import type { ControlSize } from "@charcuterie/tokens"; import type { ReactElement, ReactNode, RefObject } from "react"; import type { ListboxItem } from "../Listbox/Listbox.tsx"; export type ComboboxProps = { className?: string; /** Shown when nothing matches. Default "No matches". */ emptyLabel?: string; /** The error panel state (`PathPicker`). */ error?: ReactNode; /** A sticky footer hint (`LinkPicker`'s "type a path directly"). */ footer?: ReactNode; /** * Attached-input mode. Supply the consumer's own `` and * Combobox stops rendering its internal input/chip bar: it anchors the * popup to this element, drives arrow/Enter/Tab/Escape off it, and * mirrors the active option onto it for a screen reader. The consumer * owns the input's `value`/`onChange` (wire them to the controlled * `query`, which is then required) **and** `isVisible` — so a select * does NOT auto-dismiss in this mode; staying open (a folder-picker * drilling in) or closing (`onSelect` calls the consumer's own close) * is the consumer's call. Options arrive pre-filtered (as with * `onQueryChange`). Single-select only; `isMultiple` is not supported * here. */ inputRef?: RefObject; /** Enter commits the raw query as a value (`AssFieldPicker`). */ isCreatable?: boolean; /** The loading panel state. */ isLoading?: boolean; /** Multi-select, rendered as removable chips (`LanguageCodeField`). */ isMultiple?: boolean; /** Windowing. Auto-on above ~100 options when left undefined. */ isVirtualized?: boolean; isVisible: boolean; /** * How tall each option — and the search field above them — is, from * the same density-aware tokens a `Button` reads. * * It covers the search row deliberately. The owner's report was that * the panel's own field was visibly bigger than the options under it * (*"the button is huge, but the options don't match it"*), and two * sizes inside one panel is the defect. One prop drives both. * * A short window steps it back down on its own (`usePanelItemSize`). */ itemSize?: ControlSize; onDismiss: () => void; onSelect: (value: string) => void; /** * Omit to filter internally by `textValue`; supply to own the query * (a react-query search, say), in which case `options` arrives * pre-filtered. */ onQueryChange?: (query: string) => void; options: readonly ListboxItem[]; placeholder?: string; /** Controlled query; uncontrolled when absent. */ query?: string; selectedValue?: readonly string[] | string; /** * The control the popup hangs off. **Cloned, not wrapped.** Omit only * in attached-input mode (`inputRef`), where the consumer's `` * is the anchor. */ trigger?: ReactElement; }; /** * The searchable, filtering, virtualized picker — the other half of * the picker family, and the one that consolidates the fleet's * hand-rolled dropdowns. * * The ARIA contract differs from `Listbox` and the difference is * forced, not stylistic: **focus stays in the text input**, so the * active option is tracked with `aria-activedescendant`, not roving * tabindex. The input is the `role="combobox"`; the popup is a * `role="listbox"`. Arrows move the active descendant while the caret * stays put; Enter selects; Escape clears the query before it closes. * * Filtering is the consumer's when `onQueryChange` is supplied (the * `options` then arrive pre-filtered — a react-query search owns the * debounce, the request token, the cache), and internal on `textValue` * otherwise. */ export declare const Combobox: ({ className, emptyLabel, error, footer, inputRef, isCreatable, isLoading, isMultiple, isVirtualized, isVisible, itemSize: requestedItemSize, onDismiss, onQueryChange, onSelect, options, placeholder, query, selectedValue, trigger, }: ComboboxProps) => ReactNode; //# sourceMappingURL=Combobox.d.ts.map