import { OptionProps } from 'react-select'; export interface Option { value: string; label: string; description?: string; } export interface SelectProps { /** * The name of the form field/input, used to set/track the field value in the form state. */ name: string; /** * The (accessible) label for the field - anything that can be rendered. * * You must always provide a label to ensure the field is accessible to users of * assistive technologies. */ label: React.ReactNode; /** * Available options for the select. Options *may* have a description. */ options: Option[]; /** * Indicator whether options are still being retrieved. */ isLoading?: boolean; /** * If enabled and when there is only one possible option in the `options`, * automatically select it. */ autoSelectOnlyOption?: boolean; /** * Allow multiple options selection or not. */ isMulti?: boolean; /** * Required fields get additional markup/styling to indicate this validation requirement. */ isRequired?: boolean; /** * Readonly fields get marked as such in an accessible manner. */ isReadOnly?: boolean; /** * Additional description displayed close to the field - use this to document any * validation requirements that are crucial to successfully submit the form. More * information that is contextual/background typically belongs in a tooltip. */ description?: React.ReactNode; /** * Optional tooltip to provide additional information that is not crucial but may * assist users in filling out the field correctly. */ tooltip?: React.ReactNode; /** * Formio compatibility - a select without any option chosen is represented as empty * string in Formio submission data, instead of `null` or `undefined`. The default * is to use `undefined` to remove the value from the Formik state entirely. */ noOptionSelectedValue?: undefined | ''; /** * Custom component used for the select dropdown options. */ optionComponent?: React.FC>; } declare const Select: React.FC; export default Select;