@megafon/ui-shared 5.16.0 → 6.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/style/AudioPlayer.css +1 -58
- package/dist/es/components/AudioPlayer/style/AudioProgress.css +1 -35
- package/dist/es/components/AudioPlayer/style/AudioRange.css +1 -68
- package/dist/es/components/AudioPlayer/style/AudioVolume.css +1 -34
- 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/style/BenefitsIcons.css +1 -38
- package/dist/es/components/BenefitsIcons/style/BenefitsIconsTile.css +1 -90
- 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.css +1 -16
- 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.css +1 -354
- package/dist/es/components/Card/Card.d.ts +5 -9
- package/dist/es/components/Card/Card.js +26 -136
- package/dist/es/components/Card/types.d.ts +9 -15
- 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.css +1 -3230
- 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.css +1 -37
- 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.css +1 -36
- 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.css +1 -248
- package/dist/es/components/ImageBanner/ImageBanner.d.ts +21 -17
- package/dist/es/components/ImageBanner/ImageBanner.js +51 -109
- package/dist/es/components/Instructions/Instructions.css +1 -790
- 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.css +1 -0
- 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.css +1 -80
- 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.css +1 -53
- 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.css +1 -80
- 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.css +1 -156
- 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.css +1 -17
- 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.css +1 -41
- 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.css +1 -42
- 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.css +1 -346
- 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.css +1 -327
- 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.css +1 -157
- 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.css +1 -25
- 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.css +1 -27
- 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.css +1 -10
- 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.css +1 -29
- 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.css +1 -31
- 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.css +1 -225
- 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.css +1 -106
- 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/style/AudioPlayer.css +1 -58
- package/dist/lib/components/AudioPlayer/style/AudioProgress.css +1 -35
- package/dist/lib/components/AudioPlayer/style/AudioRange.css +1 -68
- package/dist/lib/components/AudioPlayer/style/AudioVolume.css +1 -34
- 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/style/BenefitsIcons.css +1 -38
- package/dist/lib/components/BenefitsIcons/style/BenefitsIconsTile.css +1 -90
- 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.css +1 -16
- 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.css +1 -354
- package/dist/lib/components/Card/Card.d.ts +5 -9
- package/dist/lib/components/Card/Card.js +63 -180
- package/dist/lib/components/Card/types.d.ts +9 -15
- 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.css +1 -3230
- package/dist/lib/components/Container/Container.d.ts +7 -5
- package/dist/lib/components/Container/Container.js +17 -39
- package/dist/lib/components/DownloadLinks/DownloadLink.css +1 -37
- 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.css +1 -36
- 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.css +1 -248
- package/dist/lib/components/ImageBanner/ImageBanner.d.ts +21 -17
- package/dist/lib/components/ImageBanner/ImageBanner.js +71 -155
- package/dist/lib/components/Instructions/Instructions.css +1 -790
- 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.css +1 -0
- 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.css +1 -80
- 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.css +1 -53
- 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.css +1 -80
- 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.css +1 -156
- 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.css +1 -17
- 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.css +1 -41
- 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.css +1 -42
- 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.css +1 -346
- 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.css +1 -327
- 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.css +1 -157
- 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.css +1 -25
- 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.css +1 -27
- 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.css +1 -10
- 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.css +1 -29
- 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.css +1 -31
- 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.css +1 -225
- 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.css +1 -106
- 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 +89 -92
- package/CHANGELOG.md +0 -3984
- package/dist/es/components/NotificationBox/style/NotificationBox.css +0 -28
- 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/lib/components/NotificationBox/style/NotificationBox.css +0 -28
- 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
@@ -1,5 +1,6 @@
|
|
1
|
-
import
|
2
|
-
import '
|
1
|
+
import * as React from 'react';
|
2
|
+
import { PriceBadge } from '@megafon/ui-core';
|
3
|
+
import './ImageBanner.scss';
|
3
4
|
export declare const BackgroundColor: {
|
4
5
|
readonly TRANSPARENT: "transparent";
|
5
6
|
readonly GREEN: "green";
|
@@ -8,23 +9,28 @@ export declare const BackgroundColor: {
|
|
8
9
|
readonly GRADIENT: "gradient";
|
9
10
|
readonly LIGHT: "light";
|
10
11
|
};
|
11
|
-
export
|
12
|
+
export type BackgroundColorType = (typeof BackgroundColor)[keyof typeof BackgroundColor];
|
12
13
|
export declare const Radius: {
|
13
14
|
readonly CORNERS: "corners";
|
14
15
|
readonly ROUNDED: "rounded";
|
15
16
|
};
|
16
|
-
export
|
17
|
+
export type RadiusType = (typeof Radius)[keyof typeof Radius];
|
17
18
|
export declare const NavTheme: {
|
18
19
|
readonly LIGHT: "light";
|
19
20
|
readonly DARK: "dark";
|
20
21
|
};
|
21
|
-
export
|
22
|
+
export type NavThemeType = (typeof NavTheme)[keyof typeof NavTheme];
|
22
23
|
export declare const ImageVerticalAlign: {
|
23
24
|
readonly TOP: "top";
|
24
25
|
readonly CENTER: "center";
|
25
26
|
readonly BOTTOM: "bottom";
|
26
27
|
};
|
27
|
-
export
|
28
|
+
export type ImageVerticalAlignType = (typeof ImageVerticalAlign)[keyof typeof ImageVerticalAlign];
|
29
|
+
type PriceBadgeTypes = React.ComponentProps<typeof PriceBadge>;
|
30
|
+
export type PriceBadgePropsType = Pick<PriceBadgeTypes, 'iconType'> & {
|
31
|
+
/** Текст бейджа */
|
32
|
+
text: string;
|
33
|
+
};
|
28
34
|
export interface IImageBannerProps {
|
29
35
|
/** Дополнительные data атрибуты к внутренним элементам */
|
30
36
|
dataAttrs?: {
|
@@ -37,26 +43,22 @@ export interface IImageBannerProps {
|
|
37
43
|
classes?: {
|
38
44
|
root?: string;
|
39
45
|
image?: string;
|
40
|
-
imageSource?: string;
|
41
46
|
title?: string;
|
42
47
|
description?: string;
|
43
48
|
cost?: string;
|
44
49
|
badgesContainer?: string;
|
45
50
|
badges?: string;
|
51
|
+
badge?: string;
|
46
52
|
adBlock?: string;
|
47
53
|
};
|
48
54
|
/** Ссылка на корневой элемент */
|
49
|
-
rootRef?: Ref<HTMLDivElement>;
|
55
|
+
rootRef?: React.Ref<HTMLDivElement>;
|
50
56
|
/** Заголовок */
|
51
|
-
title
|
57
|
+
title: string | React.ReactNode | React.ReactNode[];
|
52
58
|
/** Текст-описание */
|
53
59
|
description?: string | React.ReactNode | React.ReactNode[];
|
54
60
|
/** Строка со стоимостью услуги */
|
55
61
|
cost?: string;
|
56
|
-
/** Тег заголовка на разрешении экрана 0-767 */
|
57
|
-
headerLevelMobile?: 'h1' | 'h2';
|
58
|
-
/** Тег заголовка на разрешении экрана 768+ */
|
59
|
-
headerLevel?: 'h1' | 'h2';
|
60
62
|
/** Фоновый цвет */
|
61
63
|
backgroundColor?: BackgroundColorType;
|
62
64
|
/** Радиус границы */
|
@@ -77,10 +79,12 @@ export interface IImageBannerProps {
|
|
77
79
|
autoHeight?: boolean;
|
78
80
|
/** Изображение растягивается на всю ширину или вписывается в фиксированный фрейм (по умолчанию фрейм) */
|
79
81
|
isImageFullWidth?: boolean;
|
80
|
-
/**
|
81
|
-
badges?:
|
82
|
+
/** Данные для блока с бейджами */
|
83
|
+
badges?: PriceBadgePropsType[];
|
84
|
+
/** Дополнительный отступ снизу при использовании в баннере */
|
85
|
+
hasBottomOffset?: boolean;
|
82
86
|
/** Элемент блока с рекламой */
|
83
|
-
adBlock?: JSX.Element
|
87
|
+
adBlock?: JSX.Element;
|
84
88
|
}
|
85
|
-
declare const ImageBanner: React.FC<IImageBannerProps
|
89
|
+
declare const ImageBanner: React.FC<React.PropsWithChildren<IImageBannerProps>>;
|
86
90
|
export default ImageBanner;
|
@@ -1,13 +1,11 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
2
|
import "core-js/modules/es.symbol.js";
|
4
3
|
import "core-js/modules/es.symbol.description.js";
|
5
4
|
import "core-js/modules/es.array.concat.js";
|
6
|
-
import "core-js/modules/es.
|
7
|
-
import React from 'react';
|
8
|
-
import { Header } from '@megafon/ui-core';
|
5
|
+
import "core-js/modules/es.array.map.js";
|
6
|
+
import * as React from 'react';
|
7
|
+
import { Header, PriceBadge } from '@megafon/ui-core';
|
9
8
|
import { breakpoints, cnCreate, filterDataAttrs, convert, titleConvertConfig } from '@megafon/ui-helpers';
|
10
|
-
import * as PropTypes from 'prop-types';
|
11
9
|
import "./ImageBanner.css";
|
12
10
|
export var BackgroundColor = {
|
13
11
|
TRANSPARENT: 'transparent',
|
@@ -30,18 +28,15 @@ export var ImageVerticalAlign = {
|
|
30
28
|
CENTER: 'center',
|
31
29
|
BOTTOM: 'bottom'
|
32
30
|
};
|
33
|
-
|
34
31
|
var getTheme = function getTheme(backgrounColor) {
|
35
32
|
switch (backgrounColor) {
|
36
33
|
case BackgroundColor.GREEN:
|
37
34
|
case BackgroundColor.PURPLE:
|
38
35
|
return NavTheme.LIGHT;
|
39
|
-
|
40
36
|
default:
|
41
37
|
return NavTheme.DARK;
|
42
38
|
}
|
43
39
|
};
|
44
|
-
|
45
40
|
var cn = cnCreate('mfui-image-banner');
|
46
41
|
var typographyConfig = {
|
47
42
|
b: {
|
@@ -55,67 +50,53 @@ var typographyConfig = {
|
|
55
50
|
}
|
56
51
|
}
|
57
52
|
};
|
58
|
-
|
59
53
|
var ImageBanner = function ImageBanner(_ref2) {
|
60
54
|
var dataAttrs = _ref2.dataAttrs,
|
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
|
-
_ref2$children = _ref2.children,
|
93
|
-
children = _ref2$children === void 0 ? [] : _ref2$children;
|
94
|
-
|
95
|
-
var _React$useState = React.useState(false),
|
96
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
97
|
-
isMobile = _React$useState2[0],
|
98
|
-
setIsMobile = _React$useState2[1];
|
99
|
-
|
100
|
-
React.useEffect(function () {
|
101
|
-
var mediaQuery = window.matchMedia("(max-width: ".concat(breakpoints.MOBILE_MIDDLE_END, "px)"));
|
102
|
-
|
103
|
-
var handleMediaChange = function handleMediaChange(_ref3) {
|
104
|
-
var matches = _ref3.matches;
|
105
|
-
setIsMobile(matches);
|
106
|
-
};
|
107
|
-
|
108
|
-
setIsMobile(mediaQuery.matches);
|
109
|
-
mediaQuery.addEventListener('change', handleMediaChange);
|
110
|
-
return function () {
|
111
|
-
mediaQuery.removeEventListener('change', handleMediaChange);
|
112
|
-
};
|
113
|
-
}, []);
|
55
|
+
className = _ref2.className,
|
56
|
+
_ref2$classes = _ref2.classes,
|
57
|
+
classes = _ref2$classes === void 0 ? {} : _ref2$classes,
|
58
|
+
rootRef = _ref2.rootRef,
|
59
|
+
_ref2$imageMobile = _ref2.imageMobile,
|
60
|
+
imageMobile = _ref2$imageMobile === void 0 ? '' : _ref2$imageMobile,
|
61
|
+
_ref2$imageMobile2x = _ref2.imageMobile2x,
|
62
|
+
imageMobile2x = _ref2$imageMobile2x === void 0 ? '' : _ref2$imageMobile2x,
|
63
|
+
_ref2$imageDesktop = _ref2.imageDesktop,
|
64
|
+
imageDesktop = _ref2$imageDesktop === void 0 ? '' : _ref2$imageDesktop,
|
65
|
+
_ref2$imageDesktop2x = _ref2.imageDesktop2x,
|
66
|
+
imageDesktop2x = _ref2$imageDesktop2x === void 0 ? '' : _ref2$imageDesktop2x,
|
67
|
+
_ref2$imageAlt = _ref2.imageAlt,
|
68
|
+
imageAlt = _ref2$imageAlt === void 0 ? '' : _ref2$imageAlt,
|
69
|
+
_ref2$imageVerticalAl = _ref2.imageVerticalAlign,
|
70
|
+
imageVerticalAlign = _ref2$imageVerticalAl === void 0 ? ImageVerticalAlign.CENTER : _ref2$imageVerticalAl,
|
71
|
+
title = _ref2.title,
|
72
|
+
description = _ref2.description,
|
73
|
+
cost = _ref2.cost,
|
74
|
+
_ref2$backgroundColor = _ref2.backgroundColor,
|
75
|
+
backgroundColor = _ref2$backgroundColor === void 0 ? BackgroundColor.TRANSPARENT : _ref2$backgroundColor,
|
76
|
+
_ref2$radius = _ref2.radius,
|
77
|
+
radius = _ref2$radius === void 0 ? Radius.CORNERS : _ref2$radius,
|
78
|
+
autoHeight = _ref2.autoHeight,
|
79
|
+
isImageFullWidth = _ref2.isImageFullWidth,
|
80
|
+
_ref2$badges = _ref2.badges,
|
81
|
+
badges = _ref2$badges === void 0 ? [] : _ref2$badges,
|
82
|
+
hasBottomOffset = _ref2.hasBottomOffset,
|
83
|
+
adBlock = _ref2.adBlock,
|
84
|
+
_ref2$children = _ref2.children,
|
85
|
+
children = _ref2$children === void 0 ? [] : _ref2$children;
|
114
86
|
var navTheme = getTheme(backgroundColor);
|
115
87
|
var hasImage = !!(imageMobile || imageMobile2x || imageDesktop || imageDesktop2x);
|
116
|
-
var renderBadges = !!badges && /*#__PURE__*/React.createElement("div", {
|
88
|
+
var renderBadges = !!badges.length && /*#__PURE__*/React.createElement("div", {
|
117
89
|
className: cn('badges', [classes.badges])
|
118
|
-
}, badges)
|
90
|
+
}, badges.map(function (_ref3) {
|
91
|
+
var text = _ref3.text,
|
92
|
+
iconType = _ref3.iconType;
|
93
|
+
return /*#__PURE__*/React.createElement(PriceBadge, {
|
94
|
+
className: classes.badge,
|
95
|
+
theme: navTheme,
|
96
|
+
iconType: iconType,
|
97
|
+
key: text
|
98
|
+
}, text);
|
99
|
+
}));
|
119
100
|
var renderAdBlock = !!adBlock && /*#__PURE__*/React.createElement("div", {
|
120
101
|
className: cn('ad-block', [classes.adBlock])
|
121
102
|
}, adBlock);
|
@@ -125,8 +106,7 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
125
106
|
className: cn('badges-container', [classes.badgesContainer])
|
126
107
|
}, renderBadges, renderAdBlock), !!title && /*#__PURE__*/React.createElement(Header, {
|
127
108
|
className: cn('title', [classes.title]),
|
128
|
-
color: "inherit"
|
129
|
-
as: isMobile ? headerLevelMobile : headerLevel
|
109
|
+
color: "inherit"
|
130
110
|
}, typeof title === 'string' ? convert(title, titleConvertConfig) : title), !!description && /*#__PURE__*/React.createElement(Header, {
|
131
111
|
className: cn('description', [classes.description]),
|
132
112
|
as: "h5",
|
@@ -141,11 +121,10 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
141
121
|
'v-align': imageVerticalAlign
|
142
122
|
})
|
143
123
|
}, /*#__PURE__*/React.createElement("source", {
|
144
|
-
className: classes.imageSource,
|
145
124
|
media: "(min-width: ".concat(breakpoints.DESKTOP_SMALL_START, "px)"),
|
146
125
|
srcSet: "".concat(imageDesktop, ", ").concat(imageDesktop2x, " 2x")
|
147
126
|
}), /*#__PURE__*/React.createElement("img", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image), {
|
148
|
-
className: cn('image', [classes.image]),
|
127
|
+
className: cn('background-image', [classes.image]),
|
149
128
|
src: imageMobile || imageMobile2x,
|
150
129
|
srcSet: imageMobile2x ? "".concat(imageMobile2x, " 2x") : undefined,
|
151
130
|
alt: imageAlt
|
@@ -157,49 +136,12 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
157
136
|
'has-image': hasImage,
|
158
137
|
'auto-height': autoHeight,
|
159
138
|
'full-width': isImageFullWidth,
|
139
|
+
'bottom-offset': hasBottomOffset && !hasImage,
|
160
140
|
radius: radius
|
161
141
|
}, [className, classes.root]),
|
162
142
|
ref: rootRef
|
163
|
-
}),
|
164
|
-
|
165
|
-
|
166
|
-
ImageBanner.propTypes = {
|
167
|
-
dataAttrs: PropTypes.shape({
|
168
|
-
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
169
|
-
image: PropTypes.objectOf(PropTypes.string.isRequired)
|
170
|
-
}),
|
171
|
-
className: PropTypes.string,
|
172
|
-
classes: PropTypes.shape({
|
173
|
-
root: PropTypes.string,
|
174
|
-
image: PropTypes.string,
|
175
|
-
imageSource: PropTypes.string,
|
176
|
-
title: PropTypes.string,
|
177
|
-
description: PropTypes.string,
|
178
|
-
cost: PropTypes.string,
|
179
|
-
badgesContainer: PropTypes.string,
|
180
|
-
badges: PropTypes.string,
|
181
|
-
badge: PropTypes.string,
|
182
|
-
adBlock: PropTypes.string
|
183
|
-
}),
|
184
|
-
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
185
|
-
current: PropTypes.elementType
|
186
|
-
}), PropTypes.any])]),
|
187
|
-
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
188
|
-
description: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
189
|
-
cost: PropTypes.string,
|
190
|
-
headerLevelMobile: PropTypes.oneOf(['h1', 'h2']),
|
191
|
-
headerLevel: PropTypes.oneOf(['h1', 'h2']),
|
192
|
-
backgroundColor: PropTypes.oneOf(Object.values(BackgroundColor)),
|
193
|
-
radius: PropTypes.oneOf(Object.values(Radius)),
|
194
|
-
imageMobile: PropTypes.string,
|
195
|
-
imageMobile2x: PropTypes.string,
|
196
|
-
imageDesktop: PropTypes.string,
|
197
|
-
imageDesktop2x: PropTypes.string,
|
198
|
-
imageAlt: PropTypes.string,
|
199
|
-
imageVerticalAlign: PropTypes.oneOf(Object.values(ImageVerticalAlign)),
|
200
|
-
autoHeight: PropTypes.bool,
|
201
|
-
isImageFullWidth: PropTypes.bool,
|
202
|
-
badges: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element]),
|
203
|
-
adBlock: PropTypes.element
|
143
|
+
}), /*#__PURE__*/React.createElement("div", {
|
144
|
+
className: cn('wrapper')
|
145
|
+
}, renderContent, hasImage && renderImage));
|
204
146
|
};
|
205
147
|
export default ImageBanner;
|