@bazza-ui/react 0.1.0-canary.15 → 0.1.0-canary.17

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.
Files changed (146) hide show
  1. package/dist/combobox/index.cjs +1 -1
  2. package/dist/combobox/index.cjs.map +1 -1
  3. package/dist/combobox/index.d.ts +842 -834
  4. package/dist/combobox/index.js +1 -1
  5. package/dist/combobox/index.js.map +1 -1
  6. package/dist/command-menu/index.cjs +1 -1
  7. package/dist/command-menu/index.cjs.map +1 -1
  8. package/dist/command-menu/index.d.ts +123 -96
  9. package/dist/command-menu/index.js +1 -1
  10. package/dist/command-menu/index.js.map +1 -1
  11. package/dist/context-menu/index.cjs +1 -1
  12. package/dist/context-menu/index.cjs.map +1 -1
  13. package/dist/context-menu/index.d.ts +701 -658
  14. package/dist/context-menu/index.js +1 -1
  15. package/dist/context-menu/index.js.map +1 -1
  16. package/dist/dropdown-menu/index.cjs +1 -1
  17. package/dist/dropdown-menu/index.cjs.map +1 -1
  18. package/dist/dropdown-menu/index.d.ts +723 -680
  19. package/dist/dropdown-menu/index.js +1 -1
  20. package/dist/dropdown-menu/index.js.map +1 -1
  21. package/dist/events-DDOsDu4X.d.ts +2091 -0
  22. package/dist/index-Cabqj7qI.d.ts +2003 -0
  23. package/dist/index-D8OrKThQ.d.ts +977 -0
  24. package/dist/internal/listbox/index.cjs +1 -2
  25. package/dist/internal/listbox/index.d.ts +2 -272
  26. package/dist/internal/listbox/index.js +1 -2
  27. package/dist/internal/popup-menu/index.cjs +1 -2
  28. package/dist/internal/popup-menu/index.d.ts +4 -238
  29. package/dist/internal/popup-menu/index.js +1 -2
  30. package/dist/items-CD2hw6-3.js +2 -0
  31. package/dist/items-CD2hw6-3.js.map +1 -0
  32. package/dist/items-DYDljwnt.cjs +2 -0
  33. package/dist/items-DYDljwnt.cjs.map +1 -0
  34. package/dist/{items-B6HeFO_8.d.cts → items-ceX--VIv.d.ts} +21 -19
  35. package/dist/kbd/index.cjs +1 -1
  36. package/dist/kbd/index.cjs.map +1 -1
  37. package/dist/kbd/index.d.ts +35 -35
  38. package/dist/kbd/index.js +1 -1
  39. package/dist/kbd/index.js.map +1 -1
  40. package/dist/listbox-CnwUlLZA.js +2 -0
  41. package/dist/listbox-CnwUlLZA.js.map +1 -0
  42. package/dist/listbox-DYvJTiF6.cjs +2 -0
  43. package/dist/listbox-DYvJTiF6.cjs.map +1 -0
  44. package/dist/loaders/index.cjs +1 -1
  45. package/dist/loaders/index.cjs.map +1 -1
  46. package/dist/loaders/index.d.ts +218 -188
  47. package/dist/loaders/index.js +1 -1
  48. package/dist/loaders/index.js.map +1 -1
  49. package/dist/merge-element-props-0mpNO7ZH.cjs +2 -0
  50. package/dist/merge-element-props-0mpNO7ZH.cjs.map +1 -0
  51. package/dist/merge-element-props-PxUvRHax.js +2 -0
  52. package/dist/merge-element-props-PxUvRHax.js.map +1 -0
  53. package/dist/platform-C-sxBTRa.cjs +2 -0
  54. package/dist/platform-C-sxBTRa.cjs.map +1 -0
  55. package/dist/platform-C4_cGUkS.js +2 -0
  56. package/dist/platform-C4_cGUkS.js.map +1 -0
  57. package/dist/popup-menu-BBAzAXIe.cjs +2 -0
  58. package/dist/popup-menu-BBAzAXIe.cjs.map +1 -0
  59. package/dist/popup-menu-HmBMJEZc.js +2 -0
  60. package/dist/popup-menu-HmBMJEZc.js.map +1 -0
  61. package/dist/resolve-state-props-C-zbhdXd.cjs +2 -0
  62. package/dist/resolve-state-props-C-zbhdXd.cjs.map +1 -0
  63. package/dist/resolve-state-props-D31kizRZ.js +2 -0
  64. package/dist/resolve-state-props-D31kizRZ.js.map +1 -0
  65. package/dist/rolldown-runtime-5lHFv1cW.cjs +1 -0
  66. package/dist/rolldown-runtime-DK3Fl9T5.js +1 -0
  67. package/dist/select/index.cjs +1 -1
  68. package/dist/select/index.cjs.map +1 -1
  69. package/dist/select/index.d.ts +835 -828
  70. package/dist/select/index.js +1 -1
  71. package/dist/select/index.js.map +1 -1
  72. package/dist/suggestion-menu/index.cjs +4 -0
  73. package/dist/suggestion-menu/index.cjs.map +1 -0
  74. package/dist/suggestion-menu/index.d.ts +359 -0
  75. package/dist/suggestion-menu/index.js +4 -0
  76. package/dist/suggestion-menu/index.js.map +1 -0
  77. package/dist/types-BbN28E3_.d.ts +50 -0
  78. package/dist/video-player/index.cjs +2 -2
  79. package/dist/video-player/index.cjs.map +1 -1
  80. package/dist/video-player/index.d.ts +964 -1000
  81. package/dist/video-player/index.js +2 -2
  82. package/dist/video-player/index.js.map +1 -1
  83. package/package.json +14 -5
  84. package/dist/ListboxStore-B8oTpM57.d.cts +0 -453
  85. package/dist/ListboxStore-CV5vPUUc.d.ts +0 -453
  86. package/dist/chunk-4C666HHU.js +0 -2
  87. package/dist/chunk-4C666HHU.js.map +0 -1
  88. package/dist/chunk-5T5B5SPR.cjs +0 -2
  89. package/dist/chunk-5T5B5SPR.cjs.map +0 -1
  90. package/dist/chunk-A4Z5BY7H.js +0 -2
  91. package/dist/chunk-A4Z5BY7H.js.map +0 -1
  92. package/dist/chunk-BEWVWSAW.cjs +0 -2
  93. package/dist/chunk-BEWVWSAW.cjs.map +0 -1
  94. package/dist/chunk-EDZTZHQ4.js +0 -2
  95. package/dist/chunk-EDZTZHQ4.js.map +0 -1
  96. package/dist/chunk-IT372NHF.js +0 -2
  97. package/dist/chunk-IT372NHF.js.map +0 -1
  98. package/dist/chunk-JFEVUUPC.cjs +0 -2
  99. package/dist/chunk-JFEVUUPC.cjs.map +0 -1
  100. package/dist/chunk-KO3DXT3Y.js +0 -2
  101. package/dist/chunk-KO3DXT3Y.js.map +0 -1
  102. package/dist/chunk-LXXK4S4Q.js +0 -2
  103. package/dist/chunk-LXXK4S4Q.js.map +0 -1
  104. package/dist/chunk-M4G6J7DP.cjs +0 -2
  105. package/dist/chunk-M4G6J7DP.cjs.map +0 -1
  106. package/dist/chunk-SCDHQZFI.cjs +0 -2
  107. package/dist/chunk-SCDHQZFI.cjs.map +0 -1
  108. package/dist/chunk-XMZZ62VJ.cjs +0 -2
  109. package/dist/chunk-XMZZ62VJ.cjs.map +0 -1
  110. package/dist/combobox/index.d.cts +0 -1066
  111. package/dist/command-menu/index.d.cts +0 -154
  112. package/dist/command-score-CTJ9NV6n.d.cts +0 -23
  113. package/dist/command-score-CTJ9NV6n.d.ts +0 -23
  114. package/dist/context-menu/index.d.cts +0 -696
  115. package/dist/dropdown-menu/index.d.cts +0 -723
  116. package/dist/events-BTHQ2OoH.d.ts +0 -1860
  117. package/dist/events-DVcrtGe3.d.cts +0 -1860
  118. package/dist/input-C95v6jB0.d.cts +0 -46
  119. package/dist/input-CYweYB_i.d.ts +0 -46
  120. package/dist/internal/listbox/index.cjs.map +0 -1
  121. package/dist/internal/listbox/index.d.cts +0 -272
  122. package/dist/internal/listbox/index.js.map +0 -1
  123. package/dist/internal/popup-menu/index.cjs.map +0 -1
  124. package/dist/internal/popup-menu/index.d.cts +0 -238
  125. package/dist/internal/popup-menu/index.js.map +0 -1
  126. package/dist/items-B6HeFO_8.d.ts +0 -37
  127. package/dist/kbd/index.d.cts +0 -61
  128. package/dist/loaders/index.d.cts +0 -363
  129. package/dist/loading-C6WZGUc3.d.cts +0 -29
  130. package/dist/loading-CC4n55sR.d.ts +0 -29
  131. package/dist/resolve-B-j0eW24.d.cts +0 -406
  132. package/dist/resolve-B1F-a3P1.d.ts +0 -406
  133. package/dist/scroll-arrow-BBoKckL_.d.cts +0 -544
  134. package/dist/scroll-arrow-fl3B5sVO.d.ts +0 -544
  135. package/dist/select/index.d.cts +0 -1005
  136. package/dist/separator-Dn15rte3.d.ts +0 -275
  137. package/dist/separator-NjsBVzek.d.cts +0 -275
  138. package/dist/surface-context-CGLDpMej.d.ts +0 -14
  139. package/dist/surface-context-CN4Lb_6F.d.cts +0 -14
  140. package/dist/type-guards-BHHzjRvZ.d.cts +0 -351
  141. package/dist/type-guards-C0e_GpeY.d.ts +0 -351
  142. package/dist/types-DT4FOOa2.d.cts +0 -51
  143. package/dist/types-DT4FOOa2.d.ts +0 -51
  144. package/dist/use-listbox-item-NzZuY34-.d.cts +0 -212
  145. package/dist/use-listbox-item-NzZuY34-.d.ts +0 -212
  146. package/dist/video-player/index.d.cts +0 -1391
