lucid-ui
Version:
A UI component library from AppNexus.
80 lines (79 loc) • 2.42 kB
TypeScript
import React from 'react';
import { StandardProps } from '../../util/component-types';
export interface ILegendProps extends StandardProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
/** Custom Item element (alias for `Legend.Item`) */
Item?: React.ReactNode;
/** Determines if the legend is vertical or horizontal */
orient?: 'vertical' | 'horizontal';
/** Determines if the legend has borders */
hasBorders?: boolean;
/** Determines if the sort order of legend items is reversed or not */
isReversed?: boolean;
}
interface ILegendItemProps extends StandardProps {
/** Determines if the legend item has points */
hasPoint?: boolean;
/** Determines if the legend item has a line */
hasLine?: boolean;
/** Strings should match an existing color class unless they start with a '#'
for specific colors. E.g.:
- \`COLOR_0\`
- \`COLOR_GOOD\`
- \`'#123abc'\`
*/
color?: string;
/** Determines the kind of point */
pointKind?: number;
/** Called when a user clicks a legend \`Item\`. */
onClick?: (index: number, { event, props, }: {
event: React.MouseEvent<HTMLLIElement>;
props: ILegendItemProps;
}) => void;
}
export declare const Legend: {
(props: ILegendProps): React.ReactElement;
defaultProps: {
orient: string;
hasBorders: boolean;
isReversed: boolean;
};
displayName: string;
peek: {
description: string;
categories: string[];
};
HEIGHT: number;
propTypes: {
Item: any;
className: any;
orient: any;
hasBorders: any;
isReversed: any;
};
Item: {
(_props: ILegendItemProps): null;
displayName: string;
peek: {
description: string;
};
propName: string;
propTypes: {
children: import("prop-types").Requireable<any>;
hasPoint?: undefined;
hasLine?: undefined;
color?: undefined;
pointKind?: undefined;
onClick?: undefined;
className?: undefined;
} | {
hasPoint: any;
hasLine: any;
color: any;
pointKind: any;
onClick: any;
className: any;
children?: undefined;
};
};
};
export default Legend;