@megafon/ui-shared 5.2.3 → 5.3.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 (38) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/es/components/BenefitsPictures/BenefitsPictures.js +19 -7
  3. package/dist/es/components/BenefitsPictures/BenfitsPictures.css +21 -0
  4. package/dist/es/components/BenefitsPictures/types.d.ts +2 -2
  5. package/dist/es/components/Instructions/img/android.png +0 -0
  6. package/dist/es/components/Instructions/img/blackIphone.png +0 -0
  7. package/dist/es/components/Instructions/img/laptop.png +0 -0
  8. package/dist/es/components/Instructions/img/newIphone.png +0 -0
  9. package/dist/es/components/Instructions/img/whiteIphone.png +0 -0
  10. package/dist/es/components/Steps/Steps.d.ts +7 -1
  11. package/dist/es/components/Steps/Steps.js +11 -5
  12. package/dist/es/components/StoreBanner/doc/img/new-iphone-screen.png +0 -0
  13. package/dist/es/components/StoreBanner/doc/img/qr-code.png +0 -0
  14. package/dist/es/components/StoreBanner/doc/img/screen.png +0 -0
  15. package/dist/es/components/StoreBanner/img/android.png +0 -0
  16. package/dist/es/components/StoreBanner/img/black-iphone.png +0 -0
  17. package/dist/es/components/StoreBanner/img/new-iphone.png +0 -0
  18. package/dist/es/components/StoreBanner/img/white-iphone.png +0 -0
  19. package/dist/es/helpers/getColumnConfig.d.ts +1 -1
  20. package/dist/lib/components/BenefitsPictures/BenefitsPictures.js +19 -7
  21. package/dist/lib/components/BenefitsPictures/BenfitsPictures.css +21 -0
  22. package/dist/lib/components/BenefitsPictures/types.d.ts +2 -2
  23. package/dist/lib/components/Instructions/img/android.png +0 -0
  24. package/dist/lib/components/Instructions/img/blackIphone.png +0 -0
  25. package/dist/lib/components/Instructions/img/laptop.png +0 -0
  26. package/dist/lib/components/Instructions/img/newIphone.png +0 -0
  27. package/dist/lib/components/Instructions/img/whiteIphone.png +0 -0
  28. package/dist/lib/components/Steps/Steps.d.ts +7 -1
  29. package/dist/lib/components/Steps/Steps.js +11 -5
  30. package/dist/lib/components/StoreBanner/doc/img/new-iphone-screen.png +0 -0
  31. package/dist/lib/components/StoreBanner/doc/img/qr-code.png +0 -0
  32. package/dist/lib/components/StoreBanner/doc/img/screen.png +0 -0
  33. package/dist/lib/components/StoreBanner/img/android.png +0 -0
  34. package/dist/lib/components/StoreBanner/img/black-iphone.png +0 -0
  35. package/dist/lib/components/StoreBanner/img/new-iphone.png +0 -0
  36. package/dist/lib/components/StoreBanner/img/white-iphone.png +0 -0
  37. package/dist/lib/helpers/getColumnConfig.d.ts +1 -1
  38. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,30 @@
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.3.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.2.4...@megafon/ui-shared@5.3.0) (2023-12-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **steps:** added classes props ([e9f1732](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/e9f17329e675ec31efdd74904dcfb2861af90c79))
12
+
13
+
14
+ ### Features
15
+
16
+ * **benefitspictures:** add minor fixes ([b6203da](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/b6203dafbb3a8761ae5bfa0ad6ef54c789a01df9))
17
+
18
+
19
+
20
+
21
+
22
+ ## [5.2.4](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.2.3...@megafon/ui-shared@5.2.4) (2023-11-27)
23
+
24
+ **Note:** Version bump only for package @megafon/ui-shared
25
+
26
+
27
+
28
+
29
+
6
30
  ## [5.2.3](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.2.2...@megafon/ui-shared@5.2.3) (2023-11-22)
7
31
 
8
32
 
@@ -55,6 +55,8 @@ var BenefitsPictures = function BenefitsPictures(_ref) {
55
55
  return /*#__PURE__*/React.createElement("div", {
56
56
  className: cn([className, classes.root]),
57
57
  ref: rootRef
58
+ }, /*#__PURE__*/React.createElement("div", {
59
+ className: cn('inner')
58
60
  }, /*#__PURE__*/React.createElement(Grid, {
59
61
  guttersLeft: currentGutter,
60
62
  hAlign: isGridCenterAlign ? 'center' : 'left',
@@ -79,14 +81,24 @@ var BenefitsPictures = function BenefitsPictures(_ref) {
79
81
  }),
80
82
  src: img,
81
83
  alt: alt
82
- }), /*#__PURE__*/React.createElement(Header, {
84
+ }), !!title && /*#__PURE__*/React.createElement(Header, {
83
85
  className: cn('title'),
84
86
  align: align,
85
- as: "h3"
86
- }, convert(title)), /*#__PURE__*/React.createElement(Paragraph, {
87
- align: align
87
+ as: "h3",
88
+ dataAttrs: {
89
+ root: {
90
+ 'data-testid': "".concat(testIdPrefix, "-title")
91
+ }
92
+ }
93
+ }, convert(title)), !!text && /*#__PURE__*/React.createElement(Paragraph, {
94
+ align: align,
95
+ dataAttrs: {
96
+ root: {
97
+ 'data-testid': "".concat(testIdPrefix, "-text")
98
+ }
99
+ }
88
100
  }, convert(text))));
89
- })));
101
+ }))));
90
102
  };
