@redneckz/wildless-cms-uni-blocks 0.6.41 → 0.6.43
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/bin/migration-scripts/0.6.34.js +2 -0
- package/bin/migration-scripts/0.6.43.js +29 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +213 -101
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/bundle/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/bundle/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/bundle/components/ProductTile/renderBenefit.d.ts +4 -0
- package/bundle/components/ProductTile/renderImage.d.ts +3 -0
- package/bundle/content-page-repository/transformImg.d.ts +1 -1
- package/bundle/hooks/useCachedAsyncData.d.ts +2 -0
- package/bundle/hooks/useLocation.d.ts +6 -0
- package/bundle/hooks/useRegions.d.ts +6 -0
- package/bundle/services/sitemap/SitemapProps.d.ts +8 -0
- package/bundle/ui-kit/Location/Location.d.ts +19 -0
- package/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
- package/bundle/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/bundle/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/bundle/utils/groupBy.d.ts +1 -0
- package/dist/components/Blocks.js +4 -2
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/dist/components/Header/Header.js +2 -2
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/HeaderBurger.js +4 -3
- package/dist/components/Header/HeaderBurger.js.map +1 -1
- package/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/dist/components/Header/HeaderSecondaryMenu.js +13 -4
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/ProductTile/ProductTile.js +9 -22
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/dist/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/dist/components/ProductTile/renderAdditionalDescription.js +18 -0
- package/dist/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/dist/components/ProductTile/renderBenefit.d.ts +4 -0
- package/dist/components/ProductTile/renderBenefit.js +32 -0
- package/dist/components/ProductTile/renderBenefit.js.map +1 -0
- package/dist/components/ProductTile/renderImage.d.ts +3 -0
- package/dist/components/ProductTile/renderImage.js +12 -0
- package/dist/components/ProductTile/renderImage.js.map +1 -0
- package/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/dist/components/TextBlock/TextBlock.js +13 -28
- package/dist/components/TextBlock/TextBlock.js.map +1 -1
- package/dist/content-page-repository/transformImg.d.ts +1 -1
- package/dist/content-page-repository/transformImg.js +4 -10
- package/dist/content-page-repository/transformImg.js.map +1 -1
- package/dist/content-page-repository/transformMarkdown.js +3 -3
- package/dist/content-page-repository/transformMarkdown.js.map +1 -1
- package/dist/hooks/useCachedAsyncData.d.ts +2 -0
- package/dist/hooks/useCachedAsyncData.js +25 -0
- package/dist/hooks/useCachedAsyncData.js.map +1 -0
- package/dist/hooks/useLocation.d.ts +6 -0
- package/dist/hooks/useLocation.js +26 -0
- package/dist/hooks/useLocation.js.map +1 -0
- package/dist/hooks/useRegions.d.ts +6 -0
- package/dist/hooks/useRegions.js +11 -0
- package/dist/hooks/useRegions.js.map +1 -0
- package/dist/services/sitemap/SitemapProps.d.ts +8 -0
- package/dist/ui-kit/Location/Location.d.ts +19 -0
- package/dist/ui-kit/Location/Location.js +44 -0
- package/dist/ui-kit/Location/Location.js.map +1 -0
- package/dist/ui-kit/Location/SearchBar.d.ts +6 -0
- package/dist/ui-kit/Location/SearchBar.js +9 -0
- package/dist/ui-kit/Location/SearchBar.js.map +1 -0
- package/dist/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/dist/ui-kit/MarkdownText/MarkdownText.js +9 -0
- package/dist/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/dist/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/dist/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/dist/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/dist/ui-kit/Text/Text.js +1 -5
- package/dist/ui-kit/Text/Text.js.map +1 -1
- package/dist/utils/groupBy.d.ts +1 -0
- package/dist/utils/groupBy.js +13 -0
- package/dist/utils/groupBy.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +4 -2
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.d.ts +9 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/lib/components/Header/Header.js +2 -2
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/HeaderBurger.js +4 -3
- package/lib/components/Header/HeaderBurger.js.map +1 -1
- package/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/lib/components/Header/HeaderSecondaryMenu.js +13 -4
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/ProductTile/ProductTile.js +10 -23
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/lib/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/lib/components/ProductTile/renderAdditionalDescription.js +15 -0
- package/lib/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/lib/components/ProductTile/renderBenefit.d.ts +4 -0
- package/lib/components/ProductTile/renderBenefit.js +29 -0
- package/lib/components/ProductTile/renderBenefit.js.map +1 -0
- package/lib/components/ProductTile/renderImage.d.ts +3 -0
- package/lib/components/ProductTile/renderImage.js +9 -0
- package/lib/components/ProductTile/renderImage.js.map +1 -0
- package/lib/components/Recommendation/Recommendation.fixture.d.ts +1 -1
- package/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/lib/components/TextBlock/TextBlock.js +13 -28
- package/lib/components/TextBlock/TextBlock.js.map +1 -1
- package/lib/content-page-repository/transformImg.d.ts +1 -1
- package/lib/content-page-repository/transformImg.js +4 -10
- package/lib/content-page-repository/transformImg.js.map +1 -1
- package/lib/content-page-repository/transformMarkdown.js +3 -3
- package/lib/content-page-repository/transformMarkdown.js.map +1 -1
- package/lib/hooks/useCachedAsyncData.d.ts +2 -0
- package/lib/hooks/useCachedAsyncData.js +22 -0
- package/lib/hooks/useCachedAsyncData.js.map +1 -0
- package/lib/hooks/useLocation.d.ts +6 -0
- package/lib/hooks/useLocation.js +23 -0
- package/lib/hooks/useLocation.js.map +1 -0
- package/lib/hooks/useRegions.d.ts +6 -0
- package/lib/hooks/useRegions.js +8 -0
- package/lib/hooks/useRegions.js.map +1 -0
- package/lib/services/sitemap/SitemapProps.d.ts +8 -0
- package/lib/ui-kit/Location/Location.d.ts +19 -0
- package/lib/ui-kit/Location/Location.fixture.d.ts +6 -0
- package/lib/ui-kit/Location/Location.js +42 -0
- package/lib/ui-kit/Location/Location.js.map +1 -0
- package/lib/ui-kit/Location/SearchBar.d.ts +6 -0
- package/lib/ui-kit/Location/SearchBar.js +7 -0
- package/lib/ui-kit/Location/SearchBar.js.map +1 -0
- package/lib/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/lib/ui-kit/MarkdownText/MarkdownText.js +7 -0
- package/lib/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/lib/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/lib/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/lib/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/lib/ui-kit/Text/Text.js +1 -5
- package/lib/ui-kit/Text/Text.js.map +1 -1
- package/lib/utils/groupBy.d.ts +1 -0
- package/lib/utils/groupBy.js +10 -0
- package/lib/utils/groupBy.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +49 -25
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/mobile/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/bundle/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/mobile/bundle/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/mobile/bundle/components/ProductTile/renderBenefit.d.ts +4 -0
- package/mobile/bundle/components/ProductTile/renderImage.d.ts +3 -0
- package/mobile/bundle/content-page-repository/transformImg.d.ts +1 -1
- package/mobile/bundle/hooks/useCachedAsyncData.d.ts +2 -0
- package/mobile/bundle/hooks/useLocation.d.ts +6 -0
- package/mobile/bundle/hooks/useRegions.d.ts +6 -0
- package/mobile/bundle/services/sitemap/SitemapProps.d.ts +8 -0
- package/mobile/bundle/ui-kit/Location/Location.d.ts +19 -0
- package/mobile/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
- package/mobile/bundle/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/mobile/bundle/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/mobile/bundle/utils/groupBy.d.ts +1 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/mobile/dist/components/Header/HeaderBurger.js +4 -3
- package/mobile/dist/components/Header/HeaderBurger.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js +13 -4
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTile.js +9 -22
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/mobile/dist/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/mobile/dist/components/ProductTile/renderAdditionalDescription.js +18 -0
- package/mobile/dist/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/mobile/dist/components/ProductTile/renderBenefit.d.ts +4 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js +32 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -0
- package/mobile/dist/components/ProductTile/renderImage.d.ts +3 -0
- package/mobile/dist/components/ProductTile/renderImage.js +12 -0
- package/mobile/dist/components/ProductTile/renderImage.js.map +1 -0
- package/mobile/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/dist/content-page-repository/transformImg.d.ts +1 -1
- package/mobile/dist/content-page-repository/transformImg.js +4 -10
- package/mobile/dist/content-page-repository/transformImg.js.map +1 -1
- package/mobile/dist/content-page-repository/transformMarkdown.js +3 -3
- package/mobile/dist/content-page-repository/transformMarkdown.js.map +1 -1
- package/mobile/dist/hooks/useCachedAsyncData.d.ts +2 -0
- package/mobile/dist/hooks/useCachedAsyncData.js +25 -0
- package/mobile/dist/hooks/useCachedAsyncData.js.map +1 -0
- package/mobile/dist/hooks/useLocation.d.ts +6 -0
- package/mobile/dist/hooks/useLocation.js +26 -0
- package/mobile/dist/hooks/useLocation.js.map +1 -0
- package/mobile/dist/hooks/useRegions.d.ts +6 -0
- package/mobile/dist/hooks/useRegions.js +11 -0
- package/mobile/dist/hooks/useRegions.js.map +1 -0
- package/mobile/dist/services/sitemap/SitemapProps.d.ts +8 -0
- package/mobile/dist/ui-kit/Location/Location.d.ts +19 -0
- package/mobile/dist/ui-kit/Location/Location.js +44 -0
- package/mobile/dist/ui-kit/Location/Location.js.map +1 -0
- package/mobile/dist/ui-kit/Location/SearchBar.d.ts +6 -0
- package/mobile/dist/ui-kit/Location/SearchBar.js +9 -0
- package/mobile/dist/ui-kit/Location/SearchBar.js.map +1 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownText.js +9 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/dist/ui-kit/Text/Text.js +1 -5
- package/mobile/dist/ui-kit/Text/Text.js.map +1 -1
- package/mobile/dist/utils/groupBy.d.ts +1 -0
- package/mobile/dist/utils/groupBy.js +13 -0
- package/mobile/dist/utils/groupBy.js.map +1 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/mobile/lib/components/Header/HeaderBurger.js +4 -3
- package/mobile/lib/components/Header/HeaderBurger.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js +13 -4
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTile.js +10 -23
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/mobile/lib/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/mobile/lib/components/ProductTile/renderAdditionalDescription.js +15 -0
- package/mobile/lib/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/mobile/lib/components/ProductTile/renderBenefit.d.ts +4 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js +29 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -0
- package/mobile/lib/components/ProductTile/renderImage.d.ts +3 -0
- package/mobile/lib/components/ProductTile/renderImage.js +9 -0
- package/mobile/lib/components/ProductTile/renderImage.js.map +1 -0
- package/mobile/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/lib/content-page-repository/transformImg.d.ts +1 -1
- package/mobile/lib/content-page-repository/transformImg.js +4 -10
- package/mobile/lib/content-page-repository/transformImg.js.map +1 -1
- package/mobile/lib/content-page-repository/transformMarkdown.js +3 -3
- package/mobile/lib/content-page-repository/transformMarkdown.js.map +1 -1
- package/mobile/lib/hooks/useCachedAsyncData.d.ts +2 -0
- package/mobile/lib/hooks/useCachedAsyncData.js +22 -0
- package/mobile/lib/hooks/useCachedAsyncData.js.map +1 -0
- package/mobile/lib/hooks/useLocation.d.ts +6 -0
- package/mobile/lib/hooks/useLocation.js +23 -0
- package/mobile/lib/hooks/useLocation.js.map +1 -0
- package/mobile/lib/hooks/useRegions.d.ts +6 -0
- package/mobile/lib/hooks/useRegions.js +8 -0
- package/mobile/lib/hooks/useRegions.js.map +1 -0
- package/mobile/lib/services/sitemap/SitemapProps.d.ts +8 -0
- package/mobile/lib/ui-kit/Location/Location.d.ts +19 -0
- package/mobile/lib/ui-kit/Location/Location.js +42 -0
- package/mobile/lib/ui-kit/Location/Location.js.map +1 -0
- package/mobile/lib/ui-kit/Location/SearchBar.d.ts +6 -0
- package/mobile/lib/ui-kit/Location/SearchBar.js +7 -0
- package/mobile/lib/ui-kit/Location/SearchBar.js.map +1 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownText.js +7 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/lib/ui-kit/Text/Text.js +1 -5
- package/mobile/lib/ui-kit/Text/Text.js.map +1 -1
- package/mobile/lib/utils/groupBy.d.ts +1 -0
- package/mobile/lib/utils/groupBy.js +10 -0
- package/mobile/lib/utils/groupBy.js.map +1 -0
- package/mobile/src/common.css +50 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
- package/mobile/src/components/Header/HeaderBurger.tsx +5 -7
- package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
- package/mobile/src/components/MiniGallery/MiniGallery.ui.json +1 -1
- package/mobile/src/components/ProductTile/ProductTile.example.json +3 -0
- package/mobile/src/components/ProductTile/ProductTile.tsx +13 -44
- package/mobile/src/components/ProductTile/ProductTile.ui.json +14 -1
- package/mobile/src/components/ProductTile/ProductTileContent.ts +26 -2
- package/mobile/src/components/ProductTile/renderAdditionalDescription.tsx +30 -0
- package/mobile/src/components/ProductTile/renderBenefit.tsx +39 -0
- package/mobile/src/components/ProductTile/renderImage.tsx +15 -0
- package/mobile/src/components/Recommendation/Recommendation.example.json +6 -5
- package/mobile/src/components/Recommendation/Recommendation.ui.json +8 -0
- package/mobile/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/mobile/src/content-page-repository/transformImg.ts +6 -14
- package/mobile/src/content-page-repository/transformMarkdown.ts +3 -3
- package/mobile/src/hooks/useCachedAsyncData.ts +37 -0
- package/mobile/src/hooks/useLocation.ts +48 -0
- package/mobile/src/hooks/useRegions.ts +16 -0
- package/mobile/src/services/sitemap/SitemapProps.ts +9 -0
- package/mobile/src/ui-kit/Location/Location.tsx +168 -0
- package/mobile/src/ui-kit/Location/SearchBar.tsx +30 -0
- package/mobile/src/ui-kit/MarkdownText/MarkdownText.tsx +8 -0
- package/mobile/src/ui-kit/MarkdownText/MarkdownTextProps.ts +6 -0
- package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
- package/mobile/src/ui-kit/Text/Text.tsx +5 -7
- package/mobile/src/utils/groupBy.ts +10 -0
- package/package.json +2 -2
- package/src/common.css +50 -0
- package/src/components/Blocks.ts +4 -2
- package/src/components/Carousel/Carousel.fixture.tsx +22 -4
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +47 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
- package/src/components/Header/Header.tsx +6 -4
- package/src/components/Header/HeaderBurger.tsx +5 -7
- package/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
- package/src/components/MiniGallery/MiniGallery.ui.json +1 -1
- package/src/components/ProductTile/ProductTile.example.json +3 -0
- package/src/components/ProductTile/ProductTile.fixture.tsx +11 -4
- package/src/components/ProductTile/ProductTile.tsx +13 -44
- package/src/components/ProductTile/ProductTile.ui.json +14 -1
- package/src/components/ProductTile/ProductTileContent.ts +26 -2
- package/src/components/ProductTile/renderAdditionalDescription.tsx +30 -0
- package/src/components/ProductTile/renderBenefit.tsx +39 -0
- package/src/components/ProductTile/renderImage.tsx +15 -0
- package/src/components/Recommendation/Recommendation.example.json +6 -5
- package/src/components/Recommendation/Recommendation.fixture.tsx +11 -10
- package/src/components/Recommendation/Recommendation.ui.json +8 -0
- package/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/src/components/TextBlock/TextBlock.tsx +49 -41
- package/src/content-page-repository/transformImg.ts +6 -14
- package/src/content-page-repository/transformMarkdown.ts +3 -3
- package/src/hooks/useCachedAsyncData.ts +37 -0
- package/src/hooks/useLocation.ts +48 -0
- package/src/hooks/useRegions.ts +16 -0
- package/src/services/sitemap/SitemapProps.ts +9 -0
- package/src/ui-kit/Location/Location.fixture.tsx +81 -0
- package/src/ui-kit/Location/Location.tsx +168 -0
- package/src/ui-kit/Location/SearchBar.tsx +30 -0
- package/src/ui-kit/MarkdownText/MarkdownText.tsx +8 -0
- package/src/ui-kit/MarkdownText/MarkdownTextProps.ts +6 -0
- package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
- package/src/ui-kit/Text/Text.tsx +5 -7
- package/src/utils/groupBy.ts +10 -0
- package/bundle/hooks/useGeolocation.d.ts +0 -1
- package/dist/hooks/useGeolocation.d.ts +0 -1
- package/dist/hooks/useGeolocation.js +0 -21
- package/dist/hooks/useGeolocation.js.map +0 -1
- package/lib/hooks/useGeolocation.d.ts +0 -1
- package/lib/hooks/useGeolocation.js +0 -18
- package/lib/hooks/useGeolocation.js.map +0 -1
- package/mobile/bundle/hooks/useGeolocation.d.ts +0 -1
- package/mobile/dist/hooks/useGeolocation.d.ts +0 -1
- package/mobile/dist/hooks/useGeolocation.js +0 -21
- package/mobile/dist/hooks/useGeolocation.js.map +0 -1
- package/mobile/lib/hooks/useGeolocation.d.ts +0 -1
- package/mobile/lib/hooks/useGeolocation.js +0 -18
- package/mobile/lib/hooks/useGeolocation.js.map +0 -1
- package/mobile/src/hooks/useGeolocation.ts +0 -22
- package/src/hooks/useGeolocation.ts +0 -22
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
3
|
+
import type { LinkCommonProps } from '../../model/LinkProps';
|
|
4
|
+
import type { Picture } from '../../model/Picture';
|
|
5
|
+
import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
|
|
6
|
+
import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @title Карточка рекомендаций
|
|
10
|
+
*/
|
|
11
|
+
export interface CarouselRecommendationCardContent extends HeadlineCommonProps, ListContent {
|
|
12
|
+
/**
|
|
13
|
+
* @title Соц сети
|
|
14
|
+
* @minItems 3
|
|
15
|
+
* @default [
|
|
16
|
+
* { "href": "https://t.me" },
|
|
17
|
+
* { "href": "https://vk.com" },
|
|
18
|
+
* { "href": "https://ok.ru" },
|
|
19
|
+
* ]
|
|
20
|
+
*/
|
|
21
|
+
socialMedia?: LinkCommonProps[];
|
|
22
|
+
/**
|
|
23
|
+
* @default {
|
|
24
|
+
* "format": "webp",
|
|
25
|
+
* "size": {
|
|
26
|
+
* "width": 290
|
|
27
|
+
* },
|
|
28
|
+
* "sources": [{
|
|
29
|
+
* "media": 1279,
|
|
30
|
+
* "width": 174,
|
|
31
|
+
* "format": "webp",
|
|
32
|
+
* "alignment": "southeast"
|
|
33
|
+
* }]
|
|
34
|
+
* }
|
|
35
|
+
*/
|
|
36
|
+
image?: Picture;
|
|
37
|
+
/**
|
|
38
|
+
* @default {
|
|
39
|
+
* "text": "",
|
|
40
|
+
* "version": "secondary"
|
|
41
|
+
* }
|
|
42
|
+
*/
|
|
43
|
+
button?: ButtonProps;
|
|
44
|
+
version?: BlockVersion;
|
|
45
|
+
}
|
|
@@ -25,10 +25,11 @@ export const Header = JSX<HeaderProps>(
|
|
|
25
25
|
({ bgColor = 'bg-white', className = '', showSubMenu = true, ...rest }) => {
|
|
26
26
|
const router = useRouter();
|
|
27
27
|
|
|
28
|
-
const { topItems, logo, defaultLocation, officesLink } =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const { topItems, logo, defaultLocation, foreignOffices, officesLink } =
|
|
29
|
+
useSWRResource<SitemapDataProps>(
|
|
30
|
+
projectSettings.SITEMAP || 'sitemap',
|
|
31
|
+
rest.options?.page?.fallback,
|
|
32
|
+
);
|
|
32
33
|
|
|
33
34
|
const activeTopItem = showSubMenu ? getActiveItem(topItems, router) : null;
|
|
34
35
|
|
|
@@ -56,6 +57,7 @@ export const Header = JSX<HeaderProps>(
|
|
|
56
57
|
{topMenu}
|
|
57
58
|
<HeaderSecondaryMenu
|
|
58
59
|
className="ml-auto"
|
|
60
|
+
foreignOffices={foreignOffices}
|
|
59
61
|
defaultLocation={defaultLocation}
|
|
60
62
|
officesLink={officesLink}
|
|
61
63
|
bgColor={bgColor}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useLocation } from '../../hooks/useLocation';
|
|
3
3
|
import type { VNode } from '../../model/VNode';
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
5
5
|
import { SearchBar } from '../../ui-kit/SearchBar/SearchBar';
|
|
6
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
6
7
|
import type { DispositionItem } from './HeaderContent';
|
|
7
8
|
|
|
8
9
|
export interface HeaderBurgerProps {
|
|
@@ -14,7 +15,7 @@ export interface HeaderBurgerProps {
|
|
|
14
15
|
|
|
15
16
|
export const HeaderBurger = JSX<HeaderBurgerProps>(
|
|
16
17
|
({ burgerSubMenu, onClick, defaultLocation = '', children }) => {
|
|
17
|
-
const [
|
|
18
|
+
const [location] = useLocation(defaultLocation);
|
|
18
19
|
|
|
19
20
|
return (
|
|
20
21
|
<div className="absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20">
|
|
@@ -24,10 +25,7 @@ export const HeaderBurger = JSX<HeaderBurgerProps>(
|
|
|
24
25
|
>
|
|
25
26
|
<Img image="CloseIcon" width="24" height="24" asSVG />
|
|
26
27
|
</button>
|
|
27
|
-
<button
|
|
28
|
-
onClick={getCity}
|
|
29
|
-
className="flex items-center text-s text-secondary-text p-0 mb-4 bg-transparent cursor-pointer"
|
|
30
|
-
>
|
|
28
|
+
<button className="flex items-center text-s p-0 mb-4 bg-transparent cursor-pointer">
|
|
31
29
|
<Img
|
|
32
30
|
image="GeolocationIcon"
|
|
33
31
|
width="20"
|
|
@@ -35,7 +33,7 @@ export const HeaderBurger = JSX<HeaderBurgerProps>(
|
|
|
35
33
|
className="text-primary-main box-border mr-2"
|
|
36
34
|
asSVG
|
|
37
35
|
/>
|
|
38
|
-
{
|
|
36
|
+
<Text color="text-secondary-text">{location.name}</Text>
|
|
39
37
|
</button>
|
|
40
38
|
{children}
|
|
41
39
|
<div className="mb-7">{burgerSubMenu?.map(renderBurgerSubMenuItem)}</div>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { useLocation } from '../../hooks/useLocation';
|
|
3
4
|
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
4
5
|
import type { IconVersion } from '../../model/IconVersion';
|
|
6
|
+
import type { ForeignOffice } from '../../services/sitemap/SitemapProps';
|
|
5
7
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
|
+
import { Location } from '../../ui-kit/Location/Location';
|
|
6
9
|
import { TopItem } from '../../ui-kit/TopItem/TopItem';
|
|
7
10
|
import { HeaderSecondaryMenuButton } from './HeaderSecondaryMenuButton';
|
|
8
11
|
|
|
@@ -10,6 +13,7 @@ interface HeaderSecondaryMenuContent {
|
|
|
10
13
|
defaultLocation?: string;
|
|
11
14
|
officesLink?: string;
|
|
12
15
|
bgColor?: BgColorVersion;
|
|
16
|
+
foreignOffices?: ForeignOffice[];
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
export interface HeaderSecondaryMenuProps extends HeaderSecondaryMenuContent {
|
|
@@ -30,8 +34,23 @@ const LINKS_ICON_VERSION_MAP: Record<BgColorVersion, IconVersion> = {
|
|
|
30
34
|
};
|
|
31
35
|
|
|
32
36
|
export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
33
|
-
({
|
|
34
|
-
|
|
37
|
+
({
|
|
38
|
+
className,
|
|
39
|
+
officesLink,
|
|
40
|
+
defaultLocation = 'Москва',
|
|
41
|
+
foreignOffices,
|
|
42
|
+
bgColor = 'bg-white',
|
|
43
|
+
}) => {
|
|
44
|
+
const [isShowLocationModal, setShowLocationModal] = useState<boolean>(false);
|
|
45
|
+
|
|
46
|
+
const [location, onChangeLocation] = useLocation(defaultLocation);
|
|
47
|
+
|
|
48
|
+
const showLocationModal = () => {
|
|
49
|
+
setShowLocationModal(true);
|
|
50
|
+
};
|
|
51
|
+
const hideLocationModal = () => {
|
|
52
|
+
setShowLocationModal(false);
|
|
53
|
+
};
|
|
35
54
|
|
|
36
55
|
return (
|
|
37
56
|
<div className={`flex items-center ${className || ''}`}>
|
|
@@ -39,9 +58,9 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
39
58
|
className="mr-5"
|
|
40
59
|
flat={true}
|
|
41
60
|
href="#"
|
|
42
|
-
text={
|
|
61
|
+
text={location.name}
|
|
43
62
|
ariaLabel="Местоположение"
|
|
44
|
-
onClick={
|
|
63
|
+
onClick={showLocationModal}
|
|
45
64
|
bgColor={bgColor}
|
|
46
65
|
/>
|
|
47
66
|
{officesLink ? (
|
|
@@ -76,6 +95,14 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
76
95
|
asSVG
|
|
77
96
|
/>
|
|
78
97
|
</HeaderSecondaryMenuButton>
|
|
98
|
+
{isShowLocationModal ? (
|
|
99
|
+
<Location
|
|
100
|
+
currentLocation={location}
|
|
101
|
+
foreignOffices={foreignOffices}
|
|
102
|
+
onChangeLocation={onChangeLocation}
|
|
103
|
+
close={hideLocationModal}
|
|
104
|
+
/>
|
|
105
|
+
) : null}
|
|
79
106
|
</div>
|
|
80
107
|
);
|
|
81
108
|
},
|
|
@@ -12,14 +12,17 @@
|
|
|
12
12
|
"version": "primary",
|
|
13
13
|
"benefits": [
|
|
14
14
|
{
|
|
15
|
+
"type": "default",
|
|
15
16
|
"label": "Преимущество 1",
|
|
16
17
|
"description": "Описание"
|
|
17
18
|
},
|
|
18
19
|
{
|
|
20
|
+
"type": "default",
|
|
19
21
|
"label": "Преимущество 2",
|
|
20
22
|
"description": "Описание"
|
|
21
23
|
},
|
|
22
24
|
{
|
|
25
|
+
"type": "default",
|
|
23
26
|
"label": "Преимущество 3",
|
|
24
27
|
"description": "Описание"
|
|
25
28
|
}
|
|
@@ -2,7 +2,7 @@ import type { Picture } from '../../model/Picture';
|
|
|
2
2
|
import '../../setup-fixture';
|
|
3
3
|
import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
|
|
4
4
|
import { ProductTile } from './ProductTile';
|
|
5
|
-
import type { ProductTileContent } from './ProductTileContent';
|
|
5
|
+
import type { Benefit, ProductTileContent } from './ProductTileContent';
|
|
6
6
|
|
|
7
7
|
const imageSize = {
|
|
8
8
|
height: 242,
|
|
@@ -37,38 +37,45 @@ const building: Picture = {
|
|
|
37
37
|
size: imageSize,
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
const benefits = [
|
|
40
|
+
const benefits: Benefit[] = [
|
|
41
41
|
{
|
|
42
|
+
type: 'default',
|
|
42
43
|
label: 'до 5 млн Р',
|
|
43
44
|
description: 'Кредитный лимит',
|
|
44
45
|
},
|
|
45
46
|
{
|
|
47
|
+
type: 'default',
|
|
46
48
|
label: 'от 12,5%',
|
|
47
49
|
description: 'Процентная ставка',
|
|
48
50
|
},
|
|
49
51
|
{
|
|
52
|
+
type: 'default',
|
|
50
53
|
label: 'до 5 лет',
|
|
51
54
|
description: 'Срок кредитования',
|
|
52
55
|
},
|
|
53
56
|
];
|
|
54
57
|
|
|
55
|
-
const benefits2 = [
|
|
58
|
+
const benefits2: Benefit[] = [
|
|
56
59
|
{
|
|
60
|
+
type: 'default',
|
|
57
61
|
label: '1 год',
|
|
58
62
|
description: 'срок программы',
|
|
59
63
|
},
|
|
60
64
|
];
|
|
61
65
|
|
|
62
|
-
const multilineBenefits = [
|
|
66
|
+
const multilineBenefits: Benefit[] = [
|
|
63
67
|
{
|
|
68
|
+
type: 'default',
|
|
64
69
|
label: 'Широкий',
|
|
65
70
|
description: 'выбор платёжных систем',
|
|
66
71
|
},
|
|
67
72
|
{
|
|
73
|
+
type: 'default',
|
|
68
74
|
label: 'Специальные',
|
|
69
75
|
description: 'условия по снятию наличных условия по снятию наличных',
|
|
70
76
|
},
|
|
71
77
|
{
|
|
78
|
+
type: 'default',
|
|
72
79
|
label: '0,5 балла',
|
|
73
80
|
description: '«Урожай» за 100 рублей «Урожай» за 100 рублей',
|
|
74
81
|
},
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
-
import {
|
|
3
|
+
import { VersionStyleMap } from '../../model/BlockVersion';
|
|
4
4
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
5
5
|
import type { Picture } from '../../model/Picture';
|
|
6
6
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
7
7
|
import { ButtonSection } from '../../ui-kit/Button/ButtonSection';
|
|
8
|
-
import { Img } from '../../ui-kit/Img/Img';
|
|
9
8
|
import { getTileRightPadding } from '../BaseTile/getTileRightPadding';
|
|
10
9
|
import { Headline } from '../Headline/Headline';
|
|
11
|
-
import type {
|
|
10
|
+
import type { Benefit, ProductTileContent } from './ProductTileContent';
|
|
11
|
+
import { renderAdditionalDescription } from './renderAdditionalDescription';
|
|
12
|
+
import { renderBenefit } from './renderBenefit';
|
|
13
|
+
import { renderImage } from './renderImage';
|
|
12
14
|
|
|
13
15
|
export interface ProductTileProps extends ProductTileContent, UniBlockProps {}
|
|
14
16
|
|
|
@@ -43,7 +45,7 @@ export const ProductTile = JSX<ProductTileProps>(
|
|
|
43
45
|
{...rest}
|
|
44
46
|
/>
|
|
45
47
|
{renderBenefits(benefits, version, image)}
|
|
46
|
-
{
|
|
48
|
+
{renderAdditionalDescription(additionalDescription, image)}
|
|
47
49
|
{buttons?.length ? (
|
|
48
50
|
<ButtonSection buttons={buttons} className="mt-5 gap-4 z-10 text-l" />
|
|
49
51
|
) : null}
|
|
@@ -53,53 +55,20 @@ export const ProductTile = JSX<ProductTileProps>(
|
|
|
53
55
|
),
|
|
54
56
|
);
|
|
55
57
|
|
|
56
|
-
function renderBenefits(benefits:
|
|
58
|
+
function renderBenefits(benefits: Benefit[], version: BlockVersion, image?: Picture) {
|
|
59
|
+
if (!benefits.length) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
57
63
|
// picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
|
|
58
|
-
const
|
|
64
|
+
const benefitsWidth = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
59
65
|
|
|
60
66
|
return (
|
|
61
67
|
<div
|
|
62
68
|
className={`z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline
|
|
63
|
-
${
|
|
69
|
+
${benefitsWidth}`}
|
|
64
70
|
>
|
|
65
71
|
{benefits.length ? benefits.map(renderBenefit(version)) : null}
|
|
66
72
|
</div>
|
|
67
73
|
);
|
|
68
74
|
}
|
|
69
|
-
|
|
70
|
-
const renderBenefit =
|
|
71
|
-
(version: BlockVersion = 'primary') =>
|
|
72
|
-
(benefit: TextBenefit, i: number) => {
|
|
73
|
-
const { label = '', description = '' } = benefit;
|
|
74
|
-
|
|
75
|
-
return [
|
|
76
|
-
<div key={`label-${i}`} className="text-h6">
|
|
77
|
-
{label}
|
|
78
|
-
</div>,
|
|
79
|
-
<div key={`desc-${i}`} className={`text-m-light ${VersionAdditionalStyleMap[version]}`}>
|
|
80
|
-
{description}
|
|
81
|
-
</div>,
|
|
82
|
-
];
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
function renderAdditionalDescription(additionalDescription: string, image?: Picture) {
|
|
86
|
-
// picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
|
|
87
|
-
const DESCRIPTION_WIDTH = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<div className={`text-m-light mt-2.5 z-10 ${DESCRIPTION_WIDTH}`}>{additionalDescription}</div>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function renderImage(image?: Picture, isImageOnRightSide?: boolean) {
|
|
95
|
-
if (!image?.src) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<Img
|
|
101
|
-
className={`absolute ${isImageOnRightSide ? 'right-0' : 'left-0'} bottom-0`}
|
|
102
|
-
image={image}
|
|
103
|
-
/>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
@@ -2,8 +2,32 @@ import type { BlockVersion } from '../../model/BlockVersion';
|
|
|
2
2
|
import type { DescriptionProps, HeadlineProps, LabelProps } from '../../model/HeadlineType';
|
|
3
3
|
import type { Picture } from '../../model/Picture';
|
|
4
4
|
import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
|
|
5
|
+
import type { MarkdownTextProps } from '../../ui-kit/MarkdownText/MarkdownTextProps';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @title Стандартный
|
|
9
|
+
*/
|
|
10
|
+
type TextBenefit = DescriptionProps &
|
|
11
|
+
LabelProps & {
|
|
12
|
+
/** @default default */
|
|
13
|
+
type: 'default';
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @title Форматированный текст
|
|
18
|
+
*/
|
|
19
|
+
type MarkdownTextContent = MarkdownTextProps & {
|
|
20
|
+
/** @default md */
|
|
21
|
+
type: 'md';
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @title Преимущество
|
|
26
|
+
* @default{
|
|
27
|
+
* "type": "default"
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
export type Benefit = TextBenefit | MarkdownTextContent;
|
|
7
31
|
|
|
8
32
|
/**
|
|
9
33
|
* @title Продуктовая плитка
|
|
@@ -30,7 +54,7 @@ export type ProductTileContent = HeadlineProps &
|
|
|
30
54
|
* @title Преимущества
|
|
31
55
|
* @maxItems 7
|
|
32
56
|
*/
|
|
33
|
-
benefits?:
|
|
57
|
+
benefits?: Benefit[];
|
|
34
58
|
/** @title Дополнительное описание */
|
|
35
59
|
additionalDescription?: string;
|
|
36
60
|
/** @title Картинка справа/текст слева */
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { Picture } from '../../model/Picture';
|
|
3
|
+
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
4
|
+
import type { TextColor } from '../../ui-kit/Text/TextProps';
|
|
5
|
+
|
|
6
|
+
const DESCRIPTION_STYLE_MAP: Record<BlockVersion, TextColor> = {
|
|
7
|
+
primary: 'text-secondary-text',
|
|
8
|
+
secondary: 'text-white',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function renderAdditionalDescription(
|
|
12
|
+
additionalDescription?: string,
|
|
13
|
+
image?: Picture,
|
|
14
|
+
version: BlockVersion = 'primary',
|
|
15
|
+
) {
|
|
16
|
+
if (!additionalDescription) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
|
|
21
|
+
const descriptionWidth = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div className={`mt-2.5 z-10 ${descriptionWidth}`}>
|
|
25
|
+
<Paragraph size="text-m" font="font-light" color={DESCRIPTION_STYLE_MAP[version]}>
|
|
26
|
+
{additionalDescription}
|
|
27
|
+
</Paragraph>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import { MarkdownText } from '../../ui-kit/MarkdownText/MarkdownText';
|
|
3
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
4
|
+
import type { TextColor } from '../../ui-kit/Text/TextProps';
|
|
5
|
+
import { assertUnreachable } from '../../utils/assertUnreachable';
|
|
6
|
+
import type { Benefit } from './ProductTileContent';
|
|
7
|
+
|
|
8
|
+
const LABEL_STYLE_MAP: Record<BlockVersion, TextColor> = {
|
|
9
|
+
primary: 'text-secondary-text',
|
|
10
|
+
secondary: 'text-white',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const renderBenefit =
|
|
14
|
+
(version: BlockVersion = 'primary') =>
|
|
15
|
+
// Linter doesn't understand that switch processes all cases
|
|
16
|
+
// eslint-disable-next-line consistent-return
|
|
17
|
+
(benefit: Benefit, i: number) => {
|
|
18
|
+
const { type } = benefit;
|
|
19
|
+
|
|
20
|
+
if (!(type === 'default' || type === 'md')) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
switch (type) {
|
|
25
|
+
case 'default':
|
|
26
|
+
return [
|
|
27
|
+
<Text key={`label-${i}`} size="text-h6">
|
|
28
|
+
{benefit.label}
|
|
29
|
+
</Text>,
|
|
30
|
+
<Text key={`desc-${i}`} size="text-m-light" color={LABEL_STYLE_MAP[version]}>
|
|
31
|
+
{benefit.description}
|
|
32
|
+
</Text>,
|
|
33
|
+
];
|
|
34
|
+
case 'md':
|
|
35
|
+
return <MarkdownText md={benefit.md} />;
|
|
36
|
+
default:
|
|
37
|
+
assertUnreachable(benefit);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Picture } from '../../model/Picture';
|
|
2
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
3
|
+
|
|
4
|
+
export function renderImage(image?: Picture, isImageOnRightSide?: boolean) {
|
|
5
|
+
if (!image?.src) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<Img
|
|
11
|
+
className={`absolute ${isImageOnRightSide ? 'right-0' : 'left-0'} bottom-0`}
|
|
12
|
+
image={image}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -28,11 +28,12 @@
|
|
|
28
28
|
},
|
|
29
29
|
"title": "Заголовок 2",
|
|
30
30
|
"description": "Описание 2",
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
"button": {
|
|
32
|
+
"href": "",
|
|
33
|
+
"text": "Подробнее",
|
|
34
|
+
"target": "_self",
|
|
35
|
+
"version": "primary"
|
|
36
|
+
}
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
"image": {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import '../../setup-fixture';
|
|
2
|
+
import { Recommendation, RecommendationProps } from './Recommendation';
|
|
3
|
+
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
1
4
|
import type { LinkProps } from '../../model/LinkProps';
|
|
2
5
|
import type { Picture } from '../../model/Picture';
|
|
3
|
-
import '../../setup-fixture';
|
|
4
|
-
import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
|
|
5
|
-
import type { RecommendationProps } from './Recommendation';
|
|
6
|
-
import { Recommendation } from './Recommendation';
|
|
7
6
|
|
|
8
7
|
const cowCard: Picture = {
|
|
9
8
|
src: 'cow-card.png',
|
|
@@ -51,6 +50,13 @@ const socialMedia: LinkProps[] = [
|
|
|
51
50
|
{ href: 'https://ok.ru' },
|
|
52
51
|
];
|
|
53
52
|
|
|
53
|
+
const button: ButtonWithIconProps = {
|
|
54
|
+
href: 'https://rshb.ru',
|
|
55
|
+
text: 'Подробнее',
|
|
56
|
+
target: '_blank',
|
|
57
|
+
version: 'secondary',
|
|
58
|
+
};
|
|
59
|
+
|
|
54
60
|
export const defaultProps: RecommendationProps = {
|
|
55
61
|
title: 'Мы в социальных сетях',
|
|
56
62
|
recommendations: [
|
|
@@ -76,6 +82,7 @@ export const defaultProps: RecommendationProps = {
|
|
|
76
82
|
title: 'Кредитные карты',
|
|
77
83
|
description: 'Льготный период 120 дней',
|
|
78
84
|
image: productBasket,
|
|
85
|
+
button,
|
|
79
86
|
},
|
|
80
87
|
{
|
|
81
88
|
title: 'Кредитные карты',
|
|
@@ -111,12 +118,6 @@ export const shortProps: RecommendationProps = {
|
|
|
111
118
|
],
|
|
112
119
|
};
|
|
113
120
|
|
|
114
|
-
const button: ButtonProps = {
|
|
115
|
-
text: 'Подробнее',
|
|
116
|
-
href: '/credit-cards',
|
|
117
|
-
version: 'secondary',
|
|
118
|
-
};
|
|
119
|
-
|
|
120
121
|
export const buttonProps: RecommendationProps = {
|
|
121
122
|
title: 'Также интересуются',
|
|
122
123
|
recommendations: [
|
|
@@ -41,7 +41,7 @@ export const RecommendationCard = JSX<RecommendationCardProps>(
|
|
|
41
41
|
<SocialMedia className="pt-10 pb-0" media={socialMedia} version={version} />
|
|
42
42
|
) : null}
|
|
43
43
|
{button?.text ? (
|
|
44
|
-
<div className="pt-2">{renderButton({ button, buttonClassName: 'mt-16' })}</div>
|
|
44
|
+
<div className="pt-2">{renderButton({ button, buttonClassName: 'mt-16 px-5' })}</div>
|
|
45
45
|
) : null}
|
|
46
46
|
</div>
|
|
47
47
|
</BaseTile>
|