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