@via-profit/ui-kit 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1060) hide show
  1. package/Accordion/AccordionActions.d.ts +1 -1
  2. package/Accordion/AccordionActions.js +2 -1
  3. package/Accordion/AccordionContainer.d.ts +1 -1
  4. package/Accordion/AccordionContainer.js +2 -13
  5. package/Accordion/AccordionContent.d.ts +1 -1
  6. package/Accordion/AccordionContent.js +5 -1
  7. package/Accordion/AccordionHeader.d.ts +2 -2
  8. package/Accordion/AccordionHeader.js +8 -2
  9. package/Accordion/index.d.ts +9 -9
  10. package/Accordion/index.js +17 -7
  11. package/Autocomplete/AutocompleteContainer.d.ts +2 -2
  12. package/Autocomplete/AutocompleteContainer.js +17 -7
  13. package/Autocomplete/AutocompleteItem.js +2 -1
  14. package/Autocomplete/context.d.ts +3 -3
  15. package/Autocomplete/index.d.ts +2 -2
  16. package/Avatar/AvatarContainer.d.ts +2 -2
  17. package/Avatar/AvatarPicture.d.ts +2 -2
  18. package/Badge/BadgeBase.d.ts +1 -1
  19. package/Badge/BadgeContainer.d.ts +1 -1
  20. package/Badge/BadgeDeleteButton.d.ts +2 -2
  21. package/Badge/BadgeStyled.js +3 -1
  22. package/Badge/index.d.ts +1 -1
  23. package/Button/ButtonBase.d.ts +10 -2
  24. package/Button/ButtonBase.js +2 -2
  25. package/Button/ButtonContainer.d.ts +20 -2
  26. package/Button/ButtonContainer.js +28 -7
  27. package/Button/ButtonIconWrapper.d.ts +1 -1
  28. package/Button/ButtonStyled.d.ts +3 -2
  29. package/Button/ButtonStyled.js +3 -167
  30. package/Button/ButtonTextWrapper.d.ts +1 -1
  31. package/Button/buttonVariants.d.ts +16 -0
  32. package/Button/buttonVariants.js +169 -0
  33. package/Button/index.d.ts +1 -1
  34. package/ButtonGroup/index.js +4 -3
  35. package/CHANGELOG.md +70 -1
  36. package/Calendar/CalendarComponent.js +17 -7
  37. package/Calendar/CalendarControlButton.d.ts +2 -2
  38. package/Calendar/CalendarPaper.js +2 -1
  39. package/Calendar/CalendarWeekDayLabel.d.ts +2 -2
  40. package/Calendar/CalendarWeekRowButton.d.ts +1 -1
  41. package/Calendar/IconChevronDown.js +17 -7
  42. package/Calendar/index.d.ts +1 -1
  43. package/Calendar/index.js +17 -7
  44. package/Checkbox/CheckboxAsterisk.js +17 -7
  45. package/Checkbox/CheckboxBox.d.ts +2 -2
  46. package/Checkbox/CheckboxBox.js +3 -1
  47. package/Checkbox/CheckboxContainer.d.ts +2 -2
  48. package/Checkbox/CheckboxErrorText.js +17 -7
  49. package/Checkbox/index.d.ts +10 -10
  50. package/Checkbox/useCheckboxColor.d.ts +1 -1
  51. package/ClickOutside/index.js +5 -2
  52. package/DatePicker/index.d.ts +1 -1
  53. package/ErrorBoundary/RenderError.d.ts +2 -0
  54. package/ErrorBoundary/RenderError.js +20 -13
  55. package/ErrorBoundary/index.d.ts +20 -7
  56. package/ErrorBoundary/index.js +7 -8
  57. package/Grid/index.d.ts +17 -5
  58. package/Grid/index.js +7 -2
  59. package/LoadingIndicator/LoadingOverlay.js +17 -7
  60. package/LoadingIndicator/Spinner.js +17 -7
  61. package/LoadingIndicator/SpinnerCircle.d.ts +2 -3
  62. package/Menu/MenuContainer.d.ts +2 -2
  63. package/Menu/MenuContainer.js +18 -8
  64. package/Menu/MenuItem.js +5 -1
  65. package/Menu/MenuList.js +2 -1
  66. package/Menu/context.d.ts +1 -1
  67. package/Menu/index.d.ts +1 -1
  68. package/Modal/BaseModal/ModalInner.js +2 -0
  69. package/Modal/BaseModal/ModalWrapper.js +30 -37
  70. package/Modal/BaseModal/context.d.ts +1 -1
  71. package/Modal/ConfirmBox/ConfirmBoxContent.js +5 -1
  72. package/Modal/ConfirmBox/ConfirmBoxFooter.js +5 -1
  73. package/Modal/ConfirmBox/ConfirmBoxHeader.js +5 -1
  74. package/Modal/Dialog/DialogInner.js +5 -1
  75. package/Modal/Dialog/index.js +17 -7
  76. package/Modal/Drawer/DrawerCloseIcon.js +17 -7
  77. package/Modal/Drawer/DrawerFooter.js +5 -1
  78. package/Modal/Drawer/DrawerHeader.d.ts +4 -4
  79. package/Modal/Drawer/DrawerHeader.js +5 -1
  80. package/Modal/Drawer/index.js +17 -7
  81. package/Modal/MessageBox/MessageBoxContent.js +5 -1
  82. package/Modal/MessageBox/MessageBoxFooter.js +5 -1
  83. package/Modal/MessageBox/MessageBoxHeader.js +5 -1
  84. package/Modal/MessageBox/index.js +17 -7
  85. package/Modal/index.js +17 -7
  86. package/Pagination/PaginationContainer.d.ts +9 -0
  87. package/Pagination/PaginationContainer.js +34 -0
  88. package/Pagination/PaginationGap.d.ts +4 -0
  89. package/Pagination/PaginationGap.js +22 -0
  90. package/Pagination/PaginationIcons.d.ts +6 -0
  91. package/Pagination/PaginationIcons.js +21 -0
  92. package/Pagination/PaginationItem.d.ts +44 -0
  93. package/Pagination/PaginationItem.js +59 -0
  94. package/Pagination/getPaginationItems.d.ts +22 -0
  95. package/Pagination/getPaginationItems.js +42 -0
  96. package/Pagination/index.d.ts +104 -0
  97. package/Pagination/index.js +98 -0
  98. package/Pagination/usePagination.d.ts +105 -0
  99. package/Pagination/usePagination.js +66 -0
  100. package/PhoneField/CountryFlagComponent.d.ts +1 -1
  101. package/PhoneField/CountryFlagComponent.js +1 -1
  102. package/PhoneField/UnknownFlag.d.ts +1 -2
  103. package/PhoneField/UnknownFlag.js +2 -2
  104. package/PhoneField/flags/BY.js +49 -0
  105. package/PhoneField/flags/CN.js +45 -0
  106. package/PhoneField/flags/IL.js +45 -0
  107. package/PhoneField/flags/JP.js +44 -0
  108. package/PhoneField/flags/KZ.js +45 -0
  109. package/PhoneField/flags/RU.js +46 -0
  110. package/PhoneField/flags/UA.js +44 -0
  111. package/PhoneField/flags/US.js +48 -0
  112. package/PhoneField/flags/Unknown.js +52 -0
  113. package/PhoneField/templates.d.ts +2 -2
  114. package/PhoneField/templates.js +8 -8
  115. package/PhoneField/usePhoneUtils.js +1 -1
  116. package/Radio/RadioBox.d.ts +1 -1
  117. package/Radio/RadioBox.js +3 -1
  118. package/Radio/RadioContainer.d.ts +2 -2
  119. package/Radio/index.d.ts +5 -5
  120. package/Radio/useRadioColor.d.ts +1 -1
  121. package/RadioGroup/RadioGroupAsterisk.js +17 -7
  122. package/RadioGroup/RadioGroupErrorText.js +17 -7
  123. package/RadioGroup/RadioGroupItems.d.ts +1 -1
  124. package/RadioGroup/index.d.ts +11 -11
  125. package/Selectbox/SelectboxButton.d.ts +4 -4
  126. package/Selectbox/SelectboxButton.js +27 -10
  127. package/Selectbox/SelectboxButtonWrapper.d.ts +2 -2
  128. package/Selectbox/SelectboxButtonWrapper.js +19 -10
  129. package/Selectbox/SelectboxMenu.d.ts +2 -2
  130. package/Selectbox/SelectboxMenu.js +17 -7
  131. package/Selectbox/index.d.ts +2 -2
  132. package/Selectbox/index.js +17 -7
  133. package/Slider/SliderContainer.d.ts +19 -0
  134. package/Slider/SliderContainer.js +50 -0
  135. package/Slider/SliderMark.d.ts +25 -0
  136. package/Slider/SliderMark.js +40 -0
  137. package/Slider/SliderMarkLabel.d.ts +25 -0
  138. package/Slider/SliderMarkLabel.js +34 -0
  139. package/Slider/SliderRail.d.ts +13 -0
  140. package/Slider/SliderRail.js +49 -0
  141. package/Slider/SliderThumb.d.ts +37 -0
  142. package/Slider/SliderThumb.js +71 -0
  143. package/Slider/SliderTrack.d.ts +29 -0
  144. package/Slider/SliderTrack.js +48 -0
  145. package/Slider/index.d.ts +134 -0
  146. package/Slider/index.js +249 -0
  147. package/Slider/useSliderColor.d.ts +6 -0
  148. package/Slider/useSliderColor.js +33 -0
  149. package/Slider/utils.d.ts +10 -0
  150. package/Slider/utils.js +31 -0
  151. package/Stack/index.d.ts +18 -6
  152. package/Stack/index.js +7 -2
  153. package/Surface/SurfaceContainer.d.ts +3 -3
  154. package/Surface/SurfaceContainer.js +2 -1
  155. package/Surface/SurfaceContent.d.ts +2 -2
  156. package/Surface/SurfaceContent.js +18 -11
  157. package/Surface/SurfaceFooter.d.ts +2 -2
  158. package/Surface/SurfaceFooter.js +5 -1
  159. package/Surface/SurfaceHeader.d.ts +2 -2
  160. package/Surface/SurfaceHeader.js +6 -2
  161. package/Surface/SurfaceSubheader.d.ts +2 -2
  162. package/Surface/SurfaceSubheader.js +6 -2
  163. package/Surface/index.d.ts +10 -10
  164. package/Surface/index.js +17 -7
  165. package/Swiper/Swiper.d.ts +15 -15
  166. package/Swiper/Swiper.js +17 -7
  167. package/Swiper/SwiperContainer.d.ts +2 -2
  168. package/Swiper/SwiperSlide.js +17 -7
  169. package/Swiper/SwiperSlidesRenderer.js +17 -7
  170. package/Swiper/SwiperTrack.d.ts +2 -2
  171. package/Swiper/SwiperTrack.js +17 -7
  172. package/Swiper/SwiperWrapper.d.ts +2 -2
  173. package/Swiper/SwiperWrapper.js +19 -7
  174. package/Switch/SwitchAsterisk.js +17 -7
  175. package/Switch/SwitchContainer.d.ts +2 -2
  176. package/Switch/SwitchDot.d.ts +1 -1
  177. package/Switch/SwitchDot.js +2 -4
  178. package/Switch/SwitchErrorText.js +17 -7
  179. package/Switch/SwitchToggleWrapper.js +2 -0
  180. package/Switch/SwitchTrack.d.ts +1 -1
  181. package/Switch/index.d.ts +9 -9
  182. package/Switch/useSwitchColor.d.ts +1 -1
  183. package/Table/Table.d.ts +1 -1
  184. package/Table/Table.js +2 -1
  185. package/Table/TableCaption.js +5 -1
  186. package/Table/TableCell.js +6 -2
  187. package/Table/TableFooter.js +2 -1
  188. package/Table/TableHeaderCell.js +6 -2
  189. package/Tabs/Tab.d.ts +14 -0
  190. package/Tabs/Tab.js +131 -0
  191. package/Tabs/TabList.d.ts +4 -0
  192. package/Tabs/TabList.js +104 -0
  193. package/Tabs/TabPanel.d.ts +26 -0
  194. package/Tabs/TabPanel.js +51 -0
  195. package/Tabs/Tabs.d.ts +79 -0
  196. package/Tabs/Tabs.js +80 -0
  197. package/Tabs/context.d.ts +23 -0
  198. package/Tabs/context.js +16 -0
  199. package/Tabs/index.d.ts +10 -0
  200. package/Tabs/index.js +14 -0
  201. package/Tabs/useTabsColor.d.ts +6 -0
  202. package/Tabs/useTabsColor.js +33 -0
  203. package/TextArea/TextAreaIconWrapper.d.ts +3 -3
  204. package/TextArea/TextAreaIconWrapper.js +17 -7
  205. package/TextArea/TextAreaInput.js +23 -8
  206. package/TextArea/index.js +17 -7
  207. package/TextField/TextFieldContainer.js +17 -7
  208. package/TextField/TextFieldErrorText.js +17 -7
  209. package/TextField/TextFieldIconWrapper.d.ts +3 -3
  210. package/TextField/TextFieldIconWrapper.js +17 -7
  211. package/TextField/TextFieldInput.js +23 -8
  212. package/TextField/TextFieldInputWrapper.d.ts +5 -5
  213. package/TextField/TextFieldInputWrapper.js +22 -9
  214. package/TextField/TextFieldLabel.js +17 -7
  215. package/TextField/TextFieldLabelAsterisk.js +17 -7
  216. package/TextField/index.d.ts +1 -1
  217. package/TextField/index.js +17 -7
  218. package/ThemeProvider/createTheme.js +8 -2
  219. package/ThemeProvider/index.d.ts +87 -1
  220. package/ThemeProvider/index.js +1 -0
  221. package/ThemeProvider/tokens.d.ts +66 -0
  222. package/ThemeProvider/tokens.js +90 -0
  223. package/Toast/ToastAction.d.ts +4 -0
  224. package/Toast/ToastAction.js +32 -0
  225. package/Toast/ToastCard.d.ts +20 -0
  226. package/Toast/ToastCard.js +89 -0
  227. package/Toast/ToastCloseButton.d.ts +4 -0
  228. package/Toast/ToastCloseButton.js +48 -0
  229. package/Toast/ToastContainer.d.ts +88 -0
  230. package/Toast/ToastContainer.js +154 -0
  231. package/Toast/ToastIcon.d.ts +11 -0
  232. package/Toast/ToastIcon.js +71 -0
  233. package/Toast/ToastItem.d.ts +29 -0
  234. package/Toast/ToastItem.js +120 -0
  235. package/Toast/index.d.ts +6 -0
  236. package/Toast/index.js +11 -0
  237. package/Toast/store.d.ts +155 -0
  238. package/Toast/store.js +75 -0
  239. package/Tooltip/TooltipArrow.d.ts +15 -0
  240. package/Tooltip/TooltipArrow.js +62 -0
  241. package/Tooltip/TooltipContainer.d.ts +4 -0
  242. package/Tooltip/TooltipContainer.js +54 -0
  243. package/Tooltip/index.d.ts +78 -0
  244. package/Tooltip/index.js +195 -0
  245. package/Typography/Base.d.ts +2 -3
  246. package/Typography/Blockquote.d.ts +2 -3
  247. package/Typography/List.d.ts +6 -7
  248. package/Typography/Paragraph.d.ts +1 -1
  249. package/Typography/Paragraph.js +17 -7
  250. package/Typography/SectionDescription.d.ts +2 -3
  251. package/Typography/U.d.ts +2 -3
  252. package/esm/Accordion/AccordionActions.js +27 -0
  253. package/esm/Accordion/AccordionContainer.js +45 -0
  254. package/esm/Accordion/AccordionContent.js +43 -0
  255. package/esm/Accordion/AccordionHeader.js +71 -0
  256. package/esm/Accordion/Chevron.js +8 -0
  257. package/esm/Accordion/index.js +52 -0
  258. package/esm/Autocomplete/AutocompleteContainer.js +403 -0
  259. package/esm/Autocomplete/AutocompleteItem.js +39 -0
  260. package/esm/Autocomplete/AutocompleteTagsInput.js +59 -0
  261. package/esm/Autocomplete/IconClear.js +4 -0
  262. package/esm/Autocomplete/context.js +58 -0
  263. package/esm/Autocomplete/index.js +32 -0
  264. package/esm/Avatar/AvatarBase.js +30 -0
  265. package/esm/Avatar/AvatarContainer.js +34 -0
  266. package/esm/Avatar/AvatarIconWrapper.js +25 -0
  267. package/esm/Avatar/AvatarOnlineBadge.js +31 -0
  268. package/esm/Avatar/AvatarPicture.js +69 -0
  269. package/esm/Avatar/AvatarTextWrapper.js +31 -0
  270. package/esm/Avatar/index.js +107 -0
  271. package/esm/Badge/BadgeBase.js +48 -0
  272. package/esm/Badge/BadgeContainer.js +38 -0
  273. package/esm/Badge/BadgeDeleteButton.js +87 -0
  274. package/esm/Badge/BadgeIconWrapper.js +24 -0
  275. package/esm/Badge/BadgeOutlined.js +7 -0
  276. package/esm/Badge/BadgeStandard.js +7 -0
  277. package/esm/Badge/BadgeStyled.js +122 -0
  278. package/esm/Badge/BadgeTextWrapper.js +25 -0
  279. package/esm/Badge/index.js +5 -0
  280. package/esm/Button/ButtonBase.js +37 -0
  281. package/esm/Button/ButtonContainer.js +73 -0
  282. package/esm/Button/ButtonIconWrapper.js +32 -0
  283. package/esm/Button/ButtonOutlined.js +7 -0
  284. package/esm/Button/ButtonPlain.js +7 -0
  285. package/esm/Button/ButtonStandard.js +7 -0
  286. package/esm/Button/ButtonStyled.js +36 -0
  287. package/esm/Button/ButtonTextWrapper.js +30 -0
  288. package/esm/Button/buttonVariants.js +162 -0
  289. package/esm/Button/index.js +5 -0
  290. package/esm/ButtonGroup/ButtonGroupContext.js +6 -0
  291. package/esm/ButtonGroup/index.js +128 -0
  292. package/esm/Calendar/CalendarBody.js +25 -0
  293. package/esm/Calendar/CalendarCell.js +62 -0
  294. package/esm/Calendar/CalendarComponent.js +665 -0
  295. package/esm/Calendar/CalendarControlButton.js +39 -0
  296. package/esm/Calendar/CalendarDateContainer.js +24 -0
  297. package/esm/Calendar/CalendarDayBadge.js +70 -0
  298. package/esm/Calendar/CalendarEmptyCell.js +32 -0
  299. package/esm/Calendar/CalendarFooter.js +37 -0
  300. package/esm/Calendar/CalendarHeader.js +29 -0
  301. package/esm/Calendar/CalendarHeading.js +28 -0
  302. package/esm/Calendar/CalendarIconNext.js +4 -0
  303. package/esm/Calendar/CalendarIconPrev.js +4 -0
  304. package/esm/Calendar/CalendarMonthCell.js +28 -0
  305. package/esm/Calendar/CalendarMonthsSelector.js +25 -0
  306. package/esm/Calendar/CalendarPaper.js +29 -0
  307. package/esm/Calendar/CalendarSubheading.js +25 -0
  308. package/esm/Calendar/CalendarToolbar.js +26 -0
  309. package/esm/Calendar/CalendarWeekDayCell.js +27 -0
  310. package/esm/Calendar/CalendarWeekDayLabel.js +14 -0
  311. package/esm/Calendar/CalendarWeekDayWeekNumber.js +33 -0
  312. package/esm/Calendar/CalendarWeekDaysBar.js +34 -0
  313. package/esm/Calendar/CalendarWeekRow.js +25 -0
  314. package/esm/Calendar/CalendarWeekRowButton.js +26 -0
  315. package/esm/Calendar/CalendarYearCell.js +28 -0
  316. package/esm/Calendar/CalendarYearsSelector.js +59 -0
  317. package/esm/Calendar/IconChevronDown.js +6 -0
  318. package/esm/Calendar/index.js +8 -0
  319. package/esm/Calendar/use-calendar.js +155 -0
  320. package/esm/Checkbox/CheckboxAsterisk.js +25 -0
  321. package/esm/Checkbox/CheckboxBox.js +85 -0
  322. package/esm/Checkbox/CheckboxContainer.js +33 -0
  323. package/esm/Checkbox/CheckboxErrorText.js +48 -0
  324. package/esm/Checkbox/CheckboxIcon.js +52 -0
  325. package/esm/Checkbox/CheckboxTextWrapper.js +24 -0
  326. package/esm/Checkbox/CheckboxWrapper.js +24 -0
  327. package/esm/Checkbox/index.js +66 -0
  328. package/esm/Checkbox/useCheckboxColor.js +28 -0
  329. package/esm/ClickOutside/index.js +55 -0
  330. package/esm/Color/Color.js +324 -0
  331. package/esm/Color/ColorGenerator.js +137 -0
  332. package/esm/Color/ColorParser.js +320 -0
  333. package/esm/Color/index.js +5 -0
  334. package/esm/DatePicker/DatePickerIcon.js +4 -0
  335. package/esm/DatePicker/index.js +176 -0
  336. package/esm/DatePicker/useDatePickerFormat.js +121 -0
  337. package/esm/ErrorBoundary/RenderError.js +49 -0
  338. package/esm/ErrorBoundary/index.js +25 -0
  339. package/esm/Grid/index.js +43 -0
  340. package/esm/Highlighted/HighlightedContainer.js +17 -0
  341. package/esm/Highlighted/HighlightedMark.js +25 -0
  342. package/esm/Highlighted/HighlightedText.js +17 -0
  343. package/esm/Highlighted/index.js +50 -0
  344. package/esm/Image/index.js +40 -0
  345. package/esm/LoadingIndicator/LoadingOverlay.js +35 -0
  346. package/esm/LoadingIndicator/Spinner.js +53 -0
  347. package/esm/LoadingIndicator/SpinnerCircle.js +27 -0
  348. package/esm/LoadingIndicator/index.js +6 -0
  349. package/esm/MaskedField/index.js +74 -0
  350. package/esm/MaskedField/templates.js +80 -0
  351. package/esm/MaskedField/useMasked.js +106 -0
  352. package/esm/Menu/MenuContainer.js +365 -0
  353. package/esm/Menu/MenuItem.js +68 -0
  354. package/esm/Menu/MenuList.js +81 -0
  355. package/esm/Menu/context.js +41 -0
  356. package/esm/Menu/index.js +10 -0
  357. package/esm/Modal/BaseModal/ModalInner.js +42 -0
  358. package/esm/Modal/BaseModal/ModalInnerContainer.js +38 -0
  359. package/esm/Modal/BaseModal/ModalOverlay.js +28 -0
  360. package/esm/Modal/BaseModal/ModalWrapper.js +165 -0
  361. package/esm/Modal/BaseModal/RenderModal.js +31 -0
  362. package/esm/Modal/BaseModal/context.js +41 -0
  363. package/esm/Modal/BaseModal/index.js +49 -0
  364. package/esm/Modal/BaseModal/useDialogID.js +7 -0
  365. package/esm/Modal/ConfirmBox/ConfirmBoxContainer.js +27 -0
  366. package/esm/Modal/ConfirmBox/ConfirmBoxContent.js +26 -0
  367. package/esm/Modal/ConfirmBox/ConfirmBoxFooter.js +45 -0
  368. package/esm/Modal/ConfirmBox/ConfirmBoxHeader.js +30 -0
  369. package/esm/Modal/ConfirmBox/index.js +46 -0
  370. package/esm/Modal/Dialog/DialogInner.js +26 -0
  371. package/esm/Modal/Dialog/index.js +30 -0
  372. package/esm/Modal/Drawer/DrawerCloseIcon.js +12 -0
  373. package/esm/Modal/Drawer/DrawerContainer.js +26 -0
  374. package/esm/Modal/Drawer/DrawerContent.js +26 -0
  375. package/esm/Modal/Drawer/DrawerFooter.js +25 -0
  376. package/esm/Modal/Drawer/DrawerHeader.js +60 -0
  377. package/esm/Modal/Drawer/DrawerInner.js +145 -0
  378. package/esm/Modal/Drawer/index.js +49 -0
  379. package/esm/Modal/MessageBox/MessageBoxContainer.js +23 -0
  380. package/esm/Modal/MessageBox/MessageBoxContent.js +26 -0
  381. package/esm/Modal/MessageBox/MessageBoxFooter.js +44 -0
  382. package/esm/Modal/MessageBox/MessageBoxHeader.js +30 -0
  383. package/esm/Modal/MessageBox/index.js +47 -0
  384. package/esm/Modal/index.js +30 -0
  385. package/esm/NoSSR/index.js +10 -0
  386. package/esm/Pagination/PaginationContainer.js +29 -0
  387. package/esm/Pagination/PaginationGap.js +17 -0
  388. package/esm/Pagination/PaginationIcons.js +15 -0
  389. package/esm/Pagination/PaginationItem.js +54 -0
  390. package/esm/Pagination/getPaginationItems.js +40 -0
  391. package/esm/Pagination/index.js +77 -0
  392. package/esm/Pagination/usePagination.js +61 -0
  393. package/esm/PhoneField/CountryFlagComponent.js +39 -0
  394. package/esm/PhoneField/UnknownFlag.js +6 -0
  395. package/esm/PhoneField/flags/BY.js +11 -0
  396. package/esm/PhoneField/flags/CN.js +7 -0
  397. package/esm/PhoneField/flags/IL.js +7 -0
  398. package/esm/PhoneField/flags/JP.js +6 -0
  399. package/esm/PhoneField/flags/KZ.js +7 -0
  400. package/esm/PhoneField/flags/RU.js +8 -0
  401. package/esm/PhoneField/flags/UA.js +6 -0
  402. package/esm/PhoneField/flags/US.js +10 -0
  403. package/esm/PhoneField/flags/Unknown.js +14 -0
  404. package/esm/PhoneField/flags/isLabelled.js +5 -0
  405. package/esm/PhoneField/index.js +71 -0
  406. package/esm/PhoneField/templates.js +39 -0
  407. package/esm/PhoneField/usePhoneUtils.js +156 -0
  408. package/esm/Popper/Popper.js +97 -0
  409. package/esm/Popper/PopperContainer.js +27 -0
  410. package/esm/Popper/index.js +5 -0
  411. package/esm/Popper/usePopper.js +514 -0
  412. package/esm/Radio/RadioBox.js +97 -0
  413. package/esm/Radio/RadioContainer.js +33 -0
  414. package/esm/Radio/RadioTextWrapper.js +24 -0
  415. package/esm/Radio/index.js +44 -0
  416. package/esm/Radio/useRadioColor.js +28 -0
  417. package/esm/RadioGroup/RadioGroupAsterisk.js +25 -0
  418. package/esm/RadioGroup/RadioGroupContainer.js +31 -0
  419. package/esm/RadioGroup/RadioGroupContext.js +6 -0
  420. package/esm/RadioGroup/RadioGroupErrorText.js +48 -0
  421. package/esm/RadioGroup/RadioGroupItems.js +25 -0
  422. package/esm/RadioGroup/RadioGroupLegend.js +32 -0
  423. package/esm/RadioGroup/index.js +57 -0
  424. package/esm/Selectbox/SelectboxButton.js +59 -0
  425. package/esm/Selectbox/SelectboxButtonWrapper.js +33 -0
  426. package/esm/Selectbox/SelectboxChevronIcon.js +23 -0
  427. package/esm/Selectbox/SelectboxContainer.js +23 -0
  428. package/esm/Selectbox/SelectboxMenu.js +30 -0
  429. package/esm/Selectbox/index.js +128 -0
  430. package/esm/Slider/SliderContainer.js +45 -0
  431. package/esm/Slider/SliderMark.js +35 -0
  432. package/esm/Slider/SliderMarkLabel.js +29 -0
  433. package/esm/Slider/SliderRail.js +44 -0
  434. package/esm/Slider/SliderThumb.js +66 -0
  435. package/esm/Slider/SliderTrack.js +43 -0
  436. package/esm/Slider/index.js +244 -0
  437. package/esm/Slider/useSliderColor.js +28 -0
  438. package/esm/Slider/utils.js +25 -0
  439. package/esm/Stack/index.js +38 -0
  440. package/esm/Surface/SurfaceContainer.js +41 -0
  441. package/esm/Surface/SurfaceContent.js +41 -0
  442. package/esm/Surface/SurfaceFooter.js +30 -0
  443. package/esm/Surface/SurfaceHeader.js +29 -0
  444. package/esm/Surface/SurfaceSubheader.js +28 -0
  445. package/esm/Surface/index.js +43 -0
  446. package/esm/Swiper/Swiper.js +518 -0
  447. package/esm/Swiper/SwiperContainer.js +7 -0
  448. package/esm/Swiper/SwiperSlide.js +29 -0
  449. package/esm/Swiper/SwiperSlidesRenderer.js +52 -0
  450. package/esm/Swiper/SwiperTrack.js +31 -0
  451. package/esm/Swiper/SwiperWrapper.js +41 -0
  452. package/esm/Swiper/index.js +7 -0
  453. package/esm/Switch/SwitchAsterisk.js +25 -0
  454. package/esm/Switch/SwitchContainer.js +47 -0
  455. package/esm/Switch/SwitchDot.js +98 -0
  456. package/esm/Switch/SwitchErrorText.js +48 -0
  457. package/esm/Switch/SwitchTextWrapper.js +25 -0
  458. package/esm/Switch/SwitchToggleWrapper.js +53 -0
  459. package/esm/Switch/SwitchTrack.js +39 -0
  460. package/esm/Switch/SwitchWrapper.js +26 -0
  461. package/esm/Switch/index.js +61 -0
  462. package/esm/Switch/useSwitchColor.js +28 -0
  463. package/esm/Table/Table.js +41 -0
  464. package/esm/Table/TableBody.js +27 -0
  465. package/esm/Table/TableCaption.js +28 -0
  466. package/esm/Table/TableCell.js +27 -0
  467. package/esm/Table/TableFooter.js +33 -0
  468. package/esm/Table/TableHeader.js +29 -0
  469. package/esm/Table/TableHeaderCell.js +33 -0
  470. package/esm/Table/TableRow.js +21 -0
  471. package/esm/Table/index.js +18 -0
  472. package/esm/Tabs/Tab.js +126 -0
  473. package/esm/Tabs/TabList.js +99 -0
  474. package/esm/Tabs/TabPanel.js +46 -0
  475. package/esm/Tabs/Tabs.js +75 -0
  476. package/esm/Tabs/context.js +9 -0
  477. package/esm/Tabs/index.js +5 -0
  478. package/esm/Tabs/useTabsColor.js +28 -0
  479. package/esm/TextArea/TextAreaIconWrapper.js +25 -0
  480. package/esm/TextArea/TextAreaInput.js +51 -0
  481. package/esm/TextArea/index.js +66 -0
  482. package/esm/TextField/TextFieldContainer.js +26 -0
  483. package/esm/TextField/TextFieldErrorText.js +48 -0
  484. package/esm/TextField/TextFieldIconWrapper.js +46 -0
  485. package/esm/TextField/TextFieldInput.js +51 -0
  486. package/esm/TextField/TextFieldInputWrapper.js +62 -0
  487. package/esm/TextField/TextFieldLabel.js +23 -0
  488. package/esm/TextField/TextFieldLabelAsterisk.js +24 -0
  489. package/esm/TextField/index.js +86 -0
  490. package/esm/ThemeProvider/createTheme.js +46 -0
  491. package/esm/ThemeProvider/index.js +10 -0
  492. package/esm/ThemeProvider/tokens.js +79 -0
  493. package/esm/Toast/ToastAction.js +27 -0
  494. package/esm/Toast/ToastCard.js +83 -0
  495. package/esm/Toast/ToastCloseButton.js +43 -0
  496. package/esm/Toast/ToastContainer.js +149 -0
  497. package/esm/Toast/ToastIcon.js +66 -0
  498. package/esm/Toast/ToastItem.js +115 -0
  499. package/esm/Toast/index.js +4 -0
  500. package/esm/Toast/store.js +72 -0
  501. package/esm/Tooltip/TooltipArrow.js +57 -0
  502. package/esm/Tooltip/TooltipContainer.js +49 -0
  503. package/esm/Tooltip/index.js +190 -0
  504. package/esm/Typography/Base.js +11 -0
  505. package/esm/Typography/Blockquote.js +18 -0
  506. package/esm/Typography/Del.js +22 -0
  507. package/esm/Typography/Em.js +22 -0
  508. package/esm/Typography/H1.js +23 -0
  509. package/esm/Typography/H2.js +23 -0
  510. package/esm/Typography/H3.js +23 -0
  511. package/esm/Typography/H4.js +23 -0
  512. package/esm/Typography/H5.js +23 -0
  513. package/esm/Typography/H6.js +23 -0
  514. package/esm/Typography/List.js +26 -0
  515. package/esm/Typography/Paragraph.js +24 -0
  516. package/esm/Typography/SectionDescription.js +11 -0
  517. package/esm/Typography/SectionTitle.js +44 -0
  518. package/esm/Typography/Span.js +22 -0
  519. package/esm/Typography/Strong.js +22 -0
  520. package/esm/Typography/U.js +5 -0
  521. package/esm/Typography/index.js +20 -0
  522. package/esm/index.js +1 -0
  523. package/esm/utils/TabManager.js +139 -0
  524. package/esm/utils/getElementRef.js +13 -0
  525. package/esm/utils/spacing.js +10 -0
  526. package/package.json +1597 -74
  527. package/utils/getElementRef.d.ts +8 -0
  528. package/utils/getElementRef.js +18 -0
  529. package/CountryFlags/AC.js +0 -57
  530. package/CountryFlags/AD.js +0 -43
  531. package/CountryFlags/AE.js +0 -36
  532. package/CountryFlags/AF.js +0 -37
  533. package/CountryFlags/AG.js +0 -39
  534. package/CountryFlags/AI.js +0 -41
  535. package/CountryFlags/AL.js +0 -39
  536. package/CountryFlags/AM.d.ts +0 -3
  537. package/CountryFlags/AM.js +0 -35
  538. package/CountryFlags/AO.d.ts +0 -3
  539. package/CountryFlags/AO.js +0 -39
  540. package/CountryFlags/AQ.d.ts +0 -3
  541. package/CountryFlags/AQ.js +0 -34
  542. package/CountryFlags/AR.d.ts +0 -3
  543. package/CountryFlags/AR.js +0 -35
  544. package/CountryFlags/AS.d.ts +0 -3
  545. package/CountryFlags/AS.js +0 -37
  546. package/CountryFlags/AT.d.ts +0 -3
  547. package/CountryFlags/AT.js +0 -34
  548. package/CountryFlags/AU.d.ts +0 -3
  549. package/CountryFlags/AU.js +0 -45
  550. package/CountryFlags/AW.d.ts +0 -3
  551. package/CountryFlags/AW.js +0 -37
  552. package/CountryFlags/AX.d.ts +0 -3
  553. package/CountryFlags/AX.js +0 -35
  554. package/CountryFlags/AZ.d.ts +0 -3
  555. package/CountryFlags/AZ.js +0 -38
  556. package/CountryFlags/BA.d.ts +0 -3
  557. package/CountryFlags/BA.js +0 -44
  558. package/CountryFlags/BB.d.ts +0 -3
  559. package/CountryFlags/BB.js +0 -36
  560. package/CountryFlags/BD.d.ts +0 -3
  561. package/CountryFlags/BD.js +0 -34
  562. package/CountryFlags/BE.d.ts +0 -3
  563. package/CountryFlags/BE.js +0 -35
  564. package/CountryFlags/BF.d.ts +0 -3
  565. package/CountryFlags/BF.js +0 -35
  566. package/CountryFlags/BG.d.ts +0 -3
  567. package/CountryFlags/BG.js +0 -35
  568. package/CountryFlags/BH.d.ts +0 -3
  569. package/CountryFlags/BH.js +0 -34
  570. package/CountryFlags/BI.d.ts +0 -3
  571. package/CountryFlags/BI.js +0 -40
  572. package/CountryFlags/BJ.d.ts +0 -3
  573. package/CountryFlags/BJ.js +0 -35
  574. package/CountryFlags/BL.d.ts +0 -3
  575. package/CountryFlags/BL.js +0 -43
  576. package/CountryFlags/BM.d.ts +0 -3
  577. package/CountryFlags/BM.js +0 -44
  578. package/CountryFlags/BN.d.ts +0 -3
  579. package/CountryFlags/BN.js +0 -38
  580. package/CountryFlags/BO.d.ts +0 -3
  581. package/CountryFlags/BO.js +0 -35
  582. package/CountryFlags/BQ.d.ts +0 -3
  583. package/CountryFlags/BQ.js +0 -37
  584. package/CountryFlags/BR.d.ts +0 -3
  585. package/CountryFlags/BR.js +0 -36
  586. package/CountryFlags/BS.d.ts +0 -3
  587. package/CountryFlags/BS.js +0 -36
  588. package/CountryFlags/BT.d.ts +0 -3
  589. package/CountryFlags/BT.js +0 -35
  590. package/CountryFlags/BV.d.ts +0 -3
  591. package/CountryFlags/BV.js +0 -37
  592. package/CountryFlags/BW.d.ts +0 -3
  593. package/CountryFlags/BW.js +0 -36
  594. package/CountryFlags/BY.js +0 -39
  595. package/CountryFlags/BZ.d.ts +0 -3
  596. package/CountryFlags/BZ.js +0 -40
  597. package/CountryFlags/CA.d.ts +0 -3
  598. package/CountryFlags/CA.js +0 -35
  599. package/CountryFlags/CC.d.ts +0 -3
  600. package/CountryFlags/CC.js +0 -37
  601. package/CountryFlags/CD.d.ts +0 -3
  602. package/CountryFlags/CD.js +0 -36
  603. package/CountryFlags/CF.d.ts +0 -3
  604. package/CountryFlags/CF.js +0 -40
  605. package/CountryFlags/CG.d.ts +0 -3
  606. package/CountryFlags/CG.js +0 -35
  607. package/CountryFlags/CH.d.ts +0 -3
  608. package/CountryFlags/CH.js +0 -34
  609. package/CountryFlags/CI.d.ts +0 -3
  610. package/CountryFlags/CI.js +0 -35
  611. package/CountryFlags/CK.d.ts +0 -3
  612. package/CountryFlags/CK.js +0 -38
  613. package/CountryFlags/CL.d.ts +0 -3
  614. package/CountryFlags/CL.js +0 -36
  615. package/CountryFlags/CM.d.ts +0 -3
  616. package/CountryFlags/CM.js +0 -36
  617. package/CountryFlags/CN.js +0 -35
  618. package/CountryFlags/CO.d.ts +0 -3
  619. package/CountryFlags/CO.js +0 -35
  620. package/CountryFlags/CR.d.ts +0 -3
  621. package/CountryFlags/CR.js +0 -35
  622. package/CountryFlags/CU.d.ts +0 -3
  623. package/CountryFlags/CU.js +0 -38
  624. package/CountryFlags/CV.d.ts +0 -3
  625. package/CountryFlags/CV.js +0 -37
  626. package/CountryFlags/CW.d.ts +0 -3
  627. package/CountryFlags/CW.js +0 -36
  628. package/CountryFlags/CX.d.ts +0 -3
  629. package/CountryFlags/CX.js +0 -39
  630. package/CountryFlags/CY.d.ts +0 -3
  631. package/CountryFlags/CY.js +0 -38
  632. package/CountryFlags/CZ.d.ts +0 -3
  633. package/CountryFlags/CZ.js +0 -35
  634. package/CountryFlags/DE.d.ts +0 -3
  635. package/CountryFlags/DE.js +0 -35
  636. package/CountryFlags/DJ.d.ts +0 -3
  637. package/CountryFlags/DJ.js +0 -36
  638. package/CountryFlags/DK.d.ts +0 -3
  639. package/CountryFlags/DK.js +0 -34
  640. package/CountryFlags/DM.d.ts +0 -3
  641. package/CountryFlags/DM.js +0 -43
  642. package/CountryFlags/DO.d.ts +0 -3
  643. package/CountryFlags/DO.js +0 -42
  644. package/CountryFlags/DZ.d.ts +0 -3
  645. package/CountryFlags/DZ.js +0 -37
  646. package/CountryFlags/EC.d.ts +0 -3
  647. package/CountryFlags/EC.js +0 -39
  648. package/CountryFlags/EE.d.ts +0 -3
  649. package/CountryFlags/EE.js +0 -35
  650. package/CountryFlags/EG.d.ts +0 -3
  651. package/CountryFlags/EG.js +0 -36
  652. package/CountryFlags/EH.d.ts +0 -3
  653. package/CountryFlags/EH.js +0 -38
  654. package/CountryFlags/ER.d.ts +0 -3
  655. package/CountryFlags/ER.js +0 -44
  656. package/CountryFlags/ES.d.ts +0 -3
  657. package/CountryFlags/ES.js +0 -38
  658. package/CountryFlags/ET.d.ts +0 -3
  659. package/CountryFlags/ET.js +0 -41
  660. package/CountryFlags/EU.d.ts +0 -3
  661. package/CountryFlags/EU.js +0 -34
  662. package/CountryFlags/FI.d.ts +0 -3
  663. package/CountryFlags/FI.js +0 -34
  664. package/CountryFlags/FJ.d.ts +0 -3
  665. package/CountryFlags/FJ.js +0 -40
  666. package/CountryFlags/FK.d.ts +0 -3
  667. package/CountryFlags/FK.js +0 -47
  668. package/CountryFlags/FM.d.ts +0 -3
  669. package/CountryFlags/FM.js +0 -35
  670. package/CountryFlags/FO.d.ts +0 -3
  671. package/CountryFlags/FO.js +0 -35
  672. package/CountryFlags/FR.d.ts +0 -3
  673. package/CountryFlags/FR.js +0 -35
  674. package/CountryFlags/GA.d.ts +0 -3
  675. package/CountryFlags/GA.js +0 -35
  676. package/CountryFlags/GB.d.ts +0 -3
  677. package/CountryFlags/GB.js +0 -40
  678. package/CountryFlags/GD.d.ts +0 -3
  679. package/CountryFlags/GD.js +0 -42
  680. package/CountryFlags/GE.d.ts +0 -3
  681. package/CountryFlags/GE.js +0 -35
  682. package/CountryFlags/GEAB.d.ts +0 -3
  683. package/CountryFlags/GEAB.js +0 -44
  684. package/CountryFlags/GEOS.d.ts +0 -3
  685. package/CountryFlags/GEOS.js +0 -35
  686. package/CountryFlags/GF.d.ts +0 -3
  687. package/CountryFlags/GF.js +0 -35
  688. package/CountryFlags/GG.d.ts +0 -3
  689. package/CountryFlags/GG.js +0 -35
  690. package/CountryFlags/GH.d.ts +0 -3
  691. package/CountryFlags/GH.js +0 -36
  692. package/CountryFlags/GI.d.ts +0 -3
  693. package/CountryFlags/GI.js +0 -38
  694. package/CountryFlags/GL.d.ts +0 -3
  695. package/CountryFlags/GL.js +0 -36
  696. package/CountryFlags/GM.d.ts +0 -3
  697. package/CountryFlags/GM.js +0 -36
  698. package/CountryFlags/GN.d.ts +0 -3
  699. package/CountryFlags/GN.js +0 -35
  700. package/CountryFlags/GP.d.ts +0 -3
  701. package/CountryFlags/GP.js +0 -35
  702. package/CountryFlags/GQ.d.ts +0 -3
  703. package/CountryFlags/GQ.js +0 -41
  704. package/CountryFlags/GR.d.ts +0 -3
  705. package/CountryFlags/GR.js +0 -39
  706. package/CountryFlags/GS.d.ts +0 -3
  707. package/CountryFlags/GS.js +0 -53
  708. package/CountryFlags/GT.d.ts +0 -3
  709. package/CountryFlags/GT.js +0 -37
  710. package/CountryFlags/GU.d.ts +0 -3
  711. package/CountryFlags/GU.js +0 -41
  712. package/CountryFlags/GW.d.ts +0 -3
  713. package/CountryFlags/GW.js +0 -36
  714. package/CountryFlags/GY.d.ts +0 -3
  715. package/CountryFlags/GY.js +0 -37
  716. package/CountryFlags/HK.d.ts +0 -3
  717. package/CountryFlags/HK.js +0 -36
  718. package/CountryFlags/HM.d.ts +0 -3
  719. package/CountryFlags/HM.js +0 -45
  720. package/CountryFlags/HN.d.ts +0 -3
  721. package/CountryFlags/HN.js +0 -35
  722. package/CountryFlags/HR.d.ts +0 -3
  723. package/CountryFlags/HR.js +0 -42
  724. package/CountryFlags/HT.d.ts +0 -3
  725. package/CountryFlags/HT.js +0 -40
  726. package/CountryFlags/HU.d.ts +0 -3
  727. package/CountryFlags/HU.js +0 -35
  728. package/CountryFlags/IC.d.ts +0 -3
  729. package/CountryFlags/IC.js +0 -35
  730. package/CountryFlags/ID.d.ts +0 -3
  731. package/CountryFlags/ID.js +0 -34
  732. package/CountryFlags/IE.d.ts +0 -3
  733. package/CountryFlags/IE.js +0 -35
  734. package/CountryFlags/IL.d.ts +0 -3
  735. package/CountryFlags/IL.js +0 -35
  736. package/CountryFlags/IM.d.ts +0 -3
  737. package/CountryFlags/IM.js +0 -35
  738. package/CountryFlags/IN.d.ts +0 -3
  739. package/CountryFlags/IN.js +0 -39
  740. package/CountryFlags/IO.d.ts +0 -3
  741. package/CountryFlags/IO.js +0 -45
  742. package/CountryFlags/IQ.d.ts +0 -3
  743. package/CountryFlags/IQ.js +0 -37
  744. package/CountryFlags/IR.d.ts +0 -3
  745. package/CountryFlags/IR.js +0 -38
  746. package/CountryFlags/IS.d.ts +0 -3
  747. package/CountryFlags/IS.js +0 -35
  748. package/CountryFlags/IT.d.ts +0 -3
  749. package/CountryFlags/IT.js +0 -35
  750. package/CountryFlags/JE.d.ts +0 -3
  751. package/CountryFlags/JE.js +0 -36
  752. package/CountryFlags/JM.d.ts +0 -3
  753. package/CountryFlags/JM.js +0 -36
  754. package/CountryFlags/JO.d.ts +0 -3
  755. package/CountryFlags/JO.js +0 -37
  756. package/CountryFlags/JP.d.ts +0 -3
  757. package/CountryFlags/JP.js +0 -34
  758. package/CountryFlags/KE.d.ts +0 -3
  759. package/CountryFlags/KE.js +0 -42
  760. package/CountryFlags/KG.d.ts +0 -3
  761. package/CountryFlags/KG.js +0 -39
  762. package/CountryFlags/KH.d.ts +0 -3
  763. package/CountryFlags/KH.js +0 -36
  764. package/CountryFlags/KI.d.ts +0 -3
  765. package/CountryFlags/KI.js +0 -39
  766. package/CountryFlags/KM.d.ts +0 -3
  767. package/CountryFlags/KM.js +0 -41
  768. package/CountryFlags/KN.d.ts +0 -3
  769. package/CountryFlags/KN.js +0 -38
  770. package/CountryFlags/KP.d.ts +0 -3
  771. package/CountryFlags/KP.js +0 -39
  772. package/CountryFlags/KR.d.ts +0 -3
  773. package/CountryFlags/KR.js +0 -42
  774. package/CountryFlags/KW.d.ts +0 -3
  775. package/CountryFlags/KW.js +0 -36
  776. package/CountryFlags/KY.d.ts +0 -3
  777. package/CountryFlags/KY.js +0 -45
  778. package/CountryFlags/KZ.d.ts +0 -3
  779. package/CountryFlags/KZ.js +0 -35
  780. package/CountryFlags/LA.d.ts +0 -3
  781. package/CountryFlags/LA.js +0 -36
  782. package/CountryFlags/LB.d.ts +0 -3
  783. package/CountryFlags/LB.js +0 -37
  784. package/CountryFlags/LC.d.ts +0 -3
  785. package/CountryFlags/LC.js +0 -36
  786. package/CountryFlags/LI.d.ts +0 -3
  787. package/CountryFlags/LI.js +0 -35
  788. package/CountryFlags/LK.d.ts +0 -3
  789. package/CountryFlags/LK.js +0 -40
  790. package/CountryFlags/LR.d.ts +0 -3
  791. package/CountryFlags/LR.js +0 -37
  792. package/CountryFlags/LS.d.ts +0 -3
  793. package/CountryFlags/LS.js +0 -37
  794. package/CountryFlags/LT.d.ts +0 -3
  795. package/CountryFlags/LT.js +0 -35
  796. package/CountryFlags/LU.d.ts +0 -3
  797. package/CountryFlags/LU.js +0 -35
  798. package/CountryFlags/LV.d.ts +0 -3
  799. package/CountryFlags/LV.js +0 -35
  800. package/CountryFlags/LY.d.ts +0 -3
  801. package/CountryFlags/LY.js +0 -38
  802. package/CountryFlags/MA.d.ts +0 -3
  803. package/CountryFlags/MA.js +0 -34
  804. package/CountryFlags/MC.d.ts +0 -3
  805. package/CountryFlags/MC.js +0 -34
  806. package/CountryFlags/MD.d.ts +0 -3
  807. package/CountryFlags/MD.js +0 -36
  808. package/CountryFlags/ME.d.ts +0 -3
  809. package/CountryFlags/ME.js +0 -36
  810. package/CountryFlags/MF.d.ts +0 -3
  811. package/CountryFlags/MF.js +0 -37
  812. package/CountryFlags/MG.d.ts +0 -3
  813. package/CountryFlags/MG.js +0 -35
  814. package/CountryFlags/MH.d.ts +0 -3
  815. package/CountryFlags/MH.js +0 -36
  816. package/CountryFlags/MK.d.ts +0 -3
  817. package/CountryFlags/MK.js +0 -37
  818. package/CountryFlags/ML.d.ts +0 -3
  819. package/CountryFlags/ML.js +0 -35
  820. package/CountryFlags/MM.d.ts +0 -3
  821. package/CountryFlags/MM.js +0 -36
  822. package/CountryFlags/MN.d.ts +0 -3
  823. package/CountryFlags/MN.js +0 -41
  824. package/CountryFlags/MO.d.ts +0 -3
  825. package/CountryFlags/MO.js +0 -38
  826. package/CountryFlags/MP.d.ts +0 -3
  827. package/CountryFlags/MP.js +0 -39
  828. package/CountryFlags/MQ.d.ts +0 -3
  829. package/CountryFlags/MQ.js +0 -36
  830. package/CountryFlags/MR.d.ts +0 -3
  831. package/CountryFlags/MR.js +0 -36
  832. package/CountryFlags/MS.d.ts +0 -3
  833. package/CountryFlags/MS.js +0 -44
  834. package/CountryFlags/MT.d.ts +0 -3
  835. package/CountryFlags/MT.js +0 -35
  836. package/CountryFlags/MU.d.ts +0 -3
  837. package/CountryFlags/MU.js +0 -36
  838. package/CountryFlags/MV.d.ts +0 -3
  839. package/CountryFlags/MV.js +0 -35
  840. package/CountryFlags/MW.d.ts +0 -3
  841. package/CountryFlags/MW.js +0 -36
  842. package/CountryFlags/MX.d.ts +0 -3
  843. package/CountryFlags/MX.js +0 -37
  844. package/CountryFlags/MY.d.ts +0 -3
  845. package/CountryFlags/MY.js +0 -37
  846. package/CountryFlags/MZ.d.ts +0 -3
  847. package/CountryFlags/MZ.js +0 -38
  848. package/CountryFlags/NA.d.ts +0 -3
  849. package/CountryFlags/NA.js +0 -37
  850. package/CountryFlags/NC.d.ts +0 -3
  851. package/CountryFlags/NC.js +0 -42
  852. package/CountryFlags/NE.d.ts +0 -3
  853. package/CountryFlags/NE.js +0 -36
  854. package/CountryFlags/NF.d.ts +0 -3
  855. package/CountryFlags/NF.js +0 -35
  856. package/CountryFlags/NG.d.ts +0 -3
  857. package/CountryFlags/NG.js +0 -35
  858. package/CountryFlags/NI.d.ts +0 -3
  859. package/CountryFlags/NI.js +0 -39
  860. package/CountryFlags/NL.d.ts +0 -3
  861. package/CountryFlags/NL.js +0 -35
  862. package/CountryFlags/NO.d.ts +0 -3
  863. package/CountryFlags/NO.js +0 -35
  864. package/CountryFlags/NP.d.ts +0 -3
  865. package/CountryFlags/NP.js +0 -38
  866. package/CountryFlags/NR.d.ts +0 -3
  867. package/CountryFlags/NR.js +0 -35
  868. package/CountryFlags/NU.d.ts +0 -3
  869. package/CountryFlags/NU.js +0 -57
  870. package/CountryFlags/NZ.d.ts +0 -3
  871. package/CountryFlags/NZ.js +0 -45
  872. package/CountryFlags/OM.d.ts +0 -3
  873. package/CountryFlags/OM.js +0 -38
  874. package/CountryFlags/PA.d.ts +0 -3
  875. package/CountryFlags/PA.js +0 -37
  876. package/CountryFlags/PE.d.ts +0 -3
  877. package/CountryFlags/PE.js +0 -35
  878. package/CountryFlags/PF.d.ts +0 -3
  879. package/CountryFlags/PF.js +0 -39
  880. package/CountryFlags/PG.d.ts +0 -3
  881. package/CountryFlags/PG.js +0 -37
  882. package/CountryFlags/PH.d.ts +0 -3
  883. package/CountryFlags/PH.js +0 -37
  884. package/CountryFlags/PK.d.ts +0 -3
  885. package/CountryFlags/PK.js +0 -38
  886. package/CountryFlags/PL.d.ts +0 -3
  887. package/CountryFlags/PL.js +0 -36
  888. package/CountryFlags/PM.d.ts +0 -3
  889. package/CountryFlags/PM.js +0 -36
  890. package/CountryFlags/PN.d.ts +0 -3
  891. package/CountryFlags/PN.js +0 -47
  892. package/CountryFlags/PR.d.ts +0 -3
  893. package/CountryFlags/PR.js +0 -37
  894. package/CountryFlags/PS.d.ts +0 -3
  895. package/CountryFlags/PS.js +0 -36
  896. package/CountryFlags/PT.d.ts +0 -3
  897. package/CountryFlags/PT.js +0 -37
  898. package/CountryFlags/PW.d.ts +0 -3
  899. package/CountryFlags/PW.js +0 -34
  900. package/CountryFlags/PY.d.ts +0 -3
  901. package/CountryFlags/PY.js +0 -37
  902. package/CountryFlags/QA.d.ts +0 -3
  903. package/CountryFlags/QA.js +0 -34
  904. package/CountryFlags/RE.d.ts +0 -3
  905. package/CountryFlags/RE.js +0 -36
  906. package/CountryFlags/RO.d.ts +0 -3
  907. package/CountryFlags/RO.js +0 -35
  908. package/CountryFlags/RS.d.ts +0 -3
  909. package/CountryFlags/RS.js +0 -39
  910. package/CountryFlags/RU.d.ts +0 -3
  911. package/CountryFlags/RU.js +0 -36
  912. package/CountryFlags/RW.d.ts +0 -3
  913. package/CountryFlags/RW.js +0 -36
  914. package/CountryFlags/SA.d.ts +0 -3
  915. package/CountryFlags/SA.js +0 -37
  916. package/CountryFlags/SB.d.ts +0 -3
  917. package/CountryFlags/SB.js +0 -37
  918. package/CountryFlags/SC.d.ts +0 -3
  919. package/CountryFlags/SC.js +0 -37
  920. package/CountryFlags/SD.d.ts +0 -3
  921. package/CountryFlags/SD.js +0 -36
  922. package/CountryFlags/SE.d.ts +0 -3
  923. package/CountryFlags/SE.js +0 -34
  924. package/CountryFlags/SG.d.ts +0 -3
  925. package/CountryFlags/SG.js +0 -37
  926. package/CountryFlags/SH.d.ts +0 -3
  927. package/CountryFlags/SH.js +0 -47
  928. package/CountryFlags/SI.d.ts +0 -3
  929. package/CountryFlags/SI.js +0 -38
  930. package/CountryFlags/SJ.d.ts +0 -3
  931. package/CountryFlags/SJ.js +0 -35
  932. package/CountryFlags/SK.d.ts +0 -3
  933. package/CountryFlags/SK.js +0 -39
  934. package/CountryFlags/SL.d.ts +0 -3
  935. package/CountryFlags/SL.js +0 -35
  936. package/CountryFlags/SM.d.ts +0 -3
  937. package/CountryFlags/SM.js +0 -39
  938. package/CountryFlags/SN.d.ts +0 -3
  939. package/CountryFlags/SN.js +0 -36
  940. package/CountryFlags/SO.d.ts +0 -3
  941. package/CountryFlags/SO.js +0 -34
  942. package/CountryFlags/SR.d.ts +0 -3
  943. package/CountryFlags/SR.js +0 -37
  944. package/CountryFlags/SS.d.ts +0 -3
  945. package/CountryFlags/SS.js +0 -38
  946. package/CountryFlags/ST.d.ts +0 -3
  947. package/CountryFlags/ST.js +0 -37
  948. package/CountryFlags/SV.d.ts +0 -3
  949. package/CountryFlags/SV.js +0 -38
  950. package/CountryFlags/SX.d.ts +0 -3
  951. package/CountryFlags/SX.js +0 -41
  952. package/CountryFlags/SY.d.ts +0 -3
  953. package/CountryFlags/SY.js +0 -37
  954. package/CountryFlags/SZ.d.ts +0 -3
  955. package/CountryFlags/SZ.js +0 -39
  956. package/CountryFlags/TA.d.ts +0 -3
  957. package/CountryFlags/TA.js +0 -51
  958. package/CountryFlags/TC.d.ts +0 -3
  959. package/CountryFlags/TC.js +0 -48
  960. package/CountryFlags/TD.d.ts +0 -3
  961. package/CountryFlags/TD.js +0 -35
  962. package/CountryFlags/TF.d.ts +0 -3
  963. package/CountryFlags/TF.js +0 -38
  964. package/CountryFlags/TG.d.ts +0 -3
  965. package/CountryFlags/TG.js +0 -37
  966. package/CountryFlags/TH.d.ts +0 -3
  967. package/CountryFlags/TH.js +0 -36
  968. package/CountryFlags/TJ.d.ts +0 -3
  969. package/CountryFlags/TJ.js +0 -37
  970. package/CountryFlags/TK.d.ts +0 -3
  971. package/CountryFlags/TK.js +0 -37
  972. package/CountryFlags/TL.d.ts +0 -3
  973. package/CountryFlags/TL.js +0 -36
  974. package/CountryFlags/TM.d.ts +0 -3
  975. package/CountryFlags/TM.js +0 -49
  976. package/CountryFlags/TN.d.ts +0 -3
  977. package/CountryFlags/TN.js +0 -37
  978. package/CountryFlags/TO.d.ts +0 -3
  979. package/CountryFlags/TO.js +0 -35
  980. package/CountryFlags/TR.d.ts +0 -3
  981. package/CountryFlags/TR.js +0 -34
  982. package/CountryFlags/TT.d.ts +0 -3
  983. package/CountryFlags/TT.js +0 -35
  984. package/CountryFlags/TV.d.ts +0 -3
  985. package/CountryFlags/TV.js +0 -40
  986. package/CountryFlags/TW.d.ts +0 -3
  987. package/CountryFlags/TW.js +0 -37
  988. package/CountryFlags/TZ.d.ts +0 -3
  989. package/CountryFlags/TZ.js +0 -36
  990. package/CountryFlags/UA.d.ts +0 -3
  991. package/CountryFlags/UA.js +0 -34
  992. package/CountryFlags/UG.d.ts +0 -3
  993. package/CountryFlags/UG.js +0 -39
  994. package/CountryFlags/UM.d.ts +0 -3
  995. package/CountryFlags/UM.js +0 -38
  996. package/CountryFlags/US.d.ts +0 -3
  997. package/CountryFlags/US.js +0 -38
  998. package/CountryFlags/UY.d.ts +0 -3
  999. package/CountryFlags/UY.js +0 -37
  1000. package/CountryFlags/UZ.d.ts +0 -3
  1001. package/CountryFlags/UZ.js +0 -39
  1002. package/CountryFlags/Uknown.d.ts +0 -7
  1003. package/CountryFlags/Uknown.js +0 -12
  1004. package/CountryFlags/Unknown.d.ts +0 -3
  1005. package/CountryFlags/Unknown.js +0 -42
  1006. package/CountryFlags/VA.d.ts +0 -3
  1007. package/CountryFlags/VA.js +0 -36
  1008. package/CountryFlags/VC.d.ts +0 -3
  1009. package/CountryFlags/VC.js +0 -36
  1010. package/CountryFlags/VE.d.ts +0 -3
  1011. package/CountryFlags/VE.js +0 -36
  1012. package/CountryFlags/VG.d.ts +0 -3
  1013. package/CountryFlags/VG.js +0 -49
  1014. package/CountryFlags/VI.d.ts +0 -3
  1015. package/CountryFlags/VI.js +0 -45
  1016. package/CountryFlags/VN.d.ts +0 -3
  1017. package/CountryFlags/VN.js +0 -34
  1018. package/CountryFlags/VU.d.ts +0 -3
  1019. package/CountryFlags/VU.js +0 -39
  1020. package/CountryFlags/WF.d.ts +0 -3
  1021. package/CountryFlags/WF.js +0 -37
  1022. package/CountryFlags/WS.d.ts +0 -3
  1023. package/CountryFlags/WS.js +0 -36
  1024. package/CountryFlags/XK.d.ts +0 -3
  1025. package/CountryFlags/XK.js +0 -36
  1026. package/CountryFlags/YE.d.ts +0 -3
  1027. package/CountryFlags/YE.js +0 -35
  1028. package/CountryFlags/YT.d.ts +0 -3
  1029. package/CountryFlags/YT.js +0 -39
  1030. package/CountryFlags/ZA.d.ts +0 -3
  1031. package/CountryFlags/ZA.js +0 -38
  1032. package/CountryFlags/ZM.d.ts +0 -3
  1033. package/CountryFlags/ZM.js +0 -37
  1034. package/CountryFlags/ZW.d.ts +0 -3
  1035. package/CountryFlags/ZW.js +0 -43
  1036. package/CountryFlags/index.d.ts +0 -258
  1037. package/CountryFlags/index.js +0 -526
  1038. package/ErrorBoundary/Fallback.d.ts +0 -3
  1039. package/ErrorBoundary/Fallback.js +0 -51
  1040. package/Menu/AutoHeightWrapper.d.ts +0 -6
  1041. package/Menu/AutoHeightWrapper.js +0 -43
  1042. package/Menu/MeasuredItem.d.ts +0 -10
  1043. package/Menu/MeasuredItem.js +0 -51
  1044. package/Menu/VirtualizedItem.d.ts +0 -22
  1045. package/Menu/VirtualizedItem.js +0 -69
  1046. package/Menu/VirtualizedList.d.ts +0 -18
  1047. package/Menu/VirtualizedList.js +0 -26
  1048. package/Menu/VirtualizedListComponent.d.ts +0 -20
  1049. package/Menu/VirtualizedListComponent.js +0 -305
  1050. /package/{CountryFlags → PhoneField/flags}/BY.d.ts +0 -0
  1051. /package/{CountryFlags → PhoneField/flags}/CN.d.ts +0 -0
  1052. /package/{CountryFlags/AC.d.ts → PhoneField/flags/IL.d.ts} +0 -0
  1053. /package/{CountryFlags/AD.d.ts → PhoneField/flags/JP.d.ts} +0 -0
  1054. /package/{CountryFlags/AE.d.ts → PhoneField/flags/KZ.d.ts} +0 -0
  1055. /package/{CountryFlags/AF.d.ts → PhoneField/flags/RU.d.ts} +0 -0
  1056. /package/{CountryFlags/AG.d.ts → PhoneField/flags/UA.d.ts} +0 -0
  1057. /package/{CountryFlags/AI.d.ts → PhoneField/flags/US.d.ts} +0 -0
  1058. /package/{CountryFlags/AL.d.ts → PhoneField/flags/Unknown.d.ts} +0 -0
  1059. /package/{CountryFlags → PhoneField/flags}/isLabelled.d.ts +0 -0
  1060. /package/{CountryFlags → PhoneField/flags}/isLabelled.js +0 -0
