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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (810) hide show
  1. package/README.md +3 -3
  2. package/lib/components/Actions/Actions.js +1 -1
  3. package/lib/components/Actions/Actions.js.map +1 -1
  4. package/lib/components/AppShell/AppHeader.d.ts +2 -1
  5. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  6. package/lib/components/AppShell/AppHeader.js +4 -9
  7. package/lib/components/AppShell/AppHeader.js.map +1 -1
  8. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  9. package/lib/components/AppShell/AppShell.js +89 -62
  10. package/lib/components/AppShell/AppShell.js.map +1 -1
  11. package/lib/components/AppShell/AppShell.styles.d.ts +19 -16
  12. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppShell.styles.js +227 -173
  14. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  15. package/lib/components/AppShell/AppShell.types.d.ts +7 -7
  16. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  17. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  18. package/lib/components/AppShell/AppShellContext.d.ts +3 -0
  19. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  20. package/lib/components/AppShell/AppShellContext.js +3 -1
  21. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  22. package/lib/components/AppShell/AppShellList.d.ts +4 -3
  23. package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
  24. package/lib/components/AppShell/AppShellList.js +24 -19
  25. package/lib/components/AppShell/AppShellList.js.map +1 -1
  26. package/lib/components/AppShell/Drawer.d.ts.map +1 -1
  27. package/lib/components/AppShell/Drawer.js +7 -8
  28. package/lib/components/AppShell/Drawer.js.map +1 -1
  29. package/lib/components/AppShell/Operator.js +3 -5
  30. package/lib/components/AppShell/Operator.js.map +1 -1
  31. package/lib/components/AppShell/SkipNavigation.d.ts.map +1 -1
  32. package/lib/components/AppShell/SkipNavigation.js +30 -39
  33. package/lib/components/AppShell/SkipNavigation.js.map +1 -1
  34. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  35. package/lib/components/Avatar/Avatar.js +5 -4
  36. package/lib/components/Avatar/Avatar.js.map +1 -1
  37. package/lib/components/Backdrop/Backdrop.d.ts +1 -1
  38. package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
  39. package/lib/components/Backdrop/Backdrop.js +7 -6
  40. package/lib/components/Backdrop/Backdrop.js.map +1 -1
  41. package/lib/components/Badges/Alert.d.ts +2 -2
  42. package/lib/components/Badges/Alert.d.ts.map +1 -1
  43. package/lib/components/Badges/Alert.js +1 -1
  44. package/lib/components/Badges/Alert.js.map +1 -1
  45. package/lib/components/Badges/Count.js +1 -1
  46. package/lib/components/Badges/Count.js.map +1 -1
  47. package/lib/components/Badges/Selection.d.ts.map +1 -1
  48. package/lib/components/Badges/Selection.js +10 -9
  49. package/lib/components/Badges/Selection.js.map +1 -1
  50. package/lib/components/Badges/Status.d.ts +2 -2
  51. package/lib/components/Badges/Status.d.ts.map +1 -1
  52. package/lib/components/Badges/Status.js +1 -1
  53. package/lib/components/Badges/Status.js.map +1 -1
  54. package/lib/components/Badges/Tag.js +1 -1
  55. package/lib/components/Badges/Tag.js.map +1 -1
  56. package/lib/components/Banner/Banner.d.ts +2 -2
  57. package/lib/components/Banner/Banner.d.ts.map +1 -1
  58. package/lib/components/Banner/Banner.js +6 -8
  59. package/lib/components/Banner/Banner.js.map +1 -1
  60. package/lib/components/Boolean/BooleanDisplay.d.ts +2 -2
  61. package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
  62. package/lib/components/Boolean/BooleanDisplay.js +1 -2
  63. package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
  64. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
  65. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  66. package/lib/components/Breadcrumbs/Breadcrumbs.js +13 -11
  67. package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  68. package/lib/components/Button/BareButton.d.ts.map +1 -1
  69. package/lib/components/Button/BareButton.js +21 -2
  70. package/lib/components/Button/BareButton.js.map +1 -1
  71. package/lib/components/Button/BareRoleButton.d.ts +12 -0
  72. package/lib/components/Button/BareRoleButton.d.ts.map +1 -0
  73. package/lib/components/Button/BareRoleButton.js +20 -0
  74. package/lib/components/Button/BareRoleButton.js.map +1 -0
  75. package/lib/components/Button/Button.d.ts +5 -0
  76. package/lib/components/Button/Button.d.ts.map +1 -1
  77. package/lib/components/Button/Button.js +34 -10
  78. package/lib/components/Button/Button.js.map +1 -1
  79. package/lib/components/Card/Card.d.ts.map +1 -1
  80. package/lib/components/Card/Card.js +3 -2
  81. package/lib/components/Card/Card.js.map +1 -1
  82. package/lib/components/Card/CardContent.d.ts.map +1 -1
  83. package/lib/components/Card/CardContent.js +5 -4
  84. package/lib/components/Card/CardContent.js.map +1 -1
  85. package/lib/components/Card/CardFooter.d.ts.map +1 -1
  86. package/lib/components/Card/CardFooter.js +5 -4
  87. package/lib/components/Card/CardFooter.js.map +1 -1
  88. package/lib/components/Card/CardHeader.d.ts +3 -1
  89. package/lib/components/Card/CardHeader.d.ts.map +1 -1
  90. package/lib/components/Card/CardHeader.js +9 -7
  91. package/lib/components/Card/CardHeader.js.map +1 -1
  92. package/lib/components/Card/CardMedia.js +1 -1
  93. package/lib/components/Card/CardMedia.js.map +1 -1
  94. package/lib/components/Card/CollapsibleCard.d.ts.map +1 -1
  95. package/lib/components/Card/CollapsibleCard.js +5 -7
  96. package/lib/components/Card/CollapsibleCard.js.map +1 -1
  97. package/lib/components/Card/SelectableCard.js +1 -1
  98. package/lib/components/Card/SelectableCard.js.map +1 -1
  99. package/lib/components/Checkbox/Checkbox.d.ts +2 -2
  100. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  101. package/lib/components/Checkbox/Checkbox.js +1 -1
  102. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  103. package/lib/components/ColorPicker/ColorPicker.d.ts +2 -2
  104. package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  105. package/lib/components/ColorPicker/ColorPicker.js +8 -11
  106. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  107. package/lib/components/ComboBox/ComboBox.d.ts +1 -1
  108. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  109. package/lib/components/ComboBox/ComboBox.js +30 -33
  110. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  111. package/lib/components/ComboBox/ComboBox.types.d.ts +2 -1
  112. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  113. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  114. package/lib/components/ComboBox/ComboBoxInput.js +4 -4
  115. package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
  116. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  117. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +23 -29
  118. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  119. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
  120. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +16 -12
  121. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
  122. package/lib/components/Configuration/Configuration.js +11 -13
  123. package/lib/components/Configuration/Configuration.js.map +1 -1
  124. package/lib/components/Currency/CurrencyDisplay.d.ts +6 -2
  125. package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
  126. package/lib/components/Currency/CurrencyDisplay.js +11 -7
  127. package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
  128. package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
  129. package/lib/components/Currency/CurrencyInput.js +16 -16
  130. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  131. package/lib/components/Currency/CurrencyInput.types.d.ts +6 -2
  132. package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
  133. package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
  134. package/lib/components/Currency/utils.d.ts +12 -1
  135. package/lib/components/Currency/utils.d.ts.map +1 -1
  136. package/lib/components/Currency/utils.js +30 -2
  137. package/lib/components/Currency/utils.js.map +1 -1
  138. package/lib/components/DateTime/DateTime.types.d.ts +2 -1
  139. package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
  140. package/lib/components/DateTime/DateTime.types.js.map +1 -1
  141. package/lib/components/DateTime/DateTimeDisplay.d.ts +1 -1
  142. package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
  143. package/lib/components/DateTime/DateTimeDisplay.js +14 -3
  144. package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
  145. package/lib/components/DateTime/DurationDisplay.d.ts.map +1 -1
  146. package/lib/components/DateTime/DurationDisplay.js +11 -6
  147. package/lib/components/DateTime/DurationDisplay.js.map +1 -1
  148. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  149. package/lib/components/DateTime/Input/DateInput.js +25 -27
  150. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  151. package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
  152. package/lib/components/DateTime/Input/DateRangeInput.js +10 -16
  153. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  154. package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
  155. package/lib/components/DateTime/Input/DateTime.styles.js +14 -3
  156. package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
  157. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  158. package/lib/components/DateTime/Input/DateTimeInput.js +42 -42
  159. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  160. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +2 -0
  161. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
  162. package/lib/components/DateTime/Input/DayOfWeekInput.js +7 -5
  163. package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
  164. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
  165. package/lib/components/DateTime/Input/Duration/DurationInput.js +3 -3
  166. package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
  167. package/lib/components/DateTime/Input/Duration/NumberUnit.js +4 -5
  168. package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
  169. package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
  170. package/lib/components/DateTime/Input/Duration/Time.js +12 -15
  171. package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
  172. package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
  173. package/lib/components/DateTime/Input/MonthInput.js +12 -17
  174. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  175. package/lib/components/DateTime/Input/PartInput.js +3 -4
  176. package/lib/components/DateTime/Input/PartInput.js.map +1 -1
  177. package/lib/components/DateTime/Input/QuarterInput.d.ts +9 -0
  178. package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -0
  179. package/lib/components/DateTime/Input/QuarterInput.js +102 -0
  180. package/lib/components/DateTime/Input/QuarterInput.js.map +1 -0
  181. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  182. package/lib/components/DateTime/Input/TimeInput.js +26 -30
  183. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  184. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  185. package/lib/components/DateTime/Input/WeekInput.js +22 -23
  186. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  187. package/lib/components/DateTime/Input/useAutoFocusNextInput.d.ts.map +1 -1
  188. package/lib/components/DateTime/Input/useAutoFocusNextInput.js +8 -9
  189. package/lib/components/DateTime/Input/useAutoFocusNextInput.js.map +1 -1
  190. package/lib/components/DateTime/Input/usePickerButton.js +4 -4
  191. package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
  192. package/lib/components/DateTime/Input/utils.d.ts +7 -0
  193. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  194. package/lib/components/DateTime/Input/utils.js +52 -10
  195. package/lib/components/DateTime/Input/utils.js.map +1 -1
  196. package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
  197. package/lib/components/DateTime/Picker/Calendar.js +47 -72
  198. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  199. package/lib/components/DateTime/Picker/Calendar.styles.d.ts +2 -2
  200. package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
  201. package/lib/components/DateTime/Picker/Calendar.styles.js +16 -7
  202. package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
  203. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  204. package/lib/components/DateTime/Picker/DatePicker.js +13 -17
  205. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  206. package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
  207. package/lib/components/DateTime/Picker/DateRangePicker.js +13 -17
  208. package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
  209. package/lib/components/DateTime/Picker/TimePicker.js +9 -10
  210. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  211. package/lib/components/DateTime/Picker/Weeks.js +9 -11
  212. package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
  213. package/lib/components/DateTime/Picker/utils.d.ts +1 -0
  214. package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
  215. package/lib/components/DateTime/Picker/utils.js +3 -0
  216. package/lib/components/DateTime/Picker/utils.js.map +1 -1
  217. package/lib/components/DateTime/index.d.ts +2 -0
  218. package/lib/components/DateTime/index.d.ts.map +1 -1
  219. package/lib/components/DateTime/index.js +1 -0
  220. package/lib/components/DateTime/index.js.map +1 -1
  221. package/lib/components/Drawer/Drawer.js +6 -6
  222. package/lib/components/Drawer/Drawer.js.map +1 -1
  223. package/lib/components/Email/EmailDisplay.d.ts +2 -2
  224. package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
  225. package/lib/components/Email/EmailDisplay.js +2 -2
  226. package/lib/components/Email/EmailDisplay.js.map +1 -1
  227. package/lib/components/EmojiPicker/EmojiDisplay.d.ts.map +1 -1
  228. package/lib/components/EmojiPicker/EmojiDisplay.js +1 -1
  229. package/lib/components/EmojiPicker/EmojiDisplay.js.map +1 -1
  230. package/lib/components/EmojiPicker/EmojiPicker.js +3 -4
  231. package/lib/components/EmojiPicker/EmojiPicker.js.map +1 -1
  232. package/lib/components/EmptyState/EmptyState.d.ts +14 -0
  233. package/lib/components/EmptyState/EmptyState.d.ts.map +1 -0
  234. package/lib/components/{NoItems/NoItems.js → EmptyState/EmptyState.js} +11 -8
  235. package/lib/components/EmptyState/EmptyState.js.map +1 -0
  236. package/lib/components/EmptyState/index.d.ts +4 -0
  237. package/lib/components/EmptyState/index.d.ts.map +1 -0
  238. package/lib/components/EmptyState/index.js +3 -0
  239. package/lib/components/EmptyState/index.js.map +1 -0
  240. package/lib/components/ErrorState/ErrorState.d.ts +16 -0
  241. package/lib/components/ErrorState/ErrorState.d.ts.map +1 -0
  242. package/lib/components/ErrorState/ErrorState.js +31 -0
  243. package/lib/components/ErrorState/ErrorState.js.map +1 -0
  244. package/lib/components/ErrorState/index.d.ts +4 -0
  245. package/lib/components/ErrorState/index.d.ts.map +1 -0
  246. package/lib/components/ErrorState/index.js +3 -0
  247. package/lib/components/ErrorState/index.js.map +1 -0
  248. package/lib/components/ExpandCollapse/ExpandCollapse.js +5 -5
  249. package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
  250. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  251. package/lib/components/FieldGroup/FieldGroup.js +6 -7
  252. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  253. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  254. package/lib/components/FieldGroup/FieldGroupList.js +7 -6
  255. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  256. package/lib/components/FieldValueList/FieldValueList.d.ts +2 -2
  257. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  258. package/lib/components/FieldValueList/FieldValueList.js +5 -7
  259. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  260. package/lib/components/File/FileDisplay.d.ts +6 -3
  261. package/lib/components/File/FileDisplay.d.ts.map +1 -1
  262. package/lib/components/File/FileDisplay.js +7 -7
  263. package/lib/components/File/FileDisplay.js.map +1 -1
  264. package/lib/components/File/FileInput.d.ts +3 -3
  265. package/lib/components/File/FileInput.d.ts.map +1 -1
  266. package/lib/components/File/FileInput.js +18 -19
  267. package/lib/components/File/FileInput.js.map +1 -1
  268. package/lib/components/File/FileItem.d.ts +0 -2
  269. package/lib/components/File/FileItem.d.ts.map +1 -1
  270. package/lib/components/File/FileItem.js +3 -4
  271. package/lib/components/File/FileItem.js.map +1 -1
  272. package/lib/components/File/FileUploadItem.d.ts +4 -2
  273. package/lib/components/File/FileUploadItem.d.ts.map +1 -1
  274. package/lib/components/File/FileUploadItem.js +58 -20
  275. package/lib/components/File/FileUploadItem.js.map +1 -1
  276. package/lib/components/File/FileVisual.d.ts +7 -16
  277. package/lib/components/File/FileVisual.d.ts.map +1 -1
  278. package/lib/components/File/FileVisual.js +44 -47
  279. package/lib/components/File/FileVisual.js.map +1 -1
  280. package/lib/components/File/utils.js +2 -3
  281. package/lib/components/File/utils.js.map +1 -1
  282. package/lib/components/Flex/Flex.d.ts +17 -7
  283. package/lib/components/Flex/Flex.d.ts.map +1 -1
  284. package/lib/components/Flex/Flex.js +25 -9
  285. package/lib/components/Flex/Flex.js.map +1 -1
  286. package/lib/components/Form/Form.d.ts +7 -1
  287. package/lib/components/Form/Form.d.ts.map +1 -1
  288. package/lib/components/Form/Form.js +5 -4
  289. package/lib/components/Form/Form.js.map +1 -1
  290. package/lib/components/FormControl/FormControl.d.ts +1 -1
  291. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  292. package/lib/components/FormControl/FormControl.js +1 -1
  293. package/lib/components/FormControl/FormControl.js.map +1 -1
  294. package/lib/components/FormField/FormField.d.ts +5 -7
  295. package/lib/components/FormField/FormField.d.ts.map +1 -1
  296. package/lib/components/FormField/FormField.js +9 -19
  297. package/lib/components/FormField/FormField.js.map +1 -1
  298. package/lib/components/Grid/Grid.d.ts +1 -1
  299. package/lib/components/Grid/Grid.d.ts.map +1 -1
  300. package/lib/components/Grid/Grid.js +17 -21
  301. package/lib/components/Grid/Grid.js.map +1 -1
  302. package/lib/components/Icon/Icon.js +3 -5
  303. package/lib/components/Icon/Icon.js.map +1 -1
  304. package/lib/components/Icon/iconNames.d.ts +1 -1
  305. package/lib/components/Icon/iconNames.d.ts.map +1 -1
  306. package/lib/components/Icon/iconNames.js +2 -0
  307. package/lib/components/Icon/iconNames.js.map +1 -1
  308. package/lib/components/Icon/icons/compass-solid.icon.js +1 -2
  309. package/lib/components/Icon/icons/compass-solid.icon.js.map +1 -1
  310. package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js +1 -4
  311. package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js.map +1 -1
  312. package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js +1 -2
  313. package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js.map +1 -1
  314. package/lib/components/Icon/icons/dataviz-waterfall.icon.js +1 -5
  315. package/lib/components/Icon/icons/dataviz-waterfall.icon.js.map +1 -1
  316. package/lib/components/Icon/icons/dock.icon.d.ts +4 -0
  317. package/lib/components/Icon/icons/dock.icon.d.ts.map +1 -0
  318. package/lib/components/Icon/icons/dock.icon.js +6 -0
  319. package/lib/components/Icon/icons/dock.icon.js.map +1 -0
  320. package/lib/components/Icon/icons/filetype-text.icon.js +1 -4
  321. package/lib/components/Icon/icons/filetype-text.icon.js.map +1 -1
  322. package/lib/components/Icon/icons/folder-dollar.icon.js +1 -2
  323. package/lib/components/Icon/icons/folder-dollar.icon.js.map +1 -1
  324. package/lib/components/Icon/icons/freeze-column.icon.js +1 -2
  325. package/lib/components/Icon/icons/freeze-column.icon.js.map +1 -1
  326. package/lib/components/Icon/icons/galaxy.icon.js +1 -3
  327. package/lib/components/Icon/icons/galaxy.icon.js.map +1 -1
  328. package/lib/components/Icon/icons/grad-solid.icon.js +1 -2
  329. package/lib/components/Icon/icons/grad-solid.icon.js.map +1 -1
  330. package/lib/components/Icon/icons/grad.icon.js +1 -5
  331. package/lib/components/Icon/icons/grad.icon.js.map +1 -1
  332. package/lib/components/Icon/icons/list-number.icon.js +1 -6
  333. package/lib/components/Icon/icons/list-number.icon.js.map +1 -1
  334. package/lib/components/Icon/icons/list.icon.js +1 -6
  335. package/lib/components/Icon/icons/list.icon.js.map +1 -1
  336. package/lib/components/Icon/icons/pin.icon.js +1 -2
  337. package/lib/components/Icon/icons/pin.icon.js.map +1 -1
  338. package/lib/components/Icon/icons/search-solid.icon.js +1 -2
  339. package/lib/components/Icon/icons/search-solid.icon.js.map +1 -1
  340. package/lib/components/Icon/icons/tracer.icon.js +1 -2
  341. package/lib/components/Icon/icons/tracer.icon.js.map +1 -1
  342. package/lib/components/Icon/icons/tribox-solid.icon.js +1 -3
  343. package/lib/components/Icon/icons/tribox-solid.icon.js.map +1 -1
  344. package/lib/components/Icon/icons/tribox.icon.js +1 -3
  345. package/lib/components/Icon/icons/tribox.icon.js.map +1 -1
  346. package/lib/components/Icon/icons/undock.icon.d.ts +4 -0
  347. package/lib/components/Icon/icons/undock.icon.d.ts.map +1 -0
  348. package/lib/components/Icon/icons/undock.icon.js +6 -0
  349. package/lib/components/Icon/icons/undock.icon.js.map +1 -0
  350. package/lib/components/Image/Image.js +1 -1
  351. package/lib/components/Image/Image.js.map +1 -1
  352. package/lib/components/Image/index.d.ts +1 -1
  353. package/lib/components/Image/index.d.ts.map +1 -1
  354. package/lib/components/Image/index.js +1 -0
  355. package/lib/components/Image/index.js.map +1 -1
  356. package/lib/components/Input/Input.d.ts +2 -2
  357. package/lib/components/Input/Input.d.ts.map +1 -1
  358. package/lib/components/Input/Input.js +13 -13
  359. package/lib/components/Input/Input.js.map +1 -1
  360. package/lib/components/Input/Input.styles.js +2 -2
  361. package/lib/components/Input/Input.styles.js.map +1 -1
  362. package/lib/components/Label/Label.js +1 -1
  363. package/lib/components/Label/Label.js.map +1 -1
  364. package/lib/components/Lightbox/Lightbox.d.ts +6 -0
  365. package/lib/components/Lightbox/Lightbox.d.ts.map +1 -0
  366. package/lib/components/Lightbox/Lightbox.js +129 -0
  367. package/lib/components/Lightbox/Lightbox.js.map +1 -0
  368. package/lib/components/Lightbox/Lightbox.styles.d.ts +11 -0
  369. package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -0
  370. package/lib/components/Lightbox/Lightbox.styles.js +166 -0
  371. package/lib/components/Lightbox/Lightbox.styles.js.map +1 -0
  372. package/lib/components/Lightbox/Lightbox.types.d.ts +42 -0
  373. package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -0
  374. package/lib/components/Lightbox/Lightbox.types.js +2 -0
  375. package/lib/components/Lightbox/Lightbox.types.js.map +1 -0
  376. package/lib/components/Lightbox/index.d.ts +3 -0
  377. package/lib/components/Lightbox/index.d.ts.map +1 -0
  378. package/lib/components/Lightbox/index.js +2 -0
  379. package/lib/components/Lightbox/index.js.map +1 -0
  380. package/lib/components/Link/Link.js +5 -8
  381. package/lib/components/Link/Link.js.map +1 -1
  382. package/lib/components/List/CommaSeparatedList.d.ts +15 -0
  383. package/lib/components/List/CommaSeparatedList.d.ts.map +1 -0
  384. package/lib/components/List/CommaSeparatedList.js +61 -0
  385. package/lib/components/List/CommaSeparatedList.js.map +1 -0
  386. package/lib/components/List/List.d.ts +30 -0
  387. package/lib/components/List/List.d.ts.map +1 -0
  388. package/lib/components/List/List.js +56 -0
  389. package/lib/components/List/List.js.map +1 -0
  390. package/lib/components/List/OrderedList.d.ts +6 -0
  391. package/lib/components/List/OrderedList.d.ts.map +1 -0
  392. package/lib/components/List/OrderedList.js +6 -0
  393. package/lib/components/List/OrderedList.js.map +1 -0
  394. package/lib/components/List/UnorderedList.d.ts +6 -0
  395. package/lib/components/List/UnorderedList.d.ts.map +1 -0
  396. package/lib/components/List/UnorderedList.js +6 -0
  397. package/lib/components/List/UnorderedList.js.map +1 -0
  398. package/lib/components/List/index.d.ts +5 -0
  399. package/lib/components/List/index.d.ts.map +1 -0
  400. package/lib/components/List/index.js +4 -0
  401. package/lib/components/List/index.js.map +1 -0
  402. package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
  403. package/lib/components/Location/CurrentLocationButton.js +7 -7
  404. package/lib/components/Location/CurrentLocationButton.js.map +1 -1
  405. package/lib/components/Location/Location.types.d.ts +2 -1
  406. package/lib/components/Location/Location.types.d.ts.map +1 -1
  407. package/lib/components/Location/Location.types.js.map +1 -1
  408. package/lib/components/Location/LocationDisplay.js +8 -9
  409. package/lib/components/Location/LocationDisplay.js.map +1 -1
  410. package/lib/components/Location/LocationInput.js +27 -28
  411. package/lib/components/Location/LocationInput.js.map +1 -1
  412. package/lib/components/Location/LocationView.js +8 -13
  413. package/lib/components/Location/LocationView.js.map +1 -1
  414. package/lib/components/Location/utils.js +11 -15
  415. package/lib/components/Location/utils.js.map +1 -1
  416. package/lib/components/Menu/FlyoutMenuList.d.ts.map +1 -1
  417. package/lib/components/Menu/FlyoutMenuList.js +12 -15
  418. package/lib/components/Menu/FlyoutMenuList.js.map +1 -1
  419. package/lib/components/Menu/Menu.context.d.ts.map +1 -1
  420. package/lib/components/Menu/Menu.context.js +2 -0
  421. package/lib/components/Menu/Menu.context.js.map +1 -1
  422. package/lib/components/Menu/Menu.d.ts.map +1 -1
  423. package/lib/components/Menu/Menu.js +89 -46
  424. package/lib/components/Menu/Menu.js.map +1 -1
  425. package/lib/components/Menu/Menu.styles.d.ts +11 -0
  426. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  427. package/lib/components/Menu/Menu.styles.js +202 -3
  428. package/lib/components/Menu/Menu.styles.js.map +1 -1
  429. package/lib/components/Menu/Menu.types.d.ts +30 -12
  430. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  431. package/lib/components/Menu/Menu.types.js.map +1 -1
  432. package/lib/components/Menu/MenuGroup.d.ts +6 -0
  433. package/lib/components/Menu/MenuGroup.d.ts.map +1 -0
  434. package/lib/components/Menu/MenuGroup.js +17 -0
  435. package/lib/components/Menu/MenuGroup.js.map +1 -0
  436. package/lib/components/Menu/MenuItem.d.ts +0 -3
  437. package/lib/components/Menu/MenuItem.d.ts.map +1 -1
  438. package/lib/components/Menu/MenuItem.js +57 -164
  439. package/lib/components/Menu/MenuItem.js.map +1 -1
  440. package/lib/components/Menu/MenuList.d.ts +1 -1
  441. package/lib/components/Menu/MenuList.d.ts.map +1 -1
  442. package/lib/components/Menu/MenuList.js +28 -30
  443. package/lib/components/Menu/MenuList.js.map +1 -1
  444. package/lib/components/Menu/MenuListHeader.d.ts +0 -1
  445. package/lib/components/Menu/MenuListHeader.d.ts.map +1 -1
  446. package/lib/components/Menu/MenuListHeader.js +7 -55
  447. package/lib/components/Menu/MenuListHeader.js.map +1 -1
  448. package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
  449. package/lib/components/Menu/NavItemsList.js +2 -3
  450. package/lib/components/Menu/NavItemsList.js.map +1 -1
  451. package/lib/components/Menu/helpers.d.ts +13 -12
  452. package/lib/components/Menu/helpers.d.ts.map +1 -1
  453. package/lib/components/Menu/helpers.js +40 -36
  454. package/lib/components/Menu/helpers.js.map +1 -1
  455. package/lib/components/Menu/index.d.ts +2 -3
  456. package/lib/components/Menu/index.d.ts.map +1 -1
  457. package/lib/components/Menu/index.js +1 -2
  458. package/lib/components/Menu/index.js.map +1 -1
  459. package/lib/components/MenuButton/MenuButton.d.ts +3 -1
  460. package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
  461. package/lib/components/MenuButton/MenuButton.js +13 -14
  462. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  463. package/lib/components/MetaList/MetaList.d.ts +13 -4
  464. package/lib/components/MetaList/MetaList.d.ts.map +1 -1
  465. package/lib/components/MetaList/MetaList.js +34 -20
  466. package/lib/components/MetaList/MetaList.js.map +1 -1
  467. package/lib/components/Modal/Contexts.d.ts.map +1 -1
  468. package/lib/components/Modal/Contexts.js +3 -0
  469. package/lib/components/Modal/Contexts.js.map +1 -1
  470. package/lib/components/Modal/DockedModals.d.ts.map +1 -1
  471. package/lib/components/Modal/DockedModals.js +5 -4
  472. package/lib/components/Modal/DockedModals.js.map +1 -1
  473. package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
  474. package/lib/components/Modal/MinimizedModal.js +53 -38
  475. package/lib/components/Modal/MinimizedModal.js.map +1 -1
  476. package/lib/components/Modal/Modal.d.ts +1 -6
  477. package/lib/components/Modal/Modal.d.ts.map +1 -1
  478. package/lib/components/Modal/Modal.js +82 -134
  479. package/lib/components/Modal/Modal.js.map +1 -1
  480. package/lib/components/Modal/Modal.styles.d.ts +9 -0
  481. package/lib/components/Modal/Modal.styles.d.ts.map +1 -0
  482. package/lib/components/Modal/Modal.styles.js +135 -0
  483. package/lib/components/Modal/Modal.styles.js.map +1 -0
  484. package/lib/components/Modal/Modal.types.d.ts +56 -5
  485. package/lib/components/Modal/Modal.types.d.ts.map +1 -1
  486. package/lib/components/Modal/Modal.types.js.map +1 -1
  487. package/lib/components/Modal/ModalManager.d.ts.map +1 -1
  488. package/lib/components/Modal/ModalManager.js +74 -65
  489. package/lib/components/Modal/ModalManager.js.map +1 -1
  490. package/lib/components/MultiStep/MultiStep.d.ts.map +1 -1
  491. package/lib/components/MultiStep/MultiStep.js +10 -12
  492. package/lib/components/MultiStep/MultiStep.js.map +1 -1
  493. package/lib/components/MultiStep/MultiStep.styles.js +1 -1
  494. package/lib/components/MultiStep/MultiStep.styles.js.map +1 -1
  495. package/lib/components/MultiStep/MultiStep.types.d.ts +4 -2
  496. package/lib/components/MultiStep/MultiStep.types.d.ts.map +1 -1
  497. package/lib/components/MultiStep/MultiStep.types.js.map +1 -1
  498. package/lib/components/Number/NumberDisplay.d.ts +2 -2
  499. package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
  500. package/lib/components/Number/NumberDisplay.js +1 -1
  501. package/lib/components/Number/NumberDisplay.js.map +1 -1
  502. package/lib/components/Number/NumberInput.d.ts.map +1 -1
  503. package/lib/components/Number/NumberInput.js +18 -25
  504. package/lib/components/Number/NumberInput.js.map +1 -1
  505. package/lib/components/Number/NumberInput.styles.d.ts +2 -2
  506. package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
  507. package/lib/components/Number/NumberInput.types.d.ts +2 -2
  508. package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
  509. package/lib/components/Number/NumberInput.types.js.map +1 -1
  510. package/lib/components/Number/utils.js +2 -3
  511. package/lib/components/Number/utils.js.map +1 -1
  512. package/lib/components/PageTemplates/CategorySubPage.d.ts +1 -1
  513. package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
  514. package/lib/components/PageTemplates/CategorySubPage.js +8 -18
  515. package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
  516. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +1 -1
  517. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
  518. package/lib/components/PageTemplates/DashboardPage.d.ts +7 -1
  519. package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
  520. package/lib/components/PageTemplates/DashboardPage.js +48 -28
  521. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  522. package/lib/components/PageTemplates/PageTemplates.d.ts +15 -6
  523. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  524. package/lib/components/PageTemplates/PageTemplates.js +89 -79
  525. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  526. package/lib/components/PageTemplates/index.d.ts +3 -0
  527. package/lib/components/PageTemplates/index.d.ts.map +1 -1
  528. package/lib/components/PageTemplates/index.js +1 -0
  529. package/lib/components/PageTemplates/index.js.map +1 -1
  530. package/lib/components/Pagination/Pagination.d.ts +2 -2
  531. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  532. package/lib/components/Pagination/Pagination.js +7 -6
  533. package/lib/components/Pagination/Pagination.js.map +1 -1
  534. package/lib/components/Paragraph/ParagraphDisplay.d.ts +11 -0
  535. package/lib/components/Paragraph/ParagraphDisplay.d.ts.map +1 -0
  536. package/lib/components/Paragraph/ParagraphDisplay.js +11 -0
  537. package/lib/components/Paragraph/ParagraphDisplay.js.map +1 -0
  538. package/lib/components/Paragraph/index.d.ts +3 -0
  539. package/lib/components/Paragraph/index.d.ts.map +1 -0
  540. package/lib/components/Paragraph/index.js +2 -0
  541. package/lib/components/Paragraph/index.js.map +1 -0
  542. package/lib/components/Phone/PhoneDisplay.d.ts +2 -2
  543. package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
  544. package/lib/components/Phone/PhoneDisplay.js +2 -3
  545. package/lib/components/Phone/PhoneDisplay.js.map +1 -1
  546. package/lib/components/Phone/PhoneInput.d.ts +2 -2
  547. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  548. package/lib/components/Phone/PhoneInput.js +18 -17
  549. package/lib/components/Phone/PhoneInput.js.map +1 -1
  550. package/lib/components/Phone/utils.js +2 -3
  551. package/lib/components/Phone/utils.js.map +1 -1
  552. package/lib/components/Popover/Popover.d.ts +0 -4
  553. package/lib/components/Popover/Popover.d.ts.map +1 -1
  554. package/lib/components/Popover/Popover.js +11 -122
  555. package/lib/components/Popover/Popover.js.map +1 -1
  556. package/lib/components/Popover/Popover.styles.d.ts +5 -0
  557. package/lib/components/Popover/Popover.styles.d.ts.map +1 -0
  558. package/lib/components/Popover/Popover.styles.js +116 -0
  559. package/lib/components/Popover/Popover.styles.js.map +1 -0
  560. package/lib/components/Popover/PopoverManager.js +2 -2
  561. package/lib/components/Popover/PopoverManager.js.map +1 -1
  562. package/lib/components/Popover/index.d.ts +1 -1
  563. package/lib/components/Popover/index.d.ts.map +1 -1
  564. package/lib/components/Popover/index.js +1 -1
  565. package/lib/components/Popover/index.js.map +1 -1
  566. package/lib/components/Progress/Bar.js +2 -2
  567. package/lib/components/Progress/Bar.js.map +1 -1
  568. package/lib/components/Progress/Ellipsis.d.ts +1 -1
  569. package/lib/components/Progress/Ellipsis.d.ts.map +1 -1
  570. package/lib/components/Progress/Ellipsis.js +48 -50
  571. package/lib/components/Progress/Ellipsis.js.map +1 -1
  572. package/lib/components/Progress/Progress.js +3 -4
  573. package/lib/components/Progress/Progress.js.map +1 -1
  574. package/lib/components/Progress/Progress.types.d.ts +2 -2
  575. package/lib/components/Progress/Progress.types.d.ts.map +1 -1
  576. package/lib/components/Progress/Progress.types.js.map +1 -1
  577. package/lib/components/Progress/Ring.d.ts +1 -1
  578. package/lib/components/Progress/Ring.d.ts.map +1 -1
  579. package/lib/components/Progress/Ring.js +40 -40
  580. package/lib/components/Progress/Ring.js.map +1 -1
  581. package/lib/components/RadioButton/RadioButton.d.ts +2 -2
  582. package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
  583. package/lib/components/RadioButton/RadioButton.js +1 -1
  584. package/lib/components/RadioButton/RadioButton.js.map +1 -1
  585. package/lib/components/RadioCheck/RadioCheck.d.ts +2 -2
  586. package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
  587. package/lib/components/RadioCheck/RadioCheck.js +7 -8
  588. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  589. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +4 -0
  590. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
  591. package/lib/components/RadioCheckGroup/RadioCheckGroup.js +19 -18
  592. package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
  593. package/lib/components/Rating/Rating.d.ts +2 -2
  594. package/lib/components/Rating/Rating.d.ts.map +1 -1
  595. package/lib/components/Rating/Rating.js +6 -7
  596. package/lib/components/Rating/Rating.js.map +1 -1
  597. package/lib/components/SearchInput/SearchInput.d.ts +4 -4
  598. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  599. package/lib/components/SearchInput/SearchInput.js +14 -14
  600. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  601. package/lib/components/Select/Option.js +1 -1
  602. package/lib/components/Select/Option.js.map +1 -1
  603. package/lib/components/Select/Select.d.ts.map +1 -1
  604. package/lib/components/Select/Select.js +15 -16
  605. package/lib/components/Select/Select.js.map +1 -1
  606. package/lib/components/Sentiment/Sentiment.d.ts +2 -2
  607. package/lib/components/Sentiment/Sentiment.d.ts.map +1 -1
  608. package/lib/components/Sentiment/Sentiment.js +1 -2
  609. package/lib/components/Sentiment/Sentiment.js.map +1 -1
  610. package/lib/components/Skeleton/LineSkeleton.js +1 -1
  611. package/lib/components/Skeleton/LineSkeleton.js.map +1 -1
  612. package/lib/components/Skeleton/ParagraphSkeleton.js +1 -1
  613. package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
  614. package/lib/components/Skeleton/RectangleSkeleton.js +1 -1
  615. package/lib/components/Skeleton/RectangleSkeleton.js.map +1 -1
  616. package/lib/components/Slider/Slider.d.ts.map +1 -1
  617. package/lib/components/Slider/Slider.js +12 -19
  618. package/lib/components/Slider/Slider.js.map +1 -1
  619. package/lib/components/Slider/Slider.styles.d.ts +4 -1
  620. package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
  621. package/lib/components/Slider/Slider.styles.js +17 -5
  622. package/lib/components/Slider/Slider.styles.js.map +1 -1
  623. package/lib/components/Slider/Slider.types.d.ts +2 -2
  624. package/lib/components/Slider/Slider.types.d.ts.map +1 -1
  625. package/lib/components/Slider/Slider.types.js.map +1 -1
  626. package/lib/components/Slider/SliderTicks.d.ts +1 -0
  627. package/lib/components/Slider/SliderTicks.d.ts.map +1 -1
  628. package/lib/components/Slider/SliderTicks.js +19 -12
  629. package/lib/components/Slider/SliderTicks.js.map +1 -1
  630. package/lib/components/Slider/utils.d.ts +10 -11
  631. package/lib/components/Slider/utils.d.ts.map +1 -1
  632. package/lib/components/Slider/utils.js +24 -18
  633. package/lib/components/Slider/utils.js.map +1 -1
  634. package/lib/components/SummaryItem/SummaryItem.d.ts +5 -5
  635. package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
  636. package/lib/components/SummaryItem/SummaryItem.js +3 -5
  637. package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
  638. package/lib/components/SummaryList/SummaryList.d.ts +8 -2
  639. package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
  640. package/lib/components/SummaryList/SummaryList.js +10 -11
  641. package/lib/components/SummaryList/SummaryList.js.map +1 -1
  642. package/lib/components/SummaryList/ViewAll.d.ts +1 -1
  643. package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
  644. package/lib/components/SummaryList/ViewAll.js +14 -10
  645. package/lib/components/SummaryList/ViewAll.js.map +1 -1
  646. package/lib/components/Switch/Switch.d.ts +2 -2
  647. package/lib/components/Switch/Switch.d.ts.map +1 -1
  648. package/lib/components/Switch/Switch.js +41 -30
  649. package/lib/components/Switch/Switch.js.map +1 -1
  650. package/lib/components/Table/Table.d.ts +2 -2
  651. package/lib/components/Table/Table.d.ts.map +1 -1
  652. package/lib/components/Table/Table.js +14 -13
  653. package/lib/components/Table/Table.js.map +1 -1
  654. package/lib/components/Tabs/Tab.d.ts +1 -1
  655. package/lib/components/Tabs/Tab.d.ts.map +1 -1
  656. package/lib/components/Tabs/Tab.js +9 -7
  657. package/lib/components/Tabs/Tab.js.map +1 -1
  658. package/lib/components/Tabs/TabPanel.d.ts +10 -2
  659. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  660. package/lib/components/Tabs/TabPanel.js +24 -8
  661. package/lib/components/Tabs/TabPanel.js.map +1 -1
  662. package/lib/components/Tabs/Tabs.d.ts +1 -0
  663. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  664. package/lib/components/Tabs/Tabs.js +22 -18
  665. package/lib/components/Tabs/Tabs.js.map +1 -1
  666. package/lib/components/Tabs/Tabs.types.d.ts +2 -2
  667. package/lib/components/Tabs/Tabs.types.d.ts.map +1 -1
  668. package/lib/components/Tabs/Tabs.types.js.map +1 -1
  669. package/lib/components/Text/Text.d.ts +1 -1
  670. package/lib/components/Text/Text.d.ts.map +1 -1
  671. package/lib/components/Text/Text.js +2 -2
  672. package/lib/components/Text/Text.js.map +1 -1
  673. package/lib/components/TextArea/TextArea.d.ts +2 -2
  674. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  675. package/lib/components/TextArea/TextArea.js +31 -30
  676. package/lib/components/TextArea/TextArea.js.map +1 -1
  677. package/lib/components/Toaster/Toaster.d.ts +8 -36
  678. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  679. package/lib/components/Toaster/Toaster.js +97 -102
  680. package/lib/components/Toaster/Toaster.js.map +1 -1
  681. package/lib/components/Tooltip/Tooltip.d.ts +6 -1
  682. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  683. package/lib/components/Tooltip/Tooltip.js +6 -13
  684. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  685. package/lib/components/Tree/StandardTree.d.ts +6 -0
  686. package/lib/components/Tree/StandardTree.d.ts.map +1 -0
  687. package/lib/components/Tree/StandardTree.js +175 -0
  688. package/lib/components/Tree/StandardTree.js.map +1 -0
  689. package/lib/components/Tree/StandardTree.styles.d.ts +13 -0
  690. package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -0
  691. package/lib/components/Tree/StandardTree.styles.js +155 -0
  692. package/lib/components/Tree/StandardTree.styles.js.map +1 -0
  693. package/lib/components/Tree/StandardTree.types.d.ts +25 -0
  694. package/lib/components/Tree/StandardTree.types.d.ts.map +1 -0
  695. package/lib/components/Tree/StandardTree.types.js +2 -0
  696. package/lib/components/Tree/StandardTree.types.js.map +1 -0
  697. package/lib/components/Tree/Tree.d.ts +35 -49
  698. package/lib/components/Tree/Tree.d.ts.map +1 -1
  699. package/lib/components/Tree/Tree.js +18 -56
  700. package/lib/components/Tree/Tree.js.map +1 -1
  701. package/lib/components/Tree/helpers.d.ts +19 -0
  702. package/lib/components/Tree/helpers.d.ts.map +1 -0
  703. package/lib/components/Tree/helpers.js +180 -0
  704. package/lib/components/Tree/helpers.js.map +1 -0
  705. package/lib/components/Tree/index.d.ts +4 -2
  706. package/lib/components/Tree/index.d.ts.map +1 -1
  707. package/lib/components/Tree/index.js +3 -1
  708. package/lib/components/Tree/index.js.map +1 -1
  709. package/lib/components/URL/URLDisplay.d.ts +2 -2
  710. package/lib/components/URL/URLDisplay.d.ts.map +1 -1
  711. package/lib/components/URL/URLDisplay.js +2 -2
  712. package/lib/components/URL/URLDisplay.js.map +1 -1
  713. package/lib/hooks/index.d.ts +7 -4
  714. package/lib/hooks/index.d.ts.map +1 -1
  715. package/lib/hooks/index.js +7 -3
  716. package/lib/hooks/index.js.map +1 -1
  717. package/lib/hooks/useActiveDescendant.d.ts +17 -3
  718. package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
  719. package/lib/hooks/useActiveDescendant.js +86 -64
  720. package/lib/hooks/useActiveDescendant.js.map +1 -1
  721. package/lib/hooks/useAutoResize.d.ts.map +1 -1
  722. package/lib/hooks/useAutoResize.js +6 -7
  723. package/lib/hooks/useAutoResize.js.map +1 -1
  724. package/lib/hooks/useBreakpoint.js +2 -4
  725. package/lib/hooks/useBreakpoint.js.map +1 -1
  726. package/lib/hooks/useDraggable.d.ts +8 -0
  727. package/lib/hooks/useDraggable.d.ts.map +1 -0
  728. package/lib/hooks/useDraggable.js +64 -0
  729. package/lib/hooks/useDraggable.js.map +1 -0
  730. package/lib/hooks/useFocusWithin.d.ts +1 -1
  731. package/lib/hooks/useFocusWithin.d.ts.map +1 -1
  732. package/lib/hooks/useFocusWithin.js +29 -24
  733. package/lib/hooks/useFocusWithin.js.map +1 -1
  734. package/lib/hooks/useI18n.d.ts +505 -170
  735. package/lib/hooks/useI18n.d.ts.map +1 -1
  736. package/lib/hooks/useI18n.js +2 -2
  737. package/lib/hooks/useI18n.js.map +1 -1
  738. package/lib/hooks/useLongPress.d.ts +16 -0
  739. package/lib/hooks/useLongPress.d.ts.map +1 -0
  740. package/lib/hooks/useLongPress.js +59 -0
  741. package/lib/hooks/useLongPress.js.map +1 -0
  742. package/lib/hooks/useOuterEvent.js +1 -1
  743. package/lib/hooks/useOuterEvent.js.map +1 -1
  744. package/lib/hooks/useOverride.js +1 -1
  745. package/lib/hooks/useOverride.js.map +1 -1
  746. package/lib/hooks/useScrollStick.js +14 -3
  747. package/lib/hooks/useScrollStick.js.map +1 -1
  748. package/lib/hooks/useScrollToggle.d.ts +6 -0
  749. package/lib/hooks/useScrollToggle.d.ts.map +1 -0
  750. package/lib/hooks/useScrollToggle.js +40 -0
  751. package/lib/hooks/useScrollToggle.js.map +1 -0
  752. package/lib/hooks/useTransitionState.d.ts +39 -0
  753. package/lib/hooks/useTransitionState.d.ts.map +1 -0
  754. package/lib/hooks/useTransitionState.js +56 -0
  755. package/lib/hooks/useTransitionState.js.map +1 -0
  756. package/lib/i18n/default.d.ts +583 -0
  757. package/lib/i18n/default.d.ts.map +1 -0
  758. package/lib/i18n/default.js +627 -0
  759. package/lib/i18n/default.js.map +1 -0
  760. package/lib/i18n/i18n.d.ts +988 -318
  761. package/lib/i18n/i18n.d.ts.map +1 -1
  762. package/lib/i18n/i18n.js +1 -1
  763. package/lib/i18n/i18n.js.map +1 -1
  764. package/lib/i18n/index.d.ts +1 -0
  765. package/lib/i18n/index.d.ts.map +1 -1
  766. package/lib/i18n/index.js.map +1 -1
  767. package/lib/i18n/translate.d.ts +29 -4
  768. package/lib/i18n/translate.d.ts.map +1 -1
  769. package/lib/i18n/translate.js +21 -8
  770. package/lib/i18n/translate.js.map +1 -1
  771. package/lib/index.d.ts +8 -2
  772. package/lib/index.d.ts.map +1 -1
  773. package/lib/index.js +8 -2
  774. package/lib/index.js.map +1 -1
  775. package/lib/styles/GlobalStyle.d.ts.map +1 -1
  776. package/lib/styles/GlobalStyle.js +2 -26
  777. package/lib/styles/GlobalStyle.js.map +1 -1
  778. package/lib/theme/ThemeMachine.js +7 -1
  779. package/lib/theme/ThemeMachine.js.map +1 -1
  780. package/lib/theme/index.d.ts +1 -0
  781. package/lib/theme/index.d.ts.map +1 -1
  782. package/lib/theme/index.js +1 -0
  783. package/lib/theme/index.js.map +1 -1
  784. package/lib/theme/theme.d.ts +83 -53
  785. package/lib/theme/theme.d.ts.map +1 -1
  786. package/lib/theme/themeDefinition.json +50 -30
  787. package/lib/theme/themeOverrides.schema.json +24 -3
  788. package/lib/theme/themes/buildTheme.json +3 -39
  789. package/lib/theme/themes/darkTheme.json +6 -0
  790. package/lib/theme/themes/legacyBuildTheme.json +50 -0
  791. package/lib/types/types.d.ts +6 -1
  792. package/lib/types/types.d.ts.map +1 -1
  793. package/lib/types/types.js.map +1 -1
  794. package/lib/utils/utils.d.ts +41 -4
  795. package/lib/utils/utils.d.ts.map +1 -1
  796. package/lib/utils/utils.js +55 -9
  797. package/lib/utils/utils.js.map +1 -1
  798. package/package.json +10 -11
  799. package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts +0 -3
  800. package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts.map +0 -1
  801. package/lib/components/DateTime/Input/useButtonAriaLabel.js +0 -33
  802. package/lib/components/DateTime/Input/useButtonAriaLabel.js.map +0 -1
  803. package/lib/components/NoItems/NoItems.d.ts +0 -14
  804. package/lib/components/NoItems/NoItems.d.ts.map +0 -1
  805. package/lib/components/NoItems/NoItems.js.map +0 -1
  806. package/lib/components/NoItems/index.d.ts +0 -4
  807. package/lib/components/NoItems/index.d.ts.map +0 -1
  808. package/lib/components/NoItems/index.js +0 -3
  809. package/lib/components/NoItems/index.js.map +0 -1
  810. package/lib/i18n/default.json +0 -246
