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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/combobox/index.cjs +1 -1
  2. package/dist/combobox/index.cjs.map +1 -1
  3. package/dist/combobox/index.d.ts +842 -834
  4. package/dist/combobox/index.js +1 -1
  5. package/dist/combobox/index.js.map +1 -1
  6. package/dist/command-menu/index.cjs +1 -1
  7. package/dist/command-menu/index.cjs.map +1 -1
  8. package/dist/command-menu/index.d.ts +123 -96
  9. package/dist/command-menu/index.js +1 -1
  10. package/dist/command-menu/index.js.map +1 -1
  11. package/dist/context-menu/index.cjs +1 -1
  12. package/dist/context-menu/index.cjs.map +1 -1
  13. package/dist/context-menu/index.d.ts +701 -658
  14. package/dist/context-menu/index.js +1 -1
  15. package/dist/context-menu/index.js.map +1 -1
  16. package/dist/dropdown-menu/index.cjs +1 -1
  17. package/dist/dropdown-menu/index.cjs.map +1 -1
  18. package/dist/dropdown-menu/index.d.ts +723 -680
  19. package/dist/dropdown-menu/index.js +1 -1
  20. package/dist/dropdown-menu/index.js.map +1 -1
  21. package/dist/events-DDOsDu4X.d.ts +2091 -0
  22. package/dist/index-Cabqj7qI.d.ts +2003 -0
  23. package/dist/index-D8OrKThQ.d.ts +977 -0
  24. package/dist/internal/listbox/index.cjs +1 -2
  25. package/dist/internal/listbox/index.d.ts +2 -272
  26. package/dist/internal/listbox/index.js +1 -2
  27. package/dist/internal/popup-menu/index.cjs +1 -2
  28. package/dist/internal/popup-menu/index.d.ts +4 -238
  29. package/dist/internal/popup-menu/index.js +1 -2
  30. package/dist/items-CD2hw6-3.js +2 -0
  31. package/dist/items-CD2hw6-3.js.map +1 -0
  32. package/dist/items-DYDljwnt.cjs +2 -0
  33. package/dist/items-DYDljwnt.cjs.map +1 -0
  34. package/dist/{items-B6HeFO_8.d.cts → items-ceX--VIv.d.ts} +21 -19
  35. package/dist/kbd/index.cjs +1 -1
  36. package/dist/kbd/index.cjs.map +1 -1
  37. package/dist/kbd/index.d.ts +35 -35
  38. package/dist/kbd/index.js +1 -1
  39. package/dist/kbd/index.js.map +1 -1
  40. package/dist/listbox-CnwUlLZA.js +2 -0
  41. package/dist/listbox-CnwUlLZA.js.map +1 -0
  42. package/dist/listbox-DYvJTiF6.cjs +2 -0
  43. package/dist/listbox-DYvJTiF6.cjs.map +1 -0
  44. package/dist/loaders/index.cjs +1 -1
  45. package/dist/loaders/index.cjs.map +1 -1
  46. package/dist/loaders/index.d.ts +218 -188
  47. package/dist/loaders/index.js +1 -1
  48. package/dist/loaders/index.js.map +1 -1
  49. package/dist/merge-element-props-0mpNO7ZH.cjs +2 -0
  50. package/dist/merge-element-props-0mpNO7ZH.cjs.map +1 -0
  51. package/dist/merge-element-props-PxUvRHax.js +2 -0
  52. package/dist/merge-element-props-PxUvRHax.js.map +1 -0
  53. package/dist/platform-C-sxBTRa.cjs +2 -0
  54. package/dist/platform-C-sxBTRa.cjs.map +1 -0
  55. package/dist/platform-C4_cGUkS.js +2 -0
  56. package/dist/platform-C4_cGUkS.js.map +1 -0
  57. package/dist/popup-menu-BBAzAXIe.cjs +2 -0
  58. package/dist/popup-menu-BBAzAXIe.cjs.map +1 -0
  59. package/dist/popup-menu-HmBMJEZc.js +2 -0
  60. package/dist/popup-menu-HmBMJEZc.js.map +1 -0
  61. package/dist/resolve-state-props-C-zbhdXd.cjs +2 -0
  62. package/dist/resolve-state-props-C-zbhdXd.cjs.map +1 -0
  63. package/dist/resolve-state-props-D31kizRZ.js +2 -0
  64. package/dist/resolve-state-props-D31kizRZ.js.map +1 -0
  65. package/dist/rolldown-runtime-5lHFv1cW.cjs +1 -0
  66. package/dist/rolldown-runtime-DK3Fl9T5.js +1 -0
  67. package/dist/select/index.cjs +1 -1
  68. package/dist/select/index.cjs.map +1 -1
  69. package/dist/select/index.d.ts +835 -828
  70. package/dist/select/index.js +1 -1
  71. package/dist/select/index.js.map +1 -1
  72. package/dist/suggestion-menu/index.cjs +4 -0
  73. package/dist/suggestion-menu/index.cjs.map +1 -0
  74. package/dist/suggestion-menu/index.d.ts +359 -0
  75. package/dist/suggestion-menu/index.js +4 -0
  76. package/dist/suggestion-menu/index.js.map +1 -0
  77. package/dist/types-BbN28E3_.d.ts +50 -0
  78. package/dist/video-player/index.cjs +2 -2
  79. package/dist/video-player/index.cjs.map +1 -1
  80. package/dist/video-player/index.d.ts +964 -1000
  81. package/dist/video-player/index.js +2 -2
  82. package/dist/video-player/index.js.map +1 -1
  83. package/package.json +14 -5
  84. package/dist/ListboxStore-B8oTpM57.d.cts +0 -453
  85. package/dist/ListboxStore-CV5vPUUc.d.ts +0 -453
  86. package/dist/chunk-4C666HHU.js +0 -2
  87. package/dist/chunk-4C666HHU.js.map +0 -1
  88. package/dist/chunk-5T5B5SPR.cjs +0 -2
  89. package/dist/chunk-5T5B5SPR.cjs.map +0 -1
  90. package/dist/chunk-A4Z5BY7H.js +0 -2
  91. package/dist/chunk-A4Z5BY7H.js.map +0 -1
  92. package/dist/chunk-BEWVWSAW.cjs +0 -2
  93. package/dist/chunk-BEWVWSAW.cjs.map +0 -1
  94. package/dist/chunk-EDZTZHQ4.js +0 -2
  95. package/dist/chunk-EDZTZHQ4.js.map +0 -1
  96. package/dist/chunk-IT372NHF.js +0 -2
  97. package/dist/chunk-IT372NHF.js.map +0 -1
  98. package/dist/chunk-JFEVUUPC.cjs +0 -2
  99. package/dist/chunk-JFEVUUPC.cjs.map +0 -1
  100. package/dist/chunk-KO3DXT3Y.js +0 -2
  101. package/dist/chunk-KO3DXT3Y.js.map +0 -1
  102. package/dist/chunk-LXXK4S4Q.js +0 -2
  103. package/dist/chunk-LXXK4S4Q.js.map +0 -1
  104. package/dist/chunk-M4G6J7DP.cjs +0 -2
  105. package/dist/chunk-M4G6J7DP.cjs.map +0 -1
  106. package/dist/chunk-SCDHQZFI.cjs +0 -2
  107. package/dist/chunk-SCDHQZFI.cjs.map +0 -1
  108. package/dist/chunk-XMZZ62VJ.cjs +0 -2
  109. package/dist/chunk-XMZZ62VJ.cjs.map +0 -1
  110. package/dist/combobox/index.d.cts +0 -1066
  111. package/dist/command-menu/index.d.cts +0 -154
  112. package/dist/command-score-CTJ9NV6n.d.cts +0 -23
  113. package/dist/command-score-CTJ9NV6n.d.ts +0 -23
  114. package/dist/context-menu/index.d.cts +0 -696
  115. package/dist/dropdown-menu/index.d.cts +0 -723
  116. package/dist/events-BTHQ2OoH.d.ts +0 -1860
  117. package/dist/events-DVcrtGe3.d.cts +0 -1860
  118. package/dist/input-C95v6jB0.d.cts +0 -46
  119. package/dist/input-CYweYB_i.d.ts +0 -46
  120. package/dist/internal/listbox/index.cjs.map +0 -1
  121. package/dist/internal/listbox/index.d.cts +0 -272
  122. package/dist/internal/listbox/index.js.map +0 -1
  123. package/dist/internal/popup-menu/index.cjs.map +0 -1
  124. package/dist/internal/popup-menu/index.d.cts +0 -238
  125. package/dist/internal/popup-menu/index.js.map +0 -1
  126. package/dist/items-B6HeFO_8.d.ts +0 -37
  127. package/dist/kbd/index.d.cts +0 -61
  128. package/dist/loaders/index.d.cts +0 -363
  129. package/dist/loading-C6WZGUc3.d.cts +0 -29
  130. package/dist/loading-CC4n55sR.d.ts +0 -29
  131. package/dist/resolve-B-j0eW24.d.cts +0 -406
  132. package/dist/resolve-B1F-a3P1.d.ts +0 -406
  133. package/dist/scroll-arrow-BBoKckL_.d.cts +0 -544
  134. package/dist/scroll-arrow-fl3B5sVO.d.ts +0 -544
  135. package/dist/select/index.d.cts +0 -1005
  136. package/dist/separator-Dn15rte3.d.ts +0 -275
  137. package/dist/separator-NjsBVzek.d.cts +0 -275
  138. package/dist/surface-context-CGLDpMej.d.ts +0 -14
  139. package/dist/surface-context-CN4Lb_6F.d.cts +0 -14
  140. package/dist/type-guards-BHHzjRvZ.d.cts +0 -351
  141. package/dist/type-guards-C0e_GpeY.d.ts +0 -351
  142. package/dist/types-DT4FOOa2.d.cts +0 -51
  143. package/dist/types-DT4FOOa2.d.ts +0 -51
  144. package/dist/use-listbox-item-NzZuY34-.d.cts +0 -212
  145. package/dist/use-listbox-item-NzZuY34-.d.ts +0 -212
  146. package/dist/video-player/index.d.cts +0 -1391
