impact-nova 1.3.0 → 1.5.2

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 (117) hide show
  1. package/README.md +49 -0
  2. package/dist/components/layout/dashboard-layout.d.ts +15 -1
  3. package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +65 -64
  4. package/dist/components/ui/accordion.js +38 -34
  5. package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +1 -1
  6. package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.d.ts +58 -0
  7. package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.js +104 -0
  8. package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +62 -54
  9. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +4 -6
  10. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +54 -68
  11. package/dist/components/ui/ag-grid-react/cell-renderers/index.d.ts +3 -1
  12. package/dist/components/ui/ag-grid-react/cell-renderers/index.js +33 -27
  13. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +3 -0
  14. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.js +28 -12
  15. package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.d.ts +2 -0
  16. package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +45 -44
  17. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.d.ts +4 -6
  18. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +23 -37
  19. package/dist/components/ui/ag-grid-react/cell-renderers/types.d.ts +33 -17
  20. package/dist/components/ui/ag-grid-react/editable-utils.d.ts +27 -0
  21. package/dist/components/ui/ag-grid-react/editable-utils.js +62 -0
  22. package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +99 -98
  23. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +110 -143
  24. package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +72 -69
  25. package/dist/components/ui/ag-grid-react/headers/components/header-info.js +36 -35
  26. package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +14 -12
  27. package/dist/components/ui/ag-grid-react/headers/custom-header.js +111 -110
  28. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +204 -203
  29. package/dist/components/ui/alert.js +62 -58
  30. package/dist/components/ui/breadcrumb.js +81 -74
  31. package/dist/components/ui/calendar.js +354 -354
  32. package/dist/components/ui/chart/chart.js +63 -62
  33. package/dist/components/ui/chips.js +42 -38
  34. package/dist/components/ui/command-palette/command-palette-context.d.ts +52 -0
  35. package/dist/components/ui/command-palette/command-palette-context.js +110 -0
  36. package/dist/components/ui/command-palette/command-palette.d.ts +67 -0
  37. package/dist/components/ui/command-palette/command-palette.js +402 -0
  38. package/dist/components/ui/command-palette/index.d.ts +23 -0
  39. package/dist/components/ui/command-palette/index.js +44 -0
  40. package/dist/components/ui/command-palette/kbd.d.ts +28 -0
  41. package/dist/components/ui/command-palette/kbd.js +52 -0
  42. package/dist/components/ui/command-palette/shortcut-registry.d.ts +68 -0
  43. package/dist/components/ui/command-palette/shortcut-registry.js +183 -0
  44. package/dist/components/ui/command-palette/shortcut-scope-provider.d.ts +55 -0
  45. package/dist/components/ui/command-palette/shortcut-scope-provider.js +55 -0
  46. package/dist/components/ui/command-palette/shortcut-settings.d.ts +27 -0
  47. package/dist/components/ui/command-palette/shortcut-settings.js +266 -0
  48. package/dist/components/ui/command-palette/use-browser-shortcuts.d.ts +32 -0
  49. package/dist/components/ui/command-palette/use-browser-shortcuts.js +48 -0
  50. package/dist/components/ui/command-palette/use-global-shortcut.d.ts +3 -0
  51. package/dist/components/ui/command-palette/use-global-shortcut.js +7 -0
  52. package/dist/components/ui/command-palette/use-shortcut.d.ts +47 -0
  53. package/dist/components/ui/command-palette/use-shortcut.js +49 -0
  54. package/dist/components/ui/command-palette/utils.d.ts +119 -0
  55. package/dist/components/ui/command-palette/utils.js +248 -0
  56. package/dist/components/ui/data-table/data-table-column-list.js +87 -86
  57. package/dist/components/ui/data-table/data-table-format-options.js +45 -44
  58. package/dist/components/ui/data-table/data-table-view-options.js +39 -38
  59. package/dist/components/ui/date-picker/date-picker.js +89 -87
  60. package/dist/components/ui/date-picker/date-range-picker.js +140 -138
  61. package/dist/components/ui/date-picker/month-picker.js +82 -81
  62. package/dist/components/ui/date-picker/month-range-picker.js +108 -105
  63. package/dist/components/ui/date-picker/multi-date-picker.js +68 -66
  64. package/dist/components/ui/date-picker/multi-month-picker.js +59 -58
  65. package/dist/components/ui/date-picker/multi-week-picker.js +80 -78
  66. package/dist/components/ui/date-picker/week-picker.js +117 -115
  67. package/dist/components/ui/date-picker/week-range-picker.js +166 -164
  68. package/dist/components/ui/dialog.js +78 -73
  69. package/dist/components/ui/drawer.js +71 -66
  70. package/dist/components/ui/file-upload.js +131 -127
  71. package/dist/components/ui/filter-panel/filter-panel.js +98 -94
  72. package/dist/components/ui/filter-strip/filter-strip.js +95 -91
  73. package/dist/components/ui/filter-strip/filter-summary.js +91 -90
  74. package/dist/components/ui/header.js +57 -53
  75. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +78 -76
  76. package/dist/components/ui/loader.js +17 -16
  77. package/dist/components/ui/nested-list/components/NestedListHeader.d.ts +1 -0
  78. package/dist/components/ui/nested-list/components/NestedListHeader.js +51 -48
  79. package/dist/components/ui/nested-list/components/SortableItem.js +60 -59
  80. package/dist/components/ui/nested-list/nested-list.js +184 -182
  81. package/dist/components/ui/notification-panel/notification-panel.js +60 -53
  82. package/dist/components/ui/popover.js +45 -40
  83. package/dist/components/ui/prompt.js +90 -86
  84. package/dist/components/ui/select/select.js +206 -209
  85. package/dist/components/ui/sheet.d.ts +1 -0
  86. package/dist/components/ui/sheet.js +50 -48
  87. package/dist/components/ui/sidebar.js +273 -267
  88. package/dist/components/ui/stepper.js +75 -63
  89. package/dist/components/ui/tag.js +48 -44
  90. package/dist/components/ui/toast.js +46 -41
  91. package/dist/i18n/ImpactNovaI18nContext.d.ts +21 -0
  92. package/dist/i18n/ImpactNovaI18nContext.js +76 -0
  93. package/dist/i18n/defaultMessages.d.ts +231 -0
  94. package/dist/i18n/defaultMessages.js +206 -0
  95. package/dist/i18n/getDateFnsLocale.d.ts +11 -0
  96. package/dist/i18n/getDateFnsLocale.js +21 -0
  97. package/dist/i18n/index.d.ts +5 -0
  98. package/dist/i18n/locales/de.d.ts +2 -0
  99. package/dist/i18n/locales/de.js +206 -0
  100. package/dist/i18n/locales/es.d.ts +2 -0
  101. package/dist/i18n/locales/es.js +206 -0
  102. package/dist/i18n/locales/hi.d.ts +2 -0
  103. package/dist/i18n/locales/hi.js +206 -0
  104. package/dist/i18n/locales/index.d.ts +4 -0
  105. package/dist/i18n/locales/kn.d.ts +2 -0
  106. package/dist/i18n/locales/kn.js +206 -0
  107. package/dist/icons/assets/boxAdd.svg.js +5 -0
  108. package/dist/icons/assets/boxed.svg.js +5 -0
  109. package/dist/icons/assets/trolley.svg.js +5 -0
  110. package/dist/icons/assets/unlocked.svg.js +5 -0
  111. package/dist/icons/index.d.ts +4 -0
  112. package/dist/icons/index.js +179 -171
  113. package/dist/impact-nova.css +1 -1
  114. package/dist/index.d.ts +4 -0
  115. package/dist/index.js +232 -172
  116. package/package.json +36 -4
  117. package/dist/components/ui/ag-grid-react/cell-renderers/types.js +0 -74
