@oneplatformdev/ui 0.1.99-beta.296 → 0.1.99-beta.298
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/.storybook/Wrappers.js.map +1 -1
- package/Accordion/Accordion.js.map +1 -1
- package/Alert/Alert.js.map +1 -1
- package/Alert/alertVariants.js.map +1 -1
- package/AlertDialog/AlertDialog.js.map +1 -1
- package/AlertDialog/AlertDialog.stories.js +2 -4
- package/AlertDialog/AlertDialog.stories.js.map +1 -1
- package/AlertDialog/AlertDialogRoot.js +18 -20
- package/AlertDialog/AlertDialogRoot.js.map +1 -1
- package/AreaChart/AreaChart.js.map +1 -1
- package/Aside/Aside.js.map +1 -1
- package/Aside/AsideSidebar.js.map +1 -1
- package/AspectRatio/AspectRatio.js.map +1 -1
- package/Avatar/Avatar.js.map +1 -1
- package/Badge/Badge.js.map +1 -1
- package/Badge/badgeVariants.js.map +1 -1
- package/Breadcrumb/Breadcrumb.js.map +1 -1
- package/Button/Button.js +10 -11
- package/Button/Button.js.map +1 -1
- package/Button/Button.stories.js.map +1 -1
- package/Button/Button.utils.js.map +1 -1
- package/Button/ButtonCounterBadge.js.map +1 -1
- package/Button/buttonVariants.js.map +1 -1
- package/ButtonIcon/ButtonIcon.js +19 -22
- package/ButtonIcon/ButtonIcon.js.map +1 -1
- package/ButtonIcon/ButtonIcon.stories.js.map +1 -1
- package/ButtonIcon/buttonIconVariants.js.map +1 -1
- package/CHANGELOG.md +3491 -3465
- package/Calendar/Calendar.js +4 -6
- package/Calendar/Calendar.js.map +1 -1
- package/Card/Card.js.map +1 -1
- package/Carousel/Carousel.js +6 -7
- package/Carousel/Carousel.js.map +1 -1
- package/Chart/Chart.js.map +1 -1
- package/Checkbox/Checkbox.js +0 -1
- package/Checkbox/Checkbox.js.map +1 -1
- package/Checkbox/Checkbox.stories.js.map +1 -1
- package/Collapsible/Collapsible.js.map +1 -1
- package/Combobox/Combobox.js +10 -10
- package/Combobox/Combobox.js.map +1 -1
- package/Combobox/Combobox.stories.js.map +1 -1
- package/Combobox/Combobox.types.js.map +1 -1
- package/Combobox/ComboboxOptionItem.js +18 -19
- package/Combobox/ComboboxOptionItem.js.map +1 -1
- package/Combobox/ComboboxRenderContent.js +26 -27
- package/Combobox/ComboboxRenderContent.js.map +1 -1
- package/Combobox/ComboboxRenderOptions.js +5 -5
- package/Combobox/ComboboxRenderOptions.js.map +1 -1
- package/Combobox/ComboboxRenderTrigger.js +18 -20
- package/Combobox/ComboboxRenderTrigger.js.map +1 -1
- package/Command/Command.js +21 -22
- package/Command/Command.js.map +1 -1
- package/ContextPopover/ContextDropdownMenu.js.map +1 -1
- package/ContextPopover/ContextPopover.js.map +1 -1
- package/ContextPopover/useContextPopoverHandler.js.map +1 -1
- package/DataTable/DataTable.js +24 -26
- package/DataTable/DataTable.js.map +1 -1
- package/DataTable/DataTableColumnFilter.js +6 -7
- package/DataTable/DataTableColumnFilter.js.map +1 -1
- package/DataTable/useDataTable.js.map +1 -1
- package/DatePicker/DatePicker.js +1 -2
- package/DatePicker/DatePicker.js.map +1 -1
- package/Dialog/Dialog.js +20 -21
- package/Dialog/Dialog.js.map +1 -1
- package/Dialog/Dialog.stories.js +14 -15
- package/Dialog/Dialog.stories.js.map +1 -1
- package/Dialog/DialogOverlayScope.js.map +1 -1
- package/Dialog/useDialogClosePosition.js.map +1 -1
- package/Drawer/Drawer.js.map +1 -1
- package/DropdownMenu/DropdownMenu.js.map +1 -1
- package/Dropzone/Dropzone.d.ts.map +1 -1
- package/Dropzone/Dropzone.js +300 -277
- 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/DropzoneCoverPreview.d.ts +14 -0
- package/Dropzone/DropzoneCoverPreview.d.ts.map +1 -0
- package/Dropzone/DropzoneCoverPreview.js +56 -0
- package/Dropzone/DropzoneCoverPreview.js.map +1 -0
- 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/DropzoneFilePreview.js.map +1 -1
- package/Dropzone/DropzoneSinglePickPreview.js +2 -3
- package/Dropzone/DropzoneSinglePickPreview.js.map +1 -1
- package/Dropzone/DropzoneUtils.js.map +1 -1
- package/Dropzone/index.js +6 -5
- package/Form/Form.js +14 -15
- package/Form/Form.js.map +1 -1
- package/Form/FormRenderControl.js +6 -7
- package/Form/FormRenderControl.js.map +1 -1
- package/Form/Form_old.js +4 -5
- package/Form/Form_old.js.map +1 -1
- package/FormCheckbox/FormCheckbox.js +4 -4
- package/FormCheckbox/FormCheckbox.js.map +1 -1
- package/FormCombobox/FormCombobox.js +4 -4
- package/FormCombobox/FormCombobox.js.map +1 -1
- package/FormDatePicker/FormDatePicker.js +4 -4
- package/FormDatePicker/FormDatePicker.js.map +1 -1
- package/FormDropzone/FormDropzone.js +3 -3
- package/FormDropzone/FormDropzone.js.map +1 -1
- package/FormInput/FormInput.js +6 -6
- package/FormInput/FormInput.js.map +1 -1
- package/FormInput/FormInput.stories.js.map +1 -1
- package/FormRadio/FormRadio.js.map +1 -1
- package/FormSelect/FormSelect.js +6 -9
- package/FormSelect/FormSelect.js.map +1 -1
- package/FormTextarea/FormTextarea.js +4 -4
- package/FormTextarea/FormTextarea.js.map +1 -1
- package/Header/Header.js.map +1 -1
- package/HoverCard/HoverCard.js.map +1 -1
- package/InfoBlock/InfoBlock.js.map +1 -1
- package/InfoBlock/InfoBlock.stories.js.map +1 -1
- package/InfoBlock/infoBlockVariants.js.map +1 -1
- package/Input/Input.js.map +1 -1
- package/Input/Input.stories.js.map +1 -1
- package/Input/inputVariants.js.map +1 -1
- package/InputOTP/InputOTP.d.ts.map +1 -1
- package/InputOTP/InputOTP.js.map +1 -1
- package/LICENSE +21 -21
- package/Label/Label.js.map +1 -1
- package/Label/labelVariants.js.map +1 -1
- package/LazyLoader/LazyLoader.js +4 -5
- package/LazyLoader/LazyLoader.js.map +1 -1
- package/LoadedIcon/LoadedIcon.js.map +1 -1
- package/LoadingMask/LoadingMask.js.map +1 -1
- package/LoadingMask/RenderLoadingMask.js.map +1 -1
- package/LoadingProgress/LoadingProgress.js.map +1 -1
- package/LoadingProgress/loadingProgressVariants.js.map +1 -1
- package/Menubar/Menubar.js.map +1 -1
- package/NavigationMenu/NavigationMenu.js.map +1 -1
- package/NavigationMenu/navigationMenuVariants.js.map +1 -1
- package/Pagination/Pagination.js +0 -1
- package/Pagination/Pagination.js.map +1 -1
- package/Popover/Popover.js.map +1 -1
- package/Progress/Progress.js.map +1 -1
- package/README.md +7 -7
- package/Radio/Radio.js.map +1 -1
- package/RadioGroup/RadioGroup.js.map +1 -1
- package/Resizable/Resizable.js.map +1 -1
- package/Resizable/Resizable.stories.js.map +1 -1
- package/ScrollArea/ScrollArea.js.map +1 -1
- package/Search/Search.js +9 -9
- package/Search/Search.js.map +1 -1
- package/Search/Search.stories.js.map +1 -1
- package/Select/Select.js +6 -7
- package/Select/Select.js.map +1 -1
- package/Select/Select.stories.js.map +1 -1
- package/Select/SelectRoot.js.map +1 -1
- package/Separator/Separator.js.map +1 -1
- package/Sheet/Sheet.js.map +1 -1
- package/Sidebar/Sidebar.js +20 -21
- package/Sidebar/Sidebar.js.map +1 -1
- package/Skeleton/Skeleton.js.map +1 -1
- package/Slider/Slider.js.map +1 -1
- package/Sonner/Sonner.js.map +1 -1
- package/Switch/Switch.js.map +1 -1
- package/Switch/Switch.stories.js.map +1 -1
- package/Table/Table.js.map +1 -1
- package/TablePagination/TablePagination.js +21 -26
- package/TablePagination/TablePagination.js.map +1 -1
- package/Tabs/Tabs.js.map +1 -1
- package/Tabs/TabsRoot.js.map +1 -1
- package/Textarea/Textarea.js.map +1 -1
- package/Textarea/Textarea.stories.js.map +1 -1
- package/Textarea/useAutosizeTextArea.js.map +1 -1
- package/Theme/ThemeModeToggle.js +3 -4
- package/Theme/ThemeModeToggle.js.map +1 -1
- package/Theme/ThemeProvider.js.map +1 -1
- package/Toast/Toast.js.map +1 -1
- package/Toast/toast.constants.js.map +1 -1
- package/Toast/toastVariants.js.map +1 -1
- package/Toast/useToast.js.map +1 -1
- package/Toaster/Toaster.js.map +1 -1
- package/Toggle/Toggle.js.map +1 -1
- package/ToggleGroup/ToggleGroup.js.map +1 -1
- package/Tooltip/Tooltip.js.map +1 -1
- package/Tooltip/TooltipRoot.js.map +1 -1
- package/Tooltip/tooltipVariants.js.map +1 -1
- package/index.js +304 -303
- package/package.json +4 -4
- package/vite-env.d.ts +7 -7
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
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import "
|
|
13
|
-
import
|
|
6
|
+
import { Card as Xe } from "../Card/Card.js";
|
|
7
|
+
import { DEFAULT_FILE_TYPES as Ke } from "./Dropzone.types.js";
|
|
8
|
+
import { DropzoneCoverPreview as re } from "./DropzoneCoverPreview.js";
|
|
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
14
|
import Pe from "./icons/file-doc.svg.js";
|
|
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
|
-
|
|
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:
|
|
36
|
+
return r >= s ? `${(r / s).toFixed(r / s >= 100 ? 0 : 1)} KB` : `${r} B`;
|
|
37
|
+
}, st = {
|
|
38
|
+
csv: Je,
|
|
38
39
|
doc: Pe,
|
|
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 =
|
|
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,128 +76,141 @@ const b = (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:
|
|
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",
|
|
99
100
|
singlePick: n = !1,
|
|
100
|
-
labelDropzoneClassname:
|
|
101
|
-
labelDropzoneSubClassname:
|
|
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:
|
|
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,
|
|
112
113
|
singlePickFileInfo: W,
|
|
113
|
-
persistentDropzone:
|
|
114
|
-
previewVariant:
|
|
115
|
-
coverFirstItem:
|
|
116
|
-
|
|
117
|
-
},
|
|
118
|
-
const [
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
|
|
114
|
+
persistentDropzone: _ = !1,
|
|
115
|
+
previewVariant: h = "default",
|
|
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
|
-
}, [
|
|
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: n ? 1 :
|
|
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
|
-
|
|
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(
|
|
151
165
|
"mt-2 text-sm text-gray-500 flex flex-wrap items-start",
|
|
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(
|
|
161
175
|
"relative",
|
|
162
|
-
|
|
176
|
+
h === "image-grid" ? "w-[75px] h-[75px]" : "flex flex-col items-center gap-2"
|
|
163
177
|
),
|
|
164
178
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__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
|
-
"absolute top-0 right-0 cursor-pointer bg-gray-300 rounded-sm",
|
|
172
|
-
|
|
185
|
+
"absolute top-0 right-0 z-20 cursor-pointer bg-gray-300 rounded-sm",
|
|
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
|
-
|
|
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,282 +218,291 @@ const b = (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
|
-
|
|
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
|
-
|
|
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",
|
|
228
243
|
f && "border-[#E4E4E7] pointer-events-none",
|
|
229
|
-
|
|
230
|
-
|
|
244
|
+
u.length > 0 && !B && "border-red-500",
|
|
245
|
+
Be && "bg-gray-100",
|
|
231
246
|
n && "shadow-none!",
|
|
232
|
-
n &&
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
|
236
252
|
),
|
|
237
253
|
children: [
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
p && /* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ t("input", { ...je() }),
|
|
255
|
+
p && /* @__PURE__ */ l(
|
|
240
256
|
"div",
|
|
241
257
|
{
|
|
242
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",
|
|
243
|
-
onClick: (
|
|
259
|
+
onClick: (e) => e.stopPropagation(),
|
|
244
260
|
children: [
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
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))),
|
|
249
265
|
"%"
|
|
250
266
|
] })
|
|
251
267
|
] }),
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
-
/* @__PURE__ */
|
|
255
|
-
|
|
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),
|
|
256
272
|
" ",
|
|
257
|
-
|
|
273
|
+
ve,
|
|
258
274
|
" ",
|
|
259
|
-
|
|
275
|
+
z(ge)
|
|
260
276
|
] }),
|
|
261
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ t("p", { className: "mt-2 text-sm text-[#666A78]", children: Fe })
|
|
262
278
|
] }),
|
|
263
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ t("div", { className: "w-full max-w-[520px] h-2 rounded-full bg-[#E6E1F5] overflow-hidden", children: /* @__PURE__ */ t(
|
|
264
280
|
"div",
|
|
265
281
|
{
|
|
266
282
|
className: "h-full bg-[#9368FF] transition-[width] duration-150 ease-linear",
|
|
267
|
-
style: { width: `${Math.max(0, Math.min(100,
|
|
283
|
+
style: { width: `${Math.max(0, Math.min(100, H))}%` }
|
|
268
284
|
}
|
|
269
285
|
) }),
|
|
270
|
-
|
|
286
|
+
J && /* @__PURE__ */ t(
|
|
271
287
|
"button",
|
|
272
288
|
{
|
|
273
289
|
type: "button",
|
|
274
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",
|
|
275
|
-
onClick: (
|
|
276
|
-
|
|
291
|
+
onClick: (e) => {
|
|
292
|
+
e.stopPropagation(), J();
|
|
277
293
|
},
|
|
278
|
-
children:
|
|
294
|
+
children: we
|
|
279
295
|
}
|
|
280
296
|
)
|
|
281
297
|
]
|
|
282
298
|
}
|
|
283
299
|
),
|
|
284
|
-
!p &&
|
|
300
|
+
!p && D && /* @__PURE__ */ l(
|
|
285
301
|
"div",
|
|
286
302
|
{
|
|
287
303
|
className: "absolute inset-0 rounded-[8px] overflow-hidden",
|
|
288
|
-
onClick: (
|
|
304
|
+
onClick: (e) => e.stopPropagation(),
|
|
289
305
|
children: [
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
|
|
292
|
-
{
|
|
293
|
-
item: i[0],
|
|
294
|
-
styles: {
|
|
295
|
-
...u,
|
|
296
|
-
previewWraper: x(
|
|
297
|
-
"w-full h-full rounded-[8px] border-0",
|
|
298
|
-
u?.previewWraper?.replace(/w-\[[^\]]+\]|h-\[[^\]]+\]/g, "")
|
|
299
|
-
)
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
),
|
|
303
|
-
/* @__PURE__ */ e(
|
|
306
|
+
/* @__PURE__ */ t(re, { item: o[0], className: "rounded-[8px]" }),
|
|
307
|
+
/* @__PURE__ */ t(
|
|
304
308
|
"div",
|
|
305
309
|
{
|
|
306
|
-
className: "absolute top-2 right-2 cursor-pointer bg-white/90 rounded-full p-1",
|
|
307
|
-
onClick: (
|
|
308
|
-
children: /* @__PURE__ */
|
|
310
|
+
className: "absolute top-2 right-2 z-20 cursor-pointer bg-white/90 rounded-full p-1",
|
|
311
|
+
onClick: (e) => E(e, 0),
|
|
312
|
+
children: /* @__PURE__ */ t(M, { size: 16, strokeWidth: 1, color: "black" })
|
|
309
313
|
}
|
|
310
314
|
)
|
|
311
315
|
]
|
|
312
316
|
}
|
|
313
317
|
),
|
|
314
|
-
!p && (
|
|
318
|
+
!p && (o.length === 0 || !n && _) && (u.length === 0 || !n) && /* @__PURE__ */ l(
|
|
315
319
|
"div",
|
|
316
320
|
{
|
|
317
321
|
className: x(
|
|
318
322
|
"flex flex-col items-center gap-2 w-full",
|
|
319
|
-
|
|
320
|
-
|
|
323
|
+
b?.idleWrapper,
|
|
324
|
+
D && "invisible"
|
|
321
325
|
),
|
|
322
326
|
children: [
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
|
|
325
|
-
|
|
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(
|
|
326
347
|
"span",
|
|
327
348
|
{
|
|
328
349
|
className: x(
|
|
329
350
|
"font-semibold text-[14px] leading-[125%] text-[#06080D] text-center w-full whitespace-pre-line",
|
|
330
|
-
|
|
351
|
+
N && "text-[#A1A1AA]",
|
|
352
|
+
xe
|
|
331
353
|
),
|
|
332
|
-
children:
|
|
354
|
+
children: R
|
|
333
355
|
}
|
|
334
356
|
),
|
|
335
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ t(
|
|
336
358
|
"span",
|
|
337
359
|
{
|
|
338
360
|
className: x(
|
|
339
361
|
"font-medium text-[12px] leading-[120%] text-[#666A78] text-center w-full whitespace-pre-line",
|
|
340
|
-
|
|
362
|
+
he
|
|
341
363
|
),
|
|
342
|
-
children:
|
|
364
|
+
children: ce
|
|
343
365
|
}
|
|
344
366
|
)
|
|
345
367
|
] }) }),
|
|
346
|
-
!f && /* @__PURE__ */
|
|
347
|
-
|
|
368
|
+
!f && /* @__PURE__ */ t(
|
|
369
|
+
nt,
|
|
348
370
|
{
|
|
349
371
|
type: "button",
|
|
350
372
|
size: "md",
|
|
351
|
-
|
|
373
|
+
disabled: N,
|
|
374
|
+
children: ae
|
|
352
375
|
}
|
|
353
376
|
)
|
|
354
377
|
]
|
|
355
378
|
}
|
|
356
379
|
),
|
|
357
|
-
!p && n &&
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
-
|
|
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,
|
|
360
383
|
":"
|
|
361
384
|
] }),
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
-
|
|
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,
|
|
364
387
|
" (",
|
|
365
|
-
|
|
388
|
+
z(e.file.size),
|
|
366
389
|
")",
|
|
367
|
-
!
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
] },
|
|
372
|
-
] },
|
|
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)) })
|
|
373
396
|
] }),
|
|
374
|
-
!p && !!(n &&
|
|
397
|
+
!p && !!(n && o.length) && /* @__PURE__ */ t(V, { children: X ? /* @__PURE__ */ l(
|
|
375
398
|
"div",
|
|
376
399
|
{
|
|
377
400
|
className: "w-full max-w-[502px] flex flex-col items-center gap-4",
|
|
378
|
-
onClick: (
|
|
401
|
+
onClick: (e) => e.stopPropagation(),
|
|
379
402
|
children: [
|
|
380
|
-
/* @__PURE__ */
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
|
|
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(
|
|
383
406
|
"img",
|
|
384
407
|
{
|
|
385
|
-
src:
|
|
408
|
+
src: S,
|
|
386
409
|
alt: "",
|
|
387
410
|
className: "size-10 shrink-0"
|
|
388
411
|
}
|
|
389
|
-
) : /* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
-
/* @__PURE__ */
|
|
392
|
-
/* @__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) })
|
|
393
416
|
] }),
|
|
394
|
-
!f && /* @__PURE__ */
|
|
417
|
+
!f && /* @__PURE__ */ t(
|
|
395
418
|
"div",
|
|
396
419
|
{
|
|
397
420
|
className: "size-6 flex items-center justify-center cursor-pointer",
|
|
398
|
-
onClick: (
|
|
399
|
-
children: /* @__PURE__ */
|
|
421
|
+
onClick: (e) => E(e, 0),
|
|
422
|
+
children: /* @__PURE__ */ t(M, { size: 24, color: "#06080D" })
|
|
400
423
|
}
|
|
401
424
|
)
|
|
402
425
|
] })
|
|
403
426
|
]
|
|
404
427
|
}
|
|
405
|
-
) : /* @__PURE__ */
|
|
406
|
-
|
|
428
|
+
) : /* @__PURE__ */ t(
|
|
429
|
+
qe,
|
|
407
430
|
{
|
|
408
|
-
item:
|
|
409
|
-
onRemoveClick: (
|
|
410
|
-
onReplaceClick: (
|
|
411
|
-
|
|
431
|
+
item: o[0],
|
|
432
|
+
onRemoveClick: (e) => E(e, 0),
|
|
433
|
+
onReplaceClick: (e) => {
|
|
434
|
+
e.stopPropagation(), !f && K();
|
|
412
435
|
},
|
|
413
|
-
labelUploaded:
|
|
414
|
-
labelReplace:
|
|
436
|
+
labelUploaded: fe,
|
|
437
|
+
labelReplace: pe,
|
|
415
438
|
fileInfo: W,
|
|
416
439
|
disabled: f,
|
|
417
|
-
playerTranslations:
|
|
440
|
+
playerTranslations: Ce
|
|
418
441
|
}
|
|
419
442
|
) }),
|
|
420
|
-
!p &&
|
|
443
|
+
!p && Z && /* @__PURE__ */ l(
|
|
421
444
|
"div",
|
|
422
445
|
{
|
|
423
446
|
className: "w-full max-w-[502px] flex flex-col items-center gap-4",
|
|
424
|
-
onClick: (
|
|
447
|
+
onClick: (e) => e.stopPropagation(),
|
|
425
448
|
children: [
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
-
/* @__PURE__ */
|
|
428
|
-
|
|
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(
|
|
429
452
|
"img",
|
|
430
453
|
{
|
|
431
|
-
src:
|
|
454
|
+
src: S,
|
|
432
455
|
alt: "",
|
|
433
456
|
className: "size-10 shrink-0"
|
|
434
457
|
}
|
|
435
|
-
) : /* @__PURE__ */
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
/* @__PURE__ */
|
|
438
|
-
/* @__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` : "" })
|
|
439
462
|
] }),
|
|
440
|
-
!f && /* @__PURE__ */
|
|
463
|
+
!f && /* @__PURE__ */ t(
|
|
441
464
|
"div",
|
|
442
465
|
{
|
|
443
466
|
className: "size-6 flex items-center justify-center cursor-pointer",
|
|
444
|
-
onClick: (
|
|
445
|
-
|
|
467
|
+
onClick: (e) => {
|
|
468
|
+
e.stopPropagation(), P([]);
|
|
446
469
|
},
|
|
447
|
-
children: /* @__PURE__ */
|
|
470
|
+
children: /* @__PURE__ */ t(M, { size: 24, color: "#06080D" })
|
|
448
471
|
}
|
|
449
472
|
)
|
|
450
473
|
] }),
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
/* @__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 })
|
|
454
477
|
] })
|
|
455
478
|
]
|
|
456
479
|
}
|
|
457
480
|
),
|
|
458
|
-
!
|
|
481
|
+
!O && U
|
|
459
482
|
]
|
|
460
483
|
}
|
|
461
484
|
),
|
|
462
|
-
|
|
463
|
-
!p && !n &&
|
|
485
|
+
O && /* @__PURE__ */ t("div", { className: "w-full", children: U }),
|
|
486
|
+
!p && !n && u.length > 0 && /* @__PURE__ */ t(
|
|
464
487
|
"div",
|
|
465
488
|
{
|
|
466
|
-
className: x("w-full mt-4 flex flex-col gap-2",
|
|
467
|
-
children:
|
|
468
|
-
const
|
|
469
|
-
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(
|
|
470
493
|
"div",
|
|
471
494
|
{
|
|
472
495
|
className: "w-full bg-[#DC26260F] p-4 flex items-start gap-4 rounded-[8px]",
|
|
473
496
|
children: [
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
/* @__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 }),
|
|
477
500
|
" — ",
|
|
478
|
-
|
|
501
|
+
g
|
|
479
502
|
] })
|
|
480
503
|
]
|
|
481
504
|
},
|
|
482
|
-
|
|
505
|
+
c
|
|
483
506
|
);
|
|
484
507
|
})
|
|
485
508
|
}
|
|
@@ -487,8 +510,8 @@ const b = (l = 0) => {
|
|
|
487
510
|
] });
|
|
488
511
|
}
|
|
489
512
|
);
|
|
490
|
-
|
|
513
|
+
dt.displayName = "Dropzone";
|
|
491
514
|
export {
|
|
492
|
-
|
|
515
|
+
dt as Dropzone
|
|
493
516
|
};
|
|
494
517
|
//# sourceMappingURL=Dropzone.js.map
|