@drivenets/design-system 0.0.3 → 0.0.4

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 (221) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/components/ds-alert-banner/ds-alert-banner.cjs +157 -52
  3. package/dist/components/ds-alert-banner/ds-alert-banner.d.cts +5 -5
  4. package/dist/components/ds-alert-banner/ds-alert-banner.d.cts.map +1 -1
  5. package/dist/components/ds-alert-banner/ds-alert-banner.js +157 -52
  6. package/dist/components/ds-alert-banner/ds-alert-banner.js.map +1 -1
  7. package/dist/components/ds-alert-banner/ds-alert-banner.types.d.cts.map +1 -1
  8. package/dist/components/ds-alert-banner/ds-alert-banner.types.js.map +1 -1
  9. package/dist/components/ds-breadcrumb/ds-breadcrumb.cjs +59 -16
  10. package/dist/components/ds-breadcrumb/ds-breadcrumb.js +59 -16
  11. package/dist/components/ds-breadcrumb/ds-breadcrumb.js.map +1 -1
  12. package/dist/components/ds-button/ds-button.cjs +18 -2
  13. package/dist/components/ds-button/ds-button.d.cts +2 -2
  14. package/dist/components/ds-button/ds-button.d.ts +2 -2
  15. package/dist/components/ds-button/ds-button.js +18 -2
  16. package/dist/components/ds-button/ds-button.js.map +1 -1
  17. package/dist/components/ds-button/versions/ds-button-legacy/ds-button-legacy.cjs +79 -10
  18. package/dist/components/ds-button/versions/ds-button-legacy/ds-button-legacy.js +79 -10
  19. package/dist/components/ds-button/versions/ds-button-legacy/ds-button-legacy.js.map +1 -1
  20. package/dist/components/ds-button/versions/ds-button-new/ds-button-new.cjs +78 -10
  21. package/dist/components/ds-button/versions/ds-button-new/ds-button-new.js +78 -10
  22. package/dist/components/ds-button/versions/ds-button-new/ds-button-new.js.map +1 -1
  23. package/dist/components/ds-checkbox/ds-checkbox.cjs +89 -18
  24. package/dist/components/ds-checkbox/ds-checkbox.js +89 -18
  25. package/dist/components/ds-checkbox/ds-checkbox.js.map +1 -1
  26. package/dist/components/ds-chip/ds-chip.cjs +100 -30
  27. package/dist/components/ds-chip/ds-chip.js +100 -30
  28. package/dist/components/ds-chip/ds-chip.js.map +1 -1
  29. package/dist/components/ds-chip-group/ds-chip-group.cjs +6 -6
  30. package/dist/components/ds-chip-group/ds-chip-group.js +6 -6
  31. package/dist/components/ds-chip-group/ds-chip-group.js.map +1 -1
  32. package/dist/components/ds-chip-group/hooks/use-chip-row-calculation.js.map +1 -1
  33. package/dist/components/ds-confirmation/ds-confirmation.cjs +210 -56
  34. package/dist/components/ds-confirmation/ds-confirmation.d.cts +8 -8
  35. package/dist/components/ds-confirmation/ds-confirmation.d.cts.map +1 -1
  36. package/dist/components/ds-confirmation/ds-confirmation.d.ts +8 -8
  37. package/dist/components/ds-confirmation/ds-confirmation.js +210 -56
  38. package/dist/components/ds-confirmation/ds-confirmation.js.map +1 -1
  39. package/dist/components/ds-dialog/ds-dialog.js.map +1 -1
  40. package/dist/components/ds-drawer/ds-drawer.cjs +261 -61
  41. package/dist/components/ds-drawer/ds-drawer.d.cts +9 -9
  42. package/dist/components/ds-drawer/ds-drawer.d.ts +9 -9
  43. package/dist/components/ds-drawer/ds-drawer.js +261 -61
  44. package/dist/components/ds-drawer/ds-drawer.js.map +1 -1
  45. package/dist/components/ds-dropdown-menu/ds-dropdown-menu.cjs +481 -135
  46. package/dist/components/ds-dropdown-menu/ds-dropdown-menu.js +481 -135
  47. package/dist/components/ds-dropdown-menu/ds-dropdown-menu.js.map +1 -1
  48. package/dist/components/ds-expandable-text-input/ds-expandable-text-input.cjs +146 -56
  49. package/dist/components/ds-expandable-text-input/ds-expandable-text-input.d.cts +2 -2
  50. package/dist/components/ds-expandable-text-input/ds-expandable-text-input.d.ts +2 -2
  51. package/dist/components/ds-expandable-text-input/ds-expandable-text-input.js +146 -56
  52. package/dist/components/ds-expandable-text-input/ds-expandable-text-input.js.map +1 -1
  53. package/dist/components/ds-file-upload/components/file-upload/file-upload.cjs +190 -69
  54. package/dist/components/ds-file-upload/components/file-upload/file-upload.js +190 -69
  55. package/dist/components/ds-file-upload/components/file-upload/file-upload.js.map +1 -1
  56. package/dist/components/ds-file-upload/components/file-upload-item/file-upload-item.cjs +273 -132
  57. package/dist/components/ds-file-upload/components/file-upload-item/file-upload-item.js +273 -132
  58. package/dist/components/ds-file-upload/components/file-upload-item/file-upload-item.js.map +1 -1
  59. package/dist/components/ds-file-upload/ds-file-upload.cjs +96 -16
  60. package/dist/components/ds-file-upload/ds-file-upload.js +96 -16
  61. package/dist/components/ds-file-upload/ds-file-upload.js.map +1 -1
  62. package/dist/components/ds-file-upload/errors/file-upload-errors.js.map +1 -1
  63. package/dist/components/ds-file-upload/hooks/use-file-upload.cjs +93 -93
  64. package/dist/components/ds-file-upload/hooks/use-file-upload.js +93 -93
  65. package/dist/components/ds-file-upload/hooks/use-file-upload.js.map +1 -1
  66. package/dist/components/ds-file-upload/types/accept-types.js.map +1 -1
  67. package/dist/components/ds-file-upload/utils/accept-utils.js.map +1 -1
  68. package/dist/components/ds-file-upload/utils/constants.js.map +1 -1
  69. package/dist/components/ds-file-upload/utils/file-factory.js.map +1 -1
  70. package/dist/components/ds-file-upload/utils/format-file-size.js.map +1 -1
  71. package/dist/components/ds-file-upload/utils/generate-helper-text.js.map +1 -1
  72. package/dist/components/ds-file-upload/utils/get-error-message.js.map +1 -1
  73. package/dist/components/ds-file-upload/utils/is-file-equal.js.map +1 -1
  74. package/dist/components/ds-form-control/ds-form-control.cjs +119 -34
  75. package/dist/components/ds-form-control/ds-form-control.d.cts +7 -7
  76. package/dist/components/ds-form-control/ds-form-control.d.ts +7 -7
  77. package/dist/components/ds-form-control/ds-form-control.d.ts.map +1 -1
  78. package/dist/components/ds-form-control/ds-form-control.js +119 -34
  79. package/dist/components/ds-form-control/ds-form-control.js.map +1 -1
  80. package/dist/components/ds-form-control/ds-form-control.types.js.map +1 -1
  81. package/dist/components/ds-grid/ds-grid.js.map +1 -1
  82. package/dist/components/ds-icon/ds-icon.cjs +84 -13
  83. package/dist/components/ds-icon/ds-icon.js +84 -13
  84. package/dist/components/ds-icon/ds-icon.js.map +1 -1
  85. package/dist/components/ds-icon/ds-icon.types.d.cts.map +1 -1
  86. package/dist/components/ds-icon/ds-icon.types.js.map +1 -1
  87. package/dist/components/ds-modal/ds-modal.cjs +222 -55
  88. package/dist/components/ds-modal/ds-modal.d.cts +8 -8
  89. package/dist/components/ds-modal/ds-modal.d.cts.map +1 -1
  90. package/dist/components/ds-modal/ds-modal.d.ts +8 -8
  91. package/dist/components/ds-modal/ds-modal.d.ts.map +1 -1
  92. package/dist/components/ds-modal/ds-modal.js +222 -55
  93. package/dist/components/ds-modal/ds-modal.js.map +1 -1
  94. package/dist/components/ds-number-input/ds-number-input.cjs +136 -49
  95. package/dist/components/ds-number-input/ds-number-input.js +136 -49
  96. package/dist/components/ds-number-input/ds-number-input.js.map +1 -1
  97. package/dist/components/ds-panel/ds-panel.cjs +111 -19
  98. package/dist/components/ds-panel/ds-panel.d.cts +2 -2
  99. package/dist/components/ds-panel/ds-panel.d.cts.map +1 -1
  100. package/dist/components/ds-panel/ds-panel.js +111 -19
  101. package/dist/components/ds-panel/ds-panel.js.map +1 -1
  102. package/dist/components/ds-password-input/ds-password-input.cjs +108 -41
  103. package/dist/components/ds-password-input/ds-password-input.js +108 -41
  104. package/dist/components/ds-password-input/ds-password-input.js.map +1 -1
  105. package/dist/components/ds-popover/ds-popover.cjs +50 -12
  106. package/dist/components/ds-popover/ds-popover.js +50 -12
  107. package/dist/components/ds-popover/ds-popover.js.map +1 -1
  108. package/dist/components/ds-radio-group/ds-radio-group.cjs +209 -53
  109. package/dist/components/ds-radio-group/ds-radio-group.js +209 -53
  110. package/dist/components/ds-radio-group/ds-radio-group.js.map +1 -1
  111. package/dist/components/ds-select/ds-select.cjs +198 -89
  112. package/dist/components/ds-select/ds-select.d.cts +2 -2
  113. package/dist/components/ds-select/ds-select.d.cts.map +1 -1
  114. package/dist/components/ds-select/ds-select.js +198 -89
  115. package/dist/components/ds-select/ds-select.js.map +1 -1
  116. package/dist/components/ds-select/select-items-chips.cjs +73 -22
  117. package/dist/components/ds-select/select-items-chips.js +73 -22
  118. package/dist/components/ds-select/select-items-chips.js.map +1 -1
  119. package/dist/components/ds-smart-tabs/ds-smart-tabs.cjs +208 -46
  120. package/dist/components/ds-smart-tabs/ds-smart-tabs.d.cts +2 -2
  121. package/dist/components/ds-smart-tabs/ds-smart-tabs.d.cts.map +1 -1
  122. package/dist/components/ds-smart-tabs/ds-smart-tabs.d.ts +2 -2
  123. package/dist/components/ds-smart-tabs/ds-smart-tabs.d.ts.map +1 -1
  124. package/dist/components/ds-smart-tabs/ds-smart-tabs.js +208 -46
  125. package/dist/components/ds-smart-tabs/ds-smart-tabs.js.map +1 -1
  126. package/dist/components/ds-smart-tabs/ds-smart-tabs.types.js.map +1 -1
  127. package/dist/components/ds-spinner/ds-spinner.cjs +90 -20
  128. package/dist/components/ds-spinner/ds-spinner.js +90 -20
  129. package/dist/components/ds-spinner/ds-spinner.js.map +1 -1
  130. package/dist/components/ds-spinner/ds-spinner.types.js.map +1 -1
  131. package/dist/components/ds-status-badge/ds-status-badge.cjs +54 -11
  132. package/dist/components/ds-status-badge/ds-status-badge.js +54 -11
  133. package/dist/components/ds-status-badge/ds-status-badge.js.map +1 -1
  134. package/dist/components/ds-stepper/components/ds-step-content.cjs +59 -13
  135. package/dist/components/ds-stepper/components/ds-step-content.d.cts +2 -2
  136. package/dist/components/ds-stepper/components/ds-step-content.d.ts +2 -2
  137. package/dist/components/ds-stepper/components/ds-step-content.js +59 -13
  138. package/dist/components/ds-stepper/components/ds-step-content.js.map +1 -1
  139. package/dist/components/ds-stepper/components/ds-step-description.cjs +14 -5
  140. package/dist/components/ds-stepper/components/ds-step-description.js +14 -5
  141. package/dist/components/ds-stepper/components/ds-step-description.js.map +1 -1
  142. package/dist/components/ds-stepper/components/ds-step-label.cjs +14 -5
  143. package/dist/components/ds-stepper/components/ds-step-label.js +14 -5
  144. package/dist/components/ds-stepper/components/ds-step-label.js.map +1 -1
  145. package/dist/components/ds-stepper/components/ds-step-next-button.cjs +23 -6
  146. package/dist/components/ds-stepper/components/ds-step-next-button.d.cts +2 -2
  147. package/dist/components/ds-stepper/components/ds-step-next-button.d.ts +2 -2
  148. package/dist/components/ds-stepper/components/ds-step-next-button.js +23 -6
  149. package/dist/components/ds-stepper/components/ds-step-next-button.js.map +1 -1
  150. package/dist/components/ds-stepper/components/ds-step.cjs +106 -25
  151. package/dist/components/ds-stepper/components/ds-step.d.cts +2 -2
  152. package/dist/components/ds-stepper/components/ds-step.d.ts +2 -2
  153. package/dist/components/ds-stepper/components/ds-step.js +106 -25
  154. package/dist/components/ds-stepper/components/ds-step.js.map +1 -1
  155. package/dist/components/ds-stepper/ds-stepper.cjs +62 -15
  156. package/dist/components/ds-stepper/ds-stepper.d.cts +2 -2
  157. package/dist/components/ds-stepper/ds-stepper.d.cts.map +1 -1
  158. package/dist/components/ds-stepper/ds-stepper.d.ts +2 -2
  159. package/dist/components/ds-stepper/ds-stepper.js +62 -15
  160. package/dist/components/ds-stepper/ds-stepper.js.map +1 -1
  161. package/dist/components/ds-stepper/hooks/use-stepper.js.map +1 -1
  162. package/dist/components/ds-stepper/hooks/use-steps.cjs +29 -9
  163. package/dist/components/ds-stepper/hooks/use-steps.js +29 -9
  164. package/dist/components/ds-stepper/hooks/use-steps.js.map +1 -1
  165. package/dist/components/ds-system-status/ds-system-status.cjs +37 -7
  166. package/dist/components/ds-system-status/ds-system-status.js +37 -7
  167. package/dist/components/ds-system-status/ds-system-status.js.map +1 -1
  168. package/dist/components/ds-system-status/ds-system-status.types.js.map +1 -1
  169. package/dist/components/ds-table/components/core-table/core-table.cjs +281 -48
  170. package/dist/components/ds-table/components/core-table/core-table.js +281 -48
  171. package/dist/components/ds-table/components/core-table/core-table.js.map +1 -1
  172. package/dist/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.cjs +134 -50
  173. package/dist/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.js +134 -50
  174. package/dist/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.js.map +1 -1
  175. package/dist/components/ds-table/components/ds-table-cell/ds-table-cell.cjs +140 -43
  176. package/dist/components/ds-table/components/ds-table-cell/ds-table-cell.js +140 -43
  177. package/dist/components/ds-table/components/ds-table-cell/ds-table-cell.js.map +1 -1
  178. package/dist/components/ds-table/components/ds-table-header/ds-table-header.cjs +37 -6
  179. package/dist/components/ds-table/components/ds-table-header/ds-table-header.js +37 -6
  180. package/dist/components/ds-table/components/ds-table-header/ds-table-header.js.map +1 -1
  181. package/dist/components/ds-table/components/ds-table-row/ds-table-row.cjs +272 -100
  182. package/dist/components/ds-table/components/ds-table-row/ds-table-row.js +272 -100
  183. package/dist/components/ds-table/components/ds-table-row/ds-table-row.js.map +1 -1
  184. package/dist/components/ds-table/context/ds-table-context.js.map +1 -1
  185. package/dist/components/ds-table/ds-table.cjs +15 -15
  186. package/dist/components/ds-table/ds-table.d.cts +2 -2
  187. package/dist/components/ds-table/ds-table.js +15 -15
  188. package/dist/components/ds-table/ds-table.js.map +1 -1
  189. package/dist/components/ds-table/hooks/use-drag-and-drop.cjs +126 -38
  190. package/dist/components/ds-table/hooks/use-drag-and-drop.js +126 -38
  191. package/dist/components/ds-table/hooks/use-drag-and-drop.js.map +1 -1
  192. package/dist/components/ds-table/utils/column-styling.js.map +1 -1
  193. package/dist/components/ds-table/utils/create-columns-grid-template.js.map +1 -1
  194. package/dist/components/ds-table/utils/merge-refs.js.map +1 -1
  195. package/dist/components/ds-text-input/ds-text-input.cjs +128 -43
  196. package/dist/components/ds-text-input/ds-text-input.js +128 -43
  197. package/dist/components/ds-text-input/ds-text-input.js.map +1 -1
  198. package/dist/components/ds-text-input/ds-text-input.types.js.map +1 -1
  199. package/dist/components/ds-textarea/ds-textarea.cjs +66 -22
  200. package/dist/components/ds-textarea/ds-textarea.js +66 -22
  201. package/dist/components/ds-textarea/ds-textarea.js.map +1 -1
  202. package/dist/components/ds-toast/ds-toast-context.cjs +62 -17
  203. package/dist/components/ds-toast/ds-toast-context.js +62 -17
  204. package/dist/components/ds-toast/ds-toast-context.js.map +1 -1
  205. package/dist/components/ds-toast/ds-toast.cjs +90 -26
  206. package/dist/components/ds-toast/ds-toast.js +90 -26
  207. package/dist/components/ds-toast/ds-toast.js.map +1 -1
  208. package/dist/components/ds-tooltip/ds-tooltip.cjs +51 -13
  209. package/dist/components/ds-tooltip/ds-tooltip.js +51 -13
  210. package/dist/components/ds-tooltip/ds-tooltip.js.map +1 -1
  211. package/dist/components/ds-typography/ds-typography.cjs +51 -7
  212. package/dist/components/ds-typography/ds-typography.config.js.map +1 -1
  213. package/dist/components/ds-typography/ds-typography.js +51 -7
  214. package/dist/components/ds-typography/ds-typography.js.map +1 -1
  215. package/dist/components/ds-vertical-tabs/ds-vertical-tabs.cjs +91 -30
  216. package/dist/components/ds-vertical-tabs/ds-vertical-tabs.d.cts +5 -5
  217. package/dist/components/ds-vertical-tabs/ds-vertical-tabs.d.ts +5 -5
  218. package/dist/components/ds-vertical-tabs/ds-vertical-tabs.js +91 -30
  219. package/dist/components/ds-vertical-tabs/ds-vertical-tabs.js.map +1 -1
  220. package/dist/index.min.css +1 -1
  221. package/package.json +7 -1
