@sps-woodland/core 8.56.2 → 8.56.3

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 (262) hide show
  1. package/lib/action-bar/action-bar/ActionBar.js +44 -59
  2. package/lib/action-bar/action-bar/ActionBar.ve.js +4 -11
  3. package/lib/action-bar/action-bar-additional-content/ActionBarAdditionalContent.js +14 -22
  4. package/lib/action-bar/index.js +54 -74
  5. package/lib/action-bar/index.umd.cjs +1 -1
  6. package/lib/action-bar/style.css +2 -1
  7. package/lib/add-to-list/add-to-list/AddToList.js +220 -302
  8. package/lib/add-to-list/add-to-list/AddToList.ve.js +79 -24
  9. package/lib/add-to-list/add-to-list/ItemsList.js +42 -67
  10. package/lib/add-to-list/add-to-list/ListItem.js +24 -50
  11. package/lib/add-to-list/index.js +393 -453
  12. package/lib/add-to-list/index.umd.cjs +1 -1
  13. package/lib/add-to-list/style.css +2 -1
  14. package/lib/buttons/button/Button.js +95 -121
  15. package/lib/buttons/button/Button.ve.js +150 -9
  16. package/lib/buttons/index.js +281 -171
  17. package/lib/buttons/index.umd.cjs +1 -1
  18. package/lib/buttons/style.css +2 -1
  19. package/lib/cards/card/Card.js +19 -27
  20. package/lib/cards/card/Card.ve.js +4 -4
  21. package/lib/cards/card-footer/CardFooter.js +12 -13
  22. package/lib/cards/card-footer/CardFooter.ve.js +4 -4
  23. package/lib/cards/card-header/CardHeader.js +12 -13
  24. package/lib/cards/card-header/CardHeader.ve.js +4 -4
  25. package/lib/cards/card-title/CardTitle.js +11 -12
  26. package/lib/cards/card-title/CardTitle.ve.js +4 -4
  27. package/lib/cards/index.js +52 -52
  28. package/lib/cards/index.umd.cjs +1 -1
  29. package/lib/cards/style.css +2 -1
  30. package/lib/column-manager/column-manager/ColumnManager.js +95 -112
  31. package/lib/column-manager/column-manager/useColumnManager.js +59 -48
  32. package/lib/column-manager/index.js +2 -5
  33. package/lib/components/icon/Icon.ve.js +15 -5
  34. package/lib/components/icon/icons/sprite.svg.js +4 -4
  35. package/lib/content-row/content-row/ContentRow.js +146 -173
  36. package/lib/content-row/content-row/ContentRow.ve.js +105 -18
  37. package/lib/content-row/content-row-col/ContentRowCol.js +37 -48
  38. package/lib/content-row/content-row-col/ContentRowCol.ve.js +49 -6
  39. package/lib/content-row/content-row-expansion/ContentRowExpansion.js +16 -24
  40. package/lib/content-row/index.js +407 -318
  41. package/lib/content-row/index.umd.cjs +1 -1
  42. package/lib/content-row/row-list-auto-layout/RowListAutoLayout.js +24 -39
  43. package/lib/content-row/row-list-auto-layout/RowListAutoLayout.ve.js +13 -5
  44. package/lib/content-row/style.css +2 -1
  45. package/lib/content-tiles/content-tile/ContentTile.js +71 -60
  46. package/lib/content-tiles/content-tile/ContentTile.ve.js +36 -14
  47. package/lib/content-tiles/content-tile-list/ContentTileList.js +12 -13
  48. package/lib/content-tiles/content-tile-list/ContentTileList.ve.js +4 -5
  49. package/lib/content-tiles/index.js +156 -118
  50. package/lib/content-tiles/index.umd.cjs +1 -1
  51. package/lib/content-tiles/style.css +2 -1
  52. package/lib/core.css +2 -1
  53. package/lib/dropdowns/dropdown/Dropdown.js +56 -68
  54. package/lib/dropdowns/dropdown/Dropdown.ve.js +37 -8
  55. package/lib/dropdowns/index.js +171 -171
  56. package/lib/dropdowns/index.umd.cjs +1 -1
  57. package/lib/dropdowns/option-list/Option.js +14 -18
  58. package/lib/dropdowns/option-list/Option.ve.js +4 -5
  59. package/lib/dropdowns/option-list/OptionList.js +28 -44
  60. package/lib/dropdowns/option-list/OptionList.ve.js +4 -5
  61. package/lib/dropdowns/style.css +2 -1
  62. package/lib/editable-table/EditableTable.js +68 -85
  63. package/lib/editable-table/index.js +1 -4
  64. package/lib/feedback-block/FeedbackBlock.js +40 -35
  65. package/lib/feedback-block/FeedbackBlock.ve.js +56 -7
  66. package/lib/feedback-block/index.js +132 -85
  67. package/lib/feedback-block/index.umd.cjs +1 -1
  68. package/lib/feedback-block/style.css +2 -1
  69. package/lib/file-upload/file-upload/FileUpload.js +164 -202
  70. package/lib/file-upload/file-upload/FileUpload.ve.js +84 -18
  71. package/lib/file-upload/file-upload/mime-type.enum.js +106 -106
  72. package/lib/file-upload/index.js +390 -353
  73. package/lib/file-upload/index.umd.cjs +1 -1
  74. package/lib/file-upload/style.css +2 -1
  75. package/lib/filter-tiles/filter-tile/FilterTile.js +41 -46
  76. package/lib/filter-tiles/filter-tile/FilterTile.ve.js +51 -9
  77. package/lib/filter-tiles/filter-tile-set/FilterTileSet.js +12 -15
  78. package/lib/filter-tiles/filter-tile-set/FilterTileSet.ve.js +4 -4
  79. package/lib/filter-tiles/index.js +142 -107
  80. package/lib/filter-tiles/index.umd.cjs +1 -1
  81. package/lib/filter-tiles/style.css +2 -1
  82. package/lib/focused-task/focused-task/FocusedTask.js +52 -74
  83. package/lib/focused-task/focused-task/FocusedTask.ve.js +13 -12
  84. package/lib/focused-task/focused-task/useFocusedTask.js +20 -18
  85. package/lib/focused-task/focused-task-actions/FocusedTaskActions.js +12 -13
  86. package/lib/focused-task/index.js +127 -144
  87. package/lib/focused-task/index.umd.cjs +1 -1
  88. package/lib/focused-task/style.css +2 -1
  89. package/lib/growler/Growler.js +78 -90
  90. package/lib/growler/Growler.ve.js +23 -12
  91. package/lib/growler/GrowlerListProvider.js +38 -39
  92. package/lib/growler/Sonner.ve.js +17 -12
  93. package/lib/growler/index.js +249 -274
  94. package/lib/growler/index.umd.cjs +1 -1
  95. package/lib/growler/sonner.js +73 -102
  96. package/lib/growler/style.css +2 -1
  97. package/lib/index.js +520 -501
  98. package/lib/index.umd.cjs +4 -4
  99. package/lib/insight-card/InsightCard.js +90 -84
  100. package/lib/insight-card/InsightCard.ve.js +148 -15
  101. package/lib/insight-card/InsightCardSet.js +12 -12
  102. package/lib/insight-card/index.js +269 -141
  103. package/lib/insight-card/index.umd.cjs +1 -1
  104. package/lib/insight-card/style.css +2 -1
  105. package/lib/key-value-set/index.js +97 -87
  106. package/lib/key-value-set/index.umd.cjs +1 -1
  107. package/lib/key-value-set/key-value-set/KeyValueSet.js +17 -21
  108. package/lib/key-value-set/key-value-set/KeyValueSet.ve.js +10 -5
  109. package/lib/key-value-set/key-value-set-item/KeyValueSetItem.js +25 -21
  110. package/lib/key-value-set/key-value-set-item/KeyValueSetItem.ve.js +13 -6
  111. package/lib/key-value-set/style.css +2 -1
  112. package/lib/list-bar/advanced-search/AdvancedSearch.js +51 -54
  113. package/lib/list-bar/advanced-search/AdvancedSearch.ve.js +30 -8
  114. package/lib/list-bar/index.js +305 -301
  115. package/lib/list-bar/index.umd.cjs +1 -1
  116. package/lib/list-bar/list-bar/InputGroupWrapper.js +10 -19
  117. package/lib/list-bar/list-bar/ListBar.js +105 -121
  118. package/lib/list-bar/list-bar/ListBar.ve.js +13 -17
  119. package/lib/list-bar/list-bar/ListBarSearch.js +20 -21
  120. package/lib/list-bar/list-bar/ListBarSearchInfo.js +8 -12
  121. package/lib/list-bar/list-bar/ListBarSortBy.js +28 -38
  122. package/lib/list-bar/search-results-bar/SearchResultsBar.js +38 -28
  123. package/lib/list-bar/search-results-bar/SearchResultsBar.ve.js +4 -11
  124. package/lib/list-bar/style.css +2 -1
  125. package/lib/matrix/index.js +79 -87
  126. package/lib/matrix/index.umd.cjs +1 -1
  127. package/lib/matrix/matrix/Matrix.js +18 -26
  128. package/lib/matrix/matrix/Matrix.ve.js +4 -7
  129. package/lib/matrix/matrix-body/MatrixBody.js +10 -13
  130. package/lib/matrix/matrix-cell/MatrixCell.js +23 -18
  131. package/lib/matrix/matrix-head/MatrixHead.js +10 -13
  132. package/lib/matrix/matrix-header/MatrixHeader.js +20 -23
  133. package/lib/matrix/matrix-row/MatrixRow.js +10 -13
  134. package/lib/matrix/style.css +2 -1
  135. package/lib/modal/index.js +197 -187
  136. package/lib/modal/index.umd.cjs +1 -1
  137. package/lib/modal/modal/Modal.js +90 -108
  138. package/lib/modal/modal/Modal.ve.js +43 -13
  139. package/lib/modal/modal/useModal.js +19 -24
  140. package/lib/modal/modal-footer/ModalFooter.js +11 -12
  141. package/lib/modal/style.css +2 -1
  142. package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.21.2/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +49 -0
  143. package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/index.browser.js +8 -10
  144. package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/url-alphabet/index.js +4 -4
  145. package/lib/page-title/heading-level/HeadingLevel.js +8 -12
  146. package/lib/page-title/index.js +33 -40
  147. package/lib/page-title/index.umd.cjs +1 -1
  148. package/lib/page-title/page-subtitle/PageSubtitle.js +13 -18
  149. package/lib/page-title/page-subtitle/PageSubtitle.ve.js +4 -5
  150. package/lib/page-title/page-title/PageTitle.js +15 -19
  151. package/lib/page-title/page-title/PageTitle.ve.js +4 -7
  152. package/lib/page-title/style.css +2 -1
  153. package/lib/photo/index.js +174 -177
  154. package/lib/photo/index.umd.cjs +1 -1
  155. package/lib/photo/photo/Photo.js +72 -81
  156. package/lib/photo/photo/Photo.ve.js +21 -7
  157. package/lib/photo/photo-carousel/PhotoCarousel.js +36 -51
  158. package/lib/photo/photo-carousel/PhotoCarousel.ve.js +13 -9
  159. package/lib/photo/style.css +2 -1
  160. package/lib/product-bar/hooks/usePriorityPlus.js +88 -104
  161. package/lib/product-bar/index.js +372 -395
  162. package/lib/product-bar/index.umd.cjs +1 -1
  163. package/lib/product-bar/product-bar/ProductBar.js +77 -103
  164. package/lib/product-bar/product-bar/ProductBar.ve.js +46 -15
  165. package/lib/product-bar/product-bar-name/ProductBarName.js +37 -40
  166. package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.js +48 -70
  167. package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.ve.js +4 -8
  168. package/lib/product-bar/product-bar-tab/ProductBarTab.js +28 -26
  169. package/lib/product-bar/slack-link/SlackLink.js +26 -30
  170. package/lib/product-bar/slack-link/SlackLink.ve.js +4 -5
  171. package/lib/product-bar/style.css +2 -1
  172. package/lib/product-bar-vertical/index.js +240 -251
  173. package/lib/product-bar-vertical/index.umd.cjs +1 -1
  174. package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.js +42 -61
  175. package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.ve.js +53 -23
  176. package/lib/product-bar-vertical/product-bar-vertical-header/ProductBarVerticalHeader.js +30 -42
  177. package/lib/product-bar-vertical/product-bar-vertical-item/ProductBarVerticalItem.js +71 -89
  178. package/lib/product-bar-vertical/product-bar-vertical-section/ProductBarVerticalSection.js +22 -29
  179. package/lib/product-bar-vertical/style.css +2 -1
  180. package/lib/progress-indicators/index.js +372 -255
  181. package/lib/progress-indicators/index.umd.cjs +1 -1
  182. package/lib/progress-indicators/progress-bar/ProgressBar.js +66 -110
  183. package/lib/progress-indicators/progress-bar/ProgressBar.ve.js +66 -13
  184. package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.js +34 -54
  185. package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.ve.js +136 -8
  186. package/lib/progress-indicators/progress-ring/ProgressRing.js +45 -52
  187. package/lib/progress-indicators/style.css +2 -1
  188. package/lib/rich-text-editor/index.js +556 -582
  189. package/lib/rich-text-editor/index.umd.cjs +11 -11
  190. package/lib/rich-text-editor/rich-text-editor/RTELinkModal.js +29 -33
  191. package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.js +23 -37
  192. package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.ve.js +13 -6
  193. package/lib/rich-text-editor/rich-text-editor/RichTextEditor.js +68 -77
  194. package/lib/rich-text-editor/rich-text-editor/RichTextEditor.ve.js +21 -8
  195. package/lib/rich-text-editor/rich-text-editor/hooks/useHtmlToMd.js +14 -20
  196. package/lib/rich-text-editor/rich-text-editor/hooks/useMdToHtml.js +14 -20
  197. package/lib/rich-text-editor/rich-text-editor/hooks/useRTEContent.js +33 -27
  198. package/lib/rich-text-editor/rich-text-editor/hooks/useRTEObserver.js +79 -88
  199. package/lib/rich-text-editor/rich-text-editor/hooks/useRTESelectionListener.js +28 -36
  200. package/lib/rich-text-editor/rich-text-editor/hooks/useRTEToolbarButtons.js +195 -211
  201. package/lib/rich-text-editor/rich-text-editor/icons/BOLD.svg.js +4 -4
  202. package/lib/rich-text-editor/rich-text-editor/icons/INDENT.svg.js +4 -4
  203. package/lib/rich-text-editor/rich-text-editor/icons/ITALICS.svg.js +4 -4
  204. package/lib/rich-text-editor/rich-text-editor/icons/LINK.svg.js +4 -4
  205. package/lib/rich-text-editor/rich-text-editor/icons/ORDERED_LIST.svg.js +4 -4
  206. package/lib/rich-text-editor/rich-text-editor/icons/OUTDENT.svg.js +4 -4
  207. package/lib/rich-text-editor/rich-text-editor/icons/REDO.svg.js +4 -4
  208. package/lib/rich-text-editor/rich-text-editor/icons/UNDO.svg.js +4 -4
  209. package/lib/rich-text-editor/rich-text-editor/icons/UNLINK.svg.js +4 -4
  210. package/lib/rich-text-editor/rich-text-editor/icons/UNORDERED_LIST.svg.js +4 -4
  211. package/lib/rich-text-editor/rich-text-editor/utils/flattenListItemParagraphs.js +12 -12
  212. package/lib/rich-text-editor/rich-text-editor/utils/removeUnrepresentableBreaks.js +20 -19
  213. package/lib/rich-text-editor/rich-text-editor/utils/utils.js +11 -15
  214. package/lib/rich-text-editor/style.css +2 -1
  215. package/lib/scrollable-container/ScrollableContainer.js +18 -27
  216. package/lib/scrollable-container/ScrollableContainer.ve.js +4 -4
  217. package/lib/scrollable-container/index.js +20 -27
  218. package/lib/scrollable-container/index.umd.cjs +1 -1
  219. package/lib/scrollable-container/style.css +2 -1
  220. package/lib/side-nav/index.js +190 -228
  221. package/lib/side-nav/index.umd.cjs +1 -1
  222. package/lib/side-nav/side-nav/SideNav.js +43 -60
  223. package/lib/side-nav/side-nav/SideNav.ve.js +22 -16
  224. package/lib/side-nav/side-nav/navContext.js +7 -7
  225. package/lib/side-nav/side-nav-header/SideNavHeader.js +14 -15
  226. package/lib/side-nav/side-nav-item/SideNavItem.js +68 -94
  227. package/lib/side-nav/side-nav-section/SideNavSection.js +16 -26
  228. package/lib/side-nav/style.css +2 -1
  229. package/lib/sorting-header/caret/caret.ve.js +13 -5
  230. package/lib/sorting-header/index.js +269 -251
  231. package/lib/sorting-header/index.umd.cjs +1 -1
  232. package/lib/sorting-header/sorting-header/SortingHeader.js +110 -124
  233. package/lib/sorting-header/sorting-header/SortingHeader.ve.js +30 -6
  234. package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.js +69 -83
  235. package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.ve.js +21 -7
  236. package/lib/sorting-header/style.css +2 -1
  237. package/lib/style.css +2 -1
  238. package/lib/tabs/index.js +255 -201
  239. package/lib/tabs/index.umd.cjs +1 -1
  240. package/lib/tabs/style.css +2 -1
  241. package/lib/tabs/tab/Tab.js +24 -27
  242. package/lib/tabs/tab/Tab.ve.js +76 -6
  243. package/lib/tabs/tab-panel/TabPanel.js +16 -25
  244. package/lib/tabs/tabs/Tabs.js +101 -112
  245. package/lib/tabs/tabs/Tabs.ve.js +13 -11
  246. package/lib/tags/clickable-tag/ClickableTag.js +86 -90
  247. package/lib/tags/clickable-tag/ClickableTag.ve.js +66 -9
  248. package/lib/tags/index.js +342 -199
  249. package/lib/tags/index.umd.cjs +1 -1
  250. package/lib/tags/split-tag/SplitTag.js +49 -30
  251. package/lib/tags/split-tag/SplitTag.ve.js +35 -9
  252. package/lib/tags/style.css +2 -1
  253. package/lib/tags/tag/Tag.js +42 -38
  254. package/lib/tags/tag/Tag.ve.js +41 -6
  255. package/lib/utils/cl.js +5 -5
  256. package/lib/zero-state/ZeroState.js +36 -29
  257. package/lib/zero-state/ZeroState.ve.js +29 -11
  258. package/lib/zero-state/index.js +103 -78
  259. package/lib/zero-state/index.umd.cjs +1 -1
  260. package/lib/zero-state/style.css +2 -1
  261. package/package.json +12 -12
  262. package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.17.4/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +0 -57
