+
+ Get started
+
+
Instant access to the power of the Joy UI library.
*': { flexGrow: 1, fontWeight: 'lg' },
+ gap: 1,
}}
>
-
+ }
+ sx={{
+ ...buttonStyles,
+ '&:active': { bgcolor: solid ? shade(200) : shade(700) },
+ }}
+ >
+ Install
+
}
sx={{
- '&:hover': { '--Button-gap': '0.625rem' },
- '& span': { transition: '0.15s' },
+ ...textColor,
+ ...buttonStyles,
}}
>
See the docs
-
-
-
+ {
- const colors = ['primary', 'neutral', 'danger', 'success', 'warning'];
-
- const nextColorIndex = colors.indexOf(color) + 1;
- setColor(colors[nextColorIndex] ?? colors[0]);
+ bgcolor: 'transparent',
+ display: 'flex',
+ gap: 2,
+ '& button': { borderRadius: '50%' },
}}
>
-
-
+
setSolid((state) => !state)}>
+
+
+
{
+ const colors = ['primary', 'neutral', 'danger', 'success', 'warning'];
+
+ const nextColorIndex = colors.indexOf(color) + 1;
+ setColor(colors[nextColorIndex] ?? colors[0]);
+ }}
+ >
+
+
+
);
}
diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionMarketing.tsx b/docs/data/joy/main-features/color-inversion/ColorInversionMarketing.tsx
index 90e93c26a075d4..befa18c13e5612 100644
--- a/docs/data/joy/main-features/color-inversion/ColorInversionMarketing.tsx
+++ b/docs/data/joy/main-features/color-inversion/ColorInversionMarketing.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { ColorPaletteProp } from '@mui/joy/styles';
+import { ColorPaletteProp, PaletteRange, useTheme } from '@mui/joy/styles';
import Box from '@mui/joy/Box';
import Button from '@mui/joy/Button';
import IconButton from '@mui/joy/IconButton';
@@ -7,6 +7,7 @@ import Typography from '@mui/joy/Typography';
import Sheet from '@mui/joy/Sheet';
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
import ColorLensRoundedIcon from '@mui/icons-material/ColorLensRounded';
+import InvertColorsIcon from '@mui/icons-material/InvertColors';
/**
* Design credit: https://flutter.dev/
@@ -14,76 +15,118 @@ import ColorLensRoundedIcon from '@mui/icons-material/ColorLensRounded';
export default function ColorInversionMarketing() {
const [color, setColor] = React.useState
('primary');
+ const [solid, setSolid] = React.useState(true);
+ const theme = useTheme();
+
+ const shade = (x: keyof PaletteRange): string => theme.vars.palette[color][x];
+ const color1 = solid ? shade(800) : shade(600);
+ const color2 = solid ? shade(600) : shade(200);
+ const color3 = shade(900);
+ const gradient1 = `${color1}, ${color2} 65%`;
+ const gradient2 = `${color1} 65%, ${color3}`;
+ const textColor = { color: solid ? shade(50) : shade(700) };
+
+ const buttonStyles = {
+ borderRadius: 99,
+ '&:hover': {
+ '& .MuiButton-endDecorator': { transform: 'translate(4px, 0px)' },
+ },
+ '& span': { transition: '0.15s' },
+ };
+
return (
-
- Get started
-
+
+
+ Get started
+
+
Instant access to the power of the Joy UI library.
*': { flexGrow: 1, fontWeight: 'lg' },
+ gap: 1,
}}
>
-
+ }
+ sx={{
+ ...buttonStyles,
+ '&:active': { bgcolor: solid ? shade(200) : shade(700) },
+ }}
+ >
+ Install
+
}
sx={{
- '&:hover': { '--Button-gap': '0.625rem' },
- '& span': { transition: '0.15s' },
+ ...textColor,
+ ...buttonStyles,
}}
>
See the docs
-
-
-
+ {
- const colors: ColorPaletteProp[] = [
- 'primary',
- 'neutral',
- 'danger',
- 'success',
- 'warning',
- ];
- const nextColorIndex = colors.indexOf(color) + 1;
- setColor(colors[nextColorIndex] ?? colors[0]);
+ bgcolor: 'transparent',
+ display: 'flex',
+ gap: 2,
+ '& button': { borderRadius: '50%' },
}}
>
-
-
+
setSolid((state) => !state)}>
+
+
+
{
+ const colors: ColorPaletteProp[] = [
+ 'primary',
+ 'neutral',
+ 'danger',
+ 'success',
+ 'warning',
+ ];
+ const nextColorIndex = colors.indexOf(color) + 1;
+ setColor(colors[nextColorIndex] ?? colors[0]);
+ }}
+ >
+
+
+
);
}
diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionMotivation.js b/docs/data/joy/main-features/color-inversion/ColorInversionMotivation.js
index 822606a78376a9..147f6e3b0735a7 100644
--- a/docs/data/joy/main-features/color-inversion/ColorInversionMotivation.js
+++ b/docs/data/joy/main-features/color-inversion/ColorInversionMotivation.js
@@ -10,7 +10,7 @@ import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
export default function ColorInversionMotivation() {
const demo = (
-
+
{/* Left: The global variants are applied to children only */}
-
+
{demo}
One layer
@@ -55,7 +54,7 @@ export default function ColorInversionMotivation() {
{/* Right: The global variants are applied to both parent and children */}
-
+
{React.cloneElement(demo, {
variant: 'solid',
color: 'primary',
diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionMotivation.tsx b/docs/data/joy/main-features/color-inversion/ColorInversionMotivation.tsx
index 352d801efdde4e..e6d5948ea2673f 100644
--- a/docs/data/joy/main-features/color-inversion/ColorInversionMotivation.tsx
+++ b/docs/data/joy/main-features/color-inversion/ColorInversionMotivation.tsx
@@ -10,7 +10,7 @@ import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
export default function ColorInversionMotivation() {
const demo = (
-
+
{/* Left: The global variants are applied to children only */}
-
+
{demo}
One layer
@@ -54,7 +53,7 @@ export default function ColorInversionMotivation() {
{/* Right: The global variants are applied to both parent and children */}
-
+
{React.cloneElement(demo, {
variant: 'solid',
color: 'primary',
diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionPopup.js b/docs/data/joy/main-features/color-inversion/ColorInversionPopup.js
index 7d8b603c3e2dc9..41c91f879e4c45 100644
--- a/docs/data/joy/main-features/color-inversion/ColorInversionPopup.js
+++ b/docs/data/joy/main-features/color-inversion/ColorInversionPopup.js
@@ -28,10 +28,10 @@ export default function ColorInversionPopup() {
const [color, setColor] = React.useState('danger');
const [menuButton, setMenuButton] = React.useState(null);
return (
-
+
}
variant="outlined"
+ startDecorator={}
onClick={() => {
const colors = ['primary', 'neutral', 'danger', 'success', 'warning'];
@@ -47,21 +47,23 @@ export default function ColorInversionPopup() {
color={color}
invertedColors
sx={{
- gap: 4,
minHeight: 240,
+ zIndex: 0,
+ p: 4,
+ width: '100%',
+ flexDirection: { xs: 'column', sm: 'row' },
alignItems: 'flex-start',
justifyContent: 'center',
flexGrow: 1,
- zIndex: 0,
+ gap: 6,
borderRadius: 'sm',
- p: 4,
}}
>
Delete
diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionPopup.tsx b/docs/data/joy/main-features/color-inversion/ColorInversionPopup.tsx
index 99684b40da625b..aff50c0772d8bd 100644
--- a/docs/data/joy/main-features/color-inversion/ColorInversionPopup.tsx
+++ b/docs/data/joy/main-features/color-inversion/ColorInversionPopup.tsx
@@ -28,10 +28,10 @@ export default function ColorInversionPopup() {
const [color, setColor] = React.useState('danger');
const [menuButton, setMenuButton] = React.useState(null);
return (
-
+
}
variant="outlined"
+ startDecorator={}
onClick={() => {
const colors: ColorPaletteProp[] = [
'primary',
@@ -52,21 +52,23 @@ export default function ColorInversionPopup() {
color={color}
invertedColors
sx={{
- gap: 4,
minHeight: 240,
+ zIndex: 0,
+ p: 4,
+ width: '100%',
+ flexDirection: { xs: 'column', sm: 'row' },
alignItems: 'flex-start',
justifyContent: 'center',
flexGrow: 1,
- zIndex: 0,
+ gap: 6,
borderRadius: 'sm',
- p: 4,
}}
>
Delete
diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionSurface.js b/docs/data/joy/main-features/color-inversion/ColorInversionSurface.js
index b7e0b94a246de4..2450dd4eea342f 100644
--- a/docs/data/joy/main-features/color-inversion/ColorInversionSurface.js
+++ b/docs/data/joy/main-features/color-inversion/ColorInversionSurface.js
@@ -12,7 +12,13 @@ export default function ColorInversionSurface() {
variant="solid"
color="warning"
invertedColors
- sx={{ gap: 2, minWidth: 300, boxShadow: 'md' }}
+ sx={{
+ gap: 2,
+ minWidth: 300,
+ boxShadow: 'md',
+ border: '1px solid',
+ borderColor: 'divider',
+ }}
>
@@ -65,7 +71,9 @@ export default function ColorInversionSurface() {
);
return (
-
+
{creditCard}
{React.cloneElement(creditCard, { variant: 'soft' })}
diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionSurface.tsx b/docs/data/joy/main-features/color-inversion/ColorInversionSurface.tsx
index 3f49510152aaf3..0a9f9e57f0f601 100644
--- a/docs/data/joy/main-features/color-inversion/ColorInversionSurface.tsx
+++ b/docs/data/joy/main-features/color-inversion/ColorInversionSurface.tsx
@@ -12,7 +12,13 @@ export default function ColorInversionSurface() {
variant="solid"
color="warning"
invertedColors
- sx={{ gap: 2, minWidth: 300, boxShadow: 'md' }}
+ sx={{
+ gap: 2,
+ minWidth: 300,
+ boxShadow: 'md',
+ border: '1px solid',
+ borderColor: 'divider',
+ }}
>
@@ -64,7 +70,9 @@ export default function ColorInversionSurface() {
);
return (
-
+
{creditCard}
{React.cloneElement(creditCard, { variant: 'soft' })}
diff --git a/docs/data/material/components/about-the-lab/about-the-lab.md b/docs/data/material/components/about-the-lab/about-the-lab.md
index 138aaa0a6384b2..5119f8e01eb3f2 100644
--- a/docs/data/material/components/about-the-lab/about-the-lab.md
+++ b/docs/data/material/components/about-the-lab/about-the-lab.md
@@ -19,18 +19,24 @@ For a component to be ready to move to the core, the following criteria are cons
To install and save in your `package.json` dependencies, run one of the following commands:
+:::info
+The `next` tag is used to download the latest pre-release, v6 version. Remove it to get the current stable version.
+:::
+
+
+
```bash npm
-npm install @mui/lab @mui/material
+npm install @mui/lab@next @mui/material@next
```
```bash yarn
-yarn add @mui/lab @mui/material
+yarn add @mui/lab@next @mui/material@next
```
```bash pnpm
-pnpm add @mui/lab @mui/material
+pnpm add @mui/lab@next @mui/material@next
```
diff --git a/docs/data/material/components/icons/icons.md b/docs/data/material/components/icons/icons.md
index 8bf166dd4b7d34..fa1e8c49403b64 100644
--- a/docs/data/material/components/icons/icons.md
+++ b/docs/data/material/components/icons/icons.md
@@ -26,17 +26,23 @@ You can [search the full list of these icons](/material-ui/material-icons/).
Run one of the following commands to install it and save it to your `package.json` dependencies:
+:::info
+The `next` tag is used to download the latest pre-release, v6 version. Remove it to get the current stable version.
+:::
+
+
+
```bash npm
-npm install @mui/icons-material
+npm install @mui/icons-material@next
```
```bash yarn
-yarn add @mui/icons-material
+yarn add @mui/icons-material@next
```
```bash pnpm
-pnpm add @mui/icons-material
+pnpm add @mui/icons-material@next
```
diff --git a/docs/data/material/components/material-icons/material-icons.md b/docs/data/material/components/material-icons/material-icons.md
index fcc8997547c097..bb54929acc1204 100644
--- a/docs/data/material/components/material-icons/material-icons.md
+++ b/docs/data/material/components/material-icons/material-icons.md
@@ -18,18 +18,24 @@ includes the 2,100+ official [Material Icons](https://fonts.google.com/icons?ico
It depends on `@mui/material`, which requires Emotion packages.
Use one of the following commands to install it:
+:::info
+The `next` tag is used to download the latest pre-release, v6 version. Remove it to get the current stable version.
+:::
+
+
+
```bash npm
-npm install @mui/icons-material @mui/material @emotion/styled @emotion/react
+npm install @mui/icons-material@next @mui/material@next @emotion/styled @emotion/react
```
```bash yarn
-yarn add @mui/icons-material @mui/material @emotion/styled @emotion/react
+yarn add @mui/icons-material@next @mui/material@next @emotion/styled @emotion/react
```
```bash pnpm
-pnpm add @mui/icons-material @mui/material @emotion/styled @emotion/react
+pnpm add @mui/icons-material@next @mui/material@next @emotion/styled @emotion/react
```
diff --git a/docs/data/material/getting-started/installation/installation.md b/docs/data/material/getting-started/installation/installation.md
index ffcc22d222f0dc..5be405621bd99a 100644
--- a/docs/data/material/getting-started/installation/installation.md
+++ b/docs/data/material/getting-started/installation/installation.md
@@ -6,18 +6,24 @@
Run one of the following commands to add Material UI to your project:
+:::info
+The `next` tag is used to download the latest pre-release, v6 version. Remove it to get the current stable version.
+:::
+
+
+
```bash npm
-npm install @mui/material @emotion/react @emotion/styled
+npm install @mui/material@next @emotion/react @emotion/styled
```
```bash yarn
-yarn add @mui/material @emotion/react @emotion/styled
+yarn add @mui/material@next @emotion/react @emotion/styled
```
```bash pnpm
-pnpm add @mui/material @emotion/react @emotion/styled
+pnpm add @mui/material@next @emotion/react @emotion/styled
```
diff --git a/docs/data/material/integrations/nextjs/nextjs.md b/docs/data/material/integrations/nextjs/nextjs.md
index c3003b6f553ee9..880c30fe523c97 100644
--- a/docs/data/material/integrations/nextjs/nextjs.md
+++ b/docs/data/material/integrations/nextjs/nextjs.md
@@ -11,18 +11,24 @@ This section walks through the Material UI integration with the Next.js [App Ro
Start by ensuring that you already have `@mui/material` and `next` installed.
Then, run one of the following commands to install the dependencies:
+:::info
+The `next` tag is used to download the latest pre-release, v6 version. Remove it to get the current stable version.
+:::
+
+
+
```bash npm
-npm install @mui/material-nextjs @emotion/cache
+npm install @mui/material-nextjs@next @emotion/cache
```
```bash yarn
-yarn add @mui/material-nextjs @emotion/cache
+yarn add @mui/material-nextjs@next @emotion/cache
```
```bash pnpm
-pnpm add @mui/material-nextjs @emotion/cache
+pnpm add @mui/material-nextjs@next @emotion/cache
```
diff --git a/docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md b/docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md
index 4e0c17cf442959..8baab6a5dec4e0 100644
--- a/docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md
+++ b/docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md
@@ -479,6 +479,140 @@ Here's how to migrate:
},
```
+## ButtonGroup
+
+Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#button-group-classes) below to migrate the code as described in the following sections:
+
+```bash
+npx @mui/codemod@latest deprecations/button-group-classes
+```
+
+### Composed CSS classes
+
+The CSS classes that composed the following props were deprecated:
+
+- `orientation` | `variant` and `grouped`
+- `color`, `variant` and `grouped`
+
+Here's how to migrate:
+
+```diff
+-.MuiButtonGroup-root .MuiButtonGroup-groupedHorizontal
++.MuiButtonGroup-root.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedVertical
++.MuiButtonGroup-root.MuiButtonGroup-vertical > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedText
++.MuiButtonGroup-root.MuiButtonGroup-text > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedTextHorizontal
++.MuiButtonGroup-root.MuiButtonGroup-text.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedTextVertical
++.MuiButtonGroup-root.MuiButtonGroup-text.MuiButtonGroup-vertical > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedTextPrimary
++.MuiButtonGroup-root.MuiButtonGroup-text.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedTextSecondary
++.MuiButtonGroup-root.MuiButtonGroup-text.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedOutlined
++.MuiButtonGroup-root.MuiButtonGroup-outlined > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedOutlinedHorizontal
++.MuiButtonGroup-root.MuiButtonGroup-outlined.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedOutlinedVertical
++.MuiButtonGroup-root.MuiButtonGroup-outlined.MuiButtonGroup-vertical > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedOutlinedPrimary
++.MuiButtonGroup-root.MuiButtonGroup-outlined.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedOutlinedSecondary
++.MuiButtonGroup-root.MuiButtonGroup-outlined.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedContained
++.MuiButtonGroup-root.MuiButtonGroup-contained > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedContainedHorizontal
++.MuiButtonGroup-root.MuiButtonGroup-contained.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedContainedVertical
++.MuiButtonGroup-root.MuiButtonGroup-contained.MuiButtonGroup-vertical > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedContainedPrimary
++.MuiButtonGroup-root.MuiButtonGroup-contained.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedContainedSecondary
++.MuiButtonGroup-root.MuiButtonGroup-contained.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped
+```
+
+```diff
+
+ import { buttonGroupClasses } from '@mui/material/ButtonGroup';
+
+ MuiButtonGroup: {
+ styleOverrides: {
+ root: {
+- [`& .${buttonGroupClasses.groupedHorizontal}`]: {
++ [`&.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedVertical}`]: {
++ [`&.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedText}`]: {
++ [`&.${buttonGroupClasses.text} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedTextHorizontal}`]: {
++ [`&.${buttonGroupClasses.text}.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedTextVertical}`]: {
++ [`&.${buttonGroupClasses.text}.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedTextPrimary}`]: {
++ [`&.${buttonGroupClasses.text}.${buttonGroupClasses.colorPrimary} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedTextSecondary}`]: {
++ [`&.${buttonGroupClasses.text}.${buttonGroupClasses.colorSecondary} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedOutlined}`]: {
++ [`&.${buttonGroupClasses.outlined} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedOutlinedHorizontal}`]: {
++ [`&.${buttonGroupClasses.outlined}.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedOutlinedVertical}`]: {
++ [`&.${buttonGroupClasses.outlined}.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedOutlinedPrimary}`]: {
++ [`&.${buttonGroupClasses.outlined}.${buttonGroupClasses.colorPrimary} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedOutlinedSecondary}`]: {
++ [`&.${buttonGroupClasses.outlined}.${buttonGroupClasses.colorSecondary} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedContained}`]: {
++ [`&.${buttonGroupClasses.contained} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedContainedHorizontal}`]: {
++ [`&.${buttonGroupClasses.contained}.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedContainedVertical}`]: {
++ [`&.${buttonGroupClasses.contained}.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedContainedPrimary}`]: {
++ [`&.${buttonGroupClasses.contained}.${buttonGroupClasses.colorPrimary} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedContainedSecondary}`]: {
++ [`&.${buttonGroupClasses.contained}.${buttonGroupClasses.colorSecondary} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+ },
+ },
+
+```
+
## Chip
Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#chip-classes) below to migrate the code as described in the following sections:
diff --git a/docs/data/styles/basics/basics.md b/docs/data/styles/basics/basics.md
index f654a750ce5d72..deab3798fbaeb8 100644
--- a/docs/data/styles/basics/basics.md
+++ b/docs/data/styles/basics/basics.md
@@ -17,10 +17,14 @@ Please use [`@mui/system`](/system/getting-started/) instead.
To install and save in your `package.json` dependencies, run:
+:::info
+The `next` tag is used to download the latest pre-release, v6 version. Remove it to get the current stable version.
+:::
+
```bash
-npm install @mui/styles
+npm install @mui/styles@next
```
## Getting started
diff --git a/docs/data/system/getting-started/installation/installation.md b/docs/data/system/getting-started/installation/installation.md
index 3fe69f67219c12..325db1402f6063 100644
--- a/docs/data/system/getting-started/installation/installation.md
+++ b/docs/data/system/getting-started/installation/installation.md
@@ -6,18 +6,20 @@
Run one of the following commands to add MUI System to your project:
+
+
```bash npm
-npm install @mui/system @emotion/react @emotion/styled
+npm install @mui/system@next @emotion/react @emotion/styled
```
```bash yarn
-yarn add @mui/system @emotion/react @emotion/styled
+yarn add @mui/system@next @emotion/react @emotion/styled
```
```bash pnpm
-pnpm add @mui/system @emotion/react @emotion/styled
+pnpm add @mui/system@next @emotion/react @emotion/styled
```
@@ -39,18 +41,24 @@ Please note that [react](https://www.npmjs.com/package/react) is a peer dependen
MUI System uses [Emotion](https://emotion.sh/docs/introduction) as its default styling engine.
If you want to use [styled-components](https://styled-components.com/) instead, run one of the following commands:
+:::info
+The `next` tag is used to download the latest pre-release, v6 version. Remove it to get the current stable version.
+:::
+
+
+
```bash npm
-npm install @mui/system @mui/styled-engine-sc styled-components
+npm install @mui/system@next @mui/styled-engine-sc@next styled-components
```
```bash yarn
-yarn add @mui/system @mui/styled-engine-sc styled-components
+yarn add @mui/system@next @mui/styled-engine-sc@next styled-components
```
```bash pnpm
-pnpm add @mui/system @mui/styled-engine-sc styled-components
+pnpm add @mui/system@next @mui/styled-engine-sc@next styled-components
```
diff --git a/docs/pages/material-ui/api/button-group.json b/docs/pages/material-ui/api/button-group.json
index 16a90311dfbd13..88121829c7f353 100644
--- a/docs/pages/material-ui/api/button-group.json
+++ b/docs/pages/material-ui/api/button-group.json
@@ -47,6 +47,18 @@
"import { ButtonGroup } from '@mui/material';"
],
"classes": [
+ {
+ "key": "colorPrimary",
+ "className": "MuiButtonGroup-colorPrimary",
+ "description": "Styles applied to the root element if `color=\"primary\"`",
+ "isGlobal": false
+ },
+ {
+ "key": "colorSecondary",
+ "className": "MuiButtonGroup-colorSecondary",
+ "description": "Styles applied to the root element if `color=\"secondary\"`",
+ "isGlobal": false
+ },
{
"key": "contained",
"className": "MuiButtonGroup-contained",
@@ -87,102 +99,125 @@
"key": "groupedContained",
"className": "MuiButtonGroup-groupedContained",
"description": "Styles applied to the children if `variant=\"contained\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedContainedHorizontal",
"className": "MuiButtonGroup-groupedContainedHorizontal",
"description": "Styles applied to the children if `variant=\"contained\"` and `orientation=\"horizontal\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedContainedPrimary",
"className": "MuiButtonGroup-groupedContainedPrimary",
"description": "Styles applied to the children if `variant=\"contained\"` and `color=\"primary\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedContainedSecondary",
"className": "MuiButtonGroup-groupedContainedSecondary",
"description": "Styles applied to the children if `variant=\"contained\"` and `color=\"secondary\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedContainedVertical",
"className": "MuiButtonGroup-groupedContainedVertical",
"description": "Styles applied to the children if `variant=\"contained\"` and `orientation=\"vertical\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedHorizontal",
"className": "MuiButtonGroup-groupedHorizontal",
"description": "Styles applied to the children if `orientation=\"horizontal\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedOutlined",
"className": "MuiButtonGroup-groupedOutlined",
"description": "Styles applied to the children if `variant=\"outlined\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedOutlinedHorizontal",
"className": "MuiButtonGroup-groupedOutlinedHorizontal",
"description": "Styles applied to the children if `variant=\"outlined\"` and `orientation=\"horizontal\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedOutlinedPrimary",
"className": "MuiButtonGroup-groupedOutlinedPrimary",
"description": "Styles applied to the children if `variant=\"outlined\"` and `color=\"primary\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedOutlinedSecondary",
"className": "MuiButtonGroup-groupedOutlinedSecondary",
"description": "Styles applied to the children if `variant=\"outlined\"` and `color=\"secondary\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedOutlinedVertical",
"className": "MuiButtonGroup-groupedOutlinedVertical",
"description": "Styles applied to the children if `variant=\"outlined\"` and `orientation=\"vertical\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedText",
"className": "MuiButtonGroup-groupedText",
"description": "Styles applied to the children if `variant=\"text\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedTextHorizontal",
"className": "MuiButtonGroup-groupedTextHorizontal",
"description": "Styles applied to the children if `variant=\"text\"` and `orientation=\"horizontal\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedTextPrimary",
"className": "MuiButtonGroup-groupedTextPrimary",
"description": "Styles applied to the children if `variant=\"text\"` and `color=\"primary\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedTextSecondary",
"className": "MuiButtonGroup-groupedTextSecondary",
"description": "Styles applied to the children if `variant=\"text\"` and `color=\"secondary\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedTextVertical",
"className": "MuiButtonGroup-groupedTextVertical",
"description": "Styles applied to the children if `variant=\"text\"` and `orientation=\"vertical\"`.",
- "isGlobal": false
+ "isGlobal": false,
+ "isDeprecated": true
},
{
"key": "groupedVertical",
"className": "MuiButtonGroup-groupedVertical",
"description": "Styles applied to the children if `orientation=\"vertical\"`.",
+ "isGlobal": false,
+ "isDeprecated": true
+ },
+ {
+ "key": "horizontal",
+ "className": "MuiButtonGroup-horizontal",
+ "description": "Styles applied to the root element if `orientation=\"horizontal\"`.",
"isGlobal": false
},
{
diff --git a/docs/src/components/about/Team.tsx b/docs/src/components/about/Team.tsx
index 805d10b79cf065..087e43d93fbb8f 100644
--- a/docs/src/components/about/Team.tsx
+++ b/docs/src/components/about/Team.tsx
@@ -123,7 +123,7 @@ function Person(props: Profile & { sx?: PaperProps['sx'] }) {
borderRadius: 40,
border: '2px solid',
borderColor: 'primary.50',
- boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.15)',
+ boxShadow: '0px 2px 6px rgba(0, 0, 0, 0.1)',
transform: 'translateX(50%)',
overflow: 'hidden',
...theme.applyDarkStyles({
@@ -185,7 +185,7 @@ function Person(props: Profile & { sx?: PaperProps['sx'] }) {
{props.about && }
{props.about && (
-
+
{props.about}
)}
diff --git a/docs/src/components/pricing/LicensingModelSwitch.tsx b/docs/src/components/pricing/LicensingModelSwitch.tsx
index edb28f944a752d..8e10672d7017d7 100644
--- a/docs/src/components/pricing/LicensingModelSwitch.tsx
+++ b/docs/src/components/pricing/LicensingModelSwitch.tsx
@@ -17,7 +17,8 @@ const StyledTabs = styled(Tabs)(({ theme }) => ({
borderColor: (theme.vars || theme).palette.grey[100],
backgroundColor: (theme.vars || theme).palette.grey[50],
'&:has(.Mui-focusVisible)': {
- outline: `2px solid ${(theme.vars || theme).palette.primary.main}`,
+ outline: `3px solid ${alpha(theme.palette.primary[500], 0.5)}`,
+ outlineOffset: '2px',
},
'& .MuiTabs-scroller, & .MuiTab-root': {
// Override inline-style to see the box-shadow
@@ -32,14 +33,14 @@ const StyledTabs = styled(Tabs)(({ theme }) => ({
fontWeight: theme.typography.fontWeightSemiBold,
minWidth: 0,
minHeight: 0,
- color: (theme.vars || theme).palette.grey[600],
+ color: (theme.vars || theme).palette.text.tertiary,
borderRadius: 20,
zIndex: 2,
'&:hover': {
- color: (theme.vars || theme).palette.grey[800],
+ color: (theme.vars || theme).palette.text.primary,
},
'&.Mui-selected': {
- color: (theme.vars || theme).palette.primary[500],
+ color: (theme.vars || theme).palette.primary[600],
fontWeight: theme.typography.fontWeightSemiBold,
},
'&.Mui-focusVisible': {
@@ -58,19 +59,14 @@ const StyledTabs = styled(Tabs)(({ theme }) => ({
...theme.applyDarkStyles({
borderColor: (theme.vars || theme).palette.primaryDark[700],
backgroundColor: (theme.vars || theme).palette.primaryDark[900],
- color: (theme.vars || theme).palette.grey[400],
'& .MuiTabs-indicator': {
height: '100%',
borderRadius: 20,
backgroundColor: alpha(theme.palette.primaryDark[600], 0.5),
- borderColor: (theme.vars || theme).palette.primaryDark[500],
+ borderColor: (theme.vars || theme).palette.primaryDark[600],
boxShadow: `0px 1px 4px ${(theme.vars || theme).palette.common.black}`,
},
'& .MuiTab-root': {
- color: (theme.vars || theme).palette.grey[400],
- '&:hover': {
- color: (theme.vars || theme).palette.grey[300],
- },
'&.Mui-selected': {
color: (theme.vars || theme).palette.primary[200],
},
diff --git a/docs/src/components/pricing/PricingTable.tsx b/docs/src/components/pricing/PricingTable.tsx
index e9b9dc71280ea1..c4d14e4cf645dc 100644
--- a/docs/src/components/pricing/PricingTable.tsx
+++ b/docs/src/components/pricing/PricingTable.tsx
@@ -1338,8 +1338,8 @@ export default function PricingTable({
sx={[
(theme) => ({
px: 1,
- py: 1.5,
justifyContent: 'flex-start',
+ fontSize: '0.875rem',
fontWeight: 'medium',
borderRadius: '0px',
position: 'absolute',
@@ -1489,8 +1489,8 @@ export default function PricingTable({
sx={[
(theme) => ({
px: 1,
- py: 1.5,
justifyContent: 'flex-start',
+ fontSize: '0.875rem',
fontWeight: 'medium',
borderRadius: '0px',
position: 'absolute',
diff --git a/docs/src/components/productX/XHero.tsx b/docs/src/components/productX/XHero.tsx
index 95d9d956cefd6b..89059c5235b17f 100644
--- a/docs/src/components/productX/XHero.tsx
+++ b/docs/src/components/productX/XHero.tsx
@@ -141,7 +141,7 @@ export default function XHero() {
...theme.applyDarkStyles({
borderColor: 'primaryDark.700',
backgroundColor: 'primaryDark.900',
- boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.4)',
+ boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2)',
}),
})}
>
@@ -281,7 +281,7 @@ export default function XHero() {
...theme.applyDarkStyles({
borderColor: 'primaryDark.700',
backgroundColor: 'primaryDark.900',
- boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.4)',
+ boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2)',
}),
})}
>
@@ -338,7 +338,7 @@ export default function XHero() {
(theme) =>
theme.applyDarkStyles({
borderColor: 'primaryDark.700',
- boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.4)',
+ boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2)',
backgroundColor: 'primaryDark.900',
'& .MuiDateRangePickerDay-day.Mui-selected': {
color: '#FFF',
diff --git a/docs/src/components/showcase/FolderTable.tsx b/docs/src/components/showcase/FolderTable.tsx
index dcf0005bfdf3cf..bd1694b4c40633 100644
--- a/docs/src/components/showcase/FolderTable.tsx
+++ b/docs/src/components/showcase/FolderTable.tsx
@@ -91,6 +91,7 @@ export default function BasicTable() {
sx={[
{
maxWidth: 260,
+ borderColor: 'grey.200',
boxShadow: (theme) => `0px 4px 8px ${alpha(theme.palette.grey[200], 0.6)}`,
[`& .${tableCellClasses.root}`]: {
borderColor: 'grey.200',
@@ -103,7 +104,7 @@ export default function BasicTable() {
theme.applyDarkStyles({
bgcolor: 'primaryDark.900',
borderColor: 'primaryDark.700',
- boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.4)',
+ boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2)',
[`& .${tableCellClasses.root}`]: {
borderColor: 'primaryDark.700',
},
diff --git a/docs/src/components/showcase/NotificationCard.tsx b/docs/src/components/showcase/NotificationCard.tsx
index 8f08369d6b3a4f..ab0f3097c1b409 100644
--- a/docs/src/components/showcase/NotificationCard.tsx
+++ b/docs/src/components/showcase/NotificationCard.tsx
@@ -17,11 +17,12 @@ export default function NotificationCard() {
p: 2,
gap: 2,
maxWidth: 283,
+ borderColor: 'grey.200',
boxShadow: `0px 4px 8px ${alpha(theme.palette.grey[200], 0.6)}`,
...theme.applyDarkStyles({
bgcolor: 'primaryDark.900',
borderColor: 'primaryDark.700',
- boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.4)',
+ boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2)',
}),
})}
>
diff --git a/docs/src/components/showcase/PlayerCard.tsx b/docs/src/components/showcase/PlayerCard.tsx
index 8183ffe5f0e81a..37a4e88cd7bd3d 100644
--- a/docs/src/components/showcase/PlayerCard.tsx
+++ b/docs/src/components/showcase/PlayerCard.tsx
@@ -28,7 +28,7 @@ export default function PlayerCard({ disableTheming }: { disableTheming?: boolea
alignItems: 'center',
gap: 2,
...(!disableTheming && {
- borderColor: 'divider',
+ borderColor: 'grey.200',
boxShadow: (theme) => `0px 4px 8px ${alpha(theme.palette.grey[200], 0.6)}`,
[`& .${iconButtonClasses.root}`]: {
border: '1px solid',
@@ -52,7 +52,7 @@ export default function PlayerCard({ disableTheming }: { disableTheming?: boolea
((theme) =>
theme.applyDarkStyles({
bgcolor: 'primaryDark.900',
- boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.4)',
+ boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2)',
[`& .${iconButtonClasses.root}`]: {
bgcolor: 'primary.900',
color: 'primary.200',
diff --git a/docs/src/components/showcase/RealEstateCard.tsx b/docs/src/components/showcase/RealEstateCard.tsx
index 569e8d7166f406..a9306332e62dc5 100644
--- a/docs/src/components/showcase/RealEstateCard.tsx
+++ b/docs/src/components/showcase/RealEstateCard.tsx
@@ -21,7 +21,7 @@ export default function RealEstateCard({ sx, ...props }: CardProps) {
boxShadow: `0px 4px 8px ${alpha(theme.palette.grey[200], 0.6)}`,
...theme.applyDarkStyles({
bgcolor: 'primaryDark.900',
- boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.4)',
+ boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2)',
}),
}),
...(Array.isArray(sx) ? sx : [sx]),
diff --git a/docs/src/components/showcase/TaskCard.tsx b/docs/src/components/showcase/TaskCard.tsx
index d437f7a6f6b217..077ffc8188461c 100644
--- a/docs/src/components/showcase/TaskCard.tsx
+++ b/docs/src/components/showcase/TaskCard.tsx
@@ -13,18 +13,17 @@ export default function TaskCard() {
({
+ sx={{
minWidth: 280,
maxWidth: 360,
minHeight: 280,
display: 'flex',
flexDirection: 'column',
p: 3,
- background: `linear-gradient(to right bottom, ${
- (theme.vars || theme).palette.primary[500]
- }, ${(theme.vars || theme).palette.primary[600]} 120%)`,
- boxShadow: '0px 20px 25px rgba(0, 0, 0, 0.1), 0px 10px 10px rgba(0, 0, 0, 0.04)',
- })}
+ background:
+ 'linear-gradient(180deg, var(--muidocs-palette-primary-600) 0%, var(--muidocs-palette-primary-700) 100%)',
+ boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.04)',
+ }}
>
diff --git a/docs/src/components/showcase/ThemeAccordion.tsx b/docs/src/components/showcase/ThemeAccordion.tsx
index cee46e898ebf03..ee3e35afe8939a 100644
--- a/docs/src/components/showcase/ThemeAccordion.tsx
+++ b/docs/src/components/showcase/ThemeAccordion.tsx
@@ -24,6 +24,7 @@ export default function ThemeAccordion() {
{
[`& .${accordionClasses.root}`]: {
bgcolor: '#fff',
+ borderColor: 'grey.200',
boxShadow: (theme) => `0px 4px 8px ${alpha(theme.palette.grey[200], 0.6)}`,
[`&.${accordionClasses.expanded}`]: {
@@ -59,7 +60,7 @@ export default function ThemeAccordion() {
[`& .${accordionClasses.root}`]: {
bgcolor: 'primaryDark.900',
borderColor: 'primaryDark.700',
- boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.4)',
+ boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2)',
},
[`& .${accordionSummaryClasses.root}`]: {
[`& .${accordionSummaryClasses.content}`]: {
diff --git a/docs/src/components/showcase/ThemeDatePicker.tsx b/docs/src/components/showcase/ThemeDatePicker.tsx
index 2695dba9efbc2a..822ce3b5c4f0a4 100644
--- a/docs/src/components/showcase/ThemeDatePicker.tsx
+++ b/docs/src/components/showcase/ThemeDatePicker.tsx
@@ -95,7 +95,7 @@ export default function ThemeDatePicker() {
'& > div': {
borderColor: 'primaryDark.700',
bgcolor: 'primaryDark.900',
- boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.4)',
+ boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2)',
},
[`& .${iconButtonClasses.root}`]: {
color: 'primary.300',
diff --git a/docs/src/components/showcase/ThemeSlider.tsx b/docs/src/components/showcase/ThemeSlider.tsx
index 5c94f416b82b06..5c5eca0bdbfa93 100644
--- a/docs/src/components/showcase/ThemeSlider.tsx
+++ b/docs/src/components/showcase/ThemeSlider.tsx
@@ -25,7 +25,7 @@ export default function ThemeSlider() {
...theme.applyDarkStyles({
bgcolor: 'primaryDark.900',
borderColor: 'primaryDark.700',
- boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.4)',
+ boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2)',
}),
})}
>
@@ -36,7 +36,6 @@ export default function ThemeSlider() {
valueLabelFormat={valuetext}
valueLabelDisplay="on"
marks={[
- { value: 0, label: '0ºC' },
{ value: 10 },
{ value: 20, label: '20ºC' },
{ value: 30 },
@@ -46,17 +45,15 @@ export default function ThemeSlider() {
{ value: 70 },
{ value: 80, label: '80ºC' },
{ value: 90 },
- { value: 100, label: '100ºC' },
]}
sx={[
{
- display: 'inline-block',
- width: '100%',
- color: 'primary.500',
+ display: 'inline-flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ color: 'primary.main',
height: 6,
- margin: 0,
- pt: 2,
- pb: 2,
+ m: 0,
[`& .${sliderClasses.rail}`]: {
opacity: 1,
bgcolor: 'grey.200',
@@ -65,16 +62,17 @@ export default function ThemeSlider() {
border: 'none',
},
[`& .${sliderClasses.mark}`]: {
- color: 'transparent',
+ color: 'text.tertiary',
},
[`& .${sliderClasses.markLabel}`]: {
- color: 'grey.900',
+ color: 'text.secondary',
fontSize: '0.75rem',
- fontWeight: 600,
+ fontWeight: 'semiBold',
},
[`& .${sliderClasses.thumb}`]: {
- width: 12,
- height: 12,
+ mx: -1,
+ width: 16,
+ height: 16,
'&::before': {
boxShadow: 'none',
},
@@ -82,7 +80,8 @@ export default function ThemeSlider() {
[`& .${sliderClasses.valueLabel}`]: {
backgroundColor: 'transparent',
color: 'primary.600',
- fontWeight: 700,
+ fontSize: '0.75rem',
+ fontWeight: 'bold',
padding: 0,
[`& .${sliderClasses.valueLabelOpen}`]: {
transform: 'none',
@@ -92,15 +91,11 @@ export default function ThemeSlider() {
},
(theme) =>
theme.applyDarkStyles({
- color: 'primary.400',
[`& .${sliderClasses.rail}`]: {
bgcolor: 'primaryDark.600',
},
- [`& .${sliderClasses.markLabel}`]: {
- color: 'grey.600',
- },
[`& .${sliderClasses.valueLabel}`]: {
- color: 'primary.200',
+ color: 'primary.300',
},
}),
]}
diff --git a/docs/src/components/showcase/ThemeTabs.tsx b/docs/src/components/showcase/ThemeTabs.tsx
index 9be02584352a8e..a0d208721ea201 100644
--- a/docs/src/components/showcase/ThemeTabs.tsx
+++ b/docs/src/components/showcase/ThemeTabs.tsx
@@ -19,10 +19,10 @@ export default function ThemeTabs() {
variant="fullWidth"
sx={[
{
- background:
- 'linear-gradient(180deg, var(--muidocs-palette-primary-500) 0%, var(--muidocs-palette-primary-600) 100%)',
borderRadius: 1,
- boxShadow: '0px 20px 25px rgba(0, 0, 0, 0.1), 0px 10px 10px rgba(0, 0, 0, 0.04)',
+ background:
+ 'linear-gradient(180deg, var(--muidocs-palette-primary-600) 0%, var(--muidocs-palette-primary-700) 100%)',
+ boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.04)',
[`& .${tabsClasses.indicator}`]: {
backgroundColor: 'transparent',
'&::before': {
@@ -47,12 +47,6 @@ export default function ThemeTabs() {
},
},
},
- (theme) =>
- theme.applyDarkStyles({
- [`& .${tabClasses.root}`]: {
- color: 'primary.200',
- },
- }),
]}
>
diff --git a/docs/src/components/showcase/ThemeTimeline.tsx b/docs/src/components/showcase/ThemeTimeline.tsx
index 65845d316776a4..42e29a0d7536af 100644
--- a/docs/src/components/showcase/ThemeTimeline.tsx
+++ b/docs/src/components/showcase/ThemeTimeline.tsx
@@ -21,11 +21,12 @@ export default function BasicTimeline() {
pb: 1,
display: 'flex',
alignItems: 'flex-start',
+ borderColor: 'grey.200',
boxShadow: `0px 4px 8px ${alpha(theme.palette.grey[200], 0.6)}`,
...theme.applyDarkStyles({
bgcolor: 'primaryDark.900',
borderColor: 'primaryDark.700',
- boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.4)',
+ boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2)',
}),
})}
>
@@ -42,9 +43,12 @@ export default function BasicTimeline() {
borderRadius: 0.3,
bgcolor: 'primary.50',
color: 'primary.600',
+ border: '1px solid',
+ borderColor: 'primary.100',
...theme.applyDarkStyles({
bgcolor: 'primary.900',
color: 'primary.50',
+ borderColor: 'primary.800',
}),
})}
>
diff --git a/docs/src/components/showcase/ThemeToggleButton.tsx b/docs/src/components/showcase/ThemeToggleButton.tsx
index edddebe19d38b5..2359550e6148ac 100644
--- a/docs/src/components/showcase/ThemeToggleButton.tsx
+++ b/docs/src/components/showcase/ThemeToggleButton.tsx
@@ -20,8 +20,8 @@ export default function ThemeToggleButton() {
bgcolor: '#fff',
'& .MuiToggleButton-root': {
textTransform: 'none',
- fontWeight: 600,
- color: 'grey.700',
+ fontWeight: 'medium',
+ color: 'text.secondary',
'&.Mui-selected': {
color: 'primary.700',
bgcolor: 'primary.50',
@@ -32,7 +32,6 @@ export default function ThemeToggleButton() {
theme.applyDarkStyles({
bgcolor: 'primaryDark.900',
'& .MuiToggleButton-root': {
- color: 'grey.400',
'&.Mui-selected': {
color: 'primary.100',
bgcolor: 'primary.900',
diff --git a/docs/src/modules/brandingTheme.ts b/docs/src/modules/brandingTheme.ts
index b52135676bcff5..763ea0e811bac0 100644
--- a/docs/src/modules/brandingTheme.ts
+++ b/docs/src/modules/brandingTheme.ts
@@ -1178,8 +1178,8 @@ export function getThemedComponents(): ThemeOptions {
root: ({ theme, ownerState }) => [
{
textTransform: 'none',
- fontWeight: 500,
- color: theme.palette.grey[700],
+ fontWeight: 'medium',
+ color: theme.palette.text.secondary,
borderColor: theme.palette.grey[200],
...(ownerState.size === 'small' && {
padding: '0.375rem 0.75rem',
@@ -1194,7 +1194,6 @@ export function getThemedComponents(): ThemeOptions {
},
} as const,
theme.applyDarkStyles({
- color: theme.palette.grey[300],
borderColor: theme.palette.primaryDark[700],
'&:hover': {
backgroundColor: alpha(theme.palette.primaryDark[600], 0.2),
diff --git a/docs/translations/api-docs/button-group/button-group.json b/docs/translations/api-docs/button-group/button-group.json
index a4d761a2f23f79..f3d4332d76ef50 100644
--- a/docs/translations/api-docs/button-group/button-group.json
+++ b/docs/translations/api-docs/button-group/button-group.json
@@ -30,6 +30,12 @@
"variant": { "description": "The variant to use." }
},
"classDescriptions": {
+ "colorPrimary": {
+ "description": "Styles applied to the root element if color="primary"
"
+ },
+ "colorSecondary": {
+ "description": "Styles applied to the root element if color="secondary"
"
+ },
"contained": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the root element",
@@ -58,87 +64,109 @@
"groupedContained": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"contained\"
"
+ "conditions": "variant=\"contained\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-contained and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedContainedHorizontal": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"contained\"
and orientation=\"horizontal\"
"
+ "conditions": "variant=\"contained\"
and orientation=\"horizontal\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-contained , .MuiButtonGroup-horizontal and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedContainedPrimary": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"contained\"
and color=\"primary\"
"
+ "conditions": "variant=\"contained\"
and color=\"primary\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-contained , .MuiButtonGroup-colorPrimary and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedContainedSecondary": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"contained\"
and color=\"secondary\"
"
+ "conditions": "variant=\"contained\"
and color=\"secondary\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-contained , .MuiButtonGroup-colorSecondary and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedContainedVertical": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"contained\"
and orientation=\"vertical\"
"
+ "conditions": "variant=\"contained\"
and orientation=\"vertical\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-contained , .MuiButtonGroup-vertical and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedHorizontal": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "orientation=\"horizontal\"
"
+ "conditions": "orientation=\"horizontal\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-horizontal and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedOutlined": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"outlined\"
"
+ "conditions": "variant=\"outlined\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-outlined and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedOutlinedHorizontal": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"outlined\"
and orientation=\"horizontal\"
"
+ "conditions": "variant=\"outlined\"
and orientation=\"horizontal\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-outlined , .MuiButtonGroup-horizontal and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedOutlinedPrimary": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"outlined\"
and color=\"primary\"
"
+ "conditions": "variant=\"outlined\"
and color=\"primary\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-outlined , .MuiButtonGroup-colorPrimary and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedOutlinedSecondary": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"outlined\"
and color=\"secondary\"
"
+ "conditions": "variant=\"outlined\"
and color=\"secondary\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-outlined , .MuiButtonGroup-colorSecondary and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedOutlinedVertical": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"outlined\"
and orientation=\"vertical\"
"
+ "conditions": "variant=\"outlined\"
and orientation=\"vertical\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-outlined , .MuiButtonGroup-vertical and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedText": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"text\"
"
+ "conditions": "variant=\"text\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-text and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedTextHorizontal": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"text\"
and orientation=\"horizontal\"
"
+ "conditions": "variant=\"text\"
and orientation=\"horizontal\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-text , .MuiButtonGroup-horizontal and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedTextPrimary": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"text\"
and color=\"primary\"
"
+ "conditions": "variant=\"text\"
and color=\"primary\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-text , .MuiButtonGroup-colorPrimary and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedTextSecondary": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"text\"
and color=\"secondary\"
"
+ "conditions": "variant=\"text\"
and color=\"secondary\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-text , .MuiButtonGroup-colorSecondary and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedTextVertical": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "variant=\"text\"
and orientation=\"vertical\"
"
+ "conditions": "variant=\"text\"
and orientation=\"vertical\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-text , .MuiButtonGroup-vertical and .MuiButtonGroup-grouped classes instead. How to migrate"
},
"groupedVertical": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the children",
- "conditions": "orientation=\"vertical\"
"
+ "conditions": "orientation=\"vertical\"
",
+ "deprecationInfo": "Combine the .MuiButtonGroup-vertical and .MuiButtonGroup-grouped classes instead. How to migrate"
+ },
+ "horizontal": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the root element",
+ "conditions": "orientation=\"horizontal\"
"
},
"lastButton": {
"description": "Styles applied to {{nodeName}}.",
diff --git a/packages/mui-base/README.md b/packages/mui-base/README.md
index e96bbd7afda60b..45b919f6e3c34b 100644
--- a/packages/mui-base/README.md
+++ b/packages/mui-base/README.md
@@ -11,8 +11,10 @@ Base UI is a library of headless ("unstyled") React components and low-level ho
Install the package in your project directory with:
+
+
```bash
-npm install @mui/base
+npm install @mui/base@next
```
## Documentation
diff --git a/packages/mui-codemod/README.md b/packages/mui-codemod/README.md
index 55e7f114c0eb14..465fba0845dacf 100644
--- a/packages/mui-codemod/README.md
+++ b/packages/mui-codemod/README.md
@@ -497,6 +497,132 @@ CSS transforms:
npx @mui/codemod@next deprecations/button-classes
```
+#### `button-group-classes`
+
+JS transforms:
+
+```diff
+ import { buttonGroupClasses } from '@mui/material/ButtonGroup';
+
+ MuiButtonGroup: {
+ styleOverrides: {
+ root: {
+- [`& .${buttonGroupClasses.groupedHorizontal}`]: {
++ [`&.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedVertical}`]: {
++ [`&.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedText}`]: {
++ [`&.${buttonGroupClasses.text} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedTextHorizontal}`]: {
++ [`&.${buttonGroupClasses.text}.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedTextVertical}`]: {
++ [`&.${buttonGroupClasses.text}.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedTextPrimary}`]: {
++ [`&.${buttonGroupClasses.text}.${buttonGroupClasses.colorPrimary} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedTextSecondary}`]: {
++ [`&.${buttonGroupClasses.text}.${buttonGroupClasses.colorSecondary} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedOutlined}`]: {
++ [`&.${buttonGroupClasses.outlined} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedOutlinedHorizontal}`]: {
++ [`&.${buttonGroupClasses.outlined}.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedOutlinedVertical}`]: {
++ [`&.${buttonGroupClasses.outlined}.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedOutlinedPrimary}`]: {
++ [`&.${buttonGroupClasses.outlined}.${buttonGroupClasses.colorPrimary} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedOutlinedSecondary}`]: {
++ [`&.${buttonGroupClasses.outlined}.${buttonGroupClasses.colorSecondary} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedContained}`]: {
++ [`&.${buttonGroupClasses.contained} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedContainedHorizontal}`]: {
++ [`&.${buttonGroupClasses.contained}.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedContainedVertical}`]: {
++ [`&.${buttonGroupClasses.contained}.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedContainedPrimary}`]: {
++ [`&.${buttonGroupClasses.contained}.${buttonGroupClasses.colorPrimary} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+- [`& .${buttonGroupClasses.groupedContainedSecondary}`]: {
++ [`&.${buttonGroupClasses.contained}.${buttonGroupClasses.colorSecondary} > .${buttonGroupClasses.grouped}`]: {
+ color: 'red',
+ },
+ },
+ },
+ },
+```
+
+CSS transforms:
+
+```diff
+-.MuiButtonGroup-root .MuiButtonGroup-groupedHorizontal
++.MuiButtonGroup-root.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedVertical
++.MuiButtonGroup-root.MuiButtonGroup-vertical > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedText
++.MuiButtonGroup-root.MuiButtonGroup-text > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedTextHorizontal
++.MuiButtonGroup-root.MuiButtonGroup-text.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedTextVertical
++.MuiButtonGroup-root.MuiButtonGroup-text.MuiButtonGroup-vertical > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedTextPrimary
++.MuiButtonGroup-root.MuiButtonGroup-text.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedTextSecondary
++.MuiButtonGroup-root.MuiButtonGroup-text.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedOutlined
++.MuiButtonGroup-root.MuiButtonGroup-outlined > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedOutlinedHorizontal
++.MuiButtonGroup-root.MuiButtonGroup-outlined.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedOutlinedVertical
++.MuiButtonGroup-root.MuiButtonGroup-outlined.MuiButtonGroup-vertical > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedOutlinedPrimary
++.MuiButtonGroup-root.MuiButtonGroup-outlined.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedOutlinedSecondary
++.MuiButtonGroup-root.MuiButtonGroup-outlined.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedContained
++.MuiButtonGroup-root.MuiButtonGroup-contained > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedContainedHorizontal
++.MuiButtonGroup-root.MuiButtonGroup-contained.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedContainedVertical
++.MuiButtonGroup-root.MuiButtonGroup-contained.MuiButtonGroup-vertical > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedContainedPrimary
++.MuiButtonGroup-root.MuiButtonGroup-contained.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped
+-.MuiButtonGroup-root .MuiButtonGroup-groupedContainedSecondary
++.MuiButtonGroup-root.MuiButtonGroup-contained.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped
+```
+
+```bash
+npx @mui/codemod@latest deprecations/button-group-classes
+```
+
#### `chip-classes`
JS transforms:
diff --git a/packages/mui-codemod/src/deprecations/all/deprecations-all.js b/packages/mui-codemod/src/deprecations/all/deprecations-all.js
index d2e5772afc4a83..30af0e6d4a7aa8 100644
--- a/packages/mui-codemod/src/deprecations/all/deprecations-all.js
+++ b/packages/mui-codemod/src/deprecations/all/deprecations-all.js
@@ -3,6 +3,7 @@ import transformAvatarProps from '../avatar-props';
import transformDividerProps from '../divider-props';
import transformAccordionClasses from '../accordion-summary-classes';
import transformButtonClasses from '../button-classes';
+import transformButtonGroupClasses from '../button-group-classes';
import transformChipClasses from '../chip-classes';
import transformPaginationItemClasses from '../pagination-item-classes';
import transformAlertClasses from '../alert-classes';
@@ -18,6 +19,7 @@ export default function deprecationsAll(file, api, options) {
file.source = transformDividerProps(file, api, options);
file.source = transformAccordionClasses(file, api, options);
file.source = transformButtonClasses(file, api, options);
+ file.source = transformButtonGroupClasses(file, api, options);
file.source = transformChipClasses(file, api, options);
file.source = transformPaginationItemClasses(file, api, options);
file.source = transformAlertClasses(file, api, options);
diff --git a/packages/mui-codemod/src/deprecations/all/postcss.config.js b/packages/mui-codemod/src/deprecations/all/postcss.config.js
index 9673a34e2131fd..67d88d6ac1e777 100644
--- a/packages/mui-codemod/src/deprecations/all/postcss.config.js
+++ b/packages/mui-codemod/src/deprecations/all/postcss.config.js
@@ -3,6 +3,7 @@ const {
} = require('../accordion-summary-classes/postcss-plugin');
const { plugin: alertClassesPlugin } = require('../alert-classes/postcss-plugin');
const { plugin: buttonClassesPlugin } = require('../button-classes/postcss-plugin');
+const { plugin: buttonGroupClassesPlugin } = require('../button-group-classes/postcss-plugin');
const { plugin: chipClassesPlugin } = require('../chip-classes/postcss-plugin');
const {
plugin: paginationItemClassesPlugin,
@@ -13,6 +14,7 @@ module.exports = {
accordionSummaryClassesPlugin,
alertClassesPlugin,
buttonClassesPlugin,
+ buttonGroupClassesPlugin,
chipClassesPlugin,
paginationItemClassesPlugin,
],
diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.js b/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.js
new file mode 100644
index 00000000000000..cffe90a28e2599
--- /dev/null
+++ b/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.js
@@ -0,0 +1,127 @@
+import { classes } from './postcss-plugin';
+
+/**
+ * @param {import('jscodeshift').FileInfo} file
+ * @param {import('jscodeshift').API} api
+ */
+export default function transformer(file, api, options) {
+ const j = api.jscodeshift;
+ const root = j(file.source);
+ const printOptions = options.printOptions;
+ classes.forEach(({ deprecatedClass, replacementSelector }) => {
+ const replacementSelectorPrefix = '&';
+ root
+ .find(j.ImportDeclaration)
+ .filter((path) => path.node.source.value.match(/^@mui\/material\/ButtonGroup$/))
+ .forEach((path) => {
+ path.node.specifiers.forEach((specifier) => {
+ if (
+ specifier.type === 'ImportSpecifier' &&
+ specifier.imported.name === 'buttonGroupClasses'
+ ) {
+ const deprecatedAtomicClass = deprecatedClass.replace(
+ `${deprecatedClass.split('-')[0]}-`,
+ '',
+ );
+ root
+ .find(j.MemberExpression, {
+ object: { name: specifier.local.name },
+ property: { name: deprecatedAtomicClass },
+ })
+ .forEach((memberExpression) => {
+ const parent = memberExpression.parentPath.parentPath.value;
+ if (parent.type === j.TemplateLiteral.name) {
+ const memberExpressionIndex = parent.expressions.findIndex(
+ (expression) => expression === memberExpression.value,
+ );
+ const precedingTemplateElement = parent.quasis[memberExpressionIndex];
+ const atomicClasses = replacementSelector
+ .replaceAll('MuiButtonGroup-', '')
+ .replaceAll(replacementSelectorPrefix, '')
+ .replaceAll(' > ', '')
+ .split('.')
+ .filter(Boolean);
+
+ if (
+ precedingTemplateElement.value.raw.endsWith(
+ deprecatedClass.startsWith(' ')
+ ? `${replacementSelectorPrefix} .`
+ : `${replacementSelectorPrefix}.`,
+ )
+ ) {
+ const atomicClassesArgs = [
+ memberExpressionIndex,
+ 1,
+ ...atomicClasses.map((atomicClass) =>
+ j.memberExpression(
+ memberExpression.value.object,
+ j.identifier(atomicClass),
+ ),
+ ),
+ ];
+ parent.expressions.splice(...atomicClassesArgs);
+
+ if (replacementSelector.includes(' > ')) {
+ const quasisArgs = [
+ memberExpressionIndex,
+ 1,
+ j.templateElement(
+ {
+ raw: precedingTemplateElement.value.raw.replace(' ', ''),
+ cooked: precedingTemplateElement.value.cooked.replace(' ', ''),
+ },
+ false,
+ ),
+ j.templateElement({ raw: ' > .', cooked: ' > .' }, false),
+ ];
+
+ if (atomicClasses.length === 3) {
+ quasisArgs.splice(
+ 3,
+ 0,
+ j.templateElement({ raw: '.', cooked: '.' }, false),
+ );
+ }
+
+ parent.quasis.splice(...quasisArgs);
+ } else {
+ parent.quasis.splice(
+ memberExpressionIndex,
+ 1,
+ j.templateElement(
+ {
+ raw: precedingTemplateElement.value.raw,
+ cooked: precedingTemplateElement.value.cooked,
+ },
+ false,
+ ),
+
+ j.templateElement({ raw: '.', cooked: '.' }, false),
+ );
+ }
+ }
+ }
+ });
+ }
+ });
+ });
+
+ const selectorRegex = new RegExp(`${replacementSelectorPrefix}${deprecatedClass}$`);
+ root
+ .find(
+ j.Literal,
+ (literal) => typeof literal.value === 'string' && literal.value.match(selectorRegex),
+ )
+ .forEach((path) => {
+ path.replace(
+ j.literal(
+ path.value.value.replace(
+ selectorRegex,
+ `${replacementSelectorPrefix}${replacementSelector}`,
+ ),
+ ),
+ );
+ });
+ });
+ return root.toSource(printOptions);
+}
diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.test.js b/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.test.js
new file mode 100644
index 00000000000000..f01fec88ccb4a4
--- /dev/null
+++ b/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.test.js
@@ -0,0 +1,78 @@
+import path from 'path';
+import { expect } from 'chai';
+import postcss from 'postcss';
+import { jscodeshift } from '../../../testUtils';
+import jsTransform from './button-group-classes';
+import { plugin as postcssPlugin } from './postcss-plugin';
+import readFile from '../../util/readFile';
+
+function read(fileName) {
+ return readFile(path.join(__dirname, fileName));
+}
+
+const postcssProcessor = postcss([postcssPlugin]);
+
+describe('@mui/codemod', () => {
+ describe('deprecations', () => {
+ describe('button-group-classes', () => {
+ describe('js-transform', () => {
+ it('transforms props as needed', () => {
+ const actual = jsTransform(
+ { source: read('./test-cases/actual.js') },
+ { jscodeshift },
+ { printOptions: { quote: 'double', trailingComma: true } },
+ );
+
+ const expected = read('./test-cases/expected.js');
+ expect(actual).to.equal(expected, 'The transformed version should be correct');
+ });
+
+ it('should be idempotent', () => {
+ const actual = jsTransform(
+ { source: read('./test-cases/expected.js') },
+ { jscodeshift },
+ {},
+ );
+
+ const expected = read('./test-cases/expected.js');
+ expect(actual).to.equal(expected, 'The transformed version should be correct');
+ });
+ });
+
+ describe('css-transform', () => {
+ it('transforms classes as needed', async () => {
+ const actual = await postcssProcessor.process(read('./test-cases/actual.css'), {
+ from: undefined,
+ });
+
+ const expected = read('./test-cases/expected.css');
+ expect(actual.css).to.equal(expected, 'The transformed version should be correct');
+ });
+
+ it('should be idempotent', async () => {
+ const actual = await postcssProcessor.process(read('./test-cases/expected.css'), {
+ from: undefined,
+ });
+
+ const expected = read('./test-cases/expected.css');
+ expect(actual.css).to.equal(expected, 'The transformed version should be correct');
+ });
+ });
+
+ describe('test-cases', () => {
+ it('should not be the same', () => {
+ const actualJS = read('./test-cases/actual.js');
+ const expectedJS = read('./test-cases/expected.js');
+ expect(actualJS).not.to.equal(expectedJS, 'The actual and expected should be different');
+
+ const actualCSS = read('./test-cases/actual.css');
+ const expectedCSS = read('./test-cases/expected.css');
+ expect(actualCSS).not.to.equal(
+ expectedCSS,
+ 'The actual and expected should be different',
+ );
+ });
+ });
+ });
+ });
+});
diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/index.js b/packages/mui-codemod/src/deprecations/button-group-classes/index.js
new file mode 100644
index 00000000000000..61090001f8f759
--- /dev/null
+++ b/packages/mui-codemod/src/deprecations/button-group-classes/index.js
@@ -0,0 +1 @@
+export { default } from './button-group-classes';
diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/postcss-plugin.js b/packages/mui-codemod/src/deprecations/button-group-classes/postcss-plugin.js
new file mode 100644
index 00000000000000..1d3ebf4054fead
--- /dev/null
+++ b/packages/mui-codemod/src/deprecations/button-group-classes/postcss-plugin.js
@@ -0,0 +1,103 @@
+const classes = [
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedHorizontal',
+ replacementSelector: '.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedVertical',
+ replacementSelector: '.MuiButtonGroup-vertical > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedText',
+ replacementSelector: '.MuiButtonGroup-text > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedTextHorizontal',
+ replacementSelector: '.MuiButtonGroup-text.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedTextVertical',
+ replacementSelector: '.MuiButtonGroup-text.MuiButtonGroup-vertical > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedTextPrimary',
+ replacementSelector:
+ '.MuiButtonGroup-text.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedTextSecondary',
+ replacementSelector:
+ '.MuiButtonGroup-text.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedOutlined',
+ replacementSelector: '.MuiButtonGroup-outlined > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedOutlinedHorizontal',
+ replacementSelector:
+ '.MuiButtonGroup-outlined.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedOutlinedVertical',
+ replacementSelector:
+ '.MuiButtonGroup-outlined.MuiButtonGroup-vertical > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedOutlinedPrimary',
+ replacementSelector:
+ '.MuiButtonGroup-outlined.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedOutlinedSecondary',
+ replacementSelector:
+ '.MuiButtonGroup-outlined.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedContained',
+ replacementSelector: '.MuiButtonGroup-contained > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedContainedHorizontal',
+ replacementSelector:
+ '.MuiButtonGroup-contained.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedContainedVertical',
+ replacementSelector:
+ '.MuiButtonGroup-contained.MuiButtonGroup-vertical > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedContainedPrimary',
+ replacementSelector:
+ '.MuiButtonGroup-contained.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped',
+ },
+ {
+ deprecatedClass: ' .MuiButtonGroup-groupedContainedSecondary',
+ replacementSelector:
+ '.MuiButtonGroup-contained.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped',
+ },
+];
+
+const plugin = () => {
+ return {
+ postcssPlugin: `Replace deperecated ButtonGroup classes with new classes`,
+ Rule(rule) {
+ const { selector } = rule;
+
+ classes.forEach(({ deprecatedClass, replacementSelector }) => {
+ const selectorRegex = new RegExp(`${deprecatedClass}$`);
+
+ if (selector.match(selectorRegex)) {
+ rule.selector = selector.replace(selectorRegex, replacementSelector);
+ }
+ });
+ },
+ };
+};
+plugin.postcss = true;
+
+module.exports = {
+ plugin,
+ classes,
+};
diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/postcss.config.js b/packages/mui-codemod/src/deprecations/button-group-classes/postcss.config.js
new file mode 100644
index 00000000000000..23bebc1125be6e
--- /dev/null
+++ b/packages/mui-codemod/src/deprecations/button-group-classes/postcss.config.js
@@ -0,0 +1,5 @@
+const { plugin } = require('./postcss-plugin');
+
+module.exports = {
+ plugins: [plugin],
+};
diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/actual.css b/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/actual.css
new file mode 100644
index 00000000000000..776ac7444db6e6
--- /dev/null
+++ b/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/actual.css
@@ -0,0 +1,67 @@
+.MuiButtonGroup-root .MuiButtonGroup-groupedHorizontal {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedVertical {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedText {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedTextHorizontal {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedTextVertical {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedTextPrimary {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedTextSecondary {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedOutlined {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedOutlinedHorizontal {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedOutlinedVertical {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedOutlinedPrimary {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedOutlinedSecondary {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedContained {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedContainedHorizontal {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedContainedVertical {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedContainedPrimary {
+ color: red;
+}
+
+.MuiButtonGroup-root .MuiButtonGroup-groupedContainedSecondary {
+ color: red;
+}
diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/actual.js b/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/actual.js
new file mode 100644
index 00000000000000..a01fc2611a63ac
--- /dev/null
+++ b/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/actual.js
@@ -0,0 +1,36 @@
+import { buttonGroupClasses } from '@mui/material/ButtonGroup';
+
+('& .MuiButtonGroup-groupedHorizontal');
+('& .MuiButtonGroup-groupedVertical');
+('& .MuiButtonGroup-groupedText');
+('& .MuiButtonGroup-groupedTextHorizontal');
+('& .MuiButtonGroup-groupedTextVertical');
+('& .MuiButtonGroup-groupedTextPrimary');
+('& .MuiButtonGroup-groupedTextSecondary');
+('& .MuiButtonGroup-groupedOutlined');
+('& .MuiButtonGroup-groupedOutlinedHorizontal');
+('& .MuiButtonGroup-groupedOutlinedVertical');
+('& .MuiButtonGroup-groupedOutlinedPrimary');
+('& .MuiButtonGroup-groupedOutlinedSecondary');
+('& .MuiButtonGroup-groupedContained');
+('& .MuiButtonGroup-groupedContainedHorizontal');
+('& .MuiButtonGroup-groupedContainedVertical');
+('& .MuiButtonGroup-groupedContainedPrimary');
+('& .MuiButtonGroup-groupedContainedSecondary');
+`& .${buttonGroupClasses.groupedHorizontal}`;
+`& .${buttonGroupClasses.groupedVertical}`;
+`& .${buttonGroupClasses.groupedText}`;
+`& .${buttonGroupClasses.groupedTextHorizontal}`;
+`& .${buttonGroupClasses.groupedTextVertical}`;
+`& .${buttonGroupClasses.groupedTextPrimary}`;
+`& .${buttonGroupClasses.groupedTextSecondary}`;
+`& .${buttonGroupClasses.groupedOutlined}`;
+`& .${buttonGroupClasses.groupedOutlinedHorizontal}`;
+`& .${buttonGroupClasses.groupedOutlinedVertical}`;
+`& .${buttonGroupClasses.groupedOutlinedPrimary}`;
+`& .${buttonGroupClasses.groupedOutlinedSecondary}`;
+`& .${buttonGroupClasses.groupedContained}`;
+`& .${buttonGroupClasses.groupedContainedHorizontal}`;
+`& .${buttonGroupClasses.groupedContainedVertical}`;
+`& .${buttonGroupClasses.groupedContainedPrimary}`;
+`& .${buttonGroupClasses.groupedContainedSecondary}`;
diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.css b/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.css
new file mode 100644
index 00000000000000..304f77cbcabb29
--- /dev/null
+++ b/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.css
@@ -0,0 +1,67 @@
+.MuiButtonGroup-root.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-vertical > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-text > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-text.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-text.MuiButtonGroup-vertical > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-text.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-text.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-outlined > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-outlined.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-outlined.MuiButtonGroup-vertical > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-outlined.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-outlined.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-contained > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-contained.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-contained.MuiButtonGroup-vertical > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-contained.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped {
+ color: red;
+}
+
+.MuiButtonGroup-root.MuiButtonGroup-contained.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped {
+ color: red;
+}
diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.js b/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.js
new file mode 100644
index 00000000000000..809d1ecfba446b
--- /dev/null
+++ b/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.js
@@ -0,0 +1,36 @@
+import { buttonGroupClasses } from '@mui/material/ButtonGroup';
+
+("&.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-vertical > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-text > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-text.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-text.MuiButtonGroup-vertical > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-text.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-text.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-outlined > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-outlined.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-outlined.MuiButtonGroup-vertical > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-outlined.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-outlined.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-contained > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-contained.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-contained.MuiButtonGroup-vertical > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-contained.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped");
+("&.MuiButtonGroup-contained.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped");
+`&.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.text} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.text}.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.text}.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.text}.${buttonGroupClasses.colorPrimary} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.text}.${buttonGroupClasses.colorSecondary} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.outlined} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.outlined}.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.outlined}.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.outlined}.${buttonGroupClasses.colorPrimary} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.outlined}.${buttonGroupClasses.colorSecondary} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.contained} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.contained}.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.contained}.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.contained}.${buttonGroupClasses.colorPrimary} > .${buttonGroupClasses.grouped}`;
+`&.${buttonGroupClasses.contained}.${buttonGroupClasses.colorSecondary} > .${buttonGroupClasses.grouped}`;
diff --git a/packages/mui-docs/README.md b/packages/mui-docs/README.md
index 00b0d507a3e6cf..562368dcd515b3 100644
--- a/packages/mui-docs/README.md
+++ b/packages/mui-docs/README.md
@@ -6,15 +6,19 @@ This package hosts the documentation building blocks.
Install the package in your project directory with:
+
+
```bash
-npm install @mui/docs
+npm install @mui/docs@next
```
The docs has a peer dependency on the core components.
If you are not already using Material UI in your project, you can add it with:
+
+
```bash
-npm install @mui/material
+npm install @mui/material@next
```
## Documentation
diff --git a/packages/mui-joy/README.md b/packages/mui-joy/README.md
index 4921f8a288f6af..30fdd7c1f9011a 100644
--- a/packages/mui-joy/README.md
+++ b/packages/mui-joy/README.md
@@ -11,8 +11,10 @@ Joy UI is an open-source React component library that implements MUI's own desi
Install the package in your project directory with:
+
+
```bash
-npm install @mui/joy @emotion/react @emotion/styled
+npm install @mui/joy@next @emotion/react @emotion/styled
```
## Documentation
diff --git a/packages/mui-material/README.md b/packages/mui-material/README.md
index 13b6dee92b9573..9e5719c35d785b 100644
--- a/packages/mui-material/README.md
+++ b/packages/mui-material/README.md
@@ -11,8 +11,10 @@ Material UI is an open-source React component library that implements Google's
Install the package in your project directory with:
+
+
```bash
-npm install @mui/material @emotion/react @emotion/styled
+npm install @mui/material@next @emotion/react @emotion/styled
```
## Documentation
diff --git a/packages/mui-material/src/AvatarGroup/AvatarGroup.js b/packages/mui-material/src/AvatarGroup/AvatarGroup.js
index 84babf704c59e8..1f6221e06a02ab 100644
--- a/packages/mui-material/src/AvatarGroup/AvatarGroup.js
+++ b/packages/mui-material/src/AvatarGroup/AvatarGroup.js
@@ -5,16 +5,17 @@ import { isFragment } from 'react-is';
import clsx from 'clsx';
import chainPropTypes from '@mui/utils/chainPropTypes';
import composeClasses from '@mui/utils/composeClasses';
-import styled from '../styles/styled';
-import useThemeProps from '../styles/useThemeProps';
+import { styled, createUseThemeProps } from '../zero-styled';
import Avatar, { avatarClasses } from '../Avatar';
import avatarGroupClasses, { getAvatarGroupUtilityClass } from './avatarGroupClasses';
const SPACINGS = {
small: -16,
- medium: null,
+ medium: -8,
};
+const useThemeProps = createUseThemeProps('MuiAlert');
+
const useUtilityClasses = (ownerState) => {
const { classes } = ownerState;
@@ -33,25 +34,18 @@ const AvatarGroupRoot = styled('div', {
[`& .${avatarGroupClasses.avatar}`]: styles.avatar,
...styles.root,
}),
-})(({ theme, ownerState }) => {
- const marginValue =
- ownerState.spacing && SPACINGS[ownerState.spacing] !== undefined
- ? SPACINGS[ownerState.spacing]
- : -ownerState.spacing;
-
- return {
- [`& .${avatarClasses.root}`]: {
- border: `2px solid ${(theme.vars || theme).palette.background.default}`,
- boxSizing: 'content-box',
- marginLeft: marginValue ?? -8,
- '&:last-child': {
- marginLeft: 0,
- },
+})(({ theme }) => ({
+ display: 'flex',
+ flexDirection: 'row-reverse',
+ [`& .${avatarClasses.root}`]: {
+ border: `2px solid ${(theme.vars || theme).palette.background.default}`,
+ boxSizing: 'content-box',
+ marginLeft: 'var(--AvatarGroup-spacing, -8px)',
+ '&:last-child': {
+ marginLeft: 0,
},
- display: 'flex',
- flexDirection: 'row-reverse',
- };
-});
+ },
+}));
const AvatarGroup = React.forwardRef(function AvatarGroup(inProps, ref) {
const props = useThemeProps({
@@ -113,6 +107,11 @@ const AvatarGroup = React.forwardRef(function AvatarGroup(inProps, ref) {
const additionalAvatarSlotProps = slotProps.additionalAvatar ?? componentsProps.additionalAvatar;
+ const marginValue =
+ ownerState.spacing && SPACINGS[ownerState.spacing] !== undefined
+ ? SPACINGS[ownerState.spacing]
+ : -ownerState.spacing || -8;
+
return (
{extraAvatarsElement}
@@ -215,6 +218,10 @@ AvatarGroup.propTypes /* remove-proptypes */ = {
* @default 'medium'
*/
spacing: PropTypes.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.number]),
+ /**
+ * @ignore
+ */
+ style: PropTypes.object,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
diff --git a/packages/mui-material/src/ButtonGroup/ButtonGroup.js b/packages/mui-material/src/ButtonGroup/ButtonGroup.js
index 8dc5c7aa6e1855..7153a43d09ded9 100644
--- a/packages/mui-material/src/ButtonGroup/ButtonGroup.js
+++ b/packages/mui-material/src/ButtonGroup/ButtonGroup.js
@@ -54,9 +54,10 @@ const useUtilityClasses = (ownerState) => {
root: [
'root',
variant,
- orientation === 'vertical' && 'vertical',
+ orientation,
fullWidth && 'fullWidth',
disableElevation && 'disableElevation',
+ `color${capitalize(color)}`,
],
grouped: [
'grouped',
diff --git a/packages/mui-material/src/ButtonGroup/ButtonGroup.test.js b/packages/mui-material/src/ButtonGroup/ButtonGroup.test.js
index bfe0a0f0965543..65387b240d46ef 100644
--- a/packages/mui-material/src/ButtonGroup/ButtonGroup.test.js
+++ b/packages/mui-material/src/ButtonGroup/ButtonGroup.test.js
@@ -38,6 +38,28 @@ describe('', () => {
expect(buttonGroup).not.to.have.class(classes.fullWidth);
});
+ it('should have colorPrimary, horizontal class', () => {
+ const { container } = render(
+
+
+ ,
+ );
+ const buttonGroup = container.firstChild;
+ expect(buttonGroup).to.have.class(classes.colorPrimary);
+ expect(buttonGroup).to.have.class(classes.horizontal);
+ });
+
+ it('should have colorSecondary class', () => {
+ const { container } = render(
+
+
+ ,
+ );
+
+ const buttonGroup = container.firstChild;
+ expect(buttonGroup).to.have.class(classes.colorSecondary);
+ });
+
it('should render an outlined button', () => {
const { getByRole } = render(
diff --git a/packages/mui-material/src/ButtonGroup/buttonGroupClasses.ts b/packages/mui-material/src/ButtonGroup/buttonGroupClasses.ts
index de0223228fa273..89f93aaf8d8ad3 100644
--- a/packages/mui-material/src/ButtonGroup/buttonGroupClasses.ts
+++ b/packages/mui-material/src/ButtonGroup/buttonGroupClasses.ts
@@ -18,43 +18,83 @@ export interface ButtonGroupClasses {
firstButton: string;
/** Styles applied to the root element if `fullWidth={true}`. */
fullWidth: string;
+ /** Styles applied to the root element if `orientation="horizontal"`. */
+ horizontal: string;
/** Styles applied to the root element if `orientation="vertical"`. */
vertical: string;
/** Styles applied to the children. */
grouped: string;
- /** Styles applied to the children if `orientation="horizontal"`. */
+ /** Styles applied to the root element if `color="primary"` */
+ colorPrimary: string;
+ /** Styles applied to the root element if `color="secondary"` */
+ colorSecondary: string;
+ /** Styles applied to the children if `orientation="horizontal"`.
+ * @deprecated Combine the [.MuiButtonGroup-horizontal](/material-ui/api/button-group/#button-group-classes-horizontal) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedHorizontal: string;
- /** Styles applied to the children if `orientation="vertical"`. */
+ /** Styles applied to the children if `orientation="vertical"`.
+ * @deprecated Combine the [.MuiButtonGroup-vertical](/material-ui/api/button-group/#button-group-classes-vertical) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedVertical: string;
- /** Styles applied to the children if `variant="text"`. */
+ /** Styles applied to the children if `variant="text"`.
+ * @deprecated Combine the [.MuiButtonGroup-text](/material-ui/api/button-group/#button-group-classes-text) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedText: string;
- /** Styles applied to the children if `variant="text"` and `orientation="horizontal"`. */
+ /** Styles applied to the children if `variant="text"` and `orientation="horizontal"`.
+ * @deprecated Combine the [.MuiButtonGroup-text](/material-ui/api/button-group/#button-group-classes-text) , [.MuiButtonGroup-horizontal](/material-ui/api/button-group/#button-group-classes-horizontal) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedTextHorizontal: string;
- /** Styles applied to the children if `variant="text"` and `orientation="vertical"`. */
+ /** Styles applied to the children if `variant="text"` and `orientation="vertical"`.
+ * @deprecated Combine the [.MuiButtonGroup-text](/material-ui/api/button-group/#button-group-classes-text) , [.MuiButtonGroup-vertical](/material-ui/api/button-group/#button-group-classes-vertical) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedTextVertical: string;
- /** Styles applied to the children if `variant="text"` and `color="primary"`. */
+ /** Styles applied to the children if `variant="text"` and `color="primary"`.
+ * @deprecated Combine the [.MuiButtonGroup-text](/material-ui/api/button-group/#button-group-classes-text) , [.MuiButtonGroup-colorPrimary](/material-ui/api/button-group/#button-group-classes-colorPrimary) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedTextPrimary: string;
- /** Styles applied to the children if `variant="text"` and `color="secondary"`. */
+ /** Styles applied to the children if `variant="text"` and `color="secondary"`.
+ * @deprecated Combine the [.MuiButtonGroup-text](/material-ui/api/button-group/#button-group-classes-text) , [.MuiButtonGroup-colorSecondary](/material-ui/api/button-group/#button-group-classes-colorSecondary) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedTextSecondary: string;
- /** Styles applied to the children if `variant="outlined"`. */
+ /** Styles applied to the children if `variant="outlined"`.
+ * @deprecated Combine the [.MuiButtonGroup-outlined](/material-ui/api/button-group/#button-group-classes-outlined) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedOutlined: string;
- /** Styles applied to the children if `variant="outlined"` and `orientation="horizontal"`. */
+ /** Styles applied to the children if `variant="outlined"` and `orientation="horizontal"`.
+ * @deprecated Combine the [.MuiButtonGroup-outlined](/material-ui/api/button-group/#button-group-classes-outlined) , [.MuiButtonGroup-horizontal](/material-ui/api/button-group/#button-group-classes-horizontal) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedOutlinedHorizontal: string;
- /** Styles applied to the children if `variant="outlined"` and `orientation="vertical"`. */
+ /** Styles applied to the children if `variant="outlined"` and `orientation="vertical"`.
+ * @deprecated Combine the [.MuiButtonGroup-outlined](/material-ui/api/button-group/#button-group-classes-outlined) , [.MuiButtonGroup-vertical](/material-ui/api/button-group/#button-group-classes-vertical) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedOutlinedVertical: string;
- /** Styles applied to the children if `variant="outlined"` and `color="primary"`. */
+ /** Styles applied to the children if `variant="outlined"` and `color="primary"`.
+ * @deprecated Combine the [.MuiButtonGroup-outlined](/material-ui/api/button-group/#button-group-classes-outlined) , [.MuiButtonGroup-colorPrimary](/material-ui/api/button-group/#button-group-classes-colorPrimary) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedOutlinedPrimary: string;
- /** Styles applied to the children if `variant="outlined"` and `color="secondary"`. */
+ /** Styles applied to the children if `variant="outlined"` and `color="secondary"`.
+ * @deprecated Combine the [.MuiButtonGroup-outlined](/material-ui/api/button-group/#button-group-classes-outlined) , [.MuiButtonGroup-colorSecondary](/material-ui/api/button-group/#button-group-classes-colorSecondary) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedOutlinedSecondary: string;
- /** Styles applied to the children if `variant="contained"`. */
+ /** Styles applied to the children if `variant="contained"`.
+ * @deprecated Combine the [.MuiButtonGroup-contained](/material-ui/api/button-group/#button-group-classes-contained) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedContained: string;
- /** Styles applied to the children if `variant="contained"` and `orientation="horizontal"`. */
+ /** Styles applied to the children if `variant="contained"` and `orientation="horizontal"`.
+ * @deprecated Combine the [.MuiButtonGroup-contained](/material-ui/api/button-group/#button-group-classes-contained) , [.MuiButtonGroup-horizontal](/material-ui/api/button-group/#button-group-classes-horizontal) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedContainedHorizontal: string;
- /** Styles applied to the children if `variant="contained"` and `orientation="vertical"`. */
+ /** Styles applied to the children if `variant="contained"` and `orientation="vertical"`.
+ * @deprecated Combine the [.MuiButtonGroup-contained](/material-ui/api/button-group/#button-group-classes-contained) , [.MuiButtonGroup-vertical](/material-ui/api/button-group/#button-group-classes-vertical) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedContainedVertical: string;
- /** Styles applied to the children if `variant="contained"` and `color="primary"`. */
+ /** Styles applied to the children if `variant="contained"` and `color="primary"`.
+ * @deprecated Combine the [.MuiButtonGroup-contained](/material-ui/api/button-group/#button-group-classes-contained) , [.MuiButtonGroup-colorPrimary](/material-ui/api/button-group/#button-group-classes-colorPrimary) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedContainedPrimary: string;
- /** Styles applied to the children if `variant="contained"` and `color="secondary"`. */
+ /** Styles applied to the children if `variant="contained"` and `color="secondary"`.
+ * @deprecated Combine the [.MuiButtonGroup-contained](/material-ui/api/button-group/#button-group-classes-contained) , [.MuiButtonGroup-colorSecondary](/material-ui/api/button-group/#button-group-classes-colorSecondary) and [.MuiButtonGroup-grouped](/material-ui/api/button-group/#button-group-classes-grouped) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
+ */
groupedContainedSecondary: string;
/** Styles applied to the last button in the button group. */
lastButton: string;
@@ -77,7 +117,10 @@ const buttonGroupClasses: ButtonGroupClasses = generateUtilityClasses('MuiButton
'disabled',
'firstButton',
'fullWidth',
+ 'horizontal',
'vertical',
+ 'colorPrimary',
+ 'colorSecondary',
'grouped',
'groupedHorizontal',
'groupedVertical',
diff --git a/packages/mui-styles/README.md b/packages/mui-styles/README.md
index 93587d0f4a587a..944061cd8a83da 100644
--- a/packages/mui-styles/README.md
+++ b/packages/mui-styles/README.md
@@ -6,8 +6,10 @@ You can leverage our styling solution, even if you are not using our components.
Install the package in your project directory with:
+
+
```bash
-npm install @mui/styles
+npm install @mui/styles@next
```
## Documentation