diff --git a/components/ContentType/HotelPage/Rooms/RoomCard/index.tsx b/components/ContentType/HotelPage/Rooms/RoomCard/index.tsx index 158fb05ad..4e6c6624d 100644 --- a/components/ContentType/HotelPage/Rooms/RoomCard/index.tsx +++ b/components/ContentType/HotelPage/Rooms/RoomCard/index.tsx @@ -74,7 +74,7 @@ export function RoomCard({ onClick={handleRoomCtaClick} > {intl.formatMessage({ id: "See room details" })} - + diff --git a/components/ContentType/HotelPage/hotelPage.module.css b/components/ContentType/HotelPage/hotelPage.module.css index ceea1bfbe..f2f0377b6 100644 --- a/components/ContentType/HotelPage/hotelPage.module.css +++ b/components/ContentType/HotelPage/hotelPage.module.css @@ -63,3 +63,10 @@ align-items: end; } } + +/* Add this to your existing styles */ +.contentCardContainer { + margin: var(--Spacing-x4) 0; + display: grid; + gap: var(--Spacing-x4); +} diff --git a/components/ContentType/HotelPage/index.tsx b/components/ContentType/HotelPage/index.tsx index f37750db4..3737859fb 100644 --- a/components/ContentType/HotelPage/index.tsx +++ b/components/ContentType/HotelPage/index.tsx @@ -1,6 +1,8 @@ import { env } from "@/env/server" import { serverClient } from "@/lib/trpc/server" +import ContentCard from "@/components/TempDesignSystem/ContentCard" + import { MOCK_FACILITIES } from "./Facilities/mockData" import { setActivityCard } from "./Facilities/utils" import DynamicMap from "./Map/DynamicMap" @@ -65,6 +67,34 @@ export default async function HotelPage() { + + {/* Add ContentCard here */} + + + {/* Example of ContentCard with SidePeek */} + {googleMapsApiKey ? ( <> diff --git a/components/TempDesignSystem/ContentCard/contentCard.module.css b/components/TempDesignSystem/ContentCard/contentCard.module.css new file mode 100644 index 000000000..e1fe789e0 --- /dev/null +++ b/components/TempDesignSystem/ContentCard/contentCard.module.css @@ -0,0 +1,51 @@ +.card { + border-radius: var(--Corner-radius-Medium); + display: flex; + flex-direction: column; + max-width: 399px; + overflow: hidden; +} + +.default { + background-color: var(--Base-Surface-Subtle-Normal); +} + +.featured { + background-color: var(--Main-Grey-White); +} + +.imageContainer { + width: 100%; + height: 12.58625rem; /* 201.38px / 16 = 12.58625rem */ + overflow: hidden; +} + +.backgroundImage { + width: 100%; + height: 100%; + object-fit: cover; +} + +.content { + display: flex; + flex-direction: column; + gap: var(--Spacing-x2); + align-items: flex-start; + padding: var(--Spacing-x4); +} + +.description { + color: var(--Base-Text-Medium-contrast); +} + +.ctaContainer { + display: flex; + gap: var(--Spacing-x2); + margin-top: var(--Spacing-x2); +} + +.sidePeekCTA { + /* TODO: Create ticket to remove padding on "link" buttons, + align w. design on this. */ + padding: 0 !important; +} diff --git a/components/TempDesignSystem/ContentCard/index.tsx b/components/TempDesignSystem/ContentCard/index.tsx new file mode 100644 index 000000000..d65542389 --- /dev/null +++ b/components/TempDesignSystem/ContentCard/index.tsx @@ -0,0 +1,85 @@ +import React from "react" + +import { ChevronRightIcon } from "@/components/Icons" +import Image from "@/components/Image" +import Button from "@/components/TempDesignSystem/Button" +import Link from "@/components/TempDesignSystem/Link" +import Body from "@/components/TempDesignSystem/Text/Body" + +import Subtitle from "../Text/Subtitle" +import { contentCardVariants } from "./variants" + +import styles from "./contentCard.module.css" + +import type { ContentCardProps } from "@/types/components/contentCard" + +export default function ContentCard({ + title, + description, + primaryCTA, + secondaryCTA, + sidePeekCTA, + backgroundImage, + style = "default", + className, +}: ContentCardProps) { + const cardClasses = contentCardVariants({ style, className }) + + return ( +
+ {backgroundImage && ( +
+ +
+ )} +
+ + {title} + + {description} + {sidePeekCTA ? ( + + ) : ( +
+ {primaryCTA && ( + + )} + {secondaryCTA && ( + + )} +
+ )} +
+
+ ) +} diff --git a/components/TempDesignSystem/ContentCard/variants.ts b/components/TempDesignSystem/ContentCard/variants.ts new file mode 100644 index 000000000..1fda9c69d --- /dev/null +++ b/components/TempDesignSystem/ContentCard/variants.ts @@ -0,0 +1,15 @@ +import { cva } from "class-variance-authority" + +import styles from "./contentCard.module.css" + +export const contentCardVariants = cva(styles.card, { + variants: { + style: { + default: styles.default, + featured: styles.featured, + }, + }, + defaultVariants: { + style: "default", + }, +}) diff --git a/types/components/contentCard.ts b/types/components/contentCard.ts new file mode 100644 index 000000000..a15e1edd5 --- /dev/null +++ b/types/components/contentCard.ts @@ -0,0 +1,26 @@ +import { VariantProps } from "class-variance-authority" + +import { contentCardVariants } from "@/components/TempDesignSystem/ContentCard/variants" + +export interface CTA { + label: string + href: string + openInNewTab?: boolean +} + +export interface SidePeekCTA { + label: string + // onClick: () => void + onClick: boolean +} + +export interface ContentCardProps + extends VariantProps { + title: string + description: string + primaryCTA?: CTA + secondaryCTA?: CTA + sidePeekCTA?: SidePeekCTA + backgroundImage?: string + className?: string +}