@redneckz/wildless-cms-uni-blocks 0.11.1 → 0.11.3
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.11.1.js +34 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +90 -64
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ButtonsBlock/ButtonsBlock.d.ts +6 -0
- package/bundle/components/ButtonsBlock/ButtonsBlockContent.d.ts +8 -0
- package/bundle/components/CarouselCard/CarouselCard.d.ts +1 -1
- package/bundle/components/CarouselCard/getCardWidth.d.ts +1 -0
- package/bundle/components/CarouselCard/titleSize.d.ts +1 -0
- package/bundle/components/CarouselCard/titleSize.mobile.d.ts +1 -0
- package/bundle/components/Footer/Contacts.d.ts +2 -2
- package/bundle/components/Footer/FooterContent.d.ts +9 -1
- package/bundle/components/Footer/FooterDataProps.d.ts +2 -2
- package/bundle/components/Header/Header.mobile.d.ts +2 -2
- package/bundle/components/Header/HeaderContent.d.ts +13 -1
- package/bundle/components/Header/HeaderTop.d.ts +6 -2
- package/bundle/components/PictureText/positionStyle.d.ts +1 -0
- package/bundle/components/PictureText/positionStyle.mobile.d.ts +1 -0
- package/bundle/components/PictureText/renderInsuranceSumMonth.d.ts +2 -0
- package/bundle/components/PictureText/styleInsuranceSum.d.ts +1 -0
- package/bundle/components/PictureText/styleInsuranceSum.mobile.d.ts +1 -0
- package/bundle/components/PictureText/styleValueBlock.d.ts +2 -0
- package/bundle/components/PictureText/styleValueBlock.mobile.d.ts +2 -0
- package/bundle/components/ProductGallery/ProductGallery.mobile.d.ts +5 -0
- package/bundle/components/RollupItem/RollupItemContent.d.ts +4 -2
- package/bundle/components/RollupItem/renderRoundedIcon.d.ts +3 -0
- package/bundle/components/RollupItem/renderRoundedIcon.mobile.d.ts +4 -0
- package/bundle/icons/IconName.d.ts +4 -2
- package/bundle/ui-kit/BenefitItem/borderRadius.mobile.d.ts +1 -0
- package/bundle/ui-kit/BenefitItem/labelSize.d.ts +1 -0
- package/bundle/ui-kit/BenefitItem/labelSize.mobile.d.ts +1 -0
- package/bundle/ui-kit/Heading/headingTag.d.ts +2 -0
- package/bundle/ui-kit/Heading/headingTag.mobile.d.ts +2 -0
- package/bundle/ui-kit/Icon/IconProps.d.ts +8 -3
- package/bundle/ui-kit/Icon/RoundedIcon.d.ts +5 -1
- package/cosmos-static/icons/ChevronLeft.svg +1 -0
- package/dist/components/BaseTile/BaseTile.js +2 -1
- package/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/dist/components/BenefitsBlock/BenefitsBlock.js +1 -1
- package/dist/components/Blocks.js +2 -2
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Blocks.mobile.js +10 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/Bonus/Bonus.js +1 -1
- package/dist/components/BusinessBlock/BusinessCard.js +1 -1
- package/dist/components/ButtonsBlock/ButtonsBlock.d.ts +6 -0
- package/dist/components/{ButtonBlock/ButtonBlock.js → ButtonsBlock/ButtonsBlock.js} +3 -3
- package/dist/components/ButtonsBlock/ButtonsBlock.js.map +1 -0
- package/dist/components/ButtonsBlock/ButtonsBlockContent.d.ts +8 -0
- package/dist/components/{ButtonBlock/ButtonBlockContent.js → ButtonsBlock/ButtonsBlockContent.js} +1 -1
- package/dist/components/ButtonsBlock/ButtonsBlockContent.js.map +1 -0
- package/dist/components/CardTransfer/CardTransfer.js +1 -1
- package/dist/components/CardTransfer/CardTransfer.js.map +1 -1
- package/dist/components/CarouselCard/CarouselCard.d.ts +1 -1
- package/dist/components/CarouselCard/CarouselCard.js +9 -7
- package/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/dist/components/CarouselCard/getCardWidth.d.ts +1 -0
- package/dist/components/CarouselCard/getCardWidth.js +18 -0
- package/dist/components/CarouselCard/getCardWidth.js.map +1 -0
- package/dist/components/CarouselCard/titleSize.d.ts +1 -0
- package/dist/components/CarouselCard/titleSize.js +4 -0
- package/dist/components/CarouselCard/titleSize.js.map +1 -0
- package/dist/components/CarouselCard/titleSize.mobile.d.ts +1 -0
- package/dist/components/CarouselCard/titleSize.mobile.js +4 -0
- package/dist/components/CarouselCard/titleSize.mobile.js.map +1 -0
- package/dist/components/CarouselProductCard/CarouselProductCard.js +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/dist/components/Footer/Contacts.d.ts +2 -2
- package/dist/components/Footer/Contacts.js +4 -5
- package/dist/components/Footer/Contacts.js.map +1 -1
- package/dist/components/Footer/FooterContent.d.ts +9 -1
- package/dist/components/Footer/FooterDataProps.d.ts +2 -2
- package/dist/components/Header/Header.mobile.d.ts +2 -2
- package/dist/components/Header/Header.mobile.js +3 -17
- package/dist/components/Header/Header.mobile.js.map +1 -1
- package/dist/components/Header/HeaderContent.d.ts +13 -1
- package/dist/components/Header/HeaderTop.d.ts +6 -2
- package/dist/components/Header/HeaderTop.js +15 -2
- package/dist/components/Header/HeaderTop.js.map +1 -1
- package/dist/components/Headline/headlineVersionStyles.js +6 -6
- package/dist/components/Headline/headlineVersionStyles.js.map +1 -1
- package/dist/components/PictureText/PictureText.js +5 -11
- package/dist/components/PictureText/PictureText.js.map +1 -1
- package/dist/components/PictureText/positionStyle.d.ts +1 -0
- package/dist/components/PictureText/positionStyle.js +4 -0
- package/dist/components/PictureText/positionStyle.js.map +1 -0
- package/dist/components/PictureText/positionStyle.mobile.d.ts +1 -0
- package/dist/components/PictureText/positionStyle.mobile.js +4 -0
- package/dist/components/PictureText/positionStyle.mobile.js.map +1 -0
- package/dist/components/PictureText/renderInsuranceSumMonth.d.ts +2 -0
- package/dist/components/PictureText/renderInsuranceSumMonth.js +15 -0
- package/dist/components/PictureText/renderInsuranceSumMonth.js.map +1 -0
- package/dist/components/PictureText/styleInsuranceSum.d.ts +1 -0
- package/dist/components/PictureText/styleInsuranceSum.js +4 -0
- package/dist/components/PictureText/styleInsuranceSum.js.map +1 -0
- package/dist/components/PictureText/styleInsuranceSum.mobile.d.ts +1 -0
- package/dist/components/PictureText/styleInsuranceSum.mobile.js +4 -0
- package/dist/components/PictureText/styleInsuranceSum.mobile.js.map +1 -0
- package/dist/components/PictureText/styleValueBlock.d.ts +2 -0
- package/dist/components/PictureText/styleValueBlock.js +5 -0
- package/dist/components/PictureText/styleValueBlock.js.map +1 -0
- package/dist/components/PictureText/styleValueBlock.mobile.d.ts +2 -0
- package/dist/components/PictureText/styleValueBlock.mobile.js +5 -0
- package/dist/components/PictureText/styleValueBlock.mobile.js.map +1 -0
- package/dist/components/ProductGallery/ProductGallery.mobile.d.ts +5 -0
- package/dist/components/ProductGallery/ProductGallery.mobile.js +13 -0
- package/dist/components/ProductGallery/ProductGallery.mobile.js.map +1 -0
- package/dist/components/RollupItem/RollupItem.js +14 -9
- package/dist/components/RollupItem/RollupItem.js.map +1 -1
- package/dist/components/RollupItem/RollupItemContent.d.ts +4 -2
- package/dist/components/RollupItem/renderRoundedIcon.d.ts +3 -0
- package/dist/components/RollupItem/renderRoundedIcon.js +5 -0
- package/dist/components/RollupItem/renderRoundedIcon.js.map +1 -0
- package/dist/components/RollupItem/renderRoundedIcon.mobile.d.ts +4 -0
- package/dist/components/RollupItem/renderRoundedIcon.mobile.js +7 -0
- package/dist/components/RollupItem/renderRoundedIcon.mobile.js.map +1 -0
- package/dist/content-page-repository/transformImg.js +1 -1
- package/dist/content-page-repository/transformImg.js.map +1 -1
- package/dist/icons/IconName.d.ts +4 -2
- package/dist/icons/IconName.js +3 -1
- package/dist/icons/IconName.js.map +1 -1
- package/dist/ui-kit/BenefitItem/BenefitItem.js +12 -11
- package/dist/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
- package/dist/ui-kit/BenefitItem/borderRadius.mobile.d.ts +1 -0
- package/dist/ui-kit/BenefitItem/borderRadius.mobile.js +4 -0
- package/dist/ui-kit/BenefitItem/borderRadius.mobile.js.map +1 -0
- package/dist/ui-kit/BenefitItem/labelSize.d.ts +1 -0
- package/dist/ui-kit/BenefitItem/labelSize.js +4 -0
- package/dist/ui-kit/BenefitItem/labelSize.js.map +1 -0
- package/dist/ui-kit/BenefitItem/labelSize.mobile.d.ts +1 -0
- package/dist/ui-kit/BenefitItem/labelSize.mobile.js +4 -0
- package/dist/ui-kit/BenefitItem/labelSize.mobile.js.map +1 -0
- package/dist/ui-kit/Button/renderButtonsSection.js +2 -2
- package/dist/ui-kit/Button/renderButtonsSection.js.map +1 -1
- package/dist/ui-kit/Heading/Heading.js +5 -1
- package/dist/ui-kit/Heading/Heading.js.map +1 -1
- package/dist/ui-kit/Heading/headingTag.d.ts +2 -0
- package/dist/ui-kit/Heading/headingTag.js +5 -0
- package/dist/ui-kit/Heading/headingTag.js.map +1 -0
- package/dist/ui-kit/Heading/headingTag.mobile.d.ts +2 -0
- package/dist/ui-kit/Heading/headingTag.mobile.js +13 -0
- package/dist/ui-kit/Heading/headingTag.mobile.js.map +1 -0
- package/dist/ui-kit/Icon/IconProps.d.ts +8 -3
- package/dist/ui-kit/Icon/RoundedIcon.d.ts +5 -1
- package/dist/ui-kit/Icon/RoundedIcon.js +5 -1
- package/dist/ui-kit/Icon/RoundedIcon.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/BaseTile/BaseTile.js +2 -1
- package/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/lib/components/BenefitsBlock/BenefitsBlock.js +1 -1
- package/lib/components/Blocks.js +2 -2
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Blocks.mobile.js +10 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/Bonus/Bonus.js +1 -1
- package/lib/components/BusinessBlock/BusinessCard.js +1 -1
- package/lib/components/ButtonsBlock/ButtonsBlock.d.ts +6 -0
- package/lib/components/ButtonsBlock/ButtonsBlock.fixture.mobile.d.ts +6 -0
- package/lib/components/{ButtonBlock/ButtonBlock.js → ButtonsBlock/ButtonsBlock.js} +2 -2
- package/lib/components/ButtonsBlock/ButtonsBlock.js.map +1 -0
- package/lib/components/ButtonsBlock/ButtonsBlockContent.d.ts +8 -0
- package/lib/components/ButtonsBlock/ButtonsBlockContent.js +2 -0
- package/lib/components/ButtonsBlock/ButtonsBlockContent.js.map +1 -0
- package/lib/components/CardTransfer/CardTransfer.fixture.mobile.d.ts +6 -0
- package/lib/components/CardTransfer/CardTransfer.js +1 -1
- package/lib/components/CardTransfer/CardTransfer.js.map +1 -1
- package/lib/components/CarouselCard/CarouselCard.d.ts +1 -1
- package/lib/components/CarouselCard/CarouselCard.fixture.mobile.d.ts +8 -0
- package/lib/components/CarouselCard/CarouselCard.js +9 -7
- package/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/lib/components/CarouselCard/getCardWidth.d.ts +1 -0
- package/lib/components/CarouselCard/getCardWidth.js +15 -0
- package/lib/components/CarouselCard/getCardWidth.js.map +1 -0
- package/lib/components/CarouselCard/titleSize.d.ts +1 -0
- package/lib/components/CarouselCard/titleSize.js +2 -0
- package/lib/components/CarouselCard/titleSize.js.map +1 -0
- package/lib/components/CarouselCard/titleSize.mobile.d.ts +1 -0
- package/lib/components/CarouselCard/titleSize.mobile.js +2 -0
- package/lib/components/CarouselCard/titleSize.mobile.js.map +1 -0
- package/lib/components/CarouselProductCard/CarouselProductCard.js +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/lib/components/Footer/Contacts.d.ts +2 -2
- package/lib/components/Footer/Contacts.js +4 -5
- package/lib/components/Footer/Contacts.js.map +1 -1
- package/lib/components/Footer/FooterContent.d.ts +9 -1
- package/lib/components/Footer/FooterDataProps.d.ts +2 -2
- package/lib/components/Header/Header.fixture.mobile.d.ts +2 -0
- package/lib/components/Header/Header.mobile.d.ts +2 -2
- package/lib/components/Header/Header.mobile.js +4 -18
- package/lib/components/Header/Header.mobile.js.map +1 -1
- package/lib/components/Header/HeaderContent.d.ts +13 -1
- package/lib/components/Header/HeaderTop.d.ts +6 -2
- package/lib/components/Header/HeaderTop.js +15 -2
- package/lib/components/Header/HeaderTop.js.map +1 -1
- package/lib/components/Headline/headlineVersionStyles.js +6 -6
- package/lib/components/Headline/headlineVersionStyles.js.map +1 -1
- package/lib/components/PictureText/PictureText.fixture.mobile.d.ts +14 -0
- package/lib/components/PictureText/PictureText.js +5 -11
- package/lib/components/PictureText/PictureText.js.map +1 -1
- package/lib/components/PictureText/positionStyle.d.ts +1 -0
- package/lib/components/PictureText/positionStyle.js +2 -0
- package/lib/components/PictureText/positionStyle.js.map +1 -0
- package/lib/components/PictureText/positionStyle.mobile.d.ts +1 -0
- package/lib/components/PictureText/positionStyle.mobile.js +2 -0
- package/lib/components/PictureText/positionStyle.mobile.js.map +1 -0
- package/lib/components/PictureText/renderBenefit.d.ts +0 -1
- package/lib/components/PictureText/renderInsuranceSumMonth.d.ts +1 -0
- package/lib/components/PictureText/renderInsuranceSumMonth.js +12 -0
- package/lib/components/PictureText/renderInsuranceSumMonth.js.map +1 -0
- package/lib/components/PictureText/styleInsuranceSum.d.ts +1 -0
- package/lib/components/PictureText/styleInsuranceSum.js +2 -0
- package/lib/components/PictureText/styleInsuranceSum.js.map +1 -0
- package/lib/components/PictureText/styleInsuranceSum.mobile.d.ts +1 -0
- package/lib/components/PictureText/styleInsuranceSum.mobile.js +2 -0
- package/lib/components/PictureText/styleInsuranceSum.mobile.js.map +1 -0
- package/lib/components/PictureText/styleValueBlock.d.ts +2 -0
- package/lib/components/PictureText/styleValueBlock.js +3 -0
- package/lib/components/PictureText/styleValueBlock.js.map +1 -0
- package/lib/components/PictureText/styleValueBlock.mobile.d.ts +2 -0
- package/lib/components/PictureText/styleValueBlock.mobile.js +3 -0
- package/lib/components/PictureText/styleValueBlock.mobile.js.map +1 -0
- package/lib/components/ProductGallery/ProductGallery.fixture.mobile.d.ts +7 -0
- package/lib/components/ProductGallery/ProductGallery.mobile.d.ts +5 -0
- package/lib/components/ProductGallery/ProductGallery.mobile.js +11 -0
- package/lib/components/ProductGallery/ProductGallery.mobile.js.map +1 -0
- package/lib/components/RollupItem/RollupItem.fixture.mobile.d.ts +1 -0
- package/lib/components/RollupItem/RollupItem.js +14 -9
- package/lib/components/RollupItem/RollupItem.js.map +1 -1
- package/lib/components/RollupItem/RollupItemContent.d.ts +4 -2
- package/lib/components/RollupItem/renderRoundedIcon.d.ts +3 -0
- package/lib/components/RollupItem/renderRoundedIcon.js +2 -0
- package/lib/components/RollupItem/renderRoundedIcon.js.map +1 -0
- package/lib/components/RollupItem/renderRoundedIcon.mobile.d.ts +3 -0
- package/lib/components/RollupItem/renderRoundedIcon.mobile.js +4 -0
- package/lib/components/RollupItem/renderRoundedIcon.mobile.js.map +1 -0
- package/lib/content-page-repository/transformImg.js +1 -1
- package/lib/content-page-repository/transformImg.js.map +1 -1
- package/lib/icons/IconName.d.ts +4 -2
- package/lib/icons/IconName.js +3 -1
- package/lib/icons/IconName.js.map +1 -1
- package/lib/ui-kit/BenefitItem/BenefitItem.js +12 -11
- package/lib/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
- package/lib/ui-kit/BenefitItem/borderRadius.mobile.d.ts +1 -0
- package/lib/ui-kit/BenefitItem/borderRadius.mobile.js +2 -0
- package/lib/ui-kit/BenefitItem/borderRadius.mobile.js.map +1 -0
- package/lib/ui-kit/BenefitItem/labelSize.d.ts +1 -0
- package/lib/ui-kit/BenefitItem/labelSize.js +2 -0
- package/lib/ui-kit/BenefitItem/labelSize.js.map +1 -0
- package/lib/ui-kit/BenefitItem/labelSize.mobile.d.ts +1 -0
- package/lib/ui-kit/BenefitItem/labelSize.mobile.js +2 -0
- package/lib/ui-kit/BenefitItem/labelSize.mobile.js.map +1 -0
- package/lib/ui-kit/Button/renderButtonsSection.js +2 -2
- package/lib/ui-kit/Button/renderButtonsSection.js.map +1 -1
- package/lib/ui-kit/Heading/Heading.js +5 -1
- package/lib/ui-kit/Heading/Heading.js.map +1 -1
- package/lib/ui-kit/Heading/headingTag.d.ts +2 -0
- package/lib/ui-kit/Heading/headingTag.js +2 -0
- package/lib/ui-kit/Heading/headingTag.js.map +1 -0
- package/lib/ui-kit/Heading/headingTag.mobile.d.ts +2 -0
- package/lib/ui-kit/Heading/headingTag.mobile.js +10 -0
- package/lib/ui-kit/Heading/headingTag.mobile.js.map +1 -0
- package/lib/ui-kit/Icon/IconProps.d.ts +8 -3
- package/lib/ui-kit/Icon/RoundedIcon.d.ts +5 -1
- package/lib/ui-kit/Icon/RoundedIcon.js +5 -1
- package/lib/ui-kit/Icon/RoundedIcon.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +532 -655
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ButtonsBlock/ButtonsBlock.d.ts +6 -0
- package/mobile/bundle/components/ButtonsBlock/ButtonsBlockContent.d.ts +8 -0
- package/mobile/bundle/components/CarouselCard/CarouselCard.d.ts +1 -1
- package/mobile/bundle/components/CarouselCard/getCardWidth.d.ts +1 -0
- package/mobile/bundle/components/CarouselCard/titleSize.d.ts +1 -0
- package/mobile/bundle/components/Footer/Contacts.d.ts +2 -2
- package/mobile/bundle/components/Footer/FooterContent.d.ts +9 -1
- package/mobile/bundle/components/Footer/FooterDataProps.d.ts +2 -2
- package/mobile/bundle/components/Header/Header.d.ts +2 -2
- package/mobile/bundle/components/Header/HeaderContent.d.ts +13 -1
- package/mobile/bundle/components/Header/HeaderTop.d.ts +6 -2
- package/mobile/bundle/components/PictureText/positionStyle.d.ts +1 -0
- package/mobile/bundle/components/PictureText/renderInsuranceSumMonth.d.ts +2 -0
- package/mobile/bundle/components/PictureText/styleInsuranceSum.d.ts +1 -0
- package/mobile/bundle/components/PictureText/styleValueBlock.d.ts +2 -0
- package/mobile/bundle/components/RollupItem/RollupItemContent.d.ts +4 -2
- package/mobile/bundle/components/RollupItem/renderRoundedIcon.d.ts +4 -0
- package/mobile/bundle/icons/IconName.d.ts +4 -2
- package/mobile/bundle/ui-kit/BenefitItem/labelSize.d.ts +1 -0
- package/mobile/bundle/ui-kit/Heading/headingTag.d.ts +2 -0
- package/mobile/bundle/ui-kit/Icon/IconProps.d.ts +8 -3
- package/mobile/bundle/ui-kit/Icon/RoundedIcon.d.ts +5 -1
- package/mobile/dist/components/BaseTile/BaseTile.js +2 -1
- package/mobile/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js +1 -1
- package/mobile/dist/components/Blocks.js +10 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/Bonus/Bonus.js +1 -1
- package/mobile/dist/components/BusinessBlock/BusinessCard.js +1 -1
- package/mobile/dist/components/ButtonsBlock/ButtonsBlock.d.ts +6 -0
- package/mobile/dist/components/{ButtonBlock/ButtonBlock.js → ButtonsBlock/ButtonsBlock.js} +3 -3
- package/mobile/dist/components/ButtonsBlock/ButtonsBlock.js.map +1 -0
- package/mobile/dist/components/ButtonsBlock/ButtonsBlockContent.d.ts +8 -0
- package/mobile/dist/components/{ButtonBlock/ButtonBlockContent.js → ButtonsBlock/ButtonsBlockContent.js} +1 -1
- package/mobile/dist/components/ButtonsBlock/ButtonsBlockContent.js.map +1 -0
- package/mobile/dist/components/CardTransfer/CardTransfer.js +1 -1
- package/mobile/dist/components/CardTransfer/CardTransfer.js.map +1 -1
- package/mobile/dist/components/CarouselCard/CarouselCard.d.ts +1 -1
- package/mobile/dist/components/CarouselCard/CarouselCard.js +9 -7
- package/mobile/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/dist/components/CarouselCard/getCardWidth.d.ts +1 -0
- package/mobile/dist/components/CarouselCard/getCardWidth.js +18 -0
- package/mobile/dist/components/CarouselCard/getCardWidth.js.map +1 -0
- package/mobile/dist/components/CarouselCard/titleSize.d.ts +1 -0
- package/mobile/dist/components/CarouselCard/titleSize.js +4 -0
- package/mobile/dist/components/CarouselCard/titleSize.js.map +1 -0
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/dist/components/Footer/Contacts.d.ts +2 -2
- package/mobile/dist/components/Footer/Contacts.js +4 -5
- package/mobile/dist/components/Footer/Contacts.js.map +1 -1
- package/mobile/dist/components/Footer/FooterContent.d.ts +9 -1
- package/mobile/dist/components/Footer/FooterDataProps.d.ts +2 -2
- package/mobile/dist/components/Header/Header.d.ts +2 -2
- package/mobile/dist/components/Header/Header.js +3 -17
- package/mobile/dist/components/Header/Header.js.map +1 -1
- package/mobile/dist/components/Header/HeaderContent.d.ts +13 -1
- package/mobile/dist/components/Header/HeaderTop.d.ts +6 -2
- package/mobile/dist/components/Header/HeaderTop.js +15 -2
- package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
- package/mobile/dist/components/Headline/headlineVersionStyles.js +6 -6
- package/mobile/dist/components/Headline/headlineVersionStyles.js.map +1 -1
- package/mobile/dist/components/PictureText/PictureText.js +5 -11
- package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
- package/mobile/dist/components/PictureText/positionStyle.d.ts +1 -0
- package/mobile/dist/components/PictureText/positionStyle.js +4 -0
- package/mobile/dist/components/PictureText/positionStyle.js.map +1 -0
- package/mobile/dist/components/PictureText/renderInsuranceSumMonth.d.ts +2 -0
- package/mobile/dist/components/PictureText/renderInsuranceSumMonth.js +15 -0
- package/mobile/dist/components/PictureText/renderInsuranceSumMonth.js.map +1 -0
- package/mobile/dist/components/PictureText/styleInsuranceSum.d.ts +1 -0
- package/mobile/dist/components/PictureText/styleInsuranceSum.js +4 -0
- package/mobile/dist/components/PictureText/styleInsuranceSum.js.map +1 -0
- package/mobile/dist/components/PictureText/styleValueBlock.d.ts +2 -0
- package/mobile/dist/components/PictureText/styleValueBlock.js +5 -0
- package/mobile/dist/components/PictureText/styleValueBlock.js.map +1 -0
- package/mobile/dist/components/ProductGallery/ProductGallery.js +4 -17
- package/mobile/dist/components/ProductGallery/ProductGallery.js.map +1 -1
- package/mobile/dist/components/RollupItem/RollupItem.js +14 -9
- package/mobile/dist/components/RollupItem/RollupItem.js.map +1 -1
- package/mobile/dist/components/RollupItem/RollupItemContent.d.ts +4 -2
- package/mobile/dist/components/RollupItem/renderRoundedIcon.d.ts +4 -0
- package/mobile/dist/components/RollupItem/renderRoundedIcon.js +7 -0
- package/mobile/dist/components/RollupItem/renderRoundedIcon.js.map +1 -0
- package/mobile/dist/content-page-repository/transformImg.js +1 -1
- package/mobile/dist/content-page-repository/transformImg.js.map +1 -1
- package/mobile/dist/icons/IconName.d.ts +4 -2
- package/mobile/dist/icons/IconName.js +3 -1
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/ui-kit/BenefitItem/BenefitItem.js +12 -11
- package/mobile/dist/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
- package/mobile/dist/ui-kit/BenefitItem/labelSize.d.ts +1 -0
- package/mobile/dist/ui-kit/BenefitItem/labelSize.js +4 -0
- package/mobile/dist/ui-kit/BenefitItem/labelSize.js.map +1 -0
- package/mobile/dist/ui-kit/Button/renderButtonsSection.js +2 -2
- package/mobile/dist/ui-kit/Button/renderButtonsSection.js.map +1 -1
- package/mobile/dist/ui-kit/Heading/Heading.js +12 -11
- package/mobile/dist/ui-kit/Heading/Heading.js.map +1 -1
- package/mobile/dist/ui-kit/Heading/headingTag.d.ts +2 -0
- package/mobile/dist/ui-kit/Heading/headingTag.js +13 -0
- package/mobile/dist/ui-kit/Heading/headingTag.js.map +1 -0
- package/mobile/dist/ui-kit/Icon/IconProps.d.ts +8 -3
- package/mobile/dist/ui-kit/Icon/RoundedIcon.d.ts +5 -1
- package/mobile/dist/ui-kit/Icon/RoundedIcon.js +5 -1
- package/mobile/dist/ui-kit/Icon/RoundedIcon.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/BaseTile/BaseTile.js +2 -1
- package/mobile/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js +1 -1
- package/mobile/lib/components/Blocks.js +10 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/Bonus/Bonus.js +1 -1
- package/mobile/lib/components/BusinessBlock/BusinessCard.js +1 -1
- package/mobile/lib/components/ButtonsBlock/ButtonsBlock.d.ts +6 -0
- package/mobile/lib/components/{ButtonBlock/ButtonBlock.js → ButtonsBlock/ButtonsBlock.js} +2 -2
- package/mobile/lib/components/ButtonsBlock/ButtonsBlock.js.map +1 -0
- package/mobile/lib/components/ButtonsBlock/ButtonsBlockContent.d.ts +8 -0
- package/mobile/lib/components/ButtonsBlock/ButtonsBlockContent.js +2 -0
- package/mobile/lib/components/ButtonsBlock/ButtonsBlockContent.js.map +1 -0
- package/mobile/lib/components/CardTransfer/CardTransfer.js +1 -1
- package/mobile/lib/components/CardTransfer/CardTransfer.js.map +1 -1
- package/mobile/lib/components/CarouselCard/CarouselCard.d.ts +1 -1
- package/mobile/lib/components/CarouselCard/CarouselCard.js +9 -7
- package/mobile/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/lib/components/CarouselCard/getCardWidth.d.ts +1 -0
- package/mobile/lib/components/CarouselCard/getCardWidth.js +15 -0
- package/mobile/lib/components/CarouselCard/getCardWidth.js.map +1 -0
- package/mobile/lib/components/CarouselCard/titleSize.d.ts +1 -0
- package/mobile/lib/components/CarouselCard/titleSize.js +2 -0
- package/mobile/lib/components/CarouselCard/titleSize.js.map +1 -0
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/lib/components/Footer/Contacts.d.ts +2 -2
- package/mobile/lib/components/Footer/Contacts.js +4 -5
- package/mobile/lib/components/Footer/Contacts.js.map +1 -1
- package/mobile/lib/components/Footer/FooterContent.d.ts +9 -1
- package/mobile/lib/components/Footer/FooterDataProps.d.ts +2 -2
- package/mobile/lib/components/Header/Header.d.ts +2 -2
- package/mobile/lib/components/Header/Header.js +4 -18
- package/mobile/lib/components/Header/Header.js.map +1 -1
- package/mobile/lib/components/Header/HeaderContent.d.ts +13 -1
- package/mobile/lib/components/Header/HeaderTop.d.ts +6 -2
- package/mobile/lib/components/Header/HeaderTop.js +15 -2
- package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
- package/mobile/lib/components/Headline/headlineVersionStyles.js +6 -6
- package/mobile/lib/components/Headline/headlineVersionStyles.js.map +1 -1
- package/mobile/lib/components/PictureText/PictureText.js +5 -11
- package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
- package/mobile/lib/components/PictureText/positionStyle.d.ts +1 -0
- package/mobile/lib/components/PictureText/positionStyle.js +2 -0
- package/mobile/lib/components/PictureText/positionStyle.js.map +1 -0
- package/mobile/lib/components/PictureText/renderInsuranceSumMonth.d.ts +2 -0
- package/mobile/lib/components/PictureText/renderInsuranceSumMonth.js +12 -0
- package/mobile/lib/components/PictureText/renderInsuranceSumMonth.js.map +1 -0
- package/mobile/lib/components/PictureText/styleInsuranceSum.d.ts +1 -0
- package/mobile/lib/components/PictureText/styleInsuranceSum.js +2 -0
- package/mobile/lib/components/PictureText/styleInsuranceSum.js.map +1 -0
- package/mobile/lib/components/PictureText/styleValueBlock.d.ts +2 -0
- package/mobile/lib/components/PictureText/styleValueBlock.js +3 -0
- package/mobile/lib/components/PictureText/styleValueBlock.js.map +1 -0
- package/mobile/lib/components/ProductGallery/ProductGallery.js +5 -18
- package/mobile/lib/components/ProductGallery/ProductGallery.js.map +1 -1
- package/mobile/lib/components/RollupItem/RollupItem.js +14 -9
- package/mobile/lib/components/RollupItem/RollupItem.js.map +1 -1
- package/mobile/lib/components/RollupItem/RollupItemContent.d.ts +4 -2
- package/mobile/lib/components/RollupItem/renderRoundedIcon.d.ts +4 -0
- package/mobile/lib/components/RollupItem/renderRoundedIcon.js +4 -0
- package/mobile/lib/components/RollupItem/renderRoundedIcon.js.map +1 -0
- package/mobile/lib/content-page-repository/transformImg.js +1 -1
- package/mobile/lib/content-page-repository/transformImg.js.map +1 -1
- package/mobile/lib/icons/IconName.d.ts +4 -2
- package/mobile/lib/icons/IconName.js +3 -1
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/ui-kit/BenefitItem/BenefitItem.js +12 -11
- package/mobile/lib/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
- package/mobile/lib/ui-kit/BenefitItem/labelSize.d.ts +1 -0
- package/mobile/lib/ui-kit/BenefitItem/labelSize.js +2 -0
- package/mobile/lib/ui-kit/BenefitItem/labelSize.js.map +1 -0
- package/mobile/lib/ui-kit/Button/renderButtonsSection.js +2 -2
- package/mobile/lib/ui-kit/Button/renderButtonsSection.js.map +1 -1
- package/mobile/lib/ui-kit/Heading/Heading.js +12 -11
- package/mobile/lib/ui-kit/Heading/Heading.js.map +1 -1
- package/mobile/lib/ui-kit/Heading/headingTag.d.ts +2 -0
- package/mobile/lib/ui-kit/Heading/headingTag.js +10 -0
- package/mobile/lib/ui-kit/Heading/headingTag.js.map +1 -0
- package/mobile/lib/ui-kit/Icon/IconProps.d.ts +8 -3
- package/mobile/lib/ui-kit/Icon/RoundedIcon.d.ts +5 -1
- package/mobile/lib/ui-kit/Icon/RoundedIcon.js +5 -1
- package/mobile/lib/ui-kit/Icon/RoundedIcon.js.map +1 -1
- package/mobile/src/components/BaseTile/BaseTile.tsx +6 -3
- package/mobile/src/components/BenefitsBlock/BenefitsBlock.tsx +1 -1
- package/mobile/src/components/Blocks.ts +10 -0
- package/mobile/src/components/Bonus/Bonus.tsx +1 -1
- package/mobile/src/components/BusinessBlock/BusinessCard.tsx +1 -1
- package/mobile/src/components/ButtonsBlock/ButtonsBlock.example.json +14 -0
- package/{src/components/ButtonBlock/ButtonBlock.tsx → mobile/src/components/ButtonsBlock/ButtonsBlock.tsx} +4 -4
- package/mobile/src/components/ButtonsBlock/ButtonsBlock.ui.json +14 -0
- package/mobile/src/components/ButtonsBlock/ButtonsBlockContent.ts +9 -0
- package/mobile/src/components/CardTransfer/CardTransfer.tsx +9 -3
- package/mobile/src/components/CarouselCard/CarouselCard.tsx +16 -12
- package/mobile/src/components/CarouselCard/getCardWidth.tsx +16 -0
- package/mobile/src/components/CarouselCard/titleSize.tsx +1 -0
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.tsx +1 -3
- package/mobile/src/components/Footer/Contacts.tsx +20 -12
- package/mobile/src/components/Footer/FooterContent.ts +10 -1
- package/mobile/src/components/Footer/FooterDataProps.ts +2 -2
- package/mobile/src/components/Header/Header.tsx +19 -50
- package/mobile/src/components/Header/HeaderContent.ts +15 -1
- package/mobile/src/components/Header/HeaderTop.tsx +62 -25
- package/mobile/src/components/Headline/headlineVersionStyles.ts +6 -6
- package/mobile/src/components/PictureText/PictureText.tsx +13 -27
- package/mobile/src/components/PictureText/positionStyle.tsx +1 -0
- package/mobile/src/components/PictureText/renderInsuranceSumMonth.tsx +28 -0
- package/mobile/src/components/PictureText/styleInsuranceSum.tsx +1 -0
- package/mobile/src/components/PictureText/styleValueBlock.tsx +2 -0
- package/mobile/src/components/ProductGallery/ProductGallery.tsx +18 -59
- package/mobile/src/components/RollupItem/RollupItem.tsx +25 -18
- package/mobile/src/components/RollupItem/RollupItem.ui.json +7 -1
- package/mobile/src/components/RollupItem/RollupItemContent.ts +4 -2
- package/mobile/src/components/RollupItem/renderRoundedIcon.tsx +7 -0
- package/mobile/src/content-page-repository/transformImg.ts +1 -1
- package/mobile/src/icons/ChevronLeft.svg +3 -0
- package/mobile/src/icons/IconName.ts +5 -5
- package/mobile/src/ui-kit/BenefitItem/BenefitItem.tsx +26 -22
- package/mobile/src/ui-kit/BenefitItem/labelSize.tsx +1 -0
- package/mobile/src/ui-kit/Button/renderButtonsSection.tsx +8 -2
- package/mobile/src/ui-kit/Heading/Heading.tsx +17 -16
- package/mobile/src/ui-kit/Heading/headingTag.ts +12 -0
- package/mobile/src/ui-kit/Icon/IconProps.ts +9 -4
- package/mobile/src/ui-kit/Icon/RoundedIcon.tsx +18 -6
- package/package.json +1 -1
- package/src/components/BaseTile/BaseTile.tsx +6 -3
- package/src/components/BenefitsBlock/BenefitsBlock.tsx +1 -1
- package/src/components/Blocks.mobile.ts +10 -0
- package/src/components/Blocks.ts +2 -2
- package/src/components/Bonus/Bonus.tsx +1 -1
- package/src/components/BusinessBlock/BusinessCard.tsx +1 -1
- package/src/components/ButtonsBlock/ButtonsBlock.example.json +14 -0
- package/src/components/ButtonsBlock/ButtonsBlock.fixture.mobile.tsx +26 -0
- package/src/components/ButtonsBlock/ButtonsBlock.fixture.tsx +26 -0
- package/{mobile/src/components/ButtonBlock/ButtonBlock.tsx → src/components/ButtonsBlock/ButtonsBlock.tsx} +4 -4
- package/src/components/ButtonsBlock/ButtonsBlock.ui.json +14 -0
- package/src/components/ButtonsBlock/ButtonsBlockContent.ts +9 -0
- package/src/components/CardTransfer/CardTransfer.fixture.mobile.tsx +18 -0
- package/src/components/CardTransfer/CardTransfer.tsx +9 -3
- package/src/components/CarouselCard/CarouselCard.fixture.mobile.tsx +28 -0
- package/src/components/CarouselCard/CarouselCard.tsx +16 -12
- package/src/components/CarouselCard/getCardWidth.tsx +16 -0
- package/src/components/CarouselCard/titleSize.mobile.tsx +1 -0
- package/src/components/CarouselCard/titleSize.tsx +1 -0
- package/src/components/CarouselProductCard/CarouselProductCard.tsx +1 -3
- package/src/components/Footer/Contacts.tsx +20 -12
- package/src/components/Footer/FooterContent.ts +10 -1
- package/src/components/Footer/FooterDataProps.ts +2 -2
- package/src/components/Header/Header.fixture.mobile.tsx +4 -0
- package/src/components/Header/Header.mobile.tsx +19 -50
- package/src/components/Header/HeaderContent.ts +15 -1
- package/src/components/Header/HeaderTop.tsx +62 -25
- package/src/components/Headline/headlineVersionStyles.ts +6 -6
- package/src/components/PictureText/PictureText.fixture.mobile.tsx +122 -0
- package/src/components/PictureText/PictureText.tsx +13 -27
- package/src/components/PictureText/positionStyle.mobile.tsx +1 -0
- package/src/components/PictureText/positionStyle.tsx +1 -0
- package/src/components/PictureText/renderInsuranceSumMonth.tsx +28 -0
- package/src/components/PictureText/styleInsuranceSum.mobile.tsx +1 -0
- package/src/components/PictureText/styleInsuranceSum.tsx +1 -0
- package/src/components/PictureText/styleValueBlock.mobile.tsx +2 -0
- package/src/components/PictureText/styleValueBlock.tsx +2 -0
- package/src/components/ProductGallery/ProductGallery.fixture.mobile.tsx +142 -0
- package/src/components/ProductGallery/ProductGallery.mobile.tsx +34 -0
- package/src/components/RollupItem/RollupItem.fixture.mobile.tsx +15 -0
- package/src/components/RollupItem/RollupItem.tsx +25 -18
- package/src/components/RollupItem/RollupItem.ui.json +7 -1
- package/src/components/RollupItem/RollupItemContent.ts +4 -2
- package/src/components/RollupItem/renderRoundedIcon.mobile.tsx +7 -0
- package/src/components/RollupItem/renderRoundedIcon.tsx +4 -0
- package/src/content-page-repository/transformImg.ts +1 -1
- package/src/icons/ChevronLeft.svg +3 -0
- package/src/icons/IconName.ts +5 -1
- package/src/ui-kit/BenefitItem/BenefitItem.tsx +26 -22
- package/src/ui-kit/BenefitItem/borderRadius.mobile.tsx +1 -0
- package/src/ui-kit/BenefitItem/labelSize.mobile.tsx +1 -0
- package/src/ui-kit/BenefitItem/labelSize.tsx +1 -0
- package/src/ui-kit/Button/renderButtonsSection.tsx +8 -2
- package/src/ui-kit/Heading/Heading.fixture.mobile.tsx +6 -6
- package/src/ui-kit/Heading/Heading.fixture.tsx +6 -6
- package/src/ui-kit/Heading/Heading.tsx +8 -3
- package/src/ui-kit/Heading/headingTag.mobile.ts +12 -0
- package/src/ui-kit/Heading/headingTag.ts +3 -0
- package/src/ui-kit/Icon/IconProps.ts +9 -4
- package/src/ui-kit/Icon/RoundedIcon.tsx +18 -6
- package/tailwind.config.cjs +10 -4
- package/bundle/components/ButtonBlock/ButtonBlock.d.ts +0 -6
- package/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +0 -8
- package/bundle/ui-kit/Heading/Heading.mobile.d.ts +0 -2
- package/dist/components/ButtonBlock/ButtonBlock.d.ts +0 -6
- package/dist/components/ButtonBlock/ButtonBlock.js.map +0 -1
- package/dist/components/ButtonBlock/ButtonBlockContent.d.ts +0 -8
- package/dist/components/ButtonBlock/ButtonBlockContent.js.map +0 -1
- package/dist/ui-kit/Heading/Heading.mobile.d.ts +0 -2
- package/dist/ui-kit/Heading/Heading.mobile.js +0 -18
- package/dist/ui-kit/Heading/Heading.mobile.js.map +0 -1
- package/lib/components/ButtonBlock/ButtonBlock.d.ts +0 -6
- package/lib/components/ButtonBlock/ButtonBlock.js.map +0 -1
- package/lib/components/ButtonBlock/ButtonBlockContent.d.ts +0 -8
- package/lib/components/ButtonBlock/ButtonBlockContent.js +0 -2
- package/lib/components/ButtonBlock/ButtonBlockContent.js.map +0 -1
- package/lib/ui-kit/Heading/Heading.mobile.d.ts +0 -2
- package/lib/ui-kit/Heading/Heading.mobile.js +0 -16
- package/lib/ui-kit/Heading/Heading.mobile.js.map +0 -1
- package/mobile/bundle/components/ButtonBlock/ButtonBlock.d.ts +0 -6
- package/mobile/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +0 -8
- package/mobile/dist/components/ButtonBlock/ButtonBlock.d.ts +0 -6
- package/mobile/dist/components/ButtonBlock/ButtonBlock.js.map +0 -1
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.d.ts +0 -8
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.js.map +0 -1
- package/mobile/lib/components/ButtonBlock/ButtonBlock.d.ts +0 -6
- package/mobile/lib/components/ButtonBlock/ButtonBlock.js.map +0 -1
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.d.ts +0 -8
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js +0 -2
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js.map +0 -1
- package/mobile/src/components/ButtonBlock/ButtonBlock.example.json +0 -12
- package/mobile/src/components/ButtonBlock/ButtonBlock.ui.json +0 -12
- package/mobile/src/components/ButtonBlock/ButtonBlockContent.ts +0 -9
- package/src/components/ButtonBlock/ButtonBlock.example.json +0 -12
- package/src/components/ButtonBlock/ButtonBlock.fixture.tsx +0 -19
- package/src/components/ButtonBlock/ButtonBlock.ui.json +0 -12
- package/src/components/ButtonBlock/ButtonBlockContent.ts +0 -9
- package/src/ui-kit/Heading/Heading.mobile.tsx +0 -22
- /package/lib/components/{ButtonBlock/ButtonBlock.fixture.d.ts → ButtonsBlock/ButtonsBlock.fixture.d.ts} +0 -0
|
@@ -237,55 +237,6 @@
|
|
|
237
237
|
return JSXTmpl;
|
|
238
238
|
};
|
|
239
239
|
|
|
240
|
-
const style = (...atoms) => atoms
|
|
241
|
-
.flatMap((_) => _)
|
|
242
|
-
.filter(Boolean)
|
|
243
|
-
.join(' ');
|
|
244
|
-
|
|
245
|
-
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
246
|
-
|
|
247
|
-
const DEFAULT_ANCESTORS = [];
|
|
248
|
-
const defaultStyle = 'col-span-12';
|
|
249
|
-
function renderBlock(block, options, { className, ...extraProps } = {}) {
|
|
250
|
-
const { key, blockDecorator = defaultBlockDecorator, blocksRegistry = {}, ancestors = DEFAULT_ANCESTORS, } = options;
|
|
251
|
-
const { type } = block;
|
|
252
|
-
if (!(type && type in blocksRegistry)) {
|
|
253
|
-
console.warn(`No block with "${type}" is registered`);
|
|
254
|
-
}
|
|
255
|
-
const BlockComponent = type && blocksRegistry[type];
|
|
256
|
-
return blockDecorator({
|
|
257
|
-
blockClassName: style('scroll-mt-12', // TODO scroll-mt-12 ? here?
|
|
258
|
-
className, block.style || defaultStyle),
|
|
259
|
-
block,
|
|
260
|
-
ancestors,
|
|
261
|
-
// Adjusted by decorator block and blockClassName
|
|
262
|
-
render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
|
|
263
|
-
const { content } = adjustedBlock;
|
|
264
|
-
return BlockComponent ? (jsx(BlockComponent, { className: adjustedBlockClassName, block: block, options: options, ...content, ...extraProps }, key)) : null;
|
|
265
|
-
},
|
|
266
|
-
}, key);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
const DEFAULT_SLOT_NAME = null;
|
|
270
|
-
|
|
271
|
-
const EMPTY_ANCESTORS = [];
|
|
272
|
-
const renderBlocksList = (blocks, { key, ancestors = EMPTY_ANCESTORS, slotName = DEFAULT_SLOT_NAME, renderProps = renderBlock, ...options }) => (blocks || []).map((_, j) => renderProps(_, {
|
|
273
|
-
...options,
|
|
274
|
-
key: `${key ? key : _.type}-${j}`,
|
|
275
|
-
ancestors: options.parent
|
|
276
|
-
? [...(ancestors || EMPTY_ANCESTORS), [options.parent, slotName]]
|
|
277
|
-
: ancestors,
|
|
278
|
-
}));
|
|
279
|
-
|
|
280
|
-
function renderChildren({ children, block, options, renderProps, }) {
|
|
281
|
-
if (children) {
|
|
282
|
-
return children;
|
|
283
|
-
}
|
|
284
|
-
return block && options
|
|
285
|
-
? renderBlocksList(block.blocks, { ...options, parent: block, renderProps })
|
|
286
|
-
: null;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
240
|
class EventBus {
|
|
290
241
|
subscribers = {};
|
|
291
242
|
subjectsStateMap = {};
|
|
@@ -353,6 +304,11 @@
|
|
|
353
304
|
return useIntersectionObserver(observerCallback, { sensitivity: 1 });
|
|
354
305
|
}
|
|
355
306
|
|
|
307
|
+
const style = (...atoms) => atoms
|
|
308
|
+
.flatMap((_) => _)
|
|
309
|
+
.filter(Boolean)
|
|
310
|
+
.join(' ');
|
|
311
|
+
|
|
356
312
|
const blockStyles = {
|
|
357
313
|
primary: 'bg-white text-primary-text',
|
|
358
314
|
secondary: 'bg-primary-main text-white',
|
|
@@ -371,159 +327,6 @@
|
|
|
371
327
|
});
|
|
372
328
|
const groupStyle = (isGroup) => (isGroup ? 'group' : '');
|
|
373
329
|
|
|
374
|
-
const mapChildren = (mapper) => (children) => {
|
|
375
|
-
if (children === null || children === undefined) {
|
|
376
|
-
return children;
|
|
377
|
-
}
|
|
378
|
-
return Array.isArray(children) ? children.map(mapper) : mapper(children, 0);
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
const HEADER_HEIGHT = 170;
|
|
382
|
-
const FOOTER_HEIGHT = 48;
|
|
383
|
-
const BLOCKS_GAP = 4;
|
|
384
|
-
const PAGE_PADDINGS_X = 20;
|
|
385
|
-
const DEFAULT_HEIGHT = 866;
|
|
386
|
-
const getContainerHeight = (minHeight) => ({
|
|
387
|
-
height: `calc(100vh - ${HEADER_HEIGHT + FOOTER_HEIGHT + BLOCKS_GAP + PAGE_PADDINGS_X}px)`,
|
|
388
|
-
minHeight: `${minHeight || DEFAULT_HEIGHT}px`,
|
|
389
|
-
});
|
|
390
|
-
|
|
391
|
-
const SwipeListItem = JSX(({ className = '', style, idx, activeIndex, observerOptions, children, onIntersection }) => {
|
|
392
|
-
const observerCallback = useCallback((entries) => {
|
|
393
|
-
if (entries.length && onIntersection) {
|
|
394
|
-
onIntersection(idx || 0, entries[entries.length - 1]);
|
|
395
|
-
}
|
|
396
|
-
}, [onIntersection, idx]);
|
|
397
|
-
const ref = useIntersectionObserver(observerCallback, observerOptions);
|
|
398
|
-
return (jsx("div", { className: `inline-block snap-always box-border ${className}`, style: style, "aria-current": Boolean(idx === activeIndex), ref: ref, children: children }));
|
|
399
|
-
});
|
|
400
|
-
|
|
401
|
-
const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
|
|
402
|
-
const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', minHeight, children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
|
|
403
|
-
const observerOptions = {
|
|
404
|
-
sensitivity: 1,
|
|
405
|
-
rootRef: containerRef,
|
|
406
|
-
};
|
|
407
|
-
const itemsVisibilityListRef = useRef([]);
|
|
408
|
-
const handleIntersection = useCallback((idx, entry) => {
|
|
409
|
-
const itemsVisibilityList = [...(itemsVisibilityListRef.current || [])];
|
|
410
|
-
itemsVisibilityList[idx] = entry;
|
|
411
|
-
itemsVisibilityListRef.current = itemsVisibilityList;
|
|
412
|
-
onVisibleItemsChange && onVisibleItemsChange(itemsVisibilityList);
|
|
413
|
-
onVisibleIndicesChange && onVisibleIndicesChange(getVisibleIndices(itemsVisibilityList));
|
|
414
|
-
}, [onVisibleItemsChange, onVisibleIndicesChange]);
|
|
415
|
-
const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
|
|
416
|
-
const isVerticalList = listType === 'vertical-list';
|
|
417
|
-
const isHorizontalList = listType === 'horizontal-list';
|
|
418
|
-
const containerStyle = {
|
|
419
|
-
...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
|
|
420
|
-
...(isVerticalList ? getContainerHeight(minHeight) : {}),
|
|
421
|
-
gap: `${gap}px`,
|
|
422
|
-
};
|
|
423
|
-
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) }));
|
|
424
|
-
});
|
|
425
|
-
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
426
|
-
const getContainerOffset = (padding, additionalPadding = 0) => ({
|
|
427
|
-
marginLeft: `${-padding}px`,
|
|
428
|
-
marginRight: `${-padding}px`,
|
|
429
|
-
paddingLeft: `${padding}px`,
|
|
430
|
-
paddingRight: `${padding + additionalPadding}px`,
|
|
431
|
-
});
|
|
432
|
-
const getVisibleIndices = (itemsVisibilityList) => itemsVisibilityList
|
|
433
|
-
.map((_, i) => [_, i])
|
|
434
|
-
.filter(([_]) => _ && _.intersectionRatio >= 0.9)
|
|
435
|
-
.map(([, i]) => i);
|
|
436
|
-
|
|
437
|
-
const containerStyles = {
|
|
438
|
-
'horizontal-list': 'mx-auto mt-5 w-fit',
|
|
439
|
-
'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
|
|
440
|
-
};
|
|
441
|
-
const activeDotStyles = {
|
|
442
|
-
'horizontal-list': 'w-6',
|
|
443
|
-
'vertical-list': 'h-6',
|
|
444
|
-
};
|
|
445
|
-
const dotStyle = 'cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white';
|
|
446
|
-
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
447
|
-
const SwipeListControlDots = JSX(({ containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list', version }) => {
|
|
448
|
-
const handleClick = (idx) => {
|
|
449
|
-
if (idx !== activeIndex && containerRef?.current) {
|
|
450
|
-
containerRef.current.children[idx]?.scrollIntoView({
|
|
451
|
-
behavior: 'smooth',
|
|
452
|
-
block: 'nearest',
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
};
|
|
456
|
-
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;
|
|
457
|
-
});
|
|
458
|
-
|
|
459
|
-
const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
|
|
460
|
-
|
|
461
|
-
const defaultDiscriminator = (_) => _;
|
|
462
|
-
const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
|
|
463
|
-
const max = maxBy();
|
|
464
|
-
|
|
465
|
-
const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
|
|
466
|
-
|
|
467
|
-
const getItemWidth = (container) => (itemCount) => container.scrollWidth / itemCount;
|
|
468
|
-
const scrollBy = (container) => (itemCount, delta) => {
|
|
469
|
-
container.scrollBy({ left: delta * getItemWidth(container)(itemCount), behavior: 'smooth' });
|
|
470
|
-
};
|
|
471
|
-
|
|
472
|
-
const scrollToEnd = (container) => {
|
|
473
|
-
container.scrollTo({ left: container.scrollWidth, behavior: 'smooth' });
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
const scrollToStart = (container) => {
|
|
477
|
-
container.scrollTo({ left: 0, behavior: 'smooth' });
|
|
478
|
-
};
|
|
479
|
-
|
|
480
|
-
const useSwipeListScroll = ({ itemCount, isCyclic, onVisibleIndicesChange, }) => {
|
|
481
|
-
const containerRef = useRef(null);
|
|
482
|
-
const [visibleIndices, setVisibleIndices] = useState([]);
|
|
483
|
-
const handleVisibleIndicesChange = useCallback((indices) => {
|
|
484
|
-
setVisibleIndices((prevIndices) => areArraysEqual(prevIndices, indices) ? prevIndices : indices);
|
|
485
|
-
onVisibleIndicesChange && onVisibleIndicesChange(indices);
|
|
486
|
-
}, [itemCount]);
|
|
487
|
-
const [minIndex, maxIndex] = visibleIndices.length
|
|
488
|
-
? [minBy()(visibleIndices), maxBy()(visibleIndices)]
|
|
489
|
-
: [-1, -1];
|
|
490
|
-
const canScrollLeft = minIndex > 0;
|
|
491
|
-
const canScrollRight = maxIndex < itemCount - 1;
|
|
492
|
-
const scrollLeft = useCallback(() => {
|
|
493
|
-
if (!containerRef.current) {
|
|
494
|
-
return;
|
|
495
|
-
}
|
|
496
|
-
if (isCyclic && !canScrollLeft) {
|
|
497
|
-
scrollToEnd(containerRef.current);
|
|
498
|
-
}
|
|
499
|
-
else {
|
|
500
|
-
scrollBy(containerRef.current)(itemCount, -1);
|
|
501
|
-
}
|
|
502
|
-
}, [isCyclic, itemCount, canScrollLeft]);
|
|
503
|
-
const scrollRight = useCallback(() => {
|
|
504
|
-
if (!containerRef.current) {
|
|
505
|
-
return;
|
|
506
|
-
}
|
|
507
|
-
if (isCyclic && !canScrollRight) {
|
|
508
|
-
scrollToStart(containerRef.current);
|
|
509
|
-
}
|
|
510
|
-
else {
|
|
511
|
-
scrollBy(containerRef.current)(itemCount, 1);
|
|
512
|
-
}
|
|
513
|
-
}, [itemCount, isCyclic, canScrollRight]);
|
|
514
|
-
return [
|
|
515
|
-
containerRef,
|
|
516
|
-
{
|
|
517
|
-
scrollLeft,
|
|
518
|
-
scrollRight,
|
|
519
|
-
canScrollLeft: isCyclic || canScrollLeft,
|
|
520
|
-
canScrollRight: isCyclic || canScrollRight,
|
|
521
|
-
visibleIndicesRange: [minIndex, maxIndex],
|
|
522
|
-
handleVisibleIndicesChange,
|
|
523
|
-
},
|
|
524
|
-
];
|
|
525
|
-
};
|
|
526
|
-
|
|
527
330
|
function useRouter() {
|
|
528
331
|
return useRouter._impl();
|
|
529
332
|
}
|
|
@@ -735,6 +538,353 @@
|
|
|
735
538
|
const RegularButton = JSX(({ className = '', href, rel, target, ariaLabel, version, rounded, onClick, children }) => (jsx("a", { className: getRegularButtonClasses({ className, version, rounded }), href: href, rel: rel, target: target, "aria-label": ariaLabel, role: href ? 'link' : 'button', onClick: onClick, children: children })));
|
|
736
539
|
const DisabledButton = JSX(({ className, ariaLabel, version, rounded, children }) => (jsx("div", { role: "button", "aria-disabled": "true", "aria-label": ariaLabel, tabIndex: -1, className: getDisabledButtonClasses({ className, rounded, version }), children: children })));
|
|
737
540
|
|
|
541
|
+
const renderButtonsSection = (buttons, { className = '', buttonClassName, isVertical } = {}) => buttons?.length && buttons.some((_) => _?.text || _?.icon?.icon) ? (jsx("div", { className: style('flex', isVertical ? 'flex-col gap-2 justify-items-stretch' : 'flex-wrap gap-4', className), children: buttons.map(renderButton(buttonClassName)) })) : null;
|
|
542
|
+
const renderButton = (buttonClassName = '') => (button, index) => {
|
|
543
|
+
const { text, icon, iconRight, version, ...rest } = button || {};
|
|
544
|
+
const iconVersionDefault = version === 'secondary' ? 'color' : 'white';
|
|
545
|
+
const iconVersion = icon?.iconVersion ? icon?.iconVersion : iconVersionDefault;
|
|
546
|
+
return text || icon?.icon ? (jsx(Button, { className: style('basis-full sm:basis-auto', buttonClassName), appendLeft: renderButtonIcon({ ...icon, iconVersion }), appendRight: renderButtonIcon({ ...iconRight, iconVersion }), version: version, text: text, ...rest }, index ? String(index) : '')) : null;
|
|
547
|
+
};
|
|
548
|
+
const DEFAULT_ICON_W = 24;
|
|
549
|
+
const renderButtonIcon = (icon) => icon?.icon || icon?.src ? (jsx(Img, { image: icon, width: String(icon?.size?.width || DEFAULT_ICON_W), height: String(DEFAULT_ICON_W) })) : null;
|
|
550
|
+
|
|
551
|
+
const ButtonsBlock = JSX(({ buttons, className, ...rest }) => (jsx(BlockWrapper, { className: style('!bg-transparent', className), ...rest, children: renderButtonsSection(buttons) })));
|
|
552
|
+
|
|
553
|
+
const identity = (_) => _;
|
|
554
|
+
|
|
555
|
+
const useForm = (initialState, onSubmit) => {
|
|
556
|
+
const [formState, setFormState] = useState(initialState);
|
|
557
|
+
const [isDirtyForm, setDirtyForm] = useState(false);
|
|
558
|
+
const [dirtyFieldsMap, setDirtyFieldsMap] = useState({});
|
|
559
|
+
const handlersMap = useRef({});
|
|
560
|
+
const field = useCallback((fieldName, options) => {
|
|
561
|
+
const { parse = identity, format = identity } = options || {};
|
|
562
|
+
if (!handlersMap.current) {
|
|
563
|
+
handlersMap.current = {};
|
|
564
|
+
}
|
|
565
|
+
handlersMap.current[fieldName] ||= (value) => {
|
|
566
|
+
setFormState((prev) => ({ ...prev, [fieldName]: parse(value) }));
|
|
567
|
+
setDirtyFieldsMap((prev) => ({ ...prev, [fieldName]: true }));
|
|
568
|
+
};
|
|
569
|
+
return {
|
|
570
|
+
value: format(formState[fieldName]),
|
|
571
|
+
isDirty: isDirtyForm || dirtyFieldsMap[fieldName],
|
|
572
|
+
onChange: handlersMap.current[fieldName],
|
|
573
|
+
};
|
|
574
|
+
}, [formState, isDirtyForm, dirtyFieldsMap]);
|
|
575
|
+
const reset = useCallback(() => {
|
|
576
|
+
setFormState(initialState);
|
|
577
|
+
setDirtyForm(false);
|
|
578
|
+
setDirtyFieldsMap({});
|
|
579
|
+
}, [initialState]);
|
|
580
|
+
const handleSubmit = useCallback((e) => {
|
|
581
|
+
e.preventDefault();
|
|
582
|
+
setDirtyForm(true);
|
|
583
|
+
onSubmit && onSubmit(formState);
|
|
584
|
+
}, [onSubmit, formState]);
|
|
585
|
+
return [
|
|
586
|
+
formState,
|
|
587
|
+
{
|
|
588
|
+
isDirty: isDirtyForm || Object.values(dirtyFieldsMap).some(Boolean),
|
|
589
|
+
field,
|
|
590
|
+
reset,
|
|
591
|
+
onSubmit: handleSubmit,
|
|
592
|
+
},
|
|
593
|
+
];
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
const useNormalizedInput = (props, { normalize, format }) => {
|
|
597
|
+
const { value, onFocus, onBlur, onChange } = props;
|
|
598
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
599
|
+
const handleFocus = useCallback((e) => {
|
|
600
|
+
setIsFocused(true);
|
|
601
|
+
onFocus && onFocus(e);
|
|
602
|
+
}, []);
|
|
603
|
+
const handleBlur = useCallback(() => {
|
|
604
|
+
setIsFocused(false);
|
|
605
|
+
onChange && onChange(normalize(value));
|
|
606
|
+
onBlur && onBlur();
|
|
607
|
+
}, [onChange, value]);
|
|
608
|
+
return {
|
|
609
|
+
value: (isFocused || !format ? value : format(value)),
|
|
610
|
+
onFocus: handleFocus,
|
|
611
|
+
onBlur: handleBlur,
|
|
612
|
+
};
|
|
613
|
+
};
|
|
614
|
+
|
|
615
|
+
const clamp = (value, min, max) => Math.max(min, Math.min(value, max));
|
|
616
|
+
|
|
617
|
+
const toLocalNumberFormat = (fractionDigits = 0) => (_ = 0) => new Intl.NumberFormat('ru-RU', {
|
|
618
|
+
minimumFractionDigits: 0,
|
|
619
|
+
maximumFractionDigits: fractionDigits,
|
|
620
|
+
}).format(Number(_) || 0);
|
|
621
|
+
|
|
622
|
+
const Text = JSX(({ children, ...style }) => (jsx("span", { className: ['font-sans', ...Object.values(style)].join(' '), children: children })));
|
|
623
|
+
|
|
624
|
+
const Input = JSX(({ key, className = '', inputClassName = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, }) => {
|
|
625
|
+
const handleChange = useCallback((e) => {
|
|
626
|
+
onChange && onChange(e.target?.value || '');
|
|
627
|
+
}, [onChange]);
|
|
628
|
+
const paddingStyle = children ? 'pr-8' : '';
|
|
629
|
+
const validStyle = valid
|
|
630
|
+
? 'border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'
|
|
631
|
+
: 'border-error';
|
|
632
|
+
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] }));
|
|
633
|
+
});
|
|
634
|
+
|
|
635
|
+
const NumberInput = JSX((props) => {
|
|
636
|
+
const { onChange, min, max, defaultValue = '0', fractionDigits = 0, ...inputProps } = props;
|
|
637
|
+
const normalizedProps = useNormalizedInput(props, {
|
|
638
|
+
normalize: (_ = defaultValue) => min && max ? String(clamp(Number(sanitizeNumberStr(_)), min, max)) : sanitizeNumberStr(_),
|
|
639
|
+
format: toLocalNumberFormat(fractionDigits),
|
|
640
|
+
});
|
|
641
|
+
const handleChange = useCallback((_) => onChange && onChange(sanitizeNumberStr(_)), [onChange]);
|
|
642
|
+
return jsx(Input, { onChange: handleChange, ...inputProps, ...normalizedProps });
|
|
643
|
+
});
|
|
644
|
+
const sanitizeNumberStr = (_ = '') => _.replaceAll(',', '.')
|
|
645
|
+
.replace(/[^\d.]/g, '')
|
|
646
|
+
.replace(/([^.]*\.[^.]*)\./, '$1');
|
|
647
|
+
|
|
648
|
+
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" }) }) })));
|
|
649
|
+
|
|
650
|
+
const mobileHeadingTagMap = {
|
|
651
|
+
h1: 'h1',
|
|
652
|
+
h2: 'h1',
|
|
653
|
+
h3: 'h2',
|
|
654
|
+
h4: 'h2',
|
|
655
|
+
h5: 'h3',
|
|
656
|
+
h6: 'h3',
|
|
657
|
+
};
|
|
658
|
+
const headingTag = (tag) => mobileHeadingTagMap[tag] || 'h3';
|
|
659
|
+
|
|
660
|
+
const styles = {
|
|
661
|
+
h0: 'text-h0',
|
|
662
|
+
h1: 'text-h1',
|
|
663
|
+
h2: 'text-h2',
|
|
664
|
+
h3: 'text-h3',
|
|
665
|
+
h4: 'text-h4',
|
|
666
|
+
h5: 'text-h5',
|
|
667
|
+
h6: 'text-h6', // 20
|
|
668
|
+
};
|
|
669
|
+
const Heading = JSX(({ className = '', headingType = 'h3', as = 'h3', title, children }) => {
|
|
670
|
+
const Tag = headingTag(as);
|
|
671
|
+
return (jsx(Tag, { className: `font-sans m-0 ${styles[headingType]} ${className}`, children: title || children }));
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
const DEFAULT_TITLE = 'Укажите сумму перевода';
|
|
675
|
+
const DEFAULT_LABEL = 'Сумма перевода';
|
|
676
|
+
const DEFAULT_PLACEHOLDER = '1500';
|
|
677
|
+
const FORM_URL = 'https://www.rshb.ru/p2p/';
|
|
678
|
+
const AMOUNT_KEY = 'amount';
|
|
679
|
+
const INITIAL_FORM_STATE = {
|
|
680
|
+
[AMOUNT_KEY]: 1500,
|
|
681
|
+
};
|
|
682
|
+
const CardTransfer = JSX(({ className = '', title = DEFAULT_TITLE, label = DEFAULT_LABEL, placeholder = DEFAULT_PLACEHOLDER, button, ...rest }) => {
|
|
683
|
+
const [{ amount }, { field }] = useForm(INITIAL_FORM_STATE);
|
|
684
|
+
const isDisabled = amount <= 0;
|
|
685
|
+
const buttonStyle = isDisabled
|
|
686
|
+
? getDisabledButtonClasses({ version: button?.version })
|
|
687
|
+
: getRegularButtonClasses({ className: 'text-white', version: button?.version });
|
|
688
|
+
const link = useLink();
|
|
689
|
+
return (jsxs(BlockWrapper, { className: style('p-default flex flex-col items-center', className), ...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] })] }));
|
|
690
|
+
});
|
|
691
|
+
|
|
692
|
+
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
693
|
+
|
|
694
|
+
const DEFAULT_ANCESTORS = [];
|
|
695
|
+
const defaultStyle = 'col-span-12';
|
|
696
|
+
function renderBlock(block, options, { className, ...extraProps } = {}) {
|
|
697
|
+
const { key, blockDecorator = defaultBlockDecorator, blocksRegistry = {}, ancestors = DEFAULT_ANCESTORS, } = options;
|
|
698
|
+
const { type } = block;
|
|
699
|
+
if (!(type && type in blocksRegistry)) {
|
|
700
|
+
console.warn(`No block with "${type}" is registered`);
|
|
701
|
+
}
|
|
702
|
+
const BlockComponent = type && blocksRegistry[type];
|
|
703
|
+
return blockDecorator({
|
|
704
|
+
blockClassName: style('scroll-mt-12', // TODO scroll-mt-12 ? here?
|
|
705
|
+
className, block.style || defaultStyle),
|
|
706
|
+
block,
|
|
707
|
+
ancestors,
|
|
708
|
+
// Adjusted by decorator block and blockClassName
|
|
709
|
+
render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
|
|
710
|
+
const { content } = adjustedBlock;
|
|
711
|
+
return BlockComponent ? (jsx(BlockComponent, { className: adjustedBlockClassName, block: block, options: options, ...content, ...extraProps }, key)) : null;
|
|
712
|
+
},
|
|
713
|
+
}, key);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
const DEFAULT_SLOT_NAME = null;
|
|
717
|
+
|
|
718
|
+
const EMPTY_ANCESTORS = [];
|
|
719
|
+
const renderBlocksList = (blocks, { key, ancestors = EMPTY_ANCESTORS, slotName = DEFAULT_SLOT_NAME, renderProps = renderBlock, ...options }) => (blocks || []).map((_, j) => renderProps(_, {
|
|
720
|
+
...options,
|
|
721
|
+
key: `${key ? key : _.type}-${j}`,
|
|
722
|
+
ancestors: options.parent
|
|
723
|
+
? [...(ancestors || EMPTY_ANCESTORS), [options.parent, slotName]]
|
|
724
|
+
: ancestors,
|
|
725
|
+
}));
|
|
726
|
+
|
|
727
|
+
function renderChildren({ children, block, options, renderProps, }) {
|
|
728
|
+
if (children) {
|
|
729
|
+
return children;
|
|
730
|
+
}
|
|
731
|
+
return block && options
|
|
732
|
+
? renderBlocksList(block.blocks, { ...options, parent: block, renderProps })
|
|
733
|
+
: null;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
const mapChildren = (mapper) => (children) => {
|
|
737
|
+
if (children === null || children === undefined) {
|
|
738
|
+
return children;
|
|
739
|
+
}
|
|
740
|
+
return Array.isArray(children) ? children.map(mapper) : mapper(children, 0);
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
const HEADER_HEIGHT = 170;
|
|
744
|
+
const FOOTER_HEIGHT = 48;
|
|
745
|
+
const BLOCKS_GAP = 4;
|
|
746
|
+
const PAGE_PADDINGS_X = 20;
|
|
747
|
+
const DEFAULT_HEIGHT = 866;
|
|
748
|
+
const getContainerHeight = (minHeight) => ({
|
|
749
|
+
height: `calc(100vh - ${HEADER_HEIGHT + FOOTER_HEIGHT + BLOCKS_GAP + PAGE_PADDINGS_X}px)`,
|
|
750
|
+
minHeight: `${minHeight || DEFAULT_HEIGHT}px`,
|
|
751
|
+
});
|
|
752
|
+
|
|
753
|
+
const SwipeListItem = JSX(({ className = '', style, idx, activeIndex, observerOptions, children, onIntersection }) => {
|
|
754
|
+
const observerCallback = useCallback((entries) => {
|
|
755
|
+
if (entries.length && onIntersection) {
|
|
756
|
+
onIntersection(idx || 0, entries[entries.length - 1]);
|
|
757
|
+
}
|
|
758
|
+
}, [onIntersection, idx]);
|
|
759
|
+
const ref = useIntersectionObserver(observerCallback, observerOptions);
|
|
760
|
+
return (jsx("div", { className: `inline-block snap-always box-border ${className}`, style: style, "aria-current": Boolean(idx === activeIndex), ref: ref, children: children }));
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
|
|
764
|
+
const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', minHeight, children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
|
|
765
|
+
const observerOptions = {
|
|
766
|
+
sensitivity: 1,
|
|
767
|
+
rootRef: containerRef,
|
|
768
|
+
};
|
|
769
|
+
const itemsVisibilityListRef = useRef([]);
|
|
770
|
+
const handleIntersection = useCallback((idx, entry) => {
|
|
771
|
+
const itemsVisibilityList = [...(itemsVisibilityListRef.current || [])];
|
|
772
|
+
itemsVisibilityList[idx] = entry;
|
|
773
|
+
itemsVisibilityListRef.current = itemsVisibilityList;
|
|
774
|
+
onVisibleItemsChange && onVisibleItemsChange(itemsVisibilityList);
|
|
775
|
+
onVisibleIndicesChange && onVisibleIndicesChange(getVisibleIndices(itemsVisibilityList));
|
|
776
|
+
}, [onVisibleItemsChange, onVisibleIndicesChange]);
|
|
777
|
+
const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
|
|
778
|
+
const isVerticalList = listType === 'vertical-list';
|
|
779
|
+
const isHorizontalList = listType === 'horizontal-list';
|
|
780
|
+
const containerStyle = {
|
|
781
|
+
...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
|
|
782
|
+
...(isVerticalList ? getContainerHeight(minHeight) : {}),
|
|
783
|
+
gap: `${gap}px`,
|
|
784
|
+
};
|
|
785
|
+
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) }));
|
|
786
|
+
});
|
|
787
|
+
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
788
|
+
const getContainerOffset = (padding, additionalPadding = 0) => ({
|
|
789
|
+
marginLeft: `${-padding}px`,
|
|
790
|
+
marginRight: `${-padding}px`,
|
|
791
|
+
paddingLeft: `${padding}px`,
|
|
792
|
+
paddingRight: `${padding + additionalPadding}px`,
|
|
793
|
+
});
|
|
794
|
+
const getVisibleIndices = (itemsVisibilityList) => itemsVisibilityList
|
|
795
|
+
.map((_, i) => [_, i])
|
|
796
|
+
.filter(([_]) => _ && _.intersectionRatio >= 0.9)
|
|
797
|
+
.map(([, i]) => i);
|
|
798
|
+
|
|
799
|
+
const containerStyles = {
|
|
800
|
+
'horizontal-list': 'mx-auto mt-5 w-fit',
|
|
801
|
+
'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
|
|
802
|
+
};
|
|
803
|
+
const activeDotStyles = {
|
|
804
|
+
'horizontal-list': 'w-6',
|
|
805
|
+
'vertical-list': 'h-6',
|
|
806
|
+
};
|
|
807
|
+
const dotStyle = 'cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white';
|
|
808
|
+
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
809
|
+
const SwipeListControlDots = JSX(({ containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list', version }) => {
|
|
810
|
+
const handleClick = (idx) => {
|
|
811
|
+
if (idx !== activeIndex && containerRef?.current) {
|
|
812
|
+
containerRef.current.children[idx]?.scrollIntoView({
|
|
813
|
+
behavior: 'smooth',
|
|
814
|
+
block: 'nearest',
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
};
|
|
818
|
+
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;
|
|
819
|
+
});
|
|
820
|
+
|
|
821
|
+
const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
|
|
822
|
+
|
|
823
|
+
const defaultDiscriminator = (_) => _;
|
|
824
|
+
const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
|
|
825
|
+
|
|
826
|
+
const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
|
|
827
|
+
|
|
828
|
+
const getItemWidth = (container) => (itemCount) => container.scrollWidth / itemCount;
|
|
829
|
+
const scrollBy = (container) => (itemCount, delta) => {
|
|
830
|
+
container.scrollBy({ left: delta * getItemWidth(container)(itemCount), behavior: 'smooth' });
|
|
831
|
+
};
|
|
832
|
+
|
|
833
|
+
const scrollToEnd = (container) => {
|
|
834
|
+
container.scrollTo({ left: container.scrollWidth, behavior: 'smooth' });
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
const scrollToStart = (container) => {
|
|
838
|
+
container.scrollTo({ left: 0, behavior: 'smooth' });
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
const useSwipeListScroll = ({ itemCount, isCyclic, onVisibleIndicesChange, }) => {
|
|
842
|
+
const containerRef = useRef(null);
|
|
843
|
+
const [visibleIndices, setVisibleIndices] = useState([]);
|
|
844
|
+
const handleVisibleIndicesChange = useCallback((indices) => {
|
|
845
|
+
setVisibleIndices((prevIndices) => areArraysEqual(prevIndices, indices) ? prevIndices : indices);
|
|
846
|
+
onVisibleIndicesChange && onVisibleIndicesChange(indices);
|
|
847
|
+
}, [itemCount]);
|
|
848
|
+
const [minIndex, maxIndex] = visibleIndices.length
|
|
849
|
+
? [minBy()(visibleIndices), maxBy()(visibleIndices)]
|
|
850
|
+
: [-1, -1];
|
|
851
|
+
const canScrollLeft = minIndex > 0;
|
|
852
|
+
const canScrollRight = maxIndex < itemCount - 1;
|
|
853
|
+
const scrollLeft = useCallback(() => {
|
|
854
|
+
if (!containerRef.current) {
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
if (isCyclic && !canScrollLeft) {
|
|
858
|
+
scrollToEnd(containerRef.current);
|
|
859
|
+
}
|
|
860
|
+
else {
|
|
861
|
+
scrollBy(containerRef.current)(itemCount, -1);
|
|
862
|
+
}
|
|
863
|
+
}, [isCyclic, itemCount, canScrollLeft]);
|
|
864
|
+
const scrollRight = useCallback(() => {
|
|
865
|
+
if (!containerRef.current) {
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
if (isCyclic && !canScrollRight) {
|
|
869
|
+
scrollToStart(containerRef.current);
|
|
870
|
+
}
|
|
871
|
+
else {
|
|
872
|
+
scrollBy(containerRef.current)(itemCount, 1);
|
|
873
|
+
}
|
|
874
|
+
}, [itemCount, isCyclic, canScrollRight]);
|
|
875
|
+
return [
|
|
876
|
+
containerRef,
|
|
877
|
+
{
|
|
878
|
+
scrollLeft,
|
|
879
|
+
scrollRight,
|
|
880
|
+
canScrollLeft: isCyclic || canScrollLeft,
|
|
881
|
+
canScrollRight: isCyclic || canScrollRight,
|
|
882
|
+
visibleIndicesRange: [minIndex, maxIndex],
|
|
883
|
+
handleVisibleIndicesChange,
|
|
884
|
+
},
|
|
885
|
+
];
|
|
886
|
+
};
|
|
887
|
+
|
|
738
888
|
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
|
|
739
889
|
? 'bg-secondary-light text-secondary-text'
|
|
740
890
|
: 'bg-white text-primary-text hover:text-primary-main'} ${className || ''}`, disabled: disabled, ...rest, children: jsx(Img, { className: "w-4 h-4 min-w-4 min-h-4 rounded-full box-border", image: { icon: 'ArrowLeftIcon', iconVersion: 'black' }, imageClassName: "group-hover/btn:text-primary-main", width: "16", height: "16" }) })));
|
|
@@ -817,6 +967,11 @@
|
|
|
817
967
|
return (jsx(Tag, { className: style('block', className), ...(href ? linkProps : {}), children: children }));
|
|
818
968
|
});
|
|
819
969
|
|
|
970
|
+
const CarouselProgramsCard = JSX(({ className = '', title, icon, list = [], href, target, ...rest }) => {
|
|
971
|
+
return (jsx(BlockWrapper, { className: style('border border-gray', className), ...rest, children: jsxs(LinkWrapper, { className: "flex", href: href, target: target, children: [jsxs("div", { className: "w-[200px] min-w-[200px] self-center", children: [icon?.icon ? jsx(Img, { image: icon }) : null, icon?.src ? jsx(Img, { image: icon }) : null] }), jsxs("div", { className: "p-8 pl-3 w-full", children: [title ? jsx(Heading, { className: "mb-3.5", headingType: "h5", title: title }) : null, list.length ? (jsx("div", { className: "flex flex-col gap-3", children: list?.map(renderList$1) })) : null] })] }) }));
|
|
972
|
+
});
|
|
973
|
+
const renderList$1 = (_, i) => (jsxs("div", { className: "break-words", children: [_.title ? jsx("div", { className: "text-h6", children: _.title }) : null, _.description ? jsx("span", { className: "text-l-light mt-1", children: _.description }) : null] }, String(i)));
|
|
974
|
+
|
|
820
975
|
const DOT_SIZE_MAP = {
|
|
821
976
|
L: 'w-1.5 h-1.5 mr-4',
|
|
822
977
|
M: 'w-1.5 h-1.5 mr-3',
|
|
@@ -886,52 +1041,38 @@
|
|
|
886
1041
|
|
|
887
1042
|
const SocialMedia = JSX(({ className = '', media }) => (jsx("div", { className: `flex gap-2 items-start justify-start ${className}`, children: media?.map((_, index) => (jsx(MediaButton, { ..._ }, String(index)))) })));
|
|
888
1043
|
|
|
889
|
-
const HeadingClass = {
|
|
890
|
-
h0: 'text-m-title',
|
|
891
|
-
h1: 'text-m-title',
|
|
892
|
-
h2: 'text-m-title',
|
|
893
|
-
h3: 'text-h6',
|
|
894
|
-
h4: 'text-m-title-xs',
|
|
895
|
-
h5: 'text-m-title-xs',
|
|
896
|
-
h6: 'text-m-title-xs',
|
|
897
|
-
};
|
|
898
|
-
const Heading = JSX((props) => {
|
|
899
|
-
const { className, headingType = 'h3', title, as: Tag = 'h3' } = props;
|
|
900
|
-
return (jsx(Tag, { className: `font-sans font-medium m-0 ${HeadingClass[headingType]} ${className || ''}`, children: title }));
|
|
901
|
-
});
|
|
902
|
-
|
|
903
1044
|
const Paragraph = JSX(({ children, ...style }) => (jsx("p", { className: ['font-sans', ...Object.values(style)].join(' '), children: children })));
|
|
904
1045
|
|
|
905
1046
|
const headlineVersionStyles = {
|
|
906
1047
|
XXL: {
|
|
907
1048
|
title: { headingType: 'h0', as: 'h1' },
|
|
908
1049
|
descriptionSize: 'text-h5',
|
|
909
|
-
descriptionStyle: 'mt-
|
|
1050
|
+
descriptionStyle: 'mt-headline-xxl',
|
|
910
1051
|
},
|
|
911
1052
|
XL: {
|
|
912
1053
|
title: { headingType: 'h1', as: 'h1' },
|
|
913
1054
|
descriptionSize: 'text-xl-light',
|
|
914
|
-
descriptionStyle: 'mt-
|
|
1055
|
+
descriptionStyle: 'mt-headline-l',
|
|
915
1056
|
},
|
|
916
1057
|
L: {
|
|
917
1058
|
title: { headingType: 'h2', as: 'h2' },
|
|
918
1059
|
descriptionSize: 'text-xl-light',
|
|
919
|
-
descriptionStyle: 'mt-
|
|
1060
|
+
descriptionStyle: 'mt-headline-l',
|
|
920
1061
|
},
|
|
921
1062
|
M: {
|
|
922
1063
|
title: { headingType: 'h3', as: 'h3' },
|
|
923
1064
|
descriptionSize: 'text-xl-light',
|
|
924
|
-
descriptionStyle: 'mt-
|
|
1065
|
+
descriptionStyle: 'mt-headline-m',
|
|
925
1066
|
},
|
|
926
1067
|
S: {
|
|
927
1068
|
title: { headingType: 'h4', as: 'h4' },
|
|
928
1069
|
descriptionSize: 'text-xl-light',
|
|
929
|
-
descriptionStyle: 'mt-
|
|
1070
|
+
descriptionStyle: 'mt-headline-s',
|
|
930
1071
|
},
|
|
931
1072
|
XS: {
|
|
932
1073
|
title: { headingType: 'h5', as: 'h5' },
|
|
933
1074
|
descriptionSize: 'text-l-light',
|
|
934
|
-
descriptionStyle: 'mt-
|
|
1075
|
+
descriptionStyle: 'mt-headline-s',
|
|
935
1076
|
},
|
|
936
1077
|
};
|
|
937
1078
|
|
|
@@ -968,22 +1109,10 @@
|
|
|
968
1109
|
: '';
|
|
969
1110
|
}
|
|
970
1111
|
}, [isUnfolded, children?.length]);
|
|
971
|
-
return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} ${className}`, children: children }));
|
|
972
|
-
});
|
|
973
|
-
|
|
974
|
-
const getPaddingStyle = (isHighlighting = false) => isHighlighting ? 'p-default mt-6' : 'mt-6 p-default'; // Хак для мобильной версии т.к. контракт должен быть идентичный
|
|
975
|
-
|
|
976
|
-
const renderButtonsSection = (buttons, { className = '', buttonClassName, isVertical } = {}) => buttons?.length && buttons.some((_) => _?.text || _?.icon?.icon) ? (jsx("div", { className: style('flex', isVertical ? 'flex-col gap-2' : 'flex-wrap gap-4', className), children: buttons.map(renderButton(buttonClassName)) })) : null;
|
|
977
|
-
const renderButton = (buttonClassName = '') => (button, index) => {
|
|
978
|
-
const { text, icon, iconRight, version, ...rest } = button || {};
|
|
979
|
-
const iconVersionDefault = version === 'secondary' ? 'color' : 'white';
|
|
980
|
-
const iconVersion = icon?.iconVersion ? icon?.iconVersion : iconVersionDefault;
|
|
981
|
-
return text || icon?.icon ? (jsx(Button, { className: buttonClassName, appendLeft: renderButtonIcon({ ...icon, iconVersion }), appendRight: renderButtonIcon({ ...iconRight, iconVersion }), version: version, text: text, ...rest }, index ? String(index) : '')) : null;
|
|
982
|
-
};
|
|
983
|
-
const DEFAULT_ICON_W = 24;
|
|
984
|
-
const renderButtonIcon = (icon) => icon?.icon || icon?.src ? (jsx(Img, { image: icon, width: String(icon?.size?.width || DEFAULT_ICON_W), height: String(DEFAULT_ICON_W) })) : null;
|
|
1112
|
+
return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} ${className}`, children: children }));
|
|
1113
|
+
});
|
|
985
1114
|
|
|
986
|
-
const
|
|
1115
|
+
const getPaddingStyle = (isHighlighting = false) => isHighlighting ? 'p-default mt-6' : 'mt-6 p-default'; // Хак для мобильной версии т.к. контракт должен быть идентичный
|
|
987
1116
|
|
|
988
1117
|
const descriptionSize = 'text-l';
|
|
989
1118
|
|
|
@@ -1123,15 +1252,6 @@
|
|
|
1123
1252
|
}
|
|
1124
1253
|
}
|
|
1125
1254
|
|
|
1126
|
-
async function fetchJSON(url, options) {
|
|
1127
|
-
try {
|
|
1128
|
-
return url ? await fetchJSONUnsafe(url, options) : null;
|
|
1129
|
-
}
|
|
1130
|
-
catch (err) {
|
|
1131
|
-
console.error(err);
|
|
1132
|
-
}
|
|
1133
|
-
return null;
|
|
1134
|
-
}
|
|
1135
1255
|
async function fetchJSONUnsafe(url, options) {
|
|
1136
1256
|
const response = await fetch(url, {
|
|
1137
1257
|
...options,
|
|
@@ -1173,45 +1293,54 @@
|
|
|
1173
1293
|
secondary: 'bg-white/30',
|
|
1174
1294
|
'secondary-light': 'bg-secondary-light',
|
|
1175
1295
|
};
|
|
1176
|
-
const RoundedIcon = JSX(({ iconBgVersion = 'primary',
|
|
1296
|
+
const RoundedIcon = JSX(({ iconBgVersion = 'primary', size, icon, ...rest }) => {
|
|
1297
|
+
const width = String(size?.width || 24);
|
|
1298
|
+
const height = String(size?.height || 24);
|
|
1299
|
+
return icon ? (jsx("div", { className: style('rounded-icon p-2.5 mr-3', iconBgStyles[iconBgVersion]), children: jsx(Icon, { ...rest, width: width, height: height, name: icon }) })) : null;
|
|
1300
|
+
});
|
|
1301
|
+
|
|
1302
|
+
const renderRoundedIcon = (icon, iconBgVersion) => (jsx(RoundedIcon, { ...icon, iconBgVersion: iconBgVersion }));
|
|
1177
1303
|
|
|
1178
1304
|
const foldableSectionStyles = 'flex flex-wrap group-last:last:pb-0';
|
|
1179
1305
|
|
|
1180
1306
|
const getIconName = (isUnfolded) => isUnfolded ? 'ArrowUpSolidIcon' : 'ArrowDownSolidIcon';
|
|
1181
1307
|
|
|
1182
|
-
const labelSize = 'text-l';
|
|
1308
|
+
const labelSize$1 = 'text-l';
|
|
1183
1309
|
|
|
1184
1310
|
const rollupIconVersion = 'normal';
|
|
1185
1311
|
|
|
1186
1312
|
const rollupItemStyles = '';
|
|
1187
1313
|
|
|
1188
|
-
const RollupItem = JSX(({ className = '', label = 'Развернуть', labelIcon, isExpanded, isFoldButtonOnTop = true, version = 'primary', ...rest }) => {
|
|
1189
|
-
return (jsx(BlockWrapper, { className: style('w-full', rollupItemStyles, className), tag: "div", version: "transparent", ...rest, children: jsx(Foldable, { isFoldButtonOnTop: isFoldButtonOnTop, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { className: style('gap-5 [&>*]:p-0', foldableSectionStyles), isUnfolded: isUnfolded, children: renderChildren(rest) })), renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({
|
|
1314
|
+
const RollupItem = JSX(({ className = '', label = 'Развернуть', labelIcon, labelIconBgVersion, isExpanded, isFoldButtonOnTop = true, version = 'primary', ...rest }) => {
|
|
1315
|
+
return (jsx(BlockWrapper, { className: style('w-full', rollupItemStyles, className), tag: "div", version: "transparent", ...rest, children: jsx(Foldable, { isFoldButtonOnTop: isFoldButtonOnTop, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { className: style('gap-5 [&>*]:p-0', foldableSectionStyles), isUnfolded: isUnfolded, children: renderChildren(rest) })), renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({
|
|
1316
|
+
version,
|
|
1317
|
+
label,
|
|
1318
|
+
labelIcon,
|
|
1319
|
+
labelIconBgVersion,
|
|
1320
|
+
isUnfolded,
|
|
1321
|
+
onToggle,
|
|
1322
|
+
}) }) }));
|
|
1190
1323
|
});
|
|
1191
1324
|
RollupItem.childrenTypes = {
|
|
1192
1325
|
exclude: ['RollupItem'],
|
|
1193
1326
|
};
|
|
1194
|
-
const renderFoldButton = ({ version, label: defaultLabel, labelIcon, isUnfolded, onToggle, }) => {
|
|
1327
|
+
const renderFoldButton = ({ version, label: defaultLabel, labelIcon, labelIconBgVersion, isUnfolded, onToggle, }) => {
|
|
1195
1328
|
const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
|
|
1196
1329
|
return version === 'primary' ? (renderPrimaryFoldButton({
|
|
1197
1330
|
label,
|
|
1198
1331
|
labelIcon,
|
|
1332
|
+
labelIconBgVersion,
|
|
1199
1333
|
icon: getIconName(isUnfolded),
|
|
1200
1334
|
onToggle,
|
|
1201
1335
|
})) : (jsx(DefaultFoldButton, { label: label, icon: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', onClick: onToggle }));
|
|
1202
1336
|
};
|
|
1203
|
-
const renderPrimaryFoldButton = ({ label, icon, onToggle, labelIcon }) => {
|
|
1204
|
-
|
|
1205
|
-
const iconHeight = String(labelIcon?.size?.height || 24);
|
|
1206
|
-
const iconName = labelIcon?.icon;
|
|
1207
|
-
return (jsxs("button", { className: style('border-none bg-transparent px-0 flex justify-between items-center w-full cursor-pointer group/button', iconName ? 'py-2' : 'py-5'), onClick: onToggle, children: [jsxs("div", { className: "flex items-center group-hover/button:text-primary-main", children: [iconName ? (jsx(RoundedIcon, { name: iconName, width: iconWidth, height: iconHeight, iconVersion: labelIcon?.iconVersion })) : null, label ? (jsx(Text, { size: labelSize, font: "font-normal", children: label })) : null] }), icon ? jsx(Icon, { name: icon, iconVersion: rollupIconVersion, width: "24", height: "24" }) : null] }));
|
|
1337
|
+
const renderPrimaryFoldButton = ({ label, labelIconBgVersion, icon, onToggle, labelIcon, }) => {
|
|
1338
|
+
return (jsxs("button", { className: style('border-none bg-transparent px-0 flex justify-between items-center w-full cursor-pointer group/button', labelIcon?.icon ? 'py-2' : 'py-5'), onClick: onToggle, children: [jsxs("div", { className: "flex items-center group-hover/button:text-primary-main", children: [renderRoundedIcon(labelIcon, labelIconBgVersion), label ? (jsx(Text, { size: labelSize$1, font: "font-normal", children: label })) : null] }), icon ? jsx(Icon, { name: icon, iconVersion: rollupIconVersion, width: "24", height: "24" }) : null] }));
|
|
1208
1339
|
};
|
|
1209
1340
|
|
|
1210
|
-
const Contacts = JSX(({ className = '', items, hasButton }) => (jsxs("div", { className: className, children: [items?.length ? items.map(
|
|
1211
|
-
const
|
|
1212
|
-
|
|
1213
|
-
return (jsxs("div", { className: "mb-4", children: [jsx("div", { children: renderText(type, text) }), jsx("div", { className: "mt-1 text-s-light text-secondary-text", children: description })] }, String(index)));
|
|
1214
|
-
};
|
|
1341
|
+
const Contacts = JSX(({ className = '', items, hasButton }) => (jsxs("div", { className: className, children: [items?.length ? items.map(renderContactsGroup) : null, hasButton ? (jsx(Button, { version: "primary", className: "mb-6 w-full", href: "https://www.rshb.ru/feedback/question/", target: "_blank", ariaLabel: "\u041E\u0431\u0440\u0430\u0442\u043D\u0430\u044F \u0441\u0432\u044F\u0437\u044C", text: "\u041E\u0431\u0440\u0430\u0442\u043D\u0430\u044F \u0441\u0432\u044F\u0437\u044C" })) : null] })));
|
|
1342
|
+
const renderContactsGroup = (item, i) => (jsxs("div", { className: "mb-6", children: [jsx("div", { className: "mb-4", children: jsx(Text, { size: "text-l", font: "font-medium", children: item?.title }) }), jsx("div", { children: item.items?.map(renderContact) })] }, String(i)));
|
|
1343
|
+
const renderContact = (item, index) => (jsxs("div", { className: "mb-4", children: [jsx("div", { children: renderText(item.type, item.text) }), jsx("div", { className: "mt-1 text-s-light text-secondary-text", children: item.description })] }, String(index)));
|
|
1215
1344
|
const renderText = (type, text = '') => {
|
|
1216
1345
|
switch (type) {
|
|
1217
1346
|
case 'tel':
|
|
@@ -1251,371 +1380,6 @@
|
|
|
1251
1380
|
return (jsxs(BlockWrapper, { tag: "footer", className: style('px-4 py-6', className), ...rest, children: [jsx("div", { className: "mb-4 pb-5 border-b border-main-divider", children: sitemap.topItems?.map((item, i) => (jsx(RollupItem, { label: item?.text, labelIcon: item?.icon, children: jsx(LinkList, { items: item.items, className: "my-3" }) }, String(i)))) }), jsx(Contacts, { className: "overflow-hidden", items: contacts }), jsx(SocialMedia, { className: "mb-4", media: socialMedia }), jsx(Button, { className: "w-full mb-4", text: "Google Play", version: "secondary", href: "/", target: "_blank" }), jsx(HorizontalNavigation, { className: "pt-4 pb-7 border-y border-main-divider", title: horizontalNavigationTitle, links: relatedEnterprises }), jsx(TextInformation, {})] }));
|
|
1252
1381
|
});
|
|
1253
1382
|
|
|
1254
|
-
const isHrefActive = (router) => ({ href }) => withoutQuery(isURL(href) ? router.href : router.pathname).startsWith(withoutQuery(href));
|
|
1255
|
-
|
|
1256
|
-
const findActiveSubItem = (router) => (items = []) => {
|
|
1257
|
-
const possibleActiveSubItems = items?.filter(isHrefActive(router));
|
|
1258
|
-
return possibleActiveSubItems?.length
|
|
1259
|
-
? maxBy((_) => _.href?.length || 0)(possibleActiveSubItems) // More specific item with max length
|
|
1260
|
-
: undefined;
|
|
1261
|
-
};
|
|
1262
|
-
|
|
1263
|
-
const isTopItemActive = (router) => isHrefActive(projectSettings.BASE_PATH ? { pathname: projectSettings.BASE_PATH } : router);
|
|
1264
|
-
|
|
1265
|
-
const HeaderItem = JSX(({ className = '', active, dataItemName, children, ...rest }) => {
|
|
1266
|
-
const link = useLink();
|
|
1267
|
-
const { href, target, text, onClick } = link(rest);
|
|
1268
|
-
return (jsxs("a", { className: style('relative inline-block bg-transparent text-center no-underline', className), href: href, target: target, "data-item-name": dataItemName, onClick: onClick, children: [jsx("span", { className: getTextStyle(active), children: text || children }), active ? (jsx("div", { className: "absolute left-0 -bottom-3 w-full h-0.5 bg-primary-main group-data-transparent:bg-transparent" })) : null] }));
|
|
1269
|
-
});
|
|
1270
|
-
const getTextStyle = (active = false) => style('font-sans text-s', active ? 'text-primary-main' : 'text-secondary-text hover:text-primary-main', 'group-data-transparent:text-white group-data-transparent:hover:text-primary-hover');
|
|
1271
|
-
|
|
1272
|
-
const STORAGE_DEFAULT_TTL = 86400000; // 24 * 60 * 60 * 1000
|
|
1273
|
-
function useCachedAsyncData(key, fetcher, storage = globalThis?.localStorage) {
|
|
1274
|
-
const cachedFetcher = useCallback(async (...args) => {
|
|
1275
|
-
const storageKey = `async:${key}`;
|
|
1276
|
-
const storageData = storage.getItem(storageKey);
|
|
1277
|
-
const cachedData = getParsedData(storageData);
|
|
1278
|
-
if (cachedData) {
|
|
1279
|
-
return cachedData;
|
|
1280
|
-
}
|
|
1281
|
-
const data = await fetcher(...args);
|
|
1282
|
-
storage.setItem(storageKey, JSON.stringify({ data, timestamp: Date.now() }));
|
|
1283
|
-
return data;
|
|
1284
|
-
}, [key, fetcher]);
|
|
1285
|
-
return useAsyncData(key, cachedFetcher);
|
|
1286
|
-
}
|
|
1287
|
-
function getParsedData(storageData) {
|
|
1288
|
-
const { data = null, timestamp = null } = storageData ? JSON.parse(storageData) : {};
|
|
1289
|
-
return data && Date.now() - timestamp < STORAGE_DEFAULT_TTL ? data : undefined;
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
const REGION_URL = '/api/v1/region';
|
|
1293
|
-
function useLocation(defaultLocation = 'Москва') {
|
|
1294
|
-
const currentLocation = getLocalStorageLocation();
|
|
1295
|
-
const [location, setLocation] = useState(currentLocation?.region ?? { name: defaultLocation });
|
|
1296
|
-
const { data } = useCachedAsyncData(REGION_URL, fetchJSONUnsafe);
|
|
1297
|
-
useEffect(() => {
|
|
1298
|
-
setLocation(currentLocation?.region && currentLocation?.manual
|
|
1299
|
-
? currentLocation.region
|
|
1300
|
-
: data || { name: defaultLocation });
|
|
1301
|
-
}, [data]);
|
|
1302
|
-
const onChangeLocation = useCallback((region) => {
|
|
1303
|
-
globalThis.localStorage?.setItem('location', JSON.stringify({ manual: true, region }));
|
|
1304
|
-
setLocation(region);
|
|
1305
|
-
}, []);
|
|
1306
|
-
return [location, onChangeLocation];
|
|
1307
|
-
}
|
|
1308
|
-
const getLocalStorageLocation = () => {
|
|
1309
|
-
const localStorageLocation = globalThis.localStorage?.getItem('location');
|
|
1310
|
-
try {
|
|
1311
|
-
return localStorageLocation ? JSON.parse(localStorageLocation) : null;
|
|
1312
|
-
}
|
|
1313
|
-
catch (_) {
|
|
1314
|
-
return null;
|
|
1315
|
-
}
|
|
1316
|
-
};
|
|
1317
|
-
|
|
1318
|
-
const CloseButton = JSX(({ className, onClick }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-1 bg-transparent border-none', className), onClick: onClick, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", children: jsx(Img, { image: { icon: 'CloseIcon' }, width: "24", height: "24" }) })));
|
|
1319
|
-
|
|
1320
|
-
function assertUnreachable(x) {
|
|
1321
|
-
throw new Error(x);
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
function useDialogHandlers({ onOpen, onClose } = {}) {
|
|
1325
|
-
useEffect(() => defaultEventBus.subscribe('dialog', (action) => {
|
|
1326
|
-
switch (action.type) {
|
|
1327
|
-
case 'open':
|
|
1328
|
-
onOpen && onOpen(action);
|
|
1329
|
-
break;
|
|
1330
|
-
case 'close':
|
|
1331
|
-
onClose && onClose();
|
|
1332
|
-
break;
|
|
1333
|
-
default:
|
|
1334
|
-
assertUnreachable(action);
|
|
1335
|
-
}
|
|
1336
|
-
}), [onOpen, onClose]);
|
|
1337
|
-
}
|
|
1338
|
-
|
|
1339
|
-
const useDebouncedEffect = (effect, deps, delay = 300) => useEffect(() => {
|
|
1340
|
-
const timerId = setTimeout(effect, delay);
|
|
1341
|
-
return () => {
|
|
1342
|
-
clearTimeout(timerId);
|
|
1343
|
-
};
|
|
1344
|
-
}, deps);
|
|
1345
|
-
|
|
1346
|
-
const compareBy = (indexOf) => (a, b) => indexOf(a) - indexOf(b);
|
|
1347
|
-
const desc = (cmp) => (a, b) => -cmp(a, b);
|
|
1348
|
-
|
|
1349
|
-
function zip(firstCol, ...restCols) {
|
|
1350
|
-
return firstCol.map((firstEl, rowIndex) => [firstEl, ...restCols.map((col) => col[rowIndex])]);
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
const JARO_WINKLER_P = 0.1;
|
|
1354
|
-
const JARO_WINKLER_MAX_L = 4;
|
|
1355
|
-
const jaroWinklerDistance = (s1) => (s2) => {
|
|
1356
|
-
if (s1 === s2) {
|
|
1357
|
-
return 1;
|
|
1358
|
-
}
|
|
1359
|
-
if (!s1 || !s2) {
|
|
1360
|
-
return 0;
|
|
1361
|
-
}
|
|
1362
|
-
const { m, s1Matches, s2Matches } = computeM(s1, s2);
|
|
1363
|
-
if (m === 0) {
|
|
1364
|
-
return 0;
|
|
1365
|
-
}
|
|
1366
|
-
const t = computeT(s1, s2, { s1Matches, s2Matches });
|
|
1367
|
-
const jaroWeight = (m / s1.length + m / s2.length + (m - t / 2) / m) / 3;
|
|
1368
|
-
const winklerWeight = jaroWeight > 0.7 ? computePrefixL(s1, s2) * JARO_WINKLER_P : 0;
|
|
1369
|
-
return jaroWeight + winklerWeight * (1 - jaroWeight);
|
|
1370
|
-
};
|
|
1371
|
-
function computeM(s1, s2) {
|
|
1372
|
-
const range = Math.max(0, Math.floor(Math.max(s1.length, s2.length) / 2) - 1);
|
|
1373
|
-
const s1Matches = new Array(s1.length);
|
|
1374
|
-
const s2Matches = new Array(s2.length);
|
|
1375
|
-
let m = 0;
|
|
1376
|
-
for (let i = 0; i < s1.length; i++) {
|
|
1377
|
-
const low = Math.max(0, i - range);
|
|
1378
|
-
const high = Math.min(i + range, s2.length - 1);
|
|
1379
|
-
for (let j = low; j <= high; j++) {
|
|
1380
|
-
if (s1Matches[i] || s2Matches[j] || s1[i] !== s2[j]) {
|
|
1381
|
-
continue;
|
|
1382
|
-
}
|
|
1383
|
-
m++;
|
|
1384
|
-
s1Matches[i] = true;
|
|
1385
|
-
s2Matches[j] = true;
|
|
1386
|
-
}
|
|
1387
|
-
}
|
|
1388
|
-
return { m, s1Matches, s2Matches };
|
|
1389
|
-
}
|
|
1390
|
-
function computeT(s1, s2, { s1Matches, s2Matches }) {
|
|
1391
|
-
let t = 0;
|
|
1392
|
-
for (let i = 0, k = 0; i < s1.length; i++) {
|
|
1393
|
-
if (!s1Matches[i]) {
|
|
1394
|
-
continue;
|
|
1395
|
-
}
|
|
1396
|
-
let j = k;
|
|
1397
|
-
for (; j < s2.length; j++) {
|
|
1398
|
-
if (s2Matches[j]) {
|
|
1399
|
-
k = j + 1;
|
|
1400
|
-
break;
|
|
1401
|
-
}
|
|
1402
|
-
}
|
|
1403
|
-
if (s1[i] !== s2[j]) {
|
|
1404
|
-
t++;
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1407
|
-
return t;
|
|
1408
|
-
}
|
|
1409
|
-
function computePrefixL(s1, s2) {
|
|
1410
|
-
let prefixL = 0;
|
|
1411
|
-
while (s1[prefixL] === s2[prefixL] && prefixL < JARO_WINKLER_MAX_L) {
|
|
1412
|
-
prefixL++;
|
|
1413
|
-
}
|
|
1414
|
-
return prefixL;
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
const joinMaps = (aggregate, emptyVal) => (acc, map) => {
|
|
1418
|
-
for (const [key, b] of map) {
|
|
1419
|
-
acc.set(key, aggregate(acc.get(key) || emptyVal, b));
|
|
1420
|
-
}
|
|
1421
|
-
return acc;
|
|
1422
|
-
};
|
|
1423
|
-
|
|
1424
|
-
const sum = (list = []) => list.reduce((a, b) => a + b, 0);
|
|
1425
|
-
|
|
1426
|
-
const MIN_TERM_LEN = 3;
|
|
1427
|
-
const tokenize = (text) => text
|
|
1428
|
-
.toLowerCase()
|
|
1429
|
-
.split(/[^0-9a-zа-я-]+/)
|
|
1430
|
-
.filter((token) => token.length >= MIN_TERM_LEN && !/[0-9a-z]/.test(token));
|
|
1431
|
-
|
|
1432
|
-
const textRank = (queryTokens) => (text) => {
|
|
1433
|
-
const textTokens = tokenize(text || '');
|
|
1434
|
-
return textTokens.length
|
|
1435
|
-
? sum(queryTokens.map((qToken) => max(textTokens.map(jaroWinklerDistance(qToken)))))
|
|
1436
|
-
: 0;
|
|
1437
|
-
};
|
|
1438
|
-
|
|
1439
|
-
const JW_THRESHOLD = 0.8;
|
|
1440
|
-
const RANK_EPS = 0.001;
|
|
1441
|
-
const search = (query) => (searchIndex) => {
|
|
1442
|
-
const { corpus, dictionary } = searchIndex || {};
|
|
1443
|
-
if (!query || !corpus?.length || !dictionary || !Object.keys(dictionary).length) {
|
|
1444
|
-
return [];
|
|
1445
|
-
}
|
|
1446
|
-
const queryTokens = tokenize(query);
|
|
1447
|
-
if (!queryTokens.length) {
|
|
1448
|
-
return [];
|
|
1449
|
-
}
|
|
1450
|
-
const dictEntries = Object.entries(dictionary);
|
|
1451
|
-
const pagesRanking = queryTokens
|
|
1452
|
-
.map(computePagesRankingPerToken(dictEntries))
|
|
1453
|
-
.reduce(joinMaps((a, b) => a + b, 0), new Map());
|
|
1454
|
-
const relevantPages = [...pagesRanking.entries()]
|
|
1455
|
-
.filter(([, pageRank]) => pageRank >= (JW_THRESHOLD - RANK_EPS) * queryTokens.length) // Multiplication of query tokens
|
|
1456
|
-
.map(([pageIndex]) => corpus[pageIndex]);
|
|
1457
|
-
return sortResultsByRank(queryTokens)(relevantPages);
|
|
1458
|
-
};
|
|
1459
|
-
const computePagesRankingPerToken = (dictEntries) => (qToken) => dictEntries
|
|
1460
|
-
.map(([stem, pageIndices]) => [jaroWinklerDistance(qToken)(stem), pageIndices])
|
|
1461
|
-
.filter(([stemRank]) => stemRank >= JW_THRESHOLD)
|
|
1462
|
-
.map(([stemRank, pageIndices]) => fillMapWith(pageIndices, stemRank))
|
|
1463
|
-
.reduce(joinMaps(Math.max, 0), new Map());
|
|
1464
|
-
const sortResultsByRank = (queryTokens) => (results) => zip(results, results.map(({ title }) => title).map(textRank(queryTokens)))
|
|
1465
|
-
.sort(desc(compareBy(([, pageTitleRank]) => pageTitleRank)))
|
|
1466
|
-
.map(([corpusItem]) => corpusItem);
|
|
1467
|
-
const fillMapWith = (keys, value) => new Map(keys.map((_) => [_, value]));
|
|
1468
|
-
|
|
1469
|
-
const SEARCH_INDEX_FILENAME = 'search.index.json';
|
|
1470
|
-
const DEFAULT_BASE_PATH = ['/'];
|
|
1471
|
-
const useSearch = ({ basePathList = DEFAULT_BASE_PATH, initialQuery = '', wasOpened, }) => {
|
|
1472
|
-
const [query, setQuery] = useState(initialQuery || '');
|
|
1473
|
-
useEffect(() => {
|
|
1474
|
-
if (initialQuery !== undefined && initialQuery !== null) {
|
|
1475
|
-
setQuery(initialQuery);
|
|
1476
|
-
}
|
|
1477
|
-
}, [initialQuery]);
|
|
1478
|
-
const key = useMemo(() => basePathList.map((_) => (wasOpened ? _ : null)), // Load search index on very first search
|
|
1479
|
-
[wasOpened, basePathList]);
|
|
1480
|
-
const { data } = useAsyncData(key, fetchSearchIndex);
|
|
1481
|
-
const [result, setResult] = useState(null);
|
|
1482
|
-
useDebouncedEffect(() => {
|
|
1483
|
-
if (data) {
|
|
1484
|
-
setResult(data.map(search(query)));
|
|
1485
|
-
}
|
|
1486
|
-
}, [data, query]);
|
|
1487
|
-
return [result, { value: query, onChange: setQuery }];
|
|
1488
|
-
};
|
|
1489
|
-
const fetchSearchIndex = async (...basePathList) => (await Promise.allSettled(basePathList.map((basePath) => fetchJSON(joinPath(basePath, '/', SEARCH_INDEX_FILENAME))))).map((_) => (_.status === 'fulfilled' ? _.value : {}));
|
|
1490
|
-
|
|
1491
|
-
const Dialog = JSX(({ className, isOpened, head, children, onClose }) => {
|
|
1492
|
-
useEffect(() => {
|
|
1493
|
-
const handleEscape = ({ key }) => {
|
|
1494
|
-
if (key === 'Escape') {
|
|
1495
|
-
onClose && onClose();
|
|
1496
|
-
}
|
|
1497
|
-
};
|
|
1498
|
-
globalThis.document?.addEventListener('keydown', handleEscape);
|
|
1499
|
-
return () => {
|
|
1500
|
-
globalThis.document?.removeEventListener('keydown', handleEscape);
|
|
1501
|
-
};
|
|
1502
|
-
}, [onClose]);
|
|
1503
|
-
return isOpened ? (jsx("div", { className: style('fixed inset-0 bg-white text-l-light z-50 overflow-x-hidden overflow-y-scroll no-scrollbar', className), role: "dialog", children: jsxs("div", { className: "relative container pb-12 min-h-full", children: [jsxs("div", { className: "sticky bg-white pt-6 top-0", children: [jsx(CloseButton, { className: "absolute top-10 -right-12", onClick: onClose }), head] }), children] }) })) : null;
|
|
1504
|
-
});
|
|
1505
|
-
|
|
1506
|
-
function useBool(defaultValue = false) {
|
|
1507
|
-
const [value, setValue] = useState(defaultValue);
|
|
1508
|
-
const setTrue = useCallback(() => setValue(true), []);
|
|
1509
|
-
const setFalse = useCallback(() => setValue(false), []);
|
|
1510
|
-
const toggle = useCallback(() => setValue((_) => !_), []);
|
|
1511
|
-
return [value, { setValue, setTrue, setFalse, toggle }];
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
function useDialogProps(id, initOpen = false) {
|
|
1515
|
-
const [isOpened, { setTrue: open, setFalse: close }] = useBool(initOpen);
|
|
1516
|
-
const [params, setParams] = useState({ id });
|
|
1517
|
-
const wasOpened = useRef(isOpened);
|
|
1518
|
-
wasOpened.current ||= isOpened;
|
|
1519
|
-
const handleOpen = useCallback((_) => {
|
|
1520
|
-
if (_.id === id) {
|
|
1521
|
-
setParams(_);
|
|
1522
|
-
open();
|
|
1523
|
-
}
|
|
1524
|
-
else {
|
|
1525
|
-
close();
|
|
1526
|
-
}
|
|
1527
|
-
}, [id]);
|
|
1528
|
-
useDialogHandlers({
|
|
1529
|
-
onOpen: handleOpen,
|
|
1530
|
-
onClose: close,
|
|
1531
|
-
});
|
|
1532
|
-
const handleCloseAsEventSource = useCallback(() => {
|
|
1533
|
-
close();
|
|
1534
|
-
defaultEventBus.fire('dialog', { type: 'close' });
|
|
1535
|
-
}, []);
|
|
1536
|
-
return {
|
|
1537
|
-
...params,
|
|
1538
|
-
isOpened,
|
|
1539
|
-
wasOpened: wasOpened.current,
|
|
1540
|
-
onClose: handleCloseAsEventSource,
|
|
1541
|
-
};
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
const Sitemap = JSX(({ className, topItems }) => {
|
|
1545
|
-
const link = useLink({ isRemote: true });
|
|
1546
|
-
return (jsx("div", { className: style('flex items-start justify-between', className), children: topItems?.map(link).map(renderColumn) }));
|
|
1547
|
-
});
|
|
1548
|
-
const renderColumn = (menuItem, index) => {
|
|
1549
|
-
const { text, items, href, target, onClick } = menuItem;
|
|
1550
|
-
return (jsxs("div", { className: "flex flex-col gap-3.5 w-1/4", children: [jsx("a", { className: "leading-5 text-l text-primary-text hover:text-primary-main no-underline", href: href, target: target || '_self', onClick: onClick, children: text || `Раздел ${index}` }), items?.map((_, i) => (jsx(ColumnItem, { ..._, basePath: appendSlash(href), index: i }, String(i))))] }, String(index)));
|
|
1551
|
-
};
|
|
1552
|
-
const ColumnItem = JSX(({ text, index, basePath, ...rest }) => {
|
|
1553
|
-
const isAnotherPortal = projectSettings.BASE_PATH && basePath ? !projectSettings.BASE_PATH.startsWith(basePath) : false;
|
|
1554
|
-
const link = useLink({ isRemote: isAnotherPortal, basePath });
|
|
1555
|
-
const { href, target, onClick } = link(rest);
|
|
1556
|
-
return (jsx("a", { className: style('text-l-light text-secondary-text hover:text-primary-main no-underline', 'overflow-x-hidden overflow-ellipsis whitespace-nowrap'), href: href, target: target || '_self', onClick: onClick, children: text || `Раздел ${index}` }));
|
|
1557
|
-
});
|
|
1558
|
-
|
|
1559
|
-
const SearchInput = JSX(({ className, value, autoFocus, onChange, onFocus }) => {
|
|
1560
|
-
const handleChange = useCallback((ev) => {
|
|
1561
|
-
onChange && onChange(ev.target?.value || '');
|
|
1562
|
-
}, [onChange]);
|
|
1563
|
-
return (jsxs("div", { className: style('font-sans relative', className), role: "form", children: [jsx("div", { className: "absolute h-full flex items-center pl-4 pointer-events-none", children: jsx(Img, { image: { icon: 'LoupeIcon' }, width: "24", height: "24" }) }), jsx("input", { className: style('h-12 pl-12 w-full text-l text-black outline-none box-border', 'border border-solid rounded-md border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'), value: value, type: "text", name: "search-bar-input", placeholder: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u0430\u0439\u0442\u0443", autoFocus: autoFocus, onChange: handleChange, onFocus: onFocus })] }));
|
|
1564
|
-
});
|
|
1565
|
-
|
|
1566
|
-
const SEARCH_DIALOG_ID = 'search';
|
|
1567
|
-
JSX(({ topItems }) => {
|
|
1568
|
-
const dialogProps = useDialogProps(SEARCH_DIALOG_ID);
|
|
1569
|
-
const basePathList = useMemo(() => topItems?.map((_) => _.href || '/'), [topItems]);
|
|
1570
|
-
const [searchResult, searchInputProps] = useSearch({
|
|
1571
|
-
basePathList,
|
|
1572
|
-
initialQuery: dialogProps.message,
|
|
1573
|
-
wasOpened: dialogProps.wasOpened,
|
|
1574
|
-
});
|
|
1575
|
-
const searchItems = useMemo(() => combineTopItemsAndSearchResult(topItems)(searchResult), [topItems, searchResult]);
|
|
1576
|
-
useEffect(() => printSearchItems(searchItems), [searchItems]); // Temp
|
|
1577
|
-
return (jsx(Dialog, { ...dialogProps, head: jsx(SearchInput, { className: "my-5", autoFocus: true, ...searchInputProps }), children: jsx(Sitemap, { topItems: searchItems }) }));
|
|
1578
|
-
});
|
|
1579
|
-
const combineTopItemsAndSearchResult = (topItems) => (searchResult) => topItems?.length && searchResult?.length
|
|
1580
|
-
? zip(topItems, searchResult).map(([_, portalSearchResult]) => ({
|
|
1581
|
-
..._,
|
|
1582
|
-
items: portalSearchResult?.map(({ title, uri }) => ({ text: title, href: joinPath('/', uri) })),
|
|
1583
|
-
}))
|
|
1584
|
-
: [];
|
|
1585
|
-
// Temp
|
|
1586
|
-
function printSearchItems(topItems) {
|
|
1587
|
-
for (const _ of topItems.filter(({ items }) => items?.length)) {
|
|
1588
|
-
console.group(_.text);
|
|
1589
|
-
console.table(_.items, ['text', 'href']);
|
|
1590
|
-
console.groupEnd();
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
const MIN_QUERY_LEN = 3;
|
|
1595
|
-
const SearchBar = JSX(({ className }) => {
|
|
1596
|
-
const [value, setValue] = useState('');
|
|
1597
|
-
const resetQueryOnDialogClose = useCallback(() => setValue(''), []);
|
|
1598
|
-
useDialogHandlers({ onClose: resetQueryOnDialogClose });
|
|
1599
|
-
const { open } = useDialog(SEARCH_DIALOG_ID);
|
|
1600
|
-
const handleInitialInputChange = useCallback((_) => {
|
|
1601
|
-
setValue(_);
|
|
1602
|
-
if (isQueryLongEnough(_)) {
|
|
1603
|
-
open(_);
|
|
1604
|
-
}
|
|
1605
|
-
}, []);
|
|
1606
|
-
return (jsxs("div", { className: className, children: [jsx(SearchInput, { value: value, onChange: handleInitialInputChange }), jsx(CloseButton, { className: "absolute top-2 right-3 sm:hidden", onClick: resetQueryOnDialogClose })] }));
|
|
1607
|
-
});
|
|
1608
|
-
const isQueryLongEnough = (_) => _ && _.length >= MIN_QUERY_LEN;
|
|
1609
|
-
|
|
1610
|
-
const HeaderBurger = JSX(({ burgerSubMenu, onClick, defaultLocation = '', children }) => {
|
|
1611
|
-
const [location] = useLocation(defaultLocation);
|
|
1612
|
-
return (jsxs("div", { className: "absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20", children: [jsx("button", { className: "absolute top-4 right-4 border-none bg-transparent cursor-pointer", onClick: onClick, children: jsx(Img, { image: { icon: 'CloseIcon' }, width: "24", height: "24" }) }), jsxs("button", { className: "flex items-center text-s p-0 mb-4 bg-transparent cursor-pointer", children: [jsx(Img, { image: { icon: 'GeolocationIcon' }, width: "20", height: "20", className: "text-primary-main box-border mr-2" }), jsx(Text, { color: "text-secondary-text", children: location.name })] }), children, jsx("div", { className: "mb-7", children: burgerSubMenu?.map(renderBurgerSubMenuItem) }), jsx(SearchBar, { className: "grow" })] }));
|
|
1613
|
-
});
|
|
1614
|
-
const renderBurgerSubMenuItem = (menu, i) => {
|
|
1615
|
-
const { icon, href, text } = menu;
|
|
1616
|
-
return (jsxs("a", { href: href, className: "flex text-s mb-4 hover:text-primary-main", children: [icon ? jsx(Img, { className: "text-primary-main pr-1", image: icon, width: "24", height: "24" }) : null, jsx("span", { className: "font-medium pl-0.5", children: text })] }, `headerSubMenu-${i}`));
|
|
1617
|
-
};
|
|
1618
|
-
|
|
1619
1383
|
const ICON_VERSION_MAP = {
|
|
1620
1384
|
'bg-white': 'color',
|
|
1621
1385
|
transparent: 'white',
|
|
@@ -1643,22 +1407,27 @@
|
|
|
1643
1407
|
return (jsxs("a", { className: `inline-flex items-center font-sans no-underline ${className}`, href: href || 'https://rshb.ru/', target: targetBlank ? '_blank' : '_self', "aria-label": logo?.title || 'Россельхозбанк', children: [renderImage$1(bgColor, logo?.image, { width: '34', height: '34' }), showTitle ? renderTitle(children || logo?.title, bgColor, 'text-s') : null] }));
|
|
1644
1408
|
});
|
|
1645
1409
|
|
|
1646
|
-
const
|
|
1410
|
+
const BUTTON_STYLE = {
|
|
1411
|
+
default: 'px-5 bg-main-divider rounded hover:text-primary-main',
|
|
1412
|
+
transparent: 'text-white hover:text-primary-hover',
|
|
1413
|
+
};
|
|
1414
|
+
const HeaderTop = JSX(({ bgColor, logo, internetBankUrl, version, mobileHeaderType, mobileTitle, mobileBackwardButtonTitle, }) => {
|
|
1415
|
+
const isTypeNone = mobileHeaderType === 'none';
|
|
1416
|
+
const isTypeWithTitle = mobileHeaderType === 'withTitle';
|
|
1417
|
+
return (jsxs("div", { className: "flex items-center justify-between w-full", children: [isTypeNone || isTypeWithTitle ? (jsx(Logo, { bgColor: bgColor, logo: logo, showTitle: isTypeNone })) : null, isTypeWithTitle ? mobileTitle : null, mobileHeaderType === 'backwardButton' ? (jsxs(Button, { className: "flex items-center text-l", children: [jsx(Img, { className: "w-6 h-6", image: {
|
|
1418
|
+
icon: 'ChevronLeft',
|
|
1419
|
+
iconVersion: 'black',
|
|
1420
|
+
} }), mobileBackwardButtonTitle] })) : null, internetBankUrl ? (jsx(Button, { href: internetBankUrl, ariaLabel: "\u0412\u043E\u0439\u0442\u0438", target: "_blank", className: style('p-3 my-1 text-s whitespace-nowrap text-primary-main hover:text-primary-hover', BUTTON_STYLE[version === 'transparent' ? 'transparent' : 'default']), children: "\u0412\u043E\u0439\u0442\u0438" })) : null] }));
|
|
1421
|
+
});
|
|
1647
1422
|
|
|
1648
1423
|
const BG_COLOR_TO_BLOCK_VERSION = {
|
|
1649
1424
|
'bg-white': 'primary',
|
|
1650
1425
|
transparent: 'transparent',
|
|
1651
1426
|
};
|
|
1652
|
-
const Header = JSX(({ bgColor = 'bg-white', version = BG_COLOR_TO_BLOCK_VERSION[bgColor], ...rest }) => {
|
|
1653
|
-
const router = useRouter();
|
|
1427
|
+
const Header = JSX(({ bgColor = 'bg-white', version = BG_COLOR_TO_BLOCK_VERSION[bgColor], mobileHeaderType = 'none', ...rest }) => {
|
|
1654
1428
|
const fallback = rest.options?.page?.fallback;
|
|
1655
|
-
const {
|
|
1656
|
-
|
|
1657
|
-
const subItems = activeTopItem?.items;
|
|
1658
|
-
const activeSubItem = findActiveSubItem(router)(subItems);
|
|
1659
|
-
const [burgerMenuShow, setBurgerMenuShow] = useState(false);
|
|
1660
|
-
const handleBurgerMenuShow = useCallback(() => setBurgerMenuShow((_) => !_), []);
|
|
1661
|
-
return (jsxs(BlockWrapper, { tag: "header", version: version, ...rest, children: [jsxs("div", { className: "container px-4 py-0 box-border", children: [jsx(HeaderTop, { onClick: handleBurgerMenuShow, bgColor: bgColor, logo: logo }), jsx("nav", { className: "flex items-center m-0 p-0 overflow-y-hidden w-full h-12", children: jsx("div", { className: "flex no-scrollbar horizontal-list h-full items-center", children: subItems?.map((_, i) => (jsx(HeaderItem, { className: "mr-8 whitespace-nowrap text-s", active: _ === activeSubItem, ..._ }, String(i)))) }) })] }), burgerMenuShow ? (jsx(HeaderBurger, { onClick: handleBurgerMenuShow, burgerSubMenu: dispositions, defaultLocation: defaultLocation, children: jsx("div", { className: "list-none m-0 p-0", children: topItems?.map((item, i) => (jsx(RollupItem, { label: item.text, children: jsx(LinkList, { className: "mt-2.5", items: item.items }) }, String(i)))) }) })) : null] }));
|
|
1429
|
+
const { logo, internetBankUrl } = useSWRResource(projectSettings.SITEMAP || 'sitemap', fallback);
|
|
1430
|
+
return (jsx(BlockWrapper, { tag: "header", version: version, ...rest, children: jsx("div", { className: "container px-4 py-1 box-border", children: jsx(HeaderTop, { bgColor: bgColor, logo: logo, internetBankUrl: internetBankUrl, version: version, mobileHeaderType: mobileHeaderType, ...rest }) }) }));
|
|
1662
1431
|
});
|
|
1663
1432
|
|
|
1664
1433
|
const ImgBlock = JSX((props) => {
|
|
@@ -1690,6 +1459,64 @@
|
|
|
1690
1459
|
return (jsx("div", { className: style('col-span-12 rounded-md cursor-pointer p-4 bg-secondary-light font-sans', className), children: href ? (jsxs("div", { className: "flex", children: [jsx("div", { className: "flex justify-center align-middle rounded-md bg-primary-main w-12 h-12", children: jsx(Logo, { className: "w-8", bgColor: "transparent", showTitle: true }) }), jsxs("a", { href: href, target: "_blank", className: "flex flex-col justify-center pl-3", children: [jsx("div", { className: "text-s font-medium mb-[3px]", children: title }), jsx("div", { className: "text-s text-secondary-text", children: description })] })] })) : null }));
|
|
1691
1460
|
});
|
|
1692
1461
|
|
|
1462
|
+
const labelSize = 'text-l';
|
|
1463
|
+
|
|
1464
|
+
const BenefitItem = JSX((props) => {
|
|
1465
|
+
const { className = '', icon, label, description, benefitsVersion = 'normal' } = props;
|
|
1466
|
+
const listItemAlign = description ? 'items-start' : 'items-center';
|
|
1467
|
+
return (jsxs("div", { className: `flex gap-5 ${listItemAlign} ${className}`, children: [icon ? (jsx("div", { className: getBenefitIconBgStyle(benefitsVersion), children: jsx(Img, { className: "w-6 h-6", image: { ...icon, iconVersion: icon.iconVersion || benefitsVersion } }) })) : null, jsxs("div", { className: "gap-0.5", children: [label ? (jsx(Text, { color: "text-primary-text group-data-secondary:text-white", size: labelSize, children: label })) : null, description ? (jsx(Paragraph, { font: "font-light", size: "text-m", color: "text-secondary-text group-data-secondary:text-white", children: description })) : null] })] }));
|
|
1468
|
+
});
|
|
1469
|
+
function getBenefitIconBgStyle(benefitsVersion) {
|
|
1470
|
+
const bgColorStyle = benefitsVersion === 'normal'
|
|
1471
|
+
? 'bg-secondary-light text-primary-main'
|
|
1472
|
+
: 'bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black';
|
|
1473
|
+
return style('w-12 h-12 min-w-12 p-2.5 box-border flex items-center justify-center rounded-icon', bgColorStyle);
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
const RichText = JSX((props) => {
|
|
1477
|
+
const { __html = '', richVersion = '' } = props;
|
|
1478
|
+
return (jsx("div", { className: style(richVersion, 'md-container'), dangerouslySetInnerHTML: { __html } }));
|
|
1479
|
+
});
|
|
1480
|
+
|
|
1481
|
+
function assertUnreachable(x) {
|
|
1482
|
+
throw new Error(x);
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
// TODO: Create universal function for this case
|
|
1486
|
+
const renderBenefit$1 =
|
|
1487
|
+
// Linter doesn't understand that switch processes all cases
|
|
1488
|
+
// eslint-disable-next-line consistent-return
|
|
1489
|
+
(version) => (benefit, i) => {
|
|
1490
|
+
const { type } = benefit;
|
|
1491
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
1492
|
+
return null;
|
|
1493
|
+
}
|
|
1494
|
+
switch (type) {
|
|
1495
|
+
case 'default':
|
|
1496
|
+
return (jsx(BenefitItem, { icon: benefit.icon, label: benefit.label, description: benefit.description, version: version }, String(i)));
|
|
1497
|
+
case 'rte':
|
|
1498
|
+
return jsx(RichText, { __html: benefit.__html });
|
|
1499
|
+
default:
|
|
1500
|
+
assertUnreachable(benefit);
|
|
1501
|
+
}
|
|
1502
|
+
};
|
|
1503
|
+
|
|
1504
|
+
const positionStyle = 'justify-end flex-col-reverse gap-4';
|
|
1505
|
+
|
|
1506
|
+
const styleInsuranceSum = 'flex-col gap-2';
|
|
1507
|
+
|
|
1508
|
+
const styleValueBlock = 'flex-col gap-1';
|
|
1509
|
+
const styleValueBlockText = '';
|
|
1510
|
+
|
|
1511
|
+
const renderInsuranceSumMonth = (sum = 0, monthLimit = 0) => sum || monthLimit ? (jsxs("div", { className: style('flex mt-6', styleInsuranceSum), children: [sum > 0 ? renderValueBlock('Страховая сумма:', sum, Boolean(monthLimit)) : null, monthLimit > 0 ? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(sum)) : null] })) : null;
|
|
1512
|
+
const renderValueBlock = (title, sum = 0, isAnotherBlock = false) => {
|
|
1513
|
+
const widthStyle = isAnotherBlock ? 'w-fit' : 'w-full';
|
|
1514
|
+
return (jsxs("div", { className: style(`flex w-full whitespace-pre`, styleValueBlock, widthStyle), children: [jsx(Text, { font: "font-light", size: "text-l", children: title }), jsxs(Text, { size: "text-h6", color: styleValueBlockText, children: [toLocalNumberFormat(2)(sum), " \u20BD"] })] }));
|
|
1515
|
+
};
|
|
1516
|
+
|
|
1517
|
+
const PictureText = JSX(({ className = '', title, description, image, benefits, sum, monthLimit, directionRight = false, version = 'primary', ...rest }) => (jsxs(BlockWrapper, { className: style('relative p-default', className), version: version, ...rest, children: [jsx(Headline, { className: "!p-0", title: title, description: description, headlineVersion: "M" // TODO: Сверить с макетом после влития мобильных правок Headline (DRAFT)
|
|
1518
|
+
, align: "text-left" }), jsxs("div", { className: style('flex mt-6', positionStyle), children: [image?.src ? jsx(Img, { className: directionRight ? 'order-2' : '', image: image }) : null, jsxs("div", { children: [benefits?.length ? (jsx("div", { className: "flex flex-col gap-4", children: benefits.map(renderBenefit$1(version)) })) : null, renderInsuranceSumMonth(Number(sum), Number(monthLimit))] })] })] })));
|
|
1519
|
+
|
|
1693
1520
|
const getColSpan = (className) => {
|
|
1694
1521
|
const colSpanPrefix = 'col-span-';
|
|
1695
1522
|
const colSpanStr = className?.split(/\s+/).find((_) => _.startsWith(colSpanPrefix));
|
|
@@ -1745,24 +1572,8 @@
|
|
|
1745
1572
|
const renderShimmerItem = (width, index) => (jsx("div", { style: { width: `${width || 100}%` }, className: "h-4 mt-2 bg-secondary-light" }, String(index)));
|
|
1746
1573
|
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
1747
1574
|
|
|
1748
|
-
const
|
|
1749
|
-
|
|
1750
|
-
return (jsx("div", { className: style(richVersion, 'md-container'), dangerouslySetInnerHTML: { __html } }));
|
|
1751
|
-
});
|
|
1752
|
-
|
|
1753
|
-
const BaseTile = JSX(({ className, title = '', insetTitle = '', buttons, leftImage, rightImage, backImage, children, }) => (jsxs("div", { className: style('relative flex flex-col font-sans', className), children: [backImage ? jsx("div", { className: "absolute bottom-0 right-0 z-0", children: backImage }) : null, title, jsxs("div", { className: "grow relative flex flex-wrap md:flex-nowrap justify-between items-stretch gap-8", children: [leftImage, jsxs("div", { className: style('flex flex-col gap-8', leftImage ? '' : 'grow'), children: [insetTitle, jsx("div", { className: "grow", children: children }), buttons] }), rightImage ? jsx("div", { className: "-order-1 lg:order-1", children: rightImage }) : null] })] })));
|
|
1754
|
-
|
|
1755
|
-
const BenefitItem = JSX(({ className, icon, label, description, version = 'primary', benefitsVersion = 'normal' }) => (jsxs("div", { className: style('flex gap-5', description ? 'items-start' : 'items-center', className), children: [icon ? (jsx("div", { className: getBenefitIconBgStyle(version, benefitsVersion), children: jsx(Img, { className: "w-6 h-6", image: { ...icon, iconVersion: icon.iconVersion || benefitsVersion } }) })) : null, jsxs("div", { children: [label ? (jsx(Text, { size: "text-h6", color: "text-primary-text group-data-secondary:text-white", children: label })) : null, description ? (jsx(Paragraph, { size: "text-m-light", color: "text-secondary-text group-data-secondary:text-white", children: description })) : null] })] })));
|
|
1756
|
-
function getBenefitIconBgStyle(version, benefitsVersion) {
|
|
1757
|
-
let bgColorStyle = 'bg-primary-main text-black';
|
|
1758
|
-
if (version === 'secondary') {
|
|
1759
|
-
bgColorStyle = 'bg-white/30 text-black';
|
|
1760
|
-
}
|
|
1761
|
-
else if (benefitsVersion === 'normal') {
|
|
1762
|
-
bgColorStyle = 'bg-secondary-light text-primary-main';
|
|
1763
|
-
}
|
|
1764
|
-
return `w-12 h-12 min-w-12 rounded-full p-2.5 box-border flex items-center justify-center ${bgColorStyle}`;
|
|
1765
|
-
}
|
|
1575
|
+
const BaseTile = JSX(({ className, title = '', insetTitle = '', buttons, leftImage, rightImage, backImage, children, }) => (jsxs("div", { className: style('relative flex flex-col font-sans', className), children: [backImage ? jsx("div", { className: "absolute bottom-0 right-0 z-0", children: backImage }) : null, title, jsxs("div", { className: "grow relative flex flex-wrap sm:flex-nowrap justify-between items-stretch gap-8", children: [renderImageContainer(leftImage), jsxs("div", { className: style('flex flex-col gap-8', leftImage ? '' : 'grow'), children: [insetTitle, jsx("div", { className: "grow", children: children }), buttons] }), renderImageContainer(rightImage, { className: '-order-1 sm:order-1' })] })] })));
|
|
1576
|
+
const renderImageContainer = (image, { className } = {}) => image ? jsx("div", { className: style('flex-none', className), children: image }) : null;
|
|
1766
1577
|
|
|
1767
1578
|
const renderBenefit = (version = 'primary', benefitsVersion = 'normal') => (props, i) => jsx(BenefitItem, { version: version, benefitsVersion: benefitsVersion, ...props }, String(i));
|
|
1768
1579
|
|
|
@@ -1786,6 +1597,12 @@
|
|
|
1786
1597
|
? renderBackwardButton(backwardButton, !rest.version || rest.version === 'primary' ? 'primary' : 'white')
|
|
1787
1598
|
: null, jsx(ProductBlockInner, { className: "grow", ...rest })] })));
|
|
1788
1599
|
|
|
1600
|
+
const ProductGallery = JSX(({ className = '', slides = [], ...rest }) => {
|
|
1601
|
+
const galleryBlocks = slides.map((s) => s.productBlock);
|
|
1602
|
+
return (jsx(BlockWrapper, { className: `box-border py-6 overflow-hidden relative w-100 mb-6 ${className}`, ...rest, children: jsx(SwipeListControl, { gap: 0, padding: 0, children: galleryBlocks.map((_, i) => renderProductBlock({ ..._, ...rest }, i)) }) }));
|
|
1603
|
+
});
|
|
1604
|
+
const renderProductBlock = (block, i) => (jsx(ProductBlockInner, { className: "z-10 px-5 group-data-secondary:text-white", ...block }, String(i)));
|
|
1605
|
+
|
|
1789
1606
|
const RichTextBlock = JSX((props) => {
|
|
1790
1607
|
const { __html, richVersion, ...rest } = props;
|
|
1791
1608
|
return (jsx(BlockWrapper, { ...rest, children: jsx(RichText, { __html: __html, richVersion: richVersion }) }));
|
|
@@ -1925,6 +1742,8 @@
|
|
|
1925
1742
|
VerticalLayout.childrenTypes = [];
|
|
1926
1743
|
|
|
1927
1744
|
const Blocks = {
|
|
1745
|
+
ButtonsBlock,
|
|
1746
|
+
CardTransfer,
|
|
1928
1747
|
Carousel,
|
|
1929
1748
|
CarouselTariffsCard,
|
|
1930
1749
|
ComparisonTable,
|
|
@@ -1934,6 +1753,7 @@
|
|
|
1934
1753
|
ImgBlock,
|
|
1935
1754
|
LinkDocs,
|
|
1936
1755
|
MobileAppTile,
|
|
1756
|
+
PictureText,
|
|
1937
1757
|
Placeholder,
|
|
1938
1758
|
ProductBlock,
|
|
1939
1759
|
StepsBlock,
|
|
@@ -1943,8 +1763,18 @@
|
|
|
1943
1763
|
RollupItem,
|
|
1944
1764
|
VerticalLayout,
|
|
1945
1765
|
CarouselRecommendationCard,
|
|
1766
|
+
CarouselProgramsCard,
|
|
1767
|
+
ProductGallery,
|
|
1946
1768
|
};
|
|
1947
1769
|
|
|
1770
|
+
function useBool(defaultValue = false) {
|
|
1771
|
+
const [value, setValue] = useState(defaultValue);
|
|
1772
|
+
const setTrue = useCallback(() => setValue(true), []);
|
|
1773
|
+
const setFalse = useCallback(() => setValue(false), []);
|
|
1774
|
+
const toggle = useCallback(() => setValue((_) => !_), []);
|
|
1775
|
+
return [value, { setValue, setTrue, setFalse, toggle }];
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1948
1778
|
const debounce = (fn, delay = 600) => {
|
|
1949
1779
|
let timerId;
|
|
1950
1780
|
const debouncedCallback = (...args) => {
|
|
@@ -2000,6 +1830,53 @@
|
|
|
2000
1830
|
}, [scrollTarget]);
|
|
2001
1831
|
}
|
|
2002
1832
|
|
|
1833
|
+
const CloseButton = JSX(({ className, onClick }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-1 bg-transparent border-none', className), onClick: onClick, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", children: jsx(Img, { image: { icon: 'CloseIcon' }, width: "24", height: "24" }) })));
|
|
1834
|
+
|
|
1835
|
+
function useDialogHandlers({ onOpen, onClose } = {}) {
|
|
1836
|
+
useEffect(() => defaultEventBus.subscribe('dialog', (action) => {
|
|
1837
|
+
switch (action.type) {
|
|
1838
|
+
case 'open':
|
|
1839
|
+
onOpen && onOpen(action);
|
|
1840
|
+
break;
|
|
1841
|
+
case 'close':
|
|
1842
|
+
onClose && onClose();
|
|
1843
|
+
break;
|
|
1844
|
+
default:
|
|
1845
|
+
assertUnreachable(action);
|
|
1846
|
+
}
|
|
1847
|
+
}), [onOpen, onClose]);
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
function useDialogProps(id, initOpen = false) {
|
|
1851
|
+
const [isOpened, { setTrue: open, setFalse: close }] = useBool(initOpen);
|
|
1852
|
+
const [params, setParams] = useState({ id });
|
|
1853
|
+
const wasOpened = useRef(isOpened);
|
|
1854
|
+
wasOpened.current ||= isOpened;
|
|
1855
|
+
const handleOpen = useCallback((_) => {
|
|
1856
|
+
if (_.id === id) {
|
|
1857
|
+
setParams(_);
|
|
1858
|
+
open();
|
|
1859
|
+
}
|
|
1860
|
+
else {
|
|
1861
|
+
close();
|
|
1862
|
+
}
|
|
1863
|
+
}, [id]);
|
|
1864
|
+
useDialogHandlers({
|
|
1865
|
+
onOpen: handleOpen,
|
|
1866
|
+
onClose: close,
|
|
1867
|
+
});
|
|
1868
|
+
const handleCloseAsEventSource = useCallback(() => {
|
|
1869
|
+
close();
|
|
1870
|
+
defaultEventBus.fire('dialog', { type: 'close' });
|
|
1871
|
+
}, []);
|
|
1872
|
+
return {
|
|
1873
|
+
...params,
|
|
1874
|
+
isOpened,
|
|
1875
|
+
wasOpened: wasOpened.current,
|
|
1876
|
+
onClose: handleCloseAsEventSource,
|
|
1877
|
+
};
|
|
1878
|
+
}
|
|
1879
|
+
|
|
2003
1880
|
const COOKIE_DIALOG_ID = 'cookie';
|
|
2004
1881
|
const LOCAL_STORAGE_NAME = 'cookieClose';
|
|
2005
1882
|
const CookiePopup = JSX(({ termLink, personalDataPolicyLink }) => {
|
|
@@ -2087,7 +1964,7 @@
|
|
|
2087
1964
|
|
|
2088
1965
|
const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
|
|
2089
1966
|
|
|
2090
|
-
const packageVersion = "0.11.
|
|
1967
|
+
const packageVersion = "0.11.3";
|
|
2091
1968
|
|
|
2092
1969
|
exports.Blocks = Blocks;
|
|
2093
1970
|
exports.ContentPage = ContentPage;
|