@bazza-ui/react 0.1.0-canary.16 → 0.1.0-canary.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/combobox/index.cjs +1 -1
- package/dist/combobox/index.cjs.map +1 -1
- package/dist/combobox/index.d.ts +842 -834
- package/dist/combobox/index.js +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/command-menu/index.cjs +1 -1
- package/dist/command-menu/index.cjs.map +1 -1
- package/dist/command-menu/index.d.ts +123 -96
- package/dist/command-menu/index.js +1 -1
- package/dist/command-menu/index.js.map +1 -1
- package/dist/context-menu/index.cjs +1 -1
- package/dist/context-menu/index.cjs.map +1 -1
- package/dist/context-menu/index.d.ts +701 -658
- package/dist/context-menu/index.js +1 -1
- package/dist/context-menu/index.js.map +1 -1
- package/dist/dropdown-menu/index.cjs +1 -1
- package/dist/dropdown-menu/index.cjs.map +1 -1
- package/dist/dropdown-menu/index.d.ts +723 -680
- package/dist/dropdown-menu/index.js +1 -1
- package/dist/dropdown-menu/index.js.map +1 -1
- package/dist/events-DDOsDu4X.d.ts +2091 -0
- package/dist/index-Cabqj7qI.d.ts +2003 -0
- package/dist/index-D8OrKThQ.d.ts +977 -0
- package/dist/internal/listbox/index.cjs +1 -2
- package/dist/internal/listbox/index.d.ts +2 -272
- package/dist/internal/listbox/index.js +1 -2
- package/dist/internal/popup-menu/index.cjs +1 -2
- package/dist/internal/popup-menu/index.d.ts +4 -238
- package/dist/internal/popup-menu/index.js +1 -2
- package/dist/items-CD2hw6-3.js +2 -0
- package/dist/items-CD2hw6-3.js.map +1 -0
- package/dist/items-DYDljwnt.cjs +2 -0
- package/dist/items-DYDljwnt.cjs.map +1 -0
- package/dist/{items-B6HeFO_8.d.cts → items-ceX--VIv.d.ts} +21 -19
- package/dist/kbd/index.cjs +1 -1
- package/dist/kbd/index.cjs.map +1 -1
- package/dist/kbd/index.d.ts +35 -35
- package/dist/kbd/index.js +1 -1
- package/dist/kbd/index.js.map +1 -1
- package/dist/listbox-CnwUlLZA.js +2 -0
- package/dist/listbox-CnwUlLZA.js.map +1 -0
- package/dist/listbox-DYvJTiF6.cjs +2 -0
- package/dist/listbox-DYvJTiF6.cjs.map +1 -0
- package/dist/loaders/index.cjs +1 -1
- package/dist/loaders/index.cjs.map +1 -1
- package/dist/loaders/index.d.ts +218 -188
- package/dist/loaders/index.js +1 -1
- package/dist/loaders/index.js.map +1 -1
- package/dist/merge-element-props-0mpNO7ZH.cjs +2 -0
- package/dist/merge-element-props-0mpNO7ZH.cjs.map +1 -0
- package/dist/merge-element-props-PxUvRHax.js +2 -0
- package/dist/merge-element-props-PxUvRHax.js.map +1 -0
- package/dist/platform-C-sxBTRa.cjs +2 -0
- package/dist/platform-C-sxBTRa.cjs.map +1 -0
- package/dist/platform-C4_cGUkS.js +2 -0
- package/dist/platform-C4_cGUkS.js.map +1 -0
- package/dist/popup-menu-BBAzAXIe.cjs +2 -0
- package/dist/popup-menu-BBAzAXIe.cjs.map +1 -0
- package/dist/popup-menu-HmBMJEZc.js +2 -0
- package/dist/popup-menu-HmBMJEZc.js.map +1 -0
- package/dist/resolve-state-props-C-zbhdXd.cjs +2 -0
- package/dist/resolve-state-props-C-zbhdXd.cjs.map +1 -0
- package/dist/resolve-state-props-D31kizRZ.js +2 -0
- package/dist/resolve-state-props-D31kizRZ.js.map +1 -0
- package/dist/rolldown-runtime-5lHFv1cW.cjs +1 -0
- package/dist/rolldown-runtime-DK3Fl9T5.js +1 -0
- package/dist/select/index.cjs +1 -1
- package/dist/select/index.cjs.map +1 -1
- package/dist/select/index.d.ts +835 -828
- package/dist/select/index.js +1 -1
- package/dist/select/index.js.map +1 -1
- package/dist/suggestion-menu/index.cjs +4 -0
- package/dist/suggestion-menu/index.cjs.map +1 -0
- package/dist/suggestion-menu/index.d.ts +359 -0
- package/dist/suggestion-menu/index.js +4 -0
- package/dist/suggestion-menu/index.js.map +1 -0
- package/dist/types-BbN28E3_.d.ts +50 -0
- package/dist/video-player/index.cjs +2 -2
- package/dist/video-player/index.cjs.map +1 -1
- package/dist/video-player/index.d.ts +964 -1000
- package/dist/video-player/index.js +2 -2
- package/dist/video-player/index.js.map +1 -1
- package/package.json +14 -5
- package/dist/ListboxStore-B8oTpM57.d.cts +0 -453
- package/dist/ListboxStore-CV5vPUUc.d.ts +0 -453
- package/dist/chunk-3HMQLMSF.js +0 -2
- package/dist/chunk-3HMQLMSF.js.map +0 -1
- package/dist/chunk-4C666HHU.js +0 -2
- package/dist/chunk-4C666HHU.js.map +0 -1
- package/dist/chunk-5T5B5SPR.cjs +0 -2
- package/dist/chunk-5T5B5SPR.cjs.map +0 -1
- package/dist/chunk-A4Z5BY7H.js +0 -2
- package/dist/chunk-A4Z5BY7H.js.map +0 -1
- package/dist/chunk-IT372NHF.js +0 -2
- package/dist/chunk-IT372NHF.js.map +0 -1
- package/dist/chunk-JFEVUUPC.cjs +0 -2
- package/dist/chunk-JFEVUUPC.cjs.map +0 -1
- package/dist/chunk-KO3DXT3Y.js +0 -2
- package/dist/chunk-KO3DXT3Y.js.map +0 -1
- package/dist/chunk-LXXK4S4Q.js +0 -2
- package/dist/chunk-LXXK4S4Q.js.map +0 -1
- package/dist/chunk-M4G6J7DP.cjs +0 -2
- package/dist/chunk-M4G6J7DP.cjs.map +0 -1
- package/dist/chunk-MPPIEWSL.js +0 -2
- package/dist/chunk-MPPIEWSL.js.map +0 -1
- package/dist/chunk-PCNHYMD6.cjs +0 -2
- package/dist/chunk-PCNHYMD6.cjs.map +0 -1
- package/dist/chunk-RTG6U56O.cjs +0 -2
- package/dist/chunk-RTG6U56O.cjs.map +0 -1
- package/dist/chunk-SCDHQZFI.cjs +0 -2
- package/dist/chunk-SCDHQZFI.cjs.map +0 -1
- package/dist/chunk-XMZZ62VJ.cjs +0 -2
- package/dist/chunk-XMZZ62VJ.cjs.map +0 -1
- package/dist/combobox/index.d.cts +0 -1066
- package/dist/command-menu/index.d.cts +0 -154
- package/dist/command-score-CTJ9NV6n.d.cts +0 -23
- package/dist/command-score-CTJ9NV6n.d.ts +0 -23
- package/dist/context-menu/index.d.cts +0 -696
- package/dist/dropdown-menu/index.d.cts +0 -723
- package/dist/events-BTHQ2OoH.d.ts +0 -1860
- package/dist/events-DVcrtGe3.d.cts +0 -1860
- package/dist/input-C95v6jB0.d.cts +0 -46
- package/dist/input-CYweYB_i.d.ts +0 -46
- package/dist/internal/listbox/index.cjs.map +0 -1
- package/dist/internal/listbox/index.d.cts +0 -272
- package/dist/internal/listbox/index.js.map +0 -1
- package/dist/internal/popup-menu/index.cjs.map +0 -1
- package/dist/internal/popup-menu/index.d.cts +0 -238
- package/dist/internal/popup-menu/index.js.map +0 -1
- package/dist/items-B6HeFO_8.d.ts +0 -37
- package/dist/kbd/index.d.cts +0 -61
- package/dist/loaders/index.d.cts +0 -363
- package/dist/loading-C6WZGUc3.d.cts +0 -29
- package/dist/loading-CC4n55sR.d.ts +0 -29
- package/dist/resolve-B-j0eW24.d.cts +0 -406
- package/dist/resolve-B1F-a3P1.d.ts +0 -406
- package/dist/scroll-arrow-BBoKckL_.d.cts +0 -544
- package/dist/scroll-arrow-fl3B5sVO.d.ts +0 -544
- package/dist/select/index.d.cts +0 -1005
- package/dist/separator-Dn15rte3.d.ts +0 -275
- package/dist/separator-NjsBVzek.d.cts +0 -275
- package/dist/surface-context-CGLDpMej.d.ts +0 -14
- package/dist/surface-context-CN4Lb_6F.d.cts +0 -14
- package/dist/type-guards-BHHzjRvZ.d.cts +0 -351
- package/dist/type-guards-C0e_GpeY.d.ts +0 -351
- package/dist/types-DT4FOOa2.d.cts +0 -51
- package/dist/types-DT4FOOa2.d.ts +0 -51
- package/dist/use-listbox-item-NzZuY34-.d.cts +0 -212
- package/dist/use-listbox-item-NzZuY34-.d.ts +0 -212
- package/dist/video-player/index.d.cts +0 -1391
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { C as ComponentProps } from './types-DT4FOOa2.cjs';
|
|
3
|
-
|
|
4
|
-
interface PopupMenuInputState extends Record<string, unknown> {
|
|
5
|
-
/**
|
|
6
|
-
* Whether the input is active (visible).
|
|
7
|
-
* Only relevant when `hideUntilActive` is true.
|
|
8
|
-
*/
|
|
9
|
-
active: boolean;
|
|
10
|
-
}
|
|
11
|
-
interface PopupMenuInputProps extends Omit<ComponentProps<'input', PopupMenuInput.State>, 'value' | 'onChange' | 'type'> {
|
|
12
|
-
/**
|
|
13
|
-
* Controlled value for the search input.
|
|
14
|
-
* If provided, this takes precedence over the Surface's search state.
|
|
15
|
-
*/
|
|
16
|
-
value?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Callback when the input value changes.
|
|
19
|
-
*/
|
|
20
|
-
onValueChange?: (value: string) => void;
|
|
21
|
-
/**
|
|
22
|
-
* When true, the input is not rendered until the user starts typing.
|
|
23
|
-
* The List receives focus initially, and typing a character activates the input.
|
|
24
|
-
* Once activated, the input stays visible until the menu closes.
|
|
25
|
-
* @default false
|
|
26
|
-
*/
|
|
27
|
-
hideUntilActive?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* When true, Backspace in an empty subpage input navigates back one page.
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
backspaceGoesBack?: boolean;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Search input for filtering popup menu items.
|
|
36
|
-
* Handles keyboard navigation (Arrow keys, Ctrl+N/P, Enter).
|
|
37
|
-
* Renders an `<input>` element.
|
|
38
|
-
*/
|
|
39
|
-
declare const PopupMenuInput: React.ForwardRefExoticComponent<Omit<PopupMenuInput.Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
40
|
-
declare namespace PopupMenuInput {
|
|
41
|
-
type State = PopupMenuInputState;
|
|
42
|
-
interface Props extends PopupMenuInputProps {
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { PopupMenuInput as P, type PopupMenuInputProps as a, type PopupMenuInputState as b };
|
package/dist/input-CYweYB_i.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { C as ComponentProps } from './types-DT4FOOa2.js';
|
|
3
|
-
|
|
4
|
-
interface PopupMenuInputState extends Record<string, unknown> {
|
|
5
|
-
/**
|
|
6
|
-
* Whether the input is active (visible).
|
|
7
|
-
* Only relevant when `hideUntilActive` is true.
|
|
8
|
-
*/
|
|
9
|
-
active: boolean;
|
|
10
|
-
}
|
|
11
|
-
interface PopupMenuInputProps extends Omit<ComponentProps<'input', PopupMenuInput.State>, 'value' | 'onChange' | 'type'> {
|
|
12
|
-
/**
|
|
13
|
-
* Controlled value for the search input.
|
|
14
|
-
* If provided, this takes precedence over the Surface's search state.
|
|
15
|
-
*/
|
|
16
|
-
value?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Callback when the input value changes.
|
|
19
|
-
*/
|
|
20
|
-
onValueChange?: (value: string) => void;
|
|
21
|
-
/**
|
|
22
|
-
* When true, the input is not rendered until the user starts typing.
|
|
23
|
-
* The List receives focus initially, and typing a character activates the input.
|
|
24
|
-
* Once activated, the input stays visible until the menu closes.
|
|
25
|
-
* @default false
|
|
26
|
-
*/
|
|
27
|
-
hideUntilActive?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* When true, Backspace in an empty subpage input navigates back one page.
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
backspaceGoesBack?: boolean;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Search input for filtering popup menu items.
|
|
36
|
-
* Handles keyboard navigation (Arrow keys, Ctrl+N/P, Enter).
|
|
37
|
-
* Renders an `<input>` element.
|
|
38
|
-
*/
|
|
39
|
-
declare const PopupMenuInput: React.ForwardRefExoticComponent<Omit<PopupMenuInput.Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
40
|
-
declare namespace PopupMenuInput {
|
|
41
|
-
type State = PopupMenuInputState;
|
|
42
|
-
interface Props extends PopupMenuInputProps {
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { PopupMenuInput as P, type PopupMenuInputProps as a, type PopupMenuInputState as b };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/ui/ui/packages/react/dist/internal/listbox/index.cjs"],"names":[],"mappings":"AAAA,qIAA+L,oCAAiC,2hCAAwe","file":"/home/runner/work/ui/ui/packages/react/dist/internal/listbox/index.cjs"}
|
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
export { A as AimGuardRefs, c as GroupContext, G as GroupContextValue, b as GroupPositional, e as ItemContext, I as ItemContextValue, U as UseListboxItemParams, f as UseListboxItemReturn, d as useGroupContext, u as useItemContext, g as useListboxItem, a as useMaybeItemContext } from '../../use-listbox-item-NzZuY34-.cjs';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { aZ as HighlightChangeEventDetails } from '../../events-DVcrtGe3.cjs';
|
|
4
|
-
import { b as ListboxStore, V as VirtualItem } from '../../ListboxStore-B8oTpM57.cjs';
|
|
5
|
-
export { L as Context, D as DOMRefs, F as FilterFn, H as HighlightSource, I as ItemRegistration, L as ListboxContext, a as ListboxState, S as SearchNormalizer, a as State } from '../../ListboxStore-B8oTpM57.cjs';
|
|
6
|
-
export { b as SurfaceContext, S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../../surface-context-CN4Lb_6F.cjs';
|
|
7
|
-
export { c as commandScore, d as defaultFilter } from '../../command-score-CTJ9NV6n.cjs';
|
|
8
|
-
import '../../types-DT4FOOa2.cjs';
|
|
9
|
-
import '@base-ui/utils/store';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Virtualization configuration passed from Root/Submenu to Surface.
|
|
13
|
-
*/
|
|
14
|
-
interface VirtualizationConfig {
|
|
15
|
-
/** Whether virtualization mode is enabled */
|
|
16
|
-
virtualized: boolean;
|
|
17
|
-
/** Pre-registered items for virtualization */
|
|
18
|
-
items: VirtualItem[];
|
|
19
|
-
/**
|
|
20
|
-
* Callback when highlighted item changes (for scroll sync).
|
|
21
|
-
* The third parameter contains event details including the reason for the change.
|
|
22
|
-
*/
|
|
23
|
-
onHighlightChange?: (id: string | null, index: number, eventDetails: HighlightChangeEventDetails) => void;
|
|
24
|
-
}
|
|
25
|
-
interface ListboxContextValue {
|
|
26
|
-
/** The Listbox store instance */
|
|
27
|
-
store: ListboxStore;
|
|
28
|
-
/** Nesting depth: 0 = root menu, 1+ = submenu */
|
|
29
|
-
depth: number;
|
|
30
|
-
/** Close the entire menu tree (deepest submenu to root, sequentially) */
|
|
31
|
-
closeAll: () => void;
|
|
32
|
-
/** Register a surface (submenu) for closeAll tracking. Returns unregister function. */
|
|
33
|
-
registerSurface: (depth: number, setOpen: (open: boolean) => void) => () => void;
|
|
34
|
-
/** Virtualization configuration (if enabled) */
|
|
35
|
-
virtualization?: VirtualizationConfig;
|
|
36
|
-
}
|
|
37
|
-
declare const ListboxContext: React.Context<ListboxContextValue | null>;
|
|
38
|
-
declare function useListboxContext(): ListboxContextValue;
|
|
39
|
-
declare function useMaybeListboxContext(): ListboxContextValue | null;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Context value for row width measurement.
|
|
43
|
-
* Provided by List when `measureRowWidth` is enabled.
|
|
44
|
-
*/
|
|
45
|
-
interface RowWidthContextValue {
|
|
46
|
-
/**
|
|
47
|
-
* Queue a row element for width measurement.
|
|
48
|
-
* Call this when a row mounts or becomes visible.
|
|
49
|
-
*
|
|
50
|
-
* @param element - The DOM element to measure
|
|
51
|
-
* @param id - Unique identifier for this row (used to avoid re-measuring)
|
|
52
|
-
*/
|
|
53
|
-
queueMeasurement: (element: HTMLElement, id: string) => void;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Context for row width measurement.
|
|
57
|
-
* Items use this to self-register for measurement.
|
|
58
|
-
*/
|
|
59
|
-
declare const RowWidthContext: React.Context<RowWidthContextValue | null>;
|
|
60
|
-
/**
|
|
61
|
-
* Hook to get the row width context.
|
|
62
|
-
* Throws an error if used outside of a List with `measureRowWidth` enabled.
|
|
63
|
-
*/
|
|
64
|
-
declare function useRowWidthContext(): RowWidthContextValue;
|
|
65
|
-
/**
|
|
66
|
-
* Hook to optionally get the row width context.
|
|
67
|
-
* Returns null if not within a List with `measureRowWidth` enabled.
|
|
68
|
-
* This is the preferred hook for items that should work both with and without measurement.
|
|
69
|
-
*/
|
|
70
|
-
declare function useMaybeRowWidthContext(): RowWidthContextValue | null;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Focus owner interface for keyboard handling.
|
|
74
|
-
* Optional - only needed for popup menus with multiple surfaces.
|
|
75
|
-
*/
|
|
76
|
-
interface FocusOwnerInterface {
|
|
77
|
-
/** Check if a surface is the current owner */
|
|
78
|
-
useState: (selector: 'isOwner', surfaceId: string) => boolean;
|
|
79
|
-
/** Set the owner surface ID */
|
|
80
|
-
setOwnerId: (id: string | null) => void;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Submenu context interface for keyboard handling.
|
|
84
|
-
* Optional - only needed for popup menus with submenus.
|
|
85
|
-
*/
|
|
86
|
-
interface SubmenuInterface {
|
|
87
|
-
/** Close this submenu */
|
|
88
|
-
setOpen: (open: boolean) => void;
|
|
89
|
-
/** Parent surface ID for focus transfer */
|
|
90
|
-
parentSurfaceId: string;
|
|
91
|
-
/** Whether Escape closes the root menu or just this submenu */
|
|
92
|
-
closeRootOnEsc?: boolean;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Subpage context interface for keyboard handling.
|
|
96
|
-
* Optional - only needed for popup menus with in-popup subpage navigation.
|
|
97
|
-
*/
|
|
98
|
-
interface SubpageInterface {
|
|
99
|
-
/** Pop one page from the current stack. */
|
|
100
|
-
goBack: () => boolean;
|
|
101
|
-
/** Parent surface ID for focus transfer after back navigation. */
|
|
102
|
-
parentSurfaceId: string | null;
|
|
103
|
-
/** Whether Escape closes the root menu instead of navigating back. */
|
|
104
|
-
closeRootOnEsc?: boolean;
|
|
105
|
-
}
|
|
106
|
-
interface UseListboxKeyboardParams {
|
|
107
|
-
/** The Listbox store instance */
|
|
108
|
-
store: ListboxStore;
|
|
109
|
-
/** Unique identifier for this surface */
|
|
110
|
-
surfaceId: string;
|
|
111
|
-
/** Whether keyboard handling is enabled */
|
|
112
|
-
enabled: boolean;
|
|
113
|
-
/** User's onKeyDown handler to compose with */
|
|
114
|
-
onKeyDown?: React.KeyboardEventHandler;
|
|
115
|
-
/**
|
|
116
|
-
* Callback when an item is selected via keyboard (Enter or shortcut).
|
|
117
|
-
* Called with selection details. The consumer handles any
|
|
118
|
-
* post-selection behavior like closing menus.
|
|
119
|
-
*/
|
|
120
|
-
onSelect?: (details: {
|
|
121
|
-
itemId: string | null;
|
|
122
|
-
closeOnClick: boolean;
|
|
123
|
-
}) => void;
|
|
124
|
-
/**
|
|
125
|
-
* Callback to close the entire menu tree from the root.
|
|
126
|
-
* Used when Escape is pressed and closeRootOnEsc is true (default).
|
|
127
|
-
*/
|
|
128
|
-
closeAll: () => void;
|
|
129
|
-
/** The FocusOwner store for managing focus ownership (optional) */
|
|
130
|
-
focusOwner?: FocusOwnerInterface;
|
|
131
|
-
/** Menu depth (0 for root, >0 for submenus) - defaults to 0 */
|
|
132
|
-
depth?: number;
|
|
133
|
-
/** Submenu context for ArrowLeft navigation back to parent (optional) */
|
|
134
|
-
submenuContext?: SubmenuInterface | null;
|
|
135
|
-
/** Subpage context for ArrowLeft/Ctrl+H navigation back (optional) */
|
|
136
|
-
subpageContext?: SubpageInterface | null;
|
|
137
|
-
/**
|
|
138
|
-
* Whether to enable type-to-search behavior.
|
|
139
|
-
* When true, printable characters will activate the input and set pending search.
|
|
140
|
-
* Used by List when hideUntilActive is enabled and input is not yet active.
|
|
141
|
-
* @default false
|
|
142
|
-
*/
|
|
143
|
-
enableTypeToSearch?: boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Whether to skip the focus owner check.
|
|
146
|
-
* When true, keyboard handling will work based on `enabled` prop alone,
|
|
147
|
-
* ignoring focus ownership. Useful for Combobox where the input is outside
|
|
148
|
-
* the Surface but should still handle keyboard navigation.
|
|
149
|
-
* @default false
|
|
150
|
-
*/
|
|
151
|
-
skipFocusOwnerCheck?: boolean;
|
|
152
|
-
}
|
|
153
|
-
interface UseListboxKeyboardReturn {
|
|
154
|
-
/** Keyboard event handler to attach to the element */
|
|
155
|
-
handleKeyDown: React.KeyboardEventHandler;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Centralized keyboard navigation hook for listbox-like components.
|
|
159
|
-
* Handles arrow navigation, vim bindings, submenu open/close, and selection.
|
|
160
|
-
*
|
|
161
|
-
* This hook can be used standalone (for simple listboxes like Select/Command)
|
|
162
|
-
* or with focus owner and submenu support (for popup menus with nested menus).
|
|
163
|
-
*/
|
|
164
|
-
declare function useListboxKeyboard(params: UseListboxKeyboardParams): UseListboxKeyboardReturn;
|
|
165
|
-
|
|
166
|
-
interface UseStickyRowWidthOptions {
|
|
167
|
-
/**
|
|
168
|
-
* Ref to the list container element.
|
|
169
|
-
* Used to measure row widths and as a fallback target for the CSS variable.
|
|
170
|
-
*/
|
|
171
|
-
listRef: React.RefObject<HTMLElement | null>;
|
|
172
|
-
/**
|
|
173
|
-
* Optional ref to the element where `--row-width` CSS variable should be applied.
|
|
174
|
-
* If not provided, uses the listRef element.
|
|
175
|
-
* Useful for applying the variable to a parent Popup element.
|
|
176
|
-
*/
|
|
177
|
-
targetRef?: React.RefObject<HTMLElement | null>;
|
|
178
|
-
/**
|
|
179
|
-
* Optional maximum width cap in pixels.
|
|
180
|
-
* The measured width will never exceed this value.
|
|
181
|
-
*/
|
|
182
|
-
maxWidth?: number;
|
|
183
|
-
/**
|
|
184
|
-
* Whether measurement is enabled.
|
|
185
|
-
* @default true
|
|
186
|
-
*/
|
|
187
|
-
enabled?: boolean;
|
|
188
|
-
}
|
|
189
|
-
interface UseStickyRowWidthReturn {
|
|
190
|
-
/**
|
|
191
|
-
* Queue a row element for measurement.
|
|
192
|
-
* The element's natural width will be measured and tracked.
|
|
193
|
-
* Call this when a row mounts or becomes visible.
|
|
194
|
-
*/
|
|
195
|
-
queueMeasurement: (element: HTMLElement, id: string) => void;
|
|
196
|
-
/**
|
|
197
|
-
* Reset all measurements.
|
|
198
|
-
* Call this when the menu closes to start fresh on next open.
|
|
199
|
-
*/
|
|
200
|
-
resetMeasurements: () => void;
|
|
201
|
-
/**
|
|
202
|
-
* Clear the set of measured IDs without resetting the sticky max width.
|
|
203
|
-
* Call this when row content changes for the same IDs (e.g. browse rows
|
|
204
|
-
* re-render as breadcrumb rows when deep search toggles) so rows are
|
|
205
|
-
* re-measured. The width still only grows, never shrinks.
|
|
206
|
-
*/
|
|
207
|
-
clearMeasuredIds: () => void;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Hook that measures row widths and maintains a sticky maximum width.
|
|
211
|
-
*
|
|
212
|
-
* This is useful for virtualized lists where the popup width should adapt
|
|
213
|
-
* to the content but never shrink as the user scrolls through items.
|
|
214
|
-
*
|
|
215
|
-
* The hook:
|
|
216
|
-
* 1. Measures each row's natural width (using `max-content`)
|
|
217
|
-
* 2. Tracks the maximum width seen across all rows
|
|
218
|
-
* 3. Applies `--row-width` CSS variable to the target element
|
|
219
|
-
* 4. Only grows the width, never shrinks (until reset)
|
|
220
|
-
*
|
|
221
|
-
* @example
|
|
222
|
-
* ```tsx
|
|
223
|
-
* const { queueMeasurement, resetMeasurements } = useStickyRowWidth({
|
|
224
|
-
* listRef: myListRef,
|
|
225
|
-
* maxWidth: 500,
|
|
226
|
-
* })
|
|
227
|
-
*
|
|
228
|
-
* // Queue items for measurement
|
|
229
|
-
* useLayoutEffect(() => {
|
|
230
|
-
* if (itemRef.current) {
|
|
231
|
-
* queueMeasurement(itemRef.current, itemId)
|
|
232
|
-
* }
|
|
233
|
-
* }, [itemId])
|
|
234
|
-
*
|
|
235
|
-
* // Reset on menu close
|
|
236
|
-
* useEffect(() => {
|
|
237
|
-
* if (!isOpen) {
|
|
238
|
-
* resetMeasurements()
|
|
239
|
-
* }
|
|
240
|
-
* }, [isOpen])
|
|
241
|
-
* ```
|
|
242
|
-
*/
|
|
243
|
-
declare function useStickyRowWidth(options: UseStickyRowWidthOptions): UseStickyRowWidthReturn;
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Normalizes a value string for use in filtering and identification.
|
|
247
|
-
* Trims leading/trailing whitespace to match cmdk's behavior.
|
|
248
|
-
*
|
|
249
|
-
* @param value - The value to normalize
|
|
250
|
-
* @returns The trimmed value, or empty string if value is nullish
|
|
251
|
-
*/
|
|
252
|
-
declare function normalizeValue(value: string | undefined | null): string;
|
|
253
|
-
/**
|
|
254
|
-
* Converts a value string to a URL-safe slug for use in IDs.
|
|
255
|
-
* - Trims whitespace
|
|
256
|
-
* - Converts to lowercase
|
|
257
|
-
* - Replaces spaces with hyphens
|
|
258
|
-
* - Removes non-alphanumeric characters (except hyphens)
|
|
259
|
-
* - Collapses multiple hyphens into one
|
|
260
|
-
* - Removes leading/trailing hyphens
|
|
261
|
-
*
|
|
262
|
-
* @example
|
|
263
|
-
* slugify("User Settings") // "user-settings"
|
|
264
|
-
* slugify(" Hello World! ") // "hello-world"
|
|
265
|
-
* slugify("Café & Co.") // "caf-co"
|
|
266
|
-
*
|
|
267
|
-
* @param value - The value to slugify
|
|
268
|
-
* @returns The slugified value, or empty string if value is nullish
|
|
269
|
-
*/
|
|
270
|
-
declare function slugify(value: string | undefined | null): string;
|
|
271
|
-
|
|
272
|
-
export { type FocusOwnerInterface, ListboxContext as ListboxContextProvider, type ListboxContextValue, ListboxStore, RowWidthContext, type RowWidthContextValue, type SubmenuInterface, type SubpageInterface, type UseListboxKeyboardParams, type UseListboxKeyboardReturn, type UseStickyRowWidthOptions, type UseStickyRowWidthReturn, VirtualItem, type VirtualizationConfig, normalizeValue, slugify, useListboxContext, useListboxKeyboard, useMaybeListboxContext, useMaybeRowWidthContext, useRowWidthContext, useStickyRowWidth };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/ui/ui/packages/react/dist/internal/popup-menu/index.cjs"],"names":[],"mappings":"AAAA,qIAA8hB,oCAAiC,oCAAiC,oCAAiC,87HAA07D","file":"/home/runner/work/ui/ui/packages/react/dist/internal/popup-menu/index.cjs"}
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import { F as FocusOwnerStore, O as OpenChainStore, M as MenuTreeResolver, V as VirtualizationConfig, P as PopupMenuDebugOptions, v as VirtualAnchor } from '../../scroll-arrow-BBoKckL_.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-BBoKckL_.cjs';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { p as SubpageStackContextValue, S as SubmenuContextValue, o as SubpageContextValue } from '../../type-guards-BHHzjRvZ.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, A as isLinkItemDef, 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-BHHzjRvZ.cjs';
|
|
6
|
-
import { b as ListboxStore } from '../../ListboxStore-B8oTpM57.cjs';
|
|
7
|
-
export { V as VirtualItem } from '../../ListboxStore-B8oTpM57.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-NjsBVzek.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 { R as AsyncLoaderConfig, S as AsyncLoaderFetchStatus, T as AsyncLoaderLoadingPhase, U as AsyncLoaderResult, V as AsyncLoaderSource, W as AsyncLoaderStatus, X as AsyncNodesConfig, Y as AsyncRenderState, Z as AsyncResultBehavior, _ as AsyncState, $ as BreadcrumbNode, a0 as CheckboxItemDef, a1 as CheckboxItemRenderParams, a2 as CheckboxItemRenderProps, a3 as DataListChildrenState, a4 as DeepSearchConfig, a5 as DisabledBranchBehavior, a6 as DisplayGroupNode, a7 as DisplayNode, a8 as DisplayRadioGroupNode, a9 as DisplayRowNode, aa as DisplaySeparatorNode, ab as DisplaySubpageNode, h as GetResolvedIdFn, ac as GroupBehavior, ad as GroupDef, ae as GroupLabelRenderParams, af as GroupRenderContext, ag as GroupRenderParams, ah as IncludeInDeepSearch, ai as InitialQueryBehavior, aj as ItemDef, ak as ItemRenderParams, al as ItemRenderProps, am as LinkItemDef, an as LinkItemRenderParams, ao as LinkItemRenderProps, ap as LoaderComponentProps, N as NodeDef, m as PopupMenuCheckboxItem, z as PopupMenuCheckboxItemProps, A as PopupMenuCheckboxItemState, P as PopupMenuHighlightChangeHandler, j as PopupMenuIdScope, q as PopupMenuItem, B as PopupMenuItemProps, D as PopupMenuItemState, r as PopupMenuLinkItem, E as PopupMenuLinkItemProps, F as PopupMenuLinkItemState, u as PopupMenuNode, v as PopupMenuRadioGroup, H as PopupMenuRadioGroupProps, I as PopupMenuRadioGroupState, w as PopupMenuRadioItem, J as PopupMenuRadioItemProps, K as PopupMenuRadioItemState, x as PopupMenuSubmenuTrigger, L as PopupMenuSubmenuTriggerProps, M as PopupMenuSubmenuTriggerState, y as PopupMenuSubpageTrigger, O as PopupMenuSubpageTriggerProps, Q as PopupMenuSubpageTriggerState, aq as QueryAsyncNodesConfig, ar as QueryLoaderConfig, as as RadioGroupBehavior, at as RadioGroupDef, au as RadioGroupLabelRenderParams, av as RadioGroupRenderParams, aw as RadioGroupRenderProps, ax as RadioItemDef, ay as RadioItemRenderParams, az as RadioItemRenderProps, aA as RowRenderContext, aB as ScoredNode, aC as SeparatorDef, aD as SeparatorRenderParams, aE as StaticAsyncNodesConfig, aF as StaticLoaderConfig, aG as SubmenuDef, aH as SubmenuRenderParams, aI as SubmenuRenderProps, aJ as SubpageContentRenderParams, aK as SubpageDef, aL as SubpageTriggerRenderParams, aM as SubpageTriggerRenderProps, aN as TreeItemDef, aO as TreeItemRenderParams, aP as TreeItemRenderProps, aQ as UnresolvedMenuNode, aR as defineRadioGroup, aS as isDisplayGroupNode, aT as isDisplayRadioGroupNode, aU as isDisplayRowNode, aV as isDisplaySeparatorNode } from '../../events-DVcrtGe3.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-B-j0eW24.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 };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/items-B6HeFO_8.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
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 };
|