Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-11878-changed-1742325899299.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Changed
---

Updated Radio Button component to conform to Akamai Design System specs ([#11878](https://github.com/linode/manager/pull/11878))
7 changes: 2 additions & 5 deletions packages/ui/src/assets/icons/radio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 2 additions & 15 deletions packages/ui/src/assets/icons/radioRadioed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions packages/ui/src/components/Radio/Radio.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ describe('Radio', () => {

const radio = screen.getByRole('radio');
expect(radio).toBeInTheDocument();
const notFilled = screen.container.querySelector('[id="Oval-2"]');

const notFilled = screen.container.querySelector('#radio-inner');
expect(notFilled).not.toBeInTheDocument();

fireEvent.click(radio);
const filled = screen.container.querySelector('[id="Oval-2"]');

const filled = screen.container.querySelector('#radio-inner');
expect(filled).toBeInTheDocument();
});

Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/components/Radio/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ export const Radio = (props: RadioProps) => {
<SvgIcon
component={RadioIconRadioed}
fontSize={props.size}
viewBox="0 0 25 25"
viewBox="0 0 20 20"
/>
}
icon={
<SvgIcon
component={RadioIcon}
fontSize={props.size}
viewBox="0 0 25 25"
viewBox="0 0 20 20"
/>
}
data-qa-radio={props.checked || false}
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/foundations/themes/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
GlobalHeader,
Interaction,
NotificationToast,
RadioButton,
Search,
Select,
SideNavigation,
Expand Down Expand Up @@ -1046,6 +1047,7 @@ export const darkTheme: ThemeOptions = {
elevation: Elevation,
footer: GlobalFooter,
interaction: Interaction,
radio: RadioButton,
search: Search,
sideNavigation: SideNavigation,
table: Table,
Expand Down
5 changes: 5 additions & 0 deletions packages/ui/src/foundations/themes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import type {
GlobalFooterTypes as GlobalFooterTypesLight,
GlobalHeaderTypes,
InteractionTypes as InteractionTypesLight,
RadioButtonTypes as RadioButtonTypesLight,
RadiusTypes,
SearchTypes as SearchTypesLight,
SideNavigationTypes as SideNavigationTypesLight,
Expand All @@ -53,6 +54,7 @@ import type {
ElevationTypes as ElevationTypesDark,
GlobalFooterTypes as GlobalFooterTypesDark,
InteractionTypes as InteractionTypesDark,
RadioButtonTypes as RadioButtonTypesDark,
SearchTypes as SearchTypesDark,
SideNavigationTypes as SideNavigationTypesDark,
TableTypes as TableTypesDark,
Expand All @@ -71,6 +73,7 @@ type ContentTypes = MergeTypes<ContentTypesLight, ContentTypesDark>;
type ElevationTypes = MergeTypes<ElevationTypesLight, ElevationTypesDark>;
type CalendarTypes = MergeTypes<CalendarTypesLight, CalendarTypesDark>;
type InteractionTypes = MergeTypes<InteractionTypesLight, InteractionTypesDark>;
type RadioButtonTypes = MergeTypes<RadioButtonTypesLight, RadioButtonTypesDark>;
type SideNavigationTypes = MergeTypes<
SideNavigationTypesLight,
SideNavigationTypesDark
Expand Down Expand Up @@ -157,6 +160,7 @@ declare module '@mui/material/styles/createTheme' {
footer: FooterTypes;
header: GlobalHeaderTypes;
interaction: InteractionTypes;
radio: RadioButtonTypes;
radius: RadiusTypes;
search: SearchTypes;
sideNavigation: SideNavigationTypes;
Expand Down Expand Up @@ -203,6 +207,7 @@ declare module '@mui/material/styles/createTheme' {
footer?: FooterTypes;
header?: GlobalHeaderTypes;
interaction?: InteractionTypes;
radio?: RadioButtonTypes;
radius?: RadiusTypes;
search?: SearchTypes;
sideNavigation?: SideNavigationTypes;
Expand Down
30 changes: 23 additions & 7 deletions packages/ui/src/foundations/themes/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
GlobalHeader,
Interaction,
NotificationToast,
RadioButton,
Radius,
Search,
Select,
Expand Down Expand Up @@ -1130,19 +1131,33 @@ export const lightTheme: ThemeOptions = {
color: primaryColors.main,
},
root: ({ theme }) => ({
'& $checked': {
color: primaryColors.main,
'&:active': {
color: theme.tokens.radio.Active.Active.Border,
Copy link
Copy Markdown
Contributor Author

@bill-akamai bill-akamai Mar 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be a little confusing, but Border is the correct property to use here for color (confirmed with Design). Some aspects of the radio button needed additional handling with Color.Neutrals.

},
'&.Mui-checked': {
color: theme.tokens.radio.Active.Default.Border,
'&:active': {
color: theme.tokens.radio.Active.Active.Border,
},
},
'& .defaultFill': {
fill: theme.color.white,
transition: theme.transitions.create(['fill']),
},
'& svg circle': {
fill: Color.Neutrals.White,
},
'&.Mui-disabled': {
'& .defaultFill': {
fill: Color.Neutrals[5],
},
color: `${Color.Neutrals[40]} !important`,
fill: `${Color.Neutrals[5]} !important`,
'&:not(.Mui-checked) svg circle': {
fill: Color.Neutrals[20],
},
'&:not(.Mui-checked)': {
color: theme.tokens.radio.Inactive.Disabled.Border,
},
color: theme.tokens.radio.Active.Disabled.Border,
pointerEvents: 'none',
},
'&.MuiRadio-root': {
Expand All @@ -1159,10 +1174,10 @@ export const lightTheme: ThemeOptions = {
'& .defaultFill': {
fill: theme.color.white,
},
color: theme.palette.primary.main,
fill: theme.color.white,
color: theme.tokens.radio.Active.Hover.Border,
fill: theme.tokens.radio.Active.Hover.Background,
},
color: Color.Neutrals[40],
color: theme.tokens.action.Neutral,
padding: '10px 10px',
transition: theme.transitions.create(['color']),
}),
Expand Down Expand Up @@ -1814,6 +1829,7 @@ export const lightTheme: ThemeOptions = {
footer: GlobalFooter,
header: GlobalHeader,
interaction: Interaction,
radio: RadioButton,
radius: Radius,
search: Search,
sideNavigation: SideNavigation,
Expand Down