@pega/cosmos-react-core 8.0.0-build.4.2 → 8.0.0-build.4.4

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 (485) hide show
  1. package/lib/components/Actions/Actions.js.map +1 -1
  2. package/lib/components/AppShell/AppHeader.js.map +1 -1
  3. package/lib/components/AppShell/AppHeader.styles.d.ts +1 -1
  4. package/lib/components/AppShell/AppShell.js.map +1 -1
  5. package/lib/components/AppShell/AppShell.styles.d.ts +2 -2
  6. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  7. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  8. package/lib/components/AppShell/AppShellList.js.map +1 -1
  9. package/lib/components/AppShell/AppShellList.styles.d.ts +4 -4
  10. package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
  11. package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
  12. package/lib/components/AppShell/AppShellSearch.js.map +1 -1
  13. package/lib/components/AppShell/AppShellSearch.styles.js.map +1 -1
  14. package/lib/components/AppShell/Drawer.js.map +1 -1
  15. package/lib/components/AppShell/NavigationList.js.map +1 -1
  16. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
  17. package/lib/components/AppShell/Operator.d.ts +3 -3
  18. package/lib/components/AppShell/Operator.d.ts.map +1 -1
  19. package/lib/components/AppShell/Operator.js.map +1 -1
  20. package/lib/components/AppShell/style-utils.d.ts.map +1 -1
  21. package/lib/components/AppShell/style-utils.js.map +1 -1
  22. package/lib/components/AppShell/utils.d.ts.map +1 -1
  23. package/lib/components/AppShell/utils.js.map +1 -1
  24. package/lib/components/Avatar/Avatar.d.ts +5 -5
  25. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  26. package/lib/components/Avatar/Avatar.js.map +1 -1
  27. package/lib/components/Avatar/Avatar.test-ids.d.ts +1 -1
  28. package/lib/components/Avatar/Avatar.test-ids.d.ts.map +1 -1
  29. package/lib/components/Backdrop/Backdrop.d.ts +2 -2
  30. package/lib/components/Backdrop/Backdrop.js.map +1 -1
  31. package/lib/components/Backdrop/Backdrop.test-ids.d.ts +1 -1
  32. package/lib/components/Backdrop/Backdrop.test-ids.d.ts.map +1 -1
  33. package/lib/components/Badges/Alert.d.ts +2 -5
  34. package/lib/components/Badges/Alert.d.ts.map +1 -1
  35. package/lib/components/Badges/Badges.test-ids.d.ts +6 -6
  36. package/lib/components/Badges/Badges.test-ids.d.ts.map +1 -1
  37. package/lib/components/Badges/Count.d.ts +1 -1
  38. package/lib/components/Badges/Count.js +6 -6
  39. package/lib/components/Badges/Count.js.map +1 -1
  40. package/lib/components/Badges/Keyboard.d.ts +1 -1
  41. package/lib/components/Badges/Selection.d.ts +1 -1
  42. package/lib/components/Badges/Selection.js.map +1 -1
  43. package/lib/components/Badges/Status.d.ts +1 -1
  44. package/lib/components/Badges/Tag.d.ts +1 -1
  45. package/lib/components/Banner/Banner.d.ts +3 -3
  46. package/lib/components/Banner/Banner.d.ts.map +1 -1
  47. package/lib/components/Banner/Banner.js.map +1 -1
  48. package/lib/components/Banner/Banner.test-ids.d.ts +1 -1
  49. package/lib/components/Banner/Banner.test-ids.d.ts.map +1 -1
  50. package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  51. package/lib/components/Button/BareButton.js.map +1 -1
  52. package/lib/components/Button/BareRoleButton.js.map +1 -1
  53. package/lib/components/Button/Button.js.map +1 -1
  54. package/lib/components/ColorPicker/ColorPicker.d.ts +1 -1
  55. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  56. package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts +1 -1
  57. package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts.map +1 -1
  58. package/lib/components/ComboBox/ComboBox.d.ts +1 -1
  59. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  60. package/lib/components/ComboBox/ComboBox.styles.d.ts +1 -1
  61. package/lib/components/ComboBox/ComboxBox.test-ids.d.ts +1 -1
  62. package/lib/components/ComboBox/ComboxBox.test-ids.d.ts.map +1 -1
  63. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  64. package/lib/components/CompositeInput/CompositeInput.d.ts +1 -1
  65. package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
  66. package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
  67. package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts +1 -1
  68. package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts.map +1 -1
  69. package/lib/components/Configuration/Configuration.js.map +1 -1
  70. package/lib/components/Configuration/connected-watcher.js.map +1 -1
  71. package/lib/components/Configuration/withConfiguration.d.ts.map +1 -1
  72. package/lib/components/CreditCard/CreditCardInput.d.ts +10 -13
  73. package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -1
  74. package/lib/components/CreditCard/CreditCardInput.js.map +1 -1
  75. package/lib/components/CreditCard/utils.js.map +1 -1
  76. package/lib/components/Currency/Currency.test-ids.d.ts +1 -1
  77. package/lib/components/Currency/Currency.test-ids.d.ts.map +1 -1
  78. package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
  79. package/lib/components/Currency/CurrencyInput.d.ts +1 -1
  80. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  81. package/lib/components/Currency/utils.d.ts +3 -3
  82. package/lib/components/Currency/utils.d.ts.map +1 -1
  83. package/lib/components/Currency/utils.js +1 -1
  84. package/lib/components/Currency/utils.js.map +1 -1
  85. package/lib/components/DateTime/DateTime.test-ids.d.ts +11 -11
  86. package/lib/components/DateTime/DateTime.test-ids.d.ts.map +1 -1
  87. package/lib/components/DateTime/Input/DateInput.d.ts +1 -1
  88. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  89. package/lib/components/DateTime/Input/DateInput.js +7 -7
  90. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  91. package/lib/components/DateTime/Input/DateRangeInput.d.ts +1 -1
  92. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  93. package/lib/components/DateTime/Input/DateTime.styles.d.ts +2 -2
  94. package/lib/components/DateTime/Input/DateTimeInput.d.ts +1 -1
  95. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  96. package/lib/components/DateTime/Input/DateTimeInput.js +12 -13
  97. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  98. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +1 -1
  99. package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
  100. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts +1 -1
  101. package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
  102. package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
  103. package/lib/components/DateTime/Input/MonthInput.d.ts +1 -1
  104. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  105. package/lib/components/DateTime/Input/PartInput.js.map +1 -1
  106. package/lib/components/DateTime/Input/QuarterInput.d.ts +1 -1
  107. package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
  108. package/lib/components/DateTime/Input/TimeInput.d.ts +1 -1
  109. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  110. package/lib/components/DateTime/Input/TimeInput.js +8 -9
  111. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  112. package/lib/components/DateTime/Input/TimeRangeInput.d.ts +1 -1
  113. package/lib/components/DateTime/Input/WeekInput.d.ts +1 -1
  114. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  115. package/lib/components/DateTime/Input/useAutoFocusNextInput.d.ts.map +1 -1
  116. package/lib/components/DateTime/Input/useAutoFocusNextInput.js.map +1 -1
  117. package/lib/components/DateTime/Input/usePickerButton.d.ts.map +1 -1
  118. package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
  119. package/lib/components/DateTime/Input/utils.d.ts +3 -2
  120. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  121. package/lib/components/DateTime/Input/utils.js +39 -12
  122. package/lib/components/DateTime/Input/utils.js.map +1 -1
  123. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  124. package/lib/components/DateTime/Picker/DatePicker.d.ts +1 -1
  125. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  126. package/lib/components/DateTime/Picker/DatePicker.js +4 -2
  127. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  128. package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
  129. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  130. package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
  131. package/lib/components/DateTime/Picker/utils.d.ts +1 -1
  132. package/lib/components/DateTime/Picker/utils.js.map +1 -1
  133. package/lib/components/DateTime/utils.js.map +1 -1
  134. package/lib/components/Dialog/Dialog.styles.d.ts +1 -1
  135. package/lib/components/Dialog/Dialog.styles.d.ts.map +1 -1
  136. package/lib/components/Dialog/FormDialog.d.ts +2 -2
  137. package/lib/components/Dialog/FormDialog.js.map +1 -1
  138. package/lib/components/Dialog/InfoDialog.js.map +1 -1
  139. package/lib/components/Dialog/InfoDialog.styles.d.ts +2 -2
  140. package/lib/components/Drawer/Drawer.js.map +1 -1
  141. package/lib/components/EmojiPicker/EmojiDisplay.js.map +1 -1
  142. package/lib/components/EmojiPicker/EmojiPicker.js.map +1 -1
  143. package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
  144. package/lib/components/FieldGroup/FieldGroup.d.ts +2 -2
  145. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  146. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  147. package/lib/components/FieldValueList/FieldValueList.d.ts +2 -2
  148. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  149. package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts +2 -2
  150. package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts.map +1 -1
  151. package/lib/components/File/File.test-ids.d.ts +1 -1
  152. package/lib/components/File/File.test-ids.d.ts.map +1 -1
  153. package/lib/components/File/FileDisplay.js.map +1 -1
  154. package/lib/components/File/FileInput.d.ts +1 -1
  155. package/lib/components/File/FileInput.js.map +1 -1
  156. package/lib/components/File/FileInput.styles.d.ts +6 -6
  157. package/lib/components/File/FileItem.d.ts +2 -2
  158. package/lib/components/File/FileItem.js.map +1 -1
  159. package/lib/components/File/FileList.d.ts +1 -1
  160. package/lib/components/File/FileList.d.ts.map +1 -1
  161. package/lib/components/File/FileList.js.map +1 -1
  162. package/lib/components/File/FileUploadItem.js.map +1 -1
  163. package/lib/components/File/FileVisual.js.map +1 -1
  164. package/lib/components/Flex/Flex.d.ts +1 -1
  165. package/lib/components/Flex/Flex.d.ts.map +1 -1
  166. package/lib/components/Flex/Flex.js.map +1 -1
  167. package/lib/components/Form/Form.d.ts +1 -1
  168. package/lib/components/Form/Form.test-ids.d.ts +1 -1
  169. package/lib/components/Form/Form.test-ids.d.ts.map +1 -1
  170. package/lib/components/FormControl/FormControl.d.ts +1 -1
  171. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  172. package/lib/components/FormField/FormField.d.ts +1 -1
  173. package/lib/components/FormField/FormField.js.map +1 -1
  174. package/lib/components/FormField/FormField.test-ids.d.ts +1 -1
  175. package/lib/components/FormField/FormField.test-ids.d.ts.map +1 -1
  176. package/lib/components/Fullscreen/Fullscreen.d.ts +1 -1
  177. package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts +1 -1
  178. package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts.map +1 -1
  179. package/lib/components/Fullscreen/FullscreenButton.js.map +1 -1
  180. package/lib/components/Grid/Grid.d.ts +1 -1
  181. package/lib/components/Grid/Grid.d.ts.map +1 -1
  182. package/lib/components/Grid/Grid.js.map +1 -1
  183. package/lib/components/HTML/HTML.d.ts +1 -1
  184. package/lib/components/HTML/HTML.d.ts.map +1 -1
  185. package/lib/components/HTML/HTML.js +3 -2
  186. package/lib/components/HTML/HTML.js.map +1 -1
  187. package/lib/components/HTML/HTML.test-ids.d.ts +1 -1
  188. package/lib/components/HTML/HTML.test-ids.d.ts.map +1 -1
  189. package/lib/components/Icon/Icon.d.ts +5 -5
  190. package/lib/components/Icon/Icon.d.ts.map +1 -1
  191. package/lib/components/Icon/Icon.js.map +1 -1
  192. package/lib/components/IconPicker/IconPicker.js.map +1 -1
  193. package/lib/components/Input/Input.d.ts +1 -1
  194. package/lib/components/Input/Input.js.map +1 -1
  195. package/lib/components/Input/Input.test-ids.d.ts +1 -1
  196. package/lib/components/Input/Input.test-ids.d.ts.map +1 -1
  197. package/lib/components/Lightbox/Lightbox.d.ts +1 -1
  198. package/lib/components/Lightbox/Lightbox.js.map +1 -1
  199. package/lib/components/Lightbox/Lightbox.styles.d.ts +1 -1
  200. package/lib/components/Lightbox/Lightbox.test-ids.d.ts +1 -1
  201. package/lib/components/Lightbox/Lightbox.test-ids.d.ts.map +1 -1
  202. package/lib/components/Link/Link.d.ts +1 -1
  203. package/lib/components/Link/Link.d.ts.map +1 -1
  204. package/lib/components/Link/Link.js +41 -12
  205. package/lib/components/Link/Link.js.map +1 -1
  206. package/lib/components/Link/Link.test-ids.d.ts +1 -1
  207. package/lib/components/Link/Link.test-ids.d.ts.map +1 -1
  208. package/lib/components/List/List.d.ts.map +1 -1
  209. package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
  210. package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
  211. package/lib/components/ListToolbar/ListToolbar.styles.d.ts +2 -2
  212. package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
  213. package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +1 -1
  214. package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -1
  215. package/lib/components/ListToolbar/PresetMenuPopover.js.map +1 -1
  216. package/lib/components/ListToolbar/helpers.d.ts +1 -1
  217. package/lib/components/ListToolbar/helpers.d.ts.map +1 -1
  218. package/lib/components/ListToolbar/helpers.js.map +1 -1
  219. package/lib/components/LiveLog/LiveLog.js.map +1 -1
  220. package/lib/components/Location/CurrentLocationButton.js.map +1 -1
  221. package/lib/components/Location/Location.test-ids.d.ts +1 -1
  222. package/lib/components/Location/Location.test-ids.d.ts.map +1 -1
  223. package/lib/components/Location/Location.types.d.ts +1 -1
  224. package/lib/components/Location/Location.types.d.ts.map +1 -1
  225. package/lib/components/Location/Location.types.js +1 -0
  226. package/lib/components/Location/Location.types.js.map +1 -1
  227. package/lib/components/Location/LocationDisplay.js.map +1 -1
  228. package/lib/components/Location/LocationInput.d.ts +1 -1
  229. package/lib/components/Location/LocationInput.js.map +1 -1
  230. package/lib/components/Location/LocationView.d.ts +2 -2
  231. package/lib/components/Location/LocationView.d.ts.map +1 -1
  232. package/lib/components/Location/LocationView.js +32 -27
  233. package/lib/components/Location/LocationView.js.map +1 -1
  234. package/lib/components/Location/utils.d.ts +1 -1
  235. package/lib/components/Location/utils.d.ts.map +1 -1
  236. package/lib/components/Location/utils.js +1 -0
  237. package/lib/components/Location/utils.js.map +1 -1
  238. package/lib/components/Menu/FlyoutMenuList.js.map +1 -1
  239. package/lib/components/Menu/Menu.d.ts +1 -1
  240. package/lib/components/Menu/Menu.js.map +1 -1
  241. package/lib/components/Menu/Menu.styles.d.ts +3 -3
  242. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  243. package/lib/components/Menu/Menu.test-ids.d.ts +2 -2
  244. package/lib/components/Menu/Menu.test-ids.d.ts.map +1 -1
  245. package/lib/components/Menu/Menu.utils.d.ts.map +1 -1
  246. package/lib/components/Menu/MenuGroup.js.map +1 -1
  247. package/lib/components/Menu/MenuItem.d.ts +1 -1
  248. package/lib/components/Menu/MenuItem.js.map +1 -1
  249. package/lib/components/Menu/MenuList.d.ts.map +1 -1
  250. package/lib/components/Menu/MenuList.js +13 -5
  251. package/lib/components/Menu/MenuList.js.map +1 -1
  252. package/lib/components/Menu/MenuListHeader.js.map +1 -1
  253. package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
  254. package/lib/components/Menu/NavItemsList.js.map +1 -1
  255. package/lib/components/Menu/helpers.d.ts +17 -31
  256. package/lib/components/Menu/helpers.d.ts.map +1 -1
  257. package/lib/components/Menu/helpers.js.map +1 -1
  258. package/lib/components/MenuButton/MenuButton.d.ts +1 -1
  259. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  260. package/lib/components/MenuButton/MenuButton.test-ids.d.ts +1 -1
  261. package/lib/components/MenuButton/MenuButton.test-ids.d.ts.map +1 -1
  262. package/lib/components/MetaList/MetaList.d.ts +1 -1
  263. package/lib/components/MetaList/MetaList.test-ids.d.ts +1 -1
  264. package/lib/components/MetaList/MetaList.test-ids.d.ts.map +1 -1
  265. package/lib/components/Modal/MinimizedModal.js.map +1 -1
  266. package/lib/components/Modal/Modal.js.map +1 -1
  267. package/lib/components/Modal/Modal.styles.d.ts +2 -2
  268. package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
  269. package/lib/components/Modal/Modal.styles.js.map +1 -1
  270. package/lib/components/Modal/ModalManager.js.map +1 -1
  271. package/lib/components/MultiStepForm/FormProgress.styles.d.ts +3 -3
  272. package/lib/components/MultiStepForm/FormProgress.styles.d.ts.map +1 -1
  273. package/lib/components/MultiStepForm/HorizontalFormProgress.js.map +1 -1
  274. package/lib/components/MultiStepForm/MultiStepForm.d.ts +2 -2
  275. package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
  276. package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
  277. package/lib/components/Number/Number.test-ids.d.ts +2 -2
  278. package/lib/components/Number/Number.test-ids.d.ts.map +1 -1
  279. package/lib/components/Number/NumberInput.d.ts +1 -1
  280. package/lib/components/Number/NumberInput.js.map +1 -1
  281. package/lib/components/Number/NumberInput.styles.d.ts +2 -2
  282. package/lib/components/Number/NumberRangeInput.d.ts +1 -1
  283. package/lib/components/Number/utils.d.ts +1 -1
  284. package/lib/components/Number/utils.d.ts.map +1 -1
  285. package/lib/components/Number/utils.js.map +1 -1
  286. package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
  287. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +1 -1
  288. package/lib/components/PageTemplates/DashboardPage.d.ts +2 -2
  289. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  290. package/lib/components/PageTemplates/PageTemplates.d.ts +2 -2
  291. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  292. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  293. package/lib/components/Phone/Phone.test-ids.d.ts +1 -1
  294. package/lib/components/Phone/Phone.test-ids.d.ts.map +1 -1
  295. package/lib/components/Phone/PhoneInput.d.ts +1 -1
  296. package/lib/components/Phone/PhoneInput.js.map +1 -1
  297. package/lib/components/Phone/utils.js.map +1 -1
  298. package/lib/components/Popover/Popover.js +1 -1
  299. package/lib/components/Popover/Popover.js.map +1 -1
  300. package/lib/components/Popover/Popover.styles.d.ts +2 -2
  301. package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
  302. package/lib/components/Popover/modifiers.js.map +1 -1
  303. package/lib/components/Progress/Bar.js.map +1 -1
  304. package/lib/components/Progress/Progress.js.map +1 -1
  305. package/lib/components/Progress/Progress.styles.d.ts +1 -1
  306. package/lib/components/RadioCheck/RadioCheck.d.ts +2 -2
  307. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  308. package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
  309. package/lib/components/Rating/Rating.js.map +1 -1
  310. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  311. package/lib/components/SearchInput/SearchInput.styles.d.ts +2 -2
  312. package/lib/components/Select/Select.d.ts +1 -1
  313. package/lib/components/Select/Select.test-ids.d.ts +1 -1
  314. package/lib/components/Select/Select.test-ids.d.ts.map +1 -1
  315. package/lib/components/ShortcutManager/ShortcutManager.js.map +1 -1
  316. package/lib/components/SkipLinks/SkipLinks.d.ts +1 -1
  317. package/lib/components/SkipLinks/SkipLinks.d.ts.map +1 -1
  318. package/lib/components/Slider/Slider.d.ts +1 -1
  319. package/lib/components/Slider/Slider.js.map +1 -1
  320. package/lib/components/Slider/Slider.styles.d.ts +7 -7
  321. package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
  322. package/lib/components/Slider/Slider.test-ids.d.ts +1 -1
  323. package/lib/components/Slider/Slider.test-ids.d.ts.map +1 -1
  324. package/lib/components/Slider/SliderTicks.js.map +1 -1
  325. package/lib/components/Slider/utils.d.ts +1 -1
  326. package/lib/components/Slider/utils.d.ts.map +1 -1
  327. package/lib/components/Slider/utils.js.map +1 -1
  328. package/lib/components/SummaryItem/SummaryItem.d.ts +6 -6
  329. package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
  330. package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts +1 -1
  331. package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts.map +1 -1
  332. package/lib/components/SummaryList/SummaryList.d.ts +2 -2
  333. package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
  334. package/lib/components/SummaryList/SummaryList.js.map +1 -1
  335. package/lib/components/SummaryList/ViewAll.d.ts +1 -1
  336. package/lib/components/Table/Table.d.ts.map +1 -1
  337. package/lib/components/Tabs/Tab.d.ts +2 -1
  338. package/lib/components/Tabs/Tab.d.ts.map +1 -1
  339. package/lib/components/Tabs/TabPanel.js.map +1 -1
  340. package/lib/components/Tabs/Tabs.js.map +1 -1
  341. package/lib/components/Tabs/Tabs.styles.d.ts +1 -1
  342. package/lib/components/Text/Text.d.ts +3 -2
  343. package/lib/components/Text/Text.d.ts.map +1 -1
  344. package/lib/components/Text/Text.js.map +1 -1
  345. package/lib/components/TextArea/TextArea.d.ts +1 -1
  346. package/lib/components/TextArea/TextArea.js.map +1 -1
  347. package/lib/components/TextArea/TextArea.test-ids.d.ts +1 -1
  348. package/lib/components/TextArea/TextArea.test-ids.d.ts.map +1 -1
  349. package/lib/components/Toaster/Toaster.d.ts +1 -1
  350. package/lib/components/Toaster/Toaster.js +1 -1
  351. package/lib/components/Toaster/Toaster.js.map +1 -1
  352. package/lib/components/Toaster/Toaster.test-ids.d.ts +1 -1
  353. package/lib/components/Toaster/Toaster.test-ids.d.ts.map +1 -1
  354. package/lib/components/Tooltip/Tooltip.d.ts +1 -1
  355. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  356. package/lib/components/Tooltip/Tooltip.test-ids.d.ts +1 -1
  357. package/lib/components/Tooltip/Tooltip.test-ids.d.ts.map +1 -1
  358. package/lib/components/Tree/StandardTree.js.map +1 -1
  359. package/lib/components/Tree/StandardTree.styles.d.ts +1 -1
  360. package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -1
  361. package/lib/components/Tree/Tree.d.ts +1 -1
  362. package/lib/components/Tree/Tree.d.ts.map +1 -1
  363. package/lib/components/Tree/Tree.test-ids.d.ts +2 -2
  364. package/lib/components/Tree/Tree.test-ids.d.ts.map +1 -1
  365. package/lib/components/Tree/helpers.d.ts +13 -13
  366. package/lib/components/Tree/helpers.d.ts.map +1 -1
  367. package/lib/components/Tree/helpers.js.map +1 -1
  368. package/lib/components/URL/URLDisplay.js.map +1 -1
  369. package/lib/hooks/useActiveDescendant.d.ts +2 -2
  370. package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
  371. package/lib/hooks/useActiveDescendant.js.map +1 -1
  372. package/lib/hooks/useAfterInitialEffect.d.ts.map +1 -1
  373. package/lib/hooks/useArrows.d.ts +6 -6
  374. package/lib/hooks/useArrows.d.ts.map +1 -1
  375. package/lib/hooks/useArrows.js.map +1 -1
  376. package/lib/hooks/useAutoResize.d.ts.map +1 -1
  377. package/lib/hooks/useAutoResize.js.map +1 -1
  378. package/lib/hooks/useBreakpoint.d.ts +3 -3
  379. package/lib/hooks/useBreakpoint.d.ts.map +1 -1
  380. package/lib/hooks/useBreakpoint.js.map +1 -1
  381. package/lib/hooks/useConsolidatedRef.d.ts.map +1 -1
  382. package/lib/hooks/useConsolidatedRef.js.map +1 -1
  383. package/lib/hooks/useDirection.d.ts.map +1 -1
  384. package/lib/hooks/useDraggable.d.ts.map +1 -1
  385. package/lib/hooks/useDraggable.js.map +1 -1
  386. package/lib/hooks/useElement.d.ts.map +1 -1
  387. package/lib/hooks/useEscape.d.ts.map +1 -1
  388. package/lib/hooks/useFocusTrap.d.ts.map +1 -1
  389. package/lib/hooks/useFocusTrap.js.map +1 -1
  390. package/lib/hooks/useFocusWithin.d.ts +1 -1
  391. package/lib/hooks/useFocusWithin.d.ts.map +1 -1
  392. package/lib/hooks/useFocusWithin.js.map +1 -1
  393. package/lib/hooks/useI18n.d.ts +4 -0
  394. package/lib/hooks/useI18n.d.ts.map +1 -1
  395. package/lib/hooks/useInputFormatter.d.ts.map +1 -1
  396. package/lib/hooks/useInputFormatter.js.map +1 -1
  397. package/lib/hooks/useItemIntersection.d.ts.map +1 -1
  398. package/lib/hooks/useItemIntersection.js.map +1 -1
  399. package/lib/hooks/useLongPress.d.ts +4 -4
  400. package/lib/hooks/useLongPress.d.ts.map +1 -1
  401. package/lib/hooks/useLongPress.js.map +1 -1
  402. package/lib/hooks/useOS.js.map +1 -1
  403. package/lib/hooks/useOuterEvent.d.ts.map +1 -1
  404. package/lib/hooks/useOuterEvent.js.map +1 -1
  405. package/lib/hooks/usePrevious.d.ts.map +1 -1
  406. package/lib/hooks/useRefMap.d.ts.map +1 -1
  407. package/lib/hooks/useRefMap.js.map +1 -1
  408. package/lib/hooks/useScrollStick.js.map +1 -1
  409. package/lib/hooks/useShortcut.d.ts +1 -1
  410. package/lib/hooks/useShortcut.d.ts.map +1 -1
  411. package/lib/hooks/useSimpleStore.d.ts.map +1 -1
  412. package/lib/hooks/useSimpleStore.js.map +1 -1
  413. package/lib/hooks/useSimpleStoreInstance.d.ts.map +1 -1
  414. package/lib/hooks/useTestIds.d.ts +2 -1
  415. package/lib/hooks/useTestIds.d.ts.map +1 -1
  416. package/lib/hooks/useTestIds.js.map +1 -1
  417. package/lib/hooks/useTheme.d.ts.map +1 -1
  418. package/lib/hooks/useTransitionState.d.ts +7 -7
  419. package/lib/hooks/useTransitionState.d.ts.map +1 -1
  420. package/lib/hooks/useTriggerableEffect.d.ts.map +1 -1
  421. package/lib/hooks/useTriggerableLayoutEffect.d.ts.map +1 -1
  422. package/lib/i18n/default.d.ts +4 -0
  423. package/lib/i18n/default.d.ts.map +1 -1
  424. package/lib/i18n/default.js +4 -0
  425. package/lib/i18n/default.js.map +1 -1
  426. package/lib/i18n/i18n.d.ts +5 -1
  427. package/lib/i18n/i18n.d.ts.map +1 -1
  428. package/lib/i18n/translate.d.ts.map +1 -1
  429. package/lib/i18n/translate.js.map +1 -1
  430. package/lib/init.js.map +1 -1
  431. package/lib/register-contexts.js.map +1 -1
  432. package/lib/styles/gradients.d.ts +3 -3
  433. package/lib/styles/gradients.d.ts.map +1 -1
  434. package/lib/styles/gradients.js.map +1 -1
  435. package/lib/styles/utils.d.ts.map +1 -1
  436. package/lib/styles/utils.js.map +1 -1
  437. package/lib/theme/ThemeMachine.js.map +1 -1
  438. package/lib/types/types.d.ts.map +1 -1
  439. package/lib/types/types.js.map +1 -1
  440. package/lib/utils/allowedURI.d.ts +7 -0
  441. package/lib/utils/allowedURI.d.ts.map +1 -0
  442. package/lib/utils/allowedURI.js +7 -0
  443. package/lib/utils/allowedURI.js.map +1 -0
  444. package/lib/utils/bindAll.d.ts.map +1 -1
  445. package/lib/utils/cap.d.ts.map +1 -1
  446. package/lib/utils/createStringMatcher.d.ts +1 -1
  447. package/lib/utils/createStringMatcher.js.map +1 -1
  448. package/lib/utils/createTestIds.d.ts +1 -1
  449. package/lib/utils/createTestIds.d.ts.map +1 -1
  450. package/lib/utils/debounce.d.ts +1 -1
  451. package/lib/utils/debounce.d.ts.map +1 -1
  452. package/lib/utils/deepGet.d.ts.map +1 -1
  453. package/lib/utils/deepGet.js.map +1 -1
  454. package/lib/utils/deepObjectComparison.js.map +1 -1
  455. package/lib/utils/defineSmartGetter.d.ts.map +1 -1
  456. package/lib/utils/focusHeadingOrContainer.js.map +1 -1
  457. package/lib/utils/formatListToLocaleString.d.ts +2 -2
  458. package/lib/utils/formatListToLocaleString.d.ts.map +1 -1
  459. package/lib/utils/getEdge.d.ts +1 -1
  460. package/lib/utils/getEdge.d.ts.map +1 -1
  461. package/lib/utils/getEdge.js.map +1 -1
  462. package/lib/utils/getFocusables.d.ts +1 -1
  463. package/lib/utils/getFocusables.d.ts.map +1 -1
  464. package/lib/utils/getFocusables.js.map +1 -1
  465. package/lib/utils/getRelativeOffset.d.ts +1 -1
  466. package/lib/utils/getRelativeOffset.d.ts.map +1 -1
  467. package/lib/utils/hasProp.d.ts.map +1 -1
  468. package/lib/utils/index.d.ts +1 -0
  469. package/lib/utils/index.d.ts.map +1 -1
  470. package/lib/utils/index.js +1 -0
  471. package/lib/utils/index.js.map +1 -1
  472. package/lib/utils/isPositionWithinRect.d.ts.map +1 -1
  473. package/lib/utils/kebabToCamel.d.ts.map +1 -1
  474. package/lib/utils/loadScript.d.ts.map +1 -1
  475. package/lib/utils/normalizeTargets.d.ts +1 -1
  476. package/lib/utils/normalizeTargets.d.ts.map +1 -1
  477. package/lib/utils/replaceMatchWithElement.d.ts.map +1 -1
  478. package/lib/utils/replaceMatchWithElement.js.map +1 -1
  479. package/lib/utils/throttle.d.ts +1 -1
  480. package/lib/utils/throttle.d.ts.map +1 -1
  481. package/lib/utils/triple.js.map +1 -1
  482. package/lib/utils/tryCatch.js.map +1 -1
  483. package/lib/utils/withTestIds.d.ts +2 -1
  484. package/lib/utils/withTestIds.d.ts.map +1 -1
  485. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../src/components/Configuration/Configuration.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;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AC,EAAE,iBAAiB,CAAC;oBACjE,WAAW,EAAE,IAAI;iBAClB,YAED,MAAC,aAAa,IAAC,KAAK,EAAE,YAAY,CAAC,KAAK,aACrC,cAAc;4BACb,wBAAwB;4BACxB,YAAY,CACV,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CACxB,eAAM,GAAG,EAAC,YAAY,EAAC,IAAI,EAAE,GAAG,sCAAO,GAAG,CAA6B,CACxE,CAAC,EACF,wBAAwB,CACzB,EACF,qBAAqB,IACR,GACC,EACnB,iCAAwB,GAAG,EAAE,qBAAqB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAI,IAC9E,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { createContext, useContext, useMemo, useEffect, useState } from 'react';\nimport type { FunctionComponent, ReactNode, Context, MutableRefObject } from 'react';\nimport { createPortal } from 'react-dom';\nimport { ThemeProvider, StyleSheetManager } from 'styled-components';\nimport type { StyleSheetManagerProps } from 'styled-components';\n\nimport '../../init';\nimport { GlobalStyle } from '../../styles';\nimport { ThemeMachine, BaseThemeMachine } from '../../theme';\nimport type { ThemeMachineLike, DefaultSettableTheme, DefaultThemeDefinition } from '../../theme';\nimport {\n createTranslationPack,\n DefaultTranslation,\n direction as directionOfLocale\n} from '../../i18n';\nimport type { Translation, TranslationPack } from '../../i18n';\nimport { documentIsAvailable, navigatorIsAvailable, windowIsAvailable } from '../../utils';\nimport pkg from '../../../package.json';\nimport useElement from '../../hooks/useElement';\n\nimport type PegaConnectedWatcher from './connected-watcher';\nimport './connected-watcher';\n\nexport interface ConfigurationProps {\n /** Any components or nodes that should be impacted by the settings applied by this Configuration component. */\n children: ReactNode;\n /** User locale as defined in [BCP-47](https://www.techonthenet.com/js/language_tags.php). */\n locale?: string;\n /** Override rendering direction of the document. Direction will be based on the locale if now provided. */\n direction?: 'ltr' | 'rtl';\n /** Object with (partial) translations. */\n translations?: Translation;\n /** Theme object used to override any or all Cosmos theme properties. */\n theme?: DefaultSettableTheme;\n /** Disables loading Open Sans or Inter from Google Fonts. Only takes effect on the root configuration. */\n disableDefaultFontLoading?: boolean;\n /** List of style sheets to inject in style sheet target. */\n styleSheets?: string[];\n /**\n * Target element for loading styles related to `styled-components`.\n * @deprecated\n */\n styleSheetTarget?: StyleSheetManagerProps['target'];\n /**\n * Target element for rendering a `ReactDOM` portal.\n * @deprecated\n */\n portalTarget?: Parameters<typeof createPortal>[1];\n /**\n * Use native HTML5 controls for inputs instead of rich ones.\n * @default false\n */\n renderNativeControls?: boolean;\n /** String to identify this configuration instance. */\n id?: string;\n /**\n * Enable/disable testId attribute rendering for all components.\n * @default true\n */\n testIds?: boolean;\n}\n\nexport interface ConfigurationContextValue {\n locale: string;\n direction: NonNullable<ConfigurationProps['direction']>;\n translations: TranslationPack;\n themeMachine: ThemeMachineLike<DefaultThemeDefinition>;\n styleSheetTarget: ConfigurationProps['styleSheetTarget'];\n portalTarget: ConfigurationProps['portalTarget'];\n loadedRef: MutableRefObject<boolean>;\n renderNativeControls: boolean;\n testIds: NonNullable<ConfigurationProps['testIds']>;\n /** @internal */\n mountedStyleSheetManagers?: (typeof StyleSheetManager)[];\n /** @internal */\n initialized: boolean;\n}\n\nconst defaultLocale = navigatorIsAvailable ? navigator.language : 'en';\n\nexport const ConfigurationContext = createContext<ConfigurationContextValue>({\n locale: defaultLocale,\n direction: directionOfLocale(defaultLocale),\n translations: DefaultTranslation,\n themeMachine: BaseThemeMachine,\n styleSheetTarget: documentIsAvailable ? document.head : undefined,\n portalTarget: documentIsAvailable ? document.body : undefined,\n loadedRef: { current: false },\n renderNativeControls: false,\n testIds: true,\n mountedStyleSheetManagers: [],\n initialized: false\n});\n\nconst legacyMetaKey = Symbol.for('@pega/cosmos-react-core.metadata');\n\ninterface LegacyCosmosInstace {\n version: string;\n}\n\ndeclare global {\n interface Window {\n [legacyMetaKey]?: {\n push: (instance: LegacyCosmosInstace) => void;\n };\n }\n}\n\nconst mountedConfigs = new Set<symbol>();\n\ninterface CosmosInstance extends LegacyCosmosInstace {\n mountedConfigs: string[];\n mountOrder: string[];\n mountCount: Record<string, number>;\n}\n\nconst instance: CosmosInstance = {\n version: pkg.version,\n mountedConfigs: [],\n mountOrder: [],\n mountCount: {}\n};\n\nconst mountConfig = (sym: symbol) => {\n mountedConfigs.add(sym);\n instance.mountedConfigs = [...mountedConfigs].map(i => i.description ?? 'Unknown');\n\n const description = sym.description ?? 'Unknown';\n\n instance.mountOrder.push(description);\n\n if (!(description in instance.mountCount)) {\n instance.mountCount[description] = 0;\n }\n instance.mountCount[description] += 1;\n};\n\nconst unmountConfig = (sym: symbol) => {\n mountedConfigs.delete(sym);\n instance.mountedConfigs = [...mountedConfigs].map(i => i.description ?? 'Unknown');\n};\n\ndeclare module '../../init' {\n export interface CosmosGlobals {\n instances?: (CosmosInstance | LegacyCosmosInstace)[];\n configurationContext?: Context<ConfigurationContextValue>;\n }\n}\n\nif (windowIsAvailable) {\n if (!window.cosmos.instances) {\n window.cosmos.instances = [];\n }\n\n window.cosmos.instances.push(instance);\n\n if (Array.isArray(window[legacyMetaKey])) {\n window.cosmos.instances.push(...window[legacyMetaKey]);\n delete window[legacyMetaKey];\n }\n\n if (!window[legacyMetaKey]) {\n window[legacyMetaKey] = {\n push: inst => {\n window.cosmos.instances?.push(inst);\n }\n };\n }\n}\n\nconst Configuration: FunctionComponent<ConfigurationProps> = ({\n children,\n locale,\n direction,\n translations: customTranslations,\n theme,\n disableDefaultFontLoading,\n styleSheets: styleSheetURLs,\n styleSheetTarget,\n portalTarget,\n renderNativeControls,\n testIds,\n id\n}: ConfigurationProps) => {\n const context = windowIsAvailable\n ? window.cosmos.configurationContext ?? ConfigurationContext\n : ConfigurationContext;\n const ctx = useContext(context);\n const themeMachine = theme\n ? new ThemeMachine<DefaultThemeDefinition>({ theme, parent: ctx.themeMachine })\n : ctx.themeMachine;\n const translations = useMemo(\n () => createTranslationPack({ ...ctx.translations, ...customTranslations }),\n [ctx.translations, customTranslations]\n );\n\n const [wrapperEl, setWrapperEl] = useElement<HTMLDivElement>();\n const [connectedWatcherEl, setConnectedWatcherEl] = useElement<PegaConnectedWatcher>();\n // State tracking if the DOM nodes are connected. Only used to trigger rerenders when connected state changes.\n const [, setConnected] = useState<boolean | null>(null);\n\n useEffect(() => {\n if (!connectedWatcherEl) return;\n\n const connectDisconnectListener = () => {\n setConnected(connectedWatcherEl.isConnected);\n };\n\n connectedWatcherEl.addEventListener('connect-disconnect', connectDisconnectListener);\n\n return () => {\n connectedWatcherEl.removeEventListener('connect-disconnect', connectDisconnectListener);\n };\n }, [connectedWatcherEl]);\n\n // Determine valid style sheet and portal target with ShadowDOM handling.\n const [resolvedStyleSheetTarget, resolvedPortalTarget] = useMemo(() => {\n // When rendering on the server, or before the wrapper is in the DOM, just bail.\n if (!documentIsAvailable || !wrapperEl?.isConnected) return [undefined, undefined];\n\n const rootNode = wrapperEl.getRootNode();\n\n // When within the ShadowDOM, the default target is the ShadowRoot, otherwise default to head/body element.\n const defaultStyleSheetTarget = rootNode instanceof ShadowRoot ? rootNode : document.head;\n const defaultPortalTarget = rootNode instanceof ShadowRoot ? rootNode : document.body;\n\n // Currently passed prop or previous context value\n const requestedStyleSheetTarget = styleSheetTarget ?? ctx.styleSheetTarget;\n const requestedPortalTarget = portalTarget ?? ctx.portalTarget;\n\n // If the \"requested\" target is within the root node, it is valid, so use that, otherwise fallback to the default.\n return [\n rootNode.contains(requestedStyleSheetTarget ?? null)\n ? requestedStyleSheetTarget\n : defaultStyleSheetTarget,\n rootNode.contains(requestedPortalTarget ?? null) ? requestedPortalTarget : defaultPortalTarget\n ];\n }, [\n wrapperEl,\n wrapperEl?.isConnected,\n styleSheetTarget,\n portalTarget,\n ctx.styleSheetTarget,\n ctx.portalTarget\n ]);\n\n // Load global fonts and styles if this configuration instance is...\n const shouldInitialize = useMemo(\n () =>\n // the first configuration instance or...\n !ctx.initialized ||\n // is not within the same root node as the previous configuration instance.\n !!(wrapperEl && wrapperEl.getRootNode() !== ctx.styleSheetTarget?.getRootNode()),\n [ctx.initialized, wrapperEl]\n );\n\n // Check if this StyleSheetManager is mounted above this Configuration.\n const stylesheetManagerMounted = useMemo(\n () => !!ctx.mountedStyleSheetManagers?.includes(StyleSheetManager),\n [ctx.mountedStyleSheetManagers]\n );\n\n useEffect(() => {\n const sym = Symbol(id);\n mountConfig(sym);\n\n return () => {\n unmountConfig(sym);\n };\n }, [id]);\n\n const wrappedChildren = shouldInitialize ? (\n <>\n {!disableDefaultFontLoading &&\n resolvedStyleSheetTarget &&\n createPortal(\n <link\n rel='stylesheet'\n href='https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400..700;1,400..700&family=Inter:wght@400..700&display=swap'\n data-cosmos-global-style\n />,\n resolvedStyleSheetTarget\n )}\n <GlobalStyle />\n {children}\n </>\n ) : (\n <>{children}</>\n );\n\n const styledWrappedChildren = stylesheetManagerMounted ? (\n wrappedChildren\n ) : (\n <StyleSheetManager\n disableVendorPrefixes\n target={\n // Target must be undefined in a JSDOM environment due to Styled Components server mode handling.\n navigatorIsAvailable &&\n resolvedStyleSheetTarget?.isConnected &&\n !navigator.userAgent.includes('jsdom')\n ? resolvedStyleSheetTarget\n : undefined\n }\n >\n {wrappedChildren}\n </StyleSheetManager>\n );\n\n return (\n <div\n data-config-root\n // Need to use inline styles because the StyleSheetManager is configured within this div.\n style={{ display: 'contents' }}\n ref={setWrapperEl}\n >\n <context.Provider\n // eslint-disable-next-line react/jsx-no-constructed-context-values\n value={{\n locale: locale ?? ctx.locale,\n direction:\n direction ?? (locale !== undefined ? directionOfLocale(locale) : ctx.direction),\n translations,\n themeMachine,\n styleSheetTarget: resolvedStyleSheetTarget,\n portalTarget: resolvedPortalTarget,\n loadedRef: ctx.loadedRef,\n renderNativeControls: renderNativeControls ?? ctx.renderNativeControls,\n testIds: testIds ?? ctx.testIds,\n mountedStyleSheetManagers: stylesheetManagerMounted\n ? ctx.mountedStyleSheetManagers\n : [...(ctx.mountedStyleSheetManagers ?? []), StyleSheetManager],\n initialized: true\n }}\n >\n <ThemeProvider theme={themeMachine.theme}>\n {styleSheetURLs &&\n resolvedStyleSheetTarget &&\n createPortal(\n styleSheetURLs.map(url => (\n <link rel='stylesheet' href={url} key={url} data-cosmos-global-style />\n )),\n resolvedStyleSheetTarget\n )}\n {styledWrappedChildren}\n </ThemeProvider>\n </context.Provider>\n <pega-connected-watcher ref={setConnectedWatcherEl} style={{ display: 'none' }} />\n </div>\n );\n};\n\nexport default Configuration;\n"]}
1
+ {"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../src/components/Configuration/Configuration.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGrE,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,SAAS,IAAI,iBAAiB,EAC/B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,GAAG,MAAM,uBAAuB,CAAC;AACxC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAGhD,OAAO,qBAAqB,CAAC;AAyD7B,MAAM,aAAa,GAAG,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;AAEvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAA4B;IAC3E,MAAM,EAAE,a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{ FunctionComponent, ReactNode, Context, MutableRefObject } from 'react';\nimport { createPortal } from 'react-dom';\nimport { ThemeProvider, StyleSheetManager } from 'styled-components';\nimport type { StyleSheetManagerProps } from 'styled-components';\n\nimport '../../init';\nimport { GlobalStyle } from '../../styles';\nimport { ThemeMachine, BaseThemeMachine } from '../../theme';\nimport type { ThemeMachineLike, DefaultSettableTheme, DefaultThemeDefinition } from '../../theme';\nimport {\n createTranslationPack,\n DefaultTranslation,\n direction as directionOfLocale\n} from '../../i18n';\nimport type { Translation, TranslationPack } from '../../i18n';\nimport { documentIsAvailable, navigatorIsAvailable, windowIsAvailable } from '../../utils';\nimport pkg from '../../../package.json';\nimport useElement from '../../hooks/useElement';\n\nimport type PegaConnectedWatcher from './connected-watcher';\nimport './connected-watcher';\n\nexport interface ConfigurationProps {\n /** Any components or nodes that should be impacted by the settings applied by this Configuration component. */\n children: ReactNode;\n /** User locale as defined in [BCP-47](https://www.techonthenet.com/js/language_tags.php). */\n locale?: string;\n /** Override rendering direction of the document. Direction will be based on the locale if now provided. */\n direction?: 'ltr' | 'rtl';\n /** Object with (partial) translations. */\n translations?: Translation;\n /** Theme object used to override any or all Cosmos theme properties. */\n theme?: DefaultSettableTheme;\n /** Disables loading Open Sans or Inter from Google Fonts. Only takes effect on the root configuration. */\n disableDefaultFontLoading?: boolean;\n /** List of style sheets to inject in style sheet target. */\n styleSheets?: string[];\n /**\n * Target element for loading styles related to `styled-components`.\n * @deprecated\n */\n styleSheetTarget?: StyleSheetManagerProps['target'];\n /**\n * Target element for rendering a `ReactDOM` portal.\n * @deprecated\n */\n portalTarget?: Parameters<typeof createPortal>[1];\n /**\n * Use native HTML5 controls for inputs instead of rich ones.\n * @default false\n */\n renderNativeControls?: boolean;\n /** String to identify this configuration instance. */\n id?: string;\n /**\n * Enable/disable testId attribute rendering for all components.\n * @default true\n */\n testIds?: boolean;\n}\n\nexport interface ConfigurationContextValue {\n locale: string;\n direction: NonNullable<ConfigurationProps['direction']>;\n translations: TranslationPack;\n themeMachine: ThemeMachineLike<DefaultThemeDefinition>;\n styleSheetTarget: ConfigurationProps['styleSheetTarget'];\n portalTarget: ConfigurationProps['portalTarget'];\n loadedRef: MutableRefObject<boolean>;\n renderNativeControls: boolean;\n testIds: NonNullable<ConfigurationProps['testIds']>;\n /** @internal */\n mountedStyleSheetManagers?: (typeof StyleSheetManager)[];\n /** @internal */\n initialized: boolean;\n}\n\nconst defaultLocale = navigatorIsAvailable ? navigator.language : 'en';\n\nexport const ConfigurationContext = createContext<ConfigurationContextValue>({\n locale: defaultLocale,\n direction: directionOfLocale(defaultLocale),\n translations: DefaultTranslation,\n themeMachine: BaseThemeMachine,\n styleSheetTarget: documentIsAvailable ? document.head : undefined,\n portalTarget: documentIsAvailable ? document.body : undefined,\n loadedRef: { current: false },\n renderNativeControls: false,\n testIds: true,\n mountedStyleSheetManagers: [],\n initialized: false\n});\n\nconst legacyMetaKey = Symbol.for('@pega/cosmos-react-core.metadata');\n\ninterface LegacyCosmosInstace {\n version: string;\n}\n\ndeclare global {\n interface Window {\n [legacyMetaKey]?: {\n push: (instance: LegacyCosmosInstace) => void;\n };\n }\n}\n\nconst mountedConfigs = new Set<symbol>();\n\ninterface CosmosInstance extends LegacyCosmosInstace {\n mountedConfigs: string[];\n mountOrder: string[];\n mountCount: Record<string, number>;\n}\n\nconst instance: CosmosInstance = {\n version: pkg.version,\n mountedConfigs: [],\n mountOrder: [],\n mountCount: {}\n};\n\nconst mountConfig = (sym: symbol) => {\n mountedConfigs.add(sym);\n instance.mountedConfigs = [...mountedConfigs].map(i => i.description ?? 'Unknown');\n\n const description = sym.description ?? 'Unknown';\n\n instance.mountOrder.push(description);\n\n if (!(description in instance.mountCount)) {\n instance.mountCount[description] = 0;\n }\n instance.mountCount[description] += 1;\n};\n\nconst unmountConfig = (sym: symbol) => {\n mountedConfigs.delete(sym);\n instance.mountedConfigs = [...mountedConfigs].map(i => i.description ?? 'Unknown');\n};\n\ndeclare module '../../init' {\n export interface CosmosGlobals {\n instances?: (CosmosInstance | LegacyCosmosInstace)[];\n configurationContext?: Context<ConfigurationContextValue>;\n }\n}\n\nif (windowIsAvailable) {\n if (!window.cosmos.instances) {\n window.cosmos.instances = [];\n }\n\n window.cosmos.instances.push(instance);\n\n if (Array.isArray(window[legacyMetaKey])) {\n window.cosmos.instances.push(...window[legacyMetaKey]);\n delete window[legacyMetaKey];\n }\n\n if (!window[legacyMetaKey]) {\n window[legacyMetaKey] = {\n push: inst => {\n window.cosmos.instances?.push(inst);\n }\n };\n }\n}\n\nconst Configuration: FunctionComponent<ConfigurationProps> = ({\n children,\n locale,\n direction,\n translations: customTranslations,\n theme,\n disableDefaultFontLoading,\n styleSheets: styleSheetURLs,\n styleSheetTarget,\n portalTarget,\n renderNativeControls,\n testIds,\n id\n}: ConfigurationProps) => {\n const context = windowIsAvailable\n ? window.cosmos.configurationContext ?? ConfigurationContext\n : ConfigurationContext;\n const ctx = useContext(context);\n const themeMachine = theme\n ? new ThemeMachine<DefaultThemeDefinition>({ theme, parent: ctx.themeMachine })\n : ctx.themeMachine;\n const translations = useMemo(\n () => createTranslationPack({ ...ctx.translations, ...customTranslations }),\n [ctx.translations, customTranslations]\n );\n\n const [wrapperEl, setWrapperEl] = useElement<HTMLDivElement>();\n const [connectedWatcherEl, setConnectedWatcherEl] = useElement<PegaConnectedWatcher>();\n // State tracking if the DOM nodes are connected. Only used to trigger rerenders when connected state changes.\n const [, setConnected] = useState<boolean | null>(null);\n\n useEffect(() => {\n if (!connectedWatcherEl) return;\n\n const connectDisconnectListener = () => {\n setConnected(connectedWatcherEl.isConnected);\n };\n\n connectedWatcherEl.addEventListener('connect-disconnect', connectDisconnectListener);\n\n return () => {\n connectedWatcherEl.removeEventListener('connect-disconnect', connectDisconnectListener);\n };\n }, [connectedWatcherEl]);\n\n // Determine valid style sheet and portal target with ShadowDOM handling.\n const [resolvedStyleSheetTarget, resolvedPortalTarget] = useMemo(() => {\n // When rendering on the server, or before the wrapper is in the DOM, just bail.\n if (!documentIsAvailable || !wrapperEl?.isConnected) return [undefined, undefined];\n\n const rootNode = wrapperEl.getRootNode();\n\n // When within the ShadowDOM, the default target is the ShadowRoot, otherwise default to head/body element.\n const defaultStyleSheetTarget = rootNode instanceof ShadowRoot ? rootNode : document.head;\n const defaultPortalTarget = rootNode instanceof ShadowRoot ? rootNode : document.body;\n\n // Currently passed prop or previous context value\n const requestedStyleSheetTarget = styleSheetTarget ?? ctx.styleSheetTarget;\n const requestedPortalTarget = portalTarget ?? ctx.portalTarget;\n\n // If the \"requested\" target is within the root node, it is valid, so use that, otherwise fallback to the default.\n return [\n rootNode.contains(requestedStyleSheetTarget ?? null)\n ? requestedStyleSheetTarget\n : defaultStyleSheetTarget,\n rootNode.contains(requestedPortalTarget ?? null) ? requestedPortalTarget : defaultPortalTarget\n ];\n }, [\n wrapperEl,\n wrapperEl?.isConnected,\n styleSheetTarget,\n portalTarget,\n ctx.styleSheetTarget,\n ctx.portalTarget\n ]);\n\n // Load global fonts and styles if this configuration instance is...\n const shouldInitialize = useMemo(\n () =>\n // the first configuration instance or...\n !ctx.initialized ||\n // is not within the same root node as the previous configuration instance.\n !!(wrapperEl && wrapperEl.getRootNode() !== ctx.styleSheetTarget?.getRootNode()),\n [ctx.initialized, wrapperEl]\n );\n\n // Check if this StyleSheetManager is mounted above this Configuration.\n const stylesheetManagerMounted = useMemo(\n () => !!ctx.mountedStyleSheetManagers?.includes(StyleSheetManager),\n [ctx.mountedStyleSheetManagers]\n );\n\n useEffect(() => {\n const sym = Symbol(id);\n mountConfig(sym);\n\n return () => {\n unmountConfig(sym);\n };\n }, [id]);\n\n const wrappedChildren = shouldInitialize ? (\n <>\n {!disableDefaultFontLoading &&\n resolvedStyleSheetTarget &&\n createPortal(\n <link\n rel='stylesheet'\n href='https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400..700;1,400..700&family=Inter:wght@400..700&display=swap'\n data-cosmos-global-style\n />,\n resolvedStyleSheetTarget\n )}\n <GlobalStyle />\n {children}\n </>\n ) : (\n <>{children}</>\n );\n\n const styledWrappedChildren = stylesheetManagerMounted ? (\n wrappedChildren\n ) : (\n <StyleSheetManager\n disableVendorPrefixes\n target={\n // Target must be undefined in a JSDOM environment due to Styled Components server mode handling.\n navigatorIsAvailable &&\n resolvedStyleSheetTarget?.isConnected &&\n !navigator.userAgent.includes('jsdom')\n ? resolvedStyleSheetTarget\n : undefined\n }\n >\n {wrappedChildren}\n </StyleSheetManager>\n );\n\n return (\n <div\n data-config-root\n // Need to use inline styles because the StyleSheetManager is configured within this div.\n style={{ display: 'contents' }}\n ref={setWrapperEl}\n >\n <context.Provider\n // eslint-disable-next-line react/jsx-no-constructed-context-values\n value={{\n locale: locale ?? ctx.locale,\n direction:\n direction ?? (locale !== undefined ? directionOfLocale(locale) : ctx.direction),\n translations,\n themeMachine,\n styleSheetTarget: resolvedStyleSheetTarget,\n portalTarget: resolvedPortalTarget,\n loadedRef: ctx.loadedRef,\n renderNativeControls: renderNativeControls ?? ctx.renderNativeControls,\n testIds: testIds ?? ctx.testIds,\n mountedStyleSheetManagers: stylesheetManagerMounted\n ? ctx.mountedStyleSheetManagers\n : [...(ctx.mountedStyleSheetManagers ?? []), StyleSheetManager],\n initialized: true\n }}\n >\n <ThemeProvider theme={themeMachine.theme}>\n {styleSheetURLs &&\n resolvedStyleSheetTarget &&\n createPortal(\n styleSheetURLs.map(url => (\n <link rel='stylesheet' href={url} key={url} data-cosmos-global-style />\n )),\n resolvedStyleSheetTarget\n )}\n {styledWrappedChildren}\n </ThemeProvider>\n </context.Provider>\n <pega-connected-watcher ref={setConnectedWatcherEl} style={{ display: 'none' }} />\n </div>\n );\n};\n\nexport default Configuration;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"connected-watcher.js","sourceRoot":"","sources":["../../../src/components/Configuration/connected-watcher.ts"],"names":[],"mappings":"AAiBA,MAAM,oBAAqB,SAAQ,WAAW;IAC5C,iBAAiB;QACf,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,oBAAoB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,oBAAoB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC;CACF;AAED,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,wBAAwB,CAAC,EAAE;IACjD,cAAc,CAAC,MAAM,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAAC;CACvE;AAED,eAAe,oBAAoB,CAAC","sourcesContent":["import type { DetailedHTMLProps, HTMLAttributes } from 'react';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'pega-connected-watcher': PegaConnectedWatcher;\n }\n\n namespace JSX {\n interface IntrinsicElements {\n 'pega-connected-watcher': DetailedHTMLProps<\n HTMLAttributes<PegaConnectedWatcher>,\n PegaConnectedWatcher\n >;\n }\n }\n}\n\nclass PegaConnectedWatcher extends HTMLElement {\n connectedCallback() {\n this.dispatchEvent(new Event('connect-disconnect', { bubbles: false }));\n }\n\n disconnectedCallback() {\n this.dispatchEvent(new Event('connect-disconnect', { bubbles: false }));\n }\n}\n\nif (!customElements.get('pega-connected-watcher')) {\n customElements.define('pega-connected-watcher', PegaConnectedWatcher);\n}\n\nexport default PegaConnectedWatcher;\n"]}
1
+ {"version":3,"file":"connected-watcher.js","sourceRoot":"","sources":["../../../src/components/Configuration/connected-watcher.ts"],"names":[],"mappings":"AAiBA,MAAM,oBAAqB,SAAQ,WAAW;IAC5C,iBAAiB;QACf,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,oBAAoB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,oBAAoB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC;CACF;AAED,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,wBAAwB,CAAC,EAAE,CAAC;IAClD,cAAc,CAAC,MAAM,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAAC;AACxE,CAAC;AAED,eAAe,oBAAoB,CAAC","sourcesContent":["import type { DetailedHTMLProps, HTMLAttributes } from 'react';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'pega-connected-watcher': PegaConnectedWatcher;\n }\n\n namespace JSX {\n interface IntrinsicElements {\n 'pega-connected-watcher': DetailedHTMLProps<\n HTMLAttributes<PegaConnectedWatcher>,\n PegaConnectedWatcher\n >;\n }\n }\n}\n\nclass PegaConnectedWatcher extends HTMLElement {\n connectedCallback() {\n this.dispatchEvent(new Event('connect-disconnect', { bubbles: false }));\n }\n\n disconnectedCallback() {\n this.dispatchEvent(new Event('connect-disconnect', { bubbles: false }));\n }\n}\n\nif (!customElements.get('pega-connected-watcher')) {\n customElements.define('pega-connected-watcher', PegaConnectedWatcher);\n}\n\nexport default PegaConnectedWatcher;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"withConfiguration.d.ts","sourceRoot":"","sources":["../../../src/components/Configuration/withConfiguration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAI5E;;;GAGG;AACH,QAAA,MAAM,iBAAiB,qHAMpB,CAAC;AAEJ,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"withConfiguration.d.ts","sourceRoot":"","sources":["../../../src/components/Configuration/withConfiguration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAI5E;;;GAGG;AACH,QAAA,MAAM,iBAAiB,GACpB,IAAI,SAAS,aAAa,CAAC,GAAG,CAAC,aAAa,IAAI,aACzC,eAAe,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,gBAI5C,CAAC;AAEJ,eAAe,iBAAiB,CAAC"}
@@ -1,16 +1,13 @@
1
1
  declare const _default: import("react").ForwardRefExoticComponent<Omit<Pick<import("../../types").WithAttributes<"input", import("../../types").NoChildrenProp & {
2
- status?: "error" | "warning" | "success" | "pending" | undefined;
3
- label?: import("react").ReactNode;
4
- labelHidden?: boolean | undefined;
5
- info?: import("react").ReactNode;
6
- value?: string | undefined;
7
- onChange: (value?: string | undefined) => void;
8
- onFocus?: ((value?: string | undefined) => void) | undefined;
9
- onBlur?: ((value?: string | undefined) => void) | undefined;
10
- additionalInfo?: {
11
- heading?: string | undefined;
12
- content: string | JSX.Element;
13
- } | undefined;
14
- }>, "hidden" | "color" | "content" | "size" | "style" | "height" | "translate" | "width" | "multiple" | "disabled" | "prefix" | "src" | "form" | "label" | "slot" | "title" | "pattern" | "children" | "ref" | "key" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "list" | "max" | "maxLength" | "min" | "minLength" | "name" | "status" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "enterKeyHint" | "readOnly" | "required" | "step" | "value" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "info" | "labelHidden" | "additionalInfo">, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
2
+ status?: import("../FormControl").FormControlProps["status"];
3
+ label?: import("../FormControl").FormControlProps["label"];
4
+ labelHidden?: import("../FormControl").FormControlProps["labelHidden"];
5
+ info?: import("../FormControl").FormControlProps["info"];
6
+ value?: string;
7
+ onChange: (value?: string) => void;
8
+ onFocus?: (value?: string) => void;
9
+ onBlur?: (value?: string) => void;
10
+ additionalInfo?: import("../FormControl").FormControlProps["additionalInfo"];
11
+ }>, "hidden" | "color" | "content" | "size" | "style" | "height" | "translate" | "width" | "multiple" | "disabled" | "prefix" | "src" | "form" | "label" | "slot" | "title" | "pattern" | "children" | "ref" | "className" | "id" | "lang" | "max" | "min" | "name" | "role" | "tabIndex" | "crossOrigin" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "autoComplete" | "maxLength" | "minLength" | "readOnly" | "required" | "alt" | "accept" | "capture" | "checked" | "enterKeyHint" | "list" | "step" | "status" | "info" | "labelHidden" | "additionalInfo">, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
15
12
  export default _default;
16
13
  //# sourceMappingURL=CreditCardInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CreditCardInput.d.ts","sourceRoot":"","sources":["../../../src/components/CreditCard/CreditCardInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAiBA,wBAwDE"}
1
+ {"version":3,"file":"CreditCardInput.d.ts","sourceRoot":"","sources":["../../../src/components/CreditCard/CreditCardInput.tsx"],"names":[],"mappings":";;;;;;oBA2CiB,CAAC;oBAKc,CAAC;mBAED,CAAC;;;AAjCjC,wBAwDE"}
@@ -1 +1 @@
1
- {"version":3,"file":"CreditCard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CACrE,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,CAC7D,CAAC;IAEF,OAAO,CACL,KAAC,KAAK,OACA,SAAS,EACb,SAAS,EAAC,SAAS,EACnB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAC,WAAW,GACxB,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type {\n PropsWithoutRef,\n ChangeEvent,\n ClipboardEvent,\n KeyboardEvent,\n FocusEvent\n} from 'react';\nimport creditCardType from 'credit-card-type';\n\nimport type { RefElement } from '../../types';\nimport Input from '../Input';\nimport { useConsolidatedRef, useInputFormatter } from '../../hooks';\n\nimport type { CreditCardInputProps } from './CreditCard.types';\nimport { formatCreditCard, isPossibleCardNumber } from './utils';\n\nexport default forwardRef<RefElement<CreditCardInputProps>, PropsWithoutRef<CreditCardInputProps>>(\n function CreditCardInput({ value = '', onChange, onBlur, onFocus, ...restProps }, ref) {\n const onInputKeyDown = (e: KeyboardEvent) => {\n if (value && !isPossibleCardNumber(value) && Number.isFinite(Number.parseInt(e.key, 10))) {\n (e.target as HTMLInputElement).value = '';\n }\n };\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n onChange(e.target.value ? e.target.value.replace(/\\D+/g, '') : undefined);\n };\n\n const onInputBlur = (e: FocusEvent) => {\n const inputValue = (e.target as HTMLInputElement).value;\n onBlur?.(inputValue ? inputValue.replace(/\\D+/g, '') : undefined);\n };\n\n const onInputFocus = (e: FocusEvent) => {\n const inputValue = (e.target as HTMLInputElement).value;\n onFocus?.(inputValue ? inputValue.replace(/\\D+/g, '') : undefined);\n };\n\n const onPaste = (e: ClipboardEvent) => {\n const text = e.clipboardData.getData('text').replace(/\\D+/g, '');\n const [{ lengths: [inferredLength] = [] } = {}] = creditCardType(text);\n if (text.length > inferredLength) {\n onChange(Number(text).toString());\n e.preventDefault();\n }\n };\n\n const maxLength = value ? Math.max(...(creditCardType(value)[0]?.lengths || [16])) : undefined;\n\n const obfuscation = /\\D/.test(value) ? 'partial' : 'none';\n\n const inputRef = useConsolidatedRef(ref);\n const formatted = useInputFormatter(inputRef, value, (input: string) =>\n formatCreditCard(input.replace(/\\D+/g, ''), { obfuscation })\n );\n\n return (\n <Input\n {...restProps}\n inputMode='numeric'\n ref={inputRef}\n value={formatted}\n onChange={onInputChange}\n onBlur={onInputBlur}\n onFocus={onInputFocus}\n onPaste={onPaste}\n onKeyDown={onInputKeyDown}\n maxLength={maxLength}\n autoComplete='cc-number'\n />\n );\n }\n);\n"]}
1
+ {"version":3,"file":"CreditCardInput.js","sourceRoot":"","sources":["../../../src/components/CreditCard/CreditCardInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAQnC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAG9C,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGpE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEjE,eAAe,UAAU,CACvB,SAAS,eAAe,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG;IACnF,MAAM,cAAc,GAAG,CAAC,CAAgB,EAAE,EAAE;QAC1C,IAAI,KAAK,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE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ACjC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;YAClC,CAAC,CAAC,cAAc,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE/F,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IAE1D,MAAM,QAAQ,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,iBAAiB,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CACrE,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,CAC7D,CAAC;IAEF,OAAO,CACL,KAAC,KAAK,OACA,SAAS,EACb,SAAS,EAAC,SAAS,EACnB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAC,WAAW,GACxB,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type {\n PropsWithoutRef,\n ChangeEvent,\n ClipboardEvent,\n KeyboardEvent,\n FocusEvent\n} from 'react';\nimport creditCardType from 'credit-card-type';\n\nimport type { RefElement } from '../../types';\nimport Input from '../Input';\nimport { useConsolidatedRef, useInputFormatter } from '../../hooks';\n\nimport type { CreditCardInputProps } from './CreditCard.types';\nimport { formatCreditCard, isPossibleCardNumber } from './utils';\n\nexport default forwardRef<RefElement<CreditCardInputProps>, PropsWithoutRef<CreditCardInputProps>>(\n function CreditCardInput({ value = '', onChange, onBlur, onFocus, ...restProps }, ref) {\n const onInputKeyDown = (e: KeyboardEvent) => {\n if (value && !isPossibleCardNumber(value) && Number.isFinite(Number.parseInt(e.key, 10))) {\n (e.target as HTMLInputElement).value = '';\n }\n };\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n onChange(e.target.value ? e.target.value.replace(/\\D+/g, '') : undefined);\n };\n\n const onInputBlur = (e: FocusEvent) => {\n const inputValue = (e.target as HTMLInputElement).value;\n onBlur?.(inputValue ? inputValue.replace(/\\D+/g, '') : undefined);\n };\n\n const onInputFocus = (e: FocusEvent) => {\n const inputValue = (e.target as HTMLInputElement).value;\n onFocus?.(inputValue ? inputValue.replace(/\\D+/g, '') : undefined);\n };\n\n const onPaste = (e: ClipboardEvent) => {\n const text = e.clipboardData.getData('text').replace(/\\D+/g, '');\n const [{ lengths: [inferredLength] = [] } = {}] = creditCardType(text);\n if (text.length > inferredLength) {\n onChange(Number(text).toString());\n e.preventDefault();\n }\n };\n\n const maxLength = value ? Math.max(...(creditCardType(value)[0]?.lengths || [16])) : undefined;\n\n const obfuscation = /\\D/.test(value) ? 'partial' : 'none';\n\n const inputRef = useConsolidatedRef(ref);\n const formatted = useInputFormatter(inputRef, value, (input: string) =>\n formatCreditCard(input.replace(/\\D+/g, ''), { obfuscation })\n );\n\n return (\n <Input\n {...restProps}\n inputMode='numeric'\n ref={inputRef}\n value={formatted}\n onChange={onInputChange}\n onBlur={onInputBlur}\n onFocus={onInputFocus}\n onPaste={onPaste}\n onKeyDown={onInputKeyDown}\n maxLength={maxLength}\n autoComplete='cc-number'\n />\n );\n }\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/CreditCard/ut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M,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACpE;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,0FAA0F;AAC1F,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAgB,EAAU,EAAE;IAChE,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;AACtD,CAAC,CAAC;AAEF,wFAAwF;AACxF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,UAAkB,EAAW,EAAE;IAClE,OAAO,cAAc,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,mHAAmH;AACnH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,UAAkB,EAAW,EAAE;IAC/D,OAAO,CACL,cAAc,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC;QACxF,KAAK,CACN,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import creditCardType, { getTypeInfo } from 'credit-card-type';\n\nimport type { FormattingOptions } from './CreditCard.types';\n\nconst prettyPrintCard = (value: string, gaps: number[]): string => {\n const offsets = [0].concat(\n gaps.filter(n => n < value.length),\n value.length\n );\n\n const groups = [];\n for (let i = 0; offsets[i] < value.length; i += 1) {\n groups.push(value.substring(offsets[i], offsets[i + 1]));\n }\n return groups.join(' ');\n};\n\n/**\n * Returns a formatted and obfuscated on demand partial credit card number.\n * @param value starting, partial number.\n * @param formattingOptions additional formatting options\n */\nexport const formatCreditCard = (\n value: string,\n { obfuscation = 'none' }: FormattingOptions = {}\n): string => {\n let result;\n switch (obfuscation) {\n case 'none':\n result = prettyPrintCard(value, creditCardType(value)[0]?.gaps ?? []);\n break;\n case 'partial':\n result = prettyPrintCard(value.slice(-4).padStart(16, '•'), [4, 8, 12]);\n break;\n default:\n result = Array.from({ length: 4 }).fill('•'.repeat(4)).join(' ');\n }\n return result;\n};\n\n/** Returns maximum total length of formatted credit card of given type including gaps. */\nexport const creditCardTotalLength = (cardType: string): number => {\n const type = getTypeInfo(cardType);\n return Math.max(...type.lengths) + type.gaps.length;\n};\n\n/** Returns true if given first numbers match a pattern of any card, false otherwise. */\nexport const isPossibleCardNumber = (cardNumber: string): boolean => {\n return creditCardType(cardNumber).length > 0;\n};\n\n/** Returns true if given card number is valid (matches the pattern and length of a card type), false otherwise. */\nexport const isValidCreditCard = (cardNumber: number): boolean => {\n return (\n creditCardType(cardNumber.toString())[0]?.lengths.includes(cardNumber.toString().length) ??\n false\n );\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/CreditCard/utils.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,EAAE,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAI/D,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,IAAc,EAAU,EAAE;IAChE,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CACxB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,EAClC,KAAK,CAAC,MAAM,CACb,CAAC;IAEF,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SA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AAM,oBAAoB,GAAG,CAAC,UAAkB,EAAW,EAAE;IAClE,OAAO,cAAc,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,mHAAmH;AACnH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,UAAkB,EAAW,EAAE;IAC/D,OAAO,CACL,cAAc,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC;QACxF,KAAK,CACN,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import creditCardType, { getTypeInfo } from 'credit-card-type';\n\nimport type { FormattingOptions } from './CreditCard.types';\n\nconst prettyPrintCard = (value: string, gaps: number[]): string => {\n const offsets = [0].concat(\n gaps.filter(n => n < value.length),\n value.length\n );\n\n const groups = [];\n for (let i = 0; offsets[i] < value.length; i += 1) {\n groups.push(value.substring(offsets[i], offsets[i + 1]));\n }\n return groups.join(' ');\n};\n\n/**\n * Returns a formatted and obfuscated on demand partial credit card number.\n * @param value starting, partial number.\n * @param formattingOptions additional formatting options\n */\nexport const formatCreditCard = (\n value: string,\n { obfuscation = 'none' }: FormattingOptions = {}\n): string => {\n let result;\n switch (obfuscation) {\n case 'none':\n result = prettyPrintCard(value, creditCardType(value)[0]?.gaps ?? []);\n break;\n case 'partial':\n result = prettyPrintCard(value.slice(-4).padStart(16, '•'), [4, 8, 12]);\n break;\n default:\n result = Array.from({ length: 4 }).fill('•'.repeat(4)).join(' ');\n }\n return result;\n};\n\n/** Returns maximum total length of formatted credit card of given type including gaps. */\nexport const creditCardTotalLength = (cardType: string): number => {\n const type = getTypeInfo(cardType);\n return Math.max(...type.lengths) + type.gaps.length;\n};\n\n/** Returns true if given first numbers match a pattern of any card, false otherwise. */\nexport const isPossibleCardNumber = (cardNumber: string): boolean => {\n return creditCardType(cardNumber).length > 0;\n};\n\n/** Returns true if given card number is valid (matches the pattern and length of a card type), false otherwise. */\nexport const isValidCreditCard = (cardNumber: number): boolean => {\n return (\n creditCardType(cardNumber.toString())[0]?.lengths.includes(cardNumber.toString().length) ??\n false\n );\n};\n"]}
@@ -1,2 +1,2 @@
1
- export declare const getCurrencyInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
1
+ export declare const getCurrencyInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
2
2
  //# sourceMappingURL=Currency.test-ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Currency.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/Currency.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,+KAGzB,CAAC"}