@@ -11,6 +11,7 @@ const require_constants = require('../../utils/constants.cjs');
11
11
  const require_accept_utils = require('../../utils/accept-utils.cjs');
12
12
  const require_generate_helper_text = require('../../utils/generate-helper-text.cjs');
13
13
  const require_file_upload_module = require('./file-upload.module.cjs');
14
+ let react_compiler_runtime = require("react/compiler-runtime");
14
15
  let classnames = require("classnames");
15
16
  classnames = require_rolldown_runtime.__toESM(classnames);
16
17
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -21,75 +22,195 @@ let __ark_ui_react = require("@ark-ui/react");
21
22
  * Design system base File Upload component
22
23
  * Used in conjunction with the useFileUpload hook
23
24
  */
24
- const FileUpload = ({ style = {}, className, files, acceptedFiles, errorText, dropzoneText = "Drag and drop files here or ", triggerText = "Select file...", hideProgress = false, disableDrop = false, onFileAccept, onFileReject, onFileRemove, onFileDelete, onFileCancel, onFileRetry, accept = require_constants.DEFAULT_ALLOWED_FILE_TYPES, maxFiles = require_constants.DEFAULT_MAX_FILES, maxFileSize = require_constants.DEFAULT_MAX_FILE_SIZE, compact = false, disabled = false }) => {
25
- const infoText = require_generate_helper_text.generateHelperText(accept, maxFileSize, maxFiles);
26
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__ark_ui_react.FileUpload.Root, {
27
- style,
28
- className: (0, classnames.default)(require_file_upload_module.default.fileUploadRoot, className),
29
- maxFiles,
30
- maxFileSize,
31
- accept: require_accept_utils.getMimeTypes(accept),
32
- disabled,
33
- allowDrop: !disableDrop,
34
- acceptedFiles,
35
- onFileAccept,
36
- onFileReject,
37
- children: [
38
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__ark_ui_react.FileUpload.Dropzone, {
39
- className: (0, classnames.default)(require_file_upload_module.default.dropzone, { [require_file_upload_module.default.dropzoneCompact]: compact }),
40
- children: [
41
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_icon.default, {
42
- icon: "upload",
43
- className: require_file_upload_module.default.dropzoneIcon
44
- }),
45
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_typography.default, {
46
- className: require_file_upload_module.default.dropzoneText,
47
- variant: "body-xs-reg",
48
- children: dropzoneText
49
- }),
50
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ark_ui_react.FileUpload.Trigger, {
51
- asChild: true,
52
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_button.default, {
53
- design: "v1.2",
54
- variant: "ghost",
55
- size: "small",
56
- disabled,
57
- children: triggerText
58
- })
59
- })
60
- ]
61
- }),
62
- infoText && !disabled && !errorText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_typography.default, {
63
- className: require_file_upload_module.default.infoText,
64
- variant: "body-xs-reg",
65
- children: infoText
66
- }),
67
- errorText && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ds_typography.default, {
68
- className: require_file_upload_module.default.errorText,
69
- variant: "body-xs-reg",
70
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_icon.default, {
71
- icon: "error",
72
- size: "tiny"
73
- }), errorText]
74
- }),
75
- !!files?.length && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
76
- className: require_file_upload_module.default.fileList,
77
- children: files.map((uploadFile) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_file_upload_item.FileUploadItem, {
78
- id: uploadFile.id,
79
- name: uploadFile.name,
80
- progress: uploadFile.progress,
81
- hideProgress,
82
- status: uploadFile.status,
83
- errors: uploadFile.errors,
84
- onRemove: onFileRemove,
85
- onDelete: onFileDelete,
86
- onCancel: onFileCancel,
87
- onRetry: onFileRetry
88
- }, uploadFile.id))
89
- }),
90
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ark_ui_react.FileUpload.HiddenInput, {})
91
- ]
92
- });
25
+ const FileUpload = (t0) => {
26
+ const $ = (0, react_compiler_runtime.c)(51);
27
+ const { style: t1, className, files, acceptedFiles, errorText, dropzoneText: t2, triggerText: t3, hideProgress: t4, disableDrop: t5, onFileAccept, onFileReject, onFileRemove, onFileDelete, onFileCancel, onFileRetry, accept: t6, maxFiles: t7, maxFileSize: t8, compact: t9, disabled: t10 } = t0;
28
+ let t11;
29
+ if ($[0] !== t1) {
30
+ t11 = t1 === void 0 ? {} : t1;
31
+ $[0] = t1;
32
+ $[1] = t11;
33
+ } else t11 = $[1];
34
+ const style = t11;
35
+ const dropzoneText = t2 === void 0 ? "Drag and drop files here or " : t2;
36
+ const triggerText = t3 === void 0 ? "Select file..." : t3;
37
+ const hideProgress = t4 === void 0 ? false : t4;
38
+ const disableDrop = t5 === void 0 ? false : t5;
39
+ const accept = t6 === void 0 ? require_constants.DEFAULT_ALLOWED_FILE_TYPES : t6;
40
+ const maxFiles = t7 === void 0 ? require_constants.DEFAULT_MAX_FILES : t7;
41
+ const maxFileSize = t8 === void 0 ? require_constants.DEFAULT_MAX_FILE_SIZE : t8;
42
+ const compact = t9 === void 0 ? false : t9;
43
+ const disabled = t10 === void 0 ? false : t10;
44
+ let t12;
45
+ if ($[2] !== accept || $[3] !== maxFileSize || $[4] !== maxFiles) {
46
+ t12 = require_generate_helper_text.generateHelperText(accept, maxFileSize, maxFiles);
47
+ $[2] = accept;
48
+ $[3] = maxFileSize;
49
+ $[4] = maxFiles;
50
+ $[5] = t12;
51
+ } else t12 = $[5];
52
+ const infoText = t12;
53
+ let t13;
54
+ if ($[6] !== className) {
55
+ t13 = (0, classnames.default)(require_file_upload_module.default.fileUploadRoot, className);
56
+ $[6] = className;
57
+ $[7] = t13;
58
+ } else t13 = $[7];
59
+ let t14;
60
+ if ($[8] !== accept) {
61
+ t14 = require_accept_utils.getMimeTypes(accept);
62
+ $[8] = accept;
63
+ $[9] = t14;
64
+ } else t14 = $[9];
65
+ const t15 = !disableDrop;
66
+ let t16;
67
+ if ($[10] !== compact) {
68
+ t16 = (0, classnames.default)(require_file_upload_module.default.dropzone, { [require_file_upload_module.default.dropzoneCompact]: compact });
69
+ $[10] = compact;
70
+ $[11] = t16;
71
+ } else t16 = $[11];
72
+ let t17;
73
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
74
+ t17 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_icon.default, {
75
+ icon: "upload",
76
+ className: require_file_upload_module.default.dropzoneIcon
77
+ });
78
+ $[12] = t17;
79
+ } else t17 = $[12];
80
+ let t18;
81
+ if ($[13] !== dropzoneText) {
82
+ t18 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_typography.default, {
83
+ className: require_file_upload_module.default.dropzoneText,
84
+ variant: "body-xs-reg",
85
+ children: dropzoneText
86
+ });
87
+ $[13] = dropzoneText;
88
+ $[14] = t18;
89
+ } else t18 = $[14];
90
+ let t19;
91
+ if ($[15] !== disabled || $[16] !== triggerText) {
92
+ t19 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ark_ui_react.FileUpload.Trigger, {
93
+ asChild: true,
94
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_button.default, {
95
+ design: "v1.2",
96
+ variant: "ghost",
97
+ size: "small",
98
+ disabled,
99
+ children: triggerText
100
+ })
101
+ });
102
+ $[15] = disabled;
103
+ $[16] = triggerText;
104
+ $[17] = t19;
105
+ } else t19 = $[17];
106
+ let t20;
107
+ if ($[18] !== t16 || $[19] !== t18 || $[20] !== t19) {
108
+ t20 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__ark_ui_react.FileUpload.Dropzone, {
109
+ className: t16,
110
+ children: [
111
+ t17,
112
+ t18,
113
+ t19
114
+ ]
115
+ });
116
+ $[18] = t16;
117
+ $[19] = t18;
118
+ $[20] = t19;
119
+ $[21] = t20;
120
+ } else t20 = $[21];
121
+ let t21;
122
+ if ($[22] !== disabled || $[23] !== errorText || $[24] !== infoText) {
123
+ t21 = infoText && !disabled && !errorText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_typography.default, {
124
+ className: require_file_upload_module.default.infoText,
125
+ variant: "body-xs-reg",
126
+ children: infoText
127
+ });
128
+ $[22] = disabled;
129
+ $[23] = errorText;
130
+ $[24] = infoText;
131
+ $[25] = t21;
132
+ } else t21 = $[25];
133
+ let t22;
134
+ if ($[26] !== errorText) {
135
+ t22 = errorText && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ds_typography.default, {
136
+ className: require_file_upload_module.default.errorText,
137
+ variant: "body-xs-reg",
138
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_icon.default, {
139
+ icon: "error",
140
+ size: "tiny"
141
+ }), errorText]
142
+ });
143
+ $[26] = errorText;
144
+ $[27] = t22;
145
+ } else t22 = $[27];
146
+ let t23;
147
+ if ($[28] !== files || $[29] !== hideProgress || $[30] !== onFileCancel || $[31] !== onFileDelete || $[32] !== onFileRemove || $[33] !== onFileRetry) {
148
+ t23 = !!files?.length && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
149
+ className: require_file_upload_module.default.fileList,
150
+ children: files.map((uploadFile) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_file_upload_item.FileUploadItem, {
151
+ id: uploadFile.id,
152
+ name: uploadFile.name,
153
+ progress: uploadFile.progress,
154
+ hideProgress,
155
+ status: uploadFile.status,
156
+ errors: uploadFile.errors,
157
+ onRemove: onFileRemove,
158
+ onDelete: onFileDelete,
159
+ onCancel: onFileCancel,
160
+ onRetry: onFileRetry
161
+ }, uploadFile.id))
162
+ });
163
+ $[28] = files;
164
+ $[29] = hideProgress;
165
+ $[30] = onFileCancel;
166
+ $[31] = onFileDelete;
167
+ $[32] = onFileRemove;
168
+ $[33] = onFileRetry;
169
+ $[34] = t23;
170
+ } else t23 = $[34];
171
+ let t24;
172
+ if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
173
+ t24 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ark_ui_react.FileUpload.HiddenInput, {});
174
+ $[35] = t24;
175
+ } else t24 = $[35];
176
+ let t25;
177
+ if ($[36] !== acceptedFiles || $[37] !== disabled || $[38] !== maxFileSize || $[39] !== maxFiles || $[40] !== onFileAccept || $[41] !== onFileReject || $[42] !== style || $[43] !== t13 || $[44] !== t14 || $[45] !== t15 || $[46] !== t20 || $[47] !== t21 || $[48] !== t22 || $[49] !== t23) {
178
+ t25 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__ark_ui_react.FileUpload.Root, {
179
+ style,
180
+ className: t13,
181
+ maxFiles,
182
+ maxFileSize,
183
+ accept: t14,
184
+ disabled,
185
+ allowDrop: t15,
186
+ acceptedFiles,
187
+ onFileAccept,
188
+ onFileReject,
189
+ children: [
190
+ t20,
191
+ t21,
192
+ t22,
193
+ t23,
194
+ t24
195
+ ]
196
+ });
197
+ $[36] = acceptedFiles;
198
+ $[37] = disabled;
199
+ $[38] = maxFileSize;
200
+ $[39] = maxFiles;
201
+ $[40] = onFileAccept;
202
+ $[41] = onFileReject;
203
+ $[42] = style;
204
+ $[43] = t13;
205
+ $[44] = t14;
206
+ $[45] = t15;
207
+ $[46] = t20;
208
+ $[47] = t21;
209
+ $[48] = t22;
210
+ $[49] = t23;
211
+ $[50] = t25;
212
+ } else t25 = $[50];
213
+ return t25;
93
214
  };
