@salutejs/plasma-new-hope 0.77.0-canary.1185.8720195819.0 → 0.77.0-canary.1195.8808345201.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (612) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -1
  2. package/cjs/components/Avatar/Avatar.js +28 -3
  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.css +2 -2
  23. package/cjs/components/Combobox/Combobox.js +5 -5
  24. package/cjs/components/Combobox/Combobox.js.map +1 -1
  25. package/cjs/components/Combobox/hooks/useFocusController.js +9 -9
  26. package/cjs/components/Combobox/hooks/useFocusController.js.map +1 -1
  27. package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  28. package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js.map +1 -1
  29. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +2 -2
  30. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +1 -1
  31. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +2 -2
  32. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +1 -1
  33. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +2 -2
  34. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +1 -1
  35. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +2 -2
  36. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +1 -1
  37. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.css +2 -2
  38. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +1 -1
  39. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +1 -1
  40. package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  41. package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js.map +1 -1
  42. package/cjs/components/Drawer/DrawerContext.js +1 -1
  43. package/cjs/components/Drawer/DrawerContext.js.map +1 -1
  44. package/cjs/components/Dropdown/Dropdown.css +2 -2
  45. package/cjs/components/Dropdown/Dropdown.js +4 -27
  46. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  47. package/cjs/components/Dropdown/Dropdown.styles.js +1 -1
  48. package/cjs/components/Dropdown/Dropdown.styles.js.map +1 -1
  49. package/cjs/components/Dropdown/{Dropdown.styles_13400l5.css → Dropdown.styles_1daxhqh.css} +1 -1
  50. package/cjs/components/Dropdown/Dropdown.tokens.js +0 -1
  51. package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
  52. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +5 -7
  53. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  54. package/cjs/components/Dropdown/utils/index.js +0 -43
  55. package/cjs/components/Dropdown/utils/index.js.map +1 -1
  56. package/cjs/components/IconButton/IconButton.css +27 -0
  57. package/cjs/components/IconButton/IconButton.js +84 -0
  58. package/cjs/components/IconButton/IconButton.js.map +1 -0
  59. package/cjs/components/IconButton/IconButton.styles.js +27 -0
  60. package/cjs/components/IconButton/IconButton.styles.js.map +1 -0
  61. package/cjs/components/IconButton/IconButton.styles_gh8fim.css +4 -0
  62. package/cjs/components/IconButton/IconButton.tokens.js +36 -0
  63. package/cjs/components/IconButton/IconButton.tokens.js.map +1 -0
  64. package/cjs/components/IconButton/variations/_disabled/base.js +9 -0
  65. package/cjs/components/IconButton/variations/_disabled/base.js.map +1 -0
  66. package/cjs/components/IconButton/variations/_disabled/base_x642ct.css +1 -0
  67. package/cjs/components/IconButton/variations/_focused/base.js +9 -0
  68. package/cjs/components/IconButton/variations/_focused/base.js.map +1 -0
  69. package/cjs/components/IconButton/variations/_focused/base_x642ct.css +1 -0
  70. package/cjs/components/IconButton/variations/_size/base.js +9 -0
  71. package/cjs/components/IconButton/variations/_size/base.js.map +1 -0
  72. package/cjs/components/IconButton/variations/_size/base_x642ct.css +1 -0
  73. package/cjs/components/IconButton/variations/_view/base.js +9 -0
  74. package/cjs/components/IconButton/variations/_view/base.js.map +1 -0
  75. package/cjs/components/IconButton/variations/_view/base_x642ct.css +1 -0
  76. package/cjs/components/Modal/ModalContext.js +1 -1
  77. package/cjs/components/Modal/ModalContext.js.map +1 -1
  78. package/cjs/components/Overlay/Overlay.js +1 -1
  79. package/cjs/components/Overlay/Overlay.js.map +1 -1
  80. package/cjs/components/Pagination/Pagination.css +2 -2
  81. package/cjs/components/Pagination/Pagination.js +2 -2
  82. package/cjs/components/Pagination/Pagination.js.map +1 -1
  83. package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  84. package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js.map +1 -1
  85. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -2
  86. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  87. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  88. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
  89. package/cjs/components/Popover/Popover.js +7 -7
  90. package/cjs/components/Popover/Popover.js.map +1 -1
  91. package/cjs/components/Popup/Popup.js +1 -1
  92. package/cjs/components/Popup/Popup.js.map +1 -1
  93. package/cjs/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  94. package/cjs/components/Segment/ui/SegmentItem/SegmentItem.js.map +1 -1
  95. package/cjs/components/Select/Select.css +2 -2
  96. package/cjs/components/Select/Select.js +5 -5
  97. package/cjs/components/Select/Select.js.map +1 -1
  98. package/cjs/components/Select/hooks/useKeyNavigation.js +12 -12
  99. package/cjs/components/Select/hooks/useKeyNavigation.js.map +1 -1
  100. package/cjs/components/Select/ui/SelectChip/SelectChip.js +1 -1
  101. package/cjs/components/Select/ui/SelectChip/SelectChip.js.map +1 -1
  102. package/cjs/components/Select/ui/SelectDivider/SelectDivider.css +2 -2
  103. package/cjs/components/Select/ui/SelectDivider/SelectDivider.js +1 -1
  104. package/cjs/components/Select/ui/SelectFooter/SelectFooter.css +2 -2
  105. package/cjs/components/Select/ui/SelectFooter/SelectFooter.js +1 -1
  106. package/cjs/components/Select/ui/SelectGroup/SelectGroup.css +2 -2
  107. package/cjs/components/Select/ui/SelectGroup/SelectGroup.js +1 -1
  108. package/cjs/components/Select/ui/SelectHeader/SelectHeader.css +2 -2
  109. package/cjs/components/Select/ui/SelectHeader/SelectHeader.js +1 -1
  110. package/cjs/components/Select/ui/SelectItem/SelectItem.css +2 -2
  111. package/cjs/components/Select/ui/SelectItem/SelectItem.js +1 -1
  112. package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  113. package/cjs/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  114. package/cjs/components/Select/ui/SelectTarget/SelectTarget.js.map +1 -1
  115. package/cjs/components/Select/utils/index.js +2 -2
  116. package/cjs/components/Select/utils/index.js.map +1 -1
  117. package/cjs/components/Tabs/TabsContext.js +1 -2
  118. package/cjs/components/Tabs/TabsContext.js.map +1 -1
  119. package/cjs/components/Tabs/ui/TabItem/TabItem.js +1 -1
  120. package/cjs/components/Tabs/ui/TabItem/TabItem.js.map +1 -1
  121. package/cjs/components/Tabs/ui/Tabs/Tabs.js +2 -2
  122. package/cjs/components/Tabs/ui/Tabs/Tabs.js.map +1 -1
  123. package/cjs/components/TextArea/TextArea.js +1 -1
  124. package/cjs/components/TextArea/TextArea.js.map +1 -1
  125. package/cjs/components/TextField/TextField.js +2 -2
  126. package/cjs/components/TextField/TextField.js.map +1 -1
  127. package/cjs/components/TextField/hooks/useKeyNavigation.js +9 -9
  128. package/cjs/components/TextField/hooks/useKeyNavigation.js.map +1 -1
  129. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  130. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
  131. package/cjs/components/Toast/ToastProvider/ToastProvider.js +2 -2
  132. package/cjs/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
  133. package/cjs/components/Tooltip/Tooltip.js +1 -1
  134. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  135. package/cjs/index.css +7 -2
  136. package/cjs/index.js +6 -2
  137. package/cjs/index.js.map +1 -1
  138. package/es/_virtual/_rollupPluginBabelHelpers.js +1 -1
  139. package/es/components/Avatar/Avatar.js +29 -4
  140. package/es/components/Avatar/Avatar.js.map +1 -1
  141. package/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  142. package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  143. package/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  144. package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
  145. package/es/components/Calendar/hoc/withRange.js +1 -1
  146. package/es/components/Calendar/hoc/withRange.js.map +1 -1
  147. package/es/components/Calendar/hooks/useKeyNavigation.js +19 -19
  148. package/es/components/Calendar/hooks/useKeyNavigation.js.map +1 -1
  149. package/es/components/Calendar/ui/CalendarDays/CalendarDays.js +3 -3
  150. package/es/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
  151. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +2 -2
  152. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
  153. package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
  154. package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
  155. package/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
  156. package/es/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
  157. package/es/components/Chip/Chip.js +2 -2
  158. package/es/components/Chip/Chip.js.map +1 -1
  159. package/es/components/Combobox/Combobox.css +2 -2
  160. package/es/components/Combobox/Combobox.js +5 -5
  161. package/es/components/Combobox/Combobox.js.map +1 -1
  162. package/es/components/Combobox/hooks/useFocusController.js +9 -9
  163. package/es/components/Combobox/hooks/useFocusController.js.map +1 -1
  164. package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  165. package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js.map +1 -1
  166. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +2 -2
  167. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +1 -1
  168. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +2 -2
  169. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +1 -1
  170. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +2 -2
  171. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +1 -1
  172. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +2 -2
  173. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +1 -1
  174. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.css +2 -2
  175. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +1 -1
  176. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +1 -1
  177. package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  178. package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js.map +1 -1
  179. package/es/components/Drawer/DrawerContext.js +1 -1
  180. package/es/components/Drawer/DrawerContext.js.map +1 -1
  181. package/es/components/Dropdown/Dropdown.css +2 -2
  182. package/es/components/Dropdown/Dropdown.js +6 -29
  183. package/es/components/Dropdown/Dropdown.js.map +1 -1
  184. package/es/components/Dropdown/Dropdown.styles.js +1 -1
  185. package/es/components/Dropdown/Dropdown.styles.js.map +1 -1
  186. package/es/components/Dropdown/{Dropdown.styles_13400l5.css → Dropdown.styles_1daxhqh.css} +1 -1
  187. package/es/components/Dropdown/Dropdown.tokens.js +0 -1
  188. package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
  189. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +5 -7
  190. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  191. package/es/components/Dropdown/utils/index.js +3 -45
  192. package/es/components/Dropdown/utils/index.js.map +1 -1
  193. package/es/components/IconButton/IconButton.css +27 -0
  194. package/es/components/IconButton/IconButton.js +79 -0
  195. package/es/components/IconButton/IconButton.js.map +1 -0
  196. package/es/components/IconButton/IconButton.styles.js +22 -0
  197. package/es/components/IconButton/IconButton.styles.js.map +1 -0
  198. package/es/components/IconButton/IconButton.styles_gh8fim.css +4 -0
  199. package/es/components/IconButton/IconButton.tokens.js +31 -0
  200. package/es/components/IconButton/IconButton.tokens.js.map +1 -0
  201. package/es/components/IconButton/variations/_disabled/base.js +5 -0
  202. package/es/components/IconButton/variations/_disabled/base.js.map +1 -0
  203. package/es/components/IconButton/variations/_disabled/base_x642ct.css +1 -0
  204. package/es/components/IconButton/variations/_focused/base.js +5 -0
  205. package/es/components/IconButton/variations/_focused/base.js.map +1 -0
  206. package/es/components/IconButton/variations/_focused/base_x642ct.css +1 -0
  207. package/es/components/IconButton/variations/_size/base.js +5 -0
  208. package/es/components/IconButton/variations/_size/base.js.map +1 -0
  209. package/es/components/IconButton/variations/_size/base_x642ct.css +1 -0
  210. package/es/components/IconButton/variations/_view/base.js +5 -0
  211. package/es/components/IconButton/variations/_view/base.js.map +1 -0
  212. package/es/components/IconButton/variations/_view/base_x642ct.css +1 -0
  213. package/es/components/Modal/ModalContext.js +1 -1
  214. package/es/components/Modal/ModalContext.js.map +1 -1
  215. package/es/components/Overlay/Overlay.js +1 -1
  216. package/es/components/Overlay/Overlay.js.map +1 -1
  217. package/es/components/Pagination/Pagination.css +2 -2
  218. package/es/components/Pagination/Pagination.js +2 -2
  219. package/es/components/Pagination/Pagination.js.map +1 -1
  220. package/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  221. package/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js.map +1 -1
  222. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -2
  223. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  224. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  225. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
  226. package/es/components/Popover/Popover.js +7 -7
  227. package/es/components/Popover/Popover.js.map +1 -1
  228. package/es/components/Popup/Popup.js +1 -1
  229. package/es/components/Popup/Popup.js.map +1 -1
  230. package/es/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  231. package/es/components/Segment/ui/SegmentItem/SegmentItem.js.map +1 -1
  232. package/es/components/Select/Select.css +2 -2
  233. package/es/components/Select/Select.js +5 -5
  234. package/es/components/Select/Select.js.map +1 -1
  235. package/es/components/Select/hooks/useKeyNavigation.js +12 -12
  236. package/es/components/Select/hooks/useKeyNavigation.js.map +1 -1
  237. package/es/components/Select/ui/SelectChip/SelectChip.js +1 -1
  238. package/es/components/Select/ui/SelectChip/SelectChip.js.map +1 -1
  239. package/es/components/Select/ui/SelectDivider/SelectDivider.css +2 -2
  240. package/es/components/Select/ui/SelectDivider/SelectDivider.js +1 -1
  241. package/es/components/Select/ui/SelectFooter/SelectFooter.css +2 -2
  242. package/es/components/Select/ui/SelectFooter/SelectFooter.js +1 -1
  243. package/es/components/Select/ui/SelectGroup/SelectGroup.css +2 -2
  244. package/es/components/Select/ui/SelectGroup/SelectGroup.js +1 -1
  245. package/es/components/Select/ui/SelectHeader/SelectHeader.css +2 -2
  246. package/es/components/Select/ui/SelectHeader/SelectHeader.js +1 -1
  247. package/es/components/Select/ui/SelectItem/SelectItem.css +2 -2
  248. package/es/components/Select/ui/SelectItem/SelectItem.js +1 -1
  249. package/es/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  250. package/es/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  251. package/es/components/Select/ui/SelectTarget/SelectTarget.js.map +1 -1
  252. package/es/components/Select/utils/index.js +2 -2
  253. package/es/components/Select/utils/index.js.map +1 -1
  254. package/es/components/Tabs/TabsContext.js +1 -2
  255. package/es/components/Tabs/TabsContext.js.map +1 -1
  256. package/es/components/Tabs/ui/TabItem/TabItem.js +1 -1
  257. package/es/components/Tabs/ui/TabItem/TabItem.js.map +1 -1
  258. package/es/components/Tabs/ui/Tabs/Tabs.js +2 -2
  259. package/es/components/Tabs/ui/Tabs/Tabs.js.map +1 -1
  260. package/es/components/TextArea/TextArea.js +1 -1
  261. package/es/components/TextArea/TextArea.js.map +1 -1
  262. package/es/components/TextField/TextField.js +2 -2
  263. package/es/components/TextField/TextField.js.map +1 -1
  264. package/es/components/TextField/hooks/useKeyNavigation.js +9 -9
  265. package/es/components/TextField/hooks/useKeyNavigation.js.map +1 -1
  266. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  267. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
  268. package/es/components/Toast/ToastProvider/ToastProvider.js +2 -2
  269. package/es/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
  270. package/es/components/Tooltip/Tooltip.js +1 -1
  271. package/es/components/Tooltip/Tooltip.js.map +1 -1
  272. package/es/index.css +7 -2
  273. package/es/index.js +2 -1
  274. package/es/index.js.map +1 -1
  275. package/package.json +12 -12
  276. package/styled-components/cjs/components/Avatar/Avatar.js +34 -4
  277. package/styled-components/cjs/components/Avatar/Avatar.styles.js +1 -1
  278. package/styled-components/cjs/components/Avatar/Avatar.template-doc.mdx +52 -2
  279. package/styled-components/cjs/components/AvatarGroup/AvatarGroup.js +1 -1
  280. package/styled-components/cjs/components/Badge/Badge.js +1 -1
  281. package/styled-components/cjs/components/Badge/Badge.styles.js +1 -1
  282. package/styled-components/cjs/components/Button/Button.js +2 -2
  283. package/styled-components/cjs/components/Button/Button.styles.js +1 -1
  284. package/styled-components/cjs/components/ButtonGroup/ButtonGroup.js +1 -1
  285. package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +2 -2
  286. package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.styles.js +1 -1
  287. package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +2 -2
  288. package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.styles.js +1 -1
  289. package/styled-components/cjs/components/Calendar/hoc/withRange.js +2 -2
  290. package/styled-components/cjs/components/Calendar/hooks/useKeyNavigation.js +20 -20
  291. package/styled-components/cjs/components/Calendar/store/reducer.js +1 -1
  292. package/styled-components/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.js +1 -1
  293. package/styled-components/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +4 -4
  294. package/styled-components/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
  295. package/styled-components/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +2 -2
  296. package/styled-components/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +2 -2
  297. package/styled-components/cjs/components/Cell/Cell.js +1 -1
  298. package/styled-components/cjs/components/Cell/Cell.styles.js +1 -1
  299. package/styled-components/cjs/components/Checkbox/Checkbox.js +1 -1
  300. package/styled-components/cjs/components/Chip/Chip.js +3 -3
  301. package/styled-components/cjs/components/Chip/Chip.styles.js +1 -1
  302. package/styled-components/cjs/components/Combobox/Combobox.js +6 -6
  303. package/styled-components/cjs/components/Combobox/hooks/useFocusController.js +9 -9
  304. package/styled-components/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js +2 -2
  305. package/styled-components/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +7 -7
  306. package/styled-components/cjs/components/Counter/Counter.js +1 -1
  307. package/styled-components/cjs/components/Divider/Divider.js +2 -2
  308. package/styled-components/cjs/components/Drawer/Drawer.js +1 -1
  309. package/styled-components/cjs/components/Drawer/DrawerContext.js +1 -1
  310. package/styled-components/cjs/components/Drawer/hooks/useDrawer.js +1 -1
  311. package/styled-components/cjs/components/Drawer/ui/DrawerContent/DrawerContent.js +1 -1
  312. package/styled-components/cjs/components/Drawer/ui/DrawerFooter/DrawerFooter.js +1 -1
  313. package/styled-components/cjs/components/Drawer/ui/DrawerHeader/DrawerHeader.js +1 -1
  314. package/styled-components/cjs/components/Dropdown/Dropdown.js +7 -29
  315. package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +1 -1
  316. package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +0 -1
  317. package/styled-components/cjs/components/Dropdown/index.js +1 -9
  318. package/styled-components/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +1 -1
  319. package/styled-components/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +1 -1
  320. package/styled-components/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +1 -1
  321. package/styled-components/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +1 -1
  322. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +7 -9
  323. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +1 -1
  324. package/styled-components/cjs/components/Dropdown/utils/index.js +2 -49
  325. package/styled-components/cjs/components/Grid/Grid.js +2 -2
  326. package/styled-components/cjs/components/Grid/ui/Col/Col.js +2 -2
  327. package/styled-components/cjs/components/Grid/ui/Row/Row.js +1 -1
  328. package/styled-components/cjs/components/Grid/utils/index.js +1 -1
  329. package/styled-components/cjs/components/Header/HeaderRoot/HeaderRoot.js +1 -1
  330. package/styled-components/cjs/components/Header/ui/HeaderArrow/HeaderArrow.js +1 -1
  331. package/styled-components/cjs/components/Header/ui/HeaderLogo/HeaderLogo.js +1 -1
  332. package/styled-components/cjs/components/Header/ui/HeaderTitleWrapper/HeaderTitleWrapper.js +1 -1
  333. package/styled-components/cjs/components/IconButton/IconButton.js +86 -0
  334. package/styled-components/cjs/components/IconButton/IconButton.styles.js +29 -0
  335. package/styled-components/cjs/components/IconButton/IconButton.tokens.js +34 -0
  336. package/styled-components/cjs/components/IconButton/IconButton.types.js +5 -0
  337. package/styled-components/cjs/components/IconButton/index.js +31 -0
  338. package/styled-components/cjs/components/IconButton/variations/_disabled/base.js +8 -0
  339. package/styled-components/cjs/components/IconButton/variations/_disabled/tokens.json +1 -0
  340. package/styled-components/cjs/components/IconButton/variations/_focused/base.js +8 -0
  341. package/styled-components/cjs/components/IconButton/variations/_focused/tokens.json +1 -0
  342. package/styled-components/cjs/components/IconButton/variations/_size/base.js +8 -0
  343. package/styled-components/cjs/components/IconButton/variations/_size/tokens.json +1 -0
  344. package/styled-components/cjs/components/IconButton/variations/_view/base.js +8 -0
  345. package/styled-components/cjs/components/IconButton/variations/_view/tokens.json +1 -0
  346. package/styled-components/cjs/components/Image/Image.js +2 -2
  347. package/styled-components/cjs/components/Image/Image.styles.js +1 -1
  348. package/styled-components/cjs/components/Indicator/Indicator.js +1 -1
  349. package/styled-components/cjs/components/Link/Link.js +1 -1
  350. package/styled-components/cjs/components/Modal/Modal.js +1 -1
  351. package/styled-components/cjs/components/Modal/ModalContext.js +1 -1
  352. package/styled-components/cjs/components/Modal/hooks/useModal.js +1 -1
  353. package/styled-components/cjs/components/Notification/Notification.js +1 -1
  354. package/styled-components/cjs/components/Notification/Notification.styles.js +1 -1
  355. package/styled-components/cjs/components/Notification/NotificationsPortal.js +1 -1
  356. package/styled-components/cjs/components/Notification/NotificationsStore.js +1 -1
  357. package/styled-components/cjs/components/Overlay/Overlay.js +2 -2
  358. package/styled-components/cjs/components/Pagination/Pagination.js +3 -3
  359. package/styled-components/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +2 -2
  360. package/styled-components/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  361. package/styled-components/cjs/components/Panel/Panel.js +2 -2
  362. package/styled-components/cjs/components/Panel/ui/PanelContent/PanelContent.js +1 -1
  363. package/styled-components/cjs/components/Panel/ui/PanelFooter/PanelFooter.js +1 -1
  364. package/styled-components/cjs/components/Panel/ui/PanelHeader/PanelHeader.js +1 -1
  365. package/styled-components/cjs/components/Popover/Popover.js +9 -9
  366. package/styled-components/cjs/components/Popup/Popup.js +2 -2
  367. package/styled-components/cjs/components/Popup/PopupContext.js +1 -1
  368. package/styled-components/cjs/components/Popup/PopupRoot.js +1 -1
  369. package/styled-components/cjs/components/Popup/hooks/usePopup.js +1 -1
  370. package/styled-components/cjs/components/Progress/Progress.js +1 -1
  371. package/styled-components/cjs/components/Progress/Progress.styles.js +1 -1
  372. package/styled-components/cjs/components/Radiobox/Radiobox.js +1 -1
  373. package/styled-components/cjs/components/SSRProvider/SSRProvider.js +1 -1
  374. package/styled-components/cjs/components/Segment/SegmentProvider/SegmentProvider.js +1 -1
  375. package/styled-components/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js +1 -1
  376. package/styled-components/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.styles.js +1 -1
  377. package/styled-components/cjs/components/Segment/ui/SegmentItem/SegmentItem.js +3 -3
  378. package/styled-components/cjs/components/Segment/ui/SegmentItem/SegmentItem.styles.js +1 -1
  379. package/styled-components/cjs/components/Select/Select.js +6 -6
  380. package/styled-components/cjs/components/Select/hooks/useKeyNavigation.js +12 -12
  381. package/styled-components/cjs/components/Select/ui/SelectChip/SelectChip.js +2 -2
  382. package/styled-components/cjs/components/Select/ui/SelectTarget/SelectTarget.js +3 -3
  383. package/styled-components/cjs/components/Select/utils/index.js +3 -3
  384. package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +1 -1
  385. package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +1 -1
  386. package/styled-components/cjs/components/Skeleton/RectSkeleton/RectSkeleton.js +1 -1
  387. package/styled-components/cjs/components/Skeleton/TextSkeleton/TextSkeleton.js +2 -2
  388. package/styled-components/cjs/components/Skeleton/hoc/withSkeleton.js +1 -1
  389. package/styled-components/cjs/components/Spinner/Spinner.js +1 -1
  390. package/styled-components/cjs/components/Spinner/Spinner.styles.js +1 -1
  391. package/styled-components/cjs/components/Spinner/utils/index.js +1 -1
  392. package/styled-components/cjs/components/Switch/Switch.js +1 -1
  393. package/styled-components/cjs/components/Tabs/TabsContext.js +2 -3
  394. package/styled-components/cjs/components/Tabs/createTabsController.js +1 -1
  395. package/styled-components/cjs/components/Tabs/ui/TabItem/TabItem.js +2 -2
  396. package/styled-components/cjs/components/Tabs/ui/TabItem/TabItem.styles.js +1 -1
  397. package/styled-components/cjs/components/Tabs/ui/Tabs/Tabs.js +3 -3
  398. package/styled-components/cjs/components/Tabs/ui/Tabs/Tabs.styles.js +1 -1
  399. package/styled-components/cjs/components/TextArea/TextArea.js +2 -2
  400. package/styled-components/cjs/components/TextField/TextField.js +3 -3
  401. package/styled-components/cjs/components/TextField/hooks/useKeyNavigation.js +9 -9
  402. package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +2 -2
  403. package/styled-components/cjs/components/Toast/Toast.js +2 -2
  404. package/styled-components/cjs/components/Toast/Toast.styles.js +1 -1
  405. package/styled-components/cjs/components/Toast/ToastController.js +2 -2
  406. package/styled-components/cjs/components/Toast/ToastProvider/ToastProvider.js +3 -3
  407. package/styled-components/cjs/components/Toolbar/Toolbar.js +1 -1
  408. package/styled-components/cjs/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
  409. package/styled-components/cjs/components/Tooltip/Tooltip.js +2 -2
  410. package/styled-components/cjs/components/Typography/Old/Subtitle/Subtitle.js +2 -2
  411. package/styled-components/cjs/components/Typography/Old/TypographyOld.js +2 -2
  412. package/styled-components/cjs/components/Typography/Typography.js +2 -2
  413. package/styled-components/cjs/engines/common.js +1 -1
  414. package/styled-components/cjs/engines/styled-components.js +1 -1
  415. package/styled-components/cjs/examples/_helpers.js +1 -1
  416. package/styled-components/cjs/examples/plasma_b2c/components/Avatar/Avatar.stories.tsx +26 -1
  417. package/styled-components/cjs/examples/plasma_b2c/components/AvatarGroup/AvatarGroup.stories.tsx +36 -18
  418. package/styled-components/cjs/examples/plasma_b2c/components/Button/Button.stories.tsx +27 -11
  419. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +1 -1
  420. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +7 -27
  421. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +1 -1
  422. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +11 -30
  423. package/styled-components/cjs/examples/plasma_b2c/components/Grid/Grid.config.js +1 -1
  424. package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.config.js +45 -0
  425. package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.js +11 -0
  426. package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.stories.tsx +65 -0
  427. package/styled-components/cjs/examples/plasma_b2c/components/Radiobox/Radiobox.stories.tsx +37 -43
  428. package/styled-components/cjs/examples/plasma_web/components/Avatar/Avatar.stories.tsx +26 -1
  429. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +1 -1
  430. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +8 -27
  431. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +1 -1
  432. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +11 -30
  433. package/styled-components/cjs/examples/plasma_web/components/Grid/Grid.config.js +1 -1
  434. package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.config.js +45 -0
  435. package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.js +11 -0
  436. package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.stories.tsx +65 -0
  437. package/styled-components/cjs/examples/plasma_web/components/Radiobox/Radiobox.stories.tsx +37 -43
  438. package/styled-components/cjs/examples/sds_engineer/components/Avatar/Avatar.stories.tsx +27 -1
  439. package/styled-components/cjs/examples/sds_engineer/components/Grid/Grid.config.js +1 -1
  440. package/styled-components/cjs/index.js +11 -0
  441. package/styled-components/cjs/mixins/applySpacing.js +1 -1
  442. package/styled-components/cjs/mixins/typography.js +1 -1
  443. package/styled-components/es/components/Avatar/Avatar.js +34 -3
  444. package/styled-components/es/components/Avatar/Avatar.template-doc.mdx +52 -2
  445. package/styled-components/es/components/Button/Button.js +1 -1
  446. package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  447. package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  448. package/styled-components/es/components/Calendar/hoc/withRange.js +1 -1
  449. package/styled-components/es/components/Calendar/hooks/useKeyNavigation.js +20 -20
  450. package/styled-components/es/components/Calendar/store/reducer.js +1 -1
  451. package/styled-components/es/components/Calendar/ui/CalendarDays/CalendarDays.js +3 -3
  452. package/styled-components/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +2 -2
  453. package/styled-components/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
  454. package/styled-components/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
  455. package/styled-components/es/components/Chip/Chip.js +2 -2
  456. package/styled-components/es/components/Combobox/Combobox.js +5 -5
  457. package/styled-components/es/components/Combobox/hooks/useFocusController.js +9 -9
  458. package/styled-components/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  459. package/styled-components/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  460. package/styled-components/es/components/Divider/Divider.js +1 -1
  461. package/styled-components/es/components/Drawer/DrawerContext.js +1 -1
  462. package/styled-components/es/components/Drawer/hooks/useDrawer.js +1 -1
  463. package/styled-components/es/components/Drawer/ui/DrawerContent/DrawerContent.js +1 -1
  464. package/styled-components/es/components/Drawer/ui/DrawerFooter/DrawerFooter.js +1 -1
  465. package/styled-components/es/components/Drawer/ui/DrawerHeader/DrawerHeader.js +1 -1
  466. package/styled-components/es/components/Dropdown/Dropdown.js +6 -29
  467. package/styled-components/es/components/Dropdown/Dropdown.styles.js +1 -1
  468. package/styled-components/es/components/Dropdown/Dropdown.tokens.js +0 -1
  469. package/styled-components/es/components/Dropdown/index.js +0 -1
  470. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +6 -8
  471. package/styled-components/es/components/Dropdown/utils/index.js +1 -48
  472. package/styled-components/es/components/Grid/Grid.js +1 -1
  473. package/styled-components/es/components/Grid/ui/Col/Col.js +1 -1
  474. package/styled-components/es/components/Grid/utils/index.js +1 -1
  475. package/styled-components/es/components/IconButton/IconButton.js +77 -0
  476. package/styled-components/es/components/IconButton/IconButton.styles.js +22 -0
  477. package/styled-components/es/components/IconButton/IconButton.tokens.js +28 -0
  478. package/styled-components/es/components/IconButton/IconButton.types.js +1 -0
  479. package/styled-components/es/components/IconButton/index.js +2 -0
  480. package/styled-components/es/components/IconButton/variations/_disabled/base.js +2 -0
  481. package/styled-components/es/components/IconButton/variations/_disabled/tokens.json +1 -0
  482. package/styled-components/es/components/IconButton/variations/_focused/base.js +2 -0
  483. package/styled-components/es/components/IconButton/variations/_focused/tokens.json +1 -0
  484. package/styled-components/es/components/IconButton/variations/_size/base.js +2 -0
  485. package/styled-components/es/components/IconButton/variations/_size/tokens.json +1 -0
  486. package/styled-components/es/components/IconButton/variations/_view/base.js +2 -0
  487. package/styled-components/es/components/IconButton/variations/_view/tokens.json +1 -0
  488. package/styled-components/es/components/Image/Image.js +1 -1
  489. package/styled-components/es/components/Modal/ModalContext.js +1 -1
  490. package/styled-components/es/components/Modal/hooks/useModal.js +1 -1
  491. package/styled-components/es/components/Notification/NotificationsStore.js +1 -1
  492. package/styled-components/es/components/Overlay/Overlay.js +1 -1
  493. package/styled-components/es/components/Pagination/Pagination.js +2 -2
  494. package/styled-components/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  495. package/styled-components/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  496. package/styled-components/es/components/Panel/Panel.js +1 -1
  497. package/styled-components/es/components/Popover/Popover.js +8 -8
  498. package/styled-components/es/components/Popup/Popup.js +1 -1
  499. package/styled-components/es/components/Popup/hooks/usePopup.js +1 -1
  500. package/styled-components/es/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  501. package/styled-components/es/components/Select/Select.js +5 -5
  502. package/styled-components/es/components/Select/hooks/useKeyNavigation.js +12 -12
  503. package/styled-components/es/components/Select/ui/SelectChip/SelectChip.js +1 -1
  504. package/styled-components/es/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  505. package/styled-components/es/components/Select/utils/index.js +3 -3
  506. package/styled-components/es/components/Skeleton/TextSkeleton/TextSkeleton.js +1 -1
  507. package/styled-components/es/components/Skeleton/hoc/withSkeleton.js +1 -1
  508. package/styled-components/es/components/Spinner/utils/index.js +1 -1
  509. package/styled-components/es/components/Tabs/TabsContext.js +2 -3
  510. package/styled-components/es/components/Tabs/ui/TabItem/TabItem.js +1 -1
  511. package/styled-components/es/components/Tabs/ui/Tabs/Tabs.js +2 -2
  512. package/styled-components/es/components/TextArea/TextArea.js +1 -1
  513. package/styled-components/es/components/TextField/TextField.js +2 -2
  514. package/styled-components/es/components/TextField/hooks/useKeyNavigation.js +9 -9
  515. package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  516. package/styled-components/es/components/Toast/Toast.js +1 -1
  517. package/styled-components/es/components/Toast/ToastController.js +1 -1
  518. package/styled-components/es/components/Toast/ToastProvider/ToastProvider.js +2 -2
  519. package/styled-components/es/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
  520. package/styled-components/es/components/Tooltip/Tooltip.js +1 -1
  521. package/styled-components/es/components/Typography/Old/Subtitle/Subtitle.js +1 -1
  522. package/styled-components/es/components/Typography/Old/TypographyOld.js +1 -1
  523. package/styled-components/es/components/Typography/Typography.js +1 -1
  524. package/styled-components/es/engines/common.js +1 -1
  525. package/styled-components/es/examples/_helpers.js +1 -1
  526. package/styled-components/es/examples/plasma_b2c/components/Avatar/Avatar.stories.tsx +26 -1
  527. package/styled-components/es/examples/plasma_b2c/components/AvatarGroup/AvatarGroup.stories.tsx +36 -18
  528. package/styled-components/es/examples/plasma_b2c/components/Button/Button.stories.tsx +27 -11
  529. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +1 -1
  530. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +7 -27
  531. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +1 -1
  532. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +11 -30
  533. package/styled-components/es/examples/plasma_b2c/components/Grid/Grid.config.js +1 -1
  534. package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.config.js +39 -0
  535. package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.js +5 -0
  536. package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.stories.tsx +65 -0
  537. package/styled-components/es/examples/plasma_b2c/components/Radiobox/Radiobox.stories.tsx +37 -43
  538. package/styled-components/es/examples/plasma_web/components/Avatar/Avatar.stories.tsx +26 -1
  539. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +1 -1
  540. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +8 -27
  541. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +1 -1
  542. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +11 -30
  543. package/styled-components/es/examples/plasma_web/components/Grid/Grid.config.js +1 -1
  544. package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.config.js +39 -0
  545. package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.js +5 -0
  546. package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.stories.tsx +65 -0
  547. package/styled-components/es/examples/plasma_web/components/Radiobox/Radiobox.stories.tsx +37 -43
  548. package/styled-components/es/examples/sds_engineer/components/Avatar/Avatar.stories.tsx +27 -1
  549. package/styled-components/es/examples/sds_engineer/components/Grid/Grid.config.js +1 -1
  550. package/styled-components/es/index.js +1 -0
  551. package/styled-components/es/mixins/applySpacing.js +1 -1
  552. package/styled-components/es/mixins/typography.js +1 -1
  553. package/types/components/Avatar/Avatar.d.ts +3 -1
  554. package/types/components/Avatar/Avatar.d.ts.map +1 -1
  555. package/types/components/Avatar/Avatar.types.d.ts +7 -0
  556. package/types/components/Avatar/Avatar.types.d.ts.map +1 -1
  557. package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
  558. package/types/components/Dropdown/Dropdown.tokens.d.ts +0 -1
  559. package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
  560. package/types/components/Dropdown/Dropdown.types.d.ts +2 -7
  561. package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
  562. package/types/components/Dropdown/index.d.ts +0 -1
  563. package/types/components/Dropdown/index.d.ts.map +1 -1
  564. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
  565. package/types/components/Dropdown/utils/index.d.ts +2 -5
  566. package/types/components/Dropdown/utils/index.d.ts.map +1 -1
  567. package/types/components/IconButton/IconButton.d.ts +30 -0
  568. package/types/components/IconButton/IconButton.d.ts.map +1 -0
  569. package/types/components/IconButton/IconButton.styles.d.ts +21 -0
  570. package/types/components/IconButton/IconButton.styles.d.ts.map +1 -0
  571. package/types/components/IconButton/IconButton.tokens.d.ts +29 -0
  572. package/types/components/IconButton/IconButton.tokens.d.ts.map +1 -0
  573. package/types/components/IconButton/IconButton.types.d.ts +13 -0
  574. package/types/components/IconButton/IconButton.types.d.ts.map +1 -0
  575. package/types/components/IconButton/index.d.ts +4 -0
  576. package/types/components/IconButton/index.d.ts.map +1 -0
  577. package/types/components/IconButton/variations/_disabled/base.d.ts +2 -0
  578. package/types/components/IconButton/variations/_disabled/base.d.ts.map +1 -0
  579. package/types/components/IconButton/variations/_focused/base.d.ts +2 -0
  580. package/types/components/IconButton/variations/_focused/base.d.ts.map +1 -0
  581. package/types/components/IconButton/variations/_size/base.d.ts +2 -0
  582. package/types/components/IconButton/variations/_size/base.d.ts.map +1 -0
  583. package/types/components/IconButton/variations/_view/base.d.ts +2 -0
  584. package/types/components/IconButton/variations/_view/base.d.ts.map +1 -0
  585. package/types/examples/plasma_b2c/components/Avatar/Avatar.d.ts +2 -0
  586. package/types/examples/plasma_b2c/components/Avatar/Avatar.d.ts.map +1 -1
  587. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -1
  588. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -1
  589. package/types/examples/plasma_b2c/components/IconButton/IconButton.config.d.ts +38 -0
  590. package/types/examples/plasma_b2c/components/IconButton/IconButton.config.d.ts.map +1 -0
  591. package/types/examples/plasma_b2c/components/IconButton/IconButton.d.ts +32 -0
  592. package/types/examples/plasma_b2c/components/IconButton/IconButton.d.ts.map +1 -0
  593. package/types/examples/plasma_web/components/Avatar/Avatar.d.ts +2 -0
  594. package/types/examples/plasma_web/components/Avatar/Avatar.d.ts.map +1 -1
  595. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -1
  596. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -1
  597. package/types/examples/plasma_web/components/IconButton/IconButton.config.d.ts +38 -0
  598. package/types/examples/plasma_web/components/IconButton/IconButton.config.d.ts.map +1 -0
  599. package/types/examples/plasma_web/components/IconButton/IconButton.d.ts +32 -0
  600. package/types/examples/plasma_web/components/IconButton/IconButton.d.ts.map +1 -0
  601. package/types/examples/sds_engineer/components/Avatar/Avatar.d.ts +1 -0
  602. package/types/examples/sds_engineer/components/Avatar/Avatar.d.ts.map +1 -1
  603. package/types/index.d.ts +1 -0
  604. package/types/index.d.ts.map +1 -1
  605. package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +0 -81
  606. package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js.map +0 -1
  607. package/es/components/Dropdown/hooks/useKeyboardNavigation.js +0 -76
  608. package/es/components/Dropdown/hooks/useKeyboardNavigation.js.map +0 -1
  609. package/styled-components/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +0 -83
  610. package/styled-components/es/components/Dropdown/hooks/useKeyboardNavigation.js +0 -77
  611. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts +0 -13
  612. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts.map +0 -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,11 @@ 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"];
