@krosoft/react 0.0.85 → 0.0.87
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/AppSubTitle-DaFa30Qp.js +13 -0
- package/dist/{AppTitle-CJZdhpRm.js → AppTitle-COtcNGNr.js} +4 -4
- package/dist/AppVerticalTabs-aeKDheVe.js +829 -0
- package/dist/{FormDialog-CwxZPmv4.js → FormDialog-B3u7bHU_.js} +18 -18
- package/dist/{MetricCard-5kWhYPKJ.js → MetricCard-L5ETuqBs.js} +3 -3
- package/dist/{SearchInput-Dpy2amwO.js → SearchInput-BxnaShYy.js} +3 -3
- package/dist/{TableFilter-w9BHeObX.js → TableFilter-RzydxKBF.js} +6 -5
- package/dist/{TableSettings-DNkdLgCN.js → TableSettings-Bwysm3KH.js} +15 -15
- package/dist/{ThemeSelector-BCU1tFyR.js → ThemeSelector-mZBbr2qt.js} +3 -3
- package/dist/{Topbar-DifQ00kV.js → Topbar-DzFClMWt.js} +6 -5
- package/dist/{badge-Bw-aBz_H.js → badge-DCS7KMnM.js} +1 -1
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/dialogs/index.js +1 -1
- package/dist/components/core/filters/index.d.ts +1 -0
- package/dist/components/core/filters/index.d.ts.map +1 -1
- package/dist/components/core/filters/index.js +5 -4
- package/dist/components/core/index.d.ts +4 -4
- package/dist/components/core/index.d.ts.map +1 -1
- package/dist/components/core/index.js +55 -46
- package/dist/components/core/inputs/index.js +1 -1
- package/dist/components/core/layouts/AppSubTitle.d.ts +8 -0
- package/dist/components/core/layouts/AppSubTitle.d.ts.map +1 -0
- package/dist/components/core/layouts/index.d.ts +1 -0
- package/dist/components/core/layouts/index.d.ts.map +1 -1
- package/dist/components/core/layouts/index.js +5 -3
- package/dist/components/core/navbar/index.d.ts +2 -0
- package/dist/components/core/navbar/index.d.ts.map +1 -1
- package/dist/components/core/navbar/index.js +4 -3
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.d.ts +5 -0
- package/dist/components/core/tabs/index.d.ts.map +1 -0
- package/dist/components/core/tabs/index.js +7 -0
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +109 -100
- package/dist/components/ui/index.js +4 -4
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/dropdown-menu-BDcm9kW8.js +1086 -0
- package/dist/index-DUnCfjrC.js +2176 -0
- package/dist/popover-PsZp711z.js +4533 -0
- package/dist/select-C6w0ck7-.js +1737 -0
- package/dist/tooltip-CtjaR1qq.js +337 -0
- package/dist/types/UseDataTableResult.d.ts +1 -1
- package/dist/types/UseDataTableResult.d.ts.map +1 -1
- package/package.json +6 -5
- package/dist/dropdown-menu-Q_WkonPk.js +0 -1685
- package/dist/floating-ui.react-dom-BIcsGc3t.js +0 -1681
- package/dist/popover-BMvYmQOM.js +0 -5897
- package/dist/select-CtU681LB.js +0 -2070
- package/dist/tooltip-DzQngJZK.js +0 -828
|
@@ -0,0 +1,1086 @@
|
|
|
1
|
+
import { c as Pe } from "./createLucideIcon-CRdjzt2A.js";
|
|
2
|
+
import { jsx as c, jsxs as ve } from "react/jsx-runtime";
|
|
3
|
+
import * as a from "react";
|
|
4
|
+
import { a as ge, e as fe, h as A, i as g, u as B, f as Ne, l as we, m as he, P as re, d as Te, A as kn, D as Ln, C as Gn, n as Kn, g as $n, j as Un } from "./index-DUnCfjrC.js";
|
|
5
|
+
import { j as Ae, u as Oe, P as Bn, k as Vn, R as jn, F as Yn, l as zn, C as Wn } from "./select-C6w0ck7-.js";
|
|
6
|
+
import { c as O } from "./index-gWiv5-6R.js";
|
|
7
|
+
import { u as Hn } from "./popover-PsZp711z.js";
|
|
8
|
+
/**
|
|
9
|
+
* @license lucide-react v1.16.0 - ISC
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the ISC license.
|
|
12
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
const Xn = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], Zn = Pe("circle", Xn);
|
|
15
|
+
/**
|
|
16
|
+
* @license lucide-react v1.16.0 - ISC
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the ISC license.
|
|
19
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/
|
|
21
|
+
const qn = [
|
|
22
|
+
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
23
|
+
["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
|
|
24
|
+
["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
|
|
25
|
+
], $o = Pe("ellipsis-vertical", qn);
|
|
26
|
+
var le = "rovingFocusGroup.onEntryFocus", Jn = { bubbles: !1, cancelable: !0 }, Z = "RovingFocusGroup", [pe, Fe, Qn] = Ae(Z), [et, ke] = ge(
|
|
27
|
+
Z,
|
|
28
|
+
[Qn]
|
|
29
|
+
), [nt, tt] = et(Z), Le = a.forwardRef(
|
|
30
|
+
(e, t) => /* @__PURE__ */ c(pe.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(pe.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(ot, { ...e, ref: t }) }) })
|
|
31
|
+
);
|
|
32
|
+
Le.displayName = Z;
|
|
33
|
+
var ot = a.forwardRef((e, t) => {
|
|
34
|
+
const {
|
|
35
|
+
__scopeRovingFocusGroup: n,
|
|
36
|
+
orientation: o,
|
|
37
|
+
loop: r = !1,
|
|
38
|
+
dir: s,
|
|
39
|
+
currentTabStopId: u,
|
|
40
|
+
defaultCurrentTabStopId: d,
|
|
41
|
+
onCurrentTabStopIdChange: m,
|
|
42
|
+
onEntryFocus: v,
|
|
43
|
+
preventScrollOnEntryFocus: l = !1,
|
|
44
|
+
...i
|
|
45
|
+
} = e, f = a.useRef(null), h = B(t, f), w = Oe(s), [y, M] = Ne({
|
|
46
|
+
prop: u,
|
|
47
|
+
defaultProp: d ?? null,
|
|
48
|
+
onChange: m,
|
|
49
|
+
caller: Z
|
|
50
|
+
}), [b, N] = a.useState(!1), C = we(v), S = Fe(n), V = a.useRef(!1), [Q, F] = a.useState(0);
|
|
51
|
+
return a.useEffect(() => {
|
|
52
|
+
const _ = f.current;
|
|
53
|
+
if (_)
|
|
54
|
+
return _.addEventListener(le, C), () => _.removeEventListener(le, C);
|
|
55
|
+
}, [C]), /* @__PURE__ */ c(
|
|
56
|
+
nt,
|
|
57
|
+
{
|
|
58
|
+
scope: n,
|
|
59
|
+
orientation: o,
|
|
60
|
+
dir: w,
|
|
61
|
+
loop: r,
|
|
62
|
+
currentTabStopId: y,
|
|
63
|
+
onItemFocus: a.useCallback(
|
|
64
|
+
(_) => M(_),
|
|
65
|
+
[M]
|
|
66
|
+
),
|
|
67
|
+
onItemShiftTab: a.useCallback(() => N(!0), []),
|
|
68
|
+
onFocusableItemAdd: a.useCallback(
|
|
69
|
+
() => F((_) => _ + 1),
|
|
70
|
+
[]
|
|
71
|
+
),
|
|
72
|
+
onFocusableItemRemove: a.useCallback(
|
|
73
|
+
() => F((_) => _ - 1),
|
|
74
|
+
[]
|
|
75
|
+
),
|
|
76
|
+
children: /* @__PURE__ */ c(
|
|
77
|
+
A.div,
|
|
78
|
+
{
|
|
79
|
+
tabIndex: b || Q === 0 ? -1 : 0,
|
|
80
|
+
"data-orientation": o,
|
|
81
|
+
...i,
|
|
82
|
+
ref: h,
|
|
83
|
+
style: { outline: "none", ...e.style },
|
|
84
|
+
onMouseDown: g(e.onMouseDown, () => {
|
|
85
|
+
V.current = !0;
|
|
86
|
+
}),
|
|
87
|
+
onFocus: g(e.onFocus, (_) => {
|
|
88
|
+
const K = !V.current;
|
|
89
|
+
if (_.target === _.currentTarget && K && !b) {
|
|
90
|
+
const k = new CustomEvent(le, Jn);
|
|
91
|
+
if (_.currentTarget.dispatchEvent(k), !k.defaultPrevented) {
|
|
92
|
+
const j = S().filter((x) => x.focusable), Y = j.find((x) => x.active), ee = j.find((x) => x.id === y), ie = [Y, ee, ...j].filter(
|
|
93
|
+
Boolean
|
|
94
|
+
).map((x) => x.ref.current);
|
|
95
|
+
$e(ie, l);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
V.current = !1;
|
|
99
|
+
}),
|
|
100
|
+
onBlur: g(e.onBlur, () => N(!1))
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}), Ge = "RovingFocusGroupItem", Ke = a.forwardRef(
|
|
106
|
+
(e, t) => {
|
|
107
|
+
const {
|
|
108
|
+
__scopeRovingFocusGroup: n,
|
|
109
|
+
focusable: o = !0,
|
|
110
|
+
active: r = !1,
|
|
111
|
+
tabStopId: s,
|
|
112
|
+
children: u,
|
|
113
|
+
...d
|
|
114
|
+
} = e, m = fe(), v = s || m, l = tt(Ge, n), i = l.currentTabStopId === v, f = Fe(n), { onFocusableItemAdd: h, onFocusableItemRemove: w, currentTabStopId: y } = l;
|
|
115
|
+
return a.useEffect(() => {
|
|
116
|
+
if (o)
|
|
117
|
+
return h(), () => w();
|
|
118
|
+
}, [o, h, w]), /* @__PURE__ */ c(
|
|
119
|
+
pe.ItemSlot,
|
|
120
|
+
{
|
|
121
|
+
scope: n,
|
|
122
|
+
id: v,
|
|
123
|
+
focusable: o,
|
|
124
|
+
active: r,
|
|
125
|
+
children: /* @__PURE__ */ c(
|
|
126
|
+
A.span,
|
|
127
|
+
{
|
|
128
|
+
tabIndex: i ? 0 : -1,
|
|
129
|
+
"data-orientation": l.orientation,
|
|
130
|
+
...d,
|
|
131
|
+
ref: t,
|
|
132
|
+
onMouseDown: g(e.onMouseDown, (M) => {
|
|
133
|
+
o ? l.onItemFocus(v) : M.preventDefault();
|
|
134
|
+
}),
|
|
135
|
+
onFocus: g(e.onFocus, () => l.onItemFocus(v)),
|
|
136
|
+
onKeyDown: g(e.onKeyDown, (M) => {
|
|
137
|
+
if (M.key === "Tab" && M.shiftKey) {
|
|
138
|
+
l.onItemShiftTab();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (M.target !== M.currentTarget) return;
|
|
142
|
+
const b = ct(M, l.orientation, l.dir);
|
|
143
|
+
if (b !== void 0) {
|
|
144
|
+
if (M.metaKey || M.ctrlKey || M.altKey || M.shiftKey) return;
|
|
145
|
+
M.preventDefault();
|
|
146
|
+
let C = f().filter((S) => S.focusable).map((S) => S.ref.current);
|
|
147
|
+
if (b === "last") C.reverse();
|
|
148
|
+
else if (b === "prev" || b === "next") {
|
|
149
|
+
b === "prev" && C.reverse();
|
|
150
|
+
const S = C.indexOf(M.currentTarget);
|
|
151
|
+
C = l.loop ? st(C, S + 1) : C.slice(S + 1);
|
|
152
|
+
}
|
|
153
|
+
setTimeout(() => $e(C));
|
|
154
|
+
}
|
|
155
|
+
}),
|
|
156
|
+
children: typeof u == "function" ? u({ isCurrentTabStop: i, hasTabStop: y != null }) : u
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
Ke.displayName = Ge;
|
|
164
|
+
var rt = {
|
|
165
|
+
ArrowLeft: "prev",
|
|
166
|
+
ArrowUp: "prev",
|
|
167
|
+
ArrowRight: "next",
|
|
168
|
+
ArrowDown: "next",
|
|
169
|
+
PageUp: "first",
|
|
170
|
+
Home: "first",
|
|
171
|
+
PageDown: "last",
|
|
172
|
+
End: "last"
|
|
173
|
+
};
|
|
174
|
+
function at(e, t) {
|
|
175
|
+
return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
176
|
+
}
|
|
177
|
+
function ct(e, t, n) {
|
|
178
|
+
const o = at(e.key, n);
|
|
179
|
+
if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
|
180
|
+
return rt[o];
|
|
181
|
+
}
|
|
182
|
+
function $e(e, t = !1) {
|
|
183
|
+
const n = document.activeElement;
|
|
184
|
+
for (const o of e)
|
|
185
|
+
if (o === n || (o.focus({ preventScroll: t }), document.activeElement !== n)) return;
|
|
186
|
+
}
|
|
187
|
+
function st(e, t) {
|
|
188
|
+
return e.map((n, o) => e[(t + o) % e.length]);
|
|
189
|
+
}
|
|
190
|
+
var it = Le, ut = Ke;
|
|
191
|
+
// @__NO_SIDE_EFFECTS__
|
|
192
|
+
function dt(e) {
|
|
193
|
+
const t = /* @__PURE__ */ lt(e), n = a.forwardRef((o, r) => {
|
|
194
|
+
const { children: s, ...u } = o, d = a.Children.toArray(s), m = d.find(pt);
|
|
195
|
+
if (m) {
|
|
196
|
+
const v = m.props.children, l = d.map((i) => i === m ? a.Children.count(v) > 1 ? a.Children.only(null) : a.isValidElement(v) ? v.props.children : null : i);
|
|
197
|
+
return /* @__PURE__ */ c(t, { ...u, ref: r, children: a.isValidElement(v) ? a.cloneElement(v, void 0, l) : null });
|
|
198
|
+
}
|
|
199
|
+
return /* @__PURE__ */ c(t, { ...u, ref: r, children: s });
|
|
200
|
+
});
|
|
201
|
+
return n.displayName = `${e}.Slot`, n;
|
|
202
|
+
}
|
|
203
|
+
// @__NO_SIDE_EFFECTS__
|
|
204
|
+
function lt(e) {
|
|
205
|
+
const t = a.forwardRef((n, o) => {
|
|
206
|
+
const { children: r, ...s } = n;
|
|
207
|
+
if (a.isValidElement(r)) {
|
|
208
|
+
const u = vt(r), d = mt(s, r.props);
|
|
209
|
+
return r.type !== a.Fragment && (d.ref = o ? he(o, u) : u), a.cloneElement(r, d);
|
|
210
|
+
}
|
|
211
|
+
return a.Children.count(r) > 1 ? a.Children.only(null) : null;
|
|
212
|
+
});
|
|
213
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
214
|
+
}
|
|
215
|
+
var ft = Symbol("radix.slottable");
|
|
216
|
+
function pt(e) {
|
|
217
|
+
return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === ft;
|
|
218
|
+
}
|
|
219
|
+
function mt(e, t) {
|
|
220
|
+
const n = { ...t };
|
|
221
|
+
for (const o in t) {
|
|
222
|
+
const r = e[o], s = t[o];
|
|
223
|
+
/^on[A-Z]/.test(o) ? r && s ? n[o] = (...d) => {
|
|
224
|
+
const m = s(...d);
|
|
225
|
+
return r(...d), m;
|
|
226
|
+
} : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...s } : o === "className" && (n[o] = [r, s].filter(Boolean).join(" "));
|
|
227
|
+
}
|
|
228
|
+
return { ...e, ...n };
|
|
229
|
+
}
|
|
230
|
+
function vt(e) {
|
|
231
|
+
var o, r;
|
|
232
|
+
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
233
|
+
return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
234
|
+
}
|
|
235
|
+
var me = ["Enter", " "], gt = ["ArrowDown", "PageUp", "Home"], Ue = ["ArrowUp", "PageDown", "End"], wt = [...gt, ...Ue], ht = {
|
|
236
|
+
ltr: [...me, "ArrowRight"],
|
|
237
|
+
rtl: [...me, "ArrowLeft"]
|
|
238
|
+
}, Mt = {
|
|
239
|
+
ltr: ["ArrowLeft"],
|
|
240
|
+
rtl: ["ArrowRight"]
|
|
241
|
+
}, q = "Menu", [H, Ct, _t] = Ae(q), [L, Be] = ge(q, [
|
|
242
|
+
_t,
|
|
243
|
+
Te,
|
|
244
|
+
ke
|
|
245
|
+
]), ae = Te(), Ve = ke(), [Rt, G] = L(q), [bt, J] = L(q), je = (e) => {
|
|
246
|
+
const { __scopeMenu: t, open: n = !1, children: o, dir: r, onOpenChange: s, modal: u = !0 } = e, d = ae(t), [m, v] = a.useState(null), l = a.useRef(!1), i = we(s), f = Oe(r);
|
|
247
|
+
return a.useEffect(() => {
|
|
248
|
+
const h = () => {
|
|
249
|
+
l.current = !0, document.addEventListener("pointerdown", w, { capture: !0, once: !0 }), document.addEventListener("pointermove", w, { capture: !0, once: !0 });
|
|
250
|
+
}, w = () => l.current = !1;
|
|
251
|
+
return document.addEventListener("keydown", h, { capture: !0 }), () => {
|
|
252
|
+
document.removeEventListener("keydown", h, { capture: !0 }), document.removeEventListener("pointerdown", w, { capture: !0 }), document.removeEventListener("pointermove", w, { capture: !0 });
|
|
253
|
+
};
|
|
254
|
+
}, []), /* @__PURE__ */ c($n, { ...d, children: /* @__PURE__ */ c(
|
|
255
|
+
Rt,
|
|
256
|
+
{
|
|
257
|
+
scope: t,
|
|
258
|
+
open: n,
|
|
259
|
+
onOpenChange: i,
|
|
260
|
+
content: m,
|
|
261
|
+
onContentChange: v,
|
|
262
|
+
children: /* @__PURE__ */ c(
|
|
263
|
+
bt,
|
|
264
|
+
{
|
|
265
|
+
scope: t,
|
|
266
|
+
onClose: a.useCallback(() => i(!1), [i]),
|
|
267
|
+
isUsingKeyboardRef: l,
|
|
268
|
+
dir: f,
|
|
269
|
+
modal: u,
|
|
270
|
+
children: o
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
}
|
|
274
|
+
) });
|
|
275
|
+
};
|
|
276
|
+
je.displayName = q;
|
|
277
|
+
var yt = "MenuAnchor", Me = a.forwardRef(
|
|
278
|
+
(e, t) => {
|
|
279
|
+
const { __scopeMenu: n, ...o } = e, r = ae(n);
|
|
280
|
+
return /* @__PURE__ */ c(kn, { ...r, ...o, ref: t });
|
|
281
|
+
}
|
|
282
|
+
);
|
|
283
|
+
Me.displayName = yt;
|
|
284
|
+
var Ce = "MenuPortal", [It, Ye] = L(Ce, {
|
|
285
|
+
forceMount: void 0
|
|
286
|
+
}), ze = (e) => {
|
|
287
|
+
const { __scopeMenu: t, forceMount: n, children: o, container: r } = e, s = G(Ce, t);
|
|
288
|
+
return /* @__PURE__ */ c(It, { scope: t, forceMount: n, children: /* @__PURE__ */ c(re, { present: n || s.open, children: /* @__PURE__ */ c(Bn, { asChild: !0, container: r, children: o }) }) });
|
|
289
|
+
};
|
|
290
|
+
ze.displayName = Ce;
|
|
291
|
+
var E = "MenuContent", [Et, _e] = L(E), We = a.forwardRef(
|
|
292
|
+
(e, t) => {
|
|
293
|
+
const n = Ye(E, e.__scopeMenu), { forceMount: o = n.forceMount, ...r } = e, s = G(E, e.__scopeMenu), u = J(E, e.__scopeMenu);
|
|
294
|
+
return /* @__PURE__ */ c(H.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(re, { present: o || s.open, children: /* @__PURE__ */ c(H.Slot, { scope: e.__scopeMenu, children: u.modal ? /* @__PURE__ */ c(St, { ...r, ref: t }) : /* @__PURE__ */ c(Dt, { ...r, ref: t }) }) }) });
|
|
295
|
+
}
|
|
296
|
+
), St = a.forwardRef(
|
|
297
|
+
(e, t) => {
|
|
298
|
+
const n = G(E, e.__scopeMenu), o = a.useRef(null), r = B(t, o);
|
|
299
|
+
return a.useEffect(() => {
|
|
300
|
+
const s = o.current;
|
|
301
|
+
if (s) return zn(s);
|
|
302
|
+
}, []), /* @__PURE__ */ c(
|
|
303
|
+
Re,
|
|
304
|
+
{
|
|
305
|
+
...e,
|
|
306
|
+
ref: r,
|
|
307
|
+
trapFocus: n.open,
|
|
308
|
+
disableOutsidePointerEvents: n.open,
|
|
309
|
+
disableOutsideScroll: !0,
|
|
310
|
+
onFocusOutside: g(
|
|
311
|
+
e.onFocusOutside,
|
|
312
|
+
(s) => s.preventDefault(),
|
|
313
|
+
{ checkForDefaultPrevented: !1 }
|
|
314
|
+
),
|
|
315
|
+
onDismiss: () => n.onOpenChange(!1)
|
|
316
|
+
}
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
), Dt = a.forwardRef((e, t) => {
|
|
320
|
+
const n = G(E, e.__scopeMenu);
|
|
321
|
+
return /* @__PURE__ */ c(
|
|
322
|
+
Re,
|
|
323
|
+
{
|
|
324
|
+
...e,
|
|
325
|
+
ref: t,
|
|
326
|
+
trapFocus: !1,
|
|
327
|
+
disableOutsidePointerEvents: !1,
|
|
328
|
+
disableOutsideScroll: !1,
|
|
329
|
+
onDismiss: () => n.onOpenChange(!1)
|
|
330
|
+
}
|
|
331
|
+
);
|
|
332
|
+
}), xt = /* @__PURE__ */ dt("MenuContent.ScrollLock"), Re = a.forwardRef(
|
|
333
|
+
(e, t) => {
|
|
334
|
+
const {
|
|
335
|
+
__scopeMenu: n,
|
|
336
|
+
loop: o = !1,
|
|
337
|
+
trapFocus: r,
|
|
338
|
+
onOpenAutoFocus: s,
|
|
339
|
+
onCloseAutoFocus: u,
|
|
340
|
+
disableOutsidePointerEvents: d,
|
|
341
|
+
onEntryFocus: m,
|
|
342
|
+
onEscapeKeyDown: v,
|
|
343
|
+
onPointerDownOutside: l,
|
|
344
|
+
onFocusOutside: i,
|
|
345
|
+
onInteractOutside: f,
|
|
346
|
+
onDismiss: h,
|
|
347
|
+
disableOutsideScroll: w,
|
|
348
|
+
...y
|
|
349
|
+
} = e, M = G(E, n), b = J(E, n), N = ae(n), C = Ve(n), S = Ct(n), [V, Q] = a.useState(null), F = a.useRef(null), _ = B(t, F, M.onContentChange), K = a.useRef(0), k = a.useRef(""), j = a.useRef(0), Y = a.useRef(null), ee = a.useRef("right"), ne = a.useRef(0), ie = w ? jn : a.Fragment, x = w ? { as: xt, allowPinchZoom: !0 } : void 0, Fn = (p) => {
|
|
350
|
+
var U, Se;
|
|
351
|
+
const I = k.current + p, D = S().filter((P) => !P.disabled), T = document.activeElement, ue = (U = D.find((P) => P.ref.current === T)) == null ? void 0 : U.textValue, de = D.map((P) => P.textValue), Ee = Ut(de, I, ue), z = (Se = D.find((P) => P.textValue === Ee)) == null ? void 0 : Se.ref.current;
|
|
352
|
+
(function P(De) {
|
|
353
|
+
k.current = De, window.clearTimeout(K.current), De !== "" && (K.current = window.setTimeout(() => P(""), 1e3));
|
|
354
|
+
})(I), z && setTimeout(() => z.focus());
|
|
355
|
+
};
|
|
356
|
+
a.useEffect(() => () => window.clearTimeout(K.current), []), Vn();
|
|
357
|
+
const $ = a.useCallback((p) => {
|
|
358
|
+
var D, T;
|
|
359
|
+
return ee.current === ((D = Y.current) == null ? void 0 : D.side) && Vt(p, (T = Y.current) == null ? void 0 : T.area);
|
|
360
|
+
}, []);
|
|
361
|
+
return /* @__PURE__ */ c(
|
|
362
|
+
Et,
|
|
363
|
+
{
|
|
364
|
+
scope: n,
|
|
365
|
+
searchRef: k,
|
|
366
|
+
onItemEnter: a.useCallback(
|
|
367
|
+
(p) => {
|
|
368
|
+
$(p) && p.preventDefault();
|
|
369
|
+
},
|
|
370
|
+
[$]
|
|
371
|
+
),
|
|
372
|
+
onItemLeave: a.useCallback(
|
|
373
|
+
(p) => {
|
|
374
|
+
var I;
|
|
375
|
+
$(p) || ((I = F.current) == null || I.focus(), Q(null));
|
|
376
|
+
},
|
|
377
|
+
[$]
|
|
378
|
+
),
|
|
379
|
+
onTriggerLeave: a.useCallback(
|
|
380
|
+
(p) => {
|
|
381
|
+
$(p) && p.preventDefault();
|
|
382
|
+
},
|
|
383
|
+
[$]
|
|
384
|
+
),
|
|
385
|
+
pointerGraceTimerRef: j,
|
|
386
|
+
onPointerGraceIntentChange: a.useCallback((p) => {
|
|
387
|
+
Y.current = p;
|
|
388
|
+
}, []),
|
|
389
|
+
children: /* @__PURE__ */ c(ie, { ...x, children: /* @__PURE__ */ c(
|
|
390
|
+
Yn,
|
|
391
|
+
{
|
|
392
|
+
asChild: !0,
|
|
393
|
+
trapped: r,
|
|
394
|
+
onMountAutoFocus: g(s, (p) => {
|
|
395
|
+
var I;
|
|
396
|
+
p.preventDefault(), (I = F.current) == null || I.focus({ preventScroll: !0 });
|
|
397
|
+
}),
|
|
398
|
+
onUnmountAutoFocus: u,
|
|
399
|
+
children: /* @__PURE__ */ c(
|
|
400
|
+
Ln,
|
|
401
|
+
{
|
|
402
|
+
asChild: !0,
|
|
403
|
+
disableOutsidePointerEvents: d,
|
|
404
|
+
onEscapeKeyDown: v,
|
|
405
|
+
onPointerDownOutside: l,
|
|
406
|
+
onFocusOutside: i,
|
|
407
|
+
onInteractOutside: f,
|
|
408
|
+
onDismiss: h,
|
|
409
|
+
children: /* @__PURE__ */ c(
|
|
410
|
+
it,
|
|
411
|
+
{
|
|
412
|
+
asChild: !0,
|
|
413
|
+
...C,
|
|
414
|
+
dir: b.dir,
|
|
415
|
+
orientation: "vertical",
|
|
416
|
+
loop: o,
|
|
417
|
+
currentTabStopId: V,
|
|
418
|
+
onCurrentTabStopIdChange: Q,
|
|
419
|
+
onEntryFocus: g(m, (p) => {
|
|
420
|
+
b.isUsingKeyboardRef.current || p.preventDefault();
|
|
421
|
+
}),
|
|
422
|
+
preventScrollOnEntryFocus: !0,
|
|
423
|
+
children: /* @__PURE__ */ c(
|
|
424
|
+
Gn,
|
|
425
|
+
{
|
|
426
|
+
role: "menu",
|
|
427
|
+
"aria-orientation": "vertical",
|
|
428
|
+
"data-state": dn(M.open),
|
|
429
|
+
"data-radix-menu-content": "",
|
|
430
|
+
dir: b.dir,
|
|
431
|
+
...N,
|
|
432
|
+
...y,
|
|
433
|
+
ref: _,
|
|
434
|
+
style: { outline: "none", ...y.style },
|
|
435
|
+
onKeyDown: g(y.onKeyDown, (p) => {
|
|
436
|
+
const D = p.target.closest("[data-radix-menu-content]") === p.currentTarget, T = p.ctrlKey || p.altKey || p.metaKey, ue = p.key.length === 1;
|
|
437
|
+
D && (p.key === "Tab" && p.preventDefault(), !T && ue && Fn(p.key));
|
|
438
|
+
const de = F.current;
|
|
439
|
+
if (p.target !== de || !wt.includes(p.key)) return;
|
|
440
|
+
p.preventDefault();
|
|
441
|
+
const z = S().filter((U) => !U.disabled).map((U) => U.ref.current);
|
|
442
|
+
Ue.includes(p.key) && z.reverse(), Kt(z);
|
|
443
|
+
}),
|
|
444
|
+
onBlur: g(e.onBlur, (p) => {
|
|
445
|
+
p.currentTarget.contains(p.target) || (window.clearTimeout(K.current), k.current = "");
|
|
446
|
+
}),
|
|
447
|
+
onPointerMove: g(
|
|
448
|
+
e.onPointerMove,
|
|
449
|
+
X((p) => {
|
|
450
|
+
const I = p.target, D = ne.current !== p.clientX;
|
|
451
|
+
if (p.currentTarget.contains(I) && D) {
|
|
452
|
+
const T = p.clientX > ne.current ? "right" : "left";
|
|
453
|
+
ee.current = T, ne.current = p.clientX;
|
|
454
|
+
}
|
|
455
|
+
})
|
|
456
|
+
)
|
|
457
|
+
}
|
|
458
|
+
)
|
|
459
|
+
}
|
|
460
|
+
)
|
|
461
|
+
}
|
|
462
|
+
)
|
|
463
|
+
}
|
|
464
|
+
) })
|
|
465
|
+
}
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
);
|
|
469
|
+
We.displayName = E;
|
|
470
|
+
var Pt = "MenuGroup", be = a.forwardRef(
|
|
471
|
+
(e, t) => {
|
|
472
|
+
const { __scopeMenu: n, ...o } = e;
|
|
473
|
+
return /* @__PURE__ */ c(A.div, { role: "group", ...o, ref: t });
|
|
474
|
+
}
|
|
475
|
+
);
|
|
476
|
+
be.displayName = Pt;
|
|
477
|
+
var Nt = "MenuLabel", He = a.forwardRef(
|
|
478
|
+
(e, t) => {
|
|
479
|
+
const { __scopeMenu: n, ...o } = e;
|
|
480
|
+
return /* @__PURE__ */ c(A.div, { ...o, ref: t });
|
|
481
|
+
}
|
|
482
|
+
);
|
|
483
|
+
He.displayName = Nt;
|
|
484
|
+
var te = "MenuItem", xe = "menu.itemSelect", ce = a.forwardRef(
|
|
485
|
+
(e, t) => {
|
|
486
|
+
const { disabled: n = !1, onSelect: o, ...r } = e, s = a.useRef(null), u = J(te, e.__scopeMenu), d = _e(te, e.__scopeMenu), m = B(t, s), v = a.useRef(!1), l = () => {
|
|
487
|
+
const i = s.current;
|
|
488
|
+
if (!n && i) {
|
|
489
|
+
const f = new CustomEvent(xe, { bubbles: !0, cancelable: !0 });
|
|
490
|
+
i.addEventListener(xe, (h) => o == null ? void 0 : o(h), { once: !0 }), Kn(i, f), f.defaultPrevented ? v.current = !1 : u.onClose();
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
return /* @__PURE__ */ c(
|
|
494
|
+
Xe,
|
|
495
|
+
{
|
|
496
|
+
...r,
|
|
497
|
+
ref: m,
|
|
498
|
+
disabled: n,
|
|
499
|
+
onClick: g(e.onClick, l),
|
|
500
|
+
onPointerDown: (i) => {
|
|
501
|
+
var f;
|
|
502
|
+
(f = e.onPointerDown) == null || f.call(e, i), v.current = !0;
|
|
503
|
+
},
|
|
504
|
+
onPointerUp: g(e.onPointerUp, (i) => {
|
|
505
|
+
var f;
|
|
506
|
+
v.current || (f = i.currentTarget) == null || f.click();
|
|
507
|
+
}),
|
|
508
|
+
onKeyDown: g(e.onKeyDown, (i) => {
|
|
509
|
+
const f = d.searchRef.current !== "";
|
|
510
|
+
n || f && i.key === " " || me.includes(i.key) && (i.currentTarget.click(), i.preventDefault());
|
|
511
|
+
})
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
);
|
|
516
|
+
ce.displayName = te;
|
|
517
|
+
var Xe = a.forwardRef(
|
|
518
|
+
(e, t) => {
|
|
519
|
+
const { __scopeMenu: n, disabled: o = !1, textValue: r, ...s } = e, u = _e(te, n), d = Ve(n), m = a.useRef(null), v = B(t, m), [l, i] = a.useState(!1), [f, h] = a.useState("");
|
|
520
|
+
return a.useEffect(() => {
|
|
521
|
+
const w = m.current;
|
|
522
|
+
w && h((w.textContent ?? "").trim());
|
|
523
|
+
}, [s.children]), /* @__PURE__ */ c(
|
|
524
|
+
H.ItemSlot,
|
|
525
|
+
{
|
|
526
|
+
scope: n,
|
|
527
|
+
disabled: o,
|
|
528
|
+
textValue: r ?? f,
|
|
529
|
+
children: /* @__PURE__ */ c(ut, { asChild: !0, ...d, focusable: !o, children: /* @__PURE__ */ c(
|
|
530
|
+
A.div,
|
|
531
|
+
{
|
|
532
|
+
role: "menuitem",
|
|
533
|
+
"data-highlighted": l ? "" : void 0,
|
|
534
|
+
"aria-disabled": o || void 0,
|
|
535
|
+
"data-disabled": o ? "" : void 0,
|
|
536
|
+
...s,
|
|
537
|
+
ref: v,
|
|
538
|
+
onPointerMove: g(
|
|
539
|
+
e.onPointerMove,
|
|
540
|
+
X((w) => {
|
|
541
|
+
o ? u.onItemLeave(w) : (u.onItemEnter(w), w.defaultPrevented || w.currentTarget.focus({ preventScroll: !0 }));
|
|
542
|
+
})
|
|
543
|
+
),
|
|
544
|
+
onPointerLeave: g(
|
|
545
|
+
e.onPointerLeave,
|
|
546
|
+
X((w) => u.onItemLeave(w))
|
|
547
|
+
),
|
|
548
|
+
onFocus: g(e.onFocus, () => i(!0)),
|
|
549
|
+
onBlur: g(e.onBlur, () => i(!1))
|
|
550
|
+
}
|
|
551
|
+
) })
|
|
552
|
+
}
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
), Tt = "MenuCheckboxItem", Ze = a.forwardRef(
|
|
556
|
+
(e, t) => {
|
|
557
|
+
const { checked: n = !1, onCheckedChange: o, ...r } = e;
|
|
558
|
+
return /* @__PURE__ */ c(nn, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ c(
|
|
559
|
+
ce,
|
|
560
|
+
{
|
|
561
|
+
role: "menuitemcheckbox",
|
|
562
|
+
"aria-checked": oe(n) ? "mixed" : n,
|
|
563
|
+
...r,
|
|
564
|
+
ref: t,
|
|
565
|
+
"data-state": Ie(n),
|
|
566
|
+
onSelect: g(
|
|
567
|
+
r.onSelect,
|
|
568
|
+
() => o == null ? void 0 : o(oe(n) ? !0 : !n),
|
|
569
|
+
{ checkForDefaultPrevented: !1 }
|
|
570
|
+
)
|
|
571
|
+
}
|
|
572
|
+
) });
|
|
573
|
+
}
|
|
574
|
+
);
|
|
575
|
+
Ze.displayName = Tt;
|
|
576
|
+
var qe = "MenuRadioGroup", [At, Ot] = L(
|
|
577
|
+
qe,
|
|
578
|
+
{ value: void 0, onValueChange: () => {
|
|
579
|
+
} }
|
|
580
|
+
), Je = a.forwardRef(
|
|
581
|
+
(e, t) => {
|
|
582
|
+
const { value: n, onValueChange: o, ...r } = e, s = we(o);
|
|
583
|
+
return /* @__PURE__ */ c(At, { scope: e.__scopeMenu, value: n, onValueChange: s, children: /* @__PURE__ */ c(be, { ...r, ref: t }) });
|
|
584
|
+
}
|
|
585
|
+
);
|
|
586
|
+
Je.displayName = qe;
|
|
587
|
+
var Qe = "MenuRadioItem", en = a.forwardRef(
|
|
588
|
+
(e, t) => {
|
|
589
|
+
const { value: n, ...o } = e, r = Ot(Qe, e.__scopeMenu), s = n === r.value;
|
|
590
|
+
return /* @__PURE__ */ c(nn, { scope: e.__scopeMenu, checked: s, children: /* @__PURE__ */ c(
|
|
591
|
+
ce,
|
|
592
|
+
{
|
|
593
|
+
role: "menuitemradio",
|
|
594
|
+
"aria-checked": s,
|
|
595
|
+
...o,
|
|
596
|
+
ref: t,
|
|
597
|
+
"data-state": Ie(s),
|
|
598
|
+
onSelect: g(
|
|
599
|
+
o.onSelect,
|
|
600
|
+
() => {
|
|
601
|
+
var u;
|
|
602
|
+
return (u = r.onValueChange) == null ? void 0 : u.call(r, n);
|
|
603
|
+
},
|
|
604
|
+
{ checkForDefaultPrevented: !1 }
|
|
605
|
+
)
|
|
606
|
+
}
|
|
607
|
+
) });
|
|
608
|
+
}
|
|
609
|
+
);
|
|
610
|
+
en.displayName = Qe;
|
|
611
|
+
var ye = "MenuItemIndicator", [nn, Ft] = L(
|
|
612
|
+
ye,
|
|
613
|
+
{ checked: !1 }
|
|
614
|
+
), tn = a.forwardRef(
|
|
615
|
+
(e, t) => {
|
|
616
|
+
const { __scopeMenu: n, forceMount: o, ...r } = e, s = Ft(ye, n);
|
|
617
|
+
return /* @__PURE__ */ c(
|
|
618
|
+
re,
|
|
619
|
+
{
|
|
620
|
+
present: o || oe(s.checked) || s.checked === !0,
|
|
621
|
+
children: /* @__PURE__ */ c(
|
|
622
|
+
A.span,
|
|
623
|
+
{
|
|
624
|
+
...r,
|
|
625
|
+
ref: t,
|
|
626
|
+
"data-state": Ie(s.checked)
|
|
627
|
+
}
|
|
628
|
+
)
|
|
629
|
+
}
|
|
630
|
+
);
|
|
631
|
+
}
|
|
632
|
+
);
|
|
633
|
+
tn.displayName = ye;
|
|
634
|
+
var kt = "MenuSeparator", on = a.forwardRef(
|
|
635
|
+
(e, t) => {
|
|
636
|
+
const { __scopeMenu: n, ...o } = e;
|
|
637
|
+
return /* @__PURE__ */ c(
|
|
638
|
+
A.div,
|
|
639
|
+
{
|
|
640
|
+
role: "separator",
|
|
641
|
+
"aria-orientation": "horizontal",
|
|
642
|
+
...o,
|
|
643
|
+
ref: t
|
|
644
|
+
}
|
|
645
|
+
);
|
|
646
|
+
}
|
|
647
|
+
);
|
|
648
|
+
on.displayName = kt;
|
|
649
|
+
var Lt = "MenuArrow", rn = a.forwardRef(
|
|
650
|
+
(e, t) => {
|
|
651
|
+
const { __scopeMenu: n, ...o } = e, r = ae(n);
|
|
652
|
+
return /* @__PURE__ */ c(Un, { ...r, ...o, ref: t });
|
|
653
|
+
}
|
|
654
|
+
);
|
|
655
|
+
rn.displayName = Lt;
|
|
656
|
+
var Gt = "MenuSub", [Uo, an] = L(Gt), W = "MenuSubTrigger", cn = a.forwardRef(
|
|
657
|
+
(e, t) => {
|
|
658
|
+
const n = G(W, e.__scopeMenu), o = J(W, e.__scopeMenu), r = an(W, e.__scopeMenu), s = _e(W, e.__scopeMenu), u = a.useRef(null), { pointerGraceTimerRef: d, onPointerGraceIntentChange: m } = s, v = { __scopeMenu: e.__scopeMenu }, l = a.useCallback(() => {
|
|
659
|
+
u.current && window.clearTimeout(u.current), u.current = null;
|
|
660
|
+
}, []);
|
|
661
|
+
return a.useEffect(() => l, [l]), a.useEffect(() => {
|
|
662
|
+
const i = d.current;
|
|
663
|
+
return () => {
|
|
664
|
+
window.clearTimeout(i), m(null);
|
|
665
|
+
};
|
|
666
|
+
}, [d, m]), /* @__PURE__ */ c(Me, { asChild: !0, ...v, children: /* @__PURE__ */ c(
|
|
667
|
+
Xe,
|
|
668
|
+
{
|
|
669
|
+
id: r.triggerId,
|
|
670
|
+
"aria-haspopup": "menu",
|
|
671
|
+
"aria-expanded": n.open,
|
|
672
|
+
"aria-controls": r.contentId,
|
|
673
|
+
"data-state": dn(n.open),
|
|
674
|
+
...e,
|
|
675
|
+
ref: he(t, r.onTriggerChange),
|
|
676
|
+
onClick: (i) => {
|
|
677
|
+
var f;
|
|
678
|
+
(f = e.onClick) == null || f.call(e, i), !(e.disabled || i.defaultPrevented) && (i.currentTarget.focus(), n.open || n.onOpenChange(!0));
|
|
679
|
+
},
|
|
680
|
+
onPointerMove: g(
|
|
681
|
+
e.onPointerMove,
|
|
682
|
+
X((i) => {
|
|
683
|
+
s.onItemEnter(i), !i.defaultPrevented && !e.disabled && !n.open && !u.current && (s.onPointerGraceIntentChange(null), u.current = window.setTimeout(() => {
|
|
684
|
+
n.onOpenChange(!0), l();
|
|
685
|
+
}, 100));
|
|
686
|
+
})
|
|
687
|
+
),
|
|
688
|
+
onPointerLeave: g(
|
|
689
|
+
e.onPointerLeave,
|
|
690
|
+
X((i) => {
|
|
691
|
+
var h, w;
|
|
692
|
+
l();
|
|
693
|
+
const f = (h = n.content) == null ? void 0 : h.getBoundingClientRect();
|
|
694
|
+
if (f) {
|
|
695
|
+
const y = (w = n.content) == null ? void 0 : w.dataset.side, M = y === "right", b = M ? -5 : 5, N = f[M ? "left" : "right"], C = f[M ? "right" : "left"];
|
|
696
|
+
s.onPointerGraceIntentChange({
|
|
697
|
+
area: [
|
|
698
|
+
// Apply a bleed on clientX to ensure that our exit point is
|
|
699
|
+
// consistently within polygon bounds
|
|
700
|
+
{ x: i.clientX + b, y: i.clientY },
|
|
701
|
+
{ x: N, y: f.top },
|
|
702
|
+
{ x: C, y: f.top },
|
|
703
|
+
{ x: C, y: f.bottom },
|
|
704
|
+
{ x: N, y: f.bottom }
|
|
705
|
+
],
|
|
706
|
+
side: y
|
|
707
|
+
}), window.clearTimeout(d.current), d.current = window.setTimeout(
|
|
708
|
+
() => s.onPointerGraceIntentChange(null),
|
|
709
|
+
300
|
|
710
|
+
);
|
|
711
|
+
} else {
|
|
712
|
+
if (s.onTriggerLeave(i), i.defaultPrevented) return;
|
|
713
|
+
s.onPointerGraceIntentChange(null);
|
|
714
|
+
}
|
|
715
|
+
})
|
|
716
|
+
),
|
|
717
|
+
onKeyDown: g(e.onKeyDown, (i) => {
|
|
718
|
+
var h;
|
|
719
|
+
const f = s.searchRef.current !== "";
|
|
720
|
+
e.disabled || f && i.key === " " || ht[o.dir].includes(i.key) && (n.onOpenChange(!0), (h = n.content) == null || h.focus(), i.preventDefault());
|
|
721
|
+
})
|
|
722
|
+
}
|
|
723
|
+
) });
|
|
724
|
+
}
|
|
725
|
+
);
|
|
726
|
+
cn.displayName = W;
|
|
727
|
+
var sn = "MenuSubContent", un = a.forwardRef(
|
|
728
|
+
(e, t) => {
|
|
729
|
+
const n = Ye(E, e.__scopeMenu), { forceMount: o = n.forceMount, ...r } = e, s = G(E, e.__scopeMenu), u = J(E, e.__scopeMenu), d = an(sn, e.__scopeMenu), m = a.useRef(null), v = B(t, m);
|
|
730
|
+
return /* @__PURE__ */ c(H.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(re, { present: o || s.open, children: /* @__PURE__ */ c(H.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(
|
|
731
|
+
Re,
|
|
732
|
+
{
|
|
733
|
+
id: d.contentId,
|
|
734
|
+
"aria-labelledby": d.triggerId,
|
|
735
|
+
...r,
|
|
736
|
+
ref: v,
|
|
737
|
+
align: "start",
|
|
738
|
+
side: u.dir === "rtl" ? "left" : "right",
|
|
739
|
+
disableOutsidePointerEvents: !1,
|
|
740
|
+
disableOutsideScroll: !1,
|
|
741
|
+
trapFocus: !1,
|
|
742
|
+
onOpenAutoFocus: (l) => {
|
|
743
|
+
var i;
|
|
744
|
+
u.isUsingKeyboardRef.current && ((i = m.current) == null || i.focus()), l.preventDefault();
|
|
745
|
+
},
|
|
746
|
+
onCloseAutoFocus: (l) => l.preventDefault(),
|
|
747
|
+
onFocusOutside: g(e.onFocusOutside, (l) => {
|
|
748
|
+
l.target !== d.trigger && s.onOpenChange(!1);
|
|
749
|
+
}),
|
|
750
|
+
onEscapeKeyDown: g(e.onEscapeKeyDown, (l) => {
|
|
751
|
+
u.onClose(), l.preventDefault();
|
|
752
|
+
}),
|
|
753
|
+
onKeyDown: g(e.onKeyDown, (l) => {
|
|
754
|
+
var h;
|
|
755
|
+
const i = l.currentTarget.contains(l.target), f = Mt[u.dir].includes(l.key);
|
|
756
|
+
i && f && (s.onOpenChange(!1), (h = d.trigger) == null || h.focus(), l.preventDefault());
|
|
757
|
+
})
|
|
758
|
+
}
|
|
759
|
+
) }) }) });
|
|
760
|
+
}
|
|
761
|
+
);
|
|
762
|
+
un.displayName = sn;
|
|
763
|
+
function dn(e) {
|
|
764
|
+
return e ? "open" : "closed";
|
|
765
|
+
}
|
|
766
|
+
function oe(e) {
|
|
767
|
+
return e === "indeterminate";
|
|
768
|
+
}
|
|
769
|
+
function Ie(e) {
|
|
770
|
+
return oe(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
771
|
+
}
|
|
772
|
+
function Kt(e) {
|
|
773
|
+
const t = document.activeElement;
|
|
774
|
+
for (const n of e)
|
|
775
|
+
if (n === t || (n.focus(), document.activeElement !== t)) return;
|
|
776
|
+
}
|
|
777
|
+
function $t(e, t) {
|
|
778
|
+
return e.map((n, o) => e[(t + o) % e.length]);
|
|
779
|
+
}
|
|
780
|
+
function Ut(e, t, n) {
|
|
781
|
+
const r = t.length > 1 && Array.from(t).every((v) => v === t[0]) ? t[0] : t, s = n ? e.indexOf(n) : -1;
|
|
782
|
+
let u = $t(e, Math.max(s, 0));
|
|
783
|
+
r.length === 1 && (u = u.filter((v) => v !== n));
|
|
784
|
+
const m = u.find(
|
|
785
|
+
(v) => v.toLowerCase().startsWith(r.toLowerCase())
|
|
786
|
+
);
|
|
787
|
+
return m !== n ? m : void 0;
|
|
788
|
+
}
|
|
789
|
+
function Bt(e, t) {
|
|
790
|
+
const { x: n, y: o } = e;
|
|
791
|
+
let r = !1;
|
|
792
|
+
for (let s = 0, u = t.length - 1; s < t.length; u = s++) {
|
|
793
|
+
const d = t[s], m = t[u], v = d.x, l = d.y, i = m.x, f = m.y;
|
|
794
|
+
l > o != f > o && n < (i - v) * (o - l) / (f - l) + v && (r = !r);
|
|
795
|
+
}
|
|
796
|
+
return r;
|
|
797
|
+
}
|
|
798
|
+
function Vt(e, t) {
|
|
799
|
+
if (!t) return !1;
|
|
800
|
+
const n = { x: e.clientX, y: e.clientY };
|
|
801
|
+
return Bt(n, t);
|
|
802
|
+
}
|
|
803
|
+
function X(e) {
|
|
804
|
+
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
805
|
+
}
|
|
806
|
+
var jt = je, Yt = Me, zt = ze, Wt = We, Ht = be, Xt = He, Zt = ce, qt = Ze, Jt = Je, Qt = en, eo = tn, no = on, to = rn, oo = cn, ro = un, se = "DropdownMenu", [ao] = ge(
|
|
807
|
+
se,
|
|
808
|
+
[Be]
|
|
809
|
+
), R = Be(), [co, ln] = ao(se), fn = (e) => {
|
|
810
|
+
const {
|
|
811
|
+
__scopeDropdownMenu: t,
|
|
812
|
+
children: n,
|
|
813
|
+
dir: o,
|
|
814
|
+
open: r,
|
|
815
|
+
defaultOpen: s,
|
|
816
|
+
onOpenChange: u,
|
|
817
|
+
modal: d = !0
|
|
818
|
+
} = e, m = R(t), v = a.useRef(null), [l, i] = Ne({
|
|
819
|
+
prop: r,
|
|
820
|
+
defaultProp: s ?? !1,
|
|
821
|
+
onChange: u,
|
|
822
|
+
caller: se
|
|
823
|
+
});
|
|
824
|
+
return /* @__PURE__ */ c(
|
|
825
|
+
co,
|
|
826
|
+
{
|
|
827
|
+
scope: t,
|
|
828
|
+
triggerId: fe(),
|
|
829
|
+
triggerRef: v,
|
|
830
|
+
contentId: fe(),
|
|
831
|
+
open: l,
|
|
832
|
+
onOpenChange: i,
|
|
833
|
+
onOpenToggle: a.useCallback(() => i((f) => !f), [i]),
|
|
834
|
+
modal: d,
|
|
835
|
+
children: /* @__PURE__ */ c(jt, { ...m, open: l, onOpenChange: i, dir: o, modal: d, children: n })
|
|
836
|
+
}
|
|
837
|
+
);
|
|
838
|
+
};
|
|
839
|
+
fn.displayName = se;
|
|
840
|
+
var pn = "DropdownMenuTrigger", mn = a.forwardRef(
|
|
841
|
+
(e, t) => {
|
|
842
|
+
const { __scopeDropdownMenu: n, disabled: o = !1, ...r } = e, s = ln(pn, n), u = R(n);
|
|
843
|
+
return /* @__PURE__ */ c(Yt, { asChild: !0, ...u, children: /* @__PURE__ */ c(
|
|
844
|
+
A.button,
|
|
845
|
+
{
|
|
846
|
+
type: "button",
|
|
847
|
+
id: s.triggerId,
|
|
848
|
+
"aria-haspopup": "menu",
|
|
849
|
+
"aria-expanded": s.open,
|
|
850
|
+
"aria-controls": s.open ? s.contentId : void 0,
|
|
851
|
+
"data-state": s.open ? "open" : "closed",
|
|
852
|
+
"data-disabled": o ? "" : void 0,
|
|
853
|
+
disabled: o,
|
|
854
|
+
...r,
|
|
855
|
+
ref: he(t, s.triggerRef),
|
|
856
|
+
onPointerDown: g(e.onPointerDown, (d) => {
|
|
857
|
+
!o && d.button === 0 && d.ctrlKey === !1 && (s.onOpenToggle(), s.open || d.preventDefault());
|
|
858
|
+
}),
|
|
859
|
+
onKeyDown: g(e.onKeyDown, (d) => {
|
|
860
|
+
o || (["Enter", " "].includes(d.key) && s.onOpenToggle(), d.key === "ArrowDown" && s.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(d.key) && d.preventDefault());
|
|
861
|
+
})
|
|
862
|
+
}
|
|
863
|
+
) });
|
|
864
|
+
}
|
|
865
|
+
);
|
|
866
|
+
mn.displayName = pn;
|
|
867
|
+
var so = "DropdownMenuPortal", vn = (e) => {
|
|
868
|
+
const { __scopeDropdownMenu: t, ...n } = e, o = R(t);
|
|
869
|
+
return /* @__PURE__ */ c(zt, { ...o, ...n });
|
|
870
|
+
};
|
|
871
|
+
vn.displayName = so;
|
|
872
|
+
var gn = "DropdownMenuContent", wn = a.forwardRef(
|
|
873
|
+
(e, t) => {
|
|
874
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = ln(gn, n), s = R(n), u = a.useRef(!1);
|
|
875
|
+
return /* @__PURE__ */ c(
|
|
876
|
+
Wt,
|
|
877
|
+
{
|
|
878
|
+
id: r.contentId,
|
|
879
|
+
"aria-labelledby": r.triggerId,
|
|
880
|
+
...s,
|
|
881
|
+
...o,
|
|
882
|
+
ref: t,
|
|
883
|
+
onCloseAutoFocus: g(e.onCloseAutoFocus, (d) => {
|
|
884
|
+
var m;
|
|
885
|
+
u.current || (m = r.triggerRef.current) == null || m.focus(), u.current = !1, d.preventDefault();
|
|
886
|
+
}),
|
|
887
|
+
onInteractOutside: g(e.onInteractOutside, (d) => {
|
|
888
|
+
const m = d.detail.originalEvent, v = m.button === 0 && m.ctrlKey === !0, l = m.button === 2 || v;
|
|
889
|
+
(!r.modal || l) && (u.current = !0);
|
|
890
|
+
}),
|
|
891
|
+
style: {
|
|
892
|
+
...e.style,
|
|
893
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
894
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
895
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
896
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
897
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
);
|
|
901
|
+
}
|
|
902
|
+
);
|
|
903
|
+
wn.displayName = gn;
|
|
904
|
+
var io = "DropdownMenuGroup", uo = a.forwardRef(
|
|
905
|
+
(e, t) => {
|
|
906
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = R(n);
|
|
907
|
+
return /* @__PURE__ */ c(Ht, { ...r, ...o, ref: t });
|
|
908
|
+
}
|
|
909
|
+
);
|
|
910
|
+
uo.displayName = io;
|
|
911
|
+
var lo = "DropdownMenuLabel", hn = a.forwardRef(
|
|
912
|
+
(e, t) => {
|
|
913
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = R(n);
|
|
914
|
+
return /* @__PURE__ */ c(Xt, { ...r, ...o, ref: t });
|
|
915
|
+
}
|
|
916
|
+
);
|
|
917
|
+
hn.displayName = lo;
|
|
918
|
+
var fo = "DropdownMenuItem", Mn = a.forwardRef(
|
|
919
|
+
(e, t) => {
|
|
920
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = R(n);
|
|
921
|
+
return /* @__PURE__ */ c(Zt, { ...r, ...o, ref: t });
|
|
922
|
+
}
|
|
923
|
+
);
|
|
924
|
+
Mn.displayName = fo;
|
|
925
|
+
var po = "DropdownMenuCheckboxItem", Cn = a.forwardRef((e, t) => {
|
|
926
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = R(n);
|
|
927
|
+
return /* @__PURE__ */ c(qt, { ...r, ...o, ref: t });
|
|
928
|
+
});
|
|
929
|
+
Cn.displayName = po;
|
|
930
|
+
var mo = "DropdownMenuRadioGroup", vo = a.forwardRef((e, t) => {
|
|
931
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = R(n);
|
|
932
|
+
return /* @__PURE__ */ c(Jt, { ...r, ...o, ref: t });
|
|
933
|
+
});
|
|
934
|
+
vo.displayName = mo;
|
|
935
|
+
var go = "DropdownMenuRadioItem", _n = a.forwardRef((e, t) => {
|
|
936
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = R(n);
|
|
937
|
+
return /* @__PURE__ */ c(Qt, { ...r, ...o, ref: t });
|
|
938
|
+
});
|
|
939
|
+
_n.displayName = go;
|
|
940
|
+
var wo = "DropdownMenuItemIndicator", Rn = a.forwardRef((e, t) => {
|
|
941
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = R(n);
|
|
942
|
+
return /* @__PURE__ */ c(eo, { ...r, ...o, ref: t });
|
|
943
|
+
});
|
|
944
|
+
Rn.displayName = wo;
|
|
945
|
+
var ho = "DropdownMenuSeparator", bn = a.forwardRef((e, t) => {
|
|
946
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = R(n);
|
|
947
|
+
return /* @__PURE__ */ c(no, { ...r, ...o, ref: t });
|
|
948
|
+
});
|
|
949
|
+
bn.displayName = ho;
|
|
950
|
+
var Mo = "DropdownMenuArrow", Co = a.forwardRef(
|
|
951
|
+
(e, t) => {
|
|
952
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = R(n);
|
|
953
|
+
return /* @__PURE__ */ c(to, { ...r, ...o, ref: t });
|
|
954
|
+
}
|
|
955
|
+
);
|
|
956
|
+
Co.displayName = Mo;
|
|
957
|
+
var _o = "DropdownMenuSubTrigger", yn = a.forwardRef((e, t) => {
|
|
958
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = R(n);
|
|
959
|
+
return /* @__PURE__ */ c(oo, { ...r, ...o, ref: t });
|
|
960
|
+
});
|
|
961
|
+
yn.displayName = _o;
|
|
962
|
+
var Ro = "DropdownMenuSubContent", In = a.forwardRef((e, t) => {
|
|
963
|
+
const { __scopeDropdownMenu: n, ...o } = e, r = R(n);
|
|
964
|
+
return /* @__PURE__ */ c(
|
|
965
|
+
ro,
|
|
966
|
+
{
|
|
967
|
+
...r,
|
|
968
|
+
...o,
|
|
969
|
+
ref: t,
|
|
970
|
+
style: {
|
|
971
|
+
...e.style,
|
|
972
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
973
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
974
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
975
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
976
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
);
|
|
980
|
+
});
|
|
981
|
+
In.displayName = Ro;
|
|
982
|
+
var bo = fn, yo = mn, Io = vn, En = wn, Sn = hn, Dn = Mn, xn = Cn, Pn = _n, Nn = Rn, Tn = bn, An = yn, On = In;
|
|
983
|
+
const Bo = bo, Vo = yo, Eo = a.forwardRef(({ className: e, inset: t, children: n, ...o }, r) => /* @__PURE__ */ ve(
|
|
984
|
+
An,
|
|
985
|
+
{
|
|
986
|
+
ref: r,
|
|
987
|
+
className: O(
|
|
988
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",
|
|
989
|
+
t === !0 && "pl-8",
|
|
990
|
+
e
|
|
991
|
+
),
|
|
992
|
+
...o,
|
|
993
|
+
children: [
|
|
994
|
+
n,
|
|
995
|
+
/* @__PURE__ */ c(Hn, { className: "ml-auto size-4" })
|
|
996
|
+
]
|
|
997
|
+
}
|
|
998
|
+
));
|
|
999
|
+
Eo.displayName = An.displayName;
|
|
1000
|
+
const So = a.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
1001
|
+
On,
|
|
1002
|
+
{
|
|
1003
|
+
ref: n,
|
|
1004
|
+
className: O(
|
|
1005
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
|
|
1006
|
+
e
|
|
1007
|
+
),
|
|
1008
|
+
...t
|
|
1009
|
+
}
|
|
1010
|
+
));
|
|
1011
|
+
So.displayName = On.displayName;
|
|
1012
|
+
const Do = a.forwardRef(({ className: e, sideOffset: t = 4, ...n }, o) => /* @__PURE__ */ c(Io, { children: /* @__PURE__ */ c(
|
|
1013
|
+
En,
|
|
1014
|
+
{
|
|
1015
|
+
ref: o,
|
|
1016
|
+
sideOffset: t,
|
|
1017
|
+
className: O(
|
|
1018
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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",
|
|
1019
|
+
e
|
|
1020
|
+
),
|
|
1021
|
+
...n
|
|
1022
|
+
}
|
|
1023
|
+
) }));
|
|
1024
|
+
Do.displayName = En.displayName;
|
|
1025
|
+
const xo = a.forwardRef(({ className: e, inset: t, ...n }, o) => /* @__PURE__ */ c(
|
|
1026
|
+
Dn,
|
|
1027
|
+
{
|
|
1028
|
+
ref: o,
|
|
1029
|
+
className: O(
|
|
1030
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",
|
|
1031
|
+
t === !0 && "pl-8",
|
|
1032
|
+
e
|
|
1033
|
+
),
|
|
1034
|
+
...n
|
|
1035
|
+
}
|
|
1036
|
+
));
|
|
1037
|
+
xo.displayName = Dn.displayName;
|
|
1038
|
+
const Po = a.forwardRef(({ className: e, children: t, checked: n, ...o }, r) => /* @__PURE__ */ ve(
|
|
1039
|
+
xn,
|
|
1040
|
+
{
|
|
1041
|
+
ref: r,
|
|
1042
|
+
className: O(
|
|
1043
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",
|
|
1044
|
+
e
|
|
1045
|
+
),
|
|
1046
|
+
checked: n,
|
|
1047
|
+
...o,
|
|
1048
|
+
children: [
|
|
1049
|
+
/* @__PURE__ */ c("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ c(Nn, { children: /* @__PURE__ */ c(Wn, { className: "size-4" }) }) }),
|
|
1050
|
+
t
|
|
1051
|
+
]
|
|
1052
|
+
}
|
|
1053
|
+
));
|
|
1054
|
+
Po.displayName = xn.displayName;
|
|
1055
|
+
const No = a.forwardRef(({ className: e, children: t, ...n }, o) => /* @__PURE__ */ ve(
|
|
1056
|
+
Pn,
|
|
1057
|
+
{
|
|
1058
|
+
ref: o,
|
|
1059
|
+
className: O(
|
|
1060
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",
|
|
1061
|
+
e
|
|
1062
|
+
),
|
|
1063
|
+
...n,
|
|
1064
|
+
children: [
|
|
1065
|
+
/* @__PURE__ */ c("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ c(Nn, { children: /* @__PURE__ */ c(Zn, { className: "h-2 w-2 fill-current" }) }) }),
|
|
1066
|
+
t
|
|
1067
|
+
]
|
|
1068
|
+
}
|
|
1069
|
+
));
|
|
1070
|
+
No.displayName = Pn.displayName;
|
|
1071
|
+
const To = a.forwardRef(({ className: e, inset: t, ...n }, o) => /* @__PURE__ */ c(Sn, { ref: o, className: O("px-2 py-1.5 text-sm font-semibold", t === !0 && "pl-8", e), ...n }));
|
|
1072
|
+
To.displayName = Sn.displayName;
|
|
1073
|
+
const Ao = a.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(Tn, { ref: n, className: O("-mx-1 my-1 h-px bg-muted", e), ...t }));
|
|
1074
|
+
Ao.displayName = Tn.displayName;
|
|
1075
|
+
export {
|
|
1076
|
+
Bo as D,
|
|
1077
|
+
$o as E,
|
|
1078
|
+
ut as I,
|
|
1079
|
+
it as R,
|
|
1080
|
+
Vo as a,
|
|
1081
|
+
Do as b,
|
|
1082
|
+
Ao as c,
|
|
1083
|
+
xo as d,
|
|
1084
|
+
ke as e,
|
|
1085
|
+
Po as f
|
|
1086
|
+
};
|