@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
package/README.md
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import './AccordionBox.less';
|
3
|
+
export interface IAccordionBox {
|
4
|
+
/** Дата атрибуты для корневого элемента */
|
5
|
+
dataAttrs?: {
|
6
|
+
[key: string]: string;
|
7
|
+
};
|
8
|
+
/** Ссылка на корневой элемент */
|
9
|
+
rootRef?: React.Ref<HTMLDivElement>;
|
10
|
+
/** Заголовок аккордеона */
|
11
|
+
title: string;
|
12
|
+
/** Состояние аккордеона, заданное извне */
|
13
|
+
isOpened?: boolean;
|
14
|
+
/** Отключить ограничение ширины */
|
15
|
+
isFullWidth?: boolean;
|
16
|
+
/** Центрирование по горизонтали для расширения 1280+ */
|
17
|
+
hCenterAlignWide?: boolean;
|
18
|
+
/** Вертикальные отступы */
|
19
|
+
hasVerticalPaddings?: boolean;
|
20
|
+
/** Дополнительный класс для корнеовго элемента */
|
21
|
+
className?: string;
|
22
|
+
/** Дополнительные классы для корневого и внутренних элементов */
|
23
|
+
classes?: {
|
24
|
+
openedClass?: string;
|
25
|
+
root?: string;
|
26
|
+
collapse?: string;
|
27
|
+
titleWrap?: string;
|
28
|
+
};
|
29
|
+
/** Обработчик клика */
|
30
|
+
onClickAccordion?: (isOpened: boolean, title: string) => void;
|
31
|
+
}
|
32
|
+
declare const AccordionBox: React.FC<IAccordionBox>;
|
33
|
+
export default AccordionBox;
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import "core-js/modules/es.symbol";
|
2
|
+
import "core-js/modules/es.array.index-of";
|
3
|
+
|
4
|
+
var __rest = this && this.__rest || function (s, e) {
|
5
|
+
var t = {};
|
6
|
+
|
7
|
+
for (var p in s) {
|
8
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
9
|
+
}
|
10
|
+
|
11
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
12
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
13
|
+
}
|
14
|
+
return t;
|
15
|
+
};
|
16
|
+
|
17
|
+
import * as React from 'react';
|
18
|
+
import * as PropTypes from 'prop-types';
|
19
|
+
import { Grid, GridColumn, Accordion } from '@megafon/ui-core';
|
20
|
+
import { cnCreate } from '@megafon/ui-helpers';
|
21
|
+
import "./AccordionBox.css";
|
22
|
+
var cn = cnCreate('mfui-beta-accordion-box');
|
23
|
+
|
24
|
+
var AccordionBox = function AccordionBox(_a) {
|
25
|
+
var _a$hCenterAlignWide = _a.hCenterAlignWide,
|
26
|
+
hCenterAlignWide = _a$hCenterAlignWide === void 0 ? false : _a$hCenterAlignWide,
|
27
|
+
_a$isFullWidth = _a.isFullWidth,
|
28
|
+
isFullWidth = _a$isFullWidth === void 0 ? false : _a$isFullWidth,
|
29
|
+
restProps = __rest(_a, ["hCenterAlignWide", "isFullWidth"]);
|
30
|
+
|
31
|
+
var renderAccordionWithGrid = React.useCallback(function () {
|
32
|
+
return /*#__PURE__*/React.createElement("div", {
|
33
|
+
className: cn()
|
34
|
+
}, /*#__PURE__*/React.createElement(Grid, {
|
35
|
+
hAlign: hCenterAlignWide ? 'center' : 'left'
|
36
|
+
}, /*#__PURE__*/React.createElement(GridColumn, {
|
37
|
+
wide: "8"
|
38
|
+
}, /*#__PURE__*/React.createElement(Accordion, restProps))));
|
39
|
+
}, [restProps, hCenterAlignWide]);
|
40
|
+
return isFullWidth ? /*#__PURE__*/React.createElement(Accordion, restProps) : renderAccordionWithGrid();
|
41
|
+
};
|
42
|
+
|
43
|
+
AccordionBox.propTypes = {
|
44
|
+
dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
|
45
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
46
|
+
current: PropTypes.elementType
|
47
|
+
}), PropTypes.any])]),
|
48
|
+
title: PropTypes.string.isRequired,
|
49
|
+
isFullWidth: PropTypes.bool,
|
50
|
+
isOpened: PropTypes.bool,
|
51
|
+
hCenterAlignWide: PropTypes.bool,
|
52
|
+
hasVerticalPaddings: PropTypes.bool,
|
53
|
+
className: PropTypes.string,
|
54
|
+
classes: PropTypes.shape({
|
55
|
+
openedClass: PropTypes.string,
|
56
|
+
root: PropTypes.string,
|
57
|
+
collapse: PropTypes.string,
|
58
|
+
titleWrap: PropTypes.string
|
59
|
+
}),
|
60
|
+
onClickAccordion: PropTypes.func
|
61
|
+
};
|
62
|
+
export default AccordionBox;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import "core-js/modules/es.symbol";
|
2
|
+
import "core-js/modules/es.array.index-of";
|
3
|
+
|
4
|
+
var __rest = this && this.__rest || function (s, e) {
|
5
|
+
var t = {};
|
6
|
+
|
7
|
+
for (var p in s) {
|
8
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
9
|
+
}
|
10
|
+
|
11
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
12
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
13
|
+
}
|
14
|
+
return t;
|
15
|
+
};
|
16
|
+
|
17
|
+
import * as React from 'react';
|
18
|
+
import { Banner } from '@megafon/ui-core';
|
19
|
+
import { cnCreate } from '@megafon/ui-helpers';
|
20
|
+
var cn = cnCreate('mfui-beta-banner-box');
|
21
|
+
|
22
|
+
var BannerBox = function BannerBox(_a) {
|
23
|
+
var children = _a.children,
|
24
|
+
props = __rest(_a, ["children"]);
|
25
|
+
|
26
|
+
return /*#__PURE__*/React.createElement("div", {
|
27
|
+
className: cn()
|
28
|
+
}, /*#__PURE__*/React.createElement(Banner, props, children));
|
29
|
+
};
|
30
|
+
|
31
|
+
export default BannerBox;
|
@@ -1,13 +1,24 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import './style/BenefitsIcons.less';
|
3
|
-
import {
|
3
|
+
import { IconPosition, IBenefit } from './types';
|
4
4
|
export interface IBenefitsIcons {
|
5
|
-
/**
|
6
|
-
|
7
|
-
/**
|
5
|
+
/** Ссылка на корневой элемент */
|
6
|
+
rootRef?: React.Ref<HTMLDivElement>;
|
7
|
+
/** Позиция иконки */
|
8
|
+
iconPosition?: IconPosition;
|
9
|
+
/** Выстраивать бенефиты в одну колонку вне зависимости от количества */
|
10
|
+
inOneColumn?: boolean;
|
11
|
+
/** Список бенефитов */
|
8
12
|
items: IBenefit[];
|
9
|
-
/**
|
13
|
+
/** Дополнительный css класс для корневого элемента */
|
10
14
|
className?: string;
|
15
|
+
/** Дополнительные css классы для корневого и внутренних элементов */
|
16
|
+
classes?: {
|
17
|
+
root?: string;
|
18
|
+
item?: string;
|
19
|
+
grid?: string;
|
20
|
+
gridColumn?: string;
|
21
|
+
};
|
11
22
|
}
|
12
23
|
declare const BenefitsIcons: React.FC<IBenefitsIcons>;
|
13
24
|
export default BenefitsIcons;
|
@@ -1,12 +1,16 @@
|
|
1
1
|
import "core-js/modules/es.array.map";
|
2
2
|
import "core-js/modules/es.object.values";
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
4
|
import _extends from "@babel/runtime/helpers/extends";
|
4
5
|
import * as React from 'react';
|
5
6
|
import PropTypes from 'prop-types';
|
6
7
|
import "./style/BenefitsIcons.css";
|
7
|
-
import {
|
8
|
+
import { Grid, GridColumn } from '@megafon/ui-core';
|
9
|
+
import { cnCreate, breakpoints } from '@megafon/ui-helpers';
|
8
10
|
import BenefitsIconsTile from "./BenefitsIconsTile";
|
9
|
-
import { IconPositionEnum } from "./types";
|
11
|
+
import { IconPositionEnum, ItemsAlignEnum } from "./types";
|
12
|
+
import throttle from 'lodash.throttle';
|
13
|
+
import throttleTime from "../../constants/throttleTime"; // left-aligned column with left side icon,
|
10
14
|
|
11
15
|
var getLeftSideConfig = function getLeftSideConfig(count, index) {
|
12
16
|
var everySecondWithoutOffset = index % 2 ? '1' : undefined;
|
@@ -94,7 +98,19 @@ var getCenterTopConfig = function getCenterTopConfig(count, index) {
|
|
94
98
|
}
|
95
99
|
};
|
96
100
|
|
97
|
-
var
|
101
|
+
var getOneColumnConfig = function getOneColumnConfig(iconPosition) {
|
102
|
+
return iconPosition !== IconPositionEnum.CENTER_TOP ? {
|
103
|
+
wide: '10',
|
104
|
+
desktop: '10',
|
105
|
+
tablet: '10'
|
106
|
+
} : {
|
107
|
+
wide: '12',
|
108
|
+
desktop: '12',
|
109
|
+
tablet: '12'
|
110
|
+
};
|
111
|
+
};
|
112
|
+
|
113
|
+
var getMultiColumnConfig = function getMultiColumnConfig(iconPosition, count, index) {
|
98
114
|
switch (iconPosition) {
|
99
115
|
case IconPositionEnum.LEFT_TOP:
|
100
116
|
return getLeftTopConfig(count, index);
|
@@ -110,40 +126,89 @@ var getColumnConfig = function getColumnConfig(iconPosition, count, index) {
|
|
110
126
|
var cn = cnCreate('mfui-beta-benefits-icons');
|
111
127
|
|
112
128
|
var BenefitsIcons = function BenefitsIcons(_ref) {
|
113
|
-
var
|
129
|
+
var rootRef = _ref.rootRef,
|
130
|
+
_ref$iconPosition = _ref.iconPosition,
|
114
131
|
iconPosition = _ref$iconPosition === void 0 ? IconPositionEnum.LEFT_TOP : _ref$iconPosition,
|
132
|
+
_ref$inOneColumn = _ref.inOneColumn,
|
133
|
+
inOneColumn = _ref$inOneColumn === void 0 ? false : _ref$inOneColumn,
|
115
134
|
items = _ref.items,
|
116
|
-
className = _ref.className
|
117
|
-
|
135
|
+
className = _ref.className,
|
136
|
+
_ref$classes = _ref.classes,
|
137
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes;
|
138
|
+
|
139
|
+
var _React$useState = React.useState(iconPosition === IconPositionEnum.CENTER_TOP ? 'center' : 'left'),
|
140
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
141
|
+
itemsAlign = _React$useState2[0],
|
142
|
+
setItemsAlign = _React$useState2[1];
|
143
|
+
|
144
|
+
var _React$useState3 = React.useState(iconPosition),
|
145
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
146
|
+
localIconPosition = _React$useState4[0],
|
147
|
+
setLocalIconPosition = _React$useState4[1];
|
148
|
+
|
149
|
+
var resizeHandler = React.useCallback(function () {
|
150
|
+
if (window.innerWidth <= breakpoints.MOBILE_MIDDLE_END) {
|
151
|
+
setItemsAlign(ItemsAlignEnum.CENTER);
|
152
|
+
setLocalIconPosition(IconPositionEnum.CENTER_TOP);
|
153
|
+
} else {
|
154
|
+
setItemsAlign(ItemsAlignEnum.LEFT);
|
155
|
+
setLocalIconPosition(iconPosition);
|
156
|
+
}
|
157
|
+
}, [iconPosition]);
|
158
|
+
React.useEffect(function () {
|
159
|
+
var resizeHandlerThrottled = throttle(resizeHandler, throttleTime.resize);
|
160
|
+
|
161
|
+
if (inOneColumn) {
|
162
|
+
resizeHandler();
|
163
|
+
window.addEventListener('resize', resizeHandlerThrottled);
|
164
|
+
}
|
165
|
+
|
166
|
+
return function () {
|
167
|
+
window.removeEventListener('resize', resizeHandlerThrottled);
|
168
|
+
};
|
169
|
+
}, [iconPosition, inOneColumn, resizeHandler]);
|
118
170
|
return /*#__PURE__*/React.createElement("div", {
|
119
|
-
className: cn(className)
|
171
|
+
className: cn([className, classes.root]),
|
172
|
+
ref: rootRef
|
120
173
|
}, /*#__PURE__*/React.createElement("div", {
|
121
174
|
className: cn('inner')
|
122
175
|
}, /*#__PURE__*/React.createElement(Grid, {
|
176
|
+
className: classes.grid,
|
123
177
|
guttersLeft: "medium",
|
124
|
-
hAlign:
|
178
|
+
hAlign: itemsAlign
|
125
179
|
}, items.map(function (_ref2, i) {
|
126
180
|
var title = _ref2.title,
|
127
181
|
text = _ref2.text,
|
128
182
|
icon = _ref2.icon;
|
129
|
-
|
183
|
+
var columnConfig = inOneColumn ? getOneColumnConfig(iconPosition) : getMultiColumnConfig(iconPosition, items.length, i);
|
184
|
+
return /*#__PURE__*/React.createElement(GridColumn, _extends({
|
185
|
+
className: classes.gridColumn,
|
130
186
|
key: i
|
131
|
-
}), /*#__PURE__*/React.createElement(BenefitsIconsTile, {
|
187
|
+
}, columnConfig), /*#__PURE__*/React.createElement(BenefitsIconsTile, {
|
188
|
+
className: classes.item,
|
132
189
|
title: title,
|
133
190
|
text: text,
|
134
191
|
icon: icon,
|
135
|
-
iconPosition:
|
192
|
+
iconPosition: localIconPosition
|
136
193
|
}));
|
137
194
|
}))));
|
138
195
|
};
|
139
196
|
|
140
197
|
BenefitsIcons.propTypes = {
|
198
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
199
|
+
current: PropTypes.elementType
|
200
|
+
}), PropTypes.any])]),
|
141
201
|
iconPosition: PropTypes.oneOf(Object.values(IconPositionEnum)),
|
202
|
+
inOneColumn: PropTypes.bool,
|
142
203
|
items: PropTypes.arrayOf(PropTypes.shape({
|
143
|
-
title: PropTypes.string,
|
144
|
-
text: PropTypes.string,
|
204
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
205
|
+
text: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
145
206
|
icon: PropTypes.node.isRequired
|
146
207
|
}).isRequired).isRequired,
|
147
|
-
className: PropTypes.string
|
208
|
+
className: PropTypes.string,
|
209
|
+
classes: PropTypes.shape({
|
210
|
+
root: PropTypes.string,
|
211
|
+
item: PropTypes.string
|
212
|
+
})
|
148
213
|
};
|
149
214
|
export default BenefitsIcons;
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import './style/BenefitsIconsTile.less';
|
3
|
-
import { IBenefit,
|
3
|
+
import { IBenefit, IconPosition } from './types';
|
4
4
|
export interface IBenefitsIconsTile extends IBenefit {
|
5
|
-
iconPosition?:
|
5
|
+
iconPosition?: IconPosition;
|
6
|
+
className?: string;
|
6
7
|
}
|
7
8
|
declare const BenefitsIconsTile: React.FC<IBenefitsIconsTile>;
|
8
9
|
export default BenefitsIconsTile;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import "core-js/modules/es.object.values";
|
2
2
|
import * as React from 'react';
|
3
3
|
import PropTypes from 'prop-types';
|
4
|
-
import convert from 'htmr';
|
5
4
|
import "./style/BenefitsIconsTile.css";
|
6
|
-
import { Header
|
5
|
+
import { Header } from '@megafon/ui-core';
|
6
|
+
import { cnCreate } from '@megafon/ui-helpers';
|
7
7
|
import { IconPositionEnum } from "./types";
|
8
8
|
var cn = cnCreate('mfui-beta-benefits-icons-tile');
|
9
9
|
|
@@ -12,11 +12,12 @@ var BenefitsIconsTile = function BenefitsIconsTile(_ref) {
|
|
12
12
|
text = _ref.text,
|
13
13
|
icon = _ref.icon,
|
14
14
|
_ref$iconPosition = _ref.iconPosition,
|
15
|
-
iconPosition = _ref$iconPosition === void 0 ? IconPositionEnum.LEFT_TOP : _ref$iconPosition
|
15
|
+
iconPosition = _ref$iconPosition === void 0 ? IconPositionEnum.LEFT_TOP : _ref$iconPosition,
|
16
|
+
className = _ref.className;
|
16
17
|
return /*#__PURE__*/React.createElement("div", {
|
17
|
-
className: cn(
|
18
|
+
className: cn({
|
18
19
|
'icon-position': iconPosition
|
19
|
-
})
|
20
|
+
}, [className])
|
20
21
|
}, /*#__PURE__*/React.createElement("div", {
|
21
22
|
className: cn('svg-icon')
|
22
23
|
}, icon), /*#__PURE__*/React.createElement("div", {
|
@@ -24,16 +25,16 @@ var BenefitsIconsTile = function BenefitsIconsTile(_ref) {
|
|
24
25
|
}, title && /*#__PURE__*/React.createElement(Header, {
|
25
26
|
className: cn('title'),
|
26
27
|
as: "h5"
|
27
|
-
},
|
28
|
-
className: cn('
|
29
|
-
|
30
|
-
}, convert(text))));
|
28
|
+
}, title), text && /*#__PURE__*/React.createElement("div", {
|
29
|
+
className: cn('content')
|
30
|
+
}, text)));
|
31
31
|
};
|
32
32
|
|
33
33
|
BenefitsIconsTile.propTypes = {
|
34
|
-
|
35
|
-
|
34
|
+
className: PropTypes.string,
|
35
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
36
|
+
text: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
36
37
|
iconPosition: PropTypes.oneOf(Object.values(IconPositionEnum)),
|
37
|
-
icon: PropTypes.node
|
38
|
+
icon: PropTypes.node.isRequired
|
38
39
|
};
|
39
40
|
export default BenefitsIconsTile;
|
@@ -7,17 +7,24 @@ h5 {
|
|
7
7
|
}
|
8
8
|
.mfui-beta-benefits-icons-tile {
|
9
9
|
margin-bottom: 48px;
|
10
|
-
padding: 0 16px;
|
11
10
|
}
|
12
11
|
.mfui-beta-benefits-icons-tile .mfui-beta-benefits-icons-tile__svg-icon {
|
13
12
|
margin-bottom: 10px;
|
14
13
|
}
|
15
|
-
.mfui-beta-benefits-icons-
|
14
|
+
.mfui-beta-benefits-icons-tile__content {
|
15
|
+
font-size: 15px;
|
16
|
+
line-height: 24px;
|
17
|
+
font-weight: 400;
|
18
|
+
}
|
19
|
+
.mfui-beta-benefits-icons-tile__title + .mfui-beta-benefits-icons-tile__content {
|
16
20
|
margin-top: 4px;
|
17
21
|
}
|
22
|
+
.mfui-beta-benefits-icons-tile__text {
|
23
|
+
margin-bottom: 0;
|
24
|
+
}
|
18
25
|
.mfui-beta-benefits-icons-tile__svg-icon {
|
19
|
-
width:
|
20
|
-
height:
|
26
|
+
width: 40px;
|
27
|
+
height: 40px;
|
21
28
|
overflow: hidden;
|
22
29
|
}
|
23
30
|
.mfui-beta-benefits-icons-tile_icon-position_left-side {
|
@@ -1,15 +1,24 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
declare type TGridSizeValues = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
|
3
3
|
export interface IBenefit {
|
4
|
-
|
5
|
-
|
4
|
+
/** Заголовок бенефита */
|
5
|
+
title?: string | React.ReactNode | React.ReactNode[];
|
6
|
+
/** Основной текст в бенефите */
|
7
|
+
text?: string | React.ReactNode | React.ReactNode[];
|
8
|
+
/** Иконка */
|
6
9
|
icon: React.ReactNode;
|
7
10
|
}
|
8
|
-
export declare
|
9
|
-
LEFT_TOP
|
10
|
-
CENTER_TOP
|
11
|
-
LEFT_SIDE
|
12
|
-
}
|
11
|
+
export declare const IconPositionEnum: {
|
12
|
+
readonly LEFT_TOP: "left-top";
|
13
|
+
readonly CENTER_TOP: "center-top";
|
14
|
+
readonly LEFT_SIDE: "left-side";
|
15
|
+
};
|
16
|
+
export declare type IconPosition = typeof IconPositionEnum[keyof typeof IconPositionEnum];
|
17
|
+
export declare const ItemsAlignEnum: {
|
18
|
+
readonly LEFT: "left";
|
19
|
+
readonly CENTER: "center";
|
20
|
+
};
|
21
|
+
export declare type ItemsAlignType = typeof ItemsAlignEnum[keyof typeof ItemsAlignEnum];
|
13
22
|
export declare type GridConfig = {
|
14
23
|
wide?: TGridSizeValues;
|
15
24
|
desktop?: TGridSizeValues;
|
@@ -1,7 +1,9 @@
|
|
1
|
-
export var IconPositionEnum
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
export var IconPositionEnum = {
|
2
|
+
LEFT_TOP: 'left-top',
|
3
|
+
CENTER_TOP: 'center-top',
|
4
|
+
LEFT_SIDE: 'left-side'
|
5
|
+
};
|
6
|
+
export var ItemsAlignEnum = {
|
7
|
+
LEFT: 'left',
|
8
|
+
CENTER: 'center'
|
9
|
+
};
|
@@ -2,12 +2,21 @@ import * as React from 'react';
|
|
2
2
|
import './BenfitsPictures.less';
|
3
3
|
import { IBenefit, GridGutterSize } from './types';
|
4
4
|
export interface IBenefitsPicturesProps {
|
5
|
-
/**
|
5
|
+
/** Ссылка на корневой элемент */
|
6
|
+
rootRef?: React.Ref<HTMLDivElement>;
|
7
|
+
/** Данные для бенефитов */
|
6
8
|
items: IBenefit[];
|
7
|
-
/**
|
9
|
+
/** Горизонтальное выравнивание */
|
8
10
|
hAlign?: 'left' | 'center';
|
9
|
-
/**
|
11
|
+
/** Расстояние между бенефитами */
|
10
12
|
gridGap?: GridGutterSize;
|
13
|
+
/** Дополнительный css класс для корневого элемента */
|
14
|
+
className?: string;
|
15
|
+
/** Дополнительные css классы для корневого и внутренних элементов */
|
16
|
+
classes?: {
|
17
|
+
root?: string;
|
18
|
+
item?: string;
|
19
|
+
};
|
11
20
|
}
|
12
21
|
declare const BenefitsPictures: React.FC<IBenefitsPicturesProps>;
|
13
22
|
export default BenefitsPictures;
|
@@ -6,9 +6,10 @@ import { useCallback } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
7
7
|
import throttle from 'lodash.throttle';
|
8
8
|
import "./BenfitsPictures.css";
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
|
9
|
+
import { Grid, GridColumn, Header, Paragraph } from '@megafon/ui-core';
|
10
|
+
import { breakpoints, cnCreate } from '@megafon/ui-helpers';
|
11
|
+
import convert from 'htmr';
|
12
|
+
import throttleTime from "../../constants/throttleTime";
|
12
13
|
var ONLY_LEFT_ALIGN_ITEMS_COUNT = 3;
|
13
14
|
var columnSize = {
|
14
15
|
wide: '4',
|
@@ -115,7 +116,11 @@ var BenefitsPictures = function BenefitsPictures(_ref) {
|
|
115
116
|
_ref$hAlign = _ref.hAlign,
|
116
117
|
hAlign = _ref$hAlign === void 0 ? 'left' : _ref$hAlign,
|
117
118
|
_ref$gridGap = _ref.gridGap,
|
118
|
-
gridGap = _ref$gridGap === void 0 ? 'large' : _ref$gridGap
|
119
|
+
gridGap = _ref$gridGap === void 0 ? 'large' : _ref$gridGap,
|
120
|
+
rootRef = _ref.rootRef,
|
121
|
+
className = _ref.className,
|
122
|
+
_ref$classes = _ref.classes,
|
123
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes;
|
119
124
|
var isLargeGutter = gridGap === 'large';
|
120
125
|
var isGridCenterAlign = hAlign === 'center' && items.length !== ONLY_LEFT_ALIGN_ITEMS_COUNT;
|
121
126
|
|
@@ -129,14 +134,14 @@ var BenefitsPictures = function BenefitsPictures(_ref) {
|
|
129
134
|
return;
|
130
135
|
}
|
131
136
|
|
132
|
-
if (window.innerWidth < DESKTOP_MIDDLE_START) {
|
137
|
+
if (window.innerWidth < breakpoints.DESKTOP_MIDDLE_START) {
|
133
138
|
setCurrentGutter('medium');
|
134
139
|
} else {
|
135
140
|
setCurrentGutter('large');
|
136
141
|
}
|
137
142
|
}, []);
|
138
143
|
React.useEffect(function () {
|
139
|
-
var throttledResizeHandler = throttle(resizeHandler,
|
144
|
+
var throttledResizeHandler = throttle(resizeHandler, throttleTime.resize);
|
140
145
|
resizeHandler();
|
141
146
|
window.addEventListener('resize', throttledResizeHandler);
|
142
147
|
return function () {
|
@@ -144,7 +149,8 @@ var BenefitsPictures = function BenefitsPictures(_ref) {
|
|
144
149
|
};
|
145
150
|
}, []);
|
146
151
|
return /*#__PURE__*/React.createElement("div", {
|
147
|
-
className: cn()
|
152
|
+
className: cn([className, classes.root]),
|
153
|
+
ref: rootRef
|
148
154
|
}, /*#__PURE__*/React.createElement(Grid, {
|
149
155
|
guttersLeft: currentGutter,
|
150
156
|
hAlign: isGridCenterAlign ? 'center' : 'left'
|
@@ -155,7 +161,7 @@ var BenefitsPictures = function BenefitsPictures(_ref) {
|
|
155
161
|
return /*#__PURE__*/React.createElement(GridColumn, _extends({}, hAlign === 'left' ? getLeftConfig(items.length, index) : getCenterConfig(items.length, index, gridGap), {
|
156
162
|
key: index
|
157
163
|
}), /*#__PURE__*/React.createElement("div", {
|
158
|
-
className: cn('item')
|
164
|
+
className: cn('item', [classes.item])
|
159
165
|
}, /*#__PURE__*/React.createElement("img", {
|
160
166
|
className: cn('img', {
|
161
167
|
'h-align': hAlign
|
@@ -166,19 +172,27 @@ var BenefitsPictures = function BenefitsPictures(_ref) {
|
|
166
172
|
className: cn('title'),
|
167
173
|
hAlign: hAlign,
|
168
174
|
as: "h3"
|
169
|
-
}, title), /*#__PURE__*/React.createElement(Paragraph, {
|
175
|
+
}, convert(title)), /*#__PURE__*/React.createElement(Paragraph, {
|
170
176
|
align: hAlign
|
171
|
-
}, text)));
|
177
|
+
}, convert(text))));
|
172
178
|
})));
|
173
179
|
};
|
174
180
|
|
175
181
|
BenefitsPictures.propTypes = {
|
182
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
183
|
+
current: PropTypes.elementType
|
184
|
+
}), PropTypes.any])]),
|
176
185
|
items: PropTypes.arrayOf(PropTypes.shape({
|
177
186
|
title: PropTypes.string.isRequired,
|
178
187
|
text: PropTypes.string.isRequired,
|
179
188
|
img: PropTypes.string.isRequired
|
180
189
|
}).isRequired).isRequired,
|
181
190
|
hAlign: PropTypes.oneOf(['left', 'center']),
|
182
|
-
gridGap: PropTypes.oneOf(['medium', 'large'])
|
191
|
+
gridGap: PropTypes.oneOf(['medium', 'large']),
|
192
|
+
className: PropTypes.string,
|
193
|
+
classes: PropTypes.shape({
|
194
|
+
root: PropTypes.string,
|
195
|
+
item: PropTypes.string
|
196
|
+
})
|
183
197
|
};
|
184
198
|
export default BenefitsPictures;
|
@@ -1,6 +1,9 @@
|
|
1
1
|
export interface IBenefit {
|
2
|
+
/** Заголовок бенефита */
|
2
3
|
title: string;
|
4
|
+
/** Основной текст в бенефите */
|
3
5
|
text: string;
|
6
|
+
/** Изображение */
|
4
7
|
img: string;
|
5
8
|
}
|
6
9
|
declare type TGridSizeValues = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
|