From ceebedc786603b6dd1bc77184b6aff2ea038a5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Casas?= <57921784+vicasas@users.noreply.github.com> Date: Tue, 11 May 2021 13:33:43 -0400 Subject: [PATCH] [Radio] Make color primary default (#26180) --- docs/pages/api-docs/radio.json | 2 +- .../pages/components/radio-buttons/ColorRadioButtons.js | 2 +- .../pages/components/radio-buttons/ColorRadioButtons.tsx | 2 +- docs/src/pages/components/radio-buttons/UseRadioGroup.js | 2 +- .../src/pages/components/radio-buttons/UseRadioGroup.tsx | 2 +- docs/src/pages/guides/migration-v4/migration-v4.md | 9 +++++++++ packages/material-ui/src/Radio/Radio.d.ts | 2 +- packages/material-ui/src/Radio/Radio.js | 4 ++-- packages/material-ui/src/Radio/Radio.test.js | 2 +- 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/docs/pages/api-docs/radio.json b/docs/pages/api-docs/radio.json index b5ba01f8d41457..31cfac2490eeb0 100644 --- a/docs/pages/api-docs/radio.json +++ b/docs/pages/api-docs/radio.json @@ -8,7 +8,7 @@ "name": "union", "description": "'default'
| 'primary'
| 'secondary'
| string" }, - "default": "'secondary'" + "default": "'primary'" }, "disabled": { "type": { "name": "bool" } }, "disableRipple": { "type": { "name": "bool" } }, diff --git a/docs/src/pages/components/radio-buttons/ColorRadioButtons.js b/docs/src/pages/components/radio-buttons/ColorRadioButtons.js index 9a477caba12733..2f753c96e916eb 100644 --- a/docs/src/pages/components/radio-buttons/ColorRadioButtons.js +++ b/docs/src/pages/components/radio-buttons/ColorRadioButtons.js @@ -20,7 +20,7 @@ export default function ColorRadioButtons() { return (
- + - + )( ({ theme, checked }) => ({ '.MuiFormControlLabel-label': checked && { - color: theme.palette.secondary.main, + color: theme.palette.primary.main, }, }), ); diff --git a/docs/src/pages/components/radio-buttons/UseRadioGroup.tsx b/docs/src/pages/components/radio-buttons/UseRadioGroup.tsx index daf80222671bc8..49326e1e819b64 100644 --- a/docs/src/pages/components/radio-buttons/UseRadioGroup.tsx +++ b/docs/src/pages/components/radio-buttons/UseRadioGroup.tsx @@ -14,7 +14,7 @@ const StyledFormControlLabel = styled((props: StyledFormControlLabelProps) => ( ))(({ theme, checked }) => ({ '.MuiFormControlLabel-label': checked && { - color: theme.palette.secondary.main, + color: theme.palette.primary.main, }, })); diff --git a/docs/src/pages/guides/migration-v4/migration-v4.md b/docs/src/pages/guides/migration-v4/migration-v4.md index a46c17d608eeb2..ab9d168d8af118 100644 --- a/docs/src/pages/guides/migration-v4/migration-v4.md +++ b/docs/src/pages/guides/migration-v4/migration-v4.md @@ -1060,6 +1060,15 @@ As the core components use emotion as a styled engine, the props used by emotion - Remove `onRendered` prop. Depending on your use case either use a [callback ref](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) on the child element or an effect hook in the child component. +### Radio + +- The radio color prop is now "primary" by default. To continue using the "secondary" color, you must explicitly indicate `secondary`. This brings the radio closer to the Material Design specification. + + ```diff + - + +