94
215
 
95
216
  //#endregion
@@ -10,6 +10,7 @@ import { DEFAULT_ALLOWED_FILE_TYPES, DEFAULT_MAX_FILES, DEFAULT_MAX_FILE_SIZE }
10
10
  import { getMimeTypes } from "../../utils/accept-utils.js";
11
11
  import { generateHelperText } from "../../utils/generate-helper-text.js";
12
12
  import file_upload_module_default from "./file-upload.module.js";
13
+ import { c } from "react/compiler-runtime";
13
14
  import classNames from "classnames";
14
15
  import { jsx, jsxs } from "react/jsx-runtime";
15
16
  import { FileUpload } from "@ark-ui/react";
@@ -19,75 +20,195 @@ import { FileUpload } from "@ark-ui/react";
19
20
  * Design system base File Upload component
20
21
  * Used in conjunction with the useFileUpload hook
21
22
  */
22
- const FileUpload$1 = ({ style = {}, className, files, acceptedFiles, errorText, dropzoneText = "Drag and drop files here or ", triggerText = "Select file...", hideProgress = false, disableDrop = false, onFileAccept, onFileReject, onFileRemove, onFileDelete, onFileCancel, onFileRetry, accept = DEFAULT_ALLOWED_FILE_TYPES, maxFiles = DEFAULT_MAX_FILES, maxFileSize = DEFAULT_MAX_FILE_SIZE, compact = false, disabled = false }) => {
23
- const infoText = generateHelperText(accept, maxFileSize, maxFiles);
24
- return /* @__PURE__ */ jsxs(FileUpload.Root, {
25
- style,
26
- className: classNames(file_upload_module_default.fileUploadRoot, className),
27
- maxFiles,
28
- maxFileSize,
29
- accept: getMimeTypes(accept),
30
- disabled,
31
- allowDrop: !disableDrop,
32
- acceptedFiles,
33
- onFileAccept,
34
- onFileReject,
35
- children: [
36
- /* @__PURE__ */ jsxs(FileUpload.Dropzone, {
37
- className: classNames(file_upload_module_default.dropzone, { [file_upload_module_default.dropzoneCompact]: compact }),
38
- children: [
39
- /* @__PURE__ */ jsx(ds_icon_default, {
40
- icon: "upload",
41
- className: file_upload_module_default.dropzoneIcon
42
- }),
43
- /* @__PURE__ */ jsx(ds_typography_default, {
44
- className: file_upload_module_default.dropzoneText,
45
- variant: "body-xs-reg",
46
- children: dropzoneText
47
- }),
48
- /* @__PURE__ */ jsx(FileUpload.Trigger, {
49
- asChild: true,
50
- children: /* @__PURE__ */ jsx(ds_button_default, {
51
- design: "v1.2",
52
- variant: "ghost",
53
- size: "small",
54
- disabled,
55
- children: triggerText
56
- })
57
- })
58
- ]
59
- }),
60
- infoText && !disabled && !errorText && /* @__PURE__ */ jsx(ds_typography_default, {
61
- className: file_upload_module_default.infoText,
62
- variant: "body-xs-reg",
63
- children: infoText
64
- }),
65
- errorText && /* @__PURE__ */ jsxs(ds_typography_default, {
66
- className: file_upload_module_default.errorText,
67
- variant: "body-xs-reg",
68
- children: [/* @__PURE__ */ jsx(ds_icon_default, {
69
- icon: "error",
70
- size: "tiny"
71
- }), errorText]
72
- }),
73
- !!files?.length && /* @__PURE__ */ jsx("div", {
74
- className: file_upload_module_default.fileList,
75
- children: files.map((uploadFile) => /* @__PURE__ */ jsx(FileUploadItem, {
76
- id: uploadFile.id,
77
- name: uploadFile.name,
78
- progress: uploadFile.progress,
79
- hideProgress,
80
- status: uploadFile.status,
81
- errors: uploadFile.errors,
82
- onRemove: onFileRemove,
83
- onDelete: onFileDelete,
84
- onCancel: onFileCancel,
85
- onRetry: onFileRetry
86
- }, uploadFile.id))
87
- }),
88
- /* @__PURE__ */ jsx(FileUpload.HiddenInput, {})
89
- ]
90
- });
23
+ const FileUpload$1 = (t0) => {
24
+ const $ = c(51);
25
+ const { style: t1, className, files, acceptedFiles, errorText, dropzoneText: t2, triggerText: t3, hideProgress: t4, disableDrop: t5, onFileAccept, onFileReject, onFileRemove, onFileDelete, onFileCancel, onFileRetry, accept: t6, maxFiles: t7, maxFileSize: t8, compact: t9, disabled: t10 } = t0;
26
+ let t11;
27
+ if ($[0] !== t1) {
28
+ t11 = t1 === void 0 ? {} : t1;
29
+ $[0] = t1;
30
+ $[1] = t11;
31
+ } else t11 = $[1];
32
+ const style = t11;
33
+ const dropzoneText = t2 === void 0 ? "Drag and drop files here or " : t2;
34
+ const triggerText = t3 === void 0 ? "Select file..." : t3;
35
+ const hideProgress = t4 === void 0 ? false : t4;
36
+ const disableDrop = t5 === void 0 ? false : t5;
37
+ const accept = t6 === void 0 ? DEFAULT_ALLOWED_FILE_TYPES : t6;
38
+ const maxFiles = t7 === void 0 ? DEFAULT_MAX_FILES : t7;
39
+ const maxFileSize = t8 === void 0 ? DEFAULT_MAX_FILE_SIZE : t8;
40
+ const compact = t9 === void 0 ? false : t9;
41
+ const disabled = t10 === void 0 ? false : t10;
42
+ let t12;
43
+ if ($[2] !== accept || $[3] !== maxFileSize || $[4] !== maxFiles) {
44
+ t12 = generateHelperText(accept, maxFileSize, maxFiles);
45
+ $[2] = accept;
46
+ $[3] = maxFileSize;
47
+ $[4] = maxFiles;
48
+ $[5] = t12;
49
+ } else t12 = $[5];
50
+ const infoText = t12;
51
+ let t13;
52
+ if ($[6] !== className) {
53
+ t13 = classNames(file_upload_module_default.fileUploadRoot, className);
54
+ $[6] = className;
55
+ $[7] = t13;
56
+ } else t13 = $[7];
57
+ let t14;
58
+ if ($[8] !== accept) {
59
+ t14 = getMimeTypes(accept);
60
+ $[8] = accept;
61
+ $[9] = t14;
62
+ } else t14 = $[9];
63
+ const t15 = !disableDrop;
64
+ let t16;
65
+ if ($[10] !== compact) {
66
+ t16 = classNames(file_upload_module_default.dropzone, { [file_upload_module_default.dropzoneCompact]: compact });
67
+ $[10] = compact;
68
+ $[11] = t16;
69
+ } else t16 = $[11];
70
+ let t17;
71
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
72
+ t17 = /* @__PURE__ */ jsx(ds_icon_default, {
73
+ icon: "upload",
74
+ className: file_upload_module_default.dropzoneIcon
75
+ });
76
+ $[12] = t17;
77
+ } else t17 = $[12];
78
+ let t18;
79
+ if ($[13] !== dropzoneText) {
80
+ t18 = /* @__PURE__ */ jsx(ds_typography_default, {
81
+ className: file_upload_module_default.dropzoneText,
82
+ variant: "body-xs-reg",
83
+ children: dropzoneText
84
+ });
85
+ $[13] = dropzoneText;
86
+ $[14] = t18;
87
+ } else t18 = $[14];
88
+ let t19;
89
+ if ($[15] !== disabled || $[16] !== triggerText) {
90
+ t19 = /* @__PURE__ */ jsx(FileUpload.Trigger, {
91
+ asChild: true,
92
+ children: /* @__PURE__ */ jsx(ds_button_default, {
93
+ design: "v1.2",
94
+ variant: "ghost",
95
+ size: "small",
96
+ disabled,
97
+ children: triggerText
98
+ })
99
+ });
100
+ $[15] = disabled;
101
+ $[16] = triggerText;
102
+ $[17] = t19;
103
+ } else t19 = $[17];
104
+ let t20;
105
+ if ($[18] !== t16 || $[19] !== t18 || $[20] !== t19) {
106
+ t20 = /* @__PURE__ */ jsxs(FileUpload.Dropzone, {
107
+ className: t16,
108
+ children: [
109
+ t17,
110
+ t18,
111
+ t19
112
+ ]
113
+ });
114
+ $[18] = t16;
115
+ $[19] = t18;
116
+ $[20] = t19;
117
+ $[21] = t20;
118
+ } else t20 = $[21];
119
+ let t21;
120
+ if ($[22] !== disabled || $[23] !== errorText || $[24] !== infoText) {
121
+ t21 = infoText && !disabled && !errorText && /* @__PURE__ */ jsx(ds_typography_default, {
122
+ className: file_upload_module_default.infoText,
123
+ variant: "body-xs-reg",
124
+ children: infoText
125
+ });
126
+ $[22] = disabled;
127
+ $[23] = errorText;
128
+ $[24] = infoText;
129
+ $[25] = t21;
130
+ } else t21 = $[25];
131
+ let t22;
132
+ if ($[26] !== errorText) {
133
+ t22 = errorText && /* @__PURE__ */ jsxs(ds_typography_default, {
134
+ className: file_upload_module_default.errorText,
135
+ variant: "body-xs-reg",
136
+ children: [/* @__PURE__ */ jsx(ds_icon_default, {
137
+ icon: "error",
138
+ size: "tiny"
139
+ }), errorText]
140
+ });
141
+ $[26] = errorText;
142
+ $[27] = t22;
143
+ } else t22 = $[27];
144
+ let t23;
145
+ if ($[28] !== files || $[29] !== hideProgress || $[30] !== onFileCancel || $[31] !== onFileDelete || $[32] !== onFileRemove || $[33] !== onFileRetry) {
146
+ t23 = !!files?.length && /* @__PURE__ */ jsx("div", {
147
+ className: file_upload_module_default.fileList,
148
+ children: files.map((uploadFile) => /* @__PURE__ */ jsx(FileUploadItem, {
149
+ id: uploadFile.id,
150
+ name: uploadFile.name,
151
+ progress: uploadFile.progress,
152
+ hideProgress,
153
+ status: uploadFile.status,
154
+ errors: uploadFile.errors,
155
+ onRemove: onFileRemove,
156
+ onDelete: onFileDelete,
157
+ onCancel: onFileCancel,
158
+ onRetry: onFileRetry
159
+ }, uploadFile.id))
160
+ });
161
+ $[28] = files;
162
+ $[29] = hideProgress;
163
+ $[30] = onFileCancel;
164
+ $[31] = onFileDelete;
165
+ $[32] = onFileRemove;
166
+ $[33] = onFileRetry;
167
+ $[34] = t23;
168
+ } else t23 = $[34];
169
+ let t24;
170
+ if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
171
+ t24 = /* @__PURE__ */ jsx(FileUpload.HiddenInput, {});
172
+ $[35] = t24;
173
+ } else t24 = $[35];
174
+ let t25;
175
+ if ($[36] !== acceptedFiles || $[37] !== disabled || $[38] !== maxFileSize || $[39] !== maxFiles || $[40] !== onFileAccept || $[41] !== onFileReject || $[42] !== style || $[43] !== t13 || $[44] !== t14 || $[45] !== t15 || $[46] !== t20 || $[47] !== t21 || $[48] !== t22 || $[49] !== t23) {
176
+ t25 = /* @__PURE__ */ jsxs(FileUpload.Root, {
177
+ style,
178
+ className: t13,
179
+ maxFiles,
180
+ maxFileSize,
181
+ accept: t14,
182
+ disabled,
183
+ allowDrop: t15,
184
+ acceptedFiles,
185
+ onFileAccept,
186
+ onFileReject,
187
+ children: [
188
+ t20,
189
+ t21,
190
+ t22,
191
+ t23,
192
+ t24
193
+ ]
194
+ });
195
+ $[36] = acceptedFiles;
196
+ $[37] = disabled;
197
+ $[38] = maxFileSize;
198
+ $[39] = maxFiles;
199
+ $[40] = onFileAccept;
200
+ $[41] = onFileReject;
201
+ $[42] = style;
202
+ $[43] = t13;
203
+ $[44] = t14;
204
+ $[45] = t15;
205
+ $[46] = t20;
206
+ $[47] = t21;
207
+ $[48] = t22;
208
+ $[49] = t23;
209
+ $[50] = t25;
210
+ } else t25 = $[50];
211
+ return t25;
91
212
  };
