@pega/cosmos-react-core 7.0.0-build.9.1 → 7.0.0-rc.1

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 (750) hide show
  1. package/lib/components/AIButton/AIButton.d.ts +30 -2
  2. package/lib/components/AIButton/AIButton.d.ts.map +1 -1
  3. package/lib/components/AIButton/AIButton.js +7 -6
  4. package/lib/components/AIButton/AIButton.js.map +1 -1
  5. package/lib/components/Actions/Actions.d.ts +1 -1
  6. package/lib/components/Actions/Actions.d.ts.map +1 -1
  7. package/lib/components/Actions/Actions.js +6 -3
  8. package/lib/components/Actions/Actions.js.map +1 -1
  9. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  10. package/lib/components/AppShell/AppHeader.js +9 -7
  11. package/lib/components/AppShell/AppHeader.js.map +1 -1
  12. package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppHeader.styles.js +26 -19
  14. package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
  15. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  16. package/lib/components/AppShell/AppShell.js +17 -5
  17. package/lib/components/AppShell/AppShell.js.map +1 -1
  18. package/lib/components/AppShell/AppShell.styles.d.ts +5 -1
  19. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  20. package/lib/components/AppShell/AppShell.styles.js +50 -11
  21. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  22. package/lib/components/AppShell/AppShell.types.d.ts +4 -0
  23. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  24. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  25. package/lib/components/AppShell/AppShellContext.d.ts +3 -1
  26. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  27. package/lib/components/AppShell/AppShellContext.js +3 -1
  28. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  29. package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
  30. package/lib/components/AppShell/AppShellList.styles.js +1 -0
  31. package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
  32. package/lib/components/AppShell/AppShellSearch.styles.d.ts.map +1 -1
  33. package/lib/components/AppShell/AppShellSearch.styles.js +2 -0
  34. package/lib/components/AppShell/AppShellSearch.styles.js.map +1 -1
  35. package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
  36. package/lib/components/AppShell/NavigationList.js +3 -3
  37. package/lib/components/AppShell/NavigationList.js.map +1 -1
  38. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
  39. package/lib/components/AppShell/NavigationListItemWrapper.js +1 -0
  40. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
  41. package/lib/components/AppShell/Operator.d.ts +1 -1
  42. package/lib/components/AppShell/style-utils.d.ts +3 -0
  43. package/lib/components/AppShell/style-utils.d.ts.map +1 -1
  44. package/lib/components/AppShell/style-utils.js +40 -1
  45. package/lib/components/AppShell/style-utils.js.map +1 -1
  46. package/lib/components/Avatar/Avatar.d.ts +2 -2
  47. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  48. package/lib/components/Avatar/Avatar.js +19 -19
  49. package/lib/components/Avatar/Avatar.js.map +1 -1
  50. package/lib/components/Avatar/Avatar.test-ids.d.ts +1 -1
  51. package/lib/components/Avatar/Avatar.test-ids.d.ts.map +1 -1
  52. package/lib/components/Backdrop/Backdrop.d.ts +1 -1
  53. package/lib/components/Backdrop/Backdrop.test-ids.d.ts +1 -1
  54. package/lib/components/Backdrop/Backdrop.test-ids.d.ts.map +1 -1
  55. package/lib/components/Badges/Alert.d.ts +1 -1
  56. package/lib/components/Badges/Badges.test-ids.d.ts +6 -6
  57. package/lib/components/Badges/Badges.test-ids.d.ts.map +1 -1
  58. package/lib/components/Badges/Count.d.ts +1 -1
  59. package/lib/components/Badges/Keyboard.d.ts +1 -1
  60. package/lib/components/Badges/Selection.d.ts +1 -1
  61. package/lib/components/Badges/Selection.d.ts.map +1 -1
  62. package/lib/components/Badges/Selection.js +23 -20
  63. package/lib/components/Badges/Selection.js.map +1 -1
  64. package/lib/components/Badges/Status.d.ts +1 -1
  65. package/lib/components/Badges/Status.d.ts.map +1 -1
  66. package/lib/components/Badges/Status.js +0 -1
  67. package/lib/components/Badges/Status.js.map +1 -1
  68. package/lib/components/Badges/Tag.d.ts +1 -1
  69. package/lib/components/Banner/Banner.d.ts +1 -1
  70. package/lib/components/Banner/Banner.d.ts.map +1 -1
  71. package/lib/components/Banner/Banner.js +3 -1
  72. package/lib/components/Banner/Banner.js.map +1 -1
  73. package/lib/components/Banner/Banner.test-ids.d.ts +1 -1
  74. package/lib/components/Banner/Banner.test-ids.d.ts.map +1 -1
  75. package/lib/components/Button/Button.d.ts +1 -1
  76. package/lib/components/Button/Button.d.ts.map +1 -1
  77. package/lib/components/Button/Button.js +87 -58
  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 +8 -0
  81. package/lib/components/Card/Card.js.map +1 -1
  82. package/lib/components/Checkbox/Checkbox.d.ts +3 -33
  83. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  84. package/lib/components/Checkbox/Checkbox.js +1 -5
  85. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  86. package/lib/components/ColorPicker/ColorPicker.d.ts +6 -23
  87. package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  88. package/lib/components/ColorPicker/ColorPicker.js +3 -4
  89. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  90. package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts +1 -1
  91. package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts.map +1 -1
  92. package/lib/components/ComboBox/ComboBox.d.ts +2 -4
  93. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  94. package/lib/components/ComboBox/ComboBox.js +8 -5
  95. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  96. package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
  97. package/lib/components/ComboBox/ComboBox.styles.js +7 -1
  98. package/lib/components/ComboBox/ComboBox.styles.js.map +1 -1
  99. package/lib/components/ComboBox/ComboBox.types.d.ts +8 -26
  100. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  101. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  102. package/lib/components/ComboBox/ComboxBox.test-ids.d.ts +1 -1
  103. package/lib/components/ComboBox/ComboxBox.test-ids.d.ts.map +1 -1
  104. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  105. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +21 -32
  106. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  107. package/lib/components/CompositeInput/CompositeInput.d.ts +2 -3
  108. package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
  109. package/lib/components/CompositeInput/CompositeInput.js +2 -3
  110. package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
  111. package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts +1 -1
  112. package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts.map +1 -1
  113. package/lib/components/CompositeInput/CompositeInput.types.d.ts +4 -13
  114. package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -1
  115. package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -1
  116. package/lib/components/Configuration/Configuration.d.ts +1 -0
  117. package/lib/components/Configuration/Configuration.d.ts.map +1 -1
  118. package/lib/components/Configuration/Configuration.js +58 -30
  119. package/lib/components/Configuration/Configuration.js.map +1 -1
  120. package/lib/components/Configuration/ThemeOverride.d.ts +11 -0
  121. package/lib/components/Configuration/ThemeOverride.d.ts.map +1 -0
  122. package/lib/components/Configuration/ThemeOverride.js +23 -0
  123. package/lib/components/Configuration/ThemeOverride.js.map +1 -0
  124. package/lib/components/Configuration/connected-watcher.d.ts +17 -0
  125. package/lib/components/Configuration/connected-watcher.d.ts.map +1 -0
  126. package/lib/components/Configuration/connected-watcher.js +13 -0
  127. package/lib/components/Configuration/connected-watcher.js.map +1 -0
  128. package/lib/components/Configuration/index.d.ts +1 -0
  129. package/lib/components/Configuration/index.d.ts.map +1 -1
  130. package/lib/components/Configuration/index.js +1 -0
  131. package/lib/components/Configuration/index.js.map +1 -1
  132. package/lib/components/Configuration/withConfiguration.d.ts.map +1 -1
  133. package/lib/components/Configuration/withConfiguration.js.map +1 -1
  134. package/lib/components/CreditCard/CreditCard.types.d.ts +5 -25
  135. package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
  136. package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
  137. package/lib/components/CreditCard/CreditCardDisplay.d.ts +2 -4
  138. package/lib/components/CreditCard/CreditCardDisplay.d.ts.map +1 -1
  139. package/lib/components/CreditCard/CreditCardDisplay.js +1 -2
  140. package/lib/components/CreditCard/CreditCardDisplay.js.map +1 -1
  141. package/lib/components/CreditCard/CreditCardInput.d.ts +15 -5
  142. package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -1
  143. package/lib/components/CreditCard/CreditCardInput.js +1 -2
  144. package/lib/components/CreditCard/CreditCardInput.js.map +1 -1
  145. package/lib/components/Currency/Currency.test-ids.d.ts +1 -1
  146. package/lib/components/Currency/Currency.test-ids.d.ts.map +1 -1
  147. package/lib/components/Currency/CurrencyInput.d.ts +1 -1
  148. package/lib/components/Currency/CurrencyInput.js +1 -1
  149. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  150. package/lib/components/Currency/CurrencyInput.types.d.ts +1 -1
  151. package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
  152. package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
  153. package/lib/components/DangerButton/DangerButton.js +2 -2
  154. package/lib/components/DangerButton/DangerButton.js.map +1 -1
  155. package/lib/components/DateTime/DateTime.test-ids.d.ts +11 -11
  156. package/lib/components/DateTime/DateTime.test-ids.d.ts.map +1 -1
  157. package/lib/components/DateTime/DateTime.test-ids.js +5 -1
  158. package/lib/components/DateTime/DateTime.test-ids.js.map +1 -1
  159. package/lib/components/DateTime/Input/DateInput.d.ts +1 -1
  160. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  161. package/lib/components/DateTime/Input/DateInput.js +30 -27
  162. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  163. package/lib/components/DateTime/Input/DateRangeInput.d.ts +1 -1
  164. package/lib/components/DateTime/Input/DateRangeInput.js +2 -2
  165. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  166. package/lib/components/DateTime/Input/DateTime.styles.d.ts +1 -0
  167. package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
  168. package/lib/components/DateTime/Input/DateTime.styles.js +24 -16
  169. package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
  170. package/lib/components/DateTime/Input/DateTimeInput.d.ts +1 -1
  171. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  172. package/lib/components/DateTime/Input/DateTimeInput.js +26 -25
  173. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  174. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +1 -1
  175. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts +1 -1
  176. package/lib/components/DateTime/Input/MonthInput.d.ts +1 -1
  177. package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
  178. package/lib/components/DateTime/Input/MonthInput.js +21 -10
  179. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  180. package/lib/components/DateTime/Input/PartInput.d.ts +1 -1
  181. package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
  182. package/lib/components/DateTime/Input/PartInput.js +13 -7
  183. package/lib/components/DateTime/Input/PartInput.js.map +1 -1
  184. package/lib/components/DateTime/Input/QuarterInput.d.ts +1 -1
  185. package/lib/components/DateTime/Input/TimeInput.d.ts +1 -1
  186. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  187. package/lib/components/DateTime/Input/TimeInput.js +2 -7
  188. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  189. package/lib/components/DateTime/Input/TimeRangeInput.d.ts +1 -1
  190. package/lib/components/DateTime/Input/TimeRangeInput.js +3 -3
  191. package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
  192. package/lib/components/DateTime/Input/WeekInput.d.ts +1 -1
  193. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  194. package/lib/components/DateTime/Input/WeekInput.js +17 -6
  195. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  196. package/lib/components/DateTime/Input/utils.d.ts +2 -2
  197. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  198. package/lib/components/DateTime/Input/utils.js +5 -2
  199. package/lib/components/DateTime/Input/utils.js.map +1 -1
  200. package/lib/components/DateTime/Picker/DatePicker.d.ts +1 -1
  201. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  202. package/lib/components/DateTime/Picker/DatePicker.js +28 -17
  203. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  204. package/lib/components/DateTime/Picker/DatePicker.styles.d.ts +1 -0
  205. package/lib/components/DateTime/Picker/DatePicker.styles.d.ts.map +1 -1
  206. package/lib/components/DateTime/Picker/DatePicker.styles.js +13 -5
  207. package/lib/components/DateTime/Picker/DatePicker.styles.js.map +1 -1
  208. package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
  209. package/lib/components/DateTime/Picker/DateRangePicker.js +18 -11
  210. package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
  211. package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
  212. package/lib/components/DateTime/Picker/TimePicker.js +2 -1
  213. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  214. package/lib/components/DateTime/Picker/utils.d.ts +9 -0
  215. package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
  216. package/lib/components/DateTime/Picker/utils.js +16 -0
  217. package/lib/components/DateTime/Picker/utils.js.map +1 -1
  218. package/lib/components/DateTime/index.d.ts +1 -1
  219. package/lib/components/DateTime/index.d.ts.map +1 -1
  220. package/lib/components/DateTime/index.js +1 -1
  221. package/lib/components/DateTime/index.js.map +1 -1
  222. package/lib/components/DateTime/utils.d.ts +1 -0
  223. package/lib/components/DateTime/utils.d.ts.map +1 -1
  224. package/lib/components/DateTime/utils.js +13 -11
  225. package/lib/components/DateTime/utils.js.map +1 -1
  226. package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
  227. package/lib/components/Email/EmailDisplay.js +2 -2
  228. package/lib/components/Email/EmailDisplay.js.map +1 -1
  229. package/lib/components/EmptyState/EmptyState.d.ts.map +1 -1
  230. package/lib/components/EmptyState/EmptyState.js +5 -2
  231. package/lib/components/EmptyState/EmptyState.js.map +1 -1
  232. package/lib/components/FieldGroup/FieldGroup.d.ts +6 -0
  233. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  234. package/lib/components/FieldGroup/FieldGroup.js +37 -15
  235. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  236. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  237. package/lib/components/FieldGroup/FieldGroupList.js +39 -20
  238. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  239. package/lib/components/FieldValueList/FieldValueList.d.ts +14 -10
  240. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  241. package/lib/components/FieldValueList/FieldValueList.js +13 -5
  242. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  243. package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts +2 -2
  244. package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts.map +1 -1
  245. package/lib/components/FieldValueList/index.d.ts +1 -1
  246. package/lib/components/FieldValueList/index.d.ts.map +1 -1
  247. package/lib/components/FieldValueList/index.js.map +1 -1
  248. package/lib/components/File/CompactList.d.ts +15 -0
  249. package/lib/components/File/CompactList.d.ts.map +1 -0
  250. package/lib/components/File/CompactList.js +21 -0
  251. package/lib/components/File/CompactList.js.map +1 -0
  252. package/lib/components/File/File.test-ids.d.ts +1 -1
  253. package/lib/components/File/File.test-ids.d.ts.map +1 -1
  254. package/lib/components/File/FileDisplay.d.ts +5 -0
  255. package/lib/components/File/FileDisplay.d.ts.map +1 -1
  256. package/lib/components/File/FileDisplay.js +2 -2
  257. package/lib/components/File/FileDisplay.js.map +1 -1
  258. package/lib/components/File/FileDisplayList.d.ts +4 -2
  259. package/lib/components/File/FileDisplayList.d.ts.map +1 -1
  260. package/lib/components/File/FileDisplayList.js +9 -3
  261. package/lib/components/File/FileDisplayList.js.map +1 -1
  262. package/lib/components/File/FileInput.d.ts +32 -8
  263. package/lib/components/File/FileInput.d.ts.map +1 -1
  264. package/lib/components/File/FileInput.js +169 -74
  265. package/lib/components/File/FileInput.js.map +1 -1
  266. package/lib/components/File/FileInput.styles.d.ts +26 -0
  267. package/lib/components/File/FileInput.styles.d.ts.map +1 -0
  268. package/lib/components/File/FileInput.styles.js +166 -0
  269. package/lib/components/File/FileInput.styles.js.map +1 -0
  270. package/lib/components/File/FileItem.d.ts +16 -0
  271. package/lib/components/File/FileItem.d.ts.map +1 -1
  272. package/lib/components/File/FileItem.js +82 -27
  273. package/lib/components/File/FileItem.js.map +1 -1
  274. package/lib/components/File/FileList.d.ts +9 -3
  275. package/lib/components/File/FileList.d.ts.map +1 -1
  276. package/lib/components/File/FileList.js +53 -9
  277. package/lib/components/File/FileList.js.map +1 -1
  278. package/lib/components/File/FileUploadItem.d.ts +4 -0
  279. package/lib/components/File/FileUploadItem.d.ts.map +1 -1
  280. package/lib/components/File/FileUploadItem.js +42 -38
  281. package/lib/components/File/FileUploadItem.js.map +1 -1
  282. package/lib/components/Flex/Flex.js.map +1 -1
  283. package/lib/components/Form/Form.d.ts +1 -1
  284. package/lib/components/Form/Form.test-ids.d.ts +1 -1
  285. package/lib/components/Form/Form.test-ids.d.ts.map +1 -1
  286. package/lib/components/FormField/FormField.d.ts +2 -2
  287. package/lib/components/FormField/FormField.d.ts.map +1 -1
  288. package/lib/components/FormField/FormField.js +62 -64
  289. package/lib/components/FormField/FormField.js.map +1 -1
  290. package/lib/components/FormField/FormField.test-ids.d.ts +1 -1
  291. package/lib/components/FormField/FormField.test-ids.d.ts.map +1 -1
  292. package/lib/components/Fullscreen/Fullscreen.d.ts +18 -0
  293. package/lib/components/Fullscreen/Fullscreen.d.ts.map +1 -0
  294. package/lib/components/Fullscreen/Fullscreen.js +56 -0
  295. package/lib/components/Fullscreen/Fullscreen.js.map +1 -0
  296. package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts +2 -0
  297. package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts.map +1 -0
  298. package/lib/components/Fullscreen/Fullscreen.test-ids.js +3 -0
  299. package/lib/components/Fullscreen/Fullscreen.test-ids.js.map +1 -0
  300. package/lib/components/Fullscreen/FullscreenButton.d.ts +6 -0
  301. package/lib/components/Fullscreen/FullscreenButton.d.ts.map +1 -0
  302. package/lib/components/Fullscreen/FullscreenButton.js +33 -0
  303. package/lib/components/Fullscreen/FullscreenButton.js.map +1 -0
  304. package/lib/components/Fullscreen/index.d.ts +4 -0
  305. package/lib/components/Fullscreen/index.d.ts.map +1 -0
  306. package/lib/components/Fullscreen/index.js +4 -0
  307. package/lib/components/Fullscreen/index.js.map +1 -0
  308. package/lib/components/HTML/HTML.d.ts +1 -1
  309. package/lib/components/HTML/HTML.test-ids.d.ts +1 -1
  310. package/lib/components/HTML/HTML.test-ids.d.ts.map +1 -1
  311. package/lib/components/Icon/Icon.d.ts.map +1 -1
  312. package/lib/components/Icon/Icon.js +2 -2
  313. package/lib/components/Icon/Icon.js.map +1 -1
  314. package/lib/components/Icon/iconNames.d.ts +1 -1
  315. package/lib/components/Icon/iconNames.d.ts.map +1 -1
  316. package/lib/components/Icon/iconNames.js +2 -0
  317. package/lib/components/Icon/iconNames.js.map +1 -1
  318. package/lib/components/Icon/icons/calendar-now.icon.d.ts +5 -0
  319. package/lib/components/Icon/icons/calendar-now.icon.d.ts.map +1 -0
  320. package/lib/components/Icon/icons/calendar-now.icon.js +7 -0
  321. package/lib/components/Icon/icons/calendar-now.icon.js.map +1 -0
  322. package/lib/components/Icon/icons/preview.icon.d.ts +5 -0
  323. package/lib/components/Icon/icons/preview.icon.d.ts.map +1 -0
  324. package/lib/components/Icon/icons/preview.icon.js +7 -0
  325. package/lib/components/Icon/icons/preview.icon.js.map +1 -0
  326. package/lib/components/Icon/streamline-icons/arrow-down.icon.d.ts.map +1 -1
  327. package/lib/components/Icon/streamline-icons/arrow-down.icon.js +1 -1
  328. package/lib/components/Icon/streamline-icons/arrow-down.icon.js.map +1 -1
  329. package/lib/components/Icon/streamline-icons/arrow-left.icon.d.ts.map +1 -1
  330. package/lib/components/Icon/streamline-icons/arrow-left.icon.js +1 -1
  331. package/lib/components/Icon/streamline-icons/arrow-left.icon.js.map +1 -1
  332. package/lib/components/Icon/streamline-icons/arrow-right.icon.d.ts.map +1 -1
  333. package/lib/components/Icon/streamline-icons/arrow-right.icon.js +1 -1
  334. package/lib/components/Icon/streamline-icons/arrow-right.icon.js.map +1 -1
  335. package/lib/components/Icon/streamline-icons/arrow-up.icon.d.ts.map +1 -1
  336. package/lib/components/Icon/streamline-icons/arrow-up.icon.js +1 -1
  337. package/lib/components/Icon/streamline-icons/arrow-up.icon.js.map +1 -1
  338. package/lib/components/Icon/streamline-icons/calendar-now.icon.d.ts +5 -0
  339. package/lib/components/Icon/streamline-icons/calendar-now.icon.d.ts.map +1 -0
  340. package/lib/components/Icon/streamline-icons/calendar-now.icon.js +7 -0
  341. package/lib/components/Icon/streamline-icons/calendar-now.icon.js.map +1 -0
  342. package/lib/components/Icon/streamline-icons/caret-down.icon.d.ts.map +1 -1
  343. package/lib/components/Icon/streamline-icons/caret-down.icon.js +1 -1
  344. package/lib/components/Icon/streamline-icons/caret-down.icon.js.map +1 -1
  345. package/lib/components/Icon/streamline-icons/caret-left.icon.d.ts.map +1 -1
  346. package/lib/components/Icon/streamline-icons/caret-left.icon.js +1 -1
  347. package/lib/components/Icon/streamline-icons/caret-left.icon.js.map +1 -1
  348. package/lib/components/Icon/streamline-icons/caret-right.icon.d.ts.map +1 -1
  349. package/lib/components/Icon/streamline-icons/caret-right.icon.js +1 -1
  350. package/lib/components/Icon/streamline-icons/caret-right.icon.js.map +1 -1
  351. package/lib/components/Icon/streamline-icons/caret-up.icon.d.ts.map +1 -1
  352. package/lib/components/Icon/streamline-icons/caret-up.icon.js +1 -1
  353. package/lib/components/Icon/streamline-icons/caret-up.icon.js.map +1 -1
  354. package/lib/components/Icon/streamline-icons/case-solid.icon.js +1 -1
  355. package/lib/components/Icon/streamline-icons/case-solid.icon.js.map +1 -1
  356. package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js +1 -1
  357. package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js.map +1 -1
  358. package/lib/components/Icon/streamline-icons/clock-solid.icon.js +1 -1
  359. package/lib/components/Icon/streamline-icons/clock-solid.icon.js.map +1 -1
  360. package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.d.ts.map +1 -1
  361. package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.js +1 -1
  362. package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.js.map +1 -1
  363. package/lib/components/Icon/streamline-icons/dock.icon.d.ts +5 -0
  364. package/lib/components/Icon/streamline-icons/dock.icon.d.ts.map +1 -0
  365. package/lib/components/Icon/streamline-icons/dock.icon.js +7 -0
  366. package/lib/components/Icon/streamline-icons/dock.icon.js.map +1 -0
  367. package/lib/components/Icon/streamline-icons/expression.icon.d.ts +5 -0
  368. package/lib/components/Icon/streamline-icons/expression.icon.d.ts.map +1 -0
  369. package/lib/components/Icon/streamline-icons/expression.icon.js +7 -0
  370. package/lib/components/Icon/streamline-icons/expression.icon.js.map +1 -0
  371. package/lib/components/Icon/streamline-icons/indent.icon.d.ts +5 -0
  372. package/lib/components/Icon/streamline-icons/indent.icon.d.ts.map +1 -0
  373. package/lib/components/Icon/streamline-icons/indent.icon.js +7 -0
  374. package/lib/components/Icon/streamline-icons/indent.icon.js.map +1 -0
  375. package/lib/components/Icon/streamline-icons/information-solid.icon.js +1 -1
  376. package/lib/components/Icon/streamline-icons/information-solid.icon.js.map +1 -1
  377. package/lib/components/Icon/streamline-icons/list-number.icon.d.ts +5 -0
  378. package/lib/components/Icon/streamline-icons/list-number.icon.d.ts.map +1 -0
  379. package/lib/components/Icon/streamline-icons/list-number.icon.js +7 -0
  380. package/lib/components/Icon/streamline-icons/list-number.icon.js.map +1 -0
  381. package/lib/components/Icon/streamline-icons/open.icon.d.ts.map +1 -1
  382. package/lib/components/Icon/streamline-icons/open.icon.js +1 -1
  383. package/lib/components/Icon/streamline-icons/open.icon.js.map +1 -1
  384. package/lib/components/Icon/streamline-icons/rule-library-solid.icon.js +1 -1
  385. package/lib/components/Icon/streamline-icons/rule-library-solid.icon.js.map +1 -1
  386. package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.js +1 -1
  387. package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.js.map +1 -1
  388. package/lib/components/Icon/streamline-icons/undock.icon.d.ts +5 -0
  389. package/lib/components/Icon/streamline-icons/undock.icon.d.ts.map +1 -0
  390. package/lib/components/Icon/streamline-icons/undock.icon.js +7 -0
  391. package/lib/components/Icon/streamline-icons/undock.icon.js.map +1 -0
  392. package/lib/components/Icon/streamline-icons/unindent.icon.d.ts +5 -0
  393. package/lib/components/Icon/streamline-icons/unindent.icon.d.ts.map +1 -0
  394. package/lib/components/Icon/streamline-icons/unindent.icon.js +7 -0
  395. package/lib/components/Icon/streamline-icons/unindent.icon.js.map +1 -0
  396. package/lib/components/Icon/streamline-icons/warn-solid.icon.js +1 -1
  397. package/lib/components/Icon/streamline-icons/warn-solid.icon.js.map +1 -1
  398. package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
  399. package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
  400. package/lib/components/Icon/streamlineIconNames.js +7 -0
  401. package/lib/components/Icon/streamlineIconNames.js.map +1 -1
  402. package/lib/components/IconPicker/IconPicker.d.ts +7 -1
  403. package/lib/components/IconPicker/IconPicker.d.ts.map +1 -1
  404. package/lib/components/IconPicker/IconPicker.js +20 -14
  405. package/lib/components/IconPicker/IconPicker.js.map +1 -1
  406. package/lib/components/Input/Input.d.ts +5 -8
  407. package/lib/components/Input/Input.d.ts.map +1 -1
  408. package/lib/components/Input/Input.js +2 -3
  409. package/lib/components/Input/Input.js.map +1 -1
  410. package/lib/components/Input/Input.test-ids.d.ts +1 -1
  411. package/lib/components/Input/Input.test-ids.d.ts.map +1 -1
  412. package/lib/components/Lightbox/Lightbox.d.ts +1 -1
  413. package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
  414. package/lib/components/Lightbox/Lightbox.js +13 -6
  415. package/lib/components/Lightbox/Lightbox.js.map +1 -1
  416. package/lib/components/Lightbox/Lightbox.styles.d.ts +1 -1
  417. package/lib/components/Lightbox/Lightbox.test-ids.d.ts +1 -1
  418. package/lib/components/Lightbox/Lightbox.test-ids.d.ts.map +1 -1
  419. package/lib/components/Lightbox/Lightbox.types.d.ts +1 -1
  420. package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
  421. package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
  422. package/lib/components/Link/Link.d.ts +5 -2
  423. package/lib/components/Link/Link.d.ts.map +1 -1
  424. package/lib/components/Link/Link.js +45 -17
  425. package/lib/components/Link/Link.js.map +1 -1
  426. package/lib/components/Link/Link.test-ids.d.ts +1 -1
  427. package/lib/components/Link/Link.test-ids.d.ts.map +1 -1
  428. package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
  429. package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
  430. package/lib/components/ListToolbar/ListToolbar.js +8 -7
  431. package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
  432. package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
  433. package/lib/components/ListToolbar/ListToolbar.styles.js +5 -5
  434. package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
  435. package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +1 -1
  436. package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -1
  437. package/lib/components/ListToolbar/ListToolbar.test-ids.js +4 -1
  438. package/lib/components/ListToolbar/ListToolbar.test-ids.js.map +1 -1
  439. package/lib/components/ListToolbar/ListToolbar.types.d.ts +7 -3
  440. package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
  441. package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
  442. package/lib/components/ListToolbar/PresetMenuPopover.d.ts.map +1 -1
  443. package/lib/components/ListToolbar/PresetMenuPopover.js +2 -2
  444. package/lib/components/ListToolbar/PresetMenuPopover.js.map +1 -1
  445. package/lib/components/ListToolbar/helpers.d.ts.map +1 -1
  446. package/lib/components/ListToolbar/helpers.js.map +1 -1
  447. package/lib/components/Location/CurrentLocationButton.d.ts +1 -6
  448. package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
  449. package/lib/components/Location/CurrentLocationButton.js +10 -20
  450. package/lib/components/Location/CurrentLocationButton.js.map +1 -1
  451. package/lib/components/Location/Location.test-ids.d.ts +1 -1
  452. package/lib/components/Location/Location.test-ids.d.ts.map +1 -1
  453. package/lib/components/Location/Location.types.d.ts +49 -17
  454. package/lib/components/Location/Location.types.d.ts.map +1 -1
  455. package/lib/components/Location/Location.types.js +9 -1
  456. package/lib/components/Location/Location.types.js.map +1 -1
  457. package/lib/components/Location/LocationDisplay.d.ts +5 -4
  458. package/lib/components/Location/LocationDisplay.d.ts.map +1 -1
  459. package/lib/components/Location/LocationDisplay.js +17 -4
  460. package/lib/components/Location/LocationDisplay.js.map +1 -1
  461. package/lib/components/Location/LocationInput.d.ts +23 -18
  462. package/lib/components/Location/LocationInput.d.ts.map +1 -1
  463. package/lib/components/Location/LocationInput.js +37 -15
  464. package/lib/components/Location/LocationInput.js.map +1 -1
  465. package/lib/components/Location/LocationView.d.ts +26 -12
  466. package/lib/components/Location/LocationView.d.ts.map +1 -1
  467. package/lib/components/Location/LocationView.js +103 -50
  468. package/lib/components/Location/LocationView.js.map +1 -1
  469. package/lib/components/Location/index.d.ts +2 -2
  470. package/lib/components/Location/index.d.ts.map +1 -1
  471. package/lib/components/Location/index.js +1 -1
  472. package/lib/components/Location/index.js.map +1 -1
  473. package/lib/components/Location/utils.d.ts +2 -2
  474. package/lib/components/Location/utils.d.ts.map +1 -1
  475. package/lib/components/Location/utils.js +67 -38
  476. package/lib/components/Location/utils.js.map +1 -1
  477. package/lib/components/Menu/Menu.context.d.ts.map +1 -1
  478. package/lib/components/Menu/Menu.context.js +1 -0
  479. package/lib/components/Menu/Menu.context.js.map +1 -1
  480. package/lib/components/Menu/Menu.d.ts +1 -1
  481. package/lib/components/Menu/Menu.d.ts.map +1 -1
  482. package/lib/components/Menu/Menu.js +6 -2
  483. package/lib/components/Menu/Menu.js.map +1 -1
  484. package/lib/components/Menu/Menu.styles.d.ts +0 -1
  485. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  486. package/lib/components/Menu/Menu.styles.js +2 -9
  487. package/lib/components/Menu/Menu.styles.js.map +1 -1
  488. package/lib/components/Menu/Menu.test-ids.d.ts +2 -2
  489. package/lib/components/Menu/Menu.test-ids.d.ts.map +1 -1
  490. package/lib/components/Menu/Menu.types.d.ts +14 -2
  491. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  492. package/lib/components/Menu/Menu.types.js.map +1 -1
  493. package/lib/components/Menu/Menu.utils.d.ts +4 -0
  494. package/lib/components/Menu/Menu.utils.d.ts.map +1 -0
  495. package/lib/components/Menu/Menu.utils.js +6 -0
  496. package/lib/components/Menu/Menu.utils.js.map +1 -0
  497. package/lib/components/Menu/MenuGroup.js +2 -2
  498. package/lib/components/Menu/MenuGroup.js.map +1 -1
  499. package/lib/components/Menu/MenuItem.d.ts +1 -1
  500. package/lib/components/Menu/MenuItem.d.ts.map +1 -1
  501. package/lib/components/Menu/MenuItem.js +3 -3
  502. package/lib/components/Menu/MenuItem.js.map +1 -1
  503. package/lib/components/Menu/MenuList.d.ts.map +1 -1
  504. package/lib/components/Menu/MenuList.js +3 -3
  505. package/lib/components/Menu/MenuList.js.map +1 -1
  506. package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
  507. package/lib/components/Menu/NavItemsList.js +1 -3
  508. package/lib/components/Menu/NavItemsList.js.map +1 -1
  509. package/lib/components/Menu/index.d.ts +1 -0
  510. package/lib/components/Menu/index.d.ts.map +1 -1
  511. package/lib/components/Menu/index.js +1 -0
  512. package/lib/components/Menu/index.js.map +1 -1
  513. package/lib/components/MenuButton/MenuButton.d.ts +8 -1
  514. package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
  515. package/lib/components/MenuButton/MenuButton.js +24 -14
  516. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  517. package/lib/components/MenuButton/MenuButton.test-ids.d.ts +1 -1
  518. package/lib/components/MenuButton/MenuButton.test-ids.d.ts.map +1 -1
  519. package/lib/components/MetaList/MetaList.d.ts +1 -1
  520. package/lib/components/MetaList/MetaList.test-ids.d.ts +1 -1
  521. package/lib/components/MetaList/MetaList.test-ids.d.ts.map +1 -1
  522. package/lib/components/Modal/Modal.d.ts.map +1 -1
  523. package/lib/components/Modal/Modal.js +31 -7
  524. package/lib/components/Modal/Modal.js.map +1 -1
  525. package/lib/components/Modal/Modal.styles.d.ts +3 -1
  526. package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
  527. package/lib/components/Modal/Modal.styles.js +34 -17
  528. package/lib/components/Modal/Modal.styles.js.map +1 -1
  529. package/lib/components/Modal/ModalManager.d.ts.map +1 -1
  530. package/lib/components/Modal/ModalManager.js +5 -1
  531. package/lib/components/Modal/ModalManager.js.map +1 -1
  532. package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
  533. package/lib/components/MultiStepForm/MultiStepForm.js +28 -1
  534. package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
  535. package/lib/components/Number/Number.test-ids.d.ts +2 -2
  536. package/lib/components/Number/Number.test-ids.d.ts.map +1 -1
  537. package/lib/components/Number/NumberDisplay.d.ts +5 -8
  538. package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
  539. package/lib/components/Number/NumberDisplay.js +1 -2
  540. package/lib/components/Number/NumberDisplay.js.map +1 -1
  541. package/lib/components/Number/NumberInput.d.ts +2 -4
  542. package/lib/components/Number/NumberInput.d.ts.map +1 -1
  543. package/lib/components/Number/NumberInput.js +15 -7
  544. package/lib/components/Number/NumberInput.js.map +1 -1
  545. package/lib/components/Number/NumberInput.types.d.ts +12 -30
  546. package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
  547. package/lib/components/Number/NumberInput.types.js.map +1 -1
  548. package/lib/components/Number/NumberRangeInput.d.ts +2 -4
  549. package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
  550. package/lib/components/Number/NumberRangeInput.js +7 -72
  551. package/lib/components/Number/NumberRangeInput.js.map +1 -1
  552. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +3 -1
  553. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
  554. package/lib/components/PageTemplates/CategorySubPage.styles.js +2 -0
  555. package/lib/components/PageTemplates/CategorySubPage.styles.js.map +1 -1
  556. package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
  557. package/lib/components/PageTemplates/DashboardPage.js +41 -6
  558. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  559. package/lib/components/PageTemplates/PageTemplates.d.ts +1 -0
  560. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  561. package/lib/components/PageTemplates/PageTemplates.js +85 -31
  562. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  563. package/lib/components/Phone/Phone.test-ids.d.ts +1 -1
  564. package/lib/components/Phone/Phone.test-ids.d.ts.map +1 -1
  565. package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
  566. package/lib/components/Phone/PhoneDisplay.js +2 -2
  567. package/lib/components/Phone/PhoneDisplay.js.map +1 -1
  568. package/lib/components/Phone/PhoneInput.d.ts +1 -1
  569. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  570. package/lib/components/Phone/PhoneInput.js +20 -5
  571. package/lib/components/Phone/PhoneInput.js.map +1 -1
  572. package/lib/components/Popover/Popover.d.ts +2 -0
  573. package/lib/components/Popover/Popover.d.ts.map +1 -1
  574. package/lib/components/Popover/Popover.js +20 -3
  575. package/lib/components/Popover/Popover.js.map +1 -1
  576. package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
  577. package/lib/components/Popover/Popover.styles.js +2 -2
  578. package/lib/components/Popover/Popover.styles.js.map +1 -1
  579. package/lib/components/Popover/modifiers.d.ts.map +1 -1
  580. package/lib/components/Popover/modifiers.js +11 -5
  581. package/lib/components/Popover/modifiers.js.map +1 -1
  582. package/lib/components/Progress/Progress.d.ts.map +1 -1
  583. package/lib/components/Progress/Progress.js +2 -2
  584. package/lib/components/Progress/Progress.js.map +1 -1
  585. package/lib/components/Progress/Progress.styles.d.ts +1 -1
  586. package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
  587. package/lib/components/Progress/Progress.styles.js +7 -7
  588. package/lib/components/Progress/Progress.styles.js.map +1 -1
  589. package/lib/components/Progress/Progress.types.d.ts +4 -0
  590. package/lib/components/Progress/Progress.types.d.ts.map +1 -1
  591. package/lib/components/Progress/Progress.types.js.map +1 -1
  592. package/lib/components/RadioCheck/RadioCheck.d.ts +6 -30
  593. package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
  594. package/lib/components/RadioCheck/RadioCheck.js +1 -2
  595. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  596. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
  597. package/lib/components/RadioCheckGroup/RadioCheckGroup.js +1 -1
  598. package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
  599. package/lib/components/SearchInput/SearchInput.d.ts +19 -6
  600. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  601. package/lib/components/SearchInput/SearchInput.js +5 -1
  602. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  603. package/lib/components/SearchInput/SearchInput.styles.d.ts +3 -3
  604. package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
  605. package/lib/components/SearchInput/SearchInput.styles.js +15 -15
  606. package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
  607. package/lib/components/Select/Select.d.ts +1 -1
  608. package/lib/components/Select/Select.test-ids.d.ts +1 -1
  609. package/lib/components/Select/Select.test-ids.d.ts.map +1 -1
  610. package/lib/components/Slider/Slider.d.ts +1 -1
  611. package/lib/components/Slider/Slider.js +1 -1
  612. package/lib/components/Slider/Slider.js.map +1 -1
  613. package/lib/components/Slider/Slider.styles.d.ts +1 -1
  614. package/lib/components/Slider/Slider.test-ids.d.ts +1 -1
  615. package/lib/components/Slider/Slider.test-ids.d.ts.map +1 -1
  616. package/lib/components/SummaryItem/SummaryItem.d.ts +6 -1
  617. package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
  618. package/lib/components/SummaryItem/SummaryItem.js +13 -5
  619. package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
  620. package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts +1 -1
  621. package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts.map +1 -1
  622. package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
  623. package/lib/components/SummaryList/SummaryList.js +9 -9
  624. package/lib/components/SummaryList/SummaryList.js.map +1 -1
  625. package/lib/components/Tabs/Tab.d.ts +7 -3
  626. package/lib/components/Tabs/Tab.d.ts.map +1 -1
  627. package/lib/components/Tabs/Tab.js +83 -23
  628. package/lib/components/Tabs/Tab.js.map +1 -1
  629. package/lib/components/Tabs/TabPanel.d.ts +13 -2
  630. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  631. package/lib/components/Tabs/TabPanel.js +60 -5
  632. package/lib/components/Tabs/TabPanel.js.map +1 -1
  633. package/lib/components/Tabs/Tabs.d.ts +0 -1
  634. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  635. package/lib/components/Tabs/Tabs.js +97 -35
  636. package/lib/components/Tabs/Tabs.js.map +1 -1
  637. package/lib/components/Tabs/Tabs.styles.d.ts +17 -0
  638. package/lib/components/Tabs/Tabs.styles.d.ts.map +1 -0
  639. package/lib/components/Tabs/Tabs.styles.js +110 -0
  640. package/lib/components/Tabs/Tabs.styles.js.map +1 -0
  641. package/lib/components/Tabs/TabsContext.d.ts +6 -0
  642. package/lib/components/Tabs/TabsContext.d.ts.map +1 -0
  643. package/lib/components/Tabs/TabsContext.js +6 -0
  644. package/lib/components/Tabs/TabsContext.js.map +1 -0
  645. package/lib/components/Tabs/index.d.ts +1 -0
  646. package/lib/components/Tabs/index.d.ts.map +1 -1
  647. package/lib/components/Tabs/index.js +1 -0
  648. package/lib/components/Tabs/index.js.map +1 -1
  649. package/lib/components/Text/Text.js +1 -1
  650. package/lib/components/Text/Text.js.map +1 -1
  651. package/lib/components/TextArea/TextArea.d.ts +1 -1
  652. package/lib/components/TextArea/TextArea.test-ids.d.ts +1 -1
  653. package/lib/components/TextArea/TextArea.test-ids.d.ts.map +1 -1
  654. package/lib/components/Toaster/Toaster.d.ts +1 -1
  655. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  656. package/lib/components/Toaster/Toaster.js +117 -21
  657. package/lib/components/Toaster/Toaster.js.map +1 -1
  658. package/lib/components/Toaster/Toaster.test-ids.d.ts +1 -1
  659. package/lib/components/Toaster/Toaster.test-ids.d.ts.map +1 -1
  660. package/lib/components/Toaster/Toaster.types.d.ts +17 -4
  661. package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
  662. package/lib/components/Toaster/Toaster.types.js.map +1 -1
  663. package/lib/components/Tooltip/Tooltip.d.ts +8 -3
  664. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  665. package/lib/components/Tooltip/Tooltip.js +20 -5
  666. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  667. package/lib/components/Tooltip/Tooltip.test-ids.d.ts +1 -1
  668. package/lib/components/Tooltip/Tooltip.test-ids.d.ts.map +1 -1
  669. package/lib/components/Tree/StandardTree.styles.d.ts +1 -1
  670. package/lib/components/Tree/Tree.d.ts +1 -1
  671. package/lib/components/Tree/Tree.test-ids.d.ts +2 -2
  672. package/lib/components/Tree/Tree.test-ids.d.ts.map +1 -1
  673. package/lib/hooks/index.d.ts +2 -0
  674. package/lib/hooks/index.d.ts.map +1 -1
  675. package/lib/hooks/index.js +2 -0
  676. package/lib/hooks/index.js.map +1 -1
  677. package/lib/hooks/useArrows.d.ts.map +1 -1
  678. package/lib/hooks/useArrows.js +3 -1
  679. package/lib/hooks/useArrows.js.map +1 -1
  680. package/lib/hooks/useEvent.d.ts +5 -0
  681. package/lib/hooks/useEvent.d.ts.map +1 -1
  682. package/lib/hooks/useEvent.js.map +1 -1
  683. package/lib/hooks/useFocusWithin.d.ts.map +1 -1
  684. package/lib/hooks/useFocusWithin.js +14 -8
  685. package/lib/hooks/useFocusWithin.js.map +1 -1
  686. package/lib/hooks/useI18n.d.ts +155 -4
  687. package/lib/hooks/useI18n.d.ts.map +1 -1
  688. package/lib/hooks/useRefMap.d.ts +8 -0
  689. package/lib/hooks/useRefMap.d.ts.map +1 -0
  690. package/lib/hooks/useRefMap.js +27 -0
  691. package/lib/hooks/useRefMap.js.map +1 -0
  692. package/lib/hooks/useScrollToggle.d.ts.map +1 -1
  693. package/lib/hooks/useScrollToggle.js +1 -0
  694. package/lib/hooks/useScrollToggle.js.map +1 -1
  695. package/lib/hooks/useSimpleStoreInstance.d.ts +9 -0
  696. package/lib/hooks/useSimpleStoreInstance.d.ts.map +1 -0
  697. package/lib/hooks/useSimpleStoreInstance.js +13 -0
  698. package/lib/hooks/useSimpleStoreInstance.js.map +1 -0
  699. package/lib/hooks/useTestIds.d.ts +1 -1
  700. package/lib/hooks/useTestIds.d.ts.map +1 -1
  701. package/lib/hooks/useTestIds.js +1 -1
  702. package/lib/hooks/useTestIds.js.map +1 -1
  703. package/lib/i18n/default.d.ts +155 -4
  704. package/lib/i18n/default.d.ts.map +1 -1
  705. package/lib/i18n/default.js +178 -11
  706. package/lib/i18n/default.js.map +1 -1
  707. package/lib/i18n/i18n.d.ts +155 -4
  708. package/lib/i18n/i18n.d.ts.map +1 -1
  709. package/lib/index.d.ts +2 -0
  710. package/lib/index.d.ts.map +1 -1
  711. package/lib/index.js +2 -0
  712. package/lib/index.js.map +1 -1
  713. package/lib/styles/GlobalStyle.d.ts +1 -1
  714. package/lib/styles/GlobalStyle.d.ts.map +1 -1
  715. package/lib/styles/GlobalStyle.js +6 -1
  716. package/lib/styles/GlobalStyle.js.map +1 -1
  717. package/lib/styles/mixins.d.ts +3 -0
  718. package/lib/styles/mixins.d.ts.map +1 -0
  719. package/lib/styles/mixins.js +14 -0
  720. package/lib/styles/mixins.js.map +1 -0
  721. package/lib/theme/ThemeMachine.d.ts.map +1 -1
  722. package/lib/theme/ThemeMachine.js.map +1 -1
  723. package/lib/theme/theme.d.ts +18 -24
  724. package/lib/theme/theme.d.ts.map +1 -1
  725. package/lib/theme/themeDefinition.json +9 -14
  726. package/lib/theme/themeOverrides.schema.json +13 -18
  727. package/lib/types/types.d.ts +6 -4
  728. package/lib/types/types.d.ts.map +1 -1
  729. package/lib/types/types.js.map +1 -1
  730. package/lib/utils/createStringMatcher.d.ts +1 -1
  731. package/lib/utils/createStringMatcher.d.ts.map +1 -1
  732. package/lib/utils/createStringMatcher.js +4 -1
  733. package/lib/utils/createStringMatcher.js.map +1 -1
  734. package/lib/utils/formatListToLocaleString.d.ts.map +1 -1
  735. package/lib/utils/formatListToLocaleString.js +5 -2
  736. package/lib/utils/formatListToLocaleString.js.map +1 -1
  737. package/lib/utils/index.d.ts +1 -0
  738. package/lib/utils/index.d.ts.map +1 -1
  739. package/lib/utils/index.js +1 -0
  740. package/lib/utils/index.js.map +1 -1
  741. package/lib/utils/isPositionWithinRect.d.ts +12 -0
  742. package/lib/utils/isPositionWithinRect.d.ts.map +1 -0
  743. package/lib/utils/isPositionWithinRect.js +11 -0
  744. package/lib/utils/isPositionWithinRect.js.map +1 -0
  745. package/lib/utils/withTestIds.d.ts +1 -1
  746. package/package.json +10 -7
  747. package/lib/components/Location/types.d.ts +0 -45
  748. package/lib/components/Location/types.d.ts.map +0 -1
  749. package/lib/components/Location/types.js +0 -10
  750. package/lib/components/Location/types.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Number.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Number/Number.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,yLAKvB,CAAC;AAEZ,eAAO,MAAM,qBAAqB,2KAIvB,CAAC"}
