feat(WEB-250): overview hero final ui

This commit is contained in:
Simon Emanuelsson
2024-05-24 10:13:24 +02:00
parent f884383c3c
commit 16b817f469
164 changed files with 6262 additions and 990 deletions
@@ -0,0 +1,25 @@
import { headingVariants } from "./variants"
import type { HeadingProps } from "./title"
export default function Title({
as,
children,
className = "",
color,
hideEmpty = true,
level = "h1",
textTransform,
}: HeadingProps) {
if (hideEmpty && !children) {
return null
}
const Hx = level
const classNames = headingVariants({
className,
color,
textTransform,
type: as ?? level,
})
return <Hx className={classNames}>{children}</Hx>
}
@@ -0,0 +1,104 @@
.heading {
margin: 0;
padding: 0;
}
.regular {
text-transform: none;
}
.uppercase {
text-transform: uppercase;
}
.h1 {
font-family: var(--typography-Title-1-fontFamily);
font-size: var(--typography-Title-1-Mobile-fontSize);
font-weight: var(--typography-Title-1-fontWeight);
letter-spacing: var(--typography-Title-1-letterSpacing);
line-height: var(--typography-Title-1-lineHeight);
}
.h2 {
font-family: var(--typography-Title-2-fontFamily);
font-size: var(--typography-Title-2-Mobile-fontSize);
font-weight: var(--typography-Title-2-fontWeight);
letter-spacing: var(--typography-Title-2-letterSpacing);
line-height: var(--typography-Title-2-lineHeight);
}
.h3 {
font-family: var(--typography-Title-3-fontFamily);
font-size: var(--typography-Title-3-Mobile-fontSize);
font-weight: var(--typography-Title-3-fontWeight);
letter-spacing: var(--typography-Title-3-letterSpacing);
line-height: var(--typography-Title-3-lineHeight);
}
.h4 {
font-family: var(--typography-Title-4-fontFamily);
font-size: var(--typography-Title-4-Mobile-fontSize);
font-weight: var(--typography-Title-4-fontWeight);
letter-spacing: var(--typography-Title-4-letterSpacing);
line-height: var(--typography-Title-4-lineHeight);
}
.h5 {
font-family: var(--typography-Title-5-fontFamily);
font-size: var(--typography-Title-5-Mobile-fontSize);
font-weight: var(--typography-Title-5-fontWeight);
letter-spacing: var(--typography-Title-5-letterSpacing);
line-height: var(--typography-Title-5-lineHeight);
}
@media screen and (min-width: 768px) {
.h1 {
font-size: var(--typography-Title-1-Tablet-estimate-fontSize);
}
.h2 {
font-size: var(--typography-Title-2-Tablet-estimate-fontSize);
}
.h3 {
font-size: var(--typography-Title-3-Tablet-estimate-fontSize);
}
.h4 {
font-size: var(--typography-Title-4-Tablet-estimate-fontSize);
}
.h5 {
font-size: var(--typography-Title-5-Tablet-estimate-fontSize);
}
}
@media screen and (min-width: 1367px) {
.h1 {
font-size: var(--typography-Title-1-Desktop-fontSize);
}
.h2 {
font-size: var(--typography-Title-2-Desktop-fontSize);
}
.h3 {
font-size: var(--typography-Title-3-Desktop-fontSize);
}
.h4 {
font-size: var(--typography-Title-4-Desktop-fontSize);
}
.h5 {
font-size: var(--typography-Title-5-Desktop-fontSize);
}
}
.burgundy {
color: var(--Scandic-Brand-Burgundy);
}
.pale {
color: var(--Scandic-Brand-Pale-Peach);
}
@@ -0,0 +1,13 @@
import { headingVariants } from "./variants"
import type { VariantProps } from "class-variance-authority"
type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6"
export interface HeadingProps
extends Omit<React.HTMLAttributes<HTMLHeadingElement>, "color">,
VariantProps<typeof headingVariants> {
as?: HeadingLevel
hideEmpty?: boolean
level?: HeadingLevel
}
@@ -0,0 +1,31 @@
import { cva } from "class-variance-authority"
import styles from "./title.module.css"
const config = {
variants: {
color: {
burgundy: styles.burgundy,
pale: styles.pale,
},
textTransform: {
regular: styles.regular,
uppercase: styles.uppercase,
},
type: {
h1: styles.h1,
h2: styles.h2,
h3: styles.h3,
h4: styles.h4,
h5: styles.h5,
h6: styles.h6,
},
},
defaultVariants: {
color: "burgundy",
textTransform: "uppercase",
type: "h1",
},
} as const
export const headingVariants = cva(styles.heading, config)