@megafon/ui-core 5.9.2 → 5.10.0

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 (56) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.css +15 -0
  3. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.d.ts +2 -0
  4. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.js +3 -1
  5. package/dist/es/components/Banner/Banner.css +62 -32
  6. package/dist/es/components/Banner/Banner.d.ts +29 -1
  7. package/dist/es/components/Banner/Banner.js +95 -46
  8. package/dist/es/components/Banner/BannerDot.css +27 -21
  9. package/dist/es/components/Banner/BannerDot.d.ts +8 -1
  10. package/dist/es/components/Banner/BannerDot.js +20 -8
  11. package/dist/es/components/Button/Button.css +6 -0
  12. package/dist/es/components/Button/Button.d.ts +2 -0
  13. package/dist/es/components/Button/Button.js +4 -0
  14. package/dist/es/components/ContentView/ContentView.css +9 -4
  15. package/dist/es/components/ContentView/ContentView.d.ts +6 -0
  16. package/dist/es/components/ContentView/ContentView.js +5 -1
  17. package/dist/es/components/NavArrow/NavArrow.css +16 -0
  18. package/dist/es/components/NavArrow/NavArrow.d.ts +2 -1
  19. package/dist/es/components/NavArrow/NavArrow.js +3 -2
  20. package/dist/es/components/Sliders/Slider/Slider.css +4 -0
  21. package/dist/es/components/Sliders/Slider/Slider.js +3 -3
  22. package/dist/es/components/Sliders/SliderRange/SliderRange.css +4 -0
  23. package/dist/es/components/Sliders/SliderRatio/SliderRatio.css +4 -0
  24. package/dist/es/components/Sliders/SliderRatio/SliderRatio.js +19 -7
  25. package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.css +1 -1
  26. package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.css +3 -0
  27. package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.js +1 -1
  28. package/dist/es/components/Tooltip/Tooltip.css +3 -0
  29. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.css +15 -0
  30. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.d.ts +2 -0
  31. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.js +3 -1
  32. package/dist/lib/components/Banner/Banner.css +62 -32
  33. package/dist/lib/components/Banner/Banner.d.ts +29 -1
  34. package/dist/lib/components/Banner/Banner.js +96 -45
  35. package/dist/lib/components/Banner/BannerDot.css +27 -21
  36. package/dist/lib/components/Banner/BannerDot.d.ts +8 -1
  37. package/dist/lib/components/Banner/BannerDot.js +23 -9
  38. package/dist/lib/components/Button/Button.css +6 -0
  39. package/dist/lib/components/Button/Button.d.ts +2 -0
  40. package/dist/lib/components/Button/Button.js +4 -0
  41. package/dist/lib/components/ContentView/ContentView.css +9 -4
  42. package/dist/lib/components/ContentView/ContentView.d.ts +6 -0
  43. package/dist/lib/components/ContentView/ContentView.js +5 -1
  44. package/dist/lib/components/NavArrow/NavArrow.css +16 -0
  45. package/dist/lib/components/NavArrow/NavArrow.d.ts +2 -1
  46. package/dist/lib/components/NavArrow/NavArrow.js +2 -1
  47. package/dist/lib/components/Sliders/Slider/Slider.css +4 -0
  48. package/dist/lib/components/Sliders/Slider/Slider.js +3 -3
  49. package/dist/lib/components/Sliders/SliderRange/SliderRange.css +4 -0
  50. package/dist/lib/components/Sliders/SliderRatio/SliderRatio.css +4 -0
  51. package/dist/lib/components/Sliders/SliderRatio/SliderRatio.js +19 -7
  52. package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.css +1 -1
  53. package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.css +3 -0
  54. package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.js +1 -1
  55. package/dist/lib/components/Tooltip/Tooltip.css +3 -0
  56. package/package.json +2 -2
@@ -1,8 +1,23 @@
1
1
  import * as React from 'react';
2
+ import SwiperCore from 'swiper';
3
+ import { ThemeType as ArrowThemeType } from '../NavArrow/NavArrow';
2
4
  import './Banner.less';
