UNPKG

chakra-ui-select

Version:
54 lines (53 loc) 3.21 kB
import { ChakraProps, HTMLChakraProps } from '@chakra-ui/system'; import { MaybeRenderProp } from '@chakra-ui/react-utils'; import { ControllerStateAndHelpers, DownshiftProps, GetItemPropsOptions, PropGetters } from 'downshift'; import { FormControlOptions } from '@chakra-ui/form-control'; export interface SelectValueContainerProps extends HTMLChakraProps<'div'> { } export declare function SelectValueContainer(props: SelectValueContainerProps): JSX.Element; export interface SelectIndicatorProps extends HTMLChakraProps<'div'> { } export declare const SelectIndicator: import("@chakra-ui/system").ComponentWithAs<"div", SelectIndicatorProps>; export interface ArrowIndicatorProps extends HTMLChakraProps<'div'> { } export declare const ArrowIndicator: import("@chakra-ui/system").ComponentWithAs<"div", ArrowIndicatorProps>; export declare const SelectClearIndicator: import("@chakra-ui/system").ComponentWithAs<"div", ArrowIndicatorProps>; export interface SelectControlProps extends HTMLChakraProps<'div'> { } export declare const SelectControl: import("@chakra-ui/system").ComponentWithAs<"div", SelectControlProps>; export declare type SelectButtonProps = HTMLChakraProps<'button'> & FormControlOptions; export declare const SelectButton: import("@chakra-ui/system").ComponentWithAs<"button", SelectButtonProps>; export interface SelectSearchInputProps extends HTMLChakraProps<'input'> { } export declare const SelectSearchInput: import("@chakra-ui/system").ComponentWithAs<"input", SelectSearchInputProps>; export declare type SelectOptionProps<Item = any> = Omit<GetItemPropsOptions<Item>, 'item' | 'disabled' | 'value'> & Omit<ChakraProps, 'value'> & { value: GetItemPropsOptions<Item>['item']; isDisabled?: boolean; children: MaybeRenderProp<{ isSelected?: boolean; isActive?: boolean; }>; }; export declare function SelectOption<Item = any>({ children, value, index, isDisabled, ...props }: SelectOptionProps<Item>): JSX.Element; export interface SelectMenuListProps extends HTMLChakraProps<'ul'> { } export declare const SelectMenuList: import("@chakra-ui/system").ComponentWithAs<"ul", SelectMenuListProps>; export interface SelectMenuProps extends HTMLChakraProps<'div'> { } export declare const SelectMenu: import("@chakra-ui/system").ComponentWithAs<"div", SelectMenuProps>; export declare type SelectProps<Item = any> = Omit<ChakraProps, 'onChange'> & FormControlOptions & Pick<DownshiftProps<Item>, 'itemToString' | 'defaultIsOpen' | 'getItemId'> & { isOpen?: boolean; defaultHighlightedIndex?: number; value?: Item | null; defaultValue?: Item; onChange?(selectedItem: Item | null | undefined, stateAndHelpers?: ControllerStateAndHelpers<Item>): void; children: MaybeRenderProp<{ isOpen: boolean; highlightedIndex: number | null; selectedItem: Item | null; onClose?(): void; inputValue: string | null; getLabelProps: PropGetters<Item>['getLabelProps']; }>; }; export declare function Select<Item = any>({ children, defaultValue, defaultIsOpen, onChange, itemToString, isDisabled, ...props }: SelectProps<Item>): JSX.Element;