import { Combobox as Primitive } from "@base-ui/react/combobox"; import { type ReactNode } from "react"; import { type StateClassName } from "./class-name.ts"; export declare const ComboboxRoot: typeof Primitive.Root; export declare const ComboboxInput: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; export declare const ComboboxInputGroup: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; export declare const ComboboxTrigger: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; export declare const ComboboxClear: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; export declare const ComboboxPortal: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; export declare const ComboboxPositioner: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; export declare const ComboboxPopup: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; export declare const ComboboxList: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; export declare const ComboboxItem: import("react").NamedExoticComponent & import("react").RefAttributes>; export declare const ComboboxEmpty: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; export declare const ComboboxGroup: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; export declare const ComboboxGroupLabel: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; /** * What the input shows: the QUERY while the list is open, the selected item's LABEL while it * is closed. * * The two are different strings and swapping them is the whole job. Show the label while * typing and every keystroke is overwritten by the old selection; show the query while * closed and the field goes blank the moment focus leaves, even though a value is set. */ export declare function comboboxInputValue(open: boolean, query: string, value: T | null, getLabel: (item: T) => string): string; /** Pass text for the loading state. There is no default text or English fallback. */ type ComboboxLoadingState = { loading: boolean; loadingHint: ReactNode; } | { loading?: undefined; loadingHint?: undefined; }; export type ComboboxProps = Omit, "children" | "items" | "filteredItems" | "filter" | "value" | "defaultValue" | "multiple" | "open" | "defaultOpen" | "inputValue" | "defaultInputValue" | "onInputValueChange" | "itemToStringLabel" | "isItemEqualToValue"> & { value: T | null; /** * Items for the current query. Filtering is yours: this passes `filter={null}` to Base UI, so the * list shows exactly what you return, whether it is a server search, a fuzzy match or a bounded * page. Bound it here if it needs bounding; there is no cap in the wrapper, because a cap would * quietly truncate a list a caller meant to show whole. */ search: (query: string) => readonly T[]; /** Stable identity of an item: its React key, and how two items are compared. */ getKey: (item: T) => string; /** The item's text, shown in the input once it is picked and used for typeahead matches. */ getLabel: (item: T) => string; renderItem?: (item: T) => ReactNode; /** * Shown when the query matches nothing. Required: "no results" with no next step is a dead * end, and this is the line that offers one. */ emptyHint: ReactNode; /** Label for the clear button. Required because the button has an icon and no text. */ clearLabel: string; /** Label for the button that opens the list. Required, same reason. */ openLabel: string; /** Accessible name for the input, when no visible label points at it. */ label?: string; leadingIcon?: ReactNode; /** Classes for the input itself. */ className?: StateClassName; popupClassName?: StateClassName; inputProps?: Primitive.Input.Props; /** * Positioner props: `align`, `side`, `sideOffset`, `collisionPadding` and the stacking order. The * default `z-[60]` puts the list above the overlay layer (z-50: dialog, drawer); raise it with * `positionerProps={{ className: "z-[80]" }}` if the app stacks something higher than a dialog * above it. */ positionerProps?: Primitive.Positioner.Props; } & ComboboxLoadingState; /** * A text field that filters a list. `name`, `form`, `required`, `id` and `disabled` pass * straight through to the root, so it submits inside a `
`. * * Controlled only: the wrapper owns `open` and the input value, because those two are what * the label/query bridge is made of. */ export declare function Combobox({ value, search, getKey, getLabel, renderItem, emptyHint, loading, loadingHint, clearLabel, openLabel, label, leadingIcon, className, popupClassName, inputProps, positionerProps, onOpenChange, ...rest }: ComboboxProps): import("react").JSX.Element; export {}; //# sourceMappingURL=combobox.d.ts.map