@megafon/ui-core 3.0.0-beta.8 → 3.0.2

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 (87) hide show
  1. package/CHANGELOG.md +59 -85
  2. package/README.md +2 -2
  3. package/dist/es/colors/Colors.d.ts +2 -2
  4. package/dist/es/colors/colorsData.js +1 -1
  5. package/dist/es/components/Accordion/Accordion.js +1 -1
  6. package/dist/es/components/Banner/Banner.css +28 -0
  7. package/dist/es/components/Banner/Banner.d.ts +2 -0
  8. package/dist/es/components/Banner/Banner.js +15 -10
  9. package/dist/es/components/Button/Button.css +3 -3
  10. package/dist/es/components/Button/Button.js +3 -3
  11. package/dist/es/components/Calendar/Calendar.js +3 -2
  12. package/dist/es/components/Calendar/components/Day/Day.js +1 -1
  13. package/dist/es/components/Carousel/Carousel.js +17 -14
  14. package/dist/es/components/Checkbox/Checkbox.js +1 -1
  15. package/dist/es/components/Counter/Counter.js +3 -3
  16. package/dist/es/components/Link/Link.d.ts +1 -1
  17. package/dist/es/components/Link/Link.js +19 -27
  18. package/dist/es/components/Logo/Logo.js +1 -1
  19. package/dist/es/components/NavArrow/NavArrow.css +1 -1
  20. package/dist/es/components/Notification/Notification.css +34 -25
  21. package/dist/es/components/Notification/Notification.js +4 -2
  22. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +1 -1
  23. package/dist/es/components/Pagination/helpers.d.ts +1 -1
  24. package/dist/es/components/Paragraph/Paragraph.css +0 -9
  25. package/dist/es/components/Paragraph/Paragraph.d.ts +0 -3
  26. package/dist/es/components/Paragraph/Paragraph.js +1 -4
  27. package/dist/es/components/RadioButton/RadioButton.js +1 -1
  28. package/dist/es/components/Search/Search.js +4 -3
  29. package/dist/es/components/Select/Select.css +5 -2
  30. package/dist/es/components/Select/Select.d.ts +5 -45
  31. package/dist/es/components/Select/Select.js +364 -467
  32. package/dist/es/components/Select/reducer/selectReducer.d.ts +34 -0
  33. package/dist/es/components/Select/reducer/selectReducer.js +123 -0
  34. package/dist/es/components/Switcher/Switcher.css +19 -15
  35. package/dist/es/components/Switcher/Switcher.js +1 -1
  36. package/dist/es/components/Tabs/Tabs.d.ts +2 -0
  37. package/dist/es/components/Tabs/Tabs.js +94 -49
  38. package/dist/es/components/TextField/TextField.d.ts +3 -1
  39. package/dist/es/components/TextField/TextField.js +14 -10
  40. package/dist/es/components/Tile/Tile.js +4 -2
  41. package/dist/es/components/Tooltip/Tooltip.js +17 -17
  42. package/dist/es/index.d.ts +1 -0
  43. package/dist/es/index.js +1 -0
  44. package/dist/lib/colors/Colors.d.ts +2 -2
  45. package/dist/lib/colors/colorsData.js +1 -1
  46. package/dist/lib/components/Accordion/Accordion.js +1 -1
  47. package/dist/lib/components/Banner/Banner.css +28 -0
  48. package/dist/lib/components/Banner/Banner.d.ts +2 -0
  49. package/dist/lib/components/Banner/Banner.js +15 -10
  50. package/dist/lib/components/Button/Button.css +3 -3
  51. package/dist/lib/components/Button/Button.js +3 -3
  52. package/dist/lib/components/Calendar/Calendar.js +3 -3
  53. package/dist/lib/components/Calendar/components/Day/Day.js +1 -1
  54. package/dist/lib/components/Carousel/Carousel.js +15 -12
  55. package/dist/lib/components/Checkbox/Checkbox.js +1 -1
  56. package/dist/lib/components/Counter/Counter.js +3 -3
  57. package/dist/lib/components/Link/Link.d.ts +1 -1
  58. package/dist/lib/components/Link/Link.js +28 -43
  59. package/dist/lib/components/Logo/Logo.js +1 -1
  60. package/dist/lib/components/NavArrow/NavArrow.css +1 -1
  61. package/dist/lib/components/Notification/Notification.css +34 -25
  62. package/dist/lib/components/Notification/Notification.js +4 -2
  63. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +1 -1
  64. package/dist/lib/components/Pagination/helpers.d.ts +1 -1
  65. package/dist/lib/components/Paragraph/Paragraph.css +0 -9
  66. package/dist/lib/components/Paragraph/Paragraph.d.ts +0 -3
  67. package/dist/lib/components/Paragraph/Paragraph.js +1 -4
  68. package/dist/lib/components/RadioButton/RadioButton.js +1 -1
  69. package/dist/lib/components/Search/Search.js +4 -3
  70. package/dist/lib/components/Select/Select.css +5 -2
  71. package/dist/lib/components/Select/Select.d.ts +5 -45
  72. package/dist/lib/components/Select/Select.js +358 -490
  73. package/dist/lib/components/Select/reducer/selectReducer.d.ts +34 -0
  74. package/dist/lib/components/Select/reducer/selectReducer.js +136 -0
  75. package/dist/lib/components/Switcher/Switcher.css +19 -15
  76. package/dist/lib/components/Switcher/Switcher.js +1 -1
  77. package/dist/lib/components/Tabs/Tabs.d.ts +2 -0
  78. package/dist/lib/components/Tabs/Tabs.js +94 -49
  79. package/dist/lib/components/TextField/TextField.d.ts +3 -1
  80. package/dist/lib/components/TextField/TextField.js +14 -10
  81. package/dist/lib/components/Tile/Tile.js +4 -2
  82. package/dist/lib/components/Tooltip/Tooltip.js +17 -17
  83. package/dist/lib/index.d.ts +1 -0
  84. package/dist/lib/index.js +8 -0
  85. package/package.json +4 -4
  86. package/styles/colors.css +2 -2
  87. package/styles/colorsDark.css +1 -1
