@bazza-ui/react 0.1.0-canary.16 → 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 (150) 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-3HMQLMSF.js +0 -2
  87. package/dist/chunk-3HMQLMSF.js.map +0 -1
  88. package/dist/chunk-4C666HHU.js +0 -2
  89. package/dist/chunk-4C666HHU.js.map +0 -1
  90. package/dist/chunk-5T5B5SPR.cjs +0 -2
  91. package/dist/chunk-5T5B5SPR.cjs.map +0 -1
  92. package/dist/chunk-A4Z5BY7H.js +0 -2
  93. package/dist/chunk-A4Z5BY7H.js.map +0 -1
  94. package/dist/chunk-IT372NHF.js +0 -2
  95. package/dist/chunk-IT372NHF.js.map +0 -1
  96. package/dist/chunk-JFEVUUPC.cjs +0 -2
  97. package/dist/chunk-JFEVUUPC.cjs.map +0 -1
  98. package/dist/chunk-KO3DXT3Y.js +0 -2
  99. package/dist/chunk-KO3DXT3Y.js.map +0 -1
  100. package/dist/chunk-LXXK4S4Q.js +0 -2
  101. package/dist/chunk-LXXK4S4Q.js.map +0 -1
  102. package/dist/chunk-M4G6J7DP.cjs +0 -2
  103. package/dist/chunk-M4G6J7DP.cjs.map +0 -1
  104. package/dist/chunk-MPPIEWSL.js +0 -2
  105. package/dist/chunk-MPPIEWSL.js.map +0 -1
  106. package/dist/chunk-PCNHYMD6.cjs +0 -2
  107. package/dist/chunk-PCNHYMD6.cjs.map +0 -1
  108. package/dist/chunk-RTG6U56O.cjs +0 -2
  109. package/dist/chunk-RTG6U56O.cjs.map +0 -1
  110. package/dist/chunk-SCDHQZFI.cjs +0 -2
  111. package/dist/chunk-SCDHQZFI.cjs.map +0 -1
  112. package/dist/chunk-XMZZ62VJ.cjs +0 -2
  113. package/dist/chunk-XMZZ62VJ.cjs.map +0 -1
  114. package/dist/combobox/index.d.cts +0 -1066
  115. package/dist/command-menu/index.d.cts +0 -154
  116. package/dist/command-score-CTJ9NV6n.d.cts +0 -23
  117. package/dist/command-score-CTJ9NV6n.d.ts +0 -23
  118. package/dist/context-menu/index.d.cts +0 -696
  119. package/dist/dropdown-menu/index.d.cts +0 -723
  120. package/dist/events-BTHQ2OoH.d.ts +0 -1860
  121. package/dist/events-DVcrtGe3.d.cts +0 -1860
  122. package/dist/input-C95v6jB0.d.cts +0 -46
  123. package/dist/input-CYweYB_i.d.ts +0 -46
  124. package/dist/internal/listbox/index.cjs.map +0 -1
  125. package/dist/internal/listbox/index.d.cts +0 -272
  126. package/dist/internal/listbox/index.js.map +0 -1
  127. package/dist/internal/popup-menu/index.cjs.map +0 -1
  128. package/dist/internal/popup-menu/index.d.cts +0 -238
  129. package/dist/internal/popup-menu/index.js.map +0 -1
  130. package/dist/items-B6HeFO_8.d.ts +0 -37
  131. package/dist/kbd/index.d.cts +0 -61
  132. package/dist/loaders/index.d.cts +0 -363
  133. package/dist/loading-C6WZGUc3.d.cts +0 -29
  134. package/dist/loading-CC4n55sR.d.ts +0 -29
  135. package/dist/resolve-B-j0eW24.d.cts +0 -406
  136. package/dist/resolve-B1F-a3P1.d.ts +0 -406
  137. package/dist/scroll-arrow-BBoKckL_.d.cts +0 -544
  138. package/dist/scroll-arrow-fl3B5sVO.d.ts +0 -544
  139. package/dist/select/index.d.cts +0 -1005
  140. package/dist/separator-Dn15rte3.d.ts +0 -275
  141. package/dist/separator-NjsBVzek.d.cts +0 -275
  142. package/dist/surface-context-CGLDpMej.d.ts +0 -14
  143. package/dist/surface-context-CN4Lb_6F.d.cts +0 -14
  144. package/dist/type-guards-BHHzjRvZ.d.cts +0 -351
  145. package/dist/type-guards-C0e_GpeY.d.ts +0 -351
  146. package/dist/types-DT4FOOa2.d.cts +0 -51
  147. package/dist/types-DT4FOOa2.d.ts +0 -51
  148. package/dist/use-listbox-item-NzZuY34-.d.cts +0 -212
  149. package/dist/use-listbox-item-NzZuY34-.d.ts +0 -212
  150. package/dist/video-player/index.d.cts +0 -1391
