-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(PPDSC-2299): newskit new homepage hero section (#329)
* docs(PPDSC-2299): newskit new homepage hero section * docs(PPDSC-2299): update background image rules * docs(PPDSC-2299): revert typography presets changes * docs(PPDSC-2299): fixed background and reorganise files * docs(PPDSC-2299): improve CTA buttons * docs(PPDSC-2299): hero background updates * docs(PPDSC-2299): update grid illustration * docs(PPDSC-2299): address comments * docs(PPDSC-2299): update grid structure * docs(PPDSC-2299): update maxWidth * docs(PPDSC-2299): update grid containers * docs(PPDSC-2299): remove unused `themeMode`
- Loading branch information
Showing
7 changed files
with
199 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
import * as React from 'react'; | ||
import {GridLayoutItem, TextBlock, GridLayout, Visible, Button} from 'newskit'; | ||
import LinkNext from 'next/link'; | ||
import HeroGrid from '../../illustrations/landing-page/hero-grid'; | ||
import {HeroProps} from './types'; | ||
import {HeroContainer} from './styled'; | ||
|
||
const DESIGN_BUTTON_PROPS = { | ||
href: '/getting-started/design/design-overview', | ||
overrides: {stylePreset: 'buttonSolidPrimary'}, | ||
}; | ||
const DEVELOPING_BUTTON_PROPS = { | ||
href: '/getting-started/code/engineering-quickstart', | ||
overrides: {stylePreset: 'buttonOutlinedPrimary'}, | ||
}; | ||
|
||
export const Hero = ({contentContainerOverrides}: HeroProps) => ( | ||
<HeroContainer | ||
paddingBlock={{xs: 'space020', lg: 'space100'}} | ||
marginBlockStart="-12px" | ||
> | ||
<GridLayout overrides={contentContainerOverrides}> | ||
<GridLayout | ||
columns="1fr minmax(min-content, 530px)" | ||
overrides={{marginBlock: {xs: 'space070', lg: 'space000'}}} | ||
alignItems="center" | ||
> | ||
<GridLayoutItem | ||
paddingBlock={{ | ||
xs: 'space000', | ||
md: 'space110', | ||
}} | ||
column={{ | ||
xs: `1 / span 2`, | ||
lg: `1 / span 1`, | ||
}} | ||
> | ||
<TextBlock | ||
as="h1" | ||
stylePreset="inkBase" | ||
paddingInlineEnd={{ | ||
xs: 'space120', | ||
sm: 'space100', | ||
}} | ||
typographyPreset={{ | ||
xs: 'editorialHeadline070', | ||
md: 'editorialHeadline080', | ||
lg: 'editorialDisplay020', | ||
}} | ||
> | ||
Say hello to NewsKit | ||
</TextBlock> | ||
<TextBlock | ||
marginBlockStart={{xs: 'space060', lg: 'space080'}} | ||
stylePreset="inkBase" | ||
typographyPreset="editorialSubheadline020" | ||
paddingInlineEnd={{ | ||
xs: 'space090', | ||
md: 'space080', | ||
lg: 'space100', | ||
xl: 'space080', | ||
}} | ||
> | ||
An open source design system built by News UK, for everyone | ||
</TextBlock> | ||
<GridLayout | ||
justifyContent="start" | ||
columns="repeat(2, auto)" | ||
columnGap="space030" | ||
overrides={{ | ||
marginBlockStart: 'space090', | ||
}} | ||
> | ||
<GridLayoutItem> | ||
<LinkNext href="/getting-started/design/design-overview" passHref> | ||
<> | ||
<Visible xs sm> | ||
<Button {...DESIGN_BUTTON_PROPS}>Designing</Button> | ||
</Visible> | ||
<Visible md lg xl> | ||
<Button {...DESIGN_BUTTON_PROPS}>Start designing</Button> | ||
</Visible> | ||
</> | ||
</LinkNext> | ||
</GridLayoutItem> | ||
<GridLayoutItem> | ||
<LinkNext | ||
href="/getting-started/code/engineering-quickstart" | ||
passHref | ||
> | ||
<> | ||
<Visible xs sm> | ||
<Button {...DEVELOPING_BUTTON_PROPS}>Developing</Button> | ||
</Visible> | ||
<Visible md lg xl> | ||
<Button {...DEVELOPING_BUTTON_PROPS}> | ||
Start developing | ||
</Button> | ||
</Visible> | ||
</> | ||
</LinkNext> | ||
</GridLayoutItem> | ||
</GridLayout> | ||
</GridLayoutItem> | ||
<GridLayoutItem> | ||
<Visible xl lg> | ||
<HeroGrid /> | ||
</Visible> | ||
</GridLayoutItem> | ||
</GridLayout> | ||
</GridLayout> | ||
</HeroContainer> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './hero'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {getMediaQueryFromTheme, styled, Block} from 'newskit*'; | ||
|
||
export const HeroContainer = styled(Block)` | ||
background-size: cover; | ||
background-repeat: no-repeat; | ||
${getMediaQueryFromTheme('md')} { | ||
${({theme}) => { | ||
const heroGradientBackground = theme.colors.interfaceSkeleton010; | ||
const heroGradientColor = theme.colors.interfaceBrand030; | ||
return `background-image: radial-gradient( | ||
circle at -120% 160%, | ||
${heroGradientColor} 0%, | ||
${heroGradientBackground}00 70% | ||
), | ||
radial-gradient( | ||
circle at 180% -70%, | ||
${heroGradientColor} 0%, | ||
${heroGradientBackground} 60% | ||
);`; | ||
}}; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {GridLayoutProps} from '../../../../src/grid-layout/types'; | ||
|
||
export interface HeroProps { | ||
contentContainerOverrides: GridLayoutProps['overrides']; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './hero'; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters