fix(SW-2171): Added focus state on rate cards and image-gallery
Approved-by: Arvid Norlin
This commit is contained in:
@@ -14,13 +14,9 @@
|
|||||||
|
|
||||||
.imageWrapper {
|
.imageWrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
|
||||||
height: 200px;
|
height: 200px;
|
||||||
max-width: 360px;
|
max-width: 360px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
|
||||||
|
|
||||||
.imageWrapper img {
|
|
||||||
border-radius: var(--Corner-radius-Medium);
|
border-radius: var(--Corner-radius-Medium);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
margin: 0 calc(-1 * var(--Spacing-x2));
|
margin: 0 calc(-1 * var(--Spacing-x2));
|
||||||
min-height: 190px;
|
min-height: 190px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
border-radius: var(--Corner-radius-Large) var(--Corner-radius-Large) 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
div[data-multiroom="true"] .imageContainer {
|
div[data-multiroom="true"] .imageContainer {
|
||||||
@@ -26,7 +27,6 @@ div[data-multiroom="true"] .imageContainer {
|
|||||||
|
|
||||||
.imageContainer img {
|
.imageContainer img {
|
||||||
aspect-ratio: 16/9;
|
aspect-ratio: 16/9;
|
||||||
border-radius: var(--Corner-radius-Medium) var(--Corner-radius-Medium) 0 0;
|
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
.wrapper {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
.imageCount {
|
.imageCount {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 16px;
|
bottom: 16px;
|
||||||
@@ -10,24 +17,24 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: var(--Spacing-x-quarter);
|
gap: var(--Spacing-x-quarter);
|
||||||
}
|
|
||||||
|
|
||||||
.imageCountNumber {
|
|
||||||
color: var(--Text-Inverted);
|
color: var(--Text-Inverted);
|
||||||
}
|
}
|
||||||
.triggerArea {
|
|
||||||
display: flex;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.triggerArea:not(.fill) {
|
.triggerArea {
|
||||||
position: relative;
|
background-color: transparent;
|
||||||
|
border-width: 0;
|
||||||
|
padding: 0;
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.image {
|
.image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
|
border-radius: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imagePlaceholder {
|
.imagePlaceholder {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import Lightbox from "@/components/Lightbox"
|
|||||||
import styles from "./imageGallery.module.css"
|
import styles from "./imageGallery.module.css"
|
||||||
|
|
||||||
import type { ImageGalleryProps } from "@/types/components/imageGallery"
|
import type { ImageGalleryProps } from "@/types/components/imageGallery"
|
||||||
|
import { cx } from "class-variance-authority"
|
||||||
|
|
||||||
function ImageGallery({
|
function ImageGallery({
|
||||||
images,
|
images,
|
||||||
@@ -35,13 +36,7 @@ function ImageGallery({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button
|
<div className={cx(styles.wrapper, { [styles.fill]: fill })}>
|
||||||
className={`${styles.triggerArea} ${fill ? styles.fill : ""}`}
|
|
||||||
onPress={() => setLightboxIsOpen(true)}
|
|
||||||
aria-label={intl.formatMessage({
|
|
||||||
defaultMessage: "Open image gallery",
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<Image
|
<Image
|
||||||
className={styles.image}
|
className={styles.image}
|
||||||
src={firstImage.src}
|
src={firstImage.src}
|
||||||
@@ -49,13 +44,20 @@ function ImageGallery({
|
|||||||
onError={() => setImageError(true)}
|
onError={() => setImageError(true)}
|
||||||
{...imageProps}
|
{...imageProps}
|
||||||
/>
|
/>
|
||||||
<span className={styles.imageCount}>
|
<Typography variant={"Body/Supporting text (caption)/smRegular"}>
|
||||||
<MaterialIcon icon="filter" color="Icon/Inverted" />
|
<span className={styles.imageCount}>
|
||||||
<Typography variant={"Body/Supporting text (caption)/smRegular"}>
|
<MaterialIcon icon="filter" color="Icon/Inverted" />
|
||||||
<span className={styles.imageCountNumber}>{images.length}</span>
|
<span>{images.length}</span>
|
||||||
</Typography>
|
</span>
|
||||||
</span>
|
</Typography>
|
||||||
</Button>
|
<Button
|
||||||
|
className={styles.triggerArea}
|
||||||
|
onPress={() => setLightboxIsOpen(true)}
|
||||||
|
aria-label={intl.formatMessage({
|
||||||
|
defaultMessage: "Open image gallery",
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<Lightbox
|
<Lightbox
|
||||||
images={images}
|
images={images}
|
||||||
dialogTitle={title}
|
dialogTitle={title}
|
||||||
|
|||||||
@@ -44,6 +44,10 @@
|
|||||||
border: 1px solid var(--Scandic-Peach-80, 'black');
|
border: 1px solid var(--Scandic-Peach-80, 'black');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.radio:focus-visible ~ .rateCard {
|
||||||
|
outline: 2px solid var(--Border-Interactive-Focus);
|
||||||
|
}
|
||||||
|
|
||||||
label:not(:has(.radio:checked)) .checkIcon {
|
label:not(:has(.radio:checked)) .checkIcon {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user