@redneckz/wildless-cms-uni-blocks 0.12.3 → 0.12.5
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.12.3.js +2 -0
- package/bin/migration-scripts/0.9.10.js +1 -1
- package/bundle/bundle.umd.js +43 -77
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/BenefitsBlock/BenefitsBlock.d.ts +1 -1
- package/bundle/components/BenefitsBlock/benefitImageStyles.d.ts +1 -0
- package/bundle/components/BenefitsBlock/benefitImageStyles.mobile.d.ts +1 -0
- package/bundle/components/BonusBenefitsBlock/bonusBenefitAlign.d.ts +1 -0
- package/bundle/components/BonusBenefitsBlock/bonusBenefitAlign.mobile.d.ts +1 -0
- package/bundle/components/BonusBenefitsBlock/bonusBenefitStyles.d.ts +1 -0
- package/bundle/components/BonusBenefitsBlock/bonusBenefitStyles.mobile.d.ts +1 -0
- package/bundle/components/BonusBenefitsBlock/renderBonusBenefit.d.ts +3 -0
- package/bundle/components/BonusBenefitsBlock/renderBonusBenefits.d.ts +4 -0
- package/bundle/components/BonusBenefitsBlock/renderBonusBenefits.mobile.d.ts +4 -0
- package/bundle/components/CarouselCatalogCard/CatalogCard.d.ts +9 -0
- package/bundle/components/CarouselProgramsCard/programCardStyles.d.ts +2 -0
- package/bundle/components/CarouselProgramsCard/programCardStyles.mobile.d.ts +2 -0
- package/bundle/components/Tabs/tabItemClasses.d.ts +2 -3
- package/dist/components/BenefitsBlock/BenefitsBlock.d.ts +1 -1
- package/dist/components/BenefitsBlock/BenefitsBlock.js +4 -6
- package/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/dist/components/BenefitsBlock/benefitImageStyles.d.ts +1 -0
- package/dist/components/BenefitsBlock/benefitImageStyles.js +4 -0
- package/dist/components/BenefitsBlock/benefitImageStyles.js.map +1 -0
- package/dist/components/BenefitsBlock/benefitImageStyles.mobile.d.ts +1 -0
- package/dist/components/BenefitsBlock/benefitImageStyles.mobile.js +4 -0
- package/dist/components/BenefitsBlock/benefitImageStyles.mobile.js.map +1 -0
- package/dist/components/Blocks.mobile.js +6 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +4 -18
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/dist/components/BonusBenefitsBlock/bonusBenefitAlign.d.ts +1 -0
- package/dist/components/BonusBenefitsBlock/bonusBenefitAlign.js +4 -0
- package/dist/components/BonusBenefitsBlock/bonusBenefitAlign.js.map +1 -0
- package/dist/components/BonusBenefitsBlock/bonusBenefitAlign.mobile.d.ts +1 -0
- package/dist/components/BonusBenefitsBlock/bonusBenefitAlign.mobile.js +4 -0
- package/dist/components/BonusBenefitsBlock/bonusBenefitAlign.mobile.js.map +1 -0
- package/dist/components/BonusBenefitsBlock/bonusBenefitStyles.d.ts +1 -0
- package/dist/components/BonusBenefitsBlock/bonusBenefitStyles.js +4 -0
- package/dist/components/BonusBenefitsBlock/bonusBenefitStyles.js.map +1 -0
- package/dist/components/BonusBenefitsBlock/bonusBenefitStyles.mobile.d.ts +1 -0
- package/dist/components/BonusBenefitsBlock/bonusBenefitStyles.mobile.js +4 -0
- package/dist/components/BonusBenefitsBlock/bonusBenefitStyles.mobile.js.map +1 -0
- package/dist/components/BonusBenefitsBlock/renderBonusBenefit.d.ts +3 -0
- package/dist/components/BonusBenefitsBlock/renderBonusBenefit.js +11 -0
- package/dist/components/BonusBenefitsBlock/renderBonusBenefit.js.map +1 -0
- package/dist/components/BonusBenefitsBlock/renderBonusBenefits.d.ts +4 -0
- package/dist/components/BonusBenefitsBlock/renderBonusBenefits.js +20 -0
- package/dist/components/BonusBenefitsBlock/renderBonusBenefits.js.map +1 -0
- package/dist/components/BonusBenefitsBlock/renderBonusBenefits.mobile.d.ts +4 -0
- package/dist/components/BonusBenefitsBlock/renderBonusBenefits.mobile.js +8 -0
- package/dist/components/BonusBenefitsBlock/renderBonusBenefits.mobile.js.map +1 -0
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +2 -2
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/dist/components/CarouselCatalogCard/CatalogCard.d.ts +9 -0
- package/dist/components/CarouselCatalogCard/CatalogCard.js +20 -0
- package/dist/components/CarouselCatalogCard/CatalogCard.js.map +1 -0
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +5 -2
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/dist/components/CarouselProgramsCard/programCardStyles.d.ts +2 -0
- package/dist/components/CarouselProgramsCard/programCardStyles.js +5 -0
- package/dist/components/CarouselProgramsCard/programCardStyles.js.map +1 -0
- package/dist/components/CarouselProgramsCard/programCardStyles.mobile.d.ts +2 -0
- package/dist/components/CarouselProgramsCard/programCardStyles.mobile.js +5 -0
- package/dist/components/CarouselProgramsCard/programCardStyles.mobile.js.map +1 -0
- package/dist/components/Tabs/LinkTab.js +2 -1
- package/dist/components/Tabs/LinkTab.js.map +1 -1
- package/dist/components/Tabs/Tabs.js +3 -2
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/renderGroupTab.js +7 -13
- package/dist/components/Tabs/renderGroupTab.js.map +1 -1
- package/dist/components/Tabs/tabItemClasses.d.ts +2 -3
- package/dist/components/Tabs/tabItemClasses.js +10 -46
- package/dist/components/Tabs/tabItemClasses.js.map +1 -1
- package/dist/components/TariffsTable/TariffsTable.mobile.js +0 -1
- package/dist/components/TariffsTable/TariffsTable.mobile.js.map +1 -1
- package/dist/ui-kit/PhoneInput/PhoneInput.js +1 -1
- package/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/BenefitsBlock/BenefitsBlock.d.ts +1 -1
- package/lib/components/BenefitsBlock/BenefitsBlock.fixture.mobile.d.ts +6 -0
- package/lib/components/BenefitsBlock/BenefitsBlock.js +4 -6
- package/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/lib/components/BenefitsBlock/benefitImageStyles.d.ts +1 -0
- package/lib/components/BenefitsBlock/benefitImageStyles.js +2 -0
- package/lib/components/BenefitsBlock/benefitImageStyles.js.map +1 -0
- package/lib/components/BenefitsBlock/benefitImageStyles.mobile.d.ts +1 -0
- package/lib/components/BenefitsBlock/benefitImageStyles.mobile.js +2 -0
- package/lib/components/BenefitsBlock/benefitImageStyles.mobile.js.map +1 -0
- package/lib/components/Blocks.mobile.js +6 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.fixture.mobile.d.ts +7 -0
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +4 -18
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/lib/components/BonusBenefitsBlock/bonusBenefitAlign.d.ts +1 -0
- package/lib/components/BonusBenefitsBlock/bonusBenefitAlign.js +2 -0
- package/lib/components/BonusBenefitsBlock/bonusBenefitAlign.js.map +1 -0
- package/lib/components/BonusBenefitsBlock/bonusBenefitAlign.mobile.d.ts +1 -0
- package/lib/components/BonusBenefitsBlock/bonusBenefitAlign.mobile.js +2 -0
- package/lib/components/BonusBenefitsBlock/bonusBenefitAlign.mobile.js.map +1 -0
- package/lib/components/BonusBenefitsBlock/bonusBenefitStyles.d.ts +1 -0
- package/lib/components/BonusBenefitsBlock/bonusBenefitStyles.js +2 -0
- package/lib/components/BonusBenefitsBlock/bonusBenefitStyles.js.map +1 -0
- package/lib/components/BonusBenefitsBlock/bonusBenefitStyles.mobile.d.ts +1 -0
- package/lib/components/BonusBenefitsBlock/bonusBenefitStyles.mobile.js +2 -0
- package/lib/components/BonusBenefitsBlock/bonusBenefitStyles.mobile.js.map +1 -0
- package/lib/components/BonusBenefitsBlock/renderBonusBenefit.d.ts +2 -0
- package/lib/components/BonusBenefitsBlock/renderBonusBenefit.js +8 -0
- package/lib/components/BonusBenefitsBlock/renderBonusBenefit.js.map +1 -0
- package/lib/components/BonusBenefitsBlock/renderBonusBenefits.d.ts +4 -0
- package/lib/components/BonusBenefitsBlock/renderBonusBenefits.js +17 -0
- package/lib/components/BonusBenefitsBlock/renderBonusBenefits.js.map +1 -0
- package/lib/components/BonusBenefitsBlock/renderBonusBenefits.mobile.d.ts +3 -0
- package/lib/components/BonusBenefitsBlock/renderBonusBenefits.mobile.js +5 -0
- package/lib/components/BonusBenefitsBlock/renderBonusBenefits.mobile.js.map +1 -0
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.fixture.d.ts +0 -11
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.fixture.mobile.d.ts +6 -0
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +2 -2
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/lib/components/CarouselCatalogCard/CatalogCard.d.ts +9 -0
- package/lib/components/CarouselCatalogCard/CatalogCard.js +18 -0
- package/lib/components/CarouselCatalogCard/CatalogCard.js.map +1 -0
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.fixture.d.ts +0 -1
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.fixture.mobile.d.ts +7 -0
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +5 -2
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/lib/components/CarouselProgramsCard/programCardStyles.d.ts +2 -0
- package/lib/components/CarouselProgramsCard/programCardStyles.js +3 -0
- package/lib/components/CarouselProgramsCard/programCardStyles.js.map +1 -0
- package/lib/components/CarouselProgramsCard/programCardStyles.mobile.d.ts +2 -0
- package/lib/components/CarouselProgramsCard/programCardStyles.mobile.js +3 -0
- package/lib/components/CarouselProgramsCard/programCardStyles.mobile.js.map +1 -0
- package/lib/components/Tabs/LinkTab.js +3 -2
- package/lib/components/Tabs/LinkTab.js.map +1 -1
- package/lib/components/Tabs/Tabs.fixture.mobile.d.ts +8 -0
- package/lib/components/Tabs/Tabs.js +3 -2
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/renderGroupTab.d.ts +0 -1
- package/lib/components/Tabs/renderGroupTab.js +9 -15
- package/lib/components/Tabs/renderGroupTab.js.map +1 -1
- package/lib/components/Tabs/renderTab.d.ts +0 -1
- package/lib/components/Tabs/tabItemClasses.d.ts +2 -3
- package/lib/components/Tabs/tabItemClasses.js +8 -43
- package/lib/components/Tabs/tabItemClasses.js.map +1 -1
- package/lib/components/TariffsTable/TariffsTable.mobile.js +0 -1
- package/lib/components/TariffsTable/TariffsTable.mobile.js.map +1 -1
- package/lib/ui-kit/PhoneInput/PhoneInput.js +1 -1
- package/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +507 -335
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/BenefitsBlock/BenefitsBlock.d.ts +1 -1
- package/mobile/bundle/components/BenefitsBlock/benefitImageStyles.d.ts +1 -0
- package/mobile/bundle/components/BonusBenefitsBlock/bonusBenefitAlign.d.ts +1 -0
- package/mobile/bundle/components/BonusBenefitsBlock/bonusBenefitStyles.d.ts +1 -0
- package/mobile/bundle/components/BonusBenefitsBlock/renderBonusBenefit.d.ts +3 -0
- package/mobile/bundle/components/BonusBenefitsBlock/renderBonusBenefits.d.ts +4 -0
- package/mobile/bundle/components/CarouselCatalogCard/CatalogCard.d.ts +9 -0
- package/mobile/bundle/components/CarouselProgramsCard/programCardStyles.d.ts +2 -0
- package/mobile/bundle/components/Tabs/tabItemClasses.d.ts +2 -3
- package/mobile/dist/components/BenefitsBlock/BenefitsBlock.d.ts +1 -1
- package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js +4 -6
- package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/mobile/dist/components/BenefitsBlock/benefitImageStyles.d.ts +1 -0
- package/mobile/dist/components/BenefitsBlock/benefitImageStyles.js +4 -0
- package/mobile/dist/components/BenefitsBlock/benefitImageStyles.js.map +1 -0
- package/mobile/dist/components/Blocks.js +6 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +4 -18
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/mobile/dist/components/BonusBenefitsBlock/bonusBenefitAlign.d.ts +1 -0
- package/mobile/dist/components/BonusBenefitsBlock/bonusBenefitAlign.js +4 -0
- package/mobile/dist/components/BonusBenefitsBlock/bonusBenefitAlign.js.map +1 -0
- package/mobile/dist/components/BonusBenefitsBlock/bonusBenefitStyles.d.ts +1 -0
- package/mobile/dist/components/BonusBenefitsBlock/bonusBenefitStyles.js +4 -0
- package/mobile/dist/components/BonusBenefitsBlock/bonusBenefitStyles.js.map +1 -0
- package/mobile/dist/components/BonusBenefitsBlock/renderBonusBenefit.d.ts +3 -0
- package/mobile/dist/components/BonusBenefitsBlock/renderBonusBenefit.js +11 -0
- package/mobile/dist/components/BonusBenefitsBlock/renderBonusBenefit.js.map +1 -0
- package/mobile/dist/components/BonusBenefitsBlock/renderBonusBenefits.d.ts +4 -0
- package/mobile/dist/components/BonusBenefitsBlock/renderBonusBenefits.js +8 -0
- package/mobile/dist/components/BonusBenefitsBlock/renderBonusBenefits.js.map +1 -0
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +2 -2
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/dist/components/CarouselCatalogCard/CatalogCard.d.ts +9 -0
- package/mobile/dist/components/CarouselCatalogCard/CatalogCard.js +20 -0
- package/mobile/dist/components/CarouselCatalogCard/CatalogCard.js.map +1 -0
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +5 -2
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/dist/components/CarouselProgramsCard/programCardStyles.d.ts +2 -0
- package/mobile/dist/components/CarouselProgramsCard/programCardStyles.js +5 -0
- package/mobile/dist/components/CarouselProgramsCard/programCardStyles.js.map +1 -0
- package/mobile/dist/components/Tabs/LinkTab.js +2 -1
- package/mobile/dist/components/Tabs/LinkTab.js.map +1 -1
- package/mobile/dist/components/Tabs/Tabs.js +3 -2
- package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
- package/mobile/dist/components/Tabs/renderGroupTab.js +7 -13
- package/mobile/dist/components/Tabs/renderGroupTab.js.map +1 -1
- package/mobile/dist/components/Tabs/tabItemClasses.d.ts +2 -3
- package/mobile/dist/components/Tabs/tabItemClasses.js +10 -46
- package/mobile/dist/components/Tabs/tabItemClasses.js.map +1 -1
- package/mobile/dist/components/TariffsTable/TariffsTable.js +0 -1
- package/mobile/dist/components/TariffsTable/TariffsTable.js.map +1 -1
- package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js +1 -1
- package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/BenefitsBlock/BenefitsBlock.d.ts +1 -1
- package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js +4 -6
- package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/mobile/lib/components/BenefitsBlock/benefitImageStyles.d.ts +1 -0
- package/mobile/lib/components/BenefitsBlock/benefitImageStyles.js +2 -0
- package/mobile/lib/components/BenefitsBlock/benefitImageStyles.js.map +1 -0
- package/mobile/lib/components/Blocks.js +6 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +4 -18
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/mobile/lib/components/BonusBenefitsBlock/bonusBenefitAlign.d.ts +1 -0
- package/mobile/lib/components/BonusBenefitsBlock/bonusBenefitAlign.js +2 -0
- package/mobile/lib/components/BonusBenefitsBlock/bonusBenefitAlign.js.map +1 -0
- package/mobile/lib/components/BonusBenefitsBlock/bonusBenefitStyles.d.ts +1 -0
- package/mobile/lib/components/BonusBenefitsBlock/bonusBenefitStyles.js +2 -0
- package/mobile/lib/components/BonusBenefitsBlock/bonusBenefitStyles.js.map +1 -0
- package/mobile/lib/components/BonusBenefitsBlock/renderBonusBenefit.d.ts +3 -0
- package/mobile/lib/components/BonusBenefitsBlock/renderBonusBenefit.js +8 -0
- package/mobile/lib/components/BonusBenefitsBlock/renderBonusBenefit.js.map +1 -0
- package/mobile/lib/components/BonusBenefitsBlock/renderBonusBenefits.d.ts +4 -0
- package/mobile/lib/components/BonusBenefitsBlock/renderBonusBenefits.js +5 -0
- package/mobile/lib/components/BonusBenefitsBlock/renderBonusBenefits.js.map +1 -0
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +2 -2
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/lib/components/CarouselCatalogCard/CatalogCard.d.ts +9 -0
- package/mobile/lib/components/CarouselCatalogCard/CatalogCard.js +18 -0
- package/mobile/lib/components/CarouselCatalogCard/CatalogCard.js.map +1 -0
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +5 -2
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/lib/components/CarouselProgramsCard/programCardStyles.d.ts +2 -0
- package/mobile/lib/components/CarouselProgramsCard/programCardStyles.js +3 -0
- package/mobile/lib/components/CarouselProgramsCard/programCardStyles.js.map +1 -0
- package/mobile/lib/components/Tabs/LinkTab.js +3 -2
- package/mobile/lib/components/Tabs/LinkTab.js.map +1 -1
- package/mobile/lib/components/Tabs/Tabs.js +3 -2
- package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/components/Tabs/renderGroupTab.js +9 -15
- package/mobile/lib/components/Tabs/renderGroupTab.js.map +1 -1
- package/mobile/lib/components/Tabs/tabItemClasses.d.ts +2 -3
- package/mobile/lib/components/Tabs/tabItemClasses.js +8 -43
- package/mobile/lib/components/Tabs/tabItemClasses.js.map +1 -1
- package/mobile/lib/components/TariffsTable/TariffsTable.js +0 -1
- package/mobile/lib/components/TariffsTable/TariffsTable.js.map +1 -1
- package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js +1 -1
- package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
- package/mobile/src/common.css +3 -0
- package/mobile/src/components/BenefitsBlock/BenefitsBlock.tsx +37 -34
- package/mobile/src/components/BenefitsBlock/benefitImageStyles.tsx +1 -0
- package/mobile/src/components/Blocks.ts +6 -0
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +13 -49
- package/mobile/src/components/BonusBenefitsBlock/bonusBenefitAlign.ts +1 -0
- package/mobile/src/components/BonusBenefitsBlock/bonusBenefitStyles.ts +1 -0
- package/mobile/src/components/BonusBenefitsBlock/renderBonusBenefit.tsx +29 -0
- package/mobile/src/components/BonusBenefitsBlock/renderBonusBenefits.tsx +14 -0
- package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +3 -3
- package/mobile/src/components/CarouselCatalogCard/CatalogCard.ts +22 -0
- package/mobile/src/components/CarouselInvestmentCard/CarouselInvestmentCard.example.json +1 -11
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.example.json +1 -11
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +21 -11
- package/mobile/src/components/CarouselProgramsCard/programCardStyles.ts +2 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -12
- package/mobile/src/components/ErrorBlock/ErrorBlock.example.json +1 -11
- package/mobile/src/components/MobileAppTile/MobileAppTile.example.json +1 -11
- package/mobile/src/components/PictureText/PictureText.example.json +1 -11
- package/mobile/src/components/ProductBlock/ProductBlock.example.json +1 -11
- package/mobile/src/components/ProductTile/ProductTile.example.json +4 -12
- package/mobile/src/components/Tabs/LinkTab.tsx +19 -8
- package/mobile/src/components/Tabs/Tabs.tsx +7 -4
- package/mobile/src/components/Tabs/renderGroupTab.tsx +21 -33
- package/mobile/src/components/Tabs/tabItemClasses.ts +12 -45
- package/mobile/src/components/TariffsTable/TariffsTable.tsx +0 -1
- package/mobile/src/components/Tile/Tile.example.json +1 -11
- package/mobile/src/ui-kit/PhoneInput/PhoneInput.tsx +5 -1
- package/package.json +1 -1
- package/src/common.css +3 -0
- package/src/components/BenefitsBlock/BenefitsBlock.fixture.mobile.tsx +43 -0
- package/src/components/BenefitsBlock/BenefitsBlock.fixture.tsx +0 -1
- package/src/components/BenefitsBlock/BenefitsBlock.tsx +37 -34
- package/src/components/BenefitsBlock/benefitImageStyles.mobile.tsx +1 -0
- package/src/components/BenefitsBlock/benefitImageStyles.tsx +1 -0
- package/src/components/Blocks.mobile.ts +6 -0
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.fixture.mobile.tsx +67 -0
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +13 -49
- package/src/components/BonusBenefitsBlock/bonusBenefitAlign.mobile.ts +1 -0
- package/src/components/BonusBenefitsBlock/bonusBenefitAlign.ts +1 -0
- package/src/components/BonusBenefitsBlock/bonusBenefitStyles.mobile.ts +1 -0
- package/src/components/BonusBenefitsBlock/bonusBenefitStyles.ts +1 -0
- package/src/components/BonusBenefitsBlock/renderBonusBenefit.tsx +29 -0
- package/src/components/BonusBenefitsBlock/renderBonusBenefits.mobile.tsx +14 -0
- package/src/components/BonusBenefitsBlock/renderBonusBenefits.tsx +27 -0
- package/src/components/Carousel/Carousel.fixture.tsx +13 -2
- package/src/components/CarouselCatalogCard/CarouselCatalogCard.fixture.mobile.tsx +23 -0
- package/src/components/CarouselCatalogCard/CarouselCatalogCard.fixture.tsx +3 -25
- package/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +3 -3
- package/src/components/CarouselCatalogCard/CatalogCard.ts +22 -0
- package/src/components/CarouselInvestmentCard/CarouselInvestmentCard.example.json +1 -11
- package/src/components/CarouselProductCard/CarouselProductCard.example.json +1 -11
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.fixture.mobile.tsx +34 -0
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.fixture.tsx +2 -7
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +21 -11
- package/src/components/CarouselProgramsCard/programCardStyles.mobile.ts +2 -0
- package/src/components/CarouselProgramsCard/programCardStyles.ts +2 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -12
- package/src/components/ErrorBlock/ErrorBlock.example.json +1 -11
- package/src/components/MobileAppTile/MobileAppTile.example.json +1 -11
- package/src/components/PictureText/PictureText.example.json +1 -11
- package/src/components/PictureText/PictureText.fixture.mobile.tsx +0 -6
- package/src/components/PictureText/PictureText.fixture.tsx +0 -6
- package/src/components/ProductBlock/ProductBlock.example.json +1 -11
- package/src/components/ProductBlock/ProductBlock.fixture.mobile.tsx +0 -6
- package/src/components/ProductTile/ProductTile.example.json +4 -12
- package/src/components/Tabs/LinkTab.tsx +19 -8
- package/src/components/Tabs/Tabs.fixture.mobile.tsx +55 -0
- package/src/components/Tabs/Tabs.fixture.tsx +8 -17
- package/src/components/Tabs/Tabs.tsx +7 -4
- package/src/components/Tabs/renderGroupTab.tsx +21 -33
- package/src/components/Tabs/tabItemClasses.ts +12 -45
- package/src/components/TariffsTable/TariffsTable.mobile.tsx +0 -1
- package/src/components/Tile/Tile.example.json +1 -11
- package/src/ui-kit/PhoneInput/PhoneInput.tsx +5 -1
- package/tailwind.config.cjs +25 -12
|
@@ -327,6 +327,240 @@
|
|
|
327
327
|
return (jsx(Tag, { className: style('font-sans', isGroup ? 'group' : '', blockStyles[version], isHidden ? 'hidden' : '', padding || defaultPadding, className), ...(isGroup ? { 'data-ver': version } : {}), ...(block?.anchor ? { id: block.anchor, ref } : {}), role: role, children: children }));
|
|
328
328
|
});
|
|
329
329
|
|
|
330
|
+
const mobileHeadingTagMap = {
|
|
331
|
+
h1: 'h1',
|
|
332
|
+
h2: 'h1',
|
|
333
|
+
h3: 'h2',
|
|
334
|
+
h4: 'h2',
|
|
335
|
+
h5: 'h3',
|
|
336
|
+
h6: 'h3',
|
|
337
|
+
};
|
|
338
|
+
const headingTag = (tag) => mobileHeadingTagMap[tag] || 'h3';
|
|
339
|
+
|
|
340
|
+
const styles = {
|
|
341
|
+
h0: 'text-h0',
|
|
342
|
+
h1: 'text-h1',
|
|
343
|
+
h2: 'text-h2',
|
|
344
|
+
h3: 'text-h3',
|
|
345
|
+
h4: 'text-h4',
|
|
346
|
+
h5: 'text-h5',
|
|
347
|
+
h6: 'text-h6', // 20
|
|
348
|
+
};
|
|
349
|
+
const Heading = JSX(({ className = '', headingType = 'h3', as = 'h3', title, children }) => {
|
|
350
|
+
const Tag = headingTag(as);
|
|
351
|
+
return (jsx(Tag, { className: style('font-sans m-0', styles[headingType], className), children: title || children }));
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
const Paragraph = JSX(({ children, ...style }) => (jsx("p", { className: ['font-sans', ...Object.values(style)].join(' '), children: children })));
|
|
355
|
+
|
|
356
|
+
const headlineVersionStyles = {
|
|
357
|
+
XXL: {
|
|
358
|
+
title: { headingType: 'h0', as: 'h1' },
|
|
359
|
+
descriptionSize: 'text-h5',
|
|
360
|
+
descriptionStyle: 'mt-m',
|
|
361
|
+
},
|
|
362
|
+
XL: {
|
|
363
|
+
title: { headingType: 'h1', as: 'h1' },
|
|
364
|
+
descriptionSize: 'text-xl-light',
|
|
365
|
+
descriptionStyle: 'mt-s',
|
|
366
|
+
},
|
|
367
|
+
L: {
|
|
368
|
+
title: { headingType: 'h2', as: 'h2' },
|
|
369
|
+
descriptionSize: 'text-xl-light',
|
|
370
|
+
descriptionStyle: 'mt-s',
|
|
371
|
+
},
|
|
372
|
+
M: {
|
|
373
|
+
title: { headingType: 'h3', as: 'h2' },
|
|
374
|
+
descriptionSize: 'text-xl-light',
|
|
375
|
+
descriptionStyle: 'mt-text',
|
|
376
|
+
},
|
|
377
|
+
S: {
|
|
378
|
+
title: { headingType: 'h4', as: 'h2' },
|
|
379
|
+
descriptionSize: 'text-xl-light',
|
|
380
|
+
descriptionStyle: 'mt-xs',
|
|
381
|
+
},
|
|
382
|
+
XS: {
|
|
383
|
+
title: { headingType: 'h5', as: 'h2' },
|
|
384
|
+
descriptionSize: 'text-l-light',
|
|
385
|
+
descriptionStyle: 'mt-xs',
|
|
386
|
+
},
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
const Headline = JSX(({ className, version = '', headlineVersion = 'XL', title, description, align = 'text-center', as, isPadding = true, isTheme = false, ...rest }) => {
|
|
390
|
+
const versionStyle = headlineVersionStyles[headlineVersion];
|
|
391
|
+
const descriptionStyle = { marginTop: versionStyle.descriptionStyle };
|
|
392
|
+
return (jsxs(BlockWrapper, { className: className, defaultPadding: isPadding ? 'p-default' : '', version: version, isTheme: isTheme, ...rest, children: [title ? (jsx(Heading, { className: style('whitespace-pre-wrap', align), ...versionStyle?.title, as: as || versionStyle?.title.as, title: title })) : null, description ? (jsx(Paragraph, { size: versionStyle.descriptionSize, align: align, ...descriptionStyle, children: description })) : null] }));
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
const mapChildren = (mapper) => (children) => {
|
|
396
|
+
if (children === null || children === undefined) {
|
|
397
|
+
return children;
|
|
398
|
+
}
|
|
399
|
+
return Array.isArray(children) ? children.map(mapper) : mapper(children, 0);
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
const HEADER_HEIGHT = 170;
|
|
403
|
+
const FOOTER_HEIGHT = 48;
|
|
404
|
+
const BLOCKS_GAP = 4;
|
|
405
|
+
const PAGE_PADDINGS_X = 20;
|
|
406
|
+
const DEFAULT_HEIGHT = 866;
|
|
407
|
+
const getContainerHeight = (minHeight) => ({
|
|
408
|
+
height: `calc(100vh - ${HEADER_HEIGHT + FOOTER_HEIGHT + BLOCKS_GAP + PAGE_PADDINGS_X}px)`,
|
|
409
|
+
minHeight: `${minHeight || DEFAULT_HEIGHT}px`,
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
const SwipeListItem = JSX(({ className = '', style, idx, activeIndex, observerOptions, children, onIntersection }) => {
|
|
413
|
+
const observerCallback = useCallback((entries) => {
|
|
414
|
+
if (entries.length && onIntersection) {
|
|
415
|
+
onIntersection(idx || 0, entries[entries.length - 1]);
|
|
416
|
+
}
|
|
417
|
+
}, [onIntersection, idx]);
|
|
418
|
+
const ref = useIntersectionObserver(observerCallback, observerOptions);
|
|
419
|
+
return (jsx("div", { className: `inline-block snap-always box-border ${className}`, style: style, "aria-current": Boolean(idx === activeIndex), ref: ref, children: children }));
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
|
|
423
|
+
const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', minHeight, children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
|
|
424
|
+
const observerOptions = {
|
|
425
|
+
sensitivity: 1,
|
|
426
|
+
rootRef: containerRef,
|
|
427
|
+
};
|
|
428
|
+
const itemsVisibilityListRef = useRef([]);
|
|
429
|
+
const handleIntersection = useCallback((idx, entry) => {
|
|
430
|
+
const itemsVisibilityList = [...(itemsVisibilityListRef.current || [])];
|
|
431
|
+
itemsVisibilityList[idx] = entry;
|
|
432
|
+
itemsVisibilityListRef.current = itemsVisibilityList;
|
|
433
|
+
onVisibleItemsChange && onVisibleItemsChange(itemsVisibilityList);
|
|
434
|
+
onVisibleIndicesChange && onVisibleIndicesChange(getVisibleIndices(itemsVisibilityList));
|
|
435
|
+
}, [onVisibleItemsChange, onVisibleIndicesChange]);
|
|
436
|
+
const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
|
|
437
|
+
const isVerticalList = listType === 'vertical-list';
|
|
438
|
+
const isHorizontalList = listType === 'horizontal-list';
|
|
439
|
+
const containerStyle = {
|
|
440
|
+
...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
|
|
441
|
+
...(isVerticalList ? getContainerHeight(minHeight) : {}),
|
|
442
|
+
gap: `${gap}px`,
|
|
443
|
+
};
|
|
444
|
+
return (jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, ref: containerRef, children: mapChildren((child, idx) => (jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : '', isVerticalList ? 'h-full' : ''), style: isHorizontalList ? getContainerOffset(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
|
|
445
|
+
});
|
|
446
|
+
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
447
|
+
const getContainerOffset = (padding, additionalPadding = 0) => ({
|
|
448
|
+
marginLeft: `${-padding}px`,
|
|
449
|
+
marginRight: `${-padding}px`,
|
|
450
|
+
paddingLeft: `${padding}px`,
|
|
451
|
+
paddingRight: `${padding + additionalPadding}px`,
|
|
452
|
+
});
|
|
453
|
+
const getVisibleIndices = (itemsVisibilityList) => itemsVisibilityList
|
|
454
|
+
.map((_, i) => [_, i])
|
|
455
|
+
.filter(([_]) => _ && _.intersectionRatio >= 0.9)
|
|
456
|
+
.map(([, i]) => i);
|
|
457
|
+
|
|
458
|
+
const containerStyles = {
|
|
459
|
+
'horizontal-list': 'mx-auto mt-5 w-fit',
|
|
460
|
+
'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
|
|
461
|
+
};
|
|
462
|
+
const activeDotStyles = {
|
|
463
|
+
'horizontal-list': 'w-6',
|
|
464
|
+
'vertical-list': 'h-6',
|
|
465
|
+
};
|
|
466
|
+
const dotStyle = 'cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white';
|
|
467
|
+
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
468
|
+
const SwipeListControlDots = JSX(({ containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list', version }) => {
|
|
469
|
+
const handleClick = (idx) => {
|
|
470
|
+
if (idx !== activeIndex && containerRef?.current) {
|
|
471
|
+
containerRef.current.children[idx]?.scrollIntoView({
|
|
472
|
+
behavior: 'smooth',
|
|
473
|
+
block: 'nearest',
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
return dotCount ? (jsx("div", { className: style('flex gap-2', containerStyles[listType], version ? 'group' : ''), ...(version ? { 'data-ver': version } : {}), children: new Array(dotCount).fill(null).map((_, idx) => (jsx("div", { className: `${dotStyle} ${idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle}`, role: "button", "aria-hidden": true, onClick: () => handleClick(idx) }, String(idx)))) })) : null;
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
|
|
481
|
+
|
|
482
|
+
const defaultDiscriminator = (_) => _;
|
|
483
|
+
const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
|
|
484
|
+
|
|
485
|
+
const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
|
|
486
|
+
|
|
487
|
+
const getItemWidth = (container) => (itemCount) => container.scrollWidth / itemCount;
|
|
488
|
+
const scrollBy = (container) => (itemCount, delta) => {
|
|
489
|
+
container.scrollBy({ left: delta * getItemWidth(container)(itemCount), behavior: 'smooth' });
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
const scrollToEnd = (container) => {
|
|
493
|
+
container.scrollTo({ left: container.scrollWidth, behavior: 'smooth' });
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
const scrollToStart = (container) => {
|
|
497
|
+
container.scrollTo({ left: 0, behavior: 'smooth' });
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
const useSwipeListScroll = ({ itemCount, isCyclic, onVisibleIndicesChange, }) => {
|
|
501
|
+
const containerRef = useRef(null);
|
|
502
|
+
const [visibleIndices, setVisibleIndices] = useState([]);
|
|
503
|
+
const handleVisibleIndicesChange = useCallback((indices) => {
|
|
504
|
+
setVisibleIndices((prevIndices) => areArraysEqual(prevIndices, indices) ? prevIndices : indices);
|
|
505
|
+
onVisibleIndicesChange && onVisibleIndicesChange(indices);
|
|
506
|
+
}, [itemCount]);
|
|
507
|
+
const [minIndex, maxIndex] = visibleIndices.length
|
|
508
|
+
? [minBy()(visibleIndices), maxBy()(visibleIndices)]
|
|
509
|
+
: [-1, -1];
|
|
510
|
+
const canScrollLeft = minIndex > 0;
|
|
511
|
+
const canScrollRight = maxIndex < itemCount - 1;
|
|
512
|
+
const scrollLeft = useCallback(() => {
|
|
513
|
+
if (!containerRef.current) {
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
if (isCyclic && !canScrollLeft) {
|
|
517
|
+
scrollToEnd(containerRef.current);
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
scrollBy(containerRef.current)(itemCount, -1);
|
|
521
|
+
}
|
|
522
|
+
}, [isCyclic, itemCount, canScrollLeft]);
|
|
523
|
+
const scrollRight = useCallback(() => {
|
|
524
|
+
if (!containerRef.current) {
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
if (isCyclic && !canScrollRight) {
|
|
528
|
+
scrollToStart(containerRef.current);
|
|
529
|
+
}
|
|
530
|
+
else {
|
|
531
|
+
scrollBy(containerRef.current)(itemCount, 1);
|
|
532
|
+
}
|
|
533
|
+
}, [itemCount, isCyclic, canScrollRight]);
|
|
534
|
+
return [
|
|
535
|
+
containerRef,
|
|
536
|
+
{
|
|
537
|
+
scrollLeft,
|
|
538
|
+
scrollRight,
|
|
539
|
+
canScrollLeft: isCyclic || canScrollLeft,
|
|
540
|
+
canScrollRight: isCyclic || canScrollRight,
|
|
541
|
+
visibleIndicesRange: [minIndex, maxIndex],
|
|
542
|
+
handleVisibleIndicesChange,
|
|
543
|
+
},
|
|
544
|
+
];
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
const DEFAULT_GAP = 14;
|
|
548
|
+
/*
|
|
549
|
+
Horizontal padding used on a container above SwipeListControl.
|
|
550
|
+
Same value used on a SwipeListControlChildren container to compensate it
|
|
551
|
+
and get rid of a clipping effect caused by overflow: hidden.
|
|
552
|
+
*/
|
|
553
|
+
const DEFAULT_PADDING = 16;
|
|
554
|
+
const SwipeListControl = JSX(({ className, version, gap = DEFAULT_GAP, padding = DEFAULT_PADDING, showDots = true, minHeight, children, onVisibleIndicesChange, listType = 'horizontal-list', }) => {
|
|
555
|
+
const itemCount = Array.isArray(children) ? children.length : 0;
|
|
556
|
+
const [containerRef, scroll] = useSwipeListScroll({
|
|
557
|
+
itemCount,
|
|
558
|
+
onVisibleIndicesChange,
|
|
559
|
+
});
|
|
560
|
+
const [activeIndex] = scroll.visibleIndicesRange;
|
|
561
|
+
return (jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, listType: listType, minHeight: minHeight, children: children }), showDots ? (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount, listType: listType, version: version })) : null] }));
|
|
562
|
+
});
|
|
563
|
+
|
|
330
564
|
function useRouter() {
|
|
331
565
|
return useRouter._impl();
|
|
332
566
|
}
|
|
@@ -417,6 +651,20 @@
|
|
|
417
651
|
return image.icon ? (jsx(Icon, { className: className, imageClassName: imageClassName, iconVersion: image?.iconVersion, name: image.icon, ...iconProps })) : (jsx(ImgAsPicture, { className: className, imageClassName: imageClassName, image: image, pathPrefix: pathPrefix }));
|
|
418
652
|
});
|
|
419
653
|
|
|
654
|
+
const Text = JSX(({ children, ...style }) => (jsx("span", { className: ['font-sans', ...Object.values(style)].join(' '), children: children })));
|
|
655
|
+
|
|
656
|
+
const bonusBenefitAlign = 'text-left';
|
|
657
|
+
|
|
658
|
+
const bonusBenefitStyles = 'justify-between p-4 h-full border border-gray';
|
|
659
|
+
|
|
660
|
+
const renderBonusBenefit = ({ icon, title, description }, i) => (jsxs("div", { className: style('flex flex-col', bonusBenefitStyles, !description && !title ? 'justify-center' : ''), children: [title ? (jsx(Text, { size: "text-h6", font: "font-normal", align: bonusBenefitAlign, children: title })) : null, icon ? jsx(Img, { image: icon, height: "180", className: "w-auto" }) : null, description ? (jsx(Text, { size: "text-h6", font: "font-normal", align: bonusBenefitAlign, children: description })) : null] }, String(i)));
|
|
661
|
+
|
|
662
|
+
const renderBonusBenefits = (bonusBenefits, columnsCount, cardTextAlign) => (jsx(SwipeListControl, { children: bonusBenefits.map((_, i) => renderBonusBenefit({ ..._ }, i)) }));
|
|
663
|
+
|
|
664
|
+
const BonusBenefitsBlock = JSX(({ bonusBenefits, cardTextAlign = 'center', className = '', columnsCount = '4', subtitle, title, ...rest }) => (jsxs(BlockWrapper, { className: style('p-default', className), defaultPadding: "p-default", ...rest, children: [jsx(Headline, { className: "mb-4 sm:mb-8", isPadding: false, title: title, description: subtitle, headlineVersion: "M" }), bonusBenefits?.length
|
|
665
|
+
? renderBonusBenefits(bonusBenefits)
|
|
666
|
+
: null] })));
|
|
667
|
+
|
|
420
668
|
const useDialog = (id = '') => ({
|
|
421
669
|
open: (message) => defaultEventBus.fire('dialog', { type: 'open', id, message }),
|
|
422
670
|
close: () => defaultEventBus.fire('dialog', { type: 'close' }),
|
|
@@ -599,282 +847,104 @@
|
|
|
599
847
|
return {
|
|
600
848
|
value: (isFocused || !format ? value : format(value)),
|
|
601
849
|
onFocus: handleFocus,
|
|
602
|
-
onBlur: handleBlur,
|
|
603
|
-
};
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
const clamp = (value, min, max) => Math.max(min, Math.min(value, max));
|
|
607
|
-
|
|
608
|
-
const toLocalNumberFormat = (fractionDigits = 0) => (_ = 0) => new Intl.NumberFormat('ru-RU', {
|
|
609
|
-
minimumFractionDigits: 0,
|
|
610
|
-
maximumFractionDigits: fractionDigits,
|
|
611
|
-
}).format(Number(_) || 0);
|
|
612
|
-
|
|
613
|
-
const Text = JSX(({ children, ...style }) => (jsx("span", { className: ['font-sans', ...Object.values(style)].join(' '), children: children })));
|
|
614
|
-
|
|
615
|
-
const Input = JSX(({ key, className = '', inputClassName = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, }) => {
|
|
616
|
-
const handleChange = useCallback((e) => {
|
|
617
|
-
onChange && onChange(e.target?.value || '');
|
|
618
|
-
}, [onChange]);
|
|
619
|
-
const paddingStyle = children ? 'pr-8' : '';
|
|
620
|
-
const validStyle = valid
|
|
621
|
-
? 'border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'
|
|
622
|
-
: 'border-error';
|
|
623
|
-
return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { children: [label ? (jsx("div", { className: "mb-2", children: jsx(Text, { size: "text-m", font: "font-light", children: label }) })) : null, jsx("input", { className: style('w-full border rounded-md text-primary-text outline-none p-4', paddingStyle, validStyle, inputClassName), id: id, name: name || id, placeholder: placeholder, type: type, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern }, key)] }), children] }));
|
|
624
|
-
});
|
|
625
|
-
|
|
626
|
-
const NumberInput = JSX((props) => {
|
|
627
|
-
const { onChange, min, max, defaultValue = '0', fractionDigits = 0, ...inputProps } = props;
|
|
628
|
-
const normalizedProps = useNormalizedInput(props, {
|
|
629
|
-
normalize: (_ = defaultValue) => min && max ? String(clamp(Number(sanitizeNumberStr(_)), min, max)) : sanitizeNumberStr(_),
|
|
630
|
-
format: toLocalNumberFormat(fractionDigits),
|
|
631
|
-
});
|
|
632
|
-
const handleChange = useCallback((_) => onChange && onChange(sanitizeNumberStr(_)), [onChange]);
|
|
633
|
-
return jsx(Input, { onChange: handleChange, ...inputProps, ...normalizedProps });
|
|
634
|
-
});
|
|
635
|
-
const sanitizeNumberStr = (_ = '') => _.replaceAll(',', '.')
|
|
636
|
-
.replace(/[^\d.]/g, '')
|
|
637
|
-
.replace(/([^.]*\.[^.]*)\./, '$1');
|
|
638
|
-
|
|
639
|
-
const CurrencyInput = JSX((props) => (jsx(NumberInput, { ...props, fractionDigits: 2, children: jsx("div", { className: "absolute right-4 bottom-4", children: jsx(Text, { size: "text-xl", font: "font-light", children: "\u20BD" }) }) })));
|
|
640
|
-
|
|
641
|
-
const mobileHeadingTagMap = {
|
|
642
|
-
h1: 'h1',
|
|
643
|
-
h2: 'h1',
|
|
644
|
-
h3: 'h2',
|
|
645
|
-
h4: 'h2',
|
|
646
|
-
h5: 'h3',
|
|
647
|
-
h6: 'h3',
|
|
648
|
-
};
|
|
649
|
-
const headingTag = (tag) => mobileHeadingTagMap[tag] || 'h3';
|
|
650
|
-
|
|
651
|
-
const styles = {
|
|
652
|
-
h0: 'text-h0',
|
|
653
|
-
h1: 'text-h1',
|
|
654
|
-
h2: 'text-h2',
|
|
655
|
-
h3: 'text-h3',
|
|
656
|
-
h4: 'text-h4',
|
|
657
|
-
h5: 'text-h5',
|
|
658
|
-
h6: 'text-h6', // 20
|
|
659
|
-
};
|
|
660
|
-
const Heading = JSX(({ className = '', headingType = 'h3', as = 'h3', title, children }) => {
|
|
661
|
-
const Tag = headingTag(as);
|
|
662
|
-
return (jsx(Tag, { className: style('font-sans m-0', styles[headingType], className), children: title || children }));
|
|
663
|
-
});
|
|
664
|
-
|
|
665
|
-
const DEFAULT_TITLE = 'Укажите сумму перевода';
|
|
666
|
-
const DEFAULT_LABEL = 'Сумма перевода';
|
|
667
|
-
const DEFAULT_PLACEHOLDER = '1500';
|
|
668
|
-
const FORM_URL = 'https://www.rshb.ru/p2p/';
|
|
669
|
-
const AMOUNT_KEY = 'amount';
|
|
670
|
-
const INITIAL_FORM_STATE = {
|
|
671
|
-
[AMOUNT_KEY]: 1500,
|
|
672
|
-
};
|
|
673
|
-
const CardTransfer = JSX(({ className = '', title = DEFAULT_TITLE, label = DEFAULT_LABEL, placeholder = DEFAULT_PLACEHOLDER, button, ...rest }) => {
|
|
674
|
-
const [{ amount }, { field }] = useForm(INITIAL_FORM_STATE);
|
|
675
|
-
const isDisabled = amount <= 0;
|
|
676
|
-
const buttonStyle = isDisabled
|
|
677
|
-
? getDisabledButtonClasses({ version: button?.version })
|
|
678
|
-
: getRegularButtonClasses({ className: 'text-white', version: button?.version });
|
|
679
|
-
const link = useLink();
|
|
680
|
-
return (jsxs(BlockWrapper, { className: style('flex flex-col items-center', className), defaultPadding: "p-default", ...rest, children: [title ? (jsx(Heading, { className: "pb-5 xl:pb-9 self-start xl:self-center", headingType: "h2", title: title })) : null, jsxs("form", { className: "w-full xl:max-w-[468px]", method: "POST", action: FORM_URL, children: [jsx(CurrencyInput, { name: AMOUNT_KEY, valid: !isDisabled, placeholder: placeholder, label: label, ...field(AMOUNT_KEY, { parse: Number, format: String }) }), button?.text ? (jsx("button", { type: "submit", className: style('w-full p-4 mt-5 xl:mt-6', buttonStyle), disabled: isDisabled, ...link(button), children: button.text })) : null] })] }));
|
|
681
|
-
});
|
|
682
|
-
|
|
683
|
-
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
684
|
-
|
|
685
|
-
const DEFAULT_ANCESTORS = [];
|
|
686
|
-
const defaultStyle = 'col-span-12';
|
|
687
|
-
function renderBlock(block, options, { className, ...extraProps } = {}) {
|
|
688
|
-
const { key, blockDecorator = defaultBlockDecorator, blocksRegistry = {}, ancestors = DEFAULT_ANCESTORS, } = options;
|
|
689
|
-
const { type } = block;
|
|
690
|
-
if (!(type && type in blocksRegistry)) {
|
|
691
|
-
console.warn(`No block with "${type}" is registered`);
|
|
692
|
-
}
|
|
693
|
-
const BlockComponent = type && blocksRegistry[type];
|
|
694
|
-
return blockDecorator({
|
|
695
|
-
blockClassName: style('scroll-mt-12', // TODO scroll-mt-12 ? here?
|
|
696
|
-
className, block.style || defaultStyle),
|
|
697
|
-
block,
|
|
698
|
-
ancestors,
|
|
699
|
-
// Adjusted by decorator block and blockClassName
|
|
700
|
-
render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
|
|
701
|
-
const { content } = adjustedBlock;
|
|
702
|
-
return BlockComponent ? (jsx(BlockComponent, { className: adjustedBlockClassName, block: block, options: options, ...content, ...extraProps }, key)) : null;
|
|
703
|
-
},
|
|
704
|
-
}, key);
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
const DEFAULT_SLOT_NAME = null;
|
|
708
|
-
|
|
709
|
-
const EMPTY_ANCESTORS = [];
|
|
710
|
-
const renderBlocksList = (blocks, { key, ancestors = EMPTY_ANCESTORS, slotName = DEFAULT_SLOT_NAME, renderProps = renderBlock, ...options }) => (blocks || []).map((_, j) => renderProps(_, {
|
|
711
|
-
...options,
|
|
712
|
-
key: `${key ? key : _.type}-${j}`,
|
|
713
|
-
ancestors: options.parent
|
|
714
|
-
? [...(ancestors || EMPTY_ANCESTORS), [options.parent, slotName]]
|
|
715
|
-
: ancestors,
|
|
716
|
-
}));
|
|
717
|
-
|
|
718
|
-
function renderChildren({ children, block, options, renderProps, }) {
|
|
719
|
-
if (children) {
|
|
720
|
-
return children;
|
|
721
|
-
}
|
|
722
|
-
return block && options
|
|
723
|
-
? renderBlocksList(block.blocks, { ...options, parent: block, renderProps })
|
|
724
|
-
: null;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
const mapChildren = (mapper) => (children) => {
|
|
728
|
-
if (children === null || children === undefined) {
|
|
729
|
-
return children;
|
|
730
|
-
}
|
|
731
|
-
return Array.isArray(children) ? children.map(mapper) : mapper(children, 0);
|
|
732
|
-
};
|
|
733
|
-
|
|
734
|
-
const HEADER_HEIGHT = 170;
|
|
735
|
-
const FOOTER_HEIGHT = 48;
|
|
736
|
-
const BLOCKS_GAP = 4;
|
|
737
|
-
const PAGE_PADDINGS_X = 20;
|
|
738
|
-
const DEFAULT_HEIGHT = 866;
|
|
739
|
-
const getContainerHeight = (minHeight) => ({
|
|
740
|
-
height: `calc(100vh - ${HEADER_HEIGHT + FOOTER_HEIGHT + BLOCKS_GAP + PAGE_PADDINGS_X}px)`,
|
|
741
|
-
minHeight: `${minHeight || DEFAULT_HEIGHT}px`,
|
|
742
|
-
});
|
|
743
|
-
|
|
744
|
-
const SwipeListItem = JSX(({ className = '', style, idx, activeIndex, observerOptions, children, onIntersection }) => {
|
|
745
|
-
const observerCallback = useCallback((entries) => {
|
|
746
|
-
if (entries.length && onIntersection) {
|
|
747
|
-
onIntersection(idx || 0, entries[entries.length - 1]);
|
|
748
|
-
}
|
|
749
|
-
}, [onIntersection, idx]);
|
|
750
|
-
const ref = useIntersectionObserver(observerCallback, observerOptions);
|
|
751
|
-
return (jsx("div", { className: `inline-block snap-always box-border ${className}`, style: style, "aria-current": Boolean(idx === activeIndex), ref: ref, children: children }));
|
|
752
|
-
});
|
|
753
|
-
|
|
754
|
-
const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
|
|
755
|
-
const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', minHeight, children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
|
|
756
|
-
const observerOptions = {
|
|
757
|
-
sensitivity: 1,
|
|
758
|
-
rootRef: containerRef,
|
|
759
|
-
};
|
|
760
|
-
const itemsVisibilityListRef = useRef([]);
|
|
761
|
-
const handleIntersection = useCallback((idx, entry) => {
|
|
762
|
-
const itemsVisibilityList = [...(itemsVisibilityListRef.current || [])];
|
|
763
|
-
itemsVisibilityList[idx] = entry;
|
|
764
|
-
itemsVisibilityListRef.current = itemsVisibilityList;
|
|
765
|
-
onVisibleItemsChange && onVisibleItemsChange(itemsVisibilityList);
|
|
766
|
-
onVisibleIndicesChange && onVisibleIndicesChange(getVisibleIndices(itemsVisibilityList));
|
|
767
|
-
}, [onVisibleItemsChange, onVisibleIndicesChange]);
|
|
768
|
-
const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
|
|
769
|
-
const isVerticalList = listType === 'vertical-list';
|
|
770
|
-
const isHorizontalList = listType === 'horizontal-list';
|
|
771
|
-
const containerStyle = {
|
|
772
|
-
...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
|
|
773
|
-
...(isVerticalList ? getContainerHeight(minHeight) : {}),
|
|
774
|
-
gap: `${gap}px`,
|
|
775
|
-
};
|
|
776
|
-
return (jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, ref: containerRef, children: mapChildren((child, idx) => (jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : '', isVerticalList ? 'h-full' : ''), style: isHorizontalList ? getContainerOffset(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
|
|
777
|
-
});
|
|
778
|
-
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
779
|
-
const getContainerOffset = (padding, additionalPadding = 0) => ({
|
|
780
|
-
marginLeft: `${-padding}px`,
|
|
781
|
-
marginRight: `${-padding}px`,
|
|
782
|
-
paddingLeft: `${padding}px`,
|
|
783
|
-
paddingRight: `${padding + additionalPadding}px`,
|
|
784
|
-
});
|
|
785
|
-
const getVisibleIndices = (itemsVisibilityList) => itemsVisibilityList
|
|
786
|
-
.map((_, i) => [_, i])
|
|
787
|
-
.filter(([_]) => _ && _.intersectionRatio >= 0.9)
|
|
788
|
-
.map(([, i]) => i);
|
|
789
|
-
|
|
790
|
-
const containerStyles = {
|
|
791
|
-
'horizontal-list': 'mx-auto mt-5 w-fit',
|
|
792
|
-
'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
|
|
793
|
-
};
|
|
794
|
-
const activeDotStyles = {
|
|
795
|
-
'horizontal-list': 'w-6',
|
|
796
|
-
'vertical-list': 'h-6',
|
|
797
|
-
};
|
|
798
|
-
const dotStyle = 'cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white';
|
|
799
|
-
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
800
|
-
const SwipeListControlDots = JSX(({ containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list', version }) => {
|
|
801
|
-
const handleClick = (idx) => {
|
|
802
|
-
if (idx !== activeIndex && containerRef?.current) {
|
|
803
|
-
containerRef.current.children[idx]?.scrollIntoView({
|
|
804
|
-
behavior: 'smooth',
|
|
805
|
-
block: 'nearest',
|
|
806
|
-
});
|
|
807
|
-
}
|
|
850
|
+
onBlur: handleBlur,
|
|
808
851
|
};
|
|
809
|
-
|
|
810
|
-
});
|
|
852
|
+
};
|
|
811
853
|
|
|
812
|
-
const
|
|
854
|
+
const clamp = (value, min, max) => Math.max(min, Math.min(value, max));
|
|
813
855
|
|
|
814
|
-
const
|
|
815
|
-
|
|
856
|
+
const toLocalNumberFormat = (fractionDigits = 0) => (_ = 0) => new Intl.NumberFormat('ru-RU', {
|
|
857
|
+
minimumFractionDigits: 0,
|
|
858
|
+
maximumFractionDigits: fractionDigits,
|
|
859
|
+
}).format(Number(_) || 0);
|
|
816
860
|
|
|
817
|
-
const
|
|
861
|
+
const Input = JSX(({ key, className = '', inputClassName = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, }) => {
|
|
862
|
+
const handleChange = useCallback((e) => {
|
|
863
|
+
onChange && onChange(e.target?.value || '');
|
|
864
|
+
}, [onChange]);
|
|
865
|
+
const paddingStyle = children ? 'pr-8' : '';
|
|
866
|
+
const validStyle = valid
|
|
867
|
+
? 'border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'
|
|
868
|
+
: 'border-error';
|
|
869
|
+
return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { children: [label ? (jsx("div", { className: "mb-2", children: jsx(Text, { size: "text-m", font: "font-light", children: label }) })) : null, jsx("input", { className: style('w-full border rounded-md text-primary-text outline-none p-4', paddingStyle, validStyle, inputClassName), id: id, name: name || id, placeholder: placeholder, type: type, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern }, key)] }), children] }));
|
|
870
|
+
});
|
|
818
871
|
|
|
819
|
-
const
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
872
|
+
const NumberInput = JSX((props) => {
|
|
873
|
+
const { onChange, min, max, defaultValue = '0', fractionDigits = 0, ...inputProps } = props;
|
|
874
|
+
const normalizedProps = useNormalizedInput(props, {
|
|
875
|
+
normalize: (_ = defaultValue) => min && max ? String(clamp(Number(sanitizeNumberStr(_)), min, max)) : sanitizeNumberStr(_),
|
|
876
|
+
format: toLocalNumberFormat(fractionDigits),
|
|
877
|
+
});
|
|
878
|
+
const handleChange = useCallback((_) => onChange && onChange(sanitizeNumberStr(_)), [onChange]);
|
|
879
|
+
return jsx(Input, { onChange: handleChange, ...inputProps, ...normalizedProps });
|
|
880
|
+
});
|
|
881
|
+
const sanitizeNumberStr = (_ = '') => _.replaceAll(',', '.')
|
|
882
|
+
.replace(/[^\d.]/g, '')
|
|
883
|
+
.replace(/([^.]*\.[^.]*)\./, '$1');
|
|
823
884
|
|
|
824
|
-
const
|
|
825
|
-
container.scrollTo({ left: container.scrollWidth, behavior: 'smooth' });
|
|
826
|
-
};
|
|
885
|
+
const CurrencyInput = JSX((props) => (jsx(NumberInput, { ...props, fractionDigits: 2, children: jsx("div", { className: "absolute right-4 bottom-4", children: jsx(Text, { size: "text-xl", font: "font-light", children: "\u20BD" }) }) })));
|
|
827
886
|
|
|
828
|
-
const
|
|
829
|
-
|
|
887
|
+
const DEFAULT_TITLE = 'Укажите сумму перевода';
|
|
888
|
+
const DEFAULT_LABEL = 'Сумма перевода';
|
|
889
|
+
const DEFAULT_PLACEHOLDER = '1500';
|
|
890
|
+
const FORM_URL = 'https://www.rshb.ru/p2p/';
|
|
891
|
+
const AMOUNT_KEY = 'amount';
|
|
892
|
+
const INITIAL_FORM_STATE = {
|
|
893
|
+
[AMOUNT_KEY]: 1500,
|
|
830
894
|
};
|
|
895
|
+
const CardTransfer = JSX(({ className = '', title = DEFAULT_TITLE, label = DEFAULT_LABEL, placeholder = DEFAULT_PLACEHOLDER, button, ...rest }) => {
|
|
896
|
+
const [{ amount }, { field }] = useForm(INITIAL_FORM_STATE);
|
|
897
|
+
const isDisabled = amount <= 0;
|
|
898
|
+
const buttonStyle = isDisabled
|
|
899
|
+
? getDisabledButtonClasses({ version: button?.version })
|
|
900
|
+
: getRegularButtonClasses({ className: 'text-white', version: button?.version });
|
|
901
|
+
const link = useLink();
|
|
902
|
+
return (jsxs(BlockWrapper, { className: style('flex flex-col items-center', className), defaultPadding: "p-default", ...rest, children: [title ? (jsx(Heading, { className: "pb-5 xl:pb-9 self-start xl:self-center", headingType: "h2", title: title })) : null, jsxs("form", { className: "w-full xl:max-w-[468px]", method: "POST", action: FORM_URL, children: [jsx(CurrencyInput, { name: AMOUNT_KEY, valid: !isDisabled, placeholder: placeholder, label: label, ...field(AMOUNT_KEY, { parse: Number, format: String }) }), button?.text ? (jsx("button", { type: "submit", className: style('w-full p-4 mt-5 xl:mt-6', buttonStyle), disabled: isDisabled, ...link(button), children: button.text })) : null] })] }));
|
|
903
|
+
});
|
|
831
904
|
|
|
832
|
-
const
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
scrollBy(containerRef.current)(itemCount, -1);
|
|
853
|
-
}
|
|
854
|
-
}, [isCyclic, itemCount, canScrollLeft]);
|
|
855
|
-
const scrollRight = useCallback(() => {
|
|
856
|
-
if (!containerRef.current) {
|
|
857
|
-
return;
|
|
858
|
-
}
|
|
859
|
-
if (isCyclic && !canScrollRight) {
|
|
860
|
-
scrollToStart(containerRef.current);
|
|
861
|
-
}
|
|
862
|
-
else {
|
|
863
|
-
scrollBy(containerRef.current)(itemCount, 1);
|
|
864
|
-
}
|
|
865
|
-
}, [itemCount, isCyclic, canScrollRight]);
|
|
866
|
-
return [
|
|
867
|
-
containerRef,
|
|
868
|
-
{
|
|
869
|
-
scrollLeft,
|
|
870
|
-
scrollRight,
|
|
871
|
-
canScrollLeft: isCyclic || canScrollLeft,
|
|
872
|
-
canScrollRight: isCyclic || canScrollRight,
|
|
873
|
-
visibleIndicesRange: [minIndex, maxIndex],
|
|
874
|
-
handleVisibleIndicesChange,
|
|
905
|
+
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
906
|
+
|
|
907
|
+
const DEFAULT_ANCESTORS = [];
|
|
908
|
+
const defaultStyle = 'col-span-12';
|
|
909
|
+
function renderBlock(block, options, { className, ...extraProps } = {}) {
|
|
910
|
+
const { key, blockDecorator = defaultBlockDecorator, blocksRegistry = {}, ancestors = DEFAULT_ANCESTORS, } = options;
|
|
911
|
+
const { type } = block;
|
|
912
|
+
if (!(type && type in blocksRegistry)) {
|
|
913
|
+
console.warn(`No block with "${type}" is registered`);
|
|
914
|
+
}
|
|
915
|
+
const BlockComponent = type && blocksRegistry[type];
|
|
916
|
+
return blockDecorator({
|
|
917
|
+
blockClassName: style('scroll-mt-12', // TODO scroll-mt-12 ? here?
|
|
918
|
+
className, block.style || defaultStyle),
|
|
919
|
+
block,
|
|
920
|
+
ancestors,
|
|
921
|
+
// Adjusted by decorator block and blockClassName
|
|
922
|
+
render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
|
|
923
|
+
const { content } = adjustedBlock;
|
|
924
|
+
return BlockComponent ? (jsx(BlockComponent, { className: adjustedBlockClassName, block: block, options: options, ...content, ...extraProps }, key)) : null;
|
|
875
925
|
},
|
|
876
|
-
|
|
877
|
-
}
|
|
926
|
+
}, key);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
const DEFAULT_SLOT_NAME = null;
|
|
930
|
+
|
|
931
|
+
const EMPTY_ANCESTORS = [];
|
|
932
|
+
const renderBlocksList = (blocks, { key, ancestors = EMPTY_ANCESTORS, slotName = DEFAULT_SLOT_NAME, renderProps = renderBlock, ...options }) => (blocks || []).map((_, j) => renderProps(_, {
|
|
933
|
+
...options,
|
|
934
|
+
key: `${key ? key : _.type}-${j}`,
|
|
935
|
+
ancestors: options.parent
|
|
936
|
+
? [...(ancestors || EMPTY_ANCESTORS), [options.parent, slotName]]
|
|
937
|
+
: ancestors,
|
|
938
|
+
}));
|
|
939
|
+
|
|
940
|
+
function renderChildren({ children, block, options, renderProps, }) {
|
|
941
|
+
if (children) {
|
|
942
|
+
return children;
|
|
943
|
+
}
|
|
944
|
+
return block && options
|
|
945
|
+
? renderBlocksList(block.blocks, { ...options, parent: block, renderProps })
|
|
946
|
+
: null;
|
|
947
|
+
}
|
|
878
948
|
|
|
879
949
|
const ArrowButton = JSX(({ className, disabled, ...rest }) => (jsx(Button, { rounded: true, className: `group/btn shadow-[0_4px_25px_rgba(0,0,0,0.07)] w-12 h-12 min-h-12 max-h-12 flex items-center justify-center ${disabled
|
|
880
950
|
? 'bg-secondary-light text-secondary-text'
|
|
@@ -882,7 +952,7 @@
|
|
|
882
952
|
const ScrollLeftButton = JSX((props) => (jsx(ArrowButton, { ...props, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E", "data-block-control": "scroll-left" })));
|
|
883
953
|
const ScrollRightButton = JSX((props) => (jsx(ArrowButton, { ...props, className: `${props.className || ''} rotate-180`, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E", "data-block-control": "scroll-right" })));
|
|
884
954
|
|
|
885
|
-
const scrollButtonStyle = 'absolute top-[calc(50%-24px)] z-40';
|
|
955
|
+
const scrollButtonStyle$1 = 'absolute top-[calc(50%-24px)] z-40';
|
|
886
956
|
const blurBaseStyle = 'absolute top-0 bottom-0 z-40 w-[84px] pointer-events-none';
|
|
887
957
|
const CarouselScrollButtons = JSX(({ scroll, arrowsPadded, isBlur, onScrollLeft, onScrollRight, hasEdgeBlocks, activeIndex, itemCount, }) => {
|
|
888
958
|
const { canScrollLeft, canScrollRight, scrollLeft, scrollRight } = scroll;
|
|
@@ -906,7 +976,7 @@
|
|
|
906
976
|
onScrollRight();
|
|
907
977
|
}
|
|
908
978
|
}, [scrollRight, onScrollRight, hasEdgeBlocks, canScrollLeft, activeIndex, itemCount]);
|
|
909
|
-
return (jsxs("div", { children: [renderBlur(isBlur, scroll), canMoveLeft ? (jsx(ScrollLeftButton, { className: style(scrollButtonStyle, arrowsPadded ? 'left-8' : 'left-0'), onClick: handleScrollLeft })) : null, canMoveRight ? (jsx(ScrollRightButton, { className: style(scrollButtonStyle, arrowsPadded ? 'right-8' : 'right-0'), onClick: handleScrollRight })) : null] }));
|
|
979
|
+
return (jsxs("div", { children: [renderBlur(isBlur, scroll), canMoveLeft ? (jsx(ScrollLeftButton, { className: style(scrollButtonStyle$1, arrowsPadded ? 'left-8' : 'left-0'), onClick: handleScrollLeft })) : null, canMoveRight ? (jsx(ScrollRightButton, { className: style(scrollButtonStyle$1, arrowsPadded ? 'right-8' : 'right-0'), onClick: handleScrollRight })) : null] }));
|
|
910
980
|
});
|
|
911
981
|
const renderBlur = (isBlur, scroll) => isBlur ? (jsxs("div", { children: [scroll.canScrollLeft ? (jsx("div", { className: style(blurBaseStyle, 'left-0 bg-opacity-from-white') })) : null, scroll.canScrollRight ? (jsx("div", { className: style(blurBaseStyle, 'right-0 bg-opacity-to-white') })) : null] })) : null;
|
|
912
982
|
|
|
@@ -958,10 +1028,13 @@
|
|
|
958
1028
|
return (jsx(Tag, { className: style('block', className), ...(href ? linkProps : {}), children: children }));
|
|
959
1029
|
});
|
|
960
1030
|
|
|
1031
|
+
const cardTitleFont = 'font-light';
|
|
1032
|
+
const cardDescriptionColor = '';
|
|
1033
|
+
|
|
961
1034
|
const CarouselProgramsCard = JSX(({ className = '', title, icon, list = [], href, target, ...rest }) => {
|
|
962
|
-
return (jsx(BlockWrapper, { className: style('border border-gray', className), defaultPadding: "p-0", ...rest, children: jsxs(LinkWrapper, { className: "flex", href: href, target: target, children: [
|
|
1035
|
+
return (jsx(BlockWrapper, { className: style('border border-gray', className), defaultPadding: "p-lg sm:p-0", ...rest, children: jsxs(LinkWrapper, { className: "sm:flex sm:items-center", href: href, target: target, children: [jsx("div", { className: "min-w-[200px] flex justify-center", children: icon?.src || icon?.icon ? jsx(Img, { image: icon }) : null }), jsxs("div", { className: "sm:px-3 py-xl", children: [title ? jsx(Heading, { className: "mb-2 sm:mb-3.5", headingType: "h6", title: title }) : null, list.length ? (jsx("div", { className: "flex flex-col gap-2 sm:gap-3", children: list?.map(renderList$2) })) : null] })] }) }));
|
|
963
1036
|
});
|
|
964
|
-
const renderList$2 = (_, i) => (jsxs("div", { className: "
|
|
1037
|
+
const renderList$2 = (_, i) => (jsxs("div", { className: "flex flex-row-reverse justify-between gap-y-1 sm:flex-col", children: [_.title ? (jsx(Text, { size: "text-l", font: cardTitleFont, children: _.title })) : null, _.description ? (jsx(Paragraph, { size: "text-l", font: "font-light", color: cardDescriptionColor, children: _.description })) : null] }, String(i)));
|
|
965
1038
|
|
|
966
1039
|
const DOT_SIZE_MAP = {
|
|
967
1040
|
L: 'w-1.5 h-1.5 mr-4',
|
|
@@ -1032,47 +1105,6 @@
|
|
|
1032
1105
|
|
|
1033
1106
|
const SocialMedia = JSX(({ className = '', media }) => (jsx("div", { className: `flex gap-2 items-start justify-start ${className}`, children: media?.map((_, index) => (jsx(MediaButton, { ..._ }, String(index)))) })));
|
|
1034
1107
|
|
|
1035
|
-
const Paragraph = JSX(({ children, ...style }) => (jsx("p", { className: ['font-sans', ...Object.values(style)].join(' '), children: children })));
|
|
1036
|
-
|
|
1037
|
-
const headlineVersionStyles = {
|
|
1038
|
-
XXL: {
|
|
1039
|
-
title: { headingType: 'h0', as: 'h1' },
|
|
1040
|
-
descriptionSize: 'text-h5',
|
|
1041
|
-
descriptionStyle: 'mt-m',
|
|
1042
|
-
},
|
|
1043
|
-
XL: {
|
|
1044
|
-
title: { headingType: 'h1', as: 'h1' },
|
|
1045
|
-
descriptionSize: 'text-xl-light',
|
|
1046
|
-
descriptionStyle: 'mt-s',
|
|
1047
|
-
},
|
|
1048
|
-
L: {
|
|
1049
|
-
title: { headingType: 'h2', as: 'h2' },
|
|
1050
|
-
descriptionSize: 'text-xl-light',
|
|
1051
|
-
descriptionStyle: 'mt-s',
|
|
1052
|
-
},
|
|
1053
|
-
M: {
|
|
1054
|
-
title: { headingType: 'h3', as: 'h2' },
|
|
1055
|
-
descriptionSize: 'text-xl-light',
|
|
1056
|
-
descriptionStyle: 'mt-text',
|
|
1057
|
-
},
|
|
1058
|
-
S: {
|
|
1059
|
-
title: { headingType: 'h4', as: 'h2' },
|
|
1060
|
-
descriptionSize: 'text-xl-light',
|
|
1061
|
-
descriptionStyle: 'mt-xs',
|
|
1062
|
-
},
|
|
1063
|
-
XS: {
|
|
1064
|
-
title: { headingType: 'h5', as: 'h2' },
|
|
1065
|
-
descriptionSize: 'text-l-light',
|
|
1066
|
-
descriptionStyle: 'mt-xs',
|
|
1067
|
-
},
|
|
1068
|
-
};
|
|
1069
|
-
|
|
1070
|
-
const Headline = JSX(({ className, version = '', headlineVersion = 'XL', title, description, align = 'text-center', as, isPadding = true, isTheme = false, ...rest }) => {
|
|
1071
|
-
const versionStyle = headlineVersionStyles[headlineVersion];
|
|
1072
|
-
const descriptionStyle = { marginTop: versionStyle.descriptionStyle };
|
|
1073
|
-
return (jsxs(BlockWrapper, { className: className, defaultPadding: isPadding ? 'p-default' : '', version: version, isTheme: isTheme, ...rest, children: [title ? (jsx(Heading, { className: style('whitespace-pre-wrap', align), ...versionStyle?.title, as: as || versionStyle?.title.as, title: title })) : null, description ? (jsx(Paragraph, { size: versionStyle.descriptionSize, align: align, ...descriptionStyle, children: description })) : null] }));
|
|
1074
|
-
});
|
|
1075
|
-
|
|
1076
1108
|
const BORDER_STYLE = 'border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider';
|
|
1077
1109
|
|
|
1078
1110
|
const CarouselRecommendationCard = JSX(({ className = '', description, href, icon, items = [], socialMedia = [], target, title, align = 'text-left', ...rest }) => {
|
|
@@ -1122,23 +1154,6 @@
|
|
|
1122
1154
|
const renderFoldButton$1 = ({ isUnfolded, onToggle }) => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-5 flex justify-between items-center", onClick: onToggle, children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
|
|
1123
1155
|
const renderHitIcon = () => (jsxs("div", { className: "absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: [jsx(Icon, { iconVersion: "black", name: "HeartIcon", width: "23", height: "22" }), jsx(Paragraph, { size: "text-s", font: "font-normal", align: "text-center", color: "text-primary-text", children: "\u0425\u0418\u0422" })] }));
|
|
1124
1156
|
|
|
1125
|
-
const DEFAULT_GAP = 14;
|
|
1126
|
-
/*
|
|
1127
|
-
Horizontal padding used on a container above SwipeListControl.
|
|
1128
|
-
Same value used on a SwipeListControlChildren container to compensate it
|
|
1129
|
-
and get rid of a clipping effect caused by overflow: hidden.
|
|
1130
|
-
*/
|
|
1131
|
-
const DEFAULT_PADDING = 16;
|
|
1132
|
-
const SwipeListControl = JSX(({ className, version, gap = DEFAULT_GAP, padding = DEFAULT_PADDING, showDots = true, minHeight, children, onVisibleIndicesChange, listType = 'horizontal-list', }) => {
|
|
1133
|
-
const itemCount = Array.isArray(children) ? children.length : 0;
|
|
1134
|
-
const [containerRef, scroll] = useSwipeListScroll({
|
|
1135
|
-
itemCount,
|
|
1136
|
-
onVisibleIndicesChange,
|
|
1137
|
-
});
|
|
1138
|
-
const [activeIndex] = scroll.visibleIndicesRange;
|
|
1139
|
-
return (jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, listType: listType, minHeight: minHeight, children: children }), showDots ? (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount, listType: listType, version: version })) : null] }));
|
|
1140
|
-
});
|
|
1141
|
-
|
|
1142
1157
|
const GRADIENT = 'bg-gradient-to-r from-main-gradient-start to-main-gradient-end';
|
|
1143
1158
|
const DIVIDER_CLASSES = 'border-main-divider border border-t-0 border-x-0';
|
|
1144
1159
|
|
|
@@ -1462,7 +1477,7 @@
|
|
|
1462
1477
|
const BaseTile = JSX(({ className, defaultPadding, padding, title = '', insetTitle = '', buttons, leftImage, rightImage, imageAlign, backImage, children, }) => (jsxs("div", { className: style('relative flex flex-col gap-lg font-sans overflow-hidden', padding || defaultPadding, className), children: [backImage ? jsx("div", { className: "absolute bottom-0 right-0 z-0", children: backImage }) : null, title ? jsx("div", { className: "relative", children: title }) : null, jsxs("div", { className: "grow relative flex flex-wrap sm:flex-nowrap justify-between items-stretch gap-lg", children: [renderImageContainer(leftImage, { imageAlign }), jsxs("div", { className: style('flex flex-col gap-lg max-w-[600px] xl:max-w-[728px]', leftImage ? '' : 'grow'), children: [insetTitle, jsx("div", { className: "grow", children: children }), buttons] }), renderImageContainer(rightImage, { className: '-order-1 sm:order-1', imageAlign })] })] })));
|
|
1463
1478
|
const renderImageContainer = (image, { className, imageAlign }) => image ? (jsx("div", { className: style('flex-shrink-0', imageAlign && imageAlignmentMap[imageAlign], className), children: image })) : null;
|
|
1464
1479
|
|
|
1465
|
-
const renderDescription$
|
|
1480
|
+
const renderDescription$2 = (description) => description ? (jsx("div", { className: "mb-5 pt-0.5 sm:mb-0 sm:pt-0", children: jsx(Text, { size: "text-xl", "font-weight": "light", children: description }) })) : null;
|
|
1466
1481
|
|
|
1467
1482
|
const renderList$1 = (items) => {
|
|
1468
1483
|
return items?.length ? (jsx(List, { items: items, className: "text-l-light mb-2 last:mb-0" })) : (jsx("span", { className: "text-m-light text-secondary-text", children: "\u041D\u0430\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u0430\u043C\u0435\u0440\u0443 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 \u043D\u0430 QR-\u043A\u043E\u0434 \u0438 \u0441\u043A\u0430\u0447\u0430\u0439\u0442\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435" }));
|
|
@@ -1470,7 +1485,7 @@
|
|
|
1470
1485
|
|
|
1471
1486
|
const MobileAppTile = JSX(({ className, padding, alignTitle = 'left', buttons = [], description, headingType = 'h4', image, items, qr, title = 'Мобильное приложение', version = 'primary', ...rest }) => {
|
|
1472
1487
|
const containerStyle = version === 'secondary' ? 'p-3.5 min-w-[120px]' : 'min-w-[92px]';
|
|
1473
|
-
return (jsx(BlockWrapper, { className: style('min-h-80', className), defaultPadding: "p-0", version: version, ...rest, children: jsxs(BaseTile, { className: "h-full", padding: padding, defaultPadding: "p-default", title: title ? (jsx(Heading, { headingType: headingType, title: title, className: style('whitespace-pre-wrap', AlignText[alignTitle]) })) : null, backImage: image?.src ? jsx(Img, { image: image }) : null, buttons: renderButtonsSection(buttons, { isVertical: buttons.length > 3 }), children: [renderDescription$
|
|
1488
|
+
return (jsx(BlockWrapper, { className: style('min-h-80', className), defaultPadding: "p-0", version: version, ...rest, children: jsxs(BaseTile, { className: "h-full", padding: padding, defaultPadding: "p-default", title: title ? (jsx(Heading, { headingType: headingType, title: title, className: style('whitespace-pre-wrap', AlignText[alignTitle]) })) : null, backImage: image?.src ? jsx(Img, { image: image }) : null, buttons: renderButtonsSection(buttons, { isVertical: buttons.length > 3 }), children: [renderDescription$2(description), jsxs("div", { className: "flex flex-1 gap-s items-center", children: [qr?.src ? (jsx("div", { className: style('flex justify-center bg-white rounded-md', containerStyle), children: jsx(Img, { className: "w-fit", image: qr }) })) : null, renderList$1(items)] })] }) }));
|
|
1474
1489
|
});
|
|
1475
1490
|
|
|
1476
1491
|
const sum = (list = []) => list.reduce((a, b) => a + b, 0);
|
|
@@ -1494,7 +1509,7 @@
|
|
|
1494
1509
|
return (jsx("div", { className: style(richVersion, 'md-container'), dangerouslySetInnerHTML: { __html } }));
|
|
1495
1510
|
});
|
|
1496
1511
|
|
|
1497
|
-
const renderBenefit = (benefitsVersion) => ({ type, ...benefit }, i) => {
|
|
1512
|
+
const renderBenefit$1 = (benefitsVersion) => ({ type, ...benefit }, i) => {
|
|
1498
1513
|
if (type === 'rte' && '__html' in benefit) {
|
|
1499
1514
|
return jsx(RichText, { __html: benefit.__html });
|
|
1500
1515
|
}
|
|
@@ -1506,7 +1521,7 @@
|
|
|
1506
1521
|
? _.__html?.length || 0
|
|
1507
1522
|
: Math.max(_.label?.length || 0, _.description?.length || 0);
|
|
1508
1523
|
const isDistortedBenefits = (benefits) => deviation(benefits.map(benefitLength)) > MAX_BENEFITS_LEN_DEVIATION;
|
|
1509
|
-
const BenefitsList = JSX(({ className, benefitsVersion = 'normal', benefits }) => benefits?.length ? (jsx("div", { className: style('flex gap-x-m gap-y-s', isDistortedBenefits(benefits) ? 'flex-col' : 'flex-wrap', className), children: benefits.map(renderBenefit(benefitsVersion)) })) : null);
|
|
1524
|
+
const BenefitsList = JSX(({ className, benefitsVersion = 'normal', benefits }) => benefits?.length ? (jsx("div", { className: style('flex gap-x-m gap-y-s', isDistortedBenefits(benefits) ? 'flex-col' : 'flex-wrap', className), children: benefits.map(renderBenefit$1(benefitsVersion)) })) : null);
|
|
1510
1525
|
|
|
1511
1526
|
const Tags = JSX(({ className, tags }) => tags?.length ? (jsx("div", { className: style('flex flex-wrap gap-xs', className), role: "list", children: tags.map(renderTag) })) : null);
|
|
1512
1527
|
const renderTag = (tag, key) => (jsx("div", { className: "py-2 px-2.5 border-solid border rounded-md border-gray", role: "listitem", children: jsx(Text, { size: "text-m-light", children: tag }) }, String(key)));
|
|
@@ -1608,6 +1623,144 @@
|
|
|
1608
1623
|
return (jsx("div", { className: `${iconAreaSize} ${styleMap.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`, children: jsx("span", { className: `font-medium flex self-center ${iconTextSize}`, children: checkCanRenderIcon(step?.icon) ? (jsx(Img, { image: { ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }, width: iconSize, height: iconSize })) : (jsx("span", { children: i + 1 })) }) }));
|
|
1609
1624
|
};
|
|
1610
1625
|
|
|
1626
|
+
const LINK_CLASSES = 'h-12 flex-1 flex items-center justify-center cursor-pointer';
|
|
1627
|
+
const INACTIVE_LINK_CLASSES = 'group/btn bg-white';
|
|
1628
|
+
const SCROLLABLE_ACTIVE_LINK_CLASSES = 'bg-white text-primary-main';
|
|
1629
|
+
const WIDESCREEN_ACTIVE_LINK_CLASSES = 'bg-primary-main text-white';
|
|
1630
|
+
const TEXT_CLASSES = 'font-sans text-m text-center';
|
|
1631
|
+
const ACTIVE_TEXT_CLASSES = 'text-white';
|
|
1632
|
+
const INACTIVE_TEXT_CLASSES = 'text-secondary-text sm:group-hover/btn:text-primary-main';
|
|
1633
|
+
const TAB_CLASSES = {
|
|
1634
|
+
block: {
|
|
1635
|
+
scrollable: {
|
|
1636
|
+
active: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${SCROLLABLE_ACTIVE_LINK_CLASSES}`,
|
|
1637
|
+
default: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${INACTIVE_LINK_CLASSES}`,
|
|
1638
|
+
},
|
|
1639
|
+
centered: {
|
|
1640
|
+
active: `px-4 rounded-md ${LINK_CLASSES} ${WIDESCREEN_ACTIVE_LINK_CLASSES} whitespace-nowrap`,
|
|
1641
|
+
default: `px-4 rounded-md ${LINK_CLASSES} group/btn bg-transparent whitespace-nowrap`,
|
|
1642
|
+
},
|
|
1643
|
+
wideScreen: {
|
|
1644
|
+
active: `${LINK_CLASSES} ${WIDESCREEN_ACTIVE_LINK_CLASSES} whitespace-nowrap`,
|
|
1645
|
+
default: `${LINK_CLASSES} ${INACTIVE_LINK_CLASSES} whitespace-nowrap`,
|
|
1646
|
+
},
|
|
1647
|
+
},
|
|
1648
|
+
text: {
|
|
1649
|
+
scrollable: {
|
|
1650
|
+
active: `${TEXT_CLASSES} flex items-center h-full border-0 border-b-2`,
|
|
1651
|
+
default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES}`,
|
|
1652
|
+
},
|
|
1653
|
+
centered: {
|
|
1654
|
+
active: `${TEXT_CLASSES} ${ACTIVE_TEXT_CLASSES}`,
|
|
1655
|
+
default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES}`,
|
|
1656
|
+
},
|
|
1657
|
+
wideScreen: {
|
|
1658
|
+
active: `${TEXT_CLASSES} ${ACTIVE_TEXT_CLASSES} text-black px-2.5 bg-white sm:bg-primary-main sm:text-white`,
|
|
1659
|
+
default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES} px-2.5 bg-white`,
|
|
1660
|
+
},
|
|
1661
|
+
},
|
|
1662
|
+
};
|
|
1663
|
+
const getTabClassName = (type, active, tabsMode) => {
|
|
1664
|
+
const styleActive = active ? 'active' : 'default';
|
|
1665
|
+
const mode = tabsMode || 'wideScreen';
|
|
1666
|
+
return TAB_CLASSES[type][mode][styleActive];
|
|
1667
|
+
};
|
|
1668
|
+
|
|
1669
|
+
const LinkTab = JSX((props) => {
|
|
1670
|
+
const { tab, currentTab, onClick, tabsMode } = props;
|
|
1671
|
+
const active = currentTab?.type === 'link' && currentTab.href === tab.href;
|
|
1672
|
+
const link = useLink();
|
|
1673
|
+
const adjustedProps = link(tab);
|
|
1674
|
+
const handleClick = (ev) => {
|
|
1675
|
+
adjustedProps.onClick(ev);
|
|
1676
|
+
onClick(tab);
|
|
1677
|
+
};
|
|
1678
|
+
return (jsx("div", { className: getTabClassName('block', active, tabsMode), role: "tab", "aria-selected": active, onClick: () => onClick(tab), children: jsx("a", { role: "tab", className: style('flex flex-1 items-center justify-center h-full', getTabClassName('text', active, tabsMode)), target: tab.target, href: adjustedProps.href, onClick: handleClick, children: jsx("span", { children: tab.text }) }) }));
|
|
1679
|
+
});
|
|
1680
|
+
|
|
1681
|
+
const BADGE_CLASSES = 'bg-main-divider min-w-[22px] h-[22px] rounded-full text-xs ml-2 flex justify-center items-center';
|
|
1682
|
+
const LIGHT_BADGE_CLASSES = 'bg-white/30 text-white';
|
|
1683
|
+
const DARK_BADGE_CLASSES = 'text-secondary-text group-hover/btn:text-primary-main';
|
|
1684
|
+
const renderGroupTab = ({ page, currentTab, showCounter, onClick, tabsMode }) => (tab, i) => {
|
|
1685
|
+
const active = currentTab === tab;
|
|
1686
|
+
const count = tab.ref && page?.blocks
|
|
1687
|
+
? page.blocks.filter((block) => block?.labels?.includes(tab.ref)).length
|
|
1688
|
+
: 0;
|
|
1689
|
+
return (jsx("div", { className: getTabClassName('block', active, tabsMode), role: "tab", "aria-selected": active, onClick: () => onClick(tab), children: jsxs("div", { className: style('flex flex-1 items-center justify-center h-full', getTabClassName('text', active, tabsMode)), children: [jsx("span", { children: tab.title }), showCounter && count ? renderCount(tabsMode, count, active) : null] }) }, `group-${String(i)}`));
|
|
1690
|
+
};
|
|
1691
|
+
const renderCount = (tabsMode, count, active) => {
|
|
1692
|
+
return (jsx("div", { className: style(BADGE_CLASSES, active && tabsMode !== 'scrollable' ? LIGHT_BADGE_CLASSES : DARK_BADGE_CLASSES), children: count }));
|
|
1693
|
+
};
|
|
1694
|
+
|
|
1695
|
+
const renderTab = ({ page, showCounter, ...rest }) => (tab, i) => {
|
|
1696
|
+
const type = tab.type;
|
|
1697
|
+
if (!(type === 'group' || type === 'link')) {
|
|
1698
|
+
return null;
|
|
1699
|
+
}
|
|
1700
|
+
switch (type) {
|
|
1701
|
+
case 'group':
|
|
1702
|
+
return renderGroupTab({ page, showCounter, ...rest })(tab, i);
|
|
1703
|
+
case 'link': {
|
|
1704
|
+
return jsx(LinkTab, { tab: tab, ...rest }, String(i));
|
|
1705
|
+
}
|
|
1706
|
+
default:
|
|
1707
|
+
assertUnreachable(type);
|
|
1708
|
+
}
|
|
1709
|
+
return null;
|
|
1710
|
+
};
|
|
1711
|
+
|
|
1712
|
+
const CenteredTabs = JSX(({ tabs, ...rest }) => (jsx("div", { className: "flex p-1 m-auto bg-main-gray rounded-md", children: tabs?.map(renderTab({ ...rest })) })));
|
|
1713
|
+
|
|
1714
|
+
const scrollButtonStyle = 'absolute z-40 top-0';
|
|
1715
|
+
const ScrollableTabs = JSX((props) => {
|
|
1716
|
+
const { tabs, ...rest } = props;
|
|
1717
|
+
const [containerRef, scroll] = useSwipeListScroll({
|
|
1718
|
+
itemCount: tabs?.length || 0,
|
|
1719
|
+
isCyclic: false,
|
|
1720
|
+
});
|
|
1721
|
+
return (jsxs("div", { className: "relative max-w-full m-auto", children: [jsx("div", { className: `font-sans max-w-full w-full overflow-hidden relative bg-white`, children: jsx(SwipeListContainer, { containerRef: containerRef, snapAlign: "snap-start", onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: tabs?.map(renderTab({ ...rest })) }) }), scroll.canScrollLeft ? (jsx(ScrollLeftButton, { className: `${scrollButtonStyle} left-6`, onClick: scroll.scrollLeft })) : null, scroll.canScrollRight ? (jsx(ScrollRightButton, { className: `${scrollButtonStyle} rotate-180 right-6`, onClick: scroll.scrollRight })) : null] }));
|
|
1722
|
+
});
|
|
1723
|
+
|
|
1724
|
+
const Tabs = JSX((props) => {
|
|
1725
|
+
const { className = '', isSticky, tabs, ...rest } = props;
|
|
1726
|
+
const [currentTab, setCurrentTab] = useState(tabs ? tabs[0] : undefined);
|
|
1727
|
+
useEffect(() => {
|
|
1728
|
+
if (!tabs || !tabs[0]) {
|
|
1729
|
+
return;
|
|
1730
|
+
}
|
|
1731
|
+
fireTabEvent(tabs[0]);
|
|
1732
|
+
}, []);
|
|
1733
|
+
useEffect(() => {
|
|
1734
|
+
if (currentTab?.type === 'group') {
|
|
1735
|
+
defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref });
|
|
1736
|
+
}
|
|
1737
|
+
}, [currentTab]);
|
|
1738
|
+
const handleClick = useCallback((selectedTab) => {
|
|
1739
|
+
fireTabEvent(selectedTab);
|
|
1740
|
+
setCurrentTab(selectedTab);
|
|
1741
|
+
}, []);
|
|
1742
|
+
return (jsx(BlockWrapper, { className: style('relative box-border flex gap-x-1 w-full overflow-x-auto no-scrollbar', isSticky ? 'sticky top-1 z-20' : '', className), defaultPadding: "p-0", role: "tablist", ...rest, children: renderTabs({ tabs, onClick: handleClick, currentTab, ...rest }) }));
|
|
1743
|
+
});
|
|
1744
|
+
const renderTabs = ({ tabsMode, tabs, ...rest }) => {
|
|
1745
|
+
switch (tabsMode) {
|
|
1746
|
+
case 'wideScreen':
|
|
1747
|
+
return tabs?.map(renderTab({ tabsMode, ...rest }));
|
|
1748
|
+
case 'centered':
|
|
1749
|
+
return jsx(CenteredTabs, { tabs: tabs, tabsMode: tabsMode, ...rest });
|
|
1750
|
+
case 'scrollable':
|
|
1751
|
+
return jsx(ScrollableTabs, { tabs: tabs, tabsMode: tabsMode, ...rest });
|
|
1752
|
+
}
|
|
1753
|
+
return null;
|
|
1754
|
+
};
|
|
1755
|
+
const fireTabEvent = (tab) => {
|
|
1756
|
+
if (tab.type === 'group') {
|
|
1757
|
+
defaultEventBus.fire('tab', { type: tab.type, label: tab.ref });
|
|
1758
|
+
}
|
|
1759
|
+
if (tab.type === 'link') {
|
|
1760
|
+
defaultEventBus.fire('tab', { type: tab.type, label: tab.href });
|
|
1761
|
+
}
|
|
1762
|
+
};
|
|
1763
|
+
|
|
1611
1764
|
const renderButtonsCellData = ({ buttons }) => renderButtonsSection(buttons, {
|
|
1612
1765
|
className: 'mt-3',
|
|
1613
1766
|
buttonClassName: 'w-12 h-12',
|
|
@@ -1650,10 +1803,10 @@
|
|
|
1650
1803
|
data: colData?.[i] || [{}],
|
|
1651
1804
|
}));
|
|
1652
1805
|
|
|
1653
|
-
const TextBlock = JSX(({ className = '', title, description, iconVersion, image, __html, items = [], ...rest }) => (jsxs(BlockWrapper, { className: style('flex gap-3 bg-white group-data-secondary:bg-primary-main/10', className), ...rest, children: [iconVersion === 'small' ? jsx("div", { className: "mt-1", children: renderIcon() }) : null, iconVersion === 'big' ? renderImage(image) : null, jsxs("div", { className: "flex flex-col w-fit gap-3", children: [title ? (jsx(Text, { size: "text-l", font: "font-medium", color: "text-primary-text group-data-secondary:text-white", children: title })) : null, description ? renderDescription(description) : null, items?.length ? renderList(items, true) : null, __html ? jsx(RichText, { __html: __html }) : null] })] })));
|
|
1806
|
+
const TextBlock = JSX(({ className = '', title, description, iconVersion, image, __html, items = [], ...rest }) => (jsxs(BlockWrapper, { className: style('flex gap-3 bg-white group-data-secondary:bg-primary-main/10', className), ...rest, children: [iconVersion === 'small' ? jsx("div", { className: "mt-1", children: renderIcon() }) : null, iconVersion === 'big' ? renderImage(image) : null, jsxs("div", { className: "flex flex-col w-fit gap-3", children: [title ? (jsx(Text, { size: "text-l", font: "font-medium", color: "text-primary-text group-data-secondary:text-white", children: title })) : null, description ? renderDescription$1(description) : null, items?.length ? renderList(items, true) : null, __html ? jsx(RichText, { __html: __html }) : null] })] })));
|
|
1654
1807
|
const renderIcon = () => (jsx("div", { className: `rounded-full h-4 w-4 text-center text-xs-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main`, children: "i" }));
|
|
1655
1808
|
const renderImage = (image) => image?.src ? jsx(Img, { className: "h-fit", image: image }) : null;
|
|
1656
|
-
const renderDescription = (description) => (jsx(Paragraph, { size: "text-s", color: "text-secondary-text group-data-secondary:text-white", children: description }));
|
|
1809
|
+
const renderDescription$1 = (description) => (jsx(Paragraph, { size: "text-s", color: "text-secondary-text group-data-secondary:text-white", children: description }));
|
|
1657
1810
|
const renderList = (items, bullets) => {
|
|
1658
1811
|
const listStyle = bullets ? 'list-disc pl-6' : '';
|
|
1659
1812
|
return (jsx("ul", { className: style('text-secondary-text group-data-secondary:text-white/80', listStyle), children: items.map((_, i) => (jsx("li", { children: jsx(Text, { size: "text-s", font: "font-light", children: _ }) }, `listItem-${i}`))) }));
|
|
@@ -1684,8 +1837,25 @@
|
|
|
1684
1837
|
});
|
|
1685
1838
|
VerticalLayout.childrenTypes = [];
|
|
1686
1839
|
|
|
1840
|
+
const benefitImageStyles = 'w-56 h-56 min-w-56';
|
|
1841
|
+
|
|
1842
|
+
const BenefitsBlock = JSX(({ className = '', title, benefitList, ...rest }) => (jsxs(BlockWrapper, { className: className, defaultPadding: "p-default", ...rest, children: [title ? jsx(Heading, { headingType: "h3", as: "h2", className: "text-center", title: title }) : null, benefitList?.length ? (jsx("div", { className: "sm:flex sm:flex-wrap w-full sm:justify-center sm:gap-x-m gap-y-lg sm:gap-y-0 mt-8", role: "list", children: benefitList.map(renderBenefit) })) : null] })));
|
|
1843
|
+
const renderBenefit = (benefit, i) => (jsxs("div", { className: "flex items-center sm:basis-1/2 sm:max-w-[400px] mb-14", role: "listitem", children: [benefit?.icon?.icon ? (jsx(Img, { className: style('p-3 mr-5 shrink-0 bg-main-divider text-primary-main group-data-secondary:bg-white/30 group-data-secondary:text-black', benefitImageStyles), image: benefit.icon })) : null, benefit?.icon?.src ? jsx(Img, { className: "mr-5 shrink-0", image: benefit.icon }) : null, benefit?.label ? (jsxs("div", { className: "sm:h-full", children: [jsx(Heading, { headingType: "h6", children: benefit.label }), renderDescription(benefit.description)] })) : null] }, String(i)));
|
|
1844
|
+
const renderDescription = (description) => {
|
|
1845
|
+
const benefitType = description?.benefitType || null;
|
|
1846
|
+
return description && benefitType ? (jsx("div", { className: "mt-2 text-l-light text-secondary-text group-data-secondary:text-white/80", children: benefitType === 'list'
|
|
1847
|
+
? renderListBenefit(description)
|
|
1848
|
+
: renderTextBenefit(description) })) : null;
|
|
1849
|
+
};
|
|
1850
|
+
const renderTextBenefit = (description) => description?.name || null;
|
|
1851
|
+
const renderListBenefit = (description) => {
|
|
1852
|
+
const listStyleType = description?.bullets ? 'list-disc pl-6' : '';
|
|
1853
|
+
return description?.items && description.items.length > 0 ? (jsx("ul", { className: listStyleType, children: description.items.map((_, i) => (jsx("li", { children: _ }, `benefitListItem-${i}`))) })) : null;
|
|
1854
|
+
};
|
|
1855
|
+
|
|
1687
1856
|
const Blocks = {
|
|
1688
1857
|
ButtonsBlock,
|
|
1858
|
+
BonusBenefitsBlock,
|
|
1689
1859
|
CardTransfer,
|
|
1690
1860
|
Carousel,
|
|
1691
1861
|
CarouselTariffsCard,
|
|
@@ -1700,6 +1870,7 @@
|
|
|
1700
1870
|
Placeholder,
|
|
1701
1871
|
ProductBlock,
|
|
1702
1872
|
StepsBlock,
|
|
1873
|
+
Tabs,
|
|
1703
1874
|
TariffsTable,
|
|
1704
1875
|
TextBlock,
|
|
1705
1876
|
RichTextBlock,
|
|
@@ -1708,6 +1879,7 @@
|
|
|
1708
1879
|
CarouselRecommendationCard,
|
|
1709
1880
|
CarouselProgramsCard,
|
|
1710
1881
|
ProductGallery,
|
|
1882
|
+
BenefitsBlock,
|
|
1711
1883
|
};
|
|
1712
1884
|
|
|
1713
1885
|
function useBool(defaultValue = false) {
|
|
@@ -1907,7 +2079,7 @@
|
|
|
1907
2079
|
|
|
1908
2080
|
const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
|
|
1909
2081
|
|
|
1910
|
-
const packageVersion = "0.12.
|
|
2082
|
+
const packageVersion = "0.12.5";
|
|
1911
2083
|
|
|
1912
2084
|
exports.Blocks = Blocks;
|
|
1913
2085
|
exports.ContentPage = ContentPage;
|