@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 +1 @@
1
- {"version":3,"file":"Link.js","sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useStyleProps } from '../../hooks';\nimport { type LinkProps, type PolymorphicComponent, type PolymorphicRef, type SpiritLinkProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useLinkStyleProps } from './useLinkStyleProps';\n\nconst defaultProps = {\n elementType: 'a',\n color: 'primary',\n hasVisitedStyleAllowed: false,\n underlined: 'hover',\n};\n\nconst _Link = <E extends ElementType = 'a', C = void>(\n props: SpiritLinkProps<E, C>,\n ref: PolymorphicRef<E>,\n): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = defaultProps.elementType, children, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { classProps, props: modifiedProps } = useLinkStyleProps(restProps);\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps, styleProps, otherProps });\n\n return (\n <Component {...otherProps} {...mergedStyleProps} href={restProps.href} ref={ref}>\n {children}\n </Component>\n );\n};\n\nconst Link = forwardRef<HTMLAnchorElement, SpiritLinkProps<'a', void>>(_Link) as unknown as PolymorphicComponent<\n 'a',\n LinkProps<void>\n>;\n\nLink.spiritComponent = 'Link';\nLink.displayName = 'Link';\n\nexport default Link;\n"],"names":["defaultProps","_Link","props","ref","propsWithDefaults","elementType","children","restProps","Component","classProps","modifiedProps","useLinkStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","jsx","Link","forwardRef"],"mappings":";;;;;;AAQA,MAAMA,IAAe;AAAA,EACnB,aAAa;AAAA,EACb,OAAO;AAAA,EACP,wBAAwB;AAAA,EACxB,YAAY;AACd,GAEMC,IAAQ,CACZC,GACAC,MACgB;AAChB,QAAMC,IAAoB,EAAE,GAAGJ,GAAc,GAAGE,EAAA,GAC1C,EAAE,aAAAG,IAAcL,EAAa,aAAa,UAAAM,GAAU,GAAGC,MAAcH,GAErEI,IAAYH,GAEZ,EAAE,YAAAI,GAAY,OAAOC,EAAA,IAAkBC,EAAkBJ,CAAS,GAClE,EAAE,YAAAK,GAAY,OAAOC,EAAA,IAAeC,EAAcJ,CAAa,GAC/DK,IAAmBC,EAAgBR,GAAW,EAAE,YAAAC,GAAY,YAAAG,GAAY,YAAAC,GAAY;AAE1F,SACE,gBAAAI,EAACT,GAAA,EAAW,GAAGK,GAAa,GAAGE,GAAkB,MAAMR,EAAU,MAAM,KAAAJ,GACpE,UAAAG,EAAA,CACH;AAEJ,GAEMY,IAAOC,EAA0DlB,CAAK;AAK5EiB,EAAK,kBAAkB;AACvBA,EAAK,cAAc;"}
1
+ {"version":3,"file":"Link.js","sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useLinkClick, useStyleProps } from '../../hooks';\nimport { type LinkProps, type PolymorphicComponent, type PolymorphicRef, type SpiritLinkProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useLinkStyleProps } from './useLinkStyleProps';\n\nconst defaultProps = {\n elementType: 'a',\n color: 'primary',\n hasVisitedStyleAllowed: false,\n underlined: 'hover',\n};\n\nconst _Link = <E extends ElementType = 'a', C = void>(\n props: SpiritLinkProps<E, C>,\n ref: PolymorphicRef<E>,\n): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = defaultProps.elementType, children, routerOptions, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { classProps, props: modifiedProps } = useLinkStyleProps(restProps);\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps, styleProps, otherProps });\n\n const handleClick = useLinkClick({ ...restProps, routerOptions });\n\n return (\n <Component {...otherProps} {...mergedStyleProps} onClick={handleClick} ref={ref}>\n {children}\n </Component>\n );\n};\n\nconst Link = forwardRef<HTMLAnchorElement, SpiritLinkProps<'a', void>>(_Link) as unknown as PolymorphicComponent<\n 'a',\n LinkProps<void>\n>;\n\nLink.spiritComponent = 'Link';\nLink.displayName = 'Link';\n\nexport default Link;\n"],"names":["defaultProps","_Link","props","ref","propsWithDefaults","elementType","children","routerOptions","restProps","Component","classProps","modifiedProps","useLinkStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","handleClick","useLinkClick","jsx","Link","forwardRef"],"mappings":";;;;;;;AAQA,MAAMA,IAAe;AAAA,EACnB,aAAa;AAAA,EACb,OAAO;AAAA,EACP,wBAAwB;AAAA,EACxB,YAAY;AACd,GAEMC,IAAQ,CACZC,GACAC,MACgB;AAChB,QAAMC,IAAoB,EAAE,GAAGJ,GAAc,GAAGE,EAAA,GAC1C,EAAE,aAAAG,IAAcL,EAAa,aAAa,UAAAM,GAAU,eAAAC,GAAe,GAAGC,MAAcJ,GAEpFK,IAAYJ,GAEZ,EAAE,YAAAK,GAAY,OAAOC,EAAA,IAAkBC,EAAkBJ,CAAS,GAClE,EAAE,YAAAK,GAAY,OAAOC,EAAA,IAAeC,EAAcJ,CAAa,GAC/DK,IAAmBC,EAAgBR,GAAW,EAAE,YAAAC,GAAY,YAAAG,GAAY,YAAAC,GAAY,GAEpFI,IAAcC,EAAa,EAAE,GAAGX,GAAW,eAAAD,GAAe;AAEhE,SACE,gBAAAa,EAACX,KAAW,GAAGK,GAAa,GAAGE,GAAkB,SAASE,GAAa,KAAAf,GACpE,UAAAG,GACH;AAEJ,GAEMe,IAAOC,EAA0DrB,CAAK;AAK5EoB,EAAK,kBAAkB;AACvBA,EAAK,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useLinkStyleProps.cjs","sources":["../../../src/components/Link/useLinkStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type LinkProps, type LinkStyleProps, UNDERLINED_OPTIONS } from '../../types';\n\nexport function useLinkStyleProps<C = void>(props: LinkStyleProps<C>) {\n const { color, hasVisitedStyleAllowed, isDisabled, underlined, ...restProps } = props;\n\n const linkClass = useClassNamePrefix('link');\n const linkColorClass = `${linkClass}-${color}`;\n const linkDisabledClass = `${linkClass}-disabled`;\n const linkUnderlinedClass = `${linkClass}-underlined`;\n const linkNotUnderlinedClass = `${linkClass}-not-underlined`;\n const linkVisitedStyleAllowedClass = `${linkClass}-allow-visited-style`;\n\n const className = classNames(linkColorClass, {\n [linkDisabledClass]: isDisabled,\n [linkUnderlinedClass]: underlined === UNDERLINED_OPTIONS.ALWAYS,\n [linkNotUnderlinedClass]: underlined === UNDERLINED_OPTIONS.NEVER,\n [linkVisitedStyleAllowedClass]: hasVisitedStyleAllowed,\n });\n\n return {\n classProps: className,\n props: restProps as Partial<LinkProps<C>>,\n };\n}\n"],"names":["useLinkStyleProps","props","color","hasVisitedStyleAllowed","isDisabled","underlined","restProps","linkClass","useClassNamePrefix","linkColorClass","linkDisabledClass","linkUnderlinedClass","linkNotUnderlinedClass","linkVisitedStyleAllowedClass","classNames","UNDERLINED_OPTIONS"],"mappings":"gMAIO,SAASA,EAA4BC,EAA0B,CACpE,KAAM,CAAE,MAAAC,EAAO,uBAAAC,EAAwB,WAAAC,EAAY,WAAAC,EAAY,GAAGC,GAAcL,EAE1EM,EAAYC,EAAAA,mBAAmB,MAAM,EACrCC,EAAiB,GAAGF,CAAS,IAAIL,CAAK,GACtCQ,EAAoB,GAAGH,CAAS,YAChCI,EAAsB,GAAGJ,CAAS,cAClCK,EAAyB,GAAGL,CAAS,kBACrCM,EAA+B,GAAGN,CAAS,uBASjD,MAAO,CACL,WARgBO,EAAWL,EAAgB,CAC3C,CAACC,CAAiB,EAAGN,EACrB,CAACO,CAAmB,EAAGN,IAAeU,EAAAA,mBAAmB,OACzD,CAACH,CAAsB,EAAGP,IAAeU,EAAAA,mBAAmB,MAC5D,CAACF,CAA4B,EAAGV,CAAA,CACjC,EAIC,MAAOG,CAAA,CAEX"}
1
+ {"version":3,"file":"useLinkStyleProps.cjs","sources":["../../../src/components/Link/useLinkStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type LinkProps, type LinkStyleProps, UNDERLINED_OPTIONS } from '../../types';\n\nexport function useLinkStyleProps<C = void>(props: Omit<LinkStyleProps<C>, 'routerOptions'>) {\n const { color, hasVisitedStyleAllowed, isDisabled, underlined, ...restProps } = props;\n\n const linkClass = useClassNamePrefix('link');\n const linkColorClass = `${linkClass}-${color}`;\n const linkDisabledClass = `${linkClass}-disabled`;\n const linkUnderlinedClass = `${linkClass}-underlined`;\n const linkNotUnderlinedClass = `${linkClass}-not-underlined`;\n const linkVisitedStyleAllowedClass = `${linkClass}-allow-visited-style`;\n\n const className = classNames(linkColorClass, {\n [linkDisabledClass]: isDisabled,\n [linkUnderlinedClass]: underlined === UNDERLINED_OPTIONS.ALWAYS,\n [linkNotUnderlinedClass]: underlined === UNDERLINED_OPTIONS.NEVER,\n [linkVisitedStyleAllowedClass]: hasVisitedStyleAllowed,\n });\n\n return {\n classProps: className,\n props: restProps as Partial<LinkProps<C>>,\n };\n}\n"],"names":["useLinkStyleProps","props","color","hasVisitedStyleAllowed","isDisabled","underlined","restProps","linkClass","useClassNamePrefix","linkColorClass","linkDisabledClass","linkUnderlinedClass","linkNotUnderlinedClass","linkVisitedStyleAllowedClass","classNames","UNDERLINED_OPTIONS"],"mappings":"gMAIO,SAASA,EAA4BC,EAAiD,CAC3F,KAAM,CAAE,MAAAC,EAAO,uBAAAC,EAAwB,WAAAC,EAAY,WAAAC,EAAY,GAAGC,GAAcL,EAE1EM,EAAYC,EAAAA,mBAAmB,MAAM,EACrCC,EAAiB,GAAGF,CAAS,IAAIL,CAAK,GACtCQ,EAAoB,GAAGH,CAAS,YAChCI,EAAsB,GAAGJ,CAAS,cAClCK,EAAyB,GAAGL,CAAS,kBACrCM,EAA+B,GAAGN,CAAS,uBASjD,MAAO,CACL,WARgBO,EAAWL,EAAgB,CAC3C,CAACC,CAAiB,EAAGN,EACrB,CAACO,CAAmB,EAAGN,IAAeU,EAAAA,mBAAmB,OACzD,CAACH,CAAsB,EAAGP,IAAeU,EAAAA,mBAAmB,MAC5D,CAACF,CAA4B,EAAGV,CAAA,CACjC,EAIC,MAAOG,CAAA,CAEX"}
@@ -1,5 +1,5 @@
1
1
  import { LinkProps, LinkStyleProps } from '../../types';