92
213
 
93
214
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"file-upload.js","names":["FileUpload: React.FC<FileUploadProps>","ArkUiFileUpload","styles","DsIcon","DsTypography","DsButton"],"sources":["../../../../../src/components/ds-file-upload/components/file-upload/file-upload.tsx"],"sourcesContent":["import type React from 'react';\nimport classNames from 'classnames';\nimport { FileUpload as ArkUiFileUpload } from '@ark-ui/react';\nimport { DsIcon } from '../../../ds-icon';\nimport { DsTypography } from '../../../ds-typography';\nimport { DsButton } from '../../../ds-button';\nimport { FileUploadItem } from '../file-upload-item';\nimport type { FileUploadProps } from './file-upload.types';\nimport { DEFAULT_ALLOWED_FILE_TYPES, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_FILES } from '../../utils/constants';\nimport { generateHelperText } from '../../utils/generate-helper-text';\nimport { getMimeTypes } from '../../utils/accept-utils';\nimport styles from './file-upload.module.scss';\n\n/**\n * Design system base File Upload component\n * Used in conjunction with the useFileUpload hook\n */\nexport const FileUpload: React.FC<FileUploadProps> = ({\n\tstyle = {},\n\tclassName,\n\tfiles,\n\tacceptedFiles,\n\terrorText,\n\tdropzoneText = 'Drag and drop files here or ',\n\ttriggerText = 'Select file...',\n\thideProgress = false,\n\tdisableDrop = false,\n\tonFileAccept,\n\tonFileReject,\n\tonFileRemove,\n\tonFileDelete,\n\tonFileCancel,\n\tonFileRetry,\n\taccept = DEFAULT_ALLOWED_FILE_TYPES,\n\tmaxFiles = DEFAULT_MAX_FILES,\n\tmaxFileSize = DEFAULT_MAX_FILE_SIZE,\n\tcompact = false,\n\tdisabled = false,\n}) => {\n\tconst infoText = generateHelperText(accept, maxFileSize, maxFiles);\n\n\treturn (\n\t\t<ArkUiFileUpload.Root\n\t\t\tstyle={style}\n\t\t\tclassName={classNames(styles.fileUploadRoot, className)}\n\t\t\tmaxFiles={maxFiles}\n\t\t\tmaxFileSize={maxFileSize}\n\t\t\taccept={getMimeTypes(accept)}\n\t\t\tdisabled={disabled}\n\t\t\tallowDrop={!disableDrop}\n\t\t\tacceptedFiles={acceptedFiles}\n\t\t\tonFileAccept={onFileAccept}\n\t\t\tonFileReject={onFileReject}\n\t\t>\n\t\t\t<ArkUiFileUpload.Dropzone\n\t\t\t\tclassName={classNames(styles.dropzone, {\n\t\t\t\t\t[styles.dropzoneCompact]: compact,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<DsIcon icon=\"upload\" className={styles.dropzoneIcon} />\n\t\t\t\t<DsTypography className={styles.dropzoneText} variant=\"body-xs-reg\">\n\t\t\t\t\t{dropzoneText}\n\t\t\t\t</DsTypography>\n\t\t\t\t<ArkUiFileUpload.Trigger asChild>\n\t\t\t\t\t<DsButton design=\"v1.2\" variant=\"ghost\" size=\"small\" disabled={disabled}>\n\t\t\t\t\t\t{triggerText}\n\t\t\t\t\t</DsButton>\n\t\t\t\t</ArkUiFileUpload.Trigger>\n\t\t\t</ArkUiFileUpload.Dropzone>\n\n\t\t\t{infoText && !disabled && !errorText && (\n\t\t\t\t<DsTypography className={styles.infoText} variant=\"body-xs-reg\">\n\t\t\t\t\t{infoText}\n\t\t\t\t</DsTypography>\n\t\t\t)}\n\t\t\t{errorText && (\n\t\t\t\t<DsTypography className={styles.errorText} variant=\"body-xs-reg\">\n\t\t\t\t\t<DsIcon icon=\"error\" size=\"tiny\" />\n\t\t\t\t\t{errorText}\n\t\t\t\t</DsTypography>\n\t\t\t)}\n\n\t\t\t{!!files?.length && (\n\t\t\t\t<div className={styles.fileList}>\n\t\t\t\t\t{files.map((uploadFile) => (\n\t\t\t\t\t\t<FileUploadItem\n\t\t\t\t\t\t\tkey={uploadFile.id}\n\t\t\t\t\t\t\tid={uploadFile.id}\n\t\t\t\t\t\t\tname={uploadFile.name}\n\t\t\t\t\t\t\tprogress={uploadFile.progress}\n\t\t\t\t\t\t\thideProgress={hideProgress}\n\t\t\t\t\t\t\tstatus={uploadFile.status}\n\t\t\t\t\t\t\terrors={uploadFile.errors}\n\t\t\t\t\t\t\tonRemove={onFileRemove}\n\t\t\t\t\t\t\tonDelete={onFileDelete}\n\t\t\t\t\t\t\tonCancel={onFileCancel}\n\t\t\t\t\t\t\tonRetry={onFileRetry}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t<ArkUiFileUpload.HiddenInput />\n\t\t</ArkUiFileUpload.Root>\n\t);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA,MAAaA,gBAAyC,EACrD,QAAQ,EAAE,EACV,WACA,OACA,eACA,WACA,eAAe,gCACf,cAAc,kBACd,eAAe,OACf,cAAc,OACd,cACA,cACA,cACA,cACA,cACA,aACA,SAAS,4BACT,WAAW,mBACX,cAAc,uBACd,UAAU,OACV,WAAW,YACN;CACL,MAAM,WAAW,mBAAmB,QAAQ,aAAa,SAAS;AAElE,QACC,qBAACC,WAAgB;EACT;EACP,WAAW,WAAWC,2BAAO,gBAAgB,UAAU;EAC7C;EACG;EACb,QAAQ,aAAa,OAAO;EAClB;EACV,WAAW,CAAC;EACG;EACD;EACA;;GAEd,qBAACD,WAAgB;IAChB,WAAW,WAAWC,2BAAO,UAAU,GACrCA,2BAAO,kBAAkB,SAC1B,CAAC;;KAEF,oBAACC;MAAO,MAAK;MAAS,WAAWD,2BAAO;OAAgB;KACxD,oBAACE;MAAa,WAAWF,2BAAO;MAAc,SAAQ;gBACpD;OACa;KACf,oBAACD,WAAgB;MAAQ;gBACxB,oBAACI;OAAS,QAAO;OAAO,SAAQ;OAAQ,MAAK;OAAkB;iBAC7D;QACS;OACc;;KACA;GAE1B,YAAY,CAAC,YAAY,CAAC,aAC1B,oBAACD;IAAa,WAAWF,2BAAO;IAAU,SAAQ;cAChD;KACa;GAEf,aACA,qBAACE;IAAa,WAAWF,2BAAO;IAAW,SAAQ;eAClD,oBAACC;KAAO,MAAK;KAAQ,MAAK;MAAS,EAClC;KACa;GAGf,CAAC,CAAC,OAAO,UACT,oBAAC;IAAI,WAAWD,2BAAO;cACrB,MAAM,KAAK,eACX,oBAAC;KAEA,IAAI,WAAW;KACf,MAAM,WAAW;KACjB,UAAU,WAAW;KACP;KACd,QAAQ,WAAW;KACnB,QAAQ,WAAW;KACnB,UAAU;KACV,UAAU;KACV,UAAU;KACV,SAAS;OAVJ,WAAW,GAWf,CACD;KACG;GAGP,oBAACD,WAAgB,gBAAc;;GACT"}
1
+ {"version":3,"file":"file-upload.js","names":["React","classNames","FileUpload","ArkUiFileUpload","DsIcon","DsTypography","DsButton","FileUploadItem","FileUploadProps","DEFAULT_ALLOWED_FILE_TYPES","DEFAULT_MAX_FILE_SIZE","DEFAULT_MAX_FILES","generateHelperText","getMimeTypes","styles","FC","t0","$","_c","style","t1","className","files","acceptedFiles","errorText","dropzoneText","t2","triggerText","t3","hideProgress","t4","disableDrop","t5","onFileAccept","onFileReject","onFileRemove","onFileDelete","onFileCancel","onFileRetry","accept","t6","maxFiles","t7","maxFileSize","t8","compact","t9","disabled","t10","t11","undefined","t12","infoText","t13","fileUploadRoot","t14","t15","t16","dropzone","dropzoneCompact","t17","Symbol","for","dropzoneIcon","t18","t19","t20","t21","t22","t23","length","fileList","map","uploadFile","id","name","progress","status","errors","t24","t25"],"sources":["../../../../../src/components/ds-file-upload/components/file-upload/file-upload.tsx"],"sourcesContent":["import type React from 'react';\nimport classNames from 'classnames';\nimport { FileUpload as ArkUiFileUpload } from '@ark-ui/react';\nimport { DsIcon } from '../../../ds-icon';\nimport { DsTypography } from '../../../ds-typography';\nimport { DsButton } from '../../../ds-button';\nimport { FileUploadItem } from '../file-upload-item';\nimport type { FileUploadProps } from './file-upload.types';\nimport { DEFAULT_ALLOWED_FILE_TYPES, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_FILES } from '../../utils/constants';\nimport { generateHelperText } from '../../utils/generate-helper-text';\nimport { getMimeTypes } from '../../utils/accept-utils';\nimport styles from './file-upload.module.scss';\n\n/**\n * Design system base File Upload component\n * Used in conjunction with the useFileUpload hook\n */\nexport const FileUpload: React.FC<FileUploadProps> = ({\n\tstyle = {},\n\tclassName,\n\tfiles,\n\tacceptedFiles,\n\terrorText,\n\tdropzoneText = 'Drag and drop files here or ',\n\ttriggerText = 'Select file...',\n\thideProgress = false,\n\tdisableDrop = false,\n\tonFileAccept,\n\tonFileReject,\n\tonFileRemove,\n\tonFileDelete,\n\tonFileCancel,\n\tonFileRetry,\n\taccept = DEFAULT_ALLOWED_FILE_TYPES,\n\tmaxFiles = DEFAULT_MAX_FILES,\n\tmaxFileSize = DEFAULT_MAX_FILE_SIZE,\n\tcompact = false,\n\tdisabled = false,\n}) => {\n\tconst infoText = generateHelperText(accept, maxFileSize, maxFiles);\n\n\treturn (\n\t\t<ArkUiFileUpload.Root\n\t\t\tstyle={style}\n\t\t\tclassName={classNames(styles.fileUploadRoot, className)}\n\t\t\tmaxFiles={maxFiles}\n\t\t\tmaxFileSize={maxFileSize}\n\t\t\taccept={getMimeTypes(accept)}\n\t\t\tdisabled={disabled}\n\t\t\tallowDrop={!disableDrop}\n\t\t\tacceptedFiles={acceptedFiles}\n\t\t\tonFileAccept={onFileAccept}\n\t\t\tonFileReject={onFileReject}\n\t\t>\n\t\t\t<ArkUiFileUpload.Dropzone\n\t\t\t\tclassName={classNames(styles.dropzone, {\n\t\t\t\t\t[styles.dropzoneCompact]: compact,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<DsIcon icon=\"upload\" className={styles.dropzoneIcon} />\n\t\t\t\t<DsTypography className={styles.dropzoneText} variant=\"body-xs-reg\">\n\t\t\t\t\t{dropzoneText}\n\t\t\t\t</DsTypography>\n\t\t\t\t<ArkUiFileUpload.Trigger asChild>\n\t\t\t\t\t<DsButton design=\"v1.2\" variant=\"ghost\" size=\"small\" disabled={disabled}>\n\t\t\t\t\t\t{triggerText}\n\t\t\t\t\t</DsButton>\n\t\t\t\t</ArkUiFileUpload.Trigger>\n\t\t\t</ArkUiFileUpload.Dropzone>\n\n\t\t\t{infoText && !disabled && !errorText && (\n\t\t\t\t<DsTypography className={styles.infoText} variant=\"body-xs-reg\">\n\t\t\t\t\t{infoText}\n\t\t\t\t</DsTypography>\n\t\t\t)}\n\t\t\t{errorText && (\n\t\t\t\t<DsTypography className={styles.errorText} variant=\"body-xs-reg\">\n\t\t\t\t\t<DsIcon icon=\"error\" size=\"tiny\" />\n\t\t\t\t\t{errorText}\n\t\t\t\t</DsTypography>\n\t\t\t)}\n\n\t\t\t{!!files?.length && (\n\t\t\t\t<div className={styles.fileList}>\n\t\t\t\t\t{files.map((uploadFile) => (\n\t\t\t\t\t\t<FileUploadItem\n\t\t\t\t\t\t\tkey={uploadFile.id}\n\t\t\t\t\t\t\tid={uploadFile.id}\n\t\t\t\t\t\t\tname={uploadFile.name}\n\t\t\t\t\t\t\tprogress={uploadFile.progress}\n\t\t\t\t\t\t\thideProgress={hideProgress}\n\t\t\t\t\t\t\tstatus={uploadFile.status}\n\t\t\t\t\t\t\terrors={uploadFile.errors}\n\t\t\t\t\t\t\tonRemove={onFileRemove}\n\t\t\t\t\t\t\tonDelete={onFileDelete}\n\t\t\t\t\t\t\tonCancel={onFileCancel}\n\t\t\t\t\t\t\tonRetry={onFileRetry}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t<ArkUiFileUpload.HiddenInput />\n\t\t</ArkUiFileUpload.Root>\n\t);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAaE,gBAAwCc,OAAA;CAA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