Merged in chore/sw-3145-move-preamble (pull request #2519)
chore(SW-3145): Move Preamble to design-system * Move Preamble to design-system Approved-by: Linus Flood
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import Preamble from "@scandic-hotels/design-system/Preamble"
|
||||
|
||||
import Image from "@/components/Image"
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import BiroScript from "@/components/TempDesignSystem/Text/BiroScript"
|
||||
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
|
||||
import styles from "./fullWidthCampaign.module.css"
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import Preamble from "@scandic-hotels/design-system/Preamble"
|
||||
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import SidePeek from "@/components/TempDesignSystem/SidePeek"
|
||||
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
||||
import { getIntl } from "@/i18n"
|
||||
|
||||
import styles from "./activities.module.css"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { cx } from "class-variance-authority"
|
||||
import { Suspense } from "react"
|
||||
|
||||
import Preamble from "@scandic-hotels/design-system/Preamble"
|
||||
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import Blocks from "@/components/Blocks"
|
||||
@@ -8,7 +10,6 @@ import Hero from "@/components/Hero"
|
||||
import MaxWidth from "@/components/MaxWidth"
|
||||
import Sidebar from "@/components/Sidebar"
|
||||
import SidebarSkeleton from "@/components/Sidebar/SidebarSkeleton"
|
||||
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
import TrackingSDK from "@/components/TrackingSDK"
|
||||
import { isLoggedInUser } from "@/utils/isLoggedInUser"
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { useHotelFilterStore } from "@/stores/hotel-filters"
|
||||
import Preamble from "@scandic-hotels/design-system/Preamble"
|
||||
|
||||
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
||||
import { useHotelFilterStore } from "@/stores/hotel-filters"
|
||||
|
||||
export default function HotelCount() {
|
||||
const intl = useIntl()
|
||||
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import Preamble from "@scandic-hotels/design-system/Preamble"
|
||||
|
||||
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
||||
import Preamble from "@scandic-hotels/design-system/Preamble"
|
||||
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
|
||||
import SectionLink from "../Link"
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import { Slot } from "@radix-ui/react-slot"
|
||||
|
||||
import { preambleVariants } from "./variants"
|
||||
|
||||
import type { CaptionProps } from "./preamble"
|
||||
|
||||
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} />
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { preambleVariants } from "./variants"
|
||||
|
||||
export interface CaptionProps
|
||||
extends Omit<React.HTMLAttributes<HTMLHeadingElement>, "color">,
|
||||
VariantProps<typeof preambleVariants> {
|
||||
asChild?: boolean
|
||||
}
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user