@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,1745 @@
|
|
|
1
|
+
import { jsx as t, jsxs as i, Fragment as we } from "react/jsx-runtime";
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import P from "react";
|
|
4
|
+
import { p as Le, a as A, X as $, C as J, B as j, e as Oe, S as Ee } from "./scroll-area-DQeqDp3Y.js";
|
|
5
|
+
import { c as k } from "./index-CwJPJKOE.js";
|
|
6
|
+
import { L as W, C as ve, a as Te } from "./calendar-BFWc4IB7.js";
|
|
7
|
+
import { P as H, r as U, s as B, C as ee, b as te, c as ae, d as re, e as Y, f as Q, D as $e, l as He, m as Ue, n as Be, p as ze, L as Ge } from "./popover-4V4sGe1U.js";
|
|
8
|
+
import { u as Se, f as oe } from "./use-formatters-l1_2c8z0.js";
|
|
9
|
+
import { C as ke } from "./calendar-ChJkFXXr.js";
|
|
10
|
+
import { I as G, D as je, a as Ke, b as We, c as Je } from "./input-D4AoiWxo.js";
|
|
11
|
+
import { S as Fe } from "./index-l828OqQN.js";
|
|
12
|
+
import { c as se } from "./createLucideIcon-BbeNo6vq.js";
|
|
13
|
+
import { F as Ye } from "./file-wzTXnWqz.js";
|
|
14
|
+
import { C as he } from "./chevron-up-CGtXOr51.js";
|
|
15
|
+
import { C as q } from "./chevron-down-DJ1_YIFu.js";
|
|
16
|
+
import { M as Qe } from "./minus-DvlYtl96.js";
|
|
17
|
+
import { P as Xe } from "./plus-CJD68KQD.js";
|
|
18
|
+
import { A as Ze, a as qe, b as et } from "./avatar-CN6wcrqY.js";
|
|
19
|
+
import { C as tt } from "./chevron-right-B3bovvh0.js";
|
|
20
|
+
import { u as Pe, e as at, c as pe, n as rt, m as st } from "./locale-provider-DanG6RRG.js";
|
|
21
|
+
const ie = se("ChevronsUpDown", [
|
|
22
|
+
["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
|
|
23
|
+
["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
|
|
24
|
+
]);
|
|
25
|
+
const nt = se("Globe", [
|
|
26
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
27
|
+
["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
|
|
28
|
+
["path", { d: "M2 12h20", key: "9i4pu4" }]
|
|
29
|
+
]);
|
|
30
|
+
const ot = se("Pipette", [
|
|
31
|
+
["path", { d: "m2 22 1-1h3l9-9", key: "1sre89" }],
|
|
32
|
+
["path", { d: "M3 21v-3l9-9", key: "hpe2y6" }],
|
|
33
|
+
[
|
|
34
|
+
"path",
|
|
35
|
+
{
|
|
36
|
+
d: "m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z",
|
|
37
|
+
key: "196du1"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
]);
|
|
41
|
+
const lt = se("Upload", [
|
|
42
|
+
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
43
|
+
["polyline", { points: "17 8 12 3 7 8", key: "t8dd8p" }],
|
|
44
|
+
["line", { x1: "12", x2: "12", y1: "3", y2: "15", key: "widbto" }]
|
|
45
|
+
]);
|
|
46
|
+
var ct = (e) => e.type === "checkbox", K = (e) => e instanceof Date, de = (e) => e == null;
|
|
47
|
+
const De = (e) => typeof e == "object";
|
|
48
|
+
var z = (e) => !de(e) && !Array.isArray(e) && De(e) && !K(e), it = (e) => z(e) && e.target ? ct(e.target) ? e.target.checked : e.target.value : e, dt = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, ut = (e, r) => e.has(dt(r)), mt = (e) => {
|
|
49
|
+
const r = e.constructor && e.constructor.prototype;
|
|
50
|
+
return z(r) && r.hasOwnProperty("isPrototypeOf");
|
|
51
|
+
}, ft = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
52
|
+
function Ve(e) {
|
|
53
|
+
if (e instanceof Date)
|
|
54
|
+
return new Date(e);
|
|
55
|
+
const r = typeof FileList < "u" && e instanceof FileList;
|
|
56
|
+
if (ft && (e instanceof Blob || r))
|
|
57
|
+
return e;
|
|
58
|
+
const a = Array.isArray(e);
|
|
59
|
+
if (!a && !(z(e) && mt(e)))
|
|
60
|
+
return e;
|
|
61
|
+
const s = a ? [] : Object.create(Object.getPrototypeOf(e));
|
|
62
|
+
for (const n in e)
|
|
63
|
+
Object.prototype.hasOwnProperty.call(e, n) && (s[n] = Ve(e[n]));
|
|
64
|
+
return s;
|
|
65
|
+
}
|
|
66
|
+
var Me = (e) => /^\w*$/.test(e), ce = (e) => e === void 0, ht = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Re = (e) => ht(e.replace(/["|']|\]/g, "").split(/\.|\[/)), O = (e, r, a) => {
|
|
67
|
+
if (!r || !z(e))
|
|
68
|
+
return a;
|
|
69
|
+
const s = (Me(r) ? [r] : Re(r)).reduce((n, c) => de(n) ? n : n[c], e);
|
|
70
|
+
return ce(s) || s === e ? ce(e[r]) ? a : e[r] : s;
|
|
71
|
+
}, le = (e) => typeof e == "boolean", X = (e) => typeof e == "function", ge = (e, r, a) => {
|
|
72
|
+
let s = -1;
|
|
73
|
+
const n = Me(r) ? [r] : Re(r), c = n.length, u = c - 1;
|
|
74
|
+
for (; ++s < c; ) {
|
|
75
|
+
const m = n[s];
|
|
76
|
+
let b = a;
|
|
77
|
+
if (s !== u) {
|
|
78
|
+
const N = e[m];
|
|
79
|
+
b = z(N) || Array.isArray(N) ? N : isNaN(+n[s + 1]) ? {} : [];
|
|
80
|
+
}
|
|
81
|
+
if (m === "__proto__" || m === "constructor" || m === "prototype")
|
|
82
|
+
return;
|
|
83
|
+
e[m] = b, e = e[m];
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const Ne = {
|
|
87
|
+
BLUR: "blur",
|
|
88
|
+
CHANGE: "change"
|
|
89
|
+
}, ye = {
|
|
90
|
+
all: "all"
|
|
91
|
+
}, ue = P.createContext(null);
|
|
92
|
+
ue.displayName = "HookFormControlContext";
|
|
93
|
+
const me = () => P.useContext(ue);
|
|
94
|
+
var pt = (e, r, a, s = !0) => {
|
|
95
|
+
const n = {
|
|
96
|
+
defaultValues: r._defaultValues
|
|
97
|
+
};
|
|
98
|
+
for (const c in e)
|
|
99
|
+
Object.defineProperty(n, c, {
|
|
100
|
+
get: () => {
|
|
101
|
+
const u = c;
|
|
102
|
+
return r._proxyFormState[u] !== ye.all && (r._proxyFormState[u] = !s || ye.all), a && (a[u] = !0), e[u];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
return n;
|
|
106
|
+
};
|
|
107
|
+
const Ie = typeof window < "u" ? P.useLayoutEffect : P.useEffect;
|
|
108
|
+
function gt(e) {
|
|
109
|
+
const r = me(), { control: a = r, disabled: s, name: n, exact: c } = e || {}, [u, m] = P.useState(a._formState), b = P.useRef({
|
|
110
|
+
isDirty: !1,
|
|
111
|
+
isLoading: !1,
|
|
112
|
+
dirtyFields: !1,
|
|
113
|
+
touchedFields: !1,
|
|
114
|
+
validatingFields: !1,
|
|
115
|
+
isValidating: !1,
|
|
116
|
+
isValid: !1,
|
|
117
|
+
errors: !1
|
|
118
|
+
});
|
|
119
|
+
return Ie(() => a._subscribe({
|
|
120
|
+
name: n,
|
|
121
|
+
formState: b.current,
|
|
122
|
+
exact: c,
|
|
123
|
+
callback: (N) => {
|
|
124
|
+
!s && m({
|
|
125
|
+
...a._formState,
|
|
126
|
+
...N
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}), [n, s, c]), P.useEffect(() => {
|
|
130
|
+
b.current.isValid && a._setValid(!0);
|
|
131
|
+
}, [a]), P.useMemo(() => pt(u, a, b.current, !1), [u, a]);
|
|
132
|
+
}
|
|
133
|
+
var Nt = (e) => typeof e == "string", xe = (e, r, a, s, n) => Nt(e) ? O(a, e, n) : Array.isArray(e) ? e.map((c) => O(a, c)) : a, be = (e) => de(e) || !De(e);
|
|
134
|
+
function Z(e, r, a = /* @__PURE__ */ new WeakSet()) {
|
|
135
|
+
if (be(e) || be(r))
|
|
136
|
+
return Object.is(e, r);
|
|
137
|
+
if (K(e) && K(r))
|
|
138
|
+
return Object.is(e.getTime(), r.getTime());
|
|
139
|
+
const s = Object.keys(e), n = Object.keys(r);
|
|
140
|
+
if (s.length !== n.length)
|
|
141
|
+
return !1;
|
|
142
|
+
if (a.has(e) || a.has(r))
|
|
143
|
+
return !0;
|
|
144
|
+
a.add(e), a.add(r);
|
|
145
|
+
for (const c of s) {
|
|
146
|
+
const u = e[c];
|
|
147
|
+
if (!n.includes(c))
|
|
148
|
+
return !1;
|
|
149
|
+
if (c !== "ref") {
|
|
150
|
+
const m = r[c];
|
|
151
|
+
if (K(u) && K(m) || z(u) && z(m) || Array.isArray(u) && Array.isArray(m) ? !Z(u, m, a) : !Object.is(u, m))
|
|
152
|
+
return !1;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return !0;
|
|
156
|
+
}
|
|
157
|
+
function yt(e) {
|
|
158
|
+
const r = me(), { control: a = r, name: s, defaultValue: n, disabled: c, exact: u, compute: m } = e || {}, b = P.useRef(n), N = P.useRef(m), v = P.useRef(void 0), p = P.useRef(a), d = P.useRef(s);
|
|
159
|
+
N.current = m;
|
|
160
|
+
const [g, f] = P.useState(() => {
|
|
161
|
+
const o = a._getWatch(s, b.current);
|
|
162
|
+
return N.current ? N.current(o) : o;
|
|
163
|
+
}), h = P.useCallback((o) => {
|
|
164
|
+
const S = xe(s, a._names, o || a._formValues, !1, b.current);
|
|
165
|
+
return N.current ? N.current(S) : S;
|
|
166
|
+
}, [a._formValues, a._names, s]), y = P.useCallback((o) => {
|
|
167
|
+
if (!c) {
|
|
168
|
+
const S = xe(s, a._names, o || a._formValues, !1, b.current);
|
|
169
|
+
if (N.current) {
|
|
170
|
+
const R = N.current(S);
|
|
171
|
+
Z(R, v.current) || (f(R), v.current = R);
|
|
172
|
+
} else
|
|
173
|
+
f(S);
|
|
174
|
+
}
|
|
175
|
+
}, [a._formValues, a._names, c, s]);
|
|
176
|
+
Ie(() => ((p.current !== a || !Z(d.current, s)) && (p.current = a, d.current = s, y()), a._subscribe({
|
|
177
|
+
name: s,
|
|
178
|
+
formState: {
|
|
179
|
+
values: !0
|
|
180
|
+
},
|
|
181
|
+
exact: u,
|
|
182
|
+
callback: (o) => {
|
|
183
|
+
y(o.values);
|
|
184
|
+
}
|
|
185
|
+
})), [a, u, s, y]), P.useEffect(() => a._removeUnmounted());
|
|
186
|
+
const C = p.current !== a, l = d.current, F = P.useMemo(() => {
|
|
187
|
+
if (c)
|
|
188
|
+
return null;
|
|
189
|
+
const o = !C && !Z(l, s);
|
|
190
|
+
return C || o ? h() : null;
|
|
191
|
+
}, [c, C, s, l, h]);
|
|
192
|
+
return F !== null ? F : g;
|
|
193
|
+
}
|
|
194
|
+
function xt(e) {
|
|
195
|
+
const r = me(), { name: a, disabled: s, control: n = r, shouldUnregister: c, defaultValue: u, exact: m = !0 } = e, b = ut(n._names.array, a), N = P.useMemo(() => O(n._formValues, a, O(n._defaultValues, a, u)), [n, a, u]), v = yt({
|
|
196
|
+
control: n,
|
|
197
|
+
name: a,
|
|
198
|
+
defaultValue: N,
|
|
199
|
+
exact: m
|
|
200
|
+
}), p = gt({
|
|
201
|
+
control: n,
|
|
202
|
+
name: a,
|
|
203
|
+
exact: m
|
|
204
|
+
}), d = P.useRef(e), g = P.useRef(void 0), f = P.useRef(n.register(a, {
|
|
205
|
+
...e.rules,
|
|
206
|
+
value: v,
|
|
207
|
+
...le(e.disabled) ? { disabled: e.disabled } : {}
|
|
208
|
+
}));
|
|
209
|
+
d.current = e;
|
|
210
|
+
const h = P.useMemo(() => Object.defineProperties({}, {
|
|
211
|
+
invalid: {
|
|
212
|
+
enumerable: !0,
|
|
213
|
+
get: () => !!O(p.errors, a)
|
|
214
|
+
},
|
|
215
|
+
isDirty: {
|
|
216
|
+
enumerable: !0,
|
|
217
|
+
get: () => !!O(p.dirtyFields, a)
|
|
218
|
+
},
|
|
219
|
+
isTouched: {
|
|
220
|
+
enumerable: !0,
|
|
221
|
+
get: () => !!O(p.touchedFields, a)
|
|
222
|
+
},
|
|
223
|
+
isValidating: {
|
|
224
|
+
enumerable: !0,
|
|
225
|
+
get: () => !!O(p.validatingFields, a)
|
|
226
|
+
},
|
|
227
|
+
error: {
|
|
228
|
+
enumerable: !0,
|
|
229
|
+
get: () => O(p.errors, a)
|
|
230
|
+
}
|
|
231
|
+
}), [p, a]), y = P.useCallback((o) => f.current.onChange({
|
|
232
|
+
target: {
|
|
233
|
+
value: it(o),
|
|
234
|
+
name: a
|
|
235
|
+
},
|
|
236
|
+
type: Ne.CHANGE
|
|
237
|
+
}), [a]), C = P.useCallback(() => f.current.onBlur({
|
|
238
|
+
target: {
|
|
239
|
+
value: O(n._formValues, a),
|
|
240
|
+
name: a
|
|
241
|
+
},
|
|
242
|
+
type: Ne.BLUR
|
|
243
|
+
}), [a, n._formValues]), l = P.useCallback((o) => {
|
|
244
|
+
const S = O(n._fields, a);
|
|
245
|
+
S && S._f && o && (S._f.ref = {
|
|
246
|
+
focus: () => X(o.focus) && o.focus(),
|
|
247
|
+
select: () => X(o.select) && o.select(),
|
|
248
|
+
setCustomValidity: (R) => X(o.setCustomValidity) && o.setCustomValidity(R),
|
|
249
|
+
reportValidity: () => X(o.reportValidity) && o.reportValidity()
|
|
250
|
+
});
|
|
251
|
+
}, [n._fields, a]), F = P.useMemo(() => ({
|
|
252
|
+
name: a,
|
|
253
|
+
value: v,
|
|
254
|
+
...le(s) || p.disabled ? { disabled: p.disabled || s } : {},
|
|
255
|
+
onChange: y,
|
|
256
|
+
onBlur: C,
|
|
257
|
+
ref: l
|
|
258
|
+
}), [a, s, p.disabled, y, C, l, v]);
|
|
259
|
+
return P.useEffect(() => {
|
|
260
|
+
const o = n._options.shouldUnregister || c, S = g.current;
|
|
261
|
+
S && S !== a && !b && n.unregister(S), n.register(a, {
|
|
262
|
+
...d.current.rules,
|
|
263
|
+
...le(d.current.disabled) ? { disabled: d.current.disabled } : {}
|
|
264
|
+
});
|
|
265
|
+
const R = (_, L) => {
|
|
266
|
+
const V = O(n._fields, _);
|
|
267
|
+
V && V._f && (V._f.mount = L);
|
|
268
|
+
};
|
|
269
|
+
if (R(a, !0), o) {
|
|
270
|
+
const _ = Ve(O(n._options.defaultValues, a, d.current.defaultValue));
|
|
271
|
+
ge(n._defaultValues, a, _), ce(O(n._formValues, a)) && ge(n._formValues, a, _);
|
|
272
|
+
}
|
|
273
|
+
return !b && n.register(a), g.current = a, () => {
|
|
274
|
+
(b ? o && !n._state.action : o) ? n.unregister(a) : R(a, !1);
|
|
275
|
+
};
|
|
276
|
+
}, [a, n, b, c]), P.useEffect(() => {
|
|
277
|
+
n._setDisabledField({
|
|
278
|
+
disabled: s,
|
|
279
|
+
name: a
|
|
280
|
+
});
|
|
281
|
+
}, [s, a, n]), P.useMemo(() => ({
|
|
282
|
+
field: F,
|
|
283
|
+
formState: p,
|
|
284
|
+
fieldState: h
|
|
285
|
+
}), [F, p, h]);
|
|
286
|
+
}
|
|
287
|
+
const bt = (e) => e.render(xt(e)), fe = P.createContext(null);
|
|
288
|
+
fe.displayName = "HookFormContext";
|
|
289
|
+
const Ct = () => P.useContext(fe), wt = (e) => {
|
|
290
|
+
const { children: r, watch: a, getValues: s, getFieldState: n, setError: c, clearErrors: u, setValue: m, trigger: b, formState: N, resetField: v, reset: p, handleSubmit: d, unregister: g, control: f, register: h, setFocus: y, subscribe: C } = e;
|
|
291
|
+
return P.createElement(
|
|
292
|
+
fe.Provider,
|
|
293
|
+
{ value: P.useMemo(() => ({
|
|
294
|
+
watch: a,
|
|
295
|
+
getValues: s,
|
|
296
|
+
getFieldState: n,
|
|
297
|
+
setError: c,
|
|
298
|
+
clearErrors: u,
|
|
299
|
+
setValue: m,
|
|
300
|
+
trigger: b,
|
|
301
|
+
formState: N,
|
|
302
|
+
resetField: v,
|
|
303
|
+
reset: p,
|
|
304
|
+
handleSubmit: d,
|
|
305
|
+
unregister: g,
|
|
306
|
+
control: f,
|
|
307
|
+
register: h,
|
|
308
|
+
setFocus: y,
|
|
309
|
+
subscribe: C
|
|
310
|
+
}), [
|
|
311
|
+
u,
|
|
312
|
+
f,
|
|
313
|
+
N,
|
|
314
|
+
n,
|
|
315
|
+
s,
|
|
316
|
+
d,
|
|
317
|
+
h,
|
|
318
|
+
p,
|
|
319
|
+
v,
|
|
320
|
+
c,
|
|
321
|
+
y,
|
|
322
|
+
m,
|
|
323
|
+
C,
|
|
324
|
+
b,
|
|
325
|
+
g,
|
|
326
|
+
a
|
|
327
|
+
]) },
|
|
328
|
+
P.createElement(ue.Provider, { value: f }, r)
|
|
329
|
+
);
|
|
330
|
+
}, ia = wt, Ae = x.createContext({}), da = ({
|
|
331
|
+
...e
|
|
332
|
+
}) => /* @__PURE__ */ t(Ae.Provider, { value: { name: e.name }, children: /* @__PURE__ */ t(bt, { ...e }) }), ne = () => {
|
|
333
|
+
const e = x.useContext(Ae), r = x.useContext(_e), { getFieldState: a, formState: s } = Ct(), n = a(e.name, s);
|
|
334
|
+
if (!e)
|
|
335
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
336
|
+
const { id: c } = r;
|
|
337
|
+
return {
|
|
338
|
+
id: c,
|
|
339
|
+
name: e.name,
|
|
340
|
+
formItemId: `${c}-form-item`,
|
|
341
|
+
formDescriptionId: `${c}-form-item-description`,
|
|
342
|
+
formMessageId: `${c}-form-item-message`,
|
|
343
|
+
...n
|
|
344
|
+
};
|
|
345
|
+
}, _e = x.createContext({}), vt = x.forwardRef(
|
|
346
|
+
({ className: e, ...r }, a) => {
|
|
347
|
+
const s = x.useId();
|
|
348
|
+
return /* @__PURE__ */ t(_e.Provider, { value: { id: s }, children: /* @__PURE__ */ t("div", { ref: a, className: k("space-y-2", e), ...r }) });
|
|
349
|
+
}
|
|
350
|
+
);
|
|
351
|
+
vt.displayName = "FormItem";
|
|
352
|
+
const St = x.forwardRef(({ className: e, ...r }, a) => {
|
|
353
|
+
const { error: s, formItemId: n } = ne();
|
|
354
|
+
return /* @__PURE__ */ t(
|
|
355
|
+
W,
|
|
356
|
+
{
|
|
357
|
+
ref: a,
|
|
358
|
+
className: k(s && "text-destructive", e),
|
|
359
|
+
htmlFor: n,
|
|
360
|
+
...r
|
|
361
|
+
}
|
|
362
|
+
);
|
|
363
|
+
});
|
|
364
|
+
St.displayName = "FormLabel";
|
|
365
|
+
const kt = x.forwardRef(({ ...e }, r) => {
|
|
366
|
+
const { error: a, formItemId: s, formDescriptionId: n, formMessageId: c } = ne();
|
|
367
|
+
return /* @__PURE__ */ t(
|
|
368
|
+
Le,
|
|
369
|
+
{
|
|
370
|
+
ref: r,
|
|
371
|
+
id: s,
|
|
372
|
+
"aria-describedby": a ? `${n} ${c}` : `${n}`,
|
|
373
|
+
"aria-invalid": !!a,
|
|
374
|
+
...e
|
|
375
|
+
}
|
|
376
|
+
);
|
|
377
|
+
});
|
|
378
|
+
kt.displayName = "FormControl";
|
|
379
|
+
const Ft = x.forwardRef(({ className: e, ...r }, a) => {
|
|
380
|
+
const { formDescriptionId: s } = ne();
|
|
381
|
+
return /* @__PURE__ */ t(
|
|
382
|
+
"p",
|
|
383
|
+
{
|
|
384
|
+
ref: a,
|
|
385
|
+
id: s,
|
|
386
|
+
className: k("text-sm text-muted-foreground", e),
|
|
387
|
+
...r
|
|
388
|
+
}
|
|
389
|
+
);
|
|
390
|
+
});
|
|
391
|
+
Ft.displayName = "FormDescription";
|
|
392
|
+
const Pt = x.forwardRef(({ className: e, children: r, ...a }, s) => {
|
|
393
|
+
const { error: n, formMessageId: c } = ne(), u = n ? String(n?.message) : r;
|
|
394
|
+
return u ? /* @__PURE__ */ t(
|
|
395
|
+
"p",
|
|
396
|
+
{
|
|
397
|
+
ref: s,
|
|
398
|
+
id: c,
|
|
399
|
+
className: k("text-sm font-medium text-destructive", e),
|
|
400
|
+
...a,
|
|
401
|
+
children: u
|
|
402
|
+
}
|
|
403
|
+
) : null;
|
|
404
|
+
});
|
|
405
|
+
Pt.displayName = "FormMessage";
|
|
406
|
+
function ua({
|
|
407
|
+
value: e,
|
|
408
|
+
onChange: r,
|
|
409
|
+
placeholder: a,
|
|
410
|
+
disabled: s = !1,
|
|
411
|
+
className: n,
|
|
412
|
+
dateFormat: c = "PPP"
|
|
413
|
+
}) {
|
|
414
|
+
const { t: u, formatDate: m } = Se(), b = a || u("date.selectDate");
|
|
415
|
+
return /* @__PURE__ */ i(H, { children: [
|
|
416
|
+
/* @__PURE__ */ t(U, { asChild: !0, children: /* @__PURE__ */ i(
|
|
417
|
+
A,
|
|
418
|
+
{
|
|
419
|
+
variant: "outline",
|
|
420
|
+
disabled: s,
|
|
421
|
+
className: k(
|
|
422
|
+
"w-full justify-start text-left font-normal",
|
|
423
|
+
!e && "text-muted-foreground",
|
|
424
|
+
n
|
|
425
|
+
),
|
|
426
|
+
children: [
|
|
427
|
+
/* @__PURE__ */ t(ke, { className: "mr-2 h-4 w-4" }),
|
|
428
|
+
e ? m(e, c) : /* @__PURE__ */ t("span", { children: b })
|
|
429
|
+
]
|
|
430
|
+
}
|
|
431
|
+
) }),
|
|
432
|
+
/* @__PURE__ */ t(B, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ t(ve, { mode: "single", selected: e, onSelect: r, initialFocus: !0 }) })
|
|
433
|
+
] });
|
|
434
|
+
}
|
|
435
|
+
const Dt = x.forwardRef(
|
|
436
|
+
({
|
|
437
|
+
value: e,
|
|
438
|
+
onChange: r,
|
|
439
|
+
placeholder: a = "Pick a date range",
|
|
440
|
+
disabled: s = !1,
|
|
441
|
+
className: n,
|
|
442
|
+
dateFormat: c = "LLL dd, y",
|
|
443
|
+
numberOfMonths: u = 2
|
|
444
|
+
}, m) => /* @__PURE__ */ t("div", { className: k("grid gap-2", n), children: /* @__PURE__ */ i(H, { children: [
|
|
445
|
+
/* @__PURE__ */ t(U, { asChild: !0, children: /* @__PURE__ */ i(
|
|
446
|
+
A,
|
|
447
|
+
{
|
|
448
|
+
ref: m,
|
|
449
|
+
id: "date",
|
|
450
|
+
variant: "outline",
|
|
451
|
+
disabled: s,
|
|
452
|
+
className: k(
|
|
453
|
+
"w-full justify-start text-left font-normal",
|
|
454
|
+
!e && "text-muted-foreground"
|
|
455
|
+
),
|
|
456
|
+
children: [
|
|
457
|
+
/* @__PURE__ */ t(ke, { className: "mr-2 h-4 w-4" }),
|
|
458
|
+
e?.from ? e.to ? /* @__PURE__ */ i(we, { children: [
|
|
459
|
+
oe(e.from, c),
|
|
460
|
+
" - ",
|
|
461
|
+
oe(e.to, c)
|
|
462
|
+
] }) : oe(e.from, c) : /* @__PURE__ */ t("span", { children: a })
|
|
463
|
+
]
|
|
464
|
+
}
|
|
465
|
+
) }),
|
|
466
|
+
/* @__PURE__ */ t(B, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ t(
|
|
467
|
+
ve,
|
|
468
|
+
{
|
|
469
|
+
initialFocus: !0,
|
|
470
|
+
mode: "range",
|
|
471
|
+
defaultMonth: e?.from,
|
|
472
|
+
selected: e,
|
|
473
|
+
onSelect: r,
|
|
474
|
+
numberOfMonths: u
|
|
475
|
+
}
|
|
476
|
+
) })
|
|
477
|
+
] }) })
|
|
478
|
+
);
|
|
479
|
+
Dt.displayName = "DateRangePicker";
|
|
480
|
+
const Vt = x.forwardRef(
|
|
481
|
+
({
|
|
482
|
+
className: e,
|
|
483
|
+
value: r,
|
|
484
|
+
onChange: a,
|
|
485
|
+
onSearch: s,
|
|
486
|
+
onClear: n,
|
|
487
|
+
showClearButton: c = !0,
|
|
488
|
+
loading: u = !1,
|
|
489
|
+
placeholder: m = "Search...",
|
|
490
|
+
...b
|
|
491
|
+
}, N) => {
|
|
492
|
+
const v = (g) => {
|
|
493
|
+
a?.(g.target.value);
|
|
494
|
+
}, p = () => {
|
|
495
|
+
a?.(""), n?.();
|
|
496
|
+
}, d = (g) => {
|
|
497
|
+
g.key === "Enter" && s?.(r || "");
|
|
498
|
+
};
|
|
499
|
+
return /* @__PURE__ */ i("div", { className: k("relative", e), children: [
|
|
500
|
+
/* @__PURE__ */ t(Fe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
501
|
+
/* @__PURE__ */ t(
|
|
502
|
+
G,
|
|
503
|
+
{
|
|
504
|
+
ref: N,
|
|
505
|
+
type: "text",
|
|
506
|
+
value: r,
|
|
507
|
+
onChange: v,
|
|
508
|
+
onKeyDown: d,
|
|
509
|
+
placeholder: m,
|
|
510
|
+
className: k("pl-9", c && r && "pr-9"),
|
|
511
|
+
...b
|
|
512
|
+
}
|
|
513
|
+
),
|
|
514
|
+
c && r && !u && /* @__PURE__ */ i(
|
|
515
|
+
A,
|
|
516
|
+
{
|
|
517
|
+
type: "button",
|
|
518
|
+
variant: "ghost",
|
|
519
|
+
size: "icon",
|
|
520
|
+
className: "absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2",
|
|
521
|
+
onClick: p,
|
|
522
|
+
children: [
|
|
523
|
+
/* @__PURE__ */ t($, { className: "h-4 w-4" }),
|
|
524
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: "Clear" })
|
|
525
|
+
]
|
|
526
|
+
}
|
|
527
|
+
),
|
|
528
|
+
u && /* @__PURE__ */ t("div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ t("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent" }) })
|
|
529
|
+
] });
|
|
530
|
+
}
|
|
531
|
+
);
|
|
532
|
+
Vt.displayName = "SearchInput";
|
|
533
|
+
const Mt = x.forwardRef(
|
|
534
|
+
({
|
|
535
|
+
value: e = [],
|
|
536
|
+
onChange: r,
|
|
537
|
+
accept: a,
|
|
538
|
+
multiple: s = !1,
|
|
539
|
+
maxFiles: n = 10,
|
|
540
|
+
maxSize: c = 10 * 1024 * 1024,
|
|
541
|
+
disabled: u = !1,
|
|
542
|
+
className: m
|
|
543
|
+
}, b) => {
|
|
544
|
+
const N = x.useRef(null), [v, p] = x.useState(!1), d = (l) => {
|
|
545
|
+
if (!l) return;
|
|
546
|
+
const o = Array.from(l).filter((R) => !(R.size > c)), S = s ? [...e, ...o].slice(0, n) : o.slice(0, 1);
|
|
547
|
+
r?.(S);
|
|
548
|
+
}, g = (l) => {
|
|
549
|
+
l.preventDefault(), l.stopPropagation(), l.type === "dragenter" || l.type === "dragover" ? p(!0) : l.type === "dragleave" && p(!1);
|
|
550
|
+
}, f = (l) => {
|
|
551
|
+
l.preventDefault(), l.stopPropagation(), p(!1), u || d(l.dataTransfer.files);
|
|
552
|
+
}, h = (l) => {
|
|
553
|
+
d(l.target.files);
|
|
554
|
+
}, y = (l) => {
|
|
555
|
+
const F = e.filter((o, S) => S !== l);
|
|
556
|
+
r?.(F);
|
|
557
|
+
}, C = (l) => {
|
|
558
|
+
if (l === 0) return "0 Bytes";
|
|
559
|
+
const F = 1024, o = ["Bytes", "KB", "MB", "GB"], S = Math.floor(Math.log(l) / Math.log(F));
|
|
560
|
+
return parseFloat((l / Math.pow(F, S)).toFixed(2)) + " " + o[S];
|
|
561
|
+
};
|
|
562
|
+
return /* @__PURE__ */ i("div", { ref: b, className: k("space-y-4", m), children: [
|
|
563
|
+
/* @__PURE__ */ i(
|
|
564
|
+
"div",
|
|
565
|
+
{
|
|
566
|
+
className: k(
|
|
567
|
+
"relative flex flex-col items-center justify-center rounded-lg border-2 border-dashed p-6 transition-colors",
|
|
568
|
+
v ? "border-primary bg-primary/5" : "border-muted-foreground/25",
|
|
569
|
+
u && "cursor-not-allowed opacity-50"
|
|
570
|
+
),
|
|
571
|
+
onDragEnter: g,
|
|
572
|
+
onDragLeave: g,
|
|
573
|
+
onDragOver: g,
|
|
574
|
+
onDrop: f,
|
|
575
|
+
children: [
|
|
576
|
+
/* @__PURE__ */ t(
|
|
577
|
+
"input",
|
|
578
|
+
{
|
|
579
|
+
ref: N,
|
|
580
|
+
type: "file",
|
|
581
|
+
accept: a,
|
|
582
|
+
multiple: s,
|
|
583
|
+
disabled: u,
|
|
584
|
+
onChange: h,
|
|
585
|
+
className: "absolute inset-0 cursor-pointer opacity-0"
|
|
586
|
+
}
|
|
587
|
+
),
|
|
588
|
+
/* @__PURE__ */ t(lt, { className: "mb-2 h-10 w-10 text-muted-foreground" }),
|
|
589
|
+
/* @__PURE__ */ t("p", { className: "mb-1 text-sm font-medium", children: "Drag & drop files here, or click to select" }),
|
|
590
|
+
/* @__PURE__ */ i("p", { className: "text-xs text-muted-foreground", children: [
|
|
591
|
+
s ? `Up to ${n} files` : "Single file",
|
|
592
|
+
" (max",
|
|
593
|
+
" ",
|
|
594
|
+
C(c),
|
|
595
|
+
" each)"
|
|
596
|
+
] })
|
|
597
|
+
]
|
|
598
|
+
}
|
|
599
|
+
),
|
|
600
|
+
e.length > 0 && /* @__PURE__ */ t("div", { className: "space-y-2", children: e.map((l, F) => /* @__PURE__ */ i(
|
|
601
|
+
"div",
|
|
602
|
+
{
|
|
603
|
+
className: "flex items-center justify-between rounded-lg border p-3",
|
|
604
|
+
children: [
|
|
605
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
|
|
606
|
+
/* @__PURE__ */ t(Ye, { className: "h-8 w-8 text-muted-foreground" }),
|
|
607
|
+
/* @__PURE__ */ i("div", { children: [
|
|
608
|
+
/* @__PURE__ */ t("p", { className: "text-sm font-medium", children: l.name }),
|
|
609
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: C(l.size) })
|
|
610
|
+
] })
|
|
611
|
+
] }),
|
|
612
|
+
/* @__PURE__ */ t(
|
|
613
|
+
A,
|
|
614
|
+
{
|
|
615
|
+
type: "button",
|
|
616
|
+
variant: "ghost",
|
|
617
|
+
size: "icon",
|
|
618
|
+
onClick: () => y(F),
|
|
619
|
+
disabled: u,
|
|
620
|
+
children: /* @__PURE__ */ t($, { className: "h-4 w-4" })
|
|
621
|
+
}
|
|
622
|
+
)
|
|
623
|
+
]
|
|
624
|
+
},
|
|
625
|
+
`${l.name}-${F}`
|
|
626
|
+
)) })
|
|
627
|
+
] });
|
|
628
|
+
}
|
|
629
|
+
);
|
|
630
|
+
Mt.displayName = "FileUpload";
|
|
631
|
+
const Rt = x.forwardRef(
|
|
632
|
+
({
|
|
633
|
+
options: e,
|
|
634
|
+
value: r,
|
|
635
|
+
onChange: a,
|
|
636
|
+
placeholder: s = "Select option...",
|
|
637
|
+
searchPlaceholder: n = "Search...",
|
|
638
|
+
emptyMessage: c = "No results found.",
|
|
639
|
+
disabled: u = !1,
|
|
640
|
+
className: m
|
|
641
|
+
}, b) => {
|
|
642
|
+
const [N, v] = x.useState(!1), p = e.find((d) => d.value === r);
|
|
643
|
+
return /* @__PURE__ */ i(H, { open: N, onOpenChange: v, children: [
|
|
644
|
+
/* @__PURE__ */ t(U, { asChild: !0, children: /* @__PURE__ */ i(
|
|
645
|
+
A,
|
|
646
|
+
{
|
|
647
|
+
ref: b,
|
|
648
|
+
variant: "outline",
|
|
649
|
+
role: "combobox",
|
|
650
|
+
"aria-expanded": N,
|
|
651
|
+
disabled: u,
|
|
652
|
+
className: k("w-full justify-between", !r && "text-muted-foreground", m),
|
|
653
|
+
children: [
|
|
654
|
+
p ? p.label : s,
|
|
655
|
+
/* @__PURE__ */ t(ie, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
656
|
+
]
|
|
657
|
+
}
|
|
658
|
+
) }),
|
|
659
|
+
/* @__PURE__ */ t(B, { className: "w-full p-0", align: "start", children: /* @__PURE__ */ i(ee, { children: [
|
|
660
|
+
/* @__PURE__ */ t(te, { placeholder: n }),
|
|
661
|
+
/* @__PURE__ */ i(ae, { children: [
|
|
662
|
+
/* @__PURE__ */ t(re, { children: c }),
|
|
663
|
+
/* @__PURE__ */ t(Y, { children: e.map((d) => /* @__PURE__ */ i(
|
|
664
|
+
Q,
|
|
665
|
+
{
|
|
666
|
+
value: d.value,
|
|
667
|
+
disabled: d.disabled,
|
|
668
|
+
onSelect: (g) => {
|
|
669
|
+
a?.(g === r ? "" : g), v(!1);
|
|
670
|
+
},
|
|
671
|
+
children: [
|
|
672
|
+
/* @__PURE__ */ t(
|
|
673
|
+
J,
|
|
674
|
+
{
|
|
675
|
+
className: k(
|
|
676
|
+
"mr-2 h-4 w-4",
|
|
677
|
+
r === d.value ? "opacity-100" : "opacity-0"
|
|
678
|
+
)
|
|
679
|
+
}
|
|
680
|
+
),
|
|
681
|
+
d.label
|
|
682
|
+
]
|
|
683
|
+
},
|
|
684
|
+
d.value
|
|
685
|
+
)) })
|
|
686
|
+
] })
|
|
687
|
+
] }) })
|
|
688
|
+
] });
|
|
689
|
+
}
|
|
690
|
+
);
|
|
691
|
+
Rt.displayName = "Combobox";
|
|
692
|
+
const It = x.forwardRef(
|
|
693
|
+
({
|
|
694
|
+
value: e = [],
|
|
695
|
+
onChange: r,
|
|
696
|
+
placeholder: a = "Add tag...",
|
|
697
|
+
maxTags: s = 10,
|
|
698
|
+
allowDuplicates: n = !1,
|
|
699
|
+
disabled: c = !1,
|
|
700
|
+
className: u
|
|
701
|
+
}, m) => {
|
|
702
|
+
const [b, N] = x.useState(""), v = x.useRef(null), p = (f) => {
|
|
703
|
+
const h = f.trim();
|
|
704
|
+
h && (e.length >= s || !n && e.includes(h) || (r?.([...e, h]), N("")));
|
|
705
|
+
}, d = (f) => {
|
|
706
|
+
const h = e.filter((y, C) => C !== f);
|
|
707
|
+
r?.(h);
|
|
708
|
+
}, g = (f) => {
|
|
709
|
+
f.key === "Enter" ? (f.preventDefault(), p(b)) : f.key === "Backspace" && !b && e.length > 0 ? d(e.length - 1) : f.key === "," && (f.preventDefault(), p(b));
|
|
710
|
+
};
|
|
711
|
+
return /* @__PURE__ */ i(
|
|
712
|
+
"div",
|
|
713
|
+
{
|
|
714
|
+
ref: m,
|
|
715
|
+
className: k(
|
|
716
|
+
"flex min-h-10 w-full flex-wrap items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
|
|
717
|
+
c && "cursor-not-allowed opacity-50",
|
|
718
|
+
u
|
|
719
|
+
),
|
|
720
|
+
onClick: () => v.current?.focus(),
|
|
721
|
+
children: [
|
|
722
|
+
e.map((f, h) => /* @__PURE__ */ i(j, { variant: "secondary", className: "gap-1", children: [
|
|
723
|
+
f,
|
|
724
|
+
!c && /* @__PURE__ */ t(
|
|
725
|
+
"button",
|
|
726
|
+
{
|
|
727
|
+
type: "button",
|
|
728
|
+
onClick: (y) => {
|
|
729
|
+
y.stopPropagation(), d(h);
|
|
730
|
+
},
|
|
731
|
+
className: "ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
732
|
+
children: /* @__PURE__ */ t($, { className: "h-3 w-3" })
|
|
733
|
+
}
|
|
734
|
+
)
|
|
735
|
+
] }, `${f}-${h}`)),
|
|
736
|
+
/* @__PURE__ */ t(
|
|
737
|
+
G,
|
|
738
|
+
{
|
|
739
|
+
ref: v,
|
|
740
|
+
type: "text",
|
|
741
|
+
value: b,
|
|
742
|
+
onChange: (f) => N(f.target.value),
|
|
743
|
+
onKeyDown: g,
|
|
744
|
+
placeholder: e.length === 0 ? a : "",
|
|
745
|
+
disabled: c || e.length >= s,
|
|
746
|
+
className: "flex-1 border-0 bg-transparent p-0 placeholder:text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0"
|
|
747
|
+
}
|
|
748
|
+
)
|
|
749
|
+
]
|
|
750
|
+
}
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
);
|
|
754
|
+
It.displayName = "TagInput";
|
|
755
|
+
const At = x.forwardRef(
|
|
756
|
+
({
|
|
757
|
+
value: e,
|
|
758
|
+
onChange: r,
|
|
759
|
+
format: a = "24h",
|
|
760
|
+
minuteStep: s = 1,
|
|
761
|
+
placeholder: n,
|
|
762
|
+
disabled: c = !1,
|
|
763
|
+
className: u,
|
|
764
|
+
error: m
|
|
765
|
+
}, b) => {
|
|
766
|
+
const { t: N } = Se(), [v, p] = x.useState(!1), [d, g] = x.useState(0), [f, h] = x.useState(0), [y, C] = x.useState("AM");
|
|
767
|
+
x.useEffect(() => {
|
|
768
|
+
if (e) {
|
|
769
|
+
const [M, w] = e.split(":").map(Number);
|
|
770
|
+
a === "12h" ? (g(M > 12 ? M - 12 : M === 0 ? 12 : M), C(M >= 12 ? "PM" : "AM")) : g(M), h(w);
|
|
771
|
+
}
|
|
772
|
+
}, [e, a]);
|
|
773
|
+
const l = (M, w, D) => {
|
|
774
|
+
let I = M;
|
|
775
|
+
if (a === "12h") {
|
|
776
|
+
const T = D ?? y;
|
|
777
|
+
T === "PM" && I !== 12 && (I += 12), T === "AM" && I === 12 && (I = 0);
|
|
778
|
+
}
|
|
779
|
+
const E = `${I.toString().padStart(2, "0")}:${w.toString().padStart(2, "0")}`;
|
|
780
|
+
r?.(E);
|
|
781
|
+
}, F = () => {
|
|
782
|
+
const M = a === "12h" ? 12 : 23, w = a === "12h" ? 1 : 0, D = d >= M ? w : d + 1;
|
|
783
|
+
g(D), l(D, f);
|
|
784
|
+
}, o = () => {
|
|
785
|
+
const M = a === "12h" ? 12 : 23, D = d <= (a === "12h" ? 1 : 0) ? M : d - 1;
|
|
786
|
+
g(D), l(D, f);
|
|
787
|
+
}, S = () => {
|
|
788
|
+
const M = f >= 60 - s, w = M ? 0 : f + s;
|
|
789
|
+
let D = d, I = y;
|
|
790
|
+
if (M) {
|
|
791
|
+
const E = a === "12h" ? 12 : 23, T = a === "12h" ? 1 : 0;
|
|
792
|
+
D = d >= E ? T : d + 1, a === "12h" && d === 11 && (I = y === "AM" ? "PM" : "AM", C(I)), g(D);
|
|
793
|
+
}
|
|
794
|
+
h(w), l(D, w, a === "12h" ? I : void 0);
|
|
795
|
+
}, R = () => {
|
|
796
|
+
const M = f < s, w = M ? 60 - s : f - s;
|
|
797
|
+
let D = d, I = y;
|
|
798
|
+
if (M) {
|
|
799
|
+
const E = a === "12h" ? 12 : 23;
|
|
800
|
+
D = d <= (a === "12h" ? 1 : 0) ? E : d - 1, a === "12h" && d === 12 && (I = y === "AM" ? "PM" : "AM", C(I)), g(D);
|
|
801
|
+
}
|
|
802
|
+
h(w), l(D, w, a === "12h" ? I : void 0);
|
|
803
|
+
}, _ = () => {
|
|
804
|
+
const M = y === "AM" ? "PM" : "AM";
|
|
805
|
+
C(M), l(d, f, M);
|
|
806
|
+
}, L = x.useMemo(() => e ? a === "12h" ? `${d.toString().padStart(2, "0")}:${f.toString().padStart(2, "0")} ${y}` : `${d.toString().padStart(2, "0")}:${f.toString().padStart(2, "0")}` : "", [e, a, d, f, y]), V = n || N("time.selectTime");
|
|
807
|
+
return /* @__PURE__ */ i(H, { open: v, onOpenChange: p, children: [
|
|
808
|
+
/* @__PURE__ */ t(U, { asChild: !0, children: /* @__PURE__ */ i("div", { className: k("relative", u), children: [
|
|
809
|
+
/* @__PURE__ */ t(
|
|
810
|
+
G,
|
|
811
|
+
{
|
|
812
|
+
ref: b,
|
|
813
|
+
readOnly: !0,
|
|
814
|
+
value: L,
|
|
815
|
+
placeholder: V,
|
|
816
|
+
disabled: c,
|
|
817
|
+
className: k("pr-10 cursor-pointer", m && "border-destructive"),
|
|
818
|
+
onClick: () => !c && p(!0)
|
|
819
|
+
}
|
|
820
|
+
),
|
|
821
|
+
/* @__PURE__ */ t(Te, { className: "absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" })
|
|
822
|
+
] }) }),
|
|
823
|
+
/* @__PURE__ */ t(B, { className: "w-auto p-4", align: "start", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-4", children: [
|
|
824
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col items-center gap-1", children: [
|
|
825
|
+
/* @__PURE__ */ t(W, { className: "text-xs text-muted-foreground", children: N("time.hours") }),
|
|
826
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col items-center", children: [
|
|
827
|
+
/* @__PURE__ */ t(
|
|
828
|
+
A,
|
|
829
|
+
{
|
|
830
|
+
variant: "ghost",
|
|
831
|
+
size: "icon",
|
|
832
|
+
className: "h-8 w-8",
|
|
833
|
+
onClick: F,
|
|
834
|
+
children: /* @__PURE__ */ t(he, { className: "h-4 w-4" })
|
|
835
|
+
}
|
|
836
|
+
),
|
|
837
|
+
/* @__PURE__ */ t("span", { className: "text-2xl font-bold tabular-nums", children: d.toString().padStart(2, "0") }),
|
|
838
|
+
/* @__PURE__ */ t(
|
|
839
|
+
A,
|
|
840
|
+
{
|
|
841
|
+
variant: "ghost",
|
|
842
|
+
size: "icon",
|
|
843
|
+
className: "h-8 w-8",
|
|
844
|
+
onClick: o,
|
|
845
|
+
children: /* @__PURE__ */ t(q, { className: "h-4 w-4" })
|
|
846
|
+
}
|
|
847
|
+
)
|
|
848
|
+
] })
|
|
849
|
+
] }),
|
|
850
|
+
/* @__PURE__ */ t("span", { className: "text-2xl font-bold", children: ":" }),
|
|
851
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col items-center gap-1", children: [
|
|
852
|
+
/* @__PURE__ */ t(W, { className: "text-xs text-muted-foreground", children: N("time.minutes") }),
|
|
853
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col items-center", children: [
|
|
854
|
+
/* @__PURE__ */ t(
|
|
855
|
+
A,
|
|
856
|
+
{
|
|
857
|
+
variant: "ghost",
|
|
858
|
+
size: "icon",
|
|
859
|
+
className: "h-8 w-8",
|
|
860
|
+
onClick: S,
|
|
861
|
+
children: /* @__PURE__ */ t(he, { className: "h-4 w-4" })
|
|
862
|
+
}
|
|
863
|
+
),
|
|
864
|
+
/* @__PURE__ */ t("span", { className: "text-2xl font-bold tabular-nums", children: f.toString().padStart(2, "0") }),
|
|
865
|
+
/* @__PURE__ */ t(
|
|
866
|
+
A,
|
|
867
|
+
{
|
|
868
|
+
variant: "ghost",
|
|
869
|
+
size: "icon",
|
|
870
|
+
className: "h-8 w-8",
|
|
871
|
+
onClick: R,
|
|
872
|
+
children: /* @__PURE__ */ t(q, { className: "h-4 w-4" })
|
|
873
|
+
}
|
|
874
|
+
)
|
|
875
|
+
] })
|
|
876
|
+
] }),
|
|
877
|
+
a === "12h" && /* @__PURE__ */ i("div", { className: "flex flex-col items-center gap-1", children: [
|
|
878
|
+
/* @__PURE__ */ t(W, { className: "text-xs text-muted-foreground", children: N("time.period") }),
|
|
879
|
+
/* @__PURE__ */ t(
|
|
880
|
+
A,
|
|
881
|
+
{
|
|
882
|
+
variant: "outline",
|
|
883
|
+
className: "h-auto px-3 py-2 text-lg font-bold",
|
|
884
|
+
onClick: _,
|
|
885
|
+
children: y
|
|
886
|
+
}
|
|
887
|
+
)
|
|
888
|
+
] })
|
|
889
|
+
] }) })
|
|
890
|
+
] });
|
|
891
|
+
}
|
|
892
|
+
);
|
|
893
|
+
At.displayName = "TimePicker";
|
|
894
|
+
const _t = [
|
|
895
|
+
"#000000",
|
|
896
|
+
"#ffffff",
|
|
897
|
+
"#ef4444",
|
|
898
|
+
"#f97316",
|
|
899
|
+
"#f59e0b",
|
|
900
|
+
"#eab308",
|
|
901
|
+
"#84cc16",
|
|
902
|
+
"#22c55e",
|
|
903
|
+
"#10b981",
|
|
904
|
+
"#14b8a6",
|
|
905
|
+
"#06b6d4",
|
|
906
|
+
"#0ea5e9",
|
|
907
|
+
"#3b82f6",
|
|
908
|
+
"#6366f1",
|
|
909
|
+
"#8b5cf6",
|
|
910
|
+
"#a855f7",
|
|
911
|
+
"#d946ef",
|
|
912
|
+
"#ec4899",
|
|
913
|
+
"#f43f5e",
|
|
914
|
+
"#78716c",
|
|
915
|
+
"#737373",
|
|
916
|
+
"#71717a",
|
|
917
|
+
"#6b7280",
|
|
918
|
+
"#64748b"
|
|
919
|
+
], Lt = x.forwardRef(
|
|
920
|
+
({
|
|
921
|
+
value: e = "#000000",
|
|
922
|
+
onChange: r,
|
|
923
|
+
presetColors: a = _t,
|
|
924
|
+
showInput: s = !0,
|
|
925
|
+
showEyeDropper: n = !0,
|
|
926
|
+
placeholder: c = "Select color",
|
|
927
|
+
disabled: u = !1,
|
|
928
|
+
className: m
|
|
929
|
+
}, b) => {
|
|
930
|
+
const [N, v] = x.useState(!1), [p, d] = x.useState(e), g = typeof window < "u" && "EyeDropper" in window;
|
|
931
|
+
x.useEffect(() => {
|
|
932
|
+
d(e);
|
|
933
|
+
}, [e]);
|
|
934
|
+
const f = (C) => {
|
|
935
|
+
d(C), r?.(C);
|
|
936
|
+
}, h = (C) => {
|
|
937
|
+
const l = C.target.value;
|
|
938
|
+
d(l), /^#[0-9A-Fa-f]{6}$/.test(l) && r?.(l);
|
|
939
|
+
}, y = async () => {
|
|
940
|
+
if (g)
|
|
941
|
+
try {
|
|
942
|
+
const l = await new window.EyeDropper().open();
|
|
943
|
+
f(l.sRGBHex);
|
|
944
|
+
} catch {
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
return /* @__PURE__ */ i(H, { open: N, onOpenChange: v, children: [
|
|
948
|
+
/* @__PURE__ */ t(U, { asChild: !0, children: /* @__PURE__ */ i(
|
|
949
|
+
A,
|
|
950
|
+
{
|
|
951
|
+
ref: b,
|
|
952
|
+
variant: "outline",
|
|
953
|
+
disabled: u,
|
|
954
|
+
className: k("w-full justify-start gap-2", m),
|
|
955
|
+
children: [
|
|
956
|
+
/* @__PURE__ */ t(
|
|
957
|
+
"div",
|
|
958
|
+
{
|
|
959
|
+
className: "h-5 w-5 rounded border",
|
|
960
|
+
style: { backgroundColor: p }
|
|
961
|
+
}
|
|
962
|
+
),
|
|
963
|
+
/* @__PURE__ */ t("span", { className: "flex-1 text-left font-mono text-sm", children: p || c })
|
|
964
|
+
]
|
|
965
|
+
}
|
|
966
|
+
) }),
|
|
967
|
+
/* @__PURE__ */ t(B, { className: "w-64 p-3", align: "start", children: /* @__PURE__ */ i("div", { className: "space-y-3", children: [
|
|
968
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
969
|
+
/* @__PURE__ */ t(
|
|
970
|
+
"div",
|
|
971
|
+
{
|
|
972
|
+
className: "h-10 w-10 rounded-lg border",
|
|
973
|
+
style: { backgroundColor: p }
|
|
974
|
+
}
|
|
975
|
+
),
|
|
976
|
+
/* @__PURE__ */ i("div", { className: "flex-1", children: [
|
|
977
|
+
/* @__PURE__ */ t(W, { className: "text-xs text-muted-foreground", children: "Current Color" }),
|
|
978
|
+
/* @__PURE__ */ t("p", { className: "font-mono text-sm font-medium", children: p })
|
|
979
|
+
] }),
|
|
980
|
+
n && g && /* @__PURE__ */ t(
|
|
981
|
+
A,
|
|
982
|
+
{
|
|
983
|
+
variant: "outline",
|
|
984
|
+
size: "icon",
|
|
985
|
+
onClick: y,
|
|
986
|
+
title: "Pick color from screen",
|
|
987
|
+
children: /* @__PURE__ */ t(ot, { className: "h-4 w-4" })
|
|
988
|
+
}
|
|
989
|
+
)
|
|
990
|
+
] }),
|
|
991
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-6 gap-1", children: a.map((C) => /* @__PURE__ */ t(
|
|
992
|
+
"button",
|
|
993
|
+
{
|
|
994
|
+
className: k(
|
|
995
|
+
"h-7 w-7 rounded-md border-2 transition-transform hover:scale-110",
|
|
996
|
+
p.toLowerCase() === C.toLowerCase() ? "border-primary" : "border-transparent"
|
|
997
|
+
),
|
|
998
|
+
style: { backgroundColor: C },
|
|
999
|
+
onClick: () => f(C),
|
|
1000
|
+
title: C
|
|
1001
|
+
},
|
|
1002
|
+
C
|
|
1003
|
+
)) }),
|
|
1004
|
+
s && /* @__PURE__ */ i("div", { className: "flex gap-2", children: [
|
|
1005
|
+
/* @__PURE__ */ t(
|
|
1006
|
+
G,
|
|
1007
|
+
{
|
|
1008
|
+
type: "text",
|
|
1009
|
+
value: p,
|
|
1010
|
+
onChange: h,
|
|
1011
|
+
placeholder: "#000000",
|
|
1012
|
+
className: "font-mono",
|
|
1013
|
+
maxLength: 7
|
|
1014
|
+
}
|
|
1015
|
+
),
|
|
1016
|
+
/* @__PURE__ */ t(
|
|
1017
|
+
"input",
|
|
1018
|
+
{
|
|
1019
|
+
type: "color",
|
|
1020
|
+
value: p,
|
|
1021
|
+
onChange: (C) => f(C.target.value),
|
|
1022
|
+
className: "h-10 w-10 cursor-pointer rounded border bg-transparent p-1"
|
|
1023
|
+
}
|
|
1024
|
+
)
|
|
1025
|
+
] })
|
|
1026
|
+
] }) })
|
|
1027
|
+
] });
|
|
1028
|
+
}
|
|
1029
|
+
);
|
|
1030
|
+
Lt.displayName = "ColorPicker";
|
|
1031
|
+
const Ot = x.forwardRef(
|
|
1032
|
+
({
|
|
1033
|
+
options: e,
|
|
1034
|
+
value: r = [],
|
|
1035
|
+
onChange: a,
|
|
1036
|
+
placeholder: s = "Select items...",
|
|
1037
|
+
searchPlaceholder: n = "Search...",
|
|
1038
|
+
emptyMessage: c = "No items found.",
|
|
1039
|
+
maxDisplayedItems: u = 3,
|
|
1040
|
+
maxSelections: m,
|
|
1041
|
+
disabled: b = !1,
|
|
1042
|
+
className: N
|
|
1043
|
+
}, v) => {
|
|
1044
|
+
const [p, d] = x.useState(!1), g = e.filter((l) => r.includes(l.value)), f = m !== void 0 && r.length >= m, h = (l) => {
|
|
1045
|
+
r.includes(l) ? a?.(r.filter((F) => F !== l)) : f || a?.([...r, l]);
|
|
1046
|
+
}, y = (l, F) => {
|
|
1047
|
+
F.stopPropagation(), a?.(r.filter((o) => o !== l));
|
|
1048
|
+
}, C = (l) => {
|
|
1049
|
+
l.stopPropagation(), a?.([]);
|
|
1050
|
+
};
|
|
1051
|
+
return /* @__PURE__ */ i(H, { open: p, onOpenChange: d, children: [
|
|
1052
|
+
/* @__PURE__ */ t(U, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1053
|
+
A,
|
|
1054
|
+
{
|
|
1055
|
+
ref: v,
|
|
1056
|
+
variant: "outline",
|
|
1057
|
+
role: "combobox",
|
|
1058
|
+
"aria-expanded": p,
|
|
1059
|
+
disabled: b,
|
|
1060
|
+
className: k(
|
|
1061
|
+
"w-full justify-between font-normal",
|
|
1062
|
+
g.length === 0 && "text-muted-foreground",
|
|
1063
|
+
N
|
|
1064
|
+
),
|
|
1065
|
+
children: [
|
|
1066
|
+
/* @__PURE__ */ t("div", { className: "flex flex-1 flex-wrap items-center gap-1", children: g.length === 0 ? s : g.length <= u ? g.map((l) => /* @__PURE__ */ i(
|
|
1067
|
+
j,
|
|
1068
|
+
{
|
|
1069
|
+
variant: "secondary",
|
|
1070
|
+
className: "gap-1 pr-1",
|
|
1071
|
+
children: [
|
|
1072
|
+
l.label,
|
|
1073
|
+
/* @__PURE__ */ t(
|
|
1074
|
+
"button",
|
|
1075
|
+
{
|
|
1076
|
+
className: "rounded-full hover:bg-muted-foreground/20",
|
|
1077
|
+
onClick: (F) => y(l.value, F),
|
|
1078
|
+
children: /* @__PURE__ */ t($, { className: "h-3 w-3" })
|
|
1079
|
+
}
|
|
1080
|
+
)
|
|
1081
|
+
]
|
|
1082
|
+
},
|
|
1083
|
+
l.value
|
|
1084
|
+
)) : /* @__PURE__ */ i(we, { children: [
|
|
1085
|
+
g.slice(0, u).map((l) => /* @__PURE__ */ i(
|
|
1086
|
+
j,
|
|
1087
|
+
{
|
|
1088
|
+
variant: "secondary",
|
|
1089
|
+
className: "gap-1 pr-1",
|
|
1090
|
+
children: [
|
|
1091
|
+
l.label,
|
|
1092
|
+
/* @__PURE__ */ t(
|
|
1093
|
+
"button",
|
|
1094
|
+
{
|
|
1095
|
+
className: "rounded-full hover:bg-muted-foreground/20",
|
|
1096
|
+
onClick: (F) => y(l.value, F),
|
|
1097
|
+
children: /* @__PURE__ */ t($, { className: "h-3 w-3" })
|
|
1098
|
+
}
|
|
1099
|
+
)
|
|
1100
|
+
]
|
|
1101
|
+
},
|
|
1102
|
+
l.value
|
|
1103
|
+
)),
|
|
1104
|
+
/* @__PURE__ */ i(j, { variant: "secondary", children: [
|
|
1105
|
+
"+",
|
|
1106
|
+
g.length - u
|
|
1107
|
+
] })
|
|
1108
|
+
] }) }),
|
|
1109
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
1110
|
+
g.length > 0 && /* @__PURE__ */ t(
|
|
1111
|
+
"button",
|
|
1112
|
+
{
|
|
1113
|
+
className: "rounded p-0.5 hover:bg-muted",
|
|
1114
|
+
onClick: C,
|
|
1115
|
+
children: /* @__PURE__ */ t($, { className: "h-4 w-4 text-muted-foreground" })
|
|
1116
|
+
}
|
|
1117
|
+
),
|
|
1118
|
+
/* @__PURE__ */ t(q, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
1119
|
+
] })
|
|
1120
|
+
]
|
|
1121
|
+
}
|
|
1122
|
+
) }),
|
|
1123
|
+
/* @__PURE__ */ t(B, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ i(ee, { children: [
|
|
1124
|
+
/* @__PURE__ */ t(te, { placeholder: n }),
|
|
1125
|
+
/* @__PURE__ */ i(ae, { children: [
|
|
1126
|
+
/* @__PURE__ */ t(re, { children: c }),
|
|
1127
|
+
/* @__PURE__ */ t(Y, { children: e.map((l) => {
|
|
1128
|
+
const F = r.includes(l.value), o = l.disabled || f && !F;
|
|
1129
|
+
return /* @__PURE__ */ i(
|
|
1130
|
+
Q,
|
|
1131
|
+
{
|
|
1132
|
+
value: l.value,
|
|
1133
|
+
disabled: o,
|
|
1134
|
+
onSelect: () => h(l.value),
|
|
1135
|
+
className: "flex items-center gap-2",
|
|
1136
|
+
children: [
|
|
1137
|
+
/* @__PURE__ */ t(
|
|
1138
|
+
"div",
|
|
1139
|
+
{
|
|
1140
|
+
className: k(
|
|
1141
|
+
"flex h-4 w-4 items-center justify-center rounded border",
|
|
1142
|
+
r.includes(l.value) ? "border-primary bg-primary text-primary-foreground" : "border-muted-foreground/30"
|
|
1143
|
+
),
|
|
1144
|
+
children: r.includes(l.value) && /* @__PURE__ */ t(J, { className: "h-3 w-3" })
|
|
1145
|
+
}
|
|
1146
|
+
),
|
|
1147
|
+
l.icon && /* @__PURE__ */ t("span", { className: "h-4 w-4", children: l.icon }),
|
|
1148
|
+
/* @__PURE__ */ t("span", { children: l.label })
|
|
1149
|
+
]
|
|
1150
|
+
},
|
|
1151
|
+
l.value
|
|
1152
|
+
);
|
|
1153
|
+
}) })
|
|
1154
|
+
] })
|
|
1155
|
+
] }) })
|
|
1156
|
+
] });
|
|
1157
|
+
}
|
|
1158
|
+
);
|
|
1159
|
+
Ot.displayName = "MultiSelect";
|
|
1160
|
+
const Et = Oe("relative flex", {
|
|
1161
|
+
variants: {
|
|
1162
|
+
size: {
|
|
1163
|
+
sm: "w-24",
|
|
1164
|
+
md: "w-32",
|
|
1165
|
+
lg: "w-40"
|
|
1166
|
+
}
|
|
1167
|
+
},
|
|
1168
|
+
defaultVariants: {
|
|
1169
|
+
size: "md"
|
|
1170
|
+
}
|
|
1171
|
+
}), Ce = {
|
|
1172
|
+
sm: "h-8 w-8",
|
|
1173
|
+
md: "h-10 w-10",
|
|
1174
|
+
lg: "h-12 w-12"
|
|
1175
|
+
}, Tt = {
|
|
1176
|
+
sm: "h-8 text-sm",
|
|
1177
|
+
md: "h-10 text-base",
|
|
1178
|
+
lg: "h-12 text-lg"
|
|
1179
|
+
}, $t = x.forwardRef(
|
|
1180
|
+
({
|
|
1181
|
+
className: e,
|
|
1182
|
+
value: r,
|
|
1183
|
+
onChange: a,
|
|
1184
|
+
min: s,
|
|
1185
|
+
max: n,
|
|
1186
|
+
step: c = 1,
|
|
1187
|
+
precision: u = 0,
|
|
1188
|
+
showStepper: m = !0,
|
|
1189
|
+
prefix: b,
|
|
1190
|
+
suffix: N,
|
|
1191
|
+
disabled: v,
|
|
1192
|
+
size: p = "md",
|
|
1193
|
+
...d
|
|
1194
|
+
}, g) => {
|
|
1195
|
+
const [f, h] = x.useState(r?.toString() ?? "");
|
|
1196
|
+
x.useEffect(() => {
|
|
1197
|
+
h(r?.toString() ?? "");
|
|
1198
|
+
}, [r]);
|
|
1199
|
+
const y = (L) => {
|
|
1200
|
+
let V = L;
|
|
1201
|
+
return s !== void 0 && (V = Math.max(s, V)), n !== void 0 && (V = Math.min(n, V)), Number(V.toFixed(u));
|
|
1202
|
+
}, C = (L) => {
|
|
1203
|
+
const V = L.target.value;
|
|
1204
|
+
if (h(V), V === "" || V === "-") {
|
|
1205
|
+
a?.(void 0);
|
|
1206
|
+
return;
|
|
1207
|
+
}
|
|
1208
|
+
const M = parseFloat(V);
|
|
1209
|
+
isNaN(M) || a?.(y(M));
|
|
1210
|
+
}, l = () => {
|
|
1211
|
+
if (f === "" || f === "-") {
|
|
1212
|
+
h(""), a?.(void 0);
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
const L = parseFloat(f);
|
|
1216
|
+
if (!isNaN(L)) {
|
|
1217
|
+
const V = y(L);
|
|
1218
|
+
h(V.toString()), a?.(V);
|
|
1219
|
+
}
|
|
1220
|
+
}, F = () => {
|
|
1221
|
+
const V = y((r ?? 0) + c);
|
|
1222
|
+
h(V.toString()), a?.(V);
|
|
1223
|
+
}, o = () => {
|
|
1224
|
+
const V = y((r ?? 0) - c);
|
|
1225
|
+
h(V.toString()), a?.(V);
|
|
1226
|
+
}, S = n === void 0 || (r ?? 0) < n, R = s === void 0 || (r ?? 0) > s, _ = p || "md";
|
|
1227
|
+
return /* @__PURE__ */ i("div", { className: k(Et({ size: p }), e), children: [
|
|
1228
|
+
m && /* @__PURE__ */ t(
|
|
1229
|
+
A,
|
|
1230
|
+
{
|
|
1231
|
+
type: "button",
|
|
1232
|
+
variant: "outline",
|
|
1233
|
+
size: "icon",
|
|
1234
|
+
className: k("rounded-r-none", Ce[_]),
|
|
1235
|
+
onClick: o,
|
|
1236
|
+
disabled: v || !R,
|
|
1237
|
+
children: /* @__PURE__ */ t(Qe, { className: k(_ === "sm" ? "h-3 w-3" : "h-4 w-4") })
|
|
1238
|
+
}
|
|
1239
|
+
),
|
|
1240
|
+
/* @__PURE__ */ i("div", { className: "relative flex-1", children: [
|
|
1241
|
+
b && /* @__PURE__ */ t("span", { className: k(
|
|
1242
|
+
"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",
|
|
1243
|
+
_ === "sm" && "text-sm",
|
|
1244
|
+
_ === "lg" && "text-lg"
|
|
1245
|
+
), children: b }),
|
|
1246
|
+
/* @__PURE__ */ t(
|
|
1247
|
+
G,
|
|
1248
|
+
{
|
|
1249
|
+
ref: g,
|
|
1250
|
+
type: "text",
|
|
1251
|
+
inputMode: "decimal",
|
|
1252
|
+
value: f,
|
|
1253
|
+
onChange: C,
|
|
1254
|
+
onBlur: l,
|
|
1255
|
+
disabled: v,
|
|
1256
|
+
className: k(
|
|
1257
|
+
"text-center",
|
|
1258
|
+
Tt[_],
|
|
1259
|
+
m && "rounded-none border-x-0",
|
|
1260
|
+
b && "pl-8",
|
|
1261
|
+
N && "pr-8"
|
|
1262
|
+
),
|
|
1263
|
+
...d
|
|
1264
|
+
}
|
|
1265
|
+
),
|
|
1266
|
+
N && /* @__PURE__ */ t("span", { className: k(
|
|
1267
|
+
"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",
|
|
1268
|
+
_ === "sm" && "text-sm",
|
|
1269
|
+
_ === "lg" && "text-lg"
|
|
1270
|
+
), children: N })
|
|
1271
|
+
] }),
|
|
1272
|
+
m && /* @__PURE__ */ t(
|
|
1273
|
+
A,
|
|
1274
|
+
{
|
|
1275
|
+
type: "button",
|
|
1276
|
+
variant: "outline",
|
|
1277
|
+
size: "icon",
|
|
1278
|
+
className: k("rounded-l-none", Ce[_]),
|
|
1279
|
+
onClick: F,
|
|
1280
|
+
disabled: v || !S,
|
|
1281
|
+
children: /* @__PURE__ */ t(Xe, { className: k(_ === "sm" ? "h-3 w-3" : "h-4 w-4") })
|
|
1282
|
+
}
|
|
1283
|
+
)
|
|
1284
|
+
] });
|
|
1285
|
+
}
|
|
1286
|
+
);
|
|
1287
|
+
$t.displayName = "NumberInput";
|
|
1288
|
+
const Ht = [
|
|
1289
|
+
{ code: "US", dialCode: "+1", name: "United States", flag: "🇺🇸" },
|
|
1290
|
+
{ code: "GB", dialCode: "+44", name: "United Kingdom", flag: "🇬🇧" },
|
|
1291
|
+
{ code: "DE", dialCode: "+49", name: "Germany", flag: "🇩🇪" },
|
|
1292
|
+
{ code: "FR", dialCode: "+33", name: "France", flag: "🇫🇷" },
|
|
1293
|
+
{ code: "IT", dialCode: "+39", name: "Italy", flag: "🇮🇹" },
|
|
1294
|
+
{ code: "ES", dialCode: "+34", name: "Spain", flag: "🇪🇸" },
|
|
1295
|
+
{ code: "TR", dialCode: "+90", name: "Turkey", flag: "🇹🇷" },
|
|
1296
|
+
{ code: "NL", dialCode: "+31", name: "Netherlands", flag: "🇳🇱" },
|
|
1297
|
+
{ code: "BE", dialCode: "+32", name: "Belgium", flag: "🇧🇪" },
|
|
1298
|
+
{ code: "AT", dialCode: "+43", name: "Austria", flag: "🇦🇹" },
|
|
1299
|
+
{ code: "CH", dialCode: "+41", name: "Switzerland", flag: "🇨🇭" },
|
|
1300
|
+
{ code: "PL", dialCode: "+48", name: "Poland", flag: "🇵🇱" },
|
|
1301
|
+
{ code: "SE", dialCode: "+46", name: "Sweden", flag: "🇸🇪" },
|
|
1302
|
+
{ code: "NO", dialCode: "+47", name: "Norway", flag: "🇳🇴" },
|
|
1303
|
+
{ code: "DK", dialCode: "+45", name: "Denmark", flag: "🇩🇰" },
|
|
1304
|
+
{ code: "FI", dialCode: "+358", name: "Finland", flag: "🇫🇮" },
|
|
1305
|
+
{ code: "PT", dialCode: "+351", name: "Portugal", flag: "🇵🇹" },
|
|
1306
|
+
{ code: "GR", dialCode: "+30", name: "Greece", flag: "🇬🇷" },
|
|
1307
|
+
{ code: "CZ", dialCode: "+420", name: "Czech Republic", flag: "🇨🇿" },
|
|
1308
|
+
{ code: "RO", dialCode: "+40", name: "Romania", flag: "🇷🇴" },
|
|
1309
|
+
{ code: "HU", dialCode: "+36", name: "Hungary", flag: "🇭🇺" },
|
|
1310
|
+
{ code: "IE", dialCode: "+353", name: "Ireland", flag: "🇮🇪" },
|
|
1311
|
+
{ code: "AU", dialCode: "+61", name: "Australia", flag: "🇦🇺" },
|
|
1312
|
+
{ code: "CA", dialCode: "+1", name: "Canada", flag: "🇨🇦" },
|
|
1313
|
+
{ code: "BR", dialCode: "+55", name: "Brazil", flag: "🇧🇷" },
|
|
1314
|
+
{ code: "MX", dialCode: "+52", name: "Mexico", flag: "🇲🇽" },
|
|
1315
|
+
{ code: "JP", dialCode: "+81", name: "Japan", flag: "🇯🇵" },
|
|
1316
|
+
{ code: "CN", dialCode: "+86", name: "China", flag: "🇨🇳" },
|
|
1317
|
+
{ code: "IN", dialCode: "+91", name: "India", flag: "🇮🇳" },
|
|
1318
|
+
{ code: "RU", dialCode: "+7", name: "Russia", flag: "🇷🇺" }
|
|
1319
|
+
], Ut = x.forwardRef(
|
|
1320
|
+
({
|
|
1321
|
+
value: e,
|
|
1322
|
+
onChange: r,
|
|
1323
|
+
defaultCountry: a = "US",
|
|
1324
|
+
countries: s = Ht,
|
|
1325
|
+
placeholder: n = "Phone number",
|
|
1326
|
+
disabled: c = !1,
|
|
1327
|
+
className: u,
|
|
1328
|
+
error: m
|
|
1329
|
+
}, b) => {
|
|
1330
|
+
const [N, v] = x.useState(
|
|
1331
|
+
s.find((h) => h.code === a) || s[0]
|
|
1332
|
+
), [p, d] = x.useState("");
|
|
1333
|
+
x.useEffect(() => {
|
|
1334
|
+
if (e) {
|
|
1335
|
+
const h = s.find((y) => e.startsWith(y.dialCode));
|
|
1336
|
+
h ? (v(h), d(e.slice(h.dialCode.length).trim())) : d(e);
|
|
1337
|
+
}
|
|
1338
|
+
}, [e, s]);
|
|
1339
|
+
const g = (h) => {
|
|
1340
|
+
v(h);
|
|
1341
|
+
const y = `${h.dialCode} ${p}`.trim();
|
|
1342
|
+
r?.(y, h);
|
|
1343
|
+
}, f = (h) => {
|
|
1344
|
+
const y = h.target.value.replace(/[^\d\s\-()]/g, "");
|
|
1345
|
+
d(y);
|
|
1346
|
+
const C = `${N.dialCode} ${y}`.trim();
|
|
1347
|
+
r?.(C, N);
|
|
1348
|
+
};
|
|
1349
|
+
return /* @__PURE__ */ i("div", { className: k("flex", u), children: [
|
|
1350
|
+
/* @__PURE__ */ i(je, { children: [
|
|
1351
|
+
/* @__PURE__ */ t(Ke, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1352
|
+
A,
|
|
1353
|
+
{
|
|
1354
|
+
variant: "outline",
|
|
1355
|
+
disabled: c,
|
|
1356
|
+
className: k(
|
|
1357
|
+
"flex shrink-0 items-center gap-1 rounded-r-none border-r-0 px-3",
|
|
1358
|
+
m && "border-destructive"
|
|
1359
|
+
),
|
|
1360
|
+
children: [
|
|
1361
|
+
/* @__PURE__ */ t("span", { className: "text-base", children: N.flag }),
|
|
1362
|
+
/* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: N.dialCode }),
|
|
1363
|
+
/* @__PURE__ */ t(q, { className: "h-4 w-4 opacity-50" })
|
|
1364
|
+
]
|
|
1365
|
+
}
|
|
1366
|
+
) }),
|
|
1367
|
+
/* @__PURE__ */ t(We, { className: "max-h-64 overflow-y-auto", children: s.map((h) => /* @__PURE__ */ i(
|
|
1368
|
+
Je,
|
|
1369
|
+
{
|
|
1370
|
+
onClick: () => g(h),
|
|
1371
|
+
className: "flex items-center gap-2",
|
|
1372
|
+
children: [
|
|
1373
|
+
/* @__PURE__ */ t("span", { className: "text-base", children: h.flag }),
|
|
1374
|
+
/* @__PURE__ */ t("span", { className: "flex-1", children: h.name }),
|
|
1375
|
+
/* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: h.dialCode })
|
|
1376
|
+
]
|
|
1377
|
+
},
|
|
1378
|
+
h.code
|
|
1379
|
+
)) })
|
|
1380
|
+
] }),
|
|
1381
|
+
/* @__PURE__ */ t(
|
|
1382
|
+
G,
|
|
1383
|
+
{
|
|
1384
|
+
ref: b,
|
|
1385
|
+
type: "tel",
|
|
1386
|
+
value: p,
|
|
1387
|
+
onChange: f,
|
|
1388
|
+
placeholder: n,
|
|
1389
|
+
disabled: c,
|
|
1390
|
+
className: k("rounded-l-none", m && "border-destructive")
|
|
1391
|
+
}
|
|
1392
|
+
)
|
|
1393
|
+
] });
|
|
1394
|
+
}
|
|
1395
|
+
);
|
|
1396
|
+
Ut.displayName = "PhoneInput";
|
|
1397
|
+
const Bt = x.forwardRef(
|
|
1398
|
+
({
|
|
1399
|
+
value: e,
|
|
1400
|
+
onChange: r,
|
|
1401
|
+
onSearch: a,
|
|
1402
|
+
placeholder: s = "Select...",
|
|
1403
|
+
dialogTitle: n = "Search",
|
|
1404
|
+
searchPlaceholder: c = "Type to search...",
|
|
1405
|
+
emptyMessage: u = "No results found",
|
|
1406
|
+
multiple: m = !1,
|
|
1407
|
+
disabled: b = !1,
|
|
1408
|
+
className: N,
|
|
1409
|
+
renderItem: v
|
|
1410
|
+
}, p) => {
|
|
1411
|
+
const [d, g] = x.useState(!1), [f, h] = x.useState(""), [y, C] = x.useState([]), [l, F] = x.useState(!1), o = x.useRef(null), S = x.useMemo(() => e ? Array.isArray(e) ? e : [e] : [], [e]), R = x.useCallback(
|
|
1412
|
+
async (w) => {
|
|
1413
|
+
if (h(w), o.current && clearTimeout(o.current), !w.trim()) {
|
|
1414
|
+
C([]);
|
|
1415
|
+
return;
|
|
1416
|
+
}
|
|
1417
|
+
o.current = setTimeout(async () => {
|
|
1418
|
+
F(!0);
|
|
1419
|
+
try {
|
|
1420
|
+
const D = await a(w);
|
|
1421
|
+
C(D);
|
|
1422
|
+
} catch {
|
|
1423
|
+
C([]);
|
|
1424
|
+
} finally {
|
|
1425
|
+
F(!1);
|
|
1426
|
+
}
|
|
1427
|
+
}, 300);
|
|
1428
|
+
},
|
|
1429
|
+
[a]
|
|
1430
|
+
), _ = (w) => {
|
|
1431
|
+
if (m) {
|
|
1432
|
+
const D = S, E = D.some((T) => T.id === w.id) ? D.filter((T) => T.id !== w.id) : [...D, w];
|
|
1433
|
+
r?.(E.length > 0 ? E : void 0);
|
|
1434
|
+
} else
|
|
1435
|
+
r?.(w), g(!1);
|
|
1436
|
+
}, L = (w, D) => {
|
|
1437
|
+
if (D.stopPropagation(), m) {
|
|
1438
|
+
const I = S.filter((E) => E.id !== w);
|
|
1439
|
+
r?.(I.length > 0 ? I : void 0);
|
|
1440
|
+
} else
|
|
1441
|
+
r?.(void 0);
|
|
1442
|
+
}, V = (w) => {
|
|
1443
|
+
w.stopPropagation(), r?.(void 0);
|
|
1444
|
+
}, M = (w) => /* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
|
|
1445
|
+
/* @__PURE__ */ i(Ze, { className: "h-8 w-8", children: [
|
|
1446
|
+
w.avatar && /* @__PURE__ */ t(qe, { src: w.avatar }),
|
|
1447
|
+
/* @__PURE__ */ t(et, { className: "text-xs", children: w.label.split(" ").map((D) => D[0]).join("").toUpperCase().slice(0, 2) })
|
|
1448
|
+
] }),
|
|
1449
|
+
/* @__PURE__ */ i("div", { className: "flex flex-1 flex-col", children: [
|
|
1450
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: w.label }),
|
|
1451
|
+
w.description && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: w.description })
|
|
1452
|
+
] }),
|
|
1453
|
+
w.badges && w.badges.length > 0 && /* @__PURE__ */ t("div", { className: "flex gap-1", children: w.badges.map((D, I) => /* @__PURE__ */ t(j, { variant: "secondary", className: "text-xs", children: D }, I)) })
|
|
1454
|
+
] });
|
|
1455
|
+
return /* @__PURE__ */ i($e, { open: d, onOpenChange: g, children: [
|
|
1456
|
+
/* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1457
|
+
A,
|
|
1458
|
+
{
|
|
1459
|
+
ref: p,
|
|
1460
|
+
variant: "outline",
|
|
1461
|
+
role: "combobox",
|
|
1462
|
+
disabled: b,
|
|
1463
|
+
className: k(
|
|
1464
|
+
"w-full justify-between font-normal",
|
|
1465
|
+
S.length === 0 && "text-muted-foreground",
|
|
1466
|
+
N
|
|
1467
|
+
),
|
|
1468
|
+
children: [
|
|
1469
|
+
/* @__PURE__ */ t("div", { className: "flex flex-1 flex-wrap items-center gap-1 overflow-hidden", children: S.length === 0 ? /* @__PURE__ */ t("span", { children: s }) : m ? S.map((w) => /* @__PURE__ */ i(j, { variant: "secondary", className: "gap-1 pr-1", children: [
|
|
1470
|
+
w.label,
|
|
1471
|
+
/* @__PURE__ */ t(
|
|
1472
|
+
"button",
|
|
1473
|
+
{
|
|
1474
|
+
className: "rounded-full hover:bg-muted-foreground/20",
|
|
1475
|
+
onClick: (D) => L(w.id, D),
|
|
1476
|
+
children: /* @__PURE__ */ t($, { className: "h-3 w-3" })
|
|
1477
|
+
}
|
|
1478
|
+
)
|
|
1479
|
+
] }, w.id)) : /* @__PURE__ */ t("span", { className: "truncate", children: S[0].label }) }),
|
|
1480
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
1481
|
+
S.length > 0 && !m && /* @__PURE__ */ t(
|
|
1482
|
+
"button",
|
|
1483
|
+
{
|
|
1484
|
+
className: "rounded p-0.5 hover:bg-muted",
|
|
1485
|
+
onClick: V,
|
|
1486
|
+
children: /* @__PURE__ */ t($, { className: "h-4 w-4 text-muted-foreground" })
|
|
1487
|
+
}
|
|
1488
|
+
),
|
|
1489
|
+
/* @__PURE__ */ t(tt, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
1490
|
+
] })
|
|
1491
|
+
]
|
|
1492
|
+
}
|
|
1493
|
+
) }),
|
|
1494
|
+
/* @__PURE__ */ i(Ue, { className: "max-w-lg", children: [
|
|
1495
|
+
/* @__PURE__ */ t(Be, { children: /* @__PURE__ */ t(ze, { children: n }) }),
|
|
1496
|
+
/* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
1497
|
+
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1498
|
+
/* @__PURE__ */ t(Fe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
1499
|
+
/* @__PURE__ */ t(
|
|
1500
|
+
G,
|
|
1501
|
+
{
|
|
1502
|
+
placeholder: c,
|
|
1503
|
+
value: f,
|
|
1504
|
+
onChange: (w) => R(w.target.value),
|
|
1505
|
+
className: "pl-10",
|
|
1506
|
+
autoFocus: !0
|
|
1507
|
+
}
|
|
1508
|
+
)
|
|
1509
|
+
] }),
|
|
1510
|
+
/* @__PURE__ */ t(Ee, { className: "h-64", children: l ? /* @__PURE__ */ t("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ t(Ge, { className: "h-6 w-6 animate-spin text-muted-foreground" }) }) : y.length === 0 ? /* @__PURE__ */ t("div", { className: "py-8 text-center text-sm text-muted-foreground", children: f ? u : "Start typing to search..." }) : /* @__PURE__ */ t("div", { className: "space-y-1", children: y.map((w) => {
|
|
1511
|
+
const D = S.some((I) => I.id === w.id);
|
|
1512
|
+
return /* @__PURE__ */ t(
|
|
1513
|
+
"button",
|
|
1514
|
+
{
|
|
1515
|
+
onClick: () => _(w),
|
|
1516
|
+
className: k(
|
|
1517
|
+
"w-full rounded-md p-2 text-left transition-colors hover:bg-accent",
|
|
1518
|
+
D && "bg-accent"
|
|
1519
|
+
),
|
|
1520
|
+
children: v ? v(w) : M(w)
|
|
1521
|
+
},
|
|
1522
|
+
w.id
|
|
1523
|
+
);
|
|
1524
|
+
}) }) })
|
|
1525
|
+
] })
|
|
1526
|
+
] })
|
|
1527
|
+
] });
|
|
1528
|
+
}
|
|
1529
|
+
);
|
|
1530
|
+
Bt.displayName = "LookupField";
|
|
1531
|
+
const zt = ["USD", "EUR", "GBP", "TRY", "JPY", "CNY"];
|
|
1532
|
+
function ma({
|
|
1533
|
+
value: e,
|
|
1534
|
+
onChange: r,
|
|
1535
|
+
placeholder: a,
|
|
1536
|
+
searchPlaceholder: s,
|
|
1537
|
+
emptyMessage: n,
|
|
1538
|
+
disabled: c = !1,
|
|
1539
|
+
className: u,
|
|
1540
|
+
showSymbol: m = !0,
|
|
1541
|
+
showCode: b = !0,
|
|
1542
|
+
showName: N = !0,
|
|
1543
|
+
popularCurrencies: v = zt
|
|
1544
|
+
}) {
|
|
1545
|
+
const [p, d] = x.useState(!1), { t: g } = Pe(), f = at(), h = e ? pe[e] : void 0, y = v.map((o) => pe[o]).filter(Boolean), C = f.filter(
|
|
1546
|
+
(o) => !v.includes(o.code)
|
|
1547
|
+
), F = h ? ((o) => {
|
|
1548
|
+
const S = [];
|
|
1549
|
+
return m && S.push(o.symbol), b && S.push(o.code), N && S.push(`- ${o.name}`), S.join(" ");
|
|
1550
|
+
})(h) : a || g("locale.selectCurrency");
|
|
1551
|
+
return /* @__PURE__ */ i(H, { open: p, onOpenChange: d, children: [
|
|
1552
|
+
/* @__PURE__ */ t(U, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1553
|
+
A,
|
|
1554
|
+
{
|
|
1555
|
+
variant: "outline",
|
|
1556
|
+
role: "combobox",
|
|
1557
|
+
"aria-expanded": p,
|
|
1558
|
+
disabled: c,
|
|
1559
|
+
className: k(
|
|
1560
|
+
"w-full justify-between",
|
|
1561
|
+
!e && "text-muted-foreground",
|
|
1562
|
+
u
|
|
1563
|
+
),
|
|
1564
|
+
children: [
|
|
1565
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: F }),
|
|
1566
|
+
/* @__PURE__ */ t(ie, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1567
|
+
]
|
|
1568
|
+
}
|
|
1569
|
+
) }),
|
|
1570
|
+
/* @__PURE__ */ t(B, { className: "w-[300px] p-0", align: "start", children: /* @__PURE__ */ i(ee, { children: [
|
|
1571
|
+
/* @__PURE__ */ t(
|
|
1572
|
+
te,
|
|
1573
|
+
{
|
|
1574
|
+
placeholder: s || g("common.search"),
|
|
1575
|
+
className: "h-9"
|
|
1576
|
+
}
|
|
1577
|
+
),
|
|
1578
|
+
/* @__PURE__ */ i(ae, { children: [
|
|
1579
|
+
/* @__PURE__ */ t(re, { children: n || g("common.noData") }),
|
|
1580
|
+
y.length > 0 && /* @__PURE__ */ t(Y, { heading: "Popular", children: y.map((o) => /* @__PURE__ */ i(
|
|
1581
|
+
Q,
|
|
1582
|
+
{
|
|
1583
|
+
value: `${o.code} ${o.name}`,
|
|
1584
|
+
onSelect: () => {
|
|
1585
|
+
r?.(o.code), d(!1);
|
|
1586
|
+
},
|
|
1587
|
+
children: [
|
|
1588
|
+
/* @__PURE__ */ t(
|
|
1589
|
+
J,
|
|
1590
|
+
{
|
|
1591
|
+
className: k(
|
|
1592
|
+
"mr-2 h-4 w-4",
|
|
1593
|
+
e === o.code ? "opacity-100" : "opacity-0"
|
|
1594
|
+
)
|
|
1595
|
+
}
|
|
1596
|
+
),
|
|
1597
|
+
/* @__PURE__ */ t("span", { className: "w-8 font-medium", children: o.symbol }),
|
|
1598
|
+
/* @__PURE__ */ t("span", { className: "w-12 text-muted-foreground", children: o.code }),
|
|
1599
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: o.name })
|
|
1600
|
+
]
|
|
1601
|
+
},
|
|
1602
|
+
o.code
|
|
1603
|
+
)) }),
|
|
1604
|
+
/* @__PURE__ */ t(Y, { heading: "All Currencies", children: C.map((o) => /* @__PURE__ */ i(
|
|
1605
|
+
Q,
|
|
1606
|
+
{
|
|
1607
|
+
value: `${o.code} ${o.name}`,
|
|
1608
|
+
onSelect: () => {
|
|
1609
|
+
r?.(o.code), d(!1);
|
|
1610
|
+
},
|
|
1611
|
+
children: [
|
|
1612
|
+
/* @__PURE__ */ t(
|
|
1613
|
+
J,
|
|
1614
|
+
{
|
|
1615
|
+
className: k(
|
|
1616
|
+
"mr-2 h-4 w-4",
|
|
1617
|
+
e === o.code ? "opacity-100" : "opacity-0"
|
|
1618
|
+
)
|
|
1619
|
+
}
|
|
1620
|
+
),
|
|
1621
|
+
/* @__PURE__ */ t("span", { className: "w-8 font-medium", children: o.symbol }),
|
|
1622
|
+
/* @__PURE__ */ t("span", { className: "w-12 text-muted-foreground", children: o.code }),
|
|
1623
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: o.name })
|
|
1624
|
+
]
|
|
1625
|
+
},
|
|
1626
|
+
o.code
|
|
1627
|
+
)) })
|
|
1628
|
+
] })
|
|
1629
|
+
] }) })
|
|
1630
|
+
] });
|
|
1631
|
+
}
|
|
1632
|
+
function fa({
|
|
1633
|
+
value: e,
|
|
1634
|
+
onChange: r,
|
|
1635
|
+
placeholder: a,
|
|
1636
|
+
searchPlaceholder: s,
|
|
1637
|
+
emptyMessage: n,
|
|
1638
|
+
disabled: c = !1,
|
|
1639
|
+
className: u,
|
|
1640
|
+
showFlag: m = !0,
|
|
1641
|
+
showNativeName: b = !0,
|
|
1642
|
+
showCode: N = !1,
|
|
1643
|
+
variant: v = "default"
|
|
1644
|
+
}) {
|
|
1645
|
+
const [p, d] = x.useState(!1), { t: g, config: f } = Pe(), h = rt(), y = e ? st(e) : void 0, C = e || f.locale, F = y ? ((o, S = !1) => {
|
|
1646
|
+
if (v === "icon-only" && S)
|
|
1647
|
+
return m ? o.flag : /* @__PURE__ */ t(nt, { className: "h-4 w-4" });
|
|
1648
|
+
if (v === "compact" && S)
|
|
1649
|
+
return /* @__PURE__ */ i("span", { className: "flex items-center gap-1.5", children: [
|
|
1650
|
+
m && /* @__PURE__ */ t("span", { children: o.flag }),
|
|
1651
|
+
/* @__PURE__ */ t("span", { children: o.code.split("-")[0].toUpperCase() })
|
|
1652
|
+
] });
|
|
1653
|
+
const R = [];
|
|
1654
|
+
return m && R.push(/* @__PURE__ */ t("span", { className: "mr-1.5", children: o.flag }, "flag")), b && R.push(/* @__PURE__ */ t("span", { children: o.nativeName }, "native")), N && R.push(/* @__PURE__ */ i("span", { className: "text-muted-foreground ml-1", children: [
|
|
1655
|
+
"(",
|
|
1656
|
+
o.code,
|
|
1657
|
+
")"
|
|
1658
|
+
] }, "code")), /* @__PURE__ */ t("span", { className: "flex items-center", children: R });
|
|
1659
|
+
})(y, !0) : a || g("locale.selectLanguage");
|
|
1660
|
+
return /* @__PURE__ */ i(H, { open: p, onOpenChange: d, children: [
|
|
1661
|
+
/* @__PURE__ */ t(U, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1662
|
+
A,
|
|
1663
|
+
{
|
|
1664
|
+
variant: "outline",
|
|
1665
|
+
role: "combobox",
|
|
1666
|
+
"aria-expanded": p,
|
|
1667
|
+
disabled: c,
|
|
1668
|
+
className: k(
|
|
1669
|
+
"justify-between",
|
|
1670
|
+
v === "icon-only" ? "w-10 px-0" : v === "compact" ? "w-auto" : "w-full",
|
|
1671
|
+
!e && "text-muted-foreground",
|
|
1672
|
+
u
|
|
1673
|
+
),
|
|
1674
|
+
children: [
|
|
1675
|
+
/* @__PURE__ */ t("span", { className: k("truncate", v === "icon-only" && "text-lg"), children: F }),
|
|
1676
|
+
v !== "icon-only" && /* @__PURE__ */ t(ie, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1677
|
+
]
|
|
1678
|
+
}
|
|
1679
|
+
) }),
|
|
1680
|
+
/* @__PURE__ */ t(B, { className: "w-[280px] p-0", align: "start", children: /* @__PURE__ */ i(ee, { children: [
|
|
1681
|
+
/* @__PURE__ */ t(
|
|
1682
|
+
te,
|
|
1683
|
+
{
|
|
1684
|
+
placeholder: s || g("common.search"),
|
|
1685
|
+
className: "h-9"
|
|
1686
|
+
}
|
|
1687
|
+
),
|
|
1688
|
+
/* @__PURE__ */ i(ae, { children: [
|
|
1689
|
+
/* @__PURE__ */ t(re, { children: n || g("common.noData") }),
|
|
1690
|
+
/* @__PURE__ */ t(Y, { children: h.map((o) => /* @__PURE__ */ i(
|
|
1691
|
+
Q,
|
|
1692
|
+
{
|
|
1693
|
+
value: `${o.code} ${o.name} ${o.nativeName}`,
|
|
1694
|
+
onSelect: () => {
|
|
1695
|
+
r?.(o.code), d(!1);
|
|
1696
|
+
},
|
|
1697
|
+
children: [
|
|
1698
|
+
/* @__PURE__ */ t(
|
|
1699
|
+
J,
|
|
1700
|
+
{
|
|
1701
|
+
className: k(
|
|
1702
|
+
"mr-2 h-4 w-4",
|
|
1703
|
+
C === o.code ? "opacity-100" : "opacity-0"
|
|
1704
|
+
)
|
|
1705
|
+
}
|
|
1706
|
+
),
|
|
1707
|
+
/* @__PURE__ */ t("span", { className: "mr-2 text-lg", children: o.flag }),
|
|
1708
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col", children: [
|
|
1709
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: o.nativeName }),
|
|
1710
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: o.name })
|
|
1711
|
+
] })
|
|
1712
|
+
]
|
|
1713
|
+
},
|
|
1714
|
+
o.code
|
|
1715
|
+
)) })
|
|
1716
|
+
] })
|
|
1717
|
+
] }) })
|
|
1718
|
+
] });
|
|
1719
|
+
}
|
|
1720
|
+
export {
|
|
1721
|
+
Rt as C,
|
|
1722
|
+
ua as D,
|
|
1723
|
+
ia as F,
|
|
1724
|
+
Bt as L,
|
|
1725
|
+
Ot as M,
|
|
1726
|
+
$t as N,
|
|
1727
|
+
Ut as P,
|
|
1728
|
+
Vt as S,
|
|
1729
|
+
It as T,
|
|
1730
|
+
vt as a,
|
|
1731
|
+
St as b,
|
|
1732
|
+
kt as c,
|
|
1733
|
+
Ft as d,
|
|
1734
|
+
Pt as e,
|
|
1735
|
+
da as f,
|
|
1736
|
+
Dt as g,
|
|
1737
|
+
Mt as h,
|
|
1738
|
+
At as i,
|
|
1739
|
+
Lt as j,
|
|
1740
|
+
Ht as k,
|
|
1741
|
+
ma as l,
|
|
1742
|
+
fa as m,
|
|
1743
|
+
ne as u
|
|
1744
|
+
};
|
|
1745
|
+
//# sourceMappingURL=locale-selector-xn2GpdP9.js.map
|