@oneplatformdev/ui 0.1.99-beta.27 → 0.1.99-beta.270

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.
Files changed (252) hide show
  1. package/Accordion/Accordion.d.ts +1 -1
  2. package/Accordion/Accordion.d.ts.map +1 -1
  3. package/Accordion/Accordion.js +48 -26
  4. package/Accordion/Accordion.js.map +1 -1
  5. package/AlertDialog/AlertDialog.stories.js +66 -23
  6. package/AlertDialog/AlertDialog.stories.js.map +1 -1
  7. package/AlertDialog/AlertDialogRoot.d.ts.map +1 -1
  8. package/AlertDialog/AlertDialogRoot.js +19 -18
  9. package/AlertDialog/AlertDialogRoot.js.map +1 -1
  10. package/Button/Button.d.ts.map +1 -1
  11. package/Button/Button.js +40 -40
  12. package/Button/Button.js.map +1 -1
  13. package/Button/Button.stories.js +15 -12
  14. package/Button/Button.stories.js.map +1 -1
  15. package/Button/Button.utils.d.ts +3 -0
  16. package/Button/Button.utils.d.ts.map +1 -0
  17. package/Button/Button.utils.js +14 -0
  18. package/Button/Button.utils.js.map +1 -0
  19. package/Button/buttonVariants.d.ts +2 -2
  20. package/Button/buttonVariants.d.ts.map +1 -1
  21. package/Button/buttonVariants.js +38 -6
  22. package/Button/buttonVariants.js.map +1 -1
  23. package/Button/index.d.ts +1 -0
  24. package/Button/index.d.ts.map +1 -1
  25. package/Button/index.js +8 -6
  26. package/Button/index.js.map +1 -1
  27. package/ButtonIcon/ButtonIcon.d.ts.map +1 -1
  28. package/ButtonIcon/ButtonIcon.js +47 -47
  29. package/ButtonIcon/ButtonIcon.js.map +1 -1
  30. package/ButtonIcon/ButtonIcon.stories.js +35 -33
  31. package/ButtonIcon/ButtonIcon.stories.js.map +1 -1
  32. package/ButtonIcon/buttonIconVariants.d.ts +1 -1
  33. package/ButtonIcon/buttonIconVariants.d.ts.map +1 -1
  34. package/ButtonIcon/buttonIconVariants.js +3 -2
  35. package/ButtonIcon/buttonIconVariants.js.map +1 -1
  36. package/CHANGELOG.md +1527 -0
  37. package/Card/Card.d.ts.map +1 -1
  38. package/Card/Card.js +22 -21
  39. package/Card/Card.js.map +1 -1
  40. package/Checkbox/Checkbox.d.ts.map +1 -1
  41. package/Checkbox/Checkbox.js +35 -33
  42. package/Checkbox/Checkbox.js.map +1 -1
  43. package/Checkbox/Checkbox.stories.js +108 -0
  44. package/Checkbox/Checkbox.stories.js.map +1 -0
  45. package/Checkbox/Checkbox.types.d.ts +2 -1
  46. package/Checkbox/Checkbox.types.d.ts.map +1 -1
  47. package/Combobox/Combobox.d.ts +4 -2
  48. package/Combobox/Combobox.d.ts.map +1 -1
  49. package/Combobox/Combobox.js +222 -192
  50. package/Combobox/Combobox.js.map +1 -1
  51. package/Combobox/Combobox.stories.js +231 -85
  52. package/Combobox/Combobox.stories.js.map +1 -1
  53. package/Combobox/Combobox.types.d.ts +88 -24
  54. package/Combobox/Combobox.types.d.ts.map +1 -1
  55. package/Combobox/Combobox.types.js +4 -1
  56. package/Combobox/Combobox.types.js.map +1 -1
  57. package/Combobox/ComboboxOptionItem.d.ts +5 -3
  58. package/Combobox/ComboboxOptionItem.d.ts.map +1 -1
  59. package/Combobox/ComboboxOptionItem.js +80 -23
  60. package/Combobox/ComboboxOptionItem.js.map +1 -1
  61. package/Combobox/ComboboxRenderContent.d.ts +28 -0
  62. package/Combobox/ComboboxRenderContent.d.ts.map +1 -0
  63. package/Combobox/ComboboxRenderContent.js +142 -0
  64. package/Combobox/ComboboxRenderContent.js.map +1 -0
  65. package/Combobox/ComboboxRenderOptions.d.ts +4 -0
  66. package/Combobox/ComboboxRenderOptions.d.ts.map +1 -0
  67. package/Combobox/ComboboxRenderOptions.js +53 -0
  68. package/Combobox/ComboboxRenderOptions.js.map +1 -0
  69. package/Combobox/ComboboxRenderTrigger.d.ts +18 -0
  70. package/Combobox/ComboboxRenderTrigger.d.ts.map +1 -0
  71. package/Combobox/ComboboxRenderTrigger.js +118 -0
  72. package/Combobox/ComboboxRenderTrigger.js.map +1 -0
  73. package/Command/Command.d.ts +6 -1
  74. package/Command/Command.d.ts.map +1 -1
  75. package/Command/Command.js +66 -48
  76. package/Command/Command.js.map +1 -1
  77. package/ContextPopover/ContextDropdownMenu.d.ts +12 -0
  78. package/ContextPopover/ContextDropdownMenu.d.ts.map +1 -0
  79. package/ContextPopover/ContextDropdownMenu.js +41 -0
  80. package/ContextPopover/ContextDropdownMenu.js.map +1 -0
  81. package/ContextPopover/ContextPopover.d.ts +12 -0
  82. package/ContextPopover/ContextPopover.d.ts.map +1 -0
  83. package/ContextPopover/ContextPopover.js +34 -0
  84. package/ContextPopover/ContextPopover.js.map +1 -0
  85. package/ContextPopover/index.d.ts +4 -0
  86. package/ContextPopover/index.d.ts.map +1 -0
  87. package/ContextPopover/index.js +9 -0
  88. package/ContextPopover/index.js.map +1 -0
  89. package/ContextPopover/useContextPopoverHandler.d.ts +14 -0
  90. package/ContextPopover/useContextPopoverHandler.d.ts.map +1 -0
  91. package/ContextPopover/useContextPopoverHandler.js +21 -0
  92. package/ContextPopover/useContextPopoverHandler.js.map +1 -0
  93. package/DataTable/DataTable.js +6 -6
  94. package/DataTable/useDataTable.d.ts +1 -1
  95. package/Dialog/Dialog.d.ts +4 -1
  96. package/Dialog/Dialog.d.ts.map +1 -1
  97. package/Dialog/Dialog.js +82 -40
  98. package/Dialog/Dialog.js.map +1 -1
  99. package/Dialog/Dialog.stories.js +108 -0
  100. package/Dialog/Dialog.stories.js.map +1 -0
  101. package/Dialog/Dialog.types.d.ts +4 -0
  102. package/Dialog/Dialog.types.d.ts.map +1 -0
  103. package/Dialog/Dialog.types.js +2 -0
  104. package/Dialog/Dialog.types.js.map +1 -0
  105. package/Dialog/index.d.ts +1 -0
  106. package/Dialog/index.d.ts.map +1 -1
  107. package/Dialog/useDialogClosePosition.d.ts +11 -0
  108. package/Dialog/useDialogClosePosition.d.ts.map +1 -0
  109. package/Dialog/useDialogClosePosition.js +50 -0
  110. package/Dialog/useDialogClosePosition.js.map +1 -0
  111. package/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  112. package/DropdownMenu/DropdownMenu.js +33 -20
  113. package/DropdownMenu/DropdownMenu.js.map +1 -1
  114. package/Dropzone/Dropzone.d.ts.map +1 -1
  115. package/Dropzone/Dropzone.js +340 -141
  116. package/Dropzone/Dropzone.js.map +1 -1
  117. package/Dropzone/Dropzone.stories.js +308 -0
  118. package/Dropzone/Dropzone.stories.js.map +1 -0
  119. package/Dropzone/Dropzone.types.d.ts +17 -1
  120. package/Dropzone/Dropzone.types.d.ts.map +1 -1
  121. package/Dropzone/Dropzone.types.js +19 -8
  122. package/Dropzone/Dropzone.types.js.map +1 -1
  123. package/Dropzone/DropzoneFilePreview.d.ts.map +1 -1
  124. package/Dropzone/DropzoneFilePreview.js +46 -26
  125. package/Dropzone/DropzoneFilePreview.js.map +1 -1
  126. package/Dropzone/DropzoneSinglePickPreview.d.ts +5 -2
  127. package/Dropzone/DropzoneSinglePickPreview.d.ts.map +1 -1
  128. package/Dropzone/DropzoneSinglePickPreview.js +119 -22
  129. package/Dropzone/DropzoneSinglePickPreview.js.map +1 -1
  130. package/Dropzone/index.js +7 -5
  131. package/Form/FormRenderControl.d.ts +1 -1
  132. package/Form/FormRenderControl.d.ts.map +1 -1
  133. package/Form/FormRenderControl.js +51 -24
  134. package/Form/FormRenderControl.js.map +1 -1
  135. package/Form/FormRenderControl.types.d.ts +4 -1
  136. package/Form/FormRenderControl.types.d.ts.map +1 -1
  137. package/FormCombobox/FormCombobox.d.ts +4 -2
  138. package/FormCombobox/FormCombobox.d.ts.map +1 -1
  139. package/FormCombobox/FormCombobox.js +30 -17
  140. package/FormCombobox/FormCombobox.js.map +1 -1
  141. package/FormCombobox/FormCombobox.types.d.ts +6 -2
  142. package/FormCombobox/FormCombobox.types.d.ts.map +1 -1
  143. package/FormDatePicker/FormDatePicker.d.ts.map +1 -1
  144. package/FormDatePicker/FormDatePicker.js +18 -16
  145. package/FormDatePicker/FormDatePicker.js.map +1 -1
  146. package/FormDropzone/FormDropzone.d.ts.map +1 -1
  147. package/FormDropzone/FormDropzone.js +11 -9
  148. package/FormDropzone/FormDropzone.js.map +1 -1
  149. package/FormInput/FormInput.d.ts.map +1 -1
  150. package/FormInput/FormInput.js +47 -28
  151. package/FormInput/FormInput.js.map +1 -1
  152. package/FormInput/FormInput.stories.js +61 -0
  153. package/FormInput/FormInput.stories.js.map +1 -0
  154. package/FormInput/FormInput.types.d.ts +1 -0
  155. package/FormInput/FormInput.types.d.ts.map +1 -1
  156. package/FormSelect/FormSelect.d.ts.map +1 -1
  157. package/FormSelect/FormSelect.js +33 -29
  158. package/FormSelect/FormSelect.js.map +1 -1
  159. package/FormTextarea/FormTextarea.d.ts.map +1 -1
  160. package/FormTextarea/FormTextarea.js +15 -12
  161. package/FormTextarea/FormTextarea.js.map +1 -1
  162. package/InfoBlock/InfoBlock.d.ts +7 -0
  163. package/InfoBlock/InfoBlock.d.ts.map +1 -0
  164. package/InfoBlock/InfoBlock.js +28 -0
  165. package/InfoBlock/InfoBlock.js.map +1 -0
  166. package/InfoBlock/InfoBlock.stories.js +50 -0
  167. package/InfoBlock/InfoBlock.stories.js.map +1 -0
  168. package/InfoBlock/InfoBlock.types.d.ts +9 -0
  169. package/InfoBlock/InfoBlock.types.d.ts.map +1 -0
  170. package/InfoBlock/InfoBlock.types.js +2 -0
  171. package/InfoBlock/InfoBlock.types.js.map +1 -0
  172. package/InfoBlock/index.d.ts +3 -0
  173. package/InfoBlock/index.d.ts.map +1 -0
  174. package/InfoBlock/index.js +5 -0
  175. package/InfoBlock/index.js.map +1 -0
  176. package/InfoBlock/infoBlockVariants.d.ts +6 -0
  177. package/InfoBlock/infoBlockVariants.d.ts.map +1 -0
  178. package/InfoBlock/infoBlockVariants.js +27 -0
  179. package/InfoBlock/infoBlockVariants.js.map +1 -0
  180. package/Input/Input.d.ts.map +1 -1
  181. package/Input/Input.js +104 -53
  182. package/Input/Input.js.map +1 -1
  183. package/Input/Input.stories.js +225 -0
  184. package/Input/Input.stories.js.map +1 -0
  185. package/Input/Input.types.d.ts +5 -0
  186. package/Input/Input.types.d.ts.map +1 -1
  187. package/LoadingMask/LoadingMask.d.ts +1 -2
  188. package/LoadingMask/LoadingMask.d.ts.map +1 -1
  189. package/LoadingMask/LoadingMask.js +8 -8
  190. package/LoadingMask/LoadingMask.js.map +1 -1
  191. package/LoadingMask/LoadingMask.types.d.ts +1 -0
  192. package/LoadingMask/LoadingMask.types.d.ts.map +1 -1
  193. package/Popover/Popover.d.ts +3 -1
  194. package/Popover/Popover.d.ts.map +1 -1
  195. package/Popover/Popover.js +15 -10
  196. package/Popover/Popover.js.map +1 -1
  197. package/ScrollArea/ScrollArea.d.ts +5 -1
  198. package/ScrollArea/ScrollArea.d.ts.map +1 -1
  199. package/ScrollArea/ScrollArea.js +23 -17
  200. package/ScrollArea/ScrollArea.js.map +1 -1
  201. package/Search/Search.d.ts.map +1 -1
  202. package/Search/Search.js +40 -31
  203. package/Search/Search.js.map +1 -1
  204. package/Select/Select.d.ts.map +1 -1
  205. package/Select/Select.js +53 -48
  206. package/Select/Select.js.map +1 -1
  207. package/Select/Select.types.d.ts +4 -0
  208. package/Select/Select.types.d.ts.map +1 -1
  209. package/Select/SelectRoot.d.ts.map +1 -1
  210. package/Select/SelectRoot.js +81 -68
  211. package/Select/SelectRoot.js.map +1 -1
  212. package/Switch/Switch.d.ts +1 -1
  213. package/Switch/Switch.d.ts.map +1 -1
  214. package/Switch/Switch.js +19 -9
  215. package/Switch/Switch.js.map +1 -1
  216. package/Switch/Switch.stories.js +62 -0
  217. package/Switch/Switch.stories.js.map +1 -0
  218. package/Textarea/Textarea.d.ts.map +1 -1
  219. package/Textarea/Textarea.js +50 -45
  220. package/Textarea/Textarea.js.map +1 -1
  221. package/Textarea/Textarea.types.d.ts +3 -1
  222. package/Textarea/Textarea.types.d.ts.map +1 -1
  223. package/Toast/Toast.d.ts +1 -1
  224. package/Toast/toastVariants.d.ts +1 -1
  225. package/Tooltip/QuestionMarkIcon.svg.js +6 -0
  226. package/Tooltip/QuestionMarkIcon.svg.js.map +1 -0
  227. package/Tooltip/Tooltip.d.ts.map +1 -1
  228. package/Tooltip/Tooltip.js +52 -32
  229. package/Tooltip/Tooltip.js.map +1 -1
  230. package/Tooltip/Tooltip.types.d.ts +10 -0
  231. package/Tooltip/Tooltip.types.d.ts.map +1 -1
  232. package/Tooltip/tooltipVariants.d.ts +4 -0
  233. package/Tooltip/tooltipVariants.d.ts.map +1 -0
  234. package/Tooltip/tooltipVariants.js +23 -0
  235. package/Tooltip/tooltipVariants.js.map +1 -0
  236. package/index.d.ts +2 -0
  237. package/index.d.ts.map +1 -1
  238. package/index.js +352 -340
  239. package/index.js.map +1 -1
  240. package/package.json +10 -6
  241. package/styles.css +1 -0
  242. package/vite-env.d.js +2 -0
  243. package/vite-env.d.js.map +1 -0
  244. package/vite-env.d.ts +7 -0
  245. package/Combobox/ComboboxOptions.d.ts +0 -4
  246. package/Combobox/ComboboxOptions.d.ts.map +0 -1
  247. package/Combobox/ComboboxOptions.js +0 -64
  248. package/Combobox/ComboboxOptions.js.map +0 -1
  249. package/Form/FormTooltipButton.d.ts +0 -6
  250. package/Form/FormTooltipButton.d.ts.map +0 -1
  251. package/Form/FormTooltipButton.js +0 -33
  252. package/Form/FormTooltipButton.js.map +0 -1