2
- export declare function useLinkStyleProps<C = void>(props: LinkStyleProps<C>): {
2
+ export declare function useLinkStyleProps<C = void>(props: Omit<LinkStyleProps<C>, 'routerOptions'>): {
3
3
  classProps: string;
4
4
  props: Partial<LinkProps<C>>;
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useLinkStyleProps.js","sources":["../../../src/components/Link/useLinkStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type LinkProps, type LinkStyleProps, UNDERLINED_OPTIONS } from '../../types';\n\nexport function useLinkStyleProps<C = void>(props: LinkStyleProps<C>) {\n const { color, hasVisitedStyleAllowed, isDisabled, underlined, ...restProps } = props;\n\n const linkClass = useClassNamePrefix('link');\n const linkColorClass = `${linkClass}-${color}`;\n const linkDisabledClass = `${linkClass}-disabled`;\n const linkUnderlinedClass = `${linkClass}-underlined`;\n const linkNotUnderlinedClass = `${linkClass}-not-underlined`;\n const linkVisitedStyleAllowedClass = `${linkClass}-allow-visited-style`;\n\n const className = classNames(linkColorClass, {\n [linkDisabledClass]: isDisabled,\n [linkUnderlinedClass]: underlined === UNDERLINED_OPTIONS.ALWAYS,\n [linkNotUnderlinedClass]: underlined === UNDERLINED_OPTIONS.NEVER,\n [linkVisitedStyleAllowedClass]: hasVisitedStyleAllowed,\n });\n\n return {\n classProps: className,\n props: restProps as Partial<LinkProps<C>>,\n };\n}\n"],"names":["useLinkStyleProps","props","color","hasVisitedStyleAllowed","isDisabled","underlined","restProps","linkClass","useClassNamePrefix","linkColorClass","linkDisabledClass","linkUnderlinedClass","linkNotUnderlinedClass","linkVisitedStyleAllowedClass","classNames","UNDERLINED_OPTIONS"],"mappings":";;;AAIO,SAASA,EAA4BC,GAA0B;AACpE,QAAM,EAAE,OAAAC,GAAO,wBAAAC,GAAwB,YAAAC,GAAY,YAAAC,GAAY,GAAGC,MAAcL,GAE1EM,IAAYC,EAAmB,MAAM,GACrCC,IAAiB,GAAGF,CAAS,IAAIL,CAAK,IACtCQ,IAAoB,GAAGH,CAAS,aAChCI,IAAsB,GAAGJ,CAAS,eAClCK,IAAyB,GAAGL,CAAS,mBACrCM,IAA+B,GAAGN,CAAS;AASjD,SAAO;AAAA,IACL,YARgBO,EAAWL,GAAgB;AAAA,MAC3C,CAACC,CAAiB,GAAGN;AAAA,MACrB,CAACO,CAAmB,GAAGN,MAAeU,EAAmB;AAAA,MACzD,CAACH,CAAsB,GAAGP,MAAeU,EAAmB;AAAA,MAC5D,CAACF,CAA4B,GAAGV;AAAA,IAAA,CACjC;AAAA,IAIC,OAAOG;AAAA,EAAA;AAEX;"}
1
+ {"version":3,"file":"useLinkStyleProps.js","sources":["../../../src/components/Link/useLinkStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type LinkProps, type LinkStyleProps, UNDERLINED_OPTIONS } from '../../types';\n\nexport function useLinkStyleProps<C = void>(props: Omit<LinkStyleProps<C>, 'routerOptions'>) {\n const { color, hasVisitedStyleAllowed, isDisabled, underlined, ...restProps } = props;\n\n const linkClass = useClassNamePrefix('link');\n const linkColorClass = `${linkClass}-${color}`;\n const linkDisabledClass = `${linkClass}-disabled`;\n const linkUnderlinedClass = `${linkClass}-underlined`;\n const linkNotUnderlinedClass = `${linkClass}-not-underlined`;\n const linkVisitedStyleAllowedClass = `${linkClass}-allow-visited-style`;\n\n const className = classNames(linkColorClass, {\n [linkDisabledClass]: isDisabled,\n [linkUnderlinedClass]: underlined === UNDERLINED_OPTIONS.ALWAYS,\n [linkNotUnderlinedClass]: underlined === UNDERLINED_OPTIONS.NEVER,\n [linkVisitedStyleAllowedClass]: hasVisitedStyleAllowed,\n });\n\n return {\n classProps: className,\n props: restProps as Partial<LinkProps<C>>,\n };\n}\n"],"names":["useLinkStyleProps","props","color","hasVisitedStyleAllowed","isDisabled","underlined","restProps","linkClass","useClassNamePrefix","linkColorClass","linkDisabledClass","linkUnderlinedClass","linkNotUnderlinedClass","linkVisitedStyleAllowedClass","classNames","UNDERLINED_OPTIONS"],"mappings":";;;AAIO,SAASA,EAA4BC,GAAiD;AAC3F,QAAM,EAAE,OAAAC,GAAO,wBAAAC,GAAwB,YAAAC,GAAY,YAAAC,GAAY,GAAGC,MAAcL,GAE1EM,IAAYC,EAAmB,MAAM,GACrCC,IAAiB,GAAGF,CAAS,IAAIL,CAAK,IACtCQ,IAAoB,GAAGH,CAAS,aAChCI,IAAsB,GAAGJ,CAAS,eAClCK,IAAyB,GAAGL,CAAS,mBACrCM,IAA+B,GAAGN,CAAS;AASjD,SAAO;AAAA,IACL,YARgBO,EAAWL,GAAgB;AAAA,MAC3C,CAACC,CAAiB,GAAGN;AAAA,MACrB,CAACO,CAAmB,GAAGN,MAAeU,EAAmB;AAAA,MACzD,CAACH,CAAsB,GAAGP,MAAeU,EAAmB;AAAA,MAC5D,CAACF,CAA4B,GAAGV;AAAA,IAAA,CACjC;AAAA,IAIC,OAAOG;AAAA,EAAA;AAEX;"}
@@ -1,2 +1,2 @@
1
- "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),m=require("react"),S=require("../../hooks/styleProps.cjs"),q=require("../../hooks/useI18n.cjs"),b=require("../../utils/mergeStyleProps.cjs"),L=require("../VisuallyHidden/VisuallyHidden.cjs"),f=require("./usePaginationStyleProps.cjs"),h=(i,a)=>{const{t:l}=q.useI18n(),{elementType:u="a",accessibilityLabel:c,isCurrent:t,pageNumber:n,...p}=i,P=c||`${l("pagination.goToPage")} ${n}`,r=u,{classProps:d}=f.usePaginationStyleProps({isCurrent:t}),{styleProps:g,props:o}=S.useStyleProps(p),y=b.mergeStyleProps(r,{classProps:d.link,styleProps:g,otherProps:o});return e.jsxs(r,{...t&&{"aria-current":"page"},...o,...y,ref:a,children:[e.jsx(L.default,{children:P}),e.jsx("span",{"aria-hidden":"true",children:n})]})},s=m.forwardRef(h);s.spiritComponent="PaginationLink";s.displayName="PaginationLink";exports.default=s;
1
+ "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),q=require("react"),L=require("../../hooks/styleProps.cjs"),S=require("../../hooks/useI18n.cjs"),C=require("../../hooks/useLinkClick.cjs"),b=require("../../utils/mergeStyleProps.cjs"),h=require("../VisuallyHidden/VisuallyHidden.cjs"),f=require("./usePaginationStyleProps.cjs"),j=(a,l)=>{const{t:c}=S.useI18n(),{elementType:u="a",accessibilityLabel:p,isCurrent:n,pageNumber:t,routerOptions:P,...r}=a,d=p||`${c("pagination.goToPage")} ${t}`,i=u,{classProps:g}=f.usePaginationStyleProps({isCurrent:n}),{styleProps:y,props:o}=L.useStyleProps(r),k=b.mergeStyleProps(i,{classProps:g.link,styleProps:y,otherProps:o}),m=C.useLinkClick({...r,routerOptions:P});return e.jsxs(i,{...n&&{"aria-current":"page"},...o,...k,onClick:m,ref:l,children:[e.jsx(h.default,{children:d}),e.jsx("span",{"aria-hidden":"true",children:t})]})},s=q.forwardRef(j);s.spiritComponent="PaginationLink";s.displayName="PaginationLink";exports.default=s;
2
2
  //# sourceMappingURL=PaginationLink.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaginationLink.cjs","sources":["../../../src/components/Pagination/PaginationLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useI18n, useStyleProps } from '../../hooks';\nimport { type PolymorphicComponent, type PolymorphicRef, type SpiritPaginationLinkProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { usePaginationStyleProps } from './usePaginationStyleProps';\n\nconst _PaginationLink = <E extends ElementType = 'a'>(props: SpiritPaginationLinkProps<E>, ref: PolymorphicRef<E>) => {\n const { t } = useI18n();\n const { elementType = 'a', accessibilityLabel, isCurrent, pageNumber, ...restProps } = props;\n const visuallyHiddenLabel = accessibilityLabel || `${t('pagination.goToPage')} ${pageNumber}`;\n\n const Component = elementType as ElementType;\n\n const { classProps } = usePaginationStyleProps({ isCurrent });\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link, styleProps, otherProps });\n\n return (\n <Component {...(isCurrent && { 'aria-current': 'page' })} {...otherProps} {...mergedStyleProps} ref={ref}>\n <VisuallyHidden>{visuallyHiddenLabel}</VisuallyHidden>\n <span aria-hidden=\"true\">{pageNumber}</span>\n </Component>\n );\n};\n\nconst PaginationLink = forwardRef<HTMLAnchorElement, SpiritPaginationLinkProps<'a'>>(\n _PaginationLink,\n) as unknown as PolymorphicComponent<'a', SpiritPaginationLinkProps<ElementType>>;\n\nPaginationLink.spiritComponent = 'PaginationLink';\nPaginationLink.displayName = 'PaginationLink';\n\nexport default PaginationLink;\n"],"names":["_PaginationLink","props","ref","t","useI18n","elementType","accessibilityLabel","isCurrent","pageNumber","restProps","visuallyHiddenLabel","Component","classProps","usePaginationStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","jsxs","jsx","VisuallyHidden","PaginationLink","forwardRef"],"mappings":"wYASMA,EAAkB,CAA8BC,EAAqCC,IAA2B,CACpH,KAAM,CAAE,EAAAC,CAAA,EAAMC,UAAA,EACR,CAAE,YAAAC,EAAc,IAAK,mBAAAC,EAAoB,UAAAC,EAAW,WAAAC,EAAY,GAAGC,GAAcR,EACjFS,EAAsBJ,GAAsB,GAAGH,EAAE,qBAAqB,CAAC,IAAIK,CAAU,GAErFG,EAAYN,EAEZ,CAAE,WAAAO,CAAA,EAAeC,0BAAwB,CAAE,UAAAN,EAAW,EACtD,CAAA,WAAEO,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcP,CAAS,EAC3DQ,EAAmBC,kBAAgBP,EAAW,CAAE,WAAYC,EAAW,KAAA,WAAME,EAAY,WAAAC,EAAY,EAE3G,OACEI,EAAAA,KAACR,EAAA,CAAW,GAAIJ,GAAa,CAAE,eAAgB,MAAA,EAAY,GAAGQ,EAAa,GAAGE,EAAkB,IAAAf,EAC9F,SAAA,CAAAkB,EAAAA,IAACC,EAAAA,SAAgB,SAAAX,CAAA,CAAoB,EACrCU,EAAAA,IAAC,OAAA,CAAK,cAAY,OAAQ,SAAAZ,CAAA,CAAW,CAAA,EACvC,CAEJ,EAEMc,EAAiBC,EAAAA,WACrBvB,CACF,EAEAsB,EAAe,gBAAkB,iBACjCA,EAAe,YAAc"}
1
+ {"version":3,"file":"PaginationLink.cjs","sources":["../../../src/components/Pagination/PaginationLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useI18n, useLinkClick, useStyleProps } from '../../hooks';\nimport { type PolymorphicComponent, type PolymorphicRef, type SpiritPaginationLinkProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { usePaginationStyleProps } from './usePaginationStyleProps';\n\nconst _PaginationLink = <E extends ElementType = 'a'>(props: SpiritPaginationLinkProps<E>, ref: PolymorphicRef<E>) => {\n const { t } = useI18n();\n const { elementType = 'a', accessibilityLabel, isCurrent, pageNumber, routerOptions, ...restProps } = props;\n const visuallyHiddenLabel = accessibilityLabel || `${t('pagination.goToPage')} ${pageNumber}`;\n\n const Component = elementType as ElementType;\n\n const { classProps } = usePaginationStyleProps({ isCurrent });\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link, styleProps, otherProps });\n\n const handleClick = useLinkClick({ ...restProps, routerOptions });\n\n return (\n <Component\n {...(isCurrent && { 'aria-current': 'page' })}\n {...otherProps}\n {...mergedStyleProps}\n onClick={handleClick}\n ref={ref}\n >\n <VisuallyHidden>{visuallyHiddenLabel}</VisuallyHidden>\n <span aria-hidden=\"true\">{pageNumber}</span>\n </Component>\n );\n};\n\nconst PaginationLink = forwardRef<HTMLAnchorElement, SpiritPaginationLinkProps<'a'>>(\n _PaginationLink,\n) as unknown as PolymorphicComponent<'a', SpiritPaginationLinkProps<ElementType>>;\n\nPaginationLink.spiritComponent = 'PaginationLink';\nPaginationLink.displayName = 'PaginationLink';\n\nexport default PaginationLink;\n"],"names":["_PaginationLink","props","ref","t","useI18n","elementType","accessibilityLabel","isCurrent","pageNumber","routerOptions","restProps","visuallyHiddenLabel","Component","classProps","usePaginationStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","handleClick","useLinkClick","jsxs","jsx","VisuallyHidden","PaginationLink","forwardRef"],"mappings":"kbASMA,EAAkB,CAA8BC,EAAqCC,IAA2B,CACpH,KAAM,CAAE,EAAAC,CAAA,EAAMC,UAAA,EACR,CAAE,YAAAC,EAAc,IAAK,mBAAAC,EAAoB,UAAAC,EAAW,WAAAC,EAAY,cAAAC,EAAe,GAAGC,CAAA,EAAcT,EAChGU,EAAsBL,GAAsB,GAAGH,EAAE,qBAAqB,CAAC,IAAIK,CAAU,GAErFI,EAAYP,EAEZ,CAAE,WAAAQ,CAAA,EAAeC,0BAAwB,CAAE,UAAAP,EAAW,EACtD,CAAA,WAAEQ,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcP,CAAS,EAC3DQ,EAAmBC,kBAAgBP,EAAW,CAAE,WAAYC,EAAW,KAAA,WAAME,EAAY,WAAAC,EAAY,EAErGI,EAAcC,EAAAA,aAAa,CAAE,GAAGX,EAAW,cAAAD,EAAe,EAEhE,OACEa,EAAAA,KAACV,EAAA,CACE,GAAIL,GAAa,CAAE,eAAgB,MAAA,EACnC,GAAGS,EACH,GAAGE,EACJ,QAASE,EACT,IAAAlB,EAEA,SAAA,CAAAqB,EAAAA,IAACC,EAAAA,SAAgB,SAAAb,CAAA,CAAoB,EACrCY,EAAAA,IAAC,OAAA,CAAK,cAAY,OAAQ,SAAAf,CAAA,CAAW,CAAA,CAAA,CAAA,CAG3C,EAEMiB,EAAiBC,EAAAA,WACrB1B,CACF,EAEAyB,EAAe,gBAAkB,iBACjCA,EAAe,YAAc"}
@@ -1,23 +1,34 @@
1
1
  "use client";
2
- import { jsxs as f, jsx as i } from "react/jsx-runtime";
3
- import { forwardRef as y } from "react";
4
- import { useStyleProps as L } from "../../hooks/styleProps.js";
5
- import { useI18n as h } from "../../hooks/useI18n.js";
6
- import { mergeStyleProps as k } from "../../utils/mergeStyleProps.js";
7
- import b from "../VisuallyHidden/VisuallyHidden.js";
8
- import { usePaginationStyleProps as S } from "./usePaginationStyleProps.js";
9
- const x = (s, a) => {
10
- const { t: p } = h(), { elementType: l = "a", accessibilityLabel: m, isCurrent: o, pageNumber: r, ...c } = s, P = m || `${p("pagination.goToPage")} ${r}`, e = l, { classProps: d } = S({ isCurrent: o }), { styleProps: u, props: t } = L(c), g = k(e, { classProps: d.link, styleProps: u, otherProps: t });
11
- return /* @__PURE__ */ f(e, { ...o && { "aria-current": "page" }, ...t, ...g, ref: a, children: [
12
- /* @__PURE__ */ i(b, { children: P }),
13
- /* @__PURE__ */ i("span", { "aria-hidden": "true", children: r })
14
- ] });
15
- }, n = y(
16
- x
2
+ import { jsxs as k, jsx as e } from "react/jsx-runtime";
3
+ import { forwardRef as L } from "react";
4
+ import { useStyleProps as h } from "../../hooks/styleProps.js";
5
+ import { useI18n as C } from "../../hooks/useI18n.js";
6
+ import { useLinkClick as b } from "../../hooks/useLinkClick.js";
7
+ import { mergeStyleProps as S } from "../../utils/mergeStyleProps.js";
8
+ import x from "../VisuallyHidden/VisuallyHidden.js";
9
+ import { usePaginationStyleProps as j } from "./usePaginationStyleProps.js";
10
+ const H = (a, p) => {
11
+ const { t: l } = C(), { elementType: c = "a", accessibilityLabel: m, isCurrent: o, pageNumber: r, routerOptions: u, ...i } = a, P = m || `${l("pagination.goToPage")} ${r}`, n = c, { classProps: d } = j({ isCurrent: o }), { styleProps: g, props: t } = h(i), f = S(n, { classProps: d.link, styleProps: g, otherProps: t }), y = b({ ...i, routerOptions: u });
12
+ return /* @__PURE__ */ k(
13
+ n,
14
+ {
15
+ ...o && { "aria-current": "page" },
16
+ ...t,
17
+ ...f,
18
+ onClick: y,
19
+ ref: p,
20
+ children: [
21
+ /* @__PURE__ */ e(x, { children: P }),
22
+ /* @__PURE__ */ e("span", { "aria-hidden": "true", children: r })
23
+ ]
24
+ }
25
+ );
26
+ }, s = L(
27
+ H
17
28
  );
18
- n.spiritComponent = "PaginationLink";
19
- n.displayName = "PaginationLink";
29
+ s.spiritComponent = "PaginationLink";
30
+ s.displayName = "PaginationLink";
20
31
  export {
21
- n as default
32
+ s as default
22
33
  };
23
34
  //# sourceMappingURL=PaginationLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaginationLink.js","sources":["../../../src/components/Pagination/PaginationLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useI18n, useStyleProps } from '../../hooks';\nimport { type PolymorphicComponent, type PolymorphicRef, type SpiritPaginationLinkProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { usePaginationStyleProps } from './usePaginationStyleProps';\n\nconst _PaginationLink = <E extends ElementType = 'a'>(props: SpiritPaginationLinkProps<E>, ref: PolymorphicRef<E>) => {\n const { t } = useI18n();\n const { elementType = 'a', accessibilityLabel, isCurrent, pageNumber, ...restProps } = props;\n const visuallyHiddenLabel = accessibilityLabel || `${t('pagination.goToPage')} ${pageNumber}`;\n\n const Component = elementType as ElementType;\n\n const { classProps } = usePaginationStyleProps({ isCurrent });\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link, styleProps, otherProps });\n\n return (\n <Component {...(isCurrent && { 'aria-current': 'page' })} {...otherProps} {...mergedStyleProps} ref={ref}>\n <VisuallyHidden>{visuallyHiddenLabel}</VisuallyHidden>\n <span aria-hidden=\"true\">{pageNumber}</span>\n </Component>\n );\n};\n\nconst PaginationLink = forwardRef<HTMLAnchorElement, SpiritPaginationLinkProps<'a'>>(\n _PaginationLink,\n) as unknown as PolymorphicComponent<'a', SpiritPaginationLinkProps<ElementType>>;\n\nPaginationLink.spiritComponent = 'PaginationLink';\nPaginationLink.displayName = 'PaginationLink';\n\nexport default PaginationLink;\n"],"names":["_PaginationLink","props","ref","t","useI18n","elementType","accessibilityLabel","isCurrent","pageNumber","restProps","visuallyHiddenLabel","Component","classProps","usePaginationStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","jsxs","jsx","VisuallyHidden","PaginationLink","forwardRef"],"mappings":";;;;;;;;AASA,MAAMA,IAAkB,CAA8BC,GAAqCC,MAA2B;AACpH,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,EAAE,aAAAC,IAAc,KAAK,oBAAAC,GAAoB,WAAAC,GAAW,YAAAC,GAAY,GAAGC,MAAcR,GACjFS,IAAsBJ,KAAsB,GAAGH,EAAE,qBAAqB,CAAC,IAAIK,CAAU,IAErFG,IAAYN,GAEZ,EAAE,YAAAO,EAAA,IAAeC,EAAwB,EAAE,WAAAN,GAAW,GACtD,EAAE,YAAAO,GAAY,OAAOC,EAAA,IAAeC,EAAcP,CAAS,GAC3DQ,IAAmBC,EAAgBP,GAAW,EAAE,YAAYC,EAAW,MAAM,YAAAE,GAAY,YAAAC,GAAY;AAE3G,SACE,gBAAAI,EAACR,GAAA,EAAW,GAAIJ,KAAa,EAAE,gBAAgB,OAAA,GAAY,GAAGQ,GAAa,GAAGE,GAAkB,KAAAf,GAC9F,UAAA;AAAA,IAAA,gBAAAkB,EAACC,KAAgB,UAAAX,EAAA,CAAoB;AAAA,IACrC,gBAAAU,EAAC,QAAA,EAAK,eAAY,QAAQ,UAAAZ,EAAA,CAAW;AAAA,EAAA,GACvC;AAEJ,GAEMc,IAAiBC;AAAA,EACrBvB;AACF;AAEAsB,EAAe,kBAAkB;AACjCA,EAAe,cAAc;"}
1
+ {"version":3,"file":"PaginationLink.js","sources":["../../../src/components/Pagination/PaginationLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useI18n, useLinkClick, useStyleProps } from '../../hooks';\nimport { type PolymorphicComponent, type PolymorphicRef, type SpiritPaginationLinkProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { usePaginationStyleProps } from './usePaginationStyleProps';\n\nconst _PaginationLink = <E extends ElementType = 'a'>(props: SpiritPaginationLinkProps<E>, ref: PolymorphicRef<E>) => {\n const { t } = useI18n();\n const { elementType = 'a', accessibilityLabel, isCurrent, pageNumber, routerOptions, ...restProps } = props;\n const visuallyHiddenLabel = accessibilityLabel || `${t('pagination.goToPage')} ${pageNumber}`;\n\n const Component = elementType as ElementType;\n\n const { classProps } = usePaginationStyleProps({ isCurrent });\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link, styleProps, otherProps });\n\n const handleClick = useLinkClick({ ...restProps, routerOptions });\n\n return (\n <Component\n {...(isCurrent && { 'aria-current': 'page' })}\n {...otherProps}\n {...mergedStyleProps}\n onClick={handleClick}\n ref={ref}\n >\n <VisuallyHidden>{visuallyHiddenLabel}</VisuallyHidden>\n <span aria-hidden=\"true\">{pageNumber}</span>\n </Component>\n );\n};\n\nconst PaginationLink = forwardRef<HTMLAnchorElement, SpiritPaginationLinkProps<'a'>>(\n _PaginationLink,\n) as unknown as PolymorphicComponent<'a', SpiritPaginationLinkProps<ElementType>>;\n\nPaginationLink.spiritComponent = 'PaginationLink';\nPaginationLink.displayName = 'PaginationLink';\n\nexport default PaginationLink;\n"],"names":["_PaginationLink","props","ref","t","useI18n","elementType","accessibilityLabel","isCurrent","pageNumber","routerOptions","restProps","visuallyHiddenLabel","Component","classProps","usePaginationStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","handleClick","useLinkClick","jsxs","jsx","VisuallyHidden","PaginationLink","forwardRef"],"mappings":";;;;;;;;;AASA,MAAMA,IAAkB,CAA8BC,GAAqCC,MAA2B;AACpH,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,EAAE,aAAAC,IAAc,KAAK,oBAAAC,GAAoB,WAAAC,GAAW,YAAAC,GAAY,eAAAC,GAAe,GAAGC,EAAA,IAAcT,GAChGU,IAAsBL,KAAsB,GAAGH,EAAE,qBAAqB,CAAC,IAAIK,CAAU,IAErFI,IAAYP,GAEZ,EAAE,YAAAQ,EAAA,IAAeC,EAAwB,EAAE,WAAAP,GAAW,GACtD,EAAE,YAAAQ,GAAY,OAAOC,EAAA,IAAeC,EAAcP,CAAS,GAC3DQ,IAAmBC,EAAgBP,GAAW,EAAE,YAAYC,EAAW,MAAM,YAAAE,GAAY,YAAAC,GAAY,GAErGI,IAAcC,EAAa,EAAE,GAAGX,GAAW,eAAAD,GAAe;AAEhE,SACE,gBAAAa;AAAA,IAACV;AAAA,IAAA;AAAA,MACE,GAAIL,KAAa,EAAE,gBAAgB,OAAA;AAAA,MACnC,GAAGS;AAAA,MACH,GAAGE;AAAA,MACJ,SAASE;AAAA,MACT,KAAAlB;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAqB,EAACC,KAAgB,UAAAb,EAAA,CAAoB;AAAA,QACrC,gBAAAY,EAAC,QAAA,EAAK,eAAY,QAAQ,UAAAf,EAAA,CAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG3C,GAEMiB,IAAiBC;AAAA,EACrB1B;AACF;AAEAyB,EAAe,kBAAkB;AACjCA,EAAe,cAAc;"}
@@ -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"),q=require("classnames"),R=require("react"),f=require("../../hooks/styleProps.cjs"),j=require("../../hooks/useAriaDescribedBy.cjs"),S=require("../Field/HelperText.cjs"),_=require("../Field/Label.cjs"),A=require("../Field/useAriaIds.cjs"),g=require("./useRadioStyleProps.cjs"),v=(a,o)=>{const{classProps:e,props:l}=g.useRadioStyleProps(a),{"aria-describedby":c="",helperText:d,id:r,isChecked:u,isDisabled:n,label:p,onChange:y,value:b,...m}=l,{styleProps:i,props:P}=f.useStyleProps(m),[h,x]=A.default(c),N=j.useAriaDescribedBy(h);return s.jsxs("div",{style:i.style,className:q(e.root,i.className),children:[s.jsx("input",{...P,...N,type:"radio",id:r,className:e.input,disabled:n,checked:u,onChange:y,value:b,ref:o}),s.jsxs("div",{className:e.text,children:[s.jsx(_.default,{UNSAFE_className:e.label,htmlFor:r,children:p}),s.jsx(S.default,{UNSAFE_className:e.helperText,id:`${r}__helperText`,registerAria:x,helperText:d})]})]})},t=R.forwardRef(v);t.spiritComponent="Radio";t.displayName="Radio";exports.default=t;
1
+ "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),N=require("classnames"),R=require("react"),f=require("../../hooks/styleProps.cjs"),q=require("../../hooks/useAriaIdRefs.cjs"),j=require("../Field/HelperText.cjs"),S=require("../Field/Label.cjs"),_=require("./useRadioStyleProps.cjs"),g=(a,o)=>{const{classProps:e,props:l}=_.useRadioStyleProps(a),{"aria-describedby":c="",helperText:d,id:r,isChecked:u,isDisabled:n,label:p,onChange:y,value:m,...b}=l,{styleProps:i,props:P}=f.useStyleProps(b),[h,x]=q.useAriaDescribedBy(c);return s.jsxs("div",{style:i.style,className:N(e.root,i.className),children:[s.jsx("input",{...P,...h,type:"radio",id:r,className:e.input,disabled:n,checked:u,onChange:y,value:m,ref:o}),s.jsxs("div",{className:e.text,children:[s.jsx(S.default,{UNSAFE_className:e.label,htmlFor:r,children:p}),s.jsx(j.default,{UNSAFE_className:e.helperText,id:`${r}__helperText`,registerAria:x,helperText:d})]})]})},t=R.forwardRef(g);t.spiritComponent="Radio";t.displayName="Radio";exports.default=t;
2
2
  //# sourceMappingURL=Radio.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.cjs","sources":["../../../src/components/Radio/Radio.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritRadioProps } from '../../types';\nimport { HelperText, Label, useAriaIds } from '../Field';\nimport { useRadioStyleProps } from './useRadioStyleProps';\n\nconst _Radio = (props: SpiritRadioProps, ref: ForwardedRef<HTMLInputElement>): JSX.Element => {\n const { classProps, props: modifiedProps } = useRadioStyleProps(props);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n helperText,\n id,\n isChecked,\n isDisabled,\n label,\n onChange,\n value,\n ...restProps\n } = modifiedProps;\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n\n const [ids, register] = useAriaIds(ariaDescribedBy);\n const ariaDescribedByProp = useAriaDescribedBy(ids);\n\n return (\n <div style={styleProps.style} className={classNames(classProps.root, styleProps.className)}>\n <input\n {...otherProps}\n {...ariaDescribedByProp}\n type=\"radio\"\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n checked={isChecked}\n onChange={onChange}\n value={value}\n ref={ref}\n />\n <div className={classProps.text}>\n <Label UNSAFE_className={classProps.label} htmlFor={id}>\n {label}\n </Label>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n </div>\n </div>\n );\n};\n\nconst Radio = forwardRef<HTMLInputElement, SpiritRadioProps>(_Radio) as ForwardRefComponent<\n HTMLInputElement,\n SpiritRadioProps\n>;\n\nRadio.spiritComponent = 'Radio';\nRadio.displayName = 'Radio';\n\nexport default Radio;\n"],"names":["_Radio","props","ref","classProps","modifiedProps","useRadioStyleProps","ariaDescribedBy","helperText","id","isChecked","isDisabled","label","onChange","value","restProps","styleProps","otherProps","useStyleProps","ids","register","useAriaIds","ariaDescribedByProp","useAriaDescribedBy","jsxs","classNames","jsx","Label","HelperText","Radio","forwardRef"],"mappings":"ibASMA,EAAS,CAACC,EAAyBC,IAAqD,CAC5F,KAAM,CAAE,WAAAC,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,mBAAmBJ,CAAK,EAC/D,CACJ,mBAAoBK,EAAkB,GACtC,WAAAC,EACA,GAAAC,EACA,UAAAC,EACA,WAAAC,EACA,MAAAC,EACA,SAAAC,EACA,MAAAC,EACA,GAAGC,CAAA,EACDV,EACE,CAAA,WAAEW,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcH,CAAS,EAE3D,CAACI,EAAKC,CAAQ,EAAIC,EAAAA,QAAWd,CAAe,EAC5Ce,EAAsBC,EAAAA,mBAAmBJ,CAAG,EAElD,OACEK,EAAAA,KAAC,MAAA,CAAI,MAAOR,EAAW,MAAO,UAAWS,EAAWrB,EAAW,KAAMY,EAAW,SAAS,EACvF,SAAA,CAAAU,EAAAA,IAAC,QAAA,CACE,GAAGT,EACH,GAAGK,EACJ,KAAK,QACL,GAAAb,EACA,UAAWL,EAAW,MACtB,SAAUO,EACV,QAASD,EACT,SAAAG,EACA,MAAAC,EACA,IAAAX,CAAA,CAAA,EAEFqB,EAAAA,KAAC,MAAA,CAAI,UAAWpB,EAAW,KACzB,SAAA,CAAAsB,MAACC,EAAAA,SAAM,iBAAkBvB,EAAW,MAAO,QAASK,EACjD,SAAAG,EACH,EACAc,EAAAA,IAACE,EAAAA,QAAA,CACC,iBAAkBxB,EAAW,WAC7B,GAAI,GAAGK,CAAE,eACT,aAAcW,EACd,WAAAZ,CAAA,CAAA,CACF,CAAA,CACF,CAAA,EACF,CAEJ,EAEMqB,EAAQC,EAAAA,WAA+C7B,CAAM,EAKnE4B,EAAM,gBAAkB,QACxBA,EAAM,YAAc"}
1
+ {"version":3,"file":"Radio.cjs","sources":["../../../src/components/Radio/Radio.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritRadioProps } from '../../types';\nimport { HelperText, Label } from '../Field';\nimport { useRadioStyleProps } from './useRadioStyleProps';\n\nconst _Radio = (props: SpiritRadioProps, ref: ForwardedRef<HTMLInputElement>): JSX.Element => {\n const { classProps, props: modifiedProps } = useRadioStyleProps(props);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n helperText,\n id,\n isChecked,\n isDisabled,\n label,\n onChange,\n value,\n ...restProps\n } = modifiedProps;\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n\n return (\n <div style={styleProps.style} className={classNames(classProps.root, styleProps.className)}>\n <input\n {...otherProps}\n {...ariaDescribedByProp}\n type=\"radio\"\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n checked={isChecked}\n onChange={onChange}\n value={value}\n ref={ref}\n />\n <div className={classProps.text}>\n <Label UNSAFE_className={classProps.label} htmlFor={id}>\n {label}\n </Label>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n </div>\n </div>\n );\n};\n\nconst Radio = forwardRef<HTMLInputElement, SpiritRadioProps>(_Radio) as ForwardRefComponent<\n HTMLInputElement,\n SpiritRadioProps\n>;\n\nRadio.spiritComponent = 'Radio';\nRadio.displayName = 'Radio';\n\nexport default Radio;\n"],"names":["_Radio","props","ref","classProps","modifiedProps","useRadioStyleProps","ariaDescribedBy","helperText","id","isChecked","isDisabled","label","onChange","value","restProps","styleProps","otherProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","jsxs","classNames","jsx","Label","HelperText","Radio","forwardRef"],"mappings":"uYASMA,EAAS,CAACC,EAAyBC,IAAqD,CAC5F,KAAM,CAAE,WAAAC,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,mBAAmBJ,CAAK,EAC/D,CACJ,mBAAoBK,EAAkB,GACtC,WAAAC,EACA,GAAAC,EACA,UAAAC,EACA,WAAAC,EACA,MAAAC,EACA,SAAAC,EACA,MAAAC,EACA,GAAGC,CAAA,EACDV,EACE,CAAA,WAAEW,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcH,CAAS,EAE3D,CAACI,EAAqBC,CAAQ,EAAIC,EAAAA,mBAAmBd,CAAe,EAE1E,OACEe,EAAAA,KAAC,MAAA,CAAI,MAAON,EAAW,MAAO,UAAWO,EAAWnB,EAAW,KAAMY,EAAW,SAAS,EACvF,SAAA,CAAAQ,EAAAA,IAAC,QAAA,CACE,GAAGP,EACH,GAAGE,EACJ,KAAK,QACL,GAAAV,EACA,UAAWL,EAAW,MACtB,SAAUO,EACV,QAASD,EACT,SAAAG,EACA,MAAAC,EACA,IAAAX,CAAA,CAAA,EAEFmB,EAAAA,KAAC,MAAA,CAAI,UAAWlB,EAAW,KACzB,SAAA,CAAAoB,MAACC,EAAAA,SAAM,iBAAkBrB,EAAW,MAAO,QAASK,EACjD,SAAAG,EACH,EACAY,EAAAA,IAACE,EAAAA,QAAA,CACC,iBAAkBtB,EAAW,WAC7B,GAAI,GAAGK,CAAE,eACT,aAAcW,EACd,WAAAZ,CAAA,CAAA,CACF,CAAA,CACF,CAAA,EACF,CAEJ,EAEMmB,EAAQC,EAAAA,WAA+C3B,CAAM,EAKnE0B,EAAM,gBAAkB,QACxBA,EAAM,YAAc"}
@@ -1,55 +1,54 @@
1
1
  "use client";
2
- import { jsxs as i, jsx as r } from "react/jsx-runtime";
3
- import R from "classnames";
4
- import { forwardRef as A } from "react";
2
+ import { jsxs as i, jsx as s } from "react/jsx-runtime";
3
+ import P from "classnames";
4
+ import { forwardRef as R } from "react";
5
5
  import { useStyleProps as _ } from "../../hooks/styleProps.js";
6
- import { useAriaDescribedBy as D } from "../../hooks/useAriaDescribedBy.js";
7
- import S from "../Field/HelperText.js";
8
- import T from "../Field/Label.js";
9
- import g from "../Field/useAriaIds.js";
10
- import { useRadioStyleProps as v } from "./useRadioStyleProps.js";
11
- const B = (a, l) => {
12
- const { classProps: e, props: p } = v(a), {
6
+ import { useAriaDescribedBy as A } from "../../hooks/useAriaIdRefs.js";
7
+ import D from "../Field/HelperText.js";
8
+ import S from "../Field/Label.js";
9
+ import { useRadioStyleProps as T } from "./useRadioStyleProps.js";
10
+ const g = (a, l) => {
11
+ const { classProps: e, props: p } = T(a), {
13
12
  "aria-describedby": d = "",
14
13
  helperText: m,
15
- id: s,
14
+ id: r,
16
15
  isChecked: c,
17
16
  isDisabled: n,
18
17
  label: f,
19
18
  onChange: h,
20
- value: u,
21
- ...y
22
- } = p, { styleProps: o, props: b } = _(y), [N, x] = g(d), P = D(N);
23
- return /* @__PURE__ */ i("div", { style: o.style, className: R(e.root, o.className), children: [
24
- /* @__PURE__ */ r(
19
+ value: y,
20
+ ...b
21
+ } = p, { styleProps: o, props: u } = _(b), [N, x] = A(d);
22
+ return /* @__PURE__ */ i("div", { style: o.style, className: P(e.root, o.className), children: [
23
+ /* @__PURE__ */ s(
25
24
  "input",
26
25
  {
27
- ...b,
28
- ...P,
26
+ ...u,
27
+ ...N,
29
28
  type: "radio",
30
- id: s,
29
+ id: r,
31
30
  className: e.input,
32
31
  disabled: n,
33
32
  checked: c,
34
33
  onChange: h,
35
- value: u,
34
+ value: y,
36
35
  ref: l
37
36
  }
38
37
  ),
39
38
  /* @__PURE__ */ i("div", { className: e.text, children: [
40
- /* @__PURE__ */ r(T, { UNSAFE_className: e.label, htmlFor: s, children: f }),
41
- /* @__PURE__ */ r(
42
- S,
39
+ /* @__PURE__ */ s(S, { UNSAFE_className: e.label, htmlFor: r, children: f }),
40
+ /* @__PURE__ */ s(
41
+ D,
43
42
  {
44
43
  UNSAFE_className: e.helperText,
45
- id: `${s}__helperText`,
44
+ id: `${r}__helperText`,
46
45
  registerAria: x,
47
46
  helperText: m
48
47
  }
49
48
  )
50
49
  ] })
51
50
  ] });
52
- }, t = A(B);
51
+ }, t = R(g);
53
52
  t.spiritComponent = "Radio";
54
53
  t.displayName = "Radio";
55
54
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","sources":["../../../src/components/Radio/Radio.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritRadioProps } from '../../types';\nimport { HelperText, Label, useAriaIds } from '../Field';\nimport { useRadioStyleProps } from './useRadioStyleProps';\n\nconst _Radio = (props: SpiritRadioProps, ref: ForwardedRef<HTMLInputElement>): JSX.Element => {\n const { classProps, props: modifiedProps } = useRadioStyleProps(props);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n helperText,\n id,\n isChecked,\n isDisabled,\n label,\n onChange,\n value,\n ...restProps\n } = modifiedProps;\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n\n const [ids, register] = useAriaIds(ariaDescribedBy);\n const ariaDescribedByProp = useAriaDescribedBy(ids);\n\n return (\n <div style={styleProps.style} className={classNames(classProps.root, styleProps.className)}>\n <input\n {...otherProps}\n {...ariaDescribedByProp}\n type=\"radio\"\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n checked={isChecked}\n onChange={onChange}\n value={value}\n ref={ref}\n />\n <div className={classProps.text}>\n <Label UNSAFE_className={classProps.label} htmlFor={id}>\n {label}\n </Label>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n </div>\n </div>\n );\n};\n\nconst Radio = forwardRef<HTMLInputElement, SpiritRadioProps>(_Radio) as ForwardRefComponent<\n HTMLInputElement,\n SpiritRadioProps\n>;\n\nRadio.spiritComponent = 'Radio';\nRadio.displayName = 'Radio';\n\nexport default Radio;\n"],"names":["_Radio","props","ref","classProps","modifiedProps","useRadioStyleProps","ariaDescribedBy","helperText","id","isChecked","isDisabled","label","onChange","value","restProps","styleProps","otherProps","useStyleProps","ids","register","useAriaIds","ariaDescribedByProp","useAriaDescribedBy","jsxs","classNames","jsx","Label","HelperText","Radio","forwardRef"],"mappings":";;;;;;;;;;AASA,MAAMA,IAAS,CAACC,GAAyBC,MAAqD;AAC5F,QAAM,EAAE,YAAAC,GAAY,OAAOC,EAAA,IAAkBC,EAAmBJ,CAAK,GAC/D;AAAA,IACJ,oBAAoBK,IAAkB;AAAA,IACtC,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDV,GACE,EAAE,YAAAW,GAAY,OAAOC,EAAA,IAAeC,EAAcH,CAAS,GAE3D,CAACI,GAAKC,CAAQ,IAAIC,EAAWd,CAAe,GAC5Ce,IAAsBC,EAAmBJ,CAAG;AAElD,SACE,gBAAAK,EAAC,OAAA,EAAI,OAAOR,EAAW,OAAO,WAAWS,EAAWrB,EAAW,MAAMY,EAAW,SAAS,GACvF,UAAA;AAAA,IAAA,gBAAAU;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGT;AAAA,QACH,GAAGK;AAAA,QACJ,MAAK;AAAA,QACL,IAAAb;AAAA,QACA,WAAWL,EAAW;AAAA,QACtB,UAAUO;AAAA,QACV,SAASD;AAAA,QACT,UAAAG;AAAA,QACA,OAAAC;AAAA,QACA,KAAAX;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAAqB,EAAC,OAAA,EAAI,WAAWpB,EAAW,MACzB,UAAA;AAAA,MAAA,gBAAAsB,EAACC,KAAM,kBAAkBvB,EAAW,OAAO,SAASK,GACjD,UAAAG,GACH;AAAA,MACA,gBAAAc;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,kBAAkBxB,EAAW;AAAA,UAC7B,IAAI,GAAGK,CAAE;AAAA,UACT,cAAcW;AAAA,UACd,YAAAZ;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,EAAA,CACF;AAAA,EAAA,GACF;AAEJ,GAEMqB,IAAQC,EAA+C7B,CAAM;AAKnE4B,EAAM,kBAAkB;AACxBA,EAAM,cAAc;"}
1
+ {"version":3,"file":"Radio.js","sources":["../../../src/components/Radio/Radio.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritRadioProps } from '../../types';\nimport { HelperText, Label } from '../Field';\nimport { useRadioStyleProps } from './useRadioStyleProps';\n\nconst _Radio = (props: SpiritRadioProps, ref: ForwardedRef<HTMLInputElement>): JSX.Element => {\n const { classProps, props: modifiedProps } = useRadioStyleProps(props);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n helperText,\n id,\n isChecked,\n isDisabled,\n label,\n onChange,\n value,\n ...restProps\n } = modifiedProps;\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n\n return (\n <div style={styleProps.style} className={classNames(classProps.root, styleProps.className)}>\n <input\n {...otherProps}\n {...ariaDescribedByProp}\n type=\"radio\"\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n checked={isChecked}\n onChange={onChange}\n value={value}\n ref={ref}\n />\n <div className={classProps.text}>\n <Label UNSAFE_className={classProps.label} htmlFor={id}>\n {label}\n </Label>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n </div>\n </div>\n );\n};\n\nconst Radio = forwardRef<HTMLInputElement, SpiritRadioProps>(_Radio) as ForwardRefComponent<\n HTMLInputElement,\n SpiritRadioProps\n>;\n\nRadio.spiritComponent = 'Radio';\nRadio.displayName = 'Radio';\n\nexport default Radio;\n"],"names":["_Radio","props","ref","classProps","modifiedProps","useRadioStyleProps","ariaDescribedBy","helperText","id","isChecked","isDisabled","label","onChange","value","restProps","styleProps","otherProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","jsxs","classNames","jsx","Label","HelperText","Radio","forwardRef"],"mappings":";;;;;;;;;AASA,MAAMA,IAAS,CAACC,GAAyBC,MAAqD;AAC5F,QAAM,EAAE,YAAAC,GAAY,OAAOC,EAAA,IAAkBC,EAAmBJ,CAAK,GAC/D;AAAA,IACJ,oBAAoBK,IAAkB;AAAA,IACtC,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDV,GACE,EAAE,YAAAW,GAAY,OAAOC,EAAA,IAAeC,EAAcH,CAAS,GAE3D,CAACI,GAAqBC,CAAQ,IAAIC,EAAmBd,CAAe;AAE1E,SACE,gBAAAe,EAAC,OAAA,EAAI,OAAON,EAAW,OAAO,WAAWO,EAAWnB,EAAW,MAAMY,EAAW,SAAS,GACvF,UAAA;AAAA,IAAA,gBAAAQ;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGP;AAAA,QACH,GAAGE;AAAA,QACJ,MAAK;AAAA,QACL,IAAAV;AAAA,QACA,WAAWL,EAAW;AAAA,QACtB,UAAUO;AAAA,QACV,SAASD;AAAA,QACT,UAAAG;AAAA,QACA,OAAAC;AAAA,QACA,KAAAX;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAAmB,EAAC,OAAA,EAAI,WAAWlB,EAAW,MACzB,UAAA;AAAA,MAAA,gBAAAoB,EAACC,KAAM,kBAAkBrB,EAAW,OAAO,SAASK,GACjD,UAAAG,GACH;AAAA,MACA,gBAAAY;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,kBAAkBtB,EAAW;AAAA,UAC7B,IAAI,GAAGK,CAAE;AAAA,UACT,cAAcW;AAAA,UACd,YAAAZ;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,EAAA,CACF;AAAA,EAAA,GACF;AAEJ,GAEMmB,IAAQC,EAA+C3B,CAAM;AAKnE0B,EAAM,kBAAkB;AACxBA,EAAM,cAAc;"}
@@ -4,7 +4,7 @@ import { isDirectionHorizontal as b } from "../../constants/direction.js";
4
4
  import { Position as t } from "../../constants/position.js";
5
5
  import { useResizeObserver as D } from "../../hooks/useResizeObserver.js";
6
6
  import { debounce as m } from "../../utils/debounce.js";
7
- import { DEBOUNCE_DELAY as E, EDGE_DETECTION_INACCURACY_PX as S } from "./constants.js";
7
+ import { EDGE_DETECTION_INACCURACY_PX as E, DEBOUNCE_DELAY as S } from "./constants.js";
8
8
  const h = ({
9
9
  viewportReference: e,
10
10
  contentReference: s,
@@ -24,16 +24,16 @@ const h = ({
24
24
  const o = b(a), r = o ? t.LEFT : t.TOP, p = o ? t.RIGHT : t.BOTTOM, i = A();
25
25
  if (!i)
26
26
  return;
27
- const u = i[r] <= -1 * S, d = i[p] >= S;
27
+ const u = i[r] <= -1 * E, d = i[p] >= E;
28
28
  u !== c && T(u), d !== l && P(d);
29
- }, O = C(m(n, E), [n]);
29
+ }, O = C(m(n, S), [n]);
30
30
  return D({
31
31
  ref: e,
32
32
  onResize: O
33
33
  }), g(n, []), {
34
34
  isScrolledAtEnd: l,
35
35
  isScrolledAtStart: c,
36
- onScroll: m(n, E)
36
+ onScroll: m(n, S)
37
37
  };
38
38
  };
39
39
  export {
@@ -1,2 +1,2 @@
1
- "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),_=require("classnames"),A=require("react"),u=require("../../constants/dictionaries.cjs"),R=require("../../hooks/styleProps.cjs"),D=require("../../hooks/useAriaDescribedBy.cjs"),g=require("../Field/HelperText.cjs"),F=require("../Field/Label.cjs"),I=require("../Field/useAriaIds.cjs"),M=require("../Field/ValidationText.cjs"),V=require("../Field/useValidationTextRole.cjs"),z=require("../Icon/Icon.cjs"),B=require("./useSelectStyleProps.cjs"),E=(p,x)=>{const{"aria-describedby":S="",children:b,hasValidationIcon:m,helperText:q,id:i,isDisabled:a,isFluid:y,isLabelHidden:N,isRequired:l,label:h,size:o=u.Sizes.MEDIUM,validationState:t,validationText:c,...T}=p,{classProps:s}=B.useSelectStyleProps({isDisabled:a,isFluid:y,isLabelHidden:N,isRequired:l,size:o,validationState:t}),{styleProps:n,props:v}=R.useStyleProps(T),[P,d]=I.default(S),f=D.useAriaDescribedBy(P),j=V.useValidationTextRole({validationState:t,validationText:c});return e.jsxs("div",{...n,className:_(s.root,n.className),children:[e.jsx(F.default,{htmlFor:i,UNSAFE_className:s.label,children:h}),e.jsxs("div",{className:s.container,children:[e.jsx("select",{...v,...f,id:i,className:s.input,disabled:a,required:l,ref:x,children:b}),e.jsx("div",{className:s.icon,children:e.jsx(z.default,{name:"chevron-down",boxSize:o===u.Sizes.SMALL?16:20})})]}),e.jsx(g.default,{UNSAFE_className:s.helperText,id:`${i}__helperText`,registerAria:d,helperText:q}),t&&e.jsx(M.default,{UNSAFE_className:s.validationText,...m&&{hasValidationStateIcon:t},id:`${i}__validationText`,validationText:c,registerAria:d,role:j})]})},r=A.forwardRef(E);r.spiritComponent="Select";r.displayName="Select";exports.default=r;
1
+ "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),j=require("classnames"),_=require("react"),u=require("../../constants/dictionaries.cjs"),A=require("../../hooks/styleProps.cjs"),R=require("../../hooks/useAriaIdRefs.cjs"),g=require("../Field/HelperText.cjs"),D=require("../Field/Label.cjs"),F=require("../Field/ValidationText.cjs"),I=require("../Field/useValidationTextRole.cjs"),M=require("../Icon/Icon.cjs"),V=require("./useSelectStyleProps.cjs"),z=(p,x)=>{const{"aria-describedby":S="",children:m,hasValidationIcon:b,helperText:q,id:i,isDisabled:a,isFluid:N,isLabelHidden:h,isRequired:l,label:y,size:o=u.Sizes.MEDIUM,validationState:t,validationText:c,...T}=p,{classProps:s}=V.useSelectStyleProps({isDisabled:a,isFluid:N,isLabelHidden:h,isRequired:l,size:o,validationState:t}),{styleProps:n,props:v}=A.useStyleProps(T),[P,d]=R.useAriaDescribedBy(S),f=I.useValidationTextRole({validationState:t,validationText:c});return e.jsxs("div",{...n,className:j(s.root,n.className),children:[e.jsx(D.default,{htmlFor:i,UNSAFE_className:s.label,children:y}),e.jsxs("div",{className:s.container,children:[e.jsx("select",{...v,...P,id:i,className:s.input,disabled:a,required:l,ref:x,children:m}),e.jsx("div",{className:s.icon,children:e.jsx(M.default,{name:"chevron-down",boxSize:o===u.Sizes.SMALL?16:20})})]}),e.jsx(g.default,{UNSAFE_className:s.helperText,id:`${i}__helperText`,registerAria:d,helperText:q}),t&&e.jsx(F.default,{UNSAFE_className:s.validationText,...b&&{hasValidationStateIcon:t},id:`${i}__validationText`,validationText:c,registerAria:d,role:f})]})},r=_.forwardRef(z);r.spiritComponent="Select";r.displayName="Select";exports.default=r;
2
2
  //# sourceMappingURL=Select.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.cjs","sources":["../../../src/components/Select/Select.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 { type ForwardRefComponent, type SpiritSelectProps } from '../../types';\nimport { HelperText, Label, ValidationText, useAriaIds } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { Icon } from '../Icon';\nimport { useSelectStyleProps } from './useSelectStyleProps';\n\nconst _Select = (props: SpiritSelectProps, ref: ForwardedRef<HTMLSelectElement>) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n children,\n hasValidationIcon,\n helperText,\n id,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n label,\n size = Sizes.MEDIUM,\n validationState,\n validationText,\n ...restProps\n } = props;\n const { classProps } = useSelectStyleProps({\n hasValidationIcon,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n size,\n validationState,\n });\n const { styleProps, props: transferProps } = useStyleProps(restProps);\n const [ids, register] = useAriaIds(ariaDescribedBy);\n const ariaDescribedByProp = useAriaDescribedBy(ids);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <div {...styleProps} className={classNames(classProps.root, styleProps.className)}>\n <Label htmlFor={id} UNSAFE_className={classProps.label}>\n {label}\n </Label>\n <div className={classProps.container}>\n <select\n {...transferProps}\n {...ariaDescribedByProp}\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n required={isRequired}\n ref={ref}\n >\n {children}\n </select>\n <div className={classProps.icon}>\n <Icon name=\"chevron-down\" boxSize={size === Sizes.SMALL ? 16 : 20} />\n </div>\n </div>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__validationText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n );\n};\n\nconst Select = forwardRef<HTMLSelectElement, SpiritSelectProps>(_Select) as ForwardRefComponent<\n HTMLSelectElement,\n SpiritSelectProps\n>;\n\nSelect.spiritComponent = 'Select';\nSelect.displayName = 'Select';\n\nexport default Select;\n"],"names":["_Select","props","ref","ariaDescribedBy","children","hasValidationIcon","helperText","id","isDisabled","isFluid","isLabelHidden","isRequired","label","size","Sizes","validationState","validationText","restProps","classProps","useSelectStyleProps","styleProps","transferProps","useStyleProps","ids","register","useAriaIds","ariaDescribedByProp","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","Label","Icon","HelperText","ValidationText","Select","forwardRef"],"mappings":"ulBAYMA,EAAU,CAACC,EAA0BC,IAAyC,CAClF,KAAM,CACJ,mBAAoBC,EAAkB,GACtC,SAAAC,EACA,kBAAAC,EACA,WAAAC,EACA,GAAAC,EACA,WAAAC,EACA,QAAAC,EACA,cAAAC,EACA,WAAAC,EACA,MAAAC,EACA,KAAAC,EAAOC,EAAAA,MAAM,OACb,gBAAAC,EACA,eAAAC,EACA,GAAGC,CAAA,EACDhB,EACE,CAAE,WAAAiB,CAAA,EAAeC,sBAAoB,CAEzC,WAAAX,EACA,QAAAC,EACA,cAAAC,EACA,WAAAC,EACA,KAAAE,EACA,gBAAAE,CAAA,CACD,EACK,CAAA,WAAEK,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,cAAcL,CAAS,EAC9D,CAACM,EAAKC,CAAQ,EAAIC,EAAAA,QAAWtB,CAAe,EAC5CuB,EAAsBC,EAAAA,mBAAmBJ,CAAG,EAC5CK,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAd,EACA,eAAAC,CAAA,CACD,EAED,OACEc,OAAC,MAAA,CAAK,GAAGV,EAAY,UAAWW,EAAWb,EAAW,KAAME,EAAW,SAAS,EAC9E,SAAA,CAAAY,MAACC,EAAAA,SAAM,QAAS1B,EAAI,iBAAkBW,EAAW,MAC9C,SAAAN,EACH,EACAkB,EAAAA,KAAC,MAAA,CAAI,UAAWZ,EAAW,UACzB,SAAA,CAAAc,EAAAA,IAAC,SAAA,CACE,GAAGX,EACH,GAAGK,EACJ,GAAAnB,EACA,UAAWW,EAAW,MACtB,SAAUV,EACV,SAAUG,EACV,IAAAT,EAEC,SAAAE,CAAA,CAAA,EAEH4B,EAAAA,IAAC,MAAA,CAAI,UAAWd,EAAW,KACzB,SAAAc,EAAAA,IAACE,EAAAA,QAAA,CAAK,KAAK,eAAe,QAASrB,IAASC,EAAAA,MAAM,MAAQ,GAAK,GAAI,CAAA,CACrE,CAAA,EACF,EACAkB,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBjB,EAAW,WAC7B,GAAI,GAAGX,CAAE,eACT,aAAciB,EACd,WAAAlB,CAAA,CAAA,EAEDS,GACCiB,EAAAA,IAACI,EAAAA,QAAA,CACC,iBAAkBlB,EAAW,eAC5B,GAAIb,GAAqB,CAAE,uBAAwBU,CAAA,EACpD,GAAI,GAAGR,CAAE,mBACT,eAAAS,EACA,aAAcQ,EACd,KAAMI,CAAA,CAAA,CACR,EAEJ,CAEJ,EAEMS,EAASC,EAAAA,WAAiDtC,CAAO,EAKvEqC,EAAO,gBAAkB,SACzBA,EAAO,YAAc"}
1
+ {"version":3,"file":"Select.cjs","sources":["../../../src/components/Select/Select.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 { type ForwardRefComponent, type SpiritSelectProps } from '../../types';\nimport { HelperText, Label, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { Icon } from '../Icon';\nimport { useSelectStyleProps } from './useSelectStyleProps';\n\nconst _Select = (props: SpiritSelectProps, ref: ForwardedRef<HTMLSelectElement>) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n children,\n hasValidationIcon,\n helperText,\n id,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n label,\n size = Sizes.MEDIUM,\n validationState,\n validationText,\n ...restProps\n } = props;\n const { classProps } = useSelectStyleProps({\n hasValidationIcon,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n size,\n validationState,\n });\n const { styleProps, props: transferProps } = useStyleProps(restProps);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\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 <div className={classProps.container}>\n <select\n {...transferProps}\n {...ariaDescribedByProp}\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n required={isRequired}\n ref={ref}\n >\n {children}\n </select>\n <div className={classProps.icon}>\n <Icon name=\"chevron-down\" boxSize={size === Sizes.SMALL ? 16 : 20} />\n </div>\n </div>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__validationText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n );\n};\n\nconst Select = forwardRef<HTMLSelectElement, SpiritSelectProps>(_Select) as ForwardRefComponent<\n HTMLSelectElement,\n SpiritSelectProps\n>;\n\nSelect.spiritComponent = 'Select';\nSelect.displayName = 'Select';\n\nexport default Select;\n"],"names":["_Select","props","ref","ariaDescribedBy","children","hasValidationIcon","helperText","id","isDisabled","isFluid","isLabelHidden","isRequired","label","size","Sizes","validationState","validationText","restProps","classProps","useSelectStyleProps","styleProps","transferProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","Label","Icon","HelperText","ValidationText","Select","forwardRef"],"mappings":"6iBAYMA,EAAU,CAACC,EAA0BC,IAAyC,CAClF,KAAM,CACJ,mBAAoBC,EAAkB,GACtC,SAAAC,EACA,kBAAAC,EACA,WAAAC,EACA,GAAAC,EACA,WAAAC,EACA,QAAAC,EACA,cAAAC,EACA,WAAAC,EACA,MAAAC,EACA,KAAAC,EAAOC,EAAAA,MAAM,OACb,gBAAAC,EACA,eAAAC,EACA,GAAGC,CAAA,EACDhB,EACE,CAAE,WAAAiB,CAAA,EAAeC,sBAAoB,CAEzC,WAAAX,EACA,QAAAC,EACA,cAAAC,EACA,WAAAC,EACA,KAAAE,EACA,gBAAAE,CAAA,CACD,EACK,CAAA,WAAEK,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,cAAcL,CAAS,EAC9D,CAACM,EAAqBC,CAAQ,EAAIC,EAAAA,mBAAmBtB,CAAe,EACpEuB,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAZ,EACA,eAAAC,CAAA,CACD,EAED,OACEY,OAAC,MAAA,CAAK,GAAGR,EAAY,UAAWS,EAAWX,EAAW,KAAME,EAAW,SAAS,EAC9E,SAAA,CAAAU,MAACC,EAAAA,SAAM,QAASxB,EAAI,iBAAkBW,EAAW,MAC9C,SAAAN,EACH,EACAgB,EAAAA,KAAC,MAAA,CAAI,UAAWV,EAAW,UACzB,SAAA,CAAAY,EAAAA,IAAC,SAAA,CACE,GAAGT,EACH,GAAGE,EACJ,GAAAhB,EACA,UAAWW,EAAW,MACtB,SAAUV,EACV,SAAUG,EACV,IAAAT,EAEC,SAAAE,CAAA,CAAA,EAEH0B,EAAAA,IAAC,MAAA,CAAI,UAAWZ,EAAW,KACzB,SAAAY,EAAAA,IAACE,EAAAA,QAAA,CAAK,KAAK,eAAe,QAASnB,IAASC,EAAAA,MAAM,MAAQ,GAAK,GAAI,CAAA,CACrE,CAAA,EACF,EACAgB,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBf,EAAW,WAC7B,GAAI,GAAGX,CAAE,eACT,aAAciB,EACd,WAAAlB,CAAA,CAAA,EAEDS,GACCe,EAAAA,IAACI,EAAAA,QAAA,CACC,iBAAkBhB,EAAW,eAC5B,GAAIb,GAAqB,CAAE,uBAAwBU,CAAA,EACpD,GAAI,GAAGR,CAAE,mBACT,eAAAS,EACA,aAAcQ,EACd,KAAME,CAAA,CAAA,CACR,EAEJ,CAEJ,EAEMS,EAASC,EAAAA,WAAiDpC,CAAO,EAKvEmC,EAAO,gBAAkB,SACzBA,EAAO,YAAc"}
@@ -1,26 +1,25 @@
1
1
  "use client";
2
2
  import { jsxs as m, jsx as i } from "react/jsx-runtime";
3
- import F from "classnames";
4
- import { forwardRef as I } from "react";
3
+ import D from "classnames";
4
+ import { forwardRef as F } from "react";
5
5
  import { Sizes as n } from "../../constants/dictionaries.js";
6
6
  import { useStyleProps as E } from "../../hooks/styleProps.js";
7
- import { useAriaDescribedBy as L } from "../../hooks/useAriaDescribedBy.js";
8
- import R from "../Field/HelperText.js";
9
- import U from "../Field/Label.js";
10
- import V from "../Field/useAriaIds.js";
11
- import g from "../Field/ValidationText.js";
12
- import { useValidationTextRole as z } from "../Field/useValidationTextRole.js";
13
- import B from "../Icon/Icon.js";
14
- import { useSelectStyleProps as M } from "./useSelectStyleProps.js";
15
- const j = (f, S) => {
7
+ import { useAriaDescribedBy as I } from "../../hooks/useAriaIdRefs.js";
8
+ import L from "../Field/HelperText.js";
9
+ import R from "../Field/Label.js";
10
+ import U from "../Field/ValidationText.js";
11
+ import { useValidationTextRole as V } from "../Field/useValidationTextRole.js";
12
+ import g from "../Icon/Icon.js";
13
+ import { useSelectStyleProps as z } from "./useSelectStyleProps.js";
14
+ const B = (f, S) => {
16
15
  const {
17
16
  "aria-describedby": x = "",
18
- children: u,
19
- hasValidationIcon: N,
20
- helperText: b,
17
+ children: N,
18
+ hasValidationIcon: b,
19
+ helperText: h,
21
20
  id: r,
22
21
  isDisabled: t,
23
- isFluid: h,
22
+ isFluid: u,
24
23
  isLabelHidden: T,
25
24
  isRequired: o,
26
25
  label: v,
@@ -28,57 +27,57 @@ const j = (f, S) => {
28
27
  validationState: s,
29
28
  validationText: l,
30
29
  ...y
31
- } = f, { classProps: e } = M({
30
+ } = f, { classProps: e } = z({
32
31
  isDisabled: t,
33
- isFluid: h,
32
+ isFluid: u,
34
33
  isLabelHidden: T,
35
34
  isRequired: o,
36
35
  size: a,
37
36
  validationState: s
38
- }), { styleProps: c, props: A } = E(y), [_, d] = V(x), P = L(_), D = z({
37
+ }), { styleProps: c, props: _ } = E(y), [A, d] = I(x), P = V({
39
38
  validationState: s,
40
39
  validationText: l
41
40
  });
42
- return /* @__PURE__ */ m("div", { ...c, className: F(e.root, c.className), children: [
43
- /* @__PURE__ */ i(U, { htmlFor: r, UNSAFE_className: e.label, children: v }),
41
+ return /* @__PURE__ */ m("div", { ...c, className: D(e.root, c.className), children: [
42
+ /* @__PURE__ */ i(R, { htmlFor: r, UNSAFE_className: e.label, children: v }),
44
43
  /* @__PURE__ */ m("div", { className: e.container, children: [
45
44
  /* @__PURE__ */ i(
46
45
  "select",
47
46
  {
47
+ ..._,
48
48
  ...A,
49
- ...P,
50
49
  id: r,
51
50
  className: e.input,
52
51
  disabled: t,
53
52
  required: o,
54
53
  ref: S,
55
- children: u
54
+ children: N
56
55
  }
57
56
  ),
58
- /* @__PURE__ */ i("div", { className: e.icon, children: /* @__PURE__ */ i(B, { name: "chevron-down", boxSize: a === n.SMALL ? 16 : 20 }) })
57
+ /* @__PURE__ */ i("div", { className: e.icon, children: /* @__PURE__ */ i(g, { name: "chevron-down", boxSize: a === n.SMALL ? 16 : 20 }) })
59
58
  ] }),
60
59
  /* @__PURE__ */ i(
61
- R,
60
+ L,
62
61
  {
63
62
  UNSAFE_className: e.helperText,
64
63
  id: `${r}__helperText`,
65
64
  registerAria: d,
66
- helperText: b
65
+ helperText: h
67
66
  }
68
67
  ),
69
68
  s && /* @__PURE__ */ i(
70
- g,
69
+ U,
71
70
  {
72
71
  UNSAFE_className: e.validationText,
73
- ...N && { hasValidationStateIcon: s },
72
+ ...b && { hasValidationStateIcon: s },
74
73
  id: `${r}__validationText`,
75
74
  validationText: l,
76
75
  registerAria: d,
77
- role: D
76
+ role: P
78
77
  }
79
78
  )
80
79
  ] });
81
- }, p = I(j);
80
+ }, p = F(B);
82
81
  p.spiritComponent = "Select";
83
82
  p.displayName = "Select";
84
83
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.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 { type ForwardRefComponent, type SpiritSelectProps } from '../../types';\nimport { HelperText, Label, ValidationText, useAriaIds } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { Icon } from '../Icon';\nimport { useSelectStyleProps } from './useSelectStyleProps';\n\nconst _Select = (props: SpiritSelectProps, ref: ForwardedRef<HTMLSelectElement>) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n children,\n hasValidationIcon,\n helperText,\n id,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n label,\n size = Sizes.MEDIUM,\n validationState,\n validationText,\n ...restProps\n } = props;\n const { classProps } = useSelectStyleProps({\n hasValidationIcon,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n size,\n validationState,\n });\n const { styleProps, props: transferProps } = useStyleProps(restProps);\n const [ids, register] = useAriaIds(ariaDescribedBy);\n const ariaDescribedByProp = useAriaDescribedBy(ids);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <div {...styleProps} className={classNames(classProps.root, styleProps.className)}>\n <Label htmlFor={id} UNSAFE_className={classProps.label}>\n {label}\n </Label>\n <div className={classProps.container}>\n <select\n {...transferProps}\n {...ariaDescribedByProp}\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n required={isRequired}\n ref={ref}\n >\n {children}\n </select>\n <div className={classProps.icon}>\n <Icon name=\"chevron-down\" boxSize={size === Sizes.SMALL ? 16 : 20} />\n </div>\n </div>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__validationText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n );\n};\n\nconst Select = forwardRef<HTMLSelectElement, SpiritSelectProps>(_Select) as ForwardRefComponent<\n HTMLSelectElement,\n SpiritSelectProps\n>;\n\nSelect.spiritComponent = 'Select';\nSelect.displayName = 'Select';\n\nexport default Select;\n"],"names":["_Select","props","ref","ariaDescribedBy","children","hasValidationIcon","helperText","id","isDisabled","isFluid","isLabelHidden","isRequired","label","size","Sizes","validationState","validationText","restProps","classProps","useSelectStyleProps","styleProps","transferProps","useStyleProps","ids","register","useAriaIds","ariaDescribedByProp","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","Label","Icon","HelperText","ValidationText","Select","forwardRef"],"mappings":";;;;;;;;;;;;;;AAYA,MAAMA,IAAU,CAACC,GAA0BC,MAAyC;AAClF,QAAM;AAAA,IACJ,oBAAoBC,IAAkB;AAAA,IACtC,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC,IAAOC,EAAM;AAAA,IACb,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDhB,GACE,EAAE,YAAAiB,EAAA,IAAeC,EAAoB;AAAA,IAEzC,YAAAX;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,MAAAE;AAAA,IACA,iBAAAE;AAAA,EAAA,CACD,GACK,EAAE,YAAAK,GAAY,OAAOC,EAAA,IAAkBC,EAAcL,CAAS,GAC9D,CAACM,GAAKC,CAAQ,IAAIC,EAAWtB,CAAe,GAC5CuB,IAAsBC,EAAmBJ,CAAG,GAC5CK,IAAqBC,EAAsB;AAAA,IAC/C,iBAAAd;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD;AAED,SACE,gBAAAc,EAAC,OAAA,EAAK,GAAGV,GAAY,WAAWW,EAAWb,EAAW,MAAME,EAAW,SAAS,GAC9E,UAAA;AAAA,IAAA,gBAAAY,EAACC,KAAM,SAAS1B,GAAI,kBAAkBW,EAAW,OAC9C,UAAAN,GACH;AAAA,IACA,gBAAAkB,EAAC,OAAA,EAAI,WAAWZ,EAAW,WACzB,UAAA;AAAA,MAAA,gBAAAc;AAAA,QAAC;AAAA,QAAA;AAAA,UACE,GAAGX;AAAA,UACH,GAAGK;AAAA,UACJ,IAAAnB;AAAA,UACA,WAAWW,EAAW;AAAA,UACtB,UAAUV;AAAA,UACV,UAAUG;AAAA,UACV,KAAAT;AAAA,UAEC,UAAAE;AAAA,QAAA;AAAA,MAAA;AAAA,MAEH,gBAAA4B,EAAC,OAAA,EAAI,WAAWd,EAAW,MACzB,UAAA,gBAAAc,EAACE,GAAA,EAAK,MAAK,gBAAe,SAASrB,MAASC,EAAM,QAAQ,KAAK,IAAI,EAAA,CACrE;AAAA,IAAA,GACF;AAAA,IACA,gBAAAkB;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,kBAAkBjB,EAAW;AAAA,QAC7B,IAAI,GAAGX,CAAE;AAAA,QACT,cAAciB;AAAA,QACd,YAAAlB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEDS,KACC,gBAAAiB;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,kBAAkBlB,EAAW;AAAA,QAC5B,GAAIb,KAAqB,EAAE,wBAAwBU,EAAA;AAAA,QACpD,IAAI,GAAGR,CAAE;AAAA,QACT,gBAAAS;AAAA,QACA,cAAcQ;AAAA,QACd,MAAMI;AAAA,MAAA;AAAA,IAAA;AAAA,EACR,GAEJ;AAEJ,GAEMS,IAASC,EAAiDtC,CAAO;AAKvEqC,EAAO,kBAAkB;AACzBA,EAAO,cAAc;"}
1
+ {"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.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 { type ForwardRefComponent, type SpiritSelectProps } from '../../types';\nimport { HelperText, Label, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { Icon } from '../Icon';\nimport { useSelectStyleProps } from './useSelectStyleProps';\n\nconst _Select = (props: SpiritSelectProps, ref: ForwardedRef<HTMLSelectElement>) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n children,\n hasValidationIcon,\n helperText,\n id,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n label,\n size = Sizes.MEDIUM,\n validationState,\n validationText,\n ...restProps\n } = props;\n const { classProps } = useSelectStyleProps({\n hasValidationIcon,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n size,\n validationState,\n });\n const { styleProps, props: transferProps } = useStyleProps(restProps);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\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 <div className={classProps.container}>\n <select\n {...transferProps}\n {...ariaDescribedByProp}\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n required={isRequired}\n ref={ref}\n >\n {children}\n </select>\n <div className={classProps.icon}>\n <Icon name=\"chevron-down\" boxSize={size === Sizes.SMALL ? 16 : 20} />\n </div>\n </div>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__validationText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n );\n};\n\nconst Select = forwardRef<HTMLSelectElement, SpiritSelectProps>(_Select) as ForwardRefComponent<\n HTMLSelectElement,\n SpiritSelectProps\n>;\n\nSelect.spiritComponent = 'Select';\nSelect.displayName = 'Select';\n\nexport default Select;\n"],"names":["_Select","props","ref","ariaDescribedBy","children","hasValidationIcon","helperText","id","isDisabled","isFluid","isLabelHidden","isRequired","label","size","Sizes","validationState","validationText","restProps","classProps","useSelectStyleProps","styleProps","transferProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","Label","Icon","HelperText","ValidationText","Select","forwardRef"],"mappings":";;;;;;;;;;;;;AAYA,MAAMA,IAAU,CAACC,GAA0BC,MAAyC;AAClF,QAAM;AAAA,IACJ,oBAAoBC,IAAkB;AAAA,IACtC,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC,IAAOC,EAAM;AAAA,IACb,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDhB,GACE,EAAE,YAAAiB,EAAA,IAAeC,EAAoB;AAAA,IAEzC,YAAAX;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,MAAAE;AAAA,IACA,iBAAAE;AAAA,EAAA,CACD,GACK,EAAE,YAAAK,GAAY,OAAOC,EAAA,IAAkBC,EAAcL,CAAS,GAC9D,CAACM,GAAqBC,CAAQ,IAAIC,EAAmBtB,CAAe,GACpEuB,IAAqBC,EAAsB;AAAA,IAC/C,iBAAAZ;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD;AAED,SACE,gBAAAY,EAAC,OAAA,EAAK,GAAGR,GAAY,WAAWS,EAAWX,EAAW,MAAME,EAAW,SAAS,GAC9E,UAAA;AAAA,IAAA,gBAAAU,EAACC,KAAM,SAASxB,GAAI,kBAAkBW,EAAW,OAC9C,UAAAN,GACH;AAAA,IACA,gBAAAgB,EAAC,OAAA,EAAI,WAAWV,EAAW,WACzB,UAAA;AAAA,MAAA,gBAAAY;AAAA,QAAC;AAAA,QAAA;AAAA,UACE,GAAGT;AAAA,UACH,GAAGE;AAAA,UACJ,IAAAhB;AAAA,UACA,WAAWW,EAAW;AAAA,UACtB,UAAUV;AAAA,UACV,UAAUG;AAAA,UACV,KAAAT;AAAA,UAEC,UAAAE;AAAA,QAAA;AAAA,MAAA;AAAA,MAEH,gBAAA0B,EAAC,OAAA,EAAI,WAAWZ,EAAW,MACzB,UAAA,gBAAAY,EAACE,GAAA,EAAK,MAAK,gBAAe,SAASnB,MAASC,EAAM,QAAQ,KAAK,IAAI,EAAA,CACrE;AAAA,IAAA,GACF;AAAA,IACA,gBAAAgB;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,kBAAkBf,EAAW;AAAA,QAC7B,IAAI,GAAGX,CAAE;AAAA,QACT,cAAciB;AAAA,QACd,YAAAlB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEDS,KACC,gBAAAe;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,kBAAkBhB,EAAW;AAAA,QAC5B,GAAIb,KAAqB,EAAE,wBAAwBU,EAAA;AAAA,QACpD,IAAI,GAAGR,CAAE;AAAA,QACT,gBAAAS;AAAA,QACA,cAAcQ;AAAA,QACd,MAAME;AAAA,MAAA;AAAA,IAAA;AAAA,EACR,GAEJ;AAEJ,GAEMS,IAASC,EAAiDpC,CAAO;AAKvEmC,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 s=require("react/jsx-runtime"),I=require("classnames"),E=require("react"),F=require("../../hooks/styleProps.cjs"),$=require("../../hooks/useAriaDescribedBy.cjs"),B=require("../Field/HelperText.cjs"),U=require("../Field/Label.cjs"),L=require("../Field/useAriaIds.cjs"),M=require("../Field/ValidationText.cjs"),C=require("../Field/useValidationTextRole.cjs"),O=require("./constants.cjs"),w=require("./useSliderStyleProps.cjs"),H={...O.SLIDER_DEFAULT_PROPS},W=(P,m)=>{const b={...H,...P},{"aria-describedby":T,hasValidationIcon:h,helperText:q,id:t,isDisabled:l,label:N,max:n,min:i,step:_,validationState:r,validationText:c,value:d,...f}=b,{classProps:e,props:v}=w.useSliderStyleProps({...f,isDisabled:l,validationState:r}),{styleProps:u,props:A}=F.useStyleProps(v),[g,p]=L.default(T),D=$.useAriaDescribedBy(g),R=C.useValidationTextRole({validationState:r,validationText:c}),S="--slider-position",x=a=>`${Math.round(100*(a-i)/(n-i))}%`,j=a=>{const{target:y}=a,{value:V}=y;y.style.setProperty(S,x(Number(V)))};return s.jsxs("div",{...u,...A,className:I(e.root,u.className),children:[s.jsx(U.default,{htmlFor:t,UNSAFE_className:e.label,children:N}),s.jsx("input",{...D,className:e.input,id:t,onInput:j,style:{[S]:`${x(d)}`},type:"range",min:i,max:n,step:_,value:d,disabled:l,ref:m}),s.jsx(B.default,{UNSAFE_className:e.helperText,helperText:q,id:`${t}__helperText`,registerAria:p}),r&&s.jsx(M.default,{UNSAFE_className:e.validationText,...h&&{hasValidationStateIcon:r},id:`${t}__validationText`,registerAria:p,validationText:c,role:R})]})},o=E.forwardRef(W);o.spiritComponent="Slider";o.displayName="Slider";exports.default=o;
1
+ "use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),V=require("classnames"),I=require("react"),E=require("../../hooks/styleProps.cjs"),F=require("../../hooks/useAriaIdRefs.cjs"),$=require("../Field/HelperText.cjs"),U=require("../Field/Label.cjs"),B=require("../Field/ValidationText.cjs"),L=require("../Field/useValidationTextRole.cjs"),M=require("./constants.cjs"),C=require("./useSliderStyleProps.cjs"),O={...M.SLIDER_DEFAULT_PROPS},w=(m,y)=>{const b={...O,...m},{"aria-describedby":T,hasValidationIcon:h,helperText:N,id:t,isDisabled:l,label:_,max:n,min:i,step:f,validationState:r,validationText:c,value:d,...q}=b,{classProps:e,props:v}=C.useSliderStyleProps({...q,isDisabled:l,validationState:r}),{styleProps:u,props:R}=E.useStyleProps(v),[g,p]=F.useAriaDescribedBy(T),A=L.useValidationTextRole({validationState:r,validationText:c}),S="--slider-position",x=a=>`${Math.round(100*(a-i)/(n-i))}%`,j=a=>{const{target:P}=a,{value:D}=P;P.style.setProperty(S,x(Number(D)))};return s.jsxs("div",{...u,...R,className:V(e.root,u.className),children:[s.jsx(U.default,{htmlFor:t,UNSAFE_className:e.label,children:_}),s.jsx("input",{...g,className:e.input,id:t,onInput:j,style:{[S]:`${x(d)}`},type:"range",min:i,max:n,step:f,value:d,disabled:l,ref:y}),s.jsx($.default,{UNSAFE_className:e.helperText,helperText:N,id:`${t}__helperText`,registerAria:p}),r&&s.jsx(B.default,{UNSAFE_className:e.validationText,...h&&{hasValidationStateIcon:r},id:`${t}__validationText`,registerAria:p,validationText:c,role:A})]})},o=I.forwardRef(w);o.spiritComponent="Slider";o.displayName="Slider";exports.default=o;
2
2
  //# sourceMappingURL=Slider.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.cjs","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":"wiBAWMA,EAAe,CACnB,GAAGC,EAAAA,oBACL,EAEMC,EAAU,CAACC,EAA0BC,IAAwC,CACjF,MAAMC,EAAoB,CAAE,GAAGL,EAAc,GAAGG,CAAA,EAC1C,CACJ,mBAAoBG,EACpB,kBAAAC,EACA,WAAAC,EACA,GAAAC,EACA,WAAAC,EACA,MAAAC,EACA,IAAAC,EACA,IAAAC,EACA,KAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,MAAAC,EACA,GAAGC,CAAA,EACDb,EAEE,CAAE,WAAAc,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,oBAAoB,CAC/D,GAAGH,EACH,WAAAR,EACA,gBAAAK,CAAA,CACD,EACK,CAAA,WAAEO,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcJ,CAAa,EAC/D,CAACK,EAAKC,CAAQ,EAAIC,EAAAA,QAAWrB,CAAe,EAC5CsB,EAAsBC,EAAAA,mBAAmBJ,CAAG,EAC5CK,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAhB,EACA,eAAAC,CAAA,CACD,EAEKgB,EAAc,oBAEdC,EAAqBC,GAAgB,GAAG,KAAK,MAAO,KAAOA,EAAMrB,IAASD,EAAMC,EAAI,CAAC,IAErFsB,EAAeC,GAAuC,CAC1D,KAAM,CAAE,OAAAC,GAAWD,EACb,CAAE,MAAOE,CAAA,EAAeD,EAE9BA,EAAO,MAAM,YAAYL,EAAaC,EAAkB,OAAOK,CAAU,CAAC,CAAC,CAC7E,EAEA,OACEC,EAAAA,KAAC,MAAA,CAAK,GAAGjB,EAAa,GAAGC,EAAY,UAAWiB,EAAWrB,EAAW,KAAMG,EAAW,SAAS,EAC9F,SAAA,CAAAmB,MAACC,EAAAA,SAAM,QAASjC,EAAI,iBAAkBU,EAAW,MAC9C,SAAAR,EACH,EACA8B,EAAAA,IAAC,QAAA,CACE,GAAGb,EACJ,UAAWT,EAAW,MACtB,GAAAV,EACA,QAAS0B,EACT,MAAO,CAAE,CAACH,CAAW,EAAG,GAAGC,EAAkBhB,CAAK,CAAC,EAAA,EACnD,KAAK,QACL,IAAAJ,EACA,IAAAD,EACA,KAAAE,EACA,MAAAG,EACA,SAAUP,EACV,IAAAN,CAAA,CAAA,EAEFqC,EAAAA,IAACE,EAAAA,QAAA,CACC,iBAAkBxB,EAAW,WAC7B,WAAAX,EACA,GAAI,GAAGC,CAAE,eACT,aAAciB,CAAA,CAAA,EAEfX,GACC0B,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBzB,EAAW,eAC5B,GAAIZ,GAAqB,CAAE,uBAAwBQ,CAAA,EACpD,GAAI,GAAGN,CAAE,mBACT,aAAciB,EACd,eAAAV,EACA,KAAMc,CAAA,CAAA,CACR,EAEJ,CAEJ,EAEMe,EAASC,EAAAA,WAAgD5C,CAAO,EAKtE2C,EAAO,gBAAkB,SACzBA,EAAO,YAAc"}
1
+ {"version":3,"file":"Slider.cjs","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":"8fAWMA,EAAe,CACnB,GAAGC,EAAAA,oBACL,EAEMC,EAAU,CAACC,EAA0BC,IAAwC,CACjF,MAAMC,EAAoB,CAAE,GAAGL,EAAc,GAAGG,CAAA,EAC1C,CACJ,mBAAoBG,EACpB,kBAAAC,EACA,WAAAC,EACA,GAAAC,EACA,WAAAC,EACA,MAAAC,EACA,IAAAC,EACA,IAAAC,EACA,KAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,MAAAC,EACA,GAAGC,CAAA,EACDb,EAEE,CAAE,WAAAc,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,oBAAoB,CAC/D,GAAGH,EACH,WAAAR,EACA,gBAAAK,CAAA,CACD,EACK,CAAA,WAAEO,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcJ,CAAa,EAC/D,CAACK,EAAqBC,CAAQ,EAAIC,EAAAA,mBAAmBrB,CAAe,EACpEsB,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAd,EACA,eAAAC,CAAA,CACD,EAEKc,EAAc,oBAEdC,EAAqBC,GAAgB,GAAG,KAAK,MAAO,KAAOA,EAAMnB,IAASD,EAAMC,EAAI,CAAC,IAErFoB,EAAeC,GAAuC,CAC1D,KAAM,CAAE,OAAAC,GAAWD,EACb,CAAE,MAAOE,CAAA,EAAeD,EAE9BA,EAAO,MAAM,YAAYL,EAAaC,EAAkB,OAAOK,CAAU,CAAC,CAAC,CAC7E,EAEA,OACEC,EAAAA,KAAC,MAAA,CAAK,GAAGf,EAAa,GAAGC,EAAY,UAAWe,EAAWnB,EAAW,KAAMG,EAAW,SAAS,EAC9F,SAAA,CAAAiB,MAACC,EAAAA,SAAM,QAAS/B,EAAI,iBAAkBU,EAAW,MAC9C,SAAAR,EACH,EACA4B,EAAAA,IAAC,QAAA,CACE,GAAGd,EACJ,UAAWN,EAAW,MACtB,GAAAV,EACA,QAASwB,EACT,MAAO,CAAE,CAACH,CAAW,EAAG,GAAGC,EAAkBd,CAAK,CAAC,EAAA,EACnD,KAAK,QACL,IAAAJ,EACA,IAAAD,EACA,KAAAE,EACA,MAAAG,EACA,SAAUP,EACV,IAAAN,CAAA,CAAA,EAEFmC,EAAAA,IAACE,EAAAA,QAAA,CACC,iBAAkBtB,EAAW,WAC7B,WAAAX,EACA,GAAI,GAAGC,CAAE,eACT,aAAciB,CAAA,CAAA,EAEfX,GACCwB,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBvB,EAAW,eAC5B,GAAIZ,GAAqB,CAAE,uBAAwBQ,CAAA,EACpD,GAAI,GAAGN,CAAE,mBACT,aAAciB,EACd,eAAAV,EACA,KAAMY,CAAA,CAAA,CACR,EAEJ,CAEJ,EAEMe,EAASC,EAAAA,WAAgD1C,CAAO,EAKtEyC,EAAO,gBAAkB,SACzBA,EAAO,YAAc"}