@@ -0,0 +1,2091 @@
1
+ import { t as ComponentProps } from "./types-BbN28E3_.js";
2
+ import * as React from "react";
3
+ declare namespace reason_parts_d_exports {
4
+ export { auto, clearPress, closePress, dragSelection, escapeKey, focusOut, imperativeAction, inputChange, inputClear, itemKeyboardSelect, itemPress, keyboard, listNavigation, noResults, none, outsidePress, pointer, rangeSelection, siblingOpen, submenuTrigger, triggerContextMenu, triggerFocus, triggerHover, triggerPress };
5
+ }
6
+ declare const triggerPress: 'trigger-press';
7
+ declare const triggerHover: 'trigger-hover';
8
+ declare const triggerFocus: 'trigger-focus';
9
+ declare const triggerContextMenu: 'trigger-context-menu';
10
+ declare const escapeKey: 'escape-key';
11
+ declare const outsidePress: 'outside-press';
12
+ declare const focusOut: 'focus-out';
13
+ declare const itemPress: 'item-press';
14
+ declare const itemKeyboardSelect: 'item-keyboard-select';
15
+ declare const closePress: 'close-press';
16
+ declare const rangeSelection: 'range-selection';
17
+ declare const dragSelection: 'drag-selection';
18
+ declare const inputChange: 'input-change';
19
+ declare const inputClear: 'input-clear';
20
+ declare const clearPress: 'clear-press';
21
+ declare const listNavigation: 'list-navigation';
22
+ declare const submenuTrigger: 'submenu-trigger';
23
+ declare const siblingOpen: 'sibling-open';
24
+ declare const pointer: 'pointer';
25
+ declare const keyboard: 'keyboard';
26
+ declare const auto: 'auto';
27
+ declare const imperativeAction: 'imperative-action';
28
+ /** A suggestion menu's results settled empty with `noResults: 'close'`. */
29
+ declare const noResults: 'no-results';
30
+ declare const none: 'none';
31
+ //#endregion
32
+ //#region src/utils/events/create-event-details.d.ts
33
+ /**
34
+ * Maps event reason strings to their corresponding native DOM event types.
35
+ * This provides type-safe access to the native event based on the reason.
36
+ */
37
+ interface ReasonToEventMap {
38
+ [none]: Event;
39
+ [triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
40
+ [triggerHover]: MouseEvent | PointerEvent;
41
+ [triggerFocus]: FocusEvent;
42
+ [triggerContextMenu]: MouseEvent | TouchEvent;
43
+ [escapeKey]: KeyboardEvent;
44
+ [outsidePress]: MouseEvent | PointerEvent | TouchEvent;
45
+ [focusOut]: FocusEvent | KeyboardEvent;
46
+ [itemPress]: MouseEvent | PointerEvent | KeyboardEvent;
47
+ [itemKeyboardSelect]: KeyboardEvent;
48
+ [closePress]: MouseEvent | PointerEvent | KeyboardEvent;
49
+ [inputChange]: InputEvent | Event;
50
+ [inputClear]: InputEvent | FocusEvent | Event;
51
+ [clearPress]: MouseEvent | PointerEvent | KeyboardEvent;
52
+ [listNavigation]: KeyboardEvent;
53
+ [submenuTrigger]: MouseEvent | PointerEvent | KeyboardEvent;
54
+ [siblingOpen]: Event;
55
+ [pointer]: MouseEvent | PointerEvent;
56
+ [keyboard]: KeyboardEvent;
57
+ [imperativeAction]: Event;
58
+ }
59
+ /**
60
+ * Maps a reason string to the corresponding native event type.
61
+ * Falls back to `Event` for unknown reasons.
62
+ */
63
+ type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
64
+ /**
65
+ * Details object passed to change event handlers (onOpenChange, onValueChange, etc.)
66
+ *
67
+ * @template Reason - The union of allowed reason strings for this event
68
+ * @template CustomProperties - Additional component-specific properties
69
+ */
70
+ interface ChangeEventDetails<Reason extends string, _CustomProperties extends object = Record<string, never>> {
71
+ /**
72
+ * The reason why this state change occurred.
73
+ * Use this to conditionally handle different scenarios.
74
+ *
75
+ * @example
76
+ * ```tsx
77
+ * onOpenChange={(open, details) => {
78
+ * if (details.reason === 'escape-key') {
79
+ * // Handle escape key differently
80
+ * }
81
+ * }}
82
+ * ```
83
+ */
84
+ reason: Reason;
85
+ /**
86
+ * The native DOM event that triggered this change.
87
+ * May be a synthetic event in some cases.
88
+ */
89
+ event: ReasonToEvent<Reason>;
90
+ /**
91
+ * Cancels the state change.
92
+ * When called, the component's internal state will not update.
93
+ *
94
+ * @example
95
+ * ```tsx
96
+ * onOpenChange={(open, details) => {
97
+ * if (!open && details.reason === 'outside-press') {
98
+ * details.cancel() // Prevent closing on outside press
99
+ * }
100
+ * }}
101
+ * ```
102
+ */
103
+ cancel: () => void;
104
+ /**
105
+ * Allows the native event to propagate.
106
+ * By default, some events (like Escape key) stop propagation
107
+ * to prevent parent popups from closing simultaneously.
108
+ */
109
+ allowPropagation: () => void;
110
+ /**
111
+ * Whether `cancel()` has been called.
112
+ */
113
+ readonly isCanceled: boolean;
114
+ /**
115
+ * Whether `allowPropagation()` has been called.
116
+ */
117
+ readonly isPropagationAllowed: boolean;
118
+ /**
119
+ * The element that triggered this event, if applicable.
120
+ */
121
+ trigger: Element | undefined;
122
+ }
123
+ /**
124
+ * Details object for generic events that don't support cancellation.
125
+ * Used for events like onHighlightChange where cancellation doesn't make sense.
126
+ *
127
+ * @template Reason - The union of allowed reason strings for this event
128
+ * @template CustomProperties - Additional component-specific properties
129
+ */
130
+ interface GenericEventDetails<Reason extends string, _CustomProperties extends object = Record<string, never>> {
131
+ /**
132
+ * The reason why this event occurred.
133
+ */
134
+ reason: Reason;
135
+ /**
136
+ * The native DOM event that triggered this event.
137
+ */
138
+ event: ReasonToEvent<Reason>;
139
+ }
140
+ //#endregion
141
+ //#region src/internal/popup-menu/components/checkbox-group/checkbox-group.d.ts
142
+ interface PopupMenuCheckboxGroupState extends Record<string, unknown> {
143
+ /**
144
+ * Whether the checkbox group is disabled.
145
+ */
146
+ disabled: boolean;
147
+ /**
148
+ * Present when this is the first visible group in the list.
149
+ */
150
+ firstGroup: boolean;
151
+ /**
152
+ * Present when this is the last visible group in the list.
153
+ */
154
+ lastGroup: boolean;
155
+ first: boolean;
156
+ last: boolean;
157
+ }
158
+ interface PopupMenuCheckboxGroupProps extends ComponentProps<'div', PopupMenuCheckboxGroup.State> {
159
+ /**
160
+ * The controlled array of checked item values.
161
+ */
162
+ value?: string[];
163
+ /**
164
+ * The default checked values for uncontrolled mode. @default []
165
+ */
166
+ defaultValue?: string[];
167
+ /**
168
+ * Callback fired when the selected value changes.
169
+ * The second parameter contains event details including the reason for the change.
170
+ */
171
+ onValueChange?: (value: string[], eventDetails: CheckboxValueChangeEventDetails) => void;
172
+ /**
173
+ * Whether all items in this group are disabled.
174
+ * @default false
175
+ */
176
+ disabled?: boolean;
177
+ /**
178
+ * Whether to force render this group regardless of filter results.
179
+ * @default false
180
+ */
181
+ forceMount?: boolean;
182
+ children: React.ReactNode;
183
+ }
184
+ /**
185
+ * Groups checkbox items together and owns their checked state as one array of values.
186
+ * Renders a `<div>` element with role="group".
187
+ */
188
+ declare const PopupMenuCheckboxGroup: React.ForwardRefExoticComponent<Omit<PopupMenuCheckboxGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
189
+ declare namespace PopupMenuCheckboxGroup {
190
+ type State = PopupMenuCheckboxGroupState;
191
+ interface Props extends PopupMenuCheckboxGroupProps {}
192
+ }
193
+ //#endregion
194
+ //#region src/internal/popup-menu/components/checkbox-item/checkbox-item.d.ts
195
+ interface PopupMenuCheckboxItemState extends Record<string, unknown> {
196
+ /**
197
+ * Whether the item is highlighted (via keyboard or pointer).
198
+ */
199
+ highlighted: boolean;
200
+ /**
201
+ * Whether the item is disabled.
202
+ */
203
+ disabled: boolean;
204
+ /**
205
+ * Whether the item is currently checked.
206
+ */
207
+ checked: boolean;
208
+ /** Whether a range or drag selection previews a different checked state for this item. */
209
+ pending: boolean;
210
+ first: boolean;
211
+ last: boolean;
212
+ firstInGroup: boolean;
213
+ lastInGroup: boolean;
214
+ }
215
+ interface PopupMenuCheckboxItemProps extends ComponentProps<'div', PopupMenuCheckboxItem.State> {
216
+ /**
217
+ * The controlled checked state.
218
+ */
219
+ checked?: boolean;
220
+ /**
221
+ * The default checked state for uncontrolled mode.
222
+ * @default false
223
+ */
224
+ defaultChecked?: boolean;
225
+ /**
226
+ * Callback fired when the checked state changes.
227
+ * The second parameter contains event details including the reason for the change.
228
+ */
229
+ onCheckedChange?: (checked: boolean, eventDetails: CheckedChangeEventDetails) => void;
230
+ /**
231
+ * Unique value for this item used for filtering.
232
+ * If not provided, will be inferred from textContent.
233
+ */
234
+ value?: string;
235
+ /**
236
+ * Additional keywords to match against when filtering.
237
+ * Useful for aliases or synonyms.
238
+ */
239
+ keywords?: string[];
240
+ /**
241
+ * Whether this item is disabled.
242
+ * Disabled items are not selectable and are skipped during keyboard navigation.
243
+ * @default false
244
+ */
245
+ disabled?: boolean;
246
+ /**
247
+ * Callback when this item is selected (via click or Enter key).
248
+ */
249
+ onSelect?: () => void;
250
+ /**
251
+ * Whether to force render this item regardless of filter results.
252
+ * @default false
253
+ */
254
+ forceMount?: boolean;
255
+ /**
256
+ * Whether clicking this item should close the menu.
257
+ * @default false
258
+ */
259
+ closeOnClick?: boolean;
260
+ /**
261
+ * Keyboard shortcut to trigger this item.
262
+ * When the menu is focused and the user presses this key, the item will be selected.
263
+ * Should be a single character (e.g., "1", "a", etc.).
264
+ */
265
+ shortcut?: string;
266
+ /**
267
+ * Forces this row's relative order during score-based sorting.
268
+ * Lower values appear earlier.
269
+ * @default 0
270
+ */
271
+ forceOrder?: number;
272
+ /**
273
+ * Overrides this row's computed fuzzy-match score.
274
+ */
275
+ forceScore?: number;
276
+ }
277
+ /**
278
+ * A selectable checkbox item within a popup menu.
279
+ * Manages its own checked state when standalone; inside a checkbox group the
280
+ * group owns it (`checked`, `defaultChecked` and `onCheckedChange` are ignored).
281
+ * Renders a `<div>` element with role="menuitemcheckbox".
282
+ */
283
+ declare const PopupMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<PopupMenuCheckboxItem.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
284
+ declare namespace PopupMenuCheckboxItem {
285
+ type State = PopupMenuCheckboxItemState;
286
+ interface Props extends PopupMenuCheckboxItemProps {}
287
+ }
288
+ //#endregion
289
+ //#region src/internal/popup-menu/components/item/item.d.ts
290
+ interface PopupMenuItemState extends Record<string, unknown> {
291
+ /**
292
+ * Whether the item is highlighted (via keyboard or pointer).
293
+ */
294
+ highlighted: boolean;
295
+ /**
296
+ * Whether the item is disabled.
297
+ */
298
+ disabled: boolean;
299
+ first: boolean;
300
+ last: boolean;
301
+ firstInGroup: boolean;
302
+ lastInGroup: boolean;
303
+ }
304
+ interface PopupMenuItemProps extends ComponentProps<'div', PopupMenuItem.State> {
305
+ /**
306
+ * Unique value for this item used for filtering.
307
+ * If not provided, will be inferred from textContent.
308
+ */
309
+ value?: string;
310
+ /**
311
+ * Additional keywords to match against when filtering.
312
+ * Useful for aliases or synonyms.
313
+ */
314
+ keywords?: string[];
315
+ /**
316
+ * Whether this item is disabled.
317
+ * Disabled items are not selectable and are skipped during keyboard navigation.
318
+ */
319
+ disabled?: boolean;
320
+ /**
321
+ * Whether this item can be activated via Enter or click.
322
+ * Non-activatable items are still highlightable via keyboard/pointer.
323
+ * @default true
324
+ */
325
+ activatable?: boolean;
326
+ /**
327
+ * Callback when this item is selected (via click or Enter key).
328
+ */
329
+ onSelect?: () => void;
330
+ /**
331
+ * Whether to force render this item regardless of filter results.
332
+ * @default false
333
+ */
334
+ forceMount?: boolean;
335
+ /**
336
+ * Whether clicking this item should close the menu.
337
+ * @default true
338
+ */
339
+ closeOnClick?: boolean;
340
+ /**
341
+ * Keyboard shortcut to trigger this item.
342
+ * When the menu is focused and the user presses this key, the item will be selected.
343
+ * Should be a single character (e.g., "1", "a", etc.).
344
+ */
345
+ shortcut?: string;
346
+ /**
347
+ * Forces this row's relative order during score-based sorting.
348
+ * Lower values appear earlier.
349
+ * @default 0
350
+ */
351
+ forceOrder?: number;
352
+ /**
353
+ * Overrides this row's computed fuzzy-match score.
354
+ */
355
+ forceScore?: number;
356
+ }
357
+ /**
358
+ * A selectable item in the popup menu.
359
+ * Renders a `<div>` element with role="option".
360
+ */
361
+ declare const PopupMenuItem: React.ForwardRefExoticComponent<Omit<PopupMenuItem.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
362
+ declare namespace PopupMenuItem {
363
+ type State = PopupMenuItemState;
364
+ interface Props extends PopupMenuItemProps {}
365
+ }
366
+ //#endregion
367
+ //#region src/internal/popup-menu/components/link-item/link-item.d.ts
368
+ interface PopupMenuLinkItemState extends Record<string, unknown> {
369
+ highlighted: boolean;
370
+ disabled: boolean;
371
+ first: boolean;
372
+ last: boolean;
373
+ firstInGroup: boolean;
374
+ lastInGroup: boolean;
375
+ }
376
+ interface PopupMenuLinkItemProps extends ComponentProps<'a', PopupMenuLinkItem.State> {
377
+ /**
378
+ * Unique value for this item used for filtering.
379
+ * If not provided, will be inferred from textContent.
380
+ */
381
+ value?: string;
382
+ /**
383
+ * Additional keywords to match against when filtering.
384
+ * Useful for aliases or synonyms.
385
+ */
386
+ keywords?: string[];
387
+ /**
388
+ * Whether this item is disabled.
389
+ * Disabled items do not navigate and are skipped during keyboard navigation.
390
+ */
391
+ disabled?: boolean;
392
+ /** Callback when this item is selected (via click, Enter key, or shortcut). */
393
+ onSelect?: () => void;
394
+ /** Whether to force render this item regardless of filter results. @default false */
395
+ forceMount?: boolean;
396
+ /**
397
+ * Whether clicking this item should close the menu. Defaults to false because
398
+ * full-page navigation unmounts the menu anyway.
399
+ * @default false
400
+ */
401
+ closeOnClick?: boolean;
402
+ /** Keyboard shortcut to trigger this item. */
403
+ shortcut?: string;
404
+ /** Forces this row's relative order during score-based sorting. @default 0 */
405
+ forceOrder?: number;
406
+ /** Overrides this row's computed fuzzy-match score. */
407
+ forceScore?: number;
408
+ }
409
+ declare const PopupMenuLinkItem: React.ForwardRefExoticComponent<Omit<PopupMenuLinkItem.Props, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
410
+ declare namespace PopupMenuLinkItem {
411
+ type State = PopupMenuLinkItemState;
412
+ interface Props extends PopupMenuLinkItemProps {}
413
+ }
414
+ //#endregion
415
+ //#region src/internal/popup-menu/components/radio-group/radio-group.d.ts
416
+ interface PopupMenuRadioGroupState extends Record<string, unknown> {
417
+ /**
418
+ * Whether the radio group is disabled.
419
+ */
420
+ disabled: boolean;
421
+ /**
422
+ * Present when this is the first visible group in the list.
423
+ */
424
+ firstGroup: boolean;
425
+ /**
426
+ * Present when this is the last visible group in the list.
427
+ */
428
+ lastGroup: boolean;
429
+ first: boolean;
430
+ last: boolean;
431
+ }
432
+ interface PopupMenuRadioGroupProps extends ComponentProps<'div', PopupMenuRadioGroup.State> {
433
+ /**
434
+ * The controlled selected value.
435
+ */
436
+ value?: string;
437
+ /**
438
+ * The default value for uncontrolled mode.
439
+ */
440
+ defaultValue?: string;
441
+ /**
442
+ * Callback fired when the selected value changes.
443
+ * The second parameter contains event details including the reason for the change.
444
+ */
445
+ onValueChange?: (value: string, eventDetails: RadioValueChangeEventDetails) => void;
446
+ /**
447
+ * Whether all items in this group are disabled.
448
+ * @default false
449
+ */
450
+ disabled?: boolean;
451
+ /**
452
+ * Whether to force render this group regardless of filter results.
453
+ * @default false
454
+ */
455
+ forceMount?: boolean;
456
+ children: React.ReactNode;
457
+ }
458
+ /**
459
+ * Groups radio items together and manages the selected value.
460
+ * Only one item can be selected at a time within a radio group.
461
+ * Renders a `<div>` element with role="group".
462
+ */
463
+ declare const PopupMenuRadioGroup: React.ForwardRefExoticComponent<Omit<PopupMenuRadioGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
464
+ declare namespace PopupMenuRadioGroup {
465
+ type State = PopupMenuRadioGroupState;
466
+ interface Props extends PopupMenuRadioGroupProps {}
467
+ }
468
+ //#endregion
469
+ //#region src/internal/popup-menu/components/radio-item/radio-item.d.ts
470
+ interface PopupMenuRadioItemState extends Record<string, unknown> {
471
+ /**
472
+ * Whether the item is highlighted (via keyboard or pointer).
473
+ */
474
+ highlighted: boolean;
475
+ /**
476
+ * Whether the item is disabled.
477
+ */
478
+ disabled: boolean;
479
+ /**
480
+ * Whether the item is currently selected/checked.
481
+ */
482
+ checked: boolean;
483
+ first: boolean;
484
+ last: boolean;
485
+ firstInGroup: boolean;
486
+ lastInGroup: boolean;
487
+ }
488
+ interface PopupMenuRadioItemProps extends ComponentProps<'div', PopupMenuRadioItem.State> {
489
+ /**
490
+ * The value to set when this item is selected.
491
+ * This is required and must be unique within the RadioGroup.
492
+ */
493
+ value: string;
494
+ /**
495
+ * Additional keywords to match against when filtering.
496
+ * Useful for aliases or synonyms.
497
+ */
498
+ keywords?: string[];
499
+ /**
500
+ * Whether this item is disabled.
501
+ * Disabled items are not selectable and are skipped during keyboard navigation.
502
+ * @default false
503
+ */
504
+ disabled?: boolean;
505
+ /**
506
+ * Callback when this item is selected.
507
+ */
508
+ onSelect?: () => void;
509
+ /**
510
+ * Whether to force render this item regardless of filter results.
511
+ * @default false
512
+ */
513
+ forceMount?: boolean;
514
+ /**
515
+ * Whether clicking this item should close the menu.
516
+ * @default false
517
+ */
518
+ closeOnClick?: boolean;
519
+ /**
520
+ * Keyboard shortcut to trigger this item.
521
+ * When the menu is focused and the user presses this key, the item will be selected.
522
+ * Should be a single character (e.g., "1", "a", etc.).
523
+ */
524
+ shortcut?: string;
525
+ /**
526
+ * Forces this row's relative order during score-based sorting.
527
+ * Lower values appear earlier.
528
+ * @default 0
529
+ */
530
+ forceOrder?: number;
531
+ /**
532
+ * Overrides this row's computed fuzzy-match score.
533
+ */
534
+ forceScore?: number;
535
+ }
536
+ /**
537
+ * A selectable radio item within a RadioGroup.
538
+ * Only one RadioItem can be selected at a time within a RadioGroup.
539
+ * Renders a `<div>` element with role="menuitemradio".
540
+ */
541
+ declare const PopupMenuRadioItem: React.ForwardRefExoticComponent<Omit<PopupMenuRadioItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
542
+ declare namespace PopupMenuRadioItem {
543
+ type State = PopupMenuRadioItemState;
544
+ interface Props extends PopupMenuRadioItemProps {}
545
+ }
546
+ //#endregion
547
+ //#region src/internal/popup-menu/components/submenu-trigger/submenu-trigger.d.ts
548
+ interface PopupMenuSubmenuTriggerState extends Record<string, unknown> {
549
+ /**
550
+ * Whether this is a submenu trigger (always true).
551
+ */
552
+ submenuTrigger: boolean;
553
+ /**
554
+ * Whether the submenu popup is open.
555
+ */
556
+ popupOpen: boolean;
557
+ /**
558
+ * Whether the submenu owns keyboard focus.
559
+ */
560
+ popupFocused: boolean;
561
+ /**
562
+ * Whether the item is highlighted.
563
+ */
564
+ highlighted: boolean;
565
+ /**
566
+ * Whether the item is disabled.
567
+ */
568
+ disabled: boolean;
569
+ first: boolean;
570
+ last: boolean;
571
+ firstInGroup: boolean;
572
+ lastInGroup: boolean;
573
+ }
574
+ interface PopupMenuSubmenuTriggerProps extends ComponentProps<'div', PopupMenuSubmenuTrigger.State> {
575
+ /**
576
+ * Explicit unique identifier for this item in the store.
577
+ * When provided (e.g., from data-first API's computed composite ID),
578
+ * this takes priority over `value` for store registration.
579
+ */
580
+ id?: string;
581
+ /**
582
+ * Unique value for this item used for filtering.
583
+ * If not provided, will be inferred from textContent.
584
+ */
585
+ value?: string;
586
+ /**
587
+ * Additional keywords to match against when filtering.
588
+ * Useful for aliases or synonyms.
589
+ */
590
+ keywords?: string[];
591
+ /**
592
+ * Whether this item is disabled.
593
+ * Disabled items are not selectable and are skipped during keyboard navigation.
594
+ */
595
+ disabled?: boolean;
596
+ /**
597
+ * Whether to force render this item regardless of filter results.
598
+ * @default false
599
+ */
600
+ forceMount?: boolean;
601
+ /**
602
+ * Whether the submenu opens when this trigger is highlighted.
603
+ * @default true
604
+ */
605
+ openOnHighlight?: boolean;
606
+ /**
607
+ * Delay before opening the submenu (in milliseconds).
608
+ * Can be a number (applies to both pointer and keyboard) or an object
609
+ * with separate `pointer` and `keyboard` values.
610
+ * @default { pointer: 0, keyboard: 150 }
611
+ */
612
+ delay?: number | {
613
+ pointer?: number;
614
+ keyboard?: number;
615
+ };
616
+ /**
617
+ * Delay before closing the submenu when pointer leaves (in milliseconds).
618
+ * @default 0
619
+ */
620
+ closeDelay?: number;
621
+ /**
622
+ * Whether the submenu closes when the pointer leaves the trigger without aiming at the submenu popup.
623
+ * When `false`, the submenu stays open until closed by another path (sibling highlight, keyboard, outside click, etc.).
624
+ * @default true
625
+ */
626
+ closeOnPointerLeave?: boolean;
627
+ /**
628
+ * Forces this row's relative order during score-based sorting.
629
+ * Lower values appear earlier.
630
+ * @default 0
631
+ */
632
+ forceOrder?: number;
633
+ /**
634
+ * Overrides this row's computed fuzzy-match score.
635
+ */
636
+ forceScore?: number;
637
+ }
638
+ /**
639
+ * A menu item that opens a submenu when hovered.
640
+ * Must be used within PopupMenu.Submenu.
641
+ * Renders a `<div>` element with role="menuitem" wrapped in Popover.Trigger.
642
+ */
643
+ declare const PopupMenuSubmenuTrigger: React.ForwardRefExoticComponent<Omit<PopupMenuSubmenuTrigger.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
644
+ declare namespace PopupMenuSubmenuTrigger {
645
+ type State = PopupMenuSubmenuTriggerState;
646
+ interface Props extends PopupMenuSubmenuTriggerProps {}
647
+ }
648
+ //#endregion
649
+ //#region src/internal/popup-menu/components/subpage-trigger/subpage-trigger.d.ts
650
+ interface PopupMenuSubpageTriggerState extends Record<string, unknown> {
651
+ /** Whether this is a subpage trigger (always true). */
652
+ subpageTrigger: boolean;
653
+ /** Whether the target page is active. */
654
+ popupOpen: boolean;
655
+ /** Whether the target page owns keyboard focus. */
656
+ popupFocused: boolean;
657
+ /** Whether the item is highlighted. */
658
+ highlighted: boolean;
659
+ /** Whether the item is disabled. */
660
+ disabled: boolean;
661
+ first: boolean;
662
+ last: boolean;
663
+ firstInGroup: boolean;
664
+ lastInGroup: boolean;
665
+ }
666
+ interface PopupMenuSubpageTriggerProps extends ComponentProps<'div', PopupMenuSubpageTrigger.State> {
667
+ /** Explicit unique identifier for this item in the store. */
668
+ id?: string;
669
+ /** Unique value for this item used for filtering. */
670
+ value?: string;
671
+ /** Additional keywords to match against when filtering. */
672
+ keywords?: string[];
673
+ /** Whether this item is disabled. */
674
+ disabled?: boolean;
675
+ /** Whether to force render this item regardless of filter results. */
676
+ forceMount?: boolean;
677
+ /**
678
+ * Forces this row's relative order during score-based sorting.
679
+ * Lower values appear earlier.
680
+ * @default 0
681
+ */
682
+ forceOrder?: number;
683
+ /**
684
+ * Overrides this row's computed fuzzy-match score.
685
+ */
686
+ forceScore?: number;
687
+ /** Target page ID to open when this trigger is selected. */
688
+ targetPageId: string;
689
+ }
690
+ /**
691
+ * A menu item that pushes a new page in the same popup.
692
+ * Renders a `<div>` element with role="menuitem".
693
+ */
694
+ declare const PopupMenuSubpageTrigger: React.ForwardRefExoticComponent<Omit<PopupMenuSubpageTrigger.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
695
+ declare namespace PopupMenuSubpageTrigger {
696
+ type State = PopupMenuSubpageTriggerState;
697
+ interface Props extends PopupMenuSubpageTriggerProps {}
698
+ }
699
+ //#endregion
700
+ //#region src/internal/popup-menu/data-first/types.d.ts
701
+ /**
702
+ * Library-agnostic result from an async loader.
703
+ * Compatible with TanStack Query, SWR, and custom loaders.
704
+ */
705
+ type AsyncLoaderSource = 'tanstack-query' | 'swr' | 'vanilla' | 'custom';
706
+ /**
707
+ * Canonical async loader status.
708
+ * - 'idle': no request has been executed yet
709
+ * - 'pending': request in progress and no successful data yet
710
+ * - 'success': last resolved state has data
711
+ * - 'error': last resolved state errored
712
+ */
713
+ type AsyncLoaderStatus = 'idle' | 'pending' | 'success' | 'error';
714
+ /**
715
+ * Canonical fetch status.
716
+ */
717
+ type AsyncLoaderFetchStatus = 'idle' | 'fetching' | 'paused';
718
+ /**
719
+ * Loading phase for distinguishing first-load from background revalidation.
720
+ */
721
+ type AsyncLoaderLoadingPhase = 'none' | 'initial' | 'background';
722
+ interface AsyncLoaderResult<TData, TRaw = unknown> {
723
+ /** The loaded data, undefined while loading or on error */
724
+ data: TData | undefined;
725
+ /** Raw result object returned by the underlying data library */
726
+ raw?: TRaw;
727
+ /** Source data library backing this result */
728
+ source?: AsyncLoaderSource;
729
+ /** Error if the load failed, null otherwise */
730
+ error: Error | null;
731
+ /** Canonical status state */
732
+ status: AsyncLoaderStatus;
733
+ /** Canonical fetch state */
734
+ fetchStatus: AsyncLoaderFetchStatus;
735
+ /** Distinguishes initial load vs background fetch */
736
+ loadingPhase: AsyncLoaderLoadingPhase;
737
+ /** True during the initial loading phase (TanStack-aligned semantics) */
738
+ isLoading: boolean;
739
+ /** Whether any fetch is currently in-flight */
740
+ isFetching: boolean;
741
+ /** Alias of `isLoading` for explicit phase naming */
742
+ isInitialLoading: boolean;
743
+ /** True when background re-fetch is in-flight */
744
+ isRefetching: boolean;
745
+ /** Whether query state is pending */
746
+ isPending: boolean;
747
+ /** Whether query state is successful */
748
+ isSuccess: boolean;
749
+ /** Whether the loader encountered an error */
750
+ isError: boolean;
751
+ /** Whether fetching is paused */
752
+ isPaused: boolean;
753
+ /** Whether data is currently available */
754
+ hasData: boolean;
755
+ /** Whether any fetch has completed at least once */
756
+ hasFetched: boolean;
757
+ /** Optional function to refetch the data */
758
+ refetch?: () => unknown;
759
+ }
760
+ /**
761
+ * Props passed to loader components.
762
+ * The component should call hooks internally and pass the result to children.
763
+ */
764
+ interface LoaderComponentProps {
765
+ /** Search query (for query loaders) */
766
+ query: string;
767
+ /** Whether the loader should execute its fetch/query hook */
768
+ enabled?: boolean;
769
+ /** Render function receiving loader state */
770
+ children: (state: AsyncLoaderResult<NodeDef[]>) => React.ReactNode;
771
+ }
772
+ /**
773
+ * Controls query-loader behavior before users type an active query.
774
+ */
775
+ interface InitialQueryBehavior {
776
+ /**
777
+ * Query value used before user input reaches minQueryLength.
778
+ * Defaults to '' (top/default results).
779
+ * @default ''
780
+ */
781
+ value?: string;
782
+ /**
783
+ * When the initial query should load.
784
+ * - 'needed': when submenu is explicitly opened or needed for deep-search execution
785
+ * - 'parent-open': eagerly when direct parent opens
786
+ * @default 'needed'
787
+ */
788
+ loadWhen?: 'needed' | 'parent-open';
789
+ }
790
+ /**
791
+ * Static loader configuration.
792
+ * Loads data once, then filters client-side.
793
+ */
794
+ interface StaticLoaderConfig {
795
+ type: 'static';
796
+ /**
797
+ * Component that calls hooks and provides loader state.
798
+ * This component pattern allows hooks to be called legally within React's rules.
799
+ */
800
+ Loader: React.ComponentType<LoaderComponentProps>;
801
+ /**
802
+ * When to trigger the loader:
803
+ * - 'eager': Load when menu opens (good for deep search)
804
+ * - 'lazy': Load when submenu opens (default)
805
+ * @default 'lazy'
806
+ */
807
+ loadStrategy?: 'eager' | 'lazy';
808
+ }
809
+ /**
810
+ * Query loader configuration.
811
+ * Refetches based on search query - server does the filtering.
812
+ */
813
+ interface QueryLoaderConfig {
814
+ type: 'query';
815
+ /**
816
+ * Milliseconds to wait after the search stops changing before passing it to
817
+ * the loader. While waiting, the loader counts as fetching, so the menu
818
+ * doesn't show "no results" or treat the search as finished too early.
819
+ * @default 0
820
+ */
821
+ debounce?: number;
822
+ /**
823
+ * Component that calls hooks and provides loader state.
824
+ * Receives the current search query as a prop.
825
+ */
826
+ Loader: React.ComponentType<LoaderComponentProps>;
827
+ /**
828
+ * Minimum query length before fetching.
829
+ * @default 1
830
+ */
831
+ minQueryLength?: number;
832
+ /**
833
+ * Defines behavior before user query reaches minQueryLength.
834
+ * - object: executes query loader with the configured initial value (default behavior)
835
+ * - false: disables initial fetch until query reaches minQueryLength
836
+ * @default { value: '', loadWhen: 'needed' }
837
+ */
838
+ initialQueryBehavior?: InitialQueryBehavior | false;
839
+ /**
840
+ * @deprecated Use `initialQueryBehavior` instead.
841
+ */
842
+ initialQuery?: string;
843
+ /**
844
+ * When to trigger the loader:
845
+ * - 'eager': Load when root menu opens (good for deep search)
846
+ * - 'lazy': Load when submenu opens (default)
847
+ * @default 'lazy'
848
+ */
849
+ loadStrategy?: 'eager' | 'lazy';
850
+ /**
851
+ * What to show when query is below minQueryLength.
852
+ * - 'empty': Show nothing
853
+ * - 'placeholder': Show placeholderNodes
854
+ * @default 'empty'
855
+ */
856
+ belowMinBehavior?: 'empty' | 'placeholder';
857
+ /**
858
+ * Placeholder nodes shown when query is below minQueryLength.
859
+ */
860
+ placeholderNodes?: NodeDef[];
861
+ }
862
+ /**
863
+ * Controls how submenu content participates in ancestor deep search results.
864
+ * - `true`: include submenu trigger and descendants
865
+ * - `'trigger-only'`: include submenu trigger only
866
+ * - `false`: exclude submenu trigger and descendants
867
+ */
868
+ type IncludeInDeepSearch = true | 'trigger-only' | false;
869
+ /**
870
+ * Union of all async loader configurations.
871
+ */
872
+ type AsyncLoaderConfig = StaticLoaderConfig | QueryLoaderConfig;
873
+ /**
874
+ * Static async nodes configuration for submenus.
875
+ */
876
+ type StaticAsyncNodesConfig = StaticLoaderConfig;
877
+ /**
878
+ * Query async nodes configuration for submenus.
879
+ */
880
+ type QueryAsyncNodesConfig = QueryLoaderConfig;
881
+ /**
882
+ * Async nodes configuration for submenus.
883
+ * Union of static and query loader configs.
884
+ */
885
+ type AsyncNodesConfig = StaticAsyncNodesConfig | QueryAsyncNodesConfig;
886
+ /**
887
+ * Async state exposed to submenu render functions.
888
+ */
889
+ interface AsyncRenderState {
890
+ /** Canonical status state */
891
+ status: AsyncLoaderStatus;
892
+ /** Canonical fetch state */
893
+ fetchStatus: AsyncLoaderFetchStatus;
894
+ /** Distinguishes initial load vs background fetch */
895
+ loadingPhase: AsyncLoaderLoadingPhase;
896
+ /** True during the initial loading phase */
897
+ isLoading: boolean;
898
+ /** Whether any fetch is currently in-flight */
899
+ isFetching: boolean;
900
+ /** Alias of `isLoading` for explicit phase naming */
901
+ isInitialLoading: boolean;
902
+ /** True when background re-fetch is in-flight */
903
+ isRefetching: boolean;
904
+ /** Whether the loader encountered an error */
905
+ isError: boolean;
906
+ /** The error if any */
907
+ error: Error | null;
908
+ /** For query loaders: whether query is below minQueryLength */
909
+ isBelowMinLength?: boolean;
910
+ }
911
+ /**
912
+ * Aggregate async state exposed to DataList children.
913
+ */
914
+ interface AsyncState {
915
+ /** Any loader is currently in initial loading phase */
916
+ isLoading: boolean;
917
+ /** Any loader is currently fetching */
918
+ isFetching: boolean;
919
+ /** Any loader is in first-load phase */
920
+ isInitialLoading: boolean;
921
+ /** Any loader is in background refetch phase */
922
+ isRefetching: boolean;
923
+ /** All registered loaders are in background refetch phase */
924
+ isAllRefetching: boolean;
925
+ /** Static loaders specifically are loading */
926
+ isStaticLoading: boolean;
927
+ /** Static loaders in first-load phase */
928
+ isStaticInitialLoading: boolean;
929
+ /** Static loaders in background refetch phase */
930
+ isStaticRefetching: boolean;
931
+ /** Query loaders specifically are loading */
932
+ isQueryLoading: boolean;
933
+ /** Query loaders in first-load phase */
934
+ isQueryInitialLoading: boolean;
935
+ /** Query loaders in background refetch phase */
936
+ isQueryRefetching: boolean;
937
+ /** Menus that failed (skipped from results) */
938
+ skippedMenus: Array<{
939
+ kind: 'root';
940
+ reason: 'error';
941
+ } | {
942
+ kind: 'branch';
943
+ id: string;
944
+ reason: 'error';
945
+ }>;
946
+ }
947
+ /**
948
+ * Branch node info passed in breadcrumbs context.
949
+ * Contains the full submenu/subpage definition for maximum flexibility.
950
+ */
951
+ interface BreadcrumbNode {
952
+ /** The branch node definition */
953
+ node: SubmenuDef | SubpageDef | TreeItemDef;
954
+ /** The branch Menu Node. `node`, `value`, and `id` mirror its def for compatibility. */
955
+ menuNode: PopupMenuNode<SubmenuDef | SubpageDef | TreeItemDef>;
956
+ /** The branch node's value */
957
+ value: string;
958
+ /** The branch node's explicit id (if provided) */
959
+ id?: string;
960
+ }
961
+ /**
962
+ * Context passed to item, submenu, and subpage render functions.
963
+ * Provides information about the current rendering context (search, breadcrumbs, state).
964
+ */
965
+ interface RowRenderContext {
966
+ /**
967
+ * Search context - the query in the menu where this row is being rendered.
968
+ * `null` if no active search (browsing mode).
969
+ */
970
+ search: {
971
+ /** Current search query */
972
+ query: string;
973
+ /** Match score for this row (higher = better match). */
974
+ score: number;
975
+ } | null;
976
+ /**
977
+ * Full path of branch nodes from root to this row's parent.
978
+ * Contains the full submenu/subpage node definitions for maximum flexibility.
979
+ * Empty array [] for items directly in root menu.
980
+ */
981
+ breadcrumbs: BreadcrumbNode[];
982
+ /**
983
+ * True if this row is being rendered outside its "home" menu
984
+ * (surfaced via deep search from an ancestor menu).
985
+ */
986
+ isDeepSearchResult: boolean;
987
+ /** Whether this row is currently highlighted/focused */
988
+ highlighted: boolean;
989
+ /** Whether this row is disabled */
990
+ disabled: boolean;
991
+ /**
992
+ * The group this item belongs to, if any.
993
+ * `null` if the item is not inside a group.
994
+ */
995
+ group: {
996
+ id: string;
997
+ label?: string;
998
+ } | null;
999
+ /** Tree rendering context, or null for non-tree and search rows. */
1000
+ tree: {
1001
+ depth: number;
1002
+ hasChildren: boolean;
1003
+ isLastChild: boolean;
1004
+ ancestorsLast: boolean[];
1005
+ header: boolean;
1006
+ } | null;
1007
+ }
1008
+ /**
1009
+ * Props to spread onto the Item component.
1010
+ * Derived from PopupMenuItemProps.
1011
+ */
1012
+ type ItemRenderProps = {
1013
+ /**
1014
+ * Canonical Resolved ID for the item, generated by the root policy: the
1015
+ * encoded surface Definition Path by default, or the Definition Key in
1016
+ * menu scope.
1017
+ * Must be passed to the rendered component for navigation to work.
1018
+ */
1019
+ id: string;
1020
+ /**
1021
+ * The original value from the node definition.
1022
+ * Use this for display, search matching, or any logic that needs the raw value.
1023
+ */
1024
+ value: string;
1025
+ } & Required<Pick<PopupMenuItemProps, 'disabled'>> & Pick<PopupMenuItemProps, 'closeOnClick' | 'onSelect' | 'shortcut' | 'forceOrder' | 'forceScore'>;
1026
+ /**
1027
+ * Parameters passed to item render functions.
1028
+ */
1029
+ interface ItemRenderParams {
1030
+ /** The resolved menu node for this row — canonical identity (`node.id`), definition path, and tree links */
1031
+ node: PopupMenuNode;
1032
+ /** Props to spread onto the Item component */
1033
+ props: ItemRenderProps;
1034
+ /** Context for conditional rendering (includes props values for convenience) */
1035
+ context: RowRenderContext & {
1036
+ /** The node's value (ItemDef.value) */
1037
+ value: string;
1038
+ disabled: boolean;
1039
+ };
1040
+ }
1041
+ type LinkItemRenderProps = {
1042
+ id: string;
1043
+ value: string;
1044
+ href: string;
1045
+ } & Required<Pick<PopupMenuLinkItemProps, 'disabled'>> & Pick<PopupMenuLinkItemProps, 'closeOnClick' | 'onSelect' | 'shortcut' | 'forceOrder' | 'forceScore'>;
1046
+ interface LinkItemRenderParams {
1047
+ node: PopupMenuNode;
1048
+ props: LinkItemRenderProps;
1049
+ context: RowRenderContext & {
1050
+ value: string;
1051
+ disabled: boolean;
1052
+ };
1053
+ }
1054
+ /** Props to spread onto a TreeItem component. */
1055
+ type TreeItemRenderProps = Omit<ItemRenderProps, 'shortcut'> & {
1056
+ /** Whether this row can be selected. */
1057
+ selectable: boolean;
1058
+ };
1059
+ /** Parameters passed to tree item render functions. */
1060
+ interface TreeItemRenderParams {
1061
+ /** The resolved menu node for this row — canonical identity (`node.id`), definition path, and tree links */
1062
+ node: PopupMenuNode;
1063
+ props: TreeItemRenderProps;
1064
+ context: RowRenderContext & {
1065
+ value: string;
1066
+ disabled: boolean;
1067
+ };
1068
+ }
1069
+ /**
1070
+ * Props to spread onto the RadioItem component.
1071
+ * Derived from PopupMenuRadioItemProps.
1072
+ */
1073
+ type RadioItemRenderProps = {
1074
+ /**
1075
+ * Qualified unique ID for the radio item.
1076
+ * Must be passed to the rendered component for navigation to work.
1077
+ */
1078
+ id: string;
1079
+ } & Required<Pick<PopupMenuRadioItemProps, 'value' | 'disabled'>> & Pick<PopupMenuRadioItemProps, 'closeOnClick' | 'onSelect' | 'shortcut' | 'forceOrder' | 'forceScore'>;
1080
+ /**
1081
+ * Parameters passed to radio item render functions.
1082
+ */
1083
+ interface RadioItemRenderParams {
1084
+ /** The resolved menu node for this row — canonical identity (`node.id`), definition path, and tree links */
1085
+ node: PopupMenuNode;
1086
+ /** Props to spread onto the RadioItem component */
1087
+ props: RadioItemRenderProps;
1088
+ /** Context for conditional rendering (includes props values for convenience) */
1089
+ context: RowRenderContext & {
1090
+ /** The node's value (RadioItemDef.value) */
1091
+ value: string;
1092
+ disabled: boolean;
1093
+ };
1094
+ }
1095
+ /**
1096
+ * Props to spread onto the SubmenuTrigger component.
1097
+ * Derived from PopupMenuSubmenuTriggerProps.
1098
+ */
1099
+ type SubmenuRenderProps = {
1100
+ /**
1101
+ * Qualified unique ID for the submenu trigger.
1102
+ * Must be passed to the rendered component for navigation to work.
1103
+ */
1104
+ id: string;
1105
+ /**
1106
+ * The original value from the node definition.
1107
+ */
1108
+ value: string;
1109
+ } & Required<Pick<PopupMenuSubmenuTriggerProps, 'disabled'>> & Pick<PopupMenuSubmenuTriggerProps, 'forceOrder' | 'forceScore'>;
1110
+ /**
1111
+ * Parameters passed to submenu render functions.
1112
+ * Includes context plus the submenu's child nodes and render function.
1113
+ */
1114
+ interface SubmenuRenderParams {
1115
+ /** The resolved menu node for this row — canonical identity (`node.id`), definition path, and tree links */
1116
+ node: PopupMenuNode;
1117
+ /** Props to spread onto the SubmenuTrigger */
1118
+ props: SubmenuRenderProps;
1119
+ /** Context for conditional rendering (includes props values for convenience) */
1120
+ context: RowRenderContext & {
1121
+ /** The node's value (SubmenuDef.value) */
1122
+ value: string;
1123
+ disabled: boolean;
1124
+ /** Async loading state (if asyncNodes configured) */
1125
+ async?: AsyncRenderState;
1126
+ };
1127
+ /** The branch's resolved static child Menu Nodes, in def order. Loader results are grafted as children of `node` but are not included here — use `asyncContent` to load them. Authored fields are on `child.def`. */
1128
+ nodes: PopupMenuNode[];
1129
+ /**
1130
+ * Async content configuration for this submenu.
1131
+ * Pass this to the submenu's DataSurface to enable async loading
1132
+ * with the submenu's own search query (independent of parent search).
1133
+ */
1134
+ asyncContent?: AsyncNodesConfig;
1135
+ /** Render one child Menu Node from `nodes`. */
1136
+ renderNode: (node: PopupMenuNode) => React.ReactNode;
1137
+ }
1138
+ /**
1139
+ * Props to spread onto the SubpageTrigger component.
1140
+ * Derived from PopupMenuSubpageTriggerProps.
1141
+ */
1142
+ type SubpageTriggerRenderProps = {
1143
+ /**
1144
+ * Qualified unique ID for the subpage trigger.
1145
+ * Must be passed to the rendered component for navigation to work.
1146
+ */
1147
+ id: string;
1148
+ /**
1149
+ * The original value from the node definition.
1150
+ */
1151
+ value: string;
1152
+ /**
1153
+ * Computed page ID for the associated Subpage content.
1154
+ * Must be passed to `targetPageId` on SubpageTrigger.
1155
+ */
1156
+ targetPageId: string;
1157
+ } & Required<Pick<PopupMenuSubpageTriggerProps, 'disabled'>>;
1158
+ /**
1159
+ * Parameters passed to subpage trigger render functions.
1160
+ */
1161
+ interface SubpageTriggerRenderParams {
1162
+ /** The resolved menu node for this row — canonical identity (`node.id`), definition path, and tree links */
1163
+ node: PopupMenuNode;
1164
+ /** Props to spread onto the SubpageTrigger */
1165
+ props: SubpageTriggerRenderProps;
1166
+ /** Context for conditional rendering (includes props values for convenience) */
1167
+ context: RowRenderContext & {
1168
+ /** The node's value (SubpageDef.value) */
1169
+ value: string;
1170
+ disabled: boolean;
1171
+ /** Async loading state (if asyncNodes configured) */
1172
+ async?: AsyncRenderState;
1173
+ };
1174
+ }
1175
+ /**
1176
+ * Parameters passed to subpage content render functions.
1177
+ * The returned JSX should include a `<PopupMenu.Subpage pageId={pageId}>` wrapper.
1178
+ */
1179
+ interface SubpageContentRenderParams {
1180
+ /** The resolved menu node for this row — canonical identity (`node.id`), definition path, and tree links */
1181
+ node: PopupMenuNode;
1182
+ /** The subpage's Resolved ID (`node.id`); pass it to `<Subpage pageId>`. */
1183
+ pageId: string;
1184
+ /** Context for conditional rendering */
1185
+ context: RowRenderContext & {
1186
+ /** The node's value (SubpageDef.value) */
1187
+ value: string;
1188
+ disabled: boolean;
1189
+ /** Async loading state (if asyncNodes configured) */
1190
+ async?: AsyncRenderState;
1191
+ };
1192
+ /** The branch's resolved static child Menu Nodes, in def order. Loader results are grafted as children of `node` but are not included here — use `asyncContent` to load them. Authored fields are on `child.def`. */
1193
+ nodes: PopupMenuNode[];
1194
+ /**
1195
+ * Async content configuration for this subpage.
1196
+ * Pass this to the subpage's DataSurface to enable async loading
1197
+ * with the subpage's own search query (independent of parent search).
1198
+ */
1199
+ asyncContent?: AsyncNodesConfig;
1200
+ /** Render one child Menu Node from `nodes`. */
1201
+ renderNode: (node: PopupMenuNode) => React.ReactNode;
1202
+ }
1203
+ /**
1204
+ * Context passed to group render functions.
1205
+ * Contains information about the group's state during search.
1206
+ */
1207
+ interface GroupRenderContext {
1208
+ /**
1209
+ * Search context with the best match score among items in this group.
1210
+ * `null` if no active search (browsing mode).
1211
+ */
1212
+ search: {
1213
+ /** Current search query */
1214
+ query: string;
1215
+ /** Best match score among items in this group (higher = better match). */
1216
+ bestScore: number;
1217
+ } | null;
1218
+ /** Number of matching items in this group */
1219
+ matchCount: number;
1220
+ /**
1221
+ * Breadcrumb nodes if this group is from a surfaced submenu.
1222
+ * Empty array [] for groups in the root menu.
1223
+ */
1224
+ breadcrumbs: BreadcrumbNode[];
1225
+ /** Whether this group is from deep search (surfaced from a submenu) */
1226
+ isDeepSearchResult: boolean;
1227
+ }
1228
+ /**
1229
+ * Parameters passed to group render functions.
1230
+ */
1231
+ interface GroupRenderParams {
1232
+ /** The resolved menu node for this row — canonical identity (`node.id`), definition path, and tree links */
1233
+ node: PopupMenuNode;
1234
+ /** Props (empty for groups, but consistent structure) */
1235
+ props: Record<string, never>;
1236
+ /** Context for conditional rendering (includes label for convenience) */
1237
+ context: GroupRenderContext & {
1238
+ /** The group's label */
1239
+ label?: string;
1240
+ };
1241
+ /** Pre-rendered matching children */
1242
+ children: React.ReactNode;
1243
+ }
1244
+ /**
1245
+ * Parameters passed to group label render functions.
1246
+ */
1247
+ interface GroupLabelRenderParams {
1248
+ /** The resolved menu node for this group — canonical identity (`node.id`), definition path, and tree links */
1249
+ node: PopupMenuNode;
1250
+ /** Props to spread onto the label element (stable id for aria wiring) */
1251
+ props: {
1252
+ id: string;
1253
+ };
1254
+ /** Context for conditional rendering (includes label for convenience) */
1255
+ context: GroupRenderContext & {
1256
+ /** The group's label */
1257
+ label?: string;
1258
+ };
1259
+ }
1260
+ /**
1261
+ * Props to spread onto the CheckboxItem component.
1262
+ * Derived from PopupMenuCheckboxItemProps.
1263
+ */
1264
+ type CheckboxItemRenderProps = {
1265
+ /**
1266
+ * Qualified unique ID for the checkbox item.
1267
+ * Must be passed to the rendered component for navigation to work.
1268
+ */
1269
+ id: string;
1270
+ /**
1271
+ * The original value from the node definition.
1272
+ */
1273
+ value: string;
1274
+ } & Required<Pick<PopupMenuCheckboxItemProps, 'disabled'>> & Pick<PopupMenuCheckboxItemProps, 'checked' | 'onCheckedChange' | 'closeOnClick' | 'forceOrder' | 'forceScore'>;
1275
+ /**
1276
+ * Parameters passed to checkbox item render functions.
1277
+ */
1278
+ interface CheckboxItemRenderParams {
1279
+ /** The resolved menu node for this row — canonical identity (`node.id`), definition path, and tree links */
1280
+ node: PopupMenuNode;
1281
+ /** Props to spread onto the CheckboxItem component */
1282
+ props: CheckboxItemRenderProps;
1283
+ /** Context for conditional rendering (includes props values for convenience) */
1284
+ context: RowRenderContext & {
1285
+ /** The node's value (CheckboxItemDef.value) */
1286
+ value: string;
1287
+ checked?: boolean;
1288
+ disabled: boolean;
1289
+ };
1290
+ }
1291
+ /**
1292
+ * Props to spread onto the RadioGroup component.
1293
+ * Derived from PopupMenuRadioGroupProps.
1294
+ */
1295
+ type RadioGroupRenderProps = Required<Pick<PopupMenuRadioGroupProps, 'disabled'>> & Pick<PopupMenuRadioGroupProps, 'value' | 'onValueChange'>;
1296
+ /**
1297
+ * Parameters passed to radio group render functions.
1298
+ */
1299
+ interface RadioGroupRenderParams {
1300
+ /** The resolved menu node for this row — canonical identity (`node.id`), definition path, and tree links */
1301
+ node: PopupMenuNode;
1302
+ /** Props to spread onto the RadioGroup component */
1303
+ props: RadioGroupRenderProps;
1304
+ /** Context for conditional rendering */
1305
+ context: GroupRenderContext & {
1306
+ /** The radio group's label */
1307
+ label?: string;
1308
+ /** Current selected value */
1309
+ value?: string;
1310
+ /** Whether the radio group is disabled */
1311
+ disabled: boolean;
1312
+ };
1313
+ /** Pre-rendered radio items */
1314
+ children: React.ReactNode;
1315
+ }
1316
+ /**
1317
+ * Parameters passed to radio group label render functions.
1318
+ */
1319
+ interface RadioGroupLabelRenderParams {
1320
+ /** The resolved menu node for this group — canonical identity (`node.id`), definition path, and tree links */
1321
+ node: PopupMenuNode;
1322
+ /** Props to spread onto the label element (stable id for aria wiring) */
1323
+ props: {
1324
+ id: string;
1325
+ };
1326
+ /** Context for conditional rendering (includes label for convenience) */
1327
+ context: GroupRenderContext & {
1328
+ /** The radio group's label */
1329
+ label?: string;
1330
+ /** Current selected value */
1331
+ value?: string;
1332
+ /** Whether the radio group is disabled */
1333
+ disabled: boolean;
1334
+ };
1335
+ }
1336
+ /**
1337
+ * Props to spread onto the CheckboxGroup component.
1338
+ * Derived from PopupMenuCheckboxGroupProps.
1339
+ */
1340
+ type CheckboxGroupRenderProps = Required<Pick<PopupMenuCheckboxGroupProps, 'disabled'>> & Pick<PopupMenuCheckboxGroupProps, 'onValueChange'> & {
1341
+ value: string[];
1342
+ };
1343
+ /**
1344
+ * Parameters passed to checkbox group render functions.
1345
+ */
1346
+ interface CheckboxGroupRenderParams {
1347
+ /** The resolved menu node for this row — canonical identity (`node.id`), definition path, and tree links */
1348
+ node: PopupMenuNode;
1349
+ /** Props to spread onto the CheckboxGroup component */
1350
+ props: CheckboxGroupRenderProps;
1351
+ /** Context for conditional rendering */
1352
+ context: GroupRenderContext & {
1353
+ /** The checkbox group's label */
1354
+ label?: string;
1355
+ /** Current checked values */
1356
+ value?: string[];
1357
+ /** Whether the checkbox group is disabled */
1358
+ disabled: boolean;
1359
+ };
1360
+ /** Pre-rendered checkbox items */
1361
+ children: React.ReactNode;
1362
+ }
1363
+ /**
1364
+ * Parameters passed to checkbox group label render functions.
1365
+ */
1366
+ interface CheckboxGroupLabelRenderParams {
1367
+ /** The resolved menu node for this group — canonical identity (`node.id`), definition path, and tree links */
1368
+ node: PopupMenuNode;
1369
+ /** Props to spread onto the label element (stable id for aria wiring) */
1370
+ props: {
1371
+ id: string;
1372
+ };
1373
+ /** Context for conditional rendering (includes label for convenience) */
1374
+ context: GroupRenderContext & {
1375
+ /** The checkbox group's label */
1376
+ label?: string;
1377
+ /** Current checked values */
1378
+ value?: string[];
1379
+ /** Whether the checkbox group is disabled */
1380
+ disabled: boolean;
1381
+ };
1382
+ }
1383
+ /**
1384
+ * Base properties shared by all node types.
1385
+ */
1386
+ interface BaseNodeDef {
1387
+ /**
1388
+ * Unique identifier for this node.
1389
+ * If provided, it contributes the Definition Key and encoded surface path;
1390
+ * Resolved ID generation otherwise follows the root policy or its
1391
+ * `getResolvedId` seam.
1392
+ */
1393
+ id?: string;
1394
+ /** Whether this node is hidden */
1395
+ hidden?: boolean;
1396
+ }
1397
+ /**
1398
+ * Item node definition.
1399
+ * Represents a selectable menu item.
1400
+ * Props derived from PopupMenuItemProps.
1401
+ */
1402
+ interface ItemDef extends BaseNodeDef, Required<Pick<PopupMenuItemProps, 'value'>>, Pick<PopupMenuItemProps, 'keywords' | 'disabled' | 'onSelect' | 'closeOnClick' | 'shortcut' | 'forceOrder' | 'forceScore'> {
1403
+ kind: 'item';
1404
+ /**
1405
+ * Render function for this item row.
1406
+ * Returns the JSX for the item.
1407
+ */
1408
+ render: (params: ItemRenderParams) => React.ReactNode;
1409
+ }
1410
+ /**
1411
+ * Link item node definition. Represents a menu row that navigates to `href` when activated.
1412
+ */
1413
+ interface LinkItemDef extends BaseNodeDef, Required<Pick<PopupMenuLinkItemProps, 'value' | 'href'>>, Pick<PopupMenuLinkItemProps, 'keywords' | 'disabled' | 'onSelect' | 'closeOnClick' | 'shortcut' | 'forceOrder' | 'forceScore'> {
1414
+ kind: 'link-item';
1415
+ render: (params: LinkItemRenderParams) => React.ReactNode;
1416
+ }
1417
+ /** Tree item node definition. */
1418
+ interface TreeItemDef extends BaseNodeDef, Required<Pick<PopupMenuItemProps, 'value'>>, Pick<PopupMenuItemProps, 'keywords' | 'disabled' | 'onSelect' | 'closeOnClick' | 'forceOrder' | 'forceScore'> {
1419
+ kind: 'tree-item';
1420
+ /** Whether this row itself can be selected. */
1421
+ selectable?: boolean;
1422
+ /** Inline children rendered in the same list. */
1423
+ nodes?: NodeDef[];
1424
+ /** Whether descendants surface in deep search results. */
1425
+ deepSearch?: boolean;
1426
+ /** Render function for this row. */
1427
+ render: (params: TreeItemRenderParams) => React.ReactNode;
1428
+ }
1429
+ /**
1430
+ * Radio item node definition.
1431
+ * Represents a selectable radio menu item for use within RadioGroupDef.
1432
+ * Props derived from PopupMenuRadioItemProps.
1433
+ */
1434
+ interface RadioItemDef extends BaseNodeDef, Required<Pick<PopupMenuRadioItemProps, 'value'>>, Pick<PopupMenuRadioItemProps, 'keywords' | 'disabled' | 'onSelect' | 'closeOnClick' | 'shortcut' | 'forceOrder' | 'forceScore'> {
1435
+ kind: 'radio-item';
1436
+ /**
1437
+ * Render function for this radio item row.
1438
+ * Returns the JSX for the radio item.
1439
+ */
1440
+ render: (params: RadioItemRenderParams) => React.ReactNode;
1441
+ }
1442
+ /**
1443
+ * Checkbox item node definition.
1444
+ * Represents a toggleable checkbox menu item.
1445
+ * Props derived from PopupMenuCheckboxItemProps.
1446
+ */
1447
+ interface CheckboxItemDef extends BaseNodeDef, Pick<PopupMenuCheckboxItemProps, 'keywords' | 'disabled' | 'checked' | 'onCheckedChange' | 'closeOnClick' | 'forceOrder' | 'forceScore'> {
1448
+ kind: 'checkbox-item';
1449
+ /**
1450
+ * Primary identifier and search text for this checkbox item.
1451
+ * Used for search matching and as the default identifier.
1452
+ */
1453
+ value: string;
1454
+ /**
1455
+ * Render function for this checkbox item row.
1456
+ * Returns the JSX for the checkbox item.
1457
+ */
1458
+ render: (params: CheckboxItemRenderParams) => React.ReactNode;
1459
+ }
1460
+ /**
1461
+ * Submenu node definition.
1462
+ * Represents a submenu trigger that opens a nested menu.
1463
+ * Props derived from PopupMenuSubmenuTriggerProps.
1464
+ */
1465
+ interface SubmenuDef extends BaseNodeDef, Required<Pick<PopupMenuSubmenuTriggerProps, 'value'>>, Pick<PopupMenuSubmenuTriggerProps, 'keywords' | 'disabled' | 'forceOrder' | 'forceScore'> {
1466
+ kind: 'submenu';
1467
+ /** Static child nodes */
1468
+ nodes?: NodeDef[];
1469
+ /**
1470
+ * Async child nodes configuration.
1471
+ * When provided, the Loader component will be rendered to fetch async data.
1472
+ * Async nodes are merged with static nodes.
1473
+ */
1474
+ asyncNodes?: AsyncNodesConfig;
1475
+ /**
1476
+ * Whether to include this submenu's descendants in deep search.
1477
+ * @default true
1478
+ */
1479
+ deepSearch?: boolean;
1480
+ /**
1481
+ * Whether this submenu is included in ancestor deep search results.
1482
+ * - `true`: include submenu trigger and descendants
1483
+ * - `'trigger-only'`: include submenu trigger only
1484
+ * - `false`: exclude submenu trigger and descendants
1485
+ * @default true
1486
+ */
1487
+ includeInDeepSearch?: IncludeInDeepSearch;
1488
+ /**
1489
+ * Render function for the entire submenu structure.
1490
+ * Should return the complete submenu: trigger, portal, positioner, popup, surface, list.
1491
+ */
1492
+ render: (params: SubmenuRenderParams) => React.ReactNode;
1493
+ }
1494
+ /**
1495
+ * Subpage node definition.
1496
+ * Represents a trigger row that opens a page in the same popup.
1497
+ * Props derived from PopupMenuSubpageTriggerProps.
1498
+ */
1499
+ interface SubpageDef extends BaseNodeDef, Required<Pick<PopupMenuSubpageTriggerProps, 'value'>>, Pick<PopupMenuSubpageTriggerProps, 'keywords' | 'disabled' | 'forceOrder' | 'forceScore'> {
1500
+ kind: 'subpage';
1501
+ /** Static child nodes */
1502
+ nodes?: NodeDef[];
1503
+ /**
1504
+ * Async child nodes configuration.
1505
+ * When provided, the Loader component will be rendered to fetch async data.
1506
+ * Async nodes are merged with static nodes.
1507
+ */
1508
+ asyncNodes?: AsyncNodesConfig;
1509
+ /**
1510
+ * Whether to include this subpage's descendants in deep search.
1511
+ * @default true
1512
+ */
1513
+ deepSearch?: boolean;
1514
+ /**
1515
+ * Whether this subpage is included in ancestor deep search results.
1516
+ * - `true`: include subpage trigger and descendants
1517
+ * - `'trigger-only'`: include subpage trigger only
1518
+ * - `false`: exclude subpage trigger and descendants
1519
+ * @default true
1520
+ */
1521
+ includeInDeepSearch?: IncludeInDeepSearch;
1522
+ /**
1523
+ * Render function for the trigger row.
1524
+ * Should return a `SubpageTrigger`.
1525
+ */
1526
+ renderTrigger: (params: SubpageTriggerRenderParams) => React.ReactNode;
1527
+ /**
1528
+ * Render function for the subpage content.
1529
+ * Should return a `Subpage` rendered alongside the root Surface in Popup.
1530
+ */
1531
+ renderContent: (params: SubpageContentRenderParams) => React.ReactNode;
1532
+ }
1533
+ /**
1534
+ * Render params for separator nodes.
1535
+ */
1536
+ interface SeparatorRenderParams {
1537
+ /** Props to spread on the separator element */
1538
+ props: {
1539
+ /** Unique identifier */
1540
+ id?: string;
1541
+ };
1542
+ }
1543
+ /**
1544
+ * Separator node definition.
1545
+ * Represents a visual separator between items.
1546
+ */
1547
+ interface SeparatorDef {
1548
+ kind: 'separator';
1549
+ /** Unique identifier */
1550
+ id: string;
1551
+ /** Optional render function for custom separator rendering */
1552
+ render?: (params: SeparatorRenderParams) => React.ReactNode;
1553
+ }
1554
+ /**
1555
+ * Group node definition.
1556
+ * Represents a group of items with an optional label.
1557
+ */
1558
+ interface GroupDef {
1559
+ kind: 'group';
1560
+ /** Unique identifier for this group */
1561
+ id: string;
1562
+ /** Optional group heading/label */
1563
+ label?: string;
1564
+ /** Child nodes in this group */
1565
+ nodes: NodeDef[];
1566
+ /** Optional render function for the group container */
1567
+ render?: (params: GroupRenderParams) => React.ReactNode;
1568
+ /**
1569
+ * Optional render function for the group's label row.
1570
+ * Used by the default group container when no `render` is provided, and by
1571
+ * virtualized lists (which ignore `render` and use only the label row).
1572
+ * Precedence: `render` > `renderLabel` > `label`.
1573
+ */
1574
+ renderLabel?: (params: GroupLabelRenderParams) => React.ReactNode;
1575
+ }
1576
+ /**
1577
+ * Radio group node definition.
1578
+ * Represents a group of radio items where only one can be selected.
1579
+ * Props derived from PopupMenuRadioGroupProps.
1580
+ */
1581
+ interface RadioGroupDef extends Pick<PopupMenuRadioGroupProps, 'value' | 'onValueChange' | 'disabled'> {
1582
+ kind: 'radio-group';
1583
+ /** Unique identifier for this radio group */
1584
+ id: string;
1585
+ /** Optional group heading/label */
1586
+ label?: string;
1587
+ /** Whether the radio group is hidden */
1588
+ hidden?: boolean;
1589
+ /** Child nodes in this radio group - must be RadioItemDef nodes */
1590
+ nodes: RadioItemDef[];
1591
+ /** Optional render function for the radio group container */
1592
+ render?: (params: RadioGroupRenderParams) => React.ReactNode;
1593
+ /**
1594
+ * Optional render function for the radio group's label row.
1595
+ * Used by the default radio group container when no `render` is provided, and by
1596
+ * virtualized lists (which ignore `render` and use only the label row).
1597
+ * Precedence: `render` > `renderLabel` > `label`.
1598
+ */
1599
+ renderLabel?: (params: RadioGroupLabelRenderParams) => React.ReactNode;
1600
+ }
1601
+ /**
1602
+ * Helper function to create a radio group definition with proper typing.
1603
+ */
1604
+ declare function defineRadioGroup(def: RadioGroupDef): RadioGroupDef;
1605
+ /**
1606
+ * Checkbox group node definition.
1607
+ * Represents a group of checkbox items whose checked state the group owns as one array of values.
1608
+ * Props derived from PopupMenuCheckboxGroupProps.
1609
+ */
1610
+ interface CheckboxGroupDef extends Pick<PopupMenuCheckboxGroupProps, 'onValueChange' | 'disabled'> {
1611
+ kind: 'checkbox-group';
1612
+ /** Unique identifier for this checkbox group */
1613
+ id: string;
1614
+ /** Optional group heading/label */
1615
+ label?: string;
1616
+ /** Whether the checkbox group is hidden */
1617
+ hidden?: boolean;
1618
+ /** Values of the currently checked items (controlled). */
1619
+ value: string[];
1620
+ /** Child nodes in this checkbox group - must be CheckboxItemDef nodes */
1621
+ nodes: CheckboxItemDef[];
1622
+ /** Optional render function for the checkbox group container */
1623
+ render?: (params: CheckboxGroupRenderParams) => React.ReactNode;
1624
+ /**
1625
+ * Optional render function for the checkbox group's label row.
1626
+ * Used by the default checkbox group container when no `render` is provided, and by
1627
+ * virtualized lists (which ignore `render` and use only the label row).
1628
+ * Precedence: `render` > `renderLabel` > `label`.
1629
+ */
1630
+ renderLabel?: (params: CheckboxGroupLabelRenderParams) => React.ReactNode;
1631
+ }
1632
+ /**
1633
+ * Helper function to create a checkbox group definition with proper typing.
1634
+ */
1635
+ declare function defineCheckboxGroup(def: CheckboxGroupDef): CheckboxGroupDef;
1636
+ /**
1637
+ * Union of all node definition types.
1638
+ */
1639
+ type NodeDef = ItemDef | LinkItemDef | TreeItemDef | RadioItemDef | CheckboxItemDef | SubmenuDef | SubpageDef | SeparatorDef | GroupDef | RadioGroupDef | CheckboxGroupDef;
1640
+ /**
1641
+ * A node with its search score and breadcrumb path.
1642
+ * Used internally during filtering and scoring.
1643
+ */
1644
+ interface ScoredNode {
1645
+ /** The row's Menu Node; its authored definition is `node.def`. */
1646
+ node: PopupMenuNode<RowNodeDef>;
1647
+ /** Search match score (higher = better match). */
1648
+ score: number;
1649
+ /**
1650
+ * Breadcrumb nodes leading to this node.
1651
+ * Contains the full submenu definitions for maximum flexibility.
1652
+ */
1653
+ breadcrumbs: BreadcrumbNode[];
1654
+ /** The group this node belongs to, if any */
1655
+ group: {
1656
+ id: string;
1657
+ label?: string;
1658
+ groupDef: GroupDef;
1659
+ menuNode: PopupMenuNode<GroupDef>;
1660
+ } | null;
1661
+ /** The radio group this node belongs to, if any */
1662
+ radioGroup: {
1663
+ id: string;
1664
+ label?: string;
1665
+ radioGroupDef: RadioGroupDef;
1666
+ menuNode: PopupMenuNode<RadioGroupDef>;
1667
+ } | null;
1668
+ /** The checkbox group this node belongs to, if any */
1669
+ checkboxGroup: {
1670
+ id: string;
1671
+ label?: string;
1672
+ checkboxGroupDef: CheckboxGroupDef;
1673
+ menuNode: PopupMenuNode<CheckboxGroupDef>;
1674
+ } | null;
1675
+ }
1676
+ type RowNodeDef = ItemDef | LinkItemDef | RadioItemDef | CheckboxItemDef | SubmenuDef | SubpageDef | TreeItemDef;
1677
+ /**
1678
+ * A row node ready for display with its render context.
1679
+ * Used for items, radio items, checkbox items, and submenu triggers.
1680
+ */
1681
+ interface DisplayRowNode {
1682
+ kind: 'row';
1683
+ /** The resolved menu node; its authored definition is `node.def`. */
1684
+ node: PopupMenuNode<RowNodeDef>;
1685
+ /** Pre-computed render context for this node */
1686
+ context: RowRenderContext;
1687
+ /** Radio group this node belongs to, if rendering inside one */
1688
+ radioGroup?: {
1689
+ id: string;
1690
+ label?: string;
1691
+ };
1692
+ /** Checkbox group this node belongs to, if rendering inside one. Carries the def so the row can be wrapped in the group's value provider. */
1693
+ checkboxGroup?: {
1694
+ id: string;
1695
+ label?: string;
1696
+ def: CheckboxGroupDef;
1697
+ };
1698
+ }
1699
+ /**
1700
+ * A subpage content node ready for display with its render context.
1701
+ * Used by DataSubpages to render subpage content alongside the root Surface.
1702
+ */
1703
+ interface DisplaySubpageNode {
1704
+ /** The resolved node for this subpage. The authored def is `node.def`. */
1705
+ node: PopupMenuNode<SubpageDef>;
1706
+ /** Pre-computed render context for this subpage trigger/content */
1707
+ context: RowRenderContext;
1708
+ /** Computed page ID for this subpage */
1709
+ pageId: string;
1710
+ }
1711
+ /**
1712
+ * A group node ready for display with its render context.
1713
+ * Contains the group definition and its matching items.
1714
+ */
1715
+ interface DisplayGroupNode {
1716
+ kind: 'group';
1717
+ /** The resolved node; authored def at node.def. */
1718
+ node: PopupMenuNode<GroupDef>;
1719
+ /** Pre-computed render context for this group */
1720
+ context: GroupRenderContext;
1721
+ /** Display nodes for items within this group */
1722
+ items: DisplayRowNode[];
1723
+ /** Best match score among items in this group */
1724
+ bestScore: number;
1725
+ }
1726
+ /**
1727
+ * A radio group node ready for display with its render context.
1728
+ * Contains the radio group definition and its items.
1729
+ */
1730
+ interface DisplayRadioGroupNode {
1731
+ kind: 'radio-group';
1732
+ /** The resolved node; authored def at node.def. */
1733
+ node: PopupMenuNode<RadioGroupDef>;
1734
+ /** Pre-computed render context for this radio group */
1735
+ context: GroupRenderContext;
1736
+ /** Display nodes for items within this radio group */
1737
+ items: DisplayRowNode[];
1738
+ /** Best match score among items in this radio group */
1739
+ bestScore: number;
1740
+ }
1741
+ /**
1742
+ * A checkbox group node ready for display with its render context.
1743
+ * Contains the checkbox group definition and its items.
1744
+ */
1745
+ interface DisplayCheckboxGroupNode {
1746
+ kind: 'checkbox-group';
1747
+ node: PopupMenuNode<CheckboxGroupDef>;
1748
+ context: GroupRenderContext;
1749
+ items: DisplayRowNode[];
1750
+ bestScore: number;
1751
+ }
1752
+ /**
1753
+ * A separator node ready for display.
1754
+ */
1755
+ interface DisplaySeparatorNode {
1756
+ kind: 'separator';
1757
+ /** The resolved node; authored def at node.def. */
1758
+ node: PopupMenuNode<SeparatorDef>;
1759
+ }
1760
+ /**
1761
+ * Union of all display node types.
1762
+ * Can be a row node (item/submenu/subpage), group node, radio group node, or separator.
1763
+ */
1764
+ type DisplayNode = DisplayRowNode | DisplayGroupNode | DisplayRadioGroupNode | DisplayCheckboxGroupNode | DisplaySeparatorNode;
1765
+ /**
1766
+ * Type guard for DisplayGroupNode.
1767
+ */
1768
+ declare function isDisplayGroupNode(node: DisplayNode): node is DisplayGroupNode;
1769
+ /**
1770
+ * Type guard for DisplayRadioGroupNode.
1771
+ */
1772
+ declare function isDisplayRadioGroupNode(node: DisplayNode): node is DisplayRadioGroupNode;
1773
+ /**
1774
+ * Type guard for DisplayCheckboxGroupNode.
1775
+ */
1776
+ declare function isDisplayCheckboxGroupNode(node: DisplayNode): node is DisplayCheckboxGroupNode;
1777
+ /**
1778
+ * Type guard for DisplaySeparatorNode.
1779
+ */
1780
+ declare function isDisplaySeparatorNode(node: DisplayNode): node is DisplaySeparatorNode;
1781
+ /**
1782
+ * Type guard for DisplayRowNode (items, checkbox items, submenus, subpages).
1783
+ */
1784
+ declare function isDisplayRowNode(node: DisplayNode): node is DisplayRowNode;
1785
+ /**
1786
+ * Defines how groups behave during deep search.
1787
+ * - 'flatten': Groups become invisible, items shown in flat list by score.
1788
+ * - 'preserve': Groups are shown as containers with their matching items.
1789
+ * Note: Radio groups are ALWAYS preserved regardless of this setting.
1790
+ */
1791
+ type GroupBehavior = 'flatten' | 'preserve';
1792
+ /**
1793
+ * Defines how radio groups behave during deep search.
1794
+ * - 'flatten': Radio group items are shown individually in the flat list (not recommended).
1795
+ * - 'preserve': Radio group is shown with only matching items visible.
1796
+ * - 'preserve-show-all': Radio group is shown with ALL items visible when any item matches.
1797
+ * This is useful when you want users to see all options in a radio group.
1798
+ */
1799
+ type RadioGroupBehavior = 'flatten' | 'preserve' | 'preserve-show-all';
1800
+ /**
1801
+ * Defines how checkbox groups behave during deep search.
1802
+ * - 'flatten': Checkbox group items are shown individually in the flat list (not recommended).
1803
+ * - 'preserve': Checkbox group is shown with only matching items visible.
1804
+ * - 'preserve-show-all': Checkbox group is shown with ALL items visible when any item matches.
1805
+ * This is useful when you want users to see all options in a checkbox group.
1806
+ */
1807
+ type CheckboxGroupBehavior = 'flatten' | 'preserve' | 'preserve-show-all';
1808
+ /**
1809
+ * How a surface's `asyncContent` rows combine with its `content`.
1810
+ * See `DataSurfaceProps.asyncContentMode`.
1811
+ */
1812
+ type AsyncContentMode = 'replace' | 'append';
1813
+ /**
1814
+ * Defines how deep-search async results are revealed.
1815
+ * - 'stream': show available results immediately and append new async batches as they resolve.
1816
+ * - 'block': hide all deep-search rows until every participating async loader resolves.
1817
+ */
1818
+ type AsyncResultBehavior = 'stream' | 'block';
1819
+ /**
1820
+ * How the descendants of a disabled branch (a submenu or subpage with
1821
+ * `disabled: true`) participate in deep search.
1822
+ * - 'exclude': descendants are not deep results; the disabled trigger still is.
1823
+ * Equivalent to the branch's `includeInDeepSearch` defaulting to `'trigger-only'`.
1824
+ * - 'inherit': descendants are deep results that inherit `disabled` — shown, not selectable.
1825
+ */
1826
+ type DisabledBranchBehavior = 'exclude' | 'inherit';
1827
+ /**
1828
+ * Configuration for deep search behavior.
1829
+ */
1830
+ interface DeepSearchConfig {
1831
+ /** Whether deep search is enabled */
1832
+ enabled?: boolean;
1833
+ /** Minimum query length before deep search activates */
1834
+ minLength?: number;
1835
+ /**
1836
+ * How groups behave during search results.
1837
+ * Only affects search mode - groups are always shown in browse mode.
1838
+ * Note: Radio groups have their own behavior controlled by radioGroupSearchBehavior.
1839
+ * @default 'preserve'
1840
+ */
1841
+ groupSearchBehavior?: GroupBehavior;
1842
+ /**
1843
+ * How radio groups behave during search results.
1844
+ * - 'flatten': Radio items shown individually (not recommended).
1845
+ * - 'preserve': Only matching radio items are shown (default).
1846
+ * - 'preserve-show-all': All radio items are shown when any item matches.
1847
+ * @default 'preserve'
1848
+ */
1849
+ radioGroupSearchBehavior?: RadioGroupBehavior;
1850
+ /**
1851
+ * How checkbox groups behave during search results.
1852
+ * - 'flatten': Checkbox items shown individually (not recommended).
1853
+ * - 'preserve': Only matching checkbox items are shown (default).
1854
+ * - 'preserve-show-all': All checkbox items are shown when any item matches.
1855
+ * @default 'preserve'
1856
+ */
1857
+ checkboxGroupSearchBehavior?: CheckboxGroupBehavior;
1858
+ /**
1859
+ * Whether to sort groups by their best-matching item's score.
1860
+ * Only applies when groupSearchBehavior: 'preserve'.
1861
+ * @default true
1862
+ */
1863
+ sortGroups?: boolean;
1864
+ /**
1865
+ * How async deep-search results are revealed.
1866
+ * - 'stream': emit available results immediately, append later async batches (default)
1867
+ * - 'block': show loading state only until all loaders resolve, then render once
1868
+ * @default 'stream'
1869
+ */
1870
+ asyncResultBehavior?: AsyncResultBehavior;
1871
+ /**
1872
+ * How descendants of a disabled branch appear in deep search results.
1873
+ * - 'exclude': not shown; the disabled branch trigger still appears (default)
1874
+ * - 'inherit': shown as deep results with inherited `disabled`
1875
+ * An explicit `includeInDeepSearch` on the branch def always takes precedence.
1876
+ * @default 'exclude'
1877
+ */
1878
+ disabledBranchBehavior?: DisabledBranchBehavior;
1879
+ }
1880
+ /**
1881
+ * Props for the DataSurface component.
1882
+ */
1883
+ interface DataSurfaceProps {
1884
+ /**
1885
+ * The menu content (node definitions with render functions). Resolved nodes
1886
+ * are accepted anywhere defs are; they are unwrapped to their defs, and
1887
+ * re-supplying the same nodes preserves identity.
1888
+ */
1889
+ content?: NodeDef[] | PopupMenuNode[];
1890
+ /**
1891
+ * Async content configuration for root-level async loading.
1892
+ * When provided, the Loader component will be rendered to fetch async data.
1893
+ * How its rows combine with `content` is set by `asyncContentMode`.
1894
+ */
1895
+ asyncContent?: AsyncLoaderConfig;
1896
+ /**
1897
+ * How rows from `asyncContent` combine with `content` once they load.
1898
+ * - `'replace'`: the loaded rows replace `content` (`content` shows until then).
1899
+ * - `'append'`: `content` stays first and the loaded rows follow it. A loaded
1900
+ * row whose Definition Key matches a row already in `content` (including
1901
+ * rows inside groups and tree items) is dropped, so local rows win.
1902
+ * @default 'replace'
1903
+ */
1904
+ asyncContentMode?: AsyncContentMode;
1905
+ /**
1906
+ * When rows from `asyncContent` appear.
1907
+ * - `'stream'`: as soon as they load (local `content` shows meanwhile).
1908
+ * - `'block'`: only once the loader has settled for the current search. Until
1909
+ * then the previous settled list stays up unchanged; before anything has
1910
+ * settled the list is empty and `Loading` shows. Rows kept from a previous
1911
+ * search while the next one loads don't count as settled.
1912
+ *
1913
+ * Deep search has its own `deepSearch.asyncResultBehavior`, which still shows
1914
+ * the loading state while a new search loads.
1915
+ * @default 'stream'
1916
+ */
1917
+ asyncContentReveal?: AsyncResultBehavior;
1918
+ /** Deep search configuration */
1919
+ deepSearch?: DeepSearchConfig | boolean;
1920
+ /**
1921
+ * Default inclusion mode for descendant branch nodes in deep search results.
1922
+ * Submenus/subpages can override via `includeInDeepSearch`.
1923
+ * @default true
1924
+ */
1925
+ includeInDeepSearch?: IncludeInDeepSearch;
1926
+ /** Filter function or false to disable filtering */
1927
+ filter?: ((value: string, search: string, keywords?: string[]) => number) | false;
1928
+ /**
1929
+ * Transforms search input before filtering and visibility logic.
1930
+ * @default trim whitespace (`search.trim()`)
1931
+ */
1932
+ normalizeSearch?: (search: string) => string;
1933
+ /** Controlled search value */
1934
+ search?: string;
1935
+ /** Callback when search value changes */
1936
+ onSearchChange?: (search: string) => void;
1937
+ /** Default search value for uncontrolled usage */
1938
+ defaultSearch?: string;
1939
+ /** Whether navigation should loop */
1940
+ loop?: boolean;
1941
+ /** Auto-highlight behavior when menu opens */
1942
+ autoHighlightFirst?: boolean | string;
1943
+ /**
1944
+ * Whether to clear search on close.
1945
+ * - `true`: clear immediately when menu closes (default)
1946
+ * - `false`: preserve search when menu closes
1947
+ * - `'after-exit'`: clear after exit animation completes
1948
+ */
1949
+ clearSearchOnClose?: boolean | 'after-exit';
1950
+ /**
1951
+ * Whether to reset the list scroll position when the search query changes.
1952
+ * @default true
1953
+ */
1954
+ resetScrollOnSearch?: boolean;
1955
+ /** Children (Input, List, etc.) */
1956
+ children: React.ReactNode;
1957
+ }
1958
+ /**
1959
+ * State passed to the DataList render function.
1960
+ */
1961
+ interface DataListChildrenState {
1962
+ /** Current search query (empty string if browsing) */
1963
+ search: string;
1964
+ /**
1965
+ * Display nodes (filtered and scored if searching).
1966
+ * Can include groups (DisplayGroupNode), radio groups (DisplayRadioGroupNode), or checkbox groups (DisplayCheckboxGroupNode)
1967
+ * when groupSearchBehavior: 'preserve'.
1968
+ */
1969
+ nodes: DisplayNode[];
1970
+ /**
1971
+ * Function to render a node.
1972
+ * Handles items, submenus, groups, radio groups, and checkbox groups, calling their render functions with context.
1973
+ */
1974
+ renderNode: (displayNode: DisplayNode) => React.ReactNode;
1975
+ /** Number of visible items (counting items inside groups) */
1976
+ count: number;
1977
+ /** Whether deep search is active (query length >= minLength) */
1978
+ isDeepSearching: boolean;
1979
+ /** Aggregate async loading state across all menus */
1980
+ async: AsyncState;
1981
+ }
1982
+ //#endregion
1983
+ //#region src/internal/popup-menu/menu-tree/types.d.ts
1984
+ type PopupMenuIdScope = 'menu' | 'surface';
1985
+ /**
1986
+ * A menu node: the library-created, resolved instance of a node def.
1987
+ * Exactly one per logical row per menu root, in every render context —
1988
+ * object identity is Resolved ID identity, and `id` is its serialization.
1989
+ * Created by resolution at the root or by grafting; instances are stable
1990
+ * across content re-supplies (reconciliation swaps `def` in place).
1991
+ * The type parameter narrows `def`/`kind` for callers that know the def kind
1992
+ * statically. Narrowing is a lookup-time snapshot: reconcile may replace `def`
1993
+ * in place with another def of the same resolved id, so a long-held narrowed
1994
+ * reference sees the current def, not necessarily the exact object/type it was
1995
+ * looked up with.
1996
+ */
1997
+ interface PopupMenuNode<D extends NodeDef = NodeDef> {
1998
+ /** The originating def. Replaced in place when content is re-supplied. */
1999
+ def: D;
2000
+ /** Mirror of `def.kind`, stable for the node's lifetime. */
2001
+ kind: D['kind'];
2002
+ /**
2003
+ * This node's path component: explicit `def.id` verbatim when present,
2004
+ * otherwise the slugified `value` (kinds without a display value use
2005
+ * their required `id`).
2006
+ */
2007
+ definitionKey: string;
2008
+ /**
2009
+ * Definition Path: Definition Keys from the menu root to this node,
2010
+ * including its own key, root-first. Only submenu and subpage ancestors
2011
+ * contribute keys (groups, radio-groups, checkbox-groups, and tree-items are path-transparent).
2012
+ */
2013
+ definitionPath: string[];
2014
+ /** Resolved ID selected by the root's identity policy. */
2015
+ id: string;
2016
+ parent: PopupMenuNode | null;
2017
+ children: PopupMenuNode[];
2018
+ /** Def-tree depth counting every node kind; roots are 0. */
2019
+ depth: number;
2020
+ /** Sibling index in the def tree (position within `parent.children`). */
2021
+ index: number;
2022
+ }
2023
+ /**
2024
+ * A menu node before its resolved ID is assigned — the argument to `GetResolvedIdFn`.
2025
+ * Carries definitional facts only (`def`, `definitionKey`, `definitionPath`, resolved
2026
+ * `parent`, `depth`, def-tree sibling `index`). Contextual facts (search
2027
+ * state, deep-search flags, display position) are deliberately absent:
2028
+ * a context-dependent Resolved ID is inexpressible by construction.
2029
+ */
2030
+ type UnresolvedMenuNode = Omit<PopupMenuNode, 'id'>;
2031
+ /**
2032
+ * Computes a node's Resolved ID from definitional facts. The ID must be unique
2033
+ * per menu root; it is the identity persistent state, registration, and
2034
+ * highlight key off.
2035
+ *
2036
+ * Contract: the id may read the node's own facts (including its own sibling
2037
+ * `index`) and may walk `parent` for lineage (as the default definition-path
2038
+ * rule does), but it must not depend on an *ancestor's* sibling `index` —
2039
+ * reconciliation invalidates ids by def identity and definition path, not by
2040
+ * ancestor reordering, so ancestor-index-dependent ids would go stale. The
2041
+ * seam must also not mutate its argument.
2042
+ */
2043
+ type GetResolvedIdFn = (node: UnresolvedMenuNode) => string;
2044
+ //#endregion
2045
+ //#region src/internal/popup-menu/events.d.ts
2046
+ /**
2047
+ * Reasons why a popup menu's open state changed.
2048
+ */
2049
+ type PopupMenuOpenChangeReason = typeof triggerPress | typeof triggerHover | typeof triggerFocus | typeof triggerContextMenu | typeof escapeKey | typeof outsidePress | typeof focusOut | typeof itemPress | typeof closePress | typeof listNavigation | typeof submenuTrigger | typeof siblingOpen | typeof imperativeAction | typeof none;
2050
+ /**
2051
+ * Event details for popup menu open state changes.
2052
+ */
2053
+ type PopupMenuOpenChangeEventDetails = ChangeEventDetails<PopupMenuOpenChangeReason>;
2054
+ /**
2055
+ * Reasons why highlight changed.
2056
+ */
2057
+ type HighlightChangeReason = typeof pointer | typeof keyboard | typeof auto | typeof none;
2058
+ /**
2059
+ * Event details for highlight changes.
2060
+ */
2061
+ type HighlightChangeEventDetails = GenericEventDetails<HighlightChangeReason, {
2062
+ index: number;
2063
+ }>;
2064
+ type PopupMenuHighlightChangeHandler<EventDetails = HighlightChangeEventDetails> = (id: string | null, node: PopupMenuNode | null, index: number, eventDetails: EventDetails) => void;
2065
+ /**
2066
+ * Reasons why a checkbox item's checked state changed.
2067
+ */
2068
+ type CheckedChangeReason = typeof itemPress | typeof itemKeyboardSelect | typeof rangeSelection | typeof dragSelection;
2069
+ /**
2070
+ * Event details for checkbox item checked state changes.
2071
+ */
2072
+ type CheckedChangeEventDetails = ChangeEventDetails<CheckedChangeReason>;
2073
+ /**
2074
+ * Reasons why a checkbox group's value changed.
2075
+ */
2076
+ type CheckboxValueChangeReason = typeof itemPress | typeof itemKeyboardSelect | typeof rangeSelection | typeof dragSelection;
2077
+ /**
2078
+ * Event details for checkbox group value changes.
2079
+ */
2080
+ type CheckboxValueChangeEventDetails = ChangeEventDetails<CheckboxValueChangeReason>;
2081
+ /**
2082
+ * Reasons why a radio group's value changed.
2083
+ */
2084
+ type RadioValueChangeReason = typeof itemPress | typeof itemKeyboardSelect;
2085
+ /**
2086
+ * Event details for radio group value changes.
2087
+ */
2088
+ type RadioValueChangeEventDetails = ChangeEventDetails<RadioValueChangeReason>;
2089
+ //#endregion
2090
+ export { LinkItemRenderParams as $, PopupMenuItemState as $t, CheckboxItemRenderProps as A, defineRadioGroup as At, DisplaySeparatorNode as B, PopupMenuSubmenuTriggerProps as Bt, CheckboxGroupBehavior as C, submenuTrigger as Cn, SubpageDef as Ct, CheckboxGroupRenderProps as D, triggerPress as Dn, TreeItemRenderParams as Dt, CheckboxGroupRenderParams as E, triggerHover as En, TreeItemDef as Et, DisplayCheckboxGroupNode as F, isDisplaySeparatorNode as Ft, GroupRenderContext as G, PopupMenuRadioGroup as Gt, GroupBehavior as H, PopupMenuRadioItem as Ht, DisplayGroupNode as I, PopupMenuSubpageTrigger as It, InitialQueryBehavior as J, PopupMenuLinkItem as Jt, GroupRenderParams as K, PopupMenuRadioGroupProps as Kt, DisplayNode as L, PopupMenuSubpageTriggerProps as Lt, DataSurfaceProps as M, isDisplayGroupNode as Mt, DeepSearchConfig as N, isDisplayRadioGroupNode as Nt, CheckboxItemDef as O, TreeItemRenderProps as Ot, DisabledBranchBehavior as P, isDisplayRowNode as Pt, LinkItemDef as Q, PopupMenuItemProps as Qt, DisplayRadioGroupNode as R, PopupMenuSubpageTriggerState as Rt, BreadcrumbNode as S, siblingOpen as Sn, SubpageContentRenderParams as St, CheckboxGroupLabelRenderParams as T, triggerFocus as Tn, SubpageTriggerRenderProps as Tt, GroupDef as U, PopupMenuRadioItemProps as Ut, DisplaySubpageNode as V, PopupMenuSubmenuTriggerState as Vt, GroupLabelRenderParams as W, PopupMenuRadioItemState as Wt, ItemRenderParams as X, PopupMenuLinkItemState as Xt, ItemDef as Y, PopupMenuLinkItemProps as Yt, ItemRenderProps as Z, PopupMenuItem as Zt, AsyncLoaderStatus as _, noResults as _n, StaticAsyncNodesConfig as _t, PopupMenuOpenChangeReason as a, PopupMenuCheckboxGroupState as an, RadioGroupBehavior as at, AsyncResultBehavior as b, pointer as bn, SubmenuRenderParams as bt, PopupMenuIdScope as c, closePress as cn, RadioGroupRenderParams as ct, AsyncContentMode as d, imperativeAction as dn, RadioItemRenderParams as dt, PopupMenuCheckboxItem as en, LinkItemRenderProps as et, AsyncLoaderConfig as f, inputChange as fn, RadioItemRenderProps as ft, AsyncLoaderSource as g, listNavigation as gn, SeparatorRenderParams as gt, AsyncLoaderResult as h, keyboard as hn, SeparatorDef as ht, PopupMenuOpenChangeEventDetails as i, PopupMenuCheckboxGroupProps as in, QueryLoaderConfig as it, DataListChildrenState as j, isDisplayCheckboxGroupNode as jt, CheckboxItemRenderParams as k, defineCheckboxGroup as kt, PopupMenuNode as l, escapeKey as ln, RadioGroupRenderProps as lt, AsyncLoaderLoadingPhase as m, itemPress as mn, ScoredNode as mt, HighlightChangeEventDetails as n, PopupMenuCheckboxItemState as nn, NodeDef as nt, RadioValueChangeEventDetails as o, ChangeEventDetails as on, RadioGroupDef as ot, AsyncLoaderFetchStatus as p, inputClear as pn, RowRenderContext as pt, IncludeInDeepSearch as q, PopupMenuRadioGroupState as qt, PopupMenuHighlightChangeHandler as r, PopupMenuCheckboxGroup as rn, QueryAsyncNodesConfig as rt, GetResolvedIdFn as s, GenericEventDetails as sn, RadioGroupLabelRenderParams as st, CheckboxValueChangeEventDetails as t, PopupMenuCheckboxItemProps as tn, LoaderComponentProps as tt, UnresolvedMenuNode as u, focusOut as un, RadioItemDef as ut, AsyncNodesConfig as v, none as vn, StaticLoaderConfig as vt, CheckboxGroupDef as w, triggerContextMenu as wn, SubpageTriggerRenderParams as wt, AsyncState as x, reason_parts_d_exports as xn, SubmenuRenderProps as xt, AsyncRenderState as y, outsidePress as yn, SubmenuDef as yt, DisplayRowNode as z, PopupMenuSubmenuTrigger as zt };
2091
+ //# sourceMappingURL=events-DDOsDu4X.d.ts.map