@megafon/ui-core 5.16.0 → 5.17.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 (54) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/es/components/Banner/Banner.css +43 -32
  3. package/dist/es/components/Banner/Banner.d.ts +8 -3
  4. package/dist/es/components/Banner/Banner.js +62 -44
  5. package/dist/es/components/Banner/BannerDot.css +9 -16
  6. package/dist/es/components/Banner/BannerDot.d.ts +0 -7
  7. package/dist/es/components/Banner/BannerDot.js +5 -14
  8. package/dist/es/components/Banner/slidesSettings.d.ts +5 -0
  9. package/dist/es/components/Banner/slidesSettings.js +13 -0
  10. package/dist/es/components/Button/Button.css +3 -0
  11. package/dist/es/components/ListData/ListData.css +162 -0
  12. package/dist/es/components/ListData/ListData.d.ts +94 -0
  13. package/dist/es/components/ListData/ListData.js +203 -0
  14. package/dist/es/components/ListData/ListDataGroup.css +15 -0
  15. package/dist/es/components/ListData/ListDataGroup.d.ts +46 -0
  16. package/dist/es/components/ListData/ListDataGroup.js +195 -0
  17. package/dist/es/components/ListData/components/ListDataSortable.css +79 -0
  18. package/dist/es/components/ListData/components/ListDataSortable.d.ts +34 -0
  19. package/dist/es/components/ListData/components/ListDataSortable.js +102 -0
  20. package/dist/es/components/ListData/doc/i/img.png +0 -0
  21. package/dist/es/components/ListData/helpers.d.ts +6 -0
  22. package/dist/es/components/ListData/helpers.js +40 -0
  23. package/dist/es/components/Search/Search.d.ts +1 -0
  24. package/dist/es/components/Search/Search.js +2 -2
  25. package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.css +1 -1
  26. package/dist/es/index.d.ts +4 -0
  27. package/dist/es/index.js +4 -0
  28. package/dist/lib/components/Banner/Banner.css +43 -32
  29. package/dist/lib/components/Banner/Banner.d.ts +8 -3
  30. package/dist/lib/components/Banner/Banner.js +63 -44
  31. package/dist/lib/components/Banner/BannerDot.css +9 -16
  32. package/dist/lib/components/Banner/BannerDot.d.ts +0 -7
  33. package/dist/lib/components/Banner/BannerDot.js +6 -17
  34. package/dist/lib/components/Banner/slidesSettings.d.ts +5 -0
  35. package/dist/lib/components/Banner/slidesSettings.js +24 -0
  36. package/dist/lib/components/Button/Button.css +3 -0
  37. package/dist/lib/components/ListData/ListData.css +162 -0
  38. package/dist/lib/components/ListData/ListData.d.ts +94 -0
  39. package/dist/lib/components/ListData/ListData.js +229 -0
  40. package/dist/lib/components/ListData/ListDataGroup.css +15 -0
  41. package/dist/lib/components/ListData/ListDataGroup.d.ts +46 -0
  42. package/dist/lib/components/ListData/ListDataGroup.js +229 -0
  43. package/dist/lib/components/ListData/components/ListDataSortable.css +79 -0
  44. package/dist/lib/components/ListData/components/ListDataSortable.d.ts +34 -0
  45. package/dist/lib/components/ListData/components/ListDataSortable.js +129 -0
  46. package/dist/lib/components/ListData/doc/i/img.png +0 -0
  47. package/dist/lib/components/ListData/helpers.d.ts +6 -0
  48. package/dist/lib/components/ListData/helpers.js +58 -0
  49. package/dist/lib/components/Search/Search.d.ts +1 -0
  50. package/dist/lib/components/Search/Search.js +2 -2
  51. package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.css +1 -1
  52. package/dist/lib/index.d.ts +4 -0
  53. package/dist/lib/index.js +32 -0
  54. package/package.json +4 -2
