@alma-oss/spirit-web-react 4.4.2 → 4.5.0

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 (417) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/DEPRECATIONS.md +2 -2
  3. package/README.md +135 -6
  4. package/dist/bundles/web-react.umd.js +1731 -624
  5. package/dist/bundles/web-react.umd.js.map +1 -1
  6. package/dist/bundles/web-react.umd.min.js +1 -1
  7. package/dist/bundles/web-react.umd.min.js.map +1 -1
  8. package/dist/components/Button/Button.cjs +1 -1
  9. package/dist/components/Button/Button.cjs.map +1 -1
  10. package/dist/components/Button/Button.js +19 -19
  11. package/dist/components/Button/Button.js.map +1 -1
  12. package/dist/components/ButtonLink/ButtonLink.cjs +1 -1
  13. package/dist/components/ButtonLink/ButtonLink.cjs.map +1 -1
  14. package/dist/components/ButtonLink/ButtonLink.d.ts +2 -2
  15. package/dist/components/ButtonLink/ButtonLink.js +23 -18
  16. package/dist/components/ButtonLink/ButtonLink.js.map +1 -1
  17. package/dist/components/ButtonLink/useButtonLinkStyleProps.cjs.map +1 -1
  18. package/dist/components/ButtonLink/useButtonLinkStyleProps.d.ts +9 -9
  19. package/dist/components/ButtonLink/useButtonLinkStyleProps.js.map +1 -1
  20. package/dist/components/Card/CardLink.cjs +1 -1
  21. package/dist/components/Card/CardLink.cjs.map +1 -1
  22. package/dist/components/Card/CardLink.d.ts +2 -2
  23. package/dist/components/Card/CardLink.js +10 -15
  24. package/dist/components/Card/CardLink.js.map +1 -1
  25. package/dist/components/CharacterCounter/CharacterCounter.cjs +2 -0
  26. package/dist/components/CharacterCounter/CharacterCounter.cjs.map +1 -0
  27. package/dist/components/CharacterCounter/CharacterCounter.d.ts +7 -0
  28. package/dist/components/CharacterCounter/CharacterCounter.js +23 -0
  29. package/dist/components/CharacterCounter/CharacterCounter.js.map +1 -0
  30. package/dist/components/CharacterCounter/constants.cjs +2 -0
  31. package/dist/components/CharacterCounter/constants.cjs.map +1 -0
  32. package/dist/components/CharacterCounter/constants.d.ts +1 -0
  33. package/dist/components/CharacterCounter/constants.js +5 -0
  34. package/dist/components/CharacterCounter/constants.js.map +1 -0
  35. package/dist/components/CharacterCounter/index.cjs +2 -0
  36. package/dist/components/CharacterCounter/index.d.ts +3 -0
  37. package/dist/components/CharacterCounter/index.js +7 -0
  38. package/dist/components/{UNSTABLE_Attachment → CharacterCounter}/index.js.map +1 -1
  39. package/dist/components/CharacterCounter/types.d.ts +6 -0
  40. package/dist/components/CharacterCounter/useCharacterCounterState.cjs +2 -0
  41. package/dist/components/CharacterCounter/useCharacterCounterState.cjs.map +1 -0
  42. package/dist/components/CharacterCounter/useCharacterCounterState.d.ts +25 -0
  43. package/dist/components/CharacterCounter/useCharacterCounterState.js +66 -0
  44. package/dist/components/CharacterCounter/useCharacterCounterState.js.map +1 -0
  45. package/dist/components/CharacterCounter.d.ts +2 -0
  46. package/dist/components/Checkbox/Checkbox.cjs +1 -1
  47. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  48. package/dist/components/Checkbox/Checkbox.js +58 -54
  49. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  50. package/dist/components/ControlButton/useControlButtonStyleProps.cjs.map +1 -1
  51. package/dist/components/ControlButton/useControlButtonStyleProps.js.map +1 -1
  52. package/dist/components/Dropdown/DropdownPopover.cjs.map +1 -1
  53. package/dist/components/Dropdown/DropdownPopover.d.ts +2 -2
  54. package/dist/components/Dropdown/DropdownPopover.js.map +1 -1
  55. package/dist/components/Field/index.cjs +1 -1
  56. package/dist/components/Field/index.d.ts +0 -2
  57. package/dist/components/Field/index.js +2 -4
  58. package/dist/components/Field/index.js.map +1 -1
  59. package/dist/components/Field/types.d.ts +1 -1
  60. package/dist/components/FieldGroup/FieldGroup.cjs +1 -1
  61. package/dist/components/FieldGroup/FieldGroup.cjs.map +1 -1
  62. package/dist/components/FieldGroup/FieldGroup.js +15 -16
  63. package/dist/components/FieldGroup/FieldGroup.js.map +1 -1
  64. package/dist/components/FileUploader/FileUploaderInput.cjs +1 -1
  65. package/dist/components/FileUploader/FileUploaderInput.cjs.map +1 -1
  66. package/dist/components/FileUploader/FileUploaderInput.js +36 -35
  67. package/dist/components/FileUploader/FileUploaderInput.js.map +1 -1
  68. package/dist/components/Header/HeaderDialogLink.cjs +1 -1
  69. package/dist/components/Header/HeaderDialogLink.cjs.map +1 -1
  70. package/dist/components/Header/HeaderDialogLink.js +18 -17
  71. package/dist/components/Header/HeaderDialogLink.js.map +1 -1
  72. package/dist/components/Header/HeaderLink.cjs +1 -1
  73. package/dist/components/Header/HeaderLink.cjs.map +1 -1
  74. package/dist/components/Header/HeaderLink.js +16 -15
  75. package/dist/components/Header/HeaderLink.js.map +1 -1
  76. package/dist/components/InputDetails/InputDetails.cjs +2 -0
  77. package/dist/components/InputDetails/InputDetails.cjs.map +1 -0
  78. package/dist/components/InputDetails/InputDetails.d.ts +7 -0
  79. package/dist/components/InputDetails/InputDetails.js +21 -0
  80. package/dist/components/InputDetails/InputDetails.js.map +1 -0
  81. package/dist/components/InputDetails/index.cjs +2 -0
  82. package/dist/components/InputDetails/index.cjs.map +1 -0
  83. package/dist/components/InputDetails/index.d.ts +2 -0
  84. package/dist/components/InputDetails/index.js +7 -0
  85. package/dist/components/InputDetails/index.js.map +1 -0
  86. package/dist/components/InputDetails/useInputDetailsStyleProps.cjs +2 -0
  87. package/dist/components/InputDetails/useInputDetailsStyleProps.cjs.map +1 -0
  88. package/dist/components/InputDetails/useInputDetailsStyleProps.d.ts +7 -0
  89. package/dist/components/InputDetails/useInputDetailsStyleProps.js +11 -0
  90. package/dist/components/InputDetails/useInputDetailsStyleProps.js.map +1 -0
  91. package/dist/components/InputDetails.d.ts +2 -0
  92. package/dist/components/Link/Link.cjs +1 -1
  93. package/dist/components/Link/Link.cjs.map +1 -1
  94. package/dist/components/Link/Link.js +10 -9
  95. package/dist/components/Link/Link.js.map +1 -1
  96. package/dist/components/Link/useLinkStyleProps.cjs.map +1 -1
  97. package/dist/components/Link/useLinkStyleProps.d.ts +1 -1
  98. package/dist/components/Link/useLinkStyleProps.js.map +1 -1
  99. package/dist/components/Pagination/PaginationLink.cjs +1 -1
  100. package/dist/components/Pagination/PaginationLink.cjs.map +1 -1
  101. package/dist/components/Pagination/PaginationLink.js +29 -18
  102. package/dist/components/Pagination/PaginationLink.js.map +1 -1
  103. package/dist/components/Radio/Radio.cjs +1 -1
  104. package/dist/components/Radio/Radio.cjs.map +1 -1
  105. package/dist/components/Radio/Radio.js +24 -25
  106. package/dist/components/Radio/Radio.js.map +1 -1
  107. package/dist/components/ScrollView/useScrollPosition.js +4 -4
  108. package/dist/components/Select/Select.cjs +1 -1
  109. package/dist/components/Select/Select.cjs.map +1 -1
  110. package/dist/components/Select/Select.js +28 -29
  111. package/dist/components/Select/Select.js.map +1 -1
  112. package/dist/components/Slider/Slider.cjs +1 -1
  113. package/dist/components/Slider/Slider.cjs.map +1 -1
  114. package/dist/components/Slider/Slider.js +23 -24
  115. package/dist/components/Slider/Slider.js.map +1 -1
  116. package/dist/components/Tabs/TabLink.cjs +1 -1
  117. package/dist/components/Tabs/TabLink.cjs.map +1 -1
  118. package/dist/components/Tabs/TabLink.js +18 -17
  119. package/dist/components/Tabs/TabLink.js.map +1 -1
  120. package/dist/components/Tag/constants.cjs +1 -1
  121. package/dist/components/Tag/constants.cjs.map +1 -1
  122. package/dist/components/Tag/constants.d.ts +1 -0
  123. package/dist/components/Tag/constants.js +4 -3
  124. package/dist/components/Tag/constants.js.map +1 -1
  125. package/dist/components/Tag/useTagStyleProps.cjs +1 -1
  126. package/dist/components/Tag/useTagStyleProps.cjs.map +1 -1
  127. package/dist/components/Tag/useTagStyleProps.js +25 -10
  128. package/dist/components/Tag/useTagStyleProps.js.map +1 -1
  129. package/dist/components/TextArea/TextArea.cjs +1 -1
  130. package/dist/components/TextArea/TextArea.cjs.map +1 -1
  131. package/dist/components/TextArea/TextArea.js +57 -21
  132. package/dist/components/TextArea/TextArea.js.map +1 -1
  133. package/dist/components/TextArea/constants.cjs +2 -0
  134. package/dist/components/TextArea/constants.cjs.map +1 -0
  135. package/dist/components/TextArea/constants.d.ts +1 -0
  136. package/dist/components/TextArea/constants.js +5 -0
  137. package/dist/components/TextArea/constants.js.map +1 -0
  138. package/dist/components/TextFieldBase/TextFieldBase.cjs +1 -1
  139. package/dist/components/TextFieldBase/TextFieldBase.cjs.map +1 -1
  140. package/dist/components/TextFieldBase/TextFieldBase.js +69 -59
  141. package/dist/components/TextFieldBase/TextFieldBase.js.map +1 -1
  142. package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.cjs +1 -1
  143. package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.cjs.map +1 -1
  144. package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.d.ts +1 -0
  145. package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.js +11 -10
  146. package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.js.map +1 -1
  147. package/dist/components/Toggle/Toggle.cjs +1 -1
  148. package/dist/components/Toggle/Toggle.cjs.map +1 -1
  149. package/dist/components/Toggle/Toggle.js +59 -55
  150. package/dist/components/Toggle/Toggle.js.map +1 -1
  151. package/dist/components/UNSTABLE_File/UNSTABLE_File.cjs +2 -0
  152. package/dist/components/UNSTABLE_File/UNSTABLE_File.cjs.map +1 -0
  153. package/dist/components/UNSTABLE_File/UNSTABLE_File.d.ts +8 -0
  154. package/dist/components/UNSTABLE_File/UNSTABLE_File.js +88 -0
  155. package/dist/components/UNSTABLE_File/UNSTABLE_File.js.map +1 -0
  156. package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.cjs +2 -0
  157. package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.cjs.map +1 -0
  158. package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.d.ts +8 -0
  159. package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.js +29 -0
  160. package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.js.map +1 -0
  161. package/dist/components/UNSTABLE_File/constants.cjs +2 -0
  162. package/dist/components/UNSTABLE_File/constants.cjs.map +1 -0
  163. package/dist/components/UNSTABLE_File/constants.d.ts +9 -0
  164. package/dist/components/UNSTABLE_File/constants.js +13 -0
  165. package/dist/components/UNSTABLE_File/constants.js.map +1 -0
  166. package/dist/components/UNSTABLE_File/index.cjs +2 -0
  167. package/dist/components/UNSTABLE_File/index.cjs.map +1 -0
  168. package/dist/components/UNSTABLE_File/index.d.ts +6 -0
  169. package/dist/components/UNSTABLE_File/index.js +16 -0
  170. package/dist/components/UNSTABLE_File/index.js.map +1 -0
  171. package/dist/components/UNSTABLE_File/types.d.ts +48 -0
  172. package/dist/components/UNSTABLE_File/useFileImageStyles.cjs +2 -0
  173. package/dist/components/UNSTABLE_File/useFileImageStyles.cjs.map +1 -0
  174. package/dist/components/UNSTABLE_File/useFileImageStyles.d.ts +19 -0
  175. package/dist/components/UNSTABLE_File/useFileImageStyles.js +21 -0
  176. package/dist/components/UNSTABLE_File/useFileImageStyles.js.map +1 -0
  177. package/dist/components/UNSTABLE_File/useFileStyleProps.cjs +2 -0
  178. package/dist/components/UNSTABLE_File/useFileStyleProps.cjs.map +1 -0
  179. package/dist/components/UNSTABLE_File/useFileStyleProps.d.ts +20 -0
  180. package/dist/components/UNSTABLE_File/useFileStyleProps.js +29 -0
  181. package/dist/components/UNSTABLE_File/useFileStyleProps.js.map +1 -0
  182. package/dist/components/UNSTABLE_File.d.ts +2 -0
  183. package/dist/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.cjs +1 -1
  184. package/dist/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.cjs.map +1 -1
  185. package/dist/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.js +129 -112
  186. package/dist/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.js.map +1 -1
  187. package/dist/components/UNSTABLE_FileUpload/types.d.ts +6 -3
  188. package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.cjs +1 -1
  189. package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.cjs.map +1 -1
  190. package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.d.ts +2 -3
  191. package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.js +18 -16
  192. package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.js.map +1 -1
  193. package/dist/components/UNSTABLE_Picker/PickerContext.cjs +2 -0
  194. package/dist/components/UNSTABLE_Picker/PickerContext.cjs.map +1 -0
  195. package/dist/components/UNSTABLE_Picker/PickerContext.d.ts +3 -0
  196. package/dist/components/UNSTABLE_Picker/PickerContext.js +9 -0
  197. package/dist/components/UNSTABLE_Picker/PickerContext.js.map +1 -0
  198. package/dist/components/UNSTABLE_Picker/PickerPopoverContext.cjs +2 -0
  199. package/dist/components/UNSTABLE_Picker/PickerPopoverContext.cjs.map +1 -0
  200. package/dist/components/UNSTABLE_Picker/PickerPopoverContext.d.ts +3 -0
  201. package/dist/components/UNSTABLE_Picker/PickerPopoverContext.js +16 -0
  202. package/dist/components/UNSTABLE_Picker/PickerPopoverContext.js.map +1 -0
  203. package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.cjs +2 -0
  204. package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.cjs.map +1 -0
  205. package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.d.ts +4 -0
  206. package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.js +204 -0
  207. package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.js.map +1 -0
  208. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.cjs +2 -0
  209. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.cjs.map +1 -0
  210. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.d.ts +7 -0
  211. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.js +14 -0
  212. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.js.map +1 -0
  213. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.cjs +2 -0
  214. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.cjs.map +1 -0
  215. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.d.ts +7 -0
  216. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.js +32 -0
  217. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.js.map +1 -0
  218. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.cjs +2 -0
  219. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.cjs.map +1 -0
  220. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.d.ts +7 -0
  221. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.js +64 -0
  222. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.js.map +1 -0
  223. package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.cjs +2 -0
  224. package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.cjs.map +1 -0
  225. package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.d.ts +4 -0
  226. package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.js +40 -0
  227. package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.js.map +1 -0
  228. package/dist/components/UNSTABLE_Picker/constants.cjs +2 -0
  229. package/dist/components/UNSTABLE_Picker/constants.cjs.map +1 -0
  230. package/dist/components/UNSTABLE_Picker/constants.d.ts +6 -0
  231. package/dist/components/UNSTABLE_Picker/constants.js +11 -0
  232. package/dist/components/UNSTABLE_Picker/constants.js.map +1 -0
  233. package/dist/components/UNSTABLE_Picker/index.cjs +2 -0
  234. package/dist/components/UNSTABLE_Picker/index.cjs.map +1 -0
  235. package/dist/components/UNSTABLE_Picker/index.d.ts +11 -0
  236. package/dist/components/UNSTABLE_Picker/index.js +26 -0
  237. package/dist/components/UNSTABLE_Picker/index.js.map +1 -0
  238. package/dist/components/UNSTABLE_Picker/types.d.ts +91 -0
  239. package/dist/components/UNSTABLE_Picker/usePickerId.cjs +2 -0
  240. package/dist/components/UNSTABLE_Picker/usePickerId.cjs.map +1 -0
  241. package/dist/components/UNSTABLE_Picker/usePickerId.d.ts +8 -0
  242. package/dist/components/UNSTABLE_Picker/usePickerId.js +15 -0
  243. package/dist/components/UNSTABLE_Picker/usePickerId.js.map +1 -0
  244. package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.cjs +2 -0
  245. package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.cjs.map +1 -0
  246. package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.d.ts +11 -0
  247. package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.js +27 -0
  248. package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.js.map +1 -0
  249. package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.cjs +2 -0
  250. package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.cjs.map +1 -0
  251. package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.d.ts +13 -0
  252. package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.js +95 -0
  253. package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.js.map +1 -0
  254. package/dist/components/UNSTABLE_Picker/usePickerStyleProps.cjs +2 -0
  255. package/dist/components/UNSTABLE_Picker/usePickerStyleProps.cjs.map +1 -0
  256. package/dist/components/UNSTABLE_Picker/usePickerStyleProps.d.ts +21 -0
  257. package/dist/components/UNSTABLE_Picker/usePickerStyleProps.js +29 -0
  258. package/dist/components/UNSTABLE_Picker/usePickerStyleProps.js.map +1 -0
  259. package/dist/components/UNSTABLE_Picker/utils.cjs +2 -0
  260. package/dist/components/UNSTABLE_Picker/utils.cjs.map +1 -0
  261. package/dist/components/UNSTABLE_Picker/utils.d.ts +10 -0
  262. package/dist/components/UNSTABLE_Picker/utils.js +41 -0
  263. package/dist/components/UNSTABLE_Picker/utils.js.map +1 -0
  264. package/dist/components/UNSTABLE_Picker.d.ts +2 -0
  265. package/dist/components/index.cjs +1 -1
  266. package/dist/components/index.d.ts +4 -1
  267. package/dist/components/index.js +523 -498
  268. package/dist/components/index.js.map +1 -1
  269. package/dist/constants/index.cjs +1 -1
  270. package/dist/constants/index.d.ts +1 -0
  271. package/dist/constants/index.js +43 -40
  272. package/dist/constants/index.js.map +1 -1
  273. package/dist/constants/selection.cjs +2 -0
  274. package/dist/constants/selection.cjs.map +1 -0
  275. package/dist/constants/selection.d.ts +2 -0
  276. package/dist/constants/selection.js +6 -0
  277. package/dist/constants/selection.js.map +1 -0
  278. package/dist/context/RouterContext.cjs +2 -0
  279. package/dist/context/RouterContext.cjs.map +1 -0
  280. package/dist/context/RouterContext.d.ts +16 -0
  281. package/dist/context/RouterContext.js +12 -0
  282. package/dist/context/RouterContext.js.map +1 -0
  283. package/dist/context/index.cjs +1 -1
  284. package/dist/context/index.d.ts +1 -0
  285. package/dist/context/index.js +11 -7
  286. package/dist/context/index.js.map +1 -1
  287. package/dist/hooks/index.cjs +1 -1
  288. package/dist/hooks/index.d.ts +5 -1
  289. package/dist/hooks/index.js +54 -40
  290. package/dist/hooks/index.js.map +1 -1
  291. package/dist/hooks/useAriaIdRefs.cjs +2 -0
  292. package/dist/hooks/useAriaIdRefs.cjs.map +1 -0
  293. package/dist/hooks/useAriaIdRefs.d.ts +11 -0
  294. package/dist/hooks/useAriaIdRefs.js +23 -0
  295. package/dist/hooks/useAriaIdRefs.js.map +1 -0
  296. package/dist/hooks/useControlledModeGuard.cjs +2 -0
  297. package/dist/hooks/useControlledModeGuard.cjs.map +1 -0
  298. package/dist/hooks/useControlledModeGuard.d.ts +10 -0
  299. package/dist/hooks/useControlledModeGuard.js +33 -0
  300. package/dist/hooks/useControlledModeGuard.js.map +1 -0
  301. package/dist/hooks/useDebouncedValue.cjs +2 -0
  302. package/dist/hooks/useDebouncedValue.cjs.map +1 -0
  303. package/dist/hooks/useDebouncedValue.d.ts +1 -0
  304. package/dist/hooks/useDebouncedValue.js +17 -0
  305. package/dist/hooks/useDebouncedValue.js.map +1 -0
  306. package/dist/hooks/useLinkClick.cjs +2 -0
  307. package/dist/hooks/useLinkClick.cjs.map +1 -0
  308. package/dist/hooks/useLinkClick.d.ts +4 -0
  309. package/dist/hooks/useLinkClick.js +15 -0
  310. package/dist/hooks/useLinkClick.js.map +1 -0
  311. package/dist/hooks/useSelectionState.cjs +2 -0
  312. package/dist/hooks/useSelectionState.cjs.map +1 -0
  313. package/dist/hooks/useSelectionState.d.ts +17 -0
  314. package/dist/hooks/useSelectionState.js +41 -0
  315. package/dist/hooks/useSelectionState.js.map +1 -0
  316. package/dist/index.cjs +1 -1
  317. package/dist/index.js +722 -673
  318. package/dist/index.js.map +1 -1
  319. package/dist/translations/defaults.cjs +1 -1
  320. package/dist/translations/defaults.cjs.map +1 -1
  321. package/dist/translations/defaults.d.ts +17 -0
  322. package/dist/translations/defaults.js +17 -0
  323. package/dist/translations/defaults.js.map +1 -1
  324. package/dist/types/button.d.ts +3 -2
  325. package/dist/types/card.cjs.map +1 -1
  326. package/dist/types/card.d.ts +5 -7
  327. package/dist/types/card.js.map +1 -1
  328. package/dist/types/checkbox.d.ts +2 -2
  329. package/dist/types/controlButton.d.ts +2 -3
  330. package/dist/types/header.d.ts +3 -3
  331. package/dist/types/index.d.ts +1 -0
  332. package/dist/types/inputDetails.d.ts +9 -0
  333. package/dist/types/link.cjs.map +1 -1
  334. package/dist/types/link.d.ts +2 -2
  335. package/dist/types/link.js.map +1 -1
  336. package/dist/types/pagination.d.ts +4 -4
  337. package/dist/types/shared/index.cjs.map +1 -1
  338. package/dist/types/shared/index.d.ts +1 -0
  339. package/dist/types/shared/index.js.map +1 -1
  340. package/dist/types/shared/inputs.d.ts +3 -0
  341. package/dist/types/shared/router.d.ts +3 -0
  342. package/dist/types/tabs.d.ts +2 -2
  343. package/dist/types/tag.d.ts +1 -0
  344. package/dist/types/textArea.d.ts +26 -5
  345. package/dist/types/textFieldBase.d.ts +5 -2
  346. package/dist/types/toggle.d.ts +2 -2
  347. package/dist/utils/debounce.cjs +1 -1
  348. package/dist/utils/debounce.cjs.map +1 -1
  349. package/dist/utils/debounce.d.ts +4 -1
  350. package/dist/utils/debounce.js +11 -8
  351. package/dist/utils/debounce.js.map +1 -1
  352. package/dist/utils/index.cjs +1 -1
  353. package/dist/utils/index.d.ts +1 -0
  354. package/dist/utils/index.js +36 -33
  355. package/dist/utils/index.js.map +1 -1
  356. package/dist/utils/router.cjs +2 -0
  357. package/dist/utils/router.cjs.map +1 -0
  358. package/dist/utils/router.d.ts +12 -0
  359. package/dist/utils/router.js +10 -0
  360. package/dist/utils/router.js.map +1 -0
  361. package/dist/utils/string.cjs +1 -1
  362. package/dist/utils/string.cjs.map +1 -1
  363. package/dist/utils/string.d.ts +1 -0
  364. package/dist/utils/string.js +10 -9
  365. package/dist/utils/string.js.map +1 -1
  366. package/package.json +38 -23
  367. package/dist/components/Field/useAriaIds.cjs +0 -2
  368. package/dist/components/Field/useAriaIds.cjs.map +0 -1
  369. package/dist/components/Field/useAriaIds.d.ts +0 -8
  370. package/dist/components/Field/useAriaIds.js +0 -15
  371. package/dist/components/Field/useAriaIds.js.map +0 -1
  372. package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.cjs +0 -2
  373. package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.cjs.map +0 -1
  374. package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.d.ts +0 -8
  375. package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.js +0 -42
  376. package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.js.map +0 -1
  377. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.cjs +0 -2
  378. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.cjs.map +0 -1
  379. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.d.ts +0 -8
  380. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.js +0 -30
  381. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.js.map +0 -1
  382. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.cjs +0 -2
  383. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.cjs.map +0 -1
  384. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.d.ts +0 -8
  385. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.js +0 -29
  386. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.js.map +0 -1
  387. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.cjs +0 -2
  388. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.cjs.map +0 -1
  389. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.d.ts +0 -8
  390. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.js +0 -29
  391. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.js.map +0 -1
  392. package/dist/components/UNSTABLE_Attachment/constants.cjs +0 -2
  393. package/dist/components/UNSTABLE_Attachment/constants.cjs.map +0 -1
  394. package/dist/components/UNSTABLE_Attachment/constants.d.ts +0 -9
  395. package/dist/components/UNSTABLE_Attachment/constants.js +0 -13
  396. package/dist/components/UNSTABLE_Attachment/constants.js.map +0 -1
  397. package/dist/components/UNSTABLE_Attachment/index.cjs +0 -2
  398. package/dist/components/UNSTABLE_Attachment/index.d.ts +0 -8
  399. package/dist/components/UNSTABLE_Attachment/index.js +0 -20
  400. package/dist/components/UNSTABLE_Attachment/types.d.ts +0 -42
  401. package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.cjs +0 -2
  402. package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.cjs.map +0 -1
  403. package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.d.ts +0 -18
  404. package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.js +0 -22
  405. package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.js.map +0 -1
  406. package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.cjs +0 -2
  407. package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.cjs.map +0 -1
  408. package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.d.ts +0 -21
  409. package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.js +0 -24
  410. package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.js.map +0 -1
  411. package/dist/components/UNSTABLE_Attachment.d.ts +0 -2
  412. package/dist/hooks/useAriaDescribedBy.cjs +0 -2
  413. package/dist/hooks/useAriaDescribedBy.cjs.map +0 -1
  414. package/dist/hooks/useAriaDescribedBy.d.ts +0 -5
  415. package/dist/hooks/useAriaDescribedBy.js +0 -7
  416. package/dist/hooks/useAriaDescribedBy.js.map +0 -1
  417. /package/dist/components/{UNSTABLE_Attachment → CharacterCounter}/index.cjs.map +0 -0
@@ -1,121 +1,138 @@
1
1
  "use client";
2
- import { jsxs as s, jsx as i } from "react/jsx-runtime";
3
- import M from "classnames";
4
- import { useState as w, useEffect as z } from "react";
5
- import { useStyleProps as G } from "../../hooks/styleProps.js";
6
- import { useAriaDescribedBy as J } from "../../hooks/useAriaDescribedBy.js";
7
- import K from "../Field/HelperText.js";
8
- import u from "../Field/Label.js";
9
- import Q from "../Field/useAriaIds.js";
10
- import W from "../Field/ValidationText.js";
11
- import { useValidationTextRole as X } from "../Field/useValidationTextRole.js";
12
- import Y from "../Icon/Icon.js";
13
- import { useFileUploadState as ee } from "./useFileUploadState.js";
14
- import { useFileUploadStyleProps as ie } from "./useFileUploadStyleProps.js";
15
- const f = (N) => {
16
- const [r, h] = w(!1), {
17
- "aria-describedby": v = "",
18
- accept: g,
19
- children: D,
20
- dropZoneRef: S,
21
- hasValidationIcon: b,
22
- helperText: T,
23
- iconName: x = "upload",
24
- id: n,
25
- inputRef: F,
2
+ import { jsxs as r, jsx as i, Fragment as G } from "react/jsx-runtime";
3
+ import J from "classnames";
4
+ import { useState as K, useEffect as Q } from "react";
5
+ import { useStyleProps as W } from "../../hooks/styleProps.js";
6
+ import { useAriaDescribedBy as X } from "../../hooks/useAriaIdRefs.js";
7
+ import Y from "../Button/Button.js";
8
+ import ee from "../Field/HelperText.js";
9
+ import v from "../Field/Label.js";
10
+ import oe from "../Field/ValidationText.js";
11
+ import { useValidationTextRole as ie } from "../Field/useValidationTextRole.js";
12
+ import re from "../Icon/Icon.js";
13
+ import { useFileUploadState as te } from "./useFileUploadState.js";
14
+ import { useFileUploadStyleProps as ae } from "./useFileUploadStyleProps.js";
15
+ const g = (h) => {
16
+ const [N, S] = K(!1), {
17
+ "aria-describedby": b = "",
18
+ accept: A,
19
+ buttonText: T = "Browse",
20
+ children: x,
21
+ dropZoneRef: F,
22
+ hasValidationIcon: y,
23
+ helperText: U,
24
+ iconName: E = "upload",
25
+ id: B,
26
+ inputRef: L,
27
+ isCompact: d,
26
28
  isDisabled: o,
27
- isFluid: A,
28
- isLabelHidden: U,
29
- isMultiple: E,
29
+ isDragAndDropSupported: s,
30
+ isLabelHidden: P,
31
+ isMultiple: I,
30
32
  isRequired: _,
31
- label: y,
32
- labelText: L,
33
- linkText: I,
34
- name: l,
35
- onFilesSelected: P,
36
- validationState: t,
37
- validationText: p,
38
- ...B
39
- } = N, d = l !== void 0, { isDragging: R, onChange: V, onDragEnter: Z, onDragLeave: $, onDragOver: j, onDrop: k } = ee({
40
- onFilesSelected: d ? P : void 0
41
- }), { classProps: e } = ie({
33
+ label: R,
34
+ labelText: p,
35
+ linkText: V,
36
+ name: c,
37
+ onFilesSelected: Z,
38
+ rootId: l,
39
+ validationState: n,
40
+ validationText: m,
41
+ ...C
42
+ } = h, u = c !== void 0, t = s ?? N, { isDragging: j, onChange: H, onDragEnter: O, onDragLeave: $, onDragOver: k, onDrop: q } = te({
43
+ onFilesSelected: u ? Z : void 0
44
+ }), { classProps: e } = ae({
45
+ isCompact: d,
42
46
  isDisabled: o,
43
- isDragAndDropSupported: r,
44
- isDragging: R,
45
- isFluid: A,
46
- isLabelHidden: U,
47
+ isDragAndDropSupported: t,
48
+ isDragging: j,
49
+ isLabelHidden: P,
47
50
  isRequired: _,
48
- validationState: t
49
- }), { styleProps: c, props: C } = G(B), [H, m] = Q(v), O = J(H), q = X({
50
- validationState: t,
51
- validationText: p
52
- }), a = `${n}-input`;
53
- return z(() => {
54
- h("draggable" in document.createElement("span"));
55
- }, []), /* @__PURE__ */ s("div", { id: n, ...C, ...c, className: M(e.root, c.className), children: [
56
- d && /* @__PURE__ */ s(
57
- "div",
58
- {
59
- onDragOver: !o && r ? j : void 0,
60
- onDragEnter: !o && r ? Z : void 0,
61
- onDragLeave: !o && r ? $ : void 0,
62
- onDrop: !o && r ? k : void 0,
63
- className: e.input.root,
64
- children: [
65
- /* @__PURE__ */ i(u, { htmlFor: a, UNSAFE_className: e.input.label, children: y }),
66
- /* @__PURE__ */ i(
67
- "input",
68
- {
69
- ...O,
70
- type: "file",
71
- accept: g,
72
- id: a,
73
- ref: F,
74
- name: l,
75
- className: e.input.input,
76
- onChange: V,
77
- multiple: E,
78
- disabled: o
79
- }
80
- ),
81
- /* @__PURE__ */ s("div", { ref: S, className: e.input.dropZone.root, children: [
82
- /* @__PURE__ */ i(Y, { name: x, "aria-hidden": "true" }),
83
- /* @__PURE__ */ s(u, { htmlFor: a, UNSAFE_className: e.input.dropZone.label, children: [
84
- /* @__PURE__ */ i("span", { className: e.input.link, children: I }),
85
- " ",
86
- /* @__PURE__ */ i("span", { className: e.input.dropLabel, children: L })
87
- ] }),
88
- /* @__PURE__ */ i(
89
- K,
90
- {
91
- UNSAFE_className: e.input.helper,
92
- id: `${a}__helperText`,
93
- registerAria: m,
94
- helperText: T
95
- }
96
- )
97
- ] }),
98
- t && /* @__PURE__ */ i(
99
- W,
100
- {
101
- UNSAFE_className: e.input.validationText,
102
- elementType: "span",
103
- ...b && { hasValidationStateIcon: t },
104
- id: `${a}__validationText`,
105
- validationText: p,
106
- registerAria: m,
107
- role: q
108
- }
109
- )
110
- ]
111
- }
112
- ),
113
- D
114
- ] });
51
+ validationState: n
52
+ }), { styleProps: D, props: w } = W(C), [z, f] = X(b), M = ie({
53
+ validationState: n,
54
+ validationText: m
55
+ }), a = B;
56
+ return Q(() => {
57
+ s === void 0 && S("draggable" in document.createElement("span"));
58
+ }, [s]), /* @__PURE__ */ r(
59
+ "div",
60
+ {
61
+ ...w,
62
+ ...D,
63
+ ...l != null && l !== "" ? { id: l } : {},
64
+ className: J(e.root, D.className),
65
+ children: [
66
+ u && /* @__PURE__ */ r(
67
+ "div",
68
+ {
69
+ onDragOver: !o && t ? k : void 0,
70
+ onDragEnter: !o && t ? O : void 0,
71
+ onDragLeave: !o && t ? $ : void 0,
72
+ onDrop: !o && t ? q : void 0,
73
+ className: e.input.root,
74
+ children: [
75
+ /* @__PURE__ */ i(v, { htmlFor: a, UNSAFE_className: e.input.label, children: R }),
76
+ /* @__PURE__ */ i(
77
+ "input",
78
+ {
79
+ ...z,
80
+ type: "file",
81
+ accept: A,
82
+ id: a,
83
+ ref: L,
84
+ name: c,
85
+ className: e.input.input,
86
+ onChange: H,
87
+ multiple: I,
88
+ disabled: o
89
+ }
90
+ ),
91
+ /* @__PURE__ */ r("div", { ref: F, className: e.input.dropZone.root, children: [
92
+ !d && /* @__PURE__ */ i(re, { name: E, boxSize: 28, "aria-hidden": "true" }),
93
+ /* @__PURE__ */ r("div", { className: e.input.dropZone.content, children: [
94
+ /* @__PURE__ */ r(v, { htmlFor: a, UNSAFE_className: e.input.dropZone.label, children: [
95
+ V,
96
+ p && /* @__PURE__ */ r(G, { children: [
97
+ " ",
98
+ /* @__PURE__ */ i("span", { className: e.input.dropLabel, children: p })
99
+ ] })
100
+ ] }),
101
+ /* @__PURE__ */ i(
102
+ ee,
103
+ {
104
+ UNSAFE_className: e.input.helper,
105
+ id: `${a}-helper`,
106
+ registerAria: f,
107
+ helperText: U
108
+ }
109
+ )
110
+ ] }),
111
+ /* @__PURE__ */ i(Y, { "aria-hidden": "true", isDisabled: o, elementType: "div", type: null, children: T })
112
+ ] }),
113
+ n && /* @__PURE__ */ i(
114
+ oe,
115
+ {
116
+ UNSAFE_className: e.input.validationText,
117
+ elementType: "div",
118
+ ...y && { hasValidationStateIcon: n },
119
+ id: `${a}-validation`,
120
+ validationText: m,
121
+ registerAria: f,
122
+ role: M
123
+ }
124
+ )
125
+ ]
126
+ }
127
+ ),
128
+ x
129
+ ]
130
+ }
131
+ );
115
132
  };
116
- f.spiritComponent = "UNSTABLE_FileUpload";
117
- f.displayName = "UNSTABLE_FileUpload";
133
+ g.spiritComponent = "UNSTABLE_FileUpload";
134
+ g.displayName = "UNSTABLE_FileUpload";
118
135
  export {
119
- f as default
136
+ g as default
120
137
  };
121
138
  //# sourceMappingURL=UNSTABLE_FileUpload.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UNSTABLE_FileUpload.js","sources":["../../../src/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { useEffect, useState } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { HelperText, Label, ValidationText, useAriaIds } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { Icon } from '../Icon';\nimport { type UnstableFileUploadProps } from './types';\nimport { useFileUploadState } from './useFileUploadState';\nimport { useFileUploadStyleProps } from './useFileUploadStyleProps';\n\nconst UNSTABLE_FileUpload = (props: UnstableFileUploadProps) => {\n const [isDragAndDropSupported, setIsDragAndDropSupported] = useState(false);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n accept,\n children,\n dropZoneRef,\n hasValidationIcon,\n helperText,\n iconName = 'upload',\n id,\n inputRef,\n isDisabled,\n isFluid,\n isLabelHidden,\n isMultiple,\n isRequired,\n label,\n labelText,\n linkText,\n name,\n onFilesSelected,\n validationState,\n validationText,\n ...restProps\n } = props;\n\n const hasInput = name !== undefined;\n\n const { isDragging, onChange, onDragEnter, onDragLeave, onDragOver, onDrop } = useFileUploadState({\n onFilesSelected: hasInput ? onFilesSelected : undefined,\n });\n\n const { classProps } = useFileUploadStyleProps({\n hasValidationIcon,\n isDisabled,\n isDragAndDropSupported,\n isDragging,\n isFluid,\n isLabelHidden,\n isRequired,\n validationState,\n });\n\n const { styleProps, props: transferProps } = useStyleProps(restProps);\n\n const [ids, register] = useAriaIds(ariaDescribedBy);\n const ariaDescribedByProp = useAriaDescribedBy(ids);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n const inputId = `${id}-input`;\n\n useEffect(() => {\n setIsDragAndDropSupported('draggable' in document.createElement('span'));\n }, []);\n\n return (\n <div id={id} {...transferProps} {...styleProps} className={classNames(classProps.root, styleProps.className)}>\n {hasInput && (\n <div\n onDragOver={!isDisabled && isDragAndDropSupported ? onDragOver : undefined}\n onDragEnter={!isDisabled && isDragAndDropSupported ? onDragEnter : undefined}\n onDragLeave={!isDisabled && isDragAndDropSupported ? onDragLeave : undefined}\n onDrop={!isDisabled && isDragAndDropSupported ? onDrop : undefined}\n className={classProps.input.root}\n >\n <Label htmlFor={inputId} UNSAFE_className={classProps.input.label}>\n {label}\n </Label>\n <input\n {...ariaDescribedByProp}\n type=\"file\"\n accept={accept}\n id={inputId}\n ref={inputRef}\n name={name}\n className={classProps.input.input}\n onChange={onChange}\n multiple={isMultiple}\n disabled={isDisabled}\n />\n <div ref={dropZoneRef} className={classProps.input.dropZone.root}>\n <Icon name={iconName} aria-hidden=\"true\" />\n <Label htmlFor={inputId} UNSAFE_className={classProps.input.dropZone.label}>\n <span className={classProps.input.link}>{linkText}</span>\n &nbsp;\n <span className={classProps.input.dropLabel}>{labelText}</span>\n </Label>\n <HelperText\n UNSAFE_className={classProps.input.helper}\n id={`${inputId}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n </div>\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.input.validationText}\n elementType=\"span\"\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${inputId}__validationText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n )}\n {children}\n </div>\n );\n};\n\nUNSTABLE_FileUpload.spiritComponent = 'UNSTABLE_FileUpload';\nUNSTABLE_FileUpload.displayName = 'UNSTABLE_FileUpload';\n\nexport default UNSTABLE_FileUpload;\n"],"names":["UNSTABLE_FileUpload","props","isDragAndDropSupported","setIsDragAndDropSupported","useState","ariaDescribedBy","accept","children","dropZoneRef","hasValidationIcon","helperText","iconName","id","inputRef","isDisabled","isFluid","isLabelHidden","isMultiple","isRequired","label","labelText","linkText","name","onFilesSelected","validationState","validationText","restProps","hasInput","isDragging","onChange","onDragEnter","onDragLeave","onDragOver","onDrop","useFileUploadState","classProps","useFileUploadStyleProps","styleProps","transferProps","useStyleProps","ids","register","useAriaIds","ariaDescribedByProp","useAriaDescribedBy","validationTextRole","useValidationTextRole","inputId","useEffect","jsxs","classNames","jsx","Label","Icon","HelperText","ValidationText"],"mappings":";;;;;;;;;;;;;;AAYA,MAAMA,IAAsB,CAACC,MAAmC;AAC9D,QAAM,CAACC,GAAwBC,CAAyB,IAAIC,EAAS,EAAK,GACpE;AAAA,IACJ,oBAAoBC,IAAkB;AAAA,IACtC,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,IAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC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,gBAAAtB;AAAA,cACA,cAAcgB;AAAA,cACd,MAAMI;AAAA,YAAA;AAAA,UAAA;AAAA,QACR;AAAA,MAAA;AAAA,IAAA;AAAA,IAILtC;AAAA,EAAA,GACH;AAEJ;AAEAP,EAAoB,kBAAkB;AACtCA,EAAoB,cAAc;"}
1
+ {"version":3,"file":"UNSTABLE_FileUpload.js","sources":["../../../src/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { useEffect, useState } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { Button } from '../Button';\nimport { HelperText, Label, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { Icon } from '../Icon';\nimport { type UnstableFileUploadProps } from './types';\nimport { useFileUploadState } from './useFileUploadState';\nimport { useFileUploadStyleProps } from './useFileUploadStyleProps';\n\nconst UNSTABLE_FileUpload = (props: UnstableFileUploadProps) => {\n const [isDragAndDropDetected, setIsDragAndDropDetected] = useState(false);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n accept,\n buttonText = 'Browse',\n children,\n dropZoneRef,\n hasValidationIcon,\n helperText,\n iconName = 'upload',\n id,\n inputRef,\n isCompact,\n isDisabled,\n isDragAndDropSupported: isDragAndDropSupportedProp,\n isLabelHidden,\n isMultiple,\n isRequired,\n label,\n labelText,\n linkText,\n name,\n onFilesSelected,\n rootId,\n validationState,\n validationText,\n ...restProps\n } = props;\n\n const hasInput = name !== undefined;\n\n const isDragAndDropSupported = isDragAndDropSupportedProp ?? isDragAndDropDetected;\n\n const { isDragging, onChange, onDragEnter, onDragLeave, onDragOver, onDrop } = useFileUploadState({\n onFilesSelected: hasInput ? onFilesSelected : undefined,\n });\n\n const { classProps } = useFileUploadStyleProps({\n hasValidationIcon,\n isCompact,\n isDisabled,\n isDragAndDropSupported,\n isDragging,\n isLabelHidden,\n isRequired,\n validationState,\n });\n\n const { styleProps, props: transferProps } = useStyleProps(restProps);\n\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n const inputId = id;\n\n useEffect(() => {\n if (isDragAndDropSupportedProp !== undefined) {\n return;\n }\n setIsDragAndDropDetected('draggable' in document.createElement('span'));\n }, [isDragAndDropSupportedProp]);\n\n return (\n <div\n {...transferProps}\n {...styleProps}\n {...(rootId != null && rootId !== '' ? { id: rootId } : {})}\n className={classNames(classProps.root, styleProps.className)}\n >\n {hasInput && (\n <div\n onDragOver={!isDisabled && isDragAndDropSupported ? onDragOver : undefined}\n onDragEnter={!isDisabled && isDragAndDropSupported ? onDragEnter : undefined}\n onDragLeave={!isDisabled && isDragAndDropSupported ? onDragLeave : undefined}\n onDrop={!isDisabled && isDragAndDropSupported ? onDrop : undefined}\n className={classProps.input.root}\n >\n <Label htmlFor={inputId} UNSAFE_className={classProps.input.label}>\n {label}\n </Label>\n <input\n {...ariaDescribedByProp}\n type=\"file\"\n accept={accept}\n id={inputId}\n ref={inputRef}\n name={name}\n className={classProps.input.input}\n onChange={onChange}\n multiple={isMultiple}\n disabled={isDisabled}\n />\n <div ref={dropZoneRef} className={classProps.input.dropZone.root}>\n {!isCompact && <Icon name={iconName} boxSize={28} aria-hidden=\"true\" />}\n <div className={classProps.input.dropZone.content}>\n <Label htmlFor={inputId} UNSAFE_className={classProps.input.dropZone.label}>\n {linkText}\n {labelText && (\n <>\n {' '}\n <span className={classProps.input.dropLabel}>{labelText}</span>\n </>\n )}\n </Label>\n <HelperText\n UNSAFE_className={classProps.input.helper}\n id={`${inputId}-helper`}\n registerAria={register}\n helperText={helperText}\n />\n </div>\n {/* @ts-expect-error - Div cannot have type=\"button\". This will be solved with https://jira.almacareer.tech/browse/DS-2168 */}\n <Button aria-hidden=\"true\" isDisabled={isDisabled} elementType=\"div\" type={null}>\n {buttonText}\n </Button>\n </div>\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.input.validationText}\n elementType=\"div\"\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${inputId}-validation`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n )}\n {children}\n </div>\n );\n};\n\nUNSTABLE_FileUpload.spiritComponent = 'UNSTABLE_FileUpload';\nUNSTABLE_FileUpload.displayName = 'UNSTABLE_FileUpload';\n\nexport default UNSTABLE_FileUpload;\n"],"names":["UNSTABLE_FileUpload","props","isDragAndDropDetected","setIsDragAndDropDetected","useState","ariaDescribedBy","accept","buttonText","children","dropZoneRef","hasValidationIcon","helperText","iconName","id","inputRef","isCompact","isDisabled","isDragAndDropSupportedProp","isLabelHidden","isMultiple","isRequired","label","labelText","linkText","name","onFilesSelected","rootId","validationState","validationText","restProps","hasInput","isDragAndDropSupported","isDragging","onChange","onDragEnter","onDragLeave","onDragOver","onDrop","useFileUploadState","classProps","useFileUploadStyleProps","styleProps","transferProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","validationTextRole","useValidationTextRole","inputId","useEffect","jsxs","classNames","jsx","Label","Icon","Fragment","HelperText","Button","ValidationText"],"mappings":";;;;;;;;;;;;;;AAaA,MAAMA,IAAsB,CAACC,MAAmC;AAC9D,QAAM,CAACC,GAAuBC,CAAwB,IAAIC,EAAS,EAAK,GAClE;AAAA,IACJ,oBAAoBC,IAAkB;AAAA,IACtC,QAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,IAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,wBAAwBC;AAAA,IACxB,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,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QAAO,YAAA1C,GAAwB,aAAY,OAAM,MAAM,MACxE,UAAAT,EAAA,CACH;AAAA,cAAA,GACF;AAAA,cACCoB,KACC,gBAAA0B;AAAA,gBAACM;AAAA,gBAAA;AAAA,kBACC,kBAAkBpB,EAAW,MAAM;AAAA,kBACnC,aAAY;AAAA,kBACX,GAAI7B,KAAqB,EAAE,wBAAwBiB,EAAA;AAAA,kBACpD,IAAI,GAAGsB,CAAO;AAAA,kBACd,gBAAArB;AAAA,kBACA,cAAciB;AAAA,kBACd,MAAME;AAAA,gBAAA;AAAA,cAAA;AAAA,YACR;AAAA,UAAA;AAAA,QAAA;AAAA,QAILvC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAR,EAAoB,kBAAkB;AACtCA,EAAoB,cAAc;"}
@@ -1,12 +1,13 @@
1
1
  import { MutableRefObject, ReactNode } from 'react';
2
2
  import { SpiritInputElementProps, Validation, ValidationTextType } from '../../types/shared';
3
- import { UnstableAttachmentItem } from '../UNSTABLE_Attachment/types';
3
+ import { UnstableFileItem } from '../UNSTABLE_File/types';
4
4
  export interface UnstableFileUploadTextProps {
5
+ buttonText?: string;
5
6
  helperText?: string;
6
7
  labelText?: string;
7
8
  linkText?: string;
8
9
  }
9
- export type UnstableFileUploadAttachmentsItem = UnstableAttachmentItem;
10
+ export type UnstableFileUploadAttachmentsItem = UnstableFileItem;
10
11
  export type FilesSelectedType = (files: File[]) => void;
11
12
  export interface UnstableFileUploadInputProps extends Omit<SpiritInputElementProps, 'onError' | 'label'>, UnstableFileUploadTextProps, Validation {
12
13
  accept?: string;
@@ -16,6 +17,8 @@ export interface UnstableFileUploadInputProps extends Omit<SpiritInputElementPro
16
17
  id: string;
17
18
  inputRef?: MutableRefObject<HTMLInputElement>;
18
19
  isDisabled?: boolean;
20
+ isCompact?: boolean;
21
+ isDragAndDropSupported?: boolean;
19
22
  isLabelHidden?: boolean;
20
23
  isMultiple?: boolean;
21
24
  isRequired?: boolean;
@@ -26,5 +29,5 @@ export interface UnstableFileUploadInputProps extends Omit<SpiritInputElementPro
26
29
  }
27
30
  export interface UnstableFileUploadProps extends UnstableFileUploadInputProps {
28
31
  id: string;
29
- isFluid?: boolean;
32
+ rootId?: string;
30
33
  }
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("classnames"),L=require("../../hooks/useClassNamePrefix.cjs"),D=e=>{const a=L.useClassNamePrefix("FileUploader"),t="has-drag-and-drop",n=`${a}--fluid`,l=`${a}Input`,o=`${l}--disabled`,d=`${l}--${e?.validationState}`,p="is-dragging",r=`${l}__dragAndDropLabel`,i=`${l}__dropZone`,u=`${i}Label`,c=`${l}__helperText`,f=`${l}__input`,U=`${l}__label`,C=`${l}__label--hidden`,b=`${l}__label--required`,_=`${l}__link`,I=["link-primary","link-underlined"],$=`${l}__validationText`,g=`${a}List`;return{classProps:{root:s(a,{[n]:e?.isFluid}),input:{root:s(l,{[t]:e?.isDragAndDropSupported,[o]:e?.isDisabled,[p]:e?.isDragging,[d]:e?.validationState}),label:s(U,{[b]:e?.isRequired,[C]:e?.isLabelHidden}),input:f,dropLabel:r,helper:c,link:s(_,...I),validationText:$,dropZone:{root:i,label:u}},list:g}}};exports.useFileUploadStyleProps=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("classnames"),$=require("../../hooks/useClassNamePrefix.cjs"),g=e=>{const o=$.useClassNamePrefix("UNSTABLE_FileUpload"),s="has-drag-and-drop",l=`${o}Input`,t=`${l}--disabled`,n=`${l}__dropZone--disabled`,i=`${l}__dropZone--compact`,d=`${l}--${e?.validationState}`,p="is-dragging",r=`${l}__dragAndDropLabel`,u=`${l}__dropZone`,c=`${l}__dropZoneContent`,_=`${l}__dropZoneLabel`,C=`${l}__helperText`,b=`${l}__input`,U=`${l}__label`,f=`${l}__label--hidden`,D=`${l}__label--required`,I=`${l}__validationText`;return{classProps:{root:o,input:{root:a(l,{[s]:e?.isDragAndDropSupported,[t]:e?.isDisabled,[p]:e?.isDragging,[d]:e?.validationState}),label:a(U,{[D]:e?.isRequired,[f]:e?.isLabelHidden}),input:b,dropLabel:r,helper:C,validationText:I,dropZone:{root:a(u,{[n]:e?.isDisabled,[i]:e?.isCompact}),content:c,label:_}}}}};exports.useFileUploadStyleProps=g;
2
2
  //# sourceMappingURL=useFileUploadStyleProps.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFileUploadStyleProps.cjs","sources":["../../../src/components/UNSTABLE_FileUpload/useFileUploadStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type StyleProps, type Validation } from '../../types';\n\nexport interface FileUploadStyleProps extends StyleProps, Validation {\n isDisabled?: boolean;\n isDragAndDropSupported?: boolean;\n isDragging?: boolean;\n isFluid?: boolean;\n isLabelHidden?: boolean;\n isRequired?: boolean;\n}\n\nexport interface FileUploadStyle {\n /** className props */\n classProps: {\n root: string;\n input: {\n root: string;\n label: string;\n input: string;\n dropLabel: string;\n helper: string;\n link: string;\n validationText: string;\n dropZone: {\n root: string;\n label: string;\n };\n };\n list: string;\n };\n}\n\nexport const useFileUploadStyleProps = (props?: FileUploadStyleProps): FileUploadStyle => {\n const fileUploadClass = useClassNamePrefix('FileUploader');\n const fileUploadHasDragAndDropClass = 'has-drag-and-drop';\n const fileUploadFluidClass = `${fileUploadClass}--fluid`;\n const fileUploadInputClass = `${fileUploadClass}Input`;\n const fileUploadInputDisabledClass = `${fileUploadInputClass}--disabled`;\n const fileUploadInputValidationClass = `${fileUploadInputClass}--${props?.validationState}`;\n const fileUploadInputDraggingClass = 'is-dragging';\n const fileUploadInputDropLabelClass = `${fileUploadInputClass}__dragAndDropLabel`;\n const fileUploadInputDropZoneClass = `${fileUploadInputClass}__dropZone`;\n const fileUploadInputDropZoneLabelClass = `${fileUploadInputDropZoneClass}Label`;\n const fileUploadInputHelperClass = `${fileUploadInputClass}__helperText`;\n const fileUploadInputInputClass = `${fileUploadInputClass}__input`;\n const fileUploadInputLabelClass = `${fileUploadInputClass}__label`;\n const fileUploadInputLabelHiddenClass = `${fileUploadInputClass}__label--hidden`;\n const fileUploadInputLabelRequiredClass = `${fileUploadInputClass}__label--required`;\n const fileUploadInputLinkClass = `${fileUploadInputClass}__link`;\n const fileUploadInputLinkUtilityClasses = ['link-primary', 'link-underlined'];\n const fileUploadInputValidationTextClass = `${fileUploadInputClass}__validationText`;\n const fileUploadListClass = `${fileUploadClass}List`;\n\n return {\n classProps: {\n root: classNames(fileUploadClass, { [fileUploadFluidClass]: props?.isFluid }),\n input: {\n root: classNames(fileUploadInputClass, {\n [fileUploadHasDragAndDropClass]: props?.isDragAndDropSupported,\n [fileUploadInputDisabledClass]: props?.isDisabled,\n [fileUploadInputDraggingClass]: props?.isDragging,\n [fileUploadInputValidationClass]: props?.validationState,\n }),\n label: classNames(fileUploadInputLabelClass, {\n [fileUploadInputLabelRequiredClass]: props?.isRequired,\n [fileUploadInputLabelHiddenClass]: props?.isLabelHidden,\n }),\n input: fileUploadInputInputClass,\n dropLabel: fileUploadInputDropLabelClass,\n helper: fileUploadInputHelperClass,\n link: classNames(fileUploadInputLinkClass, ...fileUploadInputLinkUtilityClasses),\n validationText: fileUploadInputValidationTextClass,\n dropZone: {\n root: fileUploadInputDropZoneClass,\n label: fileUploadInputDropZoneLabelClass,\n },\n },\n list: fileUploadListClass,\n },\n };\n};\n"],"names":["useFileUploadStyleProps","props","fileUploadClass","useClassNamePrefix","fileUploadHasDragAndDropClass","fileUploadFluidClass","fileUploadInputClass","fileUploadInputDisabledClass","fileUploadInputValidationClass","fileUploadInputDraggingClass","fileUploadInputDropLabelClass","fileUploadInputDropZoneClass","fileUploadInputDropZoneLabelClass","fileUploadInputHelperClass","fileUploadInputInputClass","fileUploadInputLabelClass","fileUploadInputLabelHiddenClass","fileUploadInputLabelRequiredClass","fileUploadInputLinkClass","fileUploadInputLinkUtilityClasses","fileUploadInputValidationTextClass","fileUploadListCl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TABLE_FileUpload/useFileUploadStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type StyleProps, type Validation } from '../../types';\n\nexport interface FileUploadStyleProps extends StyleProps, Validation {\n isDisabled?: boolean;\n isCompact?: boolean;\n isDragAndDropSupported?: boolean;\n isDragging?: boolean;\n isLabelHidden?: boolean;\n isRequired?: boolean;\n}\n\nexport interface FileUploadStyle {\n /** className props */\n classProps: {\n root: string;\n input: {\n root: string;\n label: string;\n input: string;\n dropLabel: string;\n helper: string;\n validationText: string;\n dropZone: {\n root: string;\n content: string;\n label: string;\n };\n };\n };\n}\n\nexport const useFileUploadStyleProps = (props?: FileUploadStyleProps): FileUploadStyle => {\n const fileUploadClass = useClassNamePrefix('UNSTABLE_FileUpload');\n const fileUploadHasDragAndDropClass = 'has-drag-and-drop';\n const fileUploadInputClass = `${fileUploadClass}Input`;\n const fileUploadInputDisabledClass = `${fileUploadInputClass}--disabled`;\n const fileUploadDropZoneDisabledClass = `${fileUploadInputClass}__dropZone--disabled`;\n const fileUploadDropZoneCompactClass = `${fileUploadInputClass}__dropZone--compact`;\n const fileUploadInputValidationClass = `${fileUploadInputClass}--${props?.validationState}`;\n const fileUploadInputDraggingClass = 'is-dragging';\n const fileUploadInputDropLabelClass = `${fileUploadInputClass}__dragAndDropLabel`;\n const fileUploadInputDropZoneClass = `${fileUploadInputClass}__dropZone`;\n const fileUploadInputDropZoneContentClass = `${fileUploadInputClass}__dropZoneContent`;\n const fileUploadInputDropZoneLabelClass = `${fileUploadInputClass}__dropZoneLabel`;\n const fileUploadInputHelperClass = `${fileUploadInputClass}__helperText`;\n const fileUploadInputInputClass = `${fileUploadInputClass}__input`;\n const fileUploadInputLabelClass = `${fileUploadInputClass}__label`;\n const fileUploadInputLabelHiddenClass = `${fileUploadInputClass}__label--hidden`;\n const fileUploadInputLabelRequiredClass = `${fileUploadInputClass}__label--required`;\n const fileUploadInputValidationTextClass = `${fileUploadInputClass}__validationText`;\n\n return {\n classProps: {\n root: fileUploadClass,\n input: {\n root: classNames(fileUploadInputClass, {\n [fileUploadHasDragAndDropClass]: props?.isDragAndDropSupported,\n [fileUploadInputDisabledClass]: props?.isDisabled,\n [fileUploadInputDraggingClass]: props?.isDragging,\n [fileUploadInputValidationClass]: props?.validationState,\n }),\n label: classNames(fileUploadInputLabelClass, {\n [fileUploadInputLabelRequiredClass]: props?.isRequired,\n [fileUploadInputLabelHiddenClass]: props?.isLabelHidden,\n }),\n input: fileUploadInputInputClass,\n dropLabel: fileUploadInputDropLabelClass,\n helper: fileUploadInputHelperClass,\n validationText: fileUploadInputValidationTextClass,\n dropZone: {\n root: classNames(fileUploadInputDropZoneClass, {\n [fileUploadDropZoneDisabledClass]: props?.isDisabled,\n [fileUploadDropZoneCompactClass]: props?.isCompact,\n }),\n content: fileUploadInputDropZoneContentClass,\n label: fileUploadInputDropZoneLabelClass,\n },\n },\n },\n };\n};\n"],"names":["useFileUploadStyleProps","props","fileUploadClass","useClassNamePrefix","fileUploadHasDragAndDropClass","fileUploadInputClass","fileUploadInputDisabledClass","fileUploadDropZoneDisabledClass","fileUploadDropZoneCompactClass","fileUploadInputValidationClass","fileUploadInputDraggingClass","fileUploadInputDropLabelClass","fileUploadInputDropZoneClass","fileUploadInputDropZoneContentClass","fileUploadInputDropZoneLabelClass","fileUploadInputHelperClass","fileUploadInputInputClass","fileUploadInputLabelClass","fileUploadInputLabelHiddenClass","fileUploadInputLabelRequiredClass","fileUploadInputValidationTextClass","classNames"],"mappings":"8JAiCaA,EAA2BC,GAAkD,CACxF,MAAMC,EAAkBC,EAAAA,mBAAmB,qBAAqB,EAC1DC,EAAgC,oBAChCC,EAAuB,GAAGH,CAAe,QACzCI,EAA+B,GAAGD,CAAoB,aACtDE,EAAkC,GAAGF,CAAoB,uBACzDG,EAAiC,GAAGH,CAAoB,sBACxDI,EAAiC,GAAGJ,CAAoB,KAAKJ,GAAO,eAAe,GACnFS,EAA+B,cAC/BC,EAAgC,GAAGN,CAAoB,qBACvDO,EAA+B,GAAGP,CAAoB,aACtDQ,EAAsC,GAAGR,CAAoB,oBAC7DS,EAAoC,GAAGT,CAAoB,kBAC3DU,EAA6B,GAAGV,CAAoB,eACpDW,EAA4B,GAAGX,CAAoB,UACnDY,EAA4B,GAAGZ,CAAoB,UACnDa,EAAkC,GAAGb,CAAoB,kBACzDc,EAAoC,GAAGd,CAAoB,oBAC3De,EAAqC,GAAGf,CAAoB,mBAElE,MAAO,CACL,WAAY,CACV,KAAMH,EACN,MAAO,CACL,KAAMmB,EAAWhB,EAAsB,CACrC,CAACD,CAA6B,EAAGH,GAAO,uBACxC,CAACK,CAA4B,EAAGL,GAAO,WACvC,CAACS,CAA4B,EAAGT,GAAO,WACvC,CAACQ,CAA8B,EAAGR,GAAO,eAAA,CAC1C,EACD,MAAOoB,EAAWJ,EAA2B,CAC3C,CAACE,CAAiC,EAAGlB,GAAO,WAC5C,CAACiB,CAA+B,EAAGjB,GAAO,aAAA,CAC3C,EACD,MAAOe,EACP,UAAWL,EACX,OAAQI,EACR,eAAgBK,EAChB,SAAU,CACR,KAAMC,EAAWT,EAA8B,CAC7C,CAACL,CAA+B,EAAGN,GAAO,WAC1C,CAACO,CAA8B,EAAGP,GAAO,SAAA,CAC1C,EACD,QAASY,EACT,MAAOC,CAAA,CACT,CACF,CACF,CAEJ"}
@@ -1,9 +1,9 @@
1
1
  import { StyleProps, Validation } from '../../types';
2
2
  export interface FileUploadStyleProps extends StyleProps, Validation {
3
3
  isDisabled?: boolean;
4
+ isCompact?: boolean;
4
5
  isDragAndDropSupported?: boolean;
5
6
  isDragging?: boolean;
6
- isFluid?: boolean;
7
7
  isLabelHidden?: boolean;
8
8
  isRequired?: boolean;
9
9
  }
@@ -16,14 +16,13 @@ export interface FileUploadStyle {
16
16
  input: string;
17
17
  dropLabel: string;
18
18
  helper: string;
19
- link: string;
20
19
  validationText: string;
21
20
  dropZone: {
22
21
  root: string;
22
+ content: string;
23
23
  label: string;
24
24
  };
25
25
  };
26
- list: string;
27
26
  };
