@la-batcave/ui 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -0
- package/dist/Alert.d.ts +27 -0
- package/dist/Alert.js +56 -0
- package/dist/Avatar.d.ts +20 -0
- package/dist/Avatar.js +40 -0
- package/dist/Badge.d.ts +56 -0
- package/dist/Badge.js +74 -0
- package/dist/Button.d.ts +53 -0
- package/dist/Button.js +66 -0
- package/dist/Card.d.ts +18 -0
- package/dist/Card.js +98 -0
- package/dist/CodeBlock.d.ts +45 -0
- package/dist/CodeBlock.js +306 -0
- package/dist/Collapse.d.ts +58 -0
- package/dist/Collapse.js +89 -0
- package/dist/Combobox.d.ts +44 -0
- package/dist/Combobox.js +409 -0
- package/dist/DarkMode.d.ts +59 -0
- package/dist/DarkMode.js +56 -0
- package/dist/DatePicker.d.ts +48 -0
- package/dist/DatePicker.js +2954 -0
- package/dist/Dialog.d.ts +119 -0
- package/dist/Dialog.js +337 -0
- package/dist/Drawer.d.ts +28 -0
- package/dist/Drawer.js +1126 -0
- package/dist/Dropdown.d.ts +23 -0
- package/dist/Dropdown.js +247 -0
- package/dist/EasyForm.d.ts +138 -0
- package/dist/EasyForm.js +286 -0
- package/dist/HoverCard.d.ts +10 -0
- package/dist/HoverCard.js +195 -0
- package/dist/Input.d.ts +230 -0
- package/dist/Input.js +2216 -0
- package/dist/LogViewer.d.ts +57 -0
- package/dist/LogViewer.js +120 -0
- package/dist/Menubar.d.ts +32 -0
- package/dist/Menubar.js +398 -0
- package/dist/Navbar.d.ts +20 -0
- package/dist/Navbar.js +31 -0
- package/dist/Pagination.d.ts +78 -0
- package/dist/Pagination.js +106 -0
- package/dist/Popover.d.ts +11 -0
- package/dist/Popover.js +28 -0
- package/dist/ProgressBar.d.ts +35 -0
- package/dist/ProgressBar.js +210 -0
- package/dist/Resizable.d.ts +23 -0
- package/dist/Resizable.js +1532 -0
- package/dist/Separator.d.ts +4 -0
- package/dist/Separator.js +46 -0
- package/dist/Sheet.d.ts +29 -0
- package/dist/Sheet.js +104 -0
- package/dist/Sidebar.d.ts +117 -0
- package/dist/Sidebar.js +237 -0
- package/dist/Skeleton.d.ts +57 -0
- package/dist/Skeleton.js +47 -0
- package/dist/Table.d.ts +71 -0
- package/dist/Table.js +94 -0
- package/dist/Tabs.d.ts +76 -0
- package/dist/Tabs.js +202 -0
- package/dist/Toast.d.ts +54 -0
- package/dist/Toast.js +827 -0
- package/dist/Tooltip.d.ts +29 -0
- package/dist/Tooltip.js +352 -0
- package/dist/Typography.d.ts +101 -0
- package/dist/Typography.js +123 -0
- package/dist/Widget.d.ts +133 -0
- package/dist/Widget.js +207 -0
- package/dist/_shared/Combination-D_l4PLF_.js +676 -0
- package/dist/_shared/index-B03TCNO5.js +142 -0
- package/dist/_shared/index-B1f-hyuh.js +31 -0
- package/dist/_shared/index-BC7vfx-u.js +13 -0
- package/dist/_shared/index-BrLJJgkl.js +67 -0
- package/dist/_shared/index-C0gNQvxa.js +269 -0
- package/dist/_shared/index-C3aZemLI.js +268 -0
- package/dist/_shared/index-CXeb1OMI.js +198 -0
- package/dist/_shared/index-CukUn3R0.js +626 -0
- package/dist/_shared/index-DLcqcWxM.js +29 -0
- package/dist/_shared/index-DlSuDb9N.js +283 -0
- package/dist/_shared/index-V-Ajw7Ac.js +79 -0
- package/dist/_shared/index-uPOYJZpG.js +34 -0
- package/dist/_shared/index-uu9PT5Nu.js +1588 -0
- package/dist/_shared/utils-eGXXUFl7.js +2935 -0
- package/dist/backgrounds/Aurora.d.ts +7 -0
- package/dist/backgrounds/Aurora.js +126 -0
- package/dist/backgrounds/Iridescence.d.ts +7 -0
- package/dist/backgrounds/Iridescence.js +77 -0
- package/dist/backgrounds/Lightning.d.ts +8 -0
- package/dist/backgrounds/Lightning.js +75 -0
- package/dist/backgrounds/LiquidChrome.d.ts +9 -0
- package/dist/backgrounds/LiquidChrome.js +89 -0
- package/dist/backgrounds/Particles.d.ts +15 -0
- package/dist/backgrounds/Particles.js +137 -0
- package/dist/backgrounds/PixelSnow.d.ts +9 -0
- package/dist/backgrounds/PixelSnow.js +52 -0
- package/dist/backgrounds/Silk.d.ts +8 -0
- package/dist/backgrounds/Silk.js +92 -0
- package/dist/backgrounds/Squares.d.ts +9 -0
- package/dist/backgrounds/Squares.js +75 -0
- package/dist/backgrounds/Threads.d.ts +7 -0
- package/dist/backgrounds/Threads.js +110 -0
- package/dist/backgrounds/Waves.d.ts +14 -0
- package/dist/backgrounds/Waves.js +139 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/package.json +318 -0
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { P as j, c as v, a as We, d as le } from "./index-CXeb1OMI.js";
|
|
3
|
+
import { c as de, a as Ye, I as Xe, R as He, u as $e } from "./index-C0gNQvxa.js";
|
|
4
|
+
import { c as fe, u as N } from "./index-DLcqcWxM.js";
|
|
5
|
+
import { P as ze, D as Ze } from "./index-B03TCNO5.js";
|
|
6
|
+
import { h as qe, u as Je, R as Qe, F as et } from "./Combination-D_l4PLF_.js";
|
|
7
|
+
import { c as pe, C as tt, A as nt, R as ot, a as rt } from "./index-uu9PT5Nu.js";
|
|
8
|
+
import { P as k, d as ct } from "./index-V-Ajw7Ac.js";
|
|
9
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
10
|
+
// @__NO_SIDE_EFFECTS__
|
|
11
|
+
function at(e) {
|
|
12
|
+
const n = /* @__PURE__ */ st(e), t = r.forwardRef((o, c) => {
|
|
13
|
+
const { children: a, ...l } = o, f = r.Children.toArray(a), m = f.find(it);
|
|
14
|
+
if (m) {
|
|
15
|
+
const p = m.props.children, d = f.map((s) => s === m ? r.Children.count(p) > 1 ? r.Children.only(null) : r.isValidElement(p) ? p.props.children : null : s);
|
|
16
|
+
return /* @__PURE__ */ u(n, { ...l, ref: c, children: r.isValidElement(p) ? r.cloneElement(p, void 0, d) : null });
|
|
17
|
+
}
|
|
18
|
+
return /* @__PURE__ */ u(n, { ...l, ref: c, children: a });
|
|
19
|
+
});
|
|
20
|
+
return t.displayName = `${e}.Slot`, t;
|
|
21
|
+
}
|
|
22
|
+
// @__NO_SIDE_EFFECTS__
|
|
23
|
+
function st(e) {
|
|
24
|
+
const n = r.forwardRef((t, o) => {
|
|
25
|
+
const { children: c, ...a } = t;
|
|
26
|
+
if (r.isValidElement(c)) {
|
|
27
|
+
const l = dt(c), f = lt(a, c.props);
|
|
28
|
+
return c.type !== r.Fragment && (f.ref = o ? fe(o, l) : l), r.cloneElement(c, f);
|
|
29
|
+
}
|
|
30
|
+
return r.Children.count(c) > 1 ? r.Children.only(null) : null;
|
|
31
|
+
});
|
|
32
|
+
return n.displayName = `${e}.SlotClone`, n;
|
|
33
|
+
}
|
|
34
|
+
var ut = /* @__PURE__ */ Symbol("radix.slottable");
|
|
35
|
+
function it(e) {
|
|
36
|
+
return r.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === ut;
|
|
37
|
+
}
|
|
38
|
+
function lt(e, n) {
|
|
39
|
+
const t = { ...n };
|
|
40
|
+
for (const o in n) {
|
|
41
|
+
const c = e[o], a = n[o];
|
|
42
|
+
/^on[A-Z]/.test(o) ? c && a ? t[o] = (...f) => {
|
|
43
|
+
const m = a(...f);
|
|
44
|
+
return c(...f), m;
|
|
45
|
+
} : c && (t[o] = c) : o === "style" ? t[o] = { ...c, ...a } : o === "className" && (t[o] = [c, a].filter(Boolean).join(" "));
|
|
46
|
+
}
|
|
47
|
+
return { ...e, ...t };
|
|
48
|
+
}
|
|
49
|
+
function dt(e) {
|
|
50
|
+
let n = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, t = n && "isReactWarning" in n && n.isReactWarning;
|
|
51
|
+
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);
|
|
52
|
+
}
|
|
53
|
+
var Z = ["Enter", " "], ft = ["ArrowDown", "PageUp", "Home"], me = ["ArrowUp", "PageDown", "End"], pt = [...ft, ...me], mt = {
|
|
54
|
+
ltr: [...Z, "ArrowRight"],
|
|
55
|
+
rtl: [...Z, "ArrowLeft"]
|
|
56
|
+
}, ht = {
|
|
57
|
+
ltr: ["ArrowLeft"],
|
|
58
|
+
rtl: ["ArrowRight"]
|
|
59
|
+
}, F = "Menu", [O, Ct, vt] = Ye(F), [E, $t] = We(F, [
|
|
60
|
+
vt,
|
|
61
|
+
pe,
|
|
62
|
+
de
|
|
63
|
+
]), W = pe(), he = de(), [Mt, P] = E(F), [gt, L] = E(F), Ce = (e) => {
|
|
64
|
+
const { __scopeMenu: n, open: t = !1, children: o, dir: c, onOpenChange: a, modal: l = !0 } = e, f = W(n), [m, p] = r.useState(null), d = r.useRef(!1), s = le(a), h = $e(c);
|
|
65
|
+
return r.useEffect(() => {
|
|
66
|
+
const g = () => {
|
|
67
|
+
d.current = !0, document.addEventListener("pointerdown", C, { capture: !0, once: !0 }), document.addEventListener("pointermove", C, { capture: !0, once: !0 });
|
|
68
|
+
}, C = () => d.current = !1;
|
|
69
|
+
return document.addEventListener("keydown", g, { capture: !0 }), () => {
|
|
70
|
+
document.removeEventListener("keydown", g, { capture: !0 }), document.removeEventListener("pointerdown", C, { capture: !0 }), document.removeEventListener("pointermove", C, { capture: !0 });
|
|
71
|
+
};
|
|
72
|
+
}, []), /* @__PURE__ */ u(ot, { ...f, children: /* @__PURE__ */ u(
|
|
73
|
+
Mt,
|
|
74
|
+
{
|
|
75
|
+
scope: n,
|
|
76
|
+
open: t,
|
|
77
|
+
onOpenChange: s,
|
|
78
|
+
content: m,
|
|
79
|
+
onContentChange: p,
|
|
80
|
+
children: /* @__PURE__ */ u(
|
|
81
|
+
gt,
|
|
82
|
+
{
|
|
83
|
+
scope: n,
|
|
84
|
+
onClose: r.useCallback(() => s(!1), [s]),
|
|
85
|
+
isUsingKeyboardRef: d,
|
|
86
|
+
dir: h,
|
|
87
|
+
modal: l,
|
|
88
|
+
children: o
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
) });
|
|
93
|
+
};
|
|
94
|
+
Ce.displayName = F;
|
|
95
|
+
var _t = "MenuAnchor", q = r.forwardRef(
|
|
96
|
+
(e, n) => {
|
|
97
|
+
const { __scopeMenu: t, ...o } = e, c = W(t);
|
|
98
|
+
return /* @__PURE__ */ u(nt, { ...c, ...o, ref: n });
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
q.displayName = _t;
|
|
102
|
+
var J = "MenuPortal", [Rt, ve] = E(J, {
|
|
103
|
+
forceMount: void 0
|
|
104
|
+
}), Me = (e) => {
|
|
105
|
+
const { __scopeMenu: n, forceMount: t, children: o, container: c } = e, a = P(J, n);
|
|
106
|
+
return /* @__PURE__ */ u(Rt, { scope: n, forceMount: t, children: /* @__PURE__ */ u(j, { present: t || a.open, children: /* @__PURE__ */ u(ze, { asChild: !0, container: c, children: o }) }) });
|
|
107
|
+
};
|
|
108
|
+
Me.displayName = J;
|
|
109
|
+
var _ = "MenuContent", [Et, Q] = E(_), ge = r.forwardRef(
|
|
110
|
+
(e, n) => {
|
|
111
|
+
const t = ve(_, e.__scopeMenu), { forceMount: o = t.forceMount, ...c } = e, a = P(_, e.__scopeMenu), l = L(_, e.__scopeMenu);
|
|
112
|
+
return /* @__PURE__ */ u(O.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(j, { present: o || a.open, children: /* @__PURE__ */ u(O.Slot, { scope: e.__scopeMenu, children: l.modal ? /* @__PURE__ */ u(Pt, { ...c, ref: n }) : /* @__PURE__ */ u(St, { ...c, ref: n }) }) }) });
|
|
113
|
+
}
|
|
114
|
+
), Pt = r.forwardRef(
|
|
115
|
+
(e, n) => {
|
|
116
|
+
const t = P(_, e.__scopeMenu), o = r.useRef(null), c = N(n, o);
|
|
117
|
+
return r.useEffect(() => {
|
|
118
|
+
const a = o.current;
|
|
119
|
+
if (a) return qe(a);
|
|
120
|
+
}, []), /* @__PURE__ */ u(
|
|
121
|
+
ee,
|
|
122
|
+
{
|
|
123
|
+
...e,
|
|
124
|
+
ref: c,
|
|
125
|
+
trapFocus: t.open,
|
|
126
|
+
disableOutsidePointerEvents: t.open,
|
|
127
|
+
disableOutsideScroll: !0,
|
|
128
|
+
onFocusOutside: v(
|
|
129
|
+
e.onFocusOutside,
|
|
130
|
+
(a) => a.preventDefault(),
|
|
131
|
+
{ checkForDefaultPrevented: !1 }
|
|
132
|
+
),
|
|
133
|
+
onDismiss: () => t.onOpenChange(!1)
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
), St = r.forwardRef((e, n) => {
|
|
138
|
+
const t = P(_, e.__scopeMenu);
|
|
139
|
+
return /* @__PURE__ */ u(
|
|
140
|
+
ee,
|
|
141
|
+
{
|
|
142
|
+
...e,
|
|
143
|
+
ref: n,
|
|
144
|
+
trapFocus: !1,
|
|
145
|
+
disableOutsidePointerEvents: !1,
|
|
146
|
+
disableOutsideScroll: !1,
|
|
147
|
+
onDismiss: () => t.onOpenChange(!1)
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}), yt = /* @__PURE__ */ at("MenuContent.ScrollLock"), ee = r.forwardRef(
|
|
151
|
+
(e, n) => {
|
|
152
|
+
const {
|
|
153
|
+
__scopeMenu: t,
|
|
154
|
+
loop: o = !1,
|
|
155
|
+
trapFocus: c,
|
|
156
|
+
onOpenAutoFocus: a,
|
|
157
|
+
onCloseAutoFocus: l,
|
|
158
|
+
disableOutsidePointerEvents: f,
|
|
159
|
+
onEntryFocus: m,
|
|
160
|
+
onEscapeKeyDown: p,
|
|
161
|
+
onPointerDownOutside: d,
|
|
162
|
+
onFocusOutside: s,
|
|
163
|
+
onInteractOutside: h,
|
|
164
|
+
onDismiss: g,
|
|
165
|
+
disableOutsideScroll: C,
|
|
166
|
+
...S
|
|
167
|
+
} = e, b = P(_, t), y = L(_, t), Fe = W(t), Le = he(t), re = Ct(t), [Ke, ce] = r.useState(null), K = r.useRef(null), Ge = N(n, K, b.onContentChange), G = r.useRef(0), U = r.useRef(""), Ue = r.useRef(0), X = r.useRef(null), ae = r.useRef("right"), H = r.useRef(0), Ve = C ? Qe : r.Fragment, Be = C ? { as: yt, allowPinchZoom: !0 } : void 0, je = (i) => {
|
|
168
|
+
const w = U.current + i, R = re().filter((M) => !M.disabled), x = document.activeElement, $ = R.find((M) => M.ref.current === x)?.textValue, z = R.map((M) => M.textValue), se = Lt(z, w, $), T = R.find((M) => M.textValue === se)?.ref.current;
|
|
169
|
+
(function M(ue) {
|
|
170
|
+
U.current = ue, window.clearTimeout(G.current), ue !== "" && (G.current = window.setTimeout(() => M(""), 1e3));
|
|
171
|
+
})(w), T && setTimeout(() => T.focus());
|
|
172
|
+
};
|
|
173
|
+
r.useEffect(() => () => window.clearTimeout(G.current), []), Je();
|
|
174
|
+
const I = r.useCallback((i) => ae.current === X.current?.side && Gt(i, X.current?.area), []);
|
|
175
|
+
return /* @__PURE__ */ u(
|
|
176
|
+
Et,
|
|
177
|
+
{
|
|
178
|
+
scope: t,
|
|
179
|
+
searchRef: U,
|
|
180
|
+
onItemEnter: r.useCallback(
|
|
181
|
+
(i) => {
|
|
182
|
+
I(i) && i.preventDefault();
|
|
183
|
+
},
|
|
184
|
+
[I]
|
|
185
|
+
),
|
|
186
|
+
onItemLeave: r.useCallback(
|
|
187
|
+
(i) => {
|
|
188
|
+
I(i) || (K.current?.focus(), ce(null));
|
|
189
|
+
},
|
|
190
|
+
[I]
|
|
191
|
+
),
|
|
192
|
+
onTriggerLeave: r.useCallback(
|
|
193
|
+
(i) => {
|
|
194
|
+
I(i) && i.preventDefault();
|
|
195
|
+
},
|
|
196
|
+
[I]
|
|
197
|
+
),
|
|
198
|
+
pointerGraceTimerRef: Ue,
|
|
199
|
+
onPointerGraceIntentChange: r.useCallback((i) => {
|
|
200
|
+
X.current = i;
|
|
201
|
+
}, []),
|
|
202
|
+
children: /* @__PURE__ */ u(Ve, { ...Be, children: /* @__PURE__ */ u(
|
|
203
|
+
et,
|
|
204
|
+
{
|
|
205
|
+
asChild: !0,
|
|
206
|
+
trapped: c,
|
|
207
|
+
onMountAutoFocus: v(a, (i) => {
|
|
208
|
+
i.preventDefault(), K.current?.focus({ preventScroll: !0 });
|
|
209
|
+
}),
|
|
210
|
+
onUnmountAutoFocus: l,
|
|
211
|
+
children: /* @__PURE__ */ u(
|
|
212
|
+
Ze,
|
|
213
|
+
{
|
|
214
|
+
asChild: !0,
|
|
215
|
+
disableOutsidePointerEvents: f,
|
|
216
|
+
onEscapeKeyDown: p,
|
|
217
|
+
onPointerDownOutside: d,
|
|
218
|
+
onFocusOutside: s,
|
|
219
|
+
onInteractOutside: h,
|
|
220
|
+
onDismiss: g,
|
|
221
|
+
children: /* @__PURE__ */ u(
|
|
222
|
+
He,
|
|
223
|
+
{
|
|
224
|
+
asChild: !0,
|
|
225
|
+
...Le,
|
|
226
|
+
dir: y.dir,
|
|
227
|
+
orientation: "vertical",
|
|
228
|
+
loop: o,
|
|
229
|
+
currentTabStopId: Ke,
|
|
230
|
+
onCurrentTabStopIdChange: ce,
|
|
231
|
+
onEntryFocus: v(m, (i) => {
|
|
232
|
+
y.isUsingKeyboardRef.current || i.preventDefault();
|
|
233
|
+
}),
|
|
234
|
+
preventScrollOnEntryFocus: !0,
|
|
235
|
+
children: /* @__PURE__ */ u(
|
|
236
|
+
tt,
|
|
237
|
+
{
|
|
238
|
+
role: "menu",
|
|
239
|
+
"aria-orientation": "vertical",
|
|
240
|
+
"data-state": ke(b.open),
|
|
241
|
+
"data-radix-menu-content": "",
|
|
242
|
+
dir: y.dir,
|
|
243
|
+
...Fe,
|
|
244
|
+
...S,
|
|
245
|
+
ref: Ge,
|
|
246
|
+
style: { outline: "none", ...S.style },
|
|
247
|
+
onKeyDown: v(S.onKeyDown, (i) => {
|
|
248
|
+
const R = i.target.closest("[data-radix-menu-content]") === i.currentTarget, x = i.ctrlKey || i.altKey || i.metaKey, $ = i.key.length === 1;
|
|
249
|
+
R && (i.key === "Tab" && i.preventDefault(), !x && $ && je(i.key));
|
|
250
|
+
const z = K.current;
|
|
251
|
+
if (i.target !== z || !pt.includes(i.key)) return;
|
|
252
|
+
i.preventDefault();
|
|
253
|
+
const T = re().filter((M) => !M.disabled).map((M) => M.ref.current);
|
|
254
|
+
me.includes(i.key) && T.reverse(), kt(T);
|
|
255
|
+
}),
|
|
256
|
+
onBlur: v(e.onBlur, (i) => {
|
|
257
|
+
i.currentTarget.contains(i.target) || (window.clearTimeout(G.current), U.current = "");
|
|
258
|
+
}),
|
|
259
|
+
onPointerMove: v(
|
|
260
|
+
e.onPointerMove,
|
|
261
|
+
D((i) => {
|
|
262
|
+
const w = i.target, R = H.current !== i.clientX;
|
|
263
|
+
if (i.currentTarget.contains(w) && R) {
|
|
264
|
+
const x = i.clientX > H.current ? "right" : "left";
|
|
265
|
+
ae.current = x, H.current = i.clientX;
|
|
266
|
+
}
|
|
267
|
+
})
|
|
268
|
+
)
|
|
269
|
+
}
|
|
270
|
+
)
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
}
|
|
274
|
+
)
|
|
275
|
+
}
|
|
276
|
+
) })
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
);
|
|
281
|
+
ge.displayName = _;
|
|
282
|
+
var It = "MenuGroup", te = r.forwardRef(
|
|
283
|
+
(e, n) => {
|
|
284
|
+
const { __scopeMenu: t, ...o } = e;
|
|
285
|
+
return /* @__PURE__ */ u(k.div, { role: "group", ...o, ref: n });
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
te.displayName = It;
|
|
289
|
+
var wt = "MenuLabel", _e = r.forwardRef(
|
|
290
|
+
(e, n) => {
|
|
291
|
+
const { __scopeMenu: t, ...o } = e;
|
|
292
|
+
return /* @__PURE__ */ u(k.div, { ...o, ref: n });
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
_e.displayName = wt;
|
|
296
|
+
var V = "MenuItem", ie = "menu.itemSelect", Y = r.forwardRef(
|
|
297
|
+
(e, n) => {
|
|
298
|
+
const { disabled: t = !1, onSelect: o, ...c } = e, a = r.useRef(null), l = L(V, e.__scopeMenu), f = Q(V, e.__scopeMenu), m = N(n, a), p = r.useRef(!1), d = () => {
|
|
299
|
+
const s = a.current;
|
|
300
|
+
if (!t && s) {
|
|
301
|
+
const h = new CustomEvent(ie, { bubbles: !0, cancelable: !0 });
|
|
302
|
+
s.addEventListener(ie, (g) => o?.(g), { once: !0 }), ct(s, h), h.defaultPrevented ? p.current = !1 : l.onClose();
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
return /* @__PURE__ */ u(
|
|
306
|
+
Re,
|
|
307
|
+
{
|
|
308
|
+
...c,
|
|
309
|
+
ref: m,
|
|
310
|
+
disabled: t,
|
|
311
|
+
onClick: v(e.onClick, d),
|
|
312
|
+
onPointerDown: (s) => {
|
|
313
|
+
e.onPointerDown?.(s), p.current = !0;
|
|
314
|
+
},
|
|
315
|
+
onPointerUp: v(e.onPointerUp, (s) => {
|
|
316
|
+
p.current || s.currentTarget?.click();
|
|
317
|
+
}),
|
|
318
|
+
onKeyDown: v(e.onKeyDown, (s) => {
|
|
319
|
+
const h = f.searchRef.current !== "";
|
|
320
|
+
t || h && s.key === " " || Z.includes(s.key) && (s.currentTarget.click(), s.preventDefault());
|
|
321
|
+
})
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
Y.displayName = V;
|
|
327
|
+
var Re = r.forwardRef(
|
|
328
|
+
(e, n) => {
|
|
329
|
+
const { __scopeMenu: t, disabled: o = !1, textValue: c, ...a } = e, l = Q(V, t), f = he(t), m = r.useRef(null), p = N(n, m), [d, s] = r.useState(!1), [h, g] = r.useState("");
|
|
330
|
+
return r.useEffect(() => {
|
|
331
|
+
const C = m.current;
|
|
332
|
+
C && g((C.textContent ?? "").trim());
|
|
333
|
+
}, [a.children]), /* @__PURE__ */ u(
|
|
334
|
+
O.ItemSlot,
|
|
335
|
+
{
|
|
336
|
+
scope: t,
|
|
337
|
+
disabled: o,
|
|
338
|
+
textValue: c ?? h,
|
|
339
|
+
children: /* @__PURE__ */ u(Xe, { asChild: !0, ...f, focusable: !o, children: /* @__PURE__ */ u(
|
|
340
|
+
k.div,
|
|
341
|
+
{
|
|
342
|
+
role: "menuitem",
|
|
343
|
+
"data-highlighted": d ? "" : void 0,
|
|
344
|
+
"aria-disabled": o || void 0,
|
|
345
|
+
"data-disabled": o ? "" : void 0,
|
|
346
|
+
...a,
|
|
347
|
+
ref: p,
|
|
348
|
+
onPointerMove: v(
|
|
349
|
+
e.onPointerMove,
|
|
350
|
+
D((C) => {
|
|
351
|
+
o ? l.onItemLeave(C) : (l.onItemEnter(C), C.defaultPrevented || C.currentTarget.focus({ preventScroll: !0 }));
|
|
352
|
+
})
|
|
353
|
+
),
|
|
354
|
+
onPointerLeave: v(
|
|
355
|
+
e.onPointerLeave,
|
|
356
|
+
D((C) => l.onItemLeave(C))
|
|
357
|
+
),
|
|
358
|
+
onFocus: v(e.onFocus, () => s(!0)),
|
|
359
|
+
onBlur: v(e.onBlur, () => s(!1))
|
|
360
|
+
}
|
|
361
|
+
) })
|
|
362
|
+
}
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
), bt = "MenuCheckboxItem", Ee = r.forwardRef(
|
|
366
|
+
(e, n) => {
|
|
367
|
+
const { checked: t = !1, onCheckedChange: o, ...c } = e;
|
|
368
|
+
return /* @__PURE__ */ u(we, { scope: e.__scopeMenu, checked: t, children: /* @__PURE__ */ u(
|
|
369
|
+
Y,
|
|
370
|
+
{
|
|
371
|
+
role: "menuitemcheckbox",
|
|
372
|
+
"aria-checked": B(t) ? "mixed" : t,
|
|
373
|
+
...c,
|
|
374
|
+
ref: n,
|
|
375
|
+
"data-state": oe(t),
|
|
376
|
+
onSelect: v(
|
|
377
|
+
c.onSelect,
|
|
378
|
+
() => o?.(B(t) ? !0 : !t),
|
|
379
|
+
{ checkForDefaultPrevented: !1 }
|
|
380
|
+
)
|
|
381
|
+
}
|
|
382
|
+
) });
|
|
383
|
+
}
|
|
384
|
+
);
|
|
385
|
+
Ee.displayName = bt;
|
|
386
|
+
var Pe = "MenuRadioGroup", [xt, Tt] = E(
|
|
387
|
+
Pe,
|
|
388
|
+
{ value: void 0, onValueChange: () => {
|
|
389
|
+
} }
|
|
390
|
+
), Se = r.forwardRef(
|
|
391
|
+
(e, n) => {
|
|
392
|
+
const { value: t, onValueChange: o, ...c } = e, a = le(o);
|
|
393
|
+
return /* @__PURE__ */ u(xt, { scope: e.__scopeMenu, value: t, onValueChange: a, children: /* @__PURE__ */ u(te, { ...c, ref: n }) });
|
|
394
|
+
}
|
|
395
|
+
);
|
|
396
|
+
Se.displayName = Pe;
|
|
397
|
+
var ye = "MenuRadioItem", Ie = r.forwardRef(
|
|
398
|
+
(e, n) => {
|
|
399
|
+
const { value: t, ...o } = e, c = Tt(ye, e.__scopeMenu), a = t === c.value;
|
|
400
|
+
return /* @__PURE__ */ u(we, { scope: e.__scopeMenu, checked: a, children: /* @__PURE__ */ u(
|
|
401
|
+
Y,
|
|
402
|
+
{
|
|
403
|
+
role: "menuitemradio",
|
|
404
|
+
"aria-checked": a,
|
|
405
|
+
...o,
|
|
406
|
+
ref: n,
|
|
407
|
+
"data-state": oe(a),
|
|
408
|
+
onSelect: v(
|
|
409
|
+
o.onSelect,
|
|
410
|
+
() => c.onValueChange?.(t),
|
|
411
|
+
{ checkForDefaultPrevented: !1 }
|
|
412
|
+
)
|
|
413
|
+
}
|
|
414
|
+
) });
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
Ie.displayName = ye;
|
|
418
|
+
var ne = "MenuItemIndicator", [we, At] = E(
|
|
419
|
+
ne,
|
|
420
|
+
{ checked: !1 }
|
|
421
|
+
), be = r.forwardRef(
|
|
422
|
+
(e, n) => {
|
|
423
|
+
const { __scopeMenu: t, forceMount: o, ...c } = e, a = At(ne, t);
|
|
424
|
+
return /* @__PURE__ */ u(
|
|
425
|
+
j,
|
|
426
|
+
{
|
|
427
|
+
present: o || B(a.checked) || a.checked === !0,
|
|
428
|
+
children: /* @__PURE__ */ u(
|
|
429
|
+
k.span,
|
|
430
|
+
{
|
|
431
|
+
...c,
|
|
432
|
+
ref: n,
|
|
433
|
+
"data-state": oe(a.checked)
|
|
434
|
+
}
|
|
435
|
+
)
|
|
436
|
+
}
|
|
437
|
+
);
|
|
438
|
+
}
|
|
439
|
+
);
|
|
440
|
+
be.displayName = ne;
|
|
441
|
+
var Ot = "MenuSeparator", xe = r.forwardRef(
|
|
442
|
+
(e, n) => {
|
|
443
|
+
const { __scopeMenu: t, ...o } = e;
|
|
444
|
+
return /* @__PURE__ */ u(
|
|
445
|
+
k.div,
|
|
446
|
+
{
|
|
447
|
+
role: "separator",
|
|
448
|
+
"aria-orientation": "horizontal",
|
|
449
|
+
...o,
|
|
450
|
+
ref: n
|
|
451
|
+
}
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
);
|
|
455
|
+
xe.displayName = Ot;
|
|
456
|
+
var Dt = "MenuArrow", Te = r.forwardRef(
|
|
457
|
+
(e, n) => {
|
|
458
|
+
const { __scopeMenu: t, ...o } = e, c = W(t);
|
|
459
|
+
return /* @__PURE__ */ u(rt, { ...c, ...o, ref: n });
|
|
460
|
+
}
|
|
461
|
+
);
|
|
462
|
+
Te.displayName = Dt;
|
|
463
|
+
var Nt = "MenuSub", [zt, Ae] = E(Nt), A = "MenuSubTrigger", Oe = r.forwardRef(
|
|
464
|
+
(e, n) => {
|
|
465
|
+
const t = P(A, e.__scopeMenu), o = L(A, e.__scopeMenu), c = Ae(A, e.__scopeMenu), a = Q(A, e.__scopeMenu), l = r.useRef(null), { pointerGraceTimerRef: f, onPointerGraceIntentChange: m } = a, p = { __scopeMenu: e.__scopeMenu }, d = r.useCallback(() => {
|
|
466
|
+
l.current && window.clearTimeout(l.current), l.current = null;
|
|
467
|
+
}, []);
|
|
468
|
+
return r.useEffect(() => d, [d]), r.useEffect(() => {
|
|
469
|
+
const s = f.current;
|
|
470
|
+
return () => {
|
|
471
|
+
window.clearTimeout(s), m(null);
|
|
472
|
+
};
|
|
473
|
+
}, [f, m]), /* @__PURE__ */ u(q, { asChild: !0, ...p, children: /* @__PURE__ */ u(
|
|
474
|
+
Re,
|
|
475
|
+
{
|
|
476
|
+
id: c.triggerId,
|
|
477
|
+
"aria-haspopup": "menu",
|
|
478
|
+
"aria-expanded": t.open,
|
|
479
|
+
"aria-controls": c.contentId,
|
|
480
|
+
"data-state": ke(t.open),
|
|
481
|
+
...e,
|
|
482
|
+
ref: fe(n, c.onTriggerChange),
|
|
483
|
+
onClick: (s) => {
|
|
484
|
+
e.onClick?.(s), !(e.disabled || s.defaultPrevented) && (s.currentTarget.focus(), t.open || t.onOpenChange(!0));
|
|
485
|
+
},
|
|
486
|
+
onPointerMove: v(
|
|
487
|
+
e.onPointerMove,
|
|
488
|
+
D((s) => {
|
|
489
|
+
a.onItemEnter(s), !s.defaultPrevented && !e.disabled && !t.open && !l.current && (a.onPointerGraceIntentChange(null), l.current = window.setTimeout(() => {
|
|
490
|
+
t.onOpenChange(!0), d();
|
|
491
|
+
}, 100));
|
|
492
|
+
})
|
|
493
|
+
),
|
|
494
|
+
onPointerLeave: v(
|
|
495
|
+
e.onPointerLeave,
|
|
496
|
+
D((s) => {
|
|
497
|
+
d();
|
|
498
|
+
const h = t.content?.getBoundingClientRect();
|
|
499
|
+
if (h) {
|
|
500
|
+
const g = t.content?.dataset.side, C = g === "right", S = C ? -5 : 5, b = h[C ? "left" : "right"], y = h[C ? "right" : "left"];
|
|
501
|
+
a.onPointerGraceIntentChange({
|
|
502
|
+
area: [
|
|
503
|
+
// Apply a bleed on clientX to ensure that our exit point is
|
|
504
|
+
// consistently within polygon bounds
|
|
505
|
+
{ x: s.clientX + S, y: s.clientY },
|
|
506
|
+
{ x: b, y: h.top },
|
|
507
|
+
{ x: y, y: h.top },
|
|
508
|
+
{ x: y, y: h.bottom },
|
|
509
|
+
{ x: b, y: h.bottom }
|
|
510
|
+
],
|
|
511
|
+
side: g
|
|
512
|
+
}), window.clearTimeout(f.current), f.current = window.setTimeout(
|
|
513
|
+
() => a.onPointerGraceIntentChange(null),
|
|
514
|
+
300
|
|
515
|
+
);
|
|
516
|
+
} else {
|
|
517
|
+
if (a.onTriggerLeave(s), s.defaultPrevented) return;
|
|
518
|
+
a.onPointerGraceIntentChange(null);
|
|
519
|
+
}
|
|
520
|
+
})
|
|
521
|
+
),
|
|
522
|
+
onKeyDown: v(e.onKeyDown, (s) => {
|
|
523
|
+
const h = a.searchRef.current !== "";
|
|
524
|
+
e.disabled || h && s.key === " " || mt[o.dir].includes(s.key) && (t.onOpenChange(!0), t.content?.focus(), s.preventDefault());
|
|
525
|
+
})
|
|
526
|
+
}
|
|
527
|
+
) });
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
Oe.displayName = A;
|
|
531
|
+
var De = "MenuSubContent", Ne = r.forwardRef(
|
|
532
|
+
(e, n) => {
|
|
533
|
+
const t = ve(_, e.__scopeMenu), { forceMount: o = t.forceMount, ...c } = e, a = P(_, e.__scopeMenu), l = L(_, e.__scopeMenu), f = Ae(De, e.__scopeMenu), m = r.useRef(null), p = N(n, m);
|
|
534
|
+
return /* @__PURE__ */ u(O.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(j, { present: o || a.open, children: /* @__PURE__ */ u(O.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(
|
|
535
|
+
ee,
|
|
536
|
+
{
|
|
537
|
+
id: f.contentId,
|
|
538
|
+
"aria-labelledby": f.triggerId,
|
|
539
|
+
...c,
|
|
540
|
+
ref: p,
|
|
541
|
+
align: "start",
|
|
542
|
+
side: l.dir === "rtl" ? "left" : "right",
|
|
543
|
+
disableOutsidePointerEvents: !1,
|
|
544
|
+
disableOutsideScroll: !1,
|
|
545
|
+
trapFocus: !1,
|
|
546
|
+
onOpenAutoFocus: (d) => {
|
|
547
|
+
l.isUsingKeyboardRef.current && m.current?.focus(), d.preventDefault();
|
|
548
|
+
},
|
|
549
|
+
onCloseAutoFocus: (d) => d.preventDefault(),
|
|
550
|
+
onFocusOutside: v(e.onFocusOutside, (d) => {
|
|
551
|
+
d.target !== f.trigger && a.onOpenChange(!1);
|
|
552
|
+
}),
|
|
553
|
+
onEscapeKeyDown: v(e.onEscapeKeyDown, (d) => {
|
|
554
|
+
l.onClose(), d.preventDefault();
|
|
555
|
+
}),
|
|
556
|
+
onKeyDown: v(e.onKeyDown, (d) => {
|
|
557
|
+
const s = d.currentTarget.contains(d.target), h = ht[l.dir].includes(d.key);
|
|
558
|
+
s && h && (a.onOpenChange(!1), f.trigger?.focus(), d.preventDefault());
|
|
559
|
+
})
|
|
560
|
+
}
|
|
561
|
+
) }) }) });
|
|
562
|
+
}
|
|
563
|
+
);
|
|
564
|
+
Ne.displayName = De;
|
|
565
|
+
function ke(e) {
|
|
566
|
+
return e ? "open" : "closed";
|
|
567
|
+
}
|
|
568
|
+
function B(e) {
|
|
569
|
+
return e === "indeterminate";
|
|
570
|
+
}
|
|
571
|
+
function oe(e) {
|
|
572
|
+
return B(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
573
|
+
}
|
|
574
|
+
function kt(e) {
|
|
575
|
+
const n = document.activeElement;
|
|
576
|
+
for (const t of e)
|
|
577
|
+
if (t === n || (t.focus(), document.activeElement !== n)) return;
|
|
578
|
+
}
|
|
579
|
+
function Ft(e, n) {
|
|
580
|
+
return e.map((t, o) => e[(n + o) % e.length]);
|
|
581
|
+
}
|
|
582
|
+
function Lt(e, n, t) {
|
|
583
|
+
const c = n.length > 1 && Array.from(n).every((p) => p === n[0]) ? n[0] : n, a = t ? e.indexOf(t) : -1;
|
|
584
|
+
let l = Ft(e, Math.max(a, 0));
|
|
585
|
+
c.length === 1 && (l = l.filter((p) => p !== t));
|
|
586
|
+
const m = l.find(
|
|
587
|
+
(p) => p.toLowerCase().startsWith(c.toLowerCase())
|
|
588
|
+
);
|
|
589
|
+
return m !== t ? m : void 0;
|
|
590
|
+
}
|
|
591
|
+
function Kt(e, n) {
|
|
592
|
+
const { x: t, y: o } = e;
|
|
593
|
+
let c = !1;
|
|
594
|
+
for (let a = 0, l = n.length - 1; a < n.length; l = a++) {
|
|
595
|
+
const f = n[a], m = n[l], p = f.x, d = f.y, s = m.x, h = m.y;
|
|
596
|
+
d > o != h > o && t < (s - p) * (o - d) / (h - d) + p && (c = !c);
|
|
597
|
+
}
|
|
598
|
+
return c;
|
|
599
|
+
}
|
|
600
|
+
function Gt(e, n) {
|
|
601
|
+
if (!n) return !1;
|
|
602
|
+
const t = { x: e.clientX, y: e.clientY };
|
|
603
|
+
return Kt(t, n);
|
|
604
|
+
}
|
|
605
|
+
function D(e) {
|
|
606
|
+
return (n) => n.pointerType === "mouse" ? e(n) : void 0;
|
|
607
|
+
}
|
|
608
|
+
var Zt = Ce, qt = q, Jt = Me, Qt = ge, en = te, tn = _e, nn = Y, on = Ee, rn = Se, cn = Ie, an = be, sn = xe, un = Te, ln = Oe, dn = Ne;
|
|
609
|
+
export {
|
|
610
|
+
qt as A,
|
|
611
|
+
Qt as C,
|
|
612
|
+
en as G,
|
|
613
|
+
nn as I,
|
|
614
|
+
tn as L,
|
|
615
|
+
Jt as P,
|
|
616
|
+
Zt as R,
|
|
617
|
+
sn as S,
|
|
618
|
+
on as a,
|
|
619
|
+
rn as b,
|
|
620
|
+
$t as c,
|
|
621
|
+
cn as d,
|
|
622
|
+
an as e,
|
|
623
|
+
un as f,
|
|
624
|
+
ln as g,
|
|
625
|
+
dn as h
|
|
626
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
function s(n, o) {
|
|
3
|
+
if (typeof n == "function")
|
|
4
|
+
return n(o);
|
|
5
|
+
n != null && (n.current = o);
|
|
6
|
+
}
|
|
7
|
+
function f(...n) {
|
|
8
|
+
return (o) => {
|
|
9
|
+
let u = !1;
|
|
10
|
+
const c = n.map((t) => {
|
|
11
|
+
const e = s(t, o);
|
|
12
|
+
return !u && typeof e == "function" && (u = !0), e;
|
|
13
|
+
});
|
|
14
|
+
if (u)
|
|
15
|
+
return () => {
|
|
16
|
+
for (let t = 0; t < c.length; t++) {
|
|
17
|
+
const e = c[t];
|
|
18
|
+
typeof e == "function" ? e() : s(n[t], null);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function i(...n) {
|
|
24
|
+
return l.useCallback(f(...n), n);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
f as c,
|
|
28
|
+
i as u
|
|
29
|
+
};
|