@adamosuiteservices/ui 1.2.5 → 1.4.5
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/accordion-rounded.cjs +1 -1
- package/dist/accordion-rounded.js +1 -1
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +1 -1
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.cjs +1 -0
- package/dist/breadcrumb.js +105 -0
- package/dist/{button-C1n6snOY.js → button-2GdKenQI.js} +1 -1
- package/dist/{button-BV-_FVKZ.cjs → button-DEQVHMrX.cjs} +1 -1
- package/dist/button-group.cjs +1 -1
- package/dist/button-group.js +2 -2
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.js +1 -1
- package/dist/{checkbox-BrmXPKTn.js → checkbox-Dr487kAg.js} +3 -3
- package/dist/{checkbox-Lq-HvSgc.cjs → checkbox-YWAnswaW.cjs} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.js +1 -1
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +6 -6
- package/dist/components/layout/sidebar/sidebar.d.ts +7 -3
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts +11 -0
- package/dist/components/ui/breadcrumb/breadcrumb.stories.d.ts +26 -0
- package/dist/components/ui/breadcrumb/index.d.ts +1 -0
- package/dist/components/ui/button/button.d.ts +2 -2
- package/dist/components/ui/dialog/dialog.d.ts +2 -1
- package/dist/components/ui/input-group/input-group.d.ts +1 -1
- package/dist/components/ui/toggle/toggle.d.ts +1 -1
- package/dist/components/ui/typography/typography.d.ts +1 -1
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.js +2 -2
- package/dist/custom-layered-styles.css +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +33 -19
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.js +3 -3
- package/dist/ellipsis-CryjZKZn.js +15 -0
- package/dist/ellipsis-Ct9VTDOG.cjs +6 -0
- package/dist/field.cjs +1 -1
- package/dist/field.js +2 -2
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.js +6 -6
- package/dist/{index-CAOY367Y.js → index-B0M7VOwp.js} +2 -2
- package/dist/{index-B-ZRqW0J.js → index-BBoIAjAs.js} +3 -3
- package/dist/{index-gO_QEiaK.cjs → index-BDs8lUfq.cjs} +1 -1
- package/dist/index-BFyr34mw.cjs +5 -0
- package/dist/index-BMWt1NBG.js +79 -0
- package/dist/{index-yR-v1A4G.js → index-BX9hz-JD.js} +1 -1
- package/dist/{index-BGiGvaq8.cjs → index-BcGMAmWE.cjs} +1 -1
- package/dist/{index-IKJMQref.cjs → index-Bd0gQB0k.cjs} +1 -1
- package/dist/{index-VIUqZjyP.cjs → index-BeWgla7c.cjs} +1 -1
- package/dist/{index-EUea2gfp.js → index-BpWB3aFK.js} +1 -1
- package/dist/index-BvLQnI56.js +59 -0
- package/dist/{index-CwUFT-GQ.js → index-C0YiLSjW.js} +4 -4
- package/dist/{index-o0sNTcKe.js → index-CBjZooac.js} +2 -2
- package/dist/{index-DnS_sBBe.cjs → index-COuvjZLM.cjs} +1 -1
- package/dist/index-CTjlbbt9.cjs +1 -0
- package/dist/index-CUWMxxKG.js +97 -0
- package/dist/{index-C329e3yQ.js → index-CZZ3llmi.js} +2 -2
- package/dist/index-CjyiloO7.cjs +1 -0
- package/dist/{index-D3wSWKST.cjs → index-Cmx9M9cZ.cjs} +1 -1
- package/dist/index-CocSS1YK.cjs +1 -0
- package/dist/index-CzRiuk60.cjs +1 -0
- package/dist/index-DFPDUUq7.js +658 -0
- package/dist/{index-D3S7dBDI.cjs → index-DIwmXz1u.cjs} +1 -1
- package/dist/index-DLcqcWxM.js +29 -0
- package/dist/index-DMLQL2aG.js +286 -0
- package/dist/{index-DXQ-7kNJ.cjs → index-DMs8RL3E.cjs} +1 -1
- package/dist/{index-Ce3QBKyj.cjs → index-Dbj9vHNq.cjs} +1 -1
- package/dist/{index-BRLtxFFr.cjs → index-DmGzwG2z.cjs} +1 -1
- package/dist/{index-P1sVIHE3.js → index-PYkEXTqJ.js} +1 -1
- package/dist/{index-DulPG3F9.js → index-Se4vRnIO.js} +3 -3
- package/dist/index-_XxjJPRD.cjs +1 -0
- package/dist/{index-B-cHTKrs.js → index-yWvyIlmA.js} +4 -4
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.js +1 -1
- package/dist/{label-Cne2J57f.cjs → label-BjXORCBM.cjs} +1 -1
- package/dist/{label-Ky8qBEC3.js → label-CmwGvhy1.js} +1 -1
- package/dist/label.cjs +1 -1
- package/dist/label.js +1 -1
- package/dist/pagination.cjs +1 -6
- package/dist/pagination.js +58 -69
- package/dist/popover-3rIoNCXs.js +306 -0
- package/dist/popover-FCKBtFo-.cjs +1 -0
- package/dist/popover.cjs +1 -1
- package/dist/popover.js +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +5 -5
- package/dist/select.cjs +2 -2
- package/dist/select.js +585 -542
- package/dist/{separator-CGnu_jIu.cjs → separator-BaZqZZ9R.cjs} +1 -1
- package/dist/{separator-BH73A90k.js → separator-DR7lQjv9.js} +1 -1
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +1 -1
- package/dist/{sheet-CcxnJ6LH.cjs → sheet-CU-sFSaJ.cjs} +1 -1
- package/dist/{sheet-_DVpQIVF.js → sheet-UZWAbdXr.js} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.cjs +2 -2
- package/dist/sidebar.js +89 -78
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +3 -3
- package/dist/styles.css +1 -1
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +2 -2
- package/dist/tabs-underline.cjs +1 -1
- package/dist/tabs-underline.js +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/toaster.cjs +1 -1
- package/dist/toaster.js +1 -1
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +114 -108
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/docs/AI-GUIDE.md +321 -0
- package/docs/components/layout/sidebar.md +404 -0
- package/docs/components/layout/toaster.md +436 -0
- package/docs/components/ui/accordion-rounded.md +583 -0
- package/docs/components/ui/accordion.md +267 -0
- package/docs/components/ui/alert.md +671 -0
- package/docs/components/ui/avatar.md +588 -0
- package/docs/components/ui/badge.md +1024 -0
- package/docs/components/ui/breadcrumb.md +614 -0
- package/docs/components/ui/button-group.md +1002 -0
- package/docs/components/ui/button.md +1078 -0
- package/docs/components/ui/calendar.md +1159 -0
- package/docs/components/ui/card.md +1265 -0
- package/docs/components/ui/checkbox.md +292 -0
- package/docs/components/ui/collapsible.md +320 -0
- package/docs/components/ui/combobox.md +328 -0
- package/docs/components/ui/command.md +454 -0
- package/docs/components/ui/context-menu.md +540 -0
- package/docs/components/ui/dialog.md +628 -0
- package/docs/components/ui/dropdown-menu.md +731 -0
- package/docs/components/ui/field.md +706 -0
- package/docs/components/ui/hover-card.md +446 -0
- package/docs/components/ui/input-group.md +509 -0
- package/docs/components/ui/input.md +362 -0
- package/docs/components/ui/kbd.md +434 -0
- package/docs/components/ui/label.md +359 -0
- package/docs/components/ui/pagination.md +650 -0
- package/docs/components/ui/popover.md +536 -0
- package/docs/components/ui/progress.md +182 -0
- package/docs/components/ui/radio-group.md +311 -0
- package/docs/components/ui/select.md +352 -0
- package/docs/components/ui/separator.md +214 -0
- package/docs/components/ui/sheet.md +142 -0
- package/docs/components/ui/skeleton.md +140 -0
- package/docs/components/ui/slider.md +341 -0
- package/docs/components/ui/spinner.md +170 -0
- package/docs/components/ui/switch.md +402 -0
- package/docs/components/ui/table.md +183 -0
- package/docs/components/ui/tabs-underline.md +106 -0
- package/docs/components/ui/tabs.md +122 -0
- package/docs/components/ui/textarea.md +243 -0
- package/docs/components/ui/toggle.md +243 -0
- package/docs/components/ui/tooltip.md +320 -0
- package/docs/components/ui/typography.md +191 -0
- package/package.json +11 -5
- package/dist/index-6oTEokEx.js +0 -82
- package/dist/index-B-NyefE0.js +0 -243
- package/dist/index-BKbK2GzY.cjs +0 -1
- package/dist/index-BMitW9UR.cjs +0 -1
- package/dist/index-BpvjJ_T6.cjs +0 -5
- package/dist/index-C5wjudc-.js +0 -36
- package/dist/index-CezwiPd_.js +0 -615
- package/dist/index-D02K8KOB.js +0 -54
- package/dist/index-D7hQvndv.cjs +0 -1
- package/dist/index-DQvx1rG_.cjs +0 -1
- package/dist/popover-BjdTqaB8.cjs +0 -1
- package/dist/popover-EnVfE0YA.js +0 -263
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import { c as v } from "./index-C0UREtMP.js";
|
|
3
|
+
import { c as ze, u as Ze } from "./index-CUWMxxKG.js";
|
|
4
|
+
import { c as pe, u as D } from "./index-DLcqcWxM.js";
|
|
5
|
+
import { c as qe } from "./index-FxyLF8MY.js";
|
|
6
|
+
import { D as Je } from "./index-CZZ3llmi.js";
|
|
7
|
+
import { h as Qe, u as en, R as nn, F as tn } from "./index-CBjZooac.js";
|
|
8
|
+
import { u as de } from "./index-Cv867SGx.js";
|
|
9
|
+
import { c as me, R as he, A as on, C as rn, a as sn } from "./index-B0M7VOwp.js";
|
|
10
|
+
import { P as cn } from "./index-BX9hz-JD.js";
|
|
11
|
+
import { P as W } from "./index-BpWB3aFK.js";
|
|
12
|
+
import { P as N, d as an } from "./index-BMWt1NBG.js";
|
|
13
|
+
import { c as Ce, I as un, R as ln } from "./index-Se4vRnIO.js";
|
|
14
|
+
import { j as u } from "./jsx-runtime-BzflLqGi.js";
|
|
15
|
+
import { u as q } from "./index-0ioNhtNM.js";
|
|
16
|
+
// @__NO_SIDE_EFFECTS__
|
|
17
|
+
function dn(e) {
|
|
18
|
+
const t = /* @__PURE__ */ fn(e), n = o.forwardRef((r, s) => {
|
|
19
|
+
const { children: c, ...l } = r, f = o.Children.toArray(c), m = f.find(mn);
|
|
20
|
+
if (m) {
|
|
21
|
+
const p = m.props.children, d = f.map((a) => a === m ? o.Children.count(p) > 1 ? o.Children.only(null) : o.isValidElement(p) ? p.props.children : null : a);
|
|
22
|
+
return /* @__PURE__ */ u.jsx(t, { ...l, ref: s, children: o.isValidElement(p) ? o.cloneElement(p, void 0, d) : null });
|
|
23
|
+
}
|
|
24
|
+
return /* @__PURE__ */ u.jsx(t, { ...l, ref: s, children: c });
|
|
25
|
+
});
|
|
26
|
+
return n.displayName = `${e}.Slot`, n;
|
|
27
|
+
}
|
|
28
|
+
// @__NO_SIDE_EFFECTS__
|
|
29
|
+
function fn(e) {
|
|
30
|
+
const t = o.forwardRef((n, r) => {
|
|
31
|
+
const { children: s, ...c } = n;
|
|
32
|
+
if (o.isValidElement(s)) {
|
|
33
|
+
const l = Cn(s), f = hn(c, s.props);
|
|
34
|
+
return s.type !== o.Fragment && (f.ref = r ? pe(r, l) : l), o.cloneElement(s, f);
|
|
35
|
+
}
|
|
36
|
+
return o.Children.count(s) > 1 ? o.Children.only(null) : null;
|
|
37
|
+
});
|
|
38
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
39
|
+
}
|
|
40
|
+
var pn = Symbol("radix.slottable");
|
|
41
|
+
function mn(e) {
|
|
42
|
+
return o.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === pn;
|
|
43
|
+
}
|
|
44
|
+
function hn(e, t) {
|
|
45
|
+
const n = { ...t };
|
|
46
|
+
for (const r in t) {
|
|
47
|
+
const s = e[r], c = t[r];
|
|
48
|
+
/^on[A-Z]/.test(r) ? s && c ? n[r] = (...f) => {
|
|
49
|
+
const m = c(...f);
|
|
50
|
+
return s(...f), m;
|
|
51
|
+
} : s && (n[r] = s) : r === "style" ? n[r] = { ...s, ...c } : r === "className" && (n[r] = [s, c].filter(Boolean).join(" "));
|
|
52
|
+
}
|
|
53
|
+
return { ...e, ...n };
|
|
54
|
+
}
|
|
55
|
+
function Cn(e) {
|
|
56
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
57
|
+
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
58
|
+
}
|
|
59
|
+
var Z = ["Enter", " "], vn = ["ArrowDown", "PageUp", "Home"], ve = ["ArrowUp", "PageDown", "End"], Mn = [...vn, ...ve], gn = {
|
|
60
|
+
ltr: [...Z, "ArrowRight"],
|
|
61
|
+
rtl: [...Z, "ArrowLeft"]
|
|
62
|
+
}, xn = {
|
|
63
|
+
ltr: ["ArrowLeft"],
|
|
64
|
+
rtl: ["ArrowRight"]
|
|
65
|
+
}, k = "Menu", [j, _n, Rn] = ze(k), [S, rt] = qe(k, [
|
|
66
|
+
Rn,
|
|
67
|
+
me,
|
|
68
|
+
Ce
|
|
69
|
+
]), F = me(), Me = Ce(), [ge, _] = S(k), [Sn, L] = S(k), xe = (e) => {
|
|
70
|
+
const { __scopeMenu: t, open: n = !1, children: r, dir: s, onOpenChange: c, modal: l = !0 } = e, f = F(t), [m, p] = o.useState(null), d = o.useRef(!1), a = q(c), h = Ze(s);
|
|
71
|
+
return o.useEffect(() => {
|
|
72
|
+
const g = () => {
|
|
73
|
+
d.current = !0, document.addEventListener("pointerdown", C, { capture: !0, once: !0 }), document.addEventListener("pointermove", C, { capture: !0, once: !0 });
|
|
74
|
+
}, C = () => d.current = !1;
|
|
75
|
+
return document.addEventListener("keydown", g, { capture: !0 }), () => {
|
|
76
|
+
document.removeEventListener("keydown", g, { capture: !0 }), document.removeEventListener("pointerdown", C, { capture: !0 }), document.removeEventListener("pointermove", C, { capture: !0 });
|
|
77
|
+
};
|
|
78
|
+
}, []), /* @__PURE__ */ u.jsx(he, { ...f, children: /* @__PURE__ */ u.jsx(
|
|
79
|
+
ge,
|
|
80
|
+
{
|
|
81
|
+
scope: t,
|
|
82
|
+
open: n,
|
|
83
|
+
onOpenChange: a,
|
|
84
|
+
content: m,
|
|
85
|
+
onContentChange: p,
|
|
86
|
+
children: /* @__PURE__ */ u.jsx(
|
|
87
|
+
Sn,
|
|
88
|
+
{
|
|
89
|
+
scope: t,
|
|
90
|
+
onClose: o.useCallback(() => a(!1), [a]),
|
|
91
|
+
isUsingKeyboardRef: d,
|
|
92
|
+
dir: h,
|
|
93
|
+
modal: l,
|
|
94
|
+
children: r
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
) });
|
|
99
|
+
};
|
|
100
|
+
xe.displayName = k;
|
|
101
|
+
var En = "MenuAnchor", J = o.forwardRef(
|
|
102
|
+
(e, t) => {
|
|
103
|
+
const { __scopeMenu: n, ...r } = e, s = F(n);
|
|
104
|
+
return /* @__PURE__ */ u.jsx(on, { ...s, ...r, ref: t });
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
J.displayName = En;
|
|
108
|
+
var Q = "MenuPortal", [Pn, _e] = S(Q, {
|
|
109
|
+
forceMount: void 0
|
|
110
|
+
}), Re = (e) => {
|
|
111
|
+
const { __scopeMenu: t, forceMount: n, children: r, container: s } = e, c = _(Q, t);
|
|
112
|
+
return /* @__PURE__ */ u.jsx(Pn, { scope: t, forceMount: n, children: /* @__PURE__ */ u.jsx(W, { present: n || c.open, children: /* @__PURE__ */ u.jsx(cn, { asChild: !0, container: s, children: r }) }) });
|
|
113
|
+
};
|
|
114
|
+
Re.displayName = Q;
|
|
115
|
+
var x = "MenuContent", [yn, ee] = S(x), Se = o.forwardRef(
|
|
116
|
+
(e, t) => {
|
|
117
|
+
const n = _e(x, e.__scopeMenu), { forceMount: r = n.forceMount, ...s } = e, c = _(x, e.__scopeMenu), l = L(x, e.__scopeMenu);
|
|
118
|
+
return /* @__PURE__ */ u.jsx(j.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(W, { present: r || c.open, children: /* @__PURE__ */ u.jsx(j.Slot, { scope: e.__scopeMenu, children: l.modal ? /* @__PURE__ */ u.jsx(In, { ...s, ref: t }) : /* @__PURE__ */ u.jsx(wn, { ...s, ref: t }) }) }) });
|
|
119
|
+
}
|
|
120
|
+
), In = o.forwardRef(
|
|
121
|
+
(e, t) => {
|
|
122
|
+
const n = _(x, e.__scopeMenu), r = o.useRef(null), s = D(t, r);
|
|
123
|
+
return o.useEffect(() => {
|
|
124
|
+
const c = r.current;
|
|
125
|
+
if (c) return Qe(c);
|
|
126
|
+
}, []), /* @__PURE__ */ u.jsx(
|
|
127
|
+
ne,
|
|
128
|
+
{
|
|
129
|
+
...e,
|
|
130
|
+
ref: s,
|
|
131
|
+
trapFocus: n.open,
|
|
132
|
+
disableOutsidePointerEvents: n.open,
|
|
133
|
+
disableOutsideScroll: !0,
|
|
134
|
+
onFocusOutside: v(
|
|
135
|
+
e.onFocusOutside,
|
|
136
|
+
(c) => c.preventDefault(),
|
|
137
|
+
{ checkForDefaultPrevented: !1 }
|
|
138
|
+
),
|
|
139
|
+
onDismiss: () => n.onOpenChange(!1)
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
), wn = o.forwardRef((e, t) => {
|
|
144
|
+
const n = _(x, e.__scopeMenu);
|
|
145
|
+
return /* @__PURE__ */ u.jsx(
|
|
146
|
+
ne,
|
|
147
|
+
{
|
|
148
|
+
...e,
|
|
149
|
+
ref: t,
|
|
150
|
+
trapFocus: !1,
|
|
151
|
+
disableOutsidePointerEvents: !1,
|
|
152
|
+
disableOutsideScroll: !1,
|
|
153
|
+
onDismiss: () => n.onOpenChange(!1)
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}), bn = /* @__PURE__ */ dn("MenuContent.ScrollLock"), ne = o.forwardRef(
|
|
157
|
+
(e, t) => {
|
|
158
|
+
const {
|
|
159
|
+
__scopeMenu: n,
|
|
160
|
+
loop: r = !1,
|
|
161
|
+
trapFocus: s,
|
|
162
|
+
onOpenAutoFocus: c,
|
|
163
|
+
onCloseAutoFocus: l,
|
|
164
|
+
disableOutsidePointerEvents: f,
|
|
165
|
+
onEntryFocus: m,
|
|
166
|
+
onEscapeKeyDown: p,
|
|
167
|
+
onPointerDownOutside: d,
|
|
168
|
+
onFocusOutside: a,
|
|
169
|
+
onInteractOutside: h,
|
|
170
|
+
onDismiss: g,
|
|
171
|
+
disableOutsideScroll: C,
|
|
172
|
+
...E
|
|
173
|
+
} = e, w = _(x, n), P = L(x, n), Ue = F(n), Ve = Me(n), ce = _n(n), [Be, ae] = o.useState(null), K = o.useRef(null), We = D(t, K, w.onContentChange), G = o.useRef(0), U = o.useRef(""), Ye = o.useRef(0), X = o.useRef(null), ue = o.useRef("right"), H = o.useRef(0), Xe = C ? nn : o.Fragment, He = C ? { as: bn, allowPinchZoom: !0 } : void 0, $e = (i) => {
|
|
174
|
+
const I = U.current + i, R = ce().filter((M) => !M.disabled), b = document.activeElement, $ = R.find((M) => M.ref.current === b)?.textValue, z = R.map((M) => M.textValue), ie = Un(z, I, $), T = R.find((M) => M.textValue === ie)?.ref.current;
|
|
175
|
+
(function M(le) {
|
|
176
|
+
U.current = le, window.clearTimeout(G.current), le !== "" && (G.current = window.setTimeout(() => M(""), 1e3));
|
|
177
|
+
})(I), T && setTimeout(() => T.focus());
|
|
178
|
+
};
|
|
179
|
+
o.useEffect(() => () => window.clearTimeout(G.current), []), en();
|
|
180
|
+
const y = o.useCallback((i) => ue.current === X.current?.side && Bn(i, X.current?.area), []);
|
|
181
|
+
return /* @__PURE__ */ u.jsx(
|
|
182
|
+
yn,
|
|
183
|
+
{
|
|
184
|
+
scope: n,
|
|
185
|
+
searchRef: U,
|
|
186
|
+
onItemEnter: o.useCallback(
|
|
187
|
+
(i) => {
|
|
188
|
+
y(i) && i.preventDefault();
|
|
189
|
+
},
|
|
190
|
+
[y]
|
|
191
|
+
),
|
|
192
|
+
onItemLeave: o.useCallback(
|
|
193
|
+
(i) => {
|
|
194
|
+
y(i) || (K.current?.focus(), ae(null));
|
|
195
|
+
},
|
|
196
|
+
[y]
|
|
197
|
+
),
|
|
198
|
+
onTriggerLeave: o.useCallback(
|
|
199
|
+
(i) => {
|
|
200
|
+
y(i) && i.preventDefault();
|
|
201
|
+
},
|
|
202
|
+
[y]
|
|
203
|
+
),
|
|
204
|
+
pointerGraceTimerRef: Ye,
|
|
205
|
+
onPointerGraceIntentChange: o.useCallback((i) => {
|
|
206
|
+
X.current = i;
|
|
207
|
+
}, []),
|
|
208
|
+
children: /* @__PURE__ */ u.jsx(Xe, { ...He, children: /* @__PURE__ */ u.jsx(
|
|
209
|
+
tn,
|
|
210
|
+
{
|
|
211
|
+
asChild: !0,
|
|
212
|
+
trapped: s,
|
|
213
|
+
onMountAutoFocus: v(c, (i) => {
|
|
214
|
+
i.preventDefault(), K.current?.focus({ preventScroll: !0 });
|
|
215
|
+
}),
|
|
216
|
+
onUnmountAutoFocus: l,
|
|
217
|
+
children: /* @__PURE__ */ u.jsx(
|
|
218
|
+
Je,
|
|
219
|
+
{
|
|
220
|
+
asChild: !0,
|
|
221
|
+
disableOutsidePointerEvents: f,
|
|
222
|
+
onEscapeKeyDown: p,
|
|
223
|
+
onPointerDownOutside: d,
|
|
224
|
+
onFocusOutside: a,
|
|
225
|
+
onInteractOutside: h,
|
|
226
|
+
onDismiss: g,
|
|
227
|
+
children: /* @__PURE__ */ u.jsx(
|
|
228
|
+
ln,
|
|
229
|
+
{
|
|
230
|
+
asChild: !0,
|
|
231
|
+
...Ve,
|
|
232
|
+
dir: P.dir,
|
|
233
|
+
orientation: "vertical",
|
|
234
|
+
loop: r,
|
|
235
|
+
currentTabStopId: Be,
|
|
236
|
+
onCurrentTabStopIdChange: ae,
|
|
237
|
+
onEntryFocus: v(m, (i) => {
|
|
238
|
+
P.isUsingKeyboardRef.current || i.preventDefault();
|
|
239
|
+
}),
|
|
240
|
+
preventScrollOnEntryFocus: !0,
|
|
241
|
+
children: /* @__PURE__ */ u.jsx(
|
|
242
|
+
rn,
|
|
243
|
+
{
|
|
244
|
+
role: "menu",
|
|
245
|
+
"aria-orientation": "vertical",
|
|
246
|
+
"data-state": Ge(w.open),
|
|
247
|
+
"data-radix-menu-content": "",
|
|
248
|
+
dir: P.dir,
|
|
249
|
+
...Ue,
|
|
250
|
+
...E,
|
|
251
|
+
ref: We,
|
|
252
|
+
style: { outline: "none", ...E.style },
|
|
253
|
+
onKeyDown: v(E.onKeyDown, (i) => {
|
|
254
|
+
const R = i.target.closest("[data-radix-menu-content]") === i.currentTarget, b = i.ctrlKey || i.altKey || i.metaKey, $ = i.key.length === 1;
|
|
255
|
+
R && (i.key === "Tab" && i.preventDefault(), !b && $ && $e(i.key));
|
|
256
|
+
const z = K.current;
|
|
257
|
+
if (i.target !== z || !Mn.includes(i.key)) return;
|
|
258
|
+
i.preventDefault();
|
|
259
|
+
const T = ce().filter((M) => !M.disabled).map((M) => M.ref.current);
|
|
260
|
+
ve.includes(i.key) && T.reverse(), Kn(T);
|
|
261
|
+
}),
|
|
262
|
+
onBlur: v(e.onBlur, (i) => {
|
|
263
|
+
i.currentTarget.contains(i.target) || (window.clearTimeout(G.current), U.current = "");
|
|
264
|
+
}),
|
|
265
|
+
onPointerMove: v(
|
|
266
|
+
e.onPointerMove,
|
|
267
|
+
O((i) => {
|
|
268
|
+
const I = i.target, R = H.current !== i.clientX;
|
|
269
|
+
if (i.currentTarget.contains(I) && R) {
|
|
270
|
+
const b = i.clientX > H.current ? "right" : "left";
|
|
271
|
+
ue.current = b, H.current = i.clientX;
|
|
272
|
+
}
|
|
273
|
+
})
|
|
274
|
+
)
|
|
275
|
+
}
|
|
276
|
+
)
|
|
277
|
+
}
|
|
278
|
+
)
|
|
279
|
+
}
|
|
280
|
+
)
|
|
281
|
+
}
|
|
282
|
+
) })
|
|
283
|
+
}
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
Se.displayName = x;
|
|
288
|
+
var Tn = "MenuGroup", te = o.forwardRef(
|
|
289
|
+
(e, t) => {
|
|
290
|
+
const { __scopeMenu: n, ...r } = e;
|
|
291
|
+
return /* @__PURE__ */ u.jsx(N.div, { role: "group", ...r, ref: t });
|
|
292
|
+
}
|
|
293
|
+
);
|
|
294
|
+
te.displayName = Tn;
|
|
295
|
+
var An = "MenuLabel", Ee = o.forwardRef(
|
|
296
|
+
(e, t) => {
|
|
297
|
+
const { __scopeMenu: n, ...r } = e;
|
|
298
|
+
return /* @__PURE__ */ u.jsx(N.div, { ...r, ref: t });
|
|
299
|
+
}
|
|
300
|
+
);
|
|
301
|
+
Ee.displayName = An;
|
|
302
|
+
var V = "MenuItem", fe = "menu.itemSelect", Y = o.forwardRef(
|
|
303
|
+
(e, t) => {
|
|
304
|
+
const { disabled: n = !1, onSelect: r, ...s } = e, c = o.useRef(null), l = L(V, e.__scopeMenu), f = ee(V, e.__scopeMenu), m = D(t, c), p = o.useRef(!1), d = () => {
|
|
305
|
+
const a = c.current;
|
|
306
|
+
if (!n && a) {
|
|
307
|
+
const h = new CustomEvent(fe, { bubbles: !0, cancelable: !0 });
|
|
308
|
+
a.addEventListener(fe, (g) => r?.(g), { once: !0 }), an(a, h), h.defaultPrevented ? p.current = !1 : l.onClose();
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
return /* @__PURE__ */ u.jsx(
|
|
312
|
+
Pe,
|
|
313
|
+
{
|
|
314
|
+
...s,
|
|
315
|
+
ref: m,
|
|
316
|
+
disabled: n,
|
|
317
|
+
onClick: v(e.onClick, d),
|
|
318
|
+
onPointerDown: (a) => {
|
|
319
|
+
e.onPointerDown?.(a), p.current = !0;
|
|
320
|
+
},
|
|
321
|
+
onPointerUp: v(e.onPointerUp, (a) => {
|
|
322
|
+
p.current || a.currentTarget?.click();
|
|
323
|
+
}),
|
|
324
|
+
onKeyDown: v(e.onKeyDown, (a) => {
|
|
325
|
+
const h = f.searchRef.current !== "";
|
|
326
|
+
n || h && a.key === " " || Z.includes(a.key) && (a.currentTarget.click(), a.preventDefault());
|
|
327
|
+
})
|
|
328
|
+
}
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
);
|
|
332
|
+
Y.displayName = V;
|
|
333
|
+
var Pe = o.forwardRef(
|
|
334
|
+
(e, t) => {
|
|
335
|
+
const { __scopeMenu: n, disabled: r = !1, textValue: s, ...c } = e, l = ee(V, n), f = Me(n), m = o.useRef(null), p = D(t, m), [d, a] = o.useState(!1), [h, g] = o.useState("");
|
|
336
|
+
return o.useEffect(() => {
|
|
337
|
+
const C = m.current;
|
|
338
|
+
C && g((C.textContent ?? "").trim());
|
|
339
|
+
}, [c.children]), /* @__PURE__ */ u.jsx(
|
|
340
|
+
j.ItemSlot,
|
|
341
|
+
{
|
|
342
|
+
scope: n,
|
|
343
|
+
disabled: r,
|
|
344
|
+
textValue: s ?? h,
|
|
345
|
+
children: /* @__PURE__ */ u.jsx(un, { asChild: !0, ...f, focusable: !r, children: /* @__PURE__ */ u.jsx(
|
|
346
|
+
N.div,
|
|
347
|
+
{
|
|
348
|
+
role: "menuitem",
|
|
349
|
+
"data-highlighted": d ? "" : void 0,
|
|
350
|
+
"aria-disabled": r || void 0,
|
|
351
|
+
"data-disabled": r ? "" : void 0,
|
|
352
|
+
...c,
|
|
353
|
+
ref: p,
|
|
354
|
+
onPointerMove: v(
|
|
355
|
+
e.onPointerMove,
|
|
356
|
+
O((C) => {
|
|
357
|
+
r ? l.onItemLeave(C) : (l.onItemEnter(C), C.defaultPrevented || C.currentTarget.focus({ preventScroll: !0 }));
|
|
358
|
+
})
|
|
359
|
+
),
|
|
360
|
+
onPointerLeave: v(
|
|
361
|
+
e.onPointerLeave,
|
|
362
|
+
O((C) => l.onItemLeave(C))
|
|
363
|
+
),
|
|
364
|
+
onFocus: v(e.onFocus, () => a(!0)),
|
|
365
|
+
onBlur: v(e.onBlur, () => a(!1))
|
|
366
|
+
}
|
|
367
|
+
) })
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
), jn = "MenuCheckboxItem", ye = o.forwardRef(
|
|
372
|
+
(e, t) => {
|
|
373
|
+
const { checked: n = !1, onCheckedChange: r, ...s } = e;
|
|
374
|
+
return /* @__PURE__ */ u.jsx(Ae, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ u.jsx(
|
|
375
|
+
Y,
|
|
376
|
+
{
|
|
377
|
+
role: "menuitemcheckbox",
|
|
378
|
+
"aria-checked": B(n) ? "mixed" : n,
|
|
379
|
+
...s,
|
|
380
|
+
ref: t,
|
|
381
|
+
"data-state": se(n),
|
|
382
|
+
onSelect: v(
|
|
383
|
+
s.onSelect,
|
|
384
|
+
() => r?.(B(n) ? !0 : !n),
|
|
385
|
+
{ checkForDefaultPrevented: !1 }
|
|
386
|
+
)
|
|
387
|
+
}
|
|
388
|
+
) });
|
|
389
|
+
}
|
|
390
|
+
);
|
|
391
|
+
ye.displayName = jn;
|
|
392
|
+
var Ie = "MenuRadioGroup", [On, Dn] = S(
|
|
393
|
+
Ie,
|
|
394
|
+
{ value: void 0, onValueChange: () => {
|
|
395
|
+
} }
|
|
396
|
+
), we = o.forwardRef(
|
|
397
|
+
(e, t) => {
|
|
398
|
+
const { value: n, onValueChange: r, ...s } = e, c = q(r);
|
|
399
|
+
return /* @__PURE__ */ u.jsx(On, { scope: e.__scopeMenu, value: n, onValueChange: c, children: /* @__PURE__ */ u.jsx(te, { ...s, ref: t }) });
|
|
400
|
+
}
|
|
401
|
+
);
|
|
402
|
+
we.displayName = Ie;
|
|
403
|
+
var be = "MenuRadioItem", Te = o.forwardRef(
|
|
404
|
+
(e, t) => {
|
|
405
|
+
const { value: n, ...r } = e, s = Dn(be, e.__scopeMenu), c = n === s.value;
|
|
406
|
+
return /* @__PURE__ */ u.jsx(Ae, { scope: e.__scopeMenu, checked: c, children: /* @__PURE__ */ u.jsx(
|
|
407
|
+
Y,
|
|
408
|
+
{
|
|
409
|
+
role: "menuitemradio",
|
|
410
|
+
"aria-checked": c,
|
|
411
|
+
...r,
|
|
412
|
+
ref: t,
|
|
413
|
+
"data-state": se(c),
|
|
414
|
+
onSelect: v(
|
|
415
|
+
r.onSelect,
|
|
416
|
+
() => s.onValueChange?.(n),
|
|
417
|
+
{ checkForDefaultPrevented: !1 }
|
|
418
|
+
)
|
|
419
|
+
}
|
|
420
|
+
) });
|
|
421
|
+
}
|
|
422
|
+
);
|
|
423
|
+
Te.displayName = be;
|
|
424
|
+
var oe = "MenuItemIndicator", [Ae, Nn] = S(
|
|
425
|
+
oe,
|
|
426
|
+
{ checked: !1 }
|
|
427
|
+
), je = o.forwardRef(
|
|
428
|
+
(e, t) => {
|
|
429
|
+
const { __scopeMenu: n, forceMount: r, ...s } = e, c = Nn(oe, n);
|
|
430
|
+
return /* @__PURE__ */ u.jsx(
|
|
431
|
+
W,
|
|
432
|
+
{
|
|
433
|
+
present: r || B(c.checked) || c.checked === !0,
|
|
434
|
+
children: /* @__PURE__ */ u.jsx(
|
|
435
|
+
N.span,
|
|
436
|
+
{
|
|
437
|
+
...s,
|
|
438
|
+
ref: t,
|
|
439
|
+
"data-state": se(c.checked)
|
|
440
|
+
}
|
|
441
|
+
)
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
);
|
|
446
|
+
je.displayName = oe;
|
|
447
|
+
var kn = "MenuSeparator", Oe = o.forwardRef(
|
|
448
|
+
(e, t) => {
|
|
449
|
+
const { __scopeMenu: n, ...r } = e;
|
|
450
|
+
return /* @__PURE__ */ u.jsx(
|
|
451
|
+
N.div,
|
|
452
|
+
{
|
|
453
|
+
role: "separator",
|
|
454
|
+
"aria-orientation": "horizontal",
|
|
455
|
+
...r,
|
|
456
|
+
ref: t
|
|
457
|
+
}
|
|
458
|
+
);
|
|
459
|
+
}
|
|
460
|
+
);
|
|
461
|
+
Oe.displayName = kn;
|
|
462
|
+
var Fn = "MenuArrow", De = o.forwardRef(
|
|
463
|
+
(e, t) => {
|
|
464
|
+
const { __scopeMenu: n, ...r } = e, s = F(n);
|
|
465
|
+
return /* @__PURE__ */ u.jsx(sn, { ...s, ...r, ref: t });
|
|
466
|
+
}
|
|
467
|
+
);
|
|
468
|
+
De.displayName = Fn;
|
|
469
|
+
var re = "MenuSub", [Ln, Ne] = S(re), ke = (e) => {
|
|
470
|
+
const { __scopeMenu: t, children: n, open: r = !1, onOpenChange: s } = e, c = _(re, t), l = F(t), [f, m] = o.useState(null), [p, d] = o.useState(null), a = q(s);
|
|
471
|
+
return o.useEffect(() => (c.open === !1 && a(!1), () => a(!1)), [c.open, a]), /* @__PURE__ */ u.jsx(he, { ...l, children: /* @__PURE__ */ u.jsx(
|
|
472
|
+
ge,
|
|
473
|
+
{
|
|
474
|
+
scope: t,
|
|
475
|
+
open: r,
|
|
476
|
+
onOpenChange: a,
|
|
477
|
+
content: p,
|
|
478
|
+
onContentChange: d,
|
|
479
|
+
children: /* @__PURE__ */ u.jsx(
|
|
480
|
+
Ln,
|
|
481
|
+
{
|
|
482
|
+
scope: t,
|
|
483
|
+
contentId: de(),
|
|
484
|
+
triggerId: de(),
|
|
485
|
+
trigger: f,
|
|
486
|
+
onTriggerChange: m,
|
|
487
|
+
children: n
|
|
488
|
+
}
|
|
489
|
+
)
|
|
490
|
+
}
|
|
491
|
+
) });
|
|
492
|
+
};
|
|
493
|
+
ke.displayName = re;
|
|
494
|
+
var A = "MenuSubTrigger", Fe = o.forwardRef(
|
|
495
|
+
(e, t) => {
|
|
496
|
+
const n = _(A, e.__scopeMenu), r = L(A, e.__scopeMenu), s = Ne(A, e.__scopeMenu), c = ee(A, e.__scopeMenu), l = o.useRef(null), { pointerGraceTimerRef: f, onPointerGraceIntentChange: m } = c, p = { __scopeMenu: e.__scopeMenu }, d = o.useCallback(() => {
|
|
497
|
+
l.current && window.clearTimeout(l.current), l.current = null;
|
|
498
|
+
}, []);
|
|
499
|
+
return o.useEffect(() => d, [d]), o.useEffect(() => {
|
|
500
|
+
const a = f.current;
|
|
501
|
+
return () => {
|
|
502
|
+
window.clearTimeout(a), m(null);
|
|
503
|
+
};
|
|
504
|
+
}, [f, m]), /* @__PURE__ */ u.jsx(J, { asChild: !0, ...p, children: /* @__PURE__ */ u.jsx(
|
|
505
|
+
Pe,
|
|
506
|
+
{
|
|
507
|
+
id: s.triggerId,
|
|
508
|
+
"aria-haspopup": "menu",
|
|
509
|
+
"aria-expanded": n.open,
|
|
510
|
+
"aria-controls": s.contentId,
|
|
511
|
+
"data-state": Ge(n.open),
|
|
512
|
+
...e,
|
|
513
|
+
ref: pe(t, s.onTriggerChange),
|
|
514
|
+
onClick: (a) => {
|
|
515
|
+
e.onClick?.(a), !(e.disabled || a.defaultPrevented) && (a.currentTarget.focus(), n.open || n.onOpenChange(!0));
|
|
516
|
+
},
|
|
517
|
+
onPointerMove: v(
|
|
518
|
+
e.onPointerMove,
|
|
519
|
+
O((a) => {
|
|
520
|
+
c.onItemEnter(a), !a.defaultPrevented && !e.disabled && !n.open && !l.current && (c.onPointerGraceIntentChange(null), l.current = window.setTimeout(() => {
|
|
521
|
+
n.onOpenChange(!0), d();
|
|
522
|
+
}, 100));
|
|
523
|
+
})
|
|
524
|
+
),
|
|
525
|
+
onPointerLeave: v(
|
|
526
|
+
e.onPointerLeave,
|
|
527
|
+
O((a) => {
|
|
528
|
+
d();
|
|
529
|
+
const h = n.content?.getBoundingClientRect();
|
|
530
|
+
if (h) {
|
|
531
|
+
const g = n.content?.dataset.side, C = g === "right", E = C ? -5 : 5, w = h[C ? "left" : "right"], P = h[C ? "right" : "left"];
|
|
532
|
+
c.onPointerGraceIntentChange({
|
|
533
|
+
area: [
|
|
534
|
+
// Apply a bleed on clientX to ensure that our exit point is
|
|
535
|
+
// consistently within polygon bounds
|
|
536
|
+
{ x: a.clientX + E, y: a.clientY },
|
|
537
|
+
{ x: w, y: h.top },
|
|
538
|
+
{ x: P, y: h.top },
|
|
539
|
+
{ x: P, y: h.bottom },
|
|
540
|
+
{ x: w, y: h.bottom }
|
|
541
|
+
],
|
|
542
|
+
side: g
|
|
543
|
+
}), window.clearTimeout(f.current), f.current = window.setTimeout(
|
|
544
|
+
() => c.onPointerGraceIntentChange(null),
|
|
545
|
+
300
|
|
546
|
+
);
|
|
547
|
+
} else {
|
|
548
|
+
if (c.onTriggerLeave(a), a.defaultPrevented) return;
|
|
549
|
+
c.onPointerGraceIntentChange(null);
|
|
550
|
+
}
|
|
551
|
+
})
|
|
552
|
+
),
|
|
553
|
+
onKeyDown: v(e.onKeyDown, (a) => {
|
|
554
|
+
const h = c.searchRef.current !== "";
|
|
555
|
+
e.disabled || h && a.key === " " || gn[r.dir].includes(a.key) && (n.onOpenChange(!0), n.content?.focus(), a.preventDefault());
|
|
556
|
+
})
|
|
557
|
+
}
|
|
558
|
+
) });
|
|
559
|
+
}
|
|
560
|
+
);
|
|
561
|
+
Fe.displayName = A;
|
|
562
|
+
var Le = "MenuSubContent", Ke = o.forwardRef(
|
|
563
|
+
(e, t) => {
|
|
564
|
+
const n = _e(x, e.__scopeMenu), { forceMount: r = n.forceMount, ...s } = e, c = _(x, e.__scopeMenu), l = L(x, e.__scopeMenu), f = Ne(Le, e.__scopeMenu), m = o.useRef(null), p = D(t, m);
|
|
565
|
+
return /* @__PURE__ */ u.jsx(j.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(W, { present: r || c.open, children: /* @__PURE__ */ u.jsx(j.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(
|
|
566
|
+
ne,
|
|
567
|
+
{
|
|
568
|
+
id: f.contentId,
|
|
569
|
+
"aria-labelledby": f.triggerId,
|
|
570
|
+
...s,
|
|
571
|
+
ref: p,
|
|
572
|
+
align: "start",
|
|
573
|
+
side: l.dir === "rtl" ? "left" : "right",
|
|
574
|
+
disableOutsidePointerEvents: !1,
|
|
575
|
+
disableOutsideScroll: !1,
|
|
576
|
+
trapFocus: !1,
|
|
577
|
+
onOpenAutoFocus: (d) => {
|
|
578
|
+
l.isUsingKeyboardRef.current && m.current?.focus(), d.preventDefault();
|
|
579
|
+
},
|
|
580
|
+
onCloseAutoFocus: (d) => d.preventDefault(),
|
|
581
|
+
onFocusOutside: v(e.onFocusOutside, (d) => {
|
|
582
|
+
d.target !== f.trigger && c.onOpenChange(!1);
|
|
583
|
+
}),
|
|
584
|
+
onEscapeKeyDown: v(e.onEscapeKeyDown, (d) => {
|
|
585
|
+
l.onClose(), d.preventDefault();
|
|
586
|
+
}),
|
|
587
|
+
onKeyDown: v(e.onKeyDown, (d) => {
|
|
588
|
+
const a = d.currentTarget.contains(d.target), h = xn[l.dir].includes(d.key);
|
|
589
|
+
a && h && (c.onOpenChange(!1), f.trigger?.focus(), d.preventDefault());
|
|
590
|
+
})
|
|
591
|
+
}
|
|
592
|
+
) }) }) });
|
|
593
|
+
}
|
|
594
|
+
);
|
|
595
|
+
Ke.displayName = Le;
|
|
596
|
+
function Ge(e) {
|
|
597
|
+
return e ? "open" : "closed";
|
|
598
|
+
}
|
|
599
|
+
function B(e) {
|
|
600
|
+
return e === "indeterminate";
|
|
601
|
+
}
|
|
602
|
+
function se(e) {
|
|
603
|
+
return B(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
604
|
+
}
|
|
605
|
+
function Kn(e) {
|
|
606
|
+
const t = document.activeElement;
|
|
607
|
+
for (const n of e)
|
|
608
|
+
if (n === t || (n.focus(), document.activeElement !== t)) return;
|
|
609
|
+
}
|
|
610
|
+
function Gn(e, t) {
|
|
611
|
+
return e.map((n, r) => e[(t + r) % e.length]);
|
|
612
|
+
}
|
|
613
|
+
function Un(e, t, n) {
|
|
614
|
+
const s = t.length > 1 && Array.from(t).every((p) => p === t[0]) ? t[0] : t, c = n ? e.indexOf(n) : -1;
|
|
615
|
+
let l = Gn(e, Math.max(c, 0));
|
|
616
|
+
s.length === 1 && (l = l.filter((p) => p !== n));
|
|
617
|
+
const m = l.find(
|
|
618
|
+
(p) => p.toLowerCase().startsWith(s.toLowerCase())
|
|
619
|
+
);
|
|
620
|
+
return m !== n ? m : void 0;
|
|
621
|
+
}
|
|
622
|
+
function Vn(e, t) {
|
|
623
|
+
const { x: n, y: r } = e;
|
|
624
|
+
let s = !1;
|
|
625
|
+
for (let c = 0, l = t.length - 1; c < t.length; l = c++) {
|
|
626
|
+
const f = t[c], m = t[l], p = f.x, d = f.y, a = m.x, h = m.y;
|
|
627
|
+
d > r != h > r && n < (a - p) * (r - d) / (h - d) + p && (s = !s);
|
|
628
|
+
}
|
|
629
|
+
return s;
|
|
630
|
+
}
|
|
631
|
+
function Bn(e, t) {
|
|
632
|
+
if (!t) return !1;
|
|
633
|
+
const n = { x: e.clientX, y: e.clientY };
|
|
634
|
+
return Vn(n, t);
|
|
635
|
+
}
|
|
636
|
+
function O(e) {
|
|
637
|
+
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
638
|
+
}
|
|
639
|
+
var st = xe, ct = J, at = Re, ut = Se, it = te, lt = Ee, dt = Y, ft = ye, pt = we, mt = Te, ht = je, Ct = Oe, vt = De, Mt = ke, gt = Fe, xt = Ke;
|
|
640
|
+
export {
|
|
641
|
+
ct as A,
|
|
642
|
+
ut as C,
|
|
643
|
+
it as G,
|
|
644
|
+
dt as I,
|
|
645
|
+
lt as L,
|
|
646
|
+
at as P,
|
|
647
|
+
st as R,
|
|
648
|
+
Ct as S,
|
|
649
|
+
ft as a,
|
|
650
|
+
ht as b,
|
|
651
|
+
rt as c,
|
|
652
|
+
mt as d,
|
|
653
|
+
Mt as e,
|
|
654
|
+
xt as f,
|
|
655
|
+
gt as g,
|
|
656
|
+
pt as h,
|
|
657
|
+
vt as i
|
|
658
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const l=require("react"),Q=require("./index-cwZN7ZY3.cjs"),T=require("./index-
|
|
1
|
+
"use strict";const l=require("react"),Q=require("./index-cwZN7ZY3.cjs"),T=require("./index-CzRiuk60.cjs"),W=require("./index-_XxjJPRD.cjs"),N=require("./index-BWaO7kQK.cjs"),q=require("./index-CocSS1YK.cjs"),v=require("./index-Cmx9M9cZ.cjs"),X=require("./index-WIv2ndLu.cjs"),n=require("./jsx-runtime-BB_1_6y_.cjs");var d="Accordion",Z=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[y,ee,oe]=T.createCollection(d),[R]=Q.createContextScope(d,[oe,v.createCollapsibleScope]),k=v.createCollapsibleScope(),M=l.forwardRef((o,c)=>{const{type:e,...t}=o,i=t,r=t;return n.jsxRuntimeExports.jsx(y.Provider,{scope:o.__scopeAccordion,children:e==="multiple"?n.jsxRuntimeExports.jsx(ce,{...r,ref:c}):n.jsxRuntimeExports.jsx(ne,{...i,ref:c})})});M.displayName=d;var[H,re]=R(d),[V,te]=R(d,{collapsible:!1}),ne=l.forwardRef((o,c)=>{const{value:e,defaultValue:t,onValueChange:i=()=>{},collapsible:r=!1,...a}=o,[s,u]=N.useControllableState({prop:e,defaultProp:t??"",onChange:i,caller:d});return n.jsxRuntimeExports.jsx(H,{scope:o.__scopeAccordion,value:l.useMemo(()=>s?[s]:[],[s]),onItemOpen:u,onItemClose:l.useCallback(()=>r&&u(""),[r,u]),children:n.jsxRuntimeExports.jsx(V,{scope:o.__scopeAccordion,collapsible:r,children:n.jsxRuntimeExports.jsx($,{...a,ref:c})})})}),ce=l.forwardRef((o,c)=>{const{value:e,defaultValue:t,onValueChange:i=()=>{},...r}=o,[a,s]=N.useControllableState({prop:e,defaultProp:t??[],onChange:i,caller:d}),u=l.useCallback(f=>s((x=[])=>[...x,f]),[s]),m=l.useCallback(f=>s((x=[])=>x.filter(b=>b!==f)),[s]);return n.jsxRuntimeExports.jsx(H,{scope:o.__scopeAccordion,value:a,onItemOpen:u,onItemClose:m,children:n.jsxRuntimeExports.jsx(V,{scope:o.__scopeAccordion,collapsible:!0,children:n.jsxRuntimeExports.jsx($,{...r,ref:c})})})}),[ie,j]=R(d),$=l.forwardRef((o,c)=>{const{__scopeAccordion:e,disabled:t,dir:i,orientation:r="vertical",...a}=o,s=l.useRef(null),u=W.useComposedRefs(s,c),m=ee(e),x=T.useDirection(i)==="ltr",b=N.composeEventHandlers(o.onKeyDown,C=>{if(!Z.includes(C.key))return;const F=C.target,I=m().filter(P=>!P.ref.current?.disabled),A=I.findIndex(P=>P.ref.current===F),O=I.length;if(A===-1)return;C.preventDefault();let p=A;const h=0,E=O-1,_=()=>{p=A+1,p>E&&(p=h)},w=()=>{p=A-1,p<h&&(p=E)};switch(C.key){case"Home":p=h;break;case"End":p=E;break;case"ArrowRight":r==="horizontal"&&(x?_():w());break;case"ArrowDown":r==="vertical"&&_();break;case"ArrowLeft":r==="horizontal"&&(x?w():_());break;case"ArrowUp":r==="vertical"&&w();break}const J=p%O;I[J].ref.current?.focus()});return n.jsxRuntimeExports.jsx(ie,{scope:e,disabled:t,direction:i,orientation:r,children:n.jsxRuntimeExports.jsx(y.Slot,{scope:e,children:n.jsxRuntimeExports.jsx(q.Primitive.div,{...a,"data-orientation":r,ref:u,onKeyDown:t?void 0:b})})})}),g="AccordionItem",[se,D]=R(g),K=l.forwardRef((o,c)=>{const{__scopeAccordion:e,value:t,...i}=o,r=j(g,e),a=re(g,e),s=k(e),u=X.useId(),m=t&&a.value.includes(t)||!1,f=r.disabled||o.disabled;return n.jsxRuntimeExports.jsx(se,{scope:e,open:m,disabled:f,triggerId:u,children:n.jsxRuntimeExports.jsx(v.Root,{"data-orientation":r.orientation,"data-state":B(m),...s,...i,ref:c,disabled:f,open:m,onOpenChange:x=>{x?a.onItemOpen(t):a.onItemClose(t)}})})});K.displayName=g;var L="AccordionHeader",z=l.forwardRef((o,c)=>{const{__scopeAccordion:e,...t}=o,i=j(d,e),r=D(L,e);return n.jsxRuntimeExports.jsx(q.Primitive.h3,{"data-orientation":i.orientation,"data-state":B(r.open),"data-disabled":r.disabled?"":void 0,...t,ref:c})});z.displayName=L;var S="AccordionTrigger",G=l.forwardRef((o,c)=>{const{__scopeAccordion:e,...t}=o,i=j(d,e),r=D(S,e),a=te(S,e),s=k(e);return n.jsxRuntimeExports.jsx(y.ItemSlot,{scope:e,children:n.jsxRuntimeExports.jsx(v.Trigger,{"aria-disabled":r.open&&!a.collapsible||void 0,"data-orientation":i.orientation,id:r.triggerId,...s,...t,ref:c})})});G.displayName=S;var U="AccordionContent",Y=l.forwardRef((o,c)=>{const{__scopeAccordion:e,...t}=o,i=j(d,e),r=D(U,e),a=k(e);return n.jsxRuntimeExports.jsx(v.Content,{role:"region","aria-labelledby":r.triggerId,"data-orientation":i.orientation,...a,...t,ref:c,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...o.style}})});Y.displayName=U;function B(o){return o?"open":"closed"}var ae=M,le=K,de=z,ue=G,pe=Y;exports.Content2=pe;exports.Header=de;exports.Item=le;exports.Root2=ae;exports.Trigger2=ue;
|