@mui/system 9.1.0 → 9.1.2
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.mts +15 -19
- package/Box/Box.d.ts +15 -19
- package/Box/Box.js +16 -1
- package/Box/Box.mjs +17 -1
- package/Box/index.js +12 -2
- package/Box/index.mjs +1 -0
- package/CHANGELOG.md +74 -0
- package/Container/index.d.mts +1 -1
- package/Container/index.d.ts +1 -1
- package/Grid/Grid.js +0 -1
- package/Grid/Grid.mjs +0 -1
- package/Grid/GridProps.d.mts +0 -1
- package/Grid/GridProps.d.ts +0 -1
- package/Grid/gridGenerator.d.mts +2 -2
- package/Grid/gridGenerator.d.ts +2 -2
- package/InitColorSchemeScript/InitColorSchemeScript.d.mts +2 -1
- package/InitColorSchemeScript/InitColorSchemeScript.d.ts +2 -1
- package/InitColorSchemeScript/InitColorSchemeScript.js +34 -1
- package/InitColorSchemeScript/InitColorSchemeScript.mjs +33 -1
- package/ThemeProvider/ThemeProvider.d.mts +9 -6
- package/ThemeProvider/ThemeProvider.d.ts +9 -6
- package/ThemeProvider/ThemeProvider.js +3 -2
- package/ThemeProvider/ThemeProvider.mjs +3 -2
- package/ThemeProvider/index.d.mts +1 -1
- package/ThemeProvider/index.d.ts +1 -1
- package/borders/borders.d.mts +14 -12
- package/borders/borders.d.ts +14 -12
- package/borders/borders.js +2 -4
- package/borders/borders.mjs +3 -4
- package/breakpoints/breakpoints.d.mts +13 -16
- package/breakpoints/breakpoints.d.ts +13 -16
- package/breakpoints/breakpoints.js +17 -16
- package/breakpoints/breakpoints.mjs +17 -16
- package/compose/compose.d.mts +3 -10
- package/compose/compose.d.ts +3 -10
- package/compose/compose.js +0 -2
- package/compose/compose.mjs +0 -2
- package/createBox/createBox.d.mts +4 -4
- package/createBox/createBox.d.ts +4 -4
- package/createBreakpoints/createBreakpoints.d.mts +3 -54
- package/createBreakpoints/createBreakpoints.d.ts +3 -54
- package/createBreakpoints/createBreakpoints.js +6 -8
- package/createBreakpoints/createBreakpoints.mjs +6 -8
- package/createBreakpoints/index.d.mts +0 -1
- package/createBreakpoints/index.d.ts +0 -1
- package/createTheme/createSpacing.d.mts +1 -1
- package/createTheme/createSpacing.d.ts +1 -1
- package/createTheme/shape.d.mts +2 -2
- package/createTheme/shape.d.ts +2 -2
- package/cssGrid/cssGrid.d.mts +13 -13
- package/cssGrid/cssGrid.d.ts +13 -13
- package/cssGrid/cssGrid.js +0 -8
- package/cssGrid/cssGrid.mjs +0 -9
- package/cssVars/createCssVarsProvider.js +2 -2
- package/cssVars/createCssVarsProvider.mjs +2 -2
- package/cssVars/cssVarsParser.d.mts +1 -1
- package/cssVars/cssVarsParser.d.ts +1 -1
- package/cssVars/useCurrentColorScheme.js +1 -0
- package/cssVars/useCurrentColorScheme.mjs +1 -0
- package/display/display.d.mts +49 -1
- package/display/display.d.ts +49 -1
- package/display/display.js +2 -1
- package/display/display.mjs +2 -1
- package/flexbox/flexbox.d.mts +14 -14
- package/flexbox/flexbox.d.ts +14 -14
- package/getThemeValue/getThemeValue.d.mts +2 -1
- package/getThemeValue/getThemeValue.d.ts +2 -1
- package/getThemeValue/getThemeValue.js +6 -2
- package/getThemeValue/getThemeValue.mjs +7 -3
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/memoTheme.d.mts +1 -1
- package/memoTheme.d.ts +1 -1
- package/memoize/memoize.d.mts +1 -1
- package/memoize/memoize.d.ts +1 -1
- package/package.json +61 -61
- package/palette/palette.d.mts +4 -3
- package/palette/palette.d.ts +4 -3
- package/palette/palette.js +1 -0
- package/palette/palette.mjs +2 -0
- package/positions/positions.d.mts +49 -1
- package/positions/positions.d.ts +49 -1
- package/positions/positions.js +2 -1
- package/positions/positions.mjs +2 -1
- package/propsToClassKey/propsToClassKey.d.mts +5 -0
- package/propsToClassKey/propsToClassKey.d.ts +5 -0
- package/propsToClassKey/propsToClassKey.js +1 -1
- package/propsToClassKey/propsToClassKey.mjs +1 -1
- package/shadows/shadows.d.mts +4 -4
- package/shadows/shadows.d.ts +4 -4
- package/sizing/sizing.d.mts +10 -10
- package/sizing/sizing.d.ts +10 -10
- package/sizing/sizing.js +7 -2
- package/sizing/sizing.mjs +5 -1
- package/spacing/spacing.d.mts +10 -14
- package/spacing/spacing.d.ts +10 -14
- package/spacing/spacing.js +17 -13
- package/spacing/spacing.mjs +16 -9
- package/styleFunctionSx/defaultSxConfig.d.mts +1 -1
- package/styleFunctionSx/defaultSxConfig.d.ts +1 -1
- package/styleFunctionSx/extendSxProp.d.mts +4 -2
- package/styleFunctionSx/extendSxProp.d.ts +4 -2
- package/styled/styled.d.mts +1 -1
- package/styled/styled.d.ts +1 -1
- package/typography/typography.d.mts +10 -10
- package/typography/typography.d.ts +10 -10
- package/useTheme/useTheme.d.mts +4 -2
- package/useTheme/useTheme.d.ts +4 -2
- package/useThemeProps/getThemeProps.d.mts +2 -2
- package/useThemeProps/getThemeProps.d.ts +2 -2
- package/useThemeProps/index.d.mts +1 -1
- package/useThemeProps/index.d.ts +1 -1
- package/useThemeProps/useThemeProps.js +7 -6
- package/useThemeProps/useThemeProps.mjs +7 -6
- package/useThemeWithoutDefault/useThemeWithoutDefault.d.mts +2 -1
- package/useThemeWithoutDefault/useThemeWithoutDefault.d.ts +2 -1
- package/useThemeWithoutDefault/useThemeWithoutDefault.js +2 -2
- package/useThemeWithoutDefault/useThemeWithoutDefault.mjs +2 -2
- package/version/index.js +2 -2
- package/version/index.mjs +2 -2
package/spacing/spacing.mjs
CHANGED
|
@@ -40,7 +40,11 @@ for (const keyProperty in properties) {
|
|
|
40
40
|
for (const key in aliases) {
|
|
41
41
|
CSS_PROPERTIES[key] = CSS_PROPERTIES[aliases[key]];
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
43
45
|
export const marginKeys = new Set(['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd']);
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
44
48
|
export const paddingKeys = new Set(['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd']);
|
|
45
49
|
const spacingKeys = new Set([...marginKeys, ...paddingKeys]);
|
|
46
50
|
export function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
@@ -132,28 +136,31 @@ function style(props, keys) {
|
|
|
132
136
|
}
|
|
133
137
|
return result;
|
|
134
138
|
}
|
|
135
|
-
|
|
139
|
+
function marginFn(props) {
|
|
136
140
|
return style(props, marginKeys);
|
|
137
141
|
}
|
|
138
|
-
|
|
142
|
+
marginFn.propTypes = process.env.NODE_ENV !== 'production' ? Array.from(marginKeys).reduce((obj, key) => {
|
|
139
143
|
obj[key] = responsivePropType;
|
|
140
144
|
return obj;
|
|
141
145
|
}, {}) : {};
|
|
142
|
-
|
|
143
|
-
export
|
|
146
|
+
marginFn.filterProps = marginKeys;
|
|
147
|
+
export const margin = marginFn;
|
|
148
|
+
function paddingFn(props) {
|
|
144
149
|
return style(props, paddingKeys);
|
|
145
150
|
}
|
|
146
|
-
|
|
151
|
+
paddingFn.propTypes = process.env.NODE_ENV !== 'production' ? Array.from(paddingKeys).reduce((obj, key) => {
|
|
147
152
|
obj[key] = responsivePropType;
|
|
148
153
|
return obj;
|
|
149
154
|
}, {}) : {};
|
|
150
|
-
|
|
151
|
-
|
|
155
|
+
paddingFn.filterProps = paddingKeys;
|
|
156
|
+
export const padding = paddingFn;
|
|
157
|
+
function spacingFn(props) {
|
|
152
158
|
return style(props, spacingKeys);
|
|
153
159
|
}
|
|
154
|
-
|
|
160
|
+
spacingFn.propTypes = process.env.NODE_ENV !== 'production' ? Array.from(spacingKeys).reduce((obj, key) => {
|
|
155
161
|
obj[key] = responsivePropType;
|
|
156
162
|
return obj;
|
|
157
163
|
}, {}) : {};
|
|
158
|
-
|
|
164
|
+
spacingFn.filterProps = spacingKeys;
|
|
165
|
+
const spacing = spacingFn;
|
|
159
166
|
export default spacing;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StyleFunction, TransformFunction } from "../style/index.mjs";
|
|
1
|
+
import type { StyleFunction, TransformFunction } from "../style/index.mjs";
|
|
2
2
|
type SimpleStyleFunction<PropKey extends keyof any> = StyleFunction<Partial<Record<PropKey, any>>>;
|
|
3
3
|
export interface SxConfigRecord {
|
|
4
4
|
cssProperty?: keyof React.CSSProperties | false | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StyleFunction, TransformFunction } from "../style/index.js";
|
|
1
|
+
import type { StyleFunction, TransformFunction } from "../style/index.js";
|
|
2
2
|
type SimpleStyleFunction<PropKey extends keyof any> = StyleFunction<Partial<Record<PropKey, any>>>;
|
|
3
3
|
export interface SxConfigRecord {
|
|
4
4
|
cssProperty?: keyof React.CSSProperties | false | undefined;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { SxProps } from "./styleFunctionSx.mjs";
|
|
1
|
+
import type { SxProps } from "./styleFunctionSx.mjs";
|
|
2
2
|
export default function extendSxProp<Props extends {
|
|
3
3
|
sx?: SxProps<any> | undefined;
|
|
4
|
-
} = {
|
|
4
|
+
} = {
|
|
5
|
+
sx?: SxProps<any> | undefined;
|
|
6
|
+
}>(props: Props): Props;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { SxProps } from "./styleFunctionSx.js";
|
|
1
|
+
import type { SxProps } from "./styleFunctionSx.js";
|
|
2
2
|
export default function extendSxProp<Props extends {
|
|
3
3
|
sx?: SxProps<any> | undefined;
|
|
4
|
-
} = {
|
|
4
|
+
} = {
|
|
5
|
+
sx?: SxProps<any> | undefined;
|
|
6
|
+
}>(props: Props): Props;
|
package/styled/styled.d.mts
CHANGED
package/styled/styled.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { PropsFor, SimpleStyleFunction } from "../style/index.mjs";
|
|
2
|
-
export const
|
|
3
|
-
export const
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
7
|
-
export const
|
|
8
|
-
export const lineHeight: SimpleStyleFunction<'lineHeight'>;
|
|
9
|
-
export const textAlign: SimpleStyleFunction<'textAlign'>;
|
|
10
|
-
export const
|
|
1
|
+
import type { PropsFor, SimpleStyleFunction } from "../style/index.mjs";
|
|
2
|
+
export declare const fontFamily: SimpleStyleFunction<'fontFamily'>;
|
|
3
|
+
export declare const fontSize: SimpleStyleFunction<'fontSize'>;
|
|
4
|
+
export declare const fontStyle: SimpleStyleFunction<'fontStyle'>;
|
|
5
|
+
export declare const fontWeight: SimpleStyleFunction<'fontWeight'>;
|
|
6
|
+
export declare const letterSpacing: SimpleStyleFunction<'letterSpacing'>;
|
|
7
|
+
export declare const textTransform: SimpleStyleFunction<'textTransform'>;
|
|
8
|
+
export declare const lineHeight: SimpleStyleFunction<'lineHeight'>;
|
|
9
|
+
export declare const textAlign: SimpleStyleFunction<'textAlign'>;
|
|
10
|
+
export declare const typographyVariant: SimpleStyleFunction<'typography'>;
|
|
11
11
|
declare const typography: SimpleStyleFunction<'typography' | 'fontFamily' | 'fontSize' | 'fontStyle' | 'fontWeight' | 'letterSpacing' | 'lineHeight' | 'textAlign' | 'textTransform'>;
|
|
12
12
|
export type TypographyProps = PropsFor<typeof typography>;
|
|
13
13
|
export default typography;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { PropsFor, SimpleStyleFunction } from "../style/index.js";
|
|
2
|
-
export const
|
|
3
|
-
export const
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
7
|
-
export const
|
|
8
|
-
export const lineHeight: SimpleStyleFunction<'lineHeight'>;
|
|
9
|
-
export const textAlign: SimpleStyleFunction<'textAlign'>;
|
|
10
|
-
export const
|
|
1
|
+
import type { PropsFor, SimpleStyleFunction } from "../style/index.js";
|
|
2
|
+
export declare const fontFamily: SimpleStyleFunction<'fontFamily'>;
|
|
3
|
+
export declare const fontSize: SimpleStyleFunction<'fontSize'>;
|
|
4
|
+
export declare const fontStyle: SimpleStyleFunction<'fontStyle'>;
|
|
5
|
+
export declare const fontWeight: SimpleStyleFunction<'fontWeight'>;
|
|
6
|
+
export declare const letterSpacing: SimpleStyleFunction<'letterSpacing'>;
|
|
7
|
+
export declare const textTransform: SimpleStyleFunction<'textTransform'>;
|
|
8
|
+
export declare const lineHeight: SimpleStyleFunction<'lineHeight'>;
|
|
9
|
+
export declare const textAlign: SimpleStyleFunction<'textAlign'>;
|
|
10
|
+
export declare const typographyVariant: SimpleStyleFunction<'typography'>;
|
|
11
11
|
declare const typography: SimpleStyleFunction<'typography' | 'fontFamily' | 'fontSize' | 'fontStyle' | 'fontWeight' | 'letterSpacing' | 'lineHeight' | 'textAlign' | 'textTransform'>;
|
|
12
12
|
export type TypographyProps = PropsFor<typeof typography>;
|
|
13
13
|
export default typography;
|
package/useTheme/useTheme.d.mts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { Theme } from "../createTheme/index.mjs";
|
|
2
|
-
export
|
|
1
|
+
import type { Theme } from "../createTheme/index.mjs";
|
|
2
|
+
export declare const systemDefaultTheme: Theme;
|
|
3
|
+
declare function useTheme<T = Theme>(defaultTheme?: T): T;
|
|
4
|
+
export default useTheme;
|
package/useTheme/useTheme.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { Theme } from "../createTheme/index.js";
|
|
2
|
-
export
|
|
1
|
+
import type { Theme } from "../createTheme/index.js";
|
|
2
|
+
export declare const systemDefaultTheme: Theme;
|
|
3
|
+
declare function useTheme<T = Theme>(defaultTheme?: T): T;
|
|
4
|
+
export default useTheme;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export {};
|
|
2
1
|
type ThemedProps<Theme, Name extends keyof any> = Theme extends {
|
|
3
2
|
components: Record<Name, {
|
|
4
3
|
defaultProps: infer Props;
|
|
@@ -8,4 +7,5 @@ export default function getThemeProps<Theme, Props, Name extends keyof any>(para
|
|
|
8
7
|
props: Props;
|
|
9
8
|
name: Name;
|
|
10
9
|
theme?: Theme | undefined;
|
|
11
|
-
}): Props & ThemedProps<Theme, Name>;
|
|
10
|
+
}): Props & ThemedProps<Theme, Name>;
|
|
11
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export {};
|
|
2
1
|
type ThemedProps<Theme, Name extends keyof any> = Theme extends {
|
|
3
2
|
components: Record<Name, {
|
|
4
3
|
defaultProps: infer Props;
|
|
@@ -8,4 +7,5 @@ export default function getThemeProps<Theme, Props, Name extends keyof any>(para
|
|
|
8
7
|
props: Props;
|
|
9
8
|
name: Name;
|
|
10
9
|
theme?: Theme | undefined;
|
|
11
|
-
}): Props & ThemedProps<Theme, Name>;
|
|
10
|
+
}): Props & ThemedProps<Theme, Name>;
|
|
11
|
+
export {};
|
package/useThemeProps/index.d.ts
CHANGED
|
@@ -8,12 +8,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = useThemeProps;
|
|
9
9
|
var _getThemeProps = _interopRequireDefault(require("./getThemeProps"));
|
|
10
10
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
11
|
-
function useThemeProps({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
function useThemeProps(params) {
|
|
12
|
+
const {
|
|
13
|
+
props,
|
|
14
|
+
name,
|
|
15
|
+
defaultTheme,
|
|
16
|
+
themeId
|
|
17
|
+
} = params;
|
|
17
18
|
let theme = (0, _useTheme.default)(defaultTheme);
|
|
18
19
|
if (themeId) {
|
|
19
20
|
theme = theme[themeId] || theme;
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import getThemeProps from "./getThemeProps.mjs";
|
|
4
4
|
import useTheme from "../useTheme/index.mjs";
|
|
5
|
-
export default function useThemeProps({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
export default function useThemeProps(params) {
|
|
6
|
+
const {
|
|
7
|
+
props,
|
|
8
|
+
name,
|
|
9
|
+
defaultTheme,
|
|
10
|
+
themeId
|
|
11
|
+
} = params;
|
|
11
12
|
let theme = useTheme(defaultTheme);
|
|
12
13
|
if (themeId) {
|
|
13
14
|
theme = theme[themeId] || theme;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare function useThemeWithoutDefault<T = null>(defaultTheme?: T): T;
|
|
2
|
+
export default useThemeWithoutDefault;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare function useThemeWithoutDefault<T = null>(defaultTheme?: T): T;
|
|
2
|
+
export default useThemeWithoutDefault;
|
|
@@ -11,8 +11,8 @@ var _styledEngine = require("@mui/styled-engine");
|
|
|
11
11
|
function isObjectEmpty(obj) {
|
|
12
12
|
return Object.keys(obj).length === 0;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function useThemeWithoutDefault(defaultTheme = null) {
|
|
15
15
|
const contextTheme = React.useContext(_styledEngine.ThemeContext);
|
|
16
16
|
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
|
|
17
17
|
}
|
|
18
|
-
var _default = exports.default =
|
|
18
|
+
var _default = exports.default = useThemeWithoutDefault;
|
|
@@ -5,8 +5,8 @@ import { ThemeContext } from '@mui/styled-engine';
|
|
|
5
5
|
function isObjectEmpty(obj) {
|
|
6
6
|
return Object.keys(obj).length === 0;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function useThemeWithoutDefault(defaultTheme = null) {
|
|
9
9
|
const contextTheme = React.useContext(ThemeContext);
|
|
10
10
|
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
|
|
11
11
|
}
|
|
12
|
-
export default
|
|
12
|
+
export default useThemeWithoutDefault;
|
package/version/index.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.prerelease = exports.patch = exports.minor = exports.major = exports.default = void 0;
|
|
7
|
-
const version = exports.version = "9.1.
|
|
7
|
+
const version = exports.version = "9.1.2";
|
|
8
8
|
const major = exports.major = Number("9");
|
|
9
9
|
const minor = exports.minor = Number("1");
|
|
10
|
-
const patch = exports.patch = Number("
|
|
10
|
+
const patch = exports.patch = Number("2");
|
|
11
11
|
const prerelease = exports.prerelease = undefined;
|
|
12
12
|
var _default = exports.default = version;
|
package/version/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "9.1.
|
|
1
|
+
export const version = "9.1.2";
|
|
2
2
|
export const major = Number("9");
|
|
3
3
|
export const minor = Number("1");
|
|
4
|
-
export const patch = Number("
|
|
4
|
+
export const patch = Number("2");
|
|
5
5
|
export const prerelease = undefined;
|
|
6
6
|
export default version;
|