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:
Anton Gunnarsson
2025-07-04 06:11:25 +00:00
parent 6f96698082
commit 80057264d9
12 changed files with 45 additions and 40 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,30 @@
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,6 +1,6 @@
import { cva } from "class-variance-authority"
import { cva } from 'class-variance-authority'
import styles from "./preamble.module.css"
import styles from './preamble.module.css'
const config = {
variants: {
@@ -17,7 +17,7 @@ const config = {
},
},
defaultVariants: {
color: "black",
color: 'black',
},
} as const

View File

@@ -24,6 +24,7 @@
"./CampaignRateCard": "./dist/components/RateCard/Campaign/index.js",
"./CodeRateCard": "./dist/components/RateCard/Code/index.js",
"./PointsRateCard": "./dist/components/RateCard/Points/index.js",
"./Preamble": "./dist/components/Preamble/index.js",
"./NoRateAvailableCard": "./dist/components/RateCard/NoRateAvailable/index.js",
"./IconButton": "./dist/components/IconButton/index.js",
"./Icons": "./dist/components/Icons/index.js",