91
103
 
92
104
  BenefitsPictures.propTypes = {
@@ -94,8 +106,8 @@ BenefitsPictures.propTypes = {
94
106
  current: PropTypes.elementType
95
107
  }), PropTypes.any])]),
96
108
  items: PropTypes.arrayOf(PropTypes.shape({
97
- title: PropTypes.string.isRequired,
98
- text: PropTypes.string.isRequired,
109
+ title: PropTypes.string,
110
+ text: PropTypes.string,
99
111
  img: PropTypes.string.isRequired,
100
112
  alt: PropTypes.string
101
113
  }).isRequired).isRequired,
@@ -5,9 +5,30 @@ h4,
5
5
  h5 {
6
6
  margin: 0;
7
7
  }
8
+ .mfui-benefits-pictures {
9
+ overflow: hidden;
10
+ }
11
+ .mfui-benefits-pictures__inner {
12
+ margin-bottom: -40px;
13
+ }
14
+ @media screen and (min-width: 768px) {
15
+ .mfui-benefits-pictures__inner {
16
+ margin-bottom: -48px;
17
+ }
18
+ }
19
+ .mfui-benefits-pictures__item {
20
+ margin-bottom: 40px;
21
+ }
22
+ @media screen and (min-width: 768px) {
23
+ .mfui-benefits-pictures__item {
24
+ margin-bottom: 48px;
25
+ }
26
+ }
8
27
  .mfui-benefits-pictures__img {
9
28
  max-width: 100%;
10
29
  margin-bottom: 32px;
30
+ border-radius: 12px;
31
+ vertical-align: top;
11
32
  }
