@megafon/ui-shared 3.0.0-beta.6 → 3.0.0-beta.7
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 +11 -0
- package/dist/es/components/AccordionBox/AccordionBox.d.ts +2 -2
- package/dist/es/components/AccordionBox/AccordionBox.js +3 -1
- package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +2 -2
- package/dist/es/components/ButtonBanner/ButtonBanner.js +4 -2
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.d.ts +2 -2
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +4 -2
- package/dist/es/components/StoreBanner/StoreBanner.d.ts +2 -2
- package/dist/es/components/StoreBanner/StoreBanner.js +5 -3
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +2 -2
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.js +4 -2
- package/dist/lib/components/AccordionBox/AccordionBox.d.ts +2 -2
- package/dist/lib/components/AccordionBox/AccordionBox.js +3 -1
- package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +2 -2
- package/dist/lib/components/ButtonBanner/ButtonBanner.js +4 -2
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.d.ts +2 -2
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +4 -2
- package/dist/lib/components/StoreBanner/StoreBanner.d.ts +2 -2
- package/dist/lib/components/StoreBanner/StoreBanner.js +5 -3
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +2 -2
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.js +4 -2
- package/package.json +5 -5
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.0.0-beta.7](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.0-beta.6...@megafon/ui-shared@3.0.0-beta.7) (2022-02-04)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **components:** change tests for dataAttrs prop ([2a8f306](https://github.com/MegafonWebLab/megafon-ui/commit/2a8f3061a4e89f6877894e5947db7bae2827f86a))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
6
17
|
# [3.0.0-beta.6](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.0-beta.5...@megafon/ui-shared@3.0.0-beta.6) (2022-02-02)
|
7
18
|
|
8
19
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import './AccordionBox.less';
|
3
3
|
export interface IAccordionBox {
|
4
|
-
/**
|
4
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
5
5
|
dataAttrs?: {
|
6
|
-
|
6
|
+
root?: Record<string, string>;
|
7
7
|
};
|
8
8
|
/** Ссылка на корневой элемент */
|
9
9
|
rootRef?: React.Ref<HTMLDivElement>;
|
@@ -41,7 +41,9 @@ var AccordionBox = function AccordionBox(_a) {
|
|
41
41
|
};
|
42
42
|
|
43
43
|
AccordionBox.propTypes = {
|
44
|
-
dataAttrs: PropTypes.
|
44
|
+
dataAttrs: PropTypes.shape({
|
45
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
46
|
+
}),
|
45
47
|
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
46
48
|
current: PropTypes.elementType
|
47
49
|
}), PropTypes.any])]),
|
@@ -16,9 +16,9 @@ export declare const ImageScaling: {
|
|
16
16
|
};
|
17
17
|
declare type ImageScalingType = typeof ImageScaling[keyof typeof ImageScaling];
|
18
18
|
export interface IButtonBannerProps {
|
19
|
-
/**
|
19
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
20
20
|
dataAttrs?: {
|
21
|
-
|
21
|
+
root?: Record<string, string>;
|
22
22
|
};
|
23
23
|
/** Дополнительный css класс для корневого элемента */
|
24
24
|
className?: string;
|
@@ -54,7 +54,7 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
54
54
|
onClick: onButtonClick,
|
55
55
|
download: buttonDownload
|
56
56
|
}, buttonText);
|
57
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs), {
|
57
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
58
58
|
className: cn({
|
59
59
|
image: !!imageUrl,
|
60
60
|
scaling: imageScaling
|
@@ -85,7 +85,9 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
85
85
|
};
|
86
86
|
|
87
87
|
ButtonBanner.propTypes = {
|
88
|
-
dataAttrs: PropTypes.
|
88
|
+
dataAttrs: PropTypes.shape({
|
89
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
90
|
+
}),
|
89
91
|
className: PropTypes.string,
|
90
92
|
classes: PropTypes.shape({
|
91
93
|
root: PropTypes.string,
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import React, { Ref } from 'react';
|
2
2
|
import './ButtonLinkBox.less';
|
3
3
|
export interface IButtonLinkBoxProps {
|
4
|
-
/**
|
4
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
5
5
|
dataAttrs?: {
|
6
|
-
|
6
|
+
root?: Record<string, string>;
|
7
7
|
};
|
8
8
|
/** Дополнительный класс корневого элемента */
|
9
9
|
className?: string;
|
@@ -26,7 +26,7 @@ var ButtonLinkBox = function ButtonLinkBox(_ref) {
|
|
26
26
|
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
27
27
|
onButtonClick = _ref.onButtonClick,
|
28
28
|
onLinkClick = _ref.onLinkClick;
|
29
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs), {
|
29
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
30
30
|
className: cn({
|
31
31
|
'h-align': hAlign
|
32
32
|
}, [className, classes.root]),
|
@@ -53,7 +53,9 @@ var ButtonLinkBox = function ButtonLinkBox(_ref) {
|
|
53
53
|
};
|
54
54
|
|
55
55
|
ButtonLinkBox.propTypes = {
|
56
|
-
dataAttrs: PropTypes.
|
56
|
+
dataAttrs: PropTypes.shape({
|
57
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
58
|
+
}),
|
57
59
|
className: PropTypes.string,
|
58
60
|
classes: PropTypes.shape({
|
59
61
|
root: PropTypes.string,
|
@@ -56,9 +56,9 @@ export interface IStoreBannerProps {
|
|
56
56
|
};
|
57
57
|
/** Ссылка на корневой элемент */
|
58
58
|
rootRef?: React.Ref<HTMLDivElement>;
|
59
|
-
/**
|
59
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
60
60
|
dataAttrs?: {
|
61
|
-
|
61
|
+
root?: Record<string, string>;
|
62
62
|
};
|
63
63
|
}
|
64
64
|
declare const StoreBanner: React.FC<IStoreBannerProps>;
|
@@ -52,7 +52,7 @@ var StoreBanner = function StoreBanner(_ref) {
|
|
52
52
|
mask: deviceMask
|
53
53
|
}, [className, rootClassName]),
|
54
54
|
ref: rootRef
|
55
|
-
}, filterDataAttrs(dataAttrs)), /*#__PURE__*/React.createElement("div", {
|
55
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("div", {
|
56
56
|
className: cn('container')
|
57
57
|
}, /*#__PURE__*/React.createElement("div", {
|
58
58
|
className: cn('grid')
|
@@ -139,7 +139,9 @@ StoreBanner.propTypes = {
|
|
139
139
|
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
140
140
|
current: PropTypes.elementType
|
141
141
|
}), PropTypes.any])]),
|
142
|
-
|
143
|
-
|
142
|
+
theme: PropTypes.oneOf(Object.values(Theme)),
|
143
|
+
dataAttrs: PropTypes.shape({
|
144
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
145
|
+
})
|
144
146
|
};
|
145
147
|
export default StoreBanner;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import './TitleDescriptionBox.less';
|
3
3
|
export interface ITitleDescriptionBoxProps {
|
4
|
-
/**
|
4
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
5
5
|
dataAttrs?: {
|
6
|
-
|
6
|
+
root?: Record<string, string>;
|
7
7
|
};
|
8
8
|
/** Ссылка на корневой элемент */
|
9
9
|
rootRef?: React.Ref<HTMLDivElement>;
|
@@ -29,7 +29,7 @@ var TitleDescriptionBox = function TitleDescriptionBox(_ref) {
|
|
29
29
|
className: cn('description')
|
30
30
|
}, description);
|
31
31
|
}, [description]);
|
32
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs), {
|
32
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
33
33
|
className: cn({
|
34
34
|
'h-align': hAlign,
|
35
35
|
'text-color': textColor
|
@@ -50,7 +50,9 @@ var TitleDescriptionBox = function TitleDescriptionBox(_ref) {
|
|
50
50
|
};
|
51
51
|
|
52
52
|
TitleDescriptionBox.propTypes = {
|
53
|
-
dataAttrs: PropTypes.
|
53
|
+
dataAttrs: PropTypes.shape({
|
54
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
55
|
+
}),
|
54
56
|
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
55
57
|
current: PropTypes.elementType
|
56
58
|
}), PropTypes.any])]),
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import './AccordionBox.less';
|
3
3
|
export interface IAccordionBox {
|
4
|
-
/**
|
4
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
5
5
|
dataAttrs?: {
|
6
|
-
|
6
|
+
root?: Record<string, string>;
|
7
7
|
};
|
8
8
|
/** Ссылка на корневой элемент */
|
9
9
|
rootRef?: React.Ref<HTMLDivElement>;
|
@@ -58,7 +58,9 @@ var AccordionBox = function AccordionBox(_a) {
|
|
58
58
|
};
|
59
59
|
|
60
60
|
AccordionBox.propTypes = {
|
61
|
-
dataAttrs: PropTypes.
|
61
|
+
dataAttrs: PropTypes.shape({
|
62
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
63
|
+
}),
|
62
64
|
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
63
65
|
current: PropTypes.elementType
|
64
66
|
}), PropTypes.any])]),
|
@@ -16,9 +16,9 @@ export declare const ImageScaling: {
|
|
16
16
|
};
|
17
17
|
declare type ImageScalingType = typeof ImageScaling[keyof typeof ImageScaling];
|
18
18
|
export interface IButtonBannerProps {
|
19
|
-
/**
|
19
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
20
20
|
dataAttrs?: {
|
21
|
-
|
21
|
+
root?: Record<string, string>;
|
22
22
|
};
|
23
23
|
/** Дополнительный css класс для корневого элемента */
|
24
24
|
className?: string;
|
@@ -79,7 +79,7 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
79
79
|
download: buttonDownload
|
80
80
|
}, buttonText);
|
81
81
|
|
82
|
-
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs), {
|
82
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
83
83
|
className: cn({
|
84
84
|
image: !!imageUrl,
|
85
85
|
scaling: imageScaling
|
@@ -110,7 +110,9 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
110
110
|
};
|
111
111
|
|
112
112
|
ButtonBanner.propTypes = {
|
113
|
-
dataAttrs: PropTypes.
|
113
|
+
dataAttrs: PropTypes.shape({
|
114
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
115
|
+
}),
|
114
116
|
className: PropTypes.string,
|
115
117
|
classes: PropTypes.shape({
|
116
118
|
root: PropTypes.string,
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import React, { Ref } from 'react';
|
2
2
|
import './ButtonLinkBox.less';
|
3
3
|
export interface IButtonLinkBoxProps {
|
4
|
-
/**
|
4
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
5
5
|
dataAttrs?: {
|
6
|
-
|
6
|
+
root?: Record<string, string>;
|
7
7
|
};
|
8
8
|
/** Дополнительный класс корневого элемента */
|
9
9
|
className?: string;
|
@@ -46,7 +46,7 @@ var ButtonLinkBox = function ButtonLinkBox(_ref) {
|
|
46
46
|
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
47
47
|
onButtonClick = _ref.onButtonClick,
|
48
48
|
onLinkClick = _ref.onLinkClick;
|
49
|
-
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs), {
|
49
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
50
50
|
className: cn({
|
51
51
|
'h-align': hAlign
|
52
52
|
}, [className, classes.root]),
|
@@ -73,7 +73,9 @@ var ButtonLinkBox = function ButtonLinkBox(_ref) {
|
|
73
73
|
};
|
74
74
|
|
75
75
|
ButtonLinkBox.propTypes = {
|
76
|
-
dataAttrs: PropTypes.
|
76
|
+
dataAttrs: PropTypes.shape({
|
77
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
78
|
+
}),
|
77
79
|
className: PropTypes.string,
|
78
80
|
classes: PropTypes.shape({
|
79
81
|
root: PropTypes.string,
|
@@ -56,9 +56,9 @@ export interface IStoreBannerProps {
|
|
56
56
|
};
|
57
57
|
/** Ссылка на корневой элемент */
|
58
58
|
rootRef?: React.Ref<HTMLDivElement>;
|
59
|
-
/**
|
59
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
60
60
|
dataAttrs?: {
|
61
|
-
|
61
|
+
root?: Record<string, string>;
|
62
62
|
};
|
63
63
|
}
|
64
64
|
declare const StoreBanner: React.FC<IStoreBannerProps>;
|
@@ -75,7 +75,7 @@ var StoreBanner = function StoreBanner(_ref) {
|
|
75
75
|
mask: deviceMask
|
76
76
|
}, [className, rootClassName]),
|
77
77
|
ref: rootRef
|
78
|
-
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs)), /*#__PURE__*/React.createElement("div", {
|
78
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("div", {
|
79
79
|
className: cn('container')
|
80
80
|
}, /*#__PURE__*/React.createElement("div", {
|
81
81
|
className: cn('grid')
|
@@ -162,8 +162,10 @@ StoreBanner.propTypes = {
|
|
162
162
|
rootRef: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
163
163
|
current: _propTypes["default"].elementType
|
164
164
|
}), _propTypes["default"].any])]),
|
165
|
-
|
166
|
-
|
165
|
+
theme: _propTypes["default"].oneOf(Object.values(Theme)),
|
166
|
+
dataAttrs: _propTypes["default"].shape({
|
167
|
+
root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
|
168
|
+
})
|
167
169
|
};
|
168
170
|
var _default = StoreBanner;
|
169
171
|
exports["default"] = _default;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import './TitleDescriptionBox.less';
|
3
3
|
export interface ITitleDescriptionBoxProps {
|
4
|
-
/**
|
4
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
5
5
|
dataAttrs?: {
|
6
|
-
|
6
|
+
root?: Record<string, string>;
|
7
7
|
};
|
8
8
|
/** Ссылка на корневой элемент */
|
9
9
|
rootRef?: React.Ref<HTMLDivElement>;
|
@@ -50,7 +50,7 @@ var TitleDescriptionBox = function TitleDescriptionBox(_ref) {
|
|
50
50
|
className: cn('description')
|
51
51
|
}, description);
|
52
52
|
}, [description]);
|
53
|
-
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs), {
|
53
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
54
54
|
className: cn({
|
55
55
|
'h-align': hAlign,
|
56
56
|
'text-color': textColor
|
@@ -71,7 +71,9 @@ var TitleDescriptionBox = function TitleDescriptionBox(_ref) {
|
|
71
71
|
};
|
72
72
|
|
73
73
|
TitleDescriptionBox.propTypes = {
|
74
|
-
dataAttrs: PropTypes.
|
74
|
+
dataAttrs: PropTypes.shape({
|
75
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
76
|
+
}),
|
75
77
|
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
76
78
|
current: PropTypes.elementType
|
77
79
|
}), PropTypes.any])]),
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@megafon/ui-shared",
|
3
|
-
"version": "3.0.0-beta.
|
3
|
+
"version": "3.0.0-beta.7",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"@babel/preset-env": "^7.8.6",
|
53
53
|
"@babel/preset-react": "^7.8.3",
|
54
54
|
"@babel/preset-typescript": "^7.8.3",
|
55
|
-
"@megafon/ui-icons": "^1.0.0-beta.
|
55
|
+
"@megafon/ui-icons": "^1.0.0-beta.4",
|
56
56
|
"@svgr/core": "^2.4.1",
|
57
57
|
"@types/enzyme": "^3.10.5",
|
58
58
|
"@types/enzyme-adapter-react-16": "^1.0.6",
|
@@ -82,13 +82,13 @@
|
|
82
82
|
},
|
83
83
|
"dependencies": {
|
84
84
|
"@babel/runtime": "^7.8.4",
|
85
|
-
"@megafon/ui-core": "^3.0.0-beta.
|
86
|
-
"@megafon/ui-helpers": "^2.0.0-beta.
|
85
|
+
"@megafon/ui-core": "^3.0.0-beta.7",
|
86
|
+
"@megafon/ui-helpers": "^2.0.0-beta.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": "
|
93
|
+
"gitHead": "29a52b2d41115e8a40731d91a89d88c3e3fd4e9e"
|
94
94
|
}
|