@megafon/ui-shared 2.0.0-beta.99 → 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 +1610 -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
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import React, { Ref } from 'react';
|
2
2
|
import './Container.less';
|
3
3
|
export declare const BackgroundColors: {
|
4
4
|
readonly DEFAULT: "default";
|
@@ -9,8 +9,18 @@ export declare const BackgroundColors: {
|
|
9
9
|
};
|
10
10
|
declare type BackgroundColorType = typeof BackgroundColors[keyof typeof BackgroundColors];
|
11
11
|
declare type Props = {
|
12
|
+
/** Атрибут корневого тега */
|
13
|
+
id?: string;
|
14
|
+
/** Ссылка на корневой элемент */
|
15
|
+
rootRef?: Ref<HTMLDivElement>;
|
16
|
+
/** Дополнительный класс корневого элемента */
|
17
|
+
className?: string;
|
12
18
|
/** Цвет фона */
|
13
19
|
backgroundColor?: BackgroundColorType;
|
20
|
+
/** Отключить отступ сверху */
|
21
|
+
disablePaddingTop?: boolean;
|
22
|
+
/** Отключить отступ снизу */
|
23
|
+
disablePaddingBottom?: boolean;
|
14
24
|
};
|
15
25
|
declare const Container: React.FC<Props>;
|
16
26
|
export default Container;
|
@@ -1,6 +1,9 @@
|
|
1
|
-
import
|
1
|
+
import "core-js/modules/es.object.values";
|
2
|
+
import React from 'react';
|
3
|
+
import { ContentArea } from '@megafon/ui-core';
|
4
|
+
import { cnCreate } from '@megafon/ui-helpers';
|
5
|
+
import PropTypes from 'prop-types';
|
2
6
|
import "./Container.css";
|
3
|
-
import { cnCreate, ContentArea } from '@megafon/ui-core';
|
4
7
|
export var BackgroundColors = {
|
5
8
|
DEFAULT: 'default',
|
6
9
|
LIGHT_GRAY: 'light-gray',
|
@@ -8,17 +11,36 @@ export var BackgroundColors = {
|
|
8
11
|
GREEN: 'green',
|
9
12
|
PURPLE: 'purple'
|
10
13
|
};
|
11
|
-
var cn = cnCreate('mfui-
|
14
|
+
var cn = cnCreate('mfui-container');
|
12
15
|
|
13
16
|
var Container = function Container(_ref) {
|
14
17
|
var _ref$backgroundColor = _ref.backgroundColor,
|
15
18
|
backgroundColor = _ref$backgroundColor === void 0 ? 'default' : _ref$backgroundColor,
|
16
|
-
|
19
|
+
rootRef = _ref.rootRef,
|
20
|
+
id = _ref.id,
|
21
|
+
className = _ref.className,
|
22
|
+
children = _ref.children,
|
23
|
+
disablePaddingTop = _ref.disablePaddingTop,
|
24
|
+
disablePaddingBottom = _ref.disablePaddingBottom;
|
17
25
|
return /*#__PURE__*/React.createElement("div", {
|
18
26
|
className: cn({
|
19
|
-
'bg-color': backgroundColor
|
20
|
-
|
27
|
+
'bg-color': backgroundColor,
|
28
|
+
'disable-padding-top': disablePaddingTop,
|
29
|
+
'disable-padding-bottom': disablePaddingBottom
|
30
|
+
}, [className]),
|
31
|
+
ref: rootRef,
|
32
|
+
id: id
|
21
33
|
}, /*#__PURE__*/React.createElement(ContentArea, null, children));
|
22
34
|
};
|
23
35
|
|
36
|
+
Container.propTypes = {
|
37
|
+
id: PropTypes.string,
|
38
|
+
className: PropTypes.string,
|
39
|
+
backgroundColor: PropTypes.oneOf(Object.values(BackgroundColors)),
|
40
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
41
|
+
current: PropTypes.elementType
|
42
|
+
}), PropTypes.any])]),
|
43
|
+
disablePaddingTop: PropTypes.bool,
|
44
|
+
disablePaddingBottom: PropTypes.bool
|
45
|
+
};
|
24
46
|
export default Container;
|
@@ -5,12 +5,12 @@ h4,
|
|
5
5
|
h5 {
|
6
6
|
margin: 0;
|
7
7
|
}
|
8
|
-
.mfui-
|
8
|
+
.mfui-download-link {
|
9
9
|
display: -webkit-box;
|
10
10
|
display: -ms-flexbox;
|
11
11
|
display: flex;
|
12
12
|
}
|
13
|
-
.mfui-
|
13
|
+
.mfui-download-link__icon {
|
14
14
|
-ms-flex-negative: 0;
|
15
15
|
flex-shrink: 0;
|
16
16
|
width: 40px;
|
@@ -18,16 +18,16 @@ h5 {
|
|
18
18
|
margin-right: 22px;
|
19
19
|
}
|
20
20
|
@media screen and (max-width: 1023px) {
|
21
|
-
.mfui-
|
21
|
+
.mfui-download-link__icon {
|
22
22
|
width: 32px;
|
23
23
|
height: 32px;
|
24
24
|
}
|
25
25
|
}
|
26
|
-
.mfui-
|
26
|
+
.mfui-download-link__icon-svg {
|
27
27
|
width: inherit;
|
28
28
|
height: inherit;
|
29
29
|
}
|
30
|
-
.mfui-
|
30
|
+
.mfui-download-link__info {
|
31
31
|
margin: 0;
|
32
32
|
font-size: 12px;
|
33
33
|
line-height: 16px;
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import './DownloadLink.less';
|
3
3
|
export interface IDownloadLink {
|
4
|
+
/** Ссылка на корневой элемент */
|
5
|
+
rootRef?: React.Ref<HTMLDivElement>;
|
4
6
|
/** Адресы ссылки */
|
5
7
|
href: string;
|
6
8
|
/** Текст ссылки */
|
@@ -11,6 +13,11 @@ export interface IDownloadLink {
|
|
11
13
|
fileSize: string;
|
12
14
|
/** Дополнительный класс для компонента */
|
13
15
|
className?: string;
|
16
|
+
/** Дополнительные классы для корневого и внутренних элементов */
|
17
|
+
classes?: {
|
18
|
+
root?: string;
|
19
|
+
link?: string;
|
20
|
+
};
|
14
21
|
/** Обработчик клика по ссылке */
|
15
22
|
onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
|
16
23
|
}
|
@@ -1,10 +1,21 @@
|
|
1
1
|
import "core-js/modules/es.array.concat";
|
2
|
+
import "core-js/modules/es.string.link";
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
4
|
import * as React from 'react';
|
5
|
+
import { TextLink } from '@megafon/ui-core';
|
6
|
+
import { cnCreate } from '@megafon/ui-helpers';
|
3
7
|
import * as PropTypes from 'prop-types';
|
4
|
-
import { cnCreate, TextLink } from '@megafon/ui-core';
|
5
8
|
import "./DownloadLink.css";
|
6
|
-
|
7
|
-
var
|
9
|
+
|
10
|
+
var DownloadIcon = function DownloadIcon(props) {
|
11
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
12
|
+
viewBox: "0 0 40 40"
|
13
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
14
|
+
d: "M21 6v14l2.68-4 1.65 1-4.44 6.74h-1.77L14.68 17l1.65-1L19 20V6zM8 20H6a14 14 0 0028 0h-2a12 12 0 01-24 0z"
|
15
|
+
}));
|
16
|
+
};
|
17
|
+
|
18
|
+
var cn = cnCreate('mfui-download-link');
|
8
19
|
|
9
20
|
var DownloadLink = function DownloadLink(_ref) {
|
10
21
|
var href = _ref.href,
|
@@ -12,15 +23,19 @@ var DownloadLink = function DownloadLink(_ref) {
|
|
12
23
|
extension = _ref.extension,
|
13
24
|
fileSize = _ref.fileSize,
|
14
25
|
onClick = _ref.onClick,
|
15
|
-
className = _ref.className
|
26
|
+
className = _ref.className,
|
27
|
+
_ref$classes = _ref.classes,
|
28
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
29
|
+
rootRef = _ref.rootRef;
|
16
30
|
return /*#__PURE__*/React.createElement("div", {
|
17
|
-
className: cn([className])
|
31
|
+
className: cn([className, classes.root]),
|
32
|
+
ref: rootRef
|
18
33
|
}, /*#__PURE__*/React.createElement("div", {
|
19
34
|
className: cn('icon')
|
20
35
|
}, /*#__PURE__*/React.createElement(DownloadIcon, {
|
21
36
|
className: cn('icon-svg')
|
22
37
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextLink, {
|
23
|
-
className: cn('link'),
|
38
|
+
className: cn('link', [classes.link]),
|
24
39
|
href: href,
|
25
40
|
onClick: onClick,
|
26
41
|
download: true
|
@@ -30,11 +45,18 @@ var DownloadLink = function DownloadLink(_ref) {
|
|
30
45
|
};
|
31
46
|
|
32
47
|
DownloadLink.propTypes = {
|
48
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
49
|
+
current: PropTypes.elementType
|
50
|
+
}), PropTypes.any])]),
|
33
51
|
href: PropTypes.string.isRequired,
|
34
52
|
text: PropTypes.string.isRequired,
|
35
53
|
extension: PropTypes.string.isRequired,
|
36
54
|
fileSize: PropTypes.string.isRequired,
|
37
55
|
className: PropTypes.string,
|
56
|
+
classes: PropTypes.shape({
|
57
|
+
root: PropTypes.string,
|
58
|
+
link: PropTypes.string
|
59
|
+
}),
|
38
60
|
onClick: PropTypes.func
|
39
61
|
};
|
40
62
|
export default DownloadLink;
|
@@ -6,28 +6,31 @@ h5 {
|
|
6
6
|
margin: 0;
|
7
7
|
}
|
8
8
|
@media screen and (min-width: 1024px) {
|
9
|
-
.mfui-
|
9
|
+
.mfui-download-links__column:nth-child(n + 4) {
|
10
10
|
margin-top: 24px;
|
11
11
|
}
|
12
12
|
}
|
13
13
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
14
|
-
.mfui-
|
14
|
+
.mfui-download-links__column:nth-child(n + 3) {
|
15
15
|
margin-top: 24px;
|
16
16
|
}
|
17
17
|
}
|
18
18
|
@media screen and (max-width: 767px) {
|
19
|
-
.mfui-
|
19
|
+
.mfui-download-links__column:not(:first-child) {
|
20
20
|
margin-top: 24px;
|
21
21
|
}
|
22
22
|
}
|
23
23
|
@media screen and (min-width: 768px) {
|
24
|
-
.mfui-
|
24
|
+
.mfui-download-links_count_2 .mfui-download-links__column:nth-child(n + 2) {
|
25
25
|
margin-top: 24px;
|
26
26
|
}
|
27
27
|
}
|
28
28
|
@media screen and (min-width: 768px) {
|
29
|
-
.mfui-
|
30
|
-
.mfui-
|
29
|
+
.mfui-download-links_count_3 .mfui-download-links__column:nth-child(n + 3),
|
30
|
+
.mfui-download-links_count_4 .mfui-download-links__column:nth-child(n + 3) {
|
31
31
|
margin-top: 24px;
|
32
32
|
}
|
33
33
|
}
|
34
|
+
.mfui-download-links__item:not(:first-child) {
|
35
|
+
margin-top: 24px;
|
36
|
+
}
|
@@ -2,6 +2,8 @@ import * as React from 'react';
|
|
2
2
|
import './DownloadLinks.less';
|
3
3
|
import { IDownloadLink } from './DownloadLink';
|
4
4
|
interface IDownloadLinks {
|
5
|
+
/** Выстраивать ссылки в одну колонку вне зависимости от количества */
|
6
|
+
inOneColumn?: boolean;
|
5
7
|
children: Array<React.ReactElement<IDownloadLink>> | React.ReactElement<IDownloadLink>;
|
6
8
|
}
|
7
9
|
declare const DownloadLinks: React.FC<IDownloadLinks>;
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import "core-js/modules/es.array.map";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import * as React from 'react';
|
4
|
+
import { Grid, GridColumn } from '@megafon/ui-core';
|
5
|
+
import { cnCreate } from '@megafon/ui-helpers';
|
4
6
|
import * as PropTypes from 'prop-types';
|
5
|
-
import { cnCreate, Grid, GridColumn } from '@megafon/ui-core';
|
6
7
|
import "./DownloadLinks.css";
|
7
8
|
|
8
9
|
var getColumnConfig = function getColumnConfig(itemsCount) {
|
@@ -35,10 +36,23 @@ var getColumnConfig = function getColumnConfig(itemsCount) {
|
|
35
36
|
}
|
36
37
|
};
|
37
38
|
|
38
|
-
var cn = cnCreate('mfui-
|
39
|
+
var cn = cnCreate('mfui-download-links');
|
39
40
|
|
40
41
|
var DownloadLinks = function DownloadLinks(_ref) {
|
41
|
-
var
|
42
|
+
var _ref$inOneColumn = _ref.inOneColumn,
|
43
|
+
inOneColumn = _ref$inOneColumn === void 0 ? false : _ref$inOneColumn,
|
44
|
+
children = _ref.children;
|
45
|
+
|
46
|
+
if (inOneColumn) {
|
47
|
+
return /*#__PURE__*/React.createElement("div", {
|
48
|
+
className: cn()
|
49
|
+
}, React.Children.map(children, function (child) {
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
51
|
+
className: cn('item')
|
52
|
+
}, child);
|
53
|
+
}));
|
54
|
+
}
|
55
|
+
|
42
56
|
var itemsCount = React.Children.count(children);
|
43
57
|
var columnConfig = getColumnConfig(itemsCount);
|
44
58
|
return /*#__PURE__*/React.createElement("div", {
|
@@ -55,6 +69,7 @@ var DownloadLinks = function DownloadLinks(_ref) {
|
|
55
69
|
};
|
56
70
|
|
57
71
|
DownloadLinks.propTypes = {
|
72
|
+
inOneColumn: PropTypes.bool,
|
58
73
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element]).isRequired
|
59
74
|
};
|
60
75
|
export default DownloadLinks;
|