@mui/material 6.1.1 → 6.1.3

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 (129) hide show
  1. package/Autocomplete/Autocomplete.js +1 -5
  2. package/Badge/Badge.d.ts +2 -2
  3. package/Badge/Badge.js +12 -8
  4. package/Button/Button.js +3 -4
  5. package/CHANGELOG.md +136 -0
  6. package/ClickAwayListener/ClickAwayListener.js +2 -2
  7. package/Fade/Fade.js +2 -2
  8. package/Grid2/Grid2.d.ts +16 -11
  9. package/Grid2/Grid2.js +29 -11
  10. package/Grow/Grow.js +2 -2
  11. package/Icon/Icon.js +1 -1
  12. package/InputBase/InputBase.js +1 -1
  13. package/LinearProgress/LinearProgress.js +7 -0
  14. package/MenuList/MenuList.js +2 -1
  15. package/Modal/Modal.js +3 -3
  16. package/Modal/ModalManager.d.ts +1 -1
  17. package/Modal/ModalManager.js +5 -5
  18. package/Modal/useModal.js +9 -5
  19. package/OutlinedInput/OutlinedInput.js +6 -6
  20. package/PigmentGrid/PigmentGrid.d.ts +0 -23
  21. package/PigmentGrid/PigmentGrid.js +0 -23
  22. package/Portal/Portal.js +2 -2
  23. package/Rating/Rating.d.ts +1 -1
  24. package/Rating/Rating.js +7 -2
  25. package/Select/Select.js +2 -2
  26. package/Select/SelectInput.js +1 -1
  27. package/Slide/Slide.js +2 -2
  28. package/SwipeableDrawer/SwipeableDrawer.d.ts +1 -1
  29. package/Tooltip/Tooltip.js +2 -2
  30. package/Unstable_TrapFocus/FocusTrap.js +3 -3
  31. package/Zoom/Zoom.js +2 -2
  32. package/index.js +1 -1
  33. package/modern/Autocomplete/Autocomplete.js +1 -5
  34. package/modern/Badge/Badge.js +12 -8
  35. package/modern/Button/Button.js +3 -4
  36. package/modern/ClickAwayListener/ClickAwayListener.js +2 -2
  37. package/modern/Fade/Fade.js +2 -2
  38. package/modern/Grid2/Grid2.js +29 -11
  39. package/modern/Grow/Grow.js +2 -2
  40. package/modern/Icon/Icon.js +1 -1
  41. package/modern/InputBase/InputBase.js +1 -1
  42. package/modern/LinearProgress/LinearProgress.js +7 -0
  43. package/modern/MenuList/MenuList.js +2 -1
  44. package/modern/Modal/Modal.js +3 -3
  45. package/modern/Modal/ModalManager.js +5 -5
  46. package/modern/Modal/useModal.js +9 -5
  47. package/modern/OutlinedInput/OutlinedInput.js +6 -6
  48. package/modern/PigmentGrid/PigmentGrid.js +0 -23
  49. package/modern/Portal/Portal.js +2 -2
  50. package/modern/Rating/Rating.js +7 -2
  51. package/modern/Select/Select.js +2 -2
  52. package/modern/Select/SelectInput.js +1 -1
  53. package/modern/Slide/Slide.js +2 -2
  54. package/modern/Tooltip/Tooltip.js +2 -2
  55. package/modern/Unstable_TrapFocus/FocusTrap.js +3 -3
  56. package/modern/Zoom/Zoom.js +2 -2
  57. package/modern/index.js +1 -1
  58. package/modern/styles/createGetSelector.js +8 -7
  59. package/modern/styles/createPalette.js +2 -16
  60. package/modern/styles/createThemeNoVars.js +1 -2
  61. package/modern/styles/createThemeWithVars.js +2 -0
  62. package/modern/styles/index.js +1 -1
  63. package/modern/styles/makeStyles.js +1 -3
  64. package/modern/styles/responsiveFontSizes.js +1 -2
  65. package/modern/styles/shouldSkipGeneratingVar.js +1 -1
  66. package/modern/styles/withStyles.js +1 -3
  67. package/modern/styles/withTheme.js +1 -3
  68. package/modern/useAutocomplete/useAutocomplete.js +3 -1
  69. package/modern/utils/memoTheme.js +3 -24
  70. package/modern/version/index.js +2 -2
  71. package/node/Autocomplete/Autocomplete.js +1 -5
  72. package/node/Badge/Badge.js +12 -8
  73. package/node/Button/Button.js +3 -4
  74. package/node/ClickAwayListener/ClickAwayListener.js +2 -2
  75. package/node/Fade/Fade.js +2 -2
  76. package/node/Grid2/Grid2.js +29 -11
  77. package/node/Grow/Grow.js +2 -2
  78. package/node/Icon/Icon.js +1 -1
  79. package/node/InputBase/InputBase.js +1 -1
  80. package/node/LinearProgress/LinearProgress.js +7 -0
  81. package/node/MenuList/MenuList.js +2 -1
  82. package/node/Modal/Modal.js +3 -3
  83. package/node/Modal/ModalManager.js +5 -5
  84. package/node/Modal/useModal.js +9 -5
  85. package/node/OutlinedInput/OutlinedInput.js +6 -6
  86. package/node/PigmentGrid/PigmentGrid.js +0 -23
  87. package/node/Portal/Portal.js +1 -1
  88. package/node/Rating/Rating.js +7 -2
  89. package/node/Select/Select.js +2 -2
  90. package/node/Select/SelectInput.js +1 -1
  91. package/node/Slide/Slide.js +2 -2
  92. package/node/Tooltip/Tooltip.js +2 -2
  93. package/node/Unstable_TrapFocus/FocusTrap.js +2 -2
  94. package/node/Zoom/Zoom.js +2 -2
  95. package/node/index.js +1 -1
  96. package/node/styles/createGetSelector.js +8 -7
  97. package/node/styles/createPalette.js +2 -16
  98. package/node/styles/createThemeNoVars.js +1 -2
  99. package/node/styles/createThemeWithVars.js +2 -0
  100. package/node/styles/index.js +1 -1
  101. package/node/styles/makeStyles.js +1 -3
  102. package/node/styles/responsiveFontSizes.js +1 -2
  103. package/node/styles/shouldSkipGeneratingVar.js +1 -1
  104. package/node/styles/withStyles.js +1 -3
  105. package/node/styles/withTheme.js +1 -3
  106. package/node/useAutocomplete/useAutocomplete.js +3 -1
  107. package/node/utils/memoTheme.js +4 -25
  108. package/node/version/index.js +2 -2
  109. package/package.json +6 -6
  110. package/styles/ThemeProvider.d.ts +6 -0
  111. package/styles/ThemeProviderWithVars.d.ts +2 -1
  112. package/styles/createGetSelector.d.ts +3 -8
  113. package/styles/createGetSelector.js +8 -7
  114. package/styles/createPalette.js +2 -16
  115. package/styles/createTheme.d.ts +1 -1
  116. package/styles/createThemeNoVars.d.ts +1 -0
  117. package/styles/createThemeNoVars.js +1 -2
  118. package/styles/createThemeWithVars.d.ts +8 -0
  119. package/styles/createThemeWithVars.js +2 -0
  120. package/styles/index.js +1 -1
  121. package/styles/makeStyles.js +1 -3
  122. package/styles/responsiveFontSizes.js +1 -2
  123. package/styles/shouldSkipGeneratingVar.js +1 -1
  124. package/styles/withStyles.js +1 -3
  125. package/styles/withTheme.js +1 -3
  126. package/useAutocomplete/useAutocomplete.js +3 -1
  127. package/utils/memoTheme.d.ts +4 -10
  128. package/utils/memoTheme.js +3 -24
  129. package/version/index.js +2 -2