1
+ {"version":3,"file":"Currency.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/Currency.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,0LAGzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyDisplay.js","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAkC1D,MAAM,eAAe,GAA2D,UAAU,CACxF,SAAS,eAAe,CACtB,EACE,KAAK,EACL,eAAe,EACf,iBAAiB,EAAE,EACjB,QAAQ,GAAG,QAAQ,EACnB,QAAQ,GAAG,YAAY,EACvB,QAAQ,GAAG,UAAU,EACrB,eAAe,GAAG,IAAI,EACtB,cAAc,EACf,GAAG,EAAE,EACN,GAAG,SAAS,EAC0B,EACxC,GAAgC;IAEhC,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAEtC,MAAM,OAAO,GACX,eAAe,IAAI,eAAe,CAAC,eAAe,CAAC;QACjD,CAAC,CAAE;YACC,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,eAAe;YACzB,eAAe,EAAE,QAAQ;YACzB,WAAW,EAAE,eAAe;YAC5B,QAAQ;YACR,YAAY,EAAE,QAAQ,KAAK,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU;YACpE,qBAAqB,EAAE,cAAc;YACrC,qBAAqB,EAAE,cAAc;SACT;QAChC,CAAC,CAAC,SAAS,CAAC;IAEhB,MAAM,SAAS,GAAG;QAChB,GAAG,OAAO;QACV,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,UAAU;QACxB,eAAe,EAAE,MAAM;KACxB,CAAC;IAEF,OAAO,CACL,eAAM,GAAG,EAAE,GAAG,KAAM,SAAS,YAC1B,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CACtB,8BACE,8BAAkB,MAAM,YAAE,cAAc,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAQ,EAC5E,KAAC,kBAAkB,cAChB,cAAc,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,GACnC,IACpB,CACJ,CAAC,CAAC,CAAC,CACF,KAAC,OAAO,KAAG,CACZ,GACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, Ref } from 'react';\n\nimport type { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { useConfiguration } from '../../hooks';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport NoValue from '../NoValue/NoValue';\n\nimport { formatCurrency, isValidCurrency } from './utils';\n\nexport interface CurrencyDisplayProps extends BaseProps, NoChildrenProp {\n /** Number value. */\n value?: number | bigint;\n /** Three letter currency shorthand ISO code. If not provided or invalid, component renders only the number. */\n currencyISOCode?: string;\n /** Options to define formatting. */\n formattingOptions?: {\n currency?: 'symbol' | 'code' | 'name';\n /**\n * Determines negative value notation: using minus sign or parentheses.\n * @default 'minus-sign'\n */\n negative?: 'minus-sign' | 'parentheses';\n /**\n * Value display notation.\n * @default 'standard'\n */\n notation?: 'standard' | 'compact';\n /**\n * Fixed number of fraction digits. Maximum is 20, default is currency dependant.\n * @default variable\n */\n fractionDigits?: number;\n /** Determines whether group separators should be shown.\n * @default true\n */\n groupSeparators?: boolean;\n };\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLAnchorElement>;\n}\n\nconst CurrencyDisplay: FunctionComponent<CurrencyDisplayProps & ForwardProps> = forwardRef(\n function CurrencyDisplay(\n {\n value,\n currencyISOCode,\n formattingOptions: {\n currency = 'symbol',\n negative = 'minus-sign',\n notation = 'standard',\n groupSeparators = true,\n fractionDigits\n } = {},\n ...restProps\n }: PropsWithoutRef<CurrencyDisplayProps>,\n ref: CurrencyDisplayProps['ref']\n ) {\n const { locale } = useConfiguration();\n\n const options =\n currencyISOCode && isValidCurrency(currencyISOCode)\n ? ({\n style: 'currency',\n currency: currencyISOCode,\n currencyDisplay: currency,\n useGrouping: groupSeparators,\n notation,\n currencySign: negative === 'parentheses' ? 'accounting' : 'standard',\n minimumFractionDigits: fractionDigits,\n maximumFractionDigits: fractionDigits\n } as Intl.NumberFormatOptions)\n : undefined;\n\n const srOptions = {\n ...options,\n useGrouping: false,\n currencySign: 'standard',\n currencyDisplay: 'name'\n };\n\n return (\n <span ref={ref} {...restProps}>\n {value || value === 0 ? (\n <>\n <span aria-hidden='true'>{formatCurrency(value, { locale, options })}</span>\n <VisuallyHiddenText>\n {formatCurrency(value, { locale, options: srOptions })}\n </VisuallyHiddenText>\n </>\n ) : (\n <NoValue />\n )}\n </span>\n );\n }\n);\n\nexport default CurrencyDisplay;\n"]}
1
+ {"version":3,"file":"CurrencyDisplay.js","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAkC1D,MAAM,eAAe,GAA2D,UAAU,CACxF,SAAS,eAAe,CACtB,EACE,KAAK,EACL,eAAe,EACf,iBAAiB,EAAE,EACjB,QAAQ,GAAG,QAAQ,EACnB,QAAQ,GAAG,YAAY,EACvB,QAAQ,GAAG,UAAU,EACrB,eAAe,GAAG,IAAI,EACtB,cAAc,EACf,GAAG,EAAE,EACN,GAAG,SAAS,EAC0B,EACxC,GAAgC;IAEhC,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAEtC,MAAM,OAAO,GACX,eAAe,IAAI,eAAe,CAAC,eAAe,CAAC;QACjD,CAAC,CAAE;YACC,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,eAAe;YACzB,eAAe,EAAE,QAAQ;YACzB,WAAW,EAAE,eAAe;YAC5B,QAAQ;YACR,YAAY,EAAE,QAAQ,KAAK,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU;YACpE,qBAAqB,EAAE,cAAc;YACrC,qBAAqB,EAAE,cAAc;SACT;QAChC,CAAC,CAAC,SAAS,CAAC;IAEhB,MAAM,SAAS,GAAG;QAChB,GAAG,OAAO;QACV,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,UAAU;QACxB,eAAe,EAAE,MAAM;KACW,CAAC;IAErC,OAAO,CACL,eAAM,GAAG,EAAE,GAAG,KAAM,SAAS,YAC1B,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CACtB,8BACE,8BAAkB,MAAM,YAAE,cAAc,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAQ,EAC5E,KAAC,kBAAkB,cAChB,cAAc,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,GACnC,IACpB,CACJ,CAAC,CAAC,CAAC,CACF,KAAC,OAAO,KAAG,CACZ,GACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, Ref } from 'react';\n\nimport type { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { useConfiguration } from '../../hooks';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport NoValue from '../NoValue/NoValue';\n\nimport { formatCurrency, isValidCurrency } from './utils';\n\nexport interface CurrencyDisplayProps extends BaseProps, NoChildrenProp {\n /** Number value. */\n value?: number | bigint;\n /** Three letter currency shorthand ISO code. If not provided or invalid, component renders only the number. */\n currencyISOCode?: string;\n /** Options to define formatting. */\n formattingOptions?: {\n currency?: 'symbol' | 'code' | 'name';\n /**\n * Determines negative value notation: using minus sign or parentheses.\n * @default 'minus-sign'\n */\n negative?: 'minus-sign' | 'parentheses';\n /**\n * Value display notation.\n * @default 'standard'\n */\n notation?: 'standard' | 'compact';\n /**\n * Fixed number of fraction digits. Maximum is 20, default is currency dependant.\n * @default variable\n */\n fractionDigits?: number;\n /** Determines whether group separators should be shown.\n * @default true\n */\n groupSeparators?: boolean;\n };\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLAnchorElement>;\n}\n\nconst CurrencyDisplay: FunctionComponent<CurrencyDisplayProps & ForwardProps> = forwardRef(\n function CurrencyDisplay(\n {\n value,\n currencyISOCode,\n formattingOptions: {\n currency = 'symbol',\n negative = 'minus-sign',\n notation = 'standard',\n groupSeparators = true,\n fractionDigits\n } = {},\n ...restProps\n }: PropsWithoutRef<CurrencyDisplayProps>,\n ref: CurrencyDisplayProps['ref']\n ) {\n const { locale } = useConfiguration();\n\n const options =\n currencyISOCode && isValidCurrency(currencyISOCode)\n ? ({\n style: 'currency',\n currency: currencyISOCode,\n currencyDisplay: currency,\n useGrouping: groupSeparators,\n notation,\n currencySign: negative === 'parentheses' ? 'accounting' : 'standard',\n minimumFractionDigits: fractionDigits,\n maximumFractionDigits: fractionDigits\n } as Intl.NumberFormatOptions)\n : undefined;\n\n const srOptions = {\n ...options,\n useGrouping: false,\n currencySign: 'standard',\n currencyDisplay: 'name'\n } satisfies Intl.NumberFormatOptions;\n\n return (\n <span ref={ref} {...restProps}>\n {value || value === 0 ? (\n <>\n <span aria-hidden='true'>{formatCurrency(value, { locale, options })}</span>\n <VisuallyHiddenText>\n {formatCurrency(value, { locale, options: srOptions })}\n </VisuallyHiddenText>\n </>\n ) : (\n <NoValue />\n )}\n </span>\n );\n }\n);\n\nexport default CurrencyDisplay;\n"]}
@@ -2,7 +2,7 @@ import type { FunctionComponent } from 'react';
2
2
  import type { ForwardProps } from '../../types';
3
3
  import type CurrencyInputProps from './CurrencyInput.types';
4
4
  declare const _default: FunctionComponent<CurrencyInputProps & ForwardProps> & {
5
- getTestIds: (testIdProp?: string | null | undefined) => import("../../types").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
5
+ getTestIds: (testIdProp?: import("../../types").TestIdProp["testId"]) => import("../../types").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
6
6
  };
7
7
  export default _default;
8
8
  //# sourceMappingURL=CurrencyInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyInput.js","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.tsx"],"names":[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cAAc,EAAE,cAAc,EAC9B,mBAAmB,EAAE,mBAAmB,YAEvC,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useMemo } from 'react';\nimport type {\n FunctionComponent,\n PropsWithoutRef,\n KeyboardEvent,\n ChangeEvent,\n FocusEvent\n} from 'react';\n\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport FormField from '../FormField';\nimport type { ForwardProps } from '../../types';\nimport {\n useConfiguration,\n useConsolidatedRef,\n useI18n,\n useInputFormatter,\n usePrevious,\n useTestIds,\n useUID\n} from '../../hooks';\nimport {\n getCleanedValue,\n getDecimalSign,\n getDecrementedValue,\n getIncrementedValue\n} from '../Number/utils';\nimport Input from '../Input';\nimport { withTestIds } from '../../utils';\n\nimport type CurrencyInputProps from './CurrencyInput.types';\nimport { getCurrencyMinimumFractionDigits, getFormattedValue, isValidCurrency } from './utils';\nimport { getCurrencyInputTestIds } from './Currency.test-ids';\n\nconst CurrencyInput: FunctionComponent<CurrencyInputProps & ForwardProps> = forwardRef(\n function CurrencyInput(\n props: PropsWithoutRef<CurrencyInputProps>,\n ref: CurrencyInputProps['ref']\n ) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n status,\n label,\n labelHidden,\n info,\n required,\n disabled,\n readOnly,\n additionalInfo,\n value: valueProp = '',\n onChange,\n onBlur,\n onFocus,\n onResolveSuggestion,\n currencyISOCode,\n showDecimal = true,\n showGroupSeparators = true,\n min = Number.MIN_SAFE_INTEGER,\n max = Number.MAX_SAFE_INTEGER,\n step = 1,\n alwaysShowISOCode = false,\n maximumFractionDigits = 0,\n ...restProps\n } = props;\n\n const descriptionId = useUID();\n const testIds = useTestIds(testId, getCurrencyInputTestIds);\n\n const { locale } = useConfiguration();\n\n const t = useI18n();\n const inputRef = useConsolidatedRef(ref);\n\n const validCurrencyISOCode = useMemo(\n () => (currencyISOCode && isValidCurrency(currencyISOCode) ? currencyISOCode : undefined),\n [currencyISOCode]\n );\n\n const minimumFractionDigits = useMemo(\n () => getCurrencyMinimumFractionDigits(locale, validCurrencyISOCode),\n [locale, validCurrencyISOCode]\n );\n\n const numberOfDecimals = showDecimal\n ? Math.max(maximumFractionDigits, minimumFractionDigits)\n : 0;\n\n const decimalSign = useMemo(() => getDecimalSign(locale), [locale]);\n\n // on initial render only pad the value with 0 if necessary\n const rendered = usePrevious(true);\n let value = valueProp;\n if (!rendered && validCurrencyISOCode && !Number.isNaN(parseFloat(value))) {\n const [integer, fraction = ''] = value.split('.');\n value = `${integer}.${fraction.padEnd(numberOfDecimals, '0')}`;\n }\n\n const formatValue = useCallback(\n number => {\n return getFormattedValue(number, locale, validCurrencyISOCode, {\n showGroupSeparators,\n showAs: alwaysShowISOCode ? 'code' : 'symbol',\n numberOfDecimals\n });\n },\n [alwaysShowISOCode, numberOfDecimals, showGroupSeparators, locale, validCurrencyISOCode]\n );\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const cleanedInputValue = getCleanedValue(inputValue, decimalSign, numberOfDecimals);\n if (cleanedInputValue === value) return;\n onChange(cleanedInputValue);\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (readOnly) return;\n const input = e.currentTarget;\n switch (e.key) {\n case 'ArrowUp':\n e.preventDefault();\n onChange(getIncrementedValue(value, min, max, step));\n break;\n case 'ArrowDown':\n e.preventDefault();\n onChange(getDecrementedValue(value, min, max, step));\n break;\n case decimalSign:\n if (!showDecimal) e.preventDefault();\n if (input.value.includes(decimalSign)) {\n if (input.selectionStart && input.value.charAt(input.selectionStart) === decimalSign) {\n input.setSelectionRange(input.selectionStart + 1, input.selectionStart + 1);\n }\n e.preventDefault();\n } else if (\n input.selectionStart !== null &&\n !input.value.charAt(input.selectionStart - 1).match(/\\d/)\n ) {\n onChange(\n getCleanedValue(`${input.value}0${decimalSign}`, decimalSign, numberOfDecimals)\n );\n e.preventDefault();\n }\n break;\n case '-':\n if (value.startsWith('-')) e.preventDefault();\n break;\n default:\n }\n };\n\n const onInputFocusEvent = (e: FocusEvent<HTMLInputElement>) => {\n let parsableValue = value;\n if (validCurrencyISOCode && !Number.isNaN(parseFloat(value))) {\n const [integer, fraction = ''] = value.split('.');\n parsableValue = `${integer}.${fraction.padEnd(numberOfDecimals, '0')}`;\n }\n\n if (e.type === 'focus') onFocus?.(parsableValue);\n else {\n if (parsableValue !== value) {\n onChange(parsableValue);\n }\n\n onBlur?.(parsableValue);\n }\n };\n\n const formattedValue = useInputFormatter(inputRef, value, formatValue, `\\\\p{N}${decimalSign}-`);\n\n const Comp = (\n <>\n <Input\n data-testid={testIds.control}\n onChange={onInputChange}\n id={id}\n readOnly={readOnly}\n required={required}\n disabled={disabled}\n status={status}\n {...restProps}\n onResolveSuggestion={onResolveSuggestion}\n inputMode='numeric'\n ref={inputRef}\n value={formattedValue}\n onKeyDown={onKeyDown}\n onFocus={onInputFocusEvent}\n onBlur={onInputFocusEvent}\n aria-describedby={validCurrencyISOCode ? descriptionId : undefined}\n maxLength={16}\n />\n {validCurrencyISOCode && (\n <VisuallyHiddenText id={descriptionId} aria-hidden>\n {t('measured_in', [validCurrencyISOCode])}\n </VisuallyHiddenText>\n )}\n </>\n );\n\n return label ? (\n <FormField\n testId={testIds}\n label={label}\n labelHidden={labelHidden}\n id={id}\n info={info}\n status={status}\n required={required}\n disabled={disabled}\n additionalInfo={additionalInfo}\n onResolveSuggestion={onResolveSuggestion}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default withTestIds(CurrencyInput, getCurrencyInputTestIds);\n"]}
