@pega/cosmos-react-core 3.0.0-dev.9.0 → 3.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (989) hide show
  1. package/lib/components/Actions/Actions.d.ts +5 -0
  2. package/lib/components/Actions/Actions.d.ts.map +1 -1
  3. package/lib/components/Actions/Actions.js +2 -2
  4. package/lib/components/Actions/Actions.js.map +1 -1
  5. package/lib/components/AdditionalInfo/AdditionalInfo.d.ts +11 -0
  6. package/lib/components/AdditionalInfo/AdditionalInfo.d.ts.map +1 -0
  7. package/lib/components/AdditionalInfo/AdditionalInfo.js +25 -0
  8. package/lib/components/AdditionalInfo/AdditionalInfo.js.map +1 -0
  9. package/lib/components/AdditionalInfo/index.d.ts +2 -0
  10. package/lib/components/AdditionalInfo/index.d.ts.map +1 -0
  11. package/lib/components/AdditionalInfo/index.js +2 -0
  12. package/lib/components/AdditionalInfo/index.js.map +1 -0
  13. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  14. package/lib/components/AppShell/AppHeader.js +16 -8
  15. package/lib/components/AppShell/AppHeader.js.map +1 -1
  16. package/lib/components/AppShell/AppHeader.styles.d.ts +16 -0
  17. package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -0
  18. package/lib/components/AppShell/AppHeader.styles.js +155 -0
  19. package/lib/components/AppShell/AppHeader.styles.js.map +1 -0
  20. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  21. package/lib/components/AppShell/AppShell.js +89 -218
  22. package/lib/components/AppShell/AppShell.js.map +1 -1
  23. package/lib/components/AppShell/AppShell.styles.d.ts +7 -48
  24. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  25. package/lib/components/AppShell/AppShell.styles.js +48 -527
  26. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  27. package/lib/components/AppShell/AppShell.types.d.ts +27 -80
  28. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  29. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  30. package/lib/components/AppShell/AppShellContext.d.ts +12 -6
  31. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  32. package/lib/components/AppShell/AppShellContext.js +10 -5
  33. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  34. package/lib/components/AppShell/AppShellList.d.ts +2 -2
  35. package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
  36. package/lib/components/AppShell/AppShellList.js +16 -2
  37. package/lib/components/AppShell/AppShellList.js.map +1 -1
  38. package/lib/components/AppShell/AppShellList.styles.d.ts +19 -0
  39. package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -0
  40. package/lib/components/AppShell/AppShellList.styles.js +141 -0
  41. package/lib/components/AppShell/AppShellList.styles.js.map +1 -0
  42. package/lib/components/AppShell/AppShellSearch.d.ts +9 -0
  43. package/lib/components/AppShell/AppShellSearch.d.ts.map +1 -0
  44. package/lib/components/AppShell/AppShellSearch.js +39 -0
  45. package/lib/components/AppShell/AppShellSearch.js.map +1 -0
  46. package/lib/components/AppShell/AppShellSearch.styles.d.ts +8 -0
  47. package/lib/components/AppShell/AppShellSearch.styles.d.ts.map +1 -0
  48. package/lib/components/AppShell/AppShellSearch.styles.js +193 -0
  49. package/lib/components/AppShell/AppShellSearch.styles.js.map +1 -0
  50. package/lib/components/AppShell/Drawer.d.ts +3 -1
  51. package/lib/components/AppShell/Drawer.d.ts.map +1 -1
  52. package/lib/components/AppShell/Drawer.js +14 -11
  53. package/lib/components/AppShell/Drawer.js.map +1 -1
  54. package/lib/components/AppShell/Drawer.styles.d.ts +15 -0
  55. package/lib/components/AppShell/Drawer.styles.d.ts.map +1 -0
  56. package/lib/components/AppShell/Drawer.styles.js +153 -0
  57. package/lib/components/AppShell/Drawer.styles.js.map +1 -0
  58. package/lib/components/AppShell/NavigationList.d.ts +6 -0
  59. package/lib/components/AppShell/NavigationList.d.ts.map +1 -0
  60. package/lib/components/AppShell/NavigationList.js +121 -0
  61. package/lib/components/AppShell/NavigationList.js.map +1 -0
  62. package/lib/components/AppShell/NavigationListItemWrapper.d.ts +5 -0
  63. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -0
  64. package/lib/components/AppShell/NavigationListItemWrapper.js +157 -0
  65. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -0
  66. package/lib/components/AppShell/Operator.js +4 -4
  67. package/lib/components/AppShell/Operator.js.map +1 -1
  68. package/lib/components/AppShell/index.d.ts +2 -3
  69. package/lib/components/AppShell/index.d.ts.map +1 -1
  70. package/lib/components/AppShell/index.js +1 -2
  71. package/lib/components/AppShell/index.js.map +1 -1
  72. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  73. package/lib/components/Avatar/Avatar.js +4 -4
  74. package/lib/components/Avatar/Avatar.js.map +1 -1
  75. package/lib/components/Badges/Count.d.ts.map +1 -1
  76. package/lib/components/Badges/Count.js +37 -1
  77. package/lib/components/Badges/Count.js.map +1 -1
  78. package/lib/components/Badges/Keyboard.d.ts +2 -2
  79. package/lib/components/Badges/Keyboard.d.ts.map +1 -1
  80. package/lib/components/Badges/Keyboard.js +6 -1
  81. package/lib/components/Badges/Keyboard.js.map +1 -1
  82. package/lib/components/Badges/Selection.d.ts +1 -1
  83. package/lib/components/Badges/Selection.d.ts.map +1 -1
  84. package/lib/components/Badges/Selection.js +4 -2
  85. package/lib/components/Badges/Selection.js.map +1 -1
  86. package/lib/components/Banner/Banner.d.ts.map +1 -1
  87. package/lib/components/Banner/Banner.js +8 -2
  88. package/lib/components/Banner/Banner.js.map +1 -1
  89. package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
  90. package/lib/components/Boolean/BooleanDisplay.js +4 -12
  91. package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
  92. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -1
  93. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  94. package/lib/components/Breadcrumbs/Breadcrumbs.js +44 -13
  95. package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  96. package/lib/components/Button/BareRoleButton.d.ts.map +1 -1
  97. package/lib/components/Button/BareRoleButton.js +3 -1
  98. package/lib/components/Button/BareRoleButton.js.map +1 -1
  99. package/lib/components/Checkbox/Checkbox.d.ts +3 -1
  100. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  101. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  102. package/lib/components/ColorPicker/ColorPicker.d.ts +2 -0
  103. package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  104. package/lib/components/ColorPicker/ColorPicker.js +1 -1
  105. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  106. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  107. package/lib/components/ComboBox/ComboBox.js +68 -13
  108. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  109. package/lib/components/ComboBox/ComboBox.styles.d.ts +3 -1
  110. package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
  111. package/lib/components/ComboBox/ComboBox.types.d.ts +11 -1
  112. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  113. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  114. package/lib/components/ComboBox/ComboBoxInput.d.ts +7 -0
  115. package/lib/components/ComboBox/ComboBoxInput.d.ts.map +1 -1
  116. package/lib/components/ComboBox/ComboBoxInput.js +5 -2
  117. package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
  118. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  119. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +116 -31
  120. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  121. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts +10 -0
  122. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts.map +1 -1
  123. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.js.map +1 -1
  124. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
  125. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +2 -2
  126. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
  127. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts +2 -0
  128. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts.map +1 -1
  129. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.js.map +1 -1
  130. package/lib/components/CompositeInput/CompositeInput.d.ts +5 -0
  131. package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -0
  132. package/lib/components/CompositeInput/CompositeInput.js +62 -0
  133. package/lib/components/CompositeInput/CompositeInput.js.map +1 -0
  134. package/lib/components/CompositeInput/CompositeInput.styles.d.ts +5 -0
  135. package/lib/components/CompositeInput/CompositeInput.styles.d.ts.map +1 -0
  136. package/lib/components/CompositeInput/CompositeInput.styles.js +57 -0
  137. package/lib/components/CompositeInput/CompositeInput.styles.js.map +1 -0
  138. package/lib/components/CompositeInput/CompositeInput.types.d.ts +52 -0
  139. package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -0
  140. package/lib/components/CompositeInput/CompositeInput.types.js +2 -0
  141. package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -0
  142. package/lib/components/CompositeInput/index.d.ts +3 -0
  143. package/lib/components/CompositeInput/index.d.ts.map +1 -0
  144. package/lib/components/CompositeInput/index.js +2 -0
  145. package/lib/components/CompositeInput/index.js.map +1 -0
  146. package/lib/components/Configuration/Configuration.d.ts +14 -13
  147. package/lib/components/Configuration/Configuration.d.ts.map +1 -1
  148. package/lib/components/Configuration/Configuration.js +25 -14
  149. package/lib/components/Configuration/Configuration.js.map +1 -1
  150. package/lib/components/Configuration/index.d.ts +0 -1
  151. package/lib/components/Configuration/index.d.ts.map +1 -1
  152. package/lib/components/Configuration/index.js +0 -1
  153. package/lib/components/Configuration/index.js.map +1 -1
  154. package/lib/components/CreditCard/CreditCard.types.d.ts +2 -0
  155. package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
  156. package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
  157. package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
  158. package/lib/components/Currency/CurrencyDisplay.js +2 -2
  159. package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
  160. package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
  161. package/lib/components/Currency/CurrencyInput.js +92 -26
  162. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  163. package/lib/components/Currency/CurrencyInput.types.d.ts +9 -1
  164. package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
  165. package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
  166. package/lib/components/Currency/utils.d.ts +7 -17
  167. package/lib/components/Currency/utils.d.ts.map +1 -1
  168. package/lib/components/Currency/utils.js +50 -51
  169. package/lib/components/Currency/utils.js.map +1 -1
  170. package/lib/components/DateTime/DateTime.types.d.ts +15 -9
  171. package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
  172. package/lib/components/DateTime/DateTime.types.js.map +1 -1
  173. package/lib/components/DateTime/DurationDisplay.js +3 -3
  174. package/lib/components/DateTime/DurationDisplay.js.map +1 -1
  175. package/lib/components/DateTime/Input/DateInput.d.ts +9 -2
  176. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  177. package/lib/components/DateTime/Input/DateInput.js +27 -15
  178. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  179. package/lib/components/DateTime/Input/DateRangeInput.d.ts +18 -23
  180. package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
  181. package/lib/components/DateTime/Input/DateRangeInput.js +98 -83
  182. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  183. package/lib/components/DateTime/Input/DateTimeInput.d.ts +3 -0
  184. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  185. package/lib/components/DateTime/Input/DateTimeInput.js +28 -12
  186. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  187. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +2 -0
  188. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
  189. package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
  190. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
  191. package/lib/components/DateTime/Input/Duration/DurationInput.js +10 -2
  192. package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
  193. package/lib/components/DateTime/Input/Duration/DurationInput.types.d.ts +2 -0
  194. package/lib/components/DateTime/Input/Duration/DurationInput.types.d.ts.map +1 -1
  195. package/lib/components/DateTime/Input/Duration/DurationInput.types.js.map +1 -1
  196. package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts.map +1 -1
  197. package/lib/components/DateTime/Input/Duration/NumberUnit.js +30 -33
  198. package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
  199. package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
  200. package/lib/components/DateTime/Input/Duration/Time.js +5 -4
  201. package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
  202. package/lib/components/DateTime/Input/MonthInput.d.ts +3 -0
  203. package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
  204. package/lib/components/DateTime/Input/MonthInput.js +23 -26
  205. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  206. package/lib/components/DateTime/Input/QuarterInput.d.ts +3 -0
  207. package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -1
  208. package/lib/components/DateTime/Input/QuarterInput.js +24 -25
  209. package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
  210. package/lib/components/DateTime/Input/TimeInput.d.ts +3 -0
  211. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  212. package/lib/components/DateTime/Input/TimeInput.js +21 -9
  213. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  214. package/lib/components/DateTime/Input/TimeRangeInput.d.ts +46 -0
  215. package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -0
  216. package/lib/components/DateTime/Input/TimeRangeInput.js +74 -0
  217. package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -0
  218. package/lib/components/DateTime/Input/WeekInput.d.ts +3 -2
  219. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  220. package/lib/components/DateTime/Input/WeekInput.js +12 -7
  221. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  222. package/lib/components/DateTime/Input/usePickerButton.d.ts +1 -1
  223. package/lib/components/DateTime/Input/usePickerButton.d.ts.map +1 -1
  224. package/lib/components/DateTime/Input/utils.d.ts +6 -6
  225. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  226. package/lib/components/DateTime/Input/utils.js +2 -1
  227. package/lib/components/DateTime/Input/utils.js.map +1 -1
  228. package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
  229. package/lib/components/DateTime/Picker/Calendar.js +20 -16
  230. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  231. package/lib/components/DateTime/Picker/Calendar.styles.d.ts +2 -4
  232. package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
  233. package/lib/components/DateTime/Picker/Calendar.styles.js +13 -55
  234. package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
  235. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  236. package/lib/components/DateTime/Picker/DatePicker.js +2 -1
  237. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  238. package/lib/components/DateTime/Picker/DatePicker.styles.d.ts +3 -0
  239. package/lib/components/DateTime/Picker/DatePicker.styles.d.ts.map +1 -0
  240. package/lib/components/DateTime/Picker/DatePicker.styles.js +39 -0
  241. package/lib/components/DateTime/Picker/DatePicker.styles.js.map +1 -0
  242. package/lib/components/DateTime/Picker/DateRangePicker.js +1 -1
  243. package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
  244. package/lib/components/DateTime/Picker/TimePicker.d.ts +1 -1
  245. package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
  246. package/lib/components/DateTime/Picker/TimePicker.js +10 -5
  247. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  248. package/lib/components/DateTime/Picker/Weeks.d.ts.map +1 -1
  249. package/lib/components/DateTime/Picker/Weeks.js +14 -6
  250. package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
  251. package/lib/components/DateTime/Picker/utils.d.ts +1 -1
  252. package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
  253. package/lib/components/DateTime/index.d.ts +4 -0
  254. package/lib/components/DateTime/index.d.ts.map +1 -1
  255. package/lib/components/DateTime/index.js +3 -0
  256. package/lib/components/DateTime/index.js.map +1 -1
  257. package/lib/components/DateTime/utils.d.ts +2 -2
  258. package/lib/components/DateTime/utils.d.ts.map +1 -1
  259. package/lib/components/DateTime/utils.js +18 -4
  260. package/lib/components/DateTime/utils.js.map +1 -1
  261. package/lib/components/Dialog/Dialog.d.ts +32 -0
  262. package/lib/components/Dialog/Dialog.d.ts.map +1 -0
  263. package/lib/components/Dialog/Dialog.js +149 -0
  264. package/lib/components/Dialog/Dialog.js.map +1 -0
  265. package/lib/components/Dialog/index.d.ts +3 -0
  266. package/lib/components/Dialog/index.d.ts.map +1 -0
  267. package/lib/components/Dialog/index.js +3 -0
  268. package/lib/components/Dialog/index.js.map +1 -0
  269. package/lib/components/FieldGroup/FieldGroup.d.ts +7 -0
  270. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  271. package/lib/components/FieldGroup/FieldGroup.js +45 -41
  272. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  273. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  274. package/lib/components/FieldGroup/FieldGroupList.js +6 -2
  275. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  276. package/lib/components/FieldValueList/FieldValueList.d.ts +13 -7
  277. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  278. package/lib/components/FieldValueList/FieldValueList.js +41 -13
  279. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  280. package/lib/components/FieldValueList/index.d.ts +3 -5
  281. package/lib/components/FieldValueList/index.d.ts.map +1 -1
  282. package/lib/components/FieldValueList/index.js +2 -4
  283. package/lib/components/FieldValueList/index.js.map +1 -1
  284. package/lib/components/File/FileItem.d.ts +3 -0
  285. package/lib/components/File/FileItem.d.ts.map +1 -1
  286. package/lib/components/File/FileItem.js +6 -3
  287. package/lib/components/File/FileItem.js.map +1 -1
  288. package/lib/components/File/FileVisual.d.ts.map +1 -1
  289. package/lib/components/File/FileVisual.js +6 -5
  290. package/lib/components/File/FileVisual.js.map +1 -1
  291. package/lib/components/File/utils.d.ts +1 -1
  292. package/lib/components/File/utils.d.ts.map +1 -1
  293. package/lib/components/File/utils.js.map +1 -1
  294. package/lib/components/Flex/Flex.d.ts +11 -10
  295. package/lib/components/Flex/Flex.d.ts.map +1 -1
  296. package/lib/components/Flex/Flex.js.map +1 -1
  297. package/lib/components/Form/Form.d.ts +5 -16
  298. package/lib/components/Form/Form.d.ts.map +1 -1
  299. package/lib/components/Form/Form.js +14 -11
  300. package/lib/components/Form/Form.js.map +1 -1
  301. package/lib/components/FormControl/FormControl.d.ts +12 -2
  302. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  303. package/lib/components/FormControl/FormControl.js +60 -35
  304. package/lib/components/FormControl/FormControl.js.map +1 -1
  305. package/lib/components/FormField/FormField.d.ts +5 -0
  306. package/lib/components/FormField/FormField.d.ts.map +1 -1
  307. package/lib/components/FormField/FormField.js +87 -16
  308. package/lib/components/FormField/FormField.js.map +1 -1
  309. package/lib/components/Grid/Grid.d.ts +1 -1
  310. package/lib/components/Grid/Grid.d.ts.map +1 -1
  311. package/lib/components/Grid/Grid.types.d.ts +11 -10
  312. package/lib/components/Grid/Grid.types.d.ts.map +1 -1
  313. package/lib/components/Grid/Grid.types.js.map +1 -1
  314. package/lib/components/HTML/HTML.d.ts.map +1 -1
  315. package/lib/components/HTML/HTML.js +56 -16
  316. package/lib/components/HTML/HTML.js.map +1 -1
  317. package/lib/components/Icon/Icon.d.ts.map +1 -1
  318. package/lib/components/Icon/Icon.js +1 -1
  319. package/lib/components/Icon/Icon.js.map +1 -1
  320. package/lib/components/Icon/iconNames.d.ts +2 -2
  321. package/lib/components/Icon/iconNames.d.ts.map +1 -1
  322. package/lib/components/Icon/iconNames.js +2 -1
  323. package/lib/components/Icon/iconNames.js.map +1 -1
  324. package/lib/components/Icon/icons/ai-assist.icon.js +1 -1
  325. package/lib/components/Icon/icons/ai-assist.icon.js.map +1 -1
  326. package/lib/components/Icon/icons/align-center.icon.js +1 -1
  327. package/lib/components/Icon/icons/align-center.icon.js.map +1 -1
  328. package/lib/components/Icon/icons/align-left.icon.js +1 -1
  329. package/lib/components/Icon/icons/align-left.icon.js.map +1 -1
  330. package/lib/components/Icon/icons/align-right.icon.js +1 -1
  331. package/lib/components/Icon/icons/align-right.icon.js.map +1 -1
  332. package/lib/components/Icon/icons/arrow-left.icon.js +1 -1
  333. package/lib/components/Icon/icons/arrow-left.icon.js.map +1 -1
  334. package/lib/components/Icon/icons/arrow-micro-down.icon.js +1 -1
  335. package/lib/components/Icon/icons/arrow-micro-down.icon.js.map +1 -1
  336. package/lib/components/Icon/icons/arrow-micro-left.icon.js +1 -1
  337. package/lib/components/Icon/icons/arrow-micro-left.icon.js.map +1 -1
  338. package/lib/components/Icon/icons/arrow-micro-right.icon.js +1 -1
  339. package/lib/components/Icon/icons/arrow-micro-right.icon.js.map +1 -1
  340. package/lib/components/Icon/icons/arrow-micro-up-down.icon.js +1 -1
  341. package/lib/components/Icon/icons/arrow-micro-up-down.icon.js.map +1 -1
  342. package/lib/components/Icon/icons/arrow-micro-up.icon.js +1 -1
  343. package/lib/components/Icon/icons/arrow-micro-up.icon.js.map +1 -1
  344. package/lib/components/Icon/icons/arrow-up-down.icon.js +1 -1
  345. package/lib/components/Icon/icons/arrow-up-down.icon.js.map +1 -1
  346. package/lib/components/Icon/icons/bars.icon.js +1 -1
  347. package/lib/components/Icon/icons/bars.icon.js.map +1 -1
  348. package/lib/components/Icon/icons/bell-solid.icon.js +1 -1
  349. package/lib/components/Icon/icons/bell-solid.icon.js.map +1 -1
  350. package/lib/components/Icon/icons/bell.icon.js +1 -1
  351. package/lib/components/Icon/icons/bell.icon.js.map +1 -1
  352. package/lib/components/Icon/icons/box-4-solid.icon.js +1 -1
  353. package/lib/components/Icon/icons/box-4-solid.icon.js.map +1 -1
  354. package/lib/components/Icon/icons/box-4.icon.js +1 -1
  355. package/lib/components/Icon/icons/box-4.icon.js.map +1 -1
  356. package/lib/components/Icon/icons/calendar-range.icon.js +1 -1
  357. package/lib/components/Icon/icons/calendar-range.icon.js.map +1 -1
  358. package/lib/components/Icon/icons/calendar-solid.icon.js +1 -1
  359. package/lib/components/Icon/icons/calendar-solid.icon.js.map +1 -1
  360. package/lib/components/Icon/icons/caret-down.icon.js +1 -1
  361. package/lib/components/Icon/icons/caret-down.icon.js.map +1 -1
  362. package/lib/components/Icon/icons/caret-left.icon.js +1 -1
  363. package/lib/components/Icon/icons/caret-left.icon.js.map +1 -1
  364. package/lib/components/Icon/icons/caret-right.icon.js +1 -1
  365. package/lib/components/Icon/icons/caret-right.icon.js.map +1 -1
  366. package/lib/components/Icon/icons/caret-up.icon.js +1 -1
  367. package/lib/components/Icon/icons/caret-up.icon.js.map +1 -1
  368. package/lib/components/Icon/icons/{script-solid.icon.d.ts → carrot.icon.d.ts} +2 -2
  369. package/lib/components/Icon/icons/carrot.icon.d.ts.map +1 -0
  370. package/lib/components/Icon/icons/carrot.icon.js +6 -0
  371. package/lib/components/Icon/icons/carrot.icon.js.map +1 -0
  372. package/lib/components/Icon/icons/case-solid.icon.js +1 -1
  373. package/lib/components/Icon/icons/case-solid.icon.js.map +1 -1
  374. package/lib/components/Icon/icons/case.icon.js +1 -1
  375. package/lib/components/Icon/icons/case.icon.js.map +1 -1
  376. package/lib/components/Icon/icons/chain.icon.js +1 -1
  377. package/lib/components/Icon/icons/chain.icon.js.map +1 -1
  378. package/lib/components/Icon/icons/chat-solid.icon.js +1 -1
  379. package/lib/components/Icon/icons/chat-solid.icon.js.map +1 -1
  380. package/lib/components/Icon/icons/chat.icon.js +1 -1
  381. package/lib/components/Icon/icons/chat.icon.js.map +1 -1
  382. package/lib/components/Icon/icons/check.icon.js +1 -1
  383. package/lib/components/Icon/icons/check.icon.js.map +1 -1
  384. package/lib/components/Icon/icons/clipboard-plus-solid.icon.js +1 -1
  385. package/lib/components/Icon/icons/clipboard-plus-solid.icon.js.map +1 -1
  386. package/lib/components/Icon/icons/clipboard-plus.icon.js +1 -1
  387. package/lib/components/Icon/icons/clipboard-plus.icon.js.map +1 -1
  388. package/lib/components/Icon/icons/clock-solid.icon.js +1 -1
  389. package/lib/components/Icon/icons/clock-solid.icon.js.map +1 -1
  390. package/lib/components/Icon/icons/clock.icon.js +1 -1
  391. package/lib/components/Icon/icons/clock.icon.js.map +1 -1
  392. package/lib/components/Icon/icons/code.icon.js +1 -1
  393. package/lib/components/Icon/icons/code.icon.js.map +1 -1
  394. package/lib/components/Icon/icons/dataviz-string-field.icon.d.ts +1 -1
  395. package/lib/components/Icon/icons/dataviz-string-field.icon.js +2 -2
  396. package/lib/components/Icon/icons/dataviz-string-field.icon.js.map +1 -1
  397. package/lib/components/Icon/icons/dock.icon.js +1 -1
  398. package/lib/components/Icon/icons/dock.icon.js.map +1 -1
  399. package/lib/components/Icon/icons/dot-9-solid.icon.js +1 -1
  400. package/lib/components/Icon/icons/dot-9-solid.icon.js.map +1 -1
  401. package/lib/components/Icon/icons/dot-9.icon.js +1 -1
  402. package/lib/components/Icon/icons/dot-9.icon.js.map +1 -1
  403. package/lib/components/Icon/icons/download.icon.js +1 -1
  404. package/lib/components/Icon/icons/download.icon.js.map +1 -1
  405. package/lib/components/Icon/icons/drag.icon.js +1 -1
  406. package/lib/components/Icon/icons/drag.icon.js.map +1 -1
  407. package/lib/components/Icon/icons/eye-off-solid.icon.js +1 -1
  408. package/lib/components/Icon/icons/eye-off-solid.icon.js.map +1 -1
  409. package/lib/components/Icon/icons/eye-off.icon.js +1 -1
  410. package/lib/components/Icon/icons/eye-off.icon.js.map +1 -1
  411. package/lib/components/Icon/icons/face-blank-solid.icon.d.ts.map +1 -1
  412. package/lib/components/Icon/icons/face-blank-solid.icon.js +1 -1
  413. package/lib/components/Icon/icons/face-blank-solid.icon.js.map +1 -1
  414. package/lib/components/Icon/icons/face-blank.icon.d.ts.map +1 -1
  415. package/lib/components/Icon/icons/face-blank.icon.js +1 -1
  416. package/lib/components/Icon/icons/face-blank.icon.js.map +1 -1
  417. package/lib/components/Icon/icons/face-happy-solid.icon.d.ts.map +1 -1
  418. package/lib/components/Icon/icons/face-happy-solid.icon.js +1 -1
  419. package/lib/components/Icon/icons/face-happy-solid.icon.js.map +1 -1
  420. package/lib/components/Icon/icons/face-happy.icon.d.ts.map +1 -1
  421. package/lib/components/Icon/icons/face-happy.icon.js +1 -1
  422. package/lib/components/Icon/icons/face-happy.icon.js.map +1 -1
  423. package/lib/components/Icon/icons/face-sad-solid.icon.d.ts.map +1 -1
  424. package/lib/components/Icon/icons/face-sad-solid.icon.js +1 -1
  425. package/lib/components/Icon/icons/face-sad-solid.icon.js.map +1 -1
  426. package/lib/components/Icon/icons/face-sad.icon.d.ts.map +1 -1
  427. package/lib/components/Icon/icons/face-sad.icon.js +1 -1
  428. package/lib/components/Icon/icons/face-sad.icon.js.map +1 -1
  429. package/lib/components/Icon/icons/fast-forward-solid.icon.js +1 -1
  430. package/lib/components/Icon/icons/fast-forward-solid.icon.js.map +1 -1
  431. package/lib/components/Icon/icons/filetype-text.icon.d.ts.map +1 -1
  432. package/lib/components/Icon/icons/filetype-text.icon.js +2 -2
  433. package/lib/components/Icon/icons/filetype-text.icon.js.map +1 -1
  434. package/lib/components/Icon/icons/filter-on.icon.js +1 -1
  435. package/lib/components/Icon/icons/filter-on.icon.js.map +1 -1
  436. package/lib/components/Icon/icons/filter.icon.js +1 -1
  437. package/lib/components/Icon/icons/filter.icon.js.map +1 -1
  438. package/lib/components/Icon/icons/folder-hierarchy-solid.icon.js +1 -1
  439. package/lib/components/Icon/icons/folder-hierarchy-solid.icon.js.map +1 -1
  440. package/lib/components/Icon/icons/folder-hierarchy.icon.js +1 -1
  441. package/lib/components/Icon/icons/folder-hierarchy.icon.js.map +1 -1
  442. package/lib/components/Icon/icons/forward-all-solid.icon.js +1 -1
  443. package/lib/components/Icon/icons/forward-all-solid.icon.js.map +1 -1
  444. package/lib/components/Icon/icons/forward-all.icon.js +1 -1
  445. package/lib/components/Icon/icons/forward-all.icon.js.map +1 -1
  446. package/lib/components/Icon/icons/forward-solid.icon.js +1 -1
  447. package/lib/components/Icon/icons/forward-solid.icon.js.map +1 -1
  448. package/lib/components/Icon/icons/forward.icon.js +1 -1
  449. package/lib/components/Icon/icons/forward.icon.js.map +1 -1
  450. package/lib/components/Icon/icons/galaxy.icon.d.ts.map +1 -1
  451. package/lib/components/Icon/icons/galaxy.icon.js +2 -2
  452. package/lib/components/Icon/icons/galaxy.icon.js.map +1 -1
  453. package/lib/components/Icon/icons/globe-solid.icon.js +1 -1
  454. package/lib/components/Icon/icons/globe-solid.icon.js.map +1 -1
  455. package/lib/components/Icon/icons/globe.icon.js +1 -1
  456. package/lib/components/Icon/icons/globe.icon.js.map +1 -1
  457. package/lib/components/Icon/icons/hand.icon.js +1 -1
  458. package/lib/components/Icon/icons/hand.icon.js.map +1 -1
  459. package/lib/components/Icon/icons/help-solid.icon.js +1 -1
  460. package/lib/components/Icon/icons/help-solid.icon.js.map +1 -1
  461. package/lib/components/Icon/icons/help.icon.js +1 -1
  462. package/lib/components/Icon/icons/help.icon.js.map +1 -1
  463. package/lib/components/Icon/icons/home-solid.icon.js +1 -1
  464. package/lib/components/Icon/icons/home-solid.icon.js.map +1 -1
  465. package/lib/components/Icon/icons/home.icon.js +1 -1
  466. package/lib/components/Icon/icons/home.icon.js.map +1 -1
  467. package/lib/components/Icon/icons/information-solid.icon.js +1 -1
  468. package/lib/components/Icon/icons/information-solid.icon.js.map +1 -1
  469. package/lib/components/Icon/icons/information.icon.js +1 -1
  470. package/lib/components/Icon/icons/information.icon.js.map +1 -1
  471. package/lib/components/Icon/icons/list-number.icon.d.ts.map +1 -1
  472. package/lib/components/Icon/icons/list-number.icon.js +2 -2
  473. package/lib/components/Icon/icons/list-number.icon.js.map +1 -1
  474. package/lib/components/Icon/icons/list.icon.d.ts.map +1 -1
  475. package/lib/components/Icon/icons/list.icon.js +2 -2
  476. package/lib/components/Icon/icons/list.icon.js.map +1 -1
  477. package/lib/components/Icon/icons/mail-solid.icon.js +1 -1
  478. package/lib/components/Icon/icons/mail-solid.icon.js.map +1 -1
  479. package/lib/components/Icon/icons/mail.icon.js +1 -1
  480. package/lib/components/Icon/icons/mail.icon.js.map +1 -1
  481. package/lib/components/Icon/icons/minus.icon.js +1 -1
  482. package/lib/components/Icon/icons/minus.icon.js.map +1 -1
  483. package/lib/components/Icon/icons/more.icon.js +1 -1
  484. package/lib/components/Icon/icons/more.icon.js.map +1 -1
  485. package/lib/components/Icon/icons/move-left-solid.icon.js +1 -1
  486. package/lib/components/Icon/icons/move-left-solid.icon.js.map +1 -1
  487. package/lib/components/Icon/icons/move-right-solid.icon.js +1 -1
  488. package/lib/components/Icon/icons/move-right-solid.icon.js.map +1 -1
  489. package/lib/components/Icon/icons/open.icon.js +1 -1
  490. package/lib/components/Icon/icons/open.icon.js.map +1 -1
  491. package/lib/components/Icon/icons/paper-clip.icon.js +1 -1
  492. package/lib/components/Icon/icons/paper-clip.icon.js.map +1 -1
  493. package/lib/components/Icon/icons/phone-solid.icon.js +1 -1
  494. package/lib/components/Icon/icons/phone-solid.icon.js.map +1 -1
  495. package/lib/components/Icon/icons/phone.icon.js +1 -1
  496. package/lib/components/Icon/icons/phone.icon.js.map +1 -1
  497. package/lib/components/Icon/icons/picture-solid.icon.js +1 -1
  498. package/lib/components/Icon/icons/picture-solid.icon.js.map +1 -1
  499. package/lib/components/Icon/icons/picture.icon.js +1 -1
  500. package/lib/components/Icon/icons/picture.icon.js.map +1 -1
  501. package/lib/components/Icon/icons/placeholder.icon.d.ts +4 -0
  502. package/lib/components/Icon/icons/placeholder.icon.d.ts.map +1 -0
  503. package/lib/components/Icon/icons/placeholder.icon.js +6 -0
  504. package/lib/components/Icon/icons/placeholder.icon.js.map +1 -0
  505. package/lib/components/Icon/icons/plus.icon.js +1 -1
  506. package/lib/components/Icon/icons/plus.icon.js.map +1 -1
  507. package/lib/components/Icon/icons/polaris-solid.icon.js +1 -1
  508. package/lib/components/Icon/icons/polaris-solid.icon.js.map +1 -1
  509. package/lib/components/Icon/icons/polaris.icon.js +1 -1
  510. package/lib/components/Icon/icons/polaris.icon.js.map +1 -1
  511. package/lib/components/Icon/icons/qr.icon.js +1 -1
  512. package/lib/components/Icon/icons/qr.icon.js.map +1 -1
  513. package/lib/components/Icon/icons/reply-all-solid.icon.js +1 -1
  514. package/lib/components/Icon/icons/reply-all-solid.icon.js.map +1 -1
  515. package/lib/components/Icon/icons/reply-all.icon.js +1 -1
  516. package/lib/components/Icon/icons/reply-all.icon.js.map +1 -1
  517. package/lib/components/Icon/icons/reply-solid.icon.js +1 -1
  518. package/lib/components/Icon/icons/reply-solid.icon.js.map +1 -1
  519. package/lib/components/Icon/icons/reply.icon.js +1 -1
  520. package/lib/components/Icon/icons/reply.icon.js.map +1 -1
  521. package/lib/components/Icon/icons/reset.icon.js +1 -1
  522. package/lib/components/Icon/icons/reset.icon.js.map +1 -1
  523. package/lib/components/Icon/icons/robot-happy-solid.icon.js +1 -1
  524. package/lib/components/Icon/icons/robot-happy-solid.icon.js.map +1 -1
  525. package/lib/components/Icon/icons/robot-happy.icon.js +1 -1
  526. package/lib/components/Icon/icons/robot-happy.icon.js.map +1 -1
  527. package/lib/components/Icon/icons/row-insert.icon.js +1 -1
  528. package/lib/components/Icon/icons/row-insert.icon.js.map +1 -1
  529. package/lib/components/Icon/icons/row.icon.js +1 -1
  530. package/lib/components/Icon/icons/row.icon.js.map +1 -1
  531. package/lib/components/Icon/icons/scale-down.icon.js +1 -1
  532. package/lib/components/Icon/icons/scale-down.icon.js.map +1 -1
  533. package/lib/components/Icon/icons/scale-up-solid.icon.js +1 -1
  534. package/lib/components/Icon/icons/scale-up-solid.icon.js.map +1 -1
  535. package/lib/components/Icon/icons/scale-up.icon.js +1 -1
  536. package/lib/components/Icon/icons/scale-up.icon.js.map +1 -1
  537. package/lib/components/Icon/icons/script.icon.js +1 -1
  538. package/lib/components/Icon/icons/script.icon.js.map +1 -1
  539. package/lib/components/Icon/icons/search-analytics-solid.icon.js +1 -1
  540. package/lib/components/Icon/icons/search-analytics-solid.icon.js.map +1 -1
  541. package/lib/components/Icon/icons/search-analytics.icon.js +1 -1
  542. package/lib/components/Icon/icons/search-analytics.icon.js.map +1 -1
  543. package/lib/components/Icon/icons/search.icon.js +1 -1
  544. package/lib/components/Icon/icons/search.icon.js.map +1 -1
  545. package/lib/components/Icon/icons/send-solid.icon.js +1 -1
  546. package/lib/components/Icon/icons/send-solid.icon.js.map +1 -1
  547. package/lib/components/Icon/icons/send.icon.js +1 -1
  548. package/lib/components/Icon/icons/send.icon.js.map +1 -1
  549. package/lib/components/Icon/icons/slideshow-solid.icon.js +1 -1
  550. package/lib/components/Icon/icons/slideshow-solid.icon.js.map +1 -1
  551. package/lib/components/Icon/icons/slideshow.icon.js +1 -1
  552. package/lib/components/Icon/icons/slideshow.icon.js.map +1 -1
  553. package/lib/components/Icon/icons/snow.icon.js +1 -1
  554. package/lib/components/Icon/icons/snow.icon.js.map +1 -1
  555. package/lib/components/Icon/icons/speaker-solid.icon.js +1 -1
  556. package/lib/components/Icon/icons/speaker-solid.icon.js.map +1 -1
  557. package/lib/components/Icon/icons/speaker.icon.js +1 -1
  558. package/lib/components/Icon/icons/speaker.icon.js.map +1 -1
  559. package/lib/components/Icon/icons/star-solid.icon.js +1 -1
  560. package/lib/components/Icon/icons/star-solid.icon.js.map +1 -1
  561. package/lib/components/Icon/icons/star.icon.js +1 -1
  562. package/lib/components/Icon/icons/star.icon.js.map +1 -1
  563. package/lib/components/Icon/icons/target-solid.icon.js +1 -1
  564. package/lib/components/Icon/icons/target-solid.icon.js.map +1 -1
  565. package/lib/components/Icon/icons/target.icon.js +1 -1
  566. package/lib/components/Icon/icons/target.icon.js.map +1 -1
  567. package/lib/components/Icon/icons/thumbs-up-solid.icon.js +1 -1
  568. package/lib/components/Icon/icons/thumbs-up-solid.icon.js.map +1 -1
  569. package/lib/components/Icon/icons/thumbs-up.icon.js +1 -1
  570. package/lib/components/Icon/icons/thumbs-up.icon.js.map +1 -1
  571. package/lib/components/Icon/icons/times.icon.js +1 -1
  572. package/lib/components/Icon/icons/times.icon.js.map +1 -1
  573. package/lib/components/Icon/icons/trash-solid.icon.js +1 -1
  574. package/lib/components/Icon/icons/trash-solid.icon.js.map +1 -1
  575. package/lib/components/Icon/icons/trash.icon.js +1 -1
  576. package/lib/components/Icon/icons/trash.icon.js.map +1 -1
  577. package/lib/components/Icon/icons/twitter.icon.js +1 -1
  578. package/lib/components/Icon/icons/twitter.icon.js.map +1 -1
  579. package/lib/components/Icon/icons/undock.icon.js +1 -1
  580. package/lib/components/Icon/icons/undock.icon.js.map +1 -1
  581. package/lib/components/Icon/icons/user-solid.icon.js +1 -1
  582. package/lib/components/Icon/icons/user-solid.icon.js.map +1 -1
  583. package/lib/components/Icon/icons/user-star-solid.icon.js +1 -1
  584. package/lib/components/Icon/icons/user-star-solid.icon.js.map +1 -1
  585. package/lib/components/Icon/icons/user-star.icon.js +1 -1
  586. package/lib/components/Icon/icons/user-star.icon.js.map +1 -1
  587. package/lib/components/Icon/icons/user.icon.js +1 -1
  588. package/lib/components/Icon/icons/user.icon.js.map +1 -1
  589. package/lib/components/Icon/icons/warn-solid.icon.js +1 -1
  590. package/lib/components/Icon/icons/warn-solid.icon.js.map +1 -1
  591. package/lib/components/Icon/icons/warn.icon.js +1 -1
  592. package/lib/components/Icon/icons/warn.icon.js.map +1 -1
  593. package/lib/components/Icon/index.d.ts +1 -1
  594. package/lib/components/Icon/index.d.ts.map +1 -1
  595. package/lib/components/Icon/index.js.map +1 -1
  596. package/lib/components/Input/Input.d.ts +3 -1
  597. package/lib/components/Input/Input.d.ts.map +1 -1
  598. package/lib/components/Input/Input.js +16 -2
  599. package/lib/components/Input/Input.js.map +1 -1
  600. package/lib/components/Input/Input.styles.d.ts +1 -0
  601. package/lib/components/Input/Input.styles.d.ts.map +1 -1
  602. package/lib/components/Input/Input.styles.js +31 -0
  603. package/lib/components/Input/Input.styles.js.map +1 -1
  604. package/lib/components/Link/Link.d.ts +4 -1
  605. package/lib/components/Link/Link.d.ts.map +1 -1
  606. package/lib/components/Link/Link.js +87 -30
  607. package/lib/components/Link/Link.js.map +1 -1
  608. package/lib/components/List/CommaSeparatedList.d.ts.map +1 -1
  609. package/lib/components/List/CommaSeparatedList.js +6 -14
  610. package/lib/components/List/CommaSeparatedList.js.map +1 -1
  611. package/lib/components/List/List.d.ts +2 -2
  612. package/lib/components/List/List.d.ts.map +1 -1
  613. package/lib/components/List/List.js.map +1 -1
  614. package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
  615. package/lib/components/ListToolbar/ListToolbar.js +108 -53
  616. package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
  617. package/lib/components/ListToolbar/ListToolbar.styles.d.ts +1 -0
  618. package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
  619. package/lib/components/ListToolbar/ListToolbar.styles.js +38 -2
  620. package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
  621. package/lib/components/ListToolbar/ListToolbar.types.d.ts +28 -10
  622. package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
  623. package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
  624. package/lib/components/ListToolbar/PresetMenuPopover.d.ts +12 -0
  625. package/lib/components/ListToolbar/PresetMenuPopover.d.ts.map +1 -0
  626. package/lib/components/ListToolbar/PresetMenuPopover.js +36 -0
  627. package/lib/components/ListToolbar/PresetMenuPopover.js.map +1 -0
  628. package/lib/components/ListToolbar/QueryOptionPopover.d.ts.map +1 -1
  629. package/lib/components/ListToolbar/QueryOptionPopover.js +14 -44
  630. package/lib/components/ListToolbar/QueryOptionPopover.js.map +1 -1
  631. package/lib/components/Location/LocationInput.d.ts +3 -1
  632. package/lib/components/Location/LocationInput.d.ts.map +1 -1
  633. package/lib/components/Location/LocationInput.js +2 -2
  634. package/lib/components/Location/LocationInput.js.map +1 -1
  635. package/lib/components/Location/LocationView.d.ts +1 -1
  636. package/lib/components/Location/LocationView.d.ts.map +1 -1
  637. package/lib/components/Location/LocationView.js +16 -10
  638. package/lib/components/Location/LocationView.js.map +1 -1
  639. package/lib/components/Location/utils.d.ts +3 -2
  640. package/lib/components/Location/utils.d.ts.map +1 -1
  641. package/lib/components/Location/utils.js +17 -9
  642. package/lib/components/Location/utils.js.map +1 -1
  643. package/lib/components/Menu/Menu.d.ts.map +1 -1
  644. package/lib/components/Menu/Menu.js +10 -6
  645. package/lib/components/Menu/Menu.js.map +1 -1
  646. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  647. package/lib/components/Menu/Menu.styles.js +4 -2
  648. package/lib/components/Menu/Menu.styles.js.map +1 -1
  649. package/lib/components/Menu/Menu.types.d.ts +13 -0
  650. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  651. package/lib/components/Menu/Menu.types.js.map +1 -1
  652. package/lib/components/Menu/MenuGroup.d.ts.map +1 -1
  653. package/lib/components/Menu/MenuGroup.js +3 -3
  654. package/lib/components/Menu/MenuGroup.js.map +1 -1
  655. package/lib/components/Menu/MenuItem.d.ts.map +1 -1
  656. package/lib/components/Menu/MenuItem.js +4 -8
  657. package/lib/components/Menu/MenuItem.js.map +1 -1
  658. package/lib/components/Menu/MenuList.d.ts.map +1 -1
  659. package/lib/components/Menu/MenuList.js +23 -14
  660. package/lib/components/Menu/MenuList.js.map +1 -1
  661. package/lib/components/Menu/NavItemsList.d.ts +2 -2
  662. package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
  663. package/lib/components/Menu/NavItemsList.js +12 -7
  664. package/lib/components/Menu/NavItemsList.js.map +1 -1
  665. package/lib/components/Menu/helpers.d.ts +7 -7
  666. package/lib/components/Menu/helpers.d.ts.map +1 -1
  667. package/lib/components/Menu/index.d.ts +1 -1
  668. package/lib/components/Menu/index.d.ts.map +1 -1
  669. package/lib/components/Menu/index.js +1 -1
  670. package/lib/components/Menu/index.js.map +1 -1
  671. package/lib/components/MetaList/MetaList.d.ts.map +1 -1
  672. package/lib/components/MetaList/MetaList.js +13 -10
  673. package/lib/components/MetaList/MetaList.js.map +1 -1
  674. package/lib/components/Modal/Contexts.d.ts.map +1 -1
  675. package/lib/components/Modal/Contexts.js +2 -3
  676. package/lib/components/Modal/Contexts.js.map +1 -1
  677. package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
  678. package/lib/components/Modal/MinimizedModal.js +2 -5
  679. package/lib/components/Modal/MinimizedModal.js.map +1 -1
  680. package/lib/components/Modal/Modal.d.ts.map +1 -1
  681. package/lib/components/Modal/Modal.js +3 -5
  682. package/lib/components/Modal/Modal.js.map +1 -1
  683. package/lib/components/Modal/Modal.types.d.ts +2 -6
  684. package/lib/components/Modal/Modal.types.d.ts.map +1 -1
  685. package/lib/components/Modal/Modal.types.js +1 -2
  686. package/lib/components/Modal/Modal.types.js.map +1 -1
  687. package/lib/components/Modal/ModalManager.d.ts +8 -2
  688. package/lib/components/Modal/ModalManager.d.ts.map +1 -1
  689. package/lib/components/Modal/ModalManager.js +14 -20
  690. package/lib/components/Modal/ModalManager.js.map +1 -1
  691. package/lib/components/Modal/index.d.ts +0 -1
  692. package/lib/components/Modal/index.d.ts.map +1 -1
  693. package/lib/components/Modal/index.js +0 -1
  694. package/lib/components/Modal/index.js.map +1 -1
  695. package/lib/components/MultiStepForm/FormProgress.d.ts +10 -0
  696. package/lib/components/MultiStepForm/FormProgress.d.ts.map +1 -0
  697. package/lib/components/{MultiStep/MultiStep.js → MultiStepForm/FormProgress.js} +8 -22
  698. package/lib/components/MultiStepForm/FormProgress.js.map +1 -0
  699. package/lib/components/{MultiStep/MultiStep.styles.d.ts → MultiStepForm/FormProgress.styles.d.ts} +2 -4
  700. package/lib/components/MultiStepForm/FormProgress.styles.d.ts.map +1 -0
  701. package/lib/components/{MultiStep/MultiStep.styles.js → MultiStepForm/FormProgress.styles.js} +3 -4
  702. package/lib/components/MultiStepForm/FormProgress.styles.js.map +1 -0
  703. package/lib/components/MultiStepForm/MultiStepForm.d.ts +9 -0
  704. package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -0
  705. package/lib/components/MultiStepForm/MultiStepForm.js +50 -0
  706. package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -0
  707. package/lib/components/MultiStepForm/MultiStepForm.types.d.ts +48 -0
  708. package/lib/components/MultiStepForm/MultiStepForm.types.d.ts.map +1 -0
  709. package/lib/components/MultiStepForm/MultiStepForm.types.js +2 -0
  710. package/lib/components/MultiStepForm/MultiStepForm.types.js.map +1 -0
  711. package/lib/components/MultiStepForm/index.d.ts +2 -0
  712. package/lib/components/MultiStepForm/index.d.ts.map +1 -0
  713. package/lib/components/MultiStepForm/index.js +2 -0
  714. package/lib/components/MultiStepForm/index.js.map +1 -0
  715. package/lib/components/Number/NumberDisplay.d.ts +0 -5
  716. package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
  717. package/lib/components/Number/NumberDisplay.js +8 -12
  718. package/lib/components/Number/NumberDisplay.js.map +1 -1
  719. package/lib/components/Number/NumberInput.d.ts +1 -1
  720. package/lib/components/Number/NumberInput.d.ts.map +1 -1
  721. package/lib/components/Number/NumberInput.js +60 -35
  722. package/lib/components/Number/NumberInput.js.map +1 -1
  723. package/lib/components/Number/NumberInput.styles.d.ts +8 -5
  724. package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
  725. package/lib/components/Number/NumberInput.styles.js +6 -3
  726. package/lib/components/Number/NumberInput.styles.js.map +1 -1
  727. package/lib/components/Number/NumberInput.types.d.ts +56 -21
  728. package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
  729. package/lib/components/Number/NumberInput.types.js.map +1 -1
  730. package/lib/components/Number/NumberRangeInput.d.ts +6 -0
  731. package/lib/components/Number/NumberRangeInput.d.ts.map +1 -0
  732. package/lib/components/Number/NumberRangeInput.js +30 -0
  733. package/lib/components/Number/NumberRangeInput.js.map +1 -0
  734. package/lib/components/Number/index.d.ts +3 -2
  735. package/lib/components/Number/index.d.ts.map +1 -1
  736. package/lib/components/Number/index.js +1 -0
  737. package/lib/components/Number/index.js.map +1 -1
  738. package/lib/components/Number/utils.d.ts +3 -4
  739. package/lib/components/Number/utils.d.ts.map +1 -1
  740. package/lib/components/Number/utils.js +41 -21
  741. package/lib/components/Number/utils.js.map +1 -1
  742. package/lib/components/PageTemplates/CategorySubPage.d.ts +3 -3
  743. package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
  744. package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
  745. package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
  746. package/lib/components/PageTemplates/DashboardPage.js +1 -4
  747. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  748. package/lib/components/PageTemplates/PageTemplates.d.ts +1 -2
  749. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  750. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  751. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  752. package/lib/components/Phone/PhoneInput.js +13 -3
  753. package/lib/components/Phone/PhoneInput.js.map +1 -1
  754. package/lib/components/Popover/Popover.d.ts +2 -0
  755. package/lib/components/Popover/Popover.d.ts.map +1 -1
  756. package/lib/components/Popover/Popover.js +13 -9
  757. package/lib/components/Popover/Popover.js.map +1 -1
  758. package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
  759. package/lib/components/Popover/Popover.styles.js +12 -57
  760. package/lib/components/Popover/Popover.styles.js.map +1 -1
  761. package/lib/components/Popover/PopoverContext.d.ts +1 -0
  762. package/lib/components/Popover/PopoverContext.d.ts.map +1 -1
  763. package/lib/components/Popover/PopoverContext.js +2 -1
  764. package/lib/components/Popover/PopoverContext.js.map +1 -1
  765. package/lib/components/Popover/PopoverManager.d.ts.map +1 -1
  766. package/lib/components/Popover/PopoverManager.js +2 -1
  767. package/lib/components/Popover/PopoverManager.js.map +1 -1
  768. package/lib/components/Progress/Ring.js +2 -2
  769. package/lib/components/Progress/Ring.js.map +1 -1
  770. package/lib/components/RadioButton/RadioButton.d.ts +3 -1
  771. package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
  772. package/lib/components/RadioButton/RadioButton.js.map +1 -1
  773. package/lib/components/RadioCheck/RadioCheck.d.ts +2 -0
  774. package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
  775. package/lib/components/RadioCheck/RadioCheck.js +6 -5
  776. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  777. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +3 -0
  778. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
  779. package/lib/components/RadioCheckGroup/RadioCheckGroup.js +1 -1
  780. package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
  781. package/lib/components/RadioCheckGroup/index.d.ts +1 -1
  782. package/lib/components/RadioCheckGroup/index.d.ts.map +1 -1
  783. package/lib/components/RadioCheckGroup/index.js +1 -1
  784. package/lib/components/RadioCheckGroup/index.js.map +1 -1
  785. package/lib/components/SearchInput/SearchInput.d.ts +24 -8
  786. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  787. package/lib/components/SearchInput/SearchInput.js +127 -94
  788. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  789. package/lib/components/SearchInput/SearchInput.styles.d.ts +16 -0
  790. package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -0
  791. package/lib/components/SearchInput/SearchInput.styles.js +129 -0
  792. package/lib/components/SearchInput/SearchInput.styles.js.map +1 -0
  793. package/lib/components/SearchInput/index.d.ts +1 -1
  794. package/lib/components/SearchInput/index.d.ts.map +1 -1
  795. package/lib/components/SearchInput/index.js +1 -1
  796. package/lib/components/SearchInput/index.js.map +1 -1
  797. package/lib/components/Select/Select.d.ts +5 -0
  798. package/lib/components/Select/Select.d.ts.map +1 -1
  799. package/lib/components/Select/Select.js +14 -5
  800. package/lib/components/Select/Select.js.map +1 -1
  801. package/lib/components/Skeleton/ParagraphSkeleton.d.ts.map +1 -1
  802. package/lib/components/Skeleton/ParagraphSkeleton.js +2 -2
  803. package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
  804. package/lib/components/SkipLinks/SkipLinks.d.ts +15 -0
  805. package/lib/components/SkipLinks/SkipLinks.d.ts.map +1 -0
  806. package/lib/components/SkipLinks/SkipLinks.js +67 -0
  807. package/lib/components/SkipLinks/SkipLinks.js.map +1 -0
  808. package/lib/components/SkipLinks/index.d.ts +4 -0
  809. package/lib/components/SkipLinks/index.d.ts.map +1 -0
  810. package/lib/components/SkipLinks/index.js +3 -0
  811. package/lib/components/SkipLinks/index.js.map +1 -0
  812. package/lib/components/Slider/Slider.styles.d.ts +1 -1
  813. package/lib/components/SummaryItem/SummaryItem.d.ts +2 -2
  814. package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
  815. package/lib/components/SummaryList/ViewAll.js +6 -2
  816. package/lib/components/SummaryList/ViewAll.js.map +1 -1
  817. package/lib/components/Tabs/Tab.d.ts.map +1 -1
  818. package/lib/components/Tabs/Tab.js +0 -1
  819. package/lib/components/Tabs/Tab.js.map +1 -1
  820. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  821. package/lib/components/Tabs/TabPanel.js +1 -7
  822. package/lib/components/Tabs/TabPanel.js.map +1 -1
  823. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  824. package/lib/components/Tabs/Tabs.js +1 -1
  825. package/lib/components/Tabs/Tabs.js.map +1 -1
  826. package/lib/components/Text/Text.js +2 -2
  827. package/lib/components/Text/Text.js.map +1 -1
  828. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  829. package/lib/components/TextArea/TextArea.js +8 -3
  830. package/lib/components/TextArea/TextArea.js.map +1 -1
  831. package/lib/components/Toaster/Context.d.ts +7 -0
  832. package/lib/components/Toaster/Context.d.ts.map +1 -0
  833. package/lib/components/Toaster/Context.js +6 -0
  834. package/lib/components/Toaster/Context.js.map +1 -0
  835. package/lib/components/Toaster/Toaster.d.ts +8 -40
  836. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  837. package/lib/components/Toaster/Toaster.js +12 -12
  838. package/lib/components/Toaster/Toaster.js.map +1 -1
  839. package/lib/components/Toaster/Toaster.types.d.ts +31 -0
  840. package/lib/components/Toaster/Toaster.types.d.ts.map +1 -0
  841. package/lib/components/Toaster/Toaster.types.js +2 -0
  842. package/lib/components/Toaster/Toaster.types.js.map +1 -0
  843. package/lib/components/Toaster/index.d.ts +1 -2
  844. package/lib/components/Toaster/index.d.ts.map +1 -1
  845. package/lib/components/Toaster/index.js +0 -1
  846. package/lib/components/Toaster/index.js.map +1 -1
  847. package/lib/components/Tooltip/Tooltip.d.ts +5 -0
  848. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  849. package/lib/components/Tooltip/Tooltip.js +23 -5
  850. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  851. package/lib/components/Tree/StandardTree.d.ts.map +1 -1
  852. package/lib/components/Tree/StandardTree.js +27 -13
  853. package/lib/components/Tree/StandardTree.js.map +1 -1
  854. package/lib/components/Tree/StandardTree.styles.js +3 -3
  855. package/lib/components/Tree/StandardTree.styles.js.map +1 -1
  856. package/lib/components/Tree/StandardTree.types.d.ts +1 -0
  857. package/lib/components/Tree/StandardTree.types.d.ts.map +1 -1
  858. package/lib/components/Tree/StandardTree.types.js.map +1 -1
  859. package/lib/hooks/index.d.ts +3 -0
  860. package/lib/hooks/index.d.ts.map +1 -1
  861. package/lib/hooks/index.js +3 -0
  862. package/lib/hooks/index.js.map +1 -1
  863. package/lib/hooks/useActiveDescendant.d.ts +5 -1
  864. package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
  865. package/lib/hooks/useActiveDescendant.js +175 -99
  866. package/lib/hooks/useActiveDescendant.js.map +1 -1
  867. package/lib/hooks/useAutoResize.d.ts +1 -1
  868. package/lib/hooks/useAutoResize.d.ts.map +1 -1
  869. package/lib/hooks/useAutoResize.js +14 -6
  870. package/lib/hooks/useAutoResize.js.map +1 -1
  871. package/lib/hooks/useBreakpoint.d.ts +3 -2
  872. package/lib/hooks/useBreakpoint.d.ts.map +1 -1
  873. package/lib/hooks/useBreakpoint.js +10 -13
  874. package/lib/hooks/useBreakpoint.js.map +1 -1
  875. package/lib/hooks/useConfiguration.d.ts +1 -0
  876. package/lib/hooks/useConfiguration.d.ts.map +1 -1
  877. package/lib/hooks/useConfiguration.js +9 -2
  878. package/lib/hooks/useConfiguration.js.map +1 -1
  879. package/lib/hooks/useDraggable.d.ts +1 -1
  880. package/lib/hooks/useDraggable.d.ts.map +1 -1
  881. package/lib/hooks/useDraggable.js +35 -8
  882. package/lib/hooks/useDraggable.js.map +1 -1
  883. package/lib/hooks/useFocusWithin.d.ts.map +1 -1
  884. package/lib/hooks/useFocusWithin.js +0 -8
  885. package/lib/hooks/useFocusWithin.js.map +1 -1
  886. package/lib/hooks/useI18n.d.ts +131 -34
  887. package/lib/hooks/useI18n.d.ts.map +1 -1
  888. package/lib/hooks/useI18n.js +2 -1
  889. package/lib/hooks/useI18n.js.map +1 -1
  890. package/lib/hooks/useInputFormatter.d.ts.map +1 -1
  891. package/lib/hooks/useInputFormatter.js +5 -0
  892. package/lib/hooks/useInputFormatter.js.map +1 -1
  893. package/lib/hooks/useLongPress.d.ts +1 -1
  894. package/lib/hooks/useLongPress.d.ts.map +1 -1
  895. package/lib/hooks/useModalContext.d.ts +7 -0
  896. package/lib/hooks/useModalContext.d.ts.map +1 -0
  897. package/lib/hooks/useModalContext.js +12 -0
  898. package/lib/hooks/useModalContext.js.map +1 -0
  899. package/lib/hooks/useModalManager.d.ts +8 -0
  900. package/lib/hooks/useModalManager.d.ts.map +1 -0
  901. package/lib/hooks/useModalManager.js +16 -0
  902. package/lib/hooks/useModalManager.js.map +1 -0
  903. package/lib/hooks/useOS.d.ts.map +1 -1
  904. package/lib/hooks/useOS.js +1 -2
  905. package/lib/hooks/useOS.js.map +1 -1
  906. package/lib/hooks/useScrollStick.d.ts +1 -1
  907. package/lib/hooks/useScrollStick.d.ts.map +1 -1
  908. package/lib/hooks/useToaster.d.ts +8 -0
  909. package/lib/hooks/useToaster.d.ts.map +1 -0
  910. package/lib/hooks/useToaster.js +16 -0
  911. package/lib/hooks/useToaster.js.map +1 -0
  912. package/lib/hooks/useTransitionState.js +1 -1
  913. package/lib/hooks/useTransitionState.js.map +1 -1
  914. package/lib/i18n/default.d.ts +131 -34
  915. package/lib/i18n/default.d.ts.map +1 -1
  916. package/lib/i18n/default.js +154 -47
  917. package/lib/i18n/default.js.map +1 -1
  918. package/lib/i18n/i18n.d.ts +127 -698
  919. package/lib/i18n/i18n.d.ts.map +1 -1
  920. package/lib/i18n/translate.d.ts +3 -0
  921. package/lib/i18n/translate.d.ts.map +1 -1
  922. package/lib/i18n/translate.js.map +1 -1
  923. package/lib/index.d.ts +9 -2
  924. package/lib/index.d.ts.map +1 -1
  925. package/lib/index.js +9 -2
  926. package/lib/index.js.map +1 -1
  927. package/lib/init.d.ts +8 -0
  928. package/lib/init.d.ts.map +1 -0
  929. package/lib/init.js +5 -0
  930. package/lib/init.js.map +1 -0
  931. package/lib/register-contexts.d.ts +2 -0
  932. package/lib/register-contexts.d.ts.map +1 -0
  933. package/lib/register-contexts.js +10 -0
  934. package/lib/register-contexts.js.map +1 -0
  935. package/lib/styles/utils.d.ts +1 -1
  936. package/lib/styles/utils.d.ts.map +1 -1
  937. package/lib/styles/utils.js.map +1 -1
  938. package/lib/theme/ThemeMachine.d.ts +11 -3
  939. package/lib/theme/ThemeMachine.d.ts.map +1 -1
  940. package/lib/theme/ThemeMachine.js +28 -26
  941. package/lib/theme/ThemeMachine.js.map +1 -1
  942. package/lib/theme/index.d.ts +1 -0
  943. package/lib/theme/index.d.ts.map +1 -1
  944. package/lib/theme/index.js +1 -0
  945. package/lib/theme/index.js.map +1 -1
  946. package/lib/theme/theme.d.ts +54 -0
  947. package/lib/theme/theme.d.ts.map +1 -1
  948. package/lib/theme/themeDefinition.json +33 -1
  949. package/lib/theme/themeOverrides.schema.json +9 -0
  950. package/lib/theme/themes/buildTheme.json +0 -3
  951. package/lib/theme/themes/darkTheme.json +3 -1
  952. package/lib/theme/themes/legacyBuildTheme.json +0 -3
  953. package/lib/theme/themes/wssTheme.json +6 -0
  954. package/lib/types/types.d.ts +3 -0
  955. package/lib/types/types.d.ts.map +1 -1
  956. package/lib/types/types.js.map +1 -1
  957. package/lib/utils/utils.d.ts +5 -0
  958. package/lib/utils/utils.d.ts.map +1 -1
  959. package/lib/utils/utils.js +23 -0
  960. package/lib/utils/utils.js.map +1 -1
  961. package/package.json +10 -5
  962. package/lib/components/AppShell/SkipNavigation.d.ts +0 -4
  963. package/lib/components/AppShell/SkipNavigation.d.ts.map +0 -1
  964. package/lib/components/AppShell/SkipNavigation.js +0 -61
  965. package/lib/components/AppShell/SkipNavigation.js.map +0 -1
  966. package/lib/components/Currency/currencyCodes.d.ts +0 -3
  967. package/lib/components/Currency/currencyCodes.d.ts.map +0 -1
  968. package/lib/components/Currency/currencyCodes.js +0 -182
  969. package/lib/components/Currency/currencyCodes.js.map +0 -1
  970. package/lib/components/DateTime/types.d.ts +0 -9
  971. package/lib/components/DateTime/types.d.ts.map +0 -1
  972. package/lib/components/DateTime/types.js +0 -2
  973. package/lib/components/DateTime/types.js.map +0 -1
  974. package/lib/components/Icon/icons/script-solid.icon.d.ts.map +0 -1
  975. package/lib/components/Icon/icons/script-solid.icon.js +0 -6
  976. package/lib/components/Icon/icons/script-solid.icon.js.map +0 -1
  977. package/lib/components/MultiStep/MultiStep.d.ts +0 -6
  978. package/lib/components/MultiStep/MultiStep.d.ts.map +0 -1
  979. package/lib/components/MultiStep/MultiStep.js.map +0 -1
  980. package/lib/components/MultiStep/MultiStep.styles.d.ts.map +0 -1
  981. package/lib/components/MultiStep/MultiStep.styles.js.map +0 -1
  982. package/lib/components/MultiStep/MultiStep.types.d.ts +0 -36
  983. package/lib/components/MultiStep/MultiStep.types.d.ts.map +0 -1
  984. package/lib/components/MultiStep/MultiStep.types.js +0 -2
  985. package/lib/components/MultiStep/MultiStep.types.js.map +0 -1
  986. package/lib/components/MultiStep/index.d.ts +0 -3
  987. package/lib/components/MultiStep/index.d.ts.map +0 -1
  988. package/lib/components/MultiStep/index.js +0 -2
  989. package/lib/components/MultiStep/index.js.map +0 -1
