@megafon/ui-shared 6.0.0-beta.3 → 6.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 +4031 -0
- package/dist/es/components/AccordionBox/AccordionBox.css +15 -1
- package/dist/es/components/AccordionBox/AccordionBox.d.ts +2 -2
- package/dist/es/components/AccordionBox/AccordionBox.js +49 -6
- package/dist/es/components/AudioPlayer/AudioPlayer.d.ts +2 -2
- package/dist/es/components/AudioPlayer/AudioPlayer.js +27 -11
- package/dist/es/components/AudioPlayer/AudioProgress.d.ts +1 -1
- package/dist/es/components/AudioPlayer/AudioProgress.js +22 -10
- package/dist/es/components/AudioPlayer/AudioRange.d.ts +1 -1
- package/dist/es/components/AudioPlayer/AudioRange.js +10 -8
- package/dist/es/components/AudioPlayer/AudioVolume.d.ts +1 -1
- package/dist/es/components/AudioPlayer/AudioVolume.js +12 -3
- package/dist/es/components/AudioPlayer/hooks/useTrackDuration.js +10 -4
- package/dist/es/components/AudioPlayer/style/AudioPlayer.css +58 -1
- package/dist/es/components/AudioPlayer/style/AudioProgress.css +35 -1
- package/dist/es/components/AudioPlayer/style/AudioRange.css +68 -1
- package/dist/es/components/AudioPlayer/style/AudioVolume.css +34 -1
- package/dist/es/components/AudioPlayer/timerFormatUtil.js +9 -1
- package/dist/es/components/BannerBox/BannerBox.d.ts +1 -1
- package/dist/es/components/BannerBox/BannerBox.js +12 -3
- package/dist/es/components/BenefitsIcons/BenefitsIcons.d.ts +1 -1
- package/dist/es/components/BenefitsIcons/BenefitsIcons.js +64 -23
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.d.ts +1 -1
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.js +36 -9
- package/dist/es/components/BenefitsIcons/helpers.d.ts +3 -3
- package/dist/es/components/BenefitsIcons/helpers.js +20 -6
- package/dist/es/components/BenefitsIcons/style/BenefitsIcons.css +38 -1
- package/dist/es/components/BenefitsIcons/style/BenefitsIconsTile.css +90 -1
- 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 +49 -19
- package/dist/es/components/BenefitsPictures/BenfitsPictures.css +43 -1
- package/dist/es/components/BenefitsPictures/helpers.d.ts +2 -2
- package/dist/es/components/BenefitsPictures/helpers.js +14 -0
- package/dist/es/components/BenefitsPictures/types.d.ts +3 -3
- package/dist/es/components/BenefitsPictures/types.js +0 -1
- package/dist/es/components/Breadcrumbs/Breadcrumbs.css +43 -1
- package/dist/es/components/Breadcrumbs/Breadcrumbs.d.ts +6 -6
- package/dist/es/components/Breadcrumbs/Breadcrumbs.js +39 -10
- package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.css +16 -1
- package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.d.ts +4 -4
- package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.js +36 -11
- package/dist/es/components/ButtonBanner/ButtonBanner.css +122 -1
- package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +7 -7
- package/dist/es/components/ButtonBanner/ButtonBanner.js +53 -22
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.css +19 -1
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.d.ts +3 -3
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +51 -20
- package/dist/es/components/Card/Card.css +354 -1
- package/dist/es/components/Card/Card.d.ts +4 -4
- package/dist/es/components/Card/Card.js +115 -25
- package/dist/es/components/Card/types.d.ts +10 -10
- package/dist/es/components/Card/types.js +0 -1
- package/dist/es/components/CardsBox/CardsBox.js +14 -3
- package/dist/es/components/CardsBox/helpers.d.ts +2 -2
- package/dist/es/components/CardsBox/helpers.js +4 -0
- package/dist/es/components/CarouselBox/CarouselBox.d.ts +2 -2
- package/dist/es/components/CarouselBox/CarouselBox.js +24 -11
- package/dist/es/components/Container/Container.css +3287 -1
- package/dist/es/components/Container/Container.d.ts +5 -7
- package/dist/es/components/Container/Container.js +25 -10
- package/dist/es/components/DownloadLinks/DownloadLink.css +37 -1
- package/dist/es/components/DownloadLinks/DownloadLink.d.ts +1 -1
- package/dist/es/components/DownloadLinks/DownloadLink.js +44 -13
- package/dist/es/components/DownloadLinks/DownloadLinks.css +36 -1
- package/dist/es/components/DownloadLinks/DownloadLinks.d.ts +3 -3
- package/dist/es/components/DownloadLinks/DownloadLinks.js +13 -2
- package/dist/es/components/FaqWrapper/FaqWrapper.d.ts +2 -5
- package/dist/es/components/FaqWrapper/FaqWrapper.js +3 -1
- package/dist/es/components/ImageBanner/ImageBanner.css +252 -1
- package/dist/es/components/ImageBanner/ImageBanner.d.ts +7 -8
- package/dist/es/components/ImageBanner/ImageBanner.js +88 -37
- package/dist/es/components/Instructions/Instructions.css +790 -1
- package/dist/es/components/Instructions/Instructions.d.ts +11 -11
- package/dist/es/components/Instructions/Instructions.js +94 -41
- package/dist/es/components/NotificationBox/NotificationBox.d.ts +4 -4
- package/dist/es/components/NotificationBox/NotificationBox.js +19 -5
- package/dist/es/components/NotificationBox/style/NotificationBox.css +28 -0
- package/dist/es/components/PageTitle/PageTitle.css +80 -1
- package/dist/es/components/PageTitle/PageTitle.d.ts +2 -2
- package/dist/es/components/PageTitle/PageTitle.js +37 -12
- package/dist/es/components/Partners/Partners.css +53 -1
- package/dist/es/components/Partners/Partners.d.ts +2 -2
- package/dist/es/components/Partners/Partners.js +48 -17
- package/dist/es/components/PictureWithDescription/PictureWithDescription.css +80 -1
- package/dist/es/components/PictureWithDescription/PictureWithDescription.d.ts +2 -4
- package/dist/es/components/PictureWithDescription/PictureWithDescription.js +28 -10
- package/dist/es/components/Property/Property.css +156 -1
- package/dist/es/components/Property/Property.d.ts +4 -4
- package/dist/es/components/Property/Property.js +81 -37
- package/dist/es/components/Property/PropertyDescription.css +17 -1
- package/dist/es/components/Property/PropertyDescription.d.ts +3 -3
- package/dist/es/components/Property/PropertyDescription.js +28 -8
- package/dist/es/components/Property/types.d.ts +5 -7
- package/dist/es/components/Property/types.js +0 -1
- package/dist/es/components/Steps/Steps.css +41 -1
- package/dist/es/components/Steps/Steps.d.ts +1 -2
- package/dist/es/components/Steps/Steps.js +19 -4
- package/dist/es/components/Steps/StepsItem.css +42 -1
- package/dist/es/components/Steps/StepsItem.d.ts +2 -2
- package/dist/es/components/Steps/StepsItem.js +9 -2
- package/dist/es/components/StoreBanner/StoreBanner.css +346 -1
- package/dist/es/components/StoreBanner/StoreBanner.d.ts +5 -5
- package/dist/es/components/StoreBanner/StoreBanner.js +97 -41
- 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 +327 -1
- package/dist/es/components/StoreButton/StoreButton.d.ts +3 -3
- package/dist/es/components/StoreButton/StoreButton.js +44 -13
- package/dist/es/components/Table/Table.css +157 -1
- package/dist/es/components/Table/Table.d.ts +1 -1
- package/dist/es/components/Table/Table.js +51 -31
- package/dist/es/components/Table/TableCell.js +6 -0
- package/dist/es/components/Table/TableRow.js +10 -1
- package/dist/es/components/TabsBox/TabsBox.d.ts +1 -1
- package/dist/es/components/TabsBox/TabsBox.js +13 -4
- package/dist/es/components/TextBox/TextBox.css +25 -1
- package/dist/es/components/TextBox/TextBox.d.ts +1 -2
- package/dist/es/components/TextBox/TextBox.js +23 -8
- package/dist/es/components/TextBox/TextBoxPicture.css +27 -1
- package/dist/es/components/TextBox/TextBoxPicture.d.ts +2 -2
- package/dist/es/components/TextBox/TextBoxPicture.js +14 -5
- package/dist/es/components/TextWithIcon/TextWithIcon.css +10 -1
- package/dist/es/components/TextWithIcon/TextWithIcon.d.ts +1 -1
- package/dist/es/components/TextWithIcon/TextWithIcon.js +24 -6
- package/dist/es/components/TextWithIcon/TextWithIconItem.css +29 -1
- package/dist/es/components/TextWithIcon/TextWithIconItem.d.ts +1 -1
- package/dist/es/components/TextWithIcon/TextWithIconItem.js +21 -6
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.css +31 -1
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +1 -1
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.js +23 -6
- package/dist/es/components/VideoBanner/VideoBanner.css +225 -1
- package/dist/es/components/VideoBanner/VideoBanner.d.ts +7 -7
- package/dist/es/components/VideoBanner/VideoBanner.js +110 -47
- package/dist/es/components/VideoBlock/VideoBlock.css +106 -1
- package/dist/es/components/VideoBlock/VideoBlock.d.ts +4 -4
- package/dist/es/components/VideoBlock/VideoBlock.js +75 -35
- package/dist/es/helpers/getColumnConfig.d.ts +1 -5
- package/dist/lib/components/AccordionBox/AccordionBox.css +15 -1
- package/dist/lib/components/AccordionBox/AccordionBox.d.ts +2 -2
- package/dist/lib/components/AccordionBox/AccordionBox.js +66 -10
- package/dist/lib/components/AudioPlayer/AudioPlayer.d.ts +2 -2
- package/dist/lib/components/AudioPlayer/AudioPlayer.js +56 -32
- package/dist/lib/components/AudioPlayer/AudioProgress.d.ts +1 -1
- package/dist/lib/components/AudioPlayer/AudioProgress.js +43 -12
- package/dist/lib/components/AudioPlayer/AudioRange.d.ts +1 -1
- package/dist/lib/components/AudioPlayer/AudioRange.js +17 -9
- package/dist/lib/components/AudioPlayer/AudioVolume.d.ts +1 -1
- package/dist/lib/components/AudioPlayer/AudioVolume.js +23 -4
- package/dist/lib/components/AudioPlayer/hooks/useTrackDuration.js +16 -5
- package/dist/lib/components/AudioPlayer/style/AudioPlayer.css +58 -1
- package/dist/lib/components/AudioPlayer/style/AudioProgress.css +35 -1
- package/dist/lib/components/AudioPlayer/style/AudioRange.css +68 -1
- package/dist/lib/components/AudioPlayer/style/AudioVolume.css +34 -1
- package/dist/lib/components/AudioPlayer/timerFormatUtil.js +13 -2
- package/dist/lib/components/BannerBox/BannerBox.d.ts +1 -1
- package/dist/lib/components/BannerBox/BannerBox.js +25 -7
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.d.ts +1 -1
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +86 -26
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.d.ts +1 -1
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.js +53 -13
- package/dist/lib/components/BenefitsIcons/helpers.d.ts +3 -3
- package/dist/lib/components/BenefitsIcons/helpers.js +37 -10
- package/dist/lib/components/BenefitsIcons/style/BenefitsIcons.css +38 -1
- package/dist/lib/components/BenefitsIcons/style/BenefitsIconsTile.css +90 -1
- package/dist/lib/components/BenefitsIcons/types.d.ts +5 -5
- package/dist/lib/components/BenefitsIcons/types.js +8 -5
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.d.ts +1 -1
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.js +71 -24
- package/dist/lib/components/BenefitsPictures/BenfitsPictures.css +43 -1
- package/dist/lib/components/BenefitsPictures/helpers.d.ts +2 -2
- package/dist/lib/components/BenefitsPictures/helpers.js +40 -9
- package/dist/lib/components/BenefitsPictures/types.d.ts +3 -3
- package/dist/lib/components/BenefitsPictures/types.js +1 -5
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.css +43 -1
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.d.ts +6 -6
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.js +60 -18
- package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.css +16 -1
- package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.d.ts +4 -4
- package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.js +55 -22
- package/dist/lib/components/ButtonBanner/ButtonBanner.css +122 -1
- package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +7 -7
- package/dist/lib/components/ButtonBanner/ButtonBanner.js +89 -40
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.css +19 -1
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.d.ts +3 -3
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +72 -29
- package/dist/lib/components/Card/Card.css +354 -1
- package/dist/lib/components/Card/Card.d.ts +4 -4
- package/dist/lib/components/Card/Card.js +164 -67
- package/dist/lib/components/Card/types.d.ts +10 -10
- package/dist/lib/components/Card/types.js +1 -5
- package/dist/lib/components/CardsBox/CardsBox.js +31 -7
- package/dist/lib/components/CardsBox/helpers.d.ts +2 -2
- package/dist/lib/components/CardsBox/helpers.js +8 -1
- package/dist/lib/components/CarouselBox/CarouselBox.d.ts +2 -2
- package/dist/lib/components/CarouselBox/CarouselBox.js +39 -15
- package/dist/lib/components/Container/Container.css +3287 -1
- package/dist/lib/components/Container/Container.d.ts +5 -7
- package/dist/lib/components/Container/Container.js +40 -18
- package/dist/lib/components/DownloadLinks/DownloadLink.css +37 -1
- package/dist/lib/components/DownloadLinks/DownloadLink.d.ts +1 -1
- package/dist/lib/components/DownloadLinks/DownloadLink.js +60 -17
- package/dist/lib/components/DownloadLinks/DownloadLinks.css +36 -1
- package/dist/lib/components/DownloadLinks/DownloadLinks.d.ts +3 -3
- package/dist/lib/components/DownloadLinks/DownloadLinks.js +33 -8
- package/dist/lib/components/FaqWrapper/FaqWrapper.d.ts +2 -5
- package/dist/lib/components/FaqWrapper/FaqWrapper.js +9 -6
- package/dist/lib/components/ImageBanner/ImageBanner.css +252 -1
- package/dist/lib/components/ImageBanner/ImageBanner.d.ts +7 -8
- package/dist/lib/components/ImageBanner/ImageBanner.js +138 -61
- package/dist/lib/components/Instructions/Instructions.css +790 -1
- package/dist/lib/components/Instructions/Instructions.d.ts +11 -11
- package/dist/lib/components/Instructions/Instructions.js +186 -103
- package/dist/lib/components/NotificationBox/NotificationBox.d.ts +4 -4
- package/dist/lib/components/NotificationBox/NotificationBox.js +37 -9
- package/dist/lib/components/NotificationBox/style/NotificationBox.css +28 -0
- package/dist/lib/components/PageTitle/PageTitle.css +80 -1
- package/dist/lib/components/PageTitle/PageTitle.d.ts +2 -2
- package/dist/lib/components/PageTitle/PageTitle.js +52 -15
- package/dist/lib/components/Partners/Partners.css +53 -1
- package/dist/lib/components/Partners/Partners.d.ts +2 -2
- package/dist/lib/components/Partners/Partners.js +65 -21
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.css +80 -1
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.d.ts +2 -4
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.js +46 -16
- package/dist/lib/components/Property/Property.css +156 -1
- package/dist/lib/components/Property/Property.d.ts +4 -4
- package/dist/lib/components/Property/Property.js +120 -60
- package/dist/lib/components/Property/PropertyDescription.css +17 -1
- package/dist/lib/components/Property/PropertyDescription.d.ts +3 -3
- package/dist/lib/components/Property/PropertyDescription.js +46 -15
- package/dist/lib/components/Property/types.d.ts +5 -7
- package/dist/lib/components/Property/types.js +1 -5
- package/dist/lib/components/Steps/Steps.css +41 -1
- package/dist/lib/components/Steps/Steps.d.ts +1 -2
- package/dist/lib/components/Steps/Steps.js +35 -8
- package/dist/lib/components/Steps/StepsItem.css +42 -1
- package/dist/lib/components/Steps/StepsItem.d.ts +2 -2
- package/dist/lib/components/Steps/StepsItem.js +23 -11
- package/dist/lib/components/StoreBanner/StoreBanner.css +346 -1
- package/dist/lib/components/StoreBanner/StoreBanner.d.ts +5 -5
- package/dist/lib/components/StoreBanner/StoreBanner.js +118 -47
- 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 +327 -1
- package/dist/lib/components/StoreButton/StoreButton.d.ts +3 -3
- package/dist/lib/components/StoreButton/StoreButton.js +63 -17
- package/dist/lib/components/Table/Table.css +157 -1
- package/dist/lib/components/Table/Table.d.ts +1 -1
- package/dist/lib/components/Table/Table.js +68 -35
- package/dist/lib/components/Table/TableCell.js +16 -4
- package/dist/lib/components/Table/TableRow.js +19 -5
- package/dist/lib/components/TabsBox/TabBox.js +4 -1
- package/dist/lib/components/TabsBox/TabsBox.d.ts +1 -1
- package/dist/lib/components/TabsBox/TabsBox.js +26 -8
- package/dist/lib/components/TextBox/TextBox.css +25 -1
- package/dist/lib/components/TextBox/TextBox.d.ts +1 -2
- package/dist/lib/components/TextBox/TextBox.js +36 -12
- package/dist/lib/components/TextBox/TextBoxPicture.css +27 -1
- package/dist/lib/components/TextBox/TextBoxPicture.d.ts +2 -2
- package/dist/lib/components/TextBox/TextBoxPicture.js +29 -11
- package/dist/lib/components/TextWithIcon/TextWithIcon.css +10 -1
- package/dist/lib/components/TextWithIcon/TextWithIcon.d.ts +1 -1
- package/dist/lib/components/TextWithIcon/TextWithIcon.js +39 -10
- package/dist/lib/components/TextWithIcon/TextWithIconItem.css +29 -1
- package/dist/lib/components/TextWithIcon/TextWithIconItem.d.ts +1 -1
- package/dist/lib/components/TextWithIcon/TextWithIconItem.js +37 -10
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.css +31 -1
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +1 -1
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.js +40 -10
- package/dist/lib/components/VideoBanner/VideoBanner.css +225 -1
- package/dist/lib/components/VideoBanner/VideoBanner.d.ts +7 -7
- package/dist/lib/components/VideoBanner/VideoBanner.js +176 -83
- package/dist/lib/components/VideoBlock/VideoBlock.css +106 -1
- package/dist/lib/components/VideoBlock/VideoBlock.d.ts +4 -4
- package/dist/lib/components/VideoBlock/VideoBlock.js +114 -58
- package/dist/lib/constants/throttleTime.js +3 -2
- package/dist/lib/helpers/getColumnConfig.d.ts +1 -5
- package/dist/lib/helpers/getColumnConfig.js +5 -2
- package/dist/lib/index.js +57 -10
- package/package.json +92 -87
- package/dist/es/components/NotificationBox/NotificationBox.css +0 -1
- package/dist/lib/components/NotificationBox/NotificationBox.css +0 -1
@@ -1,6 +1,6 @@
|
|
1
|
-
import
|
1
|
+
import React, { Ref } from 'react';
|
2
2
|
import SwiperCore from 'swiper';
|
3
|
-
import './Instructions.
|
3
|
+
import './Instructions.less';
|
4
4
|
export declare const pictureAlignTypes: {
|
5
5
|
readonly LEFT: "left";
|
6
6
|
readonly RIGHT: "right";
|
@@ -34,13 +34,13 @@ export declare const elementOrderTypes: {
|
|
34
34
|
readonly DEFAULT: "default";
|
35
35
|
readonly REVERSED: "reversed";
|
36
36
|
};
|
37
|
-
type PictureAlignTypesType =
|
38
|
-
type PictureVerticalAlignTypesType =
|
39
|
-
type PictureMaskTypesType =
|
40
|
-
type PictureBackgroundColorsType =
|
41
|
-
type ArrowThemeType =
|
42
|
-
type ElementOrderType =
|
43
|
-
export type InstructionItemType = {
|
37
|
+
declare type PictureAlignTypesType = typeof pictureAlignTypes[keyof typeof pictureAlignTypes];
|
38
|
+
declare type PictureVerticalAlignTypesType = typeof pictureVerticalAlignTypes[keyof typeof pictureVerticalAlignTypes];
|
39
|
+
declare type PictureMaskTypesType = typeof pictureMaskTypes[keyof typeof pictureMaskTypes];
|
40
|
+
declare type PictureBackgroundColorsType = typeof pictureBackgroundColorTypes[keyof typeof pictureBackgroundColorTypes];
|
41
|
+
declare type ArrowThemeType = typeof arrowTheme[keyof typeof arrowTheme];
|
42
|
+
declare type ElementOrderType = typeof elementOrderTypes[keyof typeof elementOrderTypes];
|
43
|
+
export declare type InstructionItemType = {
|
44
44
|
title: string | React.ReactNode | React.ReactNode[];
|
45
45
|
mediaUrl: string;
|
46
46
|
isVideo: boolean;
|
@@ -62,7 +62,7 @@ export interface IInstructionsProps {
|
|
62
62
|
arrowNext?: Record<string, string>;
|
63
63
|
};
|
64
64
|
/** Ссылка на корневой элемент */
|
65
|
-
rootRef?:
|
65
|
+
rootRef?: Ref<HTMLDivElement>;
|
66
66
|
/** Дополнительные классы для внутренних элементов */
|
67
67
|
classes?: {
|
68
68
|
instructionItem?: string;
|
@@ -99,5 +99,5 @@ export interface IInstructionsProps {
|
|
99
99
|
/** Ref на swiper */
|
100
100
|
getSwiper?: (instance: SwiperCore) => void;
|
101
101
|
}
|
102
|
-
declare const Instructions: React.FC<
|
102
|
+
declare const Instructions: React.FC<IInstructionsProps>;
|
103
103
|
export default Instructions;
|
@@ -1,33 +1,43 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
|
-
exports
|
6
|
+
exports["default"] = exports.elementOrderTypes = exports.arrowTheme = exports.pictureBackgroundColorTypes = exports.pictureMaskTypes = exports.pictureVerticalAlignTypes = exports.pictureAlignTypes = void 0;
|
7
|
+
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
|
9
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
11
|
+
|
10
12
|
require("core-js/modules/es.array.map.js");
|
11
|
-
|
13
|
+
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
15
|
+
|
12
16
|
var _uiCore = require("@megafon/ui-core");
|
17
|
+
|
13
18
|
var _uiHelpers = require("@megafon/ui-helpers");
|
19
|
+
|
20
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
21
|
+
|
14
22
|
var _react2 = require("swiper/react");
|
15
|
-
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
23
|
+
|
17
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
25
|
+
|
18
26
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
19
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
20
27
|
|
21
|
-
|
28
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
29
|
+
var pictureAlignTypes = {
|
22
30
|
LEFT: 'left',
|
23
31
|
RIGHT: 'right'
|
24
32
|
};
|
25
|
-
|
33
|
+
exports.pictureAlignTypes = pictureAlignTypes;
|
34
|
+
var pictureVerticalAlignTypes = {
|
26
35
|
CENTER: 'center',
|
27
36
|
TOP: 'top',
|
28
37
|
UNSET: 'unset'
|
29
38
|
};
|
30
|
-
|
39
|
+
exports.pictureVerticalAlignTypes = pictureVerticalAlignTypes;
|
40
|
+
var pictureMaskTypes = {
|
31
41
|
ANDROID: 'android',
|
32
42
|
ANDROID_CROPPED: 'android-cropped',
|
33
43
|
NEW_IPHONE: 'new-iphone',
|
@@ -40,96 +50,114 @@ var pictureMaskTypes = exports.pictureMaskTypes = {
|
|
40
50
|
IPHONE_CROPPED: 'iphone-cropped',
|
41
51
|
NONE: 'none'
|
42
52
|
};
|
43
|
-
|
53
|
+
exports.pictureMaskTypes = pictureMaskTypes;
|
54
|
+
var pictureBackgroundColorTypes = {
|
44
55
|
SPB_SKY_0: 'spbSky0'
|
45
56
|
};
|
46
|
-
|
57
|
+
exports.pictureBackgroundColorTypes = pictureBackgroundColorTypes;
|
58
|
+
var arrowTheme = {
|
47
59
|
PURPLE: 'purple',
|
48
60
|
DARK: 'dark'
|
49
61
|
};
|
50
|
-
|
62
|
+
exports.arrowTheme = arrowTheme;
|
63
|
+
var elementOrderTypes = {
|
51
64
|
DEFAULT: 'default',
|
52
65
|
REVERSED: 'reversed'
|
53
66
|
};
|
67
|
+
exports.elementOrderTypes = elementOrderTypes;
|
54
68
|
var testIdPrefix = 'Instructions';
|
55
69
|
var cn = (0, _uiHelpers.cnCreate)('mfui-instructions');
|
56
70
|
var swiperSlideCn = cn('slide');
|
71
|
+
|
57
72
|
var Instructions = function Instructions(_ref) {
|
58
73
|
var dataAttrs = _ref.dataAttrs,
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
74
|
+
rootRef = _ref.rootRef,
|
75
|
+
_ref$classes = _ref.classes;
|
76
|
+
_ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
|
77
|
+
var instructionItem = _ref$classes.instructionItem,
|
78
|
+
desktopInstructionItem = _ref$classes.desktopInstructionItem,
|
79
|
+
mobileInstructionItem = _ref$classes.mobileInstructionItem,
|
80
|
+
activeInstructionItem = _ref$classes.activeInstructionItem,
|
81
|
+
desktopItemTitle = _ref$classes.desktopItemTitle,
|
82
|
+
mobileItemTitle = _ref$classes.mobileItemTitle,
|
83
|
+
instructionItemImg = _ref$classes.instructionItemImg,
|
84
|
+
additionalText = _ref$classes.additionalText,
|
85
|
+
arrowPrev = _ref$classes.arrowPrev,
|
86
|
+
arrowNext = _ref$classes.arrowNext,
|
87
|
+
_ref$title = _ref.title,
|
88
|
+
title = _ref$title === void 0 ? '' : _ref$title,
|
89
|
+
instructionItems = _ref.instructionItems,
|
90
|
+
_ref$pictureAlign = _ref.pictureAlign,
|
91
|
+
pictureAlign = _ref$pictureAlign === void 0 ? 'left' : _ref$pictureAlign,
|
92
|
+
_ref$pictureVerticalA = _ref.pictureVerticalAlign,
|
93
|
+
pictureVerticalAlign = _ref$pictureVerticalA === void 0 ? 'center' : _ref$pictureVerticalA,
|
94
|
+
_ref$pictureMask = _ref.pictureMask,
|
95
|
+
pictureMask = _ref$pictureMask === void 0 ? 'none' : _ref$pictureMask,
|
96
|
+
pictureBackgroundColor = _ref.pictureBackgroundColor,
|
97
|
+
getSwiper = _ref.getSwiper,
|
98
|
+
text = _ref.additionalText,
|
99
|
+
showArrows = _ref.showArrows,
|
100
|
+
_ref$arrowsTheme = _ref.arrowsTheme,
|
101
|
+
arrowsTheme = _ref$arrowsTheme === void 0 ? arrowTheme.DARK : _ref$arrowsTheme,
|
102
|
+
_ref$elementOrder = _ref.elementOrder,
|
103
|
+
elementOrder = _ref$elementOrder === void 0 ? 'default' : _ref$elementOrder,
|
104
|
+
children = _ref.children;
|
105
|
+
|
106
|
+
var _React$useState = _react["default"].useState(),
|
107
|
+
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
108
|
+
swiperInstance = _React$useState2[0],
|
109
|
+
setSwiperInstance = _React$useState2[1];
|
110
|
+
|
111
|
+
var _React$useState3 = _react["default"].useState(0),
|
112
|
+
_React$useState4 = (0, _slicedToArray2["default"])(_React$useState3, 2),
|
113
|
+
slideIndex = _React$useState4[0],
|
114
|
+
setSlideIndex = _React$useState4[1];
|
115
|
+
|
98
116
|
var isMobileReversed = elementOrder === 'reversed';
|
99
|
-
|
117
|
+
|
118
|
+
var getSwiperInstance = _react["default"].useCallback(function (swiper) {
|
100
119
|
setSwiperInstance(swiper);
|
101
120
|
getSwiper && getSwiper(swiper);
|
102
121
|
}, [getSwiper]);
|
103
|
-
|
122
|
+
|
123
|
+
var getActiveCustomClass = _react["default"].useCallback(function (articleIndex, activeIndex) {
|
104
124
|
if (articleIndex !== activeIndex) {
|
105
125
|
return undefined;
|
106
126
|
}
|
127
|
+
|
107
128
|
return activeInstructionItem;
|
108
129
|
}, [activeInstructionItem]);
|
109
|
-
|
130
|
+
|
131
|
+
var handleArticleClick = _react["default"].useCallback(function (ind) {
|
110
132
|
return function () {
|
111
133
|
setSlideIndex(ind);
|
112
134
|
swiperInstance && swiperInstance.slideTo(ind);
|
113
135
|
};
|
114
136
|
}, [swiperInstance]);
|
115
|
-
|
137
|
+
|
138
|
+
var handleSlideChange = _react["default"].useCallback(function (_ref2) {
|
116
139
|
var activeIndex = _ref2.activeIndex;
|
117
140
|
setSlideIndex(activeIndex);
|
118
141
|
}, []);
|
119
|
-
|
142
|
+
|
143
|
+
var handlePrevClick = _react["default"].useCallback(function () {
|
120
144
|
if (!swiperInstance) {
|
121
145
|
return;
|
122
146
|
}
|
147
|
+
|
123
148
|
swiperInstance.slidePrev();
|
124
149
|
}, [swiperInstance]);
|
125
|
-
|
150
|
+
|
151
|
+
var handleNextClick = _react["default"].useCallback(function () {
|
126
152
|
if (!swiperInstance) {
|
127
153
|
return;
|
128
154
|
}
|
155
|
+
|
129
156
|
swiperInstance.slideNext();
|
130
157
|
}, [swiperInstance]);
|
131
|
-
|
132
|
-
|
158
|
+
|
159
|
+
var renderVideo = _react["default"].useCallback(function (mediaUrl, index) {
|
160
|
+
return /*#__PURE__*/_react["default"].createElement("video", (0, _extends2["default"])({
|
133
161
|
loop: true,
|
134
162
|
muted: true,
|
135
163
|
autoPlay: true,
|
@@ -137,19 +165,20 @@ var Instructions = function Instructions(_ref) {
|
|
137
165
|
className: cn('swiper-img', {
|
138
166
|
video: true
|
139
167
|
})
|
140
|
-
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, index + 1)), /*#__PURE__*/
|
168
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, index + 1)), /*#__PURE__*/_react["default"].createElement("source", {
|
141
169
|
src: mediaUrl,
|
142
170
|
type: "video/mp4"
|
143
171
|
}));
|
144
172
|
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image]);
|
145
|
-
|
146
|
-
|
173
|
+
|
174
|
+
var renderMobileDots = _react["default"].useCallback(function () {
|
175
|
+
return /*#__PURE__*/_react["default"].createElement("ul", {
|
147
176
|
className: cn('articles-dots', {
|
148
177
|
reversed: isMobileReversed
|
149
178
|
}),
|
150
179
|
"data-testid": "".concat(testIdPrefix, "-articles-dots-mobile")
|
151
180
|
}, instructionItems.map(function (_item, i) {
|
152
|
-
return /*#__PURE__*/
|
181
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
153
182
|
key: i,
|
154
183
|
className: cn('articles-dot', {
|
155
184
|
active: slideIndex === i
|
@@ -158,8 +187,9 @@ var Instructions = function Instructions(_ref) {
|
|
158
187
|
}));
|
159
188
|
}));
|
160
189
|
}, [instructionItems, dataAttrs, slideIndex, instructionItem, mobileInstructionItem, getActiveCustomClass, handleArticleClick, isMobileReversed]);
|
161
|
-
|
162
|
-
|
190
|
+
|
191
|
+
var renderSlider = _react["default"].useCallback(function () {
|
192
|
+
return /*#__PURE__*/_react["default"].createElement(_react2.Swiper, {
|
163
193
|
noSwiping: false,
|
164
194
|
onSwiper: getSwiperInstance,
|
165
195
|
noSwipingClass: swiperSlideCn,
|
@@ -167,12 +197,12 @@ var Instructions = function Instructions(_ref) {
|
|
167
197
|
className: cn('swiper')
|
168
198
|
}, instructionItems.map(function (_ref3, i) {
|
169
199
|
var mediaUrl = _ref3.mediaUrl,
|
170
|
-
|
171
|
-
|
172
|
-
return /*#__PURE__*/
|
200
|
+
isVideo = _ref3.isVideo,
|
201
|
+
imageAlt = _ref3.imageAlt;
|
202
|
+
return /*#__PURE__*/_react["default"].createElement(_react2.SwiperSlide, {
|
173
203
|
className: swiperSlideCn,
|
174
204
|
key: i + mediaUrl
|
175
|
-
}, isVideo ? renderVideo(mediaUrl, i) : /*#__PURE__*/
|
205
|
+
}, isVideo ? renderVideo(mediaUrl, i) : /*#__PURE__*/_react["default"].createElement("img", (0, _extends2["default"])({
|
176
206
|
alt: imageAlt,
|
177
207
|
src: mediaUrl
|
178
208
|
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, i + 1), {
|
@@ -180,51 +210,57 @@ var Instructions = function Instructions(_ref) {
|
|
180
210
|
})));
|
181
211
|
}));
|
182
212
|
}, [getSwiperInstance, instructionItemImg, instructionItems, renderVideo, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, handleSlideChange]);
|
183
|
-
|
184
|
-
|
213
|
+
|
214
|
+
var renderTitle = _react["default"].useCallback(function (resolution) {
|
215
|
+
return /*#__PURE__*/_react["default"].createElement(_uiCore.Header, {
|
185
216
|
className: cn('title', {
|
186
217
|
resolution: resolution
|
187
218
|
}),
|
188
219
|
as: "h2"
|
189
220
|
}, (0, _uiHelpers.convert)(title, _uiHelpers.titleConvertConfig));
|
190
221
|
}, [title]);
|
191
|
-
|
192
|
-
|
222
|
+
|
223
|
+
var renderQrCode = _react["default"].useCallback(function () {
|
224
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, instructionItems.map(function (_ref4, i) {
|
193
225
|
var qrCode = _ref4.qrCode,
|
194
|
-
|
195
|
-
return slideIndex === i && !!qrCode && /*#__PURE__*/
|
226
|
+
qrCodeText = _ref4.qrCodeText;
|
227
|
+
return slideIndex === i && !!qrCode && /*#__PURE__*/_react["default"].createElement(_uiCore.Tile, {
|
196
228
|
className: cn('qr-code'),
|
197
229
|
radius: "rounded",
|
198
230
|
shadowLevel: "default",
|
199
231
|
key: qrCode
|
200
|
-
}, !!qrCodeText && /*#__PURE__*/
|
232
|
+
}, !!qrCodeText && /*#__PURE__*/_react["default"].createElement("div", {
|
201
233
|
className: cn('qr-code-text')
|
202
|
-
}, qrCodeText), /*#__PURE__*/
|
234
|
+
}, qrCodeText), /*#__PURE__*/_react["default"].createElement("img", {
|
203
235
|
src: qrCode,
|
204
236
|
className: cn('qr-code-image'),
|
205
237
|
alt: "QR-\u043A\u043E\u0434"
|
206
238
|
}));
|
207
239
|
}));
|
208
240
|
}, [instructionItems, slideIndex]);
|
209
|
-
|
210
|
-
|
241
|
+
|
242
|
+
var renderText = _react["default"].useCallback(function () {
|
243
|
+
return /*#__PURE__*/_react["default"].createElement(_uiCore.Paragraph, {
|
211
244
|
className: cn('text', [additionalText]),
|
212
245
|
hasMargin: false
|
213
246
|
}, (0, _uiHelpers.convert)(text, _uiHelpers.textConvertConfig));
|
214
247
|
}, [text, additionalText]);
|
215
|
-
|
248
|
+
|
249
|
+
var renderPicture = _react["default"].useCallback(function () {
|
216
250
|
if (pictureMask === pictureMaskTypes.NONE) {
|
217
251
|
return renderSlider();
|
218
252
|
}
|
219
|
-
|
253
|
+
|
254
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
220
255
|
className: cn('img-wrapper'),
|
221
256
|
"data-testid": "".concat(testIdPrefix, "-img-wrapper")
|
222
|
-
}, /*#__PURE__*/
|
257
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
223
258
|
className: cn('device-screen')
|
224
259
|
}), renderSlider());
|
225
260
|
}, [pictureMask, renderSlider]);
|
226
|
-
|
227
|
-
|
261
|
+
|
262
|
+
var renderDesktopArticles = _react["default"].useCallback(function () {
|
263
|
+
return /*#__PURE__*/_react["default"].createElement("ul", {
|
228
264
|
className: cn('articles-list', {
|
229
265
|
'text-after': !!text,
|
230
266
|
desktop: true
|
@@ -232,38 +268,40 @@ var Instructions = function Instructions(_ref) {
|
|
232
268
|
"data-testid": "".concat(testIdPrefix, "-articles-list-desktop")
|
233
269
|
}, instructionItems.map(function (_ref5, i) {
|
234
270
|
var itemTitle = _ref5.title;
|
235
|
-
return
|
271
|
+
return (
|
272
|
+
/*#__PURE__*/
|
236
273
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
237
|
-
|
274
|
+
_react["default"].createElement("li", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
238
275
|
className: cn('articles-item', {
|
239
276
|
active: slideIndex === i
|
240
277
|
}, [getActiveCustomClass(i, slideIndex), instructionItem, desktopInstructionItem]),
|
241
278
|
"data-index": i,
|
242
279
|
onClick: handleArticleClick(i),
|
243
280
|
key: i
|
244
|
-
}), /*#__PURE__*/
|
281
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
245
282
|
className: cn('articles-item-dot')
|
246
|
-
}, /*#__PURE__*/
|
283
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
247
284
|
className: cn('articles-item-dot-number')
|
248
|
-
}, i + 1)), /*#__PURE__*/
|
285
|
+
}, i + 1)), /*#__PURE__*/_react["default"].createElement("div", {
|
249
286
|
className: cn('articles-item-title', [desktopItemTitle])
|
250
287
|
}, itemTitle))
|
251
288
|
);
|
252
289
|
}));
|
253
290
|
}, [desktopInstructionItem, desktopItemTitle, getActiveCustomClass, handleArticleClick, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, instructionItem, instructionItems, slideIndex, text]);
|
254
|
-
|
255
|
-
|
291
|
+
|
292
|
+
var renderMobileArticles = _react["default"].useCallback(function () {
|
293
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
256
294
|
className: cn('articles-list', {
|
257
295
|
mobile: true
|
258
296
|
}),
|
259
297
|
"data-testid": "".concat(testIdPrefix, "-articles-list-mobile")
|
260
|
-
}, /*#__PURE__*/
|
298
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
261
299
|
className: cn('articles-title-block', {
|
262
300
|
reversed: isMobileReversed
|
263
301
|
})
|
264
302
|
}, instructionItems.map(function (_ref6, i) {
|
265
303
|
var itemTitle = _ref6.title;
|
266
|
-
return slideIndex === i && /*#__PURE__*/
|
304
|
+
return slideIndex === i && /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
267
305
|
key: i,
|
268
306
|
"data-index": i
|
269
307
|
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.mobileItemText, i + 1), {
|
@@ -271,8 +309,9 @@ var Instructions = function Instructions(_ref) {
|
|
271
309
|
}), itemTitle);
|
272
310
|
})));
|
273
311
|
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.mobileItemText, instructionItems, mobileItemTitle, slideIndex, isMobileReversed]);
|
274
|
-
|
275
|
-
|
312
|
+
|
313
|
+
var renderArrows = _react["default"].useCallback(function () {
|
314
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_uiCore.NavArrow, {
|
276
315
|
dataAttrs: {
|
277
316
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowPrev
|
278
317
|
},
|
@@ -282,7 +321,7 @@ var Instructions = function Instructions(_ref) {
|
|
282
321
|
theme: arrowsTheme,
|
283
322
|
disabled: slideIndex === 0,
|
284
323
|
onClick: handlePrevClick
|
285
|
-
}), /*#__PURE__*/
|
324
|
+
}), /*#__PURE__*/_react["default"].createElement(_uiCore.NavArrow, {
|
286
325
|
dataAttrs: {
|
287
326
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowNext
|
288
327
|
},
|
@@ -295,30 +334,74 @@ var Instructions = function Instructions(_ref) {
|
|
295
334
|
onClick: handleNextClick
|
296
335
|
}));
|
297
336
|
}, [handlePrevClick, handleNextClick, arrowsTheme, arrowPrev, arrowNext, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowPrev, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowNext, slideIndex, instructionItems.length]);
|
298
|
-
|
337
|
+
|
338
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
299
339
|
className: cn({
|
300
340
|
mask: pictureMask,
|
301
341
|
reversed: isMobileReversed
|
302
342
|
}),
|
303
343
|
ref: rootRef
|
304
|
-
}), /*#__PURE__*/
|
344
|
+
}), /*#__PURE__*/_react["default"].createElement(_uiCore.Grid, {
|
305
345
|
hAlign: "center"
|
306
|
-
}, /*#__PURE__*/
|
346
|
+
}, /*#__PURE__*/_react["default"].createElement(_uiCore.GridColumn, {
|
307
347
|
all: "12"
|
308
|
-
}, !!title && renderTitle('mobile'), /*#__PURE__*/
|
348
|
+
}, !!title && renderTitle('mobile'), /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
309
349
|
className: cn('wrapper', {
|
310
350
|
'vertical-align': pictureVerticalAlign
|
311
351
|
})
|
312
|
-
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.wrapper)), /*#__PURE__*/
|
352
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.wrapper)), /*#__PURE__*/_react["default"].createElement("div", {
|
313
353
|
className: cn('picture', {
|
314
354
|
align: pictureAlign,
|
315
355
|
background: pictureBackgroundColor
|
316
356
|
}),
|
317
357
|
"data-testid": "".concat(testIdPrefix, "-picture")
|
318
|
-
}, isMobileReversed && renderMobileArticles(), renderPicture(), !!showArrows && renderArrows(), renderQrCode()), renderMobileDots(), /*#__PURE__*/
|
358
|
+
}, isMobileReversed && renderMobileArticles(), renderPicture(), !!showArrows && renderArrows(), renderQrCode()), renderMobileDots(), /*#__PURE__*/_react["default"].createElement("div", {
|
319
359
|
className: cn('articles', {
|
320
360
|
align: pictureAlign
|
321
361
|
})
|
322
362
|
}, !!title && renderTitle('desktop'), !isMobileReversed && renderMobileArticles(), renderDesktopArticles(), text && renderText(), children)))));
|
323
363
|
};
|
324
|
-
|
364
|
+
|
365
|
+
Instructions.propTypes = {
|
366
|
+
dataAttrs: _propTypes["default"].shape({
|
367
|
+
root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
368
|
+
item: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
369
|
+
image: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
370
|
+
mobileItemText: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
371
|
+
wrapper: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
372
|
+
arrowPrev: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
373
|
+
arrowNext: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
|
374
|
+
}),
|
375
|
+
rootRef: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
376
|
+
current: _propTypes["default"].elementType
|
377
|
+
}), _propTypes["default"].any])]),
|
378
|
+
classes: _propTypes["default"].shape({
|
379
|
+
instructionItem: _propTypes["default"].string,
|
380
|
+
desktopInstructionItem: _propTypes["default"].string,
|
381
|
+
mobileInstructionItem: _propTypes["default"].string,
|
382
|
+
activeInstructionItem: _propTypes["default"].string,
|
383
|
+
desktopItemTitle: _propTypes["default"].string,
|
384
|
+
mobileItemTitle: _propTypes["default"].string,
|
385
|
+
instructionItemImg: _propTypes["default"].string,
|
386
|
+
arrowPrev: _propTypes["default"].string,
|
387
|
+
arrowNext: _propTypes["default"].string
|
388
|
+
}),
|
389
|
+
title: _propTypes["default"].string,
|
390
|
+
additionalText: _propTypes["default"].string,
|
391
|
+
instructionItems: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
392
|
+
title: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node, _propTypes["default"].arrayOf(_propTypes["default"].node)]).isRequired,
|
393
|
+
mediaUrl: _propTypes["default"].string.isRequired,
|
394
|
+
isVideo: _propTypes["default"].bool.isRequired,
|
395
|
+
imageAlt: _propTypes["default"].string
|
396
|
+
}).isRequired).isRequired,
|
397
|
+
pictureAlign: _propTypes["default"].oneOf([pictureAlignTypes.LEFT, pictureAlignTypes.RIGHT]),
|
398
|
+
pictureVerticalAlign: _propTypes["default"].oneOf([pictureVerticalAlignTypes.CENTER, pictureVerticalAlignTypes.TOP, pictureVerticalAlignTypes.UNSET]),
|
399
|
+
pictureMask: _propTypes["default"].oneOf([pictureMaskTypes.ANDROID, pictureMaskTypes.ANDROID_CROPPED, pictureMaskTypes.NEW_IPHONE, pictureMaskTypes.WHITE_IPHONE, pictureMaskTypes.BLACK_IPHONE, pictureMaskTypes.LAPTOP, pictureMaskTypes.LAPTOP_NEW, pictureMaskTypes.IPHONE_12, pictureMaskTypes.IPHONE_15, pictureMaskTypes.IPHONE_CROPPED, pictureMaskTypes.NONE]),
|
400
|
+
pictureBackgroundColor: _propTypes["default"].oneOf([pictureBackgroundColorTypes.SPB_SKY_0]),
|
401
|
+
showArrows: _propTypes["default"].bool,
|
402
|
+
arrowsTheme: _propTypes["default"].oneOf([arrowTheme.DARK, arrowTheme.PURPLE]),
|
403
|
+
elementOrder: _propTypes["default"].oneOf([elementOrderTypes.DEFAULT, elementOrderTypes.REVERSED]),
|
404
|
+
getSwiper: _propTypes["default"].func
|
405
|
+
};
|
406
|
+
var _default = Instructions;
|
407
|
+
exports["default"] = _default;
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { Notification } from '@megafon/ui-core';
|
3
|
-
import './NotificationBox.
|
3
|
+
import './style/NotificationBox.less';
|
4
4
|
export declare const Align: {
|
5
5
|
readonly LEFT: "left";
|
6
6
|
readonly CENTER: "center";
|
7
7
|
};
|
8
|
-
type AlignType =
|
9
|
-
type NotificationProps = React.ComponentProps<typeof Notification>;
|
10
|
-
type NotificationBoxProps = Omit<NotificationProps, 'isColored'> & {
|
8
|
+
declare type AlignType = typeof Align[keyof typeof Align];
|
9
|
+
declare type NotificationProps = React.ComponentProps<typeof Notification>;
|
10
|
+
declare type NotificationBoxProps = Omit<NotificationProps, 'isColored'> & {
|
11
11
|
/** Горизонтальное выравнивание */
|
12
12
|
align?: AlignType;
|
13
13
|
};
|
@@ -1,36 +1,59 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
function _typeof(
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
+
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
5
6
|
value: true
|
6
7
|
});
|
7
8
|
exports["default"] = exports.Align = void 0;
|
9
|
+
|
8
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
-
|
11
|
+
|
10
12
|
require("core-js/modules/es.array.index-of.js");
|
13
|
+
|
14
|
+
require("core-js/modules/es.symbol.js");
|
15
|
+
|
16
|
+
require("core-js/modules/es.object.values.js");
|
17
|
+
|
11
18
|
var React = _interopRequireWildcard(require("react"));
|
19
|
+
|
12
20
|
var _uiCore = require("@megafon/ui-core");
|
21
|
+
|
13
22
|
var _uiHelpers = require("@megafon/ui-helpers");
|
14
|
-
|
15
|
-
|
23
|
+
|
24
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
25
|
+
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
27
|
+
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
29
|
+
|
16
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
31
|
+
|
17
32
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
18
33
|
var t = {};
|
19
|
-
|
34
|
+
|
35
|
+
for (var p in s) {
|
36
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
37
|
+
}
|
38
|
+
|
20
39
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
21
40
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
22
41
|
}
|
23
42
|
return t;
|
24
43
|
};
|
25
|
-
|
44
|
+
|
45
|
+
var Align = {
|
26
46
|
LEFT: 'left',
|
27
47
|
CENTER: 'center'
|
28
48
|
};
|
49
|
+
exports.Align = Align;
|
29
50
|
var cn = (0, _uiHelpers.cnCreate)('mfui-notification-box');
|
51
|
+
|
30
52
|
var NotificationBox = function NotificationBox(_a) {
|
31
53
|
var _a$align = _a.align,
|
32
|
-
|
33
|
-
|
54
|
+
align = _a$align === void 0 ? 'left' : _a$align,
|
55
|
+
restProps = __rest(_a, ["align"]);
|
56
|
+
|
34
57
|
return /*#__PURE__*/React.createElement("div", {
|
35
58
|
className: cn({
|
36
59
|
align: align
|
@@ -41,4 +64,9 @@ var NotificationBox = function NotificationBox(_a) {
|
|
41
64
|
isColored: false
|
42
65
|
}))));
|
43
66
|
};
|
44
|
-
|
67
|
+
|
68
|
+
NotificationBox.propTypes = {
|
69
|
+
align: _propTypes["default"].oneOf(Object.values(Align))
|
70
|
+
};
|
71
|
+
var _default = NotificationBox;
|
72
|
+
exports["default"] = _default;
|