diff --git a/apps/scandic-web/components/Blocks/DynamicContent/SAS/TransferPoints/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/SAS/TransferPoints/index.tsx
index c392683a4..ae3ce9807 100644
--- a/apps/scandic-web/components/Blocks/DynamicContent/SAS/TransferPoints/index.tsx
+++ b/apps/scandic-web/components/Blocks/DynamicContent/SAS/TransferPoints/index.tsx
@@ -2,8 +2,8 @@ import { Suspense } from "react"
import { env } from "@/env/server"
-import SectionContainer from "@/components/Section/Container"
-import SectionHeader from "@/components/Section/Header"
+import { Section } from "@/components/Section"
+import SectionHeader from "@/components/Section/Header/Deprecated"
import SectionLink from "@/components/Section/Link"
import { getLang } from "@/i18n/serverContext"
@@ -30,12 +30,12 @@ export default async function SASTransferPoints({
const lang = await getLang()
return (
-
+
+
)
}
diff --git a/apps/scandic-web/components/Blocks/DynamicContent/SectionWrapper/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/SectionWrapper/index.tsx
index 6a0a96f6a..531f3033b 100644
--- a/apps/scandic-web/components/Blocks/DynamicContent/SectionWrapper/index.tsx
+++ b/apps/scandic-web/components/Blocks/DynamicContent/SectionWrapper/index.tsx
@@ -1,5 +1,5 @@
-import SectionContainer from "@/components/Section/Container"
-import SectionHeader from "@/components/Section/Header"
+import { Section } from "@/components/Section"
+import SectionHeader from "@/components/Section/Header/Deprecated"
import SectionLink from "@/components/Section/Link"
import type { DynamicContentProps } from "@/types/components/blocks/dynamicContent"
@@ -14,7 +14,7 @@ export default function SectionWrapper({
dynamic_content.title
)
return (
-
+
{displayHeader ? (
) : null}
-
+
)
}
diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Previous/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Previous/index.tsx
index 97febbfe6..7ad8a8100 100644
--- a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Previous/index.tsx
+++ b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Previous/index.tsx
@@ -1,8 +1,8 @@
import { serverClient } from "@/lib/trpc/server"
import ClaimPoints from "@/components/Blocks/DynamicContent/Points/ClaimPoints"
-import SectionContainer from "@/components/Section/Container"
-import SectionHeader from "@/components/Section/Header"
+import { Section } from "@/components/Section"
+import SectionHeader from "@/components/Section/Header/Deprecated"
import SectionLink from "@/components/Section/Link"
import ClientPreviousStays from "./Client"
@@ -25,7 +25,7 @@ export default async function PreviousStays({
}
return (
-
+
@@ -33,6 +33,6 @@ export default async function PreviousStays({
-
+
)
}
diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Upcoming/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Upcoming/index.tsx
index 3186b07af..d96e04f78 100644
--- a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Upcoming/index.tsx
+++ b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Upcoming/index.tsx
@@ -1,7 +1,7 @@
import { serverClient } from "@/lib/trpc/server"
-import SectionContainer from "@/components/Section/Container"
-import SectionHeader from "@/components/Section/Header"
+import { Section } from "@/components/Section"
+import SectionHeader from "@/components/Section/Header/Deprecated"
import SectionLink from "@/components/Section/Link"
import EmptyUpcomingStaysBlock from "../EmptyUpcomingStays"
@@ -21,7 +21,7 @@ export default async function UpcomingStays({
})
return (
-
+
{initialUpcomingStays?.data.length ? (
@@ -29,6 +29,6 @@ export default async function UpcomingStays({
)}
-
+
)
}
diff --git a/apps/scandic-web/components/Blocks/HotelListing/index.tsx b/apps/scandic-web/components/Blocks/HotelListing/index.tsx
index 89a39fe4c..0d258596c 100644
--- a/apps/scandic-web/components/Blocks/HotelListing/index.tsx
+++ b/apps/scandic-web/components/Blocks/HotelListing/index.tsx
@@ -2,7 +2,7 @@ import { Typography } from "@scandic-hotels/design-system/Typography"
import { getHotelsByCSFilter } from "@/lib/trpc/memoizedRequests"
-import SectionContainer from "@/components/Section/Container"
+import { Section } from "@/components/Section"
import HotelListingItem from "./HotelListingItem"
@@ -26,7 +26,7 @@ export default async function HotelListing({
}
return (
-
+
{heading}
@@ -37,6 +37,6 @@ export default async function HotelListing({
contentType={contentType}
/>
))}
-
+
)
}
diff --git a/apps/scandic-web/components/Blocks/ShortcutsList/index.tsx b/apps/scandic-web/components/Blocks/ShortcutsList/index.tsx
index 29c067c7e..0ae1c3902 100644
--- a/apps/scandic-web/components/Blocks/ShortcutsList/index.tsx
+++ b/apps/scandic-web/components/Blocks/ShortcutsList/index.tsx
@@ -1,5 +1,5 @@
-import SectionContainer from "@/components/Section/Container"
-import SectionHeader from "@/components/Section/Header"
+import { Section } from "@/components/Section"
+import SectionHeader from "@/components/Section/Header/Deprecated"
import ShortcutsListItems from "./ShortcutsListItems"
@@ -34,7 +34,7 @@ export default function ShortcutsList({
]
return (
-
+
-
+
)
}
diff --git a/apps/scandic-web/components/Blocks/Table/index.tsx b/apps/scandic-web/components/Blocks/Table/index.tsx
index 60f868d7f..a166c125d 100644
--- a/apps/scandic-web/components/Blocks/Table/index.tsx
+++ b/apps/scandic-web/components/Blocks/Table/index.tsx
@@ -10,8 +10,8 @@ import { useState } from "react"
import Table from "@scandic-hotels/design-system/Table"
-import SectionContainer from "@/components/Section/Container"
-import SectionHeader from "@/components/Section/Header"
+import { Section } from "@/components/Section"
+import SectionHeader from "@/components/Section/Header/Deprecated"
import ShowMoreButton from "@/components/TempDesignSystem/ShowMoreButton"
import styles from "./table.module.css"
@@ -53,7 +53,7 @@ export default function TableBlock({ data }: TableBlockProps) {
}
return (
-
+
+
)
}
diff --git a/apps/scandic-web/components/ContentType/HotelPage/Rooms/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/Rooms/index.tsx
index 6abbda160..1c695bf80 100644
--- a/apps/scandic-web/components/ContentType/HotelPage/Rooms/index.tsx
+++ b/apps/scandic-web/components/ContentType/HotelPage/Rooms/index.tsx
@@ -5,7 +5,7 @@ import { useMemo, useRef, useState } from "react"
import { Typography } from "@scandic-hotels/design-system/Typography"
-import SectionContainer from "@/components/Section/Container"
+import { Section } from "@/components/Section"
import ShowMoreButton from "@/components/TempDesignSystem/ShowMoreButton"
import { RoomCard } from "./RoomCard"
@@ -32,10 +32,7 @@ export function Rooms({ heading, rooms, preamble }: RoomsProps) {
}
return (
-
+
@@ -65,6 +62,6 @@ export function Rooms({ heading, rooms, preamble }: RoomsProps) {
showLess={allRoomsVisible}
/>
) : null}
-
+
)
}
diff --git a/apps/scandic-web/components/SasTierComparison/index.tsx b/apps/scandic-web/components/SasTierComparison/index.tsx
index cb6a5abe5..b5dab72ca 100644
--- a/apps/scandic-web/components/SasTierComparison/index.tsx
+++ b/apps/scandic-web/components/SasTierComparison/index.tsx
@@ -10,7 +10,7 @@ import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton
import Subtitle from "@scandic-hotels/design-system/Subtitle"
import Title from "@scandic-hotels/design-system/Title"
-import SectionContainer from "../Section/Container"
+import { Section } from "@/components/Section"
import styles from "./sasTierComparison.module.css"
@@ -30,7 +30,7 @@ export function SasTierComparison({
tierComparison,
}: TierComparisonProps) {
return (
-
+
{title}
@@ -77,7 +77,7 @@ export function SasTierComparison({
)}
-
+
)
}
diff --git a/apps/scandic-web/components/Section/Container/container.module.css b/apps/scandic-web/components/Section/Container/container.module.css
deleted file mode 100644
index 54bbc26fd..000000000
--- a/apps/scandic-web/components/Section/Container/container.module.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.container {
- display: grid;
- gap: var(--Spacing-x3);
- z-index: 0;
-}
diff --git a/apps/scandic-web/components/Section/Container/index.tsx b/apps/scandic-web/components/Section/Container/index.tsx
deleted file mode 100644
index 9ea61c26b..000000000
--- a/apps/scandic-web/components/Section/Container/index.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import styles from "./container.module.css"
-
-export default function SectionContainer({
- children,
- className = "",
- ...props
-}: React.HTMLAttributes) {
- return (
-
- )
-}
diff --git a/apps/scandic-web/components/Section/Header/Deprecated.tsx b/apps/scandic-web/components/Section/Header/Deprecated.tsx
new file mode 100644
index 000000000..86d7b532d
--- /dev/null
+++ b/apps/scandic-web/components/Section/Header/Deprecated.tsx
@@ -0,0 +1,48 @@
+import Preamble from "@scandic-hotels/design-system/Preamble"
+import Title, { type HeadingProps } from "@scandic-hotels/design-system/Title"
+
+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 (
+
+
+ {title}
+
+ {preamble && {preamble}}
+
+
+ )
+}
diff --git a/apps/scandic-web/components/Section/Header/header.module.css b/apps/scandic-web/components/Section/Header/header.module.css
index 5fe35771d..8838a98db 100644
--- a/apps/scandic-web/components/Section/Header/header.module.css
+++ b/apps/scandic-web/components/Section/Header/header.module.css
@@ -1,11 +1,15 @@
.header {
display: grid;
- gap: var(--Spacing-x1) var(--Spacing-x5);
+ gap: var(--Space-x1) var(--Space-x5);
grid-template-columns: 1fr;
align-items: baseline;
}
-.title,
+.heading {
+ color: var(--Text-Heading);
+}
+
+.heading,
.preamble {
grid-column: 1 / -1;
max-width: var(--max-width-text-block);
@@ -16,7 +20,7 @@
grid-template-columns: 1fr auto;
}
- .title {
+ .heading {
grid-column: 1 / 2;
}
diff --git a/apps/scandic-web/components/Section/Header/headingVariants.ts b/apps/scandic-web/components/Section/Header/headingVariants.ts
new file mode 100644
index 000000000..8f7830fab
--- /dev/null
+++ b/apps/scandic-web/components/Section/Header/headingVariants.ts
@@ -0,0 +1,7 @@
+import { cva } from "class-variance-authority"
+
+import { withTypography } from "@scandic-hotels/design-system/Typography"
+
+import styles from "./header.module.css"
+
+export const headingVariants = cva(styles.heading, withTypography({}))
diff --git a/apps/scandic-web/components/Section/Header/index.tsx b/apps/scandic-web/components/Section/Header/index.tsx
index 00f5098ff..9e009163f 100644
--- a/apps/scandic-web/components/Section/Header/index.tsx
+++ b/apps/scandic-web/components/Section/Header/index.tsx
@@ -1,46 +1,54 @@
-import Preamble from "@scandic-hotels/design-system/Preamble"
-import Title, { type HeadingProps } from "@scandic-hotels/design-system/Title"
+import { cx, type VariantProps } from "class-variance-authority"
+
+import { Typography } from "@scandic-hotels/design-system/Typography"
+
+import { headingVariants } from "@/components/Section/Header/headingVariants"
import SectionLink from "../Link"
import styles from "./header.module.css"
-type HeaderProps = {
+import type { HTMLAttributes } from "react"
+
+interface SectionHeaderProps
+ extends HTMLAttributes,
+ VariantProps {
+ heading?: string
+ headingLevel?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6"
+ preamble?: string
link?: {
href: string
text: string
}
- preamble?: string | null
- textTransform?: HeadingProps["textTransform"]
- title?: string | null
- headingLevel?: HeadingProps["level"]
- headingAs?: HeadingProps["as"]
}
-export default function SectionHeader({
- link,
+export function SectionHeader({
+ className,
+ heading,
preamble,
- title,
- textTransform,
- headingAs = "h4",
+ link,
+ typography = "Title/sm",
headingLevel = "h2",
-}: HeaderProps) {
- if (!title && !preamble && !link) {
+ ...props
+}: SectionHeaderProps) {
+ if (!heading && !preamble && !link) {
return null
}
+ const headingClassNames = headingVariants({ typography })
+ const Hx = headingLevel
return (
-
-
- {title}
-
- {preamble && {preamble}}
-
+
+ {heading}
+ {preamble ? (
+
+ {preamble}
+
+ ) : null}
+ {link ? : null}
)
}
diff --git a/apps/scandic-web/components/Section/Link/index.tsx b/apps/scandic-web/components/Section/Link/index.tsx
index f293fa707..4719cc731 100644
--- a/apps/scandic-web/components/Section/Link/index.tsx
+++ b/apps/scandic-web/components/Section/Link/index.tsx
@@ -5,7 +5,13 @@ import { linkVariants } from "./variants"
import styles from "./link.module.css"
-import type { SectionLinkProps } from "./link"
+import type { VariantProps } from "class-variance-authority"
+
+interface SectionLinkProps
+ extends React.PropsWithChildren>,
+ VariantProps {
+ link?: { href: string; text: string }
+}
export default function SectionLink({ link, variant }: SectionLinkProps) {
if (!link) {
diff --git a/apps/scandic-web/components/Section/index.tsx b/apps/scandic-web/components/Section/index.tsx
new file mode 100644
index 000000000..2531c040b
--- /dev/null
+++ b/apps/scandic-web/components/Section/index.tsx
@@ -0,0 +1,15 @@
+import { cx } from "class-variance-authority"
+
+import styles from "./section.module.css"
+
+export function Section({
+ children,
+ className,
+ ...props
+}: React.PropsWithChildren>) {
+ return (
+
+ )
+}
diff --git a/apps/scandic-web/components/Section/section.module.css b/apps/scandic-web/components/Section/section.module.css
new file mode 100644
index 000000000..93b23e68e
--- /dev/null
+++ b/apps/scandic-web/components/Section/section.module.css
@@ -0,0 +1,5 @@
+.section {
+ display: grid;
+ gap: var(--Space-x3);
+ z-index: 0;
+}
diff --git a/packages/design-system/lib/components/Typography/variants.ts b/packages/design-system/lib/components/Typography/variants.ts
index c065e678b..d4b0dd21d 100644
--- a/packages/design-system/lib/components/Typography/variants.ts
+++ b/packages/design-system/lib/components/Typography/variants.ts
@@ -44,7 +44,9 @@ const typographyConfig = {
variants: {
typography: config.variants.variant,
},
- defaultVariants: config.defaultVariants,
+ defaultVariants: {
+ typography: config.defaultVariants.variant,
+ },
} as const
export function withTypography(config: T) {