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)
36 lines
830 B
TypeScript
36 lines
830 B
TypeScript
import { config } from './variants'
|
|
|
|
import { VariantProps } from 'class-variance-authority'
|
|
import { Typography } from '../Typography'
|
|
import { TypographyProps } from '../Typography/types'
|
|
|
|
interface BadgeProps extends VariantProps<typeof config> {
|
|
number: string | number
|
|
}
|
|
|
|
export function Badge({ number, color, size }: BadgeProps) {
|
|
const classNames = config({
|
|
color,
|
|
size,
|
|
})
|
|
|
|
return (
|
|
<Typography variant={getTypography(size)}>
|
|
<span className={classNames}>{number}</span>
|
|
</Typography>
|
|
)
|
|
}
|
|
|
|
function getTypography(size: BadgeProps['size']): TypographyProps['variant'] {
|
|
switch (size) {
|
|
case '36':
|
|
case '32':
|
|
return 'Body/Paragraph/mdBold'
|
|
case '28':
|
|
case '24':
|
|
return 'Body/Supporting text (caption)/smBold'
|
|
case '20':
|
|
return 'Label/xsRegular'
|
|
}
|
|
}
|