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.
Files changed (120) hide show
  1. package/dist/components/layout/dashboard-layout.d.ts +21 -6
  2. package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +32 -33
  3. package/dist/components/ui/accordion.js +25 -23
  4. package/dist/components/ui/ag-grid-react/cell-renderers/date-display-renderer.js +32 -21
  5. package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.d.ts +3 -5
  6. package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +57 -55
  7. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +5 -0
  8. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +50 -52
  9. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
  10. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +34 -34
  11. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +8 -11
  12. package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +17 -17
  13. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +3 -3
  14. package/dist/components/ui/alert-dialog.js +45 -40
  15. package/dist/components/ui/alert.d.ts +21 -4
  16. package/dist/components/ui/alert.js +45 -25
  17. package/dist/components/ui/avatar.js +19 -16
  18. package/dist/components/ui/badge.js +8 -1
  19. package/dist/components/ui/breadcrumb.js +1 -0
  20. package/dist/components/ui/button-group.d.ts +1 -1
  21. package/dist/components/ui/button-group.js +27 -32
  22. package/dist/components/ui/button-variants.d.ts +1 -1
  23. package/dist/components/ui/button.d.ts +11 -0
  24. package/dist/components/ui/button.js +11 -9
  25. package/dist/components/ui/calendar.d.ts +14 -2
  26. package/dist/components/ui/calendar.js +443 -376
  27. package/dist/components/ui/card.js +7 -6
  28. package/dist/components/ui/checkbox.js +64 -48
  29. package/dist/components/ui/chips.d.ts +1 -0
  30. package/dist/components/ui/chips.js +27 -19
  31. package/dist/components/ui/data-table/data-table-column-list.d.ts +4 -1
  32. package/dist/components/ui/data-table/data-table-column-list.js +58 -54
  33. package/dist/components/ui/data-table/data-table-sheet.d.ts +1 -1
  34. package/dist/components/ui/data-table/data-table-sheet.js +43 -40
  35. package/dist/components/ui/data-table/data-table-view-options.js +17 -17
  36. package/dist/components/ui/data-table/data-table.js +21 -20
  37. package/dist/components/ui/date-picker/date-picker.js +93 -93
  38. package/dist/components/ui/date-picker/date-range-picker.js +142 -133
  39. package/dist/components/ui/date-picker/month-picker.js +96 -93
  40. package/dist/components/ui/date-picker/month-range-picker.js +144 -134
  41. package/dist/components/ui/date-picker/multi-date-picker.js +43 -45
  42. package/dist/components/ui/date-picker/multi-month-picker.js +37 -39
  43. package/dist/components/ui/date-picker/multi-week-picker.js +56 -46
  44. package/dist/components/ui/date-picker/week-picker.js +119 -109
  45. package/dist/components/ui/date-picker/week-range-picker.js +170 -147
  46. package/dist/components/ui/dialog.js +15 -6
  47. package/dist/components/ui/drawer.js +16 -13
  48. package/dist/components/ui/dropdown-menu.js +4 -2
  49. package/dist/components/ui/dynamic-layout.d.ts +2 -2
  50. package/dist/components/ui/dynamic-layout.js +18 -15
  51. package/dist/components/ui/empty-container.js +69 -64
  52. package/dist/components/ui/file-upload.js +113 -106
  53. package/dist/components/ui/filter-panel/filter-panel.js +49 -46
  54. package/dist/components/ui/filter-strip/filter-strip.js +41 -37
  55. package/dist/components/ui/header.js +26 -25
  56. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +43 -40
  57. package/dist/components/ui/hover-card.js +6 -5
  58. package/dist/components/ui/input.d.ts +1 -1
  59. package/dist/components/ui/input.js +79 -68
  60. package/dist/components/ui/loader.d.ts +1 -0
  61. package/dist/components/ui/loader.js +23 -13
  62. package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -3
  63. package/dist/components/ui/nested-list/components/NestedListContent.js +16 -15
  64. package/dist/components/ui/nested-list/components/SortableItem.js +116 -80
  65. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +13 -1
  66. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +162 -112
  67. package/dist/components/ui/nested-list/nested-list.js +182 -189
  68. package/dist/components/ui/notification-panel/notification-item.js +19 -17
  69. package/dist/components/ui/notification-panel/notification-list.js +21 -21
  70. package/dist/components/ui/notification-panel/notification-panel.js +25 -25
  71. package/dist/components/ui/popover.js +37 -34
  72. package/dist/components/ui/progress.js +12 -10
  73. package/dist/components/ui/prompt.js +29 -27
  74. package/dist/components/ui/radio-group.js +55 -46
  75. package/dist/components/ui/select/components/Submenu.d.ts +1 -2
  76. package/dist/components/ui/select/components/Submenu.js +52 -48
  77. package/dist/components/ui/select/select.js +321 -324
  78. package/dist/components/ui/sheet.js +18 -15
  79. package/dist/components/ui/sidebar.d.ts +2 -2
  80. package/dist/components/ui/sidebar.js +3 -3
  81. package/dist/components/ui/skeleton.d.ts +2 -1
  82. package/dist/components/ui/skeleton.js +12 -11
  83. package/dist/components/ui/slider.js +39 -12
  84. package/dist/components/ui/smart-input.js +44 -39
  85. package/dist/components/ui/stepper.js +33 -29
  86. package/dist/components/ui/switch.js +6 -4
  87. package/dist/components/ui/tabs.js +50 -45
  88. package/dist/components/ui/tag-group.d.ts +2 -1
  89. package/dist/components/ui/tag-group.js +29 -25
  90. package/dist/components/ui/tag.d.ts +1 -0
  91. package/dist/components/ui/tag.js +26 -20
  92. package/dist/components/ui/textarea.js +18 -17
  93. package/dist/components/ui/toast.d.ts +1 -1
  94. package/dist/components/ui/toast.js +47 -41
  95. package/dist/components/ui/toaster.js +42 -42
  96. package/dist/components/ui/tooltip.js +18 -16
  97. package/dist/components/ui/types/date-picker.types.d.ts +33 -0
  98. package/dist/components/ui/types/empty-container.types.d.ts +5 -0
  99. package/dist/components/ui/types/nested-list.types.d.ts +1 -0
  100. package/dist/components/ui/types/select.types.d.ts +0 -1
  101. package/dist/icons/assets/bookmark.svg.js +4 -0
  102. package/dist/icons/assets/bookmark.svg2.js +5 -0
  103. package/dist/icons/assets/bookmarkFilled.svg.js +4 -0
  104. package/dist/icons/assets/bookmarkFilled.svg2.js +5 -0
  105. package/dist/icons/assets/download.svg.js +4 -0
  106. package/dist/icons/assets/download.svg2.js +5 -0
  107. package/dist/icons/index.d.ts +20 -6
  108. package/dist/icons/index.js +398 -370
  109. package/dist/impact-nova.css +1 -1
  110. package/dist/index.d.ts +1 -0
  111. package/dist/index.js +318 -314
  112. package/dist/lib/fiscal-calendar.d.ts +62 -0
  113. package/dist/lib/fiscal-calendar.js +99 -0
  114. package/dist/lib/utils.d.ts +2 -1
  115. package/dist/lib/utils.js +29 -13
  116. package/package.json +5 -5
  117. package/dist/components/ui/select/hooks/useClickOutside.d.ts +0 -15
  118. package/dist/components/ui/select/hooks/useClickOutside.js +0 -43
  119. package/dist/components/ui/select/hooks/useMenuPosition.d.ts +0 -2
  120. package/dist/components/ui/select/hooks/useMenuPosition.js +0 -89
