Merged in feat/new-rate-cards (pull request #1600)
feat(SW-1435): Added RateCard component to design system * feat(SW-1435): Added new component: RateCard to design system * feat: added reward night points rate card * fix: set svg icon color to "currentColor" to make them more reusable * fix: added click handler for info icon * fix: added selectedRate Approved-by: Arvid Norlin
This commit is contained in:
31
packages/design-system/lib/components/Radio/Radio.tsx
Normal file
31
packages/design-system/lib/components/Radio/Radio.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { PropsWithChildren } from 'react'
|
||||
import { Radio as AriaRadio } from 'react-aria-components'
|
||||
import styles from './radio.module.css'
|
||||
import { variants } from './variants'
|
||||
|
||||
interface RadioProps extends PropsWithChildren {
|
||||
value: string
|
||||
id?: string
|
||||
isDisabled?: boolean
|
||||
color?: 'Burgundy'
|
||||
}
|
||||
|
||||
export function Radio({ id, value, children, color, isDisabled }: RadioProps) {
|
||||
const inputId = id || `radio-${value}`
|
||||
|
||||
const classNames = variants({
|
||||
color,
|
||||
})
|
||||
|
||||
return (
|
||||
<AriaRadio
|
||||
id={inputId}
|
||||
value={value}
|
||||
isDisabled={isDisabled}
|
||||
className={`${styles.container} ${isDisabled ? styles.disabled : ''}`}
|
||||
>
|
||||
<div className={`${styles.radio} ${classNames}`} />
|
||||
<div>{children}</div>
|
||||
</AriaRadio>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user