@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
@@ -0,0 +1,66 @@
1
+ "use client";
2
+ import { useState as f, useCallback as R, useEffect as h } from "react";
3
+ import { useStyleProps as v } from "../../hooks/styleProps.js";
4
+ import { useControlledModeGuard as E } from "../../hooks/useControlledModeGuard.js";
5
+ import { useDebouncedValue as S } from "../../hooks/useDebouncedValue.js";
6
+ import { defaultLabels as b } from "../../translations/defaults.js";
7
+ import { replaceTranslationParams as m } from "../../translations/replaceTranslationParams.js";
8
+ import { CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS as _ } from "./constants.js";
9
+ const i = b.textArea.counter, M = (t, e) => e !== void 0 ? `${t}/${e}` : String(t), P = (t, e) => {
10
+ if (e === void 0)
11
+ return m(i.charactersEntered, { count: t });
12
+ if (t === 0)
13
+ return m(i.canEnterUpTo, { maxLength: e });
14
+ if (t > e) {
15
+ const s = t - e, n = s === 1 ? i.characterOverLimit : i.charactersOverLimit;
16
+ return m(n, { count: s });
17
+ }
18
+ const r = e - t, a = r === 1 ? i.characterRemaining : i.charactersRemaining;
19
+ return m(a, { count: r });
20
+ }, U = (t) => {
21
+ const { value: e, defaultValue: r, counterThreshold: a, hasCounter: s, onChange: n } = t, c = e !== void 0;
22
+ E({
23
+ componentName: "useCharacterCounterState",
24
+ value: e,
25
+ defaultValue: r
26
+ });
27
+ const [C, d] = f(
28
+ () => c ? e.length : r?.length ?? 0
29
+ ), u = c ? e.length : C, o = s === !0 || a !== void 0, p = R(
30
+ (l) => {
31
+ !c && o && d(l.target.value.length), n?.(l);
32
+ },
33
+ [c, o, n]
34
+ );
35
+ return {
36
+ counterProps: o ? {
37
+ counterThreshold: a,
38
+ currentLength: u,
39
+ hasCounter: s
40
+ } : void 0,
41
+ handleChange: p
42
+ };
43
+ }, D = (t) => {
44
+ const { counterThreshold: e, currentLength: r, hasCounter: a, id: s, registerAria: n, ...c } = t, { styleProps: C, props: d } = v(c), u = a === !0 || e !== void 0, o = `${s}__counterScreenReaderMessage`, p = M(r, e), g = P(r, e), l = S(
45
+ g,
46
+ _
47
+ );
48
+ return h(() => {
49
+ if (u)
50
+ return n({ add: o }), () => {
51
+ n({ remove: o });
52
+ };
53
+ }, [u, o, n]), {
54
+ debouncedScreenReaderMessage: l,
55
+ isVisible: u,
56
+ screenReaderMessageId: o,
57
+ styleProps: C,
58
+ transferProps: d,
59
+ visibleCounterText: p
60
+ };
61
+ };
62
+ export {
63
+ D as useCharacterCounter,
64
+ U as useCharacterCounterState
65
+ };
66
+ //# sourceMappingURL=useCharacterCounterState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCharacterCounterState.js","sources":["../../../src/components/CharacterCounter/useCharacterCounterState.ts"],"sourcesContent":["'use client';\n\nimport { type ChangeEvent, useCallback, useEffect, useState } from 'react';\nimport { type StylePropsResult, useControlledModeGuard, useDebouncedValue, useStyleProps } from '../../hooks';\nimport { defaultLabels, replaceTranslationParams } from '../../translations';\nimport { type TextAreaCounterRenderProps } from '../../types';\nimport { CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS } from './constants';\nimport { type CharacterCounterProps } from './types';\n\n/** Return value of the useCharacterCounterState hook */\nexport interface CharacterCounterState {\n /** Props to pass to CharacterCounter, or undefined when counter is hidden */\n counterProps: TextAreaCounterRenderProps | undefined;\n /** Change handler that updates internal length and calls the provided onChange */\n handleChange: (event: ChangeEvent<HTMLTextAreaElement>) => void;\n}\n\n/** Props for the useCharacterCounterState hook */\nexport interface UseCharacterCounterStateProps {\n /** Character threshold shown after the slash in the counter (e.g. `5/200`); implicitly enables the counter */\n counterThreshold?: number;\n /** Initial value when uncontrolled */\n defaultValue?: string;\n /** Whether to show the character counter; automatically true when `counterThreshold` is set */\n hasCounter?: boolean;\n /** Called when the textarea value changes */\n onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;\n /** Controlled value (takes precedence over defaultValue) */\n value?: string;\n}\n\n/** Return value of the `useCharacterCounter` hook (visible + screen reader presentation for `CharacterCounter`). */\nexport interface UseCharacterCounterResult {\n debouncedScreenReaderMessage: string;\n isVisible: boolean;\n screenReaderMessageId: string;\n styleProps: StylePropsResult['styleProps'];\n transferProps: StylePropsResult['props'];\n visibleCounterText: string;\n}\n\nconst COUNTER_LABELS = defaultLabels.textArea.counter;\n\n/**\n * Builds the visible counter label (`current/max` or count only).\n *\n * @param currentLength - Current number of characters.\n * @param counterThreshold - When set, label includes a slash and this max; when omitted, only the count is shown.\n * @returns {string} Formatted string for the aria-hidden counter element.\n */\nconst getCharacterCounterVisibleText = (currentLength: number, counterThreshold: number | undefined): string =>\n counterThreshold !== undefined ? `${currentLength}/${counterThreshold}` : String(currentLength);\n\n/**\n * Builds the polite live-region message for assistive technologies (remaining, over limit, count-only, etc.).\n *\n * @param currentLength - Current number of characters.\n * @param counterThreshold - When set, messages relate to this max; when omitted, only “characters entered” copy is used.\n * @returns {string} Localized screen reader string (not debounced).\n */\nconst getCharacterCounterScreenReaderMessage = (\n currentLength: number,\n counterThreshold: number | undefined,\n): string => {\n if (counterThreshold === undefined) {\n return replaceTranslationParams(COUNTER_LABELS.charactersEntered, { count: currentLength });\n }\n\n if (currentLength === 0) {\n return replaceTranslationParams(COUNTER_LABELS.canEnterUpTo, { maxLength: counterThreshold });\n }\n\n if (currentLength > counterThreshold) {\n const overCount = currentLength - counterThreshold;\n const template = overCount === 1 ? COUNTER_LABELS.characterOverLimit : COUNTER_LABELS.charactersOverLimit;\n\n return replaceTranslationParams(template, { count: overCount });\n }\n\n const remaining = counterThreshold - currentLength;\n const template = remaining === 1 ? COUNTER_LABELS.characterRemaining : COUNTER_LABELS.charactersRemaining;\n\n return replaceTranslationParams(template, { count: remaining });\n};\n\n/**\n * Tracks textarea length for `TextArea` and exposes `counterProps` plus a change handler when the counter is active.\n *\n * @param props - Controlled/uncontrolled value and counter flags; see {@link UseCharacterCounterStateProps}.\n * @returns {CharacterCounterState} Counter props for `CharacterCounter` (if visible) and textarea `onChange` handler.\n */\nexport const useCharacterCounterState = (props: UseCharacterCounterStateProps): CharacterCounterState => {\n const { value, defaultValue, counterThreshold, hasCounter, onChange } = props;\n const isControlled = value !== undefined;\n\n useControlledModeGuard({\n componentName: 'useCharacterCounterState',\n value,\n defaultValue,\n });\n\n const [internalLength, setInternalLength] = useState(() =>\n isControlled ? value.length : (defaultValue?.length ?? 0),\n );\n\n const currentLength = isControlled ? value.length : internalLength;\n const isCounterVisible = hasCounter === true || counterThreshold !== undefined;\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLTextAreaElement>) => {\n if (!isControlled && isCounterVisible) {\n setInternalLength(event.target.value.length);\n }\n onChange?.(event);\n },\n [isControlled, isCounterVisible, onChange],\n );\n\n const counterProps: TextAreaCounterRenderProps | undefined = isCounterVisible\n ? {\n counterThreshold,\n currentLength,\n hasCounter,\n }\n : undefined;\n\n return {\n counterProps,\n handleChange,\n };\n};\n\n/**\n * Presentation hook for `CharacterCounter`: style props, visible text, debounced screen reader text, and ARIA id registration.\n *\n * @param props - Full `CharacterCounterProps` including `id` and `registerAria`.\n * @returns {UseCharacterCounterResult} Values to render the visible counter and `VisuallyHidden` live region.\n */\nexport const useCharacterCounter = (props: CharacterCounterProps): UseCharacterCounterResult => {\n const { counterThreshold, currentLength, hasCounter, id, registerAria, ...restProps } = props;\n const { styleProps, props: transferProps } = useStyleProps(restProps);\n const isVisible = hasCounter === true || counterThreshold !== undefined;\n const screenReaderMessageId = `${id}__counterScreenReaderMessage`;\n const visibleCounterText = getCharacterCounterVisibleText(currentLength, counterThreshold);\n const screenReaderMessage = getCharacterCounterScreenReaderMessage(currentLength, counterThreshold);\n const debouncedScreenReaderMessage = useDebouncedValue(\n screenReaderMessage,\n CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS,\n );\n\n useEffect(() => {\n if (isVisible) {\n registerAria({ add: screenReaderMessageId });\n\n return () => {\n registerAria({ remove: screenReaderMessageId });\n };\n }\n\n return undefined;\n }, [isVisible, screenReaderMessageId, registerAria]);\n\n return {\n debouncedScreenReaderMessage,\n isVisible,\n screenReaderMessageId,\n styleProps,\n transferProps,\n visibleCounterText,\n };\n};\n"],"names":["COUNTER_LABELS","defaultLabels","getCharacterCounterVisibleText","currentLength","counterThreshold","getCharacterCounterScreenReaderMessage","replaceTranslationParams","overCount","template","remaining","useCharacterCounterState","props","value","defaultValue","hasCounter","onChange","isControlled","useControlledModeGuard","internalLength","setInternalLength","useState","isCounterVisible","handleChange","useCallback","event","useCharacterCounter","id","registerAria","restProps","styleProps","transferProps","useStyleProps","isVisible","screenReaderMessageId","visibleCounterText","screenReaderMessage","debouncedScreenReaderMessage","useDebouncedValue","CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS","useEffect"],"mappings":";;;;;;;;AAyCA,MAAMA,IAAiBC,EAAc,SAAS,SASxCC,IAAiC,CAACC,GAAuBC,MAC7DA,MAAqB,SAAY,GAAGD,CAAa,IAAIC,CAAgB,KAAK,OAAOD,CAAa,GAS1FE,IAAyC,CAC7CF,GACAC,MACW;AACX,MAAIA,MAAqB;AACvB,WAAOE,EAAyBN,EAAe,mBAAmB,EAAE,OAAOG,GAAe;AAG5F,MAAIA,MAAkB;AACpB,WAAOG,EAAyBN,EAAe,cAAc,EAAE,WAAWI,GAAkB;AAG9F,MAAID,IAAgBC,GAAkB;AACpC,UAAMG,IAAYJ,IAAgBC,GAC5BI,IAAWD,MAAc,IAAIP,EAAe,qBAAqBA,EAAe;AAEtF,WAAOM,EAAyBE,GAAU,EAAE,OAAOD,GAAW;AAAA,EAChE;AAEA,QAAME,IAAYL,IAAmBD,GAC/BK,IAAWC,MAAc,IAAIT,EAAe,qBAAqBA,EAAe;AAEtF,SAAOM,EAAyBE,GAAU,EAAE,OAAOC,GAAW;AAChE,GAQaC,IAA2B,CAACC,MAAgE;AACvG,QAAM,EAAE,OAAAC,GAAO,cAAAC,GAAc,kBAAAT,GAAkB,YAAAU,GAAY,UAAAC,MAAaJ,GAClEK,IAAeJ,MAAU;AAE/B,EAAAK,EAAuB;AAAA,IACrB,eAAe;AAAA,IACf,OAAAL;AAAA,IACA,cAAAC;AAAA,EAAA,CACD;AAED,QAAM,CAACK,GAAgBC,CAAiB,IAAIC;AAAA,IAAS,MACnDJ,IAAeJ,EAAM,SAAUC,GAAc,UAAU;AAAA,EAAA,GAGnDV,IAAgBa,IAAeJ,EAAM,SAASM,GAC9CG,IAAmBP,MAAe,MAAQV,MAAqB,QAE/DkB,IAAeC;AAAA,IACnB,CAACC,MAA4C;AAC3C,MAAI,CAACR,KAAgBK,KACnBF,EAAkBK,EAAM,OAAO,MAAM,MAAM,GAE7CT,IAAWS,CAAK;AAAA,IAClB;AAAA,IACA,CAACR,GAAcK,GAAkBN,CAAQ;AAAA,EAAA;AAW3C,SAAO;AAAA,IACL,cAT2DM,IACzD;AAAA,MACE,kBAAAjB;AAAA,MACA,eAAAD;AAAA,MACA,YAAAW;AAAA,IAAA,IAEF;AAAA,IAIF,cAAAQ;AAAA,EAAA;AAEJ,GAQaG,IAAsB,CAACd,MAA4D;AAC9F,QAAM,EAAE,kBAAAP,GAAkB,eAAAD,GAAe,YAAAW,GAAY,IAAAY,GAAI,cAAAC,GAAc,GAAGC,MAAcjB,GAClF,EAAE,YAAAkB,GAAY,OAAOC,EAAA,IAAkBC,EAAcH,CAAS,GAC9DI,IAAYlB,MAAe,MAAQV,MAAqB,QACxD6B,IAAwB,GAAGP,CAAE,gCAC7BQ,IAAqBhC,EAA+BC,GAAeC,CAAgB,GACnF+B,IAAsB9B,EAAuCF,GAAeC,CAAgB,GAC5FgC,IAA+BC;AAAA,IACnCF;AAAA,IACAG;AAAA,EAAA;AAGF,SAAAC,EAAU,MAAM;AACd,QAAIP;AACF,aAAAL,EAAa,EAAE,KAAKM,GAAuB,GAEpC,MAAM;AACX,QAAAN,EAAa,EAAE,QAAQM,GAAuB;AAAA,MAChD;AAAA,EAIJ,GAAG,CAACD,GAAWC,GAAuBN,CAAY,CAAC,GAE5C;AAAA,IACL,8BAAAS;AAAA,IACA,WAAAJ;AAAA,IACA,uBAAAC;AAAA,IACA,YAAAJ;AAAA,IACA,eAAAC;AAAA,IACA,oBAAAI;AAAA,EAAA;AAEJ;"}
@@ -0,0 +1,2 @@
1
+ export * from './CharacterCounter/index'
2
+ export {}
@@ -1,2 +1,2 @@
1
- "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),_=require("classnames"),f=require("react"),k=require("../../hooks/styleProps.cjs"),j=require("../../hooks/useAriaDescribedBy.cjs"),A=require("../Field/HelperText.cjs"),C=require("../Field/Label.cjs"),R=require("../Field/useAriaIds.cjs"),g=require("../Field/ValidationText.cjs"),D=require("../Field/useValidationTextRole.cjs"),V=require("./useCheckboxStyleProps.cjs"),B=(c,d)=>{const{classProps:e,props:n}=V.useCheckboxStyleProps(c),{"aria-describedby":u="",hasValidationIcon:p,helperText:x,id:t,isChecked:b,isDisabled:h,isRequired:y,label:m,validationState:r,validationText:a,value:q,...N}=n,{styleProps:o,props:P}=k.useStyleProps(N),[T,l]=R.default(u),v=j.useAriaDescribedBy(T),S=D.useValidationTextRole({validationState:r,validationText:a});return s.jsxs("div",{style:o.style,className:_(e.root,o.className),children:[s.jsx("input",{...P,...v,type:"checkbox",id:t,className:e.input,disabled:h,required:y,checked:b,value:q,ref:d}),s.jsxs("div",{className:e.text,children:[s.jsx(C.default,{UNSAFE_className:e.label,htmlFor:t,children:m}),s.jsx(A.default,{UNSAFE_className:e.helperText,id:`${t}__helperText`,registerAria:l,helperText:x}),r&&s.jsx(g.default,{UNSAFE_className:e.validationText,id:`${t}__validationText`,...p&&{hasValidationStateIcon:r},validationText:a,registerAria:l,role:S})]})]})},i=f.forwardRef(B);i.spiritComponent="Checkbox";i.displayName="Checkbox";exports.default=i;
1
+ "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),j=require("classnames"),k=require("react"),C=require("../../hooks/styleProps.cjs"),d=require("../../hooks/useAriaIdRefs.cjs"),R=require("../Field/HelperText.cjs"),g=require("../Field/Label.cjs"),V=require("../Field/ValidationText.cjs"),F=require("../Field/useValidationTextRole.cjs"),I=require("../InputDetails/InputDetails.cjs"),$=require("./useCheckboxStyleProps.cjs"),B=(n,u)=>{const{classProps:s,props:p}=$.useCheckboxStyleProps(n),{"aria-describedby":x="","aria-details":h,details:a,hasValidationIcon:b,helperText:y,id:t,isChecked:m,isDisabled:q,isRequired:P,label:N,validationState:i,validationText:l,value:T,...f}=p,{styleProps:o,props:v}=C.useStyleProps(f),[A,c]=d.useAriaDescribedBy(x),[D,S]=d.useAriaDetails(h),_=F.useValidationTextRole({validationState:i,validationText:l});return e.jsxs("div",{style:o.style,className:j(s.root,o.className),children:[e.jsx("input",{...v,...A,...D,type:"checkbox",id:t,className:s.input,disabled:q,required:P,checked:m,value:T,ref:u}),e.jsxs("div",{className:s.text,children:[e.jsx(g.default,{UNSAFE_className:s.label,htmlFor:t,children:N}),a&&e.jsx(I.default,{id:`${t}-details`,registerAriaDetails:S,children:a}),e.jsx(R.default,{UNSAFE_className:s.helperText,id:`${t}__helperText`,registerAria:c,helperText:y}),i&&e.jsx(V.default,{UNSAFE_className:s.validationText,id:`${t}__validationText`,...b&&{hasValidationStateIcon:i},validationText:l,registerAria:c,role:_})]})]})},r=k.forwardRef(B);r.spiritComponent="Checkbox";r.displayName="Checkbox";exports.default=r;
2
2
  //# sourceMappingURL=Checkbox.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.cjs","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritCheckboxProps } from '../../types';\nimport { HelperText, Label, ValidationText, useAriaIds } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { useCheckboxStyleProps } from './useCheckboxStyleProps';\n\nconst _Checkbox = (props: SpiritCheckboxProps, ref: ForwardedRef<HTMLInputElement>): JSX.Element => {\n const { classProps, props: modifiedProps } = useCheckboxStyleProps(props);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n hasValidationIcon,\n helperText,\n id,\n isChecked,\n isDisabled,\n isRequired,\n label,\n validationState,\n validationText,\n value,\n ...restProps\n } = modifiedProps;\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const [ids, register] = useAriaIds(ariaDescribedBy);\n const ariaDescribedByProp = useAriaDescribedBy(ids);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <div style={styleProps.style} className={classNames(classProps.root, styleProps.className)}>\n <input\n {...otherProps}\n {...ariaDescribedByProp}\n type=\"checkbox\"\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n required={isRequired}\n checked={isChecked}\n value={value}\n ref={ref}\n />\n <div className={classProps.text}>\n <Label UNSAFE_className={classProps.label} htmlFor={id}>\n {label}\n </Label>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n id={`${id}__validationText`}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n </div>\n );\n};\n\nconst Checkbox = forwardRef<HTMLInputElement, SpiritCheckboxProps>(_Checkbox) as ForwardRefComponent<\n HTMLInputElement,\n SpiritCheckboxProps\n>;\n\nCheckbox.spiritComponent = 'Checkbox';\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["_Checkbox","props","ref","classProps","modifiedProps","useCheckboxStyleProps","ariaDescribedBy","hasValidationIcon","helperText","id","isChecked","isDisabled","isRequired","label","validationState","validationText","value","restProps","styleProps","otherProps","useStyleProps","ids","register","useAriaIds","ariaDescribedByProp","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","Label","HelperText","ValidationText","Checkbox","forwardRef"],"mappings":"6gBAUMA,EAAY,CAACC,EAA4BC,IAAqD,CAClG,KAAM,CAAE,WAAAC,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,sBAAsBJ,CAAK,EAClE,CACJ,mBAAoBK,EAAkB,GACtC,kBAAAC,EACA,WAAAC,EACA,GAAAC,EACA,UAAAC,EACA,WAAAC,EACA,WAAAC,EACA,MAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,MAAAC,EACA,GAAGC,CAAA,EACDb,EACE,CAAA,WAAEc,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcH,CAAS,EAC3D,CAACI,EAAKC,CAAQ,EAAIC,EAAAA,QAAWjB,CAAe,EAC5CkB,EAAsBC,EAAAA,mBAAmBJ,CAAG,EAC5CK,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAb,EACA,eAAAC,CAAA,CACD,EAED,OACEa,EAAAA,KAAC,MAAA,CAAI,MAAOV,EAAW,MAAO,UAAWW,EAAW1B,EAAW,KAAMe,EAAW,SAAS,EACvF,SAAA,CAAAY,EAAAA,IAAC,QAAA,CACE,GAAGX,EACH,GAAGK,EACJ,KAAK,WACL,GAAAf,EACA,UAAWN,EAAW,MACtB,SAAUQ,EACV,SAAUC,EACV,QAASF,EACT,MAAAM,EACA,IAAAd,CAAA,CAAA,EAEF0B,EAAAA,KAAC,MAAA,CAAI,UAAWzB,EAAW,KACzB,SAAA,CAAA2B,MAACC,EAAAA,SAAM,iBAAkB5B,EAAW,MAAO,QAASM,EACjD,SAAAI,EACH,EACAiB,EAAAA,IAACE,EAAAA,QAAA,CACC,iBAAkB7B,EAAW,WAC7B,GAAI,GAAGM,CAAE,eACT,aAAca,EACd,WAAAd,CAAA,CAAA,EAEDM,GACCgB,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkB9B,EAAW,eAC7B,GAAI,GAAGM,CAAE,mBACR,GAAIF,GAAqB,CAAE,uBAAwBO,CAAA,EACpD,eAAAC,EACA,aAAcO,EACd,KAAMI,CAAA,CAAA,CACR,CAAA,CAEJ,CAAA,EACF,CAEJ,EAEMQ,EAAWC,EAAAA,WAAkDnC,CAAS,EAK5EkC,EAAS,gBAAkB,WAC3BA,EAAS,YAAc"}
