@bazza-ui/react 0.0.0 → 0.1.0-canary.2

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 (81) hide show
  1. package/dist/ListboxStore-BtcTXpzi.d.cts +351 -0
  2. package/dist/ListboxStore-DPqpLlAL.d.ts +351 -0
  3. package/dist/adapters/index.cjs +2 -0
  4. package/dist/adapters/index.cjs.map +1 -0
  5. package/dist/adapters/index.d.cts +363 -0
  6. package/dist/adapters/index.d.ts +363 -0
  7. package/dist/adapters/index.js +2 -0
  8. package/dist/adapters/index.js.map +1 -0
  9. package/dist/chunk-4C666HHU.js +2 -0
  10. package/dist/chunk-4C666HHU.js.map +1 -0
  11. package/dist/chunk-AVZ64JQ3.js +2 -0
  12. package/dist/chunk-AVZ64JQ3.js.map +1 -0
  13. package/dist/chunk-BGJJC6GX.cjs +2 -0
  14. package/dist/chunk-BGJJC6GX.cjs.map +1 -0
  15. package/dist/chunk-FWWOE2SW.cjs +2 -0
  16. package/dist/chunk-FWWOE2SW.cjs.map +1 -0
  17. package/dist/chunk-JSPKF52O.cjs +2 -0
  18. package/dist/chunk-JSPKF52O.cjs.map +1 -0
  19. package/dist/chunk-KWGD24VS.js +2 -0
  20. package/dist/chunk-KWGD24VS.js.map +1 -0
  21. package/dist/chunk-M4G6J7DP.cjs +2 -0
  22. package/dist/chunk-M4G6J7DP.cjs.map +1 -0
  23. package/dist/chunk-WKAPAKUL.js +2 -0
  24. package/dist/chunk-WKAPAKUL.js.map +1 -0
  25. package/dist/combobox/index.cjs +2 -0
  26. package/dist/combobox/index.cjs.map +1 -0
  27. package/dist/combobox/index.d.cts +1039 -0
  28. package/dist/combobox/index.d.ts +1039 -0
  29. package/dist/combobox/index.js +2 -0
  30. package/dist/combobox/index.js.map +1 -0
  31. package/dist/command-score-Dgo3ZS3Z.d.ts +36 -0
  32. package/dist/command-score-YjNr3ZWi.d.cts +36 -0
  33. package/dist/context-menu/index.cjs +2 -0
  34. package/dist/context-menu/index.cjs.map +1 -0
  35. package/dist/context-menu/index.d.cts +658 -0
  36. package/dist/context-menu/index.d.ts +658 -0
  37. package/dist/context-menu/index.js +2 -0
  38. package/dist/context-menu/index.js.map +1 -0
  39. package/dist/data-surface-B-eIGTBi.d.cts +678 -0
  40. package/dist/data-surface-D1OilMDu.d.ts +678 -0
  41. package/dist/dropdown-menu/index.cjs +2 -0
  42. package/dist/dropdown-menu/index.cjs.map +1 -0
  43. package/dist/dropdown-menu/index.d.cts +700 -0
  44. package/dist/dropdown-menu/index.d.ts +700 -0
  45. package/dist/dropdown-menu/index.js +2 -0
  46. package/dist/dropdown-menu/index.js.map +1 -0
  47. package/dist/events-BPr8sRGH.d.cts +166 -0
  48. package/dist/events-BPr8sRGH.d.ts +166 -0
  49. package/dist/input-BoIK003I.d.cts +41 -0
  50. package/dist/input-DF7D8YzW.d.ts +41 -0
  51. package/dist/internal/listbox/index.cjs +2 -0
  52. package/dist/internal/listbox/index.cjs.map +1 -0
  53. package/dist/internal/listbox/index.d.cts +269 -0
  54. package/dist/internal/listbox/index.d.ts +269 -0
  55. package/dist/internal/listbox/index.js +2 -0
  56. package/dist/internal/listbox/index.js.map +1 -0
  57. package/dist/internal/popup-menu/index.cjs +2 -0
  58. package/dist/internal/popup-menu/index.cjs.map +1 -0
  59. package/dist/internal/popup-menu/index.d.cts +846 -0
  60. package/dist/internal/popup-menu/index.d.ts +846 -0
  61. package/dist/internal/popup-menu/index.js +2 -0
  62. package/dist/internal/popup-menu/index.js.map +1 -0
  63. package/dist/item-equality-B6TbXlBT.d.cts +7 -0
  64. package/dist/item-equality-B6TbXlBT.d.ts +7 -0
  65. package/dist/loading-DphSt8MY.d.cts +27 -0
  66. package/dist/loading-TsgH6v92.d.ts +27 -0
  67. package/dist/select/index.cjs +2 -0
  68. package/dist/select/index.cjs.map +1 -0
  69. package/dist/select/index.d.cts +927 -0
  70. package/dist/select/index.d.ts +927 -0
  71. package/dist/select/index.js +2 -0
  72. package/dist/select/index.js.map +1 -0
  73. package/dist/separator-B4Ot84B0.d.ts +748 -0
  74. package/dist/separator-BmbUeeaT.d.cts +748 -0
  75. package/dist/types-9vS1uLIK.d.cts +1557 -0
  76. package/dist/types-lQCIvWW8.d.ts +1557 -0
  77. package/dist/use-listbox-item-BIi4eRPI.d.cts +182 -0
  78. package/dist/use-listbox-item-BIi4eRPI.d.ts +182 -0
  79. package/package.json +50 -12
  80. package/dist/index.d.ts +0 -2
  81. package/dist/index.js +0 -2