1
+ {"version":3,"file":"CurrencyInput.js","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO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,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,mBAAmB,EAAE,mBAAmB,YAEvC,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useMemo } from 'react';\nimport type {\n FunctionComponent,\n PropsWithoutRef,\n KeyboardEvent,\n ChangeEvent,\n FocusEvent\n} from 'react';\n\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport FormField from '../FormField';\nimport type { ForwardProps } from '../../types';\nimport {\n useConfiguration,\n useConsolidatedRef,\n useI18n,\n useInputFormatter,\n usePrevious,\n useTestIds,\n useUID\n} from '../../hooks';\nimport {\n getCleanedValue,\n getDecimalSign,\n getDecrementedValue,\n getIncrementedValue\n} from '../Number/utils';\nimport Input from '../Input';\nimport { withTestIds } from '../../utils';\n\nimport type CurrencyInputProps from './CurrencyInput.types';\nimport { getCurrencyMinimumFractionDigits, getFormattedValue, isValidCurrency } from './utils';\nimport { getCurrencyInputTestIds } from './Currency.test-ids';\n\nconst CurrencyInput: FunctionComponent<CurrencyInputProps & ForwardProps> = forwardRef(\n function CurrencyInput(\n props: PropsWithoutRef<CurrencyInputProps>,\n ref: CurrencyInputProps['ref']\n ) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n status,\n label,\n labelHidden,\n info,\n required,\n disabled,\n readOnly,\n additionalInfo,\n value: valueProp = '',\n onChange,\n onBlur,\n onFocus,\n onResolveSuggestion,\n currencyISOCode,\n showDecimal = true,\n showGroupSeparators = true,\n min = Number.MIN_SAFE_INTEGER,\n max = Number.MAX_SAFE_INTEGER,\n step = 1,\n alwaysShowISOCode = false,\n maximumFractionDigits = 0,\n ...restProps\n } = props;\n\n const descriptionId = useUID();\n const testIds = useTestIds(testId, getCurrencyInputTestIds);\n\n const { locale } = useConfiguration();\n\n const t = useI18n();\n const inputRef = useConsolidatedRef(ref);\n\n const validCurrencyISOCode = useMemo(\n () => (currencyISOCode && isValidCurrency(currencyISOCode) ? currencyISOCode : undefined),\n [currencyISOCode]\n );\n\n const minimumFractionDigits = useMemo(\n () => getCurrencyMinimumFractionDigits(locale, validCurrencyISOCode),\n [locale, validCurrencyISOCode]\n );\n\n const numberOfDecimals = showDecimal\n ? Math.max(maximumFractionDigits, minimumFractionDigits)\n : 0;\n\n const decimalSign = useMemo(() => getDecimalSign(locale), [locale]);\n\n // on initial render only pad the value with 0 if necessary\n const rendered = usePrevious(true);\n let value = valueProp;\n if (!rendered && validCurrencyISOCode && !Number.isNaN(parseFloat(value))) {\n const [integer, fraction = ''] = value.split('.');\n value = `${integer}.${fraction.padEnd(numberOfDecimals, '0')}`;\n }\n\n const formatValue = useCallback(\n number => {\n return getFormattedValue(number, locale, validCurrencyISOCode, {\n showGroupSeparators,\n showAs: alwaysShowISOCode ? 'code' : 'symbol',\n numberOfDecimals\n });\n },\n [alwaysShowISOCode, numberOfDecimals, showGroupSeparators, locale, validCurrencyISOCode]\n );\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const cleanedInputValue = getCleanedValue(inputValue, decimalSign, numberOfDecimals);\n if (cleanedInputValue === value) return;\n onChange(cleanedInputValue);\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (readOnly) return;\n const input = e.currentTarget;\n switch (e.key) {\n case 'ArrowUp':\n e.preventDefault();\n onChange(getIncrementedValue(value, min, max, step));\n break;\n case 'ArrowDown':\n e.preventDefault();\n onChange(getDecrementedValue(value, min, max, step));\n break;\n case decimalSign:\n if (!showDecimal) e.preventDefault();\n if (input.value.includes(decimalSign)) {\n if (input.selectionStart && input.value.charAt(input.selectionStart) === decimalSign) {\n input.setSelectionRange(input.selectionStart + 1, input.selectionStart + 1);\n }\n e.preventDefault();\n } else if (\n input.selectionStart !== null &&\n !input.value.charAt(input.selectionStart - 1).match(/\\d/)\n ) {\n onChange(\n getCleanedValue(`${input.value}0${decimalSign}`, decimalSign, numberOfDecimals)\n );\n e.preventDefault();\n }\n break;\n case '-':\n if (value.startsWith('-')) e.preventDefault();\n break;\n default:\n }\n };\n\n const onInputFocusEvent = (e: FocusEvent<HTMLInputElement>) => {\n let parsableValue = value;\n if (validCurrencyISOCode && !Number.isNaN(parseFloat(value))) {\n const [integer, fraction = ''] = value.split('.');\n parsableValue = `${integer}.${fraction.padEnd(numberOfDecimals, '0')}`;\n }\n\n if (e.type === 'focus') onFocus?.(parsableValue);\n else {\n if (parsableValue !== value) {\n onChange(parsableValue);\n }\n\n onBlur?.(parsableValue);\n }\n };\n\n const formattedValue = useInputFormatter(inputRef, value, formatValue, `\\\\p{N}${decimalSign}-`);\n\n const Comp = (\n <>\n <Input\n data-testid={testIds.control}\n onChange={onInputChange}\n id={id}\n readOnly={readOnly}\n required={required}\n disabled={disabled}\n status={status}\n {...restProps}\n onResolveSuggestion={onResolveSuggestion}\n inputMode='numeric'\n ref={inputRef}\n value={formattedValue}\n onKeyDown={onKeyDown}\n onFocus={onInputFocusEvent}\n onBlur={onInputFocusEvent}\n aria-describedby={validCurrencyISOCode ? descriptionId : undefined}\n maxLength={16}\n />\n {validCurrencyISOCode && (\n <VisuallyHiddenText id={descriptionId} aria-hidden>\n {t('measured_in', [validCurrencyISOCode])}\n </VisuallyHiddenText>\n )}\n </>\n );\n\n return label ? (\n <FormField\n testId={testIds}\n label={label}\n labelHidden={labelHidden}\n id={id}\n info={info}\n status={status}\n required={required}\n disabled={disabled}\n additionalInfo={additionalInfo}\n onResolveSuggestion={onResolveSuggestion}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default withTestIds(CurrencyInput, getCurrencyInputTestIds);\n"]}
@@ -1,8 +1,8 @@
1
1
  export declare const isValidCurrency: (currency: string) => boolean;
