@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.
Files changed (213) hide show
  1. package/CHANGELOG.md +156 -9
  2. package/dist/es/colors/ColorItem/ColorItem.css +1 -8
  3. package/dist/es/colors/ColorItem/ColorItem.js +1 -1
  4. package/dist/es/colors/Colors.css +3 -11
  5. package/dist/es/colors/Colors.d.ts +2 -2
  6. package/dist/es/colors/Colors.js +64 -4
  7. package/dist/es/colors/colorsData.js +78 -71
  8. package/dist/es/components/Accordion/Accordion.css +7 -27
  9. package/dist/es/components/Accordion/Accordion.d.ts +12 -7
  10. package/dist/es/components/Accordion/Accordion.js +25 -20
  11. package/dist/es/components/Banner/Banner.css +2 -37
  12. package/dist/es/components/Banner/Banner.d.ts +10 -2
  13. package/dist/es/components/Banner/Banner.js +35 -26
  14. package/dist/es/components/Banner/BannerDot.css +4 -11
  15. package/dist/es/components/Banner/BannerDot.d.ts +3 -0
  16. package/dist/es/components/Banner/BannerDot.js +8 -3
  17. package/dist/es/components/Button/Button.css +83 -74
  18. package/dist/es/components/Button/Button.d.ts +8 -2
  19. package/dist/es/components/Button/Button.js +16 -8
  20. package/dist/es/components/Calendar/Calendar.css +0 -7
  21. package/dist/es/components/Calendar/Calendar.js +2 -3
  22. package/dist/es/components/Calendar/components/Day/Day.css +10 -17
  23. package/dist/es/components/Calendar/components/Day/Day.js +1 -1
  24. package/dist/es/components/Calendar/components/Month/Month.css +3 -10
  25. package/dist/es/components/Calendar/components/Month/Month.js +21 -5
  26. package/dist/es/components/Carousel/Carousel.css +4 -11
  27. package/dist/es/components/Carousel/Carousel.d.ts +9 -2
  28. package/dist/es/components/Carousel/Carousel.js +28 -25
  29. package/dist/es/components/Checkbox/Checkbox.css +18 -25
  30. package/dist/es/components/Checkbox/Checkbox.d.ts +11 -27
  31. package/dist/es/components/Checkbox/Checkbox.js +77 -90
  32. package/dist/es/components/Collapse/Collapse.d.ts +15 -3
  33. package/dist/es/components/Collapse/Collapse.js +11 -4
  34. package/dist/es/components/ContentArea/ContentArea.css +18 -28
  35. package/dist/es/components/ContentArea/ContentArea.d.ts +2 -7
  36. package/dist/es/components/ContentArea/ContentArea.js +5 -39
  37. package/dist/es/components/Counter/Counter.css +14 -11
  38. package/dist/es/components/Counter/Counter.js +3 -3
  39. package/dist/es/components/Grid/GridColumn.css +0 -7
  40. package/dist/es/components/Header/Header.css +8 -12
  41. package/dist/es/components/Header/Header.d.ts +7 -21
  42. package/dist/es/components/Header/Header.js +31 -67
  43. package/dist/es/components/InputLabel/InputLabel.css +0 -7
  44. package/dist/es/components/InputLabel/InputLabel.d.ts +3 -0
  45. package/dist/es/components/InputLabel/InputLabel.js +9 -4
  46. package/dist/es/components/Link/Link.d.ts +3 -3
  47. package/dist/es/components/Link/Link.js +32 -21
  48. package/dist/es/components/List/List.css +9 -13
  49. package/dist/es/components/List/List.d.ts +1 -1
  50. package/dist/es/components/List/List.js +2 -2
  51. package/dist/es/components/List/ListItem.css +0 -7
  52. package/dist/es/components/Logo/Logo.css +0 -7
  53. package/dist/es/components/Logo/Logo.js +4 -8
  54. package/dist/es/components/NavArrow/NavArrow.css +5 -12
  55. package/dist/es/components/Notification/Notification.css +41 -24
  56. package/dist/es/components/Notification/Notification.d.ts +8 -0
  57. package/dist/es/components/Notification/Notification.js +21 -4
  58. package/dist/es/components/Pagination/Pagination.css +0 -7
  59. package/dist/es/components/Pagination/Pagination.d.ts +9 -2
  60. package/dist/es/components/Pagination/Pagination.js +20 -3
  61. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
  62. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
  63. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +12 -7
  64. package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
  65. package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +10 -2
  66. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
  67. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
  68. package/dist/es/components/Pagination/helpers.d.ts +1 -1
  69. package/dist/es/components/Paragraph/Paragraph.css +10 -31
  70. package/dist/es/components/Paragraph/Paragraph.d.ts +9 -13
  71. package/dist/es/components/Paragraph/Paragraph.js +14 -40
  72. package/dist/es/components/Preloader/Preloader.css +5 -12
  73. package/dist/es/components/Preloader/Preloader.d.ts +4 -0
  74. package/dist/es/components/Preloader/Preloader.js +10 -5
  75. package/dist/es/components/RadioButton/RadioButton.css +7 -14
  76. package/dist/es/components/RadioButton/RadioButton.d.ts +8 -28
  77. package/dist/es/components/RadioButton/RadioButton.js +50 -85
  78. package/dist/es/components/Search/Search.css +20 -25
  79. package/dist/es/components/Search/Search.js +3 -4
  80. package/dist/es/components/Select/Select.css +34 -37
  81. package/dist/es/components/Select/Select.d.ts +43 -50
  82. package/dist/es/components/Select/Select.js +382 -461
  83. package/dist/es/components/Select/reducer/selectReducer.d.ts +34 -0
  84. package/dist/es/components/Select/reducer/selectReducer.js +123 -0
  85. package/dist/es/components/Switcher/Switcher.css +19 -25
  86. package/dist/es/components/Switcher/Switcher.js +1 -1
  87. package/dist/es/components/Tabs/Tab.d.ts +5 -2
  88. package/dist/es/components/Tabs/Tab.js +4 -2
  89. package/dist/es/components/Tabs/Tabs.css +30 -37
  90. package/dist/es/components/Tabs/Tabs.d.ts +8 -2
  91. package/dist/es/components/Tabs/Tabs.js +68 -105
  92. package/dist/es/components/TextField/TextField.css +27 -33
  93. package/dist/es/components/TextField/TextField.d.ts +9 -3
  94. package/dist/es/components/TextField/TextField.js +32 -24
  95. package/dist/es/components/TextLink/TextLink.css +10 -14
  96. package/dist/es/components/TextLink/TextLink.d.ts +1 -1
  97. package/dist/es/components/TextLink/TextLink.js +7 -2
  98. package/dist/es/components/Tile/Tile.css +2 -8
  99. package/dist/es/components/Tile/Tile.d.ts +5 -2
  100. package/dist/es/components/Tile/Tile.js +2 -2
  101. package/dist/es/components/Tooltip/Tooltip.css +1 -8
  102. package/dist/es/components/Tooltip/Tooltip.d.ts +8 -2
  103. package/dist/es/components/Tooltip/Tooltip.js +28 -27
  104. package/dist/es/index.d.ts +1 -0
  105. package/dist/es/index.js +1 -0
  106. package/dist/lib/colors/ColorItem/ColorItem.css +1 -8
  107. package/dist/lib/colors/ColorItem/ColorItem.js +1 -1
  108. package/dist/lib/colors/Colors.css +3 -11
  109. package/dist/lib/colors/Colors.d.ts +2 -2
  110. package/dist/lib/colors/Colors.js +63 -4
  111. package/dist/lib/colors/colorsData.js +78 -71
  112. package/dist/lib/components/Accordion/Accordion.css +7 -27
  113. package/dist/lib/components/Accordion/Accordion.d.ts +12 -7
  114. package/dist/lib/components/Accordion/Accordion.js +24 -19
  115. package/dist/lib/components/Banner/Banner.css +2 -37
  116. package/dist/lib/components/Banner/Banner.d.ts +10 -2
  117. package/dist/lib/components/Banner/Banner.js +35 -25
  118. package/dist/lib/components/Banner/BannerDot.css +4 -11
  119. package/dist/lib/components/Banner/BannerDot.d.ts +3 -0
  120. package/dist/lib/components/Banner/BannerDot.js +10 -2
  121. package/dist/lib/components/Button/Button.css +83 -74
  122. package/dist/lib/components/Button/Button.d.ts +8 -2
  123. package/dist/lib/components/Button/Button.js +16 -8
  124. package/dist/lib/components/Calendar/Calendar.css +0 -7
  125. package/dist/lib/components/Calendar/Calendar.js +3 -3
  126. package/dist/lib/components/Calendar/components/Day/Day.css +10 -17
  127. package/dist/lib/components/Calendar/components/Day/Day.js +1 -1
  128. package/dist/lib/components/Calendar/components/Month/Month.css +3 -10
  129. package/dist/lib/components/Calendar/components/Month/Month.js +20 -4
  130. package/dist/lib/components/Carousel/Carousel.css +4 -11
  131. package/dist/lib/components/Carousel/Carousel.d.ts +9 -2
  132. package/dist/lib/components/Carousel/Carousel.js +26 -23
  133. package/dist/lib/components/Checkbox/Checkbox.css +18 -25
  134. package/dist/lib/components/Checkbox/Checkbox.d.ts +11 -27
  135. package/dist/lib/components/Checkbox/Checkbox.js +82 -125
  136. package/dist/lib/components/Collapse/Collapse.d.ts +15 -3
  137. package/dist/lib/components/Collapse/Collapse.js +13 -4
  138. package/dist/lib/components/ContentArea/ContentArea.css +18 -28
  139. package/dist/lib/components/ContentArea/ContentArea.d.ts +2 -7
  140. package/dist/lib/components/ContentArea/ContentArea.js +5 -42
  141. package/dist/lib/components/Counter/Counter.css +14 -11
  142. package/dist/lib/components/Counter/Counter.js +3 -3
  143. package/dist/lib/components/Grid/GridColumn.css +0 -7
  144. package/dist/lib/components/Header/Header.css +8 -12
  145. package/dist/lib/components/Header/Header.d.ts +7 -21
  146. package/dist/lib/components/Header/Header.js +31 -98
  147. package/dist/lib/components/InputLabel/InputLabel.css +0 -7
  148. package/dist/lib/components/InputLabel/InputLabel.d.ts +3 -0
  149. package/dist/lib/components/InputLabel/InputLabel.js +11 -3
  150. package/dist/lib/components/Link/Link.d.ts +3 -3
  151. package/dist/lib/components/Link/Link.js +44 -26
  152. package/dist/lib/components/List/List.css +9 -13
  153. package/dist/lib/components/List/List.d.ts +1 -1
  154. package/dist/lib/components/List/List.js +2 -2
  155. package/dist/lib/components/List/ListItem.css +0 -7
  156. package/dist/lib/components/Logo/Logo.css +0 -7
  157. package/dist/lib/components/Logo/Logo.js +4 -8
  158. package/dist/lib/components/NavArrow/NavArrow.css +5 -12
  159. package/dist/lib/components/Notification/Notification.css +41 -24
  160. package/dist/lib/components/Notification/Notification.d.ts +8 -0
  161. package/dist/lib/components/Notification/Notification.js +20 -3
  162. package/dist/lib/components/Pagination/Pagination.css +0 -7
  163. package/dist/lib/components/Pagination/Pagination.d.ts +9 -2
  164. package/dist/lib/components/Pagination/Pagination.js +20 -2
  165. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
  166. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
  167. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +12 -6
  168. package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
  169. package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +9 -1
  170. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
  171. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
  172. package/dist/lib/components/Pagination/helpers.d.ts +1 -1
  173. package/dist/lib/components/Paragraph/Paragraph.css +10 -31
  174. package/dist/lib/components/Paragraph/Paragraph.d.ts +9 -13
  175. package/dist/lib/components/Paragraph/Paragraph.js +15 -41
  176. package/dist/lib/components/Preloader/Preloader.css +5 -12
  177. package/dist/lib/components/Preloader/Preloader.d.ts +4 -0
  178. package/dist/lib/components/Preloader/Preloader.js +10 -4
  179. package/dist/lib/components/RadioButton/RadioButton.css +7 -14
  180. package/dist/lib/components/RadioButton/RadioButton.d.ts +8 -28
  181. package/dist/lib/components/RadioButton/RadioButton.js +51 -117
  182. package/dist/lib/components/Search/Search.css +20 -25
  183. package/dist/lib/components/Search/Search.js +3 -4
  184. package/dist/lib/components/Select/Select.css +34 -37
  185. package/dist/lib/components/Select/Select.d.ts +43 -50
  186. package/dist/lib/components/Select/Select.js +375 -483
  187. package/dist/lib/components/Select/reducer/selectReducer.d.ts +34 -0
  188. package/dist/lib/components/Select/reducer/selectReducer.js +136 -0
  189. package/dist/lib/components/Switcher/Switcher.css +19 -25
  190. package/dist/lib/components/Switcher/Switcher.js +1 -1
  191. package/dist/lib/components/Tabs/Tab.d.ts +5 -2
  192. package/dist/lib/components/Tabs/Tab.js +4 -2
  193. package/dist/lib/components/Tabs/Tabs.css +30 -37
  194. package/dist/lib/components/Tabs/Tabs.d.ts +8 -2
  195. package/dist/lib/components/Tabs/Tabs.js +68 -105
  196. package/dist/lib/components/TextField/TextField.css +27 -33
  197. package/dist/lib/components/TextField/TextField.d.ts +9 -3
  198. package/dist/lib/components/TextField/TextField.js +30 -23
  199. package/dist/lib/components/TextLink/TextLink.css +10 -14
  200. package/dist/lib/components/TextLink/TextLink.d.ts +1 -1
  201. package/dist/lib/components/TextLink/TextLink.js +7 -2
  202. package/dist/lib/components/Tile/Tile.css +2 -8
  203. package/dist/lib/components/Tile/Tile.d.ts +5 -2
  204. package/dist/lib/components/Tile/Tile.js +2 -2
  205. package/dist/lib/components/Tooltip/Tooltip.css +1 -8
  206. package/dist/lib/components/Tooltip/Tooltip.d.ts +8 -2
  207. package/dist/lib/components/Tooltip/Tooltip.js +27 -26
  208. package/dist/lib/index.d.ts +1 -0
  209. package/dist/lib/index.js +8 -0
  210. package/package.json +5 -4
  211. package/styles/base.less +2 -73
  212. package/styles/colors.css +60 -0
  213. 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: #333333;
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: #333333;
48
- background-color: #F6F6F6;
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: #333333;
52
- background-color: #F6F6F6;
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: #00B956;
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: #FFFFFF;
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: #EDEDED;
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: #EDEDED;
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: #EDEDED;
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 === null || onMouseLeave === void 0 ? void 0 : 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: #333333;
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 #EDEDED;
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: #333333;
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
- !isPrevMonthDisabled && goToPreviousMonth();
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
- !isNextMonthDisabled && goToNextMonth();
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: #FFFFFF80;
154
+ background-color: var(--stcWhite50);
162
155
  }
