@kenos-ui/react-combobox 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.parts.ts","../src/store.ts","../src/context.ts","../src/root/ComboboxRoot.tsx","../src/label/ComboboxLabel.tsx","../src/input/ComboboxInput.tsx","../src/trigger/ComboboxTrigger.tsx","../src/collection-context.ts","../src/content/ComboboxContent.tsx","../src/list/ComboboxList.tsx","../src/item/ComboboxItem.tsx","../src/item-text/ComboboxItemText.tsx","../src/empty/ComboboxEmpty.tsx","../src/clear/ComboboxClear.tsx"],"names":["useSyncExternalStore","useCallback","createContext","useContext","useId","useMemo","useRef","useEffect","restoreFocus","jsx","useListNavigation","useSelectCollection","useFloating","useLayoutEffect","usePresence","useClickOutside","useEscapeKey","useFocusTrap","useState"],"mappings":";;;;;;;;;;;;;AAAA,IAAA,mBAAA,GAAA;AAAA,QAAA,CAAA,mBAAA,EAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,IAAA,EAAA,MAAA,IAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,IAAA,EAAA,MAAA,IAAA;AAAA,EAAA,IAAA,EAAA,MAAA,IAAA;AAAA,EAAA,OAAA,EAAA,MAAA;AAAA,CAAA,CAAA;ACOO,IAAM,gBAAN,MAAoB;AAAA,EACjB,KAAA;AAAA,EACA,SAAA,uBAAgB,GAAA,EAAc;AAAA,EAEtC,WAAA,CAAY,OAAA,GAAuC,EAAC,EAAG;AACrD,IAAA,IAAA,CAAK,KAAA,GAAQ;AAAA,MACX,IAAA,EAAM,KAAA;AAAA,MACN,UAAA,EAAY,IAAA;AAAA,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AA,CAAA,CAAE,eAAA,EAAgB;AAClB,MAAA,UAAA,EAAW;AACX,MAAA,IAAA,CAAK,QAAA,CAAS,SAAS,KAAA,EAAM;AAC7B,MAAA,OAAA,GAAU,CAAsC,CAAA;AAAA,IAClD,CAAA;AAAA,IACA,CAAC,UAAA,EAAY,OAAA,EAAS,IAAA,CAAK,QAAQ;AAAA,GACrC;AAEA,EAAA,MAAM,aAAA,GAAgBA,iBAAAA;AAAA,IACpB,CAAC,CAAA,KAA4C;AAC3C,MAAA,IAAI,CAAA,CAAE,GAAA,KAAQ,OAAA,IAAW,CAAA,CAAE,QAAQ,GAAA,EAAK;AACtC,QAAA,cAAA,CAAe,CAAC,CAAA;AAAA,MAClB;AAAA,IACF,CAAA;AAAA,IACA,CAAC,cAAc;AAAA,GACjB;AAEA,EAAA,IAAI,CAAC,QAAA,IAAY,MAAA,CAAO,QAAA,IAAY,OAAO,QAAA,EAAU;AACnD,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,uBACEQ,cAAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,QAAA,EAAU,CAAA;AAAA,MACV,YAAA,EAAW,OAAA;AAAA,MACX,OAAA,EAAS,cAAA;AAAA,MACT,SAAA,EAAW,aAAA;AAAA,MACV,GAAG;AAAA;AAAA,GACN;AAEJ","file":"index.cjs","sourcesContent":["// Parts barrel — exported as the `Combobox` namespace.\n// packages/combobox/src/index.parts.ts\n\nexport { Root } from \"./root/ComboboxRoot\";\nexport { Label } from \"./label/ComboboxLabel\";\nexport { Input } from \"./input/ComboboxInput\";\nexport { Trigger } from \"./trigger/ComboboxTrigger\";\nexport { Content } from \"./content/ComboboxContent\";\nexport { List } from \"./list/ComboboxList\";\nexport { Item } from \"./item/ComboboxItem\";\nexport { ItemText } from \"./item-text/ComboboxItemText\";\nexport { Empty } from \"./empty/ComboboxEmpty\";\nexport { Clear } from \"./clear/ComboboxClear\";","import { useSyncExternalStore, useCallback, useRef } from \"react\";\nimport type { ComboboxItemEqualFn, ComboboxStoreState, ComboboxItemRecord } from \"./types\";\n\n// ── ComboboxStore ────────────────────────────────────────────────────────────\n\ntype Listener = () => void;\n\nexport class ComboboxStore {\n private state: ComboboxStoreState;\n private listeners = new Set<Listener>();\n\n constructor(initial: Partial<ComboboxStoreState> = {}) {\n this.state = {\n open: false,\n openSource: null,\n value: null,\n inputValue: \"\",\n highlightedValue: null,\n items: new Map(),\n ...initial,\n };\n }\n\n getState(): ComboboxStoreState {\n return this.state;\n }\n\n subscribe(listener: Listener): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n private notify(): void {\n for (const listener of this.listeners) {\n listener();\n }\n }\n\n // ── Mutations ────────────────────────────────────────────────────────────\n\n setOpen(open: boolean, source: \"input\" | \"trigger\" | null = null): void {\n if (this.state.open === open) return;\n this.state = {\n ...this.state,\n open,\n openSource: open ? source : null,\n highlightedValue: open ? this.state.highlightedValue : null,\n };\n this.notify();\n }\n\n setValue(value: string | null): void {\n if (this.state.value === value) return;\n this.state = { ...this.state, value };\n this.notify();\n }\n\n setInputValue(inputValue: string): void {\n if (this.state.inputValue === inputValue) return;\n this.state = { ...this.state, inputValue };\n this.notify();\n }\n\n clearValue(): void {\n if (this.state.value === null && this.state.inputValue === \"\") return;\n this.state = { ...this.state, value: null, inputValue: \"\" };\n this.notify();\n }\n\n isSelected(value: string, comparator: ComboboxItemEqualFn): boolean {\n const current = this.state.value;\n return typeof current === \"string\" && comparator(current, value);\n }\n\n setHighlightedValue(value: string | null): void {\n if (this.state.highlightedValue === value) return;\n this.state = { ...this.state, highlightedValue: value };\n this.notify();\n }\n\n registerItem(record: ComboboxItemRecord): void {\n const next = new Map(this.state.items);\n next.set(record.value, record);\n this.state = { ...this.state, items: next };\n this.notify();\n }\n\n unregisterItem(value: string): void {\n if (!this.state.items.has(value)) return;\n const next = new Map(this.state.items);\n next.delete(value);\n this.state = { ...this.state, items: next };\n this.notify();\n }\n\n updateItemRef(value: string, ref: HTMLElement | null): void {\n const item = this.state.items.get(value);\n if (!item || item.ref === ref) return;\n const next = new Map(this.state.items);\n next.set(value, { ...item, ref });\n this.state = { ...this.state, items: next };\n // Don't notify for ref updates — avoids render cascades\n }\n}\n\n// ── useComboboxStore ─────────────────────────────────────────────────────────\n\n/**\n * Subscribe to a slice of the ComboboxStore.\n * Re-renders only when the selected slice changes (by reference).\n */\nexport function useComboboxStore<T>(\n store: ComboboxStore,\n selector: (s: ComboboxStoreState) => T,\n): T {\n return useSyncExternalStore(\n useCallback((cb) => store.subscribe(cb), [store]),\n () => selector(store.getState()),\n () => selector(store.getState()),\n );\n}\n\n// ── useComboboxStateRef ──────────────────────────────────────────────────────\n\n/**\n * Return a stable ref to the store's current state getter.\n * Useful for event handlers that need a snapshot without subscribing.\n */\nexport function useComboboxStateRef(\n store: ComboboxStore,\n): React.RefObject<ComboboxStoreState> {\n const ref = useRef(store.getState());\n ref.current = store.getState();\n return ref;\n}","import { createContext, useContext, type RefObject } from \"react\";\nimport type { SelectCollectionFilterFn } from \"@kenos-ui/utils\";\nimport type { ComboboxStore } from \"./store\";\nimport type { ComboboxItemEqualFn } from \"./types\";\n\nexport interface ComboboxRefs {\n inputRef: RefObject<HTMLInputElement | null>;\n triggerRef: RefObject<HTMLButtonElement | null>;\n contentRef: RefObject<HTMLDivElement | null>;\n listRef: RefObject<HTMLUListElement | null>;\n}\n\nexport interface ComboboxContextValue {\n store: ComboboxStore;\n ids: {\n root: string;\n label: string;\n input: string;\n trigger: string;\n content: string;\n };\n refs: ComboboxRefs;\n config: {\n disabled: boolean;\n required: boolean;\n readOnly: boolean;\n modal: boolean;\n items: Record<string, string>;\n isItemEqualToValue: ComboboxItemEqualFn;\n filter: SelectCollectionFilterFn;\n };\n isControlledOpen: boolean;\n isControlledValue: boolean;\n isControlledInputValue: boolean;\n onOpenChangeComplete: ((open: boolean) => void) | undefined;\n /** Close the listbox and restore focus to the input. */\n close: () => void;\n /** Select a value, sync input text, and close. */\n selectValue: (value: string) => void;\n /** Clear the current selection and input text. */\n clearValue: () => void;\n}\n\nexport const ComboboxContext = createContext<ComboboxContextValue | null>(null);\n\nexport function useComboboxContext(): ComboboxContextValue {\n const ctx = useContext(ComboboxContext);\n if (!ctx) {\n throw new Error(\"Combobox compound components must be rendered inside <Combobox.Root>.\");\n }\n return ctx;\n}","import React, { useId, useMemo, useRef, useEffect, useCallback } from \"react\";\nimport { restoreFocus } from \"@kenos-ui/utils\";\nimport { ComboboxStore } from \"../store\";\nimport { ComboboxContext } from \"../context\";\nimport type { ComboboxRootProps } from \"../types\";\n\nconst defaultIsItemEqualToValue = (a: string, b: string) => a === b;\n\nfunction resolveLabel(\n value: string | null,\n items: Map<string, { label: string }>,\n staticItems: Record<string, string>,\n): string {\n if (value == null) return \"\";\n return items.get(value)?.label ?? staticItems[value] ?? value;\n}\n\nexport function Root(props: ComboboxRootProps) {\n const {\n children,\n value,\n defaultValue,\n onValueChange,\n inputValue,\n defaultInputValue,\n onInputValueChange,\n open,\n defaultOpen,\n onOpenChange,\n onOpenChangeComplete,\n disabled = false,\n required = false,\n readOnly = false,\n modal = false,\n id,\n items = {},\n isItemEqualToValue = defaultIsItemEqualToValue,\n filter,\n } = props;\n\n const uid = useId();\n const prefix = id ?? `cbx-${uid.replace(/:/g, \"\")}`;\n\n const ids = useMemo(\n () => ({\n root: prefix,\n label: `${prefix}-label`,\n input: `${prefix}-input`,\n trigger: `${prefix}-trigger`,\n content: `${prefix}-content`,\n }),\n [prefix],\n );\n\n const inputRef = useRef<HTMLInputElement | null>(null);\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n const listRef = useRef<HTMLUListElement | null>(null);\n\n const isControlledValue = value !== undefined;\n const isControlledOpen = open !== undefined;\n const isControlledInputValue = inputValue !== undefined;\n\n const initialValue = isControlledValue ? (value ?? null) : (defaultValue ?? null);\n const initialInputValue = isControlledInputValue\n ? (inputValue ?? \"\")\n : (defaultInputValue ?? resolveLabel(initialValue, new Map(), items));\n\n const storeRef = useRef<ComboboxStore | null>(null);\n if (!storeRef.current) {\n storeRef.current = new ComboboxStore({\n value: initialValue,\n inputValue: initialInputValue,\n open: isControlledOpen ? (open ?? false) : (defaultOpen ?? false),\n });\n }\n const store = storeRef.current;\n\n const prevControlledValue = useRef(value);\n useEffect(() => {\n if (!isControlledValue) return;\n if (value === prevControlledValue.current) return;\n prevControlledValue.current = value;\n store.setValue(typeof value === \"string\" ? value : null);\n }, [isControlledValue, value, store]);\n\n const prevControlledInputValue = useRef(inputValue);\n useEffect(() => {\n if (!isControlledInputValue) return;\n if (inputValue === prevControlledInputValue.current) return;\n prevControlledInputValue.current = inputValue;\n store.setInputValue(inputValue ?? \"\");\n }, [isControlledInputValue, inputValue, store]);\n\n const prevControlledOpen = useRef(open);\n useEffect(() => {\n if (!isControlledOpen) return;\n if (open === prevControlledOpen.current) return;\n prevControlledOpen.current = open;\n store.setOpen(open ?? false);\n }, [isControlledOpen, open, store]);\n\n const onValueChangeRef = useRef(onValueChange);\n onValueChangeRef.current = onValueChange;\n\n const prevStoreValue = useRef(store.getState().value);\n useEffect(() => {\n return store.subscribe(() => {\n const state = store.getState();\n if (state.value !== prevStoreValue.current) {\n prevStoreValue.current = state.value;\n onValueChangeRef.current?.(\n typeof state.value === \"string\" ? state.value : null,\n );\n }\n });\n }, [store]);\n\n const onInputValueChangeRef = useRef(onInputValueChange);\n onInputValueChangeRef.current = onInputValueChange;\n\n const prevStoreInputValue = useRef(store.getState().inputValue);\n useEffect(() => {\n return store.subscribe(() => {\n const state = store.getState();\n if (state.inputValue !== prevStoreInputValue.current) {\n prevStoreInputValue.current = state.inputValue;\n onInputValueChangeRef.current?.(state.inputValue);\n }\n });\n }, [store]);\n\n const onOpenChangeRef = useRef(onOpenChange);\n onOpenChangeRef.current = onOpenChange;\n\n const prevStoreOpen = useRef(store.getState().open);\n useEffect(() => {\n return store.subscribe(() => {\n const state = store.getState();\n if (state.open !== prevStoreOpen.current) {\n prevStoreOpen.current = state.open;\n onOpenChangeRef.current?.(state.open);\n }\n });\n }, [store]);\n\n const close = useCallback(() => {\n const state = store.getState();\n if (!state.open) return;\n store.setOpen(false);\n restoreFocus({\n openSource: state.openSource === \"trigger\" ? \"trigger\" : \"input\",\n trigger: inputRef.current ?? triggerRef.current,\n });\n }, [store]);\n\n const selectValue = useCallback(\n (itemValue: string) => {\n const item = store.getState().items.get(itemValue);\n const label = item?.label ?? items[itemValue] ?? itemValue;\n store.setValue(itemValue);\n store.setInputValue(label);\n close();\n },\n [store, close, items],\n );\n\n const clearValue = useCallback(() => {\n store.clearValue();\n }, [store]);\n\n const config = useMemo(\n () => ({\n disabled,\n required,\n readOnly,\n modal,\n items,\n isItemEqualToValue,\n filter: filter ?? ((item, query) => {\n const normalized = query.trim().toLowerCase();\n if (!normalized) return true;\n return (\n item.textValue.toLowerCase().includes(normalized) ||\n item.label.toLowerCase().includes(normalized)\n );\n }),\n }),\n [disabled, required, readOnly, modal, items, isItemEqualToValue, filter],\n );\n\n const ctx = useMemo(\n () => ({\n store,\n ids,\n refs: { inputRef, triggerRef, contentRef, listRef },\n config,\n isControlledValue,\n isControlledOpen,\n isControlledInputValue,\n onOpenChangeComplete,\n close,\n selectValue,\n clearValue,\n }),\n [\n store,\n ids,\n config,\n isControlledValue,\n isControlledOpen,\n isControlledInputValue,\n onOpenChangeComplete,\n close,\n selectValue,\n clearValue,\n ],\n );\n\n return <ComboboxContext.Provider value={ctx}>{children}</ComboboxContext.Provider>;\n}","import React from \"react\";\nimport { useComboboxContext } from \"../context\";\n\nexport type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;\n\nexport function Label({ children, ...props }: LabelProps) {\n const { ids } = useComboboxContext();\n return (\n <label id={ids.label} htmlFor={ids.input} {...props}>\n {children}\n </label>\n );\n}","import React, { useCallback } from \"react\";\nimport { useListNavigation } from \"@kenos-ui/utils\";\nimport { useComboboxContext } from \"../context\";\nimport { useComboboxStore } from \"../store\";\n\nexport type InputProps = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n \"role\" | \"aria-expanded\" | \"aria-controls\" | \"aria-autocomplete\" | \"value\" | \"defaultValue\"\n>;\n\nexport function Input({\n onChange,\n onFocus,\n onKeyDown,\n disabled,\n readOnly,\n ...props\n}: InputProps) {\n const { store, ids, refs, config, close, selectValue } = useComboboxContext();\n const open = useComboboxStore(store, (s) => s.open);\n const inputValue = useComboboxStore(store, (s) => s.inputValue);\n const highlightedValue = useComboboxStore(store, (s) => s.highlightedValue);\n const items = useComboboxStore(store, (s) => s.items);\n\n const isDisabled = disabled ?? config.disabled;\n const isReadOnly = readOnly ?? config.readOnly;\n\n const filteredItems = Array.from(items.values())\n .filter((item) => config.filter(item, inputValue))\n .map((item) => ({\n value: item.value,\n disabled: item.disabled,\n }));\n\n const { onKeyDown: onNavKeyDown } = useListNavigation({\n enabled: open && !isDisabled && !isReadOnly,\n items: filteredItems,\n highlightedValue,\n onHighlight: (v) => store.setHighlightedValue(v),\n loop: true,\n });\n\n const activeDescendantId =\n open && highlightedValue != null ? `${ids.content}-opt-${highlightedValue}` : undefined;\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n if (!open) {\n store.setOpen(true, \"input\");\n }\n onNavKeyDown(e);\n onKeyDown?.(e);\n return;\n }\n\n if (e.key === \"Enter\" && open && highlightedValue != null) {\n const item = items.get(highlightedValue);\n if (item && !item.disabled) {\n e.preventDefault();\n selectValue(highlightedValue);\n }\n onKeyDown?.(e);\n return;\n }\n\n if (e.key === \"Escape\" && open) {\n e.preventDefault();\n e.stopPropagation();\n close();\n onKeyDown?.(e);\n return;\n }\n\n onKeyDown?.(e);\n },\n [\n open,\n highlightedValue,\n items,\n store,\n onNavKeyDown,\n selectValue,\n close,\n onKeyDown,\n ],\n );\n\n return (\n <input\n ref={refs.inputRef}\n type=\"text\"\n id={ids.input}\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-controls={open ? ids.content : undefined}\n aria-autocomplete=\"list\"\n aria-labelledby={ids.label ? `${ids.label} ${ids.input}` : undefined}\n aria-activedescendant={activeDescendantId}\n aria-disabled={isDisabled || isReadOnly || undefined}\n autoComplete=\"off\"\n data-disabled={isDisabled || isReadOnly ? \"true\" : undefined}\n data-open={open ? \"true\" : undefined}\n data-state={open ? \"open\" : \"closed\"}\n disabled={isDisabled}\n readOnly={isReadOnly}\n value={inputValue}\n onChange={(e) => {\n if (isDisabled || isReadOnly) return;\n store.setInputValue(e.target.value);\n store.setOpen(true, \"input\");\n onChange?.(e);\n }}\n onFocus={(e) => {\n if (!isDisabled && !isReadOnly) {\n store.setOpen(true, \"input\");\n }\n onFocus?.(e);\n }}\n onKeyDown={handleKeyDown}\n {...props}\n />\n );\n}","import React from \"react\";\nimport { useComboboxContext } from \"../context\";\nimport { useComboboxStore } from \"../store\";\n\nexport type TriggerProps = Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n \"aria-expanded\" | \"aria-controls\"\n>;\n\nexport function Trigger({ children, onClick, disabled, ...props }: TriggerProps) {\n const { store, ids, refs, config } = useComboboxContext();\n const open = useComboboxStore(store, (s) => s.open);\n\n const isDisabled = disabled ?? config.disabled;\n const isReadOnly = config.readOnly;\n\n return (\n <button\n ref={refs.triggerRef}\n type=\"button\"\n id={ids.trigger}\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-controls={open ? ids.content : undefined}\n aria-label=\"Toggle suggestions\"\n aria-disabled={isDisabled || isReadOnly || undefined}\n data-disabled={isDisabled || isReadOnly ? \"true\" : undefined}\n data-open={open ? \"true\" : undefined}\n data-state={open ? \"open\" : \"closed\"}\n disabled={isDisabled || isReadOnly}\n tabIndex={-1}\n onClick={(e) => {\n if (isDisabled || isReadOnly) return;\n store.setOpen(!open, \"trigger\");\n refs.inputRef.current?.focus();\n onClick?.(e);\n }}\n {...props}\n >\n {children}\n </button>\n );\n}","import { createContext, useContext } from \"react\";\nimport type { SelectCollectionItem } from \"@kenos-ui/utils\";\n\nexport interface ComboboxCollectionContextValue {\n filteredItems: SelectCollectionItem[];\n enabledItems: SelectCollectionItem[];\n isEmpty: boolean;\n}\n\nexport const ComboboxCollectionContext = createContext<ComboboxCollectionContextValue | null>(\n null,\n);\n\nexport function useComboboxCollection(): ComboboxCollectionContextValue {\n const ctx = useContext(ComboboxCollectionContext);\n if (!ctx) {\n throw new Error(\n \"Combobox collection context is missing. Render inside <Combobox.Content>.\",\n );\n }\n return ctx;\n}","import React, {\n useEffect,\n useCallback,\n useLayoutEffect,\n useState,\n useMemo,\n type KeyboardEvent,\n} from \"react\";\nimport {\n useFloating,\n usePresence,\n useClickOutside,\n useEscapeKey,\n useListNavigation,\n useSelectCollection,\n useFocusTrap,\n} from \"@kenos-ui/utils\";\nimport { useComboboxContext } from \"../context\";\nimport { useComboboxStore } from \"../store\";\nimport { ComboboxCollectionContext } from \"../collection-context\";\nimport type { ComboboxContentProps } from \"../types\";\n\nexport function Content({\n children,\n forceMount,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n sameWidth = false,\n lazyMount = true,\n unmountOnExit = false,\n onOpenChangeComplete: onOpenChangeCompleteProp,\n style,\n onKeyDown,\n ...props\n}: ComboboxContentProps & React.HTMLAttributes<HTMLDivElement>) {\n const {\n store,\n ids,\n refs,\n config,\n close,\n selectValue,\n onOpenChangeComplete: onOpenChangeCompleteRoot,\n } = useComboboxContext();\n const open = useComboboxStore(store, (s) => s.open);\n const highlightedValue = useComboboxStore(store, (s) => s.highlightedValue);\n const allItems = useComboboxStore(store, (s) => s.items);\n const inputValue = useComboboxStore(store, (s) => s.inputValue);\n\n const onOpenChangeComplete = onOpenChangeCompleteProp ?? onOpenChangeCompleteRoot;\n\n const collection = useSelectCollection({\n items: allItems,\n inputValue,\n filter: config.filter,\n });\n\n const collectionValue = useMemo(\n () => ({\n filteredItems: collection.items,\n enabledItems: collection.enabledItems,\n isEmpty: collection.isEmpty,\n }),\n [collection.items, collection.enabledItems, collection.isEmpty],\n );\n\n const navItems = collection.enabledItems.map((item) => ({\n value: item.value,\n disabled: item.disabled,\n }));\n\n const { setReference, setFloating, floatingStyles, isPositioned } = useFloating({\n open,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n sameWidth,\n });\n\n useLayoutEffect(() => {\n if (!open) return;\n setReference(refs.inputRef.current);\n }, [open, refs.inputRef, setReference]);\n\n const mergedRef = useCallback(\n (node: HTMLDivElement | null) => {\n refs.contentRef.current = node;\n setFloating(node);\n },\n [refs.contentRef, setFloating],\n );\n\n const { present } = usePresence({\n open,\n lazyMount,\n unmountOnExit,\n onOpenChangeComplete,\n });\n\n useClickOutside([refs.contentRef, refs.inputRef, refs.triggerRef], close, open);\n\n useEscapeKey({\n enabled: open,\n stopPropagation: true,\n onEscape: close,\n });\n\n useFocusTrap(refs.contentRef, open && config.modal);\n\n const { onKeyDown: onNavKeyDown } = useListNavigation({\n enabled: open && !config.disabled && !config.readOnly,\n items: navItems,\n highlightedValue,\n onHighlight: (v) => store.setHighlightedValue(v),\n loop: true,\n });\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n if (highlightedValue != null) {\n e.preventDefault();\n const item = allItems.get(highlightedValue);\n if (item && !item.disabled) {\n selectValue(highlightedValue);\n }\n }\n return;\n }\n onNavKeyDown(e);\n onKeyDown?.(e);\n },\n [highlightedValue, allItems, selectValue, onNavKeyDown, onKeyDown],\n );\n\n const [transitionsReady, setTransitionsReady] = useState(false);\n useEffect(() => {\n if (!open || !isPositioned) {\n setTransitionsReady(false);\n return;\n }\n const raf = requestAnimationFrame(() => setTransitionsReady(true));\n return () => cancelAnimationFrame(raf);\n }, [open, isPositioned]);\n\n useEffect(() => {\n if (!open) return;\n const state = store.getState();\n if (state.highlightedValue == null) {\n const first = navItems.find((i) => !i.disabled);\n if (first) store.setHighlightedValue(first.value);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- only run on open/filter change\n }, [open, inputValue, navItems.length]);\n\n useEffect(() => {\n if (!open || !highlightedValue) return;\n const item = allItems.get(highlightedValue);\n if (typeof item?.ref?.scrollIntoView === \"function\") {\n item.ref.scrollIntoView({ block: \"nearest\" });\n }\n }, [highlightedValue, allItems, open]);\n\n if (!present && !forceMount) return null;\n\n return (\n <ComboboxCollectionContext.Provider value={collectionValue}>\n <div\n ref={mergedRef}\n id={ids.content}\n data-state={open ? \"open\" : \"closed\"}\n data-open={open ? \"true\" : undefined}\n data-empty={collection.isEmpty ? \"true\" : undefined}\n aria-modal={config.modal ? \"true\" : undefined}\n tabIndex={-1}\n style={{\n ...floatingStyles,\n ...(!open ? { display: \"none\" } : undefined),\n ...(open && !isPositioned ? { opacity: 0, pointerEvents: \"none\" } : undefined),\n ...(open && !transitionsReady ? { transition: \"none\" } : undefined),\n ...style,\n }}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {children}\n </div>\n </ComboboxCollectionContext.Provider>\n );\n}","import React from \"react\";\nimport { useComboboxContext } from \"../context\";\n\nexport type ListProps = React.HTMLAttributes<HTMLUListElement>;\n\nexport function List({ children, ...props }: ListProps) {\n const { ids, refs } = useComboboxContext();\n\n return (\n <ul\n ref={refs.listRef}\n role=\"listbox\"\n id={`${ids.content}-list`}\n aria-labelledby={ids.label}\n {...props}\n >\n {children}\n </ul>\n );\n}","import React, { useRef, useLayoutEffect, useCallback } from \"react\";\nimport { useComboboxContext } from \"../context\";\nimport { useComboboxStore } from \"../store\";\nimport { useComboboxCollection } from \"../collection-context\";\n\nexport interface ItemProps extends React.HTMLAttributes<HTMLLIElement> {\n value: string;\n disabled?: boolean | undefined;\n textValue?: string | undefined;\n}\n\nItem.displayName = \"Combobox.Item\";\n\nexport function Item({\n value,\n disabled = false,\n textValue,\n children,\n onClick,\n onPointerMove,\n style,\n ...props\n}: ItemProps) {\n const { store, ids, config, selectValue } = useComboboxContext();\n const selectedValue = useComboboxStore(store, (s) => s.value);\n const highlightedValue = useComboboxStore(store, (s) => s.highlightedValue);\n const { filteredItems } = useComboboxCollection();\n const liRef = useRef<HTMLLIElement>(null);\n\n const isVisible = filteredItems.some((item) => item.value === value);\n const isSelected =\n typeof selectedValue === \"string\" && config.isItemEqualToValue(selectedValue, value);\n const isHighlighted = highlightedValue === value;\n const isDisabled = disabled || config.disabled || config.readOnly;\n\n useLayoutEffect(() => {\n const el = liRef.current;\n const label = textValue ?? (el?.textContent ?? value);\n\n store.registerItem({\n value,\n label,\n textValue: textValue ?? label,\n disabled: isDisabled,\n ref: el,\n });\n\n return () => store.unregisterItem(value);\n }, [value, isDisabled, store, textValue, children]);\n\n useLayoutEffect(() => {\n store.updateItemRef(value, liRef.current);\n });\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLLIElement>) => {\n if (isDisabled) return;\n selectValue(value);\n onClick?.(e);\n },\n [isDisabled, selectValue, value, onClick],\n );\n\n const handlePointerMove = useCallback(\n (e: React.PointerEvent<HTMLLIElement>) => {\n if (!isDisabled) store.setHighlightedValue(value);\n onPointerMove?.(e);\n },\n [isDisabled, store, value, onPointerMove],\n );\n\n return (\n <li\n ref={liRef}\n id={`${ids.content}-opt-${value}`}\n role=\"option\"\n aria-selected={isSelected}\n aria-disabled={isDisabled || undefined}\n aria-hidden={!isVisible ? true : undefined}\n data-highlighted={isHighlighted ? \"true\" : undefined}\n data-selected={isSelected ? \"true\" : undefined}\n data-disabled={isDisabled ? \"true\" : undefined}\n data-hidden={!isVisible ? \"true\" : undefined}\n tabIndex={-1}\n style={{\n ...style,\n display: isVisible ? style?.display : \"none\",\n }}\n onClick={handleClick}\n onPointerMove={handlePointerMove}\n {...props}\n >\n {children}\n </li>\n );\n}","import React from \"react\";\n\nexport type ItemTextProps = React.HTMLAttributes<HTMLSpanElement>;\n\n/** Text label for a Combobox.Item. */\nexport function ItemText({ children, ...props }: ItemTextProps) {\n return <span {...props}>{children}</span>;\n}","import React from \"react\";\nimport { useComboboxContext } from \"../context\";\nimport { useComboboxStore } from \"../store\";\nimport { useComboboxCollection } from \"../collection-context\";\n\nexport type EmptyProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport function Empty({ children = \"No results found\", ...props }: EmptyProps) {\n const { store } = useComboboxContext();\n const open = useComboboxStore(store, (s) => s.open);\n const { isEmpty } = useComboboxCollection();\n\n if (!open || !isEmpty) {\n return null;\n }\n\n return (\n <div role=\"status\" aria-live=\"polite\" data-empty=\"true\" {...props}>\n {children}\n </div>\n );\n}","import React, { useCallback } from \"react\";\nimport { useComboboxContext } from \"../context\";\nimport { useComboboxStore } from \"../store\";\nimport type { ComboboxClearProps } from \"../types\";\n\nexport function Clear({ onClick, ...props }: ComboboxClearProps) {\n const { store, config, clearValue, refs } = useComboboxContext();\n const value = useComboboxStore(store, (s) => s.value);\n const inputValue = useComboboxStore(store, (s) => s.inputValue);\n\n const hasValue = value != null || inputValue.length > 0;\n\n const handleActivate = useCallback(\n (e: React.SyntheticEvent) => {\n e.preventDefault();\n e.stopPropagation();\n clearValue();\n refs.inputRef.current?.focus();\n onClick?.(e as React.MouseEvent<HTMLSpanElement>);\n },\n [clearValue, onClick, refs.inputRef],\n );\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLSpanElement>) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n handleActivate(e);\n }\n },\n [handleActivate],\n );\n\n if (!hasValue || config.disabled || config.readOnly) {\n return null;\n }\n\n return (\n <span\n role=\"button\"\n tabIndex={0}\n aria-label=\"Clear\"\n onClick={handleActivate}\n onKeyDown={handleKeyDown}\n {...props}\n />\n );\n}"]}
@@ -0,0 +1,199 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React, { HTMLAttributes, ReactNode, RefObject } from 'react';
3
+ import { SelectCollectionFilterFn } from '@kenos-ui/utils';
4
+
5
+ interface ComboboxItemRecord {
6
+ value: string;
7
+ /** Displayed label (from ItemText child). */
8
+ label: string;
9
+ /** Used for filtering. Defaults to label. */
10
+ textValue: string;
11
+ disabled: boolean;
12
+ /** The DOM element for the option — needed for aria-activedescendant. */
13
+ ref: HTMLElement | null;
14
+ }
15
+ type ComboboxItemEqualFn = (a: string, b: string) => boolean;
16
+ interface ComboboxStoreState {
17
+ open: boolean;
18
+ openSource: "input" | "trigger" | null;
19
+ value: string | null;
20
+ inputValue: string;
21
+ highlightedValue: string | null;
22
+ /** Item registry: populated as Combobox.Item mounts. */
23
+ items: Map<string, ComboboxItemRecord>;
24
+ }
25
+ interface ComboboxRootProps {
26
+ children: ReactNode;
27
+ /** Controlled open state. */
28
+ open?: boolean | undefined;
29
+ defaultOpen?: boolean | undefined;
30
+ onOpenChange?: ((open: boolean) => void) | undefined;
31
+ /** Fires when open transitions finish (including presence exit). */
32
+ onOpenChangeComplete?: ((open: boolean) => void) | undefined;
33
+ /** Controlled value. */
34
+ value?: string | null | undefined;
35
+ /** Uncontrolled default value. */
36
+ defaultValue?: string | null | undefined;
37
+ onValueChange?: ((value: string | null) => void) | undefined;
38
+ /** Controlled input text. */
39
+ inputValue?: string | undefined;
40
+ /** Uncontrolled default input text. */
41
+ defaultInputValue?: string | undefined;
42
+ onInputValueChange?: ((inputValue: string) => void) | undefined;
43
+ disabled?: boolean | undefined;
44
+ required?: boolean | undefined;
45
+ readOnly?: boolean | undefined;
46
+ /**
47
+ * When true, a focus trap + aria-modal is applied.
48
+ * **Default: false** (interop-first per popup-policy).
49
+ */
50
+ modal?: boolean | undefined;
51
+ /** Unique id prefix (auto-generated when omitted). */
52
+ id?: string | undefined;
53
+ /**
54
+ * Static value→label map for display when items are not mounted.
55
+ * Registry labels take precedence when both exist.
56
+ */
57
+ items?: Record<string, string> | undefined;
58
+ /** Custom equality for value matching. Default: strict `===`. */
59
+ isItemEqualToValue?: ComboboxItemEqualFn | undefined;
60
+ /** Custom filter for type-to-filter. Default: case-insensitive substring. */
61
+ filter?: SelectCollectionFilterFn | undefined;
62
+ }
63
+ interface ComboboxContentProps {
64
+ children?: ReactNode;
65
+ /** Force content to stay in the DOM even when closed. */
66
+ forceMount?: boolean | undefined;
67
+ side?: "top" | "bottom" | "left" | "right" | undefined;
68
+ align?: "start" | "center" | "end" | undefined;
69
+ sideOffset?: number | undefined;
70
+ alignOffset?: number | undefined;
71
+ avoidCollisions?: boolean | undefined;
72
+ collisionPadding?: number | undefined;
73
+ /** Match the input's width. Default: false. */
74
+ sameWidth?: boolean | undefined;
75
+ /** Skip DOM until first open. Default: true. */
76
+ lazyMount?: boolean | undefined;
77
+ /** Remove from DOM when closed. Default: false. */
78
+ unmountOnExit?: boolean | undefined;
79
+ /**
80
+ * Fires when open transitions finish (including presence exit).
81
+ * Prefer `onOpenChangeComplete` on `<Combobox.Root>`; this prop overrides the root callback.
82
+ */
83
+ onOpenChangeComplete?: ((open: boolean) => void) | undefined;
84
+ }
85
+ interface ComboboxClearProps extends HTMLAttributes<HTMLSpanElement> {
86
+ }
87
+
88
+ declare function Root(props: ComboboxRootProps): react_jsx_runtime.JSX.Element;
89
+
90
+ type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;
91
+ declare function Label({ children, ...props }: LabelProps): react_jsx_runtime.JSX.Element;
92
+
93
+ type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "role" | "aria-expanded" | "aria-controls" | "aria-autocomplete" | "value" | "defaultValue">;
94
+ declare function Input({ onChange, onFocus, onKeyDown, disabled, readOnly, ...props }: InputProps): react_jsx_runtime.JSX.Element;
95
+
96
+ type TriggerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-expanded" | "aria-controls">;
97
+ declare function Trigger({ children, onClick, disabled, ...props }: TriggerProps): react_jsx_runtime.JSX.Element;
98
+
99
+ declare function Content({ children, forceMount, side, align, sideOffset, alignOffset, avoidCollisions, collisionPadding, sameWidth, lazyMount, unmountOnExit, onOpenChangeComplete: onOpenChangeCompleteProp, style, onKeyDown, ...props }: ComboboxContentProps & React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element | null;
100
+
101
+ type ListProps = React.HTMLAttributes<HTMLUListElement>;
102
+ declare function List({ children, ...props }: ListProps): react_jsx_runtime.JSX.Element;
103
+
104
+ interface ItemProps extends React.HTMLAttributes<HTMLLIElement> {
105
+ value: string;
106
+ disabled?: boolean | undefined;
107
+ textValue?: string | undefined;
108
+ }
109
+ declare function Item({ value, disabled, textValue, children, onClick, onPointerMove, style, ...props }: ItemProps): react_jsx_runtime.JSX.Element;
110
+ declare namespace Item {
111
+ var displayName: string;
112
+ }
113
+
114
+ type ItemTextProps = React.HTMLAttributes<HTMLSpanElement>;
115
+ /** Text label for a Combobox.Item. */
116
+ declare function ItemText({ children, ...props }: ItemTextProps): react_jsx_runtime.JSX.Element;
117
+
118
+ type EmptyProps = React.HTMLAttributes<HTMLDivElement>;
119
+ declare function Empty({ children, ...props }: EmptyProps): react_jsx_runtime.JSX.Element | null;
120
+
121
+ declare function Clear({ onClick, ...props }: ComboboxClearProps): react_jsx_runtime.JSX.Element | null;
122
+
123
+ declare const index_parts_Clear: typeof Clear;
124
+ declare const index_parts_Content: typeof Content;
125
+ declare const index_parts_Empty: typeof Empty;
126
+ declare const index_parts_Input: typeof Input;
127
+ declare const index_parts_Item: typeof Item;
128
+ declare const index_parts_ItemText: typeof ItemText;
129
+ declare const index_parts_Label: typeof Label;
130
+ declare const index_parts_List: typeof List;
131
+ declare const index_parts_Root: typeof Root;
132
+ declare const index_parts_Trigger: typeof Trigger;
133
+ declare namespace index_parts {
134
+ export { index_parts_Clear as Clear, index_parts_Content as Content, index_parts_Empty as Empty, index_parts_Input as Input, index_parts_Item as Item, index_parts_ItemText as ItemText, index_parts_Label as Label, index_parts_List as List, index_parts_Root as Root, index_parts_Trigger as Trigger };
135
+ }
136
+
137
+ type Listener = () => void;
138
+ declare class ComboboxStore {
139
+ private state;
140
+ private listeners;
141
+ constructor(initial?: Partial<ComboboxStoreState>);
142
+ getState(): ComboboxStoreState;
143
+ subscribe(listener: Listener): () => void;
144
+ private notify;
145
+ setOpen(open: boolean, source?: "input" | "trigger" | null): void;
146
+ setValue(value: string | null): void;
147
+ setInputValue(inputValue: string): void;
148
+ clearValue(): void;
149
+ isSelected(value: string, comparator: ComboboxItemEqualFn): boolean;
150
+ setHighlightedValue(value: string | null): void;
151
+ registerItem(record: ComboboxItemRecord): void;
152
+ unregisterItem(value: string): void;
153
+ updateItemRef(value: string, ref: HTMLElement | null): void;
154
+ }
155
+ /**
156
+ * Subscribe to a slice of the ComboboxStore.
157
+ * Re-renders only when the selected slice changes (by reference).
158
+ */
159
+ declare function useComboboxStore<T>(store: ComboboxStore, selector: (s: ComboboxStoreState) => T): T;
160
+
161
+ interface ComboboxRefs {
162
+ inputRef: RefObject<HTMLInputElement | null>;
163
+ triggerRef: RefObject<HTMLButtonElement | null>;
164
+ contentRef: RefObject<HTMLDivElement | null>;
165
+ listRef: RefObject<HTMLUListElement | null>;
166
+ }
167
+ interface ComboboxContextValue {
168
+ store: ComboboxStore;
169
+ ids: {
170
+ root: string;
171
+ label: string;
172
+ input: string;
173
+ trigger: string;
174
+ content: string;
175
+ };
176
+ refs: ComboboxRefs;
177
+ config: {
178
+ disabled: boolean;
179
+ required: boolean;
180
+ readOnly: boolean;
181
+ modal: boolean;
182
+ items: Record<string, string>;
183
+ isItemEqualToValue: ComboboxItemEqualFn;
184
+ filter: SelectCollectionFilterFn;
185
+ };
186
+ isControlledOpen: boolean;
187
+ isControlledValue: boolean;
188
+ isControlledInputValue: boolean;
189
+ onOpenChangeComplete: ((open: boolean) => void) | undefined;
190
+ /** Close the listbox and restore focus to the input. */
191
+ close: () => void;
192
+ /** Select a value, sync input text, and close. */
193
+ selectValue: (value: string) => void;
194
+ /** Clear the current selection and input text. */
195
+ clearValue: () => void;
196
+ }
197
+ declare function useComboboxContext(): ComboboxContextValue;
198
+
199
+ export { index_parts as Combobox, type ComboboxClearProps, type ComboboxContentProps, type ComboboxContextValue, type ComboboxItemRecord, type ComboboxRootProps, ComboboxStore, type ComboboxStoreState, useComboboxContext, useComboboxStore };
@@ -0,0 +1,199 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React, { HTMLAttributes, ReactNode, RefObject } from 'react';
3
+ import { SelectCollectionFilterFn } from '@kenos-ui/utils';
4
+
5
+ interface ComboboxItemRecord {
6
+ value: string;
7
+ /** Displayed label (from ItemText child). */
8
+ label: string;
9
+ /** Used for filtering. Defaults to label. */
10
+ textValue: string;
11
+ disabled: boolean;
12
+ /** The DOM element for the option — needed for aria-activedescendant. */
13
+ ref: HTMLElement | null;
14
+ }
15
+ type ComboboxItemEqualFn = (a: string, b: string) => boolean;
16
+ interface ComboboxStoreState {
17
+ open: boolean;
18
+ openSource: "input" | "trigger" | null;
19
+ value: string | null;
20
+ inputValue: string;
21
+ highlightedValue: string | null;
22
+ /** Item registry: populated as Combobox.Item mounts. */
23
+ items: Map<string, ComboboxItemRecord>;
24
+ }
25
+ interface ComboboxRootProps {
26
+ children: ReactNode;
27
+ /** Controlled open state. */
28
+ open?: boolean | undefined;
29
+ defaultOpen?: boolean | undefined;
30
+ onOpenChange?: ((open: boolean) => void) | undefined;
31
+ /** Fires when open transitions finish (including presence exit). */
32
+ onOpenChangeComplete?: ((open: boolean) => void) | undefined;
33
+ /** Controlled value. */
34
+ value?: string | null | undefined;
35
+ /** Uncontrolled default value. */
36
+ defaultValue?: string | null | undefined;
37
+ onValueChange?: ((value: string | null) => void) | undefined;
38
+ /** Controlled input text. */
39
+ inputValue?: string | undefined;
40
+ /** Uncontrolled default input text. */
41
+ defaultInputValue?: string | undefined;
42
+ onInputValueChange?: ((inputValue: string) => void) | undefined;
43
+ disabled?: boolean | undefined;
44
+ required?: boolean | undefined;
45
+ readOnly?: boolean | undefined;
46
+ /**
47
+ * When true, a focus trap + aria-modal is applied.
48
+ * **Default: false** (interop-first per popup-policy).
49
+ */
50
+ modal?: boolean | undefined;
51
+ /** Unique id prefix (auto-generated when omitted). */
52
+ id?: string | undefined;
53
+ /**
54
+ * Static value→label map for display when items are not mounted.
55
+ * Registry labels take precedence when both exist.
56
+ */
57
+ items?: Record<string, string> | undefined;
58
+ /** Custom equality for value matching. Default: strict `===`. */
59
+ isItemEqualToValue?: ComboboxItemEqualFn | undefined;
60
+ /** Custom filter for type-to-filter. Default: case-insensitive substring. */
61
+ filter?: SelectCollectionFilterFn | undefined;
62
+ }
63
+ interface ComboboxContentProps {
64
+ children?: ReactNode;
65
+ /** Force content to stay in the DOM even when closed. */
66
+ forceMount?: boolean | undefined;
67
+ side?: "top" | "bottom" | "left" | "right" | undefined;
68
+ align?: "start" | "center" | "end" | undefined;
69
+ sideOffset?: number | undefined;
70
+ alignOffset?: number | undefined;
71
+ avoidCollisions?: boolean | undefined;
72
+ collisionPadding?: number | undefined;
73
+ /** Match the input's width. Default: false. */
74
+ sameWidth?: boolean | undefined;
75
+ /** Skip DOM until first open. Default: true. */
76
+ lazyMount?: boolean | undefined;
77
+ /** Remove from DOM when closed. Default: false. */
78
+ unmountOnExit?: boolean | undefined;
79
+ /**
80
+ * Fires when open transitions finish (including presence exit).
81
+ * Prefer `onOpenChangeComplete` on `<Combobox.Root>`; this prop overrides the root callback.
82
+ */
83
+ onOpenChangeComplete?: ((open: boolean) => void) | undefined;
84
+ }
85
+ interface ComboboxClearProps extends HTMLAttributes<HTMLSpanElement> {
86
+ }
87
+
88
+ declare function Root(props: ComboboxRootProps): react_jsx_runtime.JSX.Element;
89
+
90
+ type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;
91
+ declare function Label({ children, ...props }: LabelProps): react_jsx_runtime.JSX.Element;
92
+
93
+ type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "role" | "aria-expanded" | "aria-controls" | "aria-autocomplete" | "value" | "defaultValue">;
94
+ declare function Input({ onChange, onFocus, onKeyDown, disabled, readOnly, ...props }: InputProps): react_jsx_runtime.JSX.Element;
95
+
96
+ type TriggerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-expanded" | "aria-controls">;
97
+ declare function Trigger({ children, onClick, disabled, ...props }: TriggerProps): react_jsx_runtime.JSX.Element;
98
+
99
+ declare function Content({ children, forceMount, side, align, sideOffset, alignOffset, avoidCollisions, collisionPadding, sameWidth, lazyMount, unmountOnExit, onOpenChangeComplete: onOpenChangeCompleteProp, style, onKeyDown, ...props }: ComboboxContentProps & React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element | null;
100
+
101
+ type ListProps = React.HTMLAttributes<HTMLUListElement>;
102
+ declare function List({ children, ...props }: ListProps): react_jsx_runtime.JSX.Element;
103
+
104
+ interface ItemProps extends React.HTMLAttributes<HTMLLIElement> {
105
+ value: string;
106
+ disabled?: boolean | undefined;
107
+ textValue?: string | undefined;
108
+ }
109
+ declare function Item({ value, disabled, textValue, children, onClick, onPointerMove, style, ...props }: ItemProps): react_jsx_runtime.JSX.Element;
110
+ declare namespace Item {
111
+ var displayName: string;
112
+ }
113
+
114
+ type ItemTextProps = React.HTMLAttributes<HTMLSpanElement>;
115
+ /** Text label for a Combobox.Item. */
116
+ declare function ItemText({ children, ...props }: ItemTextProps): react_jsx_runtime.JSX.Element;
117
+
118
+ type EmptyProps = React.HTMLAttributes<HTMLDivElement>;
119
+ declare function Empty({ children, ...props }: EmptyProps): react_jsx_runtime.JSX.Element | null;
120
+
121
+ declare function Clear({ onClick, ...props }: ComboboxClearProps): react_jsx_runtime.JSX.Element | null;
122
+
123
+ declare const index_parts_Clear: typeof Clear;
124
+ declare const index_parts_Content: typeof Content;
125
+ declare const index_parts_Empty: typeof Empty;
126
+ declare const index_parts_Input: typeof Input;
127
+ declare const index_parts_Item: typeof Item;
128
+ declare const index_parts_ItemText: typeof ItemText;
129
+ declare const index_parts_Label: typeof Label;
130
+ declare const index_parts_List: typeof List;
131
+ declare const index_parts_Root: typeof Root;
132
+ declare const index_parts_Trigger: typeof Trigger;
133
+ declare namespace index_parts {
134
+ export { index_parts_Clear as Clear, index_parts_Content as Content, index_parts_Empty as Empty, index_parts_Input as Input, index_parts_Item as Item, index_parts_ItemText as ItemText, index_parts_Label as Label, index_parts_List as List, index_parts_Root as Root, index_parts_Trigger as Trigger };
135
+ }
136
+
137
+ type Listener = () => void;
138
+ declare class ComboboxStore {
139
+ private state;
140
+ private listeners;
141
+ constructor(initial?: Partial<ComboboxStoreState>);
142
+ getState(): ComboboxStoreState;
143
+ subscribe(listener: Listener): () => void;
144
+ private notify;
145
+ setOpen(open: boolean, source?: "input" | "trigger" | null): void;
146
+ setValue(value: string | null): void;
147
+ setInputValue(inputValue: string): void;
148
+ clearValue(): void;
149
+ isSelected(value: string, comparator: ComboboxItemEqualFn): boolean;
150
+ setHighlightedValue(value: string | null): void;
151
+ registerItem(record: ComboboxItemRecord): void;
152
+ unregisterItem(value: string): void;
153
+ updateItemRef(value: string, ref: HTMLElement | null): void;
154
+ }
155
+ /**
156
+ * Subscribe to a slice of the ComboboxStore.
157
+ * Re-renders only when the selected slice changes (by reference).
158
+ */
159
+ declare function useComboboxStore<T>(store: ComboboxStore, selector: (s: ComboboxStoreState) => T): T;
160
+
161
+ interface ComboboxRefs {
162
+ inputRef: RefObject<HTMLInputElement | null>;
163
+ triggerRef: RefObject<HTMLButtonElement | null>;
164
+ contentRef: RefObject<HTMLDivElement | null>;
165
+ listRef: RefObject<HTMLUListElement | null>;
166
+ }
167
+ interface ComboboxContextValue {
168
+ store: ComboboxStore;
169
+ ids: {
170
+ root: string;
171
+ label: string;
172
+ input: string;
173
+ trigger: string;
174
+ content: string;
175
+ };
176
+ refs: ComboboxRefs;
177
+ config: {
178
+ disabled: boolean;
179
+ required: boolean;
180
+ readOnly: boolean;
181
+ modal: boolean;
182
+ items: Record<string, string>;
183
+ isItemEqualToValue: ComboboxItemEqualFn;
184
+ filter: SelectCollectionFilterFn;
185
+ };
186
+ isControlledOpen: boolean;
187
+ isControlledValue: boolean;
188
+ isControlledInputValue: boolean;
189
+ onOpenChangeComplete: ((open: boolean) => void) | undefined;
190
+ /** Close the listbox and restore focus to the input. */
191
+ close: () => void;
192
+ /** Select a value, sync input text, and close. */
193
+ selectValue: (value: string) => void;
194
+ /** Clear the current selection and input text. */
195
+ clearValue: () => void;
196
+ }
197
+ declare function useComboboxContext(): ComboboxContextValue;
198
+
199
+ export { index_parts as Combobox, type ComboboxClearProps, type ComboboxContentProps, type ComboboxContextValue, type ComboboxItemRecord, type ComboboxRootProps, ComboboxStore, type ComboboxStoreState, useComboboxContext, useComboboxStore };