@megafon/ui-shared 2.0.0-beta.96 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1634 -0
- package/README.md +0 -5
- package/dist/es/components/AccordionBox/AccordionBox.css +13 -0
- package/dist/es/components/AccordionBox/AccordionBox.d.ts +16 -1
- package/dist/es/components/AccordionBox/AccordionBox.js +29 -13
- package/dist/es/components/BannerBox/BannerBox.js +3 -2
- package/dist/es/components/BenefitsIcons/BenefitsIcons.d.ts +13 -2
- package/dist/es/components/BenefitsIcons/BenefitsIcons.js +82 -17
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.d.ts +2 -1
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.js +15 -14
- package/dist/es/components/BenefitsIcons/style/BenefitsIcons.css +3 -3
- package/dist/es/components/BenefitsIcons/style/BenefitsIconsTile.css +19 -12
- package/dist/es/components/BenefitsIcons/types.d.ts +7 -2
- package/dist/es/components/BenefitsIcons/types.js +4 -0
- package/dist/es/components/BenefitsPictures/BenefitsPictures.d.ts +10 -1
- package/dist/es/components/BenefitsPictures/BenefitsPictures.js +28 -12
- package/dist/es/components/BenefitsPictures/BenfitsPictures.css +4 -4
- package/dist/es/components/Breadcrumbs/Breadcrumbs.css +46 -0
- package/dist/es/components/Breadcrumbs/Breadcrumbs.d.ts +21 -0
- package/dist/es/components/Breadcrumbs/Breadcrumbs.js +49 -0
- package/dist/es/components/ButtonBanner/ButtonBanner.css +122 -0
- package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +54 -0
- package/dist/es/components/ButtonBanner/ButtonBanner.js +107 -0
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.css +3 -3
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.d.ts +22 -2
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +37 -8
- package/dist/es/components/Card/Card.css +71 -44
- package/dist/es/components/Card/Card.d.ts +33 -3
- package/dist/es/components/Card/Card.js +103 -42
- package/dist/es/components/CardsBox/CardsBox.d.ts +10 -2
- package/dist/es/components/CardsBox/CardsBox.js +26 -13
- package/dist/es/components/CarouselBox/CarouselBox.js +3 -2
- package/dist/es/components/Container/Container.css +1815 -547
- package/dist/es/components/Container/Container.d.ts +11 -1
- package/dist/es/components/Container/Container.js +28 -6
- package/dist/es/components/DownloadLinks/DownloadLink.css +5 -5
- package/dist/es/components/DownloadLinks/DownloadLink.d.ts +7 -0
- package/dist/es/components/DownloadLinks/DownloadLink.js +28 -6
- package/dist/es/components/DownloadLinks/DownloadLinks.css +9 -6
- package/dist/es/components/DownloadLinks/DownloadLinks.d.ts +2 -0
- package/dist/es/components/DownloadLinks/DownloadLinks.js +18 -3
- package/dist/es/components/Instructions/Instructions.css +189 -130
- package/dist/es/components/Instructions/Instructions.d.ts +21 -2
- package/dist/es/components/Instructions/Instructions.js +115 -74
- package/dist/es/components/Instructions/img/iphone12.png +0 -0
- package/dist/es/components/PageTitle/PageTitle.css +80 -0
- package/dist/es/components/PageTitle/PageTitle.d.ts +23 -0
- package/dist/es/components/PageTitle/PageTitle.js +65 -0
- package/dist/es/components/Partners/Partners.css +22 -31
- package/dist/es/components/Partners/Partners.d.ts +13 -1
- package/dist/es/components/Partners/Partners.js +40 -18
- package/dist/es/components/PictureWithDescription/PictureWithDescription.css +25 -10
- package/dist/es/components/PictureWithDescription/PictureWithDescription.d.ts +13 -0
- package/dist/es/components/PictureWithDescription/PictureWithDescription.js +31 -7
- package/dist/es/components/Property/Property.css +79 -71
- package/dist/es/components/Property/Property.d.ts +21 -2
- package/dist/es/components/Property/Property.js +80 -34
- package/dist/es/components/Property/PropertyDescription.css +3 -3
- package/dist/es/components/Property/PropertyDescription.js +19 -21
- package/dist/es/components/Property/types.d.ts +7 -2
- package/dist/es/components/Steps/Steps.css +41 -0
- package/dist/es/components/Steps/Steps.d.ts +10 -0
- package/dist/es/components/Steps/Steps.js +35 -0
- package/dist/es/components/Steps/StepsItem.css +37 -0
- package/dist/es/components/Steps/StepsItem.d.ts +10 -0
- package/dist/es/components/Steps/StepsItem.js +26 -0
- package/dist/es/components/StoreBanner/StoreBanner.css +289 -0
- package/dist/es/components/StoreBanner/StoreBanner.d.ts +65 -0
- package/dist/es/components/StoreBanner/StoreBanner.js +145 -0
- package/dist/es/components/StoreBanner/doc/img/new-iphone-screen.png +0 -0
- package/dist/es/components/StoreBanner/doc/img/qr-code.png +0 -0
- package/dist/es/components/StoreBanner/doc/img/screen.png +0 -0
- package/dist/es/components/StoreBanner/img/android.png +0 -0
- package/dist/es/components/StoreBanner/img/black-iphone.png +0 -0
- package/dist/es/components/StoreBanner/img/new-iphone.png +0 -0
- package/dist/es/components/StoreBanner/img/white-iphone.png +0 -0
- package/dist/es/components/StoreButton/StoreButton.css +15 -0
- package/dist/es/components/StoreButton/StoreButton.d.ts +17 -0
- package/dist/es/components/StoreButton/StoreButton.js +37 -0
- package/dist/es/components/StoreButton/img/app-store.png +0 -0
- package/dist/es/components/StoreButton/img/google-play.png +0 -0
- package/dist/es/components/StoreButton/img/huawei-store.png +0 -0
- package/dist/es/components/Table/Table.css +67 -67
- package/dist/es/components/Table/Table.js +4 -4
- package/dist/es/components/Table/TableRow.js +1 -0
- package/dist/es/components/TabsBox/TabsBox.d.ts +4 -1
- package/dist/es/components/TabsBox/TabsBox.js +24 -3
- package/dist/es/components/TextBox/TextBox.css +7 -1
- package/dist/es/components/TextBox/TextBox.d.ts +8 -0
- package/dist/es/components/TextBox/TextBox.js +37 -5
- package/dist/es/components/TextBox/TextBoxPicture.css +24 -0
- package/dist/es/components/TextBox/TextBoxPicture.d.ts +17 -0
- package/dist/es/components/TextBox/TextBoxPicture.js +32 -0
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.css +15 -4
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +8 -2
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.js +34 -14
- package/dist/es/components/VideoBanner/VideoBanner.css +155 -76
- package/dist/es/components/VideoBanner/VideoBanner.d.ts +64 -13
- package/dist/es/components/VideoBanner/VideoBanner.js +202 -70
- package/dist/es/components/VideoBlock/VideoBlock.css +32 -28
- package/dist/es/components/VideoBlock/VideoBlock.d.ts +20 -6
- package/dist/es/components/VideoBlock/VideoBlock.js +63 -44
- package/dist/es/constants/throttleTime.d.ts +4 -0
- package/dist/es/constants/throttleTime.js +3 -0
- package/dist/es/index.d.ts +8 -0
- package/dist/es/index.js +8 -0
- package/dist/lib/components/AccordionBox/AccordionBox.css +13 -0
- package/dist/lib/components/AccordionBox/AccordionBox.d.ts +16 -1
- package/dist/lib/components/AccordionBox/AccordionBox.js +31 -19
- package/dist/lib/components/BannerBox/BannerBox.js +3 -5
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.d.ts +13 -2
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +84 -20
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.d.ts +2 -1
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.js +15 -16
- package/dist/lib/components/BenefitsIcons/style/BenefitsIcons.css +3 -3
- package/dist/lib/components/BenefitsIcons/style/BenefitsIconsTile.css +19 -12
- package/dist/lib/components/BenefitsIcons/types.d.ts +7 -2
- package/dist/lib/components/BenefitsIcons/types.js +7 -2
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.d.ts +10 -1
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.js +32 -15
- package/dist/lib/components/BenefitsPictures/BenfitsPictures.css +4 -4
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.css +46 -0
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.d.ts +21 -0
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.js +65 -0
- package/dist/lib/components/ButtonBanner/ButtonBanner.css +122 -0
- package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +54 -0
- package/dist/lib/components/ButtonBanner/ButtonBanner.js +133 -0
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.css +3 -3
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.d.ts +22 -2
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +45 -11
- package/dist/lib/components/Card/Card.css +71 -44
- package/dist/lib/components/Card/Card.d.ts +33 -3
- package/dist/lib/components/Card/Card.js +118 -59
- package/dist/lib/components/CardsBox/CardsBox.d.ts +10 -2
- package/dist/lib/components/CardsBox/CardsBox.js +30 -16
- package/dist/lib/components/CarouselBox/CarouselBox.js +3 -5
- package/dist/lib/components/Container/Container.css +1815 -547
- package/dist/lib/components/Container/Container.d.ts +11 -1
- package/dist/lib/components/Container/Container.js +32 -11
- package/dist/lib/components/DownloadLinks/DownloadLink.css +5 -5
- package/dist/lib/components/DownloadLinks/DownloadLink.d.ts +7 -0
- package/dist/lib/components/DownloadLinks/DownloadLink.js +32 -11
- package/dist/lib/components/DownloadLinks/DownloadLinks.css +9 -6
- package/dist/lib/components/DownloadLinks/DownloadLinks.d.ts +2 -0
- package/dist/lib/components/DownloadLinks/DownloadLinks.js +20 -6
- package/dist/lib/components/Instructions/Instructions.css +189 -130
- package/dist/lib/components/Instructions/Instructions.d.ts +21 -2
- package/dist/lib/components/Instructions/Instructions.js +148 -104
- package/dist/lib/components/Instructions/img/iphone12.png +0 -0
- package/dist/lib/components/PageTitle/PageTitle.css +80 -0
- package/dist/lib/components/PageTitle/PageTitle.d.ts +23 -0
- package/dist/lib/components/PageTitle/PageTitle.js +85 -0
- package/dist/lib/components/Partners/Partners.css +22 -31
- package/dist/lib/components/Partners/Partners.d.ts +13 -1
- package/dist/lib/components/Partners/Partners.js +43 -23
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.css +25 -10
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.d.ts +13 -0
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.js +33 -8
- package/dist/lib/components/Property/Property.css +79 -71
- package/dist/lib/components/Property/Property.d.ts +21 -2
- package/dist/lib/components/Property/Property.js +93 -53
- package/dist/lib/components/Property/PropertyDescription.css +3 -3
- package/dist/lib/components/Property/PropertyDescription.js +21 -25
- package/dist/lib/components/Property/types.d.ts +7 -2
- package/dist/lib/components/Steps/Steps.css +41 -0
- package/dist/lib/components/Steps/Steps.d.ts +10 -0
- package/dist/lib/components/Steps/Steps.js +55 -0
- package/dist/lib/components/Steps/StepsItem.css +37 -0
- package/dist/lib/components/Steps/StepsItem.d.ts +10 -0
- package/dist/lib/components/Steps/StepsItem.js +39 -0
- package/dist/lib/components/StoreBanner/StoreBanner.css +289 -0
- package/dist/lib/components/StoreBanner/StoreBanner.d.ts +65 -0
- package/dist/lib/components/StoreBanner/StoreBanner.js +169 -0
- package/dist/lib/components/StoreBanner/doc/img/new-iphone-screen.png +0 -0
- package/dist/lib/components/StoreBanner/doc/img/qr-code.png +0 -0
- package/dist/lib/components/StoreBanner/doc/img/screen.png +0 -0
- package/dist/lib/components/StoreBanner/img/android.png +0 -0
- package/dist/lib/components/StoreBanner/img/black-iphone.png +0 -0
- package/dist/lib/components/StoreBanner/img/new-iphone.png +0 -0
- package/dist/lib/components/StoreBanner/img/white-iphone.png +0 -0
- package/dist/lib/components/StoreButton/StoreButton.css +15 -0
- package/dist/lib/components/StoreButton/StoreButton.d.ts +17 -0
- package/dist/lib/components/StoreButton/StoreButton.js +58 -0
- package/dist/lib/components/StoreButton/img/app-store.png +0 -0
- package/dist/lib/components/StoreButton/img/google-play.png +0 -0
- package/dist/lib/components/StoreButton/img/huawei-store.png +0 -0
- package/dist/lib/components/Table/Table.css +67 -67
- package/dist/lib/components/Table/Table.js +6 -8
- package/dist/lib/components/Table/TableRow.js +1 -0
- package/dist/lib/components/TabsBox/TabsBox.d.ts +4 -1
- package/dist/lib/components/TabsBox/TabsBox.js +25 -2
- package/dist/lib/components/TextBox/TextBox.css +7 -1
- package/dist/lib/components/TextBox/TextBox.d.ts +8 -0
- package/dist/lib/components/TextBox/TextBox.js +39 -6
- package/dist/lib/components/TextBox/TextBoxPicture.css +24 -0
- package/dist/lib/components/TextBox/TextBoxPicture.d.ts +17 -0
- package/dist/lib/components/TextBox/TextBoxPicture.js +49 -0
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.css +15 -4
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +8 -2
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.js +39 -19
- package/dist/lib/components/VideoBanner/VideoBanner.css +155 -76
- package/dist/lib/components/VideoBanner/VideoBanner.d.ts +64 -13
- package/dist/lib/components/VideoBanner/VideoBanner.js +225 -89
- package/dist/lib/components/VideoBlock/VideoBlock.css +32 -28
- package/dist/lib/components/VideoBlock/VideoBlock.d.ts +20 -6
- package/dist/lib/components/VideoBlock/VideoBlock.js +76 -68
- package/dist/lib/constants/throttleTime.d.ts +4 -0
- package/dist/lib/constants/throttleTime.js +10 -0
- package/dist/lib/index.d.ts +8 -0
- package/dist/lib/index.js +64 -0
- package/package.json +19 -75
@@ -6,7 +6,7 @@ h5 {
|
|
6
6
|
margin: 0;
|
7
7
|
}
|
8
8
|
@media screen and (min-width: 1024px) {
|
9
|
-
.mfui-
|
9
|
+
.mfui-picture-with-description {
|
10
10
|
display: -webkit-box;
|
11
11
|
display: -ms-flexbox;
|
12
12
|
display: flex;
|
@@ -18,48 +18,63 @@ h5 {
|
|
18
18
|
justify-content: center;
|
19
19
|
}
|
20
20
|
}
|
21
|
-
.mfui-
|
21
|
+
.mfui-picture-with-description__title {
|
22
|
+
margin-bottom: 24px;
|
23
|
+
}
|
24
|
+
.mfui-picture-with-description__picture {
|
22
25
|
-ms-flex-item-align: start;
|
23
26
|
align-self: flex-start;
|
24
27
|
overflow: hidden;
|
25
28
|
text-align: center;
|
26
29
|
}
|
27
30
|
@media screen and (max-width: 1023px) {
|
28
|
-
.mfui-
|
31
|
+
.mfui-picture-with-description__picture {
|
29
32
|
margin: 0 auto 32px;
|
30
33
|
}
|
31
34
|
}
|
32
35
|
@media screen and (min-width: 1024px) {
|
33
|
-
.mfui-
|
34
|
-
width: 50%;
|
36
|
+
.mfui-picture-with-description__picture {
|
35
37
|
-webkit-box-ordinal-group: 3;
|
36
38
|
-ms-flex-order: 2;
|
37
39
|
order: 2;
|
40
|
+
width: 50%;
|
38
41
|
}
|
39
42
|
}
|
40
43
|
@media screen and (min-width: 1024px) {
|
41
|
-
.mfui-
|
44
|
+
.mfui-picture-with-description__picture_align_left {
|
42
45
|
-webkit-box-ordinal-group: 1;
|
43
46
|
-ms-flex-order: 0;
|
44
47
|
order: 0;
|
45
48
|
margin-right: 20px;
|
46
49
|
}
|
47
50
|
}
|
48
|
-
.mfui-
|
51
|
+
.mfui-picture-with-description__img {
|
49
52
|
width: 100%;
|
50
53
|
max-width: 550px;
|
51
54
|
height: 100%;
|
52
55
|
}
|
56
|
+
.mfui-picture-with-description__content :first-child {
|
57
|
+
margin-top: 0 !important;
|
58
|
+
}
|
59
|
+
.mfui-picture-with-description__content :last-child {
|
60
|
+
margin-bottom: 0 !important;
|
61
|
+
}
|
53
62
|
@media screen and (min-width: 1024px) {
|
54
|
-
.mfui-
|
55
|
-
width: 50%;
|
63
|
+
.mfui-picture-with-description__articles {
|
56
64
|
-webkit-box-ordinal-group: 2;
|
57
65
|
-ms-flex-order: 1;
|
58
66
|
order: 1;
|
67
|
+
width: 50%;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
@media screen and (min-width: 1024px) {
|
71
|
+
.mfui-picture-with-description__articles_text-top-align {
|
72
|
+
-ms-flex-item-align: start;
|
73
|
+
align-self: flex-start;
|
59
74
|
}
|
60
75
|
}
|
61
76
|
@media screen and (min-width: 1024px) {
|
62
|
-
.mfui-
|
77
|
+
.mfui-picture-with-description__articles_align_right {
|
63
78
|
margin-right: 20px;
|
64
79
|
}
|
65
80
|
}
|
@@ -6,10 +6,23 @@ export declare const pictureAlignTypes: {
|
|
6
6
|
};
|
7
7
|
declare type PictureAlignTypesType = typeof pictureAlignTypes[keyof typeof pictureAlignTypes];
|
8
8
|
export interface IPictureWithDescriptionProps {
|
9
|
+
/** Ссылка на корневой элемент */
|
10
|
+
rootRef?: React.Ref<HTMLDivElement>;
|
11
|
+
/** Дополнительный класс для корневого элемента */
|
12
|
+
className?: string;
|
13
|
+
/** Дополнительные классы для корневого и внутренних элементов */
|
14
|
+
classes?: {
|
15
|
+
root?: string;
|
16
|
+
title?: string;
|
17
|
+
};
|
18
|
+
/** Заголовок */
|
19
|
+
title?: string | React.ReactNode | React.ReactNode[];
|
9
20
|
/** Url изображения */
|
10
21
|
pictureUrl: string;
|
11
22
|
/** Расположение изображения */
|
12
23
|
pictureAlign?: PictureAlignTypesType;
|
24
|
+
/** Выравнивание текста по верхнему краю */
|
25
|
+
isTextTopAlign?: boolean;
|
13
26
|
}
|
14
27
|
declare const PictureWithDescription: React.FC<IPictureWithDescriptionProps>;
|
15
28
|
export default PictureWithDescription;
|
@@ -1,20 +1,28 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
+
import { Header } from '@megafon/ui-core';
|
3
|
+
import { cnCreate } from '@megafon/ui-helpers';
|
2
4
|
import PropTypes from 'prop-types';
|
3
5
|
import "./PictureWithDescription.css";
|
4
|
-
import { cnCreate } from '@megafon/ui-core';
|
5
6
|
export var pictureAlignTypes = {
|
6
7
|
LEFT: 'left',
|
7
8
|
RIGHT: 'right'
|
8
9
|
};
|
9
|
-
var cn = cnCreate('mfui-
|
10
|
+
var cn = cnCreate('mfui-picture-with-description');
|
10
11
|
|
11
12
|
var PictureWithDescription = function PictureWithDescription(_ref) {
|
12
|
-
var
|
13
|
+
var rootRef = _ref.rootRef,
|
14
|
+
className = _ref.className,
|
15
|
+
_ref$classes = _ref.classes,
|
16
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
17
|
+
title = _ref.title,
|
18
|
+
pictureUrl = _ref.pictureUrl,
|
13
19
|
_ref$pictureAlign = _ref.pictureAlign,
|
14
20
|
pictureAlign = _ref$pictureAlign === void 0 ? 'left' : _ref$pictureAlign,
|
21
|
+
isTextTopAlign = _ref.isTextTopAlign,
|
15
22
|
children = _ref.children;
|
16
23
|
return /*#__PURE__*/React.createElement("div", {
|
17
|
-
className: cn()
|
24
|
+
className: cn([className, classes.root]),
|
25
|
+
ref: rootRef
|
18
26
|
}, /*#__PURE__*/React.createElement("div", {
|
19
27
|
className: cn('picture', {
|
20
28
|
align: pictureAlign
|
@@ -25,13 +33,29 @@ var PictureWithDescription = function PictureWithDescription(_ref) {
|
|
25
33
|
alt: ""
|
26
34
|
})), /*#__PURE__*/React.createElement("div", {
|
27
35
|
className: cn('articles', {
|
28
|
-
align: pictureAlign
|
36
|
+
align: pictureAlign,
|
37
|
+
'text-top-align': isTextTopAlign
|
29
38
|
})
|
30
|
-
},
|
39
|
+
}, !!title && /*#__PURE__*/React.createElement(Header, {
|
40
|
+
className: cn('title', [classes.title]),
|
41
|
+
as: "h2"
|
42
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
43
|
+
className: cn('content')
|
44
|
+
}, children)));
|
31
45
|
};
|
32
46
|
|
33
47
|
PictureWithDescription.propTypes = {
|
48
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
49
|
+
current: PropTypes.elementType
|
50
|
+
}), PropTypes.any])]),
|
51
|
+
className: PropTypes.string,
|
52
|
+
classes: PropTypes.shape({
|
53
|
+
root: PropTypes.string,
|
54
|
+
title: PropTypes.string
|
55
|
+
}),
|
56
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
34
57
|
pictureUrl: PropTypes.string.isRequired,
|
35
|
-
pictureAlign: PropTypes.oneOf([pictureAlignTypes.LEFT, pictureAlignTypes.RIGHT])
|
58
|
+
pictureAlign: PropTypes.oneOf([pictureAlignTypes.LEFT, pictureAlignTypes.RIGHT]),
|
59
|
+
isTextTopAlign: PropTypes.bool
|
36
60
|
};
|
37
61
|
export default PictureWithDescription;
|
@@ -5,113 +5,121 @@ h4,
|
|
5
5
|
h5 {
|
6
6
|
margin: 0;
|
7
7
|
}
|
8
|
-
.mfui-
|
9
|
-
|
10
|
-
|
8
|
+
.mfui-property__wrapper {
|
9
|
+
display: -webkit-box;
|
10
|
+
display: -ms-flexbox;
|
11
|
+
display: flex;
|
12
|
+
-webkit-box-orient: vertical;
|
13
|
+
-webkit-box-direction: normal;
|
14
|
+
-ms-flex-direction: column;
|
15
|
+
flex-direction: column;
|
16
|
+
padding: 24px 0;
|
11
17
|
border-top: 1px solid #D8D8D8;
|
12
|
-
position: relative;
|
13
|
-
}
|
14
|
-
.mfui-beta-property_border-bottom {
|
15
|
-
border-bottom: 1px solid #D8D8D8;
|
16
18
|
}
|
17
|
-
@media screen and (
|
18
|
-
.mfui-
|
19
|
-
padding:
|
19
|
+
@media screen and (min-width: 1280px) {
|
20
|
+
.mfui-property__wrapper {
|
21
|
+
padding: 26px 0;
|
20
22
|
}
|
21
23
|
}
|
22
|
-
|
23
|
-
|
24
|
-
padding: 24px;
|
25
|
-
}
|
24
|
+
.mfui-property_border-bottom .mfui-property__wrapper {
|
25
|
+
border-bottom: 1px solid #D8D8D8;
|
26
26
|
}
|
27
|
-
.mfui-
|
27
|
+
.mfui-property__content {
|
28
28
|
display: -webkit-box;
|
29
29
|
display: -ms-flexbox;
|
30
30
|
display: flex;
|
31
|
-
-webkit-box-align: baseline;
|
32
|
-
-ms-flex-align: baseline;
|
33
|
-
align-items: baseline;
|
34
31
|
}
|
35
|
-
.mfui-
|
36
|
-
|
32
|
+
.mfui-property__item {
|
33
|
+
display: -webkit-box;
|
34
|
+
display: -ms-flexbox;
|
35
|
+
display: flex;
|
37
36
|
}
|
38
|
-
.mfui-
|
37
|
+
.mfui-property__icon {
|
38
|
+
display: inline-block;
|
39
39
|
width: 24px;
|
40
40
|
height: 24px;
|
41
|
-
overflow: hidden;
|
42
41
|
margin-right: 9px;
|
43
42
|
margin-left: 1px;
|
44
|
-
|
43
|
+
overflow: hidden;
|
45
44
|
vertical-align: bottom;
|
46
45
|
}
|
47
|
-
.mfui-
|
48
|
-
border-radius: 2px;
|
49
|
-
font-size: 12px;
|
46
|
+
.mfui-property__badge {
|
50
47
|
padding: 2px 8px;
|
48
|
+
border-radius: 2px;
|
51
49
|
color: #FFFFFF;
|
50
|
+
font-size: 12px;
|
52
51
|
background: #FFA717;
|
53
52
|
}
|
54
|
-
.mfui-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
.mfui-beta-property__inner {
|
60
|
-
width: 165px;
|
61
|
-
margin-right: 16px;
|
62
|
-
}
|
53
|
+
.mfui-property__inner {
|
54
|
+
-webkit-box-flex: 1;
|
55
|
+
-ms-flex-positive: 1;
|
56
|
+
flex-grow: 1;
|
57
|
+
padding-right: 20px;
|
63
58
|
}
|
64
59
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
65
|
-
.mfui-
|
66
|
-
|
67
|
-
margin-right: 135px;
|
60
|
+
.mfui-property__inner {
|
61
|
+
padding-right: 77px;
|
68
62
|
}
|
69
63
|
}
|
70
|
-
@media screen and (
|
71
|
-
.mfui-
|
72
|
-
|
73
|
-
margin-right: 96px;
|
64
|
+
@media screen and (max-width: 767px) {
|
65
|
+
.mfui-property__inner {
|
66
|
+
padding-right: 8px;
|
74
67
|
}
|
75
68
|
}
|
76
|
-
.mfui-
|
77
|
-
|
69
|
+
.mfui-property__items-wrapper {
|
70
|
+
width: 100%;
|
71
|
+
}
|
72
|
+
.mfui-property__value-wrapper {
|
78
73
|
display: -webkit-box;
|
79
74
|
display: -ms-flexbox;
|
80
75
|
display: flex;
|
76
|
+
-ms-flex-negative: 0;
|
77
|
+
flex-shrink: 0;
|
78
|
+
-webkit-box-align: start;
|
79
|
+
-ms-flex-align: start;
|
80
|
+
align-items: flex-start;
|
81
|
+
-webkit-box-pack: end;
|
82
|
+
-ms-flex-pack: end;
|
83
|
+
justify-content: flex-end;
|
84
|
+
width: 35%;
|
85
|
+
}
|
86
|
+
@media screen and (max-width: 479px) {
|
87
|
+
.mfui-property__value-wrapper {
|
88
|
+
width: auto;
|
89
|
+
padding-left: 10px;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
.mfui-property__value-wrapper_merged {
|
81
93
|
-webkit-box-align: center;
|
82
94
|
-ms-flex-align: center;
|
83
95
|
align-items: center;
|
84
|
-
position: absolute;
|
85
|
-
left: calc(431px + 24px + 20px);
|
86
|
-
top: 50%;
|
87
|
-
-webkit-transform: translateY(-50%);
|
88
|
-
transform: translateY(-50%);
|
89
96
|
border-left: 1px solid #D8D8D8;
|
90
|
-
padding-left: 94px;
|
91
97
|
}
|
92
|
-
|
93
|
-
|
94
|
-
height: calc(100% - 24px * 2);
|
95
|
-
left: calc(165px + 0 + 8px);
|
96
|
-
padding-left: 7px;
|
97
|
-
}
|
98
|
+
.mfui-property__desc {
|
99
|
+
margin-top: 8px;
|
98
100
|
}
|
99
|
-
|
100
|
-
|
101
|
-
height: calc(100% - 24px * 2);
|
102
|
-
left: calc(360px + 24px + 77px);
|
103
|
-
padding-left: 58px;
|
104
|
-
}
|
101
|
+
.mfui-property__item + .mfui-property__item {
|
102
|
+
margin-top: 16px;
|
105
103
|
}
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
104
|
+
.mfui-property__value {
|
105
|
+
max-width: 234px;
|
106
|
+
white-space: pre-line;
|
107
|
+
text-align: right;
|
108
|
+
font-weight: 500;
|
109
|
+
font-size: 18px;
|
110
|
+
line-height: 24px;
|
111
|
+
letter-spacing: 0.5px;
|
112
|
+
}
|
113
|
+
@media screen and (min-width: 1280px) {
|
114
|
+
.mfui-property__value {
|
115
|
+
font-size: 20px;
|
116
|
+
line-height: 28px;
|
110
117
|
}
|
111
118
|
}
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
119
|
+
@media screen and (max-width: 767px) {
|
120
|
+
.mfui-property__value {
|
121
|
+
font-size: 15px;
|
122
|
+
line-height: 24px;
|
123
|
+
font-weight: 500;
|
124
|
+
}
|
117
125
|
}
|
@@ -1,14 +1,33 @@
|
|
1
|
-
import
|
1
|
+
import React, { Ref } from 'react';
|
2
2
|
import './Property.less';
|
3
3
|
import { Item } from './types';
|
4
4
|
export interface IProperty {
|
5
|
+
/** Ссылка на корневой элемент */
|
6
|
+
rootRef?: Ref<HTMLDivElement>;
|
7
|
+
/** Массив с данными для строки */
|
5
8
|
items: Item[];
|
9
|
+
/** Дополнительный класс для основного контейнера */
|
6
10
|
className?: string;
|
11
|
+
/** Текст для бейджа */
|
7
12
|
badge?: string;
|
13
|
+
/** Наличие нижней границы */
|
8
14
|
borderBottom?: boolean;
|
15
|
+
/** Единое значение для всей строки */
|
9
16
|
mergedValue?: string;
|
17
|
+
/** Иконка для строки */
|
10
18
|
icon?: React.ReactNode;
|
11
|
-
|
19
|
+
/** Растягивание компонента на всю доступную ширину */
|
20
|
+
fullWidth?: boolean;
|
21
|
+
/** Дата атрибуты для корневого элемента */
|
22
|
+
dataAttrs?: {
|
23
|
+
[key: string]: string;
|
24
|
+
};
|
25
|
+
/** Дополнительные классы для внутренних элементов */
|
26
|
+
classes?: {
|
27
|
+
title?: string;
|
28
|
+
openedDescription?: string;
|
29
|
+
toggleDescription?: string;
|
30
|
+
};
|
12
31
|
}
|
13
32
|
declare const Property: React.FC<IProperty>;
|
14
33
|
export default Property;
|
@@ -1,15 +1,18 @@
|
|
1
1
|
import "core-js/modules/es.symbol";
|
2
2
|
import "core-js/modules/es.symbol.description";
|
3
3
|
import "core-js/modules/es.array.map";
|
4
|
-
import
|
4
|
+
import _extends from "@babel/runtime/helpers/extends";
|
5
|
+
import React from 'react';
|
6
|
+
import { Header, Grid, GridColumn } from '@megafon/ui-core';
|
7
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
5
8
|
import PropTypes from 'prop-types';
|
6
|
-
import { Header, cnCreate, convert } from '@megafon/ui-core';
|
7
9
|
import "./Property.css";
|
8
10
|
import PropertyDescription from "./PropertyDescription";
|
9
|
-
var cn = cnCreate('mfui-
|
11
|
+
var cn = cnCreate('mfui-property');
|
10
12
|
|
11
13
|
var Property = function Property(_ref) {
|
12
|
-
var
|
14
|
+
var rootRef = _ref.rootRef,
|
15
|
+
items = _ref.items,
|
13
16
|
className = _ref.className,
|
14
17
|
_ref$badge = _ref.badge,
|
15
18
|
badge = _ref$badge === void 0 ? '' : _ref$badge,
|
@@ -18,58 +21,95 @@ var Property = function Property(_ref) {
|
|
18
21
|
borderBottom = _ref$borderBottom === void 0 ? false : _ref$borderBottom,
|
19
22
|
_ref$mergedValue = _ref.mergedValue,
|
20
23
|
mergedValue = _ref$mergedValue === void 0 ? '' : _ref$mergedValue,
|
21
|
-
_ref$
|
22
|
-
|
24
|
+
_ref$fullWidth = _ref.fullWidth,
|
25
|
+
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
|
26
|
+
_ref$classes = _ref.classes,
|
27
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
28
|
+
dataAttrs = _ref.dataAttrs;
|
23
29
|
var renderTitle = React.useCallback(function (title) {
|
24
30
|
return title && title.map(function (titleItem, i) {
|
25
31
|
return /*#__PURE__*/React.createElement(Header, {
|
26
|
-
as:
|
27
|
-
key: i
|
32
|
+
as: "h5",
|
33
|
+
key: i,
|
34
|
+
className: classes.title
|
28
35
|
}, icon && i === 0 && /*#__PURE__*/React.createElement("div", {
|
29
36
|
className: cn('icon')
|
30
|
-
}, icon),
|
37
|
+
}, icon), titleItem);
|
31
38
|
});
|
32
|
-
}, []);
|
39
|
+
}, [classes.title, icon]);
|
33
40
|
var renderDescription = React.useCallback(function (description) {
|
34
|
-
return description && description.map(function (
|
41
|
+
return description && description.map(function (_ref2, j) {
|
42
|
+
var value = _ref2.value,
|
43
|
+
isCollapsible = _ref2.isCollapsible;
|
35
44
|
return /*#__PURE__*/React.createElement("div", {
|
36
45
|
className: cn('desc'),
|
37
46
|
key: j
|
38
|
-
}, /*#__PURE__*/React.createElement(PropertyDescription,
|
47
|
+
}, /*#__PURE__*/React.createElement(PropertyDescription, {
|
48
|
+
value: value,
|
49
|
+
isCollapsible: isCollapsible,
|
50
|
+
classes: {
|
51
|
+
open: classes.openedDescription,
|
52
|
+
toggle: classes.toggleDescription
|
53
|
+
}
|
54
|
+
}));
|
39
55
|
});
|
40
|
-
}, []);
|
41
|
-
|
56
|
+
}, [classes.openedDescription, classes.toggleDescription]);
|
57
|
+
var getColumnConfig = React.useCallback(function () {
|
58
|
+
return fullWidth ? {
|
59
|
+
all: '12'
|
60
|
+
} : {
|
61
|
+
wide: '8',
|
62
|
+
desktop: '10',
|
63
|
+
tablet: '12',
|
64
|
+
mobile: '12'
|
65
|
+
};
|
66
|
+
}, [fullWidth]);
|
67
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
42
68
|
className: cn({
|
43
69
|
'border-bottom': borderBottom
|
44
|
-
}, [className])
|
45
|
-
|
70
|
+
}, [className]),
|
71
|
+
ref: rootRef
|
72
|
+
}, filterDataAttrs(dataAttrs)), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(GridColumn, getColumnConfig(), /*#__PURE__*/React.createElement("div", {
|
73
|
+
className: cn('wrapper')
|
74
|
+
}, badge && /*#__PURE__*/React.createElement("div", {
|
75
|
+
className: cn('badge-wrapper')
|
76
|
+
}, /*#__PURE__*/React.createElement("span", {
|
46
77
|
className: cn('badge')
|
47
|
-
}, badge),
|
48
|
-
|
49
|
-
|
50
|
-
|
78
|
+
}, badge)), /*#__PURE__*/React.createElement("div", {
|
79
|
+
className: cn('content')
|
80
|
+
}, /*#__PURE__*/React.createElement("div", {
|
81
|
+
className: cn('items-wrapper')
|
82
|
+
}, items.map(function (_ref3, i) {
|
83
|
+
var title = _ref3.title,
|
84
|
+
value = _ref3.value,
|
85
|
+
description = _ref3.description;
|
51
86
|
return /*#__PURE__*/React.createElement("div", {
|
52
|
-
className: cn('item',
|
53
|
-
multirow: multirow
|
54
|
-
}),
|
87
|
+
className: cn('item'),
|
55
88
|
key: i
|
56
89
|
}, /*#__PURE__*/React.createElement("div", {
|
57
90
|
className: cn('inner')
|
58
|
-
}, renderTitle(title), renderDescription(description)),
|
59
|
-
|
60
|
-
}, value
|
61
|
-
className: cn('
|
62
|
-
},
|
63
|
-
|
64
|
-
|
65
|
-
|
91
|
+
}, renderTitle(title), renderDescription(description)), !mergedValue && /*#__PURE__*/React.createElement("div", {
|
92
|
+
className: cn('value-wrapper')
|
93
|
+
}, value && /*#__PURE__*/React.createElement("span", {
|
94
|
+
className: cn('value')
|
95
|
+
}, value)));
|
96
|
+
})), mergedValue && /*#__PURE__*/React.createElement("div", {
|
97
|
+
className: cn('value-wrapper', {
|
98
|
+
merged: true
|
99
|
+
})
|
100
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
101
|
+
as: "h3"
|
102
|
+
}, mergedValue)))))));
|
66
103
|
};
|
67
104
|
|
68
105
|
Property.propTypes = {
|
106
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
107
|
+
current: PropTypes.elementType
|
108
|
+
}), PropTypes.any])]),
|
69
109
|
items: PropTypes.arrayOf(PropTypes.shape({
|
70
|
-
title: PropTypes.
|
110
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.node)]),
|
71
111
|
description: PropTypes.arrayOf(PropTypes.shape({
|
72
|
-
value: PropTypes.arrayOf(PropTypes.
|
112
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.node)]).isRequired,
|
73
113
|
isCollapsible: PropTypes.bool
|
74
114
|
})),
|
75
115
|
value: PropTypes.string
|
@@ -79,6 +119,12 @@ Property.propTypes = {
|
|
79
119
|
borderBottom: PropTypes.bool,
|
80
120
|
mergedValue: PropTypes.string,
|
81
121
|
icon: PropTypes.node,
|
82
|
-
|
122
|
+
fullWidth: PropTypes.bool,
|
123
|
+
dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
|
124
|
+
classes: PropTypes.shape({
|
125
|
+
title: PropTypes.string,
|
126
|
+
openedDescription: PropTypes.string,
|
127
|
+
toggleDescription: PropTypes.string
|
128
|
+
})
|
83
129
|
};
|
84
130
|
export default Property;
|
@@ -5,13 +5,13 @@ h4,
|
|
5
5
|
h5 {
|
6
6
|
margin: 0;
|
7
7
|
}
|
8
|
-
.mfui-
|
9
|
-
font-size: 12px;
|
8
|
+
.mfui-property-description__collapse {
|
10
9
|
color: #34AAF2;
|
10
|
+
font-size: 12px;
|
11
11
|
-webkit-text-decoration: underline dashed #34AAF2;
|
12
12
|
text-decoration: underline dashed #34AAF2;
|
13
13
|
cursor: pointer;
|
14
14
|
}
|
15
|
-
.mfui-
|
15
|
+
.mfui-property-description__content-inner {
|
16
16
|
margin-top: 8px;
|
17
17
|
}
|
@@ -1,15 +1,17 @@
|
|
1
|
-
import "core-js/modules/es.array.map";
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
2
|
import * as React from 'react';
|
3
|
+
import { Collapse } from '@megafon/ui-core';
|
4
|
+
import { cnCreate } from '@megafon/ui-helpers';
|
4
5
|
import PropTypes from 'prop-types';
|
5
|
-
import { cnCreate, Collapse, Paragraph, convert } from '@megafon/ui-core';
|
6
6
|
import "./PropertyDescription.css";
|
7
|
-
var cn = cnCreate('mfui-
|
7
|
+
var cn = cnCreate('mfui-property-description');
|
8
8
|
|
9
9
|
var PropertyDescription = function PropertyDescription(_ref) {
|
10
10
|
var value = _ref.value,
|
11
11
|
_ref$isCollapsible = _ref.isCollapsible,
|
12
|
-
isCollapsible = _ref$isCollapsible === void 0 ? false : _ref$isCollapsible
|
12
|
+
isCollapsible = _ref$isCollapsible === void 0 ? false : _ref$isCollapsible,
|
13
|
+
_ref$classes = _ref.classes,
|
14
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes;
|
13
15
|
|
14
16
|
var _React$useState = React.useState(false),
|
15
17
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
@@ -19,35 +21,31 @@ var PropertyDescription = function PropertyDescription(_ref) {
|
|
19
21
|
var handleClickDesc = React.useCallback(function () {
|
20
22
|
return setIsOpened(!isOpened);
|
21
23
|
}, [isOpened]);
|
22
|
-
var renderDescriptionItems = React.useCallback(function () {
|
23
|
-
return value.map(function (valueItem, i) {
|
24
|
-
return /*#__PURE__*/React.createElement(Paragraph, {
|
25
|
-
hasMargin: false,
|
26
|
-
key: i
|
27
|
-
}, convert(valueItem));
|
28
|
-
});
|
29
|
-
}, [value]);
|
30
24
|
|
31
25
|
if (isCollapsible) {
|
32
26
|
return /*#__PURE__*/React.createElement("div", {
|
33
|
-
className: cn()
|
27
|
+
className: cn([isOpened ? classes.open : undefined])
|
34
28
|
}, /*#__PURE__*/React.createElement("span", {
|
35
|
-
className: cn('collapse'),
|
29
|
+
className: cn('collapse', classes.toggle),
|
36
30
|
onClick: handleClickDesc
|
37
31
|
}, isOpened ? 'Скрыть' : 'Подробнее'), /*#__PURE__*/React.createElement(Collapse, {
|
38
32
|
className: cn('content'),
|
39
33
|
classNameContainer: cn('content-inner'),
|
40
34
|
isOpened: isOpened
|
41
|
-
},
|
42
|
-
} else {
|
43
|
-
return /*#__PURE__*/React.createElement("div", {
|
44
|
-
className: cn()
|
45
|
-
}, renderDescriptionItems());
|
35
|
+
}, value));
|
46
36
|
}
|
37
|
+
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
39
|
+
className: cn()
|
40
|
+
}, value);
|
47
41
|
};
|
48
42
|
|
49
43
|
PropertyDescription.propTypes = {
|
50
|
-
value: PropTypes.
|
51
|
-
isCollapsible: PropTypes.bool
|
44
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.node)]).isRequired,
|
45
|
+
isCollapsible: PropTypes.bool,
|
46
|
+
classes: PropTypes.shape({
|
47
|
+
open: PropTypes.string,
|
48
|
+
toggle: PropTypes.string
|
49
|
+
})
|
52
50
|
};
|
53
51
|
export default PropertyDescription;
|
@@ -1,9 +1,14 @@
|
|
1
|
+
import * as React from 'react';
|
1
2
|
export declare type Desc = {
|
2
|
-
value: string[];
|
3
|
+
value: string | React.ReactNode[];
|
3
4
|
isCollapsible?: boolean;
|
5
|
+
classes?: {
|
6
|
+
toggle?: string;
|
7
|
+
open?: string;
|
8
|
+
};
|
4
9
|
};
|
5
10
|
export declare type Item = {
|
6
|
-
title?: string[];
|
11
|
+
title?: string[] | React.ReactNode[];
|
7
12
|
description?: Desc[];
|
8
13
|
value?: string;
|
9
14
|
};
|