5
+ export declare const BackgroundColor: {
6
+ readonly TRANSPARENT: "transparent";
7
+ readonly GREEN: "green";
8
+ readonly PURPLE: "purple";
9
+ readonly SPB_SKY_0: "spbSky0";
10
+ readonly GRADIENT: "gradient";
11
+ readonly LIGHT: "light";
12
+ };
13
+ declare type BackgroundColorType = typeof BackgroundColor[keyof typeof BackgroundColor];
14
+ export declare const Radius: {
15
+ readonly CORNERS: "corners";
16
+ readonly ROUNDED: "rounded";
17
+ };
18
+ export declare type RadiusType = typeof Radius[keyof typeof Radius];
3
19
  export declare const NavTheme: {
4
20
  readonly LIGHT: "light";
5
- readonly GREEN: "green";
6
21
  readonly DARK: "dark";
7
22
  };
8
23
  declare type NavThemeType = typeof NavTheme[keyof typeof NavTheme];
@@ -13,8 +28,13 @@ export interface IBannerProps {
13
28
  loop?: boolean;
14
29
  /** Дополнительные классы для корневого и внутренних элементов */
15
30
  classes?: {
31
+ swiper?: string;
16
32
  slide?: string;
17
33
  arrow?: string;
34
+ arrowPrev?: string;
35
+ arrowNext?: string;
36
+ pagination?: string;
37
+ dot?: string;
18
38
  };
19
39
  /** Дополнительные data атрибуты к внутренним элементам */
20
40
  dataAttrs?: {
@@ -34,10 +54,18 @@ export interface IBannerProps {
34
54
  autoPlayDelay?: number;
35
55
  /** Пауза автоматической прокрутки при наведении курсора на компонент */
36
56
  pauseOnHover?: boolean;
57
+ /** Фоновый цвет */
58
+ backgroundColor?: BackgroundColorType;
59
+ /** Радиус границы */
60
+ radius?: RadiusType;
37
61
  /** Цветовая тема навигации */
38
62
  navTheme?: NavThemeType;
63
+ /** Цветовая тема стрелок */
64
+ arrowTheme?: ArrowThemeType;
39
65
  /** Автоматическая высота слайдов */
40
66
  autoHeight?: boolean;
67
+ /** Ref на swiper */
68
+ getSwiper?: (instance: SwiperCore) => void;
41
69
  /** Обработчик клика по стрелке "вперед" (должен быть обернут в useCallback) */
42
70
  onNextClick?: (index: number) => void;
43
71
  /** Обработчик клика по стрелке "назад" (должен быть обернут в useCallback) */
@@ -5,7 +5,7 @@ function _typeof3(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "funct
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = exports.NavTheme = void 0;
8
+ exports["default"] = exports.NavTheme = exports.Radius = exports.BackgroundColor = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
@@ -39,9 +39,22 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
39
39
 
40
40
  _swiper["default"].use([_swiper.Autoplay]);
41
41
 
42
+ var BackgroundColor = {
43
+ TRANSPARENT: 'transparent',
44
+ GREEN: 'green',
45
+ PURPLE: 'purple',
46
+ SPB_SKY_0: 'spbSky0',
47
+ GRADIENT: 'gradient',
48
+ LIGHT: 'light'
49
+ };
50
+ exports.BackgroundColor = BackgroundColor;
51
+ var Radius = {
52
+ CORNERS: 'corners',
53
+ ROUNDED: 'rounded'
54
+ };
55
+ exports.Radius = Radius;
42
56
  var NavTheme = {
43
57
  LIGHT: 'light',
44
- GREEN: 'green',
45
58
  DARK: 'dark'
46
59
  };
47
60
  exports.NavTheme = NavTheme;
@@ -70,11 +83,18 @@ var Banner = function Banner(_ref) {
70
83
  _ref$loop = _ref.loop,
71
84
  loop = _ref$loop === void 0 ? false : _ref$loop,
72
85
  _ref$navTheme = _ref.navTheme,
73
- navTheme = _ref$navTheme === void 0 ? 'light' : _ref$navTheme,
86
+ navTheme = _ref$navTheme === void 0 ? NavTheme.LIGHT : _ref$navTheme,
87
+ _ref$arrowTheme = _ref.arrowTheme,
88
+ arrowTheme = _ref$arrowTheme === void 0 ? _NavArrow.Theme.DARK : _ref$arrowTheme,
89
+ _ref$backgroundColor = _ref.backgroundColor,
90
+ backgroundColor = _ref$backgroundColor === void 0 ? BackgroundColor.TRANSPARENT : _ref$backgroundColor,
91
+ _ref$radius = _ref.radius,
92
+ radius = _ref$radius === void 0 ? Radius.ROUNDED : _ref$radius,
74
93
  _ref$autoHeight = _ref.autoHeight,
75
94
  autoHeight = _ref$autoHeight === void 0 ? false : _ref$autoHeight,
76
95
  _ref$children = _ref.children,
77
96
  children = _ref$children === void 0 ? [] : _ref$children,
97
+ getSwiper = _ref.getSwiper,
78
98
  onNextClick = _ref.onNextClick,
79
99
  onPrevClick = _ref.onPrevClick,
80
100
  onDotClick = _ref.onDotClick,
@@ -83,44 +103,49 @@ var Banner = function Banner(_ref) {
83
103
  _ref$pauseOnHover = _ref.pauseOnHover,
84
104
  pauseOnHover = _ref$pauseOnHover === void 0 ? false : _ref$pauseOnHover;
85
105
 
86
- var _React$useState = React.useState(),
106
+ var _React$useState = React.useState(false),
87
107
  _React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
88
- swiperInstance = _React$useState2[0],
89
- setSwiperInstance = _React$useState2[1];
108
+ isTouch = _React$useState2[0],
109
+ setTouch = _React$useState2[1];
90
110
 
91
- var _React$useState3 = React.useState(true),
111
+ var _React$useState3 = React.useState(),
92
112
  _React$useState4 = (0, _slicedToArray2["default"])(_React$useState3, 2),
93
- isBeginning = _React$useState4[0],
94
- setBeginning = _React$useState4[1];
113
+ swiperInstance = _React$useState4[0],
114
+ setSwiperInstance = _React$useState4[1];
95
115
 
96
- var _React$useState5 = React.useState(false),
116
+ var _React$useState5 = React.useState(true),
97
117
  _React$useState6 = (0, _slicedToArray2["default"])(_React$useState5, 2),
98
- isEnd = _React$useState6[0],
99
- setEnd = _React$useState6[1];
118
+ isBeginning = _React$useState6[0],
119
+ setBeginning = _React$useState6[1];
100
120
 
101
- var _React$useState7 = React.useState(autoPlay),
121
+ var _React$useState7 = React.useState(false),
102
122
  _React$useState8 = (0, _slicedToArray2["default"])(_React$useState7, 2),
103
- isAutoPlaying = _React$useState8[0],
104
- setAutoPlaying = _React$useState8[1];
123
+ isEnd = _React$useState8[0],
124
+ setEnd = _React$useState8[1];
105
125
 
106
- var _React$useState9 = React.useState(0),
126
+ var _React$useState9 = React.useState(autoPlay),
107
127
  _React$useState10 = (0, _slicedToArray2["default"])(_React$useState9, 2),
108
- activeIndex = _React$useState10[0],
109
- setActiveIndex = _React$useState10[1];
128
+ isAutoPlaying = _React$useState10[0],
129
+ setAutoPlaying = _React$useState10[1];
110
130
 
111
- var _React$useState11 = React.useState(autoPlayDelay),
131
+ var _React$useState11 = React.useState(0),
112
132
  _React$useState12 = (0, _slicedToArray2["default"])(_React$useState11, 2),
113
- delay = _React$useState12[0],
114
- setDelay = _React$useState12[1];
133
+ activeIndex = _React$useState12[0],
134
+ setActiveIndex = _React$useState12[1];
115
135
 
116
- var _React$useState13 = React.useState(false),
136
+ var _React$useState13 = React.useState(autoPlayDelay),
117
137
  _React$useState14 = (0, _slicedToArray2["default"])(_React$useState13, 2),
118
- isIncreasedDelay = _React$useState14[0],
119
- setIsIncreasedDelay = _React$useState14[1];
138
+ delay = _React$useState14[0],
139
+ setDelay = _React$useState14[1];
120
140
 
141
+ var _React$useState15 = React.useState(false),
142
+ _React$useState16 = (0, _slicedToArray2["default"])(_React$useState15, 2),
143
+ isIncreasedDelay = _React$useState16[0],
144
+ setIsIncreasedDelay = _React$useState16[1];
145
+
146
+ var isSingleSlide = React.Children.count(children) === 1;
121
147
  var showDotTimer = loop ? isAutoPlaying : isAutoPlaying && !isEnd;
122
148
  var dotTimerDelay = delay / 1000;
123
- var navArrowTheme = navTheme === NavTheme.DARK ? _NavArrow.Theme.DARK : _NavArrow.Theme.PURPLE;
124
149
  var rootRef = React.useRef(null);
125
150
  var increaseAutoplayDelay = React.useCallback(function (_ref2) {
126
151
  var params = _ref2.params,
@@ -190,6 +215,13 @@ var Banner = function Banner(_ref) {
190
215
  setActiveIndex(realIndex);
191
216
  onChange === null || onChange === void 0 ? void 0 : onChange(realIndex);
192
217
  }, [onChange]);
218
+ var handleSwiper = React.useCallback(function (swiper) {
219
+ setSwiperInstance(swiper);
220
+ getSwiper === null || getSwiper === void 0 ? void 0 : getSwiper(swiper);
221
+ }, [getSwiper]);
222
+ React.useEffect(function () {
223
+ setTouch((0, _uiHelpers.detectTouch)());
224
+ }, []);
193
225
  React.useEffect(function () {
194
226
  var rootElement = rootRef.current;
195
227
 
@@ -209,15 +241,18 @@ var Banner = function Banner(_ref) {
209
241
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
210
242
  className: cn({
211
243
  'nav-theme': navTheme,
212
- 'auto-height': autoHeight
244
+ 'auto-height': autoHeight,
245
+ 'background-color': backgroundColor,
246
+ 'no-touch': !isTouch,
247
+ radius: radius
213
248
  }, className),
214
249
  ref: rootRef
215
250
  }), /*#__PURE__*/React.createElement(_react2.Swiper, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.swiper), {
216
- className: cn('swiper'),
251
+ className: cn('swiper', [classes.swiper]),
217
252
  loop: loop,
218
253
  autoplay: autoPlay ? getAutoPlayConfig(autoPlayDelay) : false,
219
254
  watchSlidesVisibility: true,
220
- onSwiper: setSwiperInstance,
255
+ onSwiper: handleSwiper,
221
256
  onReachBeginning: handleReachBeginning,
222
257
  onReachEnd: handleReachEnd,
223
258
  onFromEdge: handleFromEdge,
@@ -225,58 +260,69 @@ var Banner = function Banner(_ref) {
225
260
  onTouchEnd: increaseAutoplayDelay
226
261
  }), React.Children.map(children, function (child, i) {
227
262
  return /*#__PURE__*/React.createElement(_react2.SwiperSlide, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.slide, i + 1), {
228
- key: i,
229
- className: cn('slide', classes === null || classes === void 0 ? void 0 : classes.slide)
230
- }), child);
231
- })), /*#__PURE__*/React.createElement(_NavArrow["default"], {
263
+ className: cn('slide', [classes.slide]),
264
+ key: i
265
+ }), /*#__PURE__*/React.isValidElement(child) && /*#__PURE__*/React.cloneElement(child, {
266
+ backgroundColor: backgroundColor,
267
+ hasBottomOffset: !isSingleSlide
268
+ }));
269
+ })), !isSingleSlide && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_NavArrow["default"], {
270
+ className: cn('arrow', {
271
+ prev: true,
272
+ theme: arrowTheme
273
+ }, [classes.arrow, classes.arrowPrev]),
232
274
  dataAttrs: {
233
275
  root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowPrev
234
276
  },
235
- className: cn('arrow', {
236
- prev: true
237
- }, [classes.arrow]),
238
277
  onClick: handlePrevClick,
239
278
  disabled: !loop && isBeginning,
240
- theme: navArrowTheme
279
+ theme: arrowTheme
241
280
  }), /*#__PURE__*/React.createElement(_NavArrow["default"], {
281
+ className: cn('arrow', {
282
+ next: true,
283
+ theme: arrowTheme
284
+ }, [classes.arrow, classes.arrowNext]),
242
285
  dataAttrs: {
243
286
  root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowNext
244
287
  },
245
- className: cn('arrow', {
246
- next: true
247
- }, [classes.arrow]),
248
288
  view: "next",
249
289
  onClick: handleNextClick,
250
290
  disabled: !loop && isEnd,
251
- theme: navArrowTheme
291
+ theme: arrowTheme
252
292
  }), /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.pagination), {
253
293
  className: cn('pagination', {
254
294
  theme: navTheme,
255
295
  'bottom-offset': withPaginationBottomOffset
256
- })
296
+ }, [classes.pagination])
257
297
  }), React.Children.map(children, function (_, i) {
258
298
  return /*#__PURE__*/React.createElement(_BannerDot["default"], {
299
+ className: cn('dot', [classes.dot]),
259
300
  dataAttrs: {
260
301
  root: (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.dot, i + 1))
261
302
  },
262
303
  key: i,
263
- className: cn('dot'),
264
304
  index: i,
265
305
  isActive: i === activeIndex,
266
306
  showTimer: showDotTimer,
267
307
  timerDelay: dotTimerDelay,
308
+ theme: navTheme,
268
309
  onClick: handleDotClick
269
310
  });
270
- })));
311
+ }))));
271
312
  };