@@ -0,0 +1,977 @@
1
+ import { a as PopupMenuOpenChangeReason, i as PopupMenuOpenChangeEventDetails, n as HighlightChangeEventDetails } from "./events-DDOsDu4X.js";
2
+ import * as React$1 from "react";
3
+ import { ReactStore } from "@base-ui/utils/store";
4
+ //#region src/internal/listbox/contexts/group-context.d.ts
5
+ interface GroupPositional {
6
+ first?: boolean;
7
+ last?: boolean;
8
+ firstInGroup?: boolean;
9
+ lastInGroup?: boolean;
10
+ firstGroup?: boolean;
11
+ lastGroup?: boolean;
12
+ }
13
+ interface GroupContextValue {
14
+ groupId?: string;
15
+ positional?: GroupPositional;
16
+ }
17
+ declare const GroupContext: React$1.Context<GroupContextValue | null>;
18
+ declare function useGroupContext(): GroupContextValue | null;
19
+ //#endregion
20
+ //#region src/internal/listbox/contexts/item-context.d.ts
21
+ interface ItemContextValue {
22
+ /** Unique ID for this item (for DOM id attribute) */
23
+ id: string;
24
+ /** Whether the item is highlighted */
25
+ highlighted: boolean;
26
+ /** Whether the item is disabled */
27
+ disabled: boolean;
28
+ /** Keyboard shortcut for this item */
29
+ shortcut?: string;
30
+ }
31
+ declare const ItemContext: React$1.Context<ItemContextValue | null>;
32
+ declare function useItemContext(): ItemContextValue;
33
+ declare function useMaybeItemContext(): ItemContextValue | null;
34
+ //#endregion
35
+ //#region src/utils/input-modality.d.ts
36
+ /**
37
+ * How a popup/menu was opened. Mirrors Base UI's `openMethod`.
38
+ * `'keyboard'` covers any non-pointer activation.
39
+ */
40
+ type OpenMethod = 'mouse' | 'touch' | 'pen' | 'keyboard';
41
+ //#endregion
42
+ //#region src/internal/listbox/store/ListboxStore.d.ts
43
+ type FilterFn = (value: string, search: string, keywords?: string[]) => number;
44
+ type SearchNormalizer = (search: string) => string;
45
+ interface ItemRegistration {
46
+ value: string;
47
+ keywords?: string[];
48
+ groupId?: string;
49
+ disabled?: boolean;
50
+ /** Lower values are sorted earlier in score-based lists. */
51
+ forceOrder?: number;
52
+ /** Overrides computed fuzzy score in score-based lists. */
53
+ forceScore?: number;
54
+ /** Whether this item is a submenu trigger */
55
+ isSubmenuTrigger?: boolean;
56
+ /** Single character keyboard shortcut to trigger this item */
57
+ shortcut?: string;
58
+ /** Whether selecting this item should close the menu (default: true) */
59
+ closeOnClick?: boolean;
60
+ /** Whether this item can be activated via Enter/click (default: true). Non-activatable items remain highlightable. */
61
+ activatable?: boolean;
62
+ }
63
+ /** Kinds of rows that participate in positional attributes. */
64
+ type ListboxRowKind = 'item' | 'group' | 'separator' | 'empty' | 'loading';
65
+ /** A mounted row tracked for positional attributes, in DOM order. */
66
+ interface ListboxOrderedRow {
67
+ /** Unique row id (stable per component instance). */
68
+ id: string;
69
+ kind: ListboxRowKind;
70
+ /** Set for option-like rows rendered inside a Group/RadioGroup. */
71
+ groupId?: string;
72
+ }
73
+ /**
74
+ * Pre-registered item for virtualization.
75
+ * This allows the store to know about all items even when they're not mounted.
76
+ * The `value` field serves as both the unique identifier and the filtering value.
77
+ */
78
+ interface VirtualItem {
79
+ /** Value used as unique identifier and for filtering/matching */
80
+ value: string;
81
+ /** Additional keywords for filtering */
82
+ keywords?: string[];
83
+ /** Whether the item is disabled */
84
+ disabled?: boolean;
85
+ }
86
+ type HighlightSource = 'keyboard' | 'pointer' | 'auto' | null;
87
+ /**
88
+ * Describes why the consumer updated ordered items when filter={false}.
89
+ * - `replace`: list was re-ordered/replaced (default); highlight moves to the first item
90
+ * - `append`: new items were appended to the end while preserving existing order
91
+ * - `refresh`: the list changed but the search did not (e.g. async results
92
+ * arrived); keep the highlighted item while it is still present and enabled
93
+ */
94
+ type OrderedItemsUpdateReason = 'replace' | 'append' | 'refresh';
95
+ interface SetOrderedItemsOptions {
96
+ /** Why ordered items were updated. @default 'replace' */
97
+ reason?: OrderedItemsUpdateReason;
98
+ }
99
+ /**
100
+ * Refs for DOM elements used for scroll behavior.
101
+ * These are stored outside of reactive state to avoid unnecessary re-renders.
102
+ */
103
+ interface DOMRefs {
104
+ /** Ref to the semantic listbox element */
105
+ listRef: React.RefObject<HTMLElement | null>;
106
+ /** Ref to the element that owns the list's scroll position */
107
+ listScrollContainerRef: React.RefObject<HTMLElement | null>;
108
+ /** Ref to the popup (visual container) element */
109
+ popupRef: React.RefObject<HTMLElement | null>;
110
+ /** Map of item ID to ref for the item's DOM element */
111
+ itemRefs: Map<string, React.RefObject<HTMLElement | null>>;
112
+ /** Map of group ID to ref for the group's DOM element */
113
+ groupRefs: Map<string, React.RefObject<HTMLElement | null>>;
114
+ }
115
+ interface ListboxState {
116
+ /** Whether the listbox is open internally when uncontrolled */
117
+ open: boolean;
118
+ /** Controlled open prop. When defined, selectors resolve this over `open`. */
119
+ openProp: boolean | undefined;
120
+ /**
121
+ * How the listbox was most recently opened (`mouse`/`touch`/`pen`/`keyboard`).
122
+ * `null` until first opened. Retained after close (only updated on open).
123
+ */
124
+ openMethod: OpenMethod | null;
125
+ /** Current internal search query when uncontrolled */
126
+ search: string;
127
+ /** Controlled search prop. When defined, selectors resolve this over `search`. */
128
+ searchProp: string | undefined;
129
+ /** Normalized search query used for filtering and visibility checks */
130
+ normalizedSearch: string;
131
+ /** Currently highlighted item ID */
132
+ highlightedId: string | null;
133
+ /** Source of the current highlight (keyboard or pointer) */
134
+ highlightSource: HighlightSource;
135
+ /** Whether an Input is present in the Surface */
136
+ hasInput: boolean;
137
+ /** Whether the input is currently active (rendered) when hideUntilActive mode is used */
138
+ inputActive: boolean;
139
+ /** Pending search character typed before input was active */
140
+ pendingSearch: string;
141
+ /** Filtered results: item ID to score */
142
+ filteredItems: Map<string, number>;
143
+ /** Groups that have at least one visible item */
144
+ visibleGroups: Set<string>;
145
+ /** Count of visible items */
146
+ filteredCount: number;
147
+ /** Counter to trigger re-filtering when items change */
148
+ filterTrigger: number;
149
+ /** Whether virtualization mode is enabled */
150
+ virtualized: boolean;
151
+ /** Count of virtual items (from items prop) */
152
+ virtualItemsCount: number;
153
+ /**
154
+ * Rows currently mounted in the DOM, sorted by document position.
155
+ * Mounted ⇔ visible, so this is the list of visible rows.
156
+ * Immutable: replaced wholesale on every registry change so selectors recompute.
157
+ */
158
+ orderedRows: readonly ListboxOrderedRow[];
159
+ }
160
+ interface ListboxContext$1 {
161
+ /** Filter function or false to disable filtering */
162
+ filter: FilterFn | false;
163
+ /** Function used to normalize search before filtering. */
164
+ normalizeSearch: SearchNormalizer;
165
+ /** Whether to loop navigation */
166
+ loop: boolean;
167
+ /**
168
+ * Controls auto-highlighting behavior when the menu opens.
169
+ * - `true`: highlight the first item (default)
170
+ * - `false`: don't auto-highlight any item
171
+ * - `string`: highlight the item with this specific value
172
+ */
173
+ autoHighlightFirst: boolean | string;
174
+ /**
175
+ * Whether to clear search on close.
176
+ * - `true`: clear immediately when menu closes (default)
177
+ * - `false`: preserve search when menu closes
178
+ * - `'after-exit'`: clear after exit animation completes (requires Surface to call clearSearch)
179
+ */
180
+ clearSearchOnClose: boolean | 'after-exit';
181
+ /** Whether to reset list scroll position when search changes. */
182
+ resetScrollOnSearch: boolean;
183
+ /** Whether hideUntilActive mode is enabled */
184
+ hideUntilActive: boolean;
185
+ /** ID for the list element (for aria-activedescendant) */
186
+ listId: string;
187
+ /** ID for the input element */
188
+ inputId: string;
189
+ /** Map of item ID to registration data */
190
+ readonly items: Map<string, ItemRegistration>;
191
+ /** Map of group ID to set of item IDs */
192
+ readonly groups: Map<string, Set<string>>;
193
+ /** Map of item ID to onSelect callback */
194
+ readonly itemSelects: Map<string, () => void>;
195
+ /** Map of submenu trigger ID to open callback */
196
+ readonly submenuOpens: Map<string, () => void>;
197
+ /** Map of submenu trigger ID to close callback */
198
+ readonly submenuCloses: Map<string, () => void>;
199
+ /** Map of shortcut key to item ID */
200
+ readonly shortcuts: Map<string, string>;
201
+ /** Map of row ID to its mounted DOM element (positional registry). */
202
+ readonly rowElements: Map<string, HTMLElement>;
203
+ /**
204
+ * Callback when open state changes.
205
+ * The second parameter contains event details including the reason for the change.
206
+ */
207
+ onOpenChange: (open: boolean, eventDetails: PopupMenuOpenChangeEventDetails) => void;
208
+ /** Callback when search state changes */
209
+ onSearchChange: ((search: string) => void) | undefined;
210
+ /**
211
+ * Pre-registered items for virtualization.
212
+ * When provided, navigation uses this array order instead of DOM registration order.
213
+ */
214
+ virtualItems: VirtualItem[];
215
+ /**
216
+ * Consumer-provided ordered list of item values when filter={false}.
217
+ * Used to determine correct navigation/highlight order when consumer handles filtering externally.
218
+ * Must always be provided when filter={false}.
219
+ */
220
+ orderedItems: string[];
221
+ /**
222
+ * Callback when highlighted item changes.
223
+ * Useful for synchronizing with virtualizers (scrollToIndex) and other UI state.
224
+ * The third parameter contains event details including the reason for the change.
225
+ */
226
+ onHighlightChange: ((id: string | null, index: number, eventDetails: HighlightChangeEventDetails) => void) | undefined;
227
+ /**
228
+ * DOM refs for scroll behavior.
229
+ * Stored in context (not state) to avoid re-renders.
230
+ */
231
+ refs: DOMRefs;
232
+ /**
233
+ * Callback when menu close animation completes.
234
+ * Used for resetting row width measurements.
235
+ */
236
+ onCloseComplete?: () => void;
237
+ /**
238
+ * Callback when popup close transition completes.
239
+ * Used by popup-layer features that should reset only after exit animations.
240
+ */
241
+ onPopupCloseComplete?: () => void;
242
+ /**
243
+ * Last known pointer position for detecting actual pointer movement.
244
+ * Used to prevent "phantom" highlights when content shifts under a stationary pointer.
245
+ */
246
+ lastPointerPosition: {
247
+ x: number;
248
+ y: number;
249
+ } | null;
250
+ }
251
+ declare const selectors: {
252
+ open: (state: ListboxState) => boolean;
253
+ openMethod: (state: ListboxState) => OpenMethod | null;
254
+ search: (state: ListboxState) => string;
255
+ normalizedSearch: (state: ListboxState) => string;
256
+ highlightedId: (state: ListboxState) => string | null;
257
+ highlightSource: (state: ListboxState) => HighlightSource;
258
+ hasInput: (state: ListboxState) => boolean;
259
+ inputActive: (state: ListboxState) => boolean;
260
+ pendingSearch: (state: ListboxState) => string;
261
+ filteredCount: (state: ListboxState) => number;
262
+ filteredItems: (state: ListboxState) => Map<string, number>;
263
+ visibleGroups: (state: ListboxState) => Set<string>;
264
+ virtualized: (state: ListboxState) => boolean;
265
+ isHighlighted: (state: ListboxState, itemId: string) => boolean;
266
+ isGroupVisible: (state: ListboxState, groupId: string) => boolean;
267
+ isFirstRow: (state: ListboxState, rowId: string) => boolean;
268
+ isLastRow: (state: ListboxState, rowId: string) => boolean;
269
+ isFirstGroup: (state: ListboxState, rowId: string) => boolean;
270
+ isLastGroup: (state: ListboxState, rowId: string) => boolean;
271
+ isFirstInGroup: (state: ListboxState, rowId: string) => boolean;
272
+ isLastInGroup: (state: ListboxState, rowId: string) => boolean;
273
+ getItemScore: (state: ListboxState, itemId: string) => number;
274
+ hasSearchWithNoResults: (state: ListboxState) => boolean;
275
+ };
276
+ /**
277
+ * Core store for listbox-like components.
278
+ * Handles item registration, filtering, navigation, and highlight state.
279
+ *
280
+ * Used by: DropdownMenu, ContextMenu, Select, CommandMenu
281
+ */
282
+ declare class ListboxStore extends ReactStore<ListboxState, ListboxContext$1, typeof selectors> {
283
+ constructor(initialState?: Partial<ListboxState>, context?: Partial<ListboxContext$1>);
284
+ /**
285
+ * Set the open state with event details.
286
+ *
287
+ * @param open - The new open state
288
+ * @param reason - The reason for the state change (default: 'none')
289
+ * @param event - The native DOM event that triggered the change (optional)
290
+ */
291
+ setOpen(open: boolean, reason?: PopupMenuOpenChangeReason, event?: Event): void;
292
+ setSearch(search: string): void;
293
+ setSearchNormalizer(normalizeSearch: SearchNormalizer): void;
294
+ private syncNormalizedSearch;
295
+ private defaultSearchInitialized;
296
+ initializeDefaultSearch(defaultSearch: string): void;
297
+ setHighlightedId(id: string | null, cause?: HighlightSource): void;
298
+ /**
299
+ * Notify listeners about highlight changes.
300
+ * Called whenever highlightedId changes, regardless of virtualization or DOM state.
301
+ * Useful for virtualization scroll sync, analytics, or any other tracking needs.
302
+ *
303
+ * @param id - The newly highlighted item ID (or null if cleared)
304
+ * @param cause - What caused the highlight change
305
+ */
306
+ private notifyHighlightChange;
307
+ /**
308
+ * Scroll the highlighted item into view.
309
+ * Uses native scrollIntoView if the element is in the DOM.
310
+ * For virtualized lists, the onHighlightChange callback (called from setHighlightedId)
311
+ * should handle scrolling via the virtualizer.
312
+ *
313
+ * @param id - The item ID to scroll into view
314
+ */
315
+ private scrollItemIntoView;
316
+ /**
317
+ * Reveal the top of an item's group after the item has been scrolled into
318
+ * view. When keyboard navigation lands on the first visible item of a
319
+ * group, aligning the viewport to the item alone leaves the group's label
320
+ * clipped just above the viewport (e.g. when navigating upward or wrapping
321
+ * around). Scrolling up by the clipped amount aligns the viewport top with
322
+ * the group's top edge so the label is visible.
323
+ *
324
+ * No-ops when the item is not the first visible item of its group, when the
325
+ * group element is unknown or outside the list, or when the group's top is
326
+ * already visible (e.g. when navigating downward).
327
+ */
328
+ private maybeRevealGroupTop;
329
+ private scrollListToTop;
330
+ /** The element that scrolls the list: the first scrollable ancestor of the list element, or the list element itself. */
331
+ getScrollResetElement(listEl: HTMLElement): HTMLElement;
332
+ private isScrollableElement;
333
+ setHasInput(hasInput: boolean): void;
334
+ setInputActive(active: boolean): void;
335
+ setPendingSearch(search: string): void;
336
+ setHideUntilActive(enabled: boolean): void;
337
+ setVirtualized(virtualized: boolean): void;
338
+ setVirtualItems(items: VirtualItem[]): void;
339
+ /**
340
+ * Set the consumer-provided ordered items.
341
+ * Used when filter={false} and consumer controls item order/visibility.
342
+ * Must always be provided when filter={false}.
343
+ *
344
+ * @param items - Array of item IDs in display order
345
+ */
346
+ setOrderedItems(items: string[], options?: SetOrderedItemsOptions): void;
347
+ /**
348
+ * Highlights the first registered item in the ordered items (or clears the
349
+ * highlight when there is none). Uses the 'auto' source: not user-initiated,
350
+ * so submenus don't auto-open. No-op while closed.
351
+ */
352
+ highlightFirstOrderedItem(): void;
353
+ /**
354
+ * Try to auto-highlight when an item registers.
355
+ * This handles the case where orderedItems was set before items mounted.
356
+ * Only highlights if:
357
+ * - filter={false} (using orderedItems)
358
+ * - Menu is open
359
+ * - No item is currently highlighted
360
+ * - autoHighlightFirst is enabled
361
+ * - The registering item is the first in orderedItems
362
+ */
363
+ private maybeAutoHighlightOnRegister;
364
+ setOnHighlightChange(callback: ((id: string | null, index: number, eventDetails: HighlightChangeEventDetails) => void) | undefined): void;
365
+ /**
366
+ * Set the list element ref for scroll container detection.
367
+ */
368
+ setListRef(ref: React.RefObject<HTMLElement | null>): void;
369
+ /**
370
+ * Set the list scroll container ref for scroll position management.
371
+ * Use this when the semantic list element is rendered inside another
372
+ * scrollable container, such as a custom ScrollArea viewport.
373
+ */
374
+ setListScrollContainerRef(ref: React.RefObject<HTMLElement | null>): void;
375
+ /**
376
+ * Set the popup (visual container) ref. Used by popup-layer features such as
377
+ * Select's align-item-with-trigger positioning.
378
+ */
379
+ setPopupRef(ref: React.RefObject<HTMLElement | null>): void;
380
+ /**
381
+ * Register an item's DOM ref for scrollIntoView behavior.
382
+ * Returns a cleanup function.
383
+ */
384
+ registerItemRef(id: string, ref: React.RefObject<HTMLElement | null>): () => void;
385
+ /**
386
+ * Check if pointer has moved and should allow highlight.
387
+ * This prevents "phantom" highlights when content shifts under a stationary pointer
388
+ * (e.g., when search results change or menu items reorder).
389
+ *
390
+ * @param x - Current pointer X position
391
+ * @param y - Current pointer Y position
392
+ * @returns true if pointer has actually moved and highlight should be allowed
393
+ */
394
+ shouldAllowPointerHighlight(x: number, y: number): boolean;
395
+ /**
396
+ * Reset pointer position tracking.
397
+ * Call this when the menu opens or content changes significantly.
398
+ */
399
+ resetPointerPosition(): void;
400
+ /**
401
+ * Pre-register virtual items so they appear in filteredItems.
402
+ * This allows filtering to work for items that aren't mounted yet.
403
+ */
404
+ private preRegisterVirtualItems;
405
+ registerItem(id: string, registration: ItemRegistration): () => void;
406
+ /**
407
+ * Register a group. Optionally registers the group's DOM element ref,
408
+ * used for scroll positioning (e.g. revealing the group's label).
409
+ * Returns a cleanup function.
410
+ */
411
+ registerGroup(id: string, ref?: React.RefObject<HTMLElement | null>): () => void;
412
+ /**
413
+ * Register a mounted row element for positional tracking.
414
+ * Rows are kept in `state.orderedRows` sorted by DOM document position.
415
+ * Call from a layout effect once the element is mounted; the returned
416
+ * cleanup removes the row (call it when the element unmounts).
417
+ */
418
+ registerRow(id: string, element: HTMLElement, row: {
419
+ kind: ListboxRowKind;
420
+ groupId?: string;
421
+ }): () => void;
422
+ /**
423
+ * Compare two rows by DOM document position.
424
+ * Falls back to preserving current relative order when either element
425
+ * is missing or disconnected (Array.prototype.sort is stable).
426
+ */
427
+ private compareRowOrder;
428
+ registerItemSelect(id: string, onSelect: (() => void) | undefined): () => void;
429
+ registerSubmenuOpen(id: string, onOpen: (() => void) | undefined): () => void;
430
+ registerSubmenuClose(id: string, onClose: (() => void) | undefined): () => void;
431
+ /**
432
+ * Close all submenus except the one with the given ID.
433
+ * Used when hovering over a new submenu trigger to close sibling submenus.
434
+ */
435
+ closeSiblingSubmenus(exceptId: string | null): void;
436
+ highlightNext(): void;
437
+ highlightPrev(): void;
438
+ selectHighlighted(): void;
439
+ /**
440
+ * Select an item by its keyboard shortcut.
441
+ * Returns true if an item was found and selected, false otherwise.
442
+ */
443
+ selectByShortcut(key: string): boolean;
444
+ openSubmenuForHighlighted(): void;
445
+ isHighlightedSubmenuTrigger(): boolean;
446
+ /**
447
+ * Get the item registration for the highlighted item.
448
+ * Returns undefined if no item is highlighted.
449
+ */
450
+ getHighlightedItem(): ItemRegistration | undefined;
451
+ clearSearch(): void;
452
+ clearHighlight(): void;
453
+ highlightFirstItem(): void;
454
+ /**
455
+ * Apply auto-highlight based on the current context.autoHighlightFirst value.
456
+ * Called by Surface after updating the context to ensure correct value is used.
457
+ */
458
+ applyAutoHighlight(): void;
459
+ /**
460
+ * Highlight a specific item by its value.
461
+ * If the item is not visible or doesn't exist, falls back to highlighting the first item.
462
+ * Scrolls the highlighted item into view.
463
+ */
464
+ highlightItemByValue(value: string): void;
465
+ /**
466
+ * Returns whether filtering is disabled (consumer handles filtering externally).
467
+ */
468
+ isFilterDisabled(): boolean;
469
+ getVisibleItemIds(): string[];
470
+ /**
471
+ * Get the index of an item in the visible items list.
472
+ * Returns -1 if the item is not found or not visible.
473
+ */
474
+ getVisibleItemIndex(id: string): number;
475
+ /**
476
+ * Get the index of an item in the virtualItems array.
477
+ * This is used for virtualizer scrollToIndex which needs the raw array index,
478
+ * not the filtered/visible index.
479
+ * Returns -1 if not found or not in virtualized mode.
480
+ */
481
+ getVirtualItemIndex(value: string): number;
482
+ /**
483
+ * Validates and updates the highlighted item.
484
+ * This is the single source of truth for highlight management.
485
+ *
486
+ * @param options.forceFirst - Force highlight first item even if current is valid
487
+ * @param options.filteredItems - Use this map instead of state (for mid-update calls)
488
+ * @param options.newSearch - The search query for filteredItems (to detect search cleared)
489
+ */
490
+ private validateHighlight;
491
+ private recomputeFilteredItems;
492
+ static useStore(externalStore: ListboxStore | undefined, initialState?: Partial<ListboxState>, context?: Partial<ListboxContext$1>): ListboxStore;
493
+ }
494
+ //#endregion
495
+ //#region src/internal/listbox/contexts/listbox-context.d.ts
496
+ /**
497
+ * Virtualization configuration passed from Root/Submenu to Surface.
498
+ */
499
+ interface VirtualizationConfig {
500
+ /** Whether virtualization mode is enabled */
501
+ virtualized: boolean;
502
+ /** Pre-registered items for virtualization */
503
+ items: VirtualItem[];
504
+ /**
505
+ * Callback when highlighted item changes (for scroll sync).
506
+ * The third parameter contains event details including the reason for the change.
507
+ */
508
+ onHighlightChange?: (id: string | null, index: number, eventDetails: HighlightChangeEventDetails) => void;
509
+ }
510
+ interface ListboxContextValue {
511
+ /** The Listbox store instance */
512
+ store: ListboxStore;
513
+ /** Nesting depth: 0 = root menu, 1+ = submenu */
514
+ depth: number;
515
+ /** Close the entire menu tree (deepest submenu to root, sequentially) */
516
+ closeAll: () => void;
517
+ /** Register a surface (submenu) for closeAll tracking. Returns unregister function. */
518
+ registerSurface: (depth: number, setOpen: (open: boolean) => void) => () => void;
519
+ /** Virtualization configuration (if enabled) */
520
+ virtualization?: VirtualizationConfig;
521
+ }
522
+ declare const ListboxContext: React$1.Context<ListboxContextValue | null>;
523
+ declare function useListboxContext(): ListboxContextValue;
524
+ declare function useMaybeListboxContext(): ListboxContextValue | null;
525
+ //#endregion
526
+ //#region src/internal/listbox/contexts/row-width-context.d.ts
527
+ /**
528
+ * Context value for row width measurement.
529
+ * Provided by List when `measureRowWidth` is enabled.
530
+ */
531
+ interface RowWidthContextValue {
532
+ /**
533
+ * Queue a row element for width measurement.
534
+ * Call this when a row mounts or becomes visible.
535
+ *
536
+ * @param element - The DOM element to measure
537
+ * @param id - Unique identifier for this row (used to avoid re-measuring)
538
+ */
539
+ queueMeasurement: (element: HTMLElement, id: string) => void;
540
+ }
541
+ /**
542
+ * Context for row width measurement.
543
+ * Items use this to self-register for measurement.
544
+ */
545
+ declare const RowWidthContext: React$1.Context<RowWidthContextValue | null>;
546
+ /**
547
+ * Hook to get the row width context.
548
+ * Throws an error if used outside of a List with `measureRowWidth` enabled.
549
+ */
550
+ declare function useRowWidthContext(): RowWidthContextValue;
551
+ /**
552
+ * Hook to optionally get the row width context.
553
+ * Returns null if not within a List with `measureRowWidth` enabled.
554
+ * This is the preferred hook for items that should work both with and without measurement.
555
+ */
556
+ declare function useMaybeRowWidthContext(): RowWidthContextValue | null;
557
+ //#endregion
558
+ //#region src/internal/listbox/contexts/surface-context.d.ts
559
+ interface SurfaceContextValue {
560
+ /** The Listbox store instance */
561
+ store: ListboxStore;
562
+ /** Unique identifier for this surface */
563
+ surfaceId: string;
564
+ }
565
+ declare const SurfaceContext: React$1.Context<SurfaceContextValue | null>;
566
+ declare function useSurfaceContext(): SurfaceContextValue;
567
+ declare function useMaybeSurfaceContext(): SurfaceContextValue | null;
568
+ //#endregion
569
+ //#region src/internal/listbox/hooks/use-listbox-item.d.ts
570
+ /**
571
+ * Aim guard refs for submenu navigation.
572
+ * Optional - only needed for popup menus with submenus.
573
+ */
574
+ interface AimGuardRefs {
575
+ /** Whether aim guard is currently active */
576
+ aimGuardActiveRef: React$1.RefObject<boolean>;
577
+ /** The depth at which aim guard is active (null when not guarding) */
578
+ guardedDepthRef: React$1.RefObject<number | null>;
579
+ }
580
+ /**
581
+ * Parameters for the useListboxItem hook.
582
+ */
583
+ interface UseListboxItemParams {
584
+ /**
585
+ * Explicit unique identifier for this item in the store.
586
+ * Takes highest priority for item registration.
587
+ * Used by data-first APIs to ensure consistent IDs.
588
+ */
589
+ id?: string;
590
+ /**
591
+ * Unique value for this item used as identifier and for filtering.
592
+ * If not provided, will be inferred from textContent.
593
+ * Used for registration when `id` is not provided.
594
+ */
595
+ value?: string;
596
+ /**
597
+ * Additional keywords to match against when filtering.
598
+ * Useful for aliases or synonyms.
599
+ */
600
+ keywords?: string[];
601
+ /**
602
+ * Whether this item is disabled.
603
+ * Disabled items are not selectable and are skipped during keyboard navigation.
604
+ */
605
+ disabled?: boolean;
606
+ /**
607
+ * Whether this item can be activated via Enter or click.
608
+ * Non-activatable items remain highlightable.
609
+ * @default true
610
+ */
611
+ activatable?: boolean;
612
+ /**
613
+ * Whether to force render this item regardless of filter results.
614
+ * @default false
615
+ */
616
+ forceMount?: boolean;
617
+ /**
618
+ * Keyboard shortcut to trigger this item.
619
+ * When the menu is focused and the user presses this key, the item will be selected.
620
+ * Should be a single character (e.g., "1", "a", etc.).
621
+ */
622
+ shortcut?: string;
623
+ /**
624
+ * Forces this row's relative order during score-based sorting.
625
+ * Lower values appear earlier.
626
+ * @default 0
627
+ */
628
+ forceOrder?: number;
629
+ /**
630
+ * Overrides this row's computed fuzzy-match score.
631
+ * Useful for pinning or manually ranking rows in score-based views.
632
+ */
633
+ forceScore?: number;
634
+ /**
635
+ * Whether this item is a submenu trigger (for store registration).
636
+ * @default false
637
+ */
638
+ isSubmenuTrigger?: boolean;
639
+ /**
640
+ * Callback when this item is selected (via click or Enter key).
641
+ * For simple items, pass this directly. For checkbox/radio items,
642
+ * use registerSelect() to register a dynamic handler.
643
+ */
644
+ onSelect?: () => void;
645
+ /**
646
+ * Whether selecting this item should close the menu.
647
+ * @default true
648
+ */
649
+ closeOnClick?: boolean;
650
+ /**
651
+ * Callback invoked after selection occurs (via click).
652
+ * Called with the item's ID. The consumer handles any
653
+ * post-selection behavior like closing menus.
654
+ */
655
+ onAfterSelect?: (itemId: string) => void;
656
+ /**
657
+ * Children (used for text content inference when value is not provided).
658
+ */
659
+ children?: React$1.ReactNode;
660
+ /**
661
+ * Optional aim guard refs for popup menu navigation.
662
+ * When provided, pointer move events will respect the aim guard.
663
+ */
664
+ aimGuard?: AimGuardRefs;
665
+ }
666
+ /**
667
+ * Return value from the useListboxItem hook.
668
+ */
669
+ interface UseListboxItemReturn {
670
+ /** Unique ID for this item (DOM ID for aria-activedescendant) */
671
+ id: string;
672
+ /**
673
+ * Store identifier for this item.
674
+ * Use this when calling store methods like setHighlightedId, registerSubmenuOpen, etc.
675
+ * This is the `value` prop (or inferred from textContent).
676
+ */
677
+ storeId: string;
678
+ /** Ref to attach to the item element */
679
+ ref: React$1.RefObject<HTMLDivElement | null>;
680
+ /** Callback ref that tracks the mounted row element for positional attributes. Merge into the rendered element's ref. */
681
+ rowRef: (element: HTMLElement | null) => void;
682
+ /** Positional state among visible rows (all false in virtualized mode). */
683
+ positional: {
684
+ first: boolean;
685
+ last: boolean;
686
+ firstInGroup: boolean;
687
+ lastInGroup: boolean;
688
+ };
689
+ /** Whether item is currently highlighted */
690
+ isHighlighted: boolean;
691
+ /** Whether item should be rendered (passes filter) */
692
+ isVisible: boolean;
693
+ /** Context value to provide to children via ItemContext.Provider */
694
+ contextValue: ItemContextValue;
695
+ /**
696
+ * Event handlers to spread on the element.
697
+ * These handle click, pointer move, and pointer down events.
698
+ */
699
+ handlers: {
700
+ onClick: React$1.MouseEventHandler<HTMLDivElement>;
701
+ onPointerMove: React$1.PointerEventHandler<HTMLDivElement>;
702
+ onPointerDown: React$1.PointerEventHandler<HTMLDivElement>;
703
+ };
704
+ /**
705
+ * Register a custom onSelect handler.
706
+ * This is useful for checkbox/radio items where the select behavior
707
+ * needs to be customized (e.g., toggle checked state).
708
+ * Returns an unregister function.
709
+ */
710
+ registerSelect: (handler: (() => void) | undefined) => () => void;
711
+ }
712
+ /**
713
+ * Hook that provides all shared logic for navigatable/highlightable listbox items.
714
+ *
715
+ * This hook handles:
716
+ * - Item registration with the listbox store
717
+ * - Highlight state management (keyboard and pointer)
718
+ * - Filter/search visibility
719
+ * - Scroll into view on keyboard navigation
720
+ * - Click, pointer move, and pointer down event handlers
721
+ * - Optional aim guard integration (for submenu navigation)
722
+ *
723
+ * @example
724
+ * ```tsx
725
+ * function CustomItem(props) {
726
+ * const item = useListboxItem({
727
+ * value: props.value,
728
+ * disabled: props.disabled,
729
+ * onSelect: props.onSelect,
730
+ * })
731
+ *
732
+ * if (!item.isVisible) return null
733
+ *
734
+ * return (
735
+ * <ItemContext.Provider value={item.contextValue}>
736
+ * <div
737
+ * ref={item.ref}
738
+ * {...item.handlers}
739
+ * data-highlighted={item.isHighlighted || undefined}
740
+ * >
741
+ * {props.children}
742
+ * </div>
743
+ * </ItemContext.Provider>
744
+ * )
745
+ * }
746
+ * ```
747
+ */
748
+ declare function useListboxItem(params: UseListboxItemParams): UseListboxItemReturn;
749
+ //#endregion
750
+ //#region src/internal/listbox/hooks/use-listbox-keyboard.d.ts
751
+ /**
752
+ * Focus owner interface for keyboard handling.
753
+ * Optional - only needed for popup menus with multiple surfaces.
754
+ */
755
+ interface FocusOwnerInterface {
756
+ /** Check if a surface is the current owner */
757
+ useState: (selector: 'isOwner', surfaceId: string) => boolean;
758
+ /** Set the owner surface ID */
759
+ setOwnerId: (id: string | null) => void;
760
+ }
761
+ /**
762
+ * Submenu context interface for keyboard handling.
763
+ * Optional - only needed for popup menus with submenus.
764
+ */
765
+ interface SubmenuInterface {
766
+ /** Close this submenu */
767
+ setOpen: (open: boolean) => void;
768
+ /** Parent surface ID for focus transfer */
769
+ parentSurfaceId: string;
770
+ /** Whether Escape closes the root menu or just this submenu */
771
+ closeRootOnEsc?: boolean;
772
+ }
773
+ /**
774
+ * Subpage context interface for keyboard handling.
775
+ * Optional - only needed for popup menus with in-popup subpage navigation.
776
+ */
777
+ interface SubpageInterface {
778
+ /** Pop one page from the current stack. */
779
+ goBack: () => boolean;
780
+ /** Parent surface ID for focus transfer after back navigation. */
781
+ parentSurfaceId: string | null;
782
+ /** Whether Escape closes the root menu instead of navigating back. */
783
+ closeRootOnEsc?: boolean;
784
+ }
785
+ interface UseListboxKeyboardParams {
786
+ /** The Listbox store instance */
787
+ store: ListboxStore;
788
+ /** Unique identifier for this surface */
789
+ surfaceId: string;
790
+ /** Whether keyboard handling is enabled */
791
+ enabled: boolean;
792
+ /** User's onKeyDown handler to compose with */
793
+ onKeyDown?: React$1.KeyboardEventHandler;
794
+ /**
795
+ * Callback when an item is selected via keyboard (Enter or shortcut).
796
+ * Called with selection details. The consumer handles any
797
+ * post-selection behavior like closing menus.
798
+ */
799
+ onSelect?: (details: {
800
+ itemId: string | null;
801
+ closeOnClick: boolean;
802
+ }) => void;
803
+ /**
804
+ * Callback to close the entire menu tree from the root.
805
+ * Used when Escape is pressed and closeRootOnEsc is true (default).
806
+ */
807
+ closeAll: () => void;
808
+ /** The FocusOwner store for managing focus ownership (optional) */
809
+ focusOwner?: FocusOwnerInterface;
810
+ /** Menu depth (0 for root, >0 for submenus) - defaults to 0 */
811
+ depth?: number;
812
+ /** Submenu context for ArrowLeft navigation back to parent (optional) */
813
+ submenuContext?: SubmenuInterface | null;
814
+ /** Subpage context for ArrowLeft/Ctrl+H navigation back (optional) */
815
+ subpageContext?: SubpageInterface | null;
816
+ /**
817
+ * Whether to enable type-to-search behavior.
818
+ * When true, printable characters will activate the input and set pending search.
819
+ * Used by List when hideUntilActive is enabled and input is not yet active.
820
+ * @default false
821
+ */
822
+ enableTypeToSearch?: boolean;
823
+ /**
824
+ * Whether to skip the focus owner check.
825
+ * When true, keyboard handling will work based on `enabled` prop alone,
826
+ * ignoring focus ownership. Useful for Combobox where the input is outside
827
+ * the Surface but should still handle keyboard navigation.
828
+ * @default false
829
+ */
830
+ skipFocusOwnerCheck?: boolean;
831
+ }
832
+ interface UseListboxKeyboardReturn {
833
+ /** Keyboard event handler to attach to the element */
834
+ handleKeyDown: React$1.KeyboardEventHandler;
835
+ }
836
+ /**
837
+ * Centralized keyboard navigation hook for listbox-like components.
838
+ * Handles arrow navigation, vim bindings, submenu open/close, and selection.
839
+ *
840
+ * This hook can be used standalone (for simple listboxes like Select/Command)
841
+ * or with focus owner and submenu support (for popup menus with nested menus).
842
+ */
843
+ declare function useListboxKeyboard(params: UseListboxKeyboardParams): UseListboxKeyboardReturn;
844
+ //#endregion
845
+ //#region src/internal/listbox/hooks/use-sticky-row-width.d.ts
846
+ interface UseStickyRowWidthOptions {
847
+ /**
848
+ * Ref to the list container element.
849
+ * Used to measure row widths and as a fallback target for the CSS variable.
850
+ */
851
+ listRef: React$1.RefObject<HTMLElement | null>;
852
+ /**
853
+ * Optional ref to the element where `--row-width` CSS variable should be applied.
854
+ * If not provided, uses the listRef element.
855
+ * Useful for applying the variable to a parent Popup element.
856
+ */
857
+ targetRef?: React$1.RefObject<HTMLElement | null>;
858
+ /**
859
+ * Optional maximum width cap in pixels.
860
+ * The measured width will never exceed this value.
861
+ */
862
+ maxWidth?: number;
863
+ /**
864
+ * Whether measurement is enabled.
865
+ * @default true
866
+ */
867
+ enabled?: boolean;
868
+ }
869
+ interface UseStickyRowWidthReturn {
870
+ /**
871
+ * Queue a row element for measurement.
872
+ * The element's natural width will be measured and tracked.
873
+ * Call this when a row mounts or becomes visible.
874
+ */
875
+ queueMeasurement: (element: HTMLElement, id: string) => void;
876
+ /**
877
+ * Reset all measurements.
878
+ * Call this when the menu closes to start fresh on next open.
879
+ */
880
+ resetMeasurements: () => void;
881
+ /**
882
+ * Clear the set of measured IDs without resetting the sticky max width.
883
+ * Call this when row content changes for the same IDs (e.g. browse rows
884
+ * re-render as breadcrumb rows when deep search toggles) so rows are
885
+ * re-measured. The width still only grows, never shrinks.
886
+ */
887
+ clearMeasuredIds: () => void;
888
+ }
889
+ /**
890
+ * Hook that measures row widths and maintains a sticky maximum width.
891
+ *
892
+ * This is useful for virtualized lists where the popup width should adapt
893
+ * to the content but never shrink as the user scrolls through items.
894
+ *
895
+ * The hook:
896
+ * 1. Measures each row's natural width (using `max-content`)
897
+ * 2. Tracks the maximum width seen across all rows
898
+ * 3. Applies `--row-width` CSS variable to the target element
899
+ * 4. Only grows the width, never shrinks (until reset)
900
+ *
901
+ * @example
902
+ * ```tsx
903
+ * const { queueMeasurement, resetMeasurements } = useStickyRowWidth({
904
+ * listRef: myListRef,
905
+ * maxWidth: 500,
906
+ * })
907
+ *
908
+ * // Queue items for measurement
909
+ * useLayoutEffect(() => {
910
+ * if (itemRef.current) {
911
+ * queueMeasurement(itemRef.current, itemId)
912
+ * }
913
+ * }, [itemId])
914
+ *
915
+ * // Reset on menu close
916
+ * useEffect(() => {
917
+ * if (!isOpen) {
918
+ * resetMeasurements()
919
+ * }
920
+ * }, [isOpen])
921
+ * ```
922
+ */
923
+ declare function useStickyRowWidth(options: UseStickyRowWidthOptions): UseStickyRowWidthReturn;
924
+ //#endregion
925
+ //#region src/internal/listbox/utils/command-score.d.ts
926
+ /**
927
+ * Fuzzy matching algorithm for command palette-style filtering.
928
+ * Vendored from cmdk (https://github.com/pacocoursey/cmdk)
929
+ *
930
+ * The scores are arranged so that a continuous match of characters will
931
+ * result in a total score of 1.
932
+ */
933
+ /**
934
+ * Calculates a fuzzy match score between a string and an abbreviation.
935
+ *
936
+ * @param string - The string to match against
937
+ * @param abbreviation - The search query
938
+ * @param keywords - Optional additional keywords to include in matching
939
+ * @returns A score between 0 and 1, where 1 is a perfect match and 0 is no match
940
+ */
941
+ declare function commandScore(string: string, abbreviation: string, keywords?: string[]): number;
942
+ /**
943
+ * Default filter function for listbox items.
944
+ * Returns a score > 0 for matches, 0 for non-matches.
945
+ */
946
+ declare const defaultFilter: typeof commandScore;
947
+ //#endregion
948
+ //#region src/internal/listbox/utils/normalize.d.ts
949
+ /**
950
+ * Normalizes a value string for use in filtering and identification.
951
+ * Trims leading/trailing whitespace to match cmdk's behavior.
952
+ *
953
+ * @param value - The value to normalize
954
+ * @returns The trimmed value, or empty string if value is nullish
955
+ */
956
+ declare function normalizeValue(value: string | undefined | null): string;
957
+ /**
958
+ * Converts a value string to a URL-safe slug for use in IDs.
959
+ * - Trims whitespace
960
+ * - Converts to lowercase
961
+ * - Replaces spaces with hyphens
962
+ * - Removes non-alphanumeric characters (except hyphens)
963
+ * - Collapses multiple hyphens into one
964
+ * - Removes leading/trailing hyphens
965
+ *
966
+ * @example
967
+ * slugify("User Settings") // "user-settings"
968
+ * slugify(" Hello World! ") // "hello-world"
969
+ * slugify("Café & Co.") // "caf-co"
970
+ *
971
+ * @param value - The value to slugify
972
+ * @returns The slugified value, or empty string if value is nullish
973
+ */
974
+ declare function slugify(value: string | undefined | null): string;
975
+ //#endregion
976
+ export { useMaybeListboxContext as A, VirtualItem as B, RowWidthContextValue as C, ListboxContextValue as D, ListboxContext as E, ListboxContext$1 as F, GroupContext as G, ItemContextValue as H, ListboxState as I, useGroupContext as J, GroupContextValue as K, ListboxStore as L, FilterFn as M, HighlightSource as N, VirtualizationConfig as O, ItemRegistration as P, OrderedItemsUpdateReason as R, RowWidthContext as S, useRowWidthContext as T, useItemContext as U, ItemContext as V, useMaybeItemContext as W, useListboxItem as _, UseStickyRowWidthOptions as a, useMaybeSurfaceContext as b, FocusOwnerInterface as c, UseListboxKeyboardParams as d, UseListboxKeyboardReturn as f, UseListboxItemReturn as g, UseListboxItemParams as h, defaultFilter as i, DOMRefs as j, useListboxContext as k, SubmenuInterface as l, AimGuardRefs as m, slugify as n, UseStickyRowWidthReturn as o, useListboxKeyboard as p, GroupPositional as q, commandScore as r, useStickyRowWidth as s, normalizeValue as t, SubpageInterface as u, SurfaceContext as v, useMaybeRowWidthContext as w, useSurfaceContext as x, SurfaceContextValue as y, SearchNormalizer as z };
977
+ //# sourceMappingURL=index-D8OrKThQ.d.ts.map