Skip to content

Commit 4ad87db

Browse files
committed
Remove styles deprecated exports
1 parent f3aef7b commit 4ad87db

File tree

17 files changed

+39
-51
lines changed

17 files changed

+39
-51
lines changed

docs/data/material/components/grid-legacy/ResponsiveGrid.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { experimentalStyled as styled } from '@mui/material/styles';
2+
import { styled } from '@mui/material/styles';
33
import Box from '@mui/material/Box';
44
import Paper from '@mui/material/Paper';
55
import Grid from '@mui/material/GridLegacy';

docs/data/material/components/grid-legacy/ResponsiveGrid.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { experimentalStyled as styled } from '@mui/material/styles';
2+
import { styled } from '@mui/material/styles';
33
import Box from '@mui/material/Box';
44
import Paper from '@mui/material/Paper';
55
import Grid from '@mui/material/GridLegacy';

docs/data/material/components/grid/ResponsiveGrid.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { experimentalStyled as styled } from '@mui/material/styles';
2+
import { styled } from '@mui/material/styles';
33
import Box from '@mui/material/Box';
44
import Paper from '@mui/material/Paper';
55
import Grid from '@mui/material/Grid';

docs/data/material/components/grid/ResponsiveGrid.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { experimentalStyled as styled } from '@mui/material/styles';
2+
import { styled } from '@mui/material/styles';
33
import Box from '@mui/material/Box';
44
import Paper from '@mui/material/Paper';
55
import Grid from '@mui/material/Grid';

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

+30
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,26 @@ If you were using a Vite alias to force ESM imports for the icons package, you s
6969
},
7070
```
7171

72+
### createMuiTheme removed
73+
74+
The deprecated `createMuiTheme` function has been removed.
75+
Use `createTheme` instead.
76+
77+
```diff
78+
-import { createMuiTheme } from '@mui/material/styles';
79+
+import { createTheme } from '@mui/material/styles';
80+
```
81+
82+
### experimentalStyled removed
83+
84+
The deprecated `experimentalStyled` function has been removed.
85+
Use `styled` instead.
86+
87+
```diff
88+
-import { experimentalStyled as styled } from '@mui/material/styles';
89+
+import { styled } from '@mui/material/styles';
90+
```
91+
7292
### Grid and Grid2 renamed
7393

7494
The deprecated `Grid` component has been renamed to `GridLegacy`.
@@ -228,3 +248,13 @@ npx @mui/codemod@next v7.0.0/input-label-size-normal-medium <path/to/folder>
228248
### Removal of `data-testid` prop from `SvgIcon`
229249

230250
The default `data-testid` prop has been removed from the icons in `@mui/icons-material` in production bundles. This change ensures that the `data-testid` prop is only defined where needed, reducing the potential for naming clashes and removing unnecessary properties in production.
251+
252+
### StyledEngineProvider deprecated import path removed
253+
254+
Importing `StyledEngineProvider` from `'@mui/material'` was deprecated and now has been removed.
255+
Import it from `'@mui/material/styles'` instead:
256+
257+
```diff
258+
-import { StyledEngineProvider } from '@mui/material';
259+
+import { StyledEngineProvider } from '@mui/material/styles';
260+
```

docs/src/pages/premium-themes/onepirate/modules/components/Button.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { experimentalStyled as styled } from '@mui/material/styles';
2+
import { styled } from '@mui/material/styles';
33
import MuiButton from '@mui/material/Button';
44

55
const ButtonRoot = styled(MuiButton)(({ theme }) => ({

docs/src/pages/premium-themes/onepirate/modules/components/Button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { experimentalStyled as styled } from '@mui/material/styles';
2+
import { styled } from '@mui/material/styles';
33
import MuiButton, { ButtonProps } from '@mui/material/Button';
44

55
const ButtonRoot = styled(MuiButton)(({ theme }) => ({

docs/src/pages/premium-themes/onepirate/modules/form/FormFeedback.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import PropTypes from 'prop-types';
3-
import { experimentalStyled as styled } from '@mui/material/styles';
3+
import { styled } from '@mui/material/styles';
44

55
import Typography from '../components/Typography';
66

docs/src/pages/premium-themes/onepirate/modules/form/FormFeedback.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { experimentalStyled as styled, Theme } from '@mui/material/styles';
2+
import { styled, Theme } from '@mui/material/styles';
33
import { SxProps } from '@mui/system';
44
import Typography from '../components/Typography';
55

packages/mui-material/src/StyledEngineProvider/index.d.ts

-4
This file was deleted.

packages/mui-material/src/StyledEngineProvider/index.js

-1
This file was deleted.

packages/mui-material/src/index.d.ts

-5
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,6 @@ export * from './GlobalStyles';
457457

458458
export * from './version';
459459

460-
/**
461-
* @deprecated will be removed in v5.beta, please use StyledEngineProvider from @mui/material/styles instead
462-
*/
463-
export { StyledEngineProvider } from './styles';
464-
465460
export { unstable_composeClasses } from '@mui/utils';
466461

467462
export { default as generateUtilityClass } from './generateUtilityClass';

packages/mui-material/src/styles/createTheme.ts

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import createThemeWithVars, {
66
} from './createThemeWithVars';
77
import createThemeNoVars, { Theme, ThemeOptions } from './createThemeNoVars';
88

9-
export { createMuiTheme } from './createThemeNoVars';
109
export type { ThemeOptions, Theme, CssThemeVariables } from './createThemeNoVars';
1110

1211
// eslint-disable-next-line consistent-return

packages/mui-material/src/styles/createThemeNoVars.d.ts

-6
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@ export interface Theme extends BaseTheme, CssVarsProperties {
8686
unstable_sxConfig: SxConfig;
8787
}
8888

89-
/**
90-
* @deprecated
91-
* Use `import { createTheme } from '@mui/material/styles'` instead.
92-
*/
93-
export function createMuiTheme(options?: ThemeOptions, ...args: object[]): Theme;
94-
9589
/**
9690
* Generate a theme base on the options received.
9791
* @param options Takes an incomplete theme object and adds the missing parts.

packages/mui-material/src/styles/createThemeNoVars.js

-19
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,4 @@ function createThemeNoVars(options = {}, ...args) {
129129
return muiTheme;
130130
}
131131

132-
let warnedOnce = false;
133-
134-
export function createMuiTheme(...args) {
135-
if (process.env.NODE_ENV !== 'production') {
136-
if (!warnedOnce) {
137-
warnedOnce = true;
138-
console.error(
139-
[
140-
'MUI: the createMuiTheme function was renamed to createTheme.',
141-
'',
142-
"You should use `import { createTheme } from '@mui/material/styles'`",
143-
].join('\n'),
144-
);
145-
}
146-
}
147-
148-
return createThemeNoVars(...args);
149-
}
150-
151132
export default createThemeNoVars;

packages/mui-material/src/styles/index.d.ts

-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ export { default as THEME_ID } from './identifier';
22
export {
33
default as createTheme,
44
default as unstable_createMuiStrictModeTheme,
5-
createMuiTheme,
65
ThemeOptions,
76
Theme,
87
CssThemeVariables,
@@ -78,10 +77,6 @@ export { default as useTheme } from './useTheme';
7877
export { default as useThemeProps } from './useThemeProps';
7978
export * from './useThemeProps';
8079
export { default as styled } from './styled';
81-
/**
82-
* @deprecated will be removed in v5.beta, please use styled from @mui/material/styles instead
83-
*/
84-
export { default as experimentalStyled } from './styled';
8580
export { default as ThemeProvider } from './ThemeProvider';
8681
export { ComponentsProps, ComponentsPropsList } from './props';
8782
export { ComponentsVariants } from './variants';

packages/mui-material/src/styles/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function experimental_sx() {
2424
'For more details, see https://github.com/mui/material-ui/pull/35150.',
2525
);
2626
}
27-
export { default as createTheme, createMuiTheme } from './createTheme';
27+
export { default as createTheme } from './createTheme';
2828
export { default as unstable_createMuiStrictModeTheme } from './createMuiStrictModeTheme';
2929
export { default as createStyles } from './createStyles';
3030
export { getUnit as unstable_getUnit, toUnitless as unstable_toUnitless } from './cssUtils';
@@ -34,7 +34,6 @@ export { default as createColorScheme } from './createColorScheme';
3434
export { default as useTheme } from './useTheme';
3535
export { default as useThemeProps } from './useThemeProps';
3636
export { default as styled } from './styled';
37-
export { default as experimentalStyled } from './styled';
3837
export { default as ThemeProvider } from './ThemeProvider';
3938
export { StyledEngineProvider } from '@mui/system';
4039
// The legacy utilities from @mui/styles

0 commit comments

Comments
 (0)