package/dist/es/index.js CHANGED
@@ -31,6 +31,7 @@ export { default as Preloader } from "./components/Preloader/Preloader";
31
31
  export { default as RadioButton } from "./components/RadioButton/RadioButton";
32
32
  export { default as Search } from "./components/Search/Search";
33
33
  export { default as Select } from "./components/Select/Select";
34
+ export { default as selectReducer } from "./components/Select/reducer/selectReducer";
34
35
  export { default as Switcher } from "./components/Switcher/Switcher";
35
36
  export { default as Tab } from "./components/Tabs/Tab";
36
37
  export { default as Tabs } from "./components/Tabs/Tabs";
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import './Colors.less';
3
- declare const Colors: () => JSX.Element;
3
+ declare const Colors: React.FC;
4
4
  export default Colors;
@@ -79,7 +79,7 @@ var colors = {
79
79
  code: 'buttonHoverGreen'
80
80
  }, {
81
81
  name: 'Button Hov. P.',
82
- code: 'buttonhoverPurple'
82
+ code: 'buttonHoverPurple'
83
83
  }, {
84
84
  name: 'Button Down',
85
85
  code: 'buttonDown'
@@ -72,7 +72,7 @@ var Accordion = function Accordion(_ref) {
72
72
 
73
73
  var handleClickTitle = function handleClickTitle(e) {
74
74
  if ((0, _uiHelpers.checkEventIsClickOrEnterPress)(e)) {
75
- onClickAccordion && onClickAccordion(!isOpenedState);
75
+ onClickAccordion === null || onClickAccordion === void 0 ? void 0 : onClickAccordion(!isOpenedState);
76
76
  setIsOpenedState(!isOpenedState);
77
77
  }
78
78
  };
@@ -34,6 +34,11 @@
34
34
  -webkit-transform: translateY(-50%);
35
35
  transform: translateY(-50%);
36
36
  }
37
+ @media screen and (max-width: 767px) {
38
+ .mfui-banner__arrow {
39
+ display: none;
40
+ }
41
+ }
37
42
  .mfui-banner__arrow_prev {
38
43
  left: 12px;
39
44
  }
@@ -98,6 +103,29 @@
98
103
  .mfui-banner__pagination_theme_dark {
99
104
  background-color: var(--stcBlack20);
100
105
  }
106
+ .mfui-banner__pagination_bottom-offset {
107
+ bottom: 60px;
108
+ }
109
+ @media screen and (min-width: 768px) and (max-width: 1023px) {
110
+ .mfui-banner__pagination_bottom-offset {
111
+ bottom: 89px;
112
+ }
113
+ }
114
+ @media screen and (min-width: 1024px) and (max-width: 1279px) {
115
+ .mfui-banner__pagination_bottom-offset {
116
+ bottom: 90px;
117
+ }
118
+ }
119
+ @media screen and (min-width: 1280px) and (max-width: 1439px) {
120
+ .mfui-banner__pagination_bottom-offset {
121
+ bottom: 65px;
122
+ }
123
+ }
124
+ @media screen and (min-width: 1440px) {
125
+ .mfui-banner__pagination_bottom-offset {
126
+ bottom: 72px;
127
+ }
128
+ }
101
129
  .mfui-banner__dot {
102
130
  width: 12px;
103
131
  height: 12px;
@@ -26,6 +26,8 @@ export interface IBannerProps {
26
26
  pagination?: Record<string, string>;
27
27
  dot?: Record<string, string>;
28
28
  };
29
+ /** Предполагается использование с наезжанием на баннер следующего за баннером элемента */
30
+ withPaginationBottomOffset?: boolean;
29
31
  /** Автоматическая прокрутка */
30
32
  autoPlay?: boolean;
31
33
  /** Задержка автоматической прокрутки */
@@ -61,6 +61,8 @@ var Banner = function Banner(_ref) {
61
61
  var className = _ref.className,
62
62
  _ref$classes = _ref.classes,
63
63
  classes = _ref$classes === void 0 ? {} : _ref$classes,
64
+ _ref$withPaginationBo = _ref.withPaginationBottomOffset,
65
+ withPaginationBottomOffset = _ref$withPaginationBo === void 0 ? false : _ref$withPaginationBo,
64
66
  _ref$autoPlay = _ref.autoPlay,
65
67
  autoPlay = _ref$autoPlay === void 0 ? false : _ref$autoPlay,
66
68
  _ref$autoPlayDelay = _ref.autoPlayDelay,
@@ -113,7 +115,8 @@ var Banner = function Banner(_ref) {
113
115
  return;
114
116
  }
115
117
 
116
- autoplay.stop();
118
+ autoplay.stop(); // eslint-disable-next-line no-param-reassign
119
+
117
120
  params.autoplay.delay = autoPlayDelay * 3;
118
121
  autoplay.start();
119
122
  }, [autoPlayDelay]);
@@ -123,18 +126,18 @@ var Banner = function Banner(_ref) {
123
126
  }
124
127
 
125
128
  swiperInstance.slidePrev();
126
- onPrevClick && onPrevClick(swiperInstance.realIndex);
129
+ onPrevClick === null || onPrevClick === void 0 ? void 0 : onPrevClick(swiperInstance.realIndex);
127
130
  increaseAutoplayDelay(swiperInstance);
128
- }, [swiperInstance, onPrevClick]);
131
+ }, [swiperInstance, onPrevClick, increaseAutoplayDelay]);
129
132
  var handleNextClick = React.useCallback(function () {
130
133
  if (!swiperInstance) {
131
134
  return;
132
135
  }
133
136
 
134
137
  swiperInstance.slideNext();
135
- onNextClick && onNextClick(swiperInstance.realIndex);
138
+ onNextClick === null || onNextClick === void 0 ? void 0 : onNextClick(swiperInstance.realIndex);
136
139
  increaseAutoplayDelay(swiperInstance);
137
- }, [swiperInstance, onNextClick]);
140
+ }, [swiperInstance, onNextClick, increaseAutoplayDelay]);
138
141
  var handleDotClick = React.useCallback(function (index) {
139
142
  if (!swiperInstance) {
140
143
  return;
@@ -146,9 +149,9 @@ var Banner = function Banner(_ref) {
146
149
  swiperInstance.slideTo(index);
147
150
  }
148
151
 
149
- onDotClick && onDotClick(swiperInstance.realIndex);
152
+ onDotClick === null || onDotClick === void 0 ? void 0 : onDotClick(swiperInstance.realIndex);
150
153
  increaseAutoplayDelay(swiperInstance);
151
- }, [swiperInstance, loop, onDotClick]);
154
+ }, [swiperInstance, loop, onDotClick, increaseAutoplayDelay]);
152
155
  var handleSwiper = React.useCallback(function (swiper) {
153
156
  setSwiperInstance(swiper);
154
157
  }, []);
@@ -171,8 +174,8 @@ var Banner = function Banner(_ref) {
171
174
  var handleSlideChange = React.useCallback(function (_ref4) {
172
175
  var realIndex = _ref4.realIndex;
173
176
  setActiveIndex(realIndex);
174
- onChange && onChange(realIndex);
175
- }, []);
177
+ onChange === null || onChange === void 0 ? void 0 : onChange(realIndex);
178
+ }, [onChange]);
176
179
  var handleAutoplayStop = React.useCallback(function () {
177
180
  setAutoPlayning(false);
178
181
  }, []);
@@ -213,7 +216,8 @@ var Banner = function Banner(_ref) {
213
216
  theme: navArrowTheme
214
217
  })), /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.pagination), {
215
218
  className: cn('pagination', {
216
- theme: navTheme
219
+ theme: navTheme,
220
+ 'bottom-offset': withPaginationBottomOffset
217
221
  })
218
222
  }), React.Children.map(children, function (_, i) {
219
223
  return /*#__PURE__*/React.createElement(_BannerDot["default"], {
@@ -237,6 +241,7 @@ Banner.propTypes = {
237
241
  classes: PropTypes.shape({
238
242
  slide: PropTypes.string
239
243
  }),
244
+ withPaginationBottomOffset: PropTypes.bool,
240
245
  dataAttrs: PropTypes.shape({
241
246
  root: PropTypes.objectOf(PropTypes.string.isRequired),
242
247
  swiper: PropTypes.objectOf(PropTypes.string.isRequired),
@@ -224,9 +224,9 @@
224
224
  fill: var(--stcWhite);
225
225
  }
226
226
  .mfui-button_no-touch.mfui-button_type_primary.mfui-button_theme_purple:not(.mfui-button_loading):hover {
227
- background-color: var(--buttonhoverPurple);
228
- -webkit-box-shadow: inset 0 0 0 1px var(--buttonhoverPurple);
229
- box-shadow: inset 0 0 0 1px var(--buttonhoverPurple);
227
+ background-color: var(--buttonHoverPurple);
228
+ -webkit-box-shadow: inset 0 0 0 1px var(--buttonHoverPurple);
229
+ box-shadow: inset 0 0 0 1px var(--buttonHoverPurple);
230
230
  }
231
231
  .mfui-button_no-touch.mfui-button_type_primary.mfui-button_theme_purple:not(.mfui-button_loading):active {
232
232
  background-color: var(--buttonDown);
@@ -123,7 +123,7 @@ var Button = function Button(_ref) {
123
123
  return;
124
124
  }
125
125
 
126
- onClick && onClick(e);
126
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
127
127
  }, [disabled, onClick]);
128
128
 
129
129
  var currentTheme = _react["default"].useMemo(function () {
@@ -161,7 +161,7 @@ var Button = function Button(_ref) {
161
161
  }, children), !icon && showArrow && /*#__PURE__*/_react["default"].createElement(Arrow, {
162
162
  className: cn('icon-arrow')
163
163
  }));
164
- }, [contentClassName, showArrow, icon, children]);
164
+ }, [children, icon, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.content, contentClassName, showArrow]);
165
165
 
166
166
  var contentType = _react["default"].useMemo(function () {
167
167
  switch (true) {
@@ -188,7 +188,7 @@ var Button = function Button(_ref) {
188
188
  sizeTablet: sizeTablet && getLoaderSize(sizeTablet),
189
189
  sizeMobile: sizeMobile && getLoaderSize(sizeMobile)
190
190
  });
191
- }, [sizeAll, sizeWide, sizeDesktop, sizeTablet, sizeMobile]);
191
+ }, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.loader, loaderColor, sizeAll, sizeWide, sizeDesktop, sizeTablet, sizeMobile]);
192
192
 
