@oneplatformdev/ui 0.1.99-beta.274 → 0.1.99-beta.277

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.
@@ -1,63 +1,63 @@
1
- import { jsxs as l, jsx as e, Fragment as Y } from "react/jsx-runtime";
2
- import { X as k, UploadIcon as Fe, FileTextIcon as Z, InfoIcon as ve } from "lucide-react";
3
- import { forwardRef as ye, useState as G, useEffect as Ie, useImperativeHandle as be } from "react";
4
- import { useDropzone as Ce } from "react-dropzone";
1
+ import { jsxs as l, jsx as e, Fragment as K } from "react/jsx-runtime";
2
+ import { X as D, Plus as ze, UploadIcon as Ee, FileTextIcon as Q, InfoIcon as De } from "lucide-react";
3
+ import { forwardRef as je, useState as U, useEffect as Me, useImperativeHandle as ke } from "react";
4
+ import { useDropzone as Se } from "react-dropzone";
5
5
  import { cn as p } from "@oneplatformdev/utils";
6
- import { Card as ze } from "../Card/Card.js";
7
- import { DEFAULT_FILE_TYPES as Ee } from "./Dropzone.types.js";
8
- import { FilePreview as De } from "./DropzoneFilePreview.js";
9
- import { DropzoneSinglePickPreview as je } from "./DropzoneSinglePickPreview.js";
10
- import { isFile as v, isVideoUrl as Me, extractName as Se } from "./DropzoneUtils.js";
11
- import Be from "./icons/file-csv.svg.js";
12
- import ke from "./icons/file-doc.svg.js";
13
- import Re from "./icons/file-docx.svg.js";
14
- import K from "./icons/file-jpg.svg.js";
15
- import Ae from "./icons/file-pdf.svg.js";
16
- import We from "./icons/file-png.svg.js";
17
- import _e from "./icons/file-ppt.svg.js";
18
- import Pe from "./icons/file-pptx.svg.js";
19
- import Te from "./icons/file-rar.svg.js";
20
- import Xe from "./icons/file-svg.svg.js";
21
- import $e from "./icons/file-webp.svg.js";
22
- import Le from "./icons/file-xls.svg.js";
23
- import Oe from "./icons/file-xlsx.svg.js";
24
- import qe from "./icons/file-zip.svg.js";
25
- import { Button as He } from "../Button/Button.js";
26
- const Q = (r = 0) => `${(r / (1024 * 1024)).toFixed(0)} MB`, Je = {
27
- csv: Be,
28
- doc: ke,
29
- docx: Re,
30
- jpg: K,
31
- jpeg: K,
32
- pdf: Ae,
33
- png: We,
34
- ppt: _e,
35
- pptx: Pe,
36
- rar: Te,
37
- svg: Xe,
38
- webp: $e,
39
- xls: Le,
40
- xlsx: Oe,
41
- zip: qe
42
- }, Ye = (r) => {
43
- if (!r) return "";
44
- const s = r.toLowerCase().split(".");
45
- return s.length > 1 ? s[s.length - 1] : "";
46
- }, Ze = (r) => {
47
- const s = Ye(r);
48
- return Je[s] ?? null;
49
- }, Ge = (r, s) => {
50
- if (r === s) return !0;
51
- if (r.length !== s.length) return !1;
52
- for (let x = 0; x < r.length; x++) {
53
- const a = r[x], m = s[x];
54
- if (a !== m) {
55
- if (typeof a == "string" && typeof m == "string") {
56
- if (a !== m) return !1;
6
+ import { Card as Be } from "../Card/Card.js";
7
+ import { DEFAULT_FILE_TYPES as Re } from "./Dropzone.types.js";
8
+ import { FilePreview as V } from "./DropzoneFilePreview.js";
9
+ import { DropzoneSinglePickPreview as Ae } from "./DropzoneSinglePickPreview.js";
10
+ import { isFile as b, isVideoUrl as We, extractName as Pe } from "./DropzoneUtils.js";
11
+ import _e from "./icons/file-csv.svg.js";
12
+ import Te from "./icons/file-doc.svg.js";
13
+ import Xe from "./icons/file-docx.svg.js";
14
+ import ee from "./icons/file-jpg.svg.js";
15
+ import $e from "./icons/file-pdf.svg.js";
16
+ import Le from "./icons/file-png.svg.js";
17
+ import Oe from "./icons/file-ppt.svg.js";
18
+ import qe from "./icons/file-pptx.svg.js";
19
+ import Ge from "./icons/file-rar.svg.js";
20
+ import He from "./icons/file-svg.svg.js";
21
+ import Je from "./icons/file-webp.svg.js";
22
+ import Ye from "./icons/file-xls.svg.js";
23
+ import Ze from "./icons/file-xlsx.svg.js";
24
+ import Ke from "./icons/file-zip.svg.js";
25
+ import { Button as Qe } from "../Button/Button.js";
26
+ const te = (o = 0) => `${(o / (1024 * 1024)).toFixed(0)} MB`, Ue = {
27
+ csv: _e,
28
+ doc: Te,
29
+ docx: Xe,
30
+ jpg: ee,
31
+ jpeg: ee,
32
+ pdf: $e,
33
+ png: Le,
34
+ ppt: Oe,
35
+ pptx: qe,
36
+ rar: Ge,
37
+ svg: He,
38
+ webp: Je,
39
+ xls: Ye,
40
+ xlsx: Ze,
41
+ zip: Ke
42
+ }, Ve = (o) => {
43
+ if (!o) return "";
44
+ const c = o.toLowerCase().split(".");
45
+ return c.length > 1 ? c[c.length - 1] : "";
46
+ }, et = (o) => {
47
+ const c = Ve(o);
48
+ return Ue[c] ?? null;
49
+ }, tt = (o, c) => {
50
+ if (o === c) return !0;
51
+ if (o.length !== c.length) return !1;
52
+ for (let x = 0; x < o.length; x++) {
53
+ const m = o[x], f = c[x];
54
+ if (m !== f) {
55
+ if (typeof m == "string" && typeof f == "string") {
56
+ if (m !== f) return !1;
57
57
  continue;
58
58
  }
59
- if (v(a) && v(m)) {
60
- if (a.name !== m.name || a.size !== m.size || a.type !== m.type || a.lastModified !== m.lastModified)
59
+ if (b(m) && b(f)) {
60
+ if (m.name !== f.name || m.size !== f.size || m.type !== f.type || m.lastModified !== f.lastModified)
61
61
  return !1;
62
62
  continue;
63
63
  }
@@ -65,149 +65,164 @@ const Q = (r = 0) => `${(r / (1024 * 1024)).toFixed(0)} MB`, Je = {
65
65
  }
66
66
  }
67
67
  return !0;
68
- }, Ke = ye(
68
+ }, lt = je(
69
69
  ({
70
- acceptTypes: r = Ee,
71
- maxSizeMB: s,
70
+ acceptTypes: o = Re,
71
+ maxSizeMB: c,
72
72
  maxFiles: x = 1,
73
- onErrors: a,
74
- hideErrors: m = !1,
75
- disabled: d = !1,
76
- classNames: y,
77
- value: w,
78
- onChangeValue: R,
79
- className: U,
80
- labelDropzonePrompt: C = "Drop files here or click to select",
81
- labelDropzoneSubPrompt: V = "",
82
- labelOrClickToSelect: ee = "Upload file",
83
- labelSelectedFiles: te = "Selected Files",
84
- labelUploadErrors: le = "Upload Errors",
85
- labelFileTooLarge: A = "File is too large",
86
- labelInvalidFileType: W = "Invalid file type",
87
- labelVideoUploaded: ie = "Uploaded",
88
- labelVideoReplace: re = "Replace",
89
- singlePick: n = !1,
90
- labelDropzoneClassname: ne,
91
- labelDropzoneSubClassname: oe,
92
- isUploading: f = !1,
93
- uploadProgress: _ = 0,
94
- uploadLoadedBytes: se = 0,
95
- uploadTotalBytes: ce = 0,
96
- onCancelUpload: P,
97
- labelUploadingTitle: ae = "Uploading video...",
98
- labelUploadingHint: me = "Please do not close this page",
99
- labelUploadingActionCancel: de = "Cancel",
100
- persistentDropzone: T = !1,
101
- previewVariant: N = "default",
102
- ...z
103
- }, fe) => {
104
- const [i, I] = G(w ?? []), [h, X] = G([]), g = i[0], E = h[0]?.file, pe = !!E?.type?.includes("image"), D = n && i.length > 0 && v(g), xe = D && g.type.includes("image"), $ = D && g.type.includes("video") || n && i.length > 0 && typeof g == "string" && Me(g), L = D && !xe && !$, O = n && !i.length && !!E && !pe, u = L ? g : E, b = Ze(u?.name), j = n && $, he = j, M = n && i.length > 0, ue = (t, c) => {
105
- X(c), a?.(c);
106
- const o = n ? t.slice(0, 1) : [...i, ...t].slice(0, x);
107
- I(o), R?.(o);
73
+ onErrors: m,
74
+ hideErrors: f = !1,
75
+ disabled: s = !1,
76
+ classNames: w,
77
+ value: N,
78
+ onChangeValue: W,
79
+ className: le,
80
+ labelDropzonePrompt: j = "Drop files here or click to select",
81
+ labelDropzoneSubPrompt: re = "",
82
+ labelOrClickToSelect: ie = "Upload file",
83
+ labelSelectedFiles: ne = "Selected Files",
84
+ labelUploadErrors: oe = "Upload Errors",
85
+ labelFileTooLarge: P = "File is too large",
86
+ labelInvalidFileType: _ = "Invalid file type",
87
+ labelVideoUploaded: se = "Uploaded",
88
+ labelVideoReplace: ce = "Replace",
89
+ singlePick: i = !1,
90
+ labelDropzoneClassname: ae,
91
+ labelDropzoneSubClassname: de,
92
+ isUploading: a = !1,
93
+ uploadProgress: T = 0,
94
+ uploadLoadedBytes: me = 0,
95
+ uploadTotalBytes: fe = 0,
96
+ onCancelUpload: X,
97
+ labelUploadingTitle: pe = "Uploading video...",
98
+ labelUploadingHint: xe = "Please do not close this page",
99
+ labelUploadingActionCancel: he = "Cancel",
100
+ persistentDropzone: $ = !1,
101
+ previewVariant: h = "default",
102
+ coverFirstItem: ue = !1,
103
+ ...M
104
+ }, ge) => {
105
+ const [r, C] = U(N ?? []), [u, L] = U([]), F = r[0], k = u[0]?.file, we = !!k?.type?.includes("image"), S = i && r.length > 0 && b(F), Fe = S && F.type.includes("image"), O = S && F.type.includes("video") || i && r.length > 0 && typeof F == "string" && We(F), q = S && !Fe && !O, G = i && !r.length && !!k && !we, g = q ? F : k, y = et(g?.name), B = i && O, Ne = B, R = i && r.length > 0, ve = (t, d) => {
106
+ L(d), m?.(d);
107
+ const n = i ? t.slice(0, 1) : [...r, ...t].slice(0, x);
108
+ C(n), W?.(n);
108
109
  };
109
- Ie(() => {
110
- w && !Ge(i, w) && I(w);
111
- }, [i, w]);
112
- const S = (t, c) => {
113
- if (d) return;
110
+ Me(() => {
111
+ N && !tt(r, N) && C(N);
112
+ }, [r, N]);
113
+ const I = (t, d) => {
114
+ if (s) return;
114
115
  t.stopPropagation();
115
- const o = i.filter((F, B) => B !== c);
116
- I(o), R?.(o);
117
- }, { getRootProps: ge, getInputProps: we, isDragActive: Ne, open: q } = Ce({
118
- onDrop: ue,
119
- accept: r.reduce((t, c) => (t[c] = [], t), {}),
120
- maxSize: s * 1024 * 1024,
121
- maxFiles: n ? 1 : x,
122
- disabled: d || f,
116
+ const n = r.filter((z, E) => E !== d);
117
+ C(n), W?.(n);
118
+ }, { getRootProps: be, getInputProps: Ce, isDragActive: ye, open: A } = Se({
119
+ onDrop: ve,
120
+ accept: o.reduce((t, d) => (t[d] = [], t), {}),
121
+ maxSize: c * 1024 * 1024,
122
+ maxFiles: i ? 1 : x,
123
+ disabled: s || a,
123
124
  noClick: !0
124
125
  });
125
- be(fe, () => ({
126
- setItems: I
126
+ ke(ge, () => ({
127
+ setItems: C
127
128
  }), []);
128
- const H = !f && !n && T && i.length > 0, J = !f && !n && i.length > 0 && /* @__PURE__ */ l("div", { className: p("w-full mt-2", y?.previewWrapper), children: [
129
- N === "default" && /* @__PURE__ */ l("pre", { className: "font-semibold text-gray-600", children: [
130
- te,
129
+ const v = ue && h === "image-grid" && !i && r.length > 0, H = !a && !i && $ && r.length > 0, J = v ? r.slice(1) : r, Y = !s && !i && h === "image-grid" && r.length > 0 && r.length < x, Z = !a && !i && (J.length > 0 || Y) && /* @__PURE__ */ l("div", { className: p("w-full mt-2", w?.previewWrapper), children: [
130
+ h === "default" && /* @__PURE__ */ l("pre", { className: "font-semibold text-gray-600", children: [
131
+ ne,
131
132
  ":"
132
133
  ] }),
133
- /* @__PURE__ */ e(
134
+ /* @__PURE__ */ l(
134
135
  "ul",
135
136
  {
136
137
  className: p(
137
138
  "mt-2 text-sm text-gray-500 flex flex-wrap items-start",
138
- N === "image-grid" ? "gap-2 justify-start" : "gap-4 justify-center"
139
+ h === "image-grid" ? "gap-2 justify-start" : "gap-4 justify-center"
139
140
  ),
140
- children: i.map((t, c) => {
141
- const o = v(t) ? t.name : Se(t), F = v(t) ? (t.size / (1024 * 1024)).toFixed(2) + " MB" : "";
142
- return /* @__PURE__ */ l(
141
+ children: [
142
+ J.map((t, d) => {
143
+ const n = v ? d + 1 : d, z = b(t) ? t.name : Pe(t), E = b(t) ? (t.size / (1024 * 1024)).toFixed(2) + " MB" : "";
144
+ return /* @__PURE__ */ l(
145
+ "li",
146
+ {
147
+ className: p(
148
+ "relative",
149
+ h === "image-grid" ? "w-[75px] h-[75px]" : "flex flex-col items-center gap-2"
150
+ ),
151
+ children: [
152
+ /* @__PURE__ */ l("div", { className: "relative w-full h-full", children: [
153
+ /* @__PURE__ */ e(V, { item: t, styles: w }),
154
+ /* @__PURE__ */ e(
155
+ "div",
156
+ {
157
+ className: p(
158
+ "absolute top-0 right-0 cursor-pointer bg-gray-300 rounded-sm",
159
+ h === "image-grid" && "top-1 right-1 bg-white/90 rounded-full p-0.5"
160
+ ),
161
+ onClick: (Ie) => I(Ie, n),
162
+ children: /* @__PURE__ */ e(D, { size: 16, strokeWidth: 1, color: "black" })
163
+ }
164
+ )
165
+ ] }),
166
+ h === "default" && /* @__PURE__ */ l("span", { className: "inline-flex flex-col items-center", children: [
167
+ /* @__PURE__ */ e("span", { className: "max-w-[80px] text-ellipsis overflow-hidden whitespace-nowrap", children: z }),
168
+ E && /* @__PURE__ */ l("span", { children: [
169
+ "(",
170
+ E,
171
+ ")"
172
+ ] })
173
+ ] })
174
+ ]
175
+ },
176
+ n
177
+ );
178
+ }),
179
+ Y && /* @__PURE__ */ e(
143
180
  "li",
144
181
  {
145
- className: p(
146
- "relative",
147
- N === "image-grid" ? "w-[75px] h-[75px]" : "flex flex-col items-center gap-2"
148
- ),
149
- children: [
150
- /* @__PURE__ */ l("div", { className: "relative w-full h-full", children: [
151
- /* @__PURE__ */ e(De, { item: t, styles: y }),
152
- /* @__PURE__ */ e(
153
- "div",
154
- {
155
- className: p(
156
- "absolute top-0 right-0 cursor-pointer bg-gray-300 rounded-sm",
157
- N === "image-grid" && "top-1 right-1 bg-white/90 rounded-full p-0.5"
158
- ),
159
- onClick: (B) => S(B, c),
160
- children: /* @__PURE__ */ e(k, { size: 16, strokeWidth: 1, color: "black" })
161
- }
162
- )
163
- ] }),
164
- N === "default" && /* @__PURE__ */ l("span", { className: "inline-flex flex-col items-center", children: [
165
- /* @__PURE__ */ e("span", { className: "max-w-[80px] text-ellipsis overflow-hidden whitespace-nowrap", children: o }),
166
- F && /* @__PURE__ */ l("span", { children: [
167
- "(",
168
- F,
169
- ")"
170
- ] })
171
- ] })
172
- ]
182
+ className: "relative w-[75px] h-[75px] flex items-center justify-center rounded-[8px] border border-dashed border-[#9368FF80] bg-[#FCFCFC] cursor-pointer hover:bg-[#9368FF0F]",
183
+ onClick: (t) => {
184
+ t.stopPropagation(), !(s || a) && A();
185
+ },
186
+ children: /* @__PURE__ */ e("div", { className: "flex size-6 items-center justify-center rounded-full bg-[#9368FF1F]", children: /* @__PURE__ */ e(ze, { size: 16, className: "text-[#9368FF]" }) })
173
187
  },
174
- c
175
- );
176
- })
188
+ "add-more"
189
+ )
190
+ ]
177
191
  }
178
192
  )
179
193
  ] });
180
- return /* @__PURE__ */ l("div", { className: "w-full", children: [
194
+ return /* @__PURE__ */ l("div", { className: "w-full select-none", children: [
181
195
  /* @__PURE__ */ l(
182
- ze,
196
+ Be,
183
197
  {
184
- ...z,
185
- ...ge({
198
+ ...M,
199
+ ...be({
186
200
  onClick: (t) => {
187
- if (!(d || f)) {
188
- if (he) {
189
- z.onClick?.(t);
201
+ if (!(s || a)) {
202
+ if (Ne) {
203
+ M.onClick?.(t);
190
204
  return;
191
205
  }
192
- q(), z.onClick?.(t);
206
+ A(), M.onClick?.(t);
193
207
  }
194
208
  }
195
209
  }),
196
210
  className: p(
197
211
  "w-full text-center flex flex-col items-center justify-center gap-6 cursor-pointer",
198
- !M && "border border-dashed border-[#9368FF80] rounded-[8px] bg-[#FCFCFC] p-4",
199
- M && "min-h-0 border-0 bg-transparent p-0",
200
- d && "border-[#E4E4E7] pointer-events-none",
201
- h.length > 0 && !M && "border-red-500",
202
- Ne && "bg-gray-100",
203
- n && "shadow-none!",
204
- n && i.length > 0 && !j && "p-0! shadow-none!",
205
- j && "h-auto! max-h-none! min-h-0! p-2!",
206
- U
212
+ !R && "border border-dashed border-[#9368FF80] rounded-[8px] bg-[#FCFCFC] p-4",
213
+ R && "min-h-0 border-0 bg-transparent p-0",
214
+ v && "relative",
215
+ s && "border-[#E4E4E7] pointer-events-none",
216
+ u.length > 0 && !R && "border-red-500",
217
+ ye && "bg-gray-100",
218
+ i && "shadow-none!",
219
+ i && r.length > 0 && !B && "p-0! shadow-none!",
220
+ B && "h-auto! max-h-none! min-h-0! p-2!",
221
+ le
207
222
  ),
208
223
  children: [
209
- /* @__PURE__ */ e("input", { ...we() }),
210
- f && /* @__PURE__ */ l(
224
+ /* @__PURE__ */ e("input", { ...Ce() }),
225
+ a && /* @__PURE__ */ l(
211
226
  "div",
212
227
  {
213
228
  className: "w-full h-full min-h-46 rounded-lg border border-[#E4E4E7] bg-[#FCFCFC] flex flex-col items-center justify-center gap-4 p-4",
@@ -216,58 +231,89 @@ const Q = (r = 0) => `${(r / (1024 * 1024)).toFixed(0)} MB`, Je = {
216
231
  /* @__PURE__ */ l("div", { className: "relative h-24 w-24", children: [
217
232
  /* @__PURE__ */ e("svg", { className: "h-24 w-24", viewBox: "0 0 100 100", children: /* @__PURE__ */ e("circle", { cx: "50", cy: "50", r: "42", stroke: "#E6E1F5", strokeWidth: "8", fill: "none" }) }),
218
233
  /* @__PURE__ */ l("span", { className: "absolute inset-0 flex items-center justify-center text-lg font-semibold text-foreground", children: [
219
- Math.max(0, Math.min(100, Math.round(_))),
234
+ Math.max(0, Math.min(100, Math.round(T))),
220
235
  "%"
221
236
  ] })
222
237
  ] }),
223
238
  /* @__PURE__ */ l("div", { className: "text-center", children: [
224
- /* @__PURE__ */ e("p", { className: "text-xl font-semibold text-foreground", children: ae }),
239
+ /* @__PURE__ */ e("p", { className: "text-xl font-semibold text-foreground", children: pe }),
225
240
  /* @__PURE__ */ l("p", { className: "text-sm text-[#666A78]", children: [
226
- Q(se),
241
+ te(me),
227
242
  " of ",
228
- Q(ce)
243
+ te(fe)
229
244
  ] }),
230
- /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-[#666A78]", children: me })
245
+ /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-[#666A78]", children: xe })
231
246
  ] }),
232
247
  /* @__PURE__ */ e("div", { className: "w-full max-w-[520px] h-2 rounded-full bg-[#E6E1F5] overflow-hidden", children: /* @__PURE__ */ e(
233
248
  "div",
234
249
  {
235
250
  className: "h-full bg-[#9368FF] transition-[width] duration-150 ease-linear",
236
- style: { width: `${Math.max(0, Math.min(100, _))}%` }
251
+ style: { width: `${Math.max(0, Math.min(100, T))}%` }
237
252
  }
238
253
  ) }),
239
- P && /* @__PURE__ */ e(
254
+ X && /* @__PURE__ */ e(
240
255
  "button",
241
256
  {
242
257
  type: "button",
243
258
  className: "mt-1 h-10 min-w-36 rounded-md border border-[#E4E4E7] bg-white px-6 text-base font-medium text-foreground cursor-pointer",
244
259
  onClick: (t) => {
245
- t.stopPropagation(), P();
260
+ t.stopPropagation(), X();
246
261
  },
247
- children: de
262
+ children: he
263
+ }
264
+ )
265
+ ]
266
+ }
267
+ ),
268
+ !a && v && /* @__PURE__ */ l(
269
+ "div",
270
+ {
271
+ className: "absolute inset-0 rounded-[8px] overflow-hidden",
272
+ onClick: (t) => t.stopPropagation(),
273
+ children: [
274
+ /* @__PURE__ */ e(
275
+ V,
276
+ {
277
+ item: r[0],
278
+ styles: {
279
+ ...w,
280
+ previewWraper: p(
281
+ "w-full h-full rounded-[8px] border-0",
282
+ w?.previewWraper?.replace(/w-\[[^\]]+\]|h-\[[^\]]+\]/g, "")
283
+ )
284
+ }
285
+ }
286
+ ),
287
+ /* @__PURE__ */ e(
288
+ "div",
289
+ {
290
+ className: "absolute top-2 right-2 cursor-pointer bg-white/90 rounded-full p-1",
291
+ onClick: (t) => I(t, 0),
292
+ children: /* @__PURE__ */ e(D, { size: 16, strokeWidth: 1, color: "black" })
248
293
  }
249
294
  )
250
295
  ]
251
296
  }
252
297
  ),
253
- !f && (i.length === 0 || !n && T) && h.length === 0 && /* @__PURE__ */ l(
298
+ !a && (r.length === 0 || !i && $) && u.length === 0 && /* @__PURE__ */ l(
254
299
  "div",
255
300
  {
256
301
  className: p(
257
302
  "flex flex-col items-center gap-2 w-full",
258
- y?.idleWrapper
303
+ w?.idleWrapper,
304
+ v && "invisible"
259
305
  ),
260
306
  children: [
261
- /* @__PURE__ */ e("div", { className: "flex size-12 items-center justify-center rounded-full bg-[#9368FF1F]", children: /* @__PURE__ */ e(Fe, { className: "size-6 text-[#9368FF]" }) }),
262
- /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-1 w-full", children: !d && /* @__PURE__ */ l(Y, { children: [
307
+ /* @__PURE__ */ e("div", { className: "flex size-12 items-center justify-center rounded-full bg-[#9368FF1F]", children: /* @__PURE__ */ e(Ee, { className: "size-6 text-[#9368FF]" }) }),
308
+ /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-1 w-full", children: !s && /* @__PURE__ */ l(K, { children: [
263
309
  /* @__PURE__ */ e(
264
310
  "span",
265
311
  {
266
312
  className: p(
267
313
  "font-semibold text-[14px] leading-[125%] text-[#06080D] text-center w-full whitespace-pre-line",
268
- ne
314
+ ae
269
315
  ),
270
- children: C
316
+ children: j
271
317
  }
272
318
  ),
273
319
  /* @__PURE__ */ e(
@@ -275,132 +321,132 @@ const Q = (r = 0) => `${(r / (1024 * 1024)).toFixed(0)} MB`, Je = {
275
321
  {
276
322
  className: p(
277
323
  "font-medium text-[12px] leading-[120%] text-[#666A78] text-center w-full whitespace-pre-line",
278
- oe
324
+ de
279
325
  ),
280
- children: V
326
+ children: re
281
327
  }
282
328
  )
283
329
  ] }) }),
284
- !d && /* @__PURE__ */ e(
285
- He,
330
+ !s && /* @__PURE__ */ e(
331
+ Qe,
286
332
  {
287
333
  type: "button",
288
334
  size: "md",
289
- children: ee
335
+ children: ie
290
336
  }
291
337
  )
292
338
  ]
293
339
  }
294
340
  ),
295
- !f && h.length > 0 && !O && /* @__PURE__ */ l("div", { className: p("w-full mt-4", y?.errorWrapper), children: [
341
+ !a && u.length > 0 && !G && /* @__PURE__ */ l("div", { className: p("w-full mt-4", w?.errorWrapper), children: [
296
342
  /* @__PURE__ */ l("span", { className: "font-semibold text-red-500", children: [
297
- le,
343
+ oe,
298
344
  ":"
299
345
  ] }),
300
- /* @__PURE__ */ e("ul", { className: "mt-2 text-sm text-red-500 list-disc list-inside", children: h.map((t, c) => /* @__PURE__ */ l("li", { children: [
346
+ /* @__PURE__ */ e("ul", { className: "mt-2 text-sm text-red-500 list-disc list-inside", children: u.map((t, d) => /* @__PURE__ */ l("li", { children: [
301
347
  t.file.name,
302
348
  " (",
303
349
  (t.file.size / (1024 * 1024)).toFixed(2),
304
350
  " MB)",
305
- !m && /* @__PURE__ */ e("ul", { className: "ml-4 list-disc list-inside", children: t.errors.map((o, F) => /* @__PURE__ */ l("li", { children: [
306
- o.code === "file-too-large" && A,
307
- o.code === "file-invalid-type" && W,
308
- o.code !== "file-too-large" && o.code !== "file-invalid-type" && o.message
309
- ] }, F)) })
310
- ] }, c)) })
351
+ !f && /* @__PURE__ */ e("ul", { className: "ml-4 list-disc list-inside", children: t.errors.map((n, z) => /* @__PURE__ */ l("li", { children: [
352
+ n.code === "file-too-large" && P,
353
+ n.code === "file-invalid-type" && _,
354
+ n.code !== "file-too-large" && n.code !== "file-invalid-type" && n.message
355
+ ] }, z)) })
356
+ ] }, d)) })
311
357
  ] }),
312
- !f && !!(n && i.length) && /* @__PURE__ */ e(Y, { children: L ? /* @__PURE__ */ l(
358
+ !a && !!(i && r.length) && /* @__PURE__ */ e(K, { children: q ? /* @__PURE__ */ l(
313
359
  "div",
314
360
  {
315
361
  className: "w-full max-w-[502px] flex flex-col items-center gap-4",
316
362
  onClick: (t) => t.stopPropagation(),
317
363
  children: [
318
- /* @__PURE__ */ e("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: C }),
364
+ /* @__PURE__ */ e("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: j }),
319
365
  /* @__PURE__ */ l("div", { className: "w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4", children: [
320
- b ? /* @__PURE__ */ e(
366
+ y ? /* @__PURE__ */ e(
321
367
  "img",
322
368
  {
323
- src: b,
369
+ src: y,
324
370
  alt: "",
325
371
  className: "size-10 shrink-0"
326
372
  }
327
- ) : /* @__PURE__ */ e("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(Z, { size: 20 }) }),
373
+ ) : /* @__PURE__ */ e("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(Q, { size: 20 }) }),
328
374
  /* @__PURE__ */ l("div", { className: "flex flex-col items-start text-left gap-1 min-w-0 flex-1", children: [
329
- /* @__PURE__ */ e("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: u?.name }),
330
- /* @__PURE__ */ e("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: u ? `${(u.size / (1024 * 1024)).toFixed(0)} MB` : "" })
375
+ /* @__PURE__ */ e("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: g?.name }),
376
+ /* @__PURE__ */ e("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: g ? `${(g.size / (1024 * 1024)).toFixed(0)} MB` : "" })
331
377
  ] }),
332
- !d && /* @__PURE__ */ e(
378
+ !s && /* @__PURE__ */ e(
333
379
  "div",
334
380
  {
335
381
  className: "size-6 flex items-center justify-center cursor-pointer",
336
- onClick: (t) => S(t, 0),
337
- children: /* @__PURE__ */ e(k, { size: 24, color: "#06080D" })
382
+ onClick: (t) => I(t, 0),
383
+ children: /* @__PURE__ */ e(D, { size: 24, color: "#06080D" })
338
384
  }
339
385
  )
340
386
  ] })
341
387
  ]
342
388
  }
343
389
  ) : /* @__PURE__ */ e(
344
- je,
390
+ Ae,
345
391
  {
346
- item: i[0],
347
- onRemoveClick: (t) => S(t, 0),
392
+ item: r[0],
393
+ onRemoveClick: (t) => I(t, 0),
348
394
  onReplaceClick: (t) => {
349
- t.stopPropagation(), !d && q();
395
+ t.stopPropagation(), !s && A();
350
396
  },
351
- labelUploaded: ie,
352
- labelReplace: re,
353
- disabled: d
397
+ labelUploaded: se,
398
+ labelReplace: ce,
399
+ disabled: s
354
400
  }
355
401
  ) }),
356
- !f && O && /* @__PURE__ */ l(
402
+ !a && G && /* @__PURE__ */ l(
357
403
  "div",
358
404
  {
359
405
  className: "w-full max-w-[502px] flex flex-col items-center gap-4",
360
406
  onClick: (t) => t.stopPropagation(),
361
407
  children: [
362
- /* @__PURE__ */ e("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: C }),
408
+ /* @__PURE__ */ e("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: j }),
363
409
  /* @__PURE__ */ l("div", { className: "w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4", children: [
364
- b ? /* @__PURE__ */ e(
410
+ y ? /* @__PURE__ */ e(
365
411
  "img",
366
412
  {
367
- src: b,
413
+ src: y,
368
414
  alt: "",
369
415
  className: "size-10 shrink-0"
370
416
  }
371
- ) : /* @__PURE__ */ e("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(Z, { size: 20 }) }),
417
+ ) : /* @__PURE__ */ e("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(Q, { size: 20 }) }),
372
418
  /* @__PURE__ */ l("div", { className: "flex flex-col items-start text-left gap-1 min-w-0 flex-1", children: [
373
- /* @__PURE__ */ e("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: u?.name }),
374
- /* @__PURE__ */ e("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: u ? `${(u.size / (1024 * 1024)).toFixed(0)} MB` : "" })
419
+ /* @__PURE__ */ e("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: g?.name }),
420
+ /* @__PURE__ */ e("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: g ? `${(g.size / (1024 * 1024)).toFixed(0)} MB` : "" })
375
421
  ] }),
376
- !d && /* @__PURE__ */ e(
422
+ !s && /* @__PURE__ */ e(
377
423
  "div",
378
424
  {
379
425
  className: "size-6 flex items-center justify-center cursor-pointer",
380
426
  onClick: (t) => {
381
- t.stopPropagation(), X([]);
427
+ t.stopPropagation(), L([]);
382
428
  },
383
- children: /* @__PURE__ */ e(k, { size: 24, color: "#06080D" })
429
+ children: /* @__PURE__ */ e(D, { size: 24, color: "#06080D" })
384
430
  }
385
431
  )
386
432
  ] }),
387
433
  /* @__PURE__ */ l("div", { className: "w-full bg-[#DC26260F] p-4 flex items-start gap-4", children: [
388
- /* @__PURE__ */ e(ve, { size: 20, color: "#DC2626" }),
389
- /* @__PURE__ */ e("p", { className: "text-[12px] leading-[120%] font-medium text-[#DC2626] text-left", children: h[0]?.errors?.[0]?.code === "file-too-large" ? A : h[0]?.errors?.[0]?.message || W })
434
+ /* @__PURE__ */ e(De, { size: 20, color: "#DC2626" }),
435
+ /* @__PURE__ */ e("p", { className: "text-[12px] leading-[120%] font-medium text-[#DC2626] text-left", children: u[0]?.errors?.[0]?.code === "file-too-large" ? P : u[0]?.errors?.[0]?.message || _ })
390
436
  ] })
391
437
  ]
392
438
  }
393
439
  ),
394
- !H && J
440
+ !H && Z
395
441
  ]
396
442
  }
397
443
  ),
398
- H && /* @__PURE__ */ e("div", { className: "w-full", children: J })
444
+ H && /* @__PURE__ */ e("div", { className: "w-full", children: Z })
399
445
  ] });
400
446
  }
401
447
  );
402
- Ke.displayName = "Dropzone";
448
+ lt.displayName = "Dropzone";
403
449
  export {
404
- Ke as Dropzone
450
+ lt as Dropzone
405
451
  };
406
452
  //# sourceMappingURL=Dropzone.js.map