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 0e5b07efb..a6168cae7 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 c1b6d977e..58a0f511e 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/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/Carousel/Carousel.tsx b/web/core/Carousel/Carousel.tsx index dcaf20ed1..ee7f9401e 100644 --- a/web/core/Carousel/Carousel.tsx +++ b/web/core/Carousel/Carousel.tsx @@ -4,7 +4,7 @@ import { EventCardData, KeyNumberItemData, IFrameCarouselItemData, -} from '../../types/types' +} from '../../types/index' import { ElementType, forwardRef, diff --git a/web/core/Carousel/CarouselEventItem.tsx b/web/core/Carousel/CarouselEventItem.tsx index 5f5c590a8..7110862db 100644 --- a/web/core/Carousel/CarouselEventItem.tsx +++ b/web/core/Carousel/CarouselEventItem.tsx @@ -2,7 +2,7 @@ import envisTwMerge from '../../twMerge' import { DisplayModes } from './Carousel' import { forwardRef, HTMLAttributes } from 'react' import { EventCard } from '@sections/cards/EventCard' -import { EventCardData } from '../../types/types' +import { EventCardData } from '../../types/index' type CarouselEventItemProps = { event: EventCardData diff --git a/web/core/Carousel/CarouselIframeItem.tsx b/web/core/Carousel/CarouselIframeItem.tsx index 8896a5e63..30d41629d 100644 --- a/web/core/Carousel/CarouselIframeItem.tsx +++ b/web/core/Carousel/CarouselIframeItem.tsx @@ -1,5 +1,5 @@ import envisTwMerge from '../../twMerge' -import { IFrameCarouselItemData } from '../../types/types' +import { IFrameCarouselItemData } from '../../types/index' import { DisplayModes } from './Carousel' import { forwardRef, HTMLAttributes } from 'react' import { Heading, Paragraph } from '@core/Typography' diff --git a/web/core/Carousel/CarouselImageItem.tsx b/web/core/Carousel/CarouselImageItem.tsx index a4cc7ef64..bb94cd8b4 100644 --- a/web/core/Carousel/CarouselImageItem.tsx +++ b/web/core/Carousel/CarouselImageItem.tsx @@ -1,6 +1,6 @@ import envisTwMerge from '../../twMerge' import Image from '../../pageComponents/shared/SanityImage' -import { ImageWithAlt, ImageWithCaptionData } from '../../types/types' +import { ImageWithAlt, ImageWithCaptionData } from '../../types/index' import { DisplayModes } from './Carousel' import { forwardRef, HTMLAttributes } from 'react' diff --git a/web/core/Carousel/CarouselKeyNumberItem.tsx b/web/core/Carousel/CarouselKeyNumberItem.tsx index bcb2da033..6b6d18518 100644 --- a/web/core/Carousel/CarouselKeyNumberItem.tsx +++ b/web/core/Carousel/CarouselKeyNumberItem.tsx @@ -1,7 +1,7 @@ import envisTwMerge from '../../twMerge' import { DisplayModes } from './Carousel' import { forwardRef, HTMLAttributes } from 'react' -import { KeyNumberItemData } from '../../types/types' +import { KeyNumberItemData } from '../../types/index' import KeyNumberItem from '@sections/KeyNumber/KeyNumberItem' type CarouselEventItemProps = { diff --git a/web/core/Carousel/CarouselVideoItem.tsx b/web/core/Carousel/CarouselVideoItem.tsx index 7739f7a49..7c2a5eb73 100644 --- a/web/core/Carousel/CarouselVideoItem.tsx +++ b/web/core/Carousel/CarouselVideoItem.tsx @@ -1,5 +1,5 @@ import envisTwMerge from '../../twMerge' -import { VideoPlayerCarouselItem, VideoPlayerRatios } from '../../types/types' +import { VideoPlayerCarouselItem, VideoPlayerRatios } from '../../types/index' import { DisplayModes } from './Carousel' import { VideoComponentWithCaption } from '../../pageComponents/shared/VideoPlayer' import { forwardRef, HTMLAttributes } from 'react' 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 eb69dfd70..1d8bb5d8c 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 76c93e46d..5d359d2bc 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/MagazineCard.tsx b/web/pageComponents/cards/MagazineCard.tsx index 7c361fe64..fde7eb8ee 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/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/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 2d3cfce93..43bf6f994 100644 --- a/web/pageComponents/news/LatestNews.tsx +++ b/web/pageComponents/news/LatestNews.tsx @@ -1,4 +1,4 @@ -import type { CardData } from '../../types/types' +import type { CardData } from '../../types/index' import { FormattedMessage } from 'react-intl' import { FormattedDate } from '@components/FormattedDateTime' import { useMediaQuery } from '../../lib/hooks/useMediaQuery' 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 1596a0c71..951c26ab2 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 c66922a3a..9320e511e 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 b5d328404..d9129355e 100644 --- a/web/pageComponents/pageTemplates/shared/SharedPageContent.tsx +++ b/web/pageComponents/pageTemplates/shared/SharedPageContent.tsx @@ -54,7 +54,7 @@ import { DesignOptions, ImageForTextData, AnchorLinkListData, -} 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/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 0e506e016..72c5f3030 100644 --- a/web/pageComponents/shared/Footer.tsx +++ b/web/pageComponents/shared/Footer.tsx @@ -1,6 +1,6 @@ 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' 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 3ed0587d9..58a89b706 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/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 b879ffdd4..0a4dc1125 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 28324db51..d4a76de75 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 7a2ce4eff..007fe6a8a 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/iframe/BasicIFrame.tsx b/web/pageComponents/shared/iframe/BasicIFrame.tsx index 8db903fd0..e617222bf 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 9af4423df..e67f8efd0 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' 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 77575035b..506de2d6d 100644 --- a/web/pageComponents/shared/siteMenu/FeaturedContent.tsx +++ b/web/pageComponents/shared/siteMenu/FeaturedContent.tsx @@ -1,4 +1,4 @@ -import type { EventCardData, FeaturedContentData } from '../../../types/types' +import type { EventCardData, FeaturedContentData } from '../../../types/index' import PromotionCard from '@sections/cards/PromotionCard/PromotionCard' import { EventCard } from '@sections/cards/EventCard' diff --git a/web/pageComponents/shared/siteMenu/MenuGroup.tsx b/web/pageComponents/shared/siteMenu/MenuGroup.tsx index e57d4c920..b5ca0d30f 100644 --- a/web/pageComponents/shared/siteMenu/MenuGroup.tsx +++ b/web/pageComponents/shared/siteMenu/MenuGroup.tsx @@ -1,9 +1,9 @@ import { Fragment } from 'react' import styled from 'styled-components' import RichText from '../portableText/RichText' -import { Link, ReadMoreLink } from '@core/Link' import { Menu } from '@components' -import type { MenuLinkData, SubMenuData, SubMenuGroupData } from '../../../types/types' +import { Link, ReadMoreLink } from '@core/Link' +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 a73f7d543..14cfc5b0d 100644 --- a/web/pageComponents/shared/siteMenu/SiteMenu.tsx +++ b/web/pageComponents/shared/siteMenu/SiteMenu.tsx @@ -12,7 +12,7 @@ import { getAllSitesLink } from '../../../common/helpers/getAllSitesLink' import { LogoLink } from '../LogoLink' import { Link } from '@core/Link' -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 c75ce60f9..f7d29732e 100644 --- a/web/pageComponents/shared/siteMenu/simple/SimpleMenuItem.tsx +++ b/web/pageComponents/shared/siteMenu/simple/SimpleMenuItem.tsx @@ -4,7 +4,7 @@ import { List, Menu } from '@components' import { Link } from '@core/Link' 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 22ff12c17..9bb46f892 100644 --- a/web/pageComponents/shared/siteMenu/simple/SimpleSiteMenu.tsx +++ b/web/pageComponents/shared/siteMenu/simple/SimpleSiteMenu.tsx @@ -10,7 +10,7 @@ import { Link } from '@core/Link' 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 7e1ee7a1b..c687bf73d 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 3787486d8..4a80064b1 100644 --- a/web/pageComponents/topicPages/AddToCalendar.tsx +++ b/web/pageComponents/topicPages/AddToCalendar.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' 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' import { Button } from '@core/Button' diff --git a/web/pageComponents/topicPages/CallToActions.tsx b/web/pageComponents/topicPages/CallToActions.tsx index c23156544..15a64a138 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, ReadMoreLink } from '@core/Link' import { getUrlFromAction } from '../../common/helpers' import { getLocaleFromName } from '../../lib/localization' 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 da89d5cdd..61c646a5b 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 0a83018b7..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 { 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 48e64f8a5..2ff6be785 100644 --- a/web/pageComponents/topicPages/Form/SubscribeForm.tsx +++ b/web/pageComponents/topicPages/Form/SubscribeForm.tsx @@ -1,4 +1,4 @@ -import type { SubscribeFormParameters } from '../../../types/types' +import type { SubscribeFormParameters } from '../../../types/index' import { Icon } from '@equinor/eds-core-react' import { useForm, Controller } from 'react-hook-form' import { error_filled } from '@equinor/eds-icons' 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 7e0d5e8f6..de607e93e 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 IngressText from '../shared/portableText/IngressText' diff --git a/web/pageComponents/topicPages/NewsList.tsx b/web/pageComponents/topicPages/NewsList.tsx index f71c4375f..af7d2ff31 100644 --- a/web/pageComponents/topicPages/NewsList.tsx +++ b/web/pageComponents/topicPages/NewsList.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components' 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' import PromotionCard from '@sections/cards/PromotionCard/PromotionCard' 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/Promotion.tsx b/web/pageComponents/topicPages/Promotion.tsx index e22c73cdd..843922abc 100644 --- a/web/pageComponents/topicPages/Promotion.tsx +++ b/web/pageComponents/topicPages/Promotion.tsx @@ -2,7 +2,7 @@ import { BackgroundContainer } from '@components' import SinglePromotion from './promotions/SinglePromotion' import MultiplePromotions from './promotions/MultiplePromotions' import IngressText from '../shared/portableText/IngressText' -import type { PromotionData } from '../../types/types' +import type { PromotionData } from '../../types/index' import { twMerge } from 'tailwind-merge' import { ButtonLink } from '@core/Link' import { Heading } from '@core/Typography' 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 95d1ab77c..14d94b76c 100644 --- a/web/pageComponents/topicPages/Table.tsx +++ b/web/pageComponents/topicPages/Table.tsx @@ -7,7 +7,7 @@ import TitleText from '../shared/portableText/TitleText' import { Link } from '@core/Link' 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 ded0eb6ff..d3995d69c 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 703496342..04da5c020 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 6661cb656..a40696193 100644 --- a/web/pageComponents/topicPages/promotions/MultipleEventCards.tsx +++ b/web/pageComponents/topicPages/promotions/MultipleEventCards.tsx @@ -1,6 +1,6 @@ import { useMediaQuery } from '../../../lib/hooks/useMediaQuery' import { getEventDates } from '../../../common/helpers/dateUtilities' -import type { EventCardData, EventPromotionSettings } from '../../../types/types' +import type { EventCardData, EventPromotionSettings } from '../../../types/index' import { EventCard } from '@sections/cards/EventCard' import PastEvents from './pastEvents/PastEvents' import { Carousel } from '@core/Carousel/Carousel' diff --git a/web/pageComponents/topicPages/promotions/MultiplePromotions.tsx b/web/pageComponents/topicPages/promotions/MultiplePromotions.tsx index 98abcaf0b..5b7bbc786 100644 --- a/web/pageComponents/topicPages/promotions/MultiplePromotions.tsx +++ b/web/pageComponents/topicPages/promotions/MultiplePromotions.tsx @@ -4,7 +4,7 @@ import type { EventCardData, PromotionType, EventPromotionSettings, -} from '../../../types/types' +} from '../../../types/index' import MultipleEventCards from './MultipleEventCards' import PeopleCard from '@sections/cards/PeopleCard/PeopleCard' diff --git a/web/pageComponents/topicPages/promotions/SinglePromotion.tsx b/web/pageComponents/topicPages/promotions/SinglePromotion.tsx index 7c018b3be..810cce636 100644 --- a/web/pageComponents/topicPages/promotions/SinglePromotion.tsx +++ b/web/pageComponents/topicPages/promotions/SinglePromotion.tsx @@ -1,4 +1,4 @@ -import type { PeopleCardData, EventCardData, CardData } from '../../../types/types' +import type { PeopleCardData, EventCardData, CardData } from '../../../types/index' import { EventCard } from '@sections/cards/EventCard' import PeopleCard from '@sections/cards/PeopleCard/PeopleCard' import PromotionCard from '@sections/cards/PromotionCard/PromotionCard' diff --git a/web/pageComponents/topicPages/promotions/pastEvents/PastEvents.tsx b/web/pageComponents/topicPages/promotions/pastEvents/PastEvents.tsx index b8681ed48..42027fffc 100644 --- a/web/pageComponents/topicPages/promotions/pastEvents/PastEvents.tsx +++ b/web/pageComponents/topicPages/promotions/pastEvents/PastEvents.tsx @@ -1,4 +1,4 @@ -import type { EventCardData, EventPromotionSettings } from '../../../../types/types' +import type { EventCardData, EventPromotionSettings } from '../../../../types/index' import PastEventsListItem from './PastEventsListItem' type PastEventsProp = { diff --git a/web/pageComponents/topicPages/promotions/pastEvents/PastEventsListItem.tsx b/web/pageComponents/topicPages/promotions/pastEvents/PastEventsListItem.tsx index f93653c01..25119105f 100644 --- a/web/pageComponents/topicPages/promotions/pastEvents/PastEventsListItem.tsx +++ b/web/pageComponents/topicPages/promotions/pastEvents/PastEventsListItem.tsx @@ -1,5 +1,5 @@ import { Heading, Typography } from '@core/Typography' -import { EventCardData } from '../../../../types/types' +import { EventCardData } from '../../../../types/index' import { forwardRef, HTMLAttributes } from 'react' import { twMerge } from 'tailwind-merge' import { getEventDates } from '../../../../common/helpers/dateUtilities' 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 f22f4ed73..8d3a8c15b 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 0884fda1a..275c4656e 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 b7465dbd3..bf78af081 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 a4ab34526..ead3e6a33 100644 --- a/web/sections/Grid/GridFigure.tsx +++ b/web/sections/Grid/GridFigure.tsx @@ -1,6 +1,6 @@ import { forwardRef } from 'react' 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 c8c2144e4..49a7201e3 100644 --- a/web/sections/Grid/GridLinkArrow.tsx +++ b/web/sections/Grid/GridLinkArrow.tsx @@ -4,7 +4,8 @@ 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' import { forwardRef } from 'react' type GridLinkArrowProps = { diff --git a/web/sections/Grid/GridTeaser.tsx b/web/sections/Grid/GridTeaser.tsx index bed5e16f2..7218d758e 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 335c743b1..68135634d 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 { BackgroundTypes, GridTextBlockData } from '../../types/types' +import { BackgroundTypes, GridTextBlockData } from '../../types/index' import Blocks from '../../pageComponents/shared/portableText/Blocks' import { BackgroundContainer } from '@components/Backgrounds' import { Heading, Typography } from '@core/Typography' diff --git a/web/sections/Grid/mapGridContent.tsx b/web/sections/Grid/mapGridContent.tsx index a5523473c..5d92a9d7e 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/IframeCarousel/IframeCarousel.tsx b/web/sections/IframeCarousel/IframeCarousel.tsx index e484e6b63..8f62d3fb6 100644 --- a/web/sections/IframeCarousel/IframeCarousel.tsx +++ b/web/sections/IframeCarousel/IframeCarousel.tsx @@ -1,6 +1,6 @@ import { BackgroundContainer } from '@components' import { Heading } from '@core/Typography' -import type { IframeCarouselData } from '../../types/types' +import type { IframeCarouselData } from '../../types/index' import { twMerge } from 'tailwind-merge' import { Carousel } from '@core/Carousel/Carousel' diff --git a/web/sections/ImageCarousel/ImageCarousel.tsx b/web/sections/ImageCarousel/ImageCarousel.tsx index b1e5d76d9..12f9e2b57 100644 --- a/web/sections/ImageCarousel/ImageCarousel.tsx +++ b/web/sections/ImageCarousel/ImageCarousel.tsx @@ -1,6 +1,6 @@ import { Heading, Paragraph } from '@core/Typography' import envisTwMerge from '../../twMerge' -import { ImageCarouselData } from '../../types/types' +import { ImageCarouselData } from '../../types/index' import { BackgroundContainer } from '@components' import { Carousel } from '@core/Carousel/Carousel' import { forwardRef, useId } from 'react' diff --git a/web/sections/ImageForText/ImageForText.tsx b/web/sections/ImageForText/ImageForText.tsx index fefa3f5e9..3ac101c44 100644 --- a/web/sections/ImageForText/ImageForText.tsx +++ b/web/sections/ImageForText/ImageForText.tsx @@ -1,4 +1,4 @@ -import { ImageForTextData } from '../../types/types' +import { ImageForTextData } from '../../types/index' import { forwardRef } from 'react' import Image, { Ratios } from '../../pageComponents/shared/SanityImage' import Blocks from '../../pageComponents/shared/portableText/Blocks' diff --git a/web/sections/PromoTiles/PromoTile.tsx b/web/sections/PromoTiles/PromoTile.tsx index b2f846f76..586c50b67 100644 --- a/web/sections/PromoTiles/PromoTile.tsx +++ b/web/sections/PromoTiles/PromoTile.tsx @@ -3,7 +3,7 @@ import { getUrlFromAction } from '../../common/helpers' import { ColorKeyTokens, colorKeyToUtilityMap } from '../../styles/colorKeyToUtilityMap' import { BaseLinkProps } from '@core/Link' import { ArrowRight } from '../../icons' -import { PromoTileData } from '../../types/types' +import { PromoTileData } from '../../types/index' import { forwardRef } from 'react' export type FakeReadMoreProps = { diff --git a/web/sections/PromoTiles/PromoTileArray.tsx b/web/sections/PromoTiles/PromoTileArray.tsx index 9509a1795..6148bddcd 100644 --- a/web/sections/PromoTiles/PromoTileArray.tsx +++ b/web/sections/PromoTiles/PromoTileArray.tsx @@ -1,4 +1,4 @@ -import type { PromoTileArrayData, PromoTileData } from '../../types/types' +import type { PromoTileArrayData, PromoTileData } from '../../types/index' import { PromoTile } from './PromoTile' import { twMerge } from 'tailwind-merge' diff --git a/web/sections/VideoPlayerCarousel/VideoPlayerCarousel.tsx b/web/sections/VideoPlayerCarousel/VideoPlayerCarousel.tsx index 828d5c24d..deb3e0219 100644 --- a/web/sections/VideoPlayerCarousel/VideoPlayerCarousel.tsx +++ b/web/sections/VideoPlayerCarousel/VideoPlayerCarousel.tsx @@ -1,6 +1,6 @@ import { Heading, Paragraph } from '@core/Typography' import envisTwMerge from '../../twMerge' -import { VideoPlayerCarouselData } from '../../types/types' +import { VideoPlayerCarouselData } from '../../types/index' import { BackgroundContainer } from '@components' import { Carousel } from '@core/Carousel/Carousel' import { forwardRef, useId } from 'react' diff --git a/web/sections/cards/Card/Card.tsx b/web/sections/cards/Card/Card.tsx index b905833d9..7a82c8968 100644 --- a/web/sections/cards/Card/Card.tsx +++ b/web/sections/cards/Card/Card.tsx @@ -2,8 +2,8 @@ import { forwardRef, HTMLAttributes } from 'react' import { default as NextLink, LinkProps } from 'next/link' import { twMerge } from 'tailwind-merge' import Image, { Ratios } from '../../../pageComponents/shared/SanityImage' -import { ImageWithAlt } from '../../../types/types' import envisTwMerge from '../../../twMerge' +import { ImageWithAlt } from '../../../types/index' export type Variants = 'primary' | 'secondary' | 'compact' | 'single' export type CardProps = { 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 2f67e6aad..576bb0b5e 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/sections/cards/EventCard/EventCard.tsx b/web/sections/cards/EventCard/EventCard.tsx index e3ae730cc..1fb7e6919 100644 --- a/web/sections/cards/EventCard/EventCard.tsx +++ b/web/sections/cards/EventCard/EventCard.tsx @@ -1,5 +1,5 @@ import { Heading } from '@core/Typography' -import { EventCardData } from '../../../types/types' +import { EventCardData } from '../../../types/index' import { forwardRef, HTMLAttributes } from 'react' import { twMerge } from 'tailwind-merge' import { TimeIcon } from '@components/FormattedDateTime/shared' diff --git a/web/sections/cards/PeopleCard/PeopleCard.tsx b/web/sections/cards/PeopleCard/PeopleCard.tsx index 33b7d0c78..80f0f714e 100644 --- a/web/sections/cards/PeopleCard/PeopleCard.tsx +++ b/web/sections/cards/PeopleCard/PeopleCard.tsx @@ -5,7 +5,7 @@ import { BaseLink, ButtonLink } from '@core/Link' import Image, { Ratios } from '../../../pageComponents/shared/SanityImage' import { getLocaleFromName } from '../../../lib/localization' import { getUrlFromAction, urlFor } from '../../../common/helpers' -import { PeopleCardData } from '../../../types/types' +import { PeopleCardData } from '../../../types/index' import { SocialProfileJsonLd } from 'next-seo' export type PeopleCardProps = { diff --git a/web/sections/cards/PromotionCard/PromotionCard.tsx b/web/sections/cards/PromotionCard/PromotionCard.tsx index a72137205..81f93388f 100644 --- a/web/sections/cards/PromotionCard/PromotionCard.tsx +++ b/web/sections/cards/PromotionCard/PromotionCard.tsx @@ -2,7 +2,7 @@ import { useMediaQuery } from '../../../lib/hooks/useMediaQuery' import Card from '@sections/cards/Card' import { FormattedDate } from '@components/FormattedDateTime' import Blocks from '../../../pageComponents/shared/portableText/Blocks' -import type { CardData } from '../../../types/types' +import type { CardData } from '../../../types/index' import { forwardRef, HTMLAttributes } from 'react' import { twMerge } from 'tailwind-merge' diff --git a/web/types/algoliaIndexPage.ts b/web/types/algoliaIndexPage.ts index d1eb62f23..a1888315b 100644 --- a/web/types/algoliaIndexPage.ts +++ b/web/types/algoliaIndexPage.ts @@ -1,16 +1,15 @@ import { InstantSearchServerState } from 'react-instantsearch' import type { - MenuData, FooterColumns, IntlData, TeaserData, - SeoData, HeroType, ImageWithCaptionData, + SeoData, BackgroundColours, - CardData, LinkData, -} from './types' + MenuData, +} from './index' import { PortableTextBlock } from '@portabletext/types' import { SanityImageObject } from '@sanity/image-url/lib/types/types' diff --git a/web/types/cardTypes.ts b/web/types/cardTypes.ts new file mode 100644 index 000000000..9d02fce7a --- /dev/null +++ b/web/types/cardTypes.ts @@ -0,0 +1,69 @@ +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 + ingress?: PortableTextBlock[] +} + +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..f6600526c --- /dev/null +++ b/web/types/eventTypes.ts @@ -0,0 +1,16 @@ +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 + promoteSingleUpcomingEvent: boolean + pastEventsCount?: number + upcomingEventsCount?: number +} diff --git a/web/types/gridTypes.ts b/web/types/gridTypes.ts new file mode 100644 index 000000000..27c71e329 --- /dev/null +++ b/web/types/gridTypes.ts @@ -0,0 +1,75 @@ +import { + ImageWithAlt, + BackgroundColours, + LinkData, + FigureData, + IFrameData, + VideoPlayerData, + ImageBackground, +} 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 + useExtendedThemes?: boolean + content?: PortableTextBlock[] + themedContent?: PortableTextBlock[] + themeFromLarger?: any + 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 + +type GridTextBlockContentAlignment = 'left' | 'right' | 'center' | 'bottom-left' | 'bottom-center' + +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 + overline?: string + useThemedTitle?: boolean + title?: PortableTextBlock[] + themedTitle?: PortableTextBlock[] + content?: PortableTextBlock[] + contentAlignment?: GridTextBlockContentAlignment + contentTheme?: any + titleThemeFromLarger?: any + theme?: any + imageBackground?: ImageBackground +} diff --git a/web/types/imageTypes.ts b/web/types/imageTypes.ts new file mode 100644 index 000000000..29aa039fb --- /dev/null +++ b/web/types/imageTypes.ts @@ -0,0 +1,68 @@ +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[] + ingress?: PortableTextBlock[] + hideTitle?: boolean + items: ImageCarouselItem[] + options: { + autoplay: boolean + delay: number + } + designOptions: DesignOptions +} + +export type ImageCarouselItem = { + id: string +} & ImageWithCaptionData 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 89a646936..fe7f75b96 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,55 +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 - promoteSingleUpcomingEvent: boolean - pastEventsCount?: number - upcomingEventsCount?: number -} - -export type EventCardData = { - id: string - type: 'events' - title: PortableTextBlock[] - slug: string - location?: string - eventDate: EventDateType - ingress?: PortableTextBlock[] -} - -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 @@ -216,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 @@ -376,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 @@ -470,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 CookieType = 'none' | 'marketing' | 'statistics' | 'preferences' export type IFrameData = { @@ -623,26 +330,6 @@ export type SubscribeFormParameters = { categories: 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 @@ -700,90 +387,6 @@ export type AnchorLinkData = { anchorReference: string } -export enum VideoPlayerRatios { - '16:9' = '16:9', - '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 - transcript?: PortableTextBlock[] -} -export type VideoPlayerCarouselItem = { - id: string - video: VideoType - title?: PortableTextBlock[] - hideVideoTitle?: boolean - aspectRatio?: VideoPlayerRatios -} - -export type VideoPlayerCarouselData = { - id: string - type: string - items: VideoPlayerCarouselItem[] - designOptions: DesignOptions & { - aspectRatio: VideoPlayerRatios - } - title?: PortableTextBlock[] - ingress?: PortableTextBlock[] -} - -export type LoopingVideoRatio = '1:2' | 'narrow' - -export type LoopingVideoData = { - title: string - thumbnail: ImageWithAlt - url: string - ratio: LoopingVideoRatio -} -export type ImageCarouselItem = { - id: string -} & ImageWithCaptionData - -export type ImageCarouselData = { - type: 'imageCarousel' - id: string - title?: PortableTextBlock[] - ingress?: PortableTextBlock[] - hideTitle?: boolean - items: ImageCarouselItem[] - options: { - autoplay: boolean - delay: number - } - designOptions: DesignOptions -} - export type IFrameCarouselItemData = { id?: string type?: string @@ -829,86 +432,23 @@ 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[] -} -type GridTextBlockContentAlignment = 'left' | 'right' | 'center' | 'bottom-left' | 'bottom-center' - -export type GridTextBlockData = { - id: string - type: 'gridTextBlock' - action?: LinkData - overline?: string - useThemedTitle?: boolean - title?: PortableTextBlock[] - themedTitle?: PortableTextBlock[] - content?: PortableTextBlock[] - contentAlignment?: GridTextBlockContentAlignment - contentTheme?: any - titleThemeFromLarger?: any - theme?: any - imageBackground?: ImageBackground -} - export type CampaignBannerData = { type: 'campaignBanner' id: string title: PortableTextBlock[] designOptions: DesignOptions } -export type GridTeaserData = { - type: 'gridTeaser' + +export type PodcastTeaserData = { id: string + type: 'podcastTeaser' + spotifyLink?: string + appleLink?: string + linkTitle?: string + podcastName?: PortableTextBlock[] + podcastEpisode?: PortableTextBlock[] image: ImageWithAlt - rowType?: RowType - useExtendedThemes?: boolean - content?: PortableTextBlock[] - themedContent?: PortableTextBlock[] - themeFromLarger?: any - quote?: string - author?: string - authorTitle?: string - background?: BackgroundColours - imagePosition?: TeaserImagePosition - action?: LinkData - theme?: number + designOptions: DesignOptions } export type ImageForTextData = { type: 'imageForText' diff --git a/web/types/videoTypes.ts b/web/types/videoTypes.ts new file mode 100644 index 000000000..7b112e7c3 --- /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', + '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 + transcript?: PortableTextBlock[] +} + +export type VideoPlayerCarouselItem = { + id: string + video: VideoType + title?: PortableTextBlock[] + hideVideoTitle?: boolean + aspectRatio?: VideoPlayerRatios +} + +export type VideoPlayerCarouselData = { + id: string + type: string + items: VideoPlayerCarouselItem[] + designOptions: DesignOptions & { + aspectRatio: VideoPlayerRatios + } + title?: PortableTextBlock[] + ingress?: 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'