@radix-ui/react-dropdown-menu 0.1.7-rc.1 → 0.1.7-rc.10
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.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +384 -1
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +365 -1
- package/dist/index.module.js.map +1 -1
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -9,12 +9,12 @@ type ScopedProps<P> = P & {
|
|
|
9
9
|
};
|
|
10
10
|
export const createDropdownMenuScope: import("@radix-ui/react-context").CreateScope;
|
|
11
11
|
export interface DropdownMenuProps {
|
|
12
|
+
children?: React.ReactNode;
|
|
12
13
|
dir?: Direction;
|
|
13
14
|
open?: boolean;
|
|
14
15
|
defaultOpen?: boolean;
|
|
15
16
|
onOpenChange?(open: boolean): void;
|
|
16
17
|
modal?: boolean;
|
|
17
|
-
children?: React.ReactNode;
|
|
18
18
|
}
|
|
19
19
|
export const DropdownMenu: React.FC<DropdownMenuProps>;
|
|
20
20
|
type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;AAaA,iBAAiB,KAAK,GAAG,KAAK,CAAC;AAQ/B,iBAAiB,CAAC,IAAI,CAAC,GAAG;IAAE,mBAAmB,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAC1D,OAAA,8FAGC,CAAC;AAyBF;IACE,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;IAC3B,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO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AwB,CAAC,OAAO,cAAc,SAAS,CAAC,CAAC;AACzF,2CAAqC,SAAQ,kBAAkB;CAAG;AAElE,OAAA,MAAM,wHAOJ,CAAC;AAWH,8BAA8B,MAAM,wBAAwB,CAAC,OAAO,cAAc,aAAa,CAAC,CAAC;AACjG,+CAAyC,SAAQ,sBAAsB;CAAG;AAE1E,OAAA,MAAM,iIAOJ,CAAC;AAWH,0BAA0B,MAAM,wBAAwB,CAAC,OAAO,cAAc,SAAS,CAAC,CAAC;AACzF,2CAAqC,SAAQ,kBAAkB;CAAG;AAElE,OAAA,MAAM,wHAOJ,CAAC;AAWH,sBAAsB,MAAM,wBAAwB,CAAC,OAAO,cAAc,KAAK,CAAC,CAAC;AACjF,uCAAiC,SAAQ,cAAc;CAAG;AAE1D,OAAA,MAAM,+GAML,CAAC;AAMF,OAAA,MAAM,iCAAmB,CAAC;AAC1B,OAAA,MAAM,2GAA6B,CAAC;AACpC,OAAA,MAAM,wGAA6B,CAAC;AACpC,OAAA,MAAM,oGAAyB,CAAC;AAChC,OAAA,MAAM,oGAAyB,CAAC;AAChC,OAAA,MAAM,kGAAuB,CAAC;AAC9B,OAAA,MAAM,gHAAqC,CAAC;AAC5C,OAAA,MAAM,kHAAuC,CAAC;AAC9C,OAAA,MAAM,8GAAmC,CAAC;AAC1C,OAAA,MAAM,4GAAiC,CAAC;AACxC,OAAA,MAAM,qHAAyC,CAAC;AAChD,OAAA,MAAM,4GAAiC,CAAC;AACxC,OAAA,MAAM,mGAAyB,CAAC","sources":["packages/react/dropdown-menu/src/packages/react/dropdown-menu/src/DropdownMenu.tsx","packages/react/dropdown-menu/src/packages/react/dropdown-menu/src/index.ts","packages/react/dropdown-menu/src/index.ts"],"sourcesContent":[null,null,"export * from './DropdownMenu';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,385 @@
|
|
|
1
|
-
var
|
|
1
|
+
var $7dQ7Q$babelruntimehelpersextends = require("@babel/runtime/helpers/extends");
|
|
2
|
+
var $7dQ7Q$react = require("react");
|
|
3
|
+
var $7dQ7Q$radixuiprimitive = require("@radix-ui/primitive");
|
|
4
|
+
var $7dQ7Q$radixuireactcomposerefs = require("@radix-ui/react-compose-refs");
|
|
5
|
+
var $7dQ7Q$radixuireactcontext = require("@radix-ui/react-context");
|
|
6
|
+
var $7dQ7Q$radixuireactusecontrollablestate = require("@radix-ui/react-use-controllable-state");
|
|
7
|
+
var $7dQ7Q$radixuireactprimitive = require("@radix-ui/react-primitive");
|
|
8
|
+
var $7dQ7Q$radixuireactmenu = require("@radix-ui/react-menu");
|
|
9
|
+
var $7dQ7Q$radixuireactid = require("@radix-ui/react-id");
|
|
10
|
+
|
|
11
|
+
function $parcel$exportWildcard(dest, source) {
|
|
12
|
+
Object.keys(source).forEach(function(key) {
|
|
13
|
+
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
Object.defineProperty(dest, key, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function get() {
|
|
20
|
+
return source[key];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return dest;
|
|
26
|
+
}
|
|
27
|
+
function $parcel$interopDefault(a) {
|
|
28
|
+
return a && a.__esModule ? a.default : a;
|
|
29
|
+
}
|
|
30
|
+
function $parcel$export(e, n, v, s) {
|
|
31
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
32
|
+
}
|
|
33
|
+
var $d1bf075a6b218014$exports = {};
|
|
34
|
+
|
|
35
|
+
$parcel$export($d1bf075a6b218014$exports, "createDropdownMenuScope", () => $d1bf075a6b218014$export$c0623cd925aeb687);
|
|
36
|
+
$parcel$export($d1bf075a6b218014$exports, "DropdownMenu", () => $d1bf075a6b218014$export$e44a253a59704894);
|
|
37
|
+
$parcel$export($d1bf075a6b218014$exports, "DropdownMenuTrigger", () => $d1bf075a6b218014$export$d2469213b3befba9);
|
|
38
|
+
$parcel$export($d1bf075a6b218014$exports, "DropdownMenuContent", () => $d1bf075a6b218014$export$6e76d93a37c01248);
|
|
39
|
+
$parcel$export($d1bf075a6b218014$exports, "DropdownMenuGroup", () => $d1bf075a6b218014$export$246bebaba3a2f70e);
|
|
40
|
+
$parcel$export($d1bf075a6b218014$exports, "DropdownMenuLabel", () => $d1bf075a6b218014$export$76e48c5b57f24495);
|
|
41
|
+
$parcel$export($d1bf075a6b218014$exports, "DropdownMenuItem", () => $d1bf075a6b218014$export$ed97964d1871885d);
|
|
42
|
+
$parcel$export($d1bf075a6b218014$exports, "DropdownMenuTriggerItem", () => $d1bf075a6b218014$export$eb7a5647860df79a);
|
|
43
|
+
$parcel$export($d1bf075a6b218014$exports, "DropdownMenuCheckboxItem", () => $d1bf075a6b218014$export$53a69729da201fa9);
|
|
44
|
+
$parcel$export($d1bf075a6b218014$exports, "DropdownMenuRadioGroup", () => $d1bf075a6b218014$export$3323ad73d55f587e);
|
|
45
|
+
$parcel$export($d1bf075a6b218014$exports, "DropdownMenuRadioItem", () => $d1bf075a6b218014$export$e4f69b41b1637536);
|
|
46
|
+
$parcel$export($d1bf075a6b218014$exports, "DropdownMenuItemIndicator", () => $d1bf075a6b218014$export$42355ae145153fb6);
|
|
47
|
+
$parcel$export($d1bf075a6b218014$exports, "DropdownMenuSeparator", () => $d1bf075a6b218014$export$da160178fd3bc7e9);
|
|
48
|
+
$parcel$export($d1bf075a6b218014$exports, "DropdownMenuArrow", () => $d1bf075a6b218014$export$34b8980744021ec5);
|
|
49
|
+
$parcel$export($d1bf075a6b218014$exports, "Root", () => $d1bf075a6b218014$export$be92b6f5f03c0fe9);
|
|
50
|
+
$parcel$export($d1bf075a6b218014$exports, "Trigger", () => $d1bf075a6b218014$export$41fb9f06171c75f4);
|
|
51
|
+
$parcel$export($d1bf075a6b218014$exports, "Content", () => $d1bf075a6b218014$export$7c6e2c02157bb7d2);
|
|
52
|
+
$parcel$export($d1bf075a6b218014$exports, "Group", () => $d1bf075a6b218014$export$eb2fcfdbd7ba97d4);
|
|
53
|
+
$parcel$export($d1bf075a6b218014$exports, "Label", () => $d1bf075a6b218014$export$b04be29aa201d4f5);
|
|
54
|
+
$parcel$export($d1bf075a6b218014$exports, "Item", () => $d1bf075a6b218014$export$6d08773d2e66f8f2);
|
|
55
|
+
$parcel$export($d1bf075a6b218014$exports, "TriggerItem", () => $d1bf075a6b218014$export$6d0911d397e3b965);
|
|
56
|
+
$parcel$export($d1bf075a6b218014$exports, "CheckboxItem", () => $d1bf075a6b218014$export$16ce288f89fa631c);
|
|
57
|
+
$parcel$export($d1bf075a6b218014$exports, "RadioGroup", () => $d1bf075a6b218014$export$a98f0dcb43a68a25);
|
|
58
|
+
$parcel$export($d1bf075a6b218014$exports, "RadioItem", () => $d1bf075a6b218014$export$371ab307eab489c0);
|
|
59
|
+
$parcel$export($d1bf075a6b218014$exports, "ItemIndicator", () => $d1bf075a6b218014$export$c3468e2714d175fa);
|
|
60
|
+
$parcel$export($d1bf075a6b218014$exports, "Separator", () => $d1bf075a6b218014$export$1ff3c3f08ae963c0);
|
|
61
|
+
$parcel$export($d1bf075a6b218014$exports, "Arrow", () => $d1bf075a6b218014$export$21b07c8f274aebd5);
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
/* -------------------------------------------------------------------------------------------------
|
|
73
|
+
* DropdownMenu
|
|
74
|
+
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$DROPDOWN_MENU_NAME = 'DropdownMenu';
|
|
75
|
+
const [$d1bf075a6b218014$var$createDropdownMenuContext, $d1bf075a6b218014$export$c0623cd925aeb687] = $7dQ7Q$radixuireactcontext.createContextScope($d1bf075a6b218014$var$DROPDOWN_MENU_NAME, [
|
|
76
|
+
$7dQ7Q$radixuireactmenu.createMenuScope
|
|
77
|
+
]);
|
|
78
|
+
const $d1bf075a6b218014$var$useMenuScope = $7dQ7Q$radixuireactmenu.createMenuScope();
|
|
79
|
+
const [$d1bf075a6b218014$var$DropdownMenuProvider, $d1bf075a6b218014$var$useDropdownMenuContext] = $d1bf075a6b218014$var$createDropdownMenuContext($d1bf075a6b218014$var$DROPDOWN_MENU_NAME);
|
|
80
|
+
const $d1bf075a6b218014$export$e44a253a59704894 = (props)=>{
|
|
81
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange } = props;
|
|
82
|
+
const contentContext = $d1bf075a6b218014$var$useContentContext($d1bf075a6b218014$var$DROPDOWN_MENU_NAME, __scopeDropdownMenu);
|
|
83
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
84
|
+
const [open = false, setOpen] = $7dQ7Q$radixuireactusecontrollablestate.useControllableState({
|
|
85
|
+
prop: openProp,
|
|
86
|
+
defaultProp: defaultOpen,
|
|
87
|
+
onChange: onOpenChange
|
|
88
|
+
});
|
|
89
|
+
const handleOpenToggle = $7dQ7Q$react.useCallback(()=>setOpen((prevOpen)=>!prevOpen
|
|
90
|
+
)
|
|
91
|
+
, [
|
|
92
|
+
setOpen
|
|
93
|
+
]);
|
|
94
|
+
return contentContext.isInsideContent ? /*#__PURE__*/ $7dQ7Q$react.createElement($d1bf075a6b218014$var$DropdownMenuProvider, {
|
|
95
|
+
scope: __scopeDropdownMenu,
|
|
96
|
+
isRootMenu: false,
|
|
97
|
+
open: open,
|
|
98
|
+
onOpenChange: setOpen,
|
|
99
|
+
onOpenToggle: handleOpenToggle
|
|
100
|
+
}, /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Sub, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, {
|
|
101
|
+
open: open,
|
|
102
|
+
onOpenChange: setOpen
|
|
103
|
+
}), children)) : /*#__PURE__*/ $7dQ7Q$react.createElement($d1bf075a6b218014$var$DropdownMenuRoot, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, props, {
|
|
104
|
+
open: open,
|
|
105
|
+
onOpenChange: setOpen,
|
|
106
|
+
onOpenToggle: handleOpenToggle
|
|
107
|
+
}), children);
|
|
108
|
+
};
|
|
109
|
+
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$e44a253a59704894, {
|
|
110
|
+
displayName: $d1bf075a6b218014$var$DROPDOWN_MENU_NAME
|
|
111
|
+
});
|
|
112
|
+
/* ---------------------------------------------------------------------------------------------- */ const $d1bf075a6b218014$var$DropdownMenuRoot = (props)=>{
|
|
113
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , dir: dir , open: open , onOpenChange: onOpenChange , onOpenToggle: onOpenToggle , modal: modal = true } = props;
|
|
114
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
115
|
+
const triggerRef = $7dQ7Q$react.useRef(null);
|
|
116
|
+
return /*#__PURE__*/ $7dQ7Q$react.createElement($d1bf075a6b218014$var$DropdownMenuProvider, {
|
|
117
|
+
scope: __scopeDropdownMenu,
|
|
118
|
+
isRootMenu: true,
|
|
119
|
+
triggerId: $7dQ7Q$radixuireactid.useId(),
|
|
120
|
+
triggerRef: triggerRef,
|
|
121
|
+
contentId: $7dQ7Q$radixuireactid.useId(),
|
|
122
|
+
open: open,
|
|
123
|
+
onOpenChange: onOpenChange,
|
|
124
|
+
onOpenToggle: onOpenToggle,
|
|
125
|
+
modal: modal
|
|
126
|
+
}, /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Root, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, {
|
|
127
|
+
open: open,
|
|
128
|
+
onOpenChange: onOpenChange,
|
|
129
|
+
dir: dir,
|
|
130
|
+
modal: modal
|
|
131
|
+
}), children));
|
|
132
|
+
};
|
|
133
|
+
/* -------------------------------------------------------------------------------------------------
|
|
134
|
+
* DropdownMenuTrigger
|
|
135
|
+
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$TRIGGER_NAME = 'DropdownMenuTrigger';
|
|
136
|
+
const $d1bf075a6b218014$export$d2469213b3befba9 = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
137
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , disabled: disabled = false , ...triggerProps } = props;
|
|
138
|
+
const context = $d1bf075a6b218014$var$useDropdownMenuContext($d1bf075a6b218014$var$TRIGGER_NAME, __scopeDropdownMenu);
|
|
139
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
140
|
+
return context.isRootMenu ? /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Anchor, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({
|
|
141
|
+
asChild: true
|
|
142
|
+
}, menuScope), /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactprimitive.Primitive.button, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({
|
|
143
|
+
type: "button",
|
|
144
|
+
id: context.triggerId,
|
|
145
|
+
"aria-haspopup": "menu",
|
|
146
|
+
"aria-expanded": context.open ? true : undefined,
|
|
147
|
+
"aria-controls": context.open ? context.contentId : undefined,
|
|
148
|
+
"data-state": context.open ? 'open' : 'closed',
|
|
149
|
+
"data-disabled": disabled ? '' : undefined,
|
|
150
|
+
disabled: disabled
|
|
151
|
+
}, triggerProps, {
|
|
152
|
+
ref: $7dQ7Q$radixuireactcomposerefs.composeRefs(forwardedRef, context.triggerRef),
|
|
153
|
+
onPointerDown: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onPointerDown, (event)=>{
|
|
154
|
+
// only call handler if it's the left button (mousedown gets triggered by all mouse buttons)
|
|
155
|
+
// but not when the control key is pressed (avoiding MacOS right click)
|
|
156
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
157
|
+
// prevent trigger focusing when opening
|
|
158
|
+
// this allows the content to be given focus without competition
|
|
159
|
+
if (!context.open) event.preventDefault();
|
|
160
|
+
context.onOpenToggle();
|
|
161
|
+
}
|
|
162
|
+
}),
|
|
163
|
+
onKeyDown: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onKeyDown, (event)=>{
|
|
164
|
+
if (disabled) return;
|
|
165
|
+
if ([
|
|
166
|
+
'Enter',
|
|
167
|
+
' '
|
|
168
|
+
].includes(event.key)) context.onOpenToggle();
|
|
169
|
+
if (event.key === 'ArrowDown') context.onOpenChange(true); // prevent keypresses from scrolling window
|
|
170
|
+
if ([
|
|
171
|
+
' ',
|
|
172
|
+
'ArrowDown'
|
|
173
|
+
].includes(event.key)) event.preventDefault();
|
|
174
|
+
})
|
|
175
|
+
}))) : null;
|
|
176
|
+
});
|
|
177
|
+
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$d2469213b3befba9, {
|
|
178
|
+
displayName: $d1bf075a6b218014$var$TRIGGER_NAME
|
|
179
|
+
});
|
|
180
|
+
/* -------------------------------------------------------------------------------------------------
|
|
181
|
+
* DropdownMenuContent
|
|
182
|
+
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$CONTENT_NAME = 'DropdownMenuContent';
|
|
183
|
+
const [$d1bf075a6b218014$var$ContentProvider, $d1bf075a6b218014$var$useContentContext] = $d1bf075a6b218014$var$createDropdownMenuContext($d1bf075a6b218014$var$CONTENT_NAME, {
|
|
184
|
+
isInsideContent: false
|
|
185
|
+
});
|
|
186
|
+
const $d1bf075a6b218014$export$6e76d93a37c01248 = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
187
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...contentProps } = props;
|
|
188
|
+
const context = $d1bf075a6b218014$var$useDropdownMenuContext($d1bf075a6b218014$var$CONTENT_NAME, __scopeDropdownMenu);
|
|
189
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
190
|
+
const commonProps = {
|
|
191
|
+
...contentProps,
|
|
192
|
+
style: {
|
|
193
|
+
...props.style,
|
|
194
|
+
// re-namespace exposed content custom property
|
|
195
|
+
['--radix-dropdown-menu-content-transform-origin']: 'var(--radix-popper-transform-origin)'
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
return /*#__PURE__*/ $7dQ7Q$react.createElement($d1bf075a6b218014$var$ContentProvider, {
|
|
199
|
+
scope: __scopeDropdownMenu,
|
|
200
|
+
isInsideContent: true
|
|
201
|
+
}, context.isRootMenu ? /*#__PURE__*/ $7dQ7Q$react.createElement($d1bf075a6b218014$var$DropdownMenuRootContent, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({
|
|
202
|
+
__scopeDropdownMenu: __scopeDropdownMenu
|
|
203
|
+
}, commonProps, {
|
|
204
|
+
ref: forwardedRef
|
|
205
|
+
})) : /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Content, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, commonProps, {
|
|
206
|
+
ref: forwardedRef
|
|
207
|
+
})));
|
|
208
|
+
});
|
|
209
|
+
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$6e76d93a37c01248, {
|
|
210
|
+
displayName: $d1bf075a6b218014$var$CONTENT_NAME
|
|
211
|
+
});
|
|
212
|
+
/* ---------------------------------------------------------------------------------------------- */ const $d1bf075a6b218014$var$DropdownMenuRootContent = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
213
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , portalled: portalled = true , ...contentProps } = props;
|
|
214
|
+
const context = $d1bf075a6b218014$var$useDropdownMenuContext($d1bf075a6b218014$var$CONTENT_NAME, __scopeDropdownMenu);
|
|
215
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
216
|
+
const hasInteractedOutsideRef = $7dQ7Q$react.useRef(false);
|
|
217
|
+
return context.isRootMenu ? /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Content, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({
|
|
218
|
+
id: context.contentId,
|
|
219
|
+
"aria-labelledby": context.triggerId
|
|
220
|
+
}, menuScope, contentProps, {
|
|
221
|
+
ref: forwardedRef,
|
|
222
|
+
portalled: portalled,
|
|
223
|
+
onCloseAutoFocus: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onCloseAutoFocus, (event)=>{
|
|
224
|
+
var _context$triggerRef$c;
|
|
225
|
+
if (!hasInteractedOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
226
|
+
hasInteractedOutsideRef.current = false; // Always prevent auto focus because we either focus manually or want user agent focus
|
|
227
|
+
event.preventDefault();
|
|
228
|
+
}),
|
|
229
|
+
onInteractOutside: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onInteractOutside, (event)=>{
|
|
230
|
+
const originalEvent = event.detail.originalEvent;
|
|
231
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
232
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
233
|
+
if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;
|
|
234
|
+
})
|
|
235
|
+
})) : null;
|
|
236
|
+
});
|
|
237
|
+
/* -------------------------------------------------------------------------------------------------
|
|
238
|
+
* DropdownMenuGroup
|
|
239
|
+
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$GROUP_NAME = 'DropdownMenuGroup';
|
|
240
|
+
const $d1bf075a6b218014$export$246bebaba3a2f70e = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
241
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...groupProps } = props;
|
|
242
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
243
|
+
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Group, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, groupProps, {
|
|
244
|
+
ref: forwardedRef
|
|
245
|
+
}));
|
|
246
|
+
});
|
|
247
|
+
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$246bebaba3a2f70e, {
|
|
248
|
+
displayName: $d1bf075a6b218014$var$GROUP_NAME
|
|
249
|
+
});
|
|
250
|
+
/* -------------------------------------------------------------------------------------------------
|
|
251
|
+
* DropdownMenuLabel
|
|
252
|
+
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$LABEL_NAME = 'DropdownMenuLabel';
|
|
253
|
+
const $d1bf075a6b218014$export$76e48c5b57f24495 = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
254
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...labelProps } = props;
|
|
255
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
256
|
+
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Label, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, labelProps, {
|
|
257
|
+
ref: forwardedRef
|
|
258
|
+
}));
|
|
259
|
+
});
|
|
260
|
+
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$76e48c5b57f24495, {
|
|
261
|
+
displayName: $d1bf075a6b218014$var$LABEL_NAME
|
|
262
|
+
});
|
|
263
|
+
/* -------------------------------------------------------------------------------------------------
|
|
264
|
+
* DropdownMenuItem
|
|
265
|
+
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$ITEM_NAME = 'DropdownMenuItem';
|
|
266
|
+
const $d1bf075a6b218014$export$ed97964d1871885d = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
267
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...itemProps } = props;
|
|
268
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
269
|
+
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Item, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, itemProps, {
|
|
270
|
+
ref: forwardedRef
|
|
271
|
+
}));
|
|
272
|
+
});
|
|
273
|
+
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$ed97964d1871885d, {
|
|
274
|
+
displayName: $d1bf075a6b218014$var$ITEM_NAME
|
|
275
|
+
});
|
|
276
|
+
/* -------------------------------------------------------------------------------------------------
|
|
277
|
+
* DropdownMenuTriggerItem
|
|
278
|
+
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$TRIGGER_ITEM_NAME = 'DropdownMenuTriggerItem';
|
|
279
|
+
const $d1bf075a6b218014$export$eb7a5647860df79a = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
280
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...triggerItemProps } = props;
|
|
281
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
282
|
+
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.SubTrigger, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, triggerItemProps, {
|
|
283
|
+
ref: forwardedRef
|
|
284
|
+
}));
|
|
285
|
+
});
|
|
286
|
+
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$eb7a5647860df79a, {
|
|
287
|
+
displayName: $d1bf075a6b218014$var$TRIGGER_ITEM_NAME
|
|
288
|
+
});
|
|
289
|
+
/* -------------------------------------------------------------------------------------------------
|
|
290
|
+
* DropdownMenuCheckboxItem
|
|
291
|
+
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$CHECKBOX_ITEM_NAME = 'DropdownMenuCheckboxItem';
|
|
292
|
+
const $d1bf075a6b218014$export$53a69729da201fa9 = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
293
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...checkboxItemProps } = props;
|
|
294
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
295
|
+
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.CheckboxItem, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, checkboxItemProps, {
|
|
296
|
+
ref: forwardedRef
|
|
297
|
+
}));
|
|
298
|
+
});
|
|
299
|
+
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$53a69729da201fa9, {
|
|
300
|
+
displayName: $d1bf075a6b218014$var$CHECKBOX_ITEM_NAME
|
|
301
|
+
});
|
|
302
|
+
/* -------------------------------------------------------------------------------------------------
|
|
303
|
+
* DropdownMenuRadioGroup
|
|
304
|
+
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$RADIO_GROUP_NAME = 'DropdownMenuRadioGroup';
|
|
305
|
+
const $d1bf075a6b218014$export$3323ad73d55f587e = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
306
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...radioGroupProps } = props;
|
|
307
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
308
|
+
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.RadioGroup, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, radioGroupProps, {
|
|
309
|
+
ref: forwardedRef
|
|
310
|
+
}));
|
|
311
|
+
});
|
|
312
|
+
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$3323ad73d55f587e, {
|
|
313
|
+
displayName: $d1bf075a6b218014$var$RADIO_GROUP_NAME
|
|
314
|
+
});
|
|
315
|
+
/* -------------------------------------------------------------------------------------------------
|
|
316
|
+
* DropdownMenuRadioItem
|
|
317
|
+
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$RADIO_ITEM_NAME = 'DropdownMenuRadioItem';
|
|
318
|
+
const $d1bf075a6b218014$export$e4f69b41b1637536 = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
319
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...radioItemProps } = props;
|
|
320
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
321
|
+
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.RadioItem, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, radioItemProps, {
|
|
322
|
+
ref: forwardedRef
|
|
323
|
+
}));
|
|
324
|
+
});
|
|
325
|
+
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$e4f69b41b1637536, {
|
|
326
|
+
displayName: $d1bf075a6b218014$var$RADIO_ITEM_NAME
|
|
327
|
+
});
|
|
328
|
+
/* -------------------------------------------------------------------------------------------------
|
|
329
|
+
* DropdownMenuItemIndicator
|
|
330
|
+
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$INDICATOR_NAME = 'DropdownMenuItemIndicator';
|
|
331
|
+
const $d1bf075a6b218014$export$42355ae145153fb6 = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
332
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...itemIndicatorProps } = props;
|
|
333
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
334
|
+
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.ItemIndicator, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, itemIndicatorProps, {
|
|
335
|
+
ref: forwardedRef
|
|
336
|
+
}));
|
|
337
|
+
});
|
|
338
|
+
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$42355ae145153fb6, {
|
|
339
|
+
displayName: $d1bf075a6b218014$var$INDICATOR_NAME
|
|
340
|
+
});
|
|
341
|
+
/* -------------------------------------------------------------------------------------------------
|
|
342
|
+
* DropdownMenuSeparator
|
|
343
|
+
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$SEPARATOR_NAME = 'DropdownMenuSeparator';
|
|
344
|
+
const $d1bf075a6b218014$export$da160178fd3bc7e9 = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
345
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...separatorProps } = props;
|
|
346
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
347
|
+
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Separator, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, separatorProps, {
|
|
348
|
+
ref: forwardedRef
|
|
349
|
+
}));
|
|
350
|
+
});
|
|
351
|
+
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$da160178fd3bc7e9, {
|
|
352
|
+
displayName: $d1bf075a6b218014$var$SEPARATOR_NAME
|
|
353
|
+
});
|
|
354
|
+
/* -------------------------------------------------------------------------------------------------
|
|
355
|
+
* DropdownMenuArrow
|
|
356
|
+
* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$ARROW_NAME = 'DropdownMenuArrow';
|
|
357
|
+
const $d1bf075a6b218014$export$34b8980744021ec5 = /*#__PURE__*/ $7dQ7Q$react.forwardRef((props, forwardedRef)=>{
|
|
358
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...arrowProps } = props;
|
|
359
|
+
const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu);
|
|
360
|
+
return /*#__PURE__*/ $7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Arrow, ($parcel$interopDefault($7dQ7Q$babelruntimehelpersextends))({}, menuScope, arrowProps, {
|
|
361
|
+
ref: forwardedRef
|
|
362
|
+
}));
|
|
363
|
+
});
|
|
364
|
+
/*#__PURE__*/ Object.assign($d1bf075a6b218014$export$34b8980744021ec5, {
|
|
365
|
+
displayName: $d1bf075a6b218014$var$ARROW_NAME
|
|
366
|
+
});
|
|
367
|
+
/* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$export$be92b6f5f03c0fe9 = $d1bf075a6b218014$export$e44a253a59704894;
|
|
368
|
+
const $d1bf075a6b218014$export$41fb9f06171c75f4 = $d1bf075a6b218014$export$d2469213b3befba9;
|
|
369
|
+
const $d1bf075a6b218014$export$7c6e2c02157bb7d2 = $d1bf075a6b218014$export$6e76d93a37c01248;
|
|
370
|
+
const $d1bf075a6b218014$export$eb2fcfdbd7ba97d4 = $d1bf075a6b218014$export$246bebaba3a2f70e;
|
|
371
|
+
const $d1bf075a6b218014$export$b04be29aa201d4f5 = $d1bf075a6b218014$export$76e48c5b57f24495;
|
|
372
|
+
const $d1bf075a6b218014$export$6d08773d2e66f8f2 = $d1bf075a6b218014$export$ed97964d1871885d;
|
|
373
|
+
const $d1bf075a6b218014$export$6d0911d397e3b965 = $d1bf075a6b218014$export$eb7a5647860df79a;
|
|
374
|
+
const $d1bf075a6b218014$export$16ce288f89fa631c = $d1bf075a6b218014$export$53a69729da201fa9;
|
|
375
|
+
const $d1bf075a6b218014$export$a98f0dcb43a68a25 = $d1bf075a6b218014$export$3323ad73d55f587e;
|
|
376
|
+
const $d1bf075a6b218014$export$371ab307eab489c0 = $d1bf075a6b218014$export$e4f69b41b1637536;
|
|
377
|
+
const $d1bf075a6b218014$export$c3468e2714d175fa = $d1bf075a6b218014$export$42355ae145153fb6;
|
|
378
|
+
const $d1bf075a6b218014$export$1ff3c3f08ae963c0 = $d1bf075a6b218014$export$da160178fd3bc7e9;
|
|
379
|
+
const $d1bf075a6b218014$export$21b07c8f274aebd5 = $d1bf075a6b218014$export$34b8980744021ec5;
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
$parcel$exportWildcard(module.exports, $d1bf075a6b218014$exports);
|
|
383
|
+
|
|
384
|
+
|
|
2
385
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"IAAgCA,kaAAAA,8CAClBA,EAAEC,WAAaD,EAAEE,QAAUF,EAWzC,SAASG,EAAuBC,EAAMC,GAcpC,OAbAC,OAAOC,KAAKF,GAAQG,SAAQ,SAASC,GACvB,YAARA,GAA6B,eAARA,GAIzBH,OAAOI,eAAeN,EAAMK,EAAK,CAC/BE,YAAY,EACZC,IAAK,WACH,OAAOP,EAAOI,SAKbL,ECPT,MAGOS,EAA2BC,GAA2BC,EAHlC,eAKzB,CAACC,sCAEH,MAAMC,EAAeD,KAoBdE,EAAsBC,GAA0BN,EA3B5B,gBAwCrBO,EAA6CC,IACjD,MAAMC,oBAAEA,EAAFC,SAAuBA,EAAUC,KAAMC,EAAvCC,YAAiDA,EAAjDC,aAA8DA,GAAiBN,EAC/EO,EAAiBC,EA1CE,eA0CoCP,GACvDQ,EAAYb,EAAaK,IACxBE,GAAO,EAAOO,GAAWC,EAAqB,CACnDC,KAAMR,EACNS,YAAaR,EACbS,SAAUR,IAGNS,EAAmBC,EAAMC,aAAY,IAAMP,GAASQ,IAAcA,KAAW,CAACR,IAEpF,OAAOH,EAAeY,6BACpBC,EAAAC,cAACC,EAAD,CACEC,MAAOtB,EACPuB,YAAY,EACZrB,KAAMA,EACNG,aAAcI,EACde,aAAcV,gBAEdK,EAAAC,cAACK,EAAcC,IAAfC,EAAA,GAAuBnB,EAAvB,CAAkCN,KAAMA,EAAMG,aAAcI,IACzDR,iBAILkB,EAAAC,cAACQ,EAADD,EAAA,GAAsB5B,EAAtB,CAA6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KX,oCAQpE,MAAMH,EAAOvC,iBACb,MAAMgH,EAAUxE,oBAChB,MAAM6B,EAAUN,oBAChB,MAAMqB,EAAQF,kBACd,MAAMK,EAAQF,kBACd,MAAMK,EAAOF,iBACb,MAAMyB,EAActB,wBACpB,MAAMK,EAAeF,yBACrB,MAAMK,EAAaF,uBACnB,MAAMK,EAAYF,sBAClB,MAAMK,EAAgBF,0BACtB,MAAMK,EAAYF,sBAClB,MAAMK,EAAQF","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/react/dropdown-menu/src/DropdownMenu.tsx"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$reexport(e, n, v) {\n Object.defineProperty(e, n, {get: v, enumerable: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport { useId } from '@radix-ui/react-id';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst DROPDOWN_MENU_NAME = 'DropdownMenu';\n\ntype ScopedProps<P> = P & { __scopeDropdownMenu?: Scope };\nconst [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(\n DROPDOWN_MENU_NAME,\n [createMenuScope]\n);\nconst useMenuScope = createMenuScope();\n\ntype DropdownMenuRootContextValue = {\n isRootMenu: true;\n triggerId: string;\n triggerRef: React.RefObject<HTMLButtonElement>;\n contentId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\ntype DropdownMenuSubContextValue = {\n isRootMenu: false;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n};\n\nconst [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext<\n DropdownMenuRootContextValue | DropdownMenuSubContextValue\n>(DROPDOWN_MENU_NAME);\n\ninterface DropdownMenuProps {\n dir?: Direction;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n children?: React.ReactNode;\n}\n\nconst DropdownMenu: React.FC<DropdownMenuProps> = (props: ScopedProps<DropdownMenuProps>) => {\n const { __scopeDropdownMenu, children, open: openProp, defaultOpen, onOpenChange } = props;\n const contentContext = useContentContext(DROPDOWN_MENU_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n const handleOpenToggle = React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]);\n\n return contentContext.isInsideContent ? (\n <DropdownMenuProvider\n scope={__scopeDropdownMenu}\n isRootMenu={false}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={handleOpenToggle}\n >\n <MenuPrimitive.Sub {...menuScope} open={open} onOpenChange={setOpen}>\n {children}\n </MenuPrimitive.Sub>\n </DropdownMenuProvider>\n ) : (\n <DropdownMenuRoot {...props} open={open} onOpenChange={setOpen} onOpenToggle={handleOpenToggle}>\n {children}\n </DropdownMenuRoot>\n );\n};\n\nDropdownMenu.displayName = DROPDOWN_MENU_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ninterface DropdownMenuRootProps {\n dir?: Direction;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal?: boolean;\n children?: React.ReactNode;\n}\n\nconst DropdownMenuRoot: React.FC<DropdownMenuRootProps> = (\n props: ScopedProps<DropdownMenuRootProps>\n) => {\n const {\n __scopeDropdownMenu,\n children,\n dir,\n open,\n onOpenChange,\n onOpenToggle,\n modal = true,\n } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n return (\n <DropdownMenuProvider\n scope={__scopeDropdownMenu}\n isRootMenu={true}\n triggerId={useId()}\n triggerRef={triggerRef}\n contentId={useId()}\n open={open}\n onOpenChange={onOpenChange}\n onOpenToggle={onOpenToggle}\n modal={modal}\n >\n <MenuPrimitive.Root\n {...menuScope}\n open={open}\n onOpenChange={onOpenChange}\n dir={dir}\n modal={modal}\n >\n {children}\n </MenuPrimitive.Root>\n </DropdownMenuProvider>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DropdownMenuTrigger';\n\ntype DropdownMenuTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface DropdownMenuTriggerProps extends PrimitiveButtonProps {}\n\nconst DropdownMenuTrigger = React.forwardRef<DropdownMenuTriggerElement, DropdownMenuTriggerProps>(\n (props: ScopedProps<DropdownMenuTriggerProps>, forwardedRef) => {\n const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;\n const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return context.isRootMenu ? (\n <MenuPrimitive.Anchor asChild {...menuScope}>\n <Primitive.button\n type=\"button\"\n id={context.triggerId}\n aria-haspopup=\"menu\"\n aria-expanded={context.open ? true : undefined}\n aria-controls={context.open ? context.contentId : undefined}\n data-state={context.open ? 'open' : 'closed'}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n {...triggerProps}\n ref={composeRefs(forwardedRef, context.triggerRef)}\n onPointerDown={composeEventHandlers(props.onPointerDown, (event) => {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n // prevent trigger focusing when opening\n // this allows the content to be given focus without competition\n if (!context.open) event.preventDefault();\n context.onOpenToggle();\n }\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if (['Enter', ' '].includes(event.key)) context.onOpenToggle();\n if (event.key === 'ArrowDown') context.onOpenChange(true);\n // prevent keypresses from scrolling window\n if ([' ', 'ArrowDown'].includes(event.key)) event.preventDefault();\n })}\n />\n </MenuPrimitive.Anchor>\n ) : null;\n }\n);\n\nDropdownMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DropdownMenuContent';\n\nconst [ContentProvider, useContentContext] = createDropdownMenuContext(CONTENT_NAME, {\n isInsideContent: false,\n});\n\ntype DropdownMenuContentElement =\n | DropdownMenuRootContentElement\n | React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface DropdownMenuContentProps extends DropdownMenuRootContentProps, MenuContentProps {}\n\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n (props: ScopedProps<DropdownMenuContentProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const commonProps = {\n ...contentProps,\n style: {\n ...props.style,\n // re-namespace exposed content custom property\n ['--radix-dropdown-menu-content-transform-origin' as any]:\n 'var(--radix-popper-transform-origin)',\n },\n };\n\n return (\n <ContentProvider scope={__scopeDropdownMenu} isInsideContent={true}>\n {context.isRootMenu ? (\n <DropdownMenuRootContent\n __scopeDropdownMenu={__scopeDropdownMenu}\n {...commonProps}\n ref={forwardedRef}\n />\n ) : (\n <MenuPrimitive.Content {...menuScope} {...commonProps} ref={forwardedRef} />\n )}\n </ContentProvider>\n );\n }\n);\n\nDropdownMenuContent.displayName = CONTENT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype DropdownMenuRootContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ninterface DropdownMenuRootContentProps extends ScopedProps<MenuContentProps> {}\n\nconst DropdownMenuRootContent = React.forwardRef<\n DropdownMenuRootContentElement,\n DropdownMenuRootContentProps\n>((props, forwardedRef) => {\n const { __scopeDropdownMenu, portalled = true, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n return context.isRootMenu ? (\n <MenuPrimitive.Content\n id={context.contentId}\n aria-labelledby={context.triggerId}\n {...menuScope}\n {...contentProps}\n ref={forwardedRef}\n portalled={portalled}\n onCloseAutoFocus={composeEventHandlers(props.onCloseAutoFocus, (event) => {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n hasInteractedOutsideRef.current = false;\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n })}\n onInteractOutside={composeEventHandlers(props.onInteractOutside, (event) => {\n const originalEvent = event.detail.originalEvent as PointerEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;\n })}\n />\n ) : null;\n});\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'DropdownMenuGroup';\n\ntype DropdownMenuGroupElement = React.ElementRef<typeof MenuPrimitive.Group>;\ntype MenuGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;\ninterface DropdownMenuGroupProps extends MenuGroupProps {}\n\nconst DropdownMenuGroup = React.forwardRef<DropdownMenuGroupElement, DropdownMenuGroupProps>(\n (props: ScopedProps<DropdownMenuGroupProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Group {...menuScope} {...groupProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'DropdownMenuLabel';\n\ntype DropdownMenuLabelElement = React.ElementRef<typeof MenuPrimitive.Label>;\ntype MenuLabelProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Label>;\ninterface DropdownMenuLabelProps extends MenuLabelProps {}\n\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n (props: ScopedProps<DropdownMenuLabelProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Label {...menuScope} {...labelProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'DropdownMenuItem';\n\ntype DropdownMenuItemElement = React.ElementRef<typeof MenuPrimitive.Item>;\ntype MenuItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;\ninterface DropdownMenuItemProps extends MenuItemProps {}\n\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n (props: ScopedProps<DropdownMenuItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Item {...menuScope} {...itemProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuTriggerItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_ITEM_NAME = 'DropdownMenuTriggerItem';\n\ntype DropdownMenuTriggerItemElement = React.ElementRef<typeof MenuPrimitive.SubTrigger>;\ntype MenuSubTriggerProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;\ninterface DropdownMenuTriggerItemProps extends MenuSubTriggerProps {}\n\nconst DropdownMenuTriggerItem = React.forwardRef<\n DropdownMenuTriggerItemElement,\n DropdownMenuTriggerItemProps\n>((props: ScopedProps<DropdownMenuTriggerItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...triggerItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.SubTrigger {...menuScope} {...triggerItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuTriggerItem.displayName = TRIGGER_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'DropdownMenuCheckboxItem';\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<typeof MenuPrimitive.CheckboxItem>;\ntype MenuCheckboxItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>;\ninterface DropdownMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props: ScopedProps<DropdownMenuCheckboxItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.CheckboxItem {...menuScope} {...checkboxItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'DropdownMenuRadioGroup';\n\ntype DropdownMenuRadioGroupElement = React.ElementRef<typeof MenuPrimitive.RadioGroup>;\ntype MenuRadioGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioGroup>;\ninterface DropdownMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>((props: ScopedProps<DropdownMenuRadioGroupProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.RadioGroup {...menuScope} {...radioGroupProps} ref={forwardedRef} />;\n});\n\nDropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'DropdownMenuRadioItem';\n\ntype DropdownMenuRadioItemElement = React.ElementRef<typeof MenuPrimitive.RadioItem>;\ntype MenuRadioItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>;\ninterface DropdownMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props: ScopedProps<DropdownMenuRadioItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.RadioItem {...menuScope} {...radioItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'DropdownMenuItemIndicator';\n\ntype DropdownMenuItemIndicatorElement = React.ElementRef<typeof MenuPrimitive.ItemIndicator>;\ntype MenuItemIndicatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.ItemIndicator>;\ninterface DropdownMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst DropdownMenuItemIndicator = React.forwardRef<\n DropdownMenuItemIndicatorElement,\n DropdownMenuItemIndicatorProps\n>((props: ScopedProps<DropdownMenuItemIndicatorProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.ItemIndicator {...menuScope} {...itemIndicatorProps} ref={forwardedRef} />;\n});\n\nDropdownMenuItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'DropdownMenuSeparator';\n\ntype DropdownMenuSeparatorElement = React.ElementRef<typeof MenuPrimitive.Separator>;\ntype MenuSeparatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Separator>;\ninterface DropdownMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>((props: ScopedProps<DropdownMenuSeparatorProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Separator {...menuScope} {...separatorProps} ref={forwardedRef} />;\n});\n\nDropdownMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'DropdownMenuArrow';\n\ntype DropdownMenuArrowElement = React.ElementRef<typeof MenuPrimitive.Arrow>;\ntype MenuArrowProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Arrow>;\ninterface DropdownMenuArrowProps extends MenuArrowProps {}\n\nconst DropdownMenuArrow = React.forwardRef<DropdownMenuArrowElement, DropdownMenuArrowProps>(\n (props: ScopedProps<DropdownMenuArrowProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Arrow {...menuScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = DropdownMenu;\nconst Trigger = DropdownMenuTrigger;\nconst Content = DropdownMenuContent;\nconst Group = DropdownMenuGroup;\nconst Label = DropdownMenuLabel;\nconst Item = DropdownMenuItem;\nconst TriggerItem = DropdownMenuTriggerItem;\nconst CheckboxItem = DropdownMenuCheckboxItem;\nconst RadioGroup = DropdownMenuRadioGroup;\nconst RadioItem = DropdownMenuRadioItem;\nconst ItemIndicator = DropdownMenuItemIndicator;\nconst Separator = DropdownMenuSeparator;\nconst Arrow = DropdownMenuArrow;\n\nexport {\n createDropdownMenuScope,\n //\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuTriggerItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuItemIndicator,\n DropdownMenuSeparator,\n DropdownMenuArrow,\n //\n Root,\n Trigger,\n Content,\n Group,\n Label,\n Item,\n TriggerItem,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n};\nexport type {\n DropdownMenuProps,\n DropdownMenuTriggerProps,\n DropdownMenuContentProps,\n DropdownMenuGroupProps,\n DropdownMenuLabelProps,\n DropdownMenuItemProps,\n DropdownMenuTriggerItemProps,\n DropdownMenuCheckboxItemProps,\n DropdownMenuRadioGroupProps,\n DropdownMenuRadioItemProps,\n DropdownMenuItemIndicatorProps,\n DropdownMenuSeparatorProps,\n DropdownMenuArrowProps,\n};\n"],"names":["a","__esModule","default","$parcel$exportWildcard","dest","source","Object","keys","forEach","key","defineProperty","enumerable","get","createDropdownMenuContext","createDropdownMenuScope","createContextScope","createMenuScope","useMenuScope","DropdownMenuProvider","useDropdownMenuContext","DropdownMenu","props","__scopeDropdownMenu","children","open","openProp","defaultOpen","onOpenChange","contentContext","useContentContext","menuScope","setOpen","useControllableState","prop","defaultProp","onChange","handleOpenToggle","React","useCallback","prevOpen","isInsideContent","_react","createElement","$e185b8015793f9eefe208950c9dca8be$var$DropdownMenuProvider","scope","isRootMenu","onOpenToggle","_radixUiReactMenu","Sub","_babelRuntimeHelpersExtends","$e185b8015793f9eefe208950c9dca8be$var$DropdownMenuRoot","DropdownMenuRoot","dir","modal","triggerRef","useRef","triggerId","useId","contentId","Root","DropdownMenuTrigger","forwardRef","forwardedRef","disabled","triggerProps","context","Anchor","asChild","Primitive","button","type","id","undefined","ref","composeRefs","onPointerDown","composeEventHandlers","event","ctrlKey","preventDefault","onKeyDown","includes","ContentProvider","DropdownMenuContent","contentProps","commonProps","style","$e185b8015793f9eefe208950c9dca8be$var$ContentProvider","$e185b8015793f9eefe208950c9dca8be$var$DropdownMenuRootContent","Content","DropdownMenuRootContent","portalled","hasInteractedOutsideRef","onCloseAutoFocus","_context$triggerRef$c","current","focus","onInteractOutside","originalEvent","detail","ctrlLeftClick","isRightClick","DropdownMenuGroup","groupProps","Group","DropdownMenuLabel","labelProps","Label","DropdownMenuItem","itemProps","Item","DropdownMenuTriggerItem","triggerItemProps","SubTrigger","DropdownMenuCheckboxItem","checkboxItemProps","CheckboxItem","DropdownMenuRadioGroup","radioGroupProps","RadioGroup","DropdownMenuRadioItem","radioItemProps","RadioItem","DropdownMenuItemIndicator","itemIndicatorProps","ItemIndicator","DropdownMenuSeparator","separatorProps","Separator","DropdownMenuArrow","arrowProps","Arrow","Trigger","TriggerItem"],"version":3,"file":"index.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;;ACeA;;oGAEA,CAEA,MAAMS,wCAAkB,GAAG,cAA3B,AAAA;AAGA,MAAM,CAACC,+CAAD,EAA4BC,yCAA5B,CAAA,GAAuDR,6CAAkB,CAC7EM,wCAD6E,EAE7E;IAACF,uCAAD;CAF6E,CAA/E,AAAA;AAIA,MAAMK,kCAAY,GAAGL,uCAAe,EAApC,AAAA;AAoBA,MAAM,CAACM,0CAAD,EAAuBC,4CAAvB,CAAA,GAAiDJ,+CAAyB,CAE9ED,wCAF8E,CAAhF,AAAA;AAaA,MAAMM,yCAAyC,GAAIC,CAAAA,KAAD,GAA2C;IAC3F,MAAM,E,qBAAEC,mBAAF,CAAA,E,UAAuBC,QAAvB,CAAA,EAAiCC,IAAI,EAAEC,QAAvC,CAAA,E,aAAiDC,WAAjD,CAAA,E,cAA8DC,YAAAA,CAAAA,EAA9D,GAA+EN,KAArF,AAAM;IACN,MAAMO,cAAc,GAAGC,uCAAiB,CAACf,wCAAD,EAAqBQ,mBAArB,CAAxC,AAAA;IACA,MAAMQ,SAAS,GAAGb,kCAAY,CAACK,mBAAD,CAA9B,AAAA;IACA,MAAM,CAACE,IAAI,GAAG,KAAR,EAAeO,OA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AM,E,qBAAE1B,mBAAF,CAAA,EAAuB,GAAGwF,UAAH,EAAvB,GAAyCzF,KAA/C,AAAM;IACN,MAAMS,SAAS,GAAGb,kCAAY,CAACK,mBAAD,CAA9B,AAAA;IACA,OAAA,aAAO,CAAA,0BAAA,CAAC,6BAAD,EAAA,2DAAA,CAAA,EAAA,EAAyBQ,SAAzB,EAAwCgF,UAAxC,EAAP;QAA2D,GAAG,EAAE9D,YAAL;KAApD,CAAA,CAAP,CAAO;CAJe,CAA1B,AAKG;AAGH,aAAA,CAAA,MAAA,CAAA,MAAA,CAAA,yCAAA,EAAA;IAAA,WAAA,EAAA,gCAAA;CAAA,CAAA,CAAA;AAEA,oGAAA,CAEA,MAAM+D,yCAAI,GAAG3F,yCAAb,AAAA;AACA,MAAM4F,yCAAO,GAAGlE,yCAAhB,AAAA;AACA,MAAMmE,yCAAO,GAAG/C,yCAAhB,AAAA;AACA,MAAMgD,yCAAK,GAAGhC,yCAAd,AAAA;AACA,MAAMiC,yCAAK,GAAG9B,yCAAd,AAAA;AACA,MAAM+B,yCAAI,GAAG5B,yCAAb,AAAA;AACA,MAAM6B,yCAAW,GAAG1B,yCAApB,AAAA;AACA,MAAM2B,yCAAY,GAAGxB,yCAArB,AAAA;AACA,MAAMyB,yCAAU,GAAGtB,yCAAnB,AAAA;AACA,MAAMuB,yCAAS,GAAGpB,yCAAlB,AAAA;AACA,MAAMqB,yCAAa,GAAGlB,yCAAtB,AAAA;AACA,MAAMmB,yCAAS,GAAGhB,yCAAlB,AAAA;AACA,MAAMiB,yCAAK,GAAGd,yCAAd,AAAA;;ADrfA","sources":["packages/react/dropdown-menu/src/index.ts","packages/react/dropdown-menu/src/DropdownMenu.tsx"],"sourcesContent":["export * from './DropdownMenu';\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport { useId } from '@radix-ui/react-id';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst DROPDOWN_MENU_NAME = 'DropdownMenu';\n\ntype ScopedProps<P> = P & { __scopeDropdownMenu?: Scope };\nconst [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(\n DROPDOWN_MENU_NAME,\n [createMenuScope]\n);\nconst useMenuScope = createMenuScope();\n\ntype DropdownMenuRootContextValue = {\n isRootMenu: true;\n triggerId: string;\n triggerRef: React.RefObject<HTMLButtonElement>;\n contentId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\ntype DropdownMenuSubContextValue = {\n isRootMenu: false;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n};\n\nconst [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext<\n DropdownMenuRootContextValue | DropdownMenuSubContextValue\n>(DROPDOWN_MENU_NAME);\n\ninterface DropdownMenuProps {\n children?: React.ReactNode;\n dir?: Direction;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n}\n\nconst DropdownMenu: React.FC<DropdownMenuProps> = (props: ScopedProps<DropdownMenuProps>) => {\n const { __scopeDropdownMenu, children, open: openProp, defaultOpen, onOpenChange } = props;\n const contentContext = useContentContext(DROPDOWN_MENU_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n const handleOpenToggle = React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]);\n\n return contentContext.isInsideContent ? (\n <DropdownMenuProvider\n scope={__scopeDropdownMenu}\n isRootMenu={false}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={handleOpenToggle}\n >\n <MenuPrimitive.Sub {...menuScope} open={open} onOpenChange={setOpen}>\n {children}\n </MenuPrimitive.Sub>\n </DropdownMenuProvider>\n ) : (\n <DropdownMenuRoot {...props} open={open} onOpenChange={setOpen} onOpenToggle={handleOpenToggle}>\n {children}\n </DropdownMenuRoot>\n );\n};\n\nDropdownMenu.displayName = DROPDOWN_MENU_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ninterface DropdownMenuRootProps {\n children?: React.ReactNode;\n dir?: Direction;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal?: boolean;\n}\n\nconst DropdownMenuRoot: React.FC<DropdownMenuRootProps> = (\n props: ScopedProps<DropdownMenuRootProps>\n) => {\n const {\n __scopeDropdownMenu,\n children,\n dir,\n open,\n onOpenChange,\n onOpenToggle,\n modal = true,\n } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n return (\n <DropdownMenuProvider\n scope={__scopeDropdownMenu}\n isRootMenu={true}\n triggerId={useId()}\n triggerRef={triggerRef}\n contentId={useId()}\n open={open}\n onOpenChange={onOpenChange}\n onOpenToggle={onOpenToggle}\n modal={modal}\n >\n <MenuPrimitive.Root\n {...menuScope}\n open={open}\n onOpenChange={onOpenChange}\n dir={dir}\n modal={modal}\n >\n {children}\n </MenuPrimitive.Root>\n </DropdownMenuProvider>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DropdownMenuTrigger';\n\ntype DropdownMenuTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface DropdownMenuTriggerProps extends PrimitiveButtonProps {}\n\nconst DropdownMenuTrigger = React.forwardRef<DropdownMenuTriggerElement, DropdownMenuTriggerProps>(\n (props: ScopedProps<DropdownMenuTriggerProps>, forwardedRef) => {\n const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;\n const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return context.isRootMenu ? (\n <MenuPrimitive.Anchor asChild {...menuScope}>\n <Primitive.button\n type=\"button\"\n id={context.triggerId}\n aria-haspopup=\"menu\"\n aria-expanded={context.open ? true : undefined}\n aria-controls={context.open ? context.contentId : undefined}\n data-state={context.open ? 'open' : 'closed'}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n {...triggerProps}\n ref={composeRefs(forwardedRef, context.triggerRef)}\n onPointerDown={composeEventHandlers(props.onPointerDown, (event) => {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n // prevent trigger focusing when opening\n // this allows the content to be given focus without competition\n if (!context.open) event.preventDefault();\n context.onOpenToggle();\n }\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if (['Enter', ' '].includes(event.key)) context.onOpenToggle();\n if (event.key === 'ArrowDown') context.onOpenChange(true);\n // prevent keypresses from scrolling window\n if ([' ', 'ArrowDown'].includes(event.key)) event.preventDefault();\n })}\n />\n </MenuPrimitive.Anchor>\n ) : null;\n }\n);\n\nDropdownMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DropdownMenuContent';\n\nconst [ContentProvider, useContentContext] = createDropdownMenuContext(CONTENT_NAME, {\n isInsideContent: false,\n});\n\ntype DropdownMenuContentElement =\n | DropdownMenuRootContentElement\n | React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface DropdownMenuContentProps extends DropdownMenuRootContentProps, MenuContentProps {}\n\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n (props: ScopedProps<DropdownMenuContentProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const commonProps = {\n ...contentProps,\n style: {\n ...props.style,\n // re-namespace exposed content custom property\n ['--radix-dropdown-menu-content-transform-origin' as any]:\n 'var(--radix-popper-transform-origin)',\n },\n };\n\n return (\n <ContentProvider scope={__scopeDropdownMenu} isInsideContent={true}>\n {context.isRootMenu ? (\n <DropdownMenuRootContent\n __scopeDropdownMenu={__scopeDropdownMenu}\n {...commonProps}\n ref={forwardedRef}\n />\n ) : (\n <MenuPrimitive.Content {...menuScope} {...commonProps} ref={forwardedRef} />\n )}\n </ContentProvider>\n );\n }\n);\n\nDropdownMenuContent.displayName = CONTENT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype DropdownMenuRootContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ninterface DropdownMenuRootContentProps extends ScopedProps<MenuContentProps> {}\n\nconst DropdownMenuRootContent = React.forwardRef<\n DropdownMenuRootContentElement,\n DropdownMenuRootContentProps\n>((props, forwardedRef) => {\n const { __scopeDropdownMenu, portalled = true, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n return context.isRootMenu ? (\n <MenuPrimitive.Content\n id={context.contentId}\n aria-labelledby={context.triggerId}\n {...menuScope}\n {...contentProps}\n ref={forwardedRef}\n portalled={portalled}\n onCloseAutoFocus={composeEventHandlers(props.onCloseAutoFocus, (event) => {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n hasInteractedOutsideRef.current = false;\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n })}\n onInteractOutside={composeEventHandlers(props.onInteractOutside, (event) => {\n const originalEvent = event.detail.originalEvent as PointerEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;\n })}\n />\n ) : null;\n});\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'DropdownMenuGroup';\n\ntype DropdownMenuGroupElement = React.ElementRef<typeof MenuPrimitive.Group>;\ntype MenuGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;\ninterface DropdownMenuGroupProps extends MenuGroupProps {}\n\nconst DropdownMenuGroup = React.forwardRef<DropdownMenuGroupElement, DropdownMenuGroupProps>(\n (props: ScopedProps<DropdownMenuGroupProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Group {...menuScope} {...groupProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'DropdownMenuLabel';\n\ntype DropdownMenuLabelElement = React.ElementRef<typeof MenuPrimitive.Label>;\ntype MenuLabelProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Label>;\ninterface DropdownMenuLabelProps extends MenuLabelProps {}\n\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n (props: ScopedProps<DropdownMenuLabelProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Label {...menuScope} {...labelProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'DropdownMenuItem';\n\ntype DropdownMenuItemElement = React.ElementRef<typeof MenuPrimitive.Item>;\ntype MenuItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;\ninterface DropdownMenuItemProps extends MenuItemProps {}\n\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n (props: ScopedProps<DropdownMenuItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Item {...menuScope} {...itemProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuTriggerItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_ITEM_NAME = 'DropdownMenuTriggerItem';\n\ntype DropdownMenuTriggerItemElement = React.ElementRef<typeof MenuPrimitive.SubTrigger>;\ntype MenuSubTriggerProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;\ninterface DropdownMenuTriggerItemProps extends MenuSubTriggerProps {}\n\nconst DropdownMenuTriggerItem = React.forwardRef<\n DropdownMenuTriggerItemElement,\n DropdownMenuTriggerItemProps\n>((props: ScopedProps<DropdownMenuTriggerItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...triggerItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.SubTrigger {...menuScope} {...triggerItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuTriggerItem.displayName = TRIGGER_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'DropdownMenuCheckboxItem';\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<typeof MenuPrimitive.CheckboxItem>;\ntype MenuCheckboxItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>;\ninterface DropdownMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props: ScopedProps<DropdownMenuCheckboxItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.CheckboxItem {...menuScope} {...checkboxItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'DropdownMenuRadioGroup';\n\ntype DropdownMenuRadioGroupElement = React.ElementRef<typeof MenuPrimitive.RadioGroup>;\ntype MenuRadioGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioGroup>;\ninterface DropdownMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>((props: ScopedProps<DropdownMenuRadioGroupProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.RadioGroup {...menuScope} {...radioGroupProps} ref={forwardedRef} />;\n});\n\nDropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'DropdownMenuRadioItem';\n\ntype DropdownMenuRadioItemElement = React.ElementRef<typeof MenuPrimitive.RadioItem>;\ntype MenuRadioItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>;\ninterface DropdownMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props: ScopedProps<DropdownMenuRadioItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.RadioItem {...menuScope} {...radioItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'DropdownMenuItemIndicator';\n\ntype DropdownMenuItemIndicatorElement = React.ElementRef<typeof MenuPrimitive.ItemIndicator>;\ntype MenuItemIndicatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.ItemIndicator>;\ninterface DropdownMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst DropdownMenuItemIndicator = React.forwardRef<\n DropdownMenuItemIndicatorElement,\n DropdownMenuItemIndicatorProps\n>((props: ScopedProps<DropdownMenuItemIndicatorProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.ItemIndicator {...menuScope} {...itemIndicatorProps} ref={forwardedRef} />;\n});\n\nDropdownMenuItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'DropdownMenuSeparator';\n\ntype DropdownMenuSeparatorElement = React.ElementRef<typeof MenuPrimitive.Separator>;\ntype MenuSeparatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Separator>;\ninterface DropdownMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>((props: ScopedProps<DropdownMenuSeparatorProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Separator {...menuScope} {...separatorProps} ref={forwardedRef} />;\n});\n\nDropdownMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'DropdownMenuArrow';\n\ntype DropdownMenuArrowElement = React.ElementRef<typeof MenuPrimitive.Arrow>;\ntype MenuArrowProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Arrow>;\ninterface DropdownMenuArrowProps extends MenuArrowProps {}\n\nconst DropdownMenuArrow = React.forwardRef<DropdownMenuArrowElement, DropdownMenuArrowProps>(\n (props: ScopedProps<DropdownMenuArrowProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Arrow {...menuScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = DropdownMenu;\nconst Trigger = DropdownMenuTrigger;\nconst Content = DropdownMenuContent;\nconst Group = DropdownMenuGroup;\nconst Label = DropdownMenuLabel;\nconst Item = DropdownMenuItem;\nconst TriggerItem = DropdownMenuTriggerItem;\nconst CheckboxItem = DropdownMenuCheckboxItem;\nconst RadioGroup = DropdownMenuRadioGroup;\nconst RadioItem = DropdownMenuRadioItem;\nconst ItemIndicator = DropdownMenuItemIndicator;\nconst Separator = DropdownMenuSeparator;\nconst Arrow = DropdownMenuArrow;\n\nexport {\n createDropdownMenuScope,\n //\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuTriggerItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuItemIndicator,\n DropdownMenuSeparator,\n DropdownMenuArrow,\n //\n Root,\n Trigger,\n Content,\n Group,\n Label,\n Item,\n TriggerItem,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n};\nexport type {\n DropdownMenuProps,\n DropdownMenuTriggerProps,\n DropdownMenuContentProps,\n DropdownMenuGroupProps,\n DropdownMenuLabelProps,\n DropdownMenuItemProps,\n DropdownMenuTriggerItemProps,\n DropdownMenuCheckboxItemProps,\n DropdownMenuRadioGroupProps,\n DropdownMenuRadioItemProps,\n DropdownMenuItemIndicatorProps,\n DropdownMenuSeparatorProps,\n DropdownMenuArrowProps,\n};\n"],"names":["React","composeEventHandlers","composeRefs","createContextScope","useControllableState","Primitive","MenuPrimitive","createMenuScope","useId","DROPDOWN_MENU_NAME","createDropdownMenuContext","createDropdownMenuScope","useMenuScope","DropdownMenuProvider","useDropdownMenuContext","DropdownMenu","props","__scopeDropdownMenu","children","open","openProp","defaultOpen","onOpenChange","contentContext","useContentContext","menuScope","setOpen","prop","defaultProp","onChange","handleOpenToggle","useCallback","prevOpen","isInsideContent","DropdownMenuRoot","dir","onOpenToggle","modal","triggerRef","useRef","TRIGGER_NAME","DropdownMenuTrigger","forwardRef","forwardedRef","disabled","triggerProps","context","isRootMenu","triggerId","undefined","contentId","onPointerDown","event","button","ctrlKey","preventDefault","onKeyDown","includes","key","CONTENT_NAME","ContentProvider","DropdownMenuContent","contentProps","commonProps","style","DropdownMenuRootContent","portalled","hasInteractedOutsideRef","onCloseAutoFocus","current","focus","onInteractOutside","originalEvent","detail","ctrlLeftClick","isRightClick","GROUP_NAME","DropdownMenuGroup","groupProps","LABEL_NAME","DropdownMenuLabel","labelProps","ITEM_NAME","DropdownMenuItem","itemProps","TRIGGER_ITEM_NAME","DropdownMenuTriggerItem","triggerItemProps","CHECKBOX_ITEM_NAME","DropdownMenuCheckboxItem","checkboxItemProps","RADIO_GROUP_NAME","DropdownMenuRadioGroup","radioGroupProps","RADIO_ITEM_NAME","DropdownMenuRadioItem","radioItemProps","INDICATOR_NAME","DropdownMenuItemIndicator","itemIndicatorProps","SEPARATOR_NAME","DropdownMenuSeparator","separatorProps","ARROW_NAME","DropdownMenuArrow","arrowProps","Root","Trigger","Content","Group","Label","Item","TriggerItem","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow"],"version":3,"file":"index.js.map"}
|
package/dist/index.module.js
CHANGED
|
@@ -1,2 +1,366 @@
|
|
|
1
|
-
import
|
|
1
|
+
import $9kmUS$babelruntimehelpersesmextends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import {useCallback as $9kmUS$useCallback, createElement as $9kmUS$createElement, useRef as $9kmUS$useRef, 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, Sub as $9kmUS$Sub, Root as $9kmUS$Root, Anchor as $9kmUS$Anchor, Content as $9kmUS$Content, Group as $9kmUS$Group, Label as $9kmUS$Label, Item as $9kmUS$Item, SubTrigger as $9kmUS$SubTrigger, CheckboxItem as $9kmUS$CheckboxItem, RadioGroup as $9kmUS$RadioGroup, RadioItem as $9kmUS$RadioItem, ItemIndicator as $9kmUS$ItemIndicator, Separator as $9kmUS$Separator, Arrow as $9kmUS$Arrow} from "@radix-ui/react-menu";
|
|
9
|
+
import {useId as $9kmUS$useId} from "@radix-ui/react-id";
|
|
10
|
+
|
|
11
|
+
function $parcel$export(e, n, v, s) {
|
|
12
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
13
|
+
}
|
|
14
|
+
var $d08ef79370b62062$exports = {};
|
|
15
|
+
|
|
16
|
+
$parcel$export($d08ef79370b62062$exports, "createDropdownMenuScope", () => $d08ef79370b62062$export$c0623cd925aeb687);
|
|
17
|
+
$parcel$export($d08ef79370b62062$exports, "DropdownMenu", () => $d08ef79370b62062$export$e44a253a59704894);
|
|
18
|
+
$parcel$export($d08ef79370b62062$exports, "DropdownMenuTrigger", () => $d08ef79370b62062$export$d2469213b3befba9);
|
|
19
|
+
$parcel$export($d08ef79370b62062$exports, "DropdownMenuContent", () => $d08ef79370b62062$export$6e76d93a37c01248);
|
|
20
|
+
$parcel$export($d08ef79370b62062$exports, "DropdownMenuGroup", () => $d08ef79370b62062$export$246bebaba3a2f70e);
|
|
21
|
+
$parcel$export($d08ef79370b62062$exports, "DropdownMenuLabel", () => $d08ef79370b62062$export$76e48c5b57f24495);
|
|
22
|
+
$parcel$export($d08ef79370b62062$exports, "DropdownMenuItem", () => $d08ef79370b62062$export$ed97964d1871885d);
|
|
23
|
+
$parcel$export($d08ef79370b62062$exports, "DropdownMenuTriggerItem", () => $d08ef79370b62062$export$eb7a5647860df79a);
|
|
24
|
+
$parcel$export($d08ef79370b62062$exports, "DropdownMenuCheckboxItem", () => $d08ef79370b62062$export$53a69729da201fa9);
|
|
25
|
+
$parcel$export($d08ef79370b62062$exports, "DropdownMenuRadioGroup", () => $d08ef79370b62062$export$3323ad73d55f587e);
|
|
26
|
+
$parcel$export($d08ef79370b62062$exports, "DropdownMenuRadioItem", () => $d08ef79370b62062$export$e4f69b41b1637536);
|
|
27
|
+
$parcel$export($d08ef79370b62062$exports, "DropdownMenuItemIndicator", () => $d08ef79370b62062$export$42355ae145153fb6);
|
|
28
|
+
$parcel$export($d08ef79370b62062$exports, "DropdownMenuSeparator", () => $d08ef79370b62062$export$da160178fd3bc7e9);
|
|
29
|
+
$parcel$export($d08ef79370b62062$exports, "DropdownMenuArrow", () => $d08ef79370b62062$export$34b8980744021ec5);
|
|
30
|
+
$parcel$export($d08ef79370b62062$exports, "Root", () => $d08ef79370b62062$export$be92b6f5f03c0fe9);
|
|
31
|
+
$parcel$export($d08ef79370b62062$exports, "Trigger", () => $d08ef79370b62062$export$41fb9f06171c75f4);
|
|
32
|
+
$parcel$export($d08ef79370b62062$exports, "Content", () => $d08ef79370b62062$export$7c6e2c02157bb7d2);
|
|
33
|
+
$parcel$export($d08ef79370b62062$exports, "Group", () => $d08ef79370b62062$export$eb2fcfdbd7ba97d4);
|
|
34
|
+
$parcel$export($d08ef79370b62062$exports, "Label", () => $d08ef79370b62062$export$b04be29aa201d4f5);
|
|
35
|
+
$parcel$export($d08ef79370b62062$exports, "Item", () => $d08ef79370b62062$export$6d08773d2e66f8f2);
|
|
36
|
+
$parcel$export($d08ef79370b62062$exports, "TriggerItem", () => $d08ef79370b62062$export$6d0911d397e3b965);
|
|
37
|
+
$parcel$export($d08ef79370b62062$exports, "CheckboxItem", () => $d08ef79370b62062$export$16ce288f89fa631c);
|
|
38
|
+
$parcel$export($d08ef79370b62062$exports, "RadioGroup", () => $d08ef79370b62062$export$a98f0dcb43a68a25);
|
|
39
|
+
$parcel$export($d08ef79370b62062$exports, "RadioItem", () => $d08ef79370b62062$export$371ab307eab489c0);
|
|
40
|
+
$parcel$export($d08ef79370b62062$exports, "ItemIndicator", () => $d08ef79370b62062$export$c3468e2714d175fa);
|
|
41
|
+
$parcel$export($d08ef79370b62062$exports, "Separator", () => $d08ef79370b62062$export$1ff3c3f08ae963c0);
|
|
42
|
+
$parcel$export($d08ef79370b62062$exports, "Arrow", () => $d08ef79370b62062$export$21b07c8f274aebd5);
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
/* -------------------------------------------------------------------------------------------------
|
|
54
|
+
* DropdownMenu
|
|
55
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$DROPDOWN_MENU_NAME = 'DropdownMenu';
|
|
56
|
+
const [$d08ef79370b62062$var$createDropdownMenuContext, $d08ef79370b62062$export$c0623cd925aeb687] = $9kmUS$createContextScope($d08ef79370b62062$var$DROPDOWN_MENU_NAME, [
|
|
57
|
+
$9kmUS$createMenuScope
|
|
58
|
+
]);
|
|
59
|
+
const $d08ef79370b62062$var$useMenuScope = $9kmUS$createMenuScope();
|
|
60
|
+
const [$d08ef79370b62062$var$DropdownMenuProvider, $d08ef79370b62062$var$useDropdownMenuContext] = $d08ef79370b62062$var$createDropdownMenuContext($d08ef79370b62062$var$DROPDOWN_MENU_NAME);
|
|
61
|
+
const $d08ef79370b62062$export$e44a253a59704894 = (props)=>{
|
|
62
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange } = props;
|
|
63
|
+
const contentContext = $d08ef79370b62062$var$useContentContext($d08ef79370b62062$var$DROPDOWN_MENU_NAME, __scopeDropdownMenu);
|
|
64
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
65
|
+
const [open = false, setOpen] = $9kmUS$useControllableState({
|
|
66
|
+
prop: openProp,
|
|
67
|
+
defaultProp: defaultOpen,
|
|
68
|
+
onChange: onOpenChange
|
|
69
|
+
});
|
|
70
|
+
const handleOpenToggle = $9kmUS$useCallback(()=>setOpen((prevOpen)=>!prevOpen
|
|
71
|
+
)
|
|
72
|
+
, [
|
|
73
|
+
setOpen
|
|
74
|
+
]);
|
|
75
|
+
return contentContext.isInsideContent ? /*#__PURE__*/ $9kmUS$createElement($d08ef79370b62062$var$DropdownMenuProvider, {
|
|
76
|
+
scope: __scopeDropdownMenu,
|
|
77
|
+
isRootMenu: false,
|
|
78
|
+
open: open,
|
|
79
|
+
onOpenChange: setOpen,
|
|
80
|
+
onOpenToggle: handleOpenToggle
|
|
81
|
+
}, /*#__PURE__*/ $9kmUS$createElement($9kmUS$Sub, $9kmUS$babelruntimehelpersesmextends({}, menuScope, {
|
|
82
|
+
open: open,
|
|
83
|
+
onOpenChange: setOpen
|
|
84
|
+
}), children)) : /*#__PURE__*/ $9kmUS$createElement($d08ef79370b62062$var$DropdownMenuRoot, $9kmUS$babelruntimehelpersesmextends({}, props, {
|
|
85
|
+
open: open,
|
|
86
|
+
onOpenChange: setOpen,
|
|
87
|
+
onOpenToggle: handleOpenToggle
|
|
88
|
+
}), children);
|
|
89
|
+
};
|
|
90
|
+
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$e44a253a59704894, {
|
|
91
|
+
displayName: $d08ef79370b62062$var$DROPDOWN_MENU_NAME
|
|
92
|
+
});
|
|
93
|
+
/* ---------------------------------------------------------------------------------------------- */ const $d08ef79370b62062$var$DropdownMenuRoot = (props)=>{
|
|
94
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , dir: dir , open: open , onOpenChange: onOpenChange , onOpenToggle: onOpenToggle , modal: modal = true } = props;
|
|
95
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
96
|
+
const triggerRef = $9kmUS$useRef(null);
|
|
97
|
+
return /*#__PURE__*/ $9kmUS$createElement($d08ef79370b62062$var$DropdownMenuProvider, {
|
|
98
|
+
scope: __scopeDropdownMenu,
|
|
99
|
+
isRootMenu: true,
|
|
100
|
+
triggerId: $9kmUS$useId(),
|
|
101
|
+
triggerRef: triggerRef,
|
|
102
|
+
contentId: $9kmUS$useId(),
|
|
103
|
+
open: open,
|
|
104
|
+
onOpenChange: onOpenChange,
|
|
105
|
+
onOpenToggle: onOpenToggle,
|
|
106
|
+
modal: modal
|
|
107
|
+
}, /*#__PURE__*/ $9kmUS$createElement($9kmUS$Root, $9kmUS$babelruntimehelpersesmextends({}, menuScope, {
|
|
108
|
+
open: open,
|
|
109
|
+
onOpenChange: onOpenChange,
|
|
110
|
+
dir: dir,
|
|
111
|
+
modal: modal
|
|
112
|
+
}), children));
|
|
113
|
+
};
|
|
114
|
+
/* -------------------------------------------------------------------------------------------------
|
|
115
|
+
* DropdownMenuTrigger
|
|
116
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$TRIGGER_NAME = 'DropdownMenuTrigger';
|
|
117
|
+
const $d08ef79370b62062$export$d2469213b3befba9 = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
118
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , disabled: disabled = false , ...triggerProps } = props;
|
|
119
|
+
const context = $d08ef79370b62062$var$useDropdownMenuContext($d08ef79370b62062$var$TRIGGER_NAME, __scopeDropdownMenu);
|
|
120
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
121
|
+
return context.isRootMenu ? /*#__PURE__*/ $9kmUS$createElement($9kmUS$Anchor, $9kmUS$babelruntimehelpersesmextends({
|
|
122
|
+
asChild: true
|
|
123
|
+
}, menuScope), /*#__PURE__*/ $9kmUS$createElement($9kmUS$Primitive.button, $9kmUS$babelruntimehelpersesmextends({
|
|
124
|
+
type: "button",
|
|
125
|
+
id: context.triggerId,
|
|
126
|
+
"aria-haspopup": "menu",
|
|
127
|
+
"aria-expanded": context.open ? true : undefined,
|
|
128
|
+
"aria-controls": context.open ? context.contentId : undefined,
|
|
129
|
+
"data-state": context.open ? 'open' : 'closed',
|
|
130
|
+
"data-disabled": disabled ? '' : undefined,
|
|
131
|
+
disabled: disabled
|
|
132
|
+
}, triggerProps, {
|
|
133
|
+
ref: $9kmUS$composeRefs(forwardedRef, context.triggerRef),
|
|
134
|
+
onPointerDown: $9kmUS$composeEventHandlers(props.onPointerDown, (event)=>{
|
|
135
|
+
// only call handler if it's the left button (mousedown gets triggered by all mouse buttons)
|
|
136
|
+
// but not when the control key is pressed (avoiding MacOS right click)
|
|
137
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
138
|
+
// prevent trigger focusing when opening
|
|
139
|
+
// this allows the content to be given focus without competition
|
|
140
|
+
if (!context.open) event.preventDefault();
|
|
141
|
+
context.onOpenToggle();
|
|
142
|
+
}
|
|
143
|
+
}),
|
|
144
|
+
onKeyDown: $9kmUS$composeEventHandlers(props.onKeyDown, (event)=>{
|
|
145
|
+
if (disabled) return;
|
|
146
|
+
if ([
|
|
147
|
+
'Enter',
|
|
148
|
+
' '
|
|
149
|
+
].includes(event.key)) context.onOpenToggle();
|
|
150
|
+
if (event.key === 'ArrowDown') context.onOpenChange(true); // prevent keypresses from scrolling window
|
|
151
|
+
if ([
|
|
152
|
+
' ',
|
|
153
|
+
'ArrowDown'
|
|
154
|
+
].includes(event.key)) event.preventDefault();
|
|
155
|
+
})
|
|
156
|
+
}))) : null;
|
|
157
|
+
});
|
|
158
|
+
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$d2469213b3befba9, {
|
|
159
|
+
displayName: $d08ef79370b62062$var$TRIGGER_NAME
|
|
160
|
+
});
|
|
161
|
+
/* -------------------------------------------------------------------------------------------------
|
|
162
|
+
* DropdownMenuContent
|
|
163
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$CONTENT_NAME = 'DropdownMenuContent';
|
|
164
|
+
const [$d08ef79370b62062$var$ContentProvider, $d08ef79370b62062$var$useContentContext] = $d08ef79370b62062$var$createDropdownMenuContext($d08ef79370b62062$var$CONTENT_NAME, {
|
|
165
|
+
isInsideContent: false
|
|
166
|
+
});
|
|
167
|
+
const $d08ef79370b62062$export$6e76d93a37c01248 = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
168
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...contentProps } = props;
|
|
169
|
+
const context = $d08ef79370b62062$var$useDropdownMenuContext($d08ef79370b62062$var$CONTENT_NAME, __scopeDropdownMenu);
|
|
170
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
171
|
+
const commonProps = {
|
|
172
|
+
...contentProps,
|
|
173
|
+
style: {
|
|
174
|
+
...props.style,
|
|
175
|
+
// re-namespace exposed content custom property
|
|
176
|
+
['--radix-dropdown-menu-content-transform-origin']: 'var(--radix-popper-transform-origin)'
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
return /*#__PURE__*/ $9kmUS$createElement($d08ef79370b62062$var$ContentProvider, {
|
|
180
|
+
scope: __scopeDropdownMenu,
|
|
181
|
+
isInsideContent: true
|
|
182
|
+
}, context.isRootMenu ? /*#__PURE__*/ $9kmUS$createElement($d08ef79370b62062$var$DropdownMenuRootContent, $9kmUS$babelruntimehelpersesmextends({
|
|
183
|
+
__scopeDropdownMenu: __scopeDropdownMenu
|
|
184
|
+
}, commonProps, {
|
|
185
|
+
ref: forwardedRef
|
|
186
|
+
})) : /*#__PURE__*/ $9kmUS$createElement($9kmUS$Content, $9kmUS$babelruntimehelpersesmextends({}, menuScope, commonProps, {
|
|
187
|
+
ref: forwardedRef
|
|
188
|
+
})));
|
|
189
|
+
});
|
|
190
|
+
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$6e76d93a37c01248, {
|
|
191
|
+
displayName: $d08ef79370b62062$var$CONTENT_NAME
|
|
192
|
+
});
|
|
193
|
+
/* ---------------------------------------------------------------------------------------------- */ const $d08ef79370b62062$var$DropdownMenuRootContent = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
194
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , portalled: portalled = true , ...contentProps } = props;
|
|
195
|
+
const context = $d08ef79370b62062$var$useDropdownMenuContext($d08ef79370b62062$var$CONTENT_NAME, __scopeDropdownMenu);
|
|
196
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
197
|
+
const hasInteractedOutsideRef = $9kmUS$useRef(false);
|
|
198
|
+
return context.isRootMenu ? /*#__PURE__*/ $9kmUS$createElement($9kmUS$Content, $9kmUS$babelruntimehelpersesmextends({
|
|
199
|
+
id: context.contentId,
|
|
200
|
+
"aria-labelledby": context.triggerId
|
|
201
|
+
}, menuScope, contentProps, {
|
|
202
|
+
ref: forwardedRef,
|
|
203
|
+
portalled: portalled,
|
|
204
|
+
onCloseAutoFocus: $9kmUS$composeEventHandlers(props.onCloseAutoFocus, (event)=>{
|
|
205
|
+
var _context$triggerRef$c;
|
|
206
|
+
if (!hasInteractedOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
207
|
+
hasInteractedOutsideRef.current = false; // Always prevent auto focus because we either focus manually or want user agent focus
|
|
208
|
+
event.preventDefault();
|
|
209
|
+
}),
|
|
210
|
+
onInteractOutside: $9kmUS$composeEventHandlers(props.onInteractOutside, (event)=>{
|
|
211
|
+
const originalEvent = event.detail.originalEvent;
|
|
212
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
213
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
214
|
+
if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;
|
|
215
|
+
})
|
|
216
|
+
})) : null;
|
|
217
|
+
});
|
|
218
|
+
/* -------------------------------------------------------------------------------------------------
|
|
219
|
+
* DropdownMenuGroup
|
|
220
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$GROUP_NAME = 'DropdownMenuGroup';
|
|
221
|
+
const $d08ef79370b62062$export$246bebaba3a2f70e = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
222
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...groupProps } = props;
|
|
223
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
224
|
+
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$Group, $9kmUS$babelruntimehelpersesmextends({}, menuScope, groupProps, {
|
|
225
|
+
ref: forwardedRef
|
|
226
|
+
}));
|
|
227
|
+
});
|
|
228
|
+
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$246bebaba3a2f70e, {
|
|
229
|
+
displayName: $d08ef79370b62062$var$GROUP_NAME
|
|
230
|
+
});
|
|
231
|
+
/* -------------------------------------------------------------------------------------------------
|
|
232
|
+
* DropdownMenuLabel
|
|
233
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$LABEL_NAME = 'DropdownMenuLabel';
|
|
234
|
+
const $d08ef79370b62062$export$76e48c5b57f24495 = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
235
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...labelProps } = props;
|
|
236
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
237
|
+
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$Label, $9kmUS$babelruntimehelpersesmextends({}, menuScope, labelProps, {
|
|
238
|
+
ref: forwardedRef
|
|
239
|
+
}));
|
|
240
|
+
});
|
|
241
|
+
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$76e48c5b57f24495, {
|
|
242
|
+
displayName: $d08ef79370b62062$var$LABEL_NAME
|
|
243
|
+
});
|
|
244
|
+
/* -------------------------------------------------------------------------------------------------
|
|
245
|
+
* DropdownMenuItem
|
|
246
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$ITEM_NAME = 'DropdownMenuItem';
|
|
247
|
+
const $d08ef79370b62062$export$ed97964d1871885d = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
248
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...itemProps } = props;
|
|
249
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
250
|
+
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$Item, $9kmUS$babelruntimehelpersesmextends({}, menuScope, itemProps, {
|
|
251
|
+
ref: forwardedRef
|
|
252
|
+
}));
|
|
253
|
+
});
|
|
254
|
+
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$ed97964d1871885d, {
|
|
255
|
+
displayName: $d08ef79370b62062$var$ITEM_NAME
|
|
256
|
+
});
|
|
257
|
+
/* -------------------------------------------------------------------------------------------------
|
|
258
|
+
* DropdownMenuTriggerItem
|
|
259
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$TRIGGER_ITEM_NAME = 'DropdownMenuTriggerItem';
|
|
260
|
+
const $d08ef79370b62062$export$eb7a5647860df79a = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
261
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...triggerItemProps } = props;
|
|
262
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
263
|
+
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$SubTrigger, $9kmUS$babelruntimehelpersesmextends({}, menuScope, triggerItemProps, {
|
|
264
|
+
ref: forwardedRef
|
|
265
|
+
}));
|
|
266
|
+
});
|
|
267
|
+
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$eb7a5647860df79a, {
|
|
268
|
+
displayName: $d08ef79370b62062$var$TRIGGER_ITEM_NAME
|
|
269
|
+
});
|
|
270
|
+
/* -------------------------------------------------------------------------------------------------
|
|
271
|
+
* DropdownMenuCheckboxItem
|
|
272
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$CHECKBOX_ITEM_NAME = 'DropdownMenuCheckboxItem';
|
|
273
|
+
const $d08ef79370b62062$export$53a69729da201fa9 = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
274
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...checkboxItemProps } = props;
|
|
275
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
276
|
+
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$CheckboxItem, $9kmUS$babelruntimehelpersesmextends({}, menuScope, checkboxItemProps, {
|
|
277
|
+
ref: forwardedRef
|
|
278
|
+
}));
|
|
279
|
+
});
|
|
280
|
+
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$53a69729da201fa9, {
|
|
281
|
+
displayName: $d08ef79370b62062$var$CHECKBOX_ITEM_NAME
|
|
282
|
+
});
|
|
283
|
+
/* -------------------------------------------------------------------------------------------------
|
|
284
|
+
* DropdownMenuRadioGroup
|
|
285
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$RADIO_GROUP_NAME = 'DropdownMenuRadioGroup';
|
|
286
|
+
const $d08ef79370b62062$export$3323ad73d55f587e = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
287
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...radioGroupProps } = props;
|
|
288
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
289
|
+
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$RadioGroup, $9kmUS$babelruntimehelpersesmextends({}, menuScope, radioGroupProps, {
|
|
290
|
+
ref: forwardedRef
|
|
291
|
+
}));
|
|
292
|
+
});
|
|
293
|
+
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$3323ad73d55f587e, {
|
|
294
|
+
displayName: $d08ef79370b62062$var$RADIO_GROUP_NAME
|
|
295
|
+
});
|
|
296
|
+
/* -------------------------------------------------------------------------------------------------
|
|
297
|
+
* DropdownMenuRadioItem
|
|
298
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$RADIO_ITEM_NAME = 'DropdownMenuRadioItem';
|
|
299
|
+
const $d08ef79370b62062$export$e4f69b41b1637536 = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
300
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...radioItemProps } = props;
|
|
301
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
302
|
+
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$RadioItem, $9kmUS$babelruntimehelpersesmextends({}, menuScope, radioItemProps, {
|
|
303
|
+
ref: forwardedRef
|
|
304
|
+
}));
|
|
305
|
+
});
|
|
306
|
+
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$e4f69b41b1637536, {
|
|
307
|
+
displayName: $d08ef79370b62062$var$RADIO_ITEM_NAME
|
|
308
|
+
});
|
|
309
|
+
/* -------------------------------------------------------------------------------------------------
|
|
310
|
+
* DropdownMenuItemIndicator
|
|
311
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$INDICATOR_NAME = 'DropdownMenuItemIndicator';
|
|
312
|
+
const $d08ef79370b62062$export$42355ae145153fb6 = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
313
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...itemIndicatorProps } = props;
|
|
314
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
315
|
+
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$ItemIndicator, $9kmUS$babelruntimehelpersesmextends({}, menuScope, itemIndicatorProps, {
|
|
316
|
+
ref: forwardedRef
|
|
317
|
+
}));
|
|
318
|
+
});
|
|
319
|
+
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$42355ae145153fb6, {
|
|
320
|
+
displayName: $d08ef79370b62062$var$INDICATOR_NAME
|
|
321
|
+
});
|
|
322
|
+
/* -------------------------------------------------------------------------------------------------
|
|
323
|
+
* DropdownMenuSeparator
|
|
324
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$SEPARATOR_NAME = 'DropdownMenuSeparator';
|
|
325
|
+
const $d08ef79370b62062$export$da160178fd3bc7e9 = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
326
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...separatorProps } = props;
|
|
327
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
328
|
+
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$Separator, $9kmUS$babelruntimehelpersesmextends({}, menuScope, separatorProps, {
|
|
329
|
+
ref: forwardedRef
|
|
330
|
+
}));
|
|
331
|
+
});
|
|
332
|
+
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$da160178fd3bc7e9, {
|
|
333
|
+
displayName: $d08ef79370b62062$var$SEPARATOR_NAME
|
|
334
|
+
});
|
|
335
|
+
/* -------------------------------------------------------------------------------------------------
|
|
336
|
+
* DropdownMenuArrow
|
|
337
|
+
* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$ARROW_NAME = 'DropdownMenuArrow';
|
|
338
|
+
const $d08ef79370b62062$export$34b8980744021ec5 = /*#__PURE__*/ $9kmUS$forwardRef((props, forwardedRef)=>{
|
|
339
|
+
const { __scopeDropdownMenu: __scopeDropdownMenu , ...arrowProps } = props;
|
|
340
|
+
const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
|
|
341
|
+
return /*#__PURE__*/ $9kmUS$createElement($9kmUS$Arrow, $9kmUS$babelruntimehelpersesmextends({}, menuScope, arrowProps, {
|
|
342
|
+
ref: forwardedRef
|
|
343
|
+
}));
|
|
344
|
+
});
|
|
345
|
+
/*#__PURE__*/ Object.assign($d08ef79370b62062$export$34b8980744021ec5, {
|
|
346
|
+
displayName: $d08ef79370b62062$var$ARROW_NAME
|
|
347
|
+
});
|
|
348
|
+
/* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$export$be92b6f5f03c0fe9 = $d08ef79370b62062$export$e44a253a59704894;
|
|
349
|
+
const $d08ef79370b62062$export$41fb9f06171c75f4 = $d08ef79370b62062$export$d2469213b3befba9;
|
|
350
|
+
const $d08ef79370b62062$export$7c6e2c02157bb7d2 = $d08ef79370b62062$export$6e76d93a37c01248;
|
|
351
|
+
const $d08ef79370b62062$export$eb2fcfdbd7ba97d4 = $d08ef79370b62062$export$246bebaba3a2f70e;
|
|
352
|
+
const $d08ef79370b62062$export$b04be29aa201d4f5 = $d08ef79370b62062$export$76e48c5b57f24495;
|
|
353
|
+
const $d08ef79370b62062$export$6d08773d2e66f8f2 = $d08ef79370b62062$export$ed97964d1871885d;
|
|
354
|
+
const $d08ef79370b62062$export$6d0911d397e3b965 = $d08ef79370b62062$export$eb7a5647860df79a;
|
|
355
|
+
const $d08ef79370b62062$export$16ce288f89fa631c = $d08ef79370b62062$export$53a69729da201fa9;
|
|
356
|
+
const $d08ef79370b62062$export$a98f0dcb43a68a25 = $d08ef79370b62062$export$3323ad73d55f587e;
|
|
357
|
+
const $d08ef79370b62062$export$371ab307eab489c0 = $d08ef79370b62062$export$e4f69b41b1637536;
|
|
358
|
+
const $d08ef79370b62062$export$c3468e2714d175fa = $d08ef79370b62062$export$42355ae145153fb6;
|
|
359
|
+
const $d08ef79370b62062$export$1ff3c3f08ae963c0 = $d08ef79370b62062$export$da160178fd3bc7e9;
|
|
360
|
+
const $d08ef79370b62062$export$21b07c8f274aebd5 = $d08ef79370b62062$export$34b8980744021ec5;
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
export {$d08ef79370b62062$export$c0623cd925aeb687 as createDropdownMenuScope, $d08ef79370b62062$export$e44a253a59704894 as DropdownMenu, $d08ef79370b62062$export$d2469213b3befba9 as DropdownMenuTrigger, $d08ef79370b62062$export$6e76d93a37c01248 as DropdownMenuContent, $d08ef79370b62062$export$246bebaba3a2f70e as DropdownMenuGroup, $d08ef79370b62062$export$76e48c5b57f24495 as DropdownMenuLabel, $d08ef79370b62062$export$ed97964d1871885d as DropdownMenuItem, $d08ef79370b62062$export$eb7a5647860df79a as DropdownMenuTriggerItem, $d08ef79370b62062$export$53a69729da201fa9 as DropdownMenuCheckboxItem, $d08ef79370b62062$export$3323ad73d55f587e as DropdownMenuRadioGroup, $d08ef79370b62062$export$e4f69b41b1637536 as DropdownMenuRadioItem, $d08ef79370b62062$export$42355ae145153fb6 as DropdownMenuItemIndicator, $d08ef79370b62062$export$da160178fd3bc7e9 as DropdownMenuSeparator, $d08ef79370b62062$export$34b8980744021ec5 as DropdownMenuArrow, $d08ef79370b62062$export$be92b6f5f03c0fe9 as Root, $d08ef79370b62062$export$41fb9f06171c75f4 as Trigger, $d08ef79370b62062$export$7c6e2c02157bb7d2 as Content, $d08ef79370b62062$export$eb2fcfdbd7ba97d4 as Group, $d08ef79370b62062$export$b04be29aa201d4f5 as Label, $d08ef79370b62062$export$6d08773d2e66f8f2 as Item, $d08ef79370b62062$export$6d0911d397e3b965 as TriggerItem, $d08ef79370b62062$export$16ce288f89fa631c as CheckboxItem, $d08ef79370b62062$export$a98f0dcb43a68a25 as RadioGroup, $d08ef79370b62062$export$371ab307eab489c0 as RadioItem, $d08ef79370b62062$export$c3468e2714d175fa as ItemIndicator, $d08ef79370b62062$export$1ff3c3f08ae963c0 as Separator, $d08ef79370b62062$export$21b07c8f274aebd5 as Arrow};
|
|
2
366
|
//# sourceMappingURL=index.module.js.map
|
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"0gBAmBA,MAGOA,EAA2BC,GAA2BC,EAHlC,eAKzB,CAACC,yCAEH,MAAMC,EAAeD,KAoBdE,EAAsBC,GAA0BN,EA3B5B,uBAwC3B,MAAMO,aAA6CC,IACjD,MAAMC,oBAAEA,EAAFC,SAAuBA,EAAUC,KAAMC,EAAvCC,YAAiDA,EAAjDC,aAA8DA,GAAiBN,EAC/EO,EAAiBC,EA1CE,eA0CoCP,GACvDQ,EAAYb,EAAaK,IACxBE,GAAO,EAAOO,GAAWC,EAAqB,CACnDC,KAAMR,EACNS,YAAaR,EACbS,SAAUR,IAGNS,EAAmBC,E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wB0G,GAAmB3G,EAC7CS,EAAYb,EAAaK,gBAC/B,OAAOmB,EAAAC,cAACK,EAAckF,UAAfhF,EAAA,GAA6BnB,EAAekG,EAA5C,CAA4DvD,IAAKX,4BAe1E,MAAMoE,+BAAoB7F,EAAMwB,YAC9B,CAACxC,EAA4CyC,KAC3C,MAAMxC,oBAAEA,KAAwB6G,GAAe9G,EACzCS,EAAYb,EAAaK,gBAC/B,OAAOmB,EAAAC,cAACK,EAAcqF,MAAfnF,EAAA,GAAyBnB,EAAeqG,EAAxC,CAAoD1D,IAAKX,4BAQpE,MAAMH,KAAOvC,oBACb,MAAMiH,QAAUzE,2BAChB,MAAM8B,QAAUN,2BAChB,MAAMqB,MAAQF,yBACd,MAAMK,MAAQF,yBACd,MAAMK,KAAOF,wBACb,MAAMyB,YAActB,+BACpB,MAAMK,aAAeF,gCACrB,MAAMK,WAAaF,8BACnB,MAAMK,UAAYF,6BAClB,MAAMK,cAAgBF,iCACtB,MAAMK,UAAYF,6BAClB,MAAMK,MAAQF","sources":["./packages/react/dropdown-menu/src/DropdownMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport { useId } from '@radix-ui/react-id';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst DROPDOWN_MENU_NAME = 'DropdownMenu';\n\ntype ScopedProps<P> = P & { __scopeDropdownMenu?: Scope };\nconst [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(\n DROPDOWN_MENU_NAME,\n [createMenuScope]\n);\nconst useMenuScope = createMenuScope();\n\ntype DropdownMenuRootContextValue = {\n isRootMenu: true;\n triggerId: string;\n triggerRef: React.RefObject<HTMLButtonElement>;\n contentId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\ntype DropdownMenuSubContextValue = {\n isRootMenu: false;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n};\n\nconst [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext<\n DropdownMenuRootContextValue | DropdownMenuSubContextValue\n>(DROPDOWN_MENU_NAME);\n\ninterface DropdownMenuProps {\n dir?: Direction;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n children?: React.ReactNode;\n}\n\nconst DropdownMenu: React.FC<DropdownMenuProps> = (props: ScopedProps<DropdownMenuProps>) => {\n const { __scopeDropdownMenu, children, open: openProp, defaultOpen, onOpenChange } = props;\n const contentContext = useContentContext(DROPDOWN_MENU_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n const handleOpenToggle = React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]);\n\n return contentContext.isInsideContent ? (\n <DropdownMenuProvider\n scope={__scopeDropdownMenu}\n isRootMenu={false}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={handleOpenToggle}\n >\n <MenuPrimitive.Sub {...menuScope} open={open} onOpenChange={setOpen}>\n {children}\n </MenuPrimitive.Sub>\n </DropdownMenuProvider>\n ) : (\n <DropdownMenuRoot {...props} open={open} onOpenChange={setOpen} onOpenToggle={handleOpenToggle}>\n {children}\n </DropdownMenuRoot>\n );\n};\n\nDropdownMenu.displayName = DROPDOWN_MENU_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ninterface DropdownMenuRootProps {\n dir?: Direction;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal?: boolean;\n children?: React.ReactNode;\n}\n\nconst DropdownMenuRoot: React.FC<DropdownMenuRootProps> = (\n props: ScopedProps<DropdownMenuRootProps>\n) => {\n const {\n __scopeDropdownMenu,\n children,\n dir,\n open,\n onOpenChange,\n onOpenToggle,\n modal = true,\n } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n return (\n <DropdownMenuProvider\n scope={__scopeDropdownMenu}\n isRootMenu={true}\n triggerId={useId()}\n triggerRef={triggerRef}\n contentId={useId()}\n open={open}\n onOpenChange={onOpenChange}\n onOpenToggle={onOpenToggle}\n modal={modal}\n >\n <MenuPrimitive.Root\n {...menuScope}\n open={open}\n onOpenChange={onOpenChange}\n dir={dir}\n modal={modal}\n >\n {children}\n </MenuPrimitive.Root>\n </DropdownMenuProvider>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DropdownMenuTrigger';\n\ntype DropdownMenuTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface DropdownMenuTriggerProps extends PrimitiveButtonProps {}\n\nconst DropdownMenuTrigger = React.forwardRef<DropdownMenuTriggerElement, DropdownMenuTriggerProps>(\n (props: ScopedProps<DropdownMenuTriggerProps>, forwardedRef) => {\n const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;\n const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return context.isRootMenu ? (\n <MenuPrimitive.Anchor asChild {...menuScope}>\n <Primitive.button\n type=\"button\"\n id={context.triggerId}\n aria-haspopup=\"menu\"\n aria-expanded={context.open ? true : undefined}\n aria-controls={context.open ? context.contentId : undefined}\n data-state={context.open ? 'open' : 'closed'}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n {...triggerProps}\n ref={composeRefs(forwardedRef, context.triggerRef)}\n onPointerDown={composeEventHandlers(props.onPointerDown, (event) => {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n // prevent trigger focusing when opening\n // this allows the content to be given focus without competition\n if (!context.open) event.preventDefault();\n context.onOpenToggle();\n }\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if (['Enter', ' '].includes(event.key)) context.onOpenToggle();\n if (event.key === 'ArrowDown') context.onOpenChange(true);\n // prevent keypresses from scrolling window\n if ([' ', 'ArrowDown'].includes(event.key)) event.preventDefault();\n })}\n />\n </MenuPrimitive.Anchor>\n ) : null;\n }\n);\n\nDropdownMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DropdownMenuContent';\n\nconst [ContentProvider, useContentContext] = createDropdownMenuContext(CONTENT_NAME, {\n isInsideContent: false,\n});\n\ntype DropdownMenuContentElement =\n | DropdownMenuRootContentElement\n | React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface DropdownMenuContentProps extends DropdownMenuRootContentProps, MenuContentProps {}\n\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n (props: ScopedProps<DropdownMenuContentProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const commonProps = {\n ...contentProps,\n style: {\n ...props.style,\n // re-namespace exposed content custom property\n ['--radix-dropdown-menu-content-transform-origin' as any]:\n 'var(--radix-popper-transform-origin)',\n },\n };\n\n return (\n <ContentProvider scope={__scopeDropdownMenu} isInsideContent={true}>\n {context.isRootMenu ? (\n <DropdownMenuRootContent\n __scopeDropdownMenu={__scopeDropdownMenu}\n {...commonProps}\n ref={forwardedRef}\n />\n ) : (\n <MenuPrimitive.Content {...menuScope} {...commonProps} ref={forwardedRef} />\n )}\n </ContentProvider>\n );\n }\n);\n\nDropdownMenuContent.displayName = CONTENT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype DropdownMenuRootContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ninterface DropdownMenuRootContentProps extends ScopedProps<MenuContentProps> {}\n\nconst DropdownMenuRootContent = React.forwardRef<\n DropdownMenuRootContentElement,\n DropdownMenuRootContentProps\n>((props, forwardedRef) => {\n const { __scopeDropdownMenu, portalled = true, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n return context.isRootMenu ? (\n <MenuPrimitive.Content\n id={context.contentId}\n aria-labelledby={context.triggerId}\n {...menuScope}\n {...contentProps}\n ref={forwardedRef}\n portalled={portalled}\n onCloseAutoFocus={composeEventHandlers(props.onCloseAutoFocus, (event) => {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n hasInteractedOutsideRef.current = false;\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n })}\n onInteractOutside={composeEventHandlers(props.onInteractOutside, (event) => {\n const originalEvent = event.detail.originalEvent as PointerEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;\n })}\n />\n ) : null;\n});\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'DropdownMenuGroup';\n\ntype DropdownMenuGroupElement = React.ElementRef<typeof MenuPrimitive.Group>;\ntype MenuGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;\ninterface DropdownMenuGroupProps extends MenuGroupProps {}\n\nconst DropdownMenuGroup = React.forwardRef<DropdownMenuGroupElement, DropdownMenuGroupProps>(\n (props: ScopedProps<DropdownMenuGroupProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Group {...menuScope} {...groupProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'DropdownMenuLabel';\n\ntype DropdownMenuLabelElement = React.ElementRef<typeof MenuPrimitive.Label>;\ntype MenuLabelProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Label>;\ninterface DropdownMenuLabelProps extends MenuLabelProps {}\n\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n (props: ScopedProps<DropdownMenuLabelProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Label {...menuScope} {...labelProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'DropdownMenuItem';\n\ntype DropdownMenuItemElement = React.ElementRef<typeof MenuPrimitive.Item>;\ntype MenuItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;\ninterface DropdownMenuItemProps extends MenuItemProps {}\n\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n (props: ScopedProps<DropdownMenuItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Item {...menuScope} {...itemProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuTriggerItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_ITEM_NAME = 'DropdownMenuTriggerItem';\n\ntype DropdownMenuTriggerItemElement = React.ElementRef<typeof MenuPrimitive.SubTrigger>;\ntype MenuSubTriggerProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;\ninterface DropdownMenuTriggerItemProps extends MenuSubTriggerProps {}\n\nconst DropdownMenuTriggerItem = React.forwardRef<\n DropdownMenuTriggerItemElement,\n DropdownMenuTriggerItemProps\n>((props: ScopedProps<DropdownMenuTriggerItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...triggerItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.SubTrigger {...menuScope} {...triggerItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuTriggerItem.displayName = TRIGGER_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'DropdownMenuCheckboxItem';\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<typeof MenuPrimitive.CheckboxItem>;\ntype MenuCheckboxItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>;\ninterface DropdownMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props: ScopedProps<DropdownMenuCheckboxItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.CheckboxItem {...menuScope} {...checkboxItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'DropdownMenuRadioGroup';\n\ntype DropdownMenuRadioGroupElement = React.ElementRef<typeof MenuPrimitive.RadioGroup>;\ntype MenuRadioGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioGroup>;\ninterface DropdownMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>((props: ScopedProps<DropdownMenuRadioGroupProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.RadioGroup {...menuScope} {...radioGroupProps} ref={forwardedRef} />;\n});\n\nDropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'DropdownMenuRadioItem';\n\ntype DropdownMenuRadioItemElement = React.ElementRef<typeof MenuPrimitive.RadioItem>;\ntype MenuRadioItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>;\ninterface DropdownMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props: ScopedProps<DropdownMenuRadioItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.RadioItem {...menuScope} {...radioItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'DropdownMenuItemIndicator';\n\ntype DropdownMenuItemIndicatorElement = React.ElementRef<typeof MenuPrimitive.ItemIndicator>;\ntype MenuItemIndicatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.ItemIndicator>;\ninterface DropdownMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst DropdownMenuItemIndicator = React.forwardRef<\n DropdownMenuItemIndicatorElement,\n DropdownMenuItemIndicatorProps\n>((props: ScopedProps<DropdownMenuItemIndicatorProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.ItemIndicator {...menuScope} {...itemIndicatorProps} ref={forwardedRef} />;\n});\n\nDropdownMenuItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'DropdownMenuSeparator';\n\ntype DropdownMenuSeparatorElement = React.ElementRef<typeof MenuPrimitive.Separator>;\ntype MenuSeparatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Separator>;\ninterface DropdownMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>((props: ScopedProps<DropdownMenuSeparatorProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Separator {...menuScope} {...separatorProps} ref={forwardedRef} />;\n});\n\nDropdownMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'DropdownMenuArrow';\n\ntype DropdownMenuArrowElement = React.ElementRef<typeof MenuPrimitive.Arrow>;\ntype MenuArrowProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Arrow>;\ninterface DropdownMenuArrowProps extends MenuArrowProps {}\n\nconst DropdownMenuArrow = React.forwardRef<DropdownMenuArrowElement, DropdownMenuArrowProps>(\n (props: ScopedProps<DropdownMenuArrowProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Arrow {...menuScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = DropdownMenu;\nconst Trigger = DropdownMenuTrigger;\nconst Content = DropdownMenuContent;\nconst Group = DropdownMenuGroup;\nconst Label = DropdownMenuLabel;\nconst Item = DropdownMenuItem;\nconst TriggerItem = DropdownMenuTriggerItem;\nconst CheckboxItem = DropdownMenuCheckboxItem;\nconst RadioGroup = DropdownMenuRadioGroup;\nconst RadioItem = DropdownMenuRadioItem;\nconst ItemIndicator = DropdownMenuItemIndicator;\nconst Separator = DropdownMenuSeparator;\nconst Arrow = DropdownMenuArrow;\n\nexport {\n createDropdownMenuScope,\n //\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuTriggerItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuItemIndicator,\n DropdownMenuSeparator,\n DropdownMenuArrow,\n //\n Root,\n Trigger,\n Content,\n Group,\n Label,\n Item,\n TriggerItem,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n};\nexport type {\n DropdownMenuProps,\n DropdownMenuTriggerProps,\n DropdownMenuContentProps,\n DropdownMenuGroupProps,\n DropdownMenuLabelProps,\n DropdownMenuItemProps,\n DropdownMenuTriggerItemProps,\n DropdownMenuCheckboxItemProps,\n DropdownMenuRadioGroupProps,\n DropdownMenuRadioItemProps,\n DropdownMenuItemIndicatorProps,\n DropdownMenuSeparatorProps,\n DropdownMenuArrowProps,\n};\n"],"names":["createDropdownMenuContext","createDropdownMenuScope","createContextScope","createMenuScope","useMenuScope","DropdownMenuProvider","useDropdownMenuContext","DropdownMenu","props","__scopeDropdownMenu","children","open","openProp","defaultOpen","onOpenChange","contentContext","useContentContext","menuScope","setOpen","useControllableState","prop","defaultProp","onChange","handleOpenToggle","React","useCallback","prevOpen","isInsideContent","_react","createElement","$c7ff2201b6eec7866a95d2679b05981$var$DropdownMenuProvider","scope","isRootMenu","onOpenToggle","_radixUiReactMenu","Sub","_babelRuntimeHelpersEsmExtends","$c7ff2201b6eec7866a95d2679b05981$var$DropdownMenuRoot","DropdownMenuRoot","dir","modal","triggerRef","useRef","triggerId","useId","contentId","Root","DropdownMenuTrigger","forwardRef","forwardedRef","disabled","triggerProps","context","Anchor","asChild","Primitive","button","type","id","undefined","ref","composeRefs","onPointerDown","composeEventHandlers","event","ctrlKey","preventDefault","onKeyDown","includes","key","ContentProvider","DropdownMenuContent","contentProps","commonProps","style","$c7ff2201b6eec7866a95d2679b05981$var$ContentProvider","$c7ff2201b6eec7866a95d2679b05981$var$DropdownMenuRootContent","Content","DropdownMenuRootContent","portalled","hasInteractedOutsideRef","onCloseAutoFocus","_context$triggerRef$c","current","focus","onInteractOutside","originalEvent","detail","ctrlLeftClick","isRightClick","DropdownMenuGroup","groupProps","Group","DropdownMenuLabel","labelProps","Label","DropdownMenuItem","itemProps","Item","DropdownMenuTriggerItem","triggerItemProps","SubTrigger","DropdownMenuCheckboxItem","checkboxItemProps","CheckboxItem","DropdownMenuRadioGroup","radioGroupProps","RadioGroup","DropdownMenuRadioItem","radioItemProps","RadioItem","DropdownMenuItemIndicator","itemIndicatorProps","ItemIndicator","DropdownMenuSeparator","separatorProps","Separator","DropdownMenuArrow","arrowProps","Arrow","Trigger","TriggerItem"],"version":3,"file":"index.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;;ACeA;;oGAEA,CAEA,MAAMS,wCAAkB,GAAG,cAA3B,AAAA;AAGA,MAAM,CAACC,+CAAD,EAA4BC,yCAA5B,CAAA,GAAuDR,yBAAkB,CAC7EM,wCAD6E,EAE7E;IAACF,sBAAD;CAF6E,CAA/E,AAAA;AAIA,MAAMK,kCAAY,GAAGL,sBAAe,EAApC,AAAA;AAoBA,MAAM,CAACM,0CAAD,EAAuBC,4CAAvB,CAAA,GAAiDJ,+CAAyB,CAE9ED,wCAF8E,CAAhF,AAAA;AAaA,MAAMM,yCAAyC,GAAIC,CAAAA,KAAD,GAA2C;IAC3F,MAAM,E,qBAAEC,mBAAF,CAAA,E,UAAuBC,QAAvB,CAAA,EAAiCC,IAAI,EAAEC,QAAvC,CAAA,E,aAAiDC,WAAjD,CAAA,E,cAA8DC,YAAAA,CAAAA,EAA9D,GAA+EN,KAArF,AAAM;IACN,MAAMO,cAAc,GAAGC,uCAAiB,CAACf,wCAAD,EAAqBQ,mBAArB,CAAxC,AAAA;IACA,MAAMQ,SAAS,GAAGb,kCAAY,CAACK,mBAAD,CAA9B,AAAA;IACA,MAAM,CAACE,IAAI,GAAG,KAAR,EAAeO,OAAf,CAAA,GAA0BtB,2BAAoB,CAAC;QACnDuB,IAAI,EAAEP,QAD6C;QAEnDQ,WAAW,EAAEP,WAFsC;QAGnDQ,QAAQ,EAAEP,YAAVO;KAHkD,CAApD,AAAqD;IAMrD,MAAMC,gBAAgB,GAAG9B,kBAAA,CAAkB,IAAM0B,OAAO,CAAEM,CAAAA,QAAD,GAAc,CAACA,QAAhB;QAAA,CAA/B;IAAA,EAA0D;QAACN,OAAD;KAA1D,CAAzB,AAAA;IAEA,OA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AA,CAAA,MAAA,CAAA,MAAA,CAAA,yCAAA,EAAA;IAAA,WAAA,EAAA,gCAAA;CAAA,CAAA,CAAA;AAEA,oGAAA,CAEA,MAAM+D,yCAAI,GAAG3F,yCAAb,AAAA;AACA,MAAM4F,yCAAO,GAAGlE,yCAAhB,AAAA;AACA,MAAMmE,yCAAO,GAAG/C,yCAAhB,AAAA;AACA,MAAMgD,yCAAK,GAAGhC,yCAAd,AAAA;AACA,MAAMiC,yCAAK,GAAG9B,yCAAd,AAAA;AACA,MAAM+B,yCAAI,GAAG5B,yCAAb,AAAA;AACA,MAAM6B,yCAAW,GAAG1B,yCAApB,AAAA;AACA,MAAM2B,yCAAY,GAAGxB,yCAArB,AAAA;AACA,MAAMyB,yCAAU,GAAGtB,yCAAnB,AAAA;AACA,MAAMuB,yCAAS,GAAGpB,yCAAlB,AAAA;AACA,MAAMqB,yCAAa,GAAGlB,yCAAtB,AAAA;AACA,MAAMmB,yCAAS,GAAGhB,yCAAlB,AAAA;AACA,MAAMiB,yCAAK,GAAGd,yCAAd,AAAA;;ADrfA","sources":["packages/react/dropdown-menu/src/index.ts","packages/react/dropdown-menu/src/DropdownMenu.tsx"],"sourcesContent":["export * from './DropdownMenu';\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport { useId } from '@radix-ui/react-id';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst DROPDOWN_MENU_NAME = 'DropdownMenu';\n\ntype ScopedProps<P> = P & { __scopeDropdownMenu?: Scope };\nconst [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(\n DROPDOWN_MENU_NAME,\n [createMenuScope]\n);\nconst useMenuScope = createMenuScope();\n\ntype DropdownMenuRootContextValue = {\n isRootMenu: true;\n triggerId: string;\n triggerRef: React.RefObject<HTMLButtonElement>;\n contentId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\ntype DropdownMenuSubContextValue = {\n isRootMenu: false;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n};\n\nconst [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext<\n DropdownMenuRootContextValue | DropdownMenuSubContextValue\n>(DROPDOWN_MENU_NAME);\n\ninterface DropdownMenuProps {\n children?: React.ReactNode;\n dir?: Direction;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n}\n\nconst DropdownMenu: React.FC<DropdownMenuProps> = (props: ScopedProps<DropdownMenuProps>) => {\n const { __scopeDropdownMenu, children, open: openProp, defaultOpen, onOpenChange } = props;\n const contentContext = useContentContext(DROPDOWN_MENU_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n const handleOpenToggle = React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]);\n\n return contentContext.isInsideContent ? (\n <DropdownMenuProvider\n scope={__scopeDropdownMenu}\n isRootMenu={false}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={handleOpenToggle}\n >\n <MenuPrimitive.Sub {...menuScope} open={open} onOpenChange={setOpen}>\n {children}\n </MenuPrimitive.Sub>\n </DropdownMenuProvider>\n ) : (\n <DropdownMenuRoot {...props} open={open} onOpenChange={setOpen} onOpenToggle={handleOpenToggle}>\n {children}\n </DropdownMenuRoot>\n );\n};\n\nDropdownMenu.displayName = DROPDOWN_MENU_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ninterface DropdownMenuRootProps {\n children?: React.ReactNode;\n dir?: Direction;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal?: boolean;\n}\n\nconst DropdownMenuRoot: React.FC<DropdownMenuRootProps> = (\n props: ScopedProps<DropdownMenuRootProps>\n) => {\n const {\n __scopeDropdownMenu,\n children,\n dir,\n open,\n onOpenChange,\n onOpenToggle,\n modal = true,\n } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n return (\n <DropdownMenuProvider\n scope={__scopeDropdownMenu}\n isRootMenu={true}\n triggerId={useId()}\n triggerRef={triggerRef}\n contentId={useId()}\n open={open}\n onOpenChange={onOpenChange}\n onOpenToggle={onOpenToggle}\n modal={modal}\n >\n <MenuPrimitive.Root\n {...menuScope}\n open={open}\n onOpenChange={onOpenChange}\n dir={dir}\n modal={modal}\n >\n {children}\n </MenuPrimitive.Root>\n </DropdownMenuProvider>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DropdownMenuTrigger';\n\ntype DropdownMenuTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface DropdownMenuTriggerProps extends PrimitiveButtonProps {}\n\nconst DropdownMenuTrigger = React.forwardRef<DropdownMenuTriggerElement, DropdownMenuTriggerProps>(\n (props: ScopedProps<DropdownMenuTriggerProps>, forwardedRef) => {\n const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;\n const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return context.isRootMenu ? (\n <MenuPrimitive.Anchor asChild {...menuScope}>\n <Primitive.button\n type=\"button\"\n id={context.triggerId}\n aria-haspopup=\"menu\"\n aria-expanded={context.open ? true : undefined}\n aria-controls={context.open ? context.contentId : undefined}\n data-state={context.open ? 'open' : 'closed'}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n {...triggerProps}\n ref={composeRefs(forwardedRef, context.triggerRef)}\n onPointerDown={composeEventHandlers(props.onPointerDown, (event) => {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n // prevent trigger focusing when opening\n // this allows the content to be given focus without competition\n if (!context.open) event.preventDefault();\n context.onOpenToggle();\n }\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if (['Enter', ' '].includes(event.key)) context.onOpenToggle();\n if (event.key === 'ArrowDown') context.onOpenChange(true);\n // prevent keypresses from scrolling window\n if ([' ', 'ArrowDown'].includes(event.key)) event.preventDefault();\n })}\n />\n </MenuPrimitive.Anchor>\n ) : null;\n }\n);\n\nDropdownMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DropdownMenuContent';\n\nconst [ContentProvider, useContentContext] = createDropdownMenuContext(CONTENT_NAME, {\n isInsideContent: false,\n});\n\ntype DropdownMenuContentElement =\n | DropdownMenuRootContentElement\n | React.ElementRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface DropdownMenuContentProps extends DropdownMenuRootContentProps, MenuContentProps {}\n\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n (props: ScopedProps<DropdownMenuContentProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const commonProps = {\n ...contentProps,\n style: {\n ...props.style,\n // re-namespace exposed content custom property\n ['--radix-dropdown-menu-content-transform-origin' as any]:\n 'var(--radix-popper-transform-origin)',\n },\n };\n\n return (\n <ContentProvider scope={__scopeDropdownMenu} isInsideContent={true}>\n {context.isRootMenu ? (\n <DropdownMenuRootContent\n __scopeDropdownMenu={__scopeDropdownMenu}\n {...commonProps}\n ref={forwardedRef}\n />\n ) : (\n <MenuPrimitive.Content {...menuScope} {...commonProps} ref={forwardedRef} />\n )}\n </ContentProvider>\n );\n }\n);\n\nDropdownMenuContent.displayName = CONTENT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype DropdownMenuRootContentElement = React.ElementRef<typeof MenuPrimitive.Content>;\ninterface DropdownMenuRootContentProps extends ScopedProps<MenuContentProps> {}\n\nconst DropdownMenuRootContent = React.forwardRef<\n DropdownMenuRootContentElement,\n DropdownMenuRootContentProps\n>((props, forwardedRef) => {\n const { __scopeDropdownMenu, portalled = true, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n return context.isRootMenu ? (\n <MenuPrimitive.Content\n id={context.contentId}\n aria-labelledby={context.triggerId}\n {...menuScope}\n {...contentProps}\n ref={forwardedRef}\n portalled={portalled}\n onCloseAutoFocus={composeEventHandlers(props.onCloseAutoFocus, (event) => {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n hasInteractedOutsideRef.current = false;\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n })}\n onInteractOutside={composeEventHandlers(props.onInteractOutside, (event) => {\n const originalEvent = event.detail.originalEvent as PointerEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;\n })}\n />\n ) : null;\n});\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'DropdownMenuGroup';\n\ntype DropdownMenuGroupElement = React.ElementRef<typeof MenuPrimitive.Group>;\ntype MenuGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;\ninterface DropdownMenuGroupProps extends MenuGroupProps {}\n\nconst DropdownMenuGroup = React.forwardRef<DropdownMenuGroupElement, DropdownMenuGroupProps>(\n (props: ScopedProps<DropdownMenuGroupProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Group {...menuScope} {...groupProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'DropdownMenuLabel';\n\ntype DropdownMenuLabelElement = React.ElementRef<typeof MenuPrimitive.Label>;\ntype MenuLabelProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Label>;\ninterface DropdownMenuLabelProps extends MenuLabelProps {}\n\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n (props: ScopedProps<DropdownMenuLabelProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Label {...menuScope} {...labelProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'DropdownMenuItem';\n\ntype DropdownMenuItemElement = React.ElementRef<typeof MenuPrimitive.Item>;\ntype MenuItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;\ninterface DropdownMenuItemProps extends MenuItemProps {}\n\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n (props: ScopedProps<DropdownMenuItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Item {...menuScope} {...itemProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuTriggerItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_ITEM_NAME = 'DropdownMenuTriggerItem';\n\ntype DropdownMenuTriggerItemElement = React.ElementRef<typeof MenuPrimitive.SubTrigger>;\ntype MenuSubTriggerProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;\ninterface DropdownMenuTriggerItemProps extends MenuSubTriggerProps {}\n\nconst DropdownMenuTriggerItem = React.forwardRef<\n DropdownMenuTriggerItemElement,\n DropdownMenuTriggerItemProps\n>((props: ScopedProps<DropdownMenuTriggerItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...triggerItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.SubTrigger {...menuScope} {...triggerItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuTriggerItem.displayName = TRIGGER_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'DropdownMenuCheckboxItem';\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<typeof MenuPrimitive.CheckboxItem>;\ntype MenuCheckboxItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>;\ninterface DropdownMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props: ScopedProps<DropdownMenuCheckboxItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.CheckboxItem {...menuScope} {...checkboxItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'DropdownMenuRadioGroup';\n\ntype DropdownMenuRadioGroupElement = React.ElementRef<typeof MenuPrimitive.RadioGroup>;\ntype MenuRadioGroupProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioGroup>;\ninterface DropdownMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>((props: ScopedProps<DropdownMenuRadioGroupProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.RadioGroup {...menuScope} {...radioGroupProps} ref={forwardedRef} />;\n});\n\nDropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'DropdownMenuRadioItem';\n\ntype DropdownMenuRadioItemElement = React.ElementRef<typeof MenuPrimitive.RadioItem>;\ntype MenuRadioItemProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>;\ninterface DropdownMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props: ScopedProps<DropdownMenuRadioItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.RadioItem {...menuScope} {...radioItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'DropdownMenuItemIndicator';\n\ntype DropdownMenuItemIndicatorElement = React.ElementRef<typeof MenuPrimitive.ItemIndicator>;\ntype MenuItemIndicatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.ItemIndicator>;\ninterface DropdownMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst DropdownMenuItemIndicator = React.forwardRef<\n DropdownMenuItemIndicatorElement,\n DropdownMenuItemIndicatorProps\n>((props: ScopedProps<DropdownMenuItemIndicatorProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.ItemIndicator {...menuScope} {...itemIndicatorProps} ref={forwardedRef} />;\n});\n\nDropdownMenuItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'DropdownMenuSeparator';\n\ntype DropdownMenuSeparatorElement = React.ElementRef<typeof MenuPrimitive.Separator>;\ntype MenuSeparatorProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Separator>;\ninterface DropdownMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>((props: ScopedProps<DropdownMenuSeparatorProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Separator {...menuScope} {...separatorProps} ref={forwardedRef} />;\n});\n\nDropdownMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'DropdownMenuArrow';\n\ntype DropdownMenuArrowElement = React.ElementRef<typeof MenuPrimitive.Arrow>;\ntype MenuArrowProps = Radix.ComponentPropsWithoutRef<typeof MenuPrimitive.Arrow>;\ninterface DropdownMenuArrowProps extends MenuArrowProps {}\n\nconst DropdownMenuArrow = React.forwardRef<DropdownMenuArrowElement, DropdownMenuArrowProps>(\n (props: ScopedProps<DropdownMenuArrowProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Arrow {...menuScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = DropdownMenu;\nconst Trigger = DropdownMenuTrigger;\nconst Content = DropdownMenuContent;\nconst Group = DropdownMenuGroup;\nconst Label = DropdownMenuLabel;\nconst Item = DropdownMenuItem;\nconst TriggerItem = DropdownMenuTriggerItem;\nconst CheckboxItem = DropdownMenuCheckboxItem;\nconst RadioGroup = DropdownMenuRadioGroup;\nconst RadioItem = DropdownMenuRadioItem;\nconst ItemIndicator = DropdownMenuItemIndicator;\nconst Separator = DropdownMenuSeparator;\nconst Arrow = DropdownMenuArrow;\n\nexport {\n createDropdownMenuScope,\n //\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuTriggerItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuItemIndicator,\n DropdownMenuSeparator,\n DropdownMenuArrow,\n //\n Root,\n Trigger,\n Content,\n Group,\n Label,\n Item,\n TriggerItem,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n};\nexport type {\n DropdownMenuProps,\n DropdownMenuTriggerProps,\n DropdownMenuContentProps,\n DropdownMenuGroupProps,\n DropdownMenuLabelProps,\n DropdownMenuItemProps,\n DropdownMenuTriggerItemProps,\n DropdownMenuCheckboxItemProps,\n DropdownMenuRadioGroupProps,\n DropdownMenuRadioItemProps,\n DropdownMenuItemIndicatorProps,\n DropdownMenuSeparatorProps,\n DropdownMenuArrowProps,\n};\n"],"names":["React","composeEventHandlers","composeRefs","createContextScope","useControllableState","Primitive","MenuPrimitive","createMenuScope","useId","DROPDOWN_MENU_NAME","createDropdownMenuContext","createDropdownMenuScope","useMenuScope","DropdownMenuProvider","useDropdownMenuContext","DropdownMenu","props","__scopeDropdownMenu","children","open","openProp","defaultOpen","onOpenChange","contentContext","useContentContext","menuScope","setOpen","prop","defaultProp","onChange","handleOpenToggle","useCallback","prevOpen","isInsideContent","DropdownMenuRoot","dir","onOpenToggle","modal","triggerRef","useRef","TRIGGER_NAME","DropdownMenuTrigger","forwardRef","forwardedRef","disabled","triggerProps","context","isRootMenu","triggerId","undefined","contentId","onPointerDown","event","button","ctrlKey","preventDefault","onKeyDown","includes","key","CONTENT_NAME","ContentProvider","DropdownMenuContent","contentProps","commonProps","style","DropdownMenuRootContent","portalled","hasInteractedOutsideRef","onCloseAutoFocus","current","focus","onInteractOutside","originalEvent","detail","ctrlLeftClick","isRightClick","GROUP_NAME","DropdownMenuGroup","groupProps","LABEL_NAME","DropdownMenuLabel","labelProps","ITEM_NAME","DropdownMenuItem","itemProps","TRIGGER_ITEM_NAME","DropdownMenuTriggerItem","triggerItemProps","CHECKBOX_ITEM_NAME","DropdownMenuCheckboxItem","checkboxItemProps","RADIO_GROUP_NAME","DropdownMenuRadioGroup","radioGroupProps","RADIO_ITEM_NAME","DropdownMenuRadioItem","radioItemProps","INDICATOR_NAME","DropdownMenuItemIndicator","itemIndicatorProps","SEPARATOR_NAME","DropdownMenuSeparator","separatorProps","ARROW_NAME","DropdownMenuArrow","arrowProps","Root","Trigger","Content","Group","Label","Item","TriggerItem","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow"],"version":3,"file":"index.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-dropdown-menu",
|
|
3
|
-
"version": "0.1.7-rc.
|
|
3
|
+
"version": "0.1.7-rc.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/runtime": "^7.13.10",
|
|
20
20
|
"@radix-ui/primitive": "0.1.0",
|
|
21
|
-
"@radix-ui/react-compose-refs": "0.1.
|
|
22
|
-
"@radix-ui/react-context": "0.1.
|
|
23
|
-
"@radix-ui/react-id": "0.1.
|
|
24
|
-
"@radix-ui/react-menu": "0.1.7-rc.
|
|
25
|
-
"@radix-ui/react-primitive": "0.1.
|
|
26
|
-
"@radix-ui/react-use-controllable-state": "0.1.
|
|
21
|
+
"@radix-ui/react-compose-refs": "0.1.1-rc.7",
|
|
22
|
+
"@radix-ui/react-context": "0.1.2-rc.7",
|
|
23
|
+
"@radix-ui/react-id": "0.1.6-rc.7",
|
|
24
|
+
"@radix-ui/react-menu": "0.1.7-rc.10",
|
|
25
|
+
"@radix-ui/react-primitive": "0.1.5-rc.7",
|
|
26
|
+
"@radix-ui/react-use-controllable-state": "0.1.1-rc.7"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"react": "^16.8 || ^17.0",
|
|
30
|
-
"react-dom": "^16.8 || ^17.0"
|
|
29
|
+
"react": "^16.8 || ^17.0 || ^18.0",
|
|
30
|
+
"react-dom": "^16.8 || ^17.0 || ^18.0"
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://radix-ui.com/primitives",
|
|
33
33
|
"repository": {
|