@spear-ai/spectral 1.12.0 → 1.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.js +8 -8
- package/dist/{es2015-YHaMV-St.js → Combination-9q50p_Vu.js} +251 -254
- package/dist/Combobox/ComboboxBase.js +492 -3
- package/dist/Combobox-Ch5Rxk5v.js +6360 -0
- package/dist/Combobox.js +3 -137
- package/dist/DateTimePicker/Calendar.js +1 -1
- package/dist/DateTimePicker/DateTimeDisplayInput.js +1 -1
- package/dist/DateTimePicker/DateTimeInput.js +1 -1
- package/dist/DateTimePicker/DateTimeUtils.js +1 -1
- package/dist/DateTimePicker/TimePicker.js +1 -1
- package/dist/DateTimePicker.js +2 -2
- package/dist/Dialog.js +2 -2
- package/dist/Drawer.js +1 -1
- package/dist/DropdownMenu.js +241 -241
- package/dist/{HoverCard-DERasp0v.js → HoverCard-BGpW6LnA.js} +2 -2
- package/dist/HoverCard.js +1 -1
- package/dist/MultiSelect/MultiSelectBase.js +1 -1
- package/dist/Popover.js +1 -1
- package/dist/{RadioGroup-DqKggFnI.js → RadioGroup-CfjhpW5o.js} +3 -3
- package/dist/RadioGroup.js +1 -1
- package/dist/Select.js +55 -55
- package/dist/{Slider-CfUFkWU4.js → Slider-mODhqkCs.js} +3 -3
- package/dist/Slider.js +1 -1
- package/dist/{Tooltip-BR0tdif4.js → Tooltip-DH_BzFye.js} +3 -3
- package/dist/Tooltip.js +1 -1
- package/dist/Tray.js +1 -1
- package/dist/{dist-DcUGLq_y.js → dist-BMu6Dgh_.js} +1 -1
- package/dist/{dist-fW81qjVl.js → dist-C9fJjxxB.js} +41 -41
- package/dist/{dist-C0Hifjgh.js → dist-Cv8I-d2q.js} +2 -2
- package/dist/{dist-B9tup-4O.js → dist-D6QANKSj.js} +5 -5
- package/dist/{dist-3Af8168y.js → dist-Tbzy5UFA.js} +1 -1
- package/dist/{dist-B2k1iWFp.js → dist-jQ7HawWM.js} +1 -1
- package/dist/{dist-BtdmHAzK.js → dist-nYKAWiy4.js} +6 -6
- package/dist/primitives/popover.js +1 -1
- package/dist/primitives/select.js +32 -32
- package/dist/styles/spectral.css +1 -1
- package/package.json +4 -2
- package/dist/ComboboxBase-BzDGK36x.js +0 -491
- /package/dist/{Calendar-Cnh_PTbQ.js → Calendar-2UVWeLYp.js} +0 -0
- /package/dist/{DateTimeUtils-BJUAMuot.js → DateTimeUtils-DrR2JWoU.js} +0 -0
- /package/dist/{dist-Bfjk-jx9.js → dist-ChNh3U3S.js} +0 -0
- /package/dist/{dist-D8Wb_MX9.js → dist-DDjUcieO.js} +0 -0
- /package/dist/{dist-s1uWaZYZ.js → dist-DFT13f_s.js} +0 -0
- /package/dist/{dist-ClmepHp4.js → dist-DIt8FP2G.js} +0 -0
- /package/dist/{dist-BK1K0g9W.js → dist-K0_i37VL.js} +0 -0
package/dist/DropdownMenu.js
CHANGED
|
@@ -6,38 +6,38 @@ import { n as l, t as u } from "./dist-CGzgmYB9.js";
|
|
|
6
6
|
import { t as d } from "./dist-Bft31cJh.js";
|
|
7
7
|
import { t as f } from "./dist-Dtvmk11N.js";
|
|
8
8
|
import { t as p } from "./twUtils-D_qzdiwM.js";
|
|
9
|
-
import { EmptyState as m, LoadingState as
|
|
10
|
-
import { useUncontrolledState as
|
|
11
|
-
import {
|
|
12
|
-
import { t as
|
|
13
|
-
import { n as ne, t as
|
|
14
|
-
import { i as
|
|
15
|
-
import {
|
|
16
|
-
import { n as
|
|
17
|
-
import * as
|
|
18
|
-
import { jsx as
|
|
9
|
+
import { EmptyState as m, LoadingState as h, getDropdownSurfaceClasses as g, getDropdownWidthStyles as _, getOptionClasses as v } from "./utils/formFieldUtils.js";
|
|
10
|
+
import { useUncontrolledState as y } from "./hooks/useUncontrolledState.js";
|
|
11
|
+
import { t as b } from "./dist-DIt8FP2G.js";
|
|
12
|
+
import { n as ee, t as x } from "./dist-jQ7HawWM.js";
|
|
13
|
+
import { i as te, n as S, r as ne, t as re } from "./Combination-9q50p_Vu.js";
|
|
14
|
+
import { a as C, i as w, n as T, r as ie, t as E } from "./dist-Cv8I-d2q.js";
|
|
15
|
+
import { useAutoDropdownHorizontalShift as D } from "./utils/dropdownPositioning.js";
|
|
16
|
+
import { n as ae, r as O, t as k } from "./dist-BMu6Dgh_.js";
|
|
17
|
+
import * as A from "react";
|
|
18
|
+
import { jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
19
19
|
//#region node_modules/.pnpm/@radix-ui+react-menu@2.1.16_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react@_af24564827454c35f463162a4c5cfd35/node_modules/@radix-ui/react-menu/dist/index.mjs
|
|
20
|
-
var
|
|
20
|
+
var N = ["Enter", " "], P = [
|
|
21
21
|
"ArrowDown",
|
|
22
22
|
"PageUp",
|
|
23
23
|
"Home"
|
|
24
|
-
],
|
|
24
|
+
], F = [
|
|
25
25
|
"ArrowUp",
|
|
26
26
|
"PageDown",
|
|
27
27
|
"End"
|
|
28
|
-
],
|
|
29
|
-
ltr: [...
|
|
30
|
-
rtl: [...
|
|
31
|
-
},
|
|
28
|
+
], I = [...P, ...F], L = {
|
|
29
|
+
ltr: [...N, "ArrowRight"],
|
|
30
|
+
rtl: [...N, "ArrowLeft"]
|
|
31
|
+
}, R = {
|
|
32
32
|
ltr: ["ArrowLeft"],
|
|
33
33
|
rtl: ["ArrowRight"]
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
]),
|
|
39
|
-
let { __scopeMenu: t, open: n = !1, children: r, dir: i, onOpenChange: a, modal: o = !0 } = e, s =
|
|
40
|
-
return
|
|
34
|
+
}, z = "Menu", [B, oe, se] = l(z), [V, H] = r(z, [
|
|
35
|
+
se,
|
|
36
|
+
C,
|
|
37
|
+
O
|
|
38
|
+
]), U = C(), ce = O(), [le, W] = V(z), [ue, G] = V(z), de = (e) => {
|
|
39
|
+
let { __scopeMenu: t, open: n = !1, children: r, dir: i, onOpenChange: a, modal: o = !0 } = e, s = U(t), [c, l] = A.useState(null), d = A.useRef(!1), f = b(a), p = u(i);
|
|
40
|
+
return A.useEffect(() => {
|
|
41
41
|
let e = () => {
|
|
42
42
|
d.current = !0, document.addEventListener("pointerdown", t, {
|
|
43
43
|
capture: !0,
|
|
@@ -50,17 +50,17 @@ var A = ["Enter", " "], j = [
|
|
|
50
50
|
return document.addEventListener("keydown", e, { capture: !0 }), () => {
|
|
51
51
|
document.removeEventListener("keydown", e, { capture: !0 }), document.removeEventListener("pointerdown", t, { capture: !0 }), document.removeEventListener("pointermove", t, { capture: !0 });
|
|
52
52
|
};
|
|
53
|
-
}, []), /* @__PURE__ */
|
|
53
|
+
}, []), /* @__PURE__ */ j(w, {
|
|
54
54
|
...s,
|
|
55
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ j(le, {
|
|
56
56
|
scope: t,
|
|
57
57
|
open: n,
|
|
58
58
|
onOpenChange: f,
|
|
59
59
|
content: c,
|
|
60
60
|
onContentChange: l,
|
|
61
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ j(ue, {
|
|
62
62
|
scope: t,
|
|
63
|
-
onClose:
|
|
63
|
+
onClose: A.useCallback(() => f(!1), [f]),
|
|
64
64
|
isUsingKeyboardRef: d,
|
|
65
65
|
dir: p,
|
|
66
66
|
modal: o,
|
|
@@ -69,24 +69,24 @@ var A = ["Enter", " "], j = [
|
|
|
69
69
|
})
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
|
-
|
|
73
|
-
var
|
|
72
|
+
de.displayName = z;
|
|
73
|
+
var fe = "MenuAnchor", pe = A.forwardRef((e, t) => {
|
|
74
74
|
let { __scopeMenu: n, ...r } = e;
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
...
|
|
75
|
+
return /* @__PURE__ */ j(E, {
|
|
76
|
+
...U(n),
|
|
77
77
|
...r,
|
|
78
78
|
ref: t
|
|
79
79
|
});
|
|
80
80
|
});
|
|
81
|
-
|
|
82
|
-
var
|
|
83
|
-
let { __scopeMenu: t, forceMount: n, children: r, container: i } = e, a =
|
|
84
|
-
return /* @__PURE__ */
|
|
81
|
+
pe.displayName = fe;
|
|
82
|
+
var me = "MenuPortal", [he, ge] = V(me, { forceMount: void 0 }), _e = (e) => {
|
|
83
|
+
let { __scopeMenu: t, forceMount: n, children: r, container: i } = e, a = W(me, t);
|
|
84
|
+
return /* @__PURE__ */ j(he, {
|
|
85
85
|
scope: t,
|
|
86
86
|
forceMount: n,
|
|
87
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ j(d, {
|
|
88
88
|
present: n || a.open,
|
|
89
|
-
children: /* @__PURE__ */
|
|
89
|
+
children: /* @__PURE__ */ j(x, {
|
|
90
90
|
asChild: !0,
|
|
91
91
|
container: i,
|
|
92
92
|
children: r
|
|
@@ -94,31 +94,31 @@ var U = "MenuPortal", [_e, ve] = L(U, { forceMount: void 0 }), ye = (e) => {
|
|
|
94
94
|
})
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
|
-
|
|
98
|
-
var
|
|
99
|
-
let n =
|
|
100
|
-
return /* @__PURE__ */
|
|
97
|
+
_e.displayName = me;
|
|
98
|
+
var K = "MenuContent", [ve, ye] = V(K), be = A.forwardRef((e, t) => {
|
|
99
|
+
let n = ge(K, e.__scopeMenu), { forceMount: r = n.forceMount, ...i } = e, a = W(K, e.__scopeMenu), o = G(K, e.__scopeMenu);
|
|
100
|
+
return /* @__PURE__ */ j(B.Provider, {
|
|
101
101
|
scope: e.__scopeMenu,
|
|
102
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ j(d, {
|
|
103
103
|
present: r || a.open,
|
|
104
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: /* @__PURE__ */ j(B.Slot, {
|
|
105
105
|
scope: e.__scopeMenu,
|
|
106
|
-
children: o.modal ? /* @__PURE__ */
|
|
106
|
+
children: o.modal ? /* @__PURE__ */ j(xe, {
|
|
107
107
|
...i,
|
|
108
108
|
ref: t
|
|
109
|
-
}) : /* @__PURE__ */
|
|
109
|
+
}) : /* @__PURE__ */ j(Se, {
|
|
110
110
|
...i,
|
|
111
111
|
ref: t
|
|
112
112
|
})
|
|
113
113
|
})
|
|
114
114
|
})
|
|
115
115
|
});
|
|
116
|
-
}),
|
|
117
|
-
let r =
|
|
118
|
-
return
|
|
116
|
+
}), xe = A.forwardRef((e, n) => {
|
|
117
|
+
let r = W(K, e.__scopeMenu), a = A.useRef(null), o = i(n, a);
|
|
118
|
+
return A.useEffect(() => {
|
|
119
119
|
let e = a.current;
|
|
120
|
-
if (e) return
|
|
121
|
-
}, []), /* @__PURE__ */
|
|
120
|
+
if (e) return S(e);
|
|
121
|
+
}, []), /* @__PURE__ */ j(we, {
|
|
122
122
|
...e,
|
|
123
123
|
ref: o,
|
|
124
124
|
trapFocus: r.open,
|
|
@@ -127,9 +127,9 @@ var W = "MenuContent", [be, G] = L(W), xe = D.forwardRef((e, t) => {
|
|
|
127
127
|
onFocusOutside: t(e.onFocusOutside, (e) => e.preventDefault(), { checkForDefaultPrevented: !1 }),
|
|
128
128
|
onDismiss: () => r.onOpenChange(!1)
|
|
129
129
|
});
|
|
130
|
-
}),
|
|
131
|
-
let n =
|
|
132
|
-
return /* @__PURE__ */
|
|
130
|
+
}), Se = A.forwardRef((e, t) => {
|
|
131
|
+
let n = W(K, e.__scopeMenu);
|
|
132
|
+
return /* @__PURE__ */ j(we, {
|
|
133
133
|
...e,
|
|
134
134
|
ref: t,
|
|
135
135
|
trapFocus: !1,
|
|
@@ -137,91 +137,91 @@ var W = "MenuContent", [be, G] = L(W), xe = D.forwardRef((e, t) => {
|
|
|
137
137
|
disableOutsideScroll: !1,
|
|
138
138
|
onDismiss: () => n.onOpenChange(!1)
|
|
139
139
|
});
|
|
140
|
-
}),
|
|
141
|
-
let { __scopeMenu: r, loop: a = !1, trapFocus: o, onOpenAutoFocus: s, onCloseAutoFocus: c, disableOutsidePointerEvents: l, onEntryFocus: u, onEscapeKeyDown: d, onPointerDownOutside: f, onFocusOutside: p, onInteractOutside: m, onDismiss:
|
|
142
|
-
as:
|
|
140
|
+
}), Ce = o("MenuContent.ScrollLock"), we = A.forwardRef((e, n) => {
|
|
141
|
+
let { __scopeMenu: r, loop: a = !1, trapFocus: o, onOpenAutoFocus: s, onCloseAutoFocus: c, disableOutsidePointerEvents: l, onEntryFocus: u, onEscapeKeyDown: d, onPointerDownOutside: f, onFocusOutside: p, onInteractOutside: m, onDismiss: h, disableOutsideScroll: g, ..._ } = e, v = W(K, r), y = G(K, r), b = U(r), x = ce(r), S = oe(r), [C, w] = A.useState(null), T = A.useRef(null), E = i(n, T, v.onContentChange), D = A.useRef(0), O = A.useRef(""), k = A.useRef(0), M = A.useRef(null), N = A.useRef("right"), P = A.useRef(0), L = g ? re : A.Fragment, R = g ? {
|
|
142
|
+
as: Ce,
|
|
143
143
|
allowPinchZoom: !0
|
|
144
|
-
} : void 0,
|
|
145
|
-
let t =
|
|
144
|
+
} : void 0, z = (e) => {
|
|
145
|
+
let t = O.current + e, n = S().filter((e) => !e.disabled), r = document.activeElement, i = n.find((e) => e.ref.current === r)?.textValue, a = it(n.map((e) => e.textValue), t, i), o = n.find((e) => e.textValue === a)?.ref.current;
|
|
146
146
|
(function e(t) {
|
|
147
|
-
|
|
147
|
+
O.current = t, window.clearTimeout(D.current), t !== "" && (D.current = window.setTimeout(() => e(""), 1e3));
|
|
148
148
|
})(t), o && setTimeout(() => o.focus());
|
|
149
149
|
};
|
|
150
|
-
|
|
151
|
-
let
|
|
152
|
-
return /* @__PURE__ */
|
|
150
|
+
A.useEffect(() => () => window.clearTimeout(D.current), []), te();
|
|
151
|
+
let B = A.useCallback((e) => N.current === M.current?.side && ot(e, M.current?.area), []);
|
|
152
|
+
return /* @__PURE__ */ j(ve, {
|
|
153
153
|
scope: r,
|
|
154
|
-
searchRef:
|
|
155
|
-
onItemEnter:
|
|
156
|
-
|
|
157
|
-
}, [
|
|
158
|
-
onItemLeave:
|
|
159
|
-
|
|
160
|
-
}, [
|
|
161
|
-
onTriggerLeave:
|
|
162
|
-
|
|
163
|
-
}, [
|
|
164
|
-
pointerGraceTimerRef:
|
|
165
|
-
onPointerGraceIntentChange:
|
|
166
|
-
|
|
154
|
+
searchRef: O,
|
|
155
|
+
onItemEnter: A.useCallback((e) => {
|
|
156
|
+
B(e) && e.preventDefault();
|
|
157
|
+
}, [B]),
|
|
158
|
+
onItemLeave: A.useCallback((e) => {
|
|
159
|
+
B(e) || (T.current?.focus(), w(null));
|
|
160
|
+
}, [B]),
|
|
161
|
+
onTriggerLeave: A.useCallback((e) => {
|
|
162
|
+
B(e) && e.preventDefault();
|
|
163
|
+
}, [B]),
|
|
164
|
+
pointerGraceTimerRef: k,
|
|
165
|
+
onPointerGraceIntentChange: A.useCallback((e) => {
|
|
166
|
+
M.current = e;
|
|
167
167
|
}, []),
|
|
168
|
-
children: /* @__PURE__ */
|
|
169
|
-
...
|
|
170
|
-
children: /* @__PURE__ */
|
|
168
|
+
children: /* @__PURE__ */ j(L, {
|
|
169
|
+
...R,
|
|
170
|
+
children: /* @__PURE__ */ j(ne, {
|
|
171
171
|
asChild: !0,
|
|
172
172
|
trapped: o,
|
|
173
173
|
onMountAutoFocus: t(s, (e) => {
|
|
174
|
-
e.preventDefault(),
|
|
174
|
+
e.preventDefault(), T.current?.focus({ preventScroll: !0 });
|
|
175
175
|
}),
|
|
176
176
|
onUnmountAutoFocus: c,
|
|
177
|
-
children: /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ j(ee, {
|
|
178
178
|
asChild: !0,
|
|
179
179
|
disableOutsidePointerEvents: l,
|
|
180
180
|
onEscapeKeyDown: d,
|
|
181
181
|
onPointerDownOutside: f,
|
|
182
182
|
onFocusOutside: p,
|
|
183
183
|
onInteractOutside: m,
|
|
184
|
-
onDismiss:
|
|
185
|
-
children: /* @__PURE__ */
|
|
184
|
+
onDismiss: h,
|
|
185
|
+
children: /* @__PURE__ */ j(ae, {
|
|
186
186
|
asChild: !0,
|
|
187
|
-
...
|
|
188
|
-
dir:
|
|
187
|
+
...x,
|
|
188
|
+
dir: y.dir,
|
|
189
189
|
orientation: "vertical",
|
|
190
190
|
loop: a,
|
|
191
|
-
currentTabStopId:
|
|
192
|
-
onCurrentTabStopIdChange:
|
|
191
|
+
currentTabStopId: C,
|
|
192
|
+
onCurrentTabStopIdChange: w,
|
|
193
193
|
onEntryFocus: t(u, (e) => {
|
|
194
|
-
|
|
194
|
+
y.isUsingKeyboardRef.current || e.preventDefault();
|
|
195
195
|
}),
|
|
196
196
|
preventScrollOnEntryFocus: !0,
|
|
197
|
-
children: /* @__PURE__ */
|
|
197
|
+
children: /* @__PURE__ */ j(ie, {
|
|
198
198
|
role: "menu",
|
|
199
199
|
"aria-orientation": "vertical",
|
|
200
|
-
"data-state": et(
|
|
200
|
+
"data-state": et(v.open),
|
|
201
201
|
"data-radix-menu-content": "",
|
|
202
|
-
dir:
|
|
203
|
-
...
|
|
204
|
-
...
|
|
205
|
-
ref:
|
|
202
|
+
dir: y.dir,
|
|
203
|
+
...b,
|
|
204
|
+
..._,
|
|
205
|
+
ref: E,
|
|
206
206
|
style: {
|
|
207
207
|
outline: "none",
|
|
208
|
-
...
|
|
208
|
+
..._.style
|
|
209
209
|
},
|
|
210
|
-
onKeyDown: t(
|
|
210
|
+
onKeyDown: t(_.onKeyDown, (e) => {
|
|
211
211
|
let t = e.target.closest("[data-radix-menu-content]") === e.currentTarget, n = e.ctrlKey || e.altKey || e.metaKey, r = e.key.length === 1;
|
|
212
|
-
t && (e.key === "Tab" && e.preventDefault(), !n && r &&
|
|
213
|
-
let i =
|
|
214
|
-
if (e.target !== i || !
|
|
212
|
+
t && (e.key === "Tab" && e.preventDefault(), !n && r && z(e.key));
|
|
213
|
+
let i = T.current;
|
|
214
|
+
if (e.target !== i || !I.includes(e.key)) return;
|
|
215
215
|
e.preventDefault();
|
|
216
|
-
let a =
|
|
217
|
-
|
|
216
|
+
let a = S().filter((e) => !e.disabled).map((e) => e.ref.current);
|
|
217
|
+
F.includes(e.key) && a.reverse(), nt(a);
|
|
218
218
|
}),
|
|
219
219
|
onBlur: t(e.onBlur, (e) => {
|
|
220
|
-
e.currentTarget.contains(e.target) || (window.clearTimeout(
|
|
220
|
+
e.currentTarget.contains(e.target) || (window.clearTimeout(D.current), O.current = "");
|
|
221
221
|
}),
|
|
222
222
|
onPointerMove: t(e.onPointerMove, Z((e) => {
|
|
223
|
-
let t = e.target, n =
|
|
224
|
-
e.currentTarget.contains(t) && n && (
|
|
223
|
+
let t = e.target, n = P.current !== e.clientX;
|
|
224
|
+
e.currentTarget.contains(t) && n && (N.current = e.clientX > P.current ? "right" : "left", P.current = e.clientX);
|
|
225
225
|
}))
|
|
226
226
|
})
|
|
227
227
|
})
|
|
@@ -230,26 +230,26 @@ var W = "MenuContent", [be, G] = L(W), xe = D.forwardRef((e, t) => {
|
|
|
230
230
|
})
|
|
231
231
|
});
|
|
232
232
|
});
|
|
233
|
-
|
|
234
|
-
var Te = "MenuGroup", Ee =
|
|
233
|
+
be.displayName = K;
|
|
234
|
+
var Te = "MenuGroup", Ee = A.forwardRef((e, t) => {
|
|
235
235
|
let { __scopeMenu: n, ...r } = e;
|
|
236
|
-
return /* @__PURE__ */
|
|
236
|
+
return /* @__PURE__ */ j(c.div, {
|
|
237
237
|
role: "group",
|
|
238
238
|
...r,
|
|
239
239
|
ref: t
|
|
240
240
|
});
|
|
241
241
|
});
|
|
242
242
|
Ee.displayName = Te;
|
|
243
|
-
var De = "MenuLabel", Oe =
|
|
243
|
+
var De = "MenuLabel", Oe = A.forwardRef((e, t) => {
|
|
244
244
|
let { __scopeMenu: n, ...r } = e;
|
|
245
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ j(c.div, {
|
|
246
246
|
...r,
|
|
247
247
|
ref: t
|
|
248
248
|
});
|
|
249
249
|
});
|
|
250
250
|
Oe.displayName = De;
|
|
251
|
-
var q = "MenuItem", ke = "menu.itemSelect", J =
|
|
252
|
-
let { disabled: r = !1, onSelect: o, ...s } = e, c =
|
|
251
|
+
var q = "MenuItem", ke = "menu.itemSelect", J = A.forwardRef((e, n) => {
|
|
252
|
+
let { disabled: r = !1, onSelect: o, ...s } = e, c = A.useRef(null), l = G(q, e.__scopeMenu), u = ye(q, e.__scopeMenu), d = i(n, c), f = A.useRef(!1), p = () => {
|
|
253
253
|
let e = c.current;
|
|
254
254
|
if (!r && e) {
|
|
255
255
|
let t = new CustomEvent(ke, {
|
|
@@ -259,7 +259,7 @@ var q = "MenuItem", ke = "menu.itemSelect", J = D.forwardRef((e, n) => {
|
|
|
259
259
|
e.addEventListener(ke, (e) => o?.(e), { once: !0 }), a(e, t), t.defaultPrevented ? f.current = !1 : l.onClose();
|
|
260
260
|
}
|
|
261
261
|
};
|
|
262
|
-
return /* @__PURE__ */
|
|
262
|
+
return /* @__PURE__ */ j(Ae, {
|
|
263
263
|
...s,
|
|
264
264
|
ref: d,
|
|
265
265
|
disabled: r,
|
|
@@ -272,25 +272,25 @@ var q = "MenuItem", ke = "menu.itemSelect", J = D.forwardRef((e, n) => {
|
|
|
272
272
|
}),
|
|
273
273
|
onKeyDown: t(e.onKeyDown, (e) => {
|
|
274
274
|
let t = u.searchRef.current !== "";
|
|
275
|
-
r || t && e.key === " " ||
|
|
275
|
+
r || t && e.key === " " || N.includes(e.key) && (e.currentTarget.click(), e.preventDefault());
|
|
276
276
|
})
|
|
277
277
|
});
|
|
278
278
|
});
|
|
279
279
|
J.displayName = q;
|
|
280
|
-
var Ae =
|
|
281
|
-
let { __scopeMenu: r, disabled: a = !1, textValue: o, ...s } = e, l =
|
|
282
|
-
return
|
|
280
|
+
var Ae = A.forwardRef((e, n) => {
|
|
281
|
+
let { __scopeMenu: r, disabled: a = !1, textValue: o, ...s } = e, l = ye(q, r), u = ce(r), d = A.useRef(null), f = i(n, d), [p, m] = A.useState(!1), [h, g] = A.useState("");
|
|
282
|
+
return A.useEffect(() => {
|
|
283
283
|
let e = d.current;
|
|
284
|
-
e &&
|
|
285
|
-
}, [s.children]), /* @__PURE__ */
|
|
284
|
+
e && g((e.textContent ?? "").trim());
|
|
285
|
+
}, [s.children]), /* @__PURE__ */ j(B.ItemSlot, {
|
|
286
286
|
scope: r,
|
|
287
287
|
disabled: a,
|
|
288
|
-
textValue: o ??
|
|
289
|
-
children: /* @__PURE__ */
|
|
288
|
+
textValue: o ?? h,
|
|
289
|
+
children: /* @__PURE__ */ j(k, {
|
|
290
290
|
asChild: !0,
|
|
291
291
|
...u,
|
|
292
292
|
focusable: !a,
|
|
293
|
-
children: /* @__PURE__ */
|
|
293
|
+
children: /* @__PURE__ */ j(c.div, {
|
|
294
294
|
role: "menuitem",
|
|
295
295
|
"data-highlighted": p ? "" : void 0,
|
|
296
296
|
"aria-disabled": a || void 0,
|
|
@@ -306,12 +306,12 @@ var Ae = D.forwardRef((e, n) => {
|
|
|
306
306
|
})
|
|
307
307
|
})
|
|
308
308
|
});
|
|
309
|
-
}), je = "MenuCheckboxItem", Me =
|
|
309
|
+
}), je = "MenuCheckboxItem", Me = A.forwardRef((e, n) => {
|
|
310
310
|
let { checked: r = !1, onCheckedChange: i, ...a } = e;
|
|
311
|
-
return /* @__PURE__ */
|
|
311
|
+
return /* @__PURE__ */ j(Be, {
|
|
312
312
|
scope: e.__scopeMenu,
|
|
313
313
|
checked: r,
|
|
314
|
-
children: /* @__PURE__ */
|
|
314
|
+
children: /* @__PURE__ */ j(J, {
|
|
315
315
|
role: "menuitemcheckbox",
|
|
316
316
|
"aria-checked": X(r) ? "mixed" : r,
|
|
317
317
|
...a,
|
|
@@ -322,28 +322,28 @@ var Ae = D.forwardRef((e, n) => {
|
|
|
322
322
|
});
|
|
323
323
|
});
|
|
324
324
|
Me.displayName = je;
|
|
325
|
-
var Ne = "MenuRadioGroup", [Pe, Fe] =
|
|
325
|
+
var Ne = "MenuRadioGroup", [Pe, Fe] = V(Ne, {
|
|
326
326
|
value: void 0,
|
|
327
327
|
onValueChange: () => {}
|
|
328
|
-
}), Ie =
|
|
329
|
-
let { value: n, onValueChange: r, ...i } = e, a =
|
|
330
|
-
return /* @__PURE__ */
|
|
328
|
+
}), Ie = A.forwardRef((e, t) => {
|
|
329
|
+
let { value: n, onValueChange: r, ...i } = e, a = b(r);
|
|
330
|
+
return /* @__PURE__ */ j(Pe, {
|
|
331
331
|
scope: e.__scopeMenu,
|
|
332
332
|
value: n,
|
|
333
333
|
onValueChange: a,
|
|
334
|
-
children: /* @__PURE__ */
|
|
334
|
+
children: /* @__PURE__ */ j(Ee, {
|
|
335
335
|
...i,
|
|
336
336
|
ref: t
|
|
337
337
|
})
|
|
338
338
|
});
|
|
339
339
|
});
|
|
340
340
|
Ie.displayName = Ne;
|
|
341
|
-
var Le = "MenuRadioItem", Re =
|
|
341
|
+
var Le = "MenuRadioItem", Re = A.forwardRef((e, n) => {
|
|
342
342
|
let { value: r, ...i } = e, a = Fe(Le, e.__scopeMenu), o = r === a.value;
|
|
343
|
-
return /* @__PURE__ */
|
|
343
|
+
return /* @__PURE__ */ j(Be, {
|
|
344
344
|
scope: e.__scopeMenu,
|
|
345
345
|
checked: o,
|
|
346
|
-
children: /* @__PURE__ */
|
|
346
|
+
children: /* @__PURE__ */ j(J, {
|
|
347
347
|
role: "menuitemradio",
|
|
348
348
|
"aria-checked": o,
|
|
349
349
|
...i,
|
|
@@ -354,11 +354,11 @@ var Le = "MenuRadioItem", Re = D.forwardRef((e, n) => {
|
|
|
354
354
|
});
|
|
355
355
|
});
|
|
356
356
|
Re.displayName = Le;
|
|
357
|
-
var ze = "MenuItemIndicator", [Be, Ve] =
|
|
357
|
+
var ze = "MenuItemIndicator", [Be, Ve] = V(ze, { checked: !1 }), He = A.forwardRef((e, t) => {
|
|
358
358
|
let { __scopeMenu: n, forceMount: r, ...i } = e, a = Ve(ze, n);
|
|
359
|
-
return /* @__PURE__ */
|
|
359
|
+
return /* @__PURE__ */ j(d, {
|
|
360
360
|
present: r || X(a.checked) || a.checked === !0,
|
|
361
|
-
children: /* @__PURE__ */
|
|
361
|
+
children: /* @__PURE__ */ j(c.span, {
|
|
362
362
|
...i,
|
|
363
363
|
ref: t,
|
|
364
364
|
"data-state": tt(a.checked)
|
|
@@ -366,9 +366,9 @@ var ze = "MenuItemIndicator", [Be, Ve] = L(ze, { checked: !1 }), He = D.forwardR
|
|
|
366
366
|
});
|
|
367
367
|
});
|
|
368
368
|
He.displayName = ze;
|
|
369
|
-
var Ue = "MenuSeparator", We =
|
|
369
|
+
var Ue = "MenuSeparator", We = A.forwardRef((e, t) => {
|
|
370
370
|
let { __scopeMenu: n, ...r } = e;
|
|
371
|
-
return /* @__PURE__ */
|
|
371
|
+
return /* @__PURE__ */ j(c.div, {
|
|
372
372
|
role: "separator",
|
|
373
373
|
"aria-orientation": "horizontal",
|
|
374
374
|
...r,
|
|
@@ -376,26 +376,26 @@ var Ue = "MenuSeparator", We = D.forwardRef((e, t) => {
|
|
|
376
376
|
});
|
|
377
377
|
});
|
|
378
378
|
We.displayName = Ue;
|
|
379
|
-
var Ge = "MenuArrow", Ke =
|
|
379
|
+
var Ge = "MenuArrow", Ke = A.forwardRef((e, t) => {
|
|
380
380
|
let { __scopeMenu: n, ...r } = e;
|
|
381
|
-
return /* @__PURE__ */
|
|
382
|
-
...
|
|
381
|
+
return /* @__PURE__ */ j(T, {
|
|
382
|
+
...U(n),
|
|
383
383
|
...r,
|
|
384
384
|
ref: t
|
|
385
385
|
});
|
|
386
386
|
});
|
|
387
387
|
Ke.displayName = Ge;
|
|
388
|
-
var qe = "MenuSub", [Je, Ye] =
|
|
389
|
-
let { __scopeMenu: t, children: n, open: r = !1, onOpenChange: i } = e, a =
|
|
390
|
-
return
|
|
388
|
+
var qe = "MenuSub", [Je, Ye] = V(qe), Xe = (e) => {
|
|
389
|
+
let { __scopeMenu: t, children: n, open: r = !1, onOpenChange: i } = e, a = W(qe, t), o = U(t), [s, c] = A.useState(null), [l, u] = A.useState(null), d = b(i);
|
|
390
|
+
return A.useEffect(() => (a.open === !1 && d(!1), () => d(!1)), [a.open, d]), /* @__PURE__ */ j(w, {
|
|
391
391
|
...o,
|
|
392
|
-
children: /* @__PURE__ */
|
|
392
|
+
children: /* @__PURE__ */ j(le, {
|
|
393
393
|
scope: t,
|
|
394
394
|
open: r,
|
|
395
395
|
onOpenChange: d,
|
|
396
396
|
content: l,
|
|
397
397
|
onContentChange: u,
|
|
398
|
-
children: /* @__PURE__ */
|
|
398
|
+
children: /* @__PURE__ */ j(Je, {
|
|
399
399
|
scope: t,
|
|
400
400
|
contentId: f(),
|
|
401
401
|
triggerId: f(),
|
|
@@ -407,19 +407,19 @@ var qe = "MenuSub", [Je, Ye] = L(qe), Xe = (e) => {
|
|
|
407
407
|
});
|
|
408
408
|
};
|
|
409
409
|
Xe.displayName = qe;
|
|
410
|
-
var Y = "MenuSubTrigger", Ze =
|
|
411
|
-
let i =
|
|
410
|
+
var Y = "MenuSubTrigger", Ze = A.forwardRef((e, r) => {
|
|
411
|
+
let i = W(Y, e.__scopeMenu), a = G(Y, e.__scopeMenu), o = Ye(Y, e.__scopeMenu), s = ye(Y, e.__scopeMenu), c = A.useRef(null), { pointerGraceTimerRef: l, onPointerGraceIntentChange: u } = s, d = { __scopeMenu: e.__scopeMenu }, f = A.useCallback(() => {
|
|
412
412
|
c.current && window.clearTimeout(c.current), c.current = null;
|
|
413
413
|
}, []);
|
|
414
|
-
return
|
|
414
|
+
return A.useEffect(() => f, [f]), A.useEffect(() => {
|
|
415
415
|
let e = l.current;
|
|
416
416
|
return () => {
|
|
417
417
|
window.clearTimeout(e), u(null);
|
|
418
418
|
};
|
|
419
|
-
}, [l, u]), /* @__PURE__ */
|
|
419
|
+
}, [l, u]), /* @__PURE__ */ j(pe, {
|
|
420
420
|
asChild: !0,
|
|
421
421
|
...d,
|
|
422
|
-
children: /* @__PURE__ */
|
|
422
|
+
children: /* @__PURE__ */ j(Ae, {
|
|
423
423
|
id: o.triggerId,
|
|
424
424
|
"aria-haspopup": "menu",
|
|
425
425
|
"aria-expanded": i.open,
|
|
@@ -472,21 +472,21 @@ var Y = "MenuSubTrigger", Ze = D.forwardRef((e, r) => {
|
|
|
472
472
|
})),
|
|
473
473
|
onKeyDown: t(e.onKeyDown, (t) => {
|
|
474
474
|
let n = s.searchRef.current !== "";
|
|
475
|
-
e.disabled || n && t.key === " " ||
|
|
475
|
+
e.disabled || n && t.key === " " || L[a.dir].includes(t.key) && (i.onOpenChange(!0), i.content?.focus(), t.preventDefault());
|
|
476
476
|
})
|
|
477
477
|
})
|
|
478
478
|
});
|
|
479
479
|
});
|
|
480
480
|
Ze.displayName = Y;
|
|
481
|
-
var Qe = "MenuSubContent", $e =
|
|
482
|
-
let r =
|
|
483
|
-
return /* @__PURE__ */
|
|
481
|
+
var Qe = "MenuSubContent", $e = A.forwardRef((e, n) => {
|
|
482
|
+
let r = ge(K, e.__scopeMenu), { forceMount: a = r.forceMount, ...o } = e, s = W(K, e.__scopeMenu), c = G(K, e.__scopeMenu), l = Ye(Qe, e.__scopeMenu), u = A.useRef(null), f = i(n, u);
|
|
483
|
+
return /* @__PURE__ */ j(B.Provider, {
|
|
484
484
|
scope: e.__scopeMenu,
|
|
485
|
-
children: /* @__PURE__ */
|
|
485
|
+
children: /* @__PURE__ */ j(d, {
|
|
486
486
|
present: a || s.open,
|
|
487
|
-
children: /* @__PURE__ */
|
|
487
|
+
children: /* @__PURE__ */ j(B.Slot, {
|
|
488
488
|
scope: e.__scopeMenu,
|
|
489
|
-
children: /* @__PURE__ */
|
|
489
|
+
children: /* @__PURE__ */ j(we, {
|
|
490
490
|
id: l.contentId,
|
|
491
491
|
"aria-labelledby": l.triggerId,
|
|
492
492
|
...o,
|
|
@@ -507,7 +507,7 @@ var Qe = "MenuSubContent", $e = D.forwardRef((e, n) => {
|
|
|
507
507
|
c.onClose(), e.preventDefault();
|
|
508
508
|
}),
|
|
509
509
|
onKeyDown: t(e.onKeyDown, (e) => {
|
|
510
|
-
let t = e.currentTarget.contains(e.target), n =
|
|
510
|
+
let t = e.currentTarget.contains(e.target), n = R[c.dir].includes(e.key);
|
|
511
511
|
t && n && (s.onOpenChange(!1), l.trigger?.focus(), e.preventDefault());
|
|
512
512
|
})
|
|
513
513
|
})
|
|
@@ -555,23 +555,23 @@ function ot(e, t) {
|
|
|
555
555
|
function Z(e) {
|
|
556
556
|
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
557
557
|
}
|
|
558
|
-
var st =
|
|
559
|
-
let { __scopeDropdownMenu: t, children: n, dir: r, open: i, defaultOpen: a, onOpenChange: o, modal: c = !0 } = e, l = $(t), u =
|
|
558
|
+
var st = de, ct = pe, lt = _e, ut = be, dt = Ee, ft = Oe, pt = J, mt = Me, ht = Ie, gt = Re, _t = He, vt = We, yt = Ke, bt = Ze, xt = $e, Q = "DropdownMenu", [St, Ct] = r(Q, [H]), $ = H(), [wt, Tt] = St(Q), Et = (e) => {
|
|
559
|
+
let { __scopeDropdownMenu: t, children: n, dir: r, open: i, defaultOpen: a, onOpenChange: o, modal: c = !0 } = e, l = $(t), u = A.useRef(null), [d, p] = s({
|
|
560
560
|
prop: i,
|
|
561
561
|
defaultProp: a ?? !1,
|
|
562
562
|
onChange: o,
|
|
563
563
|
caller: Q
|
|
564
564
|
});
|
|
565
|
-
return /* @__PURE__ */
|
|
565
|
+
return /* @__PURE__ */ j(wt, {
|
|
566
566
|
scope: t,
|
|
567
567
|
triggerId: f(),
|
|
568
568
|
triggerRef: u,
|
|
569
569
|
contentId: f(),
|
|
570
570
|
open: d,
|
|
571
571
|
onOpenChange: p,
|
|
572
|
-
onOpenToggle:
|
|
572
|
+
onOpenToggle: A.useCallback(() => p((e) => !e), [p]),
|
|
573
573
|
modal: c,
|
|
574
|
-
children: /* @__PURE__ */
|
|
574
|
+
children: /* @__PURE__ */ j(st, {
|
|
575
575
|
...l,
|
|
576
576
|
open: d,
|
|
577
577
|
onOpenChange: p,
|
|
@@ -582,12 +582,12 @@ var st = he, ct = H, lt = ye, ut = xe, dt = Ee, ft = Oe, pt = J, mt = Me, ht = I
|
|
|
582
582
|
});
|
|
583
583
|
};
|
|
584
584
|
Et.displayName = Q;
|
|
585
|
-
var Dt = "DropdownMenuTrigger", Ot =
|
|
585
|
+
var Dt = "DropdownMenuTrigger", Ot = A.forwardRef((e, r) => {
|
|
586
586
|
let { __scopeDropdownMenu: i, disabled: a = !1, ...o } = e, s = Tt(Dt, i);
|
|
587
|
-
return /* @__PURE__ */
|
|
587
|
+
return /* @__PURE__ */ j(ct, {
|
|
588
588
|
asChild: !0,
|
|
589
589
|
...$(i),
|
|
590
|
-
children: /* @__PURE__ */
|
|
590
|
+
children: /* @__PURE__ */ j(c.button, {
|
|
591
591
|
type: "button",
|
|
592
592
|
id: s.triggerId,
|
|
593
593
|
"aria-haspopup": "menu",
|
|
@@ -614,15 +614,15 @@ var Dt = "DropdownMenuTrigger", Ot = D.forwardRef((e, r) => {
|
|
|
614
614
|
Ot.displayName = Dt;
|
|
615
615
|
var kt = "DropdownMenuPortal", At = (e) => {
|
|
616
616
|
let { __scopeDropdownMenu: t, ...n } = e;
|
|
617
|
-
return /* @__PURE__ */
|
|
617
|
+
return /* @__PURE__ */ j(lt, {
|
|
618
618
|
...$(t),
|
|
619
619
|
...n
|
|
620
620
|
});
|
|
621
621
|
};
|
|
622
622
|
At.displayName = kt;
|
|
623
|
-
var jt = "DropdownMenuContent", Mt =
|
|
624
|
-
let { __scopeDropdownMenu: r, ...i } = e, a = Tt(jt, r), o = $(r), s =
|
|
625
|
-
return /* @__PURE__ */
|
|
623
|
+
var jt = "DropdownMenuContent", Mt = A.forwardRef((e, n) => {
|
|
624
|
+
let { __scopeDropdownMenu: r, ...i } = e, a = Tt(jt, r), o = $(r), s = A.useRef(!1);
|
|
625
|
+
return /* @__PURE__ */ j(ut, {
|
|
626
626
|
id: a.contentId,
|
|
627
627
|
"aria-labelledby": a.triggerId,
|
|
628
628
|
...o,
|
|
@@ -646,99 +646,99 @@ var jt = "DropdownMenuContent", Mt = D.forwardRef((e, n) => {
|
|
|
646
646
|
});
|
|
647
647
|
});
|
|
648
648
|
Mt.displayName = jt;
|
|
649
|
-
var Nt = "DropdownMenuGroup", Pt =
|
|
649
|
+
var Nt = "DropdownMenuGroup", Pt = A.forwardRef((e, t) => {
|
|
650
650
|
let { __scopeDropdownMenu: n, ...r } = e;
|
|
651
|
-
return /* @__PURE__ */
|
|
651
|
+
return /* @__PURE__ */ j(dt, {
|
|
652
652
|
...$(n),
|
|
653
653
|
...r,
|
|
654
654
|
ref: t
|
|
655
655
|
});
|
|
656
656
|
});
|
|
657
657
|
Pt.displayName = Nt;
|
|
658
|
-
var Ft = "DropdownMenuLabel", It =
|
|
658
|
+
var Ft = "DropdownMenuLabel", It = A.forwardRef((e, t) => {
|
|
659
659
|
let { __scopeDropdownMenu: n, ...r } = e;
|
|
660
|
-
return /* @__PURE__ */
|
|
660
|
+
return /* @__PURE__ */ j(ft, {
|
|
661
661
|
...$(n),
|
|
662
662
|
...r,
|
|
663
663
|
ref: t
|
|
664
664
|
});
|
|
665
665
|
});
|
|
666
666
|
It.displayName = Ft;
|
|
667
|
-
var Lt = "DropdownMenuItem", Rt =
|
|
667
|
+
var Lt = "DropdownMenuItem", Rt = A.forwardRef((e, t) => {
|
|
668
668
|
let { __scopeDropdownMenu: n, ...r } = e;
|
|
669
|
-
return /* @__PURE__ */
|
|
669
|
+
return /* @__PURE__ */ j(pt, {
|
|
670
670
|
...$(n),
|
|
671
671
|
...r,
|
|
672
672
|
ref: t
|
|
673
673
|
});
|
|
674
674
|
});
|
|
675
675
|
Rt.displayName = Lt;
|
|
676
|
-
var zt = "DropdownMenuCheckboxItem", Bt =
|
|
676
|
+
var zt = "DropdownMenuCheckboxItem", Bt = A.forwardRef((e, t) => {
|
|
677
677
|
let { __scopeDropdownMenu: n, ...r } = e;
|
|
678
|
-
return /* @__PURE__ */
|
|
678
|
+
return /* @__PURE__ */ j(mt, {
|
|
679
679
|
...$(n),
|
|
680
680
|
...r,
|
|
681
681
|
ref: t
|
|
682
682
|
});
|
|
683
683
|
});
|
|
684
684
|
Bt.displayName = zt;
|
|
685
|
-
var Vt = "DropdownMenuRadioGroup", Ht =
|
|
685
|
+
var Vt = "DropdownMenuRadioGroup", Ht = A.forwardRef((e, t) => {
|
|
686
686
|
let { __scopeDropdownMenu: n, ...r } = e;
|
|
687
|
-
return /* @__PURE__ */
|
|
687
|
+
return /* @__PURE__ */ j(ht, {
|
|
688
688
|
...$(n),
|
|
689
689
|
...r,
|
|
690
690
|
ref: t
|
|
691
691
|
});
|
|
692
692
|
});
|
|
693
693
|
Ht.displayName = Vt;
|
|
694
|
-
var Ut = "DropdownMenuRadioItem", Wt =
|
|
694
|
+
var Ut = "DropdownMenuRadioItem", Wt = A.forwardRef((e, t) => {
|
|
695
695
|
let { __scopeDropdownMenu: n, ...r } = e;
|
|
696
|
-
return /* @__PURE__ */
|
|
696
|
+
return /* @__PURE__ */ j(gt, {
|
|
697
697
|
...$(n),
|
|
698
698
|
...r,
|
|
699
699
|
ref: t
|
|
700
700
|
});
|
|
701
701
|
});
|
|
702
702
|
Wt.displayName = Ut;
|
|
703
|
-
var Gt = "DropdownMenuItemIndicator", Kt =
|
|
703
|
+
var Gt = "DropdownMenuItemIndicator", Kt = A.forwardRef((e, t) => {
|
|
704
704
|
let { __scopeDropdownMenu: n, ...r } = e;
|
|
705
|
-
return /* @__PURE__ */
|
|
705
|
+
return /* @__PURE__ */ j(_t, {
|
|
706
706
|
...$(n),
|
|
707
707
|
...r,
|
|
708
708
|
ref: t
|
|
709
709
|
});
|
|
710
710
|
});
|
|
711
711
|
Kt.displayName = Gt;
|
|
712
|
-
var qt = "DropdownMenuSeparator", Jt =
|
|
712
|
+
var qt = "DropdownMenuSeparator", Jt = A.forwardRef((e, t) => {
|
|
713
713
|
let { __scopeDropdownMenu: n, ...r } = e;
|
|
714
|
-
return /* @__PURE__ */
|
|
714
|
+
return /* @__PURE__ */ j(vt, {
|
|
715
715
|
...$(n),
|
|
716
716
|
...r,
|
|
717
717
|
ref: t
|
|
718
718
|
});
|
|
719
719
|
});
|
|
720
720
|
Jt.displayName = qt;
|
|
721
|
-
var Yt = "DropdownMenuArrow", Xt =
|
|
721
|
+
var Yt = "DropdownMenuArrow", Xt = A.forwardRef((e, t) => {
|
|
722
722
|
let { __scopeDropdownMenu: n, ...r } = e;
|
|
723
|
-
return /* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ j(yt, {
|
|
724
724
|
...$(n),
|
|
725
725
|
...r,
|
|
726
726
|
ref: t
|
|
727
727
|
});
|
|
728
728
|
});
|
|
729
729
|
Xt.displayName = Yt;
|
|
730
|
-
var Zt = "DropdownMenuSubTrigger", Qt =
|
|
730
|
+
var Zt = "DropdownMenuSubTrigger", Qt = A.forwardRef((e, t) => {
|
|
731
731
|
let { __scopeDropdownMenu: n, ...r } = e;
|
|
732
|
-
return /* @__PURE__ */
|
|
732
|
+
return /* @__PURE__ */ j(bt, {
|
|
733
733
|
...$(n),
|
|
734
734
|
...r,
|
|
735
735
|
ref: t
|
|
736
736
|
});
|
|
737
737
|
});
|
|
738
738
|
Qt.displayName = Zt;
|
|
739
|
-
var $t = "DropdownMenuSubContent", en =
|
|
739
|
+
var $t = "DropdownMenuSubContent", en = A.forwardRef((e, t) => {
|
|
740
740
|
let { __scopeDropdownMenu: n, ...r } = e;
|
|
741
|
-
return /* @__PURE__ */
|
|
741
|
+
return /* @__PURE__ */ j(xt, {
|
|
742
742
|
...$(n),
|
|
743
743
|
...r,
|
|
744
744
|
ref: t,
|
|
@@ -753,114 +753,114 @@ var $t = "DropdownMenuSubContent", en = D.forwardRef((e, t) => {
|
|
|
753
753
|
});
|
|
754
754
|
});
|
|
755
755
|
en.displayName = $t;
|
|
756
|
-
var tn = Et, nn = Ot, rn = At, an = Mt, on = It, sn = Rt, cn = Bt, ln = Kt, un = Jt, dn = (e, t) => t === "multiple" ? Array.isArray(e) ? e : e ? [e] : [] : Array.isArray(e) ? e[0] ?? "" : e ?? "", fn = (e) => e.type !== "separator" && e.type !== "label", pn = ({ align: t = "start", asChild: n = !0, alignOffset: r = 0, avoidCollisions: i = !0, className: a, collisionBoundary: o, collisionPadding: s = 10, contentClassName: c, dataTestId: l, defaultOpen: u, defaultValue: d, disabled: f = !1, dropdownWidth:
|
|
757
|
-
let [
|
|
758
|
-
value:
|
|
756
|
+
var tn = Et, nn = Ot, rn = At, an = Mt, on = It, sn = Rt, cn = Bt, ln = Kt, un = Jt, dn = (e, t) => t === "multiple" ? Array.isArray(e) ? e : e ? [e] : [] : Array.isArray(e) ? e[0] ?? "" : e ?? "", fn = (e) => e.type !== "separator" && e.type !== "label", pn = ({ align: t = "start", asChild: n = !0, alignOffset: r = 0, avoidCollisions: i = !0, className: a, collisionBoundary: o, collisionPadding: s = 10, contentClassName: c, dataTestId: l, defaultOpen: u, defaultValue: d, disabled: f = !1, dropdownWidth: b = "content", emptyMessage: ee = "No options found", loadingMessage: x = "Loading…", modal: te = !0, onOpenChange: S, onValueChange: ne, open: re, options: C, selectionMode: w = "single", side: T = "bottom", sideOffset: ie = 4, state: E = "default", trigger: ae, value: O }) => {
|
|
757
|
+
let [k, A] = y({
|
|
758
|
+
value: re,
|
|
759
759
|
defaultValue: u ?? !1,
|
|
760
|
-
onChange:
|
|
761
|
-
}), { dropdownShiftStyle:
|
|
762
|
-
value:
|
|
763
|
-
defaultValue:
|
|
764
|
-
onChange:
|
|
765
|
-
}), { dropdownWidthMode:
|
|
766
|
-
dropdownWidth:
|
|
760
|
+
onChange: S
|
|
761
|
+
}), { dropdownShiftStyle: N, setDropdownElement: P } = D(k), F = dn(d, w), [I, L] = y({
|
|
762
|
+
value: O === void 0 ? void 0 : dn(O, w),
|
|
763
|
+
defaultValue: F,
|
|
764
|
+
onChange: ne
|
|
765
|
+
}), { dropdownWidthMode: R, dropdownWidthStyle: z } = _({
|
|
766
|
+
dropdownWidth: b,
|
|
767
767
|
triggerWidth: "var(--radix-dropdown-menu-trigger-width)"
|
|
768
|
-
}),
|
|
769
|
-
if (
|
|
770
|
-
let t = Array.isArray(
|
|
771
|
-
|
|
768
|
+
}), B = f || E === "loading", oe = C.filter(fn), se = (e) => w === "multiple" ? (Array.isArray(I) ? I : []).includes(e) : I === e, V = (e) => {
|
|
769
|
+
if (w === "multiple") {
|
|
770
|
+
let t = Array.isArray(I) ? I : [];
|
|
771
|
+
L(t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
772
772
|
return;
|
|
773
773
|
}
|
|
774
|
-
|
|
775
|
-
},
|
|
776
|
-
if (t.type === "separator") return /* @__PURE__ */
|
|
774
|
+
L(e), A(!1);
|
|
775
|
+
}, H = (t, n) => {
|
|
776
|
+
if (t.type === "separator") return /* @__PURE__ */ j(un, {
|
|
777
777
|
className: "-mx-1 my-1 h-px bg-border-secondary",
|
|
778
778
|
"data-testid": "spectral-dropdown-menu-separator"
|
|
779
779
|
}, t.id ?? `separator-${n}`);
|
|
780
|
-
if (t.type === "label") return /* @__PURE__ */
|
|
780
|
+
if (t.type === "label") return /* @__PURE__ */ j(on, {
|
|
781
781
|
className: "px-2 py-1.5 text-base font-semibold text-text-primary",
|
|
782
782
|
"data-testid": "spectral-dropdown-menu-label",
|
|
783
783
|
children: t.label
|
|
784
784
|
}, t.id ?? `label-${n}`);
|
|
785
|
-
let r =
|
|
786
|
-
return
|
|
785
|
+
let r = se(t.value), i = p(v(!!t.disabled, !1, r), "group/spectral-dropdown-menu-item pr-2 gap-4 relative flex w-full justify-between");
|
|
786
|
+
return w === "multiple" || t.type === "checkbox" ? /* @__PURE__ */ M(cn, {
|
|
787
787
|
checked: r,
|
|
788
788
|
className: i,
|
|
789
789
|
"data-testid": "spectral-dropdown-menu-checkbox-item",
|
|
790
790
|
disabled: t.disabled,
|
|
791
|
-
onCheckedChange: () =>
|
|
791
|
+
onCheckedChange: () => V(t.value),
|
|
792
792
|
onSelect: (e) => e.preventDefault(),
|
|
793
793
|
children: [
|
|
794
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ j("span", {
|
|
795
795
|
className: "min-w-0 flex-1 truncate whitespace-nowrap",
|
|
796
796
|
children: t.label
|
|
797
797
|
}),
|
|
798
|
-
t.shortcut && /* @__PURE__ */
|
|
798
|
+
t.shortcut && /* @__PURE__ */ j("span", {
|
|
799
799
|
className: "text-xs tracking-widest ml-auto text-input-text-placeholder",
|
|
800
800
|
children: t.shortcut
|
|
801
801
|
}),
|
|
802
|
-
/* @__PURE__ */
|
|
802
|
+
/* @__PURE__ */ j("span", {
|
|
803
803
|
"aria-hidden": "true",
|
|
804
804
|
className: "ml-2 size-4 flex shrink-0 items-center justify-center",
|
|
805
|
-
children: /* @__PURE__ */
|
|
805
|
+
children: /* @__PURE__ */ j(ln, {
|
|
806
806
|
asChild: !0,
|
|
807
|
-
children: /* @__PURE__ */
|
|
807
|
+
children: /* @__PURE__ */ j("span", {
|
|
808
808
|
className: "size-4 flex items-center justify-center",
|
|
809
|
-
children: /* @__PURE__ */
|
|
809
|
+
children: /* @__PURE__ */ j(e, { size: 16 })
|
|
810
810
|
})
|
|
811
811
|
})
|
|
812
812
|
})
|
|
813
813
|
]
|
|
814
|
-
}, t.value) : /* @__PURE__ */
|
|
814
|
+
}, t.value) : /* @__PURE__ */ M(sn, {
|
|
815
815
|
className: i,
|
|
816
816
|
"data-testid": "spectral-dropdown-menu-item",
|
|
817
817
|
disabled: t.disabled,
|
|
818
|
-
onSelect: () =>
|
|
818
|
+
onSelect: () => V(t.value),
|
|
819
819
|
children: [
|
|
820
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ j("span", {
|
|
821
821
|
className: "min-w-0 flex-1 truncate whitespace-nowrap",
|
|
822
822
|
children: t.label
|
|
823
823
|
}),
|
|
824
|
-
t.shortcut && /* @__PURE__ */
|
|
824
|
+
t.shortcut && /* @__PURE__ */ j("span", {
|
|
825
825
|
className: "text-xs tracking-widest ml-auto text-input-text-placeholder",
|
|
826
826
|
children: t.shortcut
|
|
827
827
|
}),
|
|
828
|
-
/* @__PURE__ */
|
|
828
|
+
/* @__PURE__ */ j("span", {
|
|
829
829
|
"aria-hidden": "true",
|
|
830
830
|
className: "ml-2 size-4 flex shrink-0 items-center justify-center",
|
|
831
|
-
children: r && /* @__PURE__ */
|
|
831
|
+
children: r && /* @__PURE__ */ j(e, { size: 16 })
|
|
832
832
|
})
|
|
833
833
|
]
|
|
834
834
|
}, t.value);
|
|
835
835
|
};
|
|
836
|
-
return /* @__PURE__ */
|
|
837
|
-
modal:
|
|
838
|
-
onOpenChange:
|
|
839
|
-
open:
|
|
840
|
-
children: [/* @__PURE__ */
|
|
836
|
+
return /* @__PURE__ */ M(tn, {
|
|
837
|
+
modal: te,
|
|
838
|
+
onOpenChange: A,
|
|
839
|
+
open: k,
|
|
840
|
+
children: [/* @__PURE__ */ j(nn, {
|
|
841
841
|
asChild: n,
|
|
842
842
|
className: p(a, "transition-opacity duration-200 hover:cursor-pointer hover:opacity-80"),
|
|
843
843
|
"data-testid": l ?? "spectral-dropdown-menu-trigger",
|
|
844
|
-
disabled:
|
|
845
|
-
children:
|
|
846
|
-
}), /* @__PURE__ */
|
|
844
|
+
disabled: B,
|
|
845
|
+
children: ae
|
|
846
|
+
}), /* @__PURE__ */ j(rn, { children: /* @__PURE__ */ j(an, {
|
|
847
847
|
align: t,
|
|
848
848
|
alignOffset: r,
|
|
849
849
|
avoidCollisions: i,
|
|
850
|
-
className: p("p-1 relative z-50 motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=open]:animate-in",
|
|
850
|
+
className: p("p-1 relative z-50 motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=open]:animate-in", g(), "motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95", "max-h-[min(var(--radix-dropdown-menu-content-available-height),300px)] motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=top]:slide-in-from-bottom-2", "min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto", c),
|
|
851
851
|
collisionBoundary: o,
|
|
852
852
|
collisionPadding: s,
|
|
853
|
-
"data-dropdown-width-mode":
|
|
854
|
-
"data-dropdown-width-value":
|
|
853
|
+
"data-dropdown-width-mode": R,
|
|
854
|
+
"data-dropdown-width-value": R === "custom" ? b : void 0,
|
|
855
855
|
"data-testid": "spectral-dropdown-menu-content",
|
|
856
|
-
ref:
|
|
857
|
-
side:
|
|
858
|
-
sideOffset:
|
|
856
|
+
ref: P,
|
|
857
|
+
side: T,
|
|
858
|
+
sideOffset: ie,
|
|
859
859
|
style: {
|
|
860
|
-
...
|
|
861
|
-
...
|
|
860
|
+
...z,
|
|
861
|
+
...N
|
|
862
862
|
},
|
|
863
|
-
children:
|
|
863
|
+
children: E === "loading" ? /* @__PURE__ */ j(h, { message: x }) : oe.length === 0 ? /* @__PURE__ */ j(m, { message: ee }) : C.map(H)
|
|
864
864
|
}) })]
|
|
865
865
|
});
|
|
866
866
|
};
|