@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
package/CHANGELOG.md CHANGED
@@ -3,6 +3,26 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.17.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@5.16.0...@megafon/ui-core@5.17.0) (2024-07-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **banner:** fix banner height ([fead67b](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/fead67bcee5e1da3bb77a567952ff8514ea8a86d))
12
+ * **banner:** fix banner height ([b2315de](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/b2315de6ce1bd08dacf3f80bdf9d07a45de480b5))
13
+ * **snackbar:** timer margin ([0008718](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/0008718c43bca5efd2e08933e0c0061860ac5a14))
14
+
15
+
16
+ ### Features
17
+
18
+ * **banner, imagebanner:** update components ([c6e8d6b](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/c6e8d6bf308a6d179b768aceba23e564d17f3d64))
19
+ * **listdata:** create component ListData ([75ad1d5](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/75ad1d5476245e723a635e8d17da9ea7418657dc))
20
+ * **search:** update props data attr ([861d0f5](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/861d0f58d477c36855b8d94d3472c0c3994c4890))
21
+
22
+
23
+
24
+
25
+
6
26
  # [5.16.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@5.15.0...@megafon/ui-core@5.16.0) (2024-06-26)
7
27
 
8
28
 
@@ -6,6 +6,9 @@
6
6
  display: -ms-flexbox;
7
7
  display: flex;
8
8
  }
9
+ .mfui-banner .mfui-banner__swiper-container {
10
+ position: relative;
11
+ }
9
12
  .mfui-banner__swiper {
10
13
  overflow: hidden;
11
14
  }
@@ -24,16 +27,18 @@
24
27
  height: 400px;
25
28
  }
26
29
  }
27
- .mfui-banner_auto-height .mfui-banner__slide {
28
- height: auto;
30
+ .mfui-banner__slide-content {
31
+ margin-right: -1px;
32
+ border-right: 1px solid transparent;
29
33
  }
30
- @media screen and (min-width: 1024px) {
31
- .mfui-banner .swiper-slide-visible {
32
- opacity: 1;
33
- -webkit-transition: opacity 0.4s;
34
- transition: opacity 0.4s;
34
+ @media screen and (max-width: 1023px) {
35
+ .mfui-banner__slide-content {
36
+ height: 100%;
35
37
  }
36
38
  }
39
+ .mfui-banner_auto-height .mfui-banner__slide {
40
+ height: auto;
41
+ }
37
42
  .mfui-banner__arrow {
38
43
  position: absolute;
39
44
  top: 50%;
@@ -107,32 +112,27 @@
107
112
  scale: 1.125;
108
113
  }
109
114
  .mfui-banner__pagination {
110
- position: absolute;
111
- bottom: 24px;
112
115
  left: 50%;
113
116
  z-index: 10;
114
117
  display: -webkit-box;
115
118
  display: -ms-flexbox;
116
119
  display: flex;
117
- gap: 8px;
120
+ gap: 12px;
118
121
  -webkit-box-align: center;
119
122
  -ms-flex-align: center;
120
123
  align-items: center;
121
124
  -webkit-box-pack: center;
122
125
  -ms-flex-pack: center;
123
126
  justify-content: center;
124
- padding: 6px 10px;
125
- border-radius: 12px;
126
- -webkit-transform: translateX(-50%);
127
- transform: translateX(-50%);
128
- }
129
- @media screen and (min-width: 1024px) {
130
- .mfui-banner__pagination {
131
- bottom: 16px;
132
- }
127
+ margin-top: 32px;
133
128
  }
134
129
  .mfui-banner__pagination_bottom-offset {
130
+ position: absolute;
135
131
  bottom: 60px;
132
+ left: 50%;
133
+ z-index: 10;
134
+ -webkit-transform: translateX(-50%);
135
+ transform: translateX(-50%);
136
136
  }
137
137
  @media screen and (min-width: 768px) and (max-width: 1023px) {
138
138
  .mfui-banner__pagination_bottom-offset {
@@ -154,31 +154,42 @@
154
154
  bottom: 72px;
155
155
  }
156
156
  }
157
- .mfui-banner__pagination_theme_light {
158
- background-color: var(--stcWhite20);
157
+ .mfui-banner_radius_rounded .mfui-banner__swiper {
158
+ border-radius: 24px;
159
159
  }
160
- .mfui-banner__pagination_theme_dark {
161
- background-color: var(--stcBlack20);
160
+ @media screen and (max-width: 767px) {
161
+ .mfui-banner_show-next-slide .mfui-banner__swiper {
162
+ margin-right: -16px;
163
+ margin-left: -16px;
164
+ padding-right: 32px;
165
+ padding-left: 16px;
166
+ border-radius: 0;
167
+ }
162
168
  }
163
- .mfui-banner_radius_rounded {
164
- border-radius: 24px;
169
+ @media screen and (max-width: 767px) {
170
+ .mfui-banner_show-next-slide .mfui-banner__slide-content {
171
+ margin-right: 0;
172
+ border-right: none;
173
+ }
165
174
  }
166
- .mfui-banner_radius_rounded .mfui-banner__swiper {
167
- border-radius: 24px;
175
+ @media screen and (max-width: 767px) {
176
+ .mfui-banner_show-next-slide.mfui-banner_radius_rounded .mfui-banner__slide-content {
177
+ border-radius: 24px;
178
+ }
168
179
  }
169
- .mfui-banner_background-color_green {
180
+ .mfui-banner_background-color_green .mfui-banner__swiper {
170
181
  background-color: var(--brandGreen);
171
182
  }
172
- .mfui-banner_background-color_purple {
183
+ .mfui-banner_background-color_purple .mfui-banner__swiper {
173
184
  background-color: var(--brandPurple);
174
185
  }
175
- .mfui-banner_background-color_gradient {
186
+ .mfui-banner_background-color_gradient .mfui-banner__swiper {
176
187
  background: -webkit-gradient(linear, right top, left top, from(#ADA6BA), to(#F6F2F9));
177
188
  background: linear-gradient(270deg, #ADA6BA 0%, #F6F2F9 100%);
178
189
  }
179
- .mfui-banner_background-color_light {
190
+ .mfui-banner_background-color_light .mfui-banner__swiper {
180
191
  background-color: #F6F2F9;
181
192
  }
182
- .mfui-banner_background-color_spbSky0 {
193
+ .mfui-banner_background-color_spbSky0 .mfui-banner__swiper {
183
194
  background-color: var(--spbSky0);
184
195
  }
@@ -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) */
@@ -10,6 +10,7 @@ import SwiperCore, { Autoplay } from 'swiper';
10
10
  import { Swiper, SwiperSlide } from 'swiper/react';
11
11
  import NavArrow, { Theme as ArrowTheme } from "../NavArrow/NavArrow";
12
12
  import BannerDot from "./BannerDot";
13
+ import SLIDES_SETTINGS from "./slidesSettings";
13
14
  import "./Banner.css";
14
15
  SwiperCore.use([Autoplay]);
15
16
  export var BackgroundColor = {
@@ -44,6 +45,7 @@ var Banner = function Banner(_ref) {
44
45
  var className = _ref.className,
45
46
  _ref$classes = _ref.classes,
46
47
  classes = _ref$classes === void 0 ? {} : _ref$classes,
48
+ dataAttrs = _ref.dataAttrs,
47
49
  _ref$withPaginationBo = _ref.withPaginationBottomOffset,
48
50
  withPaginationBottomOffset = _ref$withPaginationBo === void 0 ? false : _ref$withPaginationBo,
49
51
  _ref$autoPlay = _ref.autoPlay,
@@ -52,26 +54,25 @@ var Banner = function Banner(_ref) {
52
54
  autoPlayDelay = _ref$autoPlayDelay === void 0 ? 5000 : _ref$autoPlayDelay,
53
55
  _ref$loop = _ref.loop,
54
56
  loop = _ref$loop === void 0 ? false : _ref$loop,
55
- _ref$navTheme = _ref.navTheme,
56
- navTheme = _ref$navTheme === void 0 ? NavTheme.LIGHT : _ref$navTheme,
57
- _ref$arrowTheme = _ref.arrowTheme,
58
- arrowTheme = _ref$arrowTheme === void 0 ? ArrowTheme.DARK : _ref$arrowTheme,
57
+ _ref$pauseOnHover = _ref.pauseOnHover,
58
+ pauseOnHover = _ref$pauseOnHover === void 0 ? false : _ref$pauseOnHover,
59
59
  _ref$backgroundColor = _ref.backgroundColor,
60
60
  backgroundColor = _ref$backgroundColor === void 0 ? BackgroundColor.TRANSPARENT : _ref$backgroundColor,
61
61
  _ref$radius = _ref.radius,
62
62
  radius = _ref$radius === void 0 ? Radius.ROUNDED : _ref$radius,
63
+ _ref$arrowTheme = _ref.arrowTheme,
64
+ arrowTheme = _ref$arrowTheme === void 0 ? ArrowTheme.DARK : _ref$arrowTheme,
63
65
  _ref$autoHeight = _ref.autoHeight,
64
66
  autoHeight = _ref$autoHeight === void 0 ? false : _ref$autoHeight,
67
+ noIncreaseAutoplayDelay = _ref.noIncreaseAutoplayDelay,
68
+ showNextSlide = _ref.showNextSlide,
65
69
  _ref$children = _ref.children,
66
70
  children = _ref$children === void 0 ? [] : _ref$children,
67
71
  getSwiper = _ref.getSwiper,
68
72
  onNextClick = _ref.onNextClick,
69
73
  onPrevClick = _ref.onPrevClick,
70
74
  onDotClick = _ref.onDotClick,
71
- onChange = _ref.onChange,
72
- dataAttrs = _ref.dataAttrs,
73
- _ref$pauseOnHover = _ref.pauseOnHover,
74
- pauseOnHover = _ref$pauseOnHover === void 0 ? false : _ref$pauseOnHover;
75
+ onChange = _ref.onChange;
75
76
 
76
77
  var _React$useState = React.useState(false),
77
78
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -121,7 +122,7 @@ var Banner = function Banner(_ref) {
121
122
  var params = _ref2.params,
122
123
  autoplay = _ref2.autoplay;
123
124
 
124
- if (_typeof(params.autoplay) !== 'object' || !autoPlay) {
125
+ if (_typeof(params.autoplay) !== 'object' || !autoPlay || noIncreaseAutoplayDelay) {
125
126
  return;
126
127
  }
127
128
 
@@ -131,7 +132,7 @@ var Banner = function Banner(_ref) {
131
132
  setDelay(autoPlayDelay * 3);
132
133
  setIsIncreasedDelay(true);
133
134
  autoplay.start();
134
- }, [autoPlay, autoPlayDelay]);
135
+ }, [autoPlay, autoPlayDelay, noIncreaseAutoplayDelay]);
135
136
  var handlePrevClick = React.useCallback(function () {
136
137
  if (!swiperInstance) {
137
138
  return;
@@ -208,34 +209,17 @@ var Banner = function Banner(_ref) {
208
209
  setAutoPlaying(true);
209
210
  });
210
211
  }, [autoPlay, pauseOnHover, swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay]);
211
- return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
212
- className: cn({
213
- 'nav-theme': navTheme,
214
- 'auto-height': autoHeight,
215
- 'background-color': backgroundColor,
216
- 'no-touch': !isTouch,
217
- radius: radius
218
- }, className),
219
- ref: rootRef
220
- }), /*#__PURE__*/React.createElement(Swiper, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.swiper), {
221
- className: cn('swiper', [classes.swiper]),
222
- loop: loop,
223
- autoplay: autoPlay ? getAutoPlayConfig(autoPlayDelay) : false,
224
- watchSlidesVisibility: true,
225
- onSwiper: handleSwiper,
226
- onReachBeginning: handleReachBeginning,
227
- onReachEnd: handleReachEnd,
228
- onFromEdge: handleFromEdge,
229
- onSlideChange: handleSlideChange,
230
- onTouchEnd: increaseAutoplayDelay
231
- }), React.Children.map(children, function (child, i) {
232
- return /*#__PURE__*/React.createElement(SwiperSlide, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.slide, i + 1), {
233
- className: cn('slide', [classes.slide]),
234
- key: i
235
- }), /*#__PURE__*/React.isValidElement(child) && /*#__PURE__*/React.cloneElement(child, {
236
- hasBottomOffset: !isSingleSlide
237
- }));
238
- })), !isSingleSlide && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NavArrow, {
212
+ React.useEffect(function () {
213
+ setAutoPlaying(autoPlay);
214
+
215
+ if (autoPlay) {
216
+ swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay.start();
217
+ return;
218
+ }
219
+
220
+ swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay.stop();
221
+ }, [autoPlay, swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay]);
222
+ var renderNavArrows = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NavArrow, {
239
223
  className: cn('arrow', {
240
224
  prev: true,
241
225
  theme: arrowTheme
@@ -258,9 +242,9 @@ var Banner = function Banner(_ref) {
258
242
  onClick: handleNextClick,
259
243
  disabled: !loop && isEnd,
260
244
  theme: arrowTheme
261
- }), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.pagination), {
245
+ }));
246
+ var renderPagination = /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.pagination), {
262
247
  className: cn('pagination', {
263
- theme: navTheme,
264
248
  'bottom-offset': withPaginationBottomOffset
265
249
  }, [classes.pagination])
266
250
  }), React.Children.map(children, function (_, i) {
@@ -274,15 +258,45 @@ var Banner = function Banner(_ref) {
274
258
  isActive: i === activeIndex,
275
259
  showTimer: showDotTimer,
276
260
  timerDelay: dotTimerDelay,
277
- theme: navTheme,
278
261
  onClick: handleDotClick
279
262
  });
280
- }))));
263
+ }));
264
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
265
+ className: cn({
266
+ 'auto-height': autoHeight,
267
+ 'background-color': backgroundColor,
268
+ 'no-touch': !isTouch,
269
+ radius: radius,
270
+ 'show-next-slide': showNextSlide
271
+ }, className),
272
+ ref: rootRef
273
+ }), /*#__PURE__*/React.createElement("div", {
274
+ className: cn('swiper-container')
275
+ }, /*#__PURE__*/React.createElement(Swiper, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.swiper), {
276
+ className: cn('swiper', [classes.swiper]),
277
+ loop: loop,
278
+ autoplay: autoPlay ? getAutoPlayConfig(autoPlayDelay) : false,
279
+ watchSlidesVisibility: true,
280
+ noSwipingClass: classes.noSwiping,
281
+ breakpoints: showNextSlide ? SLIDES_SETTINGS : undefined,
282
+ onSwiper: handleSwiper,
283
+ onReachBeginning: handleReachBeginning,
284
+ onReachEnd: handleReachEnd,
285
+ onFromEdge: handleFromEdge,
286
+ onSlideChange: handleSlideChange,
287
+ onTouchEnd: increaseAutoplayDelay
288
+ }), React.Children.map(children, function (child, i) {
289
+ return /*#__PURE__*/React.createElement(SwiperSlide, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.slide, i + 1), {
290
+ className: cn('slide', [classes.slide]),
291
+ key: i
292
+ }), /*#__PURE__*/React.isValidElement(child) && /*#__PURE__*/React.cloneElement(child, {
293
+ className: cn('slide-content', [child === null || child === void 0 ? void 0 : child.props.className])
294
+ }));
295
+ })), !isSingleSlide && renderNavArrows), !isSingleSlide && renderPagination);
281
296
  };