163
156
  .mfui-carousel_nav-theme_light .swiper-pagination-bullet:before {
164
- background-color: rgba(51, 51, 51, 0.25);
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: #FFFFFF;
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: #731982;
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 extends IFilterDataAttrs {
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(); // eslint-disable-next-line no-param-reassign
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 === null || onPrevClick === void 0 ? void 0 : onPrevClick(swiperInstance.realIndex);
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 === null || onNextClick === void 0 ? void 0 : onNextClick(swiperInstance.realIndex);
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 === null || getSwiper === void 0 ? void 0 : getSwiper(swiper);
184
- }, [getSwiper]);
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 === null || onChange === void 0 ? void 0 : onChange(realIndex, previousIndex, params.slidesPerView);
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
- (0, _lodash["default"])(function (swiper) {
220
- setBeginning(swiper.isBeginning);
221
- setEnd(swiper.isEnd);
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
- if (swiper.params.slidesPerView === SlidesPerView.AUTO) {}
225
- }, _throttleTime["default"].resize);
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.objectOf(PropTypes.string.isRequired),
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: #D8D8D8;
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: #10E272;
88
+ border-color: var(--buttonHoverGreen);
96
89
  }
97
90
  .mfui-checkbox_color_dark .mfui-checkbox__label:active .mfui-checkbox__custom-input {
98
- border-color: #404D46 !important;
99
- background-color: #404D46;
91
+ border-color: var(--buttonDown) !important;
92
+ background-color: var(--buttonDown);
100
93
  }
101
94
  .mfui-checkbox_color_dark .mfui-checkbox__icon {
102
- fill: #FFFFFF;
95
+ fill: var(--stcWhite);
103
96
  }
104
97
  .mfui-checkbox_color_dark.mfui-checkbox_checked .mfui-checkbox__custom-input {
105
- border-color: #00B956;
106
- color: #FFFFFF;
107
- background-color: #00B956;
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: #10E272;
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: #404D46 !important;
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: #D8D8D8;
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: #D8D8D8 !important;
126
- background-color: #EDEDED;
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: #F62434;
122
+ border-color: var(--fury);
130
123
  }
131
124
  .mfui-checkbox_color_light {
132
- color: #FFFFFF;
125
+ color: var(--stcWhite);
133
126
  }
134
127
  .mfui-checkbox_color_light .mfui-checkbox__custom-input {
135
- border-color: #FFFFFF;
136
- color: #00B956;
137
- background-color: #FFFFFF;
128
+ border-color: var(--stcWhite);
129
+ color: var(--brandGreen);
130
+ background-color: var(--stcWhite);
138
131
  }
@@ -1,8 +1,6 @@
1
- import * as React from 'react';
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 extends IFilterDataAttrs {
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?: (e: React.ChangeEvent<HTMLInputElement>) => void;
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;