@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/Select/Select.d.ts
CHANGED
|
@@ -151,7 +151,8 @@ export interface BaseSelectProps<Value = unknown>
|
|
|
151
151
|
variant?: SelectVariants;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
export interface FilledSelectProps
|
|
154
|
+
export interface FilledSelectProps
|
|
155
|
+
extends Omit<FilledInputProps, 'value' | 'onChange' | 'id' | 'classes' | 'inputProps'> {
|
|
155
156
|
/**
|
|
156
157
|
* The variant to use.
|
|
157
158
|
* @default 'outlined'
|
|
@@ -159,7 +160,8 @@ export interface FilledSelectProps extends Omit<FilledInputProps, 'value' | 'onC
|
|
|
159
160
|
variant: 'filled';
|
|
160
161
|
}
|
|
161
162
|
|
|
162
|
-
export interface StandardSelectProps
|
|
163
|
+
export interface StandardSelectProps
|
|
164
|
+
extends Omit<InputProps, 'value' | 'onChange' | 'id' | 'classes' | 'inputProps'> {
|
|
163
165
|
/**
|
|
164
166
|
* The variant to use.
|
|
165
167
|
* @default 'outlined'
|
|
@@ -167,7 +169,8 @@ export interface StandardSelectProps extends Omit<InputProps, 'value' | 'onChang
|
|
|
167
169
|
variant: 'standard';
|
|
168
170
|
}
|
|
169
171
|
|
|
170
|
-
export interface OutlinedSelectProps
|
|
172
|
+
export interface OutlinedSelectProps
|
|
173
|
+
extends Omit<OutlinedInputProps, 'value' | 'onChange' | 'id' | 'classes' | 'inputProps'> {
|
|
171
174
|
/**
|
|
172
175
|
* The variant to use.
|
|
173
176
|
* @default 'outlined'
|
|
@@ -193,8 +196,8 @@ export type SelectProps<Value = unknown> =
|
|
|
193
196
|
* - [Select API](https://mui.com/material-ui/api/select/)
|
|
194
197
|
* - inherits [OutlinedInput API](https://mui.com/material-ui/api/outlined-input/)
|
|
195
198
|
*/
|
|
196
|
-
|
|
197
|
-
props: SelectProps<Value>,
|
|
198
|
-
): JSX.Element & {
|
|
199
|
+
declare const Select: (<Value = unknown>(props: SelectProps<Value>) => JSX.Element) & {
|
|
199
200
|
muiName: string;
|
|
200
201
|
};
|
|
202
|
+
|
|
203
|
+
export default Select;
|
package/Slider/Slider.js
CHANGED
|
@@ -279,27 +279,7 @@ export const SliderThumb = styled('span', {
|
|
|
279
279
|
boxShadow: 'none'
|
|
280
280
|
}
|
|
281
281
|
},
|
|
282
|
-
variants: [
|
|
283
|
-
props: {
|
|
284
|
-
color
|
|
285
|
-
},
|
|
286
|
-
style: {
|
|
287
|
-
[`&:hover, &.${sliderClasses.focusVisible}`]: _extends({}, theme.vars ? {
|
|
288
|
-
boxShadow: `0px 0px 0px 8px rgba(${theme.vars.palette[color].mainChannel} / 0.16)`
|
|
289
|
-
} : {
|
|
290
|
-
boxShadow: `0px 0px 0px 8px ${alpha(theme.palette[color].main, 0.16)}`
|
|
291
|
-
}, {
|
|
292
|
-
'@media (hover: none)': {
|
|
293
|
-
boxShadow: 'none'
|
|
294
|
-
}
|
|
295
|
-
}),
|
|
296
|
-
[`&.${sliderClasses.active}`]: _extends({}, theme.vars ? {
|
|
297
|
-
boxShadow: `0px 0px 0px 14px rgba(${theme.vars.palette[color].mainChannel} / 0.16)}`
|
|
298
|
-
} : {
|
|
299
|
-
boxShadow: `0px 0px 0px 14px ${alpha(theme.palette[color].main, 0.16)}`
|
|
300
|
-
})
|
|
301
|
-
}
|
|
302
|
-
})), {
|
|
282
|
+
variants: [{
|
|
303
283
|
props: {
|
|
304
284
|
size: 'small'
|
|
305
285
|
},
|
|
@@ -326,7 +306,27 @@ export const SliderThumb = styled('span', {
|
|
|
326
306
|
left: '50%',
|
|
327
307
|
transform: 'translate(-50%, 50%)'
|
|
328
308
|
}
|
|
329
|
-
}]
|
|
309
|
+
}, ...Object.keys((theme.vars ?? theme).palette).filter(key => (theme.vars ?? theme).palette[key].main).map(color => ({
|
|
310
|
+
props: {
|
|
311
|
+
color
|
|
312
|
+
},
|
|
313
|
+
style: {
|
|
314
|
+
[`&:hover, &.${sliderClasses.focusVisible}`]: _extends({}, theme.vars ? {
|
|
315
|
+
boxShadow: `0px 0px 0px 8px rgba(${theme.vars.palette[color].mainChannel} / 0.16)`
|
|
316
|
+
} : {
|
|
317
|
+
boxShadow: `0px 0px 0px 8px ${alpha(theme.palette[color].main, 0.16)}`
|
|
318
|
+
}, {
|
|
319
|
+
'@media (hover: none)': {
|
|
320
|
+
boxShadow: 'none'
|
|
321
|
+
}
|
|
322
|
+
}),
|
|
323
|
+
[`&.${sliderClasses.active}`]: _extends({}, theme.vars ? {
|
|
324
|
+
boxShadow: `0px 0px 0px 14px rgba(${theme.vars.palette[color].mainChannel} / 0.16)}`
|
|
325
|
+
} : {
|
|
326
|
+
boxShadow: `0px 0px 0px 14px ${alpha(theme.palette[color].main, 0.16)}`
|
|
327
|
+
})
|
|
328
|
+
}
|
|
329
|
+
}))]
|
|
330
330
|
}));
|
|
331
331
|
export const SliderValueLabel = styled(BaseSliderValueLabel, {
|
|
332
332
|
name: 'MuiSlider',
|
package/Table/Table.d.ts
CHANGED
package/Table/Table.js
CHANGED
|
@@ -119,8 +119,6 @@ process.env.NODE_ENV !== "production" ? Table.propTypes /* remove-proptypes */ =
|
|
|
119
119
|
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),
|
|
120
120
|
/**
|
|
121
121
|
* Set the header sticky.
|
|
122
|
-
*
|
|
123
|
-
* ⚠️ It doesn't work with IE11.
|
|
124
122
|
* @default false
|
|
125
123
|
*/
|
|
126
124
|
stickyHeader: PropTypes.bool,
|
package/index.js
CHANGED
package/legacy/AppBar/AppBar.js
CHANGED
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
8
|
import clsx from 'clsx';
|
|
8
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
|
-
import styled from '../
|
|
10
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
10
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
11
11
|
import capitalize from '../utils/capitalize';
|
|
12
12
|
import Paper from '../Paper';
|
|
13
13
|
import { getAppBarUtilityClass } from './appBarClasses';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
var useThemeProps = createUseThemeProps('MuiAppBar');
|
|
15
16
|
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
16
17
|
var color = ownerState.color,
|
|
17
18
|
position = ownerState.position,
|
|
@@ -35,73 +36,132 @@ var AppBarRoot = styled(Paper, {
|
|
|
35
36
|
return [styles.root, styles["position".concat(capitalize(ownerState.position))], styles["color".concat(capitalize(ownerState.color))]];
|
|
36
37
|
}
|
|
37
38
|
})(function (_ref) {
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return _extends({
|
|
39
|
+
var _theme$vars;
|
|
40
|
+
var theme = _ref.theme;
|
|
41
|
+
return {
|
|
42
42
|
display: 'flex',
|
|
43
43
|
flexDirection: 'column',
|
|
44
44
|
width: '100%',
|
|
45
45
|
boxSizing: 'border-box',
|
|
46
46
|
// Prevent padding issue with the Modal and fixed positioned AppBar.
|
|
47
|
-
flexShrink: 0
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
47
|
+
flexShrink: 0,
|
|
48
|
+
variants: [{
|
|
49
|
+
props: {
|
|
50
|
+
position: 'fixed'
|
|
51
|
+
},
|
|
52
|
+
style: {
|
|
53
|
+
position: 'fixed',
|
|
54
|
+
zIndex: (theme.vars || theme).zIndex.appBar,
|
|
55
|
+
top: 0,
|
|
56
|
+
left: 'auto',
|
|
57
|
+
right: 0,
|
|
58
|
+
'@media print': {
|
|
59
|
+
// Prevent the app bar to be visible on each printed page.
|
|
60
|
+
position: 'absolute'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
props: {
|
|
65
|
+
position: 'absolute'
|
|
66
|
+
},
|
|
67
|
+
style: {
|
|
68
|
+
position: 'absolute',
|
|
69
|
+
zIndex: (theme.vars || theme).zIndex.appBar,
|
|
70
|
+
top: 0,
|
|
71
|
+
left: 'auto',
|
|
72
|
+
right: 0
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
props: {
|
|
76
|
+
position: 'sticky'
|
|
77
|
+
},
|
|
78
|
+
style: {
|
|
79
|
+
// ⚠️ sticky is not supported by IE11.
|
|
80
|
+
position: 'sticky',
|
|
81
|
+
zIndex: (theme.vars || theme).zIndex.appBar,
|
|
82
|
+
top: 0,
|
|
83
|
+
left: 'auto',
|
|
84
|
+
right: 0
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
props: {
|
|
88
|
+
position: 'static'
|
|
89
|
+
},
|
|
90
|
+
style: {
|
|
91
|
+
position: 'static'
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
props: {
|
|
95
|
+
position: 'relative'
|
|
96
|
+
},
|
|
97
|
+
style: {
|
|
98
|
+
position: 'relative'
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
props: {
|
|
102
|
+
color: 'inherit'
|
|
103
|
+
},
|
|
104
|
+
style: {
|
|
105
|
+
'--AppBar-color': 'inherit'
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
props: {
|
|
109
|
+
color: 'default'
|
|
110
|
+
},
|
|
111
|
+
style: _extends({
|
|
112
|
+
'--AppBar-background': theme.vars ? theme.vars.palette.AppBar.defaultBg : theme.palette.grey[100],
|
|
113
|
+
'--AppBar-color': theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(theme.palette.grey[100])
|
|
114
|
+
}, theme.applyStyles('dark', {
|
|
115
|
+
'--AppBar-background': theme.vars ? theme.vars.palette.AppBar.defaultBg : theme.palette.grey[900],
|
|
116
|
+
'--AppBar-color': theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(theme.palette.grey[900])
|
|
117
|
+
}))
|
|
118
|
+
}].concat(_toConsumableArray(Object.keys(((_theme$vars = theme.vars) != null ? _theme$vars : theme).palette).filter(function (key) {
|
|
119
|
+
var _theme$vars2, _theme$vars3;
|
|
120
|
+
return ((_theme$vars2 = theme.vars) != null ? _theme$vars2 : theme).palette[key].main && ((_theme$vars3 = theme.vars) != null ? _theme$vars3 : theme).palette[key].contrastText;
|
|
121
|
+
}).map(function (color) {
|
|
122
|
+
var _theme$vars4, _theme$vars5;
|
|
123
|
+
return {
|
|
124
|
+
props: {
|
|
125
|
+
color: color
|
|
126
|
+
},
|
|
127
|
+
style: {
|
|
128
|
+
'--AppBar-background': ((_theme$vars4 = theme.vars) != null ? _theme$vars4 : theme).palette[color].main,
|
|
129
|
+
'--AppBar-color': ((_theme$vars5 = theme.vars) != null ? _theme$vars5 : theme).palette[color].contrastText
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
})), [{
|
|
133
|
+
props: {
|
|
134
|
+
enableColorOnDark: true
|
|
135
|
+
},
|
|
136
|
+
style: {
|
|
137
|
+
backgroundColor: 'var(--AppBar-background)',
|
|
138
|
+
color: 'var(--AppBar-color)'
|
|
139
|
+
}
|
|
140
|
+
}, {
|
|
141
|
+
props: {
|
|
142
|
+
enableColorOnDark: false
|
|
143
|
+
},
|
|
144
|
+
style: _extends({
|
|
145
|
+
backgroundColor: 'var(--AppBar-background)',
|
|
146
|
+
color: 'var(--AppBar-color)'
|
|
147
|
+
}, theme.applyStyles('dark', {
|
|
148
|
+
backgroundColor: theme.vars ? joinVars(theme.vars.palette.AppBar.darkBg, 'var(--AppBar-background)') : null,
|
|
149
|
+
color: theme.vars ? joinVars(theme.vars.palette.AppBar.darkColor, 'var(--AppBar-color)') : null
|
|
150
|
+
}))
|
|
151
|
+
}, {
|
|
152
|
+
props: {
|
|
153
|
+
color: 'transparent'
|
|
154
|
+
},
|
|
155
|
+
style: _extends({
|
|
156
|
+
'--AppBar-background': 'transparent',
|
|
157
|
+
'--AppBar-color': 'inherit',
|
|
158
|
+
backgroundColor: 'var(--AppBar-background)',
|
|
159
|
+
color: 'var(--AppBar-color)'
|
|
160
|
+
}, theme.applyStyles('dark', {
|
|
161
|
+
backgroundImage: 'none'
|
|
162
|
+
}))
|
|
163
|
+
}])
|
|
164
|
+
};
|
|
105
165
|
});
|
|
106
166
|
var AppBar = /*#__PURE__*/React.forwardRef(function AppBar(inProps, ref) {
|
|
107
167
|
var props = useThemeProps({
|
package/legacy/Badge/Badge.js
CHANGED
|
@@ -369,8 +369,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
|
|
|
369
369
|
/**
|
|
370
370
|
* The components used for each slot inside.
|
|
371
371
|
*
|
|
372
|
-
* This prop
|
|
373
|
-
* It's recommended to use the `slots` prop instead.
|
|
372
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
374
373
|
*
|
|
375
374
|
* @default {}
|
|
376
375
|
*/
|
|
@@ -382,8 +381,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
|
|
|
382
381
|
* The extra props for the slot components.
|
|
383
382
|
* You can override the existing props or add new ones.
|
|
384
383
|
*
|
|
385
|
-
* This prop
|
|
386
|
-
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
384
|
+
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
387
385
|
*
|
|
388
386
|
* @default {}
|
|
389
387
|
*/
|