@adamosuiteservices/ui 2.20.2 → 2.20.3
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/checkbox-BHStM029.cjs +24 -0
- package/dist/{checkbox-DPlUjwLi.js → checkbox-DX8b_6kG.js} +4 -3
- 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-DylTjGrw.cjs → combobox-BURhN76t.cjs} +1 -1
- package/dist/{combobox-DG9u4g84.js → combobox-BrHVXnf2.js} +3 -3
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/context-menu.cjs +8 -8
- package/dist/context-menu.js +56 -55
- package/dist/date-picker-selector.cjs +1 -1
- package/dist/date-picker-selector.js +2 -2
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu.cjs +9 -9
- package/dist/dropdown-menu.js +33 -32
- package/dist/full-screen-loader.cjs +4 -4
- package/dist/full-screen-loader.js +27 -24
- package/dist/hover-card.cjs +2 -2
- package/dist/hover-card.js +12 -11
- package/dist/index-1Io41IIt.cjs +1 -0
- package/dist/index-437EL2iq.js +52 -0
- package/dist/index-B695uy69.js +9 -0
- package/dist/index-BE-HFcQ8.cjs +1 -0
- package/dist/{index-BPOsnOxS.js → index-BM2A-WRV.js} +1 -1
- package/dist/index-BOnhen57.cjs +1 -0
- package/dist/{index-D_hmhfRp.js → index-BPnOqaWN.js} +9 -8
- package/dist/index-BqyOu62e.cjs +1 -0
- package/dist/index-C8aODXfJ.cjs +1 -0
- package/dist/index-CFB4VzSW.js +542 -0
- package/dist/index-CgAmFB15.cjs +1 -0
- package/dist/{index-B76LQ4E5.js → index-CinpJ0oP.js} +24 -23
- package/dist/{index-wujanfX3.js → index-Cpaqurwq.js} +191 -190
- package/dist/{index-B6gxHWt9.js → index-CwrPuu3I.js} +15 -14
- package/dist/index-D3xJARPa.cjs +1 -0
- package/dist/index-DSj2iNTW.js +137 -0
- package/dist/{index-Ce7JfyIP.js → index-DWrql5dh.js} +11 -10
- package/dist/{index-BIydBVaH.js → index-E5ek046p.js} +78 -76
- package/dist/{index-BaCYnOIG.cjs → index-L8BhH23Y.cjs} +1 -1
- package/dist/index-ZzRl2Lfu.cjs +5 -0
- package/dist/index-_TfuLupy.cjs +41 -0
- package/dist/index-cBJ7G45l.cjs +1 -0
- package/dist/popover-Dod16CM1.cjs +15 -0
- package/dist/{popover-DcQ18EVl.js → popover-tP2NoMYx.js} +84 -82
- package/dist/popover.cjs +1 -1
- package/dist/popover.js +1 -1
- package/dist/radio-group.cjs +3 -3
- package/dist/radio-group.js +10 -9
- package/dist/select.cjs +8 -8
- package/dist/select.js +21 -19
- package/dist/{sheet-Cp6JGhWC.cjs → sheet-DR1nAs9U.cjs} +1 -1
- package/dist/{sheet-hWerE8S1.js → sheet-UNggtdu3.js} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.cjs +1 -1
- package/dist/sidebar.js +1 -1
- package/dist/slider.cjs +5 -5
- package/dist/slider.js +7 -6
- package/dist/switch.cjs +3 -3
- package/dist/switch.js +8 -7
- 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/toggle.cjs +2 -2
- package/dist/toggle.js +6 -5
- package/dist/tooltip.cjs +3 -3
- package/dist/tooltip.js +23 -22
- package/docs/components/layout/full-screen-loader.md +16 -5
- package/package.json +4 -2
- package/dist/checkbox-CIzBdqN7.cjs +0 -24
- package/dist/index-8iwAKZIp.cjs +0 -1
- package/dist/index-BWaO7kQK.cjs +0 -1
- package/dist/index-BnkHpTJs.cjs +0 -1
- package/dist/index-C0UREtMP.js +0 -59
- package/dist/index-C2P2kXMc.cjs +0 -41
- package/dist/index-CC6DBo2g.cjs +0 -1
- package/dist/index-CRWn-2fF.cjs +0 -1
- package/dist/index-Ca99LLZF.cjs +0 -5
- package/dist/index-e0gNU5O1.js +0 -675
- package/dist/index-i5lLg35-.cjs +0 -1
- package/dist/popover-cGp_rNLg.cjs +0 -15
|
@@ -1,74 +1,75 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as o from "react";
|
|
3
|
-
import { c as v } from "./index-
|
|
3
|
+
import { c as v } from "./index-B695uy69.js";
|
|
4
4
|
import { c as ze, u as Ze } from "./index-CmWhhuj7.js";
|
|
5
5
|
import { c as pe, u as D } from "./index-DLcqcWxM.js";
|
|
6
6
|
import { c as qe } from "./index-FxyLF8MY.js";
|
|
7
|
-
import { D as Je } from "./index-
|
|
8
|
-
import { h as Qe, u as
|
|
7
|
+
import { D as Je } from "./index-BM2A-WRV.js";
|
|
8
|
+
import { h as Qe, u as et, R as tt } from "./index-CFB4VzSW.js";
|
|
9
|
+
import { F as nt } from "./index-DSj2iNTW.js";
|
|
9
10
|
import { u as de } from "./index-Cv867SGx.js";
|
|
10
|
-
import { c as me, R as he, A as
|
|
11
|
-
import { P as
|
|
11
|
+
import { c as me, R as he, A as ot, C as rt, a as st } from "./index-BAEhLEFF.js";
|
|
12
|
+
import { P as ct } from "./index-CZWDxvEo.js";
|
|
12
13
|
import { P as W } from "./index-CSFEzRxy.js";
|
|
13
|
-
import { P as N, d as
|
|
14
|
-
import { c as Ce, I as
|
|
14
|
+
import { P as N, d as at } from "./index-BMWt1NBG.js";
|
|
15
|
+
import { c as Ce, I as ut, R as it } from "./index-CwrPuu3I.js";
|
|
15
16
|
import { j as u } from "./jsx-runtime-BzflLqGi.js";
|
|
16
17
|
import { u as q } from "./index-0ioNhtNM.js";
|
|
17
18
|
// @__NO_SIDE_EFFECTS__
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
const { children: c, ...l } = r, f = o.Children.toArray(c), m = f.find(
|
|
19
|
+
function lt(e) {
|
|
20
|
+
const n = /* @__PURE__ */ dt(e), t = o.forwardRef((r, s) => {
|
|
21
|
+
const { children: c, ...l } = r, f = o.Children.toArray(c), m = f.find(pt);
|
|
21
22
|
if (m) {
|
|
22
23
|
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);
|
|
23
|
-
return /* @__PURE__ */ u.jsx(
|
|
24
|
+
return /* @__PURE__ */ u.jsx(n, { ...l, ref: s, children: o.isValidElement(p) ? o.cloneElement(p, void 0, d) : null });
|
|
24
25
|
}
|
|
25
|
-
return /* @__PURE__ */ u.jsx(
|
|
26
|
+
return /* @__PURE__ */ u.jsx(n, { ...l, ref: s, children: c });
|
|
26
27
|
});
|
|
27
|
-
return
|
|
28
|
+
return t.displayName = `${e}.Slot`, t;
|
|
28
29
|
}
|
|
29
30
|
// @__NO_SIDE_EFFECTS__
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
const { children: s, ...c } =
|
|
31
|
+
function dt(e) {
|
|
32
|
+
const n = o.forwardRef((t, r) => {
|
|
33
|
+
const { children: s, ...c } = t;
|
|
33
34
|
if (o.isValidElement(s)) {
|
|
34
|
-
const l =
|
|
35
|
+
const l = ht(s), f = mt(c, s.props);
|
|
35
36
|
return s.type !== o.Fragment && (f.ref = r ? pe(r, l) : l), o.cloneElement(s, f);
|
|
36
37
|
}
|
|
37
38
|
return o.Children.count(s) > 1 ? o.Children.only(null) : null;
|
|
38
39
|
});
|
|
39
|
-
return
|
|
40
|
+
return n.displayName = `${e}.SlotClone`, n;
|
|
40
41
|
}
|
|
41
|
-
var
|
|
42
|
-
function
|
|
43
|
-
return o.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId ===
|
|
42
|
+
var ft = Symbol("radix.slottable");
|
|
43
|
+
function pt(e) {
|
|
44
|
+
return o.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === ft;
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
-
const
|
|
47
|
-
for (const r in
|
|
48
|
-
const s = e[r], c =
|
|
49
|
-
/^on[A-Z]/.test(r) ? s && c ?
|
|
46
|
+
function mt(e, n) {
|
|
47
|
+
const t = { ...n };
|
|
48
|
+
for (const r in n) {
|
|
49
|
+
const s = e[r], c = n[r];
|
|
50
|
+
/^on[A-Z]/.test(r) ? s && c ? t[r] = (...f) => {
|
|
50
51
|
const m = c(...f);
|
|
51
52
|
return s(...f), m;
|
|
52
|
-
} : s && (
|
|
53
|
+
} : s && (t[r] = s) : r === "style" ? t[r] = { ...s, ...c } : r === "className" && (t[r] = [s, c].filter(Boolean).join(" "));
|
|
53
54
|
}
|
|
54
|
-
return { ...e, ...
|
|
55
|
+
return { ...e, ...t };
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
-
let
|
|
58
|
-
return
|
|
57
|
+
function ht(e) {
|
|
58
|
+
let n = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, t = n && "isReactWarning" in n && n.isReactWarning;
|
|
59
|
+
return t ? e.ref : (n = Object.getOwnPropertyDescriptor(e, "ref")?.get, t = n && "isReactWarning" in n && n.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
|
|
59
60
|
}
|
|
60
|
-
var Z = ["Enter", " "],
|
|
61
|
+
var Z = ["Enter", " "], Ct = ["ArrowDown", "PageUp", "Home"], ve = ["ArrowUp", "PageDown", "End"], vt = [...Ct, ...ve], Mt = {
|
|
61
62
|
ltr: [...Z, "ArrowRight"],
|
|
62
63
|
rtl: [...Z, "ArrowLeft"]
|
|
63
|
-
},
|
|
64
|
+
}, gt = {
|
|
64
65
|
ltr: ["ArrowLeft"],
|
|
65
66
|
rtl: ["ArrowRight"]
|
|
66
|
-
}, k = "Menu", [j,
|
|
67
|
-
|
|
67
|
+
}, k = "Menu", [j, xt, _t] = ze(k), [S, rn] = qe(k, [
|
|
68
|
+
_t,
|
|
68
69
|
me,
|
|
69
70
|
Ce
|
|
70
|
-
]), F = me(), Me = Ce(), [ge, _] = S(k), [
|
|
71
|
-
const { __scopeMenu:
|
|
71
|
+
]), F = me(), Me = Ce(), [ge, _] = S(k), [Rt, L] = S(k), xe = (e) => {
|
|
72
|
+
const { __scopeMenu: n, open: t = !1, children: r, dir: s, onOpenChange: c, modal: l = !0 } = e, f = F(n), [m, p] = o.useState(null), d = o.useRef(!1), a = q(c), h = Ze(s);
|
|
72
73
|
return o.useEffect(() => {
|
|
73
74
|
const g = () => {
|
|
74
75
|
d.current = !0, document.addEventListener("pointerdown", C, { capture: !0, once: !0 }), document.addEventListener("pointermove", C, { capture: !0, once: !0 });
|
|
@@ -79,15 +80,15 @@ var Z = ["Enter", " "], vn = ["ArrowDown", "PageUp", "Home"], ve = ["ArrowUp", "
|
|
|
79
80
|
}, []), /* @__PURE__ */ u.jsx(he, { ...f, children: /* @__PURE__ */ u.jsx(
|
|
80
81
|
ge,
|
|
81
82
|
{
|
|
82
|
-
scope:
|
|
83
|
-
open:
|
|
83
|
+
scope: n,
|
|
84
|
+
open: t,
|
|
84
85
|
onOpenChange: a,
|
|
85
86
|
content: m,
|
|
86
87
|
onContentChange: p,
|
|
87
88
|
children: /* @__PURE__ */ u.jsx(
|
|
88
|
-
|
|
89
|
+
Rt,
|
|
89
90
|
{
|
|
90
|
-
scope:
|
|
91
|
+
scope: n,
|
|
91
92
|
onClose: o.useCallback(() => a(!1), [a]),
|
|
92
93
|
isUsingKeyboardRef: d,
|
|
93
94
|
dir: h,
|
|
@@ -99,65 +100,65 @@ var Z = ["Enter", " "], vn = ["ArrowDown", "PageUp", "Home"], ve = ["ArrowUp", "
|
|
|
99
100
|
) });
|
|
100
101
|
};
|
|
101
102
|
xe.displayName = k;
|
|
102
|
-
var
|
|
103
|
-
(e,
|
|
104
|
-
const { __scopeMenu:
|
|
105
|
-
return /* @__PURE__ */ u.jsx(
|
|
103
|
+
var St = "MenuAnchor", J = o.forwardRef(
|
|
104
|
+
(e, n) => {
|
|
105
|
+
const { __scopeMenu: t, ...r } = e, s = F(t);
|
|
106
|
+
return /* @__PURE__ */ u.jsx(ot, { ...s, ...r, ref: n });
|
|
106
107
|
}
|
|
107
108
|
);
|
|
108
|
-
J.displayName =
|
|
109
|
-
var Q = "MenuPortal", [
|
|
109
|
+
J.displayName = St;
|
|
110
|
+
var Q = "MenuPortal", [Et, _e] = S(Q, {
|
|
110
111
|
forceMount: void 0
|
|
111
112
|
}), Re = (e) => {
|
|
112
|
-
const { __scopeMenu:
|
|
113
|
-
return /* @__PURE__ */ u.jsx(
|
|
113
|
+
const { __scopeMenu: n, forceMount: t, children: r, container: s } = e, c = _(Q, n);
|
|
114
|
+
return /* @__PURE__ */ u.jsx(Et, { scope: n, forceMount: t, children: /* @__PURE__ */ u.jsx(W, { present: t || c.open, children: /* @__PURE__ */ u.jsx(ct, { asChild: !0, container: s, children: r }) }) });
|
|
114
115
|
};
|
|
115
116
|
Re.displayName = Q;
|
|
116
|
-
var x = "MenuContent", [
|
|
117
|
-
(e,
|
|
118
|
-
const
|
|
119
|
-
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(
|
|
117
|
+
var x = "MenuContent", [Pt, ee] = S(x), Se = o.forwardRef(
|
|
118
|
+
(e, n) => {
|
|
119
|
+
const t = _e(x, e.__scopeMenu), { forceMount: r = t.forceMount, ...s } = e, c = _(x, e.__scopeMenu), l = L(x, e.__scopeMenu);
|
|
120
|
+
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(yt, { ...s, ref: n }) : /* @__PURE__ */ u.jsx(It, { ...s, ref: n }) }) }) });
|
|
120
121
|
}
|
|
121
|
-
),
|
|
122
|
-
(e,
|
|
123
|
-
const
|
|
122
|
+
), yt = o.forwardRef(
|
|
123
|
+
(e, n) => {
|
|
124
|
+
const t = _(x, e.__scopeMenu), r = o.useRef(null), s = D(n, r);
|
|
124
125
|
return o.useEffect(() => {
|
|
125
126
|
const c = r.current;
|
|
126
127
|
if (c) return Qe(c);
|
|
127
128
|
}, []), /* @__PURE__ */ u.jsx(
|
|
128
|
-
|
|
129
|
+
te,
|
|
129
130
|
{
|
|
130
131
|
...e,
|
|
131
132
|
ref: s,
|
|
132
|
-
trapFocus:
|
|
133
|
-
disableOutsidePointerEvents:
|
|
133
|
+
trapFocus: t.open,
|
|
134
|
+
disableOutsidePointerEvents: t.open,
|
|
134
135
|
disableOutsideScroll: !0,
|
|
135
136
|
onFocusOutside: v(
|
|
136
137
|
e.onFocusOutside,
|
|
137
138
|
(c) => c.preventDefault(),
|
|
138
139
|
{ checkForDefaultPrevented: !1 }
|
|
139
140
|
),
|
|
140
|
-
onDismiss: () =>
|
|
141
|
+
onDismiss: () => t.onOpenChange(!1)
|
|
141
142
|
}
|
|
142
143
|
);
|
|
143
144
|
}
|
|
144
|
-
),
|
|
145
|
-
const
|
|
145
|
+
), It = o.forwardRef((e, n) => {
|
|
146
|
+
const t = _(x, e.__scopeMenu);
|
|
146
147
|
return /* @__PURE__ */ u.jsx(
|
|
147
|
-
|
|
148
|
+
te,
|
|
148
149
|
{
|
|
149
150
|
...e,
|
|
150
|
-
ref:
|
|
151
|
+
ref: n,
|
|
151
152
|
trapFocus: !1,
|
|
152
153
|
disableOutsidePointerEvents: !1,
|
|
153
154
|
disableOutsideScroll: !1,
|
|
154
|
-
onDismiss: () =>
|
|
155
|
+
onDismiss: () => t.onOpenChange(!1)
|
|
155
156
|
}
|
|
156
157
|
);
|
|
157
|
-
}),
|
|
158
|
-
(e,
|
|
158
|
+
}), wt = /* @__PURE__ */ lt("MenuContent.ScrollLock"), te = o.forwardRef(
|
|
159
|
+
(e, n) => {
|
|
159
160
|
const {
|
|
160
|
-
__scopeMenu:
|
|
161
|
+
__scopeMenu: t,
|
|
161
162
|
loop: r = !1,
|
|
162
163
|
trapFocus: s,
|
|
163
164
|
onOpenAutoFocus: c,
|
|
@@ -171,18 +172,18 @@ var x = "MenuContent", [yn, ee] = S(x), Se = o.forwardRef(
|
|
|
171
172
|
onDismiss: g,
|
|
172
173
|
disableOutsideScroll: C,
|
|
173
174
|
...E
|
|
174
|
-
} = e, w = _(x,
|
|
175
|
-
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 =
|
|
175
|
+
} = e, w = _(x, t), P = L(x, t), Ue = F(t), Ve = Me(t), ce = xt(t), [Be, ae] = o.useState(null), K = o.useRef(null), We = D(n, 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 ? tt : o.Fragment, He = C ? { as: wt, allowPinchZoom: !0 } : void 0, $e = (i) => {
|
|
176
|
+
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 = Gt(z, I, $), T = R.find((M) => M.textValue === ie)?.ref.current;
|
|
176
177
|
(function M(le) {
|
|
177
178
|
U.current = le, window.clearTimeout(G.current), le !== "" && (G.current = window.setTimeout(() => M(""), 1e3));
|
|
178
179
|
})(I), T && setTimeout(() => T.focus());
|
|
179
180
|
};
|
|
180
|
-
o.useEffect(() => () => window.clearTimeout(G.current), []),
|
|
181
|
-
const y = o.useCallback((i) => ue.current === X.current?.side &&
|
|
181
|
+
o.useEffect(() => () => window.clearTimeout(G.current), []), et();
|
|
182
|
+
const y = o.useCallback((i) => ue.current === X.current?.side && Vt(i, X.current?.area), []);
|
|
182
183
|
return /* @__PURE__ */ u.jsx(
|
|
183
|
-
|
|
184
|
+
Pt,
|
|
184
185
|
{
|
|
185
|
-
scope:
|
|
186
|
+
scope: t,
|
|
186
187
|
searchRef: U,
|
|
187
188
|
onItemEnter: o.useCallback(
|
|
188
189
|
(i) => {
|
|
@@ -207,7 +208,7 @@ var x = "MenuContent", [yn, ee] = S(x), Se = o.forwardRef(
|
|
|
207
208
|
X.current = i;
|
|
208
209
|
}, []),
|
|
209
210
|
children: /* @__PURE__ */ u.jsx(Xe, { ...He, children: /* @__PURE__ */ u.jsx(
|
|
210
|
-
|
|
211
|
+
nt,
|
|
211
212
|
{
|
|
212
213
|
asChild: !0,
|
|
213
214
|
trapped: s,
|
|
@@ -226,7 +227,7 @@ var x = "MenuContent", [yn, ee] = S(x), Se = o.forwardRef(
|
|
|
226
227
|
onInteractOutside: h,
|
|
227
228
|
onDismiss: g,
|
|
228
229
|
children: /* @__PURE__ */ u.jsx(
|
|
229
|
-
|
|
230
|
+
it,
|
|
230
231
|
{
|
|
231
232
|
asChild: !0,
|
|
232
233
|
...Ve,
|
|
@@ -240,7 +241,7 @@ var x = "MenuContent", [yn, ee] = S(x), Se = o.forwardRef(
|
|
|
240
241
|
}),
|
|
241
242
|
preventScrollOnEntryFocus: !0,
|
|
242
243
|
children: /* @__PURE__ */ u.jsx(
|
|
243
|
-
|
|
244
|
+
rt,
|
|
244
245
|
{
|
|
245
246
|
role: "menu",
|
|
246
247
|
"aria-orientation": "vertical",
|
|
@@ -255,10 +256,10 @@ var x = "MenuContent", [yn, ee] = S(x), Se = o.forwardRef(
|
|
|
255
256
|
const R = i.target.closest("[data-radix-menu-content]") === i.currentTarget, b = i.ctrlKey || i.altKey || i.metaKey, $ = i.key.length === 1;
|
|
256
257
|
R && (i.key === "Tab" && i.preventDefault(), !b && $ && $e(i.key));
|
|
257
258
|
const z = K.current;
|
|
258
|
-
if (i.target !== z || !
|
|
259
|
+
if (i.target !== z || !vt.includes(i.key)) return;
|
|
259
260
|
i.preventDefault();
|
|
260
261
|
const T = ce().filter((M) => !M.disabled).map((M) => M.ref.current);
|
|
261
|
-
ve.includes(i.key) && T.reverse(),
|
|
262
|
+
ve.includes(i.key) && T.reverse(), Lt(T);
|
|
262
263
|
}),
|
|
263
264
|
onBlur: v(e.onBlur, (i) => {
|
|
264
265
|
i.currentTarget.contains(i.target) || (window.clearTimeout(G.current), U.current = "");
|
|
@@ -286,27 +287,27 @@ var x = "MenuContent", [yn, ee] = S(x), Se = o.forwardRef(
|
|
|
286
287
|
}
|
|
287
288
|
);
|
|
288
289
|
Se.displayName = x;
|
|
289
|
-
var
|
|
290
|
-
(e,
|
|
291
|
-
const { __scopeMenu:
|
|
292
|
-
return /* @__PURE__ */ u.jsx(N.div, { role: "group", ...r, ref:
|
|
290
|
+
var bt = "MenuGroup", ne = o.forwardRef(
|
|
291
|
+
(e, n) => {
|
|
292
|
+
const { __scopeMenu: t, ...r } = e;
|
|
293
|
+
return /* @__PURE__ */ u.jsx(N.div, { role: "group", ...r, ref: n });
|
|
293
294
|
}
|
|
294
295
|
);
|
|
295
|
-
|
|
296
|
-
var
|
|
297
|
-
(e,
|
|
298
|
-
const { __scopeMenu:
|
|
299
|
-
return /* @__PURE__ */ u.jsx(N.div, { ...r, ref:
|
|
296
|
+
ne.displayName = bt;
|
|
297
|
+
var Tt = "MenuLabel", Ee = o.forwardRef(
|
|
298
|
+
(e, n) => {
|
|
299
|
+
const { __scopeMenu: t, ...r } = e;
|
|
300
|
+
return /* @__PURE__ */ u.jsx(N.div, { ...r, ref: n });
|
|
300
301
|
}
|
|
301
302
|
);
|
|
302
|
-
Ee.displayName =
|
|
303
|
+
Ee.displayName = Tt;
|
|
303
304
|
var V = "MenuItem", fe = "menu.itemSelect", Y = o.forwardRef(
|
|
304
|
-
(e,
|
|
305
|
-
const { disabled:
|
|
305
|
+
(e, n) => {
|
|
306
|
+
const { disabled: t = !1, onSelect: r, ...s } = e, c = o.useRef(null), l = L(V, e.__scopeMenu), f = ee(V, e.__scopeMenu), m = D(n, c), p = o.useRef(!1), d = () => {
|
|
306
307
|
const a = c.current;
|
|
307
|
-
if (!
|
|
308
|
+
if (!t && a) {
|
|
308
309
|
const h = new CustomEvent(fe, { bubbles: !0, cancelable: !0 });
|
|
309
|
-
a.addEventListener(fe, (g) => r?.(g), { once: !0 }),
|
|
310
|
+
a.addEventListener(fe, (g) => r?.(g), { once: !0 }), at(a, h), h.defaultPrevented ? p.current = !1 : l.onClose();
|
|
310
311
|
}
|
|
311
312
|
};
|
|
312
313
|
return /* @__PURE__ */ u.jsx(
|
|
@@ -314,7 +315,7 @@ var V = "MenuItem", fe = "menu.itemSelect", Y = o.forwardRef(
|
|
|
314
315
|
{
|
|
315
316
|
...s,
|
|
316
317
|
ref: m,
|
|
317
|
-
disabled:
|
|
318
|
+
disabled: t,
|
|
318
319
|
onClick: v(e.onClick, d),
|
|
319
320
|
onPointerDown: (a) => {
|
|
320
321
|
e.onPointerDown?.(a), p.current = !0;
|
|
@@ -324,7 +325,7 @@ var V = "MenuItem", fe = "menu.itemSelect", Y = o.forwardRef(
|
|
|
324
325
|
}),
|
|
325
326
|
onKeyDown: v(e.onKeyDown, (a) => {
|
|
326
327
|
const h = f.searchRef.current !== "";
|
|
327
|
-
|
|
328
|
+
t || h && a.key === " " || Z.includes(a.key) && (a.currentTarget.click(), a.preventDefault());
|
|
328
329
|
})
|
|
329
330
|
}
|
|
330
331
|
);
|
|
@@ -332,18 +333,18 @@ var V = "MenuItem", fe = "menu.itemSelect", Y = o.forwardRef(
|
|
|
332
333
|
);
|
|
333
334
|
Y.displayName = V;
|
|
334
335
|
var Pe = o.forwardRef(
|
|
335
|
-
(e,
|
|
336
|
-
const { __scopeMenu:
|
|
336
|
+
(e, n) => {
|
|
337
|
+
const { __scopeMenu: t, disabled: r = !1, textValue: s, ...c } = e, l = ee(V, t), f = Me(t), m = o.useRef(null), p = D(n, m), [d, a] = o.useState(!1), [h, g] = o.useState("");
|
|
337
338
|
return o.useEffect(() => {
|
|
338
339
|
const C = m.current;
|
|
339
340
|
C && g((C.textContent ?? "").trim());
|
|
340
341
|
}, [c.children]), /* @__PURE__ */ u.jsx(
|
|
341
342
|
j.ItemSlot,
|
|
342
343
|
{
|
|
343
|
-
scope:
|
|
344
|
+
scope: t,
|
|
344
345
|
disabled: r,
|
|
345
346
|
textValue: s ?? h,
|
|
346
|
-
children: /* @__PURE__ */ u.jsx(
|
|
347
|
+
children: /* @__PURE__ */ u.jsx(ut, { asChild: !0, ...f, focusable: !r, children: /* @__PURE__ */ u.jsx(
|
|
347
348
|
N.div,
|
|
348
349
|
{
|
|
349
350
|
role: "menuitem",
|
|
@@ -369,52 +370,52 @@ var Pe = o.forwardRef(
|
|
|
369
370
|
}
|
|
370
371
|
);
|
|
371
372
|
}
|
|
372
|
-
),
|
|
373
|
-
(e,
|
|
374
|
-
const { checked:
|
|
375
|
-
return /* @__PURE__ */ u.jsx(Ae, { scope: e.__scopeMenu, checked:
|
|
373
|
+
), At = "MenuCheckboxItem", ye = o.forwardRef(
|
|
374
|
+
(e, n) => {
|
|
375
|
+
const { checked: t = !1, onCheckedChange: r, ...s } = e;
|
|
376
|
+
return /* @__PURE__ */ u.jsx(Ae, { scope: e.__scopeMenu, checked: t, children: /* @__PURE__ */ u.jsx(
|
|
376
377
|
Y,
|
|
377
378
|
{
|
|
378
379
|
role: "menuitemcheckbox",
|
|
379
|
-
"aria-checked": B(
|
|
380
|
+
"aria-checked": B(t) ? "mixed" : t,
|
|
380
381
|
...s,
|
|
381
|
-
ref:
|
|
382
|
-
"data-state": se(
|
|
382
|
+
ref: n,
|
|
383
|
+
"data-state": se(t),
|
|
383
384
|
onSelect: v(
|
|
384
385
|
s.onSelect,
|
|
385
|
-
() => r?.(B(
|
|
386
|
+
() => r?.(B(t) ? !0 : !t),
|
|
386
387
|
{ checkForDefaultPrevented: !1 }
|
|
387
388
|
)
|
|
388
389
|
}
|
|
389
390
|
) });
|
|
390
391
|
}
|
|
391
392
|
);
|
|
392
|
-
ye.displayName =
|
|
393
|
-
var Ie = "MenuRadioGroup", [
|
|
393
|
+
ye.displayName = At;
|
|
394
|
+
var Ie = "MenuRadioGroup", [jt, Ot] = S(
|
|
394
395
|
Ie,
|
|
395
396
|
{ value: void 0, onValueChange: () => {
|
|
396
397
|
} }
|
|
397
398
|
), we = o.forwardRef(
|
|
398
|
-
(e,
|
|
399
|
-
const { value:
|
|
400
|
-
return /* @__PURE__ */ u.jsx(
|
|
399
|
+
(e, n) => {
|
|
400
|
+
const { value: t, onValueChange: r, ...s } = e, c = q(r);
|
|
401
|
+
return /* @__PURE__ */ u.jsx(jt, { scope: e.__scopeMenu, value: t, onValueChange: c, children: /* @__PURE__ */ u.jsx(ne, { ...s, ref: n }) });
|
|
401
402
|
}
|
|
402
403
|
);
|
|
403
404
|
we.displayName = Ie;
|
|
404
405
|
var be = "MenuRadioItem", Te = o.forwardRef(
|
|
405
|
-
(e,
|
|
406
|
-
const { value:
|
|
406
|
+
(e, n) => {
|
|
407
|
+
const { value: t, ...r } = e, s = Ot(be, e.__scopeMenu), c = t === s.value;
|
|
407
408
|
return /* @__PURE__ */ u.jsx(Ae, { scope: e.__scopeMenu, checked: c, children: /* @__PURE__ */ u.jsx(
|
|
408
409
|
Y,
|
|
409
410
|
{
|
|
410
411
|
role: "menuitemradio",
|
|
411
412
|
"aria-checked": c,
|
|
412
413
|
...r,
|
|
413
|
-
ref:
|
|
414
|
+
ref: n,
|
|
414
415
|
"data-state": se(c),
|
|
415
416
|
onSelect: v(
|
|
416
417
|
r.onSelect,
|
|
417
|
-
() => s.onValueChange?.(
|
|
418
|
+
() => s.onValueChange?.(t),
|
|
418
419
|
{ checkForDefaultPrevented: !1 }
|
|
419
420
|
)
|
|
420
421
|
}
|
|
@@ -422,12 +423,12 @@ var be = "MenuRadioItem", Te = o.forwardRef(
|
|
|
422
423
|
}
|
|
423
424
|
);
|
|
424
425
|
Te.displayName = be;
|
|
425
|
-
var oe = "MenuItemIndicator", [Ae,
|
|
426
|
+
var oe = "MenuItemIndicator", [Ae, Dt] = S(
|
|
426
427
|
oe,
|
|
427
428
|
{ checked: !1 }
|
|
428
429
|
), je = o.forwardRef(
|
|
429
|
-
(e,
|
|
430
|
-
const { __scopeMenu:
|
|
430
|
+
(e, n) => {
|
|
431
|
+
const { __scopeMenu: t, forceMount: r, ...s } = e, c = Dt(oe, t);
|
|
431
432
|
return /* @__PURE__ */ u.jsx(
|
|
432
433
|
W,
|
|
433
434
|
{
|
|
@@ -436,7 +437,7 @@ var oe = "MenuItemIndicator", [Ae, Nn] = S(
|
|
|
436
437
|
N.span,
|
|
437
438
|
{
|
|
438
439
|
...s,
|
|
439
|
-
ref:
|
|
440
|
+
ref: n,
|
|
440
441
|
"data-state": se(c.checked)
|
|
441
442
|
}
|
|
442
443
|
)
|
|
@@ -445,47 +446,47 @@ var oe = "MenuItemIndicator", [Ae, Nn] = S(
|
|
|
445
446
|
}
|
|
446
447
|
);
|
|
447
448
|
je.displayName = oe;
|
|
448
|
-
var
|
|
449
|
-
(e,
|
|
450
|
-
const { __scopeMenu:
|
|
449
|
+
var Nt = "MenuSeparator", Oe = o.forwardRef(
|
|
450
|
+
(e, n) => {
|
|
451
|
+
const { __scopeMenu: t, ...r } = e;
|
|
451
452
|
return /* @__PURE__ */ u.jsx(
|
|
452
453
|
N.div,
|
|
453
454
|
{
|
|
454
455
|
role: "separator",
|
|
455
456
|
"aria-orientation": "horizontal",
|
|
456
457
|
...r,
|
|
457
|
-
ref:
|
|
458
|
+
ref: n
|
|
458
459
|
}
|
|
459
460
|
);
|
|
460
461
|
}
|
|
461
462
|
);
|
|
462
|
-
Oe.displayName =
|
|
463
|
-
var
|
|
464
|
-
(e,
|
|
465
|
-
const { __scopeMenu:
|
|
466
|
-
return /* @__PURE__ */ u.jsx(
|
|
463
|
+
Oe.displayName = Nt;
|
|
464
|
+
var kt = "MenuArrow", De = o.forwardRef(
|
|
465
|
+
(e, n) => {
|
|
466
|
+
const { __scopeMenu: t, ...r } = e, s = F(t);
|
|
467
|
+
return /* @__PURE__ */ u.jsx(st, { ...s, ...r, ref: n });
|
|
467
468
|
}
|
|
468
469
|
);
|
|
469
|
-
De.displayName =
|
|
470
|
-
var re = "MenuSub", [
|
|
471
|
-
const { __scopeMenu:
|
|
470
|
+
De.displayName = kt;
|
|
471
|
+
var re = "MenuSub", [Ft, Ne] = S(re), ke = (e) => {
|
|
472
|
+
const { __scopeMenu: n, children: t, open: r = !1, onOpenChange: s } = e, c = _(re, n), l = F(n), [f, m] = o.useState(null), [p, d] = o.useState(null), a = q(s);
|
|
472
473
|
return o.useEffect(() => (c.open === !1 && a(!1), () => a(!1)), [c.open, a]), /* @__PURE__ */ u.jsx(he, { ...l, children: /* @__PURE__ */ u.jsx(
|
|
473
474
|
ge,
|
|
474
475
|
{
|
|
475
|
-
scope:
|
|
476
|
+
scope: n,
|
|
476
477
|
open: r,
|
|
477
478
|
onOpenChange: a,
|
|
478
479
|
content: p,
|
|
479
480
|
onContentChange: d,
|
|
480
481
|
children: /* @__PURE__ */ u.jsx(
|
|
481
|
-
|
|
482
|
+
Ft,
|
|
482
483
|
{
|
|
483
|
-
scope:
|
|
484
|
+
scope: n,
|
|
484
485
|
contentId: de(),
|
|
485
486
|
triggerId: de(),
|
|
486
487
|
trigger: f,
|
|
487
488
|
onTriggerChange: m,
|
|
488
|
-
children:
|
|
489
|
+
children: t
|
|
489
490
|
}
|
|
490
491
|
)
|
|
491
492
|
}
|
|
@@ -493,8 +494,8 @@ var re = "MenuSub", [Ln, Ne] = S(re), ke = (e) => {
|
|
|
493
494
|
};
|
|
494
495
|
ke.displayName = re;
|
|
495
496
|
var A = "MenuSubTrigger", Fe = o.forwardRef(
|
|
496
|
-
(e,
|
|
497
|
-
const
|
|
497
|
+
(e, n) => {
|
|
498
|
+
const t = _(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(() => {
|
|
498
499
|
l.current && window.clearTimeout(l.current), l.current = null;
|
|
499
500
|
}, []);
|
|
500
501
|
return o.useEffect(() => d, [d]), o.useEffect(() => {
|
|
@@ -507,19 +508,19 @@ var A = "MenuSubTrigger", Fe = o.forwardRef(
|
|
|
507
508
|
{
|
|
508
509
|
id: s.triggerId,
|
|
509
510
|
"aria-haspopup": "menu",
|
|
510
|
-
"aria-expanded":
|
|
511
|
+
"aria-expanded": t.open,
|
|
511
512
|
"aria-controls": s.contentId,
|
|
512
|
-
"data-state": Ge(
|
|
513
|
+
"data-state": Ge(t.open),
|
|
513
514
|
...e,
|
|
514
|
-
ref: pe(
|
|
515
|
+
ref: pe(n, s.onTriggerChange),
|
|
515
516
|
onClick: (a) => {
|
|
516
|
-
e.onClick?.(a), !(e.disabled || a.defaultPrevented) && (a.currentTarget.focus(),
|
|
517
|
+
e.onClick?.(a), !(e.disabled || a.defaultPrevented) && (a.currentTarget.focus(), t.open || t.onOpenChange(!0));
|
|
517
518
|
},
|
|
518
519
|
onPointerMove: v(
|
|
519
520
|
e.onPointerMove,
|
|
520
521
|
O((a) => {
|
|
521
|
-
c.onItemEnter(a), !a.defaultPrevented && !e.disabled && !
|
|
522
|
-
|
|
522
|
+
c.onItemEnter(a), !a.defaultPrevented && !e.disabled && !t.open && !l.current && (c.onPointerGraceIntentChange(null), l.current = window.setTimeout(() => {
|
|
523
|
+
t.onOpenChange(!0), d();
|
|
523
524
|
}, 100));
|
|
524
525
|
})
|
|
525
526
|
),
|
|
@@ -527,9 +528,9 @@ var A = "MenuSubTrigger", Fe = o.forwardRef(
|
|
|
527
528
|
e.onPointerLeave,
|
|
528
529
|
O((a) => {
|
|
529
530
|
d();
|
|
530
|
-
const h =
|
|
531
|
+
const h = t.content?.getBoundingClientRect();
|
|
531
532
|
if (h) {
|
|
532
|
-
const g =
|
|
533
|
+
const g = t.content?.dataset.side, C = g === "right", E = C ? -5 : 5, w = h[C ? "left" : "right"], P = h[C ? "right" : "left"];
|
|
533
534
|
c.onPointerGraceIntentChange({
|
|
534
535
|
area: [
|
|
535
536
|
// Apply a bleed on clientX to ensure that our exit point is
|
|
@@ -553,7 +554,7 @@ var A = "MenuSubTrigger", Fe = o.forwardRef(
|
|
|
553
554
|
),
|
|
554
555
|
onKeyDown: v(e.onKeyDown, (a) => {
|
|
555
556
|
const h = c.searchRef.current !== "";
|
|
556
|
-
e.disabled || h && a.key === " " ||
|
|
557
|
+
e.disabled || h && a.key === " " || Mt[r.dir].includes(a.key) && (t.onOpenChange(!0), t.content?.focus(), a.preventDefault());
|
|
557
558
|
})
|
|
558
559
|
}
|
|
559
560
|
) });
|
|
@@ -561,10 +562,10 @@ var A = "MenuSubTrigger", Fe = o.forwardRef(
|
|
|
561
562
|
);
|
|
562
563
|
Fe.displayName = A;
|
|
563
564
|
var Le = "MenuSubContent", Ke = o.forwardRef(
|
|
564
|
-
(e,
|
|
565
|
-
const
|
|
565
|
+
(e, n) => {
|
|
566
|
+
const t = _e(x, e.__scopeMenu), { forceMount: r = t.forceMount, ...s } = e, c = _(x, e.__scopeMenu), l = L(x, e.__scopeMenu), f = Ne(Le, e.__scopeMenu), m = o.useRef(null), p = D(n, m);
|
|
566
567
|
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(
|
|
567
|
-
|
|
568
|
+
te,
|
|
568
569
|
{
|
|
569
570
|
id: f.contentId,
|
|
570
571
|
"aria-labelledby": f.triggerId,
|
|
@@ -586,7 +587,7 @@ var Le = "MenuSubContent", Ke = o.forwardRef(
|
|
|
586
587
|
l.onClose(), d.preventDefault();
|
|
587
588
|
}),
|
|
588
589
|
onKeyDown: v(e.onKeyDown, (d) => {
|
|
589
|
-
const a = d.currentTarget.contains(d.target), h =
|
|
590
|
+
const a = d.currentTarget.contains(d.target), h = gt[l.dir].includes(d.key);
|
|
590
591
|
a && h && (c.onOpenChange(!1), f.trigger?.focus(), d.preventDefault());
|
|
591
592
|
})
|
|
592
593
|
}
|
|
@@ -603,57 +604,57 @@ function B(e) {
|
|
|
603
604
|
function se(e) {
|
|
604
605
|
return B(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
605
606
|
}
|
|
606
|
-
function
|
|
607
|
-
const
|
|
608
|
-
for (const
|
|
609
|
-
if (
|
|
607
|
+
function Lt(e) {
|
|
608
|
+
const n = document.activeElement;
|
|
609
|
+
for (const t of e)
|
|
610
|
+
if (t === n || (t.focus(), document.activeElement !== n)) return;
|
|
610
611
|
}
|
|
611
|
-
function
|
|
612
|
-
return e.map((
|
|
612
|
+
function Kt(e, n) {
|
|
613
|
+
return e.map((t, r) => e[(n + r) % e.length]);
|
|
613
614
|
}
|
|
614
|
-
function
|
|
615
|
-
const s =
|
|
616
|
-
let l =
|
|
617
|
-
s.length === 1 && (l = l.filter((p) => p !==
|
|
615
|
+
function Gt(e, n, t) {
|
|
616
|
+
const s = n.length > 1 && Array.from(n).every((p) => p === n[0]) ? n[0] : n, c = t ? e.indexOf(t) : -1;
|
|
617
|
+
let l = Kt(e, Math.max(c, 0));
|
|
618
|
+
s.length === 1 && (l = l.filter((p) => p !== t));
|
|
618
619
|
const m = l.find(
|
|
619
620
|
(p) => p.toLowerCase().startsWith(s.toLowerCase())
|
|
620
621
|
);
|
|
621
|
-
return m !==
|
|
622
|
+
return m !== t ? m : void 0;
|
|
622
623
|
}
|
|
623
|
-
function
|
|
624
|
-
const { x:
|
|
624
|
+
function Ut(e, n) {
|
|
625
|
+
const { x: t, y: r } = e;
|
|
625
626
|
let s = !1;
|
|
626
|
-
for (let c = 0, l =
|
|
627
|
-
const f =
|
|
628
|
-
d > r != h > r &&
|
|
627
|
+
for (let c = 0, l = n.length - 1; c < n.length; l = c++) {
|
|
628
|
+
const f = n[c], m = n[l], p = f.x, d = f.y, a = m.x, h = m.y;
|
|
629
|
+
d > r != h > r && t < (a - p) * (r - d) / (h - d) + p && (s = !s);
|
|
629
630
|
}
|
|
630
631
|
return s;
|
|
631
632
|
}
|
|
632
|
-
function
|
|
633
|
-
if (!
|
|
634
|
-
const
|
|
635
|
-
return
|
|
633
|
+
function Vt(e, n) {
|
|
634
|
+
if (!n) return !1;
|
|
635
|
+
const t = { x: e.clientX, y: e.clientY };
|
|
636
|
+
return Ut(t, n);
|
|
636
637
|
}
|
|
637
638
|
function O(e) {
|
|
638
|
-
return (
|
|
639
|
+
return (n) => n.pointerType === "mouse" ? e(n) : void 0;
|
|
639
640
|
}
|
|
640
|
-
var
|
|
641
|
+
var sn = xe, cn = J, an = Re, un = Se, ln = ne, dn = Ee, fn = Y, pn = ye, mn = we, hn = Te, Cn = je, vn = Oe, Mn = De, gn = ke, xn = Fe, _n = Ke;
|
|
641
642
|
export {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
643
|
+
cn as A,
|
|
644
|
+
un as C,
|
|
645
|
+
ln as G,
|
|
646
|
+
fn as I,
|
|
647
|
+
dn as L,
|
|
648
|
+
an as P,
|
|
649
|
+
sn as R,
|
|
650
|
+
vn as S,
|
|
651
|
+
pn as a,
|
|
652
|
+
Cn as b,
|
|
653
|
+
rn as c,
|
|
654
|
+
hn as d,
|
|
655
|
+
gn as e,
|
|
656
|
+
_n as f,
|
|
657
|
+
xn as g,
|
|
658
|
+
mn as h,
|
|
659
|
+
Mn as i
|
|
659
660
|
};
|