272
313
 
273
314
  Banner.propTypes = {
274
315
  className: PropTypes.string,
275
316
  loop: PropTypes.bool,
276
317
  classes: PropTypes.shape({
277
- slide: PropTypes.string
318
+ swiper: PropTypes.string,
319
+ slide: PropTypes.string,
320
+ arrow: PropTypes.string,
321
+ arrowPrev: PropTypes.string,
322
+ arrowNext: PropTypes.string,
323
+ pagination: PropTypes.string,
324
+ dot: PropTypes.string
278
325
  }),
279
- withPaginationBottomOffset: PropTypes.bool,
280
326
  dataAttrs: PropTypes.shape({
281
327
  root: PropTypes.objectOf(PropTypes.string.isRequired),
282
328
  swiper: PropTypes.objectOf(PropTypes.string.isRequired),
@@ -286,11 +332,16 @@ Banner.propTypes = {
286
332
  pagination: PropTypes.objectOf(PropTypes.string.isRequired),
287
333
  dot: PropTypes.objectOf(PropTypes.string.isRequired)
288
334
  }),
335
+ withPaginationBottomOffset: PropTypes.bool,
289
336
  autoPlay: PropTypes.bool,
290
337
  autoPlayDelay: PropTypes.number,
291
338
  pauseOnHover: PropTypes.bool,
339
+ backgroundColor: PropTypes.oneOf(Object.values(BackgroundColor)),
340
+ radius: PropTypes.oneOf(Object.values(Radius)),
292
341
  navTheme: PropTypes.oneOf(Object.values(NavTheme)),
342
+ arrowTheme: PropTypes.oneOf(Object.values(_NavArrow.Theme)),
293
343
  autoHeight: PropTypes.bool,
344
+ getSwiper: PropTypes.func,
294
345
  onNextClick: PropTypes.func,
295
346
  onPrevClick: PropTypes.func,
296
347
  onDotClick: PropTypes.func,
@@ -1,4 +1,5 @@
1
1
  .mfui-banner-dot {
2
+ position: relative;
2
3
  display: -webkit-box;
3
4
  display: -ms-flexbox;
4
5
  display: flex;
@@ -11,60 +12,65 @@
11
12
  -webkit-box-sizing: border-box;
12
13
  box-sizing: border-box;
13
14
  padding: 2px;
14
- border-radius: 50%;
15
15
  cursor: pointer;
16
16
  }
17
17
  .mfui-banner-dot:before {
18
18
  content: '';
19
19
  display: block;
20
- width: 100%;
21
- height: 100%;
22
- border-radius: 50%;
20
+ width: 8px;
21
+ height: 8px;
22
+ border-radius: 4px;
23
23
  background-color: var(--stcWhite50);
24
24
  }
25
+ .mfui-banner-dot_theme_light.mfui-banner-dot_active:before {
26
+ background-color: var(--stcWhite);
27
+ }
28
+ .mfui-banner-dot_theme_light.mfui-banner-dot_active .mfui-banner-dot__timer-inner {
29
+ fill: var(--stcWhite);
30
+ }
31
+ .mfui-banner-dot_theme_dark.mfui-banner-dot_active:before {
32
+ background-color: var(--brandGreen);
33
+ }
34
+ .mfui-banner-dot_theme_dark.mfui-banner-dot_active .mfui-banner-dot__timer-inner {
35
+ fill: var(--brandGreen);
36
+ }
25
37
  .mfui-banner-dot_active {
26
- padding: 0;
27
38
  cursor: default;
28
39
  }
29
40
  .mfui-banner-dot_active:before {
30
- background-color: var(--stcWhite);
41
+ width: 24px;
31
42
  }
32
43
  .mfui-banner-dot_active.mfui-banner-dot_timer:before {
33
- display: none;
44
+ background-color: var(--stcWhite50);
34
45
  }
35
46
  .mfui-banner-dot__timer {
47
+ position: absolute;
36
48
  display: block;
37
- width: 100%;
38
- height: 100%;
39
- border-radius: 50%;
40
- -webkit-transform: rotate(90deg);
41
- transform: rotate(90deg);
49
+ width: 24px;
50
+ height: 8px;
51
+ border-radius: 4px;
42
52
  }
43
- .mfui-banner-dot__timer-circle {
53
+ .mfui-banner-dot__timer-inner {
44
54
  -webkit-transform: scale(-1, 1);
45
55
  transform: scale(-1, 1);
46
56
  -webkit-transform-origin: center;
47
57
  transform-origin: center;
48
58
  -webkit-animation: timer linear;
49
59
  animation: timer linear;
50
- fill: var(--stcWhite50);
51
- stroke: var(--base);
52
- stroke-width: 100;
53
- stroke-dasharray: 1000;
54
60
  }
55
61
  @-webkit-keyframes timer {
56
62
  0% {
57
- stroke-dashoffset: -350;
63
+ width: 100%;
58
64
  }
59
65
  100% {
60
- stroke-dashoffset: 0;
66
+ width: 0;
61
67
  }
62
68
  }
63
69
  @keyframes timer {
64
70
  0% {
65
- stroke-dashoffset: -350;
71
+ width: 100%;
66
72
  }
67
73
  100% {
68
- stroke-dashoffset: 0;
74
+ width: 0;
69
75
  }
70
76
  }
@@ -1,15 +1,22 @@
1
1
  import * as React from 'react';
2
2
  import './BannerDot.less';
3
+ export declare const BannerDotTheme: {
4
+ readonly LIGHT: "light";
5
+ readonly DARK: "dark";
6
+ };
7
+ declare type BannerDotThemeType = typeof BannerDotTheme[keyof typeof BannerDotTheme];
3
8
  export interface IBannerDotProps {
4
9
  className?: string;
5
10
  index: number;
6
11
  isActive: boolean;
7
12
  showTimer: boolean;
8
13
  timerDelay: number;
14
+ /** Цветовая тема */
15
+ theme?: BannerDotThemeType;
9
16
  dataAttrs?: {
10
17
  root?: Record<string, string>;
11
18
  svg?: Record<string, string>;
12
- circle?: Record<string, string>;
19
+ inner?: Record<string, string>;
13
20
  };
14
21
  onClick: (index: number) => void;
15
22
  }
@@ -5,10 +5,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = void 0;
8
+ exports["default"] = exports.BannerDotTheme = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
12
+ require("core-js/modules/es.object.values.js");
13
+
12
14
  var React = _interopRequireWildcard(require("react"));
13
15
 
14
16
  var _uiHelpers = require("@megafon/ui-helpers");
@@ -21,6 +23,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
21
23
 
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
25
 
26
+ var BannerDotTheme = {
27
+ LIGHT: 'light',
28
+ DARK: 'dark'
29
+ };
30
+ exports.BannerDotTheme = BannerDotTheme;
24
31
  var cn = (0, _uiHelpers.cnCreate)('mfui-banner-dot');
25
32
 
26
33
  var BannerDot = function BannerDot(_ref) {
@@ -30,6 +37,8 @@ var BannerDot = function BannerDot(_ref) {
30
37
  isActive = _ref.isActive,
31
38
  showTimer = _ref.showTimer,
32
39
  timerDelay = _ref.timerDelay,
40
+ _ref$theme = _ref.theme,
41
+ theme = _ref$theme === void 0 ? BannerDotTheme.LIGHT : _ref$theme,
33
42
  onClick = _ref.onClick;
34
43
  var handleDotClick = React.useCallback(function () {
35
44
  onClick(index);
@@ -37,20 +46,24 @@ var BannerDot = function BannerDot(_ref) {
37
46
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
38
47
  className: cn({
39
48
  active: isActive,
40
- timer: showTimer
49
+ timer: showTimer,
50
+ theme: theme
41
51
  }, className),
42
52
  onClick: handleDotClick
43
53
  }), showTimer && isActive && /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
44
54
  className: cn('timer'),
45
- viewBox: "0 0 100 100"
46
- }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.svg)), /*#__PURE__*/React.createElement("circle", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.circle), {
47
- className: cn('timer-circle'),
55
+ viewBox: "0 0 300 100"
56
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.svg)), /*#__PURE__*/React.createElement("rect", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.inner), {
57
+ className: cn('timer-inner'),
48
58
  style: {
49
59
  animationDuration: "".concat(timerDelay, "s")
50
60
  },
51
- cx: "50",
52
- cy: "50",
53
- r: "50"
61
+ x: "0",
62
+ y: "0",
63
+ width: "300",
64
+ height: "100",
65
+ rx: "50",
66
+ ry: "50"
54
67
  }))));