28
27
  }
29
28
  export declare const useFileUploadStyleProps: (props?: FileUploadStyleProps) => FileUploadStyle;
@@ -1,36 +1,38 @@
1
1
  import e from "classnames";
2
- import { useClassNamePrefix as L } from "../../hooks/useClassNamePrefix.js";
3
- const k = (a) => {
4
- const s = L("FileUploader"), t = "has-drag-and-drop", n = `${s}--fluid`, l = `${s}Input`, o = `${l}--disabled`, d = `${l}--${a?.validationState}`, p = "is-dragging", r = `${l}__dragAndDropLabel`, i = `${l}__dropZone`, u = `${i}Label`, c = `${l}__helperText`, f = `${l}__input`, U = `${l}__label`, C = `${l}__label--hidden`, _ = `${l}__label--required`, b = `${l}__link`, I = ["link-primary", "link-underlined"], $ = `${l}__validationText`, g = `${s}List`;
2
+ import { useClassNamePrefix as $ } from "../../hooks/useClassNamePrefix.js";
3
+ const L = (a) => {
4
+ const o = $("UNSTABLE_FileUpload"), s = "has-drag-and-drop", l = `${o}Input`, n = `${l}--disabled`, t = `${l}__dropZone--disabled`, i = `${l}__dropZone--compact`, d = `${l}--${a?.validationState}`, p = "is-dragging", r = `${l}__dragAndDropLabel`, c = `${l}__dropZone`, u = `${l}__dropZoneContent`, _ = `${l}__dropZoneLabel`, C = `${l}__helperText`, f = `${l}__input`, U = `${l}__label`, b = `${l}__label--hidden`, D = `${l}__label--required`, I = `${l}__validationText`;
5
5
  return {
6
6
  classProps: {
7
- root: e(s, { [n]: a?.isFluid }),
7
+ root: o,
8
8
  input: {
9
9
  root: e(l, {
10
- [t]: a?.isDragAndDropSupported,
11
- [o]: a?.isDisabled,
10
+ [s]: a?.isDragAndDropSupported,
11
+ [n]: a?.isDisabled,
12
12
  [p]: a?.isDragging,
13
13
  [d]: a?.validationState
14
14
  }),
15
15
  label: e(U, {
16
- [_]: a?.isRequired,
17
- [C]: a?.isLabelHidden
16
+ [D]: a?.isRequired,
17
+ [b]: a?.isLabelHidden
18
18
  }),
19
19
  input: f,
20
20
  dropLabel: r,
21
- helper: c,
22
- link: e(b, ...I),
23
- validationText: $,
21
+ helper: C,
22
+ validationText: I,
24
23
  dropZone: {
25
- root: i,
26
- label: u
24
+ root: e(c, {
25
+ [t]: a?.isDisabled,
26
+ [i]: a?.isCompact
27
+ }),
28
+ content: u,
29
+ label: _
27
30
  }
28
- },
29
- list: g
31
+ }
30
32
  }
31
33
  };
32
34
  };
