Merge pull request #18558 from oliviertassinari/mui-material-ui
fix: use Material UI vs. MUI where relevant
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
import { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/material/className';
|
||||
|
||||
/**
|
||||
* This API is introduced in @mui/material (v5.0.5) as a replacement of deprecated createGenerateClassName & only affects v5 MUI components from `@mui/*`
|
||||
* This API is introduced in @mui/material (v5.0.5) as a replacement of deprecated createGenerateClassName & only affects v5 Material UI components from `@mui/*`
|
||||
*/
|
||||
ClassNameGenerator.configure(componentName => {
|
||||
return `v5-${componentName}`;
|
||||
|
||||
@@ -82,8 +82,8 @@ export function createUnifiedTheme(options: UnifiedThemeOptions): UnifiedTheme {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new {@link UnifiedTheme} using MUI v4 theme options.
|
||||
* Note that this uses `adaptV4Theme` from MUI v5, which is deprecated.
|
||||
* Creates a new {@link UnifiedTheme} using Material UI v4 theme options.
|
||||
* Note that this uses `adaptV4Theme` from Material UI v5, which is deprecated.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
|
||||
@@ -43,14 +43,14 @@ export interface UnifiedThemeProviderProps {
|
||||
|
||||
// Background at https://mui.com/x/migration/migration-data-grid-v4/#using-mui-core-v4-with-v5
|
||||
// Rather than disabling globals and custom seed, we instead only set a production prefix that
|
||||
// won't collide with MUI 5 styles. We've already got a separate class name generator for v5 set
|
||||
// won't collide with Material UI 5 styles. We've already got a separate class name generator for v5 set
|
||||
// up in MuiClassNameSetup.ts, so only the production JSS needs deduplication.
|
||||
const generateV4ClassName = createGenerateClassName({
|
||||
productionPrefix: 'jss4-',
|
||||
});
|
||||
|
||||
/**
|
||||
* Provides themes for all MUI versions supported by the provided unified theme.
|
||||
* Provides themes for all Material UI versions supported by the provided unified theme.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
|
||||
@@ -131,7 +131,7 @@ function extractV5StateOverrides(
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform MUI v5 component themes into a v4 theme props and overrides.
|
||||
* Transform Material UI v5 component themes into a v4 theme props and overrides.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,7 @@ import { palettes } from '../base';
|
||||
import { createUnifiedTheme } from './UnifiedTheme';
|
||||
|
||||
/**
|
||||
* Built-in Backstage MUI themes.
|
||||
* Built-in Backstage Material UI themes.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,7 @@ export type SupportedVersions = 'v4' | 'v5';
|
||||
export type SupportedThemes = Mui4Theme | Mui5Theme;
|
||||
|
||||
/**
|
||||
* A container of one theme for multiple different MUI versions.
|
||||
* A container of one theme for multiple different Material UI versions.
|
||||
*
|
||||
* Currently known keys are 'v4' and 'v5'.
|
||||
*
|
||||
|
||||
@@ -29,7 +29,7 @@ import { defaultComponentThemes } from '../v5';
|
||||
import { transformV5ComponentThemesToV4 } from '../unified/overrides';
|
||||
|
||||
/**
|
||||
* An old helper for creating MUI v4 theme options.
|
||||
* An old helper for creating Material UI v4 theme options.
|
||||
*
|
||||
* @public
|
||||
* @deprecated Use {@link createBaseThemeOptions} instead.
|
||||
@@ -47,7 +47,7 @@ export function createThemeOptions(options: SimpleThemeOptions): ThemeOptions {
|
||||
}
|
||||
|
||||
/**
|
||||
* * An old helper for creating MUI v4 theme overrides.
|
||||
* * An old helper for creating Material UI v4 theme overrides.
|
||||
*
|
||||
* @public
|
||||
* @deprecated Use {@link defaultComponentThemes} with {@link transformV5ComponentThemesToV4} instead.
|
||||
@@ -61,7 +61,7 @@ export function createThemeOverrides(theme: Theme): Overrides {
|
||||
}
|
||||
|
||||
/**
|
||||
* The old method to create a Backstage MUI v4 theme using a palette.
|
||||
* The old method to create a Backstage Material UI v4 theme using a palette.
|
||||
* The theme is created with the common Backstage options and component styles.
|
||||
*
|
||||
* @public
|
||||
|
||||
@@ -18,7 +18,7 @@ import { createTheme } from './baseTheme';
|
||||
import { palettes } from '../base';
|
||||
|
||||
/**
|
||||
* The old MUI v4 Backstage light theme.
|
||||
* The old Material UI v4 Backstage light theme.
|
||||
*
|
||||
* @public
|
||||
* @deprecated Use {@link themes.light} instead.
|
||||
@@ -28,7 +28,7 @@ export const lightTheme = createTheme({
|
||||
});
|
||||
|
||||
/**
|
||||
* The old MUI v4 Backstage dark theme.
|
||||
* The old Material UI v4 Backstage dark theme.
|
||||
*
|
||||
* @public
|
||||
* @deprecated Use {@link themes.dark} instead.
|
||||
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
* The full Backstage palette.
|
||||
*
|
||||
* @public
|
||||
* @deprecated This type is deprecated, the MUI Palette type is now always extended instead.
|
||||
* @deprecated This type is deprecated, the Material UI Palette type is now always extended instead.
|
||||
*/
|
||||
export type BackstagePalette = MuiPalette & BackstagePaletteAdditions;
|
||||
|
||||
@@ -41,7 +41,7 @@ export type BackstagePalette = MuiPalette & BackstagePaletteAdditions;
|
||||
* The full Backstage palette options.
|
||||
*
|
||||
* @public
|
||||
* @deprecated This type is deprecated, the MUI PaletteOptions type is now always extended instead.
|
||||
* @deprecated This type is deprecated, the Material UI PaletteOptions type is now always extended instead.
|
||||
*/
|
||||
export type BackstagePaletteOptions = MuiPaletteOptions &
|
||||
BackstagePaletteAdditions;
|
||||
@@ -50,7 +50,7 @@ export type BackstagePaletteOptions = MuiPaletteOptions &
|
||||
* Backstage theme options.
|
||||
*
|
||||
* @public
|
||||
* @deprecated This type is deprecated, the MUI ThemeOptions type is now always extended instead.
|
||||
* @deprecated This type is deprecated, the Material UI ThemeOptions type is now always extended instead.
|
||||
* @remarks
|
||||
*
|
||||
* This is essentially a partial theme definition made by the user, that then
|
||||
@@ -68,7 +68,7 @@ export interface BackstageThemeOptions extends MuiThemeOptions {
|
||||
* A Backstage theme.
|
||||
*
|
||||
* @public
|
||||
* @deprecated This type is deprecated, the MUI Theme type is now always extended instead.
|
||||
* @deprecated This type is deprecated, the Material UI Theme type is now always extended instead.
|
||||
*/
|
||||
export interface BackstageTheme extends MuiTheme {
|
||||
palette: BackstagePalette;
|
||||
|
||||
Reference in New Issue
Block a user