@@ -52,7 +52,7 @@ const convertToCallbackParameter = (date, parts) => {
52
52
  };
53
53
  const DateInput = forwardRef((props, ref) => {
54
54
  const { locale } = useConfiguration();
55
- const { defaultValue, value = defaultValue, min, max, id, label, labelHidden, info = getDateFormat(locale).join(''), status, required, readOnly, disabled, onChange, onFocus, onBlur, showWeekNumber, picker, autoFocus, ...restProps } = props;
55
+ const { defaultValue, value = defaultValue, min, max, id, label, labelHidden, info = getDateFormat(locale).join(''), status, required, readOnly, disabled, onChange, onFocus, onBlur, onResolveSuggestion, showWeekNumber, picker: { renderer: PickerComp = DatePicker, rendererProps = {} } = {}, autoFocus, additionalInfo, ...restProps } = props;
56
56
  const t = useI18n();
57
57
  const date = value !== undefined ? parseToDate(value) : undefined;
58
58
  const [yearInputRef, monthInputRef, dayInputRef] = [
@@ -79,6 +79,7 @@ const DateInput = forwardRef((props, ref) => {
79
79
  : undefined;
80
80
  }
81
81
  };
82
+ const [open, setOpen, , setPopoverRef, buttonEl, setButtonEl] = usePickerButton();
82
83
  const inputContainerRef = useRef(null);
83
84
  const onFocusChange = (focused) => {
84
85
  const callbackParam = convertToCallbackParameter(date ? new Date(date) : new Date(), pickParts());
@@ -88,9 +89,9 @@ const DateInput = forwardRef((props, ref) => {
88
89
  if (inputContainerRef.current)
89
90
  inputContainerRef.current.scrollTop = 0;
90
91
  onBlur?.(callbackParam);
92
+ setOpen(false);
91
93
  }
92
94
  };
93
- const [open, setOpen, , setPopoverRef, buttonEl, setButtonEl] = usePickerButton();
94
95
  const onInputChange = () => {
95
96
  onChange?.(convertToCallbackParameter(date ? new Date(date) : new Date(), pickParts()));
96
97
  buttonEl?.setAttribute('aria-label', generatePickerButtonAriaLabel(currentlySelectedDate(), 'date', locale, t, open));
@@ -109,9 +110,10 @@ const DateInput = forwardRef((props, ref) => {
109
110
  onInputChange();
110
111
  }
111
112
  };
112
- const DayInput = (_jsx(PartInput, { placeholder: t('day_placeholder'), "aria-label": t('day_label_a11y'), value: date?.getUTCDate(), onChange: onInputChange, size: 2, maxLength: 2, readOnly: readOnly, min: 1, max: 31, ref: dayInputRef }, 'day'));
113
- const MonthInput = (_jsx(PartInput, { placeholder: t('month_placeholder'), "aria-label": t('month_label_a11y'), value: date ? date?.getUTCMonth() + 1 : undefined, onChange: onInputChange, size: 2, maxLength: 2, readOnly: readOnly, min: 1, max: 12, ref: monthInputRef }, 'month'));
114
- const YearInput = (_jsx(PartInput, { placeholder: t('year_placeholder'), "aria-label": t('year_label_a11y'), value: date?.getUTCFullYear(), onChange: onInputChange, size: 4, maxLength: 4, readOnly: readOnly, min: 1, ref: yearInputRef }, 'year'));
113
+ const displayNames = new Intl.DisplayNames(locale, { style: 'long', type: 'dateTimeField' });
114
+ const DayInput = (_jsx(PartInput, { placeholder: t('day_placeholder'), "aria-label": displayNames.of('day'), value: date?.getUTCDate(), onChange: onInputChange, size: 2, maxLength: 2, readOnly: readOnly, min: 1, max: 31, ref: dayInputRef }, 'day'));
115
+ const MonthInput = (_jsx(PartInput, { placeholder: t('month_placeholder'), "aria-label": displayNames.of('month'), value: date ? date?.getUTCMonth() + 1 : undefined, onChange: onInputChange, size: 2, maxLength: 2, readOnly: readOnly, min: 1, max: 12, ref: monthInputRef }, 'month'));
116
+ const YearInput = (_jsx(PartInput, { placeholder: t('year_placeholder'), "aria-label": displayNames.of('year'), value: date?.getUTCFullYear(), onChange: onInputChange, size: 4, maxLength: 4, readOnly: readOnly, min: 1, ref: yearInputRef }, 'year'));
115
117
  const containerRef = useRef(null);
116
118
  useFocusWithin([containerRef], onFocusChange);
117
119
  useImperativeHandle(ref, () => ({
@@ -121,22 +123,22 @@ const DateInput = forwardRef((props, ref) => {
121
123
  return currentlySelectedDate();
122
124
  }
123
125
  }));
124
- const Picker = (_jsx(DatePicker, { selected: currentlySelectedDate(), onChange: selected => {
125
- setInputValue(selected);
126
- setOpen(false);
127
- setTimeout(() => buttonEl?.focus());
128
- onInputChange();
129
- }, min: min, max: max, showWeekNumber: showWeekNumber }));
130
- const PickerButton = (_jsxs(_Fragment, { children: [_jsx(Button, { variant: 'simple', icon: true, ref: setButtonEl, onClick: () => setOpen(cur => !cur), "aria-label": generatePickerButtonAriaLabel(currentlySelectedDate(), 'date', locale, t, open), readOnly: readOnly, disabled: disabled, children: _jsx(Icon, { name: open ? 'times' : 'calendar' }) }), _jsx(Popover, { show: open, ref: setPopoverRef, target: containerRef.current, placement: 'bottom-end', strategy: 'fixed', modifiers: [
126
+ const PickerButton = (_jsxs(_Fragment, { children: [_jsx(Button, { variant: 'simple', icon: true, ref: setButtonEl, onClick: () => setOpen(cur => !cur), "aria-label": generatePickerButtonAriaLabel(currentlySelectedDate(), 'date', locale, t, open), readOnly: readOnly, disabled: disabled, children: _jsx(Icon, { name: open ? 'times' : 'calendar' }) }), open && (_jsx(Popover, { ref: setPopoverRef, target: buttonEl, placement: 'bottom-end', strategy: 'fixed', modifiers: [
131
127
  {
132
128
  name: 'flip',
133
129
  options: {
134
130
  fallbackPlacements: ['top-end', 'right', 'left']
135
131
  }
136
132
  }
137
- ], children: picker || Picker })] }));
133
+ ], children: _jsx(PickerComp, { selected: currentlySelectedDate(), min: min, max: max, showWeekNumber: showWeekNumber, ...rendererProps, onChange: selected => {
134
+ setInputValue(selected);
135
+ setOpen(false);
136
+ setTimeout(() => buttonEl?.focus());
137
+ onInputChange();
138
+ rendererProps?.onChange?.(selected);
139
+ } }) }))] }));
138
140
  const orderedRefs = [];
139
- const Comp = (_jsxs(Flex, { as: StyledDateInput, forwardedAs: StyledFormControl, container: { alignItems: 'center', wrap: 'nowrap' }, status: status, readOnly: readOnly, disabled: disabled, ref: containerRef, onClick: (e) => {
141
+ const Comp = (_jsxs(Flex, { as: StyledDateInput, forwardedAs: StyledFormControl, hasSuggestion: status === 'pending' && !!onResolveSuggestion, container: { alignItems: 'center', wrap: 'nowrap' }, status: status, readOnly: readOnly, disabled: disabled, ref: containerRef, onClick: (e) => {
140
142
  if (e.target === containerRef.current)
141
143
  orderedRefs[0].current?.focus();
142
144
  }, ...restProps, children: [_jsx(Flex, { ref: inputContainerRef, as: StyledInputContainer, container: { alignItems: 'center', wrap: 'wrap' }, onPaste: onPaste, children: getDateFormat(locale).map(part => {
@@ -159,7 +161,17 @@ const DateInput = forwardRef((props, ref) => {
159
161
  orderedRefs[0].current?.focus();
160
162
  }, [autoFocus]);
161
163
  useAutoFocusNextInput(orderedRefs);
162
- return label ? (_jsx(FormField, { as: 'fieldset', labelAs: 'legend', ...{ label, labelHidden, id, info, status, required, disabled }, ref: ref, children: Comp })) : (Comp);
164
+ return label ? (_jsx(FormField, { as: 'fieldset', "aria-labelledby": id, labelAs: 'legend', ...{
165
+ label,
166
+ labelHidden,
167
+ id,
168
+ info,
169
+ status,
170
+ required,
171
+ disabled,
172
+ onResolveSuggestion,
173
+ additionalInfo
174
+ }, ref: ref, children: Comp })) : (Comp);
163
175
  });
164
176
  export default DateInput;
165
177
  //# sourceMappingURL=DateInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateInput.js","sourceRoot":"","sources":["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,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,EACjD,OAAO,EAAE,OAAO,YAEf,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;oBAChC,QAAQ,IAAI,EAAE;wBACZ,KAAK,IAAI;4BACP,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;4BAC9B,OAAO,QAAQ,CAAC;wBAClB,KAAK,IAAI;4BACP,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;4BAChC,OAAO,UAAU,CAAC;wBACpB,KAAK,MAAM;4BACT,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;4BAC/B,OAAO,SAAS,CAAC;wBACnB;4BACE,OAAO,IAAI,CAAC;qBACf;gBACH,CAAC,CAAC,GACG,EACN,CAAC,QAAQ,IAAI,YAAY,IACrB,CACR,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS;YAAE,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IACjD,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAEnC,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,IACR,EAAE,EAAC,UAAU,EACb,OAAO,EAAC,QAAQ,KACZ,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAChE,GAAG,EAAE,GAAG,YAEP,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {\n ClipboardEvent,\n FunctionComponent,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useRef,\n RefObject,\n ReactNode,\n Dispatch,\n SetStateAction,\n useImperativeHandle,\n useEffect\n} from 'react';\nimport styled from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { useConfiguration, useFocusWithin, useI18n } from '../../../hooks';\nimport { ForwardProps } from '../../../types';\nimport FormField from '../../FormField';\nimport Flex from '../../Flex';\nimport Button from '../../Button';\nimport Icon, { registerIcon } from '../../Icon';\nimport * as timesIcon from '../../Icon/icons/times.icon';\nimport * as calendarIcon from '../../Icon/icons/calendar.icon';\nimport DatePicker from '../Picker/DatePicker';\nimport Popover from '../../Popover';\nimport { StyledFormControl } from '../../FormControl';\nimport DateTimeProps, { DateTimeCallbackParameter } from '../DateTime.types';\n\nimport {\n getDateFormat,\n parsePastedTextToDate,\n parseToDate,\n validateDate,\n generatePickerButtonAriaLabel\n} from './utils';\nimport StyledDateTime, { StyledInputContainer } from './DateTime.styles';\nimport useAutoFocusNextInput from './useAutoFocusNextInput';\nimport PartInput from './PartInput';\nimport usePickerButton from './usePickerButton';\n\nregisterIcon(timesIcon, calendarIcon);\n\nexport interface DateInputProps extends DateTimeProps {\n /**\n * Display additional column with week number in date picker popover.\n * @default false\n */\n showWeekNumber?: boolean;\n /** Changes default date picker */\n picker?: ReactNode;\n}\n\nexport interface DateInputRefObject {\n readonly value: Date | undefined;\n setOpen: Dispatch<SetStateAction<boolean>>;\n buttonEl: HTMLElement | null;\n}\n\nexport const StyledDateInput = styled(StyledDateTime)<DateInputProps>`\n padding-inline-end: 0;\n`;\n\nStyledDateInput.defaultProps = defaultThemeProp;\n\nconst convertToCallbackParameter = (\n date: Date,\n parts: (string | undefined)[]\n): DateTimeCallbackParameter => {\n if (parts.every(Boolean)) {\n const [year, monthIndex, day] = parts.map(Number);\n\n if (!validateDate(year, monthIndex + 1, day)) {\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'invalid'\n };\n }\n\n date.setUTCFullYear(year, monthIndex, day);\n return {\n valueAsISOString: date.toISOString(),\n valueAsTimestamp: date.getTime()\n };\n }\n if (parts.every(p => !p)) {\n return {\n valueAsISOString: '',\n valueAsTimestamp: undefined\n };\n }\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'incomplete'\n };\n};\n\nconst DateInput: FunctionComponent<DateInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<DateInputProps>, ref: Ref<DateInputRefObject>) => {\n const { locale } = useConfiguration();\n const {\n defaultValue,\n value = defaultValue,\n min,\n max,\n id,\n label,\n labelHidden,\n info = getDateFormat(locale).join(''),\n status,\n required,\n readOnly,\n disabled,\n onChange,\n onFocus,\n onBlur,\n showWeekNumber,\n picker,\n autoFocus,\n ...restProps\n } = props;\n\n const t = useI18n();\n\n const date = value !== undefined ? parseToDate(value) : undefined;\n\n const [yearInputRef, monthInputRef, dayInputRef] = [\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null)\n ];\n\n const pickParts = () => {\n const month = monthInputRef.current?.value\n ? (Number(monthInputRef.current.value) - 1).toString()\n : undefined;\n return [\n yearInputRef.current?.value || undefined,\n month,\n dayInputRef.current?.value || undefined\n ];\n };\n\n const currentlySelectedDate = () => {\n const parts = pickParts();\n if (parts.every(Boolean)) {\n const [year, monthIndex, day] = parts.map(Number);\n\n return validateDate(year, monthIndex + 1, day)\n ? new Date(Date.UTC(year, monthIndex, day))\n : undefined;\n }\n };\n\n const inputContainerRef = useRef<HTMLDivElement>(null);\n\n const onFocusChange = (focused: boolean) => {\n const callbackParam = convertToCallbackParameter(\n date ? new Date(date) : new Date(),\n pickParts()\n );\n if (onFocus && focused) onFocus(callbackParam);\n if (!focused) {\n if (inputContainerRef.current) inputContainerRef.current.scrollTop = 0;\n onBlur?.(callbackParam);\n }\n };\n\n const [open, setOpen, , setPopoverRef, buttonEl, setButtonEl] = usePickerButton();\n\n const onInputChange = () => {\n onChange?.(convertToCallbackParameter(date ? new Date(date) : new Date(), pickParts()));\n buttonEl?.setAttribute(\n 'aria-label',\n generatePickerButtonAriaLabel(currentlySelectedDate(), 'date', locale, t, open)\n );\n };\n\n const setInputValue = (newValue: Date) => {\n dayInputRef.current!.value = newValue.getUTCDate().toString().padStart(2, '0');\n monthInputRef.current!.value = (newValue.getUTCMonth() + 1).toString().padStart(2, '0');\n yearInputRef.current!.value = newValue.getUTCFullYear().toString();\n };\n\n const onPaste = (e: ClipboardEvent) => {\n const text = e.clipboardData.getData('text');\n const newDate = parsePastedTextToDate(text, locale, date || new Date());\n if (newDate) {\n e.preventDefault();\n setInputValue(newDate);\n onInputChange();\n }\n };\n\n const DayInput = (\n <PartInput\n key='day'\n placeholder={t('day_placeholder')}\n aria-label={t('day_label_a11y')}\n value={date?.getUTCDate()}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n min={1}\n max={31}\n ref={dayInputRef}\n />\n );\n\n const MonthInput = (\n <PartInput\n key='month'\n placeholder={t('month_placeholder')}\n aria-label={t('month_label_a11y')}\n value={date ? date?.getUTCMonth() + 1 : undefined}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n min={1}\n max={12}\n ref={monthInputRef}\n />\n );\n\n const YearInput = (\n <PartInput\n key='year'\n placeholder={t('year_placeholder')}\n aria-label={t('year_label_a11y')}\n value={date?.getUTCFullYear()}\n onChange={onInputChange}\n size={4}\n maxLength={4}\n readOnly={readOnly}\n min={1}\n ref={yearInputRef}\n />\n );\n\n const containerRef = useRef<HTMLElement>(null);\n useFocusWithin([containerRef], onFocusChange);\n\n useImperativeHandle(ref, () => ({\n setOpen,\n buttonEl,\n get value() {\n return currentlySelectedDate();\n }\n }));\n\n const Picker = (\n <DatePicker\n selected={currentlySelectedDate()}\n onChange={selected => {\n setInputValue(selected);\n setOpen(false);\n setTimeout(() => buttonEl?.focus());\n onInputChange();\n }}\n min={min}\n max={max}\n showWeekNumber={showWeekNumber}\n />\n );\n\n const PickerButton = (\n <>\n <Button\n variant='simple'\n icon\n ref={setButtonEl}\n onClick={() => setOpen(cur => !cur)}\n aria-label={generatePickerButtonAriaLabel(\n currentlySelectedDate(),\n 'date',\n locale,\n t,\n open\n )}\n readOnly={readOnly}\n disabled={disabled}\n >\n <Icon name={open ? 'times' : 'calendar'} />\n </Button>\n\n <Popover\n show={open}\n ref={setPopoverRef}\n target={containerRef.current}\n placement='bottom-end'\n strategy='fixed'\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['top-end', 'right', 'left']\n }\n }\n ]}\n >\n {picker || Picker}\n </Popover>\n </>\n );\n\n const orderedRefs: RefObject<HTMLInputElement>[] = [];\n\n const Comp = (\n <Flex\n as={StyledDateInput}\n forwardedAs={StyledFormControl}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n ref={containerRef}\n onClick={(e: MouseEvent) => {\n if (e.target === containerRef.current) orderedRefs[0].current?.focus();\n }}\n {...restProps}\n >\n <Flex\n ref={inputContainerRef}\n as={StyledInputContainer}\n container={{ alignItems: 'center', wrap: 'wrap' }}\n onPaste={onPaste}\n >\n {getDateFormat(locale).map(part => {\n switch (part) {\n case 'DD':\n orderedRefs.push(dayInputRef);\n return DayInput;\n case 'MM':\n orderedRefs.push(monthInputRef);\n return MonthInput;\n case 'YYYY':\n orderedRefs.push(yearInputRef);\n return YearInput;\n default:\n return part;\n }\n })}\n </Flex>\n {!readOnly && PickerButton}\n </Flex>\n );\n\n useEffect(() => {\n if (autoFocus) orderedRefs[0].current?.focus();\n }, [autoFocus]);\n\n useAutoFocusNextInput(orderedRefs);\n\n return label ? (\n <FormField\n as='fieldset'\n labelAs='legend'\n {...{ label, labelHidden, id, info, status, required, disabled }}\n ref={ref}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default DateInput;\n"]}
1
+ {"version":3,"file":"DateInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,UAAU,EAGV,MAAM,EAIN,mBAAmB,EACnB,SAAS,EAE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ACR,QAAQ;YACR,mBAAmB;YACnB,cAAc;SACf,EACD,GAAG,EAAE,GAAG,YAEP,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {\n ClipboardEvent,\n FunctionComponent,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useRef,\n RefObject,\n Dispatch,\n SetStateAction,\n useImperativeHandle,\n useEffect,\n ComponentType\n} from 'react';\nimport styled from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { useConfiguration, useFocusWithin, useI18n } from '../../../hooks';\nimport { ForwardProps } from '../../../types';\nimport FormField from '../../FormField';\nimport Flex from '../../Flex';\nimport Button from '../../Button';\nimport Icon, { registerIcon } from '../../Icon';\nimport * as timesIcon from '../../Icon/icons/times.icon';\nimport * as calendarIcon from '../../Icon/icons/calendar.icon';\nimport DatePicker from '../Picker/DatePicker';\nimport type DatePickerProps from '../Picker/DatePicker.types';\nimport Popover from '../../Popover';\nimport { FormControlProps, StyledFormControl } from '../../FormControl';\nimport DateTimeProps, { DateTimeCallbackParameter } from '../DateTime.types';\n\nimport {\n getDateFormat,\n parsePastedTextToDate,\n parseToDate,\n validateDate,\n generatePickerButtonAriaLabel\n} from './utils';\nimport StyledDateTime, { StyledInputContainer } from './DateTime.styles';\nimport useAutoFocusNextInput from './useAutoFocusNextInput';\nimport PartInput from './PartInput';\nimport usePickerButton from './usePickerButton';\n\nregisterIcon(timesIcon, calendarIcon);\n\nexport interface DateInputProps extends DateTimeProps {\n /**\n * Display additional column with week number in date picker popover.\n * @default false\n */\n showWeekNumber?: boolean;\n /** Changes default date picker */\n picker?: {\n renderer: ComponentType;\n rendererProps?: Partial<DatePickerProps> & ForwardProps;\n };\n /** Pass a heading and content to show additional information on the field. */\n additionalInfo?: FormControlProps['additionalInfo'];\n}\n\nexport interface DateInputRefObject {\n readonly value: Date | undefined;\n setOpen: Dispatch<SetStateAction<boolean>>;\n buttonEl: HTMLElement | null;\n}\n\nexport const StyledDateInput = styled(StyledDateTime)<DateInputProps>`\n padding-inline-end: 0;\n`;\n\nStyledDateInput.defaultProps = defaultThemeProp;\n\nconst convertToCallbackParameter = (\n date: Date,\n parts: (string | undefined)[]\n): DateTimeCallbackParameter => {\n if (parts.every(Boolean)) {\n const [year, monthIndex, day] = parts.map(Number);\n\n if (!validateDate(year, monthIndex + 1, day)) {\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'invalid'\n };\n }\n\n date.setUTCFullYear(year, monthIndex, day);\n return {\n valueAsISOString: date.toISOString(),\n valueAsTimestamp: date.getTime()\n };\n }\n if (parts.every(p => !p)) {\n return {\n valueAsISOString: '',\n valueAsTimestamp: undefined\n };\n }\n return {\n valueAsISOString: '',\n valueAsTimestamp: NaN,\n state: 'incomplete'\n };\n};\n\nconst DateInput: FunctionComponent<DateInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<DateInputProps>, ref: Ref<DateInputRefObject>) => {\n const { locale } = useConfiguration();\n const {\n defaultValue,\n value = defaultValue,\n min,\n max,\n id,\n label,\n labelHidden,\n info = getDateFormat(locale).join(''),\n status,\n required,\n readOnly,\n disabled,\n onChange,\n onFocus,\n onBlur,\n onResolveSuggestion,\n showWeekNumber,\n picker: { renderer: PickerComp = DatePicker, rendererProps = {} } = {},\n autoFocus,\n additionalInfo,\n ...restProps\n } = props;\n\n const t = useI18n();\n\n const date = value !== undefined ? parseToDate(value) : undefined;\n\n const [yearInputRef, monthInputRef, dayInputRef] = [\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null),\n useRef<HTMLInputElement>(null)\n ];\n\n const pickParts = () => {\n const month = monthInputRef.current?.value\n ? (Number(monthInputRef.current.value) - 1).toString()\n : undefined;\n return [\n yearInputRef.current?.value || undefined,\n month,\n dayInputRef.current?.value || undefined\n ];\n };\n\n const currentlySelectedDate = () => {\n const parts = pickParts();\n if (parts.every(Boolean)) {\n const [year, monthIndex, day] = parts.map(Number);\n\n return validateDate(year, monthIndex + 1, day)\n ? new Date(Date.UTC(year, monthIndex, day))\n : undefined;\n }\n };\n\n const [open, setOpen, , setPopoverRef, buttonEl, setButtonEl] = usePickerButton();\n\n const inputContainerRef = useRef<HTMLDivElement>(null);\n\n const onFocusChange = (focused: boolean) => {\n const callbackParam = convertToCallbackParameter(\n date ? new Date(date) : new Date(),\n pickParts()\n );\n if (onFocus && focused) onFocus(callbackParam);\n if (!focused) {\n if (inputContainerRef.current) inputContainerRef.current.scrollTop = 0;\n onBlur?.(callbackParam);\n setOpen(false);\n }\n };\n\n const onInputChange = () => {\n onChange?.(convertToCallbackParameter(date ? new Date(date) : new Date(), pickParts()));\n buttonEl?.setAttribute(\n 'aria-label',\n generatePickerButtonAriaLabel(currentlySelectedDate(), 'date', locale, t, open)\n );\n };\n\n const setInputValue = (newValue: Date) => {\n dayInputRef.current!.value = newValue.getUTCDate().toString().padStart(2, '0');\n monthInputRef.current!.value = (newValue.getUTCMonth() + 1).toString().padStart(2, '0');\n yearInputRef.current!.value = newValue.getUTCFullYear().toString();\n };\n\n const onPaste = (e: ClipboardEvent) => {\n const text = e.clipboardData.getData('text');\n const newDate = parsePastedTextToDate(text, locale, date || new Date());\n if (newDate) {\n e.preventDefault();\n setInputValue(newDate);\n onInputChange();\n }\n };\n\n const displayNames = new Intl.DisplayNames(locale, { style: 'long', type: 'dateTimeField' });\n\n const DayInput = (\n <PartInput\n key='day'\n placeholder={t('day_placeholder')}\n aria-label={displayNames.of('day')}\n value={date?.getUTCDate()}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n min={1}\n max={31}\n ref={dayInputRef}\n />\n );\n\n const MonthInput = (\n <PartInput\n key='month'\n placeholder={t('month_placeholder')}\n aria-label={displayNames.of('month')}\n value={date ? date?.getUTCMonth() + 1 : undefined}\n onChange={onInputChange}\n size={2}\n maxLength={2}\n readOnly={readOnly}\n min={1}\n max={12}\n ref={monthInputRef}\n />\n );\n\n const YearInput = (\n <PartInput\n key='year'\n placeholder={t('year_placeholder')}\n aria-label={displayNames.of('year')}\n value={date?.getUTCFullYear()}\n onChange={onInputChange}\n size={4}\n maxLength={4}\n readOnly={readOnly}\n min={1}\n ref={yearInputRef}\n />\n );\n\n const containerRef = useRef<HTMLElement>(null);\n useFocusWithin([containerRef], onFocusChange);\n\n useImperativeHandle(ref, () => ({\n setOpen,\n buttonEl,\n get value() {\n return currentlySelectedDate();\n }\n }));\n\n const PickerButton = (\n <>\n <Button\n variant='simple'\n icon\n ref={setButtonEl}\n onClick={() => setOpen(cur => !cur)}\n aria-label={generatePickerButtonAriaLabel(\n currentlySelectedDate(),\n 'date',\n locale,\n t,\n open\n )}\n readOnly={readOnly}\n disabled={disabled}\n >\n <Icon name={open ? 'times' : 'calendar'} />\n </Button>\n {open && (\n <Popover\n ref={setPopoverRef}\n target={buttonEl}\n placement='bottom-end'\n strategy='fixed'\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['top-end', 'right', 'left']\n }\n }\n ]}\n >\n <PickerComp\n selected={currentlySelectedDate()}\n min={min}\n max={max}\n showWeekNumber={showWeekNumber}\n {...rendererProps}\n onChange={selected => {\n setInputValue(selected);\n setOpen(false);\n setTimeout(() => buttonEl?.focus());\n onInputChange();\n rendererProps?.onChange?.(selected);\n }}\n />\n </Popover>\n )}\n </>\n );\n\n const orderedRefs: RefObject<HTMLInputElement>[] = [];\n\n const Comp = (\n <Flex\n as={StyledDateInput}\n forwardedAs={StyledFormControl}\n hasSuggestion={status === 'pending' && !!onResolveSuggestion}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n ref={containerRef}\n onClick={(e: MouseEvent) => {\n if (e.target === containerRef.current) orderedRefs[0].current?.focus();\n }}\n {...restProps}\n >\n <Flex\n ref={inputContainerRef}\n as={StyledInputContainer}\n container={{ alignItems: 'center', wrap: 'wrap' }}\n onPaste={onPaste}\n >\n {getDateFormat(locale).map(part => {\n switch (part) {\n case 'DD':\n orderedRefs.push(dayInputRef);\n return DayInput;\n case 'MM':\n orderedRefs.push(monthInputRef);\n return MonthInput;\n case 'YYYY':\n orderedRefs.push(yearInputRef);\n return YearInput;\n default:\n return part;\n }\n })}\n </Flex>\n {!readOnly && PickerButton}\n </Flex>\n );\n\n useEffect(() => {\n if (autoFocus) orderedRefs[0].current?.focus();\n }, [autoFocus]);\n\n useAutoFocusNextInput(orderedRefs);\n\n return label ? (\n <FormField\n as='fieldset'\n aria-labelledby={id}\n labelAs='legend'\n {...{\n label,\n labelHidden,\n id,\n info,\n status,\n required,\n disabled,\n onResolveSuggestion,\n additionalInfo\n }}\n ref={ref}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default DateInput;\n"]}
@@ -1,38 +1,33 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { ForwardProps } from '../../../types';
3
3
  import { FormControlProps } from '../../FormControl';
4
- import { DateRangeCallbackValue } from '../types';
5
- import type { DateTimeProperties } from '../DateTime.types';
4
+ import type { DateRangeCallbackParameter, DateTimeProperties } from '../DateTime.types';
5
+ import DateTimeProps from '../DateTime.types';
6
6
  export interface DateRangeInputProps extends DateTimeProperties {
7
+ /** Object of range boundaries. */
8
+ value?: {
9
+ start?: DateTimeProps['value'];
10
+ end?: DateTimeProps['value'];
11
+ };
7
12
  /**
8
13
  * Display additional column with week number in date picker popover.
9
14
  * @default false
10
15
  */
11
16
  showWeekNumber?: boolean;
12
- /**
13
- * Pass a string or a fragment with an Icon and string for first part of DataRangeInput.
14
- */
15
- fromLabel: FormControlProps['label'];
16
- /**
17
- * Pass a string or a fragment with an Icon and string for second part of DataRangeInput.
18
- */
19
- toLabel: FormControlProps['label'];
20
- /**
21
- * Date as ISO8601 string, timestamp or native Date object. Requires onChange prop to update value for controlled inputs.
22
- *
23
- */
24
- fromValue?: string | number | Date;
25
- /**
26
- * Date as ISO8601 string, timestamp or native Date object. Requires onChange prop to update value for controlled inputs.
27
- *
28
- */
29
- toValue?: string | number | Date;
17
+ /** Pass a string or a fragment with an Icon and string for first part of DataRangeInput. */
18
+ fromLabel?: FormControlProps['label'];
19
+ /** Pass a string or a fragment with an Icon and string for second part of DataRangeInput. */
20
+ toLabel?: FormControlProps['label'];
21
+ /** Pass an object with "heading" and "content" properties to show AdditionalInfo for second part of DataRangeInput. */
22
+ toAdditionalInfo?: FormControlProps['additionalInfo'];
23
+ /** Pass an object with "heading" and "content" properties to show AdditionalInfo for first part of DataRangeInput. */
24
+ fromAdditionalInfo?: FormControlProps['additionalInfo'];
30
25
  /** Callback fired when input value changes. */
31
- onChange?: (value: DateRangeCallbackValue) => void;
26
+ onChange: (value: DateRangeCallbackParameter) => void;
32
27
  /** Callback fired when the component gets focused. */
33
- onFocus?: (value: DateRangeCallbackValue) => void;
28
+ onFocus?: (value: DateRangeCallbackParameter) => void;
34
29
  /** Callback fired when the component loses focus. */
35
- onBlur?: (value: DateRangeCallbackValue) => void;
30
+ onBlur?: (value: DateRangeCallbackParameter) => void;
36
31
  /** Automatically focuses the input on render. */
37
32
  autoFocus?: boolean;
38
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DateRangeInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateRangeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAQlB,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD,OAAO,EAAE,sBAAsB,EAAyB,MAAM,UAAU,CAAC;AAGzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAM5D,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,SAAS,EAAE,gBAAgB,CA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IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,4FAA4F;IAC5F,SAAS,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACtC,6FAA6F;IAC7F,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACpC,uHAAuH;IACvH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACtD,sHAAsH;IACtH,kBAAkB,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACxD,+CAA+C;IAC/C,QAAQ,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACtD,sDAAsD;IACtD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACtD,qDAAqD;IACrD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACrD,iDAAiD;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAiED,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAwLzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,34 +1,28 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useRef, forwardRef, useReducer, useCallback } from 'react';
2
+ import { useRef, forwardRef, useCallback, useReducer } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { useConsolidatedRef, useDirection, useFocusWithin } from '../../../hooks';
4
+ import { useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';
5
5
  import { defaultThemeProp } from '../../../theme';
6
6
  import Flex from '../../Flex';
7
- import { StyledFormField } from '../../FormField/FormField';
7
+ import FormField, { StyledFormField } from '../../FormField/FormField';
8
8
  import DateRangePicker from '../Picker/DateRangePicker';
9
- import DatePicker from '../Picker/DatePicker';
9
+ import { StyledRangeInputContainer } from '../../Input/Input.styles';
10
10
  import DateInput from './DateInput';
11
11
  import { parseToDate } from './utils';
12
12
  import StyledDateInput from './DateTime.styles';
13
13
  const StyledDateRangeInput = styled.div(props => {
14
14
  const { theme: { components: { input } } } = props;
15
- const { start, end } = useDirection();
16
15
  return css `
17
16
  border: 0;
18
17
  min-width: min-content;
19
- ${StyledDateInput} {
20
- min-width: 50%;
21
- }
18
+
22
19
  ${StyledFormField} {
23
- &:first-child > ${StyledDateInput} {
24
- border-top-${end}-radius: 0;
25
- border-bottom-${end}-radius: 0;
26
- }
27
20
  &:last-child > ${StyledDateInput} {
28
- border-top-${start}-radius: 0;
29
- border-bottom-${start}-radius: 0;
30
21
  margin-inline-start: -${input['border-width']};
31
22
  }
23
+ & legend {
24
+ align-self: center;
25
+ }
32
26
  &:focus,
33
27
  &:hover,
34
28
  &:focus-within {
@@ -38,30 +32,24 @@ const StyledDateRangeInput = styled.div(props => {
38
32
  `;
39
33
  });
40
34
  StyledDateRangeInput.defaultProps = defaultThemeProp;
41
- const convertStateToCallbackParam = (v) => {
42
- return {
43
- valueAsISOString: v === undefined || Number.isNaN(v) ? '' : new Date(v).toISOString(),
44
- valueAsTimestamp: v
45
- };
46
- };
47
- const convertToCallbackParameter = (state) => {
48
- return {
49
- start: convertStateToCallbackParam(state[0]),
50
- end: convertStateToCallbackParam(state[1])
51
- };
52
- };
53
35
  const reducer = (prevState, action) => {
54
36
  switch (action.type) {
55
37
  case 'start': {
56
- return [action.value, prevState[1]];
38
+ return { ...prevState, start: action.value };
57
39
  }
58
40
  case 'end': {
59
- return [prevState[0], action.value];
41
+ return { ...prevState, end: action.value };
60
42
  }
61
43
  default:
62
44
  return prevState;
63
45
  }
64
46
  };
47
+ const convertToCallbackParameter = (v) => {
48
+ return {
49
+ valueAsISOString: v === undefined || Number.isNaN(v) ? '' : new Date(v).toISOString(),
50
+ valueAsTimestamp: v
51
+ };
52
+ };
65
53
  const getSelected = (first, second) => {
66
54
  const selected = first ?? second;
67
55
  return selected ? parseToDate(selected) : undefined;
@@ -69,86 +57,113 @@ const getSelected = (first, second) => {
69
57
  const parseValueToDate = (value) => {
70
58
  return value ? parseToDate(value) : undefined;
71
59
  };
72
- const DateRangeInput = forwardRef((props, ref) => {
73
- const { fromValue, toValue, min, max, fromLabel, toLabel, labelHidden, status, required, readOnly, disabled, onChange, onFocus, onBlur, showWeekNumber, autoFocus, ...restProps } = props;
74
- const [state, dispatch] = useReducer(reducer, [
75
- parseValueToDate(fromValue)?.getTime(),
76
- parseValueToDate(toValue)?.getTime()
77
- ]);
60
+ const DateRangeInput = forwardRef(({ value = {}, min, max, label, fromLabel, toLabel, labelHidden, status, required, readOnly, disabled, onChange, onFocus, onBlur, showWeekNumber, autoFocus, fromAdditionalInfo, toAdditionalInfo, ...restProps }, ref) => {
61
+ const t = useI18n();
78
62
  const startDateInputRef = useRef(null);
79
63
  const endDateInputRef = useRef(null);
80
- useEffect(() => {
81
- onChange?.(convertToCallbackParameter(state));
82
- }, [state[0], state[1]]);
64
+ const [state, dispatch] = useReducer(reducer, {
65
+ start: value.start ? parseToDate(value.start).getTime() : undefined,
66
+ end: value.end ? parseToDate(value.end).getTime() : undefined
67
+ });
68
+ // Need to keep the value in ref also, to be able to call onBlur with newest value
69
+ const startDateRef = useRef(state.start);
70
+ const endDateRef = useRef(state.end);
83
71
  const onFocusChange = useCallback((focused) => {
84
- (focused ? onFocus : onBlur)?.(convertToCallbackParameter(state));
85
- }, [onFocus, onBlur, state]);
72
+ (focused ? onFocus : onBlur)?.({
73
+ start: convertToCallbackParameter(startDateRef.current),
74
+ end: convertToCallbackParameter(endDateRef.current)
75
+ });
76
+ }, [onFocus, onBlur]);
86
77
  const containerRef = useConsolidatedRef(ref);
87
78
  useFocusWithin([containerRef], onFocusChange);
88
79
  const onStartDateChange = (selectedDate) => {
89
- if (state[1] && selectedDate.getTime() > state[1]) {
90
- dispatch({ type: 'start', value: state[1] });
80
+ if (state.end && selectedDate && selectedDate.getTime() > state.end) {
81
+ dispatch({ type: 'start', value: state.end });
91
82
  dispatch({ type: 'end', value: selectedDate.getTime() });
83
+ onChange({
84
+ start: convertToCallbackParameter(state.start),
85
+ end: convertToCallbackParameter(state.end)
86
+ });
92
87
  }
93
88
  else {
94
- dispatch({ type: 'start', value: selectedDate.getTime() });
89
+ dispatch({ type: 'start', value: selectedDate?.getTime() });
90
+ onChange({
91
+ start: convertToCallbackParameter(selectedDate?.getTime()),
92
+ end: convertToCallbackParameter(state.end)
93
+ });
95
94
  }
96
- startDateInputRef.current?.setOpen(false);
95
+ startDateRef.current = state.start;
96
+ endDateRef.current = state.end;
97
97
  endDateInputRef.current?.setOpen(true);
98
98
  };
99
99
  const onEndDateChange = (selectedDate) => {
100
- if (state[0] && selectedDate.getTime() < state[0]) {
100
+ if (state.start && selectedDate && selectedDate.getTime() < state.start) {
101
+ dispatch({ type: 'end', value: state.start });
101
102
  dispatch({ type: 'start', value: selectedDate.getTime() });
102
- dispatch({ type: 'end', value: state[0] });
103
+ onChange({
104
+ start: convertToCallbackParameter(state.start),
105
+ end: convertToCallbackParameter(state.end)
106
+ });
103
107
  }
104
108
  else {
105
- dispatch({ type: 'end', value: selectedDate.getTime() });
109
+ dispatch({ type: 'end', value: selectedDate?.getTime() });
110
+ onChange({
111
+ start: convertToCallbackParameter(state.start),
112
+ end: convertToCallbackParameter(selectedDate?.getTime())
113
+ });
106
114
  }
107
- endDateInputRef.current?.setOpen(false);
108
- endDateInputRef.current?.buttonEl?.focus();
115
+ startDateRef.current = state.start;
116
+ endDateRef.current = state.end;
109
117
  };
110
118
  const getSelectedRange = () => {
111
- const startDate = parseValueToDate(state[0]);
112
- const endDate = parseValueToDate(state[1]);
119
+ const startDate = parseValueToDate(state.start);
120
+ const endDate = parseValueToDate(state.end);
113
121
  if (startDate && endDate && startDate > endDate)
114
122
  return undefined;
115
123
  return {
116
- startDate: startDate ? parseValueToDate(startDate) : undefined,
117
- endDate: endDate ? parseValueToDate(endDate) : undefined
124
+ startDate,
125
+ endDate
118
126
  };
119
127
  };
120
- const startPicker = !(state[0] && !state[1]) ? (_jsx(DateRangePicker, { selected: getSelected(state[0], state[1]), selectedRange: getSelectedRange(), onChange: onStartDateChange, min: min, max: max, showWeekNumber: showWeekNumber })) : (_jsx(DatePicker, { selected: parseValueToDate(state[0]), onChange: onStartDateChange, min: min, max: max, showWeekNumber: showWeekNumber }));
121
- const endPicker = !(!state[0] && state[1]) ? (_jsx(DateRangePicker, { selected: getSelected(state[1], state[0]), selectedRange: getSelectedRange(), onChange: onEndDateChange, min: min, max: max, showWeekNumber: showWeekNumber })) : (_jsx(DatePicker, { selected: parseValueToDate(state[1]), onChange: onEndDateChange, min: min, max: max, showWeekNumber: showWeekNumber }));
122
- const fromProps = {
123
- value: state[0],
124
- label: fromLabel,
125
- labelHidden,
126
- ...{
127
- required,
128
- readOnly,
129
- disabled,
130
- min,
131
- max,
132
- status,
133
- autoFocus
134
- },
135
- info: props.info
136
- };
137
- const toProps = {
138
- value: state[1],
139
- label: toLabel,
140
- labelHidden,
141
- ...{
142
- required,
143
- readOnly,
144
- disabled,
145
- min,
146
- max,
147
- status
148
- },
149
- info: props.info
128
+ const commonProps = {
129
+ required,
130
+ readOnly,
131
+ disabled,
132
+ min,
133
+ max,
134
+ status
150
135
  };
151
- return (_jsxs(Flex, { as: StyledDateRangeInput, container: { wrap: 'nowrap' }, ...restProps, ref: containerRef, children: [_jsx(DateInput, { ...fromProps, ref: startDateInputRef, picker: startPicker, onChange: changedValue => dispatch({ type: 'start', value: changedValue.valueAsTimestamp }) }), _jsx(DateInput, { ...toProps, ref: endDateInputRef, picker: endPicker, onChange: changedValue => dispatch({ type: 'end', value: changedValue.valueAsTimestamp }) })] }));
136
+ return (_jsx(FormField, { as: StyledDateRangeInput, ...restProps, ref: containerRef, container: { wrap: 'nowrap' }, labelHidden: labelHidden, label: label, labelAs: 'legend', required: required, readOnly: readOnly, status: status, disabled: disabled, children: _jsxs(Flex, { container: true, as: StyledRangeInputContainer, children: [_jsx(DateInput, { ...commonProps, value: state.start, ref: startDateInputRef, picker: {
137
+ renderer: DateRangePicker,
138
+ rendererProps: {
139
+ selected: getSelected(state.start, state.end),
140
+ selectedRange: getSelectedRange(),
141
+ onChange: onStartDateChange
142
+ }
143
+ }, onBlur: changedValue => {
144
+ if (!changedValue.state)
145
+ dispatch({ type: 'start', value: changedValue.valueAsTimestamp });
146
+ startDateRef.current = changedValue.valueAsTimestamp;
147
+ onChange({
148
+ start: changedValue,
149
+ end: convertToCallbackParameter(state.end)
150
+ });
151
+ }, additionalInfo: fromAdditionalInfo, label: fromLabel, "aria-label": `${t('range_from_datetime') + (label ? ` - ${label}` : '')}`, autoFocus: autoFocus }), _jsx(DateInput, { ...commonProps, value: state.end, ref: endDateInputRef, picker: {
152
+ renderer: DateRangePicker,
153
+ rendererProps: {
154
+ selected: getSelected(state.end, state.start),
155
+ selectedRange: getSelectedRange(),
156
+ onChange: onEndDateChange
157
+ }
158
+ }, onBlur: changedValue => {
159
+ if (!changedValue.state)
160
+ dispatch({ type: 'end', value: changedValue.valueAsTimestamp });
161
+ endDateRef.current = changedValue.valueAsTimestamp;
162
+ onChange({
163
+ start: convertToCallbackParameter(state.start),
164
+ end: changedValue
165
+ });
166
+ }, additionalInfo: toAdditionalInfo, label: toLabel, "aria-label": `${t('range_to_datetime') + (label ? ` - ${label}` : '')}` })] }) }));
152
167
  });
153
168
  export default DateRangeInput;
154
169
  //# sourceMappingURL=DateRangeInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateRangeInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateRangeInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,SAAS,EACT,MAAM,EACN,UAAU,EAGV,UAAU,EACV,WAAW,EACZ,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAElF,OAAO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E,cAAc,GAC9B,CACH,CAAC;IAEF,MAAM,SAAS,GAAG;QAChB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QACf,KAAK,EAAE,SAAS;QAChB,WAAW;QACX,GAAG;YACD,QAAQ;YACR,QAAQ;YACR,QAAQ;YACR,GAAG;YACH,GAAG;YACH,MAAM;YACN,SAAS;SACV;QACD,IAAI,EAAE,KAAK,CAAC,IAAI;KACjB,CAAC;IAEF,MAAM,OAAO,GAAG;QACd,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QACf,KAAK,EAAE,OAAO;QACd,WAAW;QACX,GAAG;YACD,QAAQ;YACR,QAAQ;YACR,QAAQ;YACR,GAAG;YACH,GAAG;YACH,MAAM;SACP;QACD,IAAI,EAAE,KAAK,CAAC,IAAI;KACjB,CAAC;IAEF,OAAO,CACL,MAAC,IAAI,IACH,EAAE,EAAE,oBAAoB,EACxB,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KACzB,SAAS,EACb,GAAG,EAAE,YAAY,aAEjB,KAAC,SAAS,OACJ,SAAS,EACb,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,YAAY,CAAC,EAAE,CACvB,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,CAAC,gBAAgB,EAAE,CAAC,GAEnE,EACF,KAAC,SAAS,OACJ,OAAO,EACX,GAAG,EAAE,eAAe,EACpB,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,YAAY,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,gBAAgB,EAAE,CAAC,GACzF,IACG,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import {\n FunctionComponent,\n useEffect,\n useRef,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useReducer,\n useCallback\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { useConsolidatedRef, useDirection, useFocusWithin } from '../../../hooks';\nimport { ForwardProps } from '../../../types';\nimport { defaultThemeProp } from '../../../theme';\nimport { FormControlProps } from '../../FormControl';\nimport Flex from '../../Flex';\nimport { StyledFormField } from '../../FormField/FormField';\nimport { DateRangeCallbackValue, DateTimeCallbackValue } from '../types';\nimport DateRangePicker from '../Picker/DateRangePicker';\nimport DatePicker from '../Picker/DatePicker';\nimport type { DateTimeProperties } from '../DateTime.types';\n\nimport DateInput, { DateInputRefObject } from './DateInput';\nimport { parseToDate } from './utils';\nimport StyledDateInput from './DateTime.styles';\n\nexport interface DateRangeInputProps extends DateTimeProperties {\n /**\n * Display additional column with week number in date picker popover.\n * @default false\n */\n showWeekNumber?: boolean;\n\n /**\n * Pass a string or a fragment with an Icon and string for first part of DataRangeInput.\n */\n fromLabel: FormControlProps['label'];\n\n /**\n * Pass a string or a fragment with an Icon and string for second part of DataRangeInput.\n */\n toLabel: FormControlProps['label'];\n\n /**\n * Date as ISO8601 string, timestamp or native Date object. Requires onChange prop to update value for controlled inputs.\n *\n */\n fromValue?: string | number | Date;\n\n /**\n * Date as ISO8601 string, timestamp or native Date object. Requires onChange prop to update value for controlled inputs.\n *\n */\n toValue?: string | number | Date;\n /** Callback fired when input value changes. */\n onChange?: (value: DateRangeCallbackValue) => void;\n /** Callback fired when the component gets focused. */\n onFocus?: (value: DateRangeCallbackValue) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: DateRangeCallbackValue) => void;\n /** Automatically focuses the input on render. */\n autoFocus?: boolean;\n}\n\nconst StyledDateRangeInput = styled.div<DateRangeInputProps>(props => {\n const {\n theme: {\n components: { input }\n }\n } = props;\n\n const { start, end } = useDirection();\n\n return css`\n border: 0;\n min-width: min-content;\n ${StyledDateInput} {\n min-width: 50%;\n }\n ${StyledFormField} {\n &:first-child > ${StyledDateInput} {\n border-top-${end}-radius: 0;\n border-bottom-${end}-radius: 0;\n }\n &:last-child > ${StyledDateInput} {\n border-top-${start}-radius: 0;\n border-bottom-${start}-radius: 0;\n margin-inline-start: -${input['border-width']};\n }\n &:focus,\n &:hover,\n &:focus-within {\n z-index: 2;\n }\n }\n `;\n});\n\nStyledDateRangeInput.defaultProps = defaultThemeProp;\n\ntype DateRepresentable = string | number | Date;\n\ntype State = [start?: number, end?: number];\n\nconst convertStateToCallbackParam = (v?: number): DateTimeCallbackValue => {\n return {\n valueAsISOString: v === undefined || Number.isNaN(v) ? '' : new Date(v).toISOString(),\n valueAsTimestamp: v\n };\n};\n\nconst convertToCallbackParameter = (state: State) => {\n return {\n start: convertStateToCallbackParam(state[0]),\n end: convertStateToCallbackParam(state[1])\n };\n};\n\ntype DateRangeAction = { type: 'start' | 'end'; value?: number };\n\nconst reducer = (prevState: State, action: DateRangeAction): State => {\n switch (action.type) {\n case 'start': {\n return [action.value, prevState[1]];\n }\n case 'end': {\n return [prevState[0], action.value];\n }\n default:\n return prevState;\n }\n};\n\nconst getSelected = (first: number | undefined, second: number | undefined) => {\n const selected = first ?? second;\n return selected ? parseToDate(selected) : undefined;\n};\n\nconst parseValueToDate = (value: DateRepresentable | undefined) => {\n return value ? parseToDate(value) : undefined;\n};\n\nconst DateRangeInput: FunctionComponent<DateRangeInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<DateRangeInputProps>, ref: Ref<HTMLDivElement>) => {\n const {\n fromValue,\n toValue,\n min,\n max,\n fromLabel,\n toLabel,\n labelHidden,\n status,\n required,\n readOnly,\n disabled,\n onChange,\n onFocus,\n onBlur,\n showWeekNumber,\n autoFocus,\n ...restProps\n } = props;\n\n const [state, dispatch] = useReducer(reducer, [\n parseValueToDate(fromValue)?.getTime(),\n parseValueToDate(toValue)?.getTime()\n ]);\n\n const startDateInputRef = useRef<DateInputRefObject>(null);\n const endDateInputRef = useRef<DateInputRefObject>(null);\n\n useEffect(() => {\n onChange?.(convertToCallbackParameter(state));\n }, [state[0], state[1]]);\n\n const onFocusChange = useCallback(\n (focused: boolean) => {\n (focused ? onFocus : onBlur)?.(convertToCallbackParameter(state));\n },\n [onFocus, onBlur, state]\n );\n\n const containerRef = useConsolidatedRef(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n const onStartDateChange = (selectedDate: Date) => {\n if (state[1] && selectedDate.getTime() > state[1]) {\n dispatch({ type: 'start', value: state[1] });\n dispatch({ type: 'end', value: selectedDate.getTime() });\n } else {\n dispatch({ type: 'start', value: selectedDate.getTime() });\n }\n startDateInputRef.current?.setOpen(false);\n endDateInputRef.current?.setOpen(true);\n };\n\n const onEndDateChange = (selectedDate: Date) => {\n if (state[0] && selectedDate.getTime() < state[0]) {\n dispatch({ type: 'start', value: selectedDate.getTime() });\n dispatch({ type: 'end', value: state[0] });\n } else {\n dispatch({ type: 'end', value: selectedDate.getTime() });\n }\n endDateInputRef.current?.setOpen(false);\n endDateInputRef.current?.buttonEl?.focus();\n };\n\n const getSelectedRange = () => {\n const startDate = parseValueToDate(state[0]);\n const endDate = parseValueToDate(state[1]);\n\n if (startDate && endDate && startDate > endDate) return undefined;\n\n return {\n startDate: startDate ? parseValueToDate(startDate) : undefined,\n endDate: endDate ? parseValueToDate(endDate) : undefined\n };\n };\n\n const startPicker = !(state[0] && !state[1]) ? (\n <DateRangePicker\n selected={getSelected(state[0], state[1])}\n selectedRange={getSelectedRange()}\n onChange={onStartDateChange}\n min={min}\n max={max}\n showWeekNumber={showWeekNumber}\n />\n ) : (\n <DatePicker\n selected={parseValueToDate(state[0])}\n onChange={onStartDateChange}\n min={min}\n max={max}\n showWeekNumber={showWeekNumber}\n />\n );\n\n const endPicker = !(!state[0] && state[1]) ? (\n <DateRangePicker\n selected={getSelected(state[1], state[0])}\n selectedRange={getSelectedRange()}\n onChange={onEndDateChange}\n min={min}\n max={max}\n showWeekNumber={showWeekNumber}\n />\n ) : (\n <DatePicker\n selected={parseValueToDate(state[1])}\n onChange={onEndDateChange}\n min={min}\n max={max}\n showWeekNumber={showWeekNumber}\n />\n );\n\n const fromProps = {\n value: state[0],\n label: fromLabel,\n labelHidden,\n ...{\n required,\n readOnly,\n disabled,\n min,\n max,\n status,\n autoFocus\n },\n info: props.info\n };\n\n const toProps = {\n value: state[1],\n label: toLabel,\n labelHidden,\n ...{\n required,\n readOnly,\n disabled,\n min,\n max,\n status\n },\n info: props.info\n };\n\n return (\n <Flex\n as={StyledDateRangeInput}\n container={{ wrap: 'nowrap' }}\n {...restProps}\n ref={containerRef}\n >\n <DateInput\n {...fromProps}\n ref={startDateInputRef}\n picker={startPicker}\n onChange={changedValue =>\n dispatch({ type: 'start', value: changedValue.valueAsTimestamp })\n }\n />\n <DateInput\n {...toProps}\n ref={endDateInputRef}\n picker={endPicker}\n onChange={changedValue => dispatch({ type: 'end', value: changedValue.valueAsTimestamp })}\n />\n </Flex>\n );\n }\n);\n\nexport default DateRangeInput;\n"]}
1
+ {"version":3,"file":"DateRangeInput.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateRangeInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,MAAM,EACN,UAAU,EAGV,WAAW,EACX,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,SAAS,EAAE,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAMxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAGrE,OAAO,SAAiC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AA4BhD,MAAM,oBA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from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';\nimport { ForwardProps } from '../../../types';\nimport { defaultThemeProp } from '../../../theme';\nimport { FormControlProps } from '../../FormControl';\nimport Flex from '../../Flex';\nimport FormField, { StyledFormField } from '../../FormField/FormField';\nimport DateRangePicker from '../Picker/DateRangePicker';\nimport type {\n DateRangeCallbackParameter,\n DateTimeCallbackParameter,\n DateTimeProperties\n} from '../DateTime.types';\nimport { StyledRangeInputContainer } from '../../Input/Input.styles';\nimport DateTimeProps from '../DateTime.types';\n\nimport DateInput, { DateInputRefObject } from './DateInput';\nimport { parseToDate } from './utils';\nimport StyledDateInput from './DateTime.styles';\n\nexport interface DateRangeInputProps extends DateTimeProperties {\n /** Object of range boundaries. */\n value?: { start?: DateTimeProps['value']; end?: DateTimeProps['value'] };\n /**\n * Display additional column with week number in date picker popover.\n * @default false\n */\n showWeekNumber?: boolean;\n /** Pass a string or a fragment with an Icon and string for first part of DataRangeInput. */\n fromLabel?: FormControlProps['label'];\n /** Pass a string or a fragment with an Icon and string for second part of DataRangeInput. */\n toLabel?: FormControlProps['label'];\n /** Pass an object with \"heading\" and \"content\" properties to show AdditionalInfo for second part of DataRangeInput. */\n toAdditionalInfo?: FormControlProps['additionalInfo'];\n /** Pass an object with \"heading\" and \"content\" properties to show AdditionalInfo for first part of DataRangeInput. */\n fromAdditionalInfo?: FormControlProps['additionalInfo'];\n /** Callback fired when input value changes. */\n onChange: (value: DateRangeCallbackParameter) => void;\n /** Callback fired when the component gets focused. */\n onFocus?: (value: DateRangeCallbackParameter) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: DateRangeCallbackParameter) => void;\n /** Automatically focuses the input on render. */\n autoFocus?: boolean;\n}\n\nconst StyledDateRangeInput = styled.div<DateRangeInputProps>(props => {\n const {\n theme: {\n components: { input }\n }\n } = props;\n\n return css`\n border: 0;\n min-width: min-content;\n\n ${StyledFormField} {\n &:last-child > ${StyledDateInput} {\n margin-inline-start: -${input['border-width']};\n }\n & legend {\n align-self: center;\n }\n &:focus,\n &:hover,\n &:focus-within {\n z-index: 2;\n }\n }\n `;\n});\n\nStyledDateRangeInput.defaultProps = defaultThemeProp;\n\ntype DateRepresentable = string | number | Date;\n\ntype DateRangeAction = { type: 'start' | 'end'; value?: number };\ntype State = { start?: number; end?: number };\n\nconst reducer = (prevState: State, action: DateRangeAction): State => {\n switch (action.type) {\n case 'start': {\n return { ...prevState, start: action.value };\n }\n case 'end': {\n return { ...prevState, end: action.value };\n }\n default:\n return prevState;\n }\n};\n\nconst convertToCallbackParameter = (v?: number): DateTimeCallbackParameter => {\n return {\n valueAsISOString: v === undefined || Number.isNaN(v) ? '' : new Date(v).toISOString(),\n valueAsTimestamp: v\n };\n};\n\nconst getSelected = (first: number | undefined, second: number | undefined) => {\n const selected = first ?? second;\n return selected ? parseToDate(selected) : undefined;\n};\n\nconst parseValueToDate = (value: DateRepresentable | undefined) => {\n return value ? parseToDate(value) : undefined;\n};\n\nconst DateRangeInput: FunctionComponent<DateRangeInputProps & ForwardProps> = forwardRef(\n (\n {\n value = {},\n min,\n max,\n label,\n fromLabel,\n toLabel,\n labelHidden,\n status,\n required,\n readOnly,\n disabled,\n onChange,\n onFocus,\n onBlur,\n showWeekNumber,\n autoFocus,\n fromAdditionalInfo,\n toAdditionalInfo,\n ...restProps\n }: PropsWithoutRef<DateRangeInputProps>,\n ref: Ref<HTMLDivElement>\n ) => {\n const t = useI18n();\n\n const startDateInputRef = useRef<DateInputRefObject>(null);\n const endDateInputRef = useRef<DateInputRefObject>(null);\n\n const [state, dispatch] = useReducer(reducer, {\n start: value.start ? parseToDate(value.start).getTime() : undefined,\n end: value.end ? parseToDate(value.end).getTime() : undefined\n });\n\n // Need to keep the value in ref also, to be able to call onBlur with newest value\n const startDateRef = useRef(state.start);\n const endDateRef = useRef(state.end);\n\n const onFocusChange = useCallback(\n (focused: boolean) => {\n (focused ? onFocus : onBlur)?.({\n start: convertToCallbackParameter(startDateRef.current),\n end: convertToCallbackParameter(endDateRef.current)\n });\n },\n [onFocus, onBlur]\n );\n\n const containerRef = useConsolidatedRef(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n const onStartDateChange = (selectedDate?: Date) => {\n if (state.end && selectedDate && selectedDate.getTime() > state.end) {\n dispatch({ type: 'start', value: state.end });\n dispatch({ type: 'end', value: selectedDate.getTime() });\n onChange({\n start: convertToCallbackParameter(state.start),\n end: convertToCallbackParameter(state.end)\n });\n } else {\n dispatch({ type: 'start', value: selectedDate?.getTime() });\n onChange({\n start: convertToCallbackParameter(selectedDate?.getTime()),\n end: convertToCallbackParameter(state.end)\n });\n }\n startDateRef.current = state.start;\n endDateRef.current = state.end;\n endDateInputRef.current?.setOpen(true);\n };\n\n const onEndDateChange = (selectedDate?: Date) => {\n if (state.start && selectedDate && selectedDate.getTime() < state.start) {\n dispatch({ type: 'end', value: state.start });\n dispatch({ type: 'start', value: selectedDate.getTime() });\n onChange({\n start: convertToCallbackParameter(state.start),\n end: convertToCallbackParameter(state.end)\n });\n } else {\n dispatch({ type: 'end', value: selectedDate?.getTime() });\n onChange({\n start: convertToCallbackParameter(state.start),\n end: convertToCallbackParameter(selectedDate?.getTime())\n });\n }\n startDateRef.current = state.start;\n endDateRef.current = state.end;\n };\n\n const getSelectedRange = () => {\n const startDate = parseValueToDate(state.start);\n const endDate = parseValueToDate(state.end);\n\n if (startDate && endDate && startDate > endDate) return undefined;\n\n return {\n startDate,\n endDate\n };\n };\n\n const commonProps = {\n required,\n readOnly,\n disabled,\n min,\n max,\n status\n };\n\n return (\n <FormField\n as={StyledDateRangeInput}\n {...restProps}\n ref={containerRef}\n container={{ wrap: 'nowrap' }}\n labelHidden={labelHidden}\n label={label}\n labelAs='legend'\n required={required}\n readOnly={readOnly}\n status={status}\n disabled={disabled}\n >\n <Flex container as={StyledRangeInputContainer}>\n <DateInput\n {...commonProps}\n value={state.start}\n ref={startDateInputRef}\n picker={{\n renderer: DateRangePicker,\n rendererProps: {\n selected: getSelected(state.start, state.end),\n selectedRange: getSelectedRange(),\n onChange: onStartDateChange\n }\n }}\n onBlur={changedValue => {\n if (!changedValue.state)\n dispatch({ type: 'start', value: changedValue.valueAsTimestamp });\n\n startDateRef.current = changedValue.valueAsTimestamp;\n onChange({\n start: changedValue,\n end: convertToCallbackParameter(state.end)\n });\n }}\n additionalInfo={fromAdditionalInfo}\n label={fromLabel}\n aria-label={`${t('range_from_datetime') + (label ? ` - ${label}` : '')}`}\n autoFocus={autoFocus}\n />\n <DateInput\n {...commonProps}\n value={state.end}\n ref={endDateInputRef}\n picker={{\n renderer: DateRangePicker,\n rendererProps: {\n selected: getSelected(state.end, state.start),\n selectedRange: getSelectedRange(),\n onChange: onEndDateChange\n }\n }}\n onBlur={changedValue => {\n if (!changedValue.state)\n dispatch({ type: 'end', value: changedValue.valueAsTimestamp });\n\n endDateRef.current = changedValue.valueAsTimestamp;\n onChange({\n start: convertToCallbackParameter(state.start),\n end: changedValue\n });\n }}\n additionalInfo={toAdditionalInfo}\n label={toLabel}\n aria-label={`${t('range_to_datetime') + (label ? ` - ${label}` : '')}`}\n />\n </Flex>\n </FormField>\n );\n }\n);\n\nexport default DateRangeInput;\n"]}
@@ -1,5 +1,6 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { ForwardProps } from '../../../types';
3
+ import { FormControlProps } from '../../FormControl';
3
4
  import { MinuteInterval } from '../Picker/TimePicker';
4
5
  import DateTimeProps from '../DateTime.types';
5
6
  import { ClockFormat } from './utils';
@@ -23,6 +24,8 @@ export interface DateTimeInputProps extends DateTimeProps {
23
24
  * Defines clock format that overrides locale based format.
24
25
  */
25
26
  clockFormat?: ClockFormat;
27
+ /** Pass a heading and content to show additional information on the field. */
28
+ additionalInfo?: FormControlProps['additionalInfo'];
26
29
  }
27
30
  export declare const StyledDateTimeInput: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, DateTimeInputProps, never>;
28
31
  declare const DateTimeInput: FunctionComponent<DateTimeInputProps & ForwardProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateTimeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAY9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,aAA4C,MAAM,mBAAmB,CAAC;AAG7E,OAAO,EACL,WAAW,EASZ,MAAM,SAAS,CAAC;AAQjB,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,eAAO,MAAM,mBAAmB,yHAc9B,CAAC;AAiFH,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CA8fvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateTimeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAqB,MAAM,mBAAmB,CAAC;AAWxE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,aAA4C,MAAM,mBAAmB,CAAC;AAG7E,OAAO,EACL,WAAW,EASZ,MAAM,SAAS,CAAC;AAQjB,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD;;;OAGG;IACH,WAAW,CAAC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