@newskit-render/core 0.0.0-d55b7d88
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/.ci/trigger-circleci-workflow.sh +37 -0
- package/.eslintignore +23 -0
- package/.eslintrc +74 -0
- package/.prettierignore +19 -0
- package/.prettierrc +7 -0
- package/CHANGELOG.md +7638 -0
- package/Dockerfile +14 -0
- package/Dockerfile.withNewRelic +15 -0
- package/README.md +274 -0
- package/__tests__/pages/__snapshots__/brightcove.test.tsx.snap +20 -0
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +1195 -0
- package/__tests__/pages/brightcove.test.tsx +34 -0
- package/__tests__/pages/empty.test.tsx +10 -0
- package/__tests__/pages/home.test.tsx +16 -0
- package/app-context/InstrumentationContextProvider.tsx +36 -0
- package/assets/fontFamily.ts +416 -0
- package/assets/fonts/Graphik-Black-App.ttf +0 -0
- package/assets/fonts/Graphik-BlackItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Bold-App.ttf +0 -0
- package/assets/fonts/Graphik-BoldItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Extralight-App.ttf +0 -0
- package/assets/fonts/Graphik-ExtralightItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Light-App.ttf +0 -0
- package/assets/fonts/Graphik-LightItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Medium-App.ttf +0 -0
- package/assets/fonts/Graphik-Medium-Web.woff2 +0 -0
- package/assets/fonts/Graphik-MediumItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Regular-App.ttf +0 -0
- package/assets/fonts/Graphik-Regular-Web.woff2 +0 -0
- package/assets/fonts/Graphik-RegularItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Semibold-App.ttf +0 -0
- package/assets/fonts/Graphik-Semibold-Web.woff2 +0 -0
- package/assets/fonts/Graphik-SemiboldItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Super-App.ttf +0 -0
- package/assets/fonts/Graphik-SuperItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Thin-App.ttf +0 -0
- package/assets/fonts/Graphik-ThinItalic-App.ttf +0 -0
- package/assets/fonts/Montserrat-Black.ttf +0 -0
- package/assets/fonts/Montserrat-BlackItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Bold.ttf +0 -0
- package/assets/fonts/Montserrat-BoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraBold.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraBoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraLight.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraLightItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Italic.ttf +0 -0
- package/assets/fonts/Montserrat-Light.ttf +0 -0
- package/assets/fonts/Montserrat-LightItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Medium.ttf +0 -0
- package/assets/fonts/Montserrat-MediumItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Regular.ttf +0 -0
- package/assets/fonts/Montserrat-SemiBold.ttf +0 -0
- package/assets/fonts/Montserrat-SemiBoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Thin.ttf +0 -0
- package/assets/fonts/Montserrat-ThinItalic.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Black-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-BlackItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Bold-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Bold-Web.woff2 +0 -0
- package/assets/fonts/PublicoHeadline-BoldItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Extrabold-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-ExtraboldItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Italic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Light-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-LightItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Medium-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-MediumItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Roman-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Roman-Web.woff2 +0 -0
- package/assets/fonts/PublicoText-Bold-App.ttf +0 -0
- package/assets/fonts/PublicoText-BoldItalic-App.ttf +0 -0
- package/assets/fonts/PublicoText-Italic-App.ttf +0 -0
- package/assets/fonts/PublicoText-Italic-Web.woff2 +0 -0
- package/assets/fonts/PublicoText-Roman-App.ttf +0 -0
- package/assets/fonts/PublicoText-Roman-Web.woff2 +0 -0
- package/assets/fonts/PublicoText-Semibold-App.ttf +0 -0
- package/assets/fonts/PublicoText-SemiboldItalic-App.ttf +0 -0
- package/assets/fonts/Roboto-Bold.ttf +0 -0
- package/assets/fonts/Roboto-Light.ttf +0 -0
- package/assets/fonts/Roboto-Medium.ttf +0 -0
- package/assets/fonts/Roboto-Regular.ttf +0 -0
- package/assets/fonts/TheSun-Bold.ttf +0 -0
- package/assets/fonts/TheSun-BoldItalic.ttf +0 -0
- package/assets/fonts/TheSun-HeavyCondensed.ttf +0 -0
- package/assets/fonts/TheSun-HeavyNarrow.ttf +0 -0
- package/assets/fonts/TheSun-Italic.ttf +0 -0
- package/assets/fonts/TheSun-Medium.ttf +0 -0
- package/assets/fonts/TheSun-MediumItalic.ttf +0 -0
- package/assets/fonts/TheSun-Regular.ttf +0 -0
- package/assets/fonts/TimesDigital-Bold.ttf +0 -0
- package/assets/fonts/TimesDigital-BoldItalic.ttf +0 -0
- package/assets/fonts/TimesDigital-BoldSC.ttf +0 -0
- package/assets/fonts/TimesDigital-Italic.ttf +0 -0
- package/assets/fonts/TimesDigital-Regular.ttf +0 -0
- package/assets/fonts/TimesDigital-RegularSC.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-Bold.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-BoldItalic.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-BoldSC.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-Italic.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-Regular.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-RegularSC.ttf +0 -0
- package/assets/fonts/TimesModern-Regular.otf +0 -0
- package/assets/fonts/attribuitions.mdx +35 -0
- package/assets/fonts/bitter-medium.woff +0 -0
- package/assets/fonts/bitter-medium.woff2 +0 -0
- package/assets/fonts/bitter-mediumitalic.woff +0 -0
- package/assets/fonts/bitter-mediumitalic.woff2 +0 -0
- package/assets/fonts/bitter-regular.woff +0 -0
- package/assets/fonts/bitter-regular.woff2 +0 -0
- package/assets/fonts/bitter-semibold.woff +0 -0
- package/assets/fonts/bitter-semibold.woff2 +0 -0
- package/assets/fonts/dmmono-medium.woff +0 -0
- package/assets/fonts/dmmono-medium.woff2 +0 -0
- package/assets/fonts/dmsans-bold-webfont.woff +0 -0
- package/assets/fonts/dmsans-bold-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-bolditalic-webfont.woff +0 -0
- package/assets/fonts/dmsans-bolditalic-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-italic-webfont.woff +0 -0
- package/assets/fonts/dmsans-italic-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-medium-webfont.woff +0 -0
- package/assets/fonts/dmsans-medium-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-mediumitalic-webfont.woff +0 -0
- package/assets/fonts/dmsans-mediumitalic-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-regular-webfont.woff +0 -0
- package/assets/fonts/dmsans-regular-webfont.woff2 +0 -0
- package/assets/fonts/notosans-bold-webfont.woff +0 -0
- package/assets/fonts/notosans-bold-webfont.woff2 +0 -0
- package/assets/fonts/notosans-italic-webfont.woff +0 -0
- package/assets/fonts/notosans-italic-webfont.woff2 +0 -0
- package/assets/fonts/notosans-medium-webfont.woff +0 -0
- package/assets/fonts/notosans-medium-webfont.woff2 +0 -0
- package/assets/fonts/notosans-regular-webfont.woff +0 -0
- package/assets/fonts/notosans-regular-webfont.woff2 +0 -0
- package/assets/fonts/poppins-bold-webfont.woff +0 -0
- package/assets/fonts/poppins-bold-webfont.woff2 +0 -0
- package/assets/fonts/poppins-bolditalic-webfont.woff +0 -0
- package/assets/fonts/poppins-bolditalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-extrabold-webfont.woff +0 -0
- package/assets/fonts/poppins-extrabold-webfont.woff2 +0 -0
- package/assets/fonts/poppins-extrabolditalic-webfont.woff +0 -0
- package/assets/fonts/poppins-extrabolditalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-italic-webfont.woff +0 -0
- package/assets/fonts/poppins-italic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-light-webfont.woff +0 -0
- package/assets/fonts/poppins-light-webfont.woff2 +0 -0
- package/assets/fonts/poppins-lightitalic-webfont.woff +0 -0
- package/assets/fonts/poppins-lightitalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-medium-webfont.woff +0 -0
- package/assets/fonts/poppins-medium-webfont.woff2 +0 -0
- package/assets/fonts/poppins-mediumitalic-webfont.woff +0 -0
- package/assets/fonts/poppins-mediumitalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-regular-webfont.woff +0 -0
- package/assets/fonts/poppins-regular-webfont.woff2 +0 -0
- package/assets/fonts/poppins-semibold-webfont.woff +0 -0
- package/assets/fonts/poppins-semibold-webfont.woff2 +0 -0
- package/assets/fonts/poppins-semibolditalic-webfont.woff +0 -0
- package/assets/fonts/poppins-semibolditalic-webfont.woff2 +0 -0
- package/assets/fonts/source-serif-pro-600.woff +0 -0
- package/assets/fonts/source-serif-pro-600.woff2 +0 -0
- package/assets/fonts/source-serif-pro-600italic.woff +0 -0
- package/assets/fonts/source-serif-pro-600italic.woff2 +0 -0
- package/assets/fonts/source-serif-pro-700.woff +0 -0
- package/assets/fonts/source-serif-pro-700.woff2 +0 -0
- package/assets/fonts/source-serif-pro-700italic.woff +0 -0
- package/assets/fonts/source-serif-pro-700italic.woff2 +0 -0
- package/assets/fonts/source-serif-pro-italic.woff +0 -0
- package/assets/fonts/source-serif-pro-italic.woff2 +0 -0
- package/assets/fonts/source-serif-pro-regular.woff +0 -0
- package/assets/fonts/source-serif-pro-regular.woff2 +0 -0
- package/components/AccountDropdown/AccountDropdown.tsx +65 -0
- package/components/AccountDropdown/__tests__/AcountDropdown.test.tsx +83 -0
- package/components/AccountDropdown/accounts.ts +47 -0
- package/components/AccountDropdown/index.tsx +2 -0
- package/components/AccountDropdown/utils.ts +21 -0
- package/components/ErrorPage/ErrorPage.tsx +135 -0
- package/components/ad/index.tsx +35 -0
- package/components/article/Highlights.tsx +77 -0
- package/components/article/MetaBox.tsx +50 -0
- package/components/article/RelatedArticles.tsx +53 -0
- package/components/article/RelatedTopics.tsx +59 -0
- package/components/article/ShareBarComponent.tsx +53 -0
- package/components/article/__tests__/__snapshots__/index.test.tsx.snap +1568 -0
- package/components/article/__tests__/index.test.tsx +171 -0
- package/components/article/__tests__/mocks.ts +105 -0
- package/components/article/index.tsx +320 -0
- package/components/common/BackToHomepage.tsx +37 -0
- package/components/common/NavLink.tsx +26 -0
- package/components/common/NewskitLogo.tsx +52 -0
- package/components/common/NewskitLogoShort.tsx +48 -0
- package/components/common/SectionTitleBar.tsx +57 -0
- package/components/common/ShareButton.tsx +18 -0
- package/components/common/ViewMoreButton.tsx +20 -0
- package/components/common/iconNavLink/IconNavLink.tsx +70 -0
- package/components/common/iconNavLink/__tests__/IconNavLink.test.tsx +35 -0
- package/components/common/iconNavLink/index.ts +3 -0
- package/components/common/iconNavLink/types.ts +24 -0
- package/components/common/icons/IconAccount.tsx +13 -0
- package/components/common/icons/IconFilledTwitter.tsx +14 -0
- package/components/common/icons/StyledIconFilledChevronRight.tsx +12 -0
- package/components/footer/__snapshots__/index.test.tsx.snap +192 -0
- package/components/footer/index.test.tsx +13 -0
- package/components/footer/index.tsx +151 -0
- package/components/header/banner-messages.ts +39 -0
- package/components/header/index.tsx +52 -0
- package/components/header/navigation-links.ts +20 -0
- package/components/layout/Gutter.tsx +11 -0
- package/components/layout/LayoutTemplate.tsx +26 -0
- package/components/layout/MainGrid.tsx +66 -0
- package/components/layout/index.tsx +3 -0
- package/components/layout/layoutTypes.ts +13 -0
- package/components/section/ArticleSlice.tsx +35 -0
- package/components/section/CollectionBlock.tsx +54 -0
- package/components/section/SectionContext.tsx +9 -0
- package/components/section/__tests__/ArticleSlice.test.tsx +128 -0
- package/components/section/__tests__/CollectionBlock.test.tsx +83 -0
- package/components/section/__tests__/pageBlock.test.tsx +24 -0
- package/components/section/__tests__/sectionUtils.test.ts +94 -0
- package/components/section/index.tsx +39 -0
- package/components/section/layouts/Block.tsx +79 -0
- package/components/section/layouts/FallBack.tsx +24 -0
- package/components/section/layouts/Lead.tsx +43 -0
- package/components/section/layouts/Rows.tsx +82 -0
- package/components/section/layouts/SectionTitle.tsx +57 -0
- package/components/section/layouts/__tests__/Lead.test.tsx +37 -0
- package/components/section/layouts/__tests__/Rows.test.tsx +40 -0
- package/components/section/layouts/__tests__/SectionTitle.test.tsx +37 -0
- package/components/section/layouts/__tests__/__snapshots__/Lead.test.tsx.snap +180 -0
- package/components/section/layouts/__tests__/__snapshots__/SectionTitle.test.tsx.snap +354 -0
- package/components/section/layouts/gridUtils.ts +21 -0
- package/components/section/layouts/index.tsx +4 -0
- package/components/section/layouts/types.ts +13 -0
- package/components/section/pageBlock.tsx +23 -0
- package/components/section/sectionUtils.ts +61 -0
- package/components/teaser/index.test.tsx +50 -0
- package/components/teaser/index.tsx +64 -0
- package/components/teaser/teaserVariants.ts +33 -0
- package/components/teaser/variant-types.ts +49 -0
- package/components/teaser/variants/featureVariant.ts +42 -0
- package/components/teaser/variants/horizontal.ts +14 -0
- package/components/teaser/variants/titleTeaserVariant.ts +32 -0
- package/components/teaser/variants/titleVertical.ts +24 -0
- package/components/utils/index.test.ts +12 -0
- package/components/utils/index.ts +6 -0
- package/config/__tests__/index.test.ts +54 -0
- package/config/environment.ts +80 -0
- package/config/index.ts +2 -0
- package/config/multiTenancy.ts +11 -0
- package/constants/index.ts +2 -0
- package/context/app-context/AppContext.test.tsx +56 -0
- package/context/app-context/holidayStopListContextOverrides.ts +18 -0
- package/context/app-context/index.tsx +34 -0
- package/context/app-context/paymentMethodContext.tsx +70 -0
- package/context/index.tsx +2 -0
- package/context/multi-tenancy/MultiTenancy.test.tsx +48 -0
- package/context/multi-tenancy/index.tsx +32 -0
- package/css/index.ts +15 -0
- package/cypress/axe/terminal-log.js +19 -0
- package/cypress/config/visual.config.ts +11 -0
- package/cypress/config/visual.skip.config.ts +10 -0
- package/cypress/e2e/account/accessibility.cy.js +88 -0
- package/cypress/e2e/account/banners.cy.js +169 -0
- package/cypress/e2e/account/cancellation.cy.js +219 -0
- package/cypress/e2e/account/holiday-stops.cy.js +109 -0
- package/cypress/e2e/account/main-api.cy.js +102 -0
- package/cypress/e2e/account/newsletters-and-alerts.cy.js +149 -0
- package/cypress/e2e/account/newsletters-page.cy.js +69 -0
- package/cypress/e2e/account/payment-page.cy.js +98 -0
- package/cypress/e2e/account/personal-details.cy.js +1161 -0
- package/cypress/e2e/account/subscription-and-billing.cy.js +434 -0
- package/cypress/e2e/checkout/account-creation.cy.js +8 -0
- package/cypress/e2e/checkout/payment-details.cy.js +19 -0
- package/cypress/e2e/core/home-page.cy.js +6 -0
- package/cypress/e2e/help-hub/accessibility.cy.js +35 -0
- package/cypress/e2e/help-hub/article-page.cy.js +115 -0
- package/cypress/e2e/help-hub/landing-page.cy.js +94 -0
- package/cypress/e2e/help-hub/result-page.cy.js +117 -0
- package/cypress/fixtures/empty.html +10 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/fixtures/holiday-stops.json +40 -0
- package/cypress/fixtures/paymentFailure.js +24 -0
- package/cypress/fixtures/testDates.js +26 -0
- package/cypress/support/commands.js +125 -0
- package/cypress/support/consentValues.js +5839 -0
- package/cypress/support/e2e.js +22 -0
- package/cypress/support/users.js +58 -0
- package/cypress/visual/account/print-visual-regression.cy.js +9 -0
- package/cypress/visual/account/visual-regression.cy.js +40 -0
- package/cypress/visual/empty/empty.cy.js +5 -0
- package/cypress.config.ts +38 -0
- package/helpers/__tests__/getUser.test.ts +45 -0
- package/helpers/__tests__/logger.test.ts +62 -0
- package/helpers/__tests__/useThemeDropdownObject.test.ts +49 -0
- package/helpers/a11y.ts +7 -0
- package/helpers/addCacheHeaders.ts +8 -0
- package/helpers/getUser.ts +37 -0
- package/helpers/getYear.ts +1 -0
- package/helpers/global-types.ts +186 -0
- package/helpers/logger/getWinstonLogger.ts +19 -0
- package/helpers/logger/index.ts +20 -0
- package/helpers/logger/replaceConsoleWithLogger.ts +14 -0
- package/helpers/mocks/articleMock.ts +50 -0
- package/helpers/mocks/getPageMock.ts +369 -0
- package/helpers/mocks/getRadioPostMock.ts +71 -0
- package/helpers/mocks/getRadioPostsMock.ts +26 -0
- package/helpers/mocks/getRecommendationsMock.ts +20 -0
- package/helpers/mocks/index.ts +7 -0
- package/helpers/multiTenancy.ts +19 -0
- package/helpers/setupTests.ts +5 -0
- package/helpers/test-utils.tsx +33 -0
- package/helpers/useThemeDropdownObject.tsx +73 -0
- package/infrastructure/.circleci/config.yml +1187 -0
- package/infrastructure/INFRASTRUCTURE.md +142 -0
- package/infrastructure/build_and_deploy.png +0 -0
- package/infrastructure/helm/Chart.yaml +21 -0
- package/infrastructure/helm/templates/_helpers.tpl +87 -0
- package/infrastructure/helm/templates/deployment.yaml +45 -0
- package/infrastructure/helm/templates/horizontalpodautoscaler.yaml +21 -0
- package/infrastructure/helm/templates/ingress.yaml +31 -0
- package/infrastructure/helm/templates/networkpolicy.yaml +26 -0
- package/infrastructure/helm/templates/secret.yaml +12 -0
- package/infrastructure/helm/templates/service.yaml +15 -0
- package/infrastructure/helm/values-dev.yaml +39 -0
- package/infrastructure/helm/values-local.yaml +30 -0
- package/infrastructure/helm/values-pr.yaml +40 -0
- package/infrastructure/helm/values-prod.yaml +39 -0
- package/infrastructure/helm/values-staging.yaml +39 -0
- package/infrastructure/helm/values.yaml +44 -0
- package/infrastructure/pull_request.png +0 -0
- package/infrastructure/release-documentation-cli.config.json +18 -0
- package/infrastructure/remove_pr.png +0 -0
- package/infrastructure/terraform-ecr/dev.tfvars +3 -0
- package/infrastructure/terraform-ecr/ecr.tf +69 -0
- package/infrastructure/terraform-ecr/main.tf +3 -0
- package/infrastructure/terraform-ecr/variables.tf +19 -0
- package/infrastructure/terraform-ecr/versions.tf +12 -0
- package/infrastructure/terraform-newrelic/alerts.tf +290 -0
- package/infrastructure/terraform-newrelic/dashboards.tf +347 -0
- package/infrastructure/terraform-newrelic/dev.tfvars +3 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-dev.js +53 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-prod.js +54 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-stage.js +54 -0
- package/infrastructure/terraform-newrelic/main.tf +11 -0
- package/infrastructure/terraform-newrelic/monitors.tf +11 -0
- package/infrastructure/terraform-newrelic/prod.tfvars +3 -0
- package/infrastructure/terraform-newrelic/staging.tfvars +3 -0
- package/infrastructure/terraform-newrelic/variables.tf +33 -0
- package/infrastructure/terraform-newrelic/versions.tf +18 -0
- package/jest.config.js +40 -0
- package/jest.config.pact.js +18 -0
- package/newrelic.js +86 -0
- package/next-env.d.ts +5 -0
- package/next.config.js +95 -0
- package/package.json +127 -0
- package/pages/_app.tsx +117 -0
- package/pages/_document.tsx +112 -0
- package/pages/_error.tsx +68 -0
- package/pages/account/add/[field].tsx +34 -0
- package/pages/account/cancellation/index.tsx +22 -0
- package/pages/account/delete/confirm/index.tsx +16 -0
- package/pages/account/delete/error/index.tsx +16 -0
- package/pages/account/delete/index.tsx +16 -0
- package/pages/account/delete/success/index.tsx +16 -0
- package/pages/account/dream-team/index.tsx +19 -0
- package/pages/account/edit/[field].tsx +45 -0
- package/pages/account/family/index.tsx +19 -0
- package/pages/account/holiday-stop/index.tsx +19 -0
- package/pages/account/holiday-stop/previous-holiday-stops.tsx +19 -0
- package/pages/account/holiday-stop/upcoming-holiday-stops.tsx +19 -0
- package/pages/account/index.tsx +33 -0
- package/pages/account/newsletters/index.tsx +19 -0
- package/pages/account/newsletters-and-alerts/index.tsx +24 -0
- package/pages/account/payment/[paymentMethod].tsx +37 -0
- package/pages/account/payment/index.tsx +23 -0
- package/pages/account/payment-methods/index.tsx +21 -0
- package/pages/account/subscription-and-billing/index.tsx +29 -0
- package/pages/api/account/get-session/index.ts +33 -0
- package/pages/api/account/invoice/index.ts +35 -0
- package/pages/api/account/mutate/index.ts +8 -0
- package/pages/api/account/query/index.ts +7 -0
- package/pages/api/auth/[...nextauth].ts +11 -0
- package/pages/api/competitions-sitemap.ts +19 -0
- package/pages/api/feed.ts +23 -0
- package/pages/api/health-check.ts +7 -0
- package/pages/api/news-sitemap.ts +18 -0
- package/pages/api/pages-sitemap.ts +27 -0
- package/pages/api/robots.ts +19 -0
- package/pages/api/sitemap.ts +24 -0
- package/pages/checkout/account-creation/index.tsx +13 -0
- package/pages/checkout/payment-details/index.tsx +10 -0
- package/pages/empty.tsx +6 -0
- package/pages/help-hub/article/[title]/index.tsx +25 -0
- package/pages/help-hub/error.tsx +23 -0
- package/pages/help-hub/index.tsx +51 -0
- package/pages/help-hub/results.tsx +25 -0
- package/pages/index.tsx +19 -0
- package/pages/player/brightcove.tsx +19 -0
- package/pages/rss/create/index.tsx +18 -0
- package/pages/rss/feed/[feedId]/index.tsx +21 -0
- package/pages/rss/index.tsx +18 -0
- package/public/ads.min.js +8175 -0
- package/public/assets/display-base-header.svg +25 -0
- package/public/assets/display-personalDetails-header-sun.svg +55 -0
- package/public/assets/display-personalDetails-header-times.svg +90 -0
- package/public/assets/display-personalDetails-header-vr.svg +46 -0
- package/public/assets/dream-team.svg +10 -0
- package/public/assets/navigationPrimary-brandMark-sun.svg +9 -0
- package/public/assets/navigationPrimary-brandMark-times.svg +18 -0
- package/public/assets/navigationPrimary-brandMark-vr.svg +10 -0
- package/public/assets/newsletters/bestoftimes-101.png +0 -0
- package/public/assets/newsletters/books-115.png +0 -0
- package/public/assets/newsletters/environment-140.png +0 -0
- package/public/assets/newsletters/fashion-108.png +0 -0
- package/public/assets/newsletters/food-106.png +0 -0
- package/public/assets/newsletters/football-111.png +0 -0
- package/public/assets/newsletters/ireland-152.png +0 -0
- package/public/assets/newsletters/law-121.png +0 -0
- package/public/assets/newsletters/money-107.png +0 -0
- package/public/assets/newsletters/moneymentor-150.png +0 -0
- package/public/assets/newsletters/placeholder.png +0 -0
- package/public/assets/newsletters/politics-119.png +0 -0
- package/public/assets/newsletters/property-113.png +0 -0
- package/public/assets/newsletters/puzzles-125.png +0 -0
- package/public/assets/newsletters/scotland-134.png +0 -0
- package/public/assets/newsletters/theatre-127.png +0 -0
- package/public/assets/newsletters/travel-149.png +0 -0
- package/public/assets/newsletters/tv-133.png +0 -0
- package/public/assets/newsletters/us-153.png +0 -0
- package/public/assets/no-subscription.svg +15 -0
- package/public/assets/pending-activation.svg +16 -0
- package/public/assets/personal-details-header.svg +91 -0
- package/public/assets/plchldr150x100.png +0 -0
- package/public/assets/previous-subscription.svg +15 -0
- package/public/assets/primary-navigation-logo-white.svg +6 -0
- package/public/assets/primary-navigation-logo.svg +6 -0
- package/public/assets/tls-logo-white.svg +3 -0
- package/public/favicon.ico +0 -0
- package/public/icon.png +0 -0
- package/public/prebid.min.js +1 -0
- package/queries/getPage.ts +100 -0
- package/queries/getRadioPost.ts +61 -0
- package/queries/getRadioPosts.ts +16 -0
- package/queries/getUserSubscription.ts +9 -0
- package/queries/index.ts +3 -0
- package/scripts/k8s-local.sh +137 -0
- package/scripts/nr-exports.sh +7 -0
- package/temp/_app.tsx +15 -0
- package/temp/_document.tsx +61 -0
- package/temp/app-context-test.tsx +51 -0
- package/temp/app-context.tsx +25 -0
- package/temp/config-index.ts +1 -0
- package/temp/context-index.tsx +1 -0
- package/temp/header.tsx +45 -0
- package/temp/next.config.js +56 -0
- package/tsconfig.json +51 -0
- package/tsconfig.test.json +6 -0
- package/validation/index.tsx +24 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import {
|
|
3
|
+
withTheme,
|
|
4
|
+
styled,
|
|
5
|
+
getSizingCssFromTheme,
|
|
6
|
+
getColorCssFromTheme,
|
|
7
|
+
} from 'newskit'
|
|
8
|
+
|
|
9
|
+
interface StyledLogoPorps {
|
|
10
|
+
viewBox?: string
|
|
11
|
+
$color: string
|
|
12
|
+
size: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type NewsKitLogoProps = Omit<StyledLogoPorps, '$color'> & {
|
|
16
|
+
color: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const LogoSvg = styled.svg<StyledLogoPorps>`
|
|
20
|
+
display: inline-block;
|
|
21
|
+
${getColorCssFromTheme('fill', 'white')};
|
|
22
|
+
${getColorCssFromTheme('color', 'white')};
|
|
23
|
+
${getSizingCssFromTheme('width', 'sizing120')};
|
|
24
|
+
`
|
|
25
|
+
|
|
26
|
+
const NewsKitLogoFull = React.forwardRef<HTMLDivElement, NewsKitLogoProps>(
|
|
27
|
+
({ color, ...props }, ref) => (
|
|
28
|
+
<LogoSvg viewBox="0 0 244 40" height="40px" $color={color} {...props}>
|
|
29
|
+
<title>NewsKit Logo</title>
|
|
30
|
+
<path
|
|
31
|
+
d="M86.93 34.078V19.006l12.017 15.462a.63.63 0 0 0 .496.243h5.94a.63.63 0 0 0 .629-.633V6.715a.63.63 0 0 0-.629-.633h-6.553a.63.63 0 0 0-.629.633v14.499L86.671 6.326a.63.63 0 0 0-.496-.244h-6.427a.63.63 0 0 0-.629.633v27.363a.63.63 0 0 0 .629.633h6.553a.63.63 0 0 0 .629-.633zm134.203-20.324c2.389 0 4.325-1.947 4.325-4.35s-1.936-4.35-4.325-4.35-4.325 1.947-4.325 4.35 1.936 4.35 4.325 4.35zM120.484 35.185c4.133 0 7.092-1.617 9.192-4.085.112-.132.196-.514-.023-.696l-3.487-2.897c-.267-.222-.691-.111-.819.004-1.437 1.296-2.778 1.881-4.496 1.881-2.401 0-4.151-1.224-4.761-3.631h13.949c.26 0 .821-.208.821-.638v-.953c0-6.487-3.499-12.077-11.067-12.077-6.51 0-11.108 5.1-11.108 11.546v.082c0 6.813 4.882 11.465 11.799 11.465zm3.299-13.444h-7.706c.407-2.421 1.794-3.954 3.832-3.954 2.121 0 3.588 1.533 3.874 3.954zm20.504 12.53l3.366-10.581c.026-.083.115-.129.198-.102.049.016.087.054.102.103l3.289 10.576a.63.63 0 0 0 .601.444h5.737a.63.63 0 0 0 .601-.447l6.399-20.955c.102-.334-.084-.688-.416-.79-.06-.018-.122-.028-.185-.028h-6.102a.63.63 0 0 0-.607.469l-2.7 10.167c-.023.084-.109.135-.193.112-.052-.014-.094-.054-.11-.107l-3.116-10.276a.63.63 0 0 0-.602-.448h-5.409a.63.63 0 0 0-.601.447l-3.114 10.193c-.026.084-.114.13-.197.105-.052-.016-.092-.058-.106-.111L138.5 12.963a.63.63 0 0 0-.608-.473h-6.184a.63.63 0 0 0-.629.633c0 .062.009.124.027.184l6.323 20.955a.63.63 0 0 0 .602.449h5.657a.63.63 0 0 0 .599-.44zm30.749.914c5.364 0 8.981-2.538 8.981-7.411v-.082c0-3.869-2.798-5.483-6.527-6.663l-.25-.078-.253-.077-.255-.076-.258-.075-.259-.074-.69-.212-.285-.09-.205-.066-.197-.065-.189-.064-.181-.063-.116-.042-.113-.041-.109-.041-.106-.041-.102-.041-.098-.041-.095-.041-.045-.021-.089-.042-.085-.042-.082-.042-.039-.021-.076-.043-.071-.043-.068-.044c-.351-.235-.536-.495-.536-.819v-.082c0-.655.61-1.105 1.788-1.105 1.631 0 3.897.677 6.042 1.831l.116.063.017.006.024.007.029.007a.6.6 0 0 0 .034.006l.038.004c.124.009.29-.019.36-.192l.176-.536.147-.454.26-.816.273-.875.224-.726.421-1.38c.067-.22-.02-.337-.088-.391l-.019-.014-.025-.015c-2.353-1.248-5.173-1.93-7.947-1.93-5.08 0-8.819 2.62-8.819 7.329v.082c0 3.759 2.496 5.387 5.915 6.496l.243.077.246.076.248.074.252.073.254.072.256.071.259.07.13.035.55.157.367.106.277.082.198.061.128.04.185.059.118.039.115.039.111.039.107.039.103.039.051.02.097.04.048.02.092.04.088.04.084.041.081.041c.511.268.776.569.776.983v.082c0 .778-.65 1.187-1.991 1.187-2.157 0-4.714-.772-7.12-2.281l-.116-.074-.025-.015-.029-.015-.032-.015c-.106-.044-.251-.065-.332.079l-1.527 4.645-.051.153c-.103.295.109.504.212.565 2.713 1.602 5.831 2.403 8.979 2.403zm20.475-1.265V27.17a.16.16 0 0 1 .041-.106l2.707-2.996c.059-.065.158-.069.223-.011.009.008.017.018.024.028l6.887 10.19a.63.63 0 0 0 .52.277h7.894a.63.63 0 0 0 .519-.99l-10.382-15.267c-.041-.06-.036-.14.012-.194l9.756-11.126c.23-.262.205-.662-.055-.893-.115-.102-.263-.158-.416-.158h-7.614a.63.63 0 0 0-.479.223l-9.36 11.065c-.056.066-.155.075-.222.018-.035-.03-.055-.074-.055-.12V6.557a.63.63 0 0 0-.629-.633h-6.618a.63.63 0 0 0-.63.633V33.92a.63.63 0 0 0 .63.633h6.618a.63.63 0 0 0 .629-.633zm29.554 0V16.93a.63.63 0 0 0-.629-.633h-6.448a.63.63 0 0 0-.629.633v16.99a.63.63 0 0 0 .629.633h6.448a.63.63 0 0 0 .629-.633zm13.423 1.107c1.945 0 3.625-.433 4.951-1.088l.096-.048.026-.014.028-.017c.117-.074.267-.222.267-.559v-5.177c0-.267-.213-.294-.37-.268l-.035.007-.047.013c-.01.003-.019.006-.027.01l-.012.005c-.785.321-1.597.517-2.437.517-1.423 0-2.115-.654-2.115-2.206v-7.36c0-.087.071-.158.158-.158h4.337a.63.63 0 0 0 .629-.633v-4.946a.63.63 0 0 0-.629-.633h-4.337c-.087 0-.158-.071-.158-.158V7.506a.63.63 0 0 0-.629-.633h-6.428a.63.63 0 0 0-.629.633v4.807c0 .087-.07.158-.157.158h-1.816a.63.63 0 0 0-.629.633v4.946a.63.63 0 0 0 .629.633h1.816c.087 0 .157.071.157.158v8.872c0 5.271 2.725 7.314 7.361 7.314z"
|
|
32
|
+
fill="#fff"
|
|
33
|
+
/>
|
|
34
|
+
<path
|
|
35
|
+
d="M61.846.936c3.35.413 4.944 4.005 4.92 8.746l.017-.013c-5.497 4.462-16.323 7.515-26.958 1.71l.011-.016c1.568.832 3.224 1.475 5.172 1.715 2.386.294 4.303-1.023 6.043-2.889l.124-.134.062-.068.123-.137.123-.138.122-.14.121-.142.061-.071.121-.144.12-.145.146-.178.073-.09.182-.226.181-.228.144-.184.144-.185.143-.185.215-.279 1.091-1.431.209-.271.209-.269.14-.178.14-.177.14-.175.141-.173.141-.172.113-.136.113-.135.114-.133.114-.132.057-.065.114-.13.057-.064.115-.127.173-.187.116-.123.175-.18.117-.118C58.328 1.663 59.933.7 61.846.936z"
|
|
36
|
+
fill="white"
|
|
37
|
+
/>
|
|
38
|
+
<path
|
|
39
|
+
d="M26.763 28.981l.011.013c-1.414-.671-2.883-1.176-4.519-1.378-1.738-.214-3.244.513-4.634 1.704l-.11.095-.163.146-.108.1-.108.101-.268.261-.106.107-.106.109-.106.11-.053.056-.105.112-.053.057-.125.136-.124.138-.124.139-.062.07-.123.142-.123.143-.122.145-.122.146-.061.073-.15.183-.075.092-.149.185-.075.093-.149.187-.149.188-.223.283-.296.38-.671.866-.222.285-.222.283-.148.188-.223.28-.149.185-.149.183-.149.182-.15.18-.117.139-.118.138-.118.136-.118.135-.119.133-.119.132-.119.13-.06.064-.12.127-.1.104-.1.103-.1.101-.151.15-.101.098-.102.096-.051.048-.102.094-.206.183-.103.089-.052.044-.104.086c-1.302 1.066-2.706 1.698-4.305 1.5-3.321-.41-4.98-3.93-5.064-8.601l-.097.09c6.351-5.963 17.155-6.757 26.506-2.264z"
|
|
40
|
+
fill="white"
|
|
41
|
+
fillOpacity="0.4"
|
|
42
|
+
/>
|
|
43
|
+
<path
|
|
44
|
+
d="M42.216 35.925c-2.861-.398-5.212-1.275-7.302-2.318l-.189-.095-.188-.096-.186-.097-.231-.122-.229-.123-.182-.099-.226-.125-.224-.126-.178-.101-.177-.102-.264-.153-.349-.205-.278-.166-.276-.166-.411-.249-1.214-.738-.334-.201-.333-.199-2.669-1.45-.012-.013c-9.258-4.447-19.94-3.714-26.315 2.087l-.095.088C.156 20.101 8.779 2.598 25.068 4.608c2.854.352 5.141 1.176 7.14 2.181l.178.09.177.091.175.092.087.046.173.093.172.094.17.095.085.048.211.12.209.121.166.097.165.098.164.098.163.099.162.099.161.099.16.1.261.164.13.082.258.164.256.164 1.137.733.25.161.25.159.312.197.312.194a31.02 31.02 0 0 0 1.568.911l.199.106c10.506 5.694 21.166 2.775 26.7-1.604l.149-.12c-.055 10.998-8.815 28.185-24.55 26.243z"
|
|
45
|
+
fill="white"
|
|
46
|
+
fillOpacity="0.701961"
|
|
47
|
+
/>
|
|
48
|
+
</LogoSvg>
|
|
49
|
+
)
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
export default withTheme(NewsKitLogoFull)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import {
|
|
3
|
+
withTheme,
|
|
4
|
+
styled,
|
|
5
|
+
getSizingCssFromTheme,
|
|
6
|
+
getColorCssFromTheme,
|
|
7
|
+
} from 'newskit'
|
|
8
|
+
|
|
9
|
+
interface StyledLogoPorps {
|
|
10
|
+
viewBox?: string
|
|
11
|
+
$color: string
|
|
12
|
+
size: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type NewsKitLogoProps = Omit<StyledLogoPorps, '$color'> & {
|
|
16
|
+
color: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const LogoSvg = styled.svg<StyledLogoPorps>`
|
|
20
|
+
display: inline-block;
|
|
21
|
+
${getColorCssFromTheme('fill', 'white')};
|
|
22
|
+
${getColorCssFromTheme('color', 'white')};
|
|
23
|
+
${getSizingCssFromTheme('width', 'sizing120')};
|
|
24
|
+
`
|
|
25
|
+
|
|
26
|
+
const NewsKitLogoShort = React.forwardRef<HTMLDivElement, NewsKitLogoProps>(
|
|
27
|
+
({ color, ...props }, ref) => (
|
|
28
|
+
<LogoSvg viewBox="0 0 244 40" height="48px" $color={color} {...props}>
|
|
29
|
+
<title>NewsKit Logo</title>
|
|
30
|
+
<path
|
|
31
|
+
d="M61.846.936c3.35.413 4.944 4.005 4.92 8.746l.017-.013c-5.497 4.462-16.323 7.515-26.958 1.71l.011-.016c1.568.832 3.224 1.475 5.172 1.715 2.386.294 4.303-1.023 6.043-2.889l.124-.134.062-.068.123-.137.123-.138.122-.14.121-.142.061-.071.121-.144.12-.145.146-.178.073-.09.182-.226.181-.228.144-.184.144-.185.143-.185.215-.279 1.091-1.431.209-.271.209-.269.14-.178.14-.177.14-.175.141-.173.141-.172.113-.136.113-.135.114-.133.114-.132.057-.065.114-.13.057-.064.115-.127.173-.187.116-.123.175-.18.117-.118C58.328 1.663 59.933.7 61.846.936z"
|
|
32
|
+
fill="white"
|
|
33
|
+
/>
|
|
34
|
+
<path
|
|
35
|
+
d="M26.763 28.981l.011.013c-1.414-.671-2.883-1.176-4.519-1.378-1.738-.214-3.244.513-4.634 1.704l-.11.095-.163.146-.108.1-.108.101-.268.261-.106.107-.106.109-.106.11-.053.056-.105.112-.053.057-.125.136-.124.138-.124.139-.062.07-.123.142-.123.143-.122.145-.122.146-.061.073-.15.183-.075.092-.149.185-.075.093-.149.187-.149.188-.223.283-.296.38-.671.866-.222.285-.222.283-.148.188-.223.28-.149.185-.149.183-.149.182-.15.18-.117.139-.118.138-.118.136-.118.135-.119.133-.119.132-.119.13-.06.064-.12.127-.1.104-.1.103-.1.101-.151.15-.101.098-.102.096-.051.048-.102.094-.206.183-.103.089-.052.044-.104.086c-1.302 1.066-2.706 1.698-4.305 1.5-3.321-.41-4.98-3.93-5.064-8.601l-.097.09c6.351-5.963 17.155-6.757 26.506-2.264z"
|
|
36
|
+
fill="white"
|
|
37
|
+
fillOpacity="0.4"
|
|
38
|
+
/>
|
|
39
|
+
<path
|
|
40
|
+
d="M42.216 35.925c-2.861-.398-5.212-1.275-7.302-2.318l-.189-.095-.188-.096-.186-.097-.231-.122-.229-.123-.182-.099-.226-.125-.224-.126-.178-.101-.177-.102-.264-.153-.349-.205-.278-.166-.276-.166-.411-.249-1.214-.738-.334-.201-.333-.199-2.669-1.45-.012-.013c-9.258-4.447-19.94-3.714-26.315 2.087l-.095.088C.156 20.101 8.779 2.598 25.068 4.608c2.854.352 5.141 1.176 7.14 2.181l.178.09.177.091.175.092.087.046.173.093.172.094.17.095.085.048.211.12.209.121.166.097.165.098.164.098.163.099.162.099.161.099.16.1.261.164.13.082.258.164.256.164 1.137.733.25.161.25.159.312.197.312.194a31.02 31.02 0 0 0 1.568.911l.199.106c10.506 5.694 21.166 2.775 26.7-1.604l.149-.12c-.055 10.998-8.815 28.185-24.55 26.243z"
|
|
41
|
+
fill="white"
|
|
42
|
+
fillOpacity="0.701961"
|
|
43
|
+
/>
|
|
44
|
+
</LogoSvg>
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
export default withTheme(NewsKitLogoShort)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {
|
|
3
|
+
TitleBar,
|
|
4
|
+
styled,
|
|
5
|
+
getColorCssFromTheme,
|
|
6
|
+
Block,
|
|
7
|
+
BlockProps,
|
|
8
|
+
} from 'newskit'
|
|
9
|
+
|
|
10
|
+
type StyledTitleBarBlockProps = {
|
|
11
|
+
colour?: string
|
|
12
|
+
} & BlockProps
|
|
13
|
+
|
|
14
|
+
const StyledTitleBarBlock = styled(Block)<StyledTitleBarBlockProps>`
|
|
15
|
+
${(props) =>
|
|
16
|
+
props.colour
|
|
17
|
+
? getColorCssFromTheme('background', props.colour)
|
|
18
|
+
: getColorCssFromTheme('background', 'inkBrand010')};
|
|
19
|
+
`
|
|
20
|
+
|
|
21
|
+
type SectionTitleBarProps = {
|
|
22
|
+
title: string
|
|
23
|
+
actionItem?: React.ComponentType
|
|
24
|
+
colour?: string
|
|
25
|
+
stylePreset?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const SectionTitleBar: React.FC<SectionTitleBarProps> = ({
|
|
29
|
+
title,
|
|
30
|
+
actionItem,
|
|
31
|
+
colour,
|
|
32
|
+
stylePreset,
|
|
33
|
+
}) => (
|
|
34
|
+
<StyledTitleBarBlock
|
|
35
|
+
colour={colour}
|
|
36
|
+
marginBlockEnd="space060"
|
|
37
|
+
data-testid="SectionTitleBar"
|
|
38
|
+
>
|
|
39
|
+
<TitleBar
|
|
40
|
+
actionItem={actionItem}
|
|
41
|
+
overrides={{
|
|
42
|
+
heading: {
|
|
43
|
+
typographyPreset: {
|
|
44
|
+
xl: 'editorialHeadline070',
|
|
45
|
+
md: 'editorialHeadline060',
|
|
46
|
+
xs: 'editorialHeadline050',
|
|
47
|
+
},
|
|
48
|
+
stylePreset: stylePreset || 'inkInverse',
|
|
49
|
+
},
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
{title}
|
|
53
|
+
</TitleBar>
|
|
54
|
+
</StyledTitleBarBlock>
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
export default SectionTitleBar
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Button, toNewsKitIcon } from 'newskit'
|
|
3
|
+
|
|
4
|
+
import { Share as FilledShare } from '@emotion-icons/material/Share'
|
|
5
|
+
|
|
6
|
+
const IconFilledShare = toNewsKitIcon(FilledShare)
|
|
7
|
+
|
|
8
|
+
const ShareButton = () => (
|
|
9
|
+
<Button
|
|
10
|
+
size="small"
|
|
11
|
+
overrides={{ stylePreset: 'buttonOutlinedPrimary' }}
|
|
12
|
+
href="https://www.newskit.co.uk/"
|
|
13
|
+
>
|
|
14
|
+
<IconFilledShare />
|
|
15
|
+
Share
|
|
16
|
+
</Button>
|
|
17
|
+
)
|
|
18
|
+
export default ShareButton
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Button, toNewsKitIcon } from 'newskit'
|
|
3
|
+
|
|
4
|
+
import { ChevronRight as FilledChevronRight } from '@emotion-icons/material/ChevronRight'
|
|
5
|
+
|
|
6
|
+
const IconFilledChevronRight = toNewsKitIcon(FilledChevronRight)
|
|
7
|
+
|
|
8
|
+
const ViewMoreButton: React.FC<{ href: string }> = ({ href }) => (
|
|
9
|
+
<Button
|
|
10
|
+
overrides={{
|
|
11
|
+
stylePreset: 'inkBrand010',
|
|
12
|
+
}}
|
|
13
|
+
href={href}
|
|
14
|
+
>
|
|
15
|
+
View all
|
|
16
|
+
<IconFilledChevronRight overrides={{ size: 'iconSize020' }} />
|
|
17
|
+
</Button>
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
export default ViewMoreButton
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { NextLink } from '@newskit-render/shared-components'
|
|
3
|
+
import { Divider, TextBlock, Block, Visible, styled } from 'newskit'
|
|
4
|
+
import { IconNavLinkProps } from './types'
|
|
5
|
+
|
|
6
|
+
const StylesVerticalVisible = styled(Visible)`
|
|
7
|
+
height: 100%;
|
|
8
|
+
`
|
|
9
|
+
|
|
10
|
+
const StylesHorizontalVisible = styled(Visible)`
|
|
11
|
+
width: 100%;
|
|
12
|
+
`
|
|
13
|
+
|
|
14
|
+
const IconBlock = styled(Block)<{ top?: string }>`
|
|
15
|
+
position: relative;
|
|
16
|
+
top: ${({ top }) => top || '3'}px;
|
|
17
|
+
`
|
|
18
|
+
|
|
19
|
+
const IconNavLink: React.FC<IconNavLinkProps> = ({
|
|
20
|
+
icon,
|
|
21
|
+
href,
|
|
22
|
+
text,
|
|
23
|
+
showVerticalDivider = { md: true, lg: true, xl: true },
|
|
24
|
+
showHorizontalDivider = { xs: true, sm: true },
|
|
25
|
+
spaceInline,
|
|
26
|
+
typographyPreset,
|
|
27
|
+
stylePreset,
|
|
28
|
+
iconTop,
|
|
29
|
+
}) => (
|
|
30
|
+
<>
|
|
31
|
+
{showVerticalDivider && (
|
|
32
|
+
<StylesVerticalVisible {...showVerticalDivider}>
|
|
33
|
+
<Divider vertical />
|
|
34
|
+
</StylesVerticalVisible>
|
|
35
|
+
)}
|
|
36
|
+
<Block spaceInline={spaceInline} />
|
|
37
|
+
<Block as="span">
|
|
38
|
+
{showHorizontalDivider && (
|
|
39
|
+
<>
|
|
40
|
+
<StylesHorizontalVisible {...showHorizontalDivider}>
|
|
41
|
+
<Divider />
|
|
42
|
+
<Block
|
|
43
|
+
data-testid="myBlock"
|
|
44
|
+
marginBlockEnd={{
|
|
45
|
+
xs: 'space040',
|
|
46
|
+
md: 'space000',
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
</StylesHorizontalVisible>
|
|
50
|
+
</>
|
|
51
|
+
)}
|
|
52
|
+
<NextLink
|
|
53
|
+
type="standalone"
|
|
54
|
+
overrides={{
|
|
55
|
+
typographyPreset,
|
|
56
|
+
stylePreset,
|
|
57
|
+
}}
|
|
58
|
+
href={href}
|
|
59
|
+
>
|
|
60
|
+
<IconBlock top={iconTop}>{icon}</IconBlock>
|
|
61
|
+
<TextBlock as="span" typographyPreset={typographyPreset}>
|
|
62
|
+
{text}
|
|
63
|
+
</TextBlock>
|
|
64
|
+
</NextLink>
|
|
65
|
+
<Block spaceInline={spaceInline} />
|
|
66
|
+
</Block>
|
|
67
|
+
</>
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
export default IconNavLink
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import IconNavLink from '../IconNavLink'
|
|
3
|
+
import { IconAccount } from '../../icons/IconAccount'
|
|
4
|
+
import { renderWithTheme } from '../../../../helpers/test-utils'
|
|
5
|
+
|
|
6
|
+
describe('IconNavLink', () => {
|
|
7
|
+
test('should render with devider', () => {
|
|
8
|
+
const { getByTestId, getByText, getAllByTestId } = renderWithTheme(
|
|
9
|
+
IconNavLink,
|
|
10
|
+
{
|
|
11
|
+
icon: <IconAccount data-testid="test-icon" />,
|
|
12
|
+
href: '/account',
|
|
13
|
+
text: 'Account',
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
expect(getAllByTestId('divider')[0]).toBeInTheDocument()
|
|
17
|
+
expect(getByTestId('test-icon')).toBeInTheDocument()
|
|
18
|
+
expect(getByText('Account')).toBeInTheDocument()
|
|
19
|
+
expect(getByText('Account').closest('a')).toHaveAttribute(
|
|
20
|
+
'href',
|
|
21
|
+
'/account'
|
|
22
|
+
)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
test('should render without divider', () => {
|
|
26
|
+
const { queryByTestId } = renderWithTheme(IconNavLink, {
|
|
27
|
+
icon: <IconAccount data-testid="test-icon" />,
|
|
28
|
+
href: '/account',
|
|
29
|
+
text: 'Account',
|
|
30
|
+
showVerticalDivider: false,
|
|
31
|
+
showHorizontalDivider: false,
|
|
32
|
+
})
|
|
33
|
+
expect(queryByTestId('divider')).not.toBeInTheDocument()
|
|
34
|
+
})
|
|
35
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactElement } from 'react'
|
|
2
|
+
import { NewsKitIcon, MQ } from 'newskit'
|
|
3
|
+
|
|
4
|
+
type ShowDivider =
|
|
5
|
+
| {
|
|
6
|
+
xs?: boolean
|
|
7
|
+
sm?: boolean
|
|
8
|
+
md?: boolean
|
|
9
|
+
lg?: boolean
|
|
10
|
+
xl?: boolean
|
|
11
|
+
}
|
|
12
|
+
| false
|
|
13
|
+
|
|
14
|
+
export interface IconNavLinkProps {
|
|
15
|
+
icon: ReactElement<NewsKitIcon>
|
|
16
|
+
href: string
|
|
17
|
+
text: string
|
|
18
|
+
showVerticalDivider?: ShowDivider
|
|
19
|
+
showHorizontalDivider?: ShowDivider
|
|
20
|
+
spaceInline?: MQ<string>
|
|
21
|
+
typographyPreset?: MQ<string>
|
|
22
|
+
stylePreset?: MQ<string>
|
|
23
|
+
iconTop?: string
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { customToNewsKitIcon, Svg } from 'newskit'
|
|
3
|
+
|
|
4
|
+
export const IconAccount = customToNewsKitIcon('IconAccount', (props) => (
|
|
5
|
+
<Svg {...props} height="24px" width="24px" viewBox="0 0 24 24">
|
|
6
|
+
<path
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
|
+
d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM7.07 18.28C7.5 17.38 10.12 16.5 12 16.5C13.88 16.5 16.51 17.38 16.93 18.28C15.57 19.36 13.86 20 12 20C10.14 20 8.43 19.36 7.07 18.28ZM12 14.5C13.46 14.5 16.93 15.09 18.36 16.83C19.38 15.49 20 13.82 20 12C20 7.59 16.41 4 12 4C7.59 4 4 7.59 4 12C4 13.82 4.62 15.49 5.64 16.83C7.07 15.09 10.54 14.5 12 14.5ZM12 6C10.06 6 8.5 7.56 8.5 9.5C8.5 11.44 10.06 13 12 13C13.94 13 15.5 11.44 15.5 9.5C15.5 7.56 13.94 6 12 6ZM10.5 9.5C10.5 10.33 11.17 11 12 11C12.83 11 13.5 10.33 13.5 9.5C13.5 8.67 12.83 8 12 8C11.17 8 10.5 8.67 10.5 9.5Z"
|
|
10
|
+
fill="#FFFFFF"
|
|
11
|
+
/>
|
|
12
|
+
</Svg>
|
|
13
|
+
))
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Svg, customToNewsKitIcon } from 'newskit'
|
|
3
|
+
|
|
4
|
+
export const IconFilledTwitter = customToNewsKitIcon(
|
|
5
|
+
'IconFilledTwitter',
|
|
6
|
+
(props) => (
|
|
7
|
+
<Svg {...props} viewBox="0 0 24 24">
|
|
8
|
+
<path
|
|
9
|
+
fillRule="nonzero"
|
|
10
|
+
d="M8.28984,21 C15.83736,21 19.96472,14.4602319 19.96472,8.78946539 C19.96472,8.60363327 19.96112,8.41863784 19.95296,8.23464647 C20.75408,7.62895589 21.45056,6.87316048 22,6.01260963 C21.26472,6.35415252 20.47352,6.58441367 19.64352,6.68816506 C20.49072,6.15702487 21.14112,5.31630393 21.44784,4.31426631 C20.65488,4.80583036 19.77704,5.1633543 18.8424,5.35588007 C18.09368,4.52176909 17.02728,4 15.84728,4 C13.58104,4 11.74336,5.92199451 11.74336,8.29129138 C11.74336,8.62814872 11.77944,8.95555129 11.84976,9.2698176 C8.4396,9.09051177 5.4156,7.38271368 3.392,4.78600045 C3.03928,5.42005532 2.83632,6.15702487 2.83632,6.94294166 C2.83632,8.43194145 3.56072,9.74632096 4.66224,10.5152526 C3.98928,10.493582 3.35688,10.3001358 2.80384,9.97833919 C2.80288,9.99624467 2.80288,10.0142338 2.80288,10.0330597 C2.80288,12.111769 4.21752,13.8469273 6.09488,14.2404296 C5.75032,14.3384914 5.3876,14.3913711 5.0132,14.3913711 C4.74888,14.3913711 4.49176,14.3640109 4.24184,14.3139759 C4.76424,16.0190129 6.27896,17.2597624 8.07512,17.2947366 C6.67048,18.4457914 4.90136,19.1317219 2.97888,19.1317219 C2.64776,19.1317219 2.3212,19.1119757 2,19.0723159 C3.81608,20.2894703 5.97224,21 8.28984,21"
|
|
11
|
+
/>
|
|
12
|
+
</Svg>
|
|
13
|
+
)
|
|
14
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { styled, toNewsKitIcon } from 'newskit'
|
|
2
|
+
|
|
3
|
+
import { ChevronRight as FilledChevronRight } from '@emotion-icons/material/ChevronRight'
|
|
4
|
+
|
|
5
|
+
const IconFilledChevronRight = toNewsKitIcon(FilledChevronRight)
|
|
6
|
+
|
|
7
|
+
const StyledIconFilledChevronRight = styled(IconFilledChevronRight)`
|
|
8
|
+
top: 1px;
|
|
9
|
+
position: relative;
|
|
10
|
+
`
|
|
11
|
+
|
|
12
|
+
export default StyledIconFilledChevronRight
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Footer tests should render footer 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="css-sxhtf1"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="css-8atxkm"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
class="css-1w88buo"
|
|
13
|
+
data-testid="PageLayout"
|
|
14
|
+
>
|
|
15
|
+
<div
|
|
16
|
+
class="css-18d6eiw"
|
|
17
|
+
data-testid="PageLayout"
|
|
18
|
+
>
|
|
19
|
+
<div
|
|
20
|
+
class="css-2e5lv5"
|
|
21
|
+
>
|
|
22
|
+
<svg
|
|
23
|
+
class="css-kgdu16"
|
|
24
|
+
height="48px"
|
|
25
|
+
viewBox="0 0 244 40"
|
|
26
|
+
>
|
|
27
|
+
<title>
|
|
28
|
+
NewsKit Logo
|
|
29
|
+
</title>
|
|
30
|
+
<path
|
|
31
|
+
d="M61.846.936c3.35.413 4.944 4.005 4.92 8.746l.017-.013c-5.497 4.462-16.323 7.515-26.958 1.71l.011-.016c1.568.832 3.224 1.475 5.172 1.715 2.386.294 4.303-1.023 6.043-2.889l.124-.134.062-.068.123-.137.123-.138.122-.14.121-.142.061-.071.121-.144.12-.145.146-.178.073-.09.182-.226.181-.228.144-.184.144-.185.143-.185.215-.279 1.091-1.431.209-.271.209-.269.14-.178.14-.177.14-.175.141-.173.141-.172.113-.136.113-.135.114-.133.114-.132.057-.065.114-.13.057-.064.115-.127.173-.187.116-.123.175-.18.117-.118C58.328 1.663 59.933.7 61.846.936z"
|
|
32
|
+
fill="white"
|
|
33
|
+
/>
|
|
34
|
+
<path
|
|
35
|
+
d="M26.763 28.981l.011.013c-1.414-.671-2.883-1.176-4.519-1.378-1.738-.214-3.244.513-4.634 1.704l-.11.095-.163.146-.108.1-.108.101-.268.261-.106.107-.106.109-.106.11-.053.056-.105.112-.053.057-.125.136-.124.138-.124.139-.062.07-.123.142-.123.143-.122.145-.122.146-.061.073-.15.183-.075.092-.149.185-.075.093-.149.187-.149.188-.223.283-.296.38-.671.866-.222.285-.222.283-.148.188-.223.28-.149.185-.149.183-.149.182-.15.18-.117.139-.118.138-.118.136-.118.135-.119.133-.119.132-.119.13-.06.064-.12.127-.1.104-.1.103-.1.101-.151.15-.101.098-.102.096-.051.048-.102.094-.206.183-.103.089-.052.044-.104.086c-1.302 1.066-2.706 1.698-4.305 1.5-3.321-.41-4.98-3.93-5.064-8.601l-.097.09c6.351-5.963 17.155-6.757 26.506-2.264z"
|
|
36
|
+
fill="white"
|
|
37
|
+
fill-opacity="0.4"
|
|
38
|
+
/>
|
|
39
|
+
<path
|
|
40
|
+
d="M42.216 35.925c-2.861-.398-5.212-1.275-7.302-2.318l-.189-.095-.188-.096-.186-.097-.231-.122-.229-.123-.182-.099-.226-.125-.224-.126-.178-.101-.177-.102-.264-.153-.349-.205-.278-.166-.276-.166-.411-.249-1.214-.738-.334-.201-.333-.199-2.669-1.45-.012-.013c-9.258-4.447-19.94-3.714-26.315 2.087l-.095.088C.156 20.101 8.779 2.598 25.068 4.608c2.854.352 5.141 1.176 7.14 2.181l.178.09.177.091.175.092.087.046.173.093.172.094.17.095.085.048.211.12.209.121.166.097.165.098.164.098.163.099.162.099.161.099.16.1.261.164.13.082.258.164.256.164 1.137.733.25.161.25.159.312.197.312.194a31.02 31.02 0 0 0 1.568.911l.199.106c10.506 5.694 21.166 2.775 26.7-1.604l.149-.12c-.055 10.998-8.815 28.185-24.55 26.243z"
|
|
41
|
+
fill="white"
|
|
42
|
+
fill-opacity="0.701961"
|
|
43
|
+
/>
|
|
44
|
+
</svg>
|
|
45
|
+
</div>
|
|
46
|
+
<div
|
|
47
|
+
class="css-2e5lv5"
|
|
48
|
+
>
|
|
49
|
+
<hr
|
|
50
|
+
aria-hidden="true"
|
|
51
|
+
class="css-13iiewa"
|
|
52
|
+
data-testid="divider"
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
<div
|
|
56
|
+
class="css-hx18jh"
|
|
57
|
+
>
|
|
58
|
+
<span
|
|
59
|
+
class="css-1cpcft7"
|
|
60
|
+
>
|
|
61
|
+
<a
|
|
62
|
+
aria-label="NavLink One"
|
|
63
|
+
class="css-1ulbpfm"
|
|
64
|
+
href="/link-one"
|
|
65
|
+
>
|
|
66
|
+
<span
|
|
67
|
+
class="css-17x5lw"
|
|
68
|
+
>
|
|
69
|
+
<span
|
|
70
|
+
class="css-yk25sg"
|
|
71
|
+
>
|
|
72
|
+
NavLink One
|
|
73
|
+
</span>
|
|
74
|
+
</span>
|
|
75
|
+
</a>
|
|
76
|
+
</span>
|
|
77
|
+
<span
|
|
78
|
+
class="css-1cpcft7"
|
|
79
|
+
>
|
|
80
|
+
<a
|
|
81
|
+
aria-label="NavLink Two"
|
|
82
|
+
class="css-1ulbpfm"
|
|
83
|
+
href="/link-two"
|
|
84
|
+
>
|
|
85
|
+
<span
|
|
86
|
+
class="css-17x5lw"
|
|
87
|
+
>
|
|
88
|
+
<span
|
|
89
|
+
class="css-yk25sg"
|
|
90
|
+
>
|
|
91
|
+
NavLink Two
|
|
92
|
+
</span>
|
|
93
|
+
</span>
|
|
94
|
+
</a>
|
|
95
|
+
</span>
|
|
96
|
+
<span
|
|
97
|
+
class="css-1cpcft7"
|
|
98
|
+
>
|
|
99
|
+
<a
|
|
100
|
+
aria-label="NavLink Three"
|
|
101
|
+
class="css-1ulbpfm"
|
|
102
|
+
href="/link-three"
|
|
103
|
+
>
|
|
104
|
+
<span
|
|
105
|
+
class="css-17x5lw"
|
|
106
|
+
>
|
|
107
|
+
<span
|
|
108
|
+
class="css-yk25sg"
|
|
109
|
+
>
|
|
110
|
+
NavLink Three
|
|
111
|
+
</span>
|
|
112
|
+
</span>
|
|
113
|
+
</a>
|
|
114
|
+
</span>
|
|
115
|
+
<span
|
|
116
|
+
class="css-1cpcft7"
|
|
117
|
+
>
|
|
118
|
+
<a
|
|
119
|
+
aria-label="NavLink Four"
|
|
120
|
+
class="css-1ulbpfm"
|
|
121
|
+
href="/link-four"
|
|
122
|
+
>
|
|
123
|
+
<span
|
|
124
|
+
class="css-17x5lw"
|
|
125
|
+
>
|
|
126
|
+
<span
|
|
127
|
+
class="css-yk25sg"
|
|
128
|
+
>
|
|
129
|
+
NavLink Four
|
|
130
|
+
</span>
|
|
131
|
+
</span>
|
|
132
|
+
</a>
|
|
133
|
+
</span>
|
|
134
|
+
<span
|
|
135
|
+
class="css-1cpcft7"
|
|
136
|
+
>
|
|
137
|
+
<a
|
|
138
|
+
aria-label="NavLink Five"
|
|
139
|
+
class="css-1ulbpfm"
|
|
140
|
+
href="/link-five"
|
|
141
|
+
>
|
|
142
|
+
<span
|
|
143
|
+
class="css-17x5lw"
|
|
144
|
+
>
|
|
145
|
+
<span
|
|
146
|
+
class="css-yk25sg"
|
|
147
|
+
>
|
|
148
|
+
NavLink Five
|
|
149
|
+
</span>
|
|
150
|
+
</span>
|
|
151
|
+
</a>
|
|
152
|
+
</span>
|
|
153
|
+
<span
|
|
154
|
+
class="css-1cpcft7"
|
|
155
|
+
>
|
|
156
|
+
<a
|
|
157
|
+
aria-label="NavLink Six"
|
|
158
|
+
class="css-1ulbpfm"
|
|
159
|
+
href="/link-six"
|
|
160
|
+
>
|
|
161
|
+
<span
|
|
162
|
+
class="css-17x5lw"
|
|
163
|
+
>
|
|
164
|
+
<span
|
|
165
|
+
class="css-yk25sg"
|
|
166
|
+
>
|
|
167
|
+
NavLink Six
|
|
168
|
+
</span>
|
|
169
|
+
</span>
|
|
170
|
+
</a>
|
|
171
|
+
</span>
|
|
172
|
+
</div>
|
|
173
|
+
<div
|
|
174
|
+
class="css-2e5lv5"
|
|
175
|
+
>
|
|
176
|
+
<hr
|
|
177
|
+
aria-hidden="true"
|
|
178
|
+
class="css-13iiewa"
|
|
179
|
+
data-testid="divider"
|
|
180
|
+
/>
|
|
181
|
+
</div>
|
|
182
|
+
<p
|
|
183
|
+
class="css-tiln3q"
|
|
184
|
+
>
|
|
185
|
+
Copyright © YYYY News Corp. All rights reserved.
|
|
186
|
+
</p>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
</DocumentFragment>
|
|
192
|
+
`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { renderWithTheme } from '../../helpers/test-utils'
|
|
2
|
+
import Footer from '.'
|
|
3
|
+
|
|
4
|
+
jest.mock('../../helpers/getYear', () => ({
|
|
5
|
+
getYear: jest.fn().mockReturnValue('YYYY'),
|
|
6
|
+
}))
|
|
7
|
+
|
|
8
|
+
describe('Footer tests', () => {
|
|
9
|
+
test('should render footer', () => {
|
|
10
|
+
const { asFragment } = renderWithTheme(Footer)
|
|
11
|
+
expect(asFragment()).toMatchSnapshot()
|
|
12
|
+
})
|
|
13
|
+
})
|