@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,47 @@
|
|
|
1
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
2
|
+
import CtaOnly from '.';
|
|
3
|
+
import RichTextSection from '../RichTextSection';
|
|
4
|
+
import { RichTextSectionProps } from '../RichTextSection/RichTextSection';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'sections/CTAOnly',
|
|
8
|
+
component: CtaOnly,
|
|
9
|
+
subcomponents: { RichTextSection },
|
|
10
|
+
} as Meta<typeof CtaOnly>;
|
|
11
|
+
|
|
12
|
+
const richTextWithTitleArgs: RichTextSectionProps = {
|
|
13
|
+
slice: {
|
|
14
|
+
content: `
|
|
15
|
+
# Heading 1
|
|
16
|
+
This is some rich text that is not part of the CtaOnly section.
|
|
17
|
+
The actual CtaOnly section is only the button below.
|
|
18
|
+
`,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const richTextArgs: RichTextSectionProps = {
|
|
23
|
+
slice: {
|
|
24
|
+
content: `
|
|
25
|
+
This is some rich text that is also not part of the CtaOnly section.
|
|
26
|
+
`,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const Template: StoryFn<typeof CtaOnly> = (args) => (
|
|
31
|
+
<>
|
|
32
|
+
<RichTextSection {...richTextWithTitleArgs} />
|
|
33
|
+
<CtaOnly {...args} />
|
|
34
|
+
<RichTextSection {...richTextArgs} />
|
|
35
|
+
</>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export const WithRichText = Template.bind({});
|
|
39
|
+
WithRichText.args = {
|
|
40
|
+
slice: {
|
|
41
|
+
button: {
|
|
42
|
+
id: 1,
|
|
43
|
+
text: 'Button',
|
|
44
|
+
url: 'https://tree.ly',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { render, screen } from '@/test/testUtils';
|
|
2
|
+
import { CtaOnlyProps } from './CtaOnly';
|
|
3
|
+
import CtaOnly from '.';
|
|
4
|
+
|
|
5
|
+
const defaultProps: CtaOnlyProps = {
|
|
6
|
+
slice: {
|
|
7
|
+
button: {
|
|
8
|
+
id: 1,
|
|
9
|
+
text: 'Link',
|
|
10
|
+
url: 'url',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const setup = () => {
|
|
16
|
+
render(<CtaOnly {...defaultProps} />);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
describe('The CTAOnly component', () => {
|
|
20
|
+
it('displays a link', () => {
|
|
21
|
+
setup();
|
|
22
|
+
|
|
23
|
+
expect(screen.getByRole('link')).toBeInTheDocument();
|
|
24
|
+
expect(screen.getByText('Link')).toBeInTheDocument();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Box, Wrapper } from 'boemly';
|
|
2
|
+
import StrapiLinkButton from '@/components/StrapiLinkButton';
|
|
3
|
+
import StrapiLink from '@/models/strapi/StrapiLink';
|
|
4
|
+
|
|
5
|
+
export interface CtaOnlyProps {
|
|
6
|
+
slice: {
|
|
7
|
+
button: StrapiLink;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const CtaOnly: React.FC<CtaOnlyProps> = ({ slice }: CtaOnlyProps) => (
|
|
12
|
+
<Wrapper>
|
|
13
|
+
<Box position="absolute" top="-28" transform="translateY(50%)">
|
|
14
|
+
<StrapiLinkButton size="md" link={slice.button} />
|
|
15
|
+
</Box>
|
|
16
|
+
</Wrapper>
|
|
17
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { strapiCustomerStoryMock } from '@/test/strapiMocks/strapiCustomerStory';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
import CustomerStories from '.';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'sections/CustomerStories',
|
|
7
|
+
component: CustomerStories,
|
|
8
|
+
} as Meta<typeof CustomerStories>;
|
|
9
|
+
|
|
10
|
+
const Template: StoryFn<typeof CustomerStories> = (args) => (
|
|
11
|
+
<CustomerStories {...args} />
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const Minimal = Template.bind({});
|
|
15
|
+
Minimal.args = {
|
|
16
|
+
slice: {
|
|
17
|
+
customer_stories: [strapiCustomerStoryMock],
|
|
18
|
+
},
|
|
19
|
+
customerStories: [strapiCustomerStoryMock],
|
|
20
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { render, screen } from '@/test/testUtils';
|
|
2
|
+
import { mergeDeep } from '@/utils/mergeDeep';
|
|
3
|
+
import { strapiCustomerStoryMock } from '@/test/strapiMocks/strapiCustomerStory';
|
|
4
|
+
import { CustomerStoriesProps } from './CustomerStories';
|
|
5
|
+
import CustomerStories from '.';
|
|
6
|
+
|
|
7
|
+
const defaultProps: CustomerStoriesProps = {
|
|
8
|
+
slice: {
|
|
9
|
+
customer_stories: [
|
|
10
|
+
{
|
|
11
|
+
...strapiCustomerStoryMock,
|
|
12
|
+
attributes: {
|
|
13
|
+
...strapiCustomerStoryMock.attributes,
|
|
14
|
+
createdAt: '2022-01-10T15:04:32.897Z',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
customerStories: [strapiCustomerStoryMock],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const setup = (props = {}) => {
|
|
23
|
+
const combinedProps = mergeDeep(defaultProps, props);
|
|
24
|
+
render(<CustomerStories {...combinedProps} />);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
describe('The CustomerStories component', () => {
|
|
28
|
+
it('displays all the customer story titles', () => {
|
|
29
|
+
setup();
|
|
30
|
+
|
|
31
|
+
expect(
|
|
32
|
+
screen.getByText(strapiCustomerStoryMock.attributes.title)
|
|
33
|
+
).toBeInTheDocument();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('displays nothing if the customer story that should be displayed does not exists in the delivered customer stories', () => {
|
|
37
|
+
setup({ customerStories: [] });
|
|
38
|
+
|
|
39
|
+
expect(
|
|
40
|
+
screen.queryByText(strapiCustomerStoryMock.attributes.title)
|
|
41
|
+
).not.toBeInTheDocument();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import IStrapiData from '@/models/strapi/IStrapiData';
|
|
2
|
+
import StrapiCustomerStory from '@/models/strapi/StrapiCustomerStory';
|
|
3
|
+
import strapiMediaUrl from '@/utils/strapiMediaUrl';
|
|
4
|
+
import {
|
|
5
|
+
Box,
|
|
6
|
+
Button,
|
|
7
|
+
Center,
|
|
8
|
+
Container,
|
|
9
|
+
DefaultSectionContainer,
|
|
10
|
+
Heading,
|
|
11
|
+
SimpleGrid,
|
|
12
|
+
Text,
|
|
13
|
+
Wrapper,
|
|
14
|
+
} from 'boemly';
|
|
15
|
+
import Image from 'next/image';
|
|
16
|
+
import Link from 'next/link';
|
|
17
|
+
import { FormattedMessage } from 'react-intl';
|
|
18
|
+
|
|
19
|
+
export interface CustomerStoriesProps {
|
|
20
|
+
slice: {
|
|
21
|
+
customer_stories: IStrapiData<StrapiCustomerStory>[];
|
|
22
|
+
};
|
|
23
|
+
customerStories: IStrapiData<StrapiCustomerStory>[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const CustomerStories = ({
|
|
27
|
+
slice,
|
|
28
|
+
customerStories,
|
|
29
|
+
}: CustomerStoriesProps): JSX.Element => (
|
|
30
|
+
<DefaultSectionContainer>
|
|
31
|
+
<Wrapper>
|
|
32
|
+
<SimpleGrid columns={[1, null, null, 2]} spacingX={56} spacingY={24}>
|
|
33
|
+
{slice.customer_stories.map(({ attributes }) => {
|
|
34
|
+
const customerStory: IStrapiData<StrapiCustomerStory> | undefined =
|
|
35
|
+
customerStories.find(
|
|
36
|
+
(cs) => cs.attributes.slug === attributes.slug
|
|
37
|
+
);
|
|
38
|
+
if (!customerStory) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
return (
|
|
42
|
+
<Container padding="none" key={customerStory.id}>
|
|
43
|
+
<Center
|
|
44
|
+
height="24"
|
|
45
|
+
backgroundColor="primary.50"
|
|
46
|
+
borderTopRadius="xl"
|
|
47
|
+
>
|
|
48
|
+
<Box position="relative" height="12" width="12">
|
|
49
|
+
<Image
|
|
50
|
+
src={strapiMediaUrl(
|
|
51
|
+
customerStory.attributes.customerLogo.img,
|
|
52
|
+
'medium'
|
|
53
|
+
)}
|
|
54
|
+
alt={customerStory.attributes.customerLogo.alt}
|
|
55
|
+
fill
|
|
56
|
+
style={{
|
|
57
|
+
objectFit:
|
|
58
|
+
customerStory.attributes.customerLogo.objectFit,
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
</Box>
|
|
62
|
+
</Center>
|
|
63
|
+
<Box px="6" pt="12" pb="6">
|
|
64
|
+
<Text size="xsMonoUppercase" color="gray.500" mb="2">
|
|
65
|
+
{customerStory.attributes.customerIndustry}
|
|
66
|
+
</Text>
|
|
67
|
+
<Heading size="xl">{customerStory.attributes.title}</Heading>
|
|
68
|
+
<Button
|
|
69
|
+
as={Link}
|
|
70
|
+
href={`/customer-stories/${customerStory.attributes.slug}`}
|
|
71
|
+
variant="outline"
|
|
72
|
+
size="sm"
|
|
73
|
+
mt="12"
|
|
74
|
+
>
|
|
75
|
+
<FormattedMessage id="sections.customerStories.more" />
|
|
76
|
+
</Button>
|
|
77
|
+
</Box>
|
|
78
|
+
</Container>
|
|
79
|
+
);
|
|
80
|
+
})}
|
|
81
|
+
</SimpleGrid>
|
|
82
|
+
</Wrapper>
|
|
83
|
+
</DefaultSectionContainer>
|
|
84
|
+
);
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
2
|
+
import Facts from '.';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'sections/Facts',
|
|
6
|
+
component: Facts,
|
|
7
|
+
} as Meta<typeof Facts>;
|
|
8
|
+
|
|
9
|
+
const Template: StoryFn<typeof Facts> = (args) => <Facts {...args} />;
|
|
10
|
+
|
|
11
|
+
export const Minimal = Template.bind({});
|
|
12
|
+
Minimal.args = {
|
|
13
|
+
slice: {
|
|
14
|
+
variant: 'gray',
|
|
15
|
+
facts: [
|
|
16
|
+
{ key: 'Key 1', value: 'Value 1' },
|
|
17
|
+
{ key: 'Key 2', value: 'Value 2' },
|
|
18
|
+
{ key: 'Key 3', value: 'Value 3' },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const WithTitle = Template.bind({});
|
|
24
|
+
WithTitle.args = {
|
|
25
|
+
slice: {
|
|
26
|
+
tagline: 'Tagline',
|
|
27
|
+
title: 'Title',
|
|
28
|
+
subTitle: 'Sub title',
|
|
29
|
+
variant: 'gray',
|
|
30
|
+
facts: [
|
|
31
|
+
{ key: 'Key 1', value: 'Value 1' },
|
|
32
|
+
{ key: 'Key 2', value: 'Value 2' },
|
|
33
|
+
{ key: 'Key 3', value: 'Value 3' },
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const WithButton = Template.bind({});
|
|
39
|
+
WithButton.args = {
|
|
40
|
+
slice: {
|
|
41
|
+
button: {
|
|
42
|
+
id: 1,
|
|
43
|
+
text: 'Button',
|
|
44
|
+
url: 'https://tree.ly',
|
|
45
|
+
},
|
|
46
|
+
variant: 'gray',
|
|
47
|
+
facts: [
|
|
48
|
+
{ key: 'Key 1', value: 'Value 1' },
|
|
49
|
+
{ key: 'Key 2', value: 'Value 2' },
|
|
50
|
+
{ key: 'Key 3', value: 'Value 3' },
|
|
51
|
+
{ key: 'Key 4', value: 'Value 4' },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const Green = Template.bind({});
|
|
57
|
+
Green.args = {
|
|
58
|
+
slice: {
|
|
59
|
+
tagline: 'Tagline',
|
|
60
|
+
title: 'Title',
|
|
61
|
+
subTitle: 'Sub title',
|
|
62
|
+
button: {
|
|
63
|
+
id: 1,
|
|
64
|
+
text: 'Button',
|
|
65
|
+
url: 'https://tree.ly',
|
|
66
|
+
},
|
|
67
|
+
variant: 'green',
|
|
68
|
+
facts: [
|
|
69
|
+
{ key: 'Key 1', value: 'Value 1' },
|
|
70
|
+
{ key: 'Key 2', value: 'Value 2' },
|
|
71
|
+
{ key: 'Key 3', value: 'Value 3' },
|
|
72
|
+
{ key: 'Key 4', value: 'Value 4' },
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const White = Template.bind({});
|
|
78
|
+
White.args = {
|
|
79
|
+
slice: {
|
|
80
|
+
tagline: 'Tagline',
|
|
81
|
+
title: 'Title',
|
|
82
|
+
subTitle: 'Sub title',
|
|
83
|
+
variant: 'white',
|
|
84
|
+
button: {
|
|
85
|
+
id: 1,
|
|
86
|
+
text: 'Button',
|
|
87
|
+
url: 'https://tree.ly',
|
|
88
|
+
},
|
|
89
|
+
facts: [
|
|
90
|
+
{ key: 'Key 1', value: 'Value 1' },
|
|
91
|
+
{ key: 'Key 2', value: 'Value 2' },
|
|
92
|
+
{ key: 'Key 3', value: 'Value 3' },
|
|
93
|
+
{ key: 'Key 4', value: 'Value 4' },
|
|
94
|
+
{ key: 'Key 5', value: 'Value 5' },
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { render, screen } from '@/test/testUtils';
|
|
2
|
+
import Facts from '.';
|
|
3
|
+
import { FactsProps } from './Facts';
|
|
4
|
+
|
|
5
|
+
const defaultProps: FactsProps = {
|
|
6
|
+
slice: {
|
|
7
|
+
variant: 'gray',
|
|
8
|
+
facts: [
|
|
9
|
+
{ key: 'Fact 1', value: 'Value 1' },
|
|
10
|
+
{ key: 'Fact 2', value: 'Value 2' },
|
|
11
|
+
{ key: 'Fact 3', value: 'Value 3' },
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const setup = (props = {}) => {
|
|
17
|
+
const combinedProps = { ...defaultProps, ...props };
|
|
18
|
+
render(<Facts {...combinedProps} />);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
describe('The Facts component', () => {
|
|
22
|
+
it('displays a link if there is a button in the slice', () => {
|
|
23
|
+
setup({
|
|
24
|
+
slice: { ...defaultProps.slice, button: { url: 'url', text: 'Link' } },
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
expect(screen.getByRole('link')).toBeInTheDocument();
|
|
28
|
+
expect(screen.getByText('Link')).toBeInTheDocument();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('displays the chakra-button with css-e5zvm4 class if the slice.variant is gray', () => {
|
|
32
|
+
setup({
|
|
33
|
+
slice: { ...defaultProps.slice, button: { url: 'url', text: 'Link' } },
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
expect(screen.getByRole('link')).toHaveClass('chakra-button css-e5zvm4');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('displays the chakra-button with css-y35h5g class if the slice.variant is green', () => {
|
|
40
|
+
setup({
|
|
41
|
+
slice: {
|
|
42
|
+
...defaultProps.slice,
|
|
43
|
+
variant: 'green',
|
|
44
|
+
button: { url: 'url', text: 'Link' },
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
expect(screen.getByRole('link')).toHaveClass('chakra-button css-y35h5g');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('displays the title header when slice.title is defined', () => {
|
|
52
|
+
setup({
|
|
53
|
+
slice: {
|
|
54
|
+
...defaultProps.slice,
|
|
55
|
+
title: 'Test Title',
|
|
56
|
+
tagline: 'Test Tagline',
|
|
57
|
+
subTitle: 'Test Subtitle',
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
expect(screen.getByText('Test Title')).toBeInTheDocument();
|
|
62
|
+
expect(screen.getByText('Test Tagline')).toBeInTheDocument();
|
|
63
|
+
expect(screen.getByText('Test Subtitle')).toBeInTheDocument();
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('does not display the title header when slice.title is undefined', () => {
|
|
67
|
+
setup({
|
|
68
|
+
slice: {
|
|
69
|
+
...defaultProps.slice,
|
|
70
|
+
tagline: 'Test Tagline',
|
|
71
|
+
subTitle: 'Test Subtitle',
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
expect(screen.queryByText('Test Tagline')).toBeNull();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('displays the facts', () => {
|
|
79
|
+
setup({
|
|
80
|
+
slice: {
|
|
81
|
+
...defaultProps.slice,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
expect(screen.getByText('Fact 1')).toBeInTheDocument();
|
|
86
|
+
expect(screen.getByText('Fact 2')).toBeInTheDocument();
|
|
87
|
+
expect(screen.getByText('Fact 3')).toBeInTheDocument();
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('does not display a link if the button in the slice is undefined', () => {
|
|
91
|
+
setup({
|
|
92
|
+
slice: {
|
|
93
|
+
...defaultProps.slice,
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
expect(screen.queryByRole('button')).not.toBeInTheDocument();
|
|
98
|
+
});
|
|
99
|
+
});
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DefaultSectionContainer,
|
|
3
|
+
DefaultSectionHeader,
|
|
4
|
+
Flex,
|
|
5
|
+
Heading,
|
|
6
|
+
Spacer,
|
|
7
|
+
Text,
|
|
8
|
+
} from 'boemly';
|
|
9
|
+
import StrapiLinkButton from '@/components/StrapiLinkButton';
|
|
10
|
+
import StrapiLink from '@/models/strapi/StrapiLink';
|
|
11
|
+
|
|
12
|
+
export interface FactsProps {
|
|
13
|
+
slice: {
|
|
14
|
+
tagline?: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
subTitle?: string;
|
|
17
|
+
button?: StrapiLink;
|
|
18
|
+
variant: 'gray' | 'green' | 'white';
|
|
19
|
+
facts: { key: string; value: string }[];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const VARIANTS = {
|
|
24
|
+
gray: {
|
|
25
|
+
backgroundColor: 'primary.50',
|
|
26
|
+
tagLineColor: 'primary.500',
|
|
27
|
+
titleColor: 'black',
|
|
28
|
+
subTitleColor: 'black',
|
|
29
|
+
factKeyColor: 'gray.700',
|
|
30
|
+
factValueColor: 'gray.700',
|
|
31
|
+
},
|
|
32
|
+
green: {
|
|
33
|
+
backgroundColor: 'primary.800',
|
|
34
|
+
tagLineColor: 'white',
|
|
35
|
+
titleColor: 'white',
|
|
36
|
+
subTitleColor: 'white',
|
|
37
|
+
factKeyColor: 'whiteAlpha.900',
|
|
38
|
+
factValueColor: 'white',
|
|
39
|
+
},
|
|
40
|
+
white: {
|
|
41
|
+
backgroundColor: 'white',
|
|
42
|
+
tagLineColor: 'primary.500',
|
|
43
|
+
titleColor: 'black',
|
|
44
|
+
subTitleColor: 'black',
|
|
45
|
+
factKeyColor: 'gray.700',
|
|
46
|
+
factValueColor: 'gray.700',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Facts: React.FC<FactsProps> = ({ slice }: FactsProps) => (
|
|
51
|
+
<DefaultSectionContainer
|
|
52
|
+
backgroundColor={VARIANTS[slice.variant].backgroundColor}
|
|
53
|
+
flexDir="column"
|
|
54
|
+
textAlign="center"
|
|
55
|
+
justifyContent="space-between"
|
|
56
|
+
paddingX={['6', null, '8']}
|
|
57
|
+
title={slice.title}
|
|
58
|
+
>
|
|
59
|
+
<>
|
|
60
|
+
{slice.title && (
|
|
61
|
+
<>
|
|
62
|
+
<DefaultSectionHeader
|
|
63
|
+
tagline={slice.tagline}
|
|
64
|
+
text={slice.subTitle}
|
|
65
|
+
title={slice.title}
|
|
66
|
+
taglineProps={{
|
|
67
|
+
color: VARIANTS[slice.variant].tagLineColor,
|
|
68
|
+
textAlign: 'center',
|
|
69
|
+
}}
|
|
70
|
+
titleProps={{
|
|
71
|
+
color: VARIANTS[slice.variant].titleColor,
|
|
72
|
+
textAlign: 'center',
|
|
73
|
+
maxW: '6xl',
|
|
74
|
+
marginX: 'auto',
|
|
75
|
+
}}
|
|
76
|
+
textProps={{
|
|
77
|
+
color: VARIANTS[slice.variant].subTitleColor,
|
|
78
|
+
textAlign: 'center',
|
|
79
|
+
maxW: '3xl',
|
|
80
|
+
marginX: 'auto',
|
|
81
|
+
}}
|
|
82
|
+
/>
|
|
83
|
+
<Spacer height={['0', null, '12']} />
|
|
84
|
+
</>
|
|
85
|
+
)}
|
|
86
|
+
<Flex
|
|
87
|
+
justifyContent={slice.facts.length < 3 ? 'center' : 'flex-start'}
|
|
88
|
+
alignItems="center"
|
|
89
|
+
flexWrap="wrap"
|
|
90
|
+
mx={[null, null, null, '22', '28']}
|
|
91
|
+
flexDir={['column', null, null, 'row']}
|
|
92
|
+
gap={[null, null, null, '12']}
|
|
93
|
+
>
|
|
94
|
+
{slice.facts.map((fact) => (
|
|
95
|
+
<Flex
|
|
96
|
+
key={fact.key}
|
|
97
|
+
flexDir="column"
|
|
98
|
+
width={[
|
|
99
|
+
'var(--boemly-sizes-full)',
|
|
100
|
+
null,
|
|
101
|
+
null,
|
|
102
|
+
'calc((var(--boemly-sizes-full) - var(--boemly-space-24))/ 3 )',
|
|
103
|
+
]}
|
|
104
|
+
mt={['8', '8', '8', slice.facts.length > 3 ? '16' : '0']}
|
|
105
|
+
>
|
|
106
|
+
<Heading
|
|
107
|
+
fontSize="6xl"
|
|
108
|
+
fontFamily="GintoNord"
|
|
109
|
+
lineHeight="10"
|
|
110
|
+
fontWeight="700"
|
|
111
|
+
color={VARIANTS[slice.variant].factValueColor}
|
|
112
|
+
mb="2"
|
|
113
|
+
as="p"
|
|
114
|
+
>
|
|
115
|
+
{fact.value}
|
|
116
|
+
</Heading>
|
|
117
|
+
|
|
118
|
+
<Text
|
|
119
|
+
size="mdLowNormal"
|
|
120
|
+
color={VARIANTS[slice.variant].factKeyColor}
|
|
121
|
+
>
|
|
122
|
+
{fact.key}
|
|
123
|
+
</Text>
|
|
124
|
+
</Flex>
|
|
125
|
+
))}
|
|
126
|
+
</Flex>
|
|
127
|
+
|
|
128
|
+
{slice.button && (
|
|
129
|
+
<>
|
|
130
|
+
<Spacer height={['0', null, '20']} />
|
|
131
|
+
<StrapiLinkButton
|
|
132
|
+
link={slice.button}
|
|
133
|
+
size="md"
|
|
134
|
+
variant={slice.variant === 'green' ? 'outline' : 'solid'}
|
|
135
|
+
/>
|
|
136
|
+
</>
|
|
137
|
+
)}
|
|
138
|
+
</>
|
|
139
|
+
</DefaultSectionContainer>
|
|
140
|
+
);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { StoryFn, Meta } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { storybookStrapiAvatarMock } from '@/test/storybookMocks/storybookStrapiMedia';
|
|
4
|
+
import FullWidthHighlightQuote from '.';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'sections/FullWidthHighlightQuote',
|
|
8
|
+
component: FullWidthHighlightQuote,
|
|
9
|
+
} as Meta<typeof FullWidthHighlightQuote>;
|
|
10
|
+
|
|
11
|
+
const Template: StoryFn<typeof FullWidthHighlightQuote> = (args) => (
|
|
12
|
+
<FullWidthHighlightQuote {...args} />
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const avatar = {
|
|
16
|
+
id: 1,
|
|
17
|
+
name: 'Avatar name',
|
|
18
|
+
description: 'Avatar description',
|
|
19
|
+
image: {
|
|
20
|
+
id: 1,
|
|
21
|
+
alt: 'Avatar image alt text',
|
|
22
|
+
img: { data: storybookStrapiAvatarMock },
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const Minimal = Template.bind({});
|
|
27
|
+
Minimal.args = {
|
|
28
|
+
slice: {
|
|
29
|
+
quote: '"Quote"',
|
|
30
|
+
avatarWithName: avatar,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const WithTagline = Template.bind({});
|
|
35
|
+
WithTagline.args = {
|
|
36
|
+
slice: {
|
|
37
|
+
tagline: 'Tagline',
|
|
38
|
+
quote: '"Quote"',
|
|
39
|
+
avatarWithName: avatar,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { render, screen } from '@/test/testUtils';
|
|
2
|
+
import { strapiAvatarWithNameMock } from '@/test/strapiMocks/strapiAvatarWithName';
|
|
3
|
+
import FullWidthHighlightQuote from '.';
|
|
4
|
+
import { FullWidthHighlightQuoteProps } from './FullWidthHighlightQuote';
|
|
5
|
+
|
|
6
|
+
const defaultProps: FullWidthHighlightQuoteProps = {
|
|
7
|
+
slice: {
|
|
8
|
+
quote: 'Quote',
|
|
9
|
+
avatarWithName: strapiAvatarWithNameMock,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const setup = (props = {}) => {
|
|
14
|
+
const combinedProps = { ...defaultProps, ...props };
|
|
15
|
+
render(<FullWidthHighlightQuote {...combinedProps} />);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
describe('The FullWidthHighlightQuote component', () => {
|
|
19
|
+
it('displays a tagline if there is a tagline in the slice', () => {
|
|
20
|
+
setup({ slice: { ...defaultProps.slice, tagline: 'Tagline' } });
|
|
21
|
+
|
|
22
|
+
expect(screen.getByText('Tagline')).toBeInTheDocument();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('displays the quote', () => {
|
|
26
|
+
setup();
|
|
27
|
+
|
|
28
|
+
expect(screen.getByText(defaultProps.slice.quote)).toBeInTheDocument();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('displays the avatar with name', () => {
|
|
32
|
+
setup();
|
|
33
|
+
|
|
34
|
+
expect(screen.getByRole('img')).toHaveAttribute(
|
|
35
|
+
'alt',
|
|
36
|
+
strapiAvatarWithNameMock.image.alt
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
});
|