@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
@@ -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,19 +1,21 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
-
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
6
4
|
value: true
|
7
5
|
});
|
8
6
|
exports["default"] = exports.BackgroundColors = void 0;
|
9
7
|
|
10
|
-
|
8
|
+
require("core-js/modules/es.object.values");
|
9
|
+
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
11
|
|
12
12
|
var _uiCore = require("@megafon/ui-core");
|
13
13
|
|
14
|
-
|
14
|
+
var _uiHelpers = require("@megafon/ui-helpers");
|
15
15
|
|
16
|
-
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
17
|
+
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
17
19
|
|
18
20
|
var BackgroundColors = {
|
19
21
|
DEFAULT: 'default',
|
@@ -23,18 +25,37 @@ var BackgroundColors = {
|
|
23
25
|
PURPLE: 'purple'
|
24
26
|
};
|
25
27
|
exports.BackgroundColors = BackgroundColors;
|
26
|
-
var cn = (0,
|
28
|
+
var cn = (0, _uiHelpers.cnCreate)('mfui-container');
|
27
29
|
|
28
30
|
var Container = function Container(_ref) {
|
29
31
|
var _ref$backgroundColor = _ref.backgroundColor,
|
30
32
|
backgroundColor = _ref$backgroundColor === void 0 ? 'default' : _ref$backgroundColor,
|
31
|
-
|
32
|
-
|
33
|
+
rootRef = _ref.rootRef,
|
34
|
+
id = _ref.id,
|
35
|
+
className = _ref.className,
|
36
|
+
children = _ref.children,
|
37
|
+
disablePaddingTop = _ref.disablePaddingTop,
|
38
|
+
disablePaddingBottom = _ref.disablePaddingBottom;
|
39
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
33
40
|
className: cn({
|
34
|
-
'bg-color': backgroundColor
|
35
|
-
|
36
|
-
|
41
|
+
'bg-color': backgroundColor,
|
42
|
+
'disable-padding-top': disablePaddingTop,
|
43
|
+
'disable-padding-bottom': disablePaddingBottom
|
44
|
+
}, [className]),
|
45
|
+
ref: rootRef,
|
46
|
+
id: id
|
47
|
+
}, /*#__PURE__*/_react["default"].createElement(_uiCore.ContentArea, null, children));
|
37
48
|
};
|
38
49
|
|
50
|
+
Container.propTypes = {
|
51
|
+
id: _propTypes["default"].string,
|
52
|
+
className: _propTypes["default"].string,
|
53
|
+
backgroundColor: _propTypes["default"].oneOf(Object.values(BackgroundColors)),
|
54
|
+
rootRef: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
55
|
+
current: _propTypes["default"].elementType
|
56
|
+
}), _propTypes["default"].any])]),
|
57
|
+
disablePaddingTop: _propTypes["default"].bool,
|
58
|
+
disablePaddingBottom: _propTypes["default"].bool
|
59
|
+
};
|
39
60
|
var _default = Container;
|
40
61
|
exports["default"] = _default;
|
@@ -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
|
}
|
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
4
|
|
5
|
-
require("core-js/modules/es.array.concat");
|
6
|
-
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
8
6
|
value: true
|
9
7
|
});
|
@@ -11,21 +9,33 @@ exports["default"] = void 0;
|
|
11
9
|
|
12
10
|
require("core-js/modules/es.array.concat");
|
13
11
|
|
14
|
-
|
12
|
+
require("core-js/modules/es.string.link");
|
15
13
|
|
16
|
-
var
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
15
|
+
|
16
|
+
var React = _interopRequireWildcard(require("react"));
|
17
17
|
|
18
18
|
var _uiCore = require("@megafon/ui-core");
|
19
19
|
|
20
|
-
var
|
20
|
+
var _uiHelpers = require("@megafon/ui-helpers");
|
21
21
|
|
22
|
-
|
22
|
+
var PropTypes = _interopRequireWildcard(require("prop-types"));
|
23
23
|
|
24
24
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
25
25
|
|
26
26
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
27
27
|
|
28
|
-
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
29
|
+
|
30
|
+
var DownloadIcon = function DownloadIcon(props) {
|
31
|
+
return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
|
32
|
+
viewBox: "0 0 40 40"
|
33
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
34
|
+
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"
|
35
|
+
}));
|
36
|
+
};
|
37
|
+
|
38
|
+
var cn = (0, _uiHelpers.cnCreate)('mfui-download-link');
|
29
39
|
|
30
40
|
var DownloadLink = function DownloadLink(_ref) {
|
31
41
|
var href = _ref.href,
|
@@ -33,15 +43,19 @@ var DownloadLink = function DownloadLink(_ref) {
|
|
33
43
|
extension = _ref.extension,
|
34
44
|
fileSize = _ref.fileSize,
|
35
45
|
onClick = _ref.onClick,
|
36
|
-
className = _ref.className
|
46
|
+
className = _ref.className,
|
47
|
+
_ref$classes = _ref.classes,
|
48
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
49
|
+
rootRef = _ref.rootRef;
|
37
50
|
return /*#__PURE__*/React.createElement("div", {
|
38
|
-
className: cn([className])
|
51
|
+
className: cn([className, classes.root]),
|
52
|
+
ref: rootRef
|
39
53
|
}, /*#__PURE__*/React.createElement("div", {
|
40
54
|
className: cn('icon')
|
41
|
-
}, /*#__PURE__*/React.createElement(
|
55
|
+
}, /*#__PURE__*/React.createElement(DownloadIcon, {
|
42
56
|
className: cn('icon-svg')
|
43
57
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_uiCore.TextLink, {
|
44
|
-
className: cn('link'),
|
58
|
+
className: cn('link', [classes.link]),
|
45
59
|
href: href,
|
46
60
|
onClick: onClick,
|
47
61
|
download: true
|
@@ -51,11 +65,18 @@ var DownloadLink = function DownloadLink(_ref) {
|
|
51
65
|
};
|
52
66
|
|
53
67
|
DownloadLink.propTypes = {
|
68
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
69
|
+
current: PropTypes.elementType
|
70
|
+
}), PropTypes.any])]),
|
54
71
|
href: PropTypes.string.isRequired,
|
55
72
|
text: PropTypes.string.isRequired,
|
56
73
|
extension: PropTypes.string.isRequired,
|
57
74
|
fileSize: PropTypes.string.isRequired,
|
58
75
|
className: PropTypes.string,
|
76
|
+
classes: PropTypes.shape({
|
77
|
+
root: PropTypes.string,
|
78
|
+
link: PropTypes.string
|
79
|
+
}),
|
59
80
|
onClick: PropTypes.func
|
60
81
|
};
|
61
82
|
var _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>;
|
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
4
|
|
5
|
-
require("core-js/modules/es.array.map");
|
6
|
-
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
8
6
|
value: true
|
9
7
|
});
|
@@ -15,10 +13,12 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
15
13
|
|
16
14
|
var React = _interopRequireWildcard(require("react"));
|
17
15
|
|
18
|
-
var PropTypes = _interopRequireWildcard(require("prop-types"));
|
19
|
-
|
20
16
|
var _uiCore = require("@megafon/ui-core");
|
21
17
|
|
18
|
+
var _uiHelpers = require("@megafon/ui-helpers");
|
19
|
+
|
20
|
+
var PropTypes = _interopRequireWildcard(require("prop-types"));
|
21
|
+
|
22
22
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
23
23
|
|
24
24
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
@@ -55,10 +55,23 @@ var getColumnConfig = function getColumnConfig(itemsCount) {
|
|
55
55
|
}
|
56
56
|
};
|
57
57
|
|
58
|
-
var cn = (0,
|
58
|
+
var cn = (0, _uiHelpers.cnCreate)('mfui-download-links');
|
59
59
|
|
60
60
|
var DownloadLinks = function DownloadLinks(_ref) {
|
61
|
-
var
|
61
|
+
var _ref$inOneColumn = _ref.inOneColumn,
|
62
|
+
inOneColumn = _ref$inOneColumn === void 0 ? false : _ref$inOneColumn,
|
63
|
+
children = _ref.children;
|
64
|
+
|
65
|
+
if (inOneColumn) {
|
66
|
+
return /*#__PURE__*/React.createElement("div", {
|
67
|
+
className: cn()
|
68
|
+
}, React.Children.map(children, function (child) {
|
69
|
+
return /*#__PURE__*/React.createElement("div", {
|
70
|
+
className: cn('item')
|
71
|
+
}, child);
|
72
|
+
}));
|
73
|
+
}
|
74
|
+
|
62
75
|
var itemsCount = React.Children.count(children);
|
63
76
|
var columnConfig = getColumnConfig(itemsCount);
|
64
77
|
return /*#__PURE__*/React.createElement("div", {
|
@@ -75,6 +88,7 @@ var DownloadLinks = function DownloadLinks(_ref) {
|
|
75
88
|
};
|
76
89
|
|
77
90
|
DownloadLinks.propTypes = {
|
91
|
+
inOneColumn: PropTypes.bool,
|
78
92
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element]).isRequired
|
79
93
|
};
|
80
94
|
var _default = DownloadLinks;
|