@@ -1,361 +1,398 @@
1
1
  import * as e from "react";
2
- import { Metadata as ve, cl as j, Spinner as he } from "@sps-woodland/core";
3
- import { parseFileSize as ge } from "@spscommerce/utils";
4
- import { Button as B } from "@sps-woodland/core/button";
5
- import { GENERAL_ERROR_LARGE as ke, UPLOAD_LARGE as ye } from "@sps-woodland/illustrations";
6
- import { useWoodlandLanguage as we } from "@spscommerce/i18n";
7
- const W = {
8
- "7Z": ["application/x-7z-compressed"],
9
- AAC: ["audio/aac"],
10
- ABW: ["application/x-abiword"],
11
- ARC: ["application/octet-stream"],
12
- AVI: ["video/x-msvideo"],
13
- AZW: ["application/vnd.amazon.ebook"],
14
- BIN: ["application/octet-stream"],
15
- BMP: ["image/bmp"],
16
- BZ: ["application/x-bzip"],
17
- BZ2: ["application/x-bzip2"],
18
- CER: ["application/pkix-cert", "application/x-x509-ca-cert"],
19
- CSH: ["application/x-csh"],
20
- CSS: ["text/css"],
21
- CSV: ["text/csv", "application/vnd.ms-excel"],
22
- DOC: ["application/msword"],
23
- DOT: ["application/msword"],
24
- DOCX: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
25
- DOTX: ["application/vnd.openxmlformats-officedocument.wordprocessingml.template"],
26
- DOCM: ["application/vnd.ms-word.document.macroEnabled.12"],
27
- DOTM: ["application/vnd.ms-word.template.macroEnabled.12"],
28
- EDI: ["application/edi-x12", "application/edifact"],
29
- EML: [
30
- "application/octet-stream",
31
- "message/rfc822",
32
- "multipart/mixed",
33
- "message/rfc5322",
34
- "message/rfc6532"
35
- ],
36
- EOT: ["application/vnd.ms-fontobject"],
37
- EPUB: ["application/epub+zip"],
38
- ES: ["application/ecmascript"],
39
- FLV: ["video/x-flv"],
40
- GIF: ["image/gif"],
41
- GZ: ["application/x-gzip"],
42
- HTM: ["text/html"],
43
- HTML: ["text/html"],
44
- ICO: ["image/x-icon"],
45
- ICS: ["text/calendar"],
46
- JAR: ["application/java-archive"],
47
- JPEG: ["image/jpeg"],
48
- JPG: ["image/jpeg"],
49
- JS: ["application/javascript"],
50
- JSON: ["application/json"],
51
- M3U: ["audio/x-mpequrl"],
52
- MID: ["audio/midi"],
53
- MIDI: ["audio/midi"],
54
- MOV: ["video/quicktime"],
55
- MP3: ["audio/mpeg3"],
56
- MP4: ["video/mp4"],
57
- MPEG: ["video/mpeg"],
58
- MPKG: ["application/vnd.apple.installer+xml"],
59
- ODP: ["application/vnd.oasis.opendocument.presentation"],
60
- ODS: ["application/vnd.oasis.opendocument.spreadsheet"],
61
- ODT: ["application/vnd.oasis.opendocument.text"],
62
- OGA: ["audio/ogg"],
63
- OGV: ["video/ogg"],
64
- OGX: ["application/ogg"],
65
- OTF: ["font/otf"],
66
- PNG: ["image/png"],
67
- PDF: ["application/pdf"],
68
- POT: ["application/vnd.ms-powerpoint"],
69
- POTM: ["application/vnd.ms-powerpoint.template.macroEnabled.12"],
70
- POTX: ["application/vnd.openxmlformats-officedocument.presentationml.template"],
71
- PPA: ["application/vnd.ms-powerpoint"],
72
- PPAM: ["application/vnd.ms-powerpoint.addin.macroEnabled.12"],
73
- PPS: ["application/vnd.ms-powerpoint"],
74
- PPSM: ["application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],
75
- PPT: ["application/vnd.ms-powerpoint"],
76
- PPTM: ["application/vnd.ms-powerpoint.presentation.macroEnabled.12"],
77
- PPSX: ["application/vnd.openxmlformats-officedocument.presentationml.slideshow"],
78
- PPTX: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
79
- RAR: ["application/x-rar-compressed"],
80
- RTF: ["application/rtf"],
81
- SH: ["application/x-sh"],
82
- SVG: ["image/svg+xml"],
83
- SWF: ["application/x-shockwave-flash"],
84
- TAR: ["application/x-tar"],
85
- TIF: ["image/tiff"],
86
- TIFF: ["image/tiff"],
87
- TS: ["application/typescript"],
88
- TTF: ["font/ttf"],
89
- TXT: ["text/plain"],
90
- VSD: ["application/vnd.visio"],
91
- WAV: ["audio/wav"],
92
- WEBA: ["audio/webm"],
93
- WEBM: ["video/webm"],
94
- WEBP: ["image/webp"],
95
- WOFF: ["font/woff"],
96
- WOFF2: ["font/woff2"],
97
- XHTML: ["application/xhtml+xml"],
98
- XLA: ["application/vnd.ms-excel"],
99
- XLS: ["application/vnd.ms-excel"],
100
- XLSB: ["application/vnd.ms-excel.sheet.binary.macroEnabled.12"],
101
- XLT: ["application/vnd.ms-excel"],
102
- XLAM: ["application/vnd.ms-excel.addin.macroEnabled.12"],
103
- XLSM: ["application/vnd.ms-excel.sheet.macroEnabled.12"],
104
- XLSX: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
105
- XLTM: ["application/vnd.ms-excel.template.macroEnabled.12"],
106
- XLTX: ["application/vnd.openxmlformats-officedocument.spreadsheetml.template"],
107
- XML: ["application/xml"],
108
- XUL: ["application/vnd.mozilla.xul+xml"],
109
- ZIP: ["application/zip"]
2
+ import { Metadata as t, Spinner as n, cl as r } from "@sps-woodland/core";
3
+ import { parseFileSize as i } from "@spscommerce/utils";
4
+ import { Button as a } from "@sps-woodland/core/button";
5
+ import { GENERAL_ERROR_LARGE as o, UPLOAD_LARGE as s } from "@sps-woodland/illustrations";
6
+ import { useWoodlandLanguage as c } from "@spscommerce/i18n";
7
+ //#region src/file-upload/file-upload/mime-type.enum.ts
8
+ var l = {
9
+ "7Z": ["application/x-7z-compressed"],
10
+ AAC: ["audio/aac"],
11
+ ABW: ["application/x-abiword"],
12
+ ARC: ["application/octet-stream"],
13
+ AVI: ["video/x-msvideo"],
14
+ AZW: ["application/vnd.amazon.ebook"],
15
+ BIN: ["application/octet-stream"],
16
+ BMP: ["image/bmp"],
17
+ BZ: ["application/x-bzip"],
18
+ BZ2: ["application/x-bzip2"],
19
+ CER: ["application/pkix-cert", "application/x-x509-ca-cert"],
20
+ CSH: ["application/x-csh"],
21
+ CSS: ["text/css"],
22
+ CSV: ["text/csv", "application/vnd.ms-excel"],
23
+ DOC: ["application/msword"],
24
+ DOT: ["application/msword"],
25
+ DOCX: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
26
+ DOTX: ["application/vnd.openxmlformats-officedocument.wordprocessingml.template"],
27
+ DOCM: ["application/vnd.ms-word.document.macroEnabled.12"],
28
+ DOTM: ["application/vnd.ms-word.template.macroEnabled.12"],
29
+ EDI: ["application/edi-x12", "application/edifact"],
30
+ EML: [
31
+ "application/octet-stream",
32
+ "message/rfc822",
33
+ "multipart/mixed",
34
+ "message/rfc5322",
35
+ "message/rfc6532"
36
+ ],
37
+ EOT: ["application/vnd.ms-fontobject"],
38
+ EPUB: ["application/epub+zip"],
39
+ ES: ["application/ecmascript"],
40
+ FLV: ["video/x-flv"],
41
+ GIF: ["image/gif"],
42
+ GZ: ["application/x-gzip"],
43
+ HTM: ["text/html"],
44
+ HTML: ["text/html"],
45
+ ICO: ["image/x-icon"],
46
+ ICS: ["text/calendar"],
47
+ JAR: ["application/java-archive"],
48
+ JPEG: ["image/jpeg"],
49
+ JPG: ["image/jpeg"],
50
+ JS: ["application/javascript"],
51
+ JSON: ["application/json"],
52
+ M3U: ["audio/x-mpequrl"],
53
+ MID: ["audio/midi"],
54
+ MIDI: ["audio/midi"],
55
+ MOV: ["video/quicktime"],
56
+ MP3: ["audio/mpeg3"],
57
+ MP4: ["video/mp4"],
58
+ MPEG: ["video/mpeg"],
59
+ MPKG: ["application/vnd.apple.installer+xml"],
60
+ ODP: ["application/vnd.oasis.opendocument.presentation"],
61
+ ODS: ["application/vnd.oasis.opendocument.spreadsheet"],
62
+ ODT: ["application/vnd.oasis.opendocument.text"],
63
+ OGA: ["audio/ogg"],
64
+ OGV: ["video/ogg"],
65
+ OGX: ["application/ogg"],
66
+ OTF: ["font/otf"],
67
+ PNG: ["image/png"],
68
+ PDF: ["application/pdf"],
69
+ POT: ["application/vnd.ms-powerpoint"],
70
+ POTM: ["application/vnd.ms-powerpoint.template.macroEnabled.12"],
71
+ POTX: ["application/vnd.openxmlformats-officedocument.presentationml.template"],
72
+ PPA: ["application/vnd.ms-powerpoint"],
73
+ PPAM: ["application/vnd.ms-powerpoint.addin.macroEnabled.12"],
74
+ PPS: ["application/vnd.ms-powerpoint"],
75
+ PPSM: ["application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],
76
+ PPT: ["application/vnd.ms-powerpoint"],
77
+ PPTM: ["application/vnd.ms-powerpoint.presentation.macroEnabled.12"],
78
+ PPSX: ["application/vnd.openxmlformats-officedocument.presentationml.slideshow"],
79
+ PPTX: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
80
+ RAR: ["application/x-rar-compressed"],
81
+ RTF: ["application/rtf"],
82
+ SH: ["application/x-sh"],
83
+ SVG: ["image/svg+xml"],
84
+ SWF: ["application/x-shockwave-flash"],
85
+ TAR: ["application/x-tar"],
86
+ TIF: ["image/tiff"],
87
+ TIFF: ["image/tiff"],
88
+ TS: ["application/typescript"],
89
+ TTF: ["font/ttf"],
90
+ TXT: ["text/plain"],
91
+ VSD: ["application/vnd.visio"],
92
+ WAV: ["audio/wav"],
93
+ WEBA: ["audio/webm"],
94
+ WEBM: ["video/webm"],
95
+ WEBP: ["image/webp"],
96
+ WOFF: ["font/woff"],
97
+ WOFF2: ["font/woff2"],
98
+ XHTML: ["application/xhtml+xml"],
99
+ XLA: ["application/vnd.ms-excel"],
100
+ XLS: ["application/vnd.ms-excel"],
101
+ XLSB: ["application/vnd.ms-excel.sheet.binary.macroEnabled.12"],
102
+ XLT: ["application/vnd.ms-excel"],
103
+ XLAM: ["application/vnd.ms-excel.addin.macroEnabled.12"],
104
+ XLSM: ["application/vnd.ms-excel.sheet.macroEnabled.12"],
105
+ XLSX: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
106
+ XLTM: ["application/vnd.ms-excel.template.macroEnabled.12"],
107
+ XLTX: ["application/vnd.openxmlformats-officedocument.spreadsheetml.template"],
108
+ XML: ["application/xml"],
109
+ XUL: ["application/vnd.mozilla.xul+xml"],
110
+ ZIP: ["application/zip"]
110
111
  };
111
- function Ee(a, n, t) {
112
- return n in a ? Object.defineProperty(a, n, {
113
- value: t,
114
- enumerable: !0,
115
- configurable: !0,
116
- writable: !0
117
- }) : a[n] = t, a;
112
+ //#endregion
113
+ //#region ../../../node_modules/.pnpm/@vanilla-extract+recipes@0.2.5_@vanilla-extract+css@1.21.2/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js
114
+ function u(e, t, n) {
115
+ return t in e ? Object.defineProperty(e, t, {
116
+ value: n,
117
+ enumerable: !0,
118
+ configurable: !0,
119
+ writable: !0
120
+ }) : e[t] = n, e;
118
121
  }
119
- function G(a, n) {
120
- var t = Object.keys(a);
121
- if (Object.getOwnPropertySymbols) {
122
- var l = Object.getOwnPropertySymbols(a);
123
- n && (l = l.filter(function(s) {
124
- return Object.getOwnPropertyDescriptor(a, s).enumerable;
125
- })), t.push.apply(t, l);
126
- }
127
- return t;
122
+ function d(e, t) {
123
+ var n = Object.keys(e);
124
+ if (Object.getOwnPropertySymbols) {
125
+ var r = Object.getOwnPropertySymbols(e);
126
+ t && (r = r.filter(function(t) {
127
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
128
+ })), n.push.apply(n, r);
129
+ }
130
+ return n;
128
131
  }
129
- function Z(a) {
130
- for (var n = 1; n < arguments.length; n++) {
131
- var t = arguments[n] != null ? arguments[n] : {};
132
- n % 2 ? G(Object(t), !0).forEach(function(l) {
133
- Ee(a, l, t[l]);
134
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : G(Object(t)).forEach(function(l) {
135
- Object.defineProperty(a, l, Object.getOwnPropertyDescriptor(t, l));
136
- });
137
- }
138
- return a;
132
+ function f(e) {
133
+ for (var t = 1; t < arguments.length; t++) {
134
+ var n = arguments[t] == null ? {} : arguments[t];
135
+ t % 2 ? d(Object(n), !0).forEach(function(t) {
136
+ u(e, t, n[t]);
137
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : d(Object(n)).forEach(function(t) {
138
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
139
+ });
140
+ }
141
+ return e;
139
142
  }
140
- var xe = (a, n, t) => {
141
- for (var l of Object.keys(a)) {
142
- var s;
143
- if (a[l] !== ((s = n[l]) !== null && s !== void 0 ? s : t[l]))
144
- return !1;
145
- }
146
- return !0;
147
- }, F = (a) => (n) => {
148
- var t = a.defaultClassName, l = Z(Z({}, a.defaultVariants), n);
149
- for (var s in l) {
150
- var m, k = (m = l[s]) !== null && m !== void 0 ? m : a.defaultVariants[s];
151
- if (k != null) {
152
- var p = k;
153
- typeof p == "boolean" && (p = p === !0 ? "true" : "false");
154
- var r = (
155
- // @ts-expect-error
156
- a.variantClassNames[s][p]
157
- );
158
- r && (t += " " + r);
159
- }
160
- }
161
- for (var [x, S] of a.compoundVariants)
162
- xe(x, l, a.defaultVariants) && (t += " " + S);
163
- return t;
164
- }, Oe = F({ defaultClassName: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zk0", variantClassNames: { active: { true: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zk1", false: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zk2" }, mini: { true: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zk3", false: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zk4" }, error: { true: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zk5", false: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zk6" }, shown: { true: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zk7", false: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zk8" }, disabled: { true: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zk9", false: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zka" } }, defaultVariants: { active: !1, mini: !1, error: !1, shown: !0, disabled: !1 }, compoundVariants: [] }), ze = F({ defaultClassName: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkb", variantClassNames: { constrainContentWidth: { true: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkc", false: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkd" }, disabled: { true: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zke", false: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkf" } }, defaultVariants: { constrainContentWidth: !1, disabled: !1 }, compoundVariants: [] }), $ = "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkg", Pe = F({ defaultClassName: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkh", variantClassNames: { mini: { true: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zki", false: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkj" }, error: { true: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkk", false: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkl" }, disabled: { true: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkm", false: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkn" } }, defaultVariants: { mini: !1, error: !1, disabled: !1 }, compoundVariants: [] }), Te = F({ defaultClassName: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zko", variantClassNames: { mini: { true: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkp", false: "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkq" } }, defaultVariants: { mini: !1 }, compoundVariants: [] }), be = "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkr", Fe = "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zks", q = "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkt", H = "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zku", Se = "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkv", Ce = "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkw", De = "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkx", Ue = "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zky", Me = "pkg_sps-woodland_core__family_file-upload__version_8_56_2__hash_17kn1zkz";
165
- function J({ list: a }) {
166
- return /* @__PURE__ */ e.createElement(e.Fragment, null, a.map((n, t) => {
167
- const l = Math.floor(n.length / 2);
168
- return /* @__PURE__ */ e.createElement("div", { className: Fe, key: n }, /* @__PURE__ */ e.createElement("span", { className: q }, n.substring(0, l)), /* @__PURE__ */ e.createElement("div", { className: q }, /* @__PURE__ */ e.createElement("span", null, n.substring(l))), t < a.length - 1 ? "," : "");
169
- }));
143
+ var p = (e, t, n) => {
144
+ for (var r of Object.keys(e)) if (e[r] !== (t[r] ?? n[r])) return !1;
145
+ return !0;
146
+ }, m = (e) => (t) => {
147
+ var n = e.defaultClassName, r = f(f({}, e.defaultVariants), t);
148
+ for (var i in r) {
149
+ var a = r[i] ?? e.defaultVariants[i];
150
+ if (a != null) {
151
+ var o = a;
152
+ typeof o == "boolean" && (o = o === !0 ? "true" : "false");
153
+ var s = e.variantClassNames[i][o];
154
+ s && (n += " " + s);
155
+ }
156
+ }
157
+ for (var [c, l] of e.compoundVariants) p(c, r, e.defaultVariants) && (n += " " + l);
158
+ return n;
159
+ }, h = m({
160
+ defaultClassName: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zk0",
161
+ variantClassNames: {
162
+ active: {
163
+ true: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zk1",
164
+ false: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zk2"
165
+ },
166
+ mini: {
167
+ true: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zk3",
168
+ false: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zk4"
169
+ },
170
+ error: {
171
+ true: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zk5",
172
+ false: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zk6"
173
+ },
174
+ shown: {
175
+ true: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zk7",
176
+ false: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zk8"
177
+ },
178
+ disabled: {
179
+ true: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zk9",
180
+ false: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zka"
181
+ }
182
+ },
183
+ defaultVariants: {
184
+ active: !1,
185
+ mini: !1,
186
+ error: !1,
187
+ shown: !0,
188
+ disabled: !1
189
+ },
190
+ compoundVariants: []
191
+ }), g = m({
192
+ defaultClassName: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkb",
193
+ variantClassNames: {
194
+ constrainContentWidth: {
195
+ true: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkc",
196
+ false: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkd"
197
+ },
198
+ disabled: {
199
+ true: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zke",
200
+ false: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkf"
201
+ }
202
+ },
203
+ defaultVariants: {
204
+ constrainContentWidth: !1,
205
+ disabled: !1
206
+ },
207
+ compoundVariants: []
208
+ }), _ = "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkg", ee = m({
209
+ defaultClassName: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkh",
210
+ variantClassNames: {
211
+ mini: {
212
+ true: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zki",
213
+ false: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkj"
214
+ },
215
+ error: {
216
+ true: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkk",
217
+ false: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkl"
218
+ },
219
+ disabled: {
220
+ true: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkm",
221
+ false: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkn"
222
+ }
223
+ },
224
+ defaultVariants: {
225
+ mini: !1,
226
+ error: !1,
227
+ disabled: !1
228
+ },
229
+ compoundVariants: []
230
+ }), te = m({
231
+ defaultClassName: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zko",
232
+ variantClassNames: { mini: {
233
+ true: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkp",
234
+ false: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkq"
235
+ } },
236
+ defaultVariants: { mini: !1 },
237
+ compoundVariants: []
238
+ }), v = "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkr", y = "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zks", b = "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkt", x = "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkv", S = "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zky", ne = "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkz";
239
+ //#endregion
240
+ //#region src/file-upload/file-upload/FileUpload.tsx
241
+ function C({ list: t }) {
242
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, t.map((n, r) => {
243
+ let i = Math.floor(n.length / 2);
244
+ return /* @__PURE__ */ e.createElement("div", {
245
+ className: y,
246
+ key: n
247
+ }, /* @__PURE__ */ e.createElement("span", { className: b }, n.substring(0, i)), /* @__PURE__ */ e.createElement("div", { className: b }, /* @__PURE__ */ e.createElement("span", null, n.substring(i))), r < t.length - 1 ? "," : "");
248
+ }));
170
249
  }
171
- function Le({
172
- constrainContentWidth: a,
173
- description: n,
174
- multiple: t = !1,
175
- dismissable: l,
176
- processing: s,
177
- mini: m,
178
- downloadLabel: k,
179
- acceptExtensions: p,
180
- maxSize: r,
181
- customRequirement: x,
182
- onSelection: S,
183
- onDismiss: U,
184
- download: M,
185
- shown: O,
186
- className: K,
187
- disabled: _,
188
- children: Ae,
189
- ...Q
190
- }) {
191
- const z = e.useRef(/* @__PURE__ */ new Set()), C = e.useRef(/* @__PURE__ */ new Set()), [Y, L] = e.useState(O), [Ve, ee] = e.useState([]), [ae, oe] = e.useState(""), [A, te] = e.useState(), [le, P] = e.useState(!1), [y, T] = e.useState(!1), [u, V] = e.useState([]), [v, N] = e.useState([]), [w, ne] = e.useState(""), X = e.useMemo(
192
- () => (
193
- // use Set to dedupe as the same file might be on both lists
194
- (/* @__PURE__ */ new Set([...u, ...v])).size
195
- ),
196
- [u, v]
197
- ), { t: c } = we(), b = (t ? c("fileUpload.instructions.other", {
198
- defaultValue: "Drag and drop your files here or |browse for files| on your desktop."
199
- }) : c("fileUpload.instructions.one", {
200
- defaultValue: "Drag and drop your file here or |browse for a file| on your desktop."
201
- })).split("|"), I = n || (t ? "Files" : "File"), d = e.useRef(null);
202
- e.useEffect(() => {
203
- O && L(O);
204
- }, [O]), e.useEffect(() => {
205
- r && re(r);
206
- }, [r]), e.useEffect(() => {
207
- p && se(p);
208
- }, [p]);
209
- function ie() {
210
- l && (L(!1), U && U());
211
- }
212
- function re(o) {
213
- try {
214
- te(ge(o));
215
- } catch {
216
- throw new Error(`Could not parse "${o}" as a file size.`);
217
- }
218
- }
219
- function se(o) {
220
- const h = (Array.isArray(o) ? o : o.trim().split(/\s?,\s?/)).map((i) => i.replace(/^\./, "")), f = h.map((i) => `.${i}`.toLowerCase());
221
- ne(
222
- f.map((i, g) => g > 0 && g === f.length - 1 ? `or ${i}` : i).join(f.length > 2 ? ", " : " ")
223
- ), z.current.clear(), C.current.clear();
224
- for (const i of h) {
225
- C.current.add(i.toLowerCase());
226
- const g = Object.keys(W).includes(i.toUpperCase()) ? W[i.toUpperCase()] : [];
227
- for (const D of g)
228
- z.current.add(D);
229
- }
230
- oe(f.concat(Array.from(z.current)).join(","));
231
- }
232
- function R(o) {
233
- V([]), N([]);
234
- const E = [], h = [], f = o ? Array.from(o) : [];
235
- for (const i of f) {
236
- const g = i.name.split(".").pop()?.toLowerCase() ?? "", D = i.type ? z.current.has(i.type) : C.current.has(g);
237
- p && !D && h.push(i.name), r && A && i.size > A && E.push(i.name);
238
- }
239
- E.length || h.length ? (T(!0), d.current && d.current.value && (d.current.value = "")) : (ee(f), S(f)), V(E), N(h);
240
- }
241
- function pe(o) {
242
- o.preventDefault(), T(!1), d.current && d.current.click();
243
- }
244
- function _e() {
245
- M && M();
246
- }
247
- function ce(o) {
248
- o.stopPropagation(), R(o.target.files), d.current && d.current.value && (d.current.value = "");
249
- }
250
- function de(o) {
251
- o.preventDefault(), o.stopPropagation(), P(!0), T(!1);
252
- }
253
- function fe(o) {
254
- o.preventDefault(), P(!0), T(!1);
255
- }
256
- function me(o) {
257
- o.preventDefault(), P(!1);
258
- }
259
- function ue(o) {
260
- o.preventDefault(), o.stopPropagation(), P(!1), o.dataTransfer.files && R(o.dataTransfer.files);
261
- }
262
- return /* @__PURE__ */ e.createElement(
263
- "div",
264
- {
265
- onDrop: _ ? () => {
266
- } : ue,
267
- onDragOver: _ ? () => {
268
- } : de,
269
- onDragLeave: _ ? () => {
270
- } : me,
271
- onDragEnter: _ ? () => {
272
- } : fe,
273
- className: j(Oe({ active: le, mini: m, error: y, shown: Y, disabled: _ }), K),
274
- ...Q
275
- },
276
- /* @__PURE__ */ e.createElement("div", { className: j(ze({ constrainContentWidth: a, disabled: _ })) }, s ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(he, { size: "md", "aria-hidden": "true" }), /* @__PURE__ */ e.createElement("div", { className: $ }, c("fileUpload.processing", { defaultValue: "Processing Upload..." }))) : /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("div", { className: Pe({ mini: m, error: y, disabled: _ }), "aria-hidden": "true" }, /* @__PURE__ */ e.createElement(
277
- "img",
278
- {
279
- className: Me,
280
- src: y ? ke : ye,
281
- alt: "Upload Icon"
282
- }
283
- )), /* @__PURE__ */ e.createElement("div", { className: Te({ mini: m }) }, y ? /* @__PURE__ */ e.createElement("div", null, c(
284
- X > 1 ? "fileUpload.cancelled.other" : "fileUpload.cancelled.one",
285
- {
286
- defaultValue: X > 1 ? "File Upload(s) Failed" : "File Upload Failed"
287
- }
288
- )) : /* @__PURE__ */ e.createElement("div", null, c("fileUpload.title", {
289
- description: I,
290
- defaultValue: `Upload your ${I}`
291
- }))), y ? /* @__PURE__ */ e.createElement("div", { className: be }, u.length > 0 && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(J, { list: u }), /* @__PURE__ */ e.createElement("div", { className: H }, c(
292
- u.length === 1 ? "fileUpload.error.tooLarge.one" : "fileUpload.error.tooLarge.other",
293
- {
294
- size: r,
295
- defaultValue: u.length === 1 ? `Selected file is larger than the size limit of ${r}.` : `Selected files are larger than the size limit of ${r}.`
296
- }
297
- ))), v.length > 0 && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(J, { list: v }), /* @__PURE__ */ e.createElement("div", { className: H }, c(
298
- v.length === 1 ? "fileUpload.error.wrongType.one" : "fileUpload.error.wrongType.other",
299
- {
300
- fileTypes: w,
301
- defaultValue: v.length === 1 ? `Selected file is not an accepted file type: ${w}.` : `Selected files are not accepted file types: ${w}.`
302
- }
303
- )))) : /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("div", { className: $ }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("span", null, b[0]), _ ? /* @__PURE__ */ e.createElement("u", null, b[1]) : /* @__PURE__ */ e.createElement("a", { href: "", onClick: pe }, b[1]), /* @__PURE__ */ e.createElement("span", null, b[2]))), /* @__PURE__ */ e.createElement("div", { className: Se }, p ? /* @__PURE__ */ e.createElement("span", null, "(", " ", c("fileUpload.acceptedTypes", {
304
- fileTypes: w,
305
- defaultValue: `${w} format accepted`
306
- }), " ", ")") : "", r ? /* @__PURE__ */ e.createElement("span", null, "(", " ", c("fileUpload.maximumSize", {
307
- size: r,
308
- defaultValue: `${r} maximum`
309
- }), " ", ")") : "", x ? /* @__PURE__ */ e.createElement("span", null, " ", x, " ") : ""), k && /* @__PURE__ */ e.createElement("div", { className: Ce }, /* @__PURE__ */ e.createElement(
310
- B,
311
- {
312
- disabled: _,
313
- kind: "link",
314
- icon: "download-cloud",
315
- onClick: _e
316
- },
317
- k
318
- )))),
319
- l && !s && /* @__PURE__ */ e.createElement("div", { className: De }, /* @__PURE__ */ e.createElement(
320
- B,
321
- {
322
- disabled: _,
323
- kind: "icon",
324
- icon: "x",
325
- title: c("fileUpload.close", { defaultValue: "Close" }),
326
- onClick: ie
327
- }
328
- )),
329
- /* @__PURE__ */ e.createElement("form", { className: Ue }, /* @__PURE__ */ e.createElement(
330
- "input",
331
- {
332
- ref: d,
333
- type: "file",
334
- accept: ae || "*/*",
335
- multiple: t || void 0,
336
- onChange: ce
337
- }
338
- ))
339
- );
250
+ function w({ constrainContentWidth: t, description: u, multiple: d = !1, dismissable: f, processing: p, mini: m, downloadLabel: y, acceptExtensions: b, maxSize: w, customRequirement: T, onSelection: E, onDismiss: D, download: O, shown: k, className: A, disabled: j, children: re, ...ie }) {
251
+ let M = e.useRef(/* @__PURE__ */ new Set()), N = e.useRef(/* @__PURE__ */ new Set()), [ae, P] = e.useState(k), [oe, se] = e.useState([]), [ce, F] = e.useState(""), [I, L] = e.useState(), [R, z] = e.useState(!1), [B, V] = e.useState(!1), [H, U] = e.useState([]), [W, G] = e.useState([]), [K, le] = e.useState(""), q = e.useMemo(() => (/* @__PURE__ */ new Set([...H, ...W])).size, [H, W]), { t: J } = c(), Y = (d ? J("fileUpload.instructions.other", { defaultValue: "Drag and drop your files here or |browse for files| on your desktop." }) : J("fileUpload.instructions.one", { defaultValue: "Drag and drop your file here or |browse for a file| on your desktop." })).split("|"), X = u || (d ? "Files" : "File"), Z = e.useRef(null);
252
+ e.useEffect(() => {
253
+ k && P(k);
254
+ }, [k]), e.useEffect(() => {
255
+ w && de(w);
256
+ }, [w]), e.useEffect(() => {
257
+ b && fe(b);
258
+ }, [b]);
259
+ function ue() {
260
+ f && (P(!1), D && D());
261
+ }
262
+ function de(e) {
263
+ try {
264
+ L(i(e));
265
+ } catch {
266
+ throw Error(`Could not parse "${e}" as a file size.`);
267
+ }
268
+ }
269
+ function fe(e) {
270
+ let t = (Array.isArray(e) ? e : e.trim().split(/\s?,\s?/)).map((e) => e.replace(/^\./, "")), n = t.map((e) => `.${e}`.toLowerCase());
271
+ le(n.map((e, t) => t > 0 && t === n.length - 1 ? `or ${e}` : e).join(n.length > 2 ? ", " : " ")), M.current.clear(), N.current.clear();
272
+ for (let e of t) {
273
+ N.current.add(e.toLowerCase());
274
+ let t = Object.keys(l).includes(e.toUpperCase()) ? l[e.toUpperCase()] : [];
275
+ for (let e of t) M.current.add(e);
276
+ }
277
+ F(n.concat(Array.from(M.current)).join(","));
278
+ }
279
+ function Q(e) {
280
+ U([]), G([]);
281
+ let t = [], n = [], r = e ? Array.from(e) : [];
282
+ for (let e of r) {
283
+ let r = e.name.split(".").pop()?.toLowerCase() ?? "", i = e.type ? M.current.has(e.type) : N.current.has(r);
284
+ b && !i && n.push(e.name), w && I && e.size > I && t.push(e.name);
285
+ }
286
+ t.length || n.length ? (V(!0), Z.current && Z.current.value && (Z.current.value = "")) : (se(r), E(r)), U(t), G(n);
287
+ }
288
+ function pe(e) {
289
+ e.preventDefault(), V(!1), Z.current && Z.current.click();
290
+ }
291
+ function $() {
292
+ O && O();
293
+ }
294
+ function me(e) {
295
+ e.stopPropagation(), Q(e.target.files), Z.current && Z.current.value && (Z.current.value = "");
296
+ }
297
+ function he(e) {
298
+ e.preventDefault(), e.stopPropagation(), z(!0), V(!1);
299
+ }
300
+ function ge(e) {
301
+ e.preventDefault(), z(!0), V(!1);
302
+ }
303
+ function _e(e) {
304
+ e.preventDefault(), z(!1);
305
+ }
306
+ function ve(e) {
307
+ e.preventDefault(), e.stopPropagation(), z(!1), e.dataTransfer.files && Q(e.dataTransfer.files);
308
+ }
309
+ return /* @__PURE__ */ e.createElement("div", {
310
+ onDrop: j ? () => {} : ve,
311
+ onDragOver: j ? () => {} : he,
312
+ onDragLeave: j ? () => {} : _e,
313
+ onDragEnter: j ? () => {} : ge,
314
+ className: r(h({
315
+ active: R,
316
+ mini: m,
317
+ error: B,
318
+ shown: ae,
319
+ disabled: j
320
+ }), A),
321
+ ...ie
322
+ }, /* @__PURE__ */ e.createElement("div", { className: r(g({
323
+ constrainContentWidth: t,
324
+ disabled: j
325
+ })) }, p ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(n, {
326
+ size: "md",
327
+ "aria-hidden": "true"
328
+ }), /* @__PURE__ */ e.createElement("div", { className: _ }, J("fileUpload.processing", { defaultValue: "Processing Upload..." }))) : /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("div", {
329
+ className: ee({
330
+ mini: m,
331
+ error: B,
332
+ disabled: j
333
+ }),
334
+ "aria-hidden": "true"
335
+ }, /* @__PURE__ */ e.createElement("img", {
336
+ className: ne,
337
+ src: B ? o : s,
338
+ alt: "Upload Icon"
339
+ })), /* @__PURE__ */ e.createElement("div", { className: te({ mini: m }) }, B ? /* @__PURE__ */ e.createElement("div", null, J(q > 1 ? "fileUpload.cancelled.other" : "fileUpload.cancelled.one", { defaultValue: q > 1 ? "File Upload(s) Failed" : "File Upload Failed" })) : /* @__PURE__ */ e.createElement("div", null, J("fileUpload.title", {
340
+ description: X,
341
+ defaultValue: `Upload your ${X}`
342
+ }))), B ? /* @__PURE__ */ e.createElement("div", { className: v }, H.length > 0 && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(C, { list: H }), /* @__PURE__ */ e.createElement("div", { className: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zku" }, J(H.length === 1 ? "fileUpload.error.tooLarge.one" : "fileUpload.error.tooLarge.other", {
343
+ size: w,
344
+ defaultValue: H.length === 1 ? `Selected file is larger than the size limit of ${w}.` : `Selected files are larger than the size limit of ${w}.`
345
+ }))), W.length > 0 && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(C, { list: W }), /* @__PURE__ */ e.createElement("div", { className: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zku" }, J(W.length === 1 ? "fileUpload.error.wrongType.one" : "fileUpload.error.wrongType.other", {
346
+ fileTypes: K,
347
+ defaultValue: W.length === 1 ? `Selected file is not an accepted file type: ${K}.` : `Selected files are not accepted file types: ${K}.`
348
+ })))) : /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("div", { className: _ }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("span", null, Y[0]), j ? /* @__PURE__ */ e.createElement("u", null, Y[1]) : /* @__PURE__ */ e.createElement("a", {
349
+ href: "",
350
+ onClick: pe
351
+ }, Y[1]), /* @__PURE__ */ e.createElement("span", null, Y[2]))), /* @__PURE__ */ e.createElement("div", { className: x }, b ? /* @__PURE__ */ e.createElement("span", null, "(", " ", J("fileUpload.acceptedTypes", {
352
+ fileTypes: K,
353
+ defaultValue: `${K} format accepted`
354
+ }), " ", ")") : "", w ? /* @__PURE__ */ e.createElement("span", null, "(", " ", J("fileUpload.maximumSize", {
355
+ size: w,
356
+ defaultValue: `${w} maximum`
357
+ }), " ", ")") : "", T ? /* @__PURE__ */ e.createElement("span", null, " ", T, " ") : ""), y && /* @__PURE__ */ e.createElement("div", { className: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkw" }, /* @__PURE__ */ e.createElement(a, {
358
+ disabled: j,
359
+ kind: "link",
360
+ icon: "download-cloud",
361
+ onClick: $
362
+ }, y)))), f && !p && /* @__PURE__ */ e.createElement("div", { className: "pkg_sps-woodland_core__family_file-upload__version_8_56_3__hash_17kn1zkx" }, /* @__PURE__ */ e.createElement(a, {
363
+ disabled: j,
364
+ kind: "icon",
365
+ icon: "x",
366
+ title: J("fileUpload.close", { defaultValue: "Close" }),
367
+ onClick: ue
368
+ })), /* @__PURE__ */ e.createElement("form", { className: S }, /* @__PURE__ */ e.createElement("input", {
369
+ ref: Z,
370
+ type: "file",
371
+ accept: ce || "*/*",
372
+ multiple: d || void 0,
373
+ onChange: me
374
+ })));
340
375
  }
341
- ve.set(Le, {
342
- name: "FileUpload",
343
- props: {
344
- constrainContentWidth: { type: "boolean" },
345
- description: { type: "string" },
346
- multiple: { type: "boolean" },
347
- dismissable: { type: "boolean" },
348
- mini: { type: "boolean" },
349
- downloadLabel: { type: "string" },
350
- acceptExtensions: { type: "string[] | string" },
351
- maxSize: { type: "string" },
352
- customRequirement: { type: "string" },
353
- onSelection: { type: "(files: File[]) => void", required: !0 },
354
- dismissal: { type: "() => void" },
355
- download: { type: "() => void" },
356
- disabled: { type: "boolean" }
357
- }
376
+ t.set(w, {
377
+ name: "FileUpload",
378
+ props: {
379
+ constrainContentWidth: { type: "boolean" },
380
+ description: { type: "string" },
381
+ multiple: { type: "boolean" },
382
+ dismissable: { type: "boolean" },
383
+ mini: { type: "boolean" },
384
+ downloadLabel: { type: "string" },
385
+ acceptExtensions: { type: "string[] | string" },
386
+ maxSize: { type: "string" },
387
+ customRequirement: { type: "string" },
388
+ onSelection: {
389
+ type: "(files: File[]) => void",
390
+ required: !0
391
+ },
392
+ dismissal: { type: "() => void" },
393
+ download: { type: "() => void" },
394
+ disabled: { type: "boolean" }
395
+ }
358
396
  });
359
- export {
360
- Le as FileUpload
361
- };
397
+ //#endregion
398
+ export { w as FileUpload };