diff --git a/apps/scandic-web/components/Blocks/ShortcutsList/ShortcutsListItems/shortcutsListItems.module.css b/apps/scandic-web/components/Blocks/ShortcutsList/ShortcutsListItems/shortcutsListItems.module.css index 2d502461c..545dd2dfc 100644 --- a/apps/scandic-web/components/Blocks/ShortcutsList/ShortcutsListItems/shortcutsListItems.module.css +++ b/apps/scandic-web/components/Blocks/ShortcutsList/ShortcutsListItems/shortcutsListItems.module.css @@ -20,3 +20,8 @@ .listItem:last-child .link { border-radius: 0 0 var(--Corner-radius-md) var(--Corner-radius-md); } + +.link:focus-visible { + outline: 2px auto -webkit-focus-ring-color; + outline-offset: -4px; +} diff --git a/apps/scandic-web/components/Carousel/carousel.module.css b/apps/scandic-web/components/Carousel/carousel.module.css index f9bd6c94c..ae5915a5a 100644 --- a/apps/scandic-web/components/Carousel/carousel.module.css +++ b/apps/scandic-web/components/Carousel/carousel.module.css @@ -17,6 +17,10 @@ min-width: 0; } +.item:focus-visible { + outline: 2px auto -webkit-focus-ring-color; + outline-offset: 1px; +} .buttonWrapper { position: absolute; top: 50%; diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/Steps/ConfirmationStep/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/Steps/ConfirmationStep/index.tsx index 1bd170107..1e0f5990b 100755 --- a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/Steps/ConfirmationStep/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/Steps/ConfirmationStep/index.tsx @@ -146,39 +146,16 @@ export default function ConfirmationStep({ "By adding a card you also guarantee your room booking for late arrival.", })} /> - {savedCreditCards?.length ? ( - ({ - ...x, - cardType: x.cardType as PaymentMethodEnum, - }))} - onChange={(method) => { - trackUpdatePaymentMethod({ method }) - }} - formName={"paymentMethod"} - /> - ) : null} - - - + ({ + ...card, + cardType: card.cardType as PaymentMethodEnum, + }))} + onChange={(method) => { + trackUpdatePaymentMethod({ method }) + }} + formName={"paymentMethod"} + /> )} diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/WrappedAncillaryCard/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/WrappedAncillaryCard/index.tsx index 8631c13f8..545234095 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/WrappedAncillaryCard/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/WrappedAncillaryCard/index.tsx @@ -20,11 +20,18 @@ export default function WrappedAncillaryCard({ return (
{ selectAncillary(ancillary) trackViewAncillary(ancillary, booking) }} + onKeyDown={(e) => { + if (e.key === "Enter") { + selectAncillary(ancillary) + trackViewAncillary(ancillary, booking) + } + }} >
diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/GuaranteeLateArrival/Form/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/GuaranteeLateArrival/Form/index.tsx index acc70df4b..4416362ba 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/GuaranteeLateArrival/Form/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/GuaranteeLateArrival/Form/index.tsx @@ -12,8 +12,6 @@ import { privacyPolicyRoutes } from "@scandic-hotels/common/constants/routes/pri import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting" import { Divider } from "@scandic-hotels/design-system/Divider" import Checkbox from "@scandic-hotels/design-system/Form/Checkbox" -import { PaymentOption } from "@scandic-hotels/design-system/Form/PaymentOption" -import { PaymentOptionsGroup } from "@scandic-hotels/design-system/Form/PaymentOptionsGroup" import { SelectPaymentMethod } from "@scandic-hotels/design-system/Form/SelectPaymentMethod" import { LoadingSpinner } from "@scandic-hotels/design-system/LoadingSpinner" import Link from "@scandic-hotels/design-system/OldDSLink" @@ -155,42 +153,17 @@ export default function Form() { id="guarantee" onSubmit={methods.handleSubmit(handleGuaranteeLateArrival)} > - {savedCreditCards?.length ? ( - ({ - ...x, - cardType: x.type as PaymentMethodEnum, - }))} - onChange={(method) => { - trackUpdatePaymentMethod({ method }) - }} - /> - ) : null} - ({ + ...card, + cardType: card.cardType as PaymentMethodEnum, + }))} onChange={(method) => { trackUpdatePaymentMethod({ method }) }} - > - - + formName="paymentMethod" + /> +
diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/ViewAndPrintReceipt/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/ViewAndPrintReceipt/index.tsx index cb1597d29..bd8077b2e 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/ViewAndPrintReceipt/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/ViewAndPrintReceipt/index.tsx @@ -17,6 +17,7 @@ import styles from "./view.module.css" export default function ViewAndPrintReceipt() { const intl = useIntl() const lang = useLang() + const canDownloadInvoice = useMyStayStore( (state) => !state.bookedRoom.isCancelled && diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/ViewAndPrintReceipt/view.module.css b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/ViewAndPrintReceipt/view.module.css index 95cc11637..498bff0cf 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/ViewAndPrintReceipt/view.module.css +++ b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/Upcoming/ManageStay/Actions/ViewAndPrintReceipt/view.module.css @@ -5,3 +5,7 @@ gap: var(--Space-x1); padding: var(--Space-x05) 0; } + +.download:focus-visible { + outline: 2px solid -webkit-focus-ring-color; +} diff --git a/packages/booking-flow/lib/components/EnterDetails/Confirm/Guarantee/guarantee.module.css b/packages/booking-flow/lib/components/EnterDetails/Confirm/Guarantee/guarantee.module.css index 8538e1b22..428b4f32f 100644 --- a/packages/booking-flow/lib/components/EnterDetails/Confirm/Guarantee/guarantee.module.css +++ b/packages/booking-flow/lib/components/EnterDetails/Confirm/Guarantee/guarantee.module.css @@ -38,6 +38,10 @@ justify-self: flex-end; outline: none; } +.infoButton:focus-visible { + outline: 2px auto -webkit-focus-ring-color; + outline-offset: 1px; +} .overlay { align-items: center; diff --git a/packages/booking-flow/lib/components/EnterDetails/Confirm/Guarantee/index.tsx b/packages/booking-flow/lib/components/EnterDetails/Confirm/Guarantee/index.tsx index 3f85f5e3f..b55feb826 100644 --- a/packages/booking-flow/lib/components/EnterDetails/Confirm/Guarantee/index.tsx +++ b/packages/booking-flow/lib/components/EnterDetails/Confirm/Guarantee/index.tsx @@ -9,12 +9,9 @@ import { import { useWatch } from "react-hook-form" import { useIntl } from "react-intl" -import { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMethod" import useSetOverflowVisibleOnRA from "@scandic-hotels/common/hooks/useSetOverflowVisibleOnRA" import { Button } from "@scandic-hotels/design-system/Button" import Checkbox from "@scandic-hotels/design-system/Form/Checkbox" -import { PaymentOption } from "@scandic-hotels/design-system/Form/PaymentOption" -import { PaymentOptionsGroup } from "@scandic-hotels/design-system/Form/PaymentOptionsGroup" import { SelectPaymentMethod } from "@scandic-hotels/design-system/Form/SelectPaymentMethod" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import { Typography } from "@scandic-hotels/design-system/Typography" @@ -22,6 +19,7 @@ import { trackUpdatePaymentMethod } from "@scandic-hotels/tracking/payment" import styles from "./guarantee.module.css" +import type { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMethod" import type { CreditCard } from "@scandic-hotels/trpc/types/user" interface GuaranteeProps { @@ -112,9 +110,10 @@ export default function Guarantee({ savedCreditCards }: GuaranteeProps) {
- {savedCreditCards?.length && guarantee ? ( + + {guarantee && ( ({ + paymentMethods={(savedCreditCards ?? []).map((card) => ({ ...card, cardType: card.cardType as PaymentMethodEnum, }))} @@ -123,30 +122,7 @@ export default function Guarantee({ savedCreditCards }: GuaranteeProps) { }} formName={"paymentMethod"} /> - ) : null} - {guarantee ? ( - - - - ) : null} + )} ) } diff --git a/packages/design-system/lib/components/Button/button.module.css b/packages/design-system/lib/components/Button/button.module.css index 8efa5a40b..df04f153f 100644 --- a/packages/design-system/lib/components/Button/button.module.css +++ b/packages/design-system/lib/components/Button/button.module.css @@ -17,6 +17,10 @@ cursor: progress; } } +.button:focus-visible { + outline: 2px auto -webkit-focus-ring-color; /*color should probably be cutomized for each variant later on*/ + outline-offset: 1px; +} .size-large { padding: var(--Space-x2) var(--Space-x3); diff --git a/packages/design-system/lib/components/ButtonLink/buttonLink.module.css b/packages/design-system/lib/components/ButtonLink/buttonLink.module.css index 2b3a1eb25..e5c18148a 100644 --- a/packages/design-system/lib/components/ButtonLink/buttonLink.module.css +++ b/packages/design-system/lib/components/ButtonLink/buttonLink.module.css @@ -8,3 +8,8 @@ justify-content: center; gap: var(--Space-x05); } + +.buttonLink:focus-visible { + outline: 2px auto -webkit-focus-ring-color; + outline-offset: 1px; +} diff --git a/packages/design-system/lib/components/Form/PaymentOption/PaymentOptionsGroup.tsx b/packages/design-system/lib/components/Form/PaymentOption/PaymentOptionsGroup.tsx index 6d076d1da..e765c4e54 100644 --- a/packages/design-system/lib/components/Form/PaymentOption/PaymentOptionsGroup.tsx +++ b/packages/design-system/lib/components/Form/PaymentOption/PaymentOptionsGroup.tsx @@ -2,7 +2,6 @@ import { Label, RadioGroup } from 'react-aria-components' import { useController, useFormContext } from 'react-hook-form' - import type { ReactNode } from 'react' import { Typography } from '../../../components/Typography' @@ -11,6 +10,7 @@ interface PaymentOptionsGroupProps { label?: string children: ReactNode className?: string + initalValue?: string onChange?: (newValue: string) => void } @@ -20,6 +20,7 @@ export function PaymentOptionsGroup({ children, className, onChange, + initalValue, }: PaymentOptionsGroupProps) { const { control } = useFormContext() @@ -36,7 +37,11 @@ export function PaymentOptionsGroup({ } return ( - + {label ? ( diff --git a/packages/design-system/lib/components/Form/SelectPaymentMethod/index.tsx b/packages/design-system/lib/components/Form/SelectPaymentMethod/index.tsx index ee3e9d199..c8b2ca36e 100644 --- a/packages/design-system/lib/components/Form/SelectPaymentMethod/index.tsx +++ b/packages/design-system/lib/components/Form/SelectPaymentMethod/index.tsx @@ -1,7 +1,9 @@ import { useIntl } from 'react-intl' +import { Label } from 'react-aria-components' import { PaymentOptionsGroup } from '../PaymentOption/PaymentOptionsGroup' import { PaymentOption } from '../PaymentOption/PaymentOption' +import { Typography } from '../../../components/Typography' import styles from './selectPaymentMethod.module.css' @@ -29,34 +31,71 @@ export function SelectPaymentMethod({ formName, }: SelectPaymentMethodProps) { const intl = useIntl() - const mySavedCardsLabel = intl.formatMessage({ - id: 'payment.mySavedCards', - defaultMessage: 'My saved cards', - }) + const mySavedCardsLabel = paymentMethods.length + ? intl.formatMessage({ + id: 'payment.mySavedCards', + defaultMessage: 'My saved cards', + }) + : undefined + const otherCardLabel = paymentMethods.length + ? intl.formatMessage({ + id: 'common.other', + defaultMessage: 'Other', + }) + : undefined + + const hasSavedCards = paymentMethods.length > 0 return (
- {paymentMethods?.map((paymentMethods) => { - const label = - PAYMENT_METHOD_TITLES[paymentMethods.cardType] || - paymentMethods.alias || - paymentMethods.cardType + + {hasSavedCards ? ( + <> + + {mySavedCardsLabel} + + {paymentMethods?.map((paymentMethods) => { + const label = + PAYMENT_METHOD_TITLES[paymentMethods.cardType] || + paymentMethods.alias || + paymentMethods.cardType - return ( - - ) - })} + return ( + + ) + })} + + {otherCardLabel} + + + ) : null} + +
) diff --git a/packages/design-system/lib/components/SidePeek/index.tsx b/packages/design-system/lib/components/SidePeek/index.tsx index 3c60f3c57..24f763227 100644 --- a/packages/design-system/lib/components/SidePeek/index.tsx +++ b/packages/design-system/lib/components/SidePeek/index.tsx @@ -2,7 +2,7 @@ import { useContext, useRef } from 'react' import { Dialog, Modal, ModalOverlay } from 'react-aria-components' - +import { IconButton } from '../IconButton' import { MaterialIcon } from '../Icons/MaterialIcon' import { Typography } from '../Typography' @@ -10,7 +10,6 @@ import { SidePeekContext } from './SidePeekContext' import SidePeekSEO from './SidePeekSEO' -import { IconButton } from '../IconButton' import styles from './sidePeek.module.css' interface SidePeekProps { @@ -63,8 +62,8 @@ export default function SidePeek({