@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.
Files changed (120) hide show
  1. package/Box/Box.d.mts +15 -19
  2. package/Box/Box.d.ts +15 -19
  3. package/Box/Box.js +16 -1
  4. package/Box/Box.mjs +17 -1
  5. package/Box/index.js +12 -2
  6. package/Box/index.mjs +1 -0
  7. package/CHANGELOG.md +74 -0
  8. package/Container/index.d.mts +1 -1
  9. package/Container/index.d.ts +1 -1
  10. package/Grid/Grid.js +0 -1
  11. package/Grid/Grid.mjs +0 -1
  12. package/Grid/GridProps.d.mts +0 -1
  13. package/Grid/GridProps.d.ts +0 -1
  14. package/Grid/gridGenerator.d.mts +2 -2
  15. package/Grid/gridGenerator.d.ts +2 -2
  16. package/InitColorSchemeScript/InitColorSchemeScript.d.mts +2 -1
  17. package/InitColorSchemeScript/InitColorSchemeScript.d.ts +2 -1
  18. package/InitColorSchemeScript/InitColorSchemeScript.js +34 -1
  19. package/InitColorSchemeScript/InitColorSchemeScript.mjs +33 -1
  20. package/ThemeProvider/ThemeProvider.d.mts +9 -6
  21. package/ThemeProvider/ThemeProvider.d.ts +9 -6
  22. package/ThemeProvider/ThemeProvider.js +3 -2
  23. package/ThemeProvider/ThemeProvider.mjs +3 -2
  24. package/ThemeProvider/index.d.mts +1 -1
  25. package/ThemeProvider/index.d.ts +1 -1
  26. package/borders/borders.d.mts +14 -12
  27. package/borders/borders.d.ts +14 -12
  28. package/borders/borders.js +2 -4
  29. package/borders/borders.mjs +3 -4
  30. package/breakpoints/breakpoints.d.mts +13 -16
  31. package/breakpoints/breakpoints.d.ts +13 -16
  32. package/breakpoints/breakpoints.js +17 -16
  33. package/breakpoints/breakpoints.mjs +17 -16
  34. package/compose/compose.d.mts +3 -10
  35. package/compose/compose.d.ts +3 -10
  36. package/compose/compose.js +0 -2
  37. package/compose/compose.mjs +0 -2
  38. package/createBox/createBox.d.mts +4 -4
  39. package/createBox/createBox.d.ts +4 -4
  40. package/createBreakpoints/createBreakpoints.d.mts +3 -54
  41. package/createBreakpoints/createBreakpoints.d.ts +3 -54
  42. package/createBreakpoints/createBreakpoints.js +6 -8
  43. package/createBreakpoints/createBreakpoints.mjs +6 -8
  44. package/createBreakpoints/index.d.mts +0 -1
  45. package/createBreakpoints/index.d.ts +0 -1
  46. package/createTheme/createSpacing.d.mts +1 -1
  47. package/createTheme/createSpacing.d.ts +1 -1
  48. package/createTheme/shape.d.mts +2 -2
  49. package/createTheme/shape.d.ts +2 -2
  50. package/cssGrid/cssGrid.d.mts +13 -13
  51. package/cssGrid/cssGrid.d.ts +13 -13
  52. package/cssGrid/cssGrid.js +0 -8
  53. package/cssGrid/cssGrid.mjs +0 -9
  54. package/cssVars/createCssVarsProvider.js +2 -2
  55. package/cssVars/createCssVarsProvider.mjs +2 -2
  56. package/cssVars/cssVarsParser.d.mts +1 -1
  57. package/cssVars/cssVarsParser.d.ts +1 -1
  58. package/cssVars/useCurrentColorScheme.js +1 -0
  59. package/cssVars/useCurrentColorScheme.mjs +1 -0
  60. package/display/display.d.mts +49 -1
  61. package/display/display.d.ts +49 -1
  62. package/display/display.js +2 -1
  63. package/display/display.mjs +2 -1
  64. package/flexbox/flexbox.d.mts +14 -14
  65. package/flexbox/flexbox.d.ts +14 -14
  66. package/getThemeValue/getThemeValue.d.mts +2 -1
  67. package/getThemeValue/getThemeValue.d.ts +2 -1
  68. package/getThemeValue/getThemeValue.js +6 -2
  69. package/getThemeValue/getThemeValue.mjs +7 -3
  70. package/index.js +1 -1
  71. package/index.mjs +1 -1
  72. package/memoTheme.d.mts +1 -1
  73. package/memoTheme.d.ts +1 -1
  74. package/memoize/memoize.d.mts +1 -1
  75. package/memoize/memoize.d.ts +1 -1
  76. package/package.json +61 -61
  77. package/palette/palette.d.mts +4 -3
  78. package/palette/palette.d.ts +4 -3
  79. package/palette/palette.js +1 -0
  80. package/palette/palette.mjs +2 -0
  81. package/positions/positions.d.mts +49 -1
  82. package/positions/positions.d.ts +49 -1
  83. package/positions/positions.js +2 -1
  84. package/positions/positions.mjs +2 -1
  85. package/propsToClassKey/propsToClassKey.d.mts +5 -0
  86. package/propsToClassKey/propsToClassKey.d.ts +5 -0
  87. package/propsToClassKey/propsToClassKey.js +1 -1
  88. package/propsToClassKey/propsToClassKey.mjs +1 -1
  89. package/shadows/shadows.d.mts +4 -4
  90. package/shadows/shadows.d.ts +4 -4
  91. package/sizing/sizing.d.mts +10 -10
  92. package/sizing/sizing.d.ts +10 -10
  93. package/sizing/sizing.js +7 -2
  94. package/sizing/sizing.mjs +5 -1
  95. package/spacing/spacing.d.mts +10 -14
  96. package/spacing/spacing.d.ts +10 -14
  97. package/spacing/spacing.js +17 -13
  98. package/spacing/spacing.mjs +16 -9
  99. package/styleFunctionSx/defaultSxConfig.d.mts +1 -1
  100. package/styleFunctionSx/defaultSxConfig.d.ts +1 -1
  101. package/styleFunctionSx/extendSxProp.d.mts +4 -2
  102. package/styleFunctionSx/extendSxProp.d.ts +4 -2
  103. package/styled/styled.d.mts +1 -1
  104. package/styled/styled.d.ts +1 -1
  105. package/typography/typography.d.mts +10 -10
  106. package/typography/typography.d.ts +10 -10
  107. package/useTheme/useTheme.d.mts +4 -2
  108. package/useTheme/useTheme.d.ts +4 -2
  109. package/useThemeProps/getThemeProps.d.mts +2 -2
  110. package/useThemeProps/getThemeProps.d.ts +2 -2
  111. package/useThemeProps/index.d.mts +1 -1
  112. package/useThemeProps/index.d.ts +1 -1
  113. package/useThemeProps/useThemeProps.js +7 -6
  114. package/useThemeProps/useThemeProps.mjs +7 -6
  115. package/useThemeWithoutDefault/useThemeWithoutDefault.d.mts +2 -1
  116. package/useThemeWithoutDefault/useThemeWithoutDefault.d.ts +2 -1
  117. package/useThemeWithoutDefault/useThemeWithoutDefault.js +2 -2
  118. package/useThemeWithoutDefault/useThemeWithoutDefault.mjs +2 -2
  119. package/version/index.js +2 -2
  120. package/version/index.mjs +2 -2
