Merged in feat/STAY-140-stepper-accesible (pull request #3432)
feat(STAY-140): make Stepper more accessible * feat(STAY-140): make Stepper more accessible * fix(STAY-140): add aria-valuetext Approved-by: Bianca Widstam
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { useFormContext } from "react-hook-form"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
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"
|
||||
@@ -42,10 +42,12 @@ export default function AdultSelector({
|
||||
variant="Body/Supporting text (caption)/smBold"
|
||||
className={styles.label}
|
||||
>
|
||||
<p>{adultsLabel}</p>
|
||||
<p id="stepper-adults-label">{adultsLabel}</p>
|
||||
</Typography>
|
||||
<Stepper
|
||||
count={currentAdults}
|
||||
label={adultsLabel}
|
||||
ariaLabelledBy="stepper-adults-label"
|
||||
handleOnDecrease={decreaseAdultsCount}
|
||||
handleOnIncrease={increaseAdultsCount}
|
||||
disableDecrease={currentAdults == 1}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useRef } from "react"
|
||||
import { useFormContext } from "react-hook-form"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
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 ChildInfoSelector from "./ChildInfoSelector"
|
||||
@@ -61,9 +61,11 @@ export default function ChildSelector({
|
||||
variant="Body/Supporting text (caption)/smBold"
|
||||
className={styles.label}
|
||||
>
|
||||
<p>{childrenLabel}</p>
|
||||
<p id="stepper-children-label">{childrenLabel}</p>
|
||||
</Typography>
|
||||
<Stepper
|
||||
label={childrenLabel}
|
||||
ariaLabelledBy="stepper-children-label"
|
||||
count={currentChildren.length}
|
||||
handleOnDecrease={() => {
|
||||
decreaseChildrenCount(roomIndex)
|
||||
|
||||
Reference in New Issue
Block a user