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