@pega/cosmos-react-core 3.0.0-dev.9.1 → 3.0.0-rc.3

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 +51 -25
  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 -22
  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 +7 -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 +17 -7
  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
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,OAAO,EAGP,QAAQ,EACR,UAAU,EAGV,SAAS,EACT,WAAW,EACZ,MAAM,OAAO,CAAC;AAEf,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAI/F,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,cAAc,EACd,cAAc,E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\n Ref,\n useEffect,\n useCallback\n} from 'react';\n\nimport Text from '../../Text';\nimport { CALENDAR_TYPES } from '../Input/local';\nimport {\n getCalendarTypeFromLocale,\n getDateOfISOWeek,\n getWeek,\n parseToDate,\n toUTCDateString\n} from '../Input/utils';\nimport { useConfiguration, useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';\nimport { ForwardProps } from '../../../types';\nimport { FormControlProps } from '../../FormControl';\n\nimport { getDaysOfMonth, getLocalizedDays, getWeeksOfMonth } from './utils';\nimport {\n StyledColumnLabel,\n ScreenReaderOnly,\n StyledPick,\n StyledDay,\n StyledCalendar,\n StyledWeekGrid,\n StyledWeekLabel,\n StyledWeekNumber\n} from './Calendar.styles';\n\nexport interface CalendarProps {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /**\n * Defines default date that will be selected initially when the Calendar is visible.\n */\n selected?: Date;\n /**\n * Defines currently visible month.\n * @default new Date()\n */\n current?: Date;\n /** Defines dates range with start date and end date that can be set by the user. */\n selectedRange?: { startDate: Date | undefined; endDate: Date | undefined };\n /** Defines if days should be highlighted for range selection */\n showHighlight?: boolean;\n /** Defines if week numbers should be displayed in calendar */\n showWeekNumber?: boolean;\n /**\n * The mode of the calendar that will be rendered, ie. whether single date or week are selectable.\n * @default \"date\"\n */\n mode?: 'date' | 'week';\n /** Callback fired when new day is selected. */\n onSelect?: (date: Date) => void;\n /** Callback fired when user focuses new day. */\n onFocus?: (date: Date) => void;\n /** Sets the type of calendar to be used. This will be determined by locale if no value is provided. */\n calendarType?: string;\n /** Defines minimum available value that can be selected by the user. */\n min?: string | number | Date;\n /** Defines maximum available value that can be selected by the user. */\n max?: string | number | Date;\n /** Set the calendar to disabled state, ie. non-interactive. */\n disabled?: boolean;\n}\n\nconst ariaOpts = { day: 'numeric', month: 'long', year: 'numeric' } as const;\n\nconst Calendar: FunctionComponent<CalendarProps & ForwardProps> = forwardRef(\n (\n {\n selected,\n current = selected ? new Date(selected.getTime()) : new Date(),\n selectedRange,\n showHighlight,\n mode = 'date',\n showWeekNumber,\n calendarType: calendar = CALENDAR_TYPES.ISO_8601,\n onSelect,\n onFocus,\n disabled,\n min: minProp,\n max: maxProp\n }: PropsWithoutRef<CalendarProps>,\n ref: Ref<HTMLTableElement>\n ) => {\n const { locale } = useConfiguration();\n const min = minProp ? parseToDate(minProp) : -Infinity;\n const max = maxProp ? parseToDate(maxProp) : Infinity;\n\n const showWeekLabel = mode === 'week' ? false : showWeekNumber;\n const [focusedDay, setFocusedDay] = useState(current);\n useEffect(() => {\n setFocusedDay(current);\n }, [current.getUTCFullYear(), current.getUTCMonth()]);\n\n const calendarType = useMemo(\n () => calendar ?? getCalendarTypeFromLocale(locale),\n [locale, calendar]\n );\n\n const [highlightBoundary, setHighlightBoundary] = useState<Date>();\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent<HTMLElement>) => {\n if (\n (mode === 'date'\n ? ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight']\n : ['ArrowUp', 'ArrowDown']\n ).includes(e.key)\n ) {\n e.preventDefault();\n const newFocused = new Date(focusedDay);\n switch (e.key) {\n case 'ArrowUp':\n newFocused.setUTCDate(focusedDay.getUTCDate() - 7);\n break;\n case 'ArrowDown':\n newFocused.setUTCDate(focusedDay.getUTCDate() + 7);\n break;\n case 'ArrowRight':\n newFocused.setUTCDate(focusedDay.getUTCDate() + 1);\n break;\n case 'ArrowLeft':\n newFocused.setUTCDate(focusedDay.getUTCDate() - 1);\n break;\n default:\n }\n if (newFocused < min || newFocused > max) return;\n setFocusedDay(newFocused);\n onFocus?.(newFocused);\n setHighlightBoundary(newFocused);\n }\n if (e.key === 'Enter') {\n e.preventDefault();\n onSelect?.(focusedDay);\n }\n },\n [mode, focusedDay, onFocus, onSelect]\n );\n\n const containerRef = useConsolidatedRef<HTMLTableElement>(ref);\n const hasFocus = useFocusWithin([containerRef]);\n\n const today = toUTCDateString(new Date());\n\n const isDisabled = (day: Date) => {\n return min > day.getTime() || day.getTime() > max;\n };\n\n const isSelected = (day: Date) => {\n return [\n selected && toUTCDateString(selected),\n selectedRange?.startDate && toUTCDateString(selectedRange?.startDate),\n selectedRange?.endDate && toUTCDateString(selectedRange?.endDate)\n ].includes(toUTCDateString(day));\n };\n\n const isWeekSelected = (day: Date) => {\n return (\n selected &&\n toUTCDateString(day) ===\n toUTCDateString(getDateOfISOWeek(getWeek(selected, calendarType), selected.getFullYear()))\n );\n };\n\n const isFocused = (day: Date) => {\n return toUTCDateString(day) === toUTCDateString(focusedDay);\n };\n\n const isWeekFocused = (day: Date) => {\n return (\n toUTCDateString(day) ===\n toUTCDateString(\n getDateOfISOWeek(getWeek(focusedDay, calendarType), focusedDay.getFullYear())\n )\n );\n };\n\n const isInRange = (day: Date) => {\n return (\n selectedRange &&\n selectedRange.startDate &&\n selectedRange.endDate &&\n day >= selectedRange.startDate &&\n day <= selectedRange.endDate\n );\n };\n\n const isHighlighted = (day: Date) => {\n if (!selectedRange || !showHighlight || !highlightBoundary) return false;\n const betweenHighlightAndBoundary = (rangeBoundaryType: 'startDate' | 'endDate') => {\n const rangeBoundary = selectedRange[rangeBoundaryType];\n if (!rangeBoundary) return false;\n return !!(\n rangeBoundary &&\n ((day >= rangeBoundary && day <= highlightBoundary) ||\n (day <= rangeBoundary && day >= highlightBoundary))\n );\n };\n return betweenHighlightAndBoundary('startDate') || betweenHighlightAndBoundary('endDate');\n };\n\n const days = getDaysOfMonth(current, calendarType ?? CALENDAR_TYPES.ISO_8601).map(day => {\n return (\n <StyledDay\n key={day.getTime()}\n variant='simple'\n icon={false}\n type='button'\n loading={false}\n ref={\n isFocused(day)\n ? (focusedRef: HTMLButtonElement) => {\n if (hasFocus) focusedRef?.focus();\n }\n : undefined\n }\n tabIndex={isFocused(day) ? 0 : -1}\n disabled={disabled || mode === 'week' || isDisabled(day)}\n current={toUTCDateString(day) === today}\n highlighted={isInRange(day) || isHighlighted(day)}\n aria-selected={isSelected(day) || undefined}\n aria-current={isFocused(day) ? 'date' : undefined}\n dayInNexOrPrevMonth={day.getUTCMonth() !== current.getUTCMonth()}\n aria-label={toUTCDateString(day, Intl.DateTimeFormat(locale, ariaOpts))}\n onMouseOver={showHighlight ? () => setHighlightBoundary(day) : undefined}\n onMouseOut={showHighlight ? () => setHighlightBoundary(undefined) : undefined}\n onMouseDown={() => {\n setFocusedDay(day);\n onFocus?.(day);\n onSelect?.(day);\n }}\n >\n {day.getUTCDate()}\n </StyledDay>\n );\n });\n\n const names = useMemo(() => getLocalizedDays(calendarType, locale), [locale, calendarType]);\n\n const t = useI18n();\n\n const weekText = t('week_label_a11y');\n\n const weeks = getWeeksOfMonth(current, calendarType).map(weekNo => {\n return (\n <>\n <Text as={StyledWeekNumber} key={weekNo} aria-hidden='true'>\n {weekNo.toString()}\n </Text>\n <ScreenReaderOnly>\n {`${weekText} ${weekNo.toString()} ${current.getUTCFullYear().toString()}`}\n </ScreenReaderOnly>\n </>\n );\n });\n\n const weeksButtons = getWeeksOfMonth(current, calendarType).map(weekNo => {\n const dateOfISOWeek = getDateOfISOWeek(weekNo, current.getUTCFullYear());\n const lastDayOfWeek = new Date(dateOfISOWeek);\n lastDayOfWeek.setDate(dateOfISOWeek.getDate() + 6);\n return (\n <StyledPick\n key={weekNo}\n variant='simple'\n icon={false}\n type='button'\n loading={false}\n ref={\n isWeekFocused(dateOfISOWeek)\n ? (focusedRef: HTMLButtonElement) => {\n if (hasFocus) focusedRef?.focus();\n }\n : undefined\n }\n tabIndex={isWeekFocused(dateOfISOWeek) ? 0 : -1}\n disabled={disabled || mode === 'date' || isDisabled(dateOfISOWeek)}\n aria-selected={isWeekSelected(dateOfISOWeek) || undefined}\n aria-label={`${t(\n 'week_label_a11y'\n )} ${weekNo.toString()}, ${dateOfISOWeek.toLocaleDateString()} - ${lastDayOfWeek.toLocaleDateString()}`}\n aria-current={isWeekFocused(dateOfISOWeek) ? 'date' : undefined}\n onMouseDown={() => {\n setFocusedDay(dateOfISOWeek);\n onFocus?.(dateOfISOWeek);\n onSelect?.(dateOfISOWeek);\n }}\n >\n {`${weekText} `}\n {weekNo.toString()}\n </StyledPick>\n );\n });\n\n const weekLabel =\n mode === 'date' ? (\n <>\n <Text as={StyledWeekLabel} forwardedAs='abbr' title={weekText} aria-hidden='true'>\n {t('week_text_short')}\n </Text>\n <ScreenReaderOnly>{weekText}</ScreenReaderOnly>\n </>\n ) : (\n <Text as={StyledWeekLabel}>{weekText}</Text>\n );\n\n const headerLabels = names.map(([name, abbr]) => (\n <th role='columnheader' key={name}>\n <Text as={StyledColumnLabel} forwardedAs='abbr' key={name} title={name} aria-hidden='true'>\n {abbr}\n </Text>\n <ScreenReaderOnly>{name}</ScreenReaderOnly>\n </th>\n ));\n\n const splitToWeeks = (resultArray: JSX.Element[][], item: JSX.Element, index: number) => {\n const chunkIndex = Math.floor(index / 7);\n\n if (!resultArray[chunkIndex]) {\n resultArray[chunkIndex] = [] as JSX.Element[];\n }\n\n resultArray[chunkIndex].push(item);\n return resultArray;\n };\n\n const cells = days.reduce(splitToWeeks, []).map((week, index) => {\n const rowHeader = mode === 'week' ? weeksButtons[index] : weeks[index];\n return (\n // eslint-disable-next-line react/no-array-index-key\n <tr key={`week-${index}`}>\n {showWeekLabel && <th scope='row'>{rowHeader}</th>}\n {week.map((day, dayIndex) => {\n // eslint-disable-next-line react/no-array-index-key\n return <td key={`day-${dayIndex}`}>{day}</td>;\n })}\n </tr>\n );\n });\n\n const weeksCells = weeksButtons.map((week, index) => {\n return (\n // eslint-disable-next-line react/no-array-index-key\n <tr key={`week-${index}`}>\n <td>{week}</td>\n </tr>\n );\n });\n\n const weeksGrid = (\n <StyledWeekGrid role='grid' onKeyDown={onKeyDown} ref={containerRef}>\n <thead>\n <tr>\n <th>{weekLabel}</th>\n </tr>\n </thead>\n <tbody>{weeksCells}</tbody>\n </StyledWeekGrid>\n );\n\n return (\n <>\n {mode === 'week' && weeksGrid}\n <StyledCalendar\n ref={mode === 'date' ? containerRef : undefined}\n aria-label={current.toLocaleString(locale, {\n month: 'long',\n year: 'numeric',\n timeZone: 'UTC'\n })}\n onKeyDown={onKeyDown}\n aria-hidden={mode === 'week' ? true : undefined}\n role='grid'\n >\n <thead>\n <tr>\n {showWeekLabel && <th>{weekLabel}</th>}\n {headerLabels}\n </tr>\n </thead>\n <tbody>{cells}</tbody>\n </StyledCalendar>\n <ScreenReaderOnly aria-live='polite' role='alert'>\n {t('calendar_assist')}\n </ScreenReaderOnly>\n </>\n );\n }\n);\n\nexport default Calendar;\n"]}
1
+ {"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,OAAO,EAGP,QAAQ,EACR,UAAU,EAGV,SAAS,EACT,WAAW,EACZ,MAAM,OAAO,CAAC;AAEf,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG/F,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AA0C3B,MAAM,QAAQ,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAW,CAAC;AAE7E,MAAM,QAAQ,GAAoD,UAAU,CAC1E,CAC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Effect,\n useCallback\n} from 'react';\n\nimport Text from '../../Text';\nimport { CALENDAR_TYPES } from '../Input/local';\nimport {\n getCalendarTypeFromLocale,\n getDateOfISOWeek,\n getWeek,\n parseToDate,\n toUTCDateString\n} from '../Input/utils';\nimport { useConfiguration, useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';\nimport { ForwardProps } from '../../../types';\nimport { FormControlProps } from '../../FormControl';\nimport { cap } from '../../../utils';\n\nimport { getDaysOfMonth, getLocalizedDays, getWeeksOfMonth } from './utils';\nimport {\n StyledColumnLabel,\n ScreenReaderOnly,\n StyledPick,\n StyledDay,\n StyledCalendar,\n StyledWeekGrid,\n StyledWeekLabel,\n StyledWeekNumber\n} from './Calendar.styles';\n\nexport interface CalendarProps {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /**\n * Defines default date that will be selected initially when the Calendar is visible.\n */\n selected?: Date;\n /**\n * Defines currently visible month.\n * @default new Date()\n */\n current?: Date;\n /** Defines dates range with start date and end date that can be set by the user. */\n selectedRange?: { startDate: Date | undefined; endDate: Date | undefined };\n /** Defines if days should be highlighted for range selection */\n showHighlight?: boolean;\n /** Defines if week numbers should be displayed in calendar */\n showWeekNumber?: boolean;\n /**\n * The mode of the calendar that will be rendered, ie. whether single date or week are selectable.\n * @default \"date\"\n */\n mode?: 'date' | 'week';\n /** Callback fired when new day is selected. */\n onSelect?: (date: Date) => void;\n /** Callback fired when user focuses new day. */\n onFocus?: (date: Date) => void;\n /** Sets the type of calendar to be used. This will be determined by locale if no value is provided. */\n calendarType?: string;\n /** Defines minimum available value that can be selected by the user. */\n min?: string | number | Date;\n /** Defines maximum available value that can be selected by the user. */\n max?: string | number | Date;\n /** Set the calendar to disabled state, ie. non-interactive. */\n disabled?: boolean;\n}\n\nconst ariaOpts = { day: 'numeric', month: 'long', year: 'numeric' } as const;\n\nconst Calendar: FunctionComponent<CalendarProps & ForwardProps> = forwardRef(\n (\n {\n selected,\n current = selected ? new Date(selected.getTime()) : new Date(),\n selectedRange,\n showHighlight,\n mode = 'date',\n showWeekNumber,\n calendarType: calendar = CALENDAR_TYPES.ISO_8601,\n onSelect,\n onFocus,\n disabled,\n min: minProp,\n max: maxProp\n }: PropsWithoutRef<CalendarProps>,\n ref: Ref<HTMLTableElement>\n ) => {\n const { locale } = useConfiguration();\n const min = minProp ? parseToDate(minProp) : -Infinity;\n const max = maxProp ? parseToDate(maxProp) : Infinity;\n\n const showWeekLabel = mode === 'week' ? false : showWeekNumber;\n const [focusedDay, setFocusedDay] = useState(current);\n useEffect(() => {\n setFocusedDay(current);\n }, [current.getUTCFullYear(), current.getUTCMonth()]);\n\n const calendarType = useMemo(\n () => calendar ?? getCalendarTypeFromLocale(locale),\n [locale, calendar]\n );\n\n const [highlightBoundary, setHighlightBoundary] = useState<Date>();\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent<HTMLElement>) => {\n if (\n (mode === 'date'\n ? ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight']\n : ['ArrowUp', 'ArrowDown']\n ).includes(e.key)\n ) {\n e.preventDefault();\n const newFocused = new Date(focusedDay);\n switch (e.key) {\n case 'ArrowUp':\n newFocused.setUTCDate(focusedDay.getUTCDate() - 7);\n break;\n case 'ArrowDown':\n newFocused.setUTCDate(focusedDay.getUTCDate() + 7);\n break;\n case 'ArrowRight':\n newFocused.setUTCDate(focusedDay.getUTCDate() + 1);\n break;\n case 'ArrowLeft':\n newFocused.setUTCDate(focusedDay.getUTCDate() - 1);\n break;\n default:\n }\n if (newFocused < min || newFocused > max) return;\n setFocusedDay(newFocused);\n onFocus?.(newFocused);\n setHighlightBoundary(newFocused);\n }\n if (e.key === 'Enter') {\n e.preventDefault();\n onSelect?.(focusedDay);\n }\n },\n [mode, focusedDay, onFocus, onSelect]\n );\n\n const containerRef = useConsolidatedRef<HTMLTableElement>(ref);\n const hasFocus = useFocusWithin([containerRef]);\n\n const today = toUTCDateString(new Date());\n\n const isDisabled = (day: Date) => {\n return min > day.getTime() || day.getTime() > max;\n };\n\n const isSelected = (day: Date) => {\n return [\n selected && toUTCDateString(selected),\n selectedRange?.startDate && toUTCDateString(selectedRange?.startDate),\n selectedRange?.endDate && toUTCDateString(selectedRange?.endDate)\n ].includes(toUTCDateString(day));\n };\n\n const isWeekSelected = (day: Date) => {\n return (\n selected &&\n toUTCDateString(day) ===\n toUTCDateString(getDateOfISOWeek(getWeek(selected, calendarType), selected.getFullYear()))\n );\n };\n\n const isFocused = (day: Date) => {\n return toUTCDateString(day) === toUTCDateString(focusedDay);\n };\n\n const isWeekFocused = (day: Date) => {\n return (\n toUTCDateString(day) ===\n toUTCDateString(\n getDateOfISOWeek(getWeek(focusedDay, calendarType), focusedDay.getFullYear())\n )\n );\n };\n\n const isInRange = (day: Date) => {\n return (\n selectedRange &&\n selectedRange.startDate &&\n selectedRange.endDate &&\n day >= selectedRange.startDate &&\n day <= selectedRange.endDate\n );\n };\n\n const isHighlighted = (day: Date) => {\n if (!selectedRange || !showHighlight || !highlightBoundary) return false;\n const betweenHighlightAndBoundary = (rangeBoundaryType: 'startDate' | 'endDate') => {\n const rangeBoundary = selectedRange[rangeBoundaryType];\n if (!rangeBoundary) return false;\n return !!(\n rangeBoundary &&\n ((day >= rangeBoundary && day <= highlightBoundary) ||\n (day <= rangeBoundary && day >= highlightBoundary))\n );\n };\n return betweenHighlightAndBoundary('startDate') || betweenHighlightAndBoundary('endDate');\n };\n\n useEffect(() => {\n if (hasFocus)\n containerRef.current?.querySelector<HTMLButtonElement>('button[tabindex=\"0\"]')?.focus();\n }, [hasFocus, focusedDay]);\n\n const days = getDaysOfMonth(current, calendarType ?? CALENDAR_TYPES.ISO_8601).map(day => {\n return (\n <StyledDay\n key={day.getTime()}\n tabIndex={isFocused(day) ? 0 : -1}\n disabled={disabled || mode === 'week' || isDisabled(day)}\n current={toUTCDateString(day) === today}\n highlighted={isInRange(day) || isHighlighted(day)}\n aria-selected={isSelected(day) || undefined}\n aria-current={isSelected(day) ? 'date' : undefined}\n dayInNexOrPrevMonth={day.getUTCMonth() !== current.getUTCMonth()}\n aria-label={toUTCDateString(day, Intl.DateTimeFormat(locale, ariaOpts))}\n onMouseOver={showHighlight ? () => setHighlightBoundary(day) : undefined}\n onMouseOut={showHighlight ? () => setHighlightBoundary(undefined) : undefined}\n onClick={() => {\n setFocusedDay(day);\n onFocus?.(day);\n onSelect?.(day);\n }}\n >\n {day.getUTCDate()}\n </StyledDay>\n );\n });\n\n const names = useMemo(() => getLocalizedDays(calendarType, locale), [locale, calendarType]);\n\n const t = useI18n();\n\n const displayNames = new Intl.DisplayNames(locale, {\n style: 'long',\n type: 'dateTimeField'\n }) as Intl.DateTimeDisplayNames;\n const displayNamesShort = new Intl.DisplayNames(locale, {\n style: 'short',\n type: 'dateTimeField'\n }) as Intl.DateTimeDisplayNames;\n\n const weeks = getWeeksOfMonth(current, calendarType).map(weekNo => {\n return (\n <>\n <Text as={StyledWeekNumber} key={weekNo} aria-hidden='true'>\n {weekNo.toString()}\n </Text>\n <ScreenReaderOnly>\n {`${displayNames.of('weekOfYear')} ${weekNo.toString()} ${current\n .getUTCFullYear()\n .toString()}`}\n </ScreenReaderOnly>\n </>\n );\n });\n\n const weeksButtons = getWeeksOfMonth(current, calendarType).map(weekNo => {\n const dateOfISOWeek = getDateOfISOWeek(weekNo, current.getUTCFullYear());\n const lastDayOfWeek = new Date(dateOfISOWeek);\n lastDayOfWeek.setDate(dateOfISOWeek.getDate() + 6);\n return (\n <StyledPick\n key={weekNo}\n tabIndex={isWeekFocused(dateOfISOWeek) ? 0 : -1}\n disabled={disabled || mode === 'date' || isDisabled(dateOfISOWeek)}\n aria-selected={isWeekSelected(dateOfISOWeek) || undefined}\n aria-label={`${displayNames.of('weekOfYear')} ${weekNo.toString()} ${toUTCDateString(\n dateOfISOWeek,\n Intl.DateTimeFormat(locale, ariaOpts)\n )} - ${toUTCDateString(lastDayOfWeek, Intl.DateTimeFormat(locale, ariaOpts))}`}\n aria-current={isWeekFocused(dateOfISOWeek) ? 'date' : undefined}\n onMouseDown={() => {\n setFocusedDay(dateOfISOWeek);\n onFocus?.(dateOfISOWeek);\n onSelect?.(dateOfISOWeek);\n }}\n >\n {`${cap(displayNames.of('weekOfYear'))} `}\n {weekNo.toString()}\n </StyledPick>\n );\n });\n\n const weekLabel =\n mode === 'date' ? (\n <>\n <Text\n as={StyledWeekLabel}\n forwardedAs='abbr'\n title={cap(displayNames.of('weekOfYear'))}\n aria-hidden='true'\n >\n {cap(displayNamesShort.of('weekOfYear'))}\n </Text>\n <ScreenReaderOnly>{displayNames.of('weekOfYear')}</ScreenReaderOnly>\n </>\n ) : (\n <Text as={StyledWeekLabel}>{cap(displayNames.of('weekOfYear'))}</Text>\n );\n\n const headerLabels = names.map(([name, abbr]) => (\n <th role='columnheader' key={name}>\n <Text as={StyledColumnLabel} forwardedAs='abbr' key={name} title={name} aria-hidden='true'>\n {abbr}\n </Text>\n <ScreenReaderOnly>{name}</ScreenReaderOnly>\n </th>\n ));\n\n const splitToWeeks = (resultArray: JSX.Element[][], item: JSX.Element, index: number) => {\n const chunkIndex = Math.floor(index / 7);\n\n if (!resultArray[chunkIndex]) {\n resultArray[chunkIndex] = [] as JSX.Element[];\n }\n\n resultArray[chunkIndex].push(item);\n return resultArray;\n };\n\n const cells = days.reduce(splitToWeeks, []).map((week, index) => {\n const rowHeader = mode === 'week' ? weeksButtons[index] : weeks[index];\n return (\n // eslint-disable-next-line react/no-array-index-key\n <tr key={`week-${index}`}>\n {showWeekLabel && <th scope='row'>{rowHeader}</th>}\n {week.map((day, dayIndex) => {\n // eslint-disable-next-line react/no-array-index-key\n return <td key={`day-${dayIndex}`}>{day}</td>;\n })}\n </tr>\n );\n });\n\n const weeksCells = weeksButtons.map((week, index) => {\n return (\n // eslint-disable-next-line react/no-array-index-key\n <tr key={`week-${index}`}>\n <td>{week}</td>\n </tr>\n );\n });\n\n const weeksGrid = (\n <StyledWeekGrid role='grid' onKeyDown={onKeyDown} ref={containerRef}>\n <thead>\n <tr>\n <th>{weekLabel}</th>\n </tr>\n </thead>\n <tbody>{weeksCells}</tbody>\n </StyledWeekGrid>\n );\n\n return (\n <>\n {mode === 'week' && weeksGrid}\n <StyledCalendar\n ref={mode === 'date' ? containerRef : undefined}\n aria-label={current.toLocaleString(locale, {\n month: 'long',\n year: 'numeric',\n timeZone: 'UTC'\n })}\n onKeyDown={onKeyDown}\n aria-hidden={mode === 'week' ? true : undefined}\n role='grid'\n >\n <thead>\n <tr>\n {showWeekLabel && <th>{weekLabel}</th>}\n {headerLabels}\n </tr>\n </thead>\n <tbody>{cells}</tbody>\n </StyledCalendar>\n <ScreenReaderOnly aria-live='polite' role='alert'>\n {t('calendar_assist')}\n </ScreenReaderOnly>\n </>\n );\n }\n);\n\nexport default Calendar;\n"]}
@@ -1,9 +1,7 @@
1
- export declare const StyledPick: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, import("../../..").OmitStrict<import("../../Button").ButtonProps, "icon" | "disabled" | "type" | "loading" | "variant"> & Required<Pick<import("../../Button").ButtonProps, "icon" | "disabled" | "type" | "loading" | "variant">>, never>;
2
- export declare const StyledMonthPicker: import("styled-components").StyledComponent<"fieldset", import("styled-components").DefaultTheme, {}, never>;
3
- export declare const StyledDatePicker: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
1
+ export declare const StyledPick: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../../Button").ButtonProps & import("../../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
4
2
  export declare const StyledColumnLabel: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
5
3
  export declare const ScreenReaderOnly: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
6
- export declare const StyledDay: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, import("../../..").OmitStrict<import("../../Button").ButtonProps, "icon" | "disabled" | "type" | "loading" | "variant"> & Required<Pick<import("../../Button").ButtonProps, "icon" | "disabled" | "type" | "loading" | "variant">> & {
4
+ export declare const StyledDay: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../../Button").ButtonProps & import("../../..").ForwardProps>, import("styled-components").DefaultTheme, {
7
5
  current: boolean;
8
6
  highlighted: boolean;
9
7
  dayInNexOrPrevMonth: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,4UAqCrB,CAAC;AAIH,eAAO,MAAM,iBAAiB,8GA4B5B,CAAC;AAIH,eAAO,MAAM,gBAAgB,yGAkB3B,CAAC;AAIH,eAAO,MAAM,iBAAiB,0GAI7B,CAAC;AAIF,eAAO,MAAM,gBAAgB,0GAE5B,CAAC;AAEF,eAAO,MAAM,SAAS;aACX,OAAO;iBACH,OAAO;yBACC,OAAO;SAoC5B,CAAC;AAIH,eAAO,MAAM,eAAe,0GAc1B,CAAC;AAIH,eAAO,MAAM,gBAAgB,0GAoB3B,CAAC;AAIH,eAAO,MAAM,cAAc,2GAoBzB,CAAC;AAIH,eAAO,MAAM,cAAc,2GA2CzB,CAAC"}
1
+ {"version":3,"file":"Calendar.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.styles.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,UAAU,2MAiCrB,CAAC;AAIH,eAAO,MAAM,iBAAiB,0GAI7B,CAAC;AAIF,eAAO,MAAM,gBAAgB,0GAE5B,CAAC;AAEF,eAAO,MAAM,SAAS;aACX,OAAO;iBACH,OAAO;yBACC,OAAO;SAkC5B,CAAC;AAIH,eAAO,MAAM,eAAe,0GAc1B,CAAC;AAIH,eAAO,MAAM,gBAAgB,0GA8B3B,CAAC;AAIH,eAAO,MAAM,cAAc,2GAoBzB,CAAC;AAIH,eAAO,MAAM,cAAc,2GA2CzB,CAAC"}
@@ -1,72 +1,30 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { hideVisually, rgba as polishedRgba } from 'polished';
2
+ import { hideVisually, mix, readableColor, rgba, transparentize } from 'polished';
3
3
  import { defaultThemeProp } from '../../../theme';
4
- import { StyledSelect } from '../../Select/Select';
5
- import { StyledButton } from '../../Button';
6
4
  import { tryCatch } from '../../../utils';
7
- export const StyledPick = styled(StyledButton)(props => {
8
- const { theme: { base: { colors, 'border-radius': borderRadius, palette: { interactive, light }, spacing } } } = props;
5
+ import Button from '../../Button';
6
+ export const StyledPick = styled(Button)(props => {
7
+ const { theme: { base: { 'border-radius': borderRadius, palette: { interactive, dark }, spacing }, components: { card: { background } } } } = props;
8
+ const textColor = tryCatch(() => readableColor(interactive));
9
+ const disabledBackground = tryCatch(() => transparentize(0.5, mix(0.8, background, dark)));
9
10
  return css `
10
11
  height: 2.625rem;
11
12
  border-radius: calc(0.5 * ${borderRadius});
12
13
  padding: 0 ${spacing};
13
14
  background-color: transparent;
14
15
 
15
- & + & {
16
- margin-inline-start: 0;
17
- }
18
-
19
16
  &[aria-selected]:enabled {
20
17
  background-color: ${interactive};
21
- color: ${light};
18
+ color: ${textColor};
22
19
  }
23
20
 
24
21
  &:disabled {
25
- background-color: ${colors.gray['extra-light']};
22
+ background-color: ${disabledBackground};
26
23
  border-radius: 0;
27
24
  }
28
-
29
- &:focus {
30
- outline: none;
31
- box-shadow: inset 0 0 0 0.125rem ${colors.blue.light};
32
- }
33
25
  `;
34
26
  });
35
27
  StyledPick.defaultProps = defaultThemeProp;
36
- export const StyledMonthPicker = styled.fieldset(props => {
37
- const { theme: { base: { spacing, 'border-radius': baseBorderRadius, palette: { 'foreground-color': color } }, components: { 'form-control': formControl } } } = props;
38
- return css `
39
- margin: calc(2 * ${spacing}) calc(0.5 * ${spacing});
40
- font-size: 0.875rem;
41
- border: none;
42
-
43
- ${StyledSelect} {
44
- border-radius: calc(${baseBorderRadius} * ${formControl['border-radius']});
45
- }
46
-
47
- ${StyledButton} {
48
- border-radius: calc(${baseBorderRadius} * ${formControl['border-radius']});
49
- border: 0;
50
- &:enabled {
51
- color: ${color};
52
- }
53
- }
54
- `;
55
- });
56
- StyledMonthPicker.defaultProps = defaultThemeProp;
57
- export const StyledDatePicker = styled.div(props => {
58
- const { theme: { base: { spacing }, components: { 'form-control': { 'foreground-color': foreground } } } } = props;
59
- return css `
60
- width: max-content;
61
-
62
- ${StyledButton} {
63
- border: transparent;
64
- color: ${foreground};
65
- }
66
- padding: 0 ${spacing} ${spacing} ${spacing};
67
- `;
68
- });
69
- StyledDatePicker.defaultProps = defaultThemeProp;
70
28
  export const StyledColumnLabel = styled.span `
71
29
  text-align: center;
72
30
  margin: 0 auto;
@@ -77,8 +35,8 @@ export const ScreenReaderOnly = styled.span `
77
35
  ${hideVisually}
78
36
  `;
79
37
  export const StyledDay = styled(StyledPick)(props => {
80
- const { theme: { base: { colors, palette: { interactive }, 'disabled-opacity': disabledOpacity } }, current, highlighted, dayInNexOrPrevMonth } = props;
81
- const highlightedBgColor = tryCatch(() => polishedRgba(interactive, 0.1));
38
+ const { theme: { base: { palette: { interactive }, 'disabled-opacity': disabledOpacity } }, current, highlighted, dayInNexOrPrevMonth } = props;
39
+ const highlightedBgColor = tryCatch(() => rgba(interactive, 0.1));
82
40
  return css `
83
41
  background-color: ${highlighted ? highlightedBgColor : 'transparent'};
84
42
 
@@ -94,7 +52,6 @@ export const StyledDay = styled(StyledPick)(props => {
94
52
 
95
53
  ${current &&
96
54
  css `
97
- color: ${colors.slate.dark};
98
55
  font-weight: bold;
99
56
  `}
100
57
  `;
@@ -112,12 +69,13 @@ export const StyledWeekLabel = styled(StyledColumnLabel)(props => {
112
69
  });
113
70
  StyledWeekLabel.defaultProps = defaultThemeProp;
114
71
  export const StyledWeekNumber = styled.span(props => {
115
- const { theme: { base: { breakpoints, spacing, colors, 'disabled-opacity': disabledOpacity } } } = props;
72
+ const { theme: { base: { breakpoints, spacing, 'disabled-opacity': disabledOpacity, palette: { dark } }, components: { card: { background: cardBackground } } } } = props;
73
+ const background = tryCatch(() => transparentize(0.5, mix(0.8, cardBackground, dark)));
116
74
  return css `
117
75
  line-height: 2.625rem;
118
76
  padding: 0;
119
77
  margin-inline-end: 0;
120
- background-color: ${colors.gray['extra-light']};
78
+ background-color: ${background};
121
79
  display: inline-block;
122
80
  opacity: ${disabledOpacity};
123
81
 
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.styles.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,EAAE;IACrD,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,MAAM,EACN,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,EAC/B,OAAO,EACR,EACF,EACF,GAAG,KAAK,CAAC;IAEV,OAAO,GAAG,CAAA;;gCAEoB,YAAY;iBAC3B,OAAO;;;;;;;;0BAQE,WAAW;eACtB,KAAK;;;;0BAIM,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;;;;;;yCAMX,MAAM,CAAC,IAAI,CAAC,KAAK;;GAEvD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,iBA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EV,OAAO,GAAG,CAAA;;;;wBAIY,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;;eAEnC,eAAe;;yBAEL,WAAW,CAAC,EAAE;mBACpB,OAAO;2BACC,OAAO;;GAE/B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjD,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,OAAO,EAAE,EAClB,EACF,GAAG,KAAK,CAAC;IACV,OAAO,GAAG,CAAA;;;;;;;0BAOc,OAAO;;;MAG3B,UAAU;2BACW,OAAO;;GAE/B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjD,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,EACjD,EACF,GAAG,KAAK,CAAC;IACV,OAAO,GAAG,CAAA;;;;;;;;;;;0BAWc,OAAO;;;;;;;;QAQzB,SAAS;;;;;;;UAOP,gBAAgB;sCACY,YAAY,gBAAgB,YAAY;;;;UAIpE,gBAAgB;0CACgB,YAAY,gBAAgB,YAAY;;;;GAI/E,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { hideVisually, rgba as polishedRgba } from 'polished';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { StyledSelect } from '../../Select/Select';\nimport { StyledButton } from '../../Button';\nimport { tryCatch } from '../../../utils';\n\nexport const StyledPick = styled(StyledButton)(props => {\n const {\n theme: {\n base: {\n colors,\n 'border-radius': borderRadius,\n palette: { interactive, light },\n spacing\n }\n }\n } = props;\n\n return css`\n height: 2.625rem;\n border-radius: calc(0.5 * ${borderRadius});\n padding: 0 ${spacing};\n background-color: transparent;\n\n & + & {\n margin-inline-start: 0;\n }\n\n &[aria-selected]:enabled {\n background-color: ${interactive};\n color: ${light};\n }\n\n &:disabled {\n background-color: ${colors.gray['extra-light']};\n border-radius: 0;\n }\n\n &:focus {\n outline: none;\n box-shadow: inset 0 0 0 0.125rem ${colors.blue.light};\n }\n `;\n});\n\nStyledPick.defaultProps = defaultThemeProp;\n\nexport const StyledMonthPicker = styled.fieldset(props => {\n const {\n theme: {\n base: {\n spacing,\n 'border-radius': baseBorderRadius,\n palette: { 'foreground-color': color }\n },\n components: { 'form-control': formControl }\n }\n } = props;\n return css`\n margin: calc(2 * ${spacing}) calc(0.5 * ${spacing});\n font-size: 0.875rem;\n border: none;\n\n ${StyledSelect} {\n border-radius: calc(${baseBorderRadius} * ${formControl['border-radius']});\n }\n\n ${StyledButton} {\n border-radius: calc(${baseBorderRadius} * ${formControl['border-radius']});\n border: 0;\n &:enabled {\n color: ${color};\n }\n }\n `;\n});\n\nStyledMonthPicker.defaultProps = defaultThemeProp;\n\nexport const StyledDatePicker = styled.div(props => {\n const {\n theme: {\n base: { spacing },\n components: {\n 'form-control': { 'foreground-color': foreground }\n }\n }\n } = props;\n return css`\n width: max-content;\n\n ${StyledButton} {\n border: transparent;\n color: ${foreground};\n }\n padding: 0 ${spacing} ${spacing} ${spacing};\n `;\n});\n\nStyledDatePicker.defaultProps = defaultThemeProp;\n\nexport const StyledColumnLabel = styled.span`\n text-align: center;\n margin: 0 auto;\n font-size: 0.75rem;\n`;\n\nStyledColumnLabel.defaultProps = defaultThemeProp;\n\nexport const ScreenReaderOnly = styled.span`\n ${hideVisually}\n`;\n\nexport const StyledDay = styled(StyledPick)<{\n current: boolean;\n highlighted: boolean;\n dayInNexOrPrevMonth: boolean;\n}>(props => {\n const {\n theme: {\n base: {\n colors,\n palette: { interactive },\n 'disabled-opacity': disabledOpacity\n }\n },\n current,\n highlighted,\n dayInNexOrPrevMonth\n } = props;\n\n const highlightedBgColor = tryCatch(() => polishedRgba(interactive, 0.1));\n\n return css`\n background-color: ${highlighted ? highlightedBgColor : 'transparent'};\n\n ${highlighted &&\n css`\n border-radius: 0;\n `}\n\n ${dayInNexOrPrevMonth &&\n css`\n opacity: ${disabledOpacity};\n `}\n\n ${current &&\n css`\n color: ${colors.slate.dark};\n font-weight: bold;\n `}\n `;\n});\n\nStyledDay.defaultProps = defaultThemeProp;\n\nexport const StyledWeekLabel = styled(StyledColumnLabel)(props => {\n const {\n theme: {\n base: { spacing, breakpoints }\n }\n } = props;\n\n return css`\n margin-inline-end: 0;\n\n @media (min-width: ${breakpoints.sm}) {\n margin-inline-end: ${spacing};\n }\n `;\n});\n\nStyledWeekLabel.defaultProps = defaultThemeProp;\n\nexport const StyledWeekNumber = styled.span(props => {\n const {\n theme: {\n base: { breakpoints, spacing, colors, 'disabled-opacity': disabledOpacity }\n }\n } = props;\n\n return css`\n line-height: 2.625rem;\n padding: 0;\n margin-inline-end: 0;\n background-color: ${colors.gray['extra-light']};\n display: inline-block;\n opacity: ${disabledOpacity};\n\n @media (min-width: ${breakpoints.sm}) {\n padding: 0 ${spacing};\n margin-inline-end: ${spacing};\n }\n `;\n});\n\nStyledWeekNumber.defaultProps = defaultThemeProp;\n\nexport const StyledWeekGrid = styled.table(props => {\n const {\n theme: {\n base: { spacing }\n }\n } = props;\n return css`\n table-layout: fixed;\n border-collapse: collapse;\n border-spacing: 0;\n\n thead {\n th {\n padding-bottom: ${spacing};\n }\n }\n ${StyledPick} {\n margin-inline-end: ${spacing};\n }\n `;\n});\n\nStyledWeekGrid.defaultProps = defaultThemeProp;\n\nexport const StyledCalendar = styled.table(props => {\n const {\n theme: {\n base: { 'border-radius': borderRadius, spacing }\n }\n } = props;\n return css`\n table-layout: fixed;\n border-collapse: collapse;\n border-spacing: 0;\n\n th {\n max-width: 2.625rem;\n }\n\n thead {\n th {\n padding-bottom: ${spacing};\n }\n }\n\n td {\n width: 2.625rem;\n max-width: 2.625rem;\n\n ${StyledDay} {\n width: 100%;\n }\n }\n\n tr {\n &:first-child {\n ${StyledWeekNumber} {\n border-radius: calc(0.5 * ${borderRadius}) calc(0.5 * ${borderRadius}) 0 0;\n }\n }\n &:last-child {\n ${StyledWeekNumber} {\n border-radius: 0 0 calc(0.5 * ${borderRadius}) calc(0.5 * ${borderRadius});\n }\n }\n }\n `;\n});\n\nStyledCalendar.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"Calendar.styles.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,EAAE;IAC/C,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAC9B,OAAO,EACR,EACD,UAAU,EAAE,EACV,IAAI,EAAE,EAAE,UAAU,EAAE,EACrB,EACF,EACF,GAAG,KAAK,CAAC;IAEV,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7D,MAAM,kBAAkB,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,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MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjD,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,EACjD,EACF,GAAG,KAAK,CAAC;IACV,OAAO,GAAG,CAAA;;;;;;;;;;;0BAWc,OAAO;;;;;;;;QAQzB,SAAS;;;;;;;UAOP,gBAAgB;sCACY,YAAY,gBAAgB,YAAY;;;;UAIpE,gBAAgB;0CACgB,YAAY,gBAAgB,YAAY;;;;GAI/E,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { hideVisually, mix, readableColor, rgba, transparentize } from 'polished';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { tryCatch } from '../../../utils';\nimport Button from '../../Button';\n\nexport const StyledPick = styled(Button)(props => {\n const {\n theme: {\n base: {\n 'border-radius': borderRadius,\n palette: { interactive, dark },\n spacing\n },\n components: {\n card: { background }\n }\n }\n } = props;\n\n const textColor = tryCatch(() => readableColor(interactive));\n const disabledBackground = tryCatch(() => transparentize(0.5, mix(0.8, background, dark)));\n\n return css`\n height: 2.625rem;\n border-radius: calc(0.5 * ${borderRadius});\n padding: 0 ${spacing};\n background-color: transparent;\n\n &[aria-selected]:enabled {\n background-color: ${interactive};\n color: ${textColor};\n }\n\n &:disabled {\n background-color: ${disabledBackground};\n border-radius: 0;\n }\n `;\n});\n\nStyledPick.defaultProps = defaultThemeProp;\n\nexport const StyledColumnLabel = styled.span`\n text-align: center;\n margin: 0 auto;\n font-size: 0.75rem;\n`;\n\nStyledColumnLabel.defaultProps = defaultThemeProp;\n\nexport const ScreenReaderOnly = styled.span`\n ${hideVisually}\n`;\n\nexport const StyledDay = styled(StyledPick)<{\n current: boolean;\n highlighted: boolean;\n dayInNexOrPrevMonth: boolean;\n}>(props => {\n const {\n theme: {\n base: {\n palette: { interactive },\n 'disabled-opacity': disabledOpacity\n }\n },\n current,\n highlighted,\n dayInNexOrPrevMonth\n } = props;\n\n const highlightedBgColor = tryCatch(() => rgba(interactive, 0.1));\n\n return css`\n background-color: ${highlighted ? highlightedBgColor : 'transparent'};\n\n ${highlighted &&\n css`\n border-radius: 0;\n `}\n\n ${dayInNexOrPrevMonth &&\n css`\n opacity: ${disabledOpacity};\n `}\n\n ${current &&\n css`\n font-weight: bold;\n `}\n `;\n});\n\nStyledDay.defaultProps = defaultThemeProp;\n\nexport const StyledWeekLabel = styled(StyledColumnLabel)(props => {\n const {\n theme: {\n base: { spacing, breakpoints }\n }\n } = props;\n\n return css`\n margin-inline-end: 0;\n\n @media (min-width: ${breakpoints.sm}) {\n margin-inline-end: ${spacing};\n }\n `;\n});\n\nStyledWeekLabel.defaultProps = defaultThemeProp;\n\nexport const StyledWeekNumber = styled.span(props => {\n const {\n theme: {\n base: {\n breakpoints,\n spacing,\n 'disabled-opacity': disabledOpacity,\n palette: { dark }\n },\n components: {\n card: { background: cardBackground }\n }\n }\n } = props;\n\n const background = tryCatch(() => transparentize(0.5, mix(0.8, cardBackground, dark)));\n\n return css`\n line-height: 2.625rem;\n padding: 0;\n margin-inline-end: 0;\n background-color: ${background};\n display: inline-block;\n opacity: ${disabledOpacity};\n\n @media (min-width: ${breakpoints.sm}) {\n padding: 0 ${spacing};\n margin-inline-end: ${spacing};\n }\n `;\n});\n\nStyledWeekNumber.defaultProps = defaultThemeProp;\n\nexport const StyledWeekGrid = styled.table(props => {\n const {\n theme: {\n base: { spacing }\n }\n } = props;\n return css`\n table-layout: fixed;\n border-collapse: collapse;\n border-spacing: 0;\n\n thead {\n th {\n padding-bottom: ${spacing};\n }\n }\n ${StyledPick} {\n margin-inline-end: ${spacing};\n }\n `;\n});\n\nStyledWeekGrid.defaultProps = defaultThemeProp;\n\nexport const StyledCalendar = styled.table(props => {\n const {\n theme: {\n base: { 'border-radius': borderRadius, spacing }\n }\n } = props;\n return css`\n table-layout: fixed;\n border-collapse: collapse;\n border-spacing: 0;\n\n th {\n max-width: 2.625rem;\n }\n\n thead {\n th {\n padding-bottom: ${spacing};\n }\n }\n\n td {\n width: 2.625rem;\n max-width: 2.625rem;\n\n ${StyledDay} {\n width: 100%;\n }\n }\n\n tr {\n &:first-child {\n ${StyledWeekNumber} {\n border-radius: calc(0.5 * ${borderRadius}) calc(0.5 * ${borderRadius}) 0 0;\n }\n }\n &:last-child {\n ${StyledWeekNumber} {\n border-radius: 0 0 calc(0.5 * ${borderRadius}) calc(0.5 * ${borderRadius});\n }\n }\n }\n `;\n});\n\nStyledCalendar.defaultProps = defaultThemeProp;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,MAAM,OAAO,CAAC;AAavE,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAejD,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,CA4FlD,CAAC;AAIF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,MAAM,OAAO,CAAC;AAavE,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAgBjD,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,CA4FlD,CAAC;AAIF,eAAe,UAAU,CAAC"}
@@ -10,8 +10,9 @@ import { useConfiguration, useDirection, useI18n } from '../../../hooks';
10
10
  import { getCalendarTypeFromLocale, toUTCDateString } from '../Input/utils';
11
11
  import { CALENDAR_TYPES } from '../Input/local';
12
12
  import Calendar from './Calendar';
13
- import { ScreenReaderOnly, StyledDatePicker, StyledMonthPicker } from './Calendar.styles';
13
+ import { ScreenReaderOnly } from './Calendar.styles';
14
14
  import { isValidDate } from './utils';
15
+ import { StyledDatePicker, StyledMonthPicker } from './DatePicker.styles';
15
16
  registerIcon(caretLeftIcon, caretRightIcon);
16
17
  const defaultProps = {
17
18
  showWeekNumber: false,
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DatePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,aAAa,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,YAAY,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AAE5C,MAAM,YAAY,GAA6B;IAC7C,cAAc,EAAE,KAAK;IACrB,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,SAAS,YAAY,CAAC,IAAsB;IAC1C,OAAO,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,GAAuC,CAAC,K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GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;4BACrC,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;4BACrD,UAAU,CAAC,UAAU,CAAC,CAAC;wBACzB,CAAC,gBACW,CAAC,CAAC,mBAAmB,CAAC,YAElC,KAAC,IAAI,IAAC,IAAI,EAAE,SAAS,GAAG,EAAE,GAAI,GACvB,IACJ,EACP,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAC,KAAK,YAC5C,KAAC,QAAQ,IACP,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAClE,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,EACtE,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,IAAI,CAAC,EAAE;wBACd,UAAU,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC,EACD,QAAQ,EAAE,IAAI,CAAC,EAAE;wBACf,UAAU,CAAC,IAAI,CAAC,CAAC;wBACjB,WAAW,CAAC,IAAI,CAAC,CAAC;wBAClB,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC,EACD,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,GACR,GACG,IACU,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG,YAAY,CAAC;AAEvC,eAAe,UAAU,CAAC","sourcesContent":["import { FunctionComponent, useState, useEffect, useRef } from 'react';\n\nimport Flex from '../../Flex';\nimport MonthInput from '../Input/MonthInput';\nimport Button from '../../Button';\nimport Icon, { registerIcon } from '../../Icon';\nimport * as caretLeftIcon from '../../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../../Icon/icons/caret-right.icon';\nimport { useConfiguration, useDirection, useI18n } from '../../../hooks';\nimport { getCalendarTypeFromLocale, toUTCDateString } from '../Input/utils';\nimport { CALENDAR_TYPES } from '../Input/local';\n\nimport Calendar from './Calendar';\nimport DatePickerProps from './DatePicker.types';\nimport { ScreenReaderOnly, StyledDatePicker, StyledMonthPicker } from './Calendar.styles';\nimport { isValidDate } from './utils';\n\nregisterIcon(caretLeftIcon, caretRightIcon);\n\nconst defaultProps: Partial<DatePickerProps> = {\n showWeekNumber: false,\n mode: 'date'\n};\n\nfunction toDateString(date: Date | undefined) {\n return date ? toUTCDateString(date) : undefined;\n}\n\nconst DatePicker: FunctionComponent<DatePickerProps> = (props: DatePickerProps) => {\n const { locale } = useConfiguration();\n const { selected: initial, onChange, min, max, mode, showWeekNumber, ...restProps } = props;\n\n const [selected, setSelected] = useState(initial);\n const [current, setCurrent] = useState(selected && isValidDate(selected) ? selected : new Date());\n\n useEffect(() => {\n if (toDateString(initial) !== toDateString(selected)) {\n setSelected(initial);\n setCurrent(initial || new Date());\n }\n }, [toDateString(initial)]);\n\n const calendarRef = useRef<HTMLTableElement>(null);\n useEffect(() => {\n // need to postpone focusing to make sure onFocusWithin has been attached\n setTimeout(() => {\n calendarRef.current?.querySelector<HTMLElement>('button[tabindex=\"0\"]:enabled')?.focus();\n });\n }, []);\n\n const calendarType = getCalendarTypeFromLocale(locale);\n const t = useI18n();\n const { start, end } = useDirection();\n\n return (\n <StyledDatePicker aria-label={t('calendar')} role='region' {...restProps}>\n <Flex as={StyledMonthPicker} container={{ justify: 'between', alignItems: 'center' }}>\n <Button\n variant='simple'\n icon\n onClick={() => {\n const newCurrent = new Date(current);\n newCurrent.setUTCMonth(newCurrent.getUTCMonth() - 1);\n setCurrent(newCurrent);\n }}\n aria-label={t('picker_prev_month')}\n >\n <Icon name={`caret-${start}`} />\n </Button>\n <MonthInput\n value={current}\n required\n role='group'\n aria-label={t('picker_jump_to_month_and_year')}\n onChange={({ valueAsTimestamp }) => {\n const newCurrent = new Date(valueAsTimestamp!);\n newCurrent.setUTCDate(current.getUTCDate());\n setCurrent(newCurrent);\n }}\n min={min}\n max={max}\n />\n <ScreenReaderOnly aria-live='polite' role='alert'>\n {current.toLocaleString(locale, { month: 'long', year: 'numeric', timeZone: 'UTC' })}\n </ScreenReaderOnly>\n <Button\n variant='simple'\n icon\n onClick={() => {\n const newCurrent = new Date(current);\n newCurrent.setUTCMonth(newCurrent.getUTCMonth() + 1);\n setCurrent(newCurrent);\n }}\n aria-label={t('picker_next_month')}\n >\n <Icon name={`caret-${end}`} />\n </Button>\n </Flex>\n <Flex container={{ wrap: 'nowrap' }} dir='ltr'>\n <Calendar\n ref={calendarRef}\n selected={selected && isValidDate(selected) ? selected : undefined}\n current={current}\n calendarType={mode === 'date' ? calendarType : CALENDAR_TYPES.ISO_8601}\n showWeekNumber={showWeekNumber}\n mode={mode}\n onFocus={date => {\n setCurrent(date);\n }}\n onSelect={date => {\n setCurrent(date);\n setSelected(date);\n onChange?.(date);\n }}\n min={min}\n max={max}\n />\n </Flex>\n </StyledDatePicker>\n );\n};\n\nDatePicker.defaultProps = defaultProps;\n\nexport default DatePicker;\n"]}
1
+ {"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DatePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,aAAa,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAC;AACpE,OAAO,EA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ChB,YAAY,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,EACtE,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,IAAI,CAAC,EAAE;wBACd,UAAU,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC,EACD,QAAQ,EAAE,IAAI,CAAC,EAAE;wBACf,UAAU,CAAC,IAAI,CAAC,CAAC;wBACjB,WAAW,CAAC,IAAI,CAAC,CAAC;wBAClB,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC,EACD,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,GACR,GACG,IACU,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG,YAAY,CAAC;AAEvC,eAAe,UAAU,CAAC","sourcesContent":["import { FunctionComponent, useState, useEffect, useRef } from 'react';\n\nimport Flex from '../../Flex';\nimport MonthInput from '../Input/MonthInput';\nimport Button from '../../Button';\nimport Icon, { registerIcon } from '../../Icon';\nimport * as caretLeftIcon from '../../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../../Icon/icons/caret-right.icon';\nimport { useConfiguration, useDirection, useI18n } from '../../../hooks';\nimport { getCalendarTypeFromLocale, toUTCDateString } from '../Input/utils';\nimport { CALENDAR_TYPES } from '../Input/local';\n\nimport Calendar from './Calendar';\nimport DatePickerProps from './DatePicker.types';\nimport { ScreenReaderOnly } from './Calendar.styles';\nimport { isValidDate } from './utils';\nimport { StyledDatePicker, StyledMonthPicker } from './DatePicker.styles';\n\nregisterIcon(caretLeftIcon, caretRightIcon);\n\nconst defaultProps: Partial<DatePickerProps> = {\n showWeekNumber: false,\n mode: 'date'\n};\n\nfunction toDateString(date: Date | undefined) {\n return date ? toUTCDateString(date) : undefined;\n}\n\nconst DatePicker: FunctionComponent<DatePickerProps> = (props: DatePickerProps) => {\n const { locale } = useConfiguration();\n const { selected: initial, onChange, min, max, mode, showWeekNumber, ...restProps } = props;\n\n const [selected, setSelected] = useState(initial);\n const [current, setCurrent] = useState(selected && isValidDate(selected) ? selected : new Date());\n\n useEffect(() => {\n if (toDateString(initial) !== toDateString(selected)) {\n setSelected(initial);\n setCurrent(initial || new Date());\n }\n }, [toDateString(initial)]);\n\n const calendarRef = useRef<HTMLTableElement>(null);\n useEffect(() => {\n // need to postpone focusing to make sure onFocusWithin has been attached\n setTimeout(() => {\n calendarRef.current?.querySelector<HTMLElement>('button[tabindex=\"0\"]:enabled')?.focus();\n });\n }, []);\n\n const calendarType = getCalendarTypeFromLocale(locale);\n const t = useI18n();\n const { start, end } = useDirection();\n\n return (\n <StyledDatePicker aria-label={t('calendar')} role='region' {...restProps}>\n <Flex as={StyledMonthPicker} container={{ justify: 'between', alignItems: 'center' }}>\n <Button\n variant='simple'\n icon\n onClick={() => {\n const newCurrent = new Date(current);\n newCurrent.setUTCMonth(newCurrent.getUTCMonth() - 1);\n setCurrent(newCurrent);\n }}\n aria-label={t('picker_prev_month')}\n >\n <Icon name={`caret-${start}`} />\n </Button>\n <MonthInput\n value={current}\n required\n role='group'\n aria-label={t('picker_jump_to_month_and_year')}\n onChange={({ valueAsTimestamp }) => {\n const newCurrent = new Date(valueAsTimestamp!);\n newCurrent.setUTCDate(current.getUTCDate());\n setCurrent(newCurrent);\n }}\n min={min}\n max={max}\n />\n <ScreenReaderOnly aria-live='polite' role='alert'>\n {current.toLocaleString(locale, { month: 'long', year: 'numeric', timeZone: 'UTC' })}\n </ScreenReaderOnly>\n <Button\n variant='simple'\n icon\n onClick={() => {\n const newCurrent = new Date(current);\n newCurrent.setUTCMonth(newCurrent.getUTCMonth() + 1);\n setCurrent(newCurrent);\n }}\n aria-label={t('picker_next_month')}\n >\n <Icon name={`caret-${end}`} />\n </Button>\n </Flex>\n <Flex container={{ wrap: 'nowrap' }} dir='ltr'>\n <Calendar\n ref={calendarRef}\n selected={selected && isValidDate(selected) ? selected : undefined}\n current={current}\n calendarType={mode === 'date' ? calendarType : CALENDAR_TYPES.ISO_8601}\n showWeekNumber={showWeekNumber}\n mode={mode}\n onFocus={date => {\n setCurrent(date);\n }}\n onSelect={date => {\n setCurrent(date);\n setSelected(date);\n onChange?.(date);\n }}\n min={min}\n max={max}\n />\n </Flex>\n </StyledDatePicker>\n );\n};\n\nDatePicker.defaultProps = defaultProps;\n\nexport default DatePicker;\n"]}
@@ -0,0 +1,3 @@
1
+ export declare const StyledMonthPicker: import("styled-components").StyledComponent<"fieldset", import("styled-components").DefaultTheme, {}, never>;
2
+ export declare const StyledDatePicker: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
+ //# sourceMappingURL=DatePicker.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DatePicker.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB,8GA4B5B,CAAC;AAIH,eAAO,MAAM,gBAAgB,yGAkB3B,CAAC"}
@@ -0,0 +1,39 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { defaultThemeProp } from '../../../theme';
3
+ import { StyledButton } from '../../Button';
4
+ import { StyledSelect } from '../../Select/Select';
5
+ export const StyledMonthPicker = styled.fieldset(props => {
6
+ const { theme: { base: { spacing, 'border-radius': baseBorderRadius, palette: { 'foreground-color': color } }, components: { 'form-control': formControl } } } = props;
7
+ return css `
8
+ margin: calc(2 * ${spacing}) calc(0.5 * ${spacing});
9
+ font-size: 0.875rem;
10
+ border: none;
11
+
12
+ ${StyledSelect} {
13
+ border-radius: calc(${baseBorderRadius} * ${formControl['border-radius']});
14
+ }
15
+
16
+ ${StyledButton} {
17
+ border-radius: calc(${baseBorderRadius} * ${formControl['border-radius']});
18
+ border: 0;
19
+ &:enabled {
20
+ color: ${color};
21
+ }
22
+ }
23
+ `;
24
+ });
25
+ StyledMonthPicker.defaultProps = defaultThemeProp;
26
+ export const StyledDatePicker = styled.div(props => {
27
+ const { theme: { base: { spacing }, components: { 'form-control': { 'foreground-color': foreground } } } } = props;
28
+ return css `
29
+ width: max-content;
30
+
31
+ ${StyledButton} {
32
+ border: transparent;
33
+ color: ${foreground};
34
+ }
35
+ padding: 0 ${spacing} ${spacing} ${spacing};
36
+ `;
37
+ });
38
+ StyledDatePicker.defaultProps = defaultThemeProp;
39
+ //# sourceMappingURL=DatePicker.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker.styles.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DatePicker.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;IACvD,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,OAAO,EACP,eAAe,EAAE,gBAAgB,EACjC,OAAO,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,EACvC,EACD,UAAU,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,EAC5C,EACF,GAAG,KAAK,CAAC;IACV,OAAO,GAAG,CAAA;uBACW,OAAO,gBAAgB,OAAO;;;;MAI/C,YAAY;4BACU,gBAAgB,MAAM,WAAW,CAAC,eAAe,CAAC;;;MAGxE,YAAY;4BACU,gBAAgB,MAAM,WAAW,CAAC,eAAe,CAAC;;;iBAG7D,KAAK;;;GAGnB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IACjD,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,OAAO,EAAE,EACjB,UAAU,EAAE,EACV,cAAc,EAAE,EAAE,kBAAkB,EAAE,UAAU,EAAE,EACnD,EACF,EACF,GAAG,KAAK,CAAC;IACV,OAAO,GAAG,CAAA;;;MAGN,YAAY;;eAEH,UAAU;;iBAER,OAAO,IAAI,OAAO,IAAI,OAAO;GAC3C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { StyledButton } from '../../Button';\nimport { StyledSelect } from '../../Select/Select';\n\nexport const StyledMonthPicker = styled.fieldset(props => {\n const {\n theme: {\n base: {\n spacing,\n 'border-radius': baseBorderRadius,\n palette: { 'foreground-color': color }\n },\n components: { 'form-control': formControl }\n }\n } = props;\n return css`\n margin: calc(2 * ${spacing}) calc(0.5 * ${spacing});\n font-size: 0.875rem;\n border: none;\n\n ${StyledSelect} {\n border-radius: calc(${baseBorderRadius} * ${formControl['border-radius']});\n }\n\n ${StyledButton} {\n border-radius: calc(${baseBorderRadius} * ${formControl['border-radius']});\n border: 0;\n &:enabled {\n color: ${color};\n }\n }\n `;\n});\n\nStyledMonthPicker.defaultProps = defaultThemeProp;\n\nexport const StyledDatePicker = styled.div(props => {\n const {\n theme: {\n base: { spacing },\n components: {\n 'form-control': { 'foreground-color': foreground }\n }\n }\n } = props;\n return css`\n width: max-content;\n\n ${StyledButton} {\n border: transparent;\n color: ${foreground};\n }\n padding: 0 ${spacing} ${spacing} ${spacing};\n `;\n});\n\nStyledDatePicker.defaultProps = defaultThemeProp;\n"]}
@@ -10,7 +10,7 @@ import { useConfiguration, useI18n } from '../../../hooks';
10
10
  import { getCalendarTypeFromLocale, toUTCDateString } from '../Input/utils';
11
11
  import Calendar from './Calendar';
12
12
  import Weeks from './Weeks';
13
- import { StyledDatePicker, StyledMonthPicker } from './Calendar.styles';
13
+ import { StyledDatePicker, StyledMonthPicker } from './DatePicker.styles';
14
14
  import { isValidDate } from './utils';
15
15
  registerIcon(caretLeftIcon, caretRightIcon);
16
16
  function toDateString(date) {
@@ -1 +1 @@
1
- {"version":3,"file":"DateRangePicker.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DateRangePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,aAAa,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE5E,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,YAAY,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AAO5C,SAAS,YAAY,CAAC,IAAsB;IAC1C,OAAO,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC;AAED,MAAM,eAAe,GAA4C,CAAC,KAA2B,EAAE,EAAE;IAC/F,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAA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c,IAAI,KAAC,KAAK,IAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,SAAG,EACnF,KAAC,QAAQ,IACP,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAClE,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,aAAa,QACb,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,IAAI,CAAC,EAAE;4BACd,UAAU,CAAC,IAAI,CAAC,CAAC;wBACnB,CAAC,EACD,QAAQ,EAAE,IAAI,CAAC,EAAE;4BACf,UAAU,CAAC,IAAI,CAAC,CAAC;4BACjB,WAAW,CAAC,IAAI,CAAC,CAAC;4BAClB,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;wBACnB,CAAC,EACD,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,GACR,IACG,IACU,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { FunctionComponent, useState, useEffect, useRef } from 'react';\n\nimport Flex from '../../Flex';\nimport MonthInput from '../Input/MonthInput';\nimport Button from '../../Button';\nimport Icon, { registerIcon } from '../../Icon';\nimport * as caretLeftIcon from '../../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../../Icon/icons/caret-right.icon';\nimport { useConfiguration, useI18n } from '../../../hooks';\nimport { getCalendarTypeFromLocale, toUTCDateString } from '../Input/utils';\n\nimport Calendar from './Calendar';\nimport DatePickerProps from './DatePicker.types';\nimport Weeks from './Weeks';\nimport { StyledDatePicker, StyledMonthPicker } from './Calendar.styles';\nimport { isValidDate } from './utils';\n\nregisterIcon(caretLeftIcon, caretRightIcon);\n\nexport interface DateRangePickerProps extends DatePickerProps {\n /** Defines dates range that can be set by the user. */\n selectedRange?: { startDate: Date | undefined; endDate: Date | undefined };\n}\n\nfunction toDateString(date: Date | undefined) {\n return date ? toUTCDateString(date) : undefined;\n}\n\nconst DateRangePicker: FunctionComponent<DateRangePickerProps> = (props: DateRangePickerProps) => {\n const { locale } = useConfiguration();\n const {\n selected: initial,\n selectedRange,\n onChange,\n min,\n max,\n mode,\n showWeekNumber,\n ...restProps\n } = props;\n\n const [selected, setSelected] = useState(initial);\n const [current, setCurrent] = useState(selected && isValidDate(selected) ? selected : new Date());\n\n useEffect(() => {\n if (toDateString(initial) !== toDateString(selected)) {\n setSelected(initial);\n setCurrent(initial || new Date());\n }\n }, [toDateString(initial)]);\n\n const calendarRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n // need to postpone focusing to make sure onFocusWithin has been attached\n setTimeout(() => {\n calendarRef.current?.querySelector<HTMLElement>('button[tabindex=\"0\"]:enabled')?.focus();\n });\n }, []);\n\n const calendarType = getCalendarTypeFromLocale(locale);\n const t = useI18n();\n\n return (\n <StyledDatePicker aria-label={t('calendar')} role='region' {...restProps}>\n <Flex as={StyledMonthPicker} container={{ justify: 'between', alignItems: 'center' }}>\n <Button\n variant='simple'\n icon\n onClick={() => {\n const newCurrent = new Date(current);\n newCurrent.setUTCMonth(newCurrent.getUTCMonth() - 1);\n setCurrent(newCurrent);\n }}\n aria-label={t('picker_prev_month')}\n >\n <Icon name='caret-left' />\n </Button>\n <MonthInput\n value={current}\n required\n role='group'\n aria-label={t('picker_jump_to_month_and_year')}\n onChange={({ valueAsTimestamp }) => {\n const newCurrent = new Date(valueAsTimestamp!);\n newCurrent.setUTCDate(current.getUTCDate());\n setCurrent(newCurrent);\n }}\n min={min}\n max={max}\n />\n <Button\n variant='simple'\n icon\n onClick={() => {\n const newCurrent = new Date(current);\n newCurrent.setUTCMonth(newCurrent.getUTCMonth() + 1);\n setCurrent(newCurrent);\n }}\n aria-label={t('picker_next_month')}\n >\n <Icon name='caret-right' />\n </Button>\n </Flex>\n <Flex container={{ wrap: 'nowrap' }}>\n {showWeekNumber && <Weeks current={current} calendarType={calendarType} disabled />}\n <Calendar\n ref={calendarRef}\n selected={selected && isValidDate(selected) ? selected : undefined}\n current={current}\n selectedRange={selectedRange}\n showHighlight\n calendarType={calendarType}\n onFocus={date => {\n setCurrent(date);\n }}\n onSelect={date => {\n setCurrent(date);\n setSelected(date);\n onChange?.(date);\n }}\n min={min}\n max={max}\n />\n </Flex>\n </StyledDatePicker>\n );\n};\n\nexport default DateRangePicker;\n"]}
1
+ {"version":3,"file":"DateRangePicker.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DateRangePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,aAAa,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE5E,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,YAAY,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AAO5C,SAAS,YAAY,CAAC,IAAsB;IAC1C,OAAO,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC;AAED,MAAM,eAAe,GAA4C,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ACJ,EACP,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,aAChC,cAAc,IAAI,KAAC,KAAK,IAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,SAAG,EACnF,KAAC,QAAQ,IACP,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAClE,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,aAAa,QACb,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,IAAI,CAAC,EAAE;4BACd,UAAU,CAAC,IAAI,CAAC,CAAC;wBACnB,CAAC,EACD,QAAQ,EAAE,IAAI,CAAC,EAAE;4BACf,UAAU,CAAC,IAAI,CAAC,CAAC;4BACjB,WAAW,CAAC,IAAI,CAAC,CAAC;4BAClB,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;wBACnB,CAAC,EACD,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,GACR,IACG,IACU,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { FunctionComponent, useState, useEffect, useRef } from 'react';\n\nimport Flex from '../../Flex';\nimport MonthInput from '../Input/MonthInput';\nimport Button from '../../Button';\nimport Icon, { registerIcon } from '../../Icon';\nimport * as caretLeftIcon from '../../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../../Icon/icons/caret-right.icon';\nimport { useConfiguration, useI18n } from '../../../hooks';\nimport { getCalendarTypeFromLocale, toUTCDateString } from '../Input/utils';\n\nimport Calendar from './Calendar';\nimport DatePickerProps from './DatePicker.types';\nimport Weeks from './Weeks';\nimport { StyledDatePicker, StyledMonthPicker } from './DatePicker.styles';\nimport { isValidDate } from './utils';\n\nregisterIcon(caretLeftIcon, caretRightIcon);\n\nexport interface DateRangePickerProps extends DatePickerProps {\n /** Defines dates range that can be set by the user. */\n selectedRange?: { startDate: Date | undefined; endDate: Date | undefined };\n}\n\nfunction toDateString(date: Date | undefined) {\n return date ? toUTCDateString(date) : undefined;\n}\n\nconst DateRangePicker: FunctionComponent<DateRangePickerProps> = (props: DateRangePickerProps) => {\n const { locale } = useConfiguration();\n const {\n selected: initial,\n selectedRange,\n onChange,\n min,\n max,\n mode,\n showWeekNumber,\n ...restProps\n } = props;\n\n const [selected, setSelected] = useState(initial);\n const [current, setCurrent] = useState(selected && isValidDate(selected) ? selected : new Date());\n\n useEffect(() => {\n if (toDateString(initial) !== toDateString(selected)) {\n setSelected(initial);\n setCurrent(initial || new Date());\n }\n }, [toDateString(initial)]);\n\n const calendarRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n // need to postpone focusing to make sure onFocusWithin has been attached\n setTimeout(() => {\n calendarRef.current?.querySelector<HTMLElement>('button[tabindex=\"0\"]:enabled')?.focus();\n });\n }, []);\n\n const calendarType = getCalendarTypeFromLocale(locale);\n const t = useI18n();\n\n return (\n <StyledDatePicker aria-label={t('calendar')} role='region' {...restProps}>\n <Flex as={StyledMonthPicker} container={{ justify: 'between', alignItems: 'center' }}>\n <Button\n variant='simple'\n icon\n onClick={() => {\n const newCurrent = new Date(current);\n newCurrent.setUTCMonth(newCurrent.getUTCMonth() - 1);\n setCurrent(newCurrent);\n }}\n aria-label={t('picker_prev_month')}\n >\n <Icon name='caret-left' />\n </Button>\n <MonthInput\n value={current}\n required\n role='group'\n aria-label={t('picker_jump_to_month_and_year')}\n onChange={({ valueAsTimestamp }) => {\n const newCurrent = new Date(valueAsTimestamp!);\n newCurrent.setUTCDate(current.getUTCDate());\n setCurrent(newCurrent);\n }}\n min={min}\n max={max}\n />\n <Button\n variant='simple'\n icon\n onClick={() => {\n const newCurrent = new Date(current);\n newCurrent.setUTCMonth(newCurrent.getUTCMonth() + 1);\n setCurrent(newCurrent);\n }}\n aria-label={t('picker_next_month')}\n >\n <Icon name='caret-right' />\n </Button>\n </Flex>\n <Flex container={{ wrap: 'nowrap' }}>\n {showWeekNumber && <Weeks current={current} calendarType={calendarType} disabled />}\n <Calendar\n ref={calendarRef}\n selected={selected && isValidDate(selected) ? selected : undefined}\n current={current}\n selectedRange={selectedRange}\n showHighlight\n calendarType={calendarType}\n onFocus={date => {\n setCurrent(date);\n }}\n onSelect={date => {\n setCurrent(date);\n setSelected(date);\n onChange?.(date);\n }}\n min={min}\n max={max}\n />\n </Flex>\n </StyledDatePicker>\n );\n};\n\nexport default DateRangePicker;\n"]}
@@ -9,7 +9,7 @@ export interface TimePickerProps extends BaseProps {
9
9
  */
10
10
  selected?: Date;
11
11
  /** Callback fired when selected value changes. */
12
- onSelect?: (date: Date) => void;
12
+ onSelect: (date: Date) => void;
13
13
  /**
14
14
  * Defines interval for time picker options (in minutes).
15
15
  * @default 30
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/TimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAkC,MAAM,OAAO,CAAC;AAI1E,OAAO,EAAE,SAAS,EAAU,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAoB,MAAM,gBAAgB,CAAC;AAI/D,oBAAY,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE1C,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD;;;OAGG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAqDD,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,GAAG,YAAY,CA6FjE,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/TimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAkC,MAAM,OAAO,CAAC;AAI1E,OAAO,EAAE,SAAS,EAAU,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAoB,MAAM,gBAAgB,CAAC;AAI/D,oBAAY,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE1C,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD;;;OAGG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,kDAAkD;IAClD,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAqDD,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,GAAG,YAAY,CAqGjE,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -89,24 +89,29 @@ const TimePicker = (props) => {
89
89
  return;
90
90
  const focusableElements = Array.from(focusEl.querySelectorAll('button'));
91
91
  if (focusableElements.length > 0) {
92
- if (!selected)
93
- focusableElements[0].tabIndex = 0;
92
+ let isChecked = false;
94
93
  focusableElements.slice(1).forEach(item => {
95
94
  const checked = item.checked;
96
- if (checked)
95
+ if (checked) {
96
+ isChecked = true;
97
97
  item.tabIndex = 0;
98
+ }
98
99
  else
99
100
  item.tabIndex = -1;
100
101
  });
102
+ if (!isChecked) {
103
+ focusableElements[0].tabIndex = 0;
104
+ focusableElements[0].focus();
105
+ }
101
106
  }
102
107
  }, [selected]);
103
108
  useEffect(() => {
104
109
  buttonEl?.focus();
105
110
  setTabIndexes();
106
111
  }, [buttonEl]);
107
- return (_jsx(StyledTimePicker, { role: 'menu', tabIndex: 0, ref: menuRef, ...restProps, children: actionsList.map(({ text, id }) => {
112
+ return (_jsx(StyledTimePicker, { role: 'menu', tabIndex: -1, ref: menuRef, ...restProps, children: actionsList.map(({ text, id }) => {
108
113
  const item = new Date(Number(id));
109
- return (_jsx(StyledTimeItem, { role: 'presentation', children: _jsx(StyledTimeButton, { role: 'menuitem', as: Button, variant: 'simple', ref: isSelected(item) ? setButtonEl : null, "aria-label": text, selected: isSelected(item), checked: isSelected(item), onClick: () => {
114
+ return (_jsx(StyledTimeItem, { role: 'presentation', children: _jsx(StyledTimeButton, { role: 'menuitem', as: Button, variant: 'simple', ref: isSelected(item) ? setButtonEl : null, "aria-label": text, selected: isSelected(item), "aria-current": isSelected(item) ? 'time' : undefined, checked: isSelected(item), onClick: () => {
110
115
  onSelect?.(item);
111
116
  }, tabIndex: '-1', children: renderTime(text) }) }, id));
112
117
  }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/TimePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAe,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAuB/C,MAAM,gBAAgB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;CAKjC,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAiB;;;;;;;;;;;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AC1B,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,EACzB,OAAO,EAAE,GAAG,EAAE;wBACZ,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC,EACD,QAAQ,EAAC,IAAI,YAEZ,UAAU,CAAC,IAAI,CAAC,GACA,IAfoB,EAAE,CAgB1B,CAClB,CAAC;QACJ,CAAC,CAAC,GACe,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { FunctionComponent, useCallback, useEffect, useRef } from 'react';\nimport styled from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { BaseProps, Action, ForwardProps } from '../../../types';\nimport Button from '../../Button';\nimport { useArrows, useConfiguration, useElement } from '../../../hooks';\nimport { ClockFormat, is12HClockFormat } from '../Input/utils';\n\nimport { getIntervalGenerator } from './utils';\n\nexport type MinuteInterval = 15 | 30 | 60;\n\nexport interface TimePickerProps extends BaseProps {\n /**\n * Defines default time that will be selected when the Time Picker is opened.\n * @default new Date()\n */\n selected?: Date;\n /** Callback fired when selected value changes. */\n onSelect?: (date: Date) => void;\n /**\n * Defines interval for time picker options (in minutes).\n * @default 30\n */\n interval?: MinuteInterval;\n /**\n * Defines clock format that overrides locale based format\n */\n clockFormat?: ClockFormat;\n}\n\nconst StyledTimePicker = styled.ul`\n list-style: none;\n max-height: 10rem;\n overflow: auto;\n width: 100%;\n`;\n\nStyledTimePicker.defaultProps = defaultThemeProp;\n\nconst StyledTimeButton = styled.button<TimePickerProps>`\n color: black;\n width: 100%;\n border-radius: inherit;\n overflow: hidden;\n text-align: start;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-width: 0;\n justify-content: start;\n padding: 0;\n background-color: ${props =>\n props.selected ? props.theme.base.colors.blue['extra-light'] : 'transparent'};\n\n > span {\n margin-inline-end: 0.125rem;\n &:first-child {\n margin-inline-start: ${({ theme }) => theme.components['form-control']['border-width']};\n }\n &:nth-child(2) {\n margin-inline-start: 0.125rem;\n }\n &:first-child,\n &:nth-child(3) {\n padding-inline-start: 0.5rem;\n }\n }\n\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: inset ${props => props.theme.base.shadow.focus};\n }\n`;\n\nStyledTimeButton.defaultProps = defaultThemeProp;\n\nconst StyledTimeItem = styled.li`\n border-radius: 0;\n`;\n\nStyledTimeItem.defaultProps = defaultThemeProp;\n\nconst TimePicker: FunctionComponent<TimePickerProps & ForwardProps> = (props: TimePickerProps) => {\n const { locale } = useConfiguration();\n const { selected = new Date(0), interval = 30, clockFormat, onSelect, ...restProps } = props;\n\n const intervalInMS = interval * 60000;\n\n const actionsList = Array.from(getIntervalGenerator(intervalInMS), time => {\n const date = new Date(selected);\n date.setUTCHours(time.getUTCHours(), time.getUTCMinutes());\n return {\n id: date.getTime().toString(),\n text: Intl.DateTimeFormat(locale, {\n hour: '2-digit',\n minute: '2-digit',\n timeZone: 'UTC',\n hour12: clockFormat ? clockFormat === 12 : is12HClockFormat(locale)\n }).format(date)\n };\n });\n\n const isSelected = (date: Date) => {\n return (\n selected?.getUTCHours() === date.getUTCHours() &&\n selected?.getUTCMinutes() === date.getUTCMinutes()\n );\n };\n\n const [buttonEl, setButtonEl] = useElement<HTMLElement>();\n const menuRef = useRef<HTMLUListElement>(null);\n\n useArrows(menuRef, {\n selector: 'button',\n cycle: true,\n dir: 'up-down',\n allowTabFocus: false\n });\n\n const renderTime = (text: string) => {\n const [hour, minute, meridiem] = text.split(/:| /);\n return (\n <>\n <span>{hour}</span>:<span>{minute}</span>\n {meridiem && <span>{meridiem}</span>}\n </>\n );\n };\n\n const setTabIndexes = useCallback(() => {\n const focusEl = menuRef.current;\n if (!focusEl) return;\n const focusableElements = Array.from(focusEl.querySelectorAll('button'));\n\n if (focusableElements.length > 0) {\n if (!selected) (focusableElements[0] as HTMLElement).tabIndex = 0;\n focusableElements.slice(1).forEach(item => {\n const checked = (item as HTMLInputElement).checked;\n if (checked) item.tabIndex = 0;\n else item.tabIndex = -1;\n });\n }\n }, [selected]);\n\n useEffect(() => {\n buttonEl?.focus();\n setTabIndexes();\n }, [buttonEl]);\n\n return (\n <StyledTimePicker role='menu' tabIndex={0} ref={menuRef} {...restProps}>\n {actionsList.map(({ text, id }: Action) => {\n const item = new Date(Number(id));\n return (\n <StyledTimeItem role='presentation' key={id}>\n <StyledTimeButton\n role='menuitem'\n as={Button}\n variant='simple'\n ref={isSelected(item) ? setButtonEl : null}\n aria-label={text}\n selected={isSelected(item)}\n checked={isSelected(item)}\n onClick={() => {\n onSelect?.(item);\n }}\n tabIndex='-1'\n >\n {renderTime(text)}\n </StyledTimeButton>\n </StyledTimeItem>\n );\n })}\n </StyledTimePicker>\n );\n};\n\nexport default TimePicker;\n"]}
1
+ {"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/TimePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAe,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAuB/C,MAAM,gBAAgB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;CAKjC,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAiB;;;;;;;;;;;sBAWjC,KAAK,CAAC,EAAE,CAC1B,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,I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EAAE,UAAU,CAAC,IAAI,CAAC,kBACZ,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACnD,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,EACzB,OAAO,EAAE,GAAG,EAAE;wBACZ,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC,EACD,QAAQ,EAAC,IAAI,YAEZ,UAAU,CAAC,IAAI,CAAC,GACA,IAhBoB,EAAE,CAiB1B,CAClB,CAAC;QACJ,CAAC,CAAC,GACe,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { FunctionComponent, useCallback, useEffect, useRef } from 'react';\nimport styled from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { BaseProps, Action, ForwardProps } from '../../../types';\nimport Button from '../../Button';\nimport { useArrows, useConfiguration, useElement } from '../../../hooks';\nimport { ClockFormat, is12HClockFormat } from '../Input/utils';\n\nimport { getIntervalGenerator } from './utils';\n\nexport type MinuteInterval = 15 | 30 | 60;\n\nexport interface TimePickerProps extends BaseProps {\n /**\n * Defines default time that will be selected when the Time Picker is opened.\n * @default new Date()\n */\n selected?: Date;\n /** Callback fired when selected value changes. */\n onSelect: (date: Date) => void;\n /**\n * Defines interval for time picker options (in minutes).\n * @default 30\n */\n interval?: MinuteInterval;\n /**\n * Defines clock format that overrides locale based format\n */\n clockFormat?: ClockFormat;\n}\n\nconst StyledTimePicker = styled.ul`\n list-style: none;\n max-height: 10rem;\n overflow: auto;\n width: 100%;\n`;\n\nStyledTimePicker.defaultProps = defaultThemeProp;\n\nconst StyledTimeButton = styled.button<TimePickerProps>`\n color: black;\n width: 100%;\n border-radius: inherit;\n overflow: hidden;\n text-align: start;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-width: 0;\n justify-content: start;\n padding: 0;\n background-color: ${props =>\n props.selected ? props.theme.base.colors.blue['extra-light'] : 'transparent'};\n\n > span {\n margin-inline-end: 0.125rem;\n &:first-child {\n margin-inline-start: ${({ theme }) => theme.components['form-control']['border-width']};\n }\n &:nth-child(2) {\n margin-inline-start: 0.125rem;\n }\n &:first-child,\n &:nth-child(3) {\n padding-inline-start: 0.5rem;\n }\n }\n\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: inset ${props => props.theme.base.shadow.focus};\n }\n`;\n\nStyledTimeButton.defaultProps = defaultThemeProp;\n\nconst StyledTimeItem = styled.li`\n border-radius: 0;\n`;\n\nStyledTimeItem.defaultProps = defaultThemeProp;\n\nconst TimePicker: FunctionComponent<TimePickerProps & ForwardProps> = (props: TimePickerProps) => {\n const { locale } = useConfiguration();\n const { selected = new Date(0), interval = 30, clockFormat, onSelect, ...restProps } = props;\n\n const intervalInMS = interval * 60000;\n\n const actionsList = Array.from(getIntervalGenerator(intervalInMS), time => {\n const date = new Date(selected);\n date.setUTCHours(time.getUTCHours(), time.getUTCMinutes());\n return {\n id: date.getTime().toString(),\n text: Intl.DateTimeFormat(locale, {\n hour: '2-digit',\n minute: '2-digit',\n timeZone: 'UTC',\n hour12: clockFormat ? clockFormat === 12 : is12HClockFormat(locale)\n }).format(date)\n };\n });\n\n const isSelected = (date: Date) => {\n return (\n selected?.getUTCHours() === date.getUTCHours() &&\n selected?.getUTCMinutes() === date.getUTCMinutes()\n );\n };\n\n const [buttonEl, setButtonEl] = useElement<HTMLElement>();\n const menuRef = useRef<HTMLUListElement>(null);\n\n useArrows(menuRef, {\n selector: 'button',\n cycle: true,\n dir: 'up-down',\n allowTabFocus: false\n });\n\n const renderTime = (text: string) => {\n const [hour, minute, meridiem] = text.split(/:| /);\n return (\n <>\n <span>{hour}</span>:<span>{minute}</span>\n {meridiem && <span>{meridiem}</span>}\n </>\n );\n };\n\n const setTabIndexes = useCallback(() => {\n const focusEl = menuRef.current;\n if (!focusEl) return;\n const focusableElements = Array.from(focusEl.querySelectorAll('button'));\n\n if (focusableElements.length > 0) {\n let isChecked = false;\n focusableElements.slice(1).forEach(item => {\n const checked = (item as HTMLInputElement).checked;\n if (checked) {\n isChecked = true;\n item.tabIndex = 0;\n } else item.tabIndex = -1;\n });\n\n if (!isChecked) {\n (focusableElements[0] as HTMLElement).tabIndex = 0;\n focusableElements[0].focus();\n }\n }\n }, [selected]);\n\n useEffect(() => {\n buttonEl?.focus();\n setTabIndexes();\n }, [buttonEl]);\n\n return (\n <StyledTimePicker role='menu' tabIndex={-1} ref={menuRef} {...restProps}>\n {actionsList.map(({ text, id }: Action) => {\n const item = new Date(Number(id));\n return (\n <StyledTimeItem role='presentation' key={id}>\n <StyledTimeButton\n role='menuitem'\n as={Button}\n variant='simple'\n ref={isSelected(item) ? setButtonEl : null}\n aria-label={text}\n selected={isSelected(item)}\n aria-current={isSelected(item) ? 'time' : undefined}\n checked={isSelected(item)}\n onClick={() => {\n onSelect?.(item);\n }}\n tabIndex='-1'\n >\n {renderTime(text)}\n </StyledTimeButton>\n </StyledTimeItem>\n );\n })}\n </StyledTimePicker>\n );\n};\n\nexport default TimePicker;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Weeks.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Weeks.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EAOH,MAAM,OAAO,CAAC;AASf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAKrD,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,iDAAiD;IACjD,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,CAAC,IAAI,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