@oneplatformdev/ui 0.1.99-beta.271 → 0.1.99-beta.272

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