55
68
  };
56
69
 
@@ -59,12 +72,13 @@ BannerDot.propTypes = {
59
72
  dataAttrs: PropTypes.shape({
60
73
  root: PropTypes.objectOf(PropTypes.string.isRequired),
61
74
  svg: PropTypes.objectOf(PropTypes.string.isRequired),
62
- circle: PropTypes.objectOf(PropTypes.string.isRequired)
75
+ inner: PropTypes.objectOf(PropTypes.string.isRequired)
63
76
  }),
64
77
  index: PropTypes.number.isRequired,
65
78
  isActive: PropTypes.bool.isRequired,
66
79
  showTimer: PropTypes.bool.isRequired,
67
80
  timerDelay: PropTypes.number.isRequired,
81
+ theme: PropTypes.oneOf(Object.values(BannerDotTheme)),
68
82
  onClick: PropTypes.func.isRequired
69
83
  };
70
84
  var _default = BannerDot;
@@ -736,6 +736,12 @@
736
736
  display: block;
737
737
  width: 100%;
738
738
  }
739
+ @media screen and (max-width: 767px) {
740
+ .mfui-button_full-width-mobile {
741
+ display: block;
742
+ width: 100%;
743
+ }
744
+ }
739
745
  .mfui-button.mfui-button_type_primary.mfui-button_disabled,
