@treely/strapi-slices 1.0.0
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/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/components/CreditsAvailableBadge/CreditsAvailableBadge.d.ts +7 -0
- package/dist/components/CreditsAvailableBadge/index.d.ts +2 -0
- package/dist/components/CreditsAvailableBadge/messages.de.d.ts +7 -0
- package/dist/components/CreditsAvailableBadge/messages.en.d.ts +7 -0
- package/dist/components/FullScreenImage/FullScreenImage.d.ts +8 -0
- package/dist/components/FullScreenImage/ZoomableImage.d.ts +7 -0
- package/dist/components/FullScreenImage/index.d.ts +2 -0
- package/dist/components/MinimalProviders/MinimalProviders.d.ts +7 -0
- package/dist/components/MinimalProviders/index.d.ts +2 -0
- package/dist/components/SliceRenderer/SliceRenderer.d.ts +12 -0
- package/dist/components/SliceRenderer/index.d.ts +2 -0
- package/dist/components/StrapiLinkButton/StrapiLinkButton.d.ts +18 -0
- package/dist/components/StrapiLinkButton/index.d.ts +2 -0
- package/dist/components/StrapiLinkButtonWithIcon/StrapiLinkButtonWithIcon.d.ts +7 -0
- package/dist/components/StrapiLinkButtonWithIcon/index.d.ts +2 -0
- package/dist/components/portfolio/Contact/Contact.d.ts +10 -0
- package/dist/components/portfolio/Contact/index.d.ts +2 -0
- package/dist/components/portfolio/DocumentsDownloadList/DocumentsDownloadList.d.ts +6 -0
- package/dist/components/portfolio/DocumentsDownloadList/index.d.ts +2 -0
- package/dist/components/portfolio/DocumentsDownloadList/messages.de.d.ts +5 -0
- package/dist/components/portfolio/DocumentsDownloadList/messages.en.d.ts +5 -0
- package/dist/components/portfolio/ProjectInfo/ProjectInfo.d.ts +18 -0
- package/dist/components/portfolio/ProjectInfo/index.d.ts +2 -0
- package/dist/components/portfolio/ProjectInfo/messages.de.d.ts +15 -0
- package/dist/components/portfolio/ProjectInfo/messages.en.d.ts +15 -0
- package/dist/components/portfolio/SmallCheckout/SmallCheckout.d.ts +13 -0
- package/dist/components/portfolio/SmallCheckout/index.d.ts +2 -0
- package/dist/components/portfolio/SmallCheckout/messages.de.d.ts +16 -0
- package/dist/components/portfolio/SmallCheckout/messages.en.d.ts +16 -0
- package/dist/constants/animations.d.ts +1 -0
- package/dist/constants/api.d.ts +3 -0
- package/dist/constants/breakpoints.d.ts +8 -0
- package/dist/constants/domain.d.ts +2 -0
- package/dist/constants/fontCustomizations.d.ts +6 -0
- package/dist/constants/formatter.d.ts +6 -0
- package/dist/constants/globalStyle.d.ts +1 -0
- package/dist/constants/mapbox.d.ts +17 -0
- package/dist/constants/strapi.d.ts +1 -0
- package/dist/icons/LinkedInIcon.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -0
- package/dist/models/BBox.d.ts +2 -0
- package/dist/models/CreditsAvailableState.d.ts +7 -0
- package/dist/models/Locale.d.ts +2 -0
- package/dist/models/PortfolioProject.d.ts +7 -0
- package/dist/models/forms/CheckoutForm.d.ts +4 -0
- package/dist/models/fpm/FPMProject.d.ts +37 -0
- package/dist/models/fpm/Issuer.d.ts +6 -0
- package/dist/models/strapi/IStrapi.d.ts +4 -0
- package/dist/models/strapi/IStrapiData.d.ts +5 -0
- package/dist/models/strapi/IStrapiResponse.d.ts +13 -0
- package/dist/models/strapi/StrapiAuthor.d.ts +10 -0
- package/dist/models/strapi/StrapiAvatarWithName.d.ts +8 -0
- package/dist/models/strapi/StrapiBanner.d.ts +9 -0
- package/dist/models/strapi/StrapiBlogPost.d.ts +25 -0
- package/dist/models/strapi/StrapiButtonWithVariant.d.ts +6 -0
- package/dist/models/strapi/StrapiCategory.d.ts +8 -0
- package/dist/models/strapi/StrapiContactArea.d.ts +10 -0
- package/dist/models/strapi/StrapiCustomerStory.d.ts +21 -0
- package/dist/models/strapi/StrapiDefaultHeader.d.ts +6 -0
- package/dist/models/strapi/StrapiGlobal.d.ts +26 -0
- package/dist/models/strapi/StrapiGlossaryItem.d.ts +6 -0
- package/dist/models/strapi/StrapiHeroCard.d.ts +13 -0
- package/dist/models/strapi/StrapiImage.d.ts +10 -0
- package/dist/models/strapi/StrapiImageFormat.d.ts +12 -0
- package/dist/models/strapi/StrapiImageWithLink.d.ts +6 -0
- package/dist/models/strapi/StrapiLink.d.ts +11 -0
- package/dist/models/strapi/StrapiLinkList.d.ts +7 -0
- package/dist/models/strapi/StrapiLinkPage.d.ts +10 -0
- package/dist/models/strapi/StrapiLinkWithIcon.d.ts +7 -0
- package/dist/models/strapi/StrapiLocalization.d.ts +7 -0
- package/dist/models/strapi/StrapiMedia.d.ts +27 -0
- package/dist/models/strapi/StrapiMetadata.d.ts +13 -0
- package/dist/models/strapi/StrapiNavMenu.d.ts +13 -0
- package/dist/models/strapi/StrapiPage.d.ts +17 -0
- package/dist/models/strapi/StrapiPortfolio.d.ts +10 -0
- package/dist/models/strapi/StrapiPortfolioCard.d.ts +15 -0
- package/dist/models/strapi/StrapiProject.d.ts +23 -0
- package/dist/models/strapi/StrapiProjectCard.d.ts +18 -0
- package/dist/models/strapi/StrapiQuoteCard.d.ts +7 -0
- package/dist/models/strapi/StrapiShapesCard.d.ts +11 -0
- package/dist/models/strapi/StrapiTextCardWithIcons.d.ts +8 -0
- package/dist/models/strapi/StrapiTopBanner.d.ts +7 -0
- package/dist/rootMessages.de.d.ts +58 -0
- package/dist/rootMessages.en.d.ts +58 -0
- package/dist/slices/Blog/Blog.d.ts +10 -0
- package/dist/slices/Blog/index.d.ts +2 -0
- package/dist/slices/Blog/styles.d.ts +9 -0
- package/dist/slices/BlogCards/BlogCards.d.ts +18 -0
- package/dist/slices/BlogCards/BlogCards.stories.d.ts +5 -0
- package/dist/slices/BlogCards/index.d.ts +2 -0
- package/dist/slices/Comparison/Comparison.d.ts +33 -0
- package/dist/slices/Comparison/Comparison.stories.d.ts +6 -0
- package/dist/slices/Comparison/Icon.d.ts +7 -0
- package/dist/slices/Comparison/index.d.ts +2 -0
- package/dist/slices/Comparison/messages.de.d.ts +4 -0
- package/dist/slices/Comparison/messages.en.d.ts +4 -0
- package/dist/slices/Cta/Cta.d.ts +26 -0
- package/dist/slices/Cta/Cta.stories.d.ts +9 -0
- package/dist/slices/Cta/index.d.ts +2 -0
- package/dist/slices/Cta/messages.de.d.ts +5 -0
- package/dist/slices/Cta/messages.en.d.ts +5 -0
- package/dist/slices/CtaOnly/CtaOnly.d.ts +8 -0
- package/dist/slices/CtaOnly/CtaOnly.stories.d.ts +3 -0
- package/dist/slices/CtaOnly/index.d.ts +2 -0
- package/dist/slices/CustomerStories/CustomerStories.d.ts +10 -0
- package/dist/slices/CustomerStories/CustomerStories.stories.d.ts +3 -0
- package/dist/slices/CustomerStories/index.d.ts +2 -0
- package/dist/slices/CustomerStories/messages.de.d.ts +4 -0
- package/dist/slices/CustomerStories/messages.en.d.ts +4 -0
- package/dist/slices/Facts/Facts.d.ts +16 -0
- package/dist/slices/Facts/Facts.stories.d.ts +7 -0
- package/dist/slices/Facts/index.d.ts +2 -0
- package/dist/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.d.ts +10 -0
- package/dist/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.stories.d.ts +4 -0
- package/dist/slices/FullWidthHighlightQuote/index.d.ts +2 -0
- package/dist/slices/FullWidthImage/FullWidthImage.d.ts +11 -0
- package/dist/slices/FullWidthImage/FullWidthImage.stories.d.ts +5 -0
- package/dist/slices/FullWidthImage/index.d.ts +2 -0
- package/dist/slices/FullWidthImage/styles.d.ts +5 -0
- package/dist/slices/FullWidthImageSlider/FullWidthImageSlider.d.ts +12 -0
- package/dist/slices/FullWidthImageSlider/FullWidthImageSlider.stories.d.ts +3 -0
- package/dist/slices/FullWidthImageSlider/index.d.ts +2 -0
- package/dist/slices/FullWidthImageSlider/styles.d.ts +295 -0
- package/dist/slices/FullWidthImageSlider/utils.d.ts +1 -0
- package/dist/slices/Glossary/Glossary.d.ts +9 -0
- package/dist/slices/Glossary/Glossary.stories.d.ts +3 -0
- package/dist/slices/Glossary/index.d.ts +2 -0
- package/dist/slices/Glossary/messages.de.d.ts +6 -0
- package/dist/slices/Glossary/messages.en.d.ts +6 -0
- package/dist/slices/Hero/Hero.d.ts +17 -0
- package/dist/slices/Hero/Hero.stories.d.ts +9 -0
- package/dist/slices/Hero/index.d.ts +2 -0
- package/dist/slices/Hero/styles.d.ts +17 -0
- package/dist/slices/IconGrid/IconGrid.d.ts +18 -0
- package/dist/slices/IconGrid/IconGrid.stories.d.ts +5 -0
- package/dist/slices/IconGrid/index.d.ts +2 -0
- package/dist/slices/IconGrid/styles.d.ts +9 -0
- package/dist/slices/ImageGrid/ImageGrid.d.ts +18 -0
- package/dist/slices/ImageGrid/ImageGrid.stories.d.ts +5 -0
- package/dist/slices/ImageGrid/index.d.ts +2 -0
- package/dist/slices/ImageGrid/styles.d.ts +5 -0
- package/dist/slices/ImageTextSequence/ImageTextSequence.d.ts +19 -0
- package/dist/slices/ImageTextSequence/ImageTextSequence.stories.d.ts +7 -0
- package/dist/slices/ImageTextSequence/index.d.ts +2 -0
- package/dist/slices/ImageTextSequence/styles.d.ts +13 -0
- package/dist/slices/LeftTextRightCard/LeftTextRightCard.d.ts +17 -0
- package/dist/slices/LeftTextRightCard/LeftTextRightCard.stories.d.ts +8 -0
- package/dist/slices/LeftTextRightCard/index.d.ts +2 -0
- package/dist/slices/LinkCardsGrid/LinkCardsGrid.d.ts +18 -0
- package/dist/slices/LinkCardsGrid/LinkCardsGrid.stories.d.ts +5 -0
- package/dist/slices/LinkCardsGrid/index.d.ts +2 -0
- package/dist/slices/LogoGridWithText/LogoGridWithText.d.ts +12 -0
- package/dist/slices/LogoGridWithText/LogoGridWithText.stories.d.ts +6 -0
- package/dist/slices/LogoGridWithText/index.d.ts +2 -0
- package/dist/slices/LogoGridWithText/styles.d.ts +5 -0
- package/dist/slices/MapHero/MapHero.d.ts +15 -0
- package/dist/slices/MapHero/MapHero.stories.d.ts +8 -0
- package/dist/slices/MapHero/index.d.ts +2 -0
- package/dist/slices/MapHero/styles.d.ts +21 -0
- package/dist/slices/ProjectFacts/ProjectFacts.d.ts +34 -0
- package/dist/slices/ProjectFacts/ProjectFacts.stories.d.ts +6 -0
- package/dist/slices/ProjectFacts/index.d.ts +2 -0
- package/dist/slices/ProjectFacts/messages.de.d.ts +5 -0
- package/dist/slices/ProjectFacts/messages.en.d.ts +5 -0
- package/dist/slices/ProjectsGrid/ProjectsGrid.d.ts +8 -0
- package/dist/slices/ProjectsGrid/ProjectsGrid.stories.d.ts +3 -0
- package/dist/slices/ProjectsGrid/index.d.ts +2 -0
- package/dist/slices/ProjectsMap/MapMarker.d.ts +10 -0
- package/dist/slices/ProjectsMap/ProjectsMap.d.ts +17 -0
- package/dist/slices/ProjectsMap/ProjectsMap.stories.d.ts +6 -0
- package/dist/slices/ProjectsMap/index.d.ts +2 -0
- package/dist/slices/ProjectsMap/messages.de.d.ts +4 -0
- package/dist/slices/ProjectsMap/messages.en.d.ts +4 -0
- package/dist/slices/QAndA/QAndA.d.ts +43 -0
- package/dist/slices/QAndA/QAndA.stories.d.ts +7 -0
- package/dist/slices/QAndA/index.d.ts +2 -0
- package/dist/slices/QuoteCards/QuoteCards.d.ts +15 -0
- package/dist/slices/QuoteCards/QuoteCards.stories.d.ts +8 -0
- package/dist/slices/QuoteCards/index.d.ts +2 -0
- package/dist/slices/QuoteCards/styles.d.ts +13 -0
- package/dist/slices/RichTextSection/RichTextSection.d.ts +7 -0
- package/dist/slices/RichTextSection/RichTextSection.stories.d.ts +3 -0
- package/dist/slices/RichTextSection/index.d.ts +2 -0
- package/dist/slices/ShopCheckout/ShopCheckout.d.ts +16 -0
- package/dist/slices/ShopCheckout/ShopCheckout.stories.d.ts +7 -0
- package/dist/slices/ShopCheckout/index.d.ts +2 -0
- package/dist/slices/ShopCheckout/messages.de.d.ts +15 -0
- package/dist/slices/ShopCheckout/messages.en.d.ts +15 -0
- package/dist/slices/SideBySideImages/SideBySideImages.d.ts +12 -0
- package/dist/slices/SideBySideImages/SideBySideImages.stories.d.ts +3 -0
- package/dist/slices/SideBySideImages/index.d.ts +2 -0
- package/dist/slices/SmallHero/SmallHero.d.ts +20 -0
- package/dist/slices/SmallHero/SmallHero.stories.d.ts +11 -0
- package/dist/slices/SmallHero/index.d.ts +2 -0
- package/dist/slices/SmallHero/styles.d.ts +9 -0
- package/dist/slices/Steps/Steps.d.ts +19 -0
- package/dist/slices/Steps/Steps.stories.d.ts +7 -0
- package/dist/slices/Steps/index.d.ts +2 -0
- package/dist/slices/Steps/styles.d.ts +25 -0
- package/dist/slices/TextCardGrid/TextCardGrid.d.ts +20 -0
- package/dist/slices/TextCardGrid/TextCardGrid.stories.d.ts +8 -0
- package/dist/slices/TextCardGrid/index.d.ts +2 -0
- package/dist/slices/TextCarousel/TextCarousel.d.ts +13 -0
- package/dist/slices/TextCarousel/TextCarousel.stories.d.ts +6 -0
- package/dist/slices/TextCarousel/index.d.ts +2 -0
- package/dist/slices/TextCarousel/styles.d.ts +284 -0
- package/dist/slices/TextWithCard/TextWithCard.d.ts +20 -0
- package/dist/slices/TextWithCard/TextWithCard.stories.d.ts +9 -0
- package/dist/slices/TextWithCard/index.d.ts +2 -0
- package/dist/slices/TextWithTextCards/TextWithTextCards.d.ts +15 -0
- package/dist/slices/TextWithTextCards/TextWithTextCards.stories.d.ts +7 -0
- package/dist/slices/TextWithTextCards/index.d.ts +2 -0
- package/dist/slices/TextWithTextCards/styles.d.ts +5 -0
- package/dist/slices/Video/Video.d.ts +10 -0
- package/dist/slices/Video/Video.stories.d.ts +3 -0
- package/dist/slices/Video/index.d.ts +2 -0
- package/dist/strapi-slices.cjs.development.js +39 -0
- package/dist/strapi-slices.cjs.development.js.map +1 -0
- package/dist/strapi-slices.cjs.production.min.js +2 -0
- package/dist/strapi-slices.cjs.production.min.js.map +1 -0
- package/dist/strapi-slices.esm.js +36 -0
- package/dist/strapi-slices.esm.js.map +1 -0
- package/dist/test/defaultMocks/next.d.ts +2 -0
- package/dist/test/integrationMocks/fpmProjectMock.d.ts +3 -0
- package/dist/test/mocks/portfolioProjectMock.d.ts +3 -0
- package/dist/test/setupTests.d.ts +1 -0
- package/dist/test/storybookMocks/storybookMedia.d.ts +1 -0
- package/dist/test/storybookMocks/storybookStrapiMedia.d.ts +8 -0
- package/dist/test/strapiMocks/minimalGlobalData.d.ts +4 -0
- package/dist/test/strapiMocks/strapiAvatarWithName.d.ts +12 -0
- package/dist/test/strapiMocks/strapiBlogPost.d.ts +3 -0
- package/dist/test/strapiMocks/strapiContact.d.ts +2 -0
- package/dist/test/strapiMocks/strapiCustomerStory.d.ts +3 -0
- package/dist/test/strapiMocks/strapiHeroCard.d.ts +2 -0
- package/dist/test/strapiMocks/strapiLinkPage.d.ts +3 -0
- package/dist/test/strapiMocks/strapiMedia.d.ts +3 -0
- package/dist/test/strapiMocks/strapiMetadata.d.ts +2 -0
- package/dist/test/strapiMocks/strapiPage.d.ts +3 -0
- package/dist/test/strapiMocks/strapiPortfolioCard.d.ts +2 -0
- package/dist/test/strapiMocks/strapiPortfolioMock.d.ts +3 -0
- package/dist/test/strapiMocks/strapiProject.d.ts +3 -0
- package/dist/test/strapiMocks/strapiProjectCard.d.ts +2 -0
- package/dist/test/strapiMocks/strapiQuoteCard.d.ts +2 -0
- package/dist/test/testUtils.d.ts +6 -0
- package/dist/unit.messages.de.d.ts +5 -0
- package/dist/unit.messages.en.d.ts +5 -0
- package/dist/utils/convertAreaM2ToHa.d.ts +2 -0
- package/dist/utils/convertCo2AmountKgToTons.d.ts +2 -0
- package/dist/utils/convertToKebabCase.d.ts +2 -0
- package/dist/utils/getTimeSpanInYears.d.ts +2 -0
- package/dist/utils/mergeBoundingBoxes.d.ts +3 -0
- package/dist/utils/mergeDeep.d.ts +12 -0
- package/dist/utils/openHubSpotChat.d.ts +2 -0
- package/dist/utils/strapiLinkUrl.d.ts +3 -0
- package/dist/utils/strapiMediaUrl.d.ts +5 -0
- package/package.json +132 -0
- package/src/components/CreditsAvailableBadge/CreditsAvailableBadge.test.tsx +65 -0
- package/src/components/CreditsAvailableBadge/CreditsAvailableBadge.tsx +55 -0
- package/src/components/CreditsAvailableBadge/index.ts +3 -0
- package/src/components/CreditsAvailableBadge/messages.de.ts +7 -0
- package/src/components/CreditsAvailableBadge/messages.en.ts +6 -0
- package/src/components/FullScreenImage/FullScreenImage.test.tsx +45 -0
- package/src/components/FullScreenImage/FullScreenImage.tsx +119 -0
- package/src/components/FullScreenImage/ZoomableImage.tsx +84 -0
- package/src/components/FullScreenImage/index.ts +3 -0
- package/src/components/MinimalProviders/MinimalProviders.tsx +25 -0
- package/src/components/MinimalProviders/index.ts +3 -0
- package/src/components/SliceRenderer/SliceRenderer.test.tsx +35 -0
- package/src/components/SliceRenderer/SliceRenderer.tsx +294 -0
- package/src/components/SliceRenderer/index.ts +3 -0
- package/src/components/StrapiLinkButton/StrapiLinkButton.test.tsx +58 -0
- package/src/components/StrapiLinkButton/StrapiLinkButton.tsx +55 -0
- package/src/components/StrapiLinkButton/index.ts +3 -0
- package/src/components/StrapiLinkButtonWithIcon/StrapiLinkButtonWithIcon.test.tsx +57 -0
- package/src/components/StrapiLinkButtonWithIcon/StrapiLinkButtonWithIcon.tsx +36 -0
- package/src/components/StrapiLinkButtonWithIcon/index.ts +3 -0
- package/src/components/portfolio/Contact/Contact.test.tsx +51 -0
- package/src/components/portfolio/Contact/Contact.tsx +73 -0
- package/src/components/portfolio/Contact/index.ts +3 -0
- package/src/components/portfolio/DocumentsDownloadList/DocumentsDownloadList.test.tsx +49 -0
- package/src/components/portfolio/DocumentsDownloadList/DocumentsDownloadList.tsx +76 -0
- package/src/components/portfolio/DocumentsDownloadList/index.ts +3 -0
- package/src/components/portfolio/DocumentsDownloadList/messages.de.ts +6 -0
- package/src/components/portfolio/DocumentsDownloadList/messages.en.ts +6 -0
- package/src/components/portfolio/ProjectInfo/ProjectInfo.test.tsx +81 -0
- package/src/components/portfolio/ProjectInfo/ProjectInfo.tsx +252 -0
- package/src/components/portfolio/ProjectInfo/index.ts +3 -0
- package/src/components/portfolio/ProjectInfo/messages.de.ts +19 -0
- package/src/components/portfolio/ProjectInfo/messages.en.ts +19 -0
- package/src/components/portfolio/SmallCheckout/SmallCheckout.test.tsx +166 -0
- package/src/components/portfolio/SmallCheckout/SmallCheckout.tsx +265 -0
- package/src/components/portfolio/SmallCheckout/index.ts +3 -0
- package/src/components/portfolio/SmallCheckout/messages.de.ts +26 -0
- package/src/components/portfolio/SmallCheckout/messages.en.ts +26 -0
- package/src/constants/animations.ts +1 -0
- package/src/constants/api.ts +5 -0
- package/src/constants/breakpoints.ts +9 -0
- package/src/constants/domain.ts +3 -0
- package/src/constants/fontCustomizations.ts +6 -0
- package/src/constants/formatter.ts +29 -0
- package/src/constants/globalStyle.ts +55 -0
- package/src/constants/mapbox.ts +24 -0
- package/src/constants/strapi.ts +2 -0
- package/src/icons/LinkedInIcon.tsx +23 -0
- package/src/index.tsx +1 -0
- package/src/models/BBox.ts +3 -0
- package/src/models/CreditsAvailableState.ts +8 -0
- package/src/models/Locale.ts +3 -0
- package/src/models/PortfolioProject.ts +9 -0
- package/src/models/forms/CheckoutForm.ts +5 -0
- package/src/models/fpm/FPMProject.ts +41 -0
- package/src/models/fpm/Issuer.ts +7 -0
- package/src/models/strapi/IStrapi.ts +5 -0
- package/src/models/strapi/IStrapiData.ts +6 -0
- package/src/models/strapi/IStrapiResponse.ts +15 -0
- package/src/models/strapi/StrapiAuthor.ts +12 -0
- package/src/models/strapi/StrapiAvatarWithName.ts +10 -0
- package/src/models/strapi/StrapiBanner.ts +11 -0
- package/src/models/strapi/StrapiBlogPost.ts +27 -0
- package/src/models/strapi/StrapiButtonWithVariant.ts +8 -0
- package/src/models/strapi/StrapiCategory.ts +10 -0
- package/src/models/strapi/StrapiContactArea.ts +12 -0
- package/src/models/strapi/StrapiCustomerStory.ts +23 -0
- package/src/models/strapi/StrapiDefaultHeader.ts +7 -0
- package/src/models/strapi/StrapiGlobal.ts +28 -0
- package/src/models/strapi/StrapiGlossaryItem.ts +7 -0
- package/src/models/strapi/StrapiHeroCard.ts +15 -0
- package/src/models/strapi/StrapiImage.ts +12 -0
- package/src/models/strapi/StrapiImageFormat.ts +13 -0
- package/src/models/strapi/StrapiImageWithLink.ts +8 -0
- package/src/models/strapi/StrapiLink.ts +13 -0
- package/src/models/strapi/StrapiLinkList.ts +9 -0
- package/src/models/strapi/StrapiLinkPage.ts +12 -0
- package/src/models/strapi/StrapiLinkWithIcon.ts +9 -0
- package/src/models/strapi/StrapiLocalization.ts +9 -0
- package/src/models/strapi/StrapiMedia.ts +29 -0
- package/src/models/strapi/StrapiMetadata.ts +15 -0
- package/src/models/strapi/StrapiNavMenu.ts +16 -0
- package/src/models/strapi/StrapiPage.ts +19 -0
- package/src/models/strapi/StrapiPortfolio.ts +12 -0
- package/src/models/strapi/StrapiPortfolioCard.ts +17 -0
- package/src/models/strapi/StrapiProject.ts +25 -0
- package/src/models/strapi/StrapiProjectCard.ts +20 -0
- package/src/models/strapi/StrapiQuoteCard.ts +9 -0
- package/src/models/strapi/StrapiShapesCard.ts +13 -0
- package/src/models/strapi/StrapiTextCardWithIcons.ts +10 -0
- package/src/models/strapi/StrapiTopBanner.ts +9 -0
- package/src/rootMessages.de.ts +41 -0
- package/src/rootMessages.en.ts +41 -0
- package/src/slices/Blog/Blog.test.tsx +146 -0
- package/src/slices/Blog/Blog.tsx +114 -0
- package/src/slices/Blog/index.ts +3 -0
- package/src/slices/Blog/styles.ts +34 -0
- package/src/slices/BlogCards/BlogCards.stories.tsx +148 -0
- package/src/slices/BlogCards/BlogCards.test.tsx +277 -0
- package/src/slices/BlogCards/BlogCards.tsx +210 -0
- package/src/slices/BlogCards/index.ts +3 -0
- package/src/slices/Comparison/Comparison.stories.tsx +123 -0
- package/src/slices/Comparison/Comparison.test.tsx +173 -0
- package/src/slices/Comparison/Comparison.tsx +265 -0
- package/src/slices/Comparison/Icon.test.tsx +43 -0
- package/src/slices/Comparison/Icon.tsx +34 -0
- package/src/slices/Comparison/index.ts +3 -0
- package/src/slices/Comparison/messages.de.ts +3 -0
- package/src/slices/Comparison/messages.en.ts +3 -0
- package/src/slices/Cta/Cta.stories.tsx +149 -0
- package/src/slices/Cta/Cta.test.tsx +249 -0
- package/src/slices/Cta/Cta.tsx +412 -0
- package/src/slices/Cta/index.ts +3 -0
- package/src/slices/Cta/messages.de.ts +4 -0
- package/src/slices/Cta/messages.en.ts +4 -0
- package/src/slices/CtaOnly/CtaOnly.stories.tsx +47 -0
- package/src/slices/CtaOnly/CtaOnly.test.tsx +26 -0
- package/src/slices/CtaOnly/CtaOnly.tsx +17 -0
- package/src/slices/CtaOnly/index.ts +3 -0
- package/src/slices/CustomerStories/CustomerStories.stories.tsx +20 -0
- package/src/slices/CustomerStories/CustomerStories.test.tsx +43 -0
- package/src/slices/CustomerStories/CustomerStories.tsx +84 -0
- package/src/slices/CustomerStories/index.ts +3 -0
- package/src/slices/CustomerStories/messages.de.ts +3 -0
- package/src/slices/CustomerStories/messages.en.ts +3 -0
- package/src/slices/Facts/Facts.stories.tsx +97 -0
- package/src/slices/Facts/Facts.test.tsx +99 -0
- package/src/slices/Facts/Facts.tsx +140 -0
- package/src/slices/Facts/index.ts +3 -0
- package/src/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.stories.tsx +41 -0
- package/src/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.test.tsx +39 -0
- package/src/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.tsx +57 -0
- package/src/slices/FullWidthHighlightQuote/index.ts +3 -0
- package/src/slices/FullWidthImage/FullWidthImage.stories.tsx +40 -0
- package/src/slices/FullWidthImage/FullWidthImage.test.tsx +33 -0
- package/src/slices/FullWidthImage/FullWidthImage.tsx +63 -0
- package/src/slices/FullWidthImage/index.ts +3 -0
- package/src/slices/FullWidthImage/styles.ts +17 -0
- package/src/slices/FullWidthImageSlider/FullWidthImageSlider.stories.tsx +75 -0
- package/src/slices/FullWidthImageSlider/FullWidthImageSlider.test.tsx +49 -0
- package/src/slices/FullWidthImageSlider/FullWidthImageSlider.tsx +149 -0
- package/src/slices/FullWidthImageSlider/index.ts +3 -0
- package/src/slices/FullWidthImageSlider/styles.ts +96 -0
- package/src/slices/FullWidthImageSlider/utils.test.ts +10 -0
- package/src/slices/FullWidthImageSlider/utils.ts +17 -0
- package/src/slices/Glossary/Glossary.stories.tsx +42 -0
- package/src/slices/Glossary/Glossary.test.tsx +102 -0
- package/src/slices/Glossary/Glossary.tsx +107 -0
- package/src/slices/Glossary/index.ts +3 -0
- package/src/slices/Glossary/messages.de.ts +7 -0
- package/src/slices/Glossary/messages.en.ts +6 -0
- package/src/slices/Hero/Hero.stories.tsx +129 -0
- package/src/slices/Hero/Hero.test.tsx +89 -0
- package/src/slices/Hero/Hero.tsx +95 -0
- package/src/slices/Hero/index.ts +3 -0
- package/src/slices/Hero/styles.ts +52 -0
- package/src/slices/IconGrid/IconGrid.stories.tsx +178 -0
- package/src/slices/IconGrid/IconGrid.test.tsx +81 -0
- package/src/slices/IconGrid/IconGrid.tsx +97 -0
- package/src/slices/IconGrid/index.ts +3 -0
- package/src/slices/IconGrid/styles.ts +21 -0
- package/src/slices/ImageGrid/ImageGrid.stories.tsx +92 -0
- package/src/slices/ImageGrid/ImageGrid.test.tsx +82 -0
- package/src/slices/ImageGrid/ImageGrid.tsx +89 -0
- package/src/slices/ImageGrid/index.ts +3 -0
- package/src/slices/ImageGrid/styles.ts +12 -0
- package/src/slices/ImageTextSequence/ImageTextSequence.stories.tsx +124 -0
- package/src/slices/ImageTextSequence/ImageTextSequence.test.tsx +91 -0
- package/src/slices/ImageTextSequence/ImageTextSequence.tsx +143 -0
- package/src/slices/ImageTextSequence/index.ts +3 -0
- package/src/slices/ImageTextSequence/styles.ts +33 -0
- package/src/slices/LeftTextRightCard/LeftTextRightCard.stories.tsx +93 -0
- package/src/slices/LeftTextRightCard/LeftTextRightCard.test.tsx +72 -0
- package/src/slices/LeftTextRightCard/LeftTextRightCard.tsx +108 -0
- package/src/slices/LeftTextRightCard/index.ts +3 -0
- package/src/slices/LinkCardsGrid/LinkCardsGrid.stories.tsx +60 -0
- package/src/slices/LinkCardsGrid/LinkCardsGrid.test.tsx +36 -0
- package/src/slices/LinkCardsGrid/LinkCardsGrid.tsx +95 -0
- package/src/slices/LinkCardsGrid/index.ts +3 -0
- package/src/slices/LogoGridWithText/LogoGridWithText.stories.tsx +73 -0
- package/src/slices/LogoGridWithText/LogoGridWithText.test.tsx +55 -0
- package/src/slices/LogoGridWithText/LogoGridWithText.tsx +95 -0
- package/src/slices/LogoGridWithText/index.ts +3 -0
- package/src/slices/LogoGridWithText/styles.ts +13 -0
- package/src/slices/MapHero/MapHero.stories.tsx +112 -0
- package/src/slices/MapHero/MapHero.test.tsx +85 -0
- package/src/slices/MapHero/MapHero.tsx +89 -0
- package/src/slices/MapHero/index.ts +3 -0
- package/src/slices/MapHero/styles.ts +105 -0
- package/src/slices/ProjectFacts/ProjectFacts.stories.tsx +91 -0
- package/src/slices/ProjectFacts/ProjectFacts.test.tsx +34 -0
- package/src/slices/ProjectFacts/ProjectFacts.tsx +95 -0
- package/src/slices/ProjectFacts/index.ts +3 -0
- package/src/slices/ProjectFacts/messages.de.ts +4 -0
- package/src/slices/ProjectFacts/messages.en.ts +4 -0
- package/src/slices/ProjectsGrid/ProjectsGrid.stories.tsx +72 -0
- package/src/slices/ProjectsGrid/ProjectsGrid.test.tsx +31 -0
- package/src/slices/ProjectsGrid/ProjectsGrid.tsx +80 -0
- package/src/slices/ProjectsGrid/index.ts +3 -0
- package/src/slices/ProjectsMap/MapMarker.test.tsx +79 -0
- package/src/slices/ProjectsMap/MapMarker.tsx +99 -0
- package/src/slices/ProjectsMap/ProjectsMap.stories.tsx +101 -0
- package/src/slices/ProjectsMap/ProjectsMap.test.tsx +95 -0
- package/src/slices/ProjectsMap/ProjectsMap.tsx +150 -0
- package/src/slices/ProjectsMap/index.ts +3 -0
- package/src/slices/ProjectsMap/messages.de.ts +3 -0
- package/src/slices/ProjectsMap/messages.en.ts +3 -0
- package/src/slices/QAndA/QAndA.stories.tsx +103 -0
- package/src/slices/QAndA/QAndA.test.tsx +67 -0
- package/src/slices/QAndA/QAndA.tsx +157 -0
- package/src/slices/QAndA/index.ts +3 -0
- package/src/slices/QuoteCards/QuoteCards.stories.tsx +118 -0
- package/src/slices/QuoteCards/QuoteCards.test.tsx +52 -0
- package/src/slices/QuoteCards/QuoteCards.tsx +135 -0
- package/src/slices/QuoteCards/index.ts +3 -0
- package/src/slices/QuoteCards/styles.ts +17 -0
- package/src/slices/RichTextSection/RichTextSection.stories.tsx +27 -0
- package/src/slices/RichTextSection/RichTextSection.test.tsx +20 -0
- package/src/slices/RichTextSection/RichTextSection.tsx +27 -0
- package/src/slices/RichTextSection/index.ts +3 -0
- package/src/slices/ShopCheckout/ShopCheckout.stories.tsx +76 -0
- package/src/slices/ShopCheckout/ShopCheckout.test.tsx +186 -0
- package/src/slices/ShopCheckout/ShopCheckout.tsx +228 -0
- package/src/slices/ShopCheckout/index.ts +3 -0
- package/src/slices/ShopCheckout/messages.de.ts +23 -0
- package/src/slices/ShopCheckout/messages.en.ts +23 -0
- package/src/slices/SideBySideImages/SideBySideImages.stories.tsx +39 -0
- package/src/slices/SideBySideImages/SideBySideImages.test.tsx +52 -0
- package/src/slices/SideBySideImages/SideBySideImages.tsx +57 -0
- package/src/slices/SideBySideImages/index.ts +3 -0
- package/src/slices/SmallHero/SmallHero.stories.tsx +138 -0
- package/src/slices/SmallHero/SmallHero.test.tsx +70 -0
- package/src/slices/SmallHero/SmallHero.tsx +116 -0
- package/src/slices/SmallHero/index.ts +3 -0
- package/src/slices/SmallHero/styles.ts +39 -0
- package/src/slices/Steps/Steps.stories.tsx +95 -0
- package/src/slices/Steps/Steps.test.tsx +68 -0
- package/src/slices/Steps/Steps.tsx +178 -0
- package/src/slices/Steps/index.ts +3 -0
- package/src/slices/Steps/styles.ts +64 -0
- package/src/slices/TextCardGrid/TextCardGrid.stories.tsx +156 -0
- package/src/slices/TextCardGrid/TextCardGrid.test.tsx +103 -0
- package/src/slices/TextCardGrid/TextCardGrid.tsx +285 -0
- package/src/slices/TextCardGrid/index.ts +3 -0
- package/src/slices/TextCarousel/TextCarousel.stories.tsx +104 -0
- package/src/slices/TextCarousel/TextCarousel.test.tsx +90 -0
- package/src/slices/TextCarousel/TextCarousel.tsx +91 -0
- package/src/slices/TextCarousel/index.ts +3 -0
- package/src/slices/TextCarousel/styles.ts +65 -0
- package/src/slices/TextWithCard/TextWithCard.stories.tsx +113 -0
- package/src/slices/TextWithCard/TextWithCard.test.tsx +87 -0
- package/src/slices/TextWithCard/TextWithCard.tsx +115 -0
- package/src/slices/TextWithCard/index.ts +3 -0
- package/src/slices/TextWithTextCards/TextWithTextCards.stories.tsx +121 -0
- package/src/slices/TextWithTextCards/TextWithTextCards.test.tsx +57 -0
- package/src/slices/TextWithTextCards/TextWithTextCards.tsx +167 -0
- package/src/slices/TextWithTextCards/index.ts +3 -0
- package/src/slices/TextWithTextCards/styles.ts +26 -0
- package/src/slices/Video/Video.stories.tsx +18 -0
- package/src/slices/Video/Video.test.tsx +26 -0
- package/src/slices/Video/Video.tsx +35 -0
- package/src/slices/Video/index.ts +3 -0
- package/src/test/defaultMocks/next.ts +29 -0
- package/src/test/integrationMocks/fpmProjectMock.ts +37 -0
- package/src/test/mocks/portfolioProjectMock.ts +11 -0
- package/src/test/setupTests.ts +5 -0
- package/src/test/storybookMocks/storybookMedia.ts +2 -0
- package/src/test/storybookMocks/storybookStrapiMedia.ts +58 -0
- package/src/test/strapiMocks/minimalGlobalData.ts +24 -0
- package/src/test/strapiMocks/strapiAvatarWithName.ts +12 -0
- package/src/test/strapiMocks/strapiBlogPost.ts +216 -0
- package/src/test/strapiMocks/strapiContact.ts +15 -0
- package/src/test/strapiMocks/strapiCustomerStory.ts +195 -0
- package/src/test/strapiMocks/strapiHeroCard.ts +7 -0
- package/src/test/strapiMocks/strapiLinkPage.ts +14 -0
- package/src/test/strapiMocks/strapiMedia.ts +91 -0
- package/src/test/strapiMocks/strapiMetadata.ts +12 -0
- package/src/test/strapiMocks/strapiPage.ts +683 -0
- package/src/test/strapiMocks/strapiPortfolioCard.ts +40 -0
- package/src/test/strapiMocks/strapiPortfolioMock.ts +20 -0
- package/src/test/strapiMocks/strapiProject.ts +34 -0
- package/src/test/strapiMocks/strapiProjectCard.ts +20 -0
- package/src/test/strapiMocks/strapiQuoteCard.ts +8 -0
- package/src/test/testUtils.tsx +25 -0
- package/src/unit.messages.de.ts +4 -0
- package/src/unit.messages.en.ts +4 -0
- package/src/utils/convertAreaM2ToHa.test.ts +9 -0
- package/src/utils/convertAreaM2ToHa.ts +4 -0
- package/src/utils/convertCo2AmountKgToTons.ts +4 -0
- package/src/utils/convertToKebabCase.test.ts +9 -0
- package/src/utils/convertToKebabCase.ts +10 -0
- package/src/utils/getTimeSpanInYears.test.ts +35 -0
- package/src/utils/getTimeSpanInYears.ts +14 -0
- package/src/utils/mergeBoundingBoxes.test.ts +13 -0
- package/src/utils/mergeBoundingBoxes.ts +19 -0
- package/src/utils/mergeDeep.ts +31 -0
- package/src/utils/openHubSpotChat.ts +15 -0
- package/src/utils/strapiLinkUrl.test.ts +26 -0
- package/src/utils/strapiLinkUrl.ts +13 -0
- package/src/utils/strapiMediaUrl.test.ts +54 -0
- package/src/utils/strapiMediaUrl.ts +32 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { strapiMediaMock } from '@/test/strapiMocks/strapiMedia';
|
|
2
|
+
import { mergeDeep } from '@/utils/mergeDeep';
|
|
3
|
+
import { render, screen } from '@/test/testUtils';
|
|
4
|
+
import { ContactProps } from './Contact';
|
|
5
|
+
import Contact from '.';
|
|
6
|
+
import { pushSpy, useRouter } from '../../../../__mocks__/next/router';
|
|
7
|
+
|
|
8
|
+
const defaultProps: ContactProps = {
|
|
9
|
+
title: 'Contact title',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const setup = (props = {}) => {
|
|
13
|
+
const combinedProps = mergeDeep(defaultProps, props);
|
|
14
|
+
render(<Contact {...combinedProps} />);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
describe('The Contact component', () => {
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
pushSpy.mockRestore();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
afterAll(() => {
|
|
23
|
+
useRouter.mockRestore();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('displays the correct title, if it is defined', () => {
|
|
27
|
+
setup();
|
|
28
|
+
|
|
29
|
+
expect(screen.getByText('Contact title')).toBeInTheDocument();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('does not display the title, if it is not defined', () => {
|
|
33
|
+
setup({ title: undefined });
|
|
34
|
+
|
|
35
|
+
expect(screen.queryByText('Contact title')).not.toBeInTheDocument();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('displays the correct text, button and avatar, if they are defined', () => {
|
|
39
|
+
setup({
|
|
40
|
+
...defaultProps,
|
|
41
|
+
text: 'Contact text',
|
|
42
|
+
button: { id: 1, url: 'https://tree.ly', text: 'Button' },
|
|
43
|
+
avatar: { id: 1, alt: 'Alt text', img: { data: strapiMediaMock } },
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
expect(screen.getByText('Contact text')).toBeInTheDocument();
|
|
47
|
+
expect(screen.getByText('Button')).toBeInTheDocument();
|
|
48
|
+
expect(screen.getByRole('link')).toBeInTheDocument();
|
|
49
|
+
expect(screen.getByAltText('Alt text')).toBeInTheDocument();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import StrapiImage from '@/models/strapi/StrapiImage';
|
|
2
|
+
import StrapiLink from '@/models/strapi/StrapiLink';
|
|
3
|
+
import strapiMediaUrl from '@/utils/strapiMediaUrl';
|
|
4
|
+
import { Text, Heading, Flex, Box, Container } from 'boemly';
|
|
5
|
+
import Image from 'next/image';
|
|
6
|
+
import StrapiLinkButton from '@/components/StrapiLinkButton';
|
|
7
|
+
|
|
8
|
+
export interface ContactProps {
|
|
9
|
+
avatar?: StrapiImage;
|
|
10
|
+
title?: string;
|
|
11
|
+
text?: string;
|
|
12
|
+
button?: StrapiLink;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const Contact: React.FC<ContactProps> = ({
|
|
16
|
+
avatar,
|
|
17
|
+
title,
|
|
18
|
+
text,
|
|
19
|
+
button,
|
|
20
|
+
}: ContactProps) => (
|
|
21
|
+
<Container backgroundColor="primary.100" border="none" p="8" height="full">
|
|
22
|
+
<Flex
|
|
23
|
+
flexDir="column"
|
|
24
|
+
justifyContent="center"
|
|
25
|
+
alignItems="center"
|
|
26
|
+
height="full"
|
|
27
|
+
>
|
|
28
|
+
{avatar ? (
|
|
29
|
+
<Box
|
|
30
|
+
position="relative"
|
|
31
|
+
width="20"
|
|
32
|
+
height="20"
|
|
33
|
+
borderRadius="full"
|
|
34
|
+
overflow="hidden"
|
|
35
|
+
>
|
|
36
|
+
<Image
|
|
37
|
+
src={strapiMediaUrl(avatar.img, 'small')}
|
|
38
|
+
alt={avatar.alt}
|
|
39
|
+
fill
|
|
40
|
+
objectFit={avatar.objectFit}
|
|
41
|
+
/>
|
|
42
|
+
</Box>
|
|
43
|
+
) : (
|
|
44
|
+
<></>
|
|
45
|
+
)}
|
|
46
|
+
{title ? (
|
|
47
|
+
<Heading
|
|
48
|
+
mt="6"
|
|
49
|
+
size="md"
|
|
50
|
+
fontWeight="500"
|
|
51
|
+
textAlign="center"
|
|
52
|
+
color="black"
|
|
53
|
+
>
|
|
54
|
+
{title}
|
|
55
|
+
</Heading>
|
|
56
|
+
) : (
|
|
57
|
+
<></>
|
|
58
|
+
)}
|
|
59
|
+
{text ? (
|
|
60
|
+
<Text mt="2" size="smRegularNormal" textAlign="center">
|
|
61
|
+
{text}
|
|
62
|
+
</Text>
|
|
63
|
+
) : (
|
|
64
|
+
<></>
|
|
65
|
+
)}
|
|
66
|
+
{button ? (
|
|
67
|
+
<StrapiLinkButton mt="6" link={button} size="md" variant="outline" />
|
|
68
|
+
) : (
|
|
69
|
+
<></>
|
|
70
|
+
)}
|
|
71
|
+
</Flex>
|
|
72
|
+
</Container>
|
|
73
|
+
);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { render, screen } from '@/test/testUtils';
|
|
2
|
+
import DocumentsDownloadList from '.';
|
|
3
|
+
import { DocumentsDownloadListProps } from './DocumentsDownloadList';
|
|
4
|
+
import messagesEn from './messages.en';
|
|
5
|
+
|
|
6
|
+
const defaultProps: DocumentsDownloadListProps = {
|
|
7
|
+
documentUrls: [
|
|
8
|
+
{
|
|
9
|
+
id: 1,
|
|
10
|
+
url: 'https://example.com/document-1.pdf',
|
|
11
|
+
text: 'Test Document 1',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: 2,
|
|
15
|
+
url: 'https://example.com/document-2.pdf',
|
|
16
|
+
text: 'Test Document 2',
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const setup = (props = {}) => {
|
|
22
|
+
const combinedProps = { ...defaultProps, ...props };
|
|
23
|
+
render(<DocumentsDownloadList {...combinedProps} />);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
describe('The DocumentsDownloadList component', () => {
|
|
27
|
+
it('renders existing documentUrls without errors', async () => {
|
|
28
|
+
setup();
|
|
29
|
+
|
|
30
|
+
expect(await screen.getByText('Test Document 1')).toBeInTheDocument();
|
|
31
|
+
expect(await screen.getByText('Test Document 2')).toBeInTheDocument();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('navigates to the url link when pressing the download button', async () => {
|
|
35
|
+
setup();
|
|
36
|
+
|
|
37
|
+
expect(
|
|
38
|
+
screen.getAllByLabelText(
|
|
39
|
+
messagesEn['features.portfolio.documentsDownloadList.downloadDocument']
|
|
40
|
+
)[0]
|
|
41
|
+
).toHaveAttribute('href', 'https://example.com/document-1.pdf');
|
|
42
|
+
|
|
43
|
+
expect(
|
|
44
|
+
screen.getAllByLabelText(
|
|
45
|
+
messagesEn['features.portfolio.documentsDownloadList.downloadDocument']
|
|
46
|
+
)[1]
|
|
47
|
+
).toHaveAttribute('href', 'https://example.com/document-2.pdf');
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import StrapiLink from '@/models/strapi/StrapiLink';
|
|
2
|
+
import {
|
|
3
|
+
Center,
|
|
4
|
+
Container,
|
|
5
|
+
Flex,
|
|
6
|
+
Heading,
|
|
7
|
+
IconButton,
|
|
8
|
+
Spacer,
|
|
9
|
+
Text,
|
|
10
|
+
} from 'boemly';
|
|
11
|
+
import { DownloadSimple, FilePdf } from '@phosphor-icons/react';
|
|
12
|
+
import Link from 'next/link';
|
|
13
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
14
|
+
|
|
15
|
+
export interface DocumentsDownloadListProps {
|
|
16
|
+
documentUrls: StrapiLink[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const DocumentsDownloadList: React.FC<DocumentsDownloadListProps> = ({
|
|
20
|
+
documentUrls,
|
|
21
|
+
}: DocumentsDownloadListProps) => {
|
|
22
|
+
const { formatMessage } = useIntl();
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Container p="2">
|
|
26
|
+
<Heading size="xl" textAlign="left">
|
|
27
|
+
<FormattedMessage id="features.portfolio.documentsDownloadList.projectDocuments" />
|
|
28
|
+
</Heading>
|
|
29
|
+
|
|
30
|
+
<Flex flexDir="column">
|
|
31
|
+
{documentUrls.map((documentUrl) => (
|
|
32
|
+
<Flex
|
|
33
|
+
justifyContent="space-between"
|
|
34
|
+
alignItems="center"
|
|
35
|
+
mt="6"
|
|
36
|
+
key={documentUrl.text}
|
|
37
|
+
>
|
|
38
|
+
<Flex alignItems="center">
|
|
39
|
+
<Center
|
|
40
|
+
w="8"
|
|
41
|
+
h="8"
|
|
42
|
+
borderRadius="full"
|
|
43
|
+
borderWidth="1px"
|
|
44
|
+
borderColor="grey.200"
|
|
45
|
+
>
|
|
46
|
+
<FilePdf />
|
|
47
|
+
</Center>
|
|
48
|
+
|
|
49
|
+
<Spacer width="4" />
|
|
50
|
+
|
|
51
|
+
<Flex flexDir="column">
|
|
52
|
+
<Text size="smMonoNormal">PDF</Text>
|
|
53
|
+
<Text size="mdLowBold" color="black" textAlign="left">
|
|
54
|
+
{documentUrl.text}
|
|
55
|
+
</Text>
|
|
56
|
+
</Flex>
|
|
57
|
+
</Flex>
|
|
58
|
+
|
|
59
|
+
<Spacer width="32" />
|
|
60
|
+
|
|
61
|
+
<IconButton
|
|
62
|
+
variant="outline"
|
|
63
|
+
aria-label={formatMessage({
|
|
64
|
+
id: 'features.portfolio.documentsDownloadList.downloadDocument',
|
|
65
|
+
})}
|
|
66
|
+
icon={<DownloadSimple />}
|
|
67
|
+
as={Link}
|
|
68
|
+
href={documentUrl.url}
|
|
69
|
+
size="sm"
|
|
70
|
+
/>
|
|
71
|
+
</Flex>
|
|
72
|
+
))}
|
|
73
|
+
</Flex>
|
|
74
|
+
</Container>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { render, screen } from '@/test/testUtils';
|
|
2
|
+
import portfolioProjectMock from '@/test/mocks/portfolioProjectMock';
|
|
3
|
+
import ProjectInfo from '.';
|
|
4
|
+
import { ProjectInfoProps } from './ProjectInfo';
|
|
5
|
+
|
|
6
|
+
const defaultProps: ProjectInfoProps = {
|
|
7
|
+
project: portfolioProjectMock,
|
|
8
|
+
subtitles: {
|
|
9
|
+
areaSubtitle: 'Area subtitle',
|
|
10
|
+
locationSubtitle: 'Location subtitle',
|
|
11
|
+
startSubtitle: 'Start subtitle',
|
|
12
|
+
timeSpanSubtitle: 'Time span subtitle',
|
|
13
|
+
projectTypeSubtitle: 'Project type subtitle',
|
|
14
|
+
projectDeveloperSubtitle: 'Project developer subtitle',
|
|
15
|
+
verificationStandardSubtitle: 'Verification standard subtitle',
|
|
16
|
+
forecastedAmountSubtitle: 'Forecasted amount subtitle',
|
|
17
|
+
riskBufferSubtitle: 'Risk buffer subtitle',
|
|
18
|
+
buyCreditsSubtitle: 'Buy credits subtitle',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const setup = (props = {}) => {
|
|
23
|
+
const combinedProps = { ...defaultProps, ...props };
|
|
24
|
+
render(<ProjectInfo {...combinedProps} />);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
describe('The ProjectInfo component', () => {
|
|
28
|
+
it('renders an existing slice without errors', () => {
|
|
29
|
+
setup();
|
|
30
|
+
|
|
31
|
+
expect(screen.getByText('Project Area')).toBeInTheDocument();
|
|
32
|
+
expect(screen.getByText('Location')).toBeInTheDocument();
|
|
33
|
+
expect(screen.getByText('Project Start Date')).toBeInTheDocument();
|
|
34
|
+
expect(screen.getByText('Project Time Span')).toBeInTheDocument();
|
|
35
|
+
expect(screen.getByText('Project Type')).toBeInTheDocument();
|
|
36
|
+
expect(screen.getByText('Project Developer')).toBeInTheDocument();
|
|
37
|
+
expect(screen.getByText('Verification Standard')).toBeInTheDocument();
|
|
38
|
+
expect(screen.getByText('Project Volume')).toBeInTheDocument();
|
|
39
|
+
expect(screen.getByText('Risk Buffer Share')).toBeInTheDocument();
|
|
40
|
+
|
|
41
|
+
expect(screen.getByText('Area subtitle')).toBeInTheDocument();
|
|
42
|
+
expect(screen.getByText('Location subtitle')).toBeInTheDocument();
|
|
43
|
+
expect(screen.getByText('Start subtitle')).toBeInTheDocument();
|
|
44
|
+
expect(screen.getByText('Time span subtitle')).toBeInTheDocument();
|
|
45
|
+
expect(screen.getByText('Project type subtitle')).toBeInTheDocument();
|
|
46
|
+
expect(screen.getByText('Project developer subtitle')).toBeInTheDocument();
|
|
47
|
+
expect(
|
|
48
|
+
screen.getByText('Verification standard subtitle')
|
|
49
|
+
).toBeInTheDocument();
|
|
50
|
+
expect(screen.getByText('Forecasted amount subtitle')).toBeInTheDocument();
|
|
51
|
+
expect(screen.getByText('Risk buffer subtitle')).toBeInTheDocument();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('counts the time span when they are defined in slice', () => {
|
|
55
|
+
setup({
|
|
56
|
+
...defaultProps,
|
|
57
|
+
project: {
|
|
58
|
+
...defaultProps.project,
|
|
59
|
+
start: new Date(2020, 1, 1),
|
|
60
|
+
end: new Date(2021, 0, 1),
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
expect(screen.getByText('Project Time Span')).toBeInTheDocument();
|
|
65
|
+
expect(screen.getByText('1 year')).toBeInTheDocument();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('displays the issuer of the project if it exists', () => {
|
|
69
|
+
setup({
|
|
70
|
+
project: {
|
|
71
|
+
...portfolioProjectMock,
|
|
72
|
+
defaultIssuer: { name: 'Issuer name', logoUrl: 'https://logo-url.com' },
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
expect(screen.getByRole('img')).toHaveAttribute(
|
|
77
|
+
'src',
|
|
78
|
+
'/_next/image?url=https%3A%2F%2Flogo-url.com&w=3840&q=75'
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
Container,
|
|
4
|
+
Divider,
|
|
5
|
+
Flex,
|
|
6
|
+
Heading,
|
|
7
|
+
LabelTextPair,
|
|
8
|
+
SimpleGrid,
|
|
9
|
+
Spacer,
|
|
10
|
+
} from 'boemly';
|
|
11
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
12
|
+
import Image from 'next/image';
|
|
13
|
+
import convertAreaM2ToHa from '@/utils/convertAreaM2ToHa';
|
|
14
|
+
import convertCo2AmountKgToTons from '@/utils/convertCo2AmountKgToTons';
|
|
15
|
+
import CreditsAvailableBadge from '@/components/CreditsAvailableBadge';
|
|
16
|
+
import PortfolioProject from '@/models/PortfolioProject';
|
|
17
|
+
import {
|
|
18
|
+
FORMAT_AS_HECTARE_CONFIG,
|
|
19
|
+
FORMAT_AS_PERCENT_CONFIG,
|
|
20
|
+
} from '@/constants/formatter';
|
|
21
|
+
import getTimeSpanInYears from '@/utils/getTimeSpanInYears';
|
|
22
|
+
|
|
23
|
+
export interface ProjectInfoProps {
|
|
24
|
+
project: PortfolioProject;
|
|
25
|
+
subtitles: {
|
|
26
|
+
areaSubtitle?: string;
|
|
27
|
+
locationSubtitle?: string;
|
|
28
|
+
startSubtitle?: string;
|
|
29
|
+
timeSpanSubtitle?: string;
|
|
30
|
+
projectTypeSubtitle?: string;
|
|
31
|
+
projectDeveloperSubtitle?: string;
|
|
32
|
+
verificationStandardSubtitle?: string;
|
|
33
|
+
forecastedAmountSubtitle?: string;
|
|
34
|
+
riskBufferSubtitle?: string;
|
|
35
|
+
buyCreditsSubtitle?: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const ProjectInfo: React.FC<ProjectInfoProps> = ({
|
|
40
|
+
project,
|
|
41
|
+
subtitles,
|
|
42
|
+
}: ProjectInfoProps) => {
|
|
43
|
+
const { formatMessage, formatNumber, formatDate } = useIntl();
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Container p="2" width="full">
|
|
47
|
+
<Heading size="xl" textAlign="left">
|
|
48
|
+
<FormattedMessage id="features.projectInfo.projectInfo.value" />
|
|
49
|
+
</Heading>
|
|
50
|
+
|
|
51
|
+
<Spacer height="8" />
|
|
52
|
+
|
|
53
|
+
<SimpleGrid
|
|
54
|
+
columns={[1, null, null, 2]}
|
|
55
|
+
gap="8"
|
|
56
|
+
spacingX="10"
|
|
57
|
+
spacingY="8"
|
|
58
|
+
>
|
|
59
|
+
{project.area && (
|
|
60
|
+
<Box>
|
|
61
|
+
<LabelTextPair
|
|
62
|
+
label={formatMessage({
|
|
63
|
+
id: 'features.projectInfo.properties.area',
|
|
64
|
+
})}
|
|
65
|
+
text={formatNumber(
|
|
66
|
+
convertAreaM2ToHa(project.area.toString()),
|
|
67
|
+
FORMAT_AS_HECTARE_CONFIG
|
|
68
|
+
)}
|
|
69
|
+
caption={subtitles.areaSubtitle}
|
|
70
|
+
/>
|
|
71
|
+
</Box>
|
|
72
|
+
)}
|
|
73
|
+
|
|
74
|
+
{project.location && (
|
|
75
|
+
<Box>
|
|
76
|
+
<LabelTextPair
|
|
77
|
+
label={formatMessage({
|
|
78
|
+
id: 'features.projectInfo.properties.location',
|
|
79
|
+
})}
|
|
80
|
+
text={project.location}
|
|
81
|
+
caption={subtitles.locationSubtitle}
|
|
82
|
+
/>
|
|
83
|
+
</Box>
|
|
84
|
+
)}
|
|
85
|
+
|
|
86
|
+
{project.start && (
|
|
87
|
+
<Box>
|
|
88
|
+
<LabelTextPair
|
|
89
|
+
label={formatMessage({
|
|
90
|
+
id: 'features.projectInfo.properties.start',
|
|
91
|
+
})}
|
|
92
|
+
text={formatDate(project.start, {
|
|
93
|
+
year: 'numeric',
|
|
94
|
+
month: 'long',
|
|
95
|
+
})}
|
|
96
|
+
caption={subtitles.startSubtitle}
|
|
97
|
+
/>
|
|
98
|
+
</Box>
|
|
99
|
+
)}
|
|
100
|
+
|
|
101
|
+
{project.start && project.end && (
|
|
102
|
+
<Box>
|
|
103
|
+
<LabelTextPair
|
|
104
|
+
label={formatMessage({
|
|
105
|
+
id: 'features.projectInfo.properties.timeSpan',
|
|
106
|
+
})}
|
|
107
|
+
text={formatMessage(
|
|
108
|
+
{
|
|
109
|
+
id: 'features.projectInfo.properties.year',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
years: getTimeSpanInYears(
|
|
113
|
+
new Date(project.start),
|
|
114
|
+
new Date(project.end)
|
|
115
|
+
),
|
|
116
|
+
}
|
|
117
|
+
)}
|
|
118
|
+
caption={subtitles.timeSpanSubtitle}
|
|
119
|
+
/>
|
|
120
|
+
</Box>
|
|
121
|
+
)}
|
|
122
|
+
</SimpleGrid>
|
|
123
|
+
|
|
124
|
+
{project.projectType ||
|
|
125
|
+
project.projectDeveloper ||
|
|
126
|
+
project.verificationStandard ? (
|
|
127
|
+
<>
|
|
128
|
+
<Spacer height="6" />
|
|
129
|
+
<Divider />
|
|
130
|
+
<Spacer height="6" />
|
|
131
|
+
</>
|
|
132
|
+
) : (
|
|
133
|
+
<></>
|
|
134
|
+
)}
|
|
135
|
+
<SimpleGrid columns={[1, null, null, 2]} spacingX="10" spacingY="8">
|
|
136
|
+
{project.projectType && (
|
|
137
|
+
<Box>
|
|
138
|
+
<LabelTextPair
|
|
139
|
+
label={formatMessage({
|
|
140
|
+
id: 'features.projectInfo.properties.projectType',
|
|
141
|
+
})}
|
|
142
|
+
text={project.projectType.title}
|
|
143
|
+
caption={subtitles.projectTypeSubtitle}
|
|
144
|
+
/>
|
|
145
|
+
</Box>
|
|
146
|
+
)}
|
|
147
|
+
{project.projectDeveloper && (
|
|
148
|
+
<Box>
|
|
149
|
+
<LabelTextPair
|
|
150
|
+
label={formatMessage({
|
|
151
|
+
id: 'features.projectInfo.properties.projectDeveloper',
|
|
152
|
+
})}
|
|
153
|
+
text={project.projectDeveloper.name}
|
|
154
|
+
caption={subtitles.projectDeveloperSubtitle}
|
|
155
|
+
/>
|
|
156
|
+
</Box>
|
|
157
|
+
)}
|
|
158
|
+
</SimpleGrid>
|
|
159
|
+
|
|
160
|
+
{project.verificationStandard ? (
|
|
161
|
+
<>
|
|
162
|
+
{project.projectType || project.projectDeveloper ? (
|
|
163
|
+
<Spacer height="6" />
|
|
164
|
+
) : (
|
|
165
|
+
<></>
|
|
166
|
+
)}
|
|
167
|
+
<Flex justifyContent="space-between" alignItems="center">
|
|
168
|
+
<Box>
|
|
169
|
+
<LabelTextPair
|
|
170
|
+
label={formatMessage({
|
|
171
|
+
id: 'features.projectInfo.properties.verificationStandard.label',
|
|
172
|
+
})}
|
|
173
|
+
text={formatMessage({
|
|
174
|
+
id: `features.projectInfo.properties.verificationStandard.value.${project.verificationStandard.id}`,
|
|
175
|
+
defaultMessage: project.verificationStandard.id,
|
|
176
|
+
})}
|
|
177
|
+
caption={subtitles.verificationStandardSubtitle}
|
|
178
|
+
/>
|
|
179
|
+
</Box>
|
|
180
|
+
|
|
181
|
+
{project.defaultIssuer && (
|
|
182
|
+
<Box position="relative" width="14" height="8">
|
|
183
|
+
<Image
|
|
184
|
+
src={project.defaultIssuer.logoUrl}
|
|
185
|
+
alt={`${project.defaultIssuer.name} logo`}
|
|
186
|
+
fill
|
|
187
|
+
style={{ objectFit: 'contain' }}
|
|
188
|
+
/>
|
|
189
|
+
</Box>
|
|
190
|
+
)}
|
|
191
|
+
</Flex>
|
|
192
|
+
</>
|
|
193
|
+
) : (
|
|
194
|
+
<></>
|
|
195
|
+
)}
|
|
196
|
+
|
|
197
|
+
{project.forecastedAmountYearly && project.riskBuffer ? (
|
|
198
|
+
<>
|
|
199
|
+
<Spacer height="8" />
|
|
200
|
+
<Divider />
|
|
201
|
+
<Spacer height="8" />
|
|
202
|
+
<SimpleGrid columns={[1, null, null, 2]} spacingX="10" spacingY="8">
|
|
203
|
+
<Box>
|
|
204
|
+
<LabelTextPair
|
|
205
|
+
label={formatMessage({
|
|
206
|
+
id: 'features.projectInfo.properties.forecastedAmountYear.label',
|
|
207
|
+
})}
|
|
208
|
+
text={formatMessage(
|
|
209
|
+
{
|
|
210
|
+
id: 'unit.formatter.tonsCo2PerYear',
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
number: formatNumber(
|
|
214
|
+
convertCo2AmountKgToTons(
|
|
215
|
+
project.forecastedAmountYearly.toString()
|
|
216
|
+
),
|
|
217
|
+
{ maximumFractionDigits: 0 }
|
|
218
|
+
),
|
|
219
|
+
}
|
|
220
|
+
)}
|
|
221
|
+
caption={subtitles.forecastedAmountSubtitle}
|
|
222
|
+
/>
|
|
223
|
+
</Box>
|
|
224
|
+
|
|
225
|
+
<Box>
|
|
226
|
+
<LabelTextPair
|
|
227
|
+
label={formatMessage({
|
|
228
|
+
id: 'features.projectInfo.properties.riskBuffer',
|
|
229
|
+
})}
|
|
230
|
+
text={formatNumber(
|
|
231
|
+
project.riskBuffer / 100,
|
|
232
|
+
FORMAT_AS_PERCENT_CONFIG
|
|
233
|
+
)}
|
|
234
|
+
caption={subtitles.riskBufferSubtitle}
|
|
235
|
+
/>
|
|
236
|
+
</Box>
|
|
237
|
+
</SimpleGrid>
|
|
238
|
+
</>
|
|
239
|
+
) : (
|
|
240
|
+
<></>
|
|
241
|
+
)}
|
|
242
|
+
|
|
243
|
+
{project.creditsAvailable ? (
|
|
244
|
+
<Box mt="2">
|
|
245
|
+
<CreditsAvailableBadge status={project.creditsAvailable} />
|
|
246
|
+
</Box>
|
|
247
|
+
) : (
|
|
248
|
+
<></>
|
|
249
|
+
)}
|
|
250
|
+
</Container>
|
|
251
|
+
);
|
|
252
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'features.projectInfo.projectInfo.value': 'Projekt Infos',
|
|
3
|
+
'features.projectInfo.properties.area': 'Projekt Fläche',
|
|
4
|
+
'features.projectInfo.properties.location': 'Standort',
|
|
5
|
+
'features.projectInfo.properties.start': 'Projekt Start Datum',
|
|
6
|
+
'features.projectInfo.properties.timeSpan': 'Projekt Zeitraum',
|
|
7
|
+
'features.projectInfo.properties.projectType': 'Projekt Typ',
|
|
8
|
+
'features.projectInfo.properties.projectDeveloper': 'Projekt Entwickler',
|
|
9
|
+
'features.projectInfo.properties.verificationStandard.label':
|
|
10
|
+
'Verifizierungsstandard',
|
|
11
|
+
'features.projectInfo.properties.verificationStandard.value.SilvaconsultFCSISO14':
|
|
12
|
+
'SILVACONSULT® Forest Carbon Standard, ISO 14064-2',
|
|
13
|
+
'features.projectInfo.properties.forecastedAmountYear.label':
|
|
14
|
+
'Projektvolumen',
|
|
15
|
+
'features.projectInfo.properties.riskBuffer': 'Anteil Risikopuffer',
|
|
16
|
+
|
|
17
|
+
'features.projectInfo.properties.year':
|
|
18
|
+
'{years} {years, plural, one {Jahr} other {Jahre} }',
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'features.projectInfo.projectInfo.value': 'Project Infos',
|
|
3
|
+
'features.projectInfo.properties.area': 'Project Area',
|
|
4
|
+
'features.projectInfo.properties.location': 'Location',
|
|
5
|
+
'features.projectInfo.properties.start': 'Project Start Date',
|
|
6
|
+
'features.projectInfo.properties.timeSpan': 'Project Time Span',
|
|
7
|
+
'features.projectInfo.properties.projectType': 'Project Type',
|
|
8
|
+
'features.projectInfo.properties.projectDeveloper': 'Project Developer',
|
|
9
|
+
'features.projectInfo.properties.verificationStandard.label':
|
|
10
|
+
'Verification Standard',
|
|
11
|
+
'features.projectInfo.properties.verificationStandard.value.SilvaconsultFCSISO14':
|
|
12
|
+
'SILVACONSULT® Forest Carbon Standard, ISO 14064-2',
|
|
13
|
+
'features.projectInfo.properties.forecastedAmountYear.label':
|
|
14
|
+
'Project Volume',
|
|
15
|
+
'features.projectInfo.properties.riskBuffer': 'Risk Buffer Share',
|
|
16
|
+
|
|
17
|
+
'features.projectInfo.properties.year':
|
|
18
|
+
'{years} {years, plural, one {year} other {years} }',
|
|
19
|
+
};
|