33
35
  export {
34
- k as useFileUploadStyleProps
36
+ L as useFileUploadStyleProps
35
37
  };
36
38
  //# sourceMappingURL=useFileUploadStyleProps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFileUploadStyleProps.js","sources":["../../../src/components/UNSTABLE_FileUpload/useFileUploadStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type StyleProps, type Validation } from '../../types';\n\nexport interface FileUploadStyleProps extends StyleProps, Validation {\n isDisabled?: boolean;\n isDragAndDropSupported?: boolean;\n isDragging?: boolean;\n isFluid?: boolean;\n isLabelHidden?: boolean;\n isRequired?: boolean;\n}\n\nexport interface FileUploadStyle {\n /** className props */\n classProps: {\n root: string;\n input: {\n root: string;\n label: string;\n input: string;\n dropLabel: string;\n helper: string;\n link: string;\n validationText: string;\n dropZone: {\n root: string;\n label: string;\n };\n };\n list: string;\n };\n}\n\nexport const useFileUploadStyleProps = (props?: FileUploadStyleProps): FileUploadStyle => {\n const fileUploadClass = useClassNamePrefix('FileUploader');\n const fileUploadHasDragAndDropClass = 'has-drag-and-drop';\n const fileUploadFluidClass = `${fileUploadClass}--fluid`;\n const fileUploadInputClass = `${fileUploadClass}Input`;\n const fileUploadInputDisabledClass = `${fileUploadInputClass}--disabled`;\n const fileUploadInputValidationClass = `${fileUploadInputClass}--${props?.validationState}`;\n const fileUploadInputDraggingClass = 'is-dragging';\n const fileUploadInputDropLabelClass = `${fileUploadInputClass}__dragAndDropLabel`;\n const fileUploadInputDropZoneClass = `${fileUploadInputClass}__dropZone`;\n const fileUploadInputDropZoneLabelClass = `${fileUploadInputDropZoneClass}Label`;\n const fileUploadInputHelperClass = `${fileUploadInputClass}__helperText`;\n const fileUploadInputInputClass = `${fileUploadInputClass}__input`;\n const fileUploadInputLabelClass = `${fileUploadInputClass}__label`;\n const fileUploadInputLabelHiddenClass = `${fileUploadInputClass}__label--hidden`;\n const fileUploadInputLabelRequiredClass = `${fileUploadInputClass}__label--required`;\n const fileUploadInputLinkClass = `${fileUploadInputClass}__link`;\n const fileUploadInputLinkUtilityClasses = ['link-primary', 'link-underlined'];\n const fileUploadInputValidationTextClass = `${fileUploadInputClass}__validationText`;\n const fileUploadListClass = `${fileUploadClass}List`;\n\n return {\n classProps: {\n root: classNames(fileUploadClass, { [fileUploadFluidClass]: props?.isFluid }),\n input: {\n root: classNames(fileUploadInputClass, {\n [fileUploadHasDragAndDropClass]: props?.isDragAndDropSupported,\n [fileUploadInputDisabledClass]: props?.isDisabled,\n [fileUploadInputDraggingClass]: props?.isDragging,\n [fileUploadInputValidationClass]: props?.validationState,\n }),\n label: classNames(fileUploadInputLabelClass, {\n [fileUploadInputLabelRequiredClass]: props?.isRequired,\n [fileUploadInputLabelHiddenClass]: props?.isLabelHidden,\n }),\n input: fileUploadInputInputClass,\n dropLabel: fileUploadInputDropLabelClass,\n helper: fileUploadInputHelperClass,\n link: classNames(fileUploadInputLinkClass, ...fileUploadInputLinkUtilityClasses),\n validationText: fileUploadInputValidationTextClass,\n dropZone: {\n root: fileUploadInputDropZoneClass,\n label: fileUploadInputDropZoneLabelClass,\n },\n },\n list: fileUploadListClass,\n },\n };\n};\n"],"names":["useFileUploadStyleProps","props","fileUploadClass","useClassNamePrefix","fileUploadHasDragAndDropClass","fileUploadFluidClass","fileUploadInputClass","fileUploadInputDisabledClass","fileUploadInputValidationClass","fileUploadInputDraggingClass","fileUploadInputDropLabelClass","fileUploadInputDropZoneClass","fileUploadInputDropZoneLabelClass","fileUploadInputHelperClass","fileUploadInputInputClass","fileUploadInputLabelClass","fileUploadInputLabelHiddenClass","fileUploadInputLabelRequiredClass","fileUploadInputLinkClass","fileUploadInputLinkUtilityClasses","fileUploadInputValidationTextClass","fileUploadListClass","classNames"],"mappings":";;AAkCO,MAAMA,IAA0B,CAACC,MAAkD;AACxF,QAAMC,IAAkBC,EAAmB,cAAc,GACnDC,IAAgC,qBAChCC,IAAuB,GAAGH,CAAe,WACzCI,IAAuB,GAAGJ,CAAe,SACzCK,IAA+B,GAAGD,CAAoB,cACtDE,IAAiC,GAAGF,CAAoB,KAAKL,GAAO,eAAe,IACnFQ,IAA+B,eAC/BC,IAAgC,GAAGJ,CAAoB,sBACvDK,IAA+B,GAAGL,CAAoB,cACtDM,IAAoC,GAAGD,CAA4B,SACnEE,IAA6B,GAAGP,CAAoB,gBACpDQ,IAA4B,GAAGR,CAAoB,WACnDS,IAA4B,GAAGT,CAAoB,WACnDU,IAAkC,GAAGV,CAAoB,mBACzDW,IAAoC,GAAGX,CAAoB,qBAC3DY,IAA2B,GAAGZ,CAAoB,UAClDa,IAAoC,CAAC,gBAAgB,iBAAiB,GACtEC,IAAqC,GAAGd,CAAoB,oBAC5De,IAAsB,GAAGnB,CAAe;AAE9C,SAAO;AAAA,IACL,YAAY;AAAA,MACV,MAAMoB,EAAWpB,GAAiB,EAAE,CAACG,CAAoB,GAAGJ,GAAO,SAAS;AAAA,MAC5E,OAAO;AAAA,QACL,MAAMqB,EAAWhB,GAAsB;AAAA,UACrC,CAACF,CAA6B,GAAGH,GAAO;AAAA,UACxC,CAACM,CAA4B,GAAGN,GAAO;AAAA,UACvC,CAACQ,CAA4B,GAAGR,GAAO;AAAA,UACvC,CAACO,CAA8B,GAAGP,GAAO;AAAA,QAAA,CAC1C;AAAA,QACD,OAAOqB,EAAWP,GAA2B;AAAA,UAC3C,CAACE,CAAiC,GAAGhB,GAAO;AAAA,UAC5C,CAACe,CAA+B,GAAGf,GAAO;AAAA,QAAA,CAC3C;AAAA,QACD,OAAOa;AAAA,QACP,WAAWJ;AAAA,QACX,QAAQG;AAAA,QACR,MAAMS,EAAWJ,GAA0B,GAAGC,CAAiC;AAAA,QAC/E,gBAAgBC;AAAA,QAChB,UAAU;AAAA,UACR,MAAMT;AAAA,UACN,OAAOC;AAAA,QAAA;AAAA,MACT;AAAA,MAEF,MAAMS;AAAA,IAAA;AAAA,EACR;AAEJ;"}