@@ -0,0 +1,665 @@
1
+ import React, { useImperativeHandle } from 'react';
2
+ import Body from './CalendarBody';
3
+ import Cell from './CalendarCell';
4
+ import WeekDayCell from './CalendarWeekDayCell';
5
+ import EmptyCell from './CalendarEmptyCell';
6
+ import WeekRowButton from './CalendarWeekRowButton';
7
+ import WeekDayWeekNumber from './CalendarWeekDayWeekNumber';
8
+ import Paper from './CalendarPaper';
9
+ import Header from './CalendarHeader';
10
+ import WeekRow from './CalendarWeekRow';
11
+ import DateContainer from './CalendarDateContainer';
12
+ import Toolbar from './CalendarToolbar';
13
+ import YearsSelector from './CalendarYearsSelector';
14
+ import MonthsSelector from './CalendarMonthsSelector';
15
+ import MonthCell from './CalendarMonthCell';
16
+ import DayBadge from './CalendarDayBadge';
17
+ import Footer from './CalendarFooter';
18
+ import ControlButton from './CalendarControlButton';
19
+ import Heading from './CalendarHeading';
20
+ import Subheading from './CalendarSubheading';
21
+ import IconPrev from './CalendarIconPrev';
22
+ import IconNext from './CalendarIconNext';
23
+ import WeekDaysBar from './CalendarWeekDaysBar';
24
+ import { useCalendar } from './use-calendar';
25
+ import styled from '@emotion/styled';
26
+ import { keyframes } from '@emotion/react';
27
+ export * from './use-calendar';
28
+ export * from './CalendarWeekDaysBar';
29
+ const viewAppear = keyframes `
30
+ from {
31
+ opacity: 0;
32
+ transform: scale(0.97);
33
+ }
34
+ to {
35
+ opacity: 1;
36
+ transform: none;
37
+ }
38
+ `;
39
+ /**
40
+ * Only the active view is rendered: the hidden views are not focusable and not announced
41
+ */
42
+ const ViewContainer = styled.div `
43
+ flex: 1;
44
+ display: flex;
45
+ flex-direction: column;
46
+ min-height: 0;
47
+ animation: ${viewAppear} 0.2s ease-out;
48
+
49
+ @media (prefers-reduced-motion: reduce) {
50
+ animation: none;
51
+ }
52
+ `;
53
+ const dateKey = (date) => `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
54
+ const isRangeValue = (value) => {
55
+ if (value instanceof Array) {
56
+ return value.every(v => v instanceof Date || v === null);
57
+ }
58
+ return false;
59
+ };
60
+ const isNotRangeValue = (value) => !isRangeValue(value);
61
+ const computeViews = (inputViews, range) => {
62
+ if (inputViews) {
63
+ return inputViews;
64
+ }
65
+ if (range) {
66
+ return ['days', 'months', 'years', 'weeks'];
67
+ }
68
+ return ['days', 'months', 'years'];
69
+ };
70
+ const computeView = (inputParams) => {
71
+ var _a;
72
+ const { inputView, inputViews, inputInitialView } = inputParams;
73
+ const requested = inputView !== null && inputView !== void 0 ? inputView : inputInitialView;
74
+ if (requested && inputViews && !inputViews.includes(requested)) {
75
+ throw new Error(`The view «${requested}» must be one of the \`views\`: ${inputViews.join(', ')}`);
76
+ }
77
+ // The requested view wins over the first of the views
78
+ return (_a = requested !== null && requested !== void 0 ? requested : inputViews === null || inputViews === void 0 ? void 0 : inputViews[0]) !== null && _a !== void 0 ? _a : 'days';
79
+ };
80
+ const computeCalendarDate = (params) => {
81
+ const { inputValue, defaultValue } = params;
82
+ const today = new Date();
83
+ // Проверяем inputValue
84
+ if (inputValue !== null && inputValue !== undefined) {
85
+ if (Array.isArray(inputValue) && inputValue.length > 0) {
86
+ // Для range режима - берем первый элемент, если он есть
87
+ if (inputValue[0] instanceof Date) {
88
+ return inputValue[0];
89
+ }
90
+ // Если первый элемент null, пробуем второй
91
+ if (inputValue[1] instanceof Date) {
92
+ return inputValue[1];
93
+ }
94
+ }
95
+ else if (inputValue instanceof Date) {
96
+ // Для non-range режима
97
+ return inputValue;
98
+ }
99
+ }
100
+ // Проверяем defaultValue
101
+ if (defaultValue !== null && defaultValue !== undefined) {
102
+ if (Array.isArray(defaultValue) && defaultValue.length > 0) {
103
+ if (defaultValue[0] instanceof Date) {
104
+ return defaultValue[0];
105
+ }
106
+ if (defaultValue[1] instanceof Date) {
107
+ return defaultValue[1];
108
+ }
109
+ }
110
+ else if (defaultValue instanceof Date) {
111
+ return defaultValue;
112
+ }
113
+ }
114
+ // Возвращаем сегодняшнюю дату, если ничего не подошло
115
+ return today;
116
+ };
117
+ const CalendarComponent = React.forwardRef((props, ref) => {
118
+ var _a;
119
+ const { minDate: inputMinDate, maxDate: inputMaxDate, weekStartDay = 'monday', locale = 'ru-RU', displayLeadingZero = false, onChange, badges = [], markToday = true, weekDayLabelFormat = 'short', accentColor = 'primary', defaultValue, value: inputValue, initialView: inputInitialView, view: inputView, views: inputViews, resetButtonLabel, todayButtonLabel, heading, subheading, footer, overrides, range = false, prevButtonLabel = 'Previous', nextButtonLabel = 'Next', } = props;
120
+ /**
121
+ * Validations
122
+ */
123
+ if (range) {
124
+ if (defaultValue && isNotRangeValue(defaultValue)) {
125
+ throw new Error('The default value must be an array of dates([Date, Date])');
126
+ }
127
+ if (inputValue && isNotRangeValue(inputValue)) {
128
+ throw new Error('The value must be an array of dates([Date, Date])');
129
+ }
130
+ }
131
+ else {
132
+ if (defaultValue && isRangeValue(defaultValue)) {
133
+ throw new Error('The default value must be a Date instance');
134
+ }
135
+ if (inputValue && isRangeValue(inputValue)) {
136
+ throw new Error('The value must be a Date instance');
137
+ }
138
+ }
139
+ if (!range) {
140
+ if ((inputViews === null || inputViews === void 0 ? void 0 : inputViews.includes('weeks')) || inputView === 'weeks') {
141
+ throw new Error('The `weeks` view allowed only in range mode');
142
+ }
143
+ }
144
+ if (typeof inputValue !== 'undefined' && typeof onChange !== 'function') {
145
+ throw new Error('You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange`.');
146
+ }
147
+ if (inputView && inputInitialView) {
148
+ throw new Error('You can not use view and initialView at the same time.');
149
+ }
150
+ // Default limits are created once, otherwise every render gets new Date instances
151
+ // and invalidates all memoized values depending on them
152
+ const minDate = React.useMemo(() => inputMinDate !== null && inputMinDate !== void 0 ? inputMinDate : new Date(new Date().getFullYear() - 100, 0, 1, 0, 0, 0), [inputMinDate]);
153
+ const maxDate = React.useMemo(() => inputMaxDate !== null && inputMaxDate !== void 0 ? inputMaxDate : new Date(new Date().getFullYear() + 100, 0, 1, 0, 0, 0), [inputMaxDate]);
154
+ const emitChange = React.useCallback((newValue) => {
155
+ if (typeof onChange === 'function') {
156
+ onChange(newValue);
157
+ }
158
+ }, [onChange]);
159
+ /**
160
+ * Overrides
161
+ */
162
+ const overridesMap = React.useMemo(() => ({
163
+ Body: (overrides === null || overrides === void 0 ? void 0 : overrides.Body) || Body,
164
+ Cell: (overrides === null || overrides === void 0 ? void 0 : overrides.Cell) || Cell,
165
+ EmptyCell: (overrides === null || overrides === void 0 ? void 0 : overrides.EmptyCell) || EmptyCell,
166
+ Paper: (overrides === null || overrides === void 0 ? void 0 : overrides.Paper) || Paper,
167
+ Header: (overrides === null || overrides === void 0 ? void 0 : overrides.Header) || Header,
168
+ WeekRow: (overrides === null || overrides === void 0 ? void 0 : overrides.WeekRow) || WeekRow,
169
+ DateContainer: (overrides === null || overrides === void 0 ? void 0 : overrides.DateContainer) || DateContainer,
170
+ Toolbar: (overrides === null || overrides === void 0 ? void 0 : overrides.Toolbar) || Toolbar,
171
+ YearsSelector: (overrides === null || overrides === void 0 ? void 0 : overrides.YearsSelector) || YearsSelector,
172
+ MonthsSelector: (overrides === null || overrides === void 0 ? void 0 : overrides.MonthsSelector) || MonthsSelector,
173
+ MonthCell: (overrides === null || overrides === void 0 ? void 0 : overrides.MonthCell) || MonthCell,
174
+ DayBadge: (overrides === null || overrides === void 0 ? void 0 : overrides.DayBadge) || DayBadge,
175
+ Footer: (overrides === null || overrides === void 0 ? void 0 : overrides.Footer) || Footer,
176
+ ControlButton: (overrides === null || overrides === void 0 ? void 0 : overrides.ControlButton) || ControlButton,
177
+ Heading: (overrides === null || overrides === void 0 ? void 0 : overrides.Heading) || Heading,
178
+ Subheading: (overrides === null || overrides === void 0 ? void 0 : overrides.Subheading) || Subheading,
179
+ IconPrev: (overrides === null || overrides === void 0 ? void 0 : overrides.IconPrev) || IconPrev,
180
+ IconNext: (overrides === null || overrides === void 0 ? void 0 : overrides.IconNext) || IconNext,
181
+ WeekDaysBar: (overrides === null || overrides === void 0 ? void 0 : overrides.WeekDaysBar) || WeekDaysBar,
182
+ WeekDayCell: (overrides === null || overrides === void 0 ? void 0 : overrides.WeekDayCell) || WeekDayCell,
183
+ WeekRowButton: (overrides === null || overrides === void 0 ? void 0 : overrides.WeekRowButton) || WeekRowButton,
184
+ WeekDayWeekNumber: (overrides === null || overrides === void 0 ? void 0 : overrides.WeekDayWeekNumber) || WeekDayWeekNumber,
185
+ }), [overrides]);
186
+ const dateContainerRef = React.useRef(null);
187
+ /**
188
+ * Inside date value
189
+ */
190
+ const [calendarDate, setCalendarDate] = React.useState(() => computeCalendarDate({
191
+ defaultValue,
192
+ inputValue,
193
+ }));
194
+ /**
195
+ * Selected value
196
+ */
197
+ const inputValueRef = React.useRef(inputValue);
198
+ const [internalValue, setValue] = React.useState((_a = inputValue !== null && inputValue !== void 0 ? inputValue : defaultValue) !== null && _a !== void 0 ? _a : null);
199
+ // Controlled: the value is always the `value` property, even if the parent did not accept the change
200
+ const value = typeof inputValue !== 'undefined'
201
+ ? inputValue
202
+ : internalValue;
203
+ /**
204
+ * The day with the keyboard focus in the days view (roving tabindex)
205
+ */
206
+ const [focusedDate, setFocusedDate] = React.useState(null);
207
+ const shouldMoveFocus = React.useRef(false);
208
+ /**
209
+ * Current view mode
210
+ */
211
+ const [view, setView] = React.useState(() => computeView({
212
+ inputViews,
213
+ inputInitialView,
214
+ inputView,
215
+ }));
216
+ /**
217
+ * List of possibility views
218
+ */
219
+ const [views, setComputedViews] = React.useState(() => computeViews(inputViews, range));
220
+ const setViews = React.useCallback((variants) => setComputedViews(variants), []);
221
+ const selectView = React.useCallback((view) => {
222
+ const nextViews = views.includes(view) ? views : [...views, view];
223
+ if (nextViews !== views) {
224
+ setViews(nextViews);
225
+ }
226
+ setView(view);
227
+ }, [setViews, views]);
228
+ /**
229
+ * Controlled `view` property was changed
230
+ */
231
+ const inputViewRef = React.useRef(inputView);
232
+ React.useEffect(() => {
233
+ if (inputView && inputView !== inputViewRef.current) {
234
+ inputViewRef.current = inputView;
235
+ selectView(inputView);
236
+ }
237
+ }, [inputView, selectView]);
238
+ const resetVariablesRef = React.useRef({
239
+ calendarDate,
240
+ value,
241
+ view,
242
+ });
243
+ const { isSameDay, getWeeks, getDayLabel, getMonthLabel, getYearLabel, getYearsRange, getMonthsRange, } = useCalendar({
244
+ minDate,
245
+ maxDate,
246
+ weekStartDay,
247
+ locale,
248
+ displayLeadingZero,
249
+ });
250
+ const availableViewsMap = React.useMemo(() => {
251
+ const viewsMap = {
252
+ years: ['months', 'days'],
253
+ months: ['days', 'weeks'],
254
+ weeks: ['days'],
255
+ days: [],
256
+ };
257
+ const availableMap = new Map();
258
+ for (const [key, value] of Object.entries(viewsMap)) {
259
+ availableMap.set(key, [...value].filter(v => views.includes(v)));
260
+ }
261
+ const obj = Object.fromEntries(availableMap);
262
+ return Object.assign({}, obj);
263
+ }, [views]);
264
+ const getNextAvailableView = React.useCallback(() => {
265
+ const availableViews = availableViewsMap[view];
266
+ if (availableViews.length === 0) {
267
+ return null;
268
+ }
269
+ return availableViews[0];
270
+ }, [view, availableViewsMap]);
271
+ /**
272
+ * value was changed
273
+ */
274
+ React.useEffect(() => {
275
+ if (JSON.stringify(inputValue) !== JSON.stringify(inputValueRef.current)) {
276
+ inputValueRef.current = inputValue;
277
+ setValue(inputValue);
278
+ if (inputValue !== null && inputValue !== undefined) {
279
+ if (Array.isArray(inputValue) && inputValue[0] instanceof Date) {
280
+ setCalendarDate(inputValue[0]);
281
+ }
282
+ else if (inputValue instanceof Date) {
283
+ setCalendarDate(inputValue);
284
+ }
285
+ }
286
+ }
287
+ }, [inputValue]);
288
+ const handlePrevNextClick = React.useCallback((type) => () => {
289
+ const newCalendarDate = new Date(calendarDate);
290
+ if (view === 'years') {
291
+ if (type === 'prev') {
292
+ newCalendarDate.setFullYear(newCalendarDate.getFullYear() - 1);
293
+ }
294
+ else {
295
+ newCalendarDate.setFullYear(newCalendarDate.getFullYear() + 1);
296
+ }
297
+ }
298
+ if (view === 'months') {
299
+ if (type === 'prev') {
300
+ newCalendarDate.setFullYear(newCalendarDate.getFullYear() - 1);
301
+ }
302
+ else {
303
+ newCalendarDate.setFullYear(newCalendarDate.getFullYear() + 1);
304
+ }
305
+ }
306
+ if (view === 'days' || view === 'weeks') {
307
+ if (type === 'prev') {
308
+ newCalendarDate.setFullYear(newCalendarDate.getFullYear(), newCalendarDate.getMonth() - 1, 1);
309
+ }
310
+ else {
311
+ newCalendarDate.setFullYear(newCalendarDate.getFullYear(), newCalendarDate.getMonth() + 1, 1);
312
+ }
313
+ }
314
+ setCalendarDate(newCalendarDate);
315
+ }, [calendarDate, view]);
316
+ const handleCellDateClick = React.useCallback((selectedDate) => () => {
317
+ var _a;
318
+ setFocusedDate(selectedDate);
319
+ const nextView = getNextAvailableView();
320
+ if (nextView) {
321
+ setView(nextView);
322
+ }
323
+ // Single-date mode
324
+ if (!range) {
325
+ emitChange(selectedDate);
326
+ setValue(selectedDate);
327
+ return;
328
+ }
329
+ // Range-date mode
330
+ const [from, to] = (_a = value) !== null && _a !== void 0 ? _a : [];
331
+ // выбрана только первая дата - завершение периода
332
+ if (from && !to) {
333
+ /// check to swap
334
+ const newValue = selectedDate.getTime() < from.getTime() ? [selectedDate, from] : [from, selectedDate];
335
+ emitChange(newValue);
336
+ setValue(newValue);
337
+ return;
338
+ }
339
+ // обе даты выбраны или ничего не выбрано ([Date, Date] | [null, null] | null) - начало нового периода
340
+ setValue([selectedDate, null]);
341
+ emitChange([selectedDate, null]);
342
+ }, [emitChange, getNextAvailableView, range, value]);
343
+ /**
344
+ * Handle of click on year item
345
+ */
346
+ const handleYearSelected = React.useCallback((selectedYear) => () => {
347
+ const newDate = new Date(selectedYear, 0, 1, 0, 0, 0, 0);
348
+ setCalendarDate(newDate);
349
+ const nextView = getNextAvailableView();
350
+ if (nextView) {
351
+ selectView(nextView);
352
+ }
353
+ // if the next `view` does not exist
354
+ if (!nextView && typeof onChange === 'function') {
355
+ const a = new Date(newDate.getFullYear(), 11, 31, 23, 59, 59, 999);
356
+ const selectedValue = range ? [newDate, a] : newDate;
357
+ onChange(selectedValue);
358
+ if (!inputValue) {
359
+ setValue(selectedValue);
360
+ }
361
+ }
362
+ }, [getNextAvailableView, onChange, selectView, range, inputValue]);
363
+ /**
364
+ * Handle of click on month item
365
+ */
366
+ const handleMonthSelected = React.useCallback((monthIndex) => () => {
367
+ const newDate = new Date(calendarDate.getFullYear(), monthIndex, 1, 0, 0, 0, 0);
368
+ setCalendarDate(newDate);
369
+ const nextView = getNextAvailableView();
370
+ if (nextView) {
371
+ selectView(nextView);
372
+ }
373
+ // if the next `view` does not exist
374
+ if (!nextView && typeof onChange === 'function') {
375
+ // The end of the last day of the month, the same way as for the year range
376
+ const a = new Date(newDate.getFullYear(), newDate.getMonth() + 1, 0, 23, 59, 59, 999);
377
+ const selectedValue = range ? [newDate, a] : newDate;
378
+ onChange(selectedValue);
379
+ if (!inputValue) {
380
+ setValue(selectedValue);
381
+ }
382
+ }
383
+ }, [calendarDate, getNextAvailableView, onChange, selectView, inputValue, range]);
384
+ /**
385
+ * Handle click on «Reset» button
386
+ */
387
+ const handleReset = React.useCallback(() => {
388
+ setCalendarDate(resetVariablesRef.current.calendarDate);
389
+ setValue(resetVariablesRef.current.value);
390
+ selectView(resetVariablesRef.current.view);
391
+ if (typeof onChange === 'function') {
392
+ onChange(resetVariablesRef.current.value);
393
+ }
394
+ }, [onChange, selectView]);
395
+ /**
396
+ * Handle click on «Today» button
397
+ */
398
+ const handleToday = React.useCallback(() => {
399
+ const now = new Date();
400
+ const today = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0);
401
+ const newValue = (range ? [today, today] : today);
402
+ setCalendarDate(today);
403
+ setValue(newValue);
404
+ emitChange(newValue);
405
+ if (view !== 'days' && views.includes('days')) {
406
+ selectView('days');
407
+ }
408
+ }, [emitChange, range, selectView, view, views]);
409
+ const handleClickWeek = React.useCallback((week) => () => {
410
+ const days = week.days;
411
+ const dates = [days[0].date, days[days.length - 1].date];
412
+ setCalendarDate(dates[0]);
413
+ /// set view
414
+ let nextView = undefined;
415
+ if (views.includes('days')) {
416
+ nextView = 'days';
417
+ }
418
+ if (nextView) {
419
+ selectView(nextView);
420
+ }
421
+ /// set value
422
+ if (range) {
423
+ setValue(dates);
424
+ if (typeof onChange === 'function') {
425
+ onChange(dates);
426
+ }
427
+ }
428
+ else {
429
+ setValue(dates[0]);
430
+ if (typeof onChange === 'function') {
431
+ onChange(dates[0]);
432
+ }
433
+ }
434
+ }, [views, range, selectView, onChange]);
435
+ const weeks = React.useMemo(() => getWeeks(calendarDate), [calendarDate, getWeeks]);
436
+ const yearsRange = React.useMemo(() => getYearsRange(minDate, maxDate), [minDate, maxDate, getYearsRange]);
437
+ const monthsRange = React.useMemo(() => getMonthsRange(minDate, maxDate, calendarDate.getFullYear()), [minDate, maxDate, getMonthsRange, calendarDate]);
438
+ const minDay = React.useMemo(() => new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()), [minDate]);
439
+ const maxDay = React.useMemo(() => new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()), [maxDate]);
440
+ const dayLabelFormatter = React.useMemo(() => typeof Intl !== 'undefined'
441
+ ? new Intl.DateTimeFormat(locale, {
442
+ weekday: 'long',
443
+ day: 'numeric',
444
+ month: 'long',
445
+ year: 'numeric',
446
+ })
447
+ : null, [locale]);
448
+ /**
449
+ * The only day in the tab order: the focused, the selected, today or the first available one
450
+ */
451
+ const tabbableDateKey = React.useMemo(() => {
452
+ const month = calendarDate.getMonth();
453
+ const days = weeks
454
+ .flatMap(week => week.days)
455
+ .filter(day => day.date.getMonth() === month && !day.isDisabled);
456
+ const selected = isRangeValue(value) ? value === null || value === void 0 ? void 0 : value[0] : isNotRangeValue(value) ? value : null;
457
+ const candidates = [focusedDate, selected, new Date()];
458
+ const found = candidates
459
+ .map(candidate => candidate && days.find(day => isSameDay(day.date, candidate)))
460
+ .find(Boolean);
461
+ return found ? dateKey(found.date) : days[0] ? dateKey(days[0].date) : null;
462
+ }, [calendarDate, weeks, value, focusedDate, isSameDay]);
463
+ /**
464
+ * Arrows move by a day and a week, Home/End — to the start/end of the week,
465
+ * PageUp/PageDown — by a month. Crossing the month border switches the month
466
+ */
467
+ const handleDaysKeyDown = React.useCallback((event) => {
468
+ var _a;
469
+ const key = (_a = event.target.closest('[data-date]')) === null || _a === void 0 ? void 0 : _a.dataset.date;
470
+ if (!key)
471
+ return;
472
+ const [y, m, d] = key.split('-').map(Number);
473
+ const current = new Date(y, m, d);
474
+ const weekDay = (current.getDay() -
475
+ ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'].indexOf(weekStartDay) +
476
+ 7) %
477
+ 7;
478
+ let target;
479
+ switch (event.key) {
480
+ case 'ArrowLeft':
481
+ target = new Date(y, m, d - 1);
482
+ break;
483
+ case 'ArrowRight':
484
+ target = new Date(y, m, d + 1);
485
+ break;
486
+ case 'ArrowUp':
487
+ target = new Date(y, m, d - 7);
488
+ break;
489
+ case 'ArrowDown':
490
+ target = new Date(y, m, d + 7);
491
+ break;
492
+ case 'Home':
493
+ target = new Date(y, m, d - weekDay);
494
+ break;
495
+ case 'End':
496
+ target = new Date(y, m, d + 6 - weekDay);
497
+ break;
498
+ case 'PageUp':
499
+ target = new Date(y, m - 1, Math.min(d, new Date(y, m, 0).getDate()));
500
+ break;
501
+ case 'PageDown':
502
+ target = new Date(y, m + 1, Math.min(d, new Date(y, m + 2, 0).getDate()));
503
+ break;
504
+ default:
505
+ return;
506
+ }
507
+ event.preventDefault();
508
+ // Stay inside minDate/maxDate
509
+ if (target.getTime() < minDay.getTime())
510
+ target = minDay;
511
+ if (target.getTime() > maxDay.getTime())
512
+ target = maxDay;
513
+ setFocusedDate(target);
514
+ shouldMoveFocus.current = true;
515
+ if (target.getMonth() !== calendarDate.getMonth() ||
516
+ target.getFullYear() !== calendarDate.getFullYear()) {
517
+ setCalendarDate(new Date(target.getFullYear(), target.getMonth(), 1));
518
+ }
519
+ }, [weekStartDay, minDay, maxDay, calendarDate]);
520
+ // Move the DOM focus after the keyboard navigation has rendered the new day
521
+ React.useEffect(() => {
522
+ var _a, _b;
523
+ if (shouldMoveFocus.current && focusedDate) {
524
+ shouldMoveFocus.current = false;
525
+ (_b = (_a = dateContainerRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-date="${dateKey(focusedDate)}"]`)) === null || _b === void 0 ? void 0 : _b.focus();
526
+ }
527
+ }, [focusedDate, calendarDate]);
528
+ const renderViewDays = React.useCallback(() => (React.createElement(overridesMap.DateContainer, { ref: dateContainerRef, onKeyDown: handleDaysKeyDown }, weeks.map(week => (React.createElement(overridesMap.WeekRow, { key: week.weekNumber }, week.days.map(day => {
529
+ if (day.date.getMonth() === calendarDate.getMonth()) {
530
+ const badge = badges.find(b => isSameDay(b.date, day.date));
531
+ let fill = false;
532
+ let isSelected = false;
533
+ if (isRangeValue(value)) {
534
+ const [from, to] = value || [];
535
+ if (from && to) {
536
+ fill =
537
+ day.date.getTime() >= from.getTime() && day.date.getTime() <= to.getTime();
538
+ }
539
+ isSelected = Boolean((from && isSameDay(from, day.date)) || (to && isSameDay(to, day.date)));
540
+ }
541
+ else if (isNotRangeValue(value)) {
542
+ isSelected = Boolean(value && isSameDay(value, day.date));
543
+ }
544
+ const key = dateKey(day.date);
545
+ return (React.createElement(overridesMap.Cell, { key: day.date.getTime(), "data-date": key, tabIndex: key === tabbableDateKey ? 0 : -1, "aria-label": dayLabelFormatter === null || dayLabelFormatter === void 0 ? void 0 : dayLabelFormatter.format(day.date), "aria-pressed": isSelected || fill, "aria-current": day.isToday ? 'date' : undefined, isToday: markToday && day.isToday, isDisabled: day.isDisabled, accentColor: accentColor, isSelected: isSelected, fill: fill, onClick: handleCellDateClick(day.date) },
546
+ getDayLabel(day.date),
547
+ badge && (React.createElement(overridesMap.DayBadge, { badgeContent: badge.badgeContent, isToday: day.isToday, accentColor: badge.accentColor }))));
548
+ }
549
+ return (React.createElement(overridesMap.EmptyCell, { key: day.date.getTime(), "aria-hidden": true }, getDayLabel(day.date)));
550
+ })))))), [
551
+ accentColor,
552
+ badges,
553
+ calendarDate,
554
+ dayLabelFormatter,
555
+ getDayLabel,
556
+ handleCellDateClick,
557
+ handleDaysKeyDown,
558
+ isSameDay,
559
+ markToday,
560
+ overridesMap,
561
+ tabbableDateKey,
562
+ value,
563
+ weeks,
564
+ ]);
565
+ const renderViewMonths = React.useCallback(() => (React.createElement(overridesMap.MonthsSelector, null, monthsRange.map(monthIndex => {
566
+ const isSelected = calendarDate.getMonth() === monthIndex;
567
+ return (React.createElement(overridesMap.MonthCell, { key: monthIndex, accentColor: accentColor, isSelected: isSelected, "aria-pressed": isSelected, onClick: handleMonthSelected(monthIndex) }, getMonthLabel(new Date(calendarDate.getFullYear(), monthIndex, 1, 0, 0, 0, 0))));
568
+ }))), [accentColor, calendarDate, getMonthLabel, handleMonthSelected, monthsRange, overridesMap]);
569
+ const renderViewYears = React.useCallback(() => (React.createElement(overridesMap.YearsSelector, { accentColor: accentColor, date: calendarDate, onChange: y => handleYearSelected(y)(), years: yearsRange, locale: locale, minDate: minDate, maxDate: maxDate })), [
570
+ accentColor,
571
+ calendarDate,
572
+ handleYearSelected,
573
+ locale,
574
+ maxDate,
575
+ minDate,
576
+ overridesMap,
577
+ yearsRange,
578
+ ]);
579
+ const renderViewWeeks = React.useCallback(() => (React.createElement(overridesMap.DateContainer, null, getWeeks(calendarDate).map(week => {
580
+ let isSelected = false;
581
+ if (isRangeValue(value)) {
582
+ const [from, to] = value || [];
583
+ if (from && to) {
584
+ if (isSameDay(from, week.days[0].date) &&
585
+ isSameDay(to, week.days[week.days.length - 1].date)) {
586
+ isSelected = true;
587
+ }
588
+ }
589
+ }
590
+ return (React.createElement(overridesMap.WeekRowButton, { key: week.weekNumber, isSelected: isSelected, onClick: handleClickWeek(week), accentColor: accentColor, week: week },
591
+ React.createElement(overridesMap.WeekDayWeekNumber, { week: week }, week.weekNumber),
592
+ week.days.map(day => {
593
+ const badge = badges.find(b => isSameDay(b.date, day.date));
594
+ const inCurrentMonth = day.date.getMonth() === calendarDate.getMonth();
595
+ return (React.createElement(overridesMap.WeekDayCell, { key: day.date.getTime(), isToday: markToday && day.isToday, inCurrentMonth: inCurrentMonth },
596
+ getDayLabel(day.date),
597
+ badge && (React.createElement(overridesMap.DayBadge, { badgeContent: badge.badgeContent, isToday: day.isToday, accentColor: badge.accentColor }))));
598
+ })));
599
+ }))), [
600
+ accentColor,
601
+ badges,
602
+ calendarDate,
603
+ getDayLabel,
604
+ getWeeks,
605
+ handleClickWeek,
606
+ isSameDay,
607
+ markToday,
608
+ overridesMap,
609
+ value,
610
+ ]);
611
+ const getActiveView = React.useCallback(() => view, [view]);
612
+ const getCalendarDate = React.useCallback(() => calendarDate, [calendarDate]);
613
+ /**
614
+ * API
615
+ */
616
+ useImperativeHandle(ref, () => ({
617
+ setView: selectView,
618
+ reset: handleReset,
619
+ setValue,
620
+ getCalendarDate,
621
+ setCalendarDate,
622
+ getActiveView,
623
+ setViews,
624
+ }), [selectView, handleReset, getActiveView, setViews, getCalendarDate]);
625
+ return (React.createElement(overridesMap.Paper, null,
626
+ React.createElement(overridesMap.Header, null,
627
+ typeof heading !== 'undefined' && React.createElement(overridesMap.Heading, null, heading),
628
+ typeof subheading !== 'undefined' && (React.createElement(overridesMap.Subheading, null, subheading)),
629
+ React.createElement(overridesMap.Toolbar, null,
630
+ React.createElement(overridesMap.ControlButton, { iconOnly: true, onClick: handlePrevNextClick('prev'), disabled: view === 'years', "aria-label": prevButtonLabel, title: prevButtonLabel },
631
+ React.createElement(overridesMap.IconPrev, null)),
632
+ React.createElement(overridesMap.ControlButton, { disabled: !views.includes('months'), onClick: () => {
633
+ if (view === 'months' && views.includes('days')) {
634
+ selectView('days');
635
+ }
636
+ if (view !== 'months' && views.includes('months')) {
637
+ selectView('months');
638
+ }
639
+ } }, getMonthLabel(calendarDate)),
640
+ React.createElement(overridesMap.ControlButton, { disabled: !views.includes('years'), onClick: () => {
641
+ if (view === 'years' && views.includes('days')) {
642
+ selectView('days');
643
+ }
644
+ if (view !== 'years' && views.includes('years')) {
645
+ selectView('years');
646
+ }
647
+ } }, getYearLabel(calendarDate)),
648
+ React.createElement(overridesMap.ControlButton, { iconOnly: true, onClick: handlePrevNextClick('next'), disabled: view === 'years', "aria-label": nextButtonLabel, title: nextButtonLabel },
649
+ React.createElement(overridesMap.IconNext, null)))),
650
+ view === 'days' && (React.createElement(overridesMap.WeekDaysBar, { locale: locale, week: weeks[0], format: weekDayLabelFormat || 'short' })),
651
+ React.createElement(overridesMap.Body, null,
652
+ React.createElement(ViewContainer, { key: view },
653
+ view === 'days' && renderViewDays(),
654
+ view === 'weeks' && renderViewWeeks(),
655
+ view === 'months' && renderViewMonths(),
656
+ view === 'years' && renderViewYears())),
657
+ (typeof resetButtonLabel !== 'undefined' ||
658
+ typeof todayButtonLabel !== 'undefined' ||
659
+ typeof footer !== 'undefined') && (React.createElement(overridesMap.Footer, null,
660
+ typeof footer !== 'undefined' && React.createElement(React.Fragment, null, footer),
661
+ typeof todayButtonLabel !== 'undefined' && (React.createElement(overridesMap.ControlButton, { onClick: handleToday }, todayButtonLabel)),
662
+ typeof resetButtonLabel !== 'undefined' && (React.createElement(overridesMap.ControlButton, { onClick: handleReset }, resetButtonLabel))))));
663
+ });
664
+ CalendarComponent.displayName = 'CalendarComponent';
665
+ export { CalendarComponent };