@megafon/ui-core 3.13.0 → 3.15.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,29 @@
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.15.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.14.0...@megafon/ui-core@3.15.0) (2022-10-03)
7
+
8
+
9
+ ### Features
10
+
11
+ * **select:** add class to list-inner element ([44a366c](https://github.com/MegafonWebLab/megafon-ui/commit/44a366ce6b79222f3ef68532c719f5ee13d3d6bf))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.14.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.13.0...@megafon/ui-core@3.14.0) (2022-09-06)
18
+
19
+
20
+ ### Features
21
+
22
+ * **badge:** add new promo badge type ([8cbe525](https://github.com/MegafonWebLab/megafon-ui/commit/8cbe5253b9d08c19c9343b42cb3920ac259c8844))
23
+ * **carousel:** add new prop slideToClickedSlide ([8a43432](https://github.com/MegafonWebLab/megafon-ui/commit/8a4343290f943475c8522adaa3ad2b564c551d83))
24
+
25
+
26
+
27
+
28
+
6
29
  # [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
30
 
8
31
 
@@ -27,6 +27,10 @@
27
27
  .mfui-promo-badge_type_user-choice {
28
28
  background-color: var(--reflexBlue);
29
29
  }
30
+ .mfui-promo-badge_type_interests {
31
+ background-color: var(--brandPurple20);
32
+ color: var(--brandPurple);
33
+ }
30
34
  .mfui-promo-badge__text {
31
35
  font-family: inherit;
32
36
  font-size: 12px;
@@ -6,6 +6,7 @@ export declare const PromoBadgeTypes: {
6
6
  readonly VIP: "vip";
7
7
  readonly POPULAR: "popular";
8
8
  readonly USER_CHOICE: "user-choice";
9
+ readonly INTERESTS: "interests";
9
10
  };
10
11
  declare type PromoBadgeTypesType = typeof PromoBadgeTypes[keyof typeof PromoBadgeTypes];
11
12
  export interface IPromoBadgeProps {
@@ -9,7 +9,8 @@ export var PromoBadgeTypes = {
9
9
  NEW: 'new',
10
10
  VIP: 'vip',
11
11
  POPULAR: 'popular',
12
- USER_CHOICE: 'user-choice'
12
+ USER_CHOICE: 'user-choice',
13
+ INTERESTS: 'interests'
13
14
  };
14
15
  var cn = cnCreate('mfui-promo-badge');
15
16
 
@@ -72,6 +72,8 @@ export interface ICarouselProps {
72
72
  effectTheme?: EffectThemeType;
73
73
  /** Css селектор элемента, при перетаскивании которого не будет происходить смена слайдов */
74
74
  noSwipingSelector?: string;
75
+ /** Свайп к слайду, по которому произведен клик */
76
+ slideToClickedSlide?: boolean;
75
77
  /** Ref на swiper */
76
78
  getSwiper?: (instance: SwiperCore) => void;
77
79
  /** Обработчик клика по стрелке вперед (должен быть обернут в useCallback) */
@@ -92,7 +92,9 @@ var Carousel = function Carousel(_ref) {
92
92
  getSwiper = _ref.getSwiper,
93
93
  onNextClick = _ref.onNextClick,
94
94
  onPrevClick = _ref.onPrevClick,
95
- onChange = _ref.onChange;
95
+ onChange = _ref.onChange,
96
+ _ref$slideToClickedSl = _ref.slideToClickedSlide,
97
+ slideToClickedSlide = _ref$slideToClickedSl === void 0 ? false : _ref$slideToClickedSl;
96
98
 
97
99
  var _React$useState = React.useState(),
98
100
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -265,6 +267,7 @@ var Carousel = function Carousel(_ref) {
265
267
  allowTouchMove: !disableTouchMove,
266
268
  centeredSlides: centeredSlides,
267
269
  effect: effectTheme,
270
+ slideToClickedSlide: slideToClickedSlide,
268
271
  fadeEffect: effectTheme === EffectTheme.FADE ? {
269
272
  crossFade: effectTheme === EffectTheme.FADE
270
273
  } : undefined,
@@ -59,6 +59,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
59
59
  title?: string;
60
60
  titleInner?: string;
61
61
  list?: string;
62
+ listInner?: string;
62
63
  listItem?: string;
63
64
  listItemTitle?: string;
64
65
  };
@@ -100,6 +101,7 @@ declare const Select: {
100
101
  title: PropTypes.Requireable<string>;
101
102
  titleInner: PropTypes.Requireable<string>;
102
103
  list: PropTypes.Requireable<string>;
104
+ listInner: PropTypes.Requireable<string>;
103
105
  listItem: PropTypes.Requireable<string>;
104
106
  listItemTitle: PropTypes.Requireable<string>;
105
107
  }>>;
@@ -363,7 +363,7 @@ var Select = function Select(_ref) {
363
363
  return /*#__PURE__*/React.createElement("div", {
364
364
  className: cn('list', [classes.list])
365
365
  }, /*#__PURE__*/React.createElement("div", {
366
- className: cn('list-inner'),
366
+ className: cn('list-inner', [classes.listInner]),
367
367
  ref: itemWrapperNode
368
368
  }, currentItems.map(function (_ref3, i) {
369
369
  var title = _ref3.title,
@@ -435,6 +435,7 @@ Select.propTypes = {
435
435
  title: PropTypes.string,
436
436
  titleInner: PropTypes.string,
437
437
  list: PropTypes.string,
438
+ listInner: PropTypes.string,
438
439
  listItem: PropTypes.string,
439
440
  listItemTitle: PropTypes.string
440
441
  }),
@@ -27,6 +27,10 @@
27
27
  .mfui-promo-badge_type_user-choice {
28
28
  background-color: var(--reflexBlue);
29
29
  }
30
+ .mfui-promo-badge_type_interests {
31
+ background-color: var(--brandPurple20);
32
+ color: var(--brandPurple);
33
+ }
30
34
  .mfui-promo-badge__text {
31
35
  font-family: inherit;
32
36
  font-size: 12px;
@@ -6,6 +6,7 @@ export declare const PromoBadgeTypes: {
6
6
  readonly VIP: "vip";
7
7
  readonly POPULAR: "popular";
8
8
  readonly USER_CHOICE: "user-choice";
9
+ readonly INTERESTS: "interests";
9
10
  };
10
11
  declare type PromoBadgeTypesType = typeof PromoBadgeTypes[keyof typeof PromoBadgeTypes];
11
12
  export interface IPromoBadgeProps {
@@ -28,7 +28,8 @@ var PromoBadgeTypes = {
28
28
  NEW: 'new',
29
29
  VIP: 'vip',
30
30
  POPULAR: 'popular',
31
- USER_CHOICE: 'user-choice'
31
+ USER_CHOICE: 'user-choice',
32
+ INTERESTS: 'interests'
32
33
  };
33
34
  exports.PromoBadgeTypes = PromoBadgeTypes;
34
35
  var cn = (0, _uiHelpers.cnCreate)('mfui-promo-badge');
@@ -72,6 +72,8 @@ export interface ICarouselProps {
72
72
  effectTheme?: EffectThemeType;
73
73
  /** Css селектор элемента, при перетаскивании которого не будет происходить смена слайдов */
74
74
  noSwipingSelector?: string;
75
+ /** Свайп к слайду, по которому произведен клик */
76
+ slideToClickedSlide?: boolean;
75
77
  /** Ref на swiper */
76
78
  getSwiper?: (instance: SwiperCore) => void;
77
79
  /** Обработчик клика по стрелке вперед (должен быть обернут в useCallback) */
@@ -124,7 +124,9 @@ var Carousel = function Carousel(_ref) {
124
124
  getSwiper = _ref.getSwiper,
125
125
  onNextClick = _ref.onNextClick,
126
126
  onPrevClick = _ref.onPrevClick,
127
- onChange = _ref.onChange;
127
+ onChange = _ref.onChange,
128
+ _ref$slideToClickedSl = _ref.slideToClickedSlide,
129
+ slideToClickedSlide = _ref$slideToClickedSl === void 0 ? false : _ref$slideToClickedSl;
128
130
 
129
131
  var _React$useState = React.useState(),
130
132
  _React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
@@ -295,6 +297,7 @@ var Carousel = function Carousel(_ref) {
295
297
  allowTouchMove: !disableTouchMove,
296
298
  centeredSlides: centeredSlides,
297
299
  effect: effectTheme,
300
+ slideToClickedSlide: slideToClickedSlide,
298
301
  fadeEffect: effectTheme === EffectTheme.FADE ? {
299
302
  crossFade: effectTheme === EffectTheme.FADE
300
303
  } : undefined,
@@ -59,6 +59,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
59
59
  title?: string;
60
60
  titleInner?: string;
61
61
  list?: string;
62
+ listInner?: string;
62
63
  listItem?: string;
63
64
  listItemTitle?: string;
64
65
  };
@@ -100,6 +101,7 @@ declare const Select: {
100
101
  title: PropTypes.Requireable<string>;
101
102
  titleInner: PropTypes.Requireable<string>;
102
103
  list: PropTypes.Requireable<string>;
104
+ listInner: PropTypes.Requireable<string>;
103
105
  listItem: PropTypes.Requireable<string>;
104
106
  listItemTitle: PropTypes.Requireable<string>;
105
107
  }>>;
@@ -398,7 +398,7 @@ var Select = function Select(_ref) {
398
398
  return /*#__PURE__*/React.createElement("div", {
399
399
  className: cn('list', [classes.list])
400
400
  }, /*#__PURE__*/React.createElement("div", {
401
- className: cn('list-inner'),
401
+ className: cn('list-inner', [classes.listInner]),
402
402
  ref: itemWrapperNode
403
403
  }, currentItems.map(function (_ref3, i) {
404
404
  var title = _ref3.title,
@@ -470,6 +470,7 @@ Select.propTypes = {
470
470
  title: PropTypes.string,
471
471
  titleInner: PropTypes.string,
472
472
  list: PropTypes.string,
473
+ listInner: PropTypes.string,
473
474
  listItem: PropTypes.string,
474
475
  listItemTitle: PropTypes.string
475
476
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-core",
3
- "version": "3.13.0",
3
+ "version": "3.15.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "styles"
@@ -54,7 +54,7 @@
54
54
  "@babel/preset-env": "^7.8.6",
55
55
  "@babel/preset-react": "^7.8.3",
56
56
  "@babel/preset-typescript": "^7.8.3",
57
- "@megafon/ui-icons": "^1.2.2",
57
+ "@megafon/ui-icons": "^1.3.0",
58
58
  "@svgr/core": "^2.4.1",
59
59
  "@testing-library/react-hooks": "^7.0.1",
60
60
  "@types/enzyme": "^3.10.5",
@@ -97,5 +97,5 @@
97
97
  "react-popper": "^2.2.3",
98
98
  "swiper": "^6.5.6"
99
99
  },
100
- "gitHead": "805c619438eb41f92e1dbb930d750393e8fea5fe"
100
+ "gitHead": "16be55dd99791687663b209a67e4ab6ec485b19c"
101
101
  }