From 4a5fc8e8bbc75937bcde894c012da7ef44aabbbd Mon Sep 17 00:00:00 2001 From: "Malin J." Date: Mon, 10 Jun 2024 15:18:26 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Codesplit=20and=20refa?= =?UTF-8?q?ctor=20types=20#2307?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/common/helpers/dateUtilities.ts | 2 +- web/common/helpers/getOpenGraphImages.ts | 2 +- web/common/helpers/getUrlFromAction.ts | 2 +- .../src/Backgrounds/BackgroundContainer.tsx | 2 +- .../src/Backgrounds/ColouredContainer.tsx | 2 +- .../Backgrounds/ImageBackgroundContainer.tsx | 2 +- web/components/src/Fact/FactBox.tsx | 2 +- web/components/src/Link/Link.tsx | 2 +- web/components/src/Table/Table.tsx | 2 +- web/components/utils/backgroundColours.tsx | 2 +- web/core/Link/BaseLink.tsx | 2 +- web/core/Link/ButtonLink.tsx | 2 +- web/core/Link/ReadMoreLink.tsx | 2 +- web/core/Link/ResourceLink.tsx | 2 +- web/pageComponents/cards/EventsCard.tsx | 2 +- .../cards/FeaturedEventCard.tsx | 2 +- web/pageComponents/cards/MagazineCard.tsx | 2 +- web/pageComponents/cards/NewsCard.tsx | 2 +- web/pageComponents/cards/PeopleCard/CV.tsx | 2 +- .../cards/PeopleCard/PeopleCard.tsx | 2 +- web/pageComponents/cards/SimpleCard.tsx | 2 +- web/pageComponents/cards/TopicPageCard.tsx | 2 +- .../landingPages/ContentGroup.tsx | 2 +- web/pageComponents/news/LatestNews.tsx | 2 +- .../pageTemplates/ErrorPage.tsx | 2 +- web/pageComponents/pageTemplates/Event.tsx | 2 +- .../pageTemplates/LandingPage.tsx | 2 +- .../pageTemplates/MagazineIndexPage.tsx | 2 +- .../pageTemplates/MagazinePage.tsx | 2 +- web/pageComponents/pageTemplates/News.tsx | 2 +- .../pageTemplates/TopicPage.tsx | 2 +- .../pageTemplates/shared/SharedBanner.tsx | 2 +- .../shared/SharedPageContent.tsx | 2 +- .../searchIndexPages/magazineIndex/Hits.tsx | 2 +- web/pageComponents/shared/ButtonLink.tsx | 2 +- web/pageComponents/shared/ContactList.tsx | 2 +- web/pageComponents/shared/Footer.tsx | 2 +- web/pageComponents/shared/Header.tsx | 2 +- .../shared/Hero/DefaultHero.tsx | 2 +- .../shared/Hero/DefaultHeroImage.tsx | 2 +- .../shared/Hero/FiftyFiftyHero.tsx | 2 +- .../shared/IframeCarousel/IframeCarousel.tsx | 2 +- .../shared/ImageCarousel/ImageCarousel.tsx | 2 +- .../ImageCarousel/ImageCarouselItem.tsx | 2 +- web/pageComponents/shared/Layout.tsx | 2 +- web/pageComponents/shared/Quote.tsx | 2 +- web/pageComponents/shared/RelatedContent.tsx | 2 +- web/pageComponents/shared/Seo.tsx | 2 +- web/pageComponents/shared/Teaser.tsx | 2 +- web/pageComponents/shared/VideoPlayer.tsx | 2 +- .../shared/VideoPlayerCarousel.tsx | 2 +- .../shared/iframe/BasicIFrame.tsx | 2 +- web/pageComponents/shared/image/Caption.tsx | 2 +- .../portableText/components/BasicIframe.tsx | 2 +- .../portableText/components/news/Fact.tsx | 2 +- .../components/news/FigureWithLayout.tsx | 2 +- .../portableText/components/news/Quote.tsx | 2 +- .../shared/siteMenu/FeaturedContent.tsx | 2 +- .../shared/siteMenu/MenuGroup.tsx | 2 +- .../shared/siteMenu/SiteMenu.tsx | 2 +- .../shared/siteMenu/simple/SimpleMenuItem.tsx | 2 +- .../shared/siteMenu/simple/SimpleSiteMenu.tsx | 2 +- .../shared/textTeaser/TextTeaser.tsx | 2 +- .../topicPages/Accordion/Accordion.tsx | 2 +- .../topicPages/Accordion/AccordionBlock.tsx | 2 +- .../topicPages/AddToCalendar.tsx | 2 +- .../topicPages/CallToActions.tsx | 2 +- .../topicPages/CookieDeclaration.tsx | 2 +- web/pageComponents/topicPages/Figure.tsx | 2 +- web/pageComponents/topicPages/Form/Form.tsx | 2 +- .../topicPages/Form/SubscribeForm.tsx | 2 +- .../topicPages/FullWidthImage.tsx | 2 +- .../topicPages/FullWidthVideo.tsx | 2 +- web/pageComponents/topicPages/IFrame.tsx | 2 +- web/pageComponents/topicPages/NewsList.tsx | 2 +- web/pageComponents/topicPages/PageQuote.tsx | 2 +- .../topicPages/PromoTileArray.tsx | 2 +- .../topicPages/PromoTileButton.tsx | 2 +- web/pageComponents/topicPages/Promotion.tsx | 2 +- web/pageComponents/topicPages/StockValues.tsx | 2 +- web/pageComponents/topicPages/Table.tsx | 2 +- web/pageComponents/topicPages/TextBlock.tsx | 2 +- .../topicPages/TextWithIconArray.tsx | 2 +- .../topicPages/TwitterEmbed.tsx | 2 +- .../promotions/MultipleEventCards.tsx | 2 +- .../promotions/MultiplePromotions.tsx | 2 +- .../topicPages/promotions/SinglePromotion.tsx | 2 +- web/pages/404.tsx | 2 +- web/pages/500.tsx | 2 +- web/pages/api/news-letter-distribution.ts | 2 +- web/pages/api/subscription.ts | 2 +- web/pages/news/archive/[...pagePath].tsx | 2 +- web/sections/CallToActions/index.tsx | 2 +- .../CampaignBanner/CampaignBanner.tsx | 2 +- web/sections/Grid/Grid.tsx | 2 +- web/sections/Grid/GridFigure.tsx | 2 +- web/sections/Grid/GridLinkArrow.tsx | 2 +- web/sections/Grid/GridTeaser.tsx | 2 +- web/sections/Grid/GridTextBlock.tsx | 2 +- web/sections/Grid/mapGridContent.tsx | 2 +- web/sections/cards/CardsList/CardItem.tsx | 2 +- web/sections/cards/CardsList/CardsList.tsx | 2 +- web/types/algoliaIndexPage.ts | 6 +- web/types/cardTypes.ts | 68 +++ web/types/designOptionsTypes.ts | 29 + web/types/eventTypes.ts | 14 + web/types/gridTypes.ts | 63 +++ web/types/imageTypes.ts | 62 +++ web/types/index.ts | 9 + web/types/linkTypes.ts | 28 + web/types/menuTypes.ts | 58 ++ web/types/pageTypes.ts | 108 ++++ web/types/types.ts | 497 +----------------- web/types/videoTypes.ts | 88 ++++ 114 files changed, 654 insertions(+), 580 deletions(-) create mode 100644 web/types/cardTypes.ts create mode 100644 web/types/designOptionsTypes.ts create mode 100644 web/types/eventTypes.ts create mode 100644 web/types/gridTypes.ts create mode 100644 web/types/imageTypes.ts create mode 100644 web/types/linkTypes.ts create mode 100644 web/types/menuTypes.ts create mode 100644 web/types/pageTypes.ts create mode 100644 web/types/videoTypes.ts diff --git a/web/common/helpers/dateUtilities.ts b/web/common/helpers/dateUtilities.ts index 9a74da443..74069b0e7 100644 --- a/web/common/helpers/dateUtilities.ts +++ b/web/common/helpers/dateUtilities.ts @@ -1,6 +1,6 @@ import { getYear, getMonth, getDate, getHours, getMinutes, getSeconds } from 'date-fns' import { zonedTimeToUtc } from 'date-fns-tz' -import { EventDateType } from '../../../web/types/types' +import { EventDateType } from '../../../web/types/index' export const toDateParts = (datetime: Date): number[] => { return [ diff --git a/web/common/helpers/getOpenGraphImages.ts b/web/common/helpers/getOpenGraphImages.ts index 4b23d16f4..c57fed29e 100644 --- a/web/common/helpers/getOpenGraphImages.ts +++ b/web/common/helpers/getOpenGraphImages.ts @@ -1,6 +1,6 @@ import imageUrlBuilder from '@sanity/image-url' import { sanityClientWithEquinorCDN } from '../../lib/sanity.server' -import type { ImageWithAlt } from '../../types/types' +import type { ImageWithAlt } from '../../types/index' const builder = imageUrlBuilder(sanityClientWithEquinorCDN) diff --git a/web/common/helpers/getUrlFromAction.ts b/web/common/helpers/getUrlFromAction.ts index 1c374a5b1..9caa4cc4f 100644 --- a/web/common/helpers/getUrlFromAction.ts +++ b/web/common/helpers/getUrlFromAction.ts @@ -1,4 +1,4 @@ -import type { LinkData } from '../../types/types' +import type { LinkData } from '../../types/index' export const getUrlFromAction = ({ link, diff --git a/web/components/src/Backgrounds/BackgroundContainer.tsx b/web/components/src/Backgrounds/BackgroundContainer.tsx index bbbc47f48..8df8b9662 100644 --- a/web/components/src/Backgrounds/BackgroundContainer.tsx +++ b/web/components/src/Backgrounds/BackgroundContainer.tsx @@ -1,7 +1,7 @@ import { forwardRef, HTMLAttributes } from 'react' import styled from 'styled-components' import { normal, inverted } from '../../../styles/themes' -import type { BackgroundColours, BackgroundTypes, ImageBackground } from '../../../types/types' +import type { BackgroundColours, BackgroundTypes, ImageBackground } from '../../../types/index' import { ColouredContainer } from './ColouredContainer' import { ImageBackgroundContainer } from './ImageBackgroundContainer' import { ColorKeyTokens } from '../../../styles/colorKeyToUtilityMap' diff --git a/web/components/src/Backgrounds/ColouredContainer.tsx b/web/components/src/Backgrounds/ColouredContainer.tsx index f169ef540..a0516d256 100644 --- a/web/components/src/Backgrounds/ColouredContainer.tsx +++ b/web/components/src/Backgrounds/ColouredContainer.tsx @@ -2,7 +2,7 @@ import styled from 'styled-components' import { normal, inverted } from '../../../styles/themes' import { getContainerColor, isInvertedStyle } from '../../utils/backgroundColours' import { forwardRef, HTMLAttributes, CSSProperties } from 'react' -import { BackgroundColours } from '../../../types/types' +import { BackgroundColours } from '../../../types/index' import { ColorKeyTokens, colorKeyToUtilityMap } from '../../../styles/colorKeyToUtilityMap' import { twMerge } from 'tailwind-merge' diff --git a/web/components/src/Backgrounds/ImageBackgroundContainer.tsx b/web/components/src/Backgrounds/ImageBackgroundContainer.tsx index fb5944bce..d3249e96b 100644 --- a/web/components/src/Backgrounds/ImageBackgroundContainer.tsx +++ b/web/components/src/Backgrounds/ImageBackgroundContainer.tsx @@ -1,6 +1,6 @@ import { forwardRef, HTMLAttributes, CSSProperties } from 'react' import { useSanityLoader } from '../../../lib/hooks/useSanityLoader' -import { ImageBackground } from '../../../types/types' +import { ImageBackground } from '../../../types/index' import { twMerge } from 'tailwind-merge' import { useMediaQuery } from '../../../lib/hooks/useMediaQuery' diff --git a/web/components/src/Fact/FactBox.tsx b/web/components/src/Fact/FactBox.tsx index 315f2ed8c..3e2251c65 100644 --- a/web/components/src/Fact/FactBox.tsx +++ b/web/components/src/Fact/FactBox.tsx @@ -1,6 +1,6 @@ import { forwardRef, HTMLAttributes } from 'react' import type { FactImagePosition } from './' -import { BackgroundColours } from '../../../types/types' +import { BackgroundColours } from '../../../types/index' import { ColorKeyTokens } from '../../../styles/colorKeyToUtilityMap' import { BackgroundContainer, BackgroundContainerProps } from '@components' import { twMerge } from 'tailwind-merge' diff --git a/web/components/src/Link/Link.tsx b/web/components/src/Link/Link.tsx index ec19e7a8e..3777b24a8 100644 --- a/web/components/src/Link/Link.tsx +++ b/web/components/src/Link/Link.tsx @@ -5,7 +5,7 @@ import { Icon } from '@equinor/eds-core-react' import { arrow_forward, external_link, arrow_down } from '@equinor/eds-icons' import styled, { css } from 'styled-components' import { outlineTemplate, Tokens } from '@utils' -import type { LinkType } from '../../../types/types' +import type { LinkType } from '../../../types/index' import { default as NextLink } from 'next/link' const { outline } = Tokens diff --git a/web/components/src/Table/Table.tsx b/web/components/src/Table/Table.tsx index fed5c1519..15cb024fd 100644 --- a/web/components/src/Table/Table.tsx +++ b/web/components/src/Table/Table.tsx @@ -1,7 +1,7 @@ import { forwardRef, CSSProperties } from 'react' import { Table as EdsTable, TableProps as EdsTableProps } from '@equinor/eds-core-react' import styled, { ThemeProvider } from 'styled-components' -import { TableThemes } from '../../../types/types' +import { TableThemes } from '../../../types/index' type ThemeType = { headerBackground: string diff --git a/web/components/utils/backgroundColours.tsx b/web/components/utils/backgroundColours.tsx index 682dfe427..efd6f6243 100644 --- a/web/components/utils/backgroundColours.tsx +++ b/web/components/utils/backgroundColours.tsx @@ -1,4 +1,4 @@ -import type { BackgroundColours } from '../../types/types' +import type { BackgroundColours } from '../../types/index' export type StyleVariants = | '--bg-default' diff --git a/web/core/Link/BaseLink.tsx b/web/core/Link/BaseLink.tsx index 9b883ae10..53d44d539 100644 --- a/web/core/Link/BaseLink.tsx +++ b/web/core/Link/BaseLink.tsx @@ -1,7 +1,7 @@ import { AnchorHTMLAttributes, forwardRef } from 'react' import { default as NextLink, LinkProps } from 'next/link' import { twMerge } from 'tailwind-merge' -import { LinkType } from '../../types/types' +import { LinkType } from '../../types/index' export type BaseLinkProps = { /** What kind of content is it */ diff --git a/web/core/Link/ButtonLink.tsx b/web/core/Link/ButtonLink.tsx index 491abcec1..5f1e0c0ae 100644 --- a/web/core/Link/ButtonLink.tsx +++ b/web/core/Link/ButtonLink.tsx @@ -1,7 +1,7 @@ import { forwardRef } from 'react' import { twMerge } from 'tailwind-merge' import { BaseLink, BaseLinkProps } from './BaseLink' -import { LinkType } from '../../types/types' +import { LinkType } from '../../types/index' import { ButtonProps, commonButtonStyling, getVariant } from '../Button' export type ButtonLinkProps = { diff --git a/web/core/Link/ReadMoreLink.tsx b/web/core/Link/ReadMoreLink.tsx index ff8f758df..a8ce0f68c 100644 --- a/web/core/Link/ReadMoreLink.tsx +++ b/web/core/Link/ReadMoreLink.tsx @@ -2,7 +2,7 @@ import { forwardRef } from 'react' import { twMerge } from 'tailwind-merge' import { BaseLink, BaseLinkProps } from './BaseLink' import { ArrowRight } from '../../icons' -import { LinkType } from '../../types/types' +import { LinkType } from '../../types/index' export type ReadMoreLinkProps = { /** Overriding styles for the icon */ diff --git a/web/core/Link/ResourceLink.tsx b/web/core/Link/ResourceLink.tsx index 732f345ef..93d86c15d 100644 --- a/web/core/Link/ResourceLink.tsx +++ b/web/core/Link/ResourceLink.tsx @@ -1,7 +1,7 @@ import { forwardRef } from 'react' import { twMerge } from 'tailwind-merge' import { BaseLink, BaseLinkProps } from './BaseLink' -import { LinkType } from '../../types/types' +import { LinkType } from '../../types/index' import { ArrowRight } from '../../icons' export type ResourceLinkProps = { diff --git a/web/pageComponents/cards/EventsCard.tsx b/web/pageComponents/cards/EventsCard.tsx index 5a7d56b6f..2c7b630cf 100644 --- a/web/pageComponents/cards/EventsCard.tsx +++ b/web/pageComponents/cards/EventsCard.tsx @@ -11,7 +11,7 @@ import AddToCalendar from '../topicPages/AddToCalendar' import { getEventDates } from '../../common/helpers/dateUtilities' import { TimeIcon } from '../../components/src/FormattedDateTime/shared' -import type { EventCardData, EventDateType } from '../../types/types' +import type { EventCardData, EventDateType } from '../../types/index' import type { PortableTextBlock } from '@portabletext/types' import { twMerge } from 'tailwind-merge' diff --git a/web/pageComponents/cards/FeaturedEventCard.tsx b/web/pageComponents/cards/FeaturedEventCard.tsx index 7d5892811..94a35cb3e 100644 --- a/web/pageComponents/cards/FeaturedEventCard.tsx +++ b/web/pageComponents/cards/FeaturedEventCard.tsx @@ -7,7 +7,7 @@ import { TimeIcon } from '../../components/src/FormattedDateTime/shared' import { Icon } from '@equinor/eds-core-react' import { world } from '@equinor/eds-icons' import type { CSSProperties } from 'react' -import type { FeaturedContentData } from '../../types/types' +import type { FeaturedContentData } from '../../types/index' import type { PortableTextBlock } from '@portabletext/types' const { Title, Media, Header, Text, Action, Arrow, CardLink } = Card diff --git a/web/pageComponents/cards/MagazineCard.tsx b/web/pageComponents/cards/MagazineCard.tsx index a787468c7..b762ed973 100644 --- a/web/pageComponents/cards/MagazineCard.tsx +++ b/web/pageComponents/cards/MagazineCard.tsx @@ -2,7 +2,7 @@ import { Card } from '@components' import { CSSProperties } from 'react' import styled from 'styled-components' import Image, { Ratios } from '../shared/SanityImage' -import { MagazineCardData } from '../../types/types' +import { MagazineCardData } from '../../types/index' const { Title, Header, Action, Arrow, Media, CardLink } = Card diff --git a/web/pageComponents/cards/NewsCard.tsx b/web/pageComponents/cards/NewsCard.tsx index 7fcaa7c27..c71e8d83c 100644 --- a/web/pageComponents/cards/NewsCard.tsx +++ b/web/pageComponents/cards/NewsCard.tsx @@ -1,6 +1,6 @@ import { FormattedDate } from '@components' import Card from '@sections/cards/Card' -import type { CardData } from '../../types/types' +import type { CardData } from '../../types/index' import { Ratios } from '../shared/SanityImage' import { useSanityLoader } from '../../lib/hooks/useSanityLoader' import Blocks from '../../pageComponents/shared/portableText/Blocks' diff --git a/web/pageComponents/cards/PeopleCard/CV.tsx b/web/pageComponents/cards/PeopleCard/CV.tsx index d8449f649..4b82be6a5 100644 --- a/web/pageComponents/cards/PeopleCard/CV.tsx +++ b/web/pageComponents/cards/PeopleCard/CV.tsx @@ -1,5 +1,5 @@ import { ButtonLink } from '@components' -import type { LinkData } from '../../../types/types' +import type { LinkData } from '../../../types/index' import { getUrlFromAction } from '../../../common/helpers/getUrlFromAction' import { getLocaleFromName } from '../../../lib/localization' diff --git a/web/pageComponents/cards/PeopleCard/PeopleCard.tsx b/web/pageComponents/cards/PeopleCard/PeopleCard.tsx index 458f31519..807ace8db 100644 --- a/web/pageComponents/cards/PeopleCard/PeopleCard.tsx +++ b/web/pageComponents/cards/PeopleCard/PeopleCard.tsx @@ -3,7 +3,7 @@ import { outlineTemplate, Tokens } from '@utils' import { CSSProperties } from 'react' import styled from 'styled-components' import Image, { Ratios } from '../../../pageComponents/shared/SanityImage' -import type { PeopleCardData } from '../../../types/types' +import type { PeopleCardData } from '../../../types/index' import CV from './CV' import { SocialProfileJsonLd } from 'next-seo' import { urlFor } from '../../../common/helpers' diff --git a/web/pageComponents/cards/SimpleCard.tsx b/web/pageComponents/cards/SimpleCard.tsx index 2ec7d3bd9..099afb1b9 100644 --- a/web/pageComponents/cards/SimpleCard.tsx +++ b/web/pageComponents/cards/SimpleCard.tsx @@ -3,7 +3,7 @@ import styled from 'styled-components' import Image, { Ratios } from '../shared/SanityImage' import { Card, Heading } from '@components' -import type { MenuLinkData, SubMenuGroupLinkData } from '../../types/types' +import type { MenuLinkData, SubMenuGroupLinkData } from '../../types/index' const { Header, Action, Arrow, CardLink, Media } = Card diff --git a/web/pageComponents/cards/TopicPageCard.tsx b/web/pageComponents/cards/TopicPageCard.tsx index 4f9265df0..6200ee7f7 100644 --- a/web/pageComponents/cards/TopicPageCard.tsx +++ b/web/pageComponents/cards/TopicPageCard.tsx @@ -6,7 +6,7 @@ import Image, { Ratios } from '../shared/SanityImage' import RichText from '../shared/portableText/RichText' import type { PortableTextBlock } from '@portabletext/types' -import type { CardData } from '../../types/types' +import type { CardData } from '../../types/index' const { Title, Header, Text, Action, Arrow, Media, CardLink } = Card diff --git a/web/pageComponents/landingPages/ContentGroup.tsx b/web/pageComponents/landingPages/ContentGroup.tsx index 66952024a..5ad3d7341 100644 --- a/web/pageComponents/landingPages/ContentGroup.tsx +++ b/web/pageComponents/landingPages/ContentGroup.tsx @@ -2,7 +2,7 @@ import styled from 'styled-components' import { Heading } from '@components' import SimpleCard from '../cards/SimpleCard' -import type { SubMenuGroupData } from '../../types/types' +import type { SubMenuGroupData } from '../../types/index' const GroupWrapper = styled.div` margin: var(--space-3xLarge) 0; diff --git a/web/pageComponents/news/LatestNews.tsx b/web/pageComponents/news/LatestNews.tsx index 23467cd93..7ab464038 100644 --- a/web/pageComponents/news/LatestNews.tsx +++ b/web/pageComponents/news/LatestNews.tsx @@ -1,7 +1,7 @@ import { Heading } from '@components' import styled from 'styled-components' import NewsCard from '../cards/NewsCard' -import type { CardData } from '../../types/types' +import type { CardData } from '../../types/index' import { FormattedMessage } from 'react-intl' import { Carousel } from '../shared/Carousel' diff --git a/web/pageComponents/pageTemplates/ErrorPage.tsx b/web/pageComponents/pageTemplates/ErrorPage.tsx index 0ba71165f..c086b84c6 100644 --- a/web/pageComponents/pageTemplates/ErrorPage.tsx +++ b/web/pageComponents/pageTemplates/ErrorPage.tsx @@ -5,7 +5,7 @@ import { Heading, Text } from '@components' import RichText from '../shared/portableText/RichText' import isEmpty from '../shared/portableText/helpers/isEmpty' import BackgroundImage from '../errorPages/BackgroundImage' -import type { ErrorPageData } from '../../types/types' +import type { ErrorPageData } from '../../types/index' import { metaTitleSuffix } from '../../languages' const TextWrapper = styled.div` diff --git a/web/pageComponents/pageTemplates/Event.tsx b/web/pageComponents/pageTemplates/Event.tsx index 4fa0d2104..e48a1fa65 100644 --- a/web/pageComponents/pageTemplates/Event.tsx +++ b/web/pageComponents/pageTemplates/Event.tsx @@ -9,7 +9,7 @@ import AddToCalendar from '../topicPages/AddToCalendar' import Promotion from '../topicPages/Promotion' import type { PortableTextBlock } from '@portabletext/types' import Seo from '../../pageComponents/shared/Seo' -import type { EventSchema } from '../../types/types' +import type { EventSchema } from '../../types/index' import { EventJsonLd } from 'next-seo' import Blocks from '../../pageComponents/shared/portableText/Blocks' import { twMerge } from 'tailwind-merge' diff --git a/web/pageComponents/pageTemplates/LandingPage.tsx b/web/pageComponents/pageTemplates/LandingPage.tsx index 918feda65..e92f2c44a 100644 --- a/web/pageComponents/pageTemplates/LandingPage.tsx +++ b/web/pageComponents/pageTemplates/LandingPage.tsx @@ -1,5 +1,5 @@ import styled from 'styled-components' -import type { LandingPageSchema } from '../../types/types' +import type { LandingPageSchema } from '../../types/index' import IngressText from '../shared/portableText/IngressText' import TitleText from '../shared/portableText/TitleText' import ContentGroup from '../landingPages/ContentGroup' diff --git a/web/pageComponents/pageTemplates/MagazineIndexPage.tsx b/web/pageComponents/pageTemplates/MagazineIndexPage.tsx index 10d5e09f6..2f3c85513 100644 --- a/web/pageComponents/pageTemplates/MagazineIndexPage.tsx +++ b/web/pageComponents/pageTemplates/MagazineIndexPage.tsx @@ -11,7 +11,7 @@ import { UnpaddedText } from './newsroom/StyledComponents' import { useRef } from 'react' import usePaginationPadding from '../../lib/hooks/usePaginationPadding' import Seo from '../../pageComponents/shared/Seo' -import { HeroTypes } from '../../types/types' +import { HeroTypes } from '../../types/index' import MagazineIndexText from '../shared/portableText/MagazineIndexText' import { PaginationContextProvider } from '../shared/search/pagination/PaginationContext' import Teaser from '../shared/Teaser' diff --git a/web/pageComponents/pageTemplates/MagazinePage.tsx b/web/pageComponents/pageTemplates/MagazinePage.tsx index e04cdb569..4794a9fbb 100644 --- a/web/pageComponents/pageTemplates/MagazinePage.tsx +++ b/web/pageComponents/pageTemplates/MagazinePage.tsx @@ -3,7 +3,7 @@ import { useRouter } from 'next/router' import MagazineTagBar from '../shared/MagazineTagBar' import { PageContent } from './shared/SharedPageContent' import SharedTitle from './shared/SharedTitle' -import { HeroTypes, MagazinePageSchema } from '../../types/types' +import { HeroTypes, MagazinePageSchema } from '../../types/index' import { SharedBanner } from './shared/SharedBanner' import Teaser from '../shared/Teaser' import Seo from '../../pageComponents/shared/Seo' diff --git a/web/pageComponents/pageTemplates/News.tsx b/web/pageComponents/pageTemplates/News.tsx index b6b477d38..a9623722b 100644 --- a/web/pageComponents/pageTemplates/News.tsx +++ b/web/pageComponents/pageTemplates/News.tsx @@ -11,7 +11,7 @@ import getOpenGraphImages from '../../common/helpers/getOpenGraphImages' import BasicIFrame from '../shared/iframe/BasicIFrame' import { getFullUrl } from '../../common/helpers/getFullUrl' import { metaTitleSuffix } from '../../languages' -import type { NewsSchema } from '../../types/types' +import type { NewsSchema } from '../../types/index' import { toPlainText } from '@portabletext/react' import Blocks from '../shared/portableText/Blocks' import { twMerge } from 'tailwind-merge' diff --git a/web/pageComponents/pageTemplates/TopicPage.tsx b/web/pageComponents/pageTemplates/TopicPage.tsx index 0bd804239..8d7fe718b 100644 --- a/web/pageComponents/pageTemplates/TopicPage.tsx +++ b/web/pageComponents/pageTemplates/TopicPage.tsx @@ -1,6 +1,6 @@ import { toPlainText } from '@portabletext/react' import useSharedTitleStyles from '../../lib/hooks/useSharedTitleStyles' -import { HeroTypes, TopicPageSchema } from '../../types/types' +import { HeroTypes, TopicPageSchema } from '../../types/index' import Seo from '../shared/Seo' import { SharedBanner } from './shared/SharedBanner' import { PageContent } from './shared/SharedPageContent' diff --git a/web/pageComponents/pageTemplates/shared/SharedBanner.tsx b/web/pageComponents/pageTemplates/shared/SharedBanner.tsx index f3ba330c8..daa2d8019 100644 --- a/web/pageComponents/pageTemplates/shared/SharedBanner.tsx +++ b/web/pageComponents/pageTemplates/shared/SharedBanner.tsx @@ -1,5 +1,5 @@ import { PortableTextBlock } from '@portabletext/types' -import { BackgroundColours, HeroType, HeroTypes, LoopingVideoData } from '../../../types/types' +import { BackgroundColours, HeroType, HeroTypes, LoopingVideoData } from '../../../types/index' import { DefaultHero } from '../../shared/Hero/DefaultHero' import { FiftyFiftyHero } from '../../shared/Hero/FiftyFiftyHero' import { FullImageHero } from '../../shared/Hero/FullImageHero' diff --git a/web/pageComponents/pageTemplates/shared/SharedPageContent.tsx b/web/pageComponents/pageTemplates/shared/SharedPageContent.tsx index fc47f967e..7aefce1e7 100644 --- a/web/pageComponents/pageTemplates/shared/SharedPageContent.tsx +++ b/web/pageComponents/pageTemplates/shared/SharedPageContent.tsx @@ -54,7 +54,7 @@ import { GridData, CampaignBannerData, DesignOptions, -} from '../../../types/types' +} from '../../../types/index' import { getColorForTheme } from '../../shared/textTeaser/theme' import Grid from '@sections/Grid/Grid' import { CampaignBanner } from '@sections/CampaignBanner' diff --git a/web/pageComponents/searchIndexPages/magazineIndex/Hits.tsx b/web/pageComponents/searchIndexPages/magazineIndex/Hits.tsx index f9aa8bb77..ff1da1c1d 100644 --- a/web/pageComponents/searchIndexPages/magazineIndex/Hits.tsx +++ b/web/pageComponents/searchIndexPages/magazineIndex/Hits.tsx @@ -2,7 +2,7 @@ import { useHits, UseHitsProps } from 'react-instantsearch' import { FormattedMessage } from 'react-intl' import styled from 'styled-components' import MagazineCard from '../../cards/MagazineCard' -import type { MagazineCardData } from '../../../types/types' +import type { MagazineCardData } from '../../../types/index' import { forwardRef } from 'react' const HitList = styled.div` diff --git a/web/pageComponents/shared/ButtonLink.tsx b/web/pageComponents/shared/ButtonLink.tsx index 1d8273f0a..594a8c815 100644 --- a/web/pageComponents/shared/ButtonLink.tsx +++ b/web/pageComponents/shared/ButtonLink.tsx @@ -2,7 +2,7 @@ import { ButtonLink as Link, ButtonLinkProps } from '@components' import { LinkProps } from 'next/link' import { getUrlFromAction } from '../../common/helpers/getUrlFromAction' import { getLocaleFromName } from '../../lib/localization' -import type { LinkData } from '../../types/types' +import type { LinkData } from '../../types/index' type Props = { action: LinkData diff --git a/web/pageComponents/shared/ContactList.tsx b/web/pageComponents/shared/ContactList.tsx index bc0323d65..fccf2c508 100644 --- a/web/pageComponents/shared/ContactList.tsx +++ b/web/pageComponents/shared/ContactList.tsx @@ -1,4 +1,4 @@ -import type { ContactListData } from '../../types/types' +import type { ContactListData } from '../../types/index' import { Text, Heading } from '@components' import { removeWhiteSpace } from '../../common/helpers/removeWhiteSpace' import { twMerge } from 'tailwind-merge' diff --git a/web/pageComponents/shared/Footer.tsx b/web/pageComponents/shared/Footer.tsx index f79aa322d..4853a350e 100644 --- a/web/pageComponents/shared/Footer.tsx +++ b/web/pageComponents/shared/Footer.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components' import { forwardRef } from 'react' import { Facebook, Instagram, Linkedin, Twitter, Youtube } from '../../icons' -import type { FooterLinkData, SomeType, FooterColumns } from '../../types/types' +import type { FooterLinkData, SomeType, FooterColumns } from '../../types/index' import { default as NextLink } from 'next/link' const StyledFooter = styled.footer` diff --git a/web/pageComponents/shared/Header.tsx b/web/pageComponents/shared/Header.tsx index 5a53dde10..a9f7f7928 100644 --- a/web/pageComponents/shared/Header.tsx +++ b/web/pageComponents/shared/Header.tsx @@ -5,7 +5,7 @@ import { useRouter } from 'next/router' import { default as NextLink } from 'next/link' import { Topbar, BackgroundContainer } from '@components' import { AllSlugsType, LocalizationSwitch } from './LocalizationSwitch' -import type { MenuData, SimpleMenuData } from '../../types/types' +import type { MenuData, SimpleMenuData } from '../../types/index' import SiteMenu from './siteMenu/SiteMenu' import SimpleSiteMenu from './siteMenu/simple/SimpleSiteMenu' import { Flags } from '../../common/helpers/datasetHelpers' diff --git a/web/pageComponents/shared/Hero/DefaultHero.tsx b/web/pageComponents/shared/Hero/DefaultHero.tsx index 1e432a9ca..6c76afa5f 100644 --- a/web/pageComponents/shared/Hero/DefaultHero.tsx +++ b/web/pageComponents/shared/Hero/DefaultHero.tsx @@ -1,4 +1,4 @@ -import type { ImageWithCaptionData } from '../../../types/types' +import type { ImageWithCaptionData } from '../../../types/index' import styled from 'styled-components' import DefaulHeroImage from './DefaultHeroImage' import { PortableTextBlock } from '@portabletext/types' diff --git a/web/pageComponents/shared/Hero/DefaultHeroImage.tsx b/web/pageComponents/shared/Hero/DefaultHeroImage.tsx index 161788b03..6c81b5860 100644 --- a/web/pageComponents/shared/Hero/DefaultHeroImage.tsx +++ b/web/pageComponents/shared/Hero/DefaultHeroImage.tsx @@ -1,4 +1,4 @@ -import type { ImageWithCaptionData } from '../../../types/types' +import type { ImageWithCaptionData } from '../../../types/index' import Image, { Ratios } from '../SanityImage' import { Caption } from '../image/Caption' diff --git a/web/pageComponents/shared/Hero/FiftyFiftyHero.tsx b/web/pageComponents/shared/Hero/FiftyFiftyHero.tsx index cc135e4f2..2fce01bf1 100644 --- a/web/pageComponents/shared/Hero/FiftyFiftyHero.tsx +++ b/web/pageComponents/shared/Hero/FiftyFiftyHero.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components' import Image from '../SanityImage' import TitleText from '../portableText/TitleText' -import type { HeroType } from '../../../types/types' +import type { HeroType } from '../../../types/index' import { BackgroundContainer } from '@components' import { ReadMoreLink } from '@core/Link' import Blocks from '../portableText/Blocks' diff --git a/web/pageComponents/shared/IframeCarousel/IframeCarousel.tsx b/web/pageComponents/shared/IframeCarousel/IframeCarousel.tsx index 000999ed8..eaa10f49f 100644 --- a/web/pageComponents/shared/IframeCarousel/IframeCarousel.tsx +++ b/web/pageComponents/shared/IframeCarousel/IframeCarousel.tsx @@ -3,7 +3,7 @@ import { BackgroundContainer, FigureCaption } from '@components' import styled from 'styled-components' import TitleText from '../portableText/TitleText' -import type { IframeCarouselData } from '../../../types/types' +import type { IframeCarouselData } from '../../../types/index' import 'swiper/css' import 'swiper/css/pagination' diff --git a/web/pageComponents/shared/ImageCarousel/ImageCarousel.tsx b/web/pageComponents/shared/ImageCarousel/ImageCarousel.tsx index a82c69a84..6a41f1a30 100644 --- a/web/pageComponents/shared/ImageCarousel/ImageCarousel.tsx +++ b/web/pageComponents/shared/ImageCarousel/ImageCarousel.tsx @@ -6,7 +6,7 @@ import { BackgroundContainer } from '@components' import styled from 'styled-components' import TitleText from '../portableText/TitleText' import { CarouselItem } from './ImageCarouselItem' -import type { ImageCarouselData } from '../../../types/types' +import type { ImageCarouselData } from '../../../types/index' import 'swiper/css' import 'swiper/css/pagination' diff --git a/web/pageComponents/shared/ImageCarousel/ImageCarouselItem.tsx b/web/pageComponents/shared/ImageCarousel/ImageCarouselItem.tsx index d44efa57e..0a423d397 100644 --- a/web/pageComponents/shared/ImageCarousel/ImageCarouselItem.tsx +++ b/web/pageComponents/shared/ImageCarousel/ImageCarouselItem.tsx @@ -3,7 +3,7 @@ import Image, { Ratios } from '../SanityImage' import { Caption } from '../image/Caption' import { EdsProvider } from '@equinor/eds-core-react' import { NavButton } from './Navigation' -import type { ImageWithAlt } from '../../../types/types' +import type { ImageWithAlt } from '../../../types/index' const StyledFigure = styled.figure` margin: 0; diff --git a/web/pageComponents/shared/Layout.tsx b/web/pageComponents/shared/Layout.tsx index a35775e73..84db64997 100644 --- a/web/pageComponents/shared/Layout.tsx +++ b/web/pageComponents/shared/Layout.tsx @@ -1,6 +1,6 @@ import { HTMLAttributes } from 'react' import Footer from './Footer' -import type { FooterColumns } from '../../types/types' +import type { FooterColumns } from '../../types/index' import { IntlProvider } from 'react-intl' import { defaultLanguage } from '../../languages' import { getIsoFromLocale } from '../../lib/localization' diff --git a/web/pageComponents/shared/Quote.tsx b/web/pageComponents/shared/Quote.tsx index 6bd621f55..81f2abe8c 100644 --- a/web/pageComponents/shared/Quote.tsx +++ b/web/pageComponents/shared/Quote.tsx @@ -1,5 +1,5 @@ import { PullQuote } from '@components' -import type { QuoteData } from '../../types/types' +import type { QuoteData } from '../../types/index' import Image, { Ratios } from './SanityImage' const Quote = ({ data: { quote, authorTitle, author, image, designOptions } }: { data: QuoteData }) => ( diff --git a/web/pageComponents/shared/RelatedContent.tsx b/web/pageComponents/shared/RelatedContent.tsx index a81ca3481..2a41b212a 100644 --- a/web/pageComponents/shared/RelatedContent.tsx +++ b/web/pageComponents/shared/RelatedContent.tsx @@ -1,6 +1,6 @@ import { Fragment, HTMLAttributes } from 'react' import { Heading, List } from '@components' -import type { RelatedLinksData, LinkData } from '../../types/types' +import type { RelatedLinksData, LinkData } from '../../types/index' import { ResourceLink } from '@core/Link' import { getUrlFromAction } from '../../common/helpers' import { getLocaleFromName } from '../../lib/localization' diff --git a/web/pageComponents/shared/Seo.tsx b/web/pageComponents/shared/Seo.tsx index 03b4cc6cc..7d0bda050 100644 --- a/web/pageComponents/shared/Seo.tsx +++ b/web/pageComponents/shared/Seo.tsx @@ -1,5 +1,5 @@ import { NextSeo, WebPageJsonLd } from 'next-seo' -import { ImageWithAlt } from '../../types/types' +import { ImageWithAlt } from '../../types/index' import { metaTitleSuffix } from '../../languages' import getOpenGraphImages from '../../common/helpers/getOpenGraphImages' import { toPlainText } from '@portabletext/react' diff --git a/web/pageComponents/shared/Teaser.tsx b/web/pageComponents/shared/Teaser.tsx index 20d50f357..56e1e3776 100644 --- a/web/pageComponents/shared/Teaser.tsx +++ b/web/pageComponents/shared/Teaser.tsx @@ -4,7 +4,7 @@ import IngressText from './portableText/IngressText' import { getUrlFromAction, urlFor } from '../../common/helpers' import Img from 'next/image' import Image from './SanityImage' -import type { TeaserData, ImageWithAlt } from '../../types/types' +import type { TeaserData, ImageWithAlt } from '../../types/index' import { ReadMoreLink, ResourceLink } from '../../core/Link' import { Heading } from '../../core/Typography' import { getLocaleFromName } from '../../lib/localization' diff --git a/web/pageComponents/shared/VideoPlayer.tsx b/web/pageComponents/shared/VideoPlayer.tsx index 370396daa..b5b291d39 100644 --- a/web/pageComponents/shared/VideoPlayer.tsx +++ b/web/pageComponents/shared/VideoPlayer.tsx @@ -6,7 +6,7 @@ import { VideoPlayerRatios, VideoType, VideoDesignOptionsType, -} from '../../types/types' +} from '../../types/index' import { BackgroundContainer } from '@components' import { urlFor } from '../../common/helpers' import IngressText from './portableText/IngressText' diff --git a/web/pageComponents/shared/VideoPlayerCarousel.tsx b/web/pageComponents/shared/VideoPlayerCarousel.tsx index 5adc1c675..6ca913a63 100644 --- a/web/pageComponents/shared/VideoPlayerCarousel.tsx +++ b/web/pageComponents/shared/VideoPlayerCarousel.tsx @@ -1,5 +1,5 @@ import styled from 'styled-components' -import { VideoPlayerCarouselData, VideoPlayerRatios } from '../../types/types' +import { VideoPlayerCarouselData, VideoPlayerRatios } from '../../types/index' import { BackgroundContainer } from '@components' import TitleText from './portableText/TitleText' import { VideoJsComponent } from './VideoPlayer' diff --git a/web/pageComponents/shared/iframe/BasicIFrame.tsx b/web/pageComponents/shared/iframe/BasicIFrame.tsx index 5efabd20c..704bb157d 100644 --- a/web/pageComponents/shared/iframe/BasicIFrame.tsx +++ b/web/pageComponents/shared/iframe/BasicIFrame.tsx @@ -1,5 +1,5 @@ import styled from 'styled-components' -import type { IFrameData } from '../../../types/types' +import type { IFrameData } from '../../../types/index' import { BackgroundContainer } from '@components' import TitleText from '../portableText/TitleText' import IFrame from './IFrame' diff --git a/web/pageComponents/shared/image/Caption.tsx b/web/pageComponents/shared/image/Caption.tsx index 258ade84e..bb72fd215 100644 --- a/web/pageComponents/shared/image/Caption.tsx +++ b/web/pageComponents/shared/image/Caption.tsx @@ -1,4 +1,4 @@ -import type { CaptionData } from 'types/types' +import type { CaptionData } from 'types/index' import { FigureCaption } from '@components' import { HTMLAttributes } from 'react' import { twMerge } from 'tailwind-merge' diff --git a/web/pageComponents/shared/portableText/components/BasicIframe.tsx b/web/pageComponents/shared/portableText/components/BasicIframe.tsx index f28c6dc8d..b766b775a 100644 --- a/web/pageComponents/shared/portableText/components/BasicIframe.tsx +++ b/web/pageComponents/shared/portableText/components/BasicIframe.tsx @@ -1,6 +1,6 @@ import IFrame from '../../iframe/IFrame' import type { PortableTextBlock } from '@portabletext/types' -import type { IFrameData } from 'types/types' +import type { IFrameData } from 'types/index' import styled from 'styled-components' import { twMerge } from 'tailwind-merge' import { useId } from '@equinor/eds-utils' diff --git a/web/pageComponents/shared/portableText/components/news/Fact.tsx b/web/pageComponents/shared/portableText/components/news/Fact.tsx index 748297c92..6d56ecd36 100644 --- a/web/pageComponents/shared/portableText/components/news/Fact.tsx +++ b/web/pageComponents/shared/portableText/components/news/Fact.tsx @@ -2,7 +2,7 @@ import { toPlainText } from '@portabletext/react' import { FactBox } from '@components' import type { FactImagePosition } from '@components' import type { PortableTextBlock } from '@portabletext/types' -import type { BackgroundColours, ImageWithAlt } from '../../../../../types/types' +import type { BackgroundColours, ImageWithAlt } from '../../../../../types/index' import { urlFor } from '../../../../../common/helpers' import Blocks from '../../Blocks' import { Typography } from '@core/Typography' diff --git a/web/pageComponents/shared/portableText/components/news/FigureWithLayout.tsx b/web/pageComponents/shared/portableText/components/news/FigureWithLayout.tsx index 34c74d5f4..e073a88a0 100644 --- a/web/pageComponents/shared/portableText/components/news/FigureWithLayout.tsx +++ b/web/pageComponents/shared/portableText/components/news/FigureWithLayout.tsx @@ -2,7 +2,7 @@ import type { PortableTextBlock } from '@portabletext/types' import { twMerge } from 'tailwind-merge' import { FigureCaption } from '@components' import Image from '../../../SanityImage' -import type { ImageWithAlt } from '../../../../../types/types' +import type { ImageWithAlt } from '../../../../../types/index' type Layout = 'full' | 'left' | 'right' diff --git a/web/pageComponents/shared/portableText/components/news/Quote.tsx b/web/pageComponents/shared/portableText/components/news/Quote.tsx index 60ac0a12e..d104397ed 100644 --- a/web/pageComponents/shared/portableText/components/news/Quote.tsx +++ b/web/pageComponents/shared/portableText/components/news/Quote.tsx @@ -2,7 +2,7 @@ import styled from 'styled-components' import QuoteComponent from '../../../Quote' import type { PortableTextBlock } from '@portabletext/types' -import type { QuoteData } from '../../../../../types/types' +import type { QuoteData } from '../../../../../types/index' import { twMerge } from 'tailwind-merge' const Container = styled.div` diff --git a/web/pageComponents/shared/siteMenu/FeaturedContent.tsx b/web/pageComponents/shared/siteMenu/FeaturedContent.tsx index 0ad487bb7..abc24896a 100644 --- a/web/pageComponents/shared/siteMenu/FeaturedContent.tsx +++ b/web/pageComponents/shared/siteMenu/FeaturedContent.tsx @@ -2,7 +2,7 @@ import styled from 'styled-components' import NewsCard from '../../cards/NewsCard' import TopicPageCard from '../../cards/TopicPageCard' import FeaturedEventCard from '../../cards/FeaturedEventCard' -import type { FeaturedContentData } from '../../../types/types' +import type { FeaturedContentData } from '../../../types/index' const Promoted = styled.div` margin-top: var(--space-medium); diff --git a/web/pageComponents/shared/siteMenu/MenuGroup.tsx b/web/pageComponents/shared/siteMenu/MenuGroup.tsx index 30714534f..23dd0c745 100644 --- a/web/pageComponents/shared/siteMenu/MenuGroup.tsx +++ b/web/pageComponents/shared/siteMenu/MenuGroup.tsx @@ -2,7 +2,7 @@ import { Fragment } from 'react' import styled from 'styled-components' import RichText from '../portableText/RichText' import { Link, List, Menu } from '@components' -import type { MenuLinkData, SubMenuData, SubMenuGroupData } from '../../../types/types' +import type { MenuLinkData, SubMenuData, SubMenuGroupData } from '../../../types/index' import { SubMenuGroupHeading, SubMenuGroupList } from './SubMenuGroup' import FeaturedContent from './FeaturedContent' import { useRouter } from 'next/router' diff --git a/web/pageComponents/shared/siteMenu/SiteMenu.tsx b/web/pageComponents/shared/siteMenu/SiteMenu.tsx index ad0b7d0d5..925fd0970 100644 --- a/web/pageComponents/shared/siteMenu/SiteMenu.tsx +++ b/web/pageComponents/shared/siteMenu/SiteMenu.tsx @@ -11,7 +11,7 @@ import { getAllSitesLink } from '../../../common/helpers/getAllSitesLink' import { LogoLink } from '../LogoLink' -import type { MenuData, SubMenuData } from '../../../types/types' +import type { MenuData, SubMenuData } from '../../../types/index' import { FormattedMessage, useIntl } from 'react-intl' const AllSitesLink = styled(Link)` diff --git a/web/pageComponents/shared/siteMenu/simple/SimpleMenuItem.tsx b/web/pageComponents/shared/siteMenu/simple/SimpleMenuItem.tsx index 0f698e806..8426f6dec 100644 --- a/web/pageComponents/shared/siteMenu/simple/SimpleMenuItem.tsx +++ b/web/pageComponents/shared/siteMenu/simple/SimpleMenuItem.tsx @@ -3,7 +3,7 @@ import styled from 'styled-components' import { Link, List, Menu } from '@components' import { SimplePanel } from './SimplePanel' import { SimpleHeader } from './SimpleHeader' -import type { SimpleGroupData } from '../../../../types/types' +import type { SimpleGroupData } from '../../../../types/index' const { SubMenu } = Menu const { Item } = List diff --git a/web/pageComponents/shared/siteMenu/simple/SimpleSiteMenu.tsx b/web/pageComponents/shared/siteMenu/simple/SimpleSiteMenu.tsx index 9d223d153..7af02ad8f 100644 --- a/web/pageComponents/shared/siteMenu/simple/SimpleSiteMenu.tsx +++ b/web/pageComponents/shared/siteMenu/simple/SimpleSiteMenu.tsx @@ -9,7 +9,7 @@ import { MenuButton, Link } from '@components' import { SimpleMenuItem } from './SimpleMenuItem' import { getAllSitesLink } from '../../../../common/helpers/getAllSitesLink' -import type { SimpleMenuData, SimpleGroupData } from '../../../../types/types' +import type { SimpleMenuData, SimpleGroupData } from '../../../../types/index' import { TopbarDropdown } from '../TopbarDropdown' import { LogoLink } from '../../LogoLink' diff --git a/web/pageComponents/shared/textTeaser/TextTeaser.tsx b/web/pageComponents/shared/textTeaser/TextTeaser.tsx index b9035e53e..eb3cdb2a6 100644 --- a/web/pageComponents/shared/textTeaser/TextTeaser.tsx +++ b/web/pageComponents/shared/textTeaser/TextTeaser.tsx @@ -2,7 +2,7 @@ import { Teaser as EnvisTeaser, BackgroundContainer } from '@components' import styled from 'styled-components' import IngressText from '../portableText/IngressText' import TitleText from '../portableText/TitleText' -import type { TextTeaserData } from '../../../types/types' +import type { TextTeaserData } from '../../../types/index' import { getColorForTheme } from './theme' import { CSSProperties } from 'react' diff --git a/web/pageComponents/topicPages/Accordion/Accordion.tsx b/web/pageComponents/topicPages/Accordion/Accordion.tsx index e3c1104bc..0eb85bf72 100644 --- a/web/pageComponents/topicPages/Accordion/Accordion.tsx +++ b/web/pageComponents/topicPages/Accordion/Accordion.tsx @@ -3,7 +3,7 @@ import { useRouter } from 'next/router' import { ParsedUrlQuery } from 'querystring' import useRouterReplace from '../../hooks/useRouterReplace' import { Accordion as EnvisAccordion } from '@components' -import type { AccordionListData } from '../../../types/types' +import type { AccordionListData } from '../../../types/index' import Blocks from '../../../pageComponents/shared/portableText/Blocks' const { Item, Header, Panel } = EnvisAccordion diff --git a/web/pageComponents/topicPages/Accordion/AccordionBlock.tsx b/web/pageComponents/topicPages/Accordion/AccordionBlock.tsx index a95d1bb8e..38e3bd154 100644 --- a/web/pageComponents/topicPages/Accordion/AccordionBlock.tsx +++ b/web/pageComponents/topicPages/Accordion/AccordionBlock.tsx @@ -5,7 +5,7 @@ import IngressText from '../../shared/portableText/IngressText' import Accordion from './Accordion' import { FAQPageJsonLd } from 'next-seo' -import type { AccordionData, AccordionListData } from '../../../types/types' +import type { AccordionData, AccordionListData } from '../../../types/index' import { toPlainText } from '@portabletext/react' import { Heading, Typography } from '../../../core/Typography' import { twMerge } from 'tailwind-merge' diff --git a/web/pageComponents/topicPages/AddToCalendar.tsx b/web/pageComponents/topicPages/AddToCalendar.tsx index 869e11853..f7e7e050c 100644 --- a/web/pageComponents/topicPages/AddToCalendar.tsx +++ b/web/pageComponents/topicPages/AddToCalendar.tsx @@ -3,7 +3,7 @@ import { Button } from '@components' import { isAfter } from 'date-fns' import { getEventDates, toUTCDateParts } from '../../common/helpers/dateUtilities' -import type { EventDateType } from '../../types/types' +import type { EventDateType } from '../../types/index' import { useIntl } from 'react-intl' // eslint-disable-next-line @typescript-eslint/no-var-requires diff --git a/web/pageComponents/topicPages/CallToActions.tsx b/web/pageComponents/topicPages/CallToActions.tsx index 379c590b8..15e6edf73 100644 --- a/web/pageComponents/topicPages/CallToActions.tsx +++ b/web/pageComponents/topicPages/CallToActions.tsx @@ -1,6 +1,6 @@ import { Fragment } from 'react' import { List } from '@components' -import type { LinkData } from '../../types/types' +import type { LinkData } from '../../types/index' import { ButtonLink } from '../shared/ButtonLink' import { ReadMoreLink } from '@core/Link' import { getUrlFromAction } from '../../common/helpers' diff --git a/web/pageComponents/topicPages/CookieDeclaration.tsx b/web/pageComponents/topicPages/CookieDeclaration.tsx index 17189abae..ef2fba116 100644 --- a/web/pageComponents/topicPages/CookieDeclaration.tsx +++ b/web/pageComponents/topicPages/CookieDeclaration.tsx @@ -3,7 +3,7 @@ import { useEffect, useRef } from 'react' import styled from 'styled-components' import { BackgroundContainer } from '@components' import TitleText from '../../pageComponents/shared/portableText/TitleText' -import { CookieDeclarationData } from '../../types/types' +import { CookieDeclarationData } from '../../types/index' import { twMerge } from 'tailwind-merge' type CookieDeclarationProps = { diff --git a/web/pageComponents/topicPages/Figure.tsx b/web/pageComponents/topicPages/Figure.tsx index 142f41de8..3c6d0b367 100644 --- a/web/pageComponents/topicPages/Figure.tsx +++ b/web/pageComponents/topicPages/Figure.tsx @@ -1,4 +1,4 @@ -import type { FigureData } from '../../types/types' +import type { FigureData } from '../../types/index' import { BackgroundContainer, FigureCaption } from '@components' import Image, { Ratios } from '../shared/SanityImage' diff --git a/web/pageComponents/topicPages/Form/Form.tsx b/web/pageComponents/topicPages/Form/Form.tsx index 8f503d41f..6feea06ff 100644 --- a/web/pageComponents/topicPages/Form/Form.tsx +++ b/web/pageComponents/topicPages/Form/Form.tsx @@ -6,7 +6,7 @@ import SubscribeForm from './SubscribeForm' import CareerFairForm from './CareerFairForm' import OrderReportsForm from './OrderReportsForm' import CareersContactForm from './careersContactForm/CareersContactForm' -import type { LinkData, FormData } from '../../../types/types' +import type { FormData } from '../../../types/index' import { twMerge } from 'tailwind-merge' import CallToActions from '@sections/CallToActions' diff --git a/web/pageComponents/topicPages/Form/SubscribeForm.tsx b/web/pageComponents/topicPages/Form/SubscribeForm.tsx index f29fb6885..7ef5af4a9 100644 --- a/web/pageComponents/topicPages/Form/SubscribeForm.tsx +++ b/web/pageComponents/topicPages/Form/SubscribeForm.tsx @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import type { SubscribeFormParameters } from '../../../types/types' +import type { SubscribeFormParameters } from '../../../types/index' import styled from 'styled-components' import { Icon } from '@equinor/eds-core-react' import { useForm, Controller } from 'react-hook-form' diff --git a/web/pageComponents/topicPages/FullWidthImage.tsx b/web/pageComponents/topicPages/FullWidthImage.tsx index 6871db403..5e811aadc 100644 --- a/web/pageComponents/topicPages/FullWidthImage.tsx +++ b/web/pageComponents/topicPages/FullWidthImage.tsx @@ -1,4 +1,4 @@ -import type { FullWidthImageData } from '../../types/types' +import type { FullWidthImageData } from '../../types/index' import Image, { Ratios } from '../shared/SanityImage' import { StyledCaption } from '../shared/image/StyledCaption' import { useMediaQuery } from '../../lib/hooks/useMediaQuery' diff --git a/web/pageComponents/topicPages/FullWidthVideo.tsx b/web/pageComponents/topicPages/FullWidthVideo.tsx index 9d3bfedd6..0caa26f67 100644 --- a/web/pageComponents/topicPages/FullWidthVideo.tsx +++ b/web/pageComponents/topicPages/FullWidthVideo.tsx @@ -1,4 +1,4 @@ -import { FullWidthVideoData, FullWidthVideoRatio } from '../../types/types' +import { FullWidthVideoData, FullWidthVideoRatio } from '../../types/index' import styled from 'styled-components' import { BackgroundContainer } from '@components' import { VideoJS } from '../../components/src/VideoJsPlayer' diff --git a/web/pageComponents/topicPages/IFrame.tsx b/web/pageComponents/topicPages/IFrame.tsx index 03a5bad4c..d40dee2ee 100644 --- a/web/pageComponents/topicPages/IFrame.tsx +++ b/web/pageComponents/topicPages/IFrame.tsx @@ -1,5 +1,5 @@ import styled from 'styled-components' -import type { IFrameData } from '../../types/types' +import type { IFrameData } from '../../types/index' import { BackgroundContainer, FigureCaption } from '@components' import CoreIFrame from '../shared/iframe/IFrame' import { ButtonLink } from '../shared/ButtonLink' diff --git a/web/pageComponents/topicPages/NewsList.tsx b/web/pageComponents/topicPages/NewsList.tsx index c9e97f98c..533cb691e 100644 --- a/web/pageComponents/topicPages/NewsList.tsx +++ b/web/pageComponents/topicPages/NewsList.tsx @@ -2,7 +2,7 @@ import styled from 'styled-components' import NewsCard from '../cards/NewsCard' import TitleText from '../shared/portableText/TitleText' import { Pagination } from '../shared/search/simplePagination/Pagination' -import type { NewsListData } from '../../types/types' +import type { NewsListData } from '../../types/index' import { useState } from 'react' import { twMerge } from 'tailwind-merge' diff --git a/web/pageComponents/topicPages/PageQuote.tsx b/web/pageComponents/topicPages/PageQuote.tsx index c4da8cea6..204e493f5 100644 --- a/web/pageComponents/topicPages/PageQuote.tsx +++ b/web/pageComponents/topicPages/PageQuote.tsx @@ -1,5 +1,5 @@ import Quote from '../shared/Quote' -import type { QuoteData } from '../../types/types' +import type { QuoteData } from '../../types/index' import { BackgroundContainer } from '@components' import { twMerge } from 'tailwind-merge' diff --git a/web/pageComponents/topicPages/PromoTileArray.tsx b/web/pageComponents/topicPages/PromoTileArray.tsx index b56db19d6..7c94d2d79 100644 --- a/web/pageComponents/topicPages/PromoTileArray.tsx +++ b/web/pageComponents/topicPages/PromoTileArray.tsx @@ -1,6 +1,6 @@ import Card from '@sections/cards/Card' import styled from 'styled-components' -import type { PromoTileArrayData, PromoTileData } from '../../types/types' +import type { PromoTileArrayData, PromoTileData } from '../../types/index' import { Ratios } from '../shared/SanityImage' import { Carousel } from '../shared/Carousel' import { useMediaQuery } from '../../lib/hooks/useMediaQuery' diff --git a/web/pageComponents/topicPages/PromoTileButton.tsx b/web/pageComponents/topicPages/PromoTileButton.tsx index 999401385..1389902db 100644 --- a/web/pageComponents/topicPages/PromoTileButton.tsx +++ b/web/pageComponents/topicPages/PromoTileButton.tsx @@ -1,4 +1,4 @@ -import { LinkData } from '../../types/types' +import { LinkData } from '../../types/index' import { ButtonLink } from '../shared/ButtonLink' import { Card, Link } from '@components' import { getUrlFromAction } from '../../common/helpers' diff --git a/web/pageComponents/topicPages/Promotion.tsx b/web/pageComponents/topicPages/Promotion.tsx index fae6aaed8..08a274a7e 100644 --- a/web/pageComponents/topicPages/Promotion.tsx +++ b/web/pageComponents/topicPages/Promotion.tsx @@ -4,7 +4,7 @@ import SinglePromotion from './promotions/SinglePromotion' import MultiplePromotions from './promotions/MultiplePromotions' import TitleText from '../shared/portableText/TitleText' import IngressText from '../shared/portableText/IngressText' -import type { PromotionData } from '../../types/types' +import type { PromotionData } from '../../types/index' import { twMerge } from 'tailwind-merge' const Wrapper = styled.div` diff --git a/web/pageComponents/topicPages/StockValues.tsx b/web/pageComponents/topicPages/StockValues.tsx index bbe77bd90..6b3e0efda 100644 --- a/web/pageComponents/topicPages/StockValues.tsx +++ b/web/pageComponents/topicPages/StockValues.tsx @@ -4,7 +4,7 @@ import * as xml2js from 'xml2js' import styled from 'styled-components' import { BackgroundContainer, FormattedDate } from '@components' import { FormattedMessage } from 'react-intl' -import type { StockValuesData } from '../../types/types' +import type { StockValuesData } from '../../types/index' import { twMerge } from 'tailwind-merge' const fetchData = async (url: string) => { diff --git a/web/pageComponents/topicPages/Table.tsx b/web/pageComponents/topicPages/Table.tsx index dbf648aba..52580daf1 100644 --- a/web/pageComponents/topicPages/Table.tsx +++ b/web/pageComponents/topicPages/Table.tsx @@ -6,7 +6,7 @@ import RichText from '../shared/portableText/RichText' import TitleText from '../shared/portableText/TitleText' import { getLocaleFromName } from '../../lib/localization' -import type { CellData, LinkData, TableData } from '../../types/types' +import type { CellData, LinkData, TableData } from '../../types/index' import { PortableTextBlock } from '@portabletext/types' import { PortableText } from '@portabletext/react' import defaultSerializers from '../shared/portableText/helpers/defaultSerializers' diff --git a/web/pageComponents/topicPages/TextBlock.tsx b/web/pageComponents/topicPages/TextBlock.tsx index 4d8842ff1..517ab7eb2 100644 --- a/web/pageComponents/topicPages/TextBlock.tsx +++ b/web/pageComponents/topicPages/TextBlock.tsx @@ -3,7 +3,7 @@ import { Heading } from '../../core/Typography' import IngressText from '../shared/portableText/IngressText' import Image, { Ratios } from '../shared/SanityImage' import styled from 'styled-components' -import type { TextBlockData } from '../../types/types' +import type { TextBlockData } from '../../types/index' //import CallToActions from './CallToActions' import CallToActions from '../../sections/CallToActions' import Blocks from '../../pageComponents/shared/portableText/Blocks' diff --git a/web/pageComponents/topicPages/TextWithIconArray.tsx b/web/pageComponents/topicPages/TextWithIconArray.tsx index 48c0cf9c9..2198469bb 100644 --- a/web/pageComponents/topicPages/TextWithIconArray.tsx +++ b/web/pageComponents/topicPages/TextWithIconArray.tsx @@ -4,7 +4,7 @@ import styled from 'styled-components' import Img from 'next/image' import IngressText from '../shared/portableText/IngressText' -import type { TextWithIconArrayData, TextWithIconItem, ImageWithAlt } from '../../types/types' +import type { TextWithIconArrayData, TextWithIconItem, ImageWithAlt } from '../../types/index' import { twMerge } from 'tailwind-merge' const Container = styled.div<{ items: number }>` diff --git a/web/pageComponents/topicPages/TwitterEmbed.tsx b/web/pageComponents/topicPages/TwitterEmbed.tsx index 5eed78114..487259fed 100644 --- a/web/pageComponents/topicPages/TwitterEmbed.tsx +++ b/web/pageComponents/topicPages/TwitterEmbed.tsx @@ -1,4 +1,4 @@ -import { TwitterEmbedData } from '../../types/types' +import { TwitterEmbedData } from '../../types/index' import RequestConsentContainer from '../../pageComponents/shared/iframe/RequestConsentContainer' import { TwitterTimelineEmbed, TwitterTweetEmbed } from 'react-twitter-embed' import { BackgroundContainer } from '@components' diff --git a/web/pageComponents/topicPages/promotions/MultipleEventCards.tsx b/web/pageComponents/topicPages/promotions/MultipleEventCards.tsx index d053a86c1..3ed23534d 100644 --- a/web/pageComponents/topicPages/promotions/MultipleEventCards.tsx +++ b/web/pageComponents/topicPages/promotions/MultipleEventCards.tsx @@ -1,6 +1,6 @@ import { getEventDates } from '../../../common/helpers/dateUtilities' import styled from 'styled-components' -import type { EventCardData, EventPromotionSettings } from '../../../types/types' +import type { EventCardData, EventPromotionSettings } from '../../../types/index' import EventsCard from '../../cards/EventsCard' import { Carousel } from '../../shared/Carousel' import { BackgroundContainer } from '@components/Backgrounds' diff --git a/web/pageComponents/topicPages/promotions/MultiplePromotions.tsx b/web/pageComponents/topicPages/promotions/MultiplePromotions.tsx index 1e261a5e1..955b5b784 100644 --- a/web/pageComponents/topicPages/promotions/MultiplePromotions.tsx +++ b/web/pageComponents/topicPages/promotions/MultiplePromotions.tsx @@ -5,7 +5,7 @@ import type { EventCardData, PromotionType, EventPromotionSettings, -} from '../../../types/types' +} from '../../../types/index' import PeopleCard from '../../cards/PeopleCard/PeopleCard' import MultipleEventCards from './MultipleEventCards' import { Carousel } from '../../shared/Carousel' diff --git a/web/pageComponents/topicPages/promotions/SinglePromotion.tsx b/web/pageComponents/topicPages/promotions/SinglePromotion.tsx index 224579594..7880d9588 100644 --- a/web/pageComponents/topicPages/promotions/SinglePromotion.tsx +++ b/web/pageComponents/topicPages/promotions/SinglePromotion.tsx @@ -4,7 +4,7 @@ import EventCard from '../../cards/EventsCard' import NewsCard from '../../cards/NewsCard' import TopicPageCard from '../../cards/TopicPageCard' -import type { PeopleCardData, EventCardData, CardData } from '../../../types/types' +import type { PeopleCardData, EventCardData, CardData } from '../../../types/index' const LandscapeWrapper = styled.div` /* max-width: 350px; */ diff --git a/web/pages/404.tsx b/web/pages/404.tsx index 1161aacc8..a3749f614 100644 --- a/web/pages/404.tsx +++ b/web/pages/404.tsx @@ -8,7 +8,7 @@ import { pageNotFoundQuery } from '../lib/queries/pageNotFound' import { getNameFromLocale, getIsoFromLocale } from '../lib/localization' import getIntl from '../common/helpers/getIntl' import { defaultLanguage } from '../languages' -import { ErrorPageData, MenuData, FooterColumns, IntlData } from '../types/types' +import { ErrorPageData, MenuData, FooterColumns, IntlData } from '../types/index' import { getComponentsData } from '../lib/fetchData' import Header from '../pageComponents/shared/Header' import Footer from '../pageComponents/shared/Footer' diff --git a/web/pages/500.tsx b/web/pages/500.tsx index 2b6726b98..ca17977f8 100644 --- a/web/pages/500.tsx +++ b/web/pages/500.tsx @@ -8,7 +8,7 @@ import { internalServerErrorQuery } from '../lib/queries/internalServerError' import { getNameFromLocale, getIsoFromLocale } from '../lib/localization' import getIntl from '../common/helpers/getIntl' import { defaultLanguage } from '../languages' -import { ErrorPageData, MenuData, FooterColumns, IntlData } from '../types/types' +import { ErrorPageData, MenuData, FooterColumns, IntlData } from '../types/index' import { getComponentsData } from '../lib/fetchData' const ErrorPage = dynamic(() => import('../pageComponents/pageTemplates/ErrorPage')) diff --git a/web/pages/api/news-letter-distribution.ts b/web/pages/api/news-letter-distribution.ts index e728d927c..a13436265 100644 --- a/web/pages/api/news-letter-distribution.ts +++ b/web/pages/api/news-letter-distribution.ts @@ -1,6 +1,6 @@ import { distribute } from './subscription' import { languages } from '../../languages' -import { NewsDistributionParameters } from '../../types/types' +import { NewsDistributionParameters } from '../../types/index' import { NextApiRequest, NextApiResponse } from 'next' import { isValidSignature, SIGNATURE_HEADER_NAME } from '@sanity/webhook' import getRawBody from 'raw-body' diff --git a/web/pages/api/subscription.ts b/web/pages/api/subscription.ts index 3b47cc3fd..3bbbf51f3 100644 --- a/web/pages/api/subscription.ts +++ b/web/pages/api/subscription.ts @@ -1,6 +1,6 @@ import soapRequest from 'easy-soap-request' import * as xml2js from 'xml2js' -import { LoginResult, SubscribeFormParameters, NewsDistributionParameters } from '../../types/types' +import { LoginResult, SubscribeFormParameters, NewsDistributionParameters } from '../../types/index' //import { appInsights } from '../../common' const subscriptionUrl = process.env.BRANDMASTER_EMAIL_SUBSCRIPTION_URL || '' diff --git a/web/pages/news/archive/[...pagePath].tsx b/web/pages/news/archive/[...pagePath].tsx index 65a85ee63..70498aff3 100644 --- a/web/pages/news/archive/[...pagePath].tsx +++ b/web/pages/news/archive/[...pagePath].tsx @@ -24,7 +24,7 @@ import { simpleMenuQuery } from '../../../lib/queries/simpleMenu' import { getClient } from '../../../lib/sanity.server' import Header from '../../../pageComponents/shared/Header' import { Layout } from '../../../pageComponents/shared/Layout' -import type { MenuData, SimpleMenuData } from '../../../types/types' +import type { MenuData, SimpleMenuData } from '../../../types/index' const { publicRuntimeConfig } = getConfig() diff --git a/web/sections/CallToActions/index.tsx b/web/sections/CallToActions/index.tsx index ec1138da9..1f52f0aee 100644 --- a/web/sections/CallToActions/index.tsx +++ b/web/sections/CallToActions/index.tsx @@ -1,6 +1,6 @@ import { List } from '@core/List' import { ResourceLink, ButtonLink } from '@core/Link' -import type { LinkData } from '../../types/types' +import type { LinkData } from '../../types/index' import { getUrlFromAction } from '../../common/helpers' import { getLocaleFromName } from '../../lib/localization' import { twMerge } from 'tailwind-merge' diff --git a/web/sections/CampaignBanner/CampaignBanner.tsx b/web/sections/CampaignBanner/CampaignBanner.tsx index 08c7c2e78..36c8a1408 100644 --- a/web/sections/CampaignBanner/CampaignBanner.tsx +++ b/web/sections/CampaignBanner/CampaignBanner.tsx @@ -1,6 +1,6 @@ import { forwardRef, HTMLAttributes } from 'react' import { twMerge } from 'tailwind-merge' -import { CampaignBannerData } from '../../types/types' +import { CampaignBannerData } from '../../types/index' import Blocks from '../../pageComponents/shared/portableText/Blocks' import { PortableTextBlock } from '@portabletext/types' import isEmpty from '../../pageComponents/shared/portableText/helpers/isEmpty' diff --git a/web/sections/Grid/Grid.tsx b/web/sections/Grid/Grid.tsx index 70d940784..4a975aeeb 100644 --- a/web/sections/Grid/Grid.tsx +++ b/web/sections/Grid/Grid.tsx @@ -1,5 +1,5 @@ import { twMerge } from 'tailwind-merge' -import { GridData, GridRowType } from '../../types/types' +import { GridData, GridRowType } from '../../types/index' import { HTMLAttributes, forwardRef } from 'react' import Span3 from './Span3' import Span2And1 from './Span2And1' diff --git a/web/sections/Grid/GridFigure.tsx b/web/sections/Grid/GridFigure.tsx index 662596d12..465c29a6d 100644 --- a/web/sections/Grid/GridFigure.tsx +++ b/web/sections/Grid/GridFigure.tsx @@ -1,5 +1,5 @@ import Image from '../../pageComponents/shared/SanityImage' -import type { FigureData } from '../../types/types' +import type { FigureData } from '../../types/index' type GridFigureProps = { data: FigureData diff --git a/web/sections/Grid/GridLinkArrow.tsx b/web/sections/Grid/GridLinkArrow.tsx index 4488dd511..9de43f8fc 100644 --- a/web/sections/Grid/GridLinkArrow.tsx +++ b/web/sections/Grid/GridLinkArrow.tsx @@ -4,7 +4,7 @@ import { getUrlFromAction } from '../../common/helpers' import { BaseLink } from '@core/Link' import { getLocaleFromName } from '../../lib/localization' import { ArrowRight } from '../../icons' -import { LinkData } from '../../types/types' +import { LinkData } from '../../types/index' import { getColorForTheme } from '../../pageComponents/shared/textTeaser/theme' type GridLinkArrowProps = { diff --git a/web/sections/Grid/GridTeaser.tsx b/web/sections/Grid/GridTeaser.tsx index ea80c7f26..7dc9e80a9 100644 --- a/web/sections/Grid/GridTeaser.tsx +++ b/web/sections/Grid/GridTeaser.tsx @@ -2,7 +2,7 @@ import { forwardRef, HTMLAttributes } from 'react' import { twMerge } from 'tailwind-merge' import Img from 'next/image' -import { GridTeaserData } from '../../types/types' +import { GridTeaserData } from '../../types/index' import { urlFor } from '../../common/helpers' import { RowType } from './mapGridContent' import GridLinkArrow from './GridLinkArrow' diff --git a/web/sections/Grid/GridTextBlock.tsx b/web/sections/Grid/GridTextBlock.tsx index f237fee4a..96b487500 100644 --- a/web/sections/Grid/GridTextBlock.tsx +++ b/web/sections/Grid/GridTextBlock.tsx @@ -2,7 +2,7 @@ import { twMerge } from 'tailwind-merge' import { getUrlFromAction } from '../../common/helpers' import GridLinkArrow from './GridLinkArrow' import { getColorForTheme } from '../../pageComponents/shared/textTeaser/theme' -import { GridTextBlockData } from '../../types/types' +import { GridTextBlockData } from '../../types/index' import Blocks from '../../pageComponents/shared/portableText/Blocks' type GridTextBlockProps = { diff --git a/web/sections/Grid/mapGridContent.tsx b/web/sections/Grid/mapGridContent.tsx index 6c84d5539..6211b82e1 100644 --- a/web/sections/Grid/mapGridContent.tsx +++ b/web/sections/Grid/mapGridContent.tsx @@ -1,5 +1,5 @@ import { ComponentProps } from '../../pageComponents/pageTemplates/shared/SharedPageContent' -import { FigureData, IFrameData, VideoPlayerData } from '../../types/types' +import { FigureData, IFrameData, VideoPlayerData } from '../../types/index' import IFrame from '../../pageComponents/topicPages/IFrame' import { VideoJsComponent } from '../../pageComponents/shared/VideoPlayer' import GridTextBlock from './GridTextBlock' diff --git a/web/sections/cards/CardsList/CardItem.tsx b/web/sections/cards/CardsList/CardItem.tsx index 6bd5c7e0e..34360b84d 100644 --- a/web/sections/cards/CardsList/CardItem.tsx +++ b/web/sections/cards/CardsList/CardItem.tsx @@ -1,4 +1,4 @@ -import type { CardListItemData } from '../../../types/types' +import type { CardListItemData } from '../../../types/index' import { Typography, Paragraph } from '@core/Typography' import { twMerge } from 'tailwind-merge' import { HTMLAttributes, forwardRef } from 'react' diff --git a/web/sections/cards/CardsList/CardsList.tsx b/web/sections/cards/CardsList/CardsList.tsx index ecf47f992..d9ffa39a8 100644 --- a/web/sections/cards/CardsList/CardsList.tsx +++ b/web/sections/cards/CardsList/CardsList.tsx @@ -1,4 +1,4 @@ -import type { CardsListData } from '../../../types/types' +import type { CardsListData } from '../../../types/index' import CardItem from './CardItem' import { colorKeyToUtilityMap } from '../../../styles/colorKeyToUtilityMap' import { Heading } from '../../../core/Typography' diff --git a/web/types/algoliaIndexPage.ts b/web/types/algoliaIndexPage.ts index 64107302e..0785f471d 100644 --- a/web/types/algoliaIndexPage.ts +++ b/web/types/algoliaIndexPage.ts @@ -1,14 +1,14 @@ import { InstantSearchServerState } from 'react-instantsearch' import type { - MenuData, FooterColumns, IntlData, TeaserData, - SeoData, HeroType, ImageWithCaptionData, + SeoData, BackgroundColours, -} from './types' + MenuData, +} from './index' import { PortableTextBlock } from '@portabletext/types' export type AlgoliaIndexPageType = { diff --git a/web/types/cardTypes.ts b/web/types/cardTypes.ts new file mode 100644 index 000000000..ba738a663 --- /dev/null +++ b/web/types/cardTypes.ts @@ -0,0 +1,68 @@ +import { + ImageWithAlt, + ImageWithCaptionData, + PortableTextBlock, + LinkData, + HeroTypes, + EventDateType, + DesignOptions, +} from './index' + +export type CardTypes = 'news' | 'topics' | 'people' | 'events' + +export type CardData = { + type?: 'news' | 'topics' | 'localNews' | 'magazine' + id: string + slug: string + title: string | PortableTextBlock[] + publishDateTime?: string + heroImage: ImageWithCaptionData + openGraphImage?: ImageWithAlt + ingress?: PortableTextBlock[] + heroType?: HeroTypes +} + +export type MagazineCardData = { + slug: string + title: string | PortableTextBlock[] + tags?: string[] + heroImage?: ImageWithAlt +} + +export type PeopleCardData = { + type?: 'people' + id: string + image?: ImageWithAlt + name: string + title?: string + department?: string + email?: string + phone?: string + isLink: boolean + cv?: LinkData + enableStructuredMarkup?: boolean +} + +export type EventCardData = { + id: string + type: 'events' + title: PortableTextBlock[] + slug: string + location?: string + eventDate: EventDateType +} + +export type CardsListData = { + type: 'cardsList' + id: string + title?: PortableTextBlock[] + cards?: CardListItemData[] + designOptions: DesignOptions +} + +export type CardListItemData = { + id: string + type: 'card' + title?: string + content?: PortableTextBlock[] +} diff --git a/web/types/designOptionsTypes.ts b/web/types/designOptionsTypes.ts new file mode 100644 index 000000000..ba15bf630 --- /dev/null +++ b/web/types/designOptionsTypes.ts @@ -0,0 +1,29 @@ +import { ColorKeyTokens } from '../styles/colorKeyToUtilityMap' +import { ImageBackground } from './imageTypes' + +export type BackgroundColours = + | 'White' + | 'Moss Green' + | 'Moss Green Light' + | 'Spruce Wood' + | 'Mist Blue' + | 'Slate Blue' + | 'Mid Green' + | 'Mid Yellow' + | 'Mid Blue' + | 'Mid Orange' + | 'Slate Blue 95' + +export type BackgroundTypes = 'backgroundColor' | 'backgroundImage' + +export type ContentAlignmentTypes = 'left' | 'right' | 'center' + +export type DesignOptions = { + background: { + type?: BackgroundTypes + backgroundColor?: BackgroundColours + backgroundImage?: ImageBackground + backgroundUtility?: keyof ColorKeyTokens + dark: boolean + } +} diff --git a/web/types/eventTypes.ts b/web/types/eventTypes.ts new file mode 100644 index 000000000..ba9a1f38a --- /dev/null +++ b/web/types/eventTypes.ts @@ -0,0 +1,14 @@ +import { PeopleCardData, RelatedLinksData, PortableTextBlock, SeoData, ContactListData, IFrameData } from './index' + +export type EventDateType = { + date: string + startTime?: string + endTime?: string + timezone: string +} + +export type EventPromotionSettings = { + manuallySelectEvents: boolean + promotePastEvents: boolean + pastEventsCount?: number +} diff --git a/web/types/gridTypes.ts b/web/types/gridTypes.ts new file mode 100644 index 000000000..0d5fae5c3 --- /dev/null +++ b/web/types/gridTypes.ts @@ -0,0 +1,63 @@ +import { + ImageWithAlt, + BackgroundColours, + LinkData, + FigureData, + IFrameData, + VideoPlayerData, + ContentAlignmentTypes, +} from './index' +import { TeaserImagePosition } from '@components/Teaser' +import { PortableTextBlock } from '@portabletext/types' +import { RowType } from '@sections/Grid/mapGridContent' + +export type GridTeaserData = { + type: 'gridTeaser' + id: string + image: ImageWithAlt + rowType?: RowType + content?: PortableTextBlock + quote?: string + author?: string + authorTitle?: string + background?: BackgroundColours + imagePosition?: TeaserImagePosition + action?: LinkData + theme?: number +} + +export type GridRowType = Span3 | Span2And1 | ThreeColumns + +export type GridData = { + type: 'grid' + id: string + gridRows?: GridRowType[] +} + +export type GridContentType = FigureData | IFrameData | VideoPlayerData | GridTextBlockData | GridTeaserData + +export type Span3 = { + type: 'span3' + id: string + content?: GridContentType[] +} +export type Span2And1 = { + type: 'span2and1' + id: string + singleColumn?: GridContentType[] + span2?: GridContentType[] +} +export type ThreeColumns = { + type: 'threeColumns' + id: string + columns?: GridContentType[] +} + +export type GridTextBlockData = { + id: string + type: 'gridTextBlock' + action?: LinkData + content?: PortableTextBlock[] + textAlignment?: ContentAlignmentTypes + theme?: number +} diff --git a/web/types/imageTypes.ts b/web/types/imageTypes.ts new file mode 100644 index 000000000..39f74d06b --- /dev/null +++ b/web/types/imageTypes.ts @@ -0,0 +1,62 @@ +import { ContentAlignmentTypes, FigureRatio, DesignOptions } from './index' +import { SanityImageCrop, SanityImageHotspot, SanityImageObject } from '@sanity/image-url/lib/types/types' +import { PortableTextBlock } from '@portabletext/types' + +export type CaptionData = { + attribution?: string + caption?: string +} + +export type ImageWithAlt = { + isDecorative: boolean + alt?: string + asset: SanityImageObject + crop?: SanityImageCrop + hotspot?: SanityImageHotspot + _type: 'imageWithAlt' + extension?: string +} + +export type ImageWithCaptionData = { + _type: 'imageWithAltAndCaption' + _key?: string + image: ImageWithAlt + asset: SanityImageObject +} & CaptionData + +export type ImageBackground = { + image: ImageWithAlt | SanityImageObject + useAnimation?: boolean + useLight?: boolean + contentAlignment: ContentAlignmentTypes +} + +export type FullWidthImageData = { + type: string + id: string + image: ImageWithCaptionData + designOptions: DesignOptions & { + aspectRatio: number + } +} + +export type FigureData = { + type: string + id: string + figure: ImageWithCaptionData + designOptions: DesignOptions & { + aspectRatio?: FigureRatio + } +} + +export type ImageCarouselData = { + type: 'imageCarousel' + id: string + title?: PortableTextBlock[] + items: ImageWithCaptionData[] + options: { + autoplay: boolean + delay: number + } + designOptions: DesignOptions +} diff --git a/web/types/index.ts b/web/types/index.ts index b8f73c4ca..35fc591fc 100644 --- a/web/types/index.ts +++ b/web/types/index.ts @@ -1,2 +1,11 @@ export * from './algoliaIndexPage' export * from './types' +export * from './imageTypes' +export * from './linkTypes' +export * from './pageTypes' +export * from './cardTypes' +export * from './eventTypes' +export * from './designOptionsTypes' +export * from './videoTypes' +export * from './menuTypes' +export * from './gridTypes' diff --git a/web/types/linkTypes.ts b/web/types/linkTypes.ts new file mode 100644 index 000000000..09d8c8346 --- /dev/null +++ b/web/types/linkTypes.ts @@ -0,0 +1,28 @@ +export type LinkType = + | 'internalUrl' + | 'externalUrl' + | 'downloadableFile' + | 'downloadableImage' + | 'dateField' + | 'textField' + | 'numberField' + | 'linkSelector' + +export type LinkData = { + type?: LinkType + id?: string + label: string + ariaLabel?: string + link?: { slug: string; type: string; lang: string } + href?: string + extension?: string + fileName?: string + anchorReference?: string + filename?: string +} + + +export type RelatedLinksData = { + title: string + links: LinkData[] +} diff --git a/web/types/menuTypes.ts b/web/types/menuTypes.ts new file mode 100644 index 000000000..2627067e2 --- /dev/null +++ b/web/types/menuTypes.ts @@ -0,0 +1,58 @@ +import { ImageWithAlt, CardData } from './index' +import { PortableTextBlock } from '@portabletext/types' + +export type MenuLinkData = { + label: string + href?: string + id?: string + link?: { + type: string + slug: string + } +} + +export type SubMenuGroupLinkData = MenuLinkData & { + image: ImageWithAlt +} + +export type SubMenuGroupData = { + id: string + label: string + links: SubMenuGroupLinkData[] +} + +export type SubMenuData = { + id: string + topLevelLink: MenuLinkData + intro: PortableTextBlock[] + groups: SubMenuGroupData[] + featuredContent: CardData +} + +export type MenuData = { + subMenus: SubMenuData[] +} + +export type SimpleMenuLink = { + id?: string + label: string + link: { + slug: string + type: string + } +} +export type SimpleGroupData = { + id: string + label: string + type: 'simpleMenuGroup' | 'simpleMenuLink' + readMoreLink?: SimpleMenuLink + links?: SimpleMenuLink[] + link?: { + slug: string + type: string + } +} + +export type SimpleMenuData = { + groups: SimpleGroupData[] +} diff --git a/web/types/pageTypes.ts b/web/types/pageTypes.ts new file mode 100644 index 000000000..ccc33543b --- /dev/null +++ b/web/types/pageTypes.ts @@ -0,0 +1,108 @@ +import { + ImageWithAlt, + ImageWithCaptionData, + RelatedLinksData, + CardData, + EventDateType, + ContactListData, + PeopleCardData, + SeoData, + HeroType, + ContentType, + TeaserData, + SubMenuGroupData, + IFrameData, +} from './index' +import { SanityImageSource } from '@sanity/asset-utils' +import { Templates } from 'instantsearch.js' + +export type PortableTextBlock = any // Adjust as per actual definition + +export type ErrorPageData = { + documentTitle?: string + metaDescription?: string + backgroundImage: SanityImageSource + title?: PortableTextBlock[] + text?: PortableTextBlock[] +} + +export type PageSchema = { + slug: string + title: PortableTextBlock[] + hero: HeroType + template: Templates + seoAndSome: SeoData + content?: ContentType[] + id: string + type: string + isCampaign?: boolean + breadcrumbs: { + enableBreadcrumbs: boolean + useCustomBreadcrumbs: boolean + defaultBreadcrumbs: Breadcrumb[] + customBreadcrumbs: Breadcrumb[] + } +} + +export type TopicPageSchema = PageSchema + +export type MagazinePageSchema = PageSchema & { + magazineTags?: string[] + footerComponent?: { + data?: TeaserData + } + hideFooterComponent?: boolean +} + +export type LandingPageSchema = { + id: string + slug: string + title: PortableTextBlock[] + ingress: PortableTextBlock[] + subGroups: SubMenuGroupData[] + template: Templates + seoAndSome: SeoData +} + +export type NewsSchema = { + slug: string + title: string + documentTitle?: string + metaDescription?: string + openGraphImage?: ImageWithAlt + id: string + updatedAt: string + publishDateTime: string + heroImage: ImageWithCaptionData + ingress: PortableTextBlock[] + content: PortableTextBlock[] + relatedLinks: RelatedLinksData + iframe: IFrameData + latestNews: CardData[] +} + +export type Breadcrumb = { + label: string + slug: string + type?: string +} + +export type EventSchema = { + id: string + title: PortableTextBlock[] + slug: string + seoAndSome: SeoData + content: { + location?: string + eventDate: EventDateType + ingress?: PortableTextBlock[] + content?: PortableTextBlock[] + iframe?: IFrameData + promotedPeople?: { + title?: PortableTextBlock[] + people?: PeopleCardData[] + } + contactList?: ContactListData + relatedLinks?: RelatedLinksData + } +} diff --git a/web/types/types.ts b/web/types/types.ts index 60f026594..ef02279f3 100644 --- a/web/types/types.ts +++ b/web/types/types.ts @@ -1,59 +1,25 @@ import { TeaserImagePosition, TeaserImageSize } from '@components' import { PortableTextBlock } from '@portabletext/types' -import { - SanityImageCrop, - SanityImageHotspot, - SanityImageObject, - SanityImageSource, -} from '@sanity/image-url/lib/types/types' -import { ColorKeyTokens } from '../styles/colorKeyToUtilityMap' -import { RowType } from '@sections/Grid/mapGridContent' - -export type CaptionData = { - attribution?: string - caption?: string -} - -export type ImageWithCaptionData = { - _type: 'imageWithAltAndCaption' - _key?: string - image: ImageWithAlt - asset: SanityImageObject -} & CaptionData - -export type LinkType = - | 'internalUrl' - | 'externalUrl' - | 'downloadableFile' - | 'downloadableImage' - | 'dateField' - | 'textField' - | 'numberField' - | 'linkSelector' - -export type LinkData = { - type?: LinkType - id?: string - label: string - ariaLabel?: string - link?: { slug: string; type: string; lang: string } - href?: string - extension?: string - fileName?: string - anchorReference?: string - filename?: string -} - -export type SeoData = { - documentTitle?: string - metaDescription?: string - openGraphImage?: ImageWithAlt -} - -export type RelatedLinksData = { - title: string - links: LinkData[] -} +import type { + ImageWithCaptionData, + ImageWithAlt, + LinkData, + LinkType, + EventDateType, + EventPromotionSettings, + CardData, + EventCardData, + PeopleCardData, + BackgroundColours, + DesignOptions, + LoopingVideoData, + VideoPlayerData, + VideoPlayerCarouselData, + FullWidthVideoData, + GridData, + FullWidthImageData, + FigureData, +} from './index' export type IntlData = { locale: string @@ -61,50 +27,10 @@ export type IntlData = { messages: Record } -export type ImageWithAlt = { - isDecorative: boolean - alt?: string - asset: SanityImageObject - crop?: SanityImageCrop - hotspot?: SanityImageHotspot - _type: 'imageWithAlt' - extension?: string -} - -export type ErrorPageData = { +export type SeoData = { documentTitle?: string metaDescription?: string - backgroundImage: SanityImageSource - title?: PortableTextBlock[] - text?: PortableTextBlock[] -} - -export type CardTypes = 'news' | 'topics' | 'people' | 'events' - -export type EventDateType = { - date: string - startTime?: string - endTime?: string - timezone: string -} - -export type CardData = { - type?: 'news' | 'topics' | 'localNews' | 'magazine' - id: string - slug: string - title: string | PortableTextBlock[] - publishDateTime?: string - heroImage: ImageWithCaptionData openGraphImage?: ImageWithAlt - ingress?: PortableTextBlock[] - heroType?: HeroTypes -} - -export type MagazineCardData = { - slug: string - title: string | PortableTextBlock[] - tags?: string[] - heroImage?: ImageWithAlt } export type FeaturedContentData = { @@ -114,52 +40,6 @@ export type FeaturedContentData = { eventDate?: EventDateType } & CardData -export type PeopleCardData = { - type?: 'people' - id: string - image?: ImageWithAlt - name: string - title?: string - department?: string - email?: string - phone?: string - isLink: boolean - cv?: LinkData - enableStructuredMarkup?: boolean -} - -export type EventPromotionSettings = { - manuallySelectEvents: boolean - promotePastEvents: boolean - pastEventsCount?: number -} - -export type EventCardData = { - id: string - type: 'events' - title: PortableTextBlock[] - slug: string - location?: string - eventDate: EventDateType -} - -export type NewsSchema = { - slug: string - title: string - documentTitle?: string - metaDescription?: string - openGraphImage?: ImageWithAlt - id: string - updatedAt: string - publishDateTime: string - heroImage: ImageWithCaptionData - ingress: PortableTextBlock[] - content: PortableTextBlock[] - relatedLinks: RelatedLinksData - iframe: IFrameData - latestNews: CardData[] -} - export type PortableTextChild = { _key: string _type: string @@ -213,83 +93,6 @@ export type ContentType = | GridData | CampaignBannerData -export type Breadcrumb = { - label: string - slug: string - type?: string -} - -export type PageSchema = { - slug: string - title: PortableTextBlock[] - hero: HeroType - template: Templates - seoAndSome: SeoData - content?: ContentType[] - id: string - type: string - isCampaign?: boolean - breadcrumbs: { - enableBreadcrumbs: boolean - useCustomBreadcrumbs: boolean - defaultBreadcrumbs: Breadcrumb[] - customBreadcrumbs: Breadcrumb[] - } -} - -export type TopicPageSchema = PageSchema - -export type MagazinePageSchema = PageSchema & { - magazineTags?: string[] - footerComponent?: { - data?: TeaserData - } - hideFooterComponent?: boolean -} - -export type LandingPageSchema = { - id: string - slug: string - title: PortableTextBlock[] - ingress: PortableTextBlock[] - subGroups: SubMenuGroupData[] - template: Templates - seoAndSome: SeoData -} -export type ContentAlignmentTypes = 'left' | 'right' | 'center' - -export type ImageBackground = { - image: ImageWithAlt | SanityImageObject - useAnimation?: boolean - useLight?: boolean - contentAlignment: ContentAlignmentTypes -} - -export type BackgroundColours = - | 'White' - | 'Moss Green' - | 'Moss Green Light' - | 'Spruce Wood' - | 'Mist Blue' - | 'Slate Blue' - | 'Mid Green' - | 'Mid Yellow' - | 'Mid Blue' - | 'Mid Orange' - | 'Slate Blue 95' - -export type BackgroundTypes = 'backgroundColor' | 'backgroundImage' - -export type DesignOptions = { - background: { - type?: BackgroundTypes - backgroundColor?: BackgroundColours - backgroundImage?: ImageBackground - backgroundUtility?: keyof ColorKeyTokens - dark: boolean - } -} - export type TextBlockData = { type: string id: string @@ -373,42 +176,6 @@ export type TableData = { designOptions: DesignOptions & { theme: TableThemes } } -export type FullWidthImageData = { - type: string - id: string - image: ImageWithCaptionData - designOptions: DesignOptions & { - aspectRatio: number - } -} - -export type FullWidthVideoData = { - type: string - id: string - video: { - title: string - url: string - thumbnail: ImageWithAlt - } - spacing?: boolean - title?: PortableTextBlock[] - action?: LinkData - designOptions: DesignOptions & { - aspectRatio: FullWidthVideoRatio - } -} - -export type FullWidthVideoRatio = 'fullScreen' | 'narrow' | '2:1' - -export type FigureData = { - type: string - id: string - figure: ImageWithCaptionData - designOptions: DesignOptions & { - aspectRatio?: FigureRatio - } -} - export type TextWithIconItem = { id: string icon: ImageWithAlt @@ -467,63 +234,6 @@ export type PromoTileArrayData = { useHorizontalScroll: boolean } -export type MenuLinkData = { - label: string - href?: string - id?: string - link?: { - type: string - slug: string - } -} - -export type SubMenuGroupLinkData = MenuLinkData & { - image: ImageWithAlt -} - -export type SubMenuGroupData = { - id: string - label: string - links: SubMenuGroupLinkData[] -} - -export type SubMenuData = { - id: string - topLevelLink: MenuLinkData - intro: PortableTextBlock[] - groups: SubMenuGroupData[] - featuredContent: CardData -} - -export type MenuData = { - subMenus: SubMenuData[] -} - -export type SimpleMenuLink = { - id?: string - label: string - link: { - slug: string - type: string - } -} - -export type SimpleGroupData = { - id: string - label: string - type: 'simpleMenuGroup' | 'simpleMenuLink' - readMoreLink?: SimpleMenuLink - links?: SimpleMenuLink[] - link?: { - slug: string - type: string - } -} - -export type SimpleMenuData = { - groups: SimpleGroupData[] -} - export type CookiePolicy = 'none' | 'marketing' | 'statistics' export type IFrameData = { @@ -622,26 +332,6 @@ export type SubscribeFormParameters = { languageCode: string } -export type EventSchema = { - id: string - title: PortableTextBlock[] - slug: string - seoAndSome: SeoData - content: { - location?: string - eventDate: EventDateType - ingress?: PortableTextBlock[] - content?: PortableTextBlock[] - iframe?: IFrameData - promotedPeople?: { - title?: PortableTextBlock[] - people?: PeopleCardData[] - } - contactList?: ContactListData - relatedLinks?: RelatedLinksData - } -} - export type NewsDistributionParameters = { timeStamp: string title: string @@ -699,86 +389,6 @@ export type AnchorLinkData = { anchorReference: string } -export enum VideoPlayerRatios { - '16:9' = '16:9', - '3:2' = '3:2', - '16:10' = '16:10', - '9:16' = '9:16', - '1:1' = '1:1', -} - -export type VideoType = { - title: string - url: string - thumbnail: ImageWithAlt -} - -export type VideoControlsType = { - playButton?: boolean - controls?: boolean - loop?: boolean - allowFullScreen?: boolean - autoPlay?: boolean - muted?: boolean -} - -export type VideoDesignOptionsType = { - aspectRatio: VideoPlayerRatios - height?: number | string - width?: 'normal' | 'extraWide' - useBrandTheme?: boolean -} - -export type VideoPlayerData = { - id: string - type: string - video: VideoType - videoControls: VideoControlsType - designOptions: DesignOptions & VideoDesignOptionsType - title?: PortableTextBlock[] - ingress?: PortableTextBlock[] - action?: LinkData -} - -export type VideoPlayerCarouselData = { - id: string - type: string - items: { - id: string - title: PortableTextBlock[] - video: { - title: string - url: string - thumbnail: ImageWithAlt - } - }[] - designOptions: DesignOptions & { - aspectRatio: VideoPlayerRatios - } - title?: PortableTextBlock[] -} - -export type LoopingVideoRatio = '1:2' | 'narrow' - -export type LoopingVideoData = { - title: string - thumbnail: ImageWithAlt - url: string - ratio: LoopingVideoRatio -} - -export type ImageCarouselData = { - type: 'imageCarousel' - id: string - title?: PortableTextBlock[] - items: ImageWithCaptionData[] - options: { - autoplay: boolean - delay: number - } - designOptions: DesignOptions -} - export type IFrameCarouselItemData = { id?: string type?: string @@ -824,76 +434,13 @@ export type KeyNumbersData = { action?: LinkData } -export type CardsListData = { - type: 'cardsList' - id: string - title?: PortableTextBlock[] - cards?: CardListItemData[] - designOptions: DesignOptions -} -export type CardListItemData = { - id: string - type: 'card' - title?: string - content?: PortableTextBlock[] -} - -export type GridRowType = Span3 | Span2And1 | ThreeColumns - -export type GridData = { - type: 'grid' - id: string - gridRows?: GridRowType[] -} - -export type GridContentType = FigureData | IFrameData | VideoPlayerData | GridTextBlockData | GridTeaserData - -export type Span3 = { - type: 'span3' - id: string - content?: GridContentType[] -} -export type Span2And1 = { - type: 'span2and1' - id: string - singleColumn?: GridContentType[] - span2?: GridContentType[] -} -export type ThreeColumns = { - type: 'threeColumns' - id: string - columns?: GridContentType[] -} - -export type GridTextBlockData = { - id: string - type: 'gridTextBlock' - action?: LinkData - content?: PortableTextBlock[] - textAlignment?: ContentAlignmentTypes - theme?: number -} - export type CampaignBannerData = { type: 'campaignBanner' id: string title: PortableTextBlock[] designOptions: DesignOptions } -export type GridTeaserData = { - type: 'gridTeaser' - id: string - image: ImageWithAlt - rowType?: RowType - content?: PortableTextBlock - quote?: string - author?: string - authorTitle?: string - background?: BackgroundColours - imagePosition?: TeaserImagePosition - action?: LinkData - theme?: number -} + export type PodcastTeaserData = { id: string type: 'podcastTeaser' diff --git a/web/types/videoTypes.ts b/web/types/videoTypes.ts new file mode 100644 index 000000000..d84b21a95 --- /dev/null +++ b/web/types/videoTypes.ts @@ -0,0 +1,88 @@ +import { ImageWithAlt, DesignOptions, LinkData } from './index' +import { PortableTextBlock } from '@portabletext/types' + +export enum VideoPlayerRatios { + '16:9' = '16:9', + '3:2' = '3:2', + '16:10' = '16:10', + '9:16' = '9:16', + '1:1' = '1:1', +} + +export type VideoType = { + title: string + url: string + thumbnail: ImageWithAlt +} + +export type VideoControlsType = { + playButton?: boolean + controls?: boolean + loop?: boolean + allowFullScreen?: boolean + autoPlay?: boolean + muted?: boolean +} + +export type VideoDesignOptionsType = { + aspectRatio: VideoPlayerRatios + height?: number + width?: 'normal' | 'extraWide' + useBrandTheme?: boolean +} + +export type VideoPlayerData = { + id: string + type: string + video: VideoType + videoControls: VideoControlsType + designOptions: DesignOptions & VideoDesignOptionsType + title?: PortableTextBlock[] + ingress?: PortableTextBlock[] + action?: LinkData +} + +export type VideoPlayerCarouselData = { + id: string + type: string + items: { + id: string + title: PortableTextBlock[] + video: { + title: string + url: string + thumbnail: ImageWithAlt + } + }[] + designOptions: DesignOptions & { + aspectRatio: VideoPlayerRatios + } + title?: PortableTextBlock[] +} + +export type LoopingVideoRatio = '1:2' | 'narrow' + +export type LoopingVideoData = { + title: string + thumbnail: ImageWithAlt + url: string + ratio: LoopingVideoRatio +} + +export type FullWidthVideoData = { + type: string + id: string + video: { + title: string + url: string + thumbnail: ImageWithAlt + } + spacing?: boolean + title?: PortableTextBlock[] + action?: LinkData + designOptions: DesignOptions & { + aspectRatio: FullWidthVideoRatio + } +} + +export type FullWidthVideoRatio = 'fullScreen' | 'narrow' | '2:1' From f36fc0219f6ba5d40731b9c35bdf9fc6d814aba7 Mon Sep 17 00:00:00 2001 From: "Malin J." Date: Wed, 11 Sep 2024 11:44:48 +0200 Subject: [PATCH 2/2] downgrade lock --- web/pnpm-lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 7f562fae8..813975caf 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true