@backbay/glia 0.2.0-alpha.7 → 0.2.0-alpha.8
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/audio/index.js +1145 -5
- package/dist/audio/index.js.map +1 -1
- package/dist/components/index.js +3187 -10
- package/dist/components/index.js.map +1 -1
- package/dist/core.js +19714 -12
- package/dist/core.js.map +1 -1
- package/dist/emotion/index.js +1 -1
- package/dist/emotion/index.js.map +1 -1
- package/dist/hooks/index.js +941 -6
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.js +31841 -183
- package/dist/index.js.map +1 -1
- package/dist/primitives/index.js +21111 -57
- package/dist/primitives/index.js.map +1 -1
- package/dist/protocol/index.js +360 -2
- package/dist/protocol/index.js.map +1 -1
- package/dist/speakeasy/index.js +2786 -38
- package/dist/speakeasy/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/index.js +1150 -3
- package/dist/theme/index.js.map +1 -1
- package/dist/vision/index.js +370 -2
- package/dist/vision/index.js.map +1 -1
- package/dist/workspace/index.js +16824 -2
- package/dist/workspace/index.js.map +1 -1
- package/package.json +15 -9
- package/dist/AuroraBackground-AP6ZHVFA.js +0 -6
- package/dist/AuroraBackground-AP6ZHVFA.js.map +0 -1
- package/dist/BentoGrid-CDARICNM.js +0 -6
- package/dist/BentoGrid-CDARICNM.js.map +0 -1
- package/dist/CommandPalette-JCWJKRBY.js +0 -6
- package/dist/CommandPalette-JCWJKRBY.js.map +0 -1
- package/dist/Glass-H4X4ZI4P.js +0 -7
- package/dist/Glass-H4X4ZI4P.js.map +0 -1
- package/dist/GlitchText-KLQ57PPY.js +0 -6
- package/dist/GlitchText-KLQ57PPY.js.map +0 -1
- package/dist/GlowButton-VGBPMZO7.js +0 -6
- package/dist/GlowButton-VGBPMZO7.js.map +0 -1
- package/dist/Graph3D-GO7N2EZQ.js +0 -540
- package/dist/Graph3D-GO7N2EZQ.js.map +0 -1
- package/dist/HUDProgressRing-N6C5NAEV.js +0 -6
- package/dist/HUDProgressRing-N6C5NAEV.js.map +0 -1
- package/dist/KPIStat-PBQK27ZB.js +0 -6
- package/dist/KPIStat-PBQK27ZB.js.map +0 -1
- package/dist/NeonToast-W5F7MU3U.js +0 -6
- package/dist/NeonToast-W5F7MU3U.js.map +0 -1
- package/dist/ParticleField-WK6CNHWU.js +0 -51
- package/dist/ParticleField-WK6CNHWU.js.map +0 -1
- package/dist/TextGenerateEffect-EUCEIIUJ.js +0 -6
- package/dist/TextGenerateEffect-EUCEIIUJ.js.map +0 -1
- package/dist/ThreeDCard-VH5I3SSY.js +0 -6
- package/dist/ThreeDCard-VH5I3SSY.js.map +0 -1
- package/dist/TypingAnimation-GIWOHPIX.js +0 -6
- package/dist/TypingAnimation-GIWOHPIX.js.map +0 -1
- package/dist/alert-dialog-QOSYBIIE.js +0 -19
- package/dist/alert-dialog-QOSYBIIE.js.map +0 -1
- package/dist/avatar-N5R37PCU.js +0 -10
- package/dist/avatar-N5R37PCU.js.map +0 -1
- package/dist/badge-GTVIIGPY.js +0 -8
- package/dist/badge-GTVIIGPY.js.map +0 -1
- package/dist/button-D7IMSV2D.js +0 -8
- package/dist/button-D7IMSV2D.js.map +0 -1
- package/dist/chunk-3CMPQOMY.js +0 -69
- package/dist/chunk-3CMPQOMY.js.map +0 -1
- package/dist/chunk-3OQT6IYR.js +0 -41
- package/dist/chunk-3OQT6IYR.js.map +0 -1
- package/dist/chunk-43B2WVLS.js +0 -85
- package/dist/chunk-43B2WVLS.js.map +0 -1
- package/dist/chunk-4SRFO5W3.js +0 -121
- package/dist/chunk-4SRFO5W3.js.map +0 -1
- package/dist/chunk-5IZELOOU.js +0 -362
- package/dist/chunk-5IZELOOU.js.map +0 -1
- package/dist/chunk-6DM4ACSS.js +0 -154
- package/dist/chunk-6DM4ACSS.js.map +0 -1
- package/dist/chunk-6IGT34PC.js +0 -50
- package/dist/chunk-6IGT34PC.js.map +0 -1
- package/dist/chunk-6RKBCJHN.js +0 -194
- package/dist/chunk-6RKBCJHN.js.map +0 -1
- package/dist/chunk-6RX2WGCO.js +0 -108
- package/dist/chunk-6RX2WGCO.js.map +0 -1
- package/dist/chunk-7K4WZM3U.js +0 -189
- package/dist/chunk-7K4WZM3U.js.map +0 -1
- package/dist/chunk-7MDBHJPT.js +0 -407
- package/dist/chunk-7MDBHJPT.js.map +0 -1
- package/dist/chunk-7UQD6ROV.js +0 -9
- package/dist/chunk-7UQD6ROV.js.map +0 -1
- package/dist/chunk-AFNIVLZP.js +0 -1069
- package/dist/chunk-AFNIVLZP.js.map +0 -1
- package/dist/chunk-ANWYRO6A.js +0 -407
- package/dist/chunk-ANWYRO6A.js.map +0 -1
- package/dist/chunk-DIXPOHDO.js +0 -71
- package/dist/chunk-DIXPOHDO.js.map +0 -1
- package/dist/chunk-DWYMKYPI.js +0 -3
- package/dist/chunk-DWYMKYPI.js.map +0 -1
- package/dist/chunk-E3NVDCZG.js +0 -280
- package/dist/chunk-E3NVDCZG.js.map +0 -1
- package/dist/chunk-EBM7YBKL.js +0 -399
- package/dist/chunk-EBM7YBKL.js.map +0 -1
- package/dist/chunk-EPAM7IWW.js +0 -294
- package/dist/chunk-EPAM7IWW.js.map +0 -1
- package/dist/chunk-EXQ7GYRS.js +0 -134
- package/dist/chunk-EXQ7GYRS.js.map +0 -1
- package/dist/chunk-F4QTUZ3C.js +0 -136
- package/dist/chunk-F4QTUZ3C.js.map +0 -1
- package/dist/chunk-FEW533R2.js +0 -105
- package/dist/chunk-FEW533R2.js.map +0 -1
- package/dist/chunk-FFZLJKC7.js +0 -270
- package/dist/chunk-FFZLJKC7.js.map +0 -1
- package/dist/chunk-GEAMOBF7.js +0 -8486
- package/dist/chunk-GEAMOBF7.js.map +0 -1
- package/dist/chunk-GRTRSCTD.js +0 -74
- package/dist/chunk-GRTRSCTD.js.map +0 -1
- package/dist/chunk-IKGYOGLK.js +0 -16
- package/dist/chunk-IKGYOGLK.js.map +0 -1
- package/dist/chunk-IQ7WYWVJ.js +0 -73
- package/dist/chunk-IQ7WYWVJ.js.map +0 -1
- package/dist/chunk-IXIVWQLF.js +0 -543
- package/dist/chunk-IXIVWQLF.js.map +0 -1
- package/dist/chunk-JCJU57RC.js +0 -115
- package/dist/chunk-JCJU57RC.js.map +0 -1
- package/dist/chunk-KORSTBU4.js +0 -117
- package/dist/chunk-KORSTBU4.js.map +0 -1
- package/dist/chunk-KSEZ6UM2.js +0 -235
- package/dist/chunk-KSEZ6UM2.js.map +0 -1
- package/dist/chunk-MHPF7R3O.js +0 -1376
- package/dist/chunk-MHPF7R3O.js.map +0 -1
- package/dist/chunk-MPC5IH7E.js +0 -81
- package/dist/chunk-MPC5IH7E.js.map +0 -1
- package/dist/chunk-MQIU2NYA.js +0 -114
- package/dist/chunk-MQIU2NYA.js.map +0 -1
- package/dist/chunk-NYMBJOGR.js +0 -2192
- package/dist/chunk-NYMBJOGR.js.map +0 -1
- package/dist/chunk-OBZD2M3C.js +0 -169
- package/dist/chunk-OBZD2M3C.js.map +0 -1
- package/dist/chunk-ODM2AG6G.js +0 -176
- package/dist/chunk-ODM2AG6G.js.map +0 -1
- package/dist/chunk-ONDKF5LP.js +0 -53
- package/dist/chunk-ONDKF5LP.js.map +0 -1
- package/dist/chunk-P25YCWQB.js +0 -41
- package/dist/chunk-P25YCWQB.js.map +0 -1
- package/dist/chunk-PFYVNM6H.js +0 -14
- package/dist/chunk-PFYVNM6H.js.map +0 -1
- package/dist/chunk-PWNNSGFL.js +0 -20
- package/dist/chunk-PWNNSGFL.js.map +0 -1
- package/dist/chunk-Q2PGZVOT.js +0 -36
- package/dist/chunk-Q2PGZVOT.js.map +0 -1
- package/dist/chunk-Q2XDMV7U.js +0 -76
- package/dist/chunk-Q2XDMV7U.js.map +0 -1
- package/dist/chunk-QG7FH2FI.js +0 -45
- package/dist/chunk-QG7FH2FI.js.map +0 -1
- package/dist/chunk-R7HUOK2D.js +0 -1914
- package/dist/chunk-R7HUOK2D.js.map +0 -1
- package/dist/chunk-REUYY7G5.js +0 -773
- package/dist/chunk-REUYY7G5.js.map +0 -1
- package/dist/chunk-RHC2Z2HT.js +0 -199
- package/dist/chunk-RHC2Z2HT.js.map +0 -1
- package/dist/chunk-RMCVLIFE.js +0 -23
- package/dist/chunk-RMCVLIFE.js.map +0 -1
- package/dist/chunk-ROZLTXGR.js +0 -234
- package/dist/chunk-ROZLTXGR.js.map +0 -1
- package/dist/chunk-RSS2C2O3.js +0 -17
- package/dist/chunk-RSS2C2O3.js.map +0 -1
- package/dist/chunk-SAGCG5SH.js +0 -355
- package/dist/chunk-SAGCG5SH.js.map +0 -1
- package/dist/chunk-TM6AOUSD.js +0 -40
- package/dist/chunk-TM6AOUSD.js.map +0 -1
- package/dist/chunk-TPK4BYCO.js +0 -970
- package/dist/chunk-TPK4BYCO.js.map +0 -1
- package/dist/chunk-UNQIL4K2.js +0 -34
- package/dist/chunk-UNQIL4K2.js.map +0 -1
- package/dist/chunk-UUG6L75Y.js +0 -47
- package/dist/chunk-UUG6L75Y.js.map +0 -1
- package/dist/chunk-V2SYMV4W.js +0 -114
- package/dist/chunk-V2SYMV4W.js.map +0 -1
- package/dist/chunk-V7EN5CTH.js +0 -130
- package/dist/chunk-V7EN5CTH.js.map +0 -1
- package/dist/chunk-VITKG2HL.js +0 -1125
- package/dist/chunk-VITKG2HL.js.map +0 -1
- package/dist/chunk-VYEWU5LO.js +0 -2631
- package/dist/chunk-VYEWU5LO.js.map +0 -1
- package/dist/chunk-W67QAGSH.js +0 -178
- package/dist/chunk-W67QAGSH.js.map +0 -1
- package/dist/chunk-WWBIN6KV.js +0 -1353
- package/dist/chunk-WWBIN6KV.js.map +0 -1
- package/dist/chunk-X77Z4PFB.js +0 -224
- package/dist/chunk-X77Z4PFB.js.map +0 -1
- package/dist/chunk-X7VG7OTT.js +0 -8
- package/dist/chunk-X7VG7OTT.js.map +0 -1
- package/dist/chunk-XE4K2SGI.js +0 -74
- package/dist/chunk-XE4K2SGI.js.map +0 -1
- package/dist/chunk-YIUG7IJK.js +0 -628
- package/dist/chunk-YIUG7IJK.js.map +0 -1
- package/dist/chunk-YNVN3V4Y.js +0 -13
- package/dist/chunk-YNVN3V4Y.js.map +0 -1
- package/dist/chunk-Z2S54IZX.js +0 -198
- package/dist/chunk-Z2S54IZX.js.map +0 -1
- package/dist/chunk-ZR6AH25Z.js +0 -17
- package/dist/chunk-ZR6AH25Z.js.map +0 -1
- package/dist/dialog-SPM3DTTI.js +0 -17
- package/dist/dialog-SPM3DTTI.js.map +0 -1
- package/dist/dropdown-menu-HMTWKWGK.js +0 -21
- package/dist/dropdown-menu-HMTWKWGK.js.map +0 -1
- package/dist/input-BH4P4S26.js +0 -6
- package/dist/input-BH4P4S26.js.map +0 -1
- package/dist/label-5Z4Q6VER.js +0 -8
- package/dist/label-5Z4Q6VER.js.map +0 -1
- package/dist/popover-IFOUXYLI.js +0 -18
- package/dist/popover-IFOUXYLI.js.map +0 -1
- package/dist/scroll-area-DJXNW6QX.js +0 -14
- package/dist/scroll-area-DJXNW6QX.js.map +0 -1
- package/dist/select-FZ277C3G.js +0 -22
- package/dist/select-FZ277C3G.js.map +0 -1
- package/dist/separator-BTMLN4NB.js +0 -8
- package/dist/separator-BTMLN4NB.js.map +0 -1
- package/dist/skeleton-DXIWBH4W.js +0 -6
- package/dist/skeleton-DXIWBH4W.js.map +0 -1
- package/dist/switch-4MCXIZBY.js +0 -13
- package/dist/switch-4MCXIZBY.js.map +0 -1
- package/dist/tabs-O7AW3APK.js +0 -17
- package/dist/tabs-O7AW3APK.js.map +0 -1
- package/dist/textarea-IB5WAFDO.js +0 -6
- package/dist/textarea-IB5WAFDO.js.map +0 -1
- package/dist/toggle-XVPPG6P4.js +0 -10
- package/dist/toggle-XVPPG6P4.js.map +0 -1
- package/dist/tooltip-JICZTD4F.js +0 -18
- package/dist/tooltip-JICZTD4F.js.map +0 -1
package/dist/chunk-WWBIN6KV.js
DELETED
|
@@ -1,1353 +0,0 @@
|
|
|
1
|
-
import { createPopperScope, Anchor, Content, Arrow, Root2 } from './chunk-NYMBJOGR.js';
|
|
2
|
-
import { createRovingFocusGroupScope, Root, Item } from './chunk-X77Z4PFB.js';
|
|
3
|
-
import { createCollection } from './chunk-6DM4ACSS.js';
|
|
4
|
-
import { useDirection } from './chunk-YNVN3V4Y.js';
|
|
5
|
-
import { hideOthers, useFocusGuards, Combination_default, FocusScope } from './chunk-AFNIVLZP.js';
|
|
6
|
-
import { DismissableLayer, Portal } from './chunk-ROZLTXGR.js';
|
|
7
|
-
import { useId } from './chunk-IKGYOGLK.js';
|
|
8
|
-
import { Presence } from './chunk-V7EN5CTH.js';
|
|
9
|
-
import { useCallbackRef } from './chunk-PFYVNM6H.js';
|
|
10
|
-
import { createContextScope } from './chunk-MPC5IH7E.js';
|
|
11
|
-
import { useControllableState } from './chunk-DIXPOHDO.js';
|
|
12
|
-
import { composeEventHandlers, Primitive, dispatchDiscreteCustomEvent } from './chunk-EXQ7GYRS.js';
|
|
13
|
-
import { useComposedRefs, composeRefs } from './chunk-P25YCWQB.js';
|
|
14
|
-
import { cn } from './chunk-6RX2WGCO.js';
|
|
15
|
-
import * as React2 from 'react';
|
|
16
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
17
|
-
import { CheckIcon, CircleIcon, ChevronRightIcon } from 'lucide-react';
|
|
18
|
-
|
|
19
|
-
// @__NO_SIDE_EFFECTS__
|
|
20
|
-
function createSlot(ownerName) {
|
|
21
|
-
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
22
|
-
const Slot2 = React2.forwardRef((props, forwardedRef) => {
|
|
23
|
-
const { children, ...slotProps } = props;
|
|
24
|
-
const childrenArray = React2.Children.toArray(children);
|
|
25
|
-
const slottable = childrenArray.find(isSlottable);
|
|
26
|
-
if (slottable) {
|
|
27
|
-
const newElement = slottable.props.children;
|
|
28
|
-
const newChildren = childrenArray.map((child) => {
|
|
29
|
-
if (child === slottable) {
|
|
30
|
-
if (React2.Children.count(newElement) > 1) return React2.Children.only(null);
|
|
31
|
-
return React2.isValidElement(newElement) ? newElement.props.children : null;
|
|
32
|
-
} else {
|
|
33
|
-
return child;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React2.isValidElement(newElement) ? React2.cloneElement(newElement, void 0, newChildren) : null });
|
|
37
|
-
}
|
|
38
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
39
|
-
});
|
|
40
|
-
Slot2.displayName = `${ownerName}.Slot`;
|
|
41
|
-
return Slot2;
|
|
42
|
-
}
|
|
43
|
-
// @__NO_SIDE_EFFECTS__
|
|
44
|
-
function createSlotClone(ownerName) {
|
|
45
|
-
const SlotClone = React2.forwardRef((props, forwardedRef) => {
|
|
46
|
-
const { children, ...slotProps } = props;
|
|
47
|
-
if (React2.isValidElement(children)) {
|
|
48
|
-
const childrenRef = getElementRef(children);
|
|
49
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
50
|
-
if (children.type !== React2.Fragment) {
|
|
51
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
52
|
-
}
|
|
53
|
-
return React2.cloneElement(children, props2);
|
|
54
|
-
}
|
|
55
|
-
return React2.Children.count(children) > 1 ? React2.Children.only(null) : null;
|
|
56
|
-
});
|
|
57
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
58
|
-
return SlotClone;
|
|
59
|
-
}
|
|
60
|
-
var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
|
|
61
|
-
function isSlottable(child) {
|
|
62
|
-
return React2.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
63
|
-
}
|
|
64
|
-
function mergeProps(slotProps, childProps) {
|
|
65
|
-
const overrideProps = { ...childProps };
|
|
66
|
-
for (const propName in childProps) {
|
|
67
|
-
const slotPropValue = slotProps[propName];
|
|
68
|
-
const childPropValue = childProps[propName];
|
|
69
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
70
|
-
if (isHandler) {
|
|
71
|
-
if (slotPropValue && childPropValue) {
|
|
72
|
-
overrideProps[propName] = (...args) => {
|
|
73
|
-
const result = childPropValue(...args);
|
|
74
|
-
slotPropValue(...args);
|
|
75
|
-
return result;
|
|
76
|
-
};
|
|
77
|
-
} else if (slotPropValue) {
|
|
78
|
-
overrideProps[propName] = slotPropValue;
|
|
79
|
-
}
|
|
80
|
-
} else if (propName === "style") {
|
|
81
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
82
|
-
} else if (propName === "className") {
|
|
83
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return { ...slotProps, ...overrideProps };
|
|
87
|
-
}
|
|
88
|
-
function getElementRef(element) {
|
|
89
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
90
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
91
|
-
if (mayWarn) {
|
|
92
|
-
return element.ref;
|
|
93
|
-
}
|
|
94
|
-
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
95
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
96
|
-
if (mayWarn) {
|
|
97
|
-
return element.props.ref;
|
|
98
|
-
}
|
|
99
|
-
return element.props.ref || element.ref;
|
|
100
|
-
}
|
|
101
|
-
var SELECTION_KEYS = ["Enter", " "];
|
|
102
|
-
var FIRST_KEYS = ["ArrowDown", "PageUp", "Home"];
|
|
103
|
-
var LAST_KEYS = ["ArrowUp", "PageDown", "End"];
|
|
104
|
-
var FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];
|
|
105
|
-
var SUB_OPEN_KEYS = {
|
|
106
|
-
ltr: [...SELECTION_KEYS, "ArrowRight"],
|
|
107
|
-
rtl: [...SELECTION_KEYS, "ArrowLeft"]
|
|
108
|
-
};
|
|
109
|
-
var SUB_CLOSE_KEYS = {
|
|
110
|
-
ltr: ["ArrowLeft"],
|
|
111
|
-
rtl: ["ArrowRight"]
|
|
112
|
-
};
|
|
113
|
-
var MENU_NAME = "Menu";
|
|
114
|
-
var [Collection, useCollection, createCollectionScope] = createCollection(MENU_NAME);
|
|
115
|
-
var [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [
|
|
116
|
-
createCollectionScope,
|
|
117
|
-
createPopperScope,
|
|
118
|
-
createRovingFocusGroupScope
|
|
119
|
-
]);
|
|
120
|
-
var usePopperScope = createPopperScope();
|
|
121
|
-
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
122
|
-
var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);
|
|
123
|
-
var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
124
|
-
var Menu = (props) => {
|
|
125
|
-
const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
|
|
126
|
-
const popperScope = usePopperScope(__scopeMenu);
|
|
127
|
-
const [content, setContent] = React2.useState(null);
|
|
128
|
-
const isUsingKeyboardRef = React2.useRef(false);
|
|
129
|
-
const handleOpenChange = useCallbackRef(onOpenChange);
|
|
130
|
-
const direction = useDirection(dir);
|
|
131
|
-
React2.useEffect(() => {
|
|
132
|
-
const handleKeyDown = () => {
|
|
133
|
-
isUsingKeyboardRef.current = true;
|
|
134
|
-
document.addEventListener("pointerdown", handlePointer, { capture: true, once: true });
|
|
135
|
-
document.addEventListener("pointermove", handlePointer, { capture: true, once: true });
|
|
136
|
-
};
|
|
137
|
-
const handlePointer = () => isUsingKeyboardRef.current = false;
|
|
138
|
-
document.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
139
|
-
return () => {
|
|
140
|
-
document.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
141
|
-
document.removeEventListener("pointerdown", handlePointer, { capture: true });
|
|
142
|
-
document.removeEventListener("pointermove", handlePointer, { capture: true });
|
|
143
|
-
};
|
|
144
|
-
}, []);
|
|
145
|
-
return /* @__PURE__ */ jsx(Root2, { ...popperScope, children: /* @__PURE__ */ jsx(
|
|
146
|
-
MenuProvider,
|
|
147
|
-
{
|
|
148
|
-
scope: __scopeMenu,
|
|
149
|
-
open,
|
|
150
|
-
onOpenChange: handleOpenChange,
|
|
151
|
-
content,
|
|
152
|
-
onContentChange: setContent,
|
|
153
|
-
children: /* @__PURE__ */ jsx(
|
|
154
|
-
MenuRootProvider,
|
|
155
|
-
{
|
|
156
|
-
scope: __scopeMenu,
|
|
157
|
-
onClose: React2.useCallback(() => handleOpenChange(false), [handleOpenChange]),
|
|
158
|
-
isUsingKeyboardRef,
|
|
159
|
-
dir: direction,
|
|
160
|
-
modal,
|
|
161
|
-
children
|
|
162
|
-
}
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
) });
|
|
166
|
-
};
|
|
167
|
-
Menu.displayName = MENU_NAME;
|
|
168
|
-
var ANCHOR_NAME = "MenuAnchor";
|
|
169
|
-
var MenuAnchor = React2.forwardRef(
|
|
170
|
-
(props, forwardedRef) => {
|
|
171
|
-
const { __scopeMenu, ...anchorProps } = props;
|
|
172
|
-
const popperScope = usePopperScope(__scopeMenu);
|
|
173
|
-
return /* @__PURE__ */ jsx(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
174
|
-
}
|
|
175
|
-
);
|
|
176
|
-
MenuAnchor.displayName = ANCHOR_NAME;
|
|
177
|
-
var PORTAL_NAME = "MenuPortal";
|
|
178
|
-
var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {
|
|
179
|
-
forceMount: void 0
|
|
180
|
-
});
|
|
181
|
-
var MenuPortal = (props) => {
|
|
182
|
-
const { __scopeMenu, forceMount, children, container } = props;
|
|
183
|
-
const context = useMenuContext(PORTAL_NAME, __scopeMenu);
|
|
184
|
-
return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal, { asChild: true, container, children }) }) });
|
|
185
|
-
};
|
|
186
|
-
MenuPortal.displayName = PORTAL_NAME;
|
|
187
|
-
var CONTENT_NAME = "MenuContent";
|
|
188
|
-
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME);
|
|
189
|
-
var MenuContent = React2.forwardRef(
|
|
190
|
-
(props, forwardedRef) => {
|
|
191
|
-
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);
|
|
192
|
-
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
193
|
-
const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
|
|
194
|
-
const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);
|
|
195
|
-
return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
196
|
-
}
|
|
197
|
-
);
|
|
198
|
-
var MenuRootContentModal = React2.forwardRef(
|
|
199
|
-
(props, forwardedRef) => {
|
|
200
|
-
const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
|
|
201
|
-
const ref = React2.useRef(null);
|
|
202
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
203
|
-
React2.useEffect(() => {
|
|
204
|
-
const content = ref.current;
|
|
205
|
-
if (content) return hideOthers(content);
|
|
206
|
-
}, []);
|
|
207
|
-
return /* @__PURE__ */ jsx(
|
|
208
|
-
MenuContentImpl,
|
|
209
|
-
{
|
|
210
|
-
...props,
|
|
211
|
-
ref: composedRefs,
|
|
212
|
-
trapFocus: context.open,
|
|
213
|
-
disableOutsidePointerEvents: context.open,
|
|
214
|
-
disableOutsideScroll: true,
|
|
215
|
-
onFocusOutside: composeEventHandlers(
|
|
216
|
-
props.onFocusOutside,
|
|
217
|
-
(event) => event.preventDefault(),
|
|
218
|
-
{ checkForDefaultPrevented: false }
|
|
219
|
-
),
|
|
220
|
-
onDismiss: () => context.onOpenChange(false)
|
|
221
|
-
}
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
);
|
|
225
|
-
var MenuRootContentNonModal = React2.forwardRef((props, forwardedRef) => {
|
|
226
|
-
const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
|
|
227
|
-
return /* @__PURE__ */ jsx(
|
|
228
|
-
MenuContentImpl,
|
|
229
|
-
{
|
|
230
|
-
...props,
|
|
231
|
-
ref: forwardedRef,
|
|
232
|
-
trapFocus: false,
|
|
233
|
-
disableOutsidePointerEvents: false,
|
|
234
|
-
disableOutsideScroll: false,
|
|
235
|
-
onDismiss: () => context.onOpenChange(false)
|
|
236
|
-
}
|
|
237
|
-
);
|
|
238
|
-
});
|
|
239
|
-
var Slot = createSlot("MenuContent.ScrollLock");
|
|
240
|
-
var MenuContentImpl = React2.forwardRef(
|
|
241
|
-
(props, forwardedRef) => {
|
|
242
|
-
const {
|
|
243
|
-
__scopeMenu,
|
|
244
|
-
loop = false,
|
|
245
|
-
trapFocus,
|
|
246
|
-
onOpenAutoFocus,
|
|
247
|
-
onCloseAutoFocus,
|
|
248
|
-
disableOutsidePointerEvents,
|
|
249
|
-
onEntryFocus,
|
|
250
|
-
onEscapeKeyDown,
|
|
251
|
-
onPointerDownOutside,
|
|
252
|
-
onFocusOutside,
|
|
253
|
-
onInteractOutside,
|
|
254
|
-
onDismiss,
|
|
255
|
-
disableOutsideScroll,
|
|
256
|
-
...contentProps
|
|
257
|
-
} = props;
|
|
258
|
-
const context = useMenuContext(CONTENT_NAME, __scopeMenu);
|
|
259
|
-
const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);
|
|
260
|
-
const popperScope = usePopperScope(__scopeMenu);
|
|
261
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
262
|
-
const getItems = useCollection(__scopeMenu);
|
|
263
|
-
const [currentItemId, setCurrentItemId] = React2.useState(null);
|
|
264
|
-
const contentRef = React2.useRef(null);
|
|
265
|
-
const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
|
|
266
|
-
const timerRef = React2.useRef(0);
|
|
267
|
-
const searchRef = React2.useRef("");
|
|
268
|
-
const pointerGraceTimerRef = React2.useRef(0);
|
|
269
|
-
const pointerGraceIntentRef = React2.useRef(null);
|
|
270
|
-
const pointerDirRef = React2.useRef("right");
|
|
271
|
-
const lastPointerXRef = React2.useRef(0);
|
|
272
|
-
const ScrollLockWrapper = disableOutsideScroll ? Combination_default : React2.Fragment;
|
|
273
|
-
const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0;
|
|
274
|
-
const handleTypeaheadSearch = (key) => {
|
|
275
|
-
const search = searchRef.current + key;
|
|
276
|
-
const items = getItems().filter((item) => !item.disabled);
|
|
277
|
-
const currentItem = document.activeElement;
|
|
278
|
-
const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;
|
|
279
|
-
const values = items.map((item) => item.textValue);
|
|
280
|
-
const nextMatch = getNextMatch(values, search, currentMatch);
|
|
281
|
-
const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;
|
|
282
|
-
(function updateSearch(value) {
|
|
283
|
-
searchRef.current = value;
|
|
284
|
-
window.clearTimeout(timerRef.current);
|
|
285
|
-
if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3);
|
|
286
|
-
})(search);
|
|
287
|
-
if (newItem) {
|
|
288
|
-
setTimeout(() => newItem.focus());
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
React2.useEffect(() => {
|
|
292
|
-
return () => window.clearTimeout(timerRef.current);
|
|
293
|
-
}, []);
|
|
294
|
-
useFocusGuards();
|
|
295
|
-
const isPointerMovingToSubmenu = React2.useCallback((event) => {
|
|
296
|
-
const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
|
|
297
|
-
return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
|
|
298
|
-
}, []);
|
|
299
|
-
return /* @__PURE__ */ jsx(
|
|
300
|
-
MenuContentProvider,
|
|
301
|
-
{
|
|
302
|
-
scope: __scopeMenu,
|
|
303
|
-
searchRef,
|
|
304
|
-
onItemEnter: React2.useCallback(
|
|
305
|
-
(event) => {
|
|
306
|
-
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
307
|
-
},
|
|
308
|
-
[isPointerMovingToSubmenu]
|
|
309
|
-
),
|
|
310
|
-
onItemLeave: React2.useCallback(
|
|
311
|
-
(event) => {
|
|
312
|
-
if (isPointerMovingToSubmenu(event)) return;
|
|
313
|
-
contentRef.current?.focus();
|
|
314
|
-
setCurrentItemId(null);
|
|
315
|
-
},
|
|
316
|
-
[isPointerMovingToSubmenu]
|
|
317
|
-
),
|
|
318
|
-
onTriggerLeave: React2.useCallback(
|
|
319
|
-
(event) => {
|
|
320
|
-
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
321
|
-
},
|
|
322
|
-
[isPointerMovingToSubmenu]
|
|
323
|
-
),
|
|
324
|
-
pointerGraceTimerRef,
|
|
325
|
-
onPointerGraceIntentChange: React2.useCallback((intent) => {
|
|
326
|
-
pointerGraceIntentRef.current = intent;
|
|
327
|
-
}, []),
|
|
328
|
-
children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(
|
|
329
|
-
FocusScope,
|
|
330
|
-
{
|
|
331
|
-
asChild: true,
|
|
332
|
-
trapped: trapFocus,
|
|
333
|
-
onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {
|
|
334
|
-
event.preventDefault();
|
|
335
|
-
contentRef.current?.focus({ preventScroll: true });
|
|
336
|
-
}),
|
|
337
|
-
onUnmountAutoFocus: onCloseAutoFocus,
|
|
338
|
-
children: /* @__PURE__ */ jsx(
|
|
339
|
-
DismissableLayer,
|
|
340
|
-
{
|
|
341
|
-
asChild: true,
|
|
342
|
-
disableOutsidePointerEvents,
|
|
343
|
-
onEscapeKeyDown,
|
|
344
|
-
onPointerDownOutside,
|
|
345
|
-
onFocusOutside,
|
|
346
|
-
onInteractOutside,
|
|
347
|
-
onDismiss,
|
|
348
|
-
children: /* @__PURE__ */ jsx(
|
|
349
|
-
Root,
|
|
350
|
-
{
|
|
351
|
-
asChild: true,
|
|
352
|
-
...rovingFocusGroupScope,
|
|
353
|
-
dir: rootContext.dir,
|
|
354
|
-
orientation: "vertical",
|
|
355
|
-
loop,
|
|
356
|
-
currentTabStopId: currentItemId,
|
|
357
|
-
onCurrentTabStopIdChange: setCurrentItemId,
|
|
358
|
-
onEntryFocus: composeEventHandlers(onEntryFocus, (event) => {
|
|
359
|
-
if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
|
|
360
|
-
}),
|
|
361
|
-
preventScrollOnEntryFocus: true,
|
|
362
|
-
children: /* @__PURE__ */ jsx(
|
|
363
|
-
Content,
|
|
364
|
-
{
|
|
365
|
-
role: "menu",
|
|
366
|
-
"aria-orientation": "vertical",
|
|
367
|
-
"data-state": getOpenState(context.open),
|
|
368
|
-
"data-radix-menu-content": "",
|
|
369
|
-
dir: rootContext.dir,
|
|
370
|
-
...popperScope,
|
|
371
|
-
...contentProps,
|
|
372
|
-
ref: composedRefs,
|
|
373
|
-
style: { outline: "none", ...contentProps.style },
|
|
374
|
-
onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {
|
|
375
|
-
const target = event.target;
|
|
376
|
-
const isKeyDownInside = target.closest("[data-radix-menu-content]") === event.currentTarget;
|
|
377
|
-
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
378
|
-
const isCharacterKey = event.key.length === 1;
|
|
379
|
-
if (isKeyDownInside) {
|
|
380
|
-
if (event.key === "Tab") event.preventDefault();
|
|
381
|
-
if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);
|
|
382
|
-
}
|
|
383
|
-
const content = contentRef.current;
|
|
384
|
-
if (event.target !== content) return;
|
|
385
|
-
if (!FIRST_LAST_KEYS.includes(event.key)) return;
|
|
386
|
-
event.preventDefault();
|
|
387
|
-
const items = getItems().filter((item) => !item.disabled);
|
|
388
|
-
const candidateNodes = items.map((item) => item.ref.current);
|
|
389
|
-
if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();
|
|
390
|
-
focusFirst(candidateNodes);
|
|
391
|
-
}),
|
|
392
|
-
onBlur: composeEventHandlers(props.onBlur, (event) => {
|
|
393
|
-
if (!event.currentTarget.contains(event.target)) {
|
|
394
|
-
window.clearTimeout(timerRef.current);
|
|
395
|
-
searchRef.current = "";
|
|
396
|
-
}
|
|
397
|
-
}),
|
|
398
|
-
onPointerMove: composeEventHandlers(
|
|
399
|
-
props.onPointerMove,
|
|
400
|
-
whenMouse((event) => {
|
|
401
|
-
const target = event.target;
|
|
402
|
-
const pointerXHasChanged = lastPointerXRef.current !== event.clientX;
|
|
403
|
-
if (event.currentTarget.contains(target) && pointerXHasChanged) {
|
|
404
|
-
const newDir = event.clientX > lastPointerXRef.current ? "right" : "left";
|
|
405
|
-
pointerDirRef.current = newDir;
|
|
406
|
-
lastPointerXRef.current = event.clientX;
|
|
407
|
-
}
|
|
408
|
-
})
|
|
409
|
-
)
|
|
410
|
-
}
|
|
411
|
-
)
|
|
412
|
-
}
|
|
413
|
-
)
|
|
414
|
-
}
|
|
415
|
-
)
|
|
416
|
-
}
|
|
417
|
-
) })
|
|
418
|
-
}
|
|
419
|
-
);
|
|
420
|
-
}
|
|
421
|
-
);
|
|
422
|
-
MenuContent.displayName = CONTENT_NAME;
|
|
423
|
-
var GROUP_NAME = "MenuGroup";
|
|
424
|
-
var MenuGroup = React2.forwardRef(
|
|
425
|
-
(props, forwardedRef) => {
|
|
426
|
-
const { __scopeMenu, ...groupProps } = props;
|
|
427
|
-
return /* @__PURE__ */ jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
428
|
-
}
|
|
429
|
-
);
|
|
430
|
-
MenuGroup.displayName = GROUP_NAME;
|
|
431
|
-
var LABEL_NAME = "MenuLabel";
|
|
432
|
-
var MenuLabel = React2.forwardRef(
|
|
433
|
-
(props, forwardedRef) => {
|
|
434
|
-
const { __scopeMenu, ...labelProps } = props;
|
|
435
|
-
return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
436
|
-
}
|
|
437
|
-
);
|
|
438
|
-
MenuLabel.displayName = LABEL_NAME;
|
|
439
|
-
var ITEM_NAME = "MenuItem";
|
|
440
|
-
var ITEM_SELECT = "menu.itemSelect";
|
|
441
|
-
var MenuItem = React2.forwardRef(
|
|
442
|
-
(props, forwardedRef) => {
|
|
443
|
-
const { disabled = false, onSelect, ...itemProps } = props;
|
|
444
|
-
const ref = React2.useRef(null);
|
|
445
|
-
const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);
|
|
446
|
-
const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);
|
|
447
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
448
|
-
const isPointerDownRef = React2.useRef(false);
|
|
449
|
-
const handleSelect = () => {
|
|
450
|
-
const menuItem = ref.current;
|
|
451
|
-
if (!disabled && menuItem) {
|
|
452
|
-
const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });
|
|
453
|
-
menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });
|
|
454
|
-
dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);
|
|
455
|
-
if (itemSelectEvent.defaultPrevented) {
|
|
456
|
-
isPointerDownRef.current = false;
|
|
457
|
-
} else {
|
|
458
|
-
rootContext.onClose();
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
|
-
return /* @__PURE__ */ jsx(
|
|
463
|
-
MenuItemImpl,
|
|
464
|
-
{
|
|
465
|
-
...itemProps,
|
|
466
|
-
ref: composedRefs,
|
|
467
|
-
disabled,
|
|
468
|
-
onClick: composeEventHandlers(props.onClick, handleSelect),
|
|
469
|
-
onPointerDown: (event) => {
|
|
470
|
-
props.onPointerDown?.(event);
|
|
471
|
-
isPointerDownRef.current = true;
|
|
472
|
-
},
|
|
473
|
-
onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
|
|
474
|
-
if (!isPointerDownRef.current) event.currentTarget?.click();
|
|
475
|
-
}),
|
|
476
|
-
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
477
|
-
const isTypingAhead = contentContext.searchRef.current !== "";
|
|
478
|
-
if (disabled || isTypingAhead && event.key === " ") return;
|
|
479
|
-
if (SELECTION_KEYS.includes(event.key)) {
|
|
480
|
-
event.currentTarget.click();
|
|
481
|
-
event.preventDefault();
|
|
482
|
-
}
|
|
483
|
-
})
|
|
484
|
-
}
|
|
485
|
-
);
|
|
486
|
-
}
|
|
487
|
-
);
|
|
488
|
-
MenuItem.displayName = ITEM_NAME;
|
|
489
|
-
var MenuItemImpl = React2.forwardRef(
|
|
490
|
-
(props, forwardedRef) => {
|
|
491
|
-
const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
492
|
-
const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);
|
|
493
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
494
|
-
const ref = React2.useRef(null);
|
|
495
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
496
|
-
const [isFocused, setIsFocused] = React2.useState(false);
|
|
497
|
-
const [textContent, setTextContent] = React2.useState("");
|
|
498
|
-
React2.useEffect(() => {
|
|
499
|
-
const menuItem = ref.current;
|
|
500
|
-
if (menuItem) {
|
|
501
|
-
setTextContent((menuItem.textContent ?? "").trim());
|
|
502
|
-
}
|
|
503
|
-
}, [itemProps.children]);
|
|
504
|
-
return /* @__PURE__ */ jsx(
|
|
505
|
-
Collection.ItemSlot,
|
|
506
|
-
{
|
|
507
|
-
scope: __scopeMenu,
|
|
508
|
-
disabled,
|
|
509
|
-
textValue: textValue ?? textContent,
|
|
510
|
-
children: /* @__PURE__ */ jsx(Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx(
|
|
511
|
-
Primitive.div,
|
|
512
|
-
{
|
|
513
|
-
role: "menuitem",
|
|
514
|
-
"data-highlighted": isFocused ? "" : void 0,
|
|
515
|
-
"aria-disabled": disabled || void 0,
|
|
516
|
-
"data-disabled": disabled ? "" : void 0,
|
|
517
|
-
...itemProps,
|
|
518
|
-
ref: composedRefs,
|
|
519
|
-
onPointerMove: composeEventHandlers(
|
|
520
|
-
props.onPointerMove,
|
|
521
|
-
whenMouse((event) => {
|
|
522
|
-
if (disabled) {
|
|
523
|
-
contentContext.onItemLeave(event);
|
|
524
|
-
} else {
|
|
525
|
-
contentContext.onItemEnter(event);
|
|
526
|
-
if (!event.defaultPrevented) {
|
|
527
|
-
const item = event.currentTarget;
|
|
528
|
-
item.focus({ preventScroll: true });
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
})
|
|
532
|
-
),
|
|
533
|
-
onPointerLeave: composeEventHandlers(
|
|
534
|
-
props.onPointerLeave,
|
|
535
|
-
whenMouse((event) => contentContext.onItemLeave(event))
|
|
536
|
-
),
|
|
537
|
-
onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),
|
|
538
|
-
onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false))
|
|
539
|
-
}
|
|
540
|
-
) })
|
|
541
|
-
}
|
|
542
|
-
);
|
|
543
|
-
}
|
|
544
|
-
);
|
|
545
|
-
var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
|
|
546
|
-
var MenuCheckboxItem = React2.forwardRef(
|
|
547
|
-
(props, forwardedRef) => {
|
|
548
|
-
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
549
|
-
return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(
|
|
550
|
-
MenuItem,
|
|
551
|
-
{
|
|
552
|
-
role: "menuitemcheckbox",
|
|
553
|
-
"aria-checked": isIndeterminate(checked) ? "mixed" : checked,
|
|
554
|
-
...checkboxItemProps,
|
|
555
|
-
ref: forwardedRef,
|
|
556
|
-
"data-state": getCheckedState(checked),
|
|
557
|
-
onSelect: composeEventHandlers(
|
|
558
|
-
checkboxItemProps.onSelect,
|
|
559
|
-
() => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),
|
|
560
|
-
{ checkForDefaultPrevented: false }
|
|
561
|
-
)
|
|
562
|
-
}
|
|
563
|
-
) });
|
|
564
|
-
}
|
|
565
|
-
);
|
|
566
|
-
MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
567
|
-
var RADIO_GROUP_NAME = "MenuRadioGroup";
|
|
568
|
-
var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(
|
|
569
|
-
RADIO_GROUP_NAME,
|
|
570
|
-
{ value: void 0, onValueChange: () => {
|
|
571
|
-
} }
|
|
572
|
-
);
|
|
573
|
-
var MenuRadioGroup = React2.forwardRef(
|
|
574
|
-
(props, forwardedRef) => {
|
|
575
|
-
const { value, onValueChange, ...groupProps } = props;
|
|
576
|
-
const handleValueChange = useCallbackRef(onValueChange);
|
|
577
|
-
return /* @__PURE__ */ jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });
|
|
578
|
-
}
|
|
579
|
-
);
|
|
580
|
-
MenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
581
|
-
var RADIO_ITEM_NAME = "MenuRadioItem";
|
|
582
|
-
var MenuRadioItem = React2.forwardRef(
|
|
583
|
-
(props, forwardedRef) => {
|
|
584
|
-
const { value, ...radioItemProps } = props;
|
|
585
|
-
const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
|
|
586
|
-
const checked = value === context.value;
|
|
587
|
-
return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(
|
|
588
|
-
MenuItem,
|
|
589
|
-
{
|
|
590
|
-
role: "menuitemradio",
|
|
591
|
-
"aria-checked": checked,
|
|
592
|
-
...radioItemProps,
|
|
593
|
-
ref: forwardedRef,
|
|
594
|
-
"data-state": getCheckedState(checked),
|
|
595
|
-
onSelect: composeEventHandlers(
|
|
596
|
-
radioItemProps.onSelect,
|
|
597
|
-
() => context.onValueChange?.(value),
|
|
598
|
-
{ checkForDefaultPrevented: false }
|
|
599
|
-
)
|
|
600
|
-
}
|
|
601
|
-
) });
|
|
602
|
-
}
|
|
603
|
-
);
|
|
604
|
-
MenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
605
|
-
var ITEM_INDICATOR_NAME = "MenuItemIndicator";
|
|
606
|
-
var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(
|
|
607
|
-
ITEM_INDICATOR_NAME,
|
|
608
|
-
{ checked: false }
|
|
609
|
-
);
|
|
610
|
-
var MenuItemIndicator = React2.forwardRef(
|
|
611
|
-
(props, forwardedRef) => {
|
|
612
|
-
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
613
|
-
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
614
|
-
return /* @__PURE__ */ jsx(
|
|
615
|
-
Presence,
|
|
616
|
-
{
|
|
617
|
-
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
618
|
-
children: /* @__PURE__ */ jsx(
|
|
619
|
-
Primitive.span,
|
|
620
|
-
{
|
|
621
|
-
...itemIndicatorProps,
|
|
622
|
-
ref: forwardedRef,
|
|
623
|
-
"data-state": getCheckedState(indicatorContext.checked)
|
|
624
|
-
}
|
|
625
|
-
)
|
|
626
|
-
}
|
|
627
|
-
);
|
|
628
|
-
}
|
|
629
|
-
);
|
|
630
|
-
MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
631
|
-
var SEPARATOR_NAME = "MenuSeparator";
|
|
632
|
-
var MenuSeparator = React2.forwardRef(
|
|
633
|
-
(props, forwardedRef) => {
|
|
634
|
-
const { __scopeMenu, ...separatorProps } = props;
|
|
635
|
-
return /* @__PURE__ */ jsx(
|
|
636
|
-
Primitive.div,
|
|
637
|
-
{
|
|
638
|
-
role: "separator",
|
|
639
|
-
"aria-orientation": "horizontal",
|
|
640
|
-
...separatorProps,
|
|
641
|
-
ref: forwardedRef
|
|
642
|
-
}
|
|
643
|
-
);
|
|
644
|
-
}
|
|
645
|
-
);
|
|
646
|
-
MenuSeparator.displayName = SEPARATOR_NAME;
|
|
647
|
-
var ARROW_NAME = "MenuArrow";
|
|
648
|
-
var MenuArrow = React2.forwardRef(
|
|
649
|
-
(props, forwardedRef) => {
|
|
650
|
-
const { __scopeMenu, ...arrowProps } = props;
|
|
651
|
-
const popperScope = usePopperScope(__scopeMenu);
|
|
652
|
-
return /* @__PURE__ */ jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
653
|
-
}
|
|
654
|
-
);
|
|
655
|
-
MenuArrow.displayName = ARROW_NAME;
|
|
656
|
-
var SUB_NAME = "MenuSub";
|
|
657
|
-
var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);
|
|
658
|
-
var MenuSub = (props) => {
|
|
659
|
-
const { __scopeMenu, children, open = false, onOpenChange } = props;
|
|
660
|
-
const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);
|
|
661
|
-
const popperScope = usePopperScope(__scopeMenu);
|
|
662
|
-
const [trigger, setTrigger] = React2.useState(null);
|
|
663
|
-
const [content, setContent] = React2.useState(null);
|
|
664
|
-
const handleOpenChange = useCallbackRef(onOpenChange);
|
|
665
|
-
React2.useEffect(() => {
|
|
666
|
-
if (parentMenuContext.open === false) handleOpenChange(false);
|
|
667
|
-
return () => handleOpenChange(false);
|
|
668
|
-
}, [parentMenuContext.open, handleOpenChange]);
|
|
669
|
-
return /* @__PURE__ */ jsx(Root2, { ...popperScope, children: /* @__PURE__ */ jsx(
|
|
670
|
-
MenuProvider,
|
|
671
|
-
{
|
|
672
|
-
scope: __scopeMenu,
|
|
673
|
-
open,
|
|
674
|
-
onOpenChange: handleOpenChange,
|
|
675
|
-
content,
|
|
676
|
-
onContentChange: setContent,
|
|
677
|
-
children: /* @__PURE__ */ jsx(
|
|
678
|
-
MenuSubProvider,
|
|
679
|
-
{
|
|
680
|
-
scope: __scopeMenu,
|
|
681
|
-
contentId: useId(),
|
|
682
|
-
triggerId: useId(),
|
|
683
|
-
trigger,
|
|
684
|
-
onTriggerChange: setTrigger,
|
|
685
|
-
children
|
|
686
|
-
}
|
|
687
|
-
)
|
|
688
|
-
}
|
|
689
|
-
) });
|
|
690
|
-
};
|
|
691
|
-
MenuSub.displayName = SUB_NAME;
|
|
692
|
-
var SUB_TRIGGER_NAME = "MenuSubTrigger";
|
|
693
|
-
var MenuSubTrigger = React2.forwardRef(
|
|
694
|
-
(props, forwardedRef) => {
|
|
695
|
-
const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
696
|
-
const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
697
|
-
const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
698
|
-
const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
699
|
-
const openTimerRef = React2.useRef(null);
|
|
700
|
-
const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;
|
|
701
|
-
const scope = { __scopeMenu: props.__scopeMenu };
|
|
702
|
-
const clearOpenTimer = React2.useCallback(() => {
|
|
703
|
-
if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
|
|
704
|
-
openTimerRef.current = null;
|
|
705
|
-
}, []);
|
|
706
|
-
React2.useEffect(() => clearOpenTimer, [clearOpenTimer]);
|
|
707
|
-
React2.useEffect(() => {
|
|
708
|
-
const pointerGraceTimer = pointerGraceTimerRef.current;
|
|
709
|
-
return () => {
|
|
710
|
-
window.clearTimeout(pointerGraceTimer);
|
|
711
|
-
onPointerGraceIntentChange(null);
|
|
712
|
-
};
|
|
713
|
-
}, [pointerGraceTimerRef, onPointerGraceIntentChange]);
|
|
714
|
-
return /* @__PURE__ */ jsx(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsx(
|
|
715
|
-
MenuItemImpl,
|
|
716
|
-
{
|
|
717
|
-
id: subContext.triggerId,
|
|
718
|
-
"aria-haspopup": "menu",
|
|
719
|
-
"aria-expanded": context.open,
|
|
720
|
-
"aria-controls": subContext.contentId,
|
|
721
|
-
"data-state": getOpenState(context.open),
|
|
722
|
-
...props,
|
|
723
|
-
ref: composeRefs(forwardedRef, subContext.onTriggerChange),
|
|
724
|
-
onClick: (event) => {
|
|
725
|
-
props.onClick?.(event);
|
|
726
|
-
if (props.disabled || event.defaultPrevented) return;
|
|
727
|
-
event.currentTarget.focus();
|
|
728
|
-
if (!context.open) context.onOpenChange(true);
|
|
729
|
-
},
|
|
730
|
-
onPointerMove: composeEventHandlers(
|
|
731
|
-
props.onPointerMove,
|
|
732
|
-
whenMouse((event) => {
|
|
733
|
-
contentContext.onItemEnter(event);
|
|
734
|
-
if (event.defaultPrevented) return;
|
|
735
|
-
if (!props.disabled && !context.open && !openTimerRef.current) {
|
|
736
|
-
contentContext.onPointerGraceIntentChange(null);
|
|
737
|
-
openTimerRef.current = window.setTimeout(() => {
|
|
738
|
-
context.onOpenChange(true);
|
|
739
|
-
clearOpenTimer();
|
|
740
|
-
}, 100);
|
|
741
|
-
}
|
|
742
|
-
})
|
|
743
|
-
),
|
|
744
|
-
onPointerLeave: composeEventHandlers(
|
|
745
|
-
props.onPointerLeave,
|
|
746
|
-
whenMouse((event) => {
|
|
747
|
-
clearOpenTimer();
|
|
748
|
-
const contentRect = context.content?.getBoundingClientRect();
|
|
749
|
-
if (contentRect) {
|
|
750
|
-
const side = context.content?.dataset.side;
|
|
751
|
-
const rightSide = side === "right";
|
|
752
|
-
const bleed = rightSide ? -5 : 5;
|
|
753
|
-
const contentNearEdge = contentRect[rightSide ? "left" : "right"];
|
|
754
|
-
const contentFarEdge = contentRect[rightSide ? "right" : "left"];
|
|
755
|
-
contentContext.onPointerGraceIntentChange({
|
|
756
|
-
area: [
|
|
757
|
-
// Apply a bleed on clientX to ensure that our exit point is
|
|
758
|
-
// consistently within polygon bounds
|
|
759
|
-
{ x: event.clientX + bleed, y: event.clientY },
|
|
760
|
-
{ x: contentNearEdge, y: contentRect.top },
|
|
761
|
-
{ x: contentFarEdge, y: contentRect.top },
|
|
762
|
-
{ x: contentFarEdge, y: contentRect.bottom },
|
|
763
|
-
{ x: contentNearEdge, y: contentRect.bottom }
|
|
764
|
-
],
|
|
765
|
-
side
|
|
766
|
-
});
|
|
767
|
-
window.clearTimeout(pointerGraceTimerRef.current);
|
|
768
|
-
pointerGraceTimerRef.current = window.setTimeout(
|
|
769
|
-
() => contentContext.onPointerGraceIntentChange(null),
|
|
770
|
-
300
|
|
771
|
-
);
|
|
772
|
-
} else {
|
|
773
|
-
contentContext.onTriggerLeave(event);
|
|
774
|
-
if (event.defaultPrevented) return;
|
|
775
|
-
contentContext.onPointerGraceIntentChange(null);
|
|
776
|
-
}
|
|
777
|
-
})
|
|
778
|
-
),
|
|
779
|
-
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
780
|
-
const isTypingAhead = contentContext.searchRef.current !== "";
|
|
781
|
-
if (props.disabled || isTypingAhead && event.key === " ") return;
|
|
782
|
-
if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {
|
|
783
|
-
context.onOpenChange(true);
|
|
784
|
-
context.content?.focus();
|
|
785
|
-
event.preventDefault();
|
|
786
|
-
}
|
|
787
|
-
})
|
|
788
|
-
}
|
|
789
|
-
) });
|
|
790
|
-
}
|
|
791
|
-
);
|
|
792
|
-
MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
793
|
-
var SUB_CONTENT_NAME = "MenuSubContent";
|
|
794
|
-
var MenuSubContent = React2.forwardRef(
|
|
795
|
-
(props, forwardedRef) => {
|
|
796
|
-
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);
|
|
797
|
-
const { forceMount = portalContext.forceMount, ...subContentProps } = props;
|
|
798
|
-
const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
|
|
799
|
-
const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);
|
|
800
|
-
const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
|
|
801
|
-
const ref = React2.useRef(null);
|
|
802
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
803
|
-
return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(
|
|
804
|
-
MenuContentImpl,
|
|
805
|
-
{
|
|
806
|
-
id: subContext.contentId,
|
|
807
|
-
"aria-labelledby": subContext.triggerId,
|
|
808
|
-
...subContentProps,
|
|
809
|
-
ref: composedRefs,
|
|
810
|
-
align: "start",
|
|
811
|
-
side: rootContext.dir === "rtl" ? "left" : "right",
|
|
812
|
-
disableOutsidePointerEvents: false,
|
|
813
|
-
disableOutsideScroll: false,
|
|
814
|
-
trapFocus: false,
|
|
815
|
-
onOpenAutoFocus: (event) => {
|
|
816
|
-
if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();
|
|
817
|
-
event.preventDefault();
|
|
818
|
-
},
|
|
819
|
-
onCloseAutoFocus: (event) => event.preventDefault(),
|
|
820
|
-
onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {
|
|
821
|
-
if (event.target !== subContext.trigger) context.onOpenChange(false);
|
|
822
|
-
}),
|
|
823
|
-
onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (event) => {
|
|
824
|
-
rootContext.onClose();
|
|
825
|
-
event.preventDefault();
|
|
826
|
-
}),
|
|
827
|
-
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
828
|
-
const isKeyDownInside = event.currentTarget.contains(event.target);
|
|
829
|
-
const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);
|
|
830
|
-
if (isKeyDownInside && isCloseKey) {
|
|
831
|
-
context.onOpenChange(false);
|
|
832
|
-
subContext.trigger?.focus();
|
|
833
|
-
event.preventDefault();
|
|
834
|
-
}
|
|
835
|
-
})
|
|
836
|
-
}
|
|
837
|
-
) }) }) });
|
|
838
|
-
}
|
|
839
|
-
);
|
|
840
|
-
MenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
841
|
-
function getOpenState(open) {
|
|
842
|
-
return open ? "open" : "closed";
|
|
843
|
-
}
|
|
844
|
-
function isIndeterminate(checked) {
|
|
845
|
-
return checked === "indeterminate";
|
|
846
|
-
}
|
|
847
|
-
function getCheckedState(checked) {
|
|
848
|
-
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
849
|
-
}
|
|
850
|
-
function focusFirst(candidates) {
|
|
851
|
-
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
852
|
-
for (const candidate of candidates) {
|
|
853
|
-
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
854
|
-
candidate.focus();
|
|
855
|
-
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
function wrapArray(array, startIndex) {
|
|
859
|
-
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
860
|
-
}
|
|
861
|
-
function getNextMatch(values, search, currentMatch) {
|
|
862
|
-
const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);
|
|
863
|
-
const normalizedSearch = isRepeated ? search[0] : search;
|
|
864
|
-
const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;
|
|
865
|
-
let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));
|
|
866
|
-
const excludeCurrentMatch = normalizedSearch.length === 1;
|
|
867
|
-
if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);
|
|
868
|
-
const nextMatch = wrappedValues.find(
|
|
869
|
-
(value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())
|
|
870
|
-
);
|
|
871
|
-
return nextMatch !== currentMatch ? nextMatch : void 0;
|
|
872
|
-
}
|
|
873
|
-
function isPointInPolygon(point, polygon) {
|
|
874
|
-
const { x, y } = point;
|
|
875
|
-
let inside = false;
|
|
876
|
-
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
877
|
-
const ii = polygon[i];
|
|
878
|
-
const jj = polygon[j];
|
|
879
|
-
const xi = ii.x;
|
|
880
|
-
const yi = ii.y;
|
|
881
|
-
const xj = jj.x;
|
|
882
|
-
const yj = jj.y;
|
|
883
|
-
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
884
|
-
if (intersect) inside = !inside;
|
|
885
|
-
}
|
|
886
|
-
return inside;
|
|
887
|
-
}
|
|
888
|
-
function isPointerInGraceArea(event, area) {
|
|
889
|
-
if (!area) return false;
|
|
890
|
-
const cursorPos = { x: event.clientX, y: event.clientY };
|
|
891
|
-
return isPointInPolygon(cursorPos, area);
|
|
892
|
-
}
|
|
893
|
-
function whenMouse(handler) {
|
|
894
|
-
return (event) => event.pointerType === "mouse" ? handler(event) : void 0;
|
|
895
|
-
}
|
|
896
|
-
var Root3 = Menu;
|
|
897
|
-
var Anchor2 = MenuAnchor;
|
|
898
|
-
var Portal2 = MenuPortal;
|
|
899
|
-
var Content2 = MenuContent;
|
|
900
|
-
var Group = MenuGroup;
|
|
901
|
-
var Label = MenuLabel;
|
|
902
|
-
var Item2 = MenuItem;
|
|
903
|
-
var CheckboxItem = MenuCheckboxItem;
|
|
904
|
-
var RadioGroup = MenuRadioGroup;
|
|
905
|
-
var RadioItem = MenuRadioItem;
|
|
906
|
-
var ItemIndicator = MenuItemIndicator;
|
|
907
|
-
var Separator = MenuSeparator;
|
|
908
|
-
var Arrow2 = MenuArrow;
|
|
909
|
-
var Sub = MenuSub;
|
|
910
|
-
var SubTrigger = MenuSubTrigger;
|
|
911
|
-
var SubContent = MenuSubContent;
|
|
912
|
-
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
913
|
-
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(
|
|
914
|
-
DROPDOWN_MENU_NAME,
|
|
915
|
-
[createMenuScope]
|
|
916
|
-
);
|
|
917
|
-
var useMenuScope = createMenuScope();
|
|
918
|
-
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
919
|
-
var DropdownMenu = (props) => {
|
|
920
|
-
const {
|
|
921
|
-
__scopeDropdownMenu,
|
|
922
|
-
children,
|
|
923
|
-
dir,
|
|
924
|
-
open: openProp,
|
|
925
|
-
defaultOpen,
|
|
926
|
-
onOpenChange,
|
|
927
|
-
modal = true
|
|
928
|
-
} = props;
|
|
929
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
930
|
-
const triggerRef = React2.useRef(null);
|
|
931
|
-
const [open, setOpen] = useControllableState({
|
|
932
|
-
prop: openProp,
|
|
933
|
-
defaultProp: defaultOpen ?? false,
|
|
934
|
-
onChange: onOpenChange,
|
|
935
|
-
caller: DROPDOWN_MENU_NAME
|
|
936
|
-
});
|
|
937
|
-
return /* @__PURE__ */ jsx(
|
|
938
|
-
DropdownMenuProvider,
|
|
939
|
-
{
|
|
940
|
-
scope: __scopeDropdownMenu,
|
|
941
|
-
triggerId: useId(),
|
|
942
|
-
triggerRef,
|
|
943
|
-
contentId: useId(),
|
|
944
|
-
open,
|
|
945
|
-
onOpenChange: setOpen,
|
|
946
|
-
onOpenToggle: React2.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
947
|
-
modal,
|
|
948
|
-
children: /* @__PURE__ */ jsx(Root3, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
949
|
-
}
|
|
950
|
-
);
|
|
951
|
-
};
|
|
952
|
-
DropdownMenu.displayName = DROPDOWN_MENU_NAME;
|
|
953
|
-
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
954
|
-
var DropdownMenuTrigger = React2.forwardRef(
|
|
955
|
-
(props, forwardedRef) => {
|
|
956
|
-
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
957
|
-
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
958
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
959
|
-
return /* @__PURE__ */ jsx(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx(
|
|
960
|
-
Primitive.button,
|
|
961
|
-
{
|
|
962
|
-
type: "button",
|
|
963
|
-
id: context.triggerId,
|
|
964
|
-
"aria-haspopup": "menu",
|
|
965
|
-
"aria-expanded": context.open,
|
|
966
|
-
"aria-controls": context.open ? context.contentId : void 0,
|
|
967
|
-
"data-state": context.open ? "open" : "closed",
|
|
968
|
-
"data-disabled": disabled ? "" : void 0,
|
|
969
|
-
disabled,
|
|
970
|
-
...triggerProps,
|
|
971
|
-
ref: composeRefs(forwardedRef, context.triggerRef),
|
|
972
|
-
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
|
|
973
|
-
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
974
|
-
context.onOpenToggle();
|
|
975
|
-
if (!context.open) event.preventDefault();
|
|
976
|
-
}
|
|
977
|
-
}),
|
|
978
|
-
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
979
|
-
if (disabled) return;
|
|
980
|
-
if (["Enter", " "].includes(event.key)) context.onOpenToggle();
|
|
981
|
-
if (event.key === "ArrowDown") context.onOpenChange(true);
|
|
982
|
-
if (["Enter", " ", "ArrowDown"].includes(event.key)) event.preventDefault();
|
|
983
|
-
})
|
|
984
|
-
}
|
|
985
|
-
) });
|
|
986
|
-
}
|
|
987
|
-
);
|
|
988
|
-
DropdownMenuTrigger.displayName = TRIGGER_NAME;
|
|
989
|
-
var PORTAL_NAME2 = "DropdownMenuPortal";
|
|
990
|
-
var DropdownMenuPortal = (props) => {
|
|
991
|
-
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
992
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
993
|
-
return /* @__PURE__ */ jsx(Portal2, { ...menuScope, ...portalProps });
|
|
994
|
-
};
|
|
995
|
-
DropdownMenuPortal.displayName = PORTAL_NAME2;
|
|
996
|
-
var CONTENT_NAME2 = "DropdownMenuContent";
|
|
997
|
-
var DropdownMenuContent = React2.forwardRef(
|
|
998
|
-
(props, forwardedRef) => {
|
|
999
|
-
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
1000
|
-
const context = useDropdownMenuContext(CONTENT_NAME2, __scopeDropdownMenu);
|
|
1001
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1002
|
-
const hasInteractedOutsideRef = React2.useRef(false);
|
|
1003
|
-
return /* @__PURE__ */ jsx(
|
|
1004
|
-
Content2,
|
|
1005
|
-
{
|
|
1006
|
-
id: context.contentId,
|
|
1007
|
-
"aria-labelledby": context.triggerId,
|
|
1008
|
-
...menuScope,
|
|
1009
|
-
...contentProps,
|
|
1010
|
-
ref: forwardedRef,
|
|
1011
|
-
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
1012
|
-
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
1013
|
-
hasInteractedOutsideRef.current = false;
|
|
1014
|
-
event.preventDefault();
|
|
1015
|
-
}),
|
|
1016
|
-
onInteractOutside: composeEventHandlers(props.onInteractOutside, (event) => {
|
|
1017
|
-
const originalEvent = event.detail.originalEvent;
|
|
1018
|
-
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
1019
|
-
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
1020
|
-
if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;
|
|
1021
|
-
}),
|
|
1022
|
-
style: {
|
|
1023
|
-
...props.style,
|
|
1024
|
-
// re-namespace exposed content custom properties
|
|
1025
|
-
...{
|
|
1026
|
-
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
1027
|
-
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
1028
|
-
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
1029
|
-
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
1030
|
-
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
);
|
|
1035
|
-
}
|
|
1036
|
-
);
|
|
1037
|
-
DropdownMenuContent.displayName = CONTENT_NAME2;
|
|
1038
|
-
var GROUP_NAME2 = "DropdownMenuGroup";
|
|
1039
|
-
var DropdownMenuGroup = React2.forwardRef(
|
|
1040
|
-
(props, forwardedRef) => {
|
|
1041
|
-
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
1042
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1043
|
-
return /* @__PURE__ */ jsx(Group, { ...menuScope, ...groupProps, ref: forwardedRef });
|
|
1044
|
-
}
|
|
1045
|
-
);
|
|
1046
|
-
DropdownMenuGroup.displayName = GROUP_NAME2;
|
|
1047
|
-
var LABEL_NAME2 = "DropdownMenuLabel";
|
|
1048
|
-
var DropdownMenuLabel = React2.forwardRef(
|
|
1049
|
-
(props, forwardedRef) => {
|
|
1050
|
-
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
1051
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1052
|
-
return /* @__PURE__ */ jsx(Label, { ...menuScope, ...labelProps, ref: forwardedRef });
|
|
1053
|
-
}
|
|
1054
|
-
);
|
|
1055
|
-
DropdownMenuLabel.displayName = LABEL_NAME2;
|
|
1056
|
-
var ITEM_NAME2 = "DropdownMenuItem";
|
|
1057
|
-
var DropdownMenuItem = React2.forwardRef(
|
|
1058
|
-
(props, forwardedRef) => {
|
|
1059
|
-
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
1060
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1061
|
-
return /* @__PURE__ */ jsx(Item2, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
1062
|
-
}
|
|
1063
|
-
);
|
|
1064
|
-
DropdownMenuItem.displayName = ITEM_NAME2;
|
|
1065
|
-
var CHECKBOX_ITEM_NAME2 = "DropdownMenuCheckboxItem";
|
|
1066
|
-
var DropdownMenuCheckboxItem = React2.forwardRef((props, forwardedRef) => {
|
|
1067
|
-
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
1068
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1069
|
-
return /* @__PURE__ */ jsx(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
1070
|
-
});
|
|
1071
|
-
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME2;
|
|
1072
|
-
var RADIO_GROUP_NAME2 = "DropdownMenuRadioGroup";
|
|
1073
|
-
var DropdownMenuRadioGroup = React2.forwardRef((props, forwardedRef) => {
|
|
1074
|
-
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
1075
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1076
|
-
return /* @__PURE__ */ jsx(RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
1077
|
-
});
|
|
1078
|
-
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME2;
|
|
1079
|
-
var RADIO_ITEM_NAME2 = "DropdownMenuRadioItem";
|
|
1080
|
-
var DropdownMenuRadioItem = React2.forwardRef((props, forwardedRef) => {
|
|
1081
|
-
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
1082
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1083
|
-
return /* @__PURE__ */ jsx(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
1084
|
-
});
|
|
1085
|
-
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME2;
|
|
1086
|
-
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
1087
|
-
var DropdownMenuItemIndicator = React2.forwardRef((props, forwardedRef) => {
|
|
1088
|
-
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
1089
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1090
|
-
return /* @__PURE__ */ jsx(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
1091
|
-
});
|
|
1092
|
-
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
1093
|
-
var SEPARATOR_NAME2 = "DropdownMenuSeparator";
|
|
1094
|
-
var DropdownMenuSeparator = React2.forwardRef((props, forwardedRef) => {
|
|
1095
|
-
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
1096
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1097
|
-
return /* @__PURE__ */ jsx(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
1098
|
-
});
|
|
1099
|
-
DropdownMenuSeparator.displayName = SEPARATOR_NAME2;
|
|
1100
|
-
var ARROW_NAME2 = "DropdownMenuArrow";
|
|
1101
|
-
var DropdownMenuArrow = React2.forwardRef(
|
|
1102
|
-
(props, forwardedRef) => {
|
|
1103
|
-
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
1104
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1105
|
-
return /* @__PURE__ */ jsx(Arrow2, { ...menuScope, ...arrowProps, ref: forwardedRef });
|
|
1106
|
-
}
|
|
1107
|
-
);
|
|
1108
|
-
DropdownMenuArrow.displayName = ARROW_NAME2;
|
|
1109
|
-
var DropdownMenuSub = (props) => {
|
|
1110
|
-
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
1111
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1112
|
-
const [open, setOpen] = useControllableState({
|
|
1113
|
-
prop: openProp,
|
|
1114
|
-
defaultProp: defaultOpen ?? false,
|
|
1115
|
-
onChange: onOpenChange,
|
|
1116
|
-
caller: "DropdownMenuSub"
|
|
1117
|
-
});
|
|
1118
|
-
return /* @__PURE__ */ jsx(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
1119
|
-
};
|
|
1120
|
-
var SUB_TRIGGER_NAME2 = "DropdownMenuSubTrigger";
|
|
1121
|
-
var DropdownMenuSubTrigger = React2.forwardRef((props, forwardedRef) => {
|
|
1122
|
-
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
1123
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1124
|
-
return /* @__PURE__ */ jsx(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
1125
|
-
});
|
|
1126
|
-
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME2;
|
|
1127
|
-
var SUB_CONTENT_NAME2 = "DropdownMenuSubContent";
|
|
1128
|
-
var DropdownMenuSubContent = React2.forwardRef((props, forwardedRef) => {
|
|
1129
|
-
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
1130
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1131
|
-
return /* @__PURE__ */ jsx(
|
|
1132
|
-
SubContent,
|
|
1133
|
-
{
|
|
1134
|
-
...menuScope,
|
|
1135
|
-
...subContentProps,
|
|
1136
|
-
ref: forwardedRef,
|
|
1137
|
-
style: {
|
|
1138
|
-
...props.style,
|
|
1139
|
-
// re-namespace exposed content custom properties
|
|
1140
|
-
...{
|
|
1141
|
-
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
1142
|
-
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
1143
|
-
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
1144
|
-
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
1145
|
-
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
);
|
|
1150
|
-
});
|
|
1151
|
-
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME2;
|
|
1152
|
-
var Root22 = DropdownMenu;
|
|
1153
|
-
var Trigger = DropdownMenuTrigger;
|
|
1154
|
-
var Portal22 = DropdownMenuPortal;
|
|
1155
|
-
var Content22 = DropdownMenuContent;
|
|
1156
|
-
var Group2 = DropdownMenuGroup;
|
|
1157
|
-
var Label2 = DropdownMenuLabel;
|
|
1158
|
-
var Item22 = DropdownMenuItem;
|
|
1159
|
-
var CheckboxItem2 = DropdownMenuCheckboxItem;
|
|
1160
|
-
var RadioGroup2 = DropdownMenuRadioGroup;
|
|
1161
|
-
var RadioItem2 = DropdownMenuRadioItem;
|
|
1162
|
-
var ItemIndicator2 = DropdownMenuItemIndicator;
|
|
1163
|
-
var Separator2 = DropdownMenuSeparator;
|
|
1164
|
-
var Sub2 = DropdownMenuSub;
|
|
1165
|
-
var SubTrigger2 = DropdownMenuSubTrigger;
|
|
1166
|
-
var SubContent2 = DropdownMenuSubContent;
|
|
1167
|
-
function DropdownMenu2({ ...props }) {
|
|
1168
|
-
return /* @__PURE__ */ jsx(Root22, { "data-slot": "dropdown-menu", ...props });
|
|
1169
|
-
}
|
|
1170
|
-
function DropdownMenuPortal2({
|
|
1171
|
-
...props
|
|
1172
|
-
}) {
|
|
1173
|
-
return /* @__PURE__ */ jsx(Portal22, { "data-slot": "dropdown-menu-portal", ...props });
|
|
1174
|
-
}
|
|
1175
|
-
function DropdownMenuTrigger2({
|
|
1176
|
-
...props
|
|
1177
|
-
}) {
|
|
1178
|
-
return /* @__PURE__ */ jsx(Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
1179
|
-
}
|
|
1180
|
-
function DropdownMenuContent2({
|
|
1181
|
-
className,
|
|
1182
|
-
sideOffset = 4,
|
|
1183
|
-
...props
|
|
1184
|
-
}) {
|
|
1185
|
-
return /* @__PURE__ */ jsx(Portal22, { children: /* @__PURE__ */ jsx(
|
|
1186
|
-
Content22,
|
|
1187
|
-
{
|
|
1188
|
-
"data-slot": "dropdown-menu-content",
|
|
1189
|
-
sideOffset,
|
|
1190
|
-
className: cn(
|
|
1191
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
1192
|
-
className
|
|
1193
|
-
),
|
|
1194
|
-
...props
|
|
1195
|
-
}
|
|
1196
|
-
) });
|
|
1197
|
-
}
|
|
1198
|
-
function DropdownMenuGroup2({ ...props }) {
|
|
1199
|
-
return /* @__PURE__ */ jsx(Group2, { "data-slot": "dropdown-menu-group", ...props });
|
|
1200
|
-
}
|
|
1201
|
-
function DropdownMenuItem2({
|
|
1202
|
-
className,
|
|
1203
|
-
inset,
|
|
1204
|
-
variant = "default",
|
|
1205
|
-
...props
|
|
1206
|
-
}) {
|
|
1207
|
-
return /* @__PURE__ */ jsx(
|
|
1208
|
-
Item22,
|
|
1209
|
-
{
|
|
1210
|
-
"data-slot": "dropdown-menu-item",
|
|
1211
|
-
"data-inset": inset,
|
|
1212
|
-
"data-variant": variant,
|
|
1213
|
-
className: cn(
|
|
1214
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1215
|
-
className
|
|
1216
|
-
),
|
|
1217
|
-
...props
|
|
1218
|
-
}
|
|
1219
|
-
);
|
|
1220
|
-
}
|
|
1221
|
-
function DropdownMenuCheckboxItem2({
|
|
1222
|
-
className,
|
|
1223
|
-
children,
|
|
1224
|
-
checked,
|
|
1225
|
-
...props
|
|
1226
|
-
}) {
|
|
1227
|
-
return /* @__PURE__ */ jsxs(
|
|
1228
|
-
CheckboxItem2,
|
|
1229
|
-
{
|
|
1230
|
-
"data-slot": "dropdown-menu-checkbox-item",
|
|
1231
|
-
className: cn(
|
|
1232
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1233
|
-
className
|
|
1234
|
-
),
|
|
1235
|
-
checked,
|
|
1236
|
-
...props,
|
|
1237
|
-
children: [
|
|
1238
|
-
/* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ItemIndicator2, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
1239
|
-
children
|
|
1240
|
-
]
|
|
1241
|
-
}
|
|
1242
|
-
);
|
|
1243
|
-
}
|
|
1244
|
-
function DropdownMenuRadioGroup2({
|
|
1245
|
-
...props
|
|
1246
|
-
}) {
|
|
1247
|
-
return /* @__PURE__ */ jsx(RadioGroup2, { "data-slot": "dropdown-menu-radio-group", ...props });
|
|
1248
|
-
}
|
|
1249
|
-
function DropdownMenuRadioItem2({
|
|
1250
|
-
className,
|
|
1251
|
-
children,
|
|
1252
|
-
...props
|
|
1253
|
-
}) {
|
|
1254
|
-
return /* @__PURE__ */ jsxs(
|
|
1255
|
-
RadioItem2,
|
|
1256
|
-
{
|
|
1257
|
-
"data-slot": "dropdown-menu-radio-item",
|
|
1258
|
-
className: cn(
|
|
1259
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1260
|
-
className
|
|
1261
|
-
),
|
|
1262
|
-
...props,
|
|
1263
|
-
children: [
|
|
1264
|
-
/* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ItemIndicator2, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
|
|
1265
|
-
children
|
|
1266
|
-
]
|
|
1267
|
-
}
|
|
1268
|
-
);
|
|
1269
|
-
}
|
|
1270
|
-
function DropdownMenuLabel2({
|
|
1271
|
-
className,
|
|
1272
|
-
inset,
|
|
1273
|
-
...props
|
|
1274
|
-
}) {
|
|
1275
|
-
return /* @__PURE__ */ jsx(
|
|
1276
|
-
Label2,
|
|
1277
|
-
{
|
|
1278
|
-
"data-slot": "dropdown-menu-label",
|
|
1279
|
-
"data-inset": inset,
|
|
1280
|
-
className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
|
|
1281
|
-
...props
|
|
1282
|
-
}
|
|
1283
|
-
);
|
|
1284
|
-
}
|
|
1285
|
-
function DropdownMenuSeparator2({
|
|
1286
|
-
className,
|
|
1287
|
-
...props
|
|
1288
|
-
}) {
|
|
1289
|
-
return /* @__PURE__ */ jsx(
|
|
1290
|
-
Separator2,
|
|
1291
|
-
{
|
|
1292
|
-
"data-slot": "dropdown-menu-separator",
|
|
1293
|
-
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
1294
|
-
...props
|
|
1295
|
-
}
|
|
1296
|
-
);
|
|
1297
|
-
}
|
|
1298
|
-
function DropdownMenuShortcut({ className, ...props }) {
|
|
1299
|
-
return /* @__PURE__ */ jsx(
|
|
1300
|
-
"span",
|
|
1301
|
-
{
|
|
1302
|
-
"data-slot": "dropdown-menu-shortcut",
|
|
1303
|
-
className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
|
|
1304
|
-
...props
|
|
1305
|
-
}
|
|
1306
|
-
);
|
|
1307
|
-
}
|
|
1308
|
-
function DropdownMenuSub2({ ...props }) {
|
|
1309
|
-
return /* @__PURE__ */ jsx(Sub2, { "data-slot": "dropdown-menu-sub", ...props });
|
|
1310
|
-
}
|
|
1311
|
-
function DropdownMenuSubTrigger2({
|
|
1312
|
-
className,
|
|
1313
|
-
inset,
|
|
1314
|
-
children,
|
|
1315
|
-
...props
|
|
1316
|
-
}) {
|
|
1317
|
-
return /* @__PURE__ */ jsxs(
|
|
1318
|
-
SubTrigger2,
|
|
1319
|
-
{
|
|
1320
|
-
"data-slot": "dropdown-menu-sub-trigger",
|
|
1321
|
-
"data-inset": inset,
|
|
1322
|
-
className: cn(
|
|
1323
|
-
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1324
|
-
className
|
|
1325
|
-
),
|
|
1326
|
-
...props,
|
|
1327
|
-
children: [
|
|
1328
|
-
children,
|
|
1329
|
-
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
|
|
1330
|
-
]
|
|
1331
|
-
}
|
|
1332
|
-
);
|
|
1333
|
-
}
|
|
1334
|
-
function DropdownMenuSubContent2({
|
|
1335
|
-
className,
|
|
1336
|
-
...props
|
|
1337
|
-
}) {
|
|
1338
|
-
return /* @__PURE__ */ jsx(
|
|
1339
|
-
SubContent2,
|
|
1340
|
-
{
|
|
1341
|
-
"data-slot": "dropdown-menu-sub-content",
|
|
1342
|
-
className: cn(
|
|
1343
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
1344
|
-
className
|
|
1345
|
-
),
|
|
1346
|
-
...props
|
|
1347
|
-
}
|
|
1348
|
-
);
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
export { DropdownMenu2 as DropdownMenu, DropdownMenuCheckboxItem2 as DropdownMenuCheckboxItem, DropdownMenuContent2 as DropdownMenuContent, DropdownMenuGroup2 as DropdownMenuGroup, DropdownMenuItem2 as DropdownMenuItem, DropdownMenuLabel2 as DropdownMenuLabel, DropdownMenuPortal2 as DropdownMenuPortal, DropdownMenuRadioGroup2 as DropdownMenuRadioGroup, DropdownMenuRadioItem2 as DropdownMenuRadioItem, DropdownMenuSeparator2 as DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub2 as DropdownMenuSub, DropdownMenuSubContent2 as DropdownMenuSubContent, DropdownMenuSubTrigger2 as DropdownMenuSubTrigger, DropdownMenuTrigger2 as DropdownMenuTrigger };
|
|
1352
|
-
//# sourceMappingURL=chunk-WWBIN6KV.js.map
|
|
1353
|
-
//# sourceMappingURL=chunk-WWBIN6KV.js.map
|