diff --git a/.changeset/thin-countries-battle.md b/.changeset/thin-countries-battle.md new file mode 100644 index 0000000000..27fc49ff16 --- /dev/null +++ b/.changeset/thin-countries-battle.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-plugin-api': patch +--- + +Change `IconComponent` type to be compatible with Material UI v5 icons. diff --git a/packages/core-plugin-api/api-report.md b/packages/core-plugin-api/api-report.md index 227b9b9816..5577d94359 100644 --- a/packages/core-plugin-api/api-report.md +++ b/packages/core-plugin-api/api-report.md @@ -502,9 +502,14 @@ export const googleAuthApiRef: ApiRef< >; // @public -export type IconComponent = ComponentType<{ - fontSize?: 'default' | 'small' | 'large'; -}>; +export type IconComponent = ComponentType< + | { + fontSize?: 'large' | 'small' | 'default'; + } + | { + fontSize?: 'medium' | 'large' | 'small'; + } +>; // @public export type IdentityApi = { diff --git a/packages/core-plugin-api/src/icons/types.ts b/packages/core-plugin-api/src/icons/types.ts index d7dca27bf9..22af0a5737 100644 --- a/packages/core-plugin-api/src/icons/types.ts +++ b/packages/core-plugin-api/src/icons/types.ts @@ -32,6 +32,14 @@ import { ComponentType } from 'react'; * * @public */ -export type IconComponent = ComponentType<{ - fontSize?: 'default' | 'small' | 'large'; -}>; + +export type IconComponent = ComponentType< + /* MUI v4 */ + | { + fontSize?: 'large' | 'small' | 'default'; + } + /* MUI v5: https://mui.com/material-ui/migration/v5-component-changes/#icon */ + | { + fontSize?: 'medium' | 'large' | 'small'; + } +>;