@megafon/ui-core 2.5.0 → 3.0.0-beta.11
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 +156 -9
- package/dist/es/colors/ColorItem/ColorItem.css +1 -8
- package/dist/es/colors/ColorItem/ColorItem.js +1 -1
- package/dist/es/colors/Colors.css +3 -11
- package/dist/es/colors/Colors.d.ts +2 -2
- package/dist/es/colors/Colors.js +64 -4
- package/dist/es/colors/colorsData.js +78 -71
- package/dist/es/components/Accordion/Accordion.css +7 -27
- package/dist/es/components/Accordion/Accordion.d.ts +12 -7
- package/dist/es/components/Accordion/Accordion.js +25 -20
- package/dist/es/components/Banner/Banner.css +2 -37
- package/dist/es/components/Banner/Banner.d.ts +10 -2
- package/dist/es/components/Banner/Banner.js +35 -26
- package/dist/es/components/Banner/BannerDot.css +4 -11
- package/dist/es/components/Banner/BannerDot.d.ts +3 -0
- package/dist/es/components/Banner/BannerDot.js +8 -3
- package/dist/es/components/Button/Button.css +83 -74
- package/dist/es/components/Button/Button.d.ts +8 -2
- package/dist/es/components/Button/Button.js +16 -8
- package/dist/es/components/Calendar/Calendar.css +0 -7
- package/dist/es/components/Calendar/Calendar.js +2 -3
- package/dist/es/components/Calendar/components/Day/Day.css +10 -17
- package/dist/es/components/Calendar/components/Day/Day.js +1 -1
- package/dist/es/components/Calendar/components/Month/Month.css +3 -10
- package/dist/es/components/Calendar/components/Month/Month.js +21 -5
- package/dist/es/components/Carousel/Carousel.css +4 -11
- package/dist/es/components/Carousel/Carousel.d.ts +9 -2
- package/dist/es/components/Carousel/Carousel.js +28 -25
- package/dist/es/components/Checkbox/Checkbox.css +18 -25
- package/dist/es/components/Checkbox/Checkbox.d.ts +11 -27
- package/dist/es/components/Checkbox/Checkbox.js +77 -90
- package/dist/es/components/Collapse/Collapse.d.ts +15 -3
- package/dist/es/components/Collapse/Collapse.js +11 -4
- package/dist/es/components/ContentArea/ContentArea.css +18 -28
- package/dist/es/components/ContentArea/ContentArea.d.ts +2 -7
- package/dist/es/components/ContentArea/ContentArea.js +5 -39
- package/dist/es/components/Counter/Counter.css +14 -11
- package/dist/es/components/Counter/Counter.js +3 -3
- package/dist/es/components/Grid/GridColumn.css +0 -7
- package/dist/es/components/Header/Header.css +8 -12
- package/dist/es/components/Header/Header.d.ts +7 -21
- package/dist/es/components/Header/Header.js +31 -67
- package/dist/es/components/InputLabel/InputLabel.css +0 -7
- package/dist/es/components/InputLabel/InputLabel.d.ts +3 -0
- package/dist/es/components/InputLabel/InputLabel.js +9 -4
- package/dist/es/components/Link/Link.d.ts +3 -3
- package/dist/es/components/Link/Link.js +32 -21
- package/dist/es/components/List/List.css +9 -13
- package/dist/es/components/List/List.d.ts +1 -1
- package/dist/es/components/List/List.js +2 -2
- package/dist/es/components/List/ListItem.css +0 -7
- package/dist/es/components/Logo/Logo.css +0 -7
- package/dist/es/components/Logo/Logo.js +4 -8
- package/dist/es/components/NavArrow/NavArrow.css +5 -12
- package/dist/es/components/Notification/Notification.css +41 -24
- package/dist/es/components/Notification/Notification.d.ts +8 -0
- package/dist/es/components/Notification/Notification.js +21 -4
- package/dist/es/components/Pagination/Pagination.css +0 -7
- package/dist/es/components/Pagination/Pagination.d.ts +9 -2
- package/dist/es/components/Pagination/Pagination.js +20 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +12 -7
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +10 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
- package/dist/es/components/Pagination/helpers.d.ts +1 -1
- package/dist/es/components/Paragraph/Paragraph.css +10 -31
- package/dist/es/components/Paragraph/Paragraph.d.ts +9 -13
- package/dist/es/components/Paragraph/Paragraph.js +14 -40
- package/dist/es/components/Preloader/Preloader.css +5 -12
- package/dist/es/components/Preloader/Preloader.d.ts +4 -0
- package/dist/es/components/Preloader/Preloader.js +10 -5
- package/dist/es/components/RadioButton/RadioButton.css +7 -14
- package/dist/es/components/RadioButton/RadioButton.d.ts +8 -28
- package/dist/es/components/RadioButton/RadioButton.js +50 -85
- package/dist/es/components/Search/Search.css +20 -25
- package/dist/es/components/Search/Search.js +3 -4
- package/dist/es/components/Select/Select.css +34 -37
- package/dist/es/components/Select/Select.d.ts +43 -50
- package/dist/es/components/Select/Select.js +382 -461
- package/dist/es/components/Select/reducer/selectReducer.d.ts +34 -0
- package/dist/es/components/Select/reducer/selectReducer.js +123 -0
- package/dist/es/components/Switcher/Switcher.css +19 -25
- package/dist/es/components/Switcher/Switcher.js +1 -1
- package/dist/es/components/Tabs/Tab.d.ts +5 -2
- package/dist/es/components/Tabs/Tab.js +4 -2
- package/dist/es/components/Tabs/Tabs.css +30 -37
- package/dist/es/components/Tabs/Tabs.d.ts +8 -2
- package/dist/es/components/Tabs/Tabs.js +68 -105
- package/dist/es/components/TextField/TextField.css +27 -33
- package/dist/es/components/TextField/TextField.d.ts +9 -3
- package/dist/es/components/TextField/TextField.js +32 -24
- package/dist/es/components/TextLink/TextLink.css +10 -14
- package/dist/es/components/TextLink/TextLink.d.ts +1 -1
- package/dist/es/components/TextLink/TextLink.js +7 -2
- package/dist/es/components/Tile/Tile.css +2 -8
- package/dist/es/components/Tile/Tile.d.ts +5 -2
- package/dist/es/components/Tile/Tile.js +2 -2
- package/dist/es/components/Tooltip/Tooltip.css +1 -8
- package/dist/es/components/Tooltip/Tooltip.d.ts +8 -2
- package/dist/es/components/Tooltip/Tooltip.js +28 -27
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +1 -0
- package/dist/lib/colors/ColorItem/ColorItem.css +1 -8
- package/dist/lib/colors/ColorItem/ColorItem.js +1 -1
- package/dist/lib/colors/Colors.css +3 -11
- package/dist/lib/colors/Colors.d.ts +2 -2
- package/dist/lib/colors/Colors.js +63 -4
- package/dist/lib/colors/colorsData.js +78 -71
- package/dist/lib/components/Accordion/Accordion.css +7 -27
- package/dist/lib/components/Accordion/Accordion.d.ts +12 -7
- package/dist/lib/components/Accordion/Accordion.js +24 -19
- package/dist/lib/components/Banner/Banner.css +2 -37
- package/dist/lib/components/Banner/Banner.d.ts +10 -2
- package/dist/lib/components/Banner/Banner.js +35 -25
- package/dist/lib/components/Banner/BannerDot.css +4 -11
- package/dist/lib/components/Banner/BannerDot.d.ts +3 -0
- package/dist/lib/components/Banner/BannerDot.js +10 -2
- package/dist/lib/components/Button/Button.css +83 -74
- package/dist/lib/components/Button/Button.d.ts +8 -2
- package/dist/lib/components/Button/Button.js +16 -8
- package/dist/lib/components/Calendar/Calendar.css +0 -7
- package/dist/lib/components/Calendar/Calendar.js +3 -3
- package/dist/lib/components/Calendar/components/Day/Day.css +10 -17
- package/dist/lib/components/Calendar/components/Day/Day.js +1 -1
- package/dist/lib/components/Calendar/components/Month/Month.css +3 -10
- package/dist/lib/components/Calendar/components/Month/Month.js +20 -4
- package/dist/lib/components/Carousel/Carousel.css +4 -11
- package/dist/lib/components/Carousel/Carousel.d.ts +9 -2
- package/dist/lib/components/Carousel/Carousel.js +26 -23
- package/dist/lib/components/Checkbox/Checkbox.css +18 -25
- package/dist/lib/components/Checkbox/Checkbox.d.ts +11 -27
- package/dist/lib/components/Checkbox/Checkbox.js +82 -125
- package/dist/lib/components/Collapse/Collapse.d.ts +15 -3
- package/dist/lib/components/Collapse/Collapse.js +13 -4
- package/dist/lib/components/ContentArea/ContentArea.css +18 -28
- package/dist/lib/components/ContentArea/ContentArea.d.ts +2 -7
- package/dist/lib/components/ContentArea/ContentArea.js +5 -42
- package/dist/lib/components/Counter/Counter.css +14 -11
- package/dist/lib/components/Counter/Counter.js +3 -3
- package/dist/lib/components/Grid/GridColumn.css +0 -7
- package/dist/lib/components/Header/Header.css +8 -12
- package/dist/lib/components/Header/Header.d.ts +7 -21
- package/dist/lib/components/Header/Header.js +31 -98
- package/dist/lib/components/InputLabel/InputLabel.css +0 -7
- package/dist/lib/components/InputLabel/InputLabel.d.ts +3 -0
- package/dist/lib/components/InputLabel/InputLabel.js +11 -3
- package/dist/lib/components/Link/Link.d.ts +3 -3
- package/dist/lib/components/Link/Link.js +44 -26
- package/dist/lib/components/List/List.css +9 -13
- package/dist/lib/components/List/List.d.ts +1 -1
- package/dist/lib/components/List/List.js +2 -2
- package/dist/lib/components/List/ListItem.css +0 -7
- package/dist/lib/components/Logo/Logo.css +0 -7
- package/dist/lib/components/Logo/Logo.js +4 -8
- package/dist/lib/components/NavArrow/NavArrow.css +5 -12
- package/dist/lib/components/Notification/Notification.css +41 -24
- package/dist/lib/components/Notification/Notification.d.ts +8 -0
- package/dist/lib/components/Notification/Notification.js +20 -3
- package/dist/lib/components/Pagination/Pagination.css +0 -7
- package/dist/lib/components/Pagination/Pagination.d.ts +9 -2
- package/dist/lib/components/Pagination/Pagination.js +20 -2
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +12 -6
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +9 -1
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
- package/dist/lib/components/Pagination/helpers.d.ts +1 -1
- package/dist/lib/components/Paragraph/Paragraph.css +10 -31
- package/dist/lib/components/Paragraph/Paragraph.d.ts +9 -13
- package/dist/lib/components/Paragraph/Paragraph.js +15 -41
- package/dist/lib/components/Preloader/Preloader.css +5 -12
- package/dist/lib/components/Preloader/Preloader.d.ts +4 -0
- package/dist/lib/components/Preloader/Preloader.js +10 -4
- package/dist/lib/components/RadioButton/RadioButton.css +7 -14
- package/dist/lib/components/RadioButton/RadioButton.d.ts +8 -28
- package/dist/lib/components/RadioButton/RadioButton.js +51 -117
- package/dist/lib/components/Search/Search.css +20 -25
- package/dist/lib/components/Search/Search.js +3 -4
- package/dist/lib/components/Select/Select.css +34 -37
- package/dist/lib/components/Select/Select.d.ts +43 -50
- package/dist/lib/components/Select/Select.js +375 -483
- package/dist/lib/components/Select/reducer/selectReducer.d.ts +34 -0
- package/dist/lib/components/Select/reducer/selectReducer.js +136 -0
- package/dist/lib/components/Switcher/Switcher.css +19 -25
- package/dist/lib/components/Switcher/Switcher.js +1 -1
- package/dist/lib/components/Tabs/Tab.d.ts +5 -2
- package/dist/lib/components/Tabs/Tab.js +4 -2
- package/dist/lib/components/Tabs/Tabs.css +30 -37
- package/dist/lib/components/Tabs/Tabs.d.ts +8 -2
- package/dist/lib/components/Tabs/Tabs.js +68 -105
- package/dist/lib/components/TextField/TextField.css +27 -33
- package/dist/lib/components/TextField/TextField.d.ts +9 -3
- package/dist/lib/components/TextField/TextField.js +30 -23
- package/dist/lib/components/TextLink/TextLink.css +10 -14
- package/dist/lib/components/TextLink/TextLink.d.ts +1 -1
- package/dist/lib/components/TextLink/TextLink.js +7 -2
- package/dist/lib/components/Tile/Tile.css +2 -8
- package/dist/lib/components/Tile/Tile.d.ts +5 -2
- package/dist/lib/components/Tile/Tile.js +2 -2
- package/dist/lib/components/Tooltip/Tooltip.css +1 -8
- package/dist/lib/components/Tooltip/Tooltip.d.ts +8 -2
- package/dist/lib/components/Tooltip/Tooltip.js +27 -26
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +8 -0
- package/package.json +5 -4
- package/styles/base.less +2 -73
- package/styles/colors.css +60 -0
- package/styles/colorsDark.css +62 -0
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-day {
|
|
9
2
|
position: relative;
|
|
10
3
|
-webkit-box-sizing: content-box;
|
|
@@ -13,7 +6,7 @@ h5 {
|
|
|
13
6
|
height: 32px;
|
|
14
7
|
padding: 0 10px 8px 0;
|
|
15
8
|
border: none;
|
|
16
|
-
color:
|
|
9
|
+
color: var(--content);
|
|
17
10
|
line-height: 24px;
|
|
18
11
|
text-decoration: none;
|
|
19
12
|
background-color: rgba(0, 0, 0, 0);
|
|
@@ -44,16 +37,16 @@ h5 {
|
|
|
44
37
|
width: 32px;
|
|
45
38
|
height: 32px;
|
|
46
39
|
border-radius: 50% !important;
|
|
47
|
-
color:
|
|
48
|
-
background-color:
|
|
40
|
+
color: var(--content);
|
|
41
|
+
background-color: var(--spbSky0);
|
|
49
42
|
}
|
|
50
43
|
.mfui-day:not(:disabled):not(.mfui-day_active):hover:after {
|
|
51
|
-
color:
|
|
52
|
-
background-color:
|
|
44
|
+
color: var(--content);
|
|
45
|
+
background-color: var(--spbSky0);
|
|
53
46
|
}
|
|
54
47
|
.mfui-day:not(:disabled):not(.mfui-day_active):focus:after,
|
|
55
48
|
.mfui-day_active:after {
|
|
56
|
-
background-color:
|
|
49
|
+
background-color: var(--brandGreen);
|
|
57
50
|
}
|
|
58
51
|
.mfui-day_disabled {
|
|
59
52
|
cursor: default;
|
|
@@ -62,7 +55,7 @@ h5 {
|
|
|
62
55
|
}
|
|
63
56
|
.mfui-day_active,
|
|
64
57
|
.mfui-day:not(:disabled):not(.mfui-day_active):focus {
|
|
65
|
-
color:
|
|
58
|
+
color: var(--stcWhite);
|
|
66
59
|
}
|
|
67
60
|
.mfui-day_active + .mfui-day_active:before,
|
|
68
61
|
.mfui-day_between:hover + .mfui-day:not(.mfui-day_monday).mfui-day_active:before {
|
|
@@ -74,7 +67,7 @@ h5 {
|
|
|
74
67
|
display: block;
|
|
75
68
|
width: 32px;
|
|
76
69
|
height: 32px;
|
|
77
|
-
background-color:
|
|
70
|
+
background-color: var(--spbSky1);
|
|
78
71
|
}
|
|
79
72
|
.mfui-day_between {
|
|
80
73
|
position: relative;
|
|
@@ -89,7 +82,7 @@ h5 {
|
|
|
89
82
|
display: block;
|
|
90
83
|
height: 32px;
|
|
91
84
|
padding: 0 20px;
|
|
92
|
-
background-color:
|
|
85
|
+
background-color: var(--spbSky1);
|
|
93
86
|
}
|
|
94
87
|
.mfui-day_between:after {
|
|
95
88
|
content: '';
|
|
@@ -100,7 +93,7 @@ h5 {
|
|
|
100
93
|
display: block;
|
|
101
94
|
width: 40px;
|
|
102
95
|
height: 32px;
|
|
103
|
-
background-color:
|
|
96
|
+
background-color: var(--spbSky1);
|
|
104
97
|
}
|
|
105
98
|
.mfui-day_sunday,
|
|
106
99
|
.mfui-day_last {
|
|
@@ -79,7 +79,7 @@ var Day = function Day(_a) {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
var handleMouseLeave = function handleMouseLeave() {
|
|
82
|
-
onMouseLeave
|
|
82
|
+
onMouseLeave && onMouseLeave();
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
return /*#__PURE__*/_react["default"].createElement("button", {
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-month {
|
|
9
2
|
position: relative;
|
|
10
3
|
z-index: 1;
|
|
@@ -42,7 +35,7 @@ h5 {
|
|
|
42
35
|
-moz-user-select: none;
|
|
43
36
|
-ms-user-select: none;
|
|
44
37
|
user-select: none;
|
|
45
|
-
fill:
|
|
38
|
+
fill: var(--content);
|
|
46
39
|
}
|
|
47
40
|
.mfui-month__title {
|
|
48
41
|
font-size: 15px;
|
|
@@ -56,7 +49,7 @@ h5 {
|
|
|
56
49
|
grid-template-columns: repeat(7, 1fr);
|
|
57
50
|
width: 272px;
|
|
58
51
|
padding-bottom: 13px;
|
|
59
|
-
border-bottom: 1px solid
|
|
52
|
+
border-bottom: 1px solid var(--spbSky1);
|
|
60
53
|
-webkit-column-gap: 22px;
|
|
61
54
|
-moz-column-gap: 22px;
|
|
62
55
|
column-gap: 22px;
|
|
@@ -66,7 +59,7 @@ h5 {
|
|
|
66
59
|
line-height: 16px;
|
|
67
60
|
width: 20px;
|
|
68
61
|
height: 16px;
|
|
69
|
-
color:
|
|
62
|
+
color: var(--content);
|
|
70
63
|
font-weight: 600;
|
|
71
64
|
line-height: 24px;
|
|
72
65
|
text-align: center;
|
|
@@ -51,12 +51,22 @@ var Month = function Month(_ref) {
|
|
|
51
51
|
goToNextMonth = _ref.goToNextMonth,
|
|
52
52
|
children = _ref.children;
|
|
53
53
|
|
|
54
|
-
var handleArrowLeftClick = function handleArrowLeftClick() {
|
|
55
|
-
|
|
54
|
+
var handleArrowLeftClick = function handleArrowLeftClick(e) {
|
|
55
|
+
if ((0, _uiHelpers.checkEventIsClickOrEnterPress)(e)) {
|
|
56
|
+
!isPrevMonthDisabled && goToPreviousMonth();
|
|
57
|
+
}
|
|
56
58
|
};
|
|
57
59
|
|
|
58
|
-
var handleArrowRightClick = function handleArrowRightClick() {
|
|
59
|
-
|
|
60
|
+
var handleArrowRightClick = function handleArrowRightClick(e) {
|
|
61
|
+
if ((0, _uiHelpers.checkEventIsClickOrEnterPress)(e)) {
|
|
62
|
+
!isNextMonthDisabled && goToNextMonth();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var getTabIndex = function getTabIndex(hasFocus) {
|
|
67
|
+
var tabIndexWithFocus = 0;
|
|
68
|
+
var tabIndexWithoutFocus = -1;
|
|
69
|
+
return hasFocus ? tabIndexWithFocus : tabIndexWithoutFocus;
|
|
60
70
|
};
|
|
61
71
|
|
|
62
72
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -64,16 +74,22 @@ var Month = function Month(_ref) {
|
|
|
64
74
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
65
75
|
className: cn('header')
|
|
66
76
|
}, /*#__PURE__*/_react["default"].createElement(ArrowLeft, {
|
|
77
|
+
role: "button",
|
|
78
|
+
tabIndex: getTabIndex(!isPrevMonthDisabled),
|
|
67
79
|
className: cn('arrow', {
|
|
68
80
|
disabled: isPrevMonthDisabled
|
|
69
81
|
}),
|
|
82
|
+
onKeyDown: handleArrowLeftClick,
|
|
70
83
|
onClick: handleArrowLeftClick
|
|
71
84
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
72
85
|
className: cn('title')
|
|
73
86
|
}, "".concat(monthLabel, " ").concat(year)), /*#__PURE__*/_react["default"].createElement(ArrowRight, {
|
|
87
|
+
role: "button",
|
|
88
|
+
tabIndex: getTabIndex(!isNextMonthDisabled),
|
|
74
89
|
className: cn('arrow', {
|
|
75
90
|
disabled: isNextMonthDisabled
|
|
76
91
|
}),
|
|
92
|
+
onKeyDown: handleArrowRightClick,
|
|
77
93
|
onClick: handleArrowRightClick
|
|
78
94
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
79
95
|
className: cn('weekday-labels')
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-carousel {
|
|
9
2
|
position: relative;
|
|
10
3
|
display: -webkit-box;
|
|
@@ -158,10 +151,10 @@ h5 {
|
|
|
158
151
|
margin-right: 8px;
|
|
159
152
|
}
|
|
160
153
|
.mfui-carousel_nav-theme_green .swiper-pagination-bullet:before {
|
|
161
|
-
background-color:
|
|
154
|
+
background-color: var(--stcWhite50);
|
|
162
155
|
}
|
|
163
156
|
.mfui-carousel_nav-theme_light .swiper-pagination-bullet:before {
|
|
164
|
-
background-color:
|
|
157
|
+
background-color: var(--spbSky2);
|
|
165
158
|
}
|
|
166
159
|
.mfui-carousel .swiper-pagination-bullet-active {
|
|
167
160
|
padding: 0;
|
|
@@ -172,12 +165,12 @@ h5 {
|
|
|
172
165
|
cursor: default;
|
|
173
166
|
}
|
|
174
167
|
.mfui-carousel_nav-theme_green .swiper-pagination-bullet-active:before {
|
|
175
|
-
background-color:
|
|
168
|
+
background-color: var(--base);
|
|
176
169
|
}
|
|
177
170
|
.mfui-carousel_nav-theme_light .swiper-pagination-bullet-active {
|
|
178
171
|
padding: 0;
|
|
179
172
|
cursor: default;
|
|
180
173
|
}
|
|
181
174
|
.mfui-carousel_nav-theme_light .swiper-pagination-bullet-active:before {
|
|
182
|
-
background-color:
|
|
175
|
+
background-color: var(--brandPurple);
|
|
183
176
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { IFilterDataAttrs } from '@megafon/ui-helpers';
|
|
3
2
|
import SwiperCore from 'swiper';
|
|
4
3
|
import { PaginationOptions } from 'swiper/types/components/pagination';
|
|
5
4
|
import './Carousel.less';
|
|
@@ -24,7 +23,7 @@ export declare type SlidesSettingsType = {
|
|
|
24
23
|
spaceBetween: number;
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
|
-
export interface ICarouselProps
|
|
26
|
+
export interface ICarouselProps {
|
|
28
27
|
/** Ссылка на корневой элемент */
|
|
29
28
|
rootRef?: React.Ref<HTMLDivElement>;
|
|
30
29
|
/** Дополнительные классы для корневого элемента */
|
|
@@ -39,6 +38,14 @@ export interface ICarouselProps extends IFilterDataAttrs {
|
|
|
39
38
|
next?: string;
|
|
40
39
|
slide?: string;
|
|
41
40
|
};
|
|
41
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
42
|
+
dataAttrs?: {
|
|
43
|
+
root?: Record<string, string>;
|
|
44
|
+
slider?: Record<string, string>;
|
|
45
|
+
prev?: Record<string, string>;
|
|
46
|
+
next?: Record<string, string>;
|
|
47
|
+
slide?: Record<string, string>;
|
|
48
|
+
};
|
|
42
49
|
/** Настройки слайдов */
|
|
43
50
|
slidesSettings?: SlidesSettingsType;
|
|
44
51
|
/** Смена слайдов с зацикливанием */
|
|
@@ -154,8 +154,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
autoplay.stop();
|
|
158
|
-
|
|
157
|
+
autoplay.stop();
|
|
159
158
|
params.autoplay.delay = autoPlayDelay * 3;
|
|
160
159
|
autoplay.start();
|
|
161
160
|
}, [autoPlayDelay]);
|
|
@@ -165,7 +164,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
swiperInstance.slidePrev();
|
|
168
|
-
onPrevClick
|
|
167
|
+
onPrevClick && onPrevClick(swiperInstance.realIndex);
|
|
169
168
|
increaseAutoplayDelay(swiperInstance);
|
|
170
169
|
}, [swiperInstance, onPrevClick, increaseAutoplayDelay]);
|
|
171
170
|
var handleNextClick = React.useCallback(function () {
|
|
@@ -174,14 +173,14 @@ var Carousel = function Carousel(_ref) {
|
|
|
174
173
|
}
|
|
175
174
|
|
|
176
175
|
swiperInstance.slideNext();
|
|
177
|
-
onNextClick
|
|
176
|
+
onNextClick && onNextClick(swiperInstance.realIndex);
|
|
178
177
|
increaseAutoplayDelay(swiperInstance);
|
|
179
178
|
}, [swiperInstance, onNextClick, increaseAutoplayDelay]);
|
|
180
179
|
var handleSwiper = React.useCallback(function (swiper) {
|
|
181
180
|
setSwiperInstance(swiper);
|
|
182
181
|
setLocked(swiper.isBeginning && swiper.isEnd);
|
|
183
|
-
getSwiper
|
|
184
|
-
}, [
|
|
182
|
+
getSwiper && getSwiper(swiper);
|
|
183
|
+
}, []);
|
|
185
184
|
var handleReachBeginnig = React.useCallback(function () {
|
|
186
185
|
setBeginning(true);
|
|
187
186
|
}, []);
|
|
@@ -202,7 +201,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
202
201
|
var realIndex = _ref4.realIndex,
|
|
203
202
|
previousIndex = _ref4.previousIndex,
|
|
204
203
|
params = _ref4.params;
|
|
205
|
-
onChange
|
|
204
|
+
onChange && onChange(realIndex, previousIndex, params.slidesPerView);
|
|
206
205
|
}, [onChange]);
|
|
207
206
|
|
|
208
207
|
var handleRootClick = function handleRootClick(e) {
|
|
@@ -215,15 +214,13 @@ var Carousel = function Carousel(_ref) {
|
|
|
215
214
|
}; // https://github.com/nolimits4web/Swiper/issues/2346
|
|
216
215
|
|
|
217
216
|
|
|
218
|
-
var handleSwiperResize = React.useCallback(function () {
|
|
219
|
-
(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
setLocked(swiper.isBeginning && swiper.isEnd);
|
|
217
|
+
var handleSwiperResize = React.useCallback((0, _lodash["default"])(function (swiper) {
|
|
218
|
+
setBeginning(swiper.isBeginning);
|
|
219
|
+
setEnd(swiper.isEnd);
|
|
220
|
+
setLocked(swiper.isBeginning && swiper.isEnd);
|
|
223
221
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}, []);
|
|
222
|
+
if (swiper.params.slidesPerView === SlidesPerView.AUTO) {}
|
|
223
|
+
}, _throttleTime["default"].resize), []);
|
|
227
224
|
|
|
228
225
|
var handleSlideFocus = function handleSlideFocus(index) {
|
|
229
226
|
return function (e) {
|
|
@@ -248,7 +245,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
248
245
|
e.nativeEvent.preventDefault();
|
|
249
246
|
};
|
|
250
247
|
|
|
251
|
-
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs), {
|
|
248
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
252
249
|
ref: rootRef,
|
|
253
250
|
className: cn({
|
|
254
251
|
'nav-theme': navTheme
|
|
@@ -256,7 +253,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
256
253
|
onClick: handleRootClick
|
|
257
254
|
}), /*#__PURE__*/React.createElement(_react2.Swiper, (0, _extends2["default"])({}, containerModifier ? {
|
|
258
255
|
containerModifierClass: containerModifier
|
|
259
|
-
} : {}, {
|
|
256
|
+
} : {}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.slider), {
|
|
260
257
|
className: cn('swiper', {
|
|
261
258
|
'default-inner-indents': !innerIndentsClass
|
|
262
259
|
}, [innerIndentsClass, containerClass]),
|
|
@@ -286,13 +283,13 @@ var Carousel = function Carousel(_ref) {
|
|
|
286
283
|
onTouchEnd: increaseAutoplayDelay,
|
|
287
284
|
onResize: handleSwiperResize
|
|
288
285
|
}), React.Children.map(children, function (child, i) {
|
|
289
|
-
return /*#__PURE__*/React.createElement(_react2.SwiperSlide, {
|
|
286
|
+
return /*#__PURE__*/React.createElement(_react2.SwiperSlide, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.slide, i + 1), {
|
|
290
287
|
key: i,
|
|
291
288
|
className: cn('slide', slideClass),
|
|
292
289
|
onFocus: handleSlideFocus(i),
|
|
293
290
|
onMouseDown: disableFocusOnSlideClick
|
|
294
|
-
}, child);
|
|
295
|
-
})), /*#__PURE__*/React.createElement(_NavArrow["default"], {
|
|
291
|
+
}), child);
|
|
292
|
+
})), /*#__PURE__*/React.createElement(_NavArrow["default"], (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.prev), {
|
|
296
293
|
className: cn('arrow', {
|
|
297
294
|
prev: true,
|
|
298
295
|
locked: isLocked
|
|
@@ -300,7 +297,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
300
297
|
onClick: handlePrevClick,
|
|
301
298
|
disabled: !loop && isBeginning,
|
|
302
299
|
theme: _NavArrow.Theme.PURPLE
|
|
303
|
-
}), /*#__PURE__*/React.createElement(_NavArrow["default"], {
|
|
300
|
+
})), /*#__PURE__*/React.createElement(_NavArrow["default"], (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.next), {
|
|
304
301
|
className: cn('arrow', {
|
|
305
302
|
next: true,
|
|
306
303
|
locked: isLocked
|
|
@@ -309,7 +306,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
309
306
|
onClick: handleNextClick,
|
|
310
307
|
disabled: !loop && isEnd,
|
|
311
308
|
theme: _NavArrow.Theme.PURPLE
|
|
312
|
-
}));
|
|
309
|
+
})));
|
|
313
310
|
};
|
|
314
311
|
|
|
315
312
|
Carousel.propTypes = {
|
|
@@ -326,7 +323,13 @@ Carousel.propTypes = {
|
|
|
326
323
|
next: PropTypes.string,
|
|
327
324
|
slide: PropTypes.string
|
|
328
325
|
}),
|
|
329
|
-
dataAttrs: PropTypes.
|
|
326
|
+
dataAttrs: PropTypes.shape({
|
|
327
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
328
|
+
slider: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
329
|
+
prev: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
330
|
+
next: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
331
|
+
slide: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
332
|
+
}),
|
|
330
333
|
slidesSettings: PropTypes.objectOf((0, _checkBreakpointsPropTypes["default"])({
|
|
331
334
|
slidesPerView: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(Object.values(SlidesPerView))]).isRequired,
|
|
332
335
|
spaceBetween: PropTypes.number.isRequired,
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-checkbox {
|
|
9
2
|
margin: 0 5px 12px 5px;
|
|
10
3
|
}
|
|
@@ -89,32 +82,32 @@ h5 {
|
|
|
89
82
|
top: 0;
|
|
90
83
|
}
|
|
91
84
|
.mfui-checkbox_color_dark .mfui-checkbox__custom-input {
|
|
92
|
-
border-color:
|
|
85
|
+
border-color: var(--spbSky2);
|
|
93
86
|
}
|
|
94
87
|
.mfui-checkbox_color_dark .mfui-checkbox__label_no-touch:hover .mfui-checkbox__custom-input {
|
|
95
|
-
border-color:
|
|
88
|
+
border-color: var(--buttonHoverGreen);
|
|
96
89
|
}
|
|
97
90
|
.mfui-checkbox_color_dark .mfui-checkbox__label:active .mfui-checkbox__custom-input {
|
|
98
|
-
border-color:
|
|
99
|
-
background-color:
|
|
91
|
+
border-color: var(--buttonDown) !important;
|
|
92
|
+
background-color: var(--buttonDown);
|
|
100
93
|
}
|
|
101
94
|
.mfui-checkbox_color_dark .mfui-checkbox__icon {
|
|
102
|
-
fill:
|
|
95
|
+
fill: var(--stcWhite);
|
|
103
96
|
}
|
|
104
97
|
.mfui-checkbox_color_dark.mfui-checkbox_checked .mfui-checkbox__custom-input {
|
|
105
|
-
border-color:
|
|
106
|
-
color:
|
|
107
|
-
background-color:
|
|
98
|
+
border-color: var(--brandGreen);
|
|
99
|
+
color: var(--stcWhite);
|
|
100
|
+
background-color: var(--brandGreen);
|
|
108
101
|
}
|
|
109
102
|
.mfui-checkbox_color_dark.mfui-checkbox_checked .mfui-checkbox__label_no-touch:hover .mfui-checkbox__custom-input {
|
|
110
|
-
background-color:
|
|
103
|
+
background-color: var(--buttonHoverGreen);
|
|
111
104
|
}
|
|
112
105
|
.mfui-checkbox_color_dark.mfui-checkbox_checked .mfui-checkbox__label:active .mfui-checkbox__custom-input {
|
|
113
|
-
background-color:
|
|
106
|
+
background-color: var(--buttonDown) !important;
|
|
114
107
|
}
|
|
115
108
|
.mfui-checkbox_color_dark.mfui-checkbox_checked.mfui-checkbox_disabled .mfui-checkbox__custom-input,
|
|
116
109
|
.mfui-checkbox_color_dark.mfui-checkbox_checked.mfui-checkbox_disabled .mfui-checkbox__label:active .mfui-checkbox__custom-input {
|
|
117
|
-
background-color:
|
|
110
|
+
background-color: var(--spbSky2);
|
|
118
111
|
}
|
|
119
112
|
.mfui-checkbox_color_dark.mfui-checkbox_disabled .mfui-checkbox__label {
|
|
120
113
|
cursor: default;
|
|
@@ -122,17 +115,17 @@ h5 {
|
|
|
122
115
|
}
|
|
123
116
|
.mfui-checkbox_color_dark.mfui-checkbox_disabled .mfui-checkbox__custom-input,
|
|
124
117
|
.mfui-checkbox_color_dark.mfui-checkbox_disabled .mfui-checkbox__label:active .mfui-checkbox__custom-input {
|
|
125
|
-
border-color:
|
|
126
|
-
background-color:
|
|
118
|
+
border-color: var(--spbSky2) !important;
|
|
119
|
+
background-color: var(--spbSky1);
|
|
127
120
|
}
|
|
128
121
|
.mfui-checkbox_color_dark.mfui-checkbox_error .mfui-checkbox__custom-input {
|
|
129
|
-
border-color:
|
|
122
|
+
border-color: var(--fury);
|
|
130
123
|
}
|
|
131
124
|
.mfui-checkbox_color_light {
|
|
132
|
-
color:
|
|
125
|
+
color: var(--stcWhite);
|
|
133
126
|
}
|
|
134
127
|
.mfui-checkbox_color_light .mfui-checkbox__custom-input {
|
|
135
|
-
border-color:
|
|
136
|
-
color:
|
|
137
|
-
background-color:
|
|
128
|
+
border-color: var(--stcWhite);
|
|
129
|
+
color: var(--brandGreen);
|
|
130
|
+
background-color: var(--stcWhite);
|
|
138
131
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IFilterDataAttrs } from '@megafon/ui-helpers';
|
|
3
|
-
import * as PropTypes from 'prop-types';
|
|
1
|
+
import React from 'react';
|
|
4
2
|
import './Checkbox.less';
|
|
5
|
-
export interface ICheckboxProps
|
|
3
|
+
export interface ICheckboxProps {
|
|
6
4
|
/** Цвет чекбокса */
|
|
7
5
|
color?: 'dark' | 'light';
|
|
8
6
|
/** Дополнительный класс корневого элемента */
|
|
@@ -12,6 +10,13 @@ export interface ICheckboxProps extends IFilterDataAttrs {
|
|
|
12
10
|
inner?: string;
|
|
13
11
|
icon?: string;
|
|
14
12
|
};
|
|
13
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
14
|
+
dataAttrs?: {
|
|
15
|
+
root?: Record<string, string>;
|
|
16
|
+
input?: Record<string, string>;
|
|
17
|
+
customInput?: Record<string, string>;
|
|
18
|
+
extraContent?: Record<string, string>;
|
|
19
|
+
};
|
|
15
20
|
/** Размер текста */
|
|
16
21
|
fontSize?: 'regular' | 'small';
|
|
17
22
|
/** Имя компонента в DOM */
|
|
@@ -28,28 +33,7 @@ export interface ICheckboxProps extends IFilterDataAttrs {
|
|
|
28
33
|
extraContent?: JSX.Element[] | Element[] | JSX.Element | Element | string;
|
|
29
34
|
children: JSX.Element[] | Element[] | JSX.Element | Element | string;
|
|
30
35
|
/** Обработчик изменения значения */
|
|
31
|
-
onChange?: (
|
|
32
|
-
}
|
|
33
|
-
declare class Checkbox extends React.Component<ICheckboxProps> {
|
|
34
|
-
static propTypes: {
|
|
35
|
-
className: PropTypes.Requireable<string>;
|
|
36
|
-
fontSize: PropTypes.Requireable<string>;
|
|
37
|
-
color: PropTypes.Requireable<string>;
|
|
38
|
-
name: PropTypes.Requireable<string>;
|
|
39
|
-
value: PropTypes.Requireable<string>;
|
|
40
|
-
checked: PropTypes.Requireable<boolean>;
|
|
41
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
42
|
-
error: PropTypes.Requireable<boolean>;
|
|
43
|
-
children: PropTypes.Requireable<string | PropTypes.ReactElementLike | (PropTypes.ReactElementLike | null | undefined)[]>;
|
|
44
|
-
extraContent: PropTypes.Requireable<string | PropTypes.ReactElementLike | (PropTypes.ReactElementLike | null | undefined)[]>;
|
|
45
|
-
dataAttrs: PropTypes.Requireable<{
|
|
46
|
-
[x: string]: string;
|
|
47
|
-
}>;
|
|
48
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
49
|
-
};
|
|
50
|
-
static defaultProps: Partial<ICheckboxProps>;
|
|
51
|
-
isTouch: boolean;
|
|
52
|
-
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
53
|
-
render(): JSX.Element;
|
|
36
|
+
onChange?: (checked: boolean) => void;
|
|
54
37
|
}
|
|
38
|
+
declare const Checkbox: React.FC<ICheckboxProps>;
|
|
55
39
|
export default Checkbox;
|