@pega/cosmos-react-core 2.0.0-dev.9.2 → 2.0.0-rc.2

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 (810) hide show
  1. package/README.md +3 -3
  2. package/lib/components/Actions/Actions.js +1 -1
  3. package/lib/components/Actions/Actions.js.map +1 -1
  4. package/lib/components/AppShell/AppHeader.d.ts +2 -1
  5. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  6. package/lib/components/AppShell/AppHeader.js +4 -9
  7. package/lib/components/AppShell/AppHeader.js.map +1 -1
  8. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  9. package/lib/components/AppShell/AppShell.js +89 -62
  10. package/lib/components/AppShell/AppShell.js.map +1 -1
  11. package/lib/components/AppShell/AppShell.styles.d.ts +19 -16
  12. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppShell.styles.js +227 -173
  14. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  15. package/lib/components/AppShell/AppShell.types.d.ts +7 -7
  16. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  17. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  18. package/lib/components/AppShell/AppShellContext.d.ts +3 -0
  19. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  20. package/lib/components/AppShell/AppShellContext.js +3 -1
  21. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  22. package/lib/components/AppShell/AppShellList.d.ts +4 -3
  23. package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
  24. package/lib/components/AppShell/AppShellList.js +24 -19
  25. package/lib/components/AppShell/AppShellList.js.map +1 -1
  26. package/lib/components/AppShell/Drawer.d.ts.map +1 -1
  27. package/lib/components/AppShell/Drawer.js +7 -8
  28. package/lib/components/AppShell/Drawer.js.map +1 -1
  29. package/lib/components/AppShell/Operator.js +3 -5
  30. package/lib/components/AppShell/Operator.js.map +1 -1
  31. package/lib/components/AppShell/SkipNavigation.d.ts.map +1 -1
  32. package/lib/components/AppShell/SkipNavigation.js +30 -39
  33. package/lib/components/AppShell/SkipNavigation.js.map +1 -1
  34. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  35. package/lib/components/Avatar/Avatar.js +5 -4
  36. package/lib/components/Avatar/Avatar.js.map +1 -1
  37. package/lib/components/Backdrop/Backdrop.d.ts +1 -1
  38. package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
  39. package/lib/components/Backdrop/Backdrop.js +7 -6
  40. package/lib/components/Backdrop/Backdrop.js.map +1 -1
  41. package/lib/components/Badges/Alert.d.ts +2 -2
  42. package/lib/components/Badges/Alert.d.ts.map +1 -1
  43. package/lib/components/Badges/Alert.js +1 -1
  44. package/lib/components/Badges/Alert.js.map +1 -1
  45. package/lib/components/Badges/Count.js +1 -1
  46. package/lib/components/Badges/Count.js.map +1 -1
  47. package/lib/components/Badges/Selection.d.ts.map +1 -1
  48. package/lib/components/Badges/Selection.js +10 -9
  49. package/lib/components/Badges/Selection.js.map +1 -1
  50. package/lib/components/Badges/Status.d.ts +2 -2
  51. package/lib/components/Badges/Status.d.ts.map +1 -1
  52. package/lib/components/Badges/Status.js +1 -1
  53. package/lib/components/Badges/Status.js.map +1 -1
  54. package/lib/components/Badges/Tag.js +1 -1
  55. package/lib/components/Badges/Tag.js.map +1 -1
  56. package/lib/components/Banner/Banner.d.ts +2 -2
  57. package/lib/components/Banner/Banner.d.ts.map +1 -1
  58. package/lib/components/Banner/Banner.js +6 -8
  59. package/lib/components/Banner/Banner.js.map +1 -1
  60. package/lib/components/Boolean/BooleanDisplay.d.ts +2 -2
  61. package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
  62. package/lib/components/Boolean/BooleanDisplay.js +1 -2
  63. package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
  64. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
  65. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  66. package/lib/components/Breadcrumbs/Breadcrumbs.js +13 -11
  67. package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  68. package/lib/components/Button/BareButton.d.ts.map +1 -1
  69. package/lib/components/Button/BareButton.js +21 -2
  70. package/lib/components/Button/BareButton.js.map +1 -1
  71. package/lib/components/Button/BareRoleButton.d.ts +12 -0
  72. package/lib/components/Button/BareRoleButton.d.ts.map +1 -0
  73. package/lib/components/Button/BareRoleButton.js +20 -0
  74. package/lib/components/Button/BareRoleButton.js.map +1 -0
  75. package/lib/components/Button/Button.d.ts +5 -0
  76. package/lib/components/Button/Button.d.ts.map +1 -1
  77. package/lib/components/Button/Button.js +34 -10
  78. package/lib/components/Button/Button.js.map +1 -1
  79. package/lib/components/Card/Card.d.ts.map +1 -1
  80. package/lib/components/Card/Card.js +3 -2
  81. package/lib/components/Card/Card.js.map +1 -1
  82. package/lib/components/Card/CardContent.d.ts.map +1 -1
  83. package/lib/components/Card/CardContent.js +5 -4
  84. package/lib/components/Card/CardContent.js.map +1 -1
  85. package/lib/components/Card/CardFooter.d.ts.map +1 -1
  86. package/lib/components/Card/CardFooter.js +5 -4
  87. package/lib/components/Card/CardFooter.js.map +1 -1
  88. package/lib/components/Card/CardHeader.d.ts +3 -1
  89. package/lib/components/Card/CardHeader.d.ts.map +1 -1
  90. package/lib/components/Card/CardHeader.js +9 -7
  91. package/lib/components/Card/CardHeader.js.map +1 -1
  92. package/lib/components/Card/CardMedia.js +1 -1
  93. package/lib/components/Card/CardMedia.js.map +1 -1
  94. package/lib/components/Card/CollapsibleCard.d.ts.map +1 -1
  95. package/lib/components/Card/CollapsibleCard.js +5 -7
  96. package/lib/components/Card/CollapsibleCard.js.map +1 -1
  97. package/lib/components/Card/SelectableCard.js +1 -1
  98. package/lib/components/Card/SelectableCard.js.map +1 -1
  99. package/lib/components/Checkbox/Checkbox.d.ts +2 -2
  100. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  101. package/lib/components/Checkbox/Checkbox.js +1 -1
  102. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  103. package/lib/components/ColorPicker/ColorPicker.d.ts +2 -2
  104. package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  105. package/lib/components/ColorPicker/ColorPicker.js +8 -11
  106. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  107. package/lib/components/ComboBox/ComboBox.d.ts +1 -1
  108. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  109. package/lib/components/ComboBox/ComboBox.js +30 -33
  110. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  111. package/lib/components/ComboBox/ComboBox.types.d.ts +2 -1
  112. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  113. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  114. package/lib/components/ComboBox/ComboBoxInput.js +4 -4
  115. package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
  116. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  117. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +23 -29
  118. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  119. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
  120. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +16 -12
  121. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
  122. package/lib/components/Configuration/Configuration.js +11 -13
  123. package/lib/components/Configuration/Configuration.js.map +1 -1
  124. package/lib/components/Currency/CurrencyDisplay.d.ts +6 -2
  125. package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
  126. package/lib/components/Currency/CurrencyDisplay.js +11 -7
  127. package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
  128. package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
  129. package/lib/components/Currency/CurrencyInput.js +16 -16
  130. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  131. package/lib/components/Currency/CurrencyInput.types.d.ts +6 -2
  132. package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
  133. package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
  134. package/lib/components/Currency/utils.d.ts +12 -1
  135. package/lib/components/Currency/utils.d.ts.map +1 -1
  136. package/lib/components/Currency/utils.js +30 -2
  137. package/lib/components/Currency/utils.js.map +1 -1
  138. package/lib/components/DateTime/DateTime.types.d.ts +2 -1
  139. package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
  140. package/lib/components/DateTime/DateTime.types.js.map +1 -1
  141. package/lib/components/DateTime/DateTimeDisplay.d.ts +1 -1
  142. package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
  143. package/lib/components/DateTime/DateTimeDisplay.js +14 -3
  144. package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
  145. package/lib/components/DateTime/DurationDisplay.d.ts.map +1 -1
  146. package/lib/components/DateTime/DurationDisplay.js +11 -6
  147. package/lib/components/DateTime/DurationDisplay.js.map +1 -1
  148. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  149. package/lib/components/DateTime/Input/DateInput.js +25 -27
  150. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  151. package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
  152. package/lib/components/DateTime/Input/DateRangeInput.js +10 -16
  153. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  154. package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
  155. package/lib/components/DateTime/Input/DateTime.styles.js +14 -3
  156. package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
  157. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  158. package/lib/components/DateTime/Input/DateTimeInput.js +42 -42
  159. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  160. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +2 -0
  161. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
  162. package/lib/components/DateTime/Input/DayOfWeekInput.js +7 -5
  163. package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
  164. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
  165. package/lib/components/DateTime/Input/Duration/DurationInput.js +3 -3
  166. package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
  167. package/lib/components/DateTime/Input/Duration/NumberUnit.js +4 -5
  168. package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
  169. package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
  170. package/lib/components/DateTime/Input/Duration/Time.js +12 -15
  171. package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
  172. package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
  173. package/lib/components/DateTime/Input/MonthInput.js +12 -17
  174. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  175. package/lib/components/DateTime/Input/PartInput.js +3 -4
  176. package/lib/components/DateTime/Input/PartInput.js.map +1 -1
  177. package/lib/components/DateTime/Input/QuarterInput.d.ts +9 -0
  178. package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -0
  179. package/lib/components/DateTime/Input/QuarterInput.js +102 -0
  180. package/lib/components/DateTime/Input/QuarterInput.js.map +1 -0
  181. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  182. package/lib/components/DateTime/Input/TimeInput.js +26 -30
  183. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  184. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  185. package/lib/components/DateTime/Input/WeekInput.js +22 -23
  186. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  187. package/lib/components/DateTime/Input/useAutoFocusNextInput.d.ts.map +1 -1
  188. package/lib/components/DateTime/Input/useAutoFocusNextInput.js +8 -9
  189. package/lib/components/DateTime/Input/useAutoFocusNextInput.js.map +1 -1
  190. package/lib/components/DateTime/Input/usePickerButton.js +4 -4
  191. package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
  192. package/lib/components/DateTime/Input/utils.d.ts +7 -0
  193. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  194. package/lib/components/DateTime/Input/utils.js +52 -10
  195. package/lib/components/DateTime/Input/utils.js.map +1 -1
  196. package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
  197. package/lib/components/DateTime/Picker/Calendar.js +47 -72
  198. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  199. package/lib/components/DateTime/Picker/Calendar.styles.d.ts +2 -2
  200. package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
  201. package/lib/components/DateTime/Picker/Calendar.styles.js +16 -7
  202. package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
  203. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  204. package/lib/components/DateTime/Picker/DatePicker.js +13 -17
  205. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  206. package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
  207. package/lib/components/DateTime/Picker/DateRangePicker.js +13 -17
  208. package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
  209. package/lib/components/DateTime/Picker/TimePicker.js +9 -10
  210. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  211. package/lib/components/DateTime/Picker/Weeks.js +9 -11
  212. package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
  213. package/lib/components/DateTime/Picker/utils.d.ts +1 -0
  214. package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
  215. package/lib/components/DateTime/Picker/utils.js +3 -0
  216. package/lib/components/DateTime/Picker/utils.js.map +1 -1
  217. package/lib/components/DateTime/index.d.ts +2 -0
  218. package/lib/components/DateTime/index.d.ts.map +1 -1
  219. package/lib/components/DateTime/index.js +1 -0
  220. package/lib/components/DateTime/index.js.map +1 -1
  221. package/lib/components/Drawer/Drawer.js +6 -6
  222. package/lib/components/Drawer/Drawer.js.map +1 -1
  223. package/lib/components/Email/EmailDisplay.d.ts +2 -2
  224. package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
  225. package/lib/components/Email/EmailDisplay.js +2 -2
  226. package/lib/components/Email/EmailDisplay.js.map +1 -1
  227. package/lib/components/EmojiPicker/EmojiDisplay.d.ts.map +1 -1
  228. package/lib/components/EmojiPicker/EmojiDisplay.js +1 -1
  229. package/lib/components/EmojiPicker/EmojiDisplay.js.map +1 -1
  230. package/lib/components/EmojiPicker/EmojiPicker.js +3 -4
  231. package/lib/components/EmojiPicker/EmojiPicker.js.map +1 -1
  232. package/lib/components/EmptyState/EmptyState.d.ts +14 -0
  233. package/lib/components/EmptyState/EmptyState.d.ts.map +1 -0
  234. package/lib/components/{NoItems/NoItems.js → EmptyState/EmptyState.js} +11 -8
  235. package/lib/components/EmptyState/EmptyState.js.map +1 -0
  236. package/lib/components/EmptyState/index.d.ts +4 -0
  237. package/lib/components/EmptyState/index.d.ts.map +1 -0
  238. package/lib/components/EmptyState/index.js +3 -0
  239. package/lib/components/EmptyState/index.js.map +1 -0
  240. package/lib/components/ErrorState/ErrorState.d.ts +16 -0
  241. package/lib/components/ErrorState/ErrorState.d.ts.map +1 -0
  242. package/lib/components/ErrorState/ErrorState.js +31 -0
  243. package/lib/components/ErrorState/ErrorState.js.map +1 -0
  244. package/lib/components/ErrorState/index.d.ts +4 -0
  245. package/lib/components/ErrorState/index.d.ts.map +1 -0
  246. package/lib/components/ErrorState/index.js +3 -0
  247. package/lib/components/ErrorState/index.js.map +1 -0
  248. package/lib/components/ExpandCollapse/ExpandCollapse.js +5 -5
  249. package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
  250. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  251. package/lib/components/FieldGroup/FieldGroup.js +6 -7
  252. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  253. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  254. package/lib/components/FieldGroup/FieldGroupList.js +7 -6
  255. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  256. package/lib/components/FieldValueList/FieldValueList.d.ts +2 -2
  257. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  258. package/lib/components/FieldValueList/FieldValueList.js +5 -7
  259. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  260. package/lib/components/File/FileDisplay.d.ts +6 -3
  261. package/lib/components/File/FileDisplay.d.ts.map +1 -1
  262. package/lib/components/File/FileDisplay.js +7 -7
  263. package/lib/components/File/FileDisplay.js.map +1 -1
  264. package/lib/components/File/FileInput.d.ts +3 -3
  265. package/lib/components/File/FileInput.d.ts.map +1 -1
  266. package/lib/components/File/FileInput.js +18 -19
  267. package/lib/components/File/FileInput.js.map +1 -1
  268. package/lib/components/File/FileItem.d.ts +0 -2
  269. package/lib/components/File/FileItem.d.ts.map +1 -1
  270. package/lib/components/File/FileItem.js +3 -4
  271. package/lib/components/File/FileItem.js.map +1 -1
  272. package/lib/components/File/FileUploadItem.d.ts +4 -2
  273. package/lib/components/File/FileUploadItem.d.ts.map +1 -1
  274. package/lib/components/File/FileUploadItem.js +58 -20
  275. package/lib/components/File/FileUploadItem.js.map +1 -1
  276. package/lib/components/File/FileVisual.d.ts +7 -16
  277. package/lib/components/File/FileVisual.d.ts.map +1 -1
  278. package/lib/components/File/FileVisual.js +44 -47
  279. package/lib/components/File/FileVisual.js.map +1 -1
  280. package/lib/components/File/utils.js +2 -3
  281. package/lib/components/File/utils.js.map +1 -1
  282. package/lib/components/Flex/Flex.d.ts +17 -7
  283. package/lib/components/Flex/Flex.d.ts.map +1 -1
  284. package/lib/components/Flex/Flex.js +25 -9
  285. package/lib/components/Flex/Flex.js.map +1 -1
  286. package/lib/components/Form/Form.d.ts +7 -1
  287. package/lib/components/Form/Form.d.ts.map +1 -1
  288. package/lib/components/Form/Form.js +5 -4
  289. package/lib/components/Form/Form.js.map +1 -1
  290. package/lib/components/FormControl/FormControl.d.ts +1 -1
  291. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  292. package/lib/components/FormControl/FormControl.js +1 -1
  293. package/lib/components/FormControl/FormControl.js.map +1 -1
  294. package/lib/components/FormField/FormField.d.ts +5 -7
  295. package/lib/components/FormField/FormField.d.ts.map +1 -1
  296. package/lib/components/FormField/FormField.js +9 -19
  297. package/lib/components/FormField/FormField.js.map +1 -1
  298. package/lib/components/Grid/Grid.d.ts +1 -1
  299. package/lib/components/Grid/Grid.d.ts.map +1 -1
  300. package/lib/components/Grid/Grid.js +17 -21
  301. package/lib/components/Grid/Grid.js.map +1 -1
  302. package/lib/components/Icon/Icon.js +3 -5
  303. package/lib/components/Icon/Icon.js.map +1 -1
  304. package/lib/components/Icon/iconNames.d.ts +1 -1
  305. package/lib/components/Icon/iconNames.d.ts.map +1 -1
  306. package/lib/components/Icon/iconNames.js +2 -0
  307. package/lib/components/Icon/iconNames.js.map +1 -1
  308. package/lib/components/Icon/icons/compass-solid.icon.js +1 -2
  309. package/lib/components/Icon/icons/compass-solid.icon.js.map +1 -1
  310. package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js +1 -4
  311. package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js.map +1 -1
  312. package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js +1 -2
  313. package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js.map +1 -1
  314. package/lib/components/Icon/icons/dataviz-waterfall.icon.js +1 -5
  315. package/lib/components/Icon/icons/dataviz-waterfall.icon.js.map +1 -1
  316. package/lib/components/Icon/icons/dock.icon.d.ts +4 -0
  317. package/lib/components/Icon/icons/dock.icon.d.ts.map +1 -0
  318. package/lib/components/Icon/icons/dock.icon.js +6 -0
  319. package/lib/components/Icon/icons/dock.icon.js.map +1 -0
  320. package/lib/components/Icon/icons/filetype-text.icon.js +1 -4
  321. package/lib/components/Icon/icons/filetype-text.icon.js.map +1 -1
  322. package/lib/components/Icon/icons/folder-dollar.icon.js +1 -2
  323. package/lib/components/Icon/icons/folder-dollar.icon.js.map +1 -1
  324. package/lib/components/Icon/icons/freeze-column.icon.js +1 -2
  325. package/lib/components/Icon/icons/freeze-column.icon.js.map +1 -1
  326. package/lib/components/Icon/icons/galaxy.icon.js +1 -3
  327. package/lib/components/Icon/icons/galaxy.icon.js.map +1 -1
  328. package/lib/components/Icon/icons/grad-solid.icon.js +1 -2
  329. package/lib/components/Icon/icons/grad-solid.icon.js.map +1 -1
  330. package/lib/components/Icon/icons/grad.icon.js +1 -5
  331. package/lib/components/Icon/icons/grad.icon.js.map +1 -1
  332. package/lib/components/Icon/icons/list-number.icon.js +1 -6
  333. package/lib/components/Icon/icons/list-number.icon.js.map +1 -1
  334. package/lib/components/Icon/icons/list.icon.js +1 -6
  335. package/lib/components/Icon/icons/list.icon.js.map +1 -1
  336. package/lib/components/Icon/icons/pin.icon.js +1 -2
  337. package/lib/components/Icon/icons/pin.icon.js.map +1 -1
  338. package/lib/components/Icon/icons/search-solid.icon.js +1 -2
  339. package/lib/components/Icon/icons/search-solid.icon.js.map +1 -1
  340. package/lib/components/Icon/icons/tracer.icon.js +1 -2
  341. package/lib/components/Icon/icons/tracer.icon.js.map +1 -1
  342. package/lib/components/Icon/icons/tribox-solid.icon.js +1 -3
  343. package/lib/components/Icon/icons/tribox-solid.icon.js.map +1 -1
  344. package/lib/components/Icon/icons/tribox.icon.js +1 -3
  345. package/lib/components/Icon/icons/tribox.icon.js.map +1 -1
  346. package/lib/components/Icon/icons/undock.icon.d.ts +4 -0
  347. package/lib/components/Icon/icons/undock.icon.d.ts.map +1 -0
  348. package/lib/components/Icon/icons/undock.icon.js +6 -0
  349. package/lib/components/Icon/icons/undock.icon.js.map +1 -0
  350. package/lib/components/Image/Image.js +1 -1
  351. package/lib/components/Image/Image.js.map +1 -1
  352. package/lib/components/Image/index.d.ts +1 -1
  353. package/lib/components/Image/index.d.ts.map +1 -1
  354. package/lib/components/Image/index.js +1 -0
  355. package/lib/components/Image/index.js.map +1 -1
  356. package/lib/components/Input/Input.d.ts +2 -2
  357. package/lib/components/Input/Input.d.ts.map +1 -1
  358. package/lib/components/Input/Input.js +13 -13
  359. package/lib/components/Input/Input.js.map +1 -1
  360. package/lib/components/Input/Input.styles.js +2 -2
  361. package/lib/components/Input/Input.styles.js.map +1 -1
  362. package/lib/components/Label/Label.js +1 -1
  363. package/lib/components/Label/Label.js.map +1 -1
  364. package/lib/components/Lightbox/Lightbox.d.ts +6 -0
  365. package/lib/components/Lightbox/Lightbox.d.ts.map +1 -0
  366. package/lib/components/Lightbox/Lightbox.js +129 -0
  367. package/lib/components/Lightbox/Lightbox.js.map +1 -0
  368. package/lib/components/Lightbox/Lightbox.styles.d.ts +11 -0
  369. package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -0
  370. package/lib/components/Lightbox/Lightbox.styles.js +166 -0
  371. package/lib/components/Lightbox/Lightbox.styles.js.map +1 -0
  372. package/lib/components/Lightbox/Lightbox.types.d.ts +42 -0
  373. package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -0
  374. package/lib/components/Lightbox/Lightbox.types.js +2 -0
  375. package/lib/components/Lightbox/Lightbox.types.js.map +1 -0
  376. package/lib/components/Lightbox/index.d.ts +3 -0
  377. package/lib/components/Lightbox/index.d.ts.map +1 -0
  378. package/lib/components/Lightbox/index.js +2 -0
  379. package/lib/components/Lightbox/index.js.map +1 -0
  380. package/lib/components/Link/Link.js +5 -8
  381. package/lib/components/Link/Link.js.map +1 -1
  382. package/lib/components/List/CommaSeparatedList.d.ts +15 -0
  383. package/lib/components/List/CommaSeparatedList.d.ts.map +1 -0
  384. package/lib/components/List/CommaSeparatedList.js +61 -0
  385. package/lib/components/List/CommaSeparatedList.js.map +1 -0
  386. package/lib/components/List/List.d.ts +30 -0
  387. package/lib/components/List/List.d.ts.map +1 -0
  388. package/lib/components/List/List.js +56 -0
  389. package/lib/components/List/List.js.map +1 -0
  390. package/lib/components/List/OrderedList.d.ts +6 -0
  391. package/lib/components/List/OrderedList.d.ts.map +1 -0
  392. package/lib/components/List/OrderedList.js +6 -0
  393. package/lib/components/List/OrderedList.js.map +1 -0
  394. package/lib/components/List/UnorderedList.d.ts +6 -0
  395. package/lib/components/List/UnorderedList.d.ts.map +1 -0
  396. package/lib/components/List/UnorderedList.js +6 -0
  397. package/lib/components/List/UnorderedList.js.map +1 -0
  398. package/lib/components/List/index.d.ts +5 -0
  399. package/lib/components/List/index.d.ts.map +1 -0
  400. package/lib/components/List/index.js +4 -0
  401. package/lib/components/List/index.js.map +1 -0
  402. package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
  403. package/lib/components/Location/CurrentLocationButton.js +7 -7
  404. package/lib/components/Location/CurrentLocationButton.js.map +1 -1
  405. package/lib/components/Location/Location.types.d.ts +2 -1
  406. package/lib/components/Location/Location.types.d.ts.map +1 -1
  407. package/lib/components/Location/Location.types.js.map +1 -1
  408. package/lib/components/Location/LocationDisplay.js +8 -9
  409. package/lib/components/Location/LocationDisplay.js.map +1 -1
  410. package/lib/components/Location/LocationInput.js +27 -28
  411. package/lib/components/Location/LocationInput.js.map +1 -1
  412. package/lib/components/Location/LocationView.js +8 -13
  413. package/lib/components/Location/LocationView.js.map +1 -1
  414. package/lib/components/Location/utils.js +11 -15
  415. package/lib/components/Location/utils.js.map +1 -1
  416. package/lib/components/Menu/FlyoutMenuList.d.ts.map +1 -1
  417. package/lib/components/Menu/FlyoutMenuList.js +12 -15
  418. package/lib/components/Menu/FlyoutMenuList.js.map +1 -1
  419. package/lib/components/Menu/Menu.context.d.ts.map +1 -1
  420. package/lib/components/Menu/Menu.context.js +2 -0
  421. package/lib/components/Menu/Menu.context.js.map +1 -1
  422. package/lib/components/Menu/Menu.d.ts.map +1 -1
  423. package/lib/components/Menu/Menu.js +89 -46
  424. package/lib/components/Menu/Menu.js.map +1 -1
  425. package/lib/components/Menu/Menu.styles.d.ts +11 -0
  426. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  427. package/lib/components/Menu/Menu.styles.js +202 -3
  428. package/lib/components/Menu/Menu.styles.js.map +1 -1
  429. package/lib/components/Menu/Menu.types.d.ts +30 -12
  430. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  431. package/lib/components/Menu/Menu.types.js.map +1 -1
  432. package/lib/components/Menu/MenuGroup.d.ts +6 -0
  433. package/lib/components/Menu/MenuGroup.d.ts.map +1 -0
  434. package/lib/components/Menu/MenuGroup.js +17 -0
  435. package/lib/components/Menu/MenuGroup.js.map +1 -0
  436. package/lib/components/Menu/MenuItem.d.ts +0 -3
  437. package/lib/components/Menu/MenuItem.d.ts.map +1 -1
  438. package/lib/components/Menu/MenuItem.js +57 -164
  439. package/lib/components/Menu/MenuItem.js.map +1 -1
  440. package/lib/components/Menu/MenuList.d.ts +1 -1
  441. package/lib/components/Menu/MenuList.d.ts.map +1 -1
  442. package/lib/components/Menu/MenuList.js +28 -30
  443. package/lib/components/Menu/MenuList.js.map +1 -1
  444. package/lib/components/Menu/MenuListHeader.d.ts +0 -1
  445. package/lib/components/Menu/MenuListHeader.d.ts.map +1 -1
  446. package/lib/components/Menu/MenuListHeader.js +7 -55
  447. package/lib/components/Menu/MenuListHeader.js.map +1 -1
  448. package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
  449. package/lib/components/Menu/NavItemsList.js +2 -3
  450. package/lib/components/Menu/NavItemsList.js.map +1 -1
  451. package/lib/components/Menu/helpers.d.ts +13 -12
  452. package/lib/components/Menu/helpers.d.ts.map +1 -1
  453. package/lib/components/Menu/helpers.js +40 -36
  454. package/lib/components/Menu/helpers.js.map +1 -1
  455. package/lib/components/Menu/index.d.ts +2 -3
  456. package/lib/components/Menu/index.d.ts.map +1 -1
  457. package/lib/components/Menu/index.js +1 -2
  458. package/lib/components/Menu/index.js.map +1 -1
  459. package/lib/components/MenuButton/MenuButton.d.ts +3 -1
  460. package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
  461. package/lib/components/MenuButton/MenuButton.js +13 -14
  462. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  463. package/lib/components/MetaList/MetaList.d.ts +13 -4
  464. package/lib/components/MetaList/MetaList.d.ts.map +1 -1
  465. package/lib/components/MetaList/MetaList.js +34 -20
  466. package/lib/components/MetaList/MetaList.js.map +1 -1
  467. package/lib/components/Modal/Contexts.d.ts.map +1 -1
  468. package/lib/components/Modal/Contexts.js +3 -0
  469. package/lib/components/Modal/Contexts.js.map +1 -1
  470. package/lib/components/Modal/DockedModals.d.ts.map +1 -1
  471. package/lib/components/Modal/DockedModals.js +5 -4
  472. package/lib/components/Modal/DockedModals.js.map +1 -1
  473. package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
  474. package/lib/components/Modal/MinimizedModal.js +53 -38
  475. package/lib/components/Modal/MinimizedModal.js.map +1 -1
  476. package/lib/components/Modal/Modal.d.ts +1 -6
  477. package/lib/components/Modal/Modal.d.ts.map +1 -1
  478. package/lib/components/Modal/Modal.js +82 -134
  479. package/lib/components/Modal/Modal.js.map +1 -1
  480. package/lib/components/Modal/Modal.styles.d.ts +9 -0
  481. package/lib/components/Modal/Modal.styles.d.ts.map +1 -0
  482. package/lib/components/Modal/Modal.styles.js +135 -0
  483. package/lib/components/Modal/Modal.styles.js.map +1 -0
  484. package/lib/components/Modal/Modal.types.d.ts +56 -5
  485. package/lib/components/Modal/Modal.types.d.ts.map +1 -1
  486. package/lib/components/Modal/Modal.types.js.map +1 -1
  487. package/lib/components/Modal/ModalManager.d.ts.map +1 -1
  488. package/lib/components/Modal/ModalManager.js +74 -65
  489. package/lib/components/Modal/ModalManager.js.map +1 -1
  490. package/lib/components/MultiStep/MultiStep.d.ts.map +1 -1
  491. package/lib/components/MultiStep/MultiStep.js +10 -12
  492. package/lib/components/MultiStep/MultiStep.js.map +1 -1
  493. package/lib/components/MultiStep/MultiStep.styles.js +1 -1
  494. package/lib/components/MultiStep/MultiStep.styles.js.map +1 -1
  495. package/lib/components/MultiStep/MultiStep.types.d.ts +4 -2
  496. package/lib/components/MultiStep/MultiStep.types.d.ts.map +1 -1
  497. package/lib/components/MultiStep/MultiStep.types.js.map +1 -1
  498. package/lib/components/Number/NumberDisplay.d.ts +2 -2
  499. package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
  500. package/lib/components/Number/NumberDisplay.js +1 -1
  501. package/lib/components/Number/NumberDisplay.js.map +1 -1
  502. package/lib/components/Number/NumberInput.d.ts.map +1 -1
  503. package/lib/components/Number/NumberInput.js +18 -25
  504. package/lib/components/Number/NumberInput.js.map +1 -1
  505. package/lib/components/Number/NumberInput.styles.d.ts +2 -2
  506. package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
  507. package/lib/components/Number/NumberInput.types.d.ts +2 -2
  508. package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
  509. package/lib/components/Number/NumberInput.types.js.map +1 -1
  510. package/lib/components/Number/utils.js +2 -3
  511. package/lib/components/Number/utils.js.map +1 -1
  512. package/lib/components/PageTemplates/CategorySubPage.d.ts +1 -1
  513. package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
  514. package/lib/components/PageTemplates/CategorySubPage.js +8 -18
  515. package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
  516. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +1 -1
  517. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
  518. package/lib/components/PageTemplates/DashboardPage.d.ts +7 -1
  519. package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
  520. package/lib/components/PageTemplates/DashboardPage.js +48 -28
  521. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  522. package/lib/components/PageTemplates/PageTemplates.d.ts +15 -6
  523. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  524. package/lib/components/PageTemplates/PageTemplates.js +89 -79
  525. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  526. package/lib/components/PageTemplates/index.d.ts +3 -0
  527. package/lib/components/PageTemplates/index.d.ts.map +1 -1
  528. package/lib/components/PageTemplates/index.js +1 -0
  529. package/lib/components/PageTemplates/index.js.map +1 -1
  530. package/lib/components/Pagination/Pagination.d.ts +2 -2
  531. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  532. package/lib/components/Pagination/Pagination.js +7 -6
  533. package/lib/components/Pagination/Pagination.js.map +1 -1
  534. package/lib/components/Paragraph/ParagraphDisplay.d.ts +11 -0
  535. package/lib/components/Paragraph/ParagraphDisplay.d.ts.map +1 -0
  536. package/lib/components/Paragraph/ParagraphDisplay.js +11 -0
  537. package/lib/components/Paragraph/ParagraphDisplay.js.map +1 -0
  538. package/lib/components/Paragraph/index.d.ts +3 -0
  539. package/lib/components/Paragraph/index.d.ts.map +1 -0
  540. package/lib/components/Paragraph/index.js +2 -0
  541. package/lib/components/Paragraph/index.js.map +1 -0
  542. package/lib/components/Phone/PhoneDisplay.d.ts +2 -2
  543. package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
  544. package/lib/components/Phone/PhoneDisplay.js +2 -3
  545. package/lib/components/Phone/PhoneDisplay.js.map +1 -1
  546. package/lib/components/Phone/PhoneInput.d.ts +2 -2
  547. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  548. package/lib/components/Phone/PhoneInput.js +18 -17
  549. package/lib/components/Phone/PhoneInput.js.map +1 -1
  550. package/lib/components/Phone/utils.js +2 -3
  551. package/lib/components/Phone/utils.js.map +1 -1
  552. package/lib/components/Popover/Popover.d.ts +0 -4
  553. package/lib/components/Popover/Popover.d.ts.map +1 -1
  554. package/lib/components/Popover/Popover.js +11 -122
  555. package/lib/components/Popover/Popover.js.map +1 -1
  556. package/lib/components/Popover/Popover.styles.d.ts +5 -0
  557. package/lib/components/Popover/Popover.styles.d.ts.map +1 -0
  558. package/lib/components/Popover/Popover.styles.js +116 -0
  559. package/lib/components/Popover/Popover.styles.js.map +1 -0
  560. package/lib/components/Popover/PopoverManager.js +2 -2
  561. package/lib/components/Popover/PopoverManager.js.map +1 -1
  562. package/lib/components/Popover/index.d.ts +1 -1
  563. package/lib/components/Popover/index.d.ts.map +1 -1
  564. package/lib/components/Popover/index.js +1 -1
  565. package/lib/components/Popover/index.js.map +1 -1
  566. package/lib/components/Progress/Bar.js +2 -2
  567. package/lib/components/Progress/Bar.js.map +1 -1
  568. package/lib/components/Progress/Ellipsis.d.ts +1 -1
  569. package/lib/components/Progress/Ellipsis.d.ts.map +1 -1
  570. package/lib/components/Progress/Ellipsis.js +48 -50
  571. package/lib/components/Progress/Ellipsis.js.map +1 -1
  572. package/lib/components/Progress/Progress.js +3 -4
  573. package/lib/components/Progress/Progress.js.map +1 -1
  574. package/lib/components/Progress/Progress.types.d.ts +2 -2
  575. package/lib/components/Progress/Progress.types.d.ts.map +1 -1
  576. package/lib/components/Progress/Progress.types.js.map +1 -1
  577. package/lib/components/Progress/Ring.d.ts +1 -1
  578. package/lib/components/Progress/Ring.d.ts.map +1 -1
  579. package/lib/components/Progress/Ring.js +40 -40
  580. package/lib/components/Progress/Ring.js.map +1 -1
  581. package/lib/components/RadioButton/RadioButton.d.ts +2 -2
  582. package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
  583. package/lib/components/RadioButton/RadioButton.js +1 -1
  584. package/lib/components/RadioButton/RadioButton.js.map +1 -1
  585. package/lib/components/RadioCheck/RadioCheck.d.ts +2 -2
  586. package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
  587. package/lib/components/RadioCheck/RadioCheck.js +7 -8
  588. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  589. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +4 -0
  590. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
  591. package/lib/components/RadioCheckGroup/RadioCheckGroup.js +19 -18
  592. package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
  593. package/lib/components/Rating/Rating.d.ts +2 -2
  594. package/lib/components/Rating/Rating.d.ts.map +1 -1
  595. package/lib/components/Rating/Rating.js +6 -7
  596. package/lib/components/Rating/Rating.js.map +1 -1
  597. package/lib/components/SearchInput/SearchInput.d.ts +4 -4
  598. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  599. package/lib/components/SearchInput/SearchInput.js +14 -14
  600. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  601. package/lib/components/Select/Option.js +1 -1
  602. package/lib/components/Select/Option.js.map +1 -1
  603. package/lib/components/Select/Select.d.ts.map +1 -1
  604. package/lib/components/Select/Select.js +15 -16
  605. package/lib/components/Select/Select.js.map +1 -1
  606. package/lib/components/Sentiment/Sentiment.d.ts +2 -2
  607. package/lib/components/Sentiment/Sentiment.d.ts.map +1 -1
  608. package/lib/components/Sentiment/Sentiment.js +1 -2
  609. package/lib/components/Sentiment/Sentiment.js.map +1 -1
  610. package/lib/components/Skeleton/LineSkeleton.js +1 -1
  611. package/lib/components/Skeleton/LineSkeleton.js.map +1 -1
  612. package/lib/components/Skeleton/ParagraphSkeleton.js +1 -1
  613. package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
  614. package/lib/components/Skeleton/RectangleSkeleton.js +1 -1
  615. package/lib/components/Skeleton/RectangleSkeleton.js.map +1 -1
  616. package/lib/components/Slider/Slider.d.ts.map +1 -1
  617. package/lib/components/Slider/Slider.js +12 -19
  618. package/lib/components/Slider/Slider.js.map +1 -1
  619. package/lib/components/Slider/Slider.styles.d.ts +4 -1
  620. package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
  621. package/lib/components/Slider/Slider.styles.js +17 -5
  622. package/lib/components/Slider/Slider.styles.js.map +1 -1
  623. package/lib/components/Slider/Slider.types.d.ts +2 -2
  624. package/lib/components/Slider/Slider.types.d.ts.map +1 -1
  625. package/lib/components/Slider/Slider.types.js.map +1 -1
  626. package/lib/components/Slider/SliderTicks.d.ts +1 -0
  627. package/lib/components/Slider/SliderTicks.d.ts.map +1 -1
  628. package/lib/components/Slider/SliderTicks.js +19 -12
  629. package/lib/components/Slider/SliderTicks.js.map +1 -1
  630. package/lib/components/Slider/utils.d.ts +10 -11
  631. package/lib/components/Slider/utils.d.ts.map +1 -1
  632. package/lib/components/Slider/utils.js +24 -18
  633. package/lib/components/Slider/utils.js.map +1 -1
  634. package/lib/components/SummaryItem/SummaryItem.d.ts +5 -5
  635. package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
  636. package/lib/components/SummaryItem/SummaryItem.js +3 -5
  637. package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
  638. package/lib/components/SummaryList/SummaryList.d.ts +8 -2
  639. package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
  640. package/lib/components/SummaryList/SummaryList.js +10 -11
  641. package/lib/components/SummaryList/SummaryList.js.map +1 -1
  642. package/lib/components/SummaryList/ViewAll.d.ts +1 -1
  643. package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
  644. package/lib/components/SummaryList/ViewAll.js +14 -10
  645. package/lib/components/SummaryList/ViewAll.js.map +1 -1
  646. package/lib/components/Switch/Switch.d.ts +2 -2
  647. package/lib/components/Switch/Switch.d.ts.map +1 -1
  648. package/lib/components/Switch/Switch.js +41 -30
  649. package/lib/components/Switch/Switch.js.map +1 -1
  650. package/lib/components/Table/Table.d.ts +2 -2
  651. package/lib/components/Table/Table.d.ts.map +1 -1
  652. package/lib/components/Table/Table.js +14 -13
  653. package/lib/components/Table/Table.js.map +1 -1
  654. package/lib/components/Tabs/Tab.d.ts +1 -1
  655. package/lib/components/Tabs/Tab.d.ts.map +1 -1
  656. package/lib/components/Tabs/Tab.js +9 -7
  657. package/lib/components/Tabs/Tab.js.map +1 -1
  658. package/lib/components/Tabs/TabPanel.d.ts +10 -2
  659. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  660. package/lib/components/Tabs/TabPanel.js +24 -8
  661. package/lib/components/Tabs/TabPanel.js.map +1 -1
  662. package/lib/components/Tabs/Tabs.d.ts +1 -0
  663. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  664. package/lib/components/Tabs/Tabs.js +22 -18
  665. package/lib/components/Tabs/Tabs.js.map +1 -1
  666. package/lib/components/Tabs/Tabs.types.d.ts +2 -2
  667. package/lib/components/Tabs/Tabs.types.d.ts.map +1 -1
  668. package/lib/components/Tabs/Tabs.types.js.map +1 -1
  669. package/lib/components/Text/Text.d.ts +1 -1
  670. package/lib/components/Text/Text.d.ts.map +1 -1
  671. package/lib/components/Text/Text.js +2 -2
  672. package/lib/components/Text/Text.js.map +1 -1
  673. package/lib/components/TextArea/TextArea.d.ts +2 -2
  674. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  675. package/lib/components/TextArea/TextArea.js +31 -30
  676. package/lib/components/TextArea/TextArea.js.map +1 -1
  677. package/lib/components/Toaster/Toaster.d.ts +8 -36
  678. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  679. package/lib/components/Toaster/Toaster.js +97 -102
  680. package/lib/components/Toaster/Toaster.js.map +1 -1
  681. package/lib/components/Tooltip/Tooltip.d.ts +6 -1
  682. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  683. package/lib/components/Tooltip/Tooltip.js +6 -13
  684. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  685. package/lib/components/Tree/StandardTree.d.ts +6 -0
  686. package/lib/components/Tree/StandardTree.d.ts.map +1 -0
  687. package/lib/components/Tree/StandardTree.js +175 -0
  688. package/lib/components/Tree/StandardTree.js.map +1 -0
  689. package/lib/components/Tree/StandardTree.styles.d.ts +13 -0
  690. package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -0
  691. package/lib/components/Tree/StandardTree.styles.js +155 -0
  692. package/lib/components/Tree/StandardTree.styles.js.map +1 -0
  693. package/lib/components/Tree/StandardTree.types.d.ts +25 -0
  694. package/lib/components/Tree/StandardTree.types.d.ts.map +1 -0
  695. package/lib/components/Tree/StandardTree.types.js +2 -0
  696. package/lib/components/Tree/StandardTree.types.js.map +1 -0
  697. package/lib/components/Tree/Tree.d.ts +35 -49
  698. package/lib/components/Tree/Tree.d.ts.map +1 -1
  699. package/lib/components/Tree/Tree.js +18 -56
  700. package/lib/components/Tree/Tree.js.map +1 -1
  701. package/lib/components/Tree/helpers.d.ts +19 -0
  702. package/lib/components/Tree/helpers.d.ts.map +1 -0
  703. package/lib/components/Tree/helpers.js +180 -0
  704. package/lib/components/Tree/helpers.js.map +1 -0
  705. package/lib/components/Tree/index.d.ts +4 -2
  706. package/lib/components/Tree/index.d.ts.map +1 -1
  707. package/lib/components/Tree/index.js +3 -1
  708. package/lib/components/Tree/index.js.map +1 -1
  709. package/lib/components/URL/URLDisplay.d.ts +2 -2
  710. package/lib/components/URL/URLDisplay.d.ts.map +1 -1
  711. package/lib/components/URL/URLDisplay.js +2 -2
  712. package/lib/components/URL/URLDisplay.js.map +1 -1
  713. package/lib/hooks/index.d.ts +7 -4
  714. package/lib/hooks/index.d.ts.map +1 -1
  715. package/lib/hooks/index.js +7 -3
  716. package/lib/hooks/index.js.map +1 -1
  717. package/lib/hooks/useActiveDescendant.d.ts +17 -3
  718. package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
  719. package/lib/hooks/useActiveDescendant.js +86 -64
  720. package/lib/hooks/useActiveDescendant.js.map +1 -1
  721. package/lib/hooks/useAutoResize.d.ts.map +1 -1
  722. package/lib/hooks/useAutoResize.js +6 -7
  723. package/lib/hooks/useAutoResize.js.map +1 -1
  724. package/lib/hooks/useBreakpoint.js +2 -4
  725. package/lib/hooks/useBreakpoint.js.map +1 -1
  726. package/lib/hooks/useDraggable.d.ts +8 -0
  727. package/lib/hooks/useDraggable.d.ts.map +1 -0
  728. package/lib/hooks/useDraggable.js +64 -0
  729. package/lib/hooks/useDraggable.js.map +1 -0
  730. package/lib/hooks/useFocusWithin.d.ts +1 -1
  731. package/lib/hooks/useFocusWithin.d.ts.map +1 -1
  732. package/lib/hooks/useFocusWithin.js +29 -24
  733. package/lib/hooks/useFocusWithin.js.map +1 -1
  734. package/lib/hooks/useI18n.d.ts +505 -170
  735. package/lib/hooks/useI18n.d.ts.map +1 -1
  736. package/lib/hooks/useI18n.js +2 -2
  737. package/lib/hooks/useI18n.js.map +1 -1
  738. package/lib/hooks/useLongPress.d.ts +16 -0
  739. package/lib/hooks/useLongPress.d.ts.map +1 -0
  740. package/lib/hooks/useLongPress.js +59 -0
  741. package/lib/hooks/useLongPress.js.map +1 -0
  742. package/lib/hooks/useOuterEvent.js +1 -1
  743. package/lib/hooks/useOuterEvent.js.map +1 -1
  744. package/lib/hooks/useOverride.js +1 -1
  745. package/lib/hooks/useOverride.js.map +1 -1
  746. package/lib/hooks/useScrollStick.js +14 -3
  747. package/lib/hooks/useScrollStick.js.map +1 -1
  748. package/lib/hooks/useScrollToggle.d.ts +6 -0
  749. package/lib/hooks/useScrollToggle.d.ts.map +1 -0
  750. package/lib/hooks/useScrollToggle.js +40 -0
  751. package/lib/hooks/useScrollToggle.js.map +1 -0
  752. package/lib/hooks/useTransitionState.d.ts +39 -0
  753. package/lib/hooks/useTransitionState.d.ts.map +1 -0
  754. package/lib/hooks/useTransitionState.js +56 -0
  755. package/lib/hooks/useTransitionState.js.map +1 -0
  756. package/lib/i18n/default.d.ts +583 -0
  757. package/lib/i18n/default.d.ts.map +1 -0
  758. package/lib/i18n/default.js +627 -0
  759. package/lib/i18n/default.js.map +1 -0
  760. package/lib/i18n/i18n.d.ts +988 -318
  761. package/lib/i18n/i18n.d.ts.map +1 -1
  762. package/lib/i18n/i18n.js +1 -1
  763. package/lib/i18n/i18n.js.map +1 -1
  764. package/lib/i18n/index.d.ts +1 -0
  765. package/lib/i18n/index.d.ts.map +1 -1
  766. package/lib/i18n/index.js.map +1 -1
  767. package/lib/i18n/translate.d.ts +29 -4
  768. package/lib/i18n/translate.d.ts.map +1 -1
  769. package/lib/i18n/translate.js +21 -8
  770. package/lib/i18n/translate.js.map +1 -1
  771. package/lib/index.d.ts +8 -2
  772. package/lib/index.d.ts.map +1 -1
  773. package/lib/index.js +8 -2
  774. package/lib/index.js.map +1 -1
  775. package/lib/styles/GlobalStyle.d.ts.map +1 -1
  776. package/lib/styles/GlobalStyle.js +2 -26
  777. package/lib/styles/GlobalStyle.js.map +1 -1
  778. package/lib/theme/ThemeMachine.js +7 -1
  779. package/lib/theme/ThemeMachine.js.map +1 -1
  780. package/lib/theme/index.d.ts +1 -0
  781. package/lib/theme/index.d.ts.map +1 -1
  782. package/lib/theme/index.js +1 -0
  783. package/lib/theme/index.js.map +1 -1
  784. package/lib/theme/theme.d.ts +83 -53
  785. package/lib/theme/theme.d.ts.map +1 -1
  786. package/lib/theme/themeDefinition.json +50 -30
  787. package/lib/theme/themeOverrides.schema.json +24 -3
  788. package/lib/theme/themes/buildTheme.json +3 -39
  789. package/lib/theme/themes/darkTheme.json +6 -0
  790. package/lib/theme/themes/legacyBuildTheme.json +50 -0
  791. package/lib/types/types.d.ts +6 -1
  792. package/lib/types/types.d.ts.map +1 -1
  793. package/lib/types/types.js.map +1 -1
  794. package/lib/utils/utils.d.ts +41 -4
  795. package/lib/utils/utils.d.ts.map +1 -1
  796. package/lib/utils/utils.js +55 -9
  797. package/lib/utils/utils.js.map +1 -1
  798. package/package.json +10 -11
  799. package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts +0 -3
  800. package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts.map +0 -1
  801. package/lib/components/DateTime/Input/useButtonAriaLabel.js +0 -33
  802. package/lib/components/DateTime/Input/useButtonAriaLabel.js.map +0 -1
  803. package/lib/components/NoItems/NoItems.d.ts +0 -14
  804. package/lib/components/NoItems/NoItems.d.ts.map +0 -1
  805. package/lib/components/NoItems/NoItems.js.map +0 -1
  806. package/lib/components/NoItems/index.d.ts +0 -4
  807. package/lib/components/NoItems/index.d.ts.map +0 -1
  808. package/lib/components/NoItems/index.js +0 -3
  809. package/lib/components/NoItems/index.js.map +0 -1
  810. package/lib/i18n/default.json +0 -246
