import { HTMLAttributes, ReactNode } from 'react'; /** * Select Context Model * * @author Nazarii Baran */ type SelectContextModel = { readonly search?: string; readonly onInput: (value: string) => void; }; /** * Option type for drop-down Select component. * * @author Nazarii Baran */ type Option = { readonly label: string; readonly value: string; }; /** * Select Props * @author Nazarii Baran */ interface SelectProps extends Pick, 'className' | 'id' | 'onBlur'> { readonly menuClassName?: string; readonly optionClassName?: string; readonly controlClassName?: string; readonly value?: string; readonly label?: string; readonly error?: string; readonly multi?: boolean; readonly icon?: ReactNode; readonly options: Option[]; readonly disabled?: boolean; readonly showArrow?: boolean; readonly searchable?: boolean; readonly placeholder?: string; readonly fullOption?: boolean; readonly showClearIcon?: boolean; readonly noOptionsLabel?: string; readonly theme?: 'PRIMARY' | 'FLAT'; readonly showOptionBorder?: boolean; readonly closeMenuOnSelect?: boolean; readonly hideSelectedOption?: boolean; readonly noMatchesPlaceholder?: string; /** Defaults to false. If set to true, will try to use native UI component the physical device. */ readonly useNativeControls?: boolean; readonly onMenuToggle?: (isExpanded: boolean) => void; readonly handleClearValues?: () => void; readonly handleChange: (value: Option | string) => void; } export type { Option, SelectContextModel, SelectProps };