import type { ReactElement } from "react"; import React from "react"; import type { RegisterOptions } from "react-hook-form"; import { SelectRoot } from "./SelectRoot"; import { SelectTrigger } from "./components/SelectTrigger"; import { SelectLabel } from "./components/SelectLabel"; import { SelectContent } from "./components/SelectContent"; import { SelectItem, SelectItemPrefix, SelectItemSuffix } from "./components/SelectItem"; export interface SelectOption { /** * Text that shows up as the option */ readonly children: string; /** * The value that gets returned when an option is selected */ readonly value: string; } export interface SelectProps { /** * Current value of the component */ readonly value?: string; /** * Default value for when the component is uncontrolled */ readonly defaultValue?: string; /** * Adds a first option to let users select a "no value". * Placeholder item selected by default until a selection is made. */ readonly placeholder?: string; /** * Label text shown above the selection. */ readonly label?: string; /** * Help text shown below the control. */ readonly assistiveText?: string; /** * Callback that provides the new value when the selection changes */ readonly onChange?: (newValue?: string) => void; /** * Disables input selection */ readonly disabled?: boolean; /** * Indicates the current selection is invalid */ readonly invalid?: boolean; /** * VoiceOver will read this string when a user selects the element */ readonly accessibilityLabel?: string; /** * Helps users understand what will happen when they perform an action */ readonly accessibilityHint?: string; /** * Name of the input. */ readonly name?: string; /** * The options to select from */ readonly children: ReactElement[]; /** * The validations that will mark this component as invalid */ readonly validations?: RegisterOptions; /** * Used to locate this view in end-to-end tests. */ readonly testID?: string; } export declare function Select({ value, defaultValue, onChange, children, placeholder, label, assistiveText, disabled, invalid, validations, accessibilityLabel, name, testID, }: SelectProps): React.JSX.Element; export declare namespace Select { var Root: typeof SelectRoot; var Trigger: typeof SelectTrigger; var Value: ({ style, ...props }: import("../primitives").SelectPrimitiveValueProps) => React.JSX.Element; var Label: typeof SelectLabel; var Content: typeof SelectContent; var Item: typeof SelectItem; var ItemPrefix: typeof SelectItemPrefix; var ItemSuffix: typeof SelectItemSuffix; var Group: ({ ...props }: import("../primitives").SelectPrimitiveGroupProps) => React.JSX.Element; var GroupLabel: ({ style, ref, ...props }: import("../primitives").SelectPrimitiveLabelProps) => React.JSX.Element; var Separator: ({ style, ref, ...props }: import("../primitives").SelectPrimitiveSeparatorProps) => React.JSX.Element; } export declare function Option({ children }: SelectOption): React.JSX.Element;