Merged in chore/BOOK-701-replace-subtitle-component (pull request #3398)

chore(BOOK-701): replace subtitle with typography

* chore(BOOK-701): replace subtitle with typography

* chore(BOOK-701): align center

* chore(BOOK-701): change token

* chore(BOOK-701): change text color

* fix(BOOK-704): revert pricechange dialog changes

* chore(BOOK-701): remove subtitle from package.json


Approved-by: Matilda Landström
This commit is contained in:
Bianca Widstam
2026-01-12 07:40:30 +00:00
parent a88b022186
commit 1b9273136a
43 changed files with 337 additions and 448 deletions

View File

@@ -3,7 +3,7 @@ import { useIntl } from "react-intl"
import { Divider } from "@scandic-hotels/design-system/Divider"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
import Subtitle from "@scandic-hotels/design-system/Subtitle"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { ChildBedMapEnum } from "@scandic-hotels/trpc/enums/childBedMapEnum"
import AdultSelector from "../AdultSelector"
@@ -40,9 +40,9 @@ export function GuestsRoom({
return (
<div className={styles.roomContainer}>
<section className={styles.roomDetailsContainer}>
<Subtitle type="two" className={styles.roomHeading}>
{roomLabel}
</Subtitle>
<Typography variant="Title/Subtitle/md" className={styles.roomHeading}>
<p>{roomLabel}</p>
</Typography>
<AdultSelector roomIndex={index} currentAdults={room.adults} />
<ChildSelector
roomIndex={index}

View File

@@ -9,7 +9,6 @@ import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
import MagicWandIcon from "@scandic-hotels/design-system/Icons/MagicWandIcon"
import Modal from "@scandic-hotels/design-system/Modal"
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
import Subtitle from "@scandic-hotels/design-system/Subtitle"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { useRoomContext } from "../../../../contexts/EnterDetails/RoomContext"
@@ -75,13 +74,18 @@ export default function MemberPriceModal() {
})}
</p>
</Typography>
<Subtitle type="two" color="red">
{formatPrice(
intl,
memberPrice.pricePerStay ?? 0,
memberPrice.currency ?? CurrencyEnum.Unknown
)}
</Subtitle>
<Typography
variant="Title/Subtitle/md"
className={styles.redPrice}
>
<p>
{formatPrice(
intl,
memberPrice.pricePerStay ?? 0,
memberPrice.currency ?? CurrencyEnum.Unknown
)}
</p>
</Typography>
</span>
)}
</div>

View File

