import { type UIEventHandler } from 'react'; import { type ListBoxItemProps as RACListBoxItemProps, type SelectProps as RACSelectProps } from 'react-aria-components'; import type { ApiProps, AsyncItemLoadingProps, CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js'; export type UNSTABLE_SelectSelectionMode = 'single' | 'multiple'; export interface SelectProps extends CommonProps, FieldProps, CollectionProps, AsyncItemLoadingProps, ApiProps, Pick, 'isDisabled' | 'isRequired' | 'isInvalid' | 'autoComplete' | 'autoFocus' | 'placeholder' | 'onFocus' | 'onBlur' | 'onOpenChange'> { /** The currently selected key in the collection (controlled). */ selectedKey?: Key | null; /** The initial selected key in the collection (uncontrolled). */ defaultSelectedKey?: Key; /** Handler that is called when the selection changes. */ onSelectionChange?: (key: Key | null) => void; /** * Whether the list of options should be virtualized. Use this as a performance optimization for large lists. * @default false */ isVirtualized?: boolean; /** Handler that is called when the list of items is scrolled. */ onScroll?: UIEventHandler; /** * The selection mode of the select. * @default 'single' */ UNSTABLE_selectionMode?: M; /** The value of the select (controlled). */ UNSTABLE_value?: M extends 'single' ? Key | null : Key[]; /** The initial value of the select (uncontrolled). */ UNSTABLE_defaultValue?: M extends 'single' ? Key : Key[]; /** Handler that is called when the value changes. */ UNSTABLE_onChange?: (key: M extends 'single' ? Key | null : Key[]) => void; /** * How the selected value is displayed. * @default 'text' */ UNSTABLE_valueDisplay?: 'text' | 'tags'; /** * Whether the list of options should be filterable. * @default false */ UNSTABLE_isFilterable?: boolean; /** The value of the filter input (controlled). */ UNSTABLE_filterValue?: string; /** The initial value of the filter input (uncontrolled). */ UNSTABLE_defaultFilterValue?: string; /** Handler that is called when the filter value changes. */ UNSTABLE_onFilterChange?: (value: string) => void; /** A custom filter function to use instead of the default filter. */ UNSTABLE_filter?: ((textValue: string, inputValue: string, node: { key: Key; value: T | null; }) => boolean) | null; UNSTABLE_isClearable?: boolean; } /** The imperative API exposed by the `Select` component. */ export interface SelectApi { /** Focuses the trigger button and opens the list of items. */ focus: () => void; } /** * Allows users to select one item from a collapsible list. * * See [select usage guidelines](https://ui.cimpress.io/components/select/). */ declare const _Select: (props: SelectProps & import("react").RefAttributes & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null; export { _Select as Select }; export interface SelectItemProps extends Pick { /** The ID of the item. Has to be unique across all sections and items. */ id?: Key; /** The content to display as the label. */ children: StringLikeChildren; } /** Renders a single list item within `Select`. */ export declare function SelectItem({ children, ...props }: SelectItemProps): import("react/jsx-runtime").JSX.Element; export declare namespace SelectItem { var displayName: string; } export interface SelectSectionProps extends CollectionProps { /** The ID of the section. Has to be unique across all sections and items. */ id?: Key; /** The content to display as the section title. */ title: string; } /** Groups list items within `Select` into a section. */ export declare function SelectSection({ title, children, items, ...props }: SelectSectionProps): import("react/jsx-runtime").JSX.Element; export declare namespace SelectSection { var displayName: string; } //# sourceMappingURL=select.d.ts.map