@megafon/ui-shared 5.17.0 → 6.0.0-beta.2
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/dist/es/components/AccordionBox/AccordionBox.css +1 -15
- package/dist/es/components/AccordionBox/AccordionBox.d.ts +2 -2
- package/dist/es/components/AccordionBox/AccordionBox.js +6 -49
- package/dist/es/components/AudioPlayer/AudioPlayer.d.ts +2 -2
- package/dist/es/components/AudioPlayer/AudioPlayer.js +11 -27
- package/dist/es/components/AudioPlayer/AudioProgress.d.ts +1 -1
- package/dist/es/components/AudioPlayer/AudioProgress.js +10 -22
- package/dist/es/components/AudioPlayer/AudioRange.d.ts +1 -1
- package/dist/es/components/AudioPlayer/AudioRange.js +8 -10
- package/dist/es/components/AudioPlayer/AudioVolume.d.ts +1 -1
- package/dist/es/components/AudioPlayer/AudioVolume.js +3 -12
- package/dist/es/components/AudioPlayer/hooks/useTrackDuration.js +4 -10
- package/dist/es/components/AudioPlayer/timerFormatUtil.js +1 -9
- package/dist/es/components/BannerBox/BannerBox.d.ts +1 -1
- package/dist/es/components/BannerBox/BannerBox.js +3 -12
- package/dist/es/components/BenefitsIcons/BenefitsIcons.d.ts +1 -1
- package/dist/es/components/BenefitsIcons/BenefitsIcons.js +23 -64
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.d.ts +1 -1
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.js +9 -36
- package/dist/es/components/BenefitsIcons/helpers.d.ts +3 -3
- package/dist/es/components/BenefitsIcons/helpers.js +6 -20
- package/dist/es/components/BenefitsIcons/types.d.ts +5 -5
- package/dist/es/components/BenefitsPictures/BenefitsPictures.d.ts +1 -1
- package/dist/es/components/BenefitsPictures/BenefitsPictures.js +19 -49
- package/dist/es/components/BenefitsPictures/BenfitsPictures.css +1 -43
- package/dist/es/components/BenefitsPictures/helpers.d.ts +2 -2
- package/dist/es/components/BenefitsPictures/helpers.js +0 -14
- package/dist/es/components/BenefitsPictures/types.d.ts +3 -3
- package/dist/es/components/BenefitsPictures/types.js +1 -0
- package/dist/es/components/Breadcrumbs/Breadcrumbs.css +1 -43
- package/dist/es/components/Breadcrumbs/Breadcrumbs.d.ts +6 -6
- package/dist/es/components/Breadcrumbs/Breadcrumbs.js +10 -39
- package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.d.ts +4 -4
- package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.js +11 -36
- package/dist/es/components/ButtonBanner/ButtonBanner.css +1 -122
- package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +7 -7
- package/dist/es/components/ButtonBanner/ButtonBanner.js +22 -53
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.css +1 -19
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.d.ts +3 -3
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +20 -51
- package/dist/es/components/Card/Card.d.ts +4 -4
- package/dist/es/components/Card/Card.js +25 -115
- package/dist/es/components/Card/types.d.ts +10 -10
- package/dist/es/components/Card/types.js +1 -0
- package/dist/es/components/CardsBox/CardsBox.js +3 -14
- package/dist/es/components/CardsBox/helpers.d.ts +2 -2
- package/dist/es/components/CardsBox/helpers.js +0 -4
- package/dist/es/components/CarouselBox/CarouselBox.d.ts +2 -2
- package/dist/es/components/CarouselBox/CarouselBox.js +11 -24
- package/dist/es/components/Container/Container.d.ts +7 -5
- package/dist/es/components/Container/Container.js +10 -25
- package/dist/es/components/DownloadLinks/DownloadLink.d.ts +1 -1
- package/dist/es/components/DownloadLinks/DownloadLink.js +13 -44
- package/dist/es/components/DownloadLinks/DownloadLinks.d.ts +3 -3
- package/dist/es/components/DownloadLinks/DownloadLinks.js +2 -13
- package/dist/es/components/FaqWrapper/FaqWrapper.d.ts +5 -2
- package/dist/es/components/FaqWrapper/FaqWrapper.js +1 -3
- package/dist/es/components/ImageBanner/ImageBanner.d.ts +8 -7
- package/dist/es/components/ImageBanner/ImageBanner.js +37 -88
- package/dist/es/components/Instructions/Instructions.d.ts +11 -11
- package/dist/es/components/Instructions/Instructions.js +41 -94
- package/dist/es/components/NotificationBox/NotificationBox.d.ts +4 -4
- package/dist/es/components/NotificationBox/NotificationBox.js +5 -19
- package/dist/es/components/PageTitle/PageTitle.d.ts +2 -2
- package/dist/es/components/PageTitle/PageTitle.js +12 -37
- package/dist/es/components/Partners/Partners.d.ts +2 -2
- package/dist/es/components/Partners/Partners.js +17 -48
- package/dist/es/components/PictureWithDescription/PictureWithDescription.d.ts +4 -2
- package/dist/es/components/PictureWithDescription/PictureWithDescription.js +10 -28
- package/dist/es/components/Property/Property.d.ts +4 -4
- package/dist/es/components/Property/Property.js +37 -81
- package/dist/es/components/Property/PropertyDescription.d.ts +3 -3
- package/dist/es/components/Property/PropertyDescription.js +8 -28
- package/dist/es/components/Property/types.d.ts +7 -5
- package/dist/es/components/Property/types.js +1 -0
- package/dist/es/components/Steps/Steps.d.ts +2 -1
- package/dist/es/components/Steps/Steps.js +4 -19
- package/dist/es/components/Steps/StepsItem.d.ts +2 -2
- package/dist/es/components/Steps/StepsItem.js +2 -9
- package/dist/es/components/StoreBanner/StoreBanner.d.ts +5 -5
- package/dist/es/components/StoreBanner/StoreBanner.js +41 -97
- package/dist/es/components/StoreButton/StoreButton.d.ts +3 -3
- package/dist/es/components/StoreButton/StoreButton.js +13 -44
- package/dist/es/components/Table/Table.d.ts +1 -1
- package/dist/es/components/Table/Table.js +31 -51
- package/dist/es/components/Table/TableCell.js +0 -6
- package/dist/es/components/Table/TableRow.js +1 -10
- package/dist/es/components/TabsBox/TabsBox.d.ts +1 -1
- package/dist/es/components/TabsBox/TabsBox.js +4 -13
- package/dist/es/components/TextBox/TextBox.d.ts +2 -1
- package/dist/es/components/TextBox/TextBox.js +8 -23
- package/dist/es/components/TextBox/TextBoxPicture.d.ts +2 -2
- package/dist/es/components/TextBox/TextBoxPicture.js +5 -14
- package/dist/es/components/TextWithIcon/TextWithIcon.d.ts +1 -1
- package/dist/es/components/TextWithIcon/TextWithIcon.js +6 -24
- package/dist/es/components/TextWithIcon/TextWithIconItem.d.ts +1 -1
- package/dist/es/components/TextWithIcon/TextWithIconItem.js +6 -21
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +1 -1
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.js +6 -23
- package/dist/es/components/VideoBanner/VideoBanner.d.ts +7 -7
- package/dist/es/components/VideoBanner/VideoBanner.js +47 -110
- package/dist/es/components/VideoBlock/VideoBlock.d.ts +4 -4
- package/dist/es/components/VideoBlock/VideoBlock.js +35 -75
- package/dist/es/helpers/getColumnConfig.d.ts +5 -1
- package/dist/lib/components/AccordionBox/AccordionBox.css +1 -15
- package/dist/lib/components/AccordionBox/AccordionBox.d.ts +2 -2
- package/dist/lib/components/AccordionBox/AccordionBox.js +10 -66
- package/dist/lib/components/AudioPlayer/AudioPlayer.d.ts +2 -2
- package/dist/lib/components/AudioPlayer/AudioPlayer.js +32 -56
- package/dist/lib/components/AudioPlayer/AudioProgress.d.ts +1 -1
- package/dist/lib/components/AudioPlayer/AudioProgress.js +12 -43
- package/dist/lib/components/AudioPlayer/AudioRange.d.ts +1 -1
- package/dist/lib/components/AudioPlayer/AudioRange.js +9 -17
- package/dist/lib/components/AudioPlayer/AudioVolume.d.ts +1 -1
- package/dist/lib/components/AudioPlayer/AudioVolume.js +4 -23
- package/dist/lib/components/AudioPlayer/hooks/useTrackDuration.js +5 -16
- package/dist/lib/components/AudioPlayer/timerFormatUtil.js +2 -13
- package/dist/lib/components/BannerBox/BannerBox.d.ts +1 -1
- package/dist/lib/components/BannerBox/BannerBox.js +7 -25
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.d.ts +1 -1
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +26 -86
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.d.ts +1 -1
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.js +13 -53
- package/dist/lib/components/BenefitsIcons/helpers.d.ts +3 -3
- package/dist/lib/components/BenefitsIcons/helpers.js +10 -37
- package/dist/lib/components/BenefitsIcons/types.d.ts +5 -5
- package/dist/lib/components/BenefitsIcons/types.js +5 -8
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.d.ts +1 -1
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.js +24 -71
- package/dist/lib/components/BenefitsPictures/BenfitsPictures.css +1 -43
- package/dist/lib/components/BenefitsPictures/helpers.d.ts +2 -2
- package/dist/lib/components/BenefitsPictures/helpers.js +9 -40
- package/dist/lib/components/BenefitsPictures/types.d.ts +3 -3
- package/dist/lib/components/BenefitsPictures/types.js +5 -1
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.css +1 -43
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.d.ts +6 -6
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.js +18 -60
- package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.d.ts +4 -4
- package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.js +22 -55
- package/dist/lib/components/ButtonBanner/ButtonBanner.css +1 -122
- package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +7 -7
- package/dist/lib/components/ButtonBanner/ButtonBanner.js +40 -89
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.css +1 -19
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.d.ts +3 -3
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +29 -72
- package/dist/lib/components/Card/Card.d.ts +4 -4
- package/dist/lib/components/Card/Card.js +67 -164
- package/dist/lib/components/Card/types.d.ts +10 -10
- package/dist/lib/components/Card/types.js +5 -1
- package/dist/lib/components/CardsBox/CardsBox.js +7 -31
- package/dist/lib/components/CardsBox/helpers.d.ts +2 -2
- package/dist/lib/components/CardsBox/helpers.js +1 -8
- package/dist/lib/components/CarouselBox/CarouselBox.d.ts +2 -2
- package/dist/lib/components/CarouselBox/CarouselBox.js +15 -39
- package/dist/lib/components/Container/Container.d.ts +7 -5
- package/dist/lib/components/Container/Container.js +18 -40
- package/dist/lib/components/DownloadLinks/DownloadLink.d.ts +1 -1
- package/dist/lib/components/DownloadLinks/DownloadLink.js +17 -60
- package/dist/lib/components/DownloadLinks/DownloadLinks.d.ts +3 -3
- package/dist/lib/components/DownloadLinks/DownloadLinks.js +8 -33
- package/dist/lib/components/FaqWrapper/FaqWrapper.d.ts +5 -2
- package/dist/lib/components/FaqWrapper/FaqWrapper.js +6 -9
- package/dist/lib/components/ImageBanner/ImageBanner.d.ts +8 -7
- package/dist/lib/components/ImageBanner/ImageBanner.js +61 -138
- package/dist/lib/components/Instructions/Instructions.d.ts +11 -11
- package/dist/lib/components/Instructions/Instructions.js +103 -186
- package/dist/lib/components/NotificationBox/NotificationBox.d.ts +4 -4
- package/dist/lib/components/NotificationBox/NotificationBox.js +9 -37
- package/dist/lib/components/PageTitle/PageTitle.d.ts +2 -2
- package/dist/lib/components/PageTitle/PageTitle.js +15 -52
- package/dist/lib/components/Partners/Partners.d.ts +2 -2
- package/dist/lib/components/Partners/Partners.js +21 -65
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.d.ts +4 -2
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.js +16 -46
- package/dist/lib/components/Property/Property.d.ts +4 -4
- package/dist/lib/components/Property/Property.js +60 -120
- package/dist/lib/components/Property/PropertyDescription.d.ts +3 -3
- package/dist/lib/components/Property/PropertyDescription.js +15 -46
- package/dist/lib/components/Property/types.d.ts +7 -5
- package/dist/lib/components/Property/types.js +5 -1
- package/dist/lib/components/Steps/Steps.d.ts +2 -1
- package/dist/lib/components/Steps/Steps.js +8 -35
- package/dist/lib/components/Steps/StepsItem.d.ts +2 -2
- package/dist/lib/components/Steps/StepsItem.js +11 -23
- package/dist/lib/components/StoreBanner/StoreBanner.d.ts +5 -5
- package/dist/lib/components/StoreBanner/StoreBanner.js +47 -118
- package/dist/lib/components/StoreButton/StoreButton.d.ts +3 -3
- package/dist/lib/components/StoreButton/StoreButton.js +17 -63
- package/dist/lib/components/Table/Table.d.ts +1 -1
- package/dist/lib/components/Table/Table.js +35 -68
- package/dist/lib/components/Table/TableCell.js +4 -16
- package/dist/lib/components/Table/TableRow.js +5 -19
- package/dist/lib/components/TabsBox/TabBox.js +1 -4
- package/dist/lib/components/TabsBox/TabsBox.d.ts +1 -1
- package/dist/lib/components/TabsBox/TabsBox.js +8 -26
- package/dist/lib/components/TextBox/TextBox.d.ts +2 -1
- package/dist/lib/components/TextBox/TextBox.js +12 -36
- package/dist/lib/components/TextBox/TextBoxPicture.d.ts +2 -2
- package/dist/lib/components/TextBox/TextBoxPicture.js +11 -29
- package/dist/lib/components/TextWithIcon/TextWithIcon.d.ts +1 -1
- package/dist/lib/components/TextWithIcon/TextWithIcon.js +10 -39
- package/dist/lib/components/TextWithIcon/TextWithIconItem.d.ts +1 -1
- package/dist/lib/components/TextWithIcon/TextWithIconItem.js +10 -37
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +1 -1
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.js +10 -40
- package/dist/lib/components/VideoBanner/VideoBanner.d.ts +7 -7
- package/dist/lib/components/VideoBanner/VideoBanner.js +83 -176
- package/dist/lib/components/VideoBlock/VideoBlock.d.ts +4 -4
- package/dist/lib/components/VideoBlock/VideoBlock.js +58 -114
- package/dist/lib/constants/throttleTime.js +2 -3
- package/dist/lib/helpers/getColumnConfig.d.ts +5 -1
- package/dist/lib/helpers/getColumnConfig.js +2 -5
- package/dist/lib/index.js +10 -57
- package/package.json +87 -92
- package/CHANGELOG.md +0 -4002
- package/dist/es/components/AudioPlayer/style/AudioPlayer.css +0 -58
- package/dist/es/components/AudioPlayer/style/AudioProgress.css +0 -35
- package/dist/es/components/AudioPlayer/style/AudioRange.css +0 -68
- package/dist/es/components/AudioPlayer/style/AudioVolume.css +0 -34
- package/dist/es/components/BenefitsIcons/style/BenefitsIcons.css +0 -38
- package/dist/es/components/BenefitsIcons/style/BenefitsIconsTile.css +0 -90
- package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.css +0 -16
- package/dist/es/components/Card/Card.css +0 -354
- package/dist/es/components/Container/Container.css +0 -3245
- package/dist/es/components/DownloadLinks/DownloadLink.css +0 -37
- package/dist/es/components/DownloadLinks/DownloadLinks.css +0 -36
- package/dist/es/components/ImageBanner/ImageBanner.css +0 -252
- package/dist/es/components/Instructions/Instructions.css +0 -790
- package/dist/es/components/NotificationBox/style/NotificationBox.css +0 -28
- package/dist/es/components/PageTitle/PageTitle.css +0 -80
- package/dist/es/components/Partners/Partners.css +0 -53
- package/dist/es/components/PictureWithDescription/PictureWithDescription.css +0 -80
- package/dist/es/components/Property/Property.css +0 -156
- package/dist/es/components/Property/PropertyDescription.css +0 -17
- package/dist/es/components/Steps/Steps.css +0 -41
- package/dist/es/components/Steps/StepsItem.css +0 -42
- package/dist/es/components/StoreBanner/StoreBanner.css +0 -346
- package/dist/es/components/StoreBanner/doc/img/android-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/StoreButton/StoreButton.css +0 -327
- package/dist/es/components/Table/Table.css +0 -157
- package/dist/es/components/TextBox/TextBox.css +0 -25
- package/dist/es/components/TextBox/TextBoxPicture.css +0 -27
- package/dist/es/components/TextWithIcon/TextWithIcon.css +0 -10
- package/dist/es/components/TextWithIcon/TextWithIconItem.css +0 -29
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.css +0 -31
- package/dist/es/components/VideoBanner/VideoBanner.css +0 -225
- package/dist/es/components/VideoBlock/VideoBlock.css +0 -106
- package/dist/lib/components/AudioPlayer/style/AudioPlayer.css +0 -58
- package/dist/lib/components/AudioPlayer/style/AudioProgress.css +0 -35
- package/dist/lib/components/AudioPlayer/style/AudioRange.css +0 -68
- package/dist/lib/components/AudioPlayer/style/AudioVolume.css +0 -34
- package/dist/lib/components/BenefitsIcons/style/BenefitsIcons.css +0 -38
- package/dist/lib/components/BenefitsIcons/style/BenefitsIconsTile.css +0 -90
- package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.css +0 -16
- package/dist/lib/components/Card/Card.css +0 -354
- package/dist/lib/components/Container/Container.css +0 -3245
- package/dist/lib/components/DownloadLinks/DownloadLink.css +0 -37
- package/dist/lib/components/DownloadLinks/DownloadLinks.css +0 -36
- package/dist/lib/components/ImageBanner/ImageBanner.css +0 -252
- package/dist/lib/components/Instructions/Instructions.css +0 -790
- package/dist/lib/components/NotificationBox/style/NotificationBox.css +0 -28
- package/dist/lib/components/PageTitle/PageTitle.css +0 -80
- package/dist/lib/components/Partners/Partners.css +0 -53
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.css +0 -80
- package/dist/lib/components/Property/Property.css +0 -156
- package/dist/lib/components/Property/PropertyDescription.css +0 -17
- package/dist/lib/components/Steps/Steps.css +0 -41
- package/dist/lib/components/Steps/StepsItem.css +0 -42
- package/dist/lib/components/StoreBanner/StoreBanner.css +0 -346
- package/dist/lib/components/StoreBanner/doc/img/android-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/StoreButton/StoreButton.css +0 -327
- package/dist/lib/components/Table/Table.css +0 -157
- package/dist/lib/components/TextBox/TextBox.css +0 -25
- package/dist/lib/components/TextBox/TextBoxPicture.css +0 -27
- package/dist/lib/components/TextWithIcon/TextWithIcon.css +0 -10
- package/dist/lib/components/TextWithIcon/TextWithIconItem.css +0 -29
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.css +0 -31
- package/dist/lib/components/VideoBanner/VideoBanner.css +0 -225
- package/dist/lib/components/VideoBlock/VideoBlock.css +0 -106
@@ -2,27 +2,23 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import * as React from 'react';
|
3
3
|
import { Header, Grid, GridColumn } from '@megafon/ui-core';
|
4
4
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
5
|
-
import * as PropTypes from 'prop-types';
|
6
5
|
import "./TextWithIcon.css";
|
7
6
|
var testIdPrefix = 'TextWithIcon';
|
8
7
|
var cn = cnCreate('mfui-text-with-icon');
|
9
|
-
|
10
8
|
var TextWithIcon = function TextWithIcon(_ref) {
|
11
9
|
var title = _ref.title,
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
10
|
+
rootRef = _ref.rootRef,
|
11
|
+
dataAttrs = _ref.dataAttrs,
|
12
|
+
className = _ref.className,
|
13
|
+
_ref$isFullWidth = _ref.isFullWidth,
|
14
|
+
isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
|
15
|
+
children = _ref.children;
|
19
16
|
var renderContent = function renderContent() {
|
20
17
|
return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement(Header, {
|
21
18
|
className: cn('header'),
|
22
19
|
as: "h5"
|
23
20
|
}, title), children);
|
24
21
|
};
|
25
|
-
|
26
22
|
var renderContentWithGrid = function renderContentWithGrid() {
|
27
23
|
return /*#__PURE__*/React.createElement(Grid, {
|
28
24
|
dataAttrs: {
|
@@ -37,23 +33,9 @@ var TextWithIcon = function TextWithIcon(_ref) {
|
|
37
33
|
wide: '6'
|
38
34
|
}, renderContent()));
|
39
35
|
};
|
40
|
-
|
41
36
|
return /*#__PURE__*/React.createElement("div", _extends({
|
42
37
|
className: cn([className]),
|
43
38
|
ref: rootRef
|
44
39
|
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), isFullWidth ? renderContent() : renderContentWithGrid());
|
45
40
|
};
|
46
|
-
|
47
|
-
TextWithIcon.propTypes = {
|
48
|
-
title: PropTypes.string,
|
49
|
-
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
50
|
-
current: PropTypes.elementType
|
51
|
-
}), PropTypes.any])]),
|
52
|
-
dataAttrs: PropTypes.shape({
|
53
|
-
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
54
|
-
}),
|
55
|
-
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element.isRequired]).isRequired,
|
56
|
-
isFullWidth: PropTypes.bool,
|
57
|
-
className: PropTypes.string
|
58
|
-
};
|
59
41
|
export default TextWithIcon;
|
@@ -3,26 +3,23 @@ import "core-js/modules/es.array.is-array.js";
|
|
3
3
|
import "core-js/modules/es.array.map.js";
|
4
4
|
import * as React from 'react';
|
5
5
|
import { cnCreate, convert, filterDataAttrs, textConvertConfig } from '@megafon/ui-helpers';
|
6
|
-
import * as PropTypes from 'prop-types';
|
7
6
|
import "./TextWithIconItem.css";
|
8
7
|
var testIdPrefix = 'TextWithIconItem';
|
9
8
|
var cn = cnCreate('mfui-text-with-icon-item');
|
10
|
-
|
11
9
|
var TextWithIconItem = function TextWithIconItem(_ref) {
|
12
10
|
var className = _ref.className,
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
11
|
+
_ref$classes = _ref.classes,
|
12
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
13
|
+
text = _ref.text,
|
14
|
+
icon = _ref.icon,
|
15
|
+
rootRef = _ref.rootRef,
|
16
|
+
dataAttrs = _ref.dataAttrs;
|
19
17
|
var renderText = React.useMemo(function () {
|
20
18
|
if (Array.isArray(text)) {
|
21
19
|
return text.map(function (item) {
|
22
20
|
return convert(item, textConvertConfig);
|
23
21
|
});
|
24
22
|
}
|
25
|
-
|
26
23
|
return convert(text, textConvertConfig);
|
27
24
|
}, [text]);
|
28
25
|
return /*#__PURE__*/React.createElement("div", _extends({
|
@@ -36,16 +33,4 @@ var TextWithIconItem = function TextWithIconItem(_ref) {
|
|
36
33
|
"data-testid": "".concat(testIdPrefix, "-text")
|
37
34
|
}, renderText));
|
38
35
|
};
|
39
|
-
|
40
|
-
TextWithIconItem.propTypes = {
|
41
|
-
text: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.arrayOf(PropTypes.string.isRequired)]).isRequired,
|
42
|
-
icon: PropTypes.node.isRequired,
|
43
|
-
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
44
|
-
current: PropTypes.elementType
|
45
|
-
}), PropTypes.any])]),
|
46
|
-
dataAttrs: PropTypes.shape({
|
47
|
-
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
48
|
-
}),
|
49
|
-
className: PropTypes.string
|
50
|
-
};
|
51
36
|
export default TextWithIconItem;
|
@@ -4,19 +4,17 @@ import "core-js/modules/es.symbol.description.js";
|
|
4
4
|
import * as React from 'react';
|
5
5
|
import { Header, Paragraph, Grid, GridColumn } from '@megafon/ui-core';
|
6
6
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
7
|
-
import * as PropTypes from 'prop-types';
|
8
7
|
import "./TitleDescriptionBox.css";
|
9
8
|
var testIdPrefix = 'TitleDescriptionBox';
|
10
9
|
var cn = cnCreate('mfui-title-description-box');
|
11
|
-
|
12
10
|
var TitleDescriptionBox = function TitleDescriptionBox(_ref) {
|
13
11
|
var dataAttrs = _ref.dataAttrs,
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
title = _ref.title,
|
13
|
+
description = _ref.description,
|
14
|
+
textColor = _ref.textColor,
|
15
|
+
align = _ref.align,
|
16
|
+
rootRef = _ref.rootRef,
|
17
|
+
className = _ref.className;
|
20
18
|
var renderDescription = React.useCallback(function () {
|
21
19
|
if (typeof description === 'string') {
|
22
20
|
return /*#__PURE__*/React.createElement(Paragraph, {
|
@@ -30,7 +28,6 @@ var TitleDescriptionBox = function TitleDescriptionBox(_ref) {
|
|
30
28
|
}
|
31
29
|
}, description);
|
32
30
|
}
|
33
|
-
|
34
31
|
return /*#__PURE__*/React.createElement("div", {
|
35
32
|
className: cn('description'),
|
36
33
|
"data-testid": "".concat(testIdPrefix, "-description-node")
|
@@ -60,18 +57,4 @@ var TitleDescriptionBox = function TitleDescriptionBox(_ref) {
|
|
60
57
|
color: "inherit"
|
61
58
|
}, title), description && renderDescription())));
|
62
59
|
};
|
63
|
-
|
64
|
-
TitleDescriptionBox.propTypes = {
|
65
|
-
dataAttrs: PropTypes.shape({
|
66
|
-
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
67
|
-
}),
|
68
|
-
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
69
|
-
current: PropTypes.elementType
|
70
|
-
}), PropTypes.any])]),
|
71
|
-
className: PropTypes.string,
|
72
|
-
title: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.node)]),
|
73
|
-
description: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.node)]),
|
74
|
-
align: PropTypes.oneOf(['center']),
|
75
|
-
textColor: PropTypes.oneOf(['white'])
|
76
|
-
};
|
77
60
|
export default TitleDescriptionBox;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import
|
1
|
+
import * as React from 'react';
|
2
2
|
import { Props as BreadcrumbsPropsType } from '../Breadcrumbs/Breadcrumbs';
|
3
|
-
import './VideoBanner.
|
4
|
-
export
|
3
|
+
import './VideoBanner.scss';
|
4
|
+
export type BreadCrumbsItemsType = BreadcrumbsPropsType['items'];
|
5
5
|
export declare const testIdPrefix = "VideoBanner";
|
6
6
|
export declare enum ClassName {
|
7
7
|
BUTTON = "button",
|
@@ -11,17 +11,17 @@ export declare const VideoType: {
|
|
11
11
|
readonly YOUTUBE: "youtube";
|
12
12
|
readonly VIDEO: "video";
|
13
13
|
};
|
14
|
-
|
14
|
+
type VideoType = (typeof VideoType)[keyof typeof VideoType];
|
15
15
|
export declare const ButtonColor: {
|
16
16
|
readonly GREEN: "green";
|
17
17
|
readonly PURPLE: "purple";
|
18
18
|
};
|
19
|
-
export
|
19
|
+
export type ButtonColorType = (typeof ButtonColor)[keyof typeof ButtonColor];
|
20
20
|
export declare const TextColor: {
|
21
21
|
readonly BLACK: "black";
|
22
22
|
readonly WHITE: "white";
|
23
23
|
};
|
24
|
-
|
24
|
+
type TextColorType = (typeof TextColor)[keyof typeof TextColor];
|
25
25
|
export interface IContent {
|
26
26
|
/** Заголовок */
|
27
27
|
title: string;
|
@@ -80,7 +80,7 @@ export interface IVideoBannerProps {
|
|
80
80
|
video?: string;
|
81
81
|
};
|
82
82
|
/** Ссылка на корневой элемент */
|
83
|
-
rootRef?: Ref<HTMLDivElement>;
|
83
|
+
rootRef?: React.Ref<HTMLDivElement>;
|
84
84
|
/** Данные для блока с контентом */
|
85
85
|
content?: IContent;
|
86
86
|
/** Источник видео. */
|
@@ -2,26 +2,22 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
3
|
import "core-js/modules/es.symbol.js";
|
4
4
|
import "core-js/modules/es.symbol.description.js";
|
5
|
-
import "core-js/modules/es.string.link.js";
|
6
5
|
import "core-js/modules/es.array.concat.js";
|
7
|
-
import "core-js/modules/es.
|
8
|
-
import React from 'react';
|
6
|
+
import "core-js/modules/es.string.link.js";
|
7
|
+
import * as React from 'react';
|
9
8
|
import { Button, Header, ContentArea, TextLink, Grid, GridColumn } from '@megafon/ui-core';
|
10
9
|
import { breakpoints, cnCreate, filterDataAttrs, convert, titleConvertConfig } from '@megafon/ui-helpers';
|
11
10
|
import throttle from 'lodash.throttle';
|
12
|
-
import * as PropTypes from 'prop-types';
|
13
11
|
import throttleTime from "../../constants/throttleTime";
|
14
12
|
import Breadcrumbs from "../Breadcrumbs/Breadcrumbs";
|
15
13
|
import "./VideoBanner.css";
|
16
14
|
export var testIdPrefix = 'VideoBanner';
|
17
15
|
var cn = cnCreate('mfui-video-banner');
|
18
16
|
export var ClassName;
|
19
|
-
|
20
17
|
(function (ClassName) {
|
21
18
|
ClassName["BUTTON"] = "button";
|
22
19
|
ClassName["LINK"] = "link";
|
23
20
|
})(ClassName || (ClassName = {}));
|
24
|
-
|
25
21
|
var typographyConfig = {
|
26
22
|
b: {
|
27
23
|
component: function component(_ref) {
|
@@ -46,61 +42,58 @@ export var TextColor = {
|
|
46
42
|
BLACK: 'black',
|
47
43
|
WHITE: 'white'
|
48
44
|
};
|
49
|
-
|
50
45
|
var VideoBanner = function VideoBanner(_ref2) {
|
51
46
|
var dataAttrs = _ref2.dataAttrs,
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
47
|
+
className = _ref2.className,
|
48
|
+
_ref2$classes = _ref2.classes,
|
49
|
+
classes = _ref2$classes === void 0 ? {} : _ref2$classes,
|
50
|
+
rootRef = _ref2.rootRef,
|
51
|
+
videoSrc = _ref2.videoSrc,
|
52
|
+
videoType = _ref2.videoType,
|
53
|
+
imageMobile = _ref2.imageMobile,
|
54
|
+
imageTablet = _ref2.imageTablet,
|
55
|
+
_ref2$imageDesktop = _ref2.imageDesktop,
|
56
|
+
imageDesktop = _ref2$imageDesktop === void 0 ? '' : _ref2$imageDesktop,
|
57
|
+
_ref2$imageDesktopWid = _ref2.imageDesktopWide,
|
58
|
+
imageDesktopWide = _ref2$imageDesktopWid === void 0 ? '' : _ref2$imageDesktopWid,
|
59
|
+
imageAlt = _ref2.imageAlt,
|
60
|
+
content = _ref2.content,
|
61
|
+
_ref2$isMuted = _ref2.isMuted,
|
62
|
+
isMuted = _ref2$isMuted === void 0 ? true : _ref2$isMuted,
|
63
|
+
breadcrumbs = _ref2.breadcrumbs,
|
64
|
+
_ref2$videoMobile = _ref2.videoMobile,
|
65
|
+
videoMobile = _ref2$videoMobile === void 0 ? false : _ref2$videoMobile,
|
66
|
+
_ref2$hasBreadcrumbsM = _ref2.hasBreadcrumbsMicrodata,
|
67
|
+
hasBreadcrumbsMicrodata = _ref2$hasBreadcrumbsM === void 0 ? false : _ref2$hasBreadcrumbsM,
|
68
|
+
_ref2$bottomShadow = _ref2.bottomShadow,
|
69
|
+
bottomShadow = _ref2$bottomShadow === void 0 ? false : _ref2$bottomShadow;
|
76
70
|
var _React$useState = React.useState(true),
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
71
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
72
|
+
isMobile = _React$useState2[0],
|
73
|
+
setIsMobile = _React$useState2[1];
|
81
74
|
var isVideoData = !!videoSrc && !!videoType;
|
82
75
|
var isRenderVideo = (!isMobile || videoMobile) && isVideoData;
|
83
76
|
var renderContent = React.useCallback(function (_ref3) {
|
84
77
|
var title = _ref3.title,
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
78
|
+
description = _ref3.description,
|
79
|
+
buttonTitle = _ref3.buttonTitle,
|
80
|
+
buttonHref = _ref3.buttonHref,
|
81
|
+
buttonTarget = _ref3.buttonTarget,
|
82
|
+
buttonDownload = _ref3.buttonDownload,
|
83
|
+
_ref3$buttonColor = _ref3.buttonColor,
|
84
|
+
buttonColor = _ref3$buttonColor === void 0 ? ButtonColor.GREEN : _ref3$buttonColor,
|
85
|
+
buttonRel = _ref3.buttonRel,
|
86
|
+
onButtonClick = _ref3.onButtonClick,
|
87
|
+
onLinkClick = _ref3.onLinkClick,
|
88
|
+
_ref3$textColor = _ref3.textColor,
|
89
|
+
textColor = _ref3$textColor === void 0 ? TextColor.BLACK : _ref3$textColor,
|
90
|
+
textColorMobile = _ref3.textColorMobile,
|
91
|
+
linkTitle = _ref3.linkTitle,
|
92
|
+
linkUrl = _ref3.linkUrl,
|
93
|
+
linkTarget = _ref3.linkTarget,
|
94
|
+
linkDownload = _ref3.linkDownload,
|
95
|
+
linkRel = _ref3.linkRel,
|
96
|
+
cost = _ref3.cost;
|
104
97
|
return /*#__PURE__*/React.createElement(Grid, {
|
105
98
|
className: cn('grid'),
|
106
99
|
guttersLeft: "medium"
|
@@ -177,7 +170,6 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
177
170
|
"data-testid": "".concat(testIdPrefix, "-iframe-video")
|
178
171
|
});
|
179
172
|
}
|
180
|
-
|
181
173
|
case VideoType.VIDEO:
|
182
174
|
{
|
183
175
|
return (
|
@@ -195,7 +187,6 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
195
187
|
}))
|
196
188
|
);
|
197
189
|
}
|
198
|
-
|
199
190
|
default:
|
200
191
|
{
|
201
192
|
return null;
|
@@ -206,7 +197,6 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
206
197
|
var resizeHandler = function resizeHandler() {
|
207
198
|
setIsMobile(window.innerWidth < breakpoints.DESKTOP_SMALL_START);
|
208
199
|
};
|
209
|
-
|
210
200
|
var resizeHandlerThrottled = throttle(resizeHandler, throttleTime.resize);
|
211
201
|
resizeHandler();
|
212
202
|
window.addEventListener('resize', resizeHandlerThrottled);
|
@@ -251,57 +241,4 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
251
241
|
alt: imageAlt
|
252
242
|
})))));
|
253
243
|
};
|
254
|
-
|
255
|
-
VideoBanner.propTypes = {
|
256
|
-
dataAttrs: PropTypes.shape({
|
257
|
-
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
258
|
-
breadcrumbs: PropTypes.objectOf(PropTypes.string.isRequired),
|
259
|
-
breadcrumbsLink: PropTypes.objectOf(PropTypes.string.isRequired),
|
260
|
-
button: PropTypes.objectOf(PropTypes.string.isRequired),
|
261
|
-
link: PropTypes.objectOf(PropTypes.string.isRequired)
|
262
|
-
}),
|
263
|
-
className: PropTypes.string,
|
264
|
-
classes: PropTypes.shape({
|
265
|
-
root: PropTypes.string,
|
266
|
-
button: PropTypes.string,
|
267
|
-
link: PropTypes.string,
|
268
|
-
breadcrumbs: PropTypes.string
|
269
|
-
}),
|
270
|
-
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
271
|
-
current: PropTypes.elementType
|
272
|
-
}), PropTypes.any])]),
|
273
|
-
videoSrc: PropTypes.string,
|
274
|
-
videoType: PropTypes.oneOf(Object.values(VideoType)),
|
275
|
-
videoMobile: PropTypes.bool,
|
276
|
-
content: PropTypes.shape({
|
277
|
-
title: PropTypes.string.isRequired,
|
278
|
-
description: PropTypes.string.isRequired,
|
279
|
-
buttonTitle: PropTypes.string,
|
280
|
-
buttonHref: PropTypes.string,
|
281
|
-
buttonDownload: PropTypes.bool,
|
282
|
-
buttonColor: PropTypes.oneOf(Object.values(ButtonColor)),
|
283
|
-
buttonRel: PropTypes.string,
|
284
|
-
onButtonClick: PropTypes.func,
|
285
|
-
onLinkClick: PropTypes.func,
|
286
|
-
textColor: PropTypes.oneOf(Object.values(TextColor)),
|
287
|
-
textColorMobile: PropTypes.oneOf(Object.values(TextColor)),
|
288
|
-
linkTitle: PropTypes.string,
|
289
|
-
linkUrl: PropTypes.string,
|
290
|
-
linkDownload: PropTypes.bool,
|
291
|
-
linkRel: PropTypes.string,
|
292
|
-
cost: PropTypes.string
|
293
|
-
}),
|
294
|
-
isMuted: PropTypes.bool,
|
295
|
-
imageMobile: PropTypes.string.isRequired,
|
296
|
-
imageTablet: PropTypes.string.isRequired,
|
297
|
-
imageDesktop: PropTypes.string,
|
298
|
-
imageDesktopWide: PropTypes.string,
|
299
|
-
imageAlt: PropTypes.string,
|
300
|
-
breadcrumbs: PropTypes.arrayOf(PropTypes.shape({
|
301
|
-
title: PropTypes.string.isRequired,
|
302
|
-
href: PropTypes.string
|
303
|
-
}).isRequired),
|
304
|
-
hasBreadcrumbsMicrodata: PropTypes.bool,
|
305
|
-
bottomShadow: PropTypes.bool
|
306
|
-
};
|
307
244
|
export default VideoBanner;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import
|
2
|
-
import './VideoBlock.
|
1
|
+
import * as React from 'react';
|
2
|
+
import './VideoBlock.scss';
|
3
3
|
export interface IContent {
|
4
4
|
/** Заголовок */
|
5
5
|
title: string;
|
@@ -20,7 +20,7 @@ export declare const VideoTypes: {
|
|
20
20
|
readonly YOUTUBE: "youtube";
|
21
21
|
readonly VIDEO: "video";
|
22
22
|
};
|
23
|
-
|
23
|
+
type VideoType = (typeof VideoTypes)[keyof typeof VideoTypes];
|
24
24
|
export interface IVideoBlockProps {
|
25
25
|
/** Дополнительные data атрибуты к внутренним элементам */
|
26
26
|
dataAttrs?: {
|
@@ -36,7 +36,7 @@ export interface IVideoBlockProps {
|
|
36
36
|
description?: string;
|
37
37
|
};
|
38
38
|
/** Ссылка на корневой элемент */
|
39
|
-
rootRef?: Ref<HTMLDivElement>;
|
39
|
+
rootRef?: React.Ref<HTMLDivElement>;
|
40
40
|
/** Данные для блока с контентом */
|
41
41
|
content?: IContent;
|
42
42
|
/** Тип видео */
|
@@ -1,12 +1,10 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import "core-js/modules/es.array.concat.js";
|
3
2
|
import "core-js/modules/es.symbol.js";
|
4
3
|
import "core-js/modules/es.symbol.description.js";
|
5
|
-
import "core-js/modules/es.
|
6
|
-
import React from 'react';
|
4
|
+
import "core-js/modules/es.array.concat.js";
|
5
|
+
import * as React from 'react';
|
7
6
|
import { Header, Button, Grid, GridColumn } from '@megafon/ui-core';
|
8
7
|
import { cnCreate, filterDataAttrs, convert, titleConvertConfig, textConvertConfig } from '@megafon/ui-helpers';
|
9
|
-
import PropTypes from 'prop-types';
|
10
8
|
import "./VideoBlock.css";
|
11
9
|
export var VideoTypes = {
|
12
10
|
YOUTUBE: 'youtube',
|
@@ -14,28 +12,27 @@ export var VideoTypes = {
|
|
14
12
|
};
|
15
13
|
export var testIdPrefix = 'VideoBlock';
|
16
14
|
var cn = cnCreate('mfui-video-block');
|
17
|
-
|
18
15
|
var VideoBlock = function VideoBlock(_ref) {
|
19
16
|
var dataAttrs = _ref.dataAttrs,
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
17
|
+
className = _ref.className,
|
18
|
+
_ref$classes = _ref.classes,
|
19
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
20
|
+
rootRef = _ref.rootRef,
|
21
|
+
content = _ref.content,
|
22
|
+
_ref$videoType = _ref.videoType,
|
23
|
+
videoType = _ref$videoType === void 0 ? 'video' : _ref$videoType,
|
24
|
+
videoSrc = _ref.videoSrc,
|
25
|
+
_ref$isMuted = _ref.isMuted,
|
26
|
+
isMuted = _ref$isMuted === void 0 ? true : _ref$isMuted,
|
27
|
+
_ref$isAutoplay = _ref.isAutoplay,
|
28
|
+
isAutoplay = _ref$isAutoplay === void 0 ? false : _ref$isAutoplay,
|
29
|
+
_ref$contentPositionR = _ref.contentPositionRight,
|
30
|
+
contentPositionRight = _ref$contentPositionR === void 0 ? false : _ref$contentPositionR,
|
31
|
+
poster = _ref.poster,
|
32
|
+
_ref$playsinline = _ref.playsinline,
|
33
|
+
playsinline = _ref$playsinline === void 0 ? false : _ref$playsinline,
|
34
|
+
_ref$fixWhiteVideoBac = _ref.fixWhiteVideoBackground,
|
35
|
+
fixWhiteVideoBackground = _ref$fixWhiteVideoBac === void 0 ? false : _ref$fixWhiteVideoBac;
|
39
36
|
var renderVideo = React.useCallback(function () {
|
40
37
|
switch (videoType) {
|
41
38
|
case VideoTypes.YOUTUBE:
|
@@ -65,7 +62,6 @@ var VideoBlock = function VideoBlock(_ref) {
|
|
65
62
|
"data-testid": "".concat(testIdPrefix, "-iframe-video")
|
66
63
|
}));
|
67
64
|
}
|
68
|
-
|
69
65
|
case VideoTypes.VIDEO:
|
70
66
|
{
|
71
67
|
return (
|
@@ -88,7 +84,6 @@ var VideoBlock = function VideoBlock(_ref) {
|
|
88
84
|
}))
|
89
85
|
);
|
90
86
|
}
|
91
|
-
|
92
87
|
default:
|
93
88
|
{
|
94
89
|
return null;
|
@@ -97,12 +92,12 @@ var VideoBlock = function VideoBlock(_ref) {
|
|
97
92
|
}, [videoType, videoSrc, isAutoplay, isMuted, poster, playsinline, fixWhiteVideoBackground]);
|
98
93
|
var renderContent = React.useCallback(function (_ref2) {
|
99
94
|
var title = _ref2.title,
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
95
|
+
description = _ref2.description,
|
96
|
+
href = _ref2.href,
|
97
|
+
buttonDownload = _ref2.buttonDownload,
|
98
|
+
buttonTitle = _ref2.buttonTitle,
|
99
|
+
buttonRel = _ref2.buttonRel,
|
100
|
+
onButtonClick = _ref2.onButtonClick;
|
106
101
|
return /*#__PURE__*/React.createElement("div", {
|
107
102
|
className: cn('content', {
|
108
103
|
'position-right': contentPositionRight
|
@@ -127,29 +122,27 @@ var VideoBlock = function VideoBlock(_ref) {
|
|
127
122
|
var renderGridColumns = React.useCallback(function () {
|
128
123
|
var columns = [];
|
129
124
|
var columnWidth = content ? '7' : '10';
|
130
|
-
|
131
125
|
if (content) {
|
132
126
|
columns.push( /*#__PURE__*/React.createElement(GridColumn, {
|
133
127
|
all: "5",
|
134
128
|
tablet: "12",
|
135
129
|
mobile: "12",
|
136
|
-
orderTablet: "
|
137
|
-
orderMobile: "
|
130
|
+
orderTablet: "1",
|
131
|
+
orderMobile: "1",
|
132
|
+
orderWide: contentPositionRight ? '1' : '0',
|
133
|
+
orderDesktop: contentPositionRight ? '1' : '0',
|
138
134
|
key: "column-content",
|
139
|
-
className: cn('content-column'
|
140
|
-
'position-right': contentPositionRight
|
141
|
-
})
|
135
|
+
className: cn('content-column')
|
142
136
|
}, renderContent(content)));
|
143
137
|
}
|
144
|
-
|
145
138
|
columns.push( /*#__PURE__*/React.createElement(GridColumn, {
|
146
139
|
all: columnWidth,
|
147
140
|
tablet: "12",
|
148
141
|
mobile: "12",
|
149
142
|
key: "column-video",
|
150
|
-
|
151
|
-
|
152
|
-
|
143
|
+
orderDesktop: contentPositionRight ? '0' : '1',
|
144
|
+
orderWide: contentPositionRight ? '0' : '1',
|
145
|
+
className: cn('video-column')
|
153
146
|
}, renderVideo()));
|
154
147
|
return columns;
|
155
148
|
}, [renderContent, renderVideo, content, contentPositionRight]);
|
@@ -161,37 +154,4 @@ var VideoBlock = function VideoBlock(_ref) {
|
|
161
154
|
className: cn('grid')
|
162
155
|
}, renderGridColumns()));
|
163
156
|
};
|
164
|
-
|
165
|
-
VideoBlock.propTypes = {
|
166
|
-
dataAttrs: PropTypes.shape({
|
167
|
-
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
168
|
-
button: PropTypes.objectOf(PropTypes.string.isRequired)
|
169
|
-
}),
|
170
|
-
className: PropTypes.string,
|
171
|
-
classes: PropTypes.shape({
|
172
|
-
root: PropTypes.string,
|
173
|
-
button: PropTypes.string,
|
174
|
-
description: PropTypes.string
|
175
|
-
}),
|
176
|
-
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
177
|
-
current: PropTypes.elementType
|
178
|
-
}), PropTypes.any])]),
|
179
|
-
content: PropTypes.shape({
|
180
|
-
title: PropTypes.string.isRequired,
|
181
|
-
description: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
|
182
|
-
href: PropTypes.string,
|
183
|
-
buttonTitle: PropTypes.string,
|
184
|
-
buttonDownload: PropTypes.bool,
|
185
|
-
buttonRel: PropTypes.string,
|
186
|
-
onButtonClick: PropTypes.func
|
187
|
-
}),
|
188
|
-
videoType: PropTypes.oneOf(Object.values(VideoTypes)),
|
189
|
-
videoSrc: PropTypes.string.isRequired,
|
190
|
-
isMuted: PropTypes.bool,
|
191
|
-
isAutoplay: PropTypes.bool,
|
192
|
-
poster: PropTypes.string,
|
193
|
-
playsinline: PropTypes.bool,
|
194
|
-
contentPositionRight: PropTypes.bool,
|
195
|
-
fixWhiteVideoBackground: PropTypes.bool
|
196
|
-
};
|
197
157
|
export default VideoBlock;
|
@@ -1,2 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
|
2
|
+
import { GridColumn } from '@megafon/ui-core';
|
3
|
+
type GridColumnPropsType = React.ComponentProps<typeof GridColumn>;
|
4
|
+
type GridColumnConfigType = Partial<Pick<GridColumnPropsType, 'all' | 'wide' | 'desktop' | 'tablet' | 'mobile'>>;
|
5
|
+
export declare const getColumnConfig: (isFullWidth: boolean) => GridColumnConfigType;
|
6
|
+
export {};
|