193
193
  var setRelAttribute = function setRelAttribute() {
194
194
  if (ElementType !== 'a') {
@@ -146,7 +146,7 @@ var Calendar = function Calendar(_ref) {
146
146
  (0, _react.useEffect)(function () {
147
147
  var propsStartDate = calendarStateFromProps.startDate;
148
148
  setCalendarState(calendarStateFromProps);
149
- propsStartDate && goToDate(propsStartDate);
149
+ propsStartDate && goToDate(propsStartDate); // eslint-disable-next-line react-hooks/exhaustive-deps
150
150
  }, [calendarStateFromProps]);
151
151
 
152
152
  var getCalendarState = function getCalendarState(date) {
@@ -211,7 +211,7 @@ var Calendar = function Calendar(_ref) {
211
211
  var nextStartDate = nextState.startDate,
212
212
  nextEndDate = nextState.endDate;
213
213
  setCalendarState(nextState);
214
- onChange && onChange(nextStartDate, nextEndDate);
214
+ onChange === null || onChange === void 0 ? void 0 : onChange(nextStartDate, nextEndDate);
215
215
  };
216
216
 
217
217
  var handleDateHover = function handleDateHover(date) {
@@ -255,7 +255,7 @@ var Calendar = function Calendar(_ref) {
255
255
  var renderMonths = function renderMonths() {
256
256
  return activeMonths.map(function (_ref2) {
257
257
  var month = _ref2.month,
258
- year = _ref2.year;
258
+ year = _ref2.year; // eslint-disable-next-line react-hooks/rules-of-hooks
259
259
 
260
260
  var _useMonth = (0, _hooks.useMonth)({
261
261
  year: year,
@@ -79,7 +79,7 @@ var Day = function Day(_a) {
79
79
  };
80
80
 
81
81
  var handleMouseLeave = function handleMouseLeave() {
82
- onMouseLeave && onMouseLeave();
82
+ onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
83
83
  };
84
84
 
85
85
  return /*#__PURE__*/_react["default"].createElement("button", {
@@ -154,7 +154,8 @@ var Carousel = function Carousel(_ref) {
154
154
  return;
155
155
  }
156
156
 
157
- autoplay.stop();
157
+ autoplay.stop(); // eslint-disable-next-line no-param-reassign
158
+
158
159
  params.autoplay.delay = autoPlayDelay * 3;
159
160
  autoplay.start();
160
161
  }, [autoPlayDelay]);
@@ -164,7 +165,7 @@ var Carousel = function Carousel(_ref) {
164
165
  }
165
166
 
166
167
  swiperInstance.slidePrev();
167
- onPrevClick && onPrevClick(swiperInstance.realIndex);
168
+ onPrevClick === null || onPrevClick === void 0 ? void 0 : onPrevClick(swiperInstance.realIndex);
168
169
  increaseAutoplayDelay(swiperInstance);
169
170
  }, [swiperInstance, onPrevClick, increaseAutoplayDelay]);
170
171
  var handleNextClick = React.useCallback(function () {
@@ -173,14 +174,14 @@ var Carousel = function Carousel(_ref) {
173
174
  }
174
175
 
175
176
  swiperInstance.slideNext();
176
- onNextClick && onNextClick(swiperInstance.realIndex);
177
+ onNextClick === null || onNextClick === void 0 ? void 0 : onNextClick(swiperInstance.realIndex);
177
178
  increaseAutoplayDelay(swiperInstance);
178
179
  }, [swiperInstance, onNextClick, increaseAutoplayDelay]);
179
180
  var handleSwiper = React.useCallback(function (swiper) {
180
181
  setSwiperInstance(swiper);
181
182
  setLocked(swiper.isBeginning && swiper.isEnd);
182
- getSwiper && getSwiper(swiper);
183
- }, []);
183
+ getSwiper === null || getSwiper === void 0 ? void 0 : getSwiper(swiper);
184
+ }, [getSwiper]);
184
185
  var handleReachBeginnig = React.useCallback(function () {
185
186
  setBeginning(true);
186
187
  }, []);
@@ -201,7 +202,7 @@ var Carousel = function Carousel(_ref) {
201
202
  var realIndex = _ref4.realIndex,
202
203
  previousIndex = _ref4.previousIndex,
203
204
  params = _ref4.params;
204
- onChange && onChange(realIndex, previousIndex, params.slidesPerView);
205
+ onChange === null || onChange === void 0 ? void 0 : onChange(realIndex, previousIndex, params.slidesPerView);
205
206
  }, [onChange]);
206
207
 
207
208
  var handleRootClick = function handleRootClick(e) {
@@ -214,13 +215,15 @@ var Carousel = function Carousel(_ref) {
214
215
  }; // https://github.com/nolimits4web/Swiper/issues/2346
215
216
 
216
217
 
217
- var handleSwiperResize = React.useCallback((0, _lodash["default"])(function (swiper) {
218
- setBeginning(swiper.isBeginning);
219
- setEnd(swiper.isEnd);
220
- setLocked(swiper.isBeginning && swiper.isEnd);
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);
221
223
 
222
- if (swiper.params.slidesPerView === SlidesPerView.AUTO) {}
223
- }, _throttleTime["default"].resize), []);
224
+ if (swiper.params.slidesPerView === SlidesPerView.AUTO) {}
225
+ }, _throttleTime["default"].resize);
226
+ }, []);
224
227
 
225
228
  var handleSlideFocus = function handleSlideFocus(index) {
226
229
  return function (e) {
@@ -67,7 +67,7 @@ var Checkbox = function Checkbox(_ref) {
67
67
  var handleChange = function handleChange(e) {
68
68
  if ((0, _uiHelpers.checkEventIsClickOrEnterPress)(e) || e.type === CHANGE_KEY) {
69
69
  setIsChecked(!isChecked);
70
- onChange && onChange(!isChecked);
70
+ onChange === null || onChange === void 0 ? void 0 : onChange(!isChecked);
71
71
  }
72
72
  };
73
73
 
@@ -75,15 +75,15 @@ var Counter = function Counter(_ref) {
75
75
  }
76
76
 
77
77
  if (inputValue < min) {
78
- onChange && onChange(min);
78
+ onChange === null || onChange === void 0 ? void 0 : onChange(min);
79
79
  }
80
80
 
81
81
  if (inputValue > max) {
82
- onChange && onChange(max);
82
+ onChange === null || onChange === void 0 ? void 0 : onChange(max);
83
83
  }
84
84
 
85
85
  if (inputValue >= min && inputValue <= max) {
86
- onChange && onChange(inputValue);
86
+ onChange === null || onChange === void 0 ? void 0 : onChange(inputValue);
87
87
  }
88
88
  }, [min, max, onChange, isControlled]);
89
89
  var handleMinusClick = React.useCallback(function () {
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  export interface ILinkProps {
3
3
  /** Дополнительный класс корневого элемента */
4
4
  className?: string;
@@ -1,65 +1,50 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports["default"] = void 0;
9
7
 
10
- require("core-js/modules/es.symbol");
11
-
12
- require("core-js/modules/es.array.index-of");
13
-
14
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
9
 
16
- var React = _interopRequireWildcard(require("react"));
10
+ var _react = _interopRequireDefault(require("react"));
17
11
 
18
12
  var _uiHelpers = require("@megafon/ui-helpers");
19
13
 
20
- var PropTypes = _interopRequireWildcard(require("prop-types"));
21
-
22
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
23
-
24
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
+ var _propTypes = _interopRequireDefault(require("prop-types"));
25
15
 
26
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
17
 
28
- var __rest = void 0 && (void 0).__rest || function (s, e) {
29
- var t = {};
30
-
31
- for (var p in s) {
32
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
33
- }
34
-
35
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
36
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
37
- }
38
- return t;
39
- };
40
-
41
- var Link = function Link(_a) {
42
- var dataAttrs = _a.dataAttrs,
43
- props = __rest(_a, ["dataAttrs"]);
44
-
45
- return (
46
- /*#__PURE__*/
47
- // eslint-disable-next-line jsx-a11y/anchor-has-content
48
- React.createElement("a", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), props))
49
- );
18
+ var Link = function Link(_ref) {
19
+ var target = _ref.target,
20
+ href = _ref.href,
21
+ rel = _ref.rel,
22
+ onClick = _ref.onClick,
23
+ className = _ref.className,
24
+ download = _ref.download,
25
+ children = _ref.children,
26
+ dataAttrs = _ref.dataAttrs;
27
+ return /*#__PURE__*/_react["default"].createElement("a", (0, _extends2["default"])({
28
+ className: className,
29
+ href: href,
30
+ target: target,
31
+ rel: rel,
32
+ download: download,
33
+ onClick: onClick
34
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), children);
50
35
  };
51
36
 
52
37
  Link.propTypes = {
53
- href: PropTypes.string,
54
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element, PropTypes.string, PropTypes.node]),
55
- target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
56
- className: PropTypes.string,
57
- dataAttrs: PropTypes.shape({
58
- root: PropTypes.objectOf(PropTypes.string.isRequired)
38
+ href: _propTypes["default"].string,
39
+ children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].element), _propTypes["default"].element, _propTypes["default"].string, _propTypes["default"].node]),
40
+ target: _propTypes["default"].oneOf(['_self', '_blank', '_parent', '_top']),
41
+ className: _propTypes["default"].string,
42
+ dataAttrs: _propTypes["default"].shape({
43
+ root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
59
44
  }),
60
- rel: PropTypes.string,
61
- download: PropTypes.bool,
62
- onClick: PropTypes.func
45
+ rel: _propTypes["default"].string,
46
+ download: _propTypes["default"].bool,
47
+ onClick: _propTypes["default"].func
63
48
  };
64
49
  var _default = Link;
65
50
  exports["default"] = _default;
@@ -44,7 +44,7 @@ var greenVerticalImg = function greenVerticalImg(props) {
44
44
  fill: "none",
45
45
  d: "M-213 356.4h169v128.5h-169z"
46
46
  }), /*#__PURE__*/React.createElement("g", {
47
- fill: "#00985F"
47
+ fill: "#00B956"
48
48
  }, /*#__PURE__*/React.createElement("path", {
49
49
  d: "M-124.9 372.3v32.4c0 1.4-1.2 2.5-2.6 2.5h-3.9c-.2 0-.3.2-.3.3v27.2c1 .1 1.9.1 2.9.1 17.4 0 31.5-14.1 31.5-31.5 0-15.8-12-29.1-27.6-31zm-.6 48.4c-2.2 0-3.9-1.8-3.9-3.9 0-2.2 1.8-3.9 3.9-3.9 2.2 0 3.9 1.8 3.9 3.9 0 2.2-1.8 3.9-3.9 3.9zm9.2 0c-2.2 0-3.9-1.8-3.9-3.9 0-2.2 1.8-3.9 3.9-3.9 2.2 0 3.9 1.8 3.9 3.9 0 2.2-1.7 3.9-3.9 3.9zm9.2 0c-2.2 0-3.9-1.8-3.9-3.9 0-2.2 1.8-3.9 3.9-3.9s3.9 1.8 3.9 3.9c0 2.2-1.7 3.9-3.9 3.9z"
50
50
  }), /*#__PURE__*/React.createElement("path", {
@@ -28,7 +28,7 @@
28
28
  background-color: var(--brandPurple);
29
29
  }
30
30
  .mfui-nav-arrow_theme_purple:hover:not(:disabled) {
31
- background-color: var(--buttonhoverPurple);
31
+ background-color: var(--buttonHoverPurple);
32
32
  }
33
33
  .mfui-nav-arrow_theme_dark {
34
34
  background-color: var(--stcBlack20);
@@ -126,31 +126,38 @@ h5 {
126
126
  }
127
127
  .mfui-notification__close {
128
128
  position: absolute;
129
- top: 12px;
130
- right: 12px;
129
+ top: 8px;
130
+ right: 8px;
131
131
  display: -webkit-box;
132
132
  display: -ms-flexbox;
133
133
  display: flex;
134
+ -webkit-box-align: center;
135
+ -ms-flex-align: center;
136
+ align-items: center;
137
+ -webkit-box-pack: center;
138
+ -ms-flex-pack: center;
139
+ justify-content: center;
140
+ width: 24px;
141
+ height: 24px;
134
142
  padding: 0;
135
143
  border: none;
136
144
  border-radius: 50%;
137
- background: transparent;
138
- cursor: pointer;
139
- }
140
- .mfui-notification__close:hover {
141
145
  background-color: var(--stcBlack5);
142
- }
143
- .mfui-notification__close-icon {
144
- width: 20px;
145
- height: 20px;
146
- fill: var(--content);
146
+ cursor: pointer;
147
147
  }
148
148
  @media screen and (min-width: 768px) {
149
- .mfui-notification__close-icon {
149
+ .mfui-notification__close {
150
+ top: 12px;
151
+ right: 12px;
150
152
  width: 32px;
151
153
  height: 32px;
152
154
  }
153
155
  }
156
+ .mfui-notification__close-icon {
157
+ width: 10px;
158
+ height: 10px;
159
+ fill: var(--stcBlack50);
160
+ }
154
161
  .mfui-notification_type_error .mfui-notification__icon-container {
155
162
  background-color: var(--fury20);
156
163
  }
@@ -182,36 +189,38 @@ h5 {
182
189
  .mfui-notification_colored .mfui-notification__icon-container {
183
190
  background-color: var(--stcWhite);
184
191
  }
185
- .mfui-notification_colored .mfui-notification__close:hover {
186
- background-color: var(--stcWhite);
192
+ .mfui-notification_colored.mfui-notification_type_success {
193
+ background-color: var(--brandGreen20);
187
194
  }
188
195
  .mfui-notification_colored.mfui-notification_type_success .mfui-notification__title,
189
- .mfui-notification_colored.mfui-notification_type_error .mfui-notification__title,
190
196
  .mfui-notification_colored.mfui-notification_type_success .mfui-notification__text,
197
+ .mfui-notification_colored.mfui-notification_type_success .mfui-notification__link {
198
+ color: var(--stcBlack);
199
+ }
200
+ .mfui-notification_colored.mfui-notification_type_success .mfui-notification__right-arrow {
201
+ fill: var(--stcBlack);
202
+ }
203
+ .mfui-notification_colored.mfui-notification_type_success .mfui-notification__icon-container {
204
+ background-color: var(--stcWhite);
205
+ }
206
+ .mfui-notification_colored.mfui-notification_type_error {
207
+ background-color: var(--fury80);
208
+ }
209
+ .mfui-notification_colored.mfui-notification_type_error .mfui-notification__title,
191
210
  .mfui-notification_colored.mfui-notification_type_error .mfui-notification__text,
192
- .mfui-notification_colored.mfui-notification_type_success .mfui-notification__link,
193
211
  .mfui-notification_colored.mfui-notification_type_error .mfui-notification__link {
194
212
  color: var(--stcWhite);
195
213
  }
196
- .mfui-notification_colored.mfui-notification_type_success .mfui-notification__right-arrow,
197
214
  .mfui-notification_colored.mfui-notification_type_error .mfui-notification__right-arrow {
198
215
  fill: var(--stcWhite);
199
216
  }
200
- .mfui-notification_colored.mfui-notification_type_success .mfui-notification__icon-container,
201
217
  .mfui-notification_colored.mfui-notification_type_error .mfui-notification__icon-container {
202
218
  background-color: var(--stcWhite20);
203
219
  }
204
- .mfui-notification_colored.mfui-notification_type_success .mfui-notification__icon-container svg,
205
220
  .mfui-notification_colored.mfui-notification_type_error .mfui-notification__icon-container svg {
206
221
  /* stylelint-disable-line max-nesting-depth */
207
222
  fill: var(--stcWhite);
208
223
  }
209
- .mfui-notification_colored.mfui-notification_type_success {
210
- background-color: var(--brandGreen);
211
- }
212
- .mfui-notification_colored.mfui-notification_type_error {
213
- background-color: var(--fury80);
214
- }
215
224
  .mfui-notification_colored.mfui-notification_type_info .mfui-notification__title,
216
225
  .mfui-notification_colored.mfui-notification_type_warning .mfui-notification__title,
217
226
  .mfui-notification_colored.mfui-notification_type_info .mfui-notification__text,
@@ -75,9 +75,11 @@ var InfoIcon = function InfoIcon(props) {
75
75
 
76
76
  var CancelIcon = function CancelIcon(props) {
77
77
  return /*#__PURE__*/_react["default"].createElement("svg", (0, _extends2["default"])({
78
- viewBox: "0 0 40 40"
78
+ viewBox: "0 0 10 10"
79
79
  }, props), /*#__PURE__*/_react["default"].createElement("path", {
80
- d: "M20 18.586l6.364-6.364 1.414 1.414L21.414 20l6.364 6.364-1.414 1.414L20 21.414l-6.364 6.364-1.414-1.414L18.586 20l-6.364-6.364 1.414-1.414L20 18.586z"
80
+ fillRule: "evenodd",
81
+ clipRule: "evenodd",
82
+ d: "M5 3.75L1.25 0 0 1.25 3.75 5 0 8.75 1.25 10 5 6.25 8.75 10 10 8.75 6.25 5 10 1.25 8.75 0 5 3.75z"
81
83
  }));
82
84
  };
83
85
 
@@ -31,7 +31,7 @@ var PaginationButton = function PaginationButton(_ref) {
31
31
  dataAttrs = _ref.dataAttrs;
32
32
 
33
33
  var handleClick = function handleClick() {
34
- onClick && onClick(value);
34
+ onClick === null || onClick === void 0 ? void 0 : onClick(value);
35
35
  };
36
36
 
37
37
  return /*#__PURE__*/_react["default"].createElement("button", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
@@ -1,2 +1,2 @@
1
- declare const getRange: (from: any, to: any, step?: number) => number[];
1
+ declare const getRange: (from: number, to: number, step?: number) => number[];
2
2
  export default getRange;
@@ -38,12 +38,3 @@
38
38
  .mfui-paragraph_color_purple {
39
39
  color: var(--brandPurple);
40
40
  }
41
- .mfui-paragraph_color_spbSky0 {
42
- color: var(--spbSky0);
43
- }
44
- .mfui-paragraph_color_spbSky1 {
45
- color: var(--spbSky1);
46
- }
47
- .mfui-paragraph_color_spbSky2 {
48
- color: var(--spbSky2);
49
- }
@@ -6,9 +6,6 @@ declare const COLORS: {
6
6
  readonly WHITE: "white";
7
7
  readonly GREEN: "green";
8
8
  readonly PURPLE: "purple";
9
- readonly SPB_SKY_0: "spbSky0";
10
- readonly SPB_SKY_1: "spbSky1";
11
- readonly SPB_SKY_2: "spbSky2";
12
9
  };
13
10
  declare type ColorType = typeof COLORS[keyof typeof COLORS];
14
11
  export interface IParagraphProps {
@@ -28,10 +28,7 @@ var COLORS = {
28
28
  DEFAULT: 'default',
29
29
  WHITE: 'white',
30
30
  GREEN: 'green',
31
- PURPLE: 'purple',
32
- SPB_SKY_0: 'spbSky0',
33
- SPB_SKY_1: 'spbSky1',
34
- SPB_SKY_2: 'spbSky2'
31
+ PURPLE: 'purple'
35
32
  };
36
33
  var cn = (0, _uiHelpers.cnCreate)('mfui-paragraph');
37
34
 
@@ -52,7 +52,7 @@ var RadioButton = function RadioButton(_ref) {
52
52
  var rootClassNames = Array.isArray(className) ? [].concat((0, _toConsumableArray2["default"])(className), [classes.root]) : [className, classes.root];
53
53
 
54
54
  var handleChange = function handleChange() {
55
- return onChange && onChange(value);
55
+ return onChange === null || onChange === void 0 ? void 0 : onChange(value);
56
56
  };
57
57
 
58
58
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({