12
33
  .mfui-benefits-pictures__img_h-align_center {
13
34
  display: block;
@@ -1,8 +1,8 @@
1
1
  export interface IBenefit {
2
2
  /** Заголовок бенефита */
3
- title: string;
3
+ title?: string;
4
4
  /** Основной текст в бенефите */
5
- text: string;
5
+ text?: string;
6
6
  /** Изображение */
7
7
  img: string;
8
8
  /** Значение тега alt для изображения */
@@ -3,10 +3,16 @@ import './Steps.less';
3
3
  export interface ISteps {
4
4
  /** Дополнительный класс корневого элемента */
5
5
  className?: string;
6
+ /** Дополнительные классы для корневого и внутренних элементов */
7
+ classes?: {
8
+ title?: string;
9
+ list?: string;
10
+ item?: string;
11
+ };
6
12
  /** Ссылка на корневой элемент */
7
13
  rootRef?: React.Ref<HTMLDivElement>;
8
14
  /** Заголовок */
9
- title: string;
15
+ title?: string;
10
16
  }
11
17
  declare const Steps: React.FC<ISteps>;
12
18
  export default Steps;
@@ -8,30 +8,36 @@ var cn = cnCreate('mfui-steps');
8
8
 
9
9
  var Steps = function Steps(_ref) {
10
10
  var className = _ref.className,
11
+ classes = _ref.classes,
11
12
  title = _ref.title,
12
13
  rootRef = _ref.rootRef,
13
14
  children = _ref.children;
14
15
  return /*#__PURE__*/React.createElement("div", {
15
16
  className: cn([className]),
16
17
  ref: rootRef
17
- }, /*#__PURE__*/React.createElement(Header, {
18
+ }, !!title && /*#__PURE__*/React.createElement(Header, {
18
19
  as: "h2",
19
20
  align: "center",
20
- className: cn('title')
21
+ className: cn('title', [classes === null || classes === void 0 ? void 0 : classes.title])
21
22
  }, convert(title, titleConvertConfig)), /*#__PURE__*/React.createElement("ul", {
22
- className: cn('list')
23
+ className: cn('list', [classes === null || classes === void 0 ? void 0 : classes.list])
23
24
  }, React.Children.map(children, function (child) {
24
25
  return /*#__PURE__*/React.createElement("li", {
25
- className: cn('item')
26
+ className: cn('item', [classes === null || classes === void 0 ? void 0 : classes.item])
26
27
  }, child);
27
28
  })));
28
29
  };
29
30
 
30
31
  Steps.propTypes = {
31
32
  className: PropTypes.string,
33
+ classes: PropTypes.shape({
34
+ title: PropTypes.string,
35
+ list: PropTypes.string,
36
+ item: PropTypes.string
37
+ }),
32
38
  rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
33
39
  current: PropTypes.elementType
34
40
  }), PropTypes.any])]),
35
- title: PropTypes.string.isRequired
41
+ title: PropTypes.string
36
42
  };
37
43
  export default Steps;
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export declare const getColumnConfig: (isFullWidth: boolean) => Pick<React.PropsWithChildren<import("@megafon/ui-core/dist/lib/components/Grid/GridColumn").IGridColumn>, "all" | "wide" | "mobile" | "desktop" | "tablet">;
2
+ export declare const getColumnConfig: (isFullWidth: boolean) => Pick<React.PropsWithChildren<import("../../../ui-core/dist/lib/components/Grid/GridColumn").IGridColumn>, "all" | "wide" | "mobile" | "desktop" | "tablet">;
@@ -80,6 +80,8 @@ var BenefitsPictures = function BenefitsPictures(_ref) {
80
80
  return /*#__PURE__*/React.createElement("div", {
81
81
  className: cn([className, classes.root]),
82
82
  ref: rootRef
83
+ }, /*#__PURE__*/React.createElement("div", {
84
+ className: cn('inner')
83
85
  }, /*#__PURE__*/React.createElement(_uiCore.Grid, {
84
86
  guttersLeft: currentGutter,
85
87
  hAlign: isGridCenterAlign ? 'center' : 'left',
@@ -104,14 +106,24 @@ var BenefitsPictures = function BenefitsPictures(_ref) {
104
106
  }),
105
107
  src: img,
106
108
  alt: alt
107
- }), /*#__PURE__*/React.createElement(_uiCore.Header, {
109
+ }), !!title && /*#__PURE__*/React.createElement(_uiCore.Header, {
108
110
  className: cn('title'),
109
111
  align: align,
110
- as: "h3"
111
- }, (0, _htmr["default"])(title)), /*#__PURE__*/React.createElement(_uiCore.Paragraph, {
112
- align: align
112
+ as: "h3",
113
+ dataAttrs: {
114
+ root: {
115
+ 'data-testid': "".concat(testIdPrefix, "-title")
116
+ }
117
+ }
118
+ }, (0, _htmr["default"])(title)), !!text && /*#__PURE__*/React.createElement(_uiCore.Paragraph, {
119
+ align: align,
120
+ dataAttrs: {
121
+ root: {
122
+ 'data-testid': "".concat(testIdPrefix, "-text")
123
+ }
124
+ }
113
125
  }, (0, _htmr["default"])(text))));
