UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

51 lines (50 loc) 1.62 kB
import React from 'react'; import { StandardProps, Overwrite } from '../../util/component-types'; interface Item { id: string; icon?: React.ReactElement; label?: React.ReactElement; isSelected?: boolean; isPartial?: boolean; tabIndex?: number; isDisabled?: boolean; className?: string; } interface IIconSelectPropsRaw extends StandardProps { /** Items in the IconSelect group. Each item should have an id. */ items: Item[]; /** Defines the type of IconSelect box. A 'single' select will create a radio input type Item. A 'multiple' select will create a checkbox input type. */ kind: 'single' | 'multiple'; /** A function that is called with the id of the Item in the IconSelect group is clicked. */ onSelect: (id: string, { event, props, }: { event: React.MouseEvent; props: IIconSelectProps; }) => void; /** Disabled all IconSelect Items. */ isDisabled: boolean; } export declare type IIconSelectProps = Overwrite<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, IIconSelectPropsRaw>; export declare const IconSelect: { (props: IIconSelectProps): React.ReactElement; displayName: string; defaultProps: { kind: "multiple"; isDisabled: boolean; onSelect: (...args: any[]) => void; }; peek: { description: string; categories: string[]; }; propTypes: { className: any; children: any; items: any; kind: any; onSelect: any; isDisabled: any; }; }; export default IconSelect;