import React from 'react'; import { PropsWithMetadata } from '@highlight-ui/utils-commons'; import { Padding, SelectOption, SelectOptionType, SelectVariant } from './types'; import { SelectTrigger, SelectContent } from './Wrappers'; export declare type BaseSelectProps = PropsWithMetadata<{ /** * Class name to apply to the element */ className?: string; /** * `inline` when used outside forms and `full-width` when used inside forms. */ variant?: SelectVariant; /** * Gets called on each key input inside list's search input field */ onSearchChange?: (search: string) => void; /** * Gets called each time an option is selected */ onSelect?: (e: SelectOption[]) => void; /** * Gets called whenever the visibility of the select's list has changed */ onListVisibilityChange?: (visible: boolean) => void; /** * List of objects of generic type `T` extending `SelectOption` */ options?: SelectOption[]; /** * Initial search field value */ searchInitialValue?: string; /** * Initial or "controlled component" mode's selected options */ selectedOptions?: SelectOption[]; /** * If Select is searchable search input will render if the number of options is more or equal to this number. */ minOptionsToDisplaySearch?: number; /** * Defines wether to render the clearing x button. Will only work with the default trigger. */ isClearable?: boolean; /** * Set to `true` when you have a `multi-select` scenario */ multiple?: boolean; /** * Should the options list disappear by each selection? (applicable when `multiple = false`) */ closeOnSelect?: boolean; /** Display the loading state of the list. */ isLoading?: boolean; /** * String specifying the option type that should be rendered. Allowed values are `'single-line'`, `'multi-line'`, `'colored'` and `'avatar'`. */ optionType: SelectOptionType; /** * Search in subLabel text when `optionType` is `multi-line` (default value `false`) */ enableSubLabelSearch?: boolean; /** * Children to render inside the select's content */ children?: React.ReactNode; /** * Reset search input when the popover closes */ resetSearchOnClose?: boolean; /** * Additional padding to use when detecting collisions of the popover list of select options */ popoverCollisionPadding?: Padding; }>; declare const BaseSelect: React.ForwardRefExoticComponent<{ /** * Class name to apply to the element */ className?: string | undefined; /** * `inline` when used outside forms and `full-width` when used inside forms. */ variant?: SelectVariant | undefined; /** * Gets called on each key input inside list's search input field */ onSearchChange?: ((search: string) => void) | undefined; /** * Gets called each time an option is selected */ onSelect?: ((e: SelectOption[]) => void) | undefined; /** * Gets called whenever the visibility of the select's list has changed */ onListVisibilityChange?: ((visible: boolean) => void) | undefined; /** * List of objects of generic type `T` extending `SelectOption` */ options?: SelectOption[] | undefined; /** * Initial search field value */ searchInitialValue?: string | undefined; /** * Initial or "controlled component" mode's selected options */ selectedOptions?: SelectOption[] | undefined; /** * If Select is searchable search input will render if the number of options is more or equal to this number. */ minOptionsToDisplaySearch?: number | undefined; /** * Defines wether to render the clearing x button. Will only work with the default trigger. */ isClearable?: boolean | undefined; /** * Set to `true` when you have a `multi-select` scenario */ multiple?: boolean | undefined; /** * Should the options list disappear by each selection? (applicable when `multiple = false`) */ closeOnSelect?: boolean | undefined; /** Display the loading state of the list. */ isLoading?: boolean | undefined; /** * String specifying the option type that should be rendered. Allowed values are `'single-line'`, `'multi-line'`, `'colored'` and `'avatar'`. */ optionType: SelectOptionType; /** * Search in subLabel text when `optionType` is `multi-line` (default value `false`) */ enableSubLabelSearch?: boolean | undefined; /** * Children to render inside the select's content */ children?: React.ReactNode; /** * Reset search input when the popover closes */ resetSearchOnClose?: boolean | undefined; /** * Additional padding to use when detecting collisions of the popover list of select options */ popoverCollisionPadding?: Padding | undefined; } & { metadata?: import("@highlight-ui/utils-commons").ComponentMetadata | undefined; } & React.RefAttributes> & { Trigger: typeof SelectTrigger; Content: typeof SelectContent; }; export default BaseSelect;