1
+ {"version":3,"file":"useFileUploadStyleProps.js","sources":["../../../src/components/UNSTABLE_FileUpload/useFileUploadStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type StyleProps, type Validation } from '../../types';\n\nexport interface FileUploadStyleProps extends StyleProps, Validation {\n isDisabled?: boolean;\n isCompact?: boolean;\n isDragAndDropSupported?: boolean;\n isDragging?: boolean;\n isLabelHidden?: boolean;\n isRequired?: boolean;\n}\n\nexport interface FileUploadStyle {\n /** className props */\n classProps: {\n root: string;\n input: {\n root: string;\n label: string;\n input: string;\n dropLabel: string;\n helper: string;\n validationText: string;\n dropZone: {\n root: string;\n content: string;\n label: string;\n };\n };\n };\n}\n\nexport const useFileUploadStyleProps = (props?: FileUploadStyleProps): FileUploadStyle => {\n const fileUploadClass = useClassNamePrefix('UNSTABLE_FileUpload');\n const fileUploadHasDragAndDropClass = 'has-drag-and-drop';\n const fileUploadInputClass = `${fileUploadClass}Input`;\n const fileUploadInputDisabledClass = `${fileUploadInputClass}--disabled`;\n const fileUploadDropZoneDisabledClass = `${fileUploadInputClass}__dropZone--disabled`;\n const fileUploadDropZoneCompactClass = `${fileUploadInputClass}__dropZone--compact`;\n const fileUploadInputValidationClass = `${fileUploadInputClass}--${props?.validationState}`;\n const fileUploadInputDraggingClass = 'is-dragging';\n const fileUploadInputDropLabelClass = `${fileUploadInputClass}__dragAndDropLabel`;\n const fileUploadInputDropZoneClass = `${fileUploadInputClass}__dropZone`;\n const fileUploadInputDropZoneContentClass = `${fileUploadInputClass}__dropZoneContent`;\n const fileUploadInputDropZoneLabelClass = `${fileUploadInputClass}__dropZoneLabel`;\n const fileUploadInputHelperClass = `${fileUploadInputClass}__helperText`;\n const fileUploadInputInputClass = `${fileUploadInputClass}__input`;\n const fileUploadInputLabelClass = `${fileUploadInputClass}__label`;\n const fileUploadInputLabelHiddenClass = `${fileUploadInputClass}__label--hidden`;\n const fileUploadInputLabelRequiredClass = `${fileUploadInputClass}__label--required`;\n const fileUploadInputValidationTextClass = `${fileUploadInputClass}__validationText`;\n\n return {\n classProps: {\n root: fileUploadClass,\n input: {\n root: classNames(fileUploadInputClass, {\n [fileUploadHasDragAndDropClass]: props?.isDragAndDropSupported,\n [fileUploadInputDisabledClass]: props?.isDisabled,\n [fileUploadInputDraggingClass]: props?.isDragging,\n [fileUploadInputValidationClass]: props?.validationState,\n }),\n label: classNames(fileUploadInputLabelClass, {\n [fileUploadInputLabelRequiredClass]: props?.isRequired,\n [fileUploadInputLabelHiddenClass]: props?.isLabelHidden,\n }),\n input: fileUploadInputInputClass,\n dropLabel: fileUploadInputDropLabelClass,\n helper: fileUploadInputHelperClass,\n validationText: fileUploadInputValidationTextClass,\n dropZone: {\n root: classNames(fileUploadInputDropZoneClass, {\n [fileUploadDropZoneDisabledClass]: props?.isDisabled,\n [fileUploadDropZoneCompactClass]: props?.isCompact,\n }),\n content: fileUploadInputDropZoneContentClass,\n label: fileUploadInputDropZoneLabelClass,\n },\n },\n },\n };\n};\n"],"names":["useFileUploadStyleProps","props","fileUploadClass","useClassNamePrefix","fileUploadHasDragAndDropClass","fileUploadInputClass","fileUploadInputDisabledClass","fileUploadDropZoneDisabledClass","fileUploadDropZoneCompactClass","fileUploadInputValidationClass","fileUploadInputDraggingClass","fileUploadInputDropLabelClass","fileUploadInputDropZoneClass","fileUploadInputDropZoneContentClass","fileUploadInputDropZoneLabelClass","fileUploadInputHelperClass","fileUploadInputInputClass","fileUploadInputLabelClass","fileUploadInputLabelHiddenClass","fileUploadInputLabelRequiredClass","fileUploadInputValidationTextClass","classNames"],"mappings":";;AAiCO,MAAMA,IAA0B,CAACC,MAAkD;AACxF,QAAMC,I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EACF;AAEJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("../../constants/dictionaries.cjs"),t=e.createContext({size:r.Sizes.MEDIUM}),i=t.Provider,o=()=>e.useContext(t);exports.PickerContextProvider=i;exports.usePickerContext=o;
2
+ //# sourceMappingURL=PickerContext.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickerContext.cjs","sources":["../../../src/components/UNSTABLE_Picker/PickerContext.ts"],"sourcesContent":["'use client';\n\nimport { createContext, useContext } from 'react';\nimport { Sizes } from '../../constants';\nimport type { UnstablePickerContextType } from './types';\n\nconst PickerContext = createContext<UnstablePickerContextType>({ size: Sizes.MEDIUM });\n\nexport const PickerContextProvider = PickerContext.Provider;\n\nexport const usePickerContext = () => useContext(PickerContext);\n"],"names":["PickerContext","createContext","Sizes","PickerContextProvider","usePickerContext","useContext"],"mappings":"oKAMMA,EAAgBC,EAAAA,cAAyC,CAAE,KAAMC,EAAAA,MAAM,OAAQ,EAExEC,EAAwBH,EAAc,SAEtCI,EAAmB,IAAMC,EAAAA,WAAWL,CAAa"}
@@ -0,0 +1,3 @@
1
+ import { UnstablePickerContextType } from './types';
2
+ export declare const PickerContextProvider: React.Provider<UnstablePickerContextType>;
3
+ export declare const usePickerContext: () => UnstablePickerContextType;
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { useContext as t, createContext as o } from "react";
3
+ import { Sizes as r } from "../../constants/dictionaries.js";
4
+ const e = o({ size: r.MEDIUM }), c = e.Provider, n = () => t(e);
5
+ export {
6
+ c as PickerContextProvider,
7
+ n as usePickerContext
8
+ };
9
+ //# sourceMappingURL=PickerContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickerContext.js","sources":["../../../src/components/UNSTABLE_Picker/PickerContext.ts"],"sourcesContent":["'use client';\n\nimport { createContext, useContext } from 'react';\nimport { Sizes } from '../../constants';\nimport type { UnstablePickerContextType } from './types';\n\nconst PickerContext = createContext<UnstablePickerContextType>({ size: Sizes.MEDIUM });\n\nexport const PickerContextProvider = PickerContext.Provider;\n\nexport const usePickerContext = () => useContext(PickerContext);\n"],"names":["PickerContext","createContext","Sizes","PickerContextProvider","usePickerContext","useContext"],"mappings":";;;AAMA,MAAMA,IAAgBC,EAAyC,EAAE,MAAMC,EAAM,QAAQ,GAExEC,IAAwBH,EAAc,UAEtCI,IAAmB,MAAMC,EAAWL,CAAa;"}
@@ -0,0 +1,2 @@
1
+ "use strict";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),o=require("../../constants/selection.cjs"),r={id:"",isDisabled:!1,onSelectionChange:()=>{},selectedKeys:[],selectionMode:o.MULTIPLE_SELECTION_MODE},t=e.createContext(r),n=t.Provider,c=()=>e.useContext(t);exports.PickerPopoverContextProvider=n;exports.usePickerPopoverContext=c;
2
+ //# sourceMappingURL=PickerPopoverContext.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickerPopoverContext.cjs","sources":["../../../src/components/UNSTABLE_Picker/PickerPopoverContext.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, useContext } from 'react';\nimport { MULTIPLE_SELECTION_MODE } from '../../constants';\nimport type { UnstablePickerPopoverContextValue } from './types';\n\nconst defaultContext: UnstablePickerPopoverContextValue = {\n id: '',\n isDisabled: false,\n onSelectionChange: () => {},\n selectedKeys: [],\n selectionMode: MULTIPLE_SELECTION_MODE,\n};\n\nconst PickerPopoverContext = createContext<UnstablePickerPopoverContextValue>(defaultContext);\n\nexport const PickerPopoverContextProvider = PickerPopoverContext.Provider;\n\nexport const usePickerPopoverContext = (): UnstablePickerPopoverContextValue => useContext(PickerPopoverContext);\n"],"names":["defaultContext","MULTIPLE_SELECTION_MODE","PickerPopoverContext","createContext","PickerPopoverContextProvider","usePickerPopoverContext","useContext"],"mappings":"iKAMMA,EAAoD,CACxD,GAAI,GACJ,WAAY,GACZ,kBAAmB,IAAM,CAAC,EAC1B,aAAc,CAAA,EACd,cAAeC,EAAAA,uBACjB,EAEMC,EAAuBC,EAAAA,cAAiDH,CAAc,EAE/EI,EAA+BF,EAAqB,SAEpDG,EAA0B,IAAyCC,EAAAA,WAAWJ,CAAoB"}
@@ -0,0 +1,3 @@
1
+ import { UnstablePickerPopoverContextValue } from './types';
2
+ export declare const PickerPopoverContextProvider: React.Provider<UnstablePickerPopoverContextValue>;
3
+ export declare const usePickerPopoverContext: () => UnstablePickerPopoverContextValue;
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { createContext as o, useContext as t } from "react";
3
+ import { MULTIPLE_SELECTION_MODE as r } from "../../constants/selection.js";
4
+ const n = {
5
+ id: "",
6
+ isDisabled: !1,
7
+ onSelectionChange: () => {
8
+ },
9
+ selectedKeys: [],
10
+ selectionMode: r
11
+ }, e = o(n), c = e.Provider, P = () => t(e);
12
+ export {
13
+ c as PickerPopoverContextProvider,
14
+ P as usePickerPopoverContext
15
+ };
16
+ //# sourceMappingURL=PickerPopoverContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickerPopoverContext.js","sources":["../../../src/components/UNSTABLE_Picker/PickerPopoverContext.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, useContext } from 'react';\nimport { MULTIPLE_SELECTION_MODE } from '../../constants';\nimport type { UnstablePickerPopoverContextValue } from './types';\n\nconst defaultContext: UnstablePickerPopoverContextValue = {\n id: '',\n isDisabled: false,\n onSelectionChange: () => {},\n selectedKeys: [],\n selectionMode: MULTIPLE_SELECTION_MODE,\n};\n\nconst PickerPopoverContext = createContext<UnstablePickerPopoverContextValue>(defaultContext);\n\nexport const PickerPopoverContextProvider = PickerPopoverContext.Provider;\n\nexport const usePickerPopoverContext = (): UnstablePickerPopoverContextValue => useContext(PickerPopoverContext);\n"],"names":["defaultContext","MULTIPLE_SELECTION_MODE","PickerPopoverContext","createContext","PickerPopoverContextProvider","usePickerPopoverContext","useContext"],"mappings":";;;AAMA,MAAMA,IAAoD;AAAA,EACxD,IAAI;AAAA,EACJ,YAAY;AAAA,EACZ,mBAAmB,MAAM;AAAA,EAAC;AAAA,EAC1B,cAAc,CAAA;AAAA,EACd,eAAeC;AACjB,GAEMC,IAAuBC,EAAiDH,CAAc,GAE/EI,IAA+BF,EAAqB,UAEpDG,IAA0B,MAAyCC,EAAWJ,CAAoB;"}
@@ -0,0 +1,2 @@
1
+ "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),ge=require("classnames"),r=require("react"),me=require("../../constants/selection.cjs"),Pe=require("../../hooks/styleProps.cjs"),be=require("../../hooks/useAriaIdRefs.cjs"),ve=require("../../hooks/useI18n.cjs"),B=require("../../hooks/useSelectionState.cjs"),U=require("../../translations/replaceTranslationParams.cjs"),xe=require("../Dropdown/Dropdown.cjs"),fe=require("../Dropdown/DropdownPopover.cjs"),Te=require("../Field/HelperText.cjs"),ye=require("../Field/Label.cjs"),ke=require("../Field/ValidationText.cjs"),Se=require("../Field/useValidationTextRole.cjs"),qe=require("../Icon/Icon.cjs"),he=require("../VisuallyHidden/VisuallyHidden.cjs"),Ie=require("./constants.cjs"),Le=require("./PickerContext.cjs"),Ae=require("./PickerPopoverContext.cjs"),w=require("./UNSTABLE_PickerTag.cjs"),Ne=require("./usePickerId.cjs"),Re=require("./usePickerPopoverTabOutToTrigger.cjs"),je=require("./usePickerSelectionGridKeyboard.cjs"),Ce=require("./usePickerStyleProps.cjs"),p=require("./utils.cjs"),Ee=(O,V)=>{const{t:n}=ve.useI18n(),{"aria-describedby":G="",addButtonLabel:F=n("picker.add"),children:x,closeButtonLabel:H=n("common.close"),emptySelectionLabel:q,helperText:$,id:z,isAggregated:f=!1,isDisabled:o=!1,isFluid:Z=!1,isLabelHidden:J=!1,isOpen:t,isRequired:Q=!1,label:i,onSelectionChange:c,onToggle:g,removeAllLabel:W=n("picker.removeAll"),renderTags:h,selectedKeys:d,selectionAriaLabel:X=n("picker.selectionAriaLabel"),selectionMode:u=me.MULTIPLE_SELECTION_MODE,size:I=Ie.DEFAULT_SIZE,tagDescriptionText:Y=n("picker.tagDescriptionText"),hasValidationIcon:ee,validationState:m,validationText:L,...re}=O,[te,A]=be.useAriaDescribedBy(G),se=Se.useValidationTextRole({validationState:m,validationText:L}),{classProps:s}=Ce.usePickerStyleProps({isDisabled:o,isFluid:Z,isLabelHidden:J,isRequired:Q,size:I,validationState:m}),{styleProps:N,props:oe}=Pe.useStyleProps(re),{labelId:R,pickerId:P,popoverId:j,selectionId:ie,tagDescriptionId:C}=Ne.usePickerId(z),E=r.useMemo(()=>p.collectPickerItems(x),[x]),_=r.useMemo(()=>p.getPickerItemLabelMap(E),[E]),b=r.useMemo(()=>B.getSelectedKeys(d,u),[d,u]),a=r.useMemo(()=>p.getSelectedItems(b,_),[b,_]),D=l=>B.isSingleSelectionMode(u)?c([]):c(d.filter(v=>v!==l)),ae=()=>c([]),K=r.useRef(null),M=r.useRef(null),T=r.useCallback(()=>{t&&(g(),Promise.resolve().then(()=>{M.current?.focus()}))},[t,g]),{onPopoverKeyDownCapture:le}=Re.usePickerPopoverTabOutToTrigger({isOpen:t,onClose:T}),ne=p.getPickerSelectionGridKeyboardRowCount(a.length,{isAggregated:f}),{getKeyboardGridRowProps:y,removeTagAtIndex:k}=je.usePickerSelectionGridKeyboard({isDisabled:o,isPopoverOpen:t,onRemoveAtIndex:l=>{f?ae():D(a[l].value)},selectionRef:K,tagCount:ne}),ce=q?U.replaceTranslationParams(q,{label:i}):i,de=p.getAggregatedTagLabel(i,a),ue=a.length?h?h({getKeyboardGridRowProps:y,onRemove:D,removeTagAtIndex:k}):f?e.jsx(w.default,{tagKeyboardProps:y(0),isDisabled:o,label:de,onRemove:()=>k(0),removeLabel:W}):a.map((l,v)=>e.jsx(w.default,{tagKeyboardProps:y(v),isDisabled:o,label:l.label,onRemove:()=>k(v)},l.value)):e.jsx("span",{"aria-hidden":"true",className:s.selectionEmpty,children:ce}),pe=r.useMemo(()=>({id:P,isDisabled:o,onSelectionChange:c,selectedKeys:b,selectionMode:u}),[b,o,c,P,u]);return r.useImperativeHandle(V,()=>({close:T,selectedKeys:d}),[T,d]),e.jsx(Le.PickerContextProvider,{value:{size:I,tagDescriptionId:C},children:e.jsxs("div",{...N,className:ge(s.root,N.className),...oe,children:[e.jsx(ye.default,{id:R,UNSAFE_className:s.label,elementType:"span",children:i}),e.jsxs(xe.default,{id:j,isOpen:t,onToggle:g,children:[e.jsxs("div",{role:"group","aria-label":i,className:s.inputContainer,children:[e.jsx("div",{ref:K,...te,id:ie,role:a.length?"grid":"group","aria-label":U.replaceTranslationParams(X,{label:i}),"aria-live":"off","aria-atomic":!1,"aria-relevant":"additions",className:s.selection,children:ue}),e.jsxs("button",{ref:M,type:"button",className:s.trigger,"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":j,onClick:g,disabled:o,children:[e.jsx(he.default,{children:t?H:F}),e.jsx(qe.default,{name:`chevron-${t?"up":"down"}`,boxSize:20})]})]}),e.jsx(fe.default,{"aria-labelledby":R,role:"dialog","aria-modal":"true",onKeyDownCapture:le,children:e.jsx(Ae.PickerPopoverContextProvider,{value:pe,children:x})})]}),e.jsx(Te.default,{UNSAFE_className:s.helperText,id:`${P}-helper-text`,registerAria:A,helperText:$}),m&&e.jsx(ke.default,{UNSAFE_className:s.validationText,id:`${P}-validation-text`,...ee&&{hasValidationStateIcon:m},validationText:L,registerAria:A,role:se}),e.jsx("span",{id:C,hidden:!0,children:Y})]})})},S=r.forwardRef(Ee);S.spiritComponent="UNSTABLE_Picker";S.displayName="UNSTABLE_Picker";exports.default=S;
2
+ //# sourceMappingURL=UNSTABLE_Picker.cjs.map