Skip to content

Commit

Permalink
refactor(components): update RadioButton for desktop use
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff committed Sep 25, 2024
1 parent 95159ed commit f39a4fa
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions components/src/atoms/buttons/RadioButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
RESPONSIVENESS,
SPACING,
StyledText,
TYPOGRAPHY,
} from '../..'
import type { IconName } from '../..'
import type { StyleProps } from '../../primitives'
Expand Down Expand Up @@ -83,7 +82,15 @@ export function RadioButton(props: RadioButtonProps): JSX.Element {
const DISABLED_BUTTON_STYLE = css`
background-color: ${COLORS.grey35};
color: ${COLORS.grey50};
cursor: ${CURSOR_NOT_ALLOWED};
&:hover,
&:active {
background-color: ${COLORS.grey35};
}
@media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} {
cursor: ${CURSOR_NOT_ALLOWED};
}
`

const SettingButtonLabel = styled.label`
Expand Down Expand Up @@ -113,6 +120,14 @@ export function RadioButton(props: RadioButtonProps): JSX.Element {
}
`

const SubButtonLabelStyle = css`
color: ${disabled
? COLORS.grey50
: isSelected
? COLORS.white
: COLORS.grey60};
`

return (
<Flex
css={css`
Expand Down Expand Up @@ -154,7 +169,9 @@ export function RadioButton(props: RadioButtonProps): JSX.Element {
{typeof buttonLabel === 'string' ? (
<StyledText
oddStyle={isLarge ? 'level4HeaderSemiBold' : 'bodyTextRegular'}
desktopStyle="bodyDefaultRegular"
desktopStyle={
isLarge ? 'bodyDefaultSemiBold' : 'bodyDefaultRegular'
}
>
{buttonLabel}
</StyledText>
Expand All @@ -164,8 +181,9 @@ export function RadioButton(props: RadioButtonProps): JSX.Element {
</Flex>
{subButtonLabel != null ? (
<StyledText
oddStyle="level4HeaderRegular"
fontWeight={TYPOGRAPHY.fontWeightRegular}
oddStyle={isLarge ? 'level4HeaderRegular' : 'bodyTextRegular'}
desktopStyle="bodyDefaultRegular"
css={SubButtonLabelStyle}
>
{subButtonLabel}
</StyledText>
Expand Down

0 comments on commit f39a4fa

Please sign in to comment.