@@ -1,86 +1,91 @@
1
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as n } from "react/jsx-runtime";
2
2
  import * as i from "react";
3
- import { Drawer as a } from "vaul";
4
- import { X as m } from "lucide-react";
3
+ import { Drawer as t } from "vaul";
4
+ import { X as f } from "lucide-react";
5
5
  import { cn as s } from "../../lib/utils.js";
6
- import { Tooltip as p, TooltipTrigger as f, TooltipContent as g } from "./tooltip.js";
7
- const w = ({
6
+ import { Tooltip as g, TooltipTrigger as w, TooltipContent as u } from "./tooltip.js";
7
+ import { useImpactNovaI18n as N } from "../../i18n/ImpactNovaI18nContext.js";
8
+ const x = ({
8
9
  shouldScaleBackground: e = !0,
9
10
  ...r
10
- }) => /* @__PURE__ */ t(
11
- a.Root,
11
+ }) => /* @__PURE__ */ a(
12
+ t.Root,
12
13
  {
13
14
  shouldScaleBackground: e,
14
15
  ...r
15
16
  }
16
17
  );
17
- w.displayName = "Drawer";
18
- const k = a.Trigger, u = a.Portal, O = a.Close, l = i.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
19
- a.Overlay,
18
+ x.displayName = "Drawer";
19
+ const F = t.Trigger, D = t.Portal, H = t.Close, c = i.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ a(
20
+ t.Overlay,
20
21
  {
21
22
  ref: o,
22
23
  className: s("fixed inset-0 z-50 bg-black/80", e),
23
24
  ...r
24
25
  }
25
26
  ));
