@megafon/ui-core 6.0.0-beta.4 → 6.0.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.
- package/CHANGELOG.md +4016 -0
- package/dist/es/colors/ColorItem/ColorItem.css +45 -1
- package/dist/es/colors/ColorItem/ColorItem.d.ts +2 -2
- package/dist/es/colors/ColorItem/ColorItem.js +7 -5
- package/dist/es/colors/Colors.css +233 -1
- package/dist/es/colors/Colors.d.ts +1 -1
- package/dist/es/colors/Colors.js +55 -33
- package/dist/es/colors/colorsData.d.ts +4 -4
- package/dist/es/components/Accordion/Accordion.css +89 -1
- package/dist/es/components/Accordion/Accordion.d.ts +1 -2
- package/dist/es/components/Accordion/Accordion.js +65 -22
- package/dist/es/components/Avatar/Avatar.css +52 -1
- package/dist/es/components/Avatar/Avatar.d.ts +1 -1
- package/dist/es/components/Avatar/Avatar.js +27 -9
- package/dist/es/components/Avatar/doc/i/img.png +0 -0
- package/dist/es/components/Badges/components/CounterBadge/CounterBadge.css +54 -0
- package/dist/es/components/Badges/{CounterBadge → components/CounterBadge}/CounterBadge.d.ts +2 -2
- package/dist/es/components/Badges/{CounterBadge → components/CounterBadge}/CounterBadge.js +28 -10
- package/dist/es/components/Badges/components/NotificationBadge/NotificationBadge.css +58 -0
- package/dist/es/components/Badges/{NotificationBadge → components/NotificationBadge}/NotificationBadge.d.ts +4 -3
- package/dist/es/components/Badges/components/NotificationBadge/NotificationBadge.js +49 -0
- package/dist/es/components/Badges/components/PriceBadge/PriceBadge.css +119 -0
- package/dist/es/components/Badges/{PriceBadge → components/PriceBadge}/PriceBadge.d.ts +4 -4
- package/dist/es/components/Badges/{PriceBadge → components/PriceBadge}/PriceBadge.js +54 -11
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +64 -0
- package/dist/{lib/components/Badges → es/components/Badges/components}/PromoBadge/PromoBadge.d.ts +3 -3
- package/dist/es/components/Badges/{PromoBadge → components/PromoBadge}/PromoBadge.js +21 -7
- package/dist/es/components/Badges/{TimerBadge/components → components/TimerBadge}/Timer/Timer.js +32 -5
- package/dist/es/components/Badges/components/TimerBadge/TimerBadge.css +60 -0
- package/dist/{lib/components/Badges → es/components/Badges/components}/TimerBadge/TimerBadge.d.ts +2 -2
- package/dist/es/components/Badges/{TimerBadge → components/TimerBadge}/TimerBadge.js +45 -22
- package/dist/es/components/Banner/Banner.css +195 -1
- package/dist/es/components/Banner/Banner.d.ts +4 -5
- package/dist/es/components/Banner/Banner.js +129 -64
- package/dist/es/components/Banner/BannerDot.css +69 -1
- package/dist/es/components/Banner/BannerDot.d.ts +1 -1
- package/dist/es/components/Banner/BannerDot.js +22 -6
- package/dist/es/components/Banner/slidesSettings.d.ts +2 -4
- package/dist/es/components/Banner/slidesSettings.js +6 -3
- package/dist/es/components/Button/Button.css +814 -1
- package/dist/es/components/Button/Button.d.ts +6 -7
- package/dist/es/components/Button/Button.js +104 -44
- package/dist/es/components/Calendar/Calendar.css +5 -1
- package/dist/es/components/Calendar/Calendar.d.ts +2 -2
- package/dist/es/components/Calendar/Calendar.js +114 -60
- package/dist/es/components/Calendar/components/Day/Day.css +128 -0
- package/dist/{lib/components/Calendar/components/_Day → es/components/Calendar/components/Day}/Day.d.ts +4 -4
- package/dist/es/components/Calendar/components/{_Day → Day}/Day.js +50 -19
- package/dist/es/components/Calendar/components/Month/Month.css +81 -0
- package/dist/es/components/Calendar/components/{_Month → Month}/Month.d.ts +2 -3
- package/dist/es/components/Calendar/components/{_Month → Month}/Month.js +33 -9
- package/dist/es/components/Caption/Caption.css +48 -1
- package/dist/es/components/Caption/Caption.d.ts +2 -4
- package/dist/es/components/Caption/Caption.js +25 -11
- package/dist/es/components/Carousel/Carousel.css +215 -1
- package/dist/es/components/Carousel/Carousel.d.ts +10 -11
- package/dist/es/components/Carousel/Carousel.js +161 -104
- package/dist/es/components/Carousel/checkBreakpointsPropTypes.d.ts +1 -1
- package/dist/es/components/Carousel/checkBreakpointsPropTypes.js +4 -1
- package/dist/es/components/Carousel/useGradient.d.ts +1 -1
- package/dist/es/components/Carousel/useGradient.js +13 -9
- package/dist/es/components/Checkbox/Checkbox.css +150 -1
- package/dist/es/components/Checkbox/Checkbox.d.ts +4 -4
- package/dist/es/components/Checkbox/Checkbox.js +50 -21
- package/dist/es/components/Chips/Chip.css +132 -1
- package/dist/es/components/Chips/Chip.d.ts +26 -6
- package/dist/es/components/Chips/Chip.js +42 -17
- package/dist/es/components/Chips/Chips.css +19 -1
- package/dist/es/components/Chips/Chips.d.ts +2 -2
- package/dist/es/components/Chips/Chips.js +56 -32
- package/dist/es/components/Chips/components/ChipsDropdown.css +106 -1
- package/dist/es/components/Chips/components/ChipsDropdown.d.ts +2 -2
- package/dist/es/components/Chips/components/ChipsDropdown.js +27 -12
- package/dist/es/components/Collapse/Collapse.css +3 -0
- package/dist/{lib/components/_Collapse → es/components/Collapse}/Collapse.d.ts +3 -3
- package/dist/es/components/{_Collapse → Collapse}/Collapse.js +62 -25
- package/dist/es/components/ContentArea/ContentArea.css +109 -1
- package/dist/es/components/ContentArea/ContentArea.d.ts +4 -5
- package/dist/es/components/ContentArea/ContentArea.js +28 -9
- package/dist/es/components/ContentView/ContentView.css +103 -1
- package/dist/es/components/ContentView/ContentView.d.ts +2 -3
- package/dist/es/components/ContentView/ContentView.js +46 -12
- package/dist/es/components/Counter/Counter.css +123 -1
- package/dist/es/components/Counter/Counter.d.ts +1 -1
- package/dist/es/components/Counter/Counter.js +55 -20
- package/dist/es/components/Grid/Grid.css +102 -1
- package/dist/es/components/Grid/Grid.d.ts +1 -1
- package/dist/es/components/Grid/Grid.js +24 -8
- package/dist/es/components/Grid/GridColumn.css +3102 -1
- package/dist/es/components/Grid/GridColumn.d.ts +2 -2
- package/dist/es/components/Grid/GridColumn.js +62 -33
- package/dist/es/components/Header/Header.css +122 -1
- package/dist/es/components/Header/Header.d.ts +1 -3
- package/dist/es/components/Header/Header.js +28 -13
- package/dist/es/components/Link/Link.d.ts +2 -2
- package/dist/es/components/Link/Link.js +25 -9
- package/dist/es/components/List/List.css +66 -1
- package/dist/es/components/List/List.d.ts +1 -2
- package/dist/es/components/List/List.js +18 -8
- package/dist/es/components/List/ListItem.css +6 -1
- package/dist/es/components/List/ListItem.d.ts +1 -2
- package/dist/es/components/List/ListItem.js +7 -1
- package/dist/es/components/ListData/ListData.css +162 -1
- package/dist/es/components/ListData/ListData.d.ts +34 -6
- package/dist/es/components/ListData/ListData.js +65 -22
- package/dist/es/components/ListData/ListDataGroup.css +15 -1
- package/dist/es/components/ListData/ListDataGroup.d.ts +4 -4
- package/dist/es/components/ListData/ListDataGroup.js +74 -29
- package/dist/es/components/ListData/components/ListDataSortable.css +79 -1
- package/dist/es/components/ListData/components/ListDataSortable.d.ts +4 -4
- package/dist/es/components/ListData/components/ListDataSortable.js +42 -21
- package/dist/es/components/ListData/doc/i/img.png +0 -0
- package/dist/es/components/ListData/helpers.js +8 -1
- package/dist/es/components/Logo/Logo.css +43 -1
- package/dist/es/components/Logo/Logo.d.ts +1 -1
- package/dist/es/components/Logo/Logo.js +25 -9
- package/dist/es/components/NavArrow/NavArrow.css +63 -1
- package/dist/es/components/NavArrow/NavArrow.d.ts +3 -3
- package/dist/es/components/NavArrow/NavArrow.js +28 -8
- package/dist/es/components/Notification/Notification.css +350 -1
- package/dist/es/components/Notification/Notification.d.ts +4 -5
- package/dist/es/components/Notification/Notification.js +131 -61
- package/dist/es/components/Pagination/Pagination.css +5 -1
- package/dist/es/components/Pagination/Pagination.d.ts +3 -4
- package/dist/es/components/Pagination/Pagination.js +22 -7
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +62 -1
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +4 -5
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +26 -10
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.css +10 -1
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +2 -3
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +22 -5
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +17 -1
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +2 -3
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +23 -7
- package/dist/es/components/Pagination/helpers.js +3 -0
- package/dist/es/components/Pagination/usePagination.d.ts +1 -2
- package/dist/es/components/Pagination/usePagination.js +18 -6
- package/dist/es/components/Paragraph/Paragraph.css +43 -1
- package/dist/es/components/Paragraph/Paragraph.d.ts +2 -4
- package/dist/es/components/Paragraph/Paragraph.js +22 -9
- package/dist/es/components/Preloader/Preloader.css +224 -1
- package/dist/es/components/Preloader/Preloader.d.ts +3 -3
- package/dist/es/components/Preloader/Preloader.js +36 -16
- package/dist/es/components/RadioButton/RadioButton.css +120 -1
- package/dist/es/components/RadioButton/RadioButton.d.ts +1 -1
- package/dist/es/components/RadioButton/RadioButton.js +50 -18
- package/dist/es/components/Row/Row.css +238 -1
- package/dist/es/components/Row/Row.d.ts +2 -2
- package/dist/es/components/Row/Row.js +48 -23
- package/dist/es/components/Search/Search.css +453 -1
- package/dist/es/components/Search/Search.d.ts +8 -7
- package/dist/es/components/Search/Search.js +149 -54
- package/dist/es/components/Select/Select.css +389 -1
- package/dist/es/components/Select/Select.d.ts +84 -8
- package/dist/es/components/Select/Select.js +142 -52
- package/dist/es/components/Select/reducer/selectReducer.d.ts +1 -1
- package/dist/es/components/Select/reducer/selectReducer.js +32 -18
- package/dist/es/components/Selector/Selector.css +132 -1
- package/dist/es/components/Selector/Selector.d.ts +1 -1
- package/dist/es/components/Selector/Selector.js +50 -23
- package/dist/es/components/Selector/doc/Selector.example.css +17 -0
- package/dist/es/components/Sliders/Slider/Slider.css +128 -1
- package/dist/es/components/Sliders/Slider/Slider.d.ts +1 -1
- package/dist/es/components/Sliders/Slider/Slider.js +56 -25
- package/dist/es/components/Sliders/SliderRange/SliderRange.css +169 -1
- package/dist/es/components/Sliders/SliderRange/SliderRange.d.ts +1 -1
- package/dist/es/components/Sliders/SliderRange/SliderRange.js +80 -33
- package/dist/es/components/Sliders/SliderRange/helpers.js +2 -0
- package/dist/es/components/Sliders/SliderRatio/SliderRatio.css +219 -1
- package/dist/es/components/Sliders/SliderRatio/SliderRatio.d.ts +1 -1
- package/dist/es/components/Sliders/SliderRatio/SliderRatio.js +85 -36
- package/dist/es/components/Sliders/SliderRatio/helpers.js +1 -1
- package/dist/es/components/Sliders/SliderRatio/types.d.ts +1 -1
- package/dist/es/components/Sliders/SliderRatio/types.js +1 -0
- package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.css +84 -1
- package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.d.ts +2 -2
- package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.js +35 -11
- package/dist/es/components/Sliders/components/SliderScale/SliderScale.css +15 -1
- package/dist/es/components/Sliders/components/SliderScale/SliderScale.d.ts +2 -2
- package/dist/es/components/Sliders/components/SliderScale/SliderScale.js +20 -6
- package/dist/es/components/Sliders/components/SliderScale/helpers.js +16 -12
- package/dist/es/components/Sliders/helpers.js +5 -1
- package/dist/es/components/Snackbar/Snackbar.css +220 -1
- package/dist/es/components/Snackbar/Snackbar.d.ts +3 -3
- package/dist/es/components/Snackbar/Snackbar.js +82 -44
- package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.css +66 -1
- package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.d.ts +3 -3
- package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.js +17 -9
- package/dist/es/components/Switcher/Switcher.css +160 -1
- package/dist/es/components/Switcher/Switcher.d.ts +1 -2
- package/dist/es/components/Switcher/Switcher.js +39 -17
- package/dist/es/components/Tabs/Tab.d.ts +6 -0
- package/dist/es/components/Tabs/Tab.js +14 -0
- package/dist/es/components/Tabs/Tabs.css +306 -1
- package/dist/es/components/Tabs/Tabs.d.ts +5 -6
- package/dist/es/components/Tabs/Tabs.js +177 -87
- package/dist/es/components/TextField/TextField.css +343 -1
- package/dist/es/components/TextField/TextField.d.ts +3 -3
- package/dist/es/components/TextField/TextField.js +188 -80
- package/dist/es/components/TextField/utils/countGraphemes.js +18 -10
- package/dist/es/components/TextLink/TextLink.css +50 -1
- package/dist/es/components/TextLink/TextLink.d.ts +2 -2
- package/dist/es/components/TextLink/TextLink.js +27 -14
- package/dist/es/components/Tile/Tile.css +43 -1
- package/dist/es/components/Tile/Tile.d.ts +5 -7
- package/dist/es/components/Tile/Tile.js +36 -16
- package/dist/es/components/Tooltip/Tooltip.css +335 -1
- package/dist/es/components/Tooltip/Tooltip.d.ts +8 -9
- package/dist/es/components/Tooltip/Tooltip.js +139 -58
- package/dist/es/hooks/usePrevious.js +2 -0
- package/dist/es/hooks/useResolution.d.ts +1 -1
- package/dist/es/hooks/useResolution.js +11 -5
- package/dist/es/hooks/useSwipe.d.ts +1 -1
- package/dist/es/hooks/useSwipe.js +44 -17
- package/dist/es/index.d.ts +9 -16
- package/dist/es/index.js +10 -17
- package/dist/lib/colors/ColorItem/ColorItem.css +45 -1
- package/dist/lib/colors/ColorItem/ColorItem.d.ts +2 -2
- package/dist/lib/colors/ColorItem/ColorItem.js +18 -9
- package/dist/lib/colors/Colors.css +233 -1
- package/dist/lib/colors/Colors.d.ts +1 -1
- package/dist/lib/colors/Colors.js +79 -37
- package/dist/lib/colors/colorsData.d.ts +4 -4
- package/dist/lib/colors/colorsData.js +2 -1
- package/dist/lib/components/Accordion/Accordion.css +89 -1
- package/dist/lib/components/Accordion/Accordion.d.ts +1 -2
- package/dist/lib/components/Accordion/Accordion.js +81 -26
- package/dist/lib/components/Avatar/Avatar.css +52 -1
- package/dist/lib/components/Avatar/Avatar.d.ts +1 -1
- package/dist/lib/components/Avatar/Avatar.js +41 -13
- package/dist/lib/components/Avatar/doc/i/img.png +0 -0
- package/dist/lib/components/Badges/components/CounterBadge/CounterBadge.css +54 -0
- package/dist/lib/components/Badges/{CounterBadge → components/CounterBadge}/CounterBadge.d.ts +2 -2
- package/dist/lib/components/Badges/components/CounterBadge/CounterBadge.js +81 -0
- package/dist/lib/components/Badges/components/NotificationBadge/NotificationBadge.css +58 -0
- package/dist/lib/components/Badges/{NotificationBadge → components/NotificationBadge}/NotificationBadge.d.ts +4 -3
- package/dist/lib/components/Badges/components/NotificationBadge/NotificationBadge.js +71 -0
- package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.css +119 -0
- package/dist/lib/components/Badges/{PriceBadge → components/PriceBadge}/PriceBadge.d.ts +4 -4
- package/dist/lib/components/Badges/{PriceBadge → components/PriceBadge}/PriceBadge.js +75 -19
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +64 -0
- package/dist/{es/components/Badges → lib/components/Badges/components}/PromoBadge/PromoBadge.d.ts +3 -3
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.js +76 -0
- package/dist/lib/components/Badges/{TimerBadge/components → components/TimerBadge}/Timer/Timer.js +55 -11
- package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.css +60 -0
- package/dist/{es/components/Badges → lib/components/Badges/components}/TimerBadge/TimerBadge.d.ts +2 -2
- package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.js +135 -0
- package/dist/lib/components/Banner/Banner.css +195 -1
- package/dist/lib/components/Banner/Banner.d.ts +4 -5
- package/dist/lib/components/Banner/Banner.js +160 -72
- package/dist/lib/components/Banner/BannerDot.css +69 -1
- package/dist/lib/components/Banner/BannerDot.d.ts +1 -1
- package/dist/lib/components/Banner/BannerDot.js +36 -10
- package/dist/lib/components/Banner/slidesSettings.d.ts +2 -4
- package/dist/lib/components/Banner/slidesSettings.js +11 -4
- package/dist/lib/components/Button/Button.css +814 -1
- package/dist/lib/components/Button/Button.d.ts +6 -7
- package/dist/lib/components/Button/Button.js +157 -70
- package/dist/lib/components/Calendar/Calendar.css +5 -1
- package/dist/lib/components/Calendar/Calendar.d.ts +2 -2
- package/dist/lib/components/Calendar/Calendar.js +148 -70
- package/dist/lib/components/Calendar/components/Day/Day.css +128 -0
- package/dist/{es/components/Calendar/components/_Day → lib/components/Calendar/components/Day}/Day.d.ts +4 -4
- package/dist/lib/components/Calendar/components/Day/Day.js +117 -0
- package/dist/lib/components/Calendar/components/Month/Month.css +81 -0
- package/dist/lib/components/Calendar/components/{_Month → Month}/Month.d.ts +2 -3
- package/dist/lib/components/Calendar/components/Month/Month.js +122 -0
- package/dist/lib/components/Caption/Caption.css +48 -1
- package/dist/lib/components/Caption/Caption.d.ts +2 -4
- package/dist/lib/components/Caption/Caption.js +40 -15
- package/dist/lib/components/Carousel/Carousel.css +215 -1
- package/dist/lib/components/Carousel/Carousel.d.ts +10 -11
- package/dist/lib/components/Carousel/Carousel.js +226 -195
- package/dist/lib/components/Carousel/checkBreakpointsPropTypes.d.ts +1 -1
- package/dist/lib/components/Carousel/checkBreakpointsPropTypes.js +17 -5
- package/dist/lib/components/Carousel/useGradient.d.ts +1 -1
- package/dist/lib/components/Carousel/useGradient.js +24 -11
- package/dist/lib/components/Checkbox/Checkbox.css +150 -1
- package/dist/lib/components/Checkbox/Checkbox.d.ts +4 -4
- package/dist/lib/components/Checkbox/Checkbox.js +74 -34
- package/dist/lib/components/Chips/Chip.css +132 -1
- package/dist/lib/components/Chips/Chip.d.ts +26 -6
- package/dist/lib/components/Chips/Chip.js +75 -35
- package/dist/lib/components/Chips/Chips.css +19 -1
- package/dist/lib/components/Chips/Chips.d.ts +2 -2
- package/dist/lib/components/Chips/Chips.js +91 -46
- package/dist/lib/components/Chips/components/ChipsDropdown.css +106 -1
- package/dist/lib/components/Chips/components/ChipsDropdown.d.ts +2 -2
- package/dist/lib/components/Chips/components/ChipsDropdown.js +66 -30
- package/dist/lib/components/Collapse/Collapse.css +3 -0
- package/dist/{es/components/_Collapse → lib/components/Collapse}/Collapse.d.ts +3 -3
- package/dist/lib/components/Collapse/Collapse.js +141 -0
- package/dist/lib/components/ContentArea/ContentArea.css +109 -1
- package/dist/lib/components/ContentArea/ContentArea.d.ts +4 -5
- package/dist/lib/components/ContentArea/ContentArea.js +43 -13
- package/dist/lib/components/ContentView/ContentView.css +103 -1
- package/dist/lib/components/ContentView/ContentView.d.ts +2 -3
- package/dist/lib/components/ContentView/ContentView.js +62 -16
- package/dist/lib/components/Counter/Counter.css +123 -1
- package/dist/lib/components/Counter/Counter.d.ts +1 -1
- package/dist/lib/components/Counter/Counter.js +70 -24
- package/dist/lib/components/Grid/Grid.css +102 -1
- package/dist/lib/components/Grid/Grid.d.ts +1 -1
- package/dist/lib/components/Grid/Grid.js +39 -12
- package/dist/lib/components/Grid/GridColumn.css +3102 -1
- package/dist/lib/components/Grid/GridColumn.d.ts +2 -2
- package/dist/lib/components/Grid/GridColumn.js +76 -37
- package/dist/lib/components/Header/Header.css +122 -1
- package/dist/lib/components/Header/Header.d.ts +1 -3
- package/dist/lib/components/Header/Header.js +42 -17
- package/dist/lib/components/Link/Link.d.ts +2 -2
- package/dist/lib/components/Link/Link.js +33 -14
- package/dist/lib/components/List/List.css +66 -1
- package/dist/lib/components/List/List.d.ts +1 -2
- package/dist/lib/components/List/List.js +30 -12
- package/dist/lib/components/List/ListItem.css +6 -1
- package/dist/lib/components/List/ListItem.d.ts +1 -2
- package/dist/lib/components/List/ListItem.js +19 -5
- package/dist/lib/components/ListData/ListData.css +162 -1
- package/dist/lib/components/ListData/ListData.d.ts +34 -6
- package/dist/lib/components/ListData/ListData.js +110 -50
- package/dist/lib/components/ListData/ListDataGroup.css +15 -1
- package/dist/lib/components/ListData/ListDataGroup.d.ts +4 -4
- package/dist/lib/components/ListData/ListDataGroup.js +117 -47
- package/dist/lib/components/ListData/components/ListDataSortable.css +79 -1
- package/dist/lib/components/ListData/components/ListDataSortable.d.ts +4 -4
- package/dist/lib/components/ListData/components/ListDataSortable.js +73 -34
- package/dist/lib/components/ListData/doc/i/img.png +0 -0
- package/dist/lib/components/ListData/helpers.js +24 -6
- package/dist/lib/components/Logo/Logo.css +43 -1
- package/dist/lib/components/Logo/Logo.d.ts +1 -1
- package/dist/lib/components/Logo/Logo.js +40 -13
- package/dist/lib/components/NavArrow/NavArrow.css +63 -1
- package/dist/lib/components/NavArrow/NavArrow.d.ts +3 -3
- package/dist/lib/components/NavArrow/NavArrow.js +46 -14
- package/dist/lib/components/Notification/Notification.css +350 -1
- package/dist/lib/components/Notification/Notification.d.ts +4 -5
- package/dist/lib/components/Notification/Notification.js +200 -113
- package/dist/lib/components/Pagination/Pagination.css +5 -1
- package/dist/lib/components/Pagination/Pagination.d.ts +3 -4
- package/dist/lib/components/Pagination/Pagination.js +50 -18
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +62 -1
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +4 -5
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +34 -11
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.css +10 -1
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +2 -3
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +31 -6
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +17 -1
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +2 -3
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +31 -8
- package/dist/lib/components/Pagination/helpers.js +6 -1
- package/dist/lib/components/Pagination/usePagination.d.ts +1 -2
- package/dist/lib/components/Pagination/usePagination.js +35 -9
- package/dist/lib/components/Paragraph/Paragraph.css +43 -1
- package/dist/lib/components/Paragraph/Paragraph.d.ts +2 -4
- package/dist/lib/components/Paragraph/Paragraph.js +37 -13
- package/dist/lib/components/Preloader/Preloader.css +224 -1
- package/dist/lib/components/Preloader/Preloader.d.ts +3 -3
- package/dist/lib/components/Preloader/Preloader.js +57 -22
- package/dist/lib/components/RadioButton/RadioButton.css +120 -1
- package/dist/lib/components/RadioButton/RadioButton.d.ts +1 -1
- package/dist/lib/components/RadioButton/RadioButton.js +69 -22
- package/dist/lib/components/Row/Row.css +238 -1
- package/dist/lib/components/Row/Row.d.ts +2 -2
- package/dist/lib/components/Row/Row.js +75 -39
- package/dist/lib/components/Search/Search.css +453 -1
- package/dist/lib/components/Search/Search.d.ts +8 -7
- package/dist/lib/components/Search/Search.js +261 -121
- package/dist/lib/components/Select/Select.css +389 -1
- package/dist/lib/components/Select/Select.d.ts +84 -8
- package/dist/lib/components/Select/Select.js +186 -69
- package/dist/lib/components/Select/reducer/selectReducer.d.ts +1 -1
- package/dist/lib/components/Select/reducer/selectReducer.js +41 -21
- package/dist/lib/components/Selector/Selector.css +132 -1
- package/dist/lib/components/Selector/Selector.d.ts +1 -1
- package/dist/lib/components/Selector/Selector.js +70 -27
- package/dist/lib/components/Selector/doc/Selector.example.css +17 -0
- package/dist/lib/components/Sliders/Slider/Slider.css +128 -1
- package/dist/lib/components/Sliders/Slider/Slider.d.ts +1 -1
- package/dist/lib/components/Sliders/Slider/Slider.js +75 -29
- package/dist/lib/components/Sliders/SliderRange/SliderRange.css +169 -1
- package/dist/lib/components/Sliders/SliderRange/SliderRange.d.ts +1 -1
- package/dist/lib/components/Sliders/SliderRange/SliderRange.js +100 -37
- package/dist/lib/components/Sliders/SliderRange/helpers.js +18 -5
- package/dist/lib/components/Sliders/SliderRatio/SliderRatio.css +219 -1
- package/dist/lib/components/Sliders/SliderRatio/SliderRatio.d.ts +1 -1
- package/dist/lib/components/Sliders/SliderRatio/SliderRatio.js +111 -40
- package/dist/lib/components/Sliders/SliderRatio/helpers.js +27 -8
- package/dist/lib/components/Sliders/SliderRatio/types.d.ts +1 -1
- package/dist/lib/components/Sliders/SliderRatio/types.js +2 -0
- package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.css +84 -1
- package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.d.ts +2 -2
- package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.js +56 -17
- package/dist/lib/components/Sliders/components/SliderScale/SliderScale.css +15 -1
- package/dist/lib/components/Sliders/components/SliderScale/SliderScale.d.ts +2 -2
- package/dist/lib/components/Sliders/components/SliderScale/SliderScale.js +39 -11
- package/dist/lib/components/Sliders/components/SliderScale/helpers.js +33 -15
- package/dist/lib/components/Sliders/helpers.js +22 -5
- package/dist/lib/components/Snackbar/Snackbar.css +220 -1
- package/dist/lib/components/Snackbar/Snackbar.d.ts +3 -3
- package/dist/lib/components/Snackbar/Snackbar.js +138 -81
- package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.css +66 -1
- package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.d.ts +3 -3
- package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.js +36 -17
- package/dist/lib/components/Switcher/Switcher.css +160 -1
- package/dist/lib/components/Switcher/Switcher.d.ts +1 -2
- package/dist/lib/components/Switcher/Switcher.js +52 -21
- package/dist/lib/components/Tabs/Tab.d.ts +6 -0
- package/dist/lib/components/Tabs/Tab.js +26 -5
- package/dist/lib/components/Tabs/Tabs.css +306 -1
- package/dist/lib/components/Tabs/Tabs.d.ts +5 -6
- package/dist/lib/components/Tabs/Tabs.js +209 -95
- package/dist/lib/components/TextField/TextField.css +343 -1
- package/dist/lib/components/TextField/TextField.d.ts +3 -3
- package/dist/lib/components/TextField/TextField.js +238 -113
- package/dist/lib/components/TextField/utils/countGraphemes.js +28 -11
- package/dist/lib/components/TextLink/TextLink.css +50 -1
- package/dist/lib/components/TextLink/TextLink.d.ts +2 -2
- package/dist/lib/components/TextLink/TextLink.js +41 -18
- package/dist/lib/components/Tile/Tile.css +43 -1
- package/dist/lib/components/Tile/Tile.d.ts +5 -7
- package/dist/lib/components/Tile/Tile.js +54 -26
- package/dist/lib/components/Tooltip/Tooltip.css +335 -1
- package/dist/lib/components/Tooltip/Tooltip.d.ts +8 -9
- package/dist/lib/components/Tooltip/Tooltip.js +218 -110
- package/dist/lib/constants/throttleTime.js +3 -2
- package/dist/lib/hooks/usePrevious.js +11 -4
- package/dist/lib/hooks/useResolution.d.ts +1 -1
- package/dist/lib/hooks/useResolution.js +23 -9
- package/dist/lib/hooks/useSwipe.d.ts +1 -1
- package/dist/lib/hooks/useSwipe.js +63 -21
- package/dist/lib/index.d.ts +9 -16
- package/dist/lib/index.js +101 -82
- package/package.json +101 -106
- package/styles/base.less +171 -0
- package/styles/colors.css +0 -53
- package/dist/es/components/Badges/CounterBadge/CounterBadge.css +0 -1
- package/dist/es/components/Badges/NotificationBadge/NotificationBadge.css +0 -1
- package/dist/es/components/Badges/NotificationBadge/NotificationBadge.js +0 -34
- package/dist/es/components/Badges/PriceBadge/PriceBadge.css +0 -1
- package/dist/es/components/Badges/PromoBadge/PromoBadge.css +0 -1
- package/dist/es/components/Badges/TimerBadge/TimerBadge.css +0 -1
- package/dist/es/components/Calendar/components/_Day/Day.css +0 -1
- package/dist/es/components/Calendar/components/_Month/Month.css +0 -1
- package/dist/es/components/Modal/Modal.css +0 -1
- package/dist/es/components/Modal/Modal.d.ts +0 -106
- package/dist/es/components/Modal/Modal.js +0 -277
- package/dist/es/components/Modal/_ModalContent/ModalContent.css +0 -1
- package/dist/es/components/Modal/_ModalContent/ModalContent.d.ts +0 -8
- package/dist/es/components/Modal/_ModalContent/ModalContent.js +0 -167
- package/dist/es/components/Modal/_ModalDesktop/ModalDesktop.css +0 -1
- package/dist/es/components/Modal/_ModalDesktop/ModalDesktop.d.ts +0 -8
- package/dist/es/components/Modal/_ModalDesktop/ModalDesktop.js +0 -32
- package/dist/es/components/Modal/_ModalMobileBottom/ModalMobileBottom.css +0 -1
- package/dist/es/components/Modal/_ModalMobileBottom/ModalMobileBottom.d.ts +0 -12
- package/dist/es/components/Modal/_ModalMobileBottom/ModalMobileBottom.js +0 -114
- package/dist/es/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.css +0 -1
- package/dist/es/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.d.ts +0 -8
- package/dist/es/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.js +0 -55
- package/dist/es/components/Modal/mocks.d.ts +0 -3
- package/dist/es/components/Modal/mocks.js +0 -79
- package/dist/es/components/Modal/types.d.ts +0 -28
- package/dist/es/components/Modal/types.js +0 -1
- package/dist/es/components/Modal/utils/utils.d.ts +0 -18
- package/dist/es/components/Modal/utils/utils.js +0 -66
- package/dist/es/components/ScrollBar/ScrollBar.css +0 -1
- package/dist/es/components/ScrollBar/ScrollBar.d.ts +0 -34
- package/dist/es/components/ScrollBar/ScrollBar.js +0 -86
- package/dist/es/components/_Collapse/Collapse.css +0 -1
- package/dist/es/styles/base.css +0 -1
- package/dist/lib/components/Badges/CounterBadge/CounterBadge.css +0 -1
- package/dist/lib/components/Badges/CounterBadge/CounterBadge.js +0 -52
- package/dist/lib/components/Badges/NotificationBadge/NotificationBadge.css +0 -1
- package/dist/lib/components/Badges/NotificationBadge/NotificationBadge.js +0 -43
- package/dist/lib/components/Badges/PriceBadge/PriceBadge.css +0 -1
- package/dist/lib/components/Badges/PromoBadge/PromoBadge.css +0 -1
- package/dist/lib/components/Badges/PromoBadge/PromoBadge.js +0 -49
- package/dist/lib/components/Badges/TimerBadge/TimerBadge.css +0 -1
- package/dist/lib/components/Badges/TimerBadge/TimerBadge.js +0 -97
- package/dist/lib/components/Calendar/components/_Day/Day.css +0 -1
- package/dist/lib/components/Calendar/components/_Day/Day.js +0 -75
- package/dist/lib/components/Calendar/components/_Month/Month.css +0 -1
- package/dist/lib/components/Calendar/components/_Month/Month.js +0 -93
- package/dist/lib/components/Modal/Modal.css +0 -1
- package/dist/lib/components/Modal/Modal.d.ts +0 -106
- package/dist/lib/components/Modal/Modal.js +0 -286
- package/dist/lib/components/Modal/_ModalContent/ModalContent.css +0 -1
- package/dist/lib/components/Modal/_ModalContent/ModalContent.d.ts +0 -8
- package/dist/lib/components/Modal/_ModalContent/ModalContent.js +0 -176
- package/dist/lib/components/Modal/_ModalDesktop/ModalDesktop.css +0 -1
- package/dist/lib/components/Modal/_ModalDesktop/ModalDesktop.d.ts +0 -8
- package/dist/lib/components/Modal/_ModalDesktop/ModalDesktop.js +0 -41
- package/dist/lib/components/Modal/_ModalMobileBottom/ModalMobileBottom.css +0 -1
- package/dist/lib/components/Modal/_ModalMobileBottom/ModalMobileBottom.d.ts +0 -12
- package/dist/lib/components/Modal/_ModalMobileBottom/ModalMobileBottom.js +0 -123
- package/dist/lib/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.css +0 -1
- package/dist/lib/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.d.ts +0 -8
- package/dist/lib/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.js +0 -64
- package/dist/lib/components/Modal/mocks.d.ts +0 -3
- package/dist/lib/components/Modal/mocks.js +0 -85
- package/dist/lib/components/Modal/types.d.ts +0 -28
- package/dist/lib/components/Modal/types.js +0 -5
- package/dist/lib/components/Modal/utils/utils.d.ts +0 -18
- package/dist/lib/components/Modal/utils/utils.js +0 -72
- package/dist/lib/components/ScrollBar/ScrollBar.css +0 -1
- package/dist/lib/components/ScrollBar/ScrollBar.d.ts +0 -34
- package/dist/lib/components/ScrollBar/ScrollBar.js +0 -94
- package/dist/lib/components/_Collapse/Collapse.css +0 -1
- package/dist/lib/components/_Collapse/Collapse.js +0 -95
- package/dist/lib/styles/base.css +0 -1
- package/styles/base.scss +0 -150
- /package/dist/es/components/Badges/{TimerBadge/components → components/TimerBadge}/Timer/Timer.d.ts +0 -0
- /package/dist/lib/components/Badges/{TimerBadge/components → components/TimerBadge}/Timer/Timer.d.ts +0 -0
|
@@ -1,71 +1,82 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import "core-js/modules/es.array.map.js";
|
|
4
3
|
import "core-js/modules/es.array.slice.js";
|
|
5
|
-
import
|
|
4
|
+
import "core-js/modules/es.array.map.js";
|
|
5
|
+
import "core-js/modules/es.object.values.js";
|
|
6
|
+
import React from 'react';
|
|
6
7
|
import { breakpoints, cnCreate } from '@megafon/ui-helpers';
|
|
7
8
|
import throttle from 'lodash.throttle';
|
|
9
|
+
import * as PropTypes from 'prop-types';
|
|
8
10
|
import throttleTime from "../../constants/throttleTime";
|
|
9
|
-
import Chip from "./Chip";
|
|
11
|
+
import Chip, { ChipColors, ChipPropType } from "./Chip";
|
|
10
12
|
import ChipsDropdown from "./components/ChipsDropdown";
|
|
11
13
|
import "./Chips.css";
|
|
12
14
|
var DESKTOP_SMALL_START = breakpoints.DESKTOP_SMALL_START,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
DESKTOP_MIDDLE_START = breakpoints.DESKTOP_MIDDLE_START,
|
|
16
|
+
MOBILE_BIG_START = breakpoints.MOBILE_BIG_START;
|
|
15
17
|
var cn = cnCreate('mfui-chips');
|
|
18
|
+
|
|
16
19
|
var Chips = function Chips(_ref) {
|
|
17
20
|
var items = _ref.items,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
value = _ref.value,
|
|
22
|
+
_ref$color = _ref.color,
|
|
23
|
+
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
24
|
+
_ref$moreTitle = _ref.moreTitle,
|
|
25
|
+
moreTitle = _ref$moreTitle === void 0 ? 'Еще' : _ref$moreTitle,
|
|
26
|
+
visibleItemsCountAll = _ref.visibleItemsCountAll,
|
|
27
|
+
visibleItemsCountTablet = _ref.visibleItemsCountTablet,
|
|
28
|
+
visibleItemsCountDesktop = _ref.visibleItemsCountDesktop,
|
|
29
|
+
visibleItemsCountWide = _ref.visibleItemsCountWide,
|
|
30
|
+
onChange = _ref.onChange,
|
|
31
|
+
className = _ref.className;
|
|
32
|
+
|
|
29
33
|
var _React$useState = React.useState(value),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
35
|
+
selectedId = _React$useState2[0],
|
|
36
|
+
setSelectedId = _React$useState2[1];
|
|
37
|
+
|
|
33
38
|
var _React$useState3 = React.useState(visibleItemsCountAll),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
40
|
+
visibleItemsCount = _React$useState4[0],
|
|
41
|
+
setVisibleItemsCount = _React$useState4[1];
|
|
42
|
+
|
|
37
43
|
var _React$useState5 = React.useState([]),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
45
|
+
visibleItems = _React$useState6[0],
|
|
46
|
+
setVisibleItems = _React$useState6[1];
|
|
47
|
+
|
|
41
48
|
var _React$useState7 = React.useState(null),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
50
|
+
hiddenItems = _React$useState8[0],
|
|
51
|
+
setHiddenItems = _React$useState8[1];
|
|
52
|
+
|
|
45
53
|
var handleClick = React.useCallback(function (e, id) {
|
|
46
54
|
e.persist();
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(id, e);
|
|
50
|
-
}
|
|
55
|
+
setSelectedId(id);
|
|
56
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(id, e);
|
|
51
57
|
}, [onChange]);
|
|
52
58
|
React.useEffect(function () {
|
|
53
59
|
var resizeHandler = function resizeHandler() {
|
|
54
60
|
var windowWidth = window.innerWidth;
|
|
61
|
+
|
|
55
62
|
if (visibleItemsCountWide && windowWidth >= DESKTOP_MIDDLE_START) {
|
|
56
63
|
setVisibleItemsCount(visibleItemsCountWide);
|
|
57
64
|
return;
|
|
58
65
|
}
|
|
66
|
+
|
|
59
67
|
if (visibleItemsCountDesktop && windowWidth >= DESKTOP_SMALL_START && windowWidth < DESKTOP_MIDDLE_START) {
|
|
60
68
|
setVisibleItemsCount(visibleItemsCountDesktop);
|
|
61
69
|
return;
|
|
62
70
|
}
|
|
71
|
+
|
|
63
72
|
if (visibleItemsCountTablet && windowWidth >= MOBILE_BIG_START && windowWidth < DESKTOP_SMALL_START) {
|
|
64
73
|
setVisibleItemsCount(visibleItemsCountTablet);
|
|
65
74
|
return;
|
|
66
75
|
}
|
|
76
|
+
|
|
67
77
|
setVisibleItemsCount(visibleItemsCountAll);
|
|
68
78
|
};
|
|
79
|
+
|
|
69
80
|
var resizeHandlerThrottled = throttle(resizeHandler, throttleTime.resize);
|
|
70
81
|
resizeHandler();
|
|
71
82
|
window.addEventListener('resize', resizeHandlerThrottled);
|
|
@@ -102,4 +113,17 @@ var Chips = function Chips(_ref) {
|
|
|
102
113
|
onClick: handleClick
|
|
103
114
|
}));
|
|
104
115
|
};
|
|
116
|
+
|
|
117
|
+
Chips.propTypes = {
|
|
118
|
+
items: PropTypes.arrayOf(PropTypes.shape(ChipPropType).isRequired).isRequired,
|
|
119
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
120
|
+
color: PropTypes.oneOf(Object.values(ChipColors)),
|
|
121
|
+
visibleItemsCountAll: PropTypes.number,
|
|
122
|
+
visibleItemsCountTablet: PropTypes.number,
|
|
123
|
+
visibleItemsCountDesktop: PropTypes.number,
|
|
124
|
+
visibleItemsCountWide: PropTypes.number,
|
|
125
|
+
moreTitle: PropTypes.string,
|
|
126
|
+
onChange: PropTypes.func,
|
|
127
|
+
className: PropTypes.string
|
|
128
|
+
};
|
|
105
129
|
export default Chips;
|
|
@@ -1 +1,106 @@
|
|
|
1
|
-
|
|
1
|
+
@-webkit-keyframes listAppear {
|
|
2
|
+
from {
|
|
3
|
+
-webkit-transform: translateY(-25px);
|
|
4
|
+
transform: translateY(-25px);
|
|
5
|
+
opacity: 0;
|
|
6
|
+
}
|
|
7
|
+
to {
|
|
8
|
+
-webkit-transform: translateY(0);
|
|
9
|
+
transform: translateY(0);
|
|
10
|
+
opacity: 1;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
@keyframes listAppear {
|
|
14
|
+
from {
|
|
15
|
+
-webkit-transform: translateY(-25px);
|
|
16
|
+
transform: translateY(-25px);
|
|
17
|
+
opacity: 0;
|
|
18
|
+
}
|
|
19
|
+
to {
|
|
20
|
+
-webkit-transform: translateY(0);
|
|
21
|
+
transform: translateY(0);
|
|
22
|
+
opacity: 1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.mfui-chips-dropdown {
|
|
26
|
+
position: relative;
|
|
27
|
+
}
|
|
28
|
+
.mfui-chips-dropdown__button {
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
31
|
+
.mfui-chips-dropdown__list {
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 100%;
|
|
34
|
+
left: 0;
|
|
35
|
+
z-index: 100;
|
|
36
|
+
display: block;
|
|
37
|
+
border-radius: 12px;
|
|
38
|
+
background-color: var(--base);
|
|
39
|
+
-webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
40
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
41
|
+
-webkit-animation-name: listAppear;
|
|
42
|
+
animation-name: listAppear;
|
|
43
|
+
-webkit-animation-duration: 0.3s;
|
|
44
|
+
animation-duration: 0.3s;
|
|
45
|
+
-webkit-animation-timing-function: ease-in-out;
|
|
46
|
+
animation-timing-function: ease-in-out;
|
|
47
|
+
}
|
|
48
|
+
.mfui-chips-dropdown__list-inner {
|
|
49
|
+
-webkit-box-sizing: border-box;
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
max-height: 320px;
|
|
52
|
+
width: -webkit-max-content;
|
|
53
|
+
width: -moz-max-content;
|
|
54
|
+
width: max-content;
|
|
55
|
+
max-width: 256px;
|
|
56
|
+
padding: 16px;
|
|
57
|
+
overflow-y: auto;
|
|
58
|
+
scrollbar-width: thin;
|
|
59
|
+
scrollbar-color: var(--spbSky2) transparent;
|
|
60
|
+
overflow-wrap: normal;
|
|
61
|
+
}
|
|
62
|
+
.mfui-chips-dropdown__list-inner::-webkit-scrollbar {
|
|
63
|
+
width: 16px;
|
|
64
|
+
}
|
|
65
|
+
.mfui-chips-dropdown__list-inner::-webkit-scrollbar-thumb {
|
|
66
|
+
border: 6px solid transparent;
|
|
67
|
+
border-radius: 16px;
|
|
68
|
+
background-color: var(--spbSky2);
|
|
69
|
+
background-clip: padding-box;
|
|
70
|
+
}
|
|
71
|
+
.mfui-chips-dropdown__list-inner::-webkit-scrollbar-thumb:hover {
|
|
72
|
+
background-color: var(--spbSky3);
|
|
73
|
+
}
|
|
74
|
+
.mfui-chips-dropdown__list-item {
|
|
75
|
+
font-family: inherit;
|
|
76
|
+
font-size: 15px;
|
|
77
|
+
line-height: 24px;
|
|
78
|
+
font-weight: 500;
|
|
79
|
+
display: -webkit-box;
|
|
80
|
+
display: -ms-flexbox;
|
|
81
|
+
display: flex;
|
|
82
|
+
padding: 12px 32px;
|
|
83
|
+
border-radius: 12px;
|
|
84
|
+
background-color: transparent;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
}
|
|
87
|
+
.mfui-chips-dropdown__list-item:hover {
|
|
88
|
+
background-color: var(--spbSky0);
|
|
89
|
+
}
|
|
90
|
+
.mfui-chips-dropdown__list-item_with-icon {
|
|
91
|
+
padding-left: 16px;
|
|
92
|
+
padding-right: 16px;
|
|
93
|
+
}
|
|
94
|
+
.mfui-chips-dropdown__icon {
|
|
95
|
+
display: block;
|
|
96
|
+
width: 24px;
|
|
97
|
+
min-width: 24px;
|
|
98
|
+
max-height: 24px;
|
|
99
|
+
margin-right: 16px;
|
|
100
|
+
}
|
|
101
|
+
.mfui-chips-dropdown__icon svg {
|
|
102
|
+
display: block;
|
|
103
|
+
width: 100%;
|
|
104
|
+
height: 100%;
|
|
105
|
+
fill: var(--content);
|
|
106
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { ChipColorsType, ChipIdType, IChipProps } from '../Chip';
|
|
3
|
-
import './ChipsDropdown.
|
|
3
|
+
import './ChipsDropdown.less';
|
|
4
4
|
export interface IChipsDropdownProps {
|
|
5
5
|
moreTitle: string;
|
|
6
6
|
value: ChipIdType;
|
|
@@ -2,24 +2,28 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import "core-js/modules/es.array.find.js";
|
|
4
4
|
import "core-js/modules/es.array.map.js";
|
|
5
|
-
import "core-js/modules/es.object.
|
|
6
|
-
import
|
|
5
|
+
import "core-js/modules/es.object.values.js";
|
|
6
|
+
import React from 'react';
|
|
7
7
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
8
|
-
import
|
|
8
|
+
import * as PropTypes from 'prop-types';
|
|
9
|
+
import Chip, { ChipColors, ChipPropType } from "../Chip";
|
|
9
10
|
import "./ChipsDropdown.css";
|
|
10
11
|
var cn = cnCreate('mfui-chips-dropdown');
|
|
12
|
+
|
|
11
13
|
var ChipsDropdown = function ChipsDropdown(_ref) {
|
|
12
14
|
var color = _ref.color,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
moreTitle = _ref.moreTitle,
|
|
16
|
+
_ref$items = _ref.items,
|
|
17
|
+
items = _ref$items === void 0 ? [] : _ref$items,
|
|
18
|
+
value = _ref.value,
|
|
19
|
+
onClick = _ref.onClick,
|
|
20
|
+
dataAttrs = _ref.dataAttrs;
|
|
21
|
+
|
|
19
22
|
var _React$useState = React.useState(false),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
24
|
+
isDropdownOpen = _React$useState2[0],
|
|
25
|
+
setIsDropdownOpen = _React$useState2[1];
|
|
26
|
+
|
|
23
27
|
var dropdownRef = React.useRef(null);
|
|
24
28
|
var listRef = React.useRef(null);
|
|
25
29
|
var currentItem = React.useMemo(function () {
|
|
@@ -35,10 +39,12 @@ var ChipsDropdown = function ChipsDropdown(_ref) {
|
|
|
35
39
|
setIsDropdownOpen(false);
|
|
36
40
|
}
|
|
37
41
|
}, []);
|
|
42
|
+
|
|
38
43
|
var handleOpenItemList = function handleOpenItemList() {
|
|
39
44
|
setIsDropdownOpen(true);
|
|
40
45
|
document.addEventListener('mousedown', handleOutsideClick);
|
|
41
46
|
};
|
|
47
|
+
|
|
42
48
|
var handleItemClick = React.useCallback(function (item) {
|
|
43
49
|
return function (e) {
|
|
44
50
|
e.persist();
|
|
@@ -83,4 +89,13 @@ var ChipsDropdown = function ChipsDropdown(_ref) {
|
|
|
83
89
|
}, item.icon), !!(item === null || item === void 0 ? void 0 : item.children) && item.children);
|
|
84
90
|
}))));
|
|
85
91
|
};
|
|
92
|
+
|
|
93
|
+
ChipsDropdown.propTypes = {
|
|
94
|
+
moreTitle: PropTypes.string.isRequired,
|
|
95
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
96
|
+
items: PropTypes.arrayOf(PropTypes.shape(ChipPropType).isRequired).isRequired,
|
|
97
|
+
color: PropTypes.oneOf(Object.values(ChipColors)).isRequired,
|
|
98
|
+
onClick: PropTypes.func.isRequired,
|
|
99
|
+
dataAttrs: PropTypes.objectOf(PropTypes.object)
|
|
100
|
+
};
|
|
86
101
|
export default ChipsDropdown;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import './Collapse.
|
|
3
|
-
type CollapseDefaultProps = {
|
|
2
|
+
import './Collapse.less';
|
|
3
|
+
declare type CollapseDefaultProps = {
|
|
4
4
|
animation?: boolean;
|
|
5
5
|
animationDuration?: number;
|
|
6
6
|
};
|
|
7
|
-
type CollapseProps = CollapseDefaultProps & {
|
|
7
|
+
declare type CollapseProps = CollapseDefaultProps & {
|
|
8
8
|
isOpened: boolean;
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
className?: string;
|
|
@@ -2,51 +2,61 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useCallback, useEffect } from 'react';
|
|
4
4
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
5
|
+
import * as PropTypes from 'prop-types';
|
|
5
6
|
import "./Collapse.css";
|
|
6
7
|
var sin = Math.sin,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
cos = Math.cos,
|
|
9
|
+
min = Math.min,
|
|
10
|
+
PI = Math.PI;
|
|
11
|
+
|
|
10
12
|
var easeOutSine = function easeOutSine(progress) {
|
|
11
13
|
return sin(progress * PI / 2);
|
|
12
14
|
};
|
|
15
|
+
|
|
13
16
|
var easeInSine = function easeInSine(progress) {
|
|
14
17
|
return 1 - cos(progress * PI / 2);
|
|
15
18
|
};
|
|
19
|
+
|
|
16
20
|
var cn = cnCreate('mfui-collapse');
|
|
21
|
+
|
|
17
22
|
var Collapse = function Collapse(_ref) {
|
|
18
23
|
var className = _ref.className,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
classNameContainer = _ref.classNameContainer,
|
|
25
|
+
_ref$animation = _ref.animation,
|
|
26
|
+
animation = _ref$animation === void 0 ? true : _ref$animation,
|
|
27
|
+
_ref$animationDuratio = _ref.animationDuration,
|
|
28
|
+
animationDuration = _ref$animationDuratio === void 0 ? 300 : _ref$animationDuratio,
|
|
29
|
+
children = _ref.children,
|
|
30
|
+
isOpened = _ref.isOpened,
|
|
31
|
+
dataAttrs = _ref.dataAttrs,
|
|
32
|
+
openedClassName = _ref.openedClassName;
|
|
28
33
|
var duration = animation ? animationDuration : 0;
|
|
29
34
|
var animationStart = React.useRef(null);
|
|
30
35
|
var animationId = React.useRef(null);
|
|
31
|
-
var
|
|
36
|
+
var canUpdate = React.useRef(false);
|
|
32
37
|
var rootNode = React.useRef(null);
|
|
33
38
|
useEffect(function () {
|
|
34
39
|
animationId.current && window.cancelAnimationFrame(animationId.current);
|
|
35
40
|
}, [isOpened]);
|
|
36
41
|
var animateSlide = useCallback(function (contentHeight, animationTime, timePassed) {
|
|
37
42
|
var isOpenAction = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
43
|
+
|
|
38
44
|
if (!rootNode.current) {
|
|
39
45
|
return;
|
|
40
46
|
}
|
|
47
|
+
|
|
41
48
|
openedClassName && rootNode.current.classList.remove(openedClassName);
|
|
49
|
+
|
|
42
50
|
if (!animationStart.current) {
|
|
43
51
|
animationStart.current = timePassed;
|
|
44
52
|
}
|
|
53
|
+
|
|
45
54
|
var runtime = timePassed - animationStart.current;
|
|
46
55
|
var progress = animationTime ? min(runtime / animationTime, 1) : 1;
|
|
47
56
|
var isAnimationInProgress = progress < 1;
|
|
48
57
|
var nextHeight = isOpenAction ? easeOutSine(progress) * contentHeight : contentHeight - easeInSine(progress) * contentHeight;
|
|
49
58
|
rootNode.current.style.height = "".concat(nextHeight, "px");
|
|
59
|
+
|
|
50
60
|
if (isAnimationInProgress) {
|
|
51
61
|
animationId.current = window.requestAnimationFrame(function (time) {
|
|
52
62
|
return animateSlide(contentHeight, animationTime, time, isOpenAction);
|
|
@@ -62,25 +72,52 @@ var Collapse = function Collapse(_ref) {
|
|
|
62
72
|
if (!rootNode.current) {
|
|
63
73
|
return;
|
|
64
74
|
}
|
|
75
|
+
|
|
65
76
|
var _rootNode$current$scr = rootNode.current.scrollHeight,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
scrollHeight = _rootNode$current$scr === void 0 ? 0 : _rootNode$current$scr;
|
|
78
|
+
|
|
79
|
+
switch (true) {
|
|
80
|
+
case !canUpdate.current && isOpened:
|
|
81
|
+
rootNode.current.style.height = 'auto';
|
|
82
|
+
break;
|
|
83
|
+
|
|
84
|
+
case !canUpdate.current && !isOpened:
|
|
85
|
+
rootNode.current.style.height = '0px';
|
|
86
|
+
break;
|
|
87
|
+
|
|
88
|
+
case isOpened:
|
|
89
|
+
animationId.current = window.requestAnimationFrame(function (timePassed) {
|
|
90
|
+
return animateSlide(scrollHeight, duration, timePassed, true);
|
|
91
|
+
});
|
|
92
|
+
break;
|
|
93
|
+
|
|
94
|
+
default:
|
|
95
|
+
animationId.current = window.requestAnimationFrame(function (timePassed) {
|
|
96
|
+
return animateSlide(scrollHeight, duration, timePassed);
|
|
97
|
+
});
|
|
74
98
|
}
|
|
99
|
+
|
|
100
|
+
canUpdate.current = true;
|
|
75
101
|
}, [isOpened, duration, animateSlide]);
|
|
76
102
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
77
103
|
className: cn([className]),
|
|
78
|
-
ref: rootNode
|
|
79
|
-
style: {
|
|
80
|
-
height: '0px'
|
|
81
|
-
}
|
|
104
|
+
ref: rootNode
|
|
82
105
|
}), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.inner), {
|
|
83
106
|
className: classNameContainer
|
|
84
107
|
}), children));
|
|
85
108
|
};
|
|
109
|
+
|
|
110
|
+
Collapse.propTypes = {
|
|
111
|
+
className: PropTypes.string,
|
|
112
|
+
classNameContainer: PropTypes.string,
|
|
113
|
+
openedClassName: PropTypes.string,
|
|
114
|
+
isOpened: PropTypes.bool.isRequired,
|
|
115
|
+
animationDuration: PropTypes.number,
|
|
116
|
+
animation: PropTypes.bool,
|
|
117
|
+
dataAttrs: PropTypes.shape({
|
|
118
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
119
|
+
inner: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
120
|
+
}),
|
|
121
|
+
children: PropTypes.node.isRequired
|
|
122
|
+
};
|
|
86
123
|
export default Collapse;
|
|
@@ -1 +1,109 @@
|
|
|
1
|
-
h1,
|
|
1
|
+
h1,
|
|
2
|
+
h2,
|
|
3
|
+
h3,
|
|
4
|
+
h4,
|
|
5
|
+
h5 {
|
|
6
|
+
margin: 0;
|
|
7
|
+
}
|
|
8
|
+
.mfui-content-area_background-color_transparent {
|
|
9
|
+
background-color: transparent;
|
|
10
|
+
}
|
|
11
|
+
.mfui-content-area_background-color_black {
|
|
12
|
+
background-color: var(--stcBlack);
|
|
13
|
+
}
|
|
14
|
+
.mfui-content-area_background-color_white {
|
|
15
|
+
background-color: var(--stcWhite);
|
|
16
|
+
}
|
|
17
|
+
.mfui-content-area_background-color_green {
|
|
18
|
+
background-color: var(--brandGreen);
|
|
19
|
+
}
|
|
20
|
+
.mfui-content-area_background-color_purple {
|
|
21
|
+
background-color: var(--brandPurple);
|
|
22
|
+
}
|
|
23
|
+
.mfui-content-area_background-color_spbSky0 {
|
|
24
|
+
background-color: var(--spbSky0);
|
|
25
|
+
}
|
|
26
|
+
.mfui-content-area_background-color_spbSky1 {
|
|
27
|
+
background-color: var(--spbSky1);
|
|
28
|
+
}
|
|
29
|
+
.mfui-content-area_background-color_spbSky2 {
|
|
30
|
+
background-color: var(--spbSky2);
|
|
31
|
+
}
|
|
32
|
+
.mfui-content-area__inner {
|
|
33
|
+
-webkit-box-sizing: content-box;
|
|
34
|
+
box-sizing: content-box;
|
|
35
|
+
max-width: 1440px;
|
|
36
|
+
margin: 0 auto;
|
|
37
|
+
padding-right: 80px;
|
|
38
|
+
padding-left: 80px;
|
|
39
|
+
}
|
|
40
|
+
@media screen and (max-width: 767px) {
|
|
41
|
+
.mfui-content-area__inner {
|
|
42
|
+
padding-right: 16px;
|
|
43
|
+
padding-left: 16px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
|
47
|
+
.mfui-content-area__inner {
|
|
48
|
+
padding-right: 48px;
|
|
49
|
+
padding-left: 48px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
|
53
|
+
.mfui-content-area__inner {
|
|
54
|
+
padding-right: 64px;
|
|
55
|
+
padding-left: 64px;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
@media screen and (max-width: 767px) {
|
|
59
|
+
.mfui-content-area__inner_disable-indents_mobile {
|
|
60
|
+
padding-right: 0;
|
|
61
|
+
padding-left: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
@media screen and (max-width: 1023px) {
|
|
65
|
+
.mfui-content-area__inner_disable-indents_mobile-tablet {
|
|
66
|
+
padding-right: 0;
|
|
67
|
+
padding-left: 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
@media screen and (min-width: 768px) {
|
|
71
|
+
.mfui-content-area__inner_disable-indents_tablet-desktop {
|
|
72
|
+
padding-right: 0;
|
|
73
|
+
padding-left: 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
.mfui-content-area__inner_disable-indents_all {
|
|
77
|
+
padding-right: 0;
|
|
78
|
+
padding-left: 0;
|
|
79
|
+
}
|
|
80
|
+
@media screen and (max-width: 359px) {
|
|
81
|
+
.mfui-content-area__inner_indents_small-mobile {
|
|
82
|
+
padding-right: 8px;
|
|
83
|
+
padding-left: 8px;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
.mfui-content-area__inner_background-color_transparent {
|
|
87
|
+
background-color: transparent;
|
|
88
|
+
}
|
|
89
|
+
.mfui-content-area__inner_background-color_black {
|
|
90
|
+
background-color: var(--stcBlack);
|
|
91
|
+
}
|
|
92
|
+
.mfui-content-area__inner_background-color_white {
|
|
93
|
+
background-color: var(--stcWhite);
|
|
94
|
+
}
|
|
95
|
+
.mfui-content-area__inner_background-color_green {
|
|
96
|
+
background-color: var(--brandGreen);
|
|
97
|
+
}
|
|
98
|
+
.mfui-content-area__inner_background-color_purple {
|
|
99
|
+
background-color: var(--brandPurple);
|
|
100
|
+
}
|
|
101
|
+
.mfui-content-area__inner_background-color_spbSky0 {
|
|
102
|
+
background-color: var(--spbSky0);
|
|
103
|
+
}
|
|
104
|
+
.mfui-content-area__inner_background-color_spbSky1 {
|
|
105
|
+
background-color: var(--spbSky1);
|
|
106
|
+
}
|
|
107
|
+
.mfui-content-area__inner_background-color_spbSky2 {
|
|
108
|
+
background-color: var(--spbSky2);
|
|
109
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import './ContentArea.
|
|
2
|
+
import './ContentArea.less';
|
|
3
3
|
declare const BACKGROUND_COLORS: {
|
|
4
4
|
readonly TRANSPARENT: "transparent";
|
|
5
5
|
readonly BLACK: "black";
|
|
@@ -10,7 +10,7 @@ declare const BACKGROUND_COLORS: {
|
|
|
10
10
|
readonly SPB_SKY_1: "spbSky1";
|
|
11
11
|
readonly SPB_SKY_2: "spbSky2";
|
|
12
12
|
};
|
|
13
|
-
export type BackgroundColorType =
|
|
13
|
+
export declare type BackgroundColorType = typeof BACKGROUND_COLORS[keyof typeof BACKGROUND_COLORS];
|
|
14
14
|
declare const DisableIndents: {
|
|
15
15
|
readonly MOBILE: "mobile";
|
|
16
16
|
readonly MOBILE_TABLET: "mobile-tablet";
|
|
@@ -20,8 +20,8 @@ declare const DisableIndents: {
|
|
|
20
20
|
declare const Indents: {
|
|
21
21
|
readonly SMALL_MOBILE: "small-mobile";
|
|
22
22
|
};
|
|
23
|
-
type DisableIndentsType =
|
|
24
|
-
type IndentsType =
|
|
23
|
+
declare type DisableIndentsType = typeof DisableIndents[keyof typeof DisableIndents];
|
|
24
|
+
declare type IndentsType = typeof Indents[keyof typeof Indents];
|
|
25
25
|
export interface IConrentAreaProps {
|
|
26
26
|
/** Фоновый цвет внешнего контейнера */
|
|
27
27
|
outerBackgroundColor?: BackgroundColorType;
|
|
@@ -43,7 +43,6 @@ export interface IConrentAreaProps {
|
|
|
43
43
|
root?: Record<string, string>;
|
|
44
44
|
inner?: Record<string, string>;
|
|
45
45
|
};
|
|
46
|
-
children: React.ReactNode;
|
|
47
46
|
}
|
|
48
47
|
declare const ContentArea: React.FC<IConrentAreaProps>;
|
|
49
48
|
export default ContentArea;
|