@megafon/ui-core 6.2.0 → 7.0.0-beta.1

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 (509) hide show
  1. package/dist/es/colors/ColorItem/ColorItem.css +1 -45
  2. package/dist/es/colors/ColorItem/ColorItem.d.ts +2 -2
  3. package/dist/es/colors/ColorItem/ColorItem.js +5 -7
  4. package/dist/es/colors/Colors.css +1 -233
  5. package/dist/es/colors/Colors.d.ts +1 -1
  6. package/dist/es/colors/Colors.js +33 -55
  7. package/dist/es/colors/colorsData.d.ts +4 -4
  8. package/dist/es/components/Accordion/Accordion.css +1 -89
  9. package/dist/es/components/Accordion/Accordion.d.ts +2 -1
  10. package/dist/es/components/Accordion/Accordion.js +22 -65
  11. package/dist/es/components/Avatar/Avatar.css +1 -52
  12. package/dist/es/components/Avatar/Avatar.d.ts +1 -1
  13. package/dist/es/components/Avatar/Avatar.js +9 -27
  14. package/dist/es/components/Badges/CounterBadge/CounterBadge.css +1 -0
  15. package/dist/{lib/components/Badges/components → es/components/Badges}/CounterBadge/CounterBadge.d.ts +2 -2
  16. package/dist/es/components/Badges/{components/CounterBadge → CounterBadge}/CounterBadge.js +10 -28
  17. package/dist/es/components/Badges/NotificationBadge/NotificationBadge.css +1 -0
  18. package/dist/{lib/components/Badges/components → es/components/Badges}/NotificationBadge/NotificationBadge.d.ts +3 -3
  19. package/dist/es/components/Badges/{components/NotificationBadge → NotificationBadge}/NotificationBadge.js +8 -22
  20. package/dist/es/components/Badges/PriceBadge/PriceBadge.css +1 -0
  21. package/dist/es/components/Badges/{components/PriceBadge → PriceBadge}/PriceBadge.d.ts +4 -4
  22. package/dist/es/components/Badges/{components/PriceBadge → PriceBadge}/PriceBadge.js +11 -54
  23. package/dist/es/components/Badges/PromoBadge/PromoBadge.css +1 -0
  24. package/dist/es/components/Badges/{components/PromoBadge → PromoBadge}/PromoBadge.d.ts +4 -4
  25. package/dist/es/components/Badges/{components/PromoBadge → PromoBadge}/PromoBadge.js +9 -23
  26. package/dist/es/components/Badges/TimerBadge/TimerBadge.css +1 -0
  27. package/dist/{lib/components/Badges/components → es/components/Badges}/TimerBadge/TimerBadge.d.ts +2 -2
  28. package/dist/es/components/Badges/{components/TimerBadge → TimerBadge}/TimerBadge.js +22 -46
  29. package/dist/es/components/Badges/{components/TimerBadge → TimerBadge/components}/Timer/Timer.js +5 -32
  30. package/dist/es/components/Banner/Banner.css +1 -195
  31. package/dist/es/components/Banner/Banner.d.ts +5 -4
  32. package/dist/es/components/Banner/Banner.js +82 -130
  33. package/dist/es/components/Banner/BannerDot.css +1 -69
  34. package/dist/es/components/Banner/BannerDot.d.ts +1 -1
  35. package/dist/es/components/Banner/BannerDot.js +6 -22
  36. package/dist/es/components/Banner/slidesSettings.d.ts +4 -2
  37. package/dist/es/components/Banner/slidesSettings.js +3 -6
  38. package/dist/es/components/Button/Button.css +1 -814
  39. package/dist/es/components/Button/Button.d.ts +7 -6
  40. package/dist/es/components/Button/Button.js +44 -104
  41. package/dist/es/components/Calendar/Calendar.css +1 -24
  42. package/dist/es/components/Calendar/Calendar.d.ts +4 -4
  43. package/dist/es/components/Calendar/Calendar.js +75 -144
  44. package/dist/es/components/Calendar/components/_Day/Day.css +1 -0
  45. package/dist/es/components/Calendar/components/{Day → _Day}/Day.d.ts +4 -4
  46. package/dist/es/components/Calendar/components/{Day → _Day}/Day.js +21 -53
  47. package/dist/es/components/Calendar/components/_Month/Month.css +1 -0
  48. package/dist/es/components/Calendar/components/{Month → _Month}/Month.d.ts +3 -2
  49. package/dist/es/components/Calendar/components/{Month → _Month}/Month.js +11 -36
  50. package/dist/es/components/Caption/Caption.css +1 -48
  51. package/dist/es/components/Caption/Caption.d.ts +4 -2
  52. package/dist/es/components/Caption/Caption.js +11 -25
  53. package/dist/es/components/Carousel/Carousel.css +1 -215
  54. package/dist/es/components/Carousel/Carousel.d.ts +11 -10
  55. package/dist/es/components/Carousel/Carousel.js +135 -162
  56. package/dist/es/components/Carousel/checkBreakpointsPropTypes.d.ts +1 -1
  57. package/dist/es/components/Carousel/checkBreakpointsPropTypes.js +1 -4
  58. package/dist/es/components/Carousel/useGradient.d.ts +1 -1
  59. package/dist/es/components/Carousel/useGradient.js +9 -13
  60. package/dist/es/components/Checkbox/Checkbox.css +1 -150
  61. package/dist/es/components/Checkbox/Checkbox.d.ts +4 -4
  62. package/dist/es/components/Checkbox/Checkbox.js +21 -50
  63. package/dist/es/components/Chips/Chip.css +1 -132
  64. package/dist/es/components/Chips/Chip.d.ts +6 -26
  65. package/dist/es/components/Chips/Chip.js +17 -42
  66. package/dist/es/components/Chips/Chips.css +1 -19
  67. package/dist/es/components/Chips/Chips.d.ts +2 -2
  68. package/dist/es/components/Chips/Chips.js +32 -56
  69. package/dist/es/components/Chips/components/ChipsDropdown.css +1 -106
  70. package/dist/es/components/Chips/components/ChipsDropdown.d.ts +2 -2
  71. package/dist/es/components/Chips/components/ChipsDropdown.js +12 -27
  72. package/dist/es/components/ContentArea/ContentArea.css +1 -109
  73. package/dist/es/components/ContentArea/ContentArea.d.ts +5 -4
  74. package/dist/es/components/ContentArea/ContentArea.js +9 -28
  75. package/dist/es/components/ContentView/ContentView.css +1 -103
  76. package/dist/es/components/ContentView/ContentView.d.ts +3 -2
  77. package/dist/es/components/ContentView/ContentView.js +12 -46
  78. package/dist/es/components/Counter/Counter.css +1 -123
  79. package/dist/es/components/Counter/Counter.d.ts +1 -1
  80. package/dist/es/components/Counter/Counter.js +20 -55
  81. package/dist/es/components/Grid/Grid.css +1 -102
  82. package/dist/es/components/Grid/Grid.d.ts +1 -1
  83. package/dist/es/components/Grid/Grid.js +8 -24
  84. package/dist/es/components/Grid/GridColumn.css +1 -3102
  85. package/dist/es/components/Grid/GridColumn.d.ts +2 -2
  86. package/dist/es/components/Grid/GridColumn.js +33 -62
  87. package/dist/es/components/Header/Header.css +1 -122
  88. package/dist/es/components/Header/Header.d.ts +3 -1
  89. package/dist/es/components/Header/Header.js +13 -28
  90. package/dist/es/components/Link/Link.d.ts +2 -2
  91. package/dist/es/components/Link/Link.js +9 -25
  92. package/dist/es/components/List/List.css +1 -66
  93. package/dist/es/components/List/List.d.ts +2 -1
  94. package/dist/es/components/List/List.js +8 -18
  95. package/dist/es/components/List/ListItem.css +1 -6
  96. package/dist/es/components/List/ListItem.d.ts +2 -1
  97. package/dist/es/components/List/ListItem.js +1 -7
  98. package/dist/es/components/ListData/ListData.css +1 -162
  99. package/dist/es/components/ListData/ListData.d.ts +6 -34
  100. package/dist/es/components/ListData/ListData.js +22 -65
  101. package/dist/es/components/ListData/ListDataGroup.css +1 -15
  102. package/dist/es/components/ListData/ListDataGroup.d.ts +4 -4
  103. package/dist/es/components/ListData/ListDataGroup.js +29 -74
  104. package/dist/es/components/ListData/components/ListDataSortable.css +1 -79
  105. package/dist/es/components/ListData/components/ListDataSortable.d.ts +4 -4
  106. package/dist/es/components/ListData/components/ListDataSortable.js +21 -42
  107. package/dist/es/components/ListData/helpers.js +1 -8
  108. package/dist/es/components/Logo/Logo.css +1 -43
  109. package/dist/es/components/Logo/Logo.d.ts +1 -1
  110. package/dist/es/components/Logo/Logo.js +9 -25
  111. package/dist/es/components/Modal/Modal.css +1 -0
  112. package/dist/es/components/Modal/Modal.d.ts +106 -0
  113. package/dist/es/components/Modal/Modal.js +278 -0
  114. package/dist/es/components/Modal/_ModalContent/ModalContent.css +1 -0
  115. package/dist/es/components/Modal/_ModalContent/ModalContent.d.ts +8 -0
  116. package/dist/es/components/Modal/_ModalContent/ModalContent.js +168 -0
  117. package/dist/es/components/Modal/_ModalDesktop/ModalDesktop.css +1 -0
  118. package/dist/es/components/Modal/_ModalDesktop/ModalDesktop.d.ts +8 -0
  119. package/dist/es/components/Modal/_ModalDesktop/ModalDesktop.js +32 -0
  120. package/dist/es/components/Modal/_ModalMobileBottom/ModalMobileBottom.css +1 -0
  121. package/dist/es/components/Modal/_ModalMobileBottom/ModalMobileBottom.d.ts +12 -0
  122. package/dist/es/components/Modal/_ModalMobileBottom/ModalMobileBottom.js +114 -0
  123. package/dist/es/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.css +1 -0
  124. package/dist/es/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.d.ts +8 -0
  125. package/dist/es/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.js +55 -0
  126. package/dist/es/components/Modal/mocks.d.ts +3 -0
  127. package/dist/es/components/Modal/mocks.js +79 -0
  128. package/dist/es/components/Modal/types.d.ts +27 -0
  129. package/dist/es/components/Modal/types.js +1 -0
  130. package/dist/es/components/Modal/utils/utils.d.ts +18 -0
  131. package/dist/es/components/Modal/utils/utils.js +66 -0
  132. package/dist/es/components/NavArrow/NavArrow.css +1 -63
  133. package/dist/es/components/NavArrow/NavArrow.d.ts +3 -3
  134. package/dist/es/components/NavArrow/NavArrow.js +8 -28
  135. package/dist/es/components/Notification/Notification.css +1 -350
  136. package/dist/es/components/Notification/Notification.d.ts +5 -4
  137. package/dist/es/components/Notification/Notification.js +61 -131
  138. package/dist/es/components/Pagination/Pagination.css +1 -5
  139. package/dist/es/components/Pagination/Pagination.d.ts +4 -3
  140. package/dist/es/components/Pagination/Pagination.js +7 -22
  141. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +1 -62
  142. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +5 -4
  143. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +10 -26
  144. package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.css +1 -10
  145. package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +3 -2
  146. package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +5 -22
  147. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +1 -17
  148. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +3 -2
  149. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +7 -23
  150. package/dist/es/components/Pagination/helpers.js +0 -3
  151. package/dist/es/components/Pagination/usePagination.d.ts +2 -1
  152. package/dist/es/components/Pagination/usePagination.js +6 -18
  153. package/dist/es/components/Paragraph/Paragraph.css +1 -43
  154. package/dist/es/components/Paragraph/Paragraph.d.ts +4 -2
  155. package/dist/es/components/Paragraph/Paragraph.js +9 -22
  156. package/dist/es/components/Preloader/Preloader.css +1 -224
  157. package/dist/es/components/Preloader/Preloader.d.ts +3 -3
  158. package/dist/es/components/Preloader/Preloader.js +16 -36
  159. package/dist/es/components/RadioButton/RadioButton.css +1 -120
  160. package/dist/es/components/RadioButton/RadioButton.d.ts +1 -1
  161. package/dist/es/components/RadioButton/RadioButton.js +18 -50
  162. package/dist/es/components/Row/Row.css +1 -238
  163. package/dist/es/components/Row/Row.d.ts +2 -2
  164. package/dist/es/components/Row/Row.js +23 -48
  165. package/dist/es/components/ScrollBar/ScrollBar.css +1 -0
  166. package/dist/es/components/ScrollBar/ScrollBar.d.ts +34 -0
  167. package/dist/es/components/ScrollBar/ScrollBar.js +86 -0
  168. package/dist/es/components/Search/Search.css +1 -453
  169. package/dist/es/components/Search/Search.d.ts +8 -9
  170. package/dist/es/components/Search/Search.js +54 -149
  171. package/dist/es/components/Select/Select.css +1 -389
  172. package/dist/es/components/Select/Select.d.ts +9 -85
  173. package/dist/es/components/Select/Select.js +52 -142
  174. package/dist/es/components/Select/reducer/selectReducer.d.ts +1 -1
  175. package/dist/es/components/Select/reducer/selectReducer.js +18 -32
  176. package/dist/es/components/Selector/Selector.css +1 -132
  177. package/dist/es/components/Selector/Selector.d.ts +1 -1
  178. package/dist/es/components/Selector/Selector.js +23 -50
  179. package/dist/es/components/Sliders/Slider/Slider.css +1 -128
  180. package/dist/es/components/Sliders/Slider/Slider.d.ts +1 -1
  181. package/dist/es/components/Sliders/Slider/Slider.js +25 -56
  182. package/dist/es/components/Sliders/SliderRange/SliderRange.css +1 -169
  183. package/dist/es/components/Sliders/SliderRange/SliderRange.d.ts +1 -1
  184. package/dist/es/components/Sliders/SliderRange/SliderRange.js +33 -80
  185. package/dist/es/components/Sliders/SliderRange/helpers.js +0 -2
  186. package/dist/es/components/Sliders/SliderRatio/SliderRatio.css +1 -219
  187. package/dist/es/components/Sliders/SliderRatio/SliderRatio.d.ts +1 -1
  188. package/dist/es/components/Sliders/SliderRatio/SliderRatio.js +36 -85
  189. package/dist/es/components/Sliders/SliderRatio/helpers.js +1 -1
  190. package/dist/es/components/Sliders/SliderRatio/types.d.ts +1 -1
  191. package/dist/es/components/Sliders/SliderRatio/types.js +0 -1
  192. package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.css +1 -84
  193. package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.d.ts +2 -2
  194. package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.js +11 -35
  195. package/dist/es/components/Sliders/components/SliderScale/SliderScale.css +1 -15
  196. package/dist/es/components/Sliders/components/SliderScale/SliderScale.d.ts +2 -2
  197. package/dist/es/components/Sliders/components/SliderScale/SliderScale.js +6 -20
  198. package/dist/es/components/Sliders/components/SliderScale/helpers.js +12 -16
  199. package/dist/es/components/Sliders/helpers.js +1 -5
  200. package/dist/es/components/Snackbar/Snackbar.css +1 -220
  201. package/dist/es/components/Snackbar/Snackbar.d.ts +3 -3
  202. package/dist/es/components/Snackbar/Snackbar.js +44 -82
  203. package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.css +1 -66
  204. package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.d.ts +3 -3
  205. package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.js +9 -17
  206. package/dist/es/components/Switcher/Switcher.css +1 -160
  207. package/dist/es/components/Switcher/Switcher.d.ts +2 -1
  208. package/dist/es/components/Switcher/Switcher.js +17 -39
  209. package/dist/es/components/Tabs/Tab.js +0 -14
  210. package/dist/es/components/Tabs/Tabs.css +1 -306
  211. package/dist/es/components/Tabs/Tabs.d.ts +6 -5
  212. package/dist/es/components/Tabs/Tabs.js +110 -166
  213. package/dist/es/components/TextField/TextField.css +1 -343
  214. package/dist/es/components/TextField/TextField.d.ts +4 -4
  215. package/dist/es/components/TextField/TextField.js +85 -193
  216. package/dist/es/components/TextField/utils/countGraphemes.js +10 -18
  217. package/dist/es/components/TextLink/TextLink.css +1 -50
  218. package/dist/es/components/TextLink/TextLink.d.ts +2 -2
  219. package/dist/es/components/TextLink/TextLink.js +14 -27
  220. package/dist/es/components/Tile/Tile.css +1 -43
  221. package/dist/es/components/Tile/Tile.d.ts +7 -5
  222. package/dist/es/components/Tile/Tile.js +16 -36
  223. package/dist/es/components/Tooltip/Tooltip.css +1 -335
  224. package/dist/es/components/Tooltip/Tooltip.d.ts +9 -8
  225. package/dist/es/components/Tooltip/Tooltip.js +58 -139
  226. package/dist/es/components/_Collapse/Collapse.css +1 -0
  227. package/dist/{lib/components/Collapse → es/components/_Collapse}/Collapse.d.ts +3 -3
  228. package/dist/es/components/{Collapse → _Collapse}/Collapse.js +25 -62
  229. package/dist/es/hooks/usePrevious.js +0 -2
  230. package/dist/es/hooks/useResolution.d.ts +1 -1
  231. package/dist/es/hooks/useResolution.js +5 -11
  232. package/dist/es/hooks/useSwipe.d.ts +1 -1
  233. package/dist/es/hooks/useSwipe.js +17 -44
  234. package/dist/es/index.d.ts +16 -9
  235. package/dist/es/index.js +17 -10
  236. package/dist/es/styles/base.css +1 -0
  237. package/dist/lib/colors/ColorItem/ColorItem.css +1 -45
  238. package/dist/lib/colors/ColorItem/ColorItem.d.ts +2 -2
  239. package/dist/lib/colors/ColorItem/ColorItem.js +9 -18
  240. package/dist/lib/colors/Colors.css +1 -233
  241. package/dist/lib/colors/Colors.d.ts +1 -1
  242. package/dist/lib/colors/Colors.js +38 -80
  243. package/dist/lib/colors/colorsData.d.ts +4 -4
  244. package/dist/lib/colors/colorsData.js +1 -2
  245. package/dist/lib/components/Accordion/Accordion.css +1 -89
  246. package/dist/lib/components/Accordion/Accordion.d.ts +2 -1
  247. package/dist/lib/components/Accordion/Accordion.js +27 -82
  248. package/dist/lib/components/Avatar/Avatar.css +1 -52
  249. package/dist/lib/components/Avatar/Avatar.d.ts +1 -1
  250. package/dist/lib/components/Avatar/Avatar.js +14 -42
  251. package/dist/lib/components/Badges/CounterBadge/CounterBadge.css +1 -0
  252. package/dist/{es/components/Badges/components → lib/components/Badges}/CounterBadge/CounterBadge.d.ts +2 -2
  253. package/dist/lib/components/Badges/CounterBadge/CounterBadge.js +52 -0
  254. package/dist/lib/components/Badges/NotificationBadge/NotificationBadge.css +1 -0
  255. package/dist/{es/components/Badges/components → lib/components/Badges}/NotificationBadge/NotificationBadge.d.ts +3 -3
  256. package/dist/lib/components/Badges/NotificationBadge/NotificationBadge.js +44 -0
  257. package/dist/lib/components/Badges/PriceBadge/PriceBadge.css +1 -0
  258. package/dist/lib/components/Badges/{components/PriceBadge → PriceBadge}/PriceBadge.d.ts +4 -4
  259. package/dist/lib/components/Badges/{components/PriceBadge → PriceBadge}/PriceBadge.js +20 -76
  260. package/dist/lib/components/Badges/PromoBadge/PromoBadge.css +1 -0
  261. package/dist/lib/components/Badges/{components/PromoBadge → PromoBadge}/PromoBadge.d.ts +4 -4
  262. package/dist/lib/components/Badges/PromoBadge/PromoBadge.js +56 -0
  263. package/dist/lib/components/Badges/TimerBadge/TimerBadge.css +1 -0
  264. package/dist/{es/components/Badges/components → lib/components/Badges}/TimerBadge/TimerBadge.d.ts +2 -2
  265. package/dist/lib/components/Badges/TimerBadge/TimerBadge.js +96 -0
  266. package/dist/lib/components/Badges/{components/TimerBadge → TimerBadge/components}/Timer/Timer.js +12 -56
  267. package/dist/lib/components/Banner/Banner.css +1 -195
  268. package/dist/lib/components/Banner/Banner.d.ts +5 -4
  269. package/dist/lib/components/Banner/Banner.js +94 -164
  270. package/dist/lib/components/Banner/BannerDot.css +1 -69
  271. package/dist/lib/components/Banner/BannerDot.d.ts +1 -1
  272. package/dist/lib/components/Banner/BannerDot.js +11 -37
  273. package/dist/lib/components/Banner/slidesSettings.d.ts +4 -2
  274. package/dist/lib/components/Banner/slidesSettings.js +5 -12
  275. package/dist/lib/components/Button/Button.css +1 -814
  276. package/dist/lib/components/Button/Button.d.ts +7 -6
  277. package/dist/lib/components/Button/Button.js +71 -158
  278. package/dist/lib/components/Calendar/Calendar.css +1 -24
  279. package/dist/lib/components/Calendar/Calendar.d.ts +4 -4
  280. package/dist/lib/components/Calendar/Calendar.js +90 -191
  281. package/dist/lib/components/Calendar/components/_Day/Day.css +1 -0
  282. package/dist/lib/components/Calendar/components/{Day → _Day}/Day.d.ts +4 -4
  283. package/dist/lib/components/Calendar/components/{Day → _Day}/Day.js +29 -72
  284. package/dist/lib/components/Calendar/components/_Month/Month.css +1 -0
  285. package/dist/lib/components/Calendar/components/{Month → _Month}/Month.d.ts +3 -2
  286. package/dist/lib/components/Calendar/components/_Month/Month.js +97 -0
  287. package/dist/lib/components/Caption/Caption.css +1 -48
  288. package/dist/lib/components/Caption/Caption.d.ts +4 -2
  289. package/dist/lib/components/Caption/Caption.js +16 -41
  290. package/dist/lib/components/Carousel/Carousel.css +1 -215
  291. package/dist/lib/components/Carousel/Carousel.d.ts +11 -10
  292. package/dist/lib/components/Carousel/Carousel.js +223 -228
  293. package/dist/lib/components/Carousel/checkBreakpointsPropTypes.d.ts +1 -1
  294. package/dist/lib/components/Carousel/checkBreakpointsPropTypes.js +6 -18
  295. package/dist/lib/components/Carousel/useGradient.d.ts +1 -1
  296. package/dist/lib/components/Carousel/useGradient.js +12 -25
  297. package/dist/lib/components/Checkbox/Checkbox.css +1 -150
  298. package/dist/lib/components/Checkbox/Checkbox.d.ts +4 -4
  299. package/dist/lib/components/Checkbox/Checkbox.js +35 -75
  300. package/dist/lib/components/Chips/Chip.css +1 -132
  301. package/dist/lib/components/Chips/Chip.d.ts +6 -26
  302. package/dist/lib/components/Chips/Chip.js +36 -76
  303. package/dist/lib/components/Chips/Chips.css +1 -19
  304. package/dist/lib/components/Chips/Chips.d.ts +2 -2
  305. package/dist/lib/components/Chips/Chips.js +47 -92
  306. package/dist/lib/components/Chips/components/ChipsDropdown.css +1 -106
  307. package/dist/lib/components/Chips/components/ChipsDropdown.d.ts +2 -2
  308. package/dist/lib/components/Chips/components/ChipsDropdown.js +31 -67
  309. package/dist/lib/components/ContentArea/ContentArea.css +1 -109
  310. package/dist/lib/components/ContentArea/ContentArea.d.ts +5 -4
  311. package/dist/lib/components/ContentArea/ContentArea.js +14 -44
  312. package/dist/lib/components/ContentView/ContentView.css +1 -103
  313. package/dist/lib/components/ContentView/ContentView.d.ts +3 -2
  314. package/dist/lib/components/ContentView/ContentView.js +17 -63
  315. package/dist/lib/components/Counter/Counter.css +1 -123
  316. package/dist/lib/components/Counter/Counter.d.ts +1 -1
  317. package/dist/lib/components/Counter/Counter.js +25 -71
  318. package/dist/lib/components/Grid/Grid.css +1 -102
  319. package/dist/lib/components/Grid/Grid.d.ts +1 -1
  320. package/dist/lib/components/Grid/Grid.js +13 -40
  321. package/dist/lib/components/Grid/GridColumn.css +1 -3102
  322. package/dist/lib/components/Grid/GridColumn.d.ts +2 -2
  323. package/dist/lib/components/Grid/GridColumn.js +38 -77
  324. package/dist/lib/components/Header/Header.css +1 -122
  325. package/dist/lib/components/Header/Header.d.ts +3 -1
  326. package/dist/lib/components/Header/Header.js +18 -43
  327. package/dist/lib/components/Link/Link.d.ts +2 -2
  328. package/dist/lib/components/Link/Link.js +15 -34
  329. package/dist/lib/components/List/List.css +1 -66
  330. package/dist/lib/components/List/List.d.ts +2 -1
  331. package/dist/lib/components/List/List.js +12 -30
  332. package/dist/lib/components/List/ListItem.css +1 -6
  333. package/dist/lib/components/List/ListItem.d.ts +2 -1
  334. package/dist/lib/components/List/ListItem.js +5 -19
  335. package/dist/lib/components/ListData/ListData.css +1 -162
  336. package/dist/lib/components/ListData/ListData.d.ts +6 -34
  337. package/dist/lib/components/ListData/ListData.js +51 -111
  338. package/dist/lib/components/ListData/ListDataGroup.css +1 -15
  339. package/dist/lib/components/ListData/ListDataGroup.d.ts +4 -4
  340. package/dist/lib/components/ListData/ListDataGroup.js +48 -118
  341. package/dist/lib/components/ListData/components/ListDataSortable.css +1 -79
  342. package/dist/lib/components/ListData/components/ListDataSortable.d.ts +4 -4
  343. package/dist/lib/components/ListData/components/ListDataSortable.js +35 -74
  344. package/dist/lib/components/ListData/helpers.js +7 -25
  345. package/dist/lib/components/Logo/Logo.css +1 -43
  346. package/dist/lib/components/Logo/Logo.d.ts +1 -1
  347. package/dist/lib/components/Logo/Logo.js +14 -41
  348. package/dist/lib/components/Modal/Modal.css +1 -0
  349. package/dist/lib/components/Modal/Modal.d.ts +106 -0
  350. package/dist/lib/components/Modal/Modal.js +287 -0
  351. package/dist/lib/components/Modal/_ModalContent/ModalContent.css +1 -0
  352. package/dist/lib/components/Modal/_ModalContent/ModalContent.d.ts +8 -0
  353. package/dist/lib/components/Modal/_ModalContent/ModalContent.js +177 -0
  354. package/dist/lib/components/Modal/_ModalDesktop/ModalDesktop.css +1 -0
  355. package/dist/lib/components/Modal/_ModalDesktop/ModalDesktop.d.ts +8 -0
  356. package/dist/lib/components/Modal/_ModalDesktop/ModalDesktop.js +41 -0
  357. package/dist/lib/components/Modal/_ModalMobileBottom/ModalMobileBottom.css +1 -0
  358. package/dist/lib/components/Modal/_ModalMobileBottom/ModalMobileBottom.d.ts +12 -0
  359. package/dist/lib/components/Modal/_ModalMobileBottom/ModalMobileBottom.js +123 -0
  360. package/dist/lib/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.css +1 -0
  361. package/dist/lib/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.d.ts +8 -0
  362. package/dist/lib/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.js +64 -0
  363. package/dist/lib/components/Modal/mocks.d.ts +3 -0
  364. package/dist/lib/components/Modal/mocks.js +85 -0
  365. package/dist/lib/components/Modal/types.d.ts +27 -0
  366. package/dist/lib/components/Modal/types.js +5 -0
  367. package/dist/lib/components/Modal/utils/utils.d.ts +18 -0
  368. package/dist/lib/components/Modal/utils/utils.js +72 -0
  369. package/dist/lib/components/NavArrow/NavArrow.css +1 -63
  370. package/dist/lib/components/NavArrow/NavArrow.d.ts +3 -3
  371. package/dist/lib/components/NavArrow/NavArrow.js +15 -47
  372. package/dist/lib/components/Notification/Notification.css +1 -350
  373. package/dist/lib/components/Notification/Notification.d.ts +5 -4
  374. package/dist/lib/components/Notification/Notification.js +114 -201
  375. package/dist/lib/components/Pagination/Pagination.css +1 -5
  376. package/dist/lib/components/Pagination/Pagination.d.ts +4 -3
  377. package/dist/lib/components/Pagination/Pagination.js +19 -51
  378. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +1 -62
  379. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +5 -4
  380. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +12 -35
  381. package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.css +1 -10
  382. package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +3 -2
  383. package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +7 -32
  384. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +1 -17
  385. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +3 -2
  386. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +9 -32
  387. package/dist/lib/components/Pagination/helpers.js +1 -6
  388. package/dist/lib/components/Pagination/usePagination.d.ts +2 -1
  389. package/dist/lib/components/Pagination/usePagination.js +10 -36
  390. package/dist/lib/components/Paragraph/Paragraph.css +1 -43
  391. package/dist/lib/components/Paragraph/Paragraph.d.ts +4 -2
  392. package/dist/lib/components/Paragraph/Paragraph.js +14 -38
  393. package/dist/lib/components/Preloader/Preloader.css +1 -224
  394. package/dist/lib/components/Preloader/Preloader.d.ts +3 -3
  395. package/dist/lib/components/Preloader/Preloader.js +23 -58
  396. package/dist/lib/components/RadioButton/RadioButton.css +1 -120
  397. package/dist/lib/components/RadioButton/RadioButton.d.ts +1 -1
  398. package/dist/lib/components/RadioButton/RadioButton.js +23 -70
  399. package/dist/lib/components/Row/Row.css +1 -238
  400. package/dist/lib/components/Row/Row.d.ts +2 -2
  401. package/dist/lib/components/Row/Row.js +40 -76
  402. package/dist/lib/components/ScrollBar/ScrollBar.css +1 -0
  403. package/dist/lib/components/ScrollBar/ScrollBar.d.ts +34 -0
  404. package/dist/lib/components/ScrollBar/ScrollBar.js +94 -0
  405. package/dist/lib/components/Search/Search.css +1 -453
  406. package/dist/lib/components/Search/Search.d.ts +8 -9
  407. package/dist/lib/components/Search/Search.js +122 -262
  408. package/dist/lib/components/Select/Select.css +1 -389
  409. package/dist/lib/components/Select/Select.d.ts +9 -85
  410. package/dist/lib/components/Select/Select.js +70 -187
  411. package/dist/lib/components/Select/reducer/selectReducer.d.ts +1 -1
  412. package/dist/lib/components/Select/reducer/selectReducer.js +22 -42
  413. package/dist/lib/components/Selector/Selector.css +1 -132
  414. package/dist/lib/components/Selector/Selector.d.ts +1 -1
  415. package/dist/lib/components/Selector/Selector.js +28 -71
  416. package/dist/lib/components/Sliders/Slider/Slider.css +1 -128
  417. package/dist/lib/components/Sliders/Slider/Slider.d.ts +1 -1
  418. package/dist/lib/components/Sliders/Slider/Slider.js +30 -76
  419. package/dist/lib/components/Sliders/SliderRange/SliderRange.css +1 -169
  420. package/dist/lib/components/Sliders/SliderRange/SliderRange.d.ts +1 -1
  421. package/dist/lib/components/Sliders/SliderRange/SliderRange.js +38 -101
  422. package/dist/lib/components/Sliders/SliderRange/helpers.js +5 -18
  423. package/dist/lib/components/Sliders/SliderRatio/SliderRatio.css +1 -219
  424. package/dist/lib/components/Sliders/SliderRatio/SliderRatio.d.ts +1 -1
  425. package/dist/lib/components/Sliders/SliderRatio/SliderRatio.js +41 -112
  426. package/dist/lib/components/Sliders/SliderRatio/helpers.js +9 -28
  427. package/dist/lib/components/Sliders/SliderRatio/types.d.ts +1 -1
  428. package/dist/lib/components/Sliders/SliderRatio/types.js +0 -2
  429. package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.css +1 -84
  430. package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.d.ts +2 -2
  431. package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.js +18 -57
  432. package/dist/lib/components/Sliders/components/SliderScale/SliderScale.css +1 -15
  433. package/dist/lib/components/Sliders/components/SliderScale/SliderScale.d.ts +2 -2
  434. package/dist/lib/components/Sliders/components/SliderScale/SliderScale.js +12 -40
  435. package/dist/lib/components/Sliders/components/SliderScale/helpers.js +16 -34
  436. package/dist/lib/components/Sliders/helpers.js +5 -22
  437. package/dist/lib/components/Snackbar/Snackbar.css +1 -220
  438. package/dist/lib/components/Snackbar/Snackbar.d.ts +3 -3
  439. package/dist/lib/components/Snackbar/Snackbar.js +82 -139
  440. package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.css +1 -66
  441. package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.d.ts +3 -3
  442. package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.js +18 -37
  443. package/dist/lib/components/Switcher/Switcher.css +1 -160
  444. package/dist/lib/components/Switcher/Switcher.d.ts +2 -1
  445. package/dist/lib/components/Switcher/Switcher.js +22 -53
  446. package/dist/lib/components/Tabs/Tab.js +5 -26
  447. package/dist/lib/components/Tabs/Tabs.css +1 -306
  448. package/dist/lib/components/Tabs/Tabs.d.ts +6 -5
  449. package/dist/lib/components/Tabs/Tabs.js +121 -200
  450. package/dist/lib/components/TextField/TextField.css +1 -343
  451. package/dist/lib/components/TextField/TextField.d.ts +4 -4
  452. package/dist/lib/components/TextField/TextField.js +119 -244
  453. package/dist/lib/components/TextField/utils/countGraphemes.js +11 -28
  454. package/dist/lib/components/TextLink/TextLink.css +1 -50
  455. package/dist/lib/components/TextLink/TextLink.d.ts +2 -2
  456. package/dist/lib/components/TextLink/TextLink.js +19 -42
  457. package/dist/lib/components/Tile/Tile.css +1 -43
  458. package/dist/lib/components/Tile/Tile.d.ts +7 -5
  459. package/dist/lib/components/Tile/Tile.js +27 -55
  460. package/dist/lib/components/Tooltip/Tooltip.css +1 -335
  461. package/dist/lib/components/Tooltip/Tooltip.d.ts +9 -8
  462. package/dist/lib/components/Tooltip/Tooltip.js +111 -219
  463. package/dist/lib/components/_Collapse/Collapse.css +1 -0
  464. package/dist/{es/components/Collapse → lib/components/_Collapse}/Collapse.d.ts +3 -3
  465. package/dist/lib/components/_Collapse/Collapse.js +95 -0
  466. package/dist/lib/constants/throttleTime.js +2 -3
  467. package/dist/lib/hooks/usePrevious.js +4 -11
  468. package/dist/lib/hooks/useResolution.d.ts +1 -1
  469. package/dist/lib/hooks/useResolution.js +10 -24
  470. package/dist/lib/hooks/useSwipe.d.ts +1 -1
  471. package/dist/lib/hooks/useSwipe.js +22 -64
  472. package/dist/lib/index.d.ts +16 -9
  473. package/dist/lib/index.js +83 -102
  474. package/dist/lib/styles/base.css +1 -0
  475. package/package.json +106 -101
  476. package/styles/base.scss +150 -0
  477. package/styles/colors.css +53 -0
  478. package/CHANGELOG.md +0 -4051
  479. package/dist/es/components/Avatar/doc/i/img.png +0 -0
  480. package/dist/es/components/Badges/components/CounterBadge/CounterBadge.css +0 -54
  481. package/dist/es/components/Badges/components/NotificationBadge/NotificationBadge.css +0 -58
  482. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.css +0 -119
  483. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +0 -69
  484. package/dist/es/components/Badges/components/TimerBadge/TimerBadge.css +0 -60
  485. package/dist/es/components/Calendar/components/Day/Day.css +0 -243
  486. package/dist/es/components/Calendar/components/Month/Month.css +0 -135
  487. package/dist/es/components/Collapse/Collapse.css +0 -3
  488. package/dist/es/components/ListData/doc/i/img.png +0 -0
  489. package/dist/es/components/Selector/doc/Selector.example.css +0 -17
  490. package/dist/lib/components/Avatar/doc/i/img.png +0 -0
  491. package/dist/lib/components/Badges/components/CounterBadge/CounterBadge.css +0 -54
  492. package/dist/lib/components/Badges/components/CounterBadge/CounterBadge.js +0 -81
  493. package/dist/lib/components/Badges/components/NotificationBadge/NotificationBadge.css +0 -58
  494. package/dist/lib/components/Badges/components/NotificationBadge/NotificationBadge.js +0 -71
  495. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.css +0 -119
  496. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +0 -69
  497. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.js +0 -84
  498. package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.css +0 -60
  499. package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.js +0 -135
  500. package/dist/lib/components/Calendar/components/Day/Day.css +0 -243
  501. package/dist/lib/components/Calendar/components/Month/Month.css +0 -135
  502. package/dist/lib/components/Calendar/components/Month/Month.js +0 -127
  503. package/dist/lib/components/Collapse/Collapse.css +0 -3
  504. package/dist/lib/components/Collapse/Collapse.js +0 -141
  505. package/dist/lib/components/ListData/doc/i/img.png +0 -0
  506. package/dist/lib/components/Selector/doc/Selector.example.css +0 -17
  507. package/styles/base.less +0 -171
  508. /package/dist/es/components/Badges/{components/TimerBadge → TimerBadge/components}/Timer/Timer.d.ts +0 -0
  509. /package/dist/lib/components/Badges/{components/TimerBadge → TimerBadge/components}/Timer/Timer.d.ts +0 -0