@@ -0,0 +1,2003 @@
1
+ import { B as VirtualItem, L as ListboxStore, M as FilterFn, g as UseListboxItemReturn, h as UseListboxItemParams, q as GroupPositional, z as SearchNormalizer } from "./index-D8OrKThQ.js";
2
+ import { $t as PopupMenuItemState, Et as TreeItemDef, L as DisplayNode, M as DataSurfaceProps, N as DeepSearchConfig, Q as LinkItemDef, Qt as PopupMenuItemProps, a as PopupMenuOpenChangeReason, b as AsyncResultBehavior, c as PopupMenuIdScope, d as AsyncContentMode, f as AsyncLoaderConfig, h as AsyncLoaderResult, j as DataListChildrenState, l as PopupMenuNode, n as HighlightChangeEventDetails, nt as NodeDef, o as RadioValueChangeEventDetails, on as ChangeEventDetails, q as IncludeInDeepSearch, r as PopupMenuHighlightChangeHandler, s as GetResolvedIdFn, t as CheckboxValueChangeEventDetails, u as UnresolvedMenuNode, x as AsyncState } from "./events-DDOsDu4X.js";
3
+ import { n as ComponentRenderFn, t as ComponentProps } from "./types-BbN28E3_.js";
4
+ import * as React from "react";
5
+ import { ReactStore } from "@base-ui/utils/store";
6
+ import { Popover, PopoverArrowProps, PopoverBackdropProps, PopoverPopupProps, PopoverPortalProps, PopoverPositionerProps, PopoverRootProps } from "@base-ui/react/popover";
7
+ //#region src/internal/popup-menu/store/FocusOwnerStore.d.ts
8
+ interface FocusOwnerState {
9
+ /** Which surface currently owns focus (surfaceId or null) */
10
+ ownerId: string | null;
11
+ }
12
+ declare const selectors$1: {
13
+ ownerId: (state: FocusOwnerState) => string | null;
14
+ isOwner: (state: FocusOwnerState, surfaceId: string) => boolean;
15
+ };
16
+ /**
17
+ * Tracks which menu surface owns DOM focus.
18
+ * Single instance per menu tree (created at root, shared via context).
19
+ *
20
+ * Used by: DropdownMenu, ContextMenu
21
+ * Not used by: Select, CommandMenu (single surface)
22
+ */
23
+ declare class FocusOwnerStore extends ReactStore<FocusOwnerState, Record<string, never>, typeof selectors$1> {
24
+ constructor();
25
+ /**
26
+ * Set the owner surface ID.
27
+ * Call this when focus should transfer to a new surface.
28
+ */
29
+ setOwnerId(id: string | null): void;
30
+ /**
31
+ * Clear the owner (set to null).
32
+ * Call this when the menu tree closes.
33
+ */
34
+ clearOwner(): void;
35
+ }
36
+ //#endregion
37
+ //#region src/internal/popup-menu/contexts/focus-owner-context.d.ts
38
+ declare function useFocusOwner(): FocusOwnerStore;
39
+ //#endregion
40
+ //#region src/internal/popup-menu/store/OpenChainStore.d.ts
41
+ interface OpenChainState {
42
+ /**
43
+ * Ordered array of surface IDs for submenus that are currently open.
44
+ * The last element is the most recently opened (deepest in chain).
45
+ */
46
+ chain: string[];
47
+ }
48
+ declare const selectors: {
49
+ isOpen: (state: OpenChainState, surfaceId: string) => boolean;
50
+ isLast: (state: OpenChainState, surfaceId: string) => boolean;
51
+ /**
52
+ * Returns true if there's an open submenu below the given depth.
53
+ * - Root (depth 0): true if any submenu is open
54
+ * - Submenu at depth N: true if a deeper submenu is open
55
+ */
56
+ hasOpenSubmenu: (state: OpenChainState, depth: number) => boolean;
57
+ };
58
+ /**
59
+ * Tracks which submenu surfaces are currently open in order.
60
+ * Used to show backdrops for all open menus in the chain.
61
+ * Single instance per menu tree (created at root, shared via context).
62
+ *
63
+ * Used by: DropdownMenu, ContextMenu
64
+ * Not used by: Select, CommandMenu (no submenus)
65
+ */
66
+ declare class OpenChainStore extends ReactStore<OpenChainState, Record<string, never>, typeof selectors> {
67
+ constructor();
68
+ /**
69
+ * Mark a surface as open (adds to end of chain).
70
+ */
71
+ open(surfaceId: string): void;
72
+ /**
73
+ * Mark a surface as closed (removes from chain).
74
+ */
75
+ close(surfaceId: string): void;
76
+ /**
77
+ * Clear all open surfaces (menu tree closed).
78
+ */
79
+ clear(): void;
80
+ }
81
+ //#endregion
82
+ //#region src/internal/popup-menu/contexts/open-chain-context.d.ts
83
+ declare function useOpenChain(): OpenChainStore;
84
+ //#endregion
85
+ //#region src/internal/popup-menu/contexts/popup-menu-context.d.ts
86
+ /**
87
+ * Virtual anchor for positioning the menu at a specific point.
88
+ * Used by ContextMenu to position at cursor location.
89
+ */
90
+ interface VirtualAnchor {
91
+ getBoundingClientRect(): DOMRect;
92
+ }
93
+ /**
94
+ * Virtualization configuration passed from Root/Submenu to Surface.
95
+ */
96
+ interface VirtualizationConfig {
97
+ /** Whether virtualization mode is enabled */
98
+ virtualized: boolean;
99
+ /** Pre-registered items for virtualization */
100
+ items: VirtualItem[];
101
+ /**
102
+ * Callback when highlighted item changes (for scroll sync).
103
+ * The third parameter contains event details including the reason for the change.
104
+ */
105
+ onHighlightChange?: (id: string | null, index: number, eventDetails: HighlightChangeEventDetails) => void;
106
+ }
107
+ /**
108
+ * Shared context value for popup menus.
109
+ * Both DropdownMenu.Root and ContextMenu.Root provide this context.
110
+ */
111
+ interface PopupMenuContextValue {
112
+ /** The Listbox store instance */
113
+ store: ListboxStore;
114
+ /** Whether this menu tree currently ignores user interaction. */
115
+ disabled: boolean;
116
+ /** Nesting depth: 0 = root menu, 1+ = submenu */
117
+ depth: number;
118
+ /** Close the entire menu tree (deepest submenu to root, sequentially) */
119
+ closeAll: (reason?: PopupMenuOpenChangeReason, event?: Event) => void;
120
+ /**
121
+ * Internal: when true, Surface handles Tab explicitly (close the tree, or
122
+ * cycle through focus zones). Enabled only by DropdownMenu.Root and
123
+ * ContextMenu.Root — never Select or Combobox.
124
+ */
125
+ explicitTabBehavior: boolean;
126
+ /**
127
+ * Internal: what Tab does under `explicitTabBehavior` when the surface (and
128
+ * its ancestors) have no focus-zone tabbables. `'close'` closes the whole
129
+ * tree (dropdown/context-menu). `'inert'` swallows the event, keeping focus
130
+ * where it is (command palette).
131
+ */
132
+ tabWithoutZones: 'close' | 'inert';
133
+ /**
134
+ * Internal: DOM focus stays on an element outside the popup (Combobox's
135
+ * input, a suggestion menu's host input) for as long as the menu is open.
136
+ * The root popup then neither moves focus in on open nor returns it on close.
137
+ */
138
+ externalFocus: boolean;
139
+ /** Register a surface (submenu) for closeAll tracking. Returns unregister function. */
140
+ registerSurface: (depth: number, setOpen: (open: boolean) => void) => () => void;
141
+ /** Virtualization configuration (if enabled) */
142
+ virtualization?: VirtualizationConfig;
143
+ /**
144
+ * Virtual anchor for positioning.
145
+ * Used by ContextMenu to position at cursor location.
146
+ * DropdownMenu uses the Popover's anchor (trigger button) instead.
147
+ */
148
+ virtualAnchor?: VirtualAnchor;
149
+ /**
150
+ * Type of menu for positioning logic.
151
+ * - 'dropdown': positions relative to trigger button
152
+ * - 'context': positions at cursor with fixed positioning
153
+ */
154
+ menuType: 'dropdown' | 'context';
155
+ /**
156
+ * When to close the menu on outside interactions.
157
+ * - 'pointerdown': Close immediately when pointer is pressed outside (default)
158
+ * - 'click': Close when a full click (pointerdown + pointerup) occurs outside
159
+ * @default 'pointerdown'
160
+ */
161
+ closeOnOutsidePress: 'click' | 'pointerdown';
162
+ /**
163
+ * Whether shift-click and Shift+Enter perform range selection on checkbox items.
164
+ * @default true
165
+ */
166
+ rangeSelection: boolean;
167
+ /**
168
+ * Whether pressing a checkbox item and dragging performs drag selection, and
169
+ * how rows the pointer moves back over are treated.
170
+ * @default false
171
+ */
172
+ dragSelection: false | 'keep' | 'rubber-band';
173
+ /**
174
+ * Text announced to assistive technology after a range or drag selection
175
+ * changes rows. Defaults to English ("3 items checked").
176
+ */
177
+ getAriaSelectionText?: (count: number, checked: boolean) => string;
178
+ }
179
+ declare const PopupMenuContext: React.Context<PopupMenuContextValue | null>;
180
+ /**
181
+ * Hook to access the popup menu context.
182
+ * Throws if used outside a popup menu.
183
+ */
184
+ declare function usePopupMenuContext(): PopupMenuContextValue;
185
+ /**
186
+ * Hook to optionally access the popup menu context.
187
+ * Returns null if used outside a popup menu.
188
+ */
189
+ declare function useMaybePopupMenuContext(): PopupMenuContextValue | null;
190
+ //#endregion
191
+ //#region src/internal/popup-menu/contexts/popup-menu-debug-context.d.ts
192
+ interface PopupMenuSafeTriangleAreaDebugOptions {
193
+ enabled?: boolean;
194
+ idleColor?: string;
195
+ successColor?: string;
196
+ missColor?: string;
197
+ triangleFillOpacity?: number;
198
+ overlayOpacity?: number;
199
+ showStroke?: boolean;
200
+ strokeWidth?: number;
201
+ strokeDasharray?: string;
202
+ showDots?: boolean;
203
+ dotRadius?: number;
204
+ freezeOnPointerLeave?: boolean;
205
+ persistOnSuccess?: boolean;
206
+ showMissState?: boolean;
207
+ missFreezeDuration?: number;
208
+ }
209
+ type PopupMenuSafeTriangleAreaDebugConfig = boolean | PopupMenuSafeTriangleAreaDebugOptions;
210
+ /**
211
+ * Debug configuration available on popup-menu roots.
212
+ */
213
+ interface PopupMenuDebugOptions {
214
+ /**
215
+ * Shows/configures the safe triangle area used by submenu aim guard.
216
+ * @default false
217
+ */
218
+ showSafeTriangleArea?: PopupMenuSafeTriangleAreaDebugConfig;
219
+ /**
220
+ * @deprecated Use `showSafeTriangleArea` instead.
221
+ */
222
+ showSubmenuSafeTriangleArea?: boolean;
223
+ /**
224
+ * Enables console logging for aim-guard diagnostics.
225
+ * @default false
226
+ */
227
+ logAimGuardEvents?: boolean;
228
+ }
229
+ //#endregion
230
+ //#region src/internal/popup-menu/contexts/popup-surface-id-context.d.ts
231
+ /**
232
+ * Context for passing surfaceId from Popup to Surface.
233
+ * This ensures Popup and Surface share the same ID for data attribute tracking.
234
+ *
235
+ * For root menus, Popup generates the ID and provides it via this context.
236
+ * For submenus, the ID comes from SubmenuContext.childSurfaceId instead.
237
+ */
238
+ declare const PopupSurfaceIdContext: React.Context<string | null>;
239
+ //#endregion
240
+ //#region src/internal/popup-menu/contexts/submenu-context.d.ts
241
+ interface SubmenuContextValue {
242
+ /** Whether the submenu is open */
243
+ open: boolean;
244
+ /** Set the submenu open state */
245
+ setOpen: (open: boolean) => void;
246
+ /**
247
+ * Latch set by explicit close actions (keyboard ArrowLeft/Ctrl+H/Escape-in-submenu,
248
+ * or clicking the open trigger). While set and the trigger remains highlighted,
249
+ * pointer/keyboard auto-open is suppressed. Reset when highlight leaves the trigger.
250
+ */
251
+ suppressAutoOpenRef: React.MutableRefObject<boolean>;
252
+ /** Reference to the trigger element */
253
+ triggerRef: React.RefObject<HTMLElement | null>;
254
+ /** Reference to the submenu content element (for aim guard rect calculations) */
255
+ contentRef: React.RefObject<HTMLElement | null>;
256
+ /** Surface ID of the parent menu (for keyboard navigation back) */
257
+ parentSurfaceId: string;
258
+ /** Surface ID of this submenu (for keyboard navigation into) */
259
+ childSurfaceId: string;
260
+ /**
261
+ * Whether pressing Escape in this submenu closes the entire menu from the root.
262
+ * When true, Escape closes the entire menu tree.
263
+ * When false, Escape only closes this submenu and moves focus to the parent.
264
+ * @default true
265
+ */
266
+ closeRootOnEsc: boolean;
267
+ }
268
+ declare function useSubmenuContext(): SubmenuContextValue;
269
+ declare function useMaybeSubmenuContext(): SubmenuContextValue | null;
270
+ //#endregion
271
+ //#region src/internal/popup-menu/contexts/subpage-context.d.ts
272
+ interface SubpageContextValue {
273
+ /** Current page ID. */
274
+ pageId: string;
275
+ /** Surface ID for this page. */
276
+ surfaceId: string;
277
+ /** Surface ID for the previous page, if available. */
278
+ parentSurfaceId: string | null;
279
+ /** Whether this page is currently active. */
280
+ isActive: boolean;
281
+ /** Whether Escape should close the entire menu tree from this page. */
282
+ closeRootOnEsc: boolean;
283
+ /** Navigate back one page. Returns true when navigation happened. */
284
+ goBack: () => boolean;
285
+ }
286
+ declare function useSubpageContext(): SubpageContextValue;
287
+ declare function useMaybeSubpageContext(): SubpageContextValue | null;
288
+ //#endregion
289
+ //#region src/internal/popup-menu/contexts/subpage-stack-context.d.ts
290
+ interface SubpageRegistration {
291
+ pageId: string;
292
+ surfaceId: string;
293
+ closeRootOnEsc: boolean;
294
+ }
295
+ interface SubpageStackContextValue {
296
+ /** Active page ID; `null` when the root surface is active. */
297
+ activePageId: string | null;
298
+ /** Surface ID of the root surface. */
299
+ rootSurfaceId: string;
300
+ /** Surface ID for the currently active page. */
301
+ activeSurfaceId: string;
302
+ /** Whether there is a previous page to navigate back to. */
303
+ canGoBack: boolean;
304
+ /** Whether Escape in the active page should close the entire menu tree. */
305
+ shouldCloseRootOnEsc: boolean;
306
+ /** Open page IDs, bottom to top; empty at root. */
307
+ stack: readonly string[];
308
+ /** Register a page and return an unregister cleanup. */
309
+ registerPage: (registration: SubpageRegistration) => () => void;
310
+ /** Push a page onto the stack. Returns true when navigation happened. */
311
+ openPage: (pageId: string) => boolean;
312
+ /** Pop one page from the stack. Returns true when navigation happened. */
313
+ goBack: () => boolean;
314
+ /** Resolve a surface ID for a page ID. */
315
+ getSurfaceId: (pageId: string) => string | null;
316
+ }
317
+ declare const SubpageStackContext: React.Context<SubpageStackContextValue | null>;
318
+ declare function useSubpageStack(): SubpageStackContextValue;
319
+ declare function useMaybeSubpageStack(): SubpageStackContextValue | null;
320
+ //#endregion
321
+ //#region src/internal/popup-menu/menu-tree/resolver.d.ts
322
+ /**
323
+ * Owns the single resolved node tree for one menu root. Content may be
324
+ * re-supplied at any time (`setContent`) and late defs may be grafted under
325
+ * an already-resolved parent (`graft`); both reconcile by id with a
326
+ * reference fast path, so node instances are stable and repeat calls with
327
+ * identical arguments are no-ops.
328
+ */
329
+ interface MenuTreeResolver {
330
+ /** The Resolved ID seam this resolver was created with. */
331
+ readonly getResolvedId: GetResolvedIdFn;
332
+ /** Definition Key uniqueness policy, captured when this resolver is created. */
333
+ readonly idScope: PopupMenuIdScope;
334
+ /** Current root nodes, in def order. */
335
+ readonly rootNodes: readonly PopupMenuNode[];
336
+ /** Re-supply the root def list and reconcile the whole tree. */
337
+ setContent(defs: readonly NodeDef[]): void;
338
+ /**
339
+ * Resolve `defs` under `parent` (the graft point) and reconcile them
340
+ * against `parent.children`. `defs` is the parent's full child list
341
+ * from the graft source's perspective (static + late defs).
342
+ */
343
+ graft(parent: PopupMenuNode, defs: readonly NodeDef[]): void;
344
+ /** Node whose current `def` is reference-equal to `def`, if any. */
345
+ getNodeForDef<D extends NodeDef>(def: D): PopupMenuNode<D> | undefined;
346
+ /** First registration wins; best-effort when ids collide. */
347
+ getNodeById(id: string): PopupMenuNode | undefined;
348
+ }
349
+ //#endregion
350
+ //#region src/internal/popup-menu/hooks/use-popup-menu-root.d.ts
351
+ interface UsePopupMenuRootParams {
352
+ /**
353
+ * Computes canonical Resolved IDs for data-first content from the Unresolved Menu Node (definitional facts only).
354
+ * @default explicit `def.id` verbatim, else the joined definition path
355
+ * Read once when the menu root mounts — later changes have no effect.
356
+ */
357
+ getResolvedId?: GetResolvedIdFn;
358
+ /** Definition Key uniqueness scope. Read once when the menu root mounts. */
359
+ idScope?: PopupMenuIdScope;
360
+ /**
361
+ * Callback when the open state changes.
362
+ * The second parameter contains event details including the reason for the change.
363
+ */
364
+ onOpenChange?: (open: boolean, eventDetails: ChangeEventDetails<string>) => void;
365
+ /**
366
+ * Whether the menu is initially open.
367
+ * @default false
368
+ */
369
+ defaultOpen?: boolean;
370
+ /**
371
+ * Whether virtualization mode is enabled.
372
+ * @default false
373
+ */
374
+ virtualized?: boolean;
375
+ /**
376
+ * Pre-registered items for virtualization.
377
+ */
378
+ items?: VirtualItem[];
379
+ /**
380
+ * Callback when the highlighted item changes. `id` is first; `node` is the
381
+ * resolved menu node enrichment and may be null.
382
+ * The fourth parameter contains event details including the reason for the change.
383
+ */
384
+ onHighlightChange?: PopupMenuHighlightChangeHandler<HighlightChangeEventDetails>;
385
+ /**
386
+ * When to close the menu on outside interactions.
387
+ * - 'pointerdown': Close immediately when pointer is pressed outside (default)
388
+ * - 'click': Close when a full click (pointerdown + pointerup) occurs outside
389
+ * @default 'pointerdown'
390
+ */
391
+ closeOnOutsidePress?: 'click' | 'pointerdown';
392
+ /**
393
+ * Elements outside the menu that don't dismiss it (e.g. a suggestion menu's
394
+ * host input): pressing one, or moving focus from the menu to one, is not an
395
+ * outside press or a focus-out. Read when the event happens, so the returned
396
+ * elements may change over time.
397
+ */
398
+ getDismissExemptElements?: () => ReadonlyArray<Element | null | undefined>;
399
+ /**
400
+ * Whether the menu should ignore user interaction.
401
+ * Can be controlled declaratively via this prop, or imperatively via actionsRef.setDisabled().
402
+ * @default false
403
+ */
404
+ disabled?: boolean;
405
+ /**
406
+ * Initial disabled state for imperative usage.
407
+ * Ignored when `disabled` prop is true.
408
+ * @default false
409
+ */
410
+ defaultDisabled?: boolean;
411
+ }
412
+ interface PopupMenuRootActions {
413
+ /** Close the menu tree imperatively. */
414
+ close: () => void;
415
+ /** Unmount the popup imperatively (when keep-mounted mode is enabled). */
416
+ unmount: () => void;
417
+ /** Enable/disable the menu tree imperatively. */
418
+ setDisabled: (disabled: boolean) => void;
419
+ }
420
+ interface UsePopupMenuRootReturn {
421
+ /** The menu-tree resolver for this menu root. */
422
+ menuTreeResolver: MenuTreeResolver;
423
+ /** The Listbox store instance */
424
+ store: ListboxStore;
425
+ /** The FocusOwner store instance */
426
+ focusOwnerStore: FocusOwnerStore;
427
+ /** The OpenChain store instance */
428
+ openChainStore: OpenChainStore;
429
+ /** Register a surface (submenu) for closeAll tracking */
430
+ registerSurface: (depth: number, setOpen: (open: boolean) => void) => () => void;
431
+ /** Close the entire menu tree */
432
+ closeAll: (reason?: PopupMenuOpenChangeReason, event?: Event) => void;
433
+ /** Virtualization configuration (if enabled) */
434
+ virtualization: VirtualizationConfig | undefined;
435
+ /** Handle open state change (updates store and clears stores on close) */
436
+ handleOpenChange: (open: boolean, reason?: PopupMenuOpenChangeReason, event?: Event) => void;
437
+ /** Whether the menu currently ignores user interaction. */
438
+ disabled: boolean;
439
+ /** Update imperative disabled state. */
440
+ setDisabled: (disabled: boolean) => void;
441
+ }
442
+ /**
443
+ * Hook that creates and manages the core stores and utilities for popup menus.
444
+ * Used by both DropdownMenu.Root and ContextMenu.Root.
445
+ *
446
+ * Provides:
447
+ * - ListboxStore for item management
448
+ * - FocusOwnerStore for focus tracking across submenus
449
+ * - OpenChainStore for tracking open submenu chain
450
+ * - Surface registry for closeAll functionality
451
+ */
452
+ declare function usePopupMenuRoot(params?: UsePopupMenuRootParams): UsePopupMenuRootReturn;
453
+ //#endregion
454
+ //#region src/internal/popup-menu/hooks/use-subpage-stack-state.d.ts
455
+ interface UseSubpageStackStateParams {
456
+ /** Surface ID of the root surface (the popup's own surface). */
457
+ surfaceId: string;
458
+ /** Listbox store; used to chain onPopupCloseComplete reset. Null-safe. */
459
+ store: ListboxStore | null;
460
+ }
461
+ interface UseSubpageStackStateReturn {
462
+ /** Context value provided to SubpageStackContext consumers. */
463
+ subpageStackContextValue: SubpageStackContextValue;
464
+ /** Whether subpage navigation is in its transient animation window. */
465
+ isSubpageNavigating: boolean;
466
+ /** Whether any subpage is currently open. */
467
+ hasOpenSubpage: boolean;
468
+ /** Active subpage ID, or null when the root surface is active. */
469
+ subpageId: string | null;
470
+ /** Ordered stack of open subpage IDs. */
471
+ openSubpageIds: string[];
472
+ }
473
+ /**
474
+ * Centralized subpage stack state for popup menu surfaces.
475
+ */
476
+ declare function useSubpageStackState(params: UseSubpageStackStateParams): UseSubpageStackStateReturn;
477
+ //#endregion
478
+ //#region src/internal/popup-menu/components/arrow/arrow.d.ts
479
+ interface PopupMenuArrowProps extends PopoverArrowProps {}
480
+ /**
481
+ * An optional arrow element to render alongside the popup menu.
482
+ * This can be used to help visually link the trigger with the popup.
483
+ * Must be rendered inside `Popup`.
484
+ * Renders a `<div>` element.
485
+ */
486
+ declare const PopupMenuArrow: React.ForwardRefExoticComponent<Omit<PopupMenuArrowProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
487
+ declare namespace PopupMenuArrow {
488
+ type Props = PopupMenuArrowProps;
489
+ type State = Popover.Arrow.State;
490
+ }
491
+ //#endregion
492
+ //#region src/internal/popup-menu/components/backdrop/backdrop.d.ts
493
+ interface PopupMenuBackdropProps extends PopoverBackdropProps {
494
+ /**
495
+ * Controls when the backdrop becomes visible for submenus.
496
+ * - `"focus"`: Show when the submenu becomes the focus owner (prevents flicker on hover).
497
+ * If a deeper submenu is open, the backdrop remains visible.
498
+ * - `"open"`: Show as soon as the submenu opens, regardless of focus.
499
+ *
500
+ * @default "focus" for submenus, "open" for root menu
501
+ */
502
+ showOn?: 'focus' | 'open';
503
+ }
504
+ /**
505
+ * An overlay displayed beneath the popup menu.
506
+ *
507
+ * For submenus with `showOn="focus"` (default), the backdrop visibility follows these rules:
508
+ * - If this submenu is at the end of the open chain (deepest), it must be
509
+ * the focus owner to show the backdrop (prevents flicker on hover)
510
+ * - If this submenu is in the chain but not at the end (has a deeper submenu open),
511
+ * the backdrop remains visible
512
+ *
513
+ * With `showOn="open"`, the backdrop shows as soon as the submenu opens.
514
+ *
515
+ * Renders a `<div>` element with `pointer-events: none`.
516
+ */
517
+ declare const PopupMenuBackdrop: React.ForwardRefExoticComponent<Omit<PopupMenuBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
518
+ declare namespace PopupMenuBackdrop {
519
+ type Props = PopupMenuBackdropProps;
520
+ type State = Popover.Backdrop.State;
521
+ }
522
+ //#endregion
523
+ //#region src/internal/popup-menu/components/popup/popup.data-attrs.d.ts
524
+ declare enum PopupMenuPopupDataAttributes {
525
+ /**
526
+ * Identifies the component part.
527
+ * @type {'bazzaui-dropdown-menu-popup' | 'bazzaui-context-menu-popup' | 'bazzaui-select-popup' | 'bazzaui-combobox-popup'}
528
+ */
529
+ slot = "bazzaui-[component]-popup",
530
+ /**
531
+ * Present when the popup menu is open.
532
+ */
533
+ open = "data-open",
534
+ /**
535
+ * Present when the popup menu is closed.
536
+ */
537
+ closed = "data-closed",
538
+ /**
539
+ * Indicates which side the popup is positioned relative to the trigger.
540
+ * @type {'top' | 'bottom' | 'left' | 'right'}
541
+ */
542
+ side = "data-side",
543
+ /**
544
+ * Indicates how the popup is aligned relative to specified side.
545
+ * @type {'start' | 'center' | 'end'}
546
+ */
547
+ align = "data-align",
548
+ /**
549
+ * Present when the popup is animating in.
550
+ */
551
+ startingStyle = "data-starting-style",
552
+ /**
553
+ * Present when the popup is animating out.
554
+ */
555
+ endingStyle = "data-ending-style",
556
+ /**
557
+ * Present if animations should be instant.
558
+ * @type {'click' | 'dismiss'}
559
+ */
560
+ instant = "data-instant",
561
+ /**
562
+ * Present when this popup's surface is the focus owner.
563
+ * Useful for styling the currently focused menu in a submenu chain.
564
+ */
565
+ focused = "data-focused",
566
+ /**
567
+ * Present when this popup has an open submenu below it in the menu tree.
568
+ * Useful for styling all parent menus in an open submenu chain.
569
+ */
570
+ hasOpenSubmenu = "data-has-open-submenu",
571
+ /**
572
+ * Present when this popup is a submenu (not the root menu).
573
+ * Useful for applying different styles to submenus vs root menus.
574
+ */
575
+ submenu = "data-submenu",
576
+ /**
577
+ * Present while navigating between subpages in this popup.
578
+ * Useful for temporary transition adjustments during subpage focus handoff.
579
+ */
580
+ navigating = "data-navigating"
581
+ }
582
+ //#endregion
583
+ //#region src/internal/popup-menu/components/popup/popup.d.ts
584
+ interface PopupMenuPopupState extends Popover.Popup.State {
585
+ /**
586
+ * Whether this popup is a submenu (not the root menu).
587
+ */
588
+ isSubmenu: boolean;
589
+ /**
590
+ * Whether any non-root subpage is currently open.
591
+ */
592
+ hasOpenSubpage: boolean;
593
+ /**
594
+ * Active subpage ID, or null when the root surface is active.
595
+ */
596
+ subpageId: string | null;
597
+ /**
598
+ * Ordered stack of open non-root subpage IDs.
599
+ * For nested subpages this includes each page in open order.
600
+ */
601
+ openSubpageIds: string[];
602
+ }
603
+ interface PopupMenuPopupProps extends Omit<PopoverPopupProps, 'className' | 'render'> {
604
+ /**
605
+ * CSS class applied to the element, or a function that
606
+ * returns a class based on the component's state.
607
+ */
608
+ className?: string | ((state: PopupMenuPopupState) => string);
609
+ /**
610
+ * Allows replacing the popup element with a custom element.
611
+ * The render state includes popup + subpage navigation state.
612
+ */
613
+ render?: React.ReactElement | ComponentRenderFn<React.HTMLAttributes<HTMLElement>, PopupMenuPopupState>;
614
+ }
615
+ /**
616
+ * A container for the popup menu contents.
617
+ * Wraps Popover.Popup with:
618
+ * - Aim guard clearing when pointer enters submenu
619
+ * - Focus ownership transfer when pointer enters submenu
620
+ * - Auto-focus disabled for submenus (focus managed by FocusOwner system)
621
+ *
622
+ * Renders a `<div>` element.
623
+ */
624
+ declare const PopupMenuPopup: React.ForwardRefExoticComponent<Omit<PopupMenuPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
625
+ declare namespace PopupMenuPopup {
626
+ type Props = PopupMenuPopupProps;
627
+ type State = PopupMenuPopupState;
628
+ }
629
+ //#endregion
630
+ //#region src/internal/popup-menu/components/portal/portal.d.ts
631
+ interface PopupMenuPortalProps extends PopoverPortalProps {}
632
+ /**
633
+ * A portal element that moves the popup to a different part of the DOM.
634
+ * By default, the portal element is appended to `<body>`.
635
+ */
636
+ declare const PopupMenuPortal: import("react").ForwardRefExoticComponent<Omit<PopoverPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
637
+ declare namespace PopupMenuPortal {
638
+ type Props = PopoverPortalProps;
639
+ type State = Popover.Portal.State;
640
+ }
641
+ //#endregion
642
+ //#region src/internal/popup-menu/components/positioner/positioner.css-vars.d.ts
643
+ declare enum PopupMenuPositionerCssVars {
644
+ /**
645
+ * The available width between the trigger and the edge of the viewport.
646
+ * @type {number}
647
+ */
648
+ availableWidth = "--available-width",
649
+ /**
650
+ * The available height between the trigger and the edge of the viewport.
651
+ * @type {number}
652
+ */
653
+ availableHeight = "--available-height",
654
+ /**
655
+ * The anchor's width.
656
+ * @type {number}
657
+ */
658
+ anchorWidth = "--anchor-width",
659
+ /**
660
+ * The anchor's height.
661
+ * @type {number}
662
+ */
663
+ anchorHeight = "--anchor-height",
664
+ /**
665
+ * The coordinates that this element is anchored to. Used for animations and transitions.
666
+ * @type {string}
667
+ */
668
+ transformOrigin = "--transform-origin",
669
+ /**
670
+ * The width of the positioner element.
671
+ * @type {number}
672
+ */
673
+ positionerWidth = "--positioner-width",
674
+ /**
675
+ * The height of the positioner element.
676
+ * @type {number}
677
+ */
678
+ positionerHeight = "--positioner-height"
679
+ }
680
+ //#endregion
681
+ //#region src/internal/popup-menu/components/positioner/positioner.d.ts
682
+ /**
683
+ * Extended align options for popup menus.
684
+ * - 'start' | 'center' | 'end': Standard Base UI alignment
685
+ * - 'list-start': Align trigger top with the top of the List component (horizontal sides only)
686
+ */
687
+ type PopupMenuPositionerAlign = PopoverPositionerProps['align'] | 'list-start';
688
+ interface PopupMenuPositionerProps extends Omit<PopoverPositionerProps, 'align' | 'style'> {
689
+ /**
690
+ * Override the virtual anchor from context.
691
+ * Useful for nested menus that need different positioning.
692
+ */
693
+ virtualAnchor?: {
694
+ getBoundingClientRect(): DOMRect;
695
+ };
696
+ /**
697
+ * How to align the popup relative to the specified side.
698
+ * - 'start': align to start of anchor
699
+ * - 'center': align to center of anchor
700
+ * - 'end': align to end of anchor
701
+ * - 'list-start': align the List component's top with the anchor top (horizontal sides only)
702
+ * @default 'start' for submenus, 'center' for root dropdowns
703
+ */
704
+ align?: PopupMenuPositionerAlign;
705
+ /**
706
+ * Custom styles for the positioner.
707
+ * Note: During list-start alignment measurement, `transition: 'none'` is
708
+ * temporarily applied to prevent visual flash.
709
+ */
710
+ style?: React.CSSProperties;
711
+ }
712
+ /**
713
+ * Positions the popup menu against its anchor.
714
+ * Wraps Popover.Positioner with:
715
+ * - Automatic virtualAnchor from PopupMenuContext (for context menus)
716
+ * - Smart default positioning based on depth and menu type
717
+ * - Smart collision avoidance: shift for horizontal menus, flip for vertical
718
+ * - 'list-start' alignment for horizontal submenus
719
+ *
720
+ * Renders a `<div>` element.
721
+ */
722
+ declare const PopupMenuPositioner: React.ForwardRefExoticComponent<Omit<PopupMenuPositionerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
723
+ declare namespace PopupMenuPositioner {
724
+ type Props = PopupMenuPositionerProps;
725
+ type State = Popover.Positioner.State;
726
+ }
727
+ //#endregion
728
+ //#region src/internal/popup-menu/contexts/component-name-context.d.ts
729
+ /**
730
+ * Component name used for generating bazzaui-* slot attributes.
731
+ * E.g., 'dropdown-menu', 'context-menu', 'select', 'combobox', 'command-menu'
732
+ */
733
+ type ComponentName = 'dropdown-menu' | 'context-menu' | 'select' | 'combobox' | 'command-menu' | 'suggestion-menu';
734
+ //#endregion
735
+ //#region src/internal/popup-menu/components/providers.d.ts
736
+ interface PopupMenuProvidersProps {
737
+ /** Created by `usePopupMenuRoot`, one per menu root. */
738
+ menuTreeResolver: MenuTreeResolver;
739
+ /** The Listbox store instance */
740
+ store: ListboxStore;
741
+ /** The FocusOwner store instance */
742
+ focusOwnerStore: FocusOwnerStore;
743
+ /** The OpenChain store instance */
744
+ openChainStore: OpenChainStore;
745
+ /** Whether this menu tree currently ignores user interaction */
746
+ disabled: boolean;
747
+ /** Nesting depth: 0 = root menu */
748
+ depth: number;
749
+ /** Close the entire menu tree */
750
+ closeAll: () => void;
751
+ /**
752
+ * Internal: when true, Surface handles Tab explicitly (close the tree, or
753
+ * cycle through focus zones). Enabled only by DropdownMenu.Root and
754
+ * ContextMenu.Root — never Select or Combobox.
755
+ */
756
+ explicitTabBehavior?: boolean;
757
+ /**
758
+ * Internal: what Tab does under `explicitTabBehavior` when the surface (and
759
+ * its ancestors) have no focus-zone tabbables. `'close'` closes the whole
760
+ * tree (dropdown/context-menu). `'inert'` swallows the event, keeping focus
761
+ * where it is (command palette).
762
+ */
763
+ tabWithoutZones?: 'close' | 'inert';
764
+ /**
765
+ * Internal: DOM focus stays on an element outside the popup for as long as
766
+ * the menu is open, so the root popup neither takes nor returns focus.
767
+ */
768
+ externalFocus?: boolean;
769
+ /** Register a surface for closeAll tracking */
770
+ registerSurface: (depth: number, setOpen: (open: boolean) => void) => () => void;
771
+ /** Virtualization configuration */
772
+ virtualization?: VirtualizationConfig;
773
+ /** Debug visualization flags. */
774
+ debug?: PopupMenuDebugOptions;
775
+ /**
776
+ * Virtual anchor for positioning (used by ContextMenu).
777
+ * DropdownMenu uses Popover's anchor (trigger button) instead.
778
+ */
779
+ virtualAnchor?: VirtualAnchor;
780
+ /**
781
+ * Type of menu for positioning logic.
782
+ * @default 'dropdown'
783
+ */
784
+ menuType?: 'dropdown' | 'context';
785
+ /**
786
+ * When to close the menu on outside interactions.
787
+ * @default 'pointerdown'
788
+ */
789
+ closeOnOutsidePress?: 'click' | 'pointerdown';
790
+ /**
791
+ * Whether shift-click and Shift+Enter perform range selection on checkbox items.
792
+ * @default true
793
+ */
794
+ rangeSelection?: boolean;
795
+ /**
796
+ * Whether pressing a checkbox item and dragging performs drag selection, and
797
+ * how rows the pointer moves back over are treated.
798
+ * @default false
799
+ */
800
+ dragSelection?: false | 'keep' | 'rubber-band';
801
+ /**
802
+ * Text announced to assistive technology after a range or drag selection
803
+ * changes rows. Defaults to English ("3 items checked").
804
+ */
805
+ getAriaSelectionText?: (count: number, checked: boolean) => string;
806
+ /**
807
+ * Component name for generating bazzaui-* slot attributes.
808
+ * E.g., 'dropdown-menu', 'context-menu', 'select', 'combobox'
809
+ */
810
+ componentName: ComponentName;
811
+ children: React.ReactNode;
812
+ }
813
+ /**
814
+ * Provides all shared context providers for popup menus.
815
+ * Wraps children with:
816
+ * - PopupMenuDebugContext (debug visualization flags)
817
+ * - PopupMenuContext (menu-specific state)
818
+ * - ListboxContextProvider (for compatibility with listbox components)
819
+ * - AimGuardProvider (for submenu aim detection)
820
+ * - FocusOwnerContext (for focus tracking across submenus)
821
+ * - OpenChainContext (for tracking open submenu chain)
822
+ */
823
+ declare function PopupMenuProviders(props: PopupMenuProvidersProps): React.JSX.Element;
824
+ //#endregion
825
+ //#region src/internal/popup-menu/hooks/use-popup-menu-keyboard.d.ts
826
+ interface UsePopupMenuKeyboardParams {
827
+ /** The Listbox store instance */
828
+ store: ListboxStore;
829
+ /** Unique identifier for this surface */
830
+ surfaceId: string;
831
+ /** The FocusOwner store for managing focus ownership */
832
+ focusOwnerStore: FocusOwnerStore;
833
+ /** Menu depth (0 for root, >0 for submenus) */
834
+ depth: number;
835
+ /** Submenu context for ArrowLeft navigation back to parent */
836
+ submenuContext: SubmenuContextValue | null;
837
+ /** Subpage context for back-stack navigation */
838
+ subpageContext?: SubpageContextValue | null;
839
+ /** Whether keyboard handling is enabled */
840
+ enabled: boolean;
841
+ /** Whether the menu currently ignores user interaction. */
842
+ disabled?: boolean;
843
+ /**
844
+ * Whether to enable type-to-search behavior.
845
+ * When true, printable characters will activate the input and set pending search.
846
+ * Used by List when hideUntilActive is enabled and input is not yet active.
847
+ * @default false
848
+ */
849
+ enableTypeToSearch?: boolean;
850
+ /** User's onKeyDown handler to compose with */
851
+ onKeyDown?: React.KeyboardEventHandler;
852
+ /**
853
+ * Callback to close the entire menu tree from the root.
854
+ * Used when Escape is pressed and closeRootOnEsc is true (default).
855
+ */
856
+ closeAll: () => void;
857
+ /**
858
+ * Whether to skip the focus owner check.
859
+ * When true, keyboard handling will work based on `enabled` prop alone,
860
+ * ignoring focus ownership. Useful for Combobox where the input is outside
861
+ * the Surface but should still handle keyboard navigation.
862
+ * @default false
863
+ */
864
+ skipFocusOwnerCheck?: boolean;
865
+ }
866
+ interface UsePopupMenuKeyboardReturn {
867
+ /** Keyboard event handler to attach to the element */
868
+ handleKeyDown: React.KeyboardEventHandler;
869
+ }
870
+ /**
871
+ * Centralized keyboard navigation hook for popup menus.
872
+ * Handles arrow navigation, vim bindings, submenu open/close, and selection.
873
+ */
874
+ declare function usePopupMenuKeyboard(params: UsePopupMenuKeyboardParams): UsePopupMenuKeyboardReturn;
875
+ //#endregion
876
+ //#region src/internal/popup-menu/hooks/use-forwarded-key-down.d.ts
877
+ /** A key press from an element outside the menu: a DOM event or a React one. */
878
+ type ForwardedKeyboardEvent = KeyboardEvent | React.KeyboardEvent;
879
+ /**
880
+ * Handles a key press that happened outside the menu. Returns `true` when the
881
+ * menu used the key (and prevented its default action), `false` when the key
882
+ * should keep its normal meaning in the element it was pressed in.
883
+ */
884
+ type ForwardKeyDown = (event: ForwardedKeyboardEvent) => boolean;
885
+ /**
886
+ * Keyboard params for a forwarded key press. There is no `onKeyDown`: the
887
+ * member handles its own keys before forwarding the rest.
888
+ */
889
+ type UseForwardedKeyDownParams = Omit<UsePopupMenuKeyboardParams, 'skipFocusOwnerCheck' | 'enableTypeToSearch' | 'onKeyDown'>;
890
+ /**
891
+ * Lets an element outside the menu (an editor, a text field) forward its key
892
+ * presses into the menu's keyboard handling: arrows, Ctrl+N/P, Home/End, Enter
893
+ * and the rest of the listbox bindings, with the same IME guard. DOM focus
894
+ * never has to enter the menu.
895
+ *
896
+ * A key counts as handled only when the menu acts on it, so the element keeps
897
+ * its own behaviour otherwise: nothing is handled while the menu is closed,
898
+ * navigation keys need at least one row, Enter needs a highlighted row it can
899
+ * activate, and printable characters always belong to the element (they never
900
+ * trigger item shortcuts).
901
+ *
902
+ * Checkbox span selection (Shift+Arrow) needs the Surface's selection context,
903
+ * so it applies only when the hook is mounted inside a Surface.
904
+ *
905
+ * The returned function is stable, so it can be handed to code outside React.
906
+ * Which keys a member forwards, and what Escape or Tab mean for it, is the
907
+ * member's policy.
908
+ */
909
+ declare function useForwardedKeyDown(params: UseForwardedKeyDownParams): ForwardKeyDown;
910
+ //#endregion
911
+ //#region src/internal/popup-menu/hooks/use-popup-menu-item.d.ts
912
+ interface UsePopupMenuItemParams extends Omit<UseListboxItemParams, 'aimGuard' | 'onAfterSelect'> {
913
+ /**
914
+ * Whether clicking this item should close the menu.
915
+ * @default true
916
+ */
917
+ closeOnClick?: boolean;
918
+ }
919
+ interface UsePopupMenuItemReturn extends UseListboxItemReturn {
920
+ /** Whether this item is effectively disabled (item disabled OR menu disabled). */
921
+ disabled: boolean;
922
+ }
923
+ /**
924
+ * Hook that provides all shared logic for navigatable/highlightable popup menu items.
925
+ * This is a thin wrapper around useListboxItem that automatically adds aim-guard
926
+ * support and handles close-on-click behavior.
927
+ *
928
+ * @see useListboxItem for full documentation
929
+ */
930
+ declare function usePopupMenuItem(params: UsePopupMenuItemParams): UsePopupMenuItemReturn;
931
+ //#endregion
932
+ //#region src/internal/popup-menu/components/icon/icon.d.ts
933
+ interface PopupMenuIconState extends Record<string, unknown> {
934
+ /**
935
+ * Whether the popup is currently open.
936
+ */
937
+ open: boolean;
938
+ }
939
+ interface PopupMenuIconProps extends ComponentProps<'span', PopupMenuIcon.State> {}
940
+ /**
941
+ * An icon that indicates the trigger opens a popup.
942
+ * Typically used inside the trigger to show a chevron or dropdown arrow.
943
+ * Renders a `<span>` element.
944
+ */
945
+ declare const PopupMenuIcon: React.ForwardRefExoticComponent<Omit<PopupMenuIcon.Props, "ref"> & React.RefAttributes<HTMLSpanElement>>;
946
+ declare namespace PopupMenuIcon {
947
+ type State = PopupMenuIconState;
948
+ interface Props extends PopupMenuIconProps {}
949
+ }
950
+ //#endregion
951
+ //#region src/internal/popup-menu/components/empty/empty.d.ts
952
+ interface PopupMenuEmptyState extends Record<string, unknown> {
953
+ first: boolean;
954
+ last: boolean;
955
+ }
956
+ interface PopupMenuEmptyProps extends ComponentProps<'div', PopupMenuEmpty.State> {
957
+ children: React.ReactNode;
958
+ }
959
+ /**
960
+ * Renders when no items match the current search query.
961
+ * Only visible when there's an active search with zero results.
962
+ * Renders a `<div>` element.
963
+ */
964
+ declare const PopupMenuEmpty: React.ForwardRefExoticComponent<Omit<PopupMenuEmpty.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
965
+ declare namespace PopupMenuEmpty {
966
+ type State = PopupMenuEmptyState;
967
+ interface Props extends PopupMenuEmptyProps {}
968
+ }
969
+ //#endregion
970
+ //#region src/internal/popup-menu/components/input/input.d.ts
971
+ interface PopupMenuInputState extends Record<string, unknown> {
972
+ /**
973
+ * Whether the input is active (visible).
974
+ * Only relevant when `hideUntilActive` is true.
975
+ */
976
+ active: boolean;
977
+ }
978
+ interface PopupMenuInputProps extends Omit<ComponentProps<'input', PopupMenuInput.State>, 'value' | 'onChange' | 'type'> {
979
+ /**
980
+ * Controlled value for the search input.
981
+ * If provided, this takes precedence over the Surface's search state.
982
+ */
983
+ value?: string;
984
+ /**
985
+ * Callback when the input value changes.
986
+ */
987
+ onValueChange?: (value: string) => void;
988
+ /**
989
+ * When true, the input is not rendered until the user starts typing.
990
+ * The List receives focus initially, and typing a character activates the input.
991
+ * Once activated, the input stays visible until the menu closes.
992
+ * @default false
993
+ */
994
+ hideUntilActive?: boolean;
995
+ /**
996
+ * When true, Backspace in an empty subpage input navigates back one page.
997
+ * @default false
998
+ */
999
+ backspaceGoesBack?: boolean;
1000
+ }
1001
+ /**
1002
+ * Search input for filtering popup menu items.
1003
+ * Handles keyboard navigation (Arrow keys, Ctrl+N/P, Enter).
1004
+ * Renders an `<input>` element.
1005
+ */
1006
+ declare const PopupMenuInput: React.ForwardRefExoticComponent<Omit<PopupMenuInput.Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
1007
+ declare namespace PopupMenuInput {
1008
+ type State = PopupMenuInputState;
1009
+ interface Props extends PopupMenuInputProps {}
1010
+ }
1011
+ //#endregion
1012
+ //#region src/internal/popup-menu/components/list/list.css-vars.d.ts
1013
+ /**
1014
+ * CSS custom properties applied to the List component.
1015
+ */
1016
+ declare enum PopupMenuListCssVars {
1017
+ /**
1018
+ * The maximum measured row width.
1019
+ * Applied when `measureRowWidth` is true.
1020
+ * Useful for keeping virtualized lists at a consistent width.
1021
+ * @type {number}
1022
+ */
1023
+ rowWidth = "--row-width"
1024
+ }
1025
+ //#endregion
1026
+ //#region src/internal/popup-menu/components/list/list.d.ts
1027
+ /**
1028
+ * State passed to children render function.
1029
+ */
1030
+ interface PopupMenuListChildrenState {
1031
+ /** Current search query */
1032
+ search: string;
1033
+ /** Number of items matching the current filter */
1034
+ filteredCount: number;
1035
+ }
1036
+ interface PopupMenuListState extends Record<string, unknown> {}
1037
+ interface PopupMenuListProps extends Omit<ComponentProps<'div', PopupMenuList.State>, 'children' | 'content'> {
1038
+ /**
1039
+ * Content to render inside the list.
1040
+ * Can be a render function that receives the current search state.
1041
+ */
1042
+ children: React.ReactNode | ((state: PopupMenuListChildrenState) => React.ReactNode);
1043
+ /**
1044
+ * Accessible label for the listbox.
1045
+ * @default 'Suggestions'
1046
+ */
1047
+ label?: string;
1048
+ /**
1049
+ * When true, measures row widths and applies `--row-width` CSS variable.
1050
+ * Keeps the list at the maximum width seen while scrolling.
1051
+ * Useful for virtualized lists where content width varies.
1052
+ * @default true
1053
+ */
1054
+ measureRowWidth?: boolean;
1055
+ /**
1056
+ * Maximum width cap for row measurement (in pixels).
1057
+ * Only used when `measureRowWidth` is true.
1058
+ */
1059
+ maxRowWidth?: number;
1060
+ /**
1061
+ * Ref to the element that owns the list's scroll position.
1062
+ * Use when the semantic list is rendered inside another scroll container.
1063
+ */
1064
+ scrollContainerRef?: React.RefObject<HTMLElement | null>;
1065
+ /**
1066
+ * When any value in this array changes, previously-measured row IDs are
1067
+ * cleared so rows re-measure (the sticky max width is kept — it only ever
1068
+ * grows until the menu closes). Use for state that changes row content for
1069
+ * the same IDs, e.g. tree rows that re-render as breadcrumb rows when deep
1070
+ * search toggles. Values are compared with `Object.is`, so pass stable
1071
+ * primitives — an inline object recreated each render would re-trigger
1072
+ * every render.
1073
+ */
1074
+ remeasureDependencies?: React.DependencyList;
1075
+ }
1076
+ declare const PopupMenuList: React.ForwardRefExoticComponent<Omit<PopupMenuList.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1077
+ declare namespace PopupMenuList {
1078
+ type State = PopupMenuListState;
1079
+ type ChildrenState = PopupMenuListChildrenState;
1080
+ interface Props extends PopupMenuListProps {}
1081
+ }
1082
+ //#endregion
1083
+ //#region src/internal/popup-menu/components/loading/loading.d.ts
1084
+ interface PopupMenuLoadingState extends Record<string, unknown> {
1085
+ first: boolean;
1086
+ last: boolean;
1087
+ }
1088
+ interface PopupMenuLoadingProps extends ComponentProps<'div', PopupMenuLoading.State> {
1089
+ children: React.ReactNode;
1090
+ /**
1091
+ * Whether to force render the loading indicator regardless of async loading state.
1092
+ * When true, the component always renders, allowing you to control visibility externally.
1093
+ * @default false
1094
+ */
1095
+ forceMount?: boolean;
1096
+ }
1097
+ /**
1098
+ * Renders when async content is in initial loading.
1099
+ * Only visible during first-load phases (unless `forceMount` is true).
1100
+ * Renders a `<div>` element.
1101
+ */
1102
+ declare const PopupMenuLoading: React.ForwardRefExoticComponent<Omit<PopupMenuLoading.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1103
+ declare namespace PopupMenuLoading {
1104
+ type State = PopupMenuLoadingState;
1105
+ interface Props extends PopupMenuLoadingProps {}
1106
+ }
1107
+ //#endregion
1108
+ //#region src/internal/popup-menu/components/scroll-arrow/scroll-arrow.d.ts
1109
+ type Direction = 'up' | 'down';
1110
+ interface PopupMenuScrollArrowState extends Record<string, unknown> {
1111
+ /**
1112
+ * The scroll direction this arrow controls.
1113
+ */
1114
+ direction: Direction;
1115
+ /**
1116
+ * Whether there is content to scroll in this direction.
1117
+ */
1118
+ visible: boolean;
1119
+ }
1120
+ interface PopupMenuScrollArrowProps extends ComponentProps<'div', PopupMenuScrollArrow.State> {
1121
+ /**
1122
+ * The direction to scroll when hovering over this arrow.
1123
+ */
1124
+ direction: Direction;
1125
+ /**
1126
+ * Whether to keep the element mounted when there's nothing to scroll.
1127
+ * When false (default), the element is not rendered.
1128
+ * When true, the element is rendered but can be styled via `data-visible="false"`.
1129
+ * @default false
1130
+ */
1131
+ keepMounted?: boolean;
1132
+ /**
1133
+ * Scroll speed in pixels per frame.
1134
+ * @default 10
1135
+ */
1136
+ scrollSpeed?: number;
1137
+ }
1138
+ /**
1139
+ * Base scroll arrow component used by ScrollUpArrow and ScrollDownArrow.
1140
+ * Shows when there is content to scroll in the specified direction.
1141
+ * Scrolls the list continuously while pointer is over it.
1142
+ * Renders a `<div>` element.
1143
+ */
1144
+ declare const PopupMenuScrollArrow: React.ForwardRefExoticComponent<Omit<PopupMenuScrollArrow.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1145
+ declare namespace PopupMenuScrollArrow {
1146
+ type State = PopupMenuScrollArrowState;
1147
+ interface Props extends PopupMenuScrollArrowProps {}
1148
+ }
1149
+ interface PopupMenuScrollUpArrowProps extends Omit<PopupMenuScrollArrowProps, 'direction'> {}
1150
+ /**
1151
+ * A scroll indicator that appears when there's content above.
1152
+ * Scrolls the list up continuously while pointer is over it.
1153
+ * Renders a `<div>` element.
1154
+ */
1155
+ declare const PopupMenuScrollUpArrow: React.ForwardRefExoticComponent<Omit<PopupMenuScrollUpArrow.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1156
+ declare namespace PopupMenuScrollUpArrow {
1157
+ type State = PopupMenuScrollArrowState;
1158
+ interface Props extends PopupMenuScrollUpArrowProps {}
1159
+ }
1160
+ interface PopupMenuScrollDownArrowProps extends Omit<PopupMenuScrollArrowProps, 'direction'> {}
1161
+ /**
1162
+ * A scroll indicator that appears when there's content below.
1163
+ * Scrolls the list down continuously while pointer is over it.
1164
+ * Renders a `<div>` element.
1165
+ */
1166
+ declare const PopupMenuScrollDownArrow: React.ForwardRefExoticComponent<Omit<PopupMenuScrollDownArrow.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1167
+ declare namespace PopupMenuScrollDownArrow {
1168
+ type State = PopupMenuScrollArrowState;
1169
+ interface Props extends PopupMenuScrollDownArrowProps {}
1170
+ }
1171
+ //#endregion
1172
+ //#region src/internal/popup-menu/components/surface/surface.d.ts
1173
+ interface PopupMenuSurfaceState extends Record<string, unknown> {}
1174
+ interface PopupMenuSurfaceProps extends Omit<ComponentProps<'div', PopupMenuSurface.State>, 'content'>, DataSurfaceProps {
1175
+ /**
1176
+ * Filter function for matching items against search query.
1177
+ * Returns a score between 0 and 1 (0 = no match, > 0 = match).
1178
+ * Pass `false` to disable filtering entirely.
1179
+ * @default commandScore (fuzzy matching)
1180
+ */
1181
+ filter?: FilterFn | false;
1182
+ /**
1183
+ * Transforms search input before filtering and visibility logic.
1184
+ * @default trim whitespace (`search.trim()`)
1185
+ */
1186
+ normalizeSearch?: SearchNormalizer;
1187
+ /**
1188
+ * Controlled search value.
1189
+ */
1190
+ search?: string;
1191
+ /**
1192
+ * Callback when search value changes.
1193
+ */
1194
+ onSearchChange?: (search: string) => void;
1195
+ /**
1196
+ * Default search value for uncontrolled usage.
1197
+ * @default ''
1198
+ */
1199
+ defaultSearch?: string;
1200
+ /**
1201
+ * Whether navigation should loop from last to first item and vice versa.
1202
+ * @default true
1203
+ */
1204
+ loop?: boolean;
1205
+ /**
1206
+ * Controls auto-highlighting behavior when the menu opens.
1207
+ * - `true`: highlight the first item (default)
1208
+ * - `false`: don't auto-highlight any item
1209
+ * - `string`: highlight the item with this specific value
1210
+ * @default true
1211
+ */
1212
+ autoHighlightFirst?: boolean | string;
1213
+ /**
1214
+ * Whether to clear the search query when the menu closes.
1215
+ * - `'after-exit'`: clear after exit animation completes (default)
1216
+ * - `true`: clear immediately when menu closes
1217
+ * - `false`: preserve search when menu closes
1218
+ * @default 'after-exit'
1219
+ */
1220
+ clearSearchOnClose?: boolean | 'after-exit';
1221
+ /**
1222
+ * Whether to reset the list scroll position when the search query changes.
1223
+ * @default true
1224
+ */
1225
+ resetScrollOnSearch?: boolean;
1226
+ /**
1227
+ * Whether to skip auto-focusing the input/list when this surface becomes the focus owner.
1228
+ * Useful for Combobox where the input is outside the popup and should retain focus.
1229
+ * @default false
1230
+ */
1231
+ skipAutoFocus?: boolean;
1232
+ /**
1233
+ * Ordered list of item values when using `filter={false}`.
1234
+ * This tells the store the intended display order for navigation/highlighting.
1235
+ * Required when `filter={false}` - must always be provided with the current visible items.
1236
+ */
1237
+ orderedItems?: string[];
1238
+ children: React.ReactNode;
1239
+ }
1240
+ /**
1241
+ * Provides search context and manages item registration for popup menu.
1242
+ * Place inside PopupMenu.Popup to enable search functionality.
1243
+ * Renders a `<div>` element.
1244
+ */
1245
+ declare const PopupMenuSurface: React.ForwardRefExoticComponent<Omit<PopupMenuSurface.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1246
+ declare namespace PopupMenuSurface {
1247
+ type State = PopupMenuSurfaceState;
1248
+ interface Props extends PopupMenuSurfaceProps {}
1249
+ }
1250
+ //#endregion
1251
+ //#region src/internal/popup-menu/components/checkbox-group/checkbox-group-value.d.ts
1252
+ interface PopupMenuCheckboxGroupValueProps {
1253
+ /**
1254
+ * The controlled array of checked item values.
1255
+ */
1256
+ value: string[];
1257
+ /**
1258
+ * Callback fired when the selected value changes.
1259
+ * The second parameter contains event details including the reason for the change.
1260
+ */
1261
+ onValueChange?: (value: string[], eventDetails: CheckboxValueChangeEventDetails) => void;
1262
+ /**
1263
+ * Stable identifier for this group. Defaults to a generated id.
1264
+ */
1265
+ groupId?: string;
1266
+ /**
1267
+ * Whether all items in this group are disabled.
1268
+ * @default false
1269
+ */
1270
+ disabled?: boolean;
1271
+ /**
1272
+ * Children to render within the checkbox group context.
1273
+ */
1274
+ children: React.ReactNode;
1275
+ }
1276
+ /**
1277
+ * Headless provider for checkbox group state.
1278
+ * Use this when you compose checkbox items yourself and do not want a wrapper element.
1279
+ * Does not render any DOM element - only provides context.
1280
+ *
1281
+ * @example
1282
+ * ```tsx
1283
+ * const [layout, setLayout] = useState(['minimap'])
1284
+ *
1285
+ * <DropdownMenu.CheckboxGroupValue value={layout} onValueChange={setLayout}>
1286
+ * <DropdownMenu.Surface content={content}>
1287
+ * ...
1288
+ * </DropdownMenu.Surface>
1289
+ * </DropdownMenu.CheckboxGroupValue>
1290
+ * ```
1291
+ */
1292
+ declare function PopupMenuCheckboxGroupValue(props: PopupMenuCheckboxGroupValueProps): React.JSX.Element;
1293
+ declare namespace PopupMenuCheckboxGroupValue {
1294
+ interface Props extends PopupMenuCheckboxGroupValueProps {}
1295
+ }
1296
+ //#endregion
1297
+ //#region src/internal/popup-menu/components/checkbox-item/checkbox-item-indicator.d.ts
1298
+ interface PopupMenuCheckboxItemIndicatorState extends Record<string, unknown> {
1299
+ /**
1300
+ * Whether the parent checkbox item is currently checked.
1301
+ */
1302
+ checked: boolean;
1303
+ /**
1304
+ * Whether the parent checkbox item is currently highlighted.
1305
+ */
1306
+ highlighted: boolean;
1307
+ /**
1308
+ * Whether the parent checkbox item is disabled.
1309
+ */
1310
+ disabled: boolean;
1311
+ /**
1312
+ * Toggle the checked state without triggering closeOnClick.
1313
+ * Useful when you want clicking directly on the indicator to toggle
1314
+ * without closing the menu.
1315
+ */
1316
+ toggle: () => void;
1317
+ }
1318
+ interface PopupMenuCheckboxItemIndicatorProps extends ComponentProps<'span', PopupMenuCheckboxItemIndicator.State> {
1319
+ /**
1320
+ * Whether to keep the indicator mounted in the DOM when unchecked.
1321
+ * Useful for animations.
1322
+ * @default false
1323
+ */
1324
+ keepMounted?: boolean;
1325
+ }
1326
+ /**
1327
+ * A visual indicator that shows when a CheckboxItem is checked.
1328
+ * Must be used within a CheckboxItem component.
1329
+ * Renders a `<span>` element with aria-hidden="true".
1330
+ */
1331
+ declare const PopupMenuCheckboxItemIndicator: React.ForwardRefExoticComponent<Omit<PopupMenuCheckboxItemIndicator.Props, "ref"> & React.RefAttributes<HTMLSpanElement>>;
1332
+ declare namespace PopupMenuCheckboxItemIndicator {
1333
+ type State = PopupMenuCheckboxItemIndicatorState;
1334
+ interface Props extends PopupMenuCheckboxItemIndicatorProps {}
1335
+ }
1336
+ //#endregion
1337
+ //#region src/internal/popup-menu/components/radio-group/radio-group-value.d.ts
1338
+ interface PopupMenuRadioGroupValueProps {
1339
+ /**
1340
+ * The controlled selected value.
1341
+ */
1342
+ value: string | undefined;
1343
+ /**
1344
+ * Callback fired when the selected value changes.
1345
+ * The second parameter contains event details including the reason for the change.
1346
+ */
1347
+ onValueChange?: (value: string, eventDetails: RadioValueChangeEventDetails) => void;
1348
+ /**
1349
+ * Whether all items in this group are disabled.
1350
+ * @default false
1351
+ */
1352
+ disabled?: boolean;
1353
+ /**
1354
+ * Children to render within the radio group context.
1355
+ */
1356
+ children: React.ReactNode;
1357
+ }
1358
+ /**
1359
+ * Headless provider for radio group state.
1360
+ * Use this to wrap DataSurface when using RadioItems in deep search.
1361
+ * Does not render any DOM element - only provides context.
1362
+ *
1363
+ * @example
1364
+ * ```tsx
1365
+ * const [theme, setTheme] = useState('light')
1366
+ *
1367
+ * <DropdownMenu.RadioGroupValue value={theme} onValueChange={setTheme}>
1368
+ * <DropdownMenu.Surface content={content}>
1369
+ * ...
1370
+ * </DropdownMenu.Surface>
1371
+ * </DropdownMenu.RadioGroupValue>
1372
+ * ```
1373
+ */
1374
+ declare function PopupMenuRadioGroupValue(props: PopupMenuRadioGroupValueProps): React.JSX.Element;
1375
+ declare namespace PopupMenuRadioGroupValue {
1376
+ interface Props extends PopupMenuRadioGroupValueProps {}
1377
+ }
1378
+ //#endregion
1379
+ //#region src/internal/popup-menu/components/radio-item/radio-item-indicator.d.ts
1380
+ interface PopupMenuRadioItemIndicatorState extends Record<string, unknown> {
1381
+ /**
1382
+ * Whether the parent radio item is currently selected/checked.
1383
+ */
1384
+ checked: boolean;
1385
+ /**
1386
+ * Whether the parent radio item is currently highlighted.
1387
+ */
1388
+ highlighted: boolean;
1389
+ /**
1390
+ * Whether the parent radio item is disabled.
1391
+ */
1392
+ disabled: boolean;
1393
+ }
1394
+ interface PopupMenuRadioItemIndicatorProps extends ComponentProps<'span', PopupMenuRadioItemIndicator.State> {
1395
+ /**
1396
+ * Whether to keep the indicator mounted in the DOM when unchecked.
1397
+ * Useful for animations.
1398
+ * @default false
1399
+ */
1400
+ keepMounted?: boolean;
1401
+ }
1402
+ /**
1403
+ * A visual indicator that shows when a RadioItem is selected.
1404
+ * Must be used within a RadioItem component.
1405
+ * Renders a `<span>` element with aria-hidden="true".
1406
+ */
1407
+ declare const PopupMenuRadioItemIndicator: React.ForwardRefExoticComponent<Omit<PopupMenuRadioItemIndicator.Props, "ref"> & React.RefAttributes<HTMLSpanElement>>;
1408
+ declare namespace PopupMenuRadioItemIndicator {
1409
+ type State = PopupMenuRadioItemIndicatorState;
1410
+ interface Props extends PopupMenuRadioItemIndicatorProps {}
1411
+ }
1412
+ //#endregion
1413
+ //#region src/internal/popup-menu/components/focus-zone/focus-zone.d.ts
1414
+ /**
1415
+ * Declares its children as tabbable popup content: they join the surface's Tab
1416
+ * cycle instead of Tab closing the menu. A zone with no tabbable children is
1417
+ * treated as absent.
1418
+ */
1419
+ interface PopupMenuFocusZoneState extends Record<string, unknown> {}
1420
+ interface PopupMenuFocusZoneProps extends ComponentProps<'div', PopupMenuFocusZone.State> {}
1421
+ declare const PopupMenuFocusZone: React.ForwardRefExoticComponent<Omit<PopupMenuFocusZone.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1422
+ declare namespace PopupMenuFocusZone {
1423
+ type State = PopupMenuFocusZoneState;
1424
+ interface Props extends PopupMenuFocusZoneProps {}
1425
+ }
1426
+ //#endregion
1427
+ //#region src/internal/popup-menu/components/footer/footer.d.ts
1428
+ /**
1429
+ * Container for tabbable content at the bottom of a menu surface (action rows like Apply/Cancel). Registers as a focus zone: its tabbable children join the surface's Tab cycle.
1430
+ */
1431
+ interface PopupMenuFooterState extends Record<string, unknown> {}
1432
+ interface PopupMenuFooterProps extends ComponentProps<'div', PopupMenuFooter.State> {}
1433
+ declare const PopupMenuFooter: React.ForwardRefExoticComponent<Omit<PopupMenuFooter.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1434
+ declare namespace PopupMenuFooter {
1435
+ type State = PopupMenuFooterState;
1436
+ interface Props extends PopupMenuFooterProps {}
1437
+ }
1438
+ //#endregion
1439
+ //#region src/internal/popup-menu/components/group/group.d.ts
1440
+ interface PopupMenuGroupState extends Record<string, unknown> {
1441
+ /**
1442
+ * Whether the group is hidden due to no matching items.
1443
+ */
1444
+ hidden: boolean;
1445
+ /**
1446
+ * Present when this is the first visible group in the list.
1447
+ */
1448
+ firstGroup: boolean;
1449
+ /**
1450
+ * Present when this is the last visible group in the list.
1451
+ */
1452
+ lastGroup: boolean;
1453
+ first: boolean;
1454
+ last: boolean;
1455
+ }
1456
+ interface PopupMenuGroupProps extends ComponentProps<'div', PopupMenuGroup.State> {
1457
+ /**
1458
+ * Whether to force render this group regardless of filter results.
1459
+ * @default false
1460
+ */
1461
+ forceMount?: boolean;
1462
+ children: React.ReactNode;
1463
+ }
1464
+ /**
1465
+ * Groups related popup menu items together.
1466
+ * Hidden when no child items match the current filter.
1467
+ * Renders a `<div>` element with role="group".
1468
+ */
1469
+ declare const PopupMenuGroup: React.ForwardRefExoticComponent<Omit<PopupMenuGroup.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1470
+ declare namespace PopupMenuGroup {
1471
+ type State = PopupMenuGroupState;
1472
+ interface Props extends PopupMenuGroupProps {}
1473
+ }
1474
+ //#endregion
1475
+ //#region src/internal/popup-menu/components/group/group-value.d.ts
1476
+ interface PopupMenuGroupValueProps {
1477
+ /** Group id items register under. Omit for ungrouped rows that only need positional flags. */
1478
+ groupId?: string;
1479
+ /** Positional flags for this row; each defined flag overrides the store-derived value. */
1480
+ positional?: GroupPositional;
1481
+ children: React.ReactNode;
1482
+ }
1483
+ /**
1484
+ * Headless provider for group membership and positional state.
1485
+ * Renders no DOM. Use to wrap individual rows in virtualized lists where
1486
+ * the store cannot derive position from mounted order.
1487
+ */
1488
+ declare function PopupMenuGroupValue(props: PopupMenuGroupValueProps): React.JSX.Element;
1489
+ declare namespace PopupMenuGroupValue {
1490
+ interface Props extends PopupMenuGroupValueProps {}
1491
+ }
1492
+ //#endregion
1493
+ //#region src/internal/popup-menu/components/group-label/group-label.d.ts
1494
+ interface PopupMenuGroupLabelState extends Record<string, unknown> {
1495
+ /**
1496
+ * Present when this label is the first row in the list.
1497
+ */
1498
+ first: boolean;
1499
+ /**
1500
+ * Present when this label is the last row in the list.
1501
+ */
1502
+ last: boolean;
1503
+ /**
1504
+ * Present when this label's parent group is the first visible group in the list.
1505
+ */
1506
+ firstGroup: boolean;
1507
+ /**
1508
+ * Present when this label's parent group is the last visible group in the list.
1509
+ */
1510
+ lastGroup: boolean;
1511
+ }
1512
+ interface PopupMenuGroupLabelProps extends ComponentProps<'div', PopupMenuGroupLabel.State> {
1513
+ children: React.ReactNode;
1514
+ }
1515
+ /**
1516
+ * A label/heading for a group of popup menu items.
1517
+ * Renders a `<div>` element with role="presentation".
1518
+ */
1519
+ declare const PopupMenuGroupLabel: React.ForwardRefExoticComponent<Omit<PopupMenuGroupLabel.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1520
+ declare namespace PopupMenuGroupLabel {
1521
+ type State = PopupMenuGroupLabelState;
1522
+ interface Props extends PopupMenuGroupLabelProps {}
1523
+ }
1524
+ //#endregion
1525
+ //#region src/internal/popup-menu/components/header/header.d.ts
1526
+ /**
1527
+ * Container for tabbable content at the top of a menu surface (toolbars, filters). Registers as a focus zone: its tabbable children join the surface's Tab cycle.
1528
+ */
1529
+ interface PopupMenuHeaderState extends Record<string, unknown> {}
1530
+ interface PopupMenuHeaderProps extends ComponentProps<'div', PopupMenuHeader.State> {}
1531
+ declare const PopupMenuHeader: React.ForwardRefExoticComponent<Omit<PopupMenuHeader.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1532
+ declare namespace PopupMenuHeader {
1533
+ type State = PopupMenuHeaderState;
1534
+ interface Props extends PopupMenuHeaderProps {}
1535
+ }
1536
+ //#endregion
1537
+ //#region src/internal/popup-menu/components/separator/separator.d.ts
1538
+ interface PopupMenuSeparatorState extends Record<string, unknown> {
1539
+ first: boolean;
1540
+ last: boolean;
1541
+ }
1542
+ interface PopupMenuSeparatorProps extends ComponentProps<'div', PopupMenuSeparator.State> {
1543
+ /**
1544
+ * Whether to always render the separator, even during search.
1545
+ * By default, separators are hidden when there's an active search query.
1546
+ * @default false
1547
+ */
1548
+ alwaysRender?: boolean;
1549
+ }
1550
+ /**
1551
+ * A visual separator between popup menu items.
1552
+ * Hidden during active search unless `alwaysRender` is true.
1553
+ * Renders a `<div>` element with role="separator".
1554
+ */
1555
+ declare const PopupMenuSeparator: React.ForwardRefExoticComponent<Omit<PopupMenuSeparator.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1556
+ declare namespace PopupMenuSeparator {
1557
+ type State = PopupMenuSeparatorState;
1558
+ interface Props extends PopupMenuSeparatorProps {}
1559
+ }
1560
+ //#endregion
1561
+ //#region src/internal/popup-menu/components/shortcut/shortcut.d.ts
1562
+ /**
1563
+ * State for the Shortcut component, passed to children render function.
1564
+ */
1565
+ interface PopupMenuShortcutState extends Record<string, unknown> {
1566
+ /**
1567
+ * The keyboard shortcut value from the parent Item.
1568
+ */
1569
+ shortcut: string | undefined;
1570
+ /**
1571
+ * Whether the parent item is highlighted.
1572
+ */
1573
+ highlighted: boolean;
1574
+ }
1575
+ interface PopupMenuShortcutProps extends Omit<ComponentProps<'kbd', PopupMenuShortcut.State>, 'children'> {
1576
+ /**
1577
+ * Content to render inside the shortcut.
1578
+ * Can be a render function that receives the shortcut value.
1579
+ * If not provided, renders the shortcut value from the parent Item.
1580
+ */
1581
+ children?: React.ReactNode | ((state: PopupMenuShortcutState) => React.ReactNode);
1582
+ }
1583
+ /**
1584
+ * Displays the keyboard shortcut for a menu item.
1585
+ * Must be used within a PopupMenu.Item component.
1586
+ * Renders a `<kbd>` element by default.
1587
+ *
1588
+ * @example
1589
+ * ```tsx
1590
+ * // Auto-renders the shortcut value
1591
+ * <PopupMenu.Item shortcut="1">
1592
+ * Icebox
1593
+ * <PopupMenu.Shortcut />
1594
+ * </PopupMenu.Item>
1595
+ *
1596
+ * // Custom rendering with children as function
1597
+ * <PopupMenu.Item shortcut="1">
1598
+ * Icebox
1599
+ * <PopupMenu.Shortcut>
1600
+ * {({ shortcut }) => <span className="key">{shortcut}</span>}
1601
+ * </PopupMenu.Shortcut>
1602
+ * </PopupMenu.Item>
1603
+ * ```
1604
+ */
1605
+ declare const PopupMenuShortcut: React.ForwardRefExoticComponent<Omit<PopupMenuShortcut.Props, "ref"> & React.RefAttributes<HTMLElement>>;
1606
+ declare namespace PopupMenuShortcut {
1607
+ type State = PopupMenuShortcutState;
1608
+ interface Props extends PopupMenuShortcutProps {}
1609
+ }
1610
+ //#endregion
1611
+ //#region src/internal/popup-menu/components/tree/tree.d.ts
1612
+ interface PopupMenuTreeState extends Record<string, unknown> {
1613
+ depth: number;
1614
+ }
1615
+ interface PopupMenuTreeProps extends ComponentProps<'div', PopupMenuTree.State> {
1616
+ children: React.ReactNode;
1617
+ }
1618
+ declare const PopupMenuTree: React.ForwardRefExoticComponent<Omit<PopupMenuTree.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1619
+ declare namespace PopupMenuTree {
1620
+ type State = PopupMenuTreeState;
1621
+ interface Props extends PopupMenuTreeProps {}
1622
+ }
1623
+ //#endregion
1624
+ //#region src/internal/popup-menu/components/tree/tree-connector.d.ts
1625
+ interface PopupMenuTreeConnectorState extends Record<string, unknown> {
1626
+ depth: number;
1627
+ }
1628
+ interface PopupMenuTreeConnectorProps extends ComponentProps<'span', PopupMenuTreeConnector.State> {
1629
+ depth?: number;
1630
+ }
1631
+ declare const PopupMenuTreeConnector: React.ForwardRefExoticComponent<Omit<PopupMenuTreeConnector.Props, "ref"> & React.RefAttributes<HTMLSpanElement>>;
1632
+ declare namespace PopupMenuTreeConnector {
1633
+ type State = PopupMenuTreeConnectorState;
1634
+ interface Props extends PopupMenuTreeConnectorProps {}
1635
+ }
1636
+ //#endregion
1637
+ //#region src/internal/popup-menu/components/tree/tree-item.d.ts
1638
+ interface PopupMenuTreeItemProps extends Omit<PopupMenuItemProps, 'activatable'> {
1639
+ /** Whether this tree item can be activated. @default true */
1640
+ selectable?: boolean;
1641
+ /** Explicit tree depth override. */
1642
+ depth?: number;
1643
+ }
1644
+ declare const PopupMenuTreeItem: React.ForwardRefExoticComponent<Omit<PopupMenuTreeItem.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1645
+ declare namespace PopupMenuTreeItem {
1646
+ type State = PopupMenuItemState;
1647
+ interface Props extends PopupMenuTreeItemProps {}
1648
+ }
1649
+ //#endregion
1650
+ //#region src/internal/popup-menu/components/submenu-root/submenu-root.d.ts
1651
+ interface PopupMenuSubmenuRootProps extends Omit<PopoverRootProps, 'open' | 'onOpenChange' | 'defaultOpen' | 'actionsRef'> {
1652
+ /**
1653
+ * Whether the submenu is open.
1654
+ * Use for controlled mode.
1655
+ */
1656
+ open?: boolean;
1657
+ /**
1658
+ * Callback when the open state changes.
1659
+ * The second parameter contains event details including the reason for the change.
1660
+ */
1661
+ onOpenChange?: (open: boolean, eventDetails: Popover.Root.ChangeEventDetails) => void;
1662
+ /**
1663
+ * Whether the submenu is initially open.
1664
+ * Use for uncontrolled mode.
1665
+ * @default false
1666
+ */
1667
+ defaultOpen?: boolean;
1668
+ /**
1669
+ * Whether pressing Escape in this submenu closes the entire menu from the root.
1670
+ * When true (default), Escape closes the entire menu tree.
1671
+ * When false, Escape only closes this submenu and moves focus to the parent.
1672
+ * @default true
1673
+ */
1674
+ closeRootOnEsc?: boolean;
1675
+ /**
1676
+ * Whether virtualization mode is enabled for this submenu.
1677
+ * When true, items should provide an explicit `index` prop and
1678
+ * the `items` prop should be provided for navigation to work correctly.
1679
+ * @default false
1680
+ */
1681
+ virtualized?: boolean;
1682
+ /**
1683
+ * Pre-registered items for virtualization.
1684
+ * When provided with `virtualized={true}`, this allows navigation to work
1685
+ * for items that aren't currently mounted in the DOM.
1686
+ */
1687
+ items?: VirtualItem[];
1688
+ /**
1689
+ * Callback when the highlighted item changes. `id` is first; `node` is the
1690
+ * resolved menu node enrichment and may be null.
1691
+ * Useful for synchronizing with a virtualizer (e.g., scrollToIndex).
1692
+ */
1693
+ onHighlightChange?: PopupMenuHighlightChangeHandler<HighlightChangeEventDetails>;
1694
+ /**
1695
+ * Event handler called after any open/close animations have completed.
1696
+ * When `clearSearchOnClose="after-exit"` is set on Surface, the search
1697
+ * will be cleared before this callback is invoked.
1698
+ */
1699
+ onOpenChangeComplete?: (open: boolean) => void;
1700
+ /**
1701
+ * Whether this submenu should ignore user interaction.
1702
+ * Also inherits disabled state from its parent menu.
1703
+ * @default false
1704
+ */
1705
+ disabled?: boolean;
1706
+ /**
1707
+ * A ref to imperative actions.
1708
+ * - `close`: closes the submenu imperatively.
1709
+ * - `unmount`: unmounts the popup imperatively (when keep-mounted mode is enabled).
1710
+ * - `setDisabled`: enables/disables the submenu imperatively.
1711
+ */
1712
+ actionsRef?: React.RefObject<PopupMenuSubmenuRoot.Actions | null>;
1713
+ children: React.ReactNode;
1714
+ }
1715
+ /**
1716
+ * Groups all parts of a submenu.
1717
+ * Manages open state and provides context to children.
1718
+ * Creates its own ListboxStore independent from the parent menu.
1719
+ * Doesn't render its own HTML element.
1720
+ */
1721
+ declare function PopupMenuSubmenuRoot(props: PopupMenuSubmenuRootProps): React.JSX.Element;
1722
+ declare namespace PopupMenuSubmenuRoot {
1723
+ interface Props extends PopupMenuSubmenuRootProps {}
1724
+ type ChangeEventDetails = Popover.Root.ChangeEventDetails;
1725
+ type Actions = PopupMenuRootActions;
1726
+ }
1727
+ //#endregion
1728
+ //#region src/internal/popup-menu/components/submenu-trigger/submenu-trigger-indicator.d.ts
1729
+ interface PopupMenuSubmenuTriggerIndicatorState extends Record<string, unknown> {
1730
+ /**
1731
+ * Whether the submenu popup is open.
1732
+ */
1733
+ popupOpen: boolean;
1734
+ /**
1735
+ * Whether the submenu owns keyboard focus.
1736
+ */
1737
+ popupFocused: boolean;
1738
+ }
1739
+ interface PopupMenuSubmenuTriggerIndicatorProps extends ComponentProps<'span', PopupMenuSubmenuTriggerIndicator.State> {}
1740
+ /**
1741
+ * An indicator element for submenu triggers that reflects the submenu's open and focus state.
1742
+ * Typically used to render a chevron or arrow icon.
1743
+ * Must be used within PopupMenu.SubmenuTrigger.
1744
+ * Renders a `<span>` element.
1745
+ */
1746
+ declare const PopupMenuSubmenuTriggerIndicator: React.ForwardRefExoticComponent<Omit<PopupMenuSubmenuTriggerIndicator.Props, "ref"> & React.RefAttributes<HTMLSpanElement>>;
1747
+ declare namespace PopupMenuSubmenuTriggerIndicator {
1748
+ type State = PopupMenuSubmenuTriggerIndicatorState;
1749
+ interface Props extends PopupMenuSubmenuTriggerIndicatorProps {}
1750
+ }
1751
+ //#endregion
1752
+ //#region src/internal/popup-menu/components/subpage/subpage.d.ts
1753
+ interface PopupMenuSubpageProps {
1754
+ /** Unique page ID for stack navigation. */
1755
+ pageId: string;
1756
+ /**
1757
+ * Whether pressing Escape in this page closes the entire menu tree.
1758
+ * When false (default), Escape navigates back one page.
1759
+ * @default false
1760
+ */
1761
+ closeRootOnEsc?: boolean;
1762
+ children: React.ReactNode;
1763
+ }
1764
+ /**
1765
+ * Groups all parts of a subpage.
1766
+ * Creates an isolated menu surface that renders in the same popup and
1767
+ * participates in push/pop page stack navigation.
1768
+ * Doesn't render its own HTML element.
1769
+ */
1770
+ declare function PopupMenuSubpage(props: PopupMenuSubpageProps): React.JSX.Element;
1771
+ declare namespace PopupMenuSubpage {
1772
+ interface Props extends PopupMenuSubpageProps {}
1773
+ }
1774
+ //#endregion
1775
+ //#region src/internal/popup-menu/components/subpage-back/subpage-back.d.ts
1776
+ interface PopupMenuSubpageBackState extends Record<string, unknown> {
1777
+ /** Whether navigating back is currently possible. */
1778
+ canGoBack: boolean;
1779
+ /** Whether the button is disabled. */
1780
+ disabled: boolean;
1781
+ }
1782
+ interface PopupMenuSubpageBackProps extends ComponentProps<'button', PopupMenuSubpageBack.State> {
1783
+ /** Whether this button is disabled. */
1784
+ disabled?: boolean;
1785
+ }
1786
+ /**
1787
+ * A button that navigates back one page in the current subpage stack.
1788
+ * Useful for custom headers/toolbars outside of list rows.
1789
+ * Renders a `<button>` element.
1790
+ */
1791
+ declare const PopupMenuSubpageBack: React.ForwardRefExoticComponent<Omit<PopupMenuSubpageBack.Props, "ref"> & React.RefAttributes<HTMLButtonElement>>;
1792
+ declare namespace PopupMenuSubpageBack {
1793
+ type State = PopupMenuSubpageBackState;
1794
+ interface Props extends PopupMenuSubpageBackProps {}
1795
+ }
1796
+ //#endregion
1797
+ //#region src/internal/popup-menu/components/subpage-back-item/subpage-back-item.d.ts
1798
+ interface PopupMenuSubpageBackItemState extends Record<string, unknown> {
1799
+ /** Whether this is a subpage back item (always true). */
1800
+ subpageBackItem: boolean;
1801
+ /** Whether the item is highlighted. */
1802
+ highlighted: boolean;
1803
+ /** Whether the item is disabled. */
1804
+ disabled: boolean;
1805
+ first: boolean;
1806
+ last: boolean;
1807
+ firstInGroup: boolean;
1808
+ lastInGroup: boolean;
1809
+ }
1810
+ interface PopupMenuSubpageBackItemProps extends ComponentProps<'div', PopupMenuSubpageBackItem.State> {
1811
+ /** Explicit unique identifier for this item in the store. */
1812
+ id?: string;
1813
+ /** Unique value for this item used for filtering. */
1814
+ value?: string;
1815
+ /** Additional keywords to match against when filtering. */
1816
+ keywords?: string[];
1817
+ /** Whether this item is disabled. */
1818
+ disabled?: boolean;
1819
+ /** Whether to force render this item regardless of filter results. */
1820
+ forceMount?: boolean;
1821
+ /** Callback when this item is selected. */
1822
+ onSelect?: () => void;
1823
+ /**
1824
+ * Async callback when this item is selected.
1825
+ *
1826
+ * When provided, this takes precedence over `onSelect`.
1827
+ * If provided, this callback is awaited before navigating back.
1828
+ * Return `false` to prevent automatic navigation.
1829
+ */
1830
+ onSelectAsync?: (context: PopupMenuSubpageBackItem.OnSelectAsyncContext) => Promise<void | boolean>;
1831
+ }
1832
+ /**
1833
+ * A list row that navigates back one page in the current subpage stack.
1834
+ * Renders a `<div>` element with role="option".
1835
+ */
1836
+ declare const PopupMenuSubpageBackItem: React.ForwardRefExoticComponent<Omit<PopupMenuSubpageBackItem.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
1837
+ declare namespace PopupMenuSubpageBackItem {
1838
+ type State = PopupMenuSubpageBackItemState;
1839
+ interface OnSelectAsyncContext {
1840
+ /** Navigate back one page manually. */
1841
+ goBack: () => boolean;
1842
+ /** Aborts when a pending async selection is canceled or unmounted. */
1843
+ signal: AbortSignal;
1844
+ }
1845
+ interface Props extends PopupMenuSubpageBackItemProps {}
1846
+ }
1847
+ //#endregion
1848
+ //#region src/internal/popup-menu/data-first/async-coordinator.d.ts
1849
+ /**
1850
+ * State for a registered async loader.
1851
+ */
1852
+ interface AsyncMenuState {
1853
+ /** Unique identifier for this async menu */
1854
+ id: string;
1855
+ /** The loader configuration */
1856
+ config: AsyncLoaderConfig;
1857
+ /** Current loader result */
1858
+ result: AsyncLoaderResult<NodeDef[]>;
1859
+ }
1860
+ interface RootAsyncMenuState {
1861
+ config: AsyncLoaderConfig;
1862
+ result: AsyncLoaderResult<NodeDef[]>;
1863
+ }
1864
+ /**
1865
+ * Context value for the async menu coordinator.
1866
+ */
1867
+ interface AsyncMenuCoordinatorValue {
1868
+ /** Register a new async loader */
1869
+ registerLoader: (state: AsyncMenuState) => void;
1870
+ /** Unregister an async loader */
1871
+ unregisterLoader: (id: string) => void;
1872
+ /** Update loader result */
1873
+ updateLoaderResult: (id: string, result: AsyncLoaderResult<NodeDef[]>) => void;
1874
+ registerRootLoader: (state: RootAsyncMenuState) => void;
1875
+ unregisterRootLoader: () => void;
1876
+ updateRootLoaderResult: (result: AsyncLoaderResult<NodeDef[]>) => void;
1877
+ /** Current search query from the store */
1878
+ searchQuery: string;
1879
+ /** All registered loaders */
1880
+ loaders: Map<string, AsyncMenuState>;
1881
+ /** The root surface's own `asyncContent` loader; `null` when none is registered. Never present in `loaders`. */
1882
+ root: RootAsyncMenuState | null;
1883
+ /** Any loader is currently in initial loading phase */
1884
+ isAnyLoading: boolean;
1885
+ /** Any loader is currently fetching (initial or background) */
1886
+ isAnyFetching: boolean;
1887
+ /** Any loader is currently in first-load phase */
1888
+ isAnyInitialLoading: boolean;
1889
+ /** Any loader is currently in background refetch phase */
1890
+ isAnyRefetching: boolean;
1891
+ /** All registered loaders are currently in background refetch phase */
1892
+ isAllRefetching: boolean;
1893
+ /** The root loader is currently in initial loading phase */
1894
+ isRootLoading: boolean;
1895
+ /** Static loaders are currently in initial loading phase */
1896
+ isStaticLoading: boolean;
1897
+ /** Static loaders are currently fetching */
1898
+ isStaticFetching: boolean;
1899
+ /** Static loaders in first-load phase */
1900
+ isStaticInitialLoading: boolean;
1901
+ /** Static loaders in background refetch phase */
1902
+ isStaticRefetching: boolean;
1903
+ /** Query loaders are currently in initial loading phase */
1904
+ isQueryLoading: boolean;
1905
+ /** Query loaders are currently fetching */
1906
+ isQueryFetching: boolean;
1907
+ /** Query loaders in first-load phase */
1908
+ isQueryInitialLoading: boolean;
1909
+ /** Query loaders in background refetch phase */
1910
+ isQueryRefetching: boolean;
1911
+ /** All loaders have resolved (not fetching) */
1912
+ allResolved: boolean;
1913
+ /** Every loader with a usable result: the root entry (if any) and one branch entry per Resolved ID. */
1914
+ getAsyncNodes: () => Array<{
1915
+ kind: 'root';
1916
+ nodes: NodeDef[];
1917
+ } | {
1918
+ kind: 'branch';
1919
+ id: string;
1920
+ nodes: NodeDef[];
1921
+ }>;
1922
+ /** Loaders that errored */
1923
+ erroredLoaders: Map<string, Error>;
1924
+ rootError: Error | null;
1925
+ /** Get the aggregate async state for DataList */
1926
+ getAsyncState: () => AsyncState;
1927
+ /**
1928
+ * Whether the root surface's `asyncContent` has settled for the current
1929
+ * search, published by the root data list. `Empty` waits for it; in
1930
+ * `asyncContentReveal: 'block'` mode `Loading` hides once it has settled.
1931
+ */
1932
+ rootReveal: RootRevealState;
1933
+ setRootReveal: (state: RootRevealState) => void;
1934
+ }
1935
+ interface RootRevealState {
1936
+ /** No root loader is pending for the current search. */
1937
+ settled: boolean;
1938
+ /** The root loader has settled at least once since mounting. */
1939
+ settledOnce: boolean;
1940
+ /** The surface uses `asyncContentReveal: 'block'`. */
1941
+ block: boolean;
1942
+ }
1943
+ declare function useAsyncMenuCoordinator(): AsyncMenuCoordinatorValue | null;
1944
+ declare function useMaybeAsyncMenuCoordinator(): AsyncMenuCoordinatorValue | null;
1945
+ //#endregion
1946
+ //#region src/internal/popup-menu/data-first/context.d.ts
1947
+ interface DataSurfaceContextValue {
1948
+ /** The original node definitions */
1949
+ content: NodeDef[];
1950
+ /** Async content configuration for root-level async loading */
1951
+ asyncContent?: AsyncLoaderConfig;
1952
+ /** How `asyncContent` rows combine with `content` */
1953
+ asyncContentMode: AsyncContentMode;
1954
+ /** When `asyncContent` rows appear */
1955
+ asyncContentReveal: AsyncResultBehavior;
1956
+ /** Deep search configuration */
1957
+ deepSearchConfig: DeepSearchConfig;
1958
+ /** Default submenu inclusion mode for deep search */
1959
+ includeInDeepSearch: IncludeInDeepSearch;
1960
+ /** List element ID for aria-activedescendant */
1961
+ listId: string;
1962
+ }
1963
+ declare const DataSurfaceContext: React.Context<DataSurfaceContextValue | null>;
1964
+ interface ResolvedNodesSlot {
1965
+ nodes: readonly PopupMenuNode[];
1966
+ graftVersion: number;
1967
+ /** The `content` prop the slot was published for; consumers drop a slot whose content the root surface no longer supplies. */
1968
+ content: NodeDef[];
1969
+ }
1970
+ interface DataPopupContextValue {
1971
+ /** Latest DataSurface context registered within this popup. */
1972
+ dataSurfaceContext: DataSurfaceContextValue | null;
1973
+ /** Registers/clears DataSurface context for sibling consumers. */
1974
+ setDataSurfaceContext: React.Dispatch<React.SetStateAction<DataSurfaceContextValue | null>>;
1975
+ /**
1976
+ * The resolved-nodes slot: the root list's current Menu Nodes plus the
1977
+ * graft version that changes when loader results are grafted under a
1978
+ * branch (which mutates `children` without changing the outer array).
1979
+ * Null until the root list registers. Retained while a subpage is active
1980
+ * and the root list is unmounted; the Menu Tree persists on the resolver.
1981
+ */
1982
+ resolvedNodes: ResolvedNodesSlot | null;
1983
+ setResolvedNodes: React.Dispatch<React.SetStateAction<ResolvedNodesSlot | null>>;
1984
+ }
1985
+ declare const DataPopupContext: React.Context<DataPopupContextValue | null>;
1986
+ declare function useDataSurfaceContext(): DataSurfaceContextValue;
1987
+ declare function useMaybeDataSurfaceContext(): DataSurfaceContextValue | null;
1988
+ declare const DataListContext: React.Context<DataListChildrenState | null>;
1989
+ declare function useDataList(): DataListChildrenState;
1990
+ declare function useMaybeDataList(): DataListChildrenState | null;
1991
+ type RenderNodeFn = (displayNode: DisplayNode) => React.ReactNode;
1992
+ //#endregion
1993
+ //#region src/internal/popup-menu/data-first/type-guards.d.ts
1994
+ declare function isLinkItemDef(node: NodeDef): node is LinkItemDef;
1995
+ declare function isTreeItemDef(node: NodeDef): node is TreeItemDef;
1996
+ //#endregion
1997
+ //#region src/internal/popup-menu/menu-tree/resolve.d.ts
1998
+ declare function isPopupMenuNode(value: unknown): value is PopupMenuNode;
1999
+ /** Default Resolved ID, using surface-scoped encoded paths unless menu scope is selected. */
2000
+ declare function defaultGetResolvedId(node: UnresolvedMenuNode, idScope?: PopupMenuIdScope): string;
2001
+ //#endregion
2002
+ export { PopupMenuFocusZoneProps as $, PopupMenuPopupProps as $t, PopupMenuTreeItem as A, useFocusOwner as An, PopupMenuInputState as At, PopupMenuHeaderProps as B, ForwardKeyDown as Bt, PopupMenuSubpage as C, PopupMenuContext as Cn, PopupMenuList as Ct, PopupMenuSubmenuTriggerIndicatorState as D, useMaybePopupMenuContext as Dn, PopupMenuListCssVars as Dt, PopupMenuSubmenuTriggerIndicatorProps as E, VirtualizationConfig as En, PopupMenuListState as Et, PopupMenuShortcutState as F, PopupMenuIconProps as Ft, PopupMenuGroupValue as G, PopupMenuProviders as Gt, PopupMenuGroupLabel as H, UseForwardedKeyDownParams as Ht, PopupMenuSeparator as I, PopupMenuIconState as It, PopupMenuGroupState as J, PopupMenuPositionerProps as Jt, PopupMenuGroup as K, PopupMenuPositioner as Kt, PopupMenuSeparatorProps as L, UsePopupMenuItemParams as Lt, PopupMenuTree as M, PopupMenuEmptyProps as Mt, PopupMenuShortcut as N, PopupMenuEmptyState as Nt, PopupMenuSubmenuRoot as O, usePopupMenuContext as On, PopupMenuInput as Ot, PopupMenuShortcutProps as P, PopupMenuIcon as Pt, PopupMenuFocusZone as Q, PopupMenuPopup as Qt, PopupMenuSeparatorState as R, UsePopupMenuItemReturn as Rt, PopupMenuSubpageBackState as S, PopupMenuDebugOptions as Sn, PopupMenuLoadingState as St, PopupMenuSubmenuTriggerIndicator as T, VirtualAnchor as Tn, PopupMenuListProps as Tt, PopupMenuGroupLabelProps as U, useForwardedKeyDown as Ut, PopupMenuHeaderState as V, ForwardedKeyboardEvent as Vt, PopupMenuGroupLabelState as W, usePopupMenuKeyboard as Wt, PopupMenuFooterProps as X, PopupMenuPortal as Xt, PopupMenuFooter as Y, PopupMenuPositionerCssVars as Yt, PopupMenuFooterState as Z, PopupMenuPortalProps as Zt, PopupMenuSubpageBackItem as _, useSubpageContext as _n, PopupMenuScrollDownArrowProps as _t, DataListContext as a, PopupMenuArrowProps as an, PopupMenuRadioGroupValueProps as at, PopupMenuSubpageBack as b, useSubmenuContext as bn, PopupMenuLoading as bt, DataSurfaceContextValue as c, UsePopupMenuRootParams as cn, PopupMenuCheckboxItemIndicatorState as ct, useDataSurfaceContext as d, SubpageStackContext as dn, PopupMenuSurface as dt, PopupMenuPopupState as en, PopupMenuFocusZoneState as et, useMaybeDataList as f, SubpageStackContextValue as fn, PopupMenuSurfaceProps as ft, useMaybeAsyncMenuCoordinator as g, useMaybeSubpageContext as gn, PopupMenuScrollDownArrow as gt, useAsyncMenuCoordinator as h, SubpageContextValue as hn, PopupMenuScrollArrowState as ht, isTreeItemDef as i, PopupMenuArrow as in, PopupMenuRadioGroupValue as it, PopupMenuTreeConnector as j, FocusOwnerStore as jn, PopupMenuEmpty as jt, PopupMenuSubmenuRootProps as k, useOpenChain as kn, PopupMenuInputProps as kt, RenderNodeFn as l, usePopupMenuRoot as ln, PopupMenuCheckboxGroupValue as lt, AsyncMenuCoordinatorValue as m, useSubpageStack as mn, PopupMenuScrollArrowProps as mt, isPopupMenuNode as n, PopupMenuBackdrop as nn, PopupMenuRadioItemIndicatorProps as nt, DataPopupContext as o, useSubpageStackState as on, PopupMenuCheckboxItemIndicator as ot, useMaybeDataSurfaceContext as p, useMaybeSubpageStack as pn, PopupMenuSurfaceState as pt, PopupMenuGroupProps as q, PopupMenuPositionerAlign as qt, isLinkItemDef as r, PopupMenuBackdropProps as rn, PopupMenuRadioItemIndicatorState as rt, DataSurfaceContext as s, PopupMenuRootActions as sn, PopupMenuCheckboxItemIndicatorProps as st, defaultGetResolvedId as t, PopupMenuPopupDataAttributes as tn, PopupMenuRadioItemIndicator as tt, useDataList as u, MenuTreeResolver as un, PopupMenuCheckboxGroupValueProps as ut, PopupMenuSubpageBackItemProps as v, SubmenuContextValue as vn, PopupMenuScrollUpArrow as vt, PopupMenuSubpageProps as w, PopupMenuContextValue as wn, PopupMenuListChildrenState as wt, PopupMenuSubpageBackProps as x, PopupSurfaceIdContext as xn, PopupMenuLoadingProps as xt, PopupMenuSubpageBackItemState as y, useMaybeSubmenuContext as yn, PopupMenuScrollUpArrowProps as yt, PopupMenuHeader as z, usePopupMenuItem as zt };
2003
+ //# sourceMappingURL=index-Cabqj7qI.d.ts.map