@megafon/ui-shared 5.2.0 → 5.2.1
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 +8 -0
- package/dist/es/components/ButtonBanner/ButtonBanner.js +5 -2
- package/dist/es/components/DownloadLinks/DownloadLink.js +1 -1
- package/dist/es/components/DownloadLinks/DownloadLinks.d.ts +10 -0
- package/dist/es/components/DownloadLinks/DownloadLinks.js +4 -4
- package/dist/es/components/Instructions/Instructions.js +11 -5
- package/dist/es/components/PageTitle/PageTitle.d.ts +2 -2
- package/dist/es/components/PageTitle/PageTitle.js +8 -1
- package/dist/es/components/Partners/Partners.js +12 -2
- package/dist/es/components/PictureWithDescription/PictureWithDescription.js +5 -2
- package/dist/es/components/StoreBanner/StoreBanner.js +5 -2
- package/dist/es/components/TabsBox/TabsBox.d.ts +1 -1
- package/dist/es/components/TabsBox/TabsBox.js +3 -2
- package/dist/es/components/TextBox/TextBox.js +6 -1
- package/dist/es/components/TextWithIcon/TextWithIcon.js +8 -1
- package/dist/es/components/TextWithIcon/TextWithIconItem.js +5 -2
- package/dist/lib/components/ButtonBanner/ButtonBanner.js +5 -2
- package/dist/lib/components/DownloadLinks/DownloadLink.js +1 -1
- package/dist/lib/components/DownloadLinks/DownloadLinks.d.ts +10 -0
- package/dist/lib/components/DownloadLinks/DownloadLinks.js +5 -2
- package/dist/lib/components/Instructions/Instructions.js +11 -5
- package/dist/lib/components/PageTitle/PageTitle.d.ts +2 -2
- package/dist/lib/components/PageTitle/PageTitle.js +8 -1
- package/dist/lib/components/Partners/Partners.js +12 -2
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.js +5 -2
- package/dist/lib/components/StoreBanner/StoreBanner.js +5 -2
- package/dist/lib/components/TabsBox/TabsBox.d.ts +1 -1
- package/dist/lib/components/TabsBox/TabsBox.js +3 -2
- package/dist/lib/components/TextBox/TextBox.js +6 -1
- package/dist/lib/components/TextWithIcon/TextWithIcon.js +8 -1
- package/dist/lib/components/TextWithIcon/TextWithIconItem.js +5 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@
|
|
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.2.1](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.2.0...@megafon/ui-shared@5.2.1) (2023-10-17)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @megafon/ui-shared
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
6
14
|
# [5.2.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.1.0...@megafon/ui-shared@5.2.0) (2023-09-21)
|
7
15
|
|
8
16
|
|
@@ -25,6 +25,7 @@ var getMediaStyle = function getMediaStyle(imageUrl) {
|
|
25
25
|
};
|
26
26
|
|
27
27
|
var cn = cnCreate('mfui-button-banner');
|
28
|
+
var testIdPrefix = 'ButtonBanner';
|
28
29
|
|
29
30
|
var ButtonBanner = function ButtonBanner(_ref) {
|
30
31
|
var dataAttrs = _ref.dataAttrs,
|
@@ -74,7 +75,8 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
74
75
|
leftOffsetDesktop: "1",
|
75
76
|
leftOffsetWide: "1"
|
76
77
|
}, /*#__PURE__*/React.createElement("div", {
|
77
|
-
className: cn('content')
|
78
|
+
className: cn('content'),
|
79
|
+
"data-testid": "".concat(testIdPrefix, "-content")
|
78
80
|
}, /*#__PURE__*/React.createElement(Header, {
|
79
81
|
className: cn('header'),
|
80
82
|
as: "h2"
|
@@ -85,7 +87,8 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
85
87
|
mobile: "12"
|
86
88
|
}, /*#__PURE__*/React.createElement("div", {
|
87
89
|
className: cn('media'),
|
88
|
-
style: getMediaStyle(imageUrl)
|
90
|
+
style: getMediaStyle(imageUrl),
|
91
|
+
"data-testid": "".concat(testIdPrefix, "-media")
|
89
92
|
}, !imageUrl && buttonElem))));
|
90
93
|
};
|
91
94
|
|
@@ -45,7 +45,7 @@ var DownloadLink = function DownloadLink(_ref) {
|
|
45
45
|
className: cn('link', [classes.link])
|
46
46
|
}, text), /*#__PURE__*/React.createElement("p", {
|
47
47
|
className: cn('info')
|
48
|
-
}, "".concat(extension).concat(extension && fileSize ? ',' : ''
|
48
|
+
}, "".concat(extension).concat(extension && fileSize ? ', ' : '').concat(fileSize))));
|
49
49
|
};
|
50
50
|
|
51
51
|
DownloadLink.propTypes = {
|
@@ -1,6 +1,16 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
+
import { GridColumn } from '@megafon/ui-core';
|
2
3
|
import './DownloadLinks.less';
|
3
4
|
import { IDownloadLink } from './DownloadLink';
|
5
|
+
declare type GridColumnType = React.ComponentProps<typeof GridColumn>;
|
6
|
+
declare type ColumnConfig = {
|
7
|
+
wide?: GridColumnType['wide'];
|
8
|
+
desktop?: GridColumnType['desktop'];
|
9
|
+
tablet?: GridColumnType['tablet'];
|
10
|
+
mobile?: GridColumnType['mobile'];
|
11
|
+
all?: GridColumnType['all'];
|
12
|
+
};
|
13
|
+
export declare const getColumnConfig: (itemsCount: number) => ColumnConfig;
|
4
14
|
interface IDownloadLinks {
|
5
15
|
/** Выстраивать ссылки в одну колонку вне зависимости от количества */
|
6
16
|
inOneColumn?: boolean;
|
@@ -5,8 +5,7 @@ import { Grid, GridColumn } from '@megafon/ui-core';
|
|
5
5
|
import { cnCreate } from '@megafon/ui-helpers';
|
6
6
|
import * as PropTypes from 'prop-types';
|
7
7
|
import "./DownloadLinks.css";
|
8
|
-
|
9
|
-
var getColumnConfig = function getColumnConfig(itemsCount) {
|
8
|
+
export var getColumnConfig = function getColumnConfig(itemsCount) {
|
10
9
|
switch (true) {
|
11
10
|
case itemsCount <= 2:
|
12
11
|
{
|
@@ -35,7 +34,7 @@ var getColumnConfig = function getColumnConfig(itemsCount) {
|
|
35
34
|
}
|
36
35
|
}
|
37
36
|
};
|
38
|
-
|
37
|
+
var testIdPrefix = 'DownloadLinks';
|
39
38
|
var cn = cnCreate('mfui-download-links');
|
40
39
|
|
41
40
|
var DownloadLinks = function DownloadLinks(_ref) {
|
@@ -45,7 +44,8 @@ var DownloadLinks = function DownloadLinks(_ref) {
|
|
45
44
|
|
46
45
|
if (inOneColumn) {
|
47
46
|
return /*#__PURE__*/React.createElement("div", {
|
48
|
-
className: cn()
|
47
|
+
className: cn(),
|
48
|
+
"data-testid": "".concat(testIdPrefix, "-oneColumn")
|
49
49
|
}, React.Children.map(children, function (child) {
|
50
50
|
return /*#__PURE__*/React.createElement("div", {
|
51
51
|
className: cn('item')
|
@@ -28,6 +28,7 @@ export var pictureMaskTypes = {
|
|
28
28
|
IPHONE_12: 'iphone-12',
|
29
29
|
NONE: 'none'
|
30
30
|
};
|
31
|
+
var testIdPrefix = 'Instructions';
|
31
32
|
var cn = cnCreate('mfui-instructions');
|
32
33
|
var swiperSlideCn = cn('slide');
|
33
34
|
|
@@ -143,7 +144,8 @@ var Instructions = function Instructions(_ref) {
|
|
143
144
|
}
|
144
145
|
|
145
146
|
return /*#__PURE__*/React.createElement("div", {
|
146
|
-
className: cn('img-wrapper')
|
147
|
+
className: cn('img-wrapper'),
|
148
|
+
"data-testid": "".concat(testIdPrefix, "-img-wrapper")
|
147
149
|
}, /*#__PURE__*/React.createElement("div", {
|
148
150
|
className: cn('device-screen')
|
149
151
|
}), renderSlider());
|
@@ -153,7 +155,8 @@ var Instructions = function Instructions(_ref) {
|
|
153
155
|
className: cn('articles-list', {
|
154
156
|
'text-after': !!text,
|
155
157
|
desktop: true
|
156
|
-
})
|
158
|
+
}),
|
159
|
+
"data-testid": "".concat(testIdPrefix, "-articles-list-desktop")
|
157
160
|
}, instructionItems.map(function (_ref4, i) {
|
158
161
|
var itemTitle = _ref4.title;
|
159
162
|
return (
|
@@ -180,7 +183,8 @@ var Instructions = function Instructions(_ref) {
|
|
180
183
|
return /*#__PURE__*/React.createElement("div", {
|
181
184
|
className: cn('articles-list', {
|
182
185
|
mobile: true
|
183
|
-
})
|
186
|
+
}),
|
187
|
+
"data-testid": "".concat(testIdPrefix, "-articles-list-mobile")
|
184
188
|
}, /*#__PURE__*/React.createElement("div", {
|
185
189
|
className: cn('articles-title-block')
|
186
190
|
}, instructionItems.map(function (_ref5, i) {
|
@@ -194,7 +198,8 @@ var Instructions = function Instructions(_ref) {
|
|
194
198
|
})), /*#__PURE__*/React.createElement("ul", {
|
195
199
|
className: cn('articles-dots', {
|
196
200
|
'text-after': !!text
|
197
|
-
})
|
201
|
+
}),
|
202
|
+
"data-testid": "".concat(testIdPrefix, "-articles-dots-mobile")
|
198
203
|
}, instructionItems.map(function (_item, i) {
|
199
204
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
200
205
|
key: i,
|
@@ -222,7 +227,8 @@ var Instructions = function Instructions(_ref) {
|
|
222
227
|
className: cn('picture', {
|
223
228
|
align: pictureAlign,
|
224
229
|
'vertical-align': pictureVerticalAlign
|
225
|
-
})
|
230
|
+
}),
|
231
|
+
"data-testid": "".concat(testIdPrefix, "-picture")
|
226
232
|
}, renderPicture()), /*#__PURE__*/React.createElement("div", {
|
227
233
|
className: cn('articles', {
|
228
234
|
align: pictureAlign
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import './PageTitle.less';
|
3
3
|
import { Props as BreadcrumbsType } from '../Breadcrumbs/Breadcrumbs';
|
4
|
-
declare type
|
4
|
+
export declare type PageTitleProps = {
|
5
5
|
/** Дополнительные data атрибуты к внутренним элементам */
|
6
6
|
dataAttrs?: {
|
7
7
|
root?: Record<string, string>;
|
@@ -27,5 +27,5 @@ declare type Props = {
|
|
27
27
|
/** Ссылка на корневой элемент */
|
28
28
|
rootRef?: React.RefObject<HTMLDivElement>;
|
29
29
|
};
|
30
|
-
declare const PageTitle: React.FC<
|
30
|
+
declare const PageTitle: React.FC<PageTitleProps>;
|
31
31
|
export default PageTitle;
|
@@ -5,6 +5,7 @@ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import "./PageTitle.css";
|
7
7
|
import Breadcrumbs from "../Breadcrumbs/Breadcrumbs";
|
8
|
+
var testIdPrefix = 'PageTitle';
|
8
9
|
var cn = cnCreate('mfui-page-title');
|
9
10
|
|
10
11
|
var PageTitle = function PageTitle(_ref) {
|
@@ -34,7 +35,13 @@ var PageTitle = function PageTitle(_ref) {
|
|
34
35
|
}, title));
|
35
36
|
}, [badge, title, isBreadcrumbs]);
|
36
37
|
var renderPageTitleWithGrid = React.useCallback(function () {
|
37
|
-
return /*#__PURE__*/React.createElement(Grid,
|
38
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
39
|
+
dataAttrs: {
|
40
|
+
root: {
|
41
|
+
'data-testid': "".concat(testIdPrefix, "-grid")
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}, /*#__PURE__*/React.createElement(GridColumn, {
|
38
45
|
wide: "8",
|
39
46
|
desktop: "10",
|
40
47
|
tablet: "12",
|
@@ -21,6 +21,7 @@ var slidesSettings = (_slidesSettings = {}, _defineProperty(_slidesSettings, bre
|
|
21
21
|
slidesPerView: 4,
|
22
22
|
spaceBetween: 20
|
23
23
|
}), _slidesSettings);
|
24
|
+
var testIdPrefix = 'Partners';
|
24
25
|
var cn = cnCreate('mfui-partners');
|
25
26
|
|
26
27
|
var Partners = function Partners(_ref) {
|
@@ -56,7 +57,8 @@ var Partners = function Partners(_ref) {
|
|
56
57
|
root: _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, index + 1))
|
57
58
|
}
|
58
59
|
}, /*#__PURE__*/React.createElement("div", {
|
59
|
-
className: cn('tile-inner', [itemClass])
|
60
|
+
className: cn('tile-inner', [itemClass]),
|
61
|
+
"data-testid": "".concat(testIdPrefix, "-tile-inner")
|
60
62
|
}, /*#__PURE__*/React.createElement("div", {
|
61
63
|
className: cn('img-wrapper')
|
62
64
|
}, /*#__PURE__*/React.createElement("img", {
|
@@ -85,7 +87,15 @@ var Partners = function Partners(_ref) {
|
|
85
87
|
slidesSettings: slidesSettings,
|
86
88
|
onChange: onChange,
|
87
89
|
onNextClick: onNextClick,
|
88
|
-
onPrevClick: onPrevClick
|
90
|
+
onPrevClick: onPrevClick,
|
91
|
+
dataAttrs: {
|
92
|
+
prev: {
|
93
|
+
'data-testid': "".concat(testIdPrefix, "-prev")
|
94
|
+
},
|
95
|
+
next: {
|
96
|
+
'data-testid': "".concat(testIdPrefix, "-next")
|
97
|
+
}
|
98
|
+
}
|
89
99
|
}, topRow.map(function (item, i) {
|
90
100
|
return /*#__PURE__*/React.createElement("div", {
|
91
101
|
key: i + item.src,
|
@@ -7,6 +7,7 @@ export var pictureAlignTypes = {
|
|
7
7
|
LEFT: 'left',
|
8
8
|
RIGHT: 'right'
|
9
9
|
};
|
10
|
+
var testIdPrefix = 'PictureWithDescription';
|
10
11
|
var cn = cnCreate('mfui-picture-with-description');
|
11
12
|
|
12
13
|
var PictureWithDescription = function PictureWithDescription(_ref) {
|
@@ -27,7 +28,8 @@ var PictureWithDescription = function PictureWithDescription(_ref) {
|
|
27
28
|
}, /*#__PURE__*/React.createElement("div", {
|
28
29
|
className: cn('picture', {
|
29
30
|
align: pictureAlign
|
30
|
-
})
|
31
|
+
}),
|
32
|
+
"data-testid": "".concat(testIdPrefix, "-picture")
|
31
33
|
}, /*#__PURE__*/React.createElement("img", {
|
32
34
|
className: cn('img'),
|
33
35
|
src: pictureUrl,
|
@@ -36,7 +38,8 @@ var PictureWithDescription = function PictureWithDescription(_ref) {
|
|
36
38
|
className: cn('articles', {
|
37
39
|
align: pictureAlign,
|
38
40
|
'text-top-align': isTextTopAlign
|
39
|
-
})
|
41
|
+
}),
|
42
|
+
"data-testid": "".concat(testIdPrefix, "-articles")
|
40
43
|
}, !!title && /*#__PURE__*/React.createElement(Header, {
|
41
44
|
className: cn('title', [classes.title]),
|
42
45
|
as: "h2"
|
@@ -19,6 +19,7 @@ export var DeviceMask = {
|
|
19
19
|
NEW_IPHONE: 'new-iphone',
|
20
20
|
WHITE_IPHONE: 'white-iphone'
|
21
21
|
};
|
22
|
+
var testIdPrefix = 'StoreBanner';
|
22
23
|
var cn = cnCreate('mfui-store-banner');
|
23
24
|
|
24
25
|
var StoreBanner = function StoreBanner(_ref) {
|
@@ -90,9 +91,11 @@ var StoreBanner = function StoreBanner(_ref) {
|
|
90
91
|
}, !linkButton && qrCode && /*#__PURE__*/React.createElement("img", {
|
91
92
|
src: qrCode,
|
92
93
|
className: cn('qr-code'),
|
93
|
-
alt: "QR-\u043A\u043E\u0434"
|
94
|
+
alt: "QR-\u043A\u043E\u0434",
|
95
|
+
"data-testid": "".concat(testIdPrefix, "-qrCode")
|
94
96
|
}), !linkButton && /*#__PURE__*/React.createElement("div", {
|
95
|
-
className: cn('stores')
|
97
|
+
className: cn('stores'),
|
98
|
+
"data-testid": "".concat(testIdPrefix, "-stores")
|
96
99
|
}, linkApple && /*#__PURE__*/React.createElement(StoreButton, {
|
97
100
|
dataAttrs: {
|
98
101
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.linkApple
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { Tabs } from '@megafon/ui-core';
|
3
|
-
declare type TabsPropsType = React.ComponentProps<typeof Tabs> & {
|
3
|
+
export declare type TabsPropsType = React.ComponentProps<typeof Tabs> & {
|
4
4
|
/** Ссылка на корневой элемент */
|
5
5
|
rootRef?: React.Ref<HTMLDivElement>;
|
6
6
|
};
|
@@ -21,12 +21,13 @@ var cn = cnCreate('mfui-tabs-box');
|
|
21
21
|
|
22
22
|
var TabsBox = function TabsBox(_a) {
|
23
23
|
var rootRef = _a.rootRef,
|
24
|
-
|
24
|
+
children = _a.children,
|
25
|
+
props = __rest(_a, ["rootRef", "children"]);
|
25
26
|
|
26
27
|
return /*#__PURE__*/React.createElement("div", {
|
27
28
|
ref: rootRef,
|
28
29
|
className: cn()
|
29
|
-
}, /*#__PURE__*/React.createElement(Tabs, props));
|
30
|
+
}, /*#__PURE__*/React.createElement(Tabs, props, children));
|
30
31
|
};
|
31
32
|
|
32
33
|
export default TabsBox;
|
@@ -24,7 +24,12 @@ var TextBox = function TextBox(_ref) {
|
|
24
24
|
|
25
25
|
var renderTextBoxWithGrid = function renderTextBoxWithGrid() {
|
26
26
|
return /*#__PURE__*/React.createElement(Grid, {
|
27
|
-
hAlign: centeringWithLimitedWidth ? 'center' : 'left'
|
27
|
+
hAlign: centeringWithLimitedWidth ? 'center' : 'left',
|
28
|
+
dataAttrs: {
|
29
|
+
container: {
|
30
|
+
'data-testid': 'TextBox-grid'
|
31
|
+
}
|
32
|
+
}
|
28
33
|
}, /*#__PURE__*/React.createElement(GridColumn, {
|
29
34
|
wide: "8",
|
30
35
|
desktop: "10",
|
@@ -4,6 +4,7 @@ import { Header, Grid, GridColumn } from '@megafon/ui-core';
|
|
4
4
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
5
5
|
import * as PropTypes from 'prop-types';
|
6
6
|
import "./TextWithIcon.css";
|
7
|
+
var testIdPrefix = 'TextWithIcon';
|
7
8
|
var cn = cnCreate('mfui-text-with-icon');
|
8
9
|
|
9
10
|
var TextWithIcon = function TextWithIcon(_ref) {
|
@@ -23,7 +24,13 @@ var TextWithIcon = function TextWithIcon(_ref) {
|
|
23
24
|
};
|
24
25
|
|
25
26
|
var renderContentWithGrid = function renderContentWithGrid() {
|
26
|
-
return /*#__PURE__*/React.createElement(Grid,
|
27
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
28
|
+
dataAttrs: {
|
29
|
+
container: {
|
30
|
+
'data-testid': "".concat(testIdPrefix, "-grid")
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}, /*#__PURE__*/React.createElement(GridColumn, {
|
27
34
|
mobile: '12',
|
28
35
|
tablet: '7',
|
29
36
|
desktop: '6',
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
5
5
|
import { cnCreate, convert, filterDataAttrs, textConvertConfig } from '@megafon/ui-helpers';
|
6
6
|
import * as PropTypes from 'prop-types';
|
7
7
|
import "./TextWithIconItem.css";
|
8
|
+
var testIdPrefix = 'TextWithIconItem';
|
8
9
|
var cn = cnCreate('mfui-text-with-icon-item');
|
9
10
|
|
10
11
|
var TextWithIconItem = function TextWithIconItem(_ref) {
|
@@ -28,9 +29,11 @@ var TextWithIconItem = function TextWithIconItem(_ref) {
|
|
28
29
|
className: cn([className]),
|
29
30
|
ref: rootRef
|
30
31
|
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("div", {
|
31
|
-
className: cn('svg-icon', [classes.icon])
|
32
|
+
className: cn('svg-icon', [classes.icon]),
|
33
|
+
"data-testid": "".concat(testIdPrefix, "-icon")
|
32
34
|
}, icon), /*#__PURE__*/React.createElement("div", {
|
33
|
-
className: cn('text', [classes.text])
|
35
|
+
className: cn('text', [classes.text]),
|
36
|
+
"data-testid": "".concat(testIdPrefix, "-text")
|
34
37
|
}, renderText));
|
35
38
|
};
|
36
39
|
|
@@ -48,6 +48,7 @@ var getMediaStyle = function getMediaStyle(imageUrl) {
|
|
48
48
|
};
|
49
49
|
|
50
50
|
var cn = (0, _uiHelpers.cnCreate)('mfui-button-banner');
|
51
|
+
var testIdPrefix = 'ButtonBanner';
|
51
52
|
|
52
53
|
var ButtonBanner = function ButtonBanner(_ref) {
|
53
54
|
var dataAttrs = _ref.dataAttrs,
|
@@ -99,7 +100,8 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
99
100
|
leftOffsetDesktop: "1",
|
100
101
|
leftOffsetWide: "1"
|
101
102
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
102
|
-
className: cn('content')
|
103
|
+
className: cn('content'),
|
104
|
+
"data-testid": "".concat(testIdPrefix, "-content")
|
103
105
|
}, /*#__PURE__*/_react["default"].createElement(_uiCore.Header, {
|
104
106
|
className: cn('header'),
|
105
107
|
as: "h2"
|
@@ -110,7 +112,8 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
110
112
|
mobile: "12"
|
111
113
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
112
114
|
className: cn('media'),
|
113
|
-
style: getMediaStyle(imageUrl)
|
115
|
+
style: getMediaStyle(imageUrl),
|
116
|
+
"data-testid": "".concat(testIdPrefix, "-media")
|
114
117
|
}, !imageUrl && buttonElem))));
|
115
118
|
};
|
116
119
|
|
@@ -65,7 +65,7 @@ var DownloadLink = function DownloadLink(_ref) {
|
|
65
65
|
className: cn('link', [classes.link])
|
66
66
|
}, text), /*#__PURE__*/React.createElement("p", {
|
67
67
|
className: cn('info')
|
68
|
-
}, "".concat(extension).concat(extension && fileSize ? ',' : ''
|
68
|
+
}, "".concat(extension).concat(extension && fileSize ? ', ' : '').concat(fileSize))));
|
69
69
|
};
|
70
70
|
|
71
71
|
DownloadLink.propTypes = {
|
@@ -1,6 +1,16 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
+
import { GridColumn } from '@megafon/ui-core';
|
2
3
|
import './DownloadLinks.less';
|
3
4
|
import { IDownloadLink } from './DownloadLink';
|
5
|
+
declare type GridColumnType = React.ComponentProps<typeof GridColumn>;
|
6
|
+
declare type ColumnConfig = {
|
7
|
+
wide?: GridColumnType['wide'];
|
8
|
+
desktop?: GridColumnType['desktop'];
|
9
|
+
tablet?: GridColumnType['tablet'];
|
10
|
+
mobile?: GridColumnType['mobile'];
|
11
|
+
all?: GridColumnType['all'];
|
12
|
+
};
|
13
|
+
export declare const getColumnConfig: (itemsCount: number) => ColumnConfig;
|
4
14
|
interface IDownloadLinks {
|
5
15
|
/** Выстраивать ссылки в одну колонку вне зависимости от количества */
|
6
16
|
inOneColumn?: boolean;
|
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
-
exports["default"] = void 0;
|
8
|
+
exports["default"] = exports.getColumnConfig = void 0;
|
9
9
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
11
11
|
|
@@ -55,6 +55,8 @@ var getColumnConfig = function getColumnConfig(itemsCount) {
|
|
55
55
|
}
|
56
56
|
};
|
57
57
|
|
58
|
+
exports.getColumnConfig = getColumnConfig;
|
59
|
+
var testIdPrefix = 'DownloadLinks';
|
58
60
|
var cn = (0, _uiHelpers.cnCreate)('mfui-download-links');
|
59
61
|
|
60
62
|
var DownloadLinks = function DownloadLinks(_ref) {
|
@@ -64,7 +66,8 @@ var DownloadLinks = function DownloadLinks(_ref) {
|
|
64
66
|
|
65
67
|
if (inOneColumn) {
|
66
68
|
return /*#__PURE__*/React.createElement("div", {
|
67
|
-
className: cn()
|
69
|
+
className: cn(),
|
70
|
+
"data-testid": "".concat(testIdPrefix, "-oneColumn")
|
68
71
|
}, React.Children.map(children, function (child) {
|
69
72
|
return /*#__PURE__*/React.createElement("div", {
|
70
73
|
className: cn('item')
|
@@ -46,6 +46,7 @@ var pictureMaskTypes = {
|
|
46
46
|
NONE: 'none'
|
47
47
|
};
|
48
48
|
exports.pictureMaskTypes = pictureMaskTypes;
|
49
|
+
var testIdPrefix = 'Instructions';
|
49
50
|
var cn = (0, _uiHelpers.cnCreate)('mfui-instructions');
|
50
51
|
var swiperSlideCn = cn('slide');
|
51
52
|
|
@@ -169,7 +170,8 @@ var Instructions = function Instructions(_ref) {
|
|
169
170
|
}
|
170
171
|
|
171
172
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
172
|
-
className: cn('img-wrapper')
|
173
|
+
className: cn('img-wrapper'),
|
174
|
+
"data-testid": "".concat(testIdPrefix, "-img-wrapper")
|
173
175
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
174
176
|
className: cn('device-screen')
|
175
177
|
}), renderSlider());
|
@@ -180,7 +182,8 @@ var Instructions = function Instructions(_ref) {
|
|
180
182
|
className: cn('articles-list', {
|
181
183
|
'text-after': !!text,
|
182
184
|
desktop: true
|
183
|
-
})
|
185
|
+
}),
|
186
|
+
"data-testid": "".concat(testIdPrefix, "-articles-list-desktop")
|
184
187
|
}, instructionItems.map(function (_ref4, i) {
|
185
188
|
var itemTitle = _ref4.title;
|
186
189
|
return (
|
@@ -208,7 +211,8 @@ var Instructions = function Instructions(_ref) {
|
|
208
211
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
209
212
|
className: cn('articles-list', {
|
210
213
|
mobile: true
|
211
|
-
})
|
214
|
+
}),
|
215
|
+
"data-testid": "".concat(testIdPrefix, "-articles-list-mobile")
|
212
216
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
213
217
|
className: cn('articles-title-block')
|
214
218
|
}, instructionItems.map(function (_ref5, i) {
|
@@ -222,7 +226,8 @@ var Instructions = function Instructions(_ref) {
|
|
222
226
|
})), /*#__PURE__*/_react["default"].createElement("ul", {
|
223
227
|
className: cn('articles-dots', {
|
224
228
|
'text-after': !!text
|
225
|
-
})
|
229
|
+
}),
|
230
|
+
"data-testid": "".concat(testIdPrefix, "-articles-dots-mobile")
|
226
231
|
}, instructionItems.map(function (_item, i) {
|
227
232
|
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
228
233
|
key: i,
|
@@ -251,7 +256,8 @@ var Instructions = function Instructions(_ref) {
|
|
251
256
|
className: cn('picture', {
|
252
257
|
align: pictureAlign,
|
253
258
|
'vertical-align': pictureVerticalAlign
|
254
|
-
})
|
259
|
+
}),
|
260
|
+
"data-testid": "".concat(testIdPrefix, "-picture")
|
255
261
|
}, renderPicture()), /*#__PURE__*/_react["default"].createElement("div", {
|
256
262
|
className: cn('articles', {
|
257
263
|
align: pictureAlign
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import './PageTitle.less';
|
3
3
|
import { Props as BreadcrumbsType } from '../Breadcrumbs/Breadcrumbs';
|
4
|
-
declare type
|
4
|
+
export declare type PageTitleProps = {
|
5
5
|
/** Дополнительные data атрибуты к внутренним элементам */
|
6
6
|
dataAttrs?: {
|
7
7
|
root?: Record<string, string>;
|
@@ -27,5 +27,5 @@ declare type Props = {
|
|
27
27
|
/** Ссылка на корневой элемент */
|
28
28
|
rootRef?: React.RefObject<HTMLDivElement>;
|
29
29
|
};
|
30
|
-
declare const PageTitle: React.FC<
|
30
|
+
declare const PageTitle: React.FC<PageTitleProps>;
|
31
31
|
export default PageTitle;
|
@@ -25,6 +25,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
25
25
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
27
27
|
|
28
|
+
var testIdPrefix = 'PageTitle';
|
28
29
|
var cn = (0, _uiHelpers.cnCreate)('mfui-page-title');
|
29
30
|
|
30
31
|
var PageTitle = function PageTitle(_ref) {
|
@@ -54,7 +55,13 @@ var PageTitle = function PageTitle(_ref) {
|
|
54
55
|
}, title));
|
55
56
|
}, [badge, title, isBreadcrumbs]);
|
56
57
|
var renderPageTitleWithGrid = React.useCallback(function () {
|
57
|
-
return /*#__PURE__*/React.createElement(_uiCore.Grid,
|
58
|
+
return /*#__PURE__*/React.createElement(_uiCore.Grid, {
|
59
|
+
dataAttrs: {
|
60
|
+
root: {
|
61
|
+
'data-testid': "".concat(testIdPrefix, "-grid")
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}, /*#__PURE__*/React.createElement(_uiCore.GridColumn, {
|
58
65
|
wide: "8",
|
59
66
|
desktop: "10",
|
60
67
|
tablet: "12",
|
@@ -42,6 +42,7 @@ var slidesSettings = (_slidesSettings = {}, (0, _defineProperty2["default"])(_sl
|
|
42
42
|
slidesPerView: 4,
|
43
43
|
spaceBetween: 20
|
44
44
|
}), _slidesSettings);
|
45
|
+
var testIdPrefix = 'Partners';
|
45
46
|
var cn = (0, _uiHelpers.cnCreate)('mfui-partners');
|
46
47
|
|
47
48
|
var Partners = function Partners(_ref) {
|
@@ -77,7 +78,8 @@ var Partners = function Partners(_ref) {
|
|
77
78
|
root: (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, index + 1))
|
78
79
|
}
|
79
80
|
}, /*#__PURE__*/React.createElement("div", {
|
80
|
-
className: cn('tile-inner', [itemClass])
|
81
|
+
className: cn('tile-inner', [itemClass]),
|
82
|
+
"data-testid": "".concat(testIdPrefix, "-tile-inner")
|
81
83
|
}, /*#__PURE__*/React.createElement("div", {
|
82
84
|
className: cn('img-wrapper')
|
83
85
|
}, /*#__PURE__*/React.createElement("img", {
|
@@ -106,7 +108,15 @@ var Partners = function Partners(_ref) {
|
|
106
108
|
slidesSettings: slidesSettings,
|
107
109
|
onChange: onChange,
|
108
110
|
onNextClick: onNextClick,
|
109
|
-
onPrevClick: onPrevClick
|
111
|
+
onPrevClick: onPrevClick,
|
112
|
+
dataAttrs: {
|
113
|
+
prev: {
|
114
|
+
'data-testid': "".concat(testIdPrefix, "-prev")
|
115
|
+
},
|
116
|
+
next: {
|
117
|
+
'data-testid': "".concat(testIdPrefix, "-next")
|
118
|
+
}
|
119
|
+
}
|
110
120
|
}, topRow.map(function (item, i) {
|
111
121
|
return /*#__PURE__*/React.createElement("div", {
|
112
122
|
key: i + item.src,
|
@@ -26,6 +26,7 @@ var pictureAlignTypes = {
|
|
26
26
|
RIGHT: 'right'
|
27
27
|
};
|
28
28
|
exports.pictureAlignTypes = pictureAlignTypes;
|
29
|
+
var testIdPrefix = 'PictureWithDescription';
|
29
30
|
var cn = (0, _uiHelpers.cnCreate)('mfui-picture-with-description');
|
30
31
|
|
31
32
|
var PictureWithDescription = function PictureWithDescription(_ref) {
|
@@ -46,7 +47,8 @@ var PictureWithDescription = function PictureWithDescription(_ref) {
|
|
46
47
|
}, /*#__PURE__*/React.createElement("div", {
|
47
48
|
className: cn('picture', {
|
48
49
|
align: pictureAlign
|
49
|
-
})
|
50
|
+
}),
|
51
|
+
"data-testid": "".concat(testIdPrefix, "-picture")
|
50
52
|
}, /*#__PURE__*/React.createElement("img", {
|
51
53
|
className: cn('img'),
|
52
54
|
src: pictureUrl,
|
@@ -55,7 +57,8 @@ var PictureWithDescription = function PictureWithDescription(_ref) {
|
|
55
57
|
className: cn('articles', {
|
56
58
|
align: pictureAlign,
|
57
59
|
'text-top-align': isTextTopAlign
|
58
|
-
})
|
60
|
+
}),
|
61
|
+
"data-testid": "".concat(testIdPrefix, "-articles")
|
59
62
|
}, !!title && /*#__PURE__*/React.createElement(_uiCore.Header, {
|
60
63
|
className: cn('title', [classes.title]),
|
61
64
|
as: "h2"
|
@@ -42,6 +42,7 @@ var DeviceMask = {
|
|
42
42
|
WHITE_IPHONE: 'white-iphone'
|
43
43
|
};
|
44
44
|
exports.DeviceMask = DeviceMask;
|
45
|
+
var testIdPrefix = 'StoreBanner';
|
45
46
|
var cn = (0, _uiHelpers.cnCreate)('mfui-store-banner');
|
46
47
|
|
47
48
|
var StoreBanner = function StoreBanner(_ref) {
|
@@ -113,9 +114,11 @@ var StoreBanner = function StoreBanner(_ref) {
|
|
113
114
|
}, !linkButton && qrCode && /*#__PURE__*/React.createElement("img", {
|
114
115
|
src: qrCode,
|
115
116
|
className: cn('qr-code'),
|
116
|
-
alt: "QR-\u043A\u043E\u0434"
|
117
|
+
alt: "QR-\u043A\u043E\u0434",
|
118
|
+
"data-testid": "".concat(testIdPrefix, "-qrCode")
|
117
119
|
}), !linkButton && /*#__PURE__*/React.createElement("div", {
|
118
|
-
className: cn('stores')
|
120
|
+
className: cn('stores'),
|
121
|
+
"data-testid": "".concat(testIdPrefix, "-stores")
|
119
122
|
}, linkApple && /*#__PURE__*/React.createElement(_StoreButton["default"], {
|
120
123
|
dataAttrs: {
|
121
124
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.linkApple
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { Tabs } from '@megafon/ui-core';
|
3
|
-
declare type TabsPropsType = React.ComponentProps<typeof Tabs> & {
|
3
|
+
export declare type TabsPropsType = React.ComponentProps<typeof Tabs> & {
|
4
4
|
/** Ссылка на корневой элемент */
|
5
5
|
rootRef?: React.Ref<HTMLDivElement>;
|
6
6
|
};
|
@@ -38,12 +38,13 @@ var cn = (0, _uiHelpers.cnCreate)('mfui-tabs-box');
|
|
38
38
|
|
39
39
|
var TabsBox = function TabsBox(_a) {
|
40
40
|
var rootRef = _a.rootRef,
|
41
|
-
|
41
|
+
children = _a.children,
|
42
|
+
props = __rest(_a, ["rootRef", "children"]);
|
42
43
|
|
43
44
|
return /*#__PURE__*/React.createElement("div", {
|
44
45
|
ref: rootRef,
|
45
46
|
className: cn()
|
46
|
-
}, /*#__PURE__*/React.createElement(_uiCore.Tabs, props));
|
47
|
+
}, /*#__PURE__*/React.createElement(_uiCore.Tabs, props, children));
|
47
48
|
};
|
48
49
|
|
49
50
|
var _default = TabsBox;
|
@@ -40,7 +40,12 @@ var TextBox = function TextBox(_ref) {
|
|
40
40
|
|
41
41
|
var renderTextBoxWithGrid = function renderTextBoxWithGrid() {
|
42
42
|
return /*#__PURE__*/React.createElement(_uiCore.Grid, {
|
43
|
-
hAlign: centeringWithLimitedWidth ? 'center' : 'left'
|
43
|
+
hAlign: centeringWithLimitedWidth ? 'center' : 'left',
|
44
|
+
dataAttrs: {
|
45
|
+
container: {
|
46
|
+
'data-testid': 'TextBox-grid'
|
47
|
+
}
|
48
|
+
}
|
44
49
|
}, /*#__PURE__*/React.createElement(_uiCore.GridColumn, {
|
45
50
|
wide: "8",
|
46
51
|
desktop: "10",
|
@@ -23,6 +23,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
23
23
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
25
25
|
|
26
|
+
var testIdPrefix = 'TextWithIcon';
|
26
27
|
var cn = (0, _uiHelpers.cnCreate)('mfui-text-with-icon');
|
27
28
|
|
28
29
|
var TextWithIcon = function TextWithIcon(_ref) {
|
@@ -42,7 +43,13 @@ var TextWithIcon = function TextWithIcon(_ref) {
|
|
42
43
|
};
|
43
44
|
|
44
45
|
var renderContentWithGrid = function renderContentWithGrid() {
|
45
|
-
return /*#__PURE__*/React.createElement(_uiCore.Grid,
|
46
|
+
return /*#__PURE__*/React.createElement(_uiCore.Grid, {
|
47
|
+
dataAttrs: {
|
48
|
+
container: {
|
49
|
+
'data-testid': "".concat(testIdPrefix, "-grid")
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}, /*#__PURE__*/React.createElement(_uiCore.GridColumn, {
|
46
53
|
mobile: '12',
|
47
54
|
tablet: '7',
|
48
55
|
desktop: '6',
|
@@ -25,6 +25,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
25
25
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
27
27
|
|
28
|
+
var testIdPrefix = 'TextWithIconItem';
|
28
29
|
var cn = (0, _uiHelpers.cnCreate)('mfui-text-with-icon-item');
|
29
30
|
|
30
31
|
var TextWithIconItem = function TextWithIconItem(_ref) {
|
@@ -48,9 +49,11 @@ var TextWithIconItem = function TextWithIconItem(_ref) {
|
|
48
49
|
className: cn([className]),
|
49
50
|
ref: rootRef
|
50
51
|
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("div", {
|
51
|
-
className: cn('svg-icon', [classes.icon])
|
52
|
+
className: cn('svg-icon', [classes.icon]),
|
53
|
+
"data-testid": "".concat(testIdPrefix, "-icon")
|
52
54
|
}, icon), /*#__PURE__*/React.createElement("div", {
|
53
|
-
className: cn('text', [classes.text])
|
55
|
+
className: cn('text', [classes.text]),
|
56
|
+
"data-testid": "".concat(testIdPrefix, "-text")
|
54
57
|
}, renderText));
|
55
58
|
};
|
56
59
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@megafon/ui-shared",
|
3
|
-
"version": "5.2.
|
3
|
+
"version": "5.2.1",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -82,7 +82,7 @@
|
|
82
82
|
},
|
83
83
|
"dependencies": {
|
84
84
|
"@babel/runtime": "^7.8.4",
|
85
|
-
"@megafon/ui-core": "^5.2.
|
85
|
+
"@megafon/ui-core": "^5.2.3",
|
86
86
|
"@megafon/ui-helpers": "^2.5.3",
|
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": "1bb6769da99d917f5dd4420892c57a7af5be3ab4"
|
94
94
|
}
|