Merged in chore/BOOK-708-replace-title-component (pull request #3414)
Chore/BOOK-708 replace title component * chore(BOOK-708): replace title with typography * chore(BOOK-708): replace title with typography * chore(BOOK-708): remove Title from package.json Approved-by: Linus Flood Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
import Title, { type HeadingProps } from "@scandic-hotels/design-system/Title"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import SectionLink from "../Link"
|
||||
|
||||
import styles from "./header.module.css"
|
||||
|
||||
type HeaderProps = {
|
||||
link?: {
|
||||
href: string
|
||||
text: string
|
||||
}
|
||||
preamble?: string | null
|
||||
textTransform?: HeadingProps["textTransform"]
|
||||
title?: string | null
|
||||
headingLevel?: HeadingProps["level"]
|
||||
headingAs?: HeadingProps["as"]
|
||||
}
|
||||
/**
|
||||
* @deprecated Use `@/components/Section/Header` instead.
|
||||
*/
|
||||
export default function SectionHeader({
|
||||
link,
|
||||
preamble,
|
||||
title,
|
||||
textTransform,
|
||||
headingAs = "h4",
|
||||
headingLevel = "h2",
|
||||
}: HeaderProps) {
|
||||
if (!title && !preamble && !link) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<header className={styles.header}>
|
||||
<Title
|
||||
as={headingAs}
|
||||
className={styles.title}
|
||||
level={headingLevel}
|
||||
textTransform={textTransform}
|
||||
>
|
||||
{title}
|
||||
</Title>
|
||||
{preamble && (
|
||||
<Typography variant="Body/Lead text" className={styles.preamble}>
|
||||
<p>{preamble}</p>
|
||||
</Typography>
|
||||
)}
|
||||
<SectionLink link={link} variant="desktop" />
|
||||
</header>
|
||||
)
|
||||
}
|
||||
@@ -11,9 +11,8 @@ import styles from "./header.module.css"
|
||||
import type { HTMLAttributes } from "react"
|
||||
|
||||
interface SectionHeaderProps
|
||||
extends HTMLAttributes<HTMLElement>,
|
||||
VariantProps<typeof headingVariants> {
|
||||
heading?: string
|
||||
extends HTMLAttributes<HTMLElement>, VariantProps<typeof headingVariants> {
|
||||
heading?: string | null
|
||||
headingLevel?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6"
|
||||
preamble?: string | null
|
||||
link?: {
|
||||
|
||||
Reference in New Issue
Block a user