impact-nova 0.1.13 → 1.1.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/components/layout/dashboard-layout.d.ts +21 -6
- package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +32 -33
- package/dist/components/ui/accordion.js +25 -23
- package/dist/components/ui/ag-grid-react/cell-renderers/date-display-renderer.js +32 -21
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.d.ts +3 -5
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +57 -55
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +5 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +50 -52
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +34 -34
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +8 -11
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +17 -17
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +3 -3
- package/dist/components/ui/alert-dialog.js +45 -40
- package/dist/components/ui/alert.d.ts +21 -4
- package/dist/components/ui/alert.js +45 -25
- package/dist/components/ui/avatar.js +19 -16
- package/dist/components/ui/badge.js +8 -1
- package/dist/components/ui/breadcrumb.js +1 -0
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button-group.js +27 -32
- package/dist/components/ui/button-variants.d.ts +1 -1
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/button.js +11 -9
- package/dist/components/ui/calendar.d.ts +14 -2
- package/dist/components/ui/calendar.js +443 -376
- package/dist/components/ui/card.js +7 -6
- package/dist/components/ui/checkbox.js +64 -48
- package/dist/components/ui/chips.d.ts +1 -0
- package/dist/components/ui/chips.js +27 -19
- package/dist/components/ui/data-table/data-table-column-list.d.ts +4 -1
- package/dist/components/ui/data-table/data-table-column-list.js +58 -54
- package/dist/components/ui/data-table/data-table-sheet.d.ts +1 -1
- package/dist/components/ui/data-table/data-table-sheet.js +43 -40
- package/dist/components/ui/data-table/data-table-view-options.js +17 -17
- package/dist/components/ui/data-table/data-table.js +21 -20
- package/dist/components/ui/date-picker/date-picker.js +93 -93
- package/dist/components/ui/date-picker/date-range-picker.js +142 -133
- package/dist/components/ui/date-picker/month-picker.js +96 -93
- package/dist/components/ui/date-picker/month-range-picker.js +144 -134
- package/dist/components/ui/date-picker/multi-date-picker.js +43 -45
- package/dist/components/ui/date-picker/multi-month-picker.js +37 -39
- package/dist/components/ui/date-picker/multi-week-picker.js +56 -46
- package/dist/components/ui/date-picker/week-picker.js +119 -109
- package/dist/components/ui/date-picker/week-range-picker.js +170 -147
- package/dist/components/ui/dialog.js +15 -6
- package/dist/components/ui/drawer.js +16 -13
- package/dist/components/ui/dropdown-menu.js +4 -2
- package/dist/components/ui/dynamic-layout.d.ts +2 -2
- package/dist/components/ui/dynamic-layout.js +18 -15
- package/dist/components/ui/empty-container.js +69 -64
- package/dist/components/ui/file-upload.js +113 -106
- package/dist/components/ui/filter-panel/filter-panel.js +49 -46
- package/dist/components/ui/filter-strip/filter-strip.js +41 -37
- package/dist/components/ui/header.js +26 -25
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +43 -40
- package/dist/components/ui/hover-card.js +6 -5
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.js +79 -68
- package/dist/components/ui/loader.d.ts +1 -0
- package/dist/components/ui/loader.js +23 -13
- package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -3
- package/dist/components/ui/nested-list/components/NestedListContent.js +16 -15
- package/dist/components/ui/nested-list/components/SortableItem.js +116 -80
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +13 -1
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +162 -112
- package/dist/components/ui/nested-list/nested-list.js +182 -189
- package/dist/components/ui/notification-panel/notification-item.js +19 -17
- package/dist/components/ui/notification-panel/notification-list.js +21 -21
- package/dist/components/ui/notification-panel/notification-panel.js +25 -25
- package/dist/components/ui/popover.js +37 -34
- package/dist/components/ui/progress.js +12 -10
- package/dist/components/ui/prompt.js +29 -27
- package/dist/components/ui/radio-group.js +55 -46
- package/dist/components/ui/select/components/Submenu.d.ts +1 -2
- package/dist/components/ui/select/components/Submenu.js +52 -48
- package/dist/components/ui/select/select.js +321 -324
- package/dist/components/ui/sheet.js +18 -15
- package/dist/components/ui/sidebar.d.ts +2 -2
- package/dist/components/ui/sidebar.js +3 -3
- package/dist/components/ui/skeleton.d.ts +2 -1
- package/dist/components/ui/skeleton.js +12 -11
- package/dist/components/ui/slider.js +39 -12
- package/dist/components/ui/smart-input.js +44 -39
- package/dist/components/ui/stepper.js +33 -29
- package/dist/components/ui/switch.js +6 -4
- package/dist/components/ui/tabs.js +50 -45
- package/dist/components/ui/tag-group.d.ts +2 -1
- package/dist/components/ui/tag-group.js +29 -25
- package/dist/components/ui/tag.d.ts +1 -0
- package/dist/components/ui/tag.js +26 -20
- package/dist/components/ui/textarea.js +18 -17
- package/dist/components/ui/toast.d.ts +1 -1
- package/dist/components/ui/toast.js +47 -41
- package/dist/components/ui/toaster.js +42 -42
- package/dist/components/ui/tooltip.js +18 -16
- package/dist/components/ui/types/date-picker.types.d.ts +33 -0
- package/dist/components/ui/types/empty-container.types.d.ts +5 -0
- package/dist/components/ui/types/nested-list.types.d.ts +1 -0
- package/dist/components/ui/types/select.types.d.ts +0 -1
- package/dist/icons/assets/bookmark.svg.js +4 -0
- package/dist/icons/assets/bookmark.svg2.js +5 -0
- package/dist/icons/assets/bookmarkFilled.svg.js +4 -0
- package/dist/icons/assets/bookmarkFilled.svg2.js +5 -0
- package/dist/icons/assets/download.svg.js +4 -0
- package/dist/icons/assets/download.svg2.js +5 -0
- package/dist/icons/index.d.ts +20 -6
- package/dist/icons/index.js +398 -370
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +318 -314
- package/dist/lib/fiscal-calendar.d.ts +62 -0
- package/dist/lib/fiscal-calendar.js +99 -0
- package/dist/lib/utils.d.ts +2 -1
- package/dist/lib/utils.js +29 -13
- package/package.json +5 -5
- package/dist/components/ui/select/hooks/useClickOutside.d.ts +0 -15
- package/dist/components/ui/select/hooks/useClickOutside.js +0 -43
- package/dist/components/ui/select/hooks/useMenuPosition.d.ts +0 -2
- package/dist/components/ui/select/hooks/useMenuPosition.js +0 -89
|
@@ -1,46 +1,39 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { Slot as p } from "@radix-ui/react-slot";
|
|
4
|
+
import { cn as s } from "../../lib/utils.js";
|
|
5
|
+
import { EmptyState1 as E, EmptyState2 as w, EmptyState3 as b, EmptyState4 as N, EmptyState5 as S, EmptyState6 as I } from "../../icons/index.js";
|
|
6
|
+
const c = [
|
|
6
7
|
{ Component: E, width: 225, height: 150 },
|
|
7
|
-
{ Component:
|
|
8
|
-
{ Component:
|
|
9
|
-
{ Component:
|
|
10
|
-
{ Component:
|
|
8
|
+
{ Component: w, width: 200, height: 200 },
|
|
9
|
+
{ Component: b, width: 225, height: 150 },
|
|
10
|
+
{ Component: N, width: 250, height: 180 },
|
|
11
|
+
{ Component: S, width: 225, height: 150 },
|
|
11
12
|
{ Component: I, width: 225, height: 150 }
|
|
12
|
-
],
|
|
13
|
-
({ className:
|
|
14
|
-
"div",
|
|
13
|
+
], R = m.forwardRef(
|
|
14
|
+
({ className: o, children: t, asChild: e = !1, ...n }, a) => /* @__PURE__ */ r(
|
|
15
|
+
e ? p : "div",
|
|
15
16
|
{
|
|
16
|
-
ref:
|
|
17
|
-
className:
|
|
17
|
+
ref: a,
|
|
18
|
+
className: s(
|
|
18
19
|
"flex flex-col items-center justify-center py-10 px-5 text-center animate-in fade-in zoom-in duration-300 border border-border-subtle rounded-xl bg-card w-[884px] min-w-[884px] h-auto",
|
|
19
|
-
|
|
20
|
+
o
|
|
20
21
|
),
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
"data-component": "empty-container",
|
|
23
|
+
...n,
|
|
24
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-col items-center max-w-[650px] gap-4", children: t })
|
|
23
25
|
}
|
|
24
26
|
)
|
|
25
27
|
);
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
({ className:
|
|
29
|
-
const [
|
|
30
|
-
null
|
|
31
|
-
);
|
|
32
|
-
r.useEffect(() => {
|
|
33
|
-
if (!t) {
|
|
34
|
-
const s = Math.floor(Math.random() * l.length);
|
|
35
|
-
c(s);
|
|
36
|
-
}
|
|
37
|
-
}, [t]);
|
|
38
|
-
const h = () => {
|
|
28
|
+
R.displayName = "EmptyContainer";
|
|
29
|
+
const v = m.forwardRef(
|
|
30
|
+
({ className: o, children: t, width: e, height: n, asChild: a = !1, ...i }, f) => {
|
|
31
|
+
const [l, M] = m.useState(() => t ? null : Math.floor(Math.random() * c.length)), h = () => {
|
|
39
32
|
if (t) return t;
|
|
40
|
-
if (
|
|
41
|
-
const { Component:
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
|
|
33
|
+
if (l !== null) {
|
|
34
|
+
const { Component: C, width: g, height: x } = c[l];
|
|
35
|
+
return /* @__PURE__ */ r(
|
|
36
|
+
C,
|
|
44
37
|
{
|
|
45
38
|
size: "100%",
|
|
46
39
|
style: {
|
|
@@ -51,58 +44,70 @@ const R = r.forwardRef(
|
|
|
51
44
|
);
|
|
52
45
|
}
|
|
53
46
|
return null;
|
|
54
|
-
},
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
"div",
|
|
47
|
+
}, d = l !== null ? c[l] : null, u = e || (t ? "auto" : d?.width || 225), y = n || (t ? "auto" : d?.height || 150);
|
|
48
|
+
return /* @__PURE__ */ r(
|
|
49
|
+
a ? p : "div",
|
|
57
50
|
{
|
|
58
|
-
ref:
|
|
59
|
-
className:
|
|
51
|
+
ref: f,
|
|
52
|
+
className: s(
|
|
60
53
|
"mb-4 flex items-center justify-center relative",
|
|
61
54
|
"after:absolute after:inset-0 after:bg-primary/5 after:blur-3xl after:-z-10 after:rounded-full",
|
|
62
|
-
|
|
55
|
+
o
|
|
63
56
|
),
|
|
64
57
|
style: {
|
|
65
58
|
width: u,
|
|
66
59
|
height: y,
|
|
67
|
-
...
|
|
60
|
+
...i.style
|
|
68
61
|
},
|
|
69
|
-
|
|
62
|
+
"data-component": "empty-container-image",
|
|
63
|
+
...i,
|
|
70
64
|
children: h()
|
|
71
65
|
}
|
|
72
66
|
);
|
|
73
67
|
}
|
|
74
68
|
);
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
({ className:
|
|
78
|
-
"h3",
|
|
69
|
+
v.displayName = "EmptyContainerImage";
|
|
70
|
+
const T = m.forwardRef(
|
|
71
|
+
({ className: o, children: t, asChild: e = !1, ...n }, a) => /* @__PURE__ */ r(
|
|
72
|
+
e ? p : "h3",
|
|
79
73
|
{
|
|
80
|
-
ref:
|
|
81
|
-
className:
|
|
82
|
-
|
|
74
|
+
ref: a,
|
|
75
|
+
className: s("text-xl font-bold tracking-tight text-foreground", o),
|
|
76
|
+
"data-component": "empty-container-title",
|
|
77
|
+
...n,
|
|
83
78
|
children: t
|
|
84
79
|
}
|
|
85
80
|
)
|
|
86
81
|
);
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
"p",
|
|
82
|
+
T.displayName = "EmptyContainerTitle";
|
|
83
|
+
const j = m.forwardRef(({ className: o, children: t, asChild: e = !1, ...n }, a) => /* @__PURE__ */ r(
|
|
84
|
+
e ? p : "p",
|
|
90
85
|
{
|
|
91
|
-
ref:
|
|
92
|
-
className:
|
|
93
|
-
|
|
86
|
+
ref: a,
|
|
87
|
+
className: s("text-base font-medium text-secondary-foreground leading-relaxed", o),
|
|
88
|
+
"data-component": "empty-container-description",
|
|
89
|
+
...n,
|
|
94
90
|
children: t
|
|
95
91
|
}
|
|
96
92
|
));
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
({ className:
|
|
93
|
+
j.displayName = "EmptyContainerDescription";
|
|
94
|
+
const A = m.forwardRef(
|
|
95
|
+
({ className: o, children: t, asChild: e = !1, ...n }, a) => /* @__PURE__ */ r(
|
|
96
|
+
e ? p : "div",
|
|
97
|
+
{
|
|
98
|
+
ref: a,
|
|
99
|
+
className: s("mt-6 flex flex-wrap items-center justify-center gap-3", o),
|
|
100
|
+
"data-component": "empty-container-action",
|
|
101
|
+
...n,
|
|
102
|
+
children: t
|
|
103
|
+
}
|
|
104
|
+
)
|
|
100
105
|
);
|
|
101
|
-
|
|
106
|
+
A.displayName = "EmptyContainerAction";
|
|
102
107
|
export {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
R as EmptyContainer,
|
|
109
|
+
A as EmptyContainerAction,
|
|
110
|
+
j as EmptyContainerDescription,
|
|
111
|
+
v as EmptyContainerImage,
|
|
112
|
+
T as EmptyContainerTitle
|
|
108
113
|
};
|
|
@@ -1,59 +1,61 @@
|
|
|
1
|
-
import { jsx as e, jsxs as N, Fragment as
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { FileUpload as
|
|
5
|
-
const U =
|
|
1
|
+
import { jsx as e, jsxs as N, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import { cn as p } from "../../lib/utils.js";
|
|
4
|
+
import { FileUpload as C, Delete as R, Document as j, Text as k, Csv as T, Excel as B } from "../../icons/index.js";
|
|
5
|
+
const U = r.createContext(
|
|
6
6
|
void 0
|
|
7
7
|
), D = () => {
|
|
8
|
-
const
|
|
9
|
-
if (!
|
|
8
|
+
const a = r.useContext(U);
|
|
9
|
+
if (!a)
|
|
10
10
|
throw new Error("useFileUpload must be used within a FileUpload component");
|
|
11
|
-
return
|
|
12
|
-
}, I =
|
|
11
|
+
return a;
|
|
12
|
+
}, I = r.forwardRef(
|
|
13
13
|
({
|
|
14
|
-
className:
|
|
15
|
-
children:
|
|
16
|
-
onFilesChange:
|
|
17
|
-
maxFiles:
|
|
14
|
+
className: a,
|
|
15
|
+
children: t,
|
|
16
|
+
onFilesChange: l,
|
|
17
|
+
maxFiles: o = 1,
|
|
18
18
|
accept: h = [],
|
|
19
|
-
disabled:
|
|
19
|
+
disabled: n = !1,
|
|
20
20
|
value: f = [],
|
|
21
|
-
...
|
|
21
|
+
...d
|
|
22
22
|
}, b) => {
|
|
23
|
-
const [m,
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const [m, s] = r.useState(f);
|
|
24
|
+
r.useEffect(() => {
|
|
25
|
+
s(f);
|
|
26
26
|
}, [f]);
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
let
|
|
30
|
-
h.length > 0 && (
|
|
31
|
-
const y =
|
|
27
|
+
const c = (u) => {
|
|
28
|
+
if (n) return;
|
|
29
|
+
let x = u;
|
|
30
|
+
h.length > 0 && (x = x.filter((F) => {
|
|
31
|
+
const y = F.name.split(".").pop()?.toLowerCase();
|
|
32
32
|
return y && h.includes(y);
|
|
33
33
|
}));
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
const w =
|
|
34
|
+
const v = o - m.length;
|
|
35
|
+
if (v <= 0) return;
|
|
36
|
+
const w = x.slice(0, v);
|
|
37
37
|
if (w.length > 0) {
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const F = [...m, ...w];
|
|
39
|
+
s(F), l?.(F);
|
|
40
40
|
}
|
|
41
|
-
}, g = (
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
|
|
41
|
+
}, g = (u) => {
|
|
42
|
+
if (n) return;
|
|
43
|
+
const x = m.filter((v) => v !== u);
|
|
44
|
+
s(x), l?.(x);
|
|
45
45
|
};
|
|
46
46
|
return /* @__PURE__ */ e(
|
|
47
47
|
U.Provider,
|
|
48
48
|
{
|
|
49
|
-
value: { files: m, addFiles:
|
|
49
|
+
value: { files: m, addFiles: c, removeFile: g, maxFiles: o, accept: h, disabled: n },
|
|
50
50
|
children: /* @__PURE__ */ e(
|
|
51
51
|
"div",
|
|
52
52
|
{
|
|
53
53
|
ref: b,
|
|
54
|
-
className:
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
className: p("w-full max-w-[550px]", a),
|
|
55
|
+
"data-component": "file-upload",
|
|
56
|
+
"data-disabled": n || void 0,
|
|
57
|
+
...d,
|
|
58
|
+
children: t
|
|
57
59
|
}
|
|
58
60
|
)
|
|
59
61
|
}
|
|
@@ -61,80 +63,82 @@ const U = s.createContext(
|
|
|
61
63
|
}
|
|
62
64
|
);
|
|
63
65
|
I.displayName = "FileUpload";
|
|
64
|
-
const L =
|
|
66
|
+
const L = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
|
|
65
67
|
"div",
|
|
66
68
|
{
|
|
67
|
-
ref:
|
|
68
|
-
className:
|
|
69
|
+
ref: o,
|
|
70
|
+
className: p(
|
|
69
71
|
"flex flex-col gap-4 p-4 min-h-[274px] bg-card border border-border rounded-2xl shadow-[0px_0px_16px_2px_rgba(0,0,0,0.0588)]",
|
|
70
|
-
|
|
72
|
+
a
|
|
71
73
|
),
|
|
72
|
-
...
|
|
73
|
-
children:
|
|
74
|
+
...l,
|
|
75
|
+
children: t
|
|
74
76
|
}
|
|
75
77
|
));
|
|
76
78
|
L.displayName = "FileUploadContent";
|
|
77
|
-
const M =
|
|
79
|
+
const M = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
|
|
78
80
|
"div",
|
|
79
81
|
{
|
|
80
|
-
ref:
|
|
81
|
-
className:
|
|
82
|
-
...
|
|
83
|
-
children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-[2px] w-full", children:
|
|
82
|
+
ref: o,
|
|
83
|
+
className: p("flex justify-between items-center w-full", a),
|
|
84
|
+
...l,
|
|
85
|
+
children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-[2px] w-full", children: t })
|
|
84
86
|
}
|
|
85
87
|
));
|
|
86
88
|
M.displayName = "FileUploadHeader";
|
|
87
|
-
const A =
|
|
89
|
+
const A = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
|
|
88
90
|
"h3",
|
|
89
91
|
{
|
|
90
|
-
ref:
|
|
91
|
-
className:
|
|
92
|
-
...
|
|
93
|
-
children:
|
|
92
|
+
ref: o,
|
|
93
|
+
className: p("text-base font-extrabold text-foreground leading-6", a),
|
|
94
|
+
...l,
|
|
95
|
+
children: t
|
|
94
96
|
}
|
|
95
97
|
));
|
|
96
98
|
A.displayName = "FileUploadTitle";
|
|
97
|
-
const O =
|
|
99
|
+
const O = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
|
|
98
100
|
"p",
|
|
99
101
|
{
|
|
100
|
-
ref:
|
|
101
|
-
className:
|
|
102
|
-
...
|
|
103
|
-
children:
|
|
102
|
+
ref: o,
|
|
103
|
+
className: p("text-sm font-medium text-[#7a8294] leading-5", a),
|
|
104
|
+
...l,
|
|
105
|
+
children: t
|
|
104
106
|
}
|
|
105
107
|
));
|
|
106
108
|
O.displayName = "FileUploadDescription";
|
|
107
|
-
const S =
|
|
108
|
-
({ className:
|
|
109
|
-
const { addFiles:
|
|
109
|
+
const S = r.forwardRef(
|
|
110
|
+
({ className: a, label: t, subLabel: l, ...o }, h) => {
|
|
111
|
+
const { addFiles: n, accept: f, disabled: d, files: b, maxFiles: m } = D(), [s, c] = r.useState(!1), g = r.useRef(null);
|
|
110
112
|
if (b.length >= m)
|
|
111
113
|
return null;
|
|
112
|
-
const
|
|
113
|
-
i.preventDefault(),
|
|
114
|
-
},
|
|
115
|
-
i.preventDefault(),
|
|
116
|
-
}, F = (i) => {
|
|
117
|
-
i.preventDefault(), d(!1), !n && i.dataTransfer.files?.length && p(Array.from(i.dataTransfer.files));
|
|
118
|
-
}, w = () => {
|
|
119
|
-
n || g.current?.click();
|
|
114
|
+
const u = (i) => {
|
|
115
|
+
i.preventDefault(), d || c(!0);
|
|
116
|
+
}, x = (i) => {
|
|
117
|
+
i.preventDefault(), c(!1);
|
|
120
118
|
}, v = (i) => {
|
|
121
|
-
i.
|
|
119
|
+
i.preventDefault(), c(!1), !d && i.dataTransfer.files?.length && n(Array.from(i.dataTransfer.files));
|
|
120
|
+
}, w = () => {
|
|
121
|
+
d || g.current?.click();
|
|
122
|
+
}, F = (i) => {
|
|
123
|
+
i.target.files?.length && (n(Array.from(i.target.files)), i.target.value = "");
|
|
122
124
|
}, y = f.length > 0 ? f.map((i) => `.${i}`).join(",") : void 0;
|
|
123
125
|
return /* @__PURE__ */ N(
|
|
124
126
|
"div",
|
|
125
127
|
{
|
|
126
128
|
ref: h,
|
|
127
129
|
onClick: w,
|
|
128
|
-
onDragOver:
|
|
129
|
-
onDragLeave:
|
|
130
|
-
onDrop:
|
|
131
|
-
className:
|
|
130
|
+
onDragOver: u,
|
|
131
|
+
onDragLeave: x,
|
|
132
|
+
onDrop: v,
|
|
133
|
+
className: p(
|
|
132
134
|
"relative flex flex-col items-center justify-end p-4 pt-6 pb-6 gap-2 h-[148px] rounded-lg border border-dashed border-[#b3bdf8] bg-transparent cursor-pointer transition-colors",
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
s && "border-primary bg-primary/5",
|
|
136
|
+
d && "opacity-50 cursor-not-allowed",
|
|
137
|
+
a
|
|
136
138
|
),
|
|
137
|
-
|
|
139
|
+
"data-component": "file-upload-dropzone",
|
|
140
|
+
"data-state": s ? "drag-over" : "idle",
|
|
141
|
+
...o,
|
|
138
142
|
children: [
|
|
139
143
|
/* @__PURE__ */ e(
|
|
140
144
|
"input",
|
|
@@ -144,18 +148,18 @@ const S = s.forwardRef(
|
|
|
144
148
|
multiple: !0,
|
|
145
149
|
className: "hidden",
|
|
146
150
|
accept: y,
|
|
147
|
-
onChange:
|
|
148
|
-
disabled:
|
|
151
|
+
onChange: F,
|
|
152
|
+
disabled: d
|
|
149
153
|
}
|
|
150
154
|
),
|
|
151
|
-
/* @__PURE__ */ e("div", { className: "absolute top-[24px] left-1/2 -translate-x-1/2 pointer-events-none", children: /* @__PURE__ */ e(
|
|
155
|
+
/* @__PURE__ */ e("div", { className: "absolute top-[24px] left-1/2 -translate-x-1/2 pointer-events-none", children: /* @__PURE__ */ e(C, { size: 56 }) }),
|
|
152
156
|
/* @__PURE__ */ N("div", { className: "text-center space-y-1 z-10 mt-auto", children: [
|
|
153
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-[#1f2b4d] leading-5", children:
|
|
157
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-[#1f2b4d] leading-5", children: t || /* @__PURE__ */ N(z, { children: [
|
|
154
158
|
"Drag your files here or",
|
|
155
159
|
" ",
|
|
156
160
|
/* @__PURE__ */ e("span", { className: "text-primary font-bold hover:underline", children: "Choose File" })
|
|
157
161
|
] }) }),
|
|
158
|
-
|
|
162
|
+
l && /* @__PURE__ */ e("p", { className: "text-xs font-medium text-[#7a8294]", children: l })
|
|
159
163
|
] })
|
|
160
164
|
]
|
|
161
165
|
}
|
|
@@ -163,18 +167,18 @@ const S = s.forwardRef(
|
|
|
163
167
|
}
|
|
164
168
|
);
|
|
165
169
|
S.displayName = "FileUploadDropZone";
|
|
166
|
-
const _ =
|
|
170
|
+
const _ = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e("div", { ref: o, className: p("flex flex-col gap-3", a), ...l, children: t }));
|
|
167
171
|
_.displayName = "FileUploadList";
|
|
168
|
-
const E =
|
|
169
|
-
({ className:
|
|
170
|
-
const { removeFile:
|
|
171
|
-
|
|
172
|
-
}, b = (
|
|
173
|
-
if (
|
|
174
|
-
const
|
|
175
|
-
return parseFloat((
|
|
176
|
-
}, m = (
|
|
177
|
-
switch (
|
|
172
|
+
const E = r.forwardRef(
|
|
173
|
+
({ className: a, file: t, onRemove: l, ...o }, h) => {
|
|
174
|
+
const { removeFile: n, disabled: f } = D(), d = (s) => {
|
|
175
|
+
s.stopPropagation(), l ? l() : n(t);
|
|
176
|
+
}, b = (s) => {
|
|
177
|
+
if (s === 0) return "0 B";
|
|
178
|
+
const c = 1024, g = ["B", "KB", "MB", "GB"], u = Math.floor(Math.log(s) / Math.log(c));
|
|
179
|
+
return parseFloat((s / Math.pow(c, u)).toFixed(2)) + " " + g[u];
|
|
180
|
+
}, m = (s) => {
|
|
181
|
+
switch (s.split(".").pop()?.toLowerCase()) {
|
|
178
182
|
case "xls":
|
|
179
183
|
case "xlsx":
|
|
180
184
|
return /* @__PURE__ */ e(B, { size: 36 });
|
|
@@ -190,26 +194,29 @@ const E = s.forwardRef(
|
|
|
190
194
|
"div",
|
|
191
195
|
{
|
|
192
196
|
ref: h,
|
|
193
|
-
className:
|
|
197
|
+
className: p(
|
|
194
198
|
"flex flex-col justify-between items-stretch gap-2 p-4 border border-[#e7e7e7] rounded-xl bg-white",
|
|
195
|
-
|
|
199
|
+
a
|
|
196
200
|
),
|
|
197
|
-
|
|
201
|
+
"data-component": "file-upload-item",
|
|
202
|
+
"data-file-name": t.name,
|
|
203
|
+
"data-file-size": t.size,
|
|
204
|
+
...o,
|
|
198
205
|
children: /* @__PURE__ */ N("div", { className: "flex justify-between items-center gap-2 z-10", children: [
|
|
199
206
|
/* @__PURE__ */ N("div", { className: "flex gap-2", children: [
|
|
200
|
-
/* @__PURE__ */ e("div", { className: "w-9 h-9 shrink-0", children: m(
|
|
207
|
+
/* @__PURE__ */ e("div", { className: "w-9 h-9 shrink-0", children: m(t.name) }),
|
|
201
208
|
/* @__PURE__ */ N("div", { className: "flex flex-col justify-between gap-[2px]", children: [
|
|
202
|
-
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-[#0b0b0b] leading-[18px] line-clamp-1 break-all", children:
|
|
203
|
-
/* @__PURE__ */ e("span", { className: "text-xs font-medium text-[#6d6d6d] leading-[16px]", children: b(
|
|
209
|
+
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-[#0b0b0b] leading-[18px] line-clamp-1 break-all", children: t.name }),
|
|
210
|
+
/* @__PURE__ */ e("span", { className: "text-xs font-medium text-[#6d6d6d] leading-[16px]", children: b(t.size) })
|
|
204
211
|
] })
|
|
205
212
|
] }),
|
|
206
213
|
!f && /* @__PURE__ */ e(
|
|
207
214
|
"button",
|
|
208
215
|
{
|
|
209
|
-
onClick:
|
|
216
|
+
onClick: d,
|
|
210
217
|
className: "flex items-center justify-center text-[#60697d] hover:text-destructive transition-colors",
|
|
211
218
|
type: "button",
|
|
212
|
-
children: /* @__PURE__ */ e(
|
|
219
|
+
children: /* @__PURE__ */ e(R, { size: 14 })
|
|
213
220
|
}
|
|
214
221
|
)
|
|
215
222
|
] })
|
|
@@ -218,13 +225,13 @@ const E = s.forwardRef(
|
|
|
218
225
|
}
|
|
219
226
|
);
|
|
220
227
|
E.displayName = "FileUploadItem";
|
|
221
|
-
const H =
|
|
228
|
+
const H = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
|
|
222
229
|
"div",
|
|
223
230
|
{
|
|
224
|
-
ref:
|
|
225
|
-
className:
|
|
226
|
-
...
|
|
227
|
-
children:
|
|
231
|
+
ref: o,
|
|
232
|
+
className: p("flex items-center justify-end gap-4 mt-auto", a),
|
|
233
|
+
...l,
|
|
234
|
+
children: t
|
|
228
235
|
}
|
|
229
236
|
));
|
|
230
237
|
H.displayName = "FileUploadFooter";
|