@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
@@ -2,18 +2,10 @@
|
|
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.symbol");
|
6
|
-
|
7
|
-
require("core-js/modules/es.symbol.description");
|
8
|
-
|
9
|
-
require("core-js/modules/es.array.concat");
|
10
|
-
|
11
|
-
require("core-js/modules/es.object.values");
|
12
|
-
|
13
5
|
Object.defineProperty(exports, "__esModule", {
|
14
6
|
value: true
|
15
7
|
});
|
16
|
-
exports["default"] = exports.
|
8
|
+
exports["default"] = exports.TextColor = exports.ButtonColor = exports.VideoType = exports.ClassName = void 0;
|
17
9
|
|
18
10
|
require("core-js/modules/es.symbol");
|
19
11
|
|
@@ -23,15 +15,25 @@ require("core-js/modules/es.array.concat");
|
|
23
15
|
|
24
16
|
require("core-js/modules/es.object.values");
|
25
17
|
|
18
|
+
require("core-js/modules/es.string.link");
|
19
|
+
|
20
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
21
|
+
|
26
22
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
27
23
|
|
28
|
-
var
|
24
|
+
var _react = _interopRequireDefault(require("react"));
|
29
25
|
|
30
|
-
var
|
26
|
+
var _uiCore = require("@megafon/ui-core");
|
27
|
+
|
28
|
+
var _uiHelpers = require("@megafon/ui-helpers");
|
31
29
|
|
32
30
|
var _lodash = _interopRequireDefault(require("lodash.throttle"));
|
33
31
|
|
34
|
-
var
|
32
|
+
var PropTypes = _interopRequireWildcard(require("prop-types"));
|
33
|
+
|
34
|
+
var _throttleTime = _interopRequireDefault(require("../../constants/throttleTime"));
|
35
|
+
|
36
|
+
var _Breadcrumbs = _interopRequireDefault(require("../Breadcrumbs/Breadcrumbs"));
|
35
37
|
|
36
38
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
37
39
|
|
@@ -39,54 +41,136 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
39
41
|
|
40
42
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
41
43
|
|
42
|
-
var
|
44
|
+
var cn = (0, _uiHelpers.cnCreate)('mfui-video-banner');
|
45
|
+
var ClassName;
|
46
|
+
exports.ClassName = ClassName;
|
47
|
+
|
48
|
+
(function (ClassName) {
|
49
|
+
ClassName["BUTTON"] = "button";
|
50
|
+
ClassName["LINK"] = "link";
|
51
|
+
})(ClassName || (exports.ClassName = ClassName = {}));
|
52
|
+
|
53
|
+
var typographyConfig = {
|
54
|
+
b: {
|
55
|
+
component: function component(_ref) {
|
56
|
+
var children = _ref.children;
|
57
|
+
return /*#__PURE__*/_react["default"].createElement(_uiCore.Header, {
|
58
|
+
className: cn('value'),
|
59
|
+
as: "h3",
|
60
|
+
color: "inherit"
|
61
|
+
}, children);
|
62
|
+
}
|
63
|
+
}
|
64
|
+
};
|
65
|
+
var VideoType = {
|
43
66
|
YOUTUBE: 'youtube',
|
44
67
|
VIDEO: 'video'
|
45
68
|
};
|
46
|
-
exports.
|
47
|
-
var
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
69
|
+
exports.VideoType = VideoType;
|
70
|
+
var ButtonColor = {
|
71
|
+
GREEN: 'green',
|
72
|
+
PURPLE: 'purple'
|
73
|
+
};
|
74
|
+
exports.ButtonColor = ButtonColor;
|
75
|
+
var TextColor = {
|
76
|
+
BLACK: 'black',
|
77
|
+
WHITE: 'white'
|
78
|
+
};
|
79
|
+
exports.TextColor = TextColor;
|
80
|
+
|
81
|
+
var VideoBanner = function VideoBanner(_ref2) {
|
82
|
+
var dataAttrs = _ref2.dataAttrs,
|
83
|
+
className = _ref2.className,
|
84
|
+
_ref2$classes = _ref2.classes,
|
85
|
+
classes = _ref2$classes === void 0 ? {} : _ref2$classes,
|
86
|
+
rootRef = _ref2.rootRef,
|
87
|
+
videoSrc = _ref2.videoSrc,
|
88
|
+
videoType = _ref2.videoType,
|
89
|
+
imageMobile = _ref2.imageMobile,
|
90
|
+
imageTablet = _ref2.imageTablet,
|
91
|
+
_ref2$imageDesktop = _ref2.imageDesktop,
|
92
|
+
imageDesktop = _ref2$imageDesktop === void 0 ? '' : _ref2$imageDesktop,
|
93
|
+
_ref2$imageDesktopWid = _ref2.imageDesktopWide,
|
94
|
+
imageDesktopWide = _ref2$imageDesktopWid === void 0 ? '' : _ref2$imageDesktopWid,
|
95
|
+
content = _ref2.content,
|
96
|
+
_ref2$isMuted = _ref2.isMuted,
|
97
|
+
isMuted = _ref2$isMuted === void 0 ? true : _ref2$isMuted,
|
98
|
+
breadcrumbs = _ref2.breadcrumbs;
|
99
|
+
|
100
|
+
var _React$useState = _react["default"].useState(true),
|
58
101
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
59
102
|
isMobile = _React$useState2[0],
|
60
103
|
setIsMobile = _React$useState2[1];
|
61
104
|
|
62
|
-
var
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
105
|
+
var _React$useState3 = _react["default"].useState(imageMobile),
|
106
|
+
_React$useState4 = (0, _slicedToArray2["default"])(_React$useState3, 2),
|
107
|
+
imageSrc = _React$useState4[0],
|
108
|
+
setImageSrc = _React$useState4[1];
|
109
|
+
|
110
|
+
var isVideoData = !!videoSrc && !!videoType;
|
111
|
+
var isRenderVideo = !isMobile && isVideoData;
|
112
|
+
|
113
|
+
var renderContent = _react["default"].useCallback(function (_ref3) {
|
114
|
+
var title = _ref3.title,
|
115
|
+
description = _ref3.description,
|
116
|
+
buttonTitle = _ref3.buttonTitle,
|
117
|
+
buttonHref = _ref3.buttonHref,
|
118
|
+
buttonDownload = _ref3.buttonDownload,
|
119
|
+
_ref3$buttonColor = _ref3.buttonColor,
|
120
|
+
buttonColor = _ref3$buttonColor === void 0 ? ButtonColor.GREEN : _ref3$buttonColor,
|
121
|
+
onButtonClick = _ref3.onButtonClick,
|
122
|
+
onLinkClick = _ref3.onLinkClick,
|
123
|
+
_ref3$textColor = _ref3.textColor,
|
124
|
+
textColor = _ref3$textColor === void 0 ? TextColor.BLACK : _ref3$textColor,
|
125
|
+
textColorMobile = _ref3.textColorMobile,
|
126
|
+
linkTitle = _ref3.linkTitle,
|
127
|
+
linkUrl = _ref3.linkUrl,
|
128
|
+
linkDownload = _ref3.linkDownload,
|
129
|
+
cost = _ref3.cost;
|
130
|
+
return /*#__PURE__*/_react["default"].createElement(_uiCore.Grid, {
|
131
|
+
className: cn('grid'),
|
132
|
+
guttersLeft: "medium"
|
133
|
+
}, /*#__PURE__*/_react["default"].createElement(_uiCore.GridColumn, {
|
134
|
+
mobile: "12",
|
135
|
+
tablet: "7",
|
136
|
+
desktop: "7",
|
137
|
+
wide: "6"
|
138
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
139
|
+
className: cn('content', {
|
140
|
+
'text-color': textColor,
|
141
|
+
'text-color-mobile': textColorMobile
|
142
|
+
})
|
143
|
+
}, /*#__PURE__*/_react["default"].createElement(_uiCore.Header, {
|
73
144
|
className: cn('title'),
|
74
|
-
|
75
|
-
|
76
|
-
}, title), /*#__PURE__*/
|
145
|
+
as: "h1",
|
146
|
+
color: "inherit"
|
147
|
+
}, title), /*#__PURE__*/_react["default"].createElement("div", {
|
77
148
|
className: cn('text')
|
78
|
-
}, /*#__PURE__*/
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
149
|
+
}, /*#__PURE__*/_react["default"].createElement(_uiCore.Header, {
|
150
|
+
as: "h5",
|
151
|
+
color: "inherit",
|
152
|
+
className: cn('description')
|
153
|
+
}, description), cost && /*#__PURE__*/_react["default"].createElement("div", {
|
154
|
+
className: cn('cost')
|
155
|
+
}, (0, _uiHelpers.convert)(cost, typographyConfig))), /*#__PURE__*/_react["default"].createElement("div", {
|
156
|
+
className: cn('btns-wrapper')
|
157
|
+
}, buttonTitle && /*#__PURE__*/_react["default"].createElement(_uiCore.Button, {
|
158
|
+
className: cn(ClassName.BUTTON, [classes.button]),
|
159
|
+
theme: buttonColor,
|
160
|
+
href: buttonHref,
|
161
|
+
onClick: onButtonClick,
|
162
|
+
download: buttonDownload
|
163
|
+
}, buttonTitle), linkTitle && /*#__PURE__*/_react["default"].createElement(_uiCore.TextLink, {
|
164
|
+
className: cn(ClassName.LINK, [classes.link]),
|
165
|
+
href: linkUrl,
|
166
|
+
download: linkDownload,
|
167
|
+
onClick: onLinkClick
|
168
|
+
}, linkTitle)))));
|
169
|
+
}, [classes.button, classes.link]);
|
170
|
+
|
171
|
+
var renderVideo = _react["default"].useCallback(function () {
|
88
172
|
switch (videoType) {
|
89
|
-
case
|
173
|
+
case VideoType.YOUTUBE:
|
90
174
|
{
|
91
175
|
var url = "https://www.youtube.com/embed/".concat(videoSrc, "?");
|
92
176
|
var autoplay = '&autoplay=1';
|
@@ -98,7 +182,8 @@ var VideoBanner = function VideoBanner(_ref) {
|
|
98
182
|
var policy = '&iv_load_policy=3';
|
99
183
|
var playlist = "&playlist=".concat(videoSrc);
|
100
184
|
var src = "".concat(url).concat(autoplay).concat(mute).concat(loop).concat(rel).concat(controls).concat(info).concat(policy).concat(playlist);
|
101
|
-
return /*#__PURE__*/
|
185
|
+
return /*#__PURE__*/_react["default"].createElement("iframe", {
|
186
|
+
title: "iframe",
|
102
187
|
className: cn('video'),
|
103
188
|
src: src,
|
104
189
|
width: "100%",
|
@@ -108,17 +193,21 @@ var VideoBanner = function VideoBanner(_ref) {
|
|
108
193
|
});
|
109
194
|
}
|
110
195
|
|
111
|
-
case
|
196
|
+
case VideoType.VIDEO:
|
112
197
|
{
|
113
|
-
return
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
198
|
+
return (
|
199
|
+
/*#__PURE__*/
|
200
|
+
// eslint-disable-next-line jsx-a11y/media-has-caption
|
201
|
+
_react["default"].createElement("video", {
|
202
|
+
className: cn('video'),
|
203
|
+
autoPlay: true,
|
204
|
+
loop: true,
|
205
|
+
muted: isMuted
|
206
|
+
}, /*#__PURE__*/_react["default"].createElement("source", {
|
207
|
+
src: videoSrc,
|
208
|
+
type: "video/mp4"
|
209
|
+
}))
|
210
|
+
);
|
122
211
|
}
|
123
212
|
|
124
213
|
default:
|
@@ -127,51 +216,98 @@ var VideoBanner = function VideoBanner(_ref) {
|
|
127
216
|
}
|
128
217
|
}
|
129
218
|
}, [videoType, videoSrc, isMuted]);
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
219
|
+
|
220
|
+
_react["default"].useEffect(function () {
|
221
|
+
var getImageSrc = function getImageSrc() {
|
222
|
+
var windowWidth = window.innerWidth;
|
223
|
+
|
224
|
+
switch (true) {
|
225
|
+
case windowWidth >= _uiHelpers.breakpoints.DESKTOP_MIDDLE_START:
|
226
|
+
return imageDesktopWide;
|
227
|
+
|
228
|
+
case windowWidth >= _uiHelpers.breakpoints.DESKTOP_SMALL_START && windowWidth <= _uiHelpers.breakpoints.DESKTOP_SMALL_END:
|
229
|
+
return imageDesktop;
|
230
|
+
|
231
|
+
case windowWidth >= _uiHelpers.breakpoints.MOBILE_BIG_START && windowWidth <= _uiHelpers.breakpoints.MOBILE_BIG_END:
|
232
|
+
return imageTablet;
|
233
|
+
|
234
|
+
default:
|
235
|
+
return imageMobile;
|
236
|
+
}
|
237
|
+
};
|
238
|
+
|
142
239
|
var resizeHandler = function resizeHandler() {
|
143
|
-
|
240
|
+
setIsMobile(window.innerWidth < _uiHelpers.breakpoints.DESKTOP_SMALL_START);
|
241
|
+
setImageSrc(getImageSrc());
|
144
242
|
};
|
145
243
|
|
146
|
-
var resizeHandlerThrottled = (0, _lodash["default"])(resizeHandler,
|
244
|
+
var resizeHandlerThrottled = (0, _lodash["default"])(resizeHandler, _throttleTime["default"].resize);
|
147
245
|
resizeHandler();
|
148
246
|
window.addEventListener('resize', resizeHandlerThrottled);
|
149
247
|
return function () {
|
150
248
|
window.removeEventListener('resize', resizeHandlerThrottled);
|
151
249
|
};
|
152
|
-
}, []);
|
153
|
-
|
154
|
-
|
155
|
-
|
250
|
+
}, [imageDesktop, imageDesktopWide, imageMobile, imageTablet]);
|
251
|
+
|
252
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs), {
|
253
|
+
className: cn([className, classes.root]),
|
254
|
+
ref: rootRef
|
255
|
+
}), /*#__PURE__*/_react["default"].createElement(_uiCore.ContentArea, null, /*#__PURE__*/_react["default"].createElement("div", {
|
156
256
|
className: cn('wrapper')
|
157
|
-
},
|
257
|
+
}, !!(breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/_react["default"].createElement(_Breadcrumbs["default"], {
|
258
|
+
className: cn('breadcrumbs'),
|
259
|
+
items: breadcrumbs,
|
260
|
+
color: content === null || content === void 0 ? void 0 : content.textColor,
|
261
|
+
classes: {
|
262
|
+
item: classes.breadcrumbs
|
263
|
+
}
|
264
|
+
}), content && renderContent(content), isRenderVideo && renderVideo(), !isRenderVideo && /*#__PURE__*/_react["default"].createElement("div", {
|
265
|
+
style: {
|
266
|
+
backgroundImage: "url(".concat(imageSrc, ")")
|
267
|
+
},
|
268
|
+
className: cn('background-image')
|
269
|
+
}))));
|
158
270
|
};
|
159
271
|
|
160
272
|
VideoBanner.propTypes = {
|
273
|
+
dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
|
274
|
+
className: PropTypes.string,
|
275
|
+
classes: PropTypes.shape({
|
276
|
+
root: PropTypes.string,
|
277
|
+
button: PropTypes.string,
|
278
|
+
link: PropTypes.string,
|
279
|
+
breadcrumbs: PropTypes.string
|
280
|
+
}),
|
281
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
282
|
+
current: PropTypes.elementType
|
283
|
+
}), PropTypes.any])]),
|
161
284
|
videoSrc: PropTypes.string,
|
162
|
-
videoType: PropTypes.oneOf(Object.values(
|
285
|
+
videoType: PropTypes.oneOf(Object.values(VideoType)),
|
163
286
|
content: PropTypes.shape({
|
164
287
|
title: PropTypes.string.isRequired,
|
165
288
|
description: PropTypes.string.isRequired,
|
166
|
-
buttonTitle: PropTypes.string
|
167
|
-
|
168
|
-
|
289
|
+
buttonTitle: PropTypes.string,
|
290
|
+
buttonHref: PropTypes.string,
|
291
|
+
buttonDownload: PropTypes.bool,
|
292
|
+
buttonColor: PropTypes.oneOf(Object.values(ButtonColor)),
|
293
|
+
onButtonClick: PropTypes.func,
|
294
|
+
onLinkClick: PropTypes.func,
|
295
|
+
textColor: PropTypes.oneOf(Object.values(TextColor)),
|
296
|
+
textColorMobile: PropTypes.oneOf(Object.values(TextColor)),
|
297
|
+
linkTitle: PropTypes.string,
|
298
|
+
linkUrl: PropTypes.string,
|
299
|
+
linkDownload: PropTypes.bool,
|
300
|
+
cost: PropTypes.string
|
169
301
|
}),
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
302
|
+
isMuted: PropTypes.bool,
|
303
|
+
imageMobile: PropTypes.string.isRequired,
|
304
|
+
imageTablet: PropTypes.string.isRequired,
|
305
|
+
imageDesktop: PropTypes.string,
|
306
|
+
imageDesktopWide: PropTypes.string,
|
307
|
+
breadcrumbs: PropTypes.arrayOf(PropTypes.shape({
|
308
|
+
title: PropTypes.string.isRequired,
|
309
|
+
href: PropTypes.string
|
310
|
+
}).isRequired)
|
175
311
|
};
|
176
312
|
var _default = VideoBanner;
|
177
313
|
exports["default"] = _default;
|
@@ -5,7 +5,7 @@ h4,
|
|
5
5
|
h5 {
|
6
6
|
margin: 0;
|
7
7
|
}
|
8
|
-
.mfui-
|
8
|
+
.mfui-video-block {
|
9
9
|
display: -webkit-box;
|
10
10
|
display: -ms-flexbox;
|
11
11
|
display: flex;
|
@@ -13,7 +13,7 @@ h5 {
|
|
13
13
|
-ms-flex-align: center;
|
14
14
|
align-items: center;
|
15
15
|
}
|
16
|
-
.mfui-
|
16
|
+
.mfui-video-block__content {
|
17
17
|
display: -webkit-box;
|
18
18
|
display: -ms-flexbox;
|
19
19
|
display: flex;
|
@@ -21,103 +21,107 @@ h5 {
|
|
21
21
|
-webkit-box-direction: normal;
|
22
22
|
-ms-flex-direction: column;
|
23
23
|
flex-direction: column;
|
24
|
-
height: 100%;
|
25
24
|
-webkit-box-pack: center;
|
26
25
|
-ms-flex-pack: center;
|
27
26
|
justify-content: center;
|
27
|
+
height: 100%;
|
28
28
|
}
|
29
29
|
@media screen and (max-width: 767px) {
|
30
|
-
.mfui-
|
30
|
+
.mfui-video-block__content {
|
31
31
|
margin-top: 24px;
|
32
32
|
}
|
33
33
|
}
|
34
34
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
35
|
-
.mfui-
|
35
|
+
.mfui-video-block__content {
|
36
36
|
margin-top: 32px;
|
37
37
|
}
|
38
38
|
}
|
39
39
|
@media screen and (min-width: 768px) {
|
40
|
-
.mfui-
|
41
|
-
padding-right: 20px;
|
40
|
+
.mfui-video-block__content {
|
42
41
|
margin-right: 20px;
|
42
|
+
padding-right: 20px;
|
43
43
|
}
|
44
44
|
}
|
45
|
-
.mfui-
|
45
|
+
.mfui-video-block__header {
|
46
46
|
margin-bottom: 24px;
|
47
47
|
}
|
48
48
|
@media screen and (max-width: 1023px) {
|
49
|
-
.mfui-
|
49
|
+
.mfui-video-block__header {
|
50
50
|
margin-bottom: 16px;
|
51
51
|
}
|
52
52
|
}
|
53
|
-
.mfui-
|
54
|
-
|
53
|
+
.mfui-video-block__description {
|
54
|
+
font-size: 15px;
|
55
|
+
line-height: 24px;
|
56
|
+
font-weight: 400;
|
55
57
|
}
|
56
|
-
.mfui-
|
58
|
+
.mfui-video-block__button {
|
59
|
+
-ms-flex-item-align: start;
|
60
|
+
align-self: flex-start;
|
61
|
+
max-width: 100%;
|
57
62
|
margin-top: 32px;
|
58
|
-
width: 171px;
|
59
63
|
}
|
60
64
|
@media screen and (max-width: 767px) {
|
61
|
-
.mfui-
|
65
|
+
.mfui-video-block__button {
|
62
66
|
-ms-flex-item-align: center;
|
63
67
|
align-self: center;
|
64
68
|
}
|
65
69
|
}
|
66
|
-
.mfui-
|
70
|
+
.mfui-video-block__video {
|
67
71
|
width: 100%;
|
68
72
|
height: 100%;
|
69
73
|
-o-object-fit: contain;
|
70
74
|
object-fit: contain;
|
71
75
|
}
|
72
|
-
.mfui-
|
76
|
+
.mfui-video-block__video-wrapper {
|
73
77
|
height: 674px;
|
74
78
|
overflow: hidden;
|
75
79
|
}
|
76
80
|
@media screen and (min-width: 1440px) and (max-width: 1599px) {
|
77
|
-
.mfui-
|
81
|
+
.mfui-video-block__video-wrapper {
|
78
82
|
height: 600px;
|
79
83
|
}
|
80
84
|
}
|
81
85
|
@media screen and (min-width: 1280px) and (max-width: 1439px) {
|
82
|
-
.mfui-
|
86
|
+
.mfui-video-block__video-wrapper {
|
83
87
|
height: 524px;
|
84
88
|
}
|
85
89
|
}
|
86
90
|
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
87
|
-
.mfui-
|
91
|
+
.mfui-video-block__video-wrapper {
|
88
92
|
height: 505px;
|
89
93
|
}
|
90
94
|
}
|
91
|
-
.mfui-
|
95
|
+
.mfui-video-block__video-wrapper_with-content {
|
92
96
|
height: 468px;
|
93
97
|
}
|
94
98
|
@media screen and (min-width: 1440px) and (max-width: 1599px) {
|
95
|
-
.mfui-
|
99
|
+
.mfui-video-block__video-wrapper_with-content {
|
96
100
|
height: 415px;
|
97
101
|
}
|
98
102
|
}
|
99
103
|
@media screen and (min-width: 1280px) and (max-width: 1439px) {
|
100
|
-
.mfui-
|
104
|
+
.mfui-video-block__video-wrapper_with-content {
|
101
105
|
height: 363px;
|
102
106
|
}
|
103
107
|
}
|
104
108
|
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
105
|
-
.mfui-
|
109
|
+
.mfui-video-block__video-wrapper_with-content {
|
106
110
|
height: 328px;
|
107
111
|
}
|
108
112
|
}
|
109
113
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
110
|
-
.mfui-
|
111
|
-
.mfui-
|
114
|
+
.mfui-video-block__video-wrapper,
|
115
|
+
.mfui-video-block__video-wrapper_with-content {
|
112
116
|
height: 379px;
|
113
117
|
}
|
114
118
|
}
|
115
119
|
@media screen and (max-width: 767px) {
|
116
|
-
.mfui-
|
117
|
-
.mfui-
|
120
|
+
.mfui-video-block__video-wrapper,
|
121
|
+
.mfui-video-block__video-wrapper_with-content {
|
118
122
|
height: 162px;
|
119
123
|
}
|
120
124
|
}
|
121
|
-
.mfui-
|
125
|
+
.mfui-video-block__grid {
|
122
126
|
width: 100%;
|
123
127
|
}
|
@@ -1,12 +1,14 @@
|
|
1
|
-
import
|
1
|
+
import React, { Ref } from 'react';
|
2
2
|
import './VideoBlock.less';
|
3
3
|
export interface IContent {
|
4
4
|
/** Заголовок */
|
5
5
|
title: string;
|
6
6
|
/** Текст-описание */
|
7
|
-
description: string[];
|
7
|
+
description: string | React.ReactNode[] | React.ReactNode;
|
8
8
|
/** Текст кнопки */
|
9
9
|
buttonTitle: string;
|
10
|
+
/** Добавляет атрибут download для тега <a> компонента Button */
|
11
|
+
buttonDownload?: boolean;
|
10
12
|
/** Ссылка на кнопке */
|
11
13
|
href?: string;
|
12
14
|
/** Обработчик клика по кнопке */
|
@@ -17,7 +19,21 @@ export declare const VideoTypes: {
|
|
17
19
|
readonly VIDEO: "video";
|
18
20
|
};
|
19
21
|
declare type VideoType = typeof VideoTypes[keyof typeof VideoTypes];
|
20
|
-
export interface
|
22
|
+
export interface IVideoBlockProps {
|
23
|
+
/** Дата атрибуты для корневого элемента */
|
24
|
+
dataAttrs?: {
|
25
|
+
[key: string]: string;
|
26
|
+
};
|
27
|
+
/** Дополнительный класс корневого элемента */
|
28
|
+
className?: string;
|
29
|
+
/** Дополнительные классы для корневого и внутренних элементов */
|
30
|
+
classes?: {
|
31
|
+
root?: string;
|
32
|
+
button?: string;
|
33
|
+
description?: string;
|
34
|
+
};
|
35
|
+
/** Ссылка на корневой элемент */
|
36
|
+
rootRef?: Ref<HTMLDivElement>;
|
21
37
|
/** Данные для блока с контентом */
|
22
38
|
content?: IContent;
|
23
39
|
/** Тип видео */
|
@@ -28,8 +44,6 @@ export interface Props {
|
|
28
44
|
isMuted?: boolean;
|
29
45
|
/** Автоматическое проигрывание видео */
|
30
46
|
isAutoplay?: boolean;
|
31
|
-
/** Дополнительный класс корневого элемента */
|
32
|
-
className?: string;
|
33
47
|
}
|
34
|
-
declare const VideoBlock: React.FC<
|
48
|
+
declare const VideoBlock: React.FC<IVideoBlockProps>;
|
35
49
|
export default VideoBlock;
|