Skip to content

Commit

Permalink
FullPageWizard components & cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrikMatiasko committed Apr 4, 2024
1 parent 56e2326 commit c7bb826
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/components/Atomic/_theme/siemens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,12 @@ const theme = {
description: {
color: colorsSiemens.neutral500,
},
groupHeadline: {
color: colorsSiemens.primary,
},
headline: {
color: colorsSiemens.primary,
},
leftCol: {
background: colorsSiemens.neutral900,
},
Expand Down
6 changes: 6 additions & 0 deletions src/components/Atomic/_theme/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,12 @@ export const getThemeTemplate = (colors: any, logoProps: LogoType) => ({
description: {
color: colors.neutral900,
},
groupHeadline: {
color: colors.primaryDarken,
},
headline: {
color: colors.primaryDarken,
},
leftCol: {
background: colors.light,
},
Expand Down
22 changes: 22 additions & 0 deletions src/components/Templates/FullPageWizard/Components.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,25 @@ export const subHeadline = (theme: ThemeType) => css`
export const noBorder = css`
border-top: none;
`

export const headline = (theme: ThemeType) => css`
font-family: ${get(theme, `Global.fontSecondary`)};
color: ${getTheme(theme, `FullPageWizard.headline.color`)};
font-size: 48px;
font-style: normal;
font-weight: 700;
line-height: 54px;
letter-spacing: -1.5px;
margin: 0 0 24px 0;
`

export const groupHeadline = (theme: ThemeType) => css`
font-family: ${get(theme, `Global.fontSecondary`)};
color: ${getTheme(theme, `FullPageWizard.groupHeadline.color`)};
font-size: 16px;
font-style: normal;
font-weight: 700;
line-height: 150%;
letter-spacing: -0.5px;
margin: 32px 0 16px 0;
`
13 changes: 13 additions & 0 deletions src/components/Templates/FullPageWizard/Components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ export type SubHeadlineProps = {
noBorder?: boolean
}

export type HeadlineProps = {
children: string
}

export type GroupHeadlineProps = {
children: string
noBorder?: boolean
}

export const Description: FC<DescriptionProps> = (props) => <p css={[styles.description, props.large && styles.descriptionLarge]}>{props.children}</p>

export const SubHeadline: FC<SubHeadlineProps> = (props) => <h2 css={[styles.subHeadline, props.noBorder && styles.noBorder]}>{props.children}</h2>

export const Headline: FC<HeadlineProps> = (props) => <h1 css={[styles.headline]}>{props.children}</h1>

export const GroupHeadline: FC<GroupHeadlineProps> = (props) => <h3 css={[styles.groupHeadline]}>{props.children}</h3>
4 changes: 3 additions & 1 deletion src/components/Templates/FullPageWizard/FullPageWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import IconDone from './assets/IconDone'
import IconCloseCircle from '../../Atomic/Icon/components/IconCloseCircle'
import { convertSize } from '../../Atomic'
import { ComponentType, Props } from './FullPageWizard.types'
import { Description, SubHeadline } from './Components'
import { Description, SubHeadline, Headline, GroupHeadline } from './Components'

const FullPageWizard: ComponentType<Props> = (props) => {
const { children, title, i18n, steps, activeStep, onStepChange, onClose, visitedStep } = props
Expand Down Expand Up @@ -79,5 +79,7 @@ const FullPageWizard: ComponentType<Props> = (props) => {
FullPageWizard.displayName = 'FullPageWizard'
FullPageWizard.Description = Description
FullPageWizard.SubHeadline = SubHeadline
FullPageWizard.Headline = Headline
FullPageWizard.GroupHeadline = GroupHeadline

export default FullPageWizard
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { FC, ReactNode } from 'react'
import { DescriptionProps, SubHeadlineProps } from './Components'
import { DescriptionProps, HeadlineProps, SubHeadlineProps, GroupHeadlineProps } from './Components'

export interface ComponentType<P> extends FC<P> {
Description: FC<DescriptionProps>
Headline: FC<HeadlineProps>
SubHeadline: FC<SubHeadlineProps>
GroupHeadline: FC<GroupHeadlineProps>
}

export type Props = {
Expand Down

0 comments on commit c7bb826

Please sign in to comment.