@salutejs/plasma-new-hope 0.76.2-canary.1180.8704132147.0 → 0.76.2-canary.1184.8705168480.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (357) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -1
  2. package/cjs/components/Avatar/Avatar.js +1 -15
  3. package/cjs/components/Avatar/Avatar.js.map +1 -1
  4. package/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  5. package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  6. package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  7. package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
  8. package/cjs/components/Calendar/hoc/withRange.js +1 -1
  9. package/cjs/components/Calendar/hoc/withRange.js.map +1 -1
  10. package/cjs/components/Calendar/hooks/useKeyNavigation.js +19 -19
  11. package/cjs/components/Calendar/hooks/useKeyNavigation.js.map +1 -1
  12. package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +3 -3
  13. package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
  14. package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +2 -2
  15. package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
  16. package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
  17. package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
  18. package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
  19. package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
  20. package/cjs/components/Chip/Chip.js +2 -2
  21. package/cjs/components/Chip/Chip.js.map +1 -1
  22. package/cjs/components/Combobox/Combobox.js +5 -5
  23. package/cjs/components/Combobox/Combobox.js.map +1 -1
  24. package/cjs/components/Combobox/hooks/useFocusController.js +9 -9
  25. package/cjs/components/Combobox/hooks/useFocusController.js.map +1 -1
  26. package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  27. package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js.map +1 -1
  28. package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  29. package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js.map +1 -1
  30. package/cjs/components/Drawer/DrawerContext.js +1 -1
  31. package/cjs/components/Drawer/DrawerContext.js.map +1 -1
  32. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -2
  33. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  34. package/cjs/components/Modal/ModalContext.js +1 -1
  35. package/cjs/components/Modal/ModalContext.js.map +1 -1
  36. package/cjs/components/Overlay/Overlay.js +1 -1
  37. package/cjs/components/Overlay/Overlay.js.map +1 -1
  38. package/cjs/components/Pagination/Pagination.js +2 -2
  39. package/cjs/components/Pagination/Pagination.js.map +1 -1
  40. package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  41. package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js.map +1 -1
  42. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  43. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  44. package/cjs/components/Popover/Popover.js +7 -7
  45. package/cjs/components/Popover/Popover.js.map +1 -1
  46. package/cjs/components/Popup/Popup.js +1 -1
  47. package/cjs/components/Popup/Popup.js.map +1 -1
  48. package/cjs/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  49. package/cjs/components/Segment/ui/SegmentItem/SegmentItem.js.map +1 -1
  50. package/cjs/components/Select/Select.js +5 -5
  51. package/cjs/components/Select/Select.js.map +1 -1
  52. package/cjs/components/Select/hooks/useKeyNavigation.js +12 -12
  53. package/cjs/components/Select/hooks/useKeyNavigation.js.map +1 -1
  54. package/cjs/components/Select/ui/SelectChip/SelectChip.js +1 -1
  55. package/cjs/components/Select/ui/SelectChip/SelectChip.js.map +1 -1
  56. package/cjs/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  57. package/cjs/components/Select/ui/SelectTarget/SelectTarget.js.map +1 -1
  58. package/cjs/components/Select/utils/index.js +2 -2
  59. package/cjs/components/Select/utils/index.js.map +1 -1
  60. package/cjs/components/Tabs/TabsContext.js +1 -2
  61. package/cjs/components/Tabs/TabsContext.js.map +1 -1
  62. package/cjs/components/Tabs/ui/TabItem/TabItem.js +1 -1
  63. package/cjs/components/Tabs/ui/TabItem/TabItem.js.map +1 -1
  64. package/cjs/components/Tabs/ui/Tabs/Tabs.js +2 -2
  65. package/cjs/components/Tabs/ui/Tabs/Tabs.js.map +1 -1
  66. package/cjs/components/TextArea/TextArea.js +1 -1
  67. package/cjs/components/TextArea/TextArea.js.map +1 -1
  68. package/cjs/components/TextField/TextField.js +2 -2
  69. package/cjs/components/TextField/TextField.js.map +1 -1
  70. package/cjs/components/TextField/hooks/useKeyNavigation.js +9 -9
  71. package/cjs/components/TextField/hooks/useKeyNavigation.js.map +1 -1
  72. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  73. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
  74. package/cjs/components/Toast/ToastProvider/ToastProvider.js +2 -2
  75. package/cjs/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
  76. package/cjs/components/Tooltip/Tooltip.js +1 -1
  77. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  78. package/es/_virtual/_rollupPluginBabelHelpers.js +1 -1
  79. package/es/components/Avatar/Avatar.js +1 -15
  80. package/es/components/Avatar/Avatar.js.map +1 -1
  81. package/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  82. package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  83. package/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  84. package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
  85. package/es/components/Calendar/hoc/withRange.js +1 -1
  86. package/es/components/Calendar/hoc/withRange.js.map +1 -1
  87. package/es/components/Calendar/hooks/useKeyNavigation.js +19 -19
  88. package/es/components/Calendar/hooks/useKeyNavigation.js.map +1 -1
  89. package/es/components/Calendar/ui/CalendarDays/CalendarDays.js +3 -3
  90. package/es/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
  91. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +2 -2
  92. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
  93. package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
  94. package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
  95. package/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
  96. package/es/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
  97. package/es/components/Chip/Chip.js +2 -2
  98. package/es/components/Chip/Chip.js.map +1 -1
  99. package/es/components/Combobox/Combobox.js +5 -5
  100. package/es/components/Combobox/Combobox.js.map +1 -1
  101. package/es/components/Combobox/hooks/useFocusController.js +9 -9
  102. package/es/components/Combobox/hooks/useFocusController.js.map +1 -1
  103. package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  104. package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js.map +1 -1
  105. package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  106. package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js.map +1 -1
  107. package/es/components/Drawer/DrawerContext.js +1 -1
  108. package/es/components/Drawer/DrawerContext.js.map +1 -1
  109. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -2
  110. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  111. package/es/components/Modal/ModalContext.js +1 -1
  112. package/es/components/Modal/ModalContext.js.map +1 -1
  113. package/es/components/Overlay/Overlay.js +1 -1
  114. package/es/components/Overlay/Overlay.js.map +1 -1
  115. package/es/components/Pagination/Pagination.js +2 -2
  116. package/es/components/Pagination/Pagination.js.map +1 -1
  117. package/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  118. package/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js.map +1 -1
  119. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  120. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  121. package/es/components/Popover/Popover.js +7 -7
  122. package/es/components/Popover/Popover.js.map +1 -1
  123. package/es/components/Popup/Popup.js +1 -1
  124. package/es/components/Popup/Popup.js.map +1 -1
  125. package/es/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  126. package/es/components/Segment/ui/SegmentItem/SegmentItem.js.map +1 -1
  127. package/es/components/Select/Select.js +5 -5
  128. package/es/components/Select/Select.js.map +1 -1
  129. package/es/components/Select/hooks/useKeyNavigation.js +12 -12
  130. package/es/components/Select/hooks/useKeyNavigation.js.map +1 -1
  131. package/es/components/Select/ui/SelectChip/SelectChip.js +1 -1
  132. package/es/components/Select/ui/SelectChip/SelectChip.js.map +1 -1
  133. package/es/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  134. package/es/components/Select/ui/SelectTarget/SelectTarget.js.map +1 -1
  135. package/es/components/Select/utils/index.js +2 -2
  136. package/es/components/Select/utils/index.js.map +1 -1
  137. package/es/components/Tabs/TabsContext.js +1 -2
  138. package/es/components/Tabs/TabsContext.js.map +1 -1
  139. package/es/components/Tabs/ui/TabItem/TabItem.js +1 -1
  140. package/es/components/Tabs/ui/TabItem/TabItem.js.map +1 -1
  141. package/es/components/Tabs/ui/Tabs/Tabs.js +2 -2
  142. package/es/components/Tabs/ui/Tabs/Tabs.js.map +1 -1
  143. package/es/components/TextArea/TextArea.js +1 -1
  144. package/es/components/TextArea/TextArea.js.map +1 -1
  145. package/es/components/TextField/TextField.js +2 -2
  146. package/es/components/TextField/TextField.js.map +1 -1
  147. package/es/components/TextField/hooks/useKeyNavigation.js +9 -9
  148. package/es/components/TextField/hooks/useKeyNavigation.js.map +1 -1
  149. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  150. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
  151. package/es/components/Toast/ToastProvider/ToastProvider.js +2 -2
  152. package/es/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
  153. package/es/components/Tooltip/Tooltip.js +1 -1
  154. package/es/components/Tooltip/Tooltip.js.map +1 -1
  155. package/package.json +10 -10
  156. package/styled-components/cjs/components/Avatar/Avatar.js +2 -16
  157. package/styled-components/cjs/components/Avatar/Avatar.styles.js +1 -1
  158. package/styled-components/cjs/components/AvatarGroup/AvatarGroup.js +1 -1
  159. package/styled-components/cjs/components/Badge/Badge.js +1 -1
  160. package/styled-components/cjs/components/Badge/Badge.styles.js +1 -1
  161. package/styled-components/cjs/components/Button/Button.js +2 -2
  162. package/styled-components/cjs/components/Button/Button.styles.js +1 -1
  163. package/styled-components/cjs/components/ButtonGroup/ButtonGroup.js +1 -1
  164. package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +2 -2
  165. package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.styles.js +1 -1
  166. package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +2 -2
  167. package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.styles.js +1 -1
  168. package/styled-components/cjs/components/Calendar/hoc/withRange.js +2 -2
  169. package/styled-components/cjs/components/Calendar/hooks/useKeyNavigation.js +20 -20
  170. package/styled-components/cjs/components/Calendar/store/reducer.js +1 -1
  171. package/styled-components/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.js +1 -1
  172. package/styled-components/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +4 -4
  173. package/styled-components/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
  174. package/styled-components/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +2 -2
  175. package/styled-components/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +2 -2
  176. package/styled-components/cjs/components/Cell/Cell.js +1 -1
  177. package/styled-components/cjs/components/Cell/Cell.styles.js +1 -1
  178. package/styled-components/cjs/components/Checkbox/Checkbox.js +1 -1
  179. package/styled-components/cjs/components/Chip/Chip.js +3 -3
  180. package/styled-components/cjs/components/Chip/Chip.styles.js +1 -1
  181. package/styled-components/cjs/components/Combobox/Combobox.js +6 -6
  182. package/styled-components/cjs/components/Combobox/hooks/useFocusController.js +9 -9
  183. package/styled-components/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js +2 -2
  184. package/styled-components/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +7 -7
  185. package/styled-components/cjs/components/Counter/Counter.js +1 -1
  186. package/styled-components/cjs/components/Divider/Divider.js +2 -2
  187. package/styled-components/cjs/components/Drawer/Drawer.js +1 -1
  188. package/styled-components/cjs/components/Drawer/DrawerContext.js +1 -1
  189. package/styled-components/cjs/components/Drawer/hooks/useDrawer.js +1 -1
  190. package/styled-components/cjs/components/Drawer/ui/DrawerContent/DrawerContent.js +1 -1
  191. package/styled-components/cjs/components/Drawer/ui/DrawerFooter/DrawerFooter.js +1 -1
  192. package/styled-components/cjs/components/Drawer/ui/DrawerHeader/DrawerHeader.js +1 -1
  193. package/styled-components/cjs/components/Dropdown/Dropdown.js +1 -1
  194. package/styled-components/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +1 -1
  195. package/styled-components/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +1 -1
  196. package/styled-components/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +1 -1
  197. package/styled-components/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +1 -1
  198. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +4 -4
  199. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +1 -1
  200. package/styled-components/cjs/components/Dropdown/utils/index.js +1 -1
  201. package/styled-components/cjs/components/Grid/Grid.js +2 -2
  202. package/styled-components/cjs/components/Grid/ui/Col/Col.js +2 -2
  203. package/styled-components/cjs/components/Grid/ui/Row/Row.js +1 -1
  204. package/styled-components/cjs/components/Grid/utils/index.js +1 -1
  205. package/styled-components/cjs/components/Header/HeaderRoot/HeaderRoot.js +1 -1
  206. package/styled-components/cjs/components/Header/ui/HeaderArrow/HeaderArrow.js +1 -1
  207. package/styled-components/cjs/components/Header/ui/HeaderLogo/HeaderLogo.js +1 -1
  208. package/styled-components/cjs/components/Header/ui/HeaderTitleWrapper/HeaderTitleWrapper.js +1 -1
  209. package/styled-components/cjs/components/Image/Image.js +2 -2
  210. package/styled-components/cjs/components/Image/Image.styles.js +1 -1
  211. package/styled-components/cjs/components/Indicator/Indicator.js +1 -1
  212. package/styled-components/cjs/components/Link/Link.js +1 -1
  213. package/styled-components/cjs/components/Modal/Modal.js +1 -1
  214. package/styled-components/cjs/components/Modal/ModalContext.js +1 -1
  215. package/styled-components/cjs/components/Modal/hooks/useModal.js +1 -1
  216. package/styled-components/cjs/components/Notification/Notification.js +1 -1
  217. package/styled-components/cjs/components/Notification/Notification.styles.js +1 -1
  218. package/styled-components/cjs/components/Notification/NotificationsPortal.js +1 -1
  219. package/styled-components/cjs/components/Notification/NotificationsStore.js +1 -1
  220. package/styled-components/cjs/components/Overlay/Overlay.js +2 -2
  221. package/styled-components/cjs/components/Pagination/Pagination.js +3 -3
  222. package/styled-components/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +2 -2
  223. package/styled-components/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  224. package/styled-components/cjs/components/Panel/Panel.js +2 -2
  225. package/styled-components/cjs/components/Panel/ui/PanelContent/PanelContent.js +1 -1
  226. package/styled-components/cjs/components/Panel/ui/PanelFooter/PanelFooter.js +1 -1
  227. package/styled-components/cjs/components/Panel/ui/PanelHeader/PanelHeader.js +1 -1
  228. package/styled-components/cjs/components/Popover/Popover.js +9 -9
  229. package/styled-components/cjs/components/Popup/Popup.js +2 -2
  230. package/styled-components/cjs/components/Popup/PopupContext.js +1 -1
  231. package/styled-components/cjs/components/Popup/PopupRoot.js +1 -1
  232. package/styled-components/cjs/components/Popup/hooks/usePopup.js +1 -1
  233. package/styled-components/cjs/components/Progress/Progress.js +1 -1
  234. package/styled-components/cjs/components/Progress/Progress.styles.js +1 -1
  235. package/styled-components/cjs/components/Radiobox/Radiobox.js +1 -1
  236. package/styled-components/cjs/components/SSRProvider/SSRProvider.js +1 -1
  237. package/styled-components/cjs/components/Segment/SegmentProvider/SegmentProvider.js +1 -1
  238. package/styled-components/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js +1 -1
  239. package/styled-components/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.styles.js +1 -1
  240. package/styled-components/cjs/components/Segment/ui/SegmentItem/SegmentItem.js +3 -3
  241. package/styled-components/cjs/components/Segment/ui/SegmentItem/SegmentItem.styles.js +1 -1
  242. package/styled-components/cjs/components/Select/Select.js +6 -6
  243. package/styled-components/cjs/components/Select/hooks/useKeyNavigation.js +12 -12
  244. package/styled-components/cjs/components/Select/ui/SelectChip/SelectChip.js +2 -2
  245. package/styled-components/cjs/components/Select/ui/SelectTarget/SelectTarget.js +3 -3
  246. package/styled-components/cjs/components/Select/utils/index.js +3 -3
  247. package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +1 -1
  248. package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +1 -1
  249. package/styled-components/cjs/components/Skeleton/RectSkeleton/RectSkeleton.js +1 -1
  250. package/styled-components/cjs/components/Skeleton/TextSkeleton/TextSkeleton.js +2 -2
  251. package/styled-components/cjs/components/Skeleton/hoc/withSkeleton.js +1 -1
  252. package/styled-components/cjs/components/Spinner/Spinner.js +1 -1
  253. package/styled-components/cjs/components/Spinner/Spinner.styles.js +1 -1
  254. package/styled-components/cjs/components/Spinner/utils/index.js +1 -1
  255. package/styled-components/cjs/components/Switch/Switch.js +1 -1
  256. package/styled-components/cjs/components/Tabs/TabsContext.js +2 -3
  257. package/styled-components/cjs/components/Tabs/createTabsController.js +1 -1
  258. package/styled-components/cjs/components/Tabs/ui/TabItem/TabItem.js +2 -2
  259. package/styled-components/cjs/components/Tabs/ui/TabItem/TabItem.styles.js +1 -1
  260. package/styled-components/cjs/components/Tabs/ui/Tabs/Tabs.js +3 -3
  261. package/styled-components/cjs/components/Tabs/ui/Tabs/Tabs.styles.js +1 -1
  262. package/styled-components/cjs/components/TextArea/TextArea.js +2 -2
  263. package/styled-components/cjs/components/TextField/TextField.js +3 -3
  264. package/styled-components/cjs/components/TextField/hooks/useKeyNavigation.js +9 -9
  265. package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +2 -2
  266. package/styled-components/cjs/components/Toast/Toast.js +2 -2
  267. package/styled-components/cjs/components/Toast/Toast.styles.js +1 -1
  268. package/styled-components/cjs/components/Toast/ToastController.js +2 -2
  269. package/styled-components/cjs/components/Toast/ToastProvider/ToastProvider.js +3 -3
  270. package/styled-components/cjs/components/Toolbar/Toolbar.js +1 -1
  271. package/styled-components/cjs/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
  272. package/styled-components/cjs/components/Tooltip/Tooltip.js +2 -2
  273. package/styled-components/cjs/components/Typography/Old/Subtitle/Subtitle.js +2 -2
  274. package/styled-components/cjs/components/Typography/Old/TypographyOld.js +2 -2
  275. package/styled-components/cjs/components/Typography/Typography.js +2 -2
  276. package/styled-components/cjs/engines/common.js +1 -1
  277. package/styled-components/cjs/engines/styled-components.js +1 -1
  278. package/styled-components/cjs/examples/_helpers.js +1 -1
  279. package/styled-components/cjs/examples/plasma_b2c/components/Avatar/Avatar.stories.tsx +0 -1
  280. package/styled-components/cjs/examples/plasma_b2c/components/AvatarGroup/AvatarGroup.stories.tsx +18 -36
  281. package/styled-components/cjs/examples/plasma_b2c/components/Grid/Grid.config.js +1 -1
  282. package/styled-components/cjs/examples/plasma_web/components/Grid/Grid.config.js +1 -1
  283. package/styled-components/cjs/examples/sds_engineer/components/Grid/Grid.config.js +1 -1
  284. package/styled-components/cjs/mixins/applySpacing.js +1 -1
  285. package/styled-components/cjs/mixins/typography.js +1 -1
  286. package/styled-components/es/components/Avatar/Avatar.js +1 -15
  287. package/styled-components/es/components/Button/Button.js +1 -1
  288. package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  289. package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  290. package/styled-components/es/components/Calendar/hoc/withRange.js +1 -1
  291. package/styled-components/es/components/Calendar/hooks/useKeyNavigation.js +20 -20
  292. package/styled-components/es/components/Calendar/store/reducer.js +1 -1
  293. package/styled-components/es/components/Calendar/ui/CalendarDays/CalendarDays.js +3 -3
  294. package/styled-components/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +2 -2
  295. package/styled-components/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
  296. package/styled-components/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
  297. package/styled-components/es/components/Chip/Chip.js +2 -2
  298. package/styled-components/es/components/Combobox/Combobox.js +5 -5
  299. package/styled-components/es/components/Combobox/hooks/useFocusController.js +9 -9
  300. package/styled-components/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  301. package/styled-components/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  302. package/styled-components/es/components/Divider/Divider.js +1 -1
  303. package/styled-components/es/components/Drawer/DrawerContext.js +1 -1
  304. package/styled-components/es/components/Drawer/hooks/useDrawer.js +1 -1
  305. package/styled-components/es/components/Drawer/ui/DrawerContent/DrawerContent.js +1 -1
  306. package/styled-components/es/components/Drawer/ui/DrawerFooter/DrawerFooter.js +1 -1
  307. package/styled-components/es/components/Drawer/ui/DrawerHeader/DrawerHeader.js +1 -1
  308. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -3
  309. package/styled-components/es/components/Grid/Grid.js +1 -1
  310. package/styled-components/es/components/Grid/ui/Col/Col.js +1 -1
  311. package/styled-components/es/components/Grid/utils/index.js +1 -1
  312. package/styled-components/es/components/Image/Image.js +1 -1
  313. package/styled-components/es/components/Modal/ModalContext.js +1 -1
  314. package/styled-components/es/components/Modal/hooks/useModal.js +1 -1
  315. package/styled-components/es/components/Notification/NotificationsStore.js +1 -1
  316. package/styled-components/es/components/Overlay/Overlay.js +1 -1
  317. package/styled-components/es/components/Pagination/Pagination.js +2 -2
  318. package/styled-components/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  319. package/styled-components/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  320. package/styled-components/es/components/Panel/Panel.js +1 -1
  321. package/styled-components/es/components/Popover/Popover.js +8 -8
  322. package/styled-components/es/components/Popup/Popup.js +1 -1
  323. package/styled-components/es/components/Popup/hooks/usePopup.js +1 -1
  324. package/styled-components/es/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  325. package/styled-components/es/components/Select/Select.js +5 -5
  326. package/styled-components/es/components/Select/hooks/useKeyNavigation.js +12 -12
  327. package/styled-components/es/components/Select/ui/SelectChip/SelectChip.js +1 -1
  328. package/styled-components/es/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  329. package/styled-components/es/components/Select/utils/index.js +3 -3
  330. package/styled-components/es/components/Skeleton/TextSkeleton/TextSkeleton.js +1 -1
  331. package/styled-components/es/components/Skeleton/hoc/withSkeleton.js +1 -1
  332. package/styled-components/es/components/Spinner/utils/index.js +1 -1
  333. package/styled-components/es/components/Tabs/TabsContext.js +2 -3
  334. package/styled-components/es/components/Tabs/ui/TabItem/TabItem.js +1 -1
  335. package/styled-components/es/components/Tabs/ui/Tabs/Tabs.js +2 -2
  336. package/styled-components/es/components/TextArea/TextArea.js +1 -1
  337. package/styled-components/es/components/TextField/TextField.js +2 -2
  338. package/styled-components/es/components/TextField/hooks/useKeyNavigation.js +9 -9
  339. package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  340. package/styled-components/es/components/Toast/Toast.js +1 -1
  341. package/styled-components/es/components/Toast/ToastController.js +1 -1
  342. package/styled-components/es/components/Toast/ToastProvider/ToastProvider.js +2 -2
  343. package/styled-components/es/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
  344. package/styled-components/es/components/Tooltip/Tooltip.js +1 -1
  345. package/styled-components/es/components/Typography/Old/Subtitle/Subtitle.js +1 -1
  346. package/styled-components/es/components/Typography/Old/TypographyOld.js +1 -1
  347. package/styled-components/es/components/Typography/Typography.js +1 -1
  348. package/styled-components/es/engines/common.js +1 -1
  349. package/styled-components/es/examples/_helpers.js +1 -1
  350. package/styled-components/es/examples/plasma_b2c/components/Avatar/Avatar.stories.tsx +0 -1
  351. package/styled-components/es/examples/plasma_b2c/components/AvatarGroup/AvatarGroup.stories.tsx +18 -36
  352. package/styled-components/es/examples/plasma_b2c/components/Grid/Grid.config.js +1 -1
  353. package/styled-components/es/examples/plasma_web/components/Grid/Grid.config.js +1 -1
  354. package/styled-components/es/examples/sds_engineer/components/Grid/Grid.config.js +1 -1
  355. package/styled-components/es/mixins/applySpacing.js +1 -1
  356. package/styled-components/es/mixins/typography.js +1 -1
  357. package/types/components/Avatar/Avatar.d.ts.map +1 -1
@@ -62,7 +62,7 @@ function _toPrimitive(t, r) {
62
62
  }
63
63
  function _toPropertyKey(t) {
64
64
  var i = _toPrimitive(t, "string");
65
- return "symbol" == typeof i ? i : String(i);
65
+ return "symbol" == typeof i ? i : i + "";
66
66
  }
67
67
  function _typeof(o) {
68
68
  "@babel/helpers - typeof";
@@ -16,7 +16,7 @@ var base = require('./variations/_size/base.js');
16
16
  var base$1 = require('./variations/_focused/base.js');
17
17
  var getInitialsForName = require('./utils/getInitialsForName.js');
18
18
 
19
- var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable", "aria-label"];
19
+ var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable"];
20
20
  var getAvatarContent = function getAvatarContent(_ref) {
21
21
  var customText = _ref.customText,
22
22
  url = _ref.url,
@@ -52,10 +52,6 @@ var StyledIndicator = /*#__PURE__*/react.styled(_exp())({
52
52
  "sgw0czr-0": [/*#__PURE__*/_exp5()]
53
53
  }
54
54
  });
55
- var StatusDict = {
56
- active: 'Активен',
57
- inactive: 'Неактивен'
58
- };
59
55
  var avatarRoot = function avatarRoot(Root) {
60
56
  return /*#__PURE__*/React.forwardRef(function (props, ref) {
61
57
  var avatarSize = props.size,
@@ -67,23 +63,14 @@ var avatarRoot = function avatarRoot(Root) {
67
63
  _props$focused = props.focused,
68
64
  focused = _props$focused === void 0 ? true : _props$focused,
69
65
  isScalable = props.isScalable,
70
- ariaLabelProp = props['aria-label'],
71
66
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
72
67
  var initials = React.useMemo(function () {
73
68
  return getInitialsForName.getInitialsForName(name);
74
69
  }, [name]);
75
- var ariaLabel;
76
-
77
- // INFO: есть a11y и есть изображение, поэтому нужно озвучить что на нем: включаем aria-label
78
- if ((rest === null || rest === void 0 ? void 0 : rest.role) === 'button' && url) {
79
- ariaLabel = !ariaLabelProp || ariaLabelProp.trim() === '' ? name : ariaLabelProp;
80
- ariaLabel = status ? "".concat(ariaLabel, ". ").concat(StatusDict[status]) : ariaLabel;
81
- }
82
70
  return /*#__PURE__*/React.createElement(Root, _rollupPluginBabelHelpers.extends({
83
71
  ref: ref,
84
72
  size: avatarSize,
85
73
  className: index.cx(Avatar_tokens.classes.avatarItem, className),
86
- "aria-label": ariaLabel,
87
74
  focused: focused
88
75
  }, rest), /*#__PURE__*/React.createElement(Avatar_styles.Wrapper, {
89
76
  isScalable: isScalable
@@ -93,7 +80,6 @@ var avatarRoot = function avatarRoot(Root) {
93
80
  initials: initials,
94
81
  name: name
95
82
  })), status && /*#__PURE__*/React.createElement(Avatar_styles.StatusIcon, null, /*#__PURE__*/React.createElement(StyledIndicator, {
96
- "aria-label": StatusDict[status],
97
83
  status: status
98
84
  })));
99
85
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, ReactElement } from 'react';\nimport { styled } from '@linaria/react';\n\nimport { RootProps, component, mergeConfig } from '../../engines';\nimport { cx } from '../../utils';\nimport { indicatorConfig, indicatorTokens } from '../Indicator';\n\nimport { classes, tokens } from './Avatar.tokens';\nimport { base, Wrapper, Image, StatusIcon, Text } from './Avatar.styles';\nimport { AvatarProps } from './Avatar.types';\nimport { base as viewCSS } from './variations/_size/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { getInitialsForName } from './utils';\n\nconst getAvatarContent = ({\n customText,\n url,\n initials,\n name,\n}: Omit<AvatarProps, 'size'> & { initials?: string }): ReactElement => {\n if (customText) {\n return <Text>{customText}</Text>;\n }\n\n if (url) {\n return <Image src={url} alt={name} />;\n }\n\n return <Text>{initials}</Text>;\n};\n\nconst mergedConfig = mergeConfig(indicatorConfig);\n\nconst Indicator: React.FunctionComponent<\n React.HTMLAttributes<HTMLDivElement> & { status: AvatarProps['status'] }\n> = component(mergedConfig) as never;\n\nconst StyledIndicator = styled(Indicator)`\n ${indicatorTokens.size}: var(${tokens.statusIconSize});\n ${indicatorTokens.color}: ${({ status }) =>\n status === 'active' ? `var(${tokens.statusOnlineColor})` : `var(${tokens.statusOfflineColor})`}\n`;\n\nconst StatusDict = {\n active: 'Активен',\n inactive: 'Неактивен',\n};\n\nexport const avatarRoot = (Root: RootProps<HTMLDivElement, AvatarProps>) => {\n return forwardRef<HTMLDivElement, AvatarProps>((props, ref) => {\n const {\n size: avatarSize,\n name,\n url,\n customText,\n status,\n className,\n focused = true,\n isScalable,\n 'aria-label': ariaLabelProp,\n ...rest\n } = props;\n\n const initials = useMemo(() => getInitialsForName(name), [name]);\n let ariaLabel;\n\n // INFO: есть a11y и есть изображение, поэтому нужно озвучить что на нем: включаем aria-label\n if (rest?.role === 'button' && url) {\n ariaLabel = !ariaLabelProp || ariaLabelProp.trim() === '' ? name : ariaLabelProp;\n ariaLabel = status ? `${ariaLabel}. ${StatusDict[status]}` : ariaLabel;\n }\n\n return (\n <Root\n ref={ref}\n size={avatarSize}\n className={cx(classes.avatarItem, className)}\n aria-label={ariaLabel}\n focused={focused}\n {...rest}\n >\n <Wrapper isScalable={isScalable}>{getAvatarContent({ customText, url, initials, name })}</Wrapper>\n\n {status && (\n <StatusIcon>\n <StyledIndicator aria-label={StatusDict[status]} status={status} />\n </StatusIcon>\n )}\n </Root>\n );\n });\n};\n\nexport const avatarConfig = {\n name: 'Avatar',\n tag: 'div',\n layout: avatarRoot,\n base,\n variations: {\n size: {\n css: viewCSS,\n },\n focused: {\n css: focusedCSS,\n },\n },\n defaults: {\n size: 'm',\n },\n};\n"],"names":["getAvatarContent","_ref","customText","url","initials","name","React","createElement","Text","Image","src","alt","mergedConfig","mergeConfig","indicatorConfig","Indicator","component","_exp","_exp5","_ref2","status","concat","tokens","statusOnlineColor","statusOfflineColor","StyledIndicator","styled","class","propsAsIs","vars","StatusDict","active","inactive","avatarRoot","Root","forwardRef","props","ref","avatarSize","size","className","_props$focused","focused","isScalable","ariaLabelProp","rest","_excluded","useMemo","getInitialsForName","ariaLabel","role","trim","_extends","cx","classes","avatarItem","Wrapper","StatusIcon","avatarConfig","tag","layout","base","variations","css","viewCSS","focusedCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;AAcA,IAAMA,gBAAgB,GAAGA,SAAnBA,gBAAgBA,CAAAC,IAAA,EAKiD;AAAA,EAAA,IAJnEC,UAAU,GAAAD,IAAA,CAAVC,UAAU;IACVC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,IAAAA,GAAAA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IAAI,EAAJA,kBAAI;AACJC,EAAAA,UAAU,EAAE;AACRvB,IAAAA,IAAI,EAAE;AACFwB,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDtB,IAAAA,OAAO,EAAE;AACLqB,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN3B,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
1
+ {"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, ReactElement } from 'react';\nimport { styled } from '@linaria/react';\n\nimport { RootProps, component, mergeConfig } from '../../engines';\nimport { cx } from '../../utils';\nimport { indicatorConfig, indicatorTokens } from '../Indicator';\n\nimport { classes, tokens } from './Avatar.tokens';\nimport { base, Wrapper, Image, StatusIcon, Text } from './Avatar.styles';\nimport { AvatarProps } from './Avatar.types';\nimport { base as viewCSS } from './variations/_size/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { getInitialsForName } from './utils';\n\nconst getAvatarContent = ({\n customText,\n url,\n initials,\n name,\n}: Omit<AvatarProps, 'size'> & { initials?: string }): ReactElement => {\n if (customText) {\n return <Text>{customText}</Text>;\n }\n\n if (url) {\n return <Image src={url} alt={name} />;\n }\n\n return <Text>{initials}</Text>;\n};\n\nconst mergedConfig = mergeConfig(indicatorConfig);\nconst Indicator: React.FunctionComponent<\n React.HTMLAttributes<HTMLDivElement> & { status: AvatarProps['status'] }\n> = component(mergedConfig) as never;\n\nconst StyledIndicator = styled(Indicator)`\n ${indicatorTokens.size}: var(${tokens.statusIconSize});\n ${indicatorTokens.color}: ${({ status }) =>\n status === 'active' ? `var(${tokens.statusOnlineColor})` : `var(${tokens.statusOfflineColor})`}\n`;\n\nexport const avatarRoot = (Root: RootProps<HTMLDivElement, AvatarProps>) => {\n return forwardRef<HTMLDivElement, AvatarProps>((props, ref) => {\n const {\n size: avatarSize,\n name,\n url,\n customText,\n status,\n className,\n focused = true,\n isScalable,\n ...rest\n } = props;\n\n const initials = useMemo(() => getInitialsForName(name), [name]);\n\n return (\n <Root ref={ref} size={avatarSize} className={cx(classes.avatarItem, className)} focused={focused} {...rest}>\n <Wrapper isScalable={isScalable}>{getAvatarContent({ customText, url, initials, name })}</Wrapper>\n\n {status && (\n <StatusIcon>\n <StyledIndicator status={status} />\n </StatusIcon>\n )}\n </Root>\n );\n });\n};\n\nexport const avatarConfig = {\n name: 'Avatar',\n tag: 'div',\n layout: avatarRoot,\n base,\n variations: {\n size: {\n css: viewCSS,\n },\n focused: {\n css: focusedCSS,\n },\n },\n defaults: {\n size: 'm',\n },\n};\n"],"names":["getAvatarContent","_ref","customText","url","initials","name","React","createElement","Text","Image","src","alt","mergedConfig","mergeConfig","indicatorConfig","Indicator","component","_exp","_exp5","_ref2","status","concat","tokens","statusOnlineColor","statusOfflineColor","StyledIndicator","styled","class","propsAsIs","vars","avatarRoot","Root","forwardRef","props","ref","avatarSize","size","className","_props$focused","focused","isScalable","rest","_excluded","useMemo","getInitialsForName","_extends","cx","classes","avatarItem","Wrapper","StatusIcon","avatarConfig","tag","layout","base","variations","css","viewCSS","focusedCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;AAcA,IAAMA,gBAAgB,GAAGA,SAAnBA,gBAAgBA,CAAAC,IAAA,EAKiD;AAAA,EAAA,IAJnEC,UAAU,GAAAD,IAAA,CAAVC,UAAU;IACVC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,IAAAA,GAAAA,IAAAA,CAAAA,IAAAA,CAAAA;AAEA,EAAA,IAAIH,UAAU,EAAE;AACZ,IAAA,oBAAOI,KAAA,CAAAC,aAAA,CAACC,kBAAI,EAAA,IAAA,EAAEN,UAAiB,CAAC,CAAA;AACpC,GAAA;AAEA,EAAA,IAAIC,GAAG,EAAE;AACL,IAAA,oBAAOG,KAAA,CAAAC,aAAA,CAACE,mBA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kB,eAAe,EAAA;AAACL,MAAAA,MAAM,EAAEA,MAAAA;KAAO,CACxB,CAEd,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AACN,EAAC;AAEM,IAAM+B,YAAY,GAAG;AACxB9C,EAAAA,IAAI,EAAE,QAAQ;AACd+C,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEvB,UAAU;AAClBwB,EAAAA,IAAI,EAAJA,kBAAI;AACJC,EAAAA,UAAU,EAAE;AACRnB,IAAAA,IAAI,EAAE;AACFoB,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDlB,IAAAA,OAAO,EAAE;AACLiB,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNvB,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
@@ -153,7 +153,7 @@ var calendarBaseRoot = function calendarBaseRoot(Root) {
153
153
  isOutOfRange = _useKeyNavigation2[4];
154
154
  var handleOnChangeDay = React.useCallback(function (newDate, coord) {
155
155
  var newDay = new Date(newDate.year, newDate.monthIndex, newDate.day);
156
- onChangeValue === null || onChangeValue === void 0 ? void 0 : onChangeValue(newDay);
156
+ onChangeValue === null || onChangeValue === void 0 || onChangeValue(newDay);
157
157
  onSelectIndexes(coord);
158
158
  }, [onChangeValue, onSelectIndexes]);
159
159
  var handleOnChangeMonth = React.useCallback(function (monthIndex) {
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarBase.js","sources":["../../../../src/components/Calendar/CalendarBase/CalendarBase.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useReducer, useState, KeyboardEvent, HTMLAttributes, forwardRef } from 'react';\n\nimport type { Calendar, DateObject, UseKeyNavigationProps } from '../Calendar.types';\nimport type { CalendarStateType } from '../store/types';\nimport { getInitialState, reducer } from '../store/reducer';\nimport { ActionType, CalendarState } from '../store/types';\nimport { isValueUpdate, YEAR_RENDER_COUNT } from '../utils';\nimport { useKeyNavigation } from '../hooks';\nimport { CalendarDays, CalendarHeader, CalendarMonths, CalendarYears } from '../ui';\nimport { RootProps } from '../../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { IsOutOfRange, StyledCalendar } from './CalendarBase.styles';\n\nexport type CalendarBaseProps = HTMLAttributes<HTMLDivElement> &\n Calendar & {\n /**\n * Тип отображения календаря: дни, месяца, года.\n */\n type?: CalendarStateType;\n };\n\n/**\n * Компонент календаря.\n */\nexport const calendarBaseRoot = (Root: RootProps<HTMLDivElement, HTMLAttributes<HTMLDivElement>>) =>\n forwardRef<HTMLDivElement, CalendarBaseProps>(\n (\n { value: externalValue, min, max, type = 'Days', eventList, disabledList, onChangeValue, ...rest },\n outerRootRef,\n ) => {\n const [firstValue, secondValue] = useMemo(\n () => (Array.isArray(externalValue) ? externalValue : [externalValue]),\n [externalValue],\n );\n const value = secondValue || firstValue;\n const [hoveredDay, setHoveredDay] = useState<DateObject | undefined>();\n const [prevType, setPrevType] = useState(type);\n const [prevValue, setPrevValue] = useState(value);\n const [outOfRangeKey, setOutOfRangeKey] = useState<number>(0);\n\n const [state, dispatch] = useReducer(reducer, getInitialState(value, [5, 6], type));\n\n const { date, calendarState, startYear, size } = state;\n\n const handlePrev = useCallback<UseKeyNavigationProps['onPrev']>(\n (withShift = false) => {\n if (calendarState === CalendarState.Days) {\n if (withShift) {\n dispatch({\n type: ActionType.PREVIOUS_YEAR,\n payload: { step: 1 },\n });\n\n return;\n }\n\n dispatch({\n type: ActionType.PREVIOUS_MONTH,\n payload: { monthIndex: date.monthIndex, year: date.year },\n });\n\n return;\n }\n\n if (calendarState === CalendarState.Months) {\n dispatch({ type: ActionType.PREVIOUS_YEAR, payload: { step: 1 } });\n\n return;\n }\n\n if (calendarState === CalendarState.Years) {\n dispatch({ type: ActionType.PREVIOUS_START_YEAR, payload: { yearsCount: YEAR_RENDER_COUNT } });\n }\n },\n [date, calendarState],\n );\n\n const handleNext = useCallback<UseKeyNavigationProps['onNext']>(\n (withShift = false) => {\n if (calendarState === CalendarState.Days) {\n if (withShift) {\n dispatch({\n type: ActionType.NEXT_YEAR,\n payload: { step: 1 },\n });\n\n return;\n }\n\n dispatch({\n type: ActionType.NEXT_MONTH,\n payload: { monthIndex: date.monthIndex, year: date.year },\n });\n\n return;\n }\n\n if (calendarState === CalendarState.Months) {\n dispatch({ type: ActionType.NEXT_YEAR, payload: { step: 1 } });\n\n return;\n }\n\n if (calendarState === CalendarState.Years) {\n dispatch({ type: ActionType.NEXT_START_YEAR, payload: { yearsCount: YEAR_RENDER_COUNT } });\n }\n },\n [date, calendarState],\n );\n\n const [selectIndexes, onKeyDown, onSelectIndexes, outerRefs, isOutOfRange] = useKeyNavigation({\n size,\n onNext: handleNext,\n onPrev: handlePrev,\n });\n\n const handleOnChangeDay = useCallback(\n (newDate: DateObject, coord: number[]) => {\n const newDay = new Date(newDate.year, newDate.monthIndex, newDate.day);\n onChangeValue?.(newDay);\n\n onSelectIndexes(coord);\n },\n [onChangeValue, onSelectIndexes],\n );\n\n const handleOnChangeMonth = useCallback((monthIndex: number) => {\n dispatch({\n type: ActionType.UPDATE_MONTH,\n payload: { calendarState: CalendarState.Days, monthIndex, size: [5, 6] },\n });\n }, []);\n\n const handleOnChangeYear = useCallback((year: number) => {\n dispatch({\n type: ActionType.UPDATE_YEAR,\n payload: { calendarState: CalendarState.Months, year },\n });\n }, []);\n\n const handleUpdateCalendarState = useCallback(\n (newCalendarState: CalendarStateType, newSize: [number, number]) => {\n dispatch({\n type: ActionType.UPDATE_CALENDAR_STATE,\n payload: { calendarState: newCalendarState, size: newSize },\n });\n },\n [],\n );\n\n if (value && prevValue && isValueUpdate(value, prevValue)) {\n dispatch({\n type: ActionType.UPDATE_DATE,\n payload: { value },\n });\n\n setPrevValue(value);\n }\n\n if (prevType !== type) {\n dispatch({\n type: ActionType.UPDATE_CALENDAR_STATE,\n payload: { calendarState: type },\n });\n\n setPrevType(type);\n }\n\n // Изменяем ключ каждый раз как пытаемся перейти на даты которые находятся за пределами min/max ограничений.\n // Это необходимо для того чтобы screen-reader корректно озвучивал уведомление aria-live=\"assertive\"\n // о том что нет доступных дат\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n setOutOfRangeKey((previousState) => Number(!previousState));\n\n onKeyDown(event);\n },\n [onKeyDown],\n );\n\n return (\n <Root ref={outerRootRef} aria-label=\"Выбор даты\" {...rest}>\n {isOutOfRange && (\n <IsOutOfRange\n key={outOfRangeKey}\n aria-atomic=\"true\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-relevant=\"additions\"\n >\n Далее нет доступных дат.\n </IsOutOfRange>\n )}\n <CalendarHeader\n firstDate={date}\n startYear={startYear}\n type={calendarState}\n onPrev={handlePrev}\n onNext={handleNext}\n onUpdateCalendarState={handleUpdateCalendarState}\n />\n {calendarState === CalendarState.Days && (\n <CalendarDays\n eventList={eventList}\n disabledList={disabledList}\n min={min}\n max={max}\n value={externalValue}\n date={date}\n hoveredDay={hoveredDay}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredDay}\n onSetSelected={onSelectIndexes}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n />\n )}\n {calendarState === CalendarState.Months && (\n <CalendarMonths\n date={date}\n selectIndexes={selectIndexes}\n onChangeMonth={handleOnChangeMonth}\n onSetSelected={onSelectIndexes}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n />\n )}\n {calendarState === CalendarState.Years && (\n <CalendarYears\n date={date}\n startYear={startYear}\n selectIndexes={selectIndexes}\n onChangeYear={handleOnChangeYear}\n onSetSelected={onSelectIndexes}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n />\n )}\n </Root>\n );\n },\n );\n\nexport const calendarBaseConfig = {\n name: 'CalendarBase',\n tag: 'div',\n layout: calendarBaseRoot,\n base: StyledCalendar,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["calendarBaseRoot","Root","forwardRef","_ref","outerRootRef","externalValue","value","min","max","_ref$type","type","eventList","disabledList","onChangeValue","rest","_objectWithoutProperties","_excluded","_useMemo","useMemo","Array","isArray","_useMemo2","_slicedToArray","firstValue","secondValue","_useState","useState","_useState2","hoveredDay","setHoveredDay","_useState3","_useState4","prevType","setPrevType","_useState5","_useState6","prevValue","setPrevValue","_useState7","_useState8","outOfRangeKey","setOutOfRangeKey","_useReducer","useReducer","reducer","getInitialState","_useReducer2","state","dispatch","date","calendarState","startYear","size","handlePrev","useCallback","withShift","arguments","length","undefined","CalendarState","Days","ActionType","PREVIOUS_YEAR","payload","step","PREVIOUS_MONTH","monthIndex","year","Months","Years","PREVIOUS_START_YEAR","yearsCount","YEAR_RENDER_COUNT","handleNext","NEXT_YEAR","NEXT_MONTH","NEXT_START_YEAR","_useKeyNavigation","useKeyNavigation","onNext","onPrev","_useKeyNavigation2","selectIndexes","onKeyDown","onSelectIndexes","outerRefs","isOutOfRange","handleOnChangeDay","newDate","coord","newDay","Date","day","handleOnChangeMonth","UPDATE_MONTH","handleOnChangeYear","UPDATE_YEAR","handleUpdateCalendarState","newCalendarState","newSize","UPDATE_CALENDAR_STATE","isValueUpdate","UPDATE_DATE","handleKeyDown","event","previousState","Number","React","createElement","_extends","ref","IsOutOfRange","key","role","CalendarHeader","firstDate","onUpdateCalendarState","CalendarDays","onChangeDay","onHoverDay","onSetSelected","CalendarMonths","onChangeMonth","CalendarYears","onChangeYear","calendarBaseConfig","name","tag","layout","base","StyledCalendar","variations","view","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA;AACA;AACA;IACaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAA+D,EAAA;AAAA,EAAA,oBAC5FC,gBAAU,CACN,UAAAC,IAAA,EAEIC,YAAY,EACX;AAAA,IAAA,IAFQC,aAAa,GAAA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AA;KACR;AACDlF,IAAAA,IAAI,EAAE;AACFiF,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNJ,IAAAA,IAAI,EAAE,SAAS;AACfhF,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
1
+ {"version":3,"file":"CalendarBase.js","sources":["../../../../src/components/Calendar/CalendarBase/CalendarBase.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useReducer, useState, KeyboardEvent, HTMLAttributes, forwardRef } from 'react';\n\nimport type { Calendar, DateObject, UseKeyNavigationProps } from '../Calendar.types';\nimport type { CalendarStateType } from '../store/types';\nimport { getInitialState, reducer } from '../store/reducer';\nimport { ActionType, CalendarState } from '../store/types';\nimport { isValueUpdate, YEAR_RENDER_COUNT } from '../utils';\nimport { useKeyNavigation } from '../hooks';\nimport { CalendarDays, CalendarHeader, CalendarMonths, CalendarYears } from '../ui';\nimport { RootProps } from '../../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { IsOutOfRange, StyledCalendar } from './CalendarBase.styles';\n\nexport type CalendarBaseProps = HTMLAttributes<HTMLDivElement> &\n Calendar & {\n /**\n * Тип отображения календаря: дни, месяца, года.\n */\n type?: CalendarStateType;\n };\n\n/**\n * Компонент календаря.\n */\nexport const calendarBaseRoot = (Root: RootProps<HTMLDivElement, HTMLAttributes<HTMLDivElement>>) =>\n forwardRef<HTMLDivElement, CalendarBaseProps>(\n (\n { value: externalValue, min, max, type = 'Days', eventList, disabledList, onChangeValue, ...rest },\n outerRootRef,\n ) => {\n const [firstValue, secondValue] = useMemo(\n () => (Array.isArray(externalValue) ? externalValue : [externalValue]),\n [externalValue],\n );\n const value = secondValue || firstValue;\n const [hoveredDay, setHoveredDay] = useState<DateObject | undefined>();\n const [prevType, setPrevType] = useState(type);\n const [prevValue, setPrevValue] = useState(value);\n const [outOfRangeKey, setOutOfRangeKey] = useState<number>(0);\n\n const [state, dispatch] = useReducer(reducer, getInitialState(value, [5, 6], type));\n\n const { date, calendarState, startYear, size } = state;\n\n const handlePrev = useCallback<UseKeyNavigationProps['onPrev']>(\n (withShift = false) => {\n if (calendarState === CalendarState.Days) {\n if (withShift) {\n dispatch({\n type: ActionType.PREVIOUS_YEAR,\n payload: { step: 1 },\n });\n\n return;\n }\n\n dispatch({\n type: ActionType.PREVIOUS_MONTH,\n payload: { monthIndex: date.monthIndex, year: date.year },\n });\n\n return;\n }\n\n if (calendarState === CalendarState.Months) {\n dispatch({ type: ActionType.PREVIOUS_YEAR, payload: { step: 1 } });\n\n return;\n }\n\n if (calendarState === CalendarState.Years) {\n dispatch({ type: ActionType.PREVIOUS_START_YEAR, payload: { yearsCount: YEAR_RENDER_COUNT } });\n }\n },\n [date, calendarState],\n );\n\n const handleNext = useCallback<UseKeyNavigationProps['onNext']>(\n (withShift = false) => {\n if (calendarState === CalendarState.Days) {\n if (withShift) {\n dispatch({\n type: ActionType.NEXT_YEAR,\n payload: { step: 1 },\n });\n\n return;\n }\n\n dispatch({\n type: ActionType.NEXT_MONTH,\n payload: { monthIndex: date.monthIndex, year: date.year },\n });\n\n return;\n }\n\n if (calendarState === CalendarState.Months) {\n dispatch({ type: ActionType.NEXT_YEAR, payload: { step: 1 } });\n\n return;\n }\n\n if (calendarState === CalendarState.Years) {\n dispatch({ type: ActionType.NEXT_START_YEAR, payload: { yearsCount: YEAR_RENDER_COUNT } });\n }\n },\n [date, calendarState],\n );\n\n const [selectIndexes, onKeyDown, onSelectIndexes, outerRefs, isOutOfRange] = useKeyNavigation({\n size,\n onNext: handleNext,\n onPrev: handlePrev,\n });\n\n const handleOnChangeDay = useCallback(\n (newDate: DateObject, coord: number[]) => {\n const newDay = new Date(newDate.year, newDate.monthIndex, newDate.day);\n onChangeValue?.(newDay);\n\n onSelectIndexes(coord);\n },\n [onChangeValue, onSelectIndexes],\n );\n\n const handleOnChangeMonth = useCallback((monthIndex: number) => {\n dispatch({\n type: ActionType.UPDATE_MONTH,\n payload: { calendarState: CalendarState.Days, monthIndex, size: [5, 6] },\n });\n }, []);\n\n const handleOnChangeYear = useCallback((year: number) => {\n dispatch({\n type: ActionType.UPDATE_YEAR,\n payload: { calendarState: CalendarState.Months, year },\n });\n }, []);\n\n const handleUpdateCalendarState = useCallback(\n (newCalendarState: CalendarStateType, newSize: [number, number]) => {\n dispatch({\n type: ActionType.UPDATE_CALENDAR_STATE,\n payload: { calendarState: newCalendarState, size: newSize },\n });\n },\n [],\n );\n\n if (value && prevValue && isValueUpdate(value, prevValue)) {\n dispatch({\n type: ActionType.UPDATE_DATE,\n payload: { value },\n });\n\n setPrevValue(value);\n }\n\n if (prevType !== type) {\n dispatch({\n type: ActionType.UPDATE_CALENDAR_STATE,\n payload: { calendarState: type },\n });\n\n setPrevType(type);\n }\n\n // Изменяем ключ каждый раз как пытаемся перейти на даты которые находятся за пределами min/max ограничений.\n // Это необходимо для того чтобы screen-reader корректно озвучивал уведомление aria-live=\"assertive\"\n // о том что нет доступных дат\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n setOutOfRangeKey((previousState) => Number(!previousState));\n\n onKeyDown(event);\n },\n [onKeyDown],\n );\n\n return (\n <Root ref={outerRootRef} aria-label=\"Выбор даты\" {...rest}>\n {isOutOfRange && (\n <IsOutOfRange\n key={outOfRangeKey}\n aria-atomic=\"true\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-relevant=\"additions\"\n >\n Далее нет доступных дат.\n </IsOutOfRange>\n )}\n <CalendarHeader\n firstDate={date}\n startYear={startYear}\n type={calendarState}\n onPrev={handlePrev}\n onNext={handleNext}\n onUpdateCalendarState={handleUpdateCalendarState}\n />\n {calendarState === CalendarState.Days && (\n <CalendarDays\n eventList={eventList}\n disabledList={disabledList}\n min={min}\n max={max}\n value={externalValue}\n date={date}\n hoveredDay={hoveredDay}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredDay}\n onSetSelected={onSelectIndexes}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n />\n )}\n {calendarState === CalendarState.Months && (\n <CalendarMonths\n date={date}\n selectIndexes={selectIndexes}\n onChangeMonth={handleOnChangeMonth}\n onSetSelected={onSelectIndexes}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n />\n )}\n {calendarState === CalendarState.Years && (\n <CalendarYears\n date={date}\n startYear={startYear}\n selectIndexes={selectIndexes}\n onChangeYear={handleOnChangeYear}\n onSetSelected={onSelectIndexes}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n />\n )}\n </Root>\n );\n },\n );\n\nexport const calendarBaseConfig = {\n name: 'CalendarBase',\n tag: 'div',\n layout: calendarBaseRoot,\n base: StyledCalendar,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["calendarBaseRoot","Root","forwardRef","_ref","outerRootRef","externalValue","value","min","max","_ref$type","type","eventList","disabledList","onChangeValue","rest","_objectWithoutProperties","_excluded","_useMemo","useMemo","Array","isArray","_useMemo2","_slicedToArray","firstValue","secondValue","_useState","useState","_useState2","hoveredDay","setHoveredDay","_useState3","_useState4","prevType","setPrevType","_useState5","_useState6","prevValue","setPrevValue","_useState7","_useState8","outOfRangeKey","setOutOfRangeKey","_useReducer","useReducer","reducer","getInitialState","_useReducer2","state","dispatch","date","calendarState","startYear","size","handlePrev","useCallback","withShift","arguments","length","undefined","CalendarState","Days","ActionType","PREVIOUS_YEAR","payload","step","PREVIOUS_MONTH","monthIndex","year","Months","Years","PREVIOUS_START_YEAR","yearsCount","YEAR_RENDER_COUNT","handleNext","NEXT_YEAR","NEXT_MONTH","NEXT_START_YEAR","_useKeyNavigation","useKeyNavigation","onNext","onPrev","_useKeyNavigation2","selectIndexes","onKeyDown","onSelectIndexes","outerRefs","isOutOfRange","handleOnChangeDay","newDate","coord","newDay","Date","day","handleOnChangeMonth","UPDATE_MONTH","handleOnChangeYear","UPDATE_YEAR","handleUpdateCalendarState","newCalendarState","newSize","UPDATE_CALENDAR_STATE","isValueUpdate","UPDATE_DATE","handleKeyDown","event","previousState","Number","React","createElement","_extends","ref","IsOutOfRange","key","role","CalendarHeader","firstDate","onUpdateCalendarState","CalendarDays","onChangeDay","onHoverDay","onSetSelected","CalendarMonths","onChangeMonth","CalendarYears","onChangeYear","calendarBaseConfig","name","tag","layout","base","StyledCalendar","variations","view","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA;AACA;AACA;IACaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAA+D,EAAA;AAAA,EAAA,oBAC5FC,gBAAU,CACN,UAAAC,IAAA,EAEIC,YAAY,EACX;AAAA,IAAA,IAFQC,aAAa,GAAAF,IAAA,CAApBG,KAAK;MAAiBC,GAAG,GAAAJ,IAAA,CAAHI,GAAG;MAAEC,GAAG,GAAAL,IAAA,CAAHK,GAAG;MAAAC,SAAA,GAAAN,IAAA,CAAEO,IAAI;AAAJA,MAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,SAAA;MAAEE,SAAS,GAAAR,IAAA,CAATQ,SAAS;MAAEC,YAAY,GAAAT,IAAA,CAAZS,YAAY;MAAEC,aAAa,GAAAV,IAAA,CAAbU,aAAa;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAAZ,IAAA,EAAAa,SAAA,CAAA,CAAA;IAGhG,IAAAC,QAAA,GAAkCC,aAAO,CACrC,YAAA;QAAA,OAAOC,KAAK,CAACC,OAAO,CAACf,aAAa,CAAC,GAAGA,aAAa,GAAG,CAACA,aAAa,CAAC,CAAA;AAAA,OAAC,EACtE,CAACA,aAAa,CAClB,CAAC;MAAAgB,SAAA,GAAAC,uCAAA,CAAAL,QAAA,EAAA,CAAA,CAAA;AAHMM,MAAAA,UAAU,GAAAF,SAAA,CAAA,CAAA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AS,EAAEA,SAAU;AACrB+B,MAAAA,aAAa,EAAEA,aAAc;AAC7B0C,MAAAA,YAAY,EAAE7B,kBAAmB;AACjCyB,MAAAA,aAAa,EAAEpC,eAAgB;AAC/BD,MAAAA,SAAS,EAAEA,SAAU;AACrBE,MAAAA,SAAS,EAAEA,SAAAA;AAAU,KACxB,CAEH,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMwC,kBAAkB,GAAG;AAC9BC,EAAAA,IAAI,EAAE,cAAc;AACpBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEhI,gBAAgB;AACxBiI,EAAAA,IAAI,EAAEC,kCAAc;AACpBC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDlF,IAAAA,IAAI,EAAE;AACFiF,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNJ,IAAAA,IAAI,EAAE,SAAS;AACfhF,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
@@ -93,7 +93,7 @@ var calendarDoubleRoot = function calendarDoubleRoot(Root) {
93
93
  outerRefs = _useKeyNavigation2[3];
94
94
  var handleOnChangeDay = React.useCallback(function (newDate, coord) {
95
95
  var newDay = new Date(newDate.year, newDate.monthIndex, newDate.day);
96
- onChangeValue === null || onChangeValue === void 0 ? void 0 : onChangeValue(newDay);
96
+ onChangeValue === null || onChangeValue === void 0 || onChangeValue(newDay);
97
97
  onSelectIndexes(coord);
98
98
  }, [onChangeValue, onSelectIndexes]);
99
99
  var firstDate = React.useMemo(function () {
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarDouble.js","sources":["../../../../src/components/Calendar/CalendarDouble/CalendarDouble.tsx"],"sourcesContent":["import React, { useState, useCallback, useMemo, forwardRef, HTMLAttributes } from 'react';\n\nimport type { Calendar, DateObject } from '../Calendar.types';\nimport { getDateFromValue, getNextDate, getPrevDate, isValueUpdate } from '../utils';\nimport { useKeyNavigation } from '../hooks';\nimport { CalendarDays, CalendarHeader } from '../ui';\nimport { RootProps } from '../../../engines/types';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { StyledCalendar, StyledSeparator, StyledWrapper } from './CalendarDouble.styles';\n\nexport type CalendarDoubleProps = HTMLAttributes<HTMLDivElement> & Calendar;\n\n/**\n * Компонент двойного календаря.\n */\nexport const calendarDoubleRoot = (Root: RootProps<HTMLDivElement, HTMLAttributes<HTMLDivElement>>) =>\n forwardRef<HTMLDivElement, CalendarDoubleProps>(\n ({ value: externalValue, min, max, eventList, disabledList, onChangeValue, ...rest }, outerRootRef) => {\n const [firstValue, secondValue] = useMemo(\n () => (Array.isArray(externalValue) ? externalValue : [externalValue]),\n [externalValue],\n );\n const value = secondValue || firstValue;\n const [hoveredDay, setHoveredDay] = useState<DateObject | undefined>();\n\n const [date, setDate] = useState<DateObject>(getDateFromValue(value));\n const [prevValue, setPrevValue] = useState(value);\n const [doubleDate, setMonths] = useState(() => {\n const nextDate = getDateFromValue(firstValue);\n const [initialYear, initialMonth] = getNextDate(nextDate.year, nextDate.monthIndex);\n\n return {\n monthIndex: [nextDate.monthIndex, initialMonth],\n year: [nextDate.year, initialYear],\n };\n });\n\n const handleMonth = useCallback(\n (getDate: (currentYear: number, currentMonth: number) => number[]) => {\n const [newCurrentYear, newCurrentMonth] = getDate(doubleDate.year[0], doubleDate.monthIndex[0]);\n const [newNextYear, newNextMonth] = getDate(doubleDate.year[1], doubleDate.monthIndex[1]);\n\n setMonths({\n monthIndex: [newCurrentMonth, newNextMonth],\n year: [newCurrentYear, newNextYear],\n });\n },\n [doubleDate],\n );\n\n const handlePrev = useCallback(() => {\n handleMonth(getPrevDate);\n }, [handleMonth]);\n\n const handleNext = useCallback(() => {\n handleMonth(getNextDate);\n }, [handleMonth]);\n\n const [selectIndexes, onKeyDown, onSelectIndexes, outerRefs] = useKeyNavigation({\n isDouble: true,\n size: [11, 6],\n onNext: handleNext,\n onPrev: handlePrev,\n });\n\n const handleOnChangeDay = useCallback(\n (newDate: DateObject, coord: number[]) => {\n const newDay = new Date(newDate.year, newDate.monthIndex, newDate.day);\n onChangeValue?.(newDay);\n\n onSelectIndexes(coord);\n },\n [onChangeValue, onSelectIndexes],\n );\n\n const firstDate = useMemo(\n () => ({\n day: date.day,\n year: doubleDate.year[0],\n monthIndex: doubleDate.monthIndex[0],\n }),\n [date, doubleDate],\n );\n\n const secondDate = useMemo(\n () => ({\n day: date.day,\n year: doubleDate.year[1],\n monthIndex: doubleDate.monthIndex[1],\n }),\n [date, doubleDate],\n );\n\n if (value && prevValue && isValueUpdate(value, prevValue)) {\n const newDate = getDateFromValue(value);\n\n const { year, monthIndex } = newDate;\n\n const {\n monthIndex: [, prevMonthIndex],\n year: [, prevYear],\n } = doubleDate;\n\n if (prevMonthIndex !== monthIndex || prevYear !== year) {\n const [nextYear, nextMonthIndex] = getNextDate(year, monthIndex);\n\n setDate(newDate);\n\n setMonths({\n monthIndex: [monthIndex, nextMonthIndex],\n year: [year, nextYear],\n });\n }\n\n setPrevValue(value);\n }\n\n return (\n <Root ref={outerRootRef} aria-label=\"Выбор даты\" {...rest}>\n <CalendarHeader\n isDouble\n firstDate={firstDate}\n secondDate={secondDate}\n onPrev={handlePrev}\n onNext={handleNext}\n />\n\n <StyledWrapper>\n <CalendarDays\n isDouble\n eventList={eventList}\n disabledList={disabledList}\n min={min}\n max={max}\n value={externalValue}\n date={firstDate}\n hoveredDay={hoveredDay}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredDay}\n onSetSelected={onSelectIndexes}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n />\n <StyledSeparator />\n <CalendarDays\n isDouble\n isSecond\n eventList={eventList}\n disabledList={disabledList}\n min={min}\n max={max}\n value={externalValue}\n date={secondDate}\n hoveredDay={hoveredDay}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredDay}\n onSetSelected={onSelectIndexes}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n />\n </StyledWrapper>\n </Root>\n );\n },\n );\n\nexport const calendarDoubleConfig = {\n name: 'CalendarDouble',\n tag: 'div',\n layout: calendarDoubleRoot,\n base: StyledCalendar,\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["calendarDoubleRoot","Root","forwardRef","_ref","outerRootRef","externalValue","value","min","max","eventList","disabledList","onChangeValue","rest","_objectWithoutProperties","_excluded","_useMemo","useMemo","Array","isArray","_useMemo2","_slicedToArray","firstValue","secondValue","_useState","useState","_useState2","hoveredDay","setHoveredDay","_useState3","getDateFromValue","_useState4","date","setDate","_useState5","_useState6","prevValue","setPrevValue","_useState7","nextDate","_getNextDate","getNextDate","year","monthIndex","_getNextDate2","initialYear","initialMonth","_useState8","doubleDate","setMonths","handleMonth","useCallback","getDate","_getDate","_getDate2","newCurrentYear","newCurrentMonth","_getDate3","_getDate4","newNextYear","newNextMonth","handlePrev","getPrevDate","handleNext","_useKeyNavigation","useKeyNavigation","isDouble","size","onNext","onPrev","_useKeyNavigation2","selectIndexes","onKeyDown","onSelectIndexes","outerRefs","handleOnChangeDay","newDate","coord","newDay","Date","day","firstDate","secondDate","isValueUpdate","_doubleDate$monthInde","prevMonthIndex","_doubleDate$year","prevYear","_getNextDate3","_getNextDate4","nextYear","nextMonthIndex","React","createElement","_extends","ref","CalendarHeader","StyledWrapper","CalendarDays","onChangeDay","onHoverDay","onSetSelected","_StyledSeparator","StyledSeparator","isSecond","calendarDoubleConfig","name","tag","layout","base","StyledCalendar","variations","view","css","viewCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;AAaA;AACA;AACA;IACaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,IAA+D,EAAA;AAAA,EAAA,oBAC9FC,gBAAU,CACN,UAAAC,IAAA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;AACrB0B,MAAAA,IAAI,EAAEkD,UAAW;AACjBvD,MAAAA,UAAU,EAAEA,UAAW;AACvB4C,MAAAA,aAAa,EAAEA,aAAc;AAC7B4B,MAAAA,WAAW,EAAExB,iBAAkB;AAC/ByB,MAAAA,UAAU,EAAExE,aAAc;AAC1ByE,MAAAA,aAAa,EAAE5B,eAAgB;AAC/BD,MAAAA,SAAS,EAAEA,SAAU;AACrBE,MAAAA,SAAS,EAAEA,SAAAA;KACd,CACU,CACb,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAM+B,oBAAoB,GAAG;AAChCC,EAAAA,IAAI,EAAE,gBAAgB;AACtBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE3G,kBAAkB;AAC1B4G,EAAAA,IAAI,EAAEC,oCAAc;AACpBC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,SAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNH,IAAAA,IAAI,EAAE,SAAS;AACf7C,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
1
+ {"version":3,"file":"CalendarDouble.js","sources":["../../../../src/components/Calendar/CalendarDouble/CalendarDouble.tsx"],"sourcesContent":["import React, { useState, useCallback, useMemo, forwardRef, HTMLAttributes } from 'react';\n\nimport type { Calendar, DateObject } from '../Calendar.types';\nimport { getDateFromValue, getNextDate, getPrevDate, isValueUpdate } from '../utils';\nimport { useKeyNavigation } from '../hooks';\nimport { CalendarDays, CalendarHeader } from '../ui';\nimport { RootProps } from '../../../engines/types';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { StyledCalendar, StyledSeparator, StyledWrapper } from './CalendarDouble.styles';\n\nexport type CalendarDoubleProps = HTMLAttributes<HTMLDivElement> & Calendar;\n\n/**\n * Компонент двойного календаря.\n */\nexport const calendarDoubleRoot = (Root: RootProps<HTMLDivElement, HTMLAttributes<HTMLDivElement>>) =>\n forwardRef<HTMLDivElement, CalendarDoubleProps>(\n ({ value: externalValue, min, max, eventList, disabledList, onChangeValue, ...rest }, outerRootRef) => {\n const [firstValue, secondValue] = useMemo(\n () => (Array.isArray(externalValue) ? externalValue : [externalValue]),\n [externalValue],\n );\n const value = secondValue || firstValue;\n const [hoveredDay, setHoveredDay] = useState<DateObject | undefined>();\n\n const [date, setDate] = useState<DateObject>(getDateFromValue(value));\n const [prevValue, setPrevValue] = useState(value);\n const [doubleDate, setMonths] = useState(() => {\n const nextDate = getDateFromValue(firstValue);\n const [initialYear, initialMonth] = getNextDate(nextDate.year, nextDate.monthIndex);\n\n return {\n monthIndex: [nextDate.monthIndex, initialMonth],\n year: [nextDate.year, initialYear],\n };\n });\n\n const handleMonth = useCallback(\n (getDate: (currentYear: number, currentMonth: number) => number[]) => {\n const [newCurrentYear, newCurrentMonth] = getDate(doubleDate.year[0], doubleDate.monthIndex[0]);\n const [newNextYear, newNextMonth] = getDate(doubleDate.year[1], doubleDate.monthIndex[1]);\n\n setMonths({\n monthIndex: [newCurrentMonth, newNextMonth],\n year: [newCurrentYear, newNextYear],\n });\n },\n [doubleDate],\n );\n\n const handlePrev = useCallback(() => {\n handleMonth(getPrevDate);\n }, [handleMonth]);\n\n const handleNext = useCallback(() => {\n handleMonth(getNextDate);\n }, [handleMonth]);\n\n const [selectIndexes, onKeyDown, onSelectIndexes, outerRefs] = useKeyNavigation({\n isDouble: true,\n size: [11, 6],\n onNext: handleNext,\n onPrev: handlePrev,\n });\n\n const handleOnChangeDay = useCallback(\n (newDate: DateObject, coord: number[]) => {\n const newDay = new Date(newDate.year, newDate.monthIndex, newDate.day);\n onChangeValue?.(newDay);\n\n onSelectIndexes(coord);\n },\n [onChangeValue, onSelectIndexes],\n );\n\n const firstDate = useMemo(\n () => ({\n day: date.day,\n year: doubleDate.year[0],\n monthIndex: doubleDate.monthIndex[0],\n }),\n [date, doubleDate],\n );\n\n const secondDate = useMemo(\n () => ({\n day: date.day,\n year: doubleDate.year[1],\n monthIndex: doubleDate.monthIndex[1],\n }),\n [date, doubleDate],\n );\n\n if (value && prevValue && isValueUpdate(value, prevValue)) {\n const newDate = getDateFromValue(value);\n\n const { year, monthIndex } = newDate;\n\n const {\n monthIndex: [, prevMonthIndex],\n year: [, prevYear],\n } = doubleDate;\n\n if (prevMonthIndex !== monthIndex || prevYear !== year) {\n const [nextYear, nextMonthIndex] = getNextDate(year, monthIndex);\n\n setDate(newDate);\n\n setMonths({\n monthIndex: [monthIndex, nextMonthIndex],\n year: [year, nextYear],\n });\n }\n\n setPrevValue(value);\n }\n\n return (\n <Root ref={outerRootRef} aria-label=\"Выбор даты\" {...rest}>\n <CalendarHeader\n isDouble\n firstDate={firstDate}\n secondDate={secondDate}\n onPrev={handlePrev}\n onNext={handleNext}\n />\n\n <StyledWrapper>\n <CalendarDays\n isDouble\n eventList={eventList}\n disabledList={disabledList}\n min={min}\n max={max}\n value={externalValue}\n date={firstDate}\n hoveredDay={hoveredDay}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredDay}\n onSetSelected={onSelectIndexes}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n />\n <StyledSeparator />\n <CalendarDays\n isDouble\n isSecond\n eventList={eventList}\n disabledList={disabledList}\n min={min}\n max={max}\n value={externalValue}\n date={secondDate}\n hoveredDay={hoveredDay}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredDay}\n onSetSelected={onSelectIndexes}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n />\n </StyledWrapper>\n </Root>\n );\n },\n );\n\nexport const calendarDoubleConfig = {\n name: 'CalendarDouble',\n tag: 'div',\n layout: calendarDoubleRoot,\n base: StyledCalendar,\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["calendarDoubleRoot","Root","forwardRef","_ref","outerRootRef","externalValue","value","min","max","eventList","disabledList","onChangeValue","rest","_objectWithoutProperties","_excluded","_useMemo","useMemo","Array","isArray","_useMemo2","_slicedToArray","firstValue","secondValue","_useState","useState","_useState2","hoveredDay","setHoveredDay","_useState3","getDateFromValue","_useState4","date","setDate","_useState5","_useState6","prevValue","setPrevValue","_useState7","nextDate","_getNextDate","getNextDate","year","monthIndex","_getNextDate2","initialYear","initialMonth","_useState8","doubleDate","setMonths","handleMonth","useCallback","getDate","_getDate","_getDate2","newCurrentYear","newCurrentMonth","_getDate3","_getDate4","newNextYear","newNextMonth","handlePrev","getPrevDate","handleNext","_useKeyNavigation","useKeyNavigation","isDouble","size","onNext","onPrev","_useKeyNavigation2","selectIndexes","onKeyDown","onSelectIndexes","outerRefs","handleOnChangeDay","newDate","coord","newDay","Date","day","firstDate","secondDate","isValueUpdate","_doubleDate$monthInde","prevMonthIndex","_doubleDate$year","prevYear","_getNextDate3","_getNextDate4","nextYear","nextMonthIndex","React","createElement","_extends","ref","CalendarHeader","StyledWrapper","CalendarDays","onChangeDay","onHoverDay","onSetSelected","_StyledSeparator","StyledSeparator","isSecond","calendarDoubleConfig","name","tag","layout","base","StyledCalendar","variations","view","css","viewCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;AAaA;AACA;AACA;IACaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,IAA+D,EAAA;AAAA,EAAA,oBAC9FC,gBAAU,CACN,UAAAC,IAAA,EAAsFC,YAAY,EAAK;AAAA,IAAA,IAA7FC,aAAa,GAAAF,IAAA,CAApBG,KAAK;MAAiBC,GAAG,GAAAJ,IAAA,CAAHI,GAAG;MAAEC,GAAG,GAAAL,IAAA,CAAHK,GAAG;MAAEC,SAAS,GAAAN,IAAA,CAATM,SAAS;MAAEC,YAAY,GAAAP,IAAA,CAAZO,YAAY;MAAEC,aAAa,GAAAR,IAAA,CAAbQ,aAAa;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAAV,IAAA,EAAAW,SAA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AAEE,IAAM+B,oBAAoB,GAAG;AAChCC,EAAAA,IAAI,EAAE,gBAAgB;AACtBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE3G,kBAAkB;AAC1B4G,EAAAA,IAAI,EAAEC,oCAAc;AACpBC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,SAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNH,IAAAA,IAAI,EAAE,SAAS;AACf7C,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
@@ -44,7 +44,7 @@ var withRange = function withRange(Component) {
44
44
  var handleOnChangeDay = React.useCallback(function (newDay) {
45
45
  if (endValue) {
46
46
  setValues([newDay, undefined]);
47
- onChangeStartOfRange === null || onChangeStartOfRange === void 0 ? void 0 : onChangeStartOfRange(newDay);
47
+ onChangeStartOfRange === null || onChangeStartOfRange === void 0 || onChangeStartOfRange(newDay);
48
48
  return;
49
49
  }
50
50
  setValues([startValue, newDay]);
@@ -1 +1 @@
1
- {"version":3,"file":"withRange.js","sources":["../../../../src/components/Calendar/hoc/withRange.tsx"],"sourcesContent":["import React, { useMemo, useState, useCallback, ReactElement } from 'react';\n\nimport type { Calendar, CalendarRange } from '../Calendar.types';\nimport { getSortedValues, isValueUpdate } from '../utils';\n\n/**\n * HOC для календаря, дающий возможность выбора диапазона даты\n */\nexport const withRange = <T extends Calendar>(Component: React.FC<Calendar>) => ({\n value,\n disabledList,\n eventList,\n min,\n max,\n onChangeValue,\n onChangeStartOfRange,\n ...rest\n}: CalendarRange<T>): ReactElement<T> => {\n const [startExternalValue, endExternalValue] = useMemo(() => value, [value]);\n const [[startValue, endValue], setValues] = useState<[Date, Date?]>([startExternalValue, endExternalValue]);\n const [prevValue, setPrevValue] = useState(value);\n\n if (isValueUpdate(value, prevValue)) {\n setValues([startExternalValue, endExternalValue]);\n\n setPrevValue(value);\n }\n\n const handleOnChangeDay = useCallback(\n (newDay: Date) => {\n if (endValue) {\n setValues([newDay, undefined]);\n\n onChangeStartOfRange?.(newDay);\n\n return;\n }\n\n setValues([startValue, newDay]);\n\n const [first, second] = getSortedValues([startValue, newDay]);\n\n if (first) {\n onChangeValue([first, second]);\n }\n },\n [onChangeValue, onChangeStartOfRange, startValue, endValue],\n );\n\n return (\n <Component\n value={[startValue, endValue]}\n onChangeValue={handleOnChangeDay}\n disabledList={disabledList}\n eventList={eventList}\n min={min}\n max={max}\n {...rest}\n />\n );\n};\n"],"names":["withRange","Component","_ref","value","disabledList","eventList","min","max","onChangeValue","onChangeStartOfRange","rest","_objectWithoutProperties","_excluded","_useMemo","useMemo","_useMemo2","_slicedToArray","startExternalValue","endExternalValue","_useState","useState","_useState2","_useState2$","startValue","endValue","setValues","_useState3","_useState4","prevValue","setPrevValue","isValueUpdate","handleOnChangeDay","useCallback","newDay","undefined","_getSortedValues","getSortedValues","_getSortedValues2","first","second","React","createElement","_extends"],"mappings":";;;;;;;;;;AAKA;AACA;AACA;IACaA,SAAS,GAAG,SAAZA,SAASA,CAAwBC,SAA6B,EAAA;EAAA,OAAK,UAAAC,IAAA,EASvC;AAAA,IAAA,IARrCC,KAAK,GAAAD,IAAA,CAALC,KAAK;MACLC,YAAY,GAAAF,IAAA,CAAZE,YAAY;MACZC,SAAS,GAAAH,IAAA,CAATG,SAAS;MACTC,GAAG,GAAAJ,IAAA,CAAHI,GAAG;MACHC,GAAG,GAAAL,IAAA,CAAHK,GAAG;MACHC,aAAa,GAAAN,IAAA,CAAbM,aAAa;MACbC,oBAAoB,GAAAP,IAAA,CAApBO,oBAAoB;AACjBC,MAAAA,IAAI,GAAAC,iDAAA,CAAAT,IAAA,EAAAU,SAAA,CAAA,CAAA;IAEP,IAAAC,QAAA,GAA+CC,aAAO,CAAC,YAAA;AAAA,QAAA,OAAMX,KAAK,CAAA;OAAE,EAAA,CAACA,KAAK,CAAC,CAAC;MAAAY,SAAA,GAAAC,uCAAA,CA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CAAC,CAAA;AAE9B,QAAA,OAAA;AACJ,OAAA;AAEAR,MAAAA,SAAS,CAAC,CAACF,UAAU,EAAEU,MAAM,CAAC,CAAC,CAAA;MAE/B,IAAAE,gBAAA,GAAwBC,qBAAe,CAAC,CAACb,UAAU,EAAEU,MAAM,CAAC,CAAC;QAAAI,iBAAA,GAAArB,uCAAA,CAAAmB,gBAAA,EAAA,CAAA,CAAA;AAAtDG,QAAAA,KAAK,GAAAD,iBAAA,CAAA,CAAA,CAAA;AAAEE,QAAAA,MAAM,GAAAF,iBAAA,CAAA,CAAA,CAAA,CAAA;AAEpB,MAAA,IAAIC,KAAK,EAAE;AACP9B,QAAAA,aAAa,CAAC,CAAC8B,KAAK,EAAEC,MAAM,CAAC,CAAC,CAAA;AAClC,OAAA;KACH,EACD,CAAC/B,aAAa,EAAEC,oBAAoB,EAAEc,UAAU,EAAEC,QAAQ,CAC9D,CAAC,CAAA;AAED,IAAA,oBACIgB,KAAA,CAAAC,aAAA,CAACxC,SAAS,EAAAyC,iCAAA,CAAA;AACNvC,MAAAA,KAAK,EAAE,CAACoB,UAAU,EAAEC,QAAQ,CAAE;AAC9BhB,MAAAA,aAAa,EAAEuB,iBAAkB;AACjC3B,MAAAA,YAAY,EAAEA,YAAa;AAC3BC,MAAAA,SAAS,EAAEA,SAAU;AACrBC,MAAAA,GAAG,EAAEA,GAAI;AACTC,MAAAA,GAAG,EAAEA,GAAAA;KACDG,EAAAA,IAAI,CACX,CAAC,CAAA;GAET,CAAA;AAAA;;;;"}
1
+ {"version":3,"file":"withRange.js","sources":["../../../../src/components/Calendar/hoc/withRange.tsx"],"sourcesContent":["import React, { useMemo, useState, useCallback, ReactElement } from 'react';\n\nimport type { Calendar, CalendarRange } from '../Calendar.types';\nimport { getSortedValues, isValueUpdate } from '../utils';\n\n/**\n * HOC для календаря, дающий возможность выбора диапазона даты\n */\nexport const withRange = <T extends Calendar>(Component: React.FC<Calendar>) => ({\n value,\n disabledList,\n eventList,\n min,\n max,\n onChangeValue,\n onChangeStartOfRange,\n ...rest\n}: CalendarRange<T>): ReactElement<T> => {\n const [startExternalValue, endExternalValue] = useMemo(() => value, [value]);\n const [[startValue, endValue], setValues] = useState<[Date, Date?]>([startExternalValue, endExternalValue]);\n const [prevValue, setPrevValue] = useState(value);\n\n if (isValueUpdate(value, prevValue)) {\n setValues([startExternalValue, endExternalValue]);\n\n setPrevValue(value);\n }\n\n const handleOnChangeDay = useCallback(\n (newDay: Date) => {\n if (endValue) {\n setValues([newDay, undefined]);\n\n onChangeStartOfRange?.(newDay);\n\n return;\n }\n\n setValues([startValue, newDay]);\n\n const [first, second] = getSortedValues([startValue, newDay]);\n\n if (first) {\n onChangeValue([first, second]);\n }\n },\n [onChangeValue, onChangeStartOfRange, startValue, endValue],\n );\n\n return (\n <Component\n value={[startValue, endValue]}\n onChangeValue={handleOnChangeDay}\n disabledList={disabledList}\n eventList={eventList}\n min={min}\n max={max}\n {...rest}\n />\n );\n};\n"],"names":["withRange","Component","_ref","value","disabledList","eventList","min","max","onChangeValue","onChangeStartOfRange","rest","_objectWithoutProperties","_excluded","_useMemo","useMemo","_useMemo2","_slicedToArray","startExternalValue","endExternalValue","_useState","useState","_useState2","_useState2$","startValue","endValue","setValues","_useState3","_useState4","prevValue","setPrevValue","isValueUpdate","handleOnChangeDay","useCallback","newDay","undefined","_getSortedValues","getSortedValues","_getSortedValues2","first","second","React","createElement","_extends"],"mappings":";;;;;;;;;;AAKA;AACA;AACA;IACaA,SAAS,GAAG,SAAZA,SAASA,CAAwBC,SAA6B,EAAA;EAAA,OAAK,UAAAC,IAAA,EASvC;AAAA,IAAA,IARrCC,KAAK,GAAAD,IAAA,CAALC,KAAK;MACLC,YAAY,GAAAF,IAAA,CAAZE,YAAY;MACZC,SAAS,GAAAH,IAAA,CAATG,SAAS;MACTC,GAAG,GAAAJ,IAAA,CAAHI,GAAG;MACHC,GAAG,GAAAL,IAAA,CAAHK,GAAG;MACHC,aAAa,GAAAN,IAAA,CAAbM,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_ref, rowSize, columnSize) {
26
26
  return columnIndex === -1 || columnIndex === columnSize + 1 || rowIndex === -1 || rowIndex === rowSize + 1;
27
27
  };
28
28
  var isVisible = function isVisible(refs, row, column) {
29
- var _refs$current, _refs$current$row;
30
- return (_refs$current = refs.current) === null || _refs$current === void 0 ? void 0 : (_refs$current$row = _refs$current[row]) === null || _refs$current$row === void 0 ? void 0 : _refs$current$row[column];
29
+ var _refs$current;
30
+ return (_refs$current = refs.current) === null || _refs$current === void 0 || (_refs$current = _refs$current[row]) === null || _refs$current === void 0 ? void 0 : _refs$current[column];
31
31
  };
32
32
  var isAriaDisableItem = function isAriaDisableItem(item) {
33
33
  return (item === null || item === void 0 ? void 0 : item.getAttribute('aria-disabled')) === 'true';
34
34
  };
35
35
  var hasDisabledArrowKey = function hasDisabledArrowKey(_ref3) {
36
- var _refs$current2, _refs$current2$previo, _refs$current2$previo2;
36
+ var _refs$current2;
37
37
  var refs = _ref3.refs,
38
38
  payload = _ref3.payload,
39
39
  key = _ref3.key;
40
40
  var _payload = _rollupPluginBabelHelpers.slicedToArray(payload, 2),
41
41
  previousRowIndex = _payload[0],
42
42
  previousColumnIndex = _payload[1];
43
- var disabledArrowKey = (_refs$current2 = refs.current) === null || _refs$current2 === void 0 ? void 0 : (_refs$current2$previo = _refs$current2[previousRowIndex]) === null || _refs$current2$previo === void 0 ? void 0 : (_refs$current2$previo2 = _refs$current2$previo[previousColumnIndex]) === null || _refs$current2$previo2 === void 0 ? void 0 : _refs$current2$previo2.dataset.disabledArrowKey;
43
+ var disabledArrowKey = (_refs$current2 = refs.current) === null || _refs$current2 === void 0 || (_refs$current2 = _refs$current2[previousRowIndex]) === null || _refs$current2 === void 0 || (_refs$current2 = _refs$current2[previousColumnIndex]) === null || _refs$current2 === void 0 ? void 0 : _refs$current2.dataset.disabledArrowKey;
44
44
  return Boolean(disabledArrowKey === null || disabledArrowKey === void 0 ? void 0 : disabledArrowKey.includes(key));
45
45
  };
46
46
  var hasDisabledMonths = function hasDisabledMonths(_ref4) {
47
47
  var _item$dataset, _item$dataset2;
48
48
  var item = _ref4.item,
49
49
  key = _ref4.key;
50
- return item !== null && item !== void 0 && (_item$dataset = item.dataset) !== null && _item$dataset !== void 0 && _item$dataset.disabledMonths ? item === null || item === void 0 ? void 0 : (_item$dataset2 = item.dataset) === null || _item$dataset2 === void 0 ? void 0 : _item$dataset2.disabledMonths.includes(key) : false;
50
+ return item !== null && item !== void 0 && (_item$dataset = item.dataset) !== null && _item$dataset !== void 0 && _item$dataset.disabledMonths ? item === null || item === void 0 || (_item$dataset2 = item.dataset) === null || _item$dataset2 === void 0 ? void 0 : _item$dataset2.disabledMonths.includes(key) : false;
51
51
  };
52
52
  var getNextCorrectPosition = function getNextCorrectPosition(_ref5) {
53
- var _refs$current3, _refs$current3$newRow;
53
+ var _refs$current3;
54
54
  var refs = _ref5.refs,
55
55
  rowSize = _ref5.rowSize,
56
56
  newRowIndex = _ref5.newRowIndex,
@@ -59,15 +59,15 @@ var getNextCorrectPosition = function getNextCorrectPosition(_ref5) {
59
59
  minColumnIndex = _ref5.minColumnIndex,
60
60
  _ref5$defaultState = _ref5.defaultState,
61
61
  defaultState = _ref5$defaultState === void 0 ? [] : _ref5$defaultState;
62
- var item = (_refs$current3 = refs.current) === null || _refs$current3 === void 0 ? void 0 : (_refs$current3$newRow = _refs$current3[newRowIndex]) === null || _refs$current3$newRow === void 0 ? void 0 : _refs$current3$newRow[newColumnIndex];
62
+ var item = (_refs$current3 = refs.current) === null || _refs$current3 === void 0 || (_refs$current3 = _refs$current3[newRowIndex]) === null || _refs$current3 === void 0 ? void 0 : _refs$current3[newColumnIndex];
63
63
  while (isAriaDisableItem(item) && newColumnIndex <= columnSize) {
64
- var _refs$current4, _refs$current4$newRow;
64
+ var _refs$current4;
65
65
  newColumnIndex++;
66
66
  if (newColumnIndex > columnSize && newRowIndex < rowSize) {
67
67
  newRowIndex++;
68
68
  newColumnIndex = minColumnIndex;
69
69
  }
70
- item = (_refs$current4 = refs.current) === null || _refs$current4 === void 0 ? void 0 : (_refs$current4$newRow = _refs$current4[newRowIndex]) === null || _refs$current4$newRow === void 0 ? void 0 : _refs$current4$newRow[newColumnIndex];
70
+ item = (_refs$current4 = refs.current) === null || _refs$current4 === void 0 || (_refs$current4 = _refs$current4[newRowIndex]) === null || _refs$current4 === void 0 ? void 0 : _refs$current4[newColumnIndex];
71
71
  if (item) {
72
72
  var isDisabledArrowDown = hasDisabledArrowKey({
73
73
  refs: refs,
@@ -87,7 +87,7 @@ var getNextCorrectPosition = function getNextCorrectPosition(_ref5) {
87
87
  return [newRowIndex, newColumnIndex];
88
88
  };
89
89
  var getPreviousCorrectPosition = function getPreviousCorrectPosition(_ref6) {
90
- var _refs$current5, _refs$current5$newRow;
90
+ var _refs$current5;
91
91
  var refs = _ref6.refs,
92
92
  rowSize = _ref6.rowSize,
93
93
  newRowIndex = _ref6.newRowIndex,
@@ -96,15 +96,15 @@ var getPreviousCorrectPosition = function getPreviousCorrectPosition(_ref6) {
96
96
  minColumnIndex = _ref6.minColumnIndex,
97
97
  _ref6$defaultState = _ref6.defaultState,
98
98
  defaultState = _ref6$defaultState === void 0 ? [] : _ref6$defaultState;
99
- var item = (_refs$current5 = refs.current) === null || _refs$current5 === void 0 ? void 0 : (_refs$current5$newRow = _refs$current5[newRowIndex]) === null || _refs$current5$newRow === void 0 ? void 0 : _refs$current5$newRow[newColumnIndex];
99
+ var item = (_refs$current5 = refs.current) === null || _refs$current5 === void 0 || (_refs$current5 = _refs$current5[newRowIndex]) === null || _refs$current5 === void 0 ? void 0 : _refs$current5[newColumnIndex];
100
100
  while (isAriaDisableItem(item) && newColumnIndex >= minColumnIndex) {
101
- var _refs$current6, _refs$current6$newRow;
101
+ var _refs$current6;
102
102
  newColumnIndex--;
103
103
  if (newColumnIndex < minColumnIndex && newRowIndex <= rowSize) {
104
104
  newRowIndex--;
105
105
  newColumnIndex = columnSize;
106
106
  }
107
- item = (_refs$current6 = refs.current) === null || _refs$current6 === void 0 ? void 0 : (_refs$current6$newRow = _refs$current6[newRowIndex]) === null || _refs$current6$newRow === void 0 ? void 0 : _refs$current6$newRow[newColumnIndex];
107
+ item = (_refs$current6 = refs.current) === null || _refs$current6 === void 0 || (_refs$current6 = _refs$current6[newRowIndex]) === null || _refs$current6 === void 0 ? void 0 : _refs$current6[newColumnIndex];
108
108
  if (item && item.dataset.day === '1') {
109
109
  var isDisabledArrowUp = hasDisabledArrowKey({
110
110
  refs: refs,
@@ -145,7 +145,7 @@ function getCorrectColumnIndex(_ref7) {
145
145
  }) - 1;
146
146
  }
147
147
  var getCorrectIndexes = function getCorrectIndexes(refs, _ref8, rowSize, columnSize, withShift, defaultState) {
148
- var _refs$current7, _refs$current7$newRow;
148
+ var _refs$current7;
149
149
  var _ref9 = _rollupPluginBabelHelpers.slicedToArray(_ref8, 2),
150
150
  rowIndex = _ref9[0],
151
151
  columnIndex = _ref9[1];
@@ -182,7 +182,7 @@ var getCorrectIndexes = function getCorrectIndexes(refs, _ref8, rowSize, columnS
182
182
 
183
183
  // INFO: Логика для получения правильной позиции дня, когда переключились на другой месяц
184
184
  // INFO: и ставим указатель на первый доступный день. Только при зажатой клавиши Shift.
185
- if (isAriaDisableItem((_refs$current7 = refs.current) === null || _refs$current7 === void 0 ? void 0 : (_refs$current7$newRow = _refs$current7[newRowIndex]) === null || _refs$current7$newRow === void 0 ? void 0 : _refs$current7$newRow[newColumnIndex]) && withShift) {
185
+ if (isAriaDisableItem((_refs$current7 = refs.current) === null || _refs$current7 === void 0 || (_refs$current7 = _refs$current7[newRowIndex]) === null || _refs$current7 === void 0 ? void 0 : _refs$current7[newColumnIndex]) && withShift) {
186
186
  var isNext = rowIndex === rowSize + 1;
187
187
  var isPrevious = rowIndex === minColumnIndex - 1;
188
188
  var state = {
@@ -299,11 +299,11 @@ var useKeyNavigation = function useKeyNavigation(_ref10) {
299
299
  setSelectIndexes([newRowIndex, newColumnIndex]);
300
300
  }, [onPrev, onNext, selectIndexes, rowSize, columnSize, withShiftState, currentIndexes, isDouble]);
301
301
  React.useLayoutEffect(function () {
302
- var _outerRefs$current, _outerRefs$current$ro;
302
+ var _outerRefs$current;
303
303
  var _selectIndexes = _rollupPluginBabelHelpers.slicedToArray(selectIndexes, 2),
304
304
  rowIndex = _selectIndexes[0],
305
305
  columnIndex = _selectIndexes[1];
306
- var item = outerRefs === null || outerRefs === void 0 ? void 0 : (_outerRefs$current = outerRefs.current) === null || _outerRefs$current === void 0 ? void 0 : (_outerRefs$current$ro = _outerRefs$current[rowIndex]) === null || _outerRefs$current$ro === void 0 ? void 0 : _outerRefs$current$ro[columnIndex];
306
+ var item = outerRefs === null || outerRefs === void 0 || (_outerRefs$current = outerRefs.current) === null || _outerRefs$current === void 0 || (_outerRefs$current = _outerRefs$current[rowIndex]) === null || _outerRefs$current === void 0 ? void 0 : _outerRefs$current[columnIndex];
307
307
  if (item) {
308
308
  item.focus();
309
309
  }
@@ -573,8 +573,8 @@ var useKeyNavigation = function useKeyNavigation(_ref10) {
573
573
  case Calendar_types.Keys.enter:
574
574
  case Calendar_types.Keys.space:
575
575
  {
576
- var _outerRefs$current2, _outerRefs$current2$n;
577
- (_outerRefs$current2 = outerRefs.current) === null || _outerRefs$current2 === void 0 ? void 0 : (_outerRefs$current2$n = _outerRefs$current2[newRowIndex]) === null || _outerRefs$current2$n === void 0 ? void 0 : _outerRefs$current2$n[newColumnIndex].click();
576
+ var _outerRefs$current2;
577
+ (_outerRefs$current2 = outerRefs.current) === null || _outerRefs$current2 === void 0 || (_outerRefs$current2 = _outerRefs$current2[newRowIndex]) === null || _outerRefs$current2 === void 0 || _outerRefs$current2[newColumnIndex].click();
578
578
  break;
579
579
  }
580
580
  default: