@rafal.lemieszewski/tide-ui 0.85.1 → 0.87.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/cjs/components/fundamental/breadcrumb.cjs +1 -1
- package/dist/cjs/components/fundamental/button.cjs +1 -1
- package/dist/cjs/components/fundamental/calendar.cjs +1 -1
- package/dist/cjs/components/fundamental/country-dropdown.cjs +1 -1
- package/dist/cjs/components/fundamental/custom-icons.cjs +1 -1
- package/dist/cjs/components/fundamental/dialog.cjs +1 -1
- package/dist/cjs/components/fundamental/file-upload.cjs +1 -1
- package/dist/cjs/components/fundamental/icon.cjs +1 -1
- package/dist/cjs/components/fundamental/month-picker.cjs +1 -1
- package/dist/cjs/components/fundamental/pagination.cjs +1 -1
- package/dist/cjs/components/fundamental/select.cjs +1 -1
- package/dist/cjs/components/fundamental/separator.cjs +1 -1
- package/dist/cjs/components/fundamental/sidebar.cjs +1 -1
- package/dist/cjs/components/fundamental/toast.cjs +1 -1
- package/dist/cjs/components/fundamental/tree.cjs +1 -1
- package/dist/cjs/components/product/app-frame.cjs +1 -1
- package/dist/cjs/components/product/attributes-list.cjs +1 -1
- package/dist/cjs/components/product/bookmarks.cjs +1 -1
- package/dist/cjs/components/product/data-table-settings-menu.cjs +1 -1
- package/dist/cjs/components/product/data-table.cjs +1 -1
- package/dist/cjs/components/product/filters.cjs +1 -1
- package/dist/cjs/components/product/fixture-status.cjs +1 -1
- package/dist/cjs/components/product/linked-chart.cjs +1 -1
- package/dist/cjs/components/product/view-mode-menu.cjs +1 -1
- package/dist/es/components/fundamental/button.js +10 -9
- package/dist/es/components/fundamental/calendar.js +18 -17
- package/dist/es/components/fundamental/custom-icons.js +283 -517
- package/dist/es/components/fundamental/dialog.js +25 -24
- package/dist/es/components/fundamental/file-upload.js +17 -16
- package/dist/es/components/fundamental/icon.js +68 -147
- package/dist/es/components/fundamental/month-picker.js +21 -20
- package/dist/es/components/fundamental/pagination.js +44 -43
- package/dist/es/components/fundamental/select.js +40 -39
- package/dist/es/components/fundamental/separator.js +11 -10
- package/dist/es/components/fundamental/sidebar.js +85 -84
- package/dist/es/components/fundamental/toast.js +8 -7
- package/dist/es/components/product/app-frame.js +83 -82
- package/dist/es/components/product/attributes-list.js +61 -60
- package/dist/es/components/product/bookmarks.js +170 -169
- package/dist/es/components/product/data-table-settings-menu.js +38 -37
- package/dist/es/components/product/data-table.js +374 -373
- package/dist/es/components/product/filters.js +93 -92
- package/dist/es/components/product/fixture-status.js +89 -87
- package/dist/es/components/product/linked-chart.js +54 -53
- package/dist/es/components/product/view-mode-menu.js +176 -175
- package/dist/types/components/core-index.d.cts +1 -1
- package/dist/types/components/core-index.d.ts +1 -1
- package/dist/types/components/fundamental/custom-icons.d.ts +32 -36
- package/dist/types/components/fundamental/dropdown-menu.d.ts +2 -1
- package/dist/types/components/fundamental/icon.d.ts +1 -3
- package/dist/types/components/index.d.ts +2 -1
- package/dist/types/components/product/fixture-status.d.ts +2 -2
- package/dist/types/lib/index.d.cts +1 -1
- package/dist/types/lib/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,10 @@ import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
|
2
2
|
import * as i from "react";
|
|
3
3
|
import * as o from "@radix-ui/react-dialog";
|
|
4
4
|
import { cn as r } from "../../lib/utils.js";
|
|
5
|
-
import { Icon as
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { Icon as m } from "./icon.js";
|
|
6
|
+
import { X as n } from "lucide-react";
|
|
7
|
+
import { Button as p } from "./button.js";
|
|
8
|
+
const C = o.Root, z = o.Trigger, f = o.Portal, R = o.Close, d = /* @__PURE__ */ i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ t(
|
|
8
9
|
o.Overlay,
|
|
9
10
|
{
|
|
10
11
|
ref: s,
|
|
@@ -16,7 +17,7 @@ const D = o.Root, w = o.Trigger, p = o.Portal, C = o.Close, d = /* @__PURE__ */
|
|
|
16
17
|
}
|
|
17
18
|
));
|
|
18
19
|
d.displayName = o.Overlay.displayName;
|
|
19
|
-
const
|
|
20
|
+
const x = /* @__PURE__ */ i.forwardRef(({ className: a, children: e, ...s }, c) => /* @__PURE__ */ l(f, { children: [
|
|
20
21
|
/* @__PURE__ */ t(d, {}),
|
|
21
22
|
/* @__PURE__ */ l(
|
|
22
23
|
o.Content,
|
|
@@ -31,13 +32,13 @@ const f = /* @__PURE__ */ i.forwardRef(({ className: a, children: e, ...s }, c)
|
|
|
31
32
|
children: [
|
|
32
33
|
e,
|
|
33
34
|
/* @__PURE__ */ t(o.Close, { asChild: !0, children: /* @__PURE__ */ l(
|
|
34
|
-
|
|
35
|
+
p,
|
|
35
36
|
{
|
|
36
37
|
variant: "ghost",
|
|
37
38
|
size: "s",
|
|
38
39
|
className: "absolute top-3 right-3 h-8 w-8 p-0",
|
|
39
40
|
children: [
|
|
40
|
-
/* @__PURE__ */ t(
|
|
41
|
+
/* @__PURE__ */ t(m, { name: n, size: "m" }),
|
|
41
42
|
/* @__PURE__ */ t("span", { className: "sr-only", children: "Close" })
|
|
42
43
|
]
|
|
43
44
|
}
|
|
@@ -46,8 +47,8 @@ const f = /* @__PURE__ */ i.forwardRef(({ className: a, children: e, ...s }, c)
|
|
|
46
47
|
}
|
|
47
48
|
)
|
|
48
49
|
] }));
|
|
49
|
-
|
|
50
|
-
const
|
|
50
|
+
x.displayName = o.Content.displayName;
|
|
51
|
+
const v = ({
|
|
51
52
|
className: a,
|
|
52
53
|
...e
|
|
53
54
|
}) => /* @__PURE__ */ t(
|
|
@@ -60,13 +61,13 @@ const x = ({
|
|
|
60
61
|
...e
|
|
61
62
|
}
|
|
62
63
|
);
|
|
63
|
-
|
|
64
|
-
const
|
|
64
|
+
v.displayName = "DialogHeader";
|
|
65
|
+
const y = ({
|
|
65
66
|
className: a,
|
|
66
67
|
...e
|
|
67
68
|
}) => /* @__PURE__ */ t("div", { className: r("flex-1 overflow-y-auto px-[var(--space-2xl)] py-[var(--space-2xl)]", a), ...e });
|
|
68
|
-
|
|
69
|
-
const
|
|
69
|
+
y.displayName = "DialogBody";
|
|
70
|
+
const g = ({
|
|
70
71
|
className: a,
|
|
71
72
|
...e
|
|
72
73
|
}) => /* @__PURE__ */ t(
|
|
@@ -79,8 +80,8 @@ const y = ({
|
|
|
79
80
|
...e
|
|
80
81
|
}
|
|
81
82
|
);
|
|
82
|
-
|
|
83
|
-
const
|
|
83
|
+
g.displayName = "DialogFooter";
|
|
84
|
+
const b = /* @__PURE__ */ i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ t(
|
|
84
85
|
o.Title,
|
|
85
86
|
{
|
|
86
87
|
ref: s,
|
|
@@ -91,16 +92,16 @@ const g = /* @__PURE__ */ i.forwardRef(({ className: a, ...e }, s) => /* @__PURE
|
|
|
91
92
|
...e
|
|
92
93
|
}
|
|
93
94
|
));
|
|
94
|
-
|
|
95
|
+
b.displayName = o.Title.displayName;
|
|
95
96
|
export {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
C as Dialog,
|
|
98
|
+
y as DialogBody,
|
|
99
|
+
R as DialogClose,
|
|
100
|
+
x as DialogContent,
|
|
101
|
+
g as DialogFooter,
|
|
102
|
+
v as DialogHeader,
|
|
102
103
|
d as DialogOverlay,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
f as DialogPortal,
|
|
105
|
+
b as DialogTitle,
|
|
106
|
+
z as DialogTrigger
|
|
106
107
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as s, jsxs as b } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import { cn as v } from "../../lib/utils.js";
|
|
4
|
-
import { cva as
|
|
4
|
+
import { cva as Q } from "class-variance-authority";
|
|
5
5
|
import { Button as P } from "./button.js";
|
|
6
6
|
import { Progress as Y } from "./progress.js";
|
|
7
7
|
import { Icon as z } from "./icon.js";
|
|
8
|
-
import {
|
|
8
|
+
import { X as Z } from "lucide-react";
|
|
9
|
+
import { Badge as _ } from "./badge.js";
|
|
9
10
|
const M = n.createContext(
|
|
10
11
|
null
|
|
11
12
|
), D = () => {
|
|
@@ -54,7 +55,7 @@ const M = n.createContext(
|
|
|
54
55
|
}
|
|
55
56
|
);
|
|
56
57
|
j.displayName = "FileUploadRoot";
|
|
57
|
-
const
|
|
58
|
+
const ee = Q(
|
|
58
59
|
"relative flex flex-col items-center justify-center rounded-l border-2 border-dashed p-6 text-center transition-colors duration-200",
|
|
59
60
|
{
|
|
60
61
|
variants: {
|
|
@@ -111,11 +112,11 @@ const _ = X(
|
|
|
111
112
|
};
|
|
112
113
|
if (h.type.startsWith("image/")) {
|
|
113
114
|
const C = new FileReader();
|
|
114
|
-
C.onload = (
|
|
115
|
-
const
|
|
116
|
-
(U) => U.id === R.id ? { ...U, preview:
|
|
115
|
+
C.onload = (H) => {
|
|
116
|
+
const J = l.map(
|
|
117
|
+
(U) => U.id === R.id ? { ...U, preview: H.target?.result } : U
|
|
117
118
|
);
|
|
118
|
-
i(
|
|
119
|
+
i(J);
|
|
119
120
|
}, C.readAsDataURL(h);
|
|
120
121
|
}
|
|
121
122
|
d.push(R);
|
|
@@ -128,9 +129,9 @@ const _ = X(
|
|
|
128
129
|
if (a.preventDefault(), a.stopPropagation(), g(!1), u) return;
|
|
129
130
|
const d = a.dataTransfer.files;
|
|
130
131
|
d.length > 0 && I(d);
|
|
131
|
-
},
|
|
132
|
+
}, X = () => {
|
|
132
133
|
u || y.current?.click();
|
|
133
|
-
},
|
|
134
|
+
}, q = (a) => {
|
|
134
135
|
const d = a.target.files;
|
|
135
136
|
d && I(d), a.target.value = "";
|
|
136
137
|
};
|
|
@@ -138,11 +139,11 @@ const _ = X(
|
|
|
138
139
|
"div",
|
|
139
140
|
{
|
|
140
141
|
ref: t,
|
|
141
|
-
className: v(
|
|
142
|
+
className: v(ee({ isDragActive: w, disabled: u }), r),
|
|
142
143
|
onDragOver: S,
|
|
143
144
|
onDragLeave: G,
|
|
144
145
|
onDrop: K,
|
|
145
|
-
onClick:
|
|
146
|
+
onClick: X,
|
|
146
147
|
role: "button",
|
|
147
148
|
tabIndex: u ? -1 : 0,
|
|
148
149
|
"aria-label": "Upload files",
|
|
@@ -157,7 +158,7 @@ const _ = X(
|
|
|
157
158
|
accept: p?.join(","),
|
|
158
159
|
disabled: u,
|
|
159
160
|
className: "hidden",
|
|
160
|
-
onChange:
|
|
161
|
+
onChange: q
|
|
161
162
|
}
|
|
162
163
|
),
|
|
163
164
|
e
|
|
@@ -225,7 +226,7 @@ W.displayName = "FileUploadItemPreview";
|
|
|
225
226
|
const $ = /* @__PURE__ */ n.forwardRef(({ className: r, file: e, ...o }, t) => /* @__PURE__ */ b("div", { ref: t, className: v("flex-1 space-y-1", r), ...o, children: [
|
|
226
227
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
|
|
227
228
|
/* @__PURE__ */ s("p", { className: "text-body-sm truncate font-medium", children: e.file.name }),
|
|
228
|
-
/* @__PURE__ */ s(
|
|
229
|
+
/* @__PURE__ */ s(_, { children: e.status })
|
|
229
230
|
] }),
|
|
230
231
|
/* @__PURE__ */ s("p", { className: "text-caption-sm text-[var(--color-text-secondary)]", children: E(e.file.size) }),
|
|
231
232
|
e.error && /* @__PURE__ */ s("p", { className: "text-caption-sm text-[var(--color-text-error-bold)]", children: e.error })
|
|
@@ -253,7 +254,7 @@ const T = /* @__PURE__ */ n.forwardRef(({ file: r, ...e }, o) => {
|
|
|
253
254
|
},
|
|
254
255
|
"aria-label": `Remove ${r.file.name}`,
|
|
255
256
|
...e,
|
|
256
|
-
children: /* @__PURE__ */ s(z, { name:
|
|
257
|
+
children: /* @__PURE__ */ s(z, { name: Z, className: "h-4 w-4" })
|
|
257
258
|
}
|
|
258
259
|
);
|
|
259
260
|
});
|
|
@@ -262,7 +263,7 @@ const E = (r) => {
|
|
|
262
263
|
if (r === 0) return "0 Bytes";
|
|
263
264
|
const e = 1024, o = ["Bytes", "KB", "MB", "GB"], t = Math.floor(Math.log(r) / Math.log(e));
|
|
264
265
|
return parseFloat((r / Math.pow(e, t)).toFixed(2)) + " " + o[t];
|
|
265
|
-
},
|
|
266
|
+
}, de = {
|
|
266
267
|
Root: j,
|
|
267
268
|
Dropzone: k,
|
|
268
269
|
Trigger: L,
|
|
@@ -274,7 +275,7 @@ const E = (r) => {
|
|
|
274
275
|
ItemDelete: T
|
|
275
276
|
};
|
|
276
277
|
export {
|
|
277
|
-
|
|
278
|
+
de as FileUpload,
|
|
278
279
|
k as FileUploadDropzone,
|
|
279
280
|
B as FileUploadItem,
|
|
280
281
|
T as FileUploadItemDelete,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { cn as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import { customIcons as v } from "./custom-icons.js";
|
|
7
|
-
const Vr = {
|
|
1
|
+
import { jsx as o, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
|
+
import { cn as a } from "../../lib/utils.js";
|
|
4
|
+
import { X as m, TriangleAlert as C, Trash2 as u, Star as p, Search as b, RotateCcw as k, PlusCircle as g, Pencil as y, PanelLeft as z, MoreHorizontal as A, Loader2 as L, ListFilter as I, Info as N, Filter as R, ExternalLink as T, CircleHelp as S, CircleCheck as D, CircleAlert as P, Circle as U, ChevronUp as W, ChevronRight as j, ChevronLeft as B, ChevronDown as F, Check as H, Bookmark as _, ArrowUpToLine as E, ArrowRightToLine as M, ArrowRight as X, ArrowLeftToLine as Y, ArrowLeft as $, ArrowDownWideNarrow as q, ArrowDownToLine as G, ArrowDownNarrowWide as J, AlertCircle as K } from "lucide-react";
|
|
5
|
+
const O = {
|
|
8
6
|
primary: "text-[var(--color-icon-primary)]",
|
|
9
7
|
secondary: "text-[var(--color-icon-secondary)]",
|
|
10
8
|
tertiary: "text-[var(--color-icon-tertiary)]",
|
|
@@ -21,7 +19,7 @@ const Vr = {
|
|
|
21
19
|
"on-action": "text-[var(--color-icon-on-action)]",
|
|
22
20
|
inverse: "text-[var(--color-icon-inverse)]",
|
|
23
21
|
violet: "text-[var(--violet-500)]"
|
|
24
|
-
},
|
|
22
|
+
}, Q = {
|
|
25
23
|
s: "w-[var(--size-3xs)] h-[var(--size-3xs)]",
|
|
26
24
|
// 12px
|
|
27
25
|
m: "w-[var(--size-2xs)] h-[var(--size-2xs)]",
|
|
@@ -30,161 +28,84 @@ const Vr = {
|
|
|
30
28
|
// 20px
|
|
31
29
|
xl: "w-[var(--size-s)] h-[var(--size-s)]"
|
|
32
30
|
// 24px
|
|
33
|
-
},
|
|
34
|
-
"alert-circle":
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"arrow-down":
|
|
38
|
-
"arrow-
|
|
39
|
-
"arrow-
|
|
40
|
-
"arrow-
|
|
41
|
-
"arrow-
|
|
42
|
-
"arrow-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"circle
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
download: xr,
|
|
70
|
-
edit: pr,
|
|
71
|
-
ellipsis: vr,
|
|
72
|
-
"external-link": ur,
|
|
73
|
-
eye: wr,
|
|
74
|
-
"file-text": hr,
|
|
75
|
-
filter: dr,
|
|
76
|
-
"grid-2x2-plus": sr,
|
|
77
|
-
handshake: ar,
|
|
78
|
-
info: lr,
|
|
79
|
-
"layout-dashboard": cr,
|
|
80
|
-
link: nr,
|
|
81
|
-
"list-filter": tr,
|
|
82
|
-
"loader-2": ir,
|
|
83
|
-
"log-out": or,
|
|
84
|
-
mail: er,
|
|
85
|
-
"map-pin": rr,
|
|
86
|
-
"message-circle": Y,
|
|
87
|
-
"message-square": V,
|
|
88
|
-
"more-horizontal": Q,
|
|
89
|
-
navigation: K,
|
|
90
|
-
package: J,
|
|
91
|
-
"panel-left": $,
|
|
92
|
-
"panel-right-close": O,
|
|
93
|
-
pencil: G,
|
|
94
|
-
plus: _,
|
|
95
|
-
"plus-circle": Z,
|
|
96
|
-
"refresh-cw": X,
|
|
97
|
-
"rotate-ccw": H,
|
|
98
|
-
route: F,
|
|
99
|
-
search: j,
|
|
100
|
-
send: W,
|
|
101
|
-
settings: E,
|
|
102
|
-
share: B,
|
|
103
|
-
"share-2": q,
|
|
104
|
-
"shield-check": M,
|
|
105
|
-
ship: U,
|
|
106
|
-
sparkles: N,
|
|
107
|
-
"square-plus": R,
|
|
108
|
-
star: P,
|
|
109
|
-
"table-2": I,
|
|
110
|
-
"text-cursor-input": T,
|
|
111
|
-
trash: L,
|
|
112
|
-
"trash-2": D,
|
|
113
|
-
"triangle-alert": S,
|
|
114
|
-
truck: z,
|
|
115
|
-
upload: b,
|
|
116
|
-
user: y,
|
|
117
|
-
users: A,
|
|
118
|
-
weight: m,
|
|
119
|
-
x: k
|
|
120
|
-
}, re = /* @__PURE__ */ g.forwardRef(
|
|
31
|
+
}, v = {
|
|
32
|
+
"alert-circle": K,
|
|
33
|
+
"arrow-down-narrow-wide": J,
|
|
34
|
+
"arrow-down-to-line": G,
|
|
35
|
+
"arrow-down-wide-narrow": q,
|
|
36
|
+
"arrow-left": $,
|
|
37
|
+
"arrow-left-to-line": Y,
|
|
38
|
+
"arrow-right": X,
|
|
39
|
+
"arrow-right-to-line": M,
|
|
40
|
+
"arrow-up-to-line": E,
|
|
41
|
+
bookmark: _,
|
|
42
|
+
check: H,
|
|
43
|
+
"chevron-down": F,
|
|
44
|
+
"chevron-left": B,
|
|
45
|
+
"chevron-right": j,
|
|
46
|
+
"chevron-up": W,
|
|
47
|
+
circle: U,
|
|
48
|
+
"circle-alert": P,
|
|
49
|
+
"circle-check": D,
|
|
50
|
+
"circle-help": S,
|
|
51
|
+
"external-link": T,
|
|
52
|
+
filter: R,
|
|
53
|
+
info: N,
|
|
54
|
+
"list-filter": I,
|
|
55
|
+
"loader-2": L,
|
|
56
|
+
"more-horizontal": A,
|
|
57
|
+
"panel-left": z,
|
|
58
|
+
pencil: y,
|
|
59
|
+
"plus-circle": g,
|
|
60
|
+
"rotate-ccw": k,
|
|
61
|
+
search: b,
|
|
62
|
+
star: p,
|
|
63
|
+
"trash-2": u,
|
|
64
|
+
"triangle-alert": C,
|
|
65
|
+
x: m
|
|
66
|
+
}, V = /* @__PURE__ */ f.forwardRef(
|
|
121
67
|
({
|
|
122
68
|
name: r,
|
|
123
|
-
size:
|
|
124
|
-
color:
|
|
125
|
-
className:
|
|
126
|
-
"aria-label":
|
|
127
|
-
...
|
|
69
|
+
size: w = "m",
|
|
70
|
+
color: s,
|
|
71
|
+
className: t,
|
|
72
|
+
"aria-label": e,
|
|
73
|
+
...i
|
|
128
74
|
}, d) => {
|
|
129
|
-
const n =
|
|
75
|
+
const n = s ? O[s] : "text-current", c = Q[w], l = e ? { "aria-label": e, role: "img" } : { "aria-hidden": !0 };
|
|
130
76
|
if (typeof r != "string")
|
|
131
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ o(
|
|
132
78
|
r,
|
|
133
79
|
{
|
|
134
|
-
className:
|
|
80
|
+
className: a("shrink-0", c, n, t),
|
|
135
81
|
...l,
|
|
136
|
-
...
|
|
82
|
+
...i
|
|
137
83
|
}
|
|
138
84
|
);
|
|
139
|
-
if (r in v)
|
|
140
|
-
|
|
141
|
-
|
|
85
|
+
if (r in v) {
|
|
86
|
+
const h = v[r];
|
|
87
|
+
return /* @__PURE__ */ o(
|
|
88
|
+
h,
|
|
142
89
|
{
|
|
143
90
|
ref: d,
|
|
144
|
-
|
|
145
|
-
fill: "none",
|
|
146
|
-
className: s("shrink-0", c, n, i),
|
|
91
|
+
className: a("shrink-0", c, n, t),
|
|
147
92
|
...l,
|
|
148
|
-
...
|
|
149
|
-
children: [
|
|
150
|
-
o && /* @__PURE__ */ e("title", { children: o }),
|
|
151
|
-
v[r]
|
|
152
|
-
]
|
|
153
|
-
}
|
|
154
|
-
);
|
|
155
|
-
if (r in p) {
|
|
156
|
-
const a = p[r];
|
|
157
|
-
return /* @__PURE__ */ e(
|
|
158
|
-
a,
|
|
159
|
-
{
|
|
160
|
-
ref: d,
|
|
161
|
-
className: s("shrink-0", c, n, i),
|
|
162
|
-
...l,
|
|
163
|
-
...t
|
|
93
|
+
...i
|
|
164
94
|
}
|
|
165
95
|
);
|
|
166
96
|
}
|
|
167
|
-
|
|
168
|
-
return w ? /* @__PURE__ */ e(
|
|
169
|
-
w,
|
|
170
|
-
{
|
|
171
|
-
ref: d,
|
|
172
|
-
className: s("shrink-0", c, n, i),
|
|
173
|
-
...l,
|
|
174
|
-
...t
|
|
175
|
-
}
|
|
176
|
-
) : (console.warn(`Icon "${r}" not found in custom icons or Lucide icons`), /* @__PURE__ */ u(
|
|
97
|
+
return console.warn(`Icon "${r}" not found in the static icon map. Use a component reference instead: <Icon name={YourIcon} />`), /* @__PURE__ */ x(
|
|
177
98
|
"svg",
|
|
178
99
|
{
|
|
179
100
|
ref: d,
|
|
180
101
|
viewBox: "0 0 24 24",
|
|
181
102
|
fill: "none",
|
|
182
|
-
className:
|
|
103
|
+
className: a("shrink-0", c, n, t),
|
|
183
104
|
...l,
|
|
184
|
-
...
|
|
105
|
+
...i,
|
|
185
106
|
children: [
|
|
186
|
-
|
|
187
|
-
/* @__PURE__ */
|
|
107
|
+
e && /* @__PURE__ */ o("title", { children: e }),
|
|
108
|
+
/* @__PURE__ */ o(
|
|
188
109
|
"rect",
|
|
189
110
|
{
|
|
190
111
|
x: "2",
|
|
@@ -196,7 +117,7 @@ const Vr = {
|
|
|
196
117
|
fill: "none"
|
|
197
118
|
}
|
|
198
119
|
),
|
|
199
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ o(
|
|
200
121
|
"text",
|
|
201
122
|
{
|
|
202
123
|
x: "12",
|
|
@@ -209,12 +130,12 @@ const Vr = {
|
|
|
209
130
|
)
|
|
210
131
|
]
|
|
211
132
|
}
|
|
212
|
-
)
|
|
133
|
+
);
|
|
213
134
|
}
|
|
214
135
|
);
|
|
215
|
-
|
|
136
|
+
V.displayName = "Icon";
|
|
216
137
|
export {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
138
|
+
V as Icon,
|
|
139
|
+
O as iconColors,
|
|
140
|
+
Q as iconSizes
|
|
220
141
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as d, jsxs as T } from "react/jsx-runtime";
|
|
2
2
|
import p from "react";
|
|
3
|
-
import { cva as
|
|
3
|
+
import { cva as K } from "class-variance-authority";
|
|
4
4
|
import { cn as u } from "../../lib/utils.js";
|
|
5
5
|
import { Button as k } from "./button.js";
|
|
6
6
|
import { Icon as w } from "./icon.js";
|
|
7
|
-
|
|
7
|
+
import { ChevronLeft as O, ChevronRight as Q } from "lucide-react";
|
|
8
|
+
K("", {
|
|
8
9
|
variants: {
|
|
9
10
|
size: {
|
|
10
11
|
default: "",
|
|
@@ -15,7 +16,7 @@ L("", {
|
|
|
15
16
|
size: "default"
|
|
16
17
|
}
|
|
17
18
|
});
|
|
18
|
-
const
|
|
19
|
+
const W = {
|
|
19
20
|
default: {
|
|
20
21
|
container: "gap-[var(--space-m)]",
|
|
21
22
|
navButton: "h-[var(--size-m)] w-[var(--size-m)]",
|
|
@@ -38,7 +39,7 @@ const O = {
|
|
|
38
39
|
monthButton: "px-1 py-[var(--space-xs)] [&]:text-caption-sm",
|
|
39
40
|
monthBorderRadius: "rounded-s"
|
|
40
41
|
}
|
|
41
|
-
}, n = (r) => new Date(r.getFullYear(), r.getMonth(), 1),
|
|
42
|
+
}, n = (r) => new Date(r.getFullYear(), r.getMonth(), 1), X = (r) => r.toLocaleDateString("en-US", { month: "short" }), Z = (r) => Array.from({ length: 12 }, (a, o) => new Date(r, o, 1)), $ = (r, a, o, l) => {
|
|
42
43
|
const f = n(r);
|
|
43
44
|
if (a) {
|
|
44
45
|
const i = n(a);
|
|
@@ -62,7 +63,7 @@ const O = {
|
|
|
62
63
|
return l > f;
|
|
63
64
|
const i = n(o).getTime();
|
|
64
65
|
return l > f && l < i;
|
|
65
|
-
}, v = (r, a) => !r || !a ? !1 : n(r).getTime() === n(a).getTime(),
|
|
66
|
+
}, v = (r, a) => !r || !a ? !1 : n(r).getTime() === n(a).getTime(), ee = /* @__PURE__ */ p.forwardRef(
|
|
66
67
|
({
|
|
67
68
|
value: r,
|
|
68
69
|
onChange: a,
|
|
@@ -71,17 +72,17 @@ const O = {
|
|
|
71
72
|
yearCount: f,
|
|
72
73
|
startYear: i,
|
|
73
74
|
minDate: g,
|
|
74
|
-
maxDate:
|
|
75
|
-
disabledDates:
|
|
76
|
-
className:
|
|
75
|
+
maxDate: C,
|
|
76
|
+
disabledDates: R,
|
|
77
|
+
className: Y,
|
|
77
78
|
monthLabelFormat: S,
|
|
78
79
|
yearLabelFormat: b,
|
|
79
80
|
enableNavigation: h = !1,
|
|
80
81
|
onYearNavigate: G
|
|
81
|
-
},
|
|
82
|
+
}, I) => {
|
|
82
83
|
const [c, M] = p.useState(null), [z, x] = p.useState(null), [y, N] = p.useState(
|
|
83
84
|
i || (/* @__PURE__ */ new Date()).getFullYear()
|
|
84
|
-
), s =
|
|
85
|
+
), s = W[l], A = f ?? (o === "single" ? 1 : 2), H = h ? y : i || (/* @__PURE__ */ new Date()).getFullYear(), D = Array.from({ length: A }, (e, t) => H + t), _ = () => {
|
|
85
86
|
const e = y - 1;
|
|
86
87
|
N(e), G?.(e);
|
|
87
88
|
}, E = () => {
|
|
@@ -103,7 +104,7 @@ const O = {
|
|
|
103
104
|
const [t, m] = r;
|
|
104
105
|
return B(e, t, m);
|
|
105
106
|
}, F = (e) => !c || !z ? !1 : B(e, c, z);
|
|
106
|
-
return /* @__PURE__ */ d("div", { ref:
|
|
107
|
+
return /* @__PURE__ */ d("div", { ref: I, className: u("flex flex-col", s.container, Y), children: /* @__PURE__ */ T("div", { className: u("flex items-center", s.yearGridGap), children: [
|
|
107
108
|
h && /* @__PURE__ */ d(
|
|
108
109
|
k,
|
|
109
110
|
{
|
|
@@ -111,13 +112,13 @@ const O = {
|
|
|
111
112
|
size: "s",
|
|
112
113
|
onClick: _,
|
|
113
114
|
className: u(s.navButton, "p-0 shrink-0"),
|
|
114
|
-
children: /* @__PURE__ */ d(w, { name:
|
|
115
|
+
children: /* @__PURE__ */ d(w, { name: O, className: s.navIcon })
|
|
115
116
|
}
|
|
116
117
|
),
|
|
117
118
|
/* @__PURE__ */ d("div", { className: u("flex flex-1", s.yearGridGap), children: D.map((e) => /* @__PURE__ */ T("div", { className: u("flex-1 flex flex-col", s.yearSectionGap), children: [
|
|
118
119
|
/* @__PURE__ */ d("div", { className: u(s.yearHeader, "text-[var(--color-text-primary)] text-center"), children: b ? b(e) : e }),
|
|
119
|
-
/* @__PURE__ */ d("div", { className: u("grid grid-cols-3", s.monthGridGap), children:
|
|
120
|
-
const m =
|
|
120
|
+
/* @__PURE__ */ d("div", { className: u("grid grid-cols-3", s.monthGridGap), children: Z(e).map((t) => {
|
|
121
|
+
const m = $(t, g, C, R), L = j(t), U = q(t), V = F(t), J = v(t, c);
|
|
121
122
|
return /* @__PURE__ */ d(
|
|
122
123
|
"button",
|
|
123
124
|
{
|
|
@@ -133,10 +134,10 @@ const O = {
|
|
|
133
134
|
"hover:bg-[var(--color-background-neutral-hovered)]",
|
|
134
135
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring-color)]",
|
|
135
136
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
136
|
-
(
|
|
137
|
-
(
|
|
137
|
+
(U || V) && "bg-[var(--color-background-blue-subtle)] text-[var(--color-text-primary)]",
|
|
138
|
+
(L || J) && "!bg-[var(--color-background-blue-bold)] !text-[var(--color-text-on-action)]"
|
|
138
139
|
),
|
|
139
|
-
children: S ? S(t) :
|
|
140
|
+
children: S ? S(t) : X(t)
|
|
140
141
|
},
|
|
141
142
|
t.getTime()
|
|
142
143
|
);
|
|
@@ -149,13 +150,13 @@ const O = {
|
|
|
149
150
|
size: "s",
|
|
150
151
|
onClick: E,
|
|
151
152
|
className: u(s.navButton, "p-0 shrink-0"),
|
|
152
|
-
children: /* @__PURE__ */ d(w, { name:
|
|
153
|
+
children: /* @__PURE__ */ d(w, { name: Q, className: s.navIcon })
|
|
153
154
|
}
|
|
154
155
|
)
|
|
155
156
|
] }) });
|
|
156
157
|
}
|
|
157
158
|
);
|
|
158
|
-
|
|
159
|
+
ee.displayName = "MonthPicker";
|
|
159
160
|
export {
|
|
160
|
-
|
|
161
|
+
ee as MonthPicker
|
|
161
162
|
};
|