@@ -21,6 +21,9 @@
gap: var(--Space-x1);
align-items: center;
}
.redPrice {
color: var(--Text-Accent-Primary);
}
@media screen and (min-width: 768px) {
.modalContent {

View File

@@ -4,7 +4,6 @@ import { useIntl } from "react-intl"
import { LoadingSpinner } from "@scandic-hotels/design-system/LoadingSpinner"
import Link from "@scandic-hotels/design-system/OldDSLink"
import Subtitle from "@scandic-hotels/design-system/Subtitle"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { useBookingFlowConfig } from "../../../../../bookingFlowConfig/bookingFlowConfigContext"
@@ -20,12 +19,14 @@ export default function TimeoutSpinner() {
return (
<div className={styles.container}>
<LoadingSpinner />
<Subtitle className={styles.heading}>
{intl.formatMessage({
id: "enterDetails.payment.loadingTitle",
defaultMessage: "Taking longer than usual",
})}
</Subtitle>
<Typography variant="Title/Subtitle/md" className={styles.heading}>
<p>
{intl.formatMessage({
id: "enterDetails.payment.loadingTitle",
defaultMessage: "Taking longer than usual",
})}
</p>
</Typography>
<Typography
variant="Body/Paragraph/mdRegular"
className={styles.messageContainer}

View File

@@ -14,7 +14,6 @@ import Caption from "@scandic-hotels/design-system/Caption"
import { Divider } from "@scandic-hotels/design-system/Divider"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
import Subtitle from "@scandic-hotels/design-system/Subtitle"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { getRoomFeatureDescription } from "../../../../utils/getRoomFeatureDescription"
@@ -63,12 +62,14 @@ export default function PriceChangeSummary({
{({ close }) => (
<div className={styles.content}>
<header className={styles.header}>
<Subtitle>
{intl.formatMessage({
id: "common.priceDetails",
defaultMessage: "Price details",
})}
</Subtitle>
<Typography variant="Title/Subtitle/md">
<p>
{intl.formatMessage({
id: "common.priceDetails",
defaultMessage: "Price details",
})}
</p>
</Typography>
<Button
onPress={close}
variant="clean"

View File

@@ -5,7 +5,6 @@ import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
import Caption from "@scandic-hotels/design-system/Caption"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
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 { Typography } from "@scandic-hotels/design-system/Typography"
@@ -129,12 +128,14 @@ export default function PriceChangeDialog({
</p>
</Typography>
<div>
<Subtitle textAlign="center" color="burgundy">
{intl.formatMessage({
id: "enterDetails.priceChangeDialog.newTotalLabel",
defaultMessage: "New total",
})}
</Subtitle>
<Typography variant="Title/Subtitle/md">
<p style={{ textAlign: "center" }}>
{intl.formatMessage({
id: "enterDetails.priceChangeDialog.newTotalLabel",
defaultMessage: "New total",
})}
</p>
</Typography>
<div className={styles.prices}>
<Caption striked>
{formatPrice(intl, prevTotalPrice, currency)}

View File

@@ -8,7 +8,7 @@ import { selectRate } from "@scandic-hotels/common/constants/routes/hotelReserva
import { Button } from "@scandic-hotels/design-system/Button"
import Footnote from "@scandic-hotels/design-system/Footnote"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import Subtitle from "@scandic-hotels/design-system/Subtitle"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { getHotelRoom } from "@scandic-hotels/trpc/routers/booking/helpers"
import { useRoomContext } from "../../../contexts/EnterDetails/RoomContext"
@@ -61,25 +61,28 @@ export default function SelectedRoom() {
})}
</h2>
</Footnote>
<Subtitle
type="two"
<Typography
variant="Title/Subtitle/md"
className={styles.description}
color="uiTextHighContrast"
>
{intl.formatMessage(
{
id: "enterDetails.selectedRoom.roomType.description",
defaultMessage: "{roomType} <rate>{rateDescription}</rate>",
},
{
roomType: room.roomType,
rateDescription: room.cancellationText,
rate: ([str]) => {
return str ? <span className={styles.rate}>{str}</span> : null
<p>
{intl.formatMessage(
{
id: "enterDetails.selectedRoom.roomType.description",
defaultMessage: "{roomType} <rate>{rateDescription}</rate>",
},
}
)}
</Subtitle>
{
roomType: room.roomType,
rateDescription: room.cancellationText,
rate: ([str]) => {
return str ? (
<span className={styles.rate}>{str}</span>
) : null
},
}
)}
</p>
</Typography>
<Button
variant="Text"
size="sm"

View File

@@ -11,7 +11,6 @@ import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
import { BookingCodeChip } from "@scandic-hotels/design-system/BookingCodeChip"
import { Divider } from "@scandic-hotels/design-system/Divider"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import Subtitle from "@scandic-hotels/design-system/Subtitle"
import { Typography } from "@scandic-hotels/design-system/Typography"
import useLang from "../../../../hooks/useLang"
@@ -101,12 +100,14 @@ export default function SummaryUI({
role="button"
onClick={isDesktop ? undefined : handleToggleSummary}
>
<Subtitle className={styles.title} type="two">
{intl.formatMessage({
id: "booking.bookingSummary",
defaultMessage: "Booking summary",
})}
</Subtitle>
<Typography className={styles.title} variant="Title/Subtitle/md">
<p>
{intl.formatMessage({
id: "booking.bookingSummary",
defaultMessage: "Booking summary",
})}
</p>
</Typography>
<Typography variant="Body/Paragraph/mdRegular" className={styles.date}>
<p>
{dt(booking.fromDate).locale(lang).format(longDateFormat[lang])}

View File

@@ -12,7 +12,6 @@ import { NoPriceAvailableCard } from "@scandic-hotels/design-system/HotelCard/No
import { IconButton } from "@scandic-hotels/design-system/IconButton"
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
import Link from "@scandic-hotels/design-system/OldDSLink"
import Subtitle from "@scandic-hotels/design-system/Subtitle"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { useGetPointsCurrency } from "../../bookingFlowConfig/bookingFlowConfigContext"
@@ -88,7 +87,9 @@ export default function ListingHotelCardDialog({
/>
<div>
<div className={styles.name}>
<Subtitle type="two">{name}</Subtitle>
<Typography variant="Title/Subtitle/md">
<p>{name}</p>
</Typography>
</div>
<div className={styles.facilities}>
{amenities.map((facility) => (
@@ -127,35 +128,47 @@ export default function ListingHotelCardDialog({
</Caption>
)}
<div className={styles.listingPrices}>
{publicPrice && !isUserLoggedIn && memberPrice ? (
{publicPrice && !isUserLoggedIn ? (
<>
<Subtitle type="two">
{publicPrice} {currency}
</Subtitle>
<Typography variant="Title/Subtitle/md">
<p>
{publicPrice} {currency}
</p>
</Typography>
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
{memberPrice && <Caption>/</Caption>}
</>
) : (
bookingCode &&
publicPrice && (
<Subtitle type="two" color="red">
{publicPrice} {currency}
</Subtitle>
<Typography
variant="Title/Subtitle/md"
className={styles.red}
>
<p>
{publicPrice} {currency}
</p>
</Typography>
)
)}
{memberPrice && (
<Subtitle type="two" color="red">
{intl.formatMessage(
{
id: "common.priceCurrency",
defaultMessage: "{price} {currency}",
},
{
price: memberPrice,
currency,
}
)}
</Subtitle>
<Typography
variant="Title/Subtitle/md"
className={styles.red}
>
<p>
{intl.formatMessage(
{
id: "common.priceCurrency",
defaultMessage: "{price} {currency}",
},
{
price: memberPrice,
currency,
}
)}
</p>
</Typography>
)}
{redemptionPrice && (
<HotelPointsRow
@@ -164,31 +177,36 @@ export default function ListingHotelCardDialog({
/>
)}
{chequePrice && (
<Subtitle type="two">
{intl.formatMessage(
{
id: "common.priceCurrency",
defaultMessage: "{price} {currency}",
},
{
price: chequePrice.numberOfCheques,
currency: "CC",
}
)}
{chequePrice.additionalPricePerStay > 0
? // eslint-disable-next-line formatjs/no-literal-string-in-jsx
" + " +
intl.formatMessage(
<>
<Typography variant="Title/Subtitle/md">
<span>
{intl.formatMessage(
{
id: "common.priceCurrency",
defaultMessage: "{price} {currency}",
},
{
price: chequePrice.additionalPricePerStay,
currency: chequePrice.currency,
price: chequePrice.numberOfCheques,
currency: "CC",
}
)
: null}
)}
{chequePrice.additionalPricePerStay > 0
? // eslint-disable-next-line formatjs/no-literal-string-in-jsx
" + " +
intl.formatMessage(
{
id: "common.priceCurrency",
defaultMessage: "{price} {currency}",
},
{
price: chequePrice.additionalPricePerStay,
currency: chequePrice.currency,
}
)
: null}
</span>
</Typography>
<Typography variant="Body/Paragraph/mdRegular">
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
<span>
@@ -199,20 +217,24 @@ export default function ListingHotelCardDialog({
})}
</span>
</Typography>
</Subtitle>
</>
)}
{voucherPrice && (
<Subtitle type="two">
{intl.formatMessage(
{
id: "common.priceCurrency",
defaultMessage: "{price} {currency}",
},
{
price: voucherPrice,
currency,
}
)}
<>
<Typography variant="Title/Subtitle/md">
<p>
{intl.formatMessage(
{
id: "common.priceCurrency",
defaultMessage: "{price} {currency}",
},
{
price: voucherPrice,
currency,
}
)}
</p>
</Typography>
<Typography variant="Body/Paragraph/mdRegular">
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
<span>
@@ -223,7 +245,7 @@ export default function ListingHotelCardDialog({
})}
</span>
</Typography>
</Subtitle>
</>
)}
</div>
</div>

View File

@@ -19,6 +19,10 @@
gap: var(--Space-x15);
}
.red {
color: var(--Text-Accent-Primary);
}
.name {
height: 48px;
max-width: 180px;

View File

@@ -1,3 +1,4 @@
import { cx } from "class-variance-authority"
import { useIntl } from "react-intl"
import { RateEnum } from "@scandic-hotels/common/constants/rate"
@@ -5,7 +6,6 @@ import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
import Caption from "@scandic-hotels/design-system/Caption"
import Footnote from "@scandic-hotels/design-system/Footnote"
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
import Subtitle from "@scandic-hotels/design-system/Subtitle"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { useIsLoggedIn } from "../../../../hooks/useIsLoggedIn"
@@ -152,18 +152,22 @@ export function DesktopSummary({
</div>
<div className={styles.summaryPrice}>
<div className={styles.summaryPriceTextDesktop}>
<Subtitle
color={showDiscounted ? "red" : "uiTextHighContrast"}
textAlign="right"
<Typography
variant="Title/Subtitle/md"
className={cx(styles.alignRight, {
[styles.red]: showDiscounted,
})}
>
{formatPrice(
intl,
selectedRates.totalPrice.local.price,
selectedRates.totalPrice.local.currency,
selectedRates.totalPrice.local.additionalPrice,
selectedRates.totalPrice.local.additionalPriceCurrency
)}
</Subtitle>
<p>
{formatPrice(
intl,
selectedRates.totalPrice.local.price,
selectedRates.totalPrice.local.currency,
selectedRates.totalPrice.local.additionalPrice,
selectedRates.totalPrice.local.additionalPriceCurrency
)}
</p>
</Typography>
{showDiscounted && selectedRates.totalPrice.local.regularPrice && (
<Caption
textAlign="right"
@@ -210,15 +214,20 @@ export function DesktopSummary({
defaultMessage: "Total price",
})}
</Caption>
<Subtitle color={showDiscounted ? "red" : "uiTextHighContrast"}>
{formatPrice(
intl,
selectedRates.totalPrice.local.price,
selectedRates.totalPrice.local.currency,
selectedRates.totalPrice.local.additionalPrice,
selectedRates.totalPrice.local.additionalPriceCurrency
)}
</Subtitle>
<Typography
variant="Title/Subtitle/md"
className={cx({ [styles.red]: showDiscounted })}
>
<p>
{formatPrice(
intl,
selectedRates.totalPrice.local.price,
selectedRates.totalPrice.local.currency,
selectedRates.totalPrice.local.additionalPrice,
selectedRates.totalPrice.local.additionalPriceCurrency
)}
</p>
</Typography>
<Footnote
color="uiTextMediumContrast"
className={styles.summaryPriceTextMobile}
@@ -258,18 +267,23 @@ function RateSummary({
if (!room || !room.isSelected) {
return (
<div key={`unselected-${roomIndex}`}>
<Subtitle color="uiTextPlaceholder">
{intl.formatMessage(
{
id: "booking.roomIndex",
defaultMessage: "Room {roomIndex}",
},
{ roomIndex: roomIndex + 1 }
)}
</Subtitle>
<Typography
variant="Title/Subtitle/md"
className={styles.placeholderText}
>
<p>
{intl.formatMessage(
{
id: "booking.roomIndex",
defaultMessage: "Room {roomIndex}",
},
{ roomIndex: roomIndex + 1 }
)}
</p>
</Typography>
<Typography
variant="Body/Paragraph/mdRegular"
className={styles.selectRoom}
className={styles.placeholderText}
>
<p>
{intl.formatMessage({
@@ -286,12 +300,14 @@ function RateSummary({
<div key={roomIndex}>
{isMultiRoom ? (
<>
<Subtitle color="uiTextHighContrast">
{intl.formatMessage(
{ id: "booking.roomIndex", defaultMessage: "Room {roomIndex}" },
{ roomIndex: roomIndex + 1 }
)}
</Subtitle>
<Typography variant="Title/Subtitle/md">
<p>
{intl.formatMessage(
{ id: "booking.roomIndex", defaultMessage: "Room {roomIndex}" },
{ roomIndex: roomIndex + 1 }
)}
</p>
</Typography>
<Typography
variant="Body/Paragraph/mdRegular"
className={styles.uiTextMediumContrast}
@@ -304,9 +320,9 @@ function RateSummary({
</>
) : (
<>
<Subtitle color="uiTextHighContrast">
{room.roomInfo.roomType}
</Subtitle>
<Typography variant="Title/Subtitle/md">
<p>{room.roomInfo.roomType}</p>
</Typography>
<Typography
variant="Body/Paragraph/mdRegular"
className={styles.uiTextMediumContrast}

View File

@@ -37,6 +37,14 @@
max-width: 264px;
}
.alignRight {
text-align: right;
}
.red {
color: var(--Text-Accent-Primary);
}
.summaryPrice {
align-self: center;
display: flex;
@@ -77,8 +85,8 @@
display: block;
}
.selectRoom {
color: var(--UI-Text-Placeholder);
.placeholderText {
color: var(--Text-Tertiary);
}
.uiTextMediumContrast {

View File

@@ -8,7 +8,6 @@ import Caption from "@scandic-hotels/design-system/Caption"
import { ChipButton } from "@scandic-hotels/design-system/ChipButton"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import Image from "@scandic-hotels/design-system/Image"
import Subtitle from "@scandic-hotels/design-system/Subtitle"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { useSelectRateContext } from "../../../../../../contexts/SelectRate/SelectRateContext"
@@ -56,9 +55,9 @@ export function SelectedRoomPanel({ roomIndex }: { roomIndex: number }) {
{ roomIndex: roomNr }
)}
</Caption>
<Subtitle className={styles.subtitle} color="uiTextHighContrast">
{selectedRate.roomInfo.roomType}
</Subtitle>
<Typography variant="Title/Subtitle/md" className={styles.subtitle}>
<p>{selectedRate.roomInfo.roomType}</p>
</Typography>
<Typography variant="Body/Paragraph/mdRegular">
<div>
<p className={styles.uiTextMediumContrast}>{rateTitle}</p>

View File

@@ -4,7 +4,7 @@ import { useIntl } from "react-intl"
import useStickyPosition from "@scandic-hotels/common/hooks/useStickyPosition"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
import Subtitle from "@scandic-hotels/design-system/Subtitle"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { useSelectRateContext } from "../../../../../contexts/SelectRate/SelectRateContext"
import { SelectedRoomPanel } from "./SelectedRoomPanel"
@@ -116,7 +116,9 @@ export function MultiRoomWrapper({ children, isMultiRoom, roomIndex }: Props) {
<div className={styles.header}>
{selectedRate && !isActiveRoom ? null : (
<Subtitle color="uiTextHighContrast">{title}</Subtitle>
<Typography variant="Title/Subtitle/md">
<p>{title}</p>
</Typography>
)}
{selectedRate && isActiveRoom ? (
<Button

View File

@@ -2,9 +2,9 @@ import { useIntl } from "react-intl"
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
import Caption from "../../Caption"
import Subtitle from "../../Subtitle"
import styles from "./hotelChequeCard.module.css"
import { Typography } from "../../Typography"
type ProductTypeCheque = {
localPrice: {
@@ -35,17 +35,17 @@ export default function HotelChequeCard({
})}
</Caption>
<div className={styles.cheque}>
<Subtitle type="two" color="uiTextHighContrast">
{productTypeCheque.localPrice.numberOfCheques}
</Subtitle>
<Typography variant="Title/Subtitle/md">
<p>{productTypeCheque.localPrice.numberOfCheques}</p>
</Typography>
<Caption color="uiTextHighContrast">{CurrencyEnum.CC}</Caption>
{productTypeCheque.localPrice.additionalPricePerStay > 0 ? (
// eslint-disable-next-line formatjs/no-literal-string-in-jsx
<>
+
<Subtitle type="two" color="uiTextHighContrast">
{productTypeCheque.localPrice.additionalPricePerStay}
</Subtitle>
<Typography variant="Title/Subtitle/md">
<p>{productTypeCheque.localPrice.additionalPricePerStay}</p>
</Typography>
<Caption color="uiTextHighContrast">
{productTypeCheque.localPrice.currency}
</Caption>

View File

@@ -1,9 +1,9 @@
import { useIntl } from "react-intl"
import Caption from "../../Caption"
import Subtitle from "../../Subtitle"
import styles from "./hotelVoucherCard.module.css"
import { Typography } from "../../Typography"
type ProductTypeVoucher = {
numberOfVouchers: number
@@ -25,9 +25,9 @@ export default function HotelVoucherCard({
})}
</Caption>
<div className={styles.voucher}>
<Subtitle type="two" color="uiTextHighContrast">
{productTypeVoucher.numberOfVouchers}
</Subtitle>
<Typography variant="Title/Subtitle/md">
<p>{productTypeVoucher.numberOfVouchers}</p>
</Typography>
<Caption color="uiTextHighContrast" className={styles.currency}>
{intl.formatMessage(
{

View File

@@ -1,6 +1,6 @@
import { MaterialIcon } from "../../Icons/MaterialIcon"
import { OldDSButton as Button } from "../../OldDSButton"
import Subtitle from "../../Subtitle"
import { Typography } from "../../Typography"
import styles from "./modalContent.module.css"
@@ -35,7 +35,9 @@ export function ModalContentWithActions({
<>
{title && (
<header className={styles.header}>
<Subtitle>{title}</Subtitle>
<Typography variant="Title/Subtitle/md">
<p>{title}</p>
</Typography>
<button onClick={onClose} type="button" className={styles.close}>
<MaterialIcon icon="close" color="Icon/Interactive/Placeholder" />
</button>

View File

@@ -1,51 +0,0 @@
import { Slot } from "@radix-ui/react-slot"
import { subtitleVariants } from "./variants"
import type { VariantProps } from "class-variance-authority"
import { Children, ReactNode } from "react"
interface SubtitleProps
extends
Omit<React.HTMLAttributes<HTMLHeadingElement>, "color">,
VariantProps<typeof subtitleVariants> {
asChild?: boolean
}
/**
* @deprecated Use `Typography` instead.
*/
export default function Subtitle({
asChild = false,
className = "",
color,
textAlign,
textTransform,
type,
...props
}: SubtitleProps) {
if (checkForEmptyChildren(props.children) === 0) {
return null
}
const Comp = asChild ? Slot : "p"
const classNames = subtitleVariants({
className,
color,
textAlign,
textTransform,
type,
})
return <Comp className={classNames} {...props} />
}
function checkForEmptyChildren(children: ReactNode) {
return Children.toArray(children).filter((child) => {
if (child === "") {
return false
} else if (child == null) {
return false
} else {
return true
}
}).length
}

View File

@@ -1,92 +0,0 @@
.subtitle {
margin: 0;
padding: 0;
}
.one {
font-family: var(--typography-Subtitle-1-fontFamily);
font-size: clamp(
var(--typography-Subtitle-1-Mobile-fontSize),
0.3vw + 15px,
var(--typography-Subtitle-1-Desktop-fontSize)
);
font-weight: 500;
letter-spacing: var(--typography-Subtitle-1-letterSpacing);
line-height: var(--typography-Subtitle-1-lineHeight);
}
.two {
font-family: var(--typography-Subtitle-2-fontFamily);
font-size: clamp(
var(--typography-Subtitle-2-Mobile-fontSize),
0.3vw + 15px,
var(--typography-Subtitle-2-Desktop-fontSize)
);
font-weight: 500;
letter-spacing: var(--typography-Subtitle-2-letterSpacing);
line-height: var(--typography-Subtitle-2-lineHeight);
}
.regular {
text-transform: none;
}
.uppercase {
text-transform: uppercase;
}
.capitalize {
text-transform: capitalize;
}
.center {
text-align: center;
}
.left {
text-align: left;
}
.right {
text-align: right;
}
.black {
color: var(--Main-Grey-100);
}
.burgundy {
color: var(--Scandic-Brand-Burgundy);
}
.pale {
color: var(--Scandic-Brand-Pale-Peach);
}
.baseTextHighContrast {
color: var(--Base-Text-High-contrast);
}
.uiTextHighContrast {
color: var(--UI-Text-High-contrast);
}
.uiTextMediumContrast {
color: var(--UI-Text-Medium-contrast);
}
.uiTextPlaceholder {
color: var(--UI-Text-Placeholder);
}
.red {
color: var(--Scandic-Brand-Scandic-Red);
}
.baseTextDisabled {
color: var(--Base-Text-Disabled);
}
.mainGrey60 {
color: var(--Main-Grey-60);
}

View File

@@ -1,42 +0,0 @@
import { cva } from "class-variance-authority"
import styles from "./subtitle.module.css"
const config = {
variants: {
color: {
black: styles.black,
burgundy: styles.burgundy,
baseTextDisabled: styles.baseTextDisabled,
pale: styles.pale,
baseTextHighContrast: styles.baseTextHighContrast,
uiTextHighContrast: styles.uiTextHighContrast,
uiTextMediumContrast: styles.uiTextMediumContrast,
uiTextPlaceholder: styles.uiTextPlaceholder,
red: styles.red,
mainGrey60: styles.mainGrey60,
},
textAlign: {
center: styles.center,
left: styles.left,
right: styles.right,
},
textTransform: {
regular: styles.regular,
uppercase: styles.uppercase,
capitalize: styles.capitalize,
},
type: {
one: styles.one,
two: styles.two,
},
},
defaultVariants: {
color: "black",
textAlign: "left",
textTransform: "regular",
type: "one",
},
} as const
export const subtitleVariants = cva(styles.subtitle, config)

View File

@@ -175,7 +175,6 @@
"./SkeletonShimmer": "./lib/components/SkeletonShimmer/index.tsx",
"./StaticMap": "./lib/components/StaticMap/index.tsx",
"./Stepper": "./lib/components/Stepper/index.tsx",
"./Subtitle": "./lib/components/Subtitle/index.tsx",
"./Switch": "./lib/components/Switch/index.tsx",
"./Table": "./lib/components/Table/index.tsx",
"./TextArea": "./lib/components/TextArea/index.tsx",