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

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 (113) hide show
  1. package/dist/ListboxStore-BYBpGrOz.d.ts +453 -0
  2. package/dist/ListboxStore-nmorsoqX.d.cts +453 -0
  3. package/dist/chunk-4C666HHU.js +2 -0
  4. package/dist/chunk-4C666HHU.js.map +1 -0
  5. package/dist/chunk-5T5B5SPR.cjs +2 -0
  6. package/dist/chunk-5T5B5SPR.cjs.map +1 -0
  7. package/dist/chunk-A4Z5BY7H.js +2 -0
  8. package/dist/chunk-A4Z5BY7H.js.map +1 -0
  9. package/dist/chunk-BFOY762U.js +2 -0
  10. package/dist/chunk-BFOY762U.js.map +1 -0
  11. package/dist/chunk-IT372NHF.js +2 -0
  12. package/dist/chunk-IT372NHF.js.map +1 -0
  13. package/dist/chunk-JFEVUUPC.cjs +2 -0
  14. package/dist/chunk-JFEVUUPC.cjs.map +1 -0
  15. package/dist/chunk-KO3DXT3Y.js +2 -0
  16. package/dist/chunk-KO3DXT3Y.js.map +1 -0
  17. package/dist/chunk-LXXK4S4Q.js +2 -0
  18. package/dist/chunk-LXXK4S4Q.js.map +1 -0
  19. package/dist/chunk-M4G6J7DP.cjs +2 -0
  20. package/dist/chunk-M4G6J7DP.cjs.map +1 -0
  21. package/dist/chunk-SCDHQZFI.cjs +2 -0
  22. package/dist/chunk-SCDHQZFI.cjs.map +1 -0
  23. package/dist/chunk-W4ACKMIZ.cjs +2 -0
  24. package/dist/chunk-W4ACKMIZ.cjs.map +1 -0
  25. package/dist/chunk-XMZZ62VJ.cjs +2 -0
  26. package/dist/chunk-XMZZ62VJ.cjs.map +1 -0
  27. package/dist/combobox/index.cjs +2 -0
  28. package/dist/combobox/index.cjs.map +1 -0
  29. package/dist/combobox/index.d.cts +1066 -0
  30. package/dist/combobox/index.d.ts +1066 -0
  31. package/dist/combobox/index.js +2 -0
  32. package/dist/combobox/index.js.map +1 -0
  33. package/dist/command-menu/index.cjs +2 -0
  34. package/dist/command-menu/index.cjs.map +1 -0
  35. package/dist/command-menu/index.d.cts +154 -0
  36. package/dist/command-menu/index.d.ts +154 -0
  37. package/dist/command-menu/index.js +2 -0
  38. package/dist/command-menu/index.js.map +1 -0
  39. package/dist/command-score-CTJ9NV6n.d.cts +23 -0
  40. package/dist/command-score-CTJ9NV6n.d.ts +23 -0
  41. package/dist/context-menu/index.cjs +2 -0
  42. package/dist/context-menu/index.cjs.map +1 -0
  43. package/dist/context-menu/index.d.cts +672 -0
  44. package/dist/context-menu/index.d.ts +672 -0
  45. package/dist/context-menu/index.js +2 -0
  46. package/dist/context-menu/index.js.map +1 -0
  47. package/dist/dropdown-menu/index.cjs +2 -0
  48. package/dist/dropdown-menu/index.cjs.map +1 -0
  49. package/dist/dropdown-menu/index.d.cts +699 -0
  50. package/dist/dropdown-menu/index.d.ts +699 -0
  51. package/dist/dropdown-menu/index.js +2 -0
  52. package/dist/dropdown-menu/index.js.map +1 -0
  53. package/dist/events-DOGItflK.d.ts +1776 -0
  54. package/dist/events-DPsuhBln.d.cts +1776 -0
  55. package/dist/input-C95v6jB0.d.cts +46 -0
  56. package/dist/input-CYweYB_i.d.ts +46 -0
  57. package/dist/internal/listbox/index.cjs +2 -0
  58. package/dist/internal/listbox/index.cjs.map +1 -0
  59. package/dist/internal/listbox/index.d.cts +272 -0
  60. package/dist/internal/listbox/index.d.ts +272 -0
  61. package/dist/internal/listbox/index.js +2 -0
  62. package/dist/internal/listbox/index.js.map +1 -0
  63. package/dist/internal/popup-menu/index.cjs +2 -0
  64. package/dist/internal/popup-menu/index.cjs.map +1 -0
  65. package/dist/internal/popup-menu/index.d.cts +238 -0
  66. package/dist/internal/popup-menu/index.d.ts +238 -0
  67. package/dist/internal/popup-menu/index.js +2 -0
  68. package/dist/internal/popup-menu/index.js.map +1 -0
  69. package/dist/items-B6HeFO_8.d.cts +37 -0
  70. package/dist/items-B6HeFO_8.d.ts +37 -0
  71. package/dist/kbd/index.cjs +2 -0
  72. package/dist/kbd/index.cjs.map +1 -0
  73. package/dist/kbd/index.d.cts +61 -0
  74. package/dist/kbd/index.d.ts +61 -0
  75. package/dist/kbd/index.js +2 -0
  76. package/dist/kbd/index.js.map +1 -0
  77. package/dist/loaders/index.cjs +2 -0
  78. package/dist/loaders/index.cjs.map +1 -0
  79. package/dist/loaders/index.d.cts +363 -0
  80. package/dist/loaders/index.d.ts +363 -0
  81. package/dist/loaders/index.js +2 -0
  82. package/dist/loaders/index.js.map +1 -0
  83. package/dist/loading-C6WZGUc3.d.cts +29 -0
  84. package/dist/loading-CC4n55sR.d.ts +29 -0
  85. package/dist/resolve-BYm41YfG.d.ts +406 -0
  86. package/dist/resolve-Dk_fAKb2.d.cts +406 -0
  87. package/dist/scroll-arrow-B81wZTZ2.d.cts +544 -0
  88. package/dist/scroll-arrow-CNd0tgME.d.ts +544 -0
  89. package/dist/select/index.cjs +2 -0
  90. package/dist/select/index.cjs.map +1 -0
  91. package/dist/select/index.d.cts +985 -0
  92. package/dist/select/index.d.ts +985 -0
  93. package/dist/select/index.js +2 -0
  94. package/dist/select/index.js.map +1 -0
  95. package/dist/separator-BiySI623.d.cts +275 -0
  96. package/dist/separator-De8l8DKO.d.ts +275 -0
  97. package/dist/surface-context-ClmxshBW.d.ts +14 -0
  98. package/dist/surface-context-DF-L-30G.d.cts +14 -0
  99. package/dist/type-guards-BC2B6bVi.d.cts +350 -0
  100. package/dist/type-guards-ybcHBB3C.d.ts +350 -0
  101. package/dist/types-DT4FOOa2.d.cts +51 -0
  102. package/dist/types-DT4FOOa2.d.ts +51 -0
  103. package/dist/use-listbox-item-NzZuY34-.d.cts +212 -0
  104. package/dist/use-listbox-item-NzZuY34-.d.ts +212 -0
  105. package/dist/video-player/index.cjs +3 -0
  106. package/dist/video-player/index.cjs.map +1 -0
  107. package/dist/video-player/index.d.cts +1391 -0
  108. package/dist/video-player/index.d.ts +1391 -0
  109. package/dist/video-player/index.js +3 -0
  110. package/dist/video-player/index.js.map +1 -0
  111. package/package.json +66 -12
  112. package/dist/index.d.ts +0 -2
  113. package/dist/index.js +0 -2