282
297
 
283
298
  Banner.propTypes = {
284
299
  className: PropTypes.string,
285
- loop: PropTypes.bool,
286
300
  classes: PropTypes.shape({
287
301
  swiper: PropTypes.string,
288
302
  slide: PropTypes.string,
@@ -290,7 +304,8 @@ Banner.propTypes = {
290
304
  arrowPrev: PropTypes.string,
291
305
  arrowNext: PropTypes.string,
292
306
  pagination: PropTypes.string,
293
- dot: PropTypes.string
307
+ dot: PropTypes.string,
308
+ noSwiping: PropTypes.string
294
309
  }),
295
310
  dataAttrs: PropTypes.shape({
296
311
  root: PropTypes.objectOf(PropTypes.string.isRequired),
@@ -304,12 +319,15 @@ Banner.propTypes = {
304
319
  withPaginationBottomOffset: PropTypes.bool,
305
320
  autoPlay: PropTypes.bool,
306
321
  autoPlayDelay: PropTypes.number,
322
+ loop: PropTypes.bool,
307
323
  pauseOnHover: PropTypes.bool,
308
324
  backgroundColor: PropTypes.oneOf(Object.values(BackgroundColor)),
309
325
  radius: PropTypes.oneOf(Object.values(Radius)),
310
326
  navTheme: PropTypes.oneOf(Object.values(NavTheme)),
311
327
  arrowTheme: PropTypes.oneOf(Object.values(ArrowTheme)),
312
328
  autoHeight: PropTypes.bool,
329
+ noIncreaseAutoplayDelay: PropTypes.bool,
330
+ showNextSlide: PropTypes.bool,
313
331
  getSwiper: PropTypes.func,
314
332
  onNextClick: PropTypes.func,
315
333
  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>;
@@ -1,13 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import "core-js/modules/es.object.values.js";
3
2
  import * as React from 'react';
4
3
  import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
5
4
  import * as PropTypes from 'prop-types';
6
5
  import "./BannerDot.css";
7
- export var BannerDotTheme = {
8
- LIGHT: 'light',
9
- DARK: 'dark'
10
- };
11
6
  var cn = cnCreate('mfui-banner-dot');
12
7
 
13
8
  var BannerDot = function BannerDot(_ref) {
@@ -17,8 +12,6 @@ var BannerDot = function BannerDot(_ref) {
17
12
  isActive = _ref.isActive,
18
13
  showTimer = _ref.showTimer,
19
14
  timerDelay = _ref.timerDelay,
20
- _ref$theme = _ref.theme,
21
- theme = _ref$theme === void 0 ? BannerDotTheme.LIGHT : _ref$theme,
22
15
  onClick = _ref.onClick;
23
16
  var handleDotClick = React.useCallback(function () {
24
17
  onClick(index);
@@ -26,21 +19,20 @@ var BannerDot = function BannerDot(_ref) {
26
19
  return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
27
20
  className: cn({
28
21
  active: isActive,
29
- timer: showTimer,
30
- theme: theme
22
+ timer: showTimer
31
23
  }, className),
32
24
  onClick: handleDotClick
33
- }), showTimer && isActive && /*#__PURE__*/React.createElement("svg", _extends({
25
+ }), showTimer && isActive && /*#__PURE__*/React.createElement("svg", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.svg), {
34
26
  className: cn('timer'),
35
- viewBox: "0 0 300 100"
36
- }, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.svg)), /*#__PURE__*/React.createElement("rect", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.inner), {
27
+ viewBox: "0 0 250 100"
28
+ }), /*#__PURE__*/React.createElement("rect", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.inner), {
37
29
  className: cn('timer-inner'),
38
30
  style: {
39
31
  animationDuration: "".concat(timerDelay, "s")
40
32
  },
41
33
  x: "0",
42
34
  y: "0",
43
- width: "300",
35
+ width: "250",
44
36
  height: "100",
45
37
  rx: "50",
46
38
  ry: "50"
@@ -58,7 +50,6 @@ BannerDot.propTypes = {
58
50
  isActive: PropTypes.bool.isRequired,
59
51
  showTimer: PropTypes.bool.isRequired,
60
52
  timerDelay: PropTypes.number.isRequired,
61
- theme: PropTypes.oneOf(Object.values(BannerDotTheme)),
62
53
  onClick: PropTypes.func.isRequired
63
54
  };
64
55
  export 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,13 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ var _SLIDES_SETTINGS;
4
+
5
+ import { breakpoints } from '@megafon/ui-helpers';
6
+ var SLIDES_SETTINGS = (_SLIDES_SETTINGS = {}, _defineProperty(_SLIDES_SETTINGS, breakpoints.MOBILE_SMALL_START, {
7
+ slidesPerView: 1,
8
+ spaceBetween: 16
9
+ }), _defineProperty(_SLIDES_SETTINGS, breakpoints.MOBILE_BIG_START, {
10
+ slidesPerView: 1,
11
+ spaceBetween: 0
12
+ }), _SLIDES_SETTINGS);
13
+ export default SLIDES_SETTINGS;
@@ -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;