ics-ui-kit 0.1.9 → 0.1.11
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/{Command-DrFVm_8w.js → Command-ClIm4U7r.js} +16 -6
- package/dist/Command-ClIm4U7r.js.map +1 -0
- package/dist/Popover-CY_d3Ggn.js +274 -0
- package/dist/Popover-CY_d3Ggn.js.map +1 -0
- package/dist/components/background-pattern/BackgroundPattern.d.ts +43 -0
- package/dist/components/background-pattern/BackgroundPattern.stories.d.ts +26 -0
- package/dist/components/background-pattern/index.d.ts +2 -0
- package/dist/components/background-pattern/patterns.d.ts +21 -0
- package/dist/components/background-pattern.d.ts +2 -0
- package/dist/components/background-pattern.js +70 -0
- package/dist/components/background-pattern.js.map +1 -0
- package/dist/components/command.js +1 -1
- package/dist/components/dropdown.js +99 -107
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/popover/Popover.stories.d.ts +6 -0
- package/dist/components/popover.js +1 -1
- package/dist/components/search-select.js +2 -2
- package/dist/styles-scoped.css +21 -0
- package/dist/styles.css +21 -0
- package/package.json +1 -1
- package/dist/Command-DrFVm_8w.js.map +0 -1
- package/dist/Popover-Dvr7y0YY.js +0 -258
- package/dist/Popover-Dvr7y0YY.js.map +0 -1
|
@@ -14,7 +14,7 @@ import { u as j } from "../index-xqkGMOJ8.js";
|
|
|
14
14
|
import { c as qe, R as Je, A as oo, a as to, C as ro } from "../index-DRo26PBK.js";
|
|
15
15
|
import { P as W } from "../index-BpWB3aFK.js";
|
|
16
16
|
import { c as Qe, I as ao, R as so } from "../index-DHyZ_0Ut.js";
|
|
17
|
-
import { u as
|
|
17
|
+
import { u as de } from "../index-0ioNhtNM.js";
|
|
18
18
|
import { T as M } from "../index-BVqs-uqP.js";
|
|
19
19
|
import { T as co } from "../TriggerButton-CfDObWP9.js";
|
|
20
20
|
import { I as io } from "../Icon-DH3ev9GK.js";
|
|
@@ -36,7 +36,7 @@ var ce = ["Enter", " "], fo = ["ArrowDown", "PageUp", "Home"], on = ["ArrowUp",
|
|
|
36
36
|
qe,
|
|
37
37
|
Qe
|
|
38
38
|
]), $ = qe(), rn = Qe(), [an, _] = D(K), [bo, U] = D(K), sn = (e) => {
|
|
39
|
-
const { __scopeMenu: o, open: n = !1, children: t, dir: r, onOpenChange: a, modal: i = !0 } = e,
|
|
39
|
+
const { __scopeMenu: o, open: n = !1, children: t, dir: r, onOpenChange: a, modal: i = !0 } = e, d = $(o), [m, f] = s.useState(null), l = s.useRef(!1), u = de(a), g = Wn(r);
|
|
40
40
|
return s.useEffect(() => {
|
|
41
41
|
const w = () => {
|
|
42
42
|
l.current = !0, document.addEventListener("pointerdown", v, { capture: !0, once: !0 }), document.addEventListener("pointermove", v, { capture: !0, once: !0 });
|
|
@@ -44,19 +44,19 @@ var ce = ["Enter", " "], fo = ["ArrowDown", "PageUp", "Home"], on = ["ArrowUp",
|
|
|
44
44
|
return document.addEventListener("keydown", w, { capture: !0 }), () => {
|
|
45
45
|
document.removeEventListener("keydown", w, { capture: !0 }), document.removeEventListener("pointerdown", v, { capture: !0 }), document.removeEventListener("pointermove", v, { capture: !0 });
|
|
46
46
|
};
|
|
47
|
-
}, []), /* @__PURE__ */ c(Je, { ...
|
|
47
|
+
}, []), /* @__PURE__ */ c(Je, { ...d, children: /* @__PURE__ */ c(
|
|
48
48
|
an,
|
|
49
49
|
{
|
|
50
50
|
scope: o,
|
|
51
51
|
open: n,
|
|
52
|
-
onOpenChange:
|
|
52
|
+
onOpenChange: u,
|
|
53
53
|
content: m,
|
|
54
54
|
onContentChange: f,
|
|
55
55
|
children: /* @__PURE__ */ c(
|
|
56
56
|
bo,
|
|
57
57
|
{
|
|
58
58
|
scope: o,
|
|
59
|
-
onClose: s.useCallback(() =>
|
|
59
|
+
onClose: s.useCallback(() => u(!1), [u]),
|
|
60
60
|
isUsingKeyboardRef: l,
|
|
61
61
|
dir: g,
|
|
62
62
|
modal: i,
|
|
@@ -67,21 +67,21 @@ var ce = ["Enter", " "], fo = ["ArrowDown", "PageUp", "Home"], on = ["ArrowUp",
|
|
|
67
67
|
) });
|
|
68
68
|
};
|
|
69
69
|
sn.displayName = K;
|
|
70
|
-
var Co = "MenuAnchor",
|
|
70
|
+
var Co = "MenuAnchor", ue = s.forwardRef(
|
|
71
71
|
(e, o) => {
|
|
72
72
|
const { __scopeMenu: n, ...t } = e, r = $(n);
|
|
73
73
|
return /* @__PURE__ */ c(oo, { ...r, ...t, ref: o });
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
|
-
|
|
76
|
+
ue.displayName = Co;
|
|
77
77
|
var le = "MenuPortal", [yo, cn] = D(le, {
|
|
78
78
|
forceMount: void 0
|
|
79
|
-
}),
|
|
79
|
+
}), dn = (e) => {
|
|
80
80
|
const { __scopeMenu: o, forceMount: n, children: t, container: r } = e, a = _(le, o);
|
|
81
81
|
return /* @__PURE__ */ c(yo, { scope: o, forceMount: n, children: /* @__PURE__ */ c(W, { present: n || a.open, children: /* @__PURE__ */ c(Zn, { asChild: !0, container: r, children: t }) }) });
|
|
82
82
|
};
|
|
83
|
-
|
|
84
|
-
var y = "MenuContent", [So, pe] = D(y),
|
|
83
|
+
dn.displayName = le;
|
|
84
|
+
var y = "MenuContent", [So, pe] = D(y), un = s.forwardRef(
|
|
85
85
|
(e, o) => {
|
|
86
86
|
const n = cn(y, e.__scopeMenu), { forceMount: t = n.forceMount, ...r } = e, a = _(y, e.__scopeMenu), i = U(y, e.__scopeMenu);
|
|
87
87
|
return /* @__PURE__ */ c(L.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(W, { present: t || a.open, children: /* @__PURE__ */ c(L.Slot, { scope: e.__scopeMenu, children: i.modal ? /* @__PURE__ */ c(_o, { ...r, ref: o }) : /* @__PURE__ */ c(Ro, { ...r, ref: o }) }) }) });
|
|
@@ -130,11 +130,11 @@ var y = "MenuContent", [So, pe] = D(y), dn = s.forwardRef(
|
|
|
130
130
|
trapFocus: r,
|
|
131
131
|
onOpenAutoFocus: a,
|
|
132
132
|
onCloseAutoFocus: i,
|
|
133
|
-
disableOutsidePointerEvents:
|
|
133
|
+
disableOutsidePointerEvents: d,
|
|
134
134
|
onEntryFocus: m,
|
|
135
135
|
onEscapeKeyDown: f,
|
|
136
136
|
onPointerDownOutside: l,
|
|
137
|
-
onFocusOutside:
|
|
137
|
+
onFocusOutside: u,
|
|
138
138
|
onInteractOutside: g,
|
|
139
139
|
onDismiss: w,
|
|
140
140
|
disableOutsideScroll: v,
|
|
@@ -187,10 +187,10 @@ var y = "MenuContent", [So, pe] = D(y), dn = s.forwardRef(
|
|
|
187
187
|
qn,
|
|
188
188
|
{
|
|
189
189
|
asChild: !0,
|
|
190
|
-
disableOutsidePointerEvents:
|
|
190
|
+
disableOutsidePointerEvents: d,
|
|
191
191
|
onEscapeKeyDown: f,
|
|
192
192
|
onPointerDownOutside: l,
|
|
193
|
-
onFocusOutside:
|
|
193
|
+
onFocusOutside: u,
|
|
194
194
|
onInteractOutside: g,
|
|
195
195
|
onDismiss: w,
|
|
196
196
|
children: /* @__PURE__ */ c(
|
|
@@ -253,7 +253,7 @@ var y = "MenuContent", [So, pe] = D(y), dn = s.forwardRef(
|
|
|
253
253
|
);
|
|
254
254
|
}
|
|
255
255
|
);
|
|
256
|
-
|
|
256
|
+
un.displayName = y;
|
|
257
257
|
var xo = "MenuGroup", fe = s.forwardRef(
|
|
258
258
|
(e, o) => {
|
|
259
259
|
const { __scopeMenu: n, ...t } = e;
|
|
@@ -270,11 +270,11 @@ var Io = "MenuLabel", ln = s.forwardRef(
|
|
|
270
270
|
ln.displayName = Io;
|
|
271
271
|
var Y = "MenuItem", Xe = "menu.itemSelect", J = s.forwardRef(
|
|
272
272
|
(e, o) => {
|
|
273
|
-
const { disabled: n = !1, onSelect: t, ...r } = e, a = s.useRef(null), i = U(Y, e.__scopeMenu),
|
|
274
|
-
const
|
|
275
|
-
if (!n &&
|
|
273
|
+
const { disabled: n = !1, onSelect: t, ...r } = e, a = s.useRef(null), i = U(Y, e.__scopeMenu), d = pe(Y, e.__scopeMenu), m = F(o, a), f = s.useRef(!1), l = () => {
|
|
274
|
+
const u = a.current;
|
|
275
|
+
if (!n && u) {
|
|
276
276
|
const g = new CustomEvent(Xe, { bubbles: !0, cancelable: !0 });
|
|
277
|
-
|
|
277
|
+
u.addEventListener(Xe, (w) => t?.(w), { once: !0 }), Yn(u, g), g.defaultPrevented ? f.current = !1 : i.onClose();
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
280
|
return /* @__PURE__ */ c(
|
|
@@ -284,15 +284,15 @@ var Y = "MenuItem", Xe = "menu.itemSelect", J = s.forwardRef(
|
|
|
284
284
|
ref: m,
|
|
285
285
|
disabled: n,
|
|
286
286
|
onClick: h(e.onClick, l),
|
|
287
|
-
onPointerDown: (
|
|
288
|
-
e.onPointerDown?.(
|
|
287
|
+
onPointerDown: (u) => {
|
|
288
|
+
e.onPointerDown?.(u), f.current = !0;
|
|
289
289
|
},
|
|
290
|
-
onPointerUp: h(e.onPointerUp, (
|
|
291
|
-
f.current ||
|
|
290
|
+
onPointerUp: h(e.onPointerUp, (u) => {
|
|
291
|
+
f.current || u.currentTarget?.click();
|
|
292
292
|
}),
|
|
293
|
-
onKeyDown: h(e.onKeyDown, (
|
|
294
|
-
const g =
|
|
295
|
-
n || g &&
|
|
293
|
+
onKeyDown: h(e.onKeyDown, (u) => {
|
|
294
|
+
const g = d.searchRef.current !== "";
|
|
295
|
+
n || g && u.key === " " || ce.includes(u.key) && (u.currentTarget.click(), u.preventDefault());
|
|
296
296
|
})
|
|
297
297
|
}
|
|
298
298
|
);
|
|
@@ -301,7 +301,7 @@ var Y = "MenuItem", Xe = "menu.itemSelect", J = s.forwardRef(
|
|
|
301
301
|
J.displayName = Y;
|
|
302
302
|
var pn = s.forwardRef(
|
|
303
303
|
(e, o) => {
|
|
304
|
-
const { __scopeMenu: n, disabled: t = !1, textValue: r, ...a } = e, i = pe(Y, n),
|
|
304
|
+
const { __scopeMenu: n, disabled: t = !1, textValue: r, ...a } = e, i = pe(Y, n), d = rn(n), m = s.useRef(null), f = F(o, m), [l, u] = s.useState(!1), [g, w] = s.useState("");
|
|
305
305
|
return s.useEffect(() => {
|
|
306
306
|
const v = m.current;
|
|
307
307
|
v && w((v.textContent ?? "").trim());
|
|
@@ -311,7 +311,7 @@ var pn = s.forwardRef(
|
|
|
311
311
|
scope: n,
|
|
312
312
|
disabled: t,
|
|
313
313
|
textValue: r ?? g,
|
|
314
|
-
children: /* @__PURE__ */ c(ao, { asChild: !0, ...
|
|
314
|
+
children: /* @__PURE__ */ c(ao, { asChild: !0, ...d, focusable: !t, children: /* @__PURE__ */ c(
|
|
315
315
|
E.div,
|
|
316
316
|
{
|
|
317
317
|
role: "menuitem",
|
|
@@ -330,8 +330,8 @@ var pn = s.forwardRef(
|
|
|
330
330
|
e.onPointerLeave,
|
|
331
331
|
G((v) => i.onItemLeave(v))
|
|
332
332
|
),
|
|
333
|
-
onFocus: h(e.onFocus, () =>
|
|
334
|
-
onBlur: h(e.onBlur, () =>
|
|
333
|
+
onFocus: h(e.onFocus, () => u(!0)),
|
|
334
|
+
onBlur: h(e.onBlur, () => u(!1))
|
|
335
335
|
}
|
|
336
336
|
) })
|
|
337
337
|
}
|
|
@@ -364,7 +364,7 @@ var fn = "MenuRadioGroup", [No, Eo] = D(
|
|
|
364
364
|
} }
|
|
365
365
|
), gn = s.forwardRef(
|
|
366
366
|
(e, o) => {
|
|
367
|
-
const { value: n, onValueChange: t, ...r } = e, a =
|
|
367
|
+
const { value: n, onValueChange: t, ...r } = e, a = de(t);
|
|
368
368
|
return /* @__PURE__ */ c(No, { scope: e.__scopeMenu, value: n, onValueChange: a, children: /* @__PURE__ */ c(fe, { ...r, ref: o }) });
|
|
369
369
|
}
|
|
370
370
|
);
|
|
@@ -436,13 +436,13 @@ var ko = "MenuArrow", Cn = s.forwardRef(
|
|
|
436
436
|
);
|
|
437
437
|
Cn.displayName = ko;
|
|
438
438
|
var he = "MenuSub", [Oo, yn] = D(he), Sn = (e) => {
|
|
439
|
-
const { __scopeMenu: o, children: n, open: t = !1, onOpenChange: r } = e, a = _(he, o), i = $(o), [
|
|
440
|
-
return s.useEffect(() => (a.open === !1 &&
|
|
439
|
+
const { __scopeMenu: o, children: n, open: t = !1, onOpenChange: r } = e, a = _(he, o), i = $(o), [d, m] = s.useState(null), [f, l] = s.useState(null), u = de(r);
|
|
440
|
+
return s.useEffect(() => (a.open === !1 && u(!1), () => u(!1)), [a.open, u]), /* @__PURE__ */ c(Je, { ...i, children: /* @__PURE__ */ c(
|
|
441
441
|
an,
|
|
442
442
|
{
|
|
443
443
|
scope: o,
|
|
444
444
|
open: t,
|
|
445
|
-
onOpenChange:
|
|
445
|
+
onOpenChange: u,
|
|
446
446
|
content: f,
|
|
447
447
|
onContentChange: l,
|
|
448
448
|
children: /* @__PURE__ */ c(
|
|
@@ -451,7 +451,7 @@ var he = "MenuSub", [Oo, yn] = D(he), Sn = (e) => {
|
|
|
451
451
|
scope: o,
|
|
452
452
|
contentId: j(),
|
|
453
453
|
triggerId: j(),
|
|
454
|
-
trigger:
|
|
454
|
+
trigger: d,
|
|
455
455
|
onTriggerChange: m,
|
|
456
456
|
children: n
|
|
457
457
|
}
|
|
@@ -462,15 +462,15 @@ var he = "MenuSub", [Oo, yn] = D(he), Sn = (e) => {
|
|
|
462
462
|
Sn.displayName = he;
|
|
463
463
|
var O = "MenuSubTrigger", _n = s.forwardRef(
|
|
464
464
|
(e, o) => {
|
|
465
|
-
const n = _(O, e.__scopeMenu), t = U(O, e.__scopeMenu), r = yn(O, e.__scopeMenu), a = pe(O, e.__scopeMenu), i = s.useRef(null), { pointerGraceTimerRef:
|
|
465
|
+
const n = _(O, e.__scopeMenu), t = U(O, e.__scopeMenu), r = yn(O, e.__scopeMenu), a = pe(O, e.__scopeMenu), i = s.useRef(null), { pointerGraceTimerRef: d, onPointerGraceIntentChange: m } = a, f = { __scopeMenu: e.__scopeMenu }, l = s.useCallback(() => {
|
|
466
466
|
i.current && window.clearTimeout(i.current), i.current = null;
|
|
467
467
|
}, []);
|
|
468
468
|
return s.useEffect(() => l, [l]), s.useEffect(() => {
|
|
469
|
-
const
|
|
469
|
+
const u = d.current;
|
|
470
470
|
return () => {
|
|
471
|
-
window.clearTimeout(
|
|
471
|
+
window.clearTimeout(u), m(null);
|
|
472
472
|
};
|
|
473
|
-
}, [
|
|
473
|
+
}, [d, m]), /* @__PURE__ */ c(ue, { asChild: !0, ...f, children: /* @__PURE__ */ c(
|
|
474
474
|
pn,
|
|
475
475
|
{
|
|
476
476
|
id: r.triggerId,
|
|
@@ -480,20 +480,20 @@ var O = "MenuSubTrigger", _n = s.forwardRef(
|
|
|
480
480
|
"data-state": xn(n.open),
|
|
481
481
|
...e,
|
|
482
482
|
ref: He(o, r.onTriggerChange),
|
|
483
|
-
onClick: (
|
|
484
|
-
e.onClick?.(
|
|
483
|
+
onClick: (u) => {
|
|
484
|
+
e.onClick?.(u), !(e.disabled || u.defaultPrevented) && (u.currentTarget.focus(), n.open || n.onOpenChange(!0));
|
|
485
485
|
},
|
|
486
486
|
onPointerMove: h(
|
|
487
487
|
e.onPointerMove,
|
|
488
|
-
G((
|
|
489
|
-
a.onItemEnter(
|
|
488
|
+
G((u) => {
|
|
489
|
+
a.onItemEnter(u), !u.defaultPrevented && !e.disabled && !n.open && !i.current && (a.onPointerGraceIntentChange(null), i.current = window.setTimeout(() => {
|
|
490
490
|
n.onOpenChange(!0), l();
|
|
491
491
|
}, 100));
|
|
492
492
|
})
|
|
493
493
|
),
|
|
494
494
|
onPointerLeave: h(
|
|
495
495
|
e.onPointerLeave,
|
|
496
|
-
G((
|
|
496
|
+
G((u) => {
|
|
497
497
|
l();
|
|
498
498
|
const g = n.content?.getBoundingClientRect();
|
|
499
499
|
if (g) {
|
|
@@ -502,26 +502,26 @@ var O = "MenuSubTrigger", _n = s.forwardRef(
|
|
|
502
502
|
area: [
|
|
503
503
|
// Apply a bleed on clientX to ensure that our exit point is
|
|
504
504
|
// consistently within polygon bounds
|
|
505
|
-
{ x:
|
|
505
|
+
{ x: u.clientX + x, y: u.clientY },
|
|
506
506
|
{ x: T, y: g.top },
|
|
507
507
|
{ x: I, y: g.top },
|
|
508
508
|
{ x: I, y: g.bottom },
|
|
509
509
|
{ x: T, y: g.bottom }
|
|
510
510
|
],
|
|
511
511
|
side: w
|
|
512
|
-
}), window.clearTimeout(
|
|
512
|
+
}), window.clearTimeout(d.current), d.current = window.setTimeout(
|
|
513
513
|
() => a.onPointerGraceIntentChange(null),
|
|
514
514
|
300
|
|
515
515
|
);
|
|
516
516
|
} else {
|
|
517
|
-
if (a.onTriggerLeave(
|
|
517
|
+
if (a.onTriggerLeave(u), u.defaultPrevented) return;
|
|
518
518
|
a.onPointerGraceIntentChange(null);
|
|
519
519
|
}
|
|
520
520
|
})
|
|
521
521
|
),
|
|
522
|
-
onKeyDown: h(e.onKeyDown, (
|
|
522
|
+
onKeyDown: h(e.onKeyDown, (u) => {
|
|
523
523
|
const g = a.searchRef.current !== "";
|
|
524
|
-
e.disabled || g &&
|
|
524
|
+
e.disabled || g && u.key === " " || ho[t.dir].includes(u.key) && (n.onOpenChange(!0), n.content?.focus(), u.preventDefault());
|
|
525
525
|
})
|
|
526
526
|
}
|
|
527
527
|
) });
|
|
@@ -530,12 +530,12 @@ var O = "MenuSubTrigger", _n = s.forwardRef(
|
|
|
530
530
|
_n.displayName = O;
|
|
531
531
|
var Rn = "MenuSubContent", Dn = s.forwardRef(
|
|
532
532
|
(e, o) => {
|
|
533
|
-
const n = cn(y, e.__scopeMenu), { forceMount: t = n.forceMount, ...r } = e, a = _(y, e.__scopeMenu), i = U(y, e.__scopeMenu),
|
|
533
|
+
const n = cn(y, e.__scopeMenu), { forceMount: t = n.forceMount, ...r } = e, a = _(y, e.__scopeMenu), i = U(y, e.__scopeMenu), d = yn(Rn, e.__scopeMenu), m = s.useRef(null), f = F(o, m);
|
|
534
534
|
return /* @__PURE__ */ c(L.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(W, { present: t || a.open, children: /* @__PURE__ */ c(L.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(
|
|
535
535
|
me,
|
|
536
536
|
{
|
|
537
|
-
id:
|
|
538
|
-
"aria-labelledby":
|
|
537
|
+
id: d.contentId,
|
|
538
|
+
"aria-labelledby": d.triggerId,
|
|
539
539
|
...r,
|
|
540
540
|
ref: f,
|
|
541
541
|
align: "start",
|
|
@@ -548,14 +548,14 @@ var Rn = "MenuSubContent", Dn = s.forwardRef(
|
|
|
548
548
|
},
|
|
549
549
|
onCloseAutoFocus: (l) => l.preventDefault(),
|
|
550
550
|
onFocusOutside: h(e.onFocusOutside, (l) => {
|
|
551
|
-
l.target !==
|
|
551
|
+
l.target !== d.trigger && a.onOpenChange(!1);
|
|
552
552
|
}),
|
|
553
553
|
onEscapeKeyDown: h(e.onEscapeKeyDown, (l) => {
|
|
554
554
|
i.onClose(), l.preventDefault();
|
|
555
555
|
}),
|
|
556
556
|
onKeyDown: h(e.onKeyDown, (l) => {
|
|
557
|
-
const
|
|
558
|
-
|
|
557
|
+
const u = l.currentTarget.contains(l.target), g = vo[i.dir].includes(l.key);
|
|
558
|
+
u && g && (a.onOpenChange(!1), d.trigger?.focus(), l.preventDefault());
|
|
559
559
|
})
|
|
560
560
|
}
|
|
561
561
|
) }) }) });
|
|
@@ -592,8 +592,8 @@ function Ko(e, o) {
|
|
|
592
592
|
const { x: n, y: t } = e;
|
|
593
593
|
let r = !1;
|
|
594
594
|
for (let a = 0, i = o.length - 1; a < o.length; i = a++) {
|
|
595
|
-
const
|
|
596
|
-
l > t != g > t && n < (
|
|
595
|
+
const d = o[a], m = o[i], f = d.x, l = d.y, u = m.x, g = m.y;
|
|
596
|
+
l > t != g > t && n < (u - f) * (t - l) / (g - l) + f && (r = !r);
|
|
597
597
|
}
|
|
598
598
|
return r;
|
|
599
599
|
}
|
|
@@ -605,7 +605,7 @@ function $o(e, o) {
|
|
|
605
605
|
function G(e) {
|
|
606
606
|
return (o) => o.pointerType === "mouse" ? e(o) : void 0;
|
|
607
607
|
}
|
|
608
|
-
var Uo = sn, Vo =
|
|
608
|
+
var Uo = sn, Vo = ue, Bo = dn, zo = un, jo = fe, Yo = ln, Xo = J, Ho = mn, Wo = gn, Zo = vn, qo = Mn, Jo = bn, Qo = Cn, et = Sn, nt = _n, ot = Dn, Q = "DropdownMenu", [tt, rt] = We(
|
|
609
609
|
Q,
|
|
610
610
|
[tn]
|
|
611
611
|
), b = tn(), [at, In] = tt(Q), we = (e) => {
|
|
@@ -616,8 +616,8 @@ var Uo = sn, Vo = de, Bo = un, zo = dn, jo = fe, Yo = ln, Xo = J, Ho = mn, Wo =
|
|
|
616
616
|
open: r,
|
|
617
617
|
defaultOpen: a,
|
|
618
618
|
onOpenChange: i,
|
|
619
|
-
modal:
|
|
620
|
-
} = e, m = b(o), f = s.useRef(null), [l,
|
|
619
|
+
modal: d = !0
|
|
620
|
+
} = e, m = b(o), f = s.useRef(null), [l, u] = Ze({
|
|
621
621
|
prop: r,
|
|
622
622
|
defaultProp: a ?? !1,
|
|
623
623
|
onChange: i,
|
|
@@ -631,10 +631,10 @@ var Uo = sn, Vo = de, Bo = un, zo = dn, jo = fe, Yo = ln, Xo = J, Ho = mn, Wo =
|
|
|
631
631
|
triggerRef: f,
|
|
632
632
|
contentId: j(),
|
|
633
633
|
open: l,
|
|
634
|
-
onOpenChange:
|
|
635
|
-
onOpenToggle: s.useCallback(() =>
|
|
636
|
-
modal:
|
|
637
|
-
children: /* @__PURE__ */ c(Uo, { ...m, open: l, onOpenChange:
|
|
634
|
+
onOpenChange: u,
|
|
635
|
+
onOpenToggle: s.useCallback(() => u((g) => !g), [u]),
|
|
636
|
+
modal: d,
|
|
637
|
+
children: /* @__PURE__ */ c(Uo, { ...m, open: l, onOpenChange: u, dir: t, modal: d, children: n })
|
|
638
638
|
}
|
|
639
639
|
);
|
|
640
640
|
};
|
|
@@ -655,11 +655,11 @@ var Pn = "DropdownMenuTrigger", Me = s.forwardRef(
|
|
|
655
655
|
disabled: t,
|
|
656
656
|
...r,
|
|
657
657
|
ref: He(o, a.triggerRef),
|
|
658
|
-
onPointerDown: h(e.onPointerDown, (
|
|
659
|
-
!t &&
|
|
658
|
+
onPointerDown: h(e.onPointerDown, (d) => {
|
|
659
|
+
!t && d.button === 0 && d.ctrlKey === !1 && (a.onOpenToggle(), a.open || d.preventDefault());
|
|
660
660
|
}),
|
|
661
|
-
onKeyDown: h(e.onKeyDown, (
|
|
662
|
-
t || (["Enter", " "].includes(
|
|
661
|
+
onKeyDown: h(e.onKeyDown, (d) => {
|
|
662
|
+
t || (["Enter", " "].includes(d.key) && a.onOpenToggle(), d.key === "ArrowDown" && a.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(d.key) && d.preventDefault());
|
|
663
663
|
})
|
|
664
664
|
}
|
|
665
665
|
) });
|
|
@@ -682,11 +682,11 @@ var Nn = "DropdownMenuContent", Ce = s.forwardRef(
|
|
|
682
682
|
...a,
|
|
683
683
|
...t,
|
|
684
684
|
ref: o,
|
|
685
|
-
onCloseAutoFocus: h(e.onCloseAutoFocus, (
|
|
686
|
-
i.current || r.triggerRef.current?.focus(), i.current = !1,
|
|
685
|
+
onCloseAutoFocus: h(e.onCloseAutoFocus, (d) => {
|
|
686
|
+
i.current || r.triggerRef.current?.focus(), i.current = !1, d.preventDefault();
|
|
687
687
|
}),
|
|
688
|
-
onInteractOutside: h(e.onInteractOutside, (
|
|
689
|
-
const m =
|
|
688
|
+
onInteractOutside: h(e.onInteractOutside, (d) => {
|
|
689
|
+
const m = d.detail.originalEvent, f = m.button === 0 && m.ctrlKey === !0, l = m.button === 2 || f;
|
|
690
690
|
(!r.modal || l) && (i.current = !0);
|
|
691
691
|
}),
|
|
692
692
|
style: {
|
|
@@ -716,18 +716,18 @@ var it = "DropdownMenuLabel", Se = s.forwardRef(
|
|
|
716
716
|
}
|
|
717
717
|
);
|
|
718
718
|
Se.displayName = it;
|
|
719
|
-
var
|
|
719
|
+
var dt = "DropdownMenuItem", _e = s.forwardRef(
|
|
720
720
|
(e, o) => {
|
|
721
721
|
const { __scopeDropdownMenu: n, ...t } = e, r = b(n);
|
|
722
722
|
return /* @__PURE__ */ c(Xo, { ...r, ...t, ref: o });
|
|
723
723
|
}
|
|
724
724
|
);
|
|
725
|
-
_e.displayName =
|
|
726
|
-
var
|
|
725
|
+
_e.displayName = dt;
|
|
726
|
+
var ut = "DropdownMenuCheckboxItem", Re = s.forwardRef((e, o) => {
|
|
727
727
|
const { __scopeDropdownMenu: n, ...t } = e, r = b(n);
|
|
728
728
|
return /* @__PURE__ */ c(Ho, { ...r, ...t, ref: o });
|
|
729
729
|
});
|
|
730
|
-
Re.displayName =
|
|
730
|
+
Re.displayName = ut;
|
|
731
731
|
var lt = "DropdownMenuRadioGroup", De = s.forwardRef((e, o) => {
|
|
732
732
|
const { __scopeDropdownMenu: n, ...t } = e, r = b(n);
|
|
733
733
|
return /* @__PURE__ */ c(Wo, { ...r, ...t, ref: o });
|
|
@@ -756,13 +756,13 @@ var gt = "DropdownMenuArrow", Ne = s.forwardRef(
|
|
|
756
756
|
);
|
|
757
757
|
Ne.displayName = gt;
|
|
758
758
|
var En = (e) => {
|
|
759
|
-
const { __scopeDropdownMenu: o, children: n, open: t, onOpenChange: r, defaultOpen: a } = e, i = b(o), [
|
|
759
|
+
const { __scopeDropdownMenu: o, children: n, open: t, onOpenChange: r, defaultOpen: a } = e, i = b(o), [d, m] = Ze({
|
|
760
760
|
prop: t,
|
|
761
761
|
defaultProp: a ?? !1,
|
|
762
762
|
onChange: r,
|
|
763
763
|
caller: "DropdownMenuSub"
|
|
764
764
|
});
|
|
765
|
-
return /* @__PURE__ */ c(et, { ...i, open:
|
|
765
|
+
return /* @__PURE__ */ c(et, { ...i, open: d, onOpenChange: m, children: n });
|
|
766
766
|
}, ht = "DropdownMenuSubTrigger", Ee = s.forwardRef((e, o) => {
|
|
767
767
|
const { __scopeDropdownMenu: n, ...t } = e, r = b(n);
|
|
768
768
|
return /* @__PURE__ */ c(nt, { ...r, ...t, ref: o });
|
|
@@ -826,7 +826,7 @@ const Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
826
826
|
createDropdownMenuScope: rt
|
|
827
827
|
}, Symbol.toStringTag, { value: "Module" })), oe = [
|
|
828
828
|
"rounded-lg bg-transparent text-primary-fg",
|
|
829
|
-
"hover:bg-secondary-border focus:bg-secondary-
|
|
829
|
+
"hover:bg-secondary-border focus:bg-secondary-border",
|
|
830
830
|
"[&:has([data-menu-item-action]:hover)]:bg-secondary-bg"
|
|
831
831
|
], yr = Tn, Mt = An, Sr = kn, _r = ee, Rr = On, Dr = ne, Ln = s.createContext(null), bt = s.forwardRef(({ indicatorIcon: e, indicatorIconClassName: o, indicatorIconPosition: n, children: t, ...r }, a) => /* @__PURE__ */ c(Ln.Provider, { value: { indicatorIcon: e, indicatorIconClassName: o, indicatorIconPosition: n }, children: /* @__PURE__ */ c(ne, { ref: a, ...r, children: t }) }));
|
|
832
832
|
bt.displayName = ne.displayName;
|
|
@@ -886,7 +886,7 @@ const _t = M({
|
|
|
886
886
|
}
|
|
887
887
|
}), Rt = M({
|
|
888
888
|
base: [
|
|
889
|
-
"
|
|
889
|
+
"backdrop-glass-regular relative z-50 min-w-[8rem] overflow-hidden rounded-2xl bg-alpha-40 p-2 shadow-glass-md",
|
|
890
890
|
"origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
891
891
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
892
892
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
@@ -918,7 +918,7 @@ const xt = M({
|
|
|
918
918
|
}
|
|
919
919
|
}), It = M({
|
|
920
920
|
base: [
|
|
921
|
-
"group/glass-dropdown-content
|
|
921
|
+
"group/glass-dropdown-content backdrop-glass-regular z-50 min-w-32 rounded-2xl bg-alpha-40 p-2 shadow-glass-md",
|
|
922
922
|
"max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden",
|
|
923
923
|
"origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
924
924
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
@@ -928,16 +928,8 @@ const xt = M({
|
|
|
928
928
|
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
|
|
929
929
|
]
|
|
930
930
|
}), Pt = s.forwardRef(({ className: e, sideOffset: o = 4, portalContainer: n, ...t }, r) => {
|
|
931
|
-
const { variant: a } = S(), i = en(n),
|
|
932
|
-
return /* @__PURE__ */ c(ee, { container: i, children: /* @__PURE__ */ c(
|
|
933
|
-
Ae,
|
|
934
|
-
{
|
|
935
|
-
ref: r,
|
|
936
|
-
sideOffset: o,
|
|
937
|
-
className: u,
|
|
938
|
-
...t
|
|
939
|
-
}
|
|
940
|
-
) });
|
|
931
|
+
const { variant: a } = S(), i = en(n), d = a === "glass" ? It({ className: e }) : xt({ theme: a, className: e });
|
|
932
|
+
return /* @__PURE__ */ c(ee, { container: i, children: /* @__PURE__ */ c(Ae, { ref: r, sideOffset: o, className: d, ...t }) });
|
|
941
933
|
});
|
|
942
934
|
Pt.displayName = Ae.displayName;
|
|
943
935
|
const Nt = M({
|
|
@@ -959,8 +951,8 @@ const Nt = M({
|
|
|
959
951
|
}
|
|
960
952
|
}
|
|
961
953
|
}), Tt = s.forwardRef(({ className: e, disabled: o, inset: n, children: t, ...r }, a) => {
|
|
962
|
-
const { variant: i } = S(),
|
|
963
|
-
return /* @__PURE__ */ c(Oe, { ref: a, disabled: o, className:
|
|
954
|
+
const { variant: i } = S(), d = i === "glass" ? Et({ className: e, disabled: o, inset: n }) : Nt({ className: e, disabled: o, inset: n, theme: i });
|
|
955
|
+
return /* @__PURE__ */ c(Oe, { ref: a, disabled: o, className: d, ...r, children: t });
|
|
964
956
|
});
|
|
965
957
|
Tt.displayName = Oe.displayName;
|
|
966
958
|
const At = M({
|
|
@@ -1024,17 +1016,17 @@ const At = M({
|
|
|
1024
1016
|
checked: !1
|
|
1025
1017
|
}
|
|
1026
1018
|
}), Ot = s.forwardRef(({ className: e, children: o, checked: n, disabled: t, ...r }, a) => {
|
|
1027
|
-
const { variant: i } = S(),
|
|
1019
|
+
const { variant: i } = S(), d = i === "glass" ? kt({ checked: n, disabled: t }) : At({ checked: n, theme: i, disabled: t });
|
|
1028
1020
|
return /* @__PURE__ */ H(
|
|
1029
1021
|
Le,
|
|
1030
1022
|
{
|
|
1031
1023
|
ref: a,
|
|
1032
|
-
className:
|
|
1024
|
+
className: d.base({ className: e }),
|
|
1033
1025
|
checked: n,
|
|
1034
1026
|
disabled: t,
|
|
1035
1027
|
...r,
|
|
1036
1028
|
children: [
|
|
1037
|
-
/* @__PURE__ */ c("span", { className:
|
|
1029
|
+
/* @__PURE__ */ c("span", { className: d.checkbox(), children: /* @__PURE__ */ c(Fe, { children: n === "indeterminate" ? /* @__PURE__ */ c(lo, { className: d.icon() }) : /* @__PURE__ */ c(nn, { className: d.icon() }) }) }),
|
|
1038
1030
|
o
|
|
1039
1031
|
]
|
|
1040
1032
|
}
|
|
@@ -1059,9 +1051,9 @@ const Lt = M({
|
|
|
1059
1051
|
}
|
|
1060
1052
|
}
|
|
1061
1053
|
}), Kt = s.forwardRef(({ className: e, children: o, disabled: n, ...t }, r) => {
|
|
1062
|
-
const { variant: a } = S(), i = s.useContext(Ln),
|
|
1054
|
+
const { variant: a } = S(), i = s.useContext(Ln), d = i?.indicatorIcon || nn, m = i?.indicatorIconPosition || "start", f = i?.indicatorIconClassName, l = a === "glass" ? Gt({ disabled: n, className: e }) : Lt({ theme: a, disabled: n, className: e }), u = /* @__PURE__ */ c("span", { className: Ft({ position: m }), children: /* @__PURE__ */ c(Fe, { children: /* @__PURE__ */ c(d, { className: jn("h-4 w-4", f) }) }) });
|
|
1063
1055
|
return /* @__PURE__ */ H(Ge, { ref: r, className: l, disabled: n, ...t, children: [
|
|
1064
|
-
|
|
1056
|
+
u,
|
|
1065
1057
|
o
|
|
1066
1058
|
] });
|
|
1067
1059
|
});
|
|
@@ -1147,23 +1139,23 @@ const Ht = M({
|
|
|
1147
1139
|
}
|
|
1148
1140
|
);
|
|
1149
1141
|
function Ir(e = {}) {
|
|
1150
|
-
const { openDelay: o = 200, closeDelay: n = 300 } = e, [t, r] = s.useState(!1), a = s.useRef(null), i = s.useRef(null),
|
|
1142
|
+
const { openDelay: o = 200, closeDelay: n = 300 } = e, [t, r] = s.useState(!1), a = s.useRef(null), i = s.useRef(null), d = s.useCallback(() => {
|
|
1151
1143
|
a.current && (clearTimeout(a.current), a.current = null), i.current && (clearTimeout(i.current), i.current = null);
|
|
1152
1144
|
}, []);
|
|
1153
1145
|
s.useEffect(() => () => {
|
|
1154
|
-
|
|
1155
|
-
}, [
|
|
1146
|
+
d();
|
|
1147
|
+
}, [d]);
|
|
1156
1148
|
const m = s.useCallback(() => {
|
|
1157
|
-
|
|
1149
|
+
d(), a.current = setTimeout(() => {
|
|
1158
1150
|
r(!0);
|
|
1159
1151
|
}, o);
|
|
1160
|
-
}, [o,
|
|
1161
|
-
|
|
1152
|
+
}, [o, d]), f = s.useCallback(() => {
|
|
1153
|
+
d(), i.current = setTimeout(() => {
|
|
1162
1154
|
r(!1);
|
|
1163
1155
|
}, n);
|
|
1164
|
-
}, [n,
|
|
1156
|
+
}, [n, d]), l = s.useCallback((w) => {
|
|
1165
1157
|
w.preventDefault(), w.stopPropagation();
|
|
1166
|
-
}, []),
|
|
1158
|
+
}, []), u = s.useCallback((w) => {
|
|
1167
1159
|
w.preventDefault();
|
|
1168
1160
|
}, []), g = s.useCallback((w) => {
|
|
1169
1161
|
r(w);
|
|
@@ -1182,7 +1174,7 @@ function Ir(e = {}) {
|
|
|
1182
1174
|
contentProps: {
|
|
1183
1175
|
onMouseEnter: m,
|
|
1184
1176
|
onMouseLeave: f,
|
|
1185
|
-
onCloseAutoFocus:
|
|
1177
|
+
onCloseAutoFocus: u
|
|
1186
1178
|
}
|
|
1187
1179
|
};
|
|
1188
1180
|
}
|