Fix/STAY-135 & STAY-127 * fix: make quantity and delivery separate steps in mobile * fix: update design for delivery step in ancillary flow * fix: add error state for missing time * fix: only allow points or cash payment for ancillaries * fix: break out stepper to design system * fix: update design of select quantity step in add ancillaries flow * fix: add error states for quantity * fix: handle insufficient points case * fix: update stepper to include optional disabledMessage tooltip * fix: handle validations * fix: change name to camel case Approved-by: Bianca Widstam Approved-by: Chuma Mcphoy (We Ahead)
44 lines
924 B
TypeScript
44 lines
924 B
TypeScript
import { PropsWithChildren } from 'react'
|
|
import { Radio as AriaRadio } from 'react-aria-components'
|
|
import styles from './radio.module.css'
|
|
import { variants } from './variants'
|
|
import { cx } from 'class-variance-authority'
|
|
|
|
interface RadioProps extends PropsWithChildren {
|
|
value: string
|
|
id?: string
|
|
isDisabled?: boolean
|
|
color?: 'Burgundy'
|
|
wrapping?: boolean
|
|
}
|
|
|
|
export function Radio({
|
|
id,
|
|
value,
|
|
children,
|
|
color,
|
|
isDisabled,
|
|
wrapping = true,
|
|
}: RadioProps) {
|
|
const inputId = id || `radio-${value}`
|
|
|
|
const classNames = variants({
|
|
color,
|
|
})
|
|
|
|
return (
|
|
<AriaRadio
|
|
id={inputId}
|
|
value={value}
|
|
isDisabled={isDisabled}
|
|
className={cx(styles.container, {
|
|
[styles.disabled]: isDisabled,
|
|
[styles.wrapping]: wrapping,
|
|
})}
|
|
>
|
|
<div className={`${styles.radio} ${classNames}`} />
|
|
{children && <div>{children}</div>}
|
|
</AriaRadio>
|
|
)
|
|
}
|