@@ -0,0 +1,278 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import * as React from 'react';
4
+ import { cnCreate, breakpoints } from '@megafon/ui-helpers';
5
+ import throttle from 'lodash.throttle';
6
+ import ReactModal from 'react-modal';
7
+ import THROTTLE_TIME from "../../constants/throttleTime";
8
+ import useResolution from "../../hooks/useResolution";
9
+ import ModalDesktop from "./_ModalDesktop/ModalDesktop";
10
+ import ModalMobileBottom from "./_ModalMobileBottom/ModalMobileBottom";
11
+ import ModalMobileFullScreen from "./_ModalMobileFullScreen/ModalMobileFullScreen";
12
+ import { changeBodyPadding, getCorrectMaxHeight } from "./utils/utils";
13
+ import "./Modal.css";
14
+ var MOBILE_BIG_START = breakpoints.MOBILE_BIG_START;
15
+ var HEIGHT_TRANSITION_PROPERTY = 'height';
16
+ export var MODAL_MOBILE_VIEWS_ENUM;
17
+ (function (MODAL_MOBILE_VIEWS_ENUM) {
18
+ MODAL_MOBILE_VIEWS_ENUM["FULL_SCREEN"] = "full-screen";
19
+ MODAL_MOBILE_VIEWS_ENUM["BOTTOM"] = "bottom";
20
+ })(MODAL_MOBILE_VIEWS_ENUM || (MODAL_MOBILE_VIEWS_ENUM = {}));
21
+ export var MODAL_TRANSITIONS_STEPS_ENUM;
22
+ (function (MODAL_TRANSITIONS_STEPS_ENUM) {
23
+ MODAL_TRANSITIONS_STEPS_ENUM["INITIAL_STEP"] = "initial-step";
24
+ MODAL_TRANSITIONS_STEPS_ENUM["MOVE_STEP"] = "move-step";
25
+ MODAL_TRANSITIONS_STEPS_ENUM["MOVE_END_STEP"] = "move-end-step";
26
+ MODAL_TRANSITIONS_STEPS_ENUM["END_STEP"] = "end-step";
27
+ })(MODAL_TRANSITIONS_STEPS_ENUM || (MODAL_TRANSITIONS_STEPS_ENUM = {}));
28
+ var bodyCn = cnCreate('mfui-modal-open-body');
29
+ var cn = cnCreate('mfui-modal');
30
+ var Modal = function Modal(_ref) {
31
+ var className = _ref.className,
32
+ classes = _ref.classes,
33
+ dataAttrs = _ref.dataAttrs,
34
+ scrollBarParams = _ref.scrollBarParams,
35
+ isOpened = _ref.isOpened,
36
+ headerProps = _ref.headerProps,
37
+ footerProps = _ref.footerProps,
38
+ _ref$mobileView = _ref.mobileView,
39
+ mobileView = _ref$mobileView === void 0 ? MODAL_MOBILE_VIEWS_ENUM.FULL_SCREEN : _ref$mobileView,
40
+ isEnabledNativeScroll = _ref.isEnabledNativeScroll,
41
+ isSwipeDisabled = _ref.isSwipeDisabled,
42
+ isDisabledBackgroundClick = _ref.isDisabledBackgroundClick,
43
+ _ref$hideAriaApp = _ref.hideAriaApp,
44
+ hideAriaApp = _ref$hideAriaApp === void 0 ? false : _ref$hideAriaApp,
45
+ contentLabel = _ref.contentLabel,
46
+ _ref$isReturnFocusAft = _ref.isReturnFocusAfterClose,
47
+ isReturnFocusAfterClose = _ref$isReturnFocusAft === void 0 ? true : _ref$isReturnFocusAft,
48
+ children = _ref.children,
49
+ onClose = _ref.onClose,
50
+ getModalContentRef = _ref.getModalContentRef,
51
+ getModalOverlayRef = _ref.getModalOverlayRef,
52
+ onAfterModalOpen = _ref.onAfterModalOpen;
53
+ var _ref2 = headerProps || {},
54
+ _ref2$isStickyHeader = _ref2.isStickyHeader,
55
+ isStickyHeader = _ref2$isStickyHeader === void 0 ? true : _ref2$isStickyHeader;
56
+ var _ref3 = footerProps || {},
57
+ isStickyFooter = _ref3.isStickyFooter;
58
+ var _React$useState = React.useState(false),
59
+ _React$useState2 = _slicedToArray(_React$useState, 2),
60
+ isPopupOpened = _React$useState2[0],
61
+ setIsPopupOpened = _React$useState2[1];
62
+ var _React$useState3 = React.useState(null),
63
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
64
+ scrollMaxHeight = _React$useState4[0],
65
+ setScrollMaxHeight = _React$useState4[1];
66
+ var _React$useState5 = React.useState(MODAL_TRANSITIONS_STEPS_ENUM.INITIAL_STEP),
67
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
68
+ transitionStep = _React$useState6[0],
69
+ setTransitionStep = _React$useState6[1];
70
+ var _React$useState7 = React.useState(''),
71
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
72
+ containerWrapTransform = _React$useState8[0],
73
+ setContainerWrapTransform = _React$useState8[1];
74
+ var _React$useState9 = React.useState(undefined),
75
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
76
+ containerWrapHeight = _React$useState10[0],
77
+ setContainerWrapHeight = _React$useState10[1];
78
+ var _React$useState11 = React.useState(''),
79
+ _React$useState12 = _slicedToArray(_React$useState11, 2),
80
+ containerWrapOverflow = _React$useState12[0],
81
+ setContainerWrapOverflow = _React$useState12[1];
82
+ var overlayRef = React.useRef(null);
83
+ var headerRef = React.useRef(null);
84
+ var footerRef = React.useRef(null);
85
+ var containerWrapRef = React.useRef(null);
86
+ var containerInnerRef = React.useRef(null);
87
+ var containerBodyRef = React.useRef(null);
88
+ var resizeObserver = React.useRef(null);
89
+ var _useResolution = useResolution(),
90
+ isMobile = _useResolution.isMobile;
91
+ var isFullScreenView = mobileView === MODAL_MOBILE_VIEWS_ENUM.FULL_SCREEN && isMobile;
92
+ var isBottomView = mobileView === MODAL_MOBILE_VIEWS_ENUM.BOTTOM && isMobile;
93
+ var isBottomTransitionIn = transitionStep !== MODAL_TRANSITIONS_STEPS_ENUM.END_STEP && transitionStep !== MODAL_TRANSITIONS_STEPS_ENUM.MOVE_END_STEP;
94
+ var isTransitionMoveStep = transitionStep === MODAL_TRANSITIONS_STEPS_ENUM.MOVE_STEP;
95
+ var isTransitionEndStep = transitionStep === MODAL_TRANSITIONS_STEPS_ENUM.END_STEP;
96
+ var handleChangeTransitionStep = function handleChangeTransitionStep(value) {
97
+ setTransitionStep(value);
98
+ };
99
+ var handleChangeContainerWrapTransform = function handleChangeContainerWrapTransform(value) {
100
+ setContainerWrapTransform(value);
101
+ };
102
+ var handleGetModalOverlayRef = function handleGetModalOverlayRef(node) {
103
+ overlayRef.current = node;
104
+ getModalOverlayRef === null || getModalOverlayRef === void 0 ? void 0 : getModalOverlayRef(node);
105
+ };
106
+ var handleSetScrollContentMaxHeight = React.useCallback(function () {
107
+ var correctMaxHeight = getCorrectMaxHeight({
108
+ refs: {
109
+ overlayNode: overlayRef.current,
110
+ headerNode: headerRef.current,
111
+ footerNode: footerRef.current,
112
+ containerBodyNode: containerBodyRef.current
113
+ },
114
+ props: {
115
+ isStickyFooter: isStickyFooter,
116
+ isBottomView: isBottomView,
117
+ isStickyHeader: isStickyHeader
118
+ }
119
+ });
120
+ setScrollMaxHeight(correctMaxHeight);
121
+ }, [isStickyFooter, isBottomView, isStickyHeader]);
122
+ var handleSetContainerWrapHeight = React.useCallback(function () {
123
+ var containerInnerNode = containerInnerRef.current;
124
+ if (!containerInnerNode) {
125
+ return;
126
+ }
127
+ setContainerWrapHeight(containerInnerNode.offsetHeight);
128
+ }, []);
129
+ var handleSetContainerWrapRef = function handleSetContainerWrapRef(node) {
130
+ containerWrapRef.current = node;
131
+ if (!containerInnerRef.current || !resizeObserver.current) {
132
+ return;
133
+ }
134
+ if (isMobile || window.innerWidth < MOBILE_BIG_START) {
135
+ resizeObserver.current.unobserve(containerInnerRef.current);
136
+ return;
137
+ }
138
+ resizeObserver.current.observe(containerInnerRef.current);
139
+ };
140
+ var handleSetStyles = React.useCallback(function () {
141
+ if (isEnabledNativeScroll && overlayRef.current) {
142
+ overlayRef.current.scrollTo(0, 0);
143
+ return;
144
+ }
145
+ handleSetScrollContentMaxHeight();
146
+ }, [isEnabledNativeScroll, handleSetScrollContentMaxHeight]);
147
+ var handleAfterOpen = function handleAfterOpen() {
148
+ handleSetStyles();
149
+ onAfterModalOpen === null || onAfterModalOpen === void 0 ? void 0 : onAfterModalOpen();
150
+ };
151
+ var handlePopupClose = function handlePopupClose() {
152
+ setTransitionStep(MODAL_TRANSITIONS_STEPS_ENUM.END_STEP);
153
+ };
154
+ var handleTransitionExited = function handleTransitionExited() {
155
+ setTransitionStep(MODAL_TRANSITIONS_STEPS_ENUM.INITIAL_STEP);
156
+ isBottomView && setContainerWrapTransform('none');
157
+ onClose === null || onClose === void 0 ? void 0 : onClose();
158
+ };
159
+ var handleTransitionEnd = function handleTransitionEnd(e) {
160
+ if (isMobile || e.propertyName !== HEIGHT_TRANSITION_PROPERTY) {
161
+ return;
162
+ }
163
+ setContainerWrapOverflow('');
164
+ };
165
+ React.useEffect(function () {
166
+ setIsPopupOpened(isOpened);
167
+ changeBodyPadding(isOpened);
168
+ if (!isOpened) {
169
+ setContainerWrapHeight(undefined);
170
+ }
171
+ }, [isOpened]);
172
+ React.useEffect(function () {
173
+ if (isMobile || window.innerWidth < MOBILE_BIG_START || !window.ResizeObserver) {
174
+ return;
175
+ }
176
+ resizeObserver.current = new ResizeObserver(handleSetContainerWrapHeight);
177
+ }, [handleSetContainerWrapHeight, isMobile]);
178
+ React.useEffect(function () {
179
+ if (!containerInnerRef.current || !resizeObserver.current || !isMobile) {
180
+ return;
181
+ }
182
+ setContainerWrapHeight(undefined);
183
+ resizeObserver.current.unobserve(containerInnerRef.current);
184
+ }, [isMobile]);
185
+ React.useEffect(function () {
186
+ if (!containerWrapRef.current || !containerWrapHeight) {
187
+ return;
188
+ }
189
+ var isNewContainerHeightMoreCurrent = containerWrapHeight > containerWrapRef.current.offsetHeight;
190
+ isNewContainerHeightMoreCurrent && setContainerWrapOverflow('hidden');
191
+ }, [containerWrapHeight]);
192
+ React.useEffect(function () {
193
+ if (isEnabledNativeScroll) {
194
+ return undefined;
195
+ }
196
+ var handleThrottleResize = throttle(function () {
197
+ handleSetScrollContentMaxHeight();
198
+ }, THROTTLE_TIME.resize);
199
+ window.addEventListener('resize', handleThrottleResize);
200
+ return function () {
201
+ window.removeEventListener('resize', handleThrottleResize);
202
+ };
203
+ }, [isEnabledNativeScroll, handleSetScrollContentMaxHeight]);
204
+ React.useEffect(function () {
205
+ return function () {
206
+ setIsPopupOpened(false);
207
+ document.body.style.paddingRight = '';
208
+ if (!containerInnerRef.current || !resizeObserver.current) {
209
+ return;
210
+ }
211
+ resizeObserver.current.unobserve(containerInnerRef.current);
212
+ };
213
+ }, []);
214
+ var contextProps = {
215
+ classes: classes,
216
+ dataAttrs: dataAttrs,
217
+ scrollBarParams: _extends(_extends({}, scrollBarParams), {
218
+ maxHeight: scrollMaxHeight
219
+ }),
220
+ headerProps: headerProps,
221
+ footerProps: footerProps,
222
+ refs: {
223
+ overlayRef: overlayRef,
224
+ headerRef: headerRef,
225
+ footerRef: footerRef,
226
+ containerWrapRef: containerWrapRef,
227
+ containerInnerRef: containerInnerRef,
228
+ containerBodyRef: containerBodyRef
229
+ },
230
+ isEnabledNativeScroll: isEnabledNativeScroll,
231
+ isDisabledBackgroundClick: isDisabledBackgroundClick,
232
+ isMobile: isMobile,
233
+ isTransitionMoveStep: isTransitionMoveStep,
234
+ isTransitionEndStep: isTransitionEndStep,
235
+ containerWrapTransform: containerWrapTransform,
236
+ containerWrapHeight: containerWrapHeight,
237
+ containerWrapOverflow: containerWrapOverflow,
238
+ isBottomTransitionIn: isBottomTransitionIn,
239
+ onSetContainerWrapRef: handleSetContainerWrapRef,
240
+ onPopupClose: handlePopupClose,
241
+ onTransitionExited: handleTransitionExited,
242
+ onTransitionEnd: handleTransitionEnd
243
+ };
244
+ var renderContent = function renderContent() {
245
+ switch (true) {
246
+ case isFullScreenView:
247
+ return /*#__PURE__*/React.createElement(ModalMobileFullScreen, contextProps, children);
248
+ case isBottomView:
249
+ return /*#__PURE__*/React.createElement(ModalMobileBottom, _extends({}, contextProps, {
250
+ isSwipeDisabled: isSwipeDisabled,
251
+ onChangeTransitionStep: handleChangeTransitionStep,
252
+ onChangeContainerWrapTransform: handleChangeContainerWrapTransform
253
+ }), children);
254
+ default:
255
+ return /*#__PURE__*/React.createElement(ModalDesktop, contextProps, children);
256
+ }
257
+ };
258
+ return /*#__PURE__*/React.createElement(ReactModal, {
259
+ className: cn('modal-content', classes === null || classes === void 0 ? void 0 : classes.modalContent),
260
+ portalClassName: cn({
261
+ 'full-view': isFullScreenView,
262
+ 'bottom-view': isBottomView,
263
+ 'transition-end': isTransitionEndStep,
264
+ 'native-scroll': isEnabledNativeScroll
265
+ }, [className]),
266
+ overlayClassName: cn('overlay', classes === null || classes === void 0 ? void 0 : classes.overlay),
267
+ bodyOpenClassName: bodyCn('', classes === null || classes === void 0 ? void 0 : classes.bodyOpen),
268
+ isOpen: isPopupOpened,
269
+ ariaHideApp: hideAriaApp,
270
+ contentLabel: contentLabel,
271
+ shouldReturnFocusAfterClose: isReturnFocusAfterClose,
272
+ contentRef: getModalContentRef,
273
+ overlayRef: handleGetModalOverlayRef,
274
+ onRequestClose: handlePopupClose,
275
+ onAfterOpen: handleAfterOpen
276
+ }, renderContent());
277
+ };
278
+ export default Modal;
@@ -0,0 +1 @@
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-modal-content__background{background-color:rgba(0,0,0,.8);bottom:0;left:0;position:fixed;right:0;top:0}.mfui-modal-content__container-wrap{-webkit-animation:show-popup .3s ease-out;animation:show-popup .3s ease-out;position:relative;width:100%}@media screen and (min-width:768px){.mfui-modal-content__container-wrap{-webkit-transition:height .1s;transition:height .1s;width:740px}}.mfui-modal-content__container-inner{background-color:var(--base);font-family:inherit;width:100%}.mfui-modal-content__header{position:relative}.mfui-modal-content__header_shadow{-webkit-box-shadow:0 2px 12px rgba(0,0,0,.1);box-shadow:0 2px 12px rgba(0,0,0,.1)}.mfui-modal-content__header-main{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;min-height:52px}@media screen and (min-width:768px){.mfui-modal-content__header-main{min-height:64px}}.mfui-modal-content__header-button{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;top:12px;z-index:2;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;background:transparent;border:none;cursor:pointer;height:32px;justify-content:center;outline:none;width:32px}@media screen and (min-width:768px){.mfui-modal-content__header-button{height:40px;width:40px}}.mfui-modal-content__header-button_back{left:16px}.mfui-modal-content__header-button_close{right:16px}.mfui-modal-content__header-button_shadow{background:var(--base);border-radius:50%;-webkit-box-shadow:0 2px 12px rgba(0,0,0,.1);box-shadow:0 2px 12px rgba(0,0,0,.1)}.mfui-modal-content__header-button svg{fill:var(--content)}.mfui-modal-content__title-area{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 48px;padding:12px}@media screen and (min-width:768px){.mfui-modal-content__title-area{margin:0 56px;padding:16px}}.mfui-modal-content__title{font-size:15px;font-weight:500;line-height:24px;text-align:center}@media screen and (min-width:768px){.mfui-modal-content__title{font-size:20px;font-weight:500;letter-spacing:.5px;line-height:28px}}.mfui-modal-content__header-additional{-webkit-box-sizing:border-box;box-sizing:border-box;padding:8px 16px;text-align:center}@media screen and (min-width:768px){.mfui-modal-content__header-additional{padding-left:32px;padding-right:32px}}.mfui-modal-content__container-body{-webkit-box-sizing:border-box;box-sizing:border-box;padding-bottom:24px;padding-right:6px}@media screen and (min-width:768px){.mfui-modal-content__container-body{padding-bottom:32px;padding-right:12px}}.mfui-modal-content__children{-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:16px;padding-right:4px;padding-top:24px}@media screen and (min-width:768px){.mfui-modal-content__children{padding-left:32px;padding-right:14px}}.mfui-modal-content__footer{padding-left:16px;padding-right:16px}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__container-body{padding-top:24px}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__children{padding-top:0}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__header{margin-bottom:24px;margin-left:-16px;margin-right:-16px}@media screen and (min-width:768px){.mfui-modal-content__container-wrap_static-header .mfui-modal-content__header{margin-left:-32px;margin-right:-32px}}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__header-main{min-height:40px}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__header-button{top:0}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__title-area{padding-bottom:4px;padding-top:4px}.mfui-modal-content__container-wrap_hide-header .mfui-modal-content__container-body{padding-top:24px}.mfui-modal-content__container-wrap_hide-header .mfui-modal-content__children{padding-top:0}.mfui-modal-content__container-wrap_sticky-footer .mfui-modal-content__container-body{padding-bottom:0}.mfui-modal-content__container-wrap_sticky-footer .mfui-modal-content__footer_shadow{-webkit-box-shadow:0 2px 12px rgba(0,0,0,.1);box-shadow:0 2px 12px rgba(0,0,0,.1)}.mfui-modal-content__container-wrap_out-side-buttons .mfui-modal-content__container-body{padding-top:24px}.mfui-modal-content__container-wrap_native-scroll .mfui-modal-content__children,.mfui-modal-content__container-wrap_native-scroll .mfui-modal-content__container-body{padding:0}.mfui-modal-content__container-wrap_transition-end{-webkit-animation:hide-popup .2s ease-in;animation:hide-popup .2s ease-in}@-webkit-keyframes show-popup{0%{-webkit-transform:scale(95%);transform:scale(95%);-webkit-transform-origin:top;transform-origin:top}to{-webkit-transform:scale(100%);transform:scale(100%)}}@keyframes show-popup{0%{-webkit-transform:scale(95%);transform:scale(95%);-webkit-transform-origin:top;transform-origin:top}to{-webkit-transform:scale(100%);transform:scale(100%)}}@-webkit-keyframes hide-popup{0%{-webkit-transform:scale(100%);transform:scale(100%)}to{-webkit-transform:scale(95%);transform:scale(95%)}}@keyframes hide-popup{0%{-webkit-transform:scale(100%);transform:scale(100%)}to{-webkit-transform:scale(95%);transform:scale(95%)}}
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import type ModalContextPropsType from '../types';
3
+ import './ModalContent.scss';
4
+ interface IModalContentProps extends ModalContextPropsType {
5
+ children?: React.ReactNode;
6
+ }
7
+ declare const ModalContent: React.FC<IModalContentProps>;
8
+ export default ModalContent;
@@ -0,0 +1,168 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import * as React from 'react';
4
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
5
+ import { CSSTransition } from 'react-transition-group';
6
+ import ScrollBar from "../../ScrollBar/ScrollBar";
7
+ import "./ModalContent.css";
8
+ var ArrowLeft24 = function ArrowLeft24(props) {
9
+ return /*#__PURE__*/React.createElement("svg", _extends({
10
+ viewBox: "0 0 32 32"
11
+ }, props), /*#__PURE__*/React.createElement("path", {
12
+ d: "M19.5 20.8L14.7 16l4.8-4.8-1.6-1.7-6.4 6.5 6.4 6.5z"
13
+ }));
14
+ };
15
+ var Cancel24 = function Cancel24(props) {
16
+ return /*#__PURE__*/React.createElement("svg", _extends({
17
+ viewBox: "0 0 32 32"
18
+ }, props), /*#__PURE__*/React.createElement("path", {
19
+ className: "Cancel24__st0",
20
+ d: "M16 14.5L11.5 10 10 11.5l4.5 4.5-4.5 4.5 1.5 1.5 4.5-4.5 4.5 4.5 1.5-1.5-4.5-4.5 4.5-4.5-1.5-1.5-4.5 4.5z"
21
+ }));
22
+ };
23
+ var ArrowLeft32 = function ArrowLeft32(props) {
24
+ return /*#__PURE__*/React.createElement("svg", _extends({
25
+ viewBox: "0 0 40 40"
26
+ }, props), /*#__PURE__*/React.createElement("path", {
27
+ d: "M24 26l-6-6 6-6-2-2-8 8 8 8z"
28
+ }));
29
+ };
30
+ var Cancel32 = function Cancel32(props) {
31
+ return /*#__PURE__*/React.createElement("svg", _extends({
32
+ viewBox: "0 0 40 40"
33
+ }, props), /*#__PURE__*/React.createElement("path", {
34
+ d: "M20 18.586l6.364-6.364 1.414 1.414L21.414 20l6.364 6.364-1.414 1.414L20 21.414l-6.364 6.364-1.414-1.414L18.586 20l-6.364-6.364 1.414-1.414L20 18.586z"
35
+ }));
36
+ };
37
+ var cn = cnCreate('mfui-modal-content');
38
+ var ModalContent = function ModalContent(_ref) {
39
+ var classes = _ref.classes,
40
+ dataAttrs = _ref.dataAttrs,
41
+ scrollBarParams = _ref.scrollBarParams,
42
+ _ref$headerProps = _ref.headerProps,
43
+ _ref$headerProps2 = _ref$headerProps === void 0 ? {} : _ref$headerProps,
44
+ headerTitle = _ref$headerProps2.headerTitle,
45
+ showBackButton = _ref$headerProps2.showBackButton,
46
+ hideCloseButton = _ref$headerProps2.hideCloseButton,
47
+ headerAdditionalContent = _ref$headerProps2.headerAdditionalContent,
48
+ hasHeaderShadow = _ref$headerProps2.hasHeaderShadow,
49
+ hasHeaderButtonsShadow = _ref$headerProps2.hasHeaderButtonsShadow,
50
+ _ref$headerProps2$isS = _ref$headerProps2.isStickyHeader,
51
+ isStickyHeaderProps = _ref$headerProps2$isS === void 0 ? true : _ref$headerProps2$isS,
52
+ isOutSideHeaderButtons = _ref$headerProps2.isOutSideHeaderButtons,
53
+ onBackButtonClick = _ref$headerProps2.onBackButtonClick,
54
+ _ref$footerProps = _ref.footerProps,
55
+ _ref$footerProps2 = _ref$footerProps === void 0 ? {} : _ref$footerProps,
56
+ footer = _ref$footerProps2.footer,
57
+ isStickyFooterProps = _ref$footerProps2.isStickyFooter,
58
+ hasFooterShadow = _ref$footerProps2.hasFooterShadow,
59
+ _ref$refs = _ref.refs,
60
+ headerRef = _ref$refs.headerRef,
61
+ footerRef = _ref$refs.footerRef,
62
+ containerInnerRef = _ref$refs.containerInnerRef,
63
+ containerBodyRef = _ref$refs.containerBodyRef,
64
+ isEnabledNativeScroll = _ref.isEnabledNativeScroll,
65
+ isDisabledBackgroundClick = _ref.isDisabledBackgroundClick,
66
+ isMobile = _ref.isMobile,
67
+ isTransitionMoveStep = _ref.isTransitionMoveStep,
68
+ isTransitionEndStep = _ref.isTransitionEndStep,
69
+ containerWrapTransform = _ref.containerWrapTransform,
70
+ containerWrapHeight = _ref.containerWrapHeight,
71
+ containerWrapOverflow = _ref.containerWrapOverflow,
72
+ isBottomTransitionIn = _ref.isBottomTransitionIn,
73
+ children = _ref.children,
74
+ onSetContainerWrapRef = _ref.onSetContainerWrapRef,
75
+ onPopupClose = _ref.onPopupClose,
76
+ onTransitionExited = _ref.onTransitionExited,
77
+ onTransitionEnd = _ref.onTransitionEnd;
78
+ var _React$useState = React.useState(false),
79
+ _React$useState2 = _slicedToArray(_React$useState, 2),
80
+ showHeaderShadow = _React$useState2[0],
81
+ setShowHeaderShadow = _React$useState2[1];
82
+ var showHeaderMain = !!showBackButton || !!headerTitle || !hideCloseButton;
83
+ var showHeader = showHeaderMain || !!headerAdditionalContent;
84
+ var isStickyHeader = showHeader && !!isStickyHeaderProps;
85
+ var isStaticHeader = showHeader && !isStickyHeaderProps;
86
+ var isStickyFooter = !!footer && !!isStickyFooterProps;
87
+ var isStaticFooter = !!footer && !isStickyFooterProps;
88
+ var isSmallIcon = isMobile || !!hasHeaderButtonsShadow;
89
+ var handleChangeShadowState = React.useCallback(function (e) {
90
+ var scrollTop = e.nativeEvent.target.scrollTop;
91
+ setShowHeaderShadow(scrollTop > 0);
92
+ }, []);
93
+ var renderBackButton = /*#__PURE__*/React.createElement("button", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.headerBackButton), {
94
+ className: cn('header-button', {
95
+ back: true,
96
+ shadow: hasHeaderButtonsShadow
97
+ }),
98
+ type: "button",
99
+ onClick: onBackButtonClick
100
+ }), isSmallIcon ? /*#__PURE__*/React.createElement(ArrowLeft24, null) : /*#__PURE__*/React.createElement(ArrowLeft32, null));
101
+ var renderCloseButton = /*#__PURE__*/React.createElement("button", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.headerCloseButton), {
102
+ className: cn('header-button', {
103
+ close: true,
104
+ shadow: hasHeaderButtonsShadow
105
+ }, classes === null || classes === void 0 ? void 0 : classes.headerCloseButton),
106
+ type: "button",
107
+ onClick: onPopupClose
108
+ }), isSmallIcon ? /*#__PURE__*/React.createElement(Cancel24, null) : /*#__PURE__*/React.createElement(Cancel32, null));
109
+ var renderHeader = /*#__PURE__*/React.createElement("div", {
110
+ className: cn('header', {
111
+ shadow: showHeaderShadow
112
+ }, classes === null || classes === void 0 ? void 0 : classes.header),
113
+ ref: headerRef
114
+ }, !!isOutSideHeaderButtons && showBackButton && renderBackButton, !isOutSideHeaderButtons && showHeaderMain && /*#__PURE__*/React.createElement("div", {
115
+ className: cn('header-main')
116
+ }, showBackButton && renderBackButton, !!headerTitle && /*#__PURE__*/React.createElement("div", {
117
+ className: cn('title-area', classes === null || classes === void 0 ? void 0 : classes.titleArea)
118
+ }, /*#__PURE__*/React.createElement("div", {
119
+ className: cn('title', classes === null || classes === void 0 ? void 0 : classes.title)
120
+ }, headerTitle)), !hideCloseButton && renderCloseButton), !!isOutSideHeaderButtons && !hideCloseButton && renderCloseButton, !!headerAdditionalContent && /*#__PURE__*/React.createElement("div", {
121
+ className: cn('header-additional')
122
+ }, headerAdditionalContent));
123
+ var renderFooter = /*#__PURE__*/React.createElement("div", {
124
+ className: cn('footer', {
125
+ shadow: hasFooterShadow
126
+ }, classes === null || classes === void 0 ? void 0 : classes.footer),
127
+ ref: footerRef
128
+ }, footer);
129
+ var renderChildren = /*#__PURE__*/React.createElement("div", {
130
+ className: cn('children', classes === null || classes === void 0 ? void 0 : classes.children)
131
+ }, isStaticHeader && renderHeader, /*#__PURE__*/React.createElement("div", {
132
+ className: cn('children-content', classes === null || classes === void 0 ? void 0 : classes.childrenContent)
133
+ }, children), isStaticFooter && renderFooter);
134
+ var renderContainer = /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.containerWrap), {
135
+ className: cn('container-wrap', {
136
+ move: isTransitionMoveStep,
137
+ 'hide-header': !showHeader,
138
+ 'sticky-footer': isStickyFooter,
139
+ 'static-header': isStaticHeader,
140
+ 'transition-end': isTransitionEndStep,
141
+ 'native-scroll': isEnabledNativeScroll,
142
+ 'out-side-buttons': isOutSideHeaderButtons
143
+ }, classes === null || classes === void 0 ? void 0 : classes.containerWrap),
144
+ style: {
145
+ height: containerWrapHeight ? "".concat(containerWrapHeight, "px") : undefined,
146
+ transform: containerWrapTransform,
147
+ overflow: containerWrapOverflow
148
+ },
149
+ ref: onSetContainerWrapRef,
150
+ onTransitionEnd: onTransitionEnd
151
+ }), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.containerInner), {
152
+ className: cn('container-inner', classes === null || classes === void 0 ? void 0 : classes.containerInner),
153
+ ref: containerInnerRef
154
+ }), isStickyHeader && renderHeader, /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.containerBody), {
155
+ className: cn('container-body', classes === null || classes === void 0 ? void 0 : classes.containerBody),
156
+ ref: containerBodyRef,
157
+ onScroll: hasHeaderShadow ? handleChangeShadowState : undefined
158
+ }), isEnabledNativeScroll ? renderChildren : /*#__PURE__*/React.createElement(ScrollBar, scrollBarParams, renderChildren)), isStickyFooter && renderFooter));
159
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.background), {
160
+ className: cn('background', classes === null || classes === void 0 ? void 0 : classes.background),
161
+ onClick: isDisabledBackgroundClick ? undefined : onPopupClose
162
+ })), /*#__PURE__*/React.createElement(CSSTransition, {
163
+ "in": isBottomTransitionIn,
164
+ timeout: 190,
165
+ onExited: onTransitionExited
166
+ }, renderContainer));
167
+ };
168
+ export default ModalContent;
@@ -0,0 +1 @@
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-modal-desktop__container-inner{border-radius:12px}
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import type ModalContextPropsType from '../types';
3
+ import './ModalDesktop.scss';
4
+ interface IModalDesktopProps extends ModalContextPropsType {
5
+ children?: React.ReactNode;
6
+ }
7
+ declare const ModalDesktop: React.FC<IModalDesktopProps>;
8
+ export default ModalDesktop;
@@ -0,0 +1,32 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import "core-js/modules/es.symbol.js";
3
+ import "core-js/modules/es.array.index-of.js";
4
+ var __rest = this && this.__rest || function (s, e) {
5
+ var t = {};
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
7
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import * as React from 'react';
13
+ import { cnCreate } from '@megafon/ui-helpers';
14
+ import ModalContent from "../_ModalContent/ModalContent";
15
+ import "./ModalDesktop.css";
16
+ var cn = cnCreate('mfui-modal-desktop');
17
+ var ModalDesktop = function ModalDesktop(_a) {
18
+ var _b = _a.classes,
19
+ _c = _b === void 0 ? {} : _b,
20
+ containerInner = _c.containerInner,
21
+ restClasses = __rest(_c, ["containerInner"]),
22
+ children = _a.children,
23
+ restProps = __rest(_a, ["classes", "children"]);
24
+ return /*#__PURE__*/React.createElement("div", {
25
+ className: cn()
26
+ }, /*#__PURE__*/React.createElement(ModalContent, _extends({}, restProps, {
27
+ classes: _extends(_extends({}, restClasses), {
28
+ containerInner: cn('container-inner', containerInner)
29
+ })
30
+ }), children));
31
+ };
32
+ export default ModalDesktop;
@@ -0,0 +1 @@
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-modal-mobile-bottom__container-wrap{bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;position:fixed;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-ms-flex-pack:end;-webkit-animation:show-popup-from-bottom .3s linear;animation:show-popup-from-bottom .3s linear;height:auto;justify-content:flex-end;max-height:100%;overflow:hidden;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.mfui-modal-mobile-bottom__container-wrap:before{content:"";display:block;-ms-flex-item-align:end;align-self:flex-end;background-color:var(--spbSky2);border-radius:10px;height:6px;margin:0 auto 8px;width:40px}.mfui-modal-mobile-bottom__container-wrap_move{-webkit-transition:none;transition:none}.mfui-modal-mobile-bottom__container-wrap_transition-end{-webkit-animation:hide-popup-to-bottom .2s linear forwards;animation:hide-popup-to-bottom .2s linear forwards}.mfui-modal-mobile-bottom__container-inner{-webkit-box-flex:0;-ms-flex-positive:0;border-top-left-radius:8px;border-top-right-radius:8px;flex-grow:0;height:auto}@-webkit-keyframes show-popup-from-bottom{0%{opacity:0;-webkit-transform:translateY(100%);transform:translateY(100%)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes show-popup-from-bottom{0%{opacity:0;-webkit-transform:translateY(100%);transform:translateY(100%)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes hide-popup-to-bottom{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}to{opacity:0;-webkit-transform:translateY(100%);transform:translateY(100%)}}@keyframes hide-popup-to-bottom{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}to{opacity:0;-webkit-transform:translateY(100%);transform:translateY(100%)}}
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { MODAL_TRANSITIONS_STEPS_ENUM } from '../Modal';
3
+ import type ModalContextPropsType from '../types';
4
+ import './ModalMobileBottom.scss';
5
+ export interface IModalMobileBottomProps extends ModalContextPropsType {
6
+ isSwipeDisabled?: boolean;
7
+ onChangeTransitionStep: (value: MODAL_TRANSITIONS_STEPS_ENUM) => void;
8
+ onChangeContainerWrapTransform: (value: string) => void;
9
+ children?: React.ReactNode;
10
+ }
11
+ declare const ModalMobileBottom: React.FC<IModalMobileBottomProps>;
12
+ export default ModalMobileBottom;
@@ -0,0 +1,114 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import "core-js/modules/es.symbol.js";
4
+ import "core-js/modules/es.array.index-of.js";
5
+ var __rest = this && this.__rest || function (s, e) {
6
+ var t = {};
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
8
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
9
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import * as React from 'react';
14
+ import { cnCreate } from '@megafon/ui-helpers';
15
+ import ModalContent from "../_ModalContent/ModalContent";
16
+ import { MODAL_TRANSITIONS_STEPS_ENUM } from "../Modal";
17
+ import "./ModalMobileBottom.css";
18
+ var HALF_DIVIDER = 2;
19
+ var cn = cnCreate('mfui-modal-mobile-bottom');
20
+ var ModalMobileBottom = function ModalMobileBottom(_a) {
21
+ var _b = _a.classes,
22
+ _c = _b === void 0 ? {} : _b,
23
+ containerWrap = _c.containerWrap,
24
+ containerInner = _c.containerInner,
25
+ restClasses = __rest(_c, ["containerWrap", "containerInner"]),
26
+ isSwipeDisabled = _a.isSwipeDisabled,
27
+ children = _a.children,
28
+ onChangeTransitionStep = _a.onChangeTransitionStep,
29
+ onChangeContainerWrapTransform = _a.onChangeContainerWrapTransform,
30
+ restProps = __rest(_a, ["classes", "isSwipeDisabled", "children", "onChangeTransitionStep", "onChangeContainerWrapTransform"]);
31
+ var _restProps$refs = restProps.refs,
32
+ containerWrapRef = _restProps$refs.containerWrapRef,
33
+ containerInnerRef = _restProps$refs.containerInnerRef,
34
+ isTransitionMoveStep = restProps.isTransitionMoveStep,
35
+ isTransitionEndStep = restProps.isTransitionEndStep;
36
+ var _React$useState = React.useState(null),
37
+ _React$useState2 = _slicedToArray(_React$useState, 2),
38
+ initialTouchPosition = _React$useState2[0],
39
+ setInitialTouchPosition = _React$useState2[1];
40
+ var _React$useState3 = React.useState(0),
41
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
42
+ initialContainerWrapHeight = _React$useState4[0],
43
+ setInitialContainerWrapHeight = _React$useState4[1];
44
+ var animationFrameId = React.useRef(0);
45
+ var offsetHeightCenter = React.useMemo(function () {
46
+ var _a;
47
+ return initialTouchPosition && containerInnerRef.current ? ((_a = containerInnerRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) / HALF_DIVIDER : 0;
48
+ }, [containerInnerRef, initialTouchPosition]);
49
+ var handleWindowTouchMove = React.useCallback(function (e) {
50
+ if (animationFrameId) {
51
+ window.cancelAnimationFrame(animationFrameId.current);
52
+ }
53
+ var containerWrapNode = containerWrapRef.current;
54
+ animationFrameId.current = window.requestAnimationFrame(function () {
55
+ onChangeTransitionStep(MODAL_TRANSITIONS_STEPS_ENUM.MOVE_STEP);
56
+ if (!containerWrapNode || e.target !== containerWrapNode) {
57
+ return;
58
+ }
59
+ if (!initialContainerWrapHeight) {
60
+ setInitialContainerWrapHeight(containerWrapNode.clientHeight);
61
+ }
62
+ if (!initialTouchPosition) {
63
+ setInitialTouchPosition(e.touches[0].clientY);
64
+ return;
65
+ }
66
+ var positionsDiff = initialTouchPosition - e.touches[0].clientY;
67
+ var positionsDiffAbs = Math.abs(positionsDiff);
68
+ var isMoveToTop = positionsDiff > 0;
69
+ var newContainerWrapHeight = initialContainerWrapHeight - positionsDiffAbs;
70
+ var isMoveAboveInitialContainer = isMoveToTop && newContainerWrapHeight < containerWrapNode.offsetHeight;
71
+ if (isMoveAboveInitialContainer) {
72
+ return;
73
+ }
74
+ onChangeContainerWrapTransform("translateY(".concat(positionsDiffAbs, "px)"));
75
+ animationFrameId.current = 0;
76
+ });
77
+ }, [containerWrapRef, initialContainerWrapHeight, initialTouchPosition, onChangeContainerWrapTransform, onChangeTransitionStep]);
78
+ var handleWindowTouchEnd = React.useCallback(function (e) {
79
+ var _a;
80
+ var containerWrapNode = containerWrapRef.current;
81
+ if (!containerWrapNode || !isTransitionMoveStep || e.target !== containerWrapNode) {
82
+ return;
83
+ }
84
+ window.cancelAnimationFrame(animationFrameId.current);
85
+ var containerCenterPosition = containerWrapNode.offsetTop + offsetHeightCenter;
86
+ var isMoreHalfClosed = ((_a = e.changedTouches[0]) === null || _a === void 0 ? void 0 : _a.clientY) > containerCenterPosition;
87
+ setInitialTouchPosition(null);
88
+ onChangeContainerWrapTransform(isMoreHalfClosed ? 'translateY(100%)' : 'none');
89
+ onChangeTransitionStep(isMoreHalfClosed ? MODAL_TRANSITIONS_STEPS_ENUM.MOVE_END_STEP : MODAL_TRANSITIONS_STEPS_ENUM.INITIAL_STEP);
90
+ }, [containerWrapRef, isTransitionMoveStep, offsetHeightCenter, onChangeContainerWrapTransform, onChangeTransitionStep]);
91
+ React.useEffect(function () {
92
+ if (isSwipeDisabled) {
93
+ return undefined;
94
+ }
95
+ window.addEventListener('touchmove', handleWindowTouchMove);
96
+ window.addEventListener('touchend', handleWindowTouchEnd);
97
+ return function () {
98
+ window.removeEventListener('touchmove', handleWindowTouchMove);
99
+ window.removeEventListener('touchend', handleWindowTouchEnd);
100
+ };
101
+ }, [handleWindowTouchEnd, handleWindowTouchMove, isSwipeDisabled]);
102
+ return /*#__PURE__*/React.createElement("div", {
103
+ className: cn()
104
+ }, /*#__PURE__*/React.createElement(ModalContent, _extends({}, restProps, {
105
+ classes: _extends(_extends({}, restClasses), {
106
+ containerWrap: cn('container-wrap', {
107
+ move: isTransitionMoveStep,
108
+ 'transition-end': isTransitionEndStep
109
+ }, containerWrap),
110
+ containerInner: cn('container-inner', containerInner)
111
+ })
112
+ }), children));
113
+ };
114
+ export default ModalMobileBottom;
@@ -0,0 +1 @@
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-modal-mobile-full-screen{width:100%}.mfui-modal-mobile-full-screen__container-inner{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%}.mfui-modal-mobile-full-screen__container-body{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.mfui-modal-mobile-full-screen__scroll-root{height:100%}.mfui-modal-mobile-full-screen__scroll-init{height:100vh}.mfui-modal-mobile-full-screen__scroll-content{height:100%}.mfui-modal-mobile-full-screen__children{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%}.mfui-modal-mobile-full-screen__children-content{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.mfui-modal-mobile-full-screen__container-wrap{height:100%}
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import type ModalContextPropsType from '../types';
3
+ import './ModalMobileFullScreen.scss';
4
+ interface IModalMobileFullScreenProps extends ModalContextPropsType {
5
+ children?: React.ReactNode;
6
+ }
7
+ declare const ModalMobileFullScreen: React.FC<IModalMobileFullScreenProps>;
8
+ export default ModalMobileFullScreen;