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