@backstage/theme 0.4.4 → 0.5.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @backstage/theme
2
2
 
3
+ ## 0.5.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 4d9e3b39e4: Added a global `OverrideComponentNameToClassKeys` for other plugins and packages to populate using module augmentation. This will in turn will provide component style override types for `createUnifiedTheme`.
8
+
3
9
  ## 0.4.4
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -3,9 +3,11 @@ import { ComponentsProps } from '@material-ui/core/styles/props';
3
3
  import { Theme, ThemeOptions, PaletteOptions as PaletteOptions$1 } from '@mui/material/styles';
4
4
  import { Theme as Theme$1, ThemeOptions as ThemeOptions$1 } from '@material-ui/core/styles';
5
5
  import { PaletteOptions, Palette } from '@material-ui/core/styles/createPalette';
6
+ import * as _backstage_theme from '@backstage/theme';
6
7
  import { ReactNode } from 'react';
7
8
  import * as _material_ui_core from '@material-ui/core';
8
9
  import { ThemeOptions as ThemeOptions$2, Theme as Theme$2 } from '@material-ui/core';
10
+ import { OverridesStyleRules } from '@mui/material/styles/overrides';
9
11
 
10
12
  /**
11
13
  * Transform Material UI v5 component themes into a v4 theme props and overrides.
@@ -219,8 +221,8 @@ declare function createUnifiedThemeFromV4(options: ThemeOptions$1): UnifiedTheme
219
221
  * @public
220
222
  */
221
223
  declare const themes: {
222
- light: UnifiedTheme;
223
- dark: UnifiedTheme;
224
+ light: _backstage_theme.UnifiedTheme;
225
+ dark: _backstage_theme.UnifiedTheme;
224
226
  };
225
227
 
226
228
  /**
@@ -571,6 +573,30 @@ declare function createThemeOverrides(theme: Theme$2): Overrides;
571
573
  */
572
574
  declare function createTheme(options: SimpleThemeOptions): Theme$2;
573
575
 
576
+ declare module '@mui/private-theming/defaultTheme' {
577
+ interface DefaultTheme extends Theme {
578
+ }
579
+ }
580
+ /**
581
+ * Merge interface declarations into this type to register overrides for your components.
582
+ *
583
+ * @public
584
+ * @example
585
+ * ```ts
586
+ * declare module '@backstage/theme' {
587
+ * interface OverrideComponentNameToClassKeys {
588
+ * MyComponent: 'root' | 'header';
589
+ * }
590
+ * }
591
+ * ```
592
+ */
593
+ interface OverrideComponentNameToClassKeys {
594
+ }
595
+ type BackstageComponentOverrides = {
596
+ [TName in keyof OverrideComponentNameToClassKeys]?: {
597
+ styleOverrides?: Partial<OverridesStyleRules<OverrideComponentNameToClassKeys[TName], TName, Theme>>;
598
+ };
599
+ };
574
600
  declare module '@mui/material/styles' {
575
601
  interface Palette extends BackstagePaletteAdditions {
576
602
  }
@@ -583,8 +609,8 @@ declare module '@mui/material/styles' {
583
609
  interface ThemeOptions extends Partial<BackstageThemeAdditions> {
584
610
  }
585
611
  }
586
- declare module '@mui/private-theming/defaultTheme' {
587
- interface DefaultTheme extends Theme {
612
+ declare module '@mui/material/styles' {
613
+ interface Components extends BackstageComponentOverrides {
588
614
  }
589
615
  }
590
616
 
@@ -595,4 +621,4 @@ declare module '@mui/private-theming/defaultTheme' {
595
621
  */
596
622
  declare const defaultComponentThemes: ThemeOptions['components'];
597
623
 
598
- export { BackstagePalette, BackstagePaletteAdditions, BackstagePaletteOptions, BackstageTheme, BackstageThemeAdditions, BackstageThemeOptions, BackstageTypography, BaseThemeOptionsInput, PageTheme, PageThemeSelector, SimpleThemeOptions, SupportedThemes, SupportedVersions, UnifiedTheme, UnifiedThemeOptions, UnifiedThemeProvider, UnifiedThemeProviderProps, colorVariants, createBaseThemeOptions, createTheme, createThemeOptions, createThemeOverrides, createUnifiedTheme, createUnifiedThemeFromV4, darkTheme, defaultComponentThemes, genPageTheme, lightTheme, pageTheme, palettes, shapes, themes, transformV5ComponentThemesToV4 };
624
+ export { BackstagePalette, BackstagePaletteAdditions, BackstagePaletteOptions, BackstageTheme, BackstageThemeAdditions, BackstageThemeOptions, BackstageTypography, BaseThemeOptionsInput, OverrideComponentNameToClassKeys, PageTheme, PageThemeSelector, SimpleThemeOptions, SupportedThemes, SupportedVersions, UnifiedTheme, UnifiedThemeOptions, UnifiedThemeProvider, UnifiedThemeProviderProps, colorVariants, createBaseThemeOptions, createTheme, createThemeOptions, createThemeOverrides, createUnifiedTheme, createUnifiedThemeFromV4, darkTheme, defaultComponentThemes, genPageTheme, lightTheme, pageTheme, palettes, shapes, themes, transformV5ComponentThemesToV4 };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/theme",
3
3
  "description": "material-ui theme for use with Backstage.",
4
- "version": "0.4.4",
4
+ "version": "0.5.0-next.0",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "main": "dist/index.esm.js",
@@ -44,7 +44,10 @@
44
44
  "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@backstage/cli": "^0.24.0",
47
+ "@backstage/cli": "^0.24.1-next.0",
48
+ "@mui/styles": "^5.14.18",
49
+ "@testing-library/jest-dom": "^6.0.0",
50
+ "@testing-library/react": "^14.0.0",
48
51
  "@types/react": "^16.13.1 || ^17.0.0"
49
52
  },
50
53
  "files": [