diff --git a/apps/scandic-web/components/ContentType/CampaignPage/Hero/index.tsx b/apps/scandic-web/components/ContentType/CampaignPage/Hero/index.tsx index e4be06efe..9eab3d41e 100644 --- a/apps/scandic-web/components/ContentType/CampaignPage/Hero/index.tsx +++ b/apps/scandic-web/components/ContentType/CampaignPage/Hero/index.tsx @@ -1,12 +1,14 @@ /* eslint-disable formatjs/no-literal-string-in-jsx */ import { cx, type VariantProps } from "class-variance-authority" +import { DEFAULT_THEME, type Theme } from "@scandic-hotels/common/utils/theme" import ButtonLink from "@scandic-hotels/design-system/ButtonLink" import { Divider } from "@scandic-hotels/design-system/Divider" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import Image from "@scandic-hotels/design-system/Image" import { Typography } from "@scandic-hotels/design-system/Typography" +import { getButtonColor } from "./utils" import { variants } from "./variants" import styles from "./hero.module.css" @@ -18,6 +20,7 @@ interface HeroProps VariantProps, Omit { pageType?: "campaign" | "overview" | "hotelPage" + hotelTheme?: Theme | null } export default async function CampaignHero({ @@ -29,11 +32,14 @@ export default async function CampaignHero({ button, theme, pageType = "campaign", + hotelTheme = DEFAULT_THEME, }: HeroProps) { const classNames = variants({ theme, }) + const buttonColor = getButtonColor(theme, hotelTheme) + const visibleBenefits = pageType === "campaign" ? benefits : benefits.slice(0, 3) @@ -95,8 +101,8 @@ export default async function CampaignHero({ {rate_text ? ( @@ -117,7 +123,7 @@ export default async function CampaignHero({ {button ? ( + +// Determine button color based on hero theme and hotel theme. +// This is done to avoid low contrast issues and conflicting colors in +// certain combinations and according to design guidelines. +export function getButtonColor( + heroTheme: VariantProps["theme"], + hotelTheme: Theme | null = Theme.scandic +): ButtonVariants["color"] { + let buttonColor: ButtonVariants["color"] = "Inverted" + + switch (hotelTheme) { + case Theme.scandic: + if (heroTheme === "Peach") { + buttonColor = "Primary" + } + break + case Theme.scandicGo: + buttonColor = "Primary" + break + case Theme.grandHotel: + buttonColor = "Primary" + break + case Theme.hotelNorge: + if (heroTheme === "Peach") { + buttonColor = "Primary" + } + break + case Theme.theDock: + if (heroTheme === "Peach") { + buttonColor = "Primary" + } + break + case Theme.downtownCamper: + case Theme.haymarket: + case Theme.marski: + default: + break + } + + return buttonColor +} diff --git a/apps/scandic-web/components/ContentType/HotelPage/Campaigns/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/Campaigns/index.tsx index 8efa7be5c..46b70accf 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/Campaigns/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/Campaigns/index.tsx @@ -1,3 +1,4 @@ +import { getTheme } from "@scandic-hotels/common/utils/theme/serverContext" import { Typography } from "@scandic-hotels/design-system/Typography" import { Carousel } from "@/components/Carousel" @@ -31,6 +32,7 @@ export default async function HotelCampaigns({ campaigns, }: HotelCampaignsProps) { const intl = await getIntl() + const hotelTheme = getTheme() const [topCampaign, ...campaignCards] = campaigns @@ -63,6 +65,7 @@ export default async function HotelCampaigns({ url: topCampaign.url, }} pageType="hotelPage" + hotelTheme={hotelTheme} /> {campaignCards.length ? (
diff --git a/apps/scandic-web/components/ContentType/HotelPage/Hero/Illustrations/ScandicGoSwirl.tsx b/apps/scandic-web/components/ContentType/HotelPage/Hero/Illustrations/ScandicGoSwirl.tsx new file mode 100644 index 000000000..641ce0805 --- /dev/null +++ b/apps/scandic-web/components/ContentType/HotelPage/Hero/Illustrations/ScandicGoSwirl.tsx @@ -0,0 +1,18 @@ +export function ScandicGoSwirl({ className }: { className?: string }) { + return ( + + ) +} diff --git a/apps/scandic-web/components/ContentType/HotelPage/Hero/Logos/brandedHotelLogo.module.css b/apps/scandic-web/components/ContentType/HotelPage/Hero/Logos/brandedHotelLogo.module.css new file mode 100644 index 000000000..fa6e35f57 --- /dev/null +++ b/apps/scandic-web/components/ContentType/HotelPage/Hero/Logos/brandedHotelLogo.module.css @@ -0,0 +1,11 @@ +@media screen and (max-width: 767px) { + .logoLarge { + display: none; + } +} + +@media screen and (min-width: 768px) { + .logoSmall { + display: none; + } +} diff --git a/apps/scandic-web/components/ContentType/HotelPage/Hero/Logos/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/Hero/Logos/index.tsx index e4265d8a7..93510c6b5 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/Hero/Logos/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/Hero/Logos/index.tsx @@ -1,3 +1,7 @@ +"use client" + +import { cx } from "class-variance-authority" + import { Theme } from "@scandic-hotels/common/utils/theme" import ScandicLogoIcon from "@scandic-hotels/design-system/Icons/ScandicLogoIcon" @@ -16,61 +20,67 @@ import { ScandicGoLogoSmall } from "./ScandicGoSmall" import { TheDockLogoLarge } from "./TheDockLarge" import { TheDockLogoSmall } from "./TheDockSmall" +import styles from "./brandedHotelLogo.module.css" + interface BrandedHotelLogoProps { theme: Theme - size?: "small" | "large" className?: string } -export function BrandedHotelLogo({ - theme, - size = "small", - className, -}: BrandedHotelLogoProps) { - const isSmall = size === "small" - +export function BrandedHotelLogo({ theme, className }: BrandedHotelLogoProps) { switch (theme) { case Theme.downtownCamper: - return isSmall ? ( - - ) : ( - + return ( + <> + + + ) case Theme.grandHotel: - return isSmall ? ( - - ) : ( - + return ( + <> + + + ) case Theme.haymarket: - return isSmall ? ( - - ) : ( - + return ( + <> + + + ) case Theme.hotelNorge: - return isSmall ? ( - - ) : ( - + return ( + <> + + + ) case Theme.marski: - return isSmall ? ( - - ) : ( - + return ( + <> + + + ) case Theme.scandicGo: - return isSmall ? ( - - ) : ( - + return ( + <> + + + ) case Theme.theDock: - return isSmall ? ( - - ) : ( - + return ( + <> + + + ) case Theme.scandic: default: diff --git a/apps/scandic-web/components/ContentType/HotelPage/Hero/hero.module.css b/apps/scandic-web/components/ContentType/HotelPage/Hero/hero.module.css index 55c05e9a2..1f618e507 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/Hero/hero.module.css +++ b/apps/scandic-web/components/ContentType/HotelPage/Hero/hero.module.css @@ -17,10 +17,25 @@ } .logoWrapper { + position: relative; background-color: var(--Surface-Brand-Primary-1-Default); display: flex; align-items: center; padding: var(--Space-x1) 0; + z-index: 0; + overflow: hidden; +} + +.logo { + z-index: 1; +} + +.scandicGoSwirl { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: auto; } .seeAllButton { @@ -39,6 +54,10 @@ height: 252px; } } + + .scandicGoSwirl { + display: none; + } } @media screen and (min-width: 768px) { @@ -47,11 +66,22 @@ height: 270px; } + .logoWrapper { + border-radius: var(--Corner-radius-sm); + justify-content: center; + } + .logo { height: 100%; } } +@media screen and (min-width: 768px) and (max-width: 1366px) { + .scandicGoSwirl { + bottom: -20px; + } +} + @media screen and (min-width: 1367px) { .hotelPageHero { padding: 0 var(--Space-x5); @@ -83,8 +113,6 @@ .logoWrapper { padding: var(--Space-x3); - border-radius: var(--Corner-radius-sm); - justify-content: center; } .seeAllButton { diff --git a/apps/scandic-web/components/ContentType/HotelPage/Hero/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/Hero/index.tsx index e5315bf40..0b695a593 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/Hero/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/Hero/index.tsx @@ -3,12 +3,12 @@ import { cx } from "class-variance-authority" import { useState } from "react" import { useIntl } from "react-intl" -import { useMediaQuery } from "usehooks-ts" -import { DEFAULT_THEME, type Theme } from "@scandic-hotels/common/utils/theme" +import { DEFAULT_THEME, Theme } from "@scandic-hotels/common/utils/theme" import { Button } from "@scandic-hotels/design-system/Button" import Lightbox from "@scandic-hotels/design-system/Lightbox" +import { ScandicGoSwirl } from "./Illustrations/ScandicGoSwirl" import { ImageButton } from "./ImageButton" import { BrandedHotelLogo } from "./Logos" @@ -28,7 +28,6 @@ export function HotelPageHero({ theme, }: HotelPageHeroProps) { const intl = useIntl() - const isMobile = useMediaQuery("(max-width: 767px)") const [lightboxState, setLightboxState] = useState({ activeIndex: 0, isOpen: false, @@ -49,11 +48,10 @@ export function HotelPageHero({ {isThemed ? ( <>
- + + {theme === Theme.scandicGo ? ( + + ) : null}
- - + + {intl.formatMessage({ id: "hotel.mapCard.nearby", defaultMessage: "Nearby", })} - -

{hotelName}

+ +

{hotelName}

    @@ -44,11 +44,8 @@ export default function MapCard({ hotelName, pois }: MapCardProps) { {poi.name} - - + + {intl.formatMessage( { id: "common.distanceKm", diff --git a/apps/scandic-web/components/ContentType/HotelPage/Map/MapCard/mapCard.module.css b/apps/scandic-web/components/ContentType/HotelPage/Map/MapCard/mapCard.module.css index 30465a18a..6001fe9a2 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/Map/MapCard/mapCard.module.css +++ b/apps/scandic-web/components/ContentType/HotelPage/Map/MapCard/mapCard.module.css @@ -35,6 +35,7 @@ .nearby { color: var(--Text-Interactive-Secondary); + text-transform: uppercase; } .hotelName { diff --git a/apps/scandic-web/components/ContentType/HotelPage/Map/MobileMapToggle/mobileToggle.module.css b/apps/scandic-web/components/ContentType/HotelPage/Map/MobileMapToggle/mobileToggle.module.css index 49b9306da..08e0df3ef 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/Map/MobileMapToggle/mobileToggle.module.css +++ b/apps/scandic-web/components/ContentType/HotelPage/Map/MobileMapToggle/mobileToggle.module.css @@ -23,11 +23,11 @@ padding: var(--Space-x1) var(--Space-x2); background-color: transparent; border-radius: 2.5rem; - color: var(--Text-Accent-Primary); + color: var(--Component-Button-Brand-Secondary-On-fill-Default); &.active { - background-color: var(--Surface-Brand-Primary-2-Default); - color: var(--Text-Inverted); + background-color: var(--Component-Button-Brand-Primary-Fill-Default); + color: var(--Component-Button-Brand-Primary-On-fill-Default); } &:not(.active) { @@ -37,7 +37,7 @@ .link { display: contents; - color: var(--Text-Accent-Primary); + color: var(--Component-Button-Brand-Secondary-On-fill-Default); } @media screen and (min-width: 1367px) { diff --git a/packages/design-system/lib/components/Button/index.tsx b/packages/design-system/lib/components/Button/index.tsx index b28437be0..5283faf8f 100644 --- a/packages/design-system/lib/components/Button/index.tsx +++ b/packages/design-system/lib/components/Button/index.tsx @@ -1,5 +1,4 @@ export { Button } from './Button' -// eslint-disable-next-line react-refresh/only-export-components -export { withButton } from './variants' - export { type ButtonProps } from './types' +// eslint-disable-next-line react-refresh/only-export-components +export { variants as buttonVariants, withButton } from './variants' diff --git a/packages/design-system/lib/components/Divider/divider.module.css b/packages/design-system/lib/components/Divider/divider.module.css index e7808070a..b6f9ecbfc 100644 --- a/packages/design-system/lib/components/Divider/divider.module.css +++ b/packages/design-system/lib/components/Divider/divider.module.css @@ -48,3 +48,7 @@ .Surface-Brand-Primary-1-OnSurface-Accent-Secondary { background-color: var(--Surface-Brand-Primary-1-OnSurface-Accent-Secondary); } + +.Border-Divider-Brand-OnAccent-Default { + background-color: var(--Border-Divider-Brand-OnAccent-Default); +} diff --git a/packages/design-system/lib/components/Divider/index.tsx b/packages/design-system/lib/components/Divider/index.tsx index 465ccc7fd..76abb93c8 100644 --- a/packages/design-system/lib/components/Divider/index.tsx +++ b/packages/design-system/lib/components/Divider/index.tsx @@ -1 +1,4 @@ export { Divider } from './Divider' + +// eslint-disable-next-line react-refresh/only-export-components +export { dividerVariants } from './variants' diff --git a/packages/design-system/lib/components/Divider/variants.ts b/packages/design-system/lib/components/Divider/variants.ts index c41f4c30e..1f5c51257 100644 --- a/packages/design-system/lib/components/Divider/variants.ts +++ b/packages/design-system/lib/components/Divider/variants.ts @@ -16,6 +16,8 @@ export const dividerVariants = cva(styles.divider, { 'Border/Divider/Subtle': styles['Border-Divider-Subtle'], 'Surface/Brand/Primary 1/OnSurface/Accent Secondary': styles['Surface-Brand-Primary-1-OnSurface-Accent-Secondary'], + 'Border/Divider/Brand/OnAccent/Default': + styles['Border-Divider-Brand-OnAccent-Default'], }, variant: { horizontal: styles.horizontal, diff --git a/packages/design-system/lib/fonts.css b/packages/design-system/lib/fonts.css index 5b373c1b6..3cb7312f1 100644 --- a/packages/design-system/lib/fonts.css +++ b/packages/design-system/lib/fonts.css @@ -98,7 +98,7 @@ @font-face { font-display: swap; - font-family: Garamond; + font-family: 'ITC Garamond Std'; font-style: normal; font-weight: 400; src: