Skip to content

Commit caec2d5

Browse files
committed
[circularprogress] Remove deprecated classes
1 parent 85bf0ca commit caec2d5

6 files changed

Lines changed: 19 additions & 45 deletions

File tree

docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,19 @@ The following deprecated `Backdrop` props have been removed:
606606
/>
607607
```
608608

609+
#### CircularProgress deprecated CSS classes removed
610+
611+
Use the [circular-progress-classes codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#circular-progress-classes) below to migrate the code as described in the following section:
612+
613+
```bash
614+
npx @mui/codemod@latest deprecations/circular-progress-classes <path>
615+
```
616+
617+
The following deprecated `CircularProgress` CSS classes have been removed:
618+
619+
- `circleDeterminate` → use `.MuiCircularProgress-determinate > .MuiCircularProgress-circle`
620+
- `circleIndeterminate` → use `.MuiCircularProgress-indeterminate > .MuiCircularProgress-circle`
621+
609622
#### Typography deprecated CSS classes removed
610623

611624
The deprecated `paragraph` CSS class has been removed.

docs/pages/material-ui/api/circular-progress.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,12 @@
4040
"description": "Styles applied to the `circle` svg path.",
4141
"isGlobal": false
4242
},
43-
{
44-
"key": "circleDeterminate",
45-
"className": "MuiCircularProgress-circleDeterminate",
46-
"description": "Styles applied to the `circle` svg path if `variant=\"determinate\"`.",
47-
"isGlobal": false,
48-
"isDeprecated": true
49-
},
5043
{
5144
"key": "circleDisableShrink",
5245
"className": "MuiCircularProgress-circleDisableShrink",
5346
"description": "Styles applied to the `circle` svg path if `disableShrink={true}`.",
5447
"isGlobal": false
5548
},
56-
{
57-
"key": "circleIndeterminate",
58-
"className": "MuiCircularProgress-circleIndeterminate",
59-
"description": "Styles applied to the `circle` svg path if `variant=\"indeterminate\"`.",
60-
"isGlobal": false,
61-
"isDeprecated": true
62-
},
6349
{
6450
"key": "colorPrimary",
6551
"className": "MuiCircularProgress-colorPrimary",

docs/translations/api-docs/circular-progress/circular-progress.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,11 @@
3030
"description": "Styles applied to {{nodeName}}.",
3131
"nodeName": "the <code>circle</code> svg path"
3232
},
33-
"circleDeterminate": {
34-
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
35-
"nodeName": "the <code>circle</code> svg path",
36-
"conditions": "<code>variant=\"determinate\"</code>",
37-
"deprecationInfo": "Combine the <a href=\"/material-ui/api/circular-progress/#circular-progress-classes-MuiCircularProgress-circle\">.MuiCircularProgress-circle</a> and <a href=\"/material-ui/api/circular-progress/#circular-progress-classes-MuiCircularProgress-determinate\">.MuiCircularProgress-determinate</a> classes instead. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
38-
},
3933
"circleDisableShrink": {
4034
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
4135
"nodeName": "the <code>circle</code> svg path",
4236
"conditions": "<code>disableShrink={true}</code>"
4337
},
44-
"circleIndeterminate": {
45-
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
46-
"nodeName": "the <code>circle</code> svg path",
47-
"conditions": "<code>variant=\"indeterminate\"</code>",
48-
"deprecationInfo": "Combine the <a href=\"/material-ui/api/circular-progress/#circular-progress-classes-MuiCircularProgress-circle\">.MuiCircularProgress-circle</a> and <a href=\"/material-ui/api/circular-progress/#circular-progress-classes-MuiCircularProgress-indeterminate\">.MuiCircularProgress-indeterminate</a> classes instead. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
49-
},
5038
"colorPrimary": {
5139
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
5240
"nodeName": "the root element",

packages/mui-material/src/CircularProgress/CircularProgress.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const useUtilityClasses = (ownerState) => {
6464
root: ['root', variant, `color${capitalize(color)}`],
6565
svg: ['svg'],
6666
track: ['track'],
67-
circle: ['circle', `circle${capitalize(variant)}`, disableShrink && 'circleDisableShrink'],
67+
circle: ['circle', disableShrink && 'circleDisableShrink'],
6868
};
6969

7070
return composeClasses(slots, getCircularProgressUtilityClass, classes);
@@ -127,11 +127,7 @@ const CircularProgressCircle = styled('circle', {
127127
overridesResolver: (props, styles) => {
128128
const { ownerState } = props;
129129

130-
return [
131-
styles.circle,
132-
styles[`circle${capitalize(ownerState.variant)}`],
133-
ownerState.disableShrink && styles.circleDisableShrink,
134-
];
130+
return [styles.circle, ownerState.disableShrink && styles.circleDisableShrink];
135131
},
136132
})(
137133
memoTheme(({ theme }) => ({

packages/mui-material/src/CircularProgress/CircularProgress.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ describe('<CircularProgress />', () => {
5252
const circularProgress = container.firstChild;
5353
expect(circularProgress).to.have.class(classes.root);
5454
const svg = circularProgress.firstChild;
55-
expect(svg.firstChild).to.have.class(
56-
classes.circleIndeterminate,
57-
'should have the circleIndeterminate class',
55+
expect(circularProgress).to.have.class(
56+
classes.indeterminate,
57+
'should have the indeterminate class',
5858
);
59+
expect(svg.firstChild).to.have.class(classes.circle, 'should have the circle class');
5960
});
6061

6162
it('should render with a different size', () => {

packages/mui-material/src/CircularProgress/circularProgressClasses.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ export interface CircularProgressClasses {
1818
track: string;
1919
/** Styles applied to the `circle` svg path. */
2020
circle: string;
21-
/** Styles applied to the `circle` svg path if `variant="determinate"`.
22-
* @deprecated Combine the [.MuiCircularProgress-circle](/material-ui/api/circular-progress/#circular-progress-classes-MuiCircularProgress-circle) and [.MuiCircularProgress-determinate](/material-ui/api/circular-progress/#circular-progress-classes-MuiCircularProgress-determinate) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
23-
*/
24-
circleDeterminate: string;
25-
/** Styles applied to the `circle` svg path if `variant="indeterminate"`.
26-
* @deprecated Combine the [.MuiCircularProgress-circle](/material-ui/api/circular-progress/#circular-progress-classes-MuiCircularProgress-circle) and [.MuiCircularProgress-indeterminate](/material-ui/api/circular-progress/#circular-progress-classes-MuiCircularProgress-indeterminate) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
27-
*/
28-
circleIndeterminate: string;
2921
/** Styles applied to the `circle` svg path if `disableShrink={true}`. */
3022
circleDisableShrink: string;
3123
}
@@ -47,8 +39,6 @@ const circularProgressClasses: CircularProgressClasses = generateUtilityClasses(
4739
'svg',
4840
'track',
4941
'circle',
50-
'circleDeterminate',
51-
'circleIndeterminate',
5242
'circleDisableShrink',
5343
],
5444
);

0 commit comments

Comments
 (0)