@@ -0,0 +1,748 @@
1
+ import * as React from 'react';
2
+ import { P as PopupMenuOpenChangeReason, H as HighlightChangeEventDetails, C as ChangeEventDetails, G as GenericEventDetails } from './events-BPr8sRGH.cjs';
3
+ import { b as ListboxStore, V as VirtualItem, F as FilterFn, S as SearchNormalizer } from './ListboxStore-BtcTXpzi.cjs';
4
+ import { G as GetQualifiedRowIdFn, av as ComponentRenderFn, C as ComponentProps } from './types-9vS1uLIK.cjs';
5
+ import { ReactStore } from '@base-ui/utils/store';
6
+ import { PopoverArrowProps, Popover, PopoverBackdropProps, PopoverPopupProps, PopoverPortalProps } from '@base-ui/react/popover';
7
+
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, {}, 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
+
37
+ interface OpenChainState {
38
+ /**
39
+ * Ordered array of surface IDs for submenus that are currently open.
40
+ * The last element is the most recently opened (deepest in chain).
41
+ */
42
+ chain: string[];
43
+ }
44
+ declare const selectors: {
45
+ isOpen: (state: OpenChainState, surfaceId: string) => boolean;
46
+ isLast: (state: OpenChainState, surfaceId: string) => boolean;
47
+ /**
48
+ * Returns true if there's an open submenu below the given depth.
49
+ * - Root (depth 0): true if any submenu is open
50
+ * - Submenu at depth N: true if a deeper submenu is open
51
+ */
52
+ hasOpenSubmenu: (state: OpenChainState, depth: number) => boolean;
53
+ };
54
+ /**
55
+ * Tracks which submenu surfaces are currently open in order.
56
+ * Used to show backdrops for all open menus in the chain.
57
+ * Single instance per menu tree (created at root, shared via context).
58
+ *
59
+ * Used by: DropdownMenu, ContextMenu
60
+ * Not used by: Select, CommandMenu (no submenus)
61
+ */
62
+ declare class OpenChainStore extends ReactStore<OpenChainState, {}, typeof selectors> {
63
+ constructor();
64
+ /**
65
+ * Mark a surface as open (adds to end of chain).
66
+ */
67
+ open(surfaceId: string): void;
68
+ /**
69
+ * Mark a surface as closed (removes from chain).
70
+ */
71
+ close(surfaceId: string): void;
72
+ /**
73
+ * Clear all open surfaces (menu tree closed).
74
+ */
75
+ clear(): void;
76
+ }
77
+
78
+ /**
79
+ * Virtual anchor for positioning the menu at a specific point.
80
+ * Used by ContextMenu to position at cursor location.
81
+ */
82
+ interface VirtualAnchor {
83
+ getBoundingClientRect(): DOMRect;
84
+ }
85
+ /**
86
+ * Virtualization configuration passed from Root/Submenu to Surface.
87
+ */
88
+ interface VirtualizationConfig {
89
+ /** Whether virtualization mode is enabled */
90
+ virtualized: boolean;
91
+ /** Pre-registered items for virtualization */
92
+ items: VirtualItem[];
93
+ /**
94
+ * Callback when highlighted item changes (for scroll sync).
95
+ * The third parameter contains event details including the reason for the change.
96
+ */
97
+ onHighlightChange?: (id: string | null, index: number, eventDetails: HighlightChangeEventDetails) => void;
98
+ }
99
+ /**
100
+ * Shared context value for popup menus.
101
+ * Both DropdownMenu.Root and ContextMenu.Root provide this context.
102
+ */
103
+ interface PopupMenuContextValue {
104
+ /** The Listbox store instance */
105
+ store: ListboxStore;
106
+ /** Whether this menu tree currently ignores user interaction. */
107
+ disabled: boolean;
108
+ /** Nesting depth: 0 = root menu, 1+ = submenu */
109
+ depth: number;
110
+ /** Close the entire menu tree (deepest submenu to root, sequentially) */
111
+ closeAll: (reason?: PopupMenuOpenChangeReason, event?: Event) => void;
112
+ /** Register a surface (submenu) for closeAll tracking. Returns unregister function. */
113
+ registerSurface: (depth: number, setOpen: (open: boolean) => void) => () => void;
114
+ /** Virtualization configuration (if enabled) */
115
+ virtualization?: VirtualizationConfig;
116
+ /**
117
+ * Virtual anchor for positioning.
118
+ * Used by ContextMenu to position at cursor location.
119
+ * DropdownMenu uses the Popover's anchor (trigger button) instead.
120
+ */
121
+ virtualAnchor?: VirtualAnchor;
122
+ /**
123
+ * Type of menu for positioning logic.
124
+ * - 'dropdown': positions relative to trigger button
125
+ * - 'context': positions at cursor with fixed positioning
126
+ */
127
+ menuType: 'dropdown' | 'context';
128
+ /**
129
+ * When to close the menu on outside interactions.
130
+ * - 'pointerdown': Close immediately when pointer is pressed outside (default)
131
+ * - 'click': Close when a full click (pointerdown + pointerup) occurs outside
132
+ * @default 'pointerdown'
133
+ */
134
+ closeOnOutsidePress: 'click' | 'pointerdown';
135
+ /**
136
+ * Function to generate qualified unique IDs for rows.
137
+ * Defined once at the root level and applied to all surfaces (root and submenus).
138
+ * If not provided, uses the default implementation.
139
+ */
140
+ getQualifiedRowId?: GetQualifiedRowIdFn;
141
+ }
142
+ declare const PopupMenuContext: React.Context<PopupMenuContextValue | null>;
143
+ /**
144
+ * Hook to access the popup menu context.
145
+ * Throws if used outside a popup menu.
146
+ */
147
+ declare function usePopupMenuContext(): PopupMenuContextValue;
148
+ /**
149
+ * Hook to optionally access the popup menu context.
150
+ * Returns null if used outside a popup menu.
151
+ */
152
+ declare function useMaybePopupMenuContext(): PopupMenuContextValue | null;
153
+
154
+ interface PopupMenuSafeTriangleAreaDebugSettings {
155
+ enabled: boolean;
156
+ idleColor: string;
157
+ successColor: string;
158
+ missColor: string;
159
+ triangleFillOpacity: number;
160
+ overlayOpacity: number;
161
+ showStroke: boolean;
162
+ strokeWidth: number;
163
+ strokeDasharray: string;
164
+ showDots: boolean;
165
+ dotRadius: number;
166
+ freezeOnPointerLeave: boolean;
167
+ persistOnSuccess: boolean;
168
+ showMissState: boolean;
169
+ missFreezeDuration: number;
170
+ }
171
+ interface PopupMenuSafeTriangleAreaDebugOptions {
172
+ enabled?: boolean;
173
+ idleColor?: string;
174
+ successColor?: string;
175
+ missColor?: string;
176
+ triangleFillOpacity?: number;
177
+ overlayOpacity?: number;
178
+ showStroke?: boolean;
179
+ strokeWidth?: number;
180
+ strokeDasharray?: string;
181
+ showDots?: boolean;
182
+ dotRadius?: number;
183
+ freezeOnPointerLeave?: boolean;
184
+ persistOnSuccess?: boolean;
185
+ showMissState?: boolean;
186
+ missFreezeDuration?: number;
187
+ }
188
+ type PopupMenuSafeTriangleAreaDebugConfig = boolean | PopupMenuSafeTriangleAreaDebugOptions;
189
+ declare function resolvePopupMenuSafeTriangleAreaDebugConfig(config?: PopupMenuSafeTriangleAreaDebugConfig, legacyEnabled?: boolean): PopupMenuSafeTriangleAreaDebugSettings;
190
+ /**
191
+ * Debug configuration available on popup-menu roots.
192
+ */
193
+ interface PopupMenuDebugOptions {
194
+ /**
195
+ * Shows/configures the safe triangle area used by submenu aim guard.
196
+ * @default false
197
+ */
198
+ showSafeTriangleArea?: PopupMenuSafeTriangleAreaDebugConfig;
199
+ /**
200
+ * @deprecated Use `showSafeTriangleArea` instead.
201
+ */
202
+ showSubmenuSafeTriangleArea?: boolean;
203
+ /**
204
+ * Enables console logging for aim-guard diagnostics.
205
+ * @default false
206
+ */
207
+ logAimGuardEvents?: boolean;
208
+ }
209
+ interface PopupMenuDebugContextValue {
210
+ showSafeTriangleArea: PopupMenuSafeTriangleAreaDebugSettings;
211
+ logAimGuardEvents: boolean;
212
+ }
213
+ declare const PopupMenuDebugContext: React.Context<PopupMenuDebugContextValue>;
214
+ declare function usePopupMenuDebug(): PopupMenuDebugContextValue;
215
+
216
+ interface UsePopupMenuRootParams {
217
+ /**
218
+ * Callback when the open state changes.
219
+ * The second parameter contains event details including the reason for the change.
220
+ */
221
+ onOpenChange?: (open: boolean, eventDetails: ChangeEventDetails<string>) => void;
222
+ /**
223
+ * Whether the menu is initially open.
224
+ * @default false
225
+ */
226
+ defaultOpen?: boolean;
227
+ /**
228
+ * Whether virtualization mode is enabled.
229
+ * @default false
230
+ */
231
+ virtualized?: boolean;
232
+ /**
233
+ * Pre-registered items for virtualization.
234
+ */
235
+ items?: VirtualItem[];
236
+ /**
237
+ * Callback when the highlighted item changes.
238
+ * The third parameter contains event details including the reason for the change.
239
+ */
240
+ onHighlightChange?: (id: string | null, index: number, eventDetails: GenericEventDetails<string, {
241
+ index: number;
242
+ }>) => void;
243
+ /**
244
+ * When to close the menu on outside interactions.
245
+ * - 'pointerdown': Close immediately when pointer is pressed outside (default)
246
+ * - 'click': Close when a full click (pointerdown + pointerup) occurs outside
247
+ * @default 'pointerdown'
248
+ */
249
+ closeOnOutsidePress?: 'click' | 'pointerdown';
250
+ /**
251
+ * Whether the menu should ignore user interaction.
252
+ * Can be controlled declaratively via this prop, or imperatively via actionsRef.setDisabled().
253
+ * @default false
254
+ */
255
+ disabled?: boolean;
256
+ /**
257
+ * Initial disabled state for imperative usage.
258
+ * Ignored when `disabled` prop is true.
259
+ * @default false
260
+ */
261
+ defaultDisabled?: boolean;
262
+ }
263
+ interface PopupMenuRootActions {
264
+ /** Close the menu tree imperatively. */
265
+ close: () => void;
266
+ /** Unmount the popup imperatively (when keep-mounted mode is enabled). */
267
+ unmount: () => void;
268
+ /** Enable/disable the menu tree imperatively. */
269
+ setDisabled: (disabled: boolean) => void;
270
+ }
271
+ interface UsePopupMenuRootReturn {
272
+ /** The Listbox store instance */
273
+ store: ListboxStore;
274
+ /** The FocusOwner store instance */
275
+ focusOwnerStore: FocusOwnerStore;
276
+ /** The OpenChain store instance */
277
+ openChainStore: OpenChainStore;
278
+ /** Register a surface (submenu) for closeAll tracking */
279
+ registerSurface: (depth: number, setOpen: (open: boolean) => void) => () => void;
280
+ /** Close the entire menu tree */
281
+ closeAll: (reason?: PopupMenuOpenChangeReason, event?: Event) => void;
282
+ /** Virtualization configuration (if enabled) */
283
+ virtualization: VirtualizationConfig | undefined;
284
+ /** Handle open state change (updates store and clears stores on close) */
285
+ handleOpenChange: (open: boolean, reason?: PopupMenuOpenChangeReason, event?: Event) => void;
286
+ /** Whether the menu currently ignores user interaction. */
287
+ disabled: boolean;
288
+ /** Update imperative disabled state. */
289
+ setDisabled: (disabled: boolean) => void;
290
+ }
291
+ /**
292
+ * Hook that creates and manages the core stores and utilities for popup menus.
293
+ * Used by both DropdownMenu.Root and ContextMenu.Root.
294
+ *
295
+ * Provides:
296
+ * - ListboxStore for item management
297
+ * - FocusOwnerStore for focus tracking across submenus
298
+ * - OpenChainStore for tracking open submenu chain
299
+ * - Surface registry for closeAll functionality
300
+ */
301
+ declare function usePopupMenuRoot(params?: UsePopupMenuRootParams): UsePopupMenuRootReturn;
302
+
303
+ interface PopupMenuArrowProps extends PopoverArrowProps {
304
+ }
305
+ /**
306
+ * An optional arrow element to render alongside the popup menu.
307
+ * This can be used to help visually link the trigger with the popup.
308
+ * Must be rendered inside `Popup`.
309
+ * Renders a `<div>` element.
310
+ */
311
+ declare const PopupMenuArrow: React.ForwardRefExoticComponent<PopupMenuArrowProps & React.RefAttributes<HTMLDivElement>>;
312
+ declare namespace PopupMenuArrow {
313
+ type Props = PopupMenuArrowProps;
314
+ type State = Popover.Arrow.State;
315
+ }
316
+
317
+ interface PopupMenuBackdropProps extends PopoverBackdropProps {
318
+ /**
319
+ * Controls when the backdrop becomes visible for submenus.
320
+ * - `"focus"`: Show when the submenu becomes the focus owner (prevents flicker on hover).
321
+ * If a deeper submenu is open, the backdrop remains visible.
322
+ * - `"open"`: Show as soon as the submenu opens, regardless of focus.
323
+ *
324
+ * @default "focus" for submenus, "open" for root menu
325
+ */
326
+ showOn?: 'focus' | 'open';
327
+ }
328
+ /**
329
+ * An overlay displayed beneath the popup menu.
330
+ *
331
+ * For submenus with `showOn="focus"` (default), the backdrop visibility follows these rules:
332
+ * - If this submenu is at the end of the open chain (deepest), it must be
333
+ * the focus owner to show the backdrop (prevents flicker on hover)
334
+ * - If this submenu is in the chain but not at the end (has a deeper submenu open),
335
+ * the backdrop remains visible
336
+ *
337
+ * With `showOn="open"`, the backdrop shows as soon as the submenu opens.
338
+ *
339
+ * Renders a `<div>` element with `pointer-events: none`.
340
+ */
341
+ declare const PopupMenuBackdrop: React.ForwardRefExoticComponent<PopupMenuBackdropProps & React.RefAttributes<HTMLDivElement>>;
342
+ declare namespace PopupMenuBackdrop {
343
+ type Props = PopupMenuBackdropProps;
344
+ type State = Popover.Backdrop.State;
345
+ }
346
+
347
+ interface PopupMenuPopupState extends Popover.Popup.State {
348
+ /**
349
+ * Whether this popup is a submenu (not the root menu).
350
+ */
351
+ isSubmenu: boolean;
352
+ /**
353
+ * Whether any non-root subpage is currently open.
354
+ */
355
+ hasOpenSubpage: boolean;
356
+ /**
357
+ * Active subpage ID, or null when only the root page is open.
358
+ */
359
+ subpageId: string | null;
360
+ /**
361
+ * Ordered stack of open non-root subpage IDs.
362
+ * For nested subpages this includes each page in open order.
363
+ */
364
+ openSubpageIds: string[];
365
+ }
366
+ interface PopupMenuPopupProps extends Omit<PopoverPopupProps, 'className' | 'render'> {
367
+ /**
368
+ * CSS class applied to the element, or a function that
369
+ * returns a class based on the component's state.
370
+ */
371
+ className?: string | ((state: PopupMenuPopupState) => string);
372
+ /**
373
+ * Allows replacing the popup element with a custom element.
374
+ * The render state includes popup + subpage navigation state.
375
+ */
376
+ render?: React.ReactElement | ComponentRenderFn<React.HTMLAttributes<HTMLElement>, PopupMenuPopupState>;
377
+ }
378
+ /**
379
+ * A container for the popup menu contents.
380
+ * Wraps Popover.Popup with:
381
+ * - Aim guard clearing when pointer enters submenu
382
+ * - Focus ownership transfer when pointer enters submenu
383
+ * - Auto-focus disabled for submenus (focus managed by FocusOwner system)
384
+ *
385
+ * Renders a `<div>` element.
386
+ */
387
+ declare const PopupMenuPopup: React.ForwardRefExoticComponent<PopupMenuPopupProps & React.RefAttributes<HTMLDivElement>>;
388
+ declare namespace PopupMenuPopup {
389
+ type Props = PopupMenuPopupProps;
390
+ type State = PopupMenuPopupState;
391
+ }
392
+
393
+ interface PopupMenuPortalProps extends PopoverPortalProps {
394
+ }
395
+ /**
396
+ * A portal element that moves the popup to a different part of the DOM.
397
+ * By default, the portal element is appended to `<body>`.
398
+ */
399
+ declare const PopupMenuPortal: React.ForwardRefExoticComponent<PopoverPortalProps & React.RefAttributes<HTMLDivElement>>;
400
+ declare namespace PopupMenuPortal {
401
+ type Props = PopoverPortalProps;
402
+ type State = Popover.Portal.State;
403
+ }
404
+
405
+ declare enum PopupMenuPositionerCssVars {
406
+ /**
407
+ * The available width between the trigger and the edge of the viewport.
408
+ * @type {number}
409
+ */
410
+ availableWidth = "--available-width",
411
+ /**
412
+ * The available height between the trigger and the edge of the viewport.
413
+ * @type {number}
414
+ */
415
+ availableHeight = "--available-height",
416
+ /**
417
+ * The anchor's width.
418
+ * @type {number}
419
+ */
420
+ anchorWidth = "--anchor-width",
421
+ /**
422
+ * The anchor's height.
423
+ * @type {number}
424
+ */
425
+ anchorHeight = "--anchor-height",
426
+ /**
427
+ * The coordinates that this element is anchored to. Used for animations and transitions.
428
+ * @type {string}
429
+ */
430
+ transformOrigin = "--transform-origin",
431
+ /**
432
+ * The width of the positioner element.
433
+ * @type {number}
434
+ */
435
+ positionerWidth = "--positioner-width",
436
+ /**
437
+ * The height of the positioner element.
438
+ * @type {number}
439
+ */
440
+ positionerHeight = "--positioner-height"
441
+ }
442
+
443
+ interface PopupMenuIconState extends Record<string, unknown> {
444
+ /**
445
+ * Whether the popup is currently open.
446
+ */
447
+ open: boolean;
448
+ }
449
+ interface PopupMenuIconProps extends ComponentProps<'span', PopupMenuIcon.State> {
450
+ }
451
+ /**
452
+ * An icon that indicates the trigger opens a popup.
453
+ * Typically used inside the trigger to show a chevron or dropdown arrow.
454
+ * Renders a `<span>` element.
455
+ */
456
+ declare const PopupMenuIcon: React.ForwardRefExoticComponent<Omit<PopupMenuIcon.Props, "ref"> & React.RefAttributes<HTMLSpanElement>>;
457
+ declare namespace PopupMenuIcon {
458
+ type State = PopupMenuIconState;
459
+ interface Props extends PopupMenuIconProps {
460
+ }
461
+ }
462
+
463
+ interface PopupMenuEmptyState extends Record<string, unknown> {
464
+ }
465
+ interface PopupMenuEmptyProps extends ComponentProps<'div', PopupMenuEmpty.State> {
466
+ children: React.ReactNode;
467
+ }
468
+ /**
469
+ * Renders when no items match the current search query.
470
+ * Only visible when there's an active search with zero results.
471
+ * Renders a `<div>` element.
472
+ */
473
+ declare const PopupMenuEmpty: React.ForwardRefExoticComponent<Omit<PopupMenuEmpty.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
474
+ declare namespace PopupMenuEmpty {
475
+ type State = PopupMenuEmptyState;
476
+ interface Props extends PopupMenuEmptyProps {
477
+ }
478
+ }
479
+
480
+ /**
481
+ * CSS custom properties applied to the List component.
482
+ */
483
+ declare enum PopupMenuListCssVars {
484
+ /**
485
+ * The maximum measured row width.
486
+ * Applied when `measureRowWidth` is true.
487
+ * Useful for keeping virtualized lists at a consistent width.
488
+ * @type {number}
489
+ */
490
+ rowWidth = "--row-width"
491
+ }
492
+
493
+ /**
494
+ * State passed to children render function.
495
+ */
496
+ interface PopupMenuListChildrenState {
497
+ /** Current search query */
498
+ search: string;
499
+ /** Number of items matching the current filter */
500
+ filteredCount: number;
501
+ }
502
+ interface PopupMenuListState extends Record<string, unknown> {
503
+ }
504
+ interface PopupMenuListProps extends Omit<ComponentProps<'div', PopupMenuList.State>, 'children'> {
505
+ /**
506
+ * Content to render inside the list.
507
+ * Can be a render function that receives the current search state.
508
+ */
509
+ children: React.ReactNode | ((state: PopupMenuListChildrenState) => React.ReactNode);
510
+ /**
511
+ * Accessible label for the listbox.
512
+ * @default 'Suggestions'
513
+ */
514
+ label?: string;
515
+ /**
516
+ * When true, measures row widths and applies `--row-width` CSS variable.
517
+ * Keeps the list at the maximum width seen while scrolling.
518
+ * Useful for virtualized lists where content width varies.
519
+ * @default true
520
+ */
521
+ measureRowWidth?: boolean;
522
+ /**
523
+ * Maximum width cap for row measurement (in pixels).
524
+ * Only used when `measureRowWidth` is true.
525
+ */
526
+ maxRowWidth?: number;
527
+ }
528
+ /**
529
+ * Container for popup menu items.
530
+ * Supports render props for accessing search state.
531
+ * Renders a `<div>` element with role="listbox".
532
+ */
533
+ declare const PopupMenuList: React.ForwardRefExoticComponent<Omit<PopupMenuList.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
534
+ declare namespace PopupMenuList {
535
+ type State = PopupMenuListState;
536
+ type ChildrenState = PopupMenuListChildrenState;
537
+ interface Props extends PopupMenuListProps {
538
+ }
539
+ }
540
+
541
+ type Direction = 'up' | 'down';
542
+ interface PopupMenuScrollArrowState extends Record<string, unknown> {
543
+ /**
544
+ * The scroll direction this arrow controls.
545
+ */
546
+ direction: Direction;
547
+ /**
548
+ * Whether there is content to scroll in this direction.
549
+ */
550
+ visible: boolean;
551
+ }
552
+ interface PopupMenuScrollArrowProps extends ComponentProps<'div', PopupMenuScrollArrow.State> {
553
+ /**
554
+ * The direction to scroll when hovering over this arrow.
555
+ */
556
+ direction: Direction;
557
+ /**
558
+ * Whether to keep the element mounted when there's nothing to scroll.
559
+ * When false (default), the element is not rendered.
560
+ * When true, the element is rendered but can be styled via `data-visible="false"`.
561
+ * @default false
562
+ */
563
+ keepMounted?: boolean;
564
+ /**
565
+ * Scroll speed in pixels per frame.
566
+ * @default 10
567
+ */
568
+ scrollSpeed?: number;
569
+ }
570
+ /**
571
+ * Base scroll arrow component used by ScrollUpArrow and ScrollDownArrow.
572
+ * Shows when there is content to scroll in the specified direction.
573
+ * Scrolls the list continuously while pointer is over it.
574
+ * Renders a `<div>` element.
575
+ */
576
+ declare const PopupMenuScrollArrow: React.ForwardRefExoticComponent<Omit<PopupMenuScrollArrow.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
577
+ declare namespace PopupMenuScrollArrow {
578
+ type State = PopupMenuScrollArrowState;
579
+ interface Props extends PopupMenuScrollArrowProps {
580
+ }
581
+ }
582
+ interface PopupMenuScrollUpArrowProps extends Omit<PopupMenuScrollArrowProps, 'direction'> {
583
+ }
584
+ /**
585
+ * A scroll indicator that appears when there's content above.
586
+ * Scrolls the list up continuously while pointer is over it.
587
+ * Renders a `<div>` element.
588
+ */
589
+ declare const PopupMenuScrollUpArrow: React.ForwardRefExoticComponent<Omit<PopupMenuScrollUpArrow.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
590
+ declare namespace PopupMenuScrollUpArrow {
591
+ type State = PopupMenuScrollArrowState;
592
+ interface Props extends PopupMenuScrollUpArrowProps {
593
+ }
594
+ }
595
+ interface PopupMenuScrollDownArrowProps extends Omit<PopupMenuScrollArrowProps, 'direction'> {
596
+ }
597
+ /**
598
+ * A scroll indicator that appears when there's content below.
599
+ * Scrolls the list down continuously while pointer is over it.
600
+ * Renders a `<div>` element.
601
+ */
602
+ declare const PopupMenuScrollDownArrow: React.ForwardRefExoticComponent<Omit<PopupMenuScrollDownArrow.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
603
+ declare namespace PopupMenuScrollDownArrow {
604
+ type State = PopupMenuScrollArrowState;
605
+ interface Props extends PopupMenuScrollDownArrowProps {
606
+ }
607
+ }
608
+
609
+ interface PopupMenuSurfaceState extends Record<string, unknown> {
610
+ }
611
+ interface PopupMenuSurfaceProps extends ComponentProps<'div', PopupMenuSurface.State> {
612
+ /**
613
+ * Filter function for matching items against search query.
614
+ * Returns a score between 0 and 1 (0 = no match, > 0 = match).
615
+ * Pass `false` to disable filtering entirely.
616
+ * @default commandScore (fuzzy matching)
617
+ */
618
+ filter?: FilterFn | false;
619
+ /**
620
+ * Transforms search input before filtering and visibility logic.
621
+ * @default trim whitespace (`search.trim()`)
622
+ */
623
+ normalizeSearch?: SearchNormalizer;
624
+ /**
625
+ * Controlled search value.
626
+ */
627
+ search?: string;
628
+ /**
629
+ * Callback when search value changes.
630
+ */
631
+ onSearchChange?: (search: string) => void;
632
+ /**
633
+ * Default search value for uncontrolled usage.
634
+ * @default ''
635
+ */
636
+ defaultSearch?: string;
637
+ /**
638
+ * Whether navigation should loop from last to first item and vice versa.
639
+ * @default true
640
+ */
641
+ loop?: boolean;
642
+ /**
643
+ * Controls auto-highlighting behavior when the menu opens.
644
+ * - `true`: highlight the first item (default)
645
+ * - `false`: don't auto-highlight any item
646
+ * - `string`: highlight the item with this specific value
647
+ * @default true
648
+ */
649
+ autoHighlightFirst?: boolean | string;
650
+ /**
651
+ * Whether to clear the search query when the menu closes.
652
+ * - `true`: clear immediately when menu closes (default)
653
+ * - `false`: preserve search when menu closes
654
+ * - `'after-exit'`: clear after exit animation completes
655
+ * @default true
656
+ */
657
+ clearSearchOnClose?: boolean | 'after-exit';
658
+ /**
659
+ * Whether to skip auto-focusing the input/list when this surface becomes the focus owner.
660
+ * Useful for Combobox where the input is outside the popup and should retain focus.
661
+ * @default false
662
+ */
663
+ skipAutoFocus?: boolean;
664
+ /**
665
+ * Ordered list of item values when using `filter={false}`.
666
+ * This tells the store the intended display order for navigation/highlighting.
667
+ * Required when `filter={false}` - must always be provided with the current visible items.
668
+ */
669
+ orderedItems?: string[];
670
+ children: React.ReactNode;
671
+ }
672
+ /**
673
+ * Provides search context and manages item registration for popup menu.
674
+ * Place inside PopupMenu.Popup to enable search functionality.
675
+ * Renders a `<div>` element.
676
+ */
677
+ declare const PopupMenuSurface: React.ForwardRefExoticComponent<Omit<PopupMenuSurface.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
678
+ declare namespace PopupMenuSurface {
679
+ type State = PopupMenuSurfaceState;
680
+ interface Props extends PopupMenuSurfaceProps {
681
+ }
682
+ }
683
+
684
+ interface PopupMenuGroupState extends Record<string, unknown> {
685
+ /**
686
+ * Whether the group is hidden due to no matching items.
687
+ */
688
+ hidden: boolean;
689
+ }
690
+ interface PopupMenuGroupProps extends ComponentProps<'div', PopupMenuGroup.State> {
691
+ /**
692
+ * Whether to force render this group regardless of filter results.
693
+ * @default false
694
+ */
695
+ forceMount?: boolean;
696
+ children: React.ReactNode;
697
+ }
698
+ /**
699
+ * Groups related popup menu items together.
700
+ * Hidden when no child items match the current filter.
701
+ * Renders a `<div>` element with role="group".
702
+ */
703
+ declare const PopupMenuGroup: React.ForwardRefExoticComponent<Omit<PopupMenuGroup.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
704
+ declare namespace PopupMenuGroup {
705
+ type State = PopupMenuGroupState;
706
+ interface Props extends PopupMenuGroupProps {
707
+ }
708
+ }
709
+
710
+ interface PopupMenuGroupLabelState extends Record<string, unknown> {
711
+ }
712
+ interface PopupMenuGroupLabelProps extends ComponentProps<'div', PopupMenuGroupLabel.State> {
713
+ children: React.ReactNode;
714
+ }
715
+ /**
716
+ * A label/heading for a group of popup menu items.
717
+ * Renders a `<div>` element with role="presentation".
718
+ */
719
+ declare const PopupMenuGroupLabel: React.ForwardRefExoticComponent<Omit<PopupMenuGroupLabel.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
720
+ declare namespace PopupMenuGroupLabel {
721
+ type State = PopupMenuGroupLabelState;
722
+ interface Props extends PopupMenuGroupLabelProps {
723
+ }
724
+ }
725
+
726
+ interface PopupMenuSeparatorState extends Record<string, unknown> {
727
+ }
728
+ interface PopupMenuSeparatorProps extends ComponentProps<'div', PopupMenuSeparator.State> {
729
+ /**
730
+ * Whether to always render the separator, even during search.
731
+ * By default, separators are hidden when there's an active search query.
732
+ * @default false
733
+ */
734
+ alwaysRender?: boolean;
735
+ }
736
+ /**
737
+ * A visual separator between popup menu items.
738
+ * Hidden during active search unless `alwaysRender` is true.
739
+ * Renders a `<div>` element with role="separator".
740
+ */
741
+ declare const PopupMenuSeparator: React.ForwardRefExoticComponent<Omit<PopupMenuSeparator.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
742
+ declare namespace PopupMenuSeparator {
743
+ type State = PopupMenuSeparatorState;
744
+ interface Props extends PopupMenuSeparatorProps {
745
+ }
746
+ }
747
+
748
+ export { PopupMenuDebugContext as $, type PopupMenuListState as A, type PopupMenuPopupProps as B, type PopupMenuPortalProps as C, type PopupMenuScrollArrowProps as D, type PopupMenuScrollArrowState as E, type PopupMenuScrollDownArrowProps as F, type PopupMenuScrollUpArrowProps as G, type PopupMenuSeparatorProps as H, type PopupMenuSeparatorState as I, type PopupMenuSurfaceProps as J, type PopupMenuSurfaceState as K, PopupMenuListCssVars as L, PopupMenuPositionerCssVars as M, type PopupMenuContextValue as N, useMaybePopupMenuContext as O, type PopupMenuDebugOptions as P, usePopupMenuContext as Q, type PopupMenuPopupState as R, FocusOwnerStore as S, OpenChainStore as T, type VirtualAnchor as U, type VirtualizationConfig as V, PopupMenuContext as W, type PopupMenuDebugContextValue as X, type PopupMenuSafeTriangleAreaDebugConfig as Y, type PopupMenuSafeTriangleAreaDebugOptions as Z, type PopupMenuSafeTriangleAreaDebugSettings as _, type PopupMenuRootActions as a, resolvePopupMenuSafeTriangleAreaDebugConfig as a0, usePopupMenuDebug as a1, type FocusOwnerState as a2, type OpenChainState as a3, type UsePopupMenuRootParams as a4, type UsePopupMenuRootReturn as a5, usePopupMenuRoot as a6, PopupMenuScrollArrow as a7, PopupMenuArrow as b, PopupMenuBackdrop as c, PopupMenuEmpty as d, PopupMenuGroup as e, PopupMenuGroupLabel as f, PopupMenuIcon as g, PopupMenuList as h, PopupMenuPopup as i, PopupMenuPortal as j, PopupMenuScrollDownArrow as k, PopupMenuScrollUpArrow as l, PopupMenuSeparator as m, PopupMenuSurface as n, type PopupMenuArrowProps as o, type PopupMenuBackdropProps as p, type PopupMenuEmptyProps as q, type PopupMenuEmptyState as r, type PopupMenuGroupLabelProps as s, type PopupMenuGroupLabelState as t, type PopupMenuGroupProps as u, type PopupMenuGroupState as v, type PopupMenuIconProps as w, type PopupMenuIconState as x, type PopupMenuListChildrenState as y, type PopupMenuListProps as z };