2
2
  export declare const getFormattedValue: (value: string, locale: string, currency?: string, { showGroupSeparators, showAs, numberOfDecimals }?: {
3
- showGroupSeparators?: boolean | undefined;
4
- showAs?: "symbol" | "code" | undefined;
5
- numberOfDecimals?: number | undefined;
3
+ showGroupSeparators?: boolean;
4
+ showAs?: "code" | "symbol";
5
+ numberOfDecimals?: number;
6
6
  }) => string;
7
7
  export declare function getCurrencyMinimumFractionDigits(locale: string, currencyISOCode?: string): number;
8
8
  interface CurrencyFormatOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,aAAc,MAAM,YAQ/C,CAAC;AAEF,eAAO,MAAM,iBAAiB,UACrB,MAAM,UACL,MAAM,aACH,MAAM;;;;YAkDlB,CAAC;AAEF,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAOjG;AAED,UAAU,qBAAqB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;CACpC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,qBAAqB,UAIhG"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,aAAc,MAAM,YAQ/C,CAAC;AAEF,eAAO,MAAM,iBAAiB,UACrB,MAAM,UACL,MAAM,aACH,MAAM,sDAKd;IAAE,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,WA6C5F,CAAC;AAEF,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAOjG;AAED,UAAU,qBAAqB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;CACpC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,qBAAqB,UAIhG"}