@@ -40,10 +40,11 @@ export declare const CssVarsProvider: (props: React.PropsWithChildren<Partial<im
40
40
  colorSchemeSelector?: "media" | "class" | "data" | string;
41
41
  };
42
42
  } | undefined;
43
+ defaultMode?: "light" | "dark" | "system";
43
44
  documentNode?: Document | null;
44
45
  colorSchemeNode?: Element | null;
45
46
  storageWindow?: Window | null;
46
47
  disableNestedContext?: boolean;
47
48
  disableStyleSheetGeneration?: boolean;
48
- }>) => React.ReactElement<any>;
49
+ }>) => React.JSX.Element;
49
50
  export { useColorScheme, getInitColorSchemeScript, Experimental_CssVarsProvider };
@@ -1,21 +1,16 @@
1
1
  declare const _default: <T extends {
2
+ rootSelector?: string;
2
3
  colorSchemeSelector?: "media" | "class" | "data" | string;
3
4
  colorSchemes?: Record<string, any>;
4
5
  defaultColorScheme?: string;
5
6
  cssVarPrefix?: string;
6
7
  }>(theme: T) => (colorScheme: keyof T["colorSchemes"] | undefined, css: Record<string, any>) => string | {
7
- ':root': Record<string, any>;
8
+ [x: string]: Record<string, any>;
8
9
  "@media (prefers-color-scheme: dark)": {
9
- ':root': Record<string, any>;
10
+ [x: string]: Record<string, any>;
10
11
  };
11
12
  } | {
12
13
  [x: string]: Record<string, any>;
13
- ':root'?: undefined;
14
- "@media (prefers-color-scheme: dark)"?: undefined;
15
- } | {
16
- ':root': {
17
- [x: string]: any;
18
- };
19
14
  "@media (prefers-color-scheme: dark)"?: undefined;
20
15
  };