1
+ {"version":3,"file":"Checkbox.cjs","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useAriaDetails, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritCheckboxProps } from '../../types';\nimport { HelperText, Label, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { InputDetails } from '../InputDetails';\nimport { useCheckboxStyleProps } from './useCheckboxStyleProps';\n\nconst _Checkbox = (props: SpiritCheckboxProps, ref: ForwardedRef<HTMLInputElement>): JSX.Element => {\n const { classProps, props: modifiedProps } = useCheckboxStyleProps(props);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n 'aria-details': ariaDetailsAttr,\n details,\n hasValidationIcon,\n helperText,\n id,\n isChecked,\n isDisabled,\n isRequired,\n label,\n validationState,\n validationText,\n value,\n ...restProps\n } = modifiedProps;\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const [ariaDetailsProp, registerDetails] = useAriaDetails(ariaDetailsAttr);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <div style={styleProps.style} className={classNames(classProps.root, styleProps.className)}>\n <input\n {...otherProps}\n {...ariaDescribedByProp}\n {...ariaDetailsProp}\n type=\"checkbox\"\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n required={isRequired}\n checked={isChecked}\n value={value}\n ref={ref}\n />\n <div className={classProps.text}>\n <Label UNSAFE_className={classProps.label} htmlFor={id}>\n {label}\n </Label>\n {details && (\n <InputDetails id={`${id}-details`} registerAriaDetails={registerDetails}>\n {details}\n </InputDetails>\n )}\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n id={`${id}__validationText`}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n </div>\n );\n};\n\nconst Checkbox = forwardRef<HTMLInputElement, SpiritCheckboxProps>(_Checkbox) as ForwardRefComponent<\n HTMLInputElement,\n SpiritCheckboxProps\n>;\n\nCheckbox.spiritComponent = 'Checkbox';\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["_Checkbox","props","ref","classProps","modifiedProps","useCheckboxStyleProps","ariaDescribedBy","ariaDetailsAttr","details","hasValidationIcon","helperText","id","isChecked","isDisabled","isRequired","label","validationState","validationText","value","restProps","styleProps","otherProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","ariaDetailsProp","registerDetails","useAriaDetails","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","Label","InputDetails","HelperText","ValidationText","Checkbox","forwardRef"],"mappings":"ihBAWMA,EAAY,CAACC,EAA4BC,IAAqD,CAClG,KAAM,CAAE,WAAAC,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,sBAAsBJ,CAAK,EAClE,CACJ,mBAAoBK,EAAkB,GACtC,eAAgBC,EAChB,QAAAC,EACA,kBAAAC,EACA,WAAAC,EACA,GAAAC,EACA,UAAAC,EACA,WAAAC,EACA,WAAAC,EACA,MAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,MAAAC,EACA,GAAGC,CAAA,EACDf,EACE,CAAA,WAAEgB,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcH,CAAS,EAC3D,CAACI,EAAqBC,CAAQ,EAAIC,EAAAA,mBAAmBnB,CAAe,EACpE,CAACoB,EAAiBC,CAAe,EAAIC,EAAAA,eAAerB,CAAe,EACnEsB,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAd,EACA,eAAAC,CAAA,CACD,EAED,OACEc,EAAAA,KAAC,MAAA,CAAI,MAAOX,EAAW,MAAO,UAAWY,EAAW7B,EAAW,KAAMiB,EAAW,SAAS,EACvF,SAAA,CAAAa,EAAAA,IAAC,QAAA,CACE,GAAGZ,EACH,GAAGE,EACH,GAAGG,EACJ,KAAK,WACL,GAAAf,EACA,UAAWR,EAAW,MACtB,SAAUU,EACV,SAAUC,EACV,QAASF,EACT,MAAAM,EACA,IAAAhB,CAAA,CAAA,EAEF6B,EAAAA,KAAC,MAAA,CAAI,UAAW5B,EAAW,KACzB,SAAA,CAAA8B,MAACC,EAAAA,SAAM,iBAAkB/B,EAAW,MAAO,QAASQ,EACjD,SAAAI,EACH,EACCP,SACE2B,EAAAA,QAAA,CAAa,GAAI,GAAGxB,CAAE,WAAY,oBAAqBgB,EACrD,SAAAnB,CAAA,CACH,EAEFyB,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBjC,EAAW,WAC7B,GAAI,GAAGQ,CAAE,eACT,aAAca,EACd,WAAAd,CAAA,CAAA,EAEDM,GACCiB,EAAAA,IAACI,EAAAA,QAAA,CACC,iBAAkBlC,EAAW,eAC7B,GAAI,GAAGQ,CAAE,mBACR,GAAIF,GAAqB,CAAE,uBAAwBO,CAAA,EACpD,eAAAC,EACA,aAAcO,EACd,KAAMK,CAAA,CAAA,CACR,CAAA,CAEJ,CAAA,EACF,CAEJ,EAEMS,EAAWC,EAAAA,WAAkDvC,CAAS,EAK5EsC,EAAS,gBAAkB,WAC3BA,EAAS,YAAc"}
@@ -1,77 +1,81 @@
1
1
  "use client";
2
- import { jsxs as l, jsx as s } from "react/jsx-runtime";
3
- import A from "classnames";
4
- import { forwardRef as C } from "react";
5
- import { useStyleProps as S } from "../../hooks/styleProps.js";
6
- import { useAriaDescribedBy as D } from "../../hooks/useAriaDescribedBy.js";
7
- import F from "../Field/HelperText.js";
8
- import R from "../Field/Label.js";
9
- import V from "../Field/useAriaIds.js";
10
- import g from "../Field/ValidationText.js";
11
- import { useValidationTextRole as B } from "../Field/useValidationTextRole.js";
12
- import { useCheckboxStyleProps as E } from "./useCheckboxStyleProps.js";
13
- const I = (d, m) => {
14
- const { classProps: e, props: p } = E(d), {
15
- "aria-describedby": n = "",
16
- hasValidationIcon: x,
17
- helperText: h,
18
- id: r,
19
- isChecked: b,
20
- isDisabled: f,
21
- isRequired: u,
22
- label: N,
23
- validationState: o,
24
- validationText: i,
25
- value: y,
26
- ...T
27
- } = p, { styleProps: t, props: k } = S(T), [v, a] = V(n), P = D(v), _ = B({
28
- validationState: o,
29
- validationText: i
2
+ import { jsxs as c, jsx as r } from "react/jsx-runtime";
3
+ import S from "classnames";
4
+ import { forwardRef as g } from "react";
5
+ import { useStyleProps as F } from "../../hooks/styleProps.js";
6
+ import { useAriaDescribedBy as R, useAriaDetails as V } from "../../hooks/useAriaIdRefs.js";
7
+ import B from "../Field/HelperText.js";
8
+ import E from "../Field/Label.js";
9
+ import I from "../Field/ValidationText.js";
10
+ import { useValidationTextRole as U } from "../Field/useValidationTextRole.js";
11
+ import $ from "../InputDetails/InputDetails.js";
12
+ import { useCheckboxStyleProps as j } from "./useCheckboxStyleProps.js";
13
+ const q = (p, m) => {
14
+ const { classProps: e, props: n } = j(p), {
15
+ "aria-describedby": x = "",
16
+ "aria-details": h,
17
+ details: s,
18
+ hasValidationIcon: b,
19
+ helperText: f,
20
+ id: i,
21
+ isChecked: u,
22
+ isDisabled: N,
23
+ isRequired: y,
24
+ label: D,
25
+ validationState: t,
26
+ validationText: a,
27
+ value: T,
28
+ ...A
29
+ } = n, { styleProps: o, props: P } = F(A), [k, l] = R(x), [v, _] = V(h), C = U({
30
+ validationState: t,
31
+ validationText: a
30
32
  });
31
- return /* @__PURE__ */ l("div", { style: t.style, className: A(e.root, t.className), children: [
32
- /* @__PURE__ */ s(
33
+ return /* @__PURE__ */ c("div", { style: o.style, className: S(e.root, o.className), children: [
34
+ /* @__PURE__ */ r(
33
35
  "input",
34
36
  {
35
- ...k,
36
37
  ...P,
38
+ ...k,
39
+ ...v,
37
40
  type: "checkbox",
38
- id: r,
41
+ id: i,
39
42
  className: e.input,
40
- disabled: f,
41
- required: u,
42
- checked: b,
43
- value: y,
43
+ disabled: N,
44
+ required: y,
45
+ checked: u,
46
+ value: T,
44
47
  ref: m
45
48
  }
46
49
  ),
47
- /* @__PURE__ */ l("div", { className: e.text, children: [
48
- /* @__PURE__ */ s(R, { UNSAFE_className: e.label, htmlFor: r, children: N }),
49
- /* @__PURE__ */ s(
50
- F,
50
+ /* @__PURE__ */ c("div", { className: e.text, children: [
51
+ /* @__PURE__ */ r(E, { UNSAFE_className: e.label, htmlFor: i, children: D }),
52
+ s && /* @__PURE__ */ r($, { id: `${i}-details`, registerAriaDetails: _, children: s }),
53
+ /* @__PURE__ */ r(
54
+ B,
51
55
  {
52
56
  UNSAFE_className: e.helperText,
53
- id: `${r}__helperText`,
54
- registerAria: a,
55
- helperText: h
57
+ id: `${i}__helperText`,
58
+ registerAria: l,
59
+ helperText: f
56
60
  }
57
61
  ),
58
- o && /* @__PURE__ */ s(
59
- g,
62
+ t && /* @__PURE__ */ r(
63
+ I,
60
64
  {
61
65
  UNSAFE_className: e.validationText,
62
- id: `${r}__validationText`,
63
- ...x && { hasValidationStateIcon: o },
64
- validationText: i,
65
- registerAria: a,
66
- role: _
66
+ id: `${i}__validationText`,
67
+ ...b && { hasValidationStateIcon: t },
68
+ validationText: a,
69
+ registerAria: l,
70
+ role: C
67
71
  }
68
72
  )
69
73
  ] })
70
74
  ] });
71
- }, c = C(I);
72
- c.spiritComponent = "Checkbox";
73
- c.displayName = "Checkbox";
75
+ }, d = g(q);
76
+ d.spiritComponent = "Checkbox";
77
+ d.displayName = "Checkbox";
74
78
  export {
75
- c as default
79
+ d as default
76
80
  };
77
81
  //# sourceMappingURL=Checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritCheckboxProps } from '../../types';\nimport { HelperText, Label, ValidationText, useAriaIds } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { useCheckboxStyleProps } from './useCheckboxStyleProps';\n\nconst _Checkbox = (props: SpiritCheckboxProps, ref: ForwardedRef<HTMLInputElement>): JSX.Element => {\n const { classProps, props: modifiedProps } = useCheckboxStyleProps(props);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n hasValidationIcon,\n helperText,\n id,\n isChecked,\n isDisabled,\n isRequired,\n label,\n validationState,\n validationText,\n value,\n ...restProps\n } = modifiedProps;\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const [ids, register] = useAriaIds(ariaDescribedBy);\n const ariaDescribedByProp = useAriaDescribedBy(ids);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <div style={styleProps.style} className={classNames(classProps.root, styleProps.className)}>\n <input\n {...otherProps}\n {...ariaDescribedByProp}\n type=\"checkbox\"\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n required={isRequired}\n checked={isChecked}\n value={value}\n ref={ref}\n />\n <div className={classProps.text}>\n <Label UNSAFE_className={classProps.label} htmlFor={id}>\n {label}\n </Label>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n id={`${id}__validationText`}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n </div>\n );\n};\n\nconst Checkbox = forwardRef<HTMLInputElement, SpiritCheckboxProps>(_Checkbox) as ForwardRefComponent<\n HTMLInputElement,\n SpiritCheckboxProps\n>;\n\nCheckbox.spiritComponent = 'Checkbox';\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["_Checkbox","props","ref","classProps","modifiedProps","useCheckboxStyleProps","ariaDescribedBy","hasValidationIcon","helperText","id","isChecked","isDisabled","isRequired","label","validationState","validationText","value","restProps","styleProps","otherProps","useStyleProps","ids","register","useAriaIds","ariaDescribedByProp","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","Label","HelperText","ValidationText","Checkbox","forwardRef"],"mappings":";;;;;;;;;;;;AAUA,MAAMA,IAAY,CAACC,GAA4BC,MAAqD;AAClG,QAAM,EAAE,YAAAC,GAAY,OAAOC,EAAA,IAAkBC,EAAsBJ,CAAK,GAClE;AAAA,IACJ,oBAAoBK,IAAkB;AAAA,IACtC,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDb,GACE,EAAE,YAAAc,GAAY,OAAOC,EAAA,IAAeC,EAAcH,CAAS,GAC3D,CAACI,GAAKC,CAAQ,IAAIC,EAAWjB,CAAe,GAC5CkB,IAAsBC,EAAmBJ,CAAG,GAC5CK,IAAqBC,EAAsB;AAAA,IAC/C,iBAAAb;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD;AAED,SACE,gBAAAa,EAAC,OAAA,EAAI,OAAOV,EAAW,OAAO,WAAWW,EAAW1B,EAAW,MAAMe,EAAW,SAAS,GACvF,UAAA;AAAA,IAAA,gBAAAY;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGX;AAAA,QACH,GAAGK;AAAA,QACJ,MAAK;AAAA,QACL,IAAAf;AAAA,QACA,WAAWN,EAAW;AAAA,QACtB,UAAUQ;AAAA,QACV,UAAUC;AAAA,QACV,SAASF;AAAA,QACT,OAAAM;AAAA,QACA,KAAAd;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAA0B,EAAC,OAAA,EAAI,WAAWzB,EAAW,MACzB,UAAA;AAAA,MAAA,gBAAA2B,EAACC,KAAM,kBAAkB5B,EAAW,OAAO,SAASM,GACjD,UAAAI,GACH;AAAA,MACA,gBAAAiB;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,kBAAkB7B,EAAW;AAAA,UAC7B,IAAI,GAAGM,CAAE;AAAA,UACT,cAAca;AAAA,UACd,YAAAd;AAAA,QAAA;AAAA,MAAA;AAAA,MAEDM,KACC,gBAAAgB;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,kBAAkB9B,EAAW;AAAA,UAC7B,IAAI,GAAGM,CAAE;AAAA,UACR,GAAIF,KAAqB,EAAE,wBAAwBO,EAAA;AAAA,UACpD,gBAAAC;AAAA,UACA,cAAcO;AAAA,UACd,MAAMI;AAAA,QAAA;AAAA,MAAA;AAAA,IACR,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ,GAEMQ,IAAWC,EAAkDnC,CAAS;AAK5EkC,EAAS,kBAAkB;AAC3BA,EAAS,cAAc;"}
1
+ {"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useAriaDetails, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritCheckboxProps } from '../../types';\nimport { HelperText, Label, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { InputDetails } from '../InputDetails';\nimport { useCheckboxStyleProps } from './useCheckboxStyleProps';\n\nconst _Checkbox = (props: SpiritCheckboxProps, ref: ForwardedRef<HTMLInputElement>): JSX.Element => {\n const { classProps, props: modifiedProps } = useCheckboxStyleProps(props);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n 'aria-details': ariaDetailsAttr,\n details,\n hasValidationIcon,\n helperText,\n id,\n isChecked,\n isDisabled,\n isRequired,\n label,\n validationState,\n validationText,\n value,\n ...restProps\n } = modifiedProps;\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const [ariaDetailsProp, registerDetails] = useAriaDetails(ariaDetailsAttr);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <div style={styleProps.style} className={classNames(classProps.root, styleProps.className)}>\n <input\n {...otherProps}\n {...ariaDescribedByProp}\n {...ariaDetailsProp}\n type=\"checkbox\"\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n required={isRequired}\n checked={isChecked}\n value={value}\n ref={ref}\n />\n <div className={classProps.text}>\n <Label UNSAFE_className={classProps.label} htmlFor={id}>\n {label}\n </Label>\n {details && (\n <InputDetails id={`${id}-details`} registerAriaDetails={registerDetails}>\n {details}\n </InputDetails>\n )}\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n id={`${id}__validationText`}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n </div>\n );\n};\n\nconst Checkbox = forwardRef<HTMLInputElement, SpiritCheckboxProps>(_Checkbox) as ForwardRefComponent<\n HTMLInputElement,\n SpiritCheckboxProps\n>;\n\nCheckbox.spiritComponent = 'Checkbox';\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["_Checkbox","props","ref","classProps","modifiedProps","useCheckboxStyleProps","ariaDescribedBy","ariaDetailsAttr","details","hasValidationIcon","helperText","id","isChecked","isDisabled","isRequired","label","validationState","validationText","value","restProps","styleProps","otherProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","ariaDetailsProp","registerDetails","useAriaDetails","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","Label","InputDetails","HelperText","ValidationText","Checkbox","forwardRef"],"mappings":";;;;;;;;;;;;AAWA,MAAMA,IAAY,CAACC,GAA4BC,MAAqD;AAClG,QAAM,EAAE,YAAAC,GAAY,OAAOC,EAAA,IAAkBC,EAAsBJ,CAAK,GAClE;AAAA,IACJ,oBAAoBK,IAAkB;AAAA,IACtC,gBAAgBC;AAAA,IAChB,SAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDf,GACE,EAAE,YAAAgB,GAAY,OAAOC,EAAA,IAAeC,EAAcH,CAAS,GAC3D,CAACI,GAAqBC,CAAQ,IAAIC,EAAmBnB,CAAe,GACpE,CAACoB,GAAiBC,CAAe,IAAIC,EAAerB,CAAe,GACnEsB,IAAqBC,EAAsB;AAAA,IAC/C,iBAAAd;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD;AAED,SACE,gBAAAc,EAAC,OAAA,EAAI,OAAOX,EAAW,OAAO,WAAWY,EAAW7B,EAAW,MAAMiB,EAAW,SAAS,GACvF,UAAA;AAAA,IAAA,gBAAAa;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGZ;AAAA,QACH,GAAGE;AAAA,QACH,GAAGG;AAAA,QACJ,MAAK;AAAA,QACL,IAAAf;AAAA,QACA,WAAWR,EAAW;AAAA,QACtB,UAAUU;AAAA,QACV,UAAUC;AAAA,QACV,SAASF;AAAA,QACT,OAAAM;AAAA,QACA,KAAAhB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAA6B,EAAC,OAAA,EAAI,WAAW5B,EAAW,MACzB,UAAA;AAAA,MAAA,gBAAA8B,EAACC,KAAM,kBAAkB/B,EAAW,OAAO,SAASQ,GACjD,UAAAI,GACH;AAAA,MACCP,uBACE2B,GAAA,EAAa,IAAI,GAAGxB,CAAE,YAAY,qBAAqBgB,GACrD,UAAAnB,EAAA,CACH;AAAA,MAEF,gBAAAyB;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,kBAAkBjC,EAAW;AAAA,UAC7B,IAAI,GAAGQ,CAAE;AAAA,UACT,cAAca;AAAA,UACd,YAAAd;AAAA,QAAA;AAAA,MAAA;AAAA,MAEDM,KACC,gBAAAiB;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,kBAAkBlC,EAAW;AAAA,UAC7B,IAAI,GAAGQ,CAAE;AAAA,UACR,GAAIF,KAAqB,EAAE,wBAAwBO,EAAA;AAAA,UACpD,gBAAAC;AAAA,UACA,cAAcO;AAAA,UACd,MAAMK;AAAA,QAAA;AAAA,MAAA;AAAA,IACR,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ,GAEMS,IAAWC,EAAkDvC,CAAS;AAK5EsC,EAAS,kBAAkB;AAC3BA,EAAS,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useControlButtonStyleProps.cjs","sources":["../../../src/components/ControlButton/useControlButtonStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix, useSymmetry } from '../../hooks';\nimport { type ControlButtonSize, type ControlButtonStyleProps } from '../../types';\nimport { applySize, compose } from '../../utils';\n\nconst getControlButtonSizeClassname = <S = void>(className: string, size: ControlButtonSize<S>): string =>\n compose(applySize<ControlButtonSize<S>>(size))(className);\n\nexport function useControlButtonStyleProps<S = void>(props: ControlButtonStyleProps<S>) {\n const { isDisabled, isSubtle, isSymmetrical, size, ...restProps } = props;\n\n const controlButtonClass = useClassNamePrefix('ControlButton');\n const controlButtonBackgroundClass = `${controlButtonClass}--hasBackground`;\n const controlButtonDisabledClass = `${controlButtonClass}--disabled`;\n const dynamicColorBackgroundInteractiveClass = useClassNamePrefix('dynamic-color-background-interactive');\n const dynamicColorBorderClass = useClassNamePrefix('dynamic-color-border');\n const accessibilityTapTargetClass = useClassNamePrefix('accessibility-tap-target');\n\n const { symmetricalClassName } = useSymmetry(controlButtonClass, isSymmetrical);\n\n const classProps = classNames(\n controlButtonClass,\n getControlButtonSizeClassname(controlButtonClass, size as ControlButtonSize<S>),\n dynamicColorBackgroundInteractiveClass,\n accessibilityTapTargetClass,\n {\n [controlButtonDisabledClass]: isDisabled,\n [controlButtonBackgroundClass]: !isSubtle,\n [dynamicColorBorderClass]: !isSubtle,\n },\n symmetricalClassName,\n );\n\n return {\n classProps,\n props: restProps,\n };\n}\n"],"names":["getControlButtonSizeClassname","className","size","compose","applySize","useControlButtonStyleProps","props","isDisabled","isSubtle","isSymmetrical","restProps","controlButtonClass","useClassNamePrefix","controlButtonBackgroundClass","controlButtonDisabledClass","dynamicColorBackgroundInteractiveClass","dynamicColorBorderClass","accessibilityTapTargetClass","symmetricalClassName","useSymmetry","classNames"],"mappings":"mRAKMA,EAAgC,CAAWC,EAAmBC,IAClEC,EAAAA,QAAQC,EAAAA,UAAgCF,CAAI,CAAC,EAAED,CAAS,EAEnD,SAASI,EAAqCC,EAAmC,CACtF,KAAM,CAAE,WAAAC,EAAY,SAAAC,EAAU,cAAAC,EAAe,KAAAP,EAAM,GAAGQ,GAAcJ,EAE9DK,EAAqBC,EAAAA,mBAAmB,eAAe,EACvDC,EAA+B,GAAGF,CAAkB,kBACpDG,EAA6B,GAAGH,CAAkB,aAClDI,EAAyCH,EAAAA,mBAAmB,sCAAsC,EAClGI,EAA0BJ,EAAAA,mBAAmB,sBAAsB,EACnEK,EAA8BL,EAAAA,mBAAmB,0BAA0B,EAE3E,CAAE,qBAAAM,CAAA,EAAyBC,cAAYR,EAAoBF,CAAa,EAe9E,MAAO,CACL,WAdiBW,EACjBT,EACAX,EAA8BW,EAAoBT,CAA4B,EAC9Ea,EACAE,EACA,CACE,CAACH,CAA0B,EAAGP,EAC9B,CAACM,CAA4B,EAAG,CAACL,EACjC,CAACQ,CAAuB,EAAG,CAACR,CAAA,EAE9BU,CAAA,EAKA,MAAOR,CAAA,CAEX"}
1
+ {"version":3,"file":"useControlButtonStyleProps.cjs","sources":["../../../src/components/ControlButton/useControlButtonStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix, useSymmetry } from '../../hooks';\nimport { type ControlButtonStyleProps, type SizeExtendedDictionaryType } from '../../types';\nimport { applySize, compose } from '../../utils';\n\nconst getControlButtonSizeClassname = <S = void>(className: string, size: SizeExtendedDictionaryType | S): string =>\n compose(applySize<SizeExtendedDictionaryType | S>(size))(className);\n\nexport function useControlButtonStyleProps<S = void>(props: ControlButtonStyleProps<S>) {\n const { isDisabled, isSubtle, isSymmetrical, size, ...restProps } = props;\n\n const controlButtonClass = useClassNamePrefix('ControlButton');\n const controlButtonBackgroundClass = `${controlButtonClass}--hasBackground`;\n const controlButtonDisabledClass = `${controlButtonClass}--disabled`;\n const dynamicColorBackgroundInteractiveClass = useClassNamePrefix('dynamic-color-background-interactive');\n const dynamicColorBorderClass = useClassNamePrefix('dynamic-color-border');\n const accessibilityTapTargetClass = useClassNamePrefix('accessibility-tap-target');\n\n const { symmetricalClassName } = useSymmetry(controlButtonClass, isSymmetrical);\n\n const classProps = classNames(\n controlButtonClass,\n getControlButtonSizeClassname(controlButtonClass, size as SizeExtendedDictionaryType | S),\n dynamicColorBackgroundInteractiveClass,\n accessibilityTapTargetClass,\n {\n [controlButtonDisabledClass]: isDisabled,\n [controlButtonBackgroundClass]: !isSubtle,\n [dynamicColorBorderClass]: !isSubtle,\n },\n symmetricalClassName,\n );\n\n return {\n classProps,\n props: restProps,\n };\n}\n"],"names":["getControlButtonSizeClassname","className","size","compose","applySize","useControlButtonStyleProps","props","isDisabled","isSubtle","isSymmetrical","restProps","controlButtonClass","useClassNamePrefix","controlButtonBackgroundClass","controlButtonDisabledClass","dynamicColorBackgroundInteractiveClass","dynamicColorBorderClass","accessibilityTapTargetClass","symmetricalClassName","useSymmetry","classNames"],"mappings":"mRAKMA,EAAgC,CAAWC,EAAmBC,IAClEC,EAAAA,QAAQC,EAAAA,UAA0CF,CAAI,CAAC,EAAED,CAAS,EAE7D,SAASI,EAAqCC,EAAmC,CACtF,KAAM,CAAE,WAAAC,EAAY,SAAAC,EAAU,cAAAC,EAAe,KAAAP,EAAM,GAAGQ,GAAcJ,EAE9DK,EAAqBC,EAAAA,mBAAmB,eAAe,EACvDC,EAA+B,GAAGF,CAAkB,kBACpDG,EAA6B,GAAGH,CAAkB,aAClDI,EAAyCH,EAAAA,mBAAmB,sCAAsC,EAClGI,EAA0BJ,EAAAA,mBAAmB,sBAAsB,EACnEK,EAA8BL,EAAAA,mBAAmB,0BAA0B,EAE3E,CAAE,qBAAAM,CAAA,EAAyBC,cAAYR,EAAoBF,CAAa,EAe9E,MAAO,CACL,WAdiBW,EACjBT,EACAX,EAA8BW,EAAoBT,CAAsC,EACxFa,EACAE,EACA,CACE,CAACH,CAA0B,EAAGP,EAC9B,CAACM,CAA4B,EAAG,CAACL,EACjC,CAACQ,CAAuB,EAAG,CAACR,CAAA,EAE9BU,CAAA,EAKA,MAAOR,CAAA,CAEX"}
@@ -1 +1 @@
1
- {"version":3,"file":"useControlButtonStyleProps.js","sources":["../../../src/components/ControlButton/useControlButtonStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix, useSymmetry } from '../../hooks';\nimport { type ControlButtonSize, type ControlButtonStyleProps } from '../../types';\nimport { applySize, compose } from '../../utils';\n\nconst getControlButtonSizeClassname = <S = void>(className: string, size: ControlButtonSize<S>): string =>\n compose(applySize<ControlButtonSize<S>>(size))(className);\n\nexport function useControlButtonStyleProps<S = void>(props: ControlButtonStyleProps<S>) {\n const { isDisabled, isSubtle, isSymmetrical, size, ...restProps } = props;\n\n const controlButtonClass = useClassNamePrefix('ControlButton');\n const controlButtonBackgroundClass = `${controlButtonClass}--hasBackground`;\n const controlButtonDisabledClass = `${controlButtonClass}--disabled`;\n const dynamicColorBackgroundInteractiveClass = useClassNamePrefix('dynamic-color-background-interactive');\n const dynamicColorBorderClass = useClassNamePrefix('dynamic-color-border');\n const accessibilityTapTargetClass = useClassNamePrefix('accessibility-tap-target');\n\n const { symmetricalClassName } = useSymmetry(controlButtonClass, isSymmetrical);\n\n const classProps = classNames(\n controlButtonClass,\n getControlButtonSizeClassname(controlButtonClass, size as ControlButtonSize<S>),\n dynamicColorBackgroundInteractiveClass,\n accessibilityTapTargetClass,\n {\n [controlButtonDisabledClass]: isDisabled,\n [controlButtonBackgroundClass]: !isSubtle,\n [dynamicColorBorderClass]: !isSubtle,\n },\n symmetricalClassName,\n );\n\n return {\n classProps,\n props: restProps,\n };\n}\n"],"names":["getControlButtonSizeClassname","className","size","compose","applySize","useControlButtonStyleProps","props","isDisabled","isSubtle","isSymmetrical","restProps","controlButtonClass","useClassNamePrefix","controlButtonBackgroundClass","controlButtonDisabledClass","dynamicColorBackgroundInteractiveClass","dynamicColorBorderClass","accessibilityTapTargetClass","symmetricalClassName","useSymmetry","classNames"],"mappings":";;;;;AAKA,MAAMA,IAAgC,CAAWC,GAAmBC,MAClEC,EAAQC,EAAgCF,CAAI,CAAC,EAAED,CAAS;AAEnD,SAASI,EAAqCC,GAAmC;AACtF,QAAM,EAAE,YAAAC,GAAY,UAAAC,GAAU,eAAAC,GAAe,MAAAP,GAAM,GAAGQ,MAAcJ,GAE9DK,IAAqBC,EAAmB,eAAe,GACvDC,IAA+B,GAAGF,CAAkB,mBACpDG,IAA6B,GAAGH,CAAkB,cAClDI,IAAyCH,EAAmB,sCAAsC,GAClGI,IAA0BJ,EAAmB,sBAAsB,GACnEK,IAA8BL,EAAmB,0BAA0B,GAE3E,EAAE,sBAAAM,EAAA,IAAyBC,EAAYR,GAAoBF,CAAa;AAe9E,SAAO;AAAA,IACL,YAdiBW;AAAA,MACjBT;AAAA,MACAX,EAA8BW,GAAoBT,CAA4B;AAAA,MAC9Ea;AAAA,MACAE;AAAA,MACA;AAAA,QACE,CAACH,CAA0B,GAAGP;AAAA,QAC9B,CAACM,CAA4B,GAAG,CAACL;AAAA,QACjC,CAACQ,CAAuB,GAAG,CAACR;AAAA,MAAA;AAAA,MAE9BU;AAAA,IAAA;AAAA,IAKA,OAAOR;AAAA,EAAA;AAEX;"}
1
+ {"version":3,"file":"useControlButtonStyleProps.js","sources":["../../../src/components/ControlButton/useControlButtonStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix, useSymmetry } from '../../hooks';\nimport { type ControlButtonStyleProps, type SizeExtendedDictionaryType } from '../../types';\nimport { applySize, compose } from '../../utils';\n\nconst getControlButtonSizeClassname = <S = void>(className: string, size: SizeExtendedDictionaryType | S): string =>\n compose(applySize<SizeExtendedDictionaryType | S>(size))(className);\n\nexport function useControlButtonStyleProps<S = void>(props: ControlButtonStyleProps<S>) {\n const { isDisabled, isSubtle, isSymmetrical, size, ...restProps } = props;\n\n const controlButtonClass = useClassNamePrefix('ControlButton');\n const controlButtonBackgroundClass = `${controlButtonClass}--hasBackground`;\n const controlButtonDisabledClass = `${controlButtonClass}--disabled`;\n const dynamicColorBackgroundInteractiveClass = useClassNamePrefix('dynamic-color-background-interactive');\n const dynamicColorBorderClass = useClassNamePrefix('dynamic-color-border');\n const accessibilityTapTargetClass = useClassNamePrefix('accessibility-tap-target');\n\n const { symmetricalClassName } = useSymmetry(controlButtonClass, isSymmetrical);\n\n const classProps = classNames(\n controlButtonClass,\n getControlButtonSizeClassname(controlButtonClass, size as SizeExtendedDictionaryType | S),\n dynamicColorBackgroundInteractiveClass,\n accessibilityTapTargetClass,\n {\n [controlButtonDisabledClass]: isDisabled,\n [controlButtonBackgroundClass]: !isSubtle,\n [dynamicColorBorderClass]: !isSubtle,\n },\n symmetricalClassName,\n );\n\n return {\n classProps,\n props: restProps,\n };\n}\n"],"names":["getControlButtonSizeClassname","className","size","compose","applySize","useControlButtonStyleProps","props","isDisabled","isSubtle","isSymmetrical","restProps","controlButtonClass","useClassNamePrefix","controlButtonBackgroundClass","controlButtonDisabledClass","dynamicColorBackgroundInteractiveClass","dynamicColorBorderClass","accessibilityTapTargetClass","symmetricalClassName","useSymmetry","classNames"],"mappings":";;;;;AAKA,MAAMA,IAAgC,CAAWC,GAAmBC,MAClEC,EAAQC,EAA0CF,CAAI,CAAC,EAAED,CAAS;AAE7D,SAASI,EAAqCC,GAAmC;AACtF,QAAM,EAAE,YAAAC,GAAY,UAAAC,GAAU,eAAAC,GAAe,MAAAP,GAAM,GAAGQ,MAAcJ,GAE9DK,IAAqBC,EAAmB,eAAe,GACvDC,IAA+B,GAAGF,CAAkB,mBACpDG,IAA6B,GAAGH,CAAkB,cAClDI,IAAyCH,EAAmB,sCAAsC,GAClGI,IAA0BJ,EAAmB,sBAAsB,GACnEK,IAA8BL,EAAmB,0BAA0B,GAE3E,EAAE,sBAAAM,EAAA,IAAyBC,EAAYR,GAAoBF,CAAa;AAe9E,SAAO;AAAA,IACL,YAdiBW;AAAA,MACjBT;AAAA,MACAX,EAA8BW,GAAoBT,CAAsC;AAAA,MACxFa;AAAA,MACAE;AAAA,MACA;AAAA,QACE,CAACH,CAA0B,GAAGP;AAAA,QAC9B,CAACM,CAA4B,GAAG,CAACL;AAAA,QACjC,CAACQ,CAAuB,GAAG,CAACR;AAAA,MAAA;AAAA,MAE9BU;AAAA,IAAA;AAAA,IAKA,OAAOR;AAAA,EAAA;AAEX;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownPopover.cjs","sources":["../../../src/components/Dropdown/DropdownPopover.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useStyleProps } from '../../hooks';\nimport { type ChildrenProps, type StyleProps } from '../../types';\nimport { useDropdownContext } from './DropdownContext';\nimport { useDropdownAriaProps } from './useDropdownAriaProps';\nimport { useDropdownStyleProps } from './useDropdownStyleProps';\n\ninterface DropdownPopoverProps extends ChildrenProps, StyleProps {}\n\nconst DropdownPopover = (props: DropdownPopoverProps) => {\n const { children, ...rest } = props;\n const { id, isOpen, onToggle, fullWidthMode, placement } = useDropdownContext();\n const { classProps, props: modifiedProps } = useDropdownStyleProps({ isOpen, ...rest });\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const { contentProps } = useDropdownAriaProps({ id, isOpen, toggleHandler: onToggle, placement, fullWidthMode });\n\n return (\n <div\n className={classNames(classProps.popover, styleProps.className)}\n style={styleProps.style}\n {...contentProps}\n {...otherProps}\n >\n {children}\n </div>\n );\n};\n\nDropdownPopover.spiritComponent = 'DropdownPopover';\n\nexport default DropdownPopover;\n"],"names":["DropdownPopover","props","children","rest","id","isOpen","onToggle","fullWidthMode","placement","useDropdownContext","classProps","modifiedProps","useDropdownStyleProps","styleProps","otherProps","useStyleProps","contentProps","useDropdownAriaProps","jsx","classNames"],"mappings":"kVAYMA,EAAmBC,GAAgC,CACvD,KAAM,CAAE,SAAAC,EAAU,GAAGC,CAAA,EAASF,EACxB,CAAE,GAAAG,EAAI,OAAAC,EAAQ,SAAAC,EAAU,cAAAC,EAAe,UAAAC,CAAA,EAAcC,qBAAA,EACrD,CAAE,WAAAC,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,sBAAsB,CAAE,OAAAP,EAAQ,GAAGF,EAAM,EAChF,CAAA,WAAEU,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcJ,CAAa,EAC/D,CAAE,aAAAK,CAAA,EAAiBC,EAAAA,qBAAqB,CAAE,GAAAb,EAAI,OAAAC,EAAQ,cAAeC,EAAU,UAAAE,EAAW,cAAAD,EAAe,EAE/G,OACEW,EAAAA,IAAC,MAAA,CACC,UAAWC,EAAWT,EAAW,QAASG,EAAW,SAAS,EAC9D,MAAOA,EAAW,MACjB,GAAGG,EACH,GAAGF,EAEH,SAAAZ,CAAA,CAAA,CAGP,EAEAF,EAAgB,gBAAkB"}
1
+ {"version":3,"file":"DropdownPopover.cjs","sources":["../../../src/components/Dropdown/DropdownPopover.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useStyleProps } from '../../hooks';\nimport { type SpiritDivElementProps } from '../../types';\nimport { useDropdownContext } from './DropdownContext';\nimport { useDropdownAriaProps } from './useDropdownAriaProps';\nimport { useDropdownStyleProps } from './useDropdownStyleProps';\n\ninterface DropdownPopoverProps extends SpiritDivElementProps {}\n\nconst DropdownPopover = (props: DropdownPopoverProps) => {\n const { children, ...rest } = props;\n const { id, isOpen, onToggle, fullWidthMode, placement } = useDropdownContext();\n const { classProps, props: modifiedProps } = useDropdownStyleProps({ isOpen, ...rest });\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const { contentProps } = useDropdownAriaProps({ id, isOpen, toggleHandler: onToggle, placement, fullWidthMode });\n\n return (\n <div\n className={classNames(classProps.popover, styleProps.className)}\n style={styleProps.style}\n {...contentProps}\n {...otherProps}\n >\n {children}\n </div>\n );\n};\n\nDropdownPopover.spiritComponent = 'DropdownPopover';\n\nexport default DropdownPopover;\n"],"names":["DropdownPopover","props","children","rest","id","isOpen","onToggle","fullWidthMode","placement","useDropdownContext","classProps","modifiedProps","useDropdownStyleProps","styleProps","otherProps","useStyleProps","contentProps","useDropdownAriaProps","jsx","classNames"],"mappings":"kVAYMA,EAAmBC,GAAgC,CACvD,KAAM,CAAE,SAAAC,EAAU,GAAGC,CAAA,EAASF,EACxB,CAAE,GAAAG,EAAI,OAAAC,EAAQ,SAAAC,EAAU,cAAAC,EAAe,UAAAC,CAAA,EAAcC,qBAAA,EACrD,CAAE,WAAAC,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,sBAAsB,CAAE,OAAAP,EAAQ,GAAGF,EAAM,EAChF,CAAA,WAAEU,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcJ,CAAa,EAC/D,CAAE,aAAAK,CAAA,EAAiBC,EAAAA,qBAAqB,CAAE,GAAAb,EAAI,OAAAC,EAAQ,cAAeC,EAAU,UAAAE,EAAW,cAAAD,EAAe,EAE/G,OACEW,EAAAA,IAAC,MAAA,CACC,UAAWC,EAAWT,EAAW,QAASG,EAAW,SAAS,EAC9D,MAAOA,EAAW,MACjB,GAAGG,EACH,GAAGF,EAEH,SAAAZ,CAAA,CAAA,CAGP,EAEAF,EAAgB,gBAAkB"}
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
- import { ChildrenProps, StyleProps } from '../../types';
3
- interface DropdownPopoverProps extends ChildrenProps, StyleProps {
2
+ import { SpiritDivElementProps } from '../../types';
3
+ interface DropdownPopoverProps extends SpiritDivElementProps {
4
4
  }
5
5
  declare const DropdownPopover: {
6
6
  (props: DropdownPopoverProps): React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownPopover.js","sources":["../../../src/components/Dropdown/DropdownPopover.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useStyleProps } from '../../hooks';\nimport { type ChildrenProps, type StyleProps } from '../../types';\nimport { useDropdownContext } from './DropdownContext';\nimport { useDropdownAriaProps } from './useDropdownAriaProps';\nimport { useDropdownStyleProps } from './useDropdownStyleProps';\n\ninterface DropdownPopoverProps extends ChildrenProps, StyleProps {}\n\nconst DropdownPopover = (props: DropdownPopoverProps) => {\n const { children, ...rest } = props;\n const { id, isOpen, onToggle, fullWidthMode, placement } = useDropdownContext();\n const { classProps, props: modifiedProps } = useDropdownStyleProps({ isOpen, ...rest });\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const { contentProps } = useDropdownAriaProps({ id, isOpen, toggleHandler: onToggle, placement, fullWidthMode });\n\n return (\n <div\n className={classNames(classProps.popover, styleProps.className)}\n style={styleProps.style}\n {...contentProps}\n {...otherProps}\n >\n {children}\n </div>\n );\n};\n\nDropdownPopover.spiritComponent = 'DropdownPopover';\n\nexport default DropdownPopover;\n"],"names":["DropdownPopover","props","children","rest","id","isOpen","onToggle","fullWidthMode","placement","useDropdownContext","classProps","modifiedProps","useDropdownStyleProps","styleProps","otherProps","useStyleProps","contentProps","useDropdownAriaProps","jsx","classNames"],"mappings":";;;;;;;AAYA,MAAMA,IAAkB,CAACC,MAAgC;AACvD,QAAM,EAAE,UAAAC,GAAU,GAAGC,EAAA,IAASF,GACxB,EAAE,IAAAG,GAAI,QAAAC,GAAQ,UAAAC,GAAU,eAAAC,GAAe,WAAAC,EAAA,IAAcC,EAAA,GACrD,EAAE,YAAAC,GAAY,OAAOC,EAAA,IAAkBC,EAAsB,EAAE,QAAAP,GAAQ,GAAGF,GAAM,GAChF,EAAE,YAAAU,GAAY,OAAOC,EAAA,IAAeC,EAAcJ,CAAa,GAC/D,EAAE,cAAAK,EAAA,IAAiBC,EAAqB,EAAE,IAAAb,GAAI,QAAAC,GAAQ,eAAeC,GAAU,WAAAE,GAAW,eAAAD,GAAe;AAE/G,SACE,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAWT,EAAW,SAASG,EAAW,SAAS;AAAA,MAC9D,OAAOA,EAAW;AAAA,MACjB,GAAGG;AAAA,MACH,GAAGF;AAAA,MAEH,UAAAZ;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAF,EAAgB,kBAAkB;"}
1
+ {"version":3,"file":"DropdownPopover.js","sources":["../../../src/components/Dropdown/DropdownPopover.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useStyleProps } from '../../hooks';\nimport { type SpiritDivElementProps } from '../../types';\nimport { useDropdownContext } from './DropdownContext';\nimport { useDropdownAriaProps } from './useDropdownAriaProps';\nimport { useDropdownStyleProps } from './useDropdownStyleProps';\n\ninterface DropdownPopoverProps extends SpiritDivElementProps {}\n\nconst DropdownPopover = (props: DropdownPopoverProps) => {\n const { children, ...rest } = props;\n const { id, isOpen, onToggle, fullWidthMode, placement } = useDropdownContext();\n const { classProps, props: modifiedProps } = useDropdownStyleProps({ isOpen, ...rest });\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const { contentProps } = useDropdownAriaProps({ id, isOpen, toggleHandler: onToggle, placement, fullWidthMode });\n\n return (\n <div\n className={classNames(classProps.popover, styleProps.className)}\n style={styleProps.style}\n {...contentProps}\n {...otherProps}\n >\n {children}\n </div>\n );\n};\n\nDropdownPopover.spiritComponent = 'DropdownPopover';\n\nexport default DropdownPopover;\n"],"names":["DropdownPopover","props","children","rest","id","isOpen","onToggle","fullWidthMode","placement","useDropdownContext","classProps","modifiedProps","useDropdownStyleProps","styleProps","otherProps","useStyleProps","contentProps","useDropdownAriaProps","jsx","classNames"],"mappings":";;;;;;;AAYA,MAAMA,IAAkB,CAACC,MAAgC;AACvD,QAAM,EAAE,UAAAC,GAAU,GAAGC,EAAA,IAASF,GACxB,EAAE,IAAAG,GAAI,QAAAC,GAAQ,UAAAC,GAAU,eAAAC,GAAe,WAAAC,EAAA,IAAcC,EAAA,GACrD,EAAE,YAAAC,GAAY,OAAOC,EAAA,IAAkBC,EAAsB,EAAE,QAAAP,GAAQ,GAAGF,GAAM,GAChF,EAAE,YAAAU,GAAY,OAAOC,EAAA,IAAeC,EAAcJ,CAAa,GAC/D,EAAE,cAAAK,EAAA,IAAiBC,EAAqB,EAAE,IAAAb,GAAI,QAAAC,GAAQ,eAAeC,GAAU,WAAAE,GAAW,eAAAD,GAAe;AAE/G,SACE,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAWT,EAAW,SAASG,EAAW,SAAS;AAAA,MAC9D,OAAOA,EAAW;AAAA,MACjB,GAAGG;AAAA,MACH,GAAGF;AAAA,MAEH,UAAAZ;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAF,EAAgB,kBAAkB;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./HelperText.cjs"),t=require("./Label.cjs"),r=require("./useAriaIds.cjs"),a=require("./ValidationText.cjs");exports.HelperText=e.default;exports.Label=t.default;exports.useAriaIds=r.default;exports.ValidationText=a.default;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./HelperText.cjs"),t=require("./Label.cjs"),r=require("./ValidationText.cjs");exports.HelperText=e.default;exports.Label=t.default;exports.ValidationText=r.default;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,3 @@
1
1
  export { default as HelperText } from './HelperText';
2
2
  export { default as Label } from './Label';
3
- export { default as useAriaIds } from './useAriaIds';
4
3
  export { default as ValidationText } from './ValidationText';
5
- export * from './useAriaIds';
@@ -1,11 +1,9 @@
1
1
  import { default as a } from "./HelperText.js";
2
2
  import { default as o } from "./Label.js";
3
- import { default as s } from "./useAriaIds.js";
4
- import { default as d } from "./ValidationText.js";
3
+ import { default as l } from "./ValidationText.js";
5
4
  export {
6
5
  a as HelperText,
7
6
  o as Label,
8
- d as ValidationText,
9
- s as useAriaIds
7
+ l as ValidationText
10
8
  };
11
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,6 +1,6 @@
1
1
  import { ElementType, ReactNode } from 'react';
2
+ import { RegisterType } from '../../hooks/useAriaIdRefs';
2
3
  import { ChildrenProps, StyleProps, TransferProps, ValidationTextProp } from '../../types';
3
- import { RegisterType } from './useAriaIds';
4
4
  export interface FieldElementTypeProps<E extends ElementType = 'div'> {
5
5
  elementType?: E;
6
6
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),S=require("classnames"),j=require("../../hooks/styleProps.cjs"),v=require("../../hooks/useAriaDescribedBy.cjs"),_=require("../Field/HelperText.cjs"),A=require("../Field/useAriaIds.cjs"),F=require("../Field/ValidationText.cjs"),g=require("../Field/useValidationTextRole.cjs"),V=require("../VisuallyHidden/VisuallyHidden.cjs"),D=require("./useFieldGroupStyleProps.cjs"),d=n=>{const{"aria-describedby":u="",children:c,helperText:p,hasValidationIcon:x,id:r,isDisabled:y,isFluid:b,isLabelHidden:T,isRequired:h,label:t,validationState:i,validationText:a,...m}=n,{classProps:s}=D.useFieldGroupStyleProps({isFluid:b,isRequired:h,validationState:i}),{styleProps:l,props:q}=j.useStyleProps(m),[P,o]=A.default(u),f=v.useAriaDescribedBy(P),N=g.useValidationTextRole({validationState:i,validationText:a});return e.jsxs("fieldset",{...q,...l,...f,className:S(s.root,l.className),disabled:y,children:[e.jsx(V.default,{elementType:"legend",children:t}),!T&&e.jsx("div",{className:s.label,"aria-hidden":"true",children:t}),e.jsx("div",{className:s.fields,children:c}),e.jsx(_.default,{UNSAFE_className:s.helperText,id:`${r}__helperText`,registerAria:o,helperText:p}),i&&e.jsx(F.default,{UNSAFE_className:s.validationText,...x&&{hasValidationStateIcon:i},id:`${r}__helperText`,validationText:a,registerAria:o,role:N})]})};d.spiritComponent="FieldGroup";exports.default=d;
1
+ "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),N=require("classnames"),S=require("../../hooks/styleProps.cjs"),j=require("../../hooks/useAriaIdRefs.cjs"),v=require("../Field/HelperText.cjs"),_=require("../Field/ValidationText.cjs"),F=require("../Field/useValidationTextRole.cjs"),g=require("../VisuallyHidden/VisuallyHidden.cjs"),A=require("./useFieldGroupStyleProps.cjs"),d=n=>{const{"aria-describedby":u="",children:c,helperText:p,hasValidationIcon:x,id:r,isDisabled:y,isFluid:T,isLabelHidden:b,isRequired:h,label:t,validationState:i,validationText:l,...m}=n,{classProps:s}=A.useFieldGroupStyleProps({isFluid:T,isRequired:h,validationState:i}),{styleProps:a,props:q}=S.useStyleProps(m),[P,o]=j.useAriaDescribedBy(u),f=F.useValidationTextRole({validationState:i,validationText:l});return e.jsxs("fieldset",{...q,...a,...P,className:N(s.root,a.className),disabled:y,children:[e.jsx(g.default,{elementType:"legend",children:t}),!b&&e.jsx("div",{className:s.label,"aria-hidden":"true",children:t}),e.jsx("div",{className:s.fields,children:c}),e.jsx(v.default,{UNSAFE_className:s.helperText,id:`${r}__helperText`,registerAria:o,helperText:p}),i&&e.jsx(_.default,{UNSAFE_className:s.validationText,...x&&{hasValidationStateIcon:i},id:`${r}__helperText`,validationText:l,registerAria:o,role:f})]})};d.spiritComponent="FieldGroup";exports.default=d;
2
2
  //# sourceMappingURL=FieldGroup.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"FieldGroup.cjs","sources":["../../../src/components/FieldGroup/FieldGroup.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type SpiritFieldGroupProps } from '../../types';\nimport { HelperText, ValidationText, useAriaIds } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { useFieldGroupStyleProps } from './useFieldGroupStyleProps';\n\nconst FieldGroup = (props: SpiritFieldGroupProps) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n children,\n helperText,\n hasValidationIcon,\n id,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n label,\n validationState,\n validationText,\n ...rest\n } = props;\n\n const { classProps } = useFieldGroupStyleProps({ hasValidationIcon, isFluid, isRequired, validationState });\n const { styleProps, props: transferProps } = useStyleProps(rest);\n const [ids, register] = useAriaIds(ariaDescribedBy);\n const ariaDescribedByProp = useAriaDescribedBy(ids);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <fieldset\n {...transferProps}\n {...styleProps}\n {...ariaDescribedByProp}\n className={classNames(classProps.root, styleProps.className)}\n disabled={isDisabled}\n >\n <VisuallyHidden elementType=\"legend\">{label}</VisuallyHidden>\n {!isLabelHidden && (\n <div className={classProps.label} aria-hidden=\"true\">\n {label}\n </div>\n )}\n <div className={classProps.fields}>{children}</div>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__helperText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </fieldset>\n );\n};\n\nFieldGroup.spiritComponent = 'FieldGroup';\n\nexport default FieldGroup;\n"],"names":["FieldGroup","props","ariaDescribedBy","children","helperText","hasValidationIcon","id","isDisabled","isFluid","isLabelHidden","isRequired","label","validationState","validationText","rest","classProps","useFieldGroupStyleProps","styleProps","transferProps","useStyleProps","ids","register","useAriaIds","ariaDescribedByProp","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","VisuallyHidden","HelperText","ValidationText"],"mappings":"8gBAWMA,EAAcC,GAAiC,CACnD,KAAM,CACJ,mBAAoBC,EAAkB,GACtC,SAAAC,EACA,WAAAC,EACA,kBAAAC,EACA,GAAAC,EACA,WAAAC,EACA,QAAAC,EACA,cAAAC,EACA,WAAAC,EACA,MAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,GAAGC,CAAA,EACDb,EAEE,CAAE,WAAAc,GAAeC,EAAAA,wBAAwB,CAAqB,QAAAR,EAAS,WAAAE,EAAY,gBAAAE,EAAiB,EACpG,CAAA,WAAEK,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,cAAcL,CAAI,EACzD,CAACM,EAAKC,CAAQ,EAAIC,EAAAA,QAAWpB,CAAe,EAC5CqB,EAAsBC,EAAAA,mBAAmBJ,CAAG,EAC5CK,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAd,EACA,eAAAC,CAAA,CACD,EAED,OACEc,EAAAA,KAAC,WAAA,CACE,GAAGT,EACH,GAAGD,EACH,GAAGM,EACJ,UAAWK,EAAWb,EAAW,KAAME,EAAW,SAAS,EAC3D,SAAUV,EAEV,SAAA,CAAAsB,EAAAA,IAACC,EAAAA,QAAA,CAAe,YAAY,SAAU,SAAAnB,EAAM,EAC3C,CAACF,GACAoB,EAAAA,IAAC,MAAA,CAAI,UAAWd,EAAW,MAAO,cAAY,OAC3C,SAAAJ,CAAA,CACH,EAEFkB,EAAAA,IAAC,MAAA,CAAI,UAAWd,EAAW,OAAS,SAAAZ,EAAS,EAC7C0B,EAAAA,IAACE,EAAAA,QAAA,CACC,iBAAkBhB,EAAW,WAC7B,GAAI,GAAGT,CAAE,eACT,aAAce,EACd,WAAAjB,CAAA,CAAA,EAEDQ,GACCiB,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBjB,EAAW,eAC5B,GAAIV,GAAqB,CAAE,uBAAwBO,CAAA,EACpD,GAAI,GAAGN,CAAE,eACT,eAAAO,EACA,aAAcQ,EACd,KAAMI,CAAA,CAAA,CACR,CAAA,CAAA,CAIR,EAEAzB,EAAW,gBAAkB"}
1
+ {"version":3,"file":"FieldGroup.cjs","sources":["../../../src/components/FieldGroup/FieldGroup.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type SpiritFieldGroupProps } from '../../types';\nimport { HelperText, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { useFieldGroupStyleProps } from './useFieldGroupStyleProps';\n\nconst FieldGroup = (props: SpiritFieldGroupProps) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n children,\n helperText,\n hasValidationIcon,\n id,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n label,\n validationState,\n validationText,\n ...rest\n } = props;\n\n const { classProps } = useFieldGroupStyleProps({ hasValidationIcon, isFluid, isRequired, validationState });\n const { styleProps, props: transferProps } = useStyleProps(rest);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <fieldset\n {...transferProps}\n {...styleProps}\n {...ariaDescribedByProp}\n className={classNames(classProps.root, styleProps.className)}\n disabled={isDisabled}\n >\n <VisuallyHidden elementType=\"legend\">{label}</VisuallyHidden>\n {!isLabelHidden && (\n <div className={classProps.label} aria-hidden=\"true\">\n {label}\n </div>\n )}\n <div className={classProps.fields}>{children}</div>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__helperText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </fieldset>\n );\n};\n\nFieldGroup.spiritComponent = 'FieldGroup';\n\nexport default FieldGroup;\n"],"names":["FieldGroup","props","ariaDescribedBy","children","helperText","hasValidationIcon","id","isDisabled","isFluid","isLabelHidden","isRequired","label","validationState","validationText","rest","classProps","useFieldGroupStyleProps","styleProps","transferProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","VisuallyHidden","HelperText","ValidationText"],"mappings":"oeAWMA,EAAcC,GAAiC,CACnD,KAAM,CACJ,mBAAoBC,EAAkB,GACtC,SAAAC,EACA,WAAAC,EACA,kBAAAC,EACA,GAAAC,EACA,WAAAC,EACA,QAAAC,EACA,cAAAC,EACA,WAAAC,EACA,MAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,GAAGC,CAAA,EACDb,EAEE,CAAE,WAAAc,GAAeC,EAAAA,wBAAwB,CAAqB,QAAAR,EAAS,WAAAE,EAAY,gBAAAE,EAAiB,EACpG,CAAA,WAAEK,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,cAAcL,CAAI,EACzD,CAACM,EAAqBC,CAAQ,EAAIC,EAAAA,mBAAmBpB,CAAe,EACpEqB,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAZ,EACA,eAAAC,CAAA,CACD,EAED,OACEY,EAAAA,KAAC,WAAA,CACE,GAAGP,EACH,GAAGD,EACH,GAAGG,EACJ,UAAWM,EAAWX,EAAW,KAAME,EAAW,SAAS,EAC3D,SAAUV,EAEV,SAAA,CAAAoB,EAAAA,IAACC,EAAAA,QAAA,CAAe,YAAY,SAAU,SAAAjB,EAAM,EAC3C,CAACF,GACAkB,EAAAA,IAAC,MAAA,CAAI,UAAWZ,EAAW,MAAO,cAAY,OAC3C,SAAAJ,CAAA,CACH,EAEFgB,EAAAA,IAAC,MAAA,CAAI,UAAWZ,EAAW,OAAS,SAAAZ,EAAS,EAC7CwB,EAAAA,IAACE,EAAAA,QAAA,CACC,iBAAkBd,EAAW,WAC7B,GAAI,GAAGT,CAAE,eACT,aAAce,EACd,WAAAjB,CAAA,CAAA,EAEDQ,GACCe,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBf,EAAW,eAC5B,GAAIV,GAAqB,CAAE,uBAAwBO,CAAA,EACpD,GAAI,GAAGN,CAAE,eACT,eAAAO,EACA,aAAcQ,EACd,KAAME,CAAA,CAAA,CACR,CAAA,CAAA,CAIR,EAEAvB,EAAW,gBAAkB"}
@@ -1,15 +1,14 @@
1
1
  "use client";
2
- import { jsxs as A, jsx as i } from "react/jsx-runtime";
2
+ import { jsxs as v, jsx as i } from "react/jsx-runtime";
3
3
  import F from "classnames";
4
4
  import { useStyleProps as P } from "../../hooks/styleProps.js";
5
- import { useAriaDescribedBy as S } from "../../hooks/useAriaDescribedBy.js";
5
+ import { useAriaDescribedBy as S } from "../../hooks/useAriaIdRefs.js";
6
6
  import _ from "../Field/HelperText.js";
7
- import V from "../Field/useAriaIds.js";
8
- import g from "../Field/ValidationText.js";
9
- import { useValidationTextRole as D } from "../Field/useValidationTextRole.js";
10
- import B from "../VisuallyHidden/VisuallyHidden.js";
11
- import { useFieldGroupStyleProps as G } from "./useFieldGroupStyleProps.js";
12
- const H = (d) => {
7
+ import A from "../Field/ValidationText.js";
8
+ import { useValidationTextRole as V } from "../Field/useValidationTextRole.js";
9
+ import g from "../VisuallyHidden/VisuallyHidden.js";
10
+ import { useFieldGroupStyleProps as D } from "./useFieldGroupStyleProps.js";
11
+ const B = (d) => {
13
12
  const {
14
13
  "aria-describedby": n = "",
15
14
  children: p,
@@ -24,20 +23,20 @@ const H = (d) => {
24
23
  validationState: r,
25
24
  validationText: a,
26
25
  ...T
27
- } = d, { classProps: e } = G({ isFluid: f, isRequired: h, validationState: r }), { styleProps: o, props: b } = P(T), [y, l] = V(n), N = S(y), v = D({
26
+ } = d, { classProps: e } = D({ isFluid: f, isRequired: h, validationState: r }), { styleProps: o, props: b } = P(T), [y, l] = S(n), N = V({
28
27
  validationState: r,
29
28
  validationText: a
30
29
  });
31
- return /* @__PURE__ */ A(
30
+ return /* @__PURE__ */ v(
32
31
  "fieldset",
33
32
  {
34
33
  ...b,
35
34
  ...o,
36
- ...N,
35
+ ...y,
37
36
  className: F(e.root, o.className),
38
37
  disabled: u,
39
38
  children: [
40
- /* @__PURE__ */ i(B, { elementType: "legend", children: t }),
39
+ /* @__PURE__ */ i(g, { elementType: "legend", children: t }),
41
40
  !x && /* @__PURE__ */ i("div", { className: e.label, "aria-hidden": "true", children: t }),
42
41
  /* @__PURE__ */ i("div", { className: e.fields, children: p }),
43
42
  /* @__PURE__ */ i(
@@ -50,22 +49,22 @@ const H = (d) => {
50
49
  }
51
50
  ),
52
51
  r && /* @__PURE__ */ i(
53
- g,
52
+ A,
54
53
  {
55
54
  UNSAFE_className: e.validationText,
56
55
  ...c && { hasValidationStateIcon: r },
57
56
  id: `${s}__helperText`,
58
57
  validationText: a,
59
58
  registerAria: l,
60
- role: v
59
+ role: N
61
60
  }
62
61
  )
63
62
  ]
64
63
  }
65
64
  );
66
65
  };
67
- H.spiritComponent = "FieldGroup";
66
+ B.spiritComponent = "FieldGroup";
68
67
  export {
69
- H as default
68
+ B as default
70
69
  };
71
70
  //# sourceMappingURL=FieldGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FieldGroup.js","sources":["../../../src/components/FieldGroup/FieldGroup.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type SpiritFieldGroupProps } from '../../types';\nimport { HelperText, ValidationText, useAriaIds } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { useFieldGroupStyleProps } from './useFieldGroupStyleProps';\n\nconst FieldGroup = (props: SpiritFieldGroupProps) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n children,\n helperText,\n hasValidationIcon,\n id,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n label,\n validationState,\n validationText,\n ...rest\n } = props;\n\n const { classProps } = useFieldGroupStyleProps({ hasValidationIcon, isFluid, isRequired, validationState });\n const { styleProps, props: transferProps } = useStyleProps(rest);\n const [ids, register] = useAriaIds(ariaDescribedBy);\n const ariaDescribedByProp = useAriaDescribedBy(ids);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <fieldset\n {...transferProps}\n {...styleProps}\n {...ariaDescribedByProp}\n className={classNames(classProps.root, styleProps.className)}\n disabled={isDisabled}\n >\n <VisuallyHidden elementType=\"legend\">{label}</VisuallyHidden>\n {!isLabelHidden && (\n <div className={classProps.label} aria-hidden=\"true\">\n {label}\n </div>\n )}\n <div className={classProps.fields}>{children}</div>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__helperText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </fieldset>\n );\n};\n\nFieldGroup.spiritComponent = 'FieldGroup';\n\nexport default FieldGroup;\n"],"names":["FieldGroup","props","ariaDescribedBy","children","helperText","hasValidationIcon","id","isDisabled","isFluid","isLabelHidden","isRequired","label","validationState","validationText","rest","classProps","useFieldGroupStyleProps","styleProps","transferProps","useStyleProps","ids","register","useAriaIds","ariaDescribedByProp","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","VisuallyHidden","HelperText","ValidationText"],"mappings":";;;;;;;;;;;AAWA,MAAMA,IAAa,CAACC,MAAiC;AACnD,QAAM;AAAA,IACJ,oBAAoBC,IAAkB;AAAA,IACtC,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,IAAAC;AAAA,IACA,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDb,GAEE,EAAE,YAAAc,MAAeC,EAAwB,EAAqB,SAAAR,GAAS,YAAAE,GAAY,iBAAAE,GAAiB,GACpG,EAAE,YAAAK,GAAY,OAAOC,EAAA,IAAkBC,EAAcL,CAAI,GACzD,CAACM,GAAKC,CAAQ,IAAIC,EAAWpB,CAAe,GAC5CqB,IAAsBC,EAAmBJ,CAAG,GAC5CK,IAAqBC,EAAsB;AAAA,IAC/C,iBAAAd;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD;AAED,SACE,gBAAAc;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGT;AAAA,MACH,GAAGD;AAAA,MACH,GAAGM;AAAA,MACJ,WAAWK,EAAWb,EAAW,MAAME,EAAW,SAAS;AAAA,MAC3D,UAAUV;AAAA,MAEV,UAAA;AAAA,QAAA,gBAAAsB,EAACC,GAAA,EAAe,aAAY,UAAU,UAAAnB,GAAM;AAAA,QAC3C,CAACF,KACA,gBAAAoB,EAAC,OAAA,EAAI,WAAWd,EAAW,OAAO,eAAY,QAC3C,UAAAJ,EAAA,CACH;AAAA,QAEF,gBAAAkB,EAAC,OAAA,EAAI,WAAWd,EAAW,QAAS,UAAAZ,GAAS;AAAA,QAC7C,gBAAA0B;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,kBAAkBhB,EAAW;AAAA,YAC7B,IAAI,GAAGT,CAAE;AAAA,YACT,cAAce;AAAA,YACd,YAAAjB;AAAA,UAAA;AAAA,QAAA;AAAA,QAEDQ,KACC,gBAAAiB;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,kBAAkBjB,EAAW;AAAA,YAC5B,GAAIV,KAAqB,EAAE,wBAAwBO,EAAA;AAAA,YACpD,IAAI,GAAGN,CAAE;AAAA,YACT,gBAAAO;AAAA,YACA,cAAcQ;AAAA,YACd,MAAMI;AAAA,UAAA;AAAA,QAAA;AAAA,MACR;AAAA,IAAA;AAAA,EAAA;AAIR;AAEAzB,EAAW,kBAAkB;"}
1
+ {"version":3,"file":"FieldGroup.js","sources":["../../../src/components/FieldGroup/FieldGroup.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type SpiritFieldGroupProps } from '../../types';\nimport { HelperText, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { useFieldGroupStyleProps } from './useFieldGroupStyleProps';\n\nconst FieldGroup = (props: SpiritFieldGroupProps) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n children,\n helperText,\n hasValidationIcon,\n id,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n label,\n validationState,\n validationText,\n ...rest\n } = props;\n\n const { classProps } = useFieldGroupStyleProps({ hasValidationIcon, isFluid, isRequired, validationState });\n const { styleProps, props: transferProps } = useStyleProps(rest);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <fieldset\n {...transferProps}\n {...styleProps}\n {...ariaDescribedByProp}\n className={classNames(classProps.root, styleProps.className)}\n disabled={isDisabled}\n >\n <VisuallyHidden elementType=\"legend\">{label}</VisuallyHidden>\n {!isLabelHidden && (\n <div className={classProps.label} aria-hidden=\"true\">\n {label}\n </div>\n )}\n <div className={classProps.fields}>{children}</div>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__helperText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </fieldset>\n );\n};\n\nFieldGroup.spiritComponent = 'FieldGroup';\n\nexport default FieldGroup;\n"],"names":["FieldGroup","props","ariaDescribedBy","children","helperText","hasValidationIcon","id","isDisabled","isFluid","isLabelHidden","isRequired","label","validationState","validationText","rest","classProps","useFieldGroupStyleProps","styleProps","transferProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","VisuallyHidden","HelperText","ValidationText"],"mappings":";;;;;;;;;;AAWA,MAAMA,IAAa,CAACC,MAAiC;AACnD,QAAM;AAAA,IACJ,oBAAoBC,IAAkB;AAAA,IACtC,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,IAAAC;AAAA,IACA,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDb,GAEE,EAAE,YAAAc,MAAeC,EAAwB,EAAqB,SAAAR,GAAS,YAAAE,GAAY,iBAAAE,GAAiB,GACpG,EAAE,YAAAK,GAAY,OAAOC,EAAA,IAAkBC,EAAcL,CAAI,GACzD,CAACM,GAAqBC,CAAQ,IAAIC,EAAmBpB,CAAe,GACpEqB,IAAqBC,EAAsB;AAAA,IAC/C,iBAAAZ;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD;AAED,SACE,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGP;AAAA,MACH,GAAGD;AAAA,MACH,GAAGG;AAAA,MACJ,WAAWM,EAAWX,EAAW,MAAME,EAAW,SAAS;AAAA,MAC3D,UAAUV;AAAA,MAEV,UAAA;AAAA,QAAA,gBAAAoB,EAACC,GAAA,EAAe,aAAY,UAAU,UAAAjB,GAAM;AAAA,QAC3C,CAACF,KACA,gBAAAkB,EAAC,OAAA,EAAI,WAAWZ,EAAW,OAAO,eAAY,QAC3C,UAAAJ,EAAA,CACH;AAAA,QAEF,gBAAAgB,EAAC,OAAA,EAAI,WAAWZ,EAAW,QAAS,UAAAZ,GAAS;AAAA,QAC7C,gBAAAwB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,kBAAkBd,EAAW;AAAA,YAC7B,IAAI,GAAGT,CAAE;AAAA,YACT,cAAce;AAAA,YACd,YAAAjB;AAAA,UAAA;AAAA,QAAA;AAAA,QAEDQ,KACC,gBAAAe;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,kBAAkBf,EAAW;AAAA,YAC5B,GAAIV,KAAqB,EAAE,wBAAwBO,EAAA;AAAA,YACpD,IAAI,GAAGN,CAAE;AAAA,YACT,gBAAAO;AAAA,YACA,cAAcQ;AAAA,YACd,MAAME;AAAA,UAAA;AAAA,QAAA;AAAA,MACR;AAAA,IAAA;AAAA,EAAA;AAIR;AAEAvB,EAAW,kBAAkB;"}
@@ -1,2 +1,2 @@
1
- "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),Q=require("classnames"),x=require("react"),z=require("../../hooks/styleProps.cjs"),w=require("../../hooks/useAriaDescribedBy.cjs"),G=require("../Field/HelperText.cjs"),D=require("../Field/Label.cjs"),J=require("../Field/useAriaIds.cjs"),K=require("../Field/ValidationText.cjs"),W=require("../Field/useValidationTextRole.cjs"),X=require("../Icon/Icon.cjs"),b=require("./constants.cjs"),Y=require("./useFileUploaderInput.cjs"),ee=require("./useFileUploaderStyleProps.cjs"),g=v=>{const[i,F]=x.useState(!1),{accept:o,"aria-describedby":T="",dropZoneRef:f,hasValidationIcon:h,helperText:q,iconName:E="upload",id:t,inputRef:I,isDisabled:r,isLabelHidden:N,isMultiple:n,isRequired:S,label:_,labelText:y,linkText:U,maxFileSize:A=b.DEFAULT_FILE_SIZE_LIMIT,maxUploadedFiles:L=b.DEFAULT_FILE_QUEUE_LIMIT,onError:j,queueLimitBehavior:l="none",validationState:a,validationText:d,...u}=v,{isDisabledByQueueLimitBehavior:p,isDragging:P,isDropZoneHidden:R,onChange:B,onDragEnter:M,onDragLeave:V,onDragOver:Z,onDrop:H}=Y.useFileUploaderInput({accept:o,isMultiple:n,maxFileSize:A,maxUploadedFiles:L,onError:j,queueLimitBehavior:l}),{classProps:s}=ee.useFileUploaderStyleProps({isDisabled:r,isDisabledByQueueLimitBehavior:p,isDragAndDropSupported:i,isDragging:P,isDropZoneHidden:R,isLabelHidden:N,isRequired:S,queueLimitBehavior:l,validationState:a}),{styleProps:c,props:O}=z.useStyleProps(u),[$,m]=J.default(T),k=w.useAriaDescribedBy($),C=W.useValidationTextRole({validationState:a,validationText:d});return x.useEffect(()=>{F("draggable"in document.createElement("span"))},[]),e.jsxs("div",{...O,...c,onDragOver:!r&&i?Z:void 0,onDragEnter:!r&&i?M:void 0,onDragLeave:!r&&i?V:void 0,onDrop:!r&&i?H:void 0,className:Q(s.input.root,c.className),children:[e.jsx(D.default,{htmlFor:t,UNSAFE_className:s.input.label,children:_}),e.jsx("input",{...k,type:"file",accept:o,id:t,ref:I,className:s.input.input,onChange:B,multiple:n,disabled:r||p,...u}),e.jsxs("div",{ref:f,className:s.input.dropZone.root,children:[e.jsx(X.default,{name:E,"aria-hidden":"true"}),e.jsxs(D.default,{htmlFor:t,UNSAFE_className:s.input.dropZone.label,children:[e.jsx("span",{className:s.input.link,children:U})," ",e.jsx("span",{className:s.input.dropLabel,children:y})]}),e.jsx(G.default,{UNSAFE_className:s.input.helper,id:`${t}__helperText`,registerAria:m,helperText:q})]}),a&&e.jsx(K.default,{UNSAFE_className:s.input.validationText,elementType:"span",...h&&{hasValidationStateIcon:a},id:`${t}__validationText`,validationText:d,registerAria:m,role:C})]})};g.spiritComponent="FileUploaderInput";exports.default=g;
1
+ "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),Q=require("classnames"),x=require("react"),z=require("../../hooks/styleProps.cjs"),w=require("../../hooks/useAriaIdRefs.cjs"),G=require("../Field/HelperText.cjs"),D=require("../Field/Label.cjs"),J=require("../Field/ValidationText.cjs"),K=require("../Field/useValidationTextRole.cjs"),W=require("../Icon/Icon.cjs"),g=require("./constants.cjs"),X=require("./useFileUploaderInput.cjs"),Y=require("./useFileUploaderStyleProps.cjs"),v=b=>{const[i,F]=x.useState(!1),{accept:o,"aria-describedby":T="",dropZoneRef:f,hasValidationIcon:h,helperText:E,iconName:I="upload",id:t,inputRef:N,isDisabled:r,isLabelHidden:S,isMultiple:n,isRequired:_,label:q,labelText:U,linkText:y,maxFileSize:L=g.DEFAULT_FILE_SIZE_LIMIT,maxUploadedFiles:j=g.DEFAULT_FILE_QUEUE_LIMIT,name:A,onError:P,queueLimitBehavior:l="none",validationState:a,validationText:d,...u}=b,{isDisabledByQueueLimitBehavior:p,isDragging:R,isDropZoneHidden:B,onChange:M,onDragEnter:V,onDragLeave:Z,onDragOver:H,onDrop:O}=X.useFileUploaderInput({accept:o,isMultiple:n,maxFileSize:L,maxUploadedFiles:j,onError:P,queueLimitBehavior:l}),{classProps:s}=Y.useFileUploaderStyleProps({isDisabled:r,isDisabledByQueueLimitBehavior:p,isDragAndDropSupported:i,isDragging:R,isDropZoneHidden:B,isLabelHidden:S,isRequired:_,queueLimitBehavior:l,validationState:a}),{styleProps:c,props:$}=z.useStyleProps(u),[k,m]=w.useAriaDescribedBy(T),C=K.useValidationTextRole({validationState:a,validationText:d});return x.useEffect(()=>{F("draggable"in document.createElement("span"))},[]),e.jsxs("div",{...$,...c,onDragOver:!r&&i?H:void 0,onDragEnter:!r&&i?V:void 0,onDragLeave:!r&&i?Z:void 0,onDrop:!r&&i?O:void 0,className:Q(s.input.root,c.className),children:[e.jsx(D.default,{htmlFor:t,UNSAFE_className:s.input.label,children:q}),e.jsx("input",{...k,type:"file",accept:o,id:t,ref:N,name:A,className:s.input.input,onChange:M,multiple:n,disabled:r||p,...u}),e.jsxs("div",{ref:f,className:s.input.dropZone.root,children:[e.jsx(W.default,{name:I,"aria-hidden":"true"}),e.jsxs(D.default,{htmlFor:t,UNSAFE_className:s.input.dropZone.label,children:[e.jsx("span",{className:s.input.link,children:y})," ",e.jsx("span",{className:s.input.dropLabel,children:U})]}),e.jsx(G.default,{UNSAFE_className:s.input.helper,id:`${t}__helperText`,registerAria:m,helperText:E})]}),a&&e.jsx(J.default,{UNSAFE_className:s.input.validationText,elementType:"span",...h&&{hasValidationStateIcon:a},id:`${t}__validationText`,validationText:d,registerAria:m,role:C})]})};v.spiritComponent="FileUploaderInput";exports.default=v;
2
2
  //# sourceMappingURL=FileUploaderInput.cjs.map