@@ -1,156 +1,355 @@
1
- import { jsxs as t, jsx as l, Fragment as j } from "react/jsx-runtime";
2
- import { X as H } from "lucide-react";
3
- import { forwardRef as O, useState as g, useImperativeHandle as X } from "react";
4
- import { useDropzone as Y } from "react-dropzone";
5
- import { cn as n } from "@oneplatformdev/utils";
6
- import { Card as q } from "../Card/Card.js";
7
- import { DEFAULT_FILE_TYPES as G } from "./Dropzone.types.js";
8
- import { FilePreview as J } from "./DropzoneFilePreview.js";
9
- import { DropzoneSinglePickPreview as K } from "./DropzoneSinglePickPreview.js";
10
- import { DefaultFileIcon as Q, isFile as v, extractName as R } from "./DropzoneUtils.js";
11
- const Z = O(
1
+ import { jsxs as l, jsx as e, Fragment as Y } from "react/jsx-runtime";
2
+ import { X as B, UploadIcon as ge, FileTextIcon as G, InfoIcon as we } from "lucide-react";
3
+ import { forwardRef as Ne, useState as J, useEffect as ve, useImperativeHandle as Fe } from "react";
4
+ import { useDropzone as be } from "react-dropzone";
5
+ import { cn as m } from "@oneplatformdev/utils";
6
+ import { Card as ye } from "../Card/Card.js";
7
+ import { DEFAULT_FILE_TYPES as Ce } from "./Dropzone.types.js";
8
+ import { FilePreview as ze } from "./DropzoneFilePreview.js";
9
+ import { DropzoneSinglePickPreview as Ee } from "./DropzoneSinglePickPreview.js";
10
+ import { isFile as v, extractName as De } from "./DropzoneUtils.js";
11
+ import { Button as Ie } from "../Button/Button.js";
12
+ const K = (f = 0) => `${(f / (1024 * 1024)).toFixed(0)} MB`, Me = (f, u) => {
13
+ if (f === u) return !0;
14
+ if (f.length !== u.length) return !1;
15
+ for (let p = 0; p < f.length; p++) {
16
+ const o = f[p], c = u[p];
17
+ if (o !== c) {
18
+ if (typeof o == "string" && typeof c == "string") {
19
+ if (o !== c) return !1;
20
+ continue;
21
+ }
22
+ if (v(o) && v(c)) {
23
+ if (o.name !== c.name || o.size !== c.size || o.type !== c.type || o.lastModified !== c.lastModified)
24
+ return !1;
25
+ continue;
26
+ }
27
+ return !1;
28
+ }
29
+ }
30
+ return !0;
31
+ }, ke = Ne(
12
32
  ({
13
- acceptTypes: w = G,
14
- maxSizeMB: N,
15
- maxFiles: x = 1,
16
- onErrors: E,
17
- hideErrors: y = !1,
33
+ acceptTypes: f = Ce,
34
+ maxSizeMB: u,
35
+ maxFiles: p = 1,
36
+ onErrors: o,
37
+ hideErrors: c = !1,
18
38
  disabled: a = !1,
19
- classNames: m,
20
- value: F = [],
21
- onChangeValue: h,
22
- className: z,
23
- labelDropzonePrompt: D = "Drop files here or click to select",
24
- labelDropzoneSubPrompt: I = "",
25
- labelOrClickToSelect: $ = "Click to select files",
26
- labelSelectedFiles: b = "Selected Files",
27
- labelUploadErrors: S = "Upload Errors",
28
- labelFileTooLarge: C = "File is too large",
29
- labelInvalidFileType: W = "Invalid file type",
30
- singlePick: i = !1,
31
- labelDropzoneClassname: k,
32
- labelDropzoneSubClassname: B,
33
- ...T
34
- }, _) => {
35
- const [s, d] = g(F), [p, A] = g([]), L = (e, o) => {
36
- A(o), E?.(o);
37
- const r = i ? e.slice(0, 1) : [...s, ...e].slice(0, x);
38
- d(r), h?.(r);
39
- }, u = (e, o) => {
39
+ classNames: F,
40
+ value: g,
41
+ onChangeValue: S,
42
+ className: Q,
43
+ labelDropzonePrompt: C = "Drop files here or click to select",
44
+ labelDropzoneSubPrompt: Z = "",
45
+ labelOrClickToSelect: U = "Upload file",
46
+ labelSelectedFiles: V = "Selected Files",
47
+ labelUploadErrors: ee = "Upload Errors",
48
+ labelFileTooLarge: j = "File is too large",
49
+ labelInvalidFileType: A = "Invalid file type",
50
+ labelVideoUploaded: te = "Uploaded",
51
+ labelVideoReplace: le = "Replace",
52
+ singlePick: n = !1,
53
+ labelDropzoneClassname: ie,
54
+ labelDropzoneSubClassname: re,
55
+ isUploading: d = !1,
56
+ uploadProgress: R = 0,
57
+ uploadLoadedBytes: ne = 0,
58
+ uploadTotalBytes: se = 0,
59
+ onCancelUpload: W,
60
+ labelUploadingTitle: oe = "Uploading video...",
61
+ labelUploadingHint: ce = "Please do not close this page",
62
+ labelUploadingActionCancel: ae = "Cancel",
63
+ persistentDropzone: $ = !1,
64
+ previewVariant: w = "default",
65
+ ...z
66
+ }, de) => {
67
+ const [i, b] = J(g ?? []), [x, _] = J([]), y = i[0], T = x[0]?.file, E = n && i.length > 0 && v(y), me = E && y.type.includes("image"), q = E && y.type.includes("video"), H = E && !me && !q, L = n && !i.length && !!T, h = H ? y : T, D = n && q, fe = D, I = n && i.length > 0, pe = (t, s) => {
68
+ _(s), o?.(s);
69
+ const r = n ? t.slice(0, 1) : [...i, ...t].slice(0, p);
70
+ b(r), S?.(r);
71
+ };
72
+ ve(() => {
73
+ g && !Me(i, g) && b(g);
74
+ }, [i, g]);
75
+ const M = (t, s) => {
40
76
  if (a) return;
41
- e.stopPropagation();
42
- const r = s.filter((c, f) => f !== o);
43
- d(r), h?.(r);
44
- }, { getRootProps: M, getInputProps: P, isDragActive: U } = Y({
45
- onDrop: L,
46
- accept: w.reduce((e, o) => (e[o] = [], e), {}),
47
- maxSize: N * 1024 * 1024,
48
- maxFiles: i ? 1 : x,
49
- disabled: a
77
+ t.stopPropagation();
78
+ const r = i.filter((N, k) => k !== s);
79
+ b(r), S?.(r);
80
+ }, { getRootProps: xe, getInputProps: he, isDragActive: ue, open: O } = be({
81
+ onDrop: pe,
82
+ accept: f.reduce((t, s) => (t[s] = [], t), {}),
83
+ maxSize: u * 1024 * 1024,
84
+ maxFiles: n ? 1 : p,
85
+ disabled: a || d,
86
+ noClick: !0
50
87
  });
51
- return X(_, () => ({
52
- setItems: d
53
- }), []), /* @__PURE__ */ t(
54
- q,
55
- {
56
- ...M(),
57
- ...T,
58
- className: n(
59
- "border-dashed p-2 text-center flex flex-col items-center justify-center cursor-pointer",
60
- a && "border-[#E4E4E7] pointer-events-none",
61
- p.length > 0 ? "border-red-500" : "border-[#E4E4E7]!",
62
- U && "bg-gray-100",
63
- i && "shadow-none!",
64
- i && s.length > 0 && "p-0! shadow-none!",
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
- }
88
+ Fe(de, () => ({
89
+ setItems: b
90
+ }), []);
91
+ const P = !d && !n && $ && i.length > 0, X = !d && !n && i.length > 0 && /* @__PURE__ */ l("div", { className: m("w-full mt-2", F?.previewWrapper), children: [
92
+ w === "default" && /* @__PURE__ */ l("pre", { className: "font-semibold text-gray-600", children: [
93
+ V,
94
+ ":"
95
+ ] }),
96
+ /* @__PURE__ */ e(
97
+ "ul",
98
+ {
99
+ className: m(
100
+ "mt-2 text-sm text-gray-500 flex flex-wrap items-start",
101
+ w === "image-grid" ? "gap-2 justify-start" : "gap-4 justify-center"
84
102
  ),
85
- p.length > 0 && /* @__PURE__ */ t("div", { className: n("w-full mt-4", m?.errorWrapper), children: [
86
- /* @__PURE__ */ t("span", { className: "font-semibold text-red-500", children: [
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
103
+ children: i.map((t, s) => {
104
+ const r = v(t) ? t.name : De(t), N = v(t) ? (t.size / (1024 * 1024)).toFixed(2) + " MB" : "";
105
+ return /* @__PURE__ */ l(
106
+ "li",
107
+ {
108
+ className: m(
109
+ "relative",
110
+ w === "image-grid" ? "w-[75px] h-[75px]" : "flex flex-col items-center gap-2"
111
+ ),
112
+ children: [
113
+ /* @__PURE__ */ l("div", { className: "relative w-full h-full", children: [
114
+ /* @__PURE__ */ e(ze, { item: t, styles: F }),
115
+ /* @__PURE__ */ e(
116
+ "div",
117
+ {
118
+ className: m(
119
+ "absolute top-0 right-0 cursor-pointer bg-gray-300 rounded-sm",
120
+ w === "image-grid" && "top-1 right-1 bg-white/90 rounded-full p-0.5"
121
+ ),
122
+ onClick: (k) => M(k, s),
123
+ children: /* @__PURE__ */ e(B, { size: 16, strokeWidth: 1, color: "black" })
124
+ }
125
+ )
126
+ ] }),
127
+ w === "default" && /* @__PURE__ */ l("span", { className: "inline-flex flex-col items-center", children: [
128
+ /* @__PURE__ */ e("span", { className: "max-w-[80px] text-ellipsis overflow-hidden whitespace-nowrap", children: r }),
129
+ N && /* @__PURE__ */ l("span", { children: [
130
+ "(",
131
+ N,
132
+ ")"
133
+ ] })
134
+ ] })
135
+ ]
136
+ },
137
+ s
138
+ );
139
+ })
140
+ }
141
+ )
142
+ ] });
143
+ return /* @__PURE__ */ l("div", { className: "w-full", children: [
144
+ /* @__PURE__ */ l(
145
+ ye,
146
+ {
147
+ ...z,
148
+ ...xe({
149
+ onClick: (t) => {
150
+ if (!(a || d)) {
151
+ if (fe) {
152
+ z.onClick?.(t);
153
+ return;
154
+ }
155
+ O(), z.onClick?.(t);
156
+ }
108
157
  }
158
+ }),
159
+ className: m(
160
+ "w-full text-center flex flex-col items-center justify-center gap-6 cursor-pointer",
161
+ !I && "border border-dashed border-[#9368FF80] rounded-[8px] bg-[#FCFCFC] p-4",
162
+ I && "min-h-0 border-0 bg-transparent p-0",
163
+ a && "border-[#E4E4E7] pointer-events-none",
164
+ x.length > 0 && !I && "border-red-500",
165
+ ue && "bg-gray-100",
166
+ n && "shadow-none!",
167
+ n && i.length > 0 && !D && "p-0! shadow-none!",
168
+ D && "h-auto! max-h-none! min-h-0! p-2!",
169
+ Q
109
170
  ),
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
- ":"
171
+ children: [
172
+ /* @__PURE__ */ e("input", { ...he() }),
173
+ d && /* @__PURE__ */ l(
174
+ "div",
175
+ {
176
+ 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",
177
+ onClick: (t) => t.stopPropagation(),
178
+ children: [
179
+ /* @__PURE__ */ l("div", { className: "relative h-24 w-24", children: [
180
+ /* @__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" }) }),
181
+ /* @__PURE__ */ l("span", { className: "absolute inset-0 flex items-center justify-center text-lg font-semibold text-foreground", children: [
182
+ Math.max(0, Math.min(100, Math.round(R))),
183
+ "%"
184
+ ] })
185
+ ] }),
186
+ /* @__PURE__ */ l("div", { className: "text-center", children: [
187
+ /* @__PURE__ */ e("p", { className: "text-xl font-semibold text-foreground", children: oe }),
188
+ /* @__PURE__ */ l("p", { className: "text-sm text-[#666A78]", children: [
189
+ K(ne),
190
+ " of ",
191
+ K(se)
192
+ ] }),
193
+ /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-[#666A78]", children: ce })
194
+ ] }),
195
+ /* @__PURE__ */ e("div", { className: "w-full max-w-[520px] h-2 rounded-full bg-[#E6E1F5] overflow-hidden", children: /* @__PURE__ */ e(
196
+ "div",
197
+ {
198
+ className: "h-full bg-[#9368FF] transition-[width] duration-150 ease-linear",
199
+ style: { width: `${Math.max(0, Math.min(100, R))}%` }
200
+ }
201
+ ) }),
202
+ W && /* @__PURE__ */ e(
203
+ "button",
204
+ {
205
+ type: "button",
206
+ 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",
207
+ onClick: (t) => {
208
+ t.stopPropagation(), W();
209
+ },
210
+ children: ae
211
+ }
212
+ )
213
+ ]
214
+ }
215
+ ),
216
+ !d && (i.length === 0 || !n && $) && x.length === 0 && /* @__PURE__ */ l(
217
+ "div",
218
+ {
219
+ className: m(
220
+ "flex flex-col items-center gap-2 w-full",
221
+ F?.idleWrapper
222
+ ),
223
+ children: [
224
+ /* @__PURE__ */ e("div", { className: "flex size-12 items-center justify-center rounded-full bg-[#9368FF1F]", children: /* @__PURE__ */ e(ge, { className: "size-6 text-[#9368FF]" }) }),
225
+ /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-1 w-full", children: !a && /* @__PURE__ */ l(Y, { children: [
226
+ /* @__PURE__ */ e(
227
+ "span",
228
+ {
229
+ className: m(
230
+ "font-semibold text-[14px] leading-[125%] text-[#06080D] text-center w-full whitespace-pre-line",
231
+ ie
232
+ ),
233
+ children: C
234
+ }
235
+ ),
236
+ /* @__PURE__ */ e(
237
+ "span",
238
+ {
239
+ className: m(
240
+ "font-medium text-[12px] leading-[120%] text-[#666A78] text-center w-full whitespace-pre-line",
241
+ re
242
+ ),
243
+ children: Z
244
+ }
245
+ )
246
+ ] }) }),
247
+ !a && /* @__PURE__ */ e(
248
+ Ie,
249
+ {
250
+ type: "button",
251
+ size: "md",
252
+ children: U
253
+ }
254
+ )
255
+ ]
256
+ }
257
+ ),
258
+ !d && x.length > 0 && !L && /* @__PURE__ */ l("div", { className: m("w-full mt-4", F?.errorWrapper), children: [
259
+ /* @__PURE__ */ l("span", { className: "font-semibold text-red-500", children: [
260
+ ee,
261
+ ":"
262
+ ] }),
263
+ /* @__PURE__ */ e("ul", { className: "mt-2 text-sm text-red-500 list-disc list-inside", children: x.map((t, s) => /* @__PURE__ */ l("li", { children: [
264
+ t.file.name,
265
+ " (",
266
+ (t.file.size / (1024 * 1024)).toFixed(2),
267
+ " MB)",
268
+ !c && /* @__PURE__ */ e("ul", { className: "ml-4 list-disc list-inside", children: t.errors.map((r, N) => /* @__PURE__ */ l("li", { children: [
269
+ r.code === "file-too-large" && j,
270
+ r.code === "file-invalid-type" && A,
271
+ r.code !== "file-too-large" && r.code !== "file-invalid-type" && r.message
272
+ ] }, N)) })
273
+ ] }, s)) })
114
274
  ] }),
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(
118
- "li",
119
- {
120
- className: "flex flex-col items-center gap-2 relative",
121
- children: [
122
- /* @__PURE__ */ t("div", { className: "relative", children: [
123
- /* @__PURE__ */ l(J, { item: e, styles: m }),
124
- /* @__PURE__ */ l(
125
- "div",
126
- {
127
- className: "absolute top-0 right-0 cursor-pointer bg-gray-300 rounded-sm",
128
- onClick: (f) => u(f, o),
129
- children: /* @__PURE__ */ l(H, { size: 16, strokeWidth: 1, color: "black" })
130
- }
131
- )
275
+ !d && !!(n && i.length) && /* @__PURE__ */ e(Y, { children: H ? /* @__PURE__ */ l(
276
+ "div",
277
+ {
278
+ className: "w-full max-w-[502px] flex flex-col items-center gap-4",
279
+ onClick: (t) => t.stopPropagation(),
280
+ children: [
281
+ /* @__PURE__ */ e("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: C }),
282
+ /* @__PURE__ */ l("div", { className: "w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4", children: [
283
+ /* @__PURE__ */ e("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(G, { size: 20 }) }),
284
+ /* @__PURE__ */ l("div", { className: "flex flex-col items-start text-left gap-1 min-w-0 flex-1", children: [
285
+ /* @__PURE__ */ e("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: h?.name }),
286
+ /* @__PURE__ */ e("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: h ? `${(h.size / (1024 * 1024)).toFixed(0)} MB` : "" })
132
287
  ] }),
133
- /* @__PURE__ */ t("span", { className: "inline-flex flex-col items-center", children: [
134
- /* @__PURE__ */ l("span", { className: "max-w-[80px] text-ellipsis overflow-hidden whitespace-nowrap", children: r }),
135
- c && /* @__PURE__ */ t("span", { children: [
136
- "(",
137
- c,
138
- ")"
139
- ] })
140
- ] })
141
- ]
288
+ !a && /* @__PURE__ */ e(
289
+ "div",
290
+ {
291
+ className: "size-6 flex items-center justify-center cursor-pointer",
292
+ onClick: (t) => M(t, 0),
293
+ children: /* @__PURE__ */ e(B, { size: 24, color: "#06080D" })
294
+ }
295
+ )
296
+ ] })
297
+ ]
298
+ }
299
+ ) : /* @__PURE__ */ e(
300
+ Ee,
301
+ {
302
+ item: i[0],
303
+ onRemoveClick: (t) => M(t, 0),
304
+ onReplaceClick: (t) => {
305
+ t.stopPropagation(), !a && O();
142
306
  },
143
- o
144
- );
145
- }) })
146
- ] })
147
- ]
148
- }
149
- );
307
+ labelUploaded: te,
308
+ labelReplace: le,
309
+ disabled: a
310
+ }
311
+ ) }),
312
+ !d && L && /* @__PURE__ */ l(
313
+ "div",
314
+ {
315
+ className: "w-full max-w-[502px] flex flex-col items-center gap-4",
316
+ onClick: (t) => t.stopPropagation(),
317
+ children: [
318
+ /* @__PURE__ */ e("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: C }),
319
+ /* @__PURE__ */ l("div", { className: "w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4", children: [
320
+ /* @__PURE__ */ e("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(G, { size: 20 }) }),
321
+ /* @__PURE__ */ l("div", { className: "flex flex-col items-start text-left gap-1 min-w-0 flex-1", children: [
322
+ /* @__PURE__ */ e("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: h?.name }),
323
+ /* @__PURE__ */ e("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: h ? `${(h.size / (1024 * 1024)).toFixed(0)} MB` : "" })
324
+ ] }),
325
+ !a && /* @__PURE__ */ e(
326
+ "div",
327
+ {
328
+ className: "size-6 flex items-center justify-center cursor-pointer",
329
+ onClick: (t) => {
330
+ t.stopPropagation(), _([]);
331
+ },
332
+ children: /* @__PURE__ */ e(B, { size: 24, color: "#06080D" })
333
+ }
334
+ )
335
+ ] }),
336
+ /* @__PURE__ */ l("div", { className: "w-full bg-[#DC26260F] p-4 flex items-start gap-4", children: [
337
+ /* @__PURE__ */ e(we, { size: 20, color: "#DC2626" }),
338
+ /* @__PURE__ */ e("p", { className: "text-[12px] leading-[120%] font-medium text-[#DC2626] text-left", children: x[0]?.errors?.[0]?.code === "file-too-large" ? j : x[0]?.errors?.[0]?.message || A })
339
+ ] })
340
+ ]
341
+ }
342
+ ),
343
+ !P && X
344
+ ]
345
+ }
346
+ ),
347
+ P && /* @__PURE__ */ e("div", { className: "w-full", children: X })
348
+ ] });
150
349
  }
151
350
  );
152
- Z.displayName = "Dropzone";
351
+ ke.displayName = "Dropzone";
153
352
  export {
154
- Z as Dropzone
353
+ ke as Dropzone
155
354
  };
156
355
  //# sourceMappingURL=Dropzone.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dropzone.js","sources":["../../src/Dropzone/Dropzone.tsx"],"sourcesContent":["import { X } from 'lucide-react';\r\nimport { forwardRef, useImperativeHandle, useState } from 'react';\r\nimport { FileRejection, useDropzone } from 'react-dropzone';\r\n\r\nimport { cn } from '@oneplatformdev/utils';\r\n\r\nimport { Card } from '../Card/Card';\r\n\r\nimport {\r\n DEFAULT_FILE_TYPES,\r\n DropzoneControl,\r\n DropzoneProps,\r\n DropzoneValueItem\r\n} from './Dropzone.types';\r\nimport { FilePreview } from './DropzoneFilePreview';\r\nimport { DropzoneSinglePickPreview } from './DropzoneSinglePickPreview';\r\nimport { DefaultFileIcon, extractName, isFile } from './DropzoneUtils';\r\n\r\n/**\r\n * Dropzone component - A drag-and-drop file upload area with image previews, error handling, and localization.\r\n *\r\n * @component\r\n * @param {DropzoneProps} props - The props for the Dropzone component.\r\n * @param {string[]} [props.acceptTypes=DEFAULT_FILE_TYPES] - Allowed file MIME types.\r\n * @param {number} props.maxSizeMB - Maximum allowed file size in megabytes.\r\n * @param {number} [props.maxFiles=1] - Maximum number of files that can be uploaded.\r\n * @param {DropzoneTranslations} props.translations - Translations for text labels.\r\n * @param {(errors: FileRejection[]) => void} [props.onErrors] - Callback triggered when file errors occur.\r\n * @param {boolean} [props.hideErrors=false] - Whether to hide error messages.\r\n * @param {boolean} [props.disabled=false] - Whether the dropzone is disabled.\r\n * @param {DropzoneStyles} [props.classNames] - Custom classNames for different dropzone states.\r\n * @param {DropzoneValueItem[]} [props.value=[]] - Current selected files or URLs.\r\n * @param {(items: DropzoneValueItem[]) => void} [props.onChangeValue] - Callback triggered when file selection changes.\r\n * @param {string} [props.className] - Additional class names for styling.\r\n * @param {React.Ref<HTMLDivElement>} ref - Ref for the root dropzone container.\r\n * @returns {JSX.Element} The rendered Dropzone component.\r\n */\r\nexport const Dropzone = forwardRef<DropzoneControl, DropzoneProps>(\r\n (\r\n {\r\n acceptTypes = DEFAULT_FILE_TYPES,\r\n maxSizeMB,\r\n maxFiles = 1,\r\n onErrors,\r\n hideErrors = false,\r\n disabled = false,\r\n classNames,\r\n value = [],\r\n onChangeValue,\r\n className,\r\n labelDropzonePrompt = 'Drop files here or click to select',\r\n labelDropzoneSubPrompt = '',\r\n labelOrClickToSelect = 'Click to select files',\r\n labelSelectedFiles = 'Selected Files',\r\n labelUploadErrors = 'Upload Errors',\r\n labelFileTooLarge = 'File is too large',\r\n labelInvalidFileType = 'Invalid file type',\r\n singlePick = false,\r\n labelDropzoneClassname,\r\n labelDropzoneSubClassname,\r\n ...restProps\r\n },\r\n ref\r\n ) => {\r\n const [items, setItems] = useState<DropzoneValueItem[]>(value);\r\n const [fileErrors, setFileErrors] = useState<FileRejection[]>([]);\r\n\r\n const onDrop = (acceptedFiles: File[], fileRejections: FileRejection[]) => {\r\n setFileErrors(fileRejections);\r\n onErrors?.(fileRejections);\r\n\r\n const newItems = singlePick\r\n ? acceptedFiles.slice(0, 1)\r\n : [...items, ...acceptedFiles].slice(0, maxFiles);\r\n\r\n setItems(newItems);\r\n onChangeValue?.(newItems);\r\n };\r\n\r\n const removeItem = (\r\n event: React.MouseEvent<HTMLDivElement>,\r\n index: number\r\n ) => {\r\n if (disabled) return;\r\n event.stopPropagation();\r\n\r\n const newItems = items.filter((_, i) => i !== index);\r\n setItems(newItems);\r\n onChangeValue?.(newItems);\r\n };\r\n\r\n const { getRootProps, getInputProps, isDragActive } = useDropzone({\r\n onDrop,\r\n accept: acceptTypes.reduce((acc, fileType) => {\r\n acc[fileType] = [];\r\n return acc;\r\n }, {} as Record<string, string[]>),\r\n maxSize: maxSizeMB * 1024 * 1024,\r\n maxFiles: singlePick ? 1 : maxFiles,\r\n disabled,\r\n });\r\n\r\n useImperativeHandle(ref, () => {\r\n return {\r\n setItems,\r\n };\r\n }, []);\r\n\r\n\r\n return (\r\n <Card\r\n {...getRootProps()}\r\n {...restProps}\r\n className={cn(\r\n `border-dashed p-2 text-center flex flex-col items-center justify-center cursor-pointer`,\r\n disabled && 'border-[#E4E4E7] pointer-events-none',\r\n fileErrors.length > 0 ? 'border-red-500' : 'border-[#E4E4E7]!',\r\n isDragActive && 'bg-gray-100',\r\n singlePick && 'shadow-none!',\r\n singlePick && items.length > 0 && 'p-0! shadow-none!',\r\n className\r\n )}\r\n >\r\n <input {...getInputProps()} />\r\n\r\n {items.length === 0 && fileErrors.length === 0 && (\r\n <div\r\n className={cn(\r\n 'flex flex-col items-center gap-1',\r\n classNames?.idleWrapper\r\n )}\r\n >\r\n <DefaultFileIcon />\r\n\r\n {!disabled && (\r\n <>\r\n <span className={cn(\"font-medium text-md text-foreground max-w-[200px]\", labelDropzoneClassname)}>\r\n {labelDropzonePrompt}\r\n </span>\r\n <span className={cn(\"font-normal text-xs text-foreground max-w-[250px]\", labelDropzoneSubClassname)}>\r\n {labelDropzoneSubPrompt}\r\n </span>\r\n </>\r\n )}\r\n </div>\r\n )}\r\n\r\n {fileErrors.length > 0 && (\r\n <div className={cn('w-full mt-4', classNames?.errorWrapper)}>\r\n <span className=\"font-semibold text-red-500\">\r\n {labelUploadErrors}:\r\n </span>\r\n <ul className=\"mt-2 text-sm text-red-500 list-disc list-inside\">\r\n {fileErrors.map((fileRejection, index) => (\r\n <li key={index}>\r\n {fileRejection.file.name} (\r\n {(fileRejection.file.size / (1024 * 1024)).toFixed(2)} MB)\r\n {!hideErrors && (\r\n <ul className=\"ml-4 list-disc list-inside\">\r\n {fileRejection.errors.map((error, errorIndex) => (\r\n <li key={errorIndex}>\r\n {error.code === 'file-too-large' && labelFileTooLarge}\r\n {error.code === 'file-invalid-type' &&\r\n labelInvalidFileType}\r\n {error.code !== 'file-too-large' &&\r\n error.code !== 'file-invalid-type' &&\r\n error.message}\r\n </li>\r\n ))}\r\n </ul>\r\n )}\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n )}\r\n\r\n {Boolean(singlePick && items.length) && (\r\n <DropzoneSinglePickPreview\r\n item={items[0]}\r\n onRemoveClick={(e) => removeItem(e, 0)}\r\n disabled={disabled}\r\n />\r\n )}\r\n\r\n {!singlePick && items.length > 0 && (\r\n <div className={cn('w-full mt-2', classNames?.previewWrapper)}>\r\n <pre className=\"font-semibold text-gray-600\">\r\n {labelSelectedFiles}:\r\n </pre>\r\n <ul className=\"mt-2 text-sm text-gray-500 flex flex-wrap gap-4 items-start justify-center\">\r\n {items.map((item, index) => {\r\n const fileName = isFile(item) ? item.name : extractName(item);\r\n const fileSize = isFile(item)\r\n ? (item.size / (1024 * 1024)).toFixed(2) + ' MB'\r\n : '';\r\n\r\n return (\r\n <li\r\n key={index}\r\n className=\"flex flex-col items-center gap-2 relative\"\r\n >\r\n <div className=\"relative\">\r\n <FilePreview item={item} styles={classNames} />\r\n <div\r\n className=\"absolute top-0 right-0 cursor-pointer bg-gray-300 rounded-sm\"\r\n onClick={(event) => removeItem(event, index)}\r\n >\r\n <X size={16} strokeWidth={1} color=\"black\" />\r\n </div>\r\n </div>\r\n <span className=\"inline-flex flex-col items-center\">\r\n <span className=\"max-w-[80px] text-ellipsis overflow-hidden whitespace-nowrap\">\r\n {fileName}\r\n </span>\r\n {fileSize && <span>({fileSize})</span>}\r\n </span>\r\n </li>\r\n );\r\n })}\r\n </ul>\r\n </div>\r\n )}\r\n </Card>\r\n );\r\n }\r\n);\r\n\r\nDropzone.displayName = 'Dropzone';\r\n"],"names":["Dropzone","forwardRef","acceptTypes","DEFAULT_FILE_TYPES","maxSizeMB","maxFiles","onErrors","hideErrors","disabled","classNames","value","onChangeValue","className","labelDropzonePrompt","labelDropzoneSubPrompt","labelOrClickToSelect","labelSelectedFiles","labelUploadErrors","labelFileTooLarge","labelInvalidFileType","singlePick","labelDropzoneClassname","labelDropzoneSubClassname","restProps","ref","items","setItems","useState","fileErrors","setFileErrors","onDrop","acceptedFiles","fileRejections","newItems","removeItem","event","index","_","i","getRootProps","getInputProps","isDragActive","useDropzone","acc","fileType","useImperativeHandle","jsxs","Card","cn","jsx","DefaultFileIcon","Fragment","fileRejection","error","errorIndex","DropzoneSinglePickPreview","item","fileName","isFile","extractName","fileSize","FilePreview","X"],"mappings":";;;;;;;;;;AAqCO,MAAMA,IAAWC;AAAA,EACtB,CACE;AAAA,IACE,aAAAC,IAAcC;AAAA,IACd,WAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,UAAAC,IAAW;AAAA,IACX,YAAAC;AAAA,IACA,OAAAC,IAAQ,CAAA;AAAA,IACR,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,qBAAAC,IAAsB;AAAA,IACtB,wBAAAC,IAAyB;AAAA,IACzB,sBAAAC,IAAuB;AAAA,IACvB,oBAAAC,IAAqB;AAAA,IACrB,mBAAAC,IAAoB;AAAA,IACpB,mBAAAC,IAAoB;AAAA,IAC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U;AAAA,0BACV,SAAS,CAACd,MAAUD,EAAWC,GAAOC,CAAK;AAAA,0BAE3C,4BAAC0B,GAAA,EAAE,MAAM,IAAI,aAAa,GAAG,OAAM,QAAA,CAAQ;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBAC7C,GACF;AAAA,oBACA,gBAAAhB,EAAC,QAAA,EAAK,WAAU,qCACd,UAAA;AAAA,sBAAA,gBAAAG,EAAC,QAAA,EAAK,WAAU,gEACb,UAAAQ,GACH;AAAA,sBACCG,uBAAa,QAAA,EAAK,UAAA;AAAA,wBAAA;AAAA,wBAAEA;AAAA,wBAAS;AAAA,sBAAA,EAAA,CAAC;AAAA,oBAAA,EAAA,CACjC;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAjBKxB;AAAA,cAAA;AAAA,YAoBX,CAAC,EAAA,CACH;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEApC,EAAS,cAAc;"}
1
+ {"version":3,"file":"Dropzone.js","sources":["../../src/Dropzone/Dropzone.tsx"],"sourcesContent":["import { FileTextIcon, InfoIcon, UploadIcon, X } from 'lucide-react';\r\nimport { forwardRef, useEffect, useImperativeHandle, useState } from 'react';\r\nimport { FileRejection, useDropzone } from 'react-dropzone';\r\n\r\nimport { cn } from '@oneplatformdev/utils';\r\n\r\nimport { Card } from '../Card/Card';\r\n\r\nimport {\r\n DEFAULT_FILE_TYPES,\r\n DropzoneControl,\r\n DropzoneProps,\r\n DropzoneValueItem\r\n} from './Dropzone.types';\r\nimport { FilePreview } from './DropzoneFilePreview';\r\nimport { DropzoneSinglePickPreview } from './DropzoneSinglePickPreview';\r\nimport { extractName, isFile } from './DropzoneUtils';\r\nimport { Button } from \"../Button\";\r\n\r\nconst formatBytesToMb = (bytes = 0) => `${(bytes / (1024 * 1024)).toFixed(0)} MB`;\r\nconst areItemsEqual = (a: DropzoneValueItem[], b: DropzoneValueItem[]) => {\r\n if (a === b) return true;\r\n if (a.length !== b.length) return false;\r\n\r\n for (let i = 0; i < a.length; i++) {\r\n const left = a[i];\r\n const right = b[i];\r\n\r\n if (left === right) continue;\r\n\r\n if (typeof left === 'string' && typeof right === 'string') {\r\n if (left !== right) return false;\r\n continue;\r\n }\r\n\r\n if (isFile(left) && isFile(right)) {\r\n if (\r\n left.name !== right.name ||\r\n left.size !== right.size ||\r\n left.type !== right.type ||\r\n left.lastModified !== right.lastModified\r\n ) {\r\n return false;\r\n }\r\n continue;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n return true;\r\n};\r\n\r\n/**\r\n * Dropzone component - A drag-and-drop file upload area with image previews, error handling, and localization.\r\n *\r\n * @component\r\n * @param {DropzoneProps} props - The props for the Dropzone component.\r\n * @param {string[]} [props.acceptTypes=DEFAULT_FILE_TYPES] - Allowed file MIME types.\r\n * @param {number} props.maxSizeMB - Maximum allowed file size in megabytes.\r\n * @param {number} [props.maxFiles=1] - Maximum number of files that can be uploaded.\r\n * @param {DropzoneTranslations} props.translations - Translations for text labels.\r\n * @param {(errors: FileRejection[]) => void} [props.onErrors] - Callback triggered when file errors occur.\r\n * @param {boolean} [props.hideErrors=false] - Whether to hide error messages.\r\n * @param {boolean} [props.disabled=false] - Whether the dropzone is disabled.\r\n * @param {DropzoneStyles} [props.classNames] - Custom classNames for different dropzone states.\r\n * @param {DropzoneValueItem[]} [props.value=[]] - Current selected files or URLs.\r\n * @param {(items: DropzoneValueItem[]) => void} [props.onChangeValue] - Callback triggered when file selection changes.\r\n * @param {string} [props.className] - Additional class names for styling.\r\n * @param {React.Ref<HTMLDivElement>} ref - Ref for the root dropzone container.\r\n * @returns {JSX.Element} The rendered Dropzone component.\r\n */\r\nexport const Dropzone = forwardRef<DropzoneControl, DropzoneProps>(\r\n (\r\n {\r\n acceptTypes = DEFAULT_FILE_TYPES,\r\n maxSizeMB,\r\n maxFiles = 1,\r\n onErrors,\r\n hideErrors = false,\r\n disabled = false,\r\n classNames,\r\n value,\r\n onChangeValue,\r\n className,\r\n labelDropzonePrompt = 'Drop files here or click to select',\r\n labelDropzoneSubPrompt = '',\r\n labelOrClickToSelect = 'Upload file',\r\n labelSelectedFiles = 'Selected Files',\r\n labelUploadErrors = 'Upload Errors',\r\n labelFileTooLarge = 'File is too large',\r\n labelInvalidFileType = 'Invalid file type',\r\n labelVideoUploaded = 'Uploaded',\r\n labelVideoReplace = 'Replace',\r\n singlePick = false,\r\n labelDropzoneClassname,\r\n labelDropzoneSubClassname,\r\n isUploading = false,\r\n uploadProgress = 0,\r\n uploadLoadedBytes = 0,\r\n uploadTotalBytes = 0,\r\n onCancelUpload,\r\n labelUploadingTitle = 'Uploading video...',\r\n labelUploadingHint = 'Please do not close this page',\r\n labelUploadingActionCancel = 'Cancel',\r\n persistentDropzone = false,\r\n previewVariant = 'default',\r\n ...restProps\r\n },\r\n ref\r\n ) => {\r\n const [items, setItems] = useState<DropzoneValueItem[]>(value ?? []);\r\n const [fileErrors, setFileErrors] = useState<FileRejection[]>([]);\r\n const firstItem = items[0];\r\n const firstRejectedFile = fileErrors[0]?.file;\r\n const isSingleFile = singlePick && items.length > 0 && isFile(firstItem);\r\n const isSingleImage = isSingleFile && firstItem.type.includes('image');\r\n const isSingleVideo =\r\n isSingleFile &&\r\n firstItem.type.includes('video');\r\n const isSingleDocument = isSingleFile && !isSingleImage && !isSingleVideo;\r\n const hasRejectedSingleFile = singlePick && !items.length && Boolean(firstRejectedFile);\r\n const singleFileCard = isSingleDocument ? firstItem : firstRejectedFile;\r\n const hasSingleVideoPreview =\r\n singlePick && isSingleVideo;\r\n const shouldBlockRootOpen = hasSingleVideoPreview;\r\n const isContentPreviewMode = singlePick && items.length > 0;\r\n\r\n const onDrop = (acceptedFiles: File[], fileRejections: FileRejection[]) => {\r\n setFileErrors(fileRejections);\r\n onErrors?.(fileRejections);\r\n\r\n const newItems = singlePick\r\n ? acceptedFiles.slice(0, 1)\r\n : [...items, ...acceptedFiles].slice(0, maxFiles);\r\n\r\n setItems(newItems);\r\n onChangeValue?.(newItems);\r\n };\r\n\r\n useEffect(() => {\r\n if (value && !areItemsEqual(items, value)) {\r\n setItems(value);\r\n }\r\n }, [items, value]);\r\n\r\n const removeItem = (\r\n event: React.MouseEvent<HTMLDivElement>,\r\n index: number\r\n ) => {\r\n if (disabled) return;\r\n event.stopPropagation();\r\n\r\n const newItems = items.filter((_, i) => i !== index);\r\n setItems(newItems);\r\n onChangeValue?.(newItems);\r\n };\r\n\r\n const { getRootProps, getInputProps, isDragActive, open } = useDropzone({\r\n onDrop,\r\n accept: acceptTypes.reduce((acc, fileType) => {\r\n acc[fileType] = [];\r\n return acc;\r\n }, {} as Record<string, string[]>),\r\n maxSize: maxSizeMB * 1024 * 1024,\r\n maxFiles: singlePick ? 1 : maxFiles,\r\n disabled: disabled || isUploading,\r\n noClick: true,\r\n });\r\n\r\n useImperativeHandle(ref, () => {\r\n return {\r\n setItems,\r\n };\r\n }, []);\r\n\r\n const shouldRenderDetachedPreview =\r\n !isUploading && !singlePick && persistentDropzone && items.length > 0;\r\n\r\n const previewBlock = !isUploading && !singlePick && items.length > 0 && (\r\n <div className={cn('w-full mt-2', classNames?.previewWrapper)}>\r\n {previewVariant === 'default' && (\r\n <pre className=\"font-semibold text-gray-600\">\r\n {labelSelectedFiles}:\r\n </pre>\r\n )}\r\n <ul\r\n className={cn(\r\n 'mt-2 text-sm text-gray-500 flex flex-wrap items-start',\r\n previewVariant === 'image-grid'\r\n ? 'gap-2 justify-start'\r\n : 'gap-4 justify-center'\r\n )}\r\n >\r\n {items.map((item, index) => {\r\n const fileName = isFile(item) ? item.name : extractName(item);\r\n const fileSize = isFile(item)\r\n ? (item.size / (1024 * 1024)).toFixed(2) + ' MB'\r\n : '';\r\n\r\n return (\r\n <li\r\n key={index}\r\n className={cn(\r\n 'relative',\r\n previewVariant === 'image-grid'\r\n ? 'w-[75px] h-[75px]'\r\n : 'flex flex-col items-center gap-2'\r\n )}\r\n >\r\n <div className=\"relative w-full h-full\">\r\n <FilePreview item={item} styles={classNames} />\r\n <div\r\n className={cn(\r\n 'absolute top-0 right-0 cursor-pointer bg-gray-300 rounded-sm',\r\n previewVariant === 'image-grid' && 'top-1 right-1 bg-white/90 rounded-full p-0.5'\r\n )}\r\n onClick={(event) => removeItem(event, index)}\r\n >\r\n <X size={16} strokeWidth={1} color=\"black\" />\r\n </div>\r\n </div>\r\n {previewVariant === 'default' && (\r\n <span className=\"inline-flex flex-col items-center\">\r\n <span className=\"max-w-[80px] text-ellipsis overflow-hidden whitespace-nowrap\">\r\n {fileName}\r\n </span>\r\n {fileSize && <span>({fileSize})</span>}\r\n </span>\r\n )}\r\n </li>\r\n );\r\n })}\r\n </ul>\r\n </div>\r\n );\r\n\r\n return (\r\n <div className=\"w-full\">\r\n <Card\r\n {...restProps}\r\n {...getRootProps({\r\n onClick: (event) => {\r\n if (disabled || isUploading) return;\r\n if (shouldBlockRootOpen) {\r\n restProps.onClick?.(event);\r\n return;\r\n }\r\n open();\r\n restProps.onClick?.(event);\r\n },\r\n })}\r\n className={cn(\r\n `w-full text-center flex flex-col items-center justify-center gap-6 cursor-pointer`,\r\n !isContentPreviewMode &&\r\n 'border border-dashed border-[#9368FF80] rounded-[8px] bg-[#FCFCFC] p-4',\r\n isContentPreviewMode && 'min-h-0 border-0 bg-transparent p-0',\r\n disabled && 'border-[#E4E4E7] pointer-events-none',\r\n fileErrors.length > 0 && !isContentPreviewMode && 'border-red-500',\r\n isDragActive && 'bg-gray-100',\r\n singlePick && 'shadow-none!',\r\n singlePick && items.length > 0 && !hasSingleVideoPreview && 'p-0! shadow-none!',\r\n hasSingleVideoPreview && 'h-auto! max-h-none! min-h-0! p-2!',\r\n className\r\n )}\r\n >\r\n <input {...getInputProps()} />\r\n\r\n {isUploading && (\r\n <div\r\n 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\"\r\n onClick={(event) => event.stopPropagation()}\r\n >\r\n <div className=\"relative h-24 w-24\">\r\n <svg className=\"h-24 w-24\" viewBox=\"0 0 100 100\">\r\n <circle cx=\"50\" cy=\"50\" r=\"42\" stroke=\"#E6E1F5\" strokeWidth=\"8\" fill=\"none\" />\r\n </svg>\r\n <span className=\"absolute inset-0 flex items-center justify-center text-lg font-semibold text-foreground\">\r\n {Math.max(0, Math.min(100, Math.round(uploadProgress)))}%\r\n </span>\r\n </div>\r\n\r\n <div className=\"text-center\">\r\n <p className=\"text-xl font-semibold text-foreground\">{labelUploadingTitle}</p>\r\n <p className=\"text-sm text-[#666A78]\">\r\n {formatBytesToMb(uploadLoadedBytes)} of {formatBytesToMb(uploadTotalBytes)}\r\n </p>\r\n <p className=\"mt-2 text-sm text-[#666A78]\">{labelUploadingHint}</p>\r\n </div>\r\n\r\n <div className=\"w-full max-w-[520px] h-2 rounded-full bg-[#E6E1F5] overflow-hidden\">\r\n <div\r\n className=\"h-full bg-[#9368FF] transition-[width] duration-150 ease-linear\"\r\n style={{ width: `${Math.max(0, Math.min(100, uploadProgress))}%` }}\r\n />\r\n </div>\r\n\r\n {onCancelUpload && (\r\n <button\r\n type=\"button\"\r\n 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\"\r\n onClick={(event) => {\r\n event.stopPropagation();\r\n onCancelUpload();\r\n }}\r\n >\r\n {labelUploadingActionCancel}\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n\r\n {!isUploading &&\r\n (items.length === 0 || (!singlePick && persistentDropzone)) &&\r\n fileErrors.length === 0 && (\r\n <div\r\n className={cn(\r\n 'flex flex-col items-center gap-2 w-full',\r\n classNames?.idleWrapper\r\n )}\r\n >\r\n <div className=\"flex size-12 items-center justify-center rounded-full bg-[#9368FF1F]\">\r\n <UploadIcon className=\"size-6 text-[#9368FF]\" />\r\n </div>\r\n\r\n <div className=\"flex flex-col items-center gap-1 w-full\">\r\n {!disabled && (\r\n <>\r\n <span\r\n className={cn(\r\n \"font-semibold text-[14px] leading-[125%] text-[#06080D] text-center w-full whitespace-pre-line\",\r\n labelDropzoneClassname\r\n )}\r\n >\r\n {labelDropzonePrompt}\r\n </span>\r\n\r\n <span\r\n className={cn(\r\n \"font-medium text-[12px] leading-[120%] text-[#666A78] text-center w-full whitespace-pre-line\",\r\n labelDropzoneSubClassname\r\n )}\r\n >\r\n {labelDropzoneSubPrompt}\r\n </span>\r\n </>\r\n )}\r\n </div>\r\n\r\n {!disabled && (\r\n <Button\r\n type=\"button\"\r\n size=\"md\"\r\n >\r\n {labelOrClickToSelect}\r\n </Button>\r\n )}\r\n </div>\r\n )}\r\n\r\n {!isUploading && fileErrors.length > 0 && !hasRejectedSingleFile && (\r\n <div className={cn('w-full mt-4', classNames?.errorWrapper)}>\r\n <span className=\"font-semibold text-red-500\">\r\n {labelUploadErrors}:\r\n </span>\r\n <ul className=\"mt-2 text-sm text-red-500 list-disc list-inside\">\r\n {fileErrors.map((fileRejection, index) => (\r\n <li key={index}>\r\n {fileRejection.file.name} (\r\n {(fileRejection.file.size / (1024 * 1024)).toFixed(2)} MB)\r\n {!hideErrors && (\r\n <ul className=\"ml-4 list-disc list-inside\">\r\n {fileRejection.errors.map((error, errorIndex) => (\r\n <li key={errorIndex}>\r\n {error.code === 'file-too-large' && labelFileTooLarge}\r\n {error.code === 'file-invalid-type' &&\r\n labelInvalidFileType}\r\n {error.code !== 'file-too-large' &&\r\n error.code !== 'file-invalid-type' &&\r\n error.message}\r\n </li>\r\n ))}\r\n </ul>\r\n )}\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n )}\r\n\r\n {!isUploading && Boolean(singlePick && items.length) && (\r\n <>\r\n {isSingleDocument ? (\r\n <div\r\n className=\"w-full max-w-[502px] flex flex-col items-center gap-4\"\r\n onClick={(event) => event.stopPropagation()}\r\n >\r\n <p className=\"w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]\">\r\n {labelDropzonePrompt}\r\n </p>\r\n\r\n <div className=\"w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4\">\r\n <div className=\"size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0\">\r\n <FileTextIcon size={20} />\r\n </div>\r\n <div className=\"flex flex-col items-start text-left gap-1 min-w-0 flex-1\">\r\n <span className=\"w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate\">\r\n {singleFileCard?.name}\r\n </span>\r\n <span className=\"w-full text-[12px] font-medium leading-[120%] text-[#666A78]\">\r\n {singleFileCard\r\n ? `${(singleFileCard.size / (1024 * 1024)).toFixed(0)} MB`\r\n : ''}\r\n </span>\r\n </div>\r\n {!disabled && (\r\n <div\r\n className=\"size-6 flex items-center justify-center cursor-pointer\"\r\n onClick={(event) => removeItem(event, 0)}\r\n >\r\n <X size={24} color=\"#06080D\" />\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n ) : (\r\n <DropzoneSinglePickPreview\r\n item={items[0]}\r\n onRemoveClick={(e) => removeItem(e, 0)}\r\n onReplaceClick={(e) => {\r\n e.stopPropagation();\r\n if (disabled) return;\r\n open();\r\n }}\r\n labelUploaded={labelVideoUploaded}\r\n labelReplace={labelVideoReplace}\r\n disabled={disabled}\r\n />\r\n )}\r\n </>\r\n )}\r\n\r\n {!isUploading && hasRejectedSingleFile && (\r\n <div\r\n className=\"w-full max-w-[502px] flex flex-col items-center gap-4\"\r\n onClick={(event) => event.stopPropagation()}\r\n >\r\n <p className=\"w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]\">\r\n {labelDropzonePrompt}\r\n </p>\r\n\r\n <div className=\"w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4\">\r\n <div className=\"size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0\">\r\n <FileTextIcon size={20} />\r\n </div>\r\n <div className=\"flex flex-col items-start text-left gap-1 min-w-0 flex-1\">\r\n <span className=\"w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate\">\r\n {singleFileCard?.name}\r\n </span>\r\n <span className=\"w-full text-[12px] font-medium leading-[120%] text-[#666A78]\">\r\n {singleFileCard\r\n ? `${(singleFileCard.size / (1024 * 1024)).toFixed(0)} MB`\r\n : ''}\r\n </span>\r\n </div>\r\n {!disabled && (\r\n <div\r\n className=\"size-6 flex items-center justify-center cursor-pointer\"\r\n onClick={(event) => {\r\n event.stopPropagation();\r\n setFileErrors([]);\r\n }}\r\n >\r\n <X size={24} color=\"#06080D\" />\r\n </div>\r\n )}\r\n </div>\r\n\r\n <div className=\"w-full bg-[#DC26260F] p-4 flex items-start gap-4\">\r\n <InfoIcon size={20} color=\"#DC2626\" />\r\n <p className=\"text-[12px] leading-[120%] font-medium text-[#DC2626] text-left\">\r\n {fileErrors[0]?.errors?.[0]?.code === 'file-too-large'\r\n ? labelFileTooLarge\r\n : fileErrors[0]?.errors?.[0]?.message || labelInvalidFileType}\r\n </p>\r\n </div>\r\n </div>\r\n )}\r\n\r\n {!shouldRenderDetachedPreview && previewBlock}\r\n </Card>\r\n {shouldRenderDetachedPreview && <div className=\"w-full\">{previewBlock}</div>}\r\n </div>\r\n );\r\n }\r\n);\r\n\r\nDropzone.displayName = 'Dropzone';\r\n\r\n"],"names":["formatBytesToMb","bytes","areItemsEqual","a","b","i","left","right","isFile","Dropzone","forwardRef","acceptTypes","DEFAULT_FILE_TYPES","maxSizeMB","maxFiles","onErrors","hideErrors","disabled","classNames","value","onChangeValue","className","labelDropzonePrompt","labelDropzoneSubPrompt","labelOrClickToSelect","labelSelectedFiles","labelUploadErrors","labelFileTooLarge","labelInvalidFileType","labelVideoUploaded","labelVideoReplace","singlePick","labelDropzoneClassname","labelDropzoneSubClassname","isUploading","uploadProgress","uploadLoadedBytes","uploadTotalBytes","onCancelUpload","labelUploadingTitle","labelUploadingHint","labelUploadingActionCancel","persistentDropzone","previewVariant","restProps","ref","items","setItems","useState","fileErrors","setFileErrors","firstItem","firstRejectedFile","isSingleFile","isSingleImage","isSingleVideo","isSingleDocument","hasRejectedSingleFile","singleFileCard","hasSingleVideoPreview","shouldBlockRootOpen","isContentPreviewMode","onDrop","acceptedFiles","fileRejections","newItems","useEffect","removeItem","event","index","_","getRootProps","getInputProps","isDragActive","open","useDropzone","acc","fileType","useImperativeHandle","shouldRenderDetachedPreview","previewBlock","jsxs","cn","jsx","item","fileName","extractName","fileSize","FilePreview","X","Card","UploadIcon","Fragment","Button","fileRejection","error","errorIndex","FileTextIcon","DropzoneSinglePickPreview","e","InfoIcon"],"mappings":";;;;;;;;;;;AAmBA,MAAMA,IAAkB,CAACC,IAAQ,MAAM,IAAIA,KAAS,OAAO,OAAO,QAAQ,CAAC,CAAC,OACtEC,KAAgB,CAACC,GAAwBC,MAA2B;AACxE,MAAID,MAAMC,EAAG,QAAO;AACpB,MAAID,EAAE,WAAWC,EAAE,OAAQ,QAAO;AAElC,WAASC,IAAI,GAAGA,IAAIF,EAAE,QAAQE,KAAK;AACjC,UAAMC,IAAOH,EAAEE,CAAC,GACVE,IAAQH,EAAEC,CAAC;AAEjB,QAAIC,MAASC,GAEb;AAAA,UAAI,OAAOD,KAAS,YAAY,OAAOC,KAAU,UAAU;AACzD,YAAID,MAASC,EAAO,QAAO;AAC3B;AAAA,MACF;AAEA,UAAIC,EAAOF,CAAI,KAAKE,EAAOD,CAAK,GAAG;AACjC,YACED,EAAK,SAASC,EAAM,QACpBD,EAAK,SAASC,EAAM,QACpBD,EAAK,SAASC,EAAM,QACpBD,EAAK,iBAAiBC,EAAM;AAE5B,iBAAO;AAET;AAAA,MACF;AAEA,aAAO;AAAA;AAAA,EACT;AAEA,SAAO;AACT,GAqBaE,KAAWC;AAAA,EACtB,CACE;AAAA,IACE,aAAAC,IAAcC;AAAA,IACd,WAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,UAAAC,IAAW;AAAA,IACX,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,W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