@radix-ui/react-dropdown-menu 2.0.7-rc.9 → 2.1.0-rc.2
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 +280 -365
- package/dist/index.js.map +7 -1
- package/dist/index.mjs +278 -320
- package/dist/index.mjs.map +7 -1
- package/package.json +8 -9
- package/dist/index.d.ts.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,345 +1,303 @@
|
|
|
1
|
-
|
|
2
|
-
import {useRef as $9kmUS$useRef, createElement as $9kmUS$createElement, useCallback as $9kmUS$useCallback, forwardRef as $9kmUS$forwardRef} from "react";
|
|
3
|
-
import {composeEventHandlers as $9kmUS$composeEventHandlers} from "@radix-ui/primitive";
|
|
4
|
-
import {composeRefs as $9kmUS$composeRefs} from "@radix-ui/react-compose-refs";
|
|
5
|
-
import {createContextScope as $9kmUS$createContextScope} from "@radix-ui/react-context";
|
|
6
|
-
import {useControllableState as $9kmUS$useControllableState} from "@radix-ui/react-use-controllable-state";
|
|
7
|
-
import {Primitive as $9kmUS$Primitive} from "@radix-ui/react-primitive";
|
|
8
|
-
import {createMenuScope as $9kmUS$createMenuScope, Root as $9kmUS$Root, Anchor as $9kmUS$Anchor, Portal as $9kmUS$Portal, Content as $9kmUS$Content, Group as $9kmUS$Group, Label as $9kmUS$Label, Item as $9kmUS$Item, CheckboxItem as $9kmUS$CheckboxItem, RadioGroup as $9kmUS$RadioGroup, RadioItem as $9kmUS$RadioItem, ItemIndicator as $9kmUS$ItemIndicator, Separator as $9kmUS$Separator, Arrow as $9kmUS$Arrow, Sub as $9kmUS$Sub, SubTrigger as $9kmUS$SubTrigger, SubContent as $9kmUS$SubContent} from "@radix-ui/react-menu";
|
|
9
|
-
import {useId as $9kmUS$useId} from "@radix-ui/react-id";
|
|
1
|
+
"use client";
|
|
10
2
|
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
3
|
+
// packages/react/dropdown-menu/src/DropdownMenu.tsx
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
6
|
+
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
7
|
+
import { createContextScope } from "@radix-ui/react-context";
|
|
8
|
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
9
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
10
|
+
import * as MenuPrimitive from "@radix-ui/react-menu";
|
|
11
|
+
import { createMenuScope } from "@radix-ui/react-menu";
|
|
12
|
+
import { useId } from "@radix-ui/react-id";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
15
|
+
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(
|
|
16
|
+
DROPDOWN_MENU_NAME,
|
|
17
|
+
[createMenuScope]
|
|
18
|
+
);
|
|
19
|
+
var useMenuScope = createMenuScope();
|
|
20
|
+
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
21
|
+
var DropdownMenu = (props) => {
|
|
22
|
+
const {
|
|
23
|
+
__scopeDropdownMenu,
|
|
24
|
+
children,
|
|
25
|
+
dir,
|
|
26
|
+
open: openProp,
|
|
27
|
+
defaultOpen,
|
|
28
|
+
onOpenChange,
|
|
29
|
+
modal = true
|
|
30
|
+
} = props;
|
|
31
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
32
|
+
const triggerRef = React.useRef(null);
|
|
33
|
+
const [open = false, setOpen] = useControllableState({
|
|
34
|
+
prop: openProp,
|
|
35
|
+
defaultProp: defaultOpen,
|
|
36
|
+
onChange: onOpenChange
|
|
37
|
+
});
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
DropdownMenuProvider,
|
|
40
|
+
{
|
|
41
|
+
scope: __scopeDropdownMenu,
|
|
42
|
+
triggerId: useId(),
|
|
43
|
+
triggerRef,
|
|
44
|
+
contentId: useId(),
|
|
45
|
+
open,
|
|
46
|
+
onOpenChange: setOpen,
|
|
47
|
+
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
48
|
+
modal,
|
|
49
|
+
children: /* @__PURE__ */ jsx(MenuPrimitive.Root, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
50
|
+
}
|
|
51
|
+
);
|
|
57
52
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$Anchor, $9kmUS$babelruntimehelpersesmextends({
|
|
69
|
-
asChild: true
|
|
70
|
-
}, menuScope), /*#__PURE__*/ $9kmUS$createElement($9kmUS$Primitive.button, $9kmUS$babelruntimehelpersesmextends({
|
|
53
|
+
DropdownMenu.displayName = DROPDOWN_MENU_NAME;
|
|
54
|
+
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
55
|
+
var DropdownMenuTrigger = React.forwardRef(
|
|
56
|
+
(props, forwardedRef) => {
|
|
57
|
+
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
58
|
+
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
59
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
60
|
+
return /* @__PURE__ */ jsx(MenuPrimitive.Anchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx(
|
|
61
|
+
Primitive.button,
|
|
62
|
+
{
|
|
71
63
|
type: "button",
|
|
72
64
|
id: context.triggerId,
|
|
73
65
|
"aria-haspopup": "menu",
|
|
74
66
|
"aria-expanded": context.open,
|
|
75
|
-
"aria-controls": context.open ? context.contentId :
|
|
76
|
-
"data-state": context.open ?
|
|
77
|
-
"data-disabled": disabled ?
|
|
78
|
-
disabled
|
|
79
|
-
|
|
80
|
-
ref:
|
|
81
|
-
onPointerDown:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (!
|
|
85
|
-
|
|
86
|
-
// this allows the content to be given focus without competition
|
|
87
|
-
if (!context.open) event.preventDefault();
|
|
88
|
-
}
|
|
67
|
+
"aria-controls": context.open ? context.contentId : void 0,
|
|
68
|
+
"data-state": context.open ? "open" : "closed",
|
|
69
|
+
"data-disabled": disabled ? "" : void 0,
|
|
70
|
+
disabled,
|
|
71
|
+
...triggerProps,
|
|
72
|
+
ref: composeRefs(forwardedRef, context.triggerRef),
|
|
73
|
+
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
|
|
74
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
75
|
+
context.onOpenToggle();
|
|
76
|
+
if (!context.open) event.preventDefault();
|
|
77
|
+
}
|
|
89
78
|
}),
|
|
90
|
-
onKeyDown:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
].includes(event.key)) context.onOpenToggle();
|
|
96
|
-
if (event.key === 'ArrowDown') context.onOpenChange(true); // prevent keydown from scrolling window / first focused item to execute
|
|
97
|
-
// that keydown (inadvertently closing the menu)
|
|
98
|
-
if ([
|
|
99
|
-
'Enter',
|
|
100
|
-
' ',
|
|
101
|
-
'ArrowDown'
|
|
102
|
-
].includes(event.key)) event.preventDefault();
|
|
79
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
80
|
+
if (disabled) return;
|
|
81
|
+
if (["Enter", " "].includes(event.key)) context.onOpenToggle();
|
|
82
|
+
if (event.key === "ArrowDown") context.onOpenChange(true);
|
|
83
|
+
if (["Enter", " ", "ArrowDown"].includes(event.key)) event.preventDefault();
|
|
103
84
|
})
|
|
104
|
-
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
115
|
-
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$Portal, $9kmUS$babelruntimehelpersesmextends({}, menuScope, portalProps));
|
|
85
|
+
}
|
|
86
|
+
) });
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
DropdownMenuTrigger.displayName = TRIGGER_NAME;
|
|
90
|
+
var PORTAL_NAME = "DropdownMenuPortal";
|
|
91
|
+
var DropdownMenuPortal = (props) => {
|
|
92
|
+
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
93
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
94
|
+
return /* @__PURE__ */ jsx(MenuPrimitive.Portal, { ...menuScope, ...portalProps });
|
|
116
95
|
};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$Content, $9kmUS$babelruntimehelpersesmextends({
|
|
96
|
+
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
97
|
+
var CONTENT_NAME = "DropdownMenuContent";
|
|
98
|
+
var DropdownMenuContent = React.forwardRef(
|
|
99
|
+
(props, forwardedRef) => {
|
|
100
|
+
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
101
|
+
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
102
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
103
|
+
const hasInteractedOutsideRef = React.useRef(false);
|
|
104
|
+
return /* @__PURE__ */ jsx(
|
|
105
|
+
MenuPrimitive.Content,
|
|
106
|
+
{
|
|
129
107
|
id: context.contentId,
|
|
130
|
-
"aria-labelledby": context.triggerId
|
|
131
|
-
|
|
108
|
+
"aria-labelledby": context.triggerId,
|
|
109
|
+
...menuScope,
|
|
110
|
+
...contentProps,
|
|
132
111
|
ref: forwardedRef,
|
|
133
|
-
onCloseAutoFocus:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
event.preventDefault();
|
|
112
|
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
113
|
+
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
114
|
+
hasInteractedOutsideRef.current = false;
|
|
115
|
+
event.preventDefault();
|
|
138
116
|
}),
|
|
139
|
-
onInteractOutside:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
117
|
+
onInteractOutside: composeEventHandlers(props.onInteractOutside, (event) => {
|
|
118
|
+
const originalEvent = event.detail.originalEvent;
|
|
119
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
120
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
121
|
+
if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;
|
|
144
122
|
}),
|
|
145
123
|
style: {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
124
|
+
...props.style,
|
|
125
|
+
// re-namespace exposed content custom properties
|
|
126
|
+
...{
|
|
127
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
128
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
129
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
130
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
131
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
132
|
+
}
|
|
152
133
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
139
|
+
var GROUP_NAME = "DropdownMenuGroup";
|
|
140
|
+
var DropdownMenuGroup = React.forwardRef(
|
|
141
|
+
(props, forwardedRef) => {
|
|
142
|
+
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
143
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
144
|
+
return /* @__PURE__ */ jsx(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef });
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
148
|
+
var LABEL_NAME = "DropdownMenuLabel";
|
|
149
|
+
var DropdownMenuLabel = React.forwardRef(
|
|
150
|
+
(props, forwardedRef) => {
|
|
151
|
+
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
152
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
153
|
+
return /* @__PURE__ */ jsx(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef });
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
DropdownMenuLabel.displayName = LABEL_NAME;
|
|
157
|
+
var ITEM_NAME = "DropdownMenuItem";
|
|
158
|
+
var DropdownMenuItem = React.forwardRef(
|
|
159
|
+
(props, forwardedRef) => {
|
|
160
|
+
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
161
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
162
|
+
return /* @__PURE__ */ jsx(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
DropdownMenuItem.displayName = ITEM_NAME;
|
|
166
|
+
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
167
|
+
var DropdownMenuCheckboxItem = React.forwardRef((props, forwardedRef) => {
|
|
168
|
+
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
169
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
170
|
+
return /* @__PURE__ */ jsx(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
183
171
|
});
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$Item, $9kmUS$babelruntimehelpersesmextends({}, menuScope, itemProps, {
|
|
191
|
-
ref: forwardedRef
|
|
192
|
-
}));
|
|
172
|
+
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
173
|
+
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
174
|
+
var DropdownMenuRadioGroup = React.forwardRef((props, forwardedRef) => {
|
|
175
|
+
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
176
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
177
|
+
return /* @__PURE__ */ jsx(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
193
178
|
});
|
|
194
|
-
|
|
195
|
-
|
|
179
|
+
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
180
|
+
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
181
|
+
var DropdownMenuRadioItem = React.forwardRef((props, forwardedRef) => {
|
|
182
|
+
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
183
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
184
|
+
return /* @__PURE__ */ jsx(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
196
185
|
});
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$CheckboxItem, $9kmUS$babelruntimehelpersesmextends({}, menuScope, checkboxItemProps, {
|
|
204
|
-
ref: forwardedRef
|
|
205
|
-
}));
|
|
186
|
+
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
187
|
+
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
188
|
+
var DropdownMenuItemIndicator = React.forwardRef((props, forwardedRef) => {
|
|
189
|
+
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
190
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
191
|
+
return /* @__PURE__ */ jsx(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
206
192
|
});
|
|
207
|
-
|
|
208
|
-
|
|
193
|
+
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
194
|
+
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
195
|
+
var DropdownMenuSeparator = React.forwardRef((props, forwardedRef) => {
|
|
196
|
+
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
197
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
198
|
+
return /* @__PURE__ */ jsx(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
209
199
|
});
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
const { __scopeDropdownMenu
|
|
215
|
-
const menuScope =
|
|
216
|
-
return
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$RadioItem, $9kmUS$babelruntimehelpersesmextends({}, menuScope, radioItemProps, {
|
|
230
|
-
ref: forwardedRef
|
|
231
|
-
}));
|
|
232
|
-
});
|
|
233
|
-
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$e4f69b41b1637536, {
|
|
234
|
-
displayName: $d08ef79370b62062$var$RADIO_ITEM_NAME
|
|
235
|
-
});
|
|
236
|
-
/* -------------------------------------------------------------------------------------------------
|
|
237
|
-
* DropdownMenuItemIndicator
|
|
238
|
-
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$INDICATOR_NAME = 'DropdownMenuItemIndicator';
|
|
239
|
-
const $d08ef79370b62062$export$42355ae145153fb6 = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
240
|
-
const { __scopeDropdownMenu: __scopeDropdownMenu , ...itemIndicatorProps } = props;
|
|
241
|
-
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
242
|
-
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$ItemIndicator, $9kmUS$babelruntimehelpersesmextends({}, menuScope, itemIndicatorProps, {
|
|
243
|
-
ref: forwardedRef
|
|
244
|
-
}));
|
|
245
|
-
});
|
|
246
|
-
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$42355ae145153fb6, {
|
|
247
|
-
displayName: $d08ef79370b62062$var$INDICATOR_NAME
|
|
248
|
-
});
|
|
249
|
-
/* -------------------------------------------------------------------------------------------------
|
|
250
|
-
* DropdownMenuSeparator
|
|
251
|
-
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$SEPARATOR_NAME = 'DropdownMenuSeparator';
|
|
252
|
-
const $d08ef79370b62062$export$da160178fd3bc7e9 = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
253
|
-
const { __scopeDropdownMenu: __scopeDropdownMenu , ...separatorProps } = props;
|
|
254
|
-
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
255
|
-
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$Separator, $9kmUS$babelruntimehelpersesmextends({}, menuScope, separatorProps, {
|
|
256
|
-
ref: forwardedRef
|
|
257
|
-
}));
|
|
258
|
-
});
|
|
259
|
-
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$da160178fd3bc7e9, {
|
|
260
|
-
displayName: $d08ef79370b62062$var$SEPARATOR_NAME
|
|
261
|
-
});
|
|
262
|
-
/* -------------------------------------------------------------------------------------------------
|
|
263
|
-
* DropdownMenuArrow
|
|
264
|
-
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$ARROW_NAME = 'DropdownMenuArrow';
|
|
265
|
-
const $d08ef79370b62062$export$34b8980744021ec5 = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
266
|
-
const { __scopeDropdownMenu: __scopeDropdownMenu , ...arrowProps } = props;
|
|
267
|
-
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
268
|
-
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$Arrow, $9kmUS$babelruntimehelpersesmextends({}, menuScope, arrowProps, {
|
|
269
|
-
ref: forwardedRef
|
|
270
|
-
}));
|
|
271
|
-
});
|
|
272
|
-
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$34b8980744021ec5, {
|
|
273
|
-
displayName: $d08ef79370b62062$var$ARROW_NAME
|
|
274
|
-
});
|
|
275
|
-
/* -------------------------------------------------------------------------------------------------
|
|
276
|
-
* DropdownMenuSub
|
|
277
|
-
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$export$2f307d81a64f5442 = (props)=>{
|
|
278
|
-
const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , open: openProp , onOpenChange: onOpenChange , defaultOpen: defaultOpen } = props;
|
|
279
|
-
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
280
|
-
const [open = false, setOpen] = $9kmUS$useControllableState({
|
|
281
|
-
prop: openProp,
|
|
282
|
-
defaultProp: defaultOpen,
|
|
283
|
-
onChange: onOpenChange
|
|
284
|
-
});
|
|
285
|
-
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$Sub, $9kmUS$babelruntimehelpersesmextends({}, menuScope, {
|
|
286
|
-
open: open,
|
|
287
|
-
onOpenChange: setOpen
|
|
288
|
-
}), children);
|
|
200
|
+
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
201
|
+
var ARROW_NAME = "DropdownMenuArrow";
|
|
202
|
+
var DropdownMenuArrow = React.forwardRef(
|
|
203
|
+
(props, forwardedRef) => {
|
|
204
|
+
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
205
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
206
|
+
return /* @__PURE__ */ jsx(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef });
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
DropdownMenuArrow.displayName = ARROW_NAME;
|
|
210
|
+
var DropdownMenuSub = (props) => {
|
|
211
|
+
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
212
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
213
|
+
const [open = false, setOpen] = useControllableState({
|
|
214
|
+
prop: openProp,
|
|
215
|
+
defaultProp: defaultOpen,
|
|
216
|
+
onChange: onOpenChange
|
|
217
|
+
});
|
|
218
|
+
return /* @__PURE__ */ jsx(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
289
219
|
};
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
296
|
-
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$SubTrigger, $9kmUS$babelruntimehelpersesmextends({}, menuScope, subTriggerProps, {
|
|
297
|
-
ref: forwardedRef
|
|
298
|
-
}));
|
|
220
|
+
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
221
|
+
var DropdownMenuSubTrigger = React.forwardRef((props, forwardedRef) => {
|
|
222
|
+
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
223
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
224
|
+
return /* @__PURE__ */ jsx(MenuPrimitive.SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
299
225
|
});
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
226
|
+
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
227
|
+
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
228
|
+
var DropdownMenuSubContent = React.forwardRef((props, forwardedRef) => {
|
|
229
|
+
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
230
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
231
|
+
return /* @__PURE__ */ jsx(
|
|
232
|
+
MenuPrimitive.SubContent,
|
|
233
|
+
{
|
|
234
|
+
...menuScope,
|
|
235
|
+
...subContentProps,
|
|
236
|
+
ref: forwardedRef,
|
|
237
|
+
style: {
|
|
238
|
+
...props.style,
|
|
239
|
+
// re-namespace exposed content custom properties
|
|
240
|
+
...{
|
|
241
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
242
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
243
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
244
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
245
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
318
246
|
}
|
|
319
|
-
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
);
|
|
320
250
|
});
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
251
|
+
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
252
|
+
var Root2 = DropdownMenu;
|
|
253
|
+
var Trigger = DropdownMenuTrigger;
|
|
254
|
+
var Portal2 = DropdownMenuPortal;
|
|
255
|
+
var Content2 = DropdownMenuContent;
|
|
256
|
+
var Group2 = DropdownMenuGroup;
|
|
257
|
+
var Label2 = DropdownMenuLabel;
|
|
258
|
+
var Item2 = DropdownMenuItem;
|
|
259
|
+
var CheckboxItem2 = DropdownMenuCheckboxItem;
|
|
260
|
+
var RadioGroup2 = DropdownMenuRadioGroup;
|
|
261
|
+
var RadioItem2 = DropdownMenuRadioItem;
|
|
262
|
+
var ItemIndicator2 = DropdownMenuItemIndicator;
|
|
263
|
+
var Separator2 = DropdownMenuSeparator;
|
|
264
|
+
var Arrow2 = DropdownMenuArrow;
|
|
265
|
+
var Sub2 = DropdownMenuSub;
|
|
266
|
+
var SubTrigger2 = DropdownMenuSubTrigger;
|
|
267
|
+
var SubContent2 = DropdownMenuSubContent;
|
|
268
|
+
export {
|
|
269
|
+
Arrow2 as Arrow,
|
|
270
|
+
CheckboxItem2 as CheckboxItem,
|
|
271
|
+
Content2 as Content,
|
|
272
|
+
DropdownMenu,
|
|
273
|
+
DropdownMenuArrow,
|
|
274
|
+
DropdownMenuCheckboxItem,
|
|
275
|
+
DropdownMenuContent,
|
|
276
|
+
DropdownMenuGroup,
|
|
277
|
+
DropdownMenuItem,
|
|
278
|
+
DropdownMenuItemIndicator,
|
|
279
|
+
DropdownMenuLabel,
|
|
280
|
+
DropdownMenuPortal,
|
|
281
|
+
DropdownMenuRadioGroup,
|
|
282
|
+
DropdownMenuRadioItem,
|
|
283
|
+
DropdownMenuSeparator,
|
|
284
|
+
DropdownMenuSub,
|
|
285
|
+
DropdownMenuSubContent,
|
|
286
|
+
DropdownMenuSubTrigger,
|
|
287
|
+
DropdownMenuTrigger,
|
|
288
|
+
Group2 as Group,
|
|
289
|
+
Item2 as Item,
|
|
290
|
+
ItemIndicator2 as ItemIndicator,
|
|
291
|
+
Label2 as Label,
|
|
292
|
+
Portal2 as Portal,
|
|
293
|
+
RadioGroup2 as RadioGroup,
|
|
294
|
+
RadioItem2 as RadioItem,
|
|
295
|
+
Root2 as Root,
|
|
296
|
+
Separator2 as Separator,
|
|
297
|
+
Sub2 as Sub,
|
|
298
|
+
SubContent2 as SubContent,
|
|
299
|
+
SubTrigger2 as SubTrigger,
|
|
300
|
+
Trigger,
|
|
301
|
+
createDropdownMenuScope
|
|
302
|
+
};
|
|
345
303
|
//# sourceMappingURL=index.mjs.map
|