@@ -53,7 +53,7 @@ export function getCurrencyMinimumFractionDigits(locale, currencyISOCode) {
53
53
  ? new Intl.NumberFormat(locale, {
54
54
  style: 'currency',
55
55
  currency: currencyISOCode
56
- }).resolvedOptions().minimumFractionDigits
56
+ }).resolvedOptions().minimumFractionDigits ?? 0
57
57
  : NUMBER_MAX_DECIMAL_PLACES;
58
58
  }
59
59
  export function formatCurrency(value, { locale, options }) {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Currency/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,iBAAiB,IAAI,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAE,EAAE;IAClD,IAAI;QACF,kCAAkC;QAClC,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC;KACb;IAAC,MAAM;QACN,OAAO,KAAK,CAAC;KACd;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,KAAa,EACb,MAAc,EACd,QAAiB,EACjB,EACE,mBAAmB,GAAG,IAAI,EAC1B,MAAM,GAAG,MAAM,EACf,gBAAgB,KAC4E,EAAE,EAChG,EAAE;IACF,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAsB,CAAC;IAEzE,IAAI,CAA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C;QACvB,CAAC,EAAE,EAAE,CAAC,CAAC;KACR;SAAM,IAAI,QAAQ,EAAE;QACnB,SAAS,GAAG,SAAS;aAClB,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAC7C,MAAM,CACL,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,CAChC,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,EACnE,EAAE,CACH,CAAC;KACL;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,UAAU,gCAAgC,CAAC,MAAc,EAAE,eAAwB;IACvF,OAAO,eAAe;QACpB,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YAC5B,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,eAAe;SAC1B,CAAC,CAAC,eAAe,EAAE,CAAC,qBAAqB;QAC5C,CAAC,CAAC,yBAAyB,CAAC;AAChC,CAAC;AAOD,MAAM,UAAU,cAAc,CAAC,KAAsB,EAAE,EAAE,MAAM,EAAE,OAAO,EAAyB;IAC/F,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEzD,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import { NUMBER_MAX_DECIMAL_PLACES } from '../Number/NumberInput.types';\nimport { getFormattedValue as getNumberFormattedValue } from '../Number/utils';\n\nexport const isValidCurrency = (currency: string) => {\n try {\n // eslint-disable-next-line no-new\n new Intl.NumberFormat(undefined, { style: 'currency', currency });\n return true;\n } catch {\n return false;\n }\n};\n\nexport const getFormattedValue = (\n value: string,\n locale: string,\n currency?: string,\n {\n showGroupSeparators = true,\n showAs = 'code',\n numberOfDecimals\n }: { showGroupSeparators?: boolean; showAs?: 'code' | 'symbol'; numberOfDecimals?: number } = {}\n) => {\n const [integer, fractionPart] = value.split('.', 2) as [string, string?];\n\n if (!currency)\n return getNumberFormattedValue(value, locale, undefined, {\n useGrouping: showGroupSeparators,\n maximumFractionDigits: numberOfDecimals,\n minimumFractionDigits: Math.min(numberOfDecimals ?? 0, fractionPart?.length ?? 0)\n });\n\n const isCurrency = isValidCurrency(currency);\n\n const formatter = new Intl.NumberFormat(locale, {\n useGrouping: showGroupSeparators,\n maximumFractionDigits: numberOfDecimals,\n minimumFractionDigits: Math.min(numberOfDecimals ?? 0, fractionPart?.length ?? 0),\n ...(isCurrency\n ? {\n style: 'currency',\n currency,\n currencyDisplay: showAs\n }\n : {})\n });\n\n let formatted = value;\n\n if (value && !Number.isNaN(parseFloat(integer))) {\n const endsWithDot = fractionPart === '';\n const valueNumber = Number(endsWithDot ? `${value}1` : value);\n formatted = formatter.formatToParts(valueNumber).reduce((result, { type, value: part }) => {\n if (type === 'fraction' && endsWithDot) return result;\n return result + part;\n }, '');\n } else if (currency) {\n formatted = formatter\n .formatToParts(value.startsWith('-') ? -1 : 1)\n .reduce(\n (result, { type, value: part }) =>\n ['currency', 'minusSign'].includes(type) ? result + part : result,\n ''\n );\n }\n return formatted;\n};\n\nexport function getCurrencyMinimumFractionDigits(locale: string, currencyISOCode?: string): number {\n return currencyISOCode\n ? new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: currencyISOCode\n }).resolvedOptions().minimumFractionDigits\n : NUMBER_MAX_DECIMAL_PLACES;\n}\n\ninterface CurrencyFormatOptions {\n locale: string;\n options?: Intl.NumberFormatOptions;\n}\n\nexport function formatCurrency(value: number | bigint, { locale, options }: CurrencyFormatOptions) {\n const formatter = new Intl.NumberFormat(locale, options);\n\n return formatter.format(value);\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../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S,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,UAAU,gCAAgC,CAAC,MAAc,EAAE,eAAwB;IACvF,OAAO,eAAe;QACpB,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YAC5B,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,eAAe;SAC1B,CAAC,CAAC,eAAe,EAAE,CAAC,qBAAqB,IAAI,CAAC;QACjD,CAAC,CAAC,yBAAyB,CAAC;AAChC,CAAC;AAOD,MAAM,UAAU,cAAc,CAAC,KAAsB,EAAE,EAAE,MAAM,EAAE,OAAO,EAAyB;IAC/F,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEzD,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import { NUMBER_MAX_DECIMAL_PLACES } from '../Number/NumberInput.types';\nimport { getFormattedValue as getNumberFormattedValue } from '../Number/utils';\n\nexport const isValidCurrency = (currency: string) => {\n try {\n // eslint-disable-next-line no-new\n new Intl.NumberFormat(undefined, { style: 'currency', currency });\n return true;\n } catch {\n return false;\n }\n};\n\nexport const getFormattedValue = (\n value: string,\n locale: string,\n currency?: string,\n {\n showGroupSeparators = true,\n showAs = 'code',\n numberOfDecimals\n }: { showGroupSeparators?: boolean; showAs?: 'code' | 'symbol'; numberOfDecimals?: number } = {}\n) => {\n const [integer, fractionPart] = value.split('.', 2) as [string, string?];\n\n if (!currency)\n return getNumberFormattedValue(value, locale, undefined, {\n useGrouping: showGroupSeparators,\n maximumFractionDigits: numberOfDecimals,\n minimumFractionDigits: Math.min(numberOfDecimals ?? 0, fractionPart?.length ?? 0)\n });\n\n const isCurrency = isValidCurrency(currency);\n\n const formatter = new Intl.NumberFormat(locale, {\n useGrouping: showGroupSeparators,\n maximumFractionDigits: numberOfDecimals,\n minimumFractionDigits: Math.min(numberOfDecimals ?? 0, fractionPart?.length ?? 0),\n ...(isCurrency\n ? {\n style: 'currency',\n currency,\n currencyDisplay: showAs\n }\n : {})\n });\n\n let formatted = value;\n\n if (value && !Number.isNaN(parseFloat(integer))) {\n const endsWithDot = fractionPart === '';\n const valueNumber = Number(endsWithDot ? `${value}1` : value);\n formatted = formatter.formatToParts(valueNumber).reduce((result, { type, value: part }) => {\n if (type === 'fraction' && endsWithDot) return result;\n return result + part;\n }, '');\n } else if (currency) {\n formatted = formatter\n .formatToParts(value.startsWith('-') ? -1 : 1)\n .reduce(\n (result, { type, value: part }) =>\n ['currency', 'minusSign'].includes(type) ? result + part : result,\n ''\n );\n }\n return formatted;\n};\n\nexport function getCurrencyMinimumFractionDigits(locale: string, currencyISOCode?: string): number {\n return currencyISOCode\n ? new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: currencyISOCode\n }).resolvedOptions().minimumFractionDigits ?? 0\n : NUMBER_MAX_DECIMAL_PLACES;\n}\n\ninterface CurrencyFormatOptions {\n locale: string;\n options?: Intl.NumberFormatOptions;\n}\n\nexport function formatCurrency(value: number | bigint, { locale, options }: CurrencyFormatOptions) {\n const formatter = new Intl.NumberFormat(locale, options);\n\n return formatter.format(value);\n}\n"]}
@@ -1,12 +1,12 @@
1
- export declare const getDurationInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-number", "control-unit", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
2
- export declare const getDateInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "open-close-picker", "clear-current-date", "set-current-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
3
- export declare const getDateRangeInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["from-date", "to-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
4
- export declare const getDateTimeInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "discard-changes", "apply-changes", "clear-current-date-and-time", "set-current-date-and-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
5
- export declare const getDayOfWeekInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
6
- export declare const getMonthInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-month", "control-year", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
7
- export declare const getQuarterInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-quarter", "control-year", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
8
- export declare const getTimeInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
9
- export declare const getTimeRangeInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["from-time", "to-time", "from-date-time", "to-date-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
10
- export declare const getWeekInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-week", "control-year", "open-close-picker", "clear-current-week", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
11
- export declare const getDatePickerTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["previous-month", "month", "next-month", "calendar", "time", "set-current-date"]>;
1
+ export declare const getDurationInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-number", "control-unit", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
2
+ export declare const getDateInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "open-close-picker", "clear-current-date", "set-current-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
3
+ export declare const getDateRangeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["from-date", "to-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
4
+ export declare const getDateTimeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "discard-changes", "apply-changes", "clear-current-date-and-time", "set-current-date-and-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
5
+ export declare const getDayOfWeekInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
6
+ export declare const getMonthInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-month", "control-year", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
7
+ export declare const getQuarterInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-quarter", "control-year", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
8
+ export declare const getTimeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
9
+ export declare const getTimeRangeInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["from-time", "to-time", "from-date-time", "to-date-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
10
+ export declare const getWeekInputTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["control-week", "control-year", "open-close-picker", "clear-current-week", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
11
+ export declare const getDatePickerTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly ["previous-month", "month", "next-month", "calendar", "time", "set-current-date"]>;
12
12
  //# sourceMappingURL=DateTime.test-ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateTime.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTime.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,0PAOzB,CAAC;AAEZ,eAAO,MAAM,mBAAmB,mRAQrB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,4LAI1B,CAAC;AAEZ,eAAO,MAAM,uBAAuB,+YAczB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,+KAG1B,CAAC;AAEZ,eAAO,MAAM,oBAAoB,qMAItB,CAAC;AAEZ,eAAO,MAAM,sBAAsB,uMAIxB,CAAC;AAEZ,eAAO,MAAM,mBAAmB,+PAOrB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,8NAM1B,CAAC;AAEZ,eAAO,MAAM,mBAAmB,+OAMrB,CAAC;AAEZ,eAAO,MAAM,oBAAoB,uKAOtB,CAAC"}
1
+ {"version":3,"file":"DateTime.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTime.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,qQAOzB,CAAC;AAEZ,eAAO,MAAM,mBAAmB,8RAQrB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,uMAI1B,CAAC;AAEZ,eAAO,MAAM,uBAAuB,0ZAczB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,0LAG1B,CAAC;AAEZ,eAAO,MAAM,oBAAoB,gNAItB,CAAC;AAEZ,eAAO,MAAM,sBAAsB,kNAIxB,CAAC;AAEZ,eAAO,MAAM,mBAAmB,0QAOrB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,yOAM1B,CAAC;AAEZ,eAAO,MAAM,mBAAmB,0PAMrB,CAAC;AAEZ,eAAO,MAAM,oBAAoB,kLAOtB,CAAC"}
@@ -24,7 +24,7 @@ export interface DateInputProps extends DateTimeProps {
24
24
  }
25
25
  export declare const StyledDateInput: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, DateInputProps, never>;
26
26
  declare const _default: FunctionComponent<DateInputProps & ForwardProps> & {
27
- getTestIds: (testIdProp?: string | null | undefined) => import("../../../types").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "open-close-picker", "clear-current-date", "set-current-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
27
+ getTestIds: (testIdProp?: import("../../../types").TestIdProp["testId"]) => import("../../../types").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "open-close-picker", "clear-current-date", "set-current-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
28
28
  };
29
29
  export default _default;
30
30
  //# sourceMappingURL=DateInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,iBAAiB,EAEjB,GAAG,EAEH,QAAQ,EACR,cAAc,EACd,aAAa,EACd,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAMnD,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAC;AAyBnD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kCAAkC;IA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AO,MAAM,eAAe,qHAE3B,CAAC;;;;AAmWF,wBAA2D"}
@@ -11,7 +11,7 @@ import DatePicker from '../Picker/DatePicker';
11
11
  import { StyledFormControl } from '../../FormControl';
12
12
  import { withTestIds } from '../../../utils';
13
13
  import { getDateInputTestIds } from '../DateTime.test-ids';
14
- import { getDateFormat, parsePastedTextToDate, parseToDate, validateDate, generatePickerButtonAriaLabel } from './utils';
14
+ import { getDateFormat, getDateTimeParts, parsePastedTextToDate, parseToDate, validateDate, generatePickerButtonAriaLabel } from './utils';
15
15
  import StyledDateTime, { StyledDatePickerDialog, StyledDialogContent, StyledInputButton, StyledInputContainer } from './DateTime.styles';
16
16
  import useAutoFocusNextInput from './useAutoFocusNextInput';
17
17
  import PartInput from './PartInput';
@@ -50,9 +50,9 @@ const convertToCallbackParameter = (date, { year, month: monthIndex, day }) => {
50
50
  };
51
51
  const DateInput = forwardRef(function DateInput(props, ref) {
52
52
  const { locale } = useConfiguration();
53
- const { testId, value, min, max, id, label, labelHidden, info = getDateFormat(locale).join(''), status, required, readOnly, disabled, onChange, onFocus, onBlur, onResolveSuggestion, showWeekNumber, picker: { renderer: PickerComp = DatePicker, rendererProps = {} } = {}, autoFocus, additionalInfo, handle, ...restProps } = props;
54
- const testIds = useTestIds(testId, getDateInputTestIds);
55
53
  const t = useI18n();
54
+ const { testId, value, min, max, id, label, labelHidden, info = getDateFormat(t, locale, 'date'), status, required, readOnly, disabled, onChange, onFocus, onBlur, onResolveSuggestion, showWeekNumber, picker: { renderer: PickerComp = DatePicker, rendererProps = {} } = {}, autoFocus, additionalInfo, handle, ...restProps } = props;
55
+ const testIds = useTestIds(testId, getDateInputTestIds);
56
56
  const containerRef = useRef(null);
57
57
  const date = value !== undefined && value !== '' ? parseToDate(value) : undefined;
58
58
  const [yearInputRef, monthInputRef, dayInputRef] = [
@@ -146,15 +146,15 @@ const DateInput = forwardRef(function DateInput(props, ref) {
146
146
  const Comp = (_jsxs(Flex, { "data-testid": testIds.root, as: StyledDateInput, forwardedAs: StyledFormControl, hasSuggestion: status === 'pending' && !!onResolveSuggestion, container: { alignItems: 'center', wrap: 'nowrap', justify: 'between' }, status: status, readOnly: readOnly, disabled: disabled, ref: containerRef, onClick: (e) => {
147
147
  if (e.target === containerRef.current)
148
148
  orderedRefs[0].current?.focus();
149
- }, ...restProps, children: [_jsx(Flex, { ref: inputContainerRef, as: StyledInputContainer, container: { alignItems: 'center', wrap: 'wrap' }, onPaste: onPaste, children: getDateFormat(locale).map(part => {
149
+ }, ...restProps, children: [_jsx(Flex, { ref: inputContainerRef, as: StyledInputContainer, container: { alignItems: 'center', wrap: 'wrap' }, onPaste: onPaste, children: getDateTimeParts(locale).map(part => {
150
150
  switch (part) {
151
- case 'DD':
151
+ case 'day':
152
152
  orderedRefs.push(dayInputRef);
153
153
  return DayInput;
154
- case 'MM':
154
+ case 'month':
155
155
  orderedRefs.push(monthInputRef);
156
156
  return MonthInput;
157
- case 'YYYY':
157
+ case 'year':
158
158
  orderedRefs.push(yearInputRef);
159
159
  return YearInput;
160
160
  default: