chakra-ui-select
Version:
Chakra ui select
49 lines (48 loc) • 3.06 kB
TypeScript
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 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 SelectSingleProps<Item = any> = Omit<HTMLChakraProps<'div'>, 'onChange' | 'defaultValue'> & FormControlOptions & Pick<DownshiftProps<Item>, 'itemToString' | 'defaultIsOpen' | 'isOpen' | 'defaultHighlightedIndex'> & {
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 SelectSingle<Item = any>({ id, children, isOpen, defaultValue, defaultIsOpen, defaultHighlightedIndex, onChange, itemToString, isDisabled, ...props }: SelectSingleProps<Item>): JSX.Element;