114
- })));
126
+ }))));
115
127
  };
116
128
 
117
129
  BenefitsPictures.propTypes = {
@@ -119,8 +131,8 @@ BenefitsPictures.propTypes = {
119
131
  current: _propTypes["default"].elementType
120
132
  }), _propTypes["default"].any])]),
121
133
  items: _propTypes["default"].arrayOf(_propTypes["default"].shape({
122
- title: _propTypes["default"].string.isRequired,
123
- text: _propTypes["default"].string.isRequired,
134
+ title: _propTypes["default"].string,
135
+ text: _propTypes["default"].string,
124
136
  img: _propTypes["default"].string.isRequired,
125
137
  alt: _propTypes["default"].string
126
138
  }).isRequired).isRequired,
@@ -5,9 +5,30 @@ h4,
5
5
  h5 {
6
6
  margin: 0;
7
7
  }
8
+ .mfui-benefits-pictures {
9
+ overflow: hidden;
10
+ }
11
+ .mfui-benefits-pictures__inner {
12
+ margin-bottom: -40px;
13
+ }
14
+ @media screen and (min-width: 768px) {
15
+ .mfui-benefits-pictures__inner {
16
+ margin-bottom: -48px;
17
+ }
18
+ }
19
+ .mfui-benefits-pictures__item {
20
+ margin-bottom: 40px;
21
+ }
22
+ @media screen and (min-width: 768px) {
23
+ .mfui-benefits-pictures__item {
24
+ margin-bottom: 48px;
25
+ }
26
+ }
8
27
  .mfui-benefits-pictures__img {
9
28
  max-width: 100%;
10
29
  margin-bottom: 32px;
30
+ border-radius: 12px;
31
+ vertical-align: top;
11
32
  }
