Update api

-reports & changeset

Signed-off-by: Philipp Hugenroth <philipph@spotify.com>
This commit is contained in:
Philipp Hugenroth
2023-07-04 16:52:16 +02:00
parent 4f28914d9f
commit e2fad5e880
4 changed files with 29 additions and 9 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
'@backstage/theme': patch
---
Overwritting `PaletteOptions` & `ThemeOptions` type to allow usage of `createTheme` from `'@backstage/theme'` as well as `@material-ui/core/styles` with the same type. Additionally replacing default `CSSBaseline` wiht v4 instead of v5 for better backwards compatibilty for now.
Overwrite `PaletteOptions` & `ThemeOptions` type to allow use of `createTheme` from `@backstage/theme` as well as `@material-ui/core/styles` with the same type. Also replaced the default `CSSBaseline` with v4 instead of v5 for better backwards compatibility for now.
+14 -7
View File
@@ -10,7 +10,8 @@ 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 { Theme as Theme_2 } from '@material-ui/core/styles';
import { Theme as Theme_3 } from '@material-ui/core';
import { ThemeOptions } from '@mui/material/styles';
import { ThemeOptions as ThemeOptions_2 } from '@material-ui/core/styles';
import type { ThemeOptions as ThemeOptions_3 } from '@material-ui/core';
@@ -86,7 +87,7 @@ export type BackstagePaletteOptions = PaletteOptions &
BackstagePaletteAdditions;
// @public @deprecated
export interface BackstageTheme extends Theme_2 {
export interface BackstageTheme extends Theme_3 {
// (undocumented)
getPageTheme: (selector: PageThemeSelector) => PageTheme;
// (undocumented)
@@ -172,13 +173,13 @@ export function createBaseThemeOptions<PaletteOptions>(
};
// @public @deprecated
export function createTheme(options: SimpleThemeOptions): Theme_2;
export function createTheme(options: SimpleThemeOptions): Theme_3;
// @public @deprecated
export function createThemeOptions(options: SimpleThemeOptions): ThemeOptions_3;
// @public @deprecated
export function createThemeOverrides(theme: Theme_2): Overrides;
export function createThemeOverrides(theme: Theme_3): Overrides;
// @public
export function createUnifiedTheme(options: UnifiedThemeOptions): UnifiedTheme;
@@ -187,7 +188,7 @@ export function createUnifiedTheme(options: UnifiedThemeOptions): UnifiedTheme;
export function createUnifiedThemeFromV4(options: ThemeOptions_2): UnifiedTheme;
// @public @deprecated
export const darkTheme: Theme_2;
export const darkTheme: Theme_3;
// @public
export const defaultComponentThemes: ThemeOptions['components'];
@@ -202,7 +203,7 @@ export function genPageTheme(props: {
}): PageTheme;
// @public @deprecated
export const lightTheme: Theme_2;
export const lightTheme: Theme_3;
// @public
export type PageTheme = {
@@ -380,6 +381,12 @@ export type SimpleThemeOptions = {
htmlFontSize?: number;
};
// @public
export type SupportedThemes = Theme_2 | Theme;
// @public
export type SupportedVersions = 'v4' | 'v5';
// @public
export const themes: {
light: UnifiedTheme;
@@ -398,7 +405,7 @@ export function transformV5ComponentThemesToV4(
// @public
export interface UnifiedTheme {
// (undocumented)
getTheme(version: string): unknown | undefined;
getTheme(version: SupportedVersions): SupportedThemes | undefined;
}
// @public
+1 -1
View File
@@ -20,4 +20,4 @@ export type { UnifiedThemeOptions } from './UnifiedTheme';
export { themes } from './themes';
export { UnifiedThemeProvider } from './UnifiedThemeProvider';
export type { UnifiedThemeProviderProps } from './UnifiedThemeProvider';
export type { UnifiedTheme } from './types';
export type { UnifiedTheme, SupportedThemes, SupportedVersions } from './types';
+13
View File
@@ -17,7 +17,20 @@
import { Theme as Mui4Theme } from '@material-ui/core/styles';
import { Theme as Mui5Theme } from '@mui/material/styles';
/**
* Supported Material UI Versions
*
* Currently: 'v4' and 'v5'.
*
* @public
*/
export type SupportedVersions = 'v4' | 'v5';
/**
* Supported Material UI Theme Types for `SupportedVersions`
*
* @public
*/
export type SupportedThemes = Mui4Theme | Mui5Theme;
/**