@radix-ui/react-dropdown-menu 2.0.7-rc.8 → 2.1.0-rc.1
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.d.mts +83 -71
- package/dist/index.d.ts +83 -71
- package/dist/index.js +279 -365
- package/dist/index.js.map +7 -1
- package/dist/index.mjs +277 -321
- package/dist/index.mjs.map +7 -1
- package/package.json +8 -9
- package/dist/index.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,384 +1,298 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
1
|
+
"use strict";
|
|
2
|
+
(() => {
|
|
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 __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
10
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
11
|
+
}) : x)(function(x) {
|
|
12
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
13
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
14
|
+
});
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
10
31
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
$parcel$export(module.exports, "ItemIndicator", () => $d1bf075a6b218014$export$c3468e2714d175fa);
|
|
46
|
-
$parcel$export(module.exports, "Separator", () => $d1bf075a6b218014$export$1ff3c3f08ae963c0);
|
|
47
|
-
$parcel$export(module.exports, "Arrow", () => $d1bf075a6b218014$export$21b07c8f274aebd5);
|
|
48
|
-
$parcel$export(module.exports, "Sub", () => $d1bf075a6b218014$export$d7a01e11500dfb6f);
|
|
49
|
-
$parcel$export(module.exports, "SubTrigger", () => $d1bf075a6b218014$export$2ea8a7a591ac5eac);
|
|
50
|
-
$parcel$export(module.exports, "SubContent", () => $d1bf075a6b218014$export$6d4de93b380beddf);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/* -------------------------------------------------------------------------------------------------
|
|
62
|
-
* DropdownMenu
|
|
63
|
-
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$DROPDOWN_MENU_NAME = 'DropdownMenu';
|
|
64
|
-
const [$d1bf075a6b218014$var$createDropdownMenuContext, $d1bf075a6b218014$export$c0623cd925aeb687] = $7dQ7Q$radixuireactcontext.createContextScope($d1bf075a6b218014$var$DROPDOWN_MENU_NAME, [
|
|
65
|
-
$7dQ7Q$radixuireactmenu.createMenuScope
|
|
66
|
-
]);
|
|
67
|
-
const $d1bf075a6b218014$var$useMenuScope = $7dQ7Q$radixuireactmenu.createMenuScope();
|
|
68
|
-
const [$d1bf075a6b218014$var$DropdownMenuProvider, $d1bf075a6b218014$var$useDropdownMenuContext] = $d1bf075a6b218014$var$createDropdownMenuContext($d1bf075a6b218014$var$DROPDOWN_MENU_NAME);
|
|
69
|
-
const $d1bf075a6b218014$export$e44a253a59704894 = (props)=>{
|
|
70
|
-
const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , dir: dir , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props;
|
|
71
|
-
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
72
|
-
const triggerRef = $7dQ7Q$react.useRef(null);
|
|
73
|
-
const [open = false, setOpen] = $7dQ7Q$radixuireactusecontrollablestate.useControllableState({
|
|
74
|
-
prop: openProp,
|
|
75
|
-
defaultProp: defaultOpen,
|
|
76
|
-
onChange: onOpenChange
|
|
32
|
+
// packages/react/dropdown-menu/src/DropdownMenu.tsx
|
|
33
|
+
var React = __toESM(__require("react"));
|
|
34
|
+
var import_primitive = __require("@radix-ui/primitive");
|
|
35
|
+
var import_react_compose_refs = __require("@radix-ui/react-compose-refs");
|
|
36
|
+
var import_react_context = __require("@radix-ui/react-context");
|
|
37
|
+
var import_react_use_controllable_state = __require("@radix-ui/react-use-controllable-state");
|
|
38
|
+
var import_react_primitive = __require("@radix-ui/react-primitive");
|
|
39
|
+
var MenuPrimitive = __toESM(__require("@radix-ui/react-menu"));
|
|
40
|
+
var import_react_menu = __require("@radix-ui/react-menu");
|
|
41
|
+
var import_react_id = __require("@radix-ui/react-id");
|
|
42
|
+
var import_jsx_runtime = __require("react/jsx-runtime");
|
|
43
|
+
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
44
|
+
var [createDropdownMenuContext, createDropdownMenuScope] = (0, import_react_context.createContextScope)(
|
|
45
|
+
DROPDOWN_MENU_NAME,
|
|
46
|
+
[import_react_menu.createMenuScope]
|
|
47
|
+
);
|
|
48
|
+
var useMenuScope = (0, import_react_menu.createMenuScope)();
|
|
49
|
+
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
50
|
+
var DropdownMenu = (props) => {
|
|
51
|
+
const {
|
|
52
|
+
__scopeDropdownMenu,
|
|
53
|
+
children,
|
|
54
|
+
dir,
|
|
55
|
+
open: openProp,
|
|
56
|
+
defaultOpen,
|
|
57
|
+
onOpenChange,
|
|
58
|
+
modal = true
|
|
59
|
+
} = props;
|
|
60
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
61
|
+
const triggerRef = React.useRef(null);
|
|
62
|
+
const [open = false, setOpen] = (0, import_react_use_controllable_state.useControllableState)({
|
|
63
|
+
prop: openProp,
|
|
64
|
+
defaultProp: defaultOpen,
|
|
65
|
+
onChange: onOpenChange
|
|
77
66
|
});
|
|
78
|
-
return
|
|
67
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
DropdownMenuProvider,
|
|
69
|
+
{
|
|
79
70
|
scope: __scopeDropdownMenu,
|
|
80
|
-
triggerId:
|
|
81
|
-
triggerRef
|
|
82
|
-
contentId:
|
|
83
|
-
open
|
|
71
|
+
triggerId: (0, import_react_id.useId)(),
|
|
72
|
+
triggerRef,
|
|
73
|
+
contentId: (0, import_react_id.useId)(),
|
|
74
|
+
open,
|
|
84
75
|
onOpenChange: setOpen,
|
|
85
|
-
onOpenToggle:
|
|
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
|
-
id: context.triggerId,
|
|
113
|
-
"aria-haspopup": "menu",
|
|
114
|
-
"aria-expanded": context.open,
|
|
115
|
-
"aria-controls": context.open ? context.contentId : undefined,
|
|
116
|
-
"data-state": context.open ? 'open' : 'closed',
|
|
117
|
-
"data-disabled": disabled ? '' : undefined,
|
|
118
|
-
disabled: disabled
|
|
119
|
-
}, triggerProps, {
|
|
120
|
-
ref: $7dQ7Q$radixuireactcomposerefs.composeRefs(forwardedRef, context.triggerRef),
|
|
121
|
-
onPointerDown: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onPointerDown, (event)=>{
|
|
122
|
-
// only call handler if it's the left button (mousedown gets triggered by all mouse buttons)
|
|
123
|
-
// but not when the control key is pressed (avoiding MacOS right click)
|
|
76
|
+
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
77
|
+
modal,
|
|
78
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Root, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
DropdownMenu.displayName = DROPDOWN_MENU_NAME;
|
|
83
|
+
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
84
|
+
var DropdownMenuTrigger = React.forwardRef(
|
|
85
|
+
(props, forwardedRef) => {
|
|
86
|
+
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
87
|
+
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
88
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
89
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Anchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
+
import_react_primitive.Primitive.button,
|
|
91
|
+
{
|
|
92
|
+
type: "button",
|
|
93
|
+
id: context.triggerId,
|
|
94
|
+
"aria-haspopup": "menu",
|
|
95
|
+
"aria-expanded": context.open,
|
|
96
|
+
"aria-controls": context.open ? context.contentId : void 0,
|
|
97
|
+
"data-state": context.open ? "open" : "closed",
|
|
98
|
+
"data-disabled": disabled ? "" : void 0,
|
|
99
|
+
disabled,
|
|
100
|
+
...triggerProps,
|
|
101
|
+
ref: (0, import_react_compose_refs.composeRefs)(forwardedRef, context.triggerRef),
|
|
102
|
+
onPointerDown: (0, import_primitive.composeEventHandlers)(props.onPointerDown, (event) => {
|
|
124
103
|
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (!context.open) event.preventDefault();
|
|
104
|
+
context.onOpenToggle();
|
|
105
|
+
if (!context.open) event.preventDefault();
|
|
128
106
|
}
|
|
129
|
-
|
|
130
|
-
|
|
107
|
+
}),
|
|
108
|
+
onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => {
|
|
131
109
|
if (disabled) return;
|
|
132
|
-
if ([
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
167
|
-
const hasInteractedOutsideRef = $7dQ7Q$react.useRef(false);
|
|
168
|
-
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Content, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({
|
|
169
|
-
id: context.contentId,
|
|
170
|
-
"aria-labelledby": context.triggerId
|
|
171
|
-
}, menuScope, contentProps, {
|
|
172
|
-
ref: forwardedRef,
|
|
173
|
-
onCloseAutoFocus: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onCloseAutoFocus, (event)=>{
|
|
174
|
-
var _context$triggerRef$c;
|
|
175
|
-
if (!hasInteractedOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
176
|
-
hasInteractedOutsideRef.current = false; // Always prevent auto focus because we either focus manually or want user agent focus
|
|
110
|
+
if (["Enter", " "].includes(event.key)) context.onOpenToggle();
|
|
111
|
+
if (event.key === "ArrowDown") context.onOpenChange(true);
|
|
112
|
+
if (["Enter", " ", "ArrowDown"].includes(event.key)) event.preventDefault();
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
) });
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
DropdownMenuTrigger.displayName = TRIGGER_NAME;
|
|
119
|
+
var PORTAL_NAME = "DropdownMenuPortal";
|
|
120
|
+
var DropdownMenuPortal = (props) => {
|
|
121
|
+
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
122
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Portal, { ...menuScope, ...portalProps });
|
|
124
|
+
};
|
|
125
|
+
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
126
|
+
var CONTENT_NAME = "DropdownMenuContent";
|
|
127
|
+
var DropdownMenuContent = React.forwardRef(
|
|
128
|
+
(props, forwardedRef) => {
|
|
129
|
+
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
130
|
+
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
131
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
132
|
+
const hasInteractedOutsideRef = React.useRef(false);
|
|
133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
134
|
+
MenuPrimitive.Content,
|
|
135
|
+
{
|
|
136
|
+
id: context.contentId,
|
|
137
|
+
"aria-labelledby": context.triggerId,
|
|
138
|
+
...menuScope,
|
|
139
|
+
...contentProps,
|
|
140
|
+
ref: forwardedRef,
|
|
141
|
+
onCloseAutoFocus: (0, import_primitive.composeEventHandlers)(props.onCloseAutoFocus, (event) => {
|
|
142
|
+
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
143
|
+
hasInteractedOutsideRef.current = false;
|
|
177
144
|
event.preventDefault();
|
|
178
|
-
|
|
179
|
-
|
|
145
|
+
}),
|
|
146
|
+
onInteractOutside: (0, import_primitive.composeEventHandlers)(props.onInteractOutside, (event) => {
|
|
180
147
|
const originalEvent = event.detail.originalEvent;
|
|
181
148
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
182
149
|
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
183
150
|
if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;
|
|
184
|
-
|
|
185
|
-
|
|
151
|
+
}),
|
|
152
|
+
style: {
|
|
186
153
|
...props.style,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
154
|
+
// re-namespace exposed content custom properties
|
|
155
|
+
...{
|
|
156
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
157
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
158
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
159
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
160
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
192
163
|
}
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
/*
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
const { __scopeDropdownMenu
|
|
255
|
-
const menuScope =
|
|
256
|
-
return
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
});
|
|
276
|
-
/* -------------------------------------------------------------------------------------------------
|
|
277
|
-
* DropdownMenuItemIndicator
|
|
278
|
-
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$INDICATOR_NAME = 'DropdownMenuItemIndicator';
|
|
279
|
-
const $d1bf075a6b218014$export$42355ae145153fb6 = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
280
|
-
const { __scopeDropdownMenu: __scopeDropdownMenu , ...itemIndicatorProps } = props;
|
|
281
|
-
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
282
|
-
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.ItemIndicator, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, itemIndicatorProps, {
|
|
283
|
-
ref: forwardedRef
|
|
284
|
-
}));
|
|
285
|
-
});
|
|
286
|
-
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$42355ae145153fb6, {
|
|
287
|
-
displayName: $d1bf075a6b218014$var$INDICATOR_NAME
|
|
288
|
-
});
|
|
289
|
-
/* -------------------------------------------------------------------------------------------------
|
|
290
|
-
* DropdownMenuSeparator
|
|
291
|
-
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$SEPARATOR_NAME = 'DropdownMenuSeparator';
|
|
292
|
-
const $d1bf075a6b218014$export$da160178fd3bc7e9 = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
293
|
-
const { __scopeDropdownMenu: __scopeDropdownMenu , ...separatorProps } = props;
|
|
294
|
-
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
295
|
-
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Separator, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, separatorProps, {
|
|
296
|
-
ref: forwardedRef
|
|
297
|
-
}));
|
|
298
|
-
});
|
|
299
|
-
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$da160178fd3bc7e9, {
|
|
300
|
-
displayName: $d1bf075a6b218014$var$SEPARATOR_NAME
|
|
301
|
-
});
|
|
302
|
-
/* -------------------------------------------------------------------------------------------------
|
|
303
|
-
* DropdownMenuArrow
|
|
304
|
-
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$ARROW_NAME = 'DropdownMenuArrow';
|
|
305
|
-
const $d1bf075a6b218014$export$34b8980744021ec5 = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
306
|
-
const { __scopeDropdownMenu: __scopeDropdownMenu , ...arrowProps } = props;
|
|
307
|
-
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
308
|
-
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Arrow, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, arrowProps, {
|
|
309
|
-
ref: forwardedRef
|
|
310
|
-
}));
|
|
311
|
-
});
|
|
312
|
-
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$34b8980744021ec5, {
|
|
313
|
-
displayName: $d1bf075a6b218014$var$ARROW_NAME
|
|
314
|
-
});
|
|
315
|
-
/* -------------------------------------------------------------------------------------------------
|
|
316
|
-
* DropdownMenuSub
|
|
317
|
-
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$export$2f307d81a64f5442 = (props)=>{
|
|
318
|
-
const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , open: openProp , onOpenChange: onOpenChange , defaultOpen: defaultOpen } = props;
|
|
319
|
-
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
320
|
-
const [open = false, setOpen] = $7dQ7Q$radixuireactusecontrollablestate.useControllableState({
|
|
321
|
-
prop: openProp,
|
|
322
|
-
defaultProp: defaultOpen,
|
|
323
|
-
onChange: onOpenChange
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
168
|
+
var GROUP_NAME = "DropdownMenuGroup";
|
|
169
|
+
var DropdownMenuGroup = React.forwardRef(
|
|
170
|
+
(props, forwardedRef) => {
|
|
171
|
+
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
172
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef });
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
177
|
+
var LABEL_NAME = "DropdownMenuLabel";
|
|
178
|
+
var DropdownMenuLabel = React.forwardRef(
|
|
179
|
+
(props, forwardedRef) => {
|
|
180
|
+
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
181
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef });
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
DropdownMenuLabel.displayName = LABEL_NAME;
|
|
186
|
+
var ITEM_NAME = "DropdownMenuItem";
|
|
187
|
+
var DropdownMenuItem = React.forwardRef(
|
|
188
|
+
(props, forwardedRef) => {
|
|
189
|
+
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
190
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
DropdownMenuItem.displayName = ITEM_NAME;
|
|
195
|
+
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
196
|
+
var DropdownMenuCheckboxItem = React.forwardRef((props, forwardedRef) => {
|
|
197
|
+
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
198
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
200
|
+
});
|
|
201
|
+
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
202
|
+
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
203
|
+
var DropdownMenuRadioGroup = React.forwardRef((props, forwardedRef) => {
|
|
204
|
+
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
205
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
207
|
+
});
|
|
208
|
+
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
209
|
+
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
210
|
+
var DropdownMenuRadioItem = React.forwardRef((props, forwardedRef) => {
|
|
211
|
+
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
212
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
214
|
+
});
|
|
215
|
+
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
216
|
+
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
217
|
+
var DropdownMenuItemIndicator = React.forwardRef((props, forwardedRef) => {
|
|
218
|
+
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
219
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
221
|
+
});
|
|
222
|
+
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
223
|
+
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
224
|
+
var DropdownMenuSeparator = React.forwardRef((props, forwardedRef) => {
|
|
225
|
+
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
226
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
228
|
+
});
|
|
229
|
+
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
230
|
+
var ARROW_NAME = "DropdownMenuArrow";
|
|
231
|
+
var DropdownMenuArrow = React.forwardRef(
|
|
232
|
+
(props, forwardedRef) => {
|
|
233
|
+
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
234
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef });
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
DropdownMenuArrow.displayName = ARROW_NAME;
|
|
239
|
+
var DropdownMenuSub = (props) => {
|
|
240
|
+
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
241
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
242
|
+
const [open = false, setOpen] = (0, import_react_use_controllable_state.useControllableState)({
|
|
243
|
+
prop: openProp,
|
|
244
|
+
defaultProp: defaultOpen,
|
|
245
|
+
onChange: onOpenChange
|
|
324
246
|
});
|
|
325
|
-
return
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
/* -------------------------------------------------------------------------------------------------
|
|
344
|
-
* DropdownMenuSubContent
|
|
345
|
-
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$SUB_CONTENT_NAME = 'DropdownMenuSubContent';
|
|
346
|
-
const $d1bf075a6b218014$export$f34ec8bc2482cc5f = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
347
|
-
const { __scopeDropdownMenu: __scopeDropdownMenu , ...subContentProps } = props;
|
|
348
|
-
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
349
|
-
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.SubContent, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, subContentProps, {
|
|
247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
248
|
+
};
|
|
249
|
+
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
250
|
+
var DropdownMenuSubTrigger = React.forwardRef((props, forwardedRef) => {
|
|
251
|
+
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
252
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
254
|
+
});
|
|
255
|
+
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
256
|
+
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
257
|
+
var DropdownMenuSubContent = React.forwardRef((props, forwardedRef) => {
|
|
258
|
+
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
259
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
261
|
+
MenuPrimitive.SubContent,
|
|
262
|
+
{
|
|
263
|
+
...menuScope,
|
|
264
|
+
...subContentProps,
|
|
350
265
|
ref: forwardedRef,
|
|
351
266
|
style: {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
267
|
+
...props.style,
|
|
268
|
+
// re-namespace exposed content custom properties
|
|
269
|
+
...{
|
|
270
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
271
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
272
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
273
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
274
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
275
|
+
}
|
|
358
276
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
});
|
|
280
|
+
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
281
|
+
var Root2 = DropdownMenu;
|
|
282
|
+
var Trigger = DropdownMenuTrigger;
|
|
283
|
+
var Portal2 = DropdownMenuPortal;
|
|
284
|
+
var Content2 = DropdownMenuContent;
|
|
285
|
+
var Group2 = DropdownMenuGroup;
|
|
286
|
+
var Label2 = DropdownMenuLabel;
|
|
287
|
+
var Item2 = DropdownMenuItem;
|
|
288
|
+
var CheckboxItem2 = DropdownMenuCheckboxItem;
|
|
289
|
+
var RadioGroup2 = DropdownMenuRadioGroup;
|
|
290
|
+
var RadioItem2 = DropdownMenuRadioItem;
|
|
291
|
+
var ItemIndicator2 = DropdownMenuItemIndicator;
|
|
292
|
+
var Separator2 = DropdownMenuSeparator;
|
|
293
|
+
var Arrow2 = DropdownMenuArrow;
|
|
294
|
+
var Sub2 = DropdownMenuSub;
|
|
295
|
+
var SubTrigger2 = DropdownMenuSubTrigger;
|
|
296
|
+
var SubContent2 = DropdownMenuSubContent;
|
|
297
|
+
})();
|
|
384
298
|
//# sourceMappingURL=index.js.map
|