1
+ {"version":3,"file":"Number.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Number/Number.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,gMAKvB,CAAC;AAEZ,eAAO,MAAM,qBAAqB,kLAIvB,CAAC"}
@@ -1,6 +1,5 @@
1
- import type { FunctionComponent, Ref } from 'react';
2
- import type { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
3
- export interface NumberDisplayProps extends BaseProps, NoChildrenProp {
1
+ import type { NoChildrenProp, WithAttributes } from '../../types';
2
+ export type NumberDisplayProps = WithAttributes<'span', NoChildrenProp & {
4
3
  /** Number value */
5
4
  value?: number | bigint;
6
5
  /** Unit to be included in the text, for example '%' */
@@ -23,9 +22,7 @@ export interface NumberDisplayProps extends BaseProps, NoChildrenProp {
23
22
  */
24
23
  groupSeparators?: boolean;
25
24
  };
26
- /** Ref for the wrapping element. */
27
- ref?: Ref<HTMLSpanElement>;
28
- }
29
- declare const NumberDisplay: FunctionComponent<NumberDisplayProps & ForwardProps>;
30
- export default NumberDisplay;
25
+ }>;
26
+ declare const _default: import("react").ForwardRefExoticComponent<Omit<NumberDisplayProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
27
+ export default _default;
31
28
  //# sourceMappingURL=NumberDisplay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumberDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/Number/NumberDisplay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAM3E,MAAM,WAAW,kBAAmB,SAAQ,SAAS,EAAE,cAAc;IACnE,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,iBAAiB,CAAC,EAAE;QAClB;;;WAGG;QACH,QAAQ,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;QAClC;;;;WAIG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB;;;WAGG;QACH,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;IACF,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B;AAED,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CA+BvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"NumberDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/Number/NumberDisplay.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAc,cAAc,EAAE,MAAM,aAAa,CAAC;AAM9E,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAC7C,MAAM,EACN,cAAc,GAAG;IACf,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,iBAAiB,CAAC,EAAE;QAClB;;;WAGG;QACH,QAAQ,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;QAClC;;;;WAIG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB;;;WAGG;QACH,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;CACH,CACF,CAAC;;AAEF,wBA+BE"}
@@ -3,7 +3,7 @@ import { forwardRef } from 'react';
3
3
  import { useConfiguration } from '../../hooks';
4
4
  import NoValue from '../NoValue/NoValue';
5
5
  import { getFraction, getFormattedValue } from './utils';
6
- const NumberDisplay = forwardRef(function NumberDisplay({ value, unit = '', formattingOptions: { fractionDigits = getFraction(String(value)).substring(1).length, notation, groupSeparators = true } = {}, ...restProps }, ref) {
6
+ export default forwardRef(function NumberDisplay({ value, unit = '', formattingOptions: { fractionDigits = getFraction(String(value)).substring(1).length, notation, groupSeparators = true } = {}, ...restProps }, ref) {
7
7
  const { locale } = useConfiguration();
8
8
  return (_jsx("span", { ref: ref, ...restProps, children: value || value === 0 ? (getFormattedValue(value.toString(), locale, unit, {
9
9
  notation,
@@ -12,5 +12,4 @@ const NumberDisplay = forwardRef(function NumberDisplay({ value, unit = '', form
12
12
  minimumFractionDigits: fractionDigits
13
13
  })) : (_jsx(NoValue, {})) }));
14
14
  });
15
- export default NumberDisplay;
16
15
  //# sourceMappingURL=NumberDisplay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumberDisplay.js","sourceRoot":"","sources":["../../../src/components/Number/NumberDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA8BzD,MAAM,aAAa,GAAyD,UAAU,CACpF,SAAS,aAAa,CACpB,EACE,KAAK,EACL,IAAI,GAAG,EAAE,EACT,iBAAiB,EAAE,EACjB,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EAC/D,QAAQ,EACR,eAAe,GAAG,IAAI,EACvB,GAAG,EAAE,EACN,GAAG,SAAS,EACwB,EACtC,GAA8B;IAE9B,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAEtC,OAAO,CACL,eAAM,GAAG,EAAE,GAAG,KAAM,SAAS,YAC1B,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CACtB,iBAAiB,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;YAChD,QAAQ;YACR,WAAW,EAAE,eAAe;YAC5B,qBAAqB,EAAE,cAAc;YACrC,qBAAqB,EAAE,cAAc;SACtC,CAAC,CACH,CAAC,CAAC,CAAC,CACF,KAAC,OAAO,KAAG,CACZ,GACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, Ref } from 'react';\n\nimport type { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { useConfiguration } from '../../hooks';\nimport NoValue from '../NoValue/NoValue';\n\nimport { getFraction, getFormattedValue } from './utils';\n\nexport interface NumberDisplayProps extends BaseProps, NoChildrenProp {\n /** Number value */\n value?: number | bigint;\n /** Unit to be included in the text, for example '%' */\n unit?: string;\n\n formattingOptions?: {\n /**\n * Value display notation.\n * @default 'standard'\n */\n notation?: 'standard' | 'compact';\n /**\n * Determines the fixed number of fraction digits. The value is rounded to the given precision.\n * Maximum is 20, default is value precision.\n * @default variable\n */\n fractionDigits?: number;\n /**\n * Determines whether group separators should be shown.\n * @default true\n */\n groupSeparators?: boolean;\n };\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLSpanElement>;\n}\n\nconst NumberDisplay: FunctionComponent<NumberDisplayProps & ForwardProps> = forwardRef(\n function NumberDisplay(\n {\n value,\n unit = '',\n formattingOptions: {\n fractionDigits = getFraction(String(value)).substring(1).length,\n notation,\n groupSeparators = true\n } = {},\n ...restProps\n }: PropsWithoutRef<NumberDisplayProps>,\n ref: NumberDisplayProps['ref']\n ) {\n const { locale } = useConfiguration();\n\n return (\n <span ref={ref} {...restProps}>\n {value || value === 0 ? (\n getFormattedValue(value.toString(), locale, unit, {\n notation,\n useGrouping: groupSeparators,\n maximumFractionDigits: fractionDigits,\n minimumFractionDigits: fractionDigits\n })\n ) : (\n <NoValue />\n )}\n </span>\n );\n }\n);\n\nexport default NumberDisplay;\n"]}
1
+ {"version":3,"file":"NumberDisplay.js","sourceRoot":"","sources":["../../../src/components/Number/NumberDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA+BzD,eAAe,UAAU,CACvB,SAAS,aAAa,CACpB,EACE,KAAK,EACL,IAAI,GAAG,EAAE,EACT,iBAAiB,EAAE,EACjB,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EAC/D,QAAQ,EACR,eAAe,GAAG,IAAI,EACvB,GAAG,EAAE,EACN,GAAG,SAAS,EACb,EACD,GAAG;IAEH,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAEtC,OAAO,CACL,eAAM,GAAG,EAAE,GAAG,KAAM,SAAS,YAC1B,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CACtB,iBAAiB,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;YAChD,QAAQ;YACR,WAAW,EAAE,eAAe;YAC5B,qBAAqB,EAAE,cAAc;YACrC,qBAAqB,EAAE,cAAc;SACtC,CAAC,CACH,CAAC,CAAC,CAAC,CACF,KAAC,OAAO,KAAG,CACZ,GACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport type { NoChildrenProp, RefElement, WithAttributes } from '../../types';\nimport { useConfiguration } from '../../hooks';\nimport NoValue from '../NoValue/NoValue';\n\nimport { getFraction, getFormattedValue } from './utils';\n\nexport type NumberDisplayProps = WithAttributes<\n 'span',\n NoChildrenProp & {\n /** Number value */\n value?: number | bigint;\n /** Unit to be included in the text, for example '%' */\n unit?: string;\n\n formattingOptions?: {\n /**\n * Value display notation.\n * @default 'standard'\n */\n notation?: 'standard' | 'compact';\n /**\n * Determines the fixed number of fraction digits. The value is rounded to the given precision.\n * Maximum is 20, default is value precision.\n * @default variable\n */\n fractionDigits?: number;\n /**\n * Determines whether group separators should be shown.\n * @default true\n */\n groupSeparators?: boolean;\n };\n }\n>;\n\nexport default forwardRef<RefElement<NumberDisplayProps>, PropsWithoutRef<NumberDisplayProps>>(\n function NumberDisplay(\n {\n value,\n unit = '',\n formattingOptions: {\n fractionDigits = getFraction(String(value)).substring(1).length,\n notation,\n groupSeparators = true\n } = {},\n ...restProps\n },\n ref\n ) {\n const { locale } = useConfiguration();\n\n return (\n <span ref={ref} {...restProps}>\n {value || value === 0 ? (\n getFormattedValue(value.toString(), locale, unit, {\n notation,\n useGrouping: groupSeparators,\n maximumFractionDigits: fractionDigits,\n minimumFractionDigits: fractionDigits\n })\n ) : (\n <NoValue />\n )}\n </span>\n );\n }\n);\n"]}
@@ -1,8 +1,6 @@
1
- import type { FunctionComponent } from 'react';
2
- import type { ForwardProps } from '../../types';
3
1
  import type { NumberInputProps } from './NumberInput.types';
4
- declare const _default: FunctionComponent<NumberInputProps & ForwardProps> & {
5
- getTestIds: (testIdProp?: string | undefined) => import("../../types").TestIdsRecord<readonly ["control", "plus", "minus", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
2
+ declare const _default: import("react").ForwardRefExoticComponent<Omit<NumberInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>> & {
3
+ getTestIds: (testIdProp?: string | null | undefined) => import("../../types").TestIdsRecord<readonly ["control", "plus", "minus", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
6
4
  };
7
5
  export default _default;
8
6
  //# sourceMappingURL=NumberInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../src/components/Number/NumberInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,iBAAiB,EAIlB,MAAM,OAAO,CAAC;AAQf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAchD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;;;;AAgQ5D,wBAA+D"}
1
+ {"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../src/components/Number/NumberInput.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;;;;AAY5D,wBA6QE"}
@@ -6,15 +6,16 @@ import * as plusIcon from '../Icon/icons/plus.icon';
6
6
  import * as minusIcon from '../Icon/icons/minus.icon';
7
7
  import Flex from '../Flex';
8
8
  import FormField from '../FormField';
9
- import { useConfiguration, useConsolidatedRef, useI18n, useInputFormatter, useTestIds, useUID } from '../../hooks';
9
+ import { useArrows, useConfiguration, useConsolidatedRef, useI18n, useInputFormatter, useTestIds, useUID } from '../../hooks';
10
10
  import StyledInput from '../Input/Input.styles';
11
11
  import { withTestIds } from '../../utils';
12
+ import VisuallyHiddenText from '../VisuallyHiddenText';
12
13
  import StyledNumberInput, { StyledStepperInput } from './NumberInput.styles';
13
14
  import { NUMBER_MAX_DECIMAL_PLACES } from './NumberInput.types';
14
15
  import { getCleanedValue, getDecimalSign, getDecrementedValue, getFormattedValue, getIncrementedValue } from './utils';
15
16
  import { getNumberInputTestIds } from './Number.test-ids';
16
17
  registerIcon(minusIcon, plusIcon);
17
- const NumberInput = forwardRef(function NumberInput(props, ref) {
18
+ export default withTestIds(forwardRef(function NumberInput(props, ref) {
18
19
  const uid = useUID();
19
20
  const { testId, id = uid, status, label, labelHidden, info, required, disabled, readOnly, additionalInfo, value = '', onChange, onFocus, onBlur, onResolveSuggestion, unit, showDecimal = true, numberOfDecimals: numberOfDecimalsProp = NUMBER_MAX_DECIMAL_PLACES, showGroupSeparators = true, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER, step = 1, variant, 'aria-label': ariaLabel, autoFocus, ...restProps } = props;
20
21
  const testIds = useTestIds(testId, getNumberInputTestIds);
@@ -51,7 +52,8 @@ const NumberInput = forwardRef(function NumberInput(props, ref) {
51
52
  break;
52
53
  case decimalSign:
53
54
  if (input.value.includes(decimalSign)) {
54
- if (input.selectionStart && input.value.charAt(input.selectionStart) === decimalSign) {
55
+ if (input.selectionStart &&
56
+ input.value.charAt(input.selectionStart) === decimalSign) {
55
57
  input.setSelectionRange(input.selectionStart + 1, input.selectionStart + 1);
56
58
  }
57
59
  e.preventDefault();
@@ -95,12 +97,18 @@ const NumberInput = forwardRef(function NumberInput(props, ref) {
95
97
  const onPlusClick = () => {
96
98
  onChange?.(getIncrementedValue(value, min, max, step));
97
99
  };
98
- const stepper = (_jsxs(Flex, { as: StyledStepperInput, hasSuggestion: status === 'pending' && !!onResolveSuggestion, container: { alignItems: 'center', wrap: 'nowrap' }, status: status, readOnly: readOnly, disabled: disabled, size: formattedValue?.length, children: [_jsx(Button, { "data-testid": testIds.minus, variant: 'simple', icon: true, onClick: onMinusClick, readOnly: readOnly, disabled: disabled, tabIndex: -1, "aria-hidden": 'true', children: _jsx(Icon, { name: 'minus' }) }), _jsx(Flex, { container: { alignItems: 'center', wrap: 'nowrap', justify: 'center' }, item: { grow: 1 }, ref: containerRef, onClick: (e) => {
100
+ const elementRef = useRef(null);
101
+ useArrows(elementRef, {
102
+ cycle: false,
103
+ selector: 'button, input',
104
+ dir: 'left-right',
105
+ initialFocusElement: inputRef.current
106
+ });
107
+ const stepper = (_jsxs(Flex, { as: StyledStepperInput, hasSuggestion: status === 'pending' && !!onResolveSuggestion, container: { alignItems: 'center', wrap: 'nowrap' }, status: status, readOnly: readOnly, disabled: disabled, size: formattedValue?.length, ref: elementRef, role: 'application', children: [_jsx(Button, { "data-testid": testIds.minus, variant: 'simple', icon: true, onClick: onMinusClick, readOnly: readOnly, disabled: disabled, tabIndex: -1, "aria-label": t('decrease_value_by', [step]), children: _jsx(Icon, { name: 'minus' }) }), _jsx(Flex, { container: { alignItems: 'center', wrap: 'nowrap', justify: 'center' }, item: { grow: 1 }, ref: containerRef, onClick: (e) => {
99
108
  if (e.target === containerRef.current)
100
109
  inputRef?.current?.focus();
101
- }, children: _jsx(StyledInput, { "data-testid": testIds.control, onChange: onInputChange, id: id, readOnly: readOnly, required: required, disabled: disabled, ...restProps, inputMode: 'numeric', ref: inputRef, value: formattedValue, onKeyDown: onKeyDown, onFocus: onInputFocusEvent, onBlur: onInputFocusEvent, "aria-label": `${ariaLabel || label}. ${unit ? t('measured_in', [unit]) : ''}`, maxLength: 16, autoFocus: autoFocus, "aria-describedby": `${id}-info` }) }), _jsx(Button, { "data-testid": testIds.plus, variant: 'simple', icon: true, onClick: onPlusClick, readOnly: readOnly, disabled: disabled, tabIndex: -1, "aria-hidden": 'true', children: _jsx(Icon, { name: 'plus' }) })] }));
110
+ }, children: _jsx(StyledInput, { "data-testid": testIds.control, onChange: onInputChange, id: id, readOnly: readOnly, required: required, disabled: disabled, ...restProps, inputMode: 'numeric', ref: inputRef, value: formattedValue, onKeyDown: onKeyDown, onFocus: onInputFocusEvent, onBlur: onInputFocusEvent, "aria-label": `${ariaLabel || label}. ${unit ? t('measured_in', [unit]) : ''}`, maxLength: 16, autoFocus: autoFocus, "aria-describedby": info ? `${id}-info ${id}-input-description` : `${id}-input-description` }) }), _jsx(Button, { "data-testid": testIds.plus, variant: 'simple', icon: true, onClick: onPlusClick, readOnly: readOnly, disabled: disabled, tabIndex: -1, "aria-label": t('increase_value_by', [step]), children: _jsx(Icon, { name: 'plus' }) }), _jsx(VisuallyHiddenText, { id: `${id}-input-description`, children: t('stepper_instructions') }), _jsx(VisuallyHiddenText, { "aria-live": 'polite', children: formattedValue })] }));
102
111
  const Comp = variant === 'stepper' && !readOnly ? stepper : numberInput;
103
112
  return label ? (_jsx(FormField, { testId: testIds, label: label, labelHidden: labelHidden, id: id, info: info, status: status, required: required, readOnly: readOnly, disabled: disabled, additionalInfo: additionalInfo, onResolveSuggestion: onResolveSuggestion, children: Comp })) : (Comp);
104
- });
105
- export default withTestIds(NumberInput, getNumberInputTestIds);
113
+ }), getNumberInputTestIds);
106
114
  //# sourceMappingURL=NumberInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../../src/components/Number/NumberInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AASjE,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,OAAO,EACP,iBAAiB,EACjB,UAAU,EACV,MAAM,EACP,MAAM,aAAa,CAAC;AACrB,OAAO,WAAW,MAA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B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,mBAAmB,EAAE,mBAAmB,YAEvC,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useMemo, useRef } from 'react';\nimport type {\n ChangeEvent,\n FunctionComponent,\n KeyboardEvent,\n PropsWithoutRef,\n FocusEvent\n} from 'react';\n\nimport Button from '../Button';\nimport Icon, { registerIcon } from '../Icon';\nimport * as plusIcon from '../Icon/icons/plus.icon';\nimport * as minusIcon from '../Icon/icons/minus.icon';\nimport Flex from '../Flex';\nimport FormField from '../FormField';\nimport type { ForwardProps } from '../../types';\nimport {\n useConfiguration,\n useConsolidatedRef,\n useI18n,\n useInputFormatter,\n useTestIds,\n useUID\n} from '../../hooks';\nimport StyledInput from '../Input/Input.styles';\nimport { withTestIds } from '../../utils';\n\nimport StyledNumberInput, { StyledStepperInput } from './NumberInput.styles';\nimport { NUMBER_MAX_DECIMAL_PLACES } from './NumberInput.types';\nimport type { NumberInputProps } from './NumberInput.types';\nimport {\n getCleanedValue,\n getDecimalSign,\n getDecrementedValue,\n getFormattedValue,\n getIncrementedValue\n} from './utils';\nimport { getNumberInputTestIds } from './Number.test-ids';\n\nregisterIcon(minusIcon, plusIcon);\n\nconst NumberInput: FunctionComponent<NumberInputProps & ForwardProps> = forwardRef(\n function NumberInput(props: PropsWithoutRef<NumberInputProps>, ref: NumberInputProps['ref']) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n status,\n label,\n labelHidden,\n info,\n required,\n disabled,\n readOnly,\n additionalInfo,\n value = '',\n onChange,\n onFocus,\n onBlur,\n onResolveSuggestion,\n unit,\n showDecimal = true,\n numberOfDecimals: numberOfDecimalsProp = NUMBER_MAX_DECIMAL_PLACES,\n showGroupSeparators = true,\n min = Number.MIN_SAFE_INTEGER,\n max = Number.MAX_SAFE_INTEGER,\n step = 1,\n variant,\n 'aria-label': ariaLabel,\n autoFocus,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getNumberInputTestIds);\n\n const { locale } = useConfiguration();\n const inputRef = useConsolidatedRef(ref);\n const containerRef = useRef<HTMLElement>(null);\n const maximumFractionDigits = showDecimal ? numberOfDecimalsProp : 0;\n const decimalSign = useMemo(() => getDecimalSign(locale), [locale]);\n\n const formatValue = useCallback(\n number => {\n return getFormattedValue(number, locale, unit, {\n useGrouping: showGroupSeparators,\n maximumFractionDigits\n });\n },\n [locale, unit, showGroupSeparators, maximumFractionDigits]\n );\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const cleanedInputValue = getCleanedValue(inputValue, decimalSign, maximumFractionDigits);\n if (cleanedInputValue === value) return;\n onChange(cleanedInputValue);\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (readOnly) return;\n const input = e.currentTarget;\n switch (e.key) {\n case 'ArrowUp':\n e.preventDefault();\n onChange(getIncrementedValue(value, min, max, step));\n break;\n case 'ArrowDown':\n e.preventDefault();\n onChange(getDecrementedValue(value, min, max, step));\n break;\n case decimalSign:\n if (input.value.includes(decimalSign)) {\n if (input.selectionStart && input.value.charAt(input.selectionStart) === decimalSign) {\n input.setSelectionRange(input.selectionStart + 1, input.selectionStart + 1);\n }\n e.preventDefault();\n } else if (\n input.selectionStart !== null &&\n !input.value.charAt(input.selectionStart - 1).match(/\\d/)\n ) {\n onChange(\n getCleanedValue(`${input.value}0${decimalSign}`, decimalSign, maximumFractionDigits)\n );\n e.preventDefault();\n }\n break;\n case '-':\n if (value.startsWith('-')) e.preventDefault();\n break;\n default:\n }\n };\n\n const onInputFocusEvent = (e: FocusEvent<HTMLInputElement>) => {\n let parsableValue = value;\n\n if (Number.isNaN(parseFloat(value))) {\n parsableValue = '';\n } else if (value?.endsWith('.')) {\n parsableValue = value.slice(0, -1);\n }\n\n if (e.type === 'focus') onFocus?.(parsableValue);\n else {\n if (parsableValue !== value) {\n onChange(parsableValue);\n }\n\n onBlur?.(parsableValue);\n }\n };\n\n const formattedValue = useInputFormatter(inputRef, value, formatValue, `\\\\p{N}${decimalSign}-`);\n\n const t = useI18n();\n\n const numberInput = (\n <Flex\n data-testid={testIds.root}\n as={StyledNumberInput}\n hasSuggestion={status === 'pending' && !!onResolveSuggestion}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n >\n <StyledInput\n data-testid={testIds.control}\n onChange={onInputChange}\n id={id}\n readOnly={readOnly}\n required={required}\n disabled={disabled}\n {...restProps}\n inputMode='numeric'\n ref={inputRef}\n value={formattedValue}\n onKeyDown={onKeyDown}\n onFocus={onInputFocusEvent}\n onBlur={onInputFocusEvent}\n aria-label={`${ariaLabel || label}. ${unit ? t('measured_in', [unit]) : ''}`}\n maxLength={16}\n autoFocus={autoFocus}\n aria-describedby={info ? `${id}-info` : undefined}\n />\n </Flex>\n );\n\n const onMinusClick = () => {\n onChange?.(getDecrementedValue(value, min, max, step));\n };\n\n const onPlusClick = () => {\n onChange?.(getIncrementedValue(value, min, max, step));\n };\n\n const stepper = (\n <Flex\n as={StyledStepperInput}\n hasSuggestion={status === 'pending' && !!onResolveSuggestion}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n size={formattedValue?.length}\n >\n <Button\n data-testid={testIds.minus}\n variant='simple'\n icon\n onClick={onMinusClick}\n readOnly={readOnly}\n disabled={disabled}\n tabIndex={-1}\n aria-hidden='true'\n >\n <Icon name='minus' />\n </Button>\n <Flex\n container={{ alignItems: 'center', wrap: 'nowrap', justify: 'center' }}\n item={{ grow: 1 }}\n ref={containerRef}\n onClick={(e: MouseEvent) => {\n if (e.target === containerRef.current) inputRef?.current?.focus();\n }}\n >\n <StyledInput\n data-testid={testIds.control}\n onChange={onInputChange}\n id={id}\n readOnly={readOnly}\n required={required}\n disabled={disabled}\n {...restProps}\n inputMode='numeric'\n ref={inputRef}\n value={formattedValue}\n onKeyDown={onKeyDown}\n onFocus={onInputFocusEvent}\n onBlur={onInputFocusEvent}\n aria-label={`${ariaLabel || label}. ${unit ? t('measured_in', [unit]) : ''}`}\n maxLength={16}\n autoFocus={autoFocus}\n aria-describedby={`${id}-info`}\n />\n </Flex>\n <Button\n data-testid={testIds.plus}\n variant='simple'\n icon\n onClick={onPlusClick}\n readOnly={readOnly}\n disabled={disabled}\n tabIndex={-1}\n aria-hidden='true'\n >\n <Icon name='plus' />\n </Button>\n </Flex>\n );\n\n const Comp = variant === 'stepper' && !readOnly ? stepper : numberInput;\n\n return label ? (\n <FormField\n testId={testIds}\n label={label}\n labelHidden={labelHidden}\n id={id}\n info={info}\n status={status}\n required={required}\n readOnly={readOnly}\n disabled={disabled}\n additionalInfo={additionalInfo}\n onResolveSuggestion={onResolveSuggestion}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default withTestIds(NumberInput, getNumberInputTestIds);\n"]}
1
+ {"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../../src/components/Number/NumberInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGjE,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,OAAO,EACP,iBAAiB,EACjB,UAAU,EACV,MAAM,EACP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AE,QAAQ,EAClB,QAAQ,EAAE,CAAC,CAAC,gBACA,CAAC,CAAC,mBAAmB,EAAE,CAAC,IAAI,CAAC,CAAC,YAE1C,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GACb,EACT,KAAC,kBAAkB,IAAC,EAAE,EAAE,GAAG,EAAE,oBAAoB,YAC9C,CAAC,CAAC,sBAAsB,CAAC,GACP,EACrB,KAAC,kBAAkB,iBAAW,QAAQ,YAAE,cAAc,GAAsB,IACvE,CACR,CAAC;IAEF,MAAM,IAAI,GAAG,OAAO,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC;IAExE,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,IACR,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,mBAAmB,EAAE,mBAAmB,YAEvC,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,EACD,qBAAqB,CACtB,CAAC","sourcesContent":["import { forwardRef, useCallback, useMemo, useRef } from 'react';\nimport type { ChangeEvent, KeyboardEvent, PropsWithoutRef, FocusEvent } from 'react';\n\nimport Button from '../Button';\nimport Icon, { registerIcon } from '../Icon';\nimport * as plusIcon from '../Icon/icons/plus.icon';\nimport * as minusIcon from '../Icon/icons/minus.icon';\nimport Flex from '../Flex';\nimport FormField from '../FormField';\nimport type { RefElement } from '../../types';\nimport {\n useArrows,\n useConfiguration,\n useConsolidatedRef,\n useI18n,\n useInputFormatter,\n useTestIds,\n useUID\n} from '../../hooks';\nimport StyledInput from '../Input/Input.styles';\nimport { withTestIds } from '../../utils';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\n\nimport StyledNumberInput, { StyledStepperInput } from './NumberInput.styles';\nimport { NUMBER_MAX_DECIMAL_PLACES } from './NumberInput.types';\nimport type { NumberInputProps } from './NumberInput.types';\nimport {\n getCleanedValue,\n getDecimalSign,\n getDecrementedValue,\n getFormattedValue,\n getIncrementedValue\n} from './utils';\nimport { getNumberInputTestIds } from './Number.test-ids';\n\nregisterIcon(minusIcon, plusIcon);\n\nexport default withTestIds(\n forwardRef<RefElement<NumberInputProps>, PropsWithoutRef<NumberInputProps>>(\n function NumberInput(props, ref) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n status,\n label,\n labelHidden,\n info,\n required,\n disabled,\n readOnly,\n additionalInfo,\n value = '',\n onChange,\n onFocus,\n onBlur,\n onResolveSuggestion,\n unit,\n showDecimal = true,\n numberOfDecimals: numberOfDecimalsProp = NUMBER_MAX_DECIMAL_PLACES,\n showGroupSeparators = true,\n min = Number.MIN_SAFE_INTEGER,\n max = Number.MAX_SAFE_INTEGER,\n step = 1,\n variant,\n 'aria-label': ariaLabel,\n autoFocus,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getNumberInputTestIds);\n\n const { locale } = useConfiguration();\n const inputRef = useConsolidatedRef(ref);\n const containerRef = useRef<HTMLElement>(null);\n const maximumFractionDigits = showDecimal ? numberOfDecimalsProp : 0;\n const decimalSign = useMemo(() => getDecimalSign(locale), [locale]);\n\n const formatValue = useCallback(\n number => {\n return getFormattedValue(number, locale, unit, {\n useGrouping: showGroupSeparators,\n maximumFractionDigits\n });\n },\n [locale, unit, showGroupSeparators, maximumFractionDigits]\n );\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const cleanedInputValue = getCleanedValue(inputValue, decimalSign, maximumFractionDigits);\n if (cleanedInputValue === value) return;\n onChange(cleanedInputValue);\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (readOnly) return;\n const input = e.currentTarget;\n switch (e.key) {\n case 'ArrowUp':\n e.preventDefault();\n onChange(getIncrementedValue(value, min, max, step));\n break;\n case 'ArrowDown':\n e.preventDefault();\n onChange(getDecrementedValue(value, min, max, step));\n break;\n case decimalSign:\n if (input.value.includes(decimalSign)) {\n if (\n input.selectionStart &&\n input.value.charAt(input.selectionStart) === decimalSign\n ) {\n input.setSelectionRange(input.selectionStart + 1, input.selectionStart + 1);\n }\n e.preventDefault();\n } else if (\n input.selectionStart !== null &&\n !input.value.charAt(input.selectionStart - 1).match(/\\d/)\n ) {\n onChange(\n getCleanedValue(`${input.value}0${decimalSign}`, decimalSign, maximumFractionDigits)\n );\n e.preventDefault();\n }\n break;\n case '-':\n if (value.startsWith('-')) e.preventDefault();\n break;\n default:\n }\n };\n\n const onInputFocusEvent = (e: FocusEvent<HTMLInputElement>) => {\n let parsableValue = value;\n\n if (Number.isNaN(parseFloat(value))) {\n parsableValue = '';\n } else if (value?.endsWith('.')) {\n parsableValue = value.slice(0, -1);\n }\n\n if (e.type === 'focus') onFocus?.(parsableValue);\n else {\n if (parsableValue !== value) {\n onChange(parsableValue);\n }\n\n onBlur?.(parsableValue);\n }\n };\n\n const formattedValue = useInputFormatter(\n inputRef,\n value,\n formatValue,\n `\\\\p{N}${decimalSign}-`\n );\n\n const t = useI18n();\n\n const numberInput = (\n <Flex\n data-testid={testIds.root}\n as={StyledNumberInput}\n hasSuggestion={status === 'pending' && !!onResolveSuggestion}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n >\n <StyledInput\n data-testid={testIds.control}\n onChange={onInputChange}\n id={id}\n readOnly={readOnly}\n required={required}\n disabled={disabled}\n {...restProps}\n inputMode='numeric'\n ref={inputRef}\n value={formattedValue}\n onKeyDown={onKeyDown}\n onFocus={onInputFocusEvent}\n onBlur={onInputFocusEvent}\n aria-label={`${ariaLabel || label}. ${unit ? t('measured_in', [unit]) : ''}`}\n maxLength={16}\n autoFocus={autoFocus}\n aria-describedby={info ? `${id}-info` : undefined}\n />\n </Flex>\n );\n\n const onMinusClick = () => {\n onChange?.(getDecrementedValue(value, min, max, step));\n };\n\n const onPlusClick = () => {\n onChange?.(getIncrementedValue(value, min, max, step));\n };\n\n const elementRef = useRef<HTMLElement | null>(null);\n useArrows(elementRef, {\n cycle: false,\n selector: 'button, input',\n dir: 'left-right',\n initialFocusElement: inputRef.current\n });\n\n const stepper = (\n <Flex\n as={StyledStepperInput}\n hasSuggestion={status === 'pending' && !!onResolveSuggestion}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n size={formattedValue?.length}\n ref={elementRef}\n role='application'\n >\n <Button\n data-testid={testIds.minus}\n variant='simple'\n icon\n onClick={onMinusClick}\n readOnly={readOnly}\n disabled={disabled}\n tabIndex={-1}\n aria-label={t('decrease_value_by', [step])}\n >\n <Icon name='minus' />\n </Button>\n <Flex\n container={{ alignItems: 'center', wrap: 'nowrap', justify: 'center' }}\n item={{ grow: 1 }}\n ref={containerRef}\n onClick={(e: MouseEvent) => {\n if (e.target === containerRef.current) inputRef?.current?.focus();\n }}\n >\n <StyledInput\n data-testid={testIds.control}\n onChange={onInputChange}\n id={id}\n readOnly={readOnly}\n required={required}\n disabled={disabled}\n {...restProps}\n inputMode='numeric'\n ref={inputRef}\n value={formattedValue}\n onKeyDown={onKeyDown}\n onFocus={onInputFocusEvent}\n onBlur={onInputFocusEvent}\n aria-label={`${ariaLabel || label}. ${unit ? t('measured_in', [unit]) : ''}`}\n maxLength={16}\n autoFocus={autoFocus}\n aria-describedby={\n info ? `${id}-info ${id}-input-description` : `${id}-input-description`\n }\n />\n </Flex>\n <Button\n data-testid={testIds.plus}\n variant='simple'\n icon\n onClick={onPlusClick}\n readOnly={readOnly}\n disabled={disabled}\n tabIndex={-1}\n aria-label={t('increase_value_by', [step])}\n >\n <Icon name='plus' />\n </Button>\n <VisuallyHiddenText id={`${id}-input-description`}>\n {t('stepper_instructions')}\n </VisuallyHiddenText>\n <VisuallyHiddenText aria-live='polite'>{formattedValue}</VisuallyHiddenText>\n </Flex>\n );\n\n const Comp = variant === 'stepper' && !readOnly ? stepper : numberInput;\n\n return label ? (\n <FormField\n testId={testIds}\n label={label}\n labelHidden={labelHidden}\n id={id}\n info={info}\n status={status}\n required={required}\n readOnly={readOnly}\n disabled={disabled}\n additionalInfo={additionalInfo}\n onResolveSuggestion={onResolveSuggestion}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n ),\n getNumberInputTestIds\n);\n"]}
@@ -1,12 +1,7 @@
1
1
  import type { Ref } from 'react';
2
2
  import type { FormControlProps, HandleValue } from '../FormControl';
3
- import type { BaseProps, NoChildrenProp, TestIdProp } from '../../types';
4
- export interface NumberProps extends BaseProps, NoChildrenProp, TestIdProp {
5
- /**
6
- * Sets DOM id for the control and associates label element via 'for' attribute.
7
- * If an id is not pass, a random id will be generated for any render.
8
- */
9
- id?: FormControlProps['id'];
3
+ import type { NoChildrenProp, TestIdProp, WithAttributes } from '../../types';
4
+ export type NumberProps = NoChildrenProp & TestIdProp & {
10
5
  /** Set visual state based on a validation state. */
11
6
  status?: FormControlProps['status'];
12
7
  /** Pass a string or a fragment with an Icon and string. */
@@ -20,23 +15,15 @@ export interface NumberProps extends BaseProps, NoChildrenProp, TestIdProp {
20
15
  info?: FormControlProps['info'];
21
16
  /** Indicate if the field is required. The browser defaults to false. */
22
17
  required?: FormControlProps['required'];
23
- /** Placeholder text. The browser defaults to an empty string. */
24
- placeholder?: string;
25
- /** Disable the control. The browser defaults to false. */
26
- disabled?: FormControlProps['disabled'];
27
- /** Makes the component non editable and non clickable. The browser defaults to false. */
18
+ /** Makes the component non-editable and non-clickable. The browser defaults to false. */
28
19
  readOnly?: FormControlProps['readOnly'];
29
- /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */
30
- name?: FormControlProps['name'];
31
20
  /** Button when clicked will show additional information */
32
21
  additionalInfo?: FormControlProps['additionalInfo'];
33
22
  /** Defines unit of the number, like 'kg', 'miles' or '%'. */
34
23
  unit?: string;
35
- /**
36
- *
37
- /** Determines whether decimal places should be shown. The value is rounded if true.
38
- * @default true
39
- */
24
+ /** Determines whether decimal places should be shown. The value is rounded if true.
25
+ * @default true
26
+ */
40
27
  showDecimal?: boolean;
41
28
  /** Determines the maximum number of decimal places. The value is rounded to the number of places.
42
29
  * @default variable NUMBER_MAX_DECIMAL_PLACES. Recommended minimum: 1.
@@ -66,12 +53,8 @@ export interface NumberProps extends BaseProps, NoChildrenProp, TestIdProp {
66
53
  * @default 'default'
67
54
  */
68
55
  variant?: 'default' | 'stepper';
69
- /** Optional manual override for generated aria label */
70
- 'aria-label'?: string;
71
- /** Automatically focuses the input on render. */
72
- autoFocus?: boolean;
73
- }
74
- export interface NumberInputProps extends NumberProps {
56
+ };
57
+ export type NumberInputProps = WithAttributes<'input', NumberProps & {
75
58
  /**
76
59
  * CurrencyInput input value.
77
60
  * Requires an onChange handler to update value.
@@ -85,10 +68,9 @@ export interface NumberInputProps extends NumberProps {
85
68
  onBlur?: (value: string) => void;
86
69
  /** Callback fired when AI suggestion is accepted/rejected */
87
70
  onResolveSuggestion?: FormControlProps['onResolveSuggestion'];
88
- /** Ref for the wrapping element. */
89
- ref?: Ref<HTMLInputElement>;
90
- }
91
- export interface NumberRangeInputProps extends NumberProps {
71
+ type?: never;
72
+ }>;
73
+ export type NumberRangeInputProps = WithAttributes<'fieldset', NumberProps & {
92
74
  /** Range as a tuple of start and end. */
93
75
  value?: {
94
76
  start?: string;
@@ -119,7 +101,7 @@ export interface NumberRangeInputProps extends NumberProps {
119
101
  toAdditionalInfo?: FormControlProps['additionalInfo'];
120
102
  /** Imperative handle */
121
103
  handle?: Ref<HandleValue>;
122
- }
104
+ }>;
123
105
  /** Maximum fraction digits is 20. */
124
106
  export declare const NUMBER_MAX_DECIMAL_PLACES = 20;
125
107
  //# sourceMappingURL=NumberInput.types.d.ts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qBAAqB,GAAG,cAAc,CAChD,UAAU,EACV,WAAW,GAAG;IACZ,yCAAyC;IACzC,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,kDAAkD;IAClD,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1D,qDAAqD;IACrD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACzD,oDAAoD;IACpD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1D,8FAA8F;IAC9F,SAAS,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACtC,+FAA+F;IAC/F,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACpC,wHAAwH;IACxH,kBAAkB,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACxD,yHAAyH;IACzH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACtD,wBAAwB;IACxB,MAAM,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CAC3B,CACF,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,yBAAyB,KAAK,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.types.js","sourceRoot":"","sources":["../../../src/components/Number/NumberInput.types.ts"],"names":[],"mappings":"AAmHA,qCAAqC;AACrC,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC","sourcesContent":["import type { Ref } from 'react';\n\nimport type { FormControlProps, HandleValue } from '../FormControl';\nimport type { BaseProps, NoChildrenProp, TestIdProp } from '../../types';\n\nexport interface NumberProps extends BaseProps, NoChildrenProp, TestIdProp {\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 /**\n * Visually hides the label region.\n * @default false\n */\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 /** Placeholder text. The browser defaults to an empty string. */\n placeholder?: string;\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the component 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 /** Button when clicked will show additional information */\n additionalInfo?: FormControlProps['additionalInfo'];\n /** Defines unit of the number, like 'kg', 'miles' or '%'. */\n unit?: string;\n /**\n *\n /** Determines whether decimal places should be shown. The value is rounded if true.\n * @default true\n */\n showDecimal?: boolean;\n /** Determines the maximum number of decimal places. The value is rounded to the number of places.\n * @default variable NUMBER_MAX_DECIMAL_PLACES. Recommended minimum: 1.\n */\n numberOfDecimals?: number;\n /** Determines whether group separators should be shown.\n * @default true\n */\n showGroupSeparators?: boolean;\n /** The minimum value to accept for this input.\n * This value must be less than or equal to the value of the max attribute.\n * @default Number.MIN_SAFE_INTEGER\n */\n min?: number;\n /**\n * The maximum value to accept for this input.\n * This value must be greater than or equal to the value of the min attribute.\n * @default Number.MAX_SAFE_INTEGER\n */\n max?: number;\n /** A stepping interval to use when using up and down arrows to adjust the value.\n * @default 1\n */\n step?: number;\n /**\n * Component variation. Might be rendered as regular input or stepper.\n * @default 'default'\n */\n variant?: 'default' | 'stepper';\n /** Optional manual override for generated aria label */\n 'aria-label'?: string;\n /** Automatically focuses the input on render. */\n autoFocus?: boolean;\n}\n\nexport interface NumberInputProps extends NumberProps {\n /**\n * CurrencyInput input value.\n * Requires an onChange handler to update value.\n */\n value?: string;\n /** Callback fired when input value changes. */\n onChange: (value: string) => void;\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 /** Callback fired when AI suggestion is accepted/rejected */\n onResolveSuggestion?: FormControlProps['onResolveSuggestion'];\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLInputElement>;\n}\n\nexport interface NumberRangeInputProps extends NumberProps {\n /** Range as a tuple of start and end. */\n value?: { start?: string; end?: string };\n /** Callback for any modifications to the range */\n onChange: (value: { start: string; end: string }) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: { start: string; end: string }) => void;\n /** Callback fired when the component gets focus. */\n onFocus?: (value: { start: string; end: string }) => void;\n /** Pass a string or a fragment with an Icon and string for first part of NumberRangeInput. */\n fromLabel?: FormControlProps['label'];\n /** Pass a string or a fragment with an Icon and string for second part of NumberRangeInput. */\n toLabel?: FormControlProps['label'];\n /** Pass an object with \"heading\" and \"content\" properties to show AdditionalInfo for first part of NumberRangeInput. */\n fromAdditionalInfo?: FormControlProps['additionalInfo'];\n /** Pass an object with \"heading\" and \"content\" properties to show AdditionalInfo for second part of NumberRangeInput. */\n toAdditionalInfo?: FormControlProps['additionalInfo'];\n /** Imperative handle */\n handle?: Ref<HandleValue>;\n}\n\n/** Maximum fraction digits is 20. */\nexport const NUMBER_MAX_DECIMAL_PLACES = 20;\n"]}
1
+ {"version":3,"file":"NumberInput.types.js","sourceRoot":"","sources":["../../../src/components/Number/NumberInput.types.ts"],"names":[],"mappings":"AAwGA,qCAAqC;AACrC,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC","sourcesContent":["import type { Ref } from 'react';\n\nimport type { FormControlProps, HandleValue } from '../FormControl';\nimport type { NoChildrenProp, TestIdProp, WithAttributes } from '../../types';\n\nexport type NumberProps = NoChildrenProp &\n TestIdProp & {\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 /**\n * Visually hides the label region.\n * @default false\n */\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 /** Makes the component non-editable and non-clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Button when clicked will show additional information */\n additionalInfo?: FormControlProps['additionalInfo'];\n /** Defines unit of the number, like 'kg', 'miles' or '%'. */\n unit?: string;\n /** Determines whether decimal places should be shown. The value is rounded if true.\n * @default true\n */\n showDecimal?: boolean;\n /** Determines the maximum number of decimal places. The value is rounded to the number of places.\n * @default variable NUMBER_MAX_DECIMAL_PLACES. Recommended minimum: 1.\n */\n numberOfDecimals?: number;\n /** Determines whether group separators should be shown.\n * @default true\n */\n showGroupSeparators?: boolean;\n /** The minimum value to accept for this input.\n * This value must be less than or equal to the value of the max attribute.\n * @default Number.MIN_SAFE_INTEGER\n */\n min?: number;\n /**\n * The maximum value to accept for this input.\n * This value must be greater than or equal to the value of the min attribute.\n * @default Number.MAX_SAFE_INTEGER\n */\n max?: number;\n /** A stepping interval to use when using up and down arrows to adjust the value.\n * @default 1\n */\n step?: number;\n /**\n * Component variation. Might be rendered as regular input or stepper.\n * @default 'default'\n */\n variant?: 'default' | 'stepper';\n };\n\nexport type NumberInputProps = WithAttributes<\n 'input',\n NumberProps & {\n /**\n * CurrencyInput input value.\n * Requires an onChange handler to update value.\n */\n value?: string;\n /** Callback fired when input value changes. */\n onChange: (value: string) => void;\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 /** Callback fired when AI suggestion is accepted/rejected */\n onResolveSuggestion?: FormControlProps['onResolveSuggestion'];\n type?: never;\n }\n>;\n\nexport type NumberRangeInputProps = WithAttributes<\n 'fieldset',\n NumberProps & {\n /** Range as a tuple of start and end. */\n value?: { start?: string; end?: string };\n /** Callback for any modifications to the range */\n onChange: (value: { start: string; end: string }) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: { start: string; end: string }) => void;\n /** Callback fired when the component gets focus. */\n onFocus?: (value: { start: string; end: string }) => void;\n /** Pass a string or a fragment with an Icon and string for first part of NumberRangeInput. */\n fromLabel?: FormControlProps['label'];\n /** Pass a string or a fragment with an Icon and string for second part of NumberRangeInput. */\n toLabel?: FormControlProps['label'];\n /** Pass an object with \"heading\" and \"content\" properties to show AdditionalInfo for first part of NumberRangeInput. */\n fromAdditionalInfo?: FormControlProps['additionalInfo'];\n /** Pass an object with \"heading\" and \"content\" properties to show AdditionalInfo for second part of NumberRangeInput. */\n toAdditionalInfo?: FormControlProps['additionalInfo'];\n /** Imperative handle */\n handle?: Ref<HandleValue>;\n }\n>;\n\n/** Maximum fraction digits is 20. */\nexport const NUMBER_MAX_DECIMAL_PLACES = 20;\n"]}
@@ -1,8 +1,6 @@
1
- import type { FunctionComponent } from 'react';
2
- import type { ForwardProps } from '../../types';
3
1
  import type { NumberRangeInputProps } from './NumberInput.types';
4
- declare const _default: FunctionComponent<NumberRangeInputProps & ForwardProps> & {
5
- getTestIds: (testIdProp?: string | undefined) => import("../../types").TestIdsRecord<readonly ["min", "max", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
2
+ declare const _default: import("react").ForwardRefExoticComponent<Omit<NumberRangeInputProps, "ref"> & import("react").RefAttributes<HTMLFieldSetElement>> & {
3
+ getTestIds: (testIdProp?: string | null | undefined) => import("../../types").TestIdsRecord<readonly ["min", "max", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
6
4
  };
7
5
  export default _default;
8
6
  //# sourceMappingURL=NumberRangeInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumberRangeInput.d.ts","sourceRoot":"","sources":["../../../src/components/Number/NumberRangeInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAO,MAAM,OAAO,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQhD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;;;;AAyLjE,wBAAoE"}
1
+ {"version":3,"file":"NumberRangeInput.d.ts","sourceRoot":"","sources":["../../../src/components/Number/NumberRangeInput.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;;;;AAGjE,wBA2GE"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useCallback, useImperativeHandle, useReducer, useRef } from 'react';
2
+ import { forwardRef, useCallback } from 'react';
3
3
  import { useConsolidatedRef, useI18n, useFocusWithin, useTestIds } from '../../hooks';
4
4
  import { StyledRangeInputContainer } from '../Input/Input.styles';
5
5
  import FormField from '../FormField';
@@ -7,48 +7,16 @@ import Flex from '../Flex';
7
7
  import { withTestIds } from '../../utils';
8
8
  import NumberInput from './NumberInput';
9
9
  import { getNumberRangeTestIds } from './Number.test-ids';
10
- const reducer = (prevState, { type, value }) => {
11
- switch (type) {
12
- case 'start': {
13
- return { ...prevState, start: value };
14
- }
15
- case 'end': {
16
- return { ...prevState, end: value };
17
- }
18
- default:
19
- return prevState;
20
- }
21
- };
22
- const NumberRangeInput = forwardRef(function NumberRangeInput({ testId, value = {}, onChange, onBlur, onFocus, label, fromLabel, toLabel, labelHidden, placeholder, disabled, readOnly, required, status, unit, showDecimal, numberOfDecimals, showGroupSeparators, min, max, step, variant, fromAdditionalInfo, toAdditionalInfo, autoFocus, handle, ...restProps }, ref) {
10
+ export default withTestIds(forwardRef(function NumberRangeInput({ name, testId, value = {}, onChange, onBlur, onFocus, label, fromLabel, toLabel, labelHidden, placeholder, disabled, readOnly, required, status, unit, showDecimal, numberOfDecimals, showGroupSeparators, min, max, step, variant, fromAdditionalInfo, toAdditionalInfo, autoFocus, handle, ...restProps }, ref) {
23
11
  const testIds = useTestIds(testId, getNumberRangeTestIds);
24
12
  const t = useI18n();
25
- const startValueInputRef = useRef(null);
26
- const endValueInputRef = useRef(null);
27
- const [state, dispatch] = useReducer(reducer, {
28
- start: value.start ?? '',
29
- end: value.end ?? ''
30
- });
31
- // Need to keep the value in ref also, to be able to call onBlur with newest value
32
- const startValueRef = useRef(state.start);
33
- const endValueRef = useRef(state.end);
13
+ const start = value.start ?? '';
14
+ const end = value.end ?? '';
34
15
  const onFocusChange = useCallback((focused) => {
35
- (focused ? onFocus : onBlur)?.({ start: startValueRef.current, end: endValueRef.current });
16
+ (focused ? onFocus : onBlur)?.({ start, end });
36
17
  }, [onBlur, value.start, value.end]);
37
18
  const containerRef = useConsolidatedRef(ref);
38
19
  useFocusWithin([containerRef], onFocusChange);
39
- useImperativeHandle(handle, () => ({
40
- clear: () => {
41
- if (startValueInputRef.current)
42
- startValueInputRef.current.value = '';
43
- if (endValueInputRef.current)
44
- endValueInputRef.current.value = '';
45
- startValueRef.current = '';
46
- endValueRef.current = '';
47
- dispatch({ type: 'start', value: '' });
48
- dispatch({ type: 'end', value: '' });
49
- onChange({ start: '', end: '' });
50
- }
51
- }), [onChange]);
52
20
  const commonProps = {
53
21
  status,
54
22
  placeholder,
@@ -62,39 +30,6 @@ const NumberRangeInput = forwardRef(function NumberRangeInput({ testId, value =
62
30
  max,
63
31
  variant
64
32
  };
65
- return (_jsx(FormField, { testId: testIds, as: 'fieldset', ...restProps, ref: containerRef, container: { wrap: 'nowrap' }, labelHidden: labelHidden, labelAs: 'legend', label: label, disabled: disabled, required: required, readOnly: readOnly, status: status, children: _jsxs(Flex, { container: true, as: StyledRangeInputContainer, children: [_jsx(NumberInput, { testId: testIds.min, ...commonProps, value: state.start, onChange: fromValue => {
66
- onChange({ start: fromValue, end: value.end ?? '' });
67
- dispatch({
68
- type: 'start',
69
- value: fromValue ?? ''
70
- });
71
- }, onBlur: changedValue => {
72
- dispatch({
73
- type: 'start',
74
- value: changedValue ?? ''
75
- });
76
- startValueRef.current = changedValue ?? '';
77
- onChange({
78
- start: changedValue ?? '',
79
- end: state.end
80
- });
81
- }, label: fromLabel, "aria-label": `${t('range_from_numeric') + (label ? ` - ${label}` : '')}`, additionalInfo: fromAdditionalInfo, autoFocus: autoFocus, ref: startValueInputRef }), _jsx(NumberInput, { testId: testIds.max, ...commonProps, value: state.end, onChange: toValue => {
82
- onChange({ start: value.start ?? '', end: toValue });
83
- dispatch({
84
- type: 'end',
85
- value: toValue ?? ''
86
- });
87
- }, onBlur: changedValue => {
88
- dispatch({
89
- type: 'end',
90
- value: changedValue ?? ''
91
- });
92
- endValueRef.current = changedValue ?? '';
93
- onChange({
94
- start: state.start,
95
- end: changedValue ?? ''
96
- });
97
- }, label: toLabel, "aria-label": `${t('range_to_numeric') + (label ? ` - ${label}` : '')}`, additionalInfo: toAdditionalInfo, ref: endValueInputRef })] }) }));
98
- });
99
- export default withTestIds(NumberRangeInput, getNumberRangeTestIds);
33
+ return (_jsx(FormField, { testId: testIds, as: 'fieldset', ...restProps, ref: containerRef, container: { wrap: 'nowrap' }, labelHidden: labelHidden, labelAs: 'legend', label: label, disabled: disabled, required: required, readOnly: readOnly, status: status, children: _jsxs(Flex, { container: true, as: StyledRangeInputContainer, children: [_jsx(NumberInput, { testId: testIds.min, ...commonProps, value: start, onChange: fromValue => onChange({ start: fromValue, end }), label: fromLabel, "aria-label": `${t('range_from_numeric') + (label ? ` - ${label}` : '')}`, additionalInfo: fromAdditionalInfo, autoFocus: autoFocus }), _jsx(NumberInput, { testId: testIds.max, ...commonProps, value: end, onChange: toValue => onChange({ start, end: toValue }), label: toLabel, "aria-label": `${t('range_to_numeric') + (label ? ` - ${label}` : '')}`, additionalInfo: toAdditionalInfo })] }) }));
34
+ }), getNumberRangeTestIds);
100
35
  //# sourceMappingURL=NumberRangeInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumberRangeInput.js","sourceRoot":"","sources":["../../../src/components/Number/NumberRangeInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAIzF,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAK1D,MAAM,OAAO,GAAG,CAAC,SAAgB,EAAE,EAAE,IAAI,EAAE,KAAK,EAAmB,EAAS,EAAE;IAC5E,QAAQ,IAAI,EAAE;QACZ,KAAK,OAAO,CAAC,CAAC;YACZ,OAAO,EAAE,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;SACvC;QACD,KAAK,KAAK,CAAC,CAAC;YACV,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;SACrC;QACD;YACE,OAAO,SAAS,CAAC;KACpB;AACH,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAA4D,UAAU,CAC1F,SAAS,gBAAgB,CACvB,EACE,MAAM,EACN,KAAK,GAAG,EAAE,EACV,QAAQ,EACR,MAAM,EACN,OAAO,EACP,KAAK,EACL,SAAS,EACT,OAAO,EACP,WAAW,EACX,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR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C,EACD,MAAM,EAAE,YAAY,CAAC,EAAE;wBACrB,QAAQ,CAAC;4BACP,IAAI,EAAE,KAAK;4BACX,KAAK,EAAE,YAAY,IAAI,EAAE;yBAC1B,CAAC,CAAC;wBACH,WAAW,CAAC,OAAO,GAAG,YAAY,IAAI,EAAE,CAAC;wBACzC,QAAQ,CAAC;4BACP,KAAK,EAAE,KAAK,CAAC,KAAK;4BAClB,GAAG,EAAE,YAAY,IAAI,EAAE;yBACxB,CAAC,CAAC;oBACL,CAAC,EACD,KAAK,EAAE,OAAO,gBACF,GAAG,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EACrE,cAAc,EAAE,gBAAgB,EAChC,GAAG,EAAE,gBAAgB,GACrB,IACG,GACG,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useImperativeHandle, useReducer, useRef } from 'react';\nimport type { FunctionComponent, Ref } from 'react';\n\nimport type { ForwardProps } from '../../types';\nimport { useConsolidatedRef, useI18n, useFocusWithin, useTestIds } from '../../hooks';\nimport { StyledRangeInputContainer } from '../Input/Input.styles';\nimport FormField from '../FormField';\nimport Flex from '../Flex';\nimport { withTestIds } from '../../utils';\n\nimport NumberInput from './NumberInput';\nimport type { NumberRangeInputProps } from './NumberInput.types';\nimport { getNumberRangeTestIds } from './Number.test-ids';\n\ntype DateRangeAction = { type: 'start' | 'end'; value: string };\ntype State = { start: string; end: string };\n\nconst reducer = (prevState: State, { type, value }: DateRangeAction): State => {\n switch (type) {\n case 'start': {\n return { ...prevState, start: value };\n }\n case 'end': {\n return { ...prevState, end: value };\n }\n default:\n return prevState;\n }\n};\n\nconst NumberRangeInput: FunctionComponent<NumberRangeInputProps & ForwardProps> = forwardRef(\n function NumberRangeInput(\n {\n testId,\n value = {},\n onChange,\n onBlur,\n onFocus,\n label,\n fromLabel,\n toLabel,\n labelHidden,\n placeholder,\n disabled,\n readOnly,\n required,\n status,\n unit,\n showDecimal,\n numberOfDecimals,\n showGroupSeparators,\n min,\n max,\n step,\n variant,\n fromAdditionalInfo,\n toAdditionalInfo,\n autoFocus,\n handle,\n ...restProps\n }: NumberRangeInputProps,\n ref: Ref<HTMLDivElement>\n ) {\n const testIds = useTestIds(testId, getNumberRangeTestIds);\n\n const t = useI18n();\n\n const startValueInputRef = useRef<HTMLInputElement>(null);\n const endValueInputRef = useRef<HTMLInputElement>(null);\n\n const [state, dispatch] = useReducer(reducer, {\n start: value.start ?? '',\n end: value.end ?? ''\n });\n\n // Need to keep the value in ref also, to be able to call onBlur with newest value\n const startValueRef = useRef(state.start);\n const endValueRef = useRef(state.end);\n\n const onFocusChange = useCallback(\n (focused: boolean) => {\n (focused ? onFocus : onBlur)?.({ start: startValueRef.current, end: endValueRef.current });\n },\n [onBlur, value.start, value.end]\n );\n\n const containerRef = useConsolidatedRef(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n useImperativeHandle(\n handle,\n () => ({\n clear: () => {\n if (startValueInputRef.current) startValueInputRef.current.value = '';\n if (endValueInputRef.current) endValueInputRef.current.value = '';\n startValueRef.current = '';\n endValueRef.current = '';\n dispatch({ type: 'start', value: '' });\n dispatch({ type: 'end', value: '' });\n onChange({ start: '', end: '' });\n }\n }),\n [onChange]\n );\n\n const commonProps = {\n status,\n placeholder,\n readOnly,\n required,\n unit,\n showDecimal,\n numberOfDecimals,\n showGroupSeparators,\n min,\n max,\n variant\n };\n\n return (\n <FormField\n testId={testIds}\n as='fieldset'\n {...restProps}\n ref={containerRef}\n container={{ wrap: 'nowrap' }}\n labelHidden={labelHidden}\n labelAs='legend'\n label={label}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n status={status}\n >\n <Flex container as={StyledRangeInputContainer}>\n <NumberInput\n testId={testIds.min}\n {...commonProps}\n value={state.start}\n onChange={fromValue => {\n onChange({ start: fromValue, end: value.end ?? '' });\n dispatch({\n type: 'start',\n value: fromValue ?? ''\n });\n }}\n onBlur={changedValue => {\n dispatch({\n type: 'start',\n value: changedValue ?? ''\n });\n startValueRef.current = changedValue ?? '';\n onChange({\n start: changedValue ?? '',\n end: state.end\n });\n }}\n label={fromLabel}\n aria-label={`${t('range_from_numeric') + (label ? ` - ${label}` : '')}`}\n additionalInfo={fromAdditionalInfo}\n autoFocus={autoFocus}\n ref={startValueInputRef}\n />\n <NumberInput\n testId={testIds.max}\n {...commonProps}\n value={state.end}\n onChange={toValue => {\n onChange({ start: value.start ?? '', end: toValue });\n dispatch({\n type: 'end',\n value: toValue ?? ''\n });\n }}\n onBlur={changedValue => {\n dispatch({\n type: 'end',\n value: changedValue ?? ''\n });\n endValueRef.current = changedValue ?? '';\n onChange({\n start: state.start,\n end: changedValue ?? ''\n });\n }}\n label={toLabel}\n aria-label={`${t('range_to_numeric') + (label ? ` - ${label}` : '')}`}\n additionalInfo={toAdditionalInfo}\n ref={endValueInputRef}\n />\n </Flex>\n </FormField>\n );\n }\n);\n\nexport default withTestIds(NumberRangeInput, getNumberRangeTestIds);\n"]}
1
+ {"version":3,"file":"NumberRangeInput.js","sourceRoot":"","sources":["../../../src/components/Number/NumberRangeInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAwB,WAAW,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,C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ent":["import { forwardRef, type PropsWithoutRef, useCallback } from 'react';\n\nimport type { RefElement } from '../../types';\nimport { useConsolidatedRef, useI18n, useFocusWithin, useTestIds } from '../../hooks';\nimport { StyledRangeInputContainer } from '../Input/Input.styles';\nimport FormField from '../FormField';\nimport Flex from '../Flex';\nimport { withTestIds } from '../../utils';\n\nimport NumberInput from './NumberInput';\nimport type { NumberRangeInputProps } from './NumberInput.types';\nimport { getNumberRangeTestIds } from './Number.test-ids';\n\nexport default withTestIds(\n forwardRef<RefElement<NumberRangeInputProps>, PropsWithoutRef<NumberRangeInputProps>>(\n function NumberRangeInput(\n {\n name,\n testId,\n value = {},\n onChange,\n onBlur,\n onFocus,\n label,\n fromLabel,\n toLabel,\n labelHidden,\n placeholder,\n disabled,\n readOnly,\n required,\n status,\n unit,\n showDecimal,\n numberOfDecimals,\n showGroupSeparators,\n min,\n max,\n step,\n variant,\n fromAdditionalInfo,\n toAdditionalInfo,\n autoFocus,\n handle,\n ...restProps\n },\n ref\n ) {\n const testIds = useTestIds(testId, getNumberRangeTestIds);\n\n const t = useI18n();\n\n const start = value.start ?? '';\n const end = value.end ?? '';\n\n const onFocusChange = useCallback(\n (focused: boolean) => {\n (focused ? onFocus : onBlur)?.({ start, end });\n },\n [onBlur, value.start, value.end]\n );\n\n const containerRef = useConsolidatedRef(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n const commonProps = {\n status,\n placeholder,\n readOnly,\n required,\n unit,\n showDecimal,\n numberOfDecimals,\n showGroupSeparators,\n min,\n max,\n variant\n };\n\n return (\n <FormField\n testId={testIds}\n as='fieldset'\n {...restProps}\n ref={containerRef}\n container={{ wrap: 'nowrap' }}\n labelHidden={labelHidden}\n labelAs='legend'\n label={label}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n status={status}\n >\n <Flex container as={StyledRangeInputContainer}>\n <NumberInput\n testId={testIds.min}\n {...commonProps}\n value={start}\n onChange={fromValue => onChange({ start: fromValue, end })}\n label={fromLabel}\n aria-label={`${t('range_from_numeric') + (label ? ` - ${label}` : '')}`}\n additionalInfo={fromAdditionalInfo}\n autoFocus={autoFocus}\n />\n <NumberInput\n testId={testIds.max}\n {...commonProps}\n value={end}\n onChange={toValue => onChange({ start, end: toValue })}\n label={toLabel}\n aria-label={`${t('range_to_numeric') + (label ? ` - ${label}` : '')}`}\n additionalInfo={toAdditionalInfo}\n />\n </Flex>\n </FormField>\n );\n }\n ),\n getNumberRangeTestIds\n);\n"]}
@@ -1,5 +1,7 @@
1
1
  export declare const StyledSkipNavigation: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Button").ButtonProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
2
- export declare const StyledNavItem: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Button/BareButton").BareButtonProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, import("../Tabs/Tab").StyledTabProps, never>;
2
+ export declare const StyledNavItem: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Button/BareButton").BareButtonProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, import("../Tabs/Tab").StyledTabProps & {
3
+ level?: number | undefined;
4
+ }, never>;
3
5
  export declare const StyledNavGroupHeader: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Text").TextProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
4
6
  export declare const StyledNavGroupList: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
5
7
  export declare const StyledNavGroup: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"CategorySubPage.styles.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/CategorySubPage.styles.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,oBAAoB,qMAoB/B,CAAC;AAEH,eAAO,MAAM,aAAa,sPAgExB,CAAC;AAGH,eAAO,MAAM,oBAAoB,iMAa/B,CAAC;AAGH,eAAO,MAAM,kBAAkB,wGA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G1B,CAAC"}
@@ -20,6 +20,7 @@ export const StyledSkipNavigation = styled(Button)(({ theme }) => {
20
20
  }
21
21
  `;
22
22
  });
23
+ StyledSkipNavigation.defaultProps = defaultThemeProp;
23
24
  export const StyledNavItem = styled(StyledTab)(({ theme }) => {
24
25
  const { base: { breakpoints, palette: { interactive, 'app-background': hoverBase }, spacing } } = theme;
25
26
  const hoverColors = getHoverColors(hoverBase);
@@ -126,6 +127,7 @@ export const StyledNavList = styled.ul(({ theme }) => {
126
127
  }
127
128
  `;
128
129
  });
130
+ StyledNavList.defaultProps = defaultThemeProp;
129
131
  export const StyledNav = styled.nav ``;
130
132
  export const StyledCategoryIconBlock = styled.div(({ theme }) => {
131
133
  const { base: { palette: { 'brand-primary': brandPrimary }, 'border-radius': baseBorderRadius, spacing } } = theme;