ics-ui-kit 0.1.6 → 0.1.7

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 (31) hide show
  1. package/dist/components/file-upload/FileUpload.d.ts +1 -0
  2. package/dist/components/file-upload/FileUpload.stories.d.ts +1 -0
  3. package/dist/components/file-upload/components/file-upload-compact-input-zone/FileUploadCompactInputZone.d.ts +1 -1
  4. package/dist/components/file-upload/components/file-upload-input-zone/FileUploadInputZone.d.ts +1 -1
  5. package/dist/components/file-upload/components/file-upload-item/FileUploadItem.d.ts +2 -0
  6. package/dist/components/file-upload/components/file-upload-item/FileUploadItem.stories.d.ts +1 -0
  7. package/dist/components/file-upload/components/file-upload-item-compact/FileUploadItemCompact.d.ts +2 -0
  8. package/dist/components/file-upload/components/file-upload-item-compact/FileUploadItemCompact.stories.d.ts +1 -0
  9. package/dist/components/file-upload/file-upload-compact/FileUploadCompact.d.ts +1 -0
  10. package/dist/components/file-upload/file-upload-compact/FileUploadCompact.stories.d.ts +1 -0
  11. package/dist/components/file-upload.js +194 -185
  12. package/dist/components/file-upload.js.map +1 -1
  13. package/dist/components/resizable/components/ResizableCornerIcon.d.ts +3 -0
  14. package/dist/components/resizable/components/ResizableCornerIcon.stories.d.ts +7 -0
  15. package/dist/components/resizable/index.d.ts +1 -0
  16. package/dist/components/resizable.js +255 -232
  17. package/dist/components/resizable.js.map +1 -1
  18. package/dist/formatBytes-C4QXq5lC.js +9 -0
  19. package/dist/formatBytes-C4QXq5lC.js.map +1 -0
  20. package/dist/hooks/use-file-upload.js +1 -1
  21. package/dist/lib/utils/index.d.ts +1 -0
  22. package/dist/lib/utils.js +4 -2
  23. package/dist/lib/utils.js.map +1 -1
  24. package/dist/styles-scoped.css +8 -2
  25. package/dist/styles.css +8 -2
  26. package/dist/useFileUpload-Bnl3P8mP.js +193 -0
  27. package/dist/useFileUpload-Bnl3P8mP.js.map +1 -0
  28. package/package.json +1 -1
  29. package/tailwind.preset.js +2 -2
  30. package/dist/useFileUpload-iDag0iqM.js +0 -197
  31. package/dist/useFileUpload-iDag0iqM.js.map +0 -1
@@ -1,25 +1,26 @@
1
- import { jsx as a, jsxs as p, Fragment as Q } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as m, Fragment as Y } from "react/jsx-runtime";
2
2
  import { I as C } from "../IconButton-DwkpNgn3.js";
3
- import { f as T, u as S } from "../useFileUpload-iDag0iqM.js";
4
- import U, { useMemo as V, useCallback as W } from "react";
5
- import { T as y } from "../index-BVqs-uqP.js";
3
+ import { f as S } from "../formatBytes-C4QXq5lC.js";
4
+ import U, { useMemo as V, useCallback as R } from "react";
5
+ import { T as b } from "../index-BVqs-uqP.js";
6
6
  import { F as q } from "../FeatureIcon-BGE0Orkc.js";
7
- import { c as v } from "../createLucideIcon-DwBrHnj9.js";
8
- import { I as Y } from "../image-BqL5JP90.js";
7
+ import { c as F } from "../createLucideIcon-DwBrHnj9.js";
8
+ import { I as ee } from "../image-BqL5JP90.js";
9
9
  import { T as B } from "../TextOverflowTooltip-DlUgic5y.js";
10
10
  import { D as Z } from "../download-BHsj218e.js";
11
11
  import { X as L } from "../x-tDTt7hTQ.js";
