import { default as React, FocusEventHandler, ReactNode } from 'react'; import { Placement } from '../../utils'; import { Option, OptionGroup } from './option'; export type SelectProps = { /** * className for the element. */ className?: string; /** * Maximum height of the dropdown content. */ dropdownContentMaxHeight?: string; /** * Whether the Select should fit its parent or content. * @default content */ fit?: 'content' | 'parent'; /** * Whether the Select is disabled. */ isDisabled?: boolean; /** * Whether the Select is invalid. */ isInvalid?: boolean; /** * The name of the Select, used when submitting an HTML form. */ name?: string; /** * The list of options. */ options: (T | OptionGroup)[]; /** * Temporary text that occupies the Select when it is empty. */ placeholder?: string; /** * The current value (controlled). */ value: T | undefined; /** * Handler that is called when the element receives focus. */ onFocus?: FocusEventHandler; /** * Handler that is called when the element loses focus. */ onBlur?: FocusEventHandler; /** * Placement the menu will render relative to the field */ placement?: Placement; /** * Handler that is called when a option is selected. */ onSelect(value: T): void; /** * Function to render option. Should return DropdownItem(s). */ renderOption?(option: T, state?: { isSelected: boolean; isDisabled: boolean; }): ReactNode; /** * Function to render option group. */ renderOptionGroup?(optionGroup: OptionGroup): ReactNode; /** * Render when no options are available; receives the current search value. */ renderNoOptions?(rawValue: string): ReactNode; /** * Enable a search bar inside the dropdown. Field becomes a button trigger. */ hasSearchBar?: boolean; /** * Called when the dropdown search value changes. Consumer should filter options. */ onSearch?(value: string | undefined): void; /** * The placeholder for the search bar. */ searchPlaceholder?: string; }; export declare const Select: ({ className, dropdownContentMaxHeight, fit, isDisabled, isInvalid, name, options, placeholder, value, onBlur, onFocus, onSelect, renderOption, renderOptionGroup, renderNoOptions, onSearch, searchPlaceholder, placement, hasSearchBar, ...rest }: SelectProps) => React.JSX.Element; //# sourceMappingURL=Select.d.ts.map