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