From 0e9d7d70e44b7d54d0282a763f407fc287361ef3 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 22 Jun 2023 12:41:47 +0200 Subject: [PATCH] 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'; + } +>;