19
+ var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable", "statusLabels"];
20
+ var StatusLabelsDefault = {
21
+ active: 'Активен',
22
+ inactive: 'Неактивен'
23
+ };
20
24
  var getAvatarContent = function getAvatarContent(_ref) {
21
25
  var customText = _ref.customText,
22
26
  url = _ref.url,
@@ -33,14 +37,28 @@ var getAvatarContent = function getAvatarContent(_ref) {
33
37
  }
34
38
  return /*#__PURE__*/React.createElement(Avatar_styles.Text, null, initials);
35
39
  };
40
+ var getAriaLabel = function getAriaLabel(_ref2) {
41
+ var url = _ref2.url,
42
+ name = _ref2.name,
43
+ status = _ref2.status,
44
+ ariaLabelProp = _ref2['aria-label'],
45
+ statusLabels = _ref2.statusLabels;
46
+ if (!url) {
47
+ return;
48
+ }
49
+
50
+ // INFO: включаем aria-label чтобы озвучить что на изображении
51
+ var ariaLabel = !ariaLabelProp || ariaLabelProp.trim() === '' ? name : ariaLabelProp;
52
+ return status ? "".concat(ariaLabel, ". ").concat(statusLabels[status]) : ariaLabel;
53
+ };
36
54
  var mergedConfig = /*#__PURE__*/common.mergeConfig(Indicator$1.indicatorConfig);
37
55
  var Indicator = /*#__PURE__*/common.component(mergedConfig);
38
56
  var _exp = function _exp() {
39
57
  return Indicator;
40
58
  };
41
59
  var _exp5 = function _exp5() {
42
- return function (_ref2) {
43
- var status = _ref2.status;
60
+ return function (_ref3) {
61
+ var status = _ref3.status;
44
62
  return status === 'active' ? "var(".concat(Avatar_tokens.tokens.statusOnlineColor, ")") : "var(".concat(Avatar_tokens.tokens.statusOfflineColor, ")");
45
63
  };
46
64
  };
@@ -63,14 +81,20 @@ var avatarRoot = function avatarRoot(Root) {
63
81
  _props$focused = props.focused,
64
82
  focused = _props$focused === void 0 ? true : _props$focused,
65
83
  isScalable = props.isScalable,
84
+ _props$statusLabels = props.statusLabels,
85
+ statusLabels = _props$statusLabels === void 0 ? StatusLabelsDefault : _props$statusLabels,
66
86
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
67
87
  var initials = React.useMemo(function () {
68
88
  return getInitialsForName.getInitialsForName(name);
69
89
  }, [name]);
90
+ var ariaLabel = getAriaLabel(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, props), {}, {
91
+ statusLabels: statusLabels
92
+ }));
70
93
  return /*#__PURE__*/React.createElement(Root, _rollupPluginBabelHelpers.extends({
71
94
  ref: ref,
72
95
  size: avatarSize,
73
96
  className: index.cx(Avatar_tokens.classes.avatarItem, className),
97
+ "aria-label": ariaLabel,
74
98
  focused: focused
75
99
  }, rest), /*#__PURE__*/React.createElement(Avatar_styles.Wrapper, {
76
100
  isScalable: isScalable
@@ -80,6 +104,7 @@ var avatarRoot = function avatarRoot(Root) {
80
104
  initials: initials,
81
105
  name: name
82
106
  })), status && /*#__PURE__*/React.createElement(Avatar_styles.StatusIcon, null, /*#__PURE__*/React.createElement(StyledIndicator, {
107
+ "aria-label": statusLabels[status],
83
108
  status: status
84
109
  })));
85
110
  });
@@ -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);\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,mBAAK,EAAA;AAACC,MAAAA,GAAG,EAAEP,GAAI;AAACQ,MAAAA,GAAG,EAAEN,IAAAA;AAAK,KAAG,CAAA,CAAA;AACzC,GAAA;AAEA,EAAA,oBAAOC,KAAA,CAAAC,aAAA,CAACC,kBAAI,EAAA,IAAA,EAAEJ,QAAe,CAAC,CAAA;AAClC,CAAC,CAAA;AAED,IAAMQ,YAAY,gBAAGC,kBAAW,CAACC,2BAAe,CAAC,CAAA;AACjD,IAAMC,SAEL,gBAAGC,gBAAS,CAACJ,YAAY,CAAU,CAAA;AAAC,IAAAK,IAAA,GAjCnBA,SAiCmBA,IAAAA,GAAA;AAAA,EAAA,OAENF,SAAS,CAAA;AAAA,CAAA,CAAA;AAAA,IAAAG,KAAA,GAnCtBA,SAmCsBA,KAAAA,GAAA;AAAA,EAAA,OAER,UAAAC,KAAA,EAAA;A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
+ {"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 { base as viewCSS } from './variations/_size/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { getInitialsForName } from './utils';\nimport type { AvatarProps, StatusLabels } from './Avatar.types';\n\nconst StatusLabelsDefault: StatusLabels = {\n active: 'Активен',\n inactive: 'Неактивен',\n};\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 getAriaLabel = ({\n url,\n name,\n status,\n 'aria-label': ariaLabelProp,\n statusLabels,\n}: Pick<AvatarProps, 'url' | 'status' | 'name' | 'aria-label'> & {\n statusLabels: StatusLabels;\n}) => {\n if (!url) {\n return;\n }\n\n // INFO: включаем aria-label чтобы озвучить что на изображении\n const ariaLabel = !ariaLabelProp || ariaLabelProp.trim() === '' ? name : ariaLabelProp;\n\n return status ? `${ariaLabel}. ${statusLabels[status]}` : ariaLabel;\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\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 statusLabels = StatusLabelsDefault,\n ...rest\n } = props;\n\n const initials = useMemo(() => getInitialsForName(name), [name]);\n const ariaLabel = getAriaLabel({\n ...props,\n statusLabels,\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={statusLabels[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":["StatusLabelsDefault","active","inactive","getAvatarContent","_ref","customText","url","initials","name","React","createElement","Text","Image","src","alt","getAriaLabel","_ref2","status","ariaLabelProp","statusLabels","ariaLabel","trim","concat","mergedConfig","mergeConfig","indicatorConfig","Indicator","component","_exp","_exp5","_ref3","tokens","statusOnlineColor","statusOfflineColor","StyledIndicator","styled","class","propsAsIs","vars","avatarRoot","Root","forwardRef","props","ref","avatarSize","size","className","_props$focused","focused","isScalable","_props$statusLabels","rest","_excluded","useMemo","getInitialsForName","_objectSpread","_extends","cx","classes","avatarItem","Wrapper","StatusIcon","avatarConfig","tag","layout","base","variations","css","viewCSS","focusedCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;AAcA,IAAMA,mBAAiC,GAAG;AACtCC,EAAAA,MAAM,EAAE,SAAS;AACjBC,EAAAA,QAAQ,EAAE,WAAA;AACd,CAAC,CAAA;AAED,IAAMC,gBAAgB,GAAGA,SAAnBA,gBAAgBA,CAAAC,I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IAAAA,EAAAA,IAAAA;AAAK,KAAC,CAAW,CAAA,EAEhGS,MAAM,iBACHR,KAAA,CAAAC,aAAA,CAACmD,wBAAU,EACPpD,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAACwB,eAAe,EAAA;MAAC,YAAYf,EAAAA,YAAY,CAACF,MAAM,CAAE;AAACA,MAAAA,MAAM,EAAEA,MAAAA;KAAO,CAC1D,CAEd,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AACN,EAAC;AAEM,IAAM6C,YAAY,GAAG;AACxBtD,EAAAA,IAAI,EAAE,QAAQ;AACduD,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEzB,UAAU;AAClB0B,EAAAA,IAAI,EAAJA,kBAAI;AACJC,EAAAA,UAAU,EAAE;AACRrB,IAAAA,IAAI,EAAE;AACFsB,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDpB,IAAAA,OAAO,EAAE;AACLmB,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNzB,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":";;;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Ac;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;;;;;"}
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,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AACrBE,MAAAA,SAAS,EAAEA,SAAAA;AAAU,KACxB,CACJ,EACAnC,aAAa,KAAKS,mBAAa,CAACU,KAAK,iBAClCsC,KAAA,CAAAC,aAAA,CAACe,2BAAa,EAAA;AACV1E,MAAAA,IAAI,EAAEA,IAAK;AACXE,MAAAA,SAAS,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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ACRsC,QAAQ,EAAA,IAAA;AACR9F,MAAAA,SAAS,EAAEA,SAAU;AACrBC,MAAAA,YAAY,EAAEA,YAAa;AAC3BH,MAAAA,GAAG,EAAEA,GAAI;AACTC,MAAAA,GAAG,EAAEA,GAAI;AACTF,MAAAA,KAAK,EAAED,aAAc;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,C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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;;;;;"}
@@ -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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QAAQ,EAAE;AACVC,QAAAA,SAAS,CAAC,CAACQ,MAAM,EAAEC,SAAS,CAAC,CAAC,CAAA;AAE9BzB,QAAAA,oBAAoB,aAApBA,oBAAoB,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAApBA,oBAAoB,CAAGwB,MAAM,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,KA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A,SAAS,EAAEA,SAAU;AACrBC,MAAAA,GAAG,EAAEA,GAAI;AACTC,MAAAA,GAAG,EAAEA,GAAAA;KACDG,EAAAA,IAAI,CACX,CAAC,CAAA;GAET,CAAA;AAAA;;;;"}
@@ -26,31 +26,31 @@ var isOutOfBound = function isOutOfBound(_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: