import { type AriaAttributes, type ComponentPropsWithoutRef, type ReactElement, type ReactNode, type Ref } from 'react'; /** Agent-readiness curated handle for Select. */ export interface SelectHandle { getValue: () => string; setValue: (value: string) => void; clear: () => void; open: () => void; close: () => void; isOpen: () => boolean; } import * as RadixSelect from '@radix-ui/react-select'; import { type VariantProps } from 'class-variance-authority'; import type { OptionShape } from '../_shared/option'; import { type OptionDescriptionTone } from '../_shared/option-row'; declare const selectTriggerVariants: (props?: ({ size?: "sm" | "md" | "lg" | null | undefined; tone?: "default" | "error" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; declare const selectContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string; declare const selectItemVariants: (props?: ({ size?: "sm" | "md" | "lg" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; type SelectRootProps = ComponentPropsWithoutRef; declare const SelectRoot: { ({ open: openProp, defaultOpen, onOpenChange, ...props }: SelectRootProps): import("react/jsx-runtime").JSX.Element; displayName: string; }; type SelectTriggerProps = ComponentPropsWithoutRef & VariantProps; declare const SelectTrigger: import("react").ForwardRefExoticComponent, "ref"> & VariantProps<(props?: ({ size?: "sm" | "md" | "lg" | null | undefined; tone?: "default" | "error" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string> & import("react").RefAttributes>; declare const SelectValue: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; type SelectContentProps = ComponentPropsWithoutRef & { container?: HTMLElement | null; }; declare const SelectContent: import("react").ForwardRefExoticComponent, "ref"> & { container?: HTMLElement | null; } & import("react").RefAttributes>; declare const SelectViewport: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; type SelectItemProps = ComponentPropsWithoutRef & VariantProps & { /** Optional leading visual rendered before the item text (e.g. a Flag). */ startAdornment?: ReactNode; /** * Trailing content pinned to the inline-end of the item (e.g. a * price Badge). Unlike `startAdornment` this is NOT `aria-hidden`, * because it carries meaning rather than decoration. * * It renders INSIDE `RadixSelect.ItemText`, because Radix builds the * item's accessible name from that element alone — content placed * outside it is shown but never announced. A consequence worth * knowing: Radix mirrors `ItemText` into the closed trigger, so the * selected item's trailing content appears there too. */ endContent?: ReactNode; /** * A second line under the label, e.g. why an option is disabled. It is * the option's accessible description, outside `ItemText`, so it is * neither part of the name nor mirrored into the trigger. It does not * fade with a disabled option, so the reason stays readable. */ description?: ReactNode; /** How `description` reads: muted meta text, or the error text colour * for a line that warns. */ descriptionTone?: OptionDescriptionTone; /** * Read `description` as part of the item's accessible name, after the * label and `endContent`, instead of as its description. For a second * line that is part of what the option is (a payment the patient * commits to), not a side note (why it is disabled). */ descriptionInName?: boolean; /** Let the label wrap onto a second line; it is clipped after two. In * the trigger it stays on one line. */ wrapLabel?: boolean; /** Writing direction of the label (`OptionShape.dir`). Set on the * element that clips, so a long label keeps its start in view. */ labelDir?: OptionShape['dir']; }; declare const SelectItem: import("react").ForwardRefExoticComponent, "ref"> & VariantProps<(props?: ({ size?: "sm" | "md" | "lg" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string> & { /** Optional leading visual rendered before the item text (e.g. a Flag). */ startAdornment?: ReactNode; /** * Trailing content pinned to the inline-end of the item (e.g. a * price Badge). Unlike `startAdornment` this is NOT `aria-hidden`, * because it carries meaning rather than decoration. * * It renders INSIDE `RadixSelect.ItemText`, because Radix builds the * item's accessible name from that element alone — content placed * outside it is shown but never announced. A consequence worth * knowing: Radix mirrors `ItemText` into the closed trigger, so the * selected item's trailing content appears there too. */ endContent?: ReactNode; /** * A second line under the label, e.g. why an option is disabled. It is * the option's accessible description, outside `ItemText`, so it is * neither part of the name nor mirrored into the trigger. It does not * fade with a disabled option, so the reason stays readable. */ description?: ReactNode; /** How `description` reads: muted meta text, or the error text colour * for a line that warns. */ descriptionTone?: OptionDescriptionTone; /** * Read `description` as part of the item's accessible name, after the * label and `endContent`, instead of as its description. For a second * line that is part of what the option is (a payment the patient * commits to), not a side note (why it is disabled). */ descriptionInName?: boolean; /** Let the label wrap onto a second line; it is clipped after two. In * the trigger it stays on one line. */ wrapLabel?: boolean; /** Writing direction of the label (`OptionShape.dir`). Set on the * element that clips, so a long label keeps its start in view. */ labelDir?: OptionShape["dir"]; } & import("react").RefAttributes>; declare const SelectItemText: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; declare const SelectGroup: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; type SelectLabelProps = ComponentPropsWithoutRef; declare const SelectLabel: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; declare const SelectSeparator: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; export type SelectOption = OptionShape & { /** * Draws a line above this option, e.g. to set an action at the end of * the list apart from the values. Select only. */ separatorBefore?: boolean; /** * `'action'`: the label in the link colour, for an option that does * something (such as opening a page) rather than pick a value. The host * handles it in `onValueChange` and keeps its own value. Select only. */ intent?: 'action'; }; /** * `data-*` attributes (test ids, error anchors) and other `aria-*` * attributes reach the trigger, and win over the ones the Select sets. */ export interface SelectProps extends Omit { options: SelectOption[]; value?: T | ''; defaultValue?: T; onValueChange?: (value: T | '') => void; placeholder?: string; clearable?: boolean; disabled?: boolean; required?: boolean; name?: string; id?: string; size?: 'sm' | 'md' | 'lg'; tone?: 'default' | 'error'; 'aria-label'?: string; /** * Extra ids describing the trigger, e.g. a visually hidden reason why an * option is disabled (a disabled option cannot take focus, so its own * description is never announced). Joined after any FormField ids. */ 'aria-describedby'?: string; /** * Show the selected option's `startAdornment` in the trigger, before its * label, e.g. a channel icon. Off by default. Decorative, like the * adornment in the list. */ adornmentInTrigger?: boolean; /** * Render each option's `description` as a second line under its label, * wired as the option's accessible description. Off by default: without * it `description` is ignored, as in 1.30.0, so existing lists keep * their layout. */ showDescriptions?: boolean; /** * With `showDescriptions`, read each description as part of its option's * accessible name (after the label and `endContent`) rather than as its * description, as Combobox and MultiSelect do. For a second line that is * part of what the option is, such as a payment the patient commits to. * Off by default. */ descriptionInName?: boolean; /** * Let a long option label wrap onto a second line instead of ending in an * ellipsis. Longer still, it is clipped after two lines. The trigger * still shows the chosen label on one line. Off by default. */ wrapOptionLabels?: boolean; className?: string; /** * Portal target for the listbox. Defaults to `document.body`, which is * almost always correct. * * You do not need this to fix stacking. `--z-dropdown` and `--z-popover` * are one layer, so a Select nested inside a Popover already paints over it * by portal order (the listbox mounts last). Only pass a container when the * listbox must live inside a specific subtree — e.g. a shadow root, or a * scroll container that would otherwise clip it. */ container?: HTMLElement | null; } interface SelectComponent { (props: SelectProps & { ref?: Ref; }): ReactElement | null; displayName?: string; Root: typeof SelectRoot; Trigger: typeof SelectTrigger; Value: typeof SelectValue; Content: typeof SelectContent; Viewport: typeof SelectViewport; Item: typeof SelectItem; ItemText: typeof SelectItemText; Group: typeof SelectGroup; Label: typeof SelectLabel; Separator: typeof SelectSeparator; } export declare const Select: SelectComponent; export { SelectRoot, SelectTrigger, SelectValue, SelectContent, SelectViewport, SelectItem, SelectItemText, SelectGroup, SelectLabel, SelectSeparator, }; export { selectTriggerVariants, selectContentVariants, selectItemVariants }; export type { SelectTriggerProps, SelectContentProps, SelectItemProps, SelectLabelProps, SelectRootProps, }; export type { ReactNode }; //# sourceMappingURL=select.d.ts.map