import { Select as BaseSelect } from '@base-ui/react/select'; import { type KeyboardEventHandler, type ReactElement, type ReactNode } from 'react'; import { type ComboboxItem } from './comboboxItems.js'; import { type FieldBoxSize } from './fieldBox.js'; /** An option of a Select: the same shape as a Combobox's, so a list moves between them as is. */ export type SelectItem = ComboboxItem; type SelectValueChange = (value: Multiple extends true ? Value[] : Value, details: BaseSelect.Root.ChangeEventDetails) => void; export type SelectProps = Omit, 'items' | 'children' | 'onValueChange'> & { items: readonly SelectItem[]; /** Called with the value picked. A single Select never passes null unless an item's value is * null, such as a "None" option, so the value is always one of the items'. */ onValueChange?: SelectValueChange | undefined; placeholder?: string | undefined; /** Applied to the trigger. */ className?: string | undefined; 'aria-label'?: string | undefined; 'aria-labelledby'?: string | undefined; 'aria-describedby'?: string | undefined; 'aria-invalid'?: boolean | undefined; 'aria-required'?: boolean | undefined; /** Renders the field as this button, for compact pickers such as a toolbar pill. The * button shows the selection itself; `placeholder` and `className` then go unused. */ trigger?: ReactElement | undefined; /** A hint on the trigger button. */ triggerTooltip?: ReactNode; /** `sm` for dense places such as toolbars and table cells, `lg` for a form that stands alone, * such as sign-in. */ size?: FieldBoxSize | undefined; /** `fill` takes the width of its row, as a form's fields do; `content` takes the width of its * longest label, as in a toolbar or beside text. By default it fills inside a Field and * sizes to its content anywhere else. */ width?: 'fill' | 'content' | undefined; /** Why the field can't be changed, with `disabled`: shown as a tooltip and read after its * name. The field stays focusable, so the keyboard reaches the reason too. */ disabledReason?: string | undefined; /** The edge of the field the open list lines up with, when the list is wider. */ align?: 'start' | 'end' | undefined; /** On the trigger, such as to keep a key from a host's own shortcuts. */ onKeyDown?: KeyboardEventHandler | undefined; /** The item a person is on as they move through the open list, then undefined once it * closes, such as to preview a theme before it is chosen. */ onItemHighlighted?: ((value: Value | undefined) => void) | undefined; }; /** Picks one value, or several with `multiple`, from a short list. Use * Combobox when the list is long enough to need filtering. */ export declare function Select({ items, placeholder, className, 'aria-label': ariaLabel, 'aria-labelledby': labelledBy, 'aria-describedby': describedBy, 'aria-invalid': invalid, 'aria-required': required, trigger, triggerTooltip, size, width, disabledReason, align, onKeyDown, onItemHighlighted, onValueChange, ...rootProps }: SelectProps): import("react").JSX.Element; export {};