diff --git a/dotcom-rendering/package.json b/dotcom-rendering/package.json index 66b07752f7d..4d66c095252 100644 --- a/dotcom-rendering/package.json +++ b/dotcom-rendering/package.json @@ -41,7 +41,7 @@ "@guardian/bridget": "7.0.0", "@guardian/browserslist-config": "6.1.0", "@guardian/cdk": "50.13.0", - "@guardian/commercial": "22.1.0", + "@guardian/commercial": "22.3.0", "@guardian/core-web-vitals": "7.0.0", "@guardian/eslint-config": "7.0.1", "@guardian/eslint-config-typescript": "9.0.1", @@ -51,7 +51,7 @@ "@guardian/ophan-tracker-js": "2.2.5", "@guardian/shimport": "1.0.2", "@guardian/source": "8.0.0", - "@guardian/source-development-kitchen": "9.0.0", + "@guardian/source-development-kitchen": "11.0.0", "@guardian/support-dotcom-components": "2.9.1", "@guardian/tsconfig": "0.2.0", "@playwright/test": "1.45.3", diff --git a/dotcom-rendering/src/components/Card/Card.stories.tsx b/dotcom-rendering/src/components/Card/Card.stories.tsx index 39c97f8ea07..95479e56bde 100644 --- a/dotcom-rendering/src/components/Card/Card.stories.tsx +++ b/dotcom-rendering/src/components/Card/Card.stories.tsx @@ -1575,6 +1575,8 @@ export const WithALargeGap = () => { design: ArticleDesign.Comment, theme: Pillar.Opinion, }} + showTopBarDesktop={false} + showTopBarMobile={true} /> diff --git a/dotcom-rendering/src/components/Card/Card.tsx b/dotcom-rendering/src/components/Card/Card.tsx index 43a642eb08f..71b23cc5155 100644 --- a/dotcom-rendering/src/components/Card/Card.tsx +++ b/dotcom-rendering/src/components/Card/Card.tsx @@ -116,6 +116,8 @@ export type Props = { index?: number; /** The Splash card in a flexible container gets a different visual treatment to other cards*/ isFlexSplash?: boolean; + showTopBarDesktop?: boolean; + showTopBarMobile?: boolean; }; const starWrapper = (cardHasImage: boolean) => css` @@ -268,6 +270,8 @@ export const Card = ({ boostedFontSizes, index = 0, isFlexSplash, + showTopBarDesktop = true, + showTopBarMobile = false, }: Props) => { const hasSublinks = supportingContent && supportingContent.length > 0; const sublinkPosition = decideSublinkPosition( @@ -454,8 +458,8 @@ export const Card = ({ return ( @@ -759,8 +763,7 @@ export const Card = ({ )} {sublinkPosition === 'outer' && supportingContentAlignment === 'horizontal' && - (imagePositionOnDesktop === 'right' || - imagePositionOnDesktop === 'left') && ( + imagePositionOnDesktop === 'right' && ( )} diff --git a/dotcom-rendering/src/components/Card/components/CardWrapper.tsx b/dotcom-rendering/src/components/Card/components/CardWrapper.tsx index 665dc36601a..5a5653df200 100644 --- a/dotcom-rendering/src/components/Card/components/CardWrapper.tsx +++ b/dotcom-rendering/src/components/Card/components/CardWrapper.tsx @@ -14,8 +14,8 @@ type Props = { children: React.ReactNode; format: ArticleFormat; containerPalette?: DCRContainerPalette; - showTopBar?: boolean; - showMobileTopBar?: boolean; + showTopBarDesktop?: boolean; + showTopBarMobile?: boolean; isOnwardContent?: boolean; }; @@ -70,7 +70,7 @@ const sublinkHoverStyles = css` } `; -const topBarStyles = css` +const desktopTopBarStyles = css` :before { border-top: 1px solid ${palette('--card-border-top')}; content: ''; @@ -83,7 +83,7 @@ const topBarStyles = css` const mobileTopBarStyles = css` ${until.tablet} { - ${topBarStyles} + ${desktopTopBarStyles} } `; @@ -100,8 +100,8 @@ export const CardWrapper = ({ children, format, containerPalette, - showTopBar = true, - showMobileTopBar = false, + showTopBarDesktop = true, + showTopBarMobile = false, isOnwardContent = false, }: Props) => { return ( @@ -112,8 +112,8 @@ export const CardWrapper = ({ baseCardStyles, hoverStyles, sublinkHoverStyles, - showTopBar && topBarStyles, - showMobileTopBar && mobileTopBarStyles, + showTopBarDesktop && desktopTopBarStyles, + showTopBarMobile && mobileTopBarStyles, isOnwardContent && onwardContentStyles, ]} > diff --git a/dotcom-rendering/src/components/Carousel.importable.tsx b/dotcom-rendering/src/components/Carousel.importable.tsx index 76546c68d17..39a09094393 100644 --- a/dotcom-rendering/src/components/Carousel.importable.tsx +++ b/dotcom-rendering/src/components/Carousel.importable.tsx @@ -540,6 +540,8 @@ const CarouselCard = ({ absoluteServerTimes={absoluteServerTimes} starRating={starRating} index={index} + showTopBarDesktop={!isOnwardContent} + showTopBarMobile={false} /> ); diff --git a/dotcom-rendering/src/components/FlexibleGeneral.tsx b/dotcom-rendering/src/components/FlexibleGeneral.tsx index 92dc1b4209c..c757ebe77bc 100644 --- a/dotcom-rendering/src/components/FlexibleGeneral.tsx +++ b/dotcom-rendering/src/components/FlexibleGeneral.tsx @@ -70,6 +70,7 @@ type BoostedSplashProperties = { headlineSizeOnTablet: SmallHeadlineSize; imagePositionOnDesktop: ImagePositionType; imagePositionOnMobile: ImagePositionType; + imageSize: ImageSizeType; supportingContentAlignment: Alignment; }; @@ -89,6 +90,7 @@ const decideSplashCardProperties = ( headlineSizeOnTablet: 'tiny', imagePositionOnDesktop: 'right', imagePositionOnMobile: 'bottom', + imageSize: 'large', supportingContentAlignment: supportingContentLength >= 4 ? 'horizontal' : 'vertical', }; @@ -99,6 +101,7 @@ const decideSplashCardProperties = ( headlineSizeOnTablet: 'small', imagePositionOnDesktop: 'right', imagePositionOnMobile: 'bottom', + imageSize: 'jumbo', supportingContentAlignment: supportingContentLength >= 4 ? 'horizontal' : 'vertical', }; @@ -109,6 +112,7 @@ const decideSplashCardProperties = ( headlineSizeOnTablet: 'medium', imagePositionOnDesktop: 'bottom', imagePositionOnMobile: 'bottom', + imageSize: 'jumbo', supportingContentAlignment: 'horizontal', }; case 'gigaboost': @@ -118,6 +122,7 @@ const decideSplashCardProperties = ( headlineSizeOnTablet: 'medium', imagePositionOnDesktop: 'bottom', imagePositionOnMobile: 'bottom', + imageSize: 'jumbo', supportingContentAlignment: 'horizontal', }; } @@ -145,6 +150,7 @@ export const SplashCardLayout = ({ headlineSizeOnTablet, imagePositionOnDesktop, imagePositionOnMobile, + imageSize, supportingContentAlignment, } = decideSplashCardProperties( card.boostLevel ?? 'default', @@ -165,7 +171,7 @@ export const SplashCardLayout = ({ headlineSizeOnTablet={headlineSizeOnTablet} imagePositionOnDesktop={imagePositionOnDesktop} imagePositionOnMobile={imagePositionOnMobile} - imageSize="jumbo" + imageSize={imageSize} trailText={card.trailText} supportingContent={card.supportingContent} supportingContentAlignment={supportingContentAlignment} @@ -175,6 +181,8 @@ export const SplashCardLayout = ({ showLivePlayable={card.showLivePlayable} boostedFontSizes={true} isFlexSplash={true} + showTopBarDesktop={false} + showTopBarMobile={true} /> @@ -236,7 +244,7 @@ export const BoostedCardLayout = ({ imageSize, } = decideCardProperties(card.boostLevel); return ( -