@mui/material 5.8.7 → 5.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Autocomplete/Autocomplete.js +2 -2
- package/ButtonBase/TouchRipple.js +1 -1
- package/CHANGELOG.md +200 -4
- package/Dialog/Dialog.js +2 -1
- package/FormHelperText/FormHelperText.d.ts +7 -1
- package/FormHelperText/FormHelperText.js +3 -1
- package/ImageListItem/ImageListItem.js +4 -4
- package/Modal/Modal.d.ts +2 -1
- package/Modal/Modal.js +8 -7
- package/OverridableComponent.d.ts +4 -0
- package/Popper/Popper.d.ts +1 -6
- package/Popper/Popper.js +24 -0
- package/README.md +60 -26
- package/ScopedCssBaseline/ScopedCssBaseline.d.ts +6 -0
- package/ScopedCssBaseline/ScopedCssBaseline.js +6 -1
- package/Slider/Slider.js +3 -2
- package/Stack/Stack.js +13 -1
- package/Tabs/Tabs.d.ts +7 -1
- package/Tabs/Tabs.js +3 -1
- package/Unstable_Grid2/Grid2.d.ts +4 -0
- package/Unstable_Grid2/Grid2.js +34 -0
- package/Unstable_Grid2/Grid2Props.d.ts +15 -0
- package/Unstable_Grid2/Grid2Props.js +1 -0
- package/Unstable_Grid2/grid2Classes.d.ts +5 -0
- package/Unstable_Grid2/grid2Classes.js +14 -0
- package/Unstable_Grid2/index.d.ts +4 -0
- package/Unstable_Grid2/index.js +4 -0
- package/Unstable_Grid2/package.json +6 -0
- package/index.d.ts +3 -0
- package/index.js +3 -1
- package/legacy/Autocomplete/Autocomplete.js +2 -2
- package/legacy/ButtonBase/TouchRipple.js +1 -1
- package/legacy/Dialog/Dialog.js +2 -1
- package/legacy/FormHelperText/FormHelperText.js +3 -1
- package/legacy/ImageListItem/ImageListItem.js +4 -4
- package/legacy/Modal/Modal.js +15 -10
- package/legacy/Popper/Popper.js +24 -0
- package/legacy/ScopedCssBaseline/ScopedCssBaseline.js +6 -1
- package/legacy/Slider/Slider.js +3 -2
- package/legacy/Stack/Stack.js +13 -1
- package/legacy/Tabs/Tabs.js +3 -1
- package/legacy/Unstable_Grid2/Grid2.js +38 -0
- package/legacy/Unstable_Grid2/Grid2Props.js +1 -0
- package/legacy/Unstable_Grid2/grid2Classes.js +27 -0
- package/legacy/Unstable_Grid2/index.js +4 -0
- package/legacy/index.js +3 -1
- package/modern/Autocomplete/Autocomplete.js +2 -2
- package/modern/ButtonBase/TouchRipple.js +1 -1
- package/modern/Dialog/Dialog.js +2 -1
- package/modern/FormHelperText/FormHelperText.js +3 -1
- package/modern/ImageListItem/ImageListItem.js +4 -4
- package/modern/Modal/Modal.js +8 -7
- package/modern/Popper/Popper.js +24 -0
- package/modern/ScopedCssBaseline/ScopedCssBaseline.js +6 -1
- package/modern/Slider/Slider.js +3 -2
- package/modern/Stack/Stack.js +13 -1
- package/modern/Tabs/Tabs.js +3 -1
- package/modern/Unstable_Grid2/Grid2.js +34 -0
- package/modern/Unstable_Grid2/Grid2Props.js +1 -0
- package/modern/Unstable_Grid2/grid2Classes.js +14 -0
- package/modern/Unstable_Grid2/index.js +4 -0
- package/modern/index.js +3 -1
- package/node/Autocomplete/Autocomplete.js +2 -2
- package/node/ButtonBase/TouchRipple.js +1 -1
- package/node/Dialog/Dialog.js +2 -1
- package/node/FormHelperText/FormHelperText.js +3 -1
- package/node/ImageListItem/ImageListItem.js +4 -4
- package/node/Modal/Modal.js +11 -10
- package/node/Popper/Popper.js +24 -0
- package/node/ScopedCssBaseline/ScopedCssBaseline.js +6 -1
- package/node/Slider/Slider.js +3 -2
- package/node/Stack/Stack.js +13 -1
- package/node/Tabs/Tabs.js +3 -1
- package/node/Unstable_Grid2/Grid2.js +47 -0
- package/node/Unstable_Grid2/Grid2Props.js +5 -0
- package/node/Unstable_Grid2/grid2Classes.js +25 -0
- package/node/Unstable_Grid2/index.js +56 -0
- package/node/index.js +22 -1
- package/package.json +7 -7
- package/styles/components.d.ts +5 -0
- package/styles/createTheme.d.ts +1 -1
- package/styles/experimental_extendTheme.d.ts +84 -7
- package/styles/index.d.ts +11 -0
- package/styles/overrides.d.ts +3 -1
- package/styles/props.d.ts +2 -0
- package/themeCssVarsAugmentation/index.d.ts +4 -8
- package/umd/material-ui.development.js +885 -290
- package/umd/material-ui.production.min.js +20 -25
package/node/Slider/Slider.js
CHANGED
|
@@ -314,7 +314,6 @@ const SliderValueLabel = (0, _styled.default)(_SliderUnstyled.SliderValueLabelUn
|
|
|
314
314
|
transition: theme.transitions.create(['transform'], {
|
|
315
315
|
duration: theme.transitions.duration.shortest
|
|
316
316
|
}),
|
|
317
|
-
transformOrigin: 'bottom center',
|
|
318
317
|
transform: 'translateY(-100%) scale(0)',
|
|
319
318
|
position: 'absolute',
|
|
320
319
|
backgroundColor: (theme.vars || theme).palette.grey[600],
|
|
@@ -326,6 +325,7 @@ const SliderValueLabel = (0, _styled.default)(_SliderUnstyled.SliderValueLabelUn
|
|
|
326
325
|
padding: '0.25rem 0.75rem'
|
|
327
326
|
}, ownerState.orientation === 'horizontal' && {
|
|
328
327
|
top: '-10px',
|
|
328
|
+
transformOrigin: 'bottom center',
|
|
329
329
|
'&:before': {
|
|
330
330
|
position: 'absolute',
|
|
331
331
|
content: '""',
|
|
@@ -338,7 +338,8 @@ const SliderValueLabel = (0, _styled.default)(_SliderUnstyled.SliderValueLabelUn
|
|
|
338
338
|
}
|
|
339
339
|
}, ownerState.orientation === 'vertical' && {
|
|
340
340
|
right: '30px',
|
|
341
|
-
top: '
|
|
341
|
+
top: '24px',
|
|
342
|
+
transformOrigin: 'right center',
|
|
342
343
|
'&:before': {
|
|
343
344
|
position: 'absolute',
|
|
344
345
|
content: '""',
|
package/node/Stack/Stack.js
CHANGED
|
@@ -67,7 +67,8 @@ const style = ({
|
|
|
67
67
|
theme
|
|
68
68
|
}) => {
|
|
69
69
|
let styles = (0, _extends2.default)({
|
|
70
|
-
display: 'flex'
|
|
70
|
+
display: 'flex',
|
|
71
|
+
flexDirection: 'column'
|
|
71
72
|
}, (0, _system.handleBreakpoints)({
|
|
72
73
|
theme
|
|
73
74
|
}, (0, _system.unstable_resolveBreakpointValues)({
|
|
@@ -95,6 +96,17 @@ const style = ({
|
|
|
95
96
|
base
|
|
96
97
|
});
|
|
97
98
|
|
|
99
|
+
if (typeof directionValues === 'object') {
|
|
100
|
+
Object.keys(directionValues).forEach((breakpoint, index, breakpoints) => {
|
|
101
|
+
const directionValue = directionValues[breakpoint];
|
|
102
|
+
|
|
103
|
+
if (!directionValue) {
|
|
104
|
+
const previousDirectionValue = index > 0 ? directionValues[breakpoints[index - 1]] : 'column';
|
|
105
|
+
directionValues[breakpoint] = previousDirectionValue;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
98
110
|
const styleFromPropValue = (propValue, breakpoint) => {
|
|
99
111
|
return {
|
|
100
112
|
'& > :not(style) + :not(style)': {
|
package/node/Tabs/Tabs.js
CHANGED
|
@@ -802,7 +802,9 @@ process.env.NODE_ENV !== "production" ? Tabs.propTypes
|
|
|
802
802
|
* Determines the color of the indicator.
|
|
803
803
|
* @default 'primary'
|
|
804
804
|
*/
|
|
805
|
-
indicatorColor: _propTypes.default
|
|
805
|
+
indicatorColor: _propTypes.default
|
|
806
|
+
/* @typescript-to-proptypes-ignore */
|
|
807
|
+
.oneOfType([_propTypes.default.oneOf(['primary', 'secondary']), _propTypes.default.string]),
|
|
806
808
|
|
|
807
809
|
/**
|
|
808
810
|
* Callback fired when the value changes.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _Unstable_Grid = require("@mui/system/Unstable_Grid");
|
|
13
|
+
|
|
14
|
+
var _styles = require("../styles");
|
|
15
|
+
|
|
16
|
+
const Grid2 = (0, _Unstable_Grid.createGrid)({
|
|
17
|
+
createStyledComponent: (0, _styles.styled)('div', {
|
|
18
|
+
name: 'MuiGrid2',
|
|
19
|
+
overridesResolver: (props, styles) => styles.root
|
|
20
|
+
}),
|
|
21
|
+
componentName: 'MuiGrid2',
|
|
22
|
+
// eslint-disable-next-line material-ui/mui-name-matches-component-name
|
|
23
|
+
useThemeProps: inProps => (0, _styles.useThemeProps)({
|
|
24
|
+
props: inProps,
|
|
25
|
+
name: 'MuiGrid2'
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
process.env.NODE_ENV !== "production" ? Grid2.propTypes
|
|
29
|
+
/* remove-proptypes */
|
|
30
|
+
= {
|
|
31
|
+
// ----------------------------- Warning --------------------------------
|
|
32
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
33
|
+
// | To update them edit TypeScript types and run "yarn proptypes" |
|
|
34
|
+
// ----------------------------------------------------------------------
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The content of the component.
|
|
38
|
+
*/
|
|
39
|
+
children: _propTypes.default.node,
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @ignore
|
|
43
|
+
*/
|
|
44
|
+
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
45
|
+
} : void 0;
|
|
46
|
+
var _default = Grid2;
|
|
47
|
+
exports.default = _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
exports.getGrid2UtilityClass = getGrid2UtilityClass;
|
|
8
|
+
|
|
9
|
+
var _base = require("@mui/base");
|
|
10
|
+
|
|
11
|
+
function getGrid2UtilityClass(slot) {
|
|
12
|
+
return (0, _base.generateUtilityClass)('MuiGrid2', slot);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
16
|
+
const DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];
|
|
17
|
+
const WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];
|
|
18
|
+
const GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
19
|
+
const grid2Classes = (0, _base.generateUtilityClasses)('MuiGrid2', ['root', 'container', 'item', 'zeroMinWidth', // spacings
|
|
20
|
+
...SPACINGS.map(spacing => `spacing-xs-${spacing}`), // direction values
|
|
21
|
+
...DIRECTIONS.map(direction => `direction-xs-${direction}`), // wrap values
|
|
22
|
+
...WRAPS.map(wrap => `wrap-xs-${wrap}`), // grid sizes for all breakpoints
|
|
23
|
+
...GRID_SIZES.map(size => `grid-xs-${size}`), ...GRID_SIZES.map(size => `grid-sm-${size}`), ...GRID_SIZES.map(size => `grid-md-${size}`), ...GRID_SIZES.map(size => `grid-lg-${size}`), ...GRID_SIZES.map(size => `grid-xl-${size}`)]);
|
|
24
|
+
var _default = grid2Classes;
|
|
25
|
+
exports.default = _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
var _exportNames = {
|
|
9
|
+
grid2Classes: true
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "default", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return _Grid.default;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "grid2Classes", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return _grid2Classes.default;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
var _Grid = _interopRequireDefault(require("./Grid2"));
|
|
25
|
+
|
|
26
|
+
var _Grid2Props = require("./Grid2Props");
|
|
27
|
+
|
|
28
|
+
Object.keys(_Grid2Props).forEach(function (key) {
|
|
29
|
+
if (key === "default" || key === "__esModule") return;
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
31
|
+
if (key in exports && exports[key] === _Grid2Props[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _Grid2Props[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
var _grid2Classes = _interopRequireWildcard(require("./grid2Classes"));
|
|
41
|
+
|
|
42
|
+
Object.keys(_grid2Classes).forEach(function (key) {
|
|
43
|
+
if (key === "default" || key === "__esModule") return;
|
|
44
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
45
|
+
if (key in exports && exports[key] === _grid2Classes[key]) return;
|
|
46
|
+
Object.defineProperty(exports, key, {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () {
|
|
49
|
+
return _grid2Classes[key];
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
55
|
+
|
|
56
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.9.2
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -62,6 +62,7 @@ var _exportNames = {
|
|
|
62
62
|
FormHelperText: true,
|
|
63
63
|
FormLabel: true,
|
|
64
64
|
Grid: true,
|
|
65
|
+
Unstable_Grid2: true,
|
|
65
66
|
Grow: true,
|
|
66
67
|
Hidden: true,
|
|
67
68
|
Icon: true,
|
|
@@ -918,6 +919,12 @@ Object.defineProperty(exports, "Typography", {
|
|
|
918
919
|
return _Typography.default;
|
|
919
920
|
}
|
|
920
921
|
});
|
|
922
|
+
Object.defineProperty(exports, "Unstable_Grid2", {
|
|
923
|
+
enumerable: true,
|
|
924
|
+
get: function () {
|
|
925
|
+
return _Unstable_Grid.default;
|
|
926
|
+
}
|
|
927
|
+
});
|
|
921
928
|
Object.defineProperty(exports, "Zoom", {
|
|
922
929
|
enumerable: true,
|
|
923
930
|
get: function () {
|
|
@@ -1692,6 +1699,20 @@ Object.keys(_Grid).forEach(function (key) {
|
|
|
1692
1699
|
});
|
|
1693
1700
|
});
|
|
1694
1701
|
|
|
1702
|
+
var _Unstable_Grid = _interopRequireWildcard(require("./Unstable_Grid2"));
|
|
1703
|
+
|
|
1704
|
+
Object.keys(_Unstable_Grid).forEach(function (key) {
|
|
1705
|
+
if (key === "default" || key === "__esModule") return;
|
|
1706
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
1707
|
+
if (key in exports && exports[key] === _Unstable_Grid[key]) return;
|
|
1708
|
+
Object.defineProperty(exports, key, {
|
|
1709
|
+
enumerable: true,
|
|
1710
|
+
get: function () {
|
|
1711
|
+
return _Unstable_Grid[key];
|
|
1712
|
+
}
|
|
1713
|
+
});
|
|
1714
|
+
});
|
|
1715
|
+
|
|
1695
1716
|
var _Grow = _interopRequireWildcard(require("./Grow"));
|
|
1696
1717
|
|
|
1697
1718
|
Object.keys(_Grow).forEach(function (key) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.9.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "React components that implement Google's Material Design.",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@babel/runtime": "^7.17.2",
|
|
49
|
-
"@mui/base": "5.0.0-alpha.
|
|
50
|
-
"@mui/system": "^5.
|
|
51
|
-
"@mui/types": "^7.1.
|
|
52
|
-
"@mui/utils": "^5.
|
|
49
|
+
"@mui/base": "5.0.0-alpha.91",
|
|
50
|
+
"@mui/system": "^5.9.2",
|
|
51
|
+
"@mui/types": "^7.1.5",
|
|
52
|
+
"@mui/utils": "^5.9.1",
|
|
53
53
|
"@types/react-transition-group": "^4.4.5",
|
|
54
|
-
"clsx": "^1.2.
|
|
54
|
+
"clsx": "^1.2.1",
|
|
55
55
|
"csstype": "^3.1.0",
|
|
56
56
|
"prop-types": "^15.8.1",
|
|
57
|
-
"react-is": "^
|
|
57
|
+
"react-is": "^18.2.0",
|
|
58
58
|
"react-transition-group": "^4.4.2"
|
|
59
59
|
},
|
|
60
60
|
"sideEffects": false,
|
package/styles/components.d.ts
CHANGED
|
@@ -228,6 +228,11 @@ export interface Components<Theme = unknown> {
|
|
|
228
228
|
styleOverrides?: ComponentsOverrides<Theme>['MuiGrid'];
|
|
229
229
|
variants?: ComponentsVariants['MuiGrid'];
|
|
230
230
|
};
|
|
231
|
+
MuiGrid2?: {
|
|
232
|
+
defaultProps?: ComponentsProps['MuiGrid2'];
|
|
233
|
+
styleOverrides?: ComponentsOverrides<Theme>['MuiGrid2'];
|
|
234
|
+
variants?: ComponentsVariants['MuiGrid2'];
|
|
235
|
+
};
|
|
231
236
|
MuiImageList?: {
|
|
232
237
|
defaultProps?: ComponentsProps['MuiImageList'];
|
|
233
238
|
styleOverrides?: ComponentsOverrides<Theme>['MuiImageList'];
|
package/styles/createTheme.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Components } from './components';
|
|
|
9
9
|
|
|
10
10
|
export interface ThemeOptions extends Omit<SystemThemeOptions, 'zIndex'> {
|
|
11
11
|
mixins?: MixinsOptions;
|
|
12
|
-
components?: Components<
|
|
12
|
+
components?: Components<Omit<Theme, 'components'>>;
|
|
13
13
|
palette?: PaletteOptions;
|
|
14
14
|
shadows?: Shadows;
|
|
15
15
|
transitions?: TransitionsOptions;
|
|
@@ -231,6 +231,7 @@ export interface CssVarsPalette {
|
|
|
231
231
|
error: PaletteColorChannel;
|
|
232
232
|
info: PaletteColorChannel;
|
|
233
233
|
success: PaletteColorChannel;
|
|
234
|
+
warning: PaletteColorChannel;
|
|
234
235
|
text: PaletteTextChannel;
|
|
235
236
|
dividerChannel: string;
|
|
236
237
|
action: PaletteActionChannel;
|
|
@@ -274,7 +275,7 @@ export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'com
|
|
|
274
275
|
}
|
|
275
276
|
|
|
276
277
|
// should not include keys defined in `shouldSkipGeneratingVar` and have value typeof function
|
|
277
|
-
interface ThemeVars {
|
|
278
|
+
export interface ThemeVars {
|
|
278
279
|
palette: Omit<
|
|
279
280
|
ColorSystem['palette'],
|
|
280
281
|
| 'colorScheme'
|
|
@@ -287,13 +288,92 @@ interface ThemeVars {
|
|
|
287
288
|
opacity: Opacity;
|
|
288
289
|
overlays: Overlays;
|
|
289
290
|
shadows: Shadows;
|
|
290
|
-
zIndex: ZIndex;
|
|
291
291
|
shape: Theme['shape'];
|
|
292
|
+
zIndex: ZIndex;
|
|
292
293
|
}
|
|
293
294
|
|
|
294
|
-
|
|
295
|
+
type Split<T, K extends keyof T = keyof T> = K extends string | number
|
|
296
|
+
? { [k in K]: Exclude<T[K], undefined> }
|
|
297
|
+
: never;
|
|
298
|
+
|
|
299
|
+
type ConcatDeep<T> = T extends Record<string | number, infer V>
|
|
300
|
+
? keyof T extends string | number
|
|
301
|
+
? V extends string | number
|
|
302
|
+
? keyof T
|
|
303
|
+
: keyof V extends string | number
|
|
304
|
+
? `${keyof T}-${ConcatDeep<Split<V>>}`
|
|
305
|
+
: never
|
|
306
|
+
: never
|
|
307
|
+
: never;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Does not work for these cases:
|
|
311
|
+
* - { borderRadius: string | number } // the value can't be a union
|
|
312
|
+
* - { shadows: [string, string, ..., string] } // the value can't be an array
|
|
313
|
+
*/
|
|
314
|
+
type NormalizeVars<T> = ConcatDeep<Split<T>>;
|
|
315
|
+
|
|
316
|
+
// shut off automatic exporting for the Generics above
|
|
295
317
|
export {};
|
|
296
318
|
|
|
319
|
+
export interface ThemeCssVarOverrides {}
|
|
320
|
+
|
|
321
|
+
export type ThemeCssVar = OverridableStringUnion<
|
|
322
|
+
| NormalizeVars<Omit<ThemeVars, 'overlays' | 'shadows' | 'shape'>>
|
|
323
|
+
| 'shape-borderRadius'
|
|
324
|
+
| 'shadows-0'
|
|
325
|
+
| 'shadows-1'
|
|
326
|
+
| 'shadows-2'
|
|
327
|
+
| 'shadows-3'
|
|
328
|
+
| 'shadows-4'
|
|
329
|
+
| 'shadows-5'
|
|
330
|
+
| 'shadows-6'
|
|
331
|
+
| 'shadows-7'
|
|
332
|
+
| 'shadows-8'
|
|
333
|
+
| 'shadows-9'
|
|
334
|
+
| 'shadows-10'
|
|
335
|
+
| 'shadows-11'
|
|
336
|
+
| 'shadows-12'
|
|
337
|
+
| 'shadows-13'
|
|
338
|
+
| 'shadows-14'
|
|
339
|
+
| 'shadows-15'
|
|
340
|
+
| 'shadows-16'
|
|
341
|
+
| 'shadows-17'
|
|
342
|
+
| 'shadows-18'
|
|
343
|
+
| 'shadows-19'
|
|
344
|
+
| 'shadows-20'
|
|
345
|
+
| 'shadows-21'
|
|
346
|
+
| 'shadows-22'
|
|
347
|
+
| 'shadows-23'
|
|
348
|
+
| 'shadows-24'
|
|
349
|
+
| 'overlays-0'
|
|
350
|
+
| 'overlays-1'
|
|
351
|
+
| 'overlays-2'
|
|
352
|
+
| 'overlays-3'
|
|
353
|
+
| 'overlays-4'
|
|
354
|
+
| 'overlays-5'
|
|
355
|
+
| 'overlays-6'
|
|
356
|
+
| 'overlays-7'
|
|
357
|
+
| 'overlays-8'
|
|
358
|
+
| 'overlays-9'
|
|
359
|
+
| 'overlays-10'
|
|
360
|
+
| 'overlays-11'
|
|
361
|
+
| 'overlays-12'
|
|
362
|
+
| 'overlays-13'
|
|
363
|
+
| 'overlays-14'
|
|
364
|
+
| 'overlays-15'
|
|
365
|
+
| 'overlays-16'
|
|
366
|
+
| 'overlays-17'
|
|
367
|
+
| 'overlays-18'
|
|
368
|
+
| 'overlays-19'
|
|
369
|
+
| 'overlays-20'
|
|
370
|
+
| 'overlays-21'
|
|
371
|
+
| 'overlays-22'
|
|
372
|
+
| 'overlays-23'
|
|
373
|
+
| 'overlays-24',
|
|
374
|
+
ThemeCssVarOverrides
|
|
375
|
+
>;
|
|
376
|
+
|
|
297
377
|
/**
|
|
298
378
|
* Theme properties generated by extendTheme and CssVarsProvider
|
|
299
379
|
*/
|
|
@@ -301,10 +381,7 @@ export interface CssVarsTheme extends ColorSystem {
|
|
|
301
381
|
colorSchemes: Record<SupportedColorScheme, ColorSystem>;
|
|
302
382
|
cssVarPrefix: string;
|
|
303
383
|
vars: ThemeVars;
|
|
304
|
-
getCssVar:
|
|
305
|
-
field: string | CustomVar,
|
|
306
|
-
...vars: Array<string | CustomVar>
|
|
307
|
-
) => string;
|
|
384
|
+
getCssVar: (field: ThemeCssVar, ...vars: ThemeCssVar[]) => string;
|
|
308
385
|
getColorSchemeSelector: (colorScheme: SupportedColorScheme) => string;
|
|
309
386
|
}
|
|
310
387
|
|
package/styles/index.d.ts
CHANGED
|
@@ -6,7 +6,10 @@ export {
|
|
|
6
6
|
Theme,
|
|
7
7
|
} from './createTheme';
|
|
8
8
|
export { default as adaptV4Theme, DeprecatedThemeOptions } from './adaptV4Theme';
|
|
9
|
+
export { Shadows } from './shadows';
|
|
10
|
+
export { ZIndex } from './zIndex';
|
|
9
11
|
export {
|
|
12
|
+
CommonColors,
|
|
10
13
|
Palette,
|
|
11
14
|
PaletteColor,
|
|
12
15
|
PaletteColorOptions,
|
|
@@ -97,8 +100,11 @@ export { default as experimental_extendTheme } from './experimental_extendTheme'
|
|
|
97
100
|
export type {
|
|
98
101
|
ColorSchemeOverrides,
|
|
99
102
|
SupportedColorScheme,
|
|
103
|
+
ColorSystem,
|
|
104
|
+
CssVarsPalette,
|
|
100
105
|
Opacity,
|
|
101
106
|
Overlays,
|
|
107
|
+
PaletteAlert,
|
|
102
108
|
PaletteActionChannel,
|
|
103
109
|
PaletteAppBar,
|
|
104
110
|
PaletteAvatar,
|
|
@@ -107,8 +113,10 @@ export type {
|
|
|
107
113
|
PaletteCommonChannel,
|
|
108
114
|
PaletteFilledInput,
|
|
109
115
|
PaletteLinearProgress,
|
|
116
|
+
PaletteSkeleton,
|
|
110
117
|
PaletteSlider,
|
|
111
118
|
PaletteSnackbarContent,
|
|
119
|
+
PaletteSpeedDialAction,
|
|
112
120
|
PaletteStepConnector,
|
|
113
121
|
PaletteStepContent,
|
|
114
122
|
PaletteSwitch,
|
|
@@ -117,4 +125,7 @@ export type {
|
|
|
117
125
|
PaletteTooltip,
|
|
118
126
|
CssVarsThemeOptions,
|
|
119
127
|
CssVarsTheme,
|
|
128
|
+
ThemeVars,
|
|
129
|
+
ThemeCssVar,
|
|
130
|
+
ThemeCssVarOverrides,
|
|
120
131
|
} from './experimental_extendTheme';
|
package/styles/overrides.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ import { FormGroupClassKey } from '../FormGroup';
|
|
|
44
44
|
import { FormHelperTextClassKey } from '../FormHelperText';
|
|
45
45
|
import { FormLabelClassKey } from '../FormLabel';
|
|
46
46
|
import { GridClassKey } from '../Grid';
|
|
47
|
+
import { Grid2Slot } from '../Unstable_Grid2';
|
|
47
48
|
import { IconButtonClassKey } from '../IconButton';
|
|
48
49
|
import { IconClassKey } from '../Icon';
|
|
49
50
|
import { ImageListClassKey } from '../ImageList';
|
|
@@ -133,7 +134,7 @@ export type ComponentsOverrides<Theme = unknown> = {
|
|
|
133
134
|
OverridesStyleRules<ComponentNameToClassKey[Name], Name, Theme>
|
|
134
135
|
>;
|
|
135
136
|
} & {
|
|
136
|
-
MuiCssBaseline?: CSSObject | string;
|
|
137
|
+
MuiCssBaseline?: CSSObject | string | ((theme: Theme) => CSSInterpolation);
|
|
137
138
|
};
|
|
138
139
|
|
|
139
140
|
export interface ComponentNameToClassKey {
|
|
@@ -181,6 +182,7 @@ export interface ComponentNameToClassKey {
|
|
|
181
182
|
MuiFormHelperText: FormHelperTextClassKey;
|
|
182
183
|
MuiFormLabel: FormLabelClassKey;
|
|
183
184
|
MuiGrid: GridClassKey;
|
|
185
|
+
MuiGrid2: Grid2Slot;
|
|
184
186
|
MuiIcon: IconClassKey;
|
|
185
187
|
MuiIconButton: IconButtonClassKey;
|
|
186
188
|
MuiImageList: ImageListClassKey;
|
package/styles/props.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ import { FormGroupProps } from '../FormGroup';
|
|
|
43
43
|
import { FormHelperTextProps } from '../FormHelperText';
|
|
44
44
|
import { FormLabelProps } from '../FormLabel';
|
|
45
45
|
import { GridProps } from '../Grid';
|
|
46
|
+
import { Grid2Props } from '../Unstable_Grid2';
|
|
46
47
|
import { IconButtonProps } from '../IconButton';
|
|
47
48
|
import { IconProps } from '../Icon';
|
|
48
49
|
import { ImageListProps } from '../ImageList';
|
|
@@ -167,6 +168,7 @@ export interface ComponentsPropsList {
|
|
|
167
168
|
MuiFormHelperText: FormHelperTextProps;
|
|
168
169
|
MuiFormLabel: FormLabelProps;
|
|
169
170
|
MuiGrid: GridProps;
|
|
171
|
+
MuiGrid2: Grid2Props;
|
|
170
172
|
MuiImageList: ImageListProps;
|
|
171
173
|
MuiImageListItem: ImageListItemProps;
|
|
172
174
|
MuiImageListItemBar: ImageListItemBarProps;
|
|
@@ -15,16 +15,12 @@ declare module '@mui/material/styles' {
|
|
|
15
15
|
// The palette must be extended in each node.
|
|
16
16
|
interface Theme extends Omit<CssVarsTheme, 'palette'> {}
|
|
17
17
|
|
|
18
|
-
//
|
|
19
|
-
interface Palette extends CssVarsPalette {}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
declare module '@mui/material/styles/createPalette' {
|
|
18
|
+
// Extend the type that will be used in palette
|
|
23
19
|
interface CommonColors extends PaletteCommonChannel {}
|
|
24
|
-
|
|
25
20
|
interface PaletteColor extends PaletteColorChannel {}
|
|
26
|
-
|
|
27
21
|
interface TypeText extends PaletteTextChannel {}
|
|
28
|
-
|
|
29
22
|
interface TypeAction extends PaletteActionChannel {}
|
|
23
|
+
|
|
24
|
+
// The extended Palette should be in sync with `extendTheme`
|
|
25
|
+
interface Palette extends CssVarsPalette {}
|
|
30
26
|
}
|