@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
@@ -1,212 +0,0 @@
1
- import * as React from 'react';
2
-
3
- interface GroupPositional {
4
- first?: boolean;
5
- last?: boolean;
6
- firstInGroup?: boolean;
7
- lastInGroup?: boolean;
8
- firstGroup?: boolean;
9
- lastGroup?: boolean;
10
- }
11
- interface GroupContextValue {
12
- groupId?: string;
13
- positional?: GroupPositional;
14
- }
15
- declare const GroupContext: React.Context<GroupContextValue | null>;
16
- declare function useGroupContext(): GroupContextValue | null;
17
-
18
- interface ItemContextValue {
19
- /** Unique ID for this item (for DOM id attribute) */
20
- id: string;
21
- /** Whether the item is highlighted */
22
- highlighted: boolean;
23
- /** Whether the item is disabled */
24
- disabled: boolean;
25
- /** Keyboard shortcut for this item */
26
- shortcut?: string;
27
- }
28
- declare const ItemContext: React.Context<ItemContextValue | null>;
29
- declare function useItemContext(): ItemContextValue;
30
- declare function useMaybeItemContext(): ItemContextValue | null;
31
-
32
- /**
33
- * Aim guard refs for submenu navigation.
34
- * Optional - only needed for popup menus with submenus.
35
- */
36
- interface AimGuardRefs {
37
- /** Whether aim guard is currently active */
38
- aimGuardActiveRef: React.RefObject<boolean>;
39
- /** The depth at which aim guard is active (null when not guarding) */
40
- guardedDepthRef: React.RefObject<number | null>;
41
- }
42
- /**
43
- * Parameters for the useListboxItem hook.
44
- */
45
- interface UseListboxItemParams {
46
- /**
47
- * Explicit unique identifier for this item in the store.
48
- * Takes highest priority for item registration.
49
- * Used by data-first APIs to ensure consistent IDs.
50
- */
51
- id?: string;
52
- /**
53
- * Unique value for this item used as identifier and for filtering.
54
- * If not provided, will be inferred from textContent.
55
- * Used for registration when `id` is not provided.
56
- */
57
- value?: string;
58
- /**
59
- * Additional keywords to match against when filtering.
60
- * Useful for aliases or synonyms.
61
- */
62
- keywords?: string[];
63
- /**
64
- * Whether this item is disabled.
65
- * Disabled items are not selectable and are skipped during keyboard navigation.
66
- */
67
- disabled?: boolean;
68
- /**
69
- * Whether this item can be activated via Enter or click.
70
- * Non-activatable items remain highlightable.
71
- * @default true
72
- */
73
- activatable?: boolean;
74
- /**
75
- * Whether to force render this item regardless of filter results.
76
- * @default false
77
- */
78
- forceMount?: boolean;
79
- /**
80
- * Keyboard shortcut to trigger this item.
81
- * When the menu is focused and the user presses this key, the item will be selected.
82
- * Should be a single character (e.g., "1", "a", etc.).
83
- */
84
- shortcut?: string;
85
- /**
86
- * Forces this row's relative order during score-based sorting.
87
- * Lower values appear earlier.
88
- * @default 0
89
- */
90
- forceOrder?: number;
91
- /**
92
- * Overrides this row's computed fuzzy-match score.
93
- * Useful for pinning or manually ranking rows in score-based views.
94
- */
95
- forceScore?: number;
96
- /**
97
- * Whether this item is a submenu trigger (for store registration).
98
- * @default false
99
- */
100
- isSubmenuTrigger?: boolean;
101
- /**
102
- * Callback when this item is selected (via click or Enter key).
103
- * For simple items, pass this directly. For checkbox/radio items,
104
- * use registerSelect() to register a dynamic handler.
105
- */
106
- onSelect?: () => void;
107
- /**
108
- * Whether selecting this item should close the menu.
109
- * @default true
110
- */
111
- closeOnClick?: boolean;
112
- /**
113
- * Callback invoked after selection occurs (via click).
114
- * Called with the item's ID. The consumer handles any
115
- * post-selection behavior like closing menus.
116
- */
117
- onAfterSelect?: (itemId: string) => void;
118
- /**
119
- * Children (used for text content inference when value is not provided).
120
- */
121
- children?: React.ReactNode;
122
- /**
123
- * Optional aim guard refs for popup menu navigation.
124
- * When provided, pointer move events will respect the aim guard.
125
- */
126
- aimGuard?: AimGuardRefs;
127
- }
128
- /**
129
- * Return value from the useListboxItem hook.
130
- */
131
- interface UseListboxItemReturn {
132
- /** Unique ID for this item (DOM ID for aria-activedescendant) */
133
- id: string;
134
- /**
135
- * Store identifier for this item.
136
- * Use this when calling store methods like setHighlightedId, registerSubmenuOpen, etc.
137
- * This is the `value` prop (or inferred from textContent).
138
- */
139
- storeId: string;
140
- /** Ref to attach to the item element */
141
- ref: React.RefObject<HTMLDivElement | null>;
142
- /** Callback ref that tracks the mounted row element for positional attributes. Merge into the rendered element's ref. */
143
- rowRef: (element: HTMLElement | null) => void;
144
- /** Positional state among visible rows (all false in virtualized mode). */
145
- positional: {
146
- first: boolean;
147
- last: boolean;
148
- firstInGroup: boolean;
149
- lastInGroup: boolean;
150
- };
151
- /** Whether item is currently highlighted */
152
- isHighlighted: boolean;
153
- /** Whether item should be rendered (passes filter) */
154
- isVisible: boolean;
155
- /** Context value to provide to children via ItemContext.Provider */
156
- contextValue: ItemContextValue;
157
- /**
158
- * Event handlers to spread on the element.
159
- * These handle click, pointer move, and pointer down events.
160
- */
161
- handlers: {
162
- onClick: React.MouseEventHandler<HTMLDivElement>;
163
- onPointerMove: React.PointerEventHandler<HTMLDivElement>;
164
- onPointerDown: React.PointerEventHandler<HTMLDivElement>;
165
- };
166
- /**
167
- * Register a custom onSelect handler.
168
- * This is useful for checkbox/radio items where the select behavior
169
- * needs to be customized (e.g., toggle checked state).
170
- * Returns an unregister function.
171
- */
172
- registerSelect: (handler: (() => void) | undefined) => () => void;
173
- }
174
- /**
175
- * Hook that provides all shared logic for navigatable/highlightable listbox items.
176
- *
177
- * This hook handles:
178
- * - Item registration with the listbox store
179
- * - Highlight state management (keyboard and pointer)
180
- * - Filter/search visibility
181
- * - Scroll into view on keyboard navigation
182
- * - Click, pointer move, and pointer down event handlers
183
- * - Optional aim guard integration (for submenu navigation)
184
- *
185
- * @example
186
- * ```tsx
187
- * function CustomItem(props) {
188
- * const item = useListboxItem({
189
- * value: props.value,
190
- * disabled: props.disabled,
191
- * onSelect: props.onSelect,
192
- * })
193
- *
194
- * if (!item.isVisible) return null
195
- *
196
- * return (
197
- * <ItemContext.Provider value={item.contextValue}>
198
- * <div
199
- * ref={item.ref}
200
- * {...item.handlers}
201
- * data-highlighted={item.isHighlighted || undefined}
202
- * >
203
- * {props.children}
204
- * </div>
205
- * </ItemContext.Provider>
206
- * )
207
- * }
208
- * ```
209
- */
210
- declare function useListboxItem(params: UseListboxItemParams): UseListboxItemReturn;
211
-
212
- export { type AimGuardRefs as A, type GroupContextValue as G, type ItemContextValue as I, type UseListboxItemParams as U, useMaybeItemContext as a, type GroupPositional as b, GroupContext as c, useGroupContext as d, ItemContext as e, type UseListboxItemReturn as f, useListboxItem as g, useItemContext as u };