@redneckz/wildless-cms-uni-blocks 0.4.4 → 0.4.6
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/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +114 -34
- package/bundle/bundle.umd.min.js +1 -1
- package/cosmos-static/icons/{AirPlane.svg → AirPlaneIcon.svg} +0 -0
- package/cosmos-static/icons/{DocDownload.svg → DocDownloadIcon.svg} +0 -0
- package/cosmos-static/icons/{Logo.svg → LogoIcon.svg} +0 -0
- package/cosmos-static/icons/{PackA4.svg → PackA4Icon.svg} +0 -0
- package/cosmos-static/icons/{WateringCan.svg → WateringCanIcon.svg} +0 -0
- package/dist/components/BenefitsBlock/BenefitsBlock.js +32 -9
- package/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/dist/components/BenefitsBlock/BenefitsBlockContent.d.ts +9 -2
- package/dist/components/BlockContent.d.ts +3 -2
- package/dist/components/Blocks.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/CardTransfer/CardTransfer.d.ts +5 -0
- package/dist/components/CardTransfer/CardTransfer.js +28 -0
- package/dist/components/CardTransfer/CardTransfer.js.map +1 -0
- package/dist/components/CardTransfer/CardTransferContent.d.ts +10 -0
- package/dist/components/CardTransfer/CardTransferContent.js +2 -0
- package/dist/components/CardTransfer/CardTransferContent.js.map +1 -0
- package/dist/components/SafeDepositRental/SafeDepositRentalTotal.js +1 -1
- package/dist/components/SafeDepositRental/SafeDepositRentalTotal.js.map +1 -1
- package/dist/components/TariffsTable/EmbeddableCellData.js +1 -0
- package/dist/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/dist/components/TariffsTable/TariffsTableRowContainer.js +3 -3
- package/dist/components/TariffsTable/TariffsTableRowContainer.js.map +1 -1
- package/dist/components/TariffsTable/dataFixture.js +1 -0
- package/dist/components/TariffsTable/dataFixture.js.map +1 -1
- package/dist/content-page-repository/transformContentPage.js +9 -3
- package/dist/content-page-repository/transformContentPage.js.map +1 -1
- package/dist/content-page-repository/transformImg.d.ts +11 -0
- package/dist/content-page-repository/transformImg.js +100 -0
- package/dist/content-page-repository/transformImg.js.map +1 -0
- package/dist/content-page-repository/transformPicture.js +15 -40
- package/dist/content-page-repository/transformPicture.js.map +1 -1
- package/dist/content-page-repository/transformSrc.d.ts +3 -0
- package/dist/content-page-repository/transformSrc.js +20 -0
- package/dist/content-page-repository/transformSrc.js.map +1 -0
- package/dist/icons/IconName.d.ts +12 -12
- package/dist/icons/IconName.js +10 -10
- package/dist/icons/IconName.js.map +1 -1
- package/dist/model/ImageSize.d.ts +6 -0
- package/dist/model/ImageSize.js +2 -0
- package/dist/model/ImageSize.js.map +1 -0
- package/dist/model/Picture.d.ts +19 -6
- package/dist/ui-kit/Button/Button.js +6 -15
- package/dist/ui-kit/Button/Button.js.map +1 -1
- package/dist/ui-kit/Button/GetButtonClassParams.d.ts +6 -0
- package/dist/ui-kit/Button/GetButtonClassParams.js +2 -0
- package/dist/ui-kit/Button/GetButtonClassParams.js.map +1 -0
- package/dist/ui-kit/Button/buttonClassNameConstants.d.ts +4 -0
- package/dist/ui-kit/Button/buttonClassNameConstants.js +14 -0
- package/dist/ui-kit/Button/buttonClassNameConstants.js.map +1 -0
- package/dist/ui-kit/Button/getDisabledButtonClasses.d.ts +2 -0
- package/dist/ui-kit/Button/getDisabledButtonClasses.js +12 -0
- package/dist/ui-kit/Button/getDisabledButtonClasses.js.map +1 -0
- package/dist/ui-kit/Button/getRegularButtonClasses.d.ts +2 -0
- package/dist/ui-kit/Button/getRegularButtonClasses.js +12 -0
- package/dist/ui-kit/Button/getRegularButtonClasses.js.map +1 -0
- package/dist/ui-kit/CurrencyInput/CurrencyInput.d.ts +19 -0
- package/dist/ui-kit/CurrencyInput/CurrencyInput.js +21 -0
- package/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -0
- package/dist/ui-kit/Img/ImgAsPicture.js +6 -2
- package/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/dist/ui-kit/InnerTable/InnerTable.js +1 -1
- package/dist/ui-kit/InnerTable/InnerTable.js.map +1 -1
- package/dist/ui-kit/InnerTable/InnerTableButton.js +2 -2
- package/dist/ui-kit/InnerTable/InnerTableButton.js.map +1 -1
- package/dist/ui-kit/InnerTable/InnerTableHeader.js +1 -1
- package/dist/ui-kit/InnerTable/InnerTableHeader.js.map +1 -1
- package/dist/ui-kit/Logo/Logo.js +1 -1
- package/dist/ui-kit/Logo/Logo.js.map +1 -1
- package/dist/ui-kit/Logo/Logo.mobile.js +1 -1
- package/dist/ui-kit/Logo/Logo.mobile.js.map +1 -1
- package/dist/utils/isPictureSizeEmpty.d.ts +2 -0
- package/dist/utils/isPictureSizeEmpty.js +7 -0
- package/dist/utils/isPictureSizeEmpty.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/BenefitsBlock/BenefitsBlock.fixture.d.ts +2 -0
- package/lib/components/BenefitsBlock/BenefitsBlock.js +32 -9
- package/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/lib/components/BenefitsBlock/BenefitsBlockContent.d.ts +9 -2
- package/lib/components/BlockContent.d.ts +3 -2
- package/lib/components/Blocks.d.ts +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/CardTransfer/CardTransfer.d.ts +5 -0
- package/lib/components/CardTransfer/CardTransfer.fixture.d.ts +5 -0
- package/lib/components/CardTransfer/CardTransfer.js +26 -0
- package/lib/components/CardTransfer/CardTransfer.js.map +1 -0
- package/lib/components/CardTransfer/CardTransferContent.d.ts +10 -0
- package/lib/components/CardTransfer/CardTransferContent.js +2 -0
- package/lib/components/CardTransfer/CardTransferContent.js.map +1 -0
- package/lib/components/SafeDepositRental/SafeDepositRentalTotal.js +1 -1
- package/lib/components/SafeDepositRental/SafeDepositRentalTotal.js.map +1 -1
- package/lib/components/TariffsTable/EmbeddableCellData.js +1 -0
- package/lib/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/lib/components/TariffsTable/TariffsTableRowContainer.js +3 -3
- package/lib/components/TariffsTable/TariffsTableRowContainer.js.map +1 -1
- package/lib/components/TariffsTable/dataFixture.js +1 -0
- package/lib/components/TariffsTable/dataFixture.js.map +1 -1
- package/lib/content-page-repository/transformContentPage.js +9 -3
- package/lib/content-page-repository/transformContentPage.js.map +1 -1
- package/lib/content-page-repository/transformImg.d.ts +11 -0
- package/lib/content-page-repository/transformImg.js +94 -0
- package/lib/content-page-repository/transformImg.js.map +1 -0
- package/lib/content-page-repository/transformPicture.js +15 -40
- package/lib/content-page-repository/transformPicture.js.map +1 -1
- package/lib/content-page-repository/transformSrc.d.ts +3 -0
- package/lib/content-page-repository/transformSrc.js +14 -0
- package/lib/content-page-repository/transformSrc.js.map +1 -0
- package/lib/icons/IconName.d.ts +12 -12
- package/lib/icons/IconName.js +10 -10
- package/lib/icons/IconName.js.map +1 -1
- package/lib/model/ImageSize.d.ts +6 -0
- package/lib/model/ImageSize.js +2 -0
- package/lib/model/ImageSize.js.map +1 -0
- package/lib/model/Picture.d.ts +19 -6
- package/lib/ui-kit/Button/Button.js +6 -15
- package/lib/ui-kit/Button/Button.js.map +1 -1
- package/lib/ui-kit/Button/GetButtonClassParams.d.ts +6 -0
- package/lib/ui-kit/Button/GetButtonClassParams.js +2 -0
- package/lib/ui-kit/Button/GetButtonClassParams.js.map +1 -0
- package/lib/ui-kit/Button/buttonClassNameConstants.d.ts +4 -0
- package/lib/ui-kit/Button/buttonClassNameConstants.js +12 -0
- package/lib/ui-kit/Button/buttonClassNameConstants.js.map +1 -0
- package/lib/ui-kit/Button/getDisabledButtonClasses.d.ts +2 -0
- package/lib/ui-kit/Button/getDisabledButtonClasses.js +9 -0
- package/lib/ui-kit/Button/getDisabledButtonClasses.js.map +1 -0
- package/lib/ui-kit/Button/getRegularButtonClasses.d.ts +2 -0
- package/lib/ui-kit/Button/getRegularButtonClasses.js +9 -0
- package/lib/ui-kit/Button/getRegularButtonClasses.js.map +1 -0
- package/lib/ui-kit/CurrencyInput/CurrencyInput.d.ts +19 -0
- package/lib/ui-kit/CurrencyInput/CurrencyInput.js +19 -0
- package/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -0
- package/lib/ui-kit/Img/ImgAsPicture.js +6 -2
- package/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/lib/ui-kit/InnerTable/InnerTable.js +1 -1
- package/lib/ui-kit/InnerTable/InnerTable.js.map +1 -1
- package/lib/ui-kit/InnerTable/InnerTableButton.js +2 -2
- package/lib/ui-kit/InnerTable/InnerTableButton.js.map +1 -1
- package/lib/ui-kit/InnerTable/InnerTableHeader.js +1 -1
- package/lib/ui-kit/InnerTable/InnerTableHeader.js.map +1 -1
- package/lib/ui-kit/Logo/Logo.js +1 -1
- package/lib/ui-kit/Logo/Logo.js.map +1 -1
- package/lib/ui-kit/Logo/Logo.mobile.js +1 -1
- package/lib/ui-kit/Logo/Logo.mobile.js.map +1 -1
- package/lib/utils/isPictureSizeEmpty.d.ts +2 -0
- package/lib/utils/isPictureSizeEmpty.js +4 -0
- package/lib/utils/isPictureSizeEmpty.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +17 -13
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js +32 -9
- package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/mobile/dist/components/BenefitsBlock/BenefitsBlockContent.d.ts +9 -2
- package/mobile/dist/components/BlockContent.d.ts +3 -2
- package/mobile/dist/components/CardTransfer/CardTransfer.d.ts +5 -0
- package/mobile/dist/components/CardTransfer/CardTransfer.js +28 -0
- package/mobile/dist/components/CardTransfer/CardTransfer.js.map +1 -0
- package/mobile/dist/components/CardTransfer/CardTransferContent.d.ts +10 -0
- package/mobile/dist/components/CardTransfer/CardTransferContent.js +2 -0
- package/mobile/dist/components/CardTransfer/CardTransferContent.js.map +1 -0
- package/mobile/dist/components/SafeDepositRental/SafeDepositRentalTotal.js +1 -1
- package/mobile/dist/components/SafeDepositRental/SafeDepositRentalTotal.js.map +1 -1
- package/mobile/dist/components/TariffsTable/TariffsTableRowContainer.js +3 -3
- package/mobile/dist/components/TariffsTable/TariffsTableRowContainer.js.map +1 -1
- package/mobile/dist/components/TariffsTable/dataFixture.js +1 -0
- package/mobile/dist/components/TariffsTable/dataFixture.js.map +1 -1
- package/mobile/dist/content-page-repository/transformContentPage.js +9 -3
- package/mobile/dist/content-page-repository/transformContentPage.js.map +1 -1
- package/mobile/dist/content-page-repository/transformImg.d.ts +11 -0
- package/mobile/dist/content-page-repository/transformImg.js +100 -0
- package/mobile/dist/content-page-repository/transformImg.js.map +1 -0
- package/mobile/dist/content-page-repository/transformPicture.js +15 -40
- package/mobile/dist/content-page-repository/transformPicture.js.map +1 -1
- package/mobile/dist/content-page-repository/transformSrc.d.ts +3 -0
- package/mobile/dist/content-page-repository/transformSrc.js +20 -0
- package/mobile/dist/content-page-repository/transformSrc.js.map +1 -0
- package/mobile/dist/icons/IconName.d.ts +12 -12
- package/mobile/dist/icons/IconName.js +10 -10
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/model/ImageSize.d.ts +6 -0
- package/mobile/dist/model/ImageSize.js +2 -0
- package/mobile/dist/model/ImageSize.js.map +1 -0
- package/mobile/dist/model/Picture.d.ts +19 -6
- package/mobile/dist/ui-kit/Button/GetButtonClassParams.d.ts +6 -0
- package/mobile/dist/ui-kit/Button/GetButtonClassParams.js +2 -0
- package/mobile/dist/ui-kit/Button/GetButtonClassParams.js.map +1 -0
- package/mobile/dist/ui-kit/Button/buttonClassNameConstants.d.ts +4 -0
- package/mobile/dist/ui-kit/Button/buttonClassNameConstants.js +14 -0
- package/mobile/dist/ui-kit/Button/buttonClassNameConstants.js.map +1 -0
- package/mobile/dist/ui-kit/Button/getDisabledButtonClasses.d.ts +2 -0
- package/mobile/dist/ui-kit/Button/getDisabledButtonClasses.js +12 -0
- package/mobile/dist/ui-kit/Button/getDisabledButtonClasses.js.map +1 -0
- package/mobile/dist/ui-kit/Button/getRegularButtonClasses.d.ts +2 -0
- package/mobile/dist/ui-kit/Button/getRegularButtonClasses.js +12 -0
- package/mobile/dist/ui-kit/Button/getRegularButtonClasses.js.map +1 -0
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.d.ts +19 -0
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js +21 -0
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -0
- package/mobile/dist/ui-kit/Img/ImgAsPicture.js +6 -2
- package/mobile/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/mobile/dist/ui-kit/InnerTable/InnerTable.js +1 -1
- package/mobile/dist/ui-kit/InnerTable/InnerTable.js.map +1 -1
- package/mobile/dist/ui-kit/InnerTable/InnerTableButton.js +2 -2
- package/mobile/dist/ui-kit/InnerTable/InnerTableButton.js.map +1 -1
- package/mobile/dist/ui-kit/InnerTable/InnerTableHeader.js +1 -1
- package/mobile/dist/ui-kit/InnerTable/InnerTableHeader.js.map +1 -1
- package/mobile/dist/ui-kit/Logo/Logo.js +1 -1
- package/mobile/dist/ui-kit/Logo/Logo.js.map +1 -1
- package/mobile/dist/utils/isPictureSizeEmpty.d.ts +2 -0
- package/mobile/dist/utils/isPictureSizeEmpty.js +7 -0
- package/mobile/dist/utils/isPictureSizeEmpty.js.map +1 -0
- package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js +32 -9
- package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/mobile/lib/components/BenefitsBlock/BenefitsBlockContent.d.ts +9 -2
- package/mobile/lib/components/BlockContent.d.ts +3 -2
- package/mobile/lib/components/CardTransfer/CardTransfer.d.ts +5 -0
- package/mobile/lib/components/CardTransfer/CardTransfer.js +26 -0
- package/mobile/lib/components/CardTransfer/CardTransfer.js.map +1 -0
- package/mobile/lib/components/CardTransfer/CardTransferContent.d.ts +10 -0
- package/mobile/lib/components/CardTransfer/CardTransferContent.js +2 -0
- package/mobile/lib/components/CardTransfer/CardTransferContent.js.map +1 -0
- package/mobile/lib/components/SafeDepositRental/SafeDepositRentalTotal.js +1 -1
- package/mobile/lib/components/SafeDepositRental/SafeDepositRentalTotal.js.map +1 -1
- package/mobile/lib/components/TariffsTable/TariffsTableRowContainer.js +3 -3
- package/mobile/lib/components/TariffsTable/TariffsTableRowContainer.js.map +1 -1
- package/mobile/lib/components/TariffsTable/dataFixture.js +1 -0
- package/mobile/lib/components/TariffsTable/dataFixture.js.map +1 -1
- package/mobile/lib/content-page-repository/transformContentPage.js +9 -3
- package/mobile/lib/content-page-repository/transformContentPage.js.map +1 -1
- package/mobile/lib/content-page-repository/transformImg.d.ts +11 -0
- package/mobile/lib/content-page-repository/transformImg.js +94 -0
- package/mobile/lib/content-page-repository/transformImg.js.map +1 -0
- package/mobile/lib/content-page-repository/transformPicture.js +15 -40
- package/mobile/lib/content-page-repository/transformPicture.js.map +1 -1
- package/mobile/lib/content-page-repository/transformSrc.d.ts +3 -0
- package/mobile/lib/content-page-repository/transformSrc.js +14 -0
- package/mobile/lib/content-page-repository/transformSrc.js.map +1 -0
- package/mobile/lib/icons/IconName.d.ts +12 -12
- package/mobile/lib/icons/IconName.js +10 -10
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/model/ImageSize.d.ts +6 -0
- package/mobile/lib/model/ImageSize.js +2 -0
- package/mobile/lib/model/ImageSize.js.map +1 -0
- package/mobile/lib/model/Picture.d.ts +19 -6
- package/mobile/lib/ui-kit/Button/GetButtonClassParams.d.ts +6 -0
- package/mobile/lib/ui-kit/Button/GetButtonClassParams.js +2 -0
- package/mobile/lib/ui-kit/Button/GetButtonClassParams.js.map +1 -0
- package/mobile/lib/ui-kit/Button/buttonClassNameConstants.d.ts +4 -0
- package/mobile/lib/ui-kit/Button/buttonClassNameConstants.js +12 -0
- package/mobile/lib/ui-kit/Button/buttonClassNameConstants.js.map +1 -0
- package/mobile/lib/ui-kit/Button/getDisabledButtonClasses.d.ts +2 -0
- package/mobile/lib/ui-kit/Button/getDisabledButtonClasses.js +9 -0
- package/mobile/lib/ui-kit/Button/getDisabledButtonClasses.js.map +1 -0
- package/mobile/lib/ui-kit/Button/getRegularButtonClasses.d.ts +2 -0
- package/mobile/lib/ui-kit/Button/getRegularButtonClasses.js +9 -0
- package/mobile/lib/ui-kit/Button/getRegularButtonClasses.js.map +1 -0
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.d.ts +19 -0
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js +19 -0
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -0
- package/mobile/lib/ui-kit/Img/ImgAsPicture.js +6 -2
- package/mobile/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/mobile/lib/ui-kit/InnerTable/InnerTable.js +1 -1
- package/mobile/lib/ui-kit/InnerTable/InnerTable.js.map +1 -1
- package/mobile/lib/ui-kit/InnerTable/InnerTableButton.js +2 -2
- package/mobile/lib/ui-kit/InnerTable/InnerTableButton.js.map +1 -1
- package/mobile/lib/ui-kit/InnerTable/InnerTableHeader.js +1 -1
- package/mobile/lib/ui-kit/InnerTable/InnerTableHeader.js.map +1 -1
- package/mobile/lib/ui-kit/Logo/Logo.js +1 -1
- package/mobile/lib/ui-kit/Logo/Logo.js.map +1 -1
- package/mobile/lib/utils/isPictureSizeEmpty.d.ts +2 -0
- package/mobile/lib/utils/isPictureSizeEmpty.js +4 -0
- package/mobile/lib/utils/isPictureSizeEmpty.js.map +1 -0
- package/mobile/src/components/BenefitsBlock/BenefitsBlock.example.json +1 -0
- package/mobile/src/components/BenefitsBlock/BenefitsBlock.tsx +78 -28
- package/mobile/src/components/BenefitsBlock/BenefitsBlockContent.ts +10 -2
- package/mobile/src/components/BlockContent.ts +3 -1
- package/mobile/src/components/CardTransfer/CardTransfer.tsx +59 -0
- package/mobile/src/components/CardTransfer/CardTransferContent.ts +10 -0
- package/mobile/src/components/ContentPage/ContentPage.page.json +5 -2
- package/mobile/src/components/SafeDepositRental/SafeDepositRentalTotal.tsx +1 -1
- package/mobile/src/components/TariffsTable/TariffsTableRowContainer.tsx +9 -4
- package/mobile/src/components/TariffsTable/dataFixture.ts +5 -4
- package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +61 -9
- package/mobile/src/content-page-repository/transformContentPage.ts +10 -3
- package/mobile/src/content-page-repository/transformImg.ts +157 -0
- package/mobile/src/content-page-repository/transformPicture.ts +24 -58
- package/mobile/src/content-page-repository/transformSrc.ts +21 -0
- package/mobile/src/icons/{AirPlane.svg → AirPlaneIcon.svg} +0 -0
- package/mobile/src/icons/{DocDownload.svg → DocDownloadIcon.svg} +0 -0
- package/mobile/src/icons/IconName.ts +4 -4
- package/mobile/src/icons/{Logo.svg → LogoIcon.svg} +0 -0
- package/mobile/src/icons/{PackA4.svg → PackA4Icon.svg} +0 -0
- package/mobile/src/icons/{WateringCan.svg → WateringCanIcon.svg} +0 -0
- package/mobile/src/model/ImageSize.ts +6 -0
- package/mobile/src/model/Picture.ts +29 -6
- package/mobile/src/ui-kit/Button/GetButtonClassParams.ts +7 -0
- package/mobile/src/ui-kit/Button/buttonClassNameConstants.ts +16 -0
- package/mobile/src/ui-kit/Button/getDisabledButtonClasses.ts +15 -0
- package/mobile/src/ui-kit/Button/getRegularButtonClasses.ts +15 -0
- package/mobile/src/ui-kit/CurrencyInput/CurrencyInput.tsx +70 -0
- package/mobile/src/ui-kit/Img/ImgAsPicture.tsx +8 -2
- package/mobile/src/ui-kit/InnerTable/InnerTable.tsx +1 -1
- package/mobile/src/ui-kit/InnerTable/InnerTableButton.tsx +2 -2
- package/mobile/src/ui-kit/InnerTable/InnerTableHeader.tsx +1 -1
- package/mobile/src/ui-kit/Logo/Logo.tsx +1 -1
- package/mobile/src/utils/isPictureSizeEmpty.ts +5 -0
- package/package.json +2 -1
- package/src/components/BenefitsBlock/BenefitsBlock.example.json +1 -0
- package/src/components/BenefitsBlock/BenefitsBlock.fixture.tsx +94 -1
- package/src/components/BenefitsBlock/BenefitsBlock.tsx +78 -28
- package/src/components/BenefitsBlock/BenefitsBlockContent.ts +10 -2
- package/src/components/BlockContent.ts +3 -1
- package/src/components/Blocks.ts +2 -0
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.fixture.tsx +2 -2
- package/src/components/CardTransfer/CardTransfer.fixture.tsx +6 -0
- package/src/components/CardTransfer/CardTransfer.tsx +59 -0
- package/src/components/CardTransfer/CardTransferContent.ts +10 -0
- package/src/components/ContentPage/ContentPage.page.json +5 -2
- package/src/components/SafeDepositRental/SafeDepositRentalTotal.tsx +1 -1
- package/src/components/TariffsTable/EmbeddableCellData.tsx +3 -2
- package/src/components/TariffsTable/TariffsTableRowContainer.tsx +9 -4
- package/src/components/TariffsTable/dataFixture.ts +5 -4
- package/src/components/__snapshots__/Blocks.spec.tsx.snap +61 -9
- package/src/content-page-repository/transformContentPage.ts +10 -3
- package/src/content-page-repository/transformImg.ts +157 -0
- package/src/content-page-repository/transformPicture.ts +24 -58
- package/src/content-page-repository/transformSrc.ts +21 -0
- package/src/icons/{AirPlane.svg → AirPlaneIcon.svg} +0 -0
- package/src/icons/{DocDownload.svg → DocDownloadIcon.svg} +0 -0
- package/src/icons/IconName.ts +16 -16
- package/src/icons/{Logo.svg → LogoIcon.svg} +0 -0
- package/src/icons/{PackA4.svg → PackA4Icon.svg} +0 -0
- package/src/icons/{WateringCan.svg → WateringCanIcon.svg} +0 -0
- package/src/model/ImageSize.ts +6 -0
- package/src/model/Picture.ts +29 -6
- package/src/ui-kit/Button/Button.tsx +6 -34
- package/src/ui-kit/Button/GetButtonClassParams.ts +7 -0
- package/src/ui-kit/Button/buttonClassNameConstants.ts +16 -0
- package/src/ui-kit/Button/getDisabledButtonClasses.ts +15 -0
- package/src/ui-kit/Button/getRegularButtonClasses.ts +15 -0
- package/src/ui-kit/CurrencyInput/CurrencyInput.tsx +70 -0
- package/src/ui-kit/Img/ImgAsPicture.tsx +8 -2
- package/src/ui-kit/InnerTable/InnerTable.tsx +1 -1
- package/src/ui-kit/InnerTable/InnerTableButton.tsx +2 -2
- package/src/ui-kit/InnerTable/InnerTableHeader.tsx +1 -1
- package/src/ui-kit/Logo/Logo.mobile.tsx +1 -1
- package/src/ui-kit/Logo/Logo.tsx +1 -1
- package/src/utils/isPictureSizeEmpty.ts +5 -0
|
@@ -18,11 +18,16 @@ export async function transformContentPage(
|
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
19
19
|
return mapJSON<ContentPageDef>(JSON.parse(content), async (value: any, [key]) => {
|
|
20
20
|
const isMarkdown = typeof value === 'string' && key?.endsWith('__md');
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
if (isMarkdown) {
|
|
23
23
|
return await transformMarkdown(value);
|
|
24
|
-
} else if (isPicture) {
|
|
25
|
-
|
|
24
|
+
} else if (isPicture(value)) {
|
|
25
|
+
try {
|
|
26
|
+
return await transformPicture(pagePath, value, options);
|
|
27
|
+
} catch (ex) {
|
|
28
|
+
console.warn('Error while transforming picture on page: %s', pagePath);
|
|
29
|
+
console.error(ex);
|
|
30
|
+
}
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
return value;
|
|
@@ -34,3 +39,5 @@ const isLocalPath = (_: any): boolean => isString(_) && _.length < 512 && !isURL
|
|
|
34
39
|
const isString = (_: any): _ is string => Boolean(_ && typeof _ === 'string');
|
|
35
40
|
|
|
36
41
|
const isURL = (src: string) => ['data:', 'https:', 'http:'].some((proto) => src.startsWith(proto));
|
|
42
|
+
|
|
43
|
+
const isPicture = (_: any): _ is Picture => Boolean(_ && isLocalPath(_?.src));
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import util from 'util';
|
|
4
|
+
import sharp from 'sharp';
|
|
5
|
+
import type { ResizeOptions, Sharp } from 'sharp';
|
|
6
|
+
import type { ImageSize } from '../model/ImageSize';
|
|
7
|
+
import type { TransformationOptions } from './TransformationOptions';
|
|
8
|
+
import type { ImgAlignment, ImgSource, Picture } from '../model/Picture';
|
|
9
|
+
import { transformSrc } from './transformSrc';
|
|
10
|
+
import { isPictureSizeEmpty } from '../utils/isPictureSizeEmpty';
|
|
11
|
+
|
|
12
|
+
const mkdir = util.promisify(fs.mkdir);
|
|
13
|
+
|
|
14
|
+
type TransformImgParams = {
|
|
15
|
+
pagePath: string;
|
|
16
|
+
src: string;
|
|
17
|
+
containerSize?: ImageSize;
|
|
18
|
+
transformationOptions: TransformationOptions & ImgSource;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export async function transformImg({
|
|
22
|
+
pagePath,
|
|
23
|
+
src,
|
|
24
|
+
containerSize,
|
|
25
|
+
transformationOptions,
|
|
26
|
+
}: TransformImgParams): Promise<string> {
|
|
27
|
+
if (!src) {
|
|
28
|
+
return '';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const { contentDir, publicDir, format, options, size, alignment } = transformationOptions;
|
|
32
|
+
|
|
33
|
+
const pageDir = path.dirname(pagePath);
|
|
34
|
+
const imgPath = `${pageDir}/${src}`;
|
|
35
|
+
let chain = sharp(imgPath);
|
|
36
|
+
|
|
37
|
+
const targetSize = getPictureSize(size, containerSize);
|
|
38
|
+
|
|
39
|
+
if (targetSize) {
|
|
40
|
+
chain = resizeImg(chain, targetSize, getResizeFit(targetSize));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (containerSize) {
|
|
44
|
+
chain = resizeImg(chain, containerSize);
|
|
45
|
+
|
|
46
|
+
// Save intermediate transform result to modify further
|
|
47
|
+
const { data } = await chain.toBuffer({ resolveWithObject: true });
|
|
48
|
+
|
|
49
|
+
chain = resizeImg(
|
|
50
|
+
sharp(data),
|
|
51
|
+
getCompositionResizeSize(containerSize, targetSize),
|
|
52
|
+
getResizeFit(targetSize),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
chain = await compositeImg({ chain, containerSize, alignment });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (format) {
|
|
59
|
+
chain = chain.toFormat(format, options);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const transformedSrc = transformSrc(src, transformationOptions);
|
|
63
|
+
const transformedImgPath = `${publicDir}/${path.relative(
|
|
64
|
+
contentDir,
|
|
65
|
+
`${path.dirname(pagePath)}/${transformedSrc}`,
|
|
66
|
+
)}`;
|
|
67
|
+
|
|
68
|
+
await mkdir(path.dirname(transformedImgPath), { recursive: true });
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
await chain.toFile(transformedImgPath);
|
|
72
|
+
} catch (e) {
|
|
73
|
+
console.error(e);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return transformedSrc;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function createBackgroundImageChain({ width, height }: ImageSize) {
|
|
80
|
+
const channels = 4;
|
|
81
|
+
const rgbaColor = 0x00000000;
|
|
82
|
+
|
|
83
|
+
const canvas = Buffer.alloc(width * height * channels, rgbaColor);
|
|
84
|
+
|
|
85
|
+
return sharp(canvas, { raw: { width, height, channels } });
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function resizeImg(chain: Sharp, size: Picture['size'], options?: ResizeOptions) {
|
|
89
|
+
return chain.resize(size?.width, size?.height, {
|
|
90
|
+
fit: sharp.fit.fill,
|
|
91
|
+
background: { r: 0, g: 0, b: 0, alpha: 0 },
|
|
92
|
+
...options,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
type CompositeImgParams = {
|
|
97
|
+
chain: Sharp;
|
|
98
|
+
containerSize: ImageSize;
|
|
99
|
+
alignment?: ImgAlignment;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
async function compositeImg({
|
|
103
|
+
chain,
|
|
104
|
+
containerSize,
|
|
105
|
+
alignment,
|
|
106
|
+
}: CompositeImgParams): Promise<Sharp> {
|
|
107
|
+
const { data } = await chain.toBuffer({ resolveWithObject: true });
|
|
108
|
+
|
|
109
|
+
return createBackgroundImageChain(containerSize).composite([
|
|
110
|
+
{
|
|
111
|
+
input: data,
|
|
112
|
+
gravity: alignment,
|
|
113
|
+
},
|
|
114
|
+
]);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function getPictureSize(size: Picture['size'], containerSize?: ImageSize) {
|
|
118
|
+
// If containerSize is undefined intrinsic dimensions of image will be used then.
|
|
119
|
+
return isPictureSizeEmpty(size) ? containerSize : size;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function getCompositionResizeSize(
|
|
123
|
+
containerSize: ImageSize,
|
|
124
|
+
size: Picture['size'] = {},
|
|
125
|
+
): Picture['size'] {
|
|
126
|
+
const { width, height } = size;
|
|
127
|
+
const { width: containerWidth, height: containerHeight } = containerSize;
|
|
128
|
+
|
|
129
|
+
let widthRatio = 0;
|
|
130
|
+
let heightRatio = 0;
|
|
131
|
+
|
|
132
|
+
if (!(width || height)) {
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (width) {
|
|
137
|
+
widthRatio = containerWidth / width;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (height) {
|
|
141
|
+
heightRatio = containerHeight / height;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return widthRatio > heightRatio
|
|
145
|
+
? { width: Math.min(Number(width), containerWidth) }
|
|
146
|
+
: { height: Math.min(Number(height), containerHeight) };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function getResizeFit(size: Picture['size']): ResizeOptions {
|
|
150
|
+
/*
|
|
151
|
+
Editor behaviour with one dimension present: resize by given dimension maintaining aspect ratio. (fit: contain)
|
|
152
|
+
With two dimensions present: resize trying to fill given dimensions (fit: fill)
|
|
153
|
+
*/
|
|
154
|
+
return {
|
|
155
|
+
fit: size?.width && size?.height ? sharp.fit.fill : sharp.fit.contain,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
1
|
import path from 'path';
|
|
3
2
|
import sharp from 'sharp';
|
|
4
|
-
import
|
|
5
|
-
import type { ImgSource, Picture } from '../model/Picture';
|
|
3
|
+
import type { Picture } from '../model/Picture';
|
|
6
4
|
import type { TransformationOptions } from './TransformationOptions';
|
|
7
|
-
|
|
8
|
-
const mkdir = util.promisify(fs.mkdir);
|
|
5
|
+
import { transformImg } from './transformImg';
|
|
9
6
|
|
|
10
7
|
export async function transformPicture(
|
|
11
8
|
pagePath: string,
|
|
@@ -14,8 +11,27 @@ export async function transformPicture(
|
|
|
14
11
|
): Promise<Picture> {
|
|
15
12
|
const sources = picture.sources || [];
|
|
16
13
|
const src = picture?.src || '';
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
|
|
15
|
+
const transformedPicture = await transformImg({
|
|
16
|
+
pagePath,
|
|
17
|
+
src,
|
|
18
|
+
transformationOptions: { ...options, ...picture },
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const { width, height } = await sharp(
|
|
22
|
+
path.resolve(options.publicDir, transformedPicture),
|
|
23
|
+
).metadata();
|
|
24
|
+
const containerSize = width && height ? { width, height } : undefined;
|
|
25
|
+
|
|
26
|
+
const transformedSources = await Promise.all(
|
|
27
|
+
sources.map((_) =>
|
|
28
|
+
transformImg({
|
|
29
|
+
pagePath,
|
|
30
|
+
src,
|
|
31
|
+
containerSize,
|
|
32
|
+
transformationOptions: { ...options, ..._ },
|
|
33
|
+
}),
|
|
34
|
+
),
|
|
19
35
|
);
|
|
20
36
|
|
|
21
37
|
return {
|
|
@@ -24,57 +40,7 @@ export async function transformPicture(
|
|
|
24
40
|
sources: transformedSources.map((_, i) => ({
|
|
25
41
|
...sources[i],
|
|
26
42
|
src: _,
|
|
43
|
+
size: { width, height },
|
|
27
44
|
})),
|
|
28
45
|
};
|
|
29
46
|
}
|
|
30
|
-
|
|
31
|
-
async function transformImg(
|
|
32
|
-
pagePath: string,
|
|
33
|
-
src: string,
|
|
34
|
-
transformationOptions: TransformationOptions & ImgSource,
|
|
35
|
-
): Promise<string> {
|
|
36
|
-
const { contentDir, publicDir, format, options, size } = transformationOptions;
|
|
37
|
-
|
|
38
|
-
const pageDir = path.dirname(pagePath);
|
|
39
|
-
const imgPath = `${pageDir}/${src}`;
|
|
40
|
-
let chain = sharp(imgPath);
|
|
41
|
-
if (size) {
|
|
42
|
-
chain = chain.resize(size?.width, size?.height, {
|
|
43
|
-
fit: sharp.fit.contain,
|
|
44
|
-
background: [0, 0, 0, 0],
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
if (format) {
|
|
48
|
-
chain = chain.toFormat(format, options);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const transformedSrc = transformSrc(src, transformationOptions);
|
|
52
|
-
const transformedImgPath = `${publicDir}/${path.relative(
|
|
53
|
-
contentDir,
|
|
54
|
-
`${path.dirname(pagePath)}/${transformedSrc}`,
|
|
55
|
-
)}`;
|
|
56
|
-
|
|
57
|
-
await mkdir(path.dirname(transformedImgPath), { recursive: true });
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
await chain.toFile(transformedImgPath);
|
|
61
|
-
} catch (e) {
|
|
62
|
-
console.error(e);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return transformedSrc;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function transformSrc(src: string, { format, size }: TransformationOptions & ImgSource): string {
|
|
69
|
-
const noTransform = !format && !size;
|
|
70
|
-
if (noTransform) {
|
|
71
|
-
return src;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const fileName = path.basename(src, path.extname(src));
|
|
75
|
-
const fileSizes = [size?.width, size?.height].filter(Boolean);
|
|
76
|
-
const suffix = fileSizes.length ? `-${fileSizes.join('-')}` : '';
|
|
77
|
-
const ext = String(format) || path.extname(src);
|
|
78
|
-
|
|
79
|
-
return `${fileName}${suffix}.${ext}`;
|
|
80
|
-
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import type { ImgSource } from '../model/Picture';
|
|
3
|
+
import type { TransformationOptions } from './TransformationOptions';
|
|
4
|
+
import { isPictureSizeEmpty } from '../utils/isPictureSizeEmpty';
|
|
5
|
+
|
|
6
|
+
export function transformSrc(
|
|
7
|
+
src: string,
|
|
8
|
+
{ format, size }: TransformationOptions & ImgSource,
|
|
9
|
+
): string {
|
|
10
|
+
const noTransform = isPictureSizeEmpty(size) && !format;
|
|
11
|
+
if (noTransform) {
|
|
12
|
+
return src;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const fileName = path.basename(src, path.extname(src));
|
|
16
|
+
const fileSizes = [size?.width, size?.height].filter(Boolean);
|
|
17
|
+
const suffix = fileSizes.length ? `-${fileSizes.join('-')}` : '';
|
|
18
|
+
const ext = format ? String(format) : 'webp';
|
|
19
|
+
|
|
20
|
+
return `${fileName}${suffix}.${ext}`;
|
|
21
|
+
}
|
|
File without changes
|
|
File without changes
|
package/src/icons/IconName.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* eslint-disable max-len, max-lines */
|
|
3
3
|
export enum IconMap {
|
|
4
4
|
ActualBalanceIcon = 'ActualBalanceIcon',
|
|
5
|
-
|
|
5
|
+
AirPlaneIcon = 'AirPlaneIcon',
|
|
6
6
|
AppleIcon = 'AppleIcon',
|
|
7
7
|
ArrowDownIcon = 'ArrowDownIcon',
|
|
8
8
|
ArrowLeftIcon = 'ArrowLeftIcon',
|
|
@@ -26,7 +26,7 @@ export enum IconMap {
|
|
|
26
26
|
ComfortableCompIcon = 'ComfortableCompIcon',
|
|
27
27
|
CreditCardsIcon = 'CreditCardsIcon',
|
|
28
28
|
DiscountShapeIcon = 'DiscountShapeIcon',
|
|
29
|
-
|
|
29
|
+
DocDownloadIcon = 'DocDownloadIcon',
|
|
30
30
|
DocIcon = 'DocIcon',
|
|
31
31
|
DocIconMonoColor = 'DocIconMonoColor',
|
|
32
32
|
DocsIcon = 'DocsIcon',
|
|
@@ -45,7 +45,7 @@ export enum IconMap {
|
|
|
45
45
|
InterestGrowthIcon = 'InterestGrowthIcon',
|
|
46
46
|
InterestIcon = 'InterestIcon',
|
|
47
47
|
JCBIcon = 'JCBIcon',
|
|
48
|
-
|
|
48
|
+
LogoIcon = 'LogoIcon',
|
|
49
49
|
LoupeIcon = 'LoupeIcon',
|
|
50
50
|
MasterCardIcon = 'MasterCardIcon',
|
|
51
51
|
MinusIcon = 'MinusIcon',
|
|
@@ -56,7 +56,7 @@ export enum IconMap {
|
|
|
56
56
|
NewDocIcon = 'NewDocIcon',
|
|
57
57
|
OfficeIcon = 'OfficeIcon',
|
|
58
58
|
OkIcon = 'OkIcon',
|
|
59
|
-
|
|
59
|
+
PackA4Icon = 'PackA4Icon',
|
|
60
60
|
PassSendIcon = 'PassSendIcon',
|
|
61
61
|
PercentageRoundIcon = 'PercentageRoundIcon',
|
|
62
62
|
PercentageSquareIcon = 'PercentageSquareIcon',
|
|
@@ -83,12 +83,12 @@ export enum IconMap {
|
|
|
83
83
|
WalletAddIcon = 'WalletAddIcon',
|
|
84
84
|
WalletIcon = 'WalletIcon',
|
|
85
85
|
WalletWithMoneyIcon = 'WalletWithMoneyIcon',
|
|
86
|
-
|
|
86
|
+
WateringCanIcon = 'WateringCanIcon',
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
export enum IconTitleMap {
|
|
90
90
|
ActualBalanceIcon = 'Деньги',
|
|
91
|
-
|
|
91
|
+
AirPlaneIcon = 'Самолет',
|
|
92
92
|
AppleIcon = 'Лого «Apple»',
|
|
93
93
|
ArrowDownIcon = "Стрелка 'Вниз'",
|
|
94
94
|
ArrowLeftIcon = 'Стрелка',
|
|
@@ -112,7 +112,7 @@ export enum IconTitleMap {
|
|
|
112
112
|
ComfortableCompIcon = 'Кресло',
|
|
113
113
|
CreditCardsIcon = 'Кредитные карты',
|
|
114
114
|
DiscountShapeIcon = 'Скидка',
|
|
115
|
-
|
|
115
|
+
DocDownloadIcon = 'Скачать документ',
|
|
116
116
|
DocIcon = 'Документ',
|
|
117
117
|
DocIconMonoColor = 'Документ (одноцветный)',
|
|
118
118
|
DocsIcon = 'Документы',
|
|
@@ -131,7 +131,7 @@ export enum IconTitleMap {
|
|
|
131
131
|
InterestGrowthIcon = 'Диаграмма роста',
|
|
132
132
|
InterestIcon = 'Скидка',
|
|
133
133
|
JCBIcon = 'JCB',
|
|
134
|
-
|
|
134
|
+
LogoIcon = 'Logo',
|
|
135
135
|
LoupeIcon = 'Лупа',
|
|
136
136
|
MasterCardIcon = 'MasterCard',
|
|
137
137
|
MinusIcon = 'Минус',
|
|
@@ -142,7 +142,7 @@ export enum IconTitleMap {
|
|
|
142
142
|
NewDocIcon = 'Новый документ',
|
|
143
143
|
OfficeIcon = 'Офис',
|
|
144
144
|
OkIcon = 'Лого «Одноклассники»',
|
|
145
|
-
|
|
145
|
+
PackA4Icon = 'PackA4Icon',
|
|
146
146
|
PassSendIcon = 'Бизнес',
|
|
147
147
|
PercentageRoundIcon = 'Проценты (круг.)',
|
|
148
148
|
PercentageSquareIcon = 'Проценты',
|
|
@@ -169,7 +169,7 @@ export enum IconTitleMap {
|
|
|
169
169
|
WalletAddIcon = 'Кошелёк с плюсом',
|
|
170
170
|
WalletIcon = 'Кошелёк',
|
|
171
171
|
WalletWithMoneyIcon = 'Кошелёк с деньгами',
|
|
172
|
-
|
|
172
|
+
WateringCanIcon = 'Добавить продукт',
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
/**
|
|
@@ -177,13 +177,13 @@ export enum IconTitleMap {
|
|
|
177
177
|
* @title Иконка
|
|
178
178
|
* @enumNames [
|
|
179
179
|
* "",
|
|
180
|
-
* 'Деньги', 'Самолет', 'Лого «Apple»', 'Стрелка \'Вниз\'', 'Стрелка', 'Стрелка вверх', 'Банкомат', 'Банк', 'Бургер', 'Календарь 2', 'Скруглённый календарь', 'Календарь', 'Календарь с галочкой', 'Кред. карта', 'Кред. карта под наклоном', 'Кред. карта с галочкой', 'Карта с драгоценностями', 'Машина', 'Деньги внутри кошелька', 'Кино', 'Часы', 'Крестик', 'Кресло', 'Кредитные карты', 'Скидка', 'Скачать документ', 'Документ', 'Документ (одноцветный)', 'Документы', 'Документ с текстом', 'Доллар', 'Зелёная \'галочка\'', 'Земля', 'Пустой кошелёк с возвратом', 'Пустой кошелёк', 'Евро', 'Геолокация', 'Зеркало', 'Глобус', 'Gps', 'Сетка (белая)', 'Диаграмма роста', 'Скидка', 'JCB', 'Logo', 'Лупа', 'MasterCard', 'Минус', 'МИР', 'Деньги', 'Денежное страхование', 'Монитор и мобильный', 'Новый документ', 'Офис', 'Лого «Одноклассники»', '
|
|
180
|
+
* 'Деньги', 'Самолет', 'Лого «Apple»', 'Стрелка \'Вниз\'', 'Стрелка', 'Стрелка вверх', 'Банкомат', 'Банк', 'Бургер', 'Календарь 2', 'Скруглённый календарь', 'Календарь', 'Календарь с галочкой', 'Кред. карта', 'Кред. карта под наклоном', 'Кред. карта с галочкой', 'Карта с драгоценностями', 'Машина', 'Деньги внутри кошелька', 'Кино', 'Часы', 'Крестик', 'Кресло', 'Кредитные карты', 'Скидка', 'Скачать документ', 'Документ', 'Документ (одноцветный)', 'Документы', 'Документ с текстом', 'Доллар', 'Зелёная \'галочка\'', 'Земля', 'Пустой кошелёк с возвратом', 'Пустой кошелёк', 'Евро', 'Геолокация', 'Зеркало', 'Глобус', 'Gps', 'Сетка (белая)', 'Диаграмма роста', 'Скидка', 'JCB', 'Logo', 'Лупа', 'MasterCard', 'Минус', 'МИР', 'Деньги', 'Денежное страхование', 'Монитор и мобильный', 'Новый документ', 'Офис', 'Лого «Одноклассники»', 'PackA4Icon', 'Бизнес', 'Проценты (круг.)', 'Проценты', 'Персональная карта', 'Лого «PlayMarket»', 'Плюс', 'Щит', 'Профиль, 2 персоны', 'Профиль', 'Тыква', 'Рубль (круг.)', 'Сейф', 'Безопасность', 'Подписанные документы', 'Маленькие часы', 'Звук', 'StateMortgageIcon', 'Лого «Telegram»', 'UnionPay', 'Пользователь', 'Visa', 'Лого «VK»', 'Пополнение карты', 'Кошелёк с плюсом', 'Кошелёк', 'Кошелёк с деньгами', 'Добавить продукт'
|
|
181
181
|
* ]
|
|
182
182
|
*/
|
|
183
183
|
export type IconName =
|
|
184
184
|
| ''
|
|
185
185
|
| 'ActualBalanceIcon'
|
|
186
|
-
| '
|
|
186
|
+
| 'AirPlaneIcon'
|
|
187
187
|
| 'AppleIcon'
|
|
188
188
|
| 'ArrowDownIcon'
|
|
189
189
|
| 'ArrowLeftIcon'
|
|
@@ -207,7 +207,7 @@ export type IconName =
|
|
|
207
207
|
| 'ComfortableCompIcon'
|
|
208
208
|
| 'CreditCardsIcon'
|
|
209
209
|
| 'DiscountShapeIcon'
|
|
210
|
-
| '
|
|
210
|
+
| 'DocDownloadIcon'
|
|
211
211
|
| 'DocIcon'
|
|
212
212
|
| 'DocIconMonoColor'
|
|
213
213
|
| 'DocsIcon'
|
|
@@ -226,7 +226,7 @@ export type IconName =
|
|
|
226
226
|
| 'InterestGrowthIcon'
|
|
227
227
|
| 'InterestIcon'
|
|
228
228
|
| 'JCBIcon'
|
|
229
|
-
| '
|
|
229
|
+
| 'LogoIcon'
|
|
230
230
|
| 'LoupeIcon'
|
|
231
231
|
| 'MasterCardIcon'
|
|
232
232
|
| 'MinusIcon'
|
|
@@ -237,7 +237,7 @@ export type IconName =
|
|
|
237
237
|
| 'NewDocIcon'
|
|
238
238
|
| 'OfficeIcon'
|
|
239
239
|
| 'OkIcon'
|
|
240
|
-
| '
|
|
240
|
+
| 'PackA4Icon'
|
|
241
241
|
| 'PassSendIcon'
|
|
242
242
|
| 'PercentageRoundIcon'
|
|
243
243
|
| 'PercentageSquareIcon'
|
|
@@ -264,4 +264,4 @@ export type IconName =
|
|
|
264
264
|
| 'WalletAddIcon'
|
|
265
265
|
| 'WalletIcon'
|
|
266
266
|
| 'WalletWithMoneyIcon'
|
|
267
|
-
| '
|
|
267
|
+
| 'WateringCanIcon';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/model/Picture.ts
CHANGED
|
@@ -1,8 +1,35 @@
|
|
|
1
1
|
import type { IconName } from '../icons/IconName';
|
|
2
2
|
import type { IconVersion } from './IconVersion';
|
|
3
|
+
import { ImageSize } from './ImageSize';
|
|
3
4
|
|
|
4
5
|
export type ImgFormats = 'jpeg' | 'jpg' | 'png' | 'gif' | 'webp' | 'heif' | 'avif';
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @title Позиционирование
|
|
9
|
+
* @enumNames [
|
|
10
|
+
* "Сверху слева",
|
|
11
|
+
* "Сверху по центру",
|
|
12
|
+
* "Сверху справа",
|
|
13
|
+
* "Посередине слева",
|
|
14
|
+
* "Посередине по центру",
|
|
15
|
+
* "Посередине справа",
|
|
16
|
+
* "Снизу слева",
|
|
17
|
+
* "Снизу по центру",
|
|
18
|
+
* "Снизу справа"
|
|
19
|
+
* ]
|
|
20
|
+
* @default "center"
|
|
21
|
+
*/
|
|
22
|
+
export type ImgAlignment =
|
|
23
|
+
| 'northwest'
|
|
24
|
+
| 'north'
|
|
25
|
+
| 'northeast'
|
|
26
|
+
| 'west'
|
|
27
|
+
| 'center'
|
|
28
|
+
| 'east'
|
|
29
|
+
| 'southwest'
|
|
30
|
+
| 'south'
|
|
31
|
+
| 'southeast';
|
|
32
|
+
|
|
6
33
|
export interface Img {
|
|
7
34
|
/** @title Картинка */
|
|
8
35
|
src?: string;
|
|
@@ -19,6 +46,7 @@ export interface Img {
|
|
|
19
46
|
export type MediaQuery = 1919 | 1439 | 1279;
|
|
20
47
|
|
|
21
48
|
export interface ImgSource {
|
|
49
|
+
alignment?: ImgAlignment;
|
|
22
50
|
/** @title Иконка */
|
|
23
51
|
icon?: IconName;
|
|
24
52
|
iconVersion?: IconVersion;
|
|
@@ -30,12 +58,7 @@ export interface ImgSource {
|
|
|
30
58
|
options?: Record<string, any>;
|
|
31
59
|
media?: MediaQuery;
|
|
32
60
|
/** @title Размер изображения */
|
|
33
|
-
size?:
|
|
34
|
-
/** @title Ширина */
|
|
35
|
-
width?: number;
|
|
36
|
-
/** @title Высота */
|
|
37
|
-
height?: number;
|
|
38
|
-
};
|
|
61
|
+
size?: Partial<ImageSize>;
|
|
39
62
|
}
|
|
40
63
|
|
|
41
64
|
/** @title Изображение */
|
|
@@ -1,22 +1,8 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type { ButtonVersion } from '../../model/ButtonVersion';
|
|
3
2
|
import { ButtonInner } from './ButtonInner';
|
|
4
3
|
import type { ButtonWithIconProps } from './ButtonProps';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
|
|
8
|
-
secondary:
|
|
9
|
-
'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
|
|
10
|
-
link: '',
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const buttonDisabledStyleMap: Record<ButtonVersion, string> = {
|
|
14
|
-
primary: 'bg-secondary-dark text-secondary-text',
|
|
15
|
-
secondary: 'bg-secondary-light text-secondary-text',
|
|
16
|
-
link: '',
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const buttonStyle = 'text-center font-sans select-none';
|
|
4
|
+
import { getRegularButtonClasses } from './getRegularButtonClasses';
|
|
5
|
+
import { getDisabledButtonClasses } from './getDisabledButtonClasses';
|
|
20
6
|
|
|
21
7
|
export const Button = JSX<ButtonWithIconProps>((props) => {
|
|
22
8
|
const { text, aboveText, appendLeft, appendRight, children, disabled, rounded, ...rest } = props;
|
|
@@ -43,22 +29,10 @@ export const Button = JSX<ButtonWithIconProps>((props) => {
|
|
|
43
29
|
});
|
|
44
30
|
|
|
45
31
|
const RegularButton = JSX<ButtonWithIconProps>(
|
|
46
|
-
({
|
|
47
|
-
className = '',
|
|
48
|
-
ariaLabel,
|
|
49
|
-
version = 'none',
|
|
50
|
-
rounded,
|
|
51
|
-
href,
|
|
52
|
-
target,
|
|
53
|
-
children,
|
|
54
|
-
onClick,
|
|
55
|
-
...rest
|
|
56
|
-
}) => {
|
|
32
|
+
({ className = '', ariaLabel, version, rounded, href, target, children, onClick, ...rest }) => {
|
|
57
33
|
return (
|
|
58
34
|
<a
|
|
59
|
-
className={
|
|
60
|
-
buttonStyleMap[version] || ''
|
|
61
|
-
} ${rounded ? 'rounded-full' : 'rounded-md'} ${className}`}
|
|
35
|
+
className={getRegularButtonClasses({ className, version, rounded })}
|
|
62
36
|
href={href}
|
|
63
37
|
target={target}
|
|
64
38
|
onClick={onClick}
|
|
@@ -73,16 +47,14 @@ const RegularButton = JSX<ButtonWithIconProps>(
|
|
|
73
47
|
);
|
|
74
48
|
|
|
75
49
|
const DisabledButton = JSX<ButtonWithIconProps>(
|
|
76
|
-
({ className, children, ariaLabel, version
|
|
50
|
+
({ className, children, ariaLabel, version, rounded }) => {
|
|
77
51
|
return (
|
|
78
52
|
<div
|
|
79
53
|
role="button"
|
|
80
54
|
aria-disabled="true"
|
|
81
55
|
aria-label={ariaLabel}
|
|
82
56
|
tabIndex={-1}
|
|
83
|
-
className={
|
|
84
|
-
rounded ? 'rounded-full' : 'rounded-md'
|
|
85
|
-
} ${className || ''}`}
|
|
57
|
+
className={getDisabledButtonClasses({ className, rounded, version })}
|
|
86
58
|
>
|
|
87
59
|
{children}
|
|
88
60
|
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ButtonVersion } from '../../model/ButtonVersion';
|
|
2
|
+
|
|
3
|
+
export const buttonStyleMap: Record<ButtonVersion, string> = {
|
|
4
|
+
primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
|
|
5
|
+
secondary:
|
|
6
|
+
'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
|
|
7
|
+
link: '',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const buttonDisabledStyleMap: Record<ButtonVersion, string> = {
|
|
11
|
+
primary: 'bg-secondary-dark text-secondary-text',
|
|
12
|
+
secondary: 'bg-secondary-light text-secondary-text',
|
|
13
|
+
link: '',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const buttonStyle = 'text-center font-sans select-none';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GetButtonClassParams } from './GetButtonClassParams';
|
|
2
|
+
import { buttonDisabledStyleMap, buttonStyle } from './buttonClassNameConstants';
|
|
3
|
+
|
|
4
|
+
export const getDisabledButtonClasses = ({
|
|
5
|
+
className,
|
|
6
|
+
rounded,
|
|
7
|
+
version,
|
|
8
|
+
}: GetButtonClassParams): string =>
|
|
9
|
+
[
|
|
10
|
+
'inline-block',
|
|
11
|
+
buttonStyle,
|
|
12
|
+
version ? buttonDisabledStyleMap[version] : '',
|
|
13
|
+
rounded ? 'rounded-full' : 'rounded-md',
|
|
14
|
+
className,
|
|
15
|
+
].join(' ');
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GetButtonClassParams } from './GetButtonClassParams';
|
|
2
|
+
import { buttonStyle, buttonStyleMap } from './buttonClassNameConstants';
|
|
3
|
+
|
|
4
|
+
export const getRegularButtonClasses = ({
|
|
5
|
+
className,
|
|
6
|
+
rounded,
|
|
7
|
+
version,
|
|
8
|
+
}: GetButtonClassParams): string =>
|
|
9
|
+
[
|
|
10
|
+
buttonStyle,
|
|
11
|
+
'border border-transparent inline-block cursor-pointer no-underline focus:border-primary-focus focus:border',
|
|
12
|
+
version ? buttonStyleMap[version] : '',
|
|
13
|
+
rounded ? 'rounded-full' : 'rounded-md',
|
|
14
|
+
className,
|
|
15
|
+
].join(' ');
|