12
33
  .mfui-benefits-pictures__img_h-align_center {
13
34
  display: block;
@@ -1,8 +1,8 @@
1
1
  export interface IBenefit {
2
2
  /** Заголовок бенефита */
3
- title: string;
3
+ title?: string;
4
4
  /** Основной текст в бенефите */
5
- text: string;
5
+ text?: string;
6
6
  /** Изображение */
7
7
  img: string;
8
8
  /** Значение тега alt для изображения */
@@ -3,10 +3,16 @@ import './Steps.less';
3
3
  export interface ISteps {
4
4
  /** Дополнительный класс корневого элемента */
5
5
  className?: string;
6
+ /** Дополнительные классы для корневого и внутренних элементов */
7
+ classes?: {
8
+ title?: string;
9
+ list?: string;
10
+ item?: string;
11
+ };
6
12
  /** Ссылка на корневой элемент */
7
13
  rootRef?: React.Ref<HTMLDivElement>;
8
14
  /** Заголовок */
9
- title: string;
15
+ title?: string;
10
16
  }
11
17
  declare const Steps: React.FC<ISteps>;
12
18
  export default Steps;
@@ -27,31 +27,37 @@ var cn = (0, _uiHelpers.cnCreate)('mfui-steps');
27
27
 
28
28
  var Steps = function Steps(_ref) {
29
29
  var className = _ref.className,
30
+ classes = _ref.classes,
30
31
  title = _ref.title,
31
32
  rootRef = _ref.rootRef,
32
33
  children = _ref.children;
33
34
  return /*#__PURE__*/React.createElement("div", {
34
35
  className: cn([className]),
35
36
  ref: rootRef
36
- }, /*#__PURE__*/React.createElement(_uiCore.Header, {
37
+ }, !!title && /*#__PURE__*/React.createElement(_uiCore.Header, {
37
38
  as: "h2",
38
39
  align: "center",
39
- className: cn('title')
40
+ className: cn('title', [classes === null || classes === void 0 ? void 0 : classes.title])
40
41
  }, (0, _uiHelpers.convert)(title, _uiHelpers.titleConvertConfig)), /*#__PURE__*/React.createElement("ul", {
41
- className: cn('list')
42
+ className: cn('list', [classes === null || classes === void 0 ? void 0 : classes.list])
42
43
  }, React.Children.map(children, function (child) {
43
44
  return /*#__PURE__*/React.createElement("li", {
44
- className: cn('item')
45
+ className: cn('item', [classes === null || classes === void 0 ? void 0 : classes.item])
45
46
  }, child);
46
47
  })));
47
48
  };
48
49
 
49
50
  Steps.propTypes = {
50
51
  className: _propTypes["default"].string,
52
+ classes: _propTypes["default"].shape({
53
+ title: _propTypes["default"].string,
54
+ list: _propTypes["default"].string,
55
+ item: _propTypes["default"].string
56
+ }),
51
57
  rootRef: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].oneOfType([_propTypes["default"].shape({
52
58
  current: _propTypes["default"].elementType
53
59
  }), _propTypes["default"].any])]),
54
- title: _propTypes["default"].string.isRequired
60
+ title: _propTypes["default"].string
55
61
  };
56
62
  var _default = Steps;
57
63
  exports["default"] = _default;
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export declare const getColumnConfig: (isFullWidth: boolean) => Pick<React.PropsWithChildren<import("@megafon/ui-core/dist/lib/components/Grid/GridColumn").IGridColumn>, "all" | "wide" | "mobile" | "desktop" | "tablet">;
2
+ export declare const getColumnConfig: (isFullWidth: boolean) => Pick<React.PropsWithChildren<import("../../../ui-core/dist/lib/components/Grid/GridColumn").IGridColumn>, "all" | "wide" | "mobile" | "desktop" | "tablet">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-shared",
3
- "version": "5.2.3",
3
+ "version": "5.3.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -48,7 +48,7 @@
48
48
  "@babel/preset-env": "^7.8.6",
49
49
  "@babel/preset-react": "^7.8.3",
50
50
  "@babel/preset-typescript": "^7.8.3",
51
- "@megafon/ui-icons": "^2.15.0",
51
+ "@megafon/ui-icons": "^2.16.0",
52
52
  "@svgr/core": "^2.4.1",
53
53
  "@testing-library/jest-dom": "5.16.2",
54
54
  "@testing-library/react": "12.1.2",
@@ -82,13 +82,13 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@babel/runtime": "^7.8.4",
85
- "@megafon/ui-core": "^5.4.0",
86
- "@megafon/ui-helpers": "^2.5.3",
85
+ "@megafon/ui-core": "^5.4.2",
86
+ "@megafon/ui-helpers": "^2.5.4",
87
87
  "core-js": "^3.6.4",
88
88
  "htmr": "^0.9.2",
89
89
  "lodash.throttle": "^4.1.1",
90
90
  "prop-types": "^15.7.2",
91
91
  "swiper": "^6.5.6"
92
92
  },
93
- "gitHead": "e78c7c397c514016ee74020939dc3807e09bf49a"
93
+ "gitHead": "18cb80b0ac6513b2ad8f31167461aefbb226a6c2"
94
94
  }