import React, { ReactElement, ReactNode } from 'react'; import { SelectContextType } from './SelectContext'; import { flex, box } from '../../utility/box'; import SeverityType from '../../types/SeverityType'; interface OptionBaseType { value: string; label: string; } interface OptionStateType { isSelected: boolean; } export type InputSeverityType = 'error'; export type PropsType = typeof flex.props & typeof box.props & { children?: ReactNode; placeholder?: string; value: string; feedback?: { 'data-testid'?: string; severity: SeverityType; message: string; }; options?: Array; emptyText: string; modalHeight?: string; disabled?: boolean; search?: ReactNode; 'data-testid'?: string; onChange(value: string): void; renderOption?(option: GenericOptionType, state: OptionStateType): React.JSX.Element; renderSelected?(option: GenericOptionType): React.JSX.Element; }; /** * This hooks allows you to tap into some internals of the Select. * This should only be used for advanced use-cases */ export declare const useSelect: () => SelectContextType; /** * This Select component renders a non-native select component that has the option to: * - custom render it's options * - add hierarchy to it's options * - optionally add a search bar to filter options * * If you need none of these features, please refer to the since it has * better performance on large sets and provides a better UI on mobile devices. */ declare const Select: { (props: PropsType): ReactElement; Search: React.FC>; Option: React.FunctionComponent>; OptionGroup: React.FC<{ children?: React.ReactNode; }>; }; export default Select; export { OptionBaseType, OptionStateType };