@mui/system 7.0.2 → 7.1.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/Box/Box.d.ts +12 -31
- package/CHANGELOG.md +97 -0
- package/Grid/createGrid.js +1 -2
- package/InitColorSchemeScript/InitColorSchemeScript.js +1 -1
- package/Stack/createStack.js +1 -2
- package/borders/borders.d.ts +2 -1
- package/breakpoints/breakpoints.d.ts +1 -1
- package/compose/compose.d.ts +14 -1
- package/compose/index.d.ts +1 -1
- package/cssGrid/cssGrid.d.ts +2 -1
- package/display/display.d.ts +2 -1
- package/esm/Box/Box.d.ts +12 -31
- package/esm/Grid/createGrid.js +1 -2
- package/esm/InitColorSchemeScript/InitColorSchemeScript.js +1 -1
- package/esm/Stack/createStack.js +1 -2
- package/esm/borders/borders.d.ts +2 -1
- package/esm/breakpoints/breakpoints.d.ts +1 -1
- package/esm/compose/compose.d.ts +14 -1
- package/esm/compose/index.d.ts +1 -1
- package/esm/cssGrid/cssGrid.d.ts +2 -1
- package/esm/display/display.d.ts +2 -1
- package/esm/flexbox/flexbox.d.ts +15 -1
- package/esm/index.d.ts +10 -0
- package/esm/index.js +1 -1
- package/esm/palette/palette.d.ts +2 -1
- package/esm/positions/positions.d.ts +2 -1
- package/esm/shadows/shadows.d.ts +2 -1
- package/esm/sizing/sizing.d.ts +2 -1
- package/esm/spacing/spacing.d.ts +2 -1
- package/esm/style/style.d.ts +5 -1
- package/esm/styleFunctionSx/defaultSxConfig.d.ts +1 -2
- package/esm/typography/typography.d.ts +2 -1
- package/esm/useMediaQuery/useMediaQuery.js +3 -0
- package/esm/version/index.js +3 -3
- package/flexbox/flexbox.d.ts +15 -1
- package/index.d.ts +10 -0
- package/index.js +1 -1
- package/package.json +7 -7
- package/palette/palette.d.ts +2 -1
- package/positions/positions.d.ts +2 -1
- package/shadows/shadows.d.ts +2 -1
- package/sizing/sizing.d.ts +2 -1
- package/spacing/spacing.d.ts +2 -1
- package/style/style.d.ts +5 -1
- package/styleFunctionSx/defaultSxConfig.d.ts +1 -2
- package/typography/typography.d.ts +2 -1
- package/useMediaQuery/useMediaQuery.js +3 -0
- package/version/index.js +3 -3
- package/modern/Box/Box.d.ts +0 -72
- package/modern/Box/boxClasses.d.ts +0 -7
- package/modern/Box/index.d.ts +0 -4
- package/modern/CSSProperties.d.ts +0 -7
- package/modern/Container/Container.d.ts +0 -13
- package/modern/Container/ContainerProps.d.ts +0 -40
- package/modern/Container/containerClasses.d.ts +0 -22
- package/modern/Container/createContainer.d.ts +0 -18
- package/modern/Container/index.d.ts +0 -4
- package/modern/DefaultPropsProvider/DefaultPropsProvider.d.ts +0 -18
- package/modern/DefaultPropsProvider/index.d.ts +0 -1
- package/modern/GlobalStyles/GlobalStyles.d.ts +0 -17
- package/modern/GlobalStyles/index.d.ts +0 -2
- package/modern/Grid/Grid.d.ts +0 -13
- package/modern/Grid/GridProps.d.ts +0 -103
- package/modern/Grid/createGrid.d.ts +0 -13
- package/modern/Grid/deleteLegacyGridProps.d.ts +0 -11
- package/modern/Grid/gridClasses.d.ts +0 -20
- package/modern/Grid/gridGenerator.d.ts +0 -42
- package/modern/Grid/index.d.ts +0 -7
- package/modern/Grid/traverseBreakpoints.d.ts +0 -7
- package/modern/InitColorSchemeScript/InitColorSchemeScript.d.ts +0 -51
- package/modern/InitColorSchemeScript/index.d.ts +0 -2
- package/modern/RtlProvider/index.d.ts +0 -8
- package/modern/Stack/Stack.d.ts +0 -14
- package/modern/Stack/StackProps.d.ts +0 -53
- package/modern/Stack/createStack.d.ts +0 -24
- package/modern/Stack/index.d.ts +0 -5
- package/modern/Stack/stackClasses.d.ts +0 -8
- package/modern/ThemeProvider/ThemeProvider.d.ts +0 -24
- package/modern/ThemeProvider/index.d.ts +0 -2
- package/modern/borders/borders.d.ts +0 -14
- package/modern/borders/index.d.ts +0 -2
- package/modern/breakpoints/breakpoints.d.ts +0 -19
- package/modern/breakpoints/index.d.ts +0 -2
- package/modern/colorManipulator/colorManipulator.d.ts +0 -25
- package/modern/colorManipulator/index.d.ts +0 -1
- package/modern/compose/compose.d.ts +0 -2
- package/modern/compose/index.d.ts +0 -1
- package/modern/createBox/createBox.d.ts +0 -9
- package/modern/createBox/index.d.ts +0 -1
- package/modern/createBreakpoints/createBreakpoints.d.ts +0 -78
- package/modern/createBreakpoints/index.d.ts +0 -3
- package/modern/createStyled/createStyled.d.ts +0 -27
- package/modern/createStyled/index.d.ts +0 -2
- package/modern/createTheme/applyStyles.d.ts +0 -67
- package/modern/createTheme/createSpacing.d.ts +0 -10
- package/modern/createTheme/createTheme.d.ts +0 -54
- package/modern/createTheme/index.d.ts +0 -4
- package/modern/createTheme/shape.d.ts +0 -6
- package/modern/cssContainerQueries/cssContainerQueries.d.ts +0 -23
- package/modern/cssContainerQueries/index.d.ts +0 -3
- package/modern/cssGrid/cssGrid.d.ts +0 -15
- package/modern/cssGrid/index.d.ts +0 -2
- package/modern/cssVars/createCssVarsProvider.d.ts +0 -141
- package/modern/cssVars/createCssVarsTheme.d.ts +0 -15
- package/modern/cssVars/createGetCssVar.d.ts +0 -5
- package/modern/cssVars/cssVarsParser.d.ts +0 -64
- package/modern/cssVars/getColorSchemeSelector.d.ts +0 -1
- package/modern/cssVars/index.d.ts +0 -8
- package/modern/cssVars/localStorageManager.d.ts +0 -34
- package/modern/cssVars/prepareCssVars.d.ts +0 -16
- package/modern/cssVars/prepareTypographyVars.d.ts +0 -4
- package/modern/cssVars/useCurrentColorScheme.d.ts +0 -56
- package/modern/display/display.d.ts +0 -3
- package/modern/display/index.d.ts +0 -2
- package/modern/flexbox/flexbox.d.ts +0 -3
- package/modern/flexbox/index.d.ts +0 -2
- package/modern/getThemeValue/getThemeValue.d.ts +0 -1
- package/modern/getThemeValue/index.d.ts +0 -2
- package/modern/index.d.ts +0 -80
- package/modern/memoTheme.d.ts +0 -12
- package/modern/memoize/index.d.ts +0 -1
- package/modern/memoize/memoize.d.ts +0 -1
- package/modern/merge/index.d.ts +0 -1
- package/modern/merge/merge.d.ts +0 -1
- package/modern/palette/index.d.ts +0 -2
- package/modern/palette/palette.d.ts +0 -5
- package/modern/positions/index.d.ts +0 -2
- package/modern/positions/positions.d.ts +0 -3
- package/modern/preprocessStyles.d.ts +0 -5
- package/modern/propsToClassKey/index.d.ts +0 -1
- package/modern/propsToClassKey/propsToClassKey.d.ts +0 -1
- package/modern/responsivePropType/index.d.ts +0 -1
- package/modern/responsivePropType/responsivePropType.d.ts +0 -2
- package/modern/shadows/index.d.ts +0 -1
- package/modern/shadows/shadows.d.ts +0 -3
- package/modern/sizing/index.d.ts +0 -2
- package/modern/sizing/sizing.d.ts +0 -12
- package/modern/spacing/index.d.ts +0 -2
- package/modern/spacing/spacing.d.ts +0 -19
- package/modern/style/index.d.ts +0 -2
- package/modern/style/style.d.ts +0 -19
- package/modern/styleFunctionSx/AliasesCSSProperties.d.ts +0 -269
- package/modern/styleFunctionSx/OverwriteCSSProperties.d.ts +0 -54
- package/modern/styleFunctionSx/StandardCssProperties.d.ts +0 -2
- package/modern/styleFunctionSx/defaultSxConfig.d.ts +0 -15
- package/modern/styleFunctionSx/extendSxProp.d.ts +0 -4
- package/modern/styleFunctionSx/index.d.ts +0 -9
- package/modern/styleFunctionSx/styleFunctionSx.d.ts +0 -62
- package/modern/styled/index.d.ts +0 -1
- package/modern/styled/styled.d.ts +0 -3
- package/modern/typography/index.d.ts +0 -2
- package/modern/typography/typography.d.ts +0 -12
- package/modern/useMediaQuery/index.d.ts +0 -2
- package/modern/useMediaQuery/useMediaQuery.d.ts +0 -32
- package/modern/useTheme/index.d.ts +0 -2
- package/modern/useTheme/useTheme.d.ts +0 -2
- package/modern/useThemeProps/getThemeProps.d.ts +0 -11
- package/modern/useThemeProps/index.d.ts +0 -3
- package/modern/useThemeProps/useThemeProps.d.ts +0 -14
- package/modern/useThemeWithoutDefault/index.d.ts +0 -1
- package/modern/useThemeWithoutDefault/useThemeWithoutDefault.d.ts +0 -1
- package/modern/version/index.d.ts +0 -6
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Breakpoints } from "../createBreakpoints/createBreakpoints.js";
|
|
2
|
-
export interface ContainerQueries {
|
|
3
|
-
up: Breakpoints['up'];
|
|
4
|
-
down: Breakpoints['down'];
|
|
5
|
-
between: Breakpoints['between'];
|
|
6
|
-
only: Breakpoints['only'];
|
|
7
|
-
not: Breakpoints['not'];
|
|
8
|
-
}
|
|
9
|
-
export interface CssContainerQueries {
|
|
10
|
-
containerQueries: ((name: string) => ContainerQueries) & ContainerQueries;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* For using in `sx` prop to sort the breakpoint from low to high.
|
|
14
|
-
* Note: this function does not work and will not support multiple units.
|
|
15
|
-
* e.g. input: { '@container (min-width:300px)': '1rem', '@container (min-width:40rem)': '2rem' }
|
|
16
|
-
* output: { '@container (min-width:40rem)': '2rem', '@container (min-width:300px)': '1rem' } // since 40 < 300 eventhough 40rem > 300px
|
|
17
|
-
*/
|
|
18
|
-
export declare function sortContainerQueries(theme: Partial<CssContainerQueries>, css: Record<string, any>): Record<string, any>;
|
|
19
|
-
export declare function isCqShorthand(breakpointKeys: string[], value: string): boolean;
|
|
20
|
-
export declare function getContainerQuery(theme: CssContainerQueries, shorthand: string): string | null;
|
|
21
|
-
export default function cssContainerQueries<T extends {
|
|
22
|
-
breakpoints: Breakpoints;
|
|
23
|
-
}>(themeInput: T): T & CssContainerQueries;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { PropsFor, grid, SimpleStyleFunction } from "../Box/index.js";
|
|
2
|
-
export const gap: SimpleStyleFunction<'gap'>;
|
|
3
|
-
export const columnGap: SimpleStyleFunction<'columnGap'>;
|
|
4
|
-
export const rowGap: SimpleStyleFunction<'rowGap'>;
|
|
5
|
-
export const gridColumn: SimpleStyleFunction<'gridColumn'>;
|
|
6
|
-
export const gridRow: SimpleStyleFunction<'gridRow'>;
|
|
7
|
-
export const gridAutoFlow: SimpleStyleFunction<'gridAutoFlow'>;
|
|
8
|
-
export const gridAutoColumns: SimpleStyleFunction<'gridAutoColumns'>;
|
|
9
|
-
export const gridAutoRows: SimpleStyleFunction<'gridAutoRows'>;
|
|
10
|
-
export const gridTemplateColumns: SimpleStyleFunction<'gridTemplateColumns'>;
|
|
11
|
-
export const gridTemplateRows: SimpleStyleFunction<'gridTemplateRows'>;
|
|
12
|
-
export const gridTemplateAreas: SimpleStyleFunction<'gridTemplateAreas'>;
|
|
13
|
-
export const gridArea: SimpleStyleFunction<'gridArea'>;
|
|
14
|
-
export type CssGridProps = PropsFor<typeof grid>;
|
|
15
|
-
export default grid;
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import InitColorSchemeScript from "../InitColorSchemeScript/index.js";
|
|
3
|
-
import { Result } from "./useCurrentColorScheme.js";
|
|
4
|
-
import type { StorageManager } from "./localStorageManager.js";
|
|
5
|
-
export interface ColorSchemeContextValue<SupportedColorScheme extends string> extends Result<SupportedColorScheme> {
|
|
6
|
-
allColorSchemes: SupportedColorScheme[];
|
|
7
|
-
}
|
|
8
|
-
export interface CssVarsProviderConfig<ColorScheme extends string> {
|
|
9
|
-
/**
|
|
10
|
-
* DOM attribute for applying color scheme
|
|
11
|
-
* @default 'data-color-scheme'
|
|
12
|
-
*/
|
|
13
|
-
attribute?: string;
|
|
14
|
-
/**
|
|
15
|
-
* localStorage key used to store application `mode`
|
|
16
|
-
* @default 'mode'
|
|
17
|
-
*/
|
|
18
|
-
modeStorageKey?: string;
|
|
19
|
-
/**
|
|
20
|
-
* localStorage key used to store `colorScheme`
|
|
21
|
-
* @default 'color-scheme'
|
|
22
|
-
*/
|
|
23
|
-
colorSchemeStorageKey?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Design system default color scheme.
|
|
26
|
-
* - provides string if the design system has one default color scheme (either light or dark)
|
|
27
|
-
* - provides object if the design system has default light & dark color schemes
|
|
28
|
-
*/
|
|
29
|
-
defaultColorScheme: ColorScheme | {
|
|
30
|
-
light: ColorScheme;
|
|
31
|
-
dark: ColorScheme;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Disable CSS transitions when switching between modes or color schemes
|
|
35
|
-
* @default false
|
|
36
|
-
*/
|
|
37
|
-
disableTransitionOnChange?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* If `true`, theme values are recalculated when the mode changes.
|
|
40
|
-
* The `theme.colorSchemes.{mode}.*` nodes will be shallow merged to the top-level of the theme.
|
|
41
|
-
* @default false
|
|
42
|
-
*/
|
|
43
|
-
forceThemeRerender?: boolean;
|
|
44
|
-
}
|
|
45
|
-
type Identify<I extends string | undefined, T> = I extends string ? T | { [k in I]: T } : T;
|
|
46
|
-
export interface CreateCssVarsProviderResult<ColorScheme extends string, Identifier extends string | undefined = undefined> {
|
|
47
|
-
CssVarsProvider: (props: React.PropsWithChildren<Partial<CssVarsProviderConfig<ColorScheme>> & {
|
|
48
|
-
theme?: Identify<Identifier, {
|
|
49
|
-
cssVariables?: false;
|
|
50
|
-
cssVarPrefix?: string;
|
|
51
|
-
colorSchemes: Partial<Record<ColorScheme, any>>;
|
|
52
|
-
colorSchemeSelector?: 'media' | 'class' | 'data' | string;
|
|
53
|
-
}>;
|
|
54
|
-
/**
|
|
55
|
-
* The default mode when the storage is empty,
|
|
56
|
-
* require the theme to have `colorSchemes` with light and dark.
|
|
57
|
-
* @default 'system'
|
|
58
|
-
*/
|
|
59
|
-
defaultMode?: 'light' | 'dark' | 'system';
|
|
60
|
-
/**
|
|
61
|
-
* The document used to perform `disableTransitionOnChange` feature
|
|
62
|
-
* @default document
|
|
63
|
-
*/
|
|
64
|
-
documentNode?: Document | null;
|
|
65
|
-
/**
|
|
66
|
-
* The node used to attach the color-scheme attribute
|
|
67
|
-
* @default document
|
|
68
|
-
*/
|
|
69
|
-
colorSchemeNode?: Element | null;
|
|
70
|
-
/**
|
|
71
|
-
* The storage manager to be used for storing the mode and color scheme.
|
|
72
|
-
* @default using `window.localStorage`
|
|
73
|
-
*/
|
|
74
|
-
storageManager?: StorageManager | null;
|
|
75
|
-
/**
|
|
76
|
-
* The window that attaches the 'storage' event listener
|
|
77
|
-
* @default window
|
|
78
|
-
*/
|
|
79
|
-
storageWindow?: Window | null;
|
|
80
|
-
/**
|
|
81
|
-
* If `true`, the provider creates its own context and generate stylesheet as if it is a root `CssVarsProvider`.
|
|
82
|
-
*/
|
|
83
|
-
disableNestedContext?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* If `true`, the style sheet won't be generated.
|
|
86
|
-
*
|
|
87
|
-
* This is useful for controlling nested CssVarsProvider behavior.
|
|
88
|
-
* @default false
|
|
89
|
-
*/
|
|
90
|
-
disableStyleSheetGeneration?: boolean;
|
|
91
|
-
}>) => React.JSX.Element;
|
|
92
|
-
useColorScheme: () => ColorSchemeContextValue<ColorScheme>;
|
|
93
|
-
getInitColorSchemeScript: typeof InitColorSchemeScript;
|
|
94
|
-
}
|
|
95
|
-
export default function createCssVarsProvider<ColorScheme extends string, Identifier extends string | undefined = undefined>(options: CssVarsProviderConfig<ColorScheme> & {
|
|
96
|
-
/**
|
|
97
|
-
* The design system's unique id for getting the corresponded theme when there are multiple design systems.
|
|
98
|
-
*/
|
|
99
|
-
themeId?: Identifier;
|
|
100
|
-
/**
|
|
101
|
-
* Design system default theme
|
|
102
|
-
*
|
|
103
|
-
* - The structure inside `theme.colorSchemes[colorScheme]` should be exactly the same in all color schemes because
|
|
104
|
-
* those object of the color scheme will be used when the color scheme is active.
|
|
105
|
-
*
|
|
106
|
-
* {
|
|
107
|
-
* colorSchemes: {
|
|
108
|
-
* light: { ...lightColorSchemeValues },
|
|
109
|
-
* dark: { ...darkColorSchemeValues }
|
|
110
|
-
* }
|
|
111
|
-
* }
|
|
112
|
-
*
|
|
113
|
-
* - If colorScheme is 'light', the `lightColorSchemeValues` will be merged to theme as `{ ...theme, ...lightColorSchemeValues }`
|
|
114
|
-
* likewise, if colorScheme is 'dark', the `darkColorSchemeValues` will be merged to theme as `{ ...theme, ...darkColorSchemeValues }`
|
|
115
|
-
*
|
|
116
|
-
* - If the theme contains the same keys as the color scheme, their values will be merged.
|
|
117
|
-
* Ex. {
|
|
118
|
-
* colorSchemes: {
|
|
119
|
-
* light: { palette: { primary: { ... } } },
|
|
120
|
-
* dark: { palette: { primary: { ...} } }
|
|
121
|
-
* },
|
|
122
|
-
* palette: { shared: { ... } }
|
|
123
|
-
* }
|
|
124
|
-
*
|
|
125
|
-
* becomes: {
|
|
126
|
-
* colorSchemes: { ... },
|
|
127
|
-
* palette: { shared: { ... }, primary: { ... } }
|
|
128
|
-
* }
|
|
129
|
-
*/
|
|
130
|
-
theme: any;
|
|
131
|
-
/**
|
|
132
|
-
* A function to be called after the CSS variables are attached. The result of this function will be the final theme pass to ThemeProvider.
|
|
133
|
-
*
|
|
134
|
-
* The example usage is the variant generation in Joy. We need to combine the token from user-input and the default theme first, then generate
|
|
135
|
-
* variants from those tokens.
|
|
136
|
-
*/
|
|
137
|
-
resolveTheme?: (theme: any) => any; // the type is any because it depends on the design system.
|
|
138
|
-
}): CreateCssVarsProviderResult<ColorScheme, Identifier>;
|
|
139
|
-
|
|
140
|
-
// disable automatic export
|
|
141
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DefaultCssVarsTheme } from "./prepareCssVars.js";
|
|
2
|
-
interface Theme extends DefaultCssVarsTheme {
|
|
3
|
-
cssVarPrefix?: string;
|
|
4
|
-
colorSchemeSelector?: 'media' | string;
|
|
5
|
-
shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean;
|
|
6
|
-
}
|
|
7
|
-
declare function createCssVarsTheme<T extends Theme, ThemeVars extends Record<string, any>>({
|
|
8
|
-
colorSchemeSelector,
|
|
9
|
-
...theme
|
|
10
|
-
}: T): T & {
|
|
11
|
-
vars: ThemeVars;
|
|
12
|
-
generateThemeVars: () => ThemeVars;
|
|
13
|
-
generateStyleSheets: () => Record<string, any>[];
|
|
14
|
-
};
|
|
15
|
-
export default createCssVarsTheme;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
|
|
3
|
-
* and they does not need to remember the prefix (defined once).
|
|
4
|
-
*/
|
|
5
|
-
export default function createGetCssVar<T extends string = string>(prefix?: string): <AdditionalVars extends string = never>(field: T | AdditionalVars, ...fallbacks: (T | AdditionalVars)[]) => string;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
type NestedRecord<V = any> = {
|
|
2
|
-
[k: string | number]: NestedRecord<V> | V;
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* This function create an object from keys, value and then assign to target
|
|
6
|
-
*
|
|
7
|
-
* @param {Object} obj : the target object to be assigned
|
|
8
|
-
* @param {string[]} keys
|
|
9
|
-
* @param {string | number} value
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* const source = {}
|
|
13
|
-
* assignNestedKeys(source, ['palette', 'primary'], 'var(--palette-primary)')
|
|
14
|
-
* console.log(source) // { palette: { primary: 'var(--palette-primary)' } }
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* const source = { palette: { primary: 'var(--palette-primary)' } }
|
|
18
|
-
* assignNestedKeys(source, ['palette', 'secondary'], 'var(--palette-secondary)')
|
|
19
|
-
* console.log(source) // { palette: { primary: 'var(--palette-primary)', secondary: 'var(--palette-secondary)' } }
|
|
20
|
-
*/
|
|
21
|
-
export declare const assignNestedKeys: <T extends Record<string, any> | null | undefined | string = NestedRecord, Value = any>(obj: T, keys: Array<string>, value: Value, arrayKeys?: Array<string>) => void;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @param {Object} obj : source object
|
|
25
|
-
* @param {Function} callback : a function that will be called when
|
|
26
|
-
* - the deepest key in source object is reached
|
|
27
|
-
* - the value of the deepest key is NOT `undefined` | `null`
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* walkObjectDeep({ palette: { primary: { main: '#000000' } } }, console.log)
|
|
31
|
-
* // ['palette', 'primary', 'main'] '#000000'
|
|
32
|
-
*/
|
|
33
|
-
export declare const walkObjectDeep: <Value, T = Record<string, any>>(obj: T, callback: (keys: Array<string>, value: Value, arrayKeys: Array<string>) => void, shouldSkipPaths?: (keys: Array<string>) => boolean) => void;
|
|
34
|
-
/**
|
|
35
|
-
* a function that parse theme and return { css, vars }
|
|
36
|
-
*
|
|
37
|
-
* @param {Object} theme
|
|
38
|
-
* @param {{
|
|
39
|
-
* prefix?: string,
|
|
40
|
-
* shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean
|
|
41
|
-
* }} options.
|
|
42
|
-
* `prefix`: The prefix of the generated CSS variables. This function does not change the value.
|
|
43
|
-
*
|
|
44
|
-
* @returns {{ css: Object, vars: Object }} `css` is the stylesheet, `vars` is an object to get css variable (same structure as theme).
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* const { css, vars } = parser({
|
|
48
|
-
* fontSize: 12,
|
|
49
|
-
* lineHeight: 1.2,
|
|
50
|
-
* palette: { primary: { 500: 'var(--color)' } }
|
|
51
|
-
* }, { prefix: 'foo' })
|
|
52
|
-
*
|
|
53
|
-
* console.log(css) // { '--foo-fontSize': '12px', '--foo-lineHeight': 1.2, '--foo-palette-primary-500': 'var(--color)' }
|
|
54
|
-
* console.log(vars) // { fontSize: 'var(--foo-fontSize)', lineHeight: 'var(--foo-lineHeight)', palette: { primary: { 500: 'var(--foo-palette-primary-500)' } } }
|
|
55
|
-
*/
|
|
56
|
-
export default function cssVarsParser<T extends Record<string, any>>(theme: Record<string, any>, options?: {
|
|
57
|
-
prefix?: string;
|
|
58
|
-
shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean;
|
|
59
|
-
}): {
|
|
60
|
-
css: Record<string, string | number>;
|
|
61
|
-
vars: T;
|
|
62
|
-
varsWithDefaults: {};
|
|
63
|
-
};
|
|
64
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function createGetColorSchemeSelector<T extends string>(selector: 'media' | 'class' | 'data' | string): (colorScheme: T) => string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { default } from "./createCssVarsProvider.js";
|
|
2
|
-
export type { CreateCssVarsProviderResult, CssVarsProviderConfig, ColorSchemeContextValue } from "./createCssVarsProvider.js";
|
|
3
|
-
export { default as prepareCssVars } from "./prepareCssVars.js";
|
|
4
|
-
export { default as prepareTypographyVars } from "./prepareTypographyVars.js";
|
|
5
|
-
export type { ExtractTypographyTokens } from "./prepareTypographyVars.js";
|
|
6
|
-
export { default as createCssVarsTheme } from "./createCssVarsTheme.js";
|
|
7
|
-
export { createGetColorSchemeSelector } from "./getColorSchemeSelector.js";
|
|
8
|
-
export type { StorageManager } from "./localStorageManager.js";
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export interface StorageManager {
|
|
2
|
-
(options: {
|
|
3
|
-
key: string;
|
|
4
|
-
storageWindow?: Window | null;
|
|
5
|
-
}): {
|
|
6
|
-
/**
|
|
7
|
-
* Function to get the value from the storage
|
|
8
|
-
* @param defaultValue The default value to be returned if the key is not found
|
|
9
|
-
* @returns The value from the storage or the default value
|
|
10
|
-
*/
|
|
11
|
-
get(defaultValue: any): any;
|
|
12
|
-
/**
|
|
13
|
-
* Function to set the value in the storage
|
|
14
|
-
* @param value The value to be set
|
|
15
|
-
* @returns void
|
|
16
|
-
*/
|
|
17
|
-
set(value: any): void;
|
|
18
|
-
/**
|
|
19
|
-
* Function to subscribe to the value of the specified key triggered by external events
|
|
20
|
-
* @param handler The function to be called when the value changes
|
|
21
|
-
* @returns A function to unsubscribe the handler
|
|
22
|
-
* @example
|
|
23
|
-
* React.useEffect(() => {
|
|
24
|
-
* const unsubscribe = storageManager.subscribe((value) => {
|
|
25
|
-
* console.log(value);
|
|
26
|
-
* });
|
|
27
|
-
* return unsubscribe;
|
|
28
|
-
* }, []);
|
|
29
|
-
*/
|
|
30
|
-
subscribe(handler: (value: any) => void): () => void;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
declare const localStorageManager: StorageManager;
|
|
34
|
-
export default localStorageManager;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface DefaultCssVarsTheme {
|
|
2
|
-
colorSchemes?: Record<string, any>;
|
|
3
|
-
defaultColorScheme?: string;
|
|
4
|
-
}
|
|
5
|
-
declare function prepareCssVars<T extends DefaultCssVarsTheme, ThemeVars extends Record<string, any>>(theme: T, parserConfig?: {
|
|
6
|
-
prefix?: string;
|
|
7
|
-
colorSchemeSelector?: 'media' | 'class' | 'data' | string;
|
|
8
|
-
disableCssColorScheme?: boolean;
|
|
9
|
-
shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean;
|
|
10
|
-
getSelector?: (colorScheme: keyof T['colorSchemes'] | undefined, css: Record<string, any>) => string | Record<string, any>;
|
|
11
|
-
}): {
|
|
12
|
-
vars: ThemeVars;
|
|
13
|
-
generateThemeVars: () => ThemeVars;
|
|
14
|
-
generateStyleSheets: () => Record<string, any>[];
|
|
15
|
-
};
|
|
16
|
-
export default prepareCssVars;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
type RecordPropertyNames<T> = { [K in keyof T]: T[K] extends Function ? never : T[K] extends Record<string, any> ? K : never }[keyof T];
|
|
2
|
-
export type ExtractTypographyTokens<T> = { [K in RecordPropertyNames<T>]: string };
|
|
3
|
-
export default function prepareTypographyVars<T extends Record<string, any>>(typography: T): ExtractTypographyTokens<T>;
|
|
4
|
-
export {};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { StorageManager } from "./localStorageManager.js";
|
|
2
|
-
export type Mode = 'light' | 'dark' | 'system';
|
|
3
|
-
export type SystemMode = Exclude<Mode, 'system'>;
|
|
4
|
-
export interface State<SupportedColorScheme extends string> {
|
|
5
|
-
/**
|
|
6
|
-
* User selected mode.
|
|
7
|
-
* Note: on the server, mode is always undefined
|
|
8
|
-
*/
|
|
9
|
-
mode: 'light' | 'dark' | 'system' | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* Only valid if `mode: 'system'`, either 'light' | 'dark'.
|
|
12
|
-
*/
|
|
13
|
-
systemMode: 'light' | 'dark' | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* The color scheme for the light mode.
|
|
16
|
-
*/
|
|
17
|
-
lightColorScheme: SupportedColorScheme;
|
|
18
|
-
/**
|
|
19
|
-
* The color scheme for the dark mode.
|
|
20
|
-
*/
|
|
21
|
-
darkColorScheme: SupportedColorScheme;
|
|
22
|
-
}
|
|
23
|
-
export type Result<SupportedColorScheme extends string> = State<SupportedColorScheme> & {
|
|
24
|
-
/**
|
|
25
|
-
* The current application color scheme. It is always `undefined` on the server.
|
|
26
|
-
*/
|
|
27
|
-
colorScheme: SupportedColorScheme | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* `mode` is saved to internal state and localStorage
|
|
30
|
-
* If `mode` is null, it will be reset to the defaultMode
|
|
31
|
-
*/
|
|
32
|
-
setMode: (mode: Mode | null) => void;
|
|
33
|
-
/**
|
|
34
|
-
* `colorScheme` is saved to internal state and localStorage
|
|
35
|
-
* If `colorScheme` is null, it will be reset to the defaultColorScheme (light | dark)
|
|
36
|
-
*/
|
|
37
|
-
setColorScheme: (colorScheme: SupportedColorScheme | Partial<{
|
|
38
|
-
light: SupportedColorScheme | null;
|
|
39
|
-
dark: SupportedColorScheme | null;
|
|
40
|
-
}> | null) => void;
|
|
41
|
-
};
|
|
42
|
-
export declare function getSystemMode(mode: undefined | string): SystemMode | undefined;
|
|
43
|
-
export declare function getColorScheme<SupportedColorScheme extends string>(state: State<SupportedColorScheme>): SupportedColorScheme | undefined;
|
|
44
|
-
interface UseCurrentColoSchemeOptions<SupportedColorScheme extends string> {
|
|
45
|
-
defaultLightColorScheme: SupportedColorScheme;
|
|
46
|
-
defaultDarkColorScheme: SupportedColorScheme;
|
|
47
|
-
supportedColorSchemes: Array<SupportedColorScheme>;
|
|
48
|
-
defaultMode?: Mode;
|
|
49
|
-
modeStorageKey?: string;
|
|
50
|
-
colorSchemeStorageKey?: string;
|
|
51
|
-
storageWindow?: Window | null;
|
|
52
|
-
storageManager?: StorageManager | null;
|
|
53
|
-
noSsr?: boolean;
|
|
54
|
-
}
|
|
55
|
-
export default function useCurrentColorScheme<SupportedColorScheme extends string>(options: UseCurrentColoSchemeOptions<SupportedColorScheme>): Result<SupportedColorScheme>;
|
|
56
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function getThemeValue(prop: string, value: any, theme: object): any;
|
package/modern/index.d.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// disable automatic export
|
|
2
|
-
export {};
|
|
3
|
-
export * from "./borders/index.js";
|
|
4
|
-
export { default as breakpoints, handleBreakpoints, mergeBreakpointsInOrder } from "./breakpoints/index.js";
|
|
5
|
-
export { default as cssContainerQueries, type CssContainerQueries } from "./cssContainerQueries/index.js";
|
|
6
|
-
export { default as compose } from "./compose/index.js";
|
|
7
|
-
export * from "./display/index.js";
|
|
8
|
-
export * from "./flexbox/index.js";
|
|
9
|
-
export * from "./cssGrid/index.js";
|
|
10
|
-
export * from "./palette/index.js";
|
|
11
|
-
export * from "./positions/index.js";
|
|
12
|
-
export * from "./shadows/index.js";
|
|
13
|
-
export * from "./sizing/index.js";
|
|
14
|
-
export * from "./typography/index.js";
|
|
15
|
-
export { default as unstable_getThemeValue } from "./getThemeValue/index.js";
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The `css` function accepts arrays as values for mobile-first responsive styles.
|
|
19
|
-
* Note that this extends to non-theme values also. For example `display=['none', 'block']`
|
|
20
|
-
* will also works.
|
|
21
|
-
*/
|
|
22
|
-
export type ResponsiveStyleValue<T> = T | Array<T | null> | {
|
|
23
|
-
[key: string]: T | null;
|
|
24
|
-
};
|
|
25
|
-
export { DefaultTheme } from '@mui/private-theming';
|
|
26
|
-
export { css, keyframes, StyledEngineProvider, Interpolation, CSSInterpolation, CSSObject } from '@mui/styled-engine';
|
|
27
|
-
export { default as GlobalStyles } from "./GlobalStyles/index.js";
|
|
28
|
-
export type { GlobalStylesProps } from "./GlobalStyles/index.js";
|
|
29
|
-
export * from "./style/index.js";
|
|
30
|
-
export { default as style } from "./style/index.js";
|
|
31
|
-
export * from "./spacing/index.js";
|
|
32
|
-
export { default as unstable_styleFunctionSx, unstable_createStyleFunctionSx, extendSxProp as unstable_extendSxProp, unstable_defaultSxConfig } from "./styleFunctionSx/index.js";
|
|
33
|
-
export * from "./styleFunctionSx/index.js";
|
|
34
|
-
|
|
35
|
-
// TODO: Remove this function in v6.
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
37
|
-
export function experimental_sx(): any;
|
|
38
|
-
export { default as Box } from "./Box/index.js";
|
|
39
|
-
export * from "./Box/index.js";
|
|
40
|
-
export { default as createBox } from "./createBox/index.js";
|
|
41
|
-
export * from "./createBox/index.js";
|
|
42
|
-
export { default as createStyled } from "./createStyled/index.js";
|
|
43
|
-
export * from "./createStyled/index.js";
|
|
44
|
-
export { default as styled } from "./styled/index.js";
|
|
45
|
-
export * from "./styled/index.js";
|
|
46
|
-
export { default as createTheme } from "./createTheme/index.js";
|
|
47
|
-
export * from "./createTheme/index.js";
|
|
48
|
-
export { default as createBreakpoints } from "./createBreakpoints/createBreakpoints.js";
|
|
49
|
-
export * from "./createBreakpoints/createBreakpoints.js";
|
|
50
|
-
export { default as createSpacing } from "./createTheme/createSpacing.js";
|
|
51
|
-
export { SpacingOptions, Spacing } from "./createTheme/createSpacing.js";
|
|
52
|
-
export { default as shape } from "./createTheme/shape.js";
|
|
53
|
-
export * from "./createTheme/shape.js";
|
|
54
|
-
export { default as useThemeProps, getThemeProps } from "./useThemeProps/index.js";
|
|
55
|
-
export { default as useTheme } from "./useTheme/index.js";
|
|
56
|
-
export * from "./useTheme/index.js";
|
|
57
|
-
export { default as useThemeWithoutDefault } from "./useThemeWithoutDefault/index.js";
|
|
58
|
-
export * from "./useThemeWithoutDefault/index.js";
|
|
59
|
-
export { default as useMediaQuery } from "./useMediaQuery/index.js";
|
|
60
|
-
export * from "./useMediaQuery/index.js";
|
|
61
|
-
export * from "./colorManipulator/index.js";
|
|
62
|
-
export { default as ThemeProvider } from "./ThemeProvider/index.js";
|
|
63
|
-
export * from "./ThemeProvider/index.js";
|
|
64
|
-
export { default as unstable_memoTheme } from "./memoTheme.js";
|
|
65
|
-
export { default as unstable_createCssVarsProvider, CreateCssVarsProviderResult } from "./cssVars/index.js";
|
|
66
|
-
export { default as unstable_createGetCssVar } from "./cssVars/createGetCssVar.js";
|
|
67
|
-
export { default as unstable_cssVarsParser } from "./cssVars/cssVarsParser.js";
|
|
68
|
-
export { default as unstable_prepareCssVars } from "./cssVars/prepareCssVars.js";
|
|
69
|
-
export { default as unstable_createCssVarsTheme } from "./cssVars/createCssVarsTheme.js";
|
|
70
|
-
export * from "./cssVars/index.js";
|
|
71
|
-
export { default as responsivePropType } from "./responsivePropType/index.js";
|
|
72
|
-
export { default as createContainer } from "./Container/createContainer.js";
|
|
73
|
-
export * from "./Container/createContainer.js";
|
|
74
|
-
export { default as Container } from "./Container/index.js";
|
|
75
|
-
export * from "./Container/index.js";
|
|
76
|
-
export { default as Grid } from "./Grid/index.js";
|
|
77
|
-
export * from "./Grid/index.js";
|
|
78
|
-
export { default as Stack } from "./Stack/index.js";
|
|
79
|
-
export * from "./Stack/index.js";
|
|
80
|
-
export * from "./version/index.js";
|
package/modern/memoTheme.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CSSInterpolation } from '@mui/styled-engine';
|
|
2
|
-
type ThemeStyleFunction<T> = (props: {
|
|
3
|
-
theme: T;
|
|
4
|
-
}) => CSSInterpolation;
|
|
5
|
-
/**
|
|
6
|
-
* Memoize style function on theme.
|
|
7
|
-
* Intended to be used in styled() calls that only need access to the theme.
|
|
8
|
-
*/
|
|
9
|
-
export default function unstable_memoTheme<T>(styleFn: ThemeStyleFunction<T>): (props: {
|
|
10
|
-
theme: T;
|
|
11
|
-
}) => string | number | boolean | import("@mui/styled-engine").ComponentSelector | import("@mui/styled-engine").Keyframes | import("@mui/styled-engine").SerializedStyles | import("@mui/styled-engine").CSSObject | import("@mui/styled-engine").ArrayCSSInterpolation | null;
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./memoize.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function memoize<ArgType = any, ReturnType = any>(fn: (arg: ArgType) => ReturnType): (arg: ArgType) => ReturnType;
|
package/modern/merge/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./merge.js";
|
package/modern/merge/merge.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function merge(acc: object, item: object): object;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./propsToClassKey.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function propsToClassKey(props: object): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./responsivePropType.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./shadows.js";
|
package/modern/sizing/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { PropsFor, SimpleStyleFunction, sizing } from "../Box/index.js";
|
|
2
|
-
export const width: SimpleStyleFunction<'width'>;
|
|
3
|
-
export const maxWidth: SimpleStyleFunction<'maxWidth'>;
|
|
4
|
-
export const minWidth: SimpleStyleFunction<'minWidth'>;
|
|
5
|
-
export const height: SimpleStyleFunction<'height'>;
|
|
6
|
-
export const maxHeight: SimpleStyleFunction<'maxHeight'>;
|
|
7
|
-
export const minHeight: SimpleStyleFunction<'minHeight'>;
|
|
8
|
-
export const sizeWidth: SimpleStyleFunction<'sizeWidth'>;
|
|
9
|
-
export const sizeHeight: SimpleStyleFunction<'sizeHeight'>;
|
|
10
|
-
export const boxSizing: SimpleStyleFunction<'boxSizing'>;
|
|
11
|
-
export type SizingProps = PropsFor<typeof sizing>;
|
|
12
|
-
export default sizing;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SimpleStyleFunction, spacing, PropsFor } from "../Box/index.js";
|
|
2
|
-
export type SpacingValueType = string | number | null | undefined;
|
|
3
|
-
export type SpacingProps = PropsFor<typeof spacing>;
|
|
4
|
-
export function createUnarySpacing<Spacing>(theme: {
|
|
5
|
-
spacing: Spacing;
|
|
6
|
-
}): Spacing extends number ? (abs: number | string) => number | number : Spacing extends any[] ? <Index extends number>(abs: Index | string) => Spacing[Index] | string : Spacing extends ((...args: unknown[]) => unknown) ? Spacing :
|
|
7
|
-
// warns in Dev
|
|
8
|
-
() => undefined;
|
|
9
|
-
export function createUnaryUnit<Spacing>(theme: {
|
|
10
|
-
spacing: Spacing;
|
|
11
|
-
}, themeKey: string, defaultValue: Spacing, propName: string): Spacing extends number ? (abs: SpacingValueType) => number | number : Spacing extends any[] ? <Index extends number>(abs: Index | string) => Spacing[Index] | string : Spacing extends ((...args: unknown[]) => unknown) ? Spacing :
|
|
12
|
-
// warns in Dev
|
|
13
|
-
() => undefined;
|
|
14
|
-
export const margin: SimpleStyleFunction<'m' | 'mt' | 'mr' | 'mb' | 'ml' | 'mx' | 'my' | 'margin' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'marginX' | 'marginY' | 'marginInline' | 'marginInlineStart' | 'marginInlineEnd' | 'marginBlock' | 'marginBlockStart' | 'marginBlockEnd'>;
|
|
15
|
-
export type MarginProps = PropsFor<typeof margin>;
|
|
16
|
-
export const padding: SimpleStyleFunction<'p' | 'pt' | 'pr' | 'pb' | 'pl' | 'px' | 'py' | 'padding' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'paddingX' | 'paddingY' | 'paddingInline' | 'paddingInlineStart' | 'paddingInlineEnd' | 'paddingBlock' | 'paddingBlockStart' | 'paddingBlockEnd'>;
|
|
17
|
-
export function getValue(transformer: (prop: SpacingValueType) => SpacingValueType, propValue: SpacingValueType): SpacingValueType;
|
|
18
|
-
export type PaddingProps = PropsFor<typeof padding>;
|
|
19
|
-
export default spacing;
|
package/modern/style/index.d.ts
DELETED