@@ -10,6 +10,10 @@ const StyledSingleInput = styled.div(props => {
10
10
  return css `
11
11
  height: ${height};
12
12
 
13
+ @media (pointer: coarse) {
14
+ min-height: ${base['hit-area']['finger-min']};
15
+ }
16
+
13
17
  &:focus-within {
14
18
  border-color: ${formControl[':focus']['border-color']};
15
19
  box-shadow: ${formControl[':focus']['box-shadow']};
@@ -21,6 +25,7 @@ const StyledSingleInput = styled.div(props => {
21
25
 
22
26
  input {
23
27
  min-width: 0;
28
+ width: 100%;
24
29
  color: ${formControl['foreground-color']};
25
30
  text-overflow: ellipsis;
26
31
  margin-inline-start: ${base.spacing};
@@ -48,19 +53,18 @@ const StyledSingleInput = styled.div(props => {
48
53
  StyledSingleInput.defaultProps = defaultThemeProp;
49
54
  const SingleSelectInput = forwardRef((props, ref) => {
50
55
  const { value, readOnly, disabled, status, actions, onChange, selected, ...restProps } = props;
51
- return (_jsxs(Flex, Object.assign({ as: StyledSingleInput, forwardedAs: StyledFormControl, container: { alignItems: 'center', wrap: 'nowrap' } }, {
52
- disabled,
53
- status,
54
- readOnly
55
- }, { children: [_jsx("input", Object.assign({}, {
56
- ref,
57
- disabled,
58
- status,
59
- readOnly
60
- }, { value: value || (selected === null || selected === void 0 ? void 0 : selected.text) || '',
56
+ return (_jsxs(Flex, { as: StyledSingleInput, forwardedAs: StyledFormControl, container: { alignItems: 'center', wrap: 'nowrap' }, ...{
57
+ disabled,
58
+ status,
59
+ readOnly
60
+ }, children: [_jsx("input", { ...{
61
+ ref,
62
+ disabled,
63
+ status,
64
+ readOnly
65
+ }, value: value || selected?.text || '',
61
66
  // no-op avoids react uncontrolled warning
62
- onChange: onChange || (() => { }), readOnly: readOnly || !onChange, autoComplete: 'off' }, restProps), void 0),
63
- actions] }), void 0));
67
+ onChange: onChange || (() => { }), readOnly: readOnly || !onChange, autoComplete: 'off', ...restProps }, void 0), actions] }, void 0));
64
68
  });
65
69
  export default SingleSelectInput;
66
70
  //# sourceMappingURL=SingleSelectInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SingleSelectInput.js","sourceRoot":"","sources":["../../../../src/components/ComboBox/SingleSelectInput/SingleSelectInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,O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AAW,EAAE,iBAAiB,EAC9B,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAC/C;QACF,QAAQ;QACR,MAAM;QACN,QAAQ;KACT,eAED,gCACM;gBACF,GAAG;gBACH,QAAQ;gBACR,MAAM;gBACN,QAAQ;aACT,IACD,KAAK,EAAE,KAAK,KAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAA,IAAI,EAAE;gBACpC,0CAA0C;gBAC1C,QAAQ,EAAE,QAAQ,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,EAChC,QAAQ,EAAE,QAAQ,IAAI,CAAC,QAAQ,EAC/B,YAAY,EAAC,KAAK,IACd,SAAS,UACb;YACD,OAAO,aACH,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { StyledFormControl } from '../../FormControl';\nimport { defaultThemeProp } from '../../../theme';\nimport Flex from '../../Flex';\nimport { ForwardProps } from '../../../types';\nimport { StyledButton } from '../../Button';\n\nimport SingleSelectInputProps from './SingleSelectInput.types';\n\nconst StyledSingleInput = styled.div(props => {\n const {\n theme: {\n base,\n components: {\n 'form-control': formControl,\n input: { height }\n }\n }\n } = props;\n\n return css`\n height: ${height};\n\n &:focus-within {\n border-color: ${formControl[':focus']['border-color']};\n box-shadow: ${formControl[':focus']['box-shadow']};\n }\n\n &:hover:not([readonly]):not([disabled]):focus-within {\n border-color: transparent;\n }\n\n input {\n min-width: 0;\n color: ${formControl['foreground-color']};\n text-overflow: ellipsis;\n margin-inline-start: ${base.spacing};\n }\n\n input,\n input:focus {\n border: none;\n outline: none;\n flex-grow: 1;\n background-color: transparent;\n\n &:read-only {\n cursor: default;\n }\n }\n\n > ${StyledButton} {\n border-radius: calc(${base['border-radius']} * ${formControl['border-radius']});\n min-height: calc(${height} - 2 * ${formControl['border-width']});\n height: calc(${height} - 2 * ${formControl['border-width']});\n }\n `;\n});\n\nStyledSingleInput.defaultProps = defaultThemeProp;\n\nconst SingleSelectInput: FunctionComponent<SingleSelectInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<SingleSelectInputProps>, ref: Ref<HTMLInputElement>) => {\n const { value, readOnly, disabled, status, actions, onChange, selected, ...restProps } = props;\n\n return (\n <Flex\n as={StyledSingleInput}\n forwardedAs={StyledFormControl}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n {...{\n disabled,\n status,\n readOnly\n }}\n >\n <input\n {...{\n ref,\n disabled,\n status,\n readOnly\n }}\n value={value || selected?.text || ''}\n // no-op avoids react uncontrolled warning\n onChange={onChange || (() => {})}\n readOnly={readOnly || !onChange}\n autoComplete='off'\n {...restProps}\n />\n {actions}\n </Flex>\n );\n }\n);\n\nexport default SingleSelectInput;\n"]}
1
+ {"version":3,"file":"SingleSelectInput.js","sourceRoot":"","sources":["../../../../src/components/ComboBox/SingleSelectInput/SingleSelectInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI5C,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IAC3C,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EACJ,UAAU,EAAE,EACV,cAAc,EAAE,WAAW,EAC3B,KAAK,EAAE,EAAE,MAAM,EAAE,EAClB,EACF,EACF,GAAG,KAAK,CAAC;IAEV,OAAO,GAAG,C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S,WACb,EACD,OAAO,YACH,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { StyledFormControl } from '../../FormControl';\nimport { defaultThemeProp } from '../../../theme';\nimport Flex from '../../Flex';\nimport { ForwardProps } from '../../../types';\nimport { StyledButton } from '../../Button';\n\nimport SingleSelectInputProps from './SingleSelectInput.types';\n\nconst StyledSingleInput = styled.div(props => {\n const {\n theme: {\n base,\n components: {\n 'form-control': formControl,\n input: { height }\n }\n }\n } = props;\n\n return css`\n height: ${height};\n\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n\n &:focus-within {\n border-color: ${formControl[':focus']['border-color']};\n box-shadow: ${formControl[':focus']['box-shadow']};\n }\n\n &:hover:not([readonly]):not([disabled]):focus-within {\n border-color: transparent;\n }\n\n input {\n min-width: 0;\n width: 100%;\n color: ${formControl['foreground-color']};\n text-overflow: ellipsis;\n margin-inline-start: ${base.spacing};\n }\n\n input,\n input:focus {\n border: none;\n outline: none;\n flex-grow: 1;\n background-color: transparent;\n\n &:read-only {\n cursor: default;\n }\n }\n\n > ${StyledButton} {\n border-radius: calc(${base['border-radius']} * ${formControl['border-radius']});\n min-height: calc(${height} - 2 * ${formControl['border-width']});\n height: calc(${height} - 2 * ${formControl['border-width']});\n }\n `;\n});\n\nStyledSingleInput.defaultProps = defaultThemeProp;\n\nconst SingleSelectInput: FunctionComponent<SingleSelectInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<SingleSelectInputProps>, ref: Ref<HTMLInputElement>) => {\n const { value, readOnly, disabled, status, actions, onChange, selected, ...restProps } = props;\n\n return (\n <Flex\n as={StyledSingleInput}\n forwardedAs={StyledFormControl}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n {...{\n disabled,\n status,\n readOnly\n }}\n >\n <input\n {...{\n ref,\n disabled,\n status,\n readOnly\n }}\n value={value || selected?.text || ''}\n // no-op avoids react uncontrolled warning\n onChange={onChange || (() => {})}\n readOnly={readOnly || !onChange}\n autoComplete='off'\n {...restProps}\n />\n {actions}\n </Flex>\n );\n }\n);\n\nexport default SingleSelectInput;\n"]}
@@ -25,35 +25,33 @@ if (windowIsAvailable) {
25
25
  if (!window[metaKey]) {
26
26
  window[metaKey] = [];
27
27
  }
28
- window[metaKey].push({ version: '2.0.0-dev.9.2' });
28
+ window[metaKey].push({ version: '2.0.0-rc.2' });
29
29
  }
30
30
  const Configuration = ({ context = ConfigurationContext, children, locale, direction, translations: customTranslations, theme, disableDefaultFontLoading, styleSheetTarget, portalTarget, overrideMap, renderNativeControls }) => {
31
31
  const ctx = useContext(context);
32
32
  const themeMachine = theme
33
33
  ? new ThemeMachine({ theme, parent: ctx.themeMachine })
34
34
  : ctx.themeMachine;
35
- const translations = useMemo(() => createTranslationPack(customTranslations), [customTranslations]);
35
+ const translations = useMemo(() => createTranslationPack({ ...ctx.translations, ...customTranslations }), [ctx.translations, customTranslations]);
36
36
  const [mounted, setMounted] = useState(false);
37
37
  useEffect(() => {
38
38
  setMounted(true);
39
39
  }, []);
40
- const wrappedChildren = ctx[initializedKey] ? (children) : (_jsx(StyleSheetManager, Object.assign({ disableVendorPrefixes: true, target: styleSheetTarget !== null && styleSheetTarget !== void 0 ? styleSheetTarget : ctx.styleSheetTarget }, { children: _jsxs(_Fragment, { children: [!disableDefaultFontLoading &&
40
+ const wrappedChildren = ctx[initializedKey] ? (children) : (_jsx(StyleSheetManager, { disableVendorPrefixes: true, target: styleSheetTarget ?? ctx.styleSheetTarget, children: _jsxs(_Fragment, { children: [!disableDefaultFontLoading &&
41
41
  mounted &&
42
42
  documentIsAvailable &&
43
- createPortal(_jsx("link", { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap' }, void 0), document.head),
44
- _jsx(GlobalStyle, {}, void 0),
45
- children] }, void 0) }), void 0));
46
- return (_jsx(ConfigurationContext.Provider, Object.assign({ value: {
47
- locale: locale !== null && locale !== void 0 ? locale : ctx.locale,
48
- direction: direction !== null && direction !== void 0 ? direction : (locale !== undefined ? directionOfLocale(locale) : ctx.direction),
43
+ createPortal(_jsx("link", { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap' }, void 0), document.head), _jsx(GlobalStyle, {}, void 0), children] }, void 0) }, void 0));
44
+ return (_jsx(ConfigurationContext.Provider, { value: {
45
+ locale: locale ?? ctx.locale,
46
+ direction: direction ?? (locale !== undefined ? directionOfLocale(locale) : ctx.direction),
49
47
  translations,
50
48
  themeMachine,
51
49
  [initializedKey]: true,
52
- styleSheetTarget: styleSheetTarget !== null && styleSheetTarget !== void 0 ? styleSheetTarget : ctx.styleSheetTarget,
53
- portalTarget: portalTarget !== null && portalTarget !== void 0 ? portalTarget : ctx.portalTarget,
50
+ styleSheetTarget: styleSheetTarget ?? ctx.styleSheetTarget,
51
+ portalTarget: portalTarget ?? ctx.portalTarget,
54
52
  overrideMap: overrideMap ? { ...ctx.overrideMap, ...overrideMap } : ctx.overrideMap,
55
- renderNativeControls: renderNativeControls !== null && renderNativeControls !== void 0 ? renderNativeControls : ctx.renderNativeControls
56
- } }, { children: _jsx(ThemeProvider, Object.assign({ theme: themeMachine.theme }, { children: wrappedChildren }), void 0) }), void 0));
53
+ renderNativeControls: renderNativeControls ?? ctx.renderNativeControls
54
+ }, children: _jsx(ThemeProvider, { theme: themeMachine.theme, children: wrappedChildren }, void 0) }, void 0));
57
55
  };
58
56
  Configuration.defaultProps = defaultProps;
59
57
  export default Configuration;
@@ -1 +1 @@
1
- {"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../src/components/Configuration/Configuration.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,UAAU,EAIV,OAAO,EACP,QAAQ,EACR,S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,EAAC,+GAA+G,WACpH,EACF,QAAQ,CAAC,IAAI,CACd;gBACH,KAAC,WAAW,aAAG;gBACd,QAAQ,YACR,YACe,CACrB,CAAC;IACF,OAAO,CACL,KAAC,oBAAoB,CAAC,QAAQ,kBAC5B,KAAK,EAAE;YACL,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,GAAG,CAAC,MAAM;YAC5B,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC;YAC1F,YAAY;YACZ,YAAY;YACZ,CAAC,cAAc,CAAC,EAAE,IAAI;YACtB,gBAAgB,EAAE,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,GAAG,CAAC,gBAAgB;YAC1D,YAAY,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,GAAG,CAAC,YAAY;YAC9C,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,WAAW,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW;YACnF,oBAAoB,EAAE,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,GAAG,CAAC,oBAAoB;SACvE,gBAED,KAAC,aAAa,kBAAC,KAAK,EAAE,YAAY,CAAC,KAAK,gBAAG,eAAe,YAAiB,YAC7C,CACjC,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG,YAAY,CAAC;AAE1C,eAAe,aAAa,CAAC","sourcesContent":["import {\n createContext,\n useContext,\n FunctionComponent,\n ComponentType,\n ReactNode,\n useMemo,\n useState,\n useEffect,\n Context\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { ThemeProvider, StyleSheetManager } from 'styled-components';\n\nimport { GlobalStyle } from '../../styles';\nimport {\n ThemeMachine,\n BaseThemeMachine,\n DefaultSettableTheme,\n DefaultThemeDefinition\n} from '../../theme';\nimport {\n createTranslationPack,\n Translation,\n TranslationPack,\n DefaultTranslation,\n direction as directionOfLocale\n} from '../../i18n';\nimport { FileInputProps } from '../File';\nimport { windowIsAvailable, navigatorIsAvailable, documentIsAvailable } from '../../utils';\n\nexport interface ConfigurationProps {\n /**\n * Any components or nodes that should be impacted by the settings applied by this Configuration component.\n */\n children: ReactNode;\n /**\n * Context to read previous configuration values from.\n */\n context?: Context<ConfigurationContextValue>;\n /**\n * User locale as defined in [BCP-47](https://www.techonthenet.com/js/language_tags.php).\n */\n locale?: string;\n /**\n * Override rendering direction of the document. Direction will be based on the locale if now provided.\n */\n direction?: 'ltr' | 'rtl';\n /**\n * Object with (partial) translations.\n */\n translations?: Translation;\n /**\n * Theme object used to override any or all Cosmos theme properties.\n */\n theme?: DefaultSettableTheme;\n /**\n * Disables loading Open Sans from Google Fonts. Only takes effect on the root configuration.\n */\n disableDefaultFontLoading?: boolean;\n /**\n * Target element for loading styles related to `styled-components`.\n */\n styleSheetTarget?: HTMLElement;\n /**\n * Target element for rendering a `ReactDOM` portal.\n */\n portalTarget?: Element;\n /**\n * Override map to replace Cosmos components.\n */\n overrideMap?: {\n FileInput?: ComponentType<FileInputProps>;\n };\n /**\n * Use native HTML5 controls for inputs instead of rich ones.\n * @default false\n */\n renderNativeControls?: boolean;\n}\n\nconst initializedKey = Symbol.for('@pega/cosmos-react-core.configuration.initialized');\n\nexport interface ConfigurationContextValue {\n [initializedKey]: boolean;\n locale: string;\n direction: ConfigurationProps['direction'];\n translations: TranslationPack;\n themeMachine: ThemeMachine<DefaultThemeDefinition>;\n styleSheetTarget?: HTMLElement;\n portalTarget?: Element;\n overrideMap: NonNullable<ConfigurationProps['overrideMap']>;\n renderNativeControls: boolean;\n}\n\nconst defaultProps: Partial<ConfigurationProps> = {};\nconst defaultLocale = navigatorIsAvailable ? navigator.language : 'en';\n\nexport const ConfigurationContext = createContext<ConfigurationContextValue>({\n [initializedKey]: false,\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 overrideMap: {},\n renderNativeControls: false\n});\n\nconst metaKey = Symbol.for('@pega/cosmos-react-core.metadata');\n\ninterface CosmosMetadata {\n version: string;\n}\n\ndeclare global {\n interface Window {\n [metaKey]: CosmosMetadata[];\n }\n}\n\nif (windowIsAvailable) {\n if (!window[metaKey]) {\n window[metaKey] = [];\n }\n\n window[metaKey].push({ version: '2.0.0-dev.9.2' });\n}\n\nconst Configuration: FunctionComponent<ConfigurationProps> = ({\n context = ConfigurationContext,\n children,\n locale,\n direction,\n translations: customTranslations,\n theme,\n disableDefaultFontLoading,\n styleSheetTarget,\n portalTarget,\n overrideMap,\n renderNativeControls\n}: ConfigurationProps) => {\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(customTranslations),\n [customTranslations]\n );\n\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n const wrappedChildren = ctx[initializedKey] ? (\n children\n ) : (\n <StyleSheetManager disableVendorPrefixes target={styleSheetTarget ?? ctx.styleSheetTarget}>\n <>\n {!disableDefaultFontLoading &&\n mounted &&\n documentIsAvailable &&\n createPortal(\n <link\n rel='stylesheet'\n href='https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap'\n />,\n document.head\n )}\n <GlobalStyle />\n {children}\n </>\n </StyleSheetManager>\n );\n return (\n <ConfigurationContext.Provider\n value={{\n locale: locale ?? ctx.locale,\n direction: direction ?? (locale !== undefined ? directionOfLocale(locale) : ctx.direction),\n translations,\n themeMachine,\n [initializedKey]: true,\n styleSheetTarget: styleSheetTarget ?? ctx.styleSheetTarget,\n portalTarget: portalTarget ?? ctx.portalTarget,\n overrideMap: overrideMap ? { ...ctx.overrideMap, ...overrideMap } : ctx.overrideMap,\n renderNativeControls: renderNativeControls ?? ctx.renderNativeControls\n }}\n >\n <ThemeProvider theme={themeMachine.theme}>{wrappedChildren}</ThemeProvider>\n </ConfigurationContext.Provider>\n );\n};\n\nConfiguration.defaultProps = defaultProps;\n\nexport default Configuration;\n"]}
1
+ {"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../src/components/Configuration/Configuration.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,UAAU,EAIV,OAAO,EACP,QAAQ,EACR,SAAS,EAEV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAGjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EAGrB,kBAAkB,EAClB,SAAS,IAAI,iBAAiB,EAC/B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAoD3F,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;AAcvF,MAAM,YAAY,GAAgC,EAAE,CAAC;AACrD,MAAM,aAAa,GAAG,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;AAEvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAA4B;IAC3E,CAAC,cAAc,CAAC,EAAE,KAAK;IACvB,MAAM,EAAE,aAAa;IACrB,SAAS,EAAE,iBAAiB,CAAC,aAAa,CAAC;I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AY,CAAC,KAAK,YAAG,eAAe,WAAiB,WAC7C,CACjC,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG,YAAY,CAAC;AAE1C,eAAe,aAAa,CAAC","sourcesContent":["import {\n createContext,\n useContext,\n FunctionComponent,\n ComponentType,\n ReactNode,\n useMemo,\n useState,\n useEffect,\n Context\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { ThemeProvider, StyleSheetManager } from 'styled-components';\n\nimport { GlobalStyle } from '../../styles';\nimport {\n ThemeMachine,\n BaseThemeMachine,\n DefaultSettableTheme,\n DefaultThemeDefinition\n} from '../../theme';\nimport {\n createTranslationPack,\n Translation,\n TranslationPack,\n DefaultTranslation,\n direction as directionOfLocale\n} from '../../i18n';\nimport { FileInputProps } from '../File';\nimport { windowIsAvailable, navigatorIsAvailable, documentIsAvailable } from '../../utils';\n\nexport interface ConfigurationProps {\n /**\n * Any components or nodes that should be impacted by the settings applied by this Configuration component.\n */\n children: ReactNode;\n /**\n * Context to read previous configuration values from.\n */\n context?: Context<ConfigurationContextValue>;\n /**\n * User locale as defined in [BCP-47](https://www.techonthenet.com/js/language_tags.php).\n */\n locale?: string;\n /**\n * Override rendering direction of the document. Direction will be based on the locale if now provided.\n */\n direction?: 'ltr' | 'rtl';\n /**\n * Object with (partial) translations.\n */\n translations?: Translation;\n /**\n * Theme object used to override any or all Cosmos theme properties.\n */\n theme?: DefaultSettableTheme;\n /**\n * Disables loading Open Sans from Google Fonts. Only takes effect on the root configuration.\n */\n disableDefaultFontLoading?: boolean;\n /**\n * Target element for loading styles related to `styled-components`.\n */\n styleSheetTarget?: HTMLElement;\n /**\n * Target element for rendering a `ReactDOM` portal.\n */\n portalTarget?: Element;\n /**\n * Override map to replace Cosmos components.\n */\n overrideMap?: {\n FileInput?: ComponentType<FileInputProps>;\n };\n /**\n * Use native HTML5 controls for inputs instead of rich ones.\n * @default false\n */\n renderNativeControls?: boolean;\n}\n\nconst initializedKey = Symbol.for('@pega/cosmos-react-core.configuration.initialized');\n\nexport interface ConfigurationContextValue {\n [initializedKey]: boolean;\n locale: string;\n direction: ConfigurationProps['direction'];\n translations: TranslationPack;\n themeMachine: ThemeMachine<DefaultThemeDefinition>;\n styleSheetTarget?: HTMLElement;\n portalTarget?: Element;\n overrideMap: NonNullable<ConfigurationProps['overrideMap']>;\n renderNativeControls: boolean;\n}\n\nconst defaultProps: Partial<ConfigurationProps> = {};\nconst defaultLocale = navigatorIsAvailable ? navigator.language : 'en';\n\nexport const ConfigurationContext = createContext<ConfigurationContextValue>({\n [initializedKey]: false,\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 overrideMap: {},\n renderNativeControls: false\n});\n\nconst metaKey = Symbol.for('@pega/cosmos-react-core.metadata');\n\ninterface CosmosMetadata {\n version: string;\n}\n\ndeclare global {\n interface Window {\n [metaKey]: CosmosMetadata[];\n }\n}\n\nif (windowIsAvailable) {\n if (!window[metaKey]) {\n window[metaKey] = [];\n }\n\n window[metaKey].push({ version: '2.0.0-rc.2' });\n}\n\nconst Configuration: FunctionComponent<ConfigurationProps> = ({\n context = ConfigurationContext,\n children,\n locale,\n direction,\n translations: customTranslations,\n theme,\n disableDefaultFontLoading,\n styleSheetTarget,\n portalTarget,\n overrideMap,\n renderNativeControls\n}: ConfigurationProps) => {\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 [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n const wrappedChildren = ctx[initializedKey] ? (\n children\n ) : (\n <StyleSheetManager disableVendorPrefixes target={styleSheetTarget ?? ctx.styleSheetTarget}>\n <>\n {!disableDefaultFontLoading &&\n mounted &&\n documentIsAvailable &&\n createPortal(\n <link\n rel='stylesheet'\n href='https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap'\n />,\n document.head\n )}\n <GlobalStyle />\n {children}\n </>\n </StyleSheetManager>\n );\n return (\n <ConfigurationContext.Provider\n value={{\n locale: locale ?? ctx.locale,\n direction: direction ?? (locale !== undefined ? directionOfLocale(locale) : ctx.direction),\n translations,\n themeMachine,\n [initializedKey]: true,\n styleSheetTarget: styleSheetTarget ?? ctx.styleSheetTarget,\n portalTarget: portalTarget ?? ctx.portalTarget,\n overrideMap: overrideMap ? { ...ctx.overrideMap, ...overrideMap } : ctx.overrideMap,\n renderNativeControls: renderNativeControls ?? ctx.renderNativeControls\n }}\n >\n <ThemeProvider theme={themeMachine.theme}>{wrappedChildren}</ThemeProvider>\n </ConfigurationContext.Provider>\n );\n};\n\nConfiguration.defaultProps = defaultProps;\n\nexport default Configuration;\n"]}
@@ -1,10 +1,14 @@
1
1
  import { FunctionComponent, Ref } from 'react';
2
- import { BaseProps, ForwardProps } from '../../types';
3
- export interface CurrencyDisplayProps extends BaseProps {
2
+ import { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
3
+ export interface CurrencyDisplayProps extends BaseProps, NoChildrenProp {
4
4
  /** Number value */
5
5
  value?: string;
6
6
  /** Three letter currency shorthand ISO code. If not provided or invalid, component renders as number */
7
7
  currencyISOCode?: string;
8
+ /** Always show ISO code
9
+ * @default false
10
+ * */
11
+ alwaysShowISOCode?: boolean;
8
12
  formattingOptions?: {
9
13
  /** Determines whether decimal places should be shown. The value is simply truncated if true.
10
14
  * @default true
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAW,MAAM,OAA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GAAG,YAAY,CAqC3E,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,15 +1,19 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useMemo } from 'react';
3
3
  import { useConfiguration } from '../../hooks';
4
- import { getFormattedValue } from '../Number/utils';
5
- import { getCurrencyMaximumFractionDigits, getCurrencySymbol, isCurrencyISOCodeValid } from './utils';
6
- const CurrencyDisplay = forwardRef(({ value = '', currencyISOCode, formattingOptions = {}, ...restProps }, ref) => {
4
+ import { getDisplayValue } from './utils';
5
+ const CurrencyDisplay = forwardRef(({ value = '', currencyISOCode, alwaysShowISOCode = false, formattingOptions = {}, ...restProps }, ref) => {
7
6
  const { locale } = useConfiguration();
8
7
  const { showDecimal = true, showGroupSeparators = true } = formattingOptions;
9
- const validCurrencyISOCode = useMemo(() => (isCurrencyISOCodeValid(currencyISOCode) ? currencyISOCode : undefined), [currencyISOCode]);
10
- const { symbol, symbolPlacement } = useMemo(() => getCurrencySymbol(locale, validCurrencyISOCode), [locale, validCurrencyISOCode]);
11
- const maximumFractionDigits = useMemo(() => getCurrencyMaximumFractionDigits(locale, validCurrencyISOCode), [locale, validCurrencyISOCode]);
12
- return (_jsx("span", Object.assign({ ref: ref }, restProps, { children: value ? (`${symbolPlacement === 'before' ? symbol : ''} ${getFormattedValue(!showDecimal ? value.split('.')[0] : value, locale, showGroupSeparators, maximumFractionDigits)} ${symbolPlacement === 'after' ? symbol : ''}`) : (_jsx("span", Object.assign({ "aria-hidden": 'true' }, { children: "\u2013\u2013" }), void 0)) }), void 0));
8
+ const displayValue = useMemo(() => value ? (getDisplayValue({
9
+ value,
10
+ locale,
11
+ alwaysShowISOCode,
12
+ showDecimal,
13
+ showGroupSeparators,
14
+ currencyISOCode
15
+ })) : (_jsx("span", { "aria-hidden": 'true', children: "\u2013\u2013" }, void 0)), [value, locale, alwaysShowISOCode, showDecimal, showGroupSeparators, currencyISOCode]);
16
+ return (_jsx("span", { ref: ref, ...restProps, children: displayValue }, void 0));
13
17
  });
14
18
  export default CurrencyDisplay;
15
19
  //# sourceMappingURL=CurrencyDisplay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyDisplay.js","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,OAAO,EAAE,MAAM,OAAO,CAAC;AAGrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EACL,gCAAgC,EAChC,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAqBjB,MAAM,eAAe,GAA2D,UAAU,CACxF,CACE,EACE,KAAK,GAAG,EAAE,EACV,eAAe,EACf,iBAAiB,GAAG,EAAE,EACtB,GAAG,SAAS,EAC0B,EACxC,GAAgC,EAChC,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACtC,MAAM,EAAE,WAAW,GAAG,IAAI,EAAE,mBAAmB,GAAG,IAAI,EAAE,GAAG,iBAAiB,CAAC;IAC7E,MAAM,oBAAoB,GAAG,OAAO,CAClC,GAAG,EAAE,CAAC,CAAC,sBAAsB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,EAC7E,CAAC,eAAe,CAAC,CAClB,CAAC;IACF,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CACzC,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,oBAAoB,CAAC,EACrD,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAC/B,CAAC;IACF,MAAM,qBAAqB,GAAG,OAAO,CACnC,GAAG,EAAE,CAAC,gCAAgC,CAAC,MAAM,EAAE,oBAAoB,CAAC,EACpE,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAC/B,CAAC;IAEF,OAAO,CACL,6BAAM,GAAG,EAAE,GAAG,IAAM,SAAS,cAC1B,KAAK,CAAC,CAAC,CAAC,CACP,GAAG,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,iBAAiB,CAChE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAC1C,MAAM,EACN,mBAAmB,EACnB,qBAAqB,CACtB,IAAI,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CACjD,CAAC,CAAC,CAAC,CACF,4CAAkB,MAAM,0CAAsB,CAC/C,YACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref, useMemo } from 'react';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { useConfiguration } from '../../hooks';\nimport { getFormattedValue } from '../Number/utils';\n\nimport {\n getCurrencyMaximumFractionDigits,\n getCurrencySymbol,\n isCurrencyISOCodeValid\n} from './utils';\n\nexport interface CurrencyDisplayProps extends BaseProps {\n /** Number value */\n value?: string;\n /** Three letter currency shorthand ISO code. If not provided or invalid, component renders as number */\n currencyISOCode?: string;\n formattingOptions?: {\n /** Determines whether decimal places should be shown. The value is simply truncated if true.\n * @default true\n */\n showDecimal?: boolean;\n /** Determines whether group separators should be shown.\n * @default true\n */\n showGroupSeparators?: boolean;\n };\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLAnchorElement>;\n}\n\nconst CurrencyDisplay: FunctionComponent<CurrencyDisplayProps & ForwardProps> = forwardRef(\n (\n {\n value = '',\n currencyISOCode,\n formattingOptions = {},\n ...restProps\n }: PropsWithoutRef<CurrencyDisplayProps>,\n ref: CurrencyDisplayProps['ref']\n ) => {\n const { locale } = useConfiguration();\n const { showDecimal = true, showGroupSeparators = true } = formattingOptions;\n const validCurrencyISOCode = useMemo(\n () => (isCurrencyISOCodeValid(currencyISOCode) ? currencyISOCode : undefined),\n [currencyISOCode]\n );\n const { symbol, symbolPlacement } = useMemo(\n () => getCurrencySymbol(locale, validCurrencyISOCode),\n [locale, validCurrencyISOCode]\n );\n const maximumFractionDigits = useMemo(\n () => getCurrencyMaximumFractionDigits(locale, validCurrencyISOCode),\n [locale, validCurrencyISOCode]\n );\n\n return (\n <span ref={ref} {...restProps}>\n {value ? (\n `${symbolPlacement === 'before' ? symbol : ''} ${getFormattedValue(\n !showDecimal ? value.split('.')[0] : value,\n locale,\n showGroupSeparators,\n maximumFractionDigits\n )} ${symbolPlacement === 'after' ? symbol : ''}`\n ) : (\n <span aria-hidden='true'>&ndash;&ndash;</span>\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,EAA2C,OAAO,EAAE,MAAM,OAAO,CAAC;AAGrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAyB1C,MAAM,eAAe,GAA2D,UAAU,CACxF,CACE,EACE,KAAK,GAAG,EAAE,EACV,eAAe,EACf,iBAAiB,GAAG,KAAK,EACzB,iBAAiB,GAAG,EAAE,EACtB,GAAG,SAAS,EAC0B,EACxC,GAAgC,EAChC,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACtC,MAAM,EAAE,WAAW,GAAG,IAAI,EAAE,mBAAmB,GAAG,IAAI,EAAE,GAAG,iBAAiB,CAAC;IAE7E,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CACH,KAAK,CAAC,CAAC,CAAC,CACN,eAAe,CAAC;QACd,KAAK;QACL,MAAM;QACN,iBAAiB;QACjB,WAAW;QACX,mBAAmB;QACnB,eAAe;KAChB,CAAC,CACH,CAAC,CAAC,CAAC,CACF,8BAAkB,MAAM,qCAAsB,CAC/C,EACH,CAAC,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,CAAC,CACtF,CAAC;IAEF,OAAO,CACL,eAAM,GAAG,EAAE,GAAG,KAAM,SAAS,YAC1B,YAAY,WACR,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref, useMemo } from 'react';\n\nimport { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { useConfiguration } from '../../hooks';\n\nimport { getDisplayValue } from './utils';\n\nexport interface CurrencyDisplayProps extends BaseProps, NoChildrenProp {\n /** Number value */\n value?: string;\n /** Three letter currency shorthand ISO code. If not provided or invalid, component renders as number */\n currencyISOCode?: string;\n /** Always show ISO code\n * @default false\n * */\n alwaysShowISOCode?: boolean;\n formattingOptions?: {\n /** Determines whether decimal places should be shown. The value is simply truncated if true.\n * @default true\n */\n showDecimal?: boolean;\n /** Determines whether group separators should be shown.\n * @default true\n */\n showGroupSeparators?: boolean;\n };\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLAnchorElement>;\n}\n\nconst CurrencyDisplay: FunctionComponent<CurrencyDisplayProps & ForwardProps> = forwardRef(\n (\n {\n value = '',\n currencyISOCode,\n alwaysShowISOCode = false,\n formattingOptions = {},\n ...restProps\n }: PropsWithoutRef<CurrencyDisplayProps>,\n ref: CurrencyDisplayProps['ref']\n ) => {\n const { locale } = useConfiguration();\n const { showDecimal = true, showGroupSeparators = true } = formattingOptions;\n\n const displayValue = useMemo(\n () =>\n value ? (\n getDisplayValue({\n value,\n locale,\n alwaysShowISOCode,\n showDecimal,\n showGroupSeparators,\n currencyISOCode\n })\n ) : (\n <span aria-hidden='true'>&ndash;&ndash;</span>\n ),\n [value, locale, alwaysShowISOCode, showDecimal, showGroupSeparators, currencyISOCode]\n );\n\n return (\n <span ref={ref} {...restProps}>\n {displayValue}\n </span>\n );\n }\n);\n\nexport default CurrencyDisplay;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyInput.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAyC,MAAM,OAAO,CAAC;AAG7F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAOvD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CA+EvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"CurrencyInput.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAyC,MAAM,OAAO,CAAC;AAG7F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAOvD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAgFvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -6,13 +6,13 @@ import { NumberInput } from '../Number';
6
6
  import { getCurrencyMaximumFractionDigits, getCurrencySymbol, isCurrencyISOCodeValid } from './utils';
7
7
  const CurrencyInput = forwardRef((props, ref) => {
8
8
  const uid = useUID();
9
- const { id = uid, status, label, labelHidden, info, required, disabled, readOnly, value = '', onBlur, onFocus, showDecimal = true, currencyISOCode, ...restProps } = props;
9
+ const { id = uid, status, label, labelHidden, info, required, disabled, readOnly, value = '', onBlur, onFocus, showDecimal = true, currencyISOCode, alwaysShowISOCode = false, ...restProps } = props;
10
10
  const { locale } = useConfiguration();
11
11
  const validCurrencyISOCode = useMemo(() => (isCurrencyISOCodeValid(currencyISOCode) ? currencyISOCode : undefined), [currencyISOCode]);
12
- const { symbol, symbolPlacement } = useMemo(() => getCurrencySymbol(locale, validCurrencyISOCode), [locale, validCurrencyISOCode]);
12
+ const { symbol, symbolPlacement } = useMemo(() => getCurrencySymbol(locale, alwaysShowISOCode, validCurrencyISOCode), [locale, alwaysShowISOCode, validCurrencyISOCode]);
13
13
  const maximumFractionDigits = useMemo(() => getCurrencyMaximumFractionDigits(locale, validCurrencyISOCode), [locale, validCurrencyISOCode]);
14
14
  const onInputFocus = useCallback(() => {
15
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(value);
15
+ onFocus?.(value);
16
16
  }, [onFocus, value]);
17
17
  const onInputBlur = useCallback((inputValue) => {
18
18
  let formattedValue = inputValue;
@@ -20,20 +20,20 @@ const CurrencyInput = forwardRef((props, ref) => {
20
20
  const [integer, fraction = ''] = inputValue.split('.');
21
21
  formattedValue = `${integer}.${fraction.padEnd(maximumFractionDigits, '0')}`;
22
22
  }
23
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(formattedValue);
23
+ onBlur?.(formattedValue);
24
24
  }, [onBlur, maximumFractionDigits]);
25
- const Comp = (_jsx(NumberInput, Object.assign({ numberOfDecimals: maximumFractionDigits, onFocus: onInputFocus, onBlur: onInputBlur, unit: symbol, unitPlacement: symbolPlacement }, {
26
- ref,
27
- id,
28
- value,
29
- showDecimal,
30
- readOnly,
31
- required,
32
- disabled,
33
- status,
34
- ...restProps
35
- }), void 0));
36
- return label ? (_jsx(FormField, Object.assign({}, { label, labelHidden, id, info, status, required, disabled }, { children: Comp }), void 0)) : (Comp);
25
+ const Comp = (_jsx(NumberInput, { numberOfDecimals: maximumFractionDigits, onFocus: onInputFocus, onBlur: onInputBlur, unit: symbol, unitPlacement: symbolPlacement, ...{
26
+ ref,
27
+ id,
28
+ value,
29
+ showDecimal,
30
+ readOnly,
31
+ required,
32
+ disabled,
33
+ status,
34
+ ...restProps
35
+ } }, void 0));
36
+ return label ? (_jsx(FormField, { ...{ label, labelHidden, id, info, status, required, disabled }, children: Comp }, void 0)) : (Comp);
37
37
  });
38
38
  export default CurrencyInput;
39
39
  //# sourceMappingURL=CurrencyInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyInput.js","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAsC,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE7F,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,EACL,gCAAgC,EAChC,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB,MAAM,aAAa,GAAyD,UAAU,CACpF,CAAC,KAA0C,EAAE,GAA8B,EAAE,EAAE;IAC7E,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,EACJ,EAAE,GAAG,GAAG,EACR,MAAM,EACN,KAAK,EACL,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,GAAG,EAAE,EACV,MAAM,EACN,OAAO,EACP,WAAW,GAAG,IAAI,EAClB,eAAe,EACf,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IAEV,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACtC,MAAM,oBAAoB,GAAG,OAAO,CAClC,GAAG,EAAE,CAAC,CAAC,sBAAsB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,EAC7E,CAAC,eAAe,CAAC,CAClB,CAAC;IACF,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CACzC,GAAG,EAAE,CAAC,iBAAiB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EF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,oBAAK,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,cACxE,IAAI,YACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, useCallback, useMemo } from 'react';\n\nimport FormField from '../FormField';\nimport { ForwardProps } from '../../types';\nimport { useConfiguration, useUID } from '../../hooks';\nimport { NumberInput } from '../Number';\n\nimport CurrencyInputProps from './CurrencyInput.types';\nimport {\n getCurrencyMaximumFractionDigits,\n getCurrencySymbol,\n isCurrencyISOCodeValid\n} from './utils';\n\nconst CurrencyInput: FunctionComponent<CurrencyInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<CurrencyInputProps>, ref: CurrencyInputProps['ref']) => {\n const uid = useUID();\n const {\n id = uid,\n status,\n label,\n labelHidden,\n info,\n required,\n disabled,\n readOnly,\n value = '',\n onBlur,\n onFocus,\n showDecimal = true,\n currencyISOCode,\n ...restProps\n } = props;\n\n const { locale } = useConfiguration();\n const validCurrencyISOCode = useMemo(\n () => (isCurrencyISOCodeValid(currencyISOCode) ? currencyISOCode : undefined),\n [currencyISOCode]\n );\n const { symbol, symbolPlacement } = useMemo(\n () => getCurrencySymbol(locale, validCurrencyISOCode),\n [locale, validCurrencyISOCode]\n );\n const maximumFractionDigits = useMemo(\n () => getCurrencyMaximumFractionDigits(locale, validCurrencyISOCode),\n [locale, validCurrencyISOCode]\n );\n\n const onInputFocus = useCallback(() => {\n onFocus?.(value);\n }, [onFocus, value]);\n\n const onInputBlur = useCallback(\n (inputValue: string) => {\n let formattedValue = inputValue;\n if (validCurrencyISOCode && !Number.isNaN(parseFloat(value))) {\n const [integer, fraction = ''] = inputValue.split('.');\n formattedValue = `${integer}.${fraction.padEnd(maximumFractionDigits, '0')}`;\n }\n onBlur?.(formattedValue);\n },\n [onBlur, maximumFractionDigits]\n );\n\n const Comp = (\n <NumberInput\n numberOfDecimals={maximumFractionDigits}\n onFocus={onInputFocus}\n onBlur={onInputBlur}\n unit={symbol}\n unitPlacement={symbolPlacement}\n {...{\n ref,\n id,\n value,\n showDecimal,\n readOnly,\n required,\n disabled,\n status,\n ...restProps\n }}\n />\n );\n\n return label ? (\n <FormField {...{ label, labelHidden, id, info, status, required, disabled }}>\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default CurrencyInput;\n"]}
1
+ {"version":3,"file":"CurrencyInput.js","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAsC,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE7F,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,EACL,gCAAgC,EAChC,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB,MAAM,aAAa,GAAyD,UAAU,CACpF,CAAC,KAA0C,EAAE,GAA8B,EAAE,EAAE;IAC7E,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,EACJ,EAAE,GAAG,GAAG,EACR,MAAM,EACN,KAAK,EACL,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,GAAG,EAAE,EACV,MAAM,EACN,OAAO,EACP,WAAW,GAAG,IAAI,EAClB,eAAe,EACf,iBAAiB,GAAG,KAAK,EACzB,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IAEV,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACtC,MAAM,oBAAoB,GAA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,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,eAAe,KAC1B;YACF,GAAG;YACH,EAAE;YACF,KAAK;YACL,WAAW;YACX,QAAQ;YACR,QAAQ;YACR,QAAQ;YACR,MAAM;YACN,GAAG,SAAS;SACb,WACD,CACH,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,OAAK,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,YACxE,IAAI,WACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, useCallback, useMemo } from 'react';\n\nimport FormField from '../FormField';\nimport { ForwardProps } from '../../types';\nimport { useConfiguration, useUID } from '../../hooks';\nimport { NumberInput } from '../Number';\n\nimport CurrencyInputProps from './CurrencyInput.types';\nimport {\n getCurrencyMaximumFractionDigits,\n getCurrencySymbol,\n isCurrencyISOCodeValid\n} from './utils';\n\nconst CurrencyInput: FunctionComponent<CurrencyInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<CurrencyInputProps>, ref: CurrencyInputProps['ref']) => {\n const uid = useUID();\n const {\n id = uid,\n status,\n label,\n labelHidden,\n info,\n required,\n disabled,\n readOnly,\n value = '',\n onBlur,\n onFocus,\n showDecimal = true,\n currencyISOCode,\n alwaysShowISOCode = false,\n ...restProps\n } = props;\n\n const { locale } = useConfiguration();\n const validCurrencyISOCode = useMemo(\n () => (isCurrencyISOCodeValid(currencyISOCode) ? currencyISOCode : undefined),\n [currencyISOCode]\n );\n const { symbol, symbolPlacement } = useMemo(\n () => getCurrencySymbol(locale, alwaysShowISOCode, validCurrencyISOCode),\n [locale, alwaysShowISOCode, validCurrencyISOCode]\n );\n const maximumFractionDigits = useMemo(\n () => getCurrencyMaximumFractionDigits(locale, validCurrencyISOCode),\n [locale, validCurrencyISOCode]\n );\n\n const onInputFocus = useCallback(() => {\n onFocus?.(value);\n }, [onFocus, value]);\n\n const onInputBlur = useCallback(\n (inputValue: string) => {\n let formattedValue = inputValue;\n if (validCurrencyISOCode && !Number.isNaN(parseFloat(value))) {\n const [integer, fraction = ''] = inputValue.split('.');\n formattedValue = `${integer}.${fraction.padEnd(maximumFractionDigits, '0')}`;\n }\n onBlur?.(formattedValue);\n },\n [onBlur, maximumFractionDigits]\n );\n\n const Comp = (\n <NumberInput\n numberOfDecimals={maximumFractionDigits}\n onFocus={onInputFocus}\n onBlur={onInputBlur}\n unit={symbol}\n unitPlacement={symbolPlacement}\n {...{\n ref,\n id,\n value,\n showDecimal,\n readOnly,\n required,\n disabled,\n status,\n ...restProps\n }}\n />\n );\n\n return label ? (\n <FormField {...{ label, labelHidden, id, info, status, required, disabled }}>\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default CurrencyInput;\n"]}
@@ -1,11 +1,15 @@
1
- import { OmitStrict } from '../../types';
1
+ import { NoChildrenProp, OmitStrict } from '../../types';
2
2
  import NumberInputProps from '../Number/NumberInput.types';
3
- export default interface CurrencyInputProps extends OmitStrict<NumberInputProps, 'numberOfDecimals'> {
3
+ export default interface CurrencyInputProps extends OmitStrict<NumberInputProps, 'numberOfDecimals'>, NoChildrenProp {
4
4
  /** Callback fired when the component gets focus */
5
5
  onFocus?: (value: string) => void;
6
6
  /** Callback fired when the component loses focus. */
7
7
  onBlur?: (value: string) => void;
8
8
  /** Three letter currency shorthand ISO code. If not provided or invalid, component renders as NumberInput */
9
9
  currencyISOCode?: string;
10
+ /** Always show ISO code
11
+ * @default false
12
+ * */
13
+ alwaysShowISOCode?: boolean;
10
14
  }
11
15
  //# sourceMappingURL=CurrencyInput.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyInput.types.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAE3D,MAAM,CAAC,OAAO,WAAW,kBACvB,SAAQ,UAAU,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;IACxD,mDAAmD;IACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,qDAAqD;IACrD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,6GAA6G;IAC7G,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
1
+ {"version":3,"file":"CurrencyInput.types.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAE3D,MAAM,CAAC,OAAO,WAAW,kBACvB,SAAQ,UAAU,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,EACtD,cAAc;IAChB,mDAAmD;IACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,qDAAqD;IACrD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,6GAA6G;IAC7G,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;SAEK;IACL,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyInput.types.js","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.types.ts"],"names":[],"mappings":"","sourcesContent":["import { OmitStrict } from '../../types';\nimport NumberInputProps from '../Number/NumberInput.types';\n\nexport default interface CurrencyInputProps\n extends OmitStrict<NumberInputProps, 'numberOfDecimals'> {\n /** Callback fired when the component gets focus */\n onFocus?: (value: string) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: string) => void;\n /** Three letter currency shorthand ISO code. If not provided or invalid, component renders as NumberInput */\n currencyISOCode?: string;\n}\n"]}
1
+ {"version":3,"file":"CurrencyInput.types.js","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.types.ts"],"names":[],"mappings":"","sourcesContent":["import { NoChildrenProp, OmitStrict } from '../../types';\nimport NumberInputProps from '../Number/NumberInput.types';\n\nexport default interface CurrencyInputProps\n extends OmitStrict<NumberInputProps, 'numberOfDecimals'>,\n NoChildrenProp {\n /** Callback fired when the component gets focus */\n onFocus?: (value: string) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: string) => void;\n /** Three letter currency shorthand ISO code. If not provided or invalid, component renders as NumberInput */\n currencyISOCode?: string;\n /** Always show ISO code\n * @default false\n * */\n alwaysShowISOCode?: boolean;\n}\n"]}
@@ -2,7 +2,18 @@ export declare type CurrencySymbol = {
2
2
  symbol: string;
3
3
  symbolPlacement: 'before' | 'after';
4
4
  };
5
- export declare function getCurrencySymbol(locale: string, currencyISOCode?: string): CurrencySymbol;
5
+ export declare function getCurrencySymbol(locale: string, alwaysShowISOCode: boolean, currencyISOCode?: string): CurrencySymbol;
6
6
  export declare function getCurrencyMaximumFractionDigits(locale: string, currencyISOCode?: string): number;
7
7
  export declare function isCurrencyISOCodeValid(currencyISOCode?: string): boolean;
8
+ export declare function addTrailingZeros(valueToFormat: string, maximumFractionDigits: number, currencyISOCode?: string): string;
9
+ declare type DisplayValueParams = {
10
+ value: string;
11
+ locale: string;
12
+ alwaysShowISOCode: boolean;
13
+ showDecimal: boolean;
14
+ showGroupSeparators: boolean;
15
+ currencyISOCode?: string;
16
+ };
17
+ export declare function getDisplayValue({ value, locale, alwaysShowISOCode, showDecimal, showGroupSeparators, currencyISOCode }: DisplayValueParams): string;
18
+ export {};
8
19
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/utils.ts"],"names":[],"mappings":"AAOA,oBAAY,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,QAAQ,GAAG,OAAO,CAAC;CACrC,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,cAAc,CAmB1F;AAED,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAOjG;AAED,wBAAgB,sBAAsB,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAExE"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/utils.ts"],"names":[],"mappings":"AAQA,oBAAY,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,QAAQ,GAAG,OAAO,CAAC;CACrC,CAAC;AAEF,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,OAAO,EAC1B,eAAe,CAAC,EAAE,MAAM,GACvB,cAAc,CAmBhB;AAED,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAOjG;AAED,wBAAgB,sBAAsB,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAExE;AAED,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,MAAM,EACrB,qBAAqB,EAAE,MAAM,EAC7B,eAAe,CAAC,EAAE,MAAM,UAQzB;AAED,aAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,MAAM,EACN,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,eAAe,EAChB,EAAE,kBAAkB,UA+BpB"}
@@ -1,7 +1,8 @@
1
1
  import { NUMBER_MAX_DECIMAL_PLACES } from '../Number/NumberInput.types';
2
+ import { getFormattedValue } from '../Number/utils';
2
3
  // Currency & funds code list valid for Intl.NumberFormat(): https://www.currency-iso.org/en/home/tables/table-a1.html
3
4
  import currencyCodeList from './currencyCodes';
4
- export function getCurrencySymbol(locale, currencyISOCode) {
5
+ export function getCurrencySymbol(locale, alwaysShowISOCode, currencyISOCode) {
5
6
  const options = currencyISOCode
6
7
  ? {
7
8
  style: 'currency',
@@ -10,7 +11,7 @@ export function getCurrencySymbol(locale, currencyISOCode) {
10
11
  : undefined;
11
12
  return new Intl.NumberFormat(locale, options).formatToParts(1).reduce((currencyObj, part, index) => {
12
13
  if (part.type === 'currency') {
13
- currencyObj.symbol = part.value;
14
+ currencyObj.symbol = alwaysShowISOCode ? currencyISOCode || '' : part.value;
14
15
  if (index === 0) {
15
16
  currencyObj.symbolPlacement = 'before';
16
17
  }
@@ -29,4 +30,31 @@ export function getCurrencyMaximumFractionDigits(locale, currencyISOCode) {
29
30
  export function isCurrencyISOCodeValid(currencyISOCode) {
30
31
  return currencyISOCode ? currencyCodeList.has(currencyISOCode) : false;
31
32
  }
33
+ export function addTrailingZeros(valueToFormat, maximumFractionDigits, currencyISOCode) {
34
+ let formattedValue = valueToFormat;
35
+ if (currencyISOCode && !Number.isNaN(parseFloat(valueToFormat))) {
36
+ const [integer, fraction = ''] = valueToFormat.split('.');
37
+ formattedValue = `${integer}.${fraction.padEnd(maximumFractionDigits, '0')}`;
38
+ }
39
+ return formattedValue;
40
+ }
41
+ export function getDisplayValue({ value, locale, alwaysShowISOCode, showDecimal, showGroupSeparators, currencyISOCode }) {
42
+ const validCurrencyISOCode = isCurrencyISOCodeValid(currencyISOCode)
43
+ ? currencyISOCode
44
+ : undefined;
45
+ const { symbol, symbolPlacement } = getCurrencySymbol(locale, alwaysShowISOCode, validCurrencyISOCode);
46
+ const maximumFractionDigits = getCurrencyMaximumFractionDigits(locale, validCurrencyISOCode);
47
+ let sign = '';
48
+ let formattedValue = getFormattedValue(!showDecimal
49
+ ? value.split('.')[0]
50
+ : addTrailingZeros(value, maximumFractionDigits, validCurrencyISOCode), locale, showGroupSeparators, maximumFractionDigits);
51
+ if (formattedValue.startsWith('-')) {
52
+ sign = '-';
53
+ formattedValue = formattedValue.substring(1);
54
+ }
55
+ let symbolBefore = symbolPlacement === 'before' ? symbol : '';
56
+ symbolBefore += symbolBefore === currencyISOCode ? ' ' : '';
57
+ const symbolAfter = symbolPlacement === 'after' && symbol ? ` ${symbol}` : '';
58
+ return `${sign}${symbolBefore}${formattedValue}${symbolAfter}`;
59
+ }
32
60
  //# sourceMappingURL=utils.js.map
@@ -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;AAExE,sHAAsH;AACtH,OAAO,gBAAgB,MAAM,iBAAiB,CAAC;AAS/C,MAAM,UAAU,iBAAiB,CAAC,MAAc,EAAE,eAAwB;IACxE,MAAM,OAAO,GAAG,eAAe;QAC7B,CAAC,CAAC;YACE,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,eAAe;SAC1B;QACH,CAAC,CAAC,SAAS,CAAC;IACd,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,MAAM,CACnE,CAAC,WAA2B,EAAE,IAAkB,EAAE,KAAa,EAAE,EAAE;QACjE,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE;YAC5B,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;YAChC,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,WAAW,CAAC,eAAe,GAAG,QAAQ,CAAC;aACxC;SACF;QACD,OAAO,WAAW,CAAC;IACrB,CAAC,EACD,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,CACzC,CAAC;AACJ,CAAC;AAED,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;AAED,MAAM,UAAU,sBAAsB,CAAC,eAAwB;IAC7D,OAAO,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACzE,CAAC","sourcesContent":["import { NUMBER_MAX_DECIMAL_PLACES } from '../Number/NumberInput.types';\n\n// Currency & funds code list valid for Intl.NumberFormat(): https://www.currency-iso.org/en/home/tables/table-a1.html\nimport currencyCodeList from './currencyCodes';\n\ntype CurrencyPart = { type: string; value: string };\n\nexport type CurrencySymbol = {\n symbol: string;\n symbolPlacement: 'before' | 'after';\n};\n\nexport function getCurrencySymbol(locale: string, currencyISOCode?: string): CurrencySymbol {\n const options = currencyISOCode\n ? {\n style: 'currency',\n currency: currencyISOCode\n }\n : undefined;\n return new Intl.NumberFormat(locale, options).formatToParts(1).reduce(\n (currencyObj: CurrencySymbol, part: CurrencyPart, index: number) => {\n if (part.type === 'currency') {\n currencyObj.symbol = part.value;\n if (index === 0) {\n currencyObj.symbolPlacement = 'before';\n }\n }\n return currencyObj;\n },\n { symbol: '', symbolPlacement: 'after' }\n );\n}\n\nexport function getCurrencyMaximumFractionDigits(locale: string, currencyISOCode?: string): number {\n return currencyISOCode\n ? new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: currencyISOCode\n }).resolvedOptions().maximumFractionDigits\n : NUMBER_MAX_DECIMAL_PLACES;\n}\n\nexport function isCurrencyISOCodeValid(currencyISOCode?: string): boolean {\n return currencyISOCode ? currencyCodeList.has(currencyISOCode) : false;\n}\n"]}
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,EAAE,MAAM,iBAAiB,CAAC;AAEpD,sHAAsH;AACtH,OAAO,gBAAgB,MAAM,iBAAiB,CAAC;AAS/C,MAAM,UAAU,iBAAiB,CAC/B,MAAc,EACd,iBAA0B,EAC1B,eAAwB;IAExB,MAAM,OAAO,GAAG,eAAe;QAC7B,CAAC,CAAC;YACE,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,eAAe;SAC1B;QACH,CAAC,CAAC,SAAS,CAAC;IACd,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,MAAM,CACnE,CAAC,WAA2B,EAAE,IAAkB,EAAE,KAAa,EAAE,EAAE;QACjE,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE;YAC5B,WAAW,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YAC5E,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,WAAW,CAAC,eAAe,GAAG,QAAQ,CAAC;aACxC;SACF;QACD,OAAO,WAAW,CAAC;IACrB,CAAC,EACD,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,CACzC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gCAAgC,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C,CAAC;IAE7F,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,cAAc,GAAG,iBAAiB,CACpC,CAAC,WAAW;QACV,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC,CAAC,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,CAAC,EACxE,MAAM,EACN,mBAAmB,EACnB,qBAAqB,CACtB,CAAC;IACF,IAAI,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAClC,IAAI,GAAG,GAAG,CAAC;QACX,cAAc,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAC9C;IAED,IAAI,YAAY,GAAG,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9D,YAAY,IAAI,YAAY,KAAK,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAE5D,MAAM,WAAW,GAAG,eAAe,KAAK,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAE9E,OAAO,GAAG,IAAI,GAAG,YAAY,GAAG,cAAc,GAAG,WAAW,EAAE,CAAC;AACjE,CAAC","sourcesContent":["import { NUMBER_MAX_DECIMAL_PLACES } from '../Number/NumberInput.types';\nimport { getFormattedValue } from '../Number/utils';\n\n// Currency & funds code list valid for Intl.NumberFormat(): https://www.currency-iso.org/en/home/tables/table-a1.html\nimport currencyCodeList from './currencyCodes';\n\ntype CurrencyPart = { type: string; value: string };\n\nexport type CurrencySymbol = {\n symbol: string;\n symbolPlacement: 'before' | 'after';\n};\n\nexport function getCurrencySymbol(\n locale: string,\n alwaysShowISOCode: boolean,\n currencyISOCode?: string\n): CurrencySymbol {\n const options = currencyISOCode\n ? {\n style: 'currency',\n currency: currencyISOCode\n }\n : undefined;\n return new Intl.NumberFormat(locale, options).formatToParts(1).reduce(\n (currencyObj: CurrencySymbol, part: CurrencyPart, index: number) => {\n if (part.type === 'currency') {\n currencyObj.symbol = alwaysShowISOCode ? currencyISOCode || '' : part.value;\n if (index === 0) {\n currencyObj.symbolPlacement = 'before';\n }\n }\n return currencyObj;\n },\n { symbol: '', symbolPlacement: 'after' }\n );\n}\n\nexport function getCurrencyMaximumFractionDigits(locale: string, currencyISOCode?: string): number {\n return currencyISOCode\n ? new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: currencyISOCode\n }).resolvedOptions().maximumFractionDigits\n : NUMBER_MAX_DECIMAL_PLACES;\n}\n\nexport function isCurrencyISOCodeValid(currencyISOCode?: string): boolean {\n return currencyISOCode ? currencyCodeList.has(currencyISOCode) : false;\n}\n\nexport function addTrailingZeros(\n valueToFormat: string,\n maximumFractionDigits: number,\n currencyISOCode?: string\n) {\n let formattedValue = valueToFormat;\n if (currencyISOCode && !Number.isNaN(parseFloat(valueToFormat))) {\n const [integer, fraction = ''] = valueToFormat.split('.');\n formattedValue = `${integer}.${fraction.padEnd(maximumFractionDigits, '0')}`;\n }\n return formattedValue;\n}\n\ntype DisplayValueParams = {\n value: string;\n locale: string;\n alwaysShowISOCode: boolean;\n showDecimal: boolean;\n showGroupSeparators: boolean;\n currencyISOCode?: string;\n};\n\nexport function getDisplayValue({\n value,\n locale,\n alwaysShowISOCode,\n showDecimal,\n showGroupSeparators,\n currencyISOCode\n}: DisplayValueParams) {\n const validCurrencyISOCode = isCurrencyISOCodeValid(currencyISOCode)\n ? currencyISOCode\n : undefined;\n const { symbol, symbolPlacement } = getCurrencySymbol(\n locale,\n alwaysShowISOCode,\n validCurrencyISOCode\n );\n const maximumFractionDigits = getCurrencyMaximumFractionDigits(locale, validCurrencyISOCode);\n\n let sign = '';\n let formattedValue = getFormattedValue(\n !showDecimal\n ? value.split('.')[0]\n : addTrailingZeros(value, maximumFractionDigits, validCurrencyISOCode),\n locale,\n showGroupSeparators,\n maximumFractionDigits\n );\n if (formattedValue.startsWith('-')) {\n sign = '-';\n formattedValue = formattedValue.substring(1);\n }\n\n let symbolBefore = symbolPlacement === 'before' ? symbol : '';\n symbolBefore += symbolBefore === currencyISOCode ? ' ' : '';\n\n const symbolAfter = symbolPlacement === 'after' && symbol ? ` ${symbol}` : '';\n\n return `${sign}${symbolBefore}${formattedValue}${symbolAfter}`;\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { NoChildrenProp } from '../../types';
1
2
  import { FormControlProps } from '../FormControl';
2
3
  export interface DateTimeProperties {
3
4
  /**
@@ -51,6 +52,6 @@ export interface DateTimeCallbacks {
51
52
  /** Callback fired when the component loses focus. */
52
53
  onBlur?: (value: DateTimeCallbackParameter) => void;
53
54
  }
54
- export default interface DateTimeProps extends DateTimeProperties, DateTimeCallbacks {
55
+ export default interface DateTimeProps extends DateTimeProperties, DateTimeCallbacks, NoChildrenProp {
55
56
  }
56
57
  //# sourceMappingURL=DateTime.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateTime.types.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTime.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACtC,4HAA4H;IAC5H,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7B,4HAA4H;IAC5H,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7B;;;OAGG;IACH,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5B,oDAAoD;IACpD,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC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IACzB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,KAAK,CAAC,EAAE,uBAAuB,CAAC;CACjC,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACtD,sDAAsD;IACtD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACrD,qDAAqD;IACrD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;CACrD;AAED,MAAM,CAAC,OAAO,WAAW,aACvB,SAAQ,kBAAkB,EACxB,iBAAiB,EACjB,cAAc;CAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"DateTime.types.js","sourceRoot":"","sources":["../../../src/components/DateTime/DateTime.types.ts"],"names":[],"mappings":"","sourcesContent":["import { FormControlProps } from '../FormControl';\n\nexport interface DateTimeProperties {\n /**\n * Date as ISO8601 string, timestamp or native Date object.\n * Requires onChange prop to update value for controlled inputs.\n */\n value?: string | number | Date;\n /**\n * Date as ISO8601 string, timestamp or native Date object. Sets the value for an uncontrolled input.\n */\n defaultValue?: string | number | Date;\n /** Date as ISO8601 string, timestamp or native Date object. Defines minimum available value that can be set by the user. */\n min?: string | number | Date;\n /** Date as ISO8601 string, timestamp or native Date object. Defines maximum available value that can be set by the user. */\n max?: string | number | Date;\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Automatically focuses the input on render. */\n autoFocus?: boolean;\n}\n\nexport type DateTimeValueErrorState = 'incomplete' | 'invalid';\n\nexport type DateTimeCallbackParameter = {\n valueAsISOString: string;\n valueAsTimestamp: number | undefined;\n state?: DateTimeValueErrorState;\n};\n\nexport interface DateTimeCallbacks {\n /** Callback fired when input value changes. */\n onChange?: (value: DateTimeCallbackParameter) => void;\n /** Callback fired when the component gets focused. */\n onFocus?: (value: DateTimeCallbackParameter) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: DateTimeCallbackParameter) => void;\n}\n\nexport default interface DateTimeProps extends DateTimeProperties, DateTimeCallbacks {}\n"]}
1
+ {"version":3,"file":"DateTime.types.js","sourceRoot":"","sources":["../../../src/components/DateTime/DateTime.types.ts"],"names":[],"mappings":"","sourcesContent":["import { NoChildrenProp } from '../../types';\nimport { FormControlProps } from '../FormControl';\n\nexport interface DateTimeProperties {\n /**\n * Date as ISO8601 string, timestamp or native Date object.\n * Requires onChange prop to update value for controlled inputs.\n */\n value?: string | number | Date;\n /**\n * Date as ISO8601 string, timestamp or native Date object. Sets the value for an uncontrolled input.\n */\n defaultValue?: string | number | Date;\n /** Date as ISO8601 string, timestamp or native Date object. Defines minimum available value that can be set by the user. */\n min?: string | number | Date;\n /** Date as ISO8601 string, timestamp or native Date object. Defines maximum available value that can be set by the user. */\n max?: string | number | Date;\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Automatically focuses the input on render. */\n autoFocus?: boolean;\n}\n\nexport type DateTimeValueErrorState = 'incomplete' | 'invalid';\n\nexport type DateTimeCallbackParameter = {\n valueAsISOString: string;\n valueAsTimestamp: number | undefined;\n state?: DateTimeValueErrorState;\n};\n\nexport interface DateTimeCallbacks {\n /** Callback fired when input value changes. */\n onChange?: (value: DateTimeCallbackParameter) => void;\n /** Callback fired when the component gets focused. */\n onFocus?: (value: DateTimeCallbackParameter) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: DateTimeCallbackParameter) => void;\n}\n\nexport default interface DateTimeProps\n extends DateTimeProperties,\n DateTimeCallbacks,\n NoChildrenProp {}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { FunctionComponent, Ref } from 'react';
2
2
  import { BaseProps, ForwardProps } from '../../types';
3
3
  import { ClockFormat } from './Input/utils';
4
- declare type AbsoluteVariant = 'date' | 'datetime' | 'time' | 'week' | 'month' | 'year' | 'monthyear';
4
+ declare type AbsoluteVariant = 'date' | 'datetime' | 'time' | 'week' | 'month' | 'year' | 'monthyear' | 'quarteryear';
5
5
  export declare type DateTimeVariant = AbsoluteVariant | 'relative';
6
6
  export declare type DateTimeFormat = 'short' | 'long' | 'numeric';
7
7
  export interface DateTimeDisplayProps extends BaseProps {
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimeDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,E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,GAAG,SAAS,CAAC;AAE1D,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/B;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B;AAaD,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CA+H3E,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
3
  import { useConfiguration, useI18n } from '../../hooks';
4
- import { getEndOfWeek, getStartOfWeek, getWeek, getWeekYear, parseToDate } from './Input/utils';
4
+ import { getEndOfWeek, getQuarter, getStartOfWeek, getWeek, getWeekYear, parseToDate } from './Input/utils';
5
+ import { isValidDate } from './Picker/utils';
5
6
  const unitsInMs = {
6
7
  year: 24 * 60 * 60 * 1000 * 365,
7
8
  month: (24 * 60 * 60 * 1000 * 365) / 12,
@@ -75,7 +76,10 @@ const DateTimeDisplay = forwardRef(({ value, variant, format = 'short', clockFor
75
76
  return new Intl.RelativeTimeFormat(locale, formatMapping.relative[format]).format(relativeValue, unit);
76
77
  };
77
78
  const getRelativeTime = (date) => {
78
- const elapsed = date.getTime() - new Date().getTime();
79
+ let elapsed = date.getTime() - Date.now();
80
+ // Deliberately reduce precision to 1 minute
81
+ if (Math.abs(elapsed) < 60000)
82
+ elapsed = 0;
79
83
  const unit = (Object.keys(unitsInMs).find(u => Math.abs(elapsed) >= unitsInMs[u]) || 'second');
80
84
  return relativeTimeFormatter(Math.round(elapsed / unitsInMs[unit]), unit);
81
85
  };
@@ -84,17 +88,24 @@ const DateTimeDisplay = forwardRef(({ value, variant, format = 'short', clockFor
84
88
  const endDate = getFormattedDate(getEndOfWeek(date), 'week');
85
89
  return `${t('week_text')} ${getWeek(date)}, ${getWeekYear(date)} (${startDate} - ${endDate})`;
86
90
  };
91
+ const getFormattedQuarterYear = (date) => {
92
+ const formattedYear = getFormattedDate(date, 'year');
93
+ const quarterNumber = getQuarter(date);
94
+ return `${t(`date_quarter_q${quarterNumber}`, [formattedYear])}`;
95
+ };
87
96
  const displayValue = (date) => {
88
97
  switch (variant) {
89
98
  case 'relative':
90
99
  return getRelativeTime(date);
91
100
  case 'week':
92
101
  return getFormattedWeek(date);
102
+ case 'quarteryear':
103
+ return getFormattedQuarterYear(date);
93
104
  default:
94
105
  return getFormattedDate(date, variant);
95
106
  }
96
107
  };
97
- return (_jsx("span", Object.assign({ ref: ref }, restProps, { children: value || value === 0 ? (displayValue(parseToDate(value))) : (_jsx("span", Object.assign({ "aria-hidden": 'true' }, { children: "\u2013\u2013" }), void 0)) }), void 0));
108
+ return (_jsx("span", { ref: ref, ...restProps, children: (value || value === 0) && isValidDate(parseToDate(value)) ? (displayValue(parseToDate(value))) : (_jsx("span", { "aria-hidden": 'true', children: "\u2013\u2013" }, void 0)) }, void 0));
98
109
  });
99
110
  export default DateTimeDisplay;
100
111
  //# sourceMappingURL=DateTimeDisplay.js.map