740
746
  .mfui-button.mfui-button_no-touch.mfui-button_type_primary.mfui-button_disabled,
741
747
  .mfui-button.mfui-button_no-touch.mfui-button_type_primary.mfui-button_disabled:hover,
@@ -70,6 +70,8 @@ export interface IButtonProps {
70
70
  sizeMobile?: ButtonSizesType;
71
71
  /** Растянуть на полную ширину контейнера */
72
72
  fullWidth?: boolean;
73
+ /** Растянуть на полную ширину контейнера на разрешении экрана 0-767 */
74
+ fullWidthMobile?: boolean;
73
75
  /** Показать загрузку */
74
76
  showLoader?: boolean;
75
77
  /** Показать стелку */
@@ -104,6 +104,8 @@ var Button = function Button(_ref) {
104
104
  sizeMobile = _ref.sizeMobile,
105
105
  _ref$fullWidth = _ref.fullWidth,
106
106
  fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
107
+ _ref$fullWidthMobile = _ref.fullWidthMobile,
108
+ fullWidthMobile = _ref$fullWidthMobile === void 0 ? false : _ref$fullWidthMobile,
107
109
  _ref$showLoader = _ref.showLoader,
108
110
  showLoader = _ref$showLoader === void 0 ? false : _ref$showLoader,
109
111
  _ref$showArrow = _ref.showArrow,
@@ -238,6 +240,7 @@ var Button = function Button(_ref) {
238
240
  'size-tablet': sizeTablet,
239
241
  'size-mobile': sizeMobile,
240
242
  'full-width': fullWidth,
243
+ 'full-width-mobile': fullWidthMobile,
241
244
  loading: showLoader,
242
245
  'no-touch': !isTouch,
243
246
  'content-type': contentType,
@@ -283,6 +286,7 @@ Button.propTypes = {
283
286
  sizeTablet: _propTypes["default"].oneOf(Object.values(ButtonSizes)),
284
287
  sizeMobile: _propTypes["default"].oneOf(Object.values(ButtonSizes)),
285
288
  fullWidth: _propTypes["default"].bool,
289
+ fullWidthMobile: _propTypes["default"].bool,
286
290
  showLoader: _propTypes["default"].bool,
287
291
  showArrow: _propTypes["default"].bool,
288
292
  icon: _propTypes["default"].element,
@@ -48,9 +48,15 @@
48
48
  }
49
49
  .mfui-content-view__title {
50
50
  font-weight: 500;
51
- font-size: 20px;
52
- line-height: 28px;
53
- letter-spacing: 0.5px;
51
+ font-size: 18px;
52
+ line-height: 24px;
53
+ }
54
+ @media screen and (min-width: 768px) {
55
+ .mfui-content-view__title {
56
+ font-size: 20px;
57
+ line-height: 28px;
58
+ letter-spacing: 0.5px;
59
+ }
54
60
  }
55
61
  .mfui-content-view__text {
56
62
  font-size: 15px;
@@ -93,6 +99,5 @@
93
99
  }
94
100
  .mfui-content-view_fullscreen .mfui-content-view__buttons {
95
101
  margin-top: auto;
96
- padding-top: 24px;
97
102
  padding-bottom: 24px;
98
103
  }
@@ -13,6 +13,12 @@ declare type ElementType = {
13
13
  export interface IContentViewProps {
14
14
  /** Дополнительный класс корневого элемента */
15
15
  className?: string;
16
+ /** Дополнительные классы для внутренних элементов */
17
+ classes?: {
18
+ title?: string;
19
+ button?: string;
20
+ link?: string;
21
+ };
16
22
  /** Заголовок */
17
23
  title: string;
18
24
  /** Тип встроенного изображения */
@@ -29,6 +29,8 @@ var cn = (0, _uiHelpers.cnCreate)('mfui-content-view');
29
29
 
30
30
  var ContentView = function ContentView(_ref) {
31
31
  var className = _ref.className,
32
+ _ref$classes = _ref.classes,
33
+ classes = _ref$classes === void 0 ? {} : _ref$classes,
32
34
  title = _ref.title,
33
35
  type = _ref.type,
34
36
  _ref$alt = _ref.alt,
@@ -55,12 +57,13 @@ var ContentView = function ContentView(_ref) {
55
57
  src: src,
56
58
  alt: alt
57
59
  }), /*#__PURE__*/React.createElement("div", {
58
- className: cn('title')
60
+ className: cn('title', [classes.title])
59
61
  }, title), !!children && /*#__PURE__*/React.createElement("div", {
60
62
  className: cn('text')
61
63
  }, children)), showButtons && /*#__PURE__*/React.createElement("div", {
62
64
  className: cn('buttons')
63
65
  }, !!(buttonParams === null || buttonParams === void 0 ? void 0 : buttonParams.text) && /*#__PURE__*/React.createElement(_Button["default"], {
66
+ className: cn('button', [classes.button]),
64
67
  href: buttonParams.href,
65
68
  target: buttonParams.target,
66
69
  onClick: buttonParams.onClick,
@@ -68,6 +71,7 @@ var ContentView = function ContentView(_ref) {
68
71
  root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
69
72
  }
70
73
  }, buttonParams.text), !!(linkParams === null || linkParams === void 0 ? void 0 : linkParams.text) && /*#__PURE__*/React.createElement(_Button["default"], {
74
+ className: cn('link', [classes.link]),
71
75
  type: "text",
72
76
  href: linkParams.href,
73
77
  target: linkParams.target,
@@ -45,3 +45,19 @@
45
45
  .mfui-nav-arrow_theme_dark:active {
46
46
  background-color: var(--buttonDown);
47
47
  }
48
+ .mfui-nav-arrow_theme_white {
49
+ background-color: var(--stcWhite);
50
+ -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
51
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
52
+ }
53
+ .mfui-nav-arrow_theme_white:hover {
54
+ -webkit-box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.1);
55
+ box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.1);
56
+ }
57
+ .mfui-nav-arrow_theme_white:active {
58
+ -webkit-box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.16);
59
+ box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.16);
60
+ }
61
+ .mfui-nav-arrow_theme_white .mfui-nav-arrow__icon {
62
+ fill: var(--stcBlack);
63
+ }
@@ -3,12 +3,13 @@ import './NavArrow.less';
3
3
  export declare const Theme: {
4
4
  readonly PURPLE: "purple";
5
5
  readonly DARK: "dark";
6
+ readonly WHITE: "white";
6
7
  };
7
8
  export declare const View: {
8
9
  readonly PREV: "prev";
9
10
  readonly NEXT: "next";
10
11
  };
11
- declare type ThemeType = typeof Theme[keyof typeof Theme];
12
+ export declare type ThemeType = typeof Theme[keyof typeof Theme];
12
13
  declare type ViewType = typeof View[keyof typeof View];
13
14
  export interface INavArrowProps {
14
15
  dataAttrs?: {