26
- l.displayName = a.Overlay.displayName;
27
- const N = i.forwardRef(({ className: e, children: r, hideClose: o, ...d }, c) => /* @__PURE__ */ n(u, { children: [
28
- /* @__PURE__ */ t(l, {}),
29
- /* @__PURE__ */ n(
30
- a.Content,
31
- {
32
- ref: c,
33
- "data-component": "drawer-content",
34
- className: s(
35
- "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
36
- e
37
- ),
38
- ...d,
39
- children: [
40
- /* @__PURE__ */ t("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
41
- r,
42
- !o && /* @__PURE__ */ n(p, { children: [
43
- /* @__PURE__ */ t(f, { asChild: !0, children: /* @__PURE__ */ n(
44
- a.Close,
45
- {
46
- className: "absolute right-4 top-4 rounded-sm opacity-50 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
47
- children: [
48
- /* @__PURE__ */ t(m, { className: "h-4 w-4" }),
49
- /* @__PURE__ */ t("span", { className: "sr-only", children: "Close" })
50
- ]
51
- }
52
- ) }),
53
- /* @__PURE__ */ t(g, { variant: "tertiary", side: "top", children: "Close" })
54
- ] })
55
- ]
56
- }
57
- )
58
- ] }));
59
- N.displayName = "DrawerContent";
60
- const x = ({
27
+ c.displayName = t.Overlay.displayName;
28
+ const y = i.forwardRef(({ className: e, children: r, hideClose: o, ...d }, m) => {
29
+ const { t: p } = N(), l = p("aria.close");
30
+ return /* @__PURE__ */ n(D, { children: [
31
+ /* @__PURE__ */ a(c, {}),
32
+ /* @__PURE__ */ n(
33
+ t.Content,
34
+ {
35
+ ref: m,
36
+ "data-component": "drawer-content",
37
+ className: s(
38
+ "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
39
+ e
40
+ ),
41
+ ...d,
42
+ children: [
43
+ /* @__PURE__ */ a("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
44
+ r,
45
+ !o && /* @__PURE__ */ n(g, { children: [
46
+ /* @__PURE__ */ a(w, { asChild: !0, children: /* @__PURE__ */ n(
47
+ t.Close,
48
+ {
49
+ className: "absolute right-4 top-4 rounded-sm opacity-50 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
50
+ "aria-label": l,
51
+ children: [
52
+ /* @__PURE__ */ a(f, { className: "h-4 w-4" }),
53
+ /* @__PURE__ */ a("span", { className: "sr-only", children: l })
54
+ ]
55
+ }
56
+ ) }),
57
+ /* @__PURE__ */ a(u, { variant: "tertiary", side: "top", children: l })
58
+ ] })
59
+ ]
60
+ }
61
+ )
62
+ ] });
63
+ });
64
+ y.displayName = "DrawerContent";
65
+ const b = ({
61
66
  className: e,
62
67
  ...r
63
- }) => /* @__PURE__ */ t(
68
+ }) => /* @__PURE__ */ a(
64
69
  "div",
65
70
  {
66
71
  className: s("grid gap-1.5 p-4 text-center sm:text-left", e),
67
72
  ...r
68
73
  }
69
74
  );
70
- x.displayName = "DrawerHeader";
71
- const D = ({
75
+ b.displayName = "DrawerHeader";
76
+ const h = ({
72
77
  className: e,
73
78
  ...r
74
- }) => /* @__PURE__ */ t(
79
+ }) => /* @__PURE__ */ a(
75
80
  "div",
76
81
  {
77
82
  className: s("mt-auto flex flex-col gap-2 p-4", e),
78
83
  ...r
79
84
  }
80
85
  );
81
- D.displayName = "DrawerFooter";
82
- const y = i.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
83
- a.Title,
86
+ h.displayName = "DrawerFooter";
87
+ const v = i.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ a(
88
+ t.Title,
84
89
  {
85
90
  ref: o,
86
91
  "data-component": "drawer-title",
@@ -91,9 +96,9 @@ const y = i.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
91
96
  ...r
92
97
  }
93
98
  ));
94
- y.displayName = a.Title.displayName;
95
- const h = i.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
96
- a.Description,
99
+ v.displayName = t.Title.displayName;
100
+ const T = i.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ a(
101
+ t.Description,
97
102
  {
98
103
  ref: o,
99
104
  "data-component": "drawer-description",
@@ -101,16 +106,16 @@ const h = i.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
101
106
  ...r
102
107
  }
103
108
  ));
104
- h.displayName = a.Description.displayName;
109
+ T.displayName = t.Description.displayName;
105
110
  export {
106
- w as Drawer,
107
- O as DrawerClose,
108
- N as DrawerContent,
109
- h as DrawerDescription,
110
- D as DrawerFooter,
111
- x as DrawerHeader,
112
- l as DrawerOverlay,
113
- u as DrawerPortal,
114
- y as DrawerTitle,
115
- k as DrawerTrigger
111
+ x as Drawer,
112
+ H as DrawerClose,
113
+ y as DrawerContent,
114
+ T as DrawerDescription,
115
+ h as DrawerFooter,
116
+ b as DrawerHeader,
117
+ c as DrawerOverlay,
118
+ D as DrawerPortal,
119
+ v as DrawerTitle,
120
+ F as DrawerTrigger
116
121
  };
@@ -1,61 +1,62 @@
1
- import { jsx as e, jsxs as f, Fragment as j } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as m, Fragment as T } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
- import { cn as n } from "../../lib/utils.js";
4
- import { Cross as T, FileUpload as k, Delete as B, Document as I, Text as L, Csv as M, Excel as A } from "../../icons/index.js";
3
+ import { cn as p } from "../../lib/utils.js";
4
+ import { Cross as k, FileUpload as I, Delete as L, Document as B, Text as M, Csv as A, Excel as O } from "../../icons/index.js";
5
5
  import { Tooltip as U, TooltipTrigger as C, TooltipContent as D } from "./tooltip.js";
6
- const z = o.createContext(
6
+ import { useImpactNovaI18n as z } from "../../i18n/ImpactNovaI18nContext.js";
7
+ const R = o.createContext(
7
8
  void 0
8
- ), R = () => {
9
- const a = o.useContext(z);
9
+ ), j = () => {
10
+ const a = o.useContext(R);
10
11
  if (!a)
11
12
  throw new Error("useFileUpload must be used within a FileUpload component");
12
13
  return a;
13
- }, O = o.forwardRef(
14
+ }, S = o.forwardRef(
14
15
  ({
15
16
  className: a,
16
17
  children: t,
17
18
  onFilesChange: l,
18
19
  maxFiles: r = 1,
19
- accept: g = [],
20
- disabled: d = !1,
21
- value: m = [],
22
- ...c
20
+ accept: d = [],
21
+ disabled: c = !1,
22
+ value: u = [],
23
+ ...f
23
24
  }, N) => {
24
- const [u, i] = o.useState(m);
25
+ const [x, h] = o.useState(u);
25
26
  o.useEffect(() => {
26
- i(m);
27
- }, [m]);
28
- const p = (x) => {
29
- if (d) return;
30
- let h = x;
31
- g.length > 0 && (h = h.filter((b) => {
27
+ h(u);
28
+ }, [u]);
29
+ const i = (v) => {
30
+ if (c) return;
31
+ let n = v;
32
+ d.length > 0 && (n = n.filter((b) => {
32
33
  const y = b.name.split(".").pop()?.toLowerCase();
33
- return y && g.includes(y);
34
+ return y && d.includes(y);
34
35
  }));
35
- const F = r - u.length;
36
+ const F = r - x.length;
36
37
  if (F <= 0) return;
37
- const w = h.slice(0, F);
38
+ const w = n.slice(0, F);
38
39
  if (w.length > 0) {
39
- const b = [...u, ...w];
40
- i(b), l?.(b);
40
+ const b = [...x, ...w];
41
+ h(b), l?.(b);
41
42
  }
42
- }, v = (x) => {
43
- if (d) return;
44
- const h = u.filter((F) => F !== x);
45
- i(h), l?.(h);
43
+ }, g = (v) => {
44
+ if (c) return;
45
+ const n = x.filter((F) => F !== v);
46
+ h(n), l?.(n);
46
47
  };
47
48
  return /* @__PURE__ */ e(
48
- z.Provider,
49
+ R.Provider,
49
50
  {
50
- value: { files: u, addFiles: p, removeFile: v, maxFiles: r, accept: g, disabled: d },
51
+ value: { files: x, addFiles: i, removeFile: g, maxFiles: r, accept: d, disabled: c },
51
52
  children: /* @__PURE__ */ e(
52
53
  "div",
53
54
  {
54
55
  ref: N,
55
- className: n("w-full max-w-[550px]", a),
56
+ className: p("w-full max-w-[550px]", a),
56
57
  "data-component": "file-upload",
57
- "data-disabled": d || void 0,
58
- ...c,
58
+ "data-disabled": c || void 0,
59
+ ...f,
59
60
  children: t
60
61
  }
61
62
  )
@@ -63,12 +64,12 @@ const z = o.createContext(
63
64
  );
64
65
  }
65
66
  );
66
- O.displayName = "FileUpload";
67
- const S = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
67
+ S.displayName = "FileUpload";
68
+ const _ = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
68
69
  "div",
69
70
  {
70
71
  ref: r,
71
- className: n(
72
+ className: p(
72
73
  "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)]",
73
74
  a
74
75
  ),
@@ -76,101 +77,104 @@ const S = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__
76
77
  children: t
77
78
  }
78
79
  ));
79
- S.displayName = "FileUploadContent";
80
- const _ = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
80
+ _.displayName = "FileUploadContent";
81
+ const E = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
81
82
  "div",
82
83
  {
83
84
  ref: r,
84
- className: n("flex justify-between items-center w-full", a),
85
+ className: p("flex justify-between items-center w-full", a),
85
86
  ...l,
86
87
  children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-[2px] w-full", children: t })
87
88
  }
88
89
  ));
89
- _.displayName = "FileUploadHeader";
90
- const E = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
90
+ E.displayName = "FileUploadHeader";
91
+ const H = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
91
92
  "h3",
92
93
  {
93
94
  ref: r,
94
- className: n("text-base font-extrabold text-foreground leading-6", a),
95
+ className: p("text-base font-extrabold text-foreground leading-6", a),
95
96
  ...l,
96
97
  children: t
97
98
  }
98
99
  ));
99
- E.displayName = "FileUploadTitle";
100
- const H = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
100
+ H.displayName = "FileUploadTitle";
101
+ const P = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
101
102
  "p",
102
103
  {
103
104
  ref: r,
104
- className: n("text-sm font-medium text-[#7a8294] leading-5", a),
105
+ className: p("text-sm font-medium text-[#7a8294] leading-5", a),
105
106
  ...l,
106
107
  children: t
107
108
  }
108
109
  ));
