@radix-ui/react-menubar 1.1.0-rc.1 → 1.1.0-rc.3
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/index.js +474 -435
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -1,461 +1,500 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
));
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
var [MenubarMenuProvider, useMenubarMenuContext] = createMenubarContext(MENU_NAME);
|
|
117
|
-
var MenubarMenu = (props) => {
|
|
118
|
-
const { __scopeMenubar, value: valueProp, ...menuProps } = props;
|
|
119
|
-
const autoValue = (0, import_react_id.useId)();
|
|
120
|
-
const value = valueProp || autoValue || "LEGACY_REACT_AUTO_VALUE";
|
|
121
|
-
const context = useMenubarContext(MENU_NAME, __scopeMenubar);
|
|
122
|
-
const menuScope = useMenuScope(__scopeMenubar);
|
|
123
|
-
const triggerRef = React.useRef(null);
|
|
124
|
-
const wasKeyboardTriggerOpenRef = React.useRef(false);
|
|
125
|
-
const open = context.value === value;
|
|
126
|
-
React.useEffect(() => {
|
|
127
|
-
if (!open) wasKeyboardTriggerOpenRef.current = false;
|
|
128
|
-
}, [open]);
|
|
31
|
+
// packages/react/menubar/src/index.ts
|
|
32
|
+
var src_exports = {};
|
|
33
|
+
__export(src_exports, {
|
|
34
|
+
Arrow: () => Arrow2,
|
|
35
|
+
CheckboxItem: () => CheckboxItem2,
|
|
36
|
+
Content: () => Content2,
|
|
37
|
+
Group: () => Group2,
|
|
38
|
+
Item: () => Item3,
|
|
39
|
+
ItemIndicator: () => ItemIndicator2,
|
|
40
|
+
Label: () => Label2,
|
|
41
|
+
Menu: () => Menu,
|
|
42
|
+
Menubar: () => Menubar,
|
|
43
|
+
MenubarArrow: () => MenubarArrow,
|
|
44
|
+
MenubarCheckboxItem: () => MenubarCheckboxItem,
|
|
45
|
+
MenubarContent: () => MenubarContent,
|
|
46
|
+
MenubarGroup: () => MenubarGroup,
|
|
47
|
+
MenubarItem: () => MenubarItem,
|
|
48
|
+
MenubarItemIndicator: () => MenubarItemIndicator,
|
|
49
|
+
MenubarLabel: () => MenubarLabel,
|
|
50
|
+
MenubarMenu: () => MenubarMenu,
|
|
51
|
+
MenubarPortal: () => MenubarPortal,
|
|
52
|
+
MenubarRadioGroup: () => MenubarRadioGroup,
|
|
53
|
+
MenubarRadioItem: () => MenubarRadioItem,
|
|
54
|
+
MenubarSeparator: () => MenubarSeparator,
|
|
55
|
+
MenubarSub: () => MenubarSub,
|
|
56
|
+
MenubarSubContent: () => MenubarSubContent,
|
|
57
|
+
MenubarSubTrigger: () => MenubarSubTrigger,
|
|
58
|
+
MenubarTrigger: () => MenubarTrigger,
|
|
59
|
+
Portal: () => Portal2,
|
|
60
|
+
RadioGroup: () => RadioGroup2,
|
|
61
|
+
RadioItem: () => RadioItem2,
|
|
62
|
+
Root: () => Root3,
|
|
63
|
+
Separator: () => Separator2,
|
|
64
|
+
Sub: () => Sub2,
|
|
65
|
+
SubContent: () => SubContent2,
|
|
66
|
+
SubTrigger: () => SubTrigger2,
|
|
67
|
+
Trigger: () => Trigger,
|
|
68
|
+
createMenubarScope: () => createMenubarScope
|
|
69
|
+
});
|
|
70
|
+
module.exports = __toCommonJS(src_exports);
|
|
71
|
+
|
|
72
|
+
// packages/react/menubar/src/Menubar.tsx
|
|
73
|
+
var React = __toESM(require("react"));
|
|
74
|
+
var import_react_collection = require("@radix-ui/react-collection");
|
|
75
|
+
var import_react_direction = require("@radix-ui/react-direction");
|
|
76
|
+
var import_primitive = require("@radix-ui/primitive");
|
|
77
|
+
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
|
78
|
+
var import_react_context = require("@radix-ui/react-context");
|
|
79
|
+
var import_react_id = require("@radix-ui/react-id");
|
|
80
|
+
var MenuPrimitive = __toESM(require("@radix-ui/react-menu"));
|
|
81
|
+
var import_react_menu = require("@radix-ui/react-menu");
|
|
82
|
+
var RovingFocusGroup = __toESM(require("@radix-ui/react-roving-focus"));
|
|
83
|
+
var import_react_roving_focus = require("@radix-ui/react-roving-focus");
|
|
84
|
+
var import_react_primitive = require("@radix-ui/react-primitive");
|
|
85
|
+
var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state");
|
|
86
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
87
|
+
var MENUBAR_NAME = "Menubar";
|
|
88
|
+
var [Collection, useCollection, createCollectionScope] = (0, import_react_collection.createCollection)(MENUBAR_NAME);
|
|
89
|
+
var [createMenubarContext, createMenubarScope] = (0, import_react_context.createContextScope)(MENUBAR_NAME, [
|
|
90
|
+
createCollectionScope,
|
|
91
|
+
import_react_roving_focus.createRovingFocusGroupScope
|
|
92
|
+
]);
|
|
93
|
+
var useMenuScope = (0, import_react_menu.createMenuScope)();
|
|
94
|
+
var useRovingFocusGroupScope = (0, import_react_roving_focus.createRovingFocusGroupScope)();
|
|
95
|
+
var [MenubarContextProvider, useMenubarContext] = createMenubarContext(MENUBAR_NAME);
|
|
96
|
+
var Menubar = React.forwardRef(
|
|
97
|
+
(props, forwardedRef) => {
|
|
98
|
+
const {
|
|
99
|
+
__scopeMenubar,
|
|
100
|
+
value: valueProp,
|
|
101
|
+
onValueChange,
|
|
102
|
+
defaultValue,
|
|
103
|
+
loop = true,
|
|
104
|
+
dir,
|
|
105
|
+
...menubarProps
|
|
106
|
+
} = props;
|
|
107
|
+
const direction = (0, import_react_direction.useDirection)(dir);
|
|
108
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenubar);
|
|
109
|
+
const [value = "", setValue] = (0, import_react_use_controllable_state.useControllableState)({
|
|
110
|
+
prop: valueProp,
|
|
111
|
+
onChange: onValueChange,
|
|
112
|
+
defaultProp: defaultValue
|
|
113
|
+
});
|
|
114
|
+
const [currentTabStopId, setCurrentTabStopId] = React.useState(null);
|
|
129
115
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
|
-
|
|
116
|
+
MenubarContextProvider,
|
|
131
117
|
{
|
|
132
118
|
scope: __scopeMenubar,
|
|
133
119
|
value,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
120
|
+
onMenuOpen: React.useCallback(
|
|
121
|
+
(value2) => {
|
|
122
|
+
setValue(value2);
|
|
123
|
+
setCurrentTabStopId(value2);
|
|
124
|
+
},
|
|
125
|
+
[setValue]
|
|
126
|
+
),
|
|
127
|
+
onMenuClose: React.useCallback(() => setValue(""), [setValue]),
|
|
128
|
+
onMenuToggle: React.useCallback(
|
|
129
|
+
(value2) => {
|
|
130
|
+
setValue((prevValue) => Boolean(prevValue) ? "" : value2);
|
|
131
|
+
setCurrentTabStopId(value2);
|
|
132
|
+
},
|
|
133
|
+
[setValue]
|
|
134
|
+
),
|
|
135
|
+
dir: direction,
|
|
136
|
+
loop,
|
|
137
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, { scope: __scopeMenubar, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, { scope: __scopeMenubar, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
138
|
+
RovingFocusGroup.Root,
|
|
140
139
|
{
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
...
|
|
140
|
+
asChild: true,
|
|
141
|
+
...rovingFocusGroupScope,
|
|
142
|
+
orientation: "horizontal",
|
|
143
|
+
loop,
|
|
144
|
+
dir: direction,
|
|
145
|
+
currentTabStopId,
|
|
146
|
+
onCurrentTabStopIdChange: setCurrentTabStopId,
|
|
147
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { role: "menubar", ...menubarProps, ref: forwardedRef })
|
|
149
148
|
}
|
|
150
|
-
)
|
|
149
|
+
) }) })
|
|
151
150
|
}
|
|
152
151
|
);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
Menubar.displayName = MENUBAR_NAME;
|
|
155
|
+
var MENU_NAME = "MenubarMenu";
|
|
156
|
+
var [MenubarMenuProvider, useMenubarMenuContext] = createMenubarContext(MENU_NAME);
|
|
157
|
+
var MenubarMenu = (props) => {
|
|
158
|
+
const { __scopeMenubar, value: valueProp, ...menuProps } = props;
|
|
159
|
+
const autoValue = (0, import_react_id.useId)();
|
|
160
|
+
const value = valueProp || autoValue || "LEGACY_REACT_AUTO_VALUE";
|
|
161
|
+
const context = useMenubarContext(MENU_NAME, __scopeMenubar);
|
|
162
|
+
const menuScope = useMenuScope(__scopeMenubar);
|
|
163
|
+
const triggerRef = React.useRef(null);
|
|
164
|
+
const wasKeyboardTriggerOpenRef = React.useRef(false);
|
|
165
|
+
const open = context.value === value;
|
|
166
|
+
React.useEffect(() => {
|
|
167
|
+
if (!open) wasKeyboardTriggerOpenRef.current = false;
|
|
168
|
+
}, [open]);
|
|
169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
170
|
+
MenubarMenuProvider,
|
|
171
|
+
{
|
|
172
|
+
scope: __scopeMenubar,
|
|
173
|
+
value,
|
|
174
|
+
triggerId: (0, import_react_id.useId)(),
|
|
175
|
+
triggerRef,
|
|
176
|
+
contentId: (0, import_react_id.useId)(),
|
|
177
|
+
wasKeyboardTriggerOpenRef,
|
|
178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
179
|
+
MenuPrimitive.Root,
|
|
169
180
|
{
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
role: "menuitem",
|
|
179
|
-
id: menuContext.triggerId,
|
|
180
|
-
"aria-haspopup": "menu",
|
|
181
|
-
"aria-expanded": open,
|
|
182
|
-
"aria-controls": open ? menuContext.contentId : void 0,
|
|
183
|
-
"data-highlighted": isFocused ? "" : void 0,
|
|
184
|
-
"data-state": open ? "open" : "closed",
|
|
185
|
-
"data-disabled": disabled ? "" : void 0,
|
|
186
|
-
disabled,
|
|
187
|
-
...triggerProps,
|
|
188
|
-
ref: composedRefs,
|
|
189
|
-
onPointerDown: (0, import_primitive.composeEventHandlers)(props.onPointerDown, (event) => {
|
|
190
|
-
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
191
|
-
context.onMenuOpen(menuContext.value);
|
|
192
|
-
if (!open) event.preventDefault();
|
|
193
|
-
}
|
|
194
|
-
}),
|
|
195
|
-
onPointerEnter: (0, import_primitive.composeEventHandlers)(props.onPointerEnter, () => {
|
|
196
|
-
const menubarOpen = Boolean(context.value);
|
|
197
|
-
if (menubarOpen && !open) {
|
|
198
|
-
context.onMenuOpen(menuContext.value);
|
|
199
|
-
ref.current?.focus();
|
|
200
|
-
}
|
|
201
|
-
}),
|
|
202
|
-
onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => {
|
|
203
|
-
if (disabled) return;
|
|
204
|
-
if (["Enter", " "].includes(event.key)) context.onMenuToggle(menuContext.value);
|
|
205
|
-
if (event.key === "ArrowDown") context.onMenuOpen(menuContext.value);
|
|
206
|
-
if (["Enter", " ", "ArrowDown"].includes(event.key)) {
|
|
207
|
-
menuContext.wasKeyboardTriggerOpenRef.current = true;
|
|
208
|
-
event.preventDefault();
|
|
209
|
-
}
|
|
210
|
-
}),
|
|
211
|
-
onFocus: (0, import_primitive.composeEventHandlers)(props.onFocus, () => setIsFocused(true)),
|
|
212
|
-
onBlur: (0, import_primitive.composeEventHandlers)(props.onBlur, () => setIsFocused(false))
|
|
213
|
-
}
|
|
214
|
-
) })
|
|
181
|
+
...menuScope,
|
|
182
|
+
open,
|
|
183
|
+
onOpenChange: (open2) => {
|
|
184
|
+
if (!open2) context.onMenuClose();
|
|
185
|
+
},
|
|
186
|
+
modal: false,
|
|
187
|
+
dir: context.dir,
|
|
188
|
+
...menuProps
|
|
215
189
|
}
|
|
216
|
-
)
|
|
190
|
+
)
|
|
217
191
|
}
|
|
218
192
|
);
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
193
|
+
};
|
|
194
|
+
MenubarMenu.displayName = MENU_NAME;
|
|
195
|
+
var TRIGGER_NAME = "MenubarTrigger";
|
|
196
|
+
var MenubarTrigger = React.forwardRef(
|
|
197
|
+
(props, forwardedRef) => {
|
|
198
|
+
const { __scopeMenubar, disabled = false, ...triggerProps } = props;
|
|
199
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenubar);
|
|
223
200
|
const menuScope = useMenuScope(__scopeMenubar);
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
MenuPrimitive.
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
const isMenubarTrigger = getItems().some((item) => item.ref.current?.contains(target));
|
|
257
|
-
if (isMenubarTrigger) event.preventDefault();
|
|
258
|
-
}),
|
|
259
|
-
onInteractOutside: (0, import_primitive.composeEventHandlers)(props.onInteractOutside, () => {
|
|
260
|
-
hasInteractedOutsideRef.current = true;
|
|
261
|
-
}),
|
|
262
|
-
onEntryFocus: (event) => {
|
|
263
|
-
if (!menuContext.wasKeyboardTriggerOpenRef.current) event.preventDefault();
|
|
264
|
-
},
|
|
265
|
-
onKeyDown: (0, import_primitive.composeEventHandlers)(
|
|
266
|
-
props.onKeyDown,
|
|
267
|
-
(event) => {
|
|
268
|
-
if (["ArrowRight", "ArrowLeft"].includes(event.key)) {
|
|
269
|
-
const target = event.target;
|
|
270
|
-
const targetIsSubTrigger = target.hasAttribute("data-radix-menubar-subtrigger");
|
|
271
|
-
const isKeyDownInsideSubMenu = target.closest("[data-radix-menubar-content]") !== event.currentTarget;
|
|
272
|
-
const prevMenuKey = context.dir === "rtl" ? "ArrowRight" : "ArrowLeft";
|
|
273
|
-
const isPrevKey = prevMenuKey === event.key;
|
|
274
|
-
const isNextKey = !isPrevKey;
|
|
275
|
-
if (isNextKey && targetIsSubTrigger) return;
|
|
276
|
-
if (isKeyDownInsideSubMenu && isPrevKey) return;
|
|
277
|
-
const items = getItems().filter((item) => !item.disabled);
|
|
278
|
-
let candidateValues = items.map((item) => item.value);
|
|
279
|
-
if (isPrevKey) candidateValues.reverse();
|
|
280
|
-
const currentIndex = candidateValues.indexOf(menuContext.value);
|
|
281
|
-
candidateValues = context.loop ? wrapArray(candidateValues, currentIndex + 1) : candidateValues.slice(currentIndex + 1);
|
|
282
|
-
const [nextValue] = candidateValues;
|
|
283
|
-
if (nextValue) context.onMenuOpen(nextValue);
|
|
201
|
+
const context = useMenubarContext(TRIGGER_NAME, __scopeMenubar);
|
|
202
|
+
const menuContext = useMenubarMenuContext(TRIGGER_NAME, __scopeMenubar);
|
|
203
|
+
const ref = React.useRef(null);
|
|
204
|
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref, menuContext.triggerRef);
|
|
205
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
206
|
+
const open = context.value === menuContext.value;
|
|
207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.ItemSlot, { scope: __scopeMenubar, value: menuContext.value, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
208
|
+
RovingFocusGroup.Item,
|
|
209
|
+
{
|
|
210
|
+
asChild: true,
|
|
211
|
+
...rovingFocusGroupScope,
|
|
212
|
+
focusable: !disabled,
|
|
213
|
+
tabStopId: menuContext.value,
|
|
214
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Anchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
215
|
+
import_react_primitive.Primitive.button,
|
|
216
|
+
{
|
|
217
|
+
type: "button",
|
|
218
|
+
role: "menuitem",
|
|
219
|
+
id: menuContext.triggerId,
|
|
220
|
+
"aria-haspopup": "menu",
|
|
221
|
+
"aria-expanded": open,
|
|
222
|
+
"aria-controls": open ? menuContext.contentId : void 0,
|
|
223
|
+
"data-highlighted": isFocused ? "" : void 0,
|
|
224
|
+
"data-state": open ? "open" : "closed",
|
|
225
|
+
"data-disabled": disabled ? "" : void 0,
|
|
226
|
+
disabled,
|
|
227
|
+
...triggerProps,
|
|
228
|
+
ref: composedRefs,
|
|
229
|
+
onPointerDown: (0, import_primitive.composeEventHandlers)(props.onPointerDown, (event) => {
|
|
230
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
231
|
+
context.onMenuOpen(menuContext.value);
|
|
232
|
+
if (!open) event.preventDefault();
|
|
284
233
|
}
|
|
285
|
-
},
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
"
|
|
296
|
-
"
|
|
234
|
+
}),
|
|
235
|
+
onPointerEnter: (0, import_primitive.composeEventHandlers)(props.onPointerEnter, () => {
|
|
236
|
+
const menubarOpen = Boolean(context.value);
|
|
237
|
+
if (menubarOpen && !open) {
|
|
238
|
+
context.onMenuOpen(menuContext.value);
|
|
239
|
+
ref.current?.focus();
|
|
240
|
+
}
|
|
241
|
+
}),
|
|
242
|
+
onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => {
|
|
243
|
+
if (disabled) return;
|
|
244
|
+
if (["Enter", " "].includes(event.key)) context.onMenuToggle(menuContext.value);
|
|
245
|
+
if (event.key === "ArrowDown") context.onMenuOpen(menuContext.value);
|
|
246
|
+
if (["Enter", " ", "ArrowDown"].includes(event.key)) {
|
|
247
|
+
menuContext.wasKeyboardTriggerOpenRef.current = true;
|
|
248
|
+
event.preventDefault();
|
|
249
|
+
}
|
|
250
|
+
}),
|
|
251
|
+
onFocus: (0, import_primitive.composeEventHandlers)(props.onFocus, () => setIsFocused(true)),
|
|
252
|
+
onBlur: (0, import_primitive.composeEventHandlers)(props.onBlur, () => setIsFocused(false))
|
|
253
|
+
}
|
|
254
|
+
) })
|
|
255
|
+
}
|
|
256
|
+
) });
|
|
257
|
+
}
|
|
258
|
+
);
|
|
259
|
+
MenubarTrigger.displayName = TRIGGER_NAME;
|
|
260
|
+
var PORTAL_NAME = "MenubarPortal";
|
|
261
|
+
var MenubarPortal = (props) => {
|
|
262
|
+
const { __scopeMenubar, ...portalProps } = props;
|
|
263
|
+
const menuScope = useMenuScope(__scopeMenubar);
|
|
264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Portal, { ...menuScope, ...portalProps });
|
|
265
|
+
};
|
|
266
|
+
MenubarPortal.displayName = PORTAL_NAME;
|
|
267
|
+
var CONTENT_NAME = "MenubarContent";
|
|
268
|
+
var MenubarContent = React.forwardRef(
|
|
269
|
+
(props, forwardedRef) => {
|
|
270
|
+
const { __scopeMenubar, align = "start", ...contentProps } = props;
|
|
271
|
+
const menuScope = useMenuScope(__scopeMenubar);
|
|
272
|
+
const context = useMenubarContext(CONTENT_NAME, __scopeMenubar);
|
|
273
|
+
const menuContext = useMenubarMenuContext(CONTENT_NAME, __scopeMenubar);
|
|
274
|
+
const getItems = useCollection(__scopeMenubar);
|
|
275
|
+
const hasInteractedOutsideRef = React.useRef(false);
|
|
276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
277
|
+
MenuPrimitive.Content,
|
|
278
|
+
{
|
|
279
|
+
id: menuContext.contentId,
|
|
280
|
+
"aria-labelledby": menuContext.triggerId,
|
|
281
|
+
"data-radix-menubar-content": "",
|
|
282
|
+
...menuScope,
|
|
283
|
+
...contentProps,
|
|
284
|
+
ref: forwardedRef,
|
|
285
|
+
align,
|
|
286
|
+
onCloseAutoFocus: (0, import_primitive.composeEventHandlers)(props.onCloseAutoFocus, (event) => {
|
|
287
|
+
const menubarOpen = Boolean(context.value);
|
|
288
|
+
if (!menubarOpen && !hasInteractedOutsideRef.current) {
|
|
289
|
+
menuContext.triggerRef.current?.focus();
|
|
290
|
+
}
|
|
291
|
+
hasInteractedOutsideRef.current = false;
|
|
292
|
+
event.preventDefault();
|
|
293
|
+
}),
|
|
294
|
+
onFocusOutside: (0, import_primitive.composeEventHandlers)(props.onFocusOutside, (event) => {
|
|
295
|
+
const target = event.target;
|
|
296
|
+
const isMenubarTrigger = getItems().some((item) => item.ref.current?.contains(target));
|
|
297
|
+
if (isMenubarTrigger) event.preventDefault();
|
|
298
|
+
}),
|
|
299
|
+
onInteractOutside: (0, import_primitive.composeEventHandlers)(props.onInteractOutside, () => {
|
|
300
|
+
hasInteractedOutsideRef.current = true;
|
|
301
|
+
}),
|
|
302
|
+
onEntryFocus: (event) => {
|
|
303
|
+
if (!menuContext.wasKeyboardTriggerOpenRef.current) event.preventDefault();
|
|
304
|
+
},
|
|
305
|
+
onKeyDown: (0, import_primitive.composeEventHandlers)(
|
|
306
|
+
props.onKeyDown,
|
|
307
|
+
(event) => {
|
|
308
|
+
if (["ArrowRight", "ArrowLeft"].includes(event.key)) {
|
|
309
|
+
const target = event.target;
|
|
310
|
+
const targetIsSubTrigger = target.hasAttribute("data-radix-menubar-subtrigger");
|
|
311
|
+
const isKeyDownInsideSubMenu = target.closest("[data-radix-menubar-content]") !== event.currentTarget;
|
|
312
|
+
const prevMenuKey = context.dir === "rtl" ? "ArrowRight" : "ArrowLeft";
|
|
313
|
+
const isPrevKey = prevMenuKey === event.key;
|
|
314
|
+
const isNextKey = !isPrevKey;
|
|
315
|
+
if (isNextKey && targetIsSubTrigger) return;
|
|
316
|
+
if (isKeyDownInsideSubMenu && isPrevKey) return;
|
|
317
|
+
const items = getItems().filter((item) => !item.disabled);
|
|
318
|
+
let candidateValues = items.map((item) => item.value);
|
|
319
|
+
if (isPrevKey) candidateValues.reverse();
|
|
320
|
+
const currentIndex = candidateValues.indexOf(menuContext.value);
|
|
321
|
+
candidateValues = context.loop ? wrapArray(candidateValues, currentIndex + 1) : candidateValues.slice(currentIndex + 1);
|
|
322
|
+
const [nextValue] = candidateValues;
|
|
323
|
+
if (nextValue) context.onMenuOpen(nextValue);
|
|
297
324
|
}
|
|
325
|
+
},
|
|
326
|
+
{ checkForDefaultPrevented: false }
|
|
327
|
+
),
|
|
328
|
+
style: {
|
|
329
|
+
...props.style,
|
|
330
|
+
// re-namespace exposed content custom properties
|
|
331
|
+
...{
|
|
332
|
+
"--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
333
|
+
"--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
|
|
334
|
+
"--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
|
|
335
|
+
"--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
|
|
336
|
+
"--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
|
|
298
337
|
}
|
|
299
338
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
328
|
-
}
|
|
329
|
-
);
|
|
330
|
-
MenubarItem.displayName = ITEM_NAME;
|
|
331
|
-
var CHECKBOX_ITEM_NAME = "MenubarCheckboxItem";
|
|
332
|
-
var MenubarCheckboxItem = React.forwardRef(
|
|
333
|
-
(props, forwardedRef) => {
|
|
334
|
-
const { __scopeMenubar, ...checkboxItemProps } = props;
|
|
335
|
-
const menuScope = useMenuScope(__scopeMenubar);
|
|
336
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
337
|
-
}
|
|
338
|
-
);
|
|
339
|
-
MenubarCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
340
|
-
var RADIO_GROUP_NAME = "MenubarRadioGroup";
|
|
341
|
-
var MenubarRadioGroup = React.forwardRef(
|
|
342
|
-
(props, forwardedRef) => {
|
|
343
|
-
const { __scopeMenubar, ...radioGroupProps } = props;
|
|
344
|
-
const menuScope = useMenuScope(__scopeMenubar);
|
|
345
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
346
|
-
}
|
|
347
|
-
);
|
|
348
|
-
MenubarRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
349
|
-
var RADIO_ITEM_NAME = "MenubarRadioItem";
|
|
350
|
-
var MenubarRadioItem = React.forwardRef(
|
|
351
|
-
(props, forwardedRef) => {
|
|
352
|
-
const { __scopeMenubar, ...radioItemProps } = props;
|
|
353
|
-
const menuScope = useMenuScope(__scopeMenubar);
|
|
354
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
355
|
-
}
|
|
356
|
-
);
|
|
357
|
-
MenubarRadioItem.displayName = RADIO_ITEM_NAME;
|
|
358
|
-
var INDICATOR_NAME = "MenubarItemIndicator";
|
|
359
|
-
var MenubarItemIndicator = React.forwardRef((props, forwardedRef) => {
|
|
360
|
-
const { __scopeMenubar, ...itemIndicatorProps } = props;
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
);
|
|
343
|
+
MenubarContent.displayName = CONTENT_NAME;
|
|
344
|
+
var GROUP_NAME = "MenubarGroup";
|
|
345
|
+
var MenubarGroup = React.forwardRef(
|
|
346
|
+
(props, forwardedRef) => {
|
|
347
|
+
const { __scopeMenubar, ...groupProps } = props;
|
|
348
|
+
const menuScope = useMenuScope(__scopeMenubar);
|
|
349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef });
|
|
350
|
+
}
|
|
351
|
+
);
|
|
352
|
+
MenubarGroup.displayName = GROUP_NAME;
|
|
353
|
+
var LABEL_NAME = "MenubarLabel";
|
|
354
|
+
var MenubarLabel = React.forwardRef(
|
|
355
|
+
(props, forwardedRef) => {
|
|
356
|
+
const { __scopeMenubar, ...labelProps } = props;
|
|
357
|
+
const menuScope = useMenuScope(__scopeMenubar);
|
|
358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef });
|
|
359
|
+
}
|
|
360
|
+
);
|
|
361
|
+
MenubarLabel.displayName = LABEL_NAME;
|
|
362
|
+
var ITEM_NAME = "MenubarItem";
|
|
363
|
+
var MenubarItem = React.forwardRef(
|
|
364
|
+
(props, forwardedRef) => {
|
|
365
|
+
const { __scopeMenubar, ...itemProps } = props;
|
|
361
366
|
const menuScope = useMenuScope(__scopeMenubar);
|
|
362
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.
|
|
367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
MenubarItem.displayName = ITEM_NAME;
|
|
371
|
+
var CHECKBOX_ITEM_NAME = "MenubarCheckboxItem";
|
|
372
|
+
var MenubarCheckboxItem = React.forwardRef(
|
|
373
|
+
(props, forwardedRef) => {
|
|
374
|
+
const { __scopeMenubar, ...checkboxItemProps } = props;
|
|
375
|
+
const menuScope = useMenuScope(__scopeMenubar);
|
|
376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
377
|
+
}
|
|
378
|
+
);
|
|
379
|
+
MenubarCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
380
|
+
var RADIO_GROUP_NAME = "MenubarRadioGroup";
|
|
381
|
+
var MenubarRadioGroup = React.forwardRef(
|
|
382
|
+
(props, forwardedRef) => {
|
|
383
|
+
const { __scopeMenubar, ...radioGroupProps } = props;
|
|
384
|
+
const menuScope = useMenuScope(__scopeMenubar);
|
|
385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
386
|
+
}
|
|
387
|
+
);
|
|
388
|
+
MenubarRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
389
|
+
var RADIO_ITEM_NAME = "MenubarRadioItem";
|
|
390
|
+
var MenubarRadioItem = React.forwardRef(
|
|
391
|
+
(props, forwardedRef) => {
|
|
392
|
+
const { __scopeMenubar, ...radioItemProps } = props;
|
|
393
|
+
const menuScope = useMenuScope(__scopeMenubar);
|
|
394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
395
|
+
}
|
|
396
|
+
);
|
|
397
|
+
MenubarRadioItem.displayName = RADIO_ITEM_NAME;
|
|
398
|
+
var INDICATOR_NAME = "MenubarItemIndicator";
|
|
399
|
+
var MenubarItemIndicator = React.forwardRef((props, forwardedRef) => {
|
|
400
|
+
const { __scopeMenubar, ...itemIndicatorProps } = props;
|
|
401
|
+
const menuScope = useMenuScope(__scopeMenubar);
|
|
402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
403
|
+
});
|
|
404
|
+
MenubarItemIndicator.displayName = INDICATOR_NAME;
|
|
405
|
+
var SEPARATOR_NAME = "MenubarSeparator";
|
|
406
|
+
var MenubarSeparator = React.forwardRef(
|
|
407
|
+
(props, forwardedRef) => {
|
|
408
|
+
const { __scopeMenubar, ...separatorProps } = props;
|
|
409
|
+
const menuScope = useMenuScope(__scopeMenubar);
|
|
410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
411
|
+
}
|
|
412
|
+
);
|
|
413
|
+
MenubarSeparator.displayName = SEPARATOR_NAME;
|
|
414
|
+
var ARROW_NAME = "MenubarArrow";
|
|
415
|
+
var MenubarArrow = React.forwardRef(
|
|
416
|
+
(props, forwardedRef) => {
|
|
417
|
+
const { __scopeMenubar, ...arrowProps } = props;
|
|
418
|
+
const menuScope = useMenuScope(__scopeMenubar);
|
|
419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef });
|
|
420
|
+
}
|
|
421
|
+
);
|
|
422
|
+
MenubarArrow.displayName = ARROW_NAME;
|
|
423
|
+
var SUB_NAME = "MenubarSub";
|
|
424
|
+
var MenubarSub = (props) => {
|
|
425
|
+
const { __scopeMenubar, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
426
|
+
const menuScope = useMenuScope(__scopeMenubar);
|
|
427
|
+
const [open = false, setOpen] = (0, import_react_use_controllable_state.useControllableState)({
|
|
428
|
+
prop: openProp,
|
|
429
|
+
defaultProp: defaultOpen,
|
|
430
|
+
onChange: onOpenChange
|
|
363
431
|
});
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
);
|
|
373
|
-
MenubarSeparator.displayName = SEPARATOR_NAME;
|
|
374
|
-
var ARROW_NAME = "MenubarArrow";
|
|
375
|
-
var MenubarArrow = React.forwardRef(
|
|
376
|
-
(props, forwardedRef) => {
|
|
377
|
-
const { __scopeMenubar, ...arrowProps } = props;
|
|
378
|
-
const menuScope = useMenuScope(__scopeMenubar);
|
|
379
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef });
|
|
380
|
-
}
|
|
381
|
-
);
|
|
382
|
-
MenubarArrow.displayName = ARROW_NAME;
|
|
383
|
-
var SUB_NAME = "MenubarSub";
|
|
384
|
-
var MenubarSub = (props) => {
|
|
385
|
-
const { __scopeMenubar, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
433
|
+
};
|
|
434
|
+
MenubarSub.displayName = SUB_NAME;
|
|
435
|
+
var SUB_TRIGGER_NAME = "MenubarSubTrigger";
|
|
436
|
+
var MenubarSubTrigger = React.forwardRef(
|
|
437
|
+
(props, forwardedRef) => {
|
|
438
|
+
const { __scopeMenubar, ...subTriggerProps } = props;
|
|
386
439
|
const menuScope = useMenuScope(__scopeMenubar);
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
...menuScope,
|
|
421
|
-
"data-radix-menubar-content": "",
|
|
422
|
-
...subContentProps,
|
|
423
|
-
ref: forwardedRef,
|
|
424
|
-
style: {
|
|
425
|
-
...props.style,
|
|
426
|
-
// re-namespace exposed content custom properties
|
|
427
|
-
...{
|
|
428
|
-
"--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
429
|
-
"--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
|
|
430
|
-
"--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
|
|
431
|
-
"--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
|
|
432
|
-
"--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
|
|
433
|
-
}
|
|
440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
441
|
+
MenuPrimitive.SubTrigger,
|
|
442
|
+
{
|
|
443
|
+
"data-radix-menubar-subtrigger": "",
|
|
444
|
+
...menuScope,
|
|
445
|
+
...subTriggerProps,
|
|
446
|
+
ref: forwardedRef
|
|
447
|
+
}
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
);
|
|
451
|
+
MenubarSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
452
|
+
var SUB_CONTENT_NAME = "MenubarSubContent";
|
|
453
|
+
var MenubarSubContent = React.forwardRef(
|
|
454
|
+
(props, forwardedRef) => {
|
|
455
|
+
const { __scopeMenubar, ...subContentProps } = props;
|
|
456
|
+
const menuScope = useMenuScope(__scopeMenubar);
|
|
457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
458
|
+
MenuPrimitive.SubContent,
|
|
459
|
+
{
|
|
460
|
+
...menuScope,
|
|
461
|
+
"data-radix-menubar-content": "",
|
|
462
|
+
...subContentProps,
|
|
463
|
+
ref: forwardedRef,
|
|
464
|
+
style: {
|
|
465
|
+
...props.style,
|
|
466
|
+
// re-namespace exposed content custom properties
|
|
467
|
+
...{
|
|
468
|
+
"--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
469
|
+
"--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
|
|
470
|
+
"--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
|
|
471
|
+
"--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
|
|
472
|
+
"--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
|
|
434
473
|
}
|
|
435
474
|
}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
);
|
|
439
|
-
MenubarSubContent.displayName = SUB_CONTENT_NAME;
|
|
440
|
-
function wrapArray(array, startIndex) {
|
|
441
|
-
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
475
|
+
}
|
|
476
|
+
);
|
|
442
477
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
478
|
+
);
|
|
479
|
+
MenubarSubContent.displayName = SUB_CONTENT_NAME;
|
|
480
|
+
function wrapArray(array, startIndex) {
|
|
481
|
+
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
482
|
+
}
|
|
483
|
+
var Root3 = Menubar;
|
|
484
|
+
var Menu = MenubarMenu;
|
|
485
|
+
var Trigger = MenubarTrigger;
|
|
486
|
+
var Portal2 = MenubarPortal;
|
|
487
|
+
var Content2 = MenubarContent;
|
|
488
|
+
var Group2 = MenubarGroup;
|
|
489
|
+
var Label2 = MenubarLabel;
|
|
490
|
+
var Item3 = MenubarItem;
|
|
491
|
+
var CheckboxItem2 = MenubarCheckboxItem;
|
|
492
|
+
var RadioGroup2 = MenubarRadioGroup;
|
|
493
|
+
var RadioItem2 = MenubarRadioItem;
|
|
494
|
+
var ItemIndicator2 = MenubarItemIndicator;
|
|
495
|
+
var Separator2 = MenubarSeparator;
|
|
496
|
+
var Arrow2 = MenubarArrow;
|
|
497
|
+
var Sub2 = MenubarSub;
|
|
498
|
+
var SubTrigger2 = MenubarSubTrigger;
|
|
499
|
+
var SubContent2 = MenubarSubContent;
|
|
461
500
|
//# sourceMappingURL=index.js.map
|