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
This commit is contained in:
Bianca Widstam
2025-11-13 13:56:22 +00:00
parent 0a513fce9c
commit f52d210240
8 changed files with 20 additions and 111 deletions

View File

@@ -12,7 +12,6 @@ import {
import { useIntl } from 'react-intl'
import { MaterialIcon } from '../Icons/MaterialIcon'
import Preamble from '../Preamble'
import Subtitle from '../Subtitle'
import {
@@ -25,6 +24,7 @@ import { fade, slideInOut } from './motionVariants'
import { modalContentVariants } from './variants'
import styles from './modal.module.css'
import { Typography } from '../Typography'
const MotionOverlay = motion.create(ModalOverlay)
const MotionModal = motion.create(AriaModal)
@@ -106,9 +106,9 @@ function InnerModal({
</Subtitle>
)}
{subtitle && (
<Preamble asChild>
<Typography variant="Body/Lead text">
<span>{subtitle}</span>
</Preamble>
</Typography>
)}
</div>

View File

@@ -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<React.HTMLAttributes<HTMLHeadingElement>, 'color'>,
VariantProps<typeof preambleVariants> {
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 <Comp className={classNames} {...props} />
}

View File

@@ -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;
}

View File

@@ -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)