From d53afd8a8071a46a44718d5f107fbff9908bc905 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 27 Apr 2023 13:28:12 +0200 Subject: [PATCH] Adjust typing to review - Build api-report Signed-off-by: Philipp Hugenroth --- packages/theme/api-report.md | 12 +++++++----- packages/theme/package.json | 2 +- packages/theme/src/unified/UnifiedTheme.tsx | 2 +- packages/theme/src/v5/types.ts | 15 ++------------- yarn.lock | 4 ++-- 5 files changed, 13 insertions(+), 22 deletions(-) diff --git a/packages/theme/api-report.md b/packages/theme/api-report.md index 763cc48e41..9fd00ff877 100644 --- a/packages/theme/api-report.md +++ b/packages/theme/api-report.md @@ -3,17 +3,17 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { ComponentsProps } from '@material-ui/core/styles/props'; +import type { ComponentsProps } from '@material-ui/core/styles/props'; import { Overrides } from '@material-ui/core/styles/overrides'; -import { Palette } from '@material-ui/core/styles/createPalette'; -import { PaletteOptions } from '@material-ui/core/styles/createPalette'; -import { PaletteOptions as PaletteOptions_2 } from '@mui/material/styles/createPalette'; +import type { Palette } from '@material-ui/core/styles/createPalette'; +import type { PaletteOptions } from '@material-ui/core/styles/createPalette'; +import { PaletteOptions as PaletteOptions_2 } from '@mui/material/styles'; import { ReactNode } from 'react'; import { Theme } from '@mui/material/styles'; import { Theme as Theme_2 } from '@material-ui/core'; import { ThemeOptions } from '@mui/material/styles'; import { ThemeOptions as ThemeOptions_2 } from '@material-ui/core/styles'; -import { ThemeOptions as ThemeOptions_3 } from '@material-ui/core'; +import type { ThemeOptions as ThemeOptions_3 } from '@material-ui/core'; // @public @deprecated export type BackstagePalette = Palette & BackstagePaletteAdditions; @@ -249,6 +249,7 @@ export const palettes: { error: string; text: string; link: string; + closeButtonColor: string; warning: string; }; border: string; @@ -322,6 +323,7 @@ export const palettes: { error: string; text: string; link: string; + closeButtonColor: string; warning: string; }; border: string; diff --git a/packages/theme/package.json b/packages/theme/package.json index 3d9e6fa132..fba9072aa0 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -34,7 +34,7 @@ "dependencies": { "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", - "@mui/material": "^5.11.2", + "@mui/material": "^5.12.2", "@mui/styles": "^5.11.2" }, "peerDependencies": { diff --git a/packages/theme/src/unified/UnifiedTheme.tsx b/packages/theme/src/unified/UnifiedTheme.tsx index 341b9e0a1f..c878cfd5e1 100644 --- a/packages/theme/src/unified/UnifiedTheme.tsx +++ b/packages/theme/src/unified/UnifiedTheme.tsx @@ -20,7 +20,7 @@ import { createTheme, } from '@material-ui/core/styles'; import type { PaletteOptions as PaletteOptionsV4 } from '@material-ui/core/styles/createPalette'; -import { PaletteOptions as PaletteOptionsV5 } from '@mui/material/styles/createPalette'; +import { PaletteOptions as PaletteOptionsV5 } from '@mui/material/styles'; import { adaptV4Theme, Theme as Mui5Theme, diff --git a/packages/theme/src/v5/types.ts b/packages/theme/src/v5/types.ts index 293383180a..31fe72b5b9 100644 --- a/packages/theme/src/v5/types.ts +++ b/packages/theme/src/v5/types.ts @@ -20,13 +20,13 @@ import { BackstageThemeAdditions, } from '../base/types'; -declare module '@mui/material/styles/createPalette' { +declare module '@mui/material/styles' { interface Palette extends BackstagePaletteAdditions {} interface PaletteOptions extends BackstagePaletteAdditions {} } -declare module '@mui/material/styles/createTheme' { +declare module '@mui/material/styles' { interface Theme extends BackstageThemeAdditions {} interface ThemeOptions extends BackstageThemeAdditions {} @@ -35,14 +35,3 @@ declare module '@mui/material/styles/createTheme' { declare module '@mui/private-theming/defaultTheme' { interface DefaultTheme extends Theme {} } - -// This is a workaround for missing methods in React 17 that MUI v5 depends on -// See https://github.com/mui/material-ui/issues/35287 -declare global { - namespace React { - interface DOMAttributes { - onResize?: (event: Event) => void; - onResizeCapture?: (event: Event) => void; - } - } -} diff --git a/yarn.lock b/yarn.lock index cf277ac9fa..1983495c23 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9630,7 +9630,7 @@ __metadata: "@backstage/cli": "workspace:^" "@emotion/react": ^11.10.5 "@emotion/styled": ^11.10.5 - "@mui/material": ^5.11.2 + "@mui/material": ^5.12.2 "@mui/styles": ^5.11.2 "@types/react": ^16.13.1 || ^17.0.0 peerDependencies: @@ -12981,7 +12981,7 @@ __metadata: languageName: node linkType: hard -"@mui/material@npm:^5.11.2, @mui/material@npm:^5.12.2": +"@mui/material@npm:^5.12.2": version: 5.12.2 resolution: "@mui/material@npm:5.12.2" dependencies: