@megafon/ui-shared 2.0.0-beta.99 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1610 -0
- package/README.md +0 -5
- package/dist/es/components/AccordionBox/AccordionBox.css +13 -0
- package/dist/es/components/AccordionBox/AccordionBox.d.ts +16 -1
- package/dist/es/components/AccordionBox/AccordionBox.js +29 -13
- package/dist/es/components/BannerBox/BannerBox.js +3 -2
- package/dist/es/components/BenefitsIcons/BenefitsIcons.d.ts +13 -2
- package/dist/es/components/BenefitsIcons/BenefitsIcons.js +82 -17
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.d.ts +2 -1
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.js +15 -14
- package/dist/es/components/BenefitsIcons/style/BenefitsIcons.css +3 -3
- package/dist/es/components/BenefitsIcons/style/BenefitsIconsTile.css +19 -12
- package/dist/es/components/BenefitsIcons/types.d.ts +7 -2
- package/dist/es/components/BenefitsIcons/types.js +4 -0
- package/dist/es/components/BenefitsPictures/BenefitsPictures.d.ts +10 -1
- package/dist/es/components/BenefitsPictures/BenefitsPictures.js +28 -12
- package/dist/es/components/BenefitsPictures/BenfitsPictures.css +4 -4
- package/dist/es/components/Breadcrumbs/Breadcrumbs.css +46 -0
- package/dist/es/components/Breadcrumbs/Breadcrumbs.d.ts +21 -0
- package/dist/es/components/Breadcrumbs/Breadcrumbs.js +49 -0
- package/dist/es/components/ButtonBanner/ButtonBanner.css +122 -0
- package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +54 -0
- package/dist/es/components/ButtonBanner/ButtonBanner.js +107 -0
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.css +3 -3
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.d.ts +22 -2
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +37 -8
- package/dist/es/components/Card/Card.css +71 -44
- package/dist/es/components/Card/Card.d.ts +33 -3
- package/dist/es/components/Card/Card.js +103 -42
- package/dist/es/components/CardsBox/CardsBox.d.ts +10 -2
- package/dist/es/components/CardsBox/CardsBox.js +26 -13
- package/dist/es/components/CarouselBox/CarouselBox.js +3 -2
- package/dist/es/components/Container/Container.css +1815 -547
- package/dist/es/components/Container/Container.d.ts +11 -1
- package/dist/es/components/Container/Container.js +28 -6
- package/dist/es/components/DownloadLinks/DownloadLink.css +5 -5
- package/dist/es/components/DownloadLinks/DownloadLink.d.ts +7 -0
- package/dist/es/components/DownloadLinks/DownloadLink.js +28 -6
- package/dist/es/components/DownloadLinks/DownloadLinks.css +9 -6
- package/dist/es/components/DownloadLinks/DownloadLinks.d.ts +2 -0
- package/dist/es/components/DownloadLinks/DownloadLinks.js +18 -3
- package/dist/es/components/Instructions/Instructions.css +189 -130
- package/dist/es/components/Instructions/Instructions.d.ts +21 -2
- package/dist/es/components/Instructions/Instructions.js +115 -74
- package/dist/es/components/Instructions/img/iphone12.png +0 -0
- package/dist/es/components/PageTitle/PageTitle.css +80 -0
- package/dist/es/components/PageTitle/PageTitle.d.ts +23 -0
- package/dist/es/components/PageTitle/PageTitle.js +65 -0
- package/dist/es/components/Partners/Partners.css +22 -31
- package/dist/es/components/Partners/Partners.d.ts +13 -1
- package/dist/es/components/Partners/Partners.js +40 -18
- package/dist/es/components/PictureWithDescription/PictureWithDescription.css +25 -10
- package/dist/es/components/PictureWithDescription/PictureWithDescription.d.ts +13 -0
- package/dist/es/components/PictureWithDescription/PictureWithDescription.js +31 -7
- package/dist/es/components/Property/Property.css +79 -71
- package/dist/es/components/Property/Property.d.ts +21 -2
- package/dist/es/components/Property/Property.js +80 -34
- package/dist/es/components/Property/PropertyDescription.css +3 -3
- package/dist/es/components/Property/PropertyDescription.js +19 -21
- package/dist/es/components/Property/types.d.ts +7 -2
- package/dist/es/components/Steps/Steps.css +41 -0
- package/dist/es/components/Steps/Steps.d.ts +10 -0
- package/dist/es/components/Steps/Steps.js +35 -0
- package/dist/es/components/Steps/StepsItem.css +37 -0
- package/dist/es/components/Steps/StepsItem.d.ts +10 -0
- package/dist/es/components/Steps/StepsItem.js +26 -0
- package/dist/es/components/StoreBanner/StoreBanner.css +289 -0
- package/dist/es/components/StoreBanner/StoreBanner.d.ts +65 -0
- package/dist/es/components/StoreBanner/StoreBanner.js +145 -0
- package/dist/es/components/StoreBanner/doc/img/new-iphone-screen.png +0 -0
- package/dist/es/components/StoreBanner/doc/img/qr-code.png +0 -0
- package/dist/es/components/StoreBanner/doc/img/screen.png +0 -0
- package/dist/es/components/StoreBanner/img/android.png +0 -0
- package/dist/es/components/StoreBanner/img/black-iphone.png +0 -0
- package/dist/es/components/StoreBanner/img/new-iphone.png +0 -0
- package/dist/es/components/StoreBanner/img/white-iphone.png +0 -0
- package/dist/es/components/StoreButton/StoreButton.css +15 -0
- package/dist/es/components/StoreButton/StoreButton.d.ts +17 -0
- package/dist/es/components/StoreButton/StoreButton.js +37 -0
- package/dist/es/components/StoreButton/img/app-store.png +0 -0
- package/dist/es/components/StoreButton/img/google-play.png +0 -0
- package/dist/es/components/StoreButton/img/huawei-store.png +0 -0
- package/dist/es/components/Table/Table.css +67 -67
- package/dist/es/components/Table/Table.js +4 -4
- package/dist/es/components/Table/TableRow.js +1 -0
- package/dist/es/components/TabsBox/TabsBox.d.ts +4 -1
- package/dist/es/components/TabsBox/TabsBox.js +24 -3
- package/dist/es/components/TextBox/TextBox.css +7 -1
- package/dist/es/components/TextBox/TextBox.d.ts +8 -0
- package/dist/es/components/TextBox/TextBox.js +37 -5
- package/dist/es/components/TextBox/TextBoxPicture.css +24 -0
- package/dist/es/components/TextBox/TextBoxPicture.d.ts +17 -0
- package/dist/es/components/TextBox/TextBoxPicture.js +32 -0
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.css +15 -4
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +8 -2
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.js +34 -14
- package/dist/es/components/VideoBanner/VideoBanner.css +155 -76
- package/dist/es/components/VideoBanner/VideoBanner.d.ts +64 -13
- package/dist/es/components/VideoBanner/VideoBanner.js +202 -70
- package/dist/es/components/VideoBlock/VideoBlock.css +32 -28
- package/dist/es/components/VideoBlock/VideoBlock.d.ts +20 -6
- package/dist/es/components/VideoBlock/VideoBlock.js +63 -44
- package/dist/es/constants/throttleTime.d.ts +4 -0
- package/dist/es/constants/throttleTime.js +3 -0
- package/dist/es/index.d.ts +8 -0
- package/dist/es/index.js +8 -0
- package/dist/lib/components/AccordionBox/AccordionBox.css +13 -0
- package/dist/lib/components/AccordionBox/AccordionBox.d.ts +16 -1
- package/dist/lib/components/AccordionBox/AccordionBox.js +31 -19
- package/dist/lib/components/BannerBox/BannerBox.js +3 -5
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.d.ts +13 -2
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +84 -20
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.d.ts +2 -1
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.js +15 -16
- package/dist/lib/components/BenefitsIcons/style/BenefitsIcons.css +3 -3
- package/dist/lib/components/BenefitsIcons/style/BenefitsIconsTile.css +19 -12
- package/dist/lib/components/BenefitsIcons/types.d.ts +7 -2
- package/dist/lib/components/BenefitsIcons/types.js +7 -2
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.d.ts +10 -1
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.js +32 -15
- package/dist/lib/components/BenefitsPictures/BenfitsPictures.css +4 -4
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.css +46 -0
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.d.ts +21 -0
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.js +65 -0
- package/dist/lib/components/ButtonBanner/ButtonBanner.css +122 -0
- package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +54 -0
- package/dist/lib/components/ButtonBanner/ButtonBanner.js +133 -0
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.css +3 -3
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.d.ts +22 -2
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +45 -11
- package/dist/lib/components/Card/Card.css +71 -44
- package/dist/lib/components/Card/Card.d.ts +33 -3
- package/dist/lib/components/Card/Card.js +118 -59
- package/dist/lib/components/CardsBox/CardsBox.d.ts +10 -2
- package/dist/lib/components/CardsBox/CardsBox.js +30 -16
- package/dist/lib/components/CarouselBox/CarouselBox.js +3 -5
- package/dist/lib/components/Container/Container.css +1815 -547
- package/dist/lib/components/Container/Container.d.ts +11 -1
- package/dist/lib/components/Container/Container.js +32 -11
- package/dist/lib/components/DownloadLinks/DownloadLink.css +5 -5
- package/dist/lib/components/DownloadLinks/DownloadLink.d.ts +7 -0
- package/dist/lib/components/DownloadLinks/DownloadLink.js +32 -11
- package/dist/lib/components/DownloadLinks/DownloadLinks.css +9 -6
- package/dist/lib/components/DownloadLinks/DownloadLinks.d.ts +2 -0
- package/dist/lib/components/DownloadLinks/DownloadLinks.js +20 -6
- package/dist/lib/components/Instructions/Instructions.css +189 -130
- package/dist/lib/components/Instructions/Instructions.d.ts +21 -2
- package/dist/lib/components/Instructions/Instructions.js +148 -104
- package/dist/lib/components/Instructions/img/iphone12.png +0 -0
- package/dist/lib/components/PageTitle/PageTitle.css +80 -0
- package/dist/lib/components/PageTitle/PageTitle.d.ts +23 -0
- package/dist/lib/components/PageTitle/PageTitle.js +85 -0
- package/dist/lib/components/Partners/Partners.css +22 -31
- package/dist/lib/components/Partners/Partners.d.ts +13 -1
- package/dist/lib/components/Partners/Partners.js +43 -23
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.css +25 -10
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.d.ts +13 -0
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.js +33 -8
- package/dist/lib/components/Property/Property.css +79 -71
- package/dist/lib/components/Property/Property.d.ts +21 -2
- package/dist/lib/components/Property/Property.js +93 -53
- package/dist/lib/components/Property/PropertyDescription.css +3 -3
- package/dist/lib/components/Property/PropertyDescription.js +21 -25
- package/dist/lib/components/Property/types.d.ts +7 -2
- package/dist/lib/components/Steps/Steps.css +41 -0
- package/dist/lib/components/Steps/Steps.d.ts +10 -0
- package/dist/lib/components/Steps/Steps.js +55 -0
- package/dist/lib/components/Steps/StepsItem.css +37 -0
- package/dist/lib/components/Steps/StepsItem.d.ts +10 -0
- package/dist/lib/components/Steps/StepsItem.js +39 -0
- package/dist/lib/components/StoreBanner/StoreBanner.css +289 -0
- package/dist/lib/components/StoreBanner/StoreBanner.d.ts +65 -0
- package/dist/lib/components/StoreBanner/StoreBanner.js +169 -0
- package/dist/lib/components/StoreBanner/doc/img/new-iphone-screen.png +0 -0
- package/dist/lib/components/StoreBanner/doc/img/qr-code.png +0 -0
- package/dist/lib/components/StoreBanner/doc/img/screen.png +0 -0
- package/dist/lib/components/StoreBanner/img/android.png +0 -0
- package/dist/lib/components/StoreBanner/img/black-iphone.png +0 -0
- package/dist/lib/components/StoreBanner/img/new-iphone.png +0 -0
- package/dist/lib/components/StoreBanner/img/white-iphone.png +0 -0
- package/dist/lib/components/StoreButton/StoreButton.css +15 -0
- package/dist/lib/components/StoreButton/StoreButton.d.ts +17 -0
- package/dist/lib/components/StoreButton/StoreButton.js +58 -0
- package/dist/lib/components/StoreButton/img/app-store.png +0 -0
- package/dist/lib/components/StoreButton/img/google-play.png +0 -0
- package/dist/lib/components/StoreButton/img/huawei-store.png +0 -0
- package/dist/lib/components/Table/Table.css +67 -67
- package/dist/lib/components/Table/Table.js +6 -8
- package/dist/lib/components/Table/TableRow.js +1 -0
- package/dist/lib/components/TabsBox/TabsBox.d.ts +4 -1
- package/dist/lib/components/TabsBox/TabsBox.js +25 -2
- package/dist/lib/components/TextBox/TextBox.css +7 -1
- package/dist/lib/components/TextBox/TextBox.d.ts +8 -0
- package/dist/lib/components/TextBox/TextBox.js +39 -6
- package/dist/lib/components/TextBox/TextBoxPicture.css +24 -0
- package/dist/lib/components/TextBox/TextBoxPicture.d.ts +17 -0
- package/dist/lib/components/TextBox/TextBoxPicture.js +49 -0
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.css +15 -4
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +8 -2
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.js +39 -19
- package/dist/lib/components/VideoBanner/VideoBanner.css +155 -76
- package/dist/lib/components/VideoBanner/VideoBanner.d.ts +64 -13
- package/dist/lib/components/VideoBanner/VideoBanner.js +225 -89
- package/dist/lib/components/VideoBlock/VideoBlock.css +32 -28
- package/dist/lib/components/VideoBlock/VideoBlock.d.ts +20 -6
- package/dist/lib/components/VideoBlock/VideoBlock.js +76 -68
- package/dist/lib/constants/throttleTime.d.ts +4 -0
- package/dist/lib/constants/throttleTime.js +10 -0
- package/dist/lib/index.d.ts +8 -0
- package/dist/lib/index.js +64 -0
- package/package.json +19 -75
@@ -1,11 +1,12 @@
|
|
1
1
|
import "core-js/modules/es.array.map";
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
|
-
import
|
3
|
+
import React from 'react';
|
4
|
+
import { Grid, GridColumn, Header, Paragraph } from '@megafon/ui-core';
|
5
|
+
import { cnCreate } from '@megafon/ui-helpers';
|
6
|
+
import convert from 'htmr';
|
4
7
|
import PropTypes from 'prop-types';
|
5
|
-
import "./Instructions.css";
|
6
|
-
import throttle from 'lodash.throttle';
|
7
8
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
8
|
-
import
|
9
|
+
import "./Instructions.css";
|
9
10
|
export var pictureAlignTypes = {
|
10
11
|
LEFT: 'left',
|
11
12
|
RIGHT: 'right'
|
@@ -16,18 +17,32 @@ export var pictureMaskTypes = {
|
|
16
17
|
BLACK_IPHONE: 'black-iphone',
|
17
18
|
WHITE_IPHONE: 'white-iphone',
|
18
19
|
LAPTOP: 'laptop',
|
20
|
+
IPHONE_12: 'iphone-12',
|
19
21
|
NONE: 'none'
|
20
22
|
};
|
21
|
-
var cn = cnCreate('mfui-
|
23
|
+
var cn = cnCreate('mfui-instructions');
|
22
24
|
var swiperSlideCn = cn('slide');
|
23
25
|
|
24
26
|
var Instructions = function Instructions(_ref) {
|
25
|
-
var
|
27
|
+
var rootRef = _ref.rootRef,
|
28
|
+
_ref$classes = _ref.classes;
|
29
|
+
_ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
|
30
|
+
var instructionItem = _ref$classes.instructionItem,
|
31
|
+
desktopInstructionItem = _ref$classes.desktopInstructionItem,
|
32
|
+
mobileInstructionItem = _ref$classes.mobileInstructionItem,
|
33
|
+
activeInstructionItem = _ref$classes.activeInstructionItem,
|
34
|
+
desktopItemTitle = _ref$classes.desktopItemTitle,
|
35
|
+
mobileItemTitle = _ref$classes.mobileItemTitle,
|
36
|
+
instructionItemImg = _ref$classes.instructionItemImg,
|
37
|
+
additionalText = _ref$classes.additionalText,
|
38
|
+
title = _ref.title,
|
26
39
|
instructionItems = _ref.instructionItems,
|
27
40
|
_ref$pictureAlign = _ref.pictureAlign,
|
28
41
|
pictureAlign = _ref$pictureAlign === void 0 ? 'left' : _ref$pictureAlign,
|
29
42
|
_ref$pictureMask = _ref.pictureMask,
|
30
|
-
pictureMask = _ref$pictureMask === void 0 ? 'none' : _ref$pictureMask
|
43
|
+
pictureMask = _ref$pictureMask === void 0 ? 'none' : _ref$pictureMask,
|
44
|
+
getSwiper = _ref.getSwiper,
|
45
|
+
text = _ref.additionalText;
|
31
46
|
|
32
47
|
var _React$useState = React.useState(),
|
33
48
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
@@ -39,49 +54,30 @@ var Instructions = function Instructions(_ref) {
|
|
39
54
|
slideIndex = _React$useState4[0],
|
40
55
|
setSlideIndex = _React$useState4[1];
|
41
56
|
|
42
|
-
var _React$useState5 = React.useState(false),
|
43
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
44
|
-
isMobile = _React$useState6[0],
|
45
|
-
setIsMobile = _React$useState6[1];
|
46
|
-
|
47
57
|
var getSwiperInstance = React.useCallback(function (swiper) {
|
48
58
|
setSwiperInstance(swiper);
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
59
|
+
getSwiper && getSwiper(swiper);
|
60
|
+
}, [getSwiper]);
|
61
|
+
var getActiveCustomClass = React.useCallback(function (articleIndex, activeIndex) {
|
62
|
+
if (articleIndex !== activeIndex) {
|
63
|
+
return undefined;
|
64
|
+
}
|
65
|
+
|
66
|
+
return activeInstructionItem;
|
67
|
+
}, [activeInstructionItem]);
|
54
68
|
var handleArticleClick = React.useCallback(function (ind) {
|
55
69
|
return function () {
|
56
70
|
setSlideIndex(ind);
|
57
71
|
swiperInstance && swiperInstance.slideTo(ind);
|
58
72
|
};
|
59
73
|
}, [swiperInstance]);
|
60
|
-
var renderTitle = React.useCallback(function (resolution) {
|
61
|
-
return /*#__PURE__*/React.createElement(Header, {
|
62
|
-
className: cn('title', {
|
63
|
-
resolution: resolution
|
64
|
-
}),
|
65
|
-
as: "h2"
|
66
|
-
}, title);
|
67
|
-
}, []);
|
68
|
-
var renderPicture = React.useCallback(function () {
|
69
|
-
if (pictureMask === pictureMaskTypes.NONE) {
|
70
|
-
return renderSlider();
|
71
|
-
}
|
72
|
-
|
73
|
-
return /*#__PURE__*/React.createElement("div", {
|
74
|
-
className: cn('img-wrapper')
|
75
|
-
}, /*#__PURE__*/React.createElement("div", {
|
76
|
-
className: cn('device-screen')
|
77
|
-
}), renderSlider());
|
78
|
-
}, [pictureMask]);
|
79
74
|
var renderVideo = React.useCallback(function (mediaUrl) {
|
80
75
|
return /*#__PURE__*/React.createElement("video", {
|
81
76
|
className: cn('swiper-img'),
|
82
77
|
autoPlay: true,
|
83
78
|
muted: true,
|
84
|
-
loop: true
|
79
|
+
loop: true,
|
80
|
+
playsInline: true
|
85
81
|
}, /*#__PURE__*/React.createElement("source", {
|
86
82
|
src: mediaUrl,
|
87
83
|
type: "video/mp4"
|
@@ -99,69 +95,100 @@ var Instructions = function Instructions(_ref) {
|
|
99
95
|
className: swiperSlideCn,
|
100
96
|
key: ind + mediaUrl
|
101
97
|
}, isVideo ? renderVideo(mediaUrl) : /*#__PURE__*/React.createElement("img", {
|
102
|
-
className: cn('swiper-img'),
|
98
|
+
className: cn('swiper-img', [instructionItemImg]),
|
103
99
|
src: mediaUrl,
|
104
100
|
alt: ""
|
105
101
|
}));
|
106
102
|
}));
|
107
|
-
}, [instructionItems]);
|
103
|
+
}, [getSwiperInstance, instructionItemImg, instructionItems, renderVideo]);
|
104
|
+
var renderTitle = React.useCallback(function (resolution) {
|
105
|
+
return /*#__PURE__*/React.createElement(Header, {
|
106
|
+
className: cn('title', {
|
107
|
+
resolution: resolution
|
108
|
+
}),
|
109
|
+
as: "h2"
|
110
|
+
}, title);
|
111
|
+
}, [title]);
|
112
|
+
var renderText = React.useCallback(function () {
|
113
|
+
return /*#__PURE__*/React.createElement(Paragraph, {
|
114
|
+
className: cn('text', [additionalText]),
|
115
|
+
hasMargin: false
|
116
|
+
}, convert(text));
|
117
|
+
}, [text, additionalText]);
|
118
|
+
var renderPicture = React.useCallback(function () {
|
119
|
+
if (pictureMask === pictureMaskTypes.NONE) {
|
120
|
+
return renderSlider();
|
121
|
+
}
|
122
|
+
|
123
|
+
return /*#__PURE__*/React.createElement("div", {
|
124
|
+
className: cn('img-wrapper')
|
125
|
+
}, /*#__PURE__*/React.createElement("div", {
|
126
|
+
className: cn('device-screen')
|
127
|
+
}), renderSlider());
|
128
|
+
}, [pictureMask, renderSlider]);
|
108
129
|
var renderDesktopArticles = React.useCallback(function () {
|
109
130
|
return /*#__PURE__*/React.createElement("ul", {
|
110
|
-
className: cn('articles-list'
|
131
|
+
className: cn('articles-list', {
|
132
|
+
'text-after': !!text,
|
133
|
+
desktop: true
|
134
|
+
})
|
111
135
|
}, instructionItems.map(function (_ref3, ind) {
|
112
136
|
var itemTitle = _ref3.title;
|
113
|
-
return
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
137
|
+
return (
|
138
|
+
/*#__PURE__*/
|
139
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
140
|
+
React.createElement("li", {
|
141
|
+
className: cn('articles-item', {
|
142
|
+
active: slideIndex === ind
|
143
|
+
}, [getActiveCustomClass(ind, slideIndex), instructionItem, desktopInstructionItem]),
|
144
|
+
"data-index": ind,
|
145
|
+
onClick: handleArticleClick(ind),
|
146
|
+
key: ind
|
147
|
+
}, /*#__PURE__*/React.createElement("div", {
|
148
|
+
className: cn('articles-item-dot')
|
149
|
+
}, /*#__PURE__*/React.createElement("span", {
|
150
|
+
className: cn('articles-item-dot-number')
|
151
|
+
}, ind + 1)), /*#__PURE__*/React.createElement("div", {
|
152
|
+
className: cn('articles-item-title', [desktopItemTitle])
|
153
|
+
}, itemTitle))
|
154
|
+
);
|
127
155
|
}));
|
128
|
-
}, [instructionItems, slideIndex,
|
156
|
+
}, [desktopInstructionItem, desktopItemTitle, getActiveCustomClass, handleArticleClick, instructionItem, instructionItems, slideIndex, text]);
|
129
157
|
var renderMobileArticles = React.useCallback(function () {
|
130
|
-
return /*#__PURE__*/React.createElement(
|
158
|
+
return /*#__PURE__*/React.createElement("div", {
|
159
|
+
className: cn('articles-list', {
|
160
|
+
mobile: true
|
161
|
+
})
|
162
|
+
}, /*#__PURE__*/React.createElement("div", {
|
131
163
|
className: cn('articles-title-block')
|
132
164
|
}, instructionItems.map(function (_ref4, ind) {
|
133
165
|
var itemTitle = _ref4.title;
|
134
|
-
return slideIndex === ind && /*#__PURE__*/React.createElement(
|
135
|
-
className: cn('articles-title'),
|
136
|
-
|
166
|
+
return slideIndex === ind && /*#__PURE__*/React.createElement("div", {
|
167
|
+
className: cn('articles-title', [mobileItemTitle]),
|
168
|
+
"data-index": ind,
|
137
169
|
key: ind
|
138
170
|
}, itemTitle);
|
139
171
|
})), /*#__PURE__*/React.createElement("ul", {
|
140
|
-
className: cn('articles-dots'
|
172
|
+
className: cn('articles-dots', {
|
173
|
+
'text-after': !!text
|
174
|
+
})
|
141
175
|
}, instructionItems.map(function (_item, ind) {
|
142
176
|
return /*#__PURE__*/React.createElement("div", {
|
143
177
|
key: ind,
|
144
178
|
className: cn('articles-dot', {
|
145
179
|
active: slideIndex === ind
|
146
|
-
}),
|
180
|
+
}, [getActiveCustomClass(ind, slideIndex), instructionItem, mobileInstructionItem]),
|
147
181
|
onClick: handleArticleClick(ind)
|
148
182
|
}, /*#__PURE__*/React.createElement("span", {
|
149
183
|
className: cn('articles-dot-number')
|
150
184
|
}, ind + 1));
|
151
185
|
})));
|
152
|
-
}, [instructionItems, slideIndex,
|
153
|
-
React.useEffect(function () {
|
154
|
-
var handleSetThrottled = throttle(handleResize, 100);
|
155
|
-
handleResize();
|
156
|
-
window.addEventListener('resize', handleSetThrottled);
|
157
|
-
return function () {
|
158
|
-
window.removeEventListener('resize', handleSetThrottled);
|
159
|
-
};
|
160
|
-
}, [handleResize]);
|
186
|
+
}, [getActiveCustomClass, handleArticleClick, instructionItem, instructionItems, mobileInstructionItem, mobileItemTitle, slideIndex, text]);
|
161
187
|
return /*#__PURE__*/React.createElement("div", {
|
162
188
|
className: cn({
|
163
189
|
mask: pictureMask
|
164
|
-
})
|
190
|
+
}),
|
191
|
+
ref: rootRef
|
165
192
|
}, /*#__PURE__*/React.createElement(Grid, {
|
166
193
|
hAlign: "center"
|
167
194
|
}, /*#__PURE__*/React.createElement(GridColumn, {
|
@@ -176,17 +203,31 @@ var Instructions = function Instructions(_ref) {
|
|
176
203
|
className: cn('articles', {
|
177
204
|
align: pictureAlign
|
178
205
|
})
|
179
|
-
}, renderTitle('desktop'),
|
206
|
+
}, renderTitle('desktop'), renderMobileArticles(), renderDesktopArticles(), text && renderText())))));
|
180
207
|
};
|
181
208
|
|
182
209
|
Instructions.propTypes = {
|
210
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
211
|
+
current: PropTypes.elementType
|
212
|
+
}), PropTypes.any])]),
|
213
|
+
classes: PropTypes.shape({
|
214
|
+
instructionItem: PropTypes.string,
|
215
|
+
desktopInstructionItem: PropTypes.string,
|
216
|
+
mobileInstructionItem: PropTypes.string,
|
217
|
+
activeInstructionItem: PropTypes.string,
|
218
|
+
desktopItemTitle: PropTypes.string,
|
219
|
+
mobileItemTitle: PropTypes.string,
|
220
|
+
instructionItemImg: PropTypes.string
|
221
|
+
}),
|
183
222
|
title: PropTypes.string.isRequired,
|
223
|
+
additionalText: PropTypes.string,
|
184
224
|
instructionItems: PropTypes.arrayOf(PropTypes.shape({
|
185
|
-
title: PropTypes.string.isRequired,
|
225
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
|
186
226
|
mediaUrl: PropTypes.string.isRequired,
|
187
227
|
isVideo: PropTypes.bool.isRequired
|
188
228
|
}).isRequired).isRequired,
|
189
229
|
pictureAlign: PropTypes.oneOf([pictureAlignTypes.LEFT, pictureAlignTypes.RIGHT]),
|
190
|
-
pictureMask: PropTypes.oneOf([pictureMaskTypes.ANDROID, pictureMaskTypes.NEW_IPHONE, pictureMaskTypes.WHITE_IPHONE, pictureMaskTypes.BLACK_IPHONE, pictureMaskTypes.LAPTOP, pictureMaskTypes.NONE])
|
230
|
+
pictureMask: PropTypes.oneOf([pictureMaskTypes.ANDROID, pictureMaskTypes.NEW_IPHONE, pictureMaskTypes.WHITE_IPHONE, pictureMaskTypes.BLACK_IPHONE, pictureMaskTypes.LAPTOP, pictureMaskTypes.IPHONE_12, pictureMaskTypes.NONE]),
|
231
|
+
getSwiper: PropTypes.func
|
191
232
|
};
|
192
233
|
export default Instructions;
|
Binary file
|
@@ -0,0 +1,80 @@
|
|
1
|
+
h1,
|
2
|
+
h2,
|
3
|
+
h3,
|
4
|
+
h4,
|
5
|
+
h5 {
|
6
|
+
margin: 0;
|
7
|
+
}
|
8
|
+
.mfui-page-title {
|
9
|
+
display: inline-block;
|
10
|
+
width: 100%;
|
11
|
+
}
|
12
|
+
.mfui-page-title__breadcrumbs {
|
13
|
+
margin-top: 32px;
|
14
|
+
}
|
15
|
+
@media screen and (max-width: 767px) {
|
16
|
+
.mfui-page-title__breadcrumbs {
|
17
|
+
display: none;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
.mfui-page-title__title {
|
21
|
+
margin-top: 110px;
|
22
|
+
}
|
23
|
+
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
24
|
+
.mfui-page-title__title {
|
25
|
+
margin-top: 100px;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
29
|
+
.mfui-page-title__title {
|
30
|
+
margin-top: 90px;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
@media screen and (max-width: 767px) {
|
34
|
+
.mfui-page-title__title {
|
35
|
+
margin-top: 45px;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
.mfui-page-title__badge {
|
39
|
+
font-size: 12px;
|
40
|
+
line-height: 16px;
|
41
|
+
display: inline-block;
|
42
|
+
margin-top: 16px;
|
43
|
+
padding: 2px 14px;
|
44
|
+
color: #FFFFFF;
|
45
|
+
font-weight: 500;
|
46
|
+
background-color: #731982;
|
47
|
+
}
|
48
|
+
@media screen and (min-width: 1280px) {
|
49
|
+
.mfui-page-title__badge_under-breadcrumbs {
|
50
|
+
margin-top: 32px;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
54
|
+
.mfui-page-title__badge_under-breadcrumbs {
|
55
|
+
margin-top: 24px;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
59
|
+
.mfui-page-title__badge_under-breadcrumbs {
|
60
|
+
margin-top: 16px;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
@media screen and (min-width: 1280px) {
|
64
|
+
.mfui-page-title__title_under-breadcrumbs {
|
65
|
+
margin-top: 60px;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
69
|
+
.mfui-page-title__title_under-breadcrumbs {
|
70
|
+
margin-top: 50px;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
74
|
+
.mfui-page-title__title_under-breadcrumbs {
|
75
|
+
margin-top: 45px;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
.mfui-page-title__badge + .mfui-page-title__title {
|
79
|
+
margin-top: 8px;
|
80
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import './PageTitle.less';
|
3
|
+
import { Props as BreadcrumbsType } from '../Breadcrumbs/Breadcrumbs';
|
4
|
+
declare type Props = {
|
5
|
+
/** Текст заголовка */
|
6
|
+
title: string | React.ReactNode | React.ReactNode[];
|
7
|
+
/** Хлебные крошки */
|
8
|
+
breadcrumbs?: BreadcrumbsType['items'];
|
9
|
+
/** Текст бейджа */
|
10
|
+
badge?: string;
|
11
|
+
/** Растягивание компонента на всю доступную ширину */
|
12
|
+
isFullWidth?: boolean;
|
13
|
+
/** Класс для корневого элемента */
|
14
|
+
className?: string;
|
15
|
+
/** Дополнительные классы для внутренних элементов */
|
16
|
+
classes?: {
|
17
|
+
breadcrumbs?: string;
|
18
|
+
};
|
19
|
+
/** Ссылка на корневой элемент */
|
20
|
+
rootRef?: React.RefObject<HTMLDivElement>;
|
21
|
+
};
|
22
|
+
declare const PageTitle: React.FC<Props>;
|
23
|
+
export default PageTitle;
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { Header, Grid, GridColumn } from '@megafon/ui-core';
|
3
|
+
import { cnCreate } from '@megafon/ui-helpers';
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
import "./PageTitle.css";
|
6
|
+
import Breadcrumbs from "../Breadcrumbs/Breadcrumbs";
|
7
|
+
var cn = cnCreate('mfui-page-title');
|
8
|
+
|
9
|
+
var PageTitle = function PageTitle(_ref) {
|
10
|
+
var title = _ref.title,
|
11
|
+
breadcrumbs = _ref.breadcrumbs,
|
12
|
+
badge = _ref.badge,
|
13
|
+
_ref$isFullWidth = _ref.isFullWidth,
|
14
|
+
isFullWidth = _ref$isFullWidth === void 0 ? true : _ref$isFullWidth,
|
15
|
+
className = _ref.className,
|
16
|
+
_ref$classes = _ref.classes,
|
17
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
18
|
+
rootRef = _ref.rootRef;
|
19
|
+
var isBreadcrumbs = !!(breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length);
|
20
|
+
var renderPageTitle = React.useCallback(function () {
|
21
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, badge && /*#__PURE__*/React.createElement("div", {
|
22
|
+
className: cn('badge', {
|
23
|
+
'under-breadcrumbs': isBreadcrumbs
|
24
|
+
})
|
25
|
+
}, badge), /*#__PURE__*/React.createElement(Header, {
|
26
|
+
className: cn('title', {
|
27
|
+
'under-breadcrumbs': isBreadcrumbs && !badge
|
28
|
+
}),
|
29
|
+
as: "h1"
|
30
|
+
}, title));
|
31
|
+
}, [badge, title, isBreadcrumbs]);
|
32
|
+
var renderPageTitleWithGrid = React.useCallback(function () {
|
33
|
+
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(GridColumn, {
|
34
|
+
wide: "8",
|
35
|
+
desktop: "10",
|
36
|
+
tablet: "12",
|
37
|
+
mobile: "12"
|
38
|
+
}, renderPageTitle()));
|
39
|
+
}, [renderPageTitle]);
|
40
|
+
return /*#__PURE__*/React.createElement("div", {
|
41
|
+
className: cn([className]),
|
42
|
+
ref: rootRef
|
43
|
+
}, (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/React.createElement(Breadcrumbs, {
|
44
|
+
items: breadcrumbs,
|
45
|
+
className: cn('breadcrumbs', [classes.breadcrumbs])
|
46
|
+
}), isFullWidth ? renderPageTitle() : renderPageTitleWithGrid());
|
47
|
+
};
|
48
|
+
|
49
|
+
PageTitle.propTypes = {
|
50
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
|
51
|
+
breadcrumbs: PropTypes.arrayOf(PropTypes.shape({
|
52
|
+
title: PropTypes.string.isRequired,
|
53
|
+
href: PropTypes.string
|
54
|
+
}).isRequired),
|
55
|
+
badge: PropTypes.string,
|
56
|
+
isFullWidth: PropTypes.bool,
|
57
|
+
className: PropTypes.string,
|
58
|
+
classes: PropTypes.shape({
|
59
|
+
breadcrumbs: PropTypes.string
|
60
|
+
}),
|
61
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
62
|
+
current: PropTypes.elementType
|
63
|
+
}), PropTypes.any])])
|
64
|
+
};
|
65
|
+
export default PageTitle;
|
@@ -5,58 +5,49 @@ h4,
|
|
5
5
|
h5 {
|
6
6
|
margin: 0;
|
7
7
|
}
|
8
|
-
.mfui-
|
8
|
+
.mfui-partners__tile:not(:last-child) {
|
9
9
|
margin-bottom: 20px;
|
10
10
|
}
|
11
11
|
@media screen and (max-width: 767px) {
|
12
|
-
.mfui-
|
12
|
+
.mfui-partners__tile:not(:last-child) {
|
13
13
|
margin-bottom: 16px;
|
14
14
|
}
|
15
15
|
}
|
16
|
-
|
17
|
-
.mfui-beta-partners__slide .mfui-beta-partners__tile {
|
18
|
-
width: 153px;
|
19
|
-
}
|
20
|
-
}
|
21
|
-
@media screen and (max-width: 767px) {
|
22
|
-
.mfui-beta-partners__slide .mfui-beta-partners__tile {
|
23
|
-
width: 120px;
|
24
|
-
}
|
25
|
-
}
|
26
|
-
.mfui-beta-partners__tile-inner {
|
27
|
-
display: -webkit-box;
|
28
|
-
display: -ms-flexbox;
|
29
|
-
display: flex;
|
30
|
-
-webkit-box-align: center;
|
31
|
-
-ms-flex-align: center;
|
32
|
-
align-items: center;
|
33
|
-
-webkit-box-pack: center;
|
34
|
-
-ms-flex-pack: center;
|
35
|
-
justify-content: center;
|
16
|
+
.mfui-partners__tile-inner {
|
36
17
|
-webkit-box-sizing: border-box;
|
37
18
|
box-sizing: border-box;
|
38
|
-
|
19
|
+
height: 132px;
|
39
20
|
padding: 28px 48px;
|
40
21
|
}
|
41
22
|
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
42
|
-
.mfui-
|
43
|
-
|
23
|
+
.mfui-partners__tile-inner {
|
24
|
+
height: 104px;
|
44
25
|
padding: 22px 37px;
|
45
26
|
}
|
46
27
|
}
|
47
28
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
48
|
-
.mfui-
|
49
|
-
|
29
|
+
.mfui-partners__tile-inner {
|
30
|
+
height: 77px;
|
50
31
|
padding: 10px;
|
51
32
|
}
|
52
33
|
}
|
53
34
|
@media screen and (max-width: 767px) {
|
54
|
-
.mfui-
|
55
|
-
|
35
|
+
.mfui-partners__tile-inner {
|
36
|
+
height: 60px;
|
56
37
|
padding: 8px;
|
57
38
|
}
|
58
39
|
}
|
59
|
-
.mfui-
|
40
|
+
.mfui-partners__img-wrapper {
|
41
|
+
position: relative;
|
42
|
+
width: 100%;
|
43
|
+
height: 100%;
|
44
|
+
}
|
45
|
+
.mfui-partners__tile-img {
|
46
|
+
position: absolute;
|
47
|
+
top: 50%;
|
48
|
+
left: 50%;
|
60
49
|
max-width: 100%;
|
61
|
-
|
50
|
+
max-height: 100%;
|
51
|
+
-webkit-transform: translate(-50%, -50%);
|
52
|
+
transform: translate(-50%, -50%);
|
62
53
|
}
|
@@ -3,8 +3,20 @@ import './Partners.less';
|
|
3
3
|
export declare type ItemType = {
|
4
4
|
src: string;
|
5
5
|
href?: string;
|
6
|
+
alt: string;
|
6
7
|
};
|
7
8
|
export interface IPartnersProps {
|
9
|
+
/** Ссылка на корневой элемент */
|
10
|
+
rootRef?: React.Ref<HTMLDivElement>;
|
11
|
+
/** Дополнительные классы для корневого и внутренних элементов */
|
12
|
+
classes?: {
|
13
|
+
root?: string;
|
14
|
+
itemClass?: string;
|
15
|
+
};
|
16
|
+
/** Дата атрибуты для корневого элемента */
|
17
|
+
dataAttrs?: {
|
18
|
+
[key: string]: string;
|
19
|
+
};
|
8
20
|
/** Дополнительный класс корневого элемента */
|
9
21
|
className?: string;
|
10
22
|
/** Список логотипов */
|
@@ -14,7 +26,7 @@ export interface IPartnersProps {
|
|
14
26
|
/** Обработчик клика по стрелке назад (должен быть обернут в useCallback) */
|
15
27
|
onPrevClick?: (index: number) => void;
|
16
28
|
/** Обработчик смены слайда (должен быть обернут в useCallback) */
|
17
|
-
onChange?: (
|
29
|
+
onChange?: (currentIndex: number, previousIndex: number, slidesPerView?: number | 'auto') => void;
|
18
30
|
}
|
19
31
|
declare const Partners: React.FC<IPartnersProps>;
|
20
32
|
export default Partners;
|
@@ -1,28 +1,36 @@
|
|
1
1
|
import "core-js/modules/es.array.map";
|
2
2
|
import "core-js/modules/es.array.slice";
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
4
5
|
|
5
6
|
var _slidesSettings;
|
6
7
|
|
7
8
|
import * as React from 'react';
|
9
|
+
import { Grid, GridColumn, Tile, Carousel } from '@megafon/ui-core';
|
10
|
+
import { breakpoints, cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
8
11
|
import * as PropTypes from 'prop-types';
|
9
|
-
import { cnCreate, Grid, GridColumn, Tile, Carousel, breakpoints } from '@megafon/ui-core';
|
10
12
|
import "./Partners.css";
|
11
13
|
var MAX_GRID_ITEMS_LENGTH = 8;
|
12
|
-
var slidesSettings = (_slidesSettings = {}, _defineProperty(_slidesSettings, breakpoints.
|
13
|
-
slidesPerView:
|
14
|
+
var slidesSettings = (_slidesSettings = {}, _defineProperty(_slidesSettings, breakpoints.MOBILE_SMALL_START, {
|
15
|
+
slidesPerView: 2,
|
14
16
|
spaceBetween: 16
|
15
|
-
}), _defineProperty(_slidesSettings, breakpoints.
|
16
|
-
slidesPerView:
|
17
|
+
}), _defineProperty(_slidesSettings, breakpoints.MOBILE_MIDDLE_START, {
|
18
|
+
slidesPerView: 3,
|
17
19
|
spaceBetween: 20
|
18
|
-
}), _defineProperty(_slidesSettings, breakpoints.
|
20
|
+
}), _defineProperty(_slidesSettings, breakpoints.DESKTOP_SMALL_START, {
|
19
21
|
slidesPerView: 4,
|
20
22
|
spaceBetween: 20
|
21
23
|
}), _slidesSettings);
|
22
|
-
var cn = cnCreate('mfui-
|
24
|
+
var cn = cnCreate('mfui-partners');
|
23
25
|
|
24
26
|
var Partners = function Partners(_ref) {
|
25
|
-
var
|
27
|
+
var rootRef = _ref.rootRef,
|
28
|
+
_ref$classes = _ref.classes;
|
29
|
+
_ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
|
30
|
+
var root = _ref$classes.root,
|
31
|
+
itemClass = _ref$classes.itemClass,
|
32
|
+
dataAttrs = _ref.dataAttrs,
|
33
|
+
className = _ref.className,
|
26
34
|
items = _ref.items,
|
27
35
|
onChange = _ref.onChange,
|
28
36
|
onNextClick = _ref.onNextClick,
|
@@ -33,19 +41,23 @@ var Partners = function Partners(_ref) {
|
|
33
41
|
}
|
34
42
|
|
35
43
|
var src = item.src,
|
36
|
-
href = item.href
|
44
|
+
href = item.href,
|
45
|
+
alt = item.alt;
|
37
46
|
return /*#__PURE__*/React.createElement(Tile, {
|
38
47
|
className: cn('tile'),
|
39
48
|
href: href,
|
40
49
|
shadowLevel: "low",
|
41
50
|
isInteractive: !!href
|
42
51
|
}, /*#__PURE__*/React.createElement("div", {
|
43
|
-
className: cn('tile-inner')
|
52
|
+
className: cn('tile-inner', [itemClass])
|
53
|
+
}, /*#__PURE__*/React.createElement("div", {
|
54
|
+
className: cn('img-wrapper')
|
44
55
|
}, /*#__PURE__*/React.createElement("img", {
|
45
56
|
src: src,
|
57
|
+
alt: alt,
|
46
58
|
className: cn('tile-img')
|
47
|
-
})));
|
48
|
-
}, []);
|
59
|
+
}))));
|
60
|
+
}, [itemClass]);
|
49
61
|
var renderGrid = React.useCallback(function () {
|
50
62
|
return /*#__PURE__*/React.createElement(Grid, {
|
51
63
|
guttersLeft: "medium",
|
@@ -57,7 +69,7 @@ var Partners = function Partners(_ref) {
|
|
57
69
|
mobile: "6"
|
58
70
|
}, renderItem(item));
|
59
71
|
}));
|
60
|
-
}, [items]);
|
72
|
+
}, [items, renderItem]);
|
61
73
|
var renderCarousel = React.useCallback(function () {
|
62
74
|
var halfItemsLength = Math.ceil(items.length / 2);
|
63
75
|
var topRow = items.slice(0, halfItemsLength);
|
@@ -73,17 +85,27 @@ var Partners = function Partners(_ref) {
|
|
73
85
|
className: cn('slide')
|
74
86
|
}, renderItem(item), renderItem(bottomRow[i]));
|
75
87
|
}));
|
76
|
-
}, [items]);
|
77
|
-
return /*#__PURE__*/React.createElement("div", {
|
78
|
-
|
79
|
-
|
88
|
+
}, [items, onChange, onNextClick, onPrevClick, renderItem]);
|
89
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
90
|
+
ref: rootRef,
|
91
|
+
className: cn([root, className])
|
92
|
+
}, filterDataAttrs(dataAttrs)), items.length > MAX_GRID_ITEMS_LENGTH ? renderCarousel() : renderGrid());
|
80
93
|
};
|
81
94
|
|
82
95
|
Partners.propTypes = {
|
96
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
97
|
+
current: PropTypes.elementType
|
98
|
+
}), PropTypes.any])]),
|
99
|
+
classes: PropTypes.shape({
|
100
|
+
root: PropTypes.string,
|
101
|
+
itemClass: PropTypes.string
|
102
|
+
}),
|
103
|
+
dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
|
83
104
|
className: PropTypes.string,
|
84
105
|
items: PropTypes.arrayOf(PropTypes.shape({
|
85
106
|
href: PropTypes.string,
|
86
|
-
src: PropTypes.string.isRequired
|
107
|
+
src: PropTypes.string.isRequired,
|
108
|
+
alt: PropTypes.string.isRequired
|
87
109
|
}).isRequired).isRequired,
|
88
110
|
onChange: PropTypes.func,
|
89
111
|
onNextClick: PropTypes.func,
|