From f52d210240cff6b8948345971cd3145d3b809eec Mon Sep 17 00:00:00 2001 From: Bianca Widstam Date: Thu, 13 Nov 2025 13:56:22 +0000 Subject: [PATCH] Merged in fix/design-system-remove-preamble (pull request #3153) remove deprecated preamble, replace with typography * remove deprecated preamble, replace with typography Approved-by: Linus Flood --- .../fullWidthCampaign.module.css | 4 ++ .../Blocks/FullWidthCampaign/index.tsx | 8 ++-- .../ContentType/LoyaltyPage/index.tsx | 5 +- .../components/Section/Header/Deprecated.tsx | 8 +++- .../lib/components/Modal/index.tsx | 6 +-- .../lib/components/Preamble/index.tsx | 30 ------------ .../components/Preamble/preamble.module.css | 46 ------------------- .../lib/components/Preamble/variants.ts | 24 ---------- 8 files changed, 20 insertions(+), 111 deletions(-) delete mode 100644 packages/design-system/lib/components/Preamble/index.tsx delete mode 100644 packages/design-system/lib/components/Preamble/preamble.module.css delete mode 100644 packages/design-system/lib/components/Preamble/variants.ts diff --git a/apps/scandic-web/components/Blocks/FullWidthCampaign/fullWidthCampaign.module.css b/apps/scandic-web/components/Blocks/FullWidthCampaign/fullWidthCampaign.module.css index 622b3c5e8..29a19de84 100644 --- a/apps/scandic-web/components/Blocks/FullWidthCampaign/fullWidthCampaign.module.css +++ b/apps/scandic-web/components/Blocks/FullWidthCampaign/fullWidthCampaign.module.css @@ -3,6 +3,10 @@ overflow: hidden; height: 100vh; } +.bodyText { + text-align: center; + color: var(--Base-Text-Inverted); +} .container::after { content: ""; diff --git a/apps/scandic-web/components/Blocks/FullWidthCampaign/index.tsx b/apps/scandic-web/components/Blocks/FullWidthCampaign/index.tsx index 128c7ba06..99a7f12c6 100644 --- a/apps/scandic-web/components/Blocks/FullWidthCampaign/index.tsx +++ b/apps/scandic-web/components/Blocks/FullWidthCampaign/index.tsx @@ -1,8 +1,8 @@ import Image from "@scandic-hotels/design-system/Image" import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton" import Link from "@scandic-hotels/design-system/OldDSLink" -import Preamble from "@scandic-hotels/design-system/Preamble" import Title from "@scandic-hotels/design-system/Title" +import { Typography } from "@scandic-hotels/design-system/Typography" import BiroScript from "@/components/TempDesignSystem/Text/BiroScript" @@ -44,9 +44,9 @@ export default function FullWidthCampaign({ content }: FullWidthCampaignProps) { > {content.heading} - - {content.body_text} - + +

{content.body_text}

+
{content.has_primary_button ? (
diff --git a/packages/design-system/lib/components/Preamble/index.tsx b/packages/design-system/lib/components/Preamble/index.tsx deleted file mode 100644 index dfac9b8a6..000000000 --- a/packages/design-system/lib/components/Preamble/index.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { Slot } from '@radix-ui/react-slot' - -import { preambleVariants } from './variants' - -import type { VariantProps } from 'class-variance-authority' - -interface CaptionProps - extends Omit, 'color'>, - VariantProps { - asChild?: boolean -} - -/** - * @deprecated Use `Typography` instead. - */ -export default function Preamble({ - asChild = false, - className = '', - color, - textAlign, - ...props -}: CaptionProps) { - const Comp = asChild ? Slot : 'p' - const classNames = preambleVariants({ - className, - color, - textAlign, - }) - return -} diff --git a/packages/design-system/lib/components/Preamble/preamble.module.css b/packages/design-system/lib/components/Preamble/preamble.module.css deleted file mode 100644 index bfb796746..000000000 --- a/packages/design-system/lib/components/Preamble/preamble.module.css +++ /dev/null @@ -1,46 +0,0 @@ -.preamble { - margin: 0; - padding: 0; - font-family: var(--typography-Preamble-fontFamily); - font-size: clamp( - var(--typography-Preamble-Mobile-fontSize), - 0.3vw + 15px, - var(--typography-Preamble-Desktop-fontSize) - ); - font-weight: var(--typography-Preamble-fontWeight); - letter-spacing: var(--typography-Preamble-letterSpacing); - line-height: var(--typography-Preamble-lineHeight); - text-decoration: var(--typography-Preamble-textDecoration); -} - -.preambleFontOnly { - font-style: normal; -} - -.black { - color: var(--Main-Grey-100); -} - -.burgundy { - color: var(--Scandic-Brand-Burgundy); -} - -.pale { - color: var(--Scandic-Brand-Pale-Peach); -} - -.textMediumContrast { - color: var(--Base-Text-UI-Medium-contrast); -} - -.baseText { - color: var(--Base-Text-Inverted); -} - -.center { - text-align: center; -} - -.left { - text-align: left; -} diff --git a/packages/design-system/lib/components/Preamble/variants.ts b/packages/design-system/lib/components/Preamble/variants.ts deleted file mode 100644 index fff43bbe2..000000000 --- a/packages/design-system/lib/components/Preamble/variants.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { cva } from 'class-variance-authority' - -import styles from './preamble.module.css' - -const config = { - variants: { - color: { - black: styles.black, - burgundy: styles.burgundy, - pale: styles.pale, - textMediumContrast: styles.textMediumContrast, - baseText: styles.baseText, - }, - textAlign: { - center: styles.center, - left: styles.left, - }, - }, - defaultVariants: { - color: 'black', - }, -} as const - -export const preambleVariants = cva(styles.preamble, config)