@megafon/ui-core 3.12.1 → 3.13.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
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
+ # [3.13.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.12.1...@megafon/ui-core@3.13.0) (2022-08-11)
7
+
8
+
9
+ ### Features
10
+
11
+ * **banner:** add auto height ([c7658fa](https://github.com/MegafonWebLab/megafon-ui/commit/c7658faf335bc26f0a1b816e29b9cca114944691))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [3.12.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.12.0...@megafon/ui-core@3.12.1) (2022-08-02)
7
18
 
8
19
 
@@ -36,6 +36,9 @@
36
36
  height: 400px;
37
37
  }
38
38
  }
39
+ .mfui-banner_auto-height .mfui-banner__slide {
40
+ height: auto;
41
+ }
39
42
  @media screen and (min-width: 1024px) {
40
43
  .mfui-banner .swiper-slide-visible {
41
44
  opacity: 1;
@@ -36,6 +36,8 @@ export interface IBannerProps {
36
36
  pauseOnHover?: boolean;
37
37
  /** Цветовая тема навигации */
38
38
  navTheme?: NavThemeType;
39
+ /** Автоматическая высота слайдов */
40
+ autoHeight?: boolean;
39
41
  /** Обработчик клика по стрелке "вперед" (должен быть обернут в useCallback) */
40
42
  onNextClick?: (index: number) => void;
41
43
  /** Обработчик клика по стрелке "назад" (должен быть обернут в useCallback) */
@@ -43,6 +43,8 @@ var Banner = function Banner(_ref) {
43
43
  loop = _ref$loop === void 0 ? false : _ref$loop,
44
44
  _ref$navTheme = _ref.navTheme,
45
45
  navTheme = _ref$navTheme === void 0 ? 'light' : _ref$navTheme,
46
+ _ref$autoHeight = _ref.autoHeight,
47
+ autoHeight = _ref$autoHeight === void 0 ? false : _ref$autoHeight,
46
48
  _ref$children = _ref.children,
47
49
  children = _ref$children === void 0 ? [] : _ref$children,
48
50
  onNextClick = _ref.onNextClick,
@@ -178,7 +180,8 @@ var Banner = function Banner(_ref) {
178
180
  }, [autoPlay, pauseOnHover, swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay]);
179
181
  return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
180
182
  className: cn({
181
- 'nav-theme': navTheme
183
+ 'nav-theme': navTheme,
184
+ 'auto-height': autoHeight
182
185
  }, className),
183
186
  ref: rootRef
184
187
  }), /*#__PURE__*/React.createElement(Swiper, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.swiper), {
@@ -259,6 +262,7 @@ Banner.propTypes = {
259
262
  autoPlayDelay: PropTypes.number,
260
263
  pauseOnHover: PropTypes.bool,
261
264
  navTheme: PropTypes.oneOf(Object.values(NavTheme)),
265
+ autoHeight: PropTypes.bool,
262
266
  onNextClick: PropTypes.func,
263
267
  onPrevClick: PropTypes.func,
264
268
  onDotClick: PropTypes.func,
@@ -36,6 +36,9 @@
36
36
  height: 400px;
37
37
  }
38
38
  }
39
+ .mfui-banner_auto-height .mfui-banner__slide {
40
+ height: auto;
41
+ }
39
42
  @media screen and (min-width: 1024px) {
40
43
  .mfui-banner .swiper-slide-visible {
41
44
  opacity: 1;
@@ -36,6 +36,8 @@ export interface IBannerProps {
36
36
  pauseOnHover?: boolean;
37
37
  /** Цветовая тема навигации */
38
38
  navTheme?: NavThemeType;
39
+ /** Автоматическая высота слайдов */
40
+ autoHeight?: boolean;
39
41
  /** Обработчик клика по стрелке "вперед" (должен быть обернут в useCallback) */
40
42
  onNextClick?: (index: number) => void;
41
43
  /** Обработчик клика по стрелке "назад" (должен быть обернут в useCallback) */
@@ -71,6 +71,8 @@ var Banner = function Banner(_ref) {
71
71
  loop = _ref$loop === void 0 ? false : _ref$loop,
72
72
  _ref$navTheme = _ref.navTheme,
73
73
  navTheme = _ref$navTheme === void 0 ? 'light' : _ref$navTheme,
74
+ _ref$autoHeight = _ref.autoHeight,
75
+ autoHeight = _ref$autoHeight === void 0 ? false : _ref$autoHeight,
74
76
  _ref$children = _ref.children,
75
77
  children = _ref$children === void 0 ? [] : _ref$children,
76
78
  onNextClick = _ref.onNextClick,
@@ -206,7 +208,8 @@ var Banner = function Banner(_ref) {
206
208
  }, [autoPlay, pauseOnHover, swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay]);
207
209
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
208
210
  className: cn({
209
- 'nav-theme': navTheme
211
+ 'nav-theme': navTheme,
212
+ 'auto-height': autoHeight
210
213
  }, className),
211
214
  ref: rootRef
212
215
  }), /*#__PURE__*/React.createElement(_react2.Swiper, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.swiper), {
@@ -287,6 +290,7 @@ Banner.propTypes = {
287
290
  autoPlayDelay: PropTypes.number,
288
291
  pauseOnHover: PropTypes.bool,
289
292
  navTheme: PropTypes.oneOf(Object.values(NavTheme)),
293
+ autoHeight: PropTypes.bool,
290
294
  onNextClick: PropTypes.func,
291
295
  onPrevClick: PropTypes.func,
292
296
  onDotClick: PropTypes.func,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-core",
3
- "version": "3.12.1",
3
+ "version": "3.13.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "styles"
@@ -43,7 +43,7 @@
43
43
  ]
44
44
  },
45
45
  "peerDependencies": {
46
- "@megafon/ui-icons": "^0.0.2-beta.2",
46
+ "@megafon/ui-icons": "^1.0.0",
47
47
  "react": ">=16.13.0",
48
48
  "react-dom": ">=16.13.0"
49
49
  },
@@ -97,5 +97,5 @@
97
97
  "react-popper": "^2.2.3",
98
98
  "swiper": "^6.5.6"
99
99
  },
100
- "gitHead": "d951676f8c48d197b6107b4e90b04ea245cf0649"
100
+ "gitHead": "805c619438eb41f92e1dbb930d750393e8fea5fe"
101
101
  }