21
16
  export default _default;
@@ -1,5 +1,6 @@
1
1
  import excludeVariablesFromRoot from "./excludeVariablesFromRoot.js";
2
2
  export default theme => (colorScheme, css) => {
3
+ const root = theme.rootSelector || ':root';
3
4
  const selector = theme.colorSchemeSelector;
4
5
  let rule = selector;
5
6
  if (selector === 'class') {
@@ -21,33 +22,33 @@ export default theme => (colorScheme, css) => {
21
22
  });
22
23
  if (rule === 'media') {
23
24
  return {
24
- ':root': css,
25
+ [root]: css,
25
26
  [`@media (prefers-color-scheme: dark)`]: {
26
- ':root': excludedVariables
27
+ [root]: excludedVariables
27
28
  }
28
29
  };
29
30
  }
30
31
  if (rule) {
31
32
  return {
32
33
  [rule.replace('%s', colorScheme)]: excludedVariables,
33
- [`:root, ${rule.replace('%s', colorScheme)}`]: css
34
+ [`${root}, ${rule.replace('%s', colorScheme)}`]: css
34
35
  };
35
36
  }
36
37
  return {
37
- ':root': {
38
+ [root]: {
38
39
  ...css,
39
40
  ...excludedVariables
40
41
  }
41
42
  };
42
43
  }
43
44
  if (rule && rule !== 'media') {
44
- return `:root, ${rule.replace('%s', String(colorScheme))}`;
45
+ return `${root}, ${rule.replace('%s', String(colorScheme))}`;
45
46
  }
46
47
  } else if (colorScheme) {
47
48
  if (rule === 'media') {
48
49
  return {
49
50
  [`@media (prefers-color-scheme: ${String(colorScheme)})`]: {
50
- ':root': css
51
+ [root]: css
51
52
  }
52
53
  };
53
54
  }
@@ -55,5 +56,5 @@ export default theme => (colorScheme, css) => {
55
56
  return rule.replace('%s', String(colorScheme));
56
57
  }
57
58
  }
58
- return ':root';
59
+ return root;
59
60
  };
@@ -212,24 +212,10 @@ export default function createPalette(palette) {
212
212
  color.main = color[mainShade];
213
213
  }
214
214
  if (!color.hasOwnProperty('main')) {
215
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
216
- The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));
215
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));
217
216
  }