109
- H.displayName = "FileUploadDescription";
110
- const P = o.forwardRef(({ className: a, ...t }, l) => /* @__PURE__ */ f(U, { children: [
111
- /* @__PURE__ */ e(C, { asChild: !0, children: /* @__PURE__ */ e(
112
- "button",
113
- {
114
- ref: l,
115
- className: n("text-[#60697d] hover:text-[#0d152c] transition-colors", a),
116
- type: "button",
117
- "aria-label": "Close",
118
- ...t,
119
- children: /* @__PURE__ */ e(T, { size: 16 })
120
- }
121
- ) }),
122
- /* @__PURE__ */ e(D, { side: "top", variant: "tertiary", children: "Close" })
123
- ] }));
124
- P.displayName = "FileUploadClose";
125
- const Z = o.forwardRef(
126
- ({ className: a, label: t, subLabel: l, ...r }, g) => {
127
- const { addFiles: d, accept: m, disabled: c, files: N, maxFiles: u } = R(), [i, p] = o.useState(!1), v = o.useRef(null);
128
- if (N.length >= u)
110
+ P.displayName = "FileUploadDescription";
111
+ const Z = o.forwardRef(({ className: a, ...t }, l) => {
112
+ const { t: r } = z(), d = r("aria.close");
113
+ return /* @__PURE__ */ m(U, { children: [
114
+ /* @__PURE__ */ e(C, { asChild: !0, children: /* @__PURE__ */ e(
115
+ "button",
116
+ {
117
+ ref: l,
118
+ className: p("text-[#60697d] hover:text-[#0d152c] transition-colors", a),
119
+ type: "button",
120
+ "aria-label": d,
121
+ ...t,
122
+ children: /* @__PURE__ */ e(k, { size: 16 })
123
+ }
124
+ ) }),
125
+ /* @__PURE__ */ e(D, { side: "top", variant: "tertiary", children: d })
126
+ ] });
127
+ });
128
+ Z.displayName = "FileUploadClose";
129
+ const $ = o.forwardRef(
130
+ ({ className: a, label: t, subLabel: l, ...r }, d) => {
131
+ const { addFiles: c, accept: u, disabled: f, files: N, maxFiles: x } = j(), [h, i] = o.useState(!1), g = o.useRef(null);
132
+ if (N.length >= x)
129
133
  return null;
130
- const x = (s) => {
131
- s.preventDefault(), c || p(!0);
132
- }, h = (s) => {
133
- s.preventDefault(), p(!1);
134
+ const v = (s) => {
135
+ s.preventDefault(), f || i(!0);
136
+ }, n = (s) => {
137
+ s.preventDefault(), i(!1);
134
138
  }, F = (s) => {
135
- s.preventDefault(), p(!1), !c && s.dataTransfer.files?.length && d(Array.from(s.dataTransfer.files));
139
+ s.preventDefault(), i(!1), !f && s.dataTransfer.files?.length && c(Array.from(s.dataTransfer.files));
136
140
  }, w = () => {
137
- c || v.current?.click();
141
+ f || g.current?.click();
138
142
  }, b = (s) => {
139
- s.target.files?.length && (d(Array.from(s.target.files)), s.target.value = "");
140
- }, y = m.length > 0 ? m.map((s) => `.${s}`).join(",") : void 0;
141
- return /* @__PURE__ */ f(
143
+ s.target.files?.length && (c(Array.from(s.target.files)), s.target.value = "");
144
+ }, y = u.length > 0 ? u.map((s) => `.${s}`).join(",") : void 0;
145
+ return /* @__PURE__ */ m(
142
146
  "div",
143
147
  {
144
- ref: g,
148
+ ref: d,
145
149
  onClick: w,
146
- onDragOver: x,
147
- onDragLeave: h,
150
+ onDragOver: v,
151
+ onDragLeave: n,
148
152
  onDrop: F,
149
- className: n(
153
+ className: p(
150
154
  "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",
151
- i && "border-primary bg-primary/5",
152
- c && "opacity-50 cursor-not-allowed",
155
+ h && "border-primary bg-primary/5",
156
+ f && "opacity-50 cursor-not-allowed",
153
157
  a
154
158
  ),
155
159
  "data-component": "file-upload-dropzone",
156
- "data-state": i ? "drag-over" : "idle",
160
+ "data-state": h ? "drag-over" : "idle",
157
161
  ...r,
158
162
  children: [
159
163
  /* @__PURE__ */ e(
160
164
  "input",
161
165
  {
162
- ref: v,
166
+ ref: g,
163
167
  type: "file",
164
168
  multiple: !0,
165
169
  className: "hidden",
166
170
  accept: y,
167
171
  onChange: b,
168
- disabled: c
172
+ disabled: f
169
173
  }
170
174
  ),
171
- /* @__PURE__ */ e("div", { className: "absolute top-[24px] left-1/2 -translate-x-1/2 pointer-events-none", children: /* @__PURE__ */ e(k, { size: 56 }) }),
172
- /* @__PURE__ */ f("div", { className: "text-center space-y-1 z-10 mt-auto", children: [
173
- /* @__PURE__ */ e("p", { className: "text-sm font-medium text-[#1f2b4d] leading-5", children: t || /* @__PURE__ */ f(j, { children: [
175
+ /* @__PURE__ */ e("div", { className: "absolute top-[24px] left-1/2 -translate-x-1/2 pointer-events-none", children: /* @__PURE__ */ e(I, { size: 56 }) }),
176
+ /* @__PURE__ */ m("div", { className: "text-center space-y-1 z-10 mt-auto", children: [
177
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-[#1f2b4d] leading-5", children: t || /* @__PURE__ */ m(T, { children: [
174
178
  "Drag your files here or",
175
179
  " ",
176
180
  /* @__PURE__ */ e("span", { className: "text-primary font-bold hover:underline", children: "Choose File" })
@@ -182,35 +186,35 @@ const Z = o.forwardRef(
182
186
  );
183
187
  }
184
188
  );
185
- Z.displayName = "FileUploadDropZone";
186
- const $ = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e("div", { ref: r, className: n("flex flex-col gap-3", a), ...l, children: t }));
187
- $.displayName = "FileUploadList";
188
- const G = o.forwardRef(
189
- ({ className: a, file: t, onRemove: l, ...r }, g) => {
190
- const { removeFile: d, disabled: m } = R(), c = (i) => {
191
- i.stopPropagation(), l ? l() : d(t);
192
- }, N = (i) => {
189
+ $.displayName = "FileUploadDropZone";
190
+ const G = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e("div", { ref: r, className: p("flex flex-col gap-3", a), ...l, children: t }));
191
+ G.displayName = "FileUploadList";
192
+ const K = o.forwardRef(
193
+ ({ className: a, file: t, onRemove: l, ...r }, d) => {
194
+ const { t: c } = z(), { removeFile: u, disabled: f } = j(), N = (i) => {
195
+ i.stopPropagation(), l ? l() : u(t);
196
+ }, x = (i) => {
193
197
  if (i === 0) return "0 B";
194
- const p = 1024, v = ["B", "KB", "MB", "GB"], x = Math.floor(Math.log(i) / Math.log(p));
195
- return parseFloat((i / Math.pow(p, x)).toFixed(2)) + " " + v[x];
196
- }, u = (i) => {
198
+ const g = 1024, v = ["B", "KB", "MB", "GB"], n = Math.floor(Math.log(i) / Math.log(g));
199
+ return parseFloat((i / Math.pow(g, n)).toFixed(2)) + " " + v[n];
200
+ }, h = (i) => {
197
201
  switch (i.split(".").pop()?.toLowerCase()) {
198
202
  case "xls":
199
203
  case "xlsx":
200
- return /* @__PURE__ */ e(A, { size: 36 });
204
+ return /* @__PURE__ */ e(O, { size: 36 });
201
205
  case "csv":
202
- return /* @__PURE__ */ e(M, { size: 36 });
206
+ return /* @__PURE__ */ e(A, { size: 36 });
203
207
  case "txt":
204
- return /* @__PURE__ */ e(L, { size: 36 });
208
+ return /* @__PURE__ */ e(M, { size: 36 });
205
209
  default:
206
- return /* @__PURE__ */ e(I, { size: 36, className: "text-gray-400" });
210
+ return /* @__PURE__ */ e(B, { size: 36, className: "text-gray-400" });
207
211
  }
208
212
  };
209
213
  return /* @__PURE__ */ e(
210
214
  "div",
211
215
  {
212
- ref: g,
213
- className: n(
216
+ ref: d,
217
+ className: p(
214
218
  "flex flex-col justify-between items-stretch gap-2 p-4 border border-[#e7e7e7] rounded-xl bg-white",
215
219
  a
216
220
  ),
@@ -218,55 +222,55 @@ const G = o.forwardRef(
218
222
  "data-file-name": t.name,
219
223
  "data-file-size": t.size,
220
224
  ...r,
221
- children: /* @__PURE__ */ f("div", { className: "flex justify-between items-center gap-2 z-10", children: [
222
- /* @__PURE__ */ f("div", { className: "flex gap-2 min-w-0", children: [
223
- /* @__PURE__ */ e("div", { className: "w-9 h-9 shrink-0", children: u(t.name) }),
224
- /* @__PURE__ */ f("div", { className: "flex flex-col justify-between gap-[2px] min-w-0", children: [
225
- /* @__PURE__ */ f(U, { children: [
225
+ children: /* @__PURE__ */ m("div", { className: "flex justify-between items-center gap-2 z-10", children: [
226
+ /* @__PURE__ */ m("div", { className: "flex gap-2 min-w-0", children: [
227
+ /* @__PURE__ */ e("div", { className: "w-9 h-9 shrink-0", children: h(t.name) }),
228
+ /* @__PURE__ */ m("div", { className: "flex flex-col justify-between gap-[2px] min-w-0", children: [
229
+ /* @__PURE__ */ m(U, { children: [
226
230
  /* @__PURE__ */ e(C, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "text-xs font-bold text-[#0b0b0b] leading-[18px] line-clamp-1 break-all cursor-default", children: t.name }) }),
227
231
  /* @__PURE__ */ e(D, { side: "top", variant: "tertiary", children: t.name })
228
232
  ] }),
229
- /* @__PURE__ */ e("span", { className: "text-xs font-medium text-[#6d6d6d] leading-[16px]", children: N(t.size) })
233
+ /* @__PURE__ */ e("span", { className: "text-xs font-medium text-[#6d6d6d] leading-[16px]", children: x(t.size) })
230
234
  ] })
231
235
  ] }),
232
- !m && /* @__PURE__ */ f(U, { children: [
236
+ !f && /* @__PURE__ */ m(U, { children: [
233
237
  /* @__PURE__ */ e(C, { asChild: !0, children: /* @__PURE__ */ e(
234
238
  "button",
235
239
  {
236
- onClick: c,
240
+ onClick: N,
237
241
  className: "flex items-center justify-center text-[#60697d] hover:text-destructive transition-colors",
238
242
  type: "button",
239
- "aria-label": "Remove file",
240
- children: /* @__PURE__ */ e(B, { size: 14 })
243
+ "aria-label": c("aria.removeFile"),
244
+ children: /* @__PURE__ */ e(L, { size: 14 })
241
245
  }
242
246
  ) }),
243
- /* @__PURE__ */ e(D, { side: "top", variant: "tertiary", children: "Remove file" })
247
+ /* @__PURE__ */ e(D, { side: "top", variant: "tertiary", children: c("aria.removeFile") })
244
248
  ] })
245
249
  ] })
246
250
  }
247
251
  );
248
252
  }
249
253
  );
250
- G.displayName = "FileUploadItem";
251
- const K = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
254
+ K.displayName = "FileUploadItem";
255
+ const q = o.forwardRef(({ className: a, children: t, ...l }, r) => /* @__PURE__ */ e(
252
256
  "div",
253
257
  {
254
258
  ref: r,
255
- className: n("flex items-center justify-end gap-4 mt-auto", a),
259
+ className: p("flex items-center justify-end gap-4 mt-auto", a),
256
260
  ...l,
257
261
  children: t
258
262
  }
259
263
  ));
260
- K.displayName = "FileUploadFooter";
264
+ q.displayName = "FileUploadFooter";
261
265
  export {
262
- O as FileUpload,
263
- P as FileUploadClose,
264
- S as FileUploadContent,
265
- H as FileUploadDescription,
266
- Z as FileUploadDropZone,
267
- K as FileUploadFooter,
268
- _ as FileUploadHeader,
269
- G as FileUploadItem,
270
- $ as FileUploadList,
271
- E as FileUploadTitle
266
+ S as FileUpload,
267
+ Z as FileUploadClose,
268
+ _ as FileUploadContent,
269
+ P as FileUploadDescription,
270
+ $ as FileUploadDropZone,
271
+ q as FileUploadFooter,
272
+ E as FileUploadHeader,
273
+ K as FileUploadItem,
274
+ G as FileUploadList,
275
+ H as FileUploadTitle
272
276
  };