1 | import {
|
2 | ThemeOptions as SystemThemeOptions,
|
3 | Theme as SystemTheme,
|
4 | SxProps,
|
5 | CSSObject,
|
6 | SxConfig,
|
7 | } from '@mui/system';
|
8 | import { Mixins, MixinsOptions } from './createMixins';
|
9 | import { Palette, PaletteOptions } from './createPalette';
|
10 | import { Typography, TypographyOptions } from './createTypography';
|
11 | import { Shadows } from './shadows';
|
12 | import { Transitions, TransitionsOptions } from './createTransitions';
|
13 | import { ZIndex, ZIndexOptions } from './zIndex';
|
14 | import { Components } from './components';
|
15 | import { CssVarsTheme, CssVarsPalette, ColorSystemOptions } from './createThemeWithVars';
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | export interface CssThemeVariables {}
|
28 |
|
29 | type CssVarsOptions = CssThemeVariables extends {
|
30 | enabled: true;
|
31 | }
|
32 | ? ColorSystemOptions
|
33 | : {};
|
34 |
|
35 | export interface ThemeOptions extends Omit<SystemThemeOptions, 'zIndex'>, CssVarsOptions {
|
36 | mixins?: MixinsOptions;
|
37 | components?: Components<Omit<Theme, 'components'>>;
|
38 | palette?: PaletteOptions;
|
39 | shadows?: Shadows;
|
40 | transitions?: TransitionsOptions;
|
41 | typography?: TypographyOptions | ((palette: Palette) => TypographyOptions);
|
42 | zIndex?: ZIndexOptions;
|
43 | unstable_strictMode?: boolean;
|
44 | unstable_sxConfig?: SxConfig;
|
45 | }
|
46 |
|
47 | interface BaseTheme extends SystemTheme {
|
48 | mixins: Mixins;
|
49 | palette: Palette & (CssThemeVariables extends { enabled: true } ? CssVarsPalette : {});
|
50 | shadows: Shadows;
|
51 | transitions: Transitions;
|
52 | typography: Typography;
|
53 | zIndex: ZIndex;
|
54 | unstable_strictMode?: boolean;
|
55 | }
|
56 |
|
57 | // shut off automatic exporting for the `BaseTheme` above
|
58 | export {};
|
59 |
|
60 | type CssVarsProperties = CssThemeVariables extends { enabled: true }
|
61 | ? Pick<
|
62 | CssVarsTheme,
|
63 | | 'applyStyles'
|
64 | | 'colorSchemes'
|
65 | | 'colorSchemeSelector'
|
66 | | 'rootSelector'
|
67 | | 'cssVarPrefix'
|
68 | | 'defaultColorScheme'
|
69 | | 'getCssVar'
|
70 | | 'getColorSchemeSelector'
|
71 | | 'generateThemeVars'
|
72 | | 'generateStyleSheets'
|
73 | | 'generateSpacing'
|
74 | | 'shouldSkipGeneratingVar'
|
75 | | 'vars'
|
76 | >
|
77 | : {};
|
78 |
|
79 | /**
|
80 | * Our [TypeScript guide on theme customization](https:
|
81 | */
|
82 | export interface Theme extends BaseTheme, CssVarsProperties {
|
83 | cssVariables?: false;
|
84 | components?: Components<BaseTheme>;
|
85 | unstable_sx: (props: SxProps<Theme>) => CSSObject;
|
86 | unstable_sxConfig: SxConfig;
|
87 | }
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 | export function createMuiTheme(options?: ThemeOptions, ...args: object[]): Theme;
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 | export default function createThemeNoVars(options?: ThemeOptions, ...args: object[]): Theme;
|
102 |
|
\ | No newline at end of file |