@mui/system 6.0.0-beta.3 → 6.0.0-beta.4
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/CHANGELOG.md +41 -0
- package/{Unstable_Grid → Grid}/gridGenerator.d.ts +1 -1
- package/{Unstable_Grid → Grid}/package.json +1 -1
- package/{Unstable_Grid → Grid}/traverseBreakpoints.d.ts +1 -1
- package/Stack/createStack.d.ts +1 -1
- package/breakpoints/breakpoints.d.ts +1 -1
- package/createBreakpoints/index.d.ts +3 -0
- package/createBreakpoints/index.js +3 -0
- package/createBreakpoints/package.json +6 -0
- package/createTheme/createTheme.d.ts +6 -2
- package/createTheme/createTheme.js +1 -1
- package/createTheme/index.js +1 -1
- package/cssContainerQueries/cssContainerQueries.d.ts +1 -1
- package/cssVars/createCssVarsProvider.js +17 -6
- package/cssVars/prepareCssVars.js +3 -0
- package/index.d.ts +4 -4
- package/index.js +4 -4
- package/modern/createBreakpoints/index.js +3 -0
- package/modern/createTheme/createTheme.js +1 -1
- package/modern/createTheme/index.js +1 -1
- package/modern/cssVars/createCssVarsProvider.js +17 -6
- package/modern/cssVars/prepareCssVars.js +3 -0
- package/modern/index.js +4 -4
- package/node/createBreakpoints/index.js +13 -0
- package/node/createTheme/createTheme.js +1 -1
- package/node/createTheme/index.js +1 -1
- package/node/cssVars/createCssVarsProvider.js +17 -6
- package/node/cssVars/prepareCssVars.js +3 -0
- package/node/index.js +14 -14
- package/package.json +6 -6
- /package/{Unstable_Grid → Grid}/Grid.d.ts +0 -0
- /package/{Unstable_Grid → Grid}/Grid.js +0 -0
- /package/{Unstable_Grid → Grid}/GridProps.d.ts +0 -0
- /package/{Unstable_Grid → Grid}/GridProps.js +0 -0
- /package/{Unstable_Grid → Grid}/createGrid.d.ts +0 -0
- /package/{Unstable_Grid → Grid}/createGrid.js +0 -0
- /package/{Unstable_Grid → Grid}/gridClasses.d.ts +0 -0
- /package/{Unstable_Grid → Grid}/gridClasses.js +0 -0
- /package/{Unstable_Grid → Grid}/gridGenerator.js +0 -0
- /package/{Unstable_Grid → Grid}/index.d.ts +0 -0
- /package/{Unstable_Grid → Grid}/index.js +0 -0
- /package/{Unstable_Grid → Grid}/traverseBreakpoints.js +0 -0
- /package/{createTheme → createBreakpoints}/createBreakpoints.d.ts +0 -0
- /package/{createTheme → createBreakpoints}/createBreakpoints.js +0 -0
- /package/modern/{Unstable_Grid → Grid}/Grid.js +0 -0
- /package/modern/{Unstable_Grid → Grid}/GridProps.js +0 -0
- /package/modern/{Unstable_Grid → Grid}/createGrid.js +0 -0
- /package/modern/{Unstable_Grid → Grid}/gridClasses.js +0 -0
- /package/modern/{Unstable_Grid → Grid}/gridGenerator.js +0 -0
- /package/modern/{Unstable_Grid → Grid}/index.js +0 -0
- /package/modern/{Unstable_Grid → Grid}/traverseBreakpoints.js +0 -0
- /package/modern/{createTheme → createBreakpoints}/createBreakpoints.js +0 -0
- /package/node/{Unstable_Grid → Grid}/Grid.js +0 -0
- /package/node/{Unstable_Grid → Grid}/GridProps.js +0 -0
- /package/node/{Unstable_Grid → Grid}/createGrid.js +0 -0
- /package/node/{Unstable_Grid → Grid}/gridClasses.js +0 -0
- /package/node/{Unstable_Grid → Grid}/gridGenerator.js +0 -0
- /package/node/{Unstable_Grid → Grid}/index.js +0 -0
- /package/node/{Unstable_Grid → Grid}/traverseBreakpoints.js +0 -0
- /package/node/{createTheme → createBreakpoints}/createBreakpoints.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 6.0.0-beta.4
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v6.0.0-beta.3..next -->
|
|
6
|
+
|
|
7
|
+
_Jul 30, 2024_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 12 contributors who made this release possible.
|
|
10
|
+
|
|
11
|
+
### `@mui/material@6.0.0-beta.4`
|
|
12
|
+
|
|
13
|
+
- [Accordion] Render a heading wrapping `AccordionSummary` button per W3C Accordion Pattern standards (#42914) @ZeeshanTamboli
|
|
14
|
+
- [Divider] Enable borderStyle enhancement in divider with children (#42715) @anuujj
|
|
15
|
+
- [ImageListItemBar] Deprecate composed classes (#42905) @sai6855
|
|
16
|
+
- Attach selector for default color scheme (#43035) @siriwatknp
|
|
17
|
+
- Stabilize Grid v2 and deprecate Grid v1 (#43054) @DiegoAndai
|
|
18
|
+
|
|
19
|
+
### `@mui/system@6.0.0-beta.4`
|
|
20
|
+
|
|
21
|
+
- Make `createBreakpoints` independent for stringify theme (#43048) @siriwatknp
|
|
22
|
+
|
|
23
|
+
### `@mui/utils@6.0.0-beta.4`
|
|
24
|
+
|
|
25
|
+
- Fix issues reported by the React Compiler (#43051) @markliu2013
|
|
26
|
+
|
|
27
|
+
### Docs
|
|
28
|
+
|
|
29
|
+
- [material-ui] Replace deprecated `<ListItem button/>` with `ListItemButton` component in routing libraries list example (#43110) @aliharis99
|
|
30
|
+
- [material-ui][Card] Update CardMedia description (#43067) @shahzaibdev1
|
|
31
|
+
- [material-ui] Polish out data table demo (#43072) @zanivan
|
|
32
|
+
- [material-ui][Snackbar] Improve reason type in demos (#43077) @sai6855
|
|
33
|
+
- [pigment-css] Fix syntax in migrating-to-pigment-css guide (#43107) @KevinVandy
|
|
34
|
+
- Fix page description line break @oliviertassinari
|
|
35
|
+
|
|
36
|
+
### Core
|
|
37
|
+
|
|
38
|
+
- Fix event naming convention @oliviertassinari
|
|
39
|
+
- [docs-infra] Move ads to the `@mui/docs` package (#42944) @alexfauquette
|
|
40
|
+
- [website] Fine-tune button styles on the branding theme (#43082) @zanivan
|
|
41
|
+
|
|
42
|
+
All contributors of this release in alphabetical order: @alexfauquette, @aliharis99, @anuujj, @DiegoAndai, @KevinVandy, @markliu2013, @oliviertassinari, @sai6855, @shahzaibdev1, @siriwatknp, @zanivan, @ZeeshanTamboli
|
|
43
|
+
|
|
3
44
|
## 6.0.0-beta.3
|
|
4
45
|
|
|
5
46
|
<!-- generated comparing v6.0.0-beta.2..next -->
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Breakpoints } from '../
|
|
1
|
+
import { Breakpoints } from '../createBreakpoints/createBreakpoints';
|
|
2
2
|
import { Spacing } from '../createTheme/createSpacing';
|
|
3
3
|
import { ResponsiveStyleValue } from '../styleFunctionSx';
|
|
4
4
|
import { GridDirection, GridOwnerState } from './GridProps';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Breakpoints, Breakpoint } from '../
|
|
1
|
+
import { Breakpoints, Breakpoint } from '../createBreakpoints/createBreakpoints';
|
|
2
2
|
export declare const filterBreakpointKeys: (breakpointsKeys: Breakpoint[], responsiveKeys: string[]) => Breakpoint[];
|
|
3
3
|
interface Iterator<T> {
|
|
4
4
|
(appendStyle: (responsiveStyles: Record<string, any>, style: object) => void, value: T): void;
|
package/Stack/createStack.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { OverridableComponent } from '@mui/types';
|
|
3
3
|
import { StackTypeMap, StackOwnerState } from './StackProps';
|
|
4
|
-
import { Breakpoints } from '../
|
|
4
|
+
import { Breakpoints } from '../createBreakpoints/createBreakpoints';
|
|
5
5
|
import { Spacing } from '../createTheme/createSpacing';
|
|
6
6
|
interface StyleFunctionProps {
|
|
7
7
|
theme: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSObject } from '@mui/styled-engine';
|
|
2
|
-
import { Breakpoints } from '../
|
|
2
|
+
import { Breakpoints } from '../createBreakpoints/createBreakpoints';
|
|
3
3
|
import type { Breakpoint } from '../createTheme';
|
|
4
4
|
import { ResponsiveStyleValue } from '../styleFunctionSx';
|
|
5
5
|
import { StyleFunction } from '../Box';
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { CSSObject } from '@mui/styled-engine';
|
|
2
|
-
import { Breakpoints, BreakpointsOptions } from '
|
|
2
|
+
import { Breakpoints, BreakpointsOptions } from '../createBreakpoints/createBreakpoints';
|
|
3
3
|
import { Shape, ShapeOptions } from './shape';
|
|
4
4
|
import { Spacing, SpacingOptions } from './createSpacing';
|
|
5
5
|
import { SxConfig, SxProps } from '../styleFunctionSx';
|
|
6
6
|
import { ApplyStyles } from './applyStyles';
|
|
7
7
|
import { CssContainerQueries } from '../cssContainerQueries';
|
|
8
8
|
|
|
9
|
-
export {
|
|
9
|
+
export {
|
|
10
|
+
Breakpoint,
|
|
11
|
+
Breakpoints,
|
|
12
|
+
BreakpointOverrides,
|
|
13
|
+
} from '../createBreakpoints/createBreakpoints';
|
|
10
14
|
|
|
11
15
|
export type Direction = 'ltr' | 'rtl';
|
|
12
16
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import deepmerge from '@mui/utils/deepmerge';
|
|
2
|
-
import createBreakpoints from '
|
|
2
|
+
import createBreakpoints from '../createBreakpoints/createBreakpoints';
|
|
3
3
|
import cssContainerQueries from '../cssContainerQueries';
|
|
4
4
|
import shape from './shape';
|
|
5
5
|
import createSpacing from './createSpacing';
|
package/createTheme/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default } from './createTheme';
|
|
2
|
-
export { default as private_createBreakpoints } from '
|
|
2
|
+
export { default as private_createBreakpoints } from '../createBreakpoints/createBreakpoints';
|
|
3
3
|
export { default as unstable_applyStyles } from './applyStyles';
|
|
@@ -134,12 +134,23 @@ export default function createCssVarsProvider(options) {
|
|
|
134
134
|
const colorSchemeSelector = restThemeProp.colorSchemeSelector;
|
|
135
135
|
React.useEffect(() => {
|
|
136
136
|
if (colorScheme && colorSchemeNode && colorSchemeSelector && colorSchemeSelector !== 'media') {
|
|
137
|
-
const selector = colorSchemeSelector
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
const selector = colorSchemeSelector;
|
|
138
|
+
let rule = colorSchemeSelector;
|
|
139
|
+
if (selector === 'class') {
|
|
140
|
+
rule = `.%s`;
|
|
141
|
+
}
|
|
142
|
+
if (selector === 'data') {
|
|
143
|
+
rule = `[data-%s]`;
|
|
144
|
+
}
|
|
145
|
+
if (selector?.startsWith('data-') && !selector.includes('%s')) {
|
|
146
|
+
// 'data-mui-color-scheme' -> '[data-mui-color-scheme="%s"]'
|
|
147
|
+
rule = `[${selector}="%s"]`;
|
|
148
|
+
}
|
|
149
|
+
if (rule.startsWith('.')) {
|
|
150
|
+
colorSchemeNode.classList.remove(...allColorSchemes.map(scheme => rule.substring(1).replace('%s', scheme)));
|
|
151
|
+
colorSchemeNode.classList.add(rule.substring(1).replace('%s', colorScheme));
|
|
141
152
|
} else {
|
|
142
|
-
const matches =
|
|
153
|
+
const matches = rule.replace('%s', colorScheme).match(/\[([^\]]+)\]/);
|
|
143
154
|
if (matches) {
|
|
144
155
|
const [attr, value] = matches[1].split('=');
|
|
145
156
|
if (!value) {
|
|
@@ -151,7 +162,7 @@ export default function createCssVarsProvider(options) {
|
|
|
151
162
|
}
|
|
152
163
|
colorSchemeNode.setAttribute(attr, value ? value.replace(/"|'/g, '') : '');
|
|
153
164
|
} else {
|
|
154
|
-
colorSchemeNode.setAttribute(
|
|
165
|
+
colorSchemeNode.setAttribute(rule, colorScheme);
|
|
155
166
|
}
|
|
156
167
|
}
|
|
157
168
|
}
|
|
@@ -70,6 +70,9 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
70
70
|
return `@media (prefers-color-scheme: ${mode}) { :root`;
|
|
71
71
|
}
|
|
72
72
|
if (rule) {
|
|
73
|
+
if (theme.defaultColorScheme === colorScheme) {
|
|
74
|
+
return `:root, ${rule.replace('%s', String(colorScheme))}`;
|
|
75
|
+
}
|
|
73
76
|
return rule.replace('%s', String(colorScheme));
|
|
74
77
|
}
|
|
75
78
|
}
|
package/index.d.ts
CHANGED
|
@@ -77,8 +77,8 @@ export * from './styled';
|
|
|
77
77
|
export { default as createTheme } from './createTheme';
|
|
78
78
|
export * from './createTheme';
|
|
79
79
|
|
|
80
|
-
export { default as createBreakpoints } from './
|
|
81
|
-
export * from './
|
|
80
|
+
export { default as createBreakpoints } from './createBreakpoints/createBreakpoints';
|
|
81
|
+
export * from './createBreakpoints/createBreakpoints';
|
|
82
82
|
|
|
83
83
|
export { default as createSpacing } from './createTheme/createSpacing';
|
|
84
84
|
export { SpacingOptions, Spacing } from './createTheme/createSpacing';
|
|
@@ -117,8 +117,8 @@ export * from './Container/createContainer';
|
|
|
117
117
|
export { default as Container } from './Container';
|
|
118
118
|
export * from './Container';
|
|
119
119
|
|
|
120
|
-
export { default as
|
|
121
|
-
export * from './
|
|
120
|
+
export { default as Grid } from './Grid';
|
|
121
|
+
export * from './Grid';
|
|
122
122
|
|
|
123
123
|
export { default as Stack } from './Stack';
|
|
124
124
|
export * from './Stack';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/system v6.0.0-beta.
|
|
2
|
+
* @mui/system v6.0.0-beta.4
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -44,7 +44,7 @@ export { default as createStyled } from './createStyled';
|
|
|
44
44
|
export * from './createStyled';
|
|
45
45
|
export { default as styled } from './styled';
|
|
46
46
|
export { default as createTheme } from './createTheme';
|
|
47
|
-
export { default as createBreakpoints } from './
|
|
47
|
+
export { default as createBreakpoints } from './createBreakpoints/createBreakpoints';
|
|
48
48
|
export { default as createSpacing } from './createTheme/createSpacing';
|
|
49
49
|
export { default as shape } from './createTheme/shape';
|
|
50
50
|
export { default as useThemeProps, getThemeProps } from './useThemeProps';
|
|
@@ -67,7 +67,7 @@ export * from './RtlProvider';
|
|
|
67
67
|
export { default as createContainer } from './Container/createContainer';
|
|
68
68
|
export { default as Container } from './Container';
|
|
69
69
|
export * from './Container';
|
|
70
|
-
export { default as
|
|
71
|
-
export * from './
|
|
70
|
+
export { default as Grid } from './Grid/Grid';
|
|
71
|
+
export * from './Grid';
|
|
72
72
|
export { default as Stack } from './Stack/Stack';
|
|
73
73
|
export * from './Stack';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import deepmerge from '@mui/utils/deepmerge';
|
|
2
|
-
import createBreakpoints from '
|
|
2
|
+
import createBreakpoints from '../createBreakpoints/createBreakpoints';
|
|
3
3
|
import cssContainerQueries from '../cssContainerQueries';
|
|
4
4
|
import shape from './shape';
|
|
5
5
|
import createSpacing from './createSpacing';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default } from './createTheme';
|
|
2
|
-
export { default as private_createBreakpoints } from '
|
|
2
|
+
export { default as private_createBreakpoints } from '../createBreakpoints/createBreakpoints';
|
|
3
3
|
export { default as unstable_applyStyles } from './applyStyles';
|
|
@@ -134,12 +134,23 @@ export default function createCssVarsProvider(options) {
|
|
|
134
134
|
const colorSchemeSelector = restThemeProp.colorSchemeSelector;
|
|
135
135
|
React.useEffect(() => {
|
|
136
136
|
if (colorScheme && colorSchemeNode && colorSchemeSelector && colorSchemeSelector !== 'media') {
|
|
137
|
-
const selector = colorSchemeSelector
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
const selector = colorSchemeSelector;
|
|
138
|
+
let rule = colorSchemeSelector;
|
|
139
|
+
if (selector === 'class') {
|
|
140
|
+
rule = `.%s`;
|
|
141
|
+
}
|
|
142
|
+
if (selector === 'data') {
|
|
143
|
+
rule = `[data-%s]`;
|
|
144
|
+
}
|
|
145
|
+
if (selector?.startsWith('data-') && !selector.includes('%s')) {
|
|
146
|
+
// 'data-mui-color-scheme' -> '[data-mui-color-scheme="%s"]'
|
|
147
|
+
rule = `[${selector}="%s"]`;
|
|
148
|
+
}
|
|
149
|
+
if (rule.startsWith('.')) {
|
|
150
|
+
colorSchemeNode.classList.remove(...allColorSchemes.map(scheme => rule.substring(1).replace('%s', scheme)));
|
|
151
|
+
colorSchemeNode.classList.add(rule.substring(1).replace('%s', colorScheme));
|
|
141
152
|
} else {
|
|
142
|
-
const matches =
|
|
153
|
+
const matches = rule.replace('%s', colorScheme).match(/\[([^\]]+)\]/);
|
|
143
154
|
if (matches) {
|
|
144
155
|
const [attr, value] = matches[1].split('=');
|
|
145
156
|
if (!value) {
|
|
@@ -151,7 +162,7 @@ export default function createCssVarsProvider(options) {
|
|
|
151
162
|
}
|
|
152
163
|
colorSchemeNode.setAttribute(attr, value ? value.replace(/"|'/g, '') : '');
|
|
153
164
|
} else {
|
|
154
|
-
colorSchemeNode.setAttribute(
|
|
165
|
+
colorSchemeNode.setAttribute(rule, colorScheme);
|
|
155
166
|
}
|
|
156
167
|
}
|
|
157
168
|
}
|
|
@@ -70,6 +70,9 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
70
70
|
return `@media (prefers-color-scheme: ${mode}) { :root`;
|
|
71
71
|
}
|
|
72
72
|
if (rule) {
|
|
73
|
+
if (theme.defaultColorScheme === colorScheme) {
|
|
74
|
+
return `:root, ${rule.replace('%s', String(colorScheme))}`;
|
|
75
|
+
}
|
|
73
76
|
return rule.replace('%s', String(colorScheme));
|
|
74
77
|
}
|
|
75
78
|
}
|
package/modern/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/system v6.0.0-beta.
|
|
2
|
+
* @mui/system v6.0.0-beta.4
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -44,7 +44,7 @@ export { default as createStyled } from './createStyled';
|
|
|
44
44
|
export * from './createStyled';
|
|
45
45
|
export { default as styled } from './styled';
|
|
46
46
|
export { default as createTheme } from './createTheme';
|
|
47
|
-
export { default as createBreakpoints } from './
|
|
47
|
+
export { default as createBreakpoints } from './createBreakpoints/createBreakpoints';
|
|
48
48
|
export { default as createSpacing } from './createTheme/createSpacing';
|
|
49
49
|
export { default as shape } from './createTheme/shape';
|
|
50
50
|
export { default as useThemeProps, getThemeProps } from './useThemeProps';
|
|
@@ -67,7 +67,7 @@ export * from './RtlProvider';
|
|
|
67
67
|
export { default as createContainer } from './Container/createContainer';
|
|
68
68
|
export { default as Container } from './Container';
|
|
69
69
|
export * from './Container';
|
|
70
|
-
export { default as
|
|
71
|
-
export * from './
|
|
70
|
+
export { default as Grid } from './Grid/Grid';
|
|
71
|
+
export * from './Grid';
|
|
72
72
|
export { default as Stack } from './Stack/Stack';
|
|
73
73
|
export * from './Stack';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "unstable_createBreakpoints", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _createBreakpoints.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _createBreakpoints = _interopRequireDefault(require("./createBreakpoints"));
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _deepmerge = _interopRequireDefault(require("@mui/utils/deepmerge"));
|
|
9
|
-
var _createBreakpoints = _interopRequireDefault(require("
|
|
9
|
+
var _createBreakpoints = _interopRequireDefault(require("../createBreakpoints/createBreakpoints"));
|
|
10
10
|
var _cssContainerQueries = _interopRequireDefault(require("../cssContainerQueries"));
|
|
11
11
|
var _shape = _interopRequireDefault(require("./shape"));
|
|
12
12
|
var _createSpacing = _interopRequireDefault(require("./createSpacing"));
|
|
@@ -23,5 +23,5 @@ Object.defineProperty(exports, "unstable_applyStyles", {
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
var _createTheme = _interopRequireDefault(require("./createTheme"));
|
|
26
|
-
var _createBreakpoints = _interopRequireDefault(require("
|
|
26
|
+
var _createBreakpoints = _interopRequireDefault(require("../createBreakpoints/createBreakpoints"));
|
|
27
27
|
var _applyStyles = _interopRequireDefault(require("./applyStyles"));
|
|
@@ -145,12 +145,23 @@ function createCssVarsProvider(options) {
|
|
|
145
145
|
const colorSchemeSelector = restThemeProp.colorSchemeSelector;
|
|
146
146
|
React.useEffect(() => {
|
|
147
147
|
if (colorScheme && colorSchemeNode && colorSchemeSelector && colorSchemeSelector !== 'media') {
|
|
148
|
-
const selector = colorSchemeSelector
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
const selector = colorSchemeSelector;
|
|
149
|
+
let rule = colorSchemeSelector;
|
|
150
|
+
if (selector === 'class') {
|
|
151
|
+
rule = `.%s`;
|
|
152
|
+
}
|
|
153
|
+
if (selector === 'data') {
|
|
154
|
+
rule = `[data-%s]`;
|
|
155
|
+
}
|
|
156
|
+
if (selector != null && selector.startsWith('data-') && !selector.includes('%s')) {
|
|
157
|
+
// 'data-mui-color-scheme' -> '[data-mui-color-scheme="%s"]'
|
|
158
|
+
rule = `[${selector}="%s"]`;
|
|
159
|
+
}
|
|
160
|
+
if (rule.startsWith('.')) {
|
|
161
|
+
colorSchemeNode.classList.remove(...allColorSchemes.map(scheme => rule.substring(1).replace('%s', scheme)));
|
|
162
|
+
colorSchemeNode.classList.add(rule.substring(1).replace('%s', colorScheme));
|
|
152
163
|
} else {
|
|
153
|
-
const matches =
|
|
164
|
+
const matches = rule.replace('%s', colorScheme).match(/\[([^\]]+)\]/);
|
|
154
165
|
if (matches) {
|
|
155
166
|
const [attr, value] = matches[1].split('=');
|
|
156
167
|
if (!value) {
|
|
@@ -162,7 +173,7 @@ function createCssVarsProvider(options) {
|
|
|
162
173
|
}
|
|
163
174
|
colorSchemeNode.setAttribute(attr, value ? value.replace(/"|'/g, '') : '');
|
|
164
175
|
} else {
|
|
165
|
-
colorSchemeNode.setAttribute(
|
|
176
|
+
colorSchemeNode.setAttribute(rule, colorScheme);
|
|
166
177
|
}
|
|
167
178
|
}
|
|
168
179
|
}
|
|
@@ -78,6 +78,9 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
78
78
|
return `@media (prefers-color-scheme: ${mode}) { :root`;
|
|
79
79
|
}
|
|
80
80
|
if (rule) {
|
|
81
|
+
if (theme.defaultColorScheme === colorScheme) {
|
|
82
|
+
return `:root, ${rule.replace('%s', String(colorScheme))}`;
|
|
83
|
+
}
|
|
81
84
|
return rule.replace('%s', String(colorScheme));
|
|
82
85
|
}
|
|
83
86
|
}
|
package/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/system v6.0.0-beta.
|
|
2
|
+
* @mui/system v6.0.0-beta.4
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -64,7 +64,7 @@ var _exportNames = {
|
|
|
64
64
|
RtlProvider: true,
|
|
65
65
|
createContainer: true,
|
|
66
66
|
Container: true,
|
|
67
|
-
|
|
67
|
+
Grid: true,
|
|
68
68
|
Stack: true
|
|
69
69
|
};
|
|
70
70
|
Object.defineProperty(exports, "Box", {
|
|
@@ -85,6 +85,12 @@ Object.defineProperty(exports, "GlobalStyles", {
|
|
|
85
85
|
return _GlobalStyles.default;
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
|
+
Object.defineProperty(exports, "Grid", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function () {
|
|
91
|
+
return _Grid.default;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
88
94
|
Object.defineProperty(exports, "RtlProvider", {
|
|
89
95
|
enumerable: true,
|
|
90
96
|
get: function () {
|
|
@@ -109,12 +115,6 @@ Object.defineProperty(exports, "ThemeProvider", {
|
|
|
109
115
|
return _ThemeProvider.default;
|
|
110
116
|
}
|
|
111
117
|
});
|
|
112
|
-
Object.defineProperty(exports, "Unstable_Grid", {
|
|
113
|
-
enumerable: true,
|
|
114
|
-
get: function () {
|
|
115
|
-
return _Grid.default;
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
118
|
Object.defineProperty(exports, "borders", {
|
|
119
119
|
enumerable: true,
|
|
120
120
|
get: function () {
|
|
@@ -509,7 +509,7 @@ Object.keys(_createStyled).forEach(function (key) {
|
|
|
509
509
|
});
|
|
510
510
|
var _styled = _interopRequireDefault(require("./styled"));
|
|
511
511
|
var _createTheme = _interopRequireDefault(require("./createTheme"));
|
|
512
|
-
var _createBreakpoints = _interopRequireDefault(require("./
|
|
512
|
+
var _createBreakpoints = _interopRequireDefault(require("./createBreakpoints/createBreakpoints"));
|
|
513
513
|
var _createSpacing = _interopRequireDefault(require("./createTheme/createSpacing"));
|
|
514
514
|
var _shape = _interopRequireDefault(require("./createTheme/shape"));
|
|
515
515
|
var _useThemeProps = _interopRequireWildcard(require("./useThemeProps"));
|
|
@@ -560,16 +560,16 @@ Object.keys(_Container).forEach(function (key) {
|
|
|
560
560
|
}
|
|
561
561
|
});
|
|
562
562
|
});
|
|
563
|
-
var _Grid = _interopRequireDefault(require("./
|
|
564
|
-
var
|
|
565
|
-
Object.keys(
|
|
563
|
+
var _Grid = _interopRequireDefault(require("./Grid/Grid"));
|
|
564
|
+
var _Grid2 = require("./Grid");
|
|
565
|
+
Object.keys(_Grid2).forEach(function (key) {
|
|
566
566
|
if (key === "default" || key === "__esModule") return;
|
|
567
567
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
568
|
-
if (key in exports && exports[key] ===
|
|
568
|
+
if (key in exports && exports[key] === _Grid2[key]) return;
|
|
569
569
|
Object.defineProperty(exports, key, {
|
|
570
570
|
enumerable: true,
|
|
571
571
|
get: function () {
|
|
572
|
-
return
|
|
572
|
+
return _Grid2[key];
|
|
573
573
|
}
|
|
574
574
|
});
|
|
575
575
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/system",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "MUI System is a set of CSS utilities to help you build custom designs more efficiently. It makes it possible to rapidly lay out custom designs.",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"url": "https://opencollective.com/mui-org"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@babel/runtime": "^7.
|
|
29
|
+
"@babel/runtime": "^7.25.0",
|
|
30
30
|
"clsx": "^2.1.1",
|
|
31
31
|
"csstype": "^3.1.3",
|
|
32
32
|
"prop-types": "^15.8.1",
|
|
33
|
-
"@mui/private-theming": "6.0.0-beta.
|
|
34
|
-
"@mui/styled-engine": "6.0.0-beta.
|
|
35
|
-
"@mui/
|
|
36
|
-
"@mui/
|
|
33
|
+
"@mui/private-theming": "6.0.0-beta.4",
|
|
34
|
+
"@mui/styled-engine": "6.0.0-beta.4",
|
|
35
|
+
"@mui/utils": "6.0.0-beta.4",
|
|
36
|
+
"@mui/types": "^7.2.14"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@emotion/react": "^11.5.0",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|