export interface SelectOption { readonly value: string; readonly label: string; readonly disabled?: boolean; } /** A labelled cluster of options (e.g. tools grouped by tag). */ export interface SelectGroup { readonly label: string; readonly options: readonly SelectOption[]; } /** Everything the two listbox shapes have in common. */ interface SelectSharedProps { readonly value?: string; readonly defaultValue?: string; readonly onValueChange?: (value: string) => void; readonly placeholder?: string; readonly disabled?: boolean; readonly name?: string; /** * Accessible name for the trigger when it is not wired to an enclosing * `Field`. A `Field` wins where both are given — it names the trigger from * visible text, and `aria-label` would override that native label and leave * the visible text out of the accessible name (WCAG 2.5.3). */ readonly 'aria-label'?: string; } /** The FLAT listbox: one ungrouped run of options. */ export interface SelectProps extends SelectSharedProps { readonly options: readonly SelectOption[]; } /** The GROUPED listbox: labelled clusters, each carrying its own options. */ export interface SelectGroupsProps extends SelectSharedProps { readonly groups: readonly SelectGroup[]; } /** * What `Select` ACCEPTS: exactly one of the two shapes, never both. Only one * list can be rendered, so accepting `options` alongside `groups` means * discarding every entry of the other without a word. * * The exclusion lives HERE and not on the two interfaces because both are * published plugin API and must stay extendable: `groups?: undefined` written * onto `SelectProps` makes `interface MyPicker extends SelectProps { groups: * readonly SelectGroup[] }` a TS2430, and a union cannot be `extends`-ed at all * (TS2312). */ type SelectArgs = (SelectProps & { readonly groups?: undefined; }) | (SelectGroupsProps & { readonly options?: undefined; }); export declare function Select(props: SelectArgs): import("react").JSX.Element; export {}; //# sourceMappingURL=select.d.ts.map