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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/DEPRECATIONS.md +2 -2
  3. package/README.md +135 -6
  4. package/dist/bundles/web-react.umd.js +1731 -624
  5. package/dist/bundles/web-react.umd.js.map +1 -1
  6. package/dist/bundles/web-react.umd.min.js +1 -1
  7. package/dist/bundles/web-react.umd.min.js.map +1 -1
  8. package/dist/components/Button/Button.cjs +1 -1
  9. package/dist/components/Button/Button.cjs.map +1 -1
  10. package/dist/components/Button/Button.js +19 -19
  11. package/dist/components/Button/Button.js.map +1 -1
  12. package/dist/components/ButtonLink/ButtonLink.cjs +1 -1
  13. package/dist/components/ButtonLink/ButtonLink.cjs.map +1 -1
  14. package/dist/components/ButtonLink/ButtonLink.d.ts +2 -2
  15. package/dist/components/ButtonLink/ButtonLink.js +23 -18
  16. package/dist/components/ButtonLink/ButtonLink.js.map +1 -1
  17. package/dist/components/ButtonLink/useButtonLinkStyleProps.cjs.map +1 -1
  18. package/dist/components/ButtonLink/useButtonLinkStyleProps.d.ts +9 -9
  19. package/dist/components/ButtonLink/useButtonLinkStyleProps.js.map +1 -1
  20. package/dist/components/Card/CardLink.cjs +1 -1
  21. package/dist/components/Card/CardLink.cjs.map +1 -1
  22. package/dist/components/Card/CardLink.d.ts +2 -2
  23. package/dist/components/Card/CardLink.js +10 -15
  24. package/dist/components/Card/CardLink.js.map +1 -1
  25. package/dist/components/CharacterCounter/CharacterCounter.cjs +2 -0
  26. package/dist/components/CharacterCounter/CharacterCounter.cjs.map +1 -0
  27. package/dist/components/CharacterCounter/CharacterCounter.d.ts +7 -0
  28. package/dist/components/CharacterCounter/CharacterCounter.js +23 -0
  29. package/dist/components/CharacterCounter/CharacterCounter.js.map +1 -0
  30. package/dist/components/CharacterCounter/constants.cjs +2 -0
  31. package/dist/components/CharacterCounter/constants.cjs.map +1 -0
  32. package/dist/components/CharacterCounter/constants.d.ts +1 -0
  33. package/dist/components/CharacterCounter/constants.js +5 -0
  34. package/dist/components/CharacterCounter/constants.js.map +1 -0
  35. package/dist/components/CharacterCounter/index.cjs +2 -0
  36. package/dist/components/CharacterCounter/index.d.ts +3 -0
  37. package/dist/components/CharacterCounter/index.js +7 -0
  38. package/dist/components/{UNSTABLE_Attachment → CharacterCounter}/index.js.map +1 -1
  39. package/dist/components/CharacterCounter/types.d.ts +6 -0
  40. package/dist/components/CharacterCounter/useCharacterCounterState.cjs +2 -0
  41. package/dist/components/CharacterCounter/useCharacterCounterState.cjs.map +1 -0
  42. package/dist/components/CharacterCounter/useCharacterCounterState.d.ts +25 -0
  43. package/dist/components/CharacterCounter/useCharacterCounterState.js +66 -0
  44. package/dist/components/CharacterCounter/useCharacterCounterState.js.map +1 -0
  45. package/dist/components/CharacterCounter.d.ts +2 -0
  46. package/dist/components/Checkbox/Checkbox.cjs +1 -1
  47. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  48. package/dist/components/Checkbox/Checkbox.js +58 -54
  49. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  50. package/dist/components/ControlButton/useControlButtonStyleProps.cjs.map +1 -1
  51. package/dist/components/ControlButton/useControlButtonStyleProps.js.map +1 -1
  52. package/dist/components/Dropdown/DropdownPopover.cjs.map +1 -1
  53. package/dist/components/Dropdown/DropdownPopover.d.ts +2 -2
  54. package/dist/components/Dropdown/DropdownPopover.js.map +1 -1
  55. package/dist/components/Field/index.cjs +1 -1
  56. package/dist/components/Field/index.d.ts +0 -2
  57. package/dist/components/Field/index.js +2 -4
  58. package/dist/components/Field/index.js.map +1 -1
  59. package/dist/components/Field/types.d.ts +1 -1
  60. package/dist/components/FieldGroup/FieldGroup.cjs +1 -1
  61. package/dist/components/FieldGroup/FieldGroup.cjs.map +1 -1
  62. package/dist/components/FieldGroup/FieldGroup.js +15 -16
  63. package/dist/components/FieldGroup/FieldGroup.js.map +1 -1
  64. package/dist/components/FileUploader/FileUploaderInput.cjs +1 -1
  65. package/dist/components/FileUploader/FileUploaderInput.cjs.map +1 -1
  66. package/dist/components/FileUploader/FileUploaderInput.js +36 -35
  67. package/dist/components/FileUploader/FileUploaderInput.js.map +1 -1
  68. package/dist/components/Header/HeaderDialogLink.cjs +1 -1
  69. package/dist/components/Header/HeaderDialogLink.cjs.map +1 -1
  70. package/dist/components/Header/HeaderDialogLink.js +18 -17
  71. package/dist/components/Header/HeaderDialogLink.js.map +1 -1
  72. package/dist/components/Header/HeaderLink.cjs +1 -1
  73. package/dist/components/Header/HeaderLink.cjs.map +1 -1
  74. package/dist/components/Header/HeaderLink.js +16 -15
  75. package/dist/components/Header/HeaderLink.js.map +1 -1
  76. package/dist/components/InputDetails/InputDetails.cjs +2 -0
  77. package/dist/components/InputDetails/InputDetails.cjs.map +1 -0
  78. package/dist/components/InputDetails/InputDetails.d.ts +7 -0
  79. package/dist/components/InputDetails/InputDetails.js +21 -0
  80. package/dist/components/InputDetails/InputDetails.js.map +1 -0
  81. package/dist/components/InputDetails/index.cjs +2 -0
  82. package/dist/components/InputDetails/index.cjs.map +1 -0
  83. package/dist/components/InputDetails/index.d.ts +2 -0
  84. package/dist/components/InputDetails/index.js +7 -0
  85. package/dist/components/InputDetails/index.js.map +1 -0
  86. package/dist/components/InputDetails/useInputDetailsStyleProps.cjs +2 -0
  87. package/dist/components/InputDetails/useInputDetailsStyleProps.cjs.map +1 -0
  88. package/dist/components/InputDetails/useInputDetailsStyleProps.d.ts +7 -0
  89. package/dist/components/InputDetails/useInputDetailsStyleProps.js +11 -0
  90. package/dist/components/InputDetails/useInputDetailsStyleProps.js.map +1 -0
  91. package/dist/components/InputDetails.d.ts +2 -0
  92. package/dist/components/Link/Link.cjs +1 -1
  93. package/dist/components/Link/Link.cjs.map +1 -1
  94. package/dist/components/Link/Link.js +10 -9
  95. package/dist/components/Link/Link.js.map +1 -1
  96. package/dist/components/Link/useLinkStyleProps.cjs.map +1 -1
  97. package/dist/components/Link/useLinkStyleProps.d.ts +1 -1
  98. package/dist/components/Link/useLinkStyleProps.js.map +1 -1
  99. package/dist/components/Pagination/PaginationLink.cjs +1 -1
  100. package/dist/components/Pagination/PaginationLink.cjs.map +1 -1
  101. package/dist/components/Pagination/PaginationLink.js +29 -18
  102. package/dist/components/Pagination/PaginationLink.js.map +1 -1
  103. package/dist/components/Radio/Radio.cjs +1 -1
  104. package/dist/components/Radio/Radio.cjs.map +1 -1
  105. package/dist/components/Radio/Radio.js +24 -25
  106. package/dist/components/Radio/Radio.js.map +1 -1
  107. package/dist/components/ScrollView/useScrollPosition.js +4 -4
  108. package/dist/components/Select/Select.cjs +1 -1
  109. package/dist/components/Select/Select.cjs.map +1 -1
  110. package/dist/components/Select/Select.js +28 -29
  111. package/dist/components/Select/Select.js.map +1 -1
  112. package/dist/components/Slider/Slider.cjs +1 -1
  113. package/dist/components/Slider/Slider.cjs.map +1 -1
  114. package/dist/components/Slider/Slider.js +23 -24
  115. package/dist/components/Slider/Slider.js.map +1 -1
  116. package/dist/components/Tabs/TabLink.cjs +1 -1
  117. package/dist/components/Tabs/TabLink.cjs.map +1 -1
  118. package/dist/components/Tabs/TabLink.js +18 -17
  119. package/dist/components/Tabs/TabLink.js.map +1 -1
  120. package/dist/components/Tag/constants.cjs +1 -1
  121. package/dist/components/Tag/constants.cjs.map +1 -1
  122. package/dist/components/Tag/constants.d.ts +1 -0
  123. package/dist/components/Tag/constants.js +4 -3
  124. package/dist/components/Tag/constants.js.map +1 -1
  125. package/dist/components/Tag/useTagStyleProps.cjs +1 -1
  126. package/dist/components/Tag/useTagStyleProps.cjs.map +1 -1
  127. package/dist/components/Tag/useTagStyleProps.js +25 -10
  128. package/dist/components/Tag/useTagStyleProps.js.map +1 -1
  129. package/dist/components/TextArea/TextArea.cjs +1 -1
  130. package/dist/components/TextArea/TextArea.cjs.map +1 -1
  131. package/dist/components/TextArea/TextArea.js +57 -21
  132. package/dist/components/TextArea/TextArea.js.map +1 -1
  133. package/dist/components/TextArea/constants.cjs +2 -0
  134. package/dist/components/TextArea/constants.cjs.map +1 -0
  135. package/dist/components/TextArea/constants.d.ts +1 -0
  136. package/dist/components/TextArea/constants.js +5 -0
  137. package/dist/components/TextArea/constants.js.map +1 -0
  138. package/dist/components/TextFieldBase/TextFieldBase.cjs +1 -1
  139. package/dist/components/TextFieldBase/TextFieldBase.cjs.map +1 -1
  140. package/dist/components/TextFieldBase/TextFieldBase.js +69 -59
  141. package/dist/components/TextFieldBase/TextFieldBase.js.map +1 -1
  142. package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.cjs +1 -1
  143. package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.cjs.map +1 -1
  144. package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.d.ts +1 -0
  145. package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.js +11 -10
  146. package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.js.map +1 -1
  147. package/dist/components/Toggle/Toggle.cjs +1 -1
  148. package/dist/components/Toggle/Toggle.cjs.map +1 -1
  149. package/dist/components/Toggle/Toggle.js +59 -55
  150. package/dist/components/Toggle/Toggle.js.map +1 -1
  151. package/dist/components/UNSTABLE_File/UNSTABLE_File.cjs +2 -0
  152. package/dist/components/UNSTABLE_File/UNSTABLE_File.cjs.map +1 -0
  153. package/dist/components/UNSTABLE_File/UNSTABLE_File.d.ts +8 -0
  154. package/dist/components/UNSTABLE_File/UNSTABLE_File.js +88 -0
  155. package/dist/components/UNSTABLE_File/UNSTABLE_File.js.map +1 -0
  156. package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.cjs +2 -0
  157. package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.cjs.map +1 -0
  158. package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.d.ts +8 -0
  159. package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.js +29 -0
  160. package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.js.map +1 -0
  161. package/dist/components/UNSTABLE_File/constants.cjs +2 -0
  162. package/dist/components/UNSTABLE_File/constants.cjs.map +1 -0
  163. package/dist/components/UNSTABLE_File/constants.d.ts +9 -0
  164. package/dist/components/UNSTABLE_File/constants.js +13 -0
  165. package/dist/components/UNSTABLE_File/constants.js.map +1 -0
  166. package/dist/components/UNSTABLE_File/index.cjs +2 -0
  167. package/dist/components/UNSTABLE_File/index.cjs.map +1 -0
  168. package/dist/components/UNSTABLE_File/index.d.ts +6 -0
  169. package/dist/components/UNSTABLE_File/index.js +16 -0
  170. package/dist/components/UNSTABLE_File/index.js.map +1 -0
  171. package/dist/components/UNSTABLE_File/types.d.ts +48 -0
  172. package/dist/components/UNSTABLE_File/useFileImageStyles.cjs +2 -0
  173. package/dist/components/UNSTABLE_File/useFileImageStyles.cjs.map +1 -0
  174. package/dist/components/UNSTABLE_File/useFileImageStyles.d.ts +19 -0
  175. package/dist/components/UNSTABLE_File/useFileImageStyles.js +21 -0
  176. package/dist/components/UNSTABLE_File/useFileImageStyles.js.map +1 -0
  177. package/dist/components/UNSTABLE_File/useFileStyleProps.cjs +2 -0
  178. package/dist/components/UNSTABLE_File/useFileStyleProps.cjs.map +1 -0
  179. package/dist/components/UNSTABLE_File/useFileStyleProps.d.ts +20 -0
  180. package/dist/components/UNSTABLE_File/useFileStyleProps.js +29 -0
  181. package/dist/components/UNSTABLE_File/useFileStyleProps.js.map +1 -0
  182. package/dist/components/UNSTABLE_File.d.ts +2 -0
  183. package/dist/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.cjs +1 -1
  184. package/dist/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.cjs.map +1 -1
  185. package/dist/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.js +129 -112
  186. package/dist/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.js.map +1 -1
  187. package/dist/components/UNSTABLE_FileUpload/types.d.ts +6 -3
  188. package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.cjs +1 -1
  189. package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.cjs.map +1 -1
  190. package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.d.ts +2 -3
  191. package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.js +18 -16
  192. package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.js.map +1 -1
  193. package/dist/components/UNSTABLE_Picker/PickerContext.cjs +2 -0
  194. package/dist/components/UNSTABLE_Picker/PickerContext.cjs.map +1 -0
  195. package/dist/components/UNSTABLE_Picker/PickerContext.d.ts +3 -0
  196. package/dist/components/UNSTABLE_Picker/PickerContext.js +9 -0
  197. package/dist/components/UNSTABLE_Picker/PickerContext.js.map +1 -0
  198. package/dist/components/UNSTABLE_Picker/PickerPopoverContext.cjs +2 -0
  199. package/dist/components/UNSTABLE_Picker/PickerPopoverContext.cjs.map +1 -0
  200. package/dist/components/UNSTABLE_Picker/PickerPopoverContext.d.ts +3 -0
  201. package/dist/components/UNSTABLE_Picker/PickerPopoverContext.js +16 -0
  202. package/dist/components/UNSTABLE_Picker/PickerPopoverContext.js.map +1 -0
  203. package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.cjs +2 -0
  204. package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.cjs.map +1 -0
  205. package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.d.ts +4 -0
  206. package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.js +204 -0
  207. package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.js.map +1 -0
  208. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.cjs +2 -0
  209. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.cjs.map +1 -0
  210. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.d.ts +7 -0
  211. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.js +14 -0
  212. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.js.map +1 -0
  213. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.cjs +2 -0
  214. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.cjs.map +1 -0
  215. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.d.ts +7 -0
  216. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.js +32 -0
  217. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.js.map +1 -0
  218. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.cjs +2 -0
  219. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.cjs.map +1 -0
  220. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.d.ts +7 -0
  221. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.js +64 -0
  222. package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.js.map +1 -0
  223. package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.cjs +2 -0
  224. package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.cjs.map +1 -0
  225. package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.d.ts +4 -0
  226. package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.js +40 -0
  227. package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.js.map +1 -0
  228. package/dist/components/UNSTABLE_Picker/constants.cjs +2 -0
  229. package/dist/components/UNSTABLE_Picker/constants.cjs.map +1 -0
  230. package/dist/components/UNSTABLE_Picker/constants.d.ts +6 -0
  231. package/dist/components/UNSTABLE_Picker/constants.js +11 -0
  232. package/dist/components/UNSTABLE_Picker/constants.js.map +1 -0
  233. package/dist/components/UNSTABLE_Picker/index.cjs +2 -0
  234. package/dist/components/UNSTABLE_Picker/index.cjs.map +1 -0
  235. package/dist/components/UNSTABLE_Picker/index.d.ts +11 -0
  236. package/dist/components/UNSTABLE_Picker/index.js +26 -0
  237. package/dist/components/UNSTABLE_Picker/index.js.map +1 -0
  238. package/dist/components/UNSTABLE_Picker/types.d.ts +91 -0
  239. package/dist/components/UNSTABLE_Picker/usePickerId.cjs +2 -0
  240. package/dist/components/UNSTABLE_Picker/usePickerId.cjs.map +1 -0
  241. package/dist/components/UNSTABLE_Picker/usePickerId.d.ts +8 -0
  242. package/dist/components/UNSTABLE_Picker/usePickerId.js +15 -0
  243. package/dist/components/UNSTABLE_Picker/usePickerId.js.map +1 -0
  244. package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.cjs +2 -0
  245. package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.cjs.map +1 -0
  246. package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.d.ts +11 -0
  247. package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.js +27 -0
  248. package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.js.map +1 -0
  249. package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.cjs +2 -0
  250. package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.cjs.map +1 -0
  251. package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.d.ts +13 -0
  252. package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.js +95 -0
  253. package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.js.map +1 -0
  254. package/dist/components/UNSTABLE_Picker/usePickerStyleProps.cjs +2 -0
  255. package/dist/components/UNSTABLE_Picker/usePickerStyleProps.cjs.map +1 -0
  256. package/dist/components/UNSTABLE_Picker/usePickerStyleProps.d.ts +21 -0
  257. package/dist/components/UNSTABLE_Picker/usePickerStyleProps.js +29 -0
  258. package/dist/components/UNSTABLE_Picker/usePickerStyleProps.js.map +1 -0
  259. package/dist/components/UNSTABLE_Picker/utils.cjs +2 -0
  260. package/dist/components/UNSTABLE_Picker/utils.cjs.map +1 -0
  261. package/dist/components/UNSTABLE_Picker/utils.d.ts +10 -0
  262. package/dist/components/UNSTABLE_Picker/utils.js +41 -0
  263. package/dist/components/UNSTABLE_Picker/utils.js.map +1 -0
  264. package/dist/components/UNSTABLE_Picker.d.ts +2 -0
  265. package/dist/components/index.cjs +1 -1
  266. package/dist/components/index.d.ts +4 -1
  267. package/dist/components/index.js +523 -498
  268. package/dist/components/index.js.map +1 -1
  269. package/dist/constants/index.cjs +1 -1
  270. package/dist/constants/index.d.ts +1 -0
  271. package/dist/constants/index.js +43 -40
  272. package/dist/constants/index.js.map +1 -1
  273. package/dist/constants/selection.cjs +2 -0
  274. package/dist/constants/selection.cjs.map +1 -0
  275. package/dist/constants/selection.d.ts +2 -0
  276. package/dist/constants/selection.js +6 -0
  277. package/dist/constants/selection.js.map +1 -0
  278. package/dist/context/RouterContext.cjs +2 -0
  279. package/dist/context/RouterContext.cjs.map +1 -0
  280. package/dist/context/RouterContext.d.ts +16 -0
  281. package/dist/context/RouterContext.js +12 -0
  282. package/dist/context/RouterContext.js.map +1 -0
  283. package/dist/context/index.cjs +1 -1
  284. package/dist/context/index.d.ts +1 -0
  285. package/dist/context/index.js +11 -7
  286. package/dist/context/index.js.map +1 -1
  287. package/dist/hooks/index.cjs +1 -1
  288. package/dist/hooks/index.d.ts +5 -1
  289. package/dist/hooks/index.js +54 -40
  290. package/dist/hooks/index.js.map +1 -1
  291. package/dist/hooks/useAriaIdRefs.cjs +2 -0
  292. package/dist/hooks/useAriaIdRefs.cjs.map +1 -0
  293. package/dist/hooks/useAriaIdRefs.d.ts +11 -0
  294. package/dist/hooks/useAriaIdRefs.js +23 -0
  295. package/dist/hooks/useAriaIdRefs.js.map +1 -0
  296. package/dist/hooks/useControlledModeGuard.cjs +2 -0
  297. package/dist/hooks/useControlledModeGuard.cjs.map +1 -0
  298. package/dist/hooks/useControlledModeGuard.d.ts +10 -0
  299. package/dist/hooks/useControlledModeGuard.js +33 -0
  300. package/dist/hooks/useControlledModeGuard.js.map +1 -0
  301. package/dist/hooks/useDebouncedValue.cjs +2 -0
  302. package/dist/hooks/useDebouncedValue.cjs.map +1 -0
  303. package/dist/hooks/useDebouncedValue.d.ts +1 -0
  304. package/dist/hooks/useDebouncedValue.js +17 -0
  305. package/dist/hooks/useDebouncedValue.js.map +1 -0
  306. package/dist/hooks/useLinkClick.cjs +2 -0
  307. package/dist/hooks/useLinkClick.cjs.map +1 -0
  308. package/dist/hooks/useLinkClick.d.ts +4 -0
  309. package/dist/hooks/useLinkClick.js +15 -0
  310. package/dist/hooks/useLinkClick.js.map +1 -0
  311. package/dist/hooks/useSelectionState.cjs +2 -0
  312. package/dist/hooks/useSelectionState.cjs.map +1 -0
  313. package/dist/hooks/useSelectionState.d.ts +17 -0
  314. package/dist/hooks/useSelectionState.js +41 -0
  315. package/dist/hooks/useSelectionState.js.map +1 -0
  316. package/dist/index.cjs +1 -1
  317. package/dist/index.js +722 -673
  318. package/dist/index.js.map +1 -1
  319. package/dist/translations/defaults.cjs +1 -1
  320. package/dist/translations/defaults.cjs.map +1 -1
  321. package/dist/translations/defaults.d.ts +17 -0
  322. package/dist/translations/defaults.js +17 -0
  323. package/dist/translations/defaults.js.map +1 -1
  324. package/dist/types/button.d.ts +3 -2
  325. package/dist/types/card.cjs.map +1 -1
  326. package/dist/types/card.d.ts +5 -7
  327. package/dist/types/card.js.map +1 -1
  328. package/dist/types/checkbox.d.ts +2 -2
  329. package/dist/types/controlButton.d.ts +2 -3
  330. package/dist/types/header.d.ts +3 -3
  331. package/dist/types/index.d.ts +1 -0
  332. package/dist/types/inputDetails.d.ts +9 -0
  333. package/dist/types/link.cjs.map +1 -1
  334. package/dist/types/link.d.ts +2 -2
  335. package/dist/types/link.js.map +1 -1
  336. package/dist/types/pagination.d.ts +4 -4
  337. package/dist/types/shared/index.cjs.map +1 -1
  338. package/dist/types/shared/index.d.ts +1 -0
  339. package/dist/types/shared/index.js.map +1 -1
  340. package/dist/types/shared/inputs.d.ts +3 -0
  341. package/dist/types/shared/router.d.ts +3 -0
  342. package/dist/types/tabs.d.ts +2 -2
  343. package/dist/types/tag.d.ts +1 -0
  344. package/dist/types/textArea.d.ts +26 -5
  345. package/dist/types/textFieldBase.d.ts +5 -2
  346. package/dist/types/toggle.d.ts +2 -2
  347. package/dist/utils/debounce.cjs +1 -1
  348. package/dist/utils/debounce.cjs.map +1 -1
  349. package/dist/utils/debounce.d.ts +4 -1
  350. package/dist/utils/debounce.js +11 -8
  351. package/dist/utils/debounce.js.map +1 -1
  352. package/dist/utils/index.cjs +1 -1
  353. package/dist/utils/index.d.ts +1 -0
  354. package/dist/utils/index.js +36 -33
  355. package/dist/utils/index.js.map +1 -1
  356. package/dist/utils/router.cjs +2 -0
  357. package/dist/utils/router.cjs.map +1 -0
  358. package/dist/utils/router.d.ts +12 -0
  359. package/dist/utils/router.js +10 -0
  360. package/dist/utils/router.js.map +1 -0
  361. package/dist/utils/string.cjs +1 -1
  362. package/dist/utils/string.cjs.map +1 -1
  363. package/dist/utils/string.d.ts +1 -0
  364. package/dist/utils/string.js +10 -9
  365. package/dist/utils/string.js.map +1 -1
  366. package/package.json +38 -23
  367. package/dist/components/Field/useAriaIds.cjs +0 -2
  368. package/dist/components/Field/useAriaIds.cjs.map +0 -1
  369. package/dist/components/Field/useAriaIds.d.ts +0 -8
  370. package/dist/components/Field/useAriaIds.js +0 -15
  371. package/dist/components/Field/useAriaIds.js.map +0 -1
  372. package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.cjs +0 -2
  373. package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.cjs.map +0 -1
  374. package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.d.ts +0 -8
  375. package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.js +0 -42
  376. package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.js.map +0 -1
  377. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.cjs +0 -2
  378. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.cjs.map +0 -1
  379. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.d.ts +0 -8
  380. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.js +0 -30
  381. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.js.map +0 -1
  382. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.cjs +0 -2
  383. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.cjs.map +0 -1
  384. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.d.ts +0 -8
  385. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.js +0 -29
  386. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.js.map +0 -1
  387. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.cjs +0 -2
  388. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.cjs.map +0 -1
  389. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.d.ts +0 -8
  390. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.js +0 -29
  391. package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.js.map +0 -1
  392. package/dist/components/UNSTABLE_Attachment/constants.cjs +0 -2
  393. package/dist/components/UNSTABLE_Attachment/constants.cjs.map +0 -1
  394. package/dist/components/UNSTABLE_Attachment/constants.d.ts +0 -9
  395. package/dist/components/UNSTABLE_Attachment/constants.js +0 -13
  396. package/dist/components/UNSTABLE_Attachment/constants.js.map +0 -1
  397. package/dist/components/UNSTABLE_Attachment/index.cjs +0 -2
  398. package/dist/components/UNSTABLE_Attachment/index.d.ts +0 -8
  399. package/dist/components/UNSTABLE_Attachment/index.js +0 -20
  400. package/dist/components/UNSTABLE_Attachment/types.d.ts +0 -42
  401. package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.cjs +0 -2
  402. package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.cjs.map +0 -1
  403. package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.d.ts +0 -18
  404. package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.js +0 -22
  405. package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.js.map +0 -1
  406. package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.cjs +0 -2
  407. package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.cjs.map +0 -1
  408. package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.d.ts +0 -21
  409. package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.js +0 -24
  410. package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.js.map +0 -1
  411. package/dist/components/UNSTABLE_Attachment.d.ts +0 -2
  412. package/dist/hooks/useAriaDescribedBy.cjs +0 -2
  413. package/dist/hooks/useAriaDescribedBy.cjs.map +0 -1
  414. package/dist/hooks/useAriaDescribedBy.d.ts +0 -5
  415. package/dist/hooks/useAriaDescribedBy.js +0 -7
  416. package/dist/hooks/useAriaDescribedBy.js.map +0 -1
  417. /package/dist/components/{UNSTABLE_Attachment → CharacterCounter}/index.cjs.map +0 -0