@@ -24,8 +24,6 @@ declare type NavThemeType = typeof NavTheme[keyof typeof NavTheme];
24
24
  export interface IBannerProps {
25
25
  /** Сss класс для внешнего контейнера */
26
26
  className?: string;
27
- /** Прокрутка с зацикливанием */
28
- loop?: boolean;
29
27
  /** Дополнительные классы для корневого и внутренних элементов */
30
28
  classes?: {
31
29
  swiper?: string;
@@ -35,6 +33,7 @@ export interface IBannerProps {
35
33
  arrowNext?: string;
36
34
  pagination?: string;
37
35
  dot?: string;
36
+ noSwiping?: string;
38
37
  };
39
38
  /** Дополнительные data атрибуты к внутренним элементам */
40
39
  dataAttrs?: {
@@ -52,18 +51,24 @@ export interface IBannerProps {
52
51
  autoPlay?: boolean;
53
52
  /** Задержка автоматической прокрутки */
54
53
  autoPlayDelay?: number;
54
+ /** Прокрутка с зацикливанием */
55
+ loop?: boolean;
55
56
  /** Пауза автоматической прокрутки при наведении курсора на компонент */
56
57
  pauseOnHover?: boolean;
57
58
  /** Фоновый цвет */
58
59
  backgroundColor?: BackgroundColorType;
59
60
  /** Радиус границы */
60
61
  radius?: RadiusType;
61
- /** Цветовая тема навигации */
62
+ /** Цветовая тема навигации (не используется) */
62
63
  navTheme?: NavThemeType;
63
64
  /** Цветовая тема стрелок */
64
65
  arrowTheme?: ArrowThemeType;
65
66
  /** Автоматическая высота слайдов */
66
67
  autoHeight?: boolean;
68
+ /** Не увеличивать время прокрутки при взаимодействии с баннером */
69
+ noIncreaseAutoplayDelay?: boolean;
70
+ /** Показать часть следующего слайда */
71
+ showNextSlide?: boolean;
67
72
  /** Ref на swiper */
68
73
  getSwiper?: (instance: SwiperCore) => void;
69
74
  /** Обработчик клика по стрелке "вперед" (должен быть обернут в useCallback) */
@@ -31,6 +31,8 @@ var _NavArrow = _interopRequireWildcard(require("../NavArrow/NavArrow"));
31
31
 
32
32
  var _BannerDot = _interopRequireDefault(require("./BannerDot"));
33
33
 
34
+ var _slidesSettings = _interopRequireDefault(require("./slidesSettings"));
35
+
34
36
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
37
 
36
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
@@ -74,6 +76,7 @@ var Banner = function Banner(_ref) {
74
76
  var className = _ref.className,
75
77
  _ref$classes = _ref.classes,
76
78
  classes = _ref$classes === void 0 ? {} : _ref$classes,
79
+ dataAttrs = _ref.dataAttrs,
77
80
  _ref$withPaginationBo = _ref.withPaginationBottomOffset,
78
81
  withPaginationBottomOffset = _ref$withPaginationBo === void 0 ? false : _ref$withPaginationBo,
79
82
  _ref$autoPlay = _ref.autoPlay,
@@ -82,26 +85,25 @@ var Banner = function Banner(_ref) {
82
85
  autoPlayDelay = _ref$autoPlayDelay === void 0 ? 5000 : _ref$autoPlayDelay,
83
86
  _ref$loop = _ref.loop,
84
87
  loop = _ref$loop === void 0 ? false : _ref$loop,
85
- _ref$navTheme = _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,
88
+ _ref$pauseOnHover = _ref.pauseOnHover,
89
+ pauseOnHover = _ref$pauseOnHover === void 0 ? false : _ref$pauseOnHover,
89
90
  _ref$backgroundColor = _ref.backgroundColor,
90
91
  backgroundColor = _ref$backgroundColor === void 0 ? BackgroundColor.TRANSPARENT : _ref$backgroundColor,
91
92
  _ref$radius = _ref.radius,
92
93
  radius = _ref$radius === void 0 ? Radius.ROUNDED : _ref$radius,
94
+ _ref$arrowTheme = _ref.arrowTheme,
95
+ arrowTheme = _ref$arrowTheme === void 0 ? _NavArrow.Theme.DARK : _ref$arrowTheme,
93
96
  _ref$autoHeight = _ref.autoHeight,
94
97
  autoHeight = _ref$autoHeight === void 0 ? false : _ref$autoHeight,
98
+ noIncreaseAutoplayDelay = _ref.noIncreaseAutoplayDelay,
99
+ showNextSlide = _ref.showNextSlide,
95
100
  _ref$children = _ref.children,
96
101
  children = _ref$children === void 0 ? [] : _ref$children,
97
102
  getSwiper = _ref.getSwiper,
98
103
  onNextClick = _ref.onNextClick,
99
104
  onPrevClick = _ref.onPrevClick,
100
105
  onDotClick = _ref.onDotClick,
101
- onChange = _ref.onChange,
102
- dataAttrs = _ref.dataAttrs,
103
- _ref$pauseOnHover = _ref.pauseOnHover,
104
- pauseOnHover = _ref$pauseOnHover === void 0 ? false : _ref$pauseOnHover;
106
+ onChange = _ref.onChange;
105
107
 
106
108
  var _React$useState = React.useState(false),
107
109
  _React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
@@ -151,7 +153,7 @@ var Banner = function Banner(_ref) {
151
153
  var params = _ref2.params,
152
154
  autoplay = _ref2.autoplay;
153
155
 
154
- if ((0, _typeof2["default"])(params.autoplay) !== 'object' || !autoPlay) {
156
+ if ((0, _typeof2["default"])(params.autoplay) !== 'object' || !autoPlay || noIncreaseAutoplayDelay) {
155
157
  return;
156
158
  }
157
159
 
@@ -161,7 +163,7 @@ var Banner = function Banner(_ref) {
161
163
  setDelay(autoPlayDelay * 3);
162
164
  setIsIncreasedDelay(true);
163
165
  autoplay.start();
164
- }, [autoPlay, autoPlayDelay]);
166
+ }, [autoPlay, autoPlayDelay, noIncreaseAutoplayDelay]);
165
167
  var handlePrevClick = React.useCallback(function () {
166
168
  if (!swiperInstance) {
167
169
  return;
@@ -238,34 +240,17 @@ var Banner = function Banner(_ref) {
238
240
  setAutoPlaying(true);
239
241
  });
240
242
  }, [autoPlay, pauseOnHover, swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay]);
241
- return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
242
- className: cn({
243
- 'nav-theme': navTheme,
244
- 'auto-height': autoHeight,
245
- 'background-color': backgroundColor,
246
- 'no-touch': !isTouch,
247
- radius: radius
248
- }, className),
249
- ref: rootRef
250
- }), /*#__PURE__*/React.createElement(_react2.Swiper, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.swiper), {
251
- className: cn('swiper', [classes.swiper]),
252
- loop: loop,
253
- autoplay: autoPlay ? getAutoPlayConfig(autoPlayDelay) : false,
254
- watchSlidesVisibility: true,
255
- onSwiper: handleSwiper,
256
- onReachBeginning: handleReachBeginning,
257
- onReachEnd: handleReachEnd,
258
- onFromEdge: handleFromEdge,
259
- onSlideChange: handleSlideChange,
260
- onTouchEnd: increaseAutoplayDelay
261
- }), React.Children.map(children, function (child, i) {
262
- return /*#__PURE__*/React.createElement(_react2.SwiperSlide, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.slide, i + 1), {
263
- className: cn('slide', [classes.slide]),
264
- key: i
265
- }), /*#__PURE__*/React.isValidElement(child) && /*#__PURE__*/React.cloneElement(child, {
266
- hasBottomOffset: !isSingleSlide
267
- }));
268
- })), !isSingleSlide && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_NavArrow["default"], {
243
+ React.useEffect(function () {
244
+ setAutoPlaying(autoPlay);
245
+
246
+ if (autoPlay) {
247
+ swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay.start();
248
+ return;
249
+ }
250
+
251
+ swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay.stop();
252
+ }, [autoPlay, swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay]);
253
+ var renderNavArrows = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_NavArrow["default"], {
269
254
  className: cn('arrow', {
270
255
  prev: true,
271
256
  theme: arrowTheme
@@ -288,9 +273,9 @@ var Banner = function Banner(_ref) {
288
273
  onClick: handleNextClick,
289
274
  disabled: !loop && isEnd,
290
275
  theme: arrowTheme
291
- }), /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.pagination), {
276
+ }));
277
+ var renderPagination = /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.pagination), {
292
278
  className: cn('pagination', {
293
- theme: navTheme,
294
279
  'bottom-offset': withPaginationBottomOffset
295
280
  }, [classes.pagination])
296
281
  }), React.Children.map(children, function (_, i) {
@@ -304,15 +289,45 @@ var Banner = function Banner(_ref) {
304
289
  isActive: i === activeIndex,
305
290
  showTimer: showDotTimer,
306
291
  timerDelay: dotTimerDelay,
307
- theme: navTheme,
308
292
  onClick: handleDotClick
309
293
  });
310
- }))));
294
+ }));
295
+ return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
296
+ className: cn({
297
+ 'auto-height': autoHeight,
298
+ 'background-color': backgroundColor,
299
+ 'no-touch': !isTouch,
300
+ radius: radius,
301
+ 'show-next-slide': showNextSlide
302
+ }, className),
303
+ ref: rootRef
304
+ }), /*#__PURE__*/React.createElement("div", {
305
+ className: cn('swiper-container')
306
+ }, /*#__PURE__*/React.createElement(_react2.Swiper, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.swiper), {
307
+ className: cn('swiper', [classes.swiper]),
308
+ loop: loop,
309
+ autoplay: autoPlay ? getAutoPlayConfig(autoPlayDelay) : false,
310
+ watchSlidesVisibility: true,
311
+ noSwipingClass: classes.noSwiping,
312
+ breakpoints: showNextSlide ? _slidesSettings["default"] : undefined,
313
+ onSwiper: handleSwiper,
314
+ onReachBeginning: handleReachBeginning,
315
+ onReachEnd: handleReachEnd,
316
+ onFromEdge: handleFromEdge,
317
+ onSlideChange: handleSlideChange,
318
+ onTouchEnd: increaseAutoplayDelay
319
+ }), React.Children.map(children, function (child, i) {
320
+ return /*#__PURE__*/React.createElement(_react2.SwiperSlide, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.slide, i + 1), {
321
+ className: cn('slide', [classes.slide]),
322
+ key: i
323
+ }), /*#__PURE__*/React.isValidElement(child) && /*#__PURE__*/React.cloneElement(child, {
324
+ className: cn('slide-content', [child === null || child === void 0 ? void 0 : child.props.className])
325
+ }));
326
+ })), !isSingleSlide && renderNavArrows), !isSingleSlide && renderPagination);
311
327
  };
312
328
 
313
329
  Banner.propTypes = {
314
330
  className: PropTypes.string,
315
- loop: PropTypes.bool,
316
331
  classes: PropTypes.shape({
317
332
  swiper: PropTypes.string,
318
333
  slide: PropTypes.string,
@@ -320,7 +335,8 @@ Banner.propTypes = {
320
335
  arrowPrev: PropTypes.string,
321
336
  arrowNext: PropTypes.string,
322
337
  pagination: PropTypes.string,
323
- dot: PropTypes.string
338
+ dot: PropTypes.string,
339
+ noSwiping: PropTypes.string
324
340
  }),
325
341
  dataAttrs: PropTypes.shape({
326
342
  root: PropTypes.objectOf(PropTypes.string.isRequired),
@@ -334,12 +350,15 @@ Banner.propTypes = {
334
350
  withPaginationBottomOffset: PropTypes.bool,
335
351
  autoPlay: PropTypes.bool,
336
352
  autoPlayDelay: PropTypes.number,
353
+ loop: PropTypes.bool,
337
354
  pauseOnHover: PropTypes.bool,
338
355
  backgroundColor: PropTypes.oneOf(Object.values(BackgroundColor)),
339
356
  radius: PropTypes.oneOf(Object.values(Radius)),
340
357
  navTheme: PropTypes.oneOf(Object.values(NavTheme)),
341
358
  arrowTheme: PropTypes.oneOf(Object.values(_NavArrow.Theme)),
342
359
  autoHeight: PropTypes.bool,
360
+ noIncreaseAutoplayDelay: PropTypes.bool,
361
+ showNextSlide: PropTypes.bool,
343
362
  getSwiper: PropTypes.func,
344
363
  onNextClick: PropTypes.func,
345
364
  onPrevClick: PropTypes.func,
@@ -11,6 +11,7 @@
11
11
  justify-content: center;
12
12
  -webkit-box-sizing: border-box;
13
13
  box-sizing: border-box;
14
+ margin: -2px;
14
15
  padding: 2px;
15
16
  cursor: pointer;
16
17
  }
@@ -20,33 +21,25 @@
20
21
  width: 8px;
21
22
  height: 8px;
22
23
  border-radius: 4px;
23
- background-color: var(--stcWhite50);
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);
24
+ background-color: var(--spbSky2);
36
25
  }
37
26
  .mfui-banner-dot_active {
38
27
  cursor: default;
39
28
  }
40
29
  .mfui-banner-dot_active:before {
41
- width: 24px;
30
+ width: 20px;
31
+ background-color: var(--brandGreen);
32
+ }
33
+ .mfui-banner-dot_active .mfui-banner-dot__timer-inner {
34
+ fill: var(--brandGreen);
42
35
  }
43
36
  .mfui-banner-dot_active.mfui-banner-dot_timer:before {
44
- background-color: var(--stcWhite50);
37
+ background-color: var(--spbSky2);
45
38
  }
46
39
  .mfui-banner-dot__timer {
47
40
  position: absolute;
48
41
  display: block;
49
- width: 24px;
42
+ width: 20px;
50
43
  height: 8px;
51
44
  border-radius: 4px;
52
45
  }
@@ -1,18 +1,11 @@
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];
8
3
  export interface IBannerDotProps {
9
4
  className?: string;
10
5
  index: number;
11
6
  isActive: boolean;
12
7
  showTimer: boolean;
13
8
  timerDelay: number;
14
- /** Цветовая тема */
15
- theme?: BannerDotThemeType;
16
9
  dataAttrs?: {
17
10
  root?: Record<string, string>;
18
11
  svg?: Record<string, string>;
@@ -5,12 +5,10 @@ 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"] = exports.BannerDotTheme = void 0;
8
+ exports["default"] = 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
-
14
12
  var React = _interopRequireWildcard(require("react"));
15
13
 
16
14
  var _uiHelpers = require("@megafon/ui-helpers");
@@ -23,11 +21,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
23
21
 
24
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
23
 
26
- var BannerDotTheme = {
27
- LIGHT: 'light',
28
- DARK: 'dark'
29
- };
30
- exports.BannerDotTheme = BannerDotTheme;
31
24
  var cn = (0, _uiHelpers.cnCreate)('mfui-banner-dot');
32
25
 
33
26
  var BannerDot = function BannerDot(_ref) {
@@ -37,8 +30,6 @@ var BannerDot = function BannerDot(_ref) {
37
30
  isActive = _ref.isActive,
38
31
  showTimer = _ref.showTimer,
39
32
  timerDelay = _ref.timerDelay,
40
- _ref$theme = _ref.theme,
41
- theme = _ref$theme === void 0 ? BannerDotTheme.LIGHT : _ref$theme,
42
33
  onClick = _ref.onClick;
43
34
  var handleDotClick = React.useCallback(function () {
44
35
  onClick(index);
@@ -46,21 +37,20 @@ var BannerDot = function BannerDot(_ref) {
46
37
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
47
38
  className: cn({
48
39
  active: isActive,
49
- timer: showTimer,
50
- theme: theme
40
+ timer: showTimer
51
41
  }, className),
52
42
  onClick: handleDotClick
53
- }), showTimer && isActive && /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
43
+ }), showTimer && isActive && /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.svg), {
54
44
  className: cn('timer'),
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), {
45
+ viewBox: "0 0 250 100"
46
+ }), /*#__PURE__*/React.createElement("rect", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.inner), {
57
47
  className: cn('timer-inner'),
58
48
  style: {
59
49
  animationDuration: "".concat(timerDelay, "s")
60
50
  },
61
51
  x: "0",
62
52
  y: "0",
63
- width: "300",
53
+ width: "250",
64
54
  height: "100",
65
55
  rx: "50",
66
56
  ry: "50"
@@ -78,7 +68,6 @@ BannerDot.propTypes = {
78
68
  isActive: PropTypes.bool.isRequired,
79
69
  showTimer: PropTypes.bool.isRequired,
80
70
  timerDelay: PropTypes.number.isRequired,
81
- theme: PropTypes.oneOf(Object.values(BannerDotTheme)),
82
71
  onClick: PropTypes.func.isRequired
83
72
  };
84
73
  var _default = BannerDot;
@@ -0,0 +1,5 @@
1
+ import type { SwiperOptions } from 'swiper';
2
+ declare const SLIDES_SETTINGS: {
3
+ [width: number]: SwiperOptions;
4
+ };
5
+ export default SLIDES_SETTINGS;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+
10
+ var _uiHelpers = require("@megafon/ui-helpers");
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
+
14
+ var _SLIDES_SETTINGS;
15
+
16
+ var SLIDES_SETTINGS = (_SLIDES_SETTINGS = {}, (0, _defineProperty2["default"])(_SLIDES_SETTINGS, _uiHelpers.breakpoints.MOBILE_SMALL_START, {
17
+ slidesPerView: 1,
18
+ spaceBetween: 16
19
+ }), (0, _defineProperty2["default"])(_SLIDES_SETTINGS, _uiHelpers.breakpoints.MOBILE_BIG_START, {
20
+ slidesPerView: 1,
21
+ spaceBetween: 0
22
+ }), _SLIDES_SETTINGS);
23
+ var _default = SLIDES_SETTINGS;
24
+ exports["default"] = _default;
@@ -447,6 +447,9 @@
447
447
  .mfui-button_content-type_icon-text .mfui-button__icon {
448
448
  margin-right: 4px;
449
449
  }
450
+ .mfui-button_content-type_icon-text:not(.mfui-button_type_text) .mfui-button__text {
451
+ margin-right: 4px;
452
+ }
450
453
  .mfui-button_type_text.mfui-button_theme_green {
451
454
  width: -webkit-fit-content;
452
455
  width: -moz-fit-content;
@@ -0,0 +1,162 @@
1
+ .mfui-list-data {
2
+ position: relative;
3
+ display: -webkit-box;
4
+ display: -ms-flexbox;
5
+ display: flex;
6
+ -webkit-box-align: center;
7
+ -ms-flex-align: center;
8
+ align-items: center;
9
+ -webkit-box-sizing: border-box;
10
+ box-sizing: border-box;
11
+ width: 100%;
12
+ height: -webkit-fit-content;
13
+ height: -moz-fit-content;
14
+ height: fit-content;
15
+ padding: 8px 16px 8px 12px;
16
+ border: none;
17
+ color: var(--content);
18
+ text-decoration: none;
19
+ background-color: transparent;
20
+ -webkit-transition: background-color, opacity;
21
+ transition: background-color, opacity;
22
+ -webkit-transition-duration: 0.3s;
23
+ transition-duration: 0.3s;
24
+ }
25
+ .mfui-list-data__icon-container {
26
+ display: -webkit-box;
27
+ display: -ms-flexbox;
28
+ display: flex;
29
+ -ms-flex-negative: 0;
30
+ flex-shrink: 0;
31
+ -webkit-box-align: center;
32
+ -ms-flex-align: center;
33
+ align-items: center;
34
+ -webkit-box-pack: center;
35
+ -ms-flex-pack: center;
36
+ justify-content: center;
37
+ width: 40px;
38
+ height: 40px;
39
+ margin-right: 8px;
40
+ }
41
+ .mfui-list-data__icon-container svg {
42
+ fill: var(--content);
43
+ }
44
+ .mfui-list-data__icon-container_colored {
45
+ border-radius: 50%;
46
+ background-color: var(--brandGreen20);
47
+ }
48
+ .mfui-list-data__icon-container_colored svg {
49
+ fill: var(--brandGreen);
50
+ }
51
+ .mfui-list-data__icon {
52
+ width: 32px;
53
+ min-width: 32px;
54
+ height: 32px;
55
+ }
56
+ .mfui-list-data__icon_small {
57
+ width: 20px;
58
+ min-width: 20px;
59
+ height: 20px;
60
+ }
61
+ .mfui-list-data__header {
62
+ display: grid;
63
+ grid-template-columns: 100%;
64
+ margin-right: auto;
65
+ padding-left: 4px;
66
+ }
67
+ .mfui-list-data__header_gap {
68
+ padding-right: 8px;
69
+ }
70
+ .mfui-list-data__header_align {
71
+ -ms-flex-item-align: end;
72
+ align-self: flex-end;
73
+ }
74
+ .mfui-list-data__title {
75
+ font-size: 15px;
76
+ line-height: 24px;
77
+ /* stylelint-disable-next-line value-no-vendor-prefix */
78
+ display: -webkit-box;
79
+ overflow: hidden;
80
+ white-space: normal;
81
+ text-overflow: ellipsis;
82
+ -webkit-box-orient: vertical;
83
+ -webkit-line-clamp: 2;
84
+ font-weight: 500;
85
+ line-height: 18px;
86
+ }
87
+ .mfui-list-data__title-link {
88
+ color: var(--content);
89
+ }
90
+ .mfui-list-data__sub-title {
91
+ font-size: 12px;
92
+ line-height: 18px;
93
+ margin-top: 4px;
94
+ overflow: hidden;
95
+ color: var(--spbSky3);
96
+ font-weight: 400;
97
+ white-space: nowrap;
98
+ text-overflow: ellipsis;
99
+ }
100
+ .mfui-list-data__value-container {
101
+ display: grid;
102
+ grid-template-columns: -webkit-min-content;
103
+ grid-template-columns: min-content;
104
+ align-self: flex-start;
105
+ padding-left: 12px;
106
+ }
107
+ .mfui-list-data__value {
108
+ font-size: 15px;
109
+ line-height: 24px;
110
+ /* stylelint-disable-next-line value-no-vendor-prefix */
111
+ display: -webkit-box;
112
+ overflow: hidden;
113
+ white-space: normal;
114
+ text-overflow: ellipsis;
115
+ -webkit-box-orient: vertical;
116
+ -webkit-line-clamp: 2;
117
+ max-width: 110px;
118
+ line-height: 18px;
119
+ }
120
+ .mfui-list-data__value_color_green {
121
+ color: var(--brandGreen);
122
+ }
123
+ .mfui-list-data__sub-value {
124
+ font-size: 12px;
125
+ line-height: 18px;
126
+ max-width: 110px;
127
+ margin-top: 4px;
128
+ overflow: hidden;
129
+ color: var(--spbSky3);
130
+ font-weight: 400;
131
+ white-space: nowrap;
132
+ text-overflow: ellipsis;
133
+ }
134
+ .mfui-list-data__action-icon {
135
+ fill: var(--spbSky3);
136
+ }
137
+ .mfui-list-data__action-icon_active {
138
+ cursor: pointer;
139
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
140
+ -webkit-transition: fill 0.3s;
141
+ transition: fill 0.3s;
142
+ }
143
+ .mfui-list-data__action-icon_active:hover {
144
+ fill: var(--content);
145
+ }
146
+ .mfui-list-data__children_event-none {
147
+ pointer-events: none;
148
+ }
149
+ .mfui-list-data_active:not(.mfui-list-data_disabled) {
150
+ border-radius: 12px;
151
+ cursor: pointer;
152
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
153
+ }
154
+ .mfui-list-data_active:not(.mfui-list-data_disabled):hover {
155
+ background-color: var(--spbSky0);
156
+ }
157
+ .mfui-list-data_disabled {
158
+ opacity: 0.5;
159
+ }
160
+ .mfui-list-data_disabled .mfui-list-data__title-link {
161
+ pointer-events: none;
162
+ }
@@ -0,0 +1,94 @@
1
+ import React from 'react';
2
+ import * as PropTypes from 'prop-types';
3
+ import './ListData.less';
4
+ declare type Target = '_self' | '_blank' | '_parent' | '_top';
5
+ export declare type TitlePropsType = {
6
+ /** Текст заголовка */
7
+ text: string;
8
+ /** Ссылка */
9
+ href: string;
10
+ /** Атрибут ссылки target */
11
+ target?: Target;
12
+ /** Атрибут ссылки rel */
13
+ rel?: string;
14
+ };
15
+ declare const ValueColors: {
16
+ readonly DEFAULT: "default";
17
+ readonly GREEN: "green";
18
+ };
19
+ export declare type ValueColorsType = typeof ValueColors[keyof typeof ValueColors];
20
+ declare const Actions: {
21
+ readonly DELETE: "delete";
22
+ readonly CONTROL: "control";
23
+ };
24
+ export declare type ActionsType = typeof Actions[keyof typeof Actions];
25
+ export interface IListDataProps {
26
+ /** Заголовок */
27
+ title: string | TitlePropsType;
28
+ /** Подзаголовок */
29
+ subTitle?: string;
30
+ /** Значение */
31
+ value?: string;
32
+ /** Цвет */
33
+ valueColor?: ValueColorsType;
34
+ /** Дополнительное значение */
35
+ subValue?: string;
36
+ /** Иконка */
37
+ icon?: JSX.Element;
38
+ /** Фоновая заливка у иконки */
39
+ isIconColored?: boolean;
40
+ /** Аватар */
41
+ avatar?: JSX.Element;
42
+ /** Отключение компонента */
43
+ disabled?: boolean;
44
+ /** Элемент дополнительного действия */
45
+ actionType?: ActionsType;
46
+ /** Обработчик дополнительного действия */
47
+ onAction?: (e: React.SyntheticEvent<EventTarget>) => void;
48
+ /** Обработчик клика */
49
+ onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
50
+ /** Дополнительный класс корневого элемента */
51
+ className?: string;
52
+ /** Дополнительные классы для внутренних элементов */
53
+ classes?: {
54
+ root?: string;
55
+ title?: string;
56
+ subtitle?: string;
57
+ };
58
+ /** Дополнительные data атрибуты к внутренним элементам */
59
+ dataAttrs?: {
60
+ root?: Record<string, string>;
61
+ actionIcon?: Record<string, string>;
62
+ };
63
+ /** Дочерние элементы: Button, Selector */
64
+ children?: React.ReactNode;
65
+ }
66
+ declare const ListData: React.FC<IListDataProps>;
67
+ export declare const ListDataPropType: {
68
+ title: PropTypes.Validator<string | PropTypes.InferProps<{
69
+ text: PropTypes.Validator<string>;
70
+ href: PropTypes.Validator<string>;
71
+ target: PropTypes.Requireable<string>;
72
+ rel: PropTypes.Requireable<string>;
73
+ }>>;
74
+ subTitle: PropTypes.Requireable<string>;
75
+ value: PropTypes.Requireable<string>;
76
+ valueColor: PropTypes.Requireable<"default" | "green">;
77
+ subValue: PropTypes.Requireable<string>;
78
+ icon: PropTypes.Requireable<PropTypes.ReactElementLike>;
79
+ isIconColored: PropTypes.Requireable<boolean>;
80
+ avatar: PropTypes.Requireable<PropTypes.ReactElementLike>;
81
+ disabled: PropTypes.Requireable<boolean>;
82
+ actionType: PropTypes.Requireable<"delete" | "control">;
83
+ onAction: PropTypes.Requireable<(...args: any[]) => any>;
84
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
85
+ className: PropTypes.Requireable<string>;
86
+ classes: PropTypes.Requireable<{
87
+ [x: string]: string | null | undefined;
88
+ }>;
89
+ dataAttrs: PropTypes.Requireable<{
90
+ [x: string]: object | null | undefined;
91
+ }>;
92
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
93
+ };
94
+ export default ListData;