@vlrc-fe/components 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Form/FormDatePicker/SingleDatePicker.d.ts.map +1 -1
- package/dist/index100.js +30 -17
- package/dist/index101.cjs +1 -1
- package/dist/index102.js +35 -19
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +29 -19
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +98 -55
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +86 -48
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +12 -6
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +23 -16
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +205 -120
- package/dist/index109.cjs +1 -1
- package/dist/index11.js +105 -53
- package/dist/index113.js +12 -6
- package/dist/index114.cjs +1 -1
- package/dist/index115.js +18 -10
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +82 -41
- package/dist/index117.cjs +1 -1
- package/dist/index118.js +42 -21
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +12 -6
- package/dist/index12.cjs +1 -1
- package/dist/index120.cjs +1 -1
- package/dist/index121.js +18 -12
- package/dist/index122.cjs +1 -1
- package/dist/index123.js +42 -28
- package/dist/index124.cjs +1 -1
- package/dist/index126.js +86 -57
- package/dist/index127.cjs +1 -1
- package/dist/index127.js +30 -17
- package/dist/index128.cjs +1 -1
- package/dist/index128.js +42 -27
- package/dist/index129.cjs +1 -1
- package/dist/index129.js +31 -18
- package/dist/index130.cjs +1 -1
- package/dist/index132.js +50 -23
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +28 -14
- package/dist/index134.cjs +1 -1
- package/dist/index135.js +147 -99
- package/dist/index136.cjs +1 -1
- package/dist/index138.js +242 -170
- package/dist/index139.cjs +1 -1
- package/dist/index14.js +9 -5
- package/dist/index141.js +21 -10
- package/dist/index142.cjs +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index18.js +32 -16
- package/dist/index186.js +57 -44
- package/dist/index187.cjs +1 -1
- package/dist/index187.js +56 -48
- package/dist/index188.cjs +1 -1
- package/dist/index188.js +16 -12
- package/dist/index189.cjs +1 -1
- package/dist/index19.cjs +1 -1
- package/dist/index191.js +36 -23
- package/dist/index192.cjs +1 -1
- package/dist/index197.js +18 -15
- package/dist/index198.cjs +1 -1
- package/dist/index20.js +79 -41
- package/dist/index200.js +49 -33
- package/dist/index201.cjs +1 -1
- package/dist/index201.js +20 -11
- package/dist/index202.cjs +1 -1
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +30 -23
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +75 -39
- package/dist/index23.cjs +1 -1
- package/dist/index26.js +39 -28
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +20 -12
- package/dist/index28.cjs +1 -1
- package/dist/index33.js +23 -13
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +87 -49
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +86 -45
- package/dist/index36.cjs +1 -1
- package/dist/index4.js +49 -26
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +34 -18
- package/dist/index6.cjs +1 -1
- package/dist/index75.js +142 -77
- package/dist/index76.cjs +1 -1
- package/dist/index77.js +96 -49
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +137 -77
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +13 -7
- package/dist/index80.cjs +1 -1
- package/dist/index81.js +130 -63
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +201 -158
- package/dist/index83.cjs +1 -1
- package/dist/index84.js +97 -59
- package/dist/index85.cjs +1 -1
- package/dist/index86.js +17 -10
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +13 -7
- package/dist/index88.cjs +1 -1
- package/dist/index89.js +54 -28
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +94 -53
- package/dist/index91.cjs +1 -1
- package/dist/index92.js +156 -89
- package/dist/index93.cjs +1 -1
- package/dist/index96.js +89 -47
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +78 -43
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +27 -17
- package/dist/index99.cjs +1 -1
- package/package.json +1 -1
package/dist/index20.js
CHANGED
|
@@ -2,68 +2,106 @@ import { cn as e } from "./index3.js";
|
|
|
2
2
|
import { ChevronRight as t, MoreHorizontal as n } from "lucide-react";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
-
import {
|
|
5
|
+
import { c as a } from "react/compiler-runtime";
|
|
6
|
+
import { Slot as o } from "@radix-ui/react-slot";
|
|
6
7
|
//#region src/ui/breadcrumb.tsx
|
|
7
|
-
function
|
|
8
|
-
|
|
8
|
+
function s(e) {
|
|
9
|
+
let t = a(4), n;
|
|
10
|
+
t[0] === e ? n = t[1] : ({...n} = e, t[0] = e, t[1] = n);
|
|
11
|
+
let i;
|
|
12
|
+
return t[2] === n ? i = t[3] : (i = /* @__PURE__ */ r("nav", {
|
|
9
13
|
"aria-label": "breadcrumb",
|
|
10
14
|
"data-slot": "breadcrumb",
|
|
11
|
-
...
|
|
12
|
-
});
|
|
15
|
+
...n
|
|
16
|
+
}), t[2] = n, t[3] = i), i;
|
|
13
17
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
18
|
+
function c(t) {
|
|
19
|
+
let n = a(8), i, o;
|
|
20
|
+
n[0] === t ? (i = n[1], o = n[2]) : ({className: i, ...o} = t, n[0] = t, n[1] = i, n[2] = o);
|
|
21
|
+
let s;
|
|
22
|
+
n[3] === i ? s = n[4] : (s = e("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5", i), n[3] = i, n[4] = s);
|
|
23
|
+
let c;
|
|
24
|
+
return n[5] !== o || n[6] !== s ? (c = /* @__PURE__ */ r("ol", {
|
|
16
25
|
"data-slot": "breadcrumb-list",
|
|
17
|
-
className:
|
|
18
|
-
...
|
|
19
|
-
});
|
|
26
|
+
className: s,
|
|
27
|
+
...o
|
|
28
|
+
}), n[5] = o, n[6] = s, n[7] = c) : c = n[7], c;
|
|
20
29
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
30
|
+
function l(t) {
|
|
31
|
+
let n = a(8), i, o;
|
|
32
|
+
n[0] === t ? (i = n[1], o = n[2]) : ({className: i, ...o} = t, n[0] = t, n[1] = i, n[2] = o);
|
|
33
|
+
let s;
|
|
34
|
+
n[3] === i ? s = n[4] : (s = e("inline-flex items-center gap-1.5", i), n[3] = i, n[4] = s);
|
|
35
|
+
let c;
|
|
36
|
+
return n[5] !== o || n[6] !== s ? (c = /* @__PURE__ */ r("li", {
|
|
23
37
|
"data-slot": "breadcrumb-item",
|
|
24
|
-
className:
|
|
25
|
-
...
|
|
26
|
-
});
|
|
38
|
+
className: s,
|
|
39
|
+
...o
|
|
40
|
+
}), n[5] = o, n[6] = s, n[7] = c) : c = n[7], c;
|
|
27
41
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
42
|
+
function u(t) {
|
|
43
|
+
let n = a(10), i, s, c;
|
|
44
|
+
n[0] === t ? (i = n[1], s = n[2], c = n[3]) : ({asChild: i, className: s, ...c} = t, n[0] = t, n[1] = i, n[2] = s, n[3] = c);
|
|
45
|
+
let l = i ? o : "a", u;
|
|
46
|
+
n[4] === s ? u = n[5] : (u = e("hover:text-foreground transition-colors", s), n[4] = s, n[5] = u);
|
|
47
|
+
let d;
|
|
48
|
+
return n[6] !== l || n[7] !== c || n[8] !== u ? (d = /* @__PURE__ */ r(l, {
|
|
30
49
|
"data-slot": "breadcrumb-link",
|
|
31
|
-
className:
|
|
32
|
-
...
|
|
33
|
-
});
|
|
50
|
+
className: u,
|
|
51
|
+
...c
|
|
52
|
+
}), n[6] = l, n[7] = c, n[8] = u, n[9] = d) : d = n[9], d;
|
|
34
53
|
}
|
|
35
|
-
function
|
|
36
|
-
|
|
54
|
+
function d(t) {
|
|
55
|
+
let n = a(8), i, o;
|
|
56
|
+
n[0] === t ? (i = n[1], o = n[2]) : ({className: i, ...o} = t, n[0] = t, n[1] = i, n[2] = o);
|
|
57
|
+
let s;
|
|
58
|
+
n[3] === i ? s = n[4] : (s = e("text-foreground font-normal", i), n[3] = i, n[4] = s);
|
|
59
|
+
let c;
|
|
60
|
+
return n[5] !== o || n[6] !== s ? (c = /* @__PURE__ */ r("span", {
|
|
37
61
|
"data-slot": "breadcrumb-page",
|
|
38
62
|
role: "link",
|
|
39
63
|
"aria-disabled": "true",
|
|
40
64
|
"aria-current": "page",
|
|
41
|
-
className:
|
|
42
|
-
...
|
|
43
|
-
});
|
|
65
|
+
className: s,
|
|
66
|
+
...o
|
|
67
|
+
}), n[5] = o, n[6] = s, n[7] = c) : c = n[7], c;
|
|
44
68
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
69
|
+
function f(n) {
|
|
70
|
+
let i = a(12), o, s, c;
|
|
71
|
+
i[0] === n ? (o = i[1], s = i[2], c = i[3]) : ({children: o, className: s, ...c} = n, i[0] = n, i[1] = o, i[2] = s, i[3] = c);
|
|
72
|
+
let l;
|
|
73
|
+
i[4] === s ? l = i[5] : (l = e("[&>svg]:size-3.5", s), i[4] = s, i[5] = l);
|
|
74
|
+
let u;
|
|
75
|
+
i[6] === o ? u = i[7] : (u = o ?? /* @__PURE__ */ r(t, {}), i[6] = o, i[7] = u);
|
|
76
|
+
let d;
|
|
77
|
+
return i[8] !== c || i[9] !== l || i[10] !== u ? (d = /* @__PURE__ */ r("li", {
|
|
47
78
|
"data-slot": "breadcrumb-separator",
|
|
48
79
|
role: "presentation",
|
|
49
80
|
"aria-hidden": "true",
|
|
50
|
-
className:
|
|
51
|
-
...
|
|
52
|
-
children:
|
|
53
|
-
});
|
|
81
|
+
className: l,
|
|
82
|
+
...c,
|
|
83
|
+
children: u
|
|
84
|
+
}), i[8] = c, i[9] = l, i[10] = u, i[11] = d) : d = i[11], d;
|
|
54
85
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
86
|
+
function p(t) {
|
|
87
|
+
let o = a(10), s, c;
|
|
88
|
+
o[0] === t ? (s = o[1], c = o[2]) : ({className: s, ...c} = t, o[0] = t, o[1] = s, o[2] = c);
|
|
89
|
+
let l;
|
|
90
|
+
o[3] === s ? l = o[4] : (l = e("flex size-9 items-center justify-center", s), o[3] = s, o[4] = l);
|
|
91
|
+
let u, d;
|
|
92
|
+
o[5] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ r(n, { className: "size-4" }), d = /* @__PURE__ */ r("span", {
|
|
93
|
+
className: "sr-only",
|
|
94
|
+
children: "More"
|
|
95
|
+
}), o[5] = u, o[6] = d) : (u = o[5], d = o[6]);
|
|
96
|
+
let f;
|
|
97
|
+
return o[7] !== c || o[8] !== l ? (f = /* @__PURE__ */ i("span", {
|
|
57
98
|
"data-slot": "breadcrumb-ellipsis",
|
|
58
99
|
role: "presentation",
|
|
59
100
|
"aria-hidden": "true",
|
|
60
|
-
className:
|
|
61
|
-
...
|
|
62
|
-
children: [
|
|
63
|
-
|
|
64
|
-
children: "More"
|
|
65
|
-
})]
|
|
66
|
-
});
|
|
101
|
+
className: l,
|
|
102
|
+
...c,
|
|
103
|
+
children: [u, d]
|
|
104
|
+
}), o[7] = c, o[8] = l, o[9] = f) : f = o[9], f;
|
|
67
105
|
}
|
|
68
106
|
//#endregion
|
|
69
|
-
export {
|
|
107
|
+
export { s as Breadcrumb, p as BreadcrumbEllipsis, l as BreadcrumbItem, u as BreadcrumbLink, c as BreadcrumbList, d as BreadcrumbPage, f as BreadcrumbSeparator };
|
package/dist/index200.js
CHANGED
|
@@ -3,28 +3,44 @@ import { FileUploadDropzone as t, FileUploadItem as n, FileUploadItemDelete as r
|
|
|
3
3
|
import { CameraIcon as u, CloudUploadIcon as d, Trash2Icon as f } from "lucide-react";
|
|
4
4
|
import { useEffect as p, useRef as m } from "react";
|
|
5
5
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
6
|
+
import { c as v } from "react/compiler-runtime";
|
|
6
7
|
//#region src/Form/FormFileUpload/FileUpload.tsx
|
|
7
|
-
function
|
|
8
|
-
let
|
|
9
|
-
return
|
|
10
|
-
if (!
|
|
11
|
-
let
|
|
12
|
-
if (
|
|
13
|
-
let
|
|
14
|
-
return
|
|
8
|
+
function y(e) {
|
|
9
|
+
let t = v(6), { onChange: n, autoUpload: r, maxFiles: i } = e, a = l(w), o = m(null), s, c;
|
|
10
|
+
return t[0] !== r || t[1] !== i || t[2] !== n || t[3] !== a ? (s = () => {
|
|
11
|
+
if (!n) return;
|
|
12
|
+
let e = Array.from(a.files.values()), t = (() => {
|
|
13
|
+
if (r) {
|
|
14
|
+
let t = e.filter(C).map(S).filter(x);
|
|
15
|
+
return i === 1 ? t.length > 0 ? t[t.length - 1] : null : t;
|
|
15
16
|
}
|
|
16
|
-
let
|
|
17
|
-
return
|
|
18
|
-
})(), s =
|
|
19
|
-
(
|
|
20
|
-
}, [
|
|
17
|
+
let t = e.map(b);
|
|
18
|
+
return i === 1 ? t.length > 0 ? t[t.length - 1] : null : t;
|
|
19
|
+
})(), s = o.current;
|
|
20
|
+
(r ? JSON.stringify(s) === JSON.stringify(t) : Array.isArray(t) && Array.isArray(s) ? t.length === s.length && t.every((e, t) => e === s[t]) : t === s) || (o.current = t, n(t));
|
|
21
|
+
}, c = [
|
|
22
|
+
a,
|
|
21
23
|
r,
|
|
22
|
-
|
|
23
|
-
n
|
|
24
|
-
|
|
25
|
-
]), null;
|
|
24
|
+
i,
|
|
25
|
+
n
|
|
26
|
+
], t[0] = r, t[1] = i, t[2] = n, t[3] = a, t[4] = s, t[5] = c) : (s = t[4], c = t[5]), p(s, c), null;
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function b(e) {
|
|
29
|
+
return e.file;
|
|
30
|
+
}
|
|
31
|
+
function x(e) {
|
|
32
|
+
return !!e;
|
|
33
|
+
}
|
|
34
|
+
function S(e) {
|
|
35
|
+
return e.file.uploadedUrl;
|
|
36
|
+
}
|
|
37
|
+
function C(e) {
|
|
38
|
+
return e.status === "success";
|
|
39
|
+
}
|
|
40
|
+
function w(e) {
|
|
41
|
+
return e;
|
|
42
|
+
}
|
|
43
|
+
function T(e, t = "") {
|
|
28
44
|
let n = e.split("/").pop()?.split("?")[0] || "file", r = n.split(".").pop()?.toLowerCase(), i = r && {
|
|
29
45
|
jpg: "image/jpeg",
|
|
30
46
|
jpeg: "image/jpeg",
|
|
@@ -36,20 +52,20 @@ function y(e, t = "") {
|
|
|
36
52
|
let a = new File([""], n, { type: i });
|
|
37
53
|
return a.isUploadedUrl = !0, a.uploadedUrl = e, a;
|
|
38
54
|
}
|
|
39
|
-
function
|
|
40
|
-
let D = (Array.isArray(l) ? l : l ? [l] : []).map((e) => e instanceof File ? e : typeof e == "string" ?
|
|
55
|
+
function E({ value: l, onChange: p, autoUpload: m = !1, uploadFile: v, maxFiles: b = 1, maxSize: x = 1024 * 1024 * 5, accept: S = "image/*", disabled: C, className: w, variant: E = "default" }) {
|
|
56
|
+
let D = (Array.isArray(l) ? l : l ? [l] : []).map((e) => e instanceof File ? e : typeof e == "string" ? T(e, S) : e);
|
|
41
57
|
return /* @__PURE__ */ _(c, {
|
|
42
58
|
value: D,
|
|
43
|
-
maxFiles: E === "avatar" ? 1 :
|
|
44
|
-
maxSize:
|
|
45
|
-
accept:
|
|
46
|
-
disabled:
|
|
59
|
+
maxFiles: E === "avatar" ? 1 : b,
|
|
60
|
+
maxSize: x,
|
|
61
|
+
accept: S,
|
|
62
|
+
disabled: C,
|
|
47
63
|
onUpload: async (e, t) => {
|
|
48
64
|
if (!m) {
|
|
49
65
|
e.forEach((e) => t.onSuccess(e));
|
|
50
66
|
return;
|
|
51
67
|
}
|
|
52
|
-
if (!
|
|
68
|
+
if (!v) {
|
|
53
69
|
console.warn("uploadFile prop is required when autoUpload is true"), e.forEach((e) => t.onError(e, /* @__PURE__ */ Error("Missing uploadFile function")));
|
|
54
70
|
return;
|
|
55
71
|
}
|
|
@@ -60,17 +76,17 @@ function b({ value: l, onChange: p, autoUpload: m = !1, uploadFile: b, maxFiles:
|
|
|
60
76
|
return;
|
|
61
77
|
}
|
|
62
78
|
try {
|
|
63
|
-
t.onProgress(e, 20), n.uploadedUrl = await
|
|
79
|
+
t.onProgress(e, 20), n.uploadedUrl = await v(e), t.onProgress(e, 100), t.onSuccess(e);
|
|
64
80
|
} catch (n) {
|
|
65
81
|
t.onError(e, n instanceof Error ? n : /* @__PURE__ */ Error("Upload failed"));
|
|
66
82
|
}
|
|
67
83
|
}));
|
|
68
84
|
},
|
|
69
|
-
className:
|
|
70
|
-
children: [/* @__PURE__ */ g(
|
|
85
|
+
className: w,
|
|
86
|
+
children: [/* @__PURE__ */ g(y, {
|
|
71
87
|
onChange: p,
|
|
72
88
|
autoUpload: m,
|
|
73
|
-
maxFiles: E === "avatar" ? 1 :
|
|
89
|
+
maxFiles: E === "avatar" ? 1 : b
|
|
74
90
|
}), E === "avatar" ? /* @__PURE__ */ _("div", {
|
|
75
91
|
className: "flex flex-col items-center gap-2",
|
|
76
92
|
children: [/* @__PURE__ */ g(t, {
|
|
@@ -115,7 +131,7 @@ function b({ value: l, onChange: p, autoUpload: m = !1, uploadFile: b, maxFiles:
|
|
|
115
131
|
})
|
|
116
132
|
}), /* @__PURE__ */ g("div", {
|
|
117
133
|
className: "text-xs text-muted-foreground",
|
|
118
|
-
children:
|
|
134
|
+
children: x ? `Max ${Math.round(x / (1024 * 1024))}MB` : ""
|
|
119
135
|
})]
|
|
120
136
|
}) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(t, { children: [
|
|
121
137
|
/* @__PURE__ */ g(d, { className: "h-10 w-10 text-muted-foreground" }),
|
|
@@ -126,9 +142,9 @@ function b({ value: l, onChange: p, autoUpload: m = !1, uploadFile: b, maxFiles:
|
|
|
126
142
|
/* @__PURE__ */ _("p", {
|
|
127
143
|
className: "text-xs text-muted-foreground",
|
|
128
144
|
children: [
|
|
129
|
-
|
|
145
|
+
b > 1 ? `Up to ${b} files` : "1 file max",
|
|
130
146
|
" ",
|
|
131
|
-
|
|
147
|
+
x ? `(Max ${Math.round(x / (1024 * 1024))}MB)` : ""
|
|
132
148
|
]
|
|
133
149
|
})
|
|
134
150
|
] }), /* @__PURE__ */ g(s, { children: D.map((t, s) => /* @__PURE__ */ _(n, {
|
|
@@ -158,4 +174,4 @@ function b({ value: l, onChange: p, autoUpload: m = !1, uploadFile: b, maxFiles:
|
|
|
158
174
|
});
|
|
159
175
|
}
|
|
160
176
|
//#endregion
|
|
161
|
-
export {
|
|
177
|
+
export { E as FileUpload };
|
package/dist/index201.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./index11.cjs"),t=require("./index83.cjs");let n=require("lucide-react"),r=require("react"),i=require("react/jsx-runtime");function a({onChange:
|
|
1
|
+
const e=require("./index11.cjs"),t=require("./index83.cjs");let n=require("lucide-react"),r=require("react"),i=require("react/jsx-runtime"),a=require("react/compiler-runtime");function o(e){let n=(0,a.c)(6),{onChange:i,autoUpload:o,maxFiles:f}=e,p=t.useStore(d),m=(0,r.useRef)(null),h,g;return n[0]!==o||n[1]!==f||n[2]!==i||n[3]!==p?(h=()=>{if(!i)return;let e=Array.from(p.files.values()),t=(()=>{if(o){let t=e.filter(u).map(l).filter(c);return f===1?t.length>0?t[t.length-1]:null:t}let t=e.map(s);return f===1?t.length>0?t[t.length-1]:null:t})(),n=m.current;(o?JSON.stringify(n)===JSON.stringify(t):Array.isArray(t)&&Array.isArray(n)?t.length===n.length&&t.every((e,t)=>e===n[t]):t===n)||(m.current=t,i(t))},g=[p,o,f,i],n[0]=o,n[1]=f,n[2]=i,n[3]=p,n[4]=h,n[5]=g):(h=n[4],g=n[5]),(0,r.useEffect)(h,g),null}function s(e){return e.file}function c(e){return!!e}function l(e){return e.file.uploadedUrl}function u(e){return e.status===`success`}function d(e){return e}function f(e,t=``){let n=e.split(`/`).pop()?.split(`?`)[0]||`file`,r=n.split(`.`).pop()?.toLowerCase(),i=r&&{jpg:`image/jpeg`,jpeg:`image/jpeg`,png:`image/png`,gif:`image/gif`,webp:`image/webp`}[r];i||=t.includes(`image`)?`image/jpeg`:`application/octet-stream`;let a=new File([``],n,{type:i});return a.isUploadedUrl=!0,a.uploadedUrl=e,a}function p({value:r,onChange:a,autoUpload:s=!1,uploadFile:c,maxFiles:l=1,maxSize:u=1024*1024*5,accept:d=`image/*`,disabled:p,className:m,variant:h=`default`}){let g=(Array.isArray(r)?r:r?[r]:[]).map(e=>e instanceof File?e:typeof e==`string`?f(e,d):e);return(0,i.jsxs)(t.FileUploadRoot,{value:g,maxFiles:h===`avatar`?1:l,maxSize:u,accept:d,disabled:p,onUpload:async(e,t)=>{if(!s){e.forEach(e=>t.onSuccess(e));return}if(!c){console.warn(`uploadFile prop is required when autoUpload is true`),e.forEach(e=>t.onError(e,Error(`Missing uploadFile function`)));return}await Promise.all(e.map(async e=>{let n=e;if(n.isUploadedUrl){t.onSuccess(e);return}try{t.onProgress(e,20),n.uploadedUrl=await c(e),t.onProgress(e,100),t.onSuccess(e)}catch(n){t.onError(e,n instanceof Error?n:Error(`Upload failed`))}}))},className:m,children:[(0,i.jsx)(o,{onChange:a,autoUpload:s,maxFiles:h===`avatar`?1:l}),h===`avatar`?(0,i.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,i.jsx)(t.FileUploadDropzone,{className:`group relative size-32 cursor-pointer overflow-hidden rounded-full border-2 border-dashed border-border p-0 hover:border-primary`,children:g[0]?(0,i.jsxs)(t.FileUploadItem,{value:g[0],className:`relative flex size-full flex-col rounded-none border-none p-0`,children:[(0,i.jsx)(t.FileUploadItemPreview,{className:`size-full rounded-none border-none bg-transparent`,render:e=>{let t=e.uploadedUrl;return t?(0,i.jsx)(`img`,{src:t,alt:`Avatar`,className:`size-full object-cover`}):(0,i.jsx)(`img`,{src:URL.createObjectURL(e),alt:`Avatar`,className:`size-full object-cover`})}}),(0,i.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-1 bg-black/40 opacity-0 transition-opacity group-hover:opacity-100`,children:[(0,i.jsx)(n.CameraIcon,{className:`size-6 text-white`}),(0,i.jsx)(`span`,{className:`text-[10px] text-white`,children:`Đổi ảnh`})]}),(0,i.jsx)(t.FileUploadItemProgress,{variant:`fill`,className:`opacity-50`})]}):(0,i.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-1 bg-accent text-muted-foreground transition-colors group-hover:bg-accent/80`,children:[(0,i.jsx)(n.CameraIcon,{className:`size-6`}),(0,i.jsx)(`span`,{className:`text-[10px]`,children:`Tải lên`})]})}),(0,i.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:u?`Max ${Math.round(u/(1024*1024))}MB`:``})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.FileUploadDropzone,{children:[(0,i.jsx)(n.CloudUploadIcon,{className:`h-10 w-10 text-muted-foreground`}),(0,i.jsx)(`p`,{className:`text-sm font-medium`,children:`Drag & drop files here, or click to select`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[l>1?`Up to ${l} files`:`1 file max`,` `,u?`(Max ${Math.round(u/(1024*1024))}MB)`:``]})]}),(0,i.jsx)(t.FileUploadList,{children:g.map((r,a)=>(0,i.jsxs)(t.FileUploadItem,{value:r,children:[(0,i.jsx)(t.FileUploadItemPreview,{render:(e,t)=>{let n=e.uploadedUrl;return n&&e.type.startsWith(`image/`)?(0,i.jsx)(`img`,{src:n,alt:e.name,className:`size-full object-cover`}):t()}}),(0,i.jsx)(t.FileUploadItemMetadata,{}),(0,i.jsx)(t.FileUploadItemProgress,{className:`absolute bottom-0 left-0 right-0 h-1 w-auto rounded-none`}),(0,i.jsx)(t.FileUploadItemDelete,{asChild:!0,children:(0,i.jsx)(e.Button,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground hover:text-destructive`,children:(0,i.jsx)(n.Trash2Icon,{className:`h-4 w-4`})})})]},a))})]})]})}exports.FileUpload=p;
|
package/dist/index201.js
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { FormBase as e } from "./index135.js";
|
|
2
2
|
import { FileUpload as t } from "./index200.js";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { c as r } from "react/compiler-runtime";
|
|
4
5
|
//#region src/Form/FormFileUpload/index.tsx
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
var i = (i) => {
|
|
7
|
+
let a = r(5), o;
|
|
8
|
+
a[0] === i ? o = a[1] : (o = (e) => {
|
|
9
|
+
let { onChange: r, value: a, disabled: o } = e;
|
|
10
|
+
return /* @__PURE__ */ n(t, {
|
|
11
|
+
...i,
|
|
12
|
+
value: a,
|
|
13
|
+
onChange: r,
|
|
14
|
+
disabled: o || i.disabled,
|
|
15
|
+
className: i.className
|
|
16
|
+
});
|
|
17
|
+
}, a[0] = i, a[1] = o);
|
|
18
|
+
let s;
|
|
19
|
+
return a[2] !== i || a[3] !== o ? (s = /* @__PURE__ */ n(e, {
|
|
20
|
+
...i,
|
|
21
|
+
children: o
|
|
22
|
+
}), a[2] = i, a[3] = o, a[4] = s) : s = a[4], s;
|
|
23
|
+
};
|
|
15
24
|
//#endregion
|
|
16
|
-
export {
|
|
25
|
+
export { i as default };
|
package/dist/index202.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./index136.cjs"),t=require("./index201.cjs");let n=require("react/jsx-runtime");var
|
|
1
|
+
const e=require("./index136.cjs"),t=require("./index201.cjs");let n=require("react/jsx-runtime"),r=require("react/compiler-runtime");var i=i=>{let a=(0,r.c)(5),o;a[0]===i?o=a[1]:(o=e=>{let{onChange:r,value:a,disabled:o}=e;return(0,n.jsx)(t.FileUpload,{...i,value:a,onChange:r,disabled:o||i.disabled,className:i.className})},a[0]=i,a[1]=o);let s;return a[2]!==i||a[3]!==o?(s=(0,n.jsx)(e.FormBase,{...i,children:o}),a[2]=i,a[3]=o,a[4]=s):s=a[4],s};exports.default=i;
|
package/dist/index21.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./index2.cjs"),t=require("./index4.cjs");let n=require("lucide-react"),r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime"),a=require("@radix-ui/react-slot");function
|
|
1
|
+
const e=require("./index2.cjs"),t=require("./index4.cjs");let n=require("lucide-react"),r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime"),a=require("react/compiler-runtime"),o=require("@radix-ui/react-slot");function s(e){let t=(0,a.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,i.jsx)(`nav`,{"aria-label":`breadcrumb`,"data-slot":`breadcrumb`,...n}),t[2]=n,t[3]=r),r}function c(e){let n=(0,a.c)(8),r,o;n[0]===e?(r=n[1],o=n[2]):({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o);let s;n[3]===r?s=n[4]:(s=t.cn(`text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5`,r),n[3]=r,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:s,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}function l(e){let n=(0,a.c)(8),r,o;n[0]===e?(r=n[1],o=n[2]):({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o);let s;n[3]===r?s=n[4]:(s=t.cn(`inline-flex items-center gap-1.5`,r),n[3]=r,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:s,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}function u(e){let n=(0,a.c)(10),r,s,c;n[0]===e?(r=n[1],s=n[2],c=n[3]):({asChild:r,className:s,...c}=e,n[0]=e,n[1]=r,n[2]=s,n[3]=c);let l=r?o.Slot:`a`,u;n[4]===s?u=n[5]:(u=t.cn(`hover:text-foreground transition-colors`,s),n[4]=s,n[5]=u);let d;return n[6]!==l||n[7]!==c||n[8]!==u?(d=(0,i.jsx)(l,{"data-slot":`breadcrumb-link`,className:u,...c}),n[6]=l,n[7]=c,n[8]=u,n[9]=d):d=n[9],d}function d(e){let n=(0,a.c)(8),r,o;n[0]===e?(r=n[1],o=n[2]):({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o);let s;n[3]===r?s=n[4]:(s=t.cn(`text-foreground font-normal`,r),n[3]=r,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`span`,{"data-slot":`breadcrumb-page`,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:s,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}function f(e){let r=(0,a.c)(12),o,s,c;r[0]===e?(o=r[1],s=r[2],c=r[3]):({children:o,className:s,...c}=e,r[0]=e,r[1]=o,r[2]=s,r[3]=c);let l;r[4]===s?l=r[5]:(l=t.cn(`[&>svg]:size-3.5`,s),r[4]=s,r[5]=l);let u;r[6]===o?u=r[7]:(u=o??(0,i.jsx)(n.ChevronRight,{}),r[6]=o,r[7]=u);let d;return r[8]!==c||r[9]!==l||r[10]!==u?(d=(0,i.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:l,...c,children:u}),r[8]=c,r[9]=l,r[10]=u,r[11]=d):d=r[11],d}function p(e){let r=(0,a.c)(10),o,s;r[0]===e?(o=r[1],s=r[2]):({className:o,...s}=e,r[0]=e,r[1]=o,r[2]=s);let c;r[3]===o?c=r[4]:(c=t.cn(`flex size-9 items-center justify-center`,o),r[3]=o,r[4]=c);let l,u;r[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,i.jsx)(n.MoreHorizontal,{className:`size-4`}),u=(0,i.jsx)(`span`,{className:`sr-only`,children:`More`}),r[5]=l,r[6]=u):(l=r[5],u=r[6]);let d;return r[7]!==s||r[8]!==c?(d=(0,i.jsxs)(`span`,{"data-slot":`breadcrumb-ellipsis`,role:`presentation`,"aria-hidden":`true`,className:c,...s,children:[l,u]}),r[7]=s,r[8]=c,r[9]=d):d=r[9],d}exports.Breadcrumb=s,exports.BreadcrumbEllipsis=p,exports.BreadcrumbItem=l,exports.BreadcrumbLink=u,exports.BreadcrumbList=c,exports.BreadcrumbPage=d,exports.BreadcrumbSeparator=f;
|
package/dist/index21.js
CHANGED
|
@@ -4,14 +4,15 @@ import { Button as t, buttonVariants as n } from "./index10.js";
|
|
|
4
4
|
import { ChevronDownIcon as r, ChevronLeftIcon as i, ChevronRightIcon as a } from "lucide-react";
|
|
5
5
|
import * as o from "react";
|
|
6
6
|
import { jsx as s } from "react/jsx-runtime";
|
|
7
|
-
import {
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
8
|
+
import { DayPicker as l, getDefaultClassNames as u } from "react-day-picker";
|
|
8
9
|
//#region src/ui/calendar.tsx
|
|
9
|
-
function
|
|
10
|
-
let _ =
|
|
11
|
-
return /* @__PURE__ */ s(
|
|
12
|
-
showOutsideDays:
|
|
10
|
+
function d({ className: t, classNames: o, showOutsideDays: c = !0, captionLayout: d = "label", buttonVariant: p = "ghost", formatters: m, components: h, ...g }) {
|
|
11
|
+
let _ = u();
|
|
12
|
+
return /* @__PURE__ */ s(l, {
|
|
13
|
+
showOutsideDays: c,
|
|
13
14
|
className: e("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, t),
|
|
14
|
-
captionLayout:
|
|
15
|
+
captionLayout: d,
|
|
15
16
|
formatters: {
|
|
16
17
|
formatMonthDropdown: (e) => e.toLocaleString("default", { month: "short" }),
|
|
17
18
|
...m
|
|
@@ -27,7 +28,7 @@ function u({ className: t, classNames: o, showOutsideDays: u = !0, captionLayout
|
|
|
27
28
|
dropdowns: e("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5", _.dropdowns),
|
|
28
29
|
dropdown_root: e("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md", _.dropdown_root),
|
|
29
30
|
dropdown: e("absolute bg-popover inset-0 opacity-0", _.dropdown),
|
|
30
|
-
caption_label: e("select-none font-medium",
|
|
31
|
+
caption_label: e("select-none font-medium", d === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5", _.caption_label),
|
|
31
32
|
weekdays: e("flex", _.weekdays),
|
|
32
33
|
weekday: e("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none", _.weekday),
|
|
33
34
|
week: e("flex w-full mt-2", _.week),
|
|
@@ -54,7 +55,7 @@ function u({ className: t, classNames: o, showOutsideDays: u = !0, captionLayout
|
|
|
54
55
|
className: e("size-4", t),
|
|
55
56
|
...o
|
|
56
57
|
}),
|
|
57
|
-
DayButton:
|
|
58
|
+
DayButton: f,
|
|
58
59
|
WeekNumber: ({ children: e, ...t }) => /* @__PURE__ */ s("td", {
|
|
59
60
|
...t,
|
|
60
61
|
children: /* @__PURE__ */ s("div", {
|
|
@@ -67,22 +68,28 @@ function u({ className: t, classNames: o, showOutsideDays: u = !0, captionLayout
|
|
|
67
68
|
...g
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
function f(n) {
|
|
72
|
+
let r = c(19), i, a, l, d;
|
|
73
|
+
r[0] === n ? (i = r[1], a = r[2], l = r[3], d = r[4]) : ({className: i, day: a, modifiers: l, ...d} = n, r[0] = n, r[1] = i, r[2] = a, r[3] = l, r[4] = d);
|
|
74
|
+
let f = u(), p = o.useRef(null), m, h;
|
|
75
|
+
r[5] === l.focused ? (m = r[6], h = r[7]) : (m = () => {
|
|
76
|
+
l.focused && p.current?.focus();
|
|
77
|
+
}, h = [l.focused], r[5] = l.focused, r[6] = m, r[7] = h), o.useEffect(m, h);
|
|
78
|
+
let g = t, _;
|
|
79
|
+
r[8] === a.date ? _ = r[9] : (_ = a.date.toLocaleDateString(), r[8] = a.date, r[9] = _);
|
|
80
|
+
let v = l.selected && !l.range_start && !l.range_end && !l.range_middle, y = l.range_start, b = l.range_end, x = l.range_middle, S = e("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70", f.day, i), C;
|
|
81
|
+
return r[10] !== g || r[11] !== l.range_end || r[12] !== l.range_middle || r[13] !== l.range_start || r[14] !== d || r[15] !== S || r[16] !== _ || r[17] !== v ? (C = /* @__PURE__ */ s(g, {
|
|
82
|
+
ref: p,
|
|
76
83
|
variant: "ghost",
|
|
77
84
|
size: "icon",
|
|
78
|
-
"data-day":
|
|
79
|
-
"data-selected-single":
|
|
80
|
-
"data-range-start":
|
|
81
|
-
"data-range-end":
|
|
82
|
-
"data-range-middle":
|
|
83
|
-
className:
|
|
84
|
-
...
|
|
85
|
-
});
|
|
85
|
+
"data-day": _,
|
|
86
|
+
"data-selected-single": v,
|
|
87
|
+
"data-range-start": y,
|
|
88
|
+
"data-range-end": b,
|
|
89
|
+
"data-range-middle": x,
|
|
90
|
+
className: S,
|
|
91
|
+
...d
|
|
92
|
+
}), r[10] = g, r[11] = l.range_end, r[12] = l.range_middle, r[13] = l.range_start, r[14] = d, r[15] = S, r[16] = _, r[17] = v, r[18] = C) : C = r[18], C;
|
|
86
93
|
}
|
|
87
94
|
//#endregion
|
|
88
|
-
export {
|
|
95
|
+
export { d as Calendar, f as CalendarDayButton };
|
package/dist/index22.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./index11.cjs");let r=require("lucide-react"),i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("react-day-picker");function
|
|
1
|
+
"use client";const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./index11.cjs");let r=require("lucide-react"),i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("react/compiler-runtime"),s=require("react-day-picker");function c({className:e,classNames:i,showOutsideDays:o=!0,captionLayout:c=`label`,buttonVariant:u=`ghost`,formatters:d,components:f,...p}){let m=(0,s.getDefaultClassNames)();return(0,a.jsx)(s.DayPicker,{showOutsideDays:o,className:t.cn(`bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent`,String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:c,formatters:{formatMonthDropdown:e=>e.toLocaleString(`default`,{month:`short`}),...d},classNames:{root:t.cn(`w-fit`,m.root),months:t.cn(`flex gap-4 flex-col md:flex-row relative`,m.months),month:t.cn(`flex flex-col w-full gap-4`,m.month),nav:t.cn(`flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between`,m.nav),button_previous:t.cn(n.buttonVariants({variant:u}),`size-(--cell-size) aria-disabled:opacity-50 p-0 select-none`,m.button_previous),button_next:t.cn(n.buttonVariants({variant:u}),`size-(--cell-size) aria-disabled:opacity-50 p-0 select-none`,m.button_next),month_caption:t.cn(`flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)`,m.month_caption),dropdowns:t.cn(`w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5`,m.dropdowns),dropdown_root:t.cn(`relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md`,m.dropdown_root),dropdown:t.cn(`absolute bg-popover inset-0 opacity-0`,m.dropdown),caption_label:t.cn(`select-none font-medium`,c===`label`?`text-sm`:`rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5`,m.caption_label),weekdays:t.cn(`flex`,m.weekdays),weekday:t.cn(`text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none`,m.weekday),week:t.cn(`flex w-full mt-2`,m.week),week_number_header:t.cn(`select-none w-(--cell-size)`,m.week_number_header),week_number:t.cn(`text-[0.8rem] select-none text-muted-foreground`,m.week_number),day:t.cn(`relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none`,p.showWeekNumber?`[&:nth-child(2)[data-selected=true]_button]:rounded-l-md`:`[&:first-child[data-selected=true]_button]:rounded-l-md`,m.day),range_start:t.cn(`rounded-l-md bg-accent`,m.range_start),range_middle:t.cn(`rounded-none`,m.range_middle),range_end:t.cn(`rounded-r-md bg-accent`,m.range_end),today:t.cn(`bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none`,m.today),outside:t.cn(`text-muted-foreground aria-selected:text-muted-foreground`,m.outside),disabled:t.cn(`text-muted-foreground opacity-50`,m.disabled),hidden:t.cn(`invisible`,m.hidden),...i},components:{Root:({className:e,rootRef:n,...r})=>(0,a.jsx)(`div`,{"data-slot":`calendar`,ref:n,className:t.cn(e),...r}),Chevron:({className:e,orientation:n,...i})=>n===`left`?(0,a.jsx)(r.ChevronLeftIcon,{className:t.cn(`size-4`,e),...i}):n===`right`?(0,a.jsx)(r.ChevronRightIcon,{className:t.cn(`size-4`,e),...i}):(0,a.jsx)(r.ChevronDownIcon,{className:t.cn(`size-4`,e),...i}),DayButton:l,WeekNumber:({children:e,...t})=>(0,a.jsx)(`td`,{...t,children:(0,a.jsx)(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:e})}),...f},...p})}function l(e){let r=(0,o.c)(19),c,l,u,d;r[0]===e?(c=r[1],l=r[2],u=r[3],d=r[4]):({className:c,day:l,modifiers:u,...d}=e,r[0]=e,r[1]=c,r[2]=l,r[3]=u,r[4]=d);let f=(0,s.getDefaultClassNames)(),p=i.useRef(null),m,h;r[5]===u.focused?(m=r[6],h=r[7]):(m=()=>{u.focused&&p.current?.focus()},h=[u.focused],r[5]=u.focused,r[6]=m,r[7]=h),i.useEffect(m,h);let g=n.Button,_;r[8]===l.date?_=r[9]:(_=l.date.toLocaleDateString(),r[8]=l.date,r[9]=_);let v=u.selected&&!u.range_start&&!u.range_end&&!u.range_middle,y=u.range_start,b=u.range_end,x=u.range_middle,S=t.cn(`data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70`,f.day,c),C;return r[10]!==g||r[11]!==u.range_end||r[12]!==u.range_middle||r[13]!==u.range_start||r[14]!==d||r[15]!==S||r[16]!==_||r[17]!==v?(C=(0,a.jsx)(g,{ref:p,variant:`ghost`,size:`icon`,"data-day":_,"data-selected-single":v,"data-range-start":y,"data-range-end":b,"data-range-middle":x,className:S,...d}),r[10]=g,r[11]=u.range_end,r[12]=u.range_middle,r[13]=u.range_start,r[14]=d,r[15]=S,r[16]=_,r[17]=v,r[18]=C):C=r[18],C}exports.Calendar=c,exports.CalendarDayButton=l;
|