@megafon/ui-shared 2.0.0-beta.97 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +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
@@ -2,59 +2,141 @@ import "core-js/modules/es.symbol";
|
|
2
2
|
import "core-js/modules/es.symbol.description";
|
3
3
|
import "core-js/modules/es.array.concat";
|
4
4
|
import "core-js/modules/es.object.values";
|
5
|
+
import "core-js/modules/es.string.link";
|
6
|
+
import _extends from "@babel/runtime/helpers/extends";
|
5
7
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
6
|
-
import
|
7
|
-
import
|
8
|
+
import React from 'react';
|
9
|
+
import { Button, Header, ContentArea, TextLink, Grid, GridColumn } from '@megafon/ui-core';
|
10
|
+
import { breakpoints, cnCreate, filterDataAttrs, convert } from '@megafon/ui-helpers';
|
8
11
|
import throttle from 'lodash.throttle';
|
12
|
+
import * as PropTypes from 'prop-types';
|
13
|
+
import throttleTime from "../../constants/throttleTime";
|
14
|
+
import Breadcrumbs from "../Breadcrumbs/Breadcrumbs";
|
9
15
|
import "./VideoBanner.css";
|
10
|
-
|
11
|
-
export var
|
16
|
+
var cn = cnCreate('mfui-video-banner');
|
17
|
+
export var ClassName;
|
18
|
+
|
19
|
+
(function (ClassName) {
|
20
|
+
ClassName["BUTTON"] = "button";
|
21
|
+
ClassName["LINK"] = "link";
|
22
|
+
})(ClassName || (ClassName = {}));
|
23
|
+
|
24
|
+
var typographyConfig = {
|
25
|
+
b: {
|
26
|
+
component: function component(_ref) {
|
27
|
+
var children = _ref.children;
|
28
|
+
return /*#__PURE__*/React.createElement(Header, {
|
29
|
+
className: cn('value'),
|
30
|
+
as: "h3",
|
31
|
+
color: "inherit"
|
32
|
+
}, children);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
};
|
36
|
+
export var VideoType = {
|
12
37
|
YOUTUBE: 'youtube',
|
13
38
|
VIDEO: 'video'
|
14
39
|
};
|
15
|
-
var
|
40
|
+
export var ButtonColor = {
|
41
|
+
GREEN: 'green',
|
42
|
+
PURPLE: 'purple'
|
43
|
+
};
|
44
|
+
export var TextColor = {
|
45
|
+
BLACK: 'black',
|
46
|
+
WHITE: 'white'
|
47
|
+
};
|
16
48
|
|
17
|
-
var VideoBanner = function VideoBanner(
|
18
|
-
var
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
49
|
+
var VideoBanner = function VideoBanner(_ref2) {
|
50
|
+
var dataAttrs = _ref2.dataAttrs,
|
51
|
+
className = _ref2.className,
|
52
|
+
_ref2$classes = _ref2.classes,
|
53
|
+
classes = _ref2$classes === void 0 ? {} : _ref2$classes,
|
54
|
+
rootRef = _ref2.rootRef,
|
55
|
+
videoSrc = _ref2.videoSrc,
|
56
|
+
videoType = _ref2.videoType,
|
57
|
+
imageMobile = _ref2.imageMobile,
|
58
|
+
imageTablet = _ref2.imageTablet,
|
59
|
+
_ref2$imageDesktop = _ref2.imageDesktop,
|
60
|
+
imageDesktop = _ref2$imageDesktop === void 0 ? '' : _ref2$imageDesktop,
|
61
|
+
_ref2$imageDesktopWid = _ref2.imageDesktopWide,
|
62
|
+
imageDesktopWide = _ref2$imageDesktopWid === void 0 ? '' : _ref2$imageDesktopWid,
|
63
|
+
content = _ref2.content,
|
64
|
+
_ref2$isMuted = _ref2.isMuted,
|
65
|
+
isMuted = _ref2$isMuted === void 0 ? true : _ref2$isMuted,
|
66
|
+
breadcrumbs = _ref2.breadcrumbs;
|
24
67
|
|
25
68
|
var _React$useState = React.useState(true),
|
26
69
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
27
70
|
isMobile = _React$useState2[0],
|
28
71
|
setIsMobile = _React$useState2[1];
|
29
72
|
|
30
|
-
var
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
73
|
+
var _React$useState3 = React.useState(imageMobile),
|
74
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
75
|
+
imageSrc = _React$useState4[0],
|
76
|
+
setImageSrc = _React$useState4[1];
|
77
|
+
|
78
|
+
var isVideoData = !!videoSrc && !!videoType;
|
79
|
+
var isRenderVideo = !isMobile && isVideoData;
|
80
|
+
var renderContent = React.useCallback(function (_ref3) {
|
81
|
+
var title = _ref3.title,
|
82
|
+
description = _ref3.description,
|
83
|
+
buttonTitle = _ref3.buttonTitle,
|
84
|
+
buttonHref = _ref3.buttonHref,
|
85
|
+
buttonDownload = _ref3.buttonDownload,
|
86
|
+
_ref3$buttonColor = _ref3.buttonColor,
|
87
|
+
buttonColor = _ref3$buttonColor === void 0 ? ButtonColor.GREEN : _ref3$buttonColor,
|
88
|
+
onButtonClick = _ref3.onButtonClick,
|
89
|
+
onLinkClick = _ref3.onLinkClick,
|
90
|
+
_ref3$textColor = _ref3.textColor,
|
91
|
+
textColor = _ref3$textColor === void 0 ? TextColor.BLACK : _ref3$textColor,
|
92
|
+
textColorMobile = _ref3.textColorMobile,
|
93
|
+
linkTitle = _ref3.linkTitle,
|
94
|
+
linkUrl = _ref3.linkUrl,
|
95
|
+
linkDownload = _ref3.linkDownload,
|
96
|
+
cost = _ref3.cost;
|
97
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
98
|
+
className: cn('grid'),
|
99
|
+
guttersLeft: "medium"
|
100
|
+
}, /*#__PURE__*/React.createElement(GridColumn, {
|
101
|
+
mobile: "12",
|
102
|
+
tablet: "7",
|
103
|
+
desktop: "7",
|
104
|
+
wide: "6"
|
105
|
+
}, /*#__PURE__*/React.createElement("div", {
|
106
|
+
className: cn('content', {
|
107
|
+
'text-color': textColor,
|
108
|
+
'text-color-mobile': textColorMobile
|
109
|
+
})
|
40
110
|
}, /*#__PURE__*/React.createElement(Header, {
|
41
111
|
className: cn('title'),
|
42
|
-
|
43
|
-
|
112
|
+
as: "h1",
|
113
|
+
color: "inherit"
|
44
114
|
}, title), /*#__PURE__*/React.createElement("div", {
|
45
115
|
className: cn('text')
|
46
|
-
}, /*#__PURE__*/React.createElement(
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
116
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
117
|
+
as: "h5",
|
118
|
+
color: "inherit",
|
119
|
+
className: cn('description')
|
120
|
+
}, description), cost && /*#__PURE__*/React.createElement("div", {
|
121
|
+
className: cn('cost')
|
122
|
+
}, convert(cost, typographyConfig))), /*#__PURE__*/React.createElement("div", {
|
123
|
+
className: cn('btns-wrapper')
|
124
|
+
}, buttonTitle && /*#__PURE__*/React.createElement(Button, {
|
125
|
+
className: cn(ClassName.BUTTON, [classes.button]),
|
126
|
+
theme: buttonColor,
|
127
|
+
href: buttonHref,
|
128
|
+
onClick: onButtonClick,
|
129
|
+
download: buttonDownload
|
130
|
+
}, buttonTitle), linkTitle && /*#__PURE__*/React.createElement(TextLink, {
|
131
|
+
className: cn(ClassName.LINK, [classes.link]),
|
132
|
+
href: linkUrl,
|
133
|
+
download: linkDownload,
|
134
|
+
onClick: onLinkClick
|
135
|
+
}, linkTitle)))));
|
136
|
+
}, [classes.button, classes.link]);
|
55
137
|
var renderVideo = React.useCallback(function () {
|
56
138
|
switch (videoType) {
|
57
|
-
case
|
139
|
+
case VideoType.YOUTUBE:
|
58
140
|
{
|
59
141
|
var url = "https://www.youtube.com/embed/".concat(videoSrc, "?");
|
60
142
|
var autoplay = '&autoplay=1';
|
@@ -67,6 +149,7 @@ var VideoBanner = function VideoBanner(_ref) {
|
|
67
149
|
var playlist = "&playlist=".concat(videoSrc);
|
68
150
|
var src = "".concat(url).concat(autoplay).concat(mute).concat(loop).concat(rel).concat(controls).concat(info).concat(policy).concat(playlist);
|
69
151
|
return /*#__PURE__*/React.createElement("iframe", {
|
152
|
+
title: "iframe",
|
70
153
|
className: cn('video'),
|
71
154
|
src: src,
|
72
155
|
width: "100%",
|
@@ -76,17 +159,21 @@ var VideoBanner = function VideoBanner(_ref) {
|
|
76
159
|
});
|
77
160
|
}
|
78
161
|
|
79
|
-
case
|
162
|
+
case VideoType.VIDEO:
|
80
163
|
{
|
81
|
-
return
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
164
|
+
return (
|
165
|
+
/*#__PURE__*/
|
166
|
+
// eslint-disable-next-line jsx-a11y/media-has-caption
|
167
|
+
React.createElement("video", {
|
168
|
+
className: cn('video'),
|
169
|
+
autoPlay: true,
|
170
|
+
loop: true,
|
171
|
+
muted: isMuted
|
172
|
+
}, /*#__PURE__*/React.createElement("source", {
|
173
|
+
src: videoSrc,
|
174
|
+
type: "video/mp4"
|
175
|
+
}))
|
176
|
+
);
|
90
177
|
}
|
91
178
|
|
92
179
|
default:
|
@@ -95,20 +182,28 @@ var VideoBanner = function VideoBanner(_ref) {
|
|
95
182
|
}
|
96
183
|
}
|
97
184
|
}, [videoType, videoSrc, isMuted]);
|
98
|
-
var renderImage = React.useCallback(function (_ref3) {
|
99
|
-
var mobile = _ref3.mobile,
|
100
|
-
desktop = _ref3.desktop;
|
101
|
-
var src = desktop && !isMobile ? desktop : mobile;
|
102
|
-
return /*#__PURE__*/React.createElement("img", {
|
103
|
-
src: src,
|
104
|
-
className: cn('background-image', {
|
105
|
-
'mobile': !desktop
|
106
|
-
})
|
107
|
-
});
|
108
|
-
}, [isMobile]);
|
109
185
|
React.useEffect(function () {
|
186
|
+
var getImageSrc = function getImageSrc() {
|
187
|
+
var windowWidth = window.innerWidth;
|
188
|
+
|
189
|
+
switch (true) {
|
190
|
+
case windowWidth >= breakpoints.DESKTOP_MIDDLE_START:
|
191
|
+
return imageDesktopWide;
|
192
|
+
|
193
|
+
case windowWidth >= breakpoints.DESKTOP_SMALL_START && windowWidth <= breakpoints.DESKTOP_SMALL_END:
|
194
|
+
return imageDesktop;
|
195
|
+
|
196
|
+
case windowWidth >= breakpoints.MOBILE_BIG_START && windowWidth <= breakpoints.MOBILE_BIG_END:
|
197
|
+
return imageTablet;
|
198
|
+
|
199
|
+
default:
|
200
|
+
return imageMobile;
|
201
|
+
}
|
202
|
+
};
|
203
|
+
|
110
204
|
var resizeHandler = function resizeHandler() {
|
111
|
-
|
205
|
+
setIsMobile(window.innerWidth < breakpoints.DESKTOP_SMALL_START);
|
206
|
+
setImageSrc(getImageSrc());
|
112
207
|
};
|
113
208
|
|
114
209
|
var resizeHandlerThrottled = throttle(resizeHandler, throttleTime.resize);
|
@@ -117,28 +212,65 @@ var VideoBanner = function VideoBanner(_ref) {
|
|
117
212
|
return function () {
|
118
213
|
window.removeEventListener('resize', resizeHandlerThrottled);
|
119
214
|
};
|
120
|
-
}, []);
|
121
|
-
return /*#__PURE__*/React.createElement("div", {
|
122
|
-
className: cn()
|
123
|
-
|
215
|
+
}, [imageDesktop, imageDesktopWide, imageMobile, imageTablet]);
|
216
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs), {
|
217
|
+
className: cn([className, classes.root]),
|
218
|
+
ref: rootRef
|
219
|
+
}), /*#__PURE__*/React.createElement(ContentArea, null, /*#__PURE__*/React.createElement("div", {
|
124
220
|
className: cn('wrapper')
|
125
|
-
},
|
221
|
+
}, !!(breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/React.createElement(Breadcrumbs, {
|
222
|
+
className: cn('breadcrumbs'),
|
223
|
+
items: breadcrumbs,
|
224
|
+
color: content === null || content === void 0 ? void 0 : content.textColor,
|
225
|
+
classes: {
|
226
|
+
item: classes.breadcrumbs
|
227
|
+
}
|
228
|
+
}), content && renderContent(content), isRenderVideo && renderVideo(), !isRenderVideo && /*#__PURE__*/React.createElement("div", {
|
229
|
+
style: {
|
230
|
+
backgroundImage: "url(".concat(imageSrc, ")")
|
231
|
+
},
|
232
|
+
className: cn('background-image')
|
233
|
+
}))));
|
126
234
|
};
|
127
235
|
|
128
236
|
VideoBanner.propTypes = {
|
237
|
+
dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
|
238
|
+
className: PropTypes.string,
|
239
|
+
classes: PropTypes.shape({
|
240
|
+
root: PropTypes.string,
|
241
|
+
button: PropTypes.string,
|
242
|
+
link: PropTypes.string,
|
243
|
+
breadcrumbs: PropTypes.string
|
244
|
+
}),
|
245
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
246
|
+
current: PropTypes.elementType
|
247
|
+
}), PropTypes.any])]),
|
129
248
|
videoSrc: PropTypes.string,
|
130
|
-
videoType: PropTypes.oneOf(Object.values(
|
249
|
+
videoType: PropTypes.oneOf(Object.values(VideoType)),
|
131
250
|
content: PropTypes.shape({
|
132
251
|
title: PropTypes.string.isRequired,
|
133
252
|
description: PropTypes.string.isRequired,
|
134
|
-
buttonTitle: PropTypes.string
|
135
|
-
|
136
|
-
|
253
|
+
buttonTitle: PropTypes.string,
|
254
|
+
buttonHref: PropTypes.string,
|
255
|
+
buttonDownload: PropTypes.bool,
|
256
|
+
buttonColor: PropTypes.oneOf(Object.values(ButtonColor)),
|
257
|
+
onButtonClick: PropTypes.func,
|
258
|
+
onLinkClick: PropTypes.func,
|
259
|
+
textColor: PropTypes.oneOf(Object.values(TextColor)),
|
260
|
+
textColorMobile: PropTypes.oneOf(Object.values(TextColor)),
|
261
|
+
linkTitle: PropTypes.string,
|
262
|
+
linkUrl: PropTypes.string,
|
263
|
+
linkDownload: PropTypes.bool,
|
264
|
+
cost: PropTypes.string
|
137
265
|
}),
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
266
|
+
isMuted: PropTypes.bool,
|
267
|
+
imageMobile: PropTypes.string.isRequired,
|
268
|
+
imageTablet: PropTypes.string.isRequired,
|
269
|
+
imageDesktop: PropTypes.string,
|
270
|
+
imageDesktopWide: PropTypes.string,
|
271
|
+
breadcrumbs: PropTypes.arrayOf(PropTypes.shape({
|
272
|
+
title: PropTypes.string.isRequired,
|
273
|
+
href: PropTypes.string
|
274
|
+
}).isRequired)
|
143
275
|
};
|
144
276
|
export default VideoBanner;
|
@@ -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;
|