theme: update API report + fixes

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-12-31 16:13:39 +01:00
committed by Philipp Hugenroth
parent 689a2f6099
commit 7044183030
6 changed files with 130 additions and 7 deletions
@@ -22,6 +22,11 @@ const DEFAULT_FONT_FAMILY =
'"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';
const DEFAULT_PAGE_THEME = 'home';
/**
* Options for {@link createBaseThemeOptions}.
*
* @public
*/
export interface BaseThemeOptionsInput<PaletteOptions> {
palette: PaletteOptions;
defaultPageTheme?: string;
+1
View File
@@ -15,6 +15,7 @@
*/
export { createBaseThemeOptions } from './createBaseThemeOptions';
export type { BaseThemeOptionsInput } from './createBaseThemeOptions';
export { colorVariants, genPageTheme, pageTheme, shapes } from './pageTheme';
export type {
BackstagePaletteAdditions,
@@ -26,13 +26,23 @@ import {
import CssBaseline from '@mui/material/CssBaseline';
import { UnifiedTheme } from './types';
interface ThemeProviderProps {
/**
* Props for {@link UnifiedThemeProvider}.
*
* @public
*/
export interface UnifiedThemeProviderProps {
children: ReactNode;
theme: UnifiedTheme;
noCssBaseline?: boolean;
}
export function UnifiedThemeProvider(props: ThemeProviderProps) {
/**
* Provides themes for all MUI versions supported by the provided unified theme.
*
* @public
*/
export function UnifiedThemeProvider(props: UnifiedThemeProviderProps) {
const { children, theme, noCssBaseline } = props;
let result = noCssBaseline ? (
+1
View File
@@ -15,4 +15,5 @@
*/
export { UnifiedThemeProvider } from './UnifiedThemeProvider';
export type { UnifiedThemeProviderProps } from './UnifiedThemeProvider';
export type { UnifiedTheme } from './types';
+16 -4
View File
@@ -51,12 +51,24 @@ declare module '@mui/material/styles/createTheme' {
// See https://github.com/mui/material-ui/issues/35287
declare global {
namespace React {
type React = typeof import('react');
interface DOMAttributes<T> {
// onResize?: ReactEventHandler<T> | undefined;
// onResizeCapture?: ReactEventHandler<T> | undefined;
interface DOMAttributes<T extends React.SyntheticEvent> {
onResize?: React.EventHandler<T> | undefined;
onResizeCapture?: React.EventHandler<T> | undefined;
onResize?: (event: Event) => void;
onResizeCapture?: (event: Event) => void;
nonce?: string | undefined;
}
}
}
// declare global {
// namespace React {
// type React = typeof import('react');
// interface DOMAttributes<T extends React.SyntheticEvent> {
// onResize?: React.EventHandler<T> | undefined;
// onResizeCapture?: React.EventHandler<T> | undefined;
// nonce?: string | undefined;
// }
// }
// }