@@ -1,46 +1,39 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import * as r from "react";
3
- import { cn as i } from "../../lib/utils.js";
4
- import { EmptyState1 as E, EmptyState2 as C, EmptyState3 as w, EmptyState4 as b, EmptyState5 as N, EmptyState6 as I } from "../../icons/index.js";
5
- const l = [
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: C, width: 200, height: 200 },
8
- { Component: w, width: 225, height: 150 },
9
- { Component: b, width: 250, height: 180 },
10
- { Component: N, width: 225, height: 150 },
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
- ], S = r.forwardRef(
13
- ({ className: a, children: t, ...e }, n) => /* @__PURE__ */ o(
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: n,
17
- className: i(
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
- a
20
+ o
20
21
  ),
21
- ...e,
22
- children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center max-w-[650px] gap-4", children: t })
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
- S.displayName = "EmptyContainer";
27
- const R = r.forwardRef(
28
- ({ className: a, children: t, width: e, height: n, ...d }, p) => {
29
- const [m, c] = r.useState(
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 (m !== null) {
41
- const { Component: s, width: g, height: x } = l[m];
42
- return /* @__PURE__ */ o(
43
- s,
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
- }, f = m !== null ? l[m] : null, u = e || (t ? "auto" : f?.width || 225), y = n || (t ? "auto" : f?.height || 150);
55
- return /* @__PURE__ */ o(
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: p,
59
- className: i(
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
- a
55
+ o
63
56
  ),
64
57
  style: {
65
58
  width: u,
66
59
  height: y,
67
- ...d.style
60
+ ...i.style
68
61
  },
69
- ...d,
62
+ "data-component": "empty-container-image",
63
+ ...i,
70
64
  children: h()
71
65
  }
72
66
  );
73
67
  }
74
68
  );
75
- R.displayName = "EmptyContainerImage";
76
- const v = r.forwardRef(
77
- ({ className: a, children: t, ...e }, n) => /* @__PURE__ */ o(
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: n,
81
- className: i("text-xl font-bold tracking-tight text-foreground", a),
82
- ...e,
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
- v.displayName = "EmptyContainerTitle";
88
- const T = r.forwardRef(({ className: a, children: t, ...e }, n) => /* @__PURE__ */ o(
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: n,
92
- className: i("text-base font-medium text-secondary-foreground leading-relaxed", a),
93
- ...e,
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
- T.displayName = "EmptyContainerDescription";
98
- const j = r.forwardRef(
99
- ({ className: a, children: t, ...e }, n) => /* @__PURE__ */ o("div", { ref: n, className: i("mt-6 flex flex-wrap items-center justify-center gap-3", a), ...e, children: t })
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
- j.displayName = "EmptyContainerAction";
106
+ A.displayName = "EmptyContainerAction";
102
107
  export {
103
- S as EmptyContainer,
104
- j as EmptyContainerAction,
105
- T as EmptyContainerDescription,
106
- R as EmptyContainerImage,
107
- v as EmptyContainerTitle
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 C } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import { cn as c } from "../../lib/utils.js";
4
- import { FileUpload as R, Delete as z, Document as j, Text as k, Csv as T, Excel as B } from "../../icons/index.js";
5
- const U = s.createContext(
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 t = s.useContext(U);
9
- if (!t)
8
+ const a = r.useContext(U);
9
+ if (!a)
10
10
  throw new Error("useFileUpload must be used within a FileUpload component");
11
- return t;
12
- }, I = s.forwardRef(
11
+ return a;
12
+ }, I = r.forwardRef(
13
13
  ({
14
- className: t,
15
- children: l,
16
- onFilesChange: a,
17
- maxFiles: r = 1,
14
+ className: a,
15
+ children: t,
16
+ onFilesChange: l,
17
+ maxFiles: o = 1,
18
18
  accept: h = [],
19
- disabled: p = !1,
19
+ disabled: n = !1,
20
20
  value: f = [],
21
- ...n
21
+ ...d
22
22
  }, b) => {
23
- const [m, o] = s.useState(f);
24
- s.useEffect(() => {
25
- o(f);
23
+ const [m, s] = r.useState(f);
24
+ r.useEffect(() => {
25
+ s(f);
26
26
  }, [f]);
27
- const d = (x) => {
28
- if (p) return;
29
- let u = x;
30
- h.length > 0 && (u = u.filter((v) => {
31
- const y = v.name.split(".").pop()?.toLowerCase();
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 F = r - m.length;
35
- if (F <= 0) return;
36
- const w = u.slice(0, F);
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 v = [...m, ...w];
39
- o(v), a?.(v);
38
+ const F = [...m, ...w];
39
+ s(F), l?.(F);
40
40
  }
41
- }, g = (x) => {
42
- if (p) return;
43
- const u = m.filter((F) => F !== x);
44
- o(u), a?.(u);
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: d, removeFile: g, maxFiles: r, accept: h, disabled: p },
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: c("w-full max-w-[550px]", t),
55
- ...n,
56
- children: l
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 = s.forwardRef(({ className: t, children: l, ...a }, r) => /* @__PURE__ */ e(
66
+ const L = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
65
67
  "div",
66
68
  {
67
- ref: r,
68
- className: c(
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
- t
72
+ a
71
73
  ),
72
- ...a,
73
- children: l
74
+ ...l,
75
+ children: t
74
76
  }
75
77
  ));
76
78
  L.displayName = "FileUploadContent";
77
- const M = s.forwardRef(({ className: t, children: l, ...a }, r) => /* @__PURE__ */ e(
79
+ const M = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
78
80
  "div",
79
81
  {
80
- ref: r,
81
- className: c("flex justify-between items-center w-full", t),
82
- ...a,
83
- children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-[2px] w-full", children: l })
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 = s.forwardRef(({ className: t, children: l, ...a }, r) => /* @__PURE__ */ e(
89
+ const A = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
88
90
  "h3",
89
91
  {
90
- ref: r,
91
- className: c("text-base font-extrabold text-foreground leading-6", t),
92
- ...a,
93
- children: l
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 = s.forwardRef(({ className: t, children: l, ...a }, r) => /* @__PURE__ */ e(
99
+ const O = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
98
100
  "p",
99
101
  {
100
- ref: r,
101
- className: c("text-sm font-medium text-[#7a8294] leading-5", t),
102
- ...a,
103
- children: l
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 = s.forwardRef(
108
- ({ className: t, label: l, subLabel: a, ...r }, h) => {
109
- const { addFiles: p, accept: f, disabled: n, files: b, maxFiles: m } = D(), [o, d] = s.useState(!1), g = s.useRef(null);
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 x = (i) => {
113
- i.preventDefault(), n || d(!0);
114
- }, u = (i) => {
115
- i.preventDefault(), d(!1);
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.target.files?.length && (p(Array.from(i.target.files)), i.target.value = "");
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: x,
129
- onDragLeave: u,
130
- onDrop: F,
131
- className: c(
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
- o && "border-primary bg-primary/5",
134
- n && "opacity-50 cursor-not-allowed",
135
- t
135
+ s && "border-primary bg-primary/5",
136
+ d && "opacity-50 cursor-not-allowed",
137
+ a
136
138
  ),
137
- ...r,
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: v,
148
- disabled: n
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(R, { size: 56 }) }),
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: l || /* @__PURE__ */ N(C, { 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
- a && /* @__PURE__ */ e("p", { className: "text-xs font-medium text-[#7a8294]", children: a })
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 _ = s.forwardRef(({ className: t, children: l, ...a }, r) => /* @__PURE__ */ e("div", { ref: r, className: c("flex flex-col gap-3", t), ...a, children: l }));
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 = s.forwardRef(
169
- ({ className: t, file: l, onRemove: a, ...r }, h) => {
170
- const { removeFile: p, disabled: f } = D(), n = (o) => {
171
- o.stopPropagation(), a ? a() : p(l);
172
- }, b = (o) => {
173
- if (o === 0) return "0 B";
174
- const d = 1024, g = ["B", "KB", "MB", "GB"], x = Math.floor(Math.log(o) / Math.log(d));
175
- return parseFloat((o / Math.pow(d, x)).toFixed(2)) + " " + g[x];
176
- }, m = (o) => {
177
- switch (o.split(".").pop()?.toLowerCase()) {
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: c(
197
+ className: p(
194
198
  "flex flex-col justify-between items-stretch gap-2 p-4 border border-[#e7e7e7] rounded-xl bg-white",
195
- t
199
+ a
196
200
  ),
197
- ...r,
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(l.name) }),
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: l.name }),
203
- /* @__PURE__ */ e("span", { className: "text-xs font-medium text-[#6d6d6d] leading-[16px]", children: b(l.size) })
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: n,
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(z, { size: 14 })
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 = s.forwardRef(({ className: t, children: l, ...a }, r) => /* @__PURE__ */ e(
228
+ const H = r.forwardRef(({ className: a, children: t, ...l }, o) => /* @__PURE__ */ e(
222
229
  "div",
223
230
  {
224
- ref: r,
225
- className: c("flex items-center justify-end gap-4 mt-auto", t),
226
- ...a,
227
- children: l
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";