@@ -3,12 +3,16 @@ import { useState, useEffect, useRef } from 'react';
3
3
  import Flex from '../../Flex';
4
4
  import MonthInput from '../Input/MonthInput';
5
5
  import Button from '../../Button';
6
- import Icon from '../../Icon';
6
+ import Icon, { registerIcon } from '../../Icon';
7
+ import * as caretLeftIcon from '../../Icon/icons/caret-left.icon';
8
+ import * as caretRightIcon from '../../Icon/icons/caret-right.icon';
7
9
  import { useConfiguration, useDirection, useI18n } from '../../../hooks';
8
10
  import { getCalendarTypeFromLocale, toUTCDateString } from '../Input/utils';
9
11
  import { CALENDAR_TYPES } from '../Input/local';
10
12
  import Calendar from './Calendar';
11
13
  import { ScreenReaderOnly, StyledDatePicker, StyledMonthPicker } from './Calendar.styles';
14
+ import { isValidDate } from './utils';
15
+ registerIcon(caretLeftIcon, caretRightIcon);
12
16
  const defaultProps = {
13
17
  showWeekNumber: false,
14
18
  mode: 'date'
@@ -16,14 +20,11 @@ const defaultProps = {
16
20
  function toDateString(date) {
17
21
  return date ? toUTCDateString(date) : undefined;
18
22
  }
19
- function getValidatedDate(date) {
20
- return date && Number.isNaN(date.getTime()) ? undefined : date;
21
- }
22
23
  const DatePicker = (props) => {
23
24
  const { locale } = useConfiguration();
24
25
  const { selected: initial, onChange, min, max, mode, showWeekNumber, ...restProps } = props;
25
26
  const [selected, setSelected] = useState(initial);
26
- const [current, setCurrent] = useState(getValidatedDate(selected) || new Date());
27
+ const [current, setCurrent] = useState(selected && isValidDate(selected) ? selected : new Date());
27
28
  useEffect(() => {
28
29
  if (toDateString(initial) !== toDateString(selected)) {
29
30
  setSelected(initial);
@@ -34,36 +35,31 @@ const DatePicker = (props) => {
34
35
  useEffect(() => {
35
36
  // need to postpone focusing to make sure onFocusWithin has been attached
36
37
  setTimeout(() => {
37
- var _a, _b;
38
- (_b = (_a = calendarRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('button[tabindex="0"]:enabled')) === null || _b === void 0 ? void 0 : _b.focus();
38
+ calendarRef.current?.querySelector('button[tabindex="0"]:enabled')?.focus();
39
39
  });
40
40
  }, []);
41
41
  const calendarType = getCalendarTypeFromLocale(locale);
42
42
  const t = useI18n();
43
43
  const { start, end } = useDirection();
44
- return (_jsxs(StyledDatePicker, Object.assign({}, restProps, { children: [_jsxs(Flex, Object.assign({ as: StyledMonthPicker, container: { justify: 'between', alignItems: 'center' } }, { children: [_jsx(Button, Object.assign({ variant: 'simple', icon: true, onClick: () => {
44
+ return (_jsxs(StyledDatePicker, { ...restProps, children: [_jsxs(Flex, { as: StyledMonthPicker, container: { justify: 'between', alignItems: 'center' }, children: [_jsx(Button, { variant: 'simple', icon: true, onClick: () => {
45
45
  const newCurrent = new Date(current);
46
46
  newCurrent.setUTCMonth(newCurrent.getUTCMonth() - 1);
47
47
  setCurrent(newCurrent);
48
- }, "aria-label": t('picker_prev_month') }, { children: _jsx(Icon, { name: `caret-${start}` }, void 0) }), void 0),
49
- _jsx(MonthInput, { value: current, required: true, "aria-label": t('picker_jump_to_month'), onChange: ({ valueAsTimestamp }) => {
48
+ }, "aria-label": t('picker_prev_month'), children: _jsx(Icon, { name: `caret-${start}` }, void 0) }, void 0), _jsx(MonthInput, { value: current, required: true, "aria-label": t('picker_jump_to_month'), onChange: ({ valueAsTimestamp }) => {
50
49
  const newCurrent = new Date(valueAsTimestamp);
51
50
  newCurrent.setUTCDate(current.getUTCDate());
52
51
  setCurrent(newCurrent);
53
- }, min: min, max: max }, void 0),
54
- _jsx(ScreenReaderOnly, Object.assign({ "aria-live": 'polite' }, { children: current.toLocaleString(locale, { month: 'long', year: 'numeric' }) }), void 0),
55
- _jsx(Button, Object.assign({ variant: 'simple', icon: true, onClick: () => {
52
+ }, min: min, max: max }, void 0), _jsx(ScreenReaderOnly, { "aria-live": 'polite', children: current.toLocaleString(locale, { month: 'long', year: 'numeric', timeZone: 'UTC' }) }, void 0), _jsx(Button, { variant: 'simple', icon: true, onClick: () => {
56
53
  const newCurrent = new Date(current);
57
54
  newCurrent.setUTCMonth(newCurrent.getUTCMonth() + 1);
58
55
  setCurrent(newCurrent);
59
- }, "aria-label": t('picker_next_month') }, { children: _jsx(Icon, { name: `caret-${end}` }, void 0) }), void 0)] }), void 0),
60
- _jsx(Flex, Object.assign({ container: { wrap: 'nowrap' }, dir: 'ltr' }, { children: _jsx(Calendar, { ref: calendarRef, selected: getValidatedDate(selected), current: current, calendarType: mode === 'date' ? calendarType : CALENDAR_TYPES.ISO_8601, showWeekNumber: showWeekNumber, mode: mode, onFocus: date => {
56
+ }, "aria-label": t('picker_next_month'), children: _jsx(Icon, { name: `caret-${end}` }, void 0) }, void 0)] }, void 0), _jsx(Flex, { container: { wrap: 'nowrap' }, dir: 'ltr', children: _jsx(Calendar, { ref: calendarRef, selected: selected && isValidDate(selected) ? selected : undefined, current: current, calendarType: mode === 'date' ? calendarType : CALENDAR_TYPES.ISO_8601, showWeekNumber: showWeekNumber, mode: mode, onFocus: date => {
61
57
  setCurrent(date);
62
58
  }, onSelect: date => {
63
59
  setCurrent(date);
64
60
  setSelected(date);
65
- onChange === null || onChange === void 0 ? void 0 : onChange(date);
66
- }, min: min, max: max }, void 0) }), void 0)] }), void 0));
61
+ onChange?.(date);
62
+ }, min: min, max: max }, void 0) }, void 0)] }, void 0));
67
63
  };
68
64
  DatePicker.defaultProps = defaultProps;
69
65
  export default DatePicker;
@@ -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,MAAM,YAAY,CAAC;AAC9B,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,E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B,CAAC,EACD,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,WACR,YACG,aACU,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 from '../../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';\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\nfunction getValidatedDate(date: Date | undefined) {\n return date && Number.isNaN(date.getTime()) ? undefined : date;\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(getValidatedDate(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 {...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 aria-label={t('picker_jump_to_month')}\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'>\n {current.toLocaleString(locale, { month: 'long', year: 'numeric' })}\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={getValidatedDate(selected)}\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;AACl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AO,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,WACR,WACG,YACU,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 {...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 aria-label={t('picker_jump_to_month')}\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'>\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 +1 @@
1
- {"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DateRangePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,MAAM,OAAO,CAAC;AAUvE,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAIjD,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,uDAAuD;IACvD,aAAa,CAAC,EAAE;QAAE,SAAS,EAAE,IAAI,GAAG,SAAS,CAAC;QAAC,OAAO,EAAE,IAAI,GAAG,SAAS,CAAA;KAAE,CAAC;CAC5E;AAUD,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,CAiG5D,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DateRangePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,MAAM,OAAO,CAAC;AAYvE,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAOjD,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,uDAAuD;IACvD,aAAa,CAAC,EAAE;QAAE,SAAS,EAAE,IAAI,GAAG,SAAS,CAAC;QAAC,OAAO,EAAE,IAAI,GAAG,SAAS,CAAA;KAAE,CAAC;CAC5E;AAMD,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,CAiG5D,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -3,23 +3,24 @@ import { useState, useEffect, useRef } from 'react';
3
3
  import Flex from '../../Flex';
4
4
  import MonthInput from '../Input/MonthInput';
5
5
  import Button from '../../Button';
6
- import Icon from '../../Icon';
6
+ import Icon, { registerIcon } from '../../Icon';
7
+ import * as caretLeftIcon from '../../Icon/icons/caret-left.icon';
8
+ import * as caretRightIcon from '../../Icon/icons/caret-right.icon';
7
9
  import { useConfiguration, useI18n } from '../../../hooks';
8
10
  import { getCalendarTypeFromLocale, toUTCDateString } from '../Input/utils';
9
11
  import Calendar from './Calendar';
10
12
  import Weeks from './Weeks';
11
13
  import { StyledDatePicker, StyledMonthPicker } from './Calendar.styles';
14
+ import { isValidDate } from './utils';
15
+ registerIcon(caretLeftIcon, caretRightIcon);
12
16
  function toDateString(date) {
13
17
  return date ? toUTCDateString(date) : undefined;
14
18
  }
15
- function getValidatedDate(date) {
16
- return date && Number.isNaN(date.getTime()) ? undefined : date;
17
- }
18
19
  const DateRangePicker = (props) => {
19
20
  const { locale } = useConfiguration();
20
21
  const { selected: initial, selectedRange, onChange, min, max, mode, showWeekNumber, ...restProps } = props;
21
22
  const [selected, setSelected] = useState(initial);
22
- const [current, setCurrent] = useState(getValidatedDate(selected) || new Date());
23
+ const [current, setCurrent] = useState(selected && isValidDate(selected) ? selected : new Date());
23
24
  useEffect(() => {
24
25
  if (toDateString(initial) !== toDateString(selected)) {
25
26
  setSelected(initial);
@@ -30,35 +31,30 @@ const DateRangePicker = (props) => {
30
31
  useEffect(() => {
31
32
  // need to postpone focusing to make sure onFocusWithin has been attached
32
33
  setTimeout(() => {
33
- var _a, _b;
34
- (_b = (_a = calendarRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('button[tabindex="0"]:enabled')) === null || _b === void 0 ? void 0 : _b.focus();
34
+ calendarRef.current?.querySelector('button[tabindex="0"]:enabled')?.focus();
35
35
  });
36
36
  }, []);
37
37
  const calendarType = getCalendarTypeFromLocale(locale);
38
38
  const t = useI18n();
39
- return (_jsxs(StyledDatePicker, Object.assign({}, restProps, { children: [_jsxs(Flex, Object.assign({ as: StyledMonthPicker, container: { justify: 'between', alignItems: 'center' } }, { children: [_jsx(Button, Object.assign({ variant: 'simple', icon: true, onClick: () => {
39
+ return (_jsxs(StyledDatePicker, { ...restProps, children: [_jsxs(Flex, { as: StyledMonthPicker, container: { justify: 'between', alignItems: 'center' }, children: [_jsx(Button, { variant: 'simple', icon: true, onClick: () => {
40
40
  const newCurrent = new Date(current);
41
41
  newCurrent.setUTCMonth(newCurrent.getUTCMonth() - 1);
42
42
  setCurrent(newCurrent);
43
- }, "aria-label": t('picker_prev_month') }, { children: _jsx(Icon, { name: 'caret-left' }, void 0) }), void 0),
44
- _jsx(MonthInput, { value: current, required: true, "aria-label": t('picker_jump_to_month'), onChange: ({ valueAsTimestamp }) => {
43
+ }, "aria-label": t('picker_prev_month'), children: _jsx(Icon, { name: 'caret-left' }, void 0) }, void 0), _jsx(MonthInput, { value: current, required: true, "aria-label": t('picker_jump_to_month'), onChange: ({ valueAsTimestamp }) => {
45
44
  const newCurrent = new Date(valueAsTimestamp);
46
45
  newCurrent.setUTCDate(current.getUTCDate());
47
46
  setCurrent(newCurrent);
48
- }, min: min, max: max }, void 0),
49
- _jsx(Button, Object.assign({ variant: 'simple', icon: true, onClick: () => {
47
+ }, min: min, max: max }, void 0), _jsx(Button, { variant: 'simple', icon: true, onClick: () => {
50
48
  const newCurrent = new Date(current);
51
49
  newCurrent.setUTCMonth(newCurrent.getUTCMonth() + 1);
52
50
  setCurrent(newCurrent);
53
- }, "aria-label": t('picker_next_month') }, { children: _jsx(Icon, { name: 'caret-right' }, void 0) }), void 0)] }), void 0),
54
- _jsxs(Flex, Object.assign({ container: { wrap: 'nowrap' } }, { children: [showWeekNumber && _jsx(Weeks, { current: current, calendarType: calendarType, disabled: true }, void 0),
55
- _jsx(Calendar, { ref: calendarRef, selected: getValidatedDate(selected), current: current, selectedRange: selectedRange, showHighlight: true, calendarType: calendarType, onFocus: date => {
51
+ }, "aria-label": t('picker_next_month'), children: _jsx(Icon, { name: 'caret-right' }, void 0) }, void 0)] }, void 0), _jsxs(Flex, { container: { wrap: 'nowrap' }, children: [showWeekNumber && _jsx(Weeks, { current: current, calendarType: calendarType, disabled: true }, void 0), _jsx(Calendar, { ref: calendarRef, selected: selected && isValidDate(selected) ? selected : undefined, current: current, selectedRange: selectedRange, showHighlight: true, calendarType: calendarType, onFocus: date => {
56
52
  setCurrent(date);
57
53
  }, onSelect: date => {
58
54
  setCurrent(date);
59
55
  setSelected(date);
60
- onChange === null || onChange === void 0 ? void 0 : onChange(date);
61
- }, min: min, max: max }, void 0)] }), void 0)] }), void 0));
56
+ onChange?.(date);
57
+ }, min: min, max: max }, void 0)] }, void 0)] }, void 0));
62
58
  };
63
59
  export default DateRangePicker;
64
60
  //# sourceMappingURL=DateRangePicker.js.map
@@ -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,MAAM,YAAY,CAAC;AAC9B,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;AAOxE,SAAS,YAAY,CAAC,IAAsB;IAC1C,OAAO,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC;AAED,SAAS,gBAAgB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,CAAC,CAAC,mBAAmB,CAAC,gBAElC,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,WAAG,YACpB,aACJ;YACP,MAAC,IAAI,kBAAC,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAChC,cAAc,IAAI,KAAC,KAAK,IAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,iBAAG;oBACnF,KAAC,QAAQ,IACP,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EACpC,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,aAAR,QAAQ,uBAAR,QAAQ,CAAG,IAAI,CAAC,CAAC;wBACnB,CAAC,EACD,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,WACR,aACG,aACU,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 from '../../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';\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\nfunction getValidatedDate(date: Date | undefined) {\n return date && Number.isNaN(date.getTime()) ? undefined : date;\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(getValidatedDate(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 {...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 aria-label={t('picker_jump_to_month')}\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={getValidatedDate(selected)}\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,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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aAChC,cAAc,IAAI,KAAC,KAAK,IAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,iBAAG,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,WACR,YACG,YACU,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 {...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 aria-label={t('picker_jump_to_month')}\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"]}
@@ -68,26 +68,25 @@ const TimePicker = (props) => {
68
68
  };
69
69
  });
70
70
  const isSelected = (date) => {
71
- return ((selected === null || selected === void 0 ? void 0 : selected.getUTCHours()) === date.getUTCHours() &&
72
- (selected === null || selected === void 0 ? void 0 : selected.getUTCMinutes()) === date.getUTCMinutes());
71
+ return (selected?.getUTCHours() === date.getUTCHours() &&
72
+ selected?.getUTCMinutes() === date.getUTCMinutes());
73
73
  };
74
74
  const [buttonEl, setButtonEl] = useElement();
75
75
  const menuRef = useRef(null);
76
76
  useArrows(menuRef, { cycle: true });
77
77
  const renderTime = (text) => {
78
78
  const [hour, minute, meridiem] = text.split(/:| /);
79
- return (_jsxs(_Fragment, { children: [_jsx("span", { children: hour }, void 0), ":", _jsx("span", { children: minute }, void 0),
80
- meridiem && _jsx("span", { children: meridiem }, void 0)] }, void 0));
79
+ return (_jsxs(_Fragment, { children: [_jsx("span", { children: hour }, void 0), ":", _jsx("span", { children: minute }, void 0), meridiem && _jsx("span", { children: meridiem }, void 0)] }, void 0));
81
80
  };
82
81
  useEffect(() => {
83
- buttonEl === null || buttonEl === void 0 ? void 0 : buttonEl.focus();
82
+ buttonEl?.focus();
84
83
  }, [buttonEl]);
85
- return (_jsx(StyledTimePicker, Object.assign({ role: 'menu', tabIndex: 0, ref: menuRef }, restProps, { children: actionsList.map(({ text, id }) => {
84
+ return (_jsx(StyledTimePicker, { role: 'menu', tabIndex: 0, ref: menuRef, ...restProps, children: actionsList.map(({ text, id }) => {
86
85
  const item = new Date(Number(id));
87
- return (_jsx(StyledTimeItem, Object.assign({ role: 'presentation' }, { children: _jsx(StyledTimeButton, Object.assign({ role: 'menuitem', as: Button, variant: 'simple', ref: isSelected(item) ? setButtonEl : null, "aria-label": text, selected: isSelected(item), onClick: () => {
88
- onSelect === null || onSelect === void 0 ? void 0 : onSelect(item);
89
- } }, { children: renderTime(text) }), void 0) }), id));
90
- }) }), void 0));
86
+ 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), onClick: () => {
87
+ onSelect?.(item);
88
+ }, children: renderTime(text) }, void 0) }, id));
89
+ }) }, void 0));
91
90
  };
92
91
  export default TimePicker;
93
92
  //# sourceMappingURL=TimePicker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/TimePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC7D,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,CAA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EAAE,IAAI,EAAE,EAAE,EAAU,EAAE,EAAE;YACxC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;YAClC,OAAO,CACL,KAAC,cAAc,kBAAC,IAAI,EAAC,cAAc,gBACjC,KAAC,gBAAgB,kBACf,IAAI,EAAC,UAAU,EACf,EAAE,EAAE,MAAM,EACV,OAAO,EAAC,QAAQ,EAChB,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,gBAC9B,IAAI,EAChB,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,EAC1B,OAAO,EAAE,GAAG,EAAE;wBACZ,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,IAAI,CAAC,CAAC;oBACnB,CAAC,gBAEA,UAAU,CAAC,IAAI,CAAC,YACA,KAboB,EAAE,CAc1B,CAClB,CAAC;QACJ,CAAC,CAAC,YACe,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { FunctionComponent, 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, { cycle: true });\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 useEffect(() => {\n buttonEl?.focus();\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 onClick={() => {\n onSelect?.(item);\n }}\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,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC7D,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,CA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EAAE,CAAC,CAAC,CAAC;YAClC,OAAO,CACL,KAAC,cAAc,IAAC,IAAI,EAAC,cAAc,YACjC,KAAC,gBAAgB,IACf,IAAI,EAAC,UAAU,EACf,EAAE,EAAE,MAAM,EACV,OAAO,EAAC,QAAQ,EAChB,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,gBAC9B,IAAI,EAChB,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,EAC1B,OAAO,EAAE,GAAG,EAAE;wBACZ,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC,YAEA,UAAU,CAAC,IAAI,CAAC,WACA,IAboB,EAAE,CAc1B,CAClB,CAAC;QACJ,CAAC,CAAC,WACe,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { FunctionComponent, 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, { cycle: true });\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 useEffect(() => {\n buttonEl?.focus();\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 onClick={() => {\n onSelect?.(item);\n }}\n >\n {renderTime(text)}\n </StyledTimeButton>\n </StyledTimeItem>\n );\n })}\n </StyledTimePicker>\n );\n};\n\nexport default TimePicker;\n"]}
@@ -43,16 +43,16 @@ const Weeks = forwardRef((props, ref) => {
43
43
  newFocused = new Date(focusedWeek);
44
44
  newFocused.setUTCDate(focusedWeek.getUTCDate() - 7);
45
45
  setFocusedWeek(newFocused);
46
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(newFocused);
46
+ onFocus?.(newFocused);
47
47
  break;
48
48
  case 'ArrowDown':
49
49
  newFocused = new Date(focusedWeek);
50
50
  newFocused.setUTCDate(focusedWeek.getUTCDate() + 7);
51
51
  setFocusedWeek(newFocused);
52
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(newFocused);
52
+ onFocus?.(newFocused);
53
53
  break;
54
54
  case 'Enter':
55
- onSelect === null || onSelect === void 0 ? void 0 : onSelect(focusedWeek);
55
+ onSelect?.(focusedWeek);
56
56
  break;
57
57
  default:
58
58
  }
@@ -77,21 +77,19 @@ const Weeks = forwardRef((props, ref) => {
77
77
  const weekText = t('week_label_a11y');
78
78
  const weeks = getWeeksOfMonth(current, calendarType).map(weekNo => {
79
79
  const dateOfISOWeek = getDateOfISOWeek(weekNo, current.getUTCFullYear());
80
- return (_jsxs(StyledWeekNumber, Object.assign({ variant: 'simple', icon: false, type: 'button', loading: false, ref: isFocused(dateOfISOWeek)
80
+ return (_jsxs(StyledWeekNumber, { variant: 'simple', icon: false, type: 'button', loading: false, ref: isFocused(dateOfISOWeek)
81
81
  ? (focusedRef) => {
82
82
  if (hasFocus)
83
- focusedRef === null || focusedRef === void 0 ? void 0 : focusedRef.focus();
83
+ focusedRef?.focus();
84
84
  }
85
85
  : undefined, tabIndex: isFocused(dateOfISOWeek) ? 0 : -1, disabled: isDisabled(dateOfISOWeek), "aria-selected": isChecked(dateOfISOWeek) || undefined, "aria-label": `${t('week_label_a11y')} ${weekNo.toString()} ${current
86
86
  .getUTCFullYear()
87
87
  .toString()}`, onClick: () => {
88
- onSelect === null || onSelect === void 0 ? void 0 : onSelect(dateOfISOWeek);
89
- } }, { children: [size === 'long' && `${weekText} `,
90
- weekNo.toString()] }), weekNo));
88
+ onSelect?.(dateOfISOWeek);
89
+ }, children: [size === 'long' && `${weekText} `, weekNo.toString()] }, weekNo));
91
90
  });
92
- const label = size === 'short' ? (_jsx(Text, Object.assign({ as: StyledColumnLabel, forwardedAs: 'abbr', title: weekText }, { children: t('week_text_short') }), void 0)) : (_jsx(Text, Object.assign({ as: StyledColumnLabel }, { children: weekText }), void 0));
93
- return (_jsxs(Flex, Object.assign({ as: StyledWeekNumbers, container: { direction: 'column' }, ref: containerRef, onKeyDown: onKeyDown }, { children: [label,
94
- weeks] }), void 0));
91
+ const label = size === 'short' ? (_jsx(Text, { as: StyledColumnLabel, forwardedAs: 'abbr', title: weekText, children: t('week_text_short') }, void 0)) : (_jsx(Text, { as: StyledColumnLabel, children: weekText }, void 0));
92
+ return (_jsxs(Flex, { as: StyledWeekNumbers, container: { direction: 'column' }, ref: containerRef, onKeyDown: onKeyDown, children: [label, weeks] }, void 0));
95
93
  });
96
94
  export default Weeks;
97
95
  //# sourceMappingURL=Weeks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Weeks.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Weeks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,eAAe,EAEf,QAAQ,EACR,UAAU,EAGX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO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YAChB,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,kBAAC,EAAE,EAAE,iBAAiB,gBAAG,QAAQ,YAAQ,CAC/C,CAAC;IAEJ,OAAO,CACL,MAAC,IAAI,kBACH,EAAE,EAAE,iBAAiB,EACrB,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAClC,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,SAAS,iBAEnB,KAAK;YACL,KAAK,aACD,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import {\n FC,\n useLayoutEffect,\n KeyboardEvent,\n useState,\n forwardRef,\n PropsWithoutRef,\n Ref\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Flex from '../../Flex';\nimport { defaultThemeProp } from '../../../theme';\nimport Text from '../../Text';\nimport { getDateOfISOWeek, getWeek, parseToDate, toUTCDateString } from '../Input/utils';\nimport { useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';\nimport { CALENDAR_TYPES } from '../Input/local';\nimport { ForwardProps } from '../../../types';\nimport { FormControlProps } from '../../FormControl';\n\nimport { StyledColumnLabel, StyledPick } from './Calendar.styles';\nimport { getWeeksOfMonth } from './utils';\n\nexport interface WeeksProps {\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 week that will be selected when the Date Picker is opened.\n */\n selected?: Date;\n /**\n * Defines default week that will be focused initially when the Date Picker is opened.\n * @default new Date()\n */\n current?: Date;\n /** Callback fired when user focuses new week. */\n onFocus?: (date: Date) => void;\n /** Callback fired when new week is selected. */\n onSelect?: (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 /** Should text be in long or short format (ie. only number). */\n size?: 'short' | 'long';\n}\n\nexport const StyledWeekNumbers = styled.div`\n margin-inline-end: ${props => props.theme.base.spacing};\n color: rgba(0, 0, 0, 0.75);\n`;\n\nStyledWeekNumbers.defaultProps = defaultThemeProp;\n\nconst StyledWeekNumber = styled(StyledPick)(props => {\n const {\n theme: {\n base: { 'border-radius': borderRadius }\n }\n } = props;\n\n return css`\n &:disabled {\n &:nth-child(2) {\n border-radius: calc(0.5 * ${borderRadius}) calc(0.5 * ${borderRadius}) 0 0;\n }\n &:last-child {\n border-radius: 0 0 calc(0.5 * ${borderRadius}) calc(0.5 * ${borderRadius});\n }\n }\n `;\n});\n\nStyledWeekNumber.defaultProps = defaultThemeProp;\n\nconst Weeks: FC<WeeksProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<WeeksProps>, ref: Ref<HTMLButtonElement>) => {\n const {\n selected,\n current = selected ? new Date(selected.getTime()) : new Date(),\n calendarType = CALENDAR_TYPES.ISO_8601,\n onSelect,\n onFocus,\n disabled = false,\n size = 'short'\n } = props;\n\n const [focusedWeek, setFocusedWeek] = useState(current);\n useLayoutEffect(() => {\n setFocusedWeek(current);\n }, [current.getUTCFullYear(), current.getUTCMonth()]);\n\n let newFocused: Date;\n const onKeyDown = (ev: KeyboardEvent<HTMLElement>) => {\n if (['ArrowUp', 'ArrowDown', 'Enter'].includes(ev.key)) ev.preventDefault();\n switch (ev.key) {\n case 'ArrowUp':\n newFocused = new Date(focusedWeek);\n newFocused.setUTCDate(focusedWeek.getUTCDate() - 7);\n setFocusedWeek(newFocused);\n onFocus?.(newFocused);\n break;\n case 'ArrowDown':\n newFocused = new Date(focusedWeek);\n newFocused.setUTCDate(focusedWeek.getUTCDate() + 7);\n setFocusedWeek(newFocused);\n onFocus?.(newFocused);\n break;\n case 'Enter':\n onSelect?.(focusedWeek);\n break;\n default:\n }\n };\n\n const containerRef = useConsolidatedRef(ref);\n const hasFocus = useFocusWithin([containerRef]);\n\n const min = props.min ? parseToDate(props.min) : -Infinity;\n const max = props.max ? parseToDate(props.max) : Infinity;\n const isDisabled = (day: Date) => {\n return disabled || min > day.getTime() || day.getTime() > max;\n };\n\n const isChecked = (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 (\n toUTCDateString(day) ===\n toUTCDateString(\n getDateOfISOWeek(getWeek(focusedWeek, calendarType), focusedWeek.getFullYear())\n )\n );\n };\n\n const t = useI18n();\n\n const weekText = t('week_label_a11y');\n\n const weeks = getWeeksOfMonth(current, calendarType).map(weekNo => {\n const dateOfISOWeek = getDateOfISOWeek(weekNo, current.getUTCFullYear());\n return (\n <StyledWeekNumber\n key={weekNo}\n variant='simple'\n icon={false}\n type='button'\n loading={false}\n ref={\n isFocused(dateOfISOWeek)\n ? (focusedRef: HTMLButtonElement) => {\n if (hasFocus) focusedRef?.focus();\n }\n : undefined\n }\n tabIndex={isFocused(dateOfISOWeek) ? 0 : -1}\n disabled={isDisabled(dateOfISOWeek)}\n aria-selected={isChecked(dateOfISOWeek) || undefined}\n aria-label={`${t('week_label_a11y')} ${weekNo.toString()} ${current\n .getUTCFullYear()\n .toString()}`}\n onClick={() => {\n onSelect?.(dateOfISOWeek);\n }}\n >\n {size === 'long' && `${weekText} `}\n {weekNo.toString()}\n </StyledWeekNumber>\n );\n });\n\n const label =\n size === 'short' ? (\n <Text as={StyledColumnLabel} forwardedAs='abbr' title={weekText}>\n {t('week_text_short')}\n </Text>\n ) : (\n <Text as={StyledColumnLabel}>{weekText}</Text>\n );\n\n return (\n <Flex\n as={StyledWeekNumbers}\n container={{ direction: 'column' }}\n ref={containerRef}\n onKeyDown={onKeyDown}\n >\n {label}\n {weeks}\n </Flex>\n );\n }\n);\n\nexport default Weeks;\n"]}
1
+ {"version":3,"file":"Weeks.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Wee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,KAAK,EAAE,QAAQ,YAC5D,CAAC,CAAC,iBAAiB,CAAC,WAChB,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,EAAE,EAAE,iBAAiB,YAAG,QAAQ,WAAQ,CAC/C,CAAC;IAEJ,OAAO,CACL,MAAC,IAAI,IACH,EAAE,EAAE,iBAAiB,EACrB,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAClC,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,SAAS,aAEnB,KAAK,EACL,KAAK,YACD,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import {\n FC,\n useLayoutEffect,\n KeyboardEvent,\n useState,\n forwardRef,\n PropsWithoutRef,\n Ref\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Flex from '../../Flex';\nimport { defaultThemeProp } from '../../../theme';\nimport Text from '../../Text';\nimport { getDateOfISOWeek, getWeek, parseToDate, toUTCDateString } from '../Input/utils';\nimport { useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';\nimport { CALENDAR_TYPES } from '../Input/local';\nimport { ForwardProps } from '../../../types';\nimport { FormControlProps } from '../../FormControl';\n\nimport { StyledColumnLabel, StyledPick } from './Calendar.styles';\nimport { getWeeksOfMonth } from './utils';\n\nexport interface WeeksProps {\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 week that will be selected when the Date Picker is opened.\n */\n selected?: Date;\n /**\n * Defines default week that will be focused initially when the Date Picker is opened.\n * @default new Date()\n */\n current?: Date;\n /** Callback fired when user focuses new week. */\n onFocus?: (date: Date) => void;\n /** Callback fired when new week is selected. */\n onSelect?: (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 /** Should text be in long or short format (ie. only number). */\n size?: 'short' | 'long';\n}\n\nexport const StyledWeekNumbers = styled.div`\n margin-inline-end: ${props => props.theme.base.spacing};\n color: rgba(0, 0, 0, 0.75);\n`;\n\nStyledWeekNumbers.defaultProps = defaultThemeProp;\n\nconst StyledWeekNumber = styled(StyledPick)(props => {\n const {\n theme: {\n base: { 'border-radius': borderRadius }\n }\n } = props;\n\n return css`\n &:disabled {\n &:nth-child(2) {\n border-radius: calc(0.5 * ${borderRadius}) calc(0.5 * ${borderRadius}) 0 0;\n }\n &:last-child {\n border-radius: 0 0 calc(0.5 * ${borderRadius}) calc(0.5 * ${borderRadius});\n }\n }\n `;\n});\n\nStyledWeekNumber.defaultProps = defaultThemeProp;\n\nconst Weeks: FC<WeeksProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<WeeksProps>, ref: Ref<HTMLButtonElement>) => {\n const {\n selected,\n current = selected ? new Date(selected.getTime()) : new Date(),\n calendarType = CALENDAR_TYPES.ISO_8601,\n onSelect,\n onFocus,\n disabled = false,\n size = 'short'\n } = props;\n\n const [focusedWeek, setFocusedWeek] = useState(current);\n useLayoutEffect(() => {\n setFocusedWeek(current);\n }, [current.getUTCFullYear(), current.getUTCMonth()]);\n\n let newFocused: Date;\n const onKeyDown = (ev: KeyboardEvent<HTMLElement>) => {\n if (['ArrowUp', 'ArrowDown', 'Enter'].includes(ev.key)) ev.preventDefault();\n switch (ev.key) {\n case 'ArrowUp':\n newFocused = new Date(focusedWeek);\n newFocused.setUTCDate(focusedWeek.getUTCDate() - 7);\n setFocusedWeek(newFocused);\n onFocus?.(newFocused);\n break;\n case 'ArrowDown':\n newFocused = new Date(focusedWeek);\n newFocused.setUTCDate(focusedWeek.getUTCDate() + 7);\n setFocusedWeek(newFocused);\n onFocus?.(newFocused);\n break;\n case 'Enter':\n onSelect?.(focusedWeek);\n break;\n default:\n }\n };\n\n const containerRef = useConsolidatedRef(ref);\n const hasFocus = useFocusWithin([containerRef]);\n\n const min = props.min ? parseToDate(props.min) : -Infinity;\n const max = props.max ? parseToDate(props.max) : Infinity;\n const isDisabled = (day: Date) => {\n return disabled || min > day.getTime() || day.getTime() > max;\n };\n\n const isChecked = (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 (\n toUTCDateString(day) ===\n toUTCDateString(\n getDateOfISOWeek(getWeek(focusedWeek, calendarType), focusedWeek.getFullYear())\n )\n );\n };\n\n const t = useI18n();\n\n const weekText = t('week_label_a11y');\n\n const weeks = getWeeksOfMonth(current, calendarType).map(weekNo => {\n const dateOfISOWeek = getDateOfISOWeek(weekNo, current.getUTCFullYear());\n return (\n <StyledWeekNumber\n key={weekNo}\n variant='simple'\n icon={false}\n type='button'\n loading={false}\n ref={\n isFocused(dateOfISOWeek)\n ? (focusedRef: HTMLButtonElement) => {\n if (hasFocus) focusedRef?.focus();\n }\n : undefined\n }\n tabIndex={isFocused(dateOfISOWeek) ? 0 : -1}\n disabled={isDisabled(dateOfISOWeek)}\n aria-selected={isChecked(dateOfISOWeek) || undefined}\n aria-label={`${t('week_label_a11y')} ${weekNo.toString()} ${current\n .getUTCFullYear()\n .toString()}`}\n onClick={() => {\n onSelect?.(dateOfISOWeek);\n }}\n >\n {size === 'long' && `${weekText} `}\n {weekNo.toString()}\n </StyledWeekNumber>\n );\n });\n\n const label =\n size === 'short' ? (\n <Text as={StyledColumnLabel} forwardedAs='abbr' title={weekText}>\n {t('week_text_short')}\n </Text>\n ) : (\n <Text as={StyledColumnLabel}>{weekText}</Text>\n );\n\n return (\n <Flex\n as={StyledWeekNumbers}\n container={{ direction: 'column' }}\n ref={containerRef}\n onKeyDown={onKeyDown}\n >\n {label}\n {weeks}\n </Flex>\n );\n }\n);\n\nexport default Weeks;\n"]}
@@ -1,4 +1,5 @@
1
1
  export declare const getLocalizedDays: (calendarType: string, localeTag?: string | undefined) => string[][];
2
+ export declare const isValidDate: (date: Date) => boolean;
2
3
  export declare const getDaysOfMonth: (date: Date, calendarType: string) => Date[];
3
4
  export declare const getWeeksOfMonth: (date: Date, calendarType: string) => number[];
4
5
  export declare const getNextMonth: (date: Date) => number;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,iBAAkB,MAAM,+CAOpD,CAAC;AAEF,eAAO,MAAM,cAAc,SAAU,IAAI,gBAAgB,MAAM,KAAG,IAAI,EAQrE,CAAC;AAEF,eAAO,MAAM,eAAe,SAAU,IAAI,gBAAgB,MAAM,KAAG,MAAM,EAmBxE,CAAC;AAEF,eAAO,MAAM,YAAY,SAAU,IAAI,WAGtC,CAAC;AAEF,eAAO,MAAM,gBAAgB,SAAU,IAAI,WAG1C,CAAC;AAIF,wBAAiB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,kCAMrD"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,iBAAkB,MAAM,+CAOpD,CAAC;AAEF,eAAO,MAAM,WAAW,SAAU,IAAI,YAErC,CAAC;AAEF,eAAO,MAAM,cAAc,SAAU,IAAI,gBAAgB,MAAM,KAAG,IAAI,EAQrE,CAAC;AAEF,eAAO,MAAM,eAAe,SAAU,IAAI,gBAAgB,MAAM,KAAG,MAAM,EAmBxE,CAAC;AAEF,eAAO,MAAM,YAAY,SAAU,IAAI,WAGtC,CAAC;AAEF,eAAO,MAAM,gBAAgB,SAAU,IAAI,WAG1C,CAAC;AAIF,wBAAiB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,kCAMrD"}
@@ -8,6 +8,9 @@ export const getLocalizedDays = (calendarType, localeTag) => {
8
8
  ];
9
9
  });
10
10
  };
11
+ export const isValidDate = (date) => {
12
+ return date.toString() !== 'Invalid Date';
13
+ };
11
14
  export const getDaysOfMonth = (date, calendarType) => {
12
15
  const firstDayInMonth = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1));
13
16
  const startingWeekDay = getDayOfWeek(firstDayInMonth, calendarType);
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,YAAoB,EAAE,SAAkB,EAAE,EAAE;IAC3E,OAAO,WAAW,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;QACjD,OAAO;YACL,GAAG,CAAC,WAAW,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;YAC/D,GAAG,CAAC,WAAW,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;SACjE,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAU,EAAE,YAAoB,EAAU,EAAE;IACzE,MAAM,eAAe,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACzF,MAAM,eAAe,GAAG,YAAY,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;IAEpE,4BAA4B;IAC5B,OAAO,KAAK,CAAC,CAAC,GAAG,eAAe,EAAE,EAAE,GAAG,eAAe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,WAAW,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClF,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;AAC5B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAAE,EAAE;IAC7C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClF,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;AAC5B,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAErC,MAAM,SAAS,CAAC,CAAC,oBAAoB,CAAC,QAAgB;IACpD,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5B,OAAO,OAAO,CAAC,OAAO,EAAE,GAAG,mBAAmB,EAAE;QAC9C,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,CAAC;KAC/C;AACH,CAAC","sourcesContent":["import { cap, range } from '../../../utils';\nimport { getDayOfWeek, getWeek, getWeekdays } from '../Input/utils';\n\nexport const getLocalizedDays = (calendarType: string, localeTag?: string) => {\n return getWeekdays(calendarType).map(weekdayDate => {\n return [\n cap(weekdayDate.toLocaleString(localeTag, { weekday: 'long' })),\n cap(weekdayDate.toLocaleString(localeTag, { weekday: 'short' }))\n ];\n });\n};\n\nexport const getDaysOfMonth = (date: Date, calendarType: string): Date[] => {\n const firstDayInMonth = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1));\n const startingWeekDay = getDayOfWeek(firstDayInMonth, calendarType);\n\n /** 6 rows * 7 days = 42 */\n return range(1 - startingWeekDay, 42 - startingWeekDay).map((day: number) => {\n return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), day));\n });\n};\n\nexport const getWeeksOfMonth = (date: Date, calendarType: string): number[] => {\n const weekdays = [];\n const year = date.getUTCFullYear();\n const month = date.getUTCMonth();\n const dayInLastWeek = new Date(Date.UTC(year, month, 36));\n const lastWeek = getWeek(dayInLastWeek, calendarType);\n\n let day;\n let currentWeek;\n let iterator = 1;\n\n do {\n day = new Date(Date.UTC(year, month, iterator));\n currentWeek = getWeek(day, calendarType);\n weekdays.push(currentWeek);\n iterator += 7;\n } while (currentWeek !== lastWeek);\n\n return weekdays;\n};\n\nexport const getNextMonth = (date: Date) => {\n const next = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + 1, 1));\n return next.getUTCMonth();\n};\n\nexport const getPreviousMonth = (date: Date) => {\n const prev = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() - 1, 1));\n return prev.getUTCMonth();\n};\n\nconst DAY_IN_MILLISECONDS = 86400000;\n\nexport function* getIntervalGenerator(interval: number) {\n const current = new Date(0);\n while (current.getTime() < DAY_IN_MILLISECONDS) {\n yield new Date(current);\n current.setTime(current.getTime() + interval);\n }\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,YAAoB,EAAE,SAAkB,EAAE,EAAE;IAC3E,OAAO,WAAW,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;QACjD,OAAO;YACL,GAAG,CAAC,WAAW,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;YAC/D,GAAG,CAAC,WAAW,CAAC,cAAc,C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QAC9C,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,CAAC;KAC/C;AACH,CAAC","sourcesContent":["import { cap, range } from '../../../utils';\nimport { getDayOfWeek, getWeek, getWeekdays } from '../Input/utils';\n\nexport const getLocalizedDays = (calendarType: string, localeTag?: string) => {\n return getWeekdays(calendarType).map(weekdayDate => {\n return [\n cap(weekdayDate.toLocaleString(localeTag, { weekday: 'long' })),\n cap(weekdayDate.toLocaleString(localeTag, { weekday: 'short' }))\n ];\n });\n};\n\nexport const isValidDate = (date: Date) => {\n return date.toString() !== 'Invalid Date';\n};\n\nexport const getDaysOfMonth = (date: Date, calendarType: string): Date[] => {\n const firstDayInMonth = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1));\n const startingWeekDay = getDayOfWeek(firstDayInMonth, calendarType);\n\n /** 6 rows * 7 days = 42 */\n return range(1 - startingWeekDay, 42 - startingWeekDay).map((day: number) => {\n return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), day));\n });\n};\n\nexport const getWeeksOfMonth = (date: Date, calendarType: string): number[] => {\n const weekdays = [];\n const year = date.getUTCFullYear();\n const month = date.getUTCMonth();\n const dayInLastWeek = new Date(Date.UTC(year, month, 36));\n const lastWeek = getWeek(dayInLastWeek, calendarType);\n\n let day;\n let currentWeek;\n let iterator = 1;\n\n do {\n day = new Date(Date.UTC(year, month, iterator));\n currentWeek = getWeek(day, calendarType);\n weekdays.push(currentWeek);\n iterator += 7;\n } while (currentWeek !== lastWeek);\n\n return weekdays;\n};\n\nexport const getNextMonth = (date: Date) => {\n const next = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + 1, 1));\n return next.getUTCMonth();\n};\n\nexport const getPreviousMonth = (date: Date) => {\n const prev = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() - 1, 1));\n return prev.getUTCMonth();\n};\n\nconst DAY_IN_MILLISECONDS = 86400000;\n\nexport function* getIntervalGenerator(interval: number) {\n const current = new Date(0);\n while (current.getTime() < DAY_IN_MILLISECONDS) {\n yield new Date(current);\n current.setTime(current.getTime() + interval);\n }\n}\n"]}
@@ -14,6 +14,8 @@ export { default as DateTimeInput } from './Input/DateTimeInput';
14
14
  export type { DateTimeInputProps } from './Input/DateTimeInput';
