@megafon/ui-shared 4.0.0-beta.9 → 4.0.2
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 +28 -10
- package/dist/es/components/BenefitsPictures/BenefitsPictures.d.ts +1 -1
- package/dist/es/components/BenefitsPictures/BenefitsPictures.js +8 -8
- package/dist/es/components/Breadcrumbs/Breadcrumbs.d.ts +0 -1
- package/dist/es/components/Breadcrumbs/Breadcrumbs.js +3 -6
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.d.ts +1 -1
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +3 -3
- package/dist/es/components/Steps/Steps.js +1 -1
- package/dist/es/components/TextWithIcon/TextWithIcon.d.ts +0 -2
- package/dist/es/components/TextWithIcon/TextWithIcon.js +1 -6
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +1 -1
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.js +4 -4
- package/dist/es/components/VideoBanner/VideoBanner.d.ts +4 -0
- package/dist/es/components/VideoBanner/VideoBanner.js +4 -0
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.d.ts +1 -1
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.js +8 -8
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.d.ts +0 -1
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.js +3 -6
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.d.ts +1 -1
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +3 -3
- package/dist/lib/components/Steps/Steps.js +1 -1
- package/dist/lib/components/TextWithIcon/TextWithIcon.d.ts +0 -2
- package/dist/lib/components/TextWithIcon/TextWithIcon.js +1 -6
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +1 -1
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.js +4 -4
- package/dist/lib/components/VideoBanner/VideoBanner.d.ts +4 -0
- package/dist/lib/components/VideoBanner/VideoBanner.js +4 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -3,39 +3,57 @@
|
|
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
|
-
|
6
|
+
## [4.0.2](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@4.0.1...@megafon/ui-shared@4.0.2) (2022-09-14)
|
7
7
|
|
8
|
+
**Note:** Version bump only for package @megafon/ui-shared
|
8
9
|
|
9
|
-
### Features
|
10
10
|
|
11
|
-
* **header:** add new prop space ([e5bef7c](https://github.com/MegafonWebLab/megafon-ui/commit/e5bef7c8e13c57e477a4c25f07a4a4a6dbb8b6bd))
|
12
11
|
|
13
12
|
|
14
13
|
|
14
|
+
## [4.0.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@4.0.0...@megafon/ui-shared@4.0.1) (2022-09-14)
|
15
15
|
|
16
16
|
|
17
|
-
|
17
|
+
### Bug Fixes
|
18
18
|
|
19
|
-
|
19
|
+
* remove forgotten deprecated props ([3acaf97](https://github.com/MegafonWebLab/megafon-ui/commit/3acaf9731780f89c7087a8b6f9af943a62f7a185))
|
20
20
|
|
21
21
|
|
22
22
|
|
23
23
|
|
24
24
|
|
25
|
-
# [4.0.0
|
25
|
+
# [4.0.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.5.0...@megafon/ui-shared@4.0.0) (2022-09-14)
|
26
26
|
|
27
|
-
**Note:** Version bump only for package @megafon/ui-shared
|
28
27
|
|
28
|
+
### Bug Fixes
|
29
29
|
|
30
|
+
* **breadcrumbs:** change default color prop value from black to default ([fd0c9b6](https://github.com/MegafonWebLab/megafon-ui/commit/fd0c9b645d41523f34b198e3f9310d27ea7e34f3))
|
30
31
|
|
31
32
|
|
33
|
+
### Features
|
34
|
+
|
35
|
+
* **header:** add new prop space ([7a9479e](https://github.com/MegafonWebLab/megafon-ui/commit/7a9479e85c1f5c19b7f2bae2e6a4d234712f2d7c))
|
36
|
+
* **paragraph:** remove prop size; add new prop; add 'pale' option to colors ([32b0c54](https://github.com/MegafonWebLab/megafon-ui/commit/32b0c54eaf82ceb1f24d5fc90a9aa81d3e427ee3))
|
37
|
+
* **tabs:** update by new design ([08d76f0](https://github.com/MegafonWebLab/megafon-ui/commit/08d76f0e15b8b7a54a18d7f115db4744b12e8ac2))
|
38
|
+
* **text-with-icon:** delete centering in mobile resolution ([0bf1236](https://github.com/MegafonWebLab/megafon-ui/commit/0bf1236c216a327bf574c5dc0e2009e98479390a))
|
39
|
+
|
40
|
+
|
41
|
+
### BREAKING CHANGES
|
42
|
+
|
43
|
+
* **text-with-icon:** centering in mobile resolution was removed according guides
|
44
|
+
* **tabs:** new prop autoWidth added
|
45
|
+
size prop small vallue removed
|
46
|
+
new sizes
|
47
|
+
* **breadcrumbs:** color is now depends on current theme. by default it matches content text color.
|
48
|
+
for keep black color on light background use 'black' value for prop 'color'.
|
49
|
+
* **paragraph:** prop 'size' is no longer exists.
|
50
|
+
use component Caption instead of Paragraph size="small"
|
51
|
+
|
32
52
|
|
33
|
-
# [4.0.0-beta.6](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.4.3...@megafon/ui-shared@4.0.0-beta.6) (2022-06-29)
|
34
53
|
|
35
54
|
|
36
|
-
### Bug Fixes
|
37
55
|
|
38
|
-
|
56
|
+
# [3.5.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.4.6...@megafon/ui-shared@3.5.0) (2022-09-14)
|
39
57
|
|
40
58
|
|
41
59
|
### Features
|
@@ -7,7 +7,7 @@ export interface IBenefitsPicturesProps {
|
|
7
7
|
/** Данные для бенефитов */
|
8
8
|
items: IBenefit[];
|
9
9
|
/** Горизонтальное выравнивание */
|
10
|
-
|
10
|
+
align?: 'left' | 'center';
|
11
11
|
/** Расстояние между бенефитами */
|
12
12
|
gridGap?: GridGutterSize;
|
13
13
|
/** Дополнительный css класс для корневого элемента */
|
@@ -113,8 +113,8 @@ var cn = cnCreate('mfui-benefits-pictures');
|
|
113
113
|
|
114
114
|
var BenefitsPictures = function BenefitsPictures(_ref) {
|
115
115
|
var items = _ref.items,
|
116
|
-
_ref$
|
117
|
-
|
116
|
+
_ref$align = _ref.align,
|
117
|
+
align = _ref$align === void 0 ? 'left' : _ref$align,
|
118
118
|
_ref$gridGap = _ref.gridGap,
|
119
119
|
gridGap = _ref$gridGap === void 0 ? 'large' : _ref$gridGap,
|
120
120
|
rootRef = _ref.rootRef,
|
@@ -122,7 +122,7 @@ var BenefitsPictures = function BenefitsPictures(_ref) {
|
|
122
122
|
_ref$classes = _ref.classes,
|
123
123
|
classes = _ref$classes === void 0 ? {} : _ref$classes;
|
124
124
|
var isLargeGutter = gridGap === 'large';
|
125
|
-
var isGridCenterAlign =
|
125
|
+
var isGridCenterAlign = align === 'center' && items.length !== ONLY_LEFT_ALIGN_ITEMS_COUNT;
|
126
126
|
|
127
127
|
var _React$useState = React.useState(gridGap),
|
128
128
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
@@ -158,22 +158,22 @@ var BenefitsPictures = function BenefitsPictures(_ref) {
|
|
158
158
|
var img = _ref2.img,
|
159
159
|
title = _ref2.title,
|
160
160
|
text = _ref2.text;
|
161
|
-
return /*#__PURE__*/React.createElement(GridColumn, _extends({},
|
161
|
+
return /*#__PURE__*/React.createElement(GridColumn, _extends({}, align === 'left' ? getLeftConfig(items.length, index) : getCenterConfig(items.length, index, gridGap), {
|
162
162
|
key: index
|
163
163
|
}), /*#__PURE__*/React.createElement("div", {
|
164
164
|
className: cn('item', [classes.item])
|
165
165
|
}, /*#__PURE__*/React.createElement("img", {
|
166
166
|
className: cn('img', {
|
167
|
-
'h-align':
|
167
|
+
'h-align': align
|
168
168
|
}),
|
169
169
|
src: img,
|
170
170
|
alt: ""
|
171
171
|
}), /*#__PURE__*/React.createElement(Header, {
|
172
172
|
className: cn('title'),
|
173
|
-
|
173
|
+
align: align,
|
174
174
|
as: "h3"
|
175
175
|
}, convert(title)), /*#__PURE__*/React.createElement(Paragraph, {
|
176
|
-
align:
|
176
|
+
align: align
|
177
177
|
}, convert(text))));
|
178
178
|
})));
|
179
179
|
};
|
@@ -187,7 +187,7 @@ BenefitsPictures.propTypes = {
|
|
187
187
|
text: PropTypes.string.isRequired,
|
188
188
|
img: PropTypes.string.isRequired
|
189
189
|
}).isRequired).isRequired,
|
190
|
-
|
190
|
+
align: PropTypes.oneOf(['left', 'center']),
|
191
191
|
gridGap: PropTypes.oneOf(['medium', 'large']),
|
192
192
|
className: PropTypes.string,
|
193
193
|
classes: PropTypes.shape({
|
@@ -46,8 +46,8 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
46
46
|
if (isObjectElement(item)) {
|
47
47
|
return /*#__PURE__*/React.createElement("div", {
|
48
48
|
className: cn('item', classes.item),
|
49
|
-
key: item.
|
50
|
-
},
|
49
|
+
key: item.title
|
50
|
+
}, /*#__PURE__*/React.createElement(TextLink, {
|
51
51
|
href: item.href,
|
52
52
|
color: color,
|
53
53
|
dataAttrs: {
|
@@ -71,10 +71,7 @@ Breadcrumbs.propTypes = {
|
|
71
71
|
}),
|
72
72
|
items: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.arrayOf(PropTypes.shape({
|
73
73
|
title: PropTypes.string,
|
74
|
-
href: PropTypes.string
|
75
|
-
|
76
|
-
/* @deprecated */
|
77
|
-
component: PropTypes.element
|
74
|
+
href: PropTypes.string
|
78
75
|
}).isRequired)]).isRequired,
|
79
76
|
color: PropTypes.oneOf(Object.values(TextColor))
|
80
77
|
};
|
@@ -36,7 +36,7 @@ export interface IButtonLinkBoxProps {
|
|
36
36
|
/** Добавляет атрибут download к свойству тега <a> */
|
37
37
|
linkDownload?: boolean;
|
38
38
|
/** Горизонтальное выравнивание */
|
39
|
-
|
39
|
+
align?: 'center' | 'left';
|
40
40
|
/** Обработчик клика по кнопке */
|
41
41
|
onButtonClick?: (e: React.SyntheticEvent<EventTarget>) => void;
|
42
42
|
/** Обработчик клика по ссылке */
|
@@ -18,7 +18,7 @@ var ButtonLinkBox = function ButtonLinkBox(_ref) {
|
|
18
18
|
linkTitle = _ref.linkTitle,
|
19
19
|
linkUrl = _ref.linkUrl,
|
20
20
|
linkDownload = _ref.linkDownload,
|
21
|
-
|
21
|
+
align = _ref.align,
|
22
22
|
className = _ref.className,
|
23
23
|
buttonTarget = _ref.buttonTarget,
|
24
24
|
linkTarget = _ref.linkTarget,
|
@@ -28,7 +28,7 @@ var ButtonLinkBox = function ButtonLinkBox(_ref) {
|
|
28
28
|
onLinkClick = _ref.onLinkClick;
|
29
29
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
30
30
|
className: cn({
|
31
|
-
'h-align':
|
31
|
+
'h-align': align
|
32
32
|
}, [className, classes.root]),
|
33
33
|
ref: rootRef
|
34
34
|
}), buttonTitle && /*#__PURE__*/React.createElement("div", {
|
@@ -80,7 +80,7 @@ ButtonLinkBox.propTypes = {
|
|
80
80
|
linkTitle: PropTypes.string,
|
81
81
|
linkUrl: PropTypes.string,
|
82
82
|
linkDownload: PropTypes.bool,
|
83
|
-
|
83
|
+
align: PropTypes.oneOf(['center']),
|
84
84
|
onButtonClick: PropTypes.func,
|
85
85
|
onLinkClick: PropTypes.func
|
86
86
|
};
|
@@ -14,8 +14,6 @@ export interface ITextWithIconProps {
|
|
14
14
|
className?: string;
|
15
15
|
/** Включить растягивание на всю ширину контейнера */
|
16
16
|
isFullWidth?: boolean;
|
17
|
-
/** Выравнивание по центру на мобильных */
|
18
|
-
centeringOnMobile?: boolean;
|
19
17
|
/** Допустимый дочерний компонент */
|
20
18
|
children: React.ReactElement<ITextWithIconItem>[] | React.ReactElement<ITextWithIconItem>;
|
21
19
|
}
|
@@ -13,8 +13,6 @@ var TextWithIcon = function TextWithIcon(_ref) {
|
|
13
13
|
className = _ref.className,
|
14
14
|
_ref$isFullWidth = _ref.isFullWidth,
|
15
15
|
isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
|
16
|
-
_ref$centeringOnMobil = _ref.centeringOnMobile,
|
17
|
-
centeringOnMobile = _ref$centeringOnMobil === void 0 ? true : _ref$centeringOnMobil,
|
18
16
|
children = _ref.children;
|
19
17
|
|
20
18
|
var renderContent = function renderContent() {
|
@@ -34,9 +32,7 @@ var TextWithIcon = function TextWithIcon(_ref) {
|
|
34
32
|
};
|
35
33
|
|
36
34
|
return /*#__PURE__*/React.createElement("div", _extends({
|
37
|
-
className: cn(
|
38
|
-
'centering-on-mobile': centeringOnMobile
|
39
|
-
}, [className]),
|
35
|
+
className: cn([className]),
|
40
36
|
ref: rootRef
|
41
37
|
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), isFullWidth ? renderContent() : renderContentWithGrid());
|
42
38
|
};
|
@@ -51,7 +47,6 @@ TextWithIcon.propTypes = {
|
|
51
47
|
}),
|
52
48
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element.isRequired]).isRequired,
|
53
49
|
isFullWidth: PropTypes.bool,
|
54
|
-
centeringOnMobile: PropTypes.bool,
|
55
50
|
className: PropTypes.string
|
56
51
|
};
|
57
52
|
export default TextWithIcon;
|
@@ -16,7 +16,7 @@ export interface ITitleDescriptionBoxProps {
|
|
16
16
|
/** Цвет текста */
|
17
17
|
textColor?: 'white';
|
18
18
|
/** Горизонтальное выравнивание */
|
19
|
-
|
19
|
+
align?: 'center';
|
20
20
|
}
|
21
21
|
declare const TitleDescriptionBox: React.FC<ITitleDescriptionBoxProps>;
|
22
22
|
export default TitleDescriptionBox;
|
@@ -13,7 +13,7 @@ var TitleDescriptionBox = function TitleDescriptionBox(_ref) {
|
|
13
13
|
title = _ref.title,
|
14
14
|
description = _ref.description,
|
15
15
|
textColor = _ref.textColor,
|
16
|
-
|
16
|
+
align = _ref.align,
|
17
17
|
rootRef = _ref.rootRef,
|
18
18
|
className = _ref.className;
|
19
19
|
var renderDescription = React.useCallback(function () {
|
@@ -31,12 +31,12 @@ var TitleDescriptionBox = function TitleDescriptionBox(_ref) {
|
|
31
31
|
}, [description]);
|
32
32
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
33
33
|
className: cn({
|
34
|
-
'h-align':
|
34
|
+
'h-align': align,
|
35
35
|
'text-color': textColor
|
36
36
|
}, className),
|
37
37
|
ref: rootRef
|
38
38
|
}), /*#__PURE__*/React.createElement(Grid, {
|
39
|
-
hAlign:
|
39
|
+
hAlign: align
|
40
40
|
}, /*#__PURE__*/React.createElement(GridColumn, {
|
41
41
|
wide: "8",
|
42
42
|
desktop: "10"
|
@@ -59,7 +59,7 @@ TitleDescriptionBox.propTypes = {
|
|
59
59
|
className: PropTypes.string,
|
60
60
|
title: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.node)]),
|
61
61
|
description: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.node)]),
|
62
|
-
|
62
|
+
align: PropTypes.oneOf(['center']),
|
63
63
|
textColor: PropTypes.oneOf(['white'])
|
64
64
|
};
|
65
65
|
export default TitleDescriptionBox;
|
@@ -30,6 +30,8 @@ export interface IContent {
|
|
30
30
|
buttonTitle?: string;
|
31
31
|
/** Ссылка на кнопке */
|
32
32
|
buttonHref?: string;
|
33
|
+
/** Target свойство кнопки */
|
34
|
+
buttonTarget?: '_self' | '_blank' | '_parent' | '_top';
|
33
35
|
/** Добавляет атрибут download для тега <a> компонента Button */
|
34
36
|
buttonDownload?: boolean;
|
35
37
|
/** Цвет кнопки */
|
@@ -46,6 +48,8 @@ export interface IContent {
|
|
46
48
|
linkTitle?: string;
|
47
49
|
/** Адрес ссылки */
|
48
50
|
linkUrl?: string;
|
51
|
+
/** Target свойство ссылки */
|
52
|
+
linkTarget?: '_self' | '_blank' | '_parent' | '_top';
|
49
53
|
/** Добавляет атрибут download для тега <a> компонента TextLink */
|
50
54
|
linkDownload?: boolean;
|
51
55
|
/** Строка со стоимостью услуги */
|
@@ -79,6 +79,7 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
79
79
|
description = _ref3.description,
|
80
80
|
buttonTitle = _ref3.buttonTitle,
|
81
81
|
buttonHref = _ref3.buttonHref,
|
82
|
+
buttonTarget = _ref3.buttonTarget,
|
82
83
|
buttonDownload = _ref3.buttonDownload,
|
83
84
|
_ref3$buttonColor = _ref3.buttonColor,
|
84
85
|
buttonColor = _ref3$buttonColor === void 0 ? ButtonColor.GREEN : _ref3$buttonColor,
|
@@ -89,6 +90,7 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
89
90
|
textColorMobile = _ref3.textColorMobile,
|
90
91
|
linkTitle = _ref3.linkTitle,
|
91
92
|
linkUrl = _ref3.linkUrl,
|
93
|
+
linkTarget = _ref3.linkTarget,
|
92
94
|
linkDownload = _ref3.linkDownload,
|
93
95
|
cost = _ref3.cost;
|
94
96
|
return /*#__PURE__*/React.createElement(Grid, {
|
@@ -125,6 +127,7 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
125
127
|
className: cn(ClassName.BUTTON, [classes.button]),
|
126
128
|
theme: buttonColor,
|
127
129
|
href: buttonHref,
|
130
|
+
target: buttonTarget,
|
128
131
|
onClick: onButtonClick,
|
129
132
|
download: buttonDownload
|
130
133
|
}, buttonTitle), linkTitle && /*#__PURE__*/React.createElement(TextLink, {
|
@@ -134,6 +137,7 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
134
137
|
className: cn(ClassName.LINK, [classes.link]),
|
135
138
|
href: linkUrl,
|
136
139
|
download: linkDownload,
|
140
|
+
target: linkTarget,
|
137
141
|
onClick: onLinkClick
|
138
142
|
}, linkTitle)))));
|
139
143
|
}, [classes.button, classes.link, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link]);
|
@@ -7,7 +7,7 @@ export interface IBenefitsPicturesProps {
|
|
7
7
|
/** Данные для бенефитов */
|
8
8
|
items: IBenefit[];
|
9
9
|
/** Горизонтальное выравнивание */
|
10
|
-
|
10
|
+
align?: 'left' | 'center';
|
11
11
|
/** Расстояние между бенефитами */
|
12
12
|
gridGap?: GridGutterSize;
|
13
13
|
/** Дополнительный css класс для корневого элемента */
|
@@ -136,8 +136,8 @@ var cn = (0, _uiHelpers.cnCreate)('mfui-benefits-pictures');
|
|
136
136
|
|
137
137
|
var BenefitsPictures = function BenefitsPictures(_ref) {
|
138
138
|
var items = _ref.items,
|
139
|
-
_ref$
|
140
|
-
|
139
|
+
_ref$align = _ref.align,
|
140
|
+
align = _ref$align === void 0 ? 'left' : _ref$align,
|
141
141
|
_ref$gridGap = _ref.gridGap,
|
142
142
|
gridGap = _ref$gridGap === void 0 ? 'large' : _ref$gridGap,
|
143
143
|
rootRef = _ref.rootRef,
|
@@ -145,7 +145,7 @@ var BenefitsPictures = function BenefitsPictures(_ref) {
|
|
145
145
|
_ref$classes = _ref.classes,
|
146
146
|
classes = _ref$classes === void 0 ? {} : _ref$classes;
|
147
147
|
var isLargeGutter = gridGap === 'large';
|
148
|
-
var isGridCenterAlign =
|
148
|
+
var isGridCenterAlign = align === 'center' && items.length !== ONLY_LEFT_ALIGN_ITEMS_COUNT;
|
149
149
|
|
150
150
|
var _React$useState = React.useState(gridGap),
|
151
151
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
@@ -181,22 +181,22 @@ var BenefitsPictures = function BenefitsPictures(_ref) {
|
|
181
181
|
var img = _ref2.img,
|
182
182
|
title = _ref2.title,
|
183
183
|
text = _ref2.text;
|
184
|
-
return /*#__PURE__*/React.createElement(_uiCore.GridColumn, (0, _extends2["default"])({},
|
184
|
+
return /*#__PURE__*/React.createElement(_uiCore.GridColumn, (0, _extends2["default"])({}, align === 'left' ? getLeftConfig(items.length, index) : getCenterConfig(items.length, index, gridGap), {
|
185
185
|
key: index
|
186
186
|
}), /*#__PURE__*/React.createElement("div", {
|
187
187
|
className: cn('item', [classes.item])
|
188
188
|
}, /*#__PURE__*/React.createElement("img", {
|
189
189
|
className: cn('img', {
|
190
|
-
'h-align':
|
190
|
+
'h-align': align
|
191
191
|
}),
|
192
192
|
src: img,
|
193
193
|
alt: ""
|
194
194
|
}), /*#__PURE__*/React.createElement(_uiCore.Header, {
|
195
195
|
className: cn('title'),
|
196
|
-
|
196
|
+
align: align,
|
197
197
|
as: "h3"
|
198
198
|
}, (0, _htmr["default"])(title)), /*#__PURE__*/React.createElement(_uiCore.Paragraph, {
|
199
|
-
align:
|
199
|
+
align: align
|
200
200
|
}, (0, _htmr["default"])(text))));
|
201
201
|
})));
|
202
202
|
};
|
@@ -210,7 +210,7 @@ BenefitsPictures.propTypes = {
|
|
210
210
|
text: _propTypes["default"].string.isRequired,
|
211
211
|
img: _propTypes["default"].string.isRequired
|
212
212
|
}).isRequired).isRequired,
|
213
|
-
|
213
|
+
align: _propTypes["default"].oneOf(['left', 'center']),
|
214
214
|
gridGap: _propTypes["default"].oneOf(['medium', 'large']),
|
215
215
|
className: _propTypes["default"].string,
|
216
216
|
classes: _propTypes["default"].shape({
|
@@ -63,8 +63,8 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
63
63
|
if (isObjectElement(item)) {
|
64
64
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
65
65
|
className: cn('item', classes.item),
|
66
|
-
key: item.
|
67
|
-
},
|
66
|
+
key: item.title
|
67
|
+
}, /*#__PURE__*/_react["default"].createElement(_uiCore.TextLink, {
|
68
68
|
href: item.href,
|
69
69
|
color: color,
|
70
70
|
dataAttrs: {
|
@@ -88,10 +88,7 @@ Breadcrumbs.propTypes = {
|
|
88
88
|
}),
|
89
89
|
items: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].element.isRequired), _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
90
90
|
title: _propTypes["default"].string,
|
91
|
-
href: _propTypes["default"].string
|
92
|
-
|
93
|
-
/* @deprecated */
|
94
|
-
component: _propTypes["default"].element
|
91
|
+
href: _propTypes["default"].string
|
95
92
|
}).isRequired)]).isRequired,
|
96
93
|
color: _propTypes["default"].oneOf(Object.values(TextColor))
|
97
94
|
};
|
@@ -36,7 +36,7 @@ export interface IButtonLinkBoxProps {
|
|
36
36
|
/** Добавляет атрибут download к свойству тега <a> */
|
37
37
|
linkDownload?: boolean;
|
38
38
|
/** Горизонтальное выравнивание */
|
39
|
-
|
39
|
+
align?: 'center' | 'left';
|
40
40
|
/** Обработчик клика по кнопке */
|
41
41
|
onButtonClick?: (e: React.SyntheticEvent<EventTarget>) => void;
|
42
42
|
/** Обработчик клика по ссылке */
|
@@ -38,7 +38,7 @@ var ButtonLinkBox = function ButtonLinkBox(_ref) {
|
|
38
38
|
linkTitle = _ref.linkTitle,
|
39
39
|
linkUrl = _ref.linkUrl,
|
40
40
|
linkDownload = _ref.linkDownload,
|
41
|
-
|
41
|
+
align = _ref.align,
|
42
42
|
className = _ref.className,
|
43
43
|
buttonTarget = _ref.buttonTarget,
|
44
44
|
linkTarget = _ref.linkTarget,
|
@@ -48,7 +48,7 @@ var ButtonLinkBox = function ButtonLinkBox(_ref) {
|
|
48
48
|
onLinkClick = _ref.onLinkClick;
|
49
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
|
-
'h-align':
|
51
|
+
'h-align': align
|
52
52
|
}, [className, classes.root]),
|
53
53
|
ref: rootRef
|
54
54
|
}), buttonTitle && /*#__PURE__*/_react["default"].createElement("div", {
|
@@ -100,7 +100,7 @@ ButtonLinkBox.propTypes = {
|
|
100
100
|
linkTitle: PropTypes.string,
|
101
101
|
linkUrl: PropTypes.string,
|
102
102
|
linkDownload: PropTypes.bool,
|
103
|
-
|
103
|
+
align: PropTypes.oneOf(['center']),
|
104
104
|
onButtonClick: PropTypes.func,
|
105
105
|
onLinkClick: PropTypes.func
|
106
106
|
};
|
@@ -34,7 +34,7 @@ var Steps = function Steps(_ref) {
|
|
34
34
|
ref: rootRef
|
35
35
|
}, /*#__PURE__*/React.createElement(_uiCore.Header, {
|
36
36
|
as: "h2",
|
37
|
-
|
37
|
+
align: "center",
|
38
38
|
className: cn('title')
|
39
39
|
}, title), /*#__PURE__*/React.createElement("ul", {
|
40
40
|
className: cn('list')
|
@@ -14,8 +14,6 @@ export interface ITextWithIconProps {
|
|
14
14
|
className?: string;
|
15
15
|
/** Включить растягивание на всю ширину контейнера */
|
16
16
|
isFullWidth?: boolean;
|
17
|
-
/** Выравнивание по центру на мобильных */
|
18
|
-
centeringOnMobile?: boolean;
|
19
17
|
/** Допустимый дочерний компонент */
|
20
18
|
children: React.ReactElement<ITextWithIconItem>[] | React.ReactElement<ITextWithIconItem>;
|
21
19
|
}
|
@@ -32,8 +32,6 @@ var TextWithIcon = function TextWithIcon(_ref) {
|
|
32
32
|
className = _ref.className,
|
33
33
|
_ref$isFullWidth = _ref.isFullWidth,
|
34
34
|
isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
|
35
|
-
_ref$centeringOnMobil = _ref.centeringOnMobile,
|
36
|
-
centeringOnMobile = _ref$centeringOnMobil === void 0 ? true : _ref$centeringOnMobil,
|
37
35
|
children = _ref.children;
|
38
36
|
|
39
37
|
var renderContent = function renderContent() {
|
@@ -53,9 +51,7 @@ var TextWithIcon = function TextWithIcon(_ref) {
|
|
53
51
|
};
|
54
52
|
|
55
53
|
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
|
56
|
-
className: cn(
|
57
|
-
'centering-on-mobile': centeringOnMobile
|
58
|
-
}, [className]),
|
54
|
+
className: cn([className]),
|
59
55
|
ref: rootRef
|
60
56
|
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), isFullWidth ? renderContent() : renderContentWithGrid());
|
61
57
|
};
|
@@ -70,7 +66,6 @@ TextWithIcon.propTypes = {
|
|
70
66
|
}),
|
71
67
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element.isRequired]).isRequired,
|
72
68
|
isFullWidth: PropTypes.bool,
|
73
|
-
centeringOnMobile: PropTypes.bool,
|
74
69
|
className: PropTypes.string
|
75
70
|
};
|
76
71
|
var _default = TextWithIcon;
|
@@ -16,7 +16,7 @@ export interface ITitleDescriptionBoxProps {
|
|
16
16
|
/** Цвет текста */
|
17
17
|
textColor?: 'white';
|
18
18
|
/** Горизонтальное выравнивание */
|
19
|
-
|
19
|
+
align?: 'center';
|
20
20
|
}
|
21
21
|
declare const TitleDescriptionBox: React.FC<ITitleDescriptionBoxProps>;
|
22
22
|
export default TitleDescriptionBox;
|
@@ -34,7 +34,7 @@ var TitleDescriptionBox = function TitleDescriptionBox(_ref) {
|
|
34
34
|
title = _ref.title,
|
35
35
|
description = _ref.description,
|
36
36
|
textColor = _ref.textColor,
|
37
|
-
|
37
|
+
align = _ref.align,
|
38
38
|
rootRef = _ref.rootRef,
|
39
39
|
className = _ref.className;
|
40
40
|
var renderDescription = React.useCallback(function () {
|
@@ -52,12 +52,12 @@ var TitleDescriptionBox = function TitleDescriptionBox(_ref) {
|
|
52
52
|
}, [description]);
|
53
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
|
-
'h-align':
|
55
|
+
'h-align': align,
|
56
56
|
'text-color': textColor
|
57
57
|
}, className),
|
58
58
|
ref: rootRef
|
59
59
|
}), /*#__PURE__*/React.createElement(_uiCore.Grid, {
|
60
|
-
hAlign:
|
60
|
+
hAlign: align
|
61
61
|
}, /*#__PURE__*/React.createElement(_uiCore.GridColumn, {
|
62
62
|
wide: "8",
|
63
63
|
desktop: "10"
|
@@ -80,7 +80,7 @@ TitleDescriptionBox.propTypes = {
|
|
80
80
|
className: PropTypes.string,
|
81
81
|
title: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.node)]),
|
82
82
|
description: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.node)]),
|
83
|
-
|
83
|
+
align: PropTypes.oneOf(['center']),
|
84
84
|
textColor: PropTypes.oneOf(['white'])
|
85
85
|
};
|
86
86
|
var _default = TitleDescriptionBox;
|
@@ -30,6 +30,8 @@ export interface IContent {
|
|
30
30
|
buttonTitle?: string;
|
31
31
|
/** Ссылка на кнопке */
|
32
32
|
buttonHref?: string;
|
33
|
+
/** Target свойство кнопки */
|
34
|
+
buttonTarget?: '_self' | '_blank' | '_parent' | '_top';
|
33
35
|
/** Добавляет атрибут download для тега <a> компонента Button */
|
34
36
|
buttonDownload?: boolean;
|
35
37
|
/** Цвет кнопки */
|
@@ -46,6 +48,8 @@ export interface IContent {
|
|
46
48
|
linkTitle?: string;
|
47
49
|
/** Адрес ссылки */
|
48
50
|
linkUrl?: string;
|
51
|
+
/** Target свойство ссылки */
|
52
|
+
linkTarget?: '_self' | '_blank' | '_parent' | '_top';
|
49
53
|
/** Добавляет атрибут download для тега <a> компонента TextLink */
|
50
54
|
linkDownload?: boolean;
|
51
55
|
/** Строка со стоимостью услуги */
|
@@ -112,6 +112,7 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
112
112
|
description = _ref3.description,
|
113
113
|
buttonTitle = _ref3.buttonTitle,
|
114
114
|
buttonHref = _ref3.buttonHref,
|
115
|
+
buttonTarget = _ref3.buttonTarget,
|
115
116
|
buttonDownload = _ref3.buttonDownload,
|
116
117
|
_ref3$buttonColor = _ref3.buttonColor,
|
117
118
|
buttonColor = _ref3$buttonColor === void 0 ? ButtonColor.GREEN : _ref3$buttonColor,
|
@@ -122,6 +123,7 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
122
123
|
textColorMobile = _ref3.textColorMobile,
|
123
124
|
linkTitle = _ref3.linkTitle,
|
124
125
|
linkUrl = _ref3.linkUrl,
|
126
|
+
linkTarget = _ref3.linkTarget,
|
125
127
|
linkDownload = _ref3.linkDownload,
|
126
128
|
cost = _ref3.cost;
|
127
129
|
return /*#__PURE__*/_react["default"].createElement(_uiCore.Grid, {
|
@@ -158,6 +160,7 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
158
160
|
className: cn(ClassName.BUTTON, [classes.button]),
|
159
161
|
theme: buttonColor,
|
160
162
|
href: buttonHref,
|
163
|
+
target: buttonTarget,
|
161
164
|
onClick: onButtonClick,
|
162
165
|
download: buttonDownload
|
163
166
|
}, buttonTitle), linkTitle && /*#__PURE__*/_react["default"].createElement(_uiCore.TextLink, {
|
@@ -167,6 +170,7 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
167
170
|
className: cn(ClassName.LINK, [classes.link]),
|
168
171
|
href: linkUrl,
|
169
172
|
download: linkDownload,
|
173
|
+
target: linkTarget,
|
170
174
|
onClick: onLinkClick
|
171
175
|
}, linkTitle)))));
|
172
176
|
}, [classes.button, classes.link, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link]);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@megafon/ui-shared",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.2",
|
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": "^2.0.0
|
55
|
+
"@megafon/ui-icons": "^2.0.0",
|
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,7 +82,7 @@
|
|
82
82
|
},
|
83
83
|
"dependencies": {
|
84
84
|
"@babel/runtime": "^7.8.4",
|
85
|
-
"@megafon/ui-core": "^4.0.
|
85
|
+
"@megafon/ui-core": "^4.0.2",
|
86
86
|
"@megafon/ui-helpers": "^2.1.2",
|
87
87
|
"core-js": "^3.6.4",
|
88
88
|
"htmr": "^0.9.2",
|
@@ -90,5 +90,5 @@
|
|
90
90
|
"prop-types": "^15.7.2",
|
91
91
|
"swiper": "^6.5.6"
|
92
92
|
},
|
93
|
-
"gitHead": "
|
93
|
+
"gitHead": "0d18806bba057218e596480752dd75eede0555e0"
|
94
94
|
}
|