Merged in chore/BOOK-739-replace-caption (pull request #3428)
chore(BOOK-739): replace caption with typography * chore(BOOK-739): replace caption with typography * chore(BOOK-739): refactor div * chore(BOOK-739): refactor badge * chore(BOOK-739): remove span * chore(BOOK-739): skeleton update * chore(BOOK-739): update * chore(BOOK-739): update reward * chore(BOOK-739): update voucher currency Approved-by: Erik Tiekstra
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { dt } from "@scandic-hotels/common/dt"
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
@@ -41,15 +40,18 @@ export default function JobylonCard({ job }: JobylonCardProps) {
|
|||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<div className={styles.contentWrapper}>
|
<div className={styles.contentWrapper}>
|
||||||
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
<div>
|
<div>
|
||||||
<Caption>{job.categories.map((cat) => cat.text).join(", ")}</Caption>
|
<p>{job.categories.map((cat) => cat.text).join(", ")}</p>
|
||||||
<Caption>
|
<p>
|
||||||
{job.locations
|
{job.locations
|
||||||
.map((loc) => `${loc.city}, ${loc.country}`)
|
.map((loc) => `${loc.city}, ${loc.country}`)
|
||||||
.join(" | ")}
|
.join(" | ")}
|
||||||
</Caption>
|
</p>
|
||||||
<Caption color="uiTextPlaceholder">{deadlineText}</Caption>
|
<p className={styles.deadline}>{deadlineText}</p>
|
||||||
</div>
|
</div>
|
||||||
|
</Typography>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
theme="base"
|
theme="base"
|
||||||
size="small"
|
size="small"
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
border-radius: var(--Corner-radius-md);
|
border-radius: var(--Corner-radius-md);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.deadline {
|
||||||
|
color: var(--Text-Secondary);
|
||||||
|
}
|
||||||
|
|
||||||
.contentWrapper {
|
.contentWrapper {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--Space-x1);
|
gap: var(--Space-x1);
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
@@ -81,23 +80,20 @@ async function LevelCard({ level }: LevelCardProps) {
|
|||||||
<Typography variant="Title/xs" className={styles.pointMsg}>
|
<Typography variant="Title/xs" className={styles.pointMsg}>
|
||||||
<h5>{pointsMsg}</h5>
|
<h5>{pointsMsg}</h5>
|
||||||
</Typography>
|
</Typography>
|
||||||
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
<div className={styles.textContainer}>
|
<div className={styles.textContainer}>
|
||||||
{level.rewards.map((reward) => (
|
{level.rewards.map((reward) => (
|
||||||
<Caption
|
<p className={styles.levelText} key={reward.reward_id}>
|
||||||
className={styles.levelText}
|
|
||||||
key={reward.reward_id}
|
|
||||||
textAlign="center"
|
|
||||||
color="textMediumContrast"
|
|
||||||
>
|
|
||||||
<MaterialIcon
|
<MaterialIcon
|
||||||
icon="check"
|
icon="check"
|
||||||
className={styles.checkIcon}
|
className={styles.checkIcon}
|
||||||
color="Icon/Interactive/Accent"
|
color="Icon/Interactive/Accent"
|
||||||
/>
|
/>
|
||||||
{reward.label}
|
{reward.label}
|
||||||
</Caption>
|
</p>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
</Typography>
|
||||||
</article>
|
</article>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.levelText {
|
.levelText {
|
||||||
|
color: var(--Text-Secondary);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
import { motion } from "motion/react"
|
import { motion } from "motion/react"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import styles from "./redeem.module.css"
|
import styles from "./redeem.module.css"
|
||||||
|
|
||||||
@@ -25,12 +25,14 @@ export default function ActiveRedeemedBadge() {
|
|||||||
>
|
>
|
||||||
<MaterialIcon icon="check_circle" color="Icon/Feedback/Success" />
|
<MaterialIcon icon="check_circle" color="Icon/Feedback/Success" />
|
||||||
</motion.div>
|
</motion.div>
|
||||||
<Caption>
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "rewards.active",
|
id: "rewards.active",
|
||||||
defaultMessage: "Active",
|
defaultMessage: "Active",
|
||||||
})}
|
})}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
||||||
import { toast } from "@scandic-hotels/design-system/Toast"
|
import { toast } from "@scandic-hotels/design-system/Toast"
|
||||||
@@ -31,15 +30,17 @@ export default function Campaign({ reward }: { reward: Campaign }) {
|
|||||||
<p>{reward.description}</p>
|
<p>{reward.description}</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
<div className={styles.rewardBadge}>
|
<div className={styles.rewardBadge}>
|
||||||
<Caption textAlign="center" color="uiTextHighContrast" type="bold">
|
<Typography variant="Body/Supporting text (caption)/smBold">
|
||||||
|
<p>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "redeemFlow.promoCode",
|
id: "redeemFlow.promoCode",
|
||||||
defaultMessage: "Promo code",
|
defaultMessage: "Promo code",
|
||||||
})}
|
})}
|
||||||
</Caption>
|
</p>
|
||||||
<Caption textAlign="center" color="uiTextHighContrast">
|
</Typography>
|
||||||
{reward.operaRewardId}
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
</Caption>
|
<p>{reward.operaRewardId}</p>
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<footer className={styles.modalFooter}>
|
<footer className={styles.modalFooter}>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import styles from "./redeem.module.css"
|
import styles from "./redeem.module.css"
|
||||||
|
|
||||||
@@ -12,8 +12,8 @@ export default function MembershipNumberBadge({
|
|||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.rewardBadge}>
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
<Caption textAlign="center" color="uiTextHighContrast">
|
<span className={styles.rewardBadge}>
|
||||||
{intl.formatMessage(
|
{intl.formatMessage(
|
||||||
{
|
{
|
||||||
id: "rewards.membershipId",
|
id: "rewards.membershipId",
|
||||||
@@ -21,7 +21,7 @@ export default function MembershipNumberBadge({
|
|||||||
},
|
},
|
||||||
{ id: membershipNumber }
|
{ id: membershipNumber }
|
||||||
)}
|
)}
|
||||||
</Caption>
|
</span>
|
||||||
</div>
|
</Typography>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { dt } from "@scandic-hotels/common/dt"
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import Countdown from "@/components/Countdown"
|
import Countdown from "@/components/Countdown"
|
||||||
|
|
||||||
@@ -21,12 +21,14 @@ export default function TimedRedeemedBadge() {
|
|||||||
<>
|
<>
|
||||||
<div className={styles.redeemed}>
|
<div className={styles.redeemed}>
|
||||||
<MaterialIcon icon="check_circle" color="Icon/Feedback/Success" />
|
<MaterialIcon icon="check_circle" color="Icon/Feedback/Success" />
|
||||||
<Caption>
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "rewards.redeemed.validThrough",
|
id: "rewards.redeemed.validThrough",
|
||||||
defaultMessage: "Redeemed & valid through:",
|
defaultMessage: "Redeemed & valid through:",
|
||||||
})}
|
})}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
<Countdown
|
<Countdown
|
||||||
minutes={duration.minutes()}
|
minutes={duration.minutes()}
|
||||||
|
|||||||
@@ -129,6 +129,7 @@
|
|||||||
background: var(--Base-Surface-Secondary-light-Normal);
|
background: var(--Base-Surface-Secondary-light-Normal);
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--Space-x05);
|
gap: var(--Space-x05);
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.redeemButton {
|
.redeemButton {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { dt } from "@scandic-hotels/common/dt"
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import Image from "@scandic-hotels/design-system/Image"
|
import Image from "@scandic-hotels/design-system/Image"
|
||||||
import Link from "@scandic-hotels/design-system/OldDSLink"
|
import Link from "@scandic-hotels/design-system/OldDSLink"
|
||||||
@@ -62,14 +61,14 @@ function CardContent({ stay }: StayCardProps) {
|
|||||||
icon="calendar_month"
|
icon="calendar_month"
|
||||||
color="Icon/Interactive/Default"
|
color="Icon/Interactive/Default"
|
||||||
/>
|
/>
|
||||||
<Caption asChild>
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
<time dateTime={arrivalDateTime}>{arrivalDate}</time>
|
<time dateTime={arrivalDateTime}>{arrivalDate}</time>
|
||||||
</Caption>
|
|
||||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||||
{" - "}
|
{" - "}
|
||||||
<Caption asChild>
|
|
||||||
<time dateTime={departDateTime}>{departDate}</time>
|
<time dateTime={departDateTime}>{departDate}</time>
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -6,10 +6,9 @@ import { useIntl } from "react-intl"
|
|||||||
|
|
||||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
import { dt } from "@scandic-hotels/common/dt"
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
import { Button } from "@scandic-hotels/design-system/Button"
|
||||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import useLang from "@/hooks/useLang"
|
import useLang from "@/hooks/useLang"
|
||||||
@@ -115,19 +114,15 @@ export default function DatePickerSingleDesktop({
|
|||||||
/>
|
/>
|
||||||
<footer className={props.className}>
|
<footer className={props.className}>
|
||||||
<Button
|
<Button
|
||||||
intent="tertiary"
|
variant="Tertiary"
|
||||||
onPress={close}
|
onPress={close}
|
||||||
size="small"
|
color="Primary"
|
||||||
theme="base"
|
size="sm"
|
||||||
>
|
>
|
||||||
<Caption color="white" type="bold" asChild>
|
|
||||||
<span>
|
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "datePicker.selectDates",
|
id: "datePicker.selectDates",
|
||||||
defaultMessage: "Select dates",
|
defaultMessage: "Select dates",
|
||||||
})}
|
})}
|
||||||
</span>
|
|
||||||
</Caption>
|
|
||||||
</Button>
|
</Button>
|
||||||
</footer>
|
</footer>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import styles from "./priceContainer.module.css"
|
import styles from "./priceContainer.module.css"
|
||||||
@@ -23,15 +22,17 @@ export default function PriceContainer({
|
|||||||
return (
|
return (
|
||||||
<div className={styles.priceContainer}>
|
<div className={styles.priceContainer}>
|
||||||
<div className={styles.info}>
|
<div className={styles.info}>
|
||||||
<Caption color="uiTextHighContrast" type="bold">
|
<Typography variant="Body/Supporting text (caption)/smBold">
|
||||||
{text}
|
<p>{text}</p>
|
||||||
</Caption>
|
</Typography>
|
||||||
<Caption color="uiTextHighContrast">
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||||
{nightsText}, {adultsText}
|
{nightsText}, {adultsText}
|
||||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||||
{totalChildren > 0 ? `, ${childrenText}` : ""}
|
{totalChildren > 0 ? `, ${childrenText}` : ""}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.wrapper}>
|
<div className={styles.wrapper}>
|
||||||
<Typography variant="Title/Subtitle/md">
|
<Typography variant="Title/Subtitle/md">
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import Image from "next/image"
|
import Image from "next/image"
|
||||||
|
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import { JsonToHtml } from "@scandic-hotels/design-system/JsonToHtml"
|
import { JsonToHtml } from "@scandic-hotels/design-system/JsonToHtml"
|
||||||
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
||||||
@@ -129,7 +128,7 @@ function TierDetails({
|
|||||||
<div className={styles.tierInfo}>
|
<div className={styles.tierInfo}>
|
||||||
<div className={styles.tierTitle}>
|
<div className={styles.tierTitle}>
|
||||||
<Typography variant="Title/Subtitle/md">
|
<Typography variant="Title/Subtitle/md">
|
||||||
<p className={styles.title}>{tierMatch.title}</p>
|
<p className={styles.tierMatch}>{tierMatch.title}</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
<div>{children}</div>
|
<div>{children}</div>
|
||||||
@@ -162,9 +161,9 @@ function ReadMoreLink({
|
|||||||
function ColumnTitle({ children }: { children?: ReactNode }) {
|
function ColumnTitle({ children }: { children?: ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.columnTitle}>
|
<div className={styles.columnTitle}>
|
||||||
<Caption type="bold" asChild>
|
<Typography variant="Title/Overline/sm">
|
||||||
<span>{children}</span>
|
<span>{children}</span>
|
||||||
</Caption>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,10 +36,6 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
|
||||||
color: var(--Text-Heading);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tierDetails {
|
.tierDetails {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: var(--Base-Surface-Primary-light-Normal);
|
background-color: var(--Base-Surface-Primary-light-Normal);
|
||||||
@@ -114,6 +110,11 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tierMatch {
|
||||||
|
text-align: left;
|
||||||
|
color: var(--Text-Heading);
|
||||||
|
}
|
||||||
|
|
||||||
.tierTitles {
|
.tierTitles {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: var(--Space-x05);
|
padding: var(--Space-x05);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||||
import Image from "@scandic-hotels/design-system/Image"
|
import Image from "@scandic-hotels/design-system/Image"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
@@ -76,9 +75,9 @@ export function AncillaryCard({ ancillary }: AncillaryCardProps) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{ancillary.description && (
|
{ancillary.description && (
|
||||||
<Caption asChild color="uiTextHighContrast">
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
<div dangerouslySetInnerHTML={{ __html: ancillary.description }} />
|
<div dangerouslySetInnerHTML={{ __html: ancillary.description }} />
|
||||||
</Caption>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
.button {
|
.button {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
color: var(--Component-Button-Brand-Secondary-On-fill-Default);
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: var(--Corner-radius-md);
|
border-radius: var(--Corner-radius-md);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import { buttonVariants } from "./variants"
|
import { buttonVariants } from "./variants"
|
||||||
|
|
||||||
import type { SearchListProps } from ".."
|
import type { SearchListProps } from ".."
|
||||||
|
|
||||||
interface ClearSearchButtonProps
|
interface ClearSearchButtonProps extends Pick<
|
||||||
extends Pick<
|
|
||||||
SearchListProps,
|
SearchListProps,
|
||||||
"getItemProps" | "handleClearSearchHistory" | "highlightedIndex"
|
"getItemProps" | "handleClearSearchHistory" | "highlightedIndex"
|
||||||
> {
|
> {
|
||||||
@@ -41,14 +40,14 @@ export default function ClearSearchButton({
|
|||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<MaterialIcon icon="delete" color="Icon/Interactive/Default" size={20} />
|
<MaterialIcon icon="delete" color="Icon/Interactive/Default" size={20} />
|
||||||
<Caption color="burgundy" type="bold" asChild>
|
<Typography variant="Body/Supporting text (caption)/smBold">
|
||||||
<span>
|
<span>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "bookingWidget.search.clearSearches",
|
id: "bookingWidget.search.clearSearches",
|
||||||
defaultMessage: "Clear searches",
|
defaultMessage: "Clear searches",
|
||||||
})}
|
})}
|
||||||
</span>
|
</span>
|
||||||
</Caption>
|
</Typography>
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { useFormContext } from "react-hook-form"
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
import { useDebounceValue } from "usehooks-ts"
|
import { useDebounceValue } from "usehooks-ts"
|
||||||
|
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||||
import Footnote from "@scandic-hotels/design-system/Footnote"
|
import Footnote from "@scandic-hotels/design-system/Footnote"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
@@ -306,10 +305,15 @@ function SearchListError({
|
|||||||
getMenuProps={getMenuProps}
|
getMenuProps={getMenuProps}
|
||||||
variant="error"
|
variant="error"
|
||||||
>
|
>
|
||||||
<Caption className={styles.heading} color="red">
|
<Typography
|
||||||
|
variant="Body/Supporting text (caption)/smBold"
|
||||||
|
className={styles.heading}
|
||||||
|
>
|
||||||
|
<p>
|
||||||
<MaterialIcon icon="error" color="Icon/Interactive/Accent" />
|
<MaterialIcon icon="error" color="Icon/Interactive/Accent" />
|
||||||
{caption}
|
{caption}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
className={styles.errorBody}
|
className={styles.errorBody}
|
||||||
variant="Body/Paragraph/mdRegular"
|
variant="Body/Paragraph/mdRegular"
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: var(--Space-x1);
|
gap: var(--Space-x1);
|
||||||
|
color: var(--Text-Interactive-Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
import { cx } from "class-variance-authority"
|
import { cx } from "class-variance-authority"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer"
|
import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer"
|
||||||
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import { useBookingFlowConfig } from "../../../../../bookingFlowConfig/bookingFlowConfigContext"
|
import { useBookingFlowConfig } from "../../../../../bookingFlowConfig/bookingFlowConfigContext"
|
||||||
import BookingCode from "../BookingCode"
|
import BookingCode from "../BookingCode"
|
||||||
@@ -43,30 +43,25 @@ export function VoucherSkeleton() {
|
|||||||
<div className={styles.optionsContainer}>
|
<div className={styles.optionsContainer}>
|
||||||
{config.bookingCodeEnabled && (
|
{config.bookingCodeEnabled && (
|
||||||
<div className={styles.voucherSkeletonContainer}>
|
<div className={styles.voucherSkeletonContainer}>
|
||||||
<label>
|
<Typography variant="Body/Supporting text (caption)/smBold">
|
||||||
<Caption type="bold" color="red" asChild>
|
<label>{vouchers}</label>
|
||||||
<span>{vouchers}</span>
|
</Typography>
|
||||||
</Caption>
|
|
||||||
</label>
|
|
||||||
<SkeletonShimmer width="100%" display="block" />
|
<SkeletonShimmer width="100%" display="block" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
<div className={styles.options}>
|
<div className={styles.options}>
|
||||||
<div className={cx(styles.option, styles.showOnTablet)}>
|
<div className={cx(styles.option, styles.showOnTablet)}>
|
||||||
<SkeletonShimmer width="24px" height="24px" />
|
<SkeletonShimmer width="24px" height="24px" />
|
||||||
<Caption color="uiTextMediumContrast" asChild>
|
{vouchers}
|
||||||
<span>{vouchers}</span>
|
|
||||||
</Caption>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.option}>
|
<div className={styles.option}>
|
||||||
<SkeletonShimmer width="24px" height="24px" />
|
<SkeletonShimmer width="24px" height="24px" />
|
||||||
<Caption color="uiTextMediumContrast" asChild>
|
{reward}
|
||||||
<span>{reward}</span>
|
|
||||||
</Caption>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
gap: var(--Space-x2);
|
gap: var(--Space-x2);
|
||||||
margin-top: var(--Space-x2);
|
margin-top: var(--Space-x2);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
color: var(--Text-Secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.optionsContainer {
|
.optionsContainer {
|
||||||
@@ -18,6 +19,7 @@
|
|||||||
}
|
}
|
||||||
.voucherSkeletonContainer {
|
.voucherSkeletonContainer {
|
||||||
padding: var(--Space-x1) var(--Space-x15);
|
padding: var(--Space-x1) var(--Space-x15);
|
||||||
|
color: var(--Text-Secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.checkbox {
|
.checkbox {
|
||||||
|
|||||||
@@ -3,3 +3,7 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
color: var(--Text-Default);
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
import { useFormContext } from "react-hook-form"
|
import { useFormContext } from "react-hook-form"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import Stepper from "@scandic-hotels/design-system/Stepper"
|
import Stepper from "@scandic-hotels/design-system/Stepper"
|
||||||
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import styles from "./adult-selector.module.css"
|
import styles from "./adult-selector.module.css"
|
||||||
|
|
||||||
@@ -38,9 +38,12 @@ export default function AdultSelector({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<section className={styles.container}>
|
<section className={styles.container}>
|
||||||
<Caption color="uiTextHighContrast" type="bold">
|
<Typography
|
||||||
{adultsLabel}
|
variant="Body/Supporting text (caption)/smBold"
|
||||||
</Caption>
|
className={styles.label}
|
||||||
|
>
|
||||||
|
<p>{adultsLabel}</p>
|
||||||
|
</Typography>
|
||||||
<Stepper
|
<Stepper
|
||||||
count={currentAdults}
|
count={currentAdults}
|
||||||
handleOnDecrease={decreaseAdultsCount}
|
handleOnDecrease={decreaseAdultsCount}
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.captionBold {
|
.label {
|
||||||
font-weight: 600;
|
color: var(--Text-Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
.childInfoContainer {
|
.childInfoContainer {
|
||||||
|
|||||||
@@ -55,7 +55,10 @@ export default function ChildSelector({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<section className={styles.container}>
|
<section className={styles.container}>
|
||||||
<Typography variant="Body/Supporting text (caption)/smBold">
|
<Typography
|
||||||
|
variant="Body/Supporting text (caption)/smBold"
|
||||||
|
className={styles.label}
|
||||||
|
>
|
||||||
<p>{childrenLabel}</p>
|
<p>{childrenLabel}</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Stepper
|
<Stepper
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.roomHeading {
|
.roomHeading {
|
||||||
|
color: var(--Text-Default);
|
||||||
margin-bottom: var(--Space-x1);
|
margin-bottom: var(--Space-x1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import {
|
|||||||
} from "react-hook-form"
|
} from "react-hook-form"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import DateSelect from "@scandic-hotels/design-system/Form/Date"
|
import DateSelect from "@scandic-hotels/design-system/Form/Date"
|
||||||
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import { useBookingFlowConfig } from "../../../../../bookingFlowConfig/bookingFlowConfigContext"
|
import { useBookingFlowConfig } from "../../../../../bookingFlowConfig/bookingFlowConfigContext"
|
||||||
import useLang from "../../../../../hooks/useLang"
|
import useLang from "../../../../../hooks/useLang"
|
||||||
@@ -70,14 +70,14 @@ export default function Signup({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<header>
|
<header>
|
||||||
<Caption type="bold">
|
<Typography variant="Body/Supporting text (caption)/smBold">
|
||||||
<span className={styles.required}>
|
<span className={styles.required}>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "common.birthDate",
|
id: "common.birthDate",
|
||||||
defaultMessage: "Birth date",
|
defaultMessage: "Birth date",
|
||||||
})}
|
})}
|
||||||
</span>
|
</span>
|
||||||
</Caption>
|
</Typography>
|
||||||
</header>
|
</header>
|
||||||
<DateSelect
|
<DateSelect
|
||||||
labels={{
|
labels={{
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import React from "react"
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -115,14 +114,11 @@ function PaymentCard({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.card}>
|
<div className={styles.card}>
|
||||||
<Caption
|
<Typography variant="Tag/sm">
|
||||||
type="bold"
|
<p>
|
||||||
textTransform="uppercase"
|
|
||||||
className={styles.cardTitle}
|
|
||||||
>
|
|
||||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||||
{title}{" "}
|
{title}{" "}
|
||||||
<span>
|
<span className={styles.roomInfo}>
|
||||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||||
{"/ "}
|
{"/ "}
|
||||||
{intl.formatMessage(
|
{intl.formatMessage(
|
||||||
@@ -135,7 +131,8 @@ function PaymentCard({
|
|||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
<Typography variant="Body/Paragraph/mdBold" className={styles.priceItem}>
|
<Typography variant="Body/Paragraph/mdBold" className={styles.priceItem}>
|
||||||
<p>
|
<p>
|
||||||
{formatPrice(intl, price, currency)}
|
{formatPrice(intl, price, currency)}
|
||||||
|
|||||||
@@ -13,12 +13,8 @@
|
|||||||
border-radius: var(--Corner-radius-md);
|
border-radius: var(--Corner-radius-md);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cardTitle {
|
.roomInfo {
|
||||||
text-transform: uppercase;
|
color: var(--Text-Tertiary);
|
||||||
}
|
|
||||||
|
|
||||||
.cardTitle > span {
|
|
||||||
color: var(--UI-Text-Placeholder);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card.inactive {
|
.card.inactive {
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import {
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
||||||
@@ -107,21 +106,28 @@ export default function PriceChangeSummary({
|
|||||||
<p>{room.roomType}</p>
|
<p>{room.roomType}</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
<div className={styles.priceRow}>
|
<div className={styles.priceRow}>
|
||||||
<Caption color="uiTextMediumContrast">
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "priceDetails.roomCharge",
|
id: "priceDetails.roomCharge",
|
||||||
defaultMessage: "Room charge",
|
defaultMessage: "Room charge",
|
||||||
})}
|
})}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
{newPrice ? (
|
{newPrice ? (
|
||||||
<div className={styles.updatedPrice}>
|
<div className={styles.updatedPrice}>
|
||||||
<Caption color="uiTextMediumContrast" striked>
|
<Typography
|
||||||
|
variant="Body/Supporting text (caption)/smRegular"
|
||||||
|
className={styles.prevPrice}
|
||||||
|
>
|
||||||
|
<p>
|
||||||
{formatPrice(
|
{formatPrice(
|
||||||
intl,
|
intl,
|
||||||
room.roomPrice.perStay.local.price,
|
room.roomPrice.perStay.local.price,
|
||||||
room.roomPrice.perStay.local.currency
|
room.roomPrice.perStay.local.currency
|
||||||
)}
|
)}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
<Typography variant="Body/Paragraph/mdBold">
|
<Typography variant="Body/Paragraph/mdBold">
|
||||||
<p>
|
<p>
|
||||||
{formatPrice(
|
{formatPrice(
|
||||||
@@ -133,24 +139,29 @@ export default function PriceChangeSummary({
|
|||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<Caption color="uiTextMediumContrast">
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
{formatPrice(
|
{formatPrice(
|
||||||
intl,
|
intl,
|
||||||
room.roomPrice.perStay.local.price,
|
room.roomPrice.perStay.local.price,
|
||||||
room.roomPrice.perStay.local.currency
|
room.roomPrice.perStay.local.currency
|
||||||
)}
|
)}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{room.breakfast && (
|
{room.breakfast && (
|
||||||
<div className={styles.priceRow}>
|
<div className={styles.priceRow}>
|
||||||
<Caption color="uiTextMediumContrast">
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "enterDetails.priceChangeDialog.breakfastCharge",
|
id: "enterDetails.priceChangeDialog.breakfastCharge",
|
||||||
defaultMessage: "Breakfast charge",
|
defaultMessage: "Breakfast charge",
|
||||||
})}
|
})}
|
||||||
</Caption>
|
</p>
|
||||||
<Caption color="uiTextMediumContrast">
|
</Typography>
|
||||||
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
{formatPrice(
|
{formatPrice(
|
||||||
intl,
|
intl,
|
||||||
Number(
|
Number(
|
||||||
@@ -158,7 +169,8 @@ export default function PriceChangeSummary({
|
|||||||
),
|
),
|
||||||
room.breakfast.localPrice.currency
|
room.breakfast.localPrice.currency
|
||||||
)}
|
)}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{room.roomFeatures?.map((feature) => (
|
{room.roomFeatures?.map((feature) => (
|
||||||
@@ -166,20 +178,24 @@ export default function PriceChangeSummary({
|
|||||||
className={styles.priceRow}
|
className={styles.priceRow}
|
||||||
key={feature.itemCode}
|
key={feature.itemCode}
|
||||||
>
|
>
|
||||||
<Caption color="uiTextMediumContrast">
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
{getRoomFeatureDescription(
|
{getRoomFeatureDescription(
|
||||||
feature.code,
|
feature.code,
|
||||||
feature.description,
|
feature.description,
|
||||||
intl
|
intl
|
||||||
)}
|
)}
|
||||||
</Caption>
|
</p>
|
||||||
<Caption color="uiTextMediumContrast">
|
</Typography>
|
||||||
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
{formatPrice(
|
{formatPrice(
|
||||||
intl,
|
intl,
|
||||||
Number(feature.localPrice.totalPrice),
|
Number(feature.localPrice.totalPrice),
|
||||||
feature.localPrice.currency
|
feature.localPrice.currency
|
||||||
)}
|
)}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -59,6 +59,10 @@
|
|||||||
color: var(--UI-Text-Medium-contrast);
|
color: var(--UI-Text-Medium-contrast);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.prevPrice {
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
|
||||||
.updatedPrice {
|
.updatedPrice {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { Dialog, Modal, ModalOverlay } from "react-aria-components"
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
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 { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
@@ -131,9 +130,12 @@ export default function PriceChangeDialog({
|
|||||||
</p>
|
</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
<div className={styles.prices}>
|
<div className={styles.prices}>
|
||||||
<Caption striked>
|
<Typography
|
||||||
{formatPrice(intl, prevTotalPrice, currency)}
|
variant="Body/Supporting text (caption)/smRegular"
|
||||||
</Caption>
|
className={styles.prevPrice}
|
||||||
|
>
|
||||||
|
<p>{formatPrice(intl, prevTotalPrice, currency)}</p>
|
||||||
|
</Typography>
|
||||||
<Typography variant="Body/Paragraph/mdBold">
|
<Typography variant="Body/Paragraph/mdBold">
|
||||||
<p style={{ textAlign: "center" }}>
|
<p style={{ textAlign: "center" }}>
|
||||||
{formatPrice(intl, newTotalPrice, currency)}
|
{formatPrice(intl, newTotalPrice, currency)}
|
||||||
|
|||||||
@@ -63,6 +63,10 @@
|
|||||||
width: 100dvw;
|
width: 100dvw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.prevPrice {
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useState } from "react"
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { selectRate } from "@scandic-hotels/common/constants/routes/hotelReservation"
|
import { selectRate } from "@scandic-hotels/common/constants/routes/hotelReservation"
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
||||||
import { FacilityToIcon } from "@scandic-hotels/design-system/FacilityToIcon"
|
import { FacilityToIcon } from "@scandic-hotels/design-system/FacilityToIcon"
|
||||||
import { HotelCardDialogImage } from "@scandic-hotels/design-system/HotelCard/HotelCardDialogImage"
|
import { HotelCardDialogImage } from "@scandic-hotels/design-system/HotelCard/HotelCardDialogImage"
|
||||||
import { HotelPointsRow } from "@scandic-hotels/design-system/HotelCard/HotelPointsRow"
|
import { HotelPointsRow } from "@scandic-hotels/design-system/HotelCard/HotelPointsRow"
|
||||||
@@ -61,6 +61,20 @@ export default function ListingHotelCardDialog({
|
|||||||
defaultMessage: "Not enough points",
|
defaultMessage: "Not enough points",
|
||||||
})
|
})
|
||||||
const shouldShowNotEnoughPoints = redemptionPrice && !hasEnoughPoints
|
const shouldShowNotEnoughPoints = redemptionPrice && !hasEnoughPoints
|
||||||
|
const label = redemptionPrice
|
||||||
|
? intl.formatMessage({
|
||||||
|
id: "hotelCard.availableRates",
|
||||||
|
defaultMessage: "Available rates",
|
||||||
|
})
|
||||||
|
: chequePrice || voucherPrice
|
||||||
|
? intl.formatMessage({
|
||||||
|
id: "common.from",
|
||||||
|
defaultMessage: "From",
|
||||||
|
})
|
||||||
|
: intl.formatMessage({
|
||||||
|
id: "listingHotelCardDialog.perNightFrom",
|
||||||
|
defaultMessage: "Per night from",
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
@@ -112,21 +126,10 @@ export default function ListingHotelCardDialog({
|
|||||||
chequePrice ? (
|
chequePrice ? (
|
||||||
<div className={styles.bottomContainer}>
|
<div className={styles.bottomContainer}>
|
||||||
<div className={styles.pricesContainer}>
|
<div className={styles.pricesContainer}>
|
||||||
{redemptionPrice ? (
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
<Caption color="uiTextHighContrast">
|
<p>{label}</p>
|
||||||
{intl.formatMessage({
|
</Typography>
|
||||||
id: "hotelCard.availableRates",
|
|
||||||
defaultMessage: "Available rates",
|
|
||||||
})}
|
|
||||||
</Caption>
|
|
||||||
) : (
|
|
||||||
<Caption color="uiTextHighContrast">
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: "listingHotelCardDialog.perNightFrom",
|
|
||||||
defaultMessage: "Per night from",
|
|
||||||
})}
|
|
||||||
</Caption>
|
|
||||||
)}
|
|
||||||
<div className={styles.listingPrices}>
|
<div className={styles.listingPrices}>
|
||||||
{publicPrice && !isUserLoggedIn ? (
|
{publicPrice && !isUserLoggedIn ? (
|
||||||
<>
|
<>
|
||||||
@@ -135,8 +138,15 @@ export default function ListingHotelCardDialog({
|
|||||||
{publicPrice} {currency}
|
{publicPrice} {currency}
|
||||||
</p>
|
</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
|
{memberPrice && (
|
||||||
|
<Typography
|
||||||
|
variant="Body/Supporting text (caption)/smRegular"
|
||||||
|
className={styles.divider}
|
||||||
|
>
|
||||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||||
{memberPrice && <Caption>/</Caption>}
|
<p>/</p>
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
bookingCode &&
|
bookingCode &&
|
||||||
@@ -206,44 +216,12 @@ export default function ListingHotelCardDialog({
|
|||||||
: null}
|
: null}
|
||||||
</span>
|
</span>
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Typography variant="Body/Paragraph/mdRegular">
|
|
||||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
|
||||||
<span>
|
|
||||||
/
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: "common.night",
|
|
||||||
defaultMessage: "night",
|
|
||||||
})}
|
|
||||||
</span>
|
|
||||||
</Typography>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{voucherPrice && (
|
{voucherPrice && (
|
||||||
<>
|
<>
|
||||||
<Typography variant="Title/Subtitle/md">
|
<Typography variant="Title/Subtitle/md">
|
||||||
<p>
|
<p>{formatPrice(intl, voucherPrice, currency)}</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>
|
|
||||||
/
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: "common.night",
|
|
||||||
defaultMessage: "night",
|
|
||||||
})}
|
|
||||||
</span>
|
|
||||||
</Typography>
|
</Typography>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
gap: var(--Space-x15);
|
gap: var(--Space-x15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.divider {
|
||||||
|
color: var(--Text-Tertiary);
|
||||||
|
}
|
||||||
.red {
|
.red {
|
||||||
color: var(--Text-Accent-Primary);
|
color: var(--Text-Accent-Primary);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ import { useIntl } from "react-intl"
|
|||||||
|
|
||||||
import { RateEnum } from "@scandic-hotels/common/constants/rate"
|
import { RateEnum } from "@scandic-hotels/common/constants/rate"
|
||||||
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
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 { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
@@ -148,7 +146,12 @@ export function DesktopSummary({
|
|||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Caption color="uiTextMediumContrast">{summaryPriceText}</Caption>
|
<Typography
|
||||||
|
variant="Body/Supporting text (caption)/smRegular"
|
||||||
|
className={styles.secondaryText}
|
||||||
|
>
|
||||||
|
<p>{summaryPriceText}</p>
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.summaryPrice}>
|
<div className={styles.summaryPrice}>
|
||||||
<div className={styles.summaryPriceTextDesktop}>
|
<div className={styles.summaryPriceTextDesktop}>
|
||||||
@@ -169,17 +172,18 @@ export function DesktopSummary({
|
|||||||
</p>
|
</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
{showDiscounted && selectedRates.totalPrice.local.regularPrice && (
|
{showDiscounted && selectedRates.totalPrice.local.regularPrice && (
|
||||||
<Caption
|
<Typography
|
||||||
textAlign="right"
|
variant="Body/Supporting text (caption)/smRegular"
|
||||||
color="uiTextMediumContrast"
|
className={styles.regularPrice}
|
||||||
striked={true}
|
|
||||||
>
|
>
|
||||||
|
<p>
|
||||||
{formatPrice(
|
{formatPrice(
|
||||||
intl,
|
intl,
|
||||||
selectedRates.totalPrice.local.regularPrice,
|
selectedRates.totalPrice.local.regularPrice,
|
||||||
selectedRates.totalPrice.local.currency
|
selectedRates.totalPrice.local.currency
|
||||||
)}
|
)}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
)}
|
)}
|
||||||
{!!selectedRates.totalPrice.requested && (
|
{!!selectedRates.totalPrice.requested && (
|
||||||
<Typography
|
<Typography
|
||||||
@@ -207,34 +211,6 @@ export function DesktopSummary({
|
|||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.summaryPriceTextMobile}>
|
|
||||||
<Caption color="uiTextHighContrast">
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: "common.totalPrice",
|
|
||||||
defaultMessage: "Total price",
|
|
||||||
})}
|
|
||||||
</Caption>
|
|
||||||
<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}
|
|
||||||
>
|
|
||||||
{summaryPriceText}
|
|
||||||
</Footnote>
|
|
||||||
</div>
|
|
||||||
<Button
|
<Button
|
||||||
className={styles.continueButton}
|
className={styles.continueButton}
|
||||||
disabled={!isAllRoomsSelected || isSubmitting}
|
disabled={!isAllRoomsSelected || isSubmitting}
|
||||||
@@ -308,15 +284,15 @@ function RateSummary({
|
|||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography
|
<Typography variant="Body/Paragraph/mdRegular">
|
||||||
variant="Body/Paragraph/mdRegular"
|
|
||||||
className={styles.uiTextMediumContrast}
|
|
||||||
>
|
|
||||||
<p>{room.roomInfo.roomType}</p>
|
<p>{room.roomInfo.roomType}</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Caption color="uiTextMediumContrast">
|
<Typography
|
||||||
{getRateDetails(room.rate)}
|
variant="Body/Paragraph/mdRegular"
|
||||||
</Caption>
|
className={styles.secondaryText}
|
||||||
|
>
|
||||||
|
<p>{getRateDetails(room.rate)}</p>
|
||||||
|
</Typography>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
@@ -325,7 +301,7 @@ function RateSummary({
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
variant="Body/Paragraph/mdRegular"
|
variant="Body/Paragraph/mdRegular"
|
||||||
className={styles.uiTextMediumContrast}
|
className={styles.secondaryText}
|
||||||
>
|
>
|
||||||
<p>{getRateDetails(room.rate)}</p>
|
<p>{getRateDetails(room.rate)}</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -41,6 +41,12 @@
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.regularPrice {
|
||||||
|
color: var(--Text-Secondary);
|
||||||
|
text-decoration: line-through;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
.red {
|
.red {
|
||||||
color: var(--Text-Accent-Primary);
|
color: var(--Text-Accent-Primary);
|
||||||
}
|
}
|
||||||
@@ -77,10 +83,6 @@
|
|||||||
min-width: 140px;
|
min-width: 140px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.summaryPriceTextMobile {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mobileSummary {
|
.mobileSummary {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
@@ -89,8 +91,8 @@
|
|||||||
color: var(--Text-Tertiary);
|
color: var(--Text-Tertiary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.uiTextMediumContrast {
|
.secondaryText {
|
||||||
color: var(--UI-Text-Medium-contrast);
|
color: var(--Text-Secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1367px) {
|
@media (min-width: 1367px) {
|
||||||
@@ -120,10 +122,6 @@
|
|||||||
gap: var(--Space-x2);
|
gap: var(--Space-x2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.summaryPriceTextMobile {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.summaryPrice,
|
.summaryPrice,
|
||||||
.continueButton {
|
.continueButton {
|
||||||
width: auto;
|
width: auto;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { useIntl } from "react-intl"
|
|||||||
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||||
import { RateEnum } from "@scandic-hotels/common/constants/rate"
|
import { RateEnum } from "@scandic-hotels/common/constants/rate"
|
||||||
import { logger } from "@scandic-hotels/common/logger"
|
import { logger } from "@scandic-hotels/common/logger"
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { ChipButton } from "@scandic-hotels/design-system/ChipButton"
|
import { ChipButton } from "@scandic-hotels/design-system/ChipButton"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import Image from "@scandic-hotels/design-system/Image"
|
import Image from "@scandic-hotels/design-system/Image"
|
||||||
@@ -49,12 +48,14 @@ export function SelectedRoomPanel({ roomIndex }: { roomIndex: number }) {
|
|||||||
return (
|
return (
|
||||||
<div className={styles.selectedRoomPanel}>
|
<div className={styles.selectedRoomPanel}>
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
<Caption color="uiTextHighContrast">
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
{intl.formatMessage(
|
{intl.formatMessage(
|
||||||
{ id: "booking.roomIndex", defaultMessage: "Room {roomIndex}" },
|
{ id: "booking.roomIndex", defaultMessage: "Room {roomIndex}" },
|
||||||
{ roomIndex: roomNr }
|
{ roomIndex: roomNr }
|
||||||
)}
|
)}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
<Typography variant="Title/Subtitle/md" className={styles.subtitle}>
|
<Typography variant="Title/Subtitle/md" className={styles.subtitle}>
|
||||||
<p>{selectedRate.roomInfo.roomType}</p>
|
<p>{selectedRate.roomInfo.roomType}</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import styles from "./notAvailable.module.css"
|
import styles from "./notAvailable.module.css"
|
||||||
|
|
||||||
@@ -12,12 +12,14 @@ export default function RoomNotAvailable() {
|
|||||||
<div className={styles.noRoomsContainer}>
|
<div className={styles.noRoomsContainer}>
|
||||||
<div className={styles.noRooms}>
|
<div className={styles.noRooms}>
|
||||||
<MaterialIcon icon="dangerous" color="Icon/Feedback/Error" size={16} />
|
<MaterialIcon icon="dangerous" color="Icon/Feedback/Error" size={16} />
|
||||||
<Caption color="uiTextHighContrast" type="bold">
|
<Typography variant="Body/Paragraph/mdRegular">
|
||||||
|
<p>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "selectRate.thisRoomIsNotAvailable",
|
id: "selectRate.thisRoomIsNotAvailable",
|
||||||
defaultMessage: "This room is not available",
|
defaultMessage: "This room is not available",
|
||||||
})}
|
})}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,4 +5,5 @@
|
|||||||
gap: var(--Space-x1);
|
gap: var(--Space-x1);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: var(--Space-x2);
|
padding: var(--Space-x2);
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
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 Footnote from "@scandic-hotels/design-system/Footnote"
|
||||||
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import { useBookingFlowConfig } from "../../bookingFlowConfig/bookingFlowConfigContext"
|
import { useBookingFlowConfig } from "../../bookingFlowConfig/bookingFlowConfigContext"
|
||||||
|
|
||||||
@@ -63,9 +63,12 @@ function Message({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
span: (str) => (
|
span: (str) => (
|
||||||
<Caption color="red" type="bold" asChild>
|
<Typography
|
||||||
|
variant="Body/Supporting text (caption)/smBold"
|
||||||
|
className={styles.red}
|
||||||
|
>
|
||||||
<span>{str}</span>
|
<span>{str}</span>
|
||||||
</Caption>
|
</Typography>
|
||||||
),
|
),
|
||||||
price,
|
price,
|
||||||
}
|
}
|
||||||
@@ -81,9 +84,12 @@ function Message({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
span: (str) => (
|
span: (str) => (
|
||||||
<Caption color="red" type="bold" asChild>
|
<Typography
|
||||||
|
variant="Body/Supporting text (caption)/smBold"
|
||||||
|
className={styles.red}
|
||||||
|
>
|
||||||
<span>{str}</span>
|
<span>{str}</span>
|
||||||
</Caption>
|
</Typography>
|
||||||
),
|
),
|
||||||
price,
|
price,
|
||||||
}
|
}
|
||||||
@@ -98,9 +104,12 @@ function Message({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
span: (str) => (
|
span: (str) => (
|
||||||
<Caption color="red" type="bold" asChild>
|
<Typography
|
||||||
|
variant="Body/Supporting text (caption)/smBold"
|
||||||
|
className={styles.red}
|
||||||
|
>
|
||||||
<span>{str}</span>
|
<span>{str}</span>
|
||||||
</Caption>
|
</Typography>
|
||||||
),
|
),
|
||||||
price,
|
price,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,10 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.red {
|
||||||
|
color: var(--Text-Accent-Primary);
|
||||||
|
}
|
||||||
|
|
||||||
.badge {
|
.badge {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -1,127 +0,0 @@
|
|||||||
p.caption {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.captionFontOnly {
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bold {
|
|
||||||
font-family: var(--typography-Caption-Bold-fontFamily);
|
|
||||||
font-size: var(--typography-Caption-Bold-fontSize);
|
|
||||||
font-weight: 500; /* var(--typography-Caption-Bold-fontWeight); /* Commented till figma values are fixed to 500 instead of medium */
|
|
||||||
letter-spacing: var(--typography-Caption-Bold-letterSpacing);
|
|
||||||
line-height: var(--typography-Caption-Bold-lineHeight);
|
|
||||||
text-decoration: var(--typography-Caption-Bold-textDecoration);
|
|
||||||
}
|
|
||||||
|
|
||||||
.labels {
|
|
||||||
font-family: var(--typography-Caption-Labels-fontFamily);
|
|
||||||
font-size: var(--typography-Caption-Labels-fontSize);
|
|
||||||
font-weight: var(--typography-Caption-Labels-fontWeight);
|
|
||||||
letter-spacing: var(--typography-Caption-Labels-letterSpacing);
|
|
||||||
line-height: var(--typography-Caption-Labels-lineHeight);
|
|
||||||
text-decoration: var(--typography-Caption-Labels-textDecoration);
|
|
||||||
}
|
|
||||||
|
|
||||||
.underline {
|
|
||||||
font-family: var(--typography-Caption-Underline-fontFamily);
|
|
||||||
font-size: var(--typography-Caption-Underline-fontSize);
|
|
||||||
font-weight: var(--typography-Caption-Underline-fontWeight);
|
|
||||||
letter-spacing: var(--typography-Caption-Underline-letterSpacing);
|
|
||||||
line-height: var(--typography-Caption-Underline-lineHeight);
|
|
||||||
text-decoration: underline; /* var(--typography-Caption-Underline-textDecoration) /* Commented till figma values are fixed to underline instead of "underline" */
|
|
||||||
}
|
|
||||||
|
|
||||||
.regular {
|
|
||||||
font-family: var(--typography-Caption-Regular-fontFamily);
|
|
||||||
font-size: var(--typography-Caption-Regular-fontSize);
|
|
||||||
font-weight: var(--typography-Caption-Regular-fontWeight);
|
|
||||||
letter-spacing: var(--typography-Caption-Regular-letterSpacing);
|
|
||||||
line-height: var(--typography-Caption-Regular-lineHeight);
|
|
||||||
text-decoration: var(--typography-Caption-Regular-textDecoration);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uppercase {
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.striked {
|
|
||||||
text-decoration: line-through;
|
|
||||||
}
|
|
||||||
|
|
||||||
.baseTextAccent {
|
|
||||||
color: var(--Base-Text-Accent);
|
|
||||||
}
|
|
||||||
|
|
||||||
.black {
|
|
||||||
color: var(--Main-Grey-100);
|
|
||||||
}
|
|
||||||
|
|
||||||
.burgundy {
|
|
||||||
color: var(--Scandic-Brand-Burgundy);
|
|
||||||
}
|
|
||||||
|
|
||||||
.pale {
|
|
||||||
color: var(--Scandic-Brand-Pale-Peach);
|
|
||||||
}
|
|
||||||
|
|
||||||
.textMediumContrast {
|
|
||||||
color: var(--Base-Text-Medium-contrast);
|
|
||||||
}
|
|
||||||
|
|
||||||
.baseTextHighContrast {
|
|
||||||
color: var(--Base-Text-High-contrast);
|
|
||||||
}
|
|
||||||
|
|
||||||
.baseTextMediumContrast {
|
|
||||||
color: var(--Base-Text-Medium-contrast);
|
|
||||||
}
|
|
||||||
|
|
||||||
.red {
|
|
||||||
color: var(--Scandic-Brand-Scandic-Red);
|
|
||||||
}
|
|
||||||
|
|
||||||
.white {
|
|
||||||
color: var(--UI-Opacity-White-100);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uiTextActive {
|
|
||||||
color: var(--UI-Text-Active);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uiTextMediumContrast {
|
|
||||||
color: var(--UI-Text-Medium-contrast);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uiTextHighContrast {
|
|
||||||
color: var(--UI-Text-High-contrast);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uiTextPlaceholder {
|
|
||||||
color: var(--UI-Text-Placeholder);
|
|
||||||
}
|
|
||||||
|
|
||||||
.disabled {
|
|
||||||
color: var(--Base-Text-Disabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
.center {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.left {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.right {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.green {
|
|
||||||
color: var(--UI-Semantic-Success);
|
|
||||||
}
|
|
||||||
.blue {
|
|
||||||
color: var(--UI-Semantic-Information);
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
import { Slot } from "@radix-ui/react-slot"
|
|
||||||
|
|
||||||
import { captionVariants, fontOnlycaptionVariants } from "./variants"
|
|
||||||
import { VariantProps } from "class-variance-authority"
|
|
||||||
|
|
||||||
interface CaptionProps
|
|
||||||
extends
|
|
||||||
Omit<React.HTMLAttributes<HTMLHeadingElement>, "color">,
|
|
||||||
VariantProps<typeof captionVariants> {
|
|
||||||
asChild?: boolean
|
|
||||||
fontOnly?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use `@scandic-hotels/design-system/Typography` instead.
|
|
||||||
*/
|
|
||||||
export default function Caption({
|
|
||||||
asChild = false,
|
|
||||||
className = "",
|
|
||||||
color,
|
|
||||||
fontOnly = false,
|
|
||||||
textAlign,
|
|
||||||
textTransform,
|
|
||||||
uppercase,
|
|
||||||
striked,
|
|
||||||
type,
|
|
||||||
...props
|
|
||||||
}: CaptionProps) {
|
|
||||||
const Comp = asChild ? Slot : "p"
|
|
||||||
const classNames = fontOnly
|
|
||||||
? fontOnlycaptionVariants({
|
|
||||||
className,
|
|
||||||
textTransform,
|
|
||||||
uppercase,
|
|
||||||
striked,
|
|
||||||
type,
|
|
||||||
})
|
|
||||||
: captionVariants({
|
|
||||||
className,
|
|
||||||
color,
|
|
||||||
textTransform,
|
|
||||||
textAlign,
|
|
||||||
uppercase,
|
|
||||||
striked,
|
|
||||||
type,
|
|
||||||
})
|
|
||||||
return <Comp className={classNames} {...props} />
|
|
||||||
}
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
import { cva } from "class-variance-authority"
|
|
||||||
|
|
||||||
import styles from "./caption.module.css"
|
|
||||||
|
|
||||||
const config = {
|
|
||||||
variants: {
|
|
||||||
type: {
|
|
||||||
regular: styles.regular,
|
|
||||||
bold: styles.bold,
|
|
||||||
label: styles.labels,
|
|
||||||
underline: styles.underline,
|
|
||||||
},
|
|
||||||
color: {
|
|
||||||
baseTextAccent: styles.baseTextAccent,
|
|
||||||
black: styles.black,
|
|
||||||
burgundy: styles.burgundy,
|
|
||||||
pale: styles.pale,
|
|
||||||
textMediumContrast: styles.textMediumContrast,
|
|
||||||
red: styles.red,
|
|
||||||
white: styles.white,
|
|
||||||
green: styles.green,
|
|
||||||
blue: styles.blue,
|
|
||||||
uiTextHighContrast: styles.uiTextHighContrast,
|
|
||||||
uiTextActive: styles.uiTextActive,
|
|
||||||
uiTextMediumContrast: styles.uiTextMediumContrast,
|
|
||||||
uiTextPlaceholder: styles.uiTextPlaceholder,
|
|
||||||
disabled: styles.disabled,
|
|
||||||
baseTextHighContrast: styles.baseTextHighContrast,
|
|
||||||
baseTextMediumContrast: styles.baseTextMediumContrast,
|
|
||||||
},
|
|
||||||
textTransform: {
|
|
||||||
uppercase: styles.uppercase,
|
|
||||||
},
|
|
||||||
textAlign: {
|
|
||||||
center: styles.center,
|
|
||||||
left: styles.left,
|
|
||||||
right: styles.right,
|
|
||||||
},
|
|
||||||
uppercase: {
|
|
||||||
true: styles.uppercase,
|
|
||||||
},
|
|
||||||
striked: {
|
|
||||||
true: styles.striked,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
defaultVariants: {
|
|
||||||
color: "black",
|
|
||||||
type: "regular",
|
|
||||||
},
|
|
||||||
} as const
|
|
||||||
|
|
||||||
export const captionVariants = cva(styles.caption, config)
|
|
||||||
|
|
||||||
const fontOnlyConfig = {
|
|
||||||
variants: {
|
|
||||||
type: {
|
|
||||||
regular: styles.regular,
|
|
||||||
bold: styles.bold,
|
|
||||||
label: styles.labels,
|
|
||||||
underline: styles.underline,
|
|
||||||
},
|
|
||||||
textTransform: {
|
|
||||||
uppercase: styles.uppercase,
|
|
||||||
},
|
|
||||||
uppercase: {
|
|
||||||
true: styles.uppercase,
|
|
||||||
},
|
|
||||||
striked: {
|
|
||||||
true: styles.striked,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
defaultVariants: {
|
|
||||||
type: "regular",
|
|
||||||
},
|
|
||||||
} as const
|
|
||||||
|
|
||||||
export const fontOnlycaptionVariants = cva(
|
|
||||||
styles.captionFontOnly,
|
|
||||||
fontOnlyConfig
|
|
||||||
)
|
|
||||||
@@ -17,6 +17,10 @@
|
|||||||
color: var(--Text-Default);
|
color: var(--Text-Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.secondaryText {
|
||||||
|
color: var(--Text-Secondary);
|
||||||
|
}
|
||||||
|
|
||||||
.cheque {
|
.cheque {
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||||
import Caption from "../../Caption"
|
|
||||||
|
|
||||||
import styles from "./hotelChequeCard.module.css"
|
import styles from "./hotelChequeCard.module.css"
|
||||||
import { Typography } from "../../Typography"
|
import { Typography } from "../../Typography"
|
||||||
@@ -28,17 +27,21 @@ export default function HotelChequeCard({
|
|||||||
return (
|
return (
|
||||||
<div className={styles.chequeCard}>
|
<div className={styles.chequeCard}>
|
||||||
<div className={styles.chequeRow}>
|
<div className={styles.chequeRow}>
|
||||||
<Caption>
|
<Typography variant="Body/Supporting text (caption)/smBold">
|
||||||
|
<p>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "common.from",
|
id: "common.from",
|
||||||
defaultMessage: "From",
|
defaultMessage: "From",
|
||||||
})}
|
})}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
<div className={styles.cheque}>
|
<div className={styles.cheque}>
|
||||||
<Typography variant="Title/Subtitle/md">
|
<Typography variant="Title/Subtitle/md">
|
||||||
<p>{productTypeCheque.localPrice.numberOfCheques}</p>
|
<p>{productTypeCheque.localPrice.numberOfCheques}</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Caption color="uiTextHighContrast">{CurrencyEnum.CC}</Caption>
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>{CurrencyEnum.CC}</p>
|
||||||
|
</Typography>
|
||||||
{productTypeCheque.localPrice.additionalPricePerStay > 0 ? (
|
{productTypeCheque.localPrice.additionalPricePerStay > 0 ? (
|
||||||
// eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
// eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
||||||
<>
|
<>
|
||||||
@@ -46,9 +49,9 @@ export default function HotelChequeCard({
|
|||||||
<Typography variant="Title/Subtitle/md">
|
<Typography variant="Title/Subtitle/md">
|
||||||
<p>{productTypeCheque.localPrice.additionalPricePerStay}</p>
|
<p>{productTypeCheque.localPrice.additionalPricePerStay}</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Caption color="uiTextHighContrast">
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
{productTypeCheque.localPrice.currency}
|
<p>{productTypeCheque.localPrice.currency}</p>
|
||||||
</Caption>
|
</Typography>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
@@ -56,21 +59,33 @@ export default function HotelChequeCard({
|
|||||||
{productTypeCheque.requestedPrice &&
|
{productTypeCheque.requestedPrice &&
|
||||||
productTypeCheque.requestedPrice.additionalPricePerStay > 0 ? (
|
productTypeCheque.requestedPrice.additionalPricePerStay > 0 ? (
|
||||||
<div className={styles.chequeRow}>
|
<div className={styles.chequeRow}>
|
||||||
<Caption color="uiTextMediumContrast">
|
<Typography
|
||||||
|
variant="Body/Supporting text (caption)/smRegular"
|
||||||
|
className={styles.secondaryText}
|
||||||
|
>
|
||||||
|
<p>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "booking.approx",
|
id: "booking.approx",
|
||||||
defaultMessage: "Approx.",
|
defaultMessage: "Approx.",
|
||||||
})}
|
})}
|
||||||
</Caption>
|
</p>
|
||||||
<Caption color="uiTextMediumContrast">
|
</Typography>
|
||||||
{productTypeCheque.requestedPrice.numberOfCheques} {CurrencyEnum.CC}
|
<Typography
|
||||||
|
variant="Body/Supporting text (caption)/smRegular"
|
||||||
|
className={styles.secondaryText}
|
||||||
|
>
|
||||||
|
<p>
|
||||||
|
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||||
|
{productTypeCheque.requestedPrice.numberOfCheques}{" "}
|
||||||
|
{CurrencyEnum.CC}
|
||||||
{productTypeCheque.requestedPrice.additionalPricePerStay
|
{productTypeCheque.requestedPrice.additionalPricePerStay
|
||||||
? // eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
? // eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
||||||
" + "
|
" + "
|
||||||
: ""}
|
: ""}
|
||||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||||
{`${productTypeCheque.requestedPrice.additionalPricePerStay} ${productTypeCheque.requestedPrice.currency}`}
|
{`${productTypeCheque.requestedPrice.additionalPricePerStay} ${productTypeCheque.requestedPrice.currency}`}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -151,7 +151,20 @@ export function StandaloneHotelCardDialog({
|
|||||||
</RoomPrice>
|
</RoomPrice>
|
||||||
) : null}
|
) : null}
|
||||||
{voucherPrice ? (
|
{voucherPrice ? (
|
||||||
<RoomPrice price={voucherPrice} currency={currency} />
|
<RoomPrice
|
||||||
|
price={voucherPrice}
|
||||||
|
currency={intl.formatMessage(
|
||||||
|
{
|
||||||
|
id: "price.numberOfVouchers",
|
||||||
|
defaultMessage:
|
||||||
|
"{numberOfVouchers, plural, one {Voucher} other {Vouchers}}",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
numberOfVouchers: voucherPrice,
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
includePerNight={false}
|
||||||
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{/* Show public price if:
|
{/* Show public price if:
|
||||||
1) user is not logged in, or
|
1) user is not logged in, or
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import Caption from "../../Caption"
|
|
||||||
|
|
||||||
import styles from "./hotelVoucherCard.module.css"
|
import styles from "./hotelVoucherCard.module.css"
|
||||||
import { Typography } from "../../Typography"
|
import { Typography } from "../../Typography"
|
||||||
|
|
||||||
@@ -18,17 +16,20 @@ export default function HotelVoucherCard({
|
|||||||
return (
|
return (
|
||||||
<div className={styles.voucherCard}>
|
<div className={styles.voucherCard}>
|
||||||
<div className={styles.voucherRow}>
|
<div className={styles.voucherRow}>
|
||||||
<Caption>
|
<Typography variant="Body/Supporting text (caption)/smBold">
|
||||||
|
<p>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "common.from",
|
id: "common.from",
|
||||||
defaultMessage: "From",
|
defaultMessage: "From",
|
||||||
})}
|
})}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
<div className={styles.voucher}>
|
<div className={styles.voucher}>
|
||||||
<Typography variant="Title/Subtitle/md">
|
<Typography variant="Title/Subtitle/md">
|
||||||
<p>{productTypeVoucher.numberOfVouchers}</p>
|
<p>{productTypeVoucher.numberOfVouchers}</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Caption color="uiTextHighContrast" className={styles.currency}>
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
{intl.formatMessage(
|
{intl.formatMessage(
|
||||||
{
|
{
|
||||||
id: "price.numberOfVouchers",
|
id: "price.numberOfVouchers",
|
||||||
@@ -39,7 +40,8 @@ export default function HotelVoucherCard({
|
|||||||
numberOfVouchers: productTypeVoucher.numberOfVouchers,
|
numberOfVouchers: productTypeVoucher.numberOfVouchers,
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import {
|
|||||||
selectRate,
|
selectRate,
|
||||||
} from "@scandic-hotels/common/constants/routes/hotelReservation"
|
} from "@scandic-hotels/common/constants/routes/hotelReservation"
|
||||||
import { getSingleDecimal } from "@scandic-hotels/common/utils/numberFormatting"
|
import { getSingleDecimal } from "@scandic-hotels/common/utils/numberFormatting"
|
||||||
import Caption from "../Caption"
|
|
||||||
import { Divider } from "../Divider"
|
import { Divider } from "../Divider"
|
||||||
import { FacilityToIcon } from "../FacilityToIcon"
|
import { FacilityToIcon } from "../FacilityToIcon"
|
||||||
import HotelLogoIcon from "../Icons/Logos"
|
import HotelLogoIcon from "../Icons/Logos"
|
||||||
@@ -341,12 +340,14 @@ export const HotelCardComponent = memo(
|
|||||||
)}
|
)}
|
||||||
{prices?.redemptions?.length ? (
|
{prices?.redemptions?.length ? (
|
||||||
<div className={styles.pointsCard}>
|
<div className={styles.pointsCard}>
|
||||||
<Caption>
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "hotelCard.availableRates",
|
id: "hotelCard.availableRates",
|
||||||
defaultMessage: "Available rates",
|
defaultMessage: "Available rates",
|
||||||
})}
|
})}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
{prices.redemptions.map((redemption) => (
|
{prices.redemptions.map((redemption) => (
|
||||||
<HotelPointsRow
|
<HotelPointsRow
|
||||||
key={redemption.rateCode}
|
key={redemption.rateCode}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Caption from "../Caption"
|
|
||||||
import Image from "../Image"
|
import Image from "../Image"
|
||||||
|
import { Typography } from "../Typography"
|
||||||
|
|
||||||
import styles from "./imageContainer.module.css"
|
import styles from "./imageContainer.module.css"
|
||||||
|
|
||||||
@@ -42,7 +42,9 @@ export default function ImageContainer({
|
|||||||
focalPoint={leftImage.focalPoint}
|
focalPoint={leftImage.focalPoint}
|
||||||
dimensions={leftImage.dimensions}
|
dimensions={leftImage.dimensions}
|
||||||
/>
|
/>
|
||||||
<Caption>{leftImage.meta.caption}</Caption>
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>{leftImage.meta.caption}</p>
|
||||||
|
</Typography>
|
||||||
</article>
|
</article>
|
||||||
<article>
|
<article>
|
||||||
<Image
|
<Image
|
||||||
@@ -54,7 +56,9 @@ export default function ImageContainer({
|
|||||||
focalPoint={rightImage.focalPoint}
|
focalPoint={rightImage.focalPoint}
|
||||||
dimensions={rightImage.dimensions}
|
dimensions={rightImage.dimensions}
|
||||||
/>
|
/>
|
||||||
<Caption>{rightImage.meta.caption}</Caption>
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>{rightImage.meta.caption}</p>
|
||||||
|
</Typography>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { RegisterOptions, useController, useFormContext } from "react-hook-form"
|
|||||||
|
|
||||||
import styles from "./switch.module.css"
|
import styles from "./switch.module.css"
|
||||||
import { MaterialIcon } from "../Icons/MaterialIcon"
|
import { MaterialIcon } from "../Icons/MaterialIcon"
|
||||||
import Caption from "../Caption"
|
import { Typography } from "../Typography"
|
||||||
|
|
||||||
interface SwitchProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
interface SwitchProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
||||||
name: string
|
name: string
|
||||||
@@ -37,10 +37,12 @@ export default function Switch({
|
|||||||
{children}
|
{children}
|
||||||
<span className={styles.switch} tabIndex={0}></span>
|
<span className={styles.switch} tabIndex={0}></span>
|
||||||
{fieldState.error ? (
|
{fieldState.error ? (
|
||||||
<Caption className={styles.error} fontOnly>
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
|
<p>
|
||||||
<MaterialIcon icon="info" color="Icon/Interactive/Accent" />
|
<MaterialIcon icon="info" color="Icon/Interactive/Accent" />
|
||||||
{fieldState.error.message}
|
{fieldState.error.message}
|
||||||
</Caption>
|
</p>
|
||||||
|
</Typography>
|
||||||
) : null}
|
) : null}
|
||||||
</AriaSwitch>
|
</AriaSwitch>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
"./Button": "./lib/components/Button/index.tsx",
|
"./Button": "./lib/components/Button/index.tsx",
|
||||||
"./ButtonLink": "./lib/components/ButtonLink/index.tsx",
|
"./ButtonLink": "./lib/components/ButtonLink/index.tsx",
|
||||||
"./CampaignRateCard": "./lib/components/RateCard/Campaign/index.tsx",
|
"./CampaignRateCard": "./lib/components/RateCard/Campaign/index.tsx",
|
||||||
"./Caption": "./lib/components/Caption/index.tsx",
|
|
||||||
"./Card": "./lib/components/Card/index.tsx",
|
"./Card": "./lib/components/Card/index.tsx",
|
||||||
"./ChipButton": "./lib/components/ChipButton/index.tsx",
|
"./ChipButton": "./lib/components/ChipButton/index.tsx",
|
||||||
"./ChipLink": "./lib/components/ChipLink/index.tsx",
|
"./ChipLink": "./lib/components/ChipLink/index.tsx",
|
||||||
|
|||||||
Reference in New Issue
Block a user