@@ -1,20 +1,19 @@
1
1
  "use client";
2
- import { jsxs as R, jsx as o } from "react/jsx-runtime";
3
- import U from "classnames";
4
- import { forwardRef as $ } from "react";
5
- import { useStyleProps as B } from "../../hooks/styleProps.js";
6
- import { useAriaDescribedBy as L } from "../../hooks/useAriaDescribedBy.js";
7
- import j from "../Field/HelperText.js";
8
- import C from "../Field/Label.js";
9
- import w from "../Field/useAriaIds.js";
10
- import H from "../Field/ValidationText.js";
11
- import { useValidationTextRole as M } from "../Field/useValidationTextRole.js";
12
- import { SLIDER_DEFAULT_PROPS as O } from "./constants.js";
13
- import { useSliderStyleProps as W } from "./useSliderStyleProps.js";
14
- const k = {
15
- ...O
16
- }, q = (x, P) => {
17
- const b = { ...k, ...x }, {
2
+ import { jsxs as I, jsx as o } from "react/jsx-runtime";
3
+ import R from "classnames";
4
+ import { forwardRef as U } from "react";
5
+ import { useStyleProps as $ } from "../../hooks/styleProps.js";
6
+ import { useAriaDescribedBy as B } from "../../hooks/useAriaIdRefs.js";
7
+ import L from "../Field/HelperText.js";
8
+ import j from "../Field/Label.js";
9
+ import C from "../Field/ValidationText.js";
10
+ import { useValidationTextRole as w } from "../Field/useValidationTextRole.js";
11
+ import { SLIDER_DEFAULT_PROPS as H } from "./constants.js";
12
+ import { useSliderStyleProps as M } from "./useSliderStyleProps.js";
13
+ const O = {
14
+ ...H
15
+ }, W = (x, P) => {
16
+ const b = { ...O, ...x }, {
18
17
  "aria-describedby": h,
19
18
  hasValidationIcon: y,
20
19
  helperText: N,
@@ -28,23 +27,23 @@ const k = {
28
27
  validationText: n,
29
28
  value: p,
30
29
  ...v
31
- } = b, { classProps: e, props: A } = W({
30
+ } = b, { classProps: e, props: A } = M({
32
31
  ...v,
33
32
  isDisabled: a,
34
33
  validationState: r
35
- }), { styleProps: d, props: D } = B(A), [g, m] = w(h), I = L(g), V = M({
34
+ }), { styleProps: d, props: D } = $(A), [g, m] = B(h), V = w({
36
35
  validationState: r,
37
36
  validationText: n
38
37
  }), c = "--slider-position", u = (i) => `${Math.round(100 * (i - s) / (l - s))}%`, E = (i) => {
39
38
  const { target: f } = i, { value: F } = f;
40
39
  f.style.setProperty(c, u(Number(F)));
41
40
  };
42
- return /* @__PURE__ */ R("div", { ...d, ...D, className: U(e.root, d.className), children: [
43
- /* @__PURE__ */ o(C, { htmlFor: t, UNSAFE_className: e.label, children: T }),
41
+ return /* @__PURE__ */ I("div", { ...d, ...D, className: R(e.root, d.className), children: [
42
+ /* @__PURE__ */ o(j, { htmlFor: t, UNSAFE_className: e.label, children: T }),
44
43
  /* @__PURE__ */ o(
45
44
  "input",
46
45
  {
47
- ...I,
46
+ ...g,
48
47
  className: e.input,
49
48
  id: t,
50
49
  onInput: E,
@@ -59,7 +58,7 @@ const k = {
59
58
  }
60
59
  ),
61
60
  /* @__PURE__ */ o(
62
- j,
61
+ L,
63
62
  {
64
63
  UNSAFE_className: e.helperText,
65
64
  helperText: N,
@@ -68,7 +67,7 @@ const k = {
68
67
  }
69
68
  ),
70
69
  r && /* @__PURE__ */ o(
71
- H,
70
+ C,
72
71
  {
73
72
  UNSAFE_className: e.validationText,
74
73
  ...y && { hasValidationStateIcon: r },
@@ -79,7 +78,7 @@ const k = {
79
78
  }
80
79
  )
81
80
  ] });
82
- }, S = $(q);
81
+ }, S = U(W);
83
82
  S.spiritComponent = "Slider";
84
83
  S.displayName = "Slider";
85
84
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type CSSProperties, type ChangeEvent, type FormEvent, type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritSliderProps } from '../../types';\nimport { HelperText, Label, ValidationText, useAriaIds } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { SLIDER_DEFAULT_PROPS } from './constants';\nimport { useSliderStyleProps } from './useSliderStyleProps';\n\nconst defaultProps = {\n ...SLIDER_DEFAULT_PROPS,\n};\n\nconst _Slider = (props: SpiritSliderProps, ref: ForwardedRef<HTMLInputElement>) => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const {\n 'aria-describedby': ariaDescribedBy,\n hasValidationIcon,\n helperText,\n id,\n isDisabled,\n label,\n max,\n min,\n step,\n validationState,\n validationText,\n value,\n ...restProps\n } = propsWithDefaults;\n\n const { classProps, props: modifiedProps } = useSliderStyleProps({\n ...restProps,\n isDisabled,\n validationState,\n });\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const [ids, register] = useAriaIds(ariaDescribedBy);\n const ariaDescribedByProp = useAriaDescribedBy(ids);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n const CSSVariable = '--slider-position';\n\n const getSliderPosition = (num: number) => `${Math.round((100 * (num - min)) / (max - min))}%`;\n\n const handleInput = (event: FormEvent<HTMLInputElement>) => {\n const { target } = event as ChangeEvent<HTMLInputElement>;\n const { value: inputValue } = target;\n\n target.style.setProperty(CSSVariable, getSliderPosition(Number(inputValue)));\n };\n\n return (\n <div {...styleProps} {...otherProps} className={classNames(classProps.root, styleProps.className)}>\n <Label htmlFor={id} UNSAFE_className={classProps.label}>\n {label}\n </Label>\n <input\n {...ariaDescribedByProp}\n className={classProps.input}\n id={id}\n onInput={handleInput}\n style={{ [CSSVariable]: `${getSliderPosition(value)}` } as CSSProperties}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={value}\n disabled={isDisabled}\n ref={ref}\n />\n <HelperText\n UNSAFE_className={classProps.helperText}\n helperText={helperText}\n id={`${id}__helperText`}\n registerAria={register}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__validationText`}\n registerAria={register}\n validationText={validationText}\n role={validationTextRole}\n />\n )}\n </div>\n );\n};\n\nconst Slider = forwardRef<HTMLInputElement, SpiritSliderProps>(_Slider) as ForwardRefComponent<\n HTMLInputElement,\n SpiritSliderProps\n>;\n\nSlider.spiritComponent = 'Slider';\nSlider.displayName = 'Slider';\n\nexport default Slider;\n"],"names":["defaultProps","SLIDER_DEFAULT_PROPS","_Slider","props","ref","propsWithDefaults","ariaDescribedBy","hasValidationIcon","helperText","id","isDisabled","label","max","min","step","validationState","validationText","value","restProps","classProps","modifiedProps","useSliderStyleProps","styleProps","otherProps","useStyleProps","ids","register","useAriaIds","ariaDescribedByProp","useAriaDescribedBy","validationTextRole","useValidationTextRole","CSSVariable","getSliderPosition","num","handleInput","event","target","inputValue","jsxs","classNames","jsx","Label","HelperText","ValidationText","Slider","forwardRef"],"mappings":";;;;;;;;;;;;;AAWA,MAAMA,IAAe;AAAA,EACnB,GAAGC;AACL,GAEMC,IAAU,CAACC,GAA0BC,MAAwC;AACjF,QAAMC,IAAoB,EAAE,GAAGL,GAAc,GAAGG,EAAA,GAC1C;AAAA,IACJ,oBAAoBG;AAAA,IACpB,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,KAAAC;AAAA,IACA,KAAAC;AAAA,IACA,MAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDb,GAEE,EAAE,YAAAc,GAAY,OAAOC,EAAA,IAAkBC,EAAoB;AAAA,IAC/D,GAAGH;AAAA,IACH,YAAAR;AAAA,IACA,iBAAAK;AAAA,EAAA,CACD,GACK,EAAE,YAAAO,GAAY,OAAOC,EAAA,IAAeC,EAAcJ,CAAa,GAC/D,CAACK,GAAKC,CAAQ,IAAIC,EAAWrB,CAAe,GAC5CsB,IAAsBC,EAAmBJ,CAAG,GAC5CK,IAAqBC,EAAsB;AAAA,IAC/C,iBAAAhB;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD,GAEKgB,IAAc,qBAEdC,IAAoB,CAACC,MAAgB,GAAG,KAAK,MAAO,OAAOA,IAAMrB,MAASD,IAAMC,EAAI,CAAC,KAErFsB,IAAc,CAACC,MAAuC;AAC1D,UAAM,EAAE,QAAAC,MAAWD,GACb,EAAE,OAAOE,EAAA,IAAeD;AAE9B,IAAAA,EAAO,MAAM,YAAYL,GAAaC,EAAkB,OAAOK,CAAU,CAAC,CAAC;AAAA,EAC7E;AAEA,SACE,gBAAAC,EAAC,OAAA,EAAK,GAAGjB,GAAa,GAAGC,GAAY,WAAWiB,EAAWrB,EAAW,MAAMG,EAAW,SAAS,GAC9F,UAAA;AAAA,IAAA,gBAAAmB,EAACC,KAAM,SAASjC,GAAI,kBAAkBU,EAAW,OAC9C,UAAAR,GACH;AAAA,IACA,gBAAA8B;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGb;AAAA,QACJ,WAAWT,EAAW;AAAA,QACtB,IAAAV;AAAA,QACA,SAAS0B;AAAA,QACT,OAAO,EAAE,CAACH,CAAW,GAAG,GAAGC,EAAkBhB,CAAK,CAAC,GAAA;AAAA,QACnD,MAAK;AAAA,QACL,KAAAJ;AAAA,QACA,KAAAD;AAAA,QACA,MAAAE;AAAA,QACA,OAAAG;AAAA,QACA,UAAUP;AAAA,QACV,KAAAN;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAAqC;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,kBAAkBxB,EAAW;AAAA,QAC7B,YAAAX;AAAA,QACA,IAAI,GAAGC,CAAE;AAAA,QACT,cAAciB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEfX,KACC,gBAAA0B;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,kBAAkBzB,EAAW;AAAA,QAC5B,GAAIZ,KAAqB,EAAE,wBAAwBQ,EAAA;AAAA,QACpD,IAAI,GAAGN,CAAE;AAAA,QACT,cAAciB;AAAA,QACd,gBAAAV;AAAA,QACA,MAAMc;AAAA,MAAA;AAAA,IAAA;AAAA,EACR,GAEJ;AAEJ,GAEMe,IAASC,EAAgD5C,CAAO;AAKtE2C,EAAO,kBAAkB;AACzBA,EAAO,cAAc;"}
1
+ {"version":3,"file":"Slider.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type CSSProperties, type ChangeEvent, type FormEvent, type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritSliderProps } from '../../types';\nimport { HelperText, Label, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { SLIDER_DEFAULT_PROPS } from './constants';\nimport { useSliderStyleProps } from './useSliderStyleProps';\n\nconst defaultProps = {\n ...SLIDER_DEFAULT_PROPS,\n};\n\nconst _Slider = (props: SpiritSliderProps, ref: ForwardedRef<HTMLInputElement>) => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const {\n 'aria-describedby': ariaDescribedBy,\n hasValidationIcon,\n helperText,\n id,\n isDisabled,\n label,\n max,\n min,\n step,\n validationState,\n validationText,\n value,\n ...restProps\n } = propsWithDefaults;\n\n const { classProps, props: modifiedProps } = useSliderStyleProps({\n ...restProps,\n isDisabled,\n validationState,\n });\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n const CSSVariable = '--slider-position';\n\n const getSliderPosition = (num: number) => `${Math.round((100 * (num - min)) / (max - min))}%`;\n\n const handleInput = (event: FormEvent<HTMLInputElement>) => {\n const { target } = event as ChangeEvent<HTMLInputElement>;\n const { value: inputValue } = target;\n\n target.style.setProperty(CSSVariable, getSliderPosition(Number(inputValue)));\n };\n\n return (\n <div {...styleProps} {...otherProps} className={classNames(classProps.root, styleProps.className)}>\n <Label htmlFor={id} UNSAFE_className={classProps.label}>\n {label}\n </Label>\n <input\n {...ariaDescribedByProp}\n className={classProps.input}\n id={id}\n onInput={handleInput}\n style={{ [CSSVariable]: `${getSliderPosition(value)}` } as CSSProperties}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={value}\n disabled={isDisabled}\n ref={ref}\n />\n <HelperText\n UNSAFE_className={classProps.helperText}\n helperText={helperText}\n id={`${id}__helperText`}\n registerAria={register}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__validationText`}\n registerAria={register}\n validationText={validationText}\n role={validationTextRole}\n />\n )}\n </div>\n );\n};\n\nconst Slider = forwardRef<HTMLInputElement, SpiritSliderProps>(_Slider) as ForwardRefComponent<\n HTMLInputElement,\n SpiritSliderProps\n>;\n\nSlider.spiritComponent = 'Slider';\nSlider.displayName = 'Slider';\n\nexport default Slider;\n"],"names":["defaultProps","SLIDER_DEFAULT_PROPS","_Slider","props","ref","propsWithDefaults","ariaDescribedBy","hasValidationIcon","helperText","id","isDisabled","label","max","min","step","validationState","validationText","value","restProps","classProps","modifiedProps","useSliderStyleProps","styleProps","otherProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","validationTextRole","useValidationTextRole","CSSVariable","getSliderPosition","num","handleInput","event","target","inputValue","jsxs","classNames","jsx","Label","HelperText","ValidationText","Slider","forwardRef"],"mappings":";;;;;;;;;;;;AAWA,MAAMA,IAAe;AAAA,EACnB,GAAGC;AACL,GAEMC,IAAU,CAACC,GAA0BC,MAAwC;AACjF,QAAMC,IAAoB,EAAE,GAAGL,GAAc,GAAGG,EAAA,GAC1C;AAAA,IACJ,oBAAoBG;AAAA,IACpB,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,KAAAC;AAAA,IACA,KAAAC;AAAA,IACA,MAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDb,GAEE,EAAE,YAAAc,GAAY,OAAOC,EAAA,IAAkBC,EAAoB;AAAA,IAC/D,GAAGH;AAAA,IACH,YAAAR;AAAA,IACA,iBAAAK;AAAA,EAAA,CACD,GACK,EAAE,YAAAO,GAAY,OAAOC,EAAA,IAAeC,EAAcJ,CAAa,GAC/D,CAACK,GAAqBC,CAAQ,IAAIC,EAAmBrB,CAAe,GACpEsB,IAAqBC,EAAsB;AAAA,IAC/C,iBAAAd;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD,GAEKc,IAAc,qBAEdC,IAAoB,CAACC,MAAgB,GAAG,KAAK,MAAO,OAAOA,IAAMnB,MAASD,IAAMC,EAAI,CAAC,KAErFoB,IAAc,CAACC,MAAuC;AAC1D,UAAM,EAAE,QAAAC,MAAWD,GACb,EAAE,OAAOE,EAAA,IAAeD;AAE9B,IAAAA,EAAO,MAAM,YAAYL,GAAaC,EAAkB,OAAOK,CAAU,CAAC,CAAC;AAAA,EAC7E;AAEA,SACE,gBAAAC,EAAC,OAAA,EAAK,GAAGf,GAAa,GAAGC,GAAY,WAAWe,EAAWnB,EAAW,MAAMG,EAAW,SAAS,GAC9F,UAAA;AAAA,IAAA,gBAAAiB,EAACC,KAAM,SAAS/B,GAAI,kBAAkBU,EAAW,OAC9C,UAAAR,GACH;AAAA,IACA,gBAAA4B;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGd;AAAA,QACJ,WAAWN,EAAW;AAAA,QACtB,IAAAV;AAAA,QACA,SAASwB;AAAA,QACT,OAAO,EAAE,CAACH,CAAW,GAAG,GAAGC,EAAkBd,CAAK,CAAC,GAAA;AAAA,QACnD,MAAK;AAAA,QACL,KAAAJ;AAAA,QACA,KAAAD;AAAA,QACA,MAAAE;AAAA,QACA,OAAAG;AAAA,QACA,UAAUP;AAAA,QACV,KAAAN;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAAmC;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,kBAAkBtB,EAAW;AAAA,QAC7B,YAAAX;AAAA,QACA,IAAI,GAAGC,CAAE;AAAA,QACT,cAAciB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEfX,KACC,gBAAAwB;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,kBAAkBvB,EAAW;AAAA,QAC5B,GAAIZ,KAAqB,EAAE,wBAAwBQ,EAAA;AAAA,QACpD,IAAI,GAAGN,CAAE;AAAA,QACT,cAAciB;AAAA,QACd,gBAAAV;AAAA,QACA,MAAMY;AAAA,MAAA;AAAA,IAAA;AAAA,EACR,GAEJ;AAEJ,GAEMe,IAASC,EAAgD1C,CAAO;AAKtEyC,EAAO,kBAAkB;AACzBA,EAAO,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),y=require("classnames"),d=require("react"),S=require("../../hooks/styleProps.cjs"),T=require("../../utils/mergeStyleProps.cjs"),b=require("./useTabsStyleProps.cjs"),f={itemProps:{}},q=(n,i)=>{const l={...f,...n},{elementType:a="a",children:c,itemProps:p={},...u}=l,s=a,{classProps:t}=b.useTabsStyleProps(),{styleProps:r,props:m}=S.useStyleProps(p),P=T.mergeStyleProps(s,{classProps:t.link});return o.jsx("li",{...r,...m,className:y(t.item,r.className),role:"presentation",children:o.jsx(s,{...u,...P,ref:i,children:c})})},e=d.forwardRef(q);e.spiritComponent="TabLink";e.displayName="TabLink";exports.default=e;
1
+ "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),S=require("classnames"),T=require("react"),b=require("../../hooks/styleProps.cjs"),f=require("../../hooks/useLinkClick.cjs"),q=require("../../utils/mergeStyleProps.cjs"),C=require("./useTabsStyleProps.cjs"),L={itemProps:{}},g=(i,l)=>{const c={...L,...i},{elementType:a="a",children:p,itemProps:u={},routerOptions:m,...e}=c,{href:P}=e,t=a,{classProps:r}=C.useTabsStyleProps(),{styleProps:o,props:y}=b.useStyleProps(u),d=q.mergeStyleProps(t,{classProps:r.link}),k=f.useLinkClick({...e,routerOptions:m});return n.jsx("li",{...o,...y,className:S(r.item,o.className),role:"presentation",children:n.jsx(t,{...e,...d,href:P,onClick:k,ref:l,children:p})})},s=T.forwardRef(g);s.spiritComponent="TabLink";s.displayName="TabLink";exports.default=s;
2
2
  //# sourceMappingURL=TabLink.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabLink.cjs","sources":["../../../src/components/Tabs/TabLink.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useStyleProps } from '../../hooks';\nimport {\n type PolymorphicComponent,\n type PolymorphicRef,\n type SpiritTabLinkProps,\n type TabLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useTabsStyleProps } from './useTabsStyleProps';\n\nconst defaultProps: TabLinkProps = {\n itemProps: {},\n};\n\nconst _TabLink = <E extends ElementType = 'a'>(props: SpiritTabLinkProps<E>, ref: PolymorphicRef<E>): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = 'a', children, itemProps = {}, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { classProps } = useTabsStyleProps();\n const { styleProps: itemStyleProps, props: itemTransferProps } = useStyleProps(itemProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link });\n\n return (\n <li\n {...itemStyleProps}\n {...itemTransferProps}\n className={classNames(classProps.item, itemStyleProps.className)}\n role=\"presentation\"\n >\n <Component {...restProps} {...mergedStyleProps} ref={ref}>\n {children}\n </Component>\n </li>\n );\n};\n\nconst TabLink = forwardRef<HTMLAnchorElement, SpiritTabLinkProps<'a'>>(_TabLink) as unknown as PolymorphicComponent<\n 'a',\n TabLinkProps\n>;\n\nTabLink.spiritComponent = 'TabLink';\nTabLink.displayName = 'TabLink';\n\nexport default TabLink;\n"],"names":["defaultProps","_TabLink","props","ref","propsWithDefaults","elementType","children","itemProps","restProps","Component","classProps","useTabsStyleProps","itemStyleProps","itemTransferProps","useStyleProps","mergedStyleProps","mergeStyleProps","jsx","classNames","TabLink","forwardRef"],"mappings":"mUAcMA,EAA6B,CACjC,UAAW,CAAA,CACb,EAEMC,EAAW,CAA8BC,EAA8BC,IAAwC,CACnH,MAAMC,EAAoB,CAAE,GAAGJ,EAAc,GAAGE,CAAA,EAC1C,CAAE,YAAAG,EAAc,IAAK,SAAAC,EAAU,UAAAC,EAAY,GAAI,GAAGC,CAAA,EAAcJ,EAEhEK,EAAYJ,EAEZ,CAAE,WAAAK,CAAA,EAAeC,oBAAA,EACjB,CAAE,WAAYC,EAAgB,MAAOC,CAAA,EAAsBC,EAAAA,cAAcP,CAAS,EAClFQ,EAAmBC,EAAAA,gBAAgBP,EAAW,CAAE,WAAYC,EAAW,KAAM,EAEnF,OACEO,EAAAA,IAAC,KAAA,CACE,GAAGL,EACH,GAAGC,EACJ,UAAWK,EAAWR,EAAW,KAAME,EAAe,SAAS,EAC/D,KAAK,eAEL,eAACH,EAAA,CAAW,GAAGD,EAAY,GAAGO,EAAkB,IAAAZ,EAC7C,SAAAG,CAAA,CACH,CAAA,CAAA,CAGN,EAEMa,EAAUC,EAAAA,WAAuDnB,CAAQ,EAK/EkB,EAAQ,gBAAkB,UAC1BA,EAAQ,YAAc"}
1
+ {"version":3,"file":"TabLink.cjs","sources":["../../../src/components/Tabs/TabLink.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useLinkClick, useStyleProps } from '../../hooks';\nimport {\n type PolymorphicComponent,\n type PolymorphicRef,\n type SpiritTabLinkProps,\n type TabLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useTabsStyleProps } from './useTabsStyleProps';\n\nconst defaultProps: TabLinkProps = {\n itemProps: {},\n};\n\nconst _TabLink = <E extends ElementType = 'a'>(props: SpiritTabLinkProps<E>, ref: PolymorphicRef<E>): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = 'a', children, itemProps = {}, routerOptions, ...restProps } = propsWithDefaults;\n const { href } = restProps;\n\n const Component = elementType as ElementType;\n\n const { classProps } = useTabsStyleProps();\n const { styleProps: itemStyleProps, props: itemTransferProps } = useStyleProps(itemProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link });\n\n const handleClick = useLinkClick({ ...restProps, routerOptions });\n\n return (\n <li\n {...itemStyleProps}\n {...itemTransferProps}\n className={classNames(classProps.item, itemStyleProps.className)}\n role=\"presentation\"\n >\n <Component {...restProps} {...mergedStyleProps} href={href} onClick={handleClick} ref={ref}>\n {children}\n </Component>\n </li>\n );\n};\n\nconst TabLink = forwardRef<HTMLAnchorElement, SpiritTabLinkProps<'a'>>(_TabLink) as unknown as PolymorphicComponent<\n 'a',\n TabLinkProps\n>;\n\nTabLink.spiritComponent = 'TabLink';\nTabLink.displayName = 'TabLink';\n\nexport default TabLink;\n"],"names":["defaultProps","_TabLink","props","ref","propsWithDefaults","elementType","children","itemProps","routerOptions","restProps","href","Component","classProps","useTabsStyleProps","itemStyleProps","itemTransferProps","useStyleProps","mergedStyleProps","mergeStyleProps","handleClick","useLinkClick","jsx","classNames","TabLink","forwardRef"],"mappings":"6WAcMA,EAA6B,CACjC,UAAW,CAAA,CACb,EAEMC,EAAW,CAA8BC,EAA8BC,IAAwC,CACnH,MAAMC,EAAoB,CAAE,GAAGJ,EAAc,GAAGE,CAAA,EAC1C,CAAE,YAAAG,EAAc,IAAK,SAAAC,EAAU,UAAAC,EAAY,CAAA,EAAI,cAAAC,EAAe,GAAGC,CAAA,EAAcL,EAC/E,CAAE,KAAAM,GAASD,EAEXE,EAAYN,EAEZ,CAAE,WAAAO,CAAA,EAAeC,oBAAA,EACjB,CAAE,WAAYC,EAAgB,MAAOC,CAAA,EAAsBC,EAAAA,cAAcT,CAAS,EAClFU,EAAmBC,EAAAA,gBAAgBP,EAAW,CAAE,WAAYC,EAAW,KAAM,EAE7EO,EAAcC,EAAAA,aAAa,CAAE,GAAGX,EAAW,cAAAD,EAAe,EAEhE,OACEa,EAAAA,IAAC,KAAA,CACE,GAAGP,EACH,GAAGC,EACJ,UAAWO,EAAWV,EAAW,KAAME,EAAe,SAAS,EAC/D,KAAK,eAEL,SAAAO,EAAAA,IAACV,EAAA,CAAW,GAAGF,EAAY,GAAGQ,EAAkB,KAAAP,EAAY,QAASS,EAAa,IAAAhB,EAC/E,SAAAG,CAAA,CACH,CAAA,CAAA,CAGN,EAEMiB,EAAUC,EAAAA,WAAuDvB,CAAQ,EAK/EsB,EAAQ,gBAAkB,UAC1BA,EAAQ,YAAc"}
@@ -1,28 +1,29 @@
1
1
  "use client";
2
- import { jsx as r } from "react/jsx-runtime";
3
- import u from "classnames";
4
- import { forwardRef as y } from "react";
5
- import { useStyleProps as d } from "../../hooks/styleProps.js";
6
- import { mergeStyleProps as T } from "../../utils/mergeStyleProps.js";
7
- import { useTabsStyleProps as b } from "./useTabsStyleProps.js";
8
- const k = {
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ import y from "classnames";
4
+ import { forwardRef as T } from "react";
5
+ import { useStyleProps as b } from "../../hooks/styleProps.js";
6
+ import { useLinkClick as h } from "../../hooks/useLinkClick.js";
7
+ import { mergeStyleProps as C } from "../../utils/mergeStyleProps.js";
8
+ import { useTabsStyleProps as L } from "./useTabsStyleProps.js";
9
+ const S = {
9
10
  itemProps: {}
10
- }, S = (p, i) => {
11
- const m = { ...k, ...p }, { elementType: n = "a", children: a, itemProps: l = {}, ...c } = m, s = n, { classProps: o } = b(), { styleProps: e, props: P } = d(l), f = T(s, { classProps: o.link });
12
- return /* @__PURE__ */ r(
11
+ }, N = (n, p) => {
12
+ const m = { ...S, ...n }, { elementType: l = "a", children: a, itemProps: c = {}, routerOptions: f, ...s } = m, { href: P } = s, o = l, { classProps: r } = L(), { styleProps: e, props: u } = b(c), k = C(o, { classProps: r.link }), d = h({ ...s, routerOptions: f });
13
+ return /* @__PURE__ */ t(
13
14
  "li",
14
15
  {
15
16
  ...e,
16
- ...P,
17
- className: u(o.item, e.className),
17
+ ...u,
18
+ className: y(r.item, e.className),
18
19
  role: "presentation",
19
- children: /* @__PURE__ */ r(s, { ...c, ...f, ref: i, children: a })
20
+ children: /* @__PURE__ */ t(o, { ...s, ...k, href: P, onClick: d, ref: p, children: a })
20
21
  }
21
22
  );
22
- }, t = y(S);
23
- t.spiritComponent = "TabLink";
24
- t.displayName = "TabLink";
23
+ }, i = T(N);
24
+ i.spiritComponent = "TabLink";
25
+ i.displayName = "TabLink";
25
26
  export {
26
- t as default
27
+ i as default
27
28
  };
28
29
  //# sourceMappingURL=TabLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabLink.js","sources":["../../../src/components/Tabs/TabLink.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useStyleProps } from '../../hooks';\nimport {\n type PolymorphicComponent,\n type PolymorphicRef,\n type SpiritTabLinkProps,\n type TabLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useTabsStyleProps } from './useTabsStyleProps';\n\nconst defaultProps: TabLinkProps = {\n itemProps: {},\n};\n\nconst _TabLink = <E extends ElementType = 'a'>(props: SpiritTabLinkProps<E>, ref: PolymorphicRef<E>): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = 'a', children, itemProps = {}, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { classProps } = useTabsStyleProps();\n const { styleProps: itemStyleProps, props: itemTransferProps } = useStyleProps(itemProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link });\n\n return (\n <li\n {...itemStyleProps}\n {...itemTransferProps}\n className={classNames(classProps.item, itemStyleProps.className)}\n role=\"presentation\"\n >\n <Component {...restProps} {...mergedStyleProps} ref={ref}>\n {children}\n </Component>\n </li>\n );\n};\n\nconst TabLink = forwardRef<HTMLAnchorElement, SpiritTabLinkProps<'a'>>(_TabLink) as unknown as PolymorphicComponent<\n 'a',\n TabLinkProps\n>;\n\nTabLink.spiritComponent = 'TabLink';\nTabLink.displayName = 'TabLink';\n\nexport default TabLink;\n"],"names":["defaultProps","_TabLink","props","ref","propsWithDefaults","elementType","children","itemProps","restProps","Component","classProps","useTabsStyleProps","itemStyleProps","itemTransferProps","useStyleProps","mergedStyleProps","mergeStyleProps","jsx","classNames","TabLink","forwardRef"],"mappings":";;;;;;;AAcA,MAAMA,IAA6B;AAAA,EACjC,WAAW,CAAA;AACb,GAEMC,IAAW,CAA8BC,GAA8BC,MAAwC;AACnH,QAAMC,IAAoB,EAAE,GAAGJ,GAAc,GAAGE,EAAA,GAC1C,EAAE,aAAAG,IAAc,KAAK,UAAAC,GAAU,WAAAC,IAAY,IAAI,GAAGC,EAAA,IAAcJ,GAEhEK,IAAYJ,GAEZ,EAAE,YAAAK,EAAA,IAAeC,EAAA,GACjB,EAAE,YAAYC,GAAgB,OAAOC,EAAA,IAAsBC,EAAcP,CAAS,GAClFQ,IAAmBC,EAAgBP,GAAW,EAAE,YAAYC,EAAW,MAAM;AAEnF,SACE,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGL;AAAA,MACH,GAAGC;AAAA,MACJ,WAAWK,EAAWR,EAAW,MAAME,EAAe,SAAS;AAAA,MAC/D,MAAK;AAAA,MAEL,4BAACH,GAAA,EAAW,GAAGD,GAAY,GAAGO,GAAkB,KAAAZ,GAC7C,UAAAG,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN,GAEMa,IAAUC,EAAuDnB,CAAQ;AAK/EkB,EAAQ,kBAAkB;AAC1BA,EAAQ,cAAc;"}
1
+ {"version":3,"file":"TabLink.js","sources":["../../../src/components/Tabs/TabLink.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useLinkClick, useStyleProps } from '../../hooks';\nimport {\n type PolymorphicComponent,\n type PolymorphicRef,\n type SpiritTabLinkProps,\n type TabLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useTabsStyleProps } from './useTabsStyleProps';\n\nconst defaultProps: TabLinkProps = {\n itemProps: {},\n};\n\nconst _TabLink = <E extends ElementType = 'a'>(props: SpiritTabLinkProps<E>, ref: PolymorphicRef<E>): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = 'a', children, itemProps = {}, routerOptions, ...restProps } = propsWithDefaults;\n const { href } = restProps;\n\n const Component = elementType as ElementType;\n\n const { classProps } = useTabsStyleProps();\n const { styleProps: itemStyleProps, props: itemTransferProps } = useStyleProps(itemProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link });\n\n const handleClick = useLinkClick({ ...restProps, routerOptions });\n\n return (\n <li\n {...itemStyleProps}\n {...itemTransferProps}\n className={classNames(classProps.item, itemStyleProps.className)}\n role=\"presentation\"\n >\n <Component {...restProps} {...mergedStyleProps} href={href} onClick={handleClick} ref={ref}>\n {children}\n </Component>\n </li>\n );\n};\n\nconst TabLink = forwardRef<HTMLAnchorElement, SpiritTabLinkProps<'a'>>(_TabLink) as unknown as PolymorphicComponent<\n 'a',\n TabLinkProps\n>;\n\nTabLink.spiritComponent = 'TabLink';\nTabLink.displayName = 'TabLink';\n\nexport default TabLink;\n"],"names":["defaultProps","_TabLink","props","ref","propsWithDefaults","elementType","children","itemProps","routerOptions","restProps","href","Component","classProps","useTabsStyleProps","itemStyleProps","itemTransferProps","useStyleProps","mergedStyleProps","mergeStyleProps","handleClick","useLinkClick","jsx","classNames","TabLink","forwardRef"],"mappings":";;;;;;;;AAcA,MAAMA,IAA6B;AAAA,EACjC,WAAW,CAAA;AACb,GAEMC,IAAW,CAA8BC,GAA8BC,MAAwC;AACnH,QAAMC,IAAoB,EAAE,GAAGJ,GAAc,GAAGE,EAAA,GAC1C,EAAE,aAAAG,IAAc,KAAK,UAAAC,GAAU,WAAAC,IAAY,CAAA,GAAI,eAAAC,GAAe,GAAGC,EAAA,IAAcL,GAC/E,EAAE,MAAAM,MAASD,GAEXE,IAAYN,GAEZ,EAAE,YAAAO,EAAA,IAAeC,EAAA,GACjB,EAAE,YAAYC,GAAgB,OAAOC,EAAA,IAAsBC,EAAcT,CAAS,GAClFU,IAAmBC,EAAgBP,GAAW,EAAE,YAAYC,EAAW,MAAM,GAE7EO,IAAcC,EAAa,EAAE,GAAGX,GAAW,eAAAD,GAAe;AAEhE,SACE,gBAAAa;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGP;AAAA,MACH,GAAGC;AAAA,MACJ,WAAWO,EAAWV,EAAW,MAAME,EAAe,SAAS;AAAA,MAC/D,MAAK;AAAA,MAEL,UAAA,gBAAAO,EAACV,GAAA,EAAW,GAAGF,GAAY,GAAGQ,GAAkB,MAAAP,GAAY,SAASS,GAAa,KAAAhB,GAC/E,UAAAG,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN,GAEMiB,IAAUC,EAAuDvB,CAAQ;AAK/EsB,EAAQ,kBAAkB;AAC1BA,EAAQ,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={NEUTRAL:"neutral"};exports.TagColorsExtended=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={NEUTRAL:"neutral",SELECTED:"selected"};exports.TagColorsExtended=e;
2
2
  //# sourceMappingURL=constants.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs","sources":["../../../src/components/Tag/constants.ts"],"sourcesContent":["export const TagColorsExtended = {\n NEUTRAL: 'neutral',\n} as const;\n"],"names":["TagColorsExtended"],"mappings":"gFAAO,MAAMA,EAAoB,CAC/B,QAAS,SACX"}
1
+ {"version":3,"file":"constants.cjs","sources":["../../../src/components/Tag/constants.ts"],"sourcesContent":["export const TagColorsExtended = {\n NEUTRAL: 'neutral',\n SELECTED: 'selected',\n} as const;\n"],"names":["TagColorsExtended"],"mappings":"gFAAO,MAAMA,EAAoB,CAC/B,QAAS,UACT,SAAU,UACZ"}
@@ -1,3 +1,4 @@
1
1
  export declare const TagColorsExtended: {
2
2
  readonly NEUTRAL: "neutral";
3
+ readonly SELECTED: "selected";
3
4
  };
@@ -1,7 +1,8 @@
1
- const t = {
2
- NEUTRAL: "neutral"
1
+ const e = {
2
+ NEUTRAL: "neutral",
3
+ SELECTED: "selected"
3
4
  };
4
5
  export {
5
- t as TagColorsExtended
6
+ e as TagColorsExtended
6
7
  };
7
8
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../src/components/Tag/constants.ts"],"sourcesContent":["export const TagColorsExtended = {\n NEUTRAL: 'neutral',\n} as const;\n"],"names":["TagColorsExtended"],"mappings":"AAAO,MAAMA,IAAoB;AAAA,EAC/B,SAAS;AACX;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../src/components/Tag/constants.ts"],"sourcesContent":["export const TagColorsExtended = {\n NEUTRAL: 'neutral',\n SELECTED: 'selected',\n} as const;\n"],"names":["TagColorsExtended"],"mappings":"AAAO,MAAMA,IAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,UAAU;AACZ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("classnames"),n=require("../../hooks/useClassNamePrefix.cjs");function g(t){const{color:e,isSubtle:a,size:o,...r}=t,s=n.useClassNamePrefix("Tag"),l=`${s}--${e}`,c=`${s}--${o}`,u=`${s}--subtle`;return{classProps:i(s,{[l]:e,[c]:o,[u]:a}),props:r}}exports.useTagStyleProps=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("@alma-oss/spirit-design-tokens"),g=require("classnames"),y=require("../../constants/colors.cjs"),o=require("../../constants/dictionaries.cjs"),T=require("../../hooks/useClassNamePrefix.cjs"),d=(s,e)=>{if(!s)return{};const n=Object.keys($.emotionColors).includes(s)?`${y.ColorPrefixes.EMOTION}-`:"",r=e?o.Intensity.SUBTLE:o.Intensity.BASIC,a=e?o.Intensity.SUBTLE:o.Intensity.BASIC,t=e?o.Intensity.BASIC:o.Intensity.SUBTLE;return{[`border-${n}${s}-${r}`]:!0,[`bg-${n}${s}-${a}`]:!0,[`text-${n}${s}-${t}`]:!0}};function I(s){const{color:e,isDisabled:i,isSubtle:n,size:r,...a}=s,t=T.useClassNamePrefix("Tag"),c=`${t}--${e}`,l=`${t}--disabled`,u=`${t}--${r}`,C=`${t}--subtle`;return{classProps:g(t,{[c]:e,[l]:i,[u]:r,[C]:n,...!i&&d(e,n)}),props:a}}exports.useTagStyleProps=I;
2
2
  //# sourceMappingURL=useTagStyleProps.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTagStyleProps.cjs","sources":["../../../src/components/Tag/useTagStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { type ElementType } from 'react';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type SpiritTagProps } from '../../types';\n\nexport interface TagStyles {\n /** className props */\n classProps: string;\n /** props to be passed to the element */\n props: Partial<SpiritTagProps>;\n}\n\nexport function useTagStyleProps<E extends ElementType = 'span', C = void, S = void>(\n props: SpiritTagProps<E, C, S>,\n): TagStyles {\n const { color, isSubtle, size, ...modifiedProps } = props;\n\n const TagClass = useClassNamePrefix('Tag');\n const TagColorClass = `${TagClass}--${color}`;\n const TagSizeClass = `${TagClass}--${size}`;\n const TagSubtleClass = `${TagClass}--subtle`;\n const classProps = classNames(TagClass, {\n [TagColorClass]: color,\n [TagSizeClass]: size,\n [TagSubtleClass]: isSubtle,\n });\n\n return {\n classProps,\n props: modifiedProps as Partial<SpiritTagProps>,\n };\n}\n"],"names":["useTagStyleProps","props","color","isSubtle","size","modifiedProps","TagClass","useClassNamePrefix","TagColorClass","TagSizeClass","TagSubtleClass","classNames"],"mappings":"8JAYO,SAASA,EACdC,EACW,CACX,KAAM,CAAE,MAAAC,EAAO,SAAAC,EAAU,KAAAC,EAAM,GAAGC,GAAkBJ,EAE9CK,EAAWC,EAAAA,mBAAmB,KAAK,EACnCC,EAAgB,GAAGF,CAAQ,KAAKJ,CAAK,GACrCO,EAAe,GAAGH,CAAQ,KAAKF,CAAI,GACnCM,EAAiB,GAAGJ,CAAQ,WAOlC,MAAO,CACL,WAPiBK,EAAWL,EAAU,CACtC,CAACE,CAAa,EAAGN,EACjB,CAACO,CAAY,EAAGL,EAChB,CAACM,CAAc,EAAGP,CAAA,CACnB,EAIC,MAAOE,CAAA,CAEX"}
1
+ {"version":3,"file":"useTagStyleProps.cjs","sources":["../../../src/components/Tag/useTagStyleProps.ts"],"sourcesContent":["import { emotionColors } from '@alma-oss/spirit-design-tokens';\nimport classNames from 'classnames';\nimport { type ElementType } from 'react';\nimport { Intensity } from '../../constants';\nimport { ColorPrefixes } from '../../constants/colors';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type SpiritTagProps } from '../../types';\n\nexport interface TagStyles {\n /** className props */\n classProps: string;\n /** props to be passed to the element */\n props: Partial<SpiritTagProps>;\n}\n\nconst getColorClasses = (color: string | undefined, isSubtle: boolean | undefined) => {\n if (!color) {\n return {};\n }\n\n const isEmotionColor = Object.keys(emotionColors).includes(color);\n const prefix = isEmotionColor ? `${ColorPrefixes.EMOTION}-` : '';\n const borderIntensity = isSubtle ? Intensity.SUBTLE : Intensity.BASIC;\n const backgroundIntensity = isSubtle ? Intensity.SUBTLE : Intensity.BASIC;\n const textIntensity = isSubtle ? Intensity.BASIC : Intensity.SUBTLE;\n\n return {\n [`border-${prefix}${color}-${borderIntensity}`]: true,\n [`bg-${prefix}${color}-${backgroundIntensity}`]: true,\n [`text-${prefix}${color}-${textIntensity}`]: true,\n };\n};\n\nexport function useTagStyleProps<E extends ElementType = 'span', C = void, S = void>(\n props: SpiritTagProps<E, C, S>,\n): TagStyles {\n const { color, isDisabled, isSubtle, size, ...modifiedProps } = props;\n\n const TagClass = useClassNamePrefix('Tag');\n const TagColorClass = `${TagClass}--${color}`;\n const TagDisabledClass = `${TagClass}--disabled`;\n const TagSizeClass = `${TagClass}--${size}`;\n const TagSubtleClass = `${TagClass}--subtle`;\n const classProps = classNames(TagClass, {\n [TagColorClass]: color,\n [TagDisabledClass]: isDisabled,\n [TagSizeClass]: size,\n [TagSubtleClass]: isSubtle,\n ...(!isDisabled && getColorClasses(color as string | undefined, isSubtle as boolean | undefined)),\n });\n\n return {\n classProps,\n props: modifiedProps as Partial<SpiritTagProps>,\n };\n}\n"],"names":["getColorClasses","color","isSubtle","prefix","emotionColors","ColorPrefixes","borderIntensity","Intensity","backgroundIntensity","textIntensity","useTagStyleProps","props","isDisabled","size","modifiedProps","TagClass","useClassNamePrefix","TagColorClass","TagDisabledClass","TagSizeClass","TagSubtleClass","classNames"],"mappings":"gSAeMA,EAAkB,CAACC,EAA2BC,IAAkC,CACpF,GAAI,CAACD,EACH,MAAO,CAAA,EAIT,MAAME,EADiB,OAAO,KAAKC,EAAAA,aAAa,EAAE,SAASH,CAAK,EAChC,GAAGI,EAAAA,cAAc,OAAO,IAAM,GACxDC,EAAkBJ,EAAWK,EAAAA,UAAU,OAASA,EAAAA,UAAU,MAC1DC,EAAsBN,EAAWK,EAAAA,UAAU,OAASA,EAAAA,UAAU,MAC9DE,EAAgBP,EAAWK,EAAAA,UAAU,MAAQA,EAAAA,UAAU,OAE7D,MAAO,CACL,CAAC,UAAUJ,CAAM,GAAGF,CAAK,IAAIK,CAAe,EAAE,EAAG,GACjD,CAAC,MAAMH,CAAM,GAAGF,CAAK,IAAIO,CAAmB,EAAE,EAAG,GACjD,CAAC,QAAQL,CAAM,GAAGF,CAAK,IAAIQ,CAAa,EAAE,EAAG,EAAA,CAEjD,EAEO,SAASC,EACdC,EACW,CACX,KAAM,CAAE,MAAAV,EAAO,WAAAW,EAAY,SAAAV,EAAU,KAAAW,EAAM,GAAGC,GAAkBH,EAE1DI,EAAWC,EAAAA,mBAAmB,KAAK,EACnCC,EAAgB,GAAGF,CAAQ,KAAKd,CAAK,GACrCiB,EAAmB,GAAGH,CAAQ,aAC9BI,EAAe,GAAGJ,CAAQ,KAAKF,CAAI,GACnCO,EAAiB,GAAGL,CAAQ,WASlC,MAAO,CACL,WATiBM,EAAWN,EAAU,CACtC,CAACE,CAAa,EAAGhB,EACjB,CAACiB,CAAgB,EAAGN,EACpB,CAACO,CAAY,EAAGN,EAChB,CAACO,CAAc,EAAGlB,EAClB,GAAI,CAACU,GAAcZ,EAAgBC,EAA6BC,CAA+B,CAAA,CAChG,EAIC,MAAOY,CAAA,CAEX"}
@@ -1,17 +1,32 @@
1
- import n from "classnames";
2
- import { useClassNamePrefix as p } from "../../hooks/useClassNamePrefix.js";
3
- function C(a) {
4
- const { color: o, isSubtle: r, size: t, ...e } = a, s = p("Tag"), l = `${s}--${o}`, c = `${s}--${t}`, i = `${s}--subtle`;
1
+ import { emotionColors as $ } from "@alma-oss/spirit-design-tokens";
2
+ import p from "classnames";
3
+ import { ColorPrefixes as u } from "../../constants/colors.js";
4
+ import { Intensity as r } from "../../constants/dictionaries.js";
5
+ import { useClassNamePrefix as f } from "../../hooks/useClassNamePrefix.js";
6
+ const T = (s, t) => {
7
+ if (!s)
8
+ return {};
9
+ const e = Object.keys($).includes(s) ? `${u.EMOTION}-` : "", n = t ? r.SUBTLE : r.BASIC, a = t ? r.SUBTLE : r.BASIC, o = t ? r.BASIC : r.SUBTLE;
5
10
  return {
6
- classProps: n(s, {
7
- [l]: o,
8
- [c]: t,
9
- [i]: r
11
+ [`border-${e}${s}-${n}`]: !0,
12
+ [`bg-${e}${s}-${a}`]: !0,
13
+ [`text-${e}${s}-${o}`]: !0
14
+ };
15
+ };
16
+ function y(s) {
17
+ const { color: t, isDisabled: i, isSubtle: e, size: n, ...a } = s, o = f("Tag"), l = `${o}--${t}`, c = `${o}--disabled`, m = `${o}--${n}`, C = `${o}--subtle`;
18
+ return {
19
+ classProps: p(o, {
20
+ [l]: t,
21
+ [c]: i,
22
+ [m]: n,
23
+ [C]: e,
24
+ ...!i && T(t, e)
10
25
  }),
11
- props: e
26
+ props: a
12
27
  };
13
28
  }
14
29
  export {
15
- C as useTagStyleProps
30
+ y as useTagStyleProps
16
31
  };
17
32
  //# sourceMappingURL=useTagStyleProps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTagStyleProps.js","sources":["../../../src/components/Tag/useTagStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { type ElementType } from 'react';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type SpiritTagProps } from '../../types';\n\nexport interface TagStyles {\n /** className props */\n classProps: string;\n /** props to be passed to the element */\n props: Partial<SpiritTagProps>;\n}\n\nexport function useTagStyleProps<E extends ElementType = 'span', C = void, S = void>(\n props: SpiritTagProps<E, C, S>,\n): TagStyles {\n const { color, isSubtle, size, ...modifiedProps } = props;\n\n const TagClass = useClassNamePrefix('Tag');\n const TagColorClass = `${TagClass}--${color}`;\n const TagSizeClass = `${TagClass}--${size}`;\n const TagSubtleClass = `${TagClass}--subtle`;\n const classProps = classNames(TagClass, {\n [TagColorClass]: color,\n [TagSizeClass]: size,\n [TagSubtleClass]: isSubtle,\n });\n\n return {\n classProps,\n props: modifiedProps as Partial<SpiritTagProps>,\n };\n}\n"],"names":["useTagStyleProps","props","color","isSubtle","size","modifiedProps","TagClass","useClassNamePrefix","TagColorClass","TagSizeClass","TagSubtleClass","classNames"],"mappings":";;AAYO,SAASA,EACdC,GACW;AACX,QAAM,EAAE,OAAAC,GAAO,UAAAC,GAAU,MAAAC,GAAM,GAAGC,MAAkBJ,GAE9CK,IAAWC,EAAmB,KAAK,GACnCC,IAAgB,GAAGF,CAAQ,KAAKJ,CAAK,IACrCO,IAAe,GAAGH,CAAQ,KAAKF,CAAI,IACnCM,IAAiB,GAAGJ,CAAQ;AAOlC,SAAO;AAAA,IACL,YAPiBK,EAAWL,GAAU;AAAA,MACtC,CAACE,CAAa,GAAGN;AAAA,MACjB,CAACO,CAAY,GAAGL;AAAA,MAChB,CAACM,CAAc,GAAGP;AAAA,IAAA,CACnB;AAAA,IAIC,OAAOE;AAAA,EAAA;AAEX;"}
1
+ {"version":3,"file":"useTagStyleProps.js","sources":["../../../src/components/Tag/useTagStyleProps.ts"],"sourcesContent":["import { emotionColors } from '@alma-oss/spirit-design-tokens';\nimport classNames from 'classnames';\nimport { type ElementType } from 'react';\nimport { Intensity } from '../../constants';\nimport { ColorPrefixes } from '../../constants/colors';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type SpiritTagProps } from '../../types';\n\nexport interface TagStyles {\n /** className props */\n classProps: string;\n /** props to be passed to the element */\n props: Partial<SpiritTagProps>;\n}\n\nconst getColorClasses = (color: string | undefined, isSubtle: boolean | undefined) => {\n if (!color) {\n return {};\n }\n\n const isEmotionColor = Object.keys(emotionColors).includes(color);\n const prefix = isEmotionColor ? `${ColorPrefixes.EMOTION}-` : '';\n const borderIntensity = isSubtle ? Intensity.SUBTLE : Intensity.BASIC;\n const backgroundIntensity = isSubtle ? Intensity.SUBTLE : Intensity.BASIC;\n const textIntensity = isSubtle ? Intensity.BASIC : Intensity.SUBTLE;\n\n return {\n [`border-${prefix}${color}-${borderIntensity}`]: true,\n [`bg-${prefix}${color}-${backgroundIntensity}`]: true,\n [`text-${prefix}${color}-${textIntensity}`]: true,\n };\n};\n\nexport function useTagStyleProps<E extends ElementType = 'span', C = void, S = void>(\n props: SpiritTagProps<E, C, S>,\n): TagStyles {\n const { color, isDisabled, isSubtle, size, ...modifiedProps } = props;\n\n const TagClass = useClassNamePrefix('Tag');\n const TagColorClass = `${TagClass}--${color}`;\n const TagDisabledClass = `${TagClass}--disabled`;\n const TagSizeClass = `${TagClass}--${size}`;\n const TagSubtleClass = `${TagClass}--subtle`;\n const classProps = classNames(TagClass, {\n [TagColorClass]: color,\n [TagDisabledClass]: isDisabled,\n [TagSizeClass]: size,\n [TagSubtleClass]: isSubtle,\n ...(!isDisabled && getColorClasses(color as string | undefined, isSubtle as boolean | undefined)),\n });\n\n return {\n classProps,\n props: modifiedProps as Partial<SpiritTagProps>,\n };\n}\n"],"names":["getColorClasses","color","isSubtle","prefix","emotionColors","ColorPrefixes","borderIntensity","Intensity","backgroundIntensity","textIntensity","useTagStyleProps","props","isDisabled","size","modifiedProps","TagClass","useClassNamePrefix","TagColorClass","TagDisabledClass","TagSizeClass","TagSubtleClass","classNames"],"mappings":";;;;;AAeA,MAAMA,IAAkB,CAACC,GAA2BC,MAAkC;AACpF,MAAI,CAACD;AACH,WAAO,CAAA;AAIT,QAAME,IADiB,OAAO,KAAKC,CAAa,EAAE,SAASH,CAAK,IAChC,GAAGI,EAAc,OAAO,MAAM,IACxDC,IAAkBJ,IAAWK,EAAU,SAASA,EAAU,OAC1DC,IAAsBN,IAAWK,EAAU,SAASA,EAAU,OAC9DE,IAAgBP,IAAWK,EAAU,QAAQA,EAAU;AAE7D,SAAO;AAAA,IACL,CAAC,UAAUJ,CAAM,GAAGF,CAAK,IAAIK,CAAe,EAAE,GAAG;AAAA,IACjD,CAAC,MAAMH,CAAM,GAAGF,CAAK,IAAIO,CAAmB,EAAE,GAAG;AAAA,IACjD,CAAC,QAAQL,CAAM,GAAGF,CAAK,IAAIQ,CAAa,EAAE,GAAG;AAAA,EAAA;AAEjD;AAEO,SAASC,EACdC,GACW;AACX,QAAM,EAAE,OAAAV,GAAO,YAAAW,GAAY,UAAAV,GAAU,MAAAW,GAAM,GAAGC,MAAkBH,GAE1DI,IAAWC,EAAmB,KAAK,GACnCC,IAAgB,GAAGF,CAAQ,KAAKd,CAAK,IACrCiB,IAAmB,GAAGH,CAAQ,cAC9BI,IAAe,GAAGJ,CAAQ,KAAKF,CAAI,IACnCO,IAAiB,GAAGL,CAAQ;AASlC,SAAO;AAAA,IACL,YATiBM,EAAWN,GAAU;AAAA,MACtC,CAACE,CAAa,GAAGhB;AAAA,MACjB,CAACiB,CAAgB,GAAGN;AAAA,MACpB,CAACO,CAAY,GAAGN;AAAA,MAChB,CAACO,CAAc,GAAGlB;AAAA,MAClB,GAAI,CAACU,KAAcZ,EAAgBC,GAA6BC,CAA+B;AAAA,IAAA,CAChG;AAAA,IAIC,OAAOY;AAAA,EAAA;AAEX;"}
@@ -1,2 +1,2 @@
1
- "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),s=require("react"),g=require("../TextFieldBase/TextFieldBase.cjs"),p=require("./useAdjustHeight.cjs"),x=(n,u)=>{const{onInput:r,isAutoResizing:i,autoResizingMaxHeight:o=400,...a}=n,t=s.useRef(u),{adjustHeightOnAutoresize:c,onInput:l}=p.useAdjustHeight({elementReference:t,onInput:r,isAutoResizing:i,maxHeight:o});return d.jsx(g.default,{isMultiline:!0,ref:t,onInput:l,onFocus:c,...a})},e=s.forwardRef(x);e.spiritComponent="TextArea";e.displayName="TextArea";exports.default=e;
1
+ "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const S=require("react/jsx-runtime"),r=require("react"),j=require("../../common/utilities/warning.cjs"),f=require("../../utils/string.cjs"),V=require("../CharacterCounter/useCharacterCounterState.cjs"),_=require("../TextFieldBase/TextFieldBase.cjs"),b=require("./constants.cjs"),E=require("./useAdjustHeight.cjs"),I=(e,a)=>e===!0||a!==void 0,w=e=>e===void 0?b.TEXTAREA_MAX_SAFE_LENGTH:e,F=(e,a)=>{const{onInput:x,isAutoResizing:m,autoResizingMaxHeight:v=400,counterThreshold:t,hasCounter:u,onChange:s,value:i,defaultValue:l,helperText:T,isDisabled:A,id:p,...n}=e,c=r.useRef(a),{adjustHeightOnAutoresize:C,onInput:L}=E.useAdjustHeight({elementReference:c,onInput:x,isAutoResizing:m,maxHeight:v}),R=f.normalizeStringValue(i),q=f.normalizeStringValue(l),{counterProps:H,handleChange:z}=V.useCharacterCounterState({value:R,defaultValue:q,counterThreshold:t,hasCounter:u,onChange:s}),d=I(u,t),h=d?w(n.maxLength):void 0,M=d?z:s,g=r.useRef(!1);return r.useEffect(()=>{t!==void 0&&n.maxLength!==void 0&&n.maxLength<t&&!g.current&&(g.current=!0,j.default(!1,"TextArea: `maxLength` should be greater than or equal to `counterThreshold` to keep visible counter and hard input limit aligned."))},[t,n.maxLength]),S.jsx(_.default,{id:p,isMultiline:!0,ref:c,onInput:L,onFocus:C,onChange:M,value:i,defaultValue:l,helperText:T,isDisabled:A,counterProps:H,...n,...h!==void 0&&{maxLength:h}})},o=r.forwardRef(F);o.spiritComponent="TextArea";o.displayName="TextArea";exports.default=o;
2
2
  //# sourceMappingURL=TextArea.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.cjs","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ForwardedRef, type RefObject, forwardRef, useRef } from 'react';\nimport { type ForwardRefComponent, type SpiritTextAreaProps } from '../../types';\nimport { TextFieldBase } from '../TextFieldBase';\nimport { useAdjustHeight } from './useAdjustHeight';\n\nconst _TextArea = (props: SpiritTextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>): JSX.Element => {\n const { onInput, isAutoResizing, autoResizingMaxHeight = 400, ...restProps } = props;\n const elementReference = useRef(ref);\n const { adjustHeightOnAutoresize, onInput: onInputHandler } = useAdjustHeight({\n elementReference,\n onInput,\n isAutoResizing,\n maxHeight: autoResizingMaxHeight,\n });\n\n return (\n <TextFieldBase\n isMultiline\n ref={elementReference as RefObject<HTMLTextAreaElement>}\n onInput={onInputHandler}\n onFocus={adjustHeightOnAutoresize}\n {...restProps}\n />\n );\n};\n\nconst TextArea = forwardRef<HTMLTextAreaElement, SpiritTextAreaProps>(_TextArea) as ForwardRefComponent<\n HTMLTextAreaElement,\n SpiritTextAreaProps\n>;\n\nTextArea.spiritComponent = 'TextArea';\nTextArea.displayName = 'TextArea';\n\nexport default TextArea;\n"],"names":["_TextArea","props","ref","onInput","isAutoResizing","autoResizingMaxHeight","restProps","elementReference","useRef","adjustHeightOnAutoresize","onInputHandler","useAdjustHeight","jsx","TextFieldBase","TextArea","forwardRef"],"mappings":"oQAOMA,EAAY,CAACC,EAA4BC,IAAwD,CACrG,KAAM,CAAE,QAAAC,EAAS,eAAAC,EAAgB,sBAAAC,EAAwB,IAAK,GAAGC,GAAcL,EACzEM,EAAmBC,EAAAA,OAAON,CAAG,EAC7B,CAAE,yBAAAO,EAA0B,QAASC,CAAA,EAAmBC,EAAAA,gBAAgB,CAC5E,iBAAAJ,EACA,QAAAJ,EACA,eAAAC,EACA,UAAWC,CAAA,CACZ,EAED,OACEO,EAAAA,IAACC,EAAAA,QAAA,CACC,YAAW,GACX,IAAKN,EACL,QAASG,EACT,QAASD,EACR,GAAGH,CAAA,CAAA,CAGV,EAEMQ,EAAWC,EAAAA,WAAqDf,CAAS,EAK/Ec,EAAS,gBAAkB,WAC3BA,EAAS,YAAc"}
1
+ {"version":3,"file":"TextArea.cjs","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ForwardedRef, type RefObject, forwardRef, useEffect, useRef } from 'react';\nimport { warning } from '../../common/utilities';\nimport { type ForwardRefComponent, type SpiritTextAreaProps } from '../../types';\nimport { normalizeStringValue } from '../../utils';\nimport { useCharacterCounterState } from '../CharacterCounter';\nimport { TextFieldBase } from '../TextFieldBase';\nimport { TEXTAREA_MAX_SAFE_LENGTH } from './constants';\nimport { useAdjustHeight } from './useAdjustHeight';\n\nconst isCounterActive = (hasCounter: boolean | undefined, counterThreshold: number | undefined): boolean =>\n hasCounter === true || counterThreshold !== undefined;\n\nconst resolveCounterNativeMaxLength = (consumerMaxLength: number | undefined): number =>\n consumerMaxLength === undefined ? TEXTAREA_MAX_SAFE_LENGTH : consumerMaxLength;\n\nconst _TextArea = (props: SpiritTextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>): JSX.Element => {\n const {\n onInput,\n isAutoResizing,\n autoResizingMaxHeight = 400,\n counterThreshold,\n hasCounter,\n onChange,\n value,\n defaultValue,\n helperText,\n isDisabled,\n id,\n ...restProps\n } = props;\n\n const elementReference = useRef(ref);\n const { adjustHeightOnAutoresize, onInput: onInputHandler } = useAdjustHeight({\n elementReference,\n onInput,\n isAutoResizing,\n maxHeight: autoResizingMaxHeight,\n });\n\n const normalizedValue = normalizeStringValue(value);\n const normalizedDefaultValue = normalizeStringValue(defaultValue);\n\n const { counterProps, handleChange } = useCharacterCounterState({\n value: normalizedValue,\n defaultValue: normalizedDefaultValue,\n counterThreshold,\n hasCounter,\n onChange,\n });\n\n const counterOn = isCounterActive(hasCounter, counterThreshold);\n const nativeMaxLength = counterOn ? resolveCounterNativeMaxLength(restProps.maxLength) : undefined;\n const changeHandler = counterOn ? handleChange : onChange;\n\n const didWarnMaxLengthLowerThanThresholdRef = useRef(false);\n useEffect(() => {\n if (\n counterThreshold !== undefined &&\n restProps.maxLength !== undefined &&\n restProps.maxLength < counterThreshold &&\n !didWarnMaxLengthLowerThanThresholdRef.current\n ) {\n didWarnMaxLengthLowerThanThresholdRef.current = true;\n warning(\n false,\n 'TextArea: `maxLength` should be greater than or equal to `counterThreshold` to keep visible counter and hard input limit aligned.',\n );\n }\n }, [counterThreshold, restProps.maxLength]);\n\n return (\n <TextFieldBase\n id={id}\n isMultiline\n ref={elementReference as RefObject<HTMLTextAreaElement>}\n onInput={onInputHandler}\n onFocus={adjustHeightOnAutoresize}\n onChange={changeHandler}\n value={value}\n defaultValue={defaultValue}\n helperText={helperText}\n isDisabled={isDisabled}\n counterProps={counterProps}\n {...restProps}\n {...(nativeMaxLength !== undefined && { maxLength: nativeMaxLength })}\n />\n );\n};\n\nconst TextArea = forwardRef<HTMLTextAreaElement, SpiritTextAreaProps>(_TextArea) as ForwardRefComponent<\n HTMLTextAreaElement,\n SpiritTextAreaProps\n>;\n\nTextArea.spiritComponent = 'TextArea';\nTextArea.displayName = 'TextArea';\n\nexport default TextArea;\n"],"names":["isCounterActive","hasCounter","counterThreshold","resolveCounterNativeMaxLength","consumerMaxLength","TEXTAREA_MAX_SAFE_LENGTH","_TextArea","props","ref","onInput","isAutoResizing","autoResizingMaxHeight","onChange","value","defaultValue","helperText","isDisabled","id","restProps","elementReference","useRef","adjustHeightOnAutoresize","onInputHandler","useAdjustHeight","normalizedValue","normalizeStringValue","normalizedDefaultValue","counterProps","handleChange","useCharacterCounterState","counterOn","nativeMaxLength","changeHandler","didWarnMaxLengthLowerThanThresholdRef","useEffect","warning","jsx","TextFieldBase","TextArea","forwardRef"],"mappings":"mbAWMA,EAAkB,CAACC,EAAiCC,IACxDD,IAAe,IAAQC,IAAqB,OAExCC,EAAiCC,GACrCA,IAAsB,OAAYC,EAAAA,yBAA2BD,EAEzDE,EAAY,CAACC,EAA4BC,IAAwD,CACrG,KAAM,CACJ,QAAAC,EACA,eAAAC,EACA,sBAAAC,EAAwB,IACxB,iBAAAT,EACA,WAAAD,EACA,SAAAW,EACA,MAAAC,EACA,aAAAC,EACA,WAAAC,EACA,WAAAC,EACA,GAAAC,EACA,GAAGC,CAAA,EACDX,EAEEY,EAAmBC,EAAAA,OAAOZ,CAAG,EAC7B,CAAE,yBAAAa,EAA0B,QAASC,CAAA,EAAmBC,EAAAA,gBAAgB,CAC5E,iBAAAJ,EACA,QAAAV,EACA,eAAAC,EACA,UAAWC,CAAA,CACZ,EAEKa,EAAkBC,EAAAA,qBAAqBZ,CAAK,EAC5Ca,EAAyBD,EAAAA,qBAAqBX,CAAY,EAE1D,CAAE,aAAAa,EAAc,aAAAC,CAAA,EAAiBC,2BAAyB,CAC9D,MAAOL,EACP,aAAcE,EACd,iBAAAxB,EACA,WAAAD,EACA,SAAAW,CAAA,CACD,EAEKkB,EAAY9B,EAAgBC,EAAYC,CAAgB,EACxD6B,EAAkBD,EAAY3B,EAA8Be,EAAU,SAAS,EAAI,OACnFc,EAAgBF,EAAYF,EAAehB,EAE3CqB,EAAwCb,EAAAA,OAAO,EAAK,EAC1Dc,OAAAA,EAAAA,UAAU,IAAM,CAEZhC,IAAqB,QACrBgB,EAAU,YAAc,QACxBA,EAAU,UAAYhB,GACtB,CAAC+B,EAAsC,UAEvCA,EAAsC,QAAU,GAChDE,EAAAA,QACE,GACA,mIAAA,EAGN,EAAG,CAACjC,EAAkBgB,EAAU,SAAS,CAAC,EAGxCkB,EAAAA,IAACC,EAAAA,QAAA,CACC,GAAApB,EACA,YAAW,GACX,IAAKE,EACL,QAASG,EACT,QAASD,EACT,SAAUW,EACV,MAAAnB,EACA,aAAAC,EACA,WAAAC,EACA,WAAAC,EACA,aAAAW,EACC,GAAGT,EACH,GAAIa,IAAoB,QAAa,CAAE,UAAWA,CAAA,CAAgB,CAAA,CAGzE,EAEMO,EAAWC,EAAAA,WAAqDjC,CAAS,EAK/EgC,EAAS,gBAAkB,WAC3BA,EAAS,YAAc"}
@@ -1,29 +1,65 @@
1
1
  "use client";
2
- import { jsx as m } from "react/jsx-runtime";
3
- import { forwardRef as f, useRef as c } from "react";
4
- import x from "../TextFieldBase/TextFieldBase.js";
5
- import { useAdjustHeight as l } from "./useAdjustHeight.js";
6
- const d = (o, r) => {
7
- const { onInput: n, isAutoResizing: s, autoResizingMaxHeight: i = 400, ...u } = o, e = c(r), { adjustHeightOnAutoresize: a, onInput: p } = l({
8
- elementReference: e,
9
- onInput: n,
10
- isAutoResizing: s,
11
- maxHeight: i
12
- });
13
- return /* @__PURE__ */ m(
14
- x,
2
+ import { jsx as V } from "react/jsx-runtime";
3
+ import { forwardRef as I, useRef as m, useEffect as _ } from "react";
4
+ import b from "../../common/utilities/warning.js";
5
+ import { normalizeStringValue as c } from "../../utils/string.js";
6
+ import { useCharacterCounterState as j } from "../CharacterCounter/useCharacterCounterState.js";
7
+ import w from "../TextFieldBase/TextFieldBase.js";
8
+ import { TEXTAREA_MAX_SAFE_LENGTH as F } from "./constants.js";
9
+ import { useAdjustHeight as N } from "./useAdjustHeight.js";
10
+ const S = (e, o) => e === !0 || o !== void 0, D = (e) => e === void 0 ? F : e, O = (e, o) => {
11
+ const {
12
+ onInput: g,
13
+ isAutoResizing: p,
14
+ autoResizingMaxHeight: x = 400,
15
+ counterThreshold: t,
16
+ hasCounter: r,
17
+ onChange: a,
18
+ value: i,
19
+ defaultValue: s,
20
+ helperText: T,
21
+ isDisabled: v,
22
+ id: A,
23
+ ...n
24
+ } = e, u = m(o), { adjustHeightOnAutoresize: L, onInput: C } = N({
25
+ elementReference: u,
26
+ onInput: g,
27
+ isAutoResizing: p,
28
+ maxHeight: x
29
+ }), H = c(i), R = c(s), { counterProps: z, handleChange: E } = j({
30
+ value: H,
31
+ defaultValue: R,
32
+ counterThreshold: t,
33
+ hasCounter: r,
34
+ onChange: a
35
+ }), l = S(r, t), d = l ? D(n.maxLength) : void 0, M = l ? E : a, h = m(!1);
36
+ return _(() => {
37
+ t !== void 0 && n.maxLength !== void 0 && n.maxLength < t && !h.current && (h.current = !0, b(
38
+ !1,
39
+ "TextArea: `maxLength` should be greater than or equal to `counterThreshold` to keep visible counter and hard input limit aligned."
40
+ ));
41
+ }, [t, n.maxLength]), /* @__PURE__ */ V(
42
+ w,
15
43
  {
44
+ id: A,
16
45
  isMultiline: !0,
17
- ref: e,
18
- onInput: p,
19
- onFocus: a,
20
- ...u
46
+ ref: u,
47
+ onInput: C,
48
+ onFocus: L,
49
+ onChange: M,
50
+ value: i,
51
+ defaultValue: s,
52
+ helperText: T,
53
+ isDisabled: v,
54
+ counterProps: z,
55
+ ...n,
56
+ ...d !== void 0 && { maxLength: d }
21
57
  }
22
58
  );
23
- }, t = f(d);
24
- t.spiritComponent = "TextArea";
25
- t.displayName = "TextArea";
59
+ }, f = I(O);
60
+ f.spiritComponent = "TextArea";
61
+ f.displayName = "TextArea";
26
62
  export {
27
- t as default
63
+ f as default
28
64
  };
29
65
  //# sourceMappingURL=TextArea.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.js","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ForwardedRef, type RefObject, forwardRef, useRef } from 'react';\nimport { type ForwardRefComponent, type SpiritTextAreaProps } from '../../types';\nimport { TextFieldBase } from '../TextFieldBase';\nimport { useAdjustHeight } from './useAdjustHeight';\n\nconst _TextArea = (props: SpiritTextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>): JSX.Element => {\n const { onInput, isAutoResizing, autoResizingMaxHeight = 400, ...restProps } = props;\n const elementReference = useRef(ref);\n const { adjustHeightOnAutoresize, onInput: onInputHandler } = useAdjustHeight({\n elementReference,\n onInput,\n isAutoResizing,\n maxHeight: autoResizingMaxHeight,\n });\n\n return (\n <TextFieldBase\n isMultiline\n ref={elementReference as RefObject<HTMLTextAreaElement>}\n onInput={onInputHandler}\n onFocus={adjustHeightOnAutoresize}\n {...restProps}\n />\n );\n};\n\nconst TextArea = forwardRef<HTMLTextAreaElement, SpiritTextAreaProps>(_TextArea) as ForwardRefComponent<\n HTMLTextAreaElement,\n SpiritTextAreaProps\n>;\n\nTextArea.spiritComponent = 'TextArea';\nTextArea.displayName = 'TextArea';\n\nexport default TextArea;\n"],"names":["_TextArea","props","ref","onInput","isAutoResizing","autoResizingMaxHeight","restProps","elementReference","useRef","adjustHeightOnAutoresize","onInputHandler","useAdjustHeight","jsx","TextFieldBase","TextArea","forwardRef"],"mappings":";;;;;AAOA,MAAMA,IAAY,CAACC,GAA4BC,MAAwD;AACrG,QAAM,EAAE,SAAAC,GAAS,gBAAAC,GAAgB,uBAAAC,IAAwB,KAAK,GAAGC,MAAcL,GACzEM,IAAmBC,EAAON,CAAG,GAC7B,EAAE,0BAAAO,GAA0B,SAASC,EAAA,IAAmBC,EAAgB;AAAA,IAC5E,kBAAAJ;AAAA,IACA,SAAAJ;AAAA,IACA,gBAAAC;AAAA,IACA,WAAWC;AAAA,EAAA,CACZ;AAED,SACE,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,aAAW;AAAA,MACX,KAAKN;AAAA,MACL,SAASG;AAAA,MACT,SAASD;AAAA,MACR,GAAGH;AAAA,IAAA;AAAA,EAAA;AAGV,GAEMQ,IAAWC,EAAqDf,CAAS;AAK/Ec,EAAS,kBAAkB;AAC3BA,EAAS,cAAc;"}
1
+ {"version":3,"file":"TextArea.js","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ForwardedRef, type RefObject, forwardRef, useEffect, useRef } from 'react';\nimport { warning } from '../../common/utilities';\nimport { type ForwardRefComponent, type SpiritTextAreaProps } from '../../types';\nimport { normalizeStringValue } from '../../utils';\nimport { useCharacterCounterState } from '../CharacterCounter';\nimport { TextFieldBase } from '../TextFieldBase';\nimport { TEXTAREA_MAX_SAFE_LENGTH } from './constants';\nimport { useAdjustHeight } from './useAdjustHeight';\n\nconst isCounterActive = (hasCounter: boolean | undefined, counterThreshold: number | undefined): boolean =>\n hasCounter === true || counterThreshold !== undefined;\n\nconst resolveCounterNativeMaxLength = (consumerMaxLength: number | undefined): number =>\n consumerMaxLength === undefined ? TEXTAREA_MAX_SAFE_LENGTH : consumerMaxLength;\n\nconst _TextArea = (props: SpiritTextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>): JSX.Element => {\n const {\n onInput,\n isAutoResizing,\n autoResizingMaxHeight = 400,\n counterThreshold,\n hasCounter,\n onChange,\n value,\n defaultValue,\n helperText,\n isDisabled,\n id,\n ...restProps\n } = props;\n\n const elementReference = useRef(ref);\n const { adjustHeightOnAutoresize, onInput: onInputHandler } = useAdjustHeight({\n elementReference,\n onInput,\n isAutoResizing,\n maxHeight: autoResizingMaxHeight,\n });\n\n const normalizedValue = normalizeStringValue(value);\n const normalizedDefaultValue = normalizeStringValue(defaultValue);\n\n const { counterProps, handleChange } = useCharacterCounterState({\n value: normalizedValue,\n defaultValue: normalizedDefaultValue,\n counterThreshold,\n hasCounter,\n onChange,\n });\n\n const counterOn = isCounterActive(hasCounter, counterThreshold);\n const nativeMaxLength = counterOn ? resolveCounterNativeMaxLength(restProps.maxLength) : undefined;\n const changeHandler = counterOn ? handleChange : onChange;\n\n const didWarnMaxLengthLowerThanThresholdRef = useRef(false);\n useEffect(() => {\n if (\n counterThreshold !== undefined &&\n restProps.maxLength !== undefined &&\n restProps.maxLength < counterThreshold &&\n !didWarnMaxLengthLowerThanThresholdRef.current\n ) {\n didWarnMaxLengthLowerThanThresholdRef.current = true;\n warning(\n false,\n 'TextArea: `maxLength` should be greater than or equal to `counterThreshold` to keep visible counter and hard input limit aligned.',\n );\n }\n }, [counterThreshold, restProps.maxLength]);\n\n return (\n <TextFieldBase\n id={id}\n isMultiline\n ref={elementReference as RefObject<HTMLTextAreaElement>}\n onInput={onInputHandler}\n onFocus={adjustHeightOnAutoresize}\n onChange={changeHandler}\n value={value}\n defaultValue={defaultValue}\n helperText={helperText}\n isDisabled={isDisabled}\n counterProps={counterProps}\n {...restProps}\n {...(nativeMaxLength !== undefined && { maxLength: nativeMaxLength })}\n />\n );\n};\n\nconst TextArea = forwardRef<HTMLTextAreaElement, SpiritTextAreaProps>(_TextArea) as ForwardRefComponent<\n HTMLTextAreaElement,\n SpiritTextAreaProps\n>;\n\nTextArea.spiritComponent = 'TextArea';\nTextArea.displayName = 'TextArea';\n\nexport default TextArea;\n"],"names":["isCounterActive","hasCounter","counterThreshold","resolveCounterNativeMaxLength","consumerMaxLength","TEXTAREA_MAX_SAFE_LENGTH","_TextArea","props","ref","onInput","isAutoResizing","autoResizingMaxHeight","onChange","value","defaultValue","helperText","isDisabled","id","restProps","elementReference","useRef","adjustHeightOnAutoresize","onInputHandler","useAdjustHeight","normalizedValue","normalizeStringValue","normalizedDefaultValue","counterProps","handleChange","useCharacterCounterState","counterOn","nativeMaxLength","changeHandler","didWarnMaxLengthLowerThanThresholdRef","useEffect","warning","jsx","TextFieldBase","TextArea","forwardRef"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAkB,CAACC,GAAiCC,MACxDD,MAAe,MAAQC,MAAqB,QAExCC,IAAgC,CAACC,MACrCA,MAAsB,SAAYC,IAA2BD,GAEzDE,IAAY,CAACC,GAA4BC,MAAwD;AACrG,QAAM;AAAA,IACJ,SAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,uBAAAC,IAAwB;AAAA,IACxB,kBAAAT;AAAA,IACA,YAAAD;AAAA,IACA,UAAAW;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDX,GAEEY,IAAmBC,EAAOZ,CAAG,GAC7B,EAAE,0BAAAa,GAA0B,SAASC,EAAA,IAAmBC,EAAgB;AAAA,IAC5E,kBAAAJ;AAAA,IACA,SAAAV;AAAA,IACA,gBAAAC;AAAA,IACA,WAAWC;AAAA,EAAA,CACZ,GAEKa,IAAkBC,EAAqBZ,CAAK,GAC5Ca,IAAyBD,EAAqBX,CAAY,GAE1D,EAAE,cAAAa,GAAc,cAAAC,EAAA,IAAiBC,EAAyB;AAAA,IAC9D,OAAOL;AAAA,IACP,cAAcE;AAAA,IACd,kBAAAxB;AAAA,IACA,YAAAD;AAAA,IACA,UAAAW;AAAA,EAAA,CACD,GAEKkB,IAAY9B,EAAgBC,GAAYC,CAAgB,GACxD6B,IAAkBD,IAAY3B,EAA8Be,EAAU,SAAS,IAAI,QACnFc,IAAgBF,IAAYF,IAAehB,GAE3CqB,IAAwCb,EAAO,EAAK;AAC1D,SAAAc,EAAU,MAAM;AACd,IACEhC,MAAqB,UACrBgB,EAAU,cAAc,UACxBA,EAAU,YAAYhB,KACtB,CAAC+B,EAAsC,YAEvCA,EAAsC,UAAU,IAChDE;AAAA,MACE;AAAA,MACA;AAAA,IAAA;AAAA,EAGN,GAAG,CAACjC,GAAkBgB,EAAU,SAAS,CAAC,GAGxC,gBAAAkB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAApB;AAAA,MACA,aAAW;AAAA,MACX,KAAKE;AAAA,MACL,SAASG;AAAA,MACT,SAASD;AAAA,MACT,UAAUW;AAAA,MACV,OAAAnB;AAAA,MACA,cAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAW;AAAA,MACC,GAAGT;AAAA,MACH,GAAIa,MAAoB,UAAa,EAAE,WAAWA,EAAA;AAAA,IAAgB;AAAA,EAAA;AAGzE,GAEMO,IAAWC,EAAqDjC,CAAS;AAK/EgC,EAAS,kBAAkB;AAC3BA,EAAS,cAAc;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=1e4;exports.TEXTAREA_MAX_SAFE_LENGTH=e;
2
+ //# sourceMappingURL=constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.cjs","sources":["../../../src/components/TextArea/constants.ts"],"sourcesContent":["// Default/fallback native maxLength when the character counter is enabled and no consumer maxLength is provided.\n// Helps prevent pathological input length in the browser without capping explicit consumer-provided maxLength values.\nexport const TEXTAREA_MAX_SAFE_LENGTH = 10000;\n"],"names":["TEXTAREA_MAX_SAFE_LENGTH"],"mappings":"gFAEO,MAAMA,EAA2B"}
@@ -0,0 +1 @@
1
+ export declare const TEXTAREA_MAX_SAFE_LENGTH = 10000;
@@ -0,0 +1,5 @@
1
+ const t = 1e4;
2
+ export {
3
+ t as TEXTAREA_MAX_SAFE_LENGTH
4
+ };
5
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../src/components/TextArea/constants.ts"],"sourcesContent":["// Default/fallback native maxLength when the character counter is enabled and no consumer maxLength is provided.\n// Helps prevent pathological input length in the browser without capping explicit consumer-provided maxLength values.\nexport const TEXTAREA_MAX_SAFE_LENGTH = 10000;\n"],"names":["TEXTAREA_MAX_SAFE_LENGTH"],"mappings":"AAEO,MAAMA,IAA2B;"}
@@ -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"),b=require("classnames"),n=require("react"),h=require("../../constants/dictionaries.cjs"),S=require("../../hooks/styleProps.cjs"),N=require("../../hooks/useAriaDescribedBy.cjs"),_=require("../Field/HelperText.cjs"),g=require("../Field/Label.cjs"),v=require("../Field/useAriaIds.cjs"),A=require("../Field/ValidationText.cjs"),j=require("../Field/useValidationTextRole.cjs"),R=require("./TextFieldBaseInput.cjs"),I=require("./useTextFieldBaseStyleProps.cjs"),w=require("./withPasswordToggle.cjs"),D=n.forwardRef(w.default(R.default)),V=(c,u)=>{const{"aria-describedby":p="",hasValidationIcon:x,helperText:T,id:e,label:q,size:a=h.Sizes.MEDIUM,validationState:t,validationText:o,...y}=c,{classProps:r,props:P}=I.useTextFieldBaseStyleProps({id:e,size:a,validationState:t,...y}),{styleProps:l,props:f}=S.useStyleProps(P),[m,d]=v.default(p),B=N.useAriaDescribedBy(m),F=j.useValidationTextRole({validationState:t,validationText:o});return s.jsxs("div",{...l,className:b(r.root,l.className),children:[s.jsx(g.default,{htmlFor:e,UNSAFE_className:r.label,children:q}),s.jsx(D,{...f,...B,id:e,ref:u,size:a}),s.jsx(_.default,{UNSAFE_className:r.helperText,id:`${e}__helperText`,registerAria:d,helperText:T}),t&&s.jsx(A.default,{UNSAFE_className:r.validationText,elementType:"span",...x&&{hasValidationStateIcon:t},id:`${e}__validationText`,validationText:o,registerAria:d,role:F})]})},i=n.forwardRef(V);i.spiritComponent="TextFieldBase";i.displayName="TextFieldBase";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"),x=require("react"),B=require("../../constants/dictionaries.cjs"),_=require("../../hooks/styleProps.cjs"),v=require("../../hooks/useAriaIdRefs.cjs"),A=require("../CharacterCounter/CharacterCounter.cjs"),E=require("../Field/HelperText.cjs"),R=require("../Field/Label.cjs"),w=require("../Field/ValidationText.cjs"),I=require("../Field/useValidationTextRole.cjs"),U=require("../Flex/Flex.cjs"),V=require("./TextFieldBaseInput.cjs"),C=require("./useTextFieldBaseStyleProps.cjs"),D=require("./withPasswordToggle.cjs"),M=x.forwardRef(D.default(V.default)),z=(T,m)=>{const{"aria-describedby":h="",counterProps:i,hasValidationIcon:f,helperText:n,id:t,label:q,size:c=B.Sizes.MEDIUM,validationState:s,validationText:a,...F}=T,{classProps:r,props:P}=C.useTextFieldBaseStyleProps({id:t,size:c,validationState:s,...F}),{styleProps:d,props:g}=_.useStyleProps(P),[y,o]=v.useAriaDescribedBy(h),N=I.useValidationTextRole({validationState:s,validationText:a}),S=n||s&&a,u=e.jsx(E.default,{UNSAFE_className:r.helperText,id:`${t}__helper-text`,registerAria:o,helperText:n}),p=s?e.jsx(w.default,{UNSAFE_className:r.validationText,elementType:"span",...f&&{hasValidationStateIcon:s},id:`${t}__validation-text`,validationText:a,registerAria:o,role:N}):null,b=i?e.jsx(A.default,{...i,id:t,registerAria:o,UNSAFE_className:r.counter}):null;return e.jsxs("div",{...d,className:j(r.root,d.className),children:[e.jsx(R.default,{htmlFor:t,UNSAFE_className:r.label,children:q}),e.jsx(M,{...g,...y,id:t,ref:m,size:c}),i?e.jsxs(U.default,{direction:"horizontal",isWrapping:!1,alignmentX:"space-between",alignmentY:"top",children:[S?e.jsxs("div",{children:[p,u]}):null,b]}):e.jsxs(e.Fragment,{children:[u,p]})]})},l=x.forwardRef(z);l.spiritComponent="TextFieldBase";l.displayName="TextFieldBase";exports.default=l;
2
2
  //# sourceMappingURL=TextFieldBase.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextFieldBase.cjs","sources":["../../../src/components/TextFieldBase/TextFieldBase.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { Sizes } from '../../constants';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport {\n type ForwardRefComponent,\n type SpiritTextFieldBaseProps,\n type TextFieldBasePasswordToggleProps,\n} from '../../types';\nimport { HelperText, Label, ValidationText, useAriaIds } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport TextFieldBaseInput from './TextFieldBaseInput';\nimport { useTextFieldBaseStyleProps } from './useTextFieldBaseStyleProps';\nimport withPasswordToggle from './withPasswordToggle';\n\nconst TextFieldBaseInputWithPasswordToggle = forwardRef(\n withPasswordToggle<TextFieldBasePasswordToggleProps>(TextFieldBaseInput),\n);\n\nconst _TextFieldBase = (props: SpiritTextFieldBaseProps, ref: ForwardedRef<HTMLInputElement | HTMLTextAreaElement>) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n hasValidationIcon,\n helperText,\n id,\n label,\n size = Sizes.MEDIUM,\n validationState,\n validationText,\n ...restProps\n } = props;\n const { classProps, props: modifiedProps } = useTextFieldBaseStyleProps({\n id,\n size,\n validationState,\n ...restProps,\n });\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\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 {...styleProps} className={classNames(classProps.root, styleProps.className)}>\n <Label htmlFor={id} UNSAFE_className={classProps.label}>\n {label}\n </Label>\n <TextFieldBaseInputWithPasswordToggle {...otherProps} {...ariaDescribedByProp} id={id} ref={ref} size={size} />\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 elementType=\"span\"\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__validationText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n );\n};\n\nconst TextFieldBase = forwardRef<HTMLInputElement | HTMLTextAreaElement, SpiritTextFieldBaseProps>(\n _TextFieldBase,\n) as ForwardRefComponent<HTMLInputElement | HTMLTextAreaElement, SpiritTextFieldBaseProps>;\n\nTextFieldBase.spiritComponent = 'TextFieldBase';\nTextFieldBase.displayName = 'TextFieldBase';\n\nexport default TextFieldBase;\n"],"names":["TextFieldBaseInputWithPasswordToggle","forwardRef","withPasswordToggle","TextFieldBaseInput","_TextFieldBase","props","ref","ariaDescribedBy","hasValidationIcon","helperText","id","label","size","Sizes","validationState","validationText","restProps","classProps","modifiedProps","useTextFieldBaseStyleProps","styleProps","otherProps","useStyleProps","ids","register","useAriaIds","ariaDescribedByProp","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","Label","HelperText","ValidationText","TextFieldBase"],"mappings":"4oBAiBMA,EAAuCC,EAAAA,WAC3CC,EAAAA,QAAqDC,EAAAA,OAAkB,CACzE,EAEMC,EAAiB,CAACC,EAAiCC,IAA8D,CACrH,KAAM,CACJ,mBAAoBC,EAAkB,GACtC,kBAAAC,EACA,WAAAC,EACA,GAAAC,EACA,MAAAC,EACA,KAAAC,EAAOC,EAAAA,MAAM,OACb,gBAAAC,EACA,eAAAC,EACA,GAAGC,CAAA,EACDX,EACE,CAAE,WAAAY,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,2BAA2B,CACtE,GAAAT,EACA,KAAAE,EACA,gBAAAE,EACA,GAAGE,CAAA,CACJ,EACK,CAAA,WAAEI,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcJ,CAAa,EAC/D,CAACK,EAAKC,CAAQ,EAAIC,EAAAA,QAAWlB,CAAe,EAC5CmB,EAAsBC,EAAAA,mBAAmBJ,CAAG,EAC5CK,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAf,EACA,eAAAC,CAAA,CACD,EAED,OACEe,OAAC,MAAA,CAAK,GAAGV,EAAY,UAAWW,EAAWd,EAAW,KAAMG,EAAW,SAAS,EAC9E,SAAA,CAAAY,MAACC,EAAAA,SAAM,QAASvB,EAAI,iBAAkBO,EAAW,MAC9C,SAAAN,EACH,EACAqB,MAAChC,GAAsC,GAAGqB,EAAa,GAAGK,EAAqB,GAAAhB,EAAQ,IAAAJ,EAAU,KAAAM,EAAY,EAC7GoB,EAAAA,IAACE,EAAAA,QAAA,CACC,iBAAkBjB,EAAW,WAC7B,GAAI,GAAGP,CAAE,eACT,aAAcc,EACd,WAAAf,CAAA,CAAA,EAEDK,GACCkB,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBlB,EAAW,eAC7B,YAAY,OACX,GAAIT,GAAqB,CAAE,uBAAwBM,CAAA,EACpD,GAAI,GAAGJ,CAAE,mBACT,eAAAK,EACA,aAAcS,EACd,KAAMI,CAAA,CAAA,CACR,EAEJ,CAEJ,EAEMQ,EAAgBnC,EAAAA,WACpBG,CACF,EAEAgC,EAAc,gBAAkB,gBAChCA,EAAc,YAAc"}
1
+ {"version":3,"file":"TextFieldBase.cjs","sources":["../../../src/components/TextFieldBase/TextFieldBase.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { Sizes } from '../../constants';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport {\n type ForwardRefComponent,\n type SpiritTextFieldBaseProps,\n type TextFieldBasePasswordToggleProps,\n} from '../../types';\nimport { CharacterCounter } from '../CharacterCounter';\nimport { HelperText, Label, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { Flex } from '../Flex';\nimport TextFieldBaseInput from './TextFieldBaseInput';\nimport { useTextFieldBaseStyleProps } from './useTextFieldBaseStyleProps';\nimport withPasswordToggle from './withPasswordToggle';\n\nconst TextFieldBaseInputWithPasswordToggle = forwardRef(\n withPasswordToggle<TextFieldBasePasswordToggleProps>(TextFieldBaseInput),\n);\n\nconst _TextFieldBase = (props: SpiritTextFieldBaseProps, ref: ForwardedRef<HTMLInputElement | HTMLTextAreaElement>) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n counterProps,\n hasValidationIcon,\n helperText,\n id,\n label,\n size = Sizes.MEDIUM,\n validationState,\n validationText,\n ...restProps\n } = props;\n const { classProps, props: modifiedProps } = useTextFieldBaseStyleProps({\n id,\n size,\n validationState,\n ...restProps,\n });\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n const hasTextContent = helperText || (validationState && validationText);\n\n const helperTextElement = (\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helper-text`}\n registerAria={register}\n helperText={helperText}\n />\n );\n\n const validationTextElement = validationState ? (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n elementType=\"span\"\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__validation-text`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n ) : null;\n\n const counterElement = counterProps ? (\n <CharacterCounter {...counterProps} id={id} registerAria={register} UNSAFE_className={classProps.counter} />\n ) : null;\n\n return (\n <div {...styleProps} className={classNames(classProps.root, styleProps.className)}>\n <Label htmlFor={id} UNSAFE_className={classProps.label}>\n {label}\n </Label>\n <TextFieldBaseInputWithPasswordToggle {...otherProps} {...ariaDescribedByProp} id={id} ref={ref} size={size} />\n {counterProps ? (\n <Flex direction=\"horizontal\" isWrapping={false} alignmentX=\"space-between\" alignmentY=\"top\">\n {hasTextContent ? (\n <div>\n {/* In counter layout, put validation first so the status message stays visually closest to the counter row. */}\n {validationTextElement}\n {helperTextElement}\n </div>\n ) : null}\n {counterElement}\n </Flex>\n ) : (\n <>\n {/* Without counter, keep the default field text flow: helper first, then validation. */}\n {helperTextElement}\n {validationTextElement}\n </>\n )}\n </div>\n );\n};\n\nconst TextFieldBase = forwardRef<HTMLInputElement | HTMLTextAreaElement, SpiritTextFieldBaseProps>(\n _TextFieldBase,\n) as ForwardRefComponent<HTMLInputElement | HTMLTextAreaElement, SpiritTextFieldBaseProps>;\n\nTextFieldBase.spiritComponent = 'TextFieldBase';\nTextFieldBase.displayName = 'TextFieldBase';\n\nexport default TextFieldBase;\n"],"names":["TextFieldBaseInputWithPasswordToggle","forwardRef","withPasswordToggle","TextFieldBaseInput","_TextFieldBase","props","ref","ariaDescribedBy","counterProps","hasValidationIcon","helperText","id","label","size","Sizes","validationState","validationText","restProps","classProps","modifiedProps","useTextFieldBaseStyleProps","styleProps","otherProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","validationTextRole","useValidationTextRole","hasTextContent","helperTextElement","jsx","HelperText","validationTextElement","ValidationText","counterElement","CharacterCounter","jsxs","classNames","Label","Flex","Fragment","TextFieldBase"],"mappings":"srBAmBMA,EAAuCC,EAAAA,WAC3CC,EAAAA,QAAqDC,EAAAA,OAAkB,CACzE,EAEMC,EAAiB,CAACC,EAAiCC,IAA8D,CACrH,KAAM,CACJ,mBAAoBC,EAAkB,GACtC,aAAAC,EACA,kBAAAC,EACA,WAAAC,EACA,GAAAC,EACA,MAAAC,EACA,KAAAC,EAAOC,EAAAA,MAAM,OACb,gBAAAC,EACA,eAAAC,EACA,GAAGC,CAAA,EACDZ,EACE,CAAE,WAAAa,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,2BAA2B,CACtE,GAAAT,EACA,KAAAE,EACA,gBAAAE,EACA,GAAGE,CAAA,CACJ,EACK,CAAA,WAAEI,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcJ,CAAa,EAC/D,CAACK,EAAqBC,CAAQ,EAAIC,EAAAA,mBAAmBnB,CAAe,EACpEoB,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAb,EACA,eAAAC,CAAA,CACD,EAEKa,EAAiBnB,GAAeK,GAAmBC,EAEnDc,EACJC,EAAAA,IAACC,EAAAA,QAAA,CACC,iBAAkBd,EAAW,WAC7B,GAAI,GAAGP,CAAE,gBACT,aAAcc,EACd,WAAAf,CAAA,CAAA,EAIEuB,EAAwBlB,EAC5BgB,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBhB,EAAW,eAC7B,YAAY,OACX,GAAIT,GAAqB,CAAE,uBAAwBM,CAAA,EACpD,GAAI,GAAGJ,CAAE,oBACT,eAAAK,EACA,aAAcS,EACd,KAAME,CAAA,CAAA,EAEN,KAEEQ,EAAiB3B,EACrBuB,EAAAA,IAACK,EAAAA,QAAA,CAAkB,GAAG5B,EAAc,GAAAG,EAAQ,aAAcc,EAAU,iBAAkBP,EAAW,OAAA,CAAS,EACxG,KAEJ,OACEmB,OAAC,MAAA,CAAK,GAAGhB,EAAY,UAAWiB,EAAWpB,EAAW,KAAMG,EAAW,SAAS,EAC9E,SAAA,CAAAU,MAACQ,EAAAA,SAAM,QAAS5B,EAAI,iBAAkBO,EAAW,MAC9C,SAAAN,EACH,EACAmB,MAAC/B,GAAsC,GAAGsB,EAAa,GAAGE,EAAqB,GAAAb,EAAQ,IAAAL,EAAU,KAAAO,EAAY,EAC5GL,EACC6B,EAAAA,KAACG,EAAAA,QAAA,CAAK,UAAU,aAAa,WAAY,GAAO,WAAW,gBAAgB,WAAW,MACnF,SAAA,CAAAX,SACE,MAAA,CAEE,SAAA,CAAAI,EACAH,CAAA,CAAA,CACH,EACE,KACHK,CAAA,CAAA,CACH,EAEAE,EAAAA,KAAAI,EAAAA,SAAA,CAEG,SAAA,CAAAX,EACAG,CAAA,CAAA,CACH,CAAA,EAEJ,CAEJ,EAEMS,EAAgBzC,EAAAA,WACpBG,CACF,EAEAsC,EAAc,gBAAkB,gBAChCA,EAAc,YAAc"}