@mui/material 6.0.0-alpha.0 → 6.0.0-alpha.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/AppBar/AppBar.js +118 -68
- package/Badge/Badge.d.ts +2 -4
- package/Badge/Badge.js +2 -4
- package/Button/Button.js +220 -131
- package/ButtonBase/ButtonBase.js +2 -2
- package/ButtonBase/Ripple.js +1 -1
- package/ButtonBase/TouchRipple.js +3 -4
- package/ButtonGroup/ButtonGroup.js +167 -70
- package/CHANGELOG.md +170 -4
- package/Grid/Grid.js +3 -0
- package/RadioGroup/RadioGroup.d.ts +0 -2
- package/RadioGroup/RadioGroup.js +23 -2
- package/RadioGroup/index.d.ts +3 -0
- package/RadioGroup/index.js +3 -1
- package/RadioGroup/radioGroupClasses.d.ts +6 -0
- package/RadioGroup/radioGroupClasses.js +7 -0
- package/Select/Select.d.ts +9 -6
- package/Slider/Slider.js +22 -22
- package/Table/Table.d.ts +0 -2
- package/Table/Table.js +0 -2
- package/index.js +1 -1
- package/legacy/AppBar/AppBar.js +124 -64
- package/legacy/Badge/Badge.js +2 -4
- package/legacy/Button/Button.js +218 -123
- package/legacy/ButtonBase/ButtonBase.js +2 -2
- package/legacy/ButtonBase/Ripple.js +1 -1
- package/legacy/ButtonBase/TouchRipple.js +3 -4
- package/legacy/ButtonGroup/ButtonGroup.js +163 -68
- package/legacy/Grid/Grid.js +3 -0
- package/legacy/RadioGroup/RadioGroup.js +21 -2
- package/legacy/RadioGroup/index.js +3 -1
- package/legacy/RadioGroup/radioGroupClasses.js +7 -0
- package/legacy/Slider/Slider.js +24 -24
- package/legacy/Table/Table.js +0 -2
- package/legacy/index.js +1 -1
- package/legacy/locale/index.js +1 -1
- package/legacy/styles/experimental_extendTheme.js +24 -2
- package/legacy/zero-styled/index.js +1 -0
- package/locale/index.js +1 -1
- package/modern/AppBar/AppBar.js +118 -68
- package/modern/Badge/Badge.js +2 -4
- package/modern/Button/Button.js +220 -131
- package/modern/ButtonBase/ButtonBase.js +2 -2
- package/modern/ButtonBase/Ripple.js +1 -1
- package/modern/ButtonBase/TouchRipple.js +3 -4
- package/modern/ButtonGroup/ButtonGroup.js +167 -70
- package/modern/Grid/Grid.js +3 -0
- package/modern/RadioGroup/RadioGroup.js +23 -2
- package/modern/RadioGroup/index.js +3 -1
- package/modern/RadioGroup/radioGroupClasses.js +7 -0
- package/modern/Slider/Slider.js +22 -22
- package/modern/Table/Table.js +0 -2
- package/modern/index.js +1 -1
- package/modern/locale/index.js +1 -1
- package/modern/styles/experimental_extendTheme.js +24 -2
- package/modern/zero-styled/index.js +1 -0
- package/node/AppBar/AppBar.js +125 -66
- package/node/Badge/Badge.js +2 -4
- package/node/Button/Button.js +224 -135
- package/node/ButtonBase/ButtonBase.js +4 -4
- package/node/ButtonBase/Ripple.js +1 -1
- package/node/ButtonBase/TouchRipple.js +9 -10
- package/node/ButtonGroup/ButtonGroup.js +169 -72
- package/node/Grid/Grid.js +3 -0
- package/node/RadioGroup/RadioGroup.js +23 -2
- package/node/RadioGroup/index.js +25 -1
- package/node/RadioGroup/radioGroupClasses.js +15 -0
- package/node/Slider/Slider.js +25 -25
- package/node/Table/Table.js +0 -2
- package/node/index.js +1 -1
- package/node/locale/index.js +1 -1
- package/node/styles/experimental_extendTheme.js +24 -2
- package/node/zero-styled/index.js +7 -0
- package/package.json +6 -6
- package/styles/components.d.ts +5 -0
- package/styles/experimental_extendTheme.d.ts +2 -0
- package/styles/experimental_extendTheme.js +24 -2
- package/styles/overrides.d.ts +2 -0
- package/umd/material-ui.development.js +888 -593
- package/umd/material-ui.production.min.js +4 -4
- package/zero-styled/index.d.ts +1 -0
- package/zero-styled/index.js +1 -0
package/node/AppBar/AppBar.js
CHANGED
|
@@ -12,8 +12,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
14
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
|
-
var
|
|
16
|
-
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
15
|
+
var _zeroStyled = require("../zero-styled");
|
|
17
16
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
18
17
|
var _Paper = _interopRequireDefault(require("../Paper"));
|
|
19
18
|
var _appBarClasses = require("./appBarClasses");
|
|
@@ -21,6 +20,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
21
20
|
const _excluded = ["className", "color", "enableColorOnDark", "position"];
|
|
22
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
23
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
|
+
const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiAppBar');
|
|
24
24
|
const useUtilityClasses = ownerState => {
|
|
25
25
|
const {
|
|
26
26
|
color,
|
|
@@ -36,7 +36,7 @@ const useUtilityClasses = ownerState => {
|
|
|
36
36
|
// var2 is the fallback.
|
|
37
37
|
// Ex. var1: 'var(--a)', var2: 'var(--b)'; return: 'var(--a, var(--b))'
|
|
38
38
|
const joinVars = (var1, var2) => var1 ? `${var1 == null ? void 0 : var1.replace(')', '')}, ${var2})` : var2;
|
|
39
|
-
const AppBarRoot = (0,
|
|
39
|
+
const AppBarRoot = (0, _zeroStyled.styled)(_Paper.default, {
|
|
40
40
|
name: 'MuiAppBar',
|
|
41
41
|
slot: 'Root',
|
|
42
42
|
overridesResolver: (props, styles) => {
|
|
@@ -46,77 +46,136 @@ const AppBarRoot = (0, _styled.default)(_Paper.default, {
|
|
|
46
46
|
return [styles.root, styles[`position${(0, _capitalize.default)(ownerState.position)}`], styles[`color${(0, _capitalize.default)(ownerState.color)}`]];
|
|
47
47
|
}
|
|
48
48
|
})(({
|
|
49
|
-
theme
|
|
50
|
-
ownerState
|
|
49
|
+
theme
|
|
51
50
|
}) => {
|
|
52
|
-
|
|
53
|
-
return
|
|
51
|
+
var _theme$vars;
|
|
52
|
+
return {
|
|
54
53
|
display: 'flex',
|
|
55
54
|
flexDirection: 'column',
|
|
56
55
|
width: '100%',
|
|
57
56
|
boxSizing: 'border-box',
|
|
58
57
|
// Prevent padding issue with the Modal and fixed positioned AppBar.
|
|
59
|
-
flexShrink: 0
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
58
|
+
flexShrink: 0,
|
|
59
|
+
variants: [{
|
|
60
|
+
props: {
|
|
61
|
+
position: 'fixed'
|
|
62
|
+
},
|
|
63
|
+
style: {
|
|
64
|
+
position: 'fixed',
|
|
65
|
+
zIndex: (theme.vars || theme).zIndex.appBar,
|
|
66
|
+
top: 0,
|
|
67
|
+
left: 'auto',
|
|
68
|
+
right: 0,
|
|
69
|
+
'@media print': {
|
|
70
|
+
// Prevent the app bar to be visible on each printed page.
|
|
71
|
+
position: 'absolute'
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
props: {
|
|
76
|
+
position: 'absolute'
|
|
77
|
+
},
|
|
78
|
+
style: {
|
|
79
|
+
position: 'absolute',
|
|
80
|
+
zIndex: (theme.vars || theme).zIndex.appBar,
|
|
81
|
+
top: 0,
|
|
82
|
+
left: 'auto',
|
|
83
|
+
right: 0
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
props: {
|
|
87
|
+
position: 'sticky'
|
|
88
|
+
},
|
|
89
|
+
style: {
|
|
90
|
+
// ⚠️ sticky is not supported by IE11.
|
|
91
|
+
position: 'sticky',
|
|
92
|
+
zIndex: (theme.vars || theme).zIndex.appBar,
|
|
93
|
+
top: 0,
|
|
94
|
+
left: 'auto',
|
|
95
|
+
right: 0
|
|
96
|
+
}
|
|
97
|
+
}, {
|
|
98
|
+
props: {
|
|
99
|
+
position: 'static'
|
|
100
|
+
},
|
|
101
|
+
style: {
|
|
102
|
+
position: 'static'
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
props: {
|
|
106
|
+
position: 'relative'
|
|
107
|
+
},
|
|
108
|
+
style: {
|
|
109
|
+
position: 'relative'
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
112
|
+
props: {
|
|
113
|
+
color: 'inherit'
|
|
114
|
+
},
|
|
115
|
+
style: {
|
|
116
|
+
'--AppBar-color': 'inherit'
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
props: {
|
|
120
|
+
color: 'default'
|
|
121
|
+
},
|
|
122
|
+
style: (0, _extends2.default)({
|
|
123
|
+
'--AppBar-background': theme.vars ? theme.vars.palette.AppBar.defaultBg : theme.palette.grey[100],
|
|
124
|
+
'--AppBar-color': theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(theme.palette.grey[100])
|
|
125
|
+
}, theme.applyStyles('dark', {
|
|
126
|
+
'--AppBar-background': theme.vars ? theme.vars.palette.AppBar.defaultBg : theme.palette.grey[900],
|
|
127
|
+
'--AppBar-color': theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(theme.palette.grey[900])
|
|
128
|
+
}))
|
|
129
|
+
}, ...Object.keys(((_theme$vars = theme.vars) != null ? _theme$vars : theme).palette).filter(key => {
|
|
130
|
+
var _theme$vars2, _theme$vars3;
|
|
131
|
+
return ((_theme$vars2 = theme.vars) != null ? _theme$vars2 : theme).palette[key].main && ((_theme$vars3 = theme.vars) != null ? _theme$vars3 : theme).palette[key].contrastText;
|
|
132
|
+
}).map(color => {
|
|
133
|
+
var _theme$vars4, _theme$vars5;
|
|
134
|
+
return {
|
|
135
|
+
props: {
|
|
136
|
+
color
|
|
137
|
+
},
|
|
138
|
+
style: {
|
|
139
|
+
'--AppBar-background': ((_theme$vars4 = theme.vars) != null ? _theme$vars4 : theme).palette[color].main,
|
|
140
|
+
'--AppBar-color': ((_theme$vars5 = theme.vars) != null ? _theme$vars5 : theme).palette[color].contrastText
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
}), {
|
|
144
|
+
props: {
|
|
145
|
+
enableColorOnDark: true
|
|
146
|
+
},
|
|
147
|
+
style: {
|
|
148
|
+
backgroundColor: 'var(--AppBar-background)',
|
|
149
|
+
color: 'var(--AppBar-color)'
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
props: {
|
|
153
|
+
enableColorOnDark: false
|
|
154
|
+
},
|
|
155
|
+
style: (0, _extends2.default)({
|
|
156
|
+
backgroundColor: 'var(--AppBar-background)',
|
|
157
|
+
color: 'var(--AppBar-color)'
|
|
158
|
+
}, theme.applyStyles('dark', {
|
|
159
|
+
backgroundColor: theme.vars ? joinVars(theme.vars.palette.AppBar.darkBg, 'var(--AppBar-background)') : null,
|
|
160
|
+
color: theme.vars ? joinVars(theme.vars.palette.AppBar.darkColor, 'var(--AppBar-color)') : null
|
|
161
|
+
}))
|
|
162
|
+
}, {
|
|
163
|
+
props: {
|
|
164
|
+
color: 'transparent'
|
|
165
|
+
},
|
|
166
|
+
style: (0, _extends2.default)({
|
|
167
|
+
'--AppBar-background': 'transparent',
|
|
168
|
+
'--AppBar-color': 'inherit',
|
|
169
|
+
backgroundColor: 'var(--AppBar-background)',
|
|
170
|
+
color: 'var(--AppBar-color)'
|
|
171
|
+
}, theme.applyStyles('dark', {
|
|
172
|
+
backgroundImage: 'none'
|
|
173
|
+
}))
|
|
174
|
+
}]
|
|
175
|
+
};
|
|
117
176
|
});
|
|
118
177
|
const AppBar = /*#__PURE__*/React.forwardRef(function AppBar(inProps, ref) {
|
|
119
|
-
const props = (
|
|
178
|
+
const props = useThemeProps({
|
|
120
179
|
props: inProps,
|
|
121
180
|
name: 'MuiAppBar'
|
|
122
181
|
});
|
package/node/Badge/Badge.js
CHANGED
|
@@ -366,8 +366,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
|
|
|
366
366
|
/**
|
|
367
367
|
* The components used for each slot inside.
|
|
368
368
|
*
|
|
369
|
-
* This prop
|
|
370
|
-
* It's recommended to use the `slots` prop instead.
|
|
369
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
371
370
|
*
|
|
372
371
|
* @default {}
|
|
373
372
|
*/
|
|
@@ -379,8 +378,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
|
|
|
379
378
|
* The extra props for the slot components.
|
|
380
379
|
* You can override the existing props or add new ones.
|
|
381
380
|
*
|
|
382
|
-
* This prop
|
|
383
|
-
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
381
|
+
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
384
382
|
*
|
|
385
383
|
* @default {}
|
|
386
384
|
*/
|