15
15
  export { default as DayOfWeekInput } from './Input/DayOfWeekInput';
16
16
  export type { DayOfWeekInputProps } from './Input/DayOfWeekInput';
17
+ export { default as QuarterInput } from './Input/QuarterInput';
18
+ export type { QuarterInputProps } from './Input/QuarterInput';
17
19
  export { default as TimePicker } from './Picker/TimePicker';
18
20
  export type { TimePickerProps } from './Picker/TimePicker';
19
21
  export { default as DatePicker } from './Picker/DatePicker';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC1E,YAA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
  export { default as DateTimeInput } from './Input/DateTimeInput';
8
8
  export { default as DayOfWeekInput } from './Input/DayOfWeekInput';
9
+ export { default as QuarterInput } from './Input/QuarterInput';
9
10
  export { default as TimePicker } from './Picker/TimePicker';
10
11
  export { default as DatePicker } from './Picker/DatePicker';
11
12
  export { default as DateTimeDisplay } from './DateTimeDisplay';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DateTime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { default as DateInput } from './Input/DateInput';\nexport type { DateInputProps } from './Input/DateInput';\nexport { default as WeekInput } from './Input/WeekInput';\nexport type { WeekInputProps } from './Input/WeekInput';\nexport { default as MonthInput } from './Input/MonthInput';\nexport type { MonthInputProps } from './Input/MonthInput';\nexport { default as TimeInput } from './Input/TimeInput';\nexport type { TimeInputProps } from './Input/TimeInput';\nexport { default as DateRangeInput } from './Input/DateRangeInput';\nexport type { DateRangeInputProps } from './Input/DateRangeInput';\nexport { default as DurationInput } from './Input/Duration/DurationInput';\nexport type { default as DurationInputProps } from './Input/Duration/DurationInput.types';\nexport { default as DateTimeInput } from './Input/DateTimeInput';\nexport type { DateTimeInputProps } from './Input/DateTimeInput';\nexport { default as DayOfWeekInput } from './Input/DayOfWeekInput';\nexport type { DayOfWeekInputProps } from './Input/DayOfWeekInput';\n\nexport { default as TimePicker } from './Picker/TimePicker';\nexport type { TimePickerProps } from './Picker/TimePicker';\nexport { default as DatePicker } from './Picker/DatePicker';\nexport type { default as DatePickerProps } from './Picker/DatePicker.types';\n\nexport { default as DateTimeDisplay } from './DateTimeDisplay';\nexport type { DateTimeDisplayProps } from './DateTimeDisplay';\nexport { default as DurationDisplay } from './DurationDisplay';\nexport type { DurationDisplayProps } from './DurationDisplay';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DateTime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAG/D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { default as DateInput } from './Input/DateInput';\nexport type { DateInputProps } from './Input/DateInput';\nexport { default as WeekInput } from './Input/WeekInput';\nexport type { WeekInputProps } from './Input/WeekInput';\nexport { default as MonthInput } from './Input/MonthInput';\nexport type { MonthInputProps } from './Input/MonthInput';\nexport { default as TimeInput } from './Input/TimeInput';\nexport type { TimeInputProps } from './Input/TimeInput';\nexport { default as DateRangeInput } from './Input/DateRangeInput';\nexport type { DateRangeInputProps } from './Input/DateRangeInput';\nexport { default as DurationInput } from './Input/Duration/DurationInput';\nexport type { default as DurationInputProps } from './Input/Duration/DurationInput.types';\nexport { default as DateTimeInput } from './Input/DateTimeInput';\nexport type { DateTimeInputProps } from './Input/DateTimeInput';\nexport { default as DayOfWeekInput } from './Input/DayOfWeekInput';\nexport type { DayOfWeekInputProps } from './Input/DayOfWeekInput';\nexport { default as QuarterInput } from './Input/QuarterInput';\nexport type { QuarterInputProps } from './Input/QuarterInput';\n\nexport { default as TimePicker } from './Picker/TimePicker';\nexport type { TimePickerProps } from './Picker/TimePicker';\nexport { default as DatePicker } from './Picker/DatePicker';\nexport type { default as DatePickerProps } from './Picker/DatePicker.types';\n\nexport { default as DateTimeDisplay } from './DateTimeDisplay';\nexport type { DateTimeDisplayProps } from './DateTimeDisplay';\nexport { default as DurationDisplay } from './DurationDisplay';\nexport type { DurationDisplayProps } from './DurationDisplay';\n"]}
