@senitix/ui 0.4.0
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/avatar-C0aVNCG9.cjs +2 -0
- package/dist/avatar-C0aVNCG9.cjs.map +1 -0
- package/dist/avatar-CN6wcrqY.js +288 -0
- package/dist/avatar-CN6wcrqY.js.map +1 -0
- package/dist/calendar-BFWc4IB7.js +1182 -0
- package/dist/calendar-BFWc4IB7.js.map +1 -0
- package/dist/calendar-BUm7YrNf.cjs +2 -0
- package/dist/calendar-BUm7YrNf.cjs.map +1 -0
- package/dist/calendar-ChJkFXXr.js +11 -0
- package/dist/calendar-ChJkFXXr.js.map +1 -0
- package/dist/calendar-SwL5isYC.cjs +2 -0
- package/dist/calendar-SwL5isYC.cjs.map +1 -0
- package/dist/card-K4fxyYwE.js +51 -0
- package/dist/card-K4fxyYwE.js.map +1 -0
- package/dist/card-tMkUxpmW.cjs +2 -0
- package/dist/card-tMkUxpmW.cjs.map +1 -0
- package/dist/checkbox-CpOq5hkT.js +289 -0
- package/dist/checkbox-CpOq5hkT.js.map +1 -0
- package/dist/checkbox-D7-LQyCl.cjs +2 -0
- package/dist/checkbox-D7-LQyCl.cjs.map +1 -0
- package/dist/chevron-down-DHdXqOqK.cjs +2 -0
- package/dist/chevron-down-DHdXqOqK.cjs.map +1 -0
- package/dist/chevron-down-DJ1_YIFu.js +8 -0
- package/dist/chevron-down-DJ1_YIFu.js.map +1 -0
- package/dist/chevron-right-B3bovvh0.js +8 -0
- package/dist/chevron-right-B3bovvh0.js.map +1 -0
- package/dist/chevron-right-Dvyd11q0.cjs +2 -0
- package/dist/chevron-right-Dvyd11q0.cjs.map +1 -0
- package/dist/chevron-up-B9fuiZhc.cjs +2 -0
- package/dist/chevron-up-B9fuiZhc.cjs.map +1 -0
- package/dist/chevron-up-CGtXOr51.js +6 -0
- package/dist/chevron-up-CGtXOr51.js.map +1 -0
- package/dist/components/charts/index.cjs.js +2 -0
- package/dist/components/charts/index.cjs.js.map +1 -0
- package/dist/components/charts/index.es.js +12 -0
- package/dist/components/charts/index.es.js.map +1 -0
- package/dist/components/data-display/index.cjs.js +2 -0
- package/dist/components/data-display/index.cjs.js.map +1 -0
- package/dist/components/data-display/index.es.js +25 -0
- package/dist/components/data-display/index.es.js.map +1 -0
- package/dist/components/dnd/index.cjs.js +2 -0
- package/dist/components/dnd/index.cjs.js.map +1 -0
- package/dist/components/dnd/index.es.js +9 -0
- package/dist/components/dnd/index.es.js.map +1 -0
- package/dist/components/feedback/index.cjs.js +2 -0
- package/dist/components/feedback/index.cjs.js.map +1 -0
- package/dist/components/feedback/index.es.js +16 -0
- package/dist/components/feedback/index.es.js.map +1 -0
- package/dist/components/forms/index.cjs.js +2 -0
- package/dist/components/forms/index.cjs.js.map +1 -0
- package/dist/components/forms/index.es.js +27 -0
- package/dist/components/forms/index.es.js.map +1 -0
- package/dist/components/layouts/index.cjs.js +2 -0
- package/dist/components/layouts/index.cjs.js.map +1 -0
- package/dist/components/layouts/index.es.js +25 -0
- package/dist/components/layouts/index.es.js.map +1 -0
- package/dist/components/navigation/index.cjs.js +2 -0
- package/dist/components/navigation/index.cjs.js.map +1 -0
- package/dist/components/navigation/index.es.js +42 -0
- package/dist/components/navigation/index.es.js.map +1 -0
- package/dist/components/ui/index.cjs.js +2 -0
- package/dist/components/ui/index.cjs.js.map +1 -0
- package/dist/components/ui/index.es.js +165 -0
- package/dist/components/ui/index.es.js.map +1 -0
- package/dist/createLucideIcon-BbeNo6vq.js +56 -0
- package/dist/createLucideIcon-BbeNo6vq.js.map +1 -0
- package/dist/createLucideIcon-i5GEhNMV.cjs +2 -0
- package/dist/createLucideIcon-i5GEhNMV.cjs.map +1 -0
- package/dist/ellipsis-BW2gWki8.cjs +2 -0
- package/dist/ellipsis-BW2gWki8.cjs.map +1 -0
- package/dist/ellipsis-CiKEaUNP.js +10 -0
- package/dist/ellipsis-CiKEaUNP.js.map +1 -0
- package/dist/file-V_hhCUhr.cjs +2 -0
- package/dist/file-V_hhCUhr.cjs.map +1 -0
- package/dist/file-wzTXnWqz.js +9 -0
- package/dist/file-wzTXnWqz.js.map +1 -0
- package/dist/filter-tags-DjUaNXHR.cjs +5 -0
- package/dist/filter-tags-DjUaNXHR.cjs.map +1 -0
- package/dist/filter-tags-i_I8qV1N.js +2658 -0
- package/dist/filter-tags-i_I8qV1N.js.map +1 -0
- package/dist/full-calendar-7ac2FFU6.js +3518 -0
- package/dist/full-calendar-7ac2FFU6.js.map +1 -0
- package/dist/full-calendar-Cpeh5xMP.cjs +8 -0
- package/dist/full-calendar-Cpeh5xMP.cjs.map +1 -0
- package/dist/global-search-UNXjoFlI.cjs +2 -0
- package/dist/global-search-UNXjoFlI.cjs.map +1 -0
- package/dist/global-search-h1rVbP2q.js +1188 -0
- package/dist/global-search-h1rVbP2q.js.map +1 -0
- package/dist/hooks/index.cjs.js +2 -0
- package/dist/hooks/index.cjs.js.map +1 -0
- package/dist/hooks/index.es.js +13 -0
- package/dist/hooks/index.es.js.map +1 -0
- package/dist/index-Co9o9StL.js +33 -0
- package/dist/index-Co9o9StL.js.map +1 -0
- package/dist/index-CwJPJKOE.js +2278 -0
- package/dist/index-CwJPJKOE.js.map +1 -0
- package/dist/index-CzVK9Zyb.cjs +6 -0
- package/dist/index-CzVK9Zyb.cjs.map +1 -0
- package/dist/index-l828OqQN.js +288 -0
- package/dist/index-l828OqQN.js.map +1 -0
- package/dist/index-lGzB9daF.cjs +2 -0
- package/dist/index-lGzB9daF.cjs.map +1 -0
- package/dist/index-lT9bLt9X.cjs +2 -0
- package/dist/index-lT9bLt9X.cjs.map +1 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.js +332 -0
- package/dist/index.es.js.map +1 -0
- package/dist/input-CZrckPLk.cjs +42 -0
- package/dist/input-CZrckPLk.cjs.map +1 -0
- package/dist/input-D4AoiWxo.js +3629 -0
- package/dist/input-D4AoiWxo.js.map +1 -0
- package/dist/locale-provider-DHMwuneF.cjs +2 -0
- package/dist/locale-provider-DHMwuneF.cjs.map +1 -0
- package/dist/locale-provider-DanG6RRG.js +1012 -0
- package/dist/locale-provider-DanG6RRG.js.map +1 -0
- package/dist/locale-selector-Ppe0KTi-.cjs +2 -0
- package/dist/locale-selector-Ppe0KTi-.cjs.map +1 -0
- package/dist/locale-selector-xn2GpdP9.js +1745 -0
- package/dist/locale-selector-xn2GpdP9.js.map +1 -0
- package/dist/minus-BXBFZSZs.cjs +2 -0
- package/dist/minus-BXBFZSZs.cjs.map +1 -0
- package/dist/minus-DvlYtl96.js +6 -0
- package/dist/minus-DvlYtl96.js.map +1 -0
- package/dist/multi-container-C2UpSw5f.js +731 -0
- package/dist/multi-container-C2UpSw5f.js.map +1 -0
- package/dist/multi-container-DMKL8c9B.cjs +2 -0
- package/dist/multi-container-DMKL8c9B.cjs.map +1 -0
- package/dist/pipeline-By5_8AFg.cjs +2 -0
- package/dist/pipeline-By5_8AFg.cjs.map +1 -0
- package/dist/pipeline-D-QNSU0U.js +1036 -0
- package/dist/pipeline-D-QNSU0U.js.map +1 -0
- package/dist/plus-8wKRkVu-.cjs +2 -0
- package/dist/plus-8wKRkVu-.cjs.map +1 -0
- package/dist/plus-CJD68KQD.js +9 -0
- package/dist/plus-CJD68KQD.js.map +1 -0
- package/dist/popover-4V4sGe1U.js +765 -0
- package/dist/popover-4V4sGe1U.js.map +1 -0
- package/dist/popover-ivh-plLc.cjs +2 -0
- package/dist/popover-ivh-plLc.cjs.map +1 -0
- package/dist/progress-CFnuLqnS.cjs +7 -0
- package/dist/progress-CFnuLqnS.cjs.map +1 -0
- package/dist/progress-D5AsrWa6.js +222 -0
- package/dist/progress-D5AsrWa6.js.map +1 -0
- package/dist/providers/index.cjs.js +2 -0
- package/dist/providers/index.cjs.js.map +1 -0
- package/dist/providers/index.es.js +9 -0
- package/dist/providers/index.es.js.map +1 -0
- package/dist/scroll-area-DQeqDp3Y.js +952 -0
- package/dist/scroll-area-DQeqDp3Y.js.map +1 -0
- package/dist/scroll-area-DYOiJMXh.cjs +2 -0
- package/dist/scroll-area-DYOiJMXh.cjs.map +1 -0
- package/dist/select-C1rNBi6c.js +974 -0
- package/dist/select-C1rNBi6c.js.map +1 -0
- package/dist/select-m-Mqwxu3.cjs +2 -0
- package/dist/select-m-Mqwxu3.cjs.map +1 -0
- package/dist/separator-DBUivkHq.cjs +2 -0
- package/dist/separator-DBUivkHq.cjs.map +1 -0
- package/dist/separator-DsfoJx-2.js +395 -0
- package/dist/separator-DsfoJx-2.js.map +1 -0
- package/dist/sheet-BVWCpq7E.js +84 -0
- package/dist/sheet-BVWCpq7E.js.map +1 -0
- package/dist/sheet-mKiFLVnK.cjs +2 -0
- package/dist/sheet-mKiFLVnK.cjs.map +1 -0
- package/dist/skeleton-BSwwYaQU.cjs +2 -0
- package/dist/skeleton-BSwwYaQU.cjs.map +1 -0
- package/dist/skeleton-BmGbfJw3.js +9 -0
- package/dist/skeleton-BmGbfJw3.js.map +1 -0
- package/dist/sortable.esm-Blhf_jh1.js +3391 -0
- package/dist/sortable.esm-Blhf_jh1.js.map +1 -0
- package/dist/sortable.esm-DcQYlXi3.cjs +6 -0
- package/dist/sortable.esm-DcQYlXi3.cjs.map +1 -0
- package/dist/sparkline-chart-Da-ehDGv.js +21082 -0
- package/dist/sparkline-chart-Da-ehDGv.js.map +1 -0
- package/dist/sparkline-chart-ca3uTzVK.cjs +68 -0
- package/dist/sparkline-chart-ca3uTzVK.cjs.map +1 -0
- package/dist/trending-up-D3Nfrhi3.cjs +2 -0
- package/dist/trending-up-D3Nfrhi3.cjs.map +1 -0
- package/dist/trending-up-DPwlYzQb.js +9 -0
- package/dist/trending-up-DPwlYzQb.js.map +1 -0
- package/dist/ui.css +1 -0
- package/dist/use-formatters-d97RVcmg.cjs +2 -0
- package/dist/use-formatters-d97RVcmg.cjs.map +1 -0
- package/dist/use-formatters-l1_2c8z0.js +6682 -0
- package/dist/use-formatters-l1_2c8z0.js.map +1 -0
- package/dist/use-local-storage-BjlrKzE-.js +42 -0
- package/dist/use-local-storage-BjlrKzE-.js.map +1 -0
- package/dist/use-local-storage-q-1odzIu.cjs +2 -0
- package/dist/use-local-storage-q-1odzIu.cjs.map +1 -0
- package/dist/use-mobile-C-LMK4T8.js +15 -0
- package/dist/use-mobile-C-LMK4T8.js.map +1 -0
- package/dist/use-mobile-DY7TJ5lx.cjs +2 -0
- package/dist/use-mobile-DY7TJ5lx.cjs.map +1 -0
- package/dist/use-toast-DG2qdYhl.js +97 -0
- package/dist/use-toast-DG2qdYhl.js.map +1 -0
- package/dist/use-toast-DxZJ8uUm.cjs +2 -0
- package/dist/use-toast-DxZJ8uUm.cjs.map +1 -0
- package/dist/utils/index.cjs.js +2 -0
- package/dist/utils/index.cjs.js.map +1 -0
- package/dist/utils/index.es.js +5 -0
- package/dist/utils/index.es.js.map +1 -0
- package/dist/welcome-card-CPolYl1D.cjs +2 -0
- package/dist/welcome-card-CPolYl1D.cjs.map +1 -0
- package/dist/welcome-card-CxMJZ8bv.js +963 -0
- package/dist/welcome-card-CxMJZ8bv.js.map +1 -0
- package/package.json +179 -0
|
@@ -0,0 +1,765 @@
|
|
|
1
|
+
import { c as rt } from "./createLucideIcon-BbeNo6vq.js";
|
|
2
|
+
import { jsx as p, jsxs as U } from "react/jsx-runtime";
|
|
3
|
+
import * as o from "react";
|
|
4
|
+
import { R as ke, P as Ee, O as ue, a as pe, C as Ne, T as ot, b as Se, D as Ae, S as nt } from "./index-l828OqQN.js";
|
|
5
|
+
import { P as S, f as V, X as at, e as lt, g as st, h as Ie, j as H, m as _e } from "./scroll-area-DQeqDp3Y.js";
|
|
6
|
+
import { p as F, o as De, u as it, R as ct, A as Oe, P as dt, r as ut, t as pt, s as ft, F as mt, v as vt, C as gt, w as ht } from "./input-D4AoiWxo.js";
|
|
7
|
+
import { c as k } from "./index-CwJPJKOE.js";
|
|
8
|
+
const Sr = rt("LoaderCircle", [
|
|
9
|
+
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
10
|
+
]);
|
|
11
|
+
var Ce = 1, bt = 0.9, yt = 0.8, xt = 0.17, le = 0.1, se = 0.999, wt = 0.9999, Ct = 0.99, Rt = /[\\\/_+.#"@\[\(\{&]/, Pt = /[\\\/_+.#"@\[\(\{&]/g, kt = /[\s-]/, Fe = /[\s-]/g;
|
|
12
|
+
function ce(e, r, t, s, n, l, i) {
|
|
13
|
+
if (l === r.length) return n === e.length ? Ce : Ct;
|
|
14
|
+
var d = `${n},${l}`;
|
|
15
|
+
if (i[d] !== void 0) return i[d];
|
|
16
|
+
for (var m = s.charAt(l), c = t.indexOf(m, n), v = 0, h, x, C, A; c >= 0; ) h = ce(e, r, t, s, c + 1, l + 1, i), h > v && (c === n ? h *= Ce : Rt.test(e.charAt(c - 1)) ? (h *= yt, C = e.slice(n, c - 1).match(Pt), C && n > 0 && (h *= Math.pow(se, C.length))) : kt.test(e.charAt(c - 1)) ? (h *= bt, A = e.slice(n, c - 1).match(Fe), A && n > 0 && (h *= Math.pow(se, A.length))) : (h *= xt, n > 0 && (h *= Math.pow(se, c - n))), e.charAt(c) !== r.charAt(l) && (h *= wt)), (h < le && t.charAt(c - 1) === s.charAt(l + 1) || s.charAt(l + 1) === s.charAt(l) && t.charAt(c - 1) !== s.charAt(l)) && (x = ce(e, r, t, s, c + 1, l + 2, i), x * le > h && (h = x * le)), h > v && (v = h), c = t.indexOf(m, c + 1);
|
|
17
|
+
return i[d] = v, v;
|
|
18
|
+
}
|
|
19
|
+
function Re(e) {
|
|
20
|
+
return e.toLowerCase().replace(Fe, " ");
|
|
21
|
+
}
|
|
22
|
+
function Et(e, r, t) {
|
|
23
|
+
return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, ce(e, r, Re(e), Re(r), 0, 0, {});
|
|
24
|
+
}
|
|
25
|
+
var K = '[cmdk-group=""]', ie = '[cmdk-group-items=""]', Nt = '[cmdk-group-heading=""]', Me = '[cmdk-item=""]', Pe = `${Me}:not([aria-disabled="true"])`, de = "cmdk-item-select", T = "data-value", St = (e, r, t) => Et(e, r, t), $e = o.createContext(void 0), q = () => o.useContext($e), Te = o.createContext(void 0), fe = () => o.useContext(Te), Le = o.createContext(void 0), Ve = o.forwardRef((e, r) => {
|
|
26
|
+
let t = L(() => {
|
|
27
|
+
var a, f;
|
|
28
|
+
return { search: "", value: (f = (a = e.value) != null ? a : e.defaultValue) != null ? f : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
29
|
+
}), s = L(() => /* @__PURE__ */ new Set()), n = L(() => /* @__PURE__ */ new Map()), l = L(() => /* @__PURE__ */ new Map()), i = L(() => /* @__PURE__ */ new Set()), d = je(e), { label: m, children: c, value: v, onValueChange: h, filter: x, shouldFilter: C, loop: A, disablePointerSelection: J = !1, vimBindings: D = !0, ...G } = e, Y = F(), ve = F(), Q = F(), O = o.useRef(null), w = Vt();
|
|
30
|
+
M(() => {
|
|
31
|
+
if (v !== void 0) {
|
|
32
|
+
let a = v.trim();
|
|
33
|
+
t.current.value = a, P.emit();
|
|
34
|
+
}
|
|
35
|
+
}, [v]), M(() => {
|
|
36
|
+
w(6, he);
|
|
37
|
+
}, []);
|
|
38
|
+
let P = o.useMemo(() => ({ subscribe: (a) => (i.current.add(a), () => i.current.delete(a)), snapshot: () => t.current, setState: (a, f, g) => {
|
|
39
|
+
var u, b, y, N;
|
|
40
|
+
if (!Object.is(t.current[a], f)) {
|
|
41
|
+
if (t.current[a] = f, a === "search") oe(), te(), w(1, re);
|
|
42
|
+
else if (a === "value") {
|
|
43
|
+
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
44
|
+
let R = document.getElementById(Q);
|
|
45
|
+
R ? R.focus() : (u = document.getElementById(Y)) == null || u.focus();
|
|
46
|
+
}
|
|
47
|
+
if (w(7, () => {
|
|
48
|
+
var R;
|
|
49
|
+
t.current.selectedItemId = (R = $()) == null ? void 0 : R.id, P.emit();
|
|
50
|
+
}), g || w(5, he), ((b = d.current) == null ? void 0 : b.value) !== void 0) {
|
|
51
|
+
let R = f ?? "";
|
|
52
|
+
(N = (y = d.current).onValueChange) == null || N.call(y, R);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
P.emit();
|
|
57
|
+
}
|
|
58
|
+
}, emit: () => {
|
|
59
|
+
i.current.forEach((a) => a());
|
|
60
|
+
} }), []), ee = o.useMemo(() => ({ value: (a, f, g) => {
|
|
61
|
+
var u;
|
|
62
|
+
f !== ((u = l.current.get(a)) == null ? void 0 : u.value) && (l.current.set(a, { value: f, keywords: g }), t.current.filtered.items.set(a, ge(f, g)), w(2, () => {
|
|
63
|
+
te(), P.emit();
|
|
64
|
+
}));
|
|
65
|
+
}, item: (a, f) => (s.current.add(a), f && (n.current.has(f) ? n.current.get(f).add(a) : n.current.set(f, /* @__PURE__ */ new Set([a]))), w(3, () => {
|
|
66
|
+
oe(), te(), t.current.value || re(), P.emit();
|
|
67
|
+
}), () => {
|
|
68
|
+
l.current.delete(a), s.current.delete(a), t.current.filtered.items.delete(a);
|
|
69
|
+
let g = $();
|
|
70
|
+
w(4, () => {
|
|
71
|
+
oe(), g?.getAttribute("id") === a && re(), P.emit();
|
|
72
|
+
});
|
|
73
|
+
}), group: (a) => (n.current.has(a) || n.current.set(a, /* @__PURE__ */ new Set()), () => {
|
|
74
|
+
l.current.delete(a), n.current.delete(a);
|
|
75
|
+
}), filter: () => d.current.shouldFilter, label: m || e["aria-label"], getDisablePointerSelection: () => d.current.disablePointerSelection, listId: Y, inputId: Q, labelId: ve, listInnerRef: O }), []);
|
|
76
|
+
function ge(a, f) {
|
|
77
|
+
var g, u;
|
|
78
|
+
let b = (u = (g = d.current) == null ? void 0 : g.filter) != null ? u : St;
|
|
79
|
+
return a ? b(a, t.current.search, f) : 0;
|
|
80
|
+
}
|
|
81
|
+
function te() {
|
|
82
|
+
if (!t.current.search || d.current.shouldFilter === !1) return;
|
|
83
|
+
let a = t.current.filtered.items, f = [];
|
|
84
|
+
t.current.filtered.groups.forEach((u) => {
|
|
85
|
+
let b = n.current.get(u), y = 0;
|
|
86
|
+
b.forEach((N) => {
|
|
87
|
+
let R = a.get(N);
|
|
88
|
+
y = Math.max(R, y);
|
|
89
|
+
}), f.push([u, y]);
|
|
90
|
+
});
|
|
91
|
+
let g = O.current;
|
|
92
|
+
z().sort((u, b) => {
|
|
93
|
+
var y, N;
|
|
94
|
+
let R = u.getAttribute("id"), B = b.getAttribute("id");
|
|
95
|
+
return ((y = a.get(B)) != null ? y : 0) - ((N = a.get(R)) != null ? N : 0);
|
|
96
|
+
}).forEach((u) => {
|
|
97
|
+
let b = u.closest(ie);
|
|
98
|
+
b ? b.appendChild(u.parentElement === b ? u : u.closest(`${ie} > *`)) : g.appendChild(u.parentElement === g ? u : u.closest(`${ie} > *`));
|
|
99
|
+
}), f.sort((u, b) => b[1] - u[1]).forEach((u) => {
|
|
100
|
+
var b;
|
|
101
|
+
let y = (b = O.current) == null ? void 0 : b.querySelector(`${K}[${T}="${encodeURIComponent(u[0])}"]`);
|
|
102
|
+
y?.parentElement.appendChild(y);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function re() {
|
|
106
|
+
let a = z().find((g) => g.getAttribute("aria-disabled") !== "true"), f = a?.getAttribute(T);
|
|
107
|
+
P.setState("value", f || void 0);
|
|
108
|
+
}
|
|
109
|
+
function oe() {
|
|
110
|
+
var a, f, g, u;
|
|
111
|
+
if (!t.current.search || d.current.shouldFilter === !1) {
|
|
112
|
+
t.current.filtered.count = s.current.size;
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
t.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
116
|
+
let b = 0;
|
|
117
|
+
for (let y of s.current) {
|
|
118
|
+
let N = (f = (a = l.current.get(y)) == null ? void 0 : a.value) != null ? f : "", R = (u = (g = l.current.get(y)) == null ? void 0 : g.keywords) != null ? u : [], B = ge(N, R);
|
|
119
|
+
t.current.filtered.items.set(y, B), B > 0 && b++;
|
|
120
|
+
}
|
|
121
|
+
for (let [y, N] of n.current) for (let R of N) if (t.current.filtered.items.get(R) > 0) {
|
|
122
|
+
t.current.filtered.groups.add(y);
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
t.current.filtered.count = b;
|
|
126
|
+
}
|
|
127
|
+
function he() {
|
|
128
|
+
var a, f, g;
|
|
129
|
+
let u = $();
|
|
130
|
+
u && (((a = u.parentElement) == null ? void 0 : a.firstChild) === u && ((g = (f = u.closest(K)) == null ? void 0 : f.querySelector(Nt)) == null || g.scrollIntoView({ block: "nearest" })), u.scrollIntoView({ block: "nearest" }));
|
|
131
|
+
}
|
|
132
|
+
function $() {
|
|
133
|
+
var a;
|
|
134
|
+
return (a = O.current) == null ? void 0 : a.querySelector(`${Me}[aria-selected="true"]`);
|
|
135
|
+
}
|
|
136
|
+
function z() {
|
|
137
|
+
var a;
|
|
138
|
+
return Array.from(((a = O.current) == null ? void 0 : a.querySelectorAll(Pe)) || []);
|
|
139
|
+
}
|
|
140
|
+
function ne(a) {
|
|
141
|
+
let f = z()[a];
|
|
142
|
+
f && P.setState("value", f.getAttribute(T));
|
|
143
|
+
}
|
|
144
|
+
function ae(a) {
|
|
145
|
+
var f;
|
|
146
|
+
let g = $(), u = z(), b = u.findIndex((N) => N === g), y = u[b + a];
|
|
147
|
+
(f = d.current) != null && f.loop && (y = b + a < 0 ? u[u.length - 1] : b + a === u.length ? u[0] : u[b + a]), y && P.setState("value", y.getAttribute(T));
|
|
148
|
+
}
|
|
149
|
+
function be(a) {
|
|
150
|
+
let f = $(), g = f?.closest(K), u;
|
|
151
|
+
for (; g && !u; ) g = a > 0 ? Tt(g, K) : Lt(g, K), u = g?.querySelector(Pe);
|
|
152
|
+
u ? P.setState("value", u.getAttribute(T)) : ae(a);
|
|
153
|
+
}
|
|
154
|
+
let ye = () => ne(z().length - 1), xe = (a) => {
|
|
155
|
+
a.preventDefault(), a.metaKey ? ye() : a.altKey ? be(1) : ae(1);
|
|
156
|
+
}, we = (a) => {
|
|
157
|
+
a.preventDefault(), a.metaKey ? ne(0) : a.altKey ? be(-1) : ae(-1);
|
|
158
|
+
};
|
|
159
|
+
return o.createElement(S.div, { ref: r, tabIndex: -1, ...G, "cmdk-root": "", onKeyDown: (a) => {
|
|
160
|
+
var f;
|
|
161
|
+
(f = G.onKeyDown) == null || f.call(G, a);
|
|
162
|
+
let g = a.nativeEvent.isComposing || a.keyCode === 229;
|
|
163
|
+
if (!(a.defaultPrevented || g)) switch (a.key) {
|
|
164
|
+
case "n":
|
|
165
|
+
case "j": {
|
|
166
|
+
D && a.ctrlKey && xe(a);
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
case "ArrowDown": {
|
|
170
|
+
xe(a);
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
case "p":
|
|
174
|
+
case "k": {
|
|
175
|
+
D && a.ctrlKey && we(a);
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
case "ArrowUp": {
|
|
179
|
+
we(a);
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
case "Home": {
|
|
183
|
+
a.preventDefault(), ne(0);
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
case "End": {
|
|
187
|
+
a.preventDefault(), ye();
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
case "Enter": {
|
|
191
|
+
a.preventDefault();
|
|
192
|
+
let u = $();
|
|
193
|
+
if (u) {
|
|
194
|
+
let b = new Event(de);
|
|
195
|
+
u.dispatchEvent(b);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
} }, o.createElement("label", { "cmdk-label": "", htmlFor: ee.inputId, id: ee.labelId, style: zt }, m), X(e, (a) => o.createElement(Te.Provider, { value: P }, o.createElement($e.Provider, { value: ee }, a))));
|
|
200
|
+
}), At = o.forwardRef((e, r) => {
|
|
201
|
+
var t, s;
|
|
202
|
+
let n = F(), l = o.useRef(null), i = o.useContext(Le), d = q(), m = je(e), c = (s = (t = m.current) == null ? void 0 : t.forceMount) != null ? s : i?.forceMount;
|
|
203
|
+
M(() => {
|
|
204
|
+
if (!c) return d.item(n, i?.id);
|
|
205
|
+
}, [c]);
|
|
206
|
+
let v = ze(n, l, [e.value, e.children, l], e.keywords), h = fe(), x = I((w) => w.value && w.value === v.current), C = I((w) => c || d.filter() === !1 ? !0 : w.search ? w.filtered.items.get(n) > 0 : !0);
|
|
207
|
+
o.useEffect(() => {
|
|
208
|
+
let w = l.current;
|
|
209
|
+
if (!(!w || e.disabled)) return w.addEventListener(de, A), () => w.removeEventListener(de, A);
|
|
210
|
+
}, [C, e.onSelect, e.disabled]);
|
|
211
|
+
function A() {
|
|
212
|
+
var w, P;
|
|
213
|
+
J(), (P = (w = m.current).onSelect) == null || P.call(w, v.current);
|
|
214
|
+
}
|
|
215
|
+
function J() {
|
|
216
|
+
h.setState("value", v.current, !0);
|
|
217
|
+
}
|
|
218
|
+
if (!C) return null;
|
|
219
|
+
let { disabled: D, value: G, onSelect: Y, forceMount: ve, keywords: Q, ...O } = e;
|
|
220
|
+
return o.createElement(S.div, { ref: V(l, r), ...O, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!D, "aria-selected": !!x, "data-disabled": !!D, "data-selected": !!x, onPointerMove: D || d.getDisablePointerSelection() ? void 0 : J, onClick: D ? void 0 : A }, e.children);
|
|
221
|
+
}), It = o.forwardRef((e, r) => {
|
|
222
|
+
let { heading: t, children: s, forceMount: n, ...l } = e, i = F(), d = o.useRef(null), m = o.useRef(null), c = F(), v = q(), h = I((C) => n || v.filter() === !1 ? !0 : C.search ? C.filtered.groups.has(i) : !0);
|
|
223
|
+
M(() => v.group(i), []), ze(i, d, [e.value, e.heading, m]);
|
|
224
|
+
let x = o.useMemo(() => ({ id: i, forceMount: n }), [n]);
|
|
225
|
+
return o.createElement(S.div, { ref: V(d, r), ...l, "cmdk-group": "", role: "presentation", hidden: h ? void 0 : !0 }, t && o.createElement("div", { ref: m, "cmdk-group-heading": "", "aria-hidden": !0, id: c }, t), X(e, (C) => o.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? c : void 0 }, o.createElement(Le.Provider, { value: x }, C))));
|
|
226
|
+
}), _t = o.forwardRef((e, r) => {
|
|
227
|
+
let { alwaysRender: t, ...s } = e, n = o.useRef(null), l = I((i) => !i.search);
|
|
228
|
+
return !t && !l ? null : o.createElement(S.div, { ref: V(n, r), ...s, "cmdk-separator": "", role: "separator" });
|
|
229
|
+
}), Dt = o.forwardRef((e, r) => {
|
|
230
|
+
let { onValueChange: t, ...s } = e, n = e.value != null, l = fe(), i = I((c) => c.search), d = I((c) => c.selectedItemId), m = q();
|
|
231
|
+
return o.useEffect(() => {
|
|
232
|
+
e.value != null && l.setState("search", e.value);
|
|
233
|
+
}, [e.value]), o.createElement(S.input, { ref: r, ...s, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": m.listId, "aria-labelledby": m.labelId, "aria-activedescendant": d, id: m.inputId, type: "text", value: n ? e.value : i, onChange: (c) => {
|
|
234
|
+
n || l.setState("search", c.target.value), t?.(c.target.value);
|
|
235
|
+
} });
|
|
236
|
+
}), Ot = o.forwardRef((e, r) => {
|
|
237
|
+
let { children: t, label: s = "Suggestions", ...n } = e, l = o.useRef(null), i = o.useRef(null), d = I((c) => c.selectedItemId), m = q();
|
|
238
|
+
return o.useEffect(() => {
|
|
239
|
+
if (i.current && l.current) {
|
|
240
|
+
let c = i.current, v = l.current, h, x = new ResizeObserver(() => {
|
|
241
|
+
h = requestAnimationFrame(() => {
|
|
242
|
+
let C = c.offsetHeight;
|
|
243
|
+
v.style.setProperty("--cmdk-list-height", C.toFixed(1) + "px");
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
return x.observe(c), () => {
|
|
247
|
+
cancelAnimationFrame(h), x.unobserve(c);
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
}, []), o.createElement(S.div, { ref: V(l, r), ...n, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": d, "aria-label": s, id: m.listId }, X(e, (c) => o.createElement("div", { ref: V(i, m.listInnerRef), "cmdk-list-sizer": "" }, c)));
|
|
251
|
+
}), Ft = o.forwardRef((e, r) => {
|
|
252
|
+
let { open: t, onOpenChange: s, overlayClassName: n, contentClassName: l, container: i, ...d } = e;
|
|
253
|
+
return o.createElement(ke, { open: t, onOpenChange: s }, o.createElement(Ee, { container: i }, o.createElement(ue, { "cmdk-overlay": "", className: n }), o.createElement(pe, { "aria-label": e.label, "cmdk-dialog": "", className: l }, o.createElement(Ve, { ref: r, ...d }))));
|
|
254
|
+
}), Mt = o.forwardRef((e, r) => I((t) => t.filtered.count === 0) ? o.createElement(S.div, { ref: r, ...e, "cmdk-empty": "", role: "presentation" }) : null), $t = o.forwardRef((e, r) => {
|
|
255
|
+
let { progress: t, children: s, label: n = "Loading...", ...l } = e;
|
|
256
|
+
return o.createElement(S.div, { ref: r, ...l, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": n }, X(e, (i) => o.createElement("div", { "aria-hidden": !0 }, i)));
|
|
257
|
+
}), E = Object.assign(Ve, { List: Ot, Item: At, Input: Dt, Group: It, Separator: _t, Dialog: Ft, Empty: Mt, Loading: $t });
|
|
258
|
+
function Tt(e, r) {
|
|
259
|
+
let t = e.nextElementSibling;
|
|
260
|
+
for (; t; ) {
|
|
261
|
+
if (t.matches(r)) return t;
|
|
262
|
+
t = t.nextElementSibling;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
function Lt(e, r) {
|
|
266
|
+
let t = e.previousElementSibling;
|
|
267
|
+
for (; t; ) {
|
|
268
|
+
if (t.matches(r)) return t;
|
|
269
|
+
t = t.previousElementSibling;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function je(e) {
|
|
273
|
+
let r = o.useRef(e);
|
|
274
|
+
return M(() => {
|
|
275
|
+
r.current = e;
|
|
276
|
+
}), r;
|
|
277
|
+
}
|
|
278
|
+
var M = typeof window > "u" ? o.useEffect : o.useLayoutEffect;
|
|
279
|
+
function L(e) {
|
|
280
|
+
let r = o.useRef();
|
|
281
|
+
return r.current === void 0 && (r.current = e()), r;
|
|
282
|
+
}
|
|
283
|
+
function I(e) {
|
|
284
|
+
let r = fe(), t = () => e(r.snapshot());
|
|
285
|
+
return o.useSyncExternalStore(r.subscribe, t, t);
|
|
286
|
+
}
|
|
287
|
+
function ze(e, r, t, s = []) {
|
|
288
|
+
let n = o.useRef(), l = q();
|
|
289
|
+
return M(() => {
|
|
290
|
+
var i;
|
|
291
|
+
let d = (() => {
|
|
292
|
+
var c;
|
|
293
|
+
for (let v of t) {
|
|
294
|
+
if (typeof v == "string") return v.trim();
|
|
295
|
+
if (typeof v == "object" && "current" in v) return v.current ? (c = v.current.textContent) == null ? void 0 : c.trim() : n.current;
|
|
296
|
+
}
|
|
297
|
+
})(), m = s.map((c) => c.trim());
|
|
298
|
+
l.value(e, d, m), (i = r.current) == null || i.setAttribute(T, d), n.current = d;
|
|
299
|
+
}), n;
|
|
300
|
+
}
|
|
301
|
+
var Vt = () => {
|
|
302
|
+
let [e, r] = o.useState(), t = L(() => /* @__PURE__ */ new Map());
|
|
303
|
+
return M(() => {
|
|
304
|
+
t.current.forEach((s) => s()), t.current = /* @__PURE__ */ new Map();
|
|
305
|
+
}, [e]), (s, n) => {
|
|
306
|
+
t.current.set(s, n), r({});
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
function jt(e) {
|
|
310
|
+
let r = e.type;
|
|
311
|
+
return typeof r == "function" ? r(e.props) : "render" in r ? r.render(e.props) : e;
|
|
312
|
+
}
|
|
313
|
+
function X({ asChild: e, children: r }, t) {
|
|
314
|
+
return e && o.isValidElement(r) ? o.cloneElement(jt(r), { ref: r.ref }, t(r.props.children)) : t(r);
|
|
315
|
+
}
|
|
316
|
+
var zt = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
317
|
+
const Kt = ke, Ar = ot, Ht = Ee, Ir = Ne, Ke = o.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ p(
|
|
318
|
+
ue,
|
|
319
|
+
{
|
|
320
|
+
ref: t,
|
|
321
|
+
className: k(
|
|
322
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
323
|
+
e
|
|
324
|
+
),
|
|
325
|
+
...r
|
|
326
|
+
}
|
|
327
|
+
));
|
|
328
|
+
Ke.displayName = ue.displayName;
|
|
329
|
+
const qt = lt(
|
|
330
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
331
|
+
{
|
|
332
|
+
variants: {
|
|
333
|
+
size: {
|
|
334
|
+
sm: "max-w-sm",
|
|
335
|
+
md: "max-w-md",
|
|
336
|
+
lg: "max-w-lg",
|
|
337
|
+
xl: "max-w-xl",
|
|
338
|
+
"2xl": "max-w-2xl",
|
|
339
|
+
"3xl": "max-w-3xl",
|
|
340
|
+
"4xl": "max-w-4xl",
|
|
341
|
+
full: "max-w-full"
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
defaultVariants: {
|
|
345
|
+
size: "lg"
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
), He = o.forwardRef(({ className: e, children: r, size: t, ...s }, n) => /* @__PURE__ */ U(Ht, { children: [
|
|
349
|
+
/* @__PURE__ */ p(Ke, {}),
|
|
350
|
+
/* @__PURE__ */ U(
|
|
351
|
+
pe,
|
|
352
|
+
{
|
|
353
|
+
ref: n,
|
|
354
|
+
className: k(qt({ size: t }), e),
|
|
355
|
+
...s,
|
|
356
|
+
children: [
|
|
357
|
+
r,
|
|
358
|
+
/* @__PURE__ */ U(Ne, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
359
|
+
/* @__PURE__ */ p(at, { className: "h-4 w-4" }),
|
|
360
|
+
/* @__PURE__ */ p("span", { className: "sr-only", children: "Close" })
|
|
361
|
+
] })
|
|
362
|
+
]
|
|
363
|
+
}
|
|
364
|
+
)
|
|
365
|
+
] }));
|
|
366
|
+
He.displayName = pe.displayName;
|
|
367
|
+
const Wt = ({ className: e, ...r }) => /* @__PURE__ */ p("div", { className: k("flex flex-col space-y-1.5 text-center sm:text-left", e), ...r });
|
|
368
|
+
Wt.displayName = "DialogHeader";
|
|
369
|
+
const Gt = ({ className: e, ...r }) => /* @__PURE__ */ p(
|
|
370
|
+
"div",
|
|
371
|
+
{
|
|
372
|
+
className: k("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
|
|
373
|
+
...r
|
|
374
|
+
}
|
|
375
|
+
);
|
|
376
|
+
Gt.displayName = "DialogFooter";
|
|
377
|
+
const Bt = o.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ p(
|
|
378
|
+
Se,
|
|
379
|
+
{
|
|
380
|
+
ref: t,
|
|
381
|
+
className: k("text-lg font-semibold leading-none tracking-tight", e),
|
|
382
|
+
...r
|
|
383
|
+
}
|
|
384
|
+
));
|
|
385
|
+
Bt.displayName = Se.displayName;
|
|
386
|
+
const Ut = o.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ p(
|
|
387
|
+
Ae,
|
|
388
|
+
{
|
|
389
|
+
ref: t,
|
|
390
|
+
className: k("text-sm text-muted-foreground", e),
|
|
391
|
+
...r
|
|
392
|
+
}
|
|
393
|
+
));
|
|
394
|
+
Ut.displayName = Ae.displayName;
|
|
395
|
+
const qe = o.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ p(
|
|
396
|
+
E,
|
|
397
|
+
{
|
|
398
|
+
ref: t,
|
|
399
|
+
className: k(
|
|
400
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
401
|
+
e
|
|
402
|
+
),
|
|
403
|
+
...r
|
|
404
|
+
}
|
|
405
|
+
));
|
|
406
|
+
qe.displayName = E.displayName;
|
|
407
|
+
const _r = ({ children: e, ...r }) => /* @__PURE__ */ p(Kt, { ...r, children: /* @__PURE__ */ p(He, { className: "overflow-hidden p-0 shadow-lg", children: /* @__PURE__ */ p(qe, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: e }) }) }), Xt = o.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ U("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
408
|
+
/* @__PURE__ */ p(nt, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
409
|
+
/* @__PURE__ */ p(
|
|
410
|
+
E.Input,
|
|
411
|
+
{
|
|
412
|
+
ref: t,
|
|
413
|
+
className: k(
|
|
414
|
+
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
415
|
+
e
|
|
416
|
+
),
|
|
417
|
+
...r
|
|
418
|
+
}
|
|
419
|
+
)
|
|
420
|
+
] }));
|
|
421
|
+
Xt.displayName = E.Input.displayName;
|
|
422
|
+
const Zt = o.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ p(
|
|
423
|
+
E.List,
|
|
424
|
+
{
|
|
425
|
+
ref: t,
|
|
426
|
+
className: k("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
|
|
427
|
+
...r
|
|
428
|
+
}
|
|
429
|
+
));
|
|
430
|
+
Zt.displayName = E.List.displayName;
|
|
431
|
+
const Jt = o.forwardRef((e, r) => /* @__PURE__ */ p(E.Empty, { ref: r, className: "py-6 text-center text-sm", ...e }));
|
|
432
|
+
Jt.displayName = E.Empty.displayName;
|
|
433
|
+
const Yt = o.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ p(
|
|
434
|
+
E.Group,
|
|
435
|
+
{
|
|
436
|
+
ref: t,
|
|
437
|
+
className: k(
|
|
438
|
+
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
439
|
+
e
|
|
440
|
+
),
|
|
441
|
+
...r
|
|
442
|
+
}
|
|
443
|
+
));
|
|
444
|
+
Yt.displayName = E.Group.displayName;
|
|
445
|
+
const Qt = o.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ p(
|
|
446
|
+
E.Separator,
|
|
447
|
+
{
|
|
448
|
+
ref: t,
|
|
449
|
+
className: k("-mx-1 h-px bg-border", e),
|
|
450
|
+
...r
|
|
451
|
+
}
|
|
452
|
+
));
|
|
453
|
+
Qt.displayName = E.Separator.displayName;
|
|
454
|
+
const er = o.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ p(
|
|
455
|
+
E.Item,
|
|
456
|
+
{
|
|
457
|
+
ref: t,
|
|
458
|
+
className: k(
|
|
459
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",
|
|
460
|
+
e
|
|
461
|
+
),
|
|
462
|
+
...r
|
|
463
|
+
}
|
|
464
|
+
));
|
|
465
|
+
er.displayName = E.Item.displayName;
|
|
466
|
+
const tr = ({ className: e, ...r }) => /* @__PURE__ */ p(
|
|
467
|
+
"span",
|
|
468
|
+
{
|
|
469
|
+
className: k("ml-auto text-xs tracking-widest text-muted-foreground", e),
|
|
470
|
+
...r
|
|
471
|
+
}
|
|
472
|
+
);
|
|
473
|
+
tr.displayName = "CommandShortcut";
|
|
474
|
+
// @__NO_SIDE_EFFECTS__
|
|
475
|
+
function rr(e) {
|
|
476
|
+
const r = /* @__PURE__ */ or(e), t = o.forwardRef((s, n) => {
|
|
477
|
+
const { children: l, ...i } = s, d = o.Children.toArray(l), m = d.find(ar);
|
|
478
|
+
if (m) {
|
|
479
|
+
const c = m.props.children, v = d.map((h) => h === m ? o.Children.count(c) > 1 ? o.Children.only(null) : o.isValidElement(c) ? c.props.children : null : h);
|
|
480
|
+
return /* @__PURE__ */ p(r, { ...i, ref: n, children: o.isValidElement(c) ? o.cloneElement(c, void 0, v) : null });
|
|
481
|
+
}
|
|
482
|
+
return /* @__PURE__ */ p(r, { ...i, ref: n, children: l });
|
|
483
|
+
});
|
|
484
|
+
return t.displayName = `${e}.Slot`, t;
|
|
485
|
+
}
|
|
486
|
+
// @__NO_SIDE_EFFECTS__
|
|
487
|
+
function or(e) {
|
|
488
|
+
const r = o.forwardRef((t, s) => {
|
|
489
|
+
const { children: n, ...l } = t;
|
|
490
|
+
if (o.isValidElement(n)) {
|
|
491
|
+
const i = sr(n), d = lr(l, n.props);
|
|
492
|
+
return n.type !== o.Fragment && (d.ref = s ? V(s, i) : i), o.cloneElement(n, d);
|
|
493
|
+
}
|
|
494
|
+
return o.Children.count(n) > 1 ? o.Children.only(null) : null;
|
|
495
|
+
});
|
|
496
|
+
return r.displayName = `${e}.SlotClone`, r;
|
|
497
|
+
}
|
|
498
|
+
var nr = /* @__PURE__ */ Symbol("radix.slottable");
|
|
499
|
+
function ar(e) {
|
|
500
|
+
return o.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === nr;
|
|
501
|
+
}
|
|
502
|
+
function lr(e, r) {
|
|
503
|
+
const t = { ...r };
|
|
504
|
+
for (const s in r) {
|
|
505
|
+
const n = e[s], l = r[s];
|
|
506
|
+
/^on[A-Z]/.test(s) ? n && l ? t[s] = (...d) => {
|
|
507
|
+
const m = l(...d);
|
|
508
|
+
return n(...d), m;
|
|
509
|
+
} : n && (t[s] = n) : s === "style" ? t[s] = { ...n, ...l } : s === "className" && (t[s] = [n, l].filter(Boolean).join(" "));
|
|
510
|
+
}
|
|
511
|
+
return { ...e, ...t };
|
|
512
|
+
}
|
|
513
|
+
function sr(e) {
|
|
514
|
+
let r = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, t = r && "isReactWarning" in r && r.isReactWarning;
|
|
515
|
+
return t ? e.ref : (r = Object.getOwnPropertyDescriptor(e, "ref")?.get, t = r && "isReactWarning" in r && r.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
|
|
516
|
+
}
|
|
517
|
+
var Z = "Popover", [We] = st(Z, [
|
|
518
|
+
De
|
|
519
|
+
]), W = De(), [ir, _] = We(Z), Ge = (e) => {
|
|
520
|
+
const {
|
|
521
|
+
__scopePopover: r,
|
|
522
|
+
children: t,
|
|
523
|
+
open: s,
|
|
524
|
+
defaultOpen: n,
|
|
525
|
+
onOpenChange: l,
|
|
526
|
+
modal: i = !1
|
|
527
|
+
} = e, d = W(r), m = o.useRef(null), [c, v] = o.useState(!1), [h, x] = it({
|
|
528
|
+
prop: s,
|
|
529
|
+
defaultProp: n ?? !1,
|
|
530
|
+
onChange: l,
|
|
531
|
+
caller: Z
|
|
532
|
+
});
|
|
533
|
+
return /* @__PURE__ */ p(ct, { ...d, children: /* @__PURE__ */ p(
|
|
534
|
+
ir,
|
|
535
|
+
{
|
|
536
|
+
scope: r,
|
|
537
|
+
contentId: F(),
|
|
538
|
+
triggerRef: m,
|
|
539
|
+
open: h,
|
|
540
|
+
onOpenChange: x,
|
|
541
|
+
onOpenToggle: o.useCallback(() => x((C) => !C), [x]),
|
|
542
|
+
hasCustomAnchor: c,
|
|
543
|
+
onCustomAnchorAdd: o.useCallback(() => v(!0), []),
|
|
544
|
+
onCustomAnchorRemove: o.useCallback(() => v(!1), []),
|
|
545
|
+
modal: i,
|
|
546
|
+
children: t
|
|
547
|
+
}
|
|
548
|
+
) });
|
|
549
|
+
};
|
|
550
|
+
Ge.displayName = Z;
|
|
551
|
+
var Be = "PopoverAnchor", cr = o.forwardRef(
|
|
552
|
+
(e, r) => {
|
|
553
|
+
const { __scopePopover: t, ...s } = e, n = _(Be, t), l = W(t), { onCustomAnchorAdd: i, onCustomAnchorRemove: d } = n;
|
|
554
|
+
return o.useEffect(() => (i(), () => d()), [i, d]), /* @__PURE__ */ p(Oe, { ...l, ...s, ref: r });
|
|
555
|
+
}
|
|
556
|
+
);
|
|
557
|
+
cr.displayName = Be;
|
|
558
|
+
var Ue = "PopoverTrigger", Xe = o.forwardRef(
|
|
559
|
+
(e, r) => {
|
|
560
|
+
const { __scopePopover: t, ...s } = e, n = _(Ue, t), l = W(t), i = Ie(r, n.triggerRef), d = /* @__PURE__ */ p(
|
|
561
|
+
S.button,
|
|
562
|
+
{
|
|
563
|
+
type: "button",
|
|
564
|
+
"aria-haspopup": "dialog",
|
|
565
|
+
"aria-expanded": n.open,
|
|
566
|
+
"aria-controls": n.contentId,
|
|
567
|
+
"data-state": et(n.open),
|
|
568
|
+
...s,
|
|
569
|
+
ref: i,
|
|
570
|
+
onClick: H(e.onClick, n.onOpenToggle)
|
|
571
|
+
}
|
|
572
|
+
);
|
|
573
|
+
return n.hasCustomAnchor ? d : /* @__PURE__ */ p(Oe, { asChild: !0, ...l, children: d });
|
|
574
|
+
}
|
|
575
|
+
);
|
|
576
|
+
Xe.displayName = Ue;
|
|
577
|
+
var me = "PopoverPortal", [dr, ur] = We(me, {
|
|
578
|
+
forceMount: void 0
|
|
579
|
+
}), Ze = (e) => {
|
|
580
|
+
const { __scopePopover: r, forceMount: t, children: s, container: n } = e, l = _(me, r);
|
|
581
|
+
return /* @__PURE__ */ p(dr, { scope: r, forceMount: t, children: /* @__PURE__ */ p(_e, { present: t || l.open, children: /* @__PURE__ */ p(dt, { asChild: !0, container: n, children: s }) }) });
|
|
582
|
+
};
|
|
583
|
+
Ze.displayName = me;
|
|
584
|
+
var j = "PopoverContent", Je = o.forwardRef(
|
|
585
|
+
(e, r) => {
|
|
586
|
+
const t = ur(j, e.__scopePopover), { forceMount: s = t.forceMount, ...n } = e, l = _(j, e.__scopePopover);
|
|
587
|
+
return /* @__PURE__ */ p(_e, { present: s || l.open, children: l.modal ? /* @__PURE__ */ p(fr, { ...n, ref: r }) : /* @__PURE__ */ p(mr, { ...n, ref: r }) });
|
|
588
|
+
}
|
|
589
|
+
);
|
|
590
|
+
Je.displayName = j;
|
|
591
|
+
var pr = /* @__PURE__ */ rr("PopoverContent.RemoveScroll"), fr = o.forwardRef(
|
|
592
|
+
(e, r) => {
|
|
593
|
+
const t = _(j, e.__scopePopover), s = o.useRef(null), n = Ie(r, s), l = o.useRef(!1);
|
|
594
|
+
return o.useEffect(() => {
|
|
595
|
+
const i = s.current;
|
|
596
|
+
if (i) return ut(i);
|
|
597
|
+
}, []), /* @__PURE__ */ p(pt, { as: pr, allowPinchZoom: !0, children: /* @__PURE__ */ p(
|
|
598
|
+
Ye,
|
|
599
|
+
{
|
|
600
|
+
...e,
|
|
601
|
+
ref: n,
|
|
602
|
+
trapFocus: t.open,
|
|
603
|
+
disableOutsidePointerEvents: !0,
|
|
604
|
+
onCloseAutoFocus: H(e.onCloseAutoFocus, (i) => {
|
|
605
|
+
i.preventDefault(), l.current || t.triggerRef.current?.focus();
|
|
606
|
+
}),
|
|
607
|
+
onPointerDownOutside: H(
|
|
608
|
+
e.onPointerDownOutside,
|
|
609
|
+
(i) => {
|
|
610
|
+
const d = i.detail.originalEvent, m = d.button === 0 && d.ctrlKey === !0, c = d.button === 2 || m;
|
|
611
|
+
l.current = c;
|
|
612
|
+
},
|
|
613
|
+
{ checkForDefaultPrevented: !1 }
|
|
614
|
+
),
|
|
615
|
+
onFocusOutside: H(
|
|
616
|
+
e.onFocusOutside,
|
|
617
|
+
(i) => i.preventDefault(),
|
|
618
|
+
{ checkForDefaultPrevented: !1 }
|
|
619
|
+
)
|
|
620
|
+
}
|
|
621
|
+
) });
|
|
622
|
+
}
|
|
623
|
+
), mr = o.forwardRef(
|
|
624
|
+
(e, r) => {
|
|
625
|
+
const t = _(j, e.__scopePopover), s = o.useRef(!1), n = o.useRef(!1);
|
|
626
|
+
return /* @__PURE__ */ p(
|
|
627
|
+
Ye,
|
|
628
|
+
{
|
|
629
|
+
...e,
|
|
630
|
+
ref: r,
|
|
631
|
+
trapFocus: !1,
|
|
632
|
+
disableOutsidePointerEvents: !1,
|
|
633
|
+
onCloseAutoFocus: (l) => {
|
|
634
|
+
e.onCloseAutoFocus?.(l), l.defaultPrevented || (s.current || t.triggerRef.current?.focus(), l.preventDefault()), s.current = !1, n.current = !1;
|
|
635
|
+
},
|
|
636
|
+
onInteractOutside: (l) => {
|
|
637
|
+
e.onInteractOutside?.(l), l.defaultPrevented || (s.current = !0, l.detail.originalEvent.type === "pointerdown" && (n.current = !0));
|
|
638
|
+
const i = l.target;
|
|
639
|
+
t.triggerRef.current?.contains(i) && l.preventDefault(), l.detail.originalEvent.type === "focusin" && n.current && l.preventDefault();
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
);
|
|
643
|
+
}
|
|
644
|
+
), Ye = o.forwardRef(
|
|
645
|
+
(e, r) => {
|
|
646
|
+
const {
|
|
647
|
+
__scopePopover: t,
|
|
648
|
+
trapFocus: s,
|
|
649
|
+
onOpenAutoFocus: n,
|
|
650
|
+
onCloseAutoFocus: l,
|
|
651
|
+
disableOutsidePointerEvents: i,
|
|
652
|
+
onEscapeKeyDown: d,
|
|
653
|
+
onPointerDownOutside: m,
|
|
654
|
+
onFocusOutside: c,
|
|
655
|
+
onInteractOutside: v,
|
|
656
|
+
...h
|
|
657
|
+
} = e, x = _(j, t), C = W(t);
|
|
658
|
+
return ft(), /* @__PURE__ */ p(
|
|
659
|
+
mt,
|
|
660
|
+
{
|
|
661
|
+
asChild: !0,
|
|
662
|
+
loop: !0,
|
|
663
|
+
trapped: s,
|
|
664
|
+
onMountAutoFocus: n,
|
|
665
|
+
onUnmountAutoFocus: l,
|
|
666
|
+
children: /* @__PURE__ */ p(
|
|
667
|
+
vt,
|
|
668
|
+
{
|
|
669
|
+
asChild: !0,
|
|
670
|
+
disableOutsidePointerEvents: i,
|
|
671
|
+
onInteractOutside: v,
|
|
672
|
+
onEscapeKeyDown: d,
|
|
673
|
+
onPointerDownOutside: m,
|
|
674
|
+
onFocusOutside: c,
|
|
675
|
+
onDismiss: () => x.onOpenChange(!1),
|
|
676
|
+
children: /* @__PURE__ */ p(
|
|
677
|
+
gt,
|
|
678
|
+
{
|
|
679
|
+
"data-state": et(x.open),
|
|
680
|
+
role: "dialog",
|
|
681
|
+
id: x.contentId,
|
|
682
|
+
...C,
|
|
683
|
+
...h,
|
|
684
|
+
ref: r,
|
|
685
|
+
style: {
|
|
686
|
+
...h.style,
|
|
687
|
+
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
688
|
+
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
689
|
+
"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
|
|
690
|
+
"--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
|
|
691
|
+
"--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
)
|
|
695
|
+
}
|
|
696
|
+
)
|
|
697
|
+
}
|
|
698
|
+
);
|
|
699
|
+
}
|
|
700
|
+
), Qe = "PopoverClose", vr = o.forwardRef(
|
|
701
|
+
(e, r) => {
|
|
702
|
+
const { __scopePopover: t, ...s } = e, n = _(Qe, t);
|
|
703
|
+
return /* @__PURE__ */ p(
|
|
704
|
+
S.button,
|
|
705
|
+
{
|
|
706
|
+
type: "button",
|
|
707
|
+
...s,
|
|
708
|
+
ref: r,
|
|
709
|
+
onClick: H(e.onClick, () => n.onOpenChange(!1))
|
|
710
|
+
}
|
|
711
|
+
);
|
|
712
|
+
}
|
|
713
|
+
);
|
|
714
|
+
vr.displayName = Qe;
|
|
715
|
+
var gr = "PopoverArrow", hr = o.forwardRef(
|
|
716
|
+
(e, r) => {
|
|
717
|
+
const { __scopePopover: t, ...s } = e, n = W(t);
|
|
718
|
+
return /* @__PURE__ */ p(ht, { ...n, ...s, ref: r });
|
|
719
|
+
}
|
|
720
|
+
);
|
|
721
|
+
hr.displayName = gr;
|
|
722
|
+
function et(e) {
|
|
723
|
+
return e ? "open" : "closed";
|
|
724
|
+
}
|
|
725
|
+
var br = Ge, yr = Xe, xr = Ze, tt = Je;
|
|
726
|
+
const Dr = br, Or = yr, wr = o.forwardRef(({ className: e, align: r = "center", sideOffset: t = 4, ...s }, n) => /* @__PURE__ */ p(xr, { children: /* @__PURE__ */ p(
|
|
727
|
+
tt,
|
|
728
|
+
{
|
|
729
|
+
ref: n,
|
|
730
|
+
align: r,
|
|
731
|
+
sideOffset: t,
|
|
732
|
+
className: k(
|
|
733
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
734
|
+
e
|
|
735
|
+
),
|
|
736
|
+
...s
|
|
737
|
+
}
|
|
738
|
+
) }));
|
|
739
|
+
wr.displayName = tt.displayName;
|
|
740
|
+
export {
|
|
741
|
+
qe as C,
|
|
742
|
+
Kt as D,
|
|
743
|
+
Sr as L,
|
|
744
|
+
Dr as P,
|
|
745
|
+
_r as a,
|
|
746
|
+
Xt as b,
|
|
747
|
+
Zt as c,
|
|
748
|
+
Jt as d,
|
|
749
|
+
Yt as e,
|
|
750
|
+
er as f,
|
|
751
|
+
tr as g,
|
|
752
|
+
Qt as h,
|
|
753
|
+
Ht as i,
|
|
754
|
+
Ke as j,
|
|
755
|
+
Ir as k,
|
|
756
|
+
Ar as l,
|
|
757
|
+
He as m,
|
|
758
|
+
Wt as n,
|
|
759
|
+
Gt as o,
|
|
760
|
+
Bt as p,
|
|
761
|
+
Ut as q,
|
|
762
|
+
Or as r,
|
|
763
|
+
wr as s
|
|
764
|
+
};
|
|
765
|
+
//# sourceMappingURL=popover-4V4sGe1U.js.map
|