@adamosuiteservices/ui 1.2.5 → 1.3.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/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/dialog/dialog.d.ts +2 -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 +1 -1
- package/dist/sidebar.js +4 -4
- 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 +330 -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
package/dist/index-CezwiPd_.js
DELETED
|
@@ -1,615 +0,0 @@
|
|
|
1
|
-
import * as o from "react";
|
|
2
|
-
import { c as M } from "./index-C0UREtMP.js";
|
|
3
|
-
import { c as ze, u as Ze } from "./index-D02K8KOB.js";
|
|
4
|
-
import { u as D, c as $e, a as qe } from "./index-6oTEokEx.js";
|
|
5
|
-
import { c as Je } from "./index-FxyLF8MY.js";
|
|
6
|
-
import { D as Qe } from "./index-C329e3yQ.js";
|
|
7
|
-
import { h as et, u as tt, R as nt, F as ot } from "./index-o0sNTcKe.js";
|
|
8
|
-
import { u as de } from "./index-Cv867SGx.js";
|
|
9
|
-
import { c as pe, R as me, A as rt, C as st, a as ct } from "./index-CAOY367Y.js";
|
|
10
|
-
import { P as at } from "./index-yR-v1A4G.js";
|
|
11
|
-
import { P as Y } from "./index-EUea2gfp.js";
|
|
12
|
-
import { P as k, d as ut } from "./index-C5wjudc-.js";
|
|
13
|
-
import { c as he, I as it, R as lt } from "./index-DulPG3F9.js";
|
|
14
|
-
import { u as q } from "./index-0ioNhtNM.js";
|
|
15
|
-
import { j as a } from "./jsx-runtime-BzflLqGi.js";
|
|
16
|
-
var $ = ["Enter", " "], dt = ["ArrowDown", "PageUp", "Home"], Ce = ["ArrowUp", "PageDown", "End"], ft = [...dt, ...Ce], pt = {
|
|
17
|
-
ltr: [...$, "ArrowRight"],
|
|
18
|
-
rtl: [...$, "ArrowLeft"]
|
|
19
|
-
}, mt = {
|
|
20
|
-
ltr: ["ArrowLeft"],
|
|
21
|
-
rtl: ["ArrowRight"]
|
|
22
|
-
}, N = "Menu", [j, ht, Ct] = ze(N), [S, Jt] = Je(N, [
|
|
23
|
-
Ct,
|
|
24
|
-
pe,
|
|
25
|
-
he
|
|
26
|
-
]), F = pe(), Me = he(), [ve, _] = S(N), [Mt, L] = S(N), ge = (e) => {
|
|
27
|
-
const { __scopeMenu: n, open: t = !1, children: r, dir: u, onOpenChange: s, modal: d = !0 } = e, m = F(n), [h, p] = o.useState(null), l = o.useRef(!1), c = q(s), f = Ze(u);
|
|
28
|
-
return o.useEffect(() => {
|
|
29
|
-
const g = () => {
|
|
30
|
-
l.current = !0, document.addEventListener("pointerdown", C, { capture: !0, once: !0 }), document.addEventListener("pointermove", C, { capture: !0, once: !0 });
|
|
31
|
-
}, C = () => l.current = !1;
|
|
32
|
-
return document.addEventListener("keydown", g, { capture: !0 }), () => {
|
|
33
|
-
document.removeEventListener("keydown", g, { capture: !0 }), document.removeEventListener("pointerdown", C, { capture: !0 }), document.removeEventListener("pointermove", C, { capture: !0 });
|
|
34
|
-
};
|
|
35
|
-
}, []), /* @__PURE__ */ a.jsx(me, { ...m, children: /* @__PURE__ */ a.jsx(
|
|
36
|
-
ve,
|
|
37
|
-
{
|
|
38
|
-
scope: n,
|
|
39
|
-
open: t,
|
|
40
|
-
onOpenChange: c,
|
|
41
|
-
content: h,
|
|
42
|
-
onContentChange: p,
|
|
43
|
-
children: /* @__PURE__ */ a.jsx(
|
|
44
|
-
Mt,
|
|
45
|
-
{
|
|
46
|
-
scope: n,
|
|
47
|
-
onClose: o.useCallback(() => c(!1), [c]),
|
|
48
|
-
isUsingKeyboardRef: l,
|
|
49
|
-
dir: f,
|
|
50
|
-
modal: d,
|
|
51
|
-
children: r
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
) });
|
|
56
|
-
};
|
|
57
|
-
ge.displayName = N;
|
|
58
|
-
var vt = "MenuAnchor", J = o.forwardRef(
|
|
59
|
-
(e, n) => {
|
|
60
|
-
const { __scopeMenu: t, ...r } = e, u = F(t);
|
|
61
|
-
return /* @__PURE__ */ a.jsx(rt, { ...u, ...r, ref: n });
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
J.displayName = vt;
|
|
65
|
-
var Q = "MenuPortal", [gt, xe] = S(Q, {
|
|
66
|
-
forceMount: void 0
|
|
67
|
-
}), _e = (e) => {
|
|
68
|
-
const { __scopeMenu: n, forceMount: t, children: r, container: u } = e, s = _(Q, n);
|
|
69
|
-
return /* @__PURE__ */ a.jsx(gt, { scope: n, forceMount: t, children: /* @__PURE__ */ a.jsx(Y, { present: t || s.open, children: /* @__PURE__ */ a.jsx(at, { asChild: !0, container: u, children: r }) }) });
|
|
70
|
-
};
|
|
71
|
-
_e.displayName = Q;
|
|
72
|
-
var x = "MenuContent", [xt, ee] = S(x), Re = o.forwardRef(
|
|
73
|
-
(e, n) => {
|
|
74
|
-
const t = xe(x, e.__scopeMenu), { forceMount: r = t.forceMount, ...u } = e, s = _(x, e.__scopeMenu), d = L(x, e.__scopeMenu);
|
|
75
|
-
return /* @__PURE__ */ a.jsx(j.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(Y, { present: r || s.open, children: /* @__PURE__ */ a.jsx(j.Slot, { scope: e.__scopeMenu, children: d.modal ? /* @__PURE__ */ a.jsx(_t, { ...u, ref: n }) : /* @__PURE__ */ a.jsx(Rt, { ...u, ref: n }) }) }) });
|
|
76
|
-
}
|
|
77
|
-
), _t = o.forwardRef(
|
|
78
|
-
(e, n) => {
|
|
79
|
-
const t = _(x, e.__scopeMenu), r = o.useRef(null), u = D(n, r);
|
|
80
|
-
return o.useEffect(() => {
|
|
81
|
-
const s = r.current;
|
|
82
|
-
if (s) return et(s);
|
|
83
|
-
}, []), /* @__PURE__ */ a.jsx(
|
|
84
|
-
te,
|
|
85
|
-
{
|
|
86
|
-
...e,
|
|
87
|
-
ref: u,
|
|
88
|
-
trapFocus: t.open,
|
|
89
|
-
disableOutsidePointerEvents: t.open,
|
|
90
|
-
disableOutsideScroll: !0,
|
|
91
|
-
onFocusOutside: M(
|
|
92
|
-
e.onFocusOutside,
|
|
93
|
-
(s) => s.preventDefault(),
|
|
94
|
-
{ checkForDefaultPrevented: !1 }
|
|
95
|
-
),
|
|
96
|
-
onDismiss: () => t.onOpenChange(!1)
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
), Rt = o.forwardRef((e, n) => {
|
|
101
|
-
const t = _(x, e.__scopeMenu);
|
|
102
|
-
return /* @__PURE__ */ a.jsx(
|
|
103
|
-
te,
|
|
104
|
-
{
|
|
105
|
-
...e,
|
|
106
|
-
ref: n,
|
|
107
|
-
trapFocus: !1,
|
|
108
|
-
disableOutsidePointerEvents: !1,
|
|
109
|
-
disableOutsideScroll: !1,
|
|
110
|
-
onDismiss: () => t.onOpenChange(!1)
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
}), St = qe("MenuContent.ScrollLock"), te = o.forwardRef(
|
|
114
|
-
(e, n) => {
|
|
115
|
-
const {
|
|
116
|
-
__scopeMenu: t,
|
|
117
|
-
loop: r = !1,
|
|
118
|
-
trapFocus: u,
|
|
119
|
-
onOpenAutoFocus: s,
|
|
120
|
-
onCloseAutoFocus: d,
|
|
121
|
-
disableOutsidePointerEvents: m,
|
|
122
|
-
onEntryFocus: h,
|
|
123
|
-
onEscapeKeyDown: p,
|
|
124
|
-
onPointerDownOutside: l,
|
|
125
|
-
onFocusOutside: c,
|
|
126
|
-
onInteractOutside: f,
|
|
127
|
-
onDismiss: g,
|
|
128
|
-
disableOutsideScroll: C,
|
|
129
|
-
...P
|
|
130
|
-
} = e, y = _(x, t), E = L(x, t), Ge = F(t), Ue = Me(t), ce = ht(t), [Be, ae] = o.useState(null), K = o.useRef(null), Ve = D(n, K, y.onContentChange), G = o.useRef(0), U = o.useRef(""), Ye = o.useRef(0), H = o.useRef(null), ue = o.useRef("right"), W = o.useRef(0), Xe = C ? nt : o.Fragment, He = C ? { as: St, allowPinchZoom: !0 } : void 0, We = (i) => {
|
|
131
|
-
const w = U.current + i, R = ce().filter((v) => !v.disabled), b = document.activeElement, z = R.find((v) => v.ref.current === b)?.textValue, Z = R.map((v) => v.textValue), ie = kt(Z, w, z), T = R.find((v) => v.textValue === ie)?.ref.current;
|
|
132
|
-
(function v(le) {
|
|
133
|
-
U.current = le, window.clearTimeout(G.current), le !== "" && (G.current = window.setTimeout(() => v(""), 1e3));
|
|
134
|
-
})(w), T && setTimeout(() => T.focus());
|
|
135
|
-
};
|
|
136
|
-
o.useEffect(() => () => window.clearTimeout(G.current), []), tt();
|
|
137
|
-
const I = o.useCallback((i) => ue.current === H.current?.side && Ft(i, H.current?.area), []);
|
|
138
|
-
return /* @__PURE__ */ a.jsx(
|
|
139
|
-
xt,
|
|
140
|
-
{
|
|
141
|
-
scope: t,
|
|
142
|
-
searchRef: U,
|
|
143
|
-
onItemEnter: o.useCallback(
|
|
144
|
-
(i) => {
|
|
145
|
-
I(i) && i.preventDefault();
|
|
146
|
-
},
|
|
147
|
-
[I]
|
|
148
|
-
),
|
|
149
|
-
onItemLeave: o.useCallback(
|
|
150
|
-
(i) => {
|
|
151
|
-
I(i) || (K.current?.focus(), ae(null));
|
|
152
|
-
},
|
|
153
|
-
[I]
|
|
154
|
-
),
|
|
155
|
-
onTriggerLeave: o.useCallback(
|
|
156
|
-
(i) => {
|
|
157
|
-
I(i) && i.preventDefault();
|
|
158
|
-
},
|
|
159
|
-
[I]
|
|
160
|
-
),
|
|
161
|
-
pointerGraceTimerRef: Ye,
|
|
162
|
-
onPointerGraceIntentChange: o.useCallback((i) => {
|
|
163
|
-
H.current = i;
|
|
164
|
-
}, []),
|
|
165
|
-
children: /* @__PURE__ */ a.jsx(Xe, { ...He, children: /* @__PURE__ */ a.jsx(
|
|
166
|
-
ot,
|
|
167
|
-
{
|
|
168
|
-
asChild: !0,
|
|
169
|
-
trapped: u,
|
|
170
|
-
onMountAutoFocus: M(s, (i) => {
|
|
171
|
-
i.preventDefault(), K.current?.focus({ preventScroll: !0 });
|
|
172
|
-
}),
|
|
173
|
-
onUnmountAutoFocus: d,
|
|
174
|
-
children: /* @__PURE__ */ a.jsx(
|
|
175
|
-
Qe,
|
|
176
|
-
{
|
|
177
|
-
asChild: !0,
|
|
178
|
-
disableOutsidePointerEvents: m,
|
|
179
|
-
onEscapeKeyDown: p,
|
|
180
|
-
onPointerDownOutside: l,
|
|
181
|
-
onFocusOutside: c,
|
|
182
|
-
onInteractOutside: f,
|
|
183
|
-
onDismiss: g,
|
|
184
|
-
children: /* @__PURE__ */ a.jsx(
|
|
185
|
-
lt,
|
|
186
|
-
{
|
|
187
|
-
asChild: !0,
|
|
188
|
-
...Ue,
|
|
189
|
-
dir: E.dir,
|
|
190
|
-
orientation: "vertical",
|
|
191
|
-
loop: r,
|
|
192
|
-
currentTabStopId: Be,
|
|
193
|
-
onCurrentTabStopIdChange: ae,
|
|
194
|
-
onEntryFocus: M(h, (i) => {
|
|
195
|
-
E.isUsingKeyboardRef.current || i.preventDefault();
|
|
196
|
-
}),
|
|
197
|
-
preventScrollOnEntryFocus: !0,
|
|
198
|
-
children: /* @__PURE__ */ a.jsx(
|
|
199
|
-
st,
|
|
200
|
-
{
|
|
201
|
-
role: "menu",
|
|
202
|
-
"aria-orientation": "vertical",
|
|
203
|
-
"data-state": Ke(y.open),
|
|
204
|
-
"data-radix-menu-content": "",
|
|
205
|
-
dir: E.dir,
|
|
206
|
-
...Ge,
|
|
207
|
-
...P,
|
|
208
|
-
ref: Ve,
|
|
209
|
-
style: { outline: "none", ...P.style },
|
|
210
|
-
onKeyDown: M(P.onKeyDown, (i) => {
|
|
211
|
-
const R = i.target.closest("[data-radix-menu-content]") === i.currentTarget, b = i.ctrlKey || i.altKey || i.metaKey, z = i.key.length === 1;
|
|
212
|
-
R && (i.key === "Tab" && i.preventDefault(), !b && z && We(i.key));
|
|
213
|
-
const Z = K.current;
|
|
214
|
-
if (i.target !== Z || !ft.includes(i.key)) return;
|
|
215
|
-
i.preventDefault();
|
|
216
|
-
const T = ce().filter((v) => !v.disabled).map((v) => v.ref.current);
|
|
217
|
-
Ce.includes(i.key) && T.reverse(), Ot(T);
|
|
218
|
-
}),
|
|
219
|
-
onBlur: M(e.onBlur, (i) => {
|
|
220
|
-
i.currentTarget.contains(i.target) || (window.clearTimeout(G.current), U.current = "");
|
|
221
|
-
}),
|
|
222
|
-
onPointerMove: M(
|
|
223
|
-
e.onPointerMove,
|
|
224
|
-
O((i) => {
|
|
225
|
-
const w = i.target, R = W.current !== i.clientX;
|
|
226
|
-
if (i.currentTarget.contains(w) && R) {
|
|
227
|
-
const b = i.clientX > W.current ? "right" : "left";
|
|
228
|
-
ue.current = b, W.current = i.clientX;
|
|
229
|
-
}
|
|
230
|
-
})
|
|
231
|
-
)
|
|
232
|
-
}
|
|
233
|
-
)
|
|
234
|
-
}
|
|
235
|
-
)
|
|
236
|
-
}
|
|
237
|
-
)
|
|
238
|
-
}
|
|
239
|
-
) })
|
|
240
|
-
}
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
);
|
|
244
|
-
Re.displayName = x;
|
|
245
|
-
var Pt = "MenuGroup", ne = o.forwardRef(
|
|
246
|
-
(e, n) => {
|
|
247
|
-
const { __scopeMenu: t, ...r } = e;
|
|
248
|
-
return /* @__PURE__ */ a.jsx(k.div, { role: "group", ...r, ref: n });
|
|
249
|
-
}
|
|
250
|
-
);
|
|
251
|
-
ne.displayName = Pt;
|
|
252
|
-
var Et = "MenuLabel", Se = o.forwardRef(
|
|
253
|
-
(e, n) => {
|
|
254
|
-
const { __scopeMenu: t, ...r } = e;
|
|
255
|
-
return /* @__PURE__ */ a.jsx(k.div, { ...r, ref: n });
|
|
256
|
-
}
|
|
257
|
-
);
|
|
258
|
-
Se.displayName = Et;
|
|
259
|
-
var B = "MenuItem", fe = "menu.itemSelect", X = o.forwardRef(
|
|
260
|
-
(e, n) => {
|
|
261
|
-
const { disabled: t = !1, onSelect: r, ...u } = e, s = o.useRef(null), d = L(B, e.__scopeMenu), m = ee(B, e.__scopeMenu), h = D(n, s), p = o.useRef(!1), l = () => {
|
|
262
|
-
const c = s.current;
|
|
263
|
-
if (!t && c) {
|
|
264
|
-
const f = new CustomEvent(fe, { bubbles: !0, cancelable: !0 });
|
|
265
|
-
c.addEventListener(fe, (g) => r?.(g), { once: !0 }), ut(c, f), f.defaultPrevented ? p.current = !1 : d.onClose();
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
return /* @__PURE__ */ a.jsx(
|
|
269
|
-
Pe,
|
|
270
|
-
{
|
|
271
|
-
...u,
|
|
272
|
-
ref: h,
|
|
273
|
-
disabled: t,
|
|
274
|
-
onClick: M(e.onClick, l),
|
|
275
|
-
onPointerDown: (c) => {
|
|
276
|
-
e.onPointerDown?.(c), p.current = !0;
|
|
277
|
-
},
|
|
278
|
-
onPointerUp: M(e.onPointerUp, (c) => {
|
|
279
|
-
p.current || c.currentTarget?.click();
|
|
280
|
-
}),
|
|
281
|
-
onKeyDown: M(e.onKeyDown, (c) => {
|
|
282
|
-
const f = m.searchRef.current !== "";
|
|
283
|
-
t || f && c.key === " " || $.includes(c.key) && (c.currentTarget.click(), c.preventDefault());
|
|
284
|
-
})
|
|
285
|
-
}
|
|
286
|
-
);
|
|
287
|
-
}
|
|
288
|
-
);
|
|
289
|
-
X.displayName = B;
|
|
290
|
-
var Pe = o.forwardRef(
|
|
291
|
-
(e, n) => {
|
|
292
|
-
const { __scopeMenu: t, disabled: r = !1, textValue: u, ...s } = e, d = ee(B, t), m = Me(t), h = o.useRef(null), p = D(n, h), [l, c] = o.useState(!1), [f, g] = o.useState("");
|
|
293
|
-
return o.useEffect(() => {
|
|
294
|
-
const C = h.current;
|
|
295
|
-
C && g((C.textContent ?? "").trim());
|
|
296
|
-
}, [s.children]), /* @__PURE__ */ a.jsx(
|
|
297
|
-
j.ItemSlot,
|
|
298
|
-
{
|
|
299
|
-
scope: t,
|
|
300
|
-
disabled: r,
|
|
301
|
-
textValue: u ?? f,
|
|
302
|
-
children: /* @__PURE__ */ a.jsx(it, { asChild: !0, ...m, focusable: !r, children: /* @__PURE__ */ a.jsx(
|
|
303
|
-
k.div,
|
|
304
|
-
{
|
|
305
|
-
role: "menuitem",
|
|
306
|
-
"data-highlighted": l ? "" : void 0,
|
|
307
|
-
"aria-disabled": r || void 0,
|
|
308
|
-
"data-disabled": r ? "" : void 0,
|
|
309
|
-
...s,
|
|
310
|
-
ref: p,
|
|
311
|
-
onPointerMove: M(
|
|
312
|
-
e.onPointerMove,
|
|
313
|
-
O((C) => {
|
|
314
|
-
r ? d.onItemLeave(C) : (d.onItemEnter(C), C.defaultPrevented || C.currentTarget.focus({ preventScroll: !0 }));
|
|
315
|
-
})
|
|
316
|
-
),
|
|
317
|
-
onPointerLeave: M(
|
|
318
|
-
e.onPointerLeave,
|
|
319
|
-
O((C) => d.onItemLeave(C))
|
|
320
|
-
),
|
|
321
|
-
onFocus: M(e.onFocus, () => c(!0)),
|
|
322
|
-
onBlur: M(e.onBlur, () => c(!1))
|
|
323
|
-
}
|
|
324
|
-
) })
|
|
325
|
-
}
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
), It = "MenuCheckboxItem", Ee = o.forwardRef(
|
|
329
|
-
(e, n) => {
|
|
330
|
-
const { checked: t = !1, onCheckedChange: r, ...u } = e;
|
|
331
|
-
return /* @__PURE__ */ a.jsx(Te, { scope: e.__scopeMenu, checked: t, children: /* @__PURE__ */ a.jsx(
|
|
332
|
-
X,
|
|
333
|
-
{
|
|
334
|
-
role: "menuitemcheckbox",
|
|
335
|
-
"aria-checked": V(t) ? "mixed" : t,
|
|
336
|
-
...u,
|
|
337
|
-
ref: n,
|
|
338
|
-
"data-state": se(t),
|
|
339
|
-
onSelect: M(
|
|
340
|
-
u.onSelect,
|
|
341
|
-
() => r?.(V(t) ? !0 : !t),
|
|
342
|
-
{ checkForDefaultPrevented: !1 }
|
|
343
|
-
)
|
|
344
|
-
}
|
|
345
|
-
) });
|
|
346
|
-
}
|
|
347
|
-
);
|
|
348
|
-
Ee.displayName = It;
|
|
349
|
-
var Ie = "MenuRadioGroup", [wt, yt] = S(
|
|
350
|
-
Ie,
|
|
351
|
-
{ value: void 0, onValueChange: () => {
|
|
352
|
-
} }
|
|
353
|
-
), we = o.forwardRef(
|
|
354
|
-
(e, n) => {
|
|
355
|
-
const { value: t, onValueChange: r, ...u } = e, s = q(r);
|
|
356
|
-
return /* @__PURE__ */ a.jsx(wt, { scope: e.__scopeMenu, value: t, onValueChange: s, children: /* @__PURE__ */ a.jsx(ne, { ...u, ref: n }) });
|
|
357
|
-
}
|
|
358
|
-
);
|
|
359
|
-
we.displayName = Ie;
|
|
360
|
-
var ye = "MenuRadioItem", be = o.forwardRef(
|
|
361
|
-
(e, n) => {
|
|
362
|
-
const { value: t, ...r } = e, u = yt(ye, e.__scopeMenu), s = t === u.value;
|
|
363
|
-
return /* @__PURE__ */ a.jsx(Te, { scope: e.__scopeMenu, checked: s, children: /* @__PURE__ */ a.jsx(
|
|
364
|
-
X,
|
|
365
|
-
{
|
|
366
|
-
role: "menuitemradio",
|
|
367
|
-
"aria-checked": s,
|
|
368
|
-
...r,
|
|
369
|
-
ref: n,
|
|
370
|
-
"data-state": se(s),
|
|
371
|
-
onSelect: M(
|
|
372
|
-
r.onSelect,
|
|
373
|
-
() => u.onValueChange?.(t),
|
|
374
|
-
{ checkForDefaultPrevented: !1 }
|
|
375
|
-
)
|
|
376
|
-
}
|
|
377
|
-
) });
|
|
378
|
-
}
|
|
379
|
-
);
|
|
380
|
-
be.displayName = ye;
|
|
381
|
-
var oe = "MenuItemIndicator", [Te, bt] = S(
|
|
382
|
-
oe,
|
|
383
|
-
{ checked: !1 }
|
|
384
|
-
), Ae = o.forwardRef(
|
|
385
|
-
(e, n) => {
|
|
386
|
-
const { __scopeMenu: t, forceMount: r, ...u } = e, s = bt(oe, t);
|
|
387
|
-
return /* @__PURE__ */ a.jsx(
|
|
388
|
-
Y,
|
|
389
|
-
{
|
|
390
|
-
present: r || V(s.checked) || s.checked === !0,
|
|
391
|
-
children: /* @__PURE__ */ a.jsx(
|
|
392
|
-
k.span,
|
|
393
|
-
{
|
|
394
|
-
...u,
|
|
395
|
-
ref: n,
|
|
396
|
-
"data-state": se(s.checked)
|
|
397
|
-
}
|
|
398
|
-
)
|
|
399
|
-
}
|
|
400
|
-
);
|
|
401
|
-
}
|
|
402
|
-
);
|
|
403
|
-
Ae.displayName = oe;
|
|
404
|
-
var Tt = "MenuSeparator", je = o.forwardRef(
|
|
405
|
-
(e, n) => {
|
|
406
|
-
const { __scopeMenu: t, ...r } = e;
|
|
407
|
-
return /* @__PURE__ */ a.jsx(
|
|
408
|
-
k.div,
|
|
409
|
-
{
|
|
410
|
-
role: "separator",
|
|
411
|
-
"aria-orientation": "horizontal",
|
|
412
|
-
...r,
|
|
413
|
-
ref: n
|
|
414
|
-
}
|
|
415
|
-
);
|
|
416
|
-
}
|
|
417
|
-
);
|
|
418
|
-
je.displayName = Tt;
|
|
419
|
-
var At = "MenuArrow", Oe = o.forwardRef(
|
|
420
|
-
(e, n) => {
|
|
421
|
-
const { __scopeMenu: t, ...r } = e, u = F(t);
|
|
422
|
-
return /* @__PURE__ */ a.jsx(ct, { ...u, ...r, ref: n });
|
|
423
|
-
}
|
|
424
|
-
);
|
|
425
|
-
Oe.displayName = At;
|
|
426
|
-
var re = "MenuSub", [jt, De] = S(re), ke = (e) => {
|
|
427
|
-
const { __scopeMenu: n, children: t, open: r = !1, onOpenChange: u } = e, s = _(re, n), d = F(n), [m, h] = o.useState(null), [p, l] = o.useState(null), c = q(u);
|
|
428
|
-
return o.useEffect(() => (s.open === !1 && c(!1), () => c(!1)), [s.open, c]), /* @__PURE__ */ a.jsx(me, { ...d, children: /* @__PURE__ */ a.jsx(
|
|
429
|
-
ve,
|
|
430
|
-
{
|
|
431
|
-
scope: n,
|
|
432
|
-
open: r,
|
|
433
|
-
onOpenChange: c,
|
|
434
|
-
content: p,
|
|
435
|
-
onContentChange: l,
|
|
436
|
-
children: /* @__PURE__ */ a.jsx(
|
|
437
|
-
jt,
|
|
438
|
-
{
|
|
439
|
-
scope: n,
|
|
440
|
-
contentId: de(),
|
|
441
|
-
triggerId: de(),
|
|
442
|
-
trigger: m,
|
|
443
|
-
onTriggerChange: h,
|
|
444
|
-
children: t
|
|
445
|
-
}
|
|
446
|
-
)
|
|
447
|
-
}
|
|
448
|
-
) });
|
|
449
|
-
};
|
|
450
|
-
ke.displayName = re;
|
|
451
|
-
var A = "MenuSubTrigger", Ne = o.forwardRef(
|
|
452
|
-
(e, n) => {
|
|
453
|
-
const t = _(A, e.__scopeMenu), r = L(A, e.__scopeMenu), u = De(A, e.__scopeMenu), s = ee(A, e.__scopeMenu), d = o.useRef(null), { pointerGraceTimerRef: m, onPointerGraceIntentChange: h } = s, p = { __scopeMenu: e.__scopeMenu }, l = o.useCallback(() => {
|
|
454
|
-
d.current && window.clearTimeout(d.current), d.current = null;
|
|
455
|
-
}, []);
|
|
456
|
-
return o.useEffect(() => l, [l]), o.useEffect(() => {
|
|
457
|
-
const c = m.current;
|
|
458
|
-
return () => {
|
|
459
|
-
window.clearTimeout(c), h(null);
|
|
460
|
-
};
|
|
461
|
-
}, [m, h]), /* @__PURE__ */ a.jsx(J, { asChild: !0, ...p, children: /* @__PURE__ */ a.jsx(
|
|
462
|
-
Pe,
|
|
463
|
-
{
|
|
464
|
-
id: u.triggerId,
|
|
465
|
-
"aria-haspopup": "menu",
|
|
466
|
-
"aria-expanded": t.open,
|
|
467
|
-
"aria-controls": u.contentId,
|
|
468
|
-
"data-state": Ke(t.open),
|
|
469
|
-
...e,
|
|
470
|
-
ref: $e(n, u.onTriggerChange),
|
|
471
|
-
onClick: (c) => {
|
|
472
|
-
e.onClick?.(c), !(e.disabled || c.defaultPrevented) && (c.currentTarget.focus(), t.open || t.onOpenChange(!0));
|
|
473
|
-
},
|
|
474
|
-
onPointerMove: M(
|
|
475
|
-
e.onPointerMove,
|
|
476
|
-
O((c) => {
|
|
477
|
-
s.onItemEnter(c), !c.defaultPrevented && !e.disabled && !t.open && !d.current && (s.onPointerGraceIntentChange(null), d.current = window.setTimeout(() => {
|
|
478
|
-
t.onOpenChange(!0), l();
|
|
479
|
-
}, 100));
|
|
480
|
-
})
|
|
481
|
-
),
|
|
482
|
-
onPointerLeave: M(
|
|
483
|
-
e.onPointerLeave,
|
|
484
|
-
O((c) => {
|
|
485
|
-
l();
|
|
486
|
-
const f = t.content?.getBoundingClientRect();
|
|
487
|
-
if (f) {
|
|
488
|
-
const g = t.content?.dataset.side, C = g === "right", P = C ? -5 : 5, y = f[C ? "left" : "right"], E = f[C ? "right" : "left"];
|
|
489
|
-
s.onPointerGraceIntentChange({
|
|
490
|
-
area: [
|
|
491
|
-
// Apply a bleed on clientX to ensure that our exit point is
|
|
492
|
-
// consistently within polygon bounds
|
|
493
|
-
{ x: c.clientX + P, y: c.clientY },
|
|
494
|
-
{ x: y, y: f.top },
|
|
495
|
-
{ x: E, y: f.top },
|
|
496
|
-
{ x: E, y: f.bottom },
|
|
497
|
-
{ x: y, y: f.bottom }
|
|
498
|
-
],
|
|
499
|
-
side: g
|
|
500
|
-
}), window.clearTimeout(m.current), m.current = window.setTimeout(
|
|
501
|
-
() => s.onPointerGraceIntentChange(null),
|
|
502
|
-
300
|
|
503
|
-
);
|
|
504
|
-
} else {
|
|
505
|
-
if (s.onTriggerLeave(c), c.defaultPrevented) return;
|
|
506
|
-
s.onPointerGraceIntentChange(null);
|
|
507
|
-
}
|
|
508
|
-
})
|
|
509
|
-
),
|
|
510
|
-
onKeyDown: M(e.onKeyDown, (c) => {
|
|
511
|
-
const f = s.searchRef.current !== "";
|
|
512
|
-
e.disabled || f && c.key === " " || pt[r.dir].includes(c.key) && (t.onOpenChange(!0), t.content?.focus(), c.preventDefault());
|
|
513
|
-
})
|
|
514
|
-
}
|
|
515
|
-
) });
|
|
516
|
-
}
|
|
517
|
-
);
|
|
518
|
-
Ne.displayName = A;
|
|
519
|
-
var Fe = "MenuSubContent", Le = o.forwardRef(
|
|
520
|
-
(e, n) => {
|
|
521
|
-
const t = xe(x, e.__scopeMenu), { forceMount: r = t.forceMount, ...u } = e, s = _(x, e.__scopeMenu), d = L(x, e.__scopeMenu), m = De(Fe, e.__scopeMenu), h = o.useRef(null), p = D(n, h);
|
|
522
|
-
return /* @__PURE__ */ a.jsx(j.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(Y, { present: r || s.open, children: /* @__PURE__ */ a.jsx(j.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(
|
|
523
|
-
te,
|
|
524
|
-
{
|
|
525
|
-
id: m.contentId,
|
|
526
|
-
"aria-labelledby": m.triggerId,
|
|
527
|
-
...u,
|
|
528
|
-
ref: p,
|
|
529
|
-
align: "start",
|
|
530
|
-
side: d.dir === "rtl" ? "left" : "right",
|
|
531
|
-
disableOutsidePointerEvents: !1,
|
|
532
|
-
disableOutsideScroll: !1,
|
|
533
|
-
trapFocus: !1,
|
|
534
|
-
onOpenAutoFocus: (l) => {
|
|
535
|
-
d.isUsingKeyboardRef.current && h.current?.focus(), l.preventDefault();
|
|
536
|
-
},
|
|
537
|
-
onCloseAutoFocus: (l) => l.preventDefault(),
|
|
538
|
-
onFocusOutside: M(e.onFocusOutside, (l) => {
|
|
539
|
-
l.target !== m.trigger && s.onOpenChange(!1);
|
|
540
|
-
}),
|
|
541
|
-
onEscapeKeyDown: M(e.onEscapeKeyDown, (l) => {
|
|
542
|
-
d.onClose(), l.preventDefault();
|
|
543
|
-
}),
|
|
544
|
-
onKeyDown: M(e.onKeyDown, (l) => {
|
|
545
|
-
const c = l.currentTarget.contains(l.target), f = mt[d.dir].includes(l.key);
|
|
546
|
-
c && f && (s.onOpenChange(!1), m.trigger?.focus(), l.preventDefault());
|
|
547
|
-
})
|
|
548
|
-
}
|
|
549
|
-
) }) }) });
|
|
550
|
-
}
|
|
551
|
-
);
|
|
552
|
-
Le.displayName = Fe;
|
|
553
|
-
function Ke(e) {
|
|
554
|
-
return e ? "open" : "closed";
|
|
555
|
-
}
|
|
556
|
-
function V(e) {
|
|
557
|
-
return e === "indeterminate";
|
|
558
|
-
}
|
|
559
|
-
function se(e) {
|
|
560
|
-
return V(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
561
|
-
}
|
|
562
|
-
function Ot(e) {
|
|
563
|
-
const n = document.activeElement;
|
|
564
|
-
for (const t of e)
|
|
565
|
-
if (t === n || (t.focus(), document.activeElement !== n)) return;
|
|
566
|
-
}
|
|
567
|
-
function Dt(e, n) {
|
|
568
|
-
return e.map((t, r) => e[(n + r) % e.length]);
|
|
569
|
-
}
|
|
570
|
-
function kt(e, n, t) {
|
|
571
|
-
const u = n.length > 1 && Array.from(n).every((p) => p === n[0]) ? n[0] : n, s = t ? e.indexOf(t) : -1;
|
|
572
|
-
let d = Dt(e, Math.max(s, 0));
|
|
573
|
-
u.length === 1 && (d = d.filter((p) => p !== t));
|
|
574
|
-
const h = d.find(
|
|
575
|
-
(p) => p.toLowerCase().startsWith(u.toLowerCase())
|
|
576
|
-
);
|
|
577
|
-
return h !== t ? h : void 0;
|
|
578
|
-
}
|
|
579
|
-
function Nt(e, n) {
|
|
580
|
-
const { x: t, y: r } = e;
|
|
581
|
-
let u = !1;
|
|
582
|
-
for (let s = 0, d = n.length - 1; s < n.length; d = s++) {
|
|
583
|
-
const m = n[s], h = n[d], p = m.x, l = m.y, c = h.x, f = h.y;
|
|
584
|
-
l > r != f > r && t < (c - p) * (r - l) / (f - l) + p && (u = !u);
|
|
585
|
-
}
|
|
586
|
-
return u;
|
|
587
|
-
}
|
|
588
|
-
function Ft(e, n) {
|
|
589
|
-
if (!n) return !1;
|
|
590
|
-
const t = { x: e.clientX, y: e.clientY };
|
|
591
|
-
return Nt(t, n);
|
|
592
|
-
}
|
|
593
|
-
function O(e) {
|
|
594
|
-
return (n) => n.pointerType === "mouse" ? e(n) : void 0;
|
|
595
|
-
}
|
|
596
|
-
var Qt = ge, en = J, tn = _e, nn = Re, on = ne, rn = Se, sn = X, cn = Ee, an = we, un = be, ln = Ae, dn = je, fn = Oe, pn = ke, mn = Ne, hn = Le;
|
|
597
|
-
export {
|
|
598
|
-
en as A,
|
|
599
|
-
nn as C,
|
|
600
|
-
on as G,
|
|
601
|
-
sn as I,
|
|
602
|
-
rn as L,
|
|
603
|
-
tn as P,
|
|
604
|
-
Qt as R,
|
|
605
|
-
dn as S,
|
|
606
|
-
cn as a,
|
|
607
|
-
ln as b,
|
|
608
|
-
Jt as c,
|
|
609
|
-
un as d,
|
|
610
|
-
pn as e,
|
|
611
|
-
hn as f,
|
|
612
|
-
mn as g,
|
|
613
|
-
an as h,
|
|
614
|
-
fn as i
|
|
615
|
-
};
|
package/dist/index-D02K8KOB.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import * as A from "react";
|
|
2
|
-
import r from "react";
|
|
3
|
-
import { c as D } from "./index-FxyLF8MY.js";
|
|
4
|
-
import { u as S, a as M } from "./index-6oTEokEx.js";
|
|
5
|
-
import { j as d } from "./jsx-runtime-BzflLqGi.js";
|
|
6
|
-
function h(l) {
|
|
7
|
-
const i = l + "CollectionProvider", [E, N] = D(i), [_, m] = E(
|
|
8
|
-
i,
|
|
9
|
-
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
10
|
-
), p = (c) => {
|
|
11
|
-
const { scope: e, children: s } = c, t = r.useRef(null), o = r.useRef(/* @__PURE__ */ new Map()).current;
|
|
12
|
-
return /* @__PURE__ */ d.jsx(_, { scope: e, itemMap: o, collectionRef: t, children: s });
|
|
13
|
-
};
|
|
14
|
-
p.displayName = i;
|
|
15
|
-
const f = l + "CollectionSlot", v = M(f), C = r.forwardRef(
|
|
16
|
-
(c, e) => {
|
|
17
|
-
const { scope: s, children: t } = c, o = m(f, s), n = S(e, o.collectionRef);
|
|
18
|
-
return /* @__PURE__ */ d.jsx(v, { ref: n, children: t });
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
C.displayName = f;
|
|
22
|
-
const u = l + "CollectionItemSlot", R = "data-radix-collection-item", T = M(u), x = r.forwardRef(
|
|
23
|
-
(c, e) => {
|
|
24
|
-
const { scope: s, children: t, ...o } = c, n = r.useRef(null), I = S(e, n), a = m(u, s);
|
|
25
|
-
return r.useEffect(() => (a.itemMap.set(n, { ref: n, ...o }), () => void a.itemMap.delete(n))), /* @__PURE__ */ d.jsx(T, { [R]: "", ref: I, children: t });
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
x.displayName = u;
|
|
29
|
-
function O(c) {
|
|
30
|
-
const e = m(l + "CollectionConsumer", c);
|
|
31
|
-
return r.useCallback(() => {
|
|
32
|
-
const t = e.collectionRef.current;
|
|
33
|
-
if (!t) return [];
|
|
34
|
-
const o = Array.from(t.querySelectorAll(`[${R}]`));
|
|
35
|
-
return Array.from(e.itemMap.values()).sort(
|
|
36
|
-
(a, y) => o.indexOf(a.ref.current) - o.indexOf(y.ref.current)
|
|
37
|
-
);
|
|
38
|
-
}, [e.collectionRef, e.itemMap]);
|
|
39
|
-
}
|
|
40
|
-
return [
|
|
41
|
-
{ Provider: p, Slot: C, ItemSlot: x },
|
|
42
|
-
O,
|
|
43
|
-
N
|
|
44
|
-
];
|
|
45
|
-
}
|
|
46
|
-
var j = A.createContext(void 0);
|
|
47
|
-
function b(l) {
|
|
48
|
-
const i = A.useContext(j);
|
|
49
|
-
return l || i || "ltr";
|
|
50
|
-
}
|
|
51
|
-
export {
|
|
52
|
-
h as c,
|
|
53
|
-
b as u
|
|
54
|
-
};
|
package/dist/index-D7hQvndv.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("react"),A=require("./index-cwZN7ZY3.cjs"),d=require("./index-BKbK2GzY.cjs"),x=require("./jsx-runtime-BB_1_6y_.cjs");function D(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const a=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(o,i,a.get?a:{enumerable:!0,get:()=>e[i]})}}return o.default=e,Object.freeze(o)}const j=D(r);function T(e){const o=e+"CollectionProvider",[i,a]=A.createContextScope(o),[E,m]=i(o,{collectionRef:{current:null},itemMap:new Map}),R=l=>{const{scope:t,children:u}=l,n=r.useRef(null),c=r.useRef(new Map).current;return x.jsxRuntimeExports.jsx(E,{scope:t,itemMap:c,collectionRef:n,children:u})};R.displayName=o;const p=e+"CollectionSlot",N=d.createSlot(p),S=r.forwardRef((l,t)=>{const{scope:u,children:n}=l,c=m(p,u),s=d.useComposedRefs(t,c.collectionRef);return x.jsxRuntimeExports.jsx(N,{ref:s,children:n})});S.displayName=p;const C=e+"CollectionItemSlot",I="data-radix-collection-item",_=d.createSlot(C),M=r.forwardRef((l,t)=>{const{scope:u,children:n,...c}=l,s=r.useRef(null),O=d.useComposedRefs(t,s),f=m(C,u);return r.useEffect(()=>(f.itemMap.set(s,{ref:s,...c}),()=>void f.itemMap.delete(s))),x.jsxRuntimeExports.jsx(_,{[I]:"",ref:O,children:n})});M.displayName=C;function v(l){const t=m(e+"CollectionConsumer",l);return r.useCallback(()=>{const n=t.collectionRef.current;if(!n)return[];const c=Array.from(n.querySelectorAll(`[${I}]`));return Array.from(t.itemMap.values()).sort((f,y)=>c.indexOf(f.ref.current)-c.indexOf(y.ref.current))},[t.collectionRef,t.itemMap])}return[{Provider:R,Slot:S,ItemSlot:M},v,a]}var b=j.createContext(void 0);function g(e){const o=j.useContext(b);return e||o||"ltr"}exports.createCollection=T;exports.useDirection=g;
|
package/dist/index-DQvx1rG_.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const l=require("react"),f=require("react-dom"),m=require("./index-BKbK2GzY.cjs"),p=require("./jsx-runtime-BB_1_6y_.cjs");function n(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const d=n(l),v=n(f);var b=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],O=b.reduce((e,t)=>{const i=m.createSlot(`Primitive.${t}`),r=d.forwardRef((c,o)=>{const{asChild:s,...a}=c,u=s?i:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsxRuntimeExports.jsx(u,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function h(e,t){e&&v.flushSync(()=>e.dispatchEvent(t))}exports.Primitive=O;exports.dispatchDiscreteCustomEvent=h;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const a=require("./jsx-runtime-BB_1_6y_.cjs"),$=require("react"),f=require("./index-BWaO7kQK.cjs"),E=require("./index-BKbK2GzY.cjs"),I=require("./index-cwZN7ZY3.cjs"),H=require("./index-VIUqZjyP.cjs"),h=require("./index-DXQ-7kNJ.cjs"),z=require("./index-WIv2ndLu.cjs"),l=require("./index-BGiGvaq8.cjs"),L=require("./index-Ce3QBKyj.cjs"),O=require("./index-IKJMQref.cjs"),_=require("./index-DQvx1rG_.cjs"),G=require("./index-DoxiiusW.cjs");function K(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const c=K($);var C="Popover",[b]=I.createContextScope(C,[l.createPopperScope]),P=l.createPopperScope(),[U,u]=b(C),w=e=>{const{__scopePopover:t,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:i=!1}=e,p=P(t),x=c.useRef(null),[m,g]=c.useState(!1),[R,d]=f.useControllableState({prop:r,defaultProp:n??!1,onChange:s,caller:C});return a.jsxRuntimeExports.jsx(l.Root2,{...p,children:a.jsxRuntimeExports.jsx(U,{scope:t,contentId:z.useId(),triggerRef:x,open:R,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(j=>!j),[d]),hasCustomAnchor:m,onCustomAnchorAdd:c.useCallback(()=>g(!0),[]),onCustomAnchorRemove:c.useCallback(()=>g(!1),[]),modal:i,children:o})})};w.displayName=C;var N="PopoverAnchor",S=c.forwardRef((e,t)=>{const{__scopePopover:o,...r}=e,n=u(N,o),s=P(o),{onCustomAnchorAdd:i,onCustomAnchorRemove:p}=n;return c.useEffect(()=>(i(),()=>p()),[i,p]),a.jsxRuntimeExports.jsx(l.Anchor,{...s,...r,ref:t})});S.displayName=N;var y="PopoverTrigger",F=c.forwardRef((e,t)=>{const{__scopePopover:o,...r}=e,n=u(y,o),s=P(o),i=E.useComposedRefs(t,n.triggerRef),p=a.jsxRuntimeExports.jsx(_.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":q(n.open),...r,ref:i,onClick:f.composeEventHandlers(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:a.jsxRuntimeExports.jsx(l.Anchor,{asChild:!0,...s,children:p})});F.displayName=y;var A="PopoverPortal",[V,W]=b(A,{forceMount:void 0}),D=e=>{const{__scopePopover:t,forceMount:o,children:r,container:n}=e,s=u(A,t);return a.jsxRuntimeExports.jsx(V,{scope:t,forceMount:o,children:a.jsxRuntimeExports.jsx(O.Presence,{present:o||s.open,children:a.jsxRuntimeExports.jsx(L.Portal,{asChild:!0,container:n,children:r})})})};D.displayName=A;var v="PopoverContent",M=c.forwardRef((e,t)=>{const o=W(v,e.__scopePopover),{forceMount:r=o.forceMount,...n}=e,s=u(v,e.__scopePopover);return a.jsxRuntimeExports.jsx(O.Presence,{present:r||s.open,children:s.modal?a.jsxRuntimeExports.jsx(B,{...n,ref:t}):a.jsxRuntimeExports.jsx(J,{...n,ref:t})})});M.displayName=v;var Z=E.createSlot("PopoverContent.RemoveScroll"),B=c.forwardRef((e,t)=>{const o=u(v,e.__scopePopover),r=c.useRef(null),n=E.useComposedRefs(t,r),s=c.useRef(!1);return c.useEffect(()=>{const i=r.current;if(i)return h.hideOthers(i)},[]),a.jsxRuntimeExports.jsx(h.ReactRemoveScroll,{as:Z,allowPinchZoom:!0,children:a.jsxRuntimeExports.jsx(T,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:f.composeEventHandlers(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:f.composeEventHandlers(e.onPointerDownOutside,i=>{const p=i.detail.originalEvent,x=p.button===0&&p.ctrlKey===!0,m=p.button===2||x;s.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:f.composeEventHandlers(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),J=c.forwardRef((e,t)=>{const o=u(v,e.__scopePopover),r=c.useRef(!1),n=c.useRef(!1);return a.jsxRuntimeExports.jsx(T,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const i=s.target;o.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),T=c.forwardRef((e,t)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:p,onPointerDownOutside:x,onFocusOutside:m,onInteractOutside:g,...R}=e,d=u(v,o),j=P(o);return h.useFocusGuards(),a.jsxRuntimeExports.jsx(h.FocusScope,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:a.jsxRuntimeExports.jsx(H.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:g,onEscapeKeyDown:p,onPointerDownOutside:x,onFocusOutside:m,onDismiss:()=>d.onOpenChange(!1),children:a.jsxRuntimeExports.jsx(l.Content,{"data-state":q(d.open),role:"dialog",id:d.contentId,...j,...R,ref:t,style:{...R.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),k="PopoverClose",Q=c.forwardRef((e,t)=>{const{__scopePopover:o,...r}=e,n=u(k,o);return a.jsxRuntimeExports.jsx(_.Primitive.button,{type:"button",...r,ref:t,onClick:f.composeEventHandlers(e.onClick,()=>n.onOpenChange(!1))})});Q.displayName=k;var X="PopoverArrow",Y=c.forwardRef((e,t)=>{const{__scopePopover:o,...r}=e,n=P(o);return a.jsxRuntimeExports.jsx(l.Arrow,{...n,...r,ref:t})});Y.displayName=X;function q(e){return e?"open":"closed"}var ee=w,oe=S,te=F,re=D,ne=M;function se({...e}){return a.jsxRuntimeExports.jsx(ee,{"data-slot":"popover",...e})}function ae({...e}){return a.jsxRuntimeExports.jsx(te,{"data-slot":"popover-trigger",...e})}function ie({className:e,align:t="center",sideOffset:o=4,...r}){return a.jsxRuntimeExports.jsx(re,{children:a.jsxRuntimeExports.jsx(ne,{"data-slot":"popover-content",align:t,sideOffset:o,className:G.cn("adm:bg-popover adm:text-popover-foreground adm:data-[state=open]:animate-in adm:data-[state=closed]:animate-out adm:data-[state=closed]:fade-out-0 adm:data-[state=open]:fade-in-0 adm:data-[state=closed]:zoom-out-95 adm:data-[state=open]:zoom-in-95 adm:data-[side=bottom]:slide-in-from-top-2 adm:data-[side=left]:slide-in-from-right-2 adm:data-[side=right]:slide-in-from-left-2 adm:data-[side=top]:slide-in-from-bottom-2 adm:z-50 adm:w-72 adm:origin-(--radix-popover-content-transform-origin) adm:rounded-md adm:border adm:p-4 adm:shadow-xs adm:outline-hidden",e),...r})})}function ce({...e}){return a.jsxRuntimeExports.jsx(oe,{"data-slot":"popover-anchor",...e})}exports.Popover=se;exports.PopoverAnchor=ce;exports.PopoverContent=ie;exports.PopoverTrigger=ae;
|