@@ -43,23 +43,23 @@ const Drawer = forwardRef((props, ref) => {
43
43
  prevState = state;
44
44
  useOuterEvent('mousedown', [drawerRef.current], useCallback(() => {
45
45
  if (open)
46
- onOuterClick === null || onOuterClick === void 0 ? void 0 : onOuterClick();
46
+ onOuterClick?.();
47
47
  }, [open, onOuterClick]));
48
48
  useEffect(() => {
49
49
  if (open && (state === 'closed' || state === 'closing')) {
50
- onBeforeOpen === null || onBeforeOpen === void 0 ? void 0 : onBeforeOpen();
50
+ onBeforeOpen?.();
51
51
  reflow(drawerRef.current);
52
52
  setState('opening');
53
53
  }
54
54
  else if (!open && (state === 'open' || state === 'opening')) {
55
- onBeforeClose === null || onBeforeClose === void 0 ? void 0 : onBeforeClose();
55
+ onBeforeClose?.();
56
56
  setState('closing');
57
57
  }
58
58
  else if (open && state === 'open' && prevState !== 'open') {
59
- onAfterOpen === null || onAfterOpen === void 0 ? void 0 : onAfterOpen();
59
+ onAfterOpen?.();
60
60
  }
61
61
  else if (!open && state === 'closed' && prevState !== 'closed') {
62
- onAfterClose === null || onAfterClose === void 0 ? void 0 : onAfterClose();
62
+ onAfterClose?.();
63
63
  }
64
64
  }, [open, state, prevState, onBeforeOpen, onBeforeClose, onAfterOpen, onAfterClose]);
65
65
  const onTransitionEnd = useCallback((e) => {
@@ -67,7 +67,7 @@ const Drawer = forwardRef((props, ref) => {
67
67
  return;
68
68
  setState(open ? 'open' : 'closed');
69
69
  }, [open]);
70
- return state === 'closed' && !open && nullWhenClosed ? null : (_jsx(StyledDrawer, Object.assign({ ref: drawerRef, position: position, shadow: shadow && open, transitionSpeed: transitionSpeed, placement: placement, size: size, open: open, state: state, onTransitionEnd: onTransitionEnd }, restProps, { children: children }), void 0));
70
+ return state === 'closed' && !open && nullWhenClosed ? null : (_jsx(StyledDrawer, { ref: drawerRef, position: position, shadow: shadow && open, transitionSpeed: transitionSpeed, placement: placement, size: size, open: open, state: state, onTransitionEnd: onTransitionEnd, ...restProps, children: children }, void 0));
71
71
  });
72
72
  export default Drawer;
73
73
  //# sourceMappingURL=Drawer.js.map