Skip to content

Commit ea06dec

Browse files
committed
Consolidate text colors in RadioGroup.Radio
1 parent 7adf8cd commit ea06dec

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/components/input/RadioGroup.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ function Radio<T extends RadioValue>({
4444
className={classnames(
4545
'focus-visible-ring rounded-lg px-3 py-2 flex-1 group',
4646
{
47-
'bg-grey-3/50': isSelected,
48-
'hover:bg-grey-3/25': !isSelected && !disabled,
47+
'hover:bg-grey-3/25 aria-checked:bg-grey-3/50 cursor-pointer':
48+
!disabled,
4949
'opacity-70': disabled,
50-
'cursor-pointer': !disabled,
5150
},
5251
)}
5352
data-value={value}
@@ -66,13 +65,20 @@ function Radio<T extends RadioValue>({
6665
>
6766
<div className="flex items-center gap-x-1.5">
6867
{isSelected ? <RadioCheckedIcon /> : <RadioIcon />}
69-
{children}
68+
<span
69+
className={classnames('flex items-center gap-x-1.5', {
70+
'text-grey-7 group-hover:text-grey-8 group-aria-checked:text-grey-8':
71+
!disabled,
72+
})}
73+
>
74+
{children}
75+
</span>
7076
</div>
7177
{subtitle && (
7278
<div
7379
className={classnames('pl-4 ml-1.5 mt-1 text-sm', {
74-
'text-grey-7': isSelected,
75-
'text-grey-6 group-hover:text-grey-7': !isSelected && !disabled,
80+
'text-grey-6 group-hover:text-grey-7 group-aria-checked:text-grey-7':
81+
!disabled,
7682
})}
7783
>
7884
{subtitle}

0 commit comments

Comments
 (0)