218
217
  if (typeof color.main !== 'string') {
219
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
220
- \`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.
221
-
222
- Did you intend to use one of the following approaches?
223
-
224
- import { green } from "@mui/material/colors";
225
-
226
- const theme1 = createTheme({ palette: {
227
- primary: green,
228
- } });
229
-
230
- const theme2 = createTheme({ palette: {
231
- primary: { main: green[500] },
232
- } });` : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
218
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.\n` + '\n' + 'Did you intend to use one of the following approaches?\n' + '\n' + 'import { green } from "@mui/material/colors";\n' + '\n' + 'const theme1 = createTheme({ palette: {\n' + ' primary: green,\n' + '} });\n' + '\n' + 'const theme2 = createTheme({ palette: {\n' + ' primary: { main: green[500] },\n' + '} });' : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
233
219
  }
234
220
  addLightOrDark(color, 'light', lightShade, tonalOffset);
235
221
  addLightOrDark(color, 'dark', darkShade, tonalOffset);
@@ -9,6 +9,6 @@ export type { ThemeOptions, Theme, CssThemeVariables } from './createThemeNoVars
9
9
  * @returns A complete, ready-to-use theme object.
10
10
  */
11
11
  export default function createTheme(options?: Omit<ThemeOptions, 'components'> & Pick<CssVarsThemeOptions, 'defaultColorScheme' | 'colorSchemes' | 'components'> & {
12
- cssVariables?: boolean | Pick<CssVarsThemeOptions, 'colorSchemeSelector' | 'disableCssColorScheme' | 'cssVarPrefix' | 'shouldSkipGeneratingVar'>;
12
+ cssVariables?: boolean | Pick<CssVarsThemeOptions, 'colorSchemeSelector' | 'rootSelector' | 'disableCssColorScheme' | 'cssVarPrefix' | 'shouldSkipGeneratingVar'>;
13
13
  }, // cast type to skip module augmentation test
14
14
  ...args: object[]): Theme;
@@ -63,6 +63,7 @@ type CssVarsProperties = CssThemeVariables extends { enabled: true }
63
63
  | 'applyStyles'
64
64
  | 'colorSchemes'
65
65
  | 'colorSchemeSelector'
66
+ | 'rootSelector'
66
67
  | 'cssVarPrefix'
67
68
  | 'defaultColorScheme'
68
69
  | 'getCssVar'
@@ -21,8 +21,7 @@ function createThemeNoVars(options = {}, ...args) {
21
21
  ...other
22
22
  } = options;
23
23
  if (options.vars) {
24
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`vars\` is a private field used for CSS variables support.
25
- Please use another name.` : _formatMuiErrorMessage(20));
24
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' + 'Please use another name.' : _formatMuiErrorMessage(20));
26
25
  }
27
26
  const palette = createPalette(paletteInput);
28
27
  const systemTheme = systemCreateTheme(options);
@@ -306,6 +306,13 @@ export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'com
306
306
  * Generate CSS variables within a data attribute [data-mode-light], [data-mode-dark]
307
307
  */
308
308
  colorSchemeSelector?: 'media' | 'class' | 'data' | string;
309
+ /**
310
+ * The selector to generate the global CSS variables (non-color-scheme related)
311
+ * @default ':root'
312
+ * @example ':host' // (for shadow DOM)
313
+ * @see https://mui.com/material-ui/customization/shadow-dom/#3-css-theme-variables-optional
314
+ */
315
+ rootSelector?: string;
309
316
  /**
310
317
  * If `true`, the CSS color-scheme will not be set.
311
318
  * https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
@@ -430,6 +437,7 @@ export type ThemeCssVar = OverridableStringUnion<
430
437
  */
431
438
  export interface CssVarsTheme extends ColorSystem {
432
439
  colorSchemes: Partial<Record<SupportedColorScheme, ColorSystem>>;
440
+ rootSelector: string;
433
441
  colorSchemeSelector: 'media' | 'class' | 'data' | string;
434
442
  cssVarPrefix: string;
435
443
  defaultColorScheme: SupportedColorScheme;
@@ -109,6 +109,7 @@ export default function createThemeWithVars(options = {}, ...args) {
109
109
  cssVarPrefix = 'mui',
110
110
  shouldSkipGeneratingVar = defaultShouldSkipGeneratingVar,
111
111
  colorSchemeSelector: selector = colorSchemesInput.light && colorSchemesInput.dark ? 'media' : undefined,
112
+ rootSelector = ':root',
112
113
  ...input
113
114
  } = options;
114
115
  const firstColorScheme = Object.keys(colorSchemesInput)[0];
@@ -146,6 +147,7 @@ export default function createThemeWithVars(options = {}, ...args) {
146
147
  ...muiTheme,
147
148
  cssVarPrefix,
148
149
  colorSchemeSelector: selector,
150
+ rootSelector,
149
151
  getCssVar,
150
152
  colorSchemes,
151
153
  font: {
package/styles/index.js CHANGED
@@ -6,7 +6,7 @@ export { unstable_createBreakpoints } from '@mui/system/createBreakpoints';
6
6
  // TODO: Remove this function in v6.
7
7
  // eslint-disable-next-line @typescript-eslint/naming-convention
8
8
  export function experimental_sx() {
9
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The \`experimental_sx\` has been moved to \`theme.unstable_sx\`.For more details, see https://github.com/mui/material-ui/pull/35150.` : _formatMuiErrorMessage(19));
9
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.' + 'For more details, see https://github.com/mui/material-ui/pull/35150.' : _formatMuiErrorMessage(19));
10
10
  }
11
11
  export { default as createTheme, createMuiTheme } from "./createTheme.js";
12
12
  export { default as unstable_createMuiStrictModeTheme } from "./createMuiStrictModeTheme.js";
@@ -1,6 +1,4 @@
1
1
  import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
2
2
  export default function makeStyles() {
3
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: makeStyles is no longer exported from @mui/material/styles.
4
- You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(14));
3
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: makeStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : _formatMuiErrorMessage(14));
6
4
  }