@@ -0,0 +1,238 @@
1
+ import { F as FocusOwnerStore, O as OpenChainStore, M as MenuTreeResolver, V as VirtualizationConfig, P as PopupMenuDebugOptions, v as VirtualAnchor } from '../../scroll-arrow-B81wZTZ2.cjs';
2
+ export { b as PopupMenuArrow, h as PopupMenuArrowProps, c as PopupMenuBackdrop, i as PopupMenuBackdropProps, w as PopupMenuContext, r as PopupMenuContextValue, p as PopupMenuListCssVars, d as PopupMenuPopup, j as PopupMenuPopupProps, t as PopupMenuPopupState, e as PopupMenuPortal, k as PopupMenuPortalProps, q as PopupMenuPositionerCssVars, a as PopupMenuRootActions, l as PopupMenuScrollArrowProps, m as PopupMenuScrollArrowState, f as PopupMenuScrollDownArrow, n as PopupMenuScrollDownArrowProps, g as PopupMenuScrollUpArrow, o as PopupMenuScrollUpArrowProps, U as UsePopupMenuRootParams, u as useMaybePopupMenuContext, s as usePopupMenuContext, x as usePopupMenuRoot } from '../../scroll-arrow-B81wZTZ2.cjs';
3
+ import * as React from 'react';
4
+ import { p as SubpageStackContextValue, S as SubmenuContextValue, o as SubpageContextValue } from '../../type-guards-BC2B6bVi.cjs';
5
+ export { P as PopupMenuGroupValue, a as PopupMenuPositioner, h as PopupMenuPositionerAlign, i as PopupMenuPositionerProps, b as PopupMenuRadioItemIndicator, j as PopupMenuRadioItemIndicatorProps, k as PopupMenuRadioItemIndicatorState, c as PopupMenuSubmenuRoot, l as PopupMenuSubmenuRootProps, d as PopupMenuSubmenuTriggerIndicator, m as PopupMenuSubmenuTriggerIndicatorProps, n as PopupMenuSubmenuTriggerIndicatorState, e as PopupMenuTree, f as PopupMenuTreeConnector, g as PopupMenuTreeItem, z as SubpageStackContext, U as UsePopupMenuItemParams, w as UsePopupMenuItemReturn, y as isTreeItemDef, u as useMaybeSubmenuContext, q as useMaybeSubpageContext, r as useMaybeSubpageStack, x as usePopupMenuItem, s as useSubmenuContext, t as useSubpageContext, v as useSubpageStack } from '../../type-guards-BC2B6bVi.cjs';
6
+ import { b as ListboxStore } from '../../ListboxStore-nmorsoqX.cjs';
7
+ export { V as VirtualItem } from '../../ListboxStore-nmorsoqX.cjs';
8
+ import * as react_jsx_runtime from 'react/jsx-runtime';
9
+ export { P as PopupMenuEmpty, g as PopupMenuEmptyProps, h as PopupMenuEmptyState, a as PopupMenuGroup, b as PopupMenuGroupLabel, i as PopupMenuGroupLabelProps, j as PopupMenuGroupLabelState, k as PopupMenuGroupProps, l as PopupMenuGroupState, c as PopupMenuIcon, m as PopupMenuIconProps, n as PopupMenuIconState, d as PopupMenuList, o as PopupMenuListChildrenState, p as PopupMenuListProps, q as PopupMenuListState, e as PopupMenuSeparator, r as PopupMenuSeparatorProps, s as PopupMenuSeparatorState, f as PopupMenuSurface, t as PopupMenuSurfaceProps, u as PopupMenuSurfaceState } from '../../separator-BiySI623.cjs';
10
+ export { P as PopupMenuInput, a as PopupMenuInputProps, b as PopupMenuInputState } from '../../input-C95v6jB0.cjs';
11
+ export { P as PopupMenuLoading, a as PopupMenuLoadingProps, b as PopupMenuLoadingState } from '../../loading-C6WZGUc3.cjs';
12
+ export { M as AsyncLoaderConfig, O as AsyncLoaderFetchStatus, Q as AsyncLoaderLoadingPhase, R as AsyncLoaderResult, S as AsyncLoaderSource, T as AsyncLoaderStatus, U as AsyncNodesConfig, V as AsyncRenderState, W as AsyncResultBehavior, X as AsyncState, Y as BreadcrumbNode, Z as CheckboxItemDef, _ as CheckboxItemRenderParams, $ as CheckboxItemRenderProps, a0 as DataListChildrenState, a1 as DeepSearchConfig, a2 as DisplayGroupNode, a3 as DisplayNode, a4 as DisplayRadioGroupNode, a5 as DisplayRowNode, a6 as DisplaySeparatorNode, a7 as DisplaySubpageNode, h as GetResolvedIdFn, a8 as GroupBehavior, a9 as GroupDef, aa as GroupLabelRenderParams, ab as GroupRenderContext, ac as GroupRenderParams, ad as IncludeInDeepSearch, ae as InitialQueryBehavior, af as ItemDef, ag as ItemRenderParams, ah as ItemRenderProps, ai as LoaderComponentProps, N as NodeDef, m as PopupMenuCheckboxItem, y as PopupMenuCheckboxItemProps, z as PopupMenuCheckboxItemState, P as PopupMenuHighlightChangeHandler, j as PopupMenuIdScope, q as PopupMenuItem, A as PopupMenuItemProps, B as PopupMenuItemState, r as PopupMenuNode, u as PopupMenuRadioGroup, D as PopupMenuRadioGroupProps, E as PopupMenuRadioGroupState, v as PopupMenuRadioItem, F as PopupMenuRadioItemProps, H as PopupMenuRadioItemState, w as PopupMenuSubmenuTrigger, I as PopupMenuSubmenuTriggerProps, J as PopupMenuSubmenuTriggerState, x as PopupMenuSubpageTrigger, K as PopupMenuSubpageTriggerProps, L as PopupMenuSubpageTriggerState, aj as QueryAsyncNodesConfig, ak as QueryLoaderConfig, al as RadioGroupBehavior, am as RadioGroupDef, an as RadioGroupLabelRenderParams, ao as RadioGroupRenderParams, ap as RadioGroupRenderProps, aq as RadioItemDef, ar as RadioItemRenderParams, as as RadioItemRenderProps, at as RowRenderContext, au as ScoredNode, av as SeparatorDef, aw as SeparatorRenderParams, ax as StaticAsyncNodesConfig, ay as StaticLoaderConfig, az as SubmenuDef, aA as SubmenuRenderParams, aB as SubmenuRenderProps, aC as SubpageContentRenderParams, aD as SubpageDef, aE as SubpageTriggerRenderParams, aF as SubpageTriggerRenderProps, aG as TreeItemDef, aH as TreeItemRenderParams, aI as TreeItemRenderProps, aJ as UnresolvedMenuNode, aK as defineRadioGroup, aL as isDisplayGroupNode, aM as isDisplayRadioGroupNode, aN as isDisplayRowNode, aO as isDisplaySeparatorNode } from '../../events-DPsuhBln.cjs';
13
+ export { B as AsyncMenuCoordinatorValue, E as DataListContext, K as DataPopupContext, F as DataSurfaceContext, D as DataSurfaceContextValue, P as PopupMenuCheckboxItemIndicator, l as PopupMenuCheckboxItemIndicatorProps, m as PopupMenuCheckboxItemIndicatorState, a as PopupMenuFocusZone, n as PopupMenuFocusZoneProps, o as PopupMenuFocusZoneState, b as PopupMenuFooter, p as PopupMenuFooterProps, q as PopupMenuFooterState, c as PopupMenuHeader, r as PopupMenuHeaderProps, s as PopupMenuHeaderState, d as PopupMenuRadioGroupValue, C as PopupMenuRadioGroupValueProps, e as PopupMenuShortcut, t as PopupMenuShortcutProps, v as PopupMenuShortcutState, f as PopupMenuSubpage, g as PopupMenuSubpageBack, h as PopupMenuSubpageBackItem, w as PopupMenuSubpageBackItemProps, x as PopupMenuSubpageBackItemState, y as PopupMenuSubpageBackProps, z as PopupMenuSubpageBackState, A as PopupMenuSubpageProps, R as RenderNodeFn, G as defaultGetResolvedId, H as isPopupMenuNode, u as useAsyncMenuCoordinator, i as useDataList, I as useDataSurfaceContext, j as useMaybeAsyncMenuCoordinator, k as useMaybeDataList, J as useMaybeDataSurfaceContext } from '../../resolve-Dk_fAKb2.cjs';
14
+ import '@base-ui/utils/store';
15
+ import '@base-ui/react/popover';
16
+ import '../../types-DT4FOOa2.cjs';
17
+ import '../../use-listbox-item-NzZuY34-.cjs';
18
+
19
+ declare function useFocusOwner(): FocusOwnerStore;
20
+
21
+ declare function useOpenChain(): OpenChainStore;
22
+
23
+ /**
24
+ * Context for passing surfaceId from Popup to Surface.
25
+ * This ensures Popup and Surface share the same ID for data attribute tracking.
26
+ *
27
+ * For root menus, Popup generates the ID and provides it via this context.
28
+ * For submenus, the ID comes from SubmenuContext.childSurfaceId instead.
29
+ */
30
+ declare const PopupSurfaceIdContext: React.Context<string | null>;
31
+
32
+ interface UseSubpageStackStateParams {
33
+ /** Surface ID of the root surface (the popup's own surface). */
34
+ surfaceId: string;
35
+ /** Listbox store; used to chain onPopupCloseComplete reset. Null-safe. */
36
+ store: ListboxStore | null;
37
+ }
38
+ interface UseSubpageStackStateReturn {
39
+ /** Context value provided to SubpageStackContext consumers. */
40
+ subpageStackContextValue: SubpageStackContextValue;
41
+ /** Whether subpage navigation is in its transient animation window. */
42
+ isSubpageNavigating: boolean;
43
+ /** Whether any subpage is currently open. */
44
+ hasOpenSubpage: boolean;
45
+ /** Active subpage ID, or null when the root surface is active. */
46
+ subpageId: string | null;
47
+ /** Ordered stack of open subpage IDs. */
48
+ openSubpageIds: string[];
49
+ }
50
+ /**
51
+ * Centralized subpage stack state for popup menu surfaces.
52
+ */
53
+ declare function useSubpageStackState(params: UseSubpageStackStateParams): UseSubpageStackStateReturn;
54
+
55
+ declare enum PopupMenuPopupDataAttributes {
56
+ /**
57
+ * Identifies the component part.
58
+ * @type {'bazzaui-dropdown-menu-popup' | 'bazzaui-context-menu-popup' | 'bazzaui-select-popup' | 'bazzaui-combobox-popup'}
59
+ */
60
+ slot = "bazzaui-[component]-popup",
61
+ /**
62
+ * Present when the popup menu is open.
63
+ */
64
+ open = "data-open",
65
+ /**
66
+ * Present when the popup menu is closed.
67
+ */
68
+ closed = "data-closed",
69
+ /**
70
+ * Indicates which side the popup is positioned relative to the trigger.
71
+ * @type {'top' | 'bottom' | 'left' | 'right'}
72
+ */
73
+ side = "data-side",
74
+ /**
75
+ * Indicates how the popup is aligned relative to specified side.
76
+ * @type {'start' | 'center' | 'end'}
77
+ */
78
+ align = "data-align",
79
+ /**
80
+ * Present when the popup is animating in.
81
+ */
82
+ startingStyle = "data-starting-style",
83
+ /**
84
+ * Present when the popup is animating out.
85
+ */
86
+ endingStyle = "data-ending-style",
87
+ /**
88
+ * Present if animations should be instant.
89
+ * @type {'click' | 'dismiss'}
90
+ */
91
+ instant = "data-instant",
92
+ /**
93
+ * Present when this popup's surface is the focus owner.
94
+ * Useful for styling the currently focused menu in a submenu chain.
95
+ */
96
+ focused = "data-focused",
97
+ /**
98
+ * Present when this popup has an open submenu below it in the menu tree.
99
+ * Useful for styling all parent menus in an open submenu chain.
100
+ */
101
+ hasOpenSubmenu = "data-has-open-submenu",
102
+ /**
103
+ * Present when this popup is a submenu (not the root menu).
104
+ * Useful for applying different styles to submenus vs root menus.
105
+ */
106
+ submenu = "data-submenu",
107
+ /**
108
+ * Present while navigating between subpages in this popup.
109
+ * Useful for temporary transition adjustments during subpage focus handoff.
110
+ */
111
+ navigating = "data-navigating"
112
+ }
113
+
114
+ /**
115
+ * Component name used for generating bazzaui-* slot attributes.
116
+ * E.g., 'dropdown-menu', 'context-menu', 'select', 'combobox', 'command-menu'
117
+ */
118
+ type ComponentName = 'dropdown-menu' | 'context-menu' | 'select' | 'combobox' | 'command-menu';
119
+
120
+ interface PopupMenuProvidersProps {
121
+ /** Created by `usePopupMenuRoot`, one per menu root. */
122
+ menuTreeResolver: MenuTreeResolver;
123
+ /** The Listbox store instance */
124
+ store: ListboxStore;
125
+ /** The FocusOwner store instance */
126
+ focusOwnerStore: FocusOwnerStore;
127
+ /** The OpenChain store instance */
128
+ openChainStore: OpenChainStore;
129
+ /** Whether this menu tree currently ignores user interaction */
130
+ disabled: boolean;
131
+ /** Nesting depth: 0 = root menu */
132
+ depth: number;
133
+ /** Close the entire menu tree */
134
+ closeAll: () => void;
135
+ /**
136
+ * Internal: when true, Surface handles Tab explicitly (close the tree, or
137
+ * cycle through focus zones). Enabled only by DropdownMenu.Root and
138
+ * ContextMenu.Root — never Select or Combobox.
139
+ */
140
+ explicitTabBehavior?: boolean;
141
+ /**
142
+ * Internal: what Tab does under `explicitTabBehavior` when the surface (and
143
+ * its ancestors) have no focus-zone tabbables. `'close'` closes the whole
144
+ * tree (dropdown/context-menu). `'inert'` swallows the event, keeping focus
145
+ * where it is (command palette).
146
+ */
147
+ tabWithoutZones?: 'close' | 'inert';
148
+ /** Register a surface for closeAll tracking */
149
+ registerSurface: (depth: number, setOpen: (open: boolean) => void) => () => void;
150
+ /** Virtualization configuration */
151
+ virtualization?: VirtualizationConfig;
152
+ /** Debug visualization flags. */
153
+ debug?: PopupMenuDebugOptions;
154
+ /**
155
+ * Virtual anchor for positioning (used by ContextMenu).
156
+ * DropdownMenu uses Popover's anchor (trigger button) instead.
157
+ */
158
+ virtualAnchor?: VirtualAnchor;
159
+ /**
160
+ * Type of menu for positioning logic.
161
+ * @default 'dropdown'
162
+ */
163
+ menuType?: 'dropdown' | 'context';
164
+ /**
165
+ * When to close the menu on outside interactions.
166
+ * @default 'pointerdown'
167
+ */
168
+ closeOnOutsidePress?: 'click' | 'pointerdown';
169
+ /**
170
+ * Component name for generating bazzaui-* slot attributes.
171
+ * E.g., 'dropdown-menu', 'context-menu', 'select', 'combobox'
172
+ */
173
+ componentName: ComponentName;
174
+ children: React.ReactNode;
175
+ }
176
+ /**
177
+ * Provides all shared context providers for popup menus.
178
+ * Wraps children with:
179
+ * - PopupMenuDebugContext (debug visualization flags)
180
+ * - PopupMenuContext (menu-specific state)
181
+ * - ListboxContextProvider (for compatibility with listbox components)
182
+ * - AimGuardProvider (for submenu aim detection)
183
+ * - FocusOwnerContext (for focus tracking across submenus)
184
+ * - OpenChainContext (for tracking open submenu chain)
185
+ */
186
+ declare function PopupMenuProviders(props: PopupMenuProvidersProps): react_jsx_runtime.JSX.Element;
187
+
188
+ interface UsePopupMenuKeyboardParams {
189
+ /** The Listbox store instance */
190
+ store: ListboxStore;
191
+ /** Unique identifier for this surface */
192
+ surfaceId: string;
193
+ /** The FocusOwner store for managing focus ownership */
194
+ focusOwnerStore: FocusOwnerStore;
195
+ /** Menu depth (0 for root, >0 for submenus) */
196
+ depth: number;
197
+ /** Submenu context for ArrowLeft navigation back to parent */
198
+ submenuContext: SubmenuContextValue | null;
199
+ /** Subpage context for back-stack navigation */
200
+ subpageContext?: SubpageContextValue | null;
201
+ /** Whether keyboard handling is enabled */
202
+ enabled: boolean;
203
+ /** Whether the menu currently ignores user interaction. */
204
+ disabled?: boolean;
205
+ /**
206
+ * Whether to enable type-to-search behavior.
207
+ * When true, printable characters will activate the input and set pending search.
208
+ * Used by List when hideUntilActive is enabled and input is not yet active.
209
+ * @default false
210
+ */
211
+ enableTypeToSearch?: boolean;
212
+ /** User's onKeyDown handler to compose with */
213
+ onKeyDown?: React.KeyboardEventHandler;
214
+ /**
215
+ * Callback to close the entire menu tree from the root.
216
+ * Used when Escape is pressed and closeRootOnEsc is true (default).
217
+ */
218
+ closeAll: () => void;
219
+ /**
220
+ * Whether to skip the focus owner check.
221
+ * When true, keyboard handling will work based on `enabled` prop alone,
222
+ * ignoring focus ownership. Useful for Combobox where the input is outside
223
+ * the Surface but should still handle keyboard navigation.
224
+ * @default false
225
+ */
226
+ skipFocusOwnerCheck?: boolean;
227
+ }
228
+ interface UsePopupMenuKeyboardReturn {
229
+ /** Keyboard event handler to attach to the element */
230
+ handleKeyDown: React.KeyboardEventHandler;
231
+ }
232
+ /**
233
+ * Centralized keyboard navigation hook for popup menus.
234
+ * Handles arrow navigation, vim bindings, submenu open/close, and selection.
235
+ */
236
+ declare function usePopupMenuKeyboard(params: UsePopupMenuKeyboardParams): UsePopupMenuKeyboardReturn;
237
+
238
+ export { FocusOwnerStore, MenuTreeResolver, PopupMenuDebugOptions, PopupMenuPopupDataAttributes, PopupMenuProviders, PopupSurfaceIdContext, SubmenuContextValue, SubpageContextValue, SubpageStackContextValue, VirtualAnchor, VirtualizationConfig, useFocusOwner, useOpenChain, usePopupMenuKeyboard, useSubpageStackState };
@@ -0,0 +1,238 @@
1
+ import { F as FocusOwnerStore, O as OpenChainStore, M as MenuTreeResolver, V as VirtualizationConfig, P as PopupMenuDebugOptions, v as VirtualAnchor } from '../../scroll-arrow-CNd0tgME.js';
2
+ export { b as PopupMenuArrow, h as PopupMenuArrowProps, c as PopupMenuBackdrop, i as PopupMenuBackdropProps, w as PopupMenuContext, r as PopupMenuContextValue, p as PopupMenuListCssVars, d as PopupMenuPopup, j as PopupMenuPopupProps, t as PopupMenuPopupState, e as PopupMenuPortal, k as PopupMenuPortalProps, q as PopupMenuPositionerCssVars, a as PopupMenuRootActions, l as PopupMenuScrollArrowProps, m as PopupMenuScrollArrowState, f as PopupMenuScrollDownArrow, n as PopupMenuScrollDownArrowProps, g as PopupMenuScrollUpArrow, o as PopupMenuScrollUpArrowProps, U as UsePopupMenuRootParams, u as useMaybePopupMenuContext, s as usePopupMenuContext, x as usePopupMenuRoot } from '../../scroll-arrow-CNd0tgME.js';
3
+ import * as React from 'react';
4
+ import { p as SubpageStackContextValue, S as SubmenuContextValue, o as SubpageContextValue } from '../../type-guards-ybcHBB3C.js';
5
+ export { P as PopupMenuGroupValue, a as PopupMenuPositioner, h as PopupMenuPositionerAlign, i as PopupMenuPositionerProps, b as PopupMenuRadioItemIndicator, j as PopupMenuRadioItemIndicatorProps, k as PopupMenuRadioItemIndicatorState, c as PopupMenuSubmenuRoot, l as PopupMenuSubmenuRootProps, d as PopupMenuSubmenuTriggerIndicator, m as PopupMenuSubmenuTriggerIndicatorProps, n as PopupMenuSubmenuTriggerIndicatorState, e as PopupMenuTree, f as PopupMenuTreeConnector, g as PopupMenuTreeItem, z as SubpageStackContext, U as UsePopupMenuItemParams, w as UsePopupMenuItemReturn, y as isTreeItemDef, u as useMaybeSubmenuContext, q as useMaybeSubpageContext, r as useMaybeSubpageStack, x as usePopupMenuItem, s as useSubmenuContext, t as useSubpageContext, v as useSubpageStack } from '../../type-guards-ybcHBB3C.js';
6
+ import { b as ListboxStore } from '../../ListboxStore-BYBpGrOz.js';
7
+ export { V as VirtualItem } from '../../ListboxStore-BYBpGrOz.js';
8
+ import * as react_jsx_runtime from 'react/jsx-runtime';
9
+ export { P as PopupMenuEmpty, g as PopupMenuEmptyProps, h as PopupMenuEmptyState, a as PopupMenuGroup, b as PopupMenuGroupLabel, i as PopupMenuGroupLabelProps, j as PopupMenuGroupLabelState, k as PopupMenuGroupProps, l as PopupMenuGroupState, c as PopupMenuIcon, m as PopupMenuIconProps, n as PopupMenuIconState, d as PopupMenuList, o as PopupMenuListChildrenState, p as PopupMenuListProps, q as PopupMenuListState, e as PopupMenuSeparator, r as PopupMenuSeparatorProps, s as PopupMenuSeparatorState, f as PopupMenuSurface, t as PopupMenuSurfaceProps, u as PopupMenuSurfaceState } from '../../separator-De8l8DKO.js';
10
+ export { P as PopupMenuInput, a as PopupMenuInputProps, b as PopupMenuInputState } from '../../input-CYweYB_i.js';
11
+ export { P as PopupMenuLoading, a as PopupMenuLoadingProps, b as PopupMenuLoadingState } from '../../loading-CC4n55sR.js';
12
+ export { M as AsyncLoaderConfig, O as AsyncLoaderFetchStatus, Q as AsyncLoaderLoadingPhase, R as AsyncLoaderResult, S as AsyncLoaderSource, T as AsyncLoaderStatus, U as AsyncNodesConfig, V as AsyncRenderState, W as AsyncResultBehavior, X as AsyncState, Y as BreadcrumbNode, Z as CheckboxItemDef, _ as CheckboxItemRenderParams, $ as CheckboxItemRenderProps, a0 as DataListChildrenState, a1 as DeepSearchConfig, a2 as DisplayGroupNode, a3 as DisplayNode, a4 as DisplayRadioGroupNode, a5 as DisplayRowNode, a6 as DisplaySeparatorNode, a7 as DisplaySubpageNode, h as GetResolvedIdFn, a8 as GroupBehavior, a9 as GroupDef, aa as GroupLabelRenderParams, ab as GroupRenderContext, ac as GroupRenderParams, ad as IncludeInDeepSearch, ae as InitialQueryBehavior, af as ItemDef, ag as ItemRenderParams, ah as ItemRenderProps, ai as LoaderComponentProps, N as NodeDef, m as PopupMenuCheckboxItem, y as PopupMenuCheckboxItemProps, z as PopupMenuCheckboxItemState, P as PopupMenuHighlightChangeHandler, j as PopupMenuIdScope, q as PopupMenuItem, A as PopupMenuItemProps, B as PopupMenuItemState, r as PopupMenuNode, u as PopupMenuRadioGroup, D as PopupMenuRadioGroupProps, E as PopupMenuRadioGroupState, v as PopupMenuRadioItem, F as PopupMenuRadioItemProps, H as PopupMenuRadioItemState, w as PopupMenuSubmenuTrigger, I as PopupMenuSubmenuTriggerProps, J as PopupMenuSubmenuTriggerState, x as PopupMenuSubpageTrigger, K as PopupMenuSubpageTriggerProps, L as PopupMenuSubpageTriggerState, aj as QueryAsyncNodesConfig, ak as QueryLoaderConfig, al as RadioGroupBehavior, am as RadioGroupDef, an as RadioGroupLabelRenderParams, ao as RadioGroupRenderParams, ap as RadioGroupRenderProps, aq as RadioItemDef, ar as RadioItemRenderParams, as as RadioItemRenderProps, at as RowRenderContext, au as ScoredNode, av as SeparatorDef, aw as SeparatorRenderParams, ax as StaticAsyncNodesConfig, ay as StaticLoaderConfig, az as SubmenuDef, aA as SubmenuRenderParams, aB as SubmenuRenderProps, aC as SubpageContentRenderParams, aD as SubpageDef, aE as SubpageTriggerRenderParams, aF as SubpageTriggerRenderProps, aG as TreeItemDef, aH as TreeItemRenderParams, aI as TreeItemRenderProps, aJ as UnresolvedMenuNode, aK as defineRadioGroup, aL as isDisplayGroupNode, aM as isDisplayRadioGroupNode, aN as isDisplayRowNode, aO as isDisplaySeparatorNode } from '../../events-DOGItflK.js';
13
+ export { B as AsyncMenuCoordinatorValue, E as DataListContext, K as DataPopupContext, F as DataSurfaceContext, D as DataSurfaceContextValue, P as PopupMenuCheckboxItemIndicator, l as PopupMenuCheckboxItemIndicatorProps, m as PopupMenuCheckboxItemIndicatorState, a as PopupMenuFocusZone, n as PopupMenuFocusZoneProps, o as PopupMenuFocusZoneState, b as PopupMenuFooter, p as PopupMenuFooterProps, q as PopupMenuFooterState, c as PopupMenuHeader, r as PopupMenuHeaderProps, s as PopupMenuHeaderState, d as PopupMenuRadioGroupValue, C as PopupMenuRadioGroupValueProps, e as PopupMenuShortcut, t as PopupMenuShortcutProps, v as PopupMenuShortcutState, f as PopupMenuSubpage, g as PopupMenuSubpageBack, h as PopupMenuSubpageBackItem, w as PopupMenuSubpageBackItemProps, x as PopupMenuSubpageBackItemState, y as PopupMenuSubpageBackProps, z as PopupMenuSubpageBackState, A as PopupMenuSubpageProps, R as RenderNodeFn, G as defaultGetResolvedId, H as isPopupMenuNode, u as useAsyncMenuCoordinator, i as useDataList, I as useDataSurfaceContext, j as useMaybeAsyncMenuCoordinator, k as useMaybeDataList, J as useMaybeDataSurfaceContext } from '../../resolve-BYm41YfG.js';
14
+ import '@base-ui/utils/store';
15
+ import '@base-ui/react/popover';
16
+ import '../../types-DT4FOOa2.js';
17
+ import '../../use-listbox-item-NzZuY34-.js';
18
+
19
+ declare function useFocusOwner(): FocusOwnerStore;
20
+
21
+ declare function useOpenChain(): OpenChainStore;
22
+
23
+ /**
24
+ * Context for passing surfaceId from Popup to Surface.
25
+ * This ensures Popup and Surface share the same ID for data attribute tracking.
26
+ *
27
+ * For root menus, Popup generates the ID and provides it via this context.
28
+ * For submenus, the ID comes from SubmenuContext.childSurfaceId instead.
29
+ */
30
+ declare const PopupSurfaceIdContext: React.Context<string | null>;
31
+
32
+ interface UseSubpageStackStateParams {
33
+ /** Surface ID of the root surface (the popup's own surface). */
34
+ surfaceId: string;
35
+ /** Listbox store; used to chain onPopupCloseComplete reset. Null-safe. */
36
+ store: ListboxStore | null;
37
+ }
38
+ interface UseSubpageStackStateReturn {
39
+ /** Context value provided to SubpageStackContext consumers. */
40
+ subpageStackContextValue: SubpageStackContextValue;
41
+ /** Whether subpage navigation is in its transient animation window. */
42
+ isSubpageNavigating: boolean;
43
+ /** Whether any subpage is currently open. */
44
+ hasOpenSubpage: boolean;
45
+ /** Active subpage ID, or null when the root surface is active. */
46
+ subpageId: string | null;
47
+ /** Ordered stack of open subpage IDs. */
48
+ openSubpageIds: string[];
49
+ }
50
+ /**
51
+ * Centralized subpage stack state for popup menu surfaces.
52
+ */
53
+ declare function useSubpageStackState(params: UseSubpageStackStateParams): UseSubpageStackStateReturn;
54
+
55
+ declare enum PopupMenuPopupDataAttributes {
56
+ /**
57
+ * Identifies the component part.
58
+ * @type {'bazzaui-dropdown-menu-popup' | 'bazzaui-context-menu-popup' | 'bazzaui-select-popup' | 'bazzaui-combobox-popup'}
59
+ */
60
+ slot = "bazzaui-[component]-popup",
61
+ /**
62
+ * Present when the popup menu is open.
63
+ */
64
+ open = "data-open",
65
+ /**
66
+ * Present when the popup menu is closed.
67
+ */
68
+ closed = "data-closed",
69
+ /**
70
+ * Indicates which side the popup is positioned relative to the trigger.
71
+ * @type {'top' | 'bottom' | 'left' | 'right'}
72
+ */
73
+ side = "data-side",
74
+ /**
75
+ * Indicates how the popup is aligned relative to specified side.
76
+ * @type {'start' | 'center' | 'end'}
77
+ */
78
+ align = "data-align",
79
+ /**
80
+ * Present when the popup is animating in.
81
+ */
82
+ startingStyle = "data-starting-style",
83
+ /**
84
+ * Present when the popup is animating out.
85
+ */
86
+ endingStyle = "data-ending-style",
87
+ /**
88
+ * Present if animations should be instant.
89
+ * @type {'click' | 'dismiss'}
90
+ */
91
+ instant = "data-instant",
92
+ /**
93
+ * Present when this popup's surface is the focus owner.
94
+ * Useful for styling the currently focused menu in a submenu chain.
95
+ */
96
+ focused = "data-focused",
97
+ /**
98
+ * Present when this popup has an open submenu below it in the menu tree.
99
+ * Useful for styling all parent menus in an open submenu chain.
100
+ */
101
+ hasOpenSubmenu = "data-has-open-submenu",
102
+ /**
103
+ * Present when this popup is a submenu (not the root menu).
104
+ * Useful for applying different styles to submenus vs root menus.
105
+ */
106
+ submenu = "data-submenu",
107
+ /**
108
+ * Present while navigating between subpages in this popup.
109
+ * Useful for temporary transition adjustments during subpage focus handoff.
110
+ */
111
+ navigating = "data-navigating"
112
+ }
113
+
114
+ /**
115
+ * Component name used for generating bazzaui-* slot attributes.
116
+ * E.g., 'dropdown-menu', 'context-menu', 'select', 'combobox', 'command-menu'
117
+ */
118
+ type ComponentName = 'dropdown-menu' | 'context-menu' | 'select' | 'combobox' | 'command-menu';
119
+
120
+ interface PopupMenuProvidersProps {
121
+ /** Created by `usePopupMenuRoot`, one per menu root. */
122
+ menuTreeResolver: MenuTreeResolver;
123
+ /** The Listbox store instance */
124
+ store: ListboxStore;
125
+ /** The FocusOwner store instance */
126
+ focusOwnerStore: FocusOwnerStore;
127
+ /** The OpenChain store instance */
128
+ openChainStore: OpenChainStore;
129
+ /** Whether this menu tree currently ignores user interaction */
130
+ disabled: boolean;
131
+ /** Nesting depth: 0 = root menu */
132
+ depth: number;
133
+ /** Close the entire menu tree */
134
+ closeAll: () => void;
135
+ /**
136
+ * Internal: when true, Surface handles Tab explicitly (close the tree, or
137
+ * cycle through focus zones). Enabled only by DropdownMenu.Root and
138
+ * ContextMenu.Root — never Select or Combobox.
139
+ */
140
+ explicitTabBehavior?: boolean;
141
+ /**
142
+ * Internal: what Tab does under `explicitTabBehavior` when the surface (and
143
+ * its ancestors) have no focus-zone tabbables. `'close'` closes the whole
144
+ * tree (dropdown/context-menu). `'inert'` swallows the event, keeping focus
145
+ * where it is (command palette).
146
+ */
147
+ tabWithoutZones?: 'close' | 'inert';
148
+ /** Register a surface for closeAll tracking */
149
+ registerSurface: (depth: number, setOpen: (open: boolean) => void) => () => void;
150
+ /** Virtualization configuration */
151
+ virtualization?: VirtualizationConfig;
152
+ /** Debug visualization flags. */
153
+ debug?: PopupMenuDebugOptions;
154
+ /**
155
+ * Virtual anchor for positioning (used by ContextMenu).
156
+ * DropdownMenu uses Popover's anchor (trigger button) instead.
157
+ */
158
+ virtualAnchor?: VirtualAnchor;
159
+ /**
160
+ * Type of menu for positioning logic.
161
+ * @default 'dropdown'
162
+ */
163
+ menuType?: 'dropdown' | 'context';
164
+ /**
165
+ * When to close the menu on outside interactions.
166
+ * @default 'pointerdown'
167
+ */
168
+ closeOnOutsidePress?: 'click' | 'pointerdown';
169
+ /**
170
+ * Component name for generating bazzaui-* slot attributes.
171
+ * E.g., 'dropdown-menu', 'context-menu', 'select', 'combobox'
172
+ */
173
+ componentName: ComponentName;
174
+ children: React.ReactNode;
175
+ }
176
+ /**
177
+ * Provides all shared context providers for popup menus.
178
+ * Wraps children with:
179
+ * - PopupMenuDebugContext (debug visualization flags)
180
+ * - PopupMenuContext (menu-specific state)
181
+ * - ListboxContextProvider (for compatibility with listbox components)
182
+ * - AimGuardProvider (for submenu aim detection)
183
+ * - FocusOwnerContext (for focus tracking across submenus)
184
+ * - OpenChainContext (for tracking open submenu chain)
185
+ */
186
+ declare function PopupMenuProviders(props: PopupMenuProvidersProps): react_jsx_runtime.JSX.Element;
187
+
188
+ interface UsePopupMenuKeyboardParams {
189
+ /** The Listbox store instance */
190
+ store: ListboxStore;
191
+ /** Unique identifier for this surface */
192
+ surfaceId: string;
193
+ /** The FocusOwner store for managing focus ownership */
194
+ focusOwnerStore: FocusOwnerStore;
195
+ /** Menu depth (0 for root, >0 for submenus) */
196
+ depth: number;
197
+ /** Submenu context for ArrowLeft navigation back to parent */
198
+ submenuContext: SubmenuContextValue | null;
199
+ /** Subpage context for back-stack navigation */
200
+ subpageContext?: SubpageContextValue | null;
201
+ /** Whether keyboard handling is enabled */
202
+ enabled: boolean;
203
+ /** Whether the menu currently ignores user interaction. */
204
+ disabled?: boolean;
205
+ /**
206
+ * Whether to enable type-to-search behavior.
207
+ * When true, printable characters will activate the input and set pending search.
208
+ * Used by List when hideUntilActive is enabled and input is not yet active.
209
+ * @default false
210
+ */
211
+ enableTypeToSearch?: boolean;
212
+ /** User's onKeyDown handler to compose with */
213
+ onKeyDown?: React.KeyboardEventHandler;
214
+ /**
215
+ * Callback to close the entire menu tree from the root.
216
+ * Used when Escape is pressed and closeRootOnEsc is true (default).
217
+ */
218
+ closeAll: () => void;
219
+ /**
220
+ * Whether to skip the focus owner check.
221
+ * When true, keyboard handling will work based on `enabled` prop alone,
222
+ * ignoring focus ownership. Useful for Combobox where the input is outside
223
+ * the Surface but should still handle keyboard navigation.
224
+ * @default false
225
+ */
226
+ skipFocusOwnerCheck?: boolean;
227
+ }
228
+ interface UsePopupMenuKeyboardReturn {
229
+ /** Keyboard event handler to attach to the element */
230
+ handleKeyDown: React.KeyboardEventHandler;
231
+ }
232
+ /**
233
+ * Centralized keyboard navigation hook for popup menus.
234
+ * Handles arrow navigation, vim bindings, submenu open/close, and selection.
235
+ */
236
+ declare function usePopupMenuKeyboard(params: UsePopupMenuKeyboardParams): UsePopupMenuKeyboardReturn;
237
+
238
+ export { FocusOwnerStore, MenuTreeResolver, PopupMenuDebugOptions, PopupMenuPopupDataAttributes, PopupMenuProviders, PopupSurfaceIdContext, SubmenuContextValue, SubpageContextValue, SubpageStackContextValue, VirtualAnchor, VirtualizationConfig, useFocusOwner, useOpenChain, usePopupMenuKeyboard, useSubpageStackState };
@@ -0,0 +1,2 @@
1
+ import{$ as U,A as x,Aa as ta,B as y,Ba as ua,C as z,Ca as va,D as A,Da as wa,E as B,F as C,G as D,H as E,J as F,K as G,L as H,M as I,N as J,O as K,P as L,T as M,U as N,V as O,W as P,X as Q,Y as R,Z as S,_ as T,a,aa as V,b,ba as W,c,ca as X,d,da as Y,e,ea as Z,f,fa as _,g,ga as $,h,ha as aa,i,ia as ba,j,ja as ca,k,ka as da,l,la as ea,m,ma as fa,n,na as ga,o,oa as ha,p,pa as ia,q,qa as ja,r,ra as ka,s,sa as la,t,ta as ma,u,ua as na,va as oa,wa as pa,xa as qa,y as v,ya as ra,z as w,za as sa}from"../../chunk-BFOY762U.js";import"../../chunk-A4Z5BY7H.js";import"../../chunk-4C666HHU.js";export{z as DataListContext,w as DataPopupContext,v as DataSurfaceContext,n as FocusOwnerStore,s as PopupMenuArrow,t as PopupMenuBackdrop,$ as PopupMenuCheckboxItem,aa as PopupMenuCheckboxItemIndicator,c as PopupMenuContext,N as PopupMenuEmpty,ga as PopupMenuFocusZone,ha as PopupMenuFooter,ia as PopupMenuGroup,P as PopupMenuGroupLabel,ja as PopupMenuGroupValue,ka as PopupMenuHeader,M as PopupMenuIcon,O as PopupMenuInput,ba as PopupMenuItem,W as PopupMenuList,V as PopupMenuListCssVars,X as PopupMenuLoading,F as PopupMenuPopup,u as PopupMenuPopupDataAttributes,G as PopupMenuPortal,I as PopupMenuPositioner,H as PopupMenuPositionerCssVars,J as PopupMenuProviders,ca as PopupMenuRadioGroup,da as PopupMenuRadioGroupValue,ea as PopupMenuRadioItem,fa as PopupMenuRadioItemIndicator,Z as PopupMenuScrollDownArrow,Y as PopupMenuScrollUpArrow,la as PopupMenuSeparator,ma as PopupMenuShortcut,qa as PopupMenuSubmenuRoot,sa as PopupMenuSubmenuTrigger,ra as PopupMenuSubmenuTriggerIndicator,ta as PopupMenuSubpage,ua as PopupMenuSubpageBack,va as PopupMenuSubpageBackItem,wa as PopupMenuSubpageTrigger,_ as PopupMenuSurface,na as PopupMenuTree,oa as PopupMenuTreeConnector,pa as PopupMenuTreeItem,f as PopupSurfaceIdContext,k as SubpageStackContext,p as defaultGetResolvedId,Q as defineRadioGroup,R as isDisplayGroupNode,S as isDisplayRadioGroupNode,U as isDisplayRowNode,T as isDisplaySeparatorNode,o as isPopupMenuNode,E as isTreeItemDef,C as useAsyncMenuCoordinator,A as useDataList,x as useDataSurfaceContext,a as useFocusOwner,D as useMaybeAsyncMenuCoordinator,B as useMaybeDataList,y as useMaybeDataSurfaceContext,e as useMaybePopupMenuContext,h as useMaybeSubmenuContext,j as useMaybeSubpageContext,m as useMaybeSubpageStack,b as useOpenChain,d as usePopupMenuContext,K as usePopupMenuItem,L as usePopupMenuKeyboard,q as usePopupMenuRoot,g as useSubmenuContext,i as useSubpageContext,l as useSubpageStack,r as useSubpageStackState};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * Type for custom item equality comparison functions.
5
+ * Used to compare object values in Select and Combobox components.
6
+ */
7
+ type ItemEqualityComparer<Value = unknown> = (itemValue: Value, value: Value) => boolean;
8
+
9
+ /**
10
+ * A single entry in the array form of the `items` prop passed to
11
+ * `Select.Root` / `Combobox.Root`.
12
+ */
13
+ interface ItemsEntry {
14
+ /**
15
+ * The item's value.
16
+ *
17
+ * Use `null` to describe a clearable/placeholder item (its label is used as
18
+ * the trigger placeholder and selecting it clears the value).
19
+ */
20
+ value: string | null;
21
+ /** The label to display for this item. */
22
+ label: React.ReactNode;
23
+ /**
24
+ * Additional keywords to match against when filtering, on top of the label.
25
+ * Useful for aliases or synonyms.
26
+ */
27
+ keywords?: string[];
28
+ }
29
+ /**
30
+ * Data structure describing the items rendered in a Select/Combobox popup.
31
+ *
32
+ * Either a record mapping a value to its label, or an array of entries. Only
33
+ * the array form can express `keywords` or a `null` (clearable) value.
34
+ */
35
+ type Items = Record<string, React.ReactNode> | Array<ItemsEntry>;
36
+
37
+ export type { ItemEqualityComparer as I, Items as a };
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * Type for custom item equality comparison functions.
5
+ * Used to compare object values in Select and Combobox components.
6
+ */
7
+ type ItemEqualityComparer<Value = unknown> = (itemValue: Value, value: Value) => boolean;
8
+
9
+ /**
10
+ * A single entry in the array form of the `items` prop passed to
11
+ * `Select.Root` / `Combobox.Root`.
12
+ */
13
+ interface ItemsEntry {
14
+ /**
15
+ * The item's value.
16
+ *
17
+ * Use `null` to describe a clearable/placeholder item (its label is used as
18
+ * the trigger placeholder and selecting it clears the value).
19
+ */
20
+ value: string | null;
21
+ /** The label to display for this item. */
22
+ label: React.ReactNode;
23
+ /**
24
+ * Additional keywords to match against when filtering, on top of the label.
25
+ * Useful for aliases or synonyms.
26
+ */
27
+ keywords?: string[];
28
+ }
29
+ /**
30
+ * Data structure describing the items rendered in a Select/Combobox popup.
31
+ *
32
+ * Either a record mapping a value to its label, or an array of entries. Only
33
+ * the array form can express `keywords` or a `null` (clearable) value.
34
+ */
35
+ type Items = Record<string, React.ReactNode> | Array<ItemsEntry>;
36
+
37
+ export type { ItemEqualityComparer as I, Items as a };
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkJFEVUUPCcjs = require('../chunk-JFEVUUPC.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var w={};_chunkM4G6J7DPcjs.a.call(void 0, w,{Key:()=>a,Root:()=>M});var _userender = require('@base-ui/react/use-render');var _react = require('react'); var s = _interopRequireWildcard(_react); var t = _interopRequireWildcard(_react);var a=s.forwardRef(function(d,m){let{label:o,children:c,render:r,className:f,style:i,...l}=d,K=s.useMemo(()=>({}),[]),e=_nullishCoalesce(c, () => (o));return _userender.useRender.call(void 0, {render:r,ref:m,state:K,props:{...l,"data-kbd-key":"",className:f,style:i,children:e},defaultTagName:"kbd"})});var _jsxruntime = require('react/jsx-runtime');var I={platform:p=>({"data-platform":String(p)})},M=t.forwardRef(function(d,m){let{keys:o,platform:c,separator:r="then",render:f,className:i,style:l,...K}=d,e=_chunkJFEVUUPCcjs.e.call(void 0, c),x=t.useMemo(()=>_chunkJFEVUUPCcjs.a.call(void 0, o),[o]),N=t.useMemo(()=>({platform:e}),[e]),L=t.useMemo(()=>{let n=[],g=new Map;for(let $ of x.chords){let P=_chunkJFEVUUPCcjs.c.call(void 0, $,e),b=P.join("+"),h=(_nullishCoalesce(g.get(b), () => (0)))+1;g.set(b,h);let k=`${b}#${h}`;n.length>0&&n.push(_jsxruntime.jsx.call(void 0, "span",{"data-kbd-separator":"",children:r},`${k}-separator`));for(let S of P)n.push(_jsxruntime.jsx.call(void 0, a,{children:S},`${k}-${S}`))}return n},[x,e,r]);return _userender.useRender.call(void 0, {render:f,ref:m,state:N,stateAttributesMapping:I,props:{...K,"data-kbd-root":"",className:i,style:l,children:L},defaultTagName:"span"})});exports.Kbd = w; exports.getChordLabels = _chunkJFEVUUPCcjs.c; exports.getKeyLabel = _chunkJFEVUUPCcjs.b; exports.isApplePlatform = _chunkJFEVUUPCcjs.d; exports.parseKeybinding = _chunkJFEVUUPCcjs.a; exports.usePlatform = _chunkJFEVUUPCcjs.e;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/kianbazza/repos/bazzalabs/ui/packages/react/dist/kbd/index.cjs","../../src/kbd/index.parts.ts","../../src/kbd/key/key.tsx","../../src/kbd/root/root.tsx"],"names":["index_parts_exports","__export","KbdKey","KbdRoot","props","forwardedRef","label","children","render","className","style","rest","state","renderedChildren","useRender","stateAttributesMapping","value","keys","platformProp","separator","platform","usePlatform","keybinding","parseKeybinding","entries","seen","chord","labels","getChordLabels","chordId","occurrence","prefix"],"mappings":"AAAA,wfAAqE,yDAA0C,ICA/GA,CAAAA,CAAA,CAAA,CAAA,CAAAC,iCAAAA,CAAAD,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,EAAAE,CAAAA,CAAA,IAAA,CAAA,CAAA,CAAA,EAAAC,CAAAA,CAAAA,CAAAA,CCEA,sDAA0B,gHACH,IAUVD,CAAAA,CAAe,CAAA,CAAA,UAAA,CAC1B,QAAA,CAAgBE,CAAAA,CAAOC,CAAAA,CAAc,CACnC,GAAM,CAAE,KAAA,CAAAC,CAAAA,CAAO,QAAA,CAAAC,CAAAA,CAAU,MAAA,CAAAC,CAAAA,CAAQ,SAAA,CAAAC,CAAAA,CAAW,KAAA,CAAAC,CAAAA,CAAO,GAAGC,CAAK,CAAA,CAAIP,CAAAA,CAEzDQ,CAAAA,CAA4B,CAAA,CAAA,OAAA,CAAQ,CAAA,CAAA,EAAA,CAAO,CAAC,CAAA,CAAA,CAAI,CAAC,CAAC,CAAA,CAClDC,CAAAA,kBAAmBN,CAAAA,SAAYD,GAAAA,CAErC,OAAOQ,kCAAAA,CACL,MAAA,CAAAN,CAAAA,CACA,GAAA,CAAKH,CAAAA,CACL,KAAA,CAAAO,CAAAA,CACA,KAAA,CAAO,CACL,GAAGD,CAAAA,CACF,cAAA,CAA2B,EAAA,CAC5B,SAAA,CAAAF,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,QAAA,CAAUG,CACZ,CAAA,CACA,cAAA,CAAgB,KAClB,CAAC,CACH,CACF,CAAA,CChCA,+CA4DY,IAvCNE,CAAAA,CAAyB,CAC7B,QAAA,CAAWC,CAAAA,EAAAA,CAAmD,CAC3D,eAAA,CAAiC,MAAA,CAAOA,CAAK,CAChD,CAAA,CACF,CAAA,CAEab,CAAAA,CAAgB,CAAA,CAAA,UAAA,CAC3B,QAAA,CAAiBC,CAAAA,CAAOC,CAAAA,CAAc,CACpC,GAAM,CACJ,IAAA,CAAAY,CAAAA,CACA,QAAA,CAAUC,CAAAA,CACV,SAAA,CAAAC,CAAAA,CAAY,MAAA,CACZ,MAAA,CAAAX,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAAIP,CAAAA,CAEEgB,CAAAA,CAAWC,iCAAAA,CAAwB,CAAA,CACnCC,CAAAA,CAAmB,CAAA,CAAA,OAAA,CAAQ,CAAA,CAAA,EAAMC,iCAAAA,CAAoB,CAAA,CAAG,CAACN,CAAI,CAAC,CAAA,CAE9DL,CAAAA,CAA6B,CAAA,CAAA,OAAA,CAAQ,CAAA,CAAA,EAAA,CAAO,CAAE,QAAA,CAAAQ,CAAS,CAAA,CAAA,CAAI,CAACA,CAAQ,CAAC,CAAA,CAErEP,CAAAA,CAAyB,CAAA,CAAA,OAAA,CAAQ,CAAA,CAAA,EAAM,CAC3C,IAAMW,CAAAA,CAA6B,CAAC,CAAA,CAI9BC,CAAAA,CAAO,IAAI,GAAA,CAEjB,GAAA,CAAA,IAAWC,EAAAA,GAASJ,CAAAA,CAAW,MAAA,CAAQ,CACrC,IAAMK,CAAAA,CAASC,iCAAAA,CAAeF,CAAON,CAAQ,CAAA,CACvCS,CAAAA,CAAUF,CAAAA,CAAO,IAAA,CAAK,GAAG,CAAA,CACzBG,CAAAA,CAAAA,kBAAcL,CAAAA,CAAK,GAAA,CAAII,CAAO,CAAA,SAAK,GAAA,CAAA,CAAK,CAAA,CAC9CJ,CAAAA,CAAK,GAAA,CAAII,CAAAA,CAASC,CAAU,CAAA,CAC5B,IAAMC,CAAAA,CAAS,CAAA,EAAA","file":"/Users/kianbazza/repos/bazzalabs/ui/packages/react/dist/kbd/index.cjs","sourcesContent":[null,"export { KbdKey as Key } from './key/key.js'\nexport { KbdRoot as Root } from './root/root.js'\n","'use client'\n\nimport { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\nimport type { ComponentProps } from '../../utils/types.js'\nimport { KbdKeyDataAttributes } from './key.data-attrs.js'\n\nexport interface KbdKeyState extends Record<string, unknown> {}\n\nexport interface KbdKeyProps extends ComponentProps<'kbd', KbdKey.State> {\n label?: string\n}\n\nexport const KbdKey = React.forwardRef<HTMLElement, KbdKey.Props>(\n function KbdKey(props, forwardedRef) {\n const { label, children, render, className, style, ...rest } = props\n\n const state: KbdKey.State = React.useMemo(() => ({}), [])\n const renderedChildren = children ?? label\n\n return useRender({\n render,\n ref: forwardedRef,\n state,\n props: {\n ...rest,\n [KbdKeyDataAttributes.key]: '',\n className,\n style,\n children: renderedChildren,\n },\n defaultTagName: 'kbd',\n })\n },\n)\n\nexport namespace KbdKey {\n export type State = KbdKeyState\n export interface Props extends KbdKeyProps {}\n}\n","'use client'\n\nimport { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\nimport type { ComponentProps } from '../../utils/types.js'\nimport { KbdKey } from '../key/key.js'\nimport { getChordLabels, parseKeybinding } from '../utils/parse-keybinding.js'\nimport { usePlatform } from '../utils/platform.js'\nimport { KbdRootDataAttributes } from './root.data-attrs.js'\n\ntype Platform = 'apple' | 'other'\n\nexport interface KbdRootState extends Record<string, unknown> {\n platform: Platform\n}\n\nexport interface KbdRootProps\n extends Omit<ComponentProps<'span', KbdRoot.State>, 'children'> {\n keys: string\n platform?: Platform\n separator?: React.ReactNode\n}\n\nconst stateAttributesMapping = {\n platform: (value: unknown): Record<string, string> | null => ({\n [KbdRootDataAttributes.platform]: String(value),\n }),\n}\n\nexport const KbdRoot = React.forwardRef<HTMLSpanElement, KbdRoot.Props>(\n function KbdRoot(props, forwardedRef) {\n const {\n keys,\n platform: platformProp,\n separator = 'then',\n render,\n className,\n style,\n ...rest\n } = props\n\n const platform = usePlatform(platformProp)\n const keybinding = React.useMemo(() => parseKeybinding(keys), [keys])\n\n const state: KbdRoot.State = React.useMemo(() => ({ platform }), [platform])\n\n const renderedChildren = React.useMemo(() => {\n const entries: React.ReactNode[] = []\n // Content-derived keys: chords are fully derived from the `keys` string,\n // so a chord's joined labels (disambiguated by occurrence count for\n // repeated chords like \"g g\") form a stable identity.\n const seen = new Map<string, number>()\n\n for (const chord of keybinding.chords) {\n const labels = getChordLabels(chord, platform)\n const chordId = labels.join('+')\n const occurrence = (seen.get(chordId) ?? 0) + 1\n seen.set(chordId, occurrence)\n const prefix = `${chordId}#${occurrence}`\n\n if (entries.length > 0) {\n entries.push(\n <span key={`${prefix}-separator`} data-kbd-separator=\"\">\n {separator}\n </span>,\n )\n }\n for (const label of labels) {\n entries.push(<KbdKey key={`${prefix}-${label}`}>{label}</KbdKey>)\n }\n }\n\n return entries\n }, [keybinding, platform, separator])\n\n return useRender({\n render,\n ref: forwardedRef,\n state,\n stateAttributesMapping,\n props: {\n ...rest,\n [KbdRootDataAttributes.root]: '',\n className,\n style,\n children: renderedChildren,\n },\n defaultTagName: 'span',\n })\n },\n)\n\nexport namespace KbdRoot {\n export type State = KbdRootState\n export interface Props extends KbdRootProps {}\n}\n"]}