From 37978d288f3edc6c86c2315611d01652f3fba223 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Mon, 19 Jun 2023 10:31:17 +0200 Subject: [PATCH 1/4] Change IconComponent type to be compatible with MUI5 Signed-off-by: Philipp Hugenroth --- packages/core-plugin-api/src/icons/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-plugin-api/src/icons/types.ts b/packages/core-plugin-api/src/icons/types.ts index d7dca27bf9..3e90c2eac4 100644 --- a/packages/core-plugin-api/src/icons/types.ts +++ b/packages/core-plugin-api/src/icons/types.ts @@ -33,5 +33,5 @@ import { ComponentType } from 'react'; * @public */ export type IconComponent = ComponentType<{ - fontSize?: 'default' | 'small' | 'large'; + fontSize?: 'inherit' | 'medium' | 'large' | 'small'; }>; From 13426ebd1235267373208936e1c507d860069585 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Mon, 19 Jun 2023 10:34:29 +0200 Subject: [PATCH 2/4] Add Changeset Signed-off-by: Philipp Hugenroth --- .changeset/thin-countries-battle.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/thin-countries-battle.md 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. From d43de19df96bebe6c1382e581fdb0fdf276d7ef8 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Mon, 19 Jun 2023 10:42:41 +0200 Subject: [PATCH 3/4] Update api-reports Signed-off-by: Philipp Hugenroth --- packages/core-plugin-api/api-report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-plugin-api/api-report.md b/packages/core-plugin-api/api-report.md index 227b9b9816..110a071f98 100644 --- a/packages/core-plugin-api/api-report.md +++ b/packages/core-plugin-api/api-report.md @@ -503,7 +503,7 @@ export const googleAuthApiRef: ApiRef< // @public export type IconComponent = ComponentType<{ - fontSize?: 'default' | 'small' | 'large'; + fontSize?: 'inherit' | 'medium' | 'large' | 'small'; }>; // @public From 0e9d7d70e44b7d54d0282a763f407fc287361ef3 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 22 Jun 2023 12:41:47 +0200 Subject: [PATCH 4/4] Add Union to consider v4 & v5 Signed-off-by: Philipp Hugenroth --- packages/core-plugin-api/api-report.md | 11 ++++++++--- packages/core-plugin-api/src/icons/types.ts | 14 +++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/packages/core-plugin-api/api-report.md b/packages/core-plugin-api/api-report.md index 110a071f98..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?: 'inherit' | 'medium' | 'large' | 'small'; -}>; +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 3e90c2eac4..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?: 'inherit' | 'medium' | 'large' | 'small'; -}>; + +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'; + } +>;