@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,121 @@
|
|
|
1
|
+
import { StoryFn, Meta } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
storybookStrapiAvatarMock,
|
|
5
|
+
storybookStrapiGradientTopDownMock,
|
|
6
|
+
storybookStrapiTreeIconMock,
|
|
7
|
+
} from '@/test/storybookMocks/storybookStrapiMedia';
|
|
8
|
+
import TextWithTextCards from '.';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: 'sections/TextWithTextCards',
|
|
12
|
+
component: TextWithTextCards,
|
|
13
|
+
} as Meta<typeof TextWithTextCards>;
|
|
14
|
+
|
|
15
|
+
const Template: StoryFn<typeof TextWithTextCards> = (args) => (
|
|
16
|
+
<TextWithTextCards {...args} />
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const cards = [
|
|
20
|
+
{
|
|
21
|
+
id: 1,
|
|
22
|
+
title: 'Title 1',
|
|
23
|
+
text: 'Text 1',
|
|
24
|
+
icon: {
|
|
25
|
+
id: 1,
|
|
26
|
+
alt: 'Icon alt text',
|
|
27
|
+
img: { data: storybookStrapiTreeIconMock },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 2,
|
|
32
|
+
title: 'Title 2',
|
|
33
|
+
text: 'Text 2',
|
|
34
|
+
icon: {
|
|
35
|
+
id: 1,
|
|
36
|
+
alt: 'Icon alt text',
|
|
37
|
+
img: { data: storybookStrapiTreeIconMock },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 3,
|
|
42
|
+
title: 'Title 3',
|
|
43
|
+
text: 'Text 3',
|
|
44
|
+
icon: {
|
|
45
|
+
id: 1,
|
|
46
|
+
alt: 'Icon alt text',
|
|
47
|
+
img: { data: storybookStrapiTreeIconMock },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
const contact = {
|
|
53
|
+
id: 1,
|
|
54
|
+
title: 'Title',
|
|
55
|
+
text: 'Text',
|
|
56
|
+
avatar: {
|
|
57
|
+
id: 1,
|
|
58
|
+
name: 'Avatar name',
|
|
59
|
+
description: 'Avatar description',
|
|
60
|
+
image: {
|
|
61
|
+
id: 1,
|
|
62
|
+
alt: 'Image alt text',
|
|
63
|
+
img: { data: storybookStrapiAvatarMock },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
button: { id: 1, text: 'Button', url: 'https://tree.ly' },
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const Minimal = Template.bind({});
|
|
70
|
+
Minimal.args = {
|
|
71
|
+
slice: {
|
|
72
|
+
title: 'Title',
|
|
73
|
+
cards,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const WithTagline = Template.bind({});
|
|
78
|
+
WithTagline.args = {
|
|
79
|
+
slice: {
|
|
80
|
+
tagline: 'Tagline',
|
|
81
|
+
title: 'Title',
|
|
82
|
+
cards,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const WithTaglineAndText = Template.bind({});
|
|
87
|
+
WithTaglineAndText.args = {
|
|
88
|
+
slice: {
|
|
89
|
+
tagline: 'Tagline',
|
|
90
|
+
title: 'Title',
|
|
91
|
+
text: 'Text',
|
|
92
|
+
cards,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const WithContact = Template.bind({});
|
|
97
|
+
WithContact.args = {
|
|
98
|
+
slice: {
|
|
99
|
+
tagline: 'Tagline',
|
|
100
|
+
title: 'Title',
|
|
101
|
+
text: 'Text',
|
|
102
|
+
cards,
|
|
103
|
+
contact,
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const WithShape = Template.bind({});
|
|
108
|
+
WithShape.args = {
|
|
109
|
+
slice: {
|
|
110
|
+
tagline: 'Tagline',
|
|
111
|
+
title: 'Title',
|
|
112
|
+
text: 'Text',
|
|
113
|
+
cards,
|
|
114
|
+
contact,
|
|
115
|
+
shape: {
|
|
116
|
+
id: 1,
|
|
117
|
+
alt: 'Shape alt text',
|
|
118
|
+
img: { data: storybookStrapiGradientTopDownMock },
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { render, screen } from '@/test/testUtils';
|
|
2
|
+
import { strapiMediaMock } from '@/test/strapiMocks/strapiMedia';
|
|
3
|
+
import { strapiContactMock } from '@/test/strapiMocks/strapiContact';
|
|
4
|
+
import TextWithTextCards from '.';
|
|
5
|
+
import { TextWithTextCardsProps } from './TextWithTextCards';
|
|
6
|
+
|
|
7
|
+
const defaultProps: TextWithTextCardsProps = {
|
|
8
|
+
slice: {
|
|
9
|
+
title: 'Title',
|
|
10
|
+
cards: [
|
|
11
|
+
{
|
|
12
|
+
id: 1,
|
|
13
|
+
title: 'Card title',
|
|
14
|
+
text: 'Card text',
|
|
15
|
+
icon: { id: 1, alt: 'Alt text 1', img: { data: strapiMediaMock } },
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const setup = (props = {}) => {
|
|
22
|
+
const combinedProps = { ...defaultProps, ...props };
|
|
23
|
+
render(<TextWithTextCards {...combinedProps} />);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
describe('The TextWithTextCards component', () => {
|
|
27
|
+
it('displays the section header', () => {
|
|
28
|
+
setup();
|
|
29
|
+
|
|
30
|
+
expect(screen.getByTestId('default-section-header')).toBeInTheDocument();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('displays the card', () => {
|
|
34
|
+
setup();
|
|
35
|
+
|
|
36
|
+
expect(
|
|
37
|
+
screen.getByText(defaultProps.slice.cards[0].title)
|
|
38
|
+
).toBeInTheDocument();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('displays the contact area if there is contact area data in the slice', () => {
|
|
42
|
+
setup({ slice: { ...defaultProps.slice, contact: strapiContactMock } });
|
|
43
|
+
|
|
44
|
+
expect(screen.getByText(strapiContactMock.text)).toBeInTheDocument();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('displays the shape if there is shape in the slice', () => {
|
|
48
|
+
setup({
|
|
49
|
+
slice: {
|
|
50
|
+
...defaultProps.slice,
|
|
51
|
+
shape: { id: 1, alt: 'Alt text', img: { data: strapiMediaMock } },
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
expect(screen.getAllByRole('img')[0]).toHaveAttribute('alt', 'Alt text');
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ContactArea,
|
|
3
|
+
DefaultSectionContainer,
|
|
4
|
+
DefaultSectionHeader,
|
|
5
|
+
Grid,
|
|
6
|
+
GridItem,
|
|
7
|
+
TextCardWithIcon,
|
|
8
|
+
useMediaQuery,
|
|
9
|
+
useToken,
|
|
10
|
+
Wrapper,
|
|
11
|
+
} from 'boemly';
|
|
12
|
+
import Image from 'next/image';
|
|
13
|
+
import { useRouter } from 'next/router';
|
|
14
|
+
import { BREAKPOINT_LG_QUERY } from '@/constants/breakpoints';
|
|
15
|
+
import strapiMediaUrl from '@/utils/strapiMediaUrl';
|
|
16
|
+
import strapiLinkUrl from '@/utils/strapiLinkUrl';
|
|
17
|
+
import StrapiDefaultHeader from '@/models/strapi/StrapiDefaultHeader';
|
|
18
|
+
import StrapiContactArea from '@/models/strapi/StrapiContactArea';
|
|
19
|
+
import StrapiTextCardWithIcon from '@/models/strapi/StrapiTextCardWithIcons';
|
|
20
|
+
import StrapiImage from '@/models/strapi/StrapiImage';
|
|
21
|
+
import { ShapeContainer } from './styles';
|
|
22
|
+
|
|
23
|
+
interface TextWithTextCardsSlice extends StrapiDefaultHeader {
|
|
24
|
+
cards: StrapiTextCardWithIcon[];
|
|
25
|
+
contact?: StrapiContactArea;
|
|
26
|
+
shape?: StrapiImage;
|
|
27
|
+
}
|
|
28
|
+
export interface TextWithTextCardsProps {
|
|
29
|
+
slice: TextWithTextCardsSlice;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const TextWithTextCards: React.FC<TextWithTextCardsProps> = ({
|
|
33
|
+
slice,
|
|
34
|
+
}: TextWithTextCardsProps) => {
|
|
35
|
+
const { push } = useRouter();
|
|
36
|
+
const [white] = useToken('colors', ['white']);
|
|
37
|
+
const [belowBreakpoint] = useMediaQuery(BREAKPOINT_LG_QUERY);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<DefaultSectionContainer backgroundColor={white} title={slice.title}>
|
|
41
|
+
<>
|
|
42
|
+
{slice.shape && (
|
|
43
|
+
<ShapeContainer>
|
|
44
|
+
<Image
|
|
45
|
+
src={strapiMediaUrl(slice.shape.img, 'medium')}
|
|
46
|
+
alt={slice.shape.alt}
|
|
47
|
+
fill
|
|
48
|
+
style={{ objectFit: slice.shape.objectFit || 'cover' }}
|
|
49
|
+
/>
|
|
50
|
+
</ShapeContainer>
|
|
51
|
+
)}
|
|
52
|
+
</>
|
|
53
|
+
<Wrapper>
|
|
54
|
+
<>
|
|
55
|
+
<Grid
|
|
56
|
+
templateColumns={[
|
|
57
|
+
'repeat(8, 1fr)',
|
|
58
|
+
null,
|
|
59
|
+
null,
|
|
60
|
+
null,
|
|
61
|
+
'repeat(16, 1fr)',
|
|
62
|
+
]}
|
|
63
|
+
templateRows={[
|
|
64
|
+
'repeat(2, auto)',
|
|
65
|
+
null,
|
|
66
|
+
null,
|
|
67
|
+
null,
|
|
68
|
+
'repeat(1, auto)',
|
|
69
|
+
]}
|
|
70
|
+
rowGap="12"
|
|
71
|
+
>
|
|
72
|
+
<GridItem
|
|
73
|
+
colSpan={[8, null, null, null, 9]}
|
|
74
|
+
rowSpan={1}
|
|
75
|
+
pr={['0', null, null, null, '32']}
|
|
76
|
+
>
|
|
77
|
+
<DefaultSectionHeader
|
|
78
|
+
tagline={slice.tagline}
|
|
79
|
+
title={slice.title}
|
|
80
|
+
text={slice.text}
|
|
81
|
+
textProps={{ pr: ['0', null, null, null, '10'] }}
|
|
82
|
+
/>
|
|
83
|
+
|
|
84
|
+
{slice.contact && !belowBreakpoint && (
|
|
85
|
+
<ContactArea
|
|
86
|
+
title={slice.contact.title}
|
|
87
|
+
text={slice.contact.text}
|
|
88
|
+
avatar={{
|
|
89
|
+
name: slice.contact.avatar.name,
|
|
90
|
+
description: slice.contact.avatar.description,
|
|
91
|
+
image: (
|
|
92
|
+
<Image
|
|
93
|
+
src={strapiMediaUrl(
|
|
94
|
+
slice.contact.avatar.image.img,
|
|
95
|
+
'small'
|
|
96
|
+
)}
|
|
97
|
+
alt={slice.contact.avatar.image.alt}
|
|
98
|
+
fill
|
|
99
|
+
style={{
|
|
100
|
+
objectFit:
|
|
101
|
+
slice.contact.avatar.image.objectFit || 'cover',
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
104
|
+
),
|
|
105
|
+
}}
|
|
106
|
+
link={{
|
|
107
|
+
text: slice.contact.button.text,
|
|
108
|
+
onClick: () => push(strapiLinkUrl(slice.contact?.button)),
|
|
109
|
+
}}
|
|
110
|
+
/>
|
|
111
|
+
)}
|
|
112
|
+
</GridItem>
|
|
113
|
+
<GridItem
|
|
114
|
+
colSpan={[8, null, null, null, 7]}
|
|
115
|
+
rowSpan={1}
|
|
116
|
+
position="relative"
|
|
117
|
+
>
|
|
118
|
+
{slice.cards.map((card) => (
|
|
119
|
+
<TextCardWithIcon
|
|
120
|
+
key={card.id}
|
|
121
|
+
title={card.title}
|
|
122
|
+
text={card.text}
|
|
123
|
+
icon={
|
|
124
|
+
<Image
|
|
125
|
+
src={strapiMediaUrl(card.icon.img, 'small')}
|
|
126
|
+
alt={card.icon.alt}
|
|
127
|
+
fill
|
|
128
|
+
style={{ objectFit: card.icon.objectFit || 'contain' }}
|
|
129
|
+
/>
|
|
130
|
+
}
|
|
131
|
+
/>
|
|
132
|
+
))}
|
|
133
|
+
</GridItem>
|
|
134
|
+
</Grid>
|
|
135
|
+
{slice.contact && belowBreakpoint && (
|
|
136
|
+
<ContactArea
|
|
137
|
+
title={slice.contact.title}
|
|
138
|
+
text={slice.contact.text}
|
|
139
|
+
avatar={{
|
|
140
|
+
name: slice.contact.avatar.name,
|
|
141
|
+
description: slice.contact.avatar.description,
|
|
142
|
+
image: (
|
|
143
|
+
<Image
|
|
144
|
+
src={strapiMediaUrl(
|
|
145
|
+
slice.contact.avatar.image.img,
|
|
146
|
+
'small'
|
|
147
|
+
)}
|
|
148
|
+
alt={slice.contact.avatar.image.alt}
|
|
149
|
+
fill
|
|
150
|
+
style={{
|
|
151
|
+
objectFit:
|
|
152
|
+
slice.contact.avatar.image.objectFit || 'cover',
|
|
153
|
+
}}
|
|
154
|
+
/>
|
|
155
|
+
),
|
|
156
|
+
}}
|
|
157
|
+
link={{
|
|
158
|
+
text: slice.contact.button.text,
|
|
159
|
+
onClick: () => push(strapiLinkUrl(slice.contact?.button)),
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
162
|
+
)}
|
|
163
|
+
</>
|
|
164
|
+
</Wrapper>
|
|
165
|
+
</DefaultSectionContainer>
|
|
166
|
+
);
|
|
167
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import { BREAKPOINT_LG } from '@/constants/breakpoints';
|
|
3
|
+
|
|
4
|
+
export const ShapeContainer = styled.div`
|
|
5
|
+
position: absolute;
|
|
6
|
+
right: calc(var(--boemly-space-136) * -1);
|
|
7
|
+
top: calc((var(--boemly-space-28)) * -1);
|
|
8
|
+
|
|
9
|
+
width: var(--boemly-sizes-4xl);
|
|
10
|
+
height: var(--boemly-sizes-4xl);
|
|
11
|
+
|
|
12
|
+
@media screen and (max-width: ${BREAKPOINT_LG}) {
|
|
13
|
+
width: var(--boemly-sizes-sm);
|
|
14
|
+
height: var(--boemly-sizes-sm);
|
|
15
|
+
|
|
16
|
+
right: calc(var(--boemly-space-28) * -1);
|
|
17
|
+
top: var(--boemly-space-96);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
border-bottom-right-radius: var(--boemly-radii-full);
|
|
21
|
+
|
|
22
|
+
& span,
|
|
23
|
+
div {
|
|
24
|
+
border-bottom-right-radius: var(--boemly-radii-full);
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StoryFn, Meta } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import Video from '.';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'sections/Video',
|
|
7
|
+
component: Video,
|
|
8
|
+
} as Meta<typeof Video>;
|
|
9
|
+
|
|
10
|
+
const Template: StoryFn<typeof Video> = (args) => <Video {...args} />;
|
|
11
|
+
|
|
12
|
+
export const Default = Template.bind({});
|
|
13
|
+
Default.args = {
|
|
14
|
+
slice: {
|
|
15
|
+
title: 'Title',
|
|
16
|
+
youTubeID: 'QnzFqtWIJCI',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { render, screen } from '@/test/testUtils';
|
|
2
|
+
import Video from '.';
|
|
3
|
+
import { VideoProps } from './Video';
|
|
4
|
+
|
|
5
|
+
const defaultProps: VideoProps = {
|
|
6
|
+
slice: {
|
|
7
|
+
title: 'Title',
|
|
8
|
+
youTubeID: 'youTubeID',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const setup = (props = {}) => {
|
|
13
|
+
const combinedProps = { ...defaultProps, ...props };
|
|
14
|
+
render(<Video {...combinedProps} />);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
describe('The Video component', () => {
|
|
18
|
+
it('displays an iframe with a video', () => {
|
|
19
|
+
setup();
|
|
20
|
+
|
|
21
|
+
expect(screen.getByTestId('video-iframe')).toHaveAttribute(
|
|
22
|
+
'src',
|
|
23
|
+
'https://www.youtube.com/embed/youTubeID'
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Box, DefaultSectionContainer, Wrapper } from 'boemly';
|
|
2
|
+
import { useMeasure } from 'react-use';
|
|
3
|
+
|
|
4
|
+
interface VideoSlice {
|
|
5
|
+
youTubeID: string;
|
|
6
|
+
title: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface VideoProps {
|
|
10
|
+
slice: VideoSlice;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Video: React.FC<VideoProps> = ({ slice }: VideoProps) => {
|
|
14
|
+
const [ref, { width }] = useMeasure<HTMLDivElement>();
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<DefaultSectionContainer>
|
|
18
|
+
<Wrapper>
|
|
19
|
+
<Box ref={ref} borderRadius="xl">
|
|
20
|
+
<iframe
|
|
21
|
+
data-testid="video-iframe"
|
|
22
|
+
width={width}
|
|
23
|
+
height={(width / 16) * 9}
|
|
24
|
+
src={`https://www.youtube.com/embed/${slice.youTubeID}`}
|
|
25
|
+
frameBorder="0"
|
|
26
|
+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
|
27
|
+
allowFullScreen
|
|
28
|
+
title={slice.title}
|
|
29
|
+
style={{ borderRadius: 'var(--boemly-radii-xl)' }}
|
|
30
|
+
/>
|
|
31
|
+
</Box>
|
|
32
|
+
</Wrapper>
|
|
33
|
+
</DefaultSectionContainer>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { NextRouter } from 'next/router';
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_USE_ROUTER_RETURN_VALUE: NextRouter = {
|
|
4
|
+
asPath: '/',
|
|
5
|
+
back: jest.fn(),
|
|
6
|
+
basePath: '',
|
|
7
|
+
beforePopState: jest.fn(),
|
|
8
|
+
events: {
|
|
9
|
+
emit: jest.fn(),
|
|
10
|
+
off: jest.fn(),
|
|
11
|
+
on: jest.fn(),
|
|
12
|
+
},
|
|
13
|
+
isFallback: false,
|
|
14
|
+
isLocaleDomain: true,
|
|
15
|
+
isPreview: false,
|
|
16
|
+
isReady: true,
|
|
17
|
+
pathname: '/',
|
|
18
|
+
prefetch: jest.fn(),
|
|
19
|
+
push: jest.fn(),
|
|
20
|
+
query: {},
|
|
21
|
+
reload: jest.fn(),
|
|
22
|
+
replace: jest.fn(),
|
|
23
|
+
route: '/',
|
|
24
|
+
defaultLocale: 'en',
|
|
25
|
+
domainLocales: [],
|
|
26
|
+
locale: 'en',
|
|
27
|
+
locales: ['en', 'de'],
|
|
28
|
+
forward: jest.fn(),
|
|
29
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import FPMProject from '@/models/fpm/FPMProject';
|
|
2
|
+
|
|
3
|
+
const fpmProjectMock: FPMProject = {
|
|
4
|
+
id: '1',
|
|
5
|
+
title: 'Project 1',
|
|
6
|
+
geom: {
|
|
7
|
+
type: 'Point',
|
|
8
|
+
coordinates: [10.036542145100883, 47.42636837845707],
|
|
9
|
+
},
|
|
10
|
+
area: 1400000,
|
|
11
|
+
location: 'Austria',
|
|
12
|
+
start: new Date('2020-01-01'),
|
|
13
|
+
end: new Date('2050-12-31'),
|
|
14
|
+
projectType: {
|
|
15
|
+
title: 'Project Type 1',
|
|
16
|
+
id: '1',
|
|
17
|
+
createdAt: new Date('2020-01-01'),
|
|
18
|
+
updatedAt: new Date('2020-01-01'),
|
|
19
|
+
},
|
|
20
|
+
projectDeveloper: {
|
|
21
|
+
name: 'Project Developer 1',
|
|
22
|
+
id: '1',
|
|
23
|
+
createdAt: new Date('2020-01-01'),
|
|
24
|
+
updatedAt: new Date('2020-01-01'),
|
|
25
|
+
},
|
|
26
|
+
verificationStandard: {
|
|
27
|
+
id: 'SilvaconsultFCSISO14',
|
|
28
|
+
createdAt: new Date('2020-01-01'),
|
|
29
|
+
updatedAt: new Date('2020-01-01'),
|
|
30
|
+
},
|
|
31
|
+
forecastedAmountYearly: 100,
|
|
32
|
+
riskBuffer: 10,
|
|
33
|
+
createdAt: new Date('2020-01-01'),
|
|
34
|
+
updatedAt: new Date('2020-01-01'),
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default fpmProjectMock;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import CreditsAvailableState from '@/models/CreditsAvailableState';
|
|
2
|
+
import PortfolioProject from '@/models/PortfolioProject';
|
|
3
|
+
import fpmProjectMock from '@/test/integrationMocks/fpmProjectMock';
|
|
4
|
+
|
|
5
|
+
const portfolioProjectMock: PortfolioProject = {
|
|
6
|
+
...fpmProjectMock,
|
|
7
|
+
creditsAvailable: CreditsAvailableState.YES,
|
|
8
|
+
slug: 'portfolio-slug',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default portfolioProjectMock;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import IStrapiData from '@/models/strapi/IStrapiData';
|
|
2
|
+
import StrapiMedia from '@/models/strapi/StrapiMedia';
|
|
3
|
+
import { strapiMediaMock } from '../strapiMocks/strapiMedia';
|
|
4
|
+
import { storybookAvatarUrl } from './storybookMedia';
|
|
5
|
+
|
|
6
|
+
export const storybookStrapiAvatarMock: IStrapiData<StrapiMedia> = {
|
|
7
|
+
...strapiMediaMock,
|
|
8
|
+
attributes: {
|
|
9
|
+
...strapiMediaMock.attributes,
|
|
10
|
+
formats: {},
|
|
11
|
+
url: storybookAvatarUrl,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const storybookStrapiCoverMock: IStrapiData<StrapiMedia> = {
|
|
16
|
+
...strapiMediaMock,
|
|
17
|
+
attributes: {
|
|
18
|
+
...strapiMediaMock.attributes,
|
|
19
|
+
formats: {},
|
|
20
|
+
url: 'https://cdn.tree.ly/storybook/v1/cover.jpeg',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const storybookStrapiGradientTopDownMock: IStrapiData<StrapiMedia> = {
|
|
25
|
+
...strapiMediaMock,
|
|
26
|
+
attributes: {
|
|
27
|
+
...strapiMediaMock.attributes,
|
|
28
|
+
formats: {},
|
|
29
|
+
url: 'https://cdn.tree.ly/storybook/v1/shape_gradient_top_down.png',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const storybookStrapiGradientBottomUpMock: IStrapiData<StrapiMedia> = {
|
|
34
|
+
...strapiMediaMock,
|
|
35
|
+
attributes: {
|
|
36
|
+
...strapiMediaMock.attributes,
|
|
37
|
+
formats: {},
|
|
38
|
+
url: 'https://cdn.tree.ly/storybook/v1/shape_gradient_buttom_up.png',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const storybookStrapiTreeIconMock: IStrapiData<StrapiMedia> = {
|
|
43
|
+
...strapiMediaMock,
|
|
44
|
+
attributes: {
|
|
45
|
+
...strapiMediaMock.attributes,
|
|
46
|
+
formats: {},
|
|
47
|
+
url: 'https://cdn.tree.ly/storybook/v1/icon_tree.png',
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const storybookStrapiMapMock: IStrapiData<StrapiMedia> = {
|
|
52
|
+
...strapiMediaMock,
|
|
53
|
+
attributes: {
|
|
54
|
+
...strapiMediaMock.attributes,
|
|
55
|
+
formats: {},
|
|
56
|
+
url: 'https://cdn.tree.ly/storybook/v1/map.jpeg',
|
|
57
|
+
},
|
|
58
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import IStrapiData from '@/models/strapi/IStrapiData';
|
|
2
|
+
import StrapiGlobal from '@/models/strapi/StrapiGlobal';
|
|
3
|
+
import { strapiMediaMock } from './strapiMedia';
|
|
4
|
+
import { strapiMetadataMock } from './strapiMetadata';
|
|
5
|
+
|
|
6
|
+
const minimalGlobalData: IStrapiData<StrapiGlobal> = {
|
|
7
|
+
id: 1,
|
|
8
|
+
attributes: {
|
|
9
|
+
metadata: strapiMetadataMock,
|
|
10
|
+
favicon: { data: strapiMediaMock },
|
|
11
|
+
metaTitleSuffix: 'Meta title suffix',
|
|
12
|
+
navbar: {
|
|
13
|
+
id: 1,
|
|
14
|
+
navMenus: undefined,
|
|
15
|
+
buttons: undefined,
|
|
16
|
+
},
|
|
17
|
+
footer: {
|
|
18
|
+
id: 1,
|
|
19
|
+
links: undefined,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default minimalGlobalData;
|