import { type UIEventHandler } from 'react'; import { type ComboBoxProps as RACComboBoxProps, type ListBoxItemProps as RACListBoxItemProps } from 'react-aria-components'; import type { ApiProps, AsyncItemLoadingProps, CollectionItem, CollectionProps, CommonProps, FieldWithPlaceholderProps, Key, StringLikeChildren } from '../types.js'; /** Represents the state of the `ComboBox` component for validation purposes. */ export interface ComboBoxValidationValue { /** The selected key in the ComboBox. */ selectedKey: Key | null; /** The value of the ComboBox input. */ inputValue: string; } export interface ComboBoxProps extends CommonProps, FieldWithPlaceholderProps, CollectionProps, AsyncItemLoadingProps, ApiProps, Pick, 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'inputValue' | 'defaultInputValue' | 'autoFocus' | 'onInputChange' | '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 imperative API exposed by the `ComboBox` component. */ export interface ComboBoxApi { /** Focuses the input field and opens the list of items. */ focus: () => void; /** Selects the contents of the input field. */ select: () => void; } /** * Allows users to filter a collapsible list and select one item from it. * * See [combo box usage guidelines](https://ui.cimpress.io/components/combo-box) */ declare const _ComboBox: (props: ComboBoxProps & import("react").RefAttributes & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null; export { _ComboBox as ComboBox }; export interface ComboBoxItemProps extends Pick, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> { /** 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 `ComboBox`. */ export declare function ComboBoxItem({ children, ...props }: ComboBoxItemProps): import("react/jsx-runtime").JSX.Element; export declare namespace ComboBoxItem { var displayName: string; } export interface ComboBoxSectionProps 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 `ComboBox` into a section. */ export declare function ComboBoxSection({ title, children, items, ...props }: ComboBoxSectionProps): import("react/jsx-runtime").JSX.Element; export declare namespace ComboBoxSection { var displayName: string; } //# sourceMappingURL=combo-box.d.ts.map