@@ -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
- export function margin(props) {
139
+ function marginFn(props) {
136
140
  return style(props, marginKeys);
137
141
  }
138
- margin.propTypes = process.env.NODE_ENV !== 'production' ? Array.from(marginKeys).reduce((obj, key) => {
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
- margin.filterProps = marginKeys;
143
- export function padding(props) {
146
+ marginFn.filterProps = marginKeys;
147
+ export const margin = marginFn;
148
+ function paddingFn(props) {
144
149
  return style(props, paddingKeys);
145
150
  }
146
- padding.propTypes = process.env.NODE_ENV !== 'production' ? Array.from(paddingKeys).reduce((obj, key) => {
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
- padding.filterProps = paddingKeys;
151
- function spacing(props) {
155
+ paddingFn.filterProps = paddingKeys;
156
+ export const padding = paddingFn;
157
+ function spacingFn(props) {
152
158
  return style(props, spacingKeys);
153
159
  }
154
- spacing.propTypes = process.env.NODE_ENV !== 'production' ? Array.from(spacingKeys).reduce((obj, key) => {
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
- spacing.filterProps = spacingKeys;
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
- } = {}>(props: Props): Props;
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
- } = {}>(props: Props): Props;
4
+ } = {
5
+ sx?: SxProps<any> | undefined;
6
+ }>(props: Props): Props;
@@ -1,3 +1,3 @@
1
- import { CreateMUIStyled } from "../createStyled/index.mjs";
1
+ import type { CreateMUIStyled } from "../createStyled/index.mjs";
2
2
  declare const styled: CreateMUIStyled;
3
3
  export default styled;
@@ -1,3 +1,3 @@
1
- import { CreateMUIStyled } from "../createStyled/index.js";
1
+ import type { CreateMUIStyled } from "../createStyled/index.js";
2
2
  declare const styled: CreateMUIStyled;
3
3
  export default styled;
@@ -1,13 +1,13 @@
1
- import { PropsFor, SimpleStyleFunction } from "../style/index.mjs";
2
- export const typographyVariant: SimpleStyleFunction<'typography'>;
3
- export const fontFamily: SimpleStyleFunction<'fontFamily'>;
4
- export const fontSize: SimpleStyleFunction<'fontSize'>;
5
- export const fontStyle: SimpleStyleFunction<'fontStyle'>;
6
- export const fontWeight: SimpleStyleFunction<'fontWeight'>;
7
- export const letterSpacing: SimpleStyleFunction<'letterSpacing'>;
8
- export const lineHeight: SimpleStyleFunction<'lineHeight'>;
9
- export const textAlign: SimpleStyleFunction<'textAlign'>;
10
- export const textTransform: SimpleStyleFunction<'textTransform'>;
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 typographyVariant: SimpleStyleFunction<'typography'>;
3
- export const fontFamily: SimpleStyleFunction<'fontFamily'>;
4
- export const fontSize: SimpleStyleFunction<'fontSize'>;
5
- export const fontStyle: SimpleStyleFunction<'fontStyle'>;
6
- export const fontWeight: SimpleStyleFunction<'fontWeight'>;
7
- export const letterSpacing: SimpleStyleFunction<'letterSpacing'>;
8
- export const lineHeight: SimpleStyleFunction<'lineHeight'>;
9
- export const textAlign: SimpleStyleFunction<'textAlign'>;
10
- export const textTransform: SimpleStyleFunction<'textTransform'>;
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;
@@ -1,2 +1,4 @@
1
- import { Theme } from "../createTheme/index.mjs";
2
- export default function useTheme<T = Theme>(defaultTheme?: T): T;
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;
@@ -1,2 +1,4 @@
1
- import { Theme } from "../createTheme/index.js";
2
- export default function useTheme<T = Theme>(defaultTheme?: T): T;
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 {};
@@ -1,3 +1,3 @@
1
1
  export { default } from "./useThemeProps.mjs";
2
- export * from "./useThemeProps.mjs";
2
+ export type * from "./useThemeProps.mjs";
3
3
  export { default as getThemeProps } from "./getThemeProps.mjs";
@@ -1,3 +1,3 @@
1
1
  export { default } from "./useThemeProps.js";
2
- export * from "./useThemeProps.js";
2
+ export type * from "./useThemeProps.js";
3
3
  export { default as getThemeProps } from "./getThemeProps.js";
@@ -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
- props,
13
- name,
14
- defaultTheme,
15
- themeId
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
- props,
7
- name,
8
- defaultTheme,
9
- themeId
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
- export default function useThemeWithoutDefault<T = null>(defaultTheme?: T): T;
1
+ declare function useThemeWithoutDefault<T = null>(defaultTheme?: T): T;
2
+ export default useThemeWithoutDefault;
@@ -1 +1,2 @@
1
- export default function useThemeWithoutDefault<T = null>(defaultTheme?: T): T;
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 useTheme(defaultTheme = null) {
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 = useTheme;
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 useTheme(defaultTheme = null) {
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 useTheme;
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.0";
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("0");
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.0";
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("0");
4
+ export const patch = Number("2");
5
5
  export const prerelease = undefined;
6
6
  export default version;