@@ -34,8 +34,7 @@ export default function responsiveFontSizes(themeInput, options = {}) {
34
34
  lineHeight
35
35
  } = style;
36
36
  if (!isUnitless(lineHeight) && !disableAlign) {
37
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: Unsupported non-unitless line height with grid alignment.
38
- Use unitless line heights instead.` : _formatMuiErrorMessage(6));
37
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: Unsupported non-unitless line height with grid alignment.\n' + 'Use unitless line heights instead.' : _formatMuiErrorMessage(6));
39
38
  }
40
39
  if (!isUnitless(lineHeight)) {
41
40
  // make it unitless
@@ -1,5 +1,5 @@
1
1
  export default function shouldSkipGeneratingVar(keys) {
2
- return !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
2
+ return !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
3
3
  // ends with sxConfig
4
4
  keys[0] === 'palette' && !!keys[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
5
5
  }
@@ -1,6 +1,4 @@
1
1
  import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
2
2
  export default function withStyles() {
3
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withStyles is no longer exported from @mui/material/styles.
4
- You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(15));
3
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : _formatMuiErrorMessage(15));
6
4
  }
@@ -1,6 +1,4 @@
1
1
  import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
2
2
  export default function withTheme() {
3
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withTheme is no longer exported from @mui/material/styles.
4
- You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(16));
3
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withTheme is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : _formatMuiErrorMessage(16));
6
4
  }
@@ -838,6 +838,7 @@ function useAutocomplete(props) {
838
838
  const handleInputMouseDown = event => {
839
839
  if (!disabledProp && (inputValue === '' || !open)) {
840
840
  handlePopupIndicator(event);
841
+ event.stopPropagation();
841
842
  }
842
843
  };
843
844
  let dirty = freeSolo && inputValue.length > 0;
@@ -914,7 +915,8 @@ function useAutocomplete(props) {
914
915
  getPopupIndicatorProps: () => ({
915
916
  tabIndex: -1,
916
917
  type: 'button',
917
- onClick: handlePopupIndicator
918
+ onClick: handlePopupIndicator,
919
+ onMouseDown: event => event.stopPropagation()
918
920
  }),
919
921
  getTagProps: ({
920
922
  index
@@ -1,13 +1,7 @@
1
- import { CSSInterpolation } from '@mui/system';
2
1
  import { Theme } from '../styles/createTheme';
3
- type ThemeStyleFunction = (props: {
2
+ declare const memoTheme: (styleFn: (props: {
4
3
  theme: Theme;
5
- }) => CSSInterpolation;
6
- /**
7
- * Memoize style function on theme.
8
- * Intended to be used in styled() calls that only need access to the theme.
9
- */
10
- export default function memoTheme(styleFn: ThemeStyleFunction): (props: {
4
+ }) => import("@mui/styled-engine").CSSInterpolation) => (props: {
11
5
  theme: Theme;
12
- }) => CSSInterpolation;
13
- export {};
6
+ }) => 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;
7
+ export default memoTheme;
@@ -1,24 +1,3 @@
1
- // We need to pass an argument as `{ theme }` for PigmentCSS, but we don't want to
2
- // allocate more objects.
3
- const arg = {
4
- theme: undefined
5
- };
6
-
7
- /**
8
- * Memoize style function on theme.
9
- * Intended to be used in styled() calls that only need access to the theme.
10
- */
11
- export default function memoTheme(styleFn) {
12
- let lastValue;
13
- let lastTheme;
14
- return props => {
15
- let value = lastValue;
16
- if (value === undefined || props.theme !== lastTheme) {
17
- arg.theme = props.theme;
18
- value = styleFn(arg);
19
- lastValue = value;
20
- lastTheme = props.theme;
21
- }
22
- return value;
23
- };
24
- }
1
+ import { unstable_memoTheme } from '@mui/system';
2
+ const memoTheme = unstable_memoTheme;
3
+ export default memoTheme;
package/version/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export const version = "6.1.1";
1
+ export const version = "6.1.3";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("1");
4
- export const patch = Number("1");
4
+ export const patch = Number("3");
5
5
  export const prerelease = undefined;
6
6
  export default version;