Merged in fix/SW-2172-accessibility-issues-sidepeek-and-other-buttons (pull request #2202)
fix(SW-2172): update sidepeek buttons to use new ones for accessibility Approved-by: Erik Tiekstra
This commit is contained in:
@@ -1,38 +1,32 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import { Button } from "@scandic-hotels/design-system/Button"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
|
||||||
import useSidePeekStore from "@/stores/sidepeek"
|
import useSidePeekStore from "@/stores/sidepeek"
|
||||||
|
|
||||||
import Button from "@/components/TempDesignSystem/Button"
|
|
||||||
|
|
||||||
import styles from "./header.module.css"
|
|
||||||
|
|
||||||
import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
|
import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
|
||||||
import type { ToggleSidePeekProps } from "@/types/components/hotelReservation/toggleSidePeekProps"
|
import type { ToggleSidePeekProps } from "@/types/components/hotelReservation/toggleSidePeekProps"
|
||||||
|
|
||||||
export default function ToggleSidePeek({
|
export default function ToggleSidePeek({ hotelId }: ToggleSidePeekProps) {
|
||||||
hotelId,
|
|
||||||
intent = "textInverted",
|
|
||||||
}: ToggleSidePeekProps) {
|
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
const openSidePeek = useSidePeekStore((state) => state.openSidePeek)
|
const openSidePeek = useSidePeekStore((state) => state.openSidePeek)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
onClick={() => openSidePeek({ key: SidePeekEnum.hotelDetails, hotelId })}
|
onPress={() => openSidePeek({ key: SidePeekEnum.hotelDetails, hotelId })}
|
||||||
theme="base"
|
size="Small"
|
||||||
size="small"
|
variant="Text"
|
||||||
variant="icon"
|
color="Inverted"
|
||||||
intent={intent}
|
|
||||||
wrapping
|
wrapping
|
||||||
className={styles.toggle}
|
typography="Body/Paragraph/mdBold"
|
||||||
>
|
>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
defaultMessage: "See hotel details",
|
defaultMessage: "See hotel details",
|
||||||
})}
|
})}
|
||||||
<MaterialIcon icon="chevron_right" size={14} color="Icon/Inverted" />
|
<MaterialIcon icon="chevron_right" size={20} color="CurrentColor" />
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,12 @@
|
|||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
background-color: rgba(57, 57, 57, 0.5);
|
background: linear-gradient(
|
||||||
|
60deg,
|
||||||
|
rgb(0 0 0 / 25%) 0%,
|
||||||
|
rgb(0 0 0 / 50%) 50%,
|
||||||
|
rgb(0 0 0 / 75%) 100%
|
||||||
|
);
|
||||||
width: 100dvw;
|
width: 100dvw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,15 +30,15 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
max-width: var(--max-width-page);
|
max-width: var(--max-width-page);
|
||||||
gap: var(--Spacing-x2);
|
gap: var(--Space-x05);
|
||||||
padding: var(--Spacing-x3) 0;
|
padding: var(--Space-x3) 0;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.titleContainer {
|
.titleContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--Spacing-x-half);
|
gap: var(--Space-x05);
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobileTitle {
|
.mobileTitle {
|
||||||
@@ -56,20 +61,16 @@
|
|||||||
.address {
|
.address {
|
||||||
display: none;
|
display: none;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
column-gap: var(--Spacing-x-one-and-half);
|
column-gap: var(--Space-x15);
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle {
|
|
||||||
padding: 0px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.address {
|
.address {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
.container {
|
.container {
|
||||||
padding: var(--Spacing-x3) 0;
|
padding: var(--Space-x3) 0;
|
||||||
}
|
}
|
||||||
.mobileTitle {
|
.mobileTitle {
|
||||||
display: none;
|
display: none;
|
||||||
@@ -81,6 +82,6 @@
|
|||||||
|
|
||||||
@media screen and (min-width: 1367px) {
|
@media screen and (min-width: 1367px) {
|
||||||
.container {
|
.container {
|
||||||
padding: var(--Spacing-x6) 0;
|
padding: var(--Space-x6) 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,19 +2,17 @@
|
|||||||
|
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import { Button } from "@scandic-hotels/design-system/Button"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
|
||||||
import useSidePeekStore from "@/stores/sidepeek"
|
import useSidePeekStore from "@/stores/sidepeek"
|
||||||
|
|
||||||
import Button from "@/components/TempDesignSystem/Button"
|
|
||||||
|
|
||||||
import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
|
import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
|
||||||
import type { ToggleSidePeekProps } from "@/types/components/hotelReservation/toggleSidePeekProps"
|
import type { ToggleSidePeekProps } from "@/types/components/hotelReservation/toggleSidePeekProps"
|
||||||
|
|
||||||
export default function ToggleSidePeek({
|
export default function ToggleSidePeek({
|
||||||
hotelId,
|
hotelId,
|
||||||
roomTypeCode,
|
roomTypeCode,
|
||||||
intent = "textInverted",
|
|
||||||
title,
|
title,
|
||||||
}: ToggleSidePeekProps) {
|
}: ToggleSidePeekProps) {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
@@ -22,21 +20,19 @@ export default function ToggleSidePeek({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
onClick={() =>
|
onPress={() =>
|
||||||
openSidePeek({ key: SidePeekEnum.roomDetails, hotelId, roomTypeCode })
|
openSidePeek({ key: SidePeekEnum.roomDetails, hotelId, roomTypeCode })
|
||||||
}
|
}
|
||||||
theme="base"
|
size="Small"
|
||||||
size="small"
|
variant="Text"
|
||||||
variant="icon"
|
|
||||||
intent={intent}
|
|
||||||
wrapping
|
wrapping
|
||||||
|
typography="Body/Paragraph/mdBold"
|
||||||
>
|
>
|
||||||
{title
|
{title ||
|
||||||
? title
|
intl.formatMessage({
|
||||||
: intl.formatMessage({
|
defaultMessage: "See room details",
|
||||||
defaultMessage: "See room details",
|
})}
|
||||||
})}
|
<MaterialIcon icon="chevron_right" size={20} color="CurrentColor" />
|
||||||
<MaterialIcon icon="chevron_right" size={14} color="CurrentColor" />
|
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,12 @@ import { useRouter } from "next/navigation"
|
|||||||
import { useTransition } from "react"
|
import { useTransition } from "react"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import { Button } from "@scandic-hotels/design-system/Button"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
|
||||||
import { selectRate } from "@/constants/routes/hotelReservation"
|
import { selectRate } from "@/constants/routes/hotelReservation"
|
||||||
import { useEnterDetailsStore } from "@/stores/enter-details"
|
import { useEnterDetailsStore } from "@/stores/enter-details"
|
||||||
|
|
||||||
import Button from "@/components/TempDesignSystem/Button"
|
|
||||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
|
||||||
import Footnote from "@/components/TempDesignSystem/Text/Footnote"
|
import Footnote from "@/components/TempDesignSystem/Text/Footnote"
|
||||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||||
import { useRoomContext } from "@/contexts/Details/Room"
|
import { useRoomContext } from "@/contexts/Details/Room"
|
||||||
@@ -76,25 +75,22 @@ export default function SelectedRoom() {
|
|||||||
)}
|
)}
|
||||||
</Subtitle>
|
</Subtitle>
|
||||||
<Button
|
<Button
|
||||||
variant="icon"
|
variant="Text"
|
||||||
intent="text"
|
size="Small"
|
||||||
size="small"
|
onPress={changeRoom}
|
||||||
onClick={changeRoom}
|
isDisabled={isPending}
|
||||||
disabled={isPending}
|
typography="Body/Supporting text (caption)/smBold"
|
||||||
>
|
>
|
||||||
<MaterialIcon icon="edit_square" color="CurrentColor" />
|
<MaterialIcon icon="edit_square" size={20} color="CurrentColor" />
|
||||||
<Caption color="burgundy" type="bold">
|
{intl.formatMessage({
|
||||||
{intl.formatMessage({
|
defaultMessage: "Change",
|
||||||
defaultMessage: "Change",
|
})}
|
||||||
})}
|
|
||||||
</Caption>
|
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{room.roomTypeCode && (
|
{room.roomTypeCode && (
|
||||||
<div className={styles.details}>
|
<div className={styles.details}>
|
||||||
<ToggleSidePeek
|
<ToggleSidePeek
|
||||||
hotelId={hotelId}
|
hotelId={hotelId}
|
||||||
intent="text"
|
|
||||||
roomTypeCode={room.roomTypeCode}
|
roomTypeCode={room.roomTypeCode}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import { Button } from "@scandic-hotels/design-system/Button"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
|
||||||
import useSidePeekStore from "@/stores/sidepeek"
|
import useSidePeekStore from "@/stores/sidepeek"
|
||||||
|
|
||||||
import Button from "@/components/TempDesignSystem/Button"
|
|
||||||
|
|
||||||
import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
|
import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
|
||||||
import type { ToggleSidePeekProps } from "@/types/components/hotelReservation/toggleSidePeekProps"
|
import type { ToggleSidePeekProps } from "@/types/components/hotelReservation/toggleSidePeekProps"
|
||||||
|
|
||||||
@@ -26,14 +26,13 @@ export default function ToggleSidePeek({
|
|||||||
roomTypeCode,
|
roomTypeCode,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
intent="text"
|
size="Small"
|
||||||
size="small"
|
variant="Text"
|
||||||
theme="base"
|
|
||||||
variant="icon"
|
|
||||||
wrapping
|
wrapping
|
||||||
|
typography="Body/Supporting text (caption)/smBold"
|
||||||
>
|
>
|
||||||
{intl.formatMessage({ defaultMessage: "Room details" })}
|
{intl.formatMessage({ defaultMessage: "Room details" })}
|
||||||
<MaterialIcon icon="chevron_right" size={14} />
|
<MaterialIcon icon="chevron_right" size={20} color="CurrentColor" />
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import type { SafeUser } from "@/types/user"
|
|||||||
export type ToggleSidePeekProps = {
|
export type ToggleSidePeekProps = {
|
||||||
hotelId: string
|
hotelId: string
|
||||||
roomTypeCode?: string
|
roomTypeCode?: string
|
||||||
intent?: "text" | "textInverted"
|
|
||||||
title?: string
|
title?: string
|
||||||
user?: SafeUser
|
user?: SafeUser
|
||||||
confirmationNumber?: string
|
confirmationNumber?: string
|
||||||
|
|||||||
Reference in New Issue
Block a user