12
- import { A as ee, b as ae, a as te } from "../AlertIcon-5B6AgZpe.js";
13
- import { C as re } from "../circle-alert-CVIokIC7.js";
14
- import { B as oe } from "../Button-Dg89xRSi.js";
12
+ import { A as ae, b as te, a as re } from "../AlertIcon-5B6AgZpe.js";
13
+ import { C as oe } from "../circle-alert-CVIokIC7.js";
14
+ import { B as ie } from "../Button-Dg89xRSi.js";
15
15
  import { I as se } from "../Icon-DH3ev9GK.js";
16
+ import { u as E } from "../useFileUpload-Bnl3P8mP.js";
16
17
  /**
17
18
  * @license lucide-react v0.460.0 - ISC
18
19
  *
19
20
  * This source code is licensed under the ISC license.
20
21
  * See the LICENSE file in the root directory of this source tree.
21
22
  */
22
- const ie = v("FileArchive", [
23
+ const ne = F("FileArchive", [
23
24
  ["path", { d: "M10 12v-1", key: "v7bkov" }],
24
25
  ["path", { d: "M10 18v-2", key: "1cjy8d" }],
25
26
  ["path", { d: "M10 7V6", key: "dljcrl" }],
@@ -36,7 +37,7 @@ const ie = v("FileArchive", [
36
37
  * This source code is licensed under the ISC license.
37
38
  * See the LICENSE file in the root directory of this source tree.
38
39
  */
39
- const le = v("FileSpreadsheet", [
40
+ const le = F("FileSpreadsheet", [
40
41
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
41
42
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
42
43
  ["path", { d: "M8 13h2", key: "yr2amv" }],
@@ -50,7 +51,7 @@ const le = v("FileSpreadsheet", [
50
51
  * This source code is licensed under the ISC license.
51
52
  * See the LICENSE file in the root directory of this source tree.
52
53
  */
53
- const ne = v("FileText", [
54
+ const de = F("FileText", [
54
55
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
55
56
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
56
57
  ["path", { d: "M10 9H8", key: "b1mrlr" }],
@@ -63,7 +64,7 @@ const ne = v("FileText", [
63
64
  * This source code is licensed under the ISC license.
64
65
  * See the LICENSE file in the root directory of this source tree.
65
66
  */
66
- const de = v("File", [
67
+ const ce = F("File", [
67
68
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
68
69
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
69
70
  ]);
@@ -73,7 +74,7 @@ const de = v("File", [
73
74
  * This source code is licensed under the ISC license.
74
75
  * See the LICENSE file in the root directory of this source tree.
75
76
  */
76
- const ce = v("Headphones", [
77
+ const pe = F("Headphones", [
77
78
  [
78
79
  "path",
79
80
  {
@@ -88,7 +89,7 @@ const ce = v("Headphones", [
88
89
  * This source code is licensed under the ISC license.
89
90
  * See the LICENSE file in the root directory of this source tree.
90
91
  */
91
- const E = v("Upload", [
92
+ const O = F("Upload", [
92
93
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
93
94
  ["polyline", { points: "17 8 12 3 7 8", key: "t8dd8p" }],
94
95
  ["line", { x1: "12", x2: "12", y1: "3", y2: "15", key: "widbto" }]
@@ -99,7 +100,7 @@ const E = v("Upload", [
99
100
  * This source code is licensed under the ISC license.
100
101
  * See the LICENSE file in the root directory of this source tree.
101
102
  */
102
- const pe = v("Video", [
103
+ const me = F("Video", [
103
104
  [
104
105
  "path",
105
106
  {
@@ -108,35 +109,35 @@ const pe = v("Video", [
108
109
  }
109
110
  ],
110
111
  ["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2", key: "158x01" }]
111
- ]), O = (r) => {
112
+ ]), _ = (r) => {
112
113
  const e = r.type, t = r.name;
113
- return e.includes("pdf") || t.endsWith(".pdf") || e.includes("word") || t.endsWith(".doc") || t.endsWith(".docx") ? ne : e.includes("zip") || e.includes("archive") || t.endsWith(".zip") || t.endsWith(".rar") ? ie : e.includes("excel") || t.endsWith(".xls") || t.endsWith(".xlsx") ? le : e.includes("video/") ? pe : e.includes("audio/") ? ce : e.startsWith("image/") ? Y : de;
114
- }, me = y({
114
+ return e.includes("pdf") || t.endsWith(".pdf") || e.includes("word") || t.endsWith(".doc") || t.endsWith(".docx") ? de : e.includes("zip") || e.includes("archive") || t.endsWith(".zip") || t.endsWith(".rar") ? ne : e.includes("excel") || t.endsWith(".xls") || t.endsWith(".xlsx") ? le : e.includes("video/") ? me : e.includes("audio/") ? pe : e.startsWith("image/") ? ee : ce;
115
+ }, he = b({
115
116
  base: "rounded-md text-muted ring-0"
116
- }), he = ({ file: r }) => {
117
- const e = O(r);
118
- return /* @__PURE__ */ a(q, { icon: e, size: "lg", className: me() });
119
- }, fe = y({
117
+ }), fe = ({ file: r }) => {
118
+ const e = _(r);
119
+ return /* @__PURE__ */ a(q, { icon: e, size: "lg", className: he() });
120
+ }, ue = b({
120
121
  slots: {
121
122
  wrapper: "box-border flex h-16 justify-between gap-2 rounded-xl border border-secondary-border bg-background p-3 pe-3",
122
123
  infoWrapper: "flex min-w-0 flex-1 items-center gap-2.5",
123
124
  textWrapper: "flex min-w-0 flex-col gap-0.5",
124
125
  title: "truncate text-sm font-medium",
125
- description: "text-xs text-muted",
126
+ description: "text-xs tabular-nums text-muted",
126
127
  actionWrapper: "-me-3 -mt-3 flex h-8 items-center -space-x-1.5"
127
128
  }
128
- }), _ = U.forwardRef(
129
- ({ onClear: r, onDownload: e, file: t, className: i, ...l }, c) => {
130
- const s = fe();
131
- return /* @__PURE__ */ p("div", { className: s.wrapper({ className: i }), ref: c, ...l, children: [
132
- /* @__PURE__ */ p("div", { className: s.infoWrapper(), children: [
133
- /* @__PURE__ */ a(he, { file: t }),
134
- /* @__PURE__ */ p("div", { className: s.textWrapper(), children: [
135
- /* @__PURE__ */ a(B, { className: s.title(), children: t.name }),
136
- /* @__PURE__ */ a("p", { className: s.description(), children: T(t.size) })
129
+ }), X = U.forwardRef(
130
+ ({ onClear: r, onDownload: e, file: t, className: i, renderDescription: s, ...d }, c) => {
131
+ const o = ue();
132
+ return /* @__PURE__ */ m("div", { className: o.wrapper({ className: i }), ref: c, ...d, children: [
133
+ /* @__PURE__ */ m("div", { className: o.infoWrapper(), children: [
134
+ /* @__PURE__ */ a(fe, { file: t }),
135
+ /* @__PURE__ */ m("div", { className: o.textWrapper(), children: [
136
+ /* @__PURE__ */ a(B, { className: o.title(), children: t.name }),
137
+ /* @__PURE__ */ a("p", { className: o.description(), children: s?.(t) ?? S(t.size) })
137
138
  ] })
138
139
  ] }),
139
- /* @__PURE__ */ p("div", { className: s.actionWrapper(), children: [
140
+ /* @__PURE__ */ m("div", { className: o.actionWrapper(), children: [
140
141
  e && /* @__PURE__ */ a(
141
142
  C,
142
143
  {
@@ -165,21 +166,21 @@ const pe = v("Video", [
165
166
  ] });
166
167
  }
167
168
  );
168
- _.displayName = "FileUploadItem";
169
- const R = U.forwardRef(({ error: r, ...e }, t) => {
169
+ X.displayName = "FileUploadItem";
170
+ const H = U.forwardRef(({ error: r, ...e }, t) => {
170
171
  const i = Array.isArray(r) ? r.join(`
171
172
  `) : r;
172
- return /* @__PURE__ */ p(ee, { status: "error", focus: "medium", ...e, ref: t, children: [
173
- /* @__PURE__ */ a(ae, { icon: re }),
174
- /* @__PURE__ */ a(te, { className: "whitespace-pre-line", children: i })
173
+ return /* @__PURE__ */ m(ae, { status: "error", focus: "medium", ...e, ref: t, children: [
174
+ /* @__PURE__ */ a(te, { icon: oe }),
175
+ /* @__PURE__ */ a(re, { className: "whitespace-pre-line", children: i })
175
176
  ] });
176
177
  });
177
- R.displayName = "FileUploadError";
178
- const ue = y({
178
+ H.displayName = "FileUploadError";
179
+ const ye = b({
179
180
  base: "shrink-0 bg-status-neutral-fg"
180
- }), H = ({ icon: r, className: e, ...t }) => /* @__PURE__ */ a(q, { size: "xl", icon: r, className: ue({ className: e }), ...t });
181
- H.displayName = "FileUploadDropAreaIcon";
182
- const ye = y({
181
+ }), j = ({ icon: r, className: e, ...t }) => /* @__PURE__ */ a(q, { size: "xl", icon: r, className: ye({ className: e }), ...t });
182
+ j.displayName = "FileUploadDropAreaIcon";
183
+ const be = b({
183
184
  slots: {
184
185
  wrapper: [
185
186
  "has-[:disabled]:pointer-events-none has-[:disabled]:opacity-50",
@@ -192,7 +193,7 @@ const ye = y({
192
193
  icon: "mb-3 size-11",
193
194
  description: "flex flex-wrap justify-center gap-1 text-xs text-muted"
194
195
  }
195
- }), X = U.forwardRef(
196
+ }), $ = U.forwardRef(
196
197
  ({
197
198
  className: r,
198
199
  title: e = "Click to upload or drop your files here ",
@@ -202,20 +203,20 @@ Infinity files
202
203
  ∙
203
204
  Infinity size`,
204
205
  icon: i,
205
- children: l,
206
- ...c
207
- }, s) => {
208
- const o = ye();
209
- return /* @__PURE__ */ p("div", { role: "button", className: o.wrapper({ className: r }), ref: s, ...c, children: [
210
- /* @__PURE__ */ a(H, { icon: i || E, className: o.icon() }),
206
+ children: s,
207
+ ...d
208
+ }, c) => {
209
+ const o = be();
210
+ return /* @__PURE__ */ m("div", { role: "button", className: o.wrapper({ className: r }), ref: c, ...d, children: [
211
+ /* @__PURE__ */ a(j, { icon: i || O, className: o.icon() }),
211
212
  /* @__PURE__ */ a("p", { className: o.title(), children: e }),
212
213
  t && /* @__PURE__ */ a("p", { className: o.description(), children: t }),
213
- l
214
+ s
214
215
  ] });
215
216
  }
216
217
  );
217
- X.displayName = "FileUploadDropArea";
218
- const be = y({
218
+ $.displayName = "FileUploadDropArea";
219
+ const xe = b({
219
220
  slots: {
220
221
  wrapper: [
221
222
  "has-[:disabled]:pointer-events-none has-[:disabled]:opacity-50",
@@ -228,99 +229,103 @@ const be = y({
228
229
  title: "text-sm font-medium text-primary-accent",
229
230
  description: "ml-1.5 flex flex-wrap justify-center gap-1.5 text-xs text-muted"
230
231
  }
231
- }), $ = U.forwardRef(
232
- ({ className: r, title: e = "Upload files", description: t = "Drag & drop or click to browse", icon: i, children: l, ...c }, s) => {
233
- const o = be();
234
- return /* @__PURE__ */ p("div", { role: "button", className: o.wrapper({ className: r }), ref: s, ...c, children: [
235
- /* @__PURE__ */ a(H, { icon: i || E, className: o.icon(), size: "sm" }),
236
- /* @__PURE__ */ p("div", { className: "flex items-baseline", children: [
232
+ }), G = U.forwardRef(
233
+ ({ className: r, title: e = "Upload files", description: t = "Drag & drop or click to browse", icon: i, children: s, ...d }, c) => {
234
+ const o = xe();
235
+ return /* @__PURE__ */ m("div", { role: "button", className: o.wrapper({ className: r }), ref: c, ...d, children: [
236
+ /* @__PURE__ */ a(j, { icon: i || O, className: o.icon(), size: "sm" }),
237
+ /* @__PURE__ */ m("div", { className: "flex items-baseline", children: [
237
238
  /* @__PURE__ */ a("p", { className: o.title(), children: e }),
238
- t && /* @__PURE__ */ p(Q, { children: [
239
+ t && /* @__PURE__ */ m(Y, { children: [
239
240
  /* @__PURE__ */ a("span", { className: "ml-1.5 text-muted", children: "∙" }),
240
241
  /* @__PURE__ */ a("p", { className: o.description(), children: t })
241
242
  ] }),
242
- l
243
+ s
243
244
  ] })
244
245
  ] });
245
246
  }
246
247
  );
247
- $.displayName = "FileUploadInlineDropArea";
248
- const G = ({ children: r = "Remove all files", ...e }) => /* @__PURE__ */ a(oe, { size: "sm", variant: "outline", type: "button", ...e, children: r });
249
- G.displayName = "FileUploadClearButton";
250
- const J = ({
248
+ G.displayName = "FileUploadInlineDropArea";
249
+ const J = ({ children: r = "Remove all files", ...e }) => /* @__PURE__ */ a(ie, { size: "sm", variant: "outline", type: "button", ...e, children: r });
250
+ J.displayName = "FileUploadClearButton";
251
+ const K = ({
251
252
  isDragging: r,
252
253
  getInputProps: e,
253
254
  openFileDialog: t,
254
255
  handleDragEnter: i,
255
- handleDragLeave: l,
256
- handleDragOver: c,
257
- handleDrop: s,
258
- ...o
256
+ handleDragLeave: s,
257
+ handleDragOver: d,
258
+ handleDrop: c,
259
+ title: o,
260
+ description: p
259
261
  }) => /* @__PURE__ */ a(
260
- X,
262
+ $,
261
263
  {
262
264
  onClick: t,
263
265
  onDragEnter: i,
264
- onDragLeave: l,
265
- onDragOver: c,
266
- onDrop: s,
266
+ onDragLeave: s,
267
+ onDragOver: d,
268
+ onDrop: c,
267
269
  "data-dragging": r || void 0,
268
- ...o,
270
+ title: o,
271
+ description: p,
269
272
  children: /* @__PURE__ */ a("input", { className: "sr-only", "aria-label": "Upload files", ...e() })
270
273
  }
271
274
  );
272
- J.displayName = "FileUploadInputZone";
273
- const K = ({
275
+ K.displayName = "FileUploadInputZone";
276
+ const P = ({
274
277
  isDragging: r,
275
278
  getInputProps: e,
276
279
  openFileDialog: t,
277
280
  handleDragEnter: i,
278
- handleDragLeave: l,
279
- handleDragOver: c,
280
- handleDrop: s,
281
- ...o
281
+ handleDragLeave: s,
282
+ handleDragOver: d,
283
+ handleDrop: c,
284
+ title: o,
285
+ description: p
282
286
  }) => /* @__PURE__ */ a(
283
- $,
287
+ G,
284
288
  {
285
289
  onClick: t,
286
290
  onDragEnter: i,
287
- onDragLeave: l,
288
- onDragOver: c,
289
- onDrop: s,
291
+ onDragLeave: s,
292
+ onDragOver: d,
293
+ onDrop: c,
290
294
  "data-dragging": r || void 0,
291
- ...o,
295
+ title: o,
296
+ description: p,
292
297
  children: /* @__PURE__ */ a("input", { className: "sr-only", "aria-label": "Upload files", ...e() })
293
298
  }
294
299
  );
295
- K.displayName = "FileUploadCompactInputZone";
296
- const xe = y({
300
+ P.displayName = "FileUploadCompactInputZone";
301
+ const ge = b({
297
302
  slots: {
298
303
  wrapper: "box-border flex h-10 items-center gap-2 rounded-lg border border-secondary-border bg-background p-2.5 pr-1",
299
304
  icon: "text-muted",
300
305
  infoWrapper: "flex w-full items-center overflow-hidden",
301
306
  textWrapper: "flex w-full items-center justify-between",
302
307
  title: "truncate text-sm font-medium",
303
- description: "text-sm text-muted",
308
+ description: "text-sm tabular-nums text-muted",
304
309
  actionWrapper: "ml-auto flex items-center -space-x-1.5"
305
310
  }
306
- }), P = U.forwardRef(
307
- ({ onClear: r, file: e, className: t, renderIcon: i, onDownload: l, ...c }, s) => {
308
- const o = xe(), N = O(e);
309
- return /* @__PURE__ */ a("div", { className: "relative", children: /* @__PURE__ */ p("div", { className: o.wrapper({ className: t }), ref: s, ...c, children: [
310
- i ?? /* @__PURE__ */ a("div", { className: "size-5", children: /* @__PURE__ */ a(se, { icon: N, size: "lg", className: o.icon() }) }),
311
- /* @__PURE__ */ a("div", { className: o.infoWrapper(), children: /* @__PURE__ */ p("div", { className: o.textWrapper(), children: [
312
- /* @__PURE__ */ a(B, { className: o.title(), children: e.name }),
313
- /* @__PURE__ */ a("p", { className: o.description(), children: T(e.size) })
311
+ }), Q = U.forwardRef(
312
+ ({ onClear: r, file: e, className: t, renderIcon: i, onDownload: s, renderDescription: d, ...c }, o) => {
313
+ const p = ge(), k = _(e);
314
+ return /* @__PURE__ */ a("div", { className: "relative", children: /* @__PURE__ */ m("div", { className: p.wrapper({ className: t }), ref: o, ...c, children: [
315
+ i ?? /* @__PURE__ */ a("div", { className: "size-5", children: /* @__PURE__ */ a(se, { icon: k, size: "lg", className: p.icon() }) }),
316
+ /* @__PURE__ */ a("div", { className: p.infoWrapper(), children: /* @__PURE__ */ m("div", { className: p.textWrapper(), children: [
317
+ /* @__PURE__ */ a(B, { className: p.title(), children: e.name }),
318
+ /* @__PURE__ */ a("p", { className: p.description(), children: d?.(e) ?? S(e.size) })
314
319
  ] }) }),
315
- /* @__PURE__ */ p("div", { className: o.actionWrapper(), children: [
316
- l && /* @__PURE__ */ a(
320
+ /* @__PURE__ */ m("div", { className: p.actionWrapper(), children: [
321
+ s && /* @__PURE__ */ a(
317
322
  C,
318
323
  {
319
324
  variant: "text",
320
325
  size: "sm",
321
326
  type: "button",
322
327
  icon: Z,
323
- onClick: () => l(e),
328
+ onClick: () => s(e),
324
329
  "aria-label": "Download file",
325
330
  iconClassName: "size-4"
326
331
  }
@@ -341,144 +346,148 @@ const xe = y({
341
346
  ] }) });
342
347
  }
343
348
  );
344
- P.displayName = "FileUploadItemCompact";
345
- const ge = y({
349
+ Q.displayName = "FileUploadItemCompact";
350
+ const ve = b({
346
351
  base: "flex flex-col gap-3"
347
- }), ve = (r) => {
352
+ }), Fe = (r) => {
348
353
  const {
349
354
  files: e,
350
355
  onRemove: t,
351
356
  onAdd: i,
352
- onClear: l,
353
- onDownload: c,
354
- initialFiles: s,
357
+ onClear: s,
358
+ onDownload: d,
359
+ initialFiles: c,
355
360
  onChange: o,
356
- className: N,
357
- title: I,
361
+ className: p,
362
+ title: k,
358
363
  description: w,
359
364
  helpText: z,
360
365
  removeBtnText: D,
361
366
  errorMessages: A,
362
- multiple: F = !0,
363
- ...M
364
- } = r, [{ files: b, isDragging: k, errors: x }, g] = S({
365
- ...M,
366
- initialFiles: s,
367
- multiple: F,
367
+ multiple: M = !0,
368
+ renderItemDescription: N,
369
+ ...W
370
+ } = r, [{ files: x, isDragging: I, errors: g }, v] = E({
371
+ ...W,
372
+ initialFiles: c,
373
+ multiple: M,
368
374
  errorMessages: A,
369
- onFilesChange: (d) => {
370
- const u = d.map((h) => h.file);
371
- o?.(u);
375
+ onFilesChange: (l) => {
376
+ const y = l.map((f) => f.file);
377
+ o?.(y);
372
378
  },
373
- onFilesAdded: (d) => {
374
- const u = d.map((h) => h.file);
375
- i?.(u);
379
+ onFilesAdded: (l) => {
380
+ const y = l.map((f) => f.file);
381
+ i?.(y);
376
382
  }
377
- }), n = V(() => e || b.map((d) => d.file), [e, b]), m = W(() => {
378
- g.clearFiles(), l?.();
379
- }, [g, l]), f = W(
380
- (d, u) => {
381
- const h = b.find((j) => j.file.name === d.name && j.file.size === d.size)?.id;
382
- h && g.removeFile(h), t?.(d, u);
383
+ }), n = V(() => e || x.map((l) => l.file), [e, x]), h = R(() => {
384
+ v.clearFiles(), s?.();
385
+ }, [v, s]), u = R(
386
+ (l, y) => {
387
+ const f = x.find((T) => T.file.name === l.name && T.file.size === l.size)?.id;
388
+ f && v.removeFile(f), t?.(l, y);
383
389
  },
384
- [b, g, t]
390
+ [x, v, t]
385
391
  );
386
- return /* @__PURE__ */ p("div", { className: ge({ className: N }), children: [
392
+ return /* @__PURE__ */ m("div", { className: ve({ className: p }), children: [
387
393
  /* @__PURE__ */ a(
388
- J,
394
+ K,
389
395
  {
390
- ...g,
391
- isDragging: k,
392
- title: I,
396
+ ...v,
397
+ isDragging: I,
398
+ title: k,
393
399
  description: w,
394
400
  helpText: z
395
401
  }
396
402
  ),
397
- x.length > 0 && /* @__PURE__ */ a(R, { error: x }),
398
- n.length > 0 && /* @__PURE__ */ p("div", { className: "space-y-2", children: [
399
- n.map((d, u) => /* @__PURE__ */ a(
400
- _,
403
+ g.length > 0 && /* @__PURE__ */ a(H, { error: g }),
404
+ n.length > 0 && /* @__PURE__ */ m("div", { className: "space-y-2", children: [
405
+ n.map((l, y) => /* @__PURE__ */ a(
406
+ X,
401
407
  {
402
- file: d,
403
- onClear: () => f(d, u),
404
- onDownload: c
408
+ file: l,
409
+ onClear: () => u(l, y),
410
+ onDownload: d,
411
+ renderDescription: N
405
412
  },
406
- u
413
+ y
407
414
  )),
408
- n.length > 1 && /* @__PURE__ */ a(G, { onClick: m, children: D })
415
+ n.length > 1 && /* @__PURE__ */ a(J, { onClick: h, children: D })
409
416
  ] })
410
417
  ] });
411
418
  };
412
- ve.displayName = "FileUpload";
413
- const Fe = y({
419
+ Fe.displayName = "FileUpload";
420
+ const Ne = b({
414
421
  base: "box-border flex flex-col gap-2"
415
- }), Ne = (r) => {
422
+ }), ke = (r) => {
416
423
  const {
417
424
  files: e,
418
425
  onRemove: t,
419
426
  onDownload: i,
420
- onAdd: l,
421
- initialFiles: c,
422
- onChange: s,
427
+ onAdd: s,
428
+ initialFiles: d,
429
+ onChange: c,
423
430
  className: o,
424
- title: N,
425
- description: I,
431
+ title: p,
432
+ description: k,
426
433
  multiple: w = !0,
427
434
  errorMessages: z,
428
435
  renderFileIcon: D,
429
- ...A
430
- } = r, [{ files: F, isDragging: M, errors: b }, k] = S({
431
- ...A,
432
- initialFiles: c,
436
+ renderItemDescription: A,
437
+ ...M
438
+ } = r, [{ files: N, isDragging: W, errors: x }, I] = E({
439
+ ...M,
440
+ initialFiles: d,
433
441
  multiple: w,
434
442
  errorMessages: z,
435
443
  onFilesChange: (n) => {
436
- const m = n.map((f) => f.file);
437
- s?.(m);
444
+ const h = n.map((u) => u.file);
445
+ c?.(h);
438
446
  },
439
447
  onFilesAdded: (n) => {
440
- const m = n.map((f) => f.file);
441
- l?.(m);
448
+ const h = n.map((u) => u.file);
449
+ s?.(h);
442
450
  }
443
- }), x = V(() => e || F.map((n) => n.file), [e, F]), g = W(
444
- (n, m) => {
445
- const f = F.find((d) => d.file.name === n.name && d.file.size === n.size)?.id;
446
- f && k.removeFile(f), t?.(n, m);
451
+ }), g = V(() => e || N.map((n) => n.file), [e, N]), v = R(
452
+ (n, h) => {
453
+ const u = N.find((l) => l.file.name === n.name && l.file.size === n.size)?.id;
454
+ u && I.removeFile(u), t?.(n, h);
447
455
  },
448
- [F, k, t]
456
+ [N, I, t]
449
457
  );
450
- return /* @__PURE__ */ p("div", { className: Fe({ className: o }), children: [
451
- /* @__PURE__ */ a(K, { ...k, isDragging: M, title: N, description: I }),
452
- b.length > 0 && /* @__PURE__ */ a(R, { error: b }),
453
- x.length > 0 && /* @__PURE__ */ a("div", { children: x.map((n, m) => {
454
- const f = m === 0, d = x.length === 1, u = m === x.length - 1;
455
- let h = "";
456
- return d ? h = "" : f ? h = "border-b-0 rounded-b-none" : u ? h = "rounded-t-none" : h = "border-b-0 rounded-none", /* @__PURE__ */ a(
457
- P,
458
+ return /* @__PURE__ */ m("div", { className: Ne({ className: o }), children: [
459
+ /* @__PURE__ */ a(P, { ...I, isDragging: W, title: p, description: k }),
460
+ x.length > 0 && /* @__PURE__ */ a(H, { error: x }),
461
+ g.length > 0 && /* @__PURE__ */ a("div", { children: g.map((n, h) => {
462
+ const u = h === 0, l = g.length === 1, y = h === g.length - 1;
463
+ let f = "";
464
+ return l ? f = "" : u ? f = "border-b-0 rounded-b-none" : y ? f = "rounded-t-none" : f = "border-b-0 rounded-none", /* @__PURE__ */ a(
465
+ Q,
458
466
  {
459
467
  file: n,
460
- onClear: () => g(n, m),
461
- className: h,
468
+ onClear: () => v(n, h),
469
+ className: f,
462
470
  renderIcon: D?.(n),
471
+ renderDescription: A,
463
472
  onDownload: i
464
473
  },
465
- m
474
+ h
466
475
  );
467
476
  }) })
468
477
  ] });
469
478
  };
470
- Ne.displayName = "FileUploadCompact";
479
+ ke.displayName = "FileUploadCompact";
471
480
  export {
472
- ve as FileUpload,
473
- G as FileUploadClearButton,
474
- Ne as FileUploadCompact,
475
- K as FileUploadCompactInputZone,
476
- X as FileUploadDropArea,
477
- R as FileUploadError,
478
- he as FileUploadIcon,
479
- $ as FileUploadInlineDropArea,
480
- J as FileUploadInputZone,
481
- _ as FileUploadItem,
482
- P as FileUploadItemCompact
481
+ Fe as FileUpload,
482
+ J as FileUploadClearButton,
483
+ ke as FileUploadCompact,
484
+ P as FileUploadCompactInputZone,
485
+ $ as FileUploadDropArea,
486
+ H as FileUploadError,
487
+ fe as FileUploadIcon,
488
+ G as FileUploadInlineDropArea,
489
+ K as FileUploadInputZone,
490
+ X as FileUploadItem,
491
+ Q as FileUploadItemCompact
483
492
  };
484
493
  //# sourceMappingURL=file-upload.js.map