@mui/material 5.15.5 → 5.15.6

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.
@@ -38,7 +38,7 @@ const useUtilityClasses = ownerState => {
38
38
  variant
39
39
  } = ownerState;
40
40
  const slots = {
41
- root: ['root', `size${capitalize(size)}`, variant, shape, color !== 'standard' && `${variant}${capitalize(color)}`, disabled && 'disabled', selected && 'selected', {
41
+ root: ['root', `size${capitalize(size)}`, variant, shape, color !== 'standard' && `color${capitalize(color)}`, color !== 'standard' && `${variant}${capitalize(color)}`, disabled && 'disabled', selected && 'selected', {
42
42
  page: 'page',
43
43
  first: 'firstLast',
44
44
  last: 'firstLast',
@@ -9,15 +9,27 @@ export interface PaginationItemClasses {
9
9
  sizeLarge: string;
10
10
  /** Styles applied to the root element if `variant="text"`. */
11
11
  text: string;
12
- /** Styles applied to the root element if `variant="text"` and `color="primary"`. */
12
+ /** Styles applied to the root element if `variant="text"` and `color="primary"`.
13
+ * @deprecated Combine the [.MuiPaginationItem-text](/material-ui/api/pagination-item/#pagination-item-classes-text)
14
+ * and [.MuiPaginationItem-colorPrimary](/material-ui/api/pagination-item/#pagination-item-classes-colorPrimary) classes instead.
15
+ */
13
16
  textPrimary: string;
14
- /** Styles applied to the root element if `variant="text"` and `color="secondary"`. */
17
+ /** Styles applied to the root element if `variant="text"` and `color="secondary"`.
18
+ * @deprecated Combine the [.MuiPaginationItem-text](/material-ui/api/pagination-item/#pagination-item-classes-text)
19
+ * and [.MuiPaginationItem-colorSecondary](/material-ui/api/pagination-item/#pagination-item-classes-colorSecondary) classes instead.
20
+ */
15
21
  textSecondary: string;
16
22
  /** Styles applied to the root element if `variant="outlined"`. */
17
23
  outlined: string;
18
- /** Styles applied to the root element if `variant="outlined"` and `color="primary"`. */
24
+ /** Styles applied to the root element if `variant="outlined"` and `color="primary"`.
25
+ * @deprecated Combine the [.MuiPaginationItem-outlined](/material-ui/api/pagination-item/#pagination-item-classes-outlined)
26
+ * and [.MuiPaginationItem-colorPrimary](/material-ui/api/pagination-item/#pagination-item-classes-colorPrimary) classes instead.
27
+ */
19
28
  outlinedPrimary: string;
20
- /** Styles applied to the root element if `variant="outlined"` and `color="secondary"`. */
29
+ /** Styles applied to the root element if `variant="outlined"` and `color="secondary"`.
30
+ * @deprecated Combine the [.MuiPaginationItem-outlined](/material-ui/api/pagination-item/#pagination-item-classes-outlined)
31
+ * and [.MuiPaginationItem-colorSecondary](/material-ui/api/pagination-item/#pagination-item-classes-colorSecondary) classes instead.
32
+ */
21
33
  outlinedSecondary: string;
22
34
  /** Styles applied to the root element if `rounded="true"`. */
23
35
  rounded: string;
@@ -35,6 +47,10 @@ export interface PaginationItemClasses {
35
47
  selected: string;
36
48
  /** Styles applied to the icon to display. */
37
49
  icon: string;
50
+ /** Styles applied to the root element if `color="primary"`. */
51
+ colorPrimary: string;
52
+ /** Styles applied to the root element if `color="secondary"`. */
53
+ colorSecondary: string;
38
54
  }
39
55
  export type PaginationItemClassKey = keyof PaginationItemClasses;
40
56
  export declare function getPaginationItemUtilityClass(slot: string): string;
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
3
3
  export function getPaginationItemUtilityClass(slot) {
4
4
  return generateUtilityClass('MuiPaginationItem', slot);
5
5
  }
6
- const paginationItemClasses = generateUtilityClasses('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon']);
6
+ const paginationItemClasses = generateUtilityClasses('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon', 'colorPrimary', 'colorSecondary']);
7
7
  export default paginationItemClasses;
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  <!-- markdownlint-disable-next-line -->
2
2
  <p align="center">
3
- <a href="https://mui.com/material-ui/" rel="noopener" target="_blank"><img width="150" height="133" src="https://mui.com/static/logo.svg" alt="Material UI logo"></a>
3
+ <a href="https://mui.com/material-ui/" rel="noopener" target="_blank"><img width="150" height="133" src="https://mui.com/static/logo.svg" alt="Material UI logo"></a>
4
4
  </p>
5
5
 
6
- <h1 align="center">Material UI</h1>
6
+ <h1 align="center">Material UI</h1>
7
7
 
8
- Material UI is an open-source React component library that implements Google's [Material Design](https://m2.material.io/design/introduction/). It's comprehensive and can be used in production out of the box.
8
+ Material UI is an open-source React component library that implements Google's [Material Design](https://m2.material.io/design/introduction/). It's comprehensive and can be used in production out of the box.
9
9
 
10
10
  ## Installation
11
11
 
@@ -26,13 +26,13 @@ Use the "material-ui" tag on Stack Overflow to make it easier for the community
26
26
 
27
27
  ## Examples
28
28
 
29
- Our documentation features [a collection of example projects using Material UI](https://mui.com/material-ui/getting-started/example-projects/).
29
+ Our documentation features [a collection of example projects using Material UI](https://mui.com/material-ui/getting-started/example-projects/).
30
30
 
31
31
  ## Contributing
32
32
 
33
33
  Read the [contributing guide](/CONTRIBUTING.md) to learn about our development process, how to propose bug fixes and improvements, and how to build and test your changes.
34
34
 
35
- Contributing to Material UI is about more than just issues and pull requests!
35
+ Contributing to Material UI is about more than just issues and pull requests!
36
36
  There are many other ways to [support MUI](https://mui.com/material-ui/getting-started/faq/#mui-is-awesome-how-can-i-support-the-project) beyond contributing to the code base.
37
37
 
38
38
  ## Changelog
package/Rating/Rating.js CHANGED
@@ -75,6 +75,7 @@ const RatingRoot = styled('span', {
75
75
  color: '#faaf00',
76
76
  cursor: 'pointer',
77
77
  textAlign: 'left',
78
+ width: 'min-content',
78
79
  WebkitTapHighlightColor: 'transparent',
79
80
  [`&.${ratingClasses.disabled}`]: {
80
81
  opacity: (theme.vars || theme).palette.action.disabledOpacity,
@@ -114,7 +114,7 @@ export interface TablePaginationOwnProps extends TablePaginationBaseProps {
114
114
  * Use -1 for the value with a custom label to show all the rows.
115
115
  * @default [10, 25, 50, 100]
116
116
  */
117
- rowsPerPageOptions?: Array<number | { value: number; label: string }>;
117
+ rowsPerPageOptions?: ReadonlyArray<number | { value: number; label: string }>;
118
118
  /**
119
119
  * Props applied to the rows per page [`Select`](/material-ui/api/select/) element.
120
120
  *
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.15.5
2
+ * @mui/material v5.15.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -30,9 +30,8 @@ var AvatarRoot = styled('div', {
30
30
  return [styles.root, styles[ownerState.variant], ownerState.colorDefault && styles.colorDefault];
31
31
  }
32
32
  })(function (_ref) {
33
- var theme = _ref.theme,
34
- ownerState = _ref.ownerState;
35
- return _extends({
33
+ var theme = _ref.theme;
34
+ return {
36
35
  position: 'relative',
37
36
  display: 'flex',
38
37
  alignItems: 'center',
@@ -45,18 +44,36 @@ var AvatarRoot = styled('div', {
45
44
  lineHeight: 1,
46
45
  borderRadius: '50%',
47
46
  overflow: 'hidden',
48
- userSelect: 'none'
49
- }, ownerState.variant === 'rounded' && {
50
- borderRadius: (theme.vars || theme).shape.borderRadius
51
- }, ownerState.variant === 'square' && {
52
- borderRadius: 0
53
- }, ownerState.colorDefault && _extends({
54
- color: (theme.vars || theme).palette.background.default
55
- }, theme.vars ? {
56
- backgroundColor: theme.vars.palette.Avatar.defaultBg
57
- } : {
58
- backgroundColor: theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]
59
- }));
47
+ userSelect: 'none',
48
+ variants: [{
49
+ props: {
50
+ variant: 'rounded'
51
+ },
52
+ style: {
53
+ borderRadius: (theme.vars || theme).shape.borderRadius
54
+ }
55
+ }, {
56
+ props: {
57
+ variant: 'square'
58
+ },
59
+ style: {
60
+ borderRadius: 0
61
+ }
62
+ }, {
63
+ props: {
64
+ colorDefault: true
65
+ },
66
+ style: _extends({
67
+ color: (theme.vars || theme).palette.background.default
68
+ }, theme.vars ? {
69
+ backgroundColor: theme.vars.palette.Avatar.defaultBg
70
+ } : _extends({
71
+ backgroundColor: theme.palette.grey[400]
72
+ }, theme.applyDarkStyles({
73
+ backgroundColor: theme.palette.grey[600]
74
+ })))
75
+ }]
76
+ };
60
77
  });
61
78
  var AvatarImg = styled('img', {
62
79
  name: 'MuiAvatar',
@@ -34,7 +34,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
34
34
  type = ownerState.type,
35
35
  variant = ownerState.variant;
36
36
  var slots = {
37
- root: ['root', "size".concat(capitalize(size)), variant, shape, color !== 'standard' && "".concat(variant).concat(capitalize(color)), disabled && 'disabled', selected && 'selected', {
37
+ root: ['root', "size".concat(capitalize(size)), variant, shape, color !== 'standard' && "color".concat(capitalize(color)), color !== 'standard' && "".concat(variant).concat(capitalize(color)), disabled && 'disabled', selected && 'selected', {
38
38
  page: 'page',
39
39
  first: 'firstLast',
40
40
  last: 'firstLast',
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
3
3
  export function getPaginationItemUtilityClass(slot) {
4
4
  return generateUtilityClass('MuiPaginationItem', slot);
5
5
  }
6
- var paginationItemClasses = generateUtilityClasses('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon']);
6
+ var paginationItemClasses = generateUtilityClasses('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon', 'colorPrimary', 'colorSecondary']);
7
7
  export default paginationItemClasses;
@@ -69,6 +69,7 @@ var RatingRoot = styled('span', {
69
69
  color: '#faaf00',
70
70
  cursor: 'pointer',
71
71
  textAlign: 'left',
72
+ width: 'min-content',
72
73
  WebkitTapHighlightColor: 'transparent'
73
74
  }, "&.".concat(ratingClasses.disabled), {
74
75
  opacity: (theme.vars || theme).palette.action.disabledOpacity,
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.15.5
2
+ * @mui/material v5.15.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -37,7 +37,19 @@ function createTheme() {
37
37
  shadows: shadows.slice(),
38
38
  typography: createTypography(palette, typographyInput),
39
39
  transitions: createTransitions(transitionsInput),
40
- zIndex: _extends({}, zIndex)
40
+ zIndex: _extends({}, zIndex),
41
+ applyDarkStyles: function applyDarkStyles(css) {
42
+ if (this.vars) {
43
+ // If CssVarsProvider is used as a provider,
44
+ // returns ':where([data-mui-color-scheme="light|dark"]) &'
45
+ var selector = this.getColorSchemeSelector('dark').replace(/(\[[^\]]+\])/, ':where($1)');
46
+ return _defineProperty({}, selector, css);
47
+ }
48
+ if (this.palette.mode === 'dark') {
49
+ return css;
50
+ }
51
+ return {};
52
+ }
41
53
  });
42
54
  muiTheme = deepmerge(muiTheme, other);
43
55
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -35,9 +35,8 @@ const AvatarRoot = styled('div', {
35
35
  return [styles.root, styles[ownerState.variant], ownerState.colorDefault && styles.colorDefault];
36
36
  }
37
37
  })(({
38
- theme,
39
- ownerState
40
- }) => _extends({
38
+ theme
39
+ }) => ({
41
40
  position: 'relative',
42
41
  display: 'flex',
43
42
  alignItems: 'center',
@@ -50,18 +49,36 @@ const AvatarRoot = styled('div', {
50
49
  lineHeight: 1,
51
50
  borderRadius: '50%',
52
51
  overflow: 'hidden',
53
- userSelect: 'none'
54
- }, ownerState.variant === 'rounded' && {
55
- borderRadius: (theme.vars || theme).shape.borderRadius
56
- }, ownerState.variant === 'square' && {
57
- borderRadius: 0
58
- }, ownerState.colorDefault && _extends({
59
- color: (theme.vars || theme).palette.background.default
60
- }, theme.vars ? {
61
- backgroundColor: theme.vars.palette.Avatar.defaultBg
62
- } : {
63
- backgroundColor: theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]
64
- })));
52
+ userSelect: 'none',
53
+ variants: [{
54
+ props: {
55
+ variant: 'rounded'
56
+ },
57
+ style: {
58
+ borderRadius: (theme.vars || theme).shape.borderRadius
59
+ }
60
+ }, {
61
+ props: {
62
+ variant: 'square'
63
+ },
64
+ style: {
65
+ borderRadius: 0
66
+ }
67
+ }, {
68
+ props: {
69
+ colorDefault: true
70
+ },
71
+ style: _extends({
72
+ color: (theme.vars || theme).palette.background.default
73
+ }, theme.vars ? {
74
+ backgroundColor: theme.vars.palette.Avatar.defaultBg
75
+ } : _extends({
76
+ backgroundColor: theme.palette.grey[400]
77
+ }, theme.applyDarkStyles({
78
+ backgroundColor: theme.palette.grey[600]
79
+ })))
80
+ }]
81
+ }));
65
82
  const AvatarImg = styled('img', {
66
83
  name: 'MuiAvatar',
67
84
  slot: 'Img',
@@ -38,7 +38,7 @@ const useUtilityClasses = ownerState => {
38
38
  variant
39
39
  } = ownerState;
40
40
  const slots = {
41
- root: ['root', `size${capitalize(size)}`, variant, shape, color !== 'standard' && `${variant}${capitalize(color)}`, disabled && 'disabled', selected && 'selected', {
41
+ root: ['root', `size${capitalize(size)}`, variant, shape, color !== 'standard' && `color${capitalize(color)}`, color !== 'standard' && `${variant}${capitalize(color)}`, disabled && 'disabled', selected && 'selected', {
42
42
  page: 'page',
43
43
  first: 'firstLast',
44
44
  last: 'firstLast',
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
3
3
  export function getPaginationItemUtilityClass(slot) {
4
4
  return generateUtilityClass('MuiPaginationItem', slot);
5
5
  }
6
- const paginationItemClasses = generateUtilityClasses('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon']);
6
+ const paginationItemClasses = generateUtilityClasses('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon', 'colorPrimary', 'colorSecondary']);
7
7
  export default paginationItemClasses;
@@ -75,6 +75,7 @@ const RatingRoot = styled('span', {
75
75
  color: '#faaf00',
76
76
  cursor: 'pointer',
77
77
  textAlign: 'left',
78
+ width: 'min-content',
78
79
  WebkitTapHighlightColor: 'transparent',
79
80
  [`&.${ratingClasses.disabled}`]: {
80
81
  opacity: (theme.vars || theme).palette.action.disabledOpacity,
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.15.5
2
+ * @mui/material v5.15.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -32,7 +32,21 @@ Please use another name.` : _formatMuiErrorMessage(18));
32
32
  shadows: shadows.slice(),
33
33
  typography: createTypography(palette, typographyInput),
34
34
  transitions: createTransitions(transitionsInput),
35
- zIndex: _extends({}, zIndex)
35
+ zIndex: _extends({}, zIndex),
36
+ applyDarkStyles(css) {
37
+ if (this.vars) {
38
+ // If CssVarsProvider is used as a provider,
39
+ // returns ':where([data-mui-color-scheme="light|dark"]) &'
40
+ const selector = this.getColorSchemeSelector('dark').replace(/(\[[^\]]+\])/, ':where($1)');
41
+ return {
42
+ [selector]: css
43
+ };
44
+ }
45
+ if (this.palette.mode === 'dark') {
46
+ return css;
47
+ }
48
+ return {};
49
+ }
36
50
  });
37
51
  muiTheme = deepmerge(muiTheme, other);
38
52
  muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
@@ -43,9 +43,8 @@ const AvatarRoot = (0, _styled.default)('div', {
43
43
  return [styles.root, styles[ownerState.variant], ownerState.colorDefault && styles.colorDefault];
44
44
  }
45
45
  })(({
46
- theme,
47
- ownerState
48
- }) => (0, _extends2.default)({
46
+ theme
47
+ }) => ({
49
48
  position: 'relative',
50
49
  display: 'flex',
51
50
  alignItems: 'center',
@@ -58,18 +57,36 @@ const AvatarRoot = (0, _styled.default)('div', {
58
57
  lineHeight: 1,
59
58
  borderRadius: '50%',
60
59
  overflow: 'hidden',
61
- userSelect: 'none'
62
- }, ownerState.variant === 'rounded' && {
63
- borderRadius: (theme.vars || theme).shape.borderRadius
64
- }, ownerState.variant === 'square' && {
65
- borderRadius: 0
66
- }, ownerState.colorDefault && (0, _extends2.default)({
67
- color: (theme.vars || theme).palette.background.default
68
- }, theme.vars ? {
69
- backgroundColor: theme.vars.palette.Avatar.defaultBg
70
- } : {
71
- backgroundColor: theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]
72
- })));
60
+ userSelect: 'none',
61
+ variants: [{
62
+ props: {
63
+ variant: 'rounded'
64
+ },
65
+ style: {
66
+ borderRadius: (theme.vars || theme).shape.borderRadius
67
+ }
68
+ }, {
69
+ props: {
70
+ variant: 'square'
71
+ },
72
+ style: {
73
+ borderRadius: 0
74
+ }
75
+ }, {
76
+ props: {
77
+ colorDefault: true
78
+ },
79
+ style: (0, _extends2.default)({
80
+ color: (theme.vars || theme).palette.background.default
81
+ }, theme.vars ? {
82
+ backgroundColor: theme.vars.palette.Avatar.defaultBg
83
+ } : (0, _extends2.default)({
84
+ backgroundColor: theme.palette.grey[400]
85
+ }, theme.applyDarkStyles({
86
+ backgroundColor: theme.palette.grey[600]
87
+ })))
88
+ }]
89
+ }));
73
90
  const AvatarImg = (0, _styled.default)('img', {
74
91
  name: 'MuiAvatar',
75
92
  slot: 'Img',
@@ -45,7 +45,7 @@ const useUtilityClasses = ownerState => {
45
45
  variant
46
46
  } = ownerState;
47
47
  const slots = {
48
- root: ['root', `size${(0, _capitalize.default)(size)}`, variant, shape, color !== 'standard' && `${variant}${(0, _capitalize.default)(color)}`, disabled && 'disabled', selected && 'selected', {
48
+ root: ['root', `size${(0, _capitalize.default)(size)}`, variant, shape, color !== 'standard' && `color${(0, _capitalize.default)(color)}`, color !== 'standard' && `${variant}${(0, _capitalize.default)(color)}`, disabled && 'disabled', selected && 'selected', {
49
49
  page: 'page',
50
50
  first: 'firstLast',
51
51
  last: 'firstLast',
@@ -11,5 +11,5 @@ var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateU
11
11
  function getPaginationItemUtilityClass(slot) {
12
12
  return (0, _generateUtilityClass.default)('MuiPaginationItem', slot);
13
13
  }
14
- const paginationItemClasses = (0, _generateUtilityClasses.default)('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon']);
14
+ const paginationItemClasses = (0, _generateUtilityClasses.default)('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon', 'colorPrimary', 'colorSecondary']);
15
15
  var _default = exports.default = paginationItemClasses;
@@ -82,6 +82,7 @@ const RatingRoot = (0, _styled.default)('span', {
82
82
  color: '#faaf00',
83
83
  cursor: 'pointer',
84
84
  textAlign: 'left',
85
+ width: 'min-content',
85
86
  WebkitTapHighlightColor: 'transparent',
86
87
  [`&.${_ratingClasses.default.disabled}`]: {
87
88
  opacity: (theme.vars || theme).palette.action.disabledOpacity,
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.15.5
2
+ * @mui/material v5.15.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -40,7 +40,21 @@ Please use another name.` : (0, _formatMuiErrorMessage2.default)(18));
40
40
  shadows: _shadows.default.slice(),
41
41
  typography: (0, _createTypography.default)(palette, typographyInput),
42
42
  transitions: (0, _createTransitions.default)(transitionsInput),
43
- zIndex: (0, _extends2.default)({}, _zIndex.default)
43
+ zIndex: (0, _extends2.default)({}, _zIndex.default),
44
+ applyDarkStyles(css) {
45
+ if (this.vars) {
46
+ // If CssVarsProvider is used as a provider,
47
+ // returns ':where([data-mui-color-scheme="light|dark"]) &'
48
+ const selector = this.getColorSchemeSelector('dark').replace(/(\[[^\]]+\])/, ':where($1)');
49
+ return {
50
+ [selector]: css
51
+ };
52
+ }
53
+ if (this.palette.mode === 'dark') {
54
+ return css;
55
+ }
56
+ return {};
57
+ }
44
58
  });
45
59
  muiTheme = (0, _utils.deepmerge)(muiTheme, other);
46
60
  muiTheme = args.reduce((acc, argument) => (0, _utils.deepmerge)(acc, argument), muiTheme);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "5.15.5",
3
+ "version": "5.15.6",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
@@ -34,11 +34,11 @@
34
34
  "prop-types": "^15.8.1",
35
35
  "react-is": "^18.2.0",
36
36
  "react-transition-group": "^4.4.5",
37
- "@mui/base": "5.0.0-beta.32",
38
- "@mui/core-downloads-tracker": "^5.15.5",
39
- "@mui/system": "^5.15.5",
40
- "@mui/utils": "^5.15.5",
41
- "@mui/types": "^7.2.13"
37
+ "@mui/base": "5.0.0-beta.33",
38
+ "@mui/core-downloads-tracker": "^5.15.6",
39
+ "@mui/system": "^5.15.6",
40
+ "@mui/types": "^7.2.13",
41
+ "@mui/utils": "^5.15.6"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@emotion/react": "^11.5.0",
@@ -45,6 +45,7 @@ export interface Theme extends BaseTheme {
45
45
  components?: Components<BaseTheme>;
46
46
  unstable_sx: (props: SxProps<Theme>) => CSSObject;
47
47
  unstable_sxConfig: SxConfig;
48
+ applyDarkStyles: (css: CSSObject) => CSSObject;
48
49
  }
49
50
 
50
51
  /**
@@ -32,7 +32,21 @@ Please use another name.` : _formatMuiErrorMessage(18));
32
32
  shadows: shadows.slice(),
33
33
  typography: createTypography(palette, typographyInput),
34
34
  transitions: createTransitions(transitionsInput),
35
- zIndex: _extends({}, zIndex)
35
+ zIndex: _extends({}, zIndex),
36
+ applyDarkStyles(css) {
37
+ if (this.vars) {
38
+ // If CssVarsProvider is used as a provider,
39
+ // returns ':where([data-mui-color-scheme="light|dark"]) &'
40
+ const selector = this.getColorSchemeSelector('dark').replace(/(\[[^\]]+\])/, ':where($1)');
41
+ return {
42
+ [selector]: css
43
+ };
44
+ }
45
+ if (this.palette.mode === 'dark') {
46
+ return css;
47
+ }
48
+ return {};
49
+ }
36
50
  });
37
51
  muiTheme = deepmerge(muiTheme, other);
38
52
  muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);