@megafon/ui-shared 2.0.0-beta.24 → 2.0.0-beta.240
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 +2292 -0
- package/README.md +0 -5
- package/dist/es/components/AccordionBox/AccordionBox.css +13 -0
- package/dist/es/components/AccordionBox/AccordionBox.d.ts +33 -0
- package/dist/es/components/AccordionBox/AccordionBox.js +62 -0
- package/dist/es/components/BannerBox/BannerBox.d.ts +5 -0
- package/dist/es/components/BannerBox/BannerBox.js +31 -0
- package/dist/es/components/BenefitsIcons/BenefitsIcons.d.ts +16 -5
- package/dist/es/components/BenefitsIcons/BenefitsIcons.js +79 -14
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.d.ts +3 -2
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.js +13 -12
- package/dist/es/components/BenefitsIcons/style/BenefitsIcons.css +1 -1
- package/dist/es/components/BenefitsIcons/style/BenefitsIconsTile.css +11 -4
- package/dist/es/components/BenefitsIcons/types.d.ts +16 -7
- package/dist/es/components/BenefitsIcons/types.js +9 -7
- package/dist/es/components/BenefitsPictures/BenefitsPictures.d.ts +12 -3
- package/dist/es/components/BenefitsPictures/BenefitsPictures.js +25 -11
- package/dist/es/components/BenefitsPictures/BenfitsPictures.css +1 -1
- package/dist/es/components/BenefitsPictures/types.d.ts +3 -0
- 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.d.ts +32 -8
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +45 -10
- package/dist/es/components/Card/Card.css +130 -0
- package/dist/es/components/Card/Card.d.ts +67 -0
- package/dist/es/components/Card/Card.js +176 -0
- package/dist/es/components/CardsBox/CardsBox.d.ts +15 -0
- package/dist/es/components/CardsBox/CardsBox.js +80 -0
- package/dist/es/components/CarouselBox/CarouselBox.d.ts +5 -0
- package/dist/es/components/CarouselBox/CarouselBox.js +31 -0
- package/dist/es/components/Container/Container.css +2830 -0
- package/dist/es/components/Container/Container.d.ts +26 -0
- package/dist/es/components/Container/Container.js +46 -0
- package/dist/es/components/DownloadLinks/DownloadLink.css +36 -0
- package/dist/es/components/DownloadLinks/DownloadLink.d.ts +25 -0
- package/dist/es/components/DownloadLinks/DownloadLink.js +62 -0
- package/dist/es/components/DownloadLinks/DownloadLinks.css +36 -0
- package/dist/es/components/DownloadLinks/DownloadLinks.d.ts +10 -0
- package/dist/es/components/DownloadLinks/DownloadLinks.js +75 -0
- package/dist/es/components/Instructions/Instructions.css +489 -0
- package/dist/es/components/Instructions/Instructions.d.ts +52 -0
- package/dist/es/components/Instructions/Instructions.js +229 -0
- package/dist/es/components/Instructions/img/android.png +0 -0
- package/dist/es/components/Instructions/img/blackIphone.png +0 -0
- package/dist/es/components/Instructions/img/iphone12.png +0 -0
- package/dist/es/components/Instructions/img/laptop.png +0 -0
- package/dist/es/components/Instructions/img/newIphone.png +0 -0
- package/dist/es/components/Instructions/img/whiteIphone.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 +53 -0
- package/dist/es/components/Partners/Partners.d.ts +32 -0
- package/dist/es/components/Partners/Partners.js +114 -0
- package/dist/es/components/PictureWithDescription/PictureWithDescription.css +80 -0
- package/dist/es/components/PictureWithDescription/PictureWithDescription.d.ts +28 -0
- package/dist/es/components/PictureWithDescription/PictureWithDescription.js +61 -0
- package/dist/es/components/Property/Property.css +125 -0
- package/dist/es/components/Property/Property.d.ts +33 -0
- package/dist/es/components/Property/Property.js +130 -0
- package/dist/es/components/Property/PropertyDescription.css +17 -0
- package/dist/es/components/Property/PropertyDescription.d.ts +5 -0
- package/dist/es/components/Property/PropertyDescription.js +51 -0
- package/dist/es/components/Property/types.d.ts +14 -0
- package/dist/es/components/Property/types.js +0 -0
- 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 +153 -0
- package/dist/es/components/Table/Table.d.ts +14 -0
- package/dist/es/components/Table/Table.js +124 -0
- package/dist/es/components/Table/TableCell.d.ts +6 -0
- package/dist/es/components/Table/TableCell.js +12 -0
- package/dist/es/components/Table/TableRow.d.ts +9 -0
- package/dist/es/components/Table/TableRow.js +13 -0
- package/dist/es/components/TabsBox/TabBox.d.ts +2 -0
- package/dist/es/components/TabsBox/TabBox.js +2 -0
- package/dist/es/components/TabsBox/TabsBox.d.ts +8 -0
- package/dist/es/components/TabsBox/TabsBox.js +32 -0
- package/dist/es/components/TextBox/TextBox.css +16 -0
- package/dist/es/components/TextBox/TextBox.d.ts +16 -0
- package/dist/es/components/TextBox/TextBox.js +53 -0
- 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 +31 -0
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.css +11 -0
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +13 -7
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.js +33 -13
- package/dist/es/components/VideoBanner/VideoBanner.css +216 -0
- package/dist/es/components/VideoBanner/VideoBanner.d.ts +90 -0
- package/dist/es/components/VideoBanner/VideoBanner.js +272 -0
- package/dist/es/components/VideoBlock/VideoBlock.css +127 -0
- package/dist/es/components/VideoBlock/VideoBlock.d.ts +49 -0
- package/dist/es/components/VideoBlock/VideoBlock.js +147 -0
- package/dist/es/constants/throttleTime.d.ts +4 -0
- package/dist/es/constants/throttleTime.js +3 -0
- package/dist/es/index.d.ts +29 -17
- package/dist/es/index.js +30 -18
- package/dist/lib/components/AccordionBox/AccordionBox.css +13 -0
- package/dist/lib/components/AccordionBox/AccordionBox.d.ts +33 -0
- package/dist/lib/components/AccordionBox/AccordionBox.js +80 -0
- package/dist/lib/components/BannerBox/BannerBox.d.ts +5 -0
- package/dist/lib/components/BannerBox/BannerBox.js +49 -0
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.d.ts +16 -5
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +82 -17
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.d.ts +3 -2
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.js +14 -15
- package/dist/lib/components/BenefitsIcons/style/BenefitsIcons.css +1 -1
- package/dist/lib/components/BenefitsIcons/style/BenefitsIconsTile.css +11 -4
- package/dist/lib/components/BenefitsIcons/types.d.ts +16 -7
- package/dist/lib/components/BenefitsIcons/types.js +11 -8
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.d.ts +12 -3
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.js +27 -13
- package/dist/lib/components/BenefitsPictures/BenfitsPictures.css +1 -1
- package/dist/lib/components/BenefitsPictures/types.d.ts +3 -0
- 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.d.ts +32 -8
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +53 -13
- package/dist/lib/components/Card/Card.css +130 -0
- package/dist/lib/components/Card/Card.d.ts +67 -0
- package/dist/lib/components/Card/Card.js +199 -0
- package/dist/lib/components/CardsBox/CardsBox.d.ts +15 -0
- package/dist/lib/components/CardsBox/CardsBox.js +105 -0
- package/dist/lib/components/CarouselBox/CarouselBox.d.ts +5 -0
- package/dist/lib/components/CarouselBox/CarouselBox.js +49 -0
- package/dist/lib/components/Container/Container.css +2830 -0
- package/dist/lib/components/Container/Container.d.ts +26 -0
- package/dist/lib/components/Container/Container.js +61 -0
- package/dist/lib/components/DownloadLinks/DownloadLink.css +36 -0
- package/dist/lib/components/DownloadLinks/DownloadLink.d.ts +25 -0
- package/dist/lib/components/DownloadLinks/DownloadLink.js +83 -0
- package/dist/lib/components/DownloadLinks/DownloadLinks.css +36 -0
- package/dist/lib/components/DownloadLinks/DownloadLinks.d.ts +10 -0
- package/dist/lib/components/DownloadLinks/DownloadLinks.js +95 -0
- package/dist/lib/components/Instructions/Instructions.css +489 -0
- package/dist/lib/components/Instructions/Instructions.d.ts +52 -0
- package/dist/lib/components/Instructions/Instructions.js +258 -0
- package/dist/lib/components/Instructions/img/android.png +0 -0
- package/dist/lib/components/Instructions/img/blackIphone.png +0 -0
- package/dist/lib/components/Instructions/img/iphone12.png +0 -0
- package/dist/lib/components/Instructions/img/laptop.png +0 -0
- package/dist/lib/components/Instructions/img/newIphone.png +0 -0
- package/dist/lib/components/Instructions/img/whiteIphone.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 +53 -0
- package/dist/lib/components/Partners/Partners.d.ts +32 -0
- package/dist/lib/components/Partners/Partners.js +136 -0
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.css +80 -0
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.d.ts +28 -0
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.js +81 -0
- package/dist/lib/components/Property/Property.css +125 -0
- package/dist/lib/components/Property/Property.d.ts +33 -0
- package/dist/lib/components/Property/Property.js +152 -0
- package/dist/lib/components/Property/PropertyDescription.css +17 -0
- package/dist/lib/components/Property/PropertyDescription.d.ts +5 -0
- package/dist/lib/components/Property/PropertyDescription.js +71 -0
- package/dist/lib/components/Property/types.d.ts +14 -0
- package/dist/lib/components/Property/types.js +1 -0
- 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 +153 -0
- package/dist/lib/components/Table/Table.d.ts +14 -0
- package/dist/lib/components/Table/Table.js +146 -0
- package/dist/lib/components/Table/TableCell.d.ts +6 -0
- package/dist/lib/components/Table/TableCell.js +27 -0
- package/dist/lib/components/Table/TableRow.d.ts +9 -0
- package/dist/lib/components/Table/TableRow.js +28 -0
- package/dist/lib/components/TabsBox/TabBox.d.ts +2 -0
- package/dist/lib/components/TabsBox/TabBox.js +11 -0
- package/dist/lib/components/TabsBox/TabsBox.d.ts +8 -0
- package/dist/lib/components/TabsBox/TabsBox.js +50 -0
- package/dist/lib/components/TextBox/TextBox.css +16 -0
- package/dist/lib/components/TextBox/TextBox.d.ts +16 -0
- package/dist/lib/components/TextBox/TextBox.js +70 -0
- 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 +48 -0
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.css +11 -0
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +13 -7
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.js +37 -17
- package/dist/lib/components/VideoBanner/VideoBanner.css +216 -0
- package/dist/lib/components/VideoBanner/VideoBanner.d.ts +90 -0
- package/dist/lib/components/VideoBanner/VideoBanner.js +309 -0
- package/dist/lib/components/VideoBlock/VideoBlock.css +127 -0
- package/dist/lib/components/VideoBlock/VideoBlock.d.ts +49 -0
- package/dist/lib/components/VideoBlock/VideoBlock.js +170 -0
- package/dist/lib/constants/throttleTime.d.ts +4 -0
- package/dist/lib/constants/throttleTime.js +10 -0
- package/dist/lib/index.d.ts +29 -17
- package/dist/lib/index.js +147 -51
- package/package.json +22 -77
- package/dist/es/components/ProductCard/ProductCardFeatures.css +0 -35
- package/dist/es/components/ProductCard/ProductCardFeatures.d.ts +0 -61
- package/dist/es/components/ProductCard/ProductCardFeatures.js +0 -82
- package/dist/es/components/ProductCard/ProductCardFeaturesBottom.css +0 -41
- package/dist/es/components/ProductCard/ProductCardFeaturesBottom.d.ts +0 -22
- package/dist/es/components/ProductCard/ProductCardFeaturesBottom.js +0 -80
- package/dist/es/components/ProductCard/ProductCardFeaturesTop.css +0 -16
- package/dist/es/components/ProductCard/ProductCardFeaturesTop.d.ts +0 -25
- package/dist/es/components/ProductCard/ProductCardFeaturesTop.js +0 -67
- package/dist/es/components/ProductCard/ProductCardInfo.css +0 -236
- package/dist/es/components/ProductCard/ProductCardInfo.d.ts +0 -75
- package/dist/es/components/ProductCard/ProductCardInfo.js +0 -169
- package/dist/es/components/ProductCard/ProductCardTotal.css +0 -113
- package/dist/es/components/ProductCard/ProductCardTotal.d.ts +0 -86
- package/dist/es/components/ProductCard/ProductCardTotal.js +0 -161
- package/dist/es/components/ProductCard/ProductCardWrapper.css +0 -162
- package/dist/es/components/ProductCard/ProductCardWrapper.d.ts +0 -53
- package/dist/es/components/ProductCard/ProductCardWrapper.js +0 -109
- package/dist/es/components/ProductSwitcher/ProductSwitcher.css +0 -372
- package/dist/es/components/ProductSwitcher/ProductSwitcher.d.ts +0 -86
- package/dist/es/components/ProductSwitcher/ProductSwitcher.js +0 -612
- package/dist/es/components/ProductTile/ProductTile.d.ts +0 -287
- package/dist/es/components/ProductTile/ProductTile.js +0 -497
- package/dist/es/components/ProductTile/ProductTileBuy.d.ts +0 -53
- package/dist/es/components/ProductTile/ProductTileBuy.js +0 -99
- package/dist/es/components/ProductTile/ProductTileCashback.d.ts +0 -20
- package/dist/es/components/ProductTile/ProductTileCashback.js +0 -60
- package/dist/es/components/ProductTile/ProductTileDynamic.d.ts +0 -42
- package/dist/es/components/ProductTile/ProductTileDynamic.js +0 -109
- package/dist/es/components/ProductTile/ProductTileHint.d.ts +0 -24
- package/dist/es/components/ProductTile/ProductTileHint.js +0 -67
- package/dist/es/components/ProductTile/ProductTileOptions.d.ts +0 -31
- package/dist/es/components/ProductTile/ProductTileOptions.js +0 -130
- package/dist/es/components/ProductTile/ProductTilePrice.d.ts +0 -26
- package/dist/es/components/ProductTile/ProductTilePrice.js +0 -75
- package/dist/es/components/ProductTile/ProductTileStatic.d.ts +0 -20
- package/dist/es/components/ProductTile/ProductTileStatic.js +0 -60
- package/dist/es/components/ProductTile/ProductTileValue.d.ts +0 -31
- package/dist/es/components/ProductTile/ProductTileValue.js +0 -111
- package/dist/es/components/ProductTile/style/ProductTile.css +0 -146
- package/dist/es/components/ProductTile/style/ProductTileBuy.css +0 -76
- package/dist/es/components/ProductTile/style/ProductTileCashback.css +0 -23
- package/dist/es/components/ProductTile/style/ProductTileDynamic.css +0 -38
- package/dist/es/components/ProductTile/style/ProductTileHint.css +0 -93
- package/dist/es/components/ProductTile/style/ProductTileOptions.css +0 -84
- package/dist/es/components/ProductTile/style/ProductTilePrice.css +0 -105
- package/dist/es/components/ProductTile/style/ProductTileStatic.css +0 -23
- package/dist/es/components/ProductTile/style/ProductTileValue.css +0 -58
- package/dist/es/components/ProductTileRest/ProductTileRest.css +0 -226
- package/dist/es/components/ProductTileRest/ProductTileRest.d.ts +0 -109
- package/dist/es/components/ProductTileRest/ProductTileRest.js +0 -291
- package/dist/es/constants/breakpoints.d.ts +0 -1
- package/dist/es/constants/breakpoints.js +0 -1
- package/dist/lib/components/ProductCard/ProductCardFeatures.css +0 -35
- package/dist/lib/components/ProductCard/ProductCardFeatures.d.ts +0 -61
- package/dist/lib/components/ProductCard/ProductCardFeatures.js +0 -141
- package/dist/lib/components/ProductCard/ProductCardFeaturesBottom.css +0 -41
- package/dist/lib/components/ProductCard/ProductCardFeaturesBottom.d.ts +0 -22
- package/dist/lib/components/ProductCard/ProductCardFeaturesBottom.js +0 -140
- package/dist/lib/components/ProductCard/ProductCardFeaturesTop.css +0 -16
- package/dist/lib/components/ProductCard/ProductCardFeaturesTop.d.ts +0 -25
- package/dist/lib/components/ProductCard/ProductCardFeaturesTop.js +0 -124
- package/dist/lib/components/ProductCard/ProductCardInfo.css +0 -236
- package/dist/lib/components/ProductCard/ProductCardInfo.d.ts +0 -75
- package/dist/lib/components/ProductCard/ProductCardInfo.js +0 -241
- package/dist/lib/components/ProductCard/ProductCardTotal.css +0 -113
- package/dist/lib/components/ProductCard/ProductCardTotal.d.ts +0 -86
- package/dist/lib/components/ProductCard/ProductCardTotal.js +0 -218
- package/dist/lib/components/ProductCard/ProductCardWrapper.css +0 -162
- package/dist/lib/components/ProductCard/ProductCardWrapper.d.ts +0 -53
- package/dist/lib/components/ProductCard/ProductCardWrapper.js +0 -170
- package/dist/lib/components/ProductSwitcher/ProductSwitcher.css +0 -372
- package/dist/lib/components/ProductSwitcher/ProductSwitcher.d.ts +0 -86
- package/dist/lib/components/ProductSwitcher/ProductSwitcher.js +0 -686
- package/dist/lib/components/ProductTile/ProductTile.d.ts +0 -287
- package/dist/lib/components/ProductTile/ProductTile.js +0 -590
- package/dist/lib/components/ProductTile/ProductTileBuy.d.ts +0 -53
- package/dist/lib/components/ProductTile/ProductTileBuy.js +0 -156
- package/dist/lib/components/ProductTile/ProductTileCashback.d.ts +0 -20
- package/dist/lib/components/ProductTile/ProductTileCashback.js +0 -117
- package/dist/lib/components/ProductTile/ProductTileDynamic.d.ts +0 -42
- package/dist/lib/components/ProductTile/ProductTileDynamic.js +0 -174
- package/dist/lib/components/ProductTile/ProductTileHint.d.ts +0 -24
- package/dist/lib/components/ProductTile/ProductTileHint.js +0 -124
- package/dist/lib/components/ProductTile/ProductTileOptions.d.ts +0 -31
- package/dist/lib/components/ProductTile/ProductTileOptions.js +0 -193
- package/dist/lib/components/ProductTile/ProductTilePrice.d.ts +0 -26
- package/dist/lib/components/ProductTile/ProductTilePrice.js +0 -136
- package/dist/lib/components/ProductTile/ProductTileStatic.d.ts +0 -20
- package/dist/lib/components/ProductTile/ProductTileStatic.js +0 -123
- package/dist/lib/components/ProductTile/ProductTileValue.d.ts +0 -31
- package/dist/lib/components/ProductTile/ProductTileValue.js +0 -171
- package/dist/lib/components/ProductTile/style/ProductTile.css +0 -146
- package/dist/lib/components/ProductTile/style/ProductTileBuy.css +0 -76
- package/dist/lib/components/ProductTile/style/ProductTileCashback.css +0 -23
- package/dist/lib/components/ProductTile/style/ProductTileDynamic.css +0 -38
- package/dist/lib/components/ProductTile/style/ProductTileHint.css +0 -93
- package/dist/lib/components/ProductTile/style/ProductTileOptions.css +0 -84
- package/dist/lib/components/ProductTile/style/ProductTilePrice.css +0 -105
- package/dist/lib/components/ProductTile/style/ProductTileStatic.css +0 -23
- package/dist/lib/components/ProductTile/style/ProductTileValue.css +0 -58
- package/dist/lib/components/ProductTileRest/ProductTileRest.css +0 -226
- package/dist/lib/components/ProductTileRest/ProductTileRest.d.ts +0 -109
- package/dist/lib/components/ProductTileRest/ProductTileRest.js +0 -364
- package/dist/lib/constants/breakpoints.d.ts +0 -1
- package/dist/lib/constants/breakpoints.js +0 -8
@@ -0,0 +1,309 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
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
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports["default"] = exports.TextColor = exports.ButtonColor = exports.VideoType = exports.ClassName = void 0;
|
9
|
+
|
10
|
+
require("core-js/modules/es.symbol");
|
11
|
+
|
12
|
+
require("core-js/modules/es.symbol.description");
|
13
|
+
|
14
|
+
require("core-js/modules/es.array.concat");
|
15
|
+
|
16
|
+
require("core-js/modules/es.object.values");
|
17
|
+
|
18
|
+
require("core-js/modules/es.string.link");
|
19
|
+
|
20
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
21
|
+
|
22
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
23
|
+
|
24
|
+
var _react = _interopRequireDefault(require("react"));
|
25
|
+
|
26
|
+
var PropTypes = _interopRequireWildcard(require("prop-types"));
|
27
|
+
|
28
|
+
var _lodash = _interopRequireDefault(require("lodash.throttle"));
|
29
|
+
|
30
|
+
var _uiCore = require("@megafon/ui-core");
|
31
|
+
|
32
|
+
var _uiHelpers = require("@megafon/ui-helpers");
|
33
|
+
|
34
|
+
var _Breadcrumbs = _interopRequireDefault(require("../Breadcrumbs/Breadcrumbs"));
|
35
|
+
|
36
|
+
var _throttleTime = _interopRequireDefault(require("../../constants/throttleTime"));
|
37
|
+
|
38
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
39
|
+
|
40
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
41
|
+
|
42
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
43
|
+
|
44
|
+
var ClassName;
|
45
|
+
exports.ClassName = ClassName;
|
46
|
+
|
47
|
+
(function (ClassName) {
|
48
|
+
ClassName["BUTTON"] = "button";
|
49
|
+
ClassName["LINK"] = "link";
|
50
|
+
})(ClassName || (exports.ClassName = ClassName = {}));
|
51
|
+
|
52
|
+
var typographyConfig = {
|
53
|
+
b: {
|
54
|
+
component: function component(_ref) {
|
55
|
+
var children = _ref.children;
|
56
|
+
return /*#__PURE__*/_react["default"].createElement(_uiCore.Header, {
|
57
|
+
className: cn('value'),
|
58
|
+
as: "h3",
|
59
|
+
color: "inherit"
|
60
|
+
}, children);
|
61
|
+
}
|
62
|
+
}
|
63
|
+
};
|
64
|
+
var VideoType = {
|
65
|
+
YOUTUBE: 'youtube',
|
66
|
+
VIDEO: 'video'
|
67
|
+
};
|
68
|
+
exports.VideoType = VideoType;
|
69
|
+
var ButtonColor = {
|
70
|
+
GREEN: 'green',
|
71
|
+
PURPLE: 'purple'
|
72
|
+
};
|
73
|
+
exports.ButtonColor = ButtonColor;
|
74
|
+
var TextColor = {
|
75
|
+
BLACK: 'black',
|
76
|
+
WHITE: 'white'
|
77
|
+
};
|
78
|
+
exports.TextColor = TextColor;
|
79
|
+
var cn = (0, _uiHelpers.cnCreate)('mfui-beta-video-banner');
|
80
|
+
|
81
|
+
var VideoBanner = function VideoBanner(_ref2) {
|
82
|
+
var dataAttrs = _ref2.dataAttrs,
|
83
|
+
className = _ref2.className,
|
84
|
+
_ref2$classes = _ref2.classes,
|
85
|
+
classes = _ref2$classes === void 0 ? {} : _ref2$classes,
|
86
|
+
rootRef = _ref2.rootRef,
|
87
|
+
videoSrc = _ref2.videoSrc,
|
88
|
+
videoType = _ref2.videoType,
|
89
|
+
imageMobile = _ref2.imageMobile,
|
90
|
+
imageTablet = _ref2.imageTablet,
|
91
|
+
_ref2$imageDesktop = _ref2.imageDesktop,
|
92
|
+
imageDesktop = _ref2$imageDesktop === void 0 ? '' : _ref2$imageDesktop,
|
93
|
+
_ref2$imageDesktopWid = _ref2.imageDesktopWide,
|
94
|
+
imageDesktopWide = _ref2$imageDesktopWid === void 0 ? '' : _ref2$imageDesktopWid,
|
95
|
+
content = _ref2.content,
|
96
|
+
_ref2$isMuted = _ref2.isMuted,
|
97
|
+
isMuted = _ref2$isMuted === void 0 ? true : _ref2$isMuted,
|
98
|
+
breadcrumbs = _ref2.breadcrumbs;
|
99
|
+
|
100
|
+
var _React$useState = _react["default"].useState(true),
|
101
|
+
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
102
|
+
isMobile = _React$useState2[0],
|
103
|
+
setIsMobile = _React$useState2[1];
|
104
|
+
|
105
|
+
var _React$useState3 = _react["default"].useState(imageMobile),
|
106
|
+
_React$useState4 = (0, _slicedToArray2["default"])(_React$useState3, 2),
|
107
|
+
imageSrc = _React$useState4[0],
|
108
|
+
setImageSrc = _React$useState4[1];
|
109
|
+
|
110
|
+
var isVideoData = !!videoSrc && !!videoType;
|
111
|
+
var isRenderVideo = !isMobile && isVideoData;
|
112
|
+
|
113
|
+
var renderContent = _react["default"].useCallback(function (_ref3) {
|
114
|
+
var title = _ref3.title,
|
115
|
+
description = _ref3.description,
|
116
|
+
buttonTitle = _ref3.buttonTitle,
|
117
|
+
buttonHref = _ref3.buttonHref,
|
118
|
+
buttonDownload = _ref3.buttonDownload,
|
119
|
+
_ref3$buttonColor = _ref3.buttonColor,
|
120
|
+
buttonColor = _ref3$buttonColor === void 0 ? ButtonColor.GREEN : _ref3$buttonColor,
|
121
|
+
onButtonClick = _ref3.onButtonClick,
|
122
|
+
onLinkClick = _ref3.onLinkClick,
|
123
|
+
_ref3$textColor = _ref3.textColor,
|
124
|
+
textColor = _ref3$textColor === void 0 ? TextColor.BLACK : _ref3$textColor,
|
125
|
+
textColorMobile = _ref3.textColorMobile,
|
126
|
+
linkTitle = _ref3.linkTitle,
|
127
|
+
linkUrl = _ref3.linkUrl,
|
128
|
+
linkDownload = _ref3.linkDownload,
|
129
|
+
cost = _ref3.cost;
|
130
|
+
return /*#__PURE__*/_react["default"].createElement(_uiCore.Grid, {
|
131
|
+
className: cn('grid'),
|
132
|
+
guttersLeft: "medium"
|
133
|
+
}, /*#__PURE__*/_react["default"].createElement(_uiCore.GridColumn, {
|
134
|
+
mobile: "12",
|
135
|
+
tablet: "7",
|
136
|
+
desktop: "7",
|
137
|
+
wide: "6"
|
138
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
139
|
+
className: cn('content', {
|
140
|
+
'text-color': textColor,
|
141
|
+
'text-color-mobile': textColorMobile
|
142
|
+
})
|
143
|
+
}, /*#__PURE__*/_react["default"].createElement(_uiCore.Header, {
|
144
|
+
className: cn('title'),
|
145
|
+
as: "h1",
|
146
|
+
color: "inherit"
|
147
|
+
}, title), /*#__PURE__*/_react["default"].createElement("div", {
|
148
|
+
className: cn('text')
|
149
|
+
}, /*#__PURE__*/_react["default"].createElement(_uiCore.Header, {
|
150
|
+
as: "h5",
|
151
|
+
color: "inherit",
|
152
|
+
className: cn('description')
|
153
|
+
}, description), cost && /*#__PURE__*/_react["default"].createElement("div", {
|
154
|
+
className: cn('cost')
|
155
|
+
}, (0, _uiHelpers.convert)(cost, typographyConfig))), /*#__PURE__*/_react["default"].createElement("div", {
|
156
|
+
className: cn('btns-wrapper')
|
157
|
+
}, buttonTitle && /*#__PURE__*/_react["default"].createElement(_uiCore.Button, {
|
158
|
+
className: cn(ClassName.BUTTON, [classes.button]),
|
159
|
+
theme: buttonColor,
|
160
|
+
href: buttonHref,
|
161
|
+
onClick: onButtonClick,
|
162
|
+
download: buttonDownload
|
163
|
+
}, buttonTitle), linkTitle && /*#__PURE__*/_react["default"].createElement(_uiCore.TextLink, {
|
164
|
+
className: cn(ClassName.LINK, [classes.link]),
|
165
|
+
href: linkUrl,
|
166
|
+
download: linkDownload,
|
167
|
+
onClick: onLinkClick
|
168
|
+
}, linkTitle)))));
|
169
|
+
}, []);
|
170
|
+
|
171
|
+
var renderVideo = _react["default"].useCallback(function () {
|
172
|
+
switch (videoType) {
|
173
|
+
case VideoType.YOUTUBE:
|
174
|
+
{
|
175
|
+
var url = "https://www.youtube.com/embed/".concat(videoSrc, "?");
|
176
|
+
var autoplay = '&autoplay=1';
|
177
|
+
var mute = "&mute=".concat(isMuted ? 1 : 0);
|
178
|
+
var loop = '&loop=1';
|
179
|
+
var rel = '&rel=0';
|
180
|
+
var controls = '&controls=0';
|
181
|
+
var info = '&showinfo=0e';
|
182
|
+
var policy = '&iv_load_policy=3';
|
183
|
+
var playlist = "&playlist=".concat(videoSrc);
|
184
|
+
var src = "".concat(url).concat(autoplay).concat(mute).concat(loop).concat(rel).concat(controls).concat(info).concat(policy).concat(playlist);
|
185
|
+
return /*#__PURE__*/_react["default"].createElement("iframe", {
|
186
|
+
title: "iframe",
|
187
|
+
className: cn('video'),
|
188
|
+
src: src,
|
189
|
+
width: "100%",
|
190
|
+
height: "100%",
|
191
|
+
frameBorder: "0",
|
192
|
+
allow: "autoplay"
|
193
|
+
});
|
194
|
+
}
|
195
|
+
|
196
|
+
case VideoType.VIDEO:
|
197
|
+
{
|
198
|
+
return /*#__PURE__*/_react["default"].createElement("video", {
|
199
|
+
className: cn('video'),
|
200
|
+
autoPlay: true,
|
201
|
+
loop: true,
|
202
|
+
muted: isMuted
|
203
|
+
}, /*#__PURE__*/_react["default"].createElement("source", {
|
204
|
+
src: videoSrc,
|
205
|
+
type: "video/mp4"
|
206
|
+
}));
|
207
|
+
}
|
208
|
+
|
209
|
+
default:
|
210
|
+
{
|
211
|
+
return null;
|
212
|
+
}
|
213
|
+
}
|
214
|
+
}, [videoType, videoSrc, isMuted]);
|
215
|
+
|
216
|
+
_react["default"].useEffect(function () {
|
217
|
+
var getImageSrc = function getImageSrc() {
|
218
|
+
var windowWidth = window.innerWidth;
|
219
|
+
|
220
|
+
switch (true) {
|
221
|
+
case windowWidth >= _uiHelpers.breakpoints.DESKTOP_MIDDLE_START:
|
222
|
+
return imageDesktopWide;
|
223
|
+
|
224
|
+
case windowWidth >= _uiHelpers.breakpoints.DESKTOP_SMALL_START && windowWidth <= _uiHelpers.breakpoints.DESKTOP_SMALL_END:
|
225
|
+
return imageDesktop;
|
226
|
+
|
227
|
+
case windowWidth >= _uiHelpers.breakpoints.MOBILE_BIG_START && windowWidth <= _uiHelpers.breakpoints.MOBILE_BIG_END:
|
228
|
+
return imageTablet;
|
229
|
+
|
230
|
+
default:
|
231
|
+
return imageMobile;
|
232
|
+
}
|
233
|
+
};
|
234
|
+
|
235
|
+
var resizeHandler = function resizeHandler() {
|
236
|
+
setIsMobile(window.innerWidth < _uiHelpers.breakpoints.DESKTOP_SMALL_START);
|
237
|
+
setImageSrc(getImageSrc());
|
238
|
+
};
|
239
|
+
|
240
|
+
var resizeHandlerThrottled = (0, _lodash["default"])(resizeHandler, _throttleTime["default"].resize);
|
241
|
+
resizeHandler();
|
242
|
+
window.addEventListener('resize', resizeHandlerThrottled);
|
243
|
+
return function () {
|
244
|
+
window.removeEventListener('resize', resizeHandlerThrottled);
|
245
|
+
};
|
246
|
+
}, []);
|
247
|
+
|
248
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs), {
|
249
|
+
className: cn([className, classes.root]),
|
250
|
+
ref: rootRef
|
251
|
+
}), /*#__PURE__*/_react["default"].createElement(_uiCore.ContentArea, null, /*#__PURE__*/_react["default"].createElement("div", {
|
252
|
+
className: cn('wrapper')
|
253
|
+
}, !!(breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/_react["default"].createElement(_Breadcrumbs["default"], {
|
254
|
+
className: cn('breadcrumbs'),
|
255
|
+
items: breadcrumbs,
|
256
|
+
color: content === null || content === void 0 ? void 0 : content.textColor,
|
257
|
+
classes: {
|
258
|
+
item: classes.breadcrumbs
|
259
|
+
}
|
260
|
+
}), content && renderContent(content), isRenderVideo && renderVideo(), !isRenderVideo && /*#__PURE__*/_react["default"].createElement("div", {
|
261
|
+
style: {
|
262
|
+
backgroundImage: "url(".concat(imageSrc, ")")
|
263
|
+
},
|
264
|
+
className: cn('background-image')
|
265
|
+
}))));
|
266
|
+
};
|
267
|
+
|
268
|
+
VideoBanner.propTypes = {
|
269
|
+
dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
|
270
|
+
className: PropTypes.string,
|
271
|
+
classes: PropTypes.shape({
|
272
|
+
root: PropTypes.string,
|
273
|
+
button: PropTypes.string,
|
274
|
+
link: PropTypes.string,
|
275
|
+
breadcrumbs: PropTypes.string
|
276
|
+
}),
|
277
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
278
|
+
current: PropTypes.elementType
|
279
|
+
}), PropTypes.any])]),
|
280
|
+
videoSrc: PropTypes.string,
|
281
|
+
videoType: PropTypes.oneOf(Object.values(VideoType)),
|
282
|
+
content: PropTypes.shape({
|
283
|
+
title: PropTypes.string.isRequired,
|
284
|
+
description: PropTypes.string.isRequired,
|
285
|
+
buttonTitle: PropTypes.string,
|
286
|
+
buttonHref: PropTypes.string,
|
287
|
+
buttonDownload: PropTypes.bool,
|
288
|
+
buttonColor: PropTypes.oneOf(Object.values(ButtonColor)),
|
289
|
+
onButtonClick: PropTypes.func,
|
290
|
+
onLinkClick: PropTypes.func,
|
291
|
+
textColor: PropTypes.oneOf(Object.values(TextColor)),
|
292
|
+
textColorMobile: PropTypes.oneOf(Object.values(TextColor)),
|
293
|
+
linkTitle: PropTypes.string,
|
294
|
+
linkUrl: PropTypes.string,
|
295
|
+
linkDownload: PropTypes.bool,
|
296
|
+
cost: PropTypes.string
|
297
|
+
}),
|
298
|
+
isMuted: PropTypes.bool,
|
299
|
+
imageMobile: PropTypes.string.isRequired,
|
300
|
+
imageTablet: PropTypes.string.isRequired,
|
301
|
+
imageDesktop: PropTypes.string,
|
302
|
+
imageDesktopWide: PropTypes.string,
|
303
|
+
breadcrumbs: PropTypes.arrayOf(PropTypes.shape({
|
304
|
+
title: PropTypes.string.isRequired,
|
305
|
+
href: PropTypes.string
|
306
|
+
}).isRequired)
|
307
|
+
};
|
308
|
+
var _default = VideoBanner;
|
309
|
+
exports["default"] = _default;
|
@@ -0,0 +1,127 @@
|
|
1
|
+
h1,
|
2
|
+
h2,
|
3
|
+
h3,
|
4
|
+
h4,
|
5
|
+
h5 {
|
6
|
+
margin: 0;
|
7
|
+
}
|
8
|
+
.mfui-beta-video-block {
|
9
|
+
display: -webkit-box;
|
10
|
+
display: -ms-flexbox;
|
11
|
+
display: flex;
|
12
|
+
-webkit-box-align: center;
|
13
|
+
-ms-flex-align: center;
|
14
|
+
align-items: center;
|
15
|
+
}
|
16
|
+
.mfui-beta-video-block__content {
|
17
|
+
display: -webkit-box;
|
18
|
+
display: -ms-flexbox;
|
19
|
+
display: flex;
|
20
|
+
-webkit-box-orient: vertical;
|
21
|
+
-webkit-box-direction: normal;
|
22
|
+
-ms-flex-direction: column;
|
23
|
+
flex-direction: column;
|
24
|
+
-webkit-box-pack: center;
|
25
|
+
-ms-flex-pack: center;
|
26
|
+
justify-content: center;
|
27
|
+
height: 100%;
|
28
|
+
}
|
29
|
+
@media screen and (max-width: 767px) {
|
30
|
+
.mfui-beta-video-block__content {
|
31
|
+
margin-top: 24px;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
35
|
+
.mfui-beta-video-block__content {
|
36
|
+
margin-top: 32px;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
@media screen and (min-width: 768px) {
|
40
|
+
.mfui-beta-video-block__content {
|
41
|
+
margin-right: 20px;
|
42
|
+
padding-right: 20px;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
.mfui-beta-video-block__header {
|
46
|
+
margin-bottom: 24px;
|
47
|
+
}
|
48
|
+
@media screen and (max-width: 1023px) {
|
49
|
+
.mfui-beta-video-block__header {
|
50
|
+
margin-bottom: 16px;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
.mfui-beta-video-block__description {
|
54
|
+
font-size: 15px;
|
55
|
+
line-height: 24px;
|
56
|
+
font-weight: 400;
|
57
|
+
}
|
58
|
+
.mfui-beta-video-block__button {
|
59
|
+
-ms-flex-item-align: start;
|
60
|
+
align-self: flex-start;
|
61
|
+
max-width: 100%;
|
62
|
+
margin-top: 32px;
|
63
|
+
}
|
64
|
+
@media screen and (max-width: 767px) {
|
65
|
+
.mfui-beta-video-block__button {
|
66
|
+
-ms-flex-item-align: center;
|
67
|
+
align-self: center;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
.mfui-beta-video-block__video {
|
71
|
+
width: 100%;
|
72
|
+
height: 100%;
|
73
|
+
-o-object-fit: contain;
|
74
|
+
object-fit: contain;
|
75
|
+
}
|
76
|
+
.mfui-beta-video-block__video-wrapper {
|
77
|
+
height: 674px;
|
78
|
+
overflow: hidden;
|
79
|
+
}
|
80
|
+
@media screen and (min-width: 1440px) and (max-width: 1599px) {
|
81
|
+
.mfui-beta-video-block__video-wrapper {
|
82
|
+
height: 600px;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
@media screen and (min-width: 1280px) and (max-width: 1439px) {
|
86
|
+
.mfui-beta-video-block__video-wrapper {
|
87
|
+
height: 524px;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
91
|
+
.mfui-beta-video-block__video-wrapper {
|
92
|
+
height: 505px;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
.mfui-beta-video-block__video-wrapper_with-content {
|
96
|
+
height: 468px;
|
97
|
+
}
|
98
|
+
@media screen and (min-width: 1440px) and (max-width: 1599px) {
|
99
|
+
.mfui-beta-video-block__video-wrapper_with-content {
|
100
|
+
height: 415px;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
@media screen and (min-width: 1280px) and (max-width: 1439px) {
|
104
|
+
.mfui-beta-video-block__video-wrapper_with-content {
|
105
|
+
height: 363px;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
109
|
+
.mfui-beta-video-block__video-wrapper_with-content {
|
110
|
+
height: 328px;
|
111
|
+
}
|
112
|
+
}
|
113
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
114
|
+
.mfui-beta-video-block__video-wrapper,
|
115
|
+
.mfui-beta-video-block__video-wrapper_with-content {
|
116
|
+
height: 379px;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
@media screen and (max-width: 767px) {
|
120
|
+
.mfui-beta-video-block__video-wrapper,
|
121
|
+
.mfui-beta-video-block__video-wrapper_with-content {
|
122
|
+
height: 162px;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
.mfui-beta-video-block__grid {
|
126
|
+
width: 100%;
|
127
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import React, { Ref } from 'react';
|
2
|
+
import './VideoBlock.less';
|
3
|
+
export interface IContent {
|
4
|
+
/** Заголовок */
|
5
|
+
title: string;
|
6
|
+
/** Текст-описание */
|
7
|
+
description: string | React.ReactNode[] | React.ReactNode;
|
8
|
+
/** Текст кнопки */
|
9
|
+
buttonTitle: string;
|
10
|
+
/** Добавляет атрибут download для тега <a> компонента Button */
|
11
|
+
buttonDownload?: boolean;
|
12
|
+
/** Ссылка на кнопке */
|
13
|
+
href?: string;
|
14
|
+
/** Обработчик клика по кнопке */
|
15
|
+
onButtonClick?: (e: React.SyntheticEvent<EventTarget>) => void;
|
16
|
+
}
|
17
|
+
export declare const VideoTypes: {
|
18
|
+
readonly YOUTUBE: "youtube";
|
19
|
+
readonly VIDEO: "video";
|
20
|
+
};
|
21
|
+
declare type VideoType = typeof VideoTypes[keyof typeof VideoTypes];
|
22
|
+
export interface Props {
|
23
|
+
/** Дата атрибуты для корневого элемента */
|
24
|
+
dataAttrs?: {
|
25
|
+
[key: string]: string;
|
26
|
+
};
|
27
|
+
/** Дополнительный класс корневого элемента */
|
28
|
+
className?: string;
|
29
|
+
/** Дополнительные классы для корневого и внутренних элементов */
|
30
|
+
classes?: {
|
31
|
+
root?: string;
|
32
|
+
button?: string;
|
33
|
+
description?: string;
|
34
|
+
};
|
35
|
+
/** Ссылка на корневой элемент */
|
36
|
+
rootRef?: Ref<HTMLDivElement>;
|
37
|
+
/** Данные для блока с контентом */
|
38
|
+
content?: IContent;
|
39
|
+
/** Тип видео */
|
40
|
+
videoType?: VideoType;
|
41
|
+
/** Источник видео. Если видео с youtube, то необходимо указать id */
|
42
|
+
videoSrc: string;
|
43
|
+
/** Наличие звука в видео */
|
44
|
+
isMuted?: boolean;
|
45
|
+
/** Автоматическое проигрывание видео */
|
46
|
+
isAutoplay?: boolean;
|
47
|
+
}
|
48
|
+
declare const VideoBlock: React.FC<Props>;
|
49
|
+
export default VideoBlock;
|
@@ -0,0 +1,170 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = exports.VideoTypes = void 0;
|
7
|
+
|
8
|
+
require("core-js/modules/es.symbol");
|
9
|
+
|
10
|
+
require("core-js/modules/es.symbol.description");
|
11
|
+
|
12
|
+
require("core-js/modules/es.array.concat");
|
13
|
+
|
14
|
+
require("core-js/modules/es.object.values");
|
15
|
+
|
16
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
17
|
+
|
18
|
+
var _react = _interopRequireDefault(require("react"));
|
19
|
+
|
20
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
21
|
+
|
22
|
+
var _uiCore = require("@megafon/ui-core");
|
23
|
+
|
24
|
+
var _uiHelpers = require("@megafon/ui-helpers");
|
25
|
+
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
27
|
+
|
28
|
+
var VideoTypes = {
|
29
|
+
YOUTUBE: 'youtube',
|
30
|
+
VIDEO: 'video'
|
31
|
+
};
|
32
|
+
exports.VideoTypes = VideoTypes;
|
33
|
+
var cn = (0, _uiHelpers.cnCreate)('mfui-beta-video-block');
|
34
|
+
|
35
|
+
var VideoBlock = function VideoBlock(_ref) {
|
36
|
+
var dataAttrs = _ref.dataAttrs,
|
37
|
+
className = _ref.className,
|
38
|
+
_ref$classes = _ref.classes,
|
39
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
40
|
+
rootRef = _ref.rootRef,
|
41
|
+
content = _ref.content,
|
42
|
+
_ref$videoType = _ref.videoType,
|
43
|
+
videoType = _ref$videoType === void 0 ? 'video' : _ref$videoType,
|
44
|
+
videoSrc = _ref.videoSrc,
|
45
|
+
_ref$isMuted = _ref.isMuted,
|
46
|
+
isMuted = _ref$isMuted === void 0 ? true : _ref$isMuted,
|
47
|
+
_ref$isAutoplay = _ref.isAutoplay,
|
48
|
+
isAutoplay = _ref$isAutoplay === void 0 ? false : _ref$isAutoplay;
|
49
|
+
|
50
|
+
var renderVideo = _react["default"].useCallback(function () {
|
51
|
+
switch (videoType) {
|
52
|
+
case VideoTypes.YOUTUBE:
|
53
|
+
{
|
54
|
+
var src = "https://www.youtube.com/embed/".concat(videoSrc, "?&autoplay=").concat(isAutoplay ? 1 : 0, "&mute=").concat(isMuted ? 1 : 0, "&loop=1&rel=0&controls=0&showinfo=0e&iv_load_policy=3&playlist=").concat(videoSrc);
|
55
|
+
return /*#__PURE__*/_react["default"].createElement("iframe", {
|
56
|
+
src: src,
|
57
|
+
width: "100%",
|
58
|
+
height: "100%",
|
59
|
+
frameBorder: "0",
|
60
|
+
allow: "autoplay",
|
61
|
+
title: "iframe"
|
62
|
+
});
|
63
|
+
}
|
64
|
+
|
65
|
+
case VideoTypes.VIDEO:
|
66
|
+
{
|
67
|
+
return /*#__PURE__*/_react["default"].createElement("video", {
|
68
|
+
className: cn('video'),
|
69
|
+
autoPlay: isAutoplay,
|
70
|
+
muted: isMuted,
|
71
|
+
controls: !isAutoplay,
|
72
|
+
loop: true
|
73
|
+
}, /*#__PURE__*/_react["default"].createElement("source", {
|
74
|
+
src: videoSrc,
|
75
|
+
type: "video/mp4"
|
76
|
+
}));
|
77
|
+
}
|
78
|
+
|
79
|
+
default:
|
80
|
+
{
|
81
|
+
return null;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}, [videoType, videoSrc]);
|
85
|
+
|
86
|
+
var renderContent = _react["default"].useCallback(function (_ref2) {
|
87
|
+
var title = _ref2.title,
|
88
|
+
description = _ref2.description,
|
89
|
+
href = _ref2.href,
|
90
|
+
buttonDownload = _ref2.buttonDownload,
|
91
|
+
buttonTitle = _ref2.buttonTitle,
|
92
|
+
onButtonClick = _ref2.onButtonClick;
|
93
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
94
|
+
className: cn('content')
|
95
|
+
}, /*#__PURE__*/_react["default"].createElement(_uiCore.Header, {
|
96
|
+
as: "h2",
|
97
|
+
className: cn('header')
|
98
|
+
}, title), /*#__PURE__*/_react["default"].createElement("div", {
|
99
|
+
className: cn('description', [classes.description])
|
100
|
+
}, description), /*#__PURE__*/_react["default"].createElement(_uiCore.Button, {
|
101
|
+
className: cn('button', [classes.button]),
|
102
|
+
href: href,
|
103
|
+
onClick: onButtonClick,
|
104
|
+
download: buttonDownload
|
105
|
+
}, buttonTitle));
|
106
|
+
}, [content]);
|
107
|
+
|
108
|
+
var renderGridColumns = _react["default"].useCallback(function () {
|
109
|
+
var columns = [];
|
110
|
+
var columnWidth = content ? '7' : '10';
|
111
|
+
|
112
|
+
if (content) {
|
113
|
+
columns.push( /*#__PURE__*/_react["default"].createElement(_uiCore.GridColumn, {
|
114
|
+
all: "5",
|
115
|
+
tablet: "12",
|
116
|
+
mobile: "12",
|
117
|
+
orderTablet: "2",
|
118
|
+
orderMobile: "2",
|
119
|
+
key: 'column-content'
|
120
|
+
}, renderContent && renderContent(content)));
|
121
|
+
}
|
122
|
+
|
123
|
+
columns.push( /*#__PURE__*/_react["default"].createElement(_uiCore.GridColumn, {
|
124
|
+
all: columnWidth,
|
125
|
+
tablet: "12",
|
126
|
+
mobile: "12",
|
127
|
+
key: 'column-video'
|
128
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
129
|
+
className: cn('video-wrapper', {
|
130
|
+
'with-content': !!content
|
131
|
+
})
|
132
|
+
}, renderVideo())));
|
133
|
+
return columns;
|
134
|
+
}, [renderContent, renderVideo, content]);
|
135
|
+
|
136
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs), {
|
137
|
+
className: cn([className, classes.root]),
|
138
|
+
ref: rootRef
|
139
|
+
}), /*#__PURE__*/_react["default"].createElement(_uiCore.Grid, {
|
140
|
+
hAlign: "center",
|
141
|
+
className: cn('grid')
|
142
|
+
}, renderGridColumns()));
|
143
|
+
};
|
144
|
+
|
145
|
+
VideoBlock.propTypes = {
|
146
|
+
dataAttrs: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
147
|
+
className: _propTypes["default"].string,
|
148
|
+
classes: _propTypes["default"].shape({
|
149
|
+
root: _propTypes["default"].string,
|
150
|
+
button: _propTypes["default"].string,
|
151
|
+
description: _propTypes["default"].string
|
152
|
+
}),
|
153
|
+
rootRef: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
154
|
+
current: _propTypes["default"].elementType
|
155
|
+
}), _propTypes["default"].any])]),
|
156
|
+
content: _propTypes["default"].shape({
|
157
|
+
title: _propTypes["default"].string.isRequired,
|
158
|
+
description: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]).isRequired,
|
159
|
+
href: _propTypes["default"].string,
|
160
|
+
buttonTitle: _propTypes["default"].string.isRequired,
|
161
|
+
buttonDownload: _propTypes["default"].bool,
|
162
|
+
onButtonClick: _propTypes["default"].func
|
163
|
+
}),
|
164
|
+
videoType: _propTypes["default"].oneOf(Object.values(VideoTypes)),
|
165
|
+
videoSrc: _propTypes["default"].string.isRequired,
|
166
|
+
isMuted: _propTypes["default"].bool,
|
167
|
+
isAutoplay: _propTypes["default"].bool
|
168
|
+
};
|
169
|
+
var _default = VideoBlock;
|
170
|
+
exports["default"] = _default;
|