@mui/material 5.3.0 → 5.4.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.d.ts +5 -0
- package/Autocomplete/Autocomplete.js +12 -4
- package/AvatarGroup/AvatarGroup.d.ts +10 -0
- package/AvatarGroup/AvatarGroup.js +19 -7
- package/Badge/Badge.js +3 -2
- package/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/Button/buttonClasses.d.ts +1 -1
- package/ButtonBase/ButtonBase.d.ts +5 -1
- package/ButtonBase/ButtonBase.js +15 -2
- package/ButtonBase/TouchRipple.js +1 -2
- package/CHANGELOG.md +300 -28
- package/Fab/Fab.d.ts +4 -1
- package/Fab/Fab.js +8 -20
- package/Fab/fabClasses.js +1 -1
- package/FormControlLabel/FormControlLabel.js +11 -3
- package/FormControlLabel/formControlLabelClasses.d.ts +2 -0
- package/FormControlLabel/formControlLabelClasses.js +1 -1
- package/FormGroup/FormGroup.js +14 -3
- package/FormGroup/formGroupClasses.d.ts +2 -0
- package/FormGroup/formGroupClasses.js +1 -1
- package/FormHelperText/FormHelperText.js +7 -9
- package/Grid/Grid.js +2 -4
- package/ImageList/ImageList.js +3 -1
- package/InputAdornment/InputAdornment.js +6 -9
- package/Modal/Modal.js +1 -1
- package/OutlinedInput/NotchedOutline.js +14 -16
- package/OutlinedInput/OutlinedInput.js +1 -1
- package/README.md +6 -6
- package/Radio/RadioButtonIcon.js +2 -6
- package/Rating/Rating.js +1 -1
- package/Select/Select.js +19 -7
- package/Select/SelectInput.js +12 -10
- package/Slider/Slider.js +3 -1
- package/Snackbar/Snackbar.js +4 -1
- package/SvgIcon/SvgIcon.js +9 -9
- package/SwipeableDrawer/SwipeArea.js +1 -3
- package/TextField/TextField.js +1 -1
- package/ToggleButton/ToggleButton.d.ts +15 -0
- package/ToggleButton/ToggleButton.js +8 -2
- package/index.d.ts +11 -3
- package/index.js +8 -3
- package/internal/SwitchBase.js +2 -6
- package/legacy/Autocomplete/Autocomplete.js +13 -4
- package/legacy/AvatarGroup/AvatarGroup.js +20 -7
- package/legacy/Badge/Badge.js +4 -2
- package/legacy/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/legacy/ButtonBase/ButtonBase.js +15 -2
- package/legacy/ButtonBase/TouchRipple.js +1 -2
- package/legacy/Fab/Fab.js +8 -20
- package/legacy/Fab/fabClasses.js +1 -1
- package/legacy/FormControlLabel/FormControlLabel.js +11 -3
- package/legacy/FormControlLabel/formControlLabelClasses.js +1 -1
- package/legacy/FormGroup/FormGroup.js +14 -3
- package/legacy/FormGroup/formGroupClasses.js +1 -1
- package/legacy/FormHelperText/FormHelperText.js +7 -9
- package/legacy/Grid/Grid.js +2 -4
- package/legacy/ImageList/ImageList.js +3 -1
- package/legacy/InputAdornment/InputAdornment.js +6 -9
- package/legacy/Modal/Modal.js +1 -1
- package/legacy/OutlinedInput/NotchedOutline.js +14 -16
- package/legacy/OutlinedInput/OutlinedInput.js +1 -1
- package/legacy/Radio/RadioButtonIcon.js +2 -6
- package/legacy/Rating/Rating.js +1 -1
- package/legacy/Select/Select.js +23 -7
- package/legacy/Select/SelectInput.js +12 -10
- package/legacy/Slider/Slider.js +3 -1
- package/legacy/Snackbar/Snackbar.js +4 -1
- package/legacy/SvgIcon/SvgIcon.js +9 -9
- package/legacy/SwipeableDrawer/SwipeArea.js +1 -3
- package/legacy/TextField/TextField.js +1 -1
- package/legacy/ToggleButton/ToggleButton.js +8 -2
- package/legacy/index.js +8 -3
- package/legacy/internal/SwitchBase.js +2 -6
- package/legacy/styles/makeStyles.js +1 -1
- package/legacy/styles/withStyles.js +1 -1
- package/legacy/styles/withTheme.js +1 -1
- package/legacy/useMediaQuery/useMediaQuery.js +87 -32
- package/modern/Autocomplete/Autocomplete.js +12 -4
- package/modern/AvatarGroup/AvatarGroup.js +17 -7
- package/modern/Badge/Badge.js +3 -2
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/modern/ButtonBase/ButtonBase.js +15 -2
- package/modern/ButtonBase/TouchRipple.js +1 -2
- package/modern/Fab/Fab.js +8 -20
- package/modern/Fab/fabClasses.js +1 -1
- package/modern/FormControlLabel/FormControlLabel.js +11 -3
- package/modern/FormControlLabel/formControlLabelClasses.js +1 -1
- package/modern/FormGroup/FormGroup.js +14 -3
- package/modern/FormGroup/formGroupClasses.js +1 -1
- package/modern/FormHelperText/FormHelperText.js +7 -9
- package/modern/Grid/Grid.js +2 -4
- package/modern/ImageList/ImageList.js +3 -1
- package/modern/InputAdornment/InputAdornment.js +6 -9
- package/modern/Modal/Modal.js +1 -1
- package/modern/OutlinedInput/NotchedOutline.js +14 -16
- package/modern/OutlinedInput/OutlinedInput.js +1 -1
- package/modern/Radio/RadioButtonIcon.js +2 -6
- package/modern/Rating/Rating.js +1 -1
- package/modern/Select/Select.js +19 -7
- package/modern/Select/SelectInput.js +12 -10
- package/modern/Slider/Slider.js +3 -1
- package/modern/Snackbar/Snackbar.js +4 -1
- package/modern/SvgIcon/SvgIcon.js +8 -8
- package/modern/SwipeableDrawer/SwipeArea.js +1 -3
- package/modern/TextField/TextField.js +1 -1
- package/modern/ToggleButton/ToggleButton.js +8 -2
- package/modern/index.js +8 -3
- package/modern/internal/SwitchBase.js +2 -6
- package/modern/styles/makeStyles.js +1 -1
- package/modern/styles/withStyles.js +1 -1
- package/modern/styles/withTheme.js +1 -1
- package/modern/useMediaQuery/useMediaQuery.js +69 -27
- package/node/Autocomplete/Autocomplete.js +12 -4
- package/node/AvatarGroup/AvatarGroup.js +19 -7
- package/node/Badge/Badge.js +3 -2
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/node/ButtonBase/ButtonBase.js +15 -2
- package/node/ButtonBase/TouchRipple.js +1 -2
- package/node/Fab/Fab.js +8 -20
- package/node/Fab/fabClasses.js +1 -1
- package/node/FormControlLabel/FormControlLabel.js +12 -3
- package/node/FormControlLabel/formControlLabelClasses.js +1 -1
- package/node/FormGroup/FormGroup.js +15 -3
- package/node/FormGroup/formGroupClasses.js +1 -1
- package/node/FormHelperText/FormHelperText.js +6 -9
- package/node/Grid/Grid.js +2 -4
- package/node/ImageList/ImageList.js +3 -1
- package/node/InputAdornment/InputAdornment.js +5 -9
- package/node/Modal/Modal.js +1 -1
- package/node/OutlinedInput/NotchedOutline.js +12 -16
- package/node/OutlinedInput/OutlinedInput.js +1 -1
- package/node/Radio/RadioButtonIcon.js +2 -6
- package/node/Rating/Rating.js +1 -1
- package/node/Select/Select.js +22 -9
- package/node/Select/SelectInput.js +11 -10
- package/node/Slider/Slider.js +3 -1
- package/node/Snackbar/Snackbar.js +4 -1
- package/node/SvgIcon/SvgIcon.js +9 -9
- package/node/SwipeableDrawer/SwipeArea.js +1 -3
- package/node/TextField/TextField.js +1 -1
- package/node/ToggleButton/ToggleButton.js +8 -2
- package/node/index.js +62 -16
- package/node/internal/SwitchBase.js +2 -6
- package/node/styles/makeStyles.js +1 -1
- package/node/styles/withStyles.js +1 -1
- package/node/styles/withTheme.js +1 -1
- package/node/useMediaQuery/useMediaQuery.js +69 -27
- package/package.json +8 -8
- package/styles/ThemeProvider.d.ts +1 -1
- package/styles/index.d.ts +3 -0
- package/styles/makeStyles.js +1 -1
- package/styles/withStyles.js +1 -1
- package/styles/withTheme.js +1 -1
- package/umd/material-ui.development.js +5056 -7204
- package/umd/material-ui.production.min.js +21 -21
- package/useMediaQuery/useMediaQuery.d.ts +4 -0
- package/useMediaQuery/useMediaQuery.js +69 -27
|
@@ -2,5 +2,5 @@ import { generateUtilityClasses, generateUtilityClass } from '@mui/base';
|
|
|
2
2
|
export function getFormControlLabelUtilityClasses(slot) {
|
|
3
3
|
return generateUtilityClass('MuiFormControlLabel', slot);
|
|
4
4
|
}
|
|
5
|
-
const formControlLabelClasses = generateUtilityClasses('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label']);
|
|
5
|
+
const formControlLabelClasses = generateUtilityClasses('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error']);
|
|
6
6
|
export default formControlLabelClasses;
|
package/FormGroup/FormGroup.js
CHANGED
|
@@ -8,15 +8,18 @@ import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
|
8
8
|
import styled from '../styles/styled';
|
|
9
9
|
import useThemeProps from '../styles/useThemeProps';
|
|
10
10
|
import { getFormGroupUtilityClass } from './formGroupClasses';
|
|
11
|
+
import useFormControl from '../FormControl/useFormControl';
|
|
12
|
+
import formControlState from '../FormControl/formControlState';
|
|
11
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
14
|
|
|
13
15
|
const useUtilityClasses = ownerState => {
|
|
14
16
|
const {
|
|
15
17
|
classes,
|
|
16
|
-
row
|
|
18
|
+
row,
|
|
19
|
+
error
|
|
17
20
|
} = ownerState;
|
|
18
21
|
const slots = {
|
|
19
|
-
root: ['root', row && 'row']
|
|
22
|
+
root: ['root', row && 'row', error && 'error']
|
|
20
23
|
};
|
|
21
24
|
return composeClasses(slots, getFormGroupUtilityClass, classes);
|
|
22
25
|
};
|
|
@@ -57,8 +60,16 @@ const FormGroup = /*#__PURE__*/React.forwardRef(function FormGroup(inProps, ref)
|
|
|
57
60
|
} = props,
|
|
58
61
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
59
62
|
|
|
63
|
+
const muiFormControl = useFormControl();
|
|
64
|
+
const fcs = formControlState({
|
|
65
|
+
props,
|
|
66
|
+
muiFormControl,
|
|
67
|
+
states: ['error']
|
|
68
|
+
});
|
|
69
|
+
|
|
60
70
|
const ownerState = _extends({}, props, {
|
|
61
|
-
row
|
|
71
|
+
row,
|
|
72
|
+
error: fcs.error
|
|
62
73
|
});
|
|
63
74
|
|
|
64
75
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -3,6 +3,8 @@ export interface FormGroupClasses {
|
|
|
3
3
|
root: string;
|
|
4
4
|
/** Styles applied to the root element if `row={true}`. */
|
|
5
5
|
row: string;
|
|
6
|
+
/** State class applied to the root element if `error={true}`. */
|
|
7
|
+
error: string;
|
|
6
8
|
}
|
|
7
9
|
export declare type FormGroupClassKey = keyof FormGroupClasses;
|
|
8
10
|
export declare function getFormGroupUtilityClass(slot: string): string;
|
|
@@ -2,5 +2,5 @@ import { generateUtilityClass, generateUtilityClasses } from '@mui/base';
|
|
|
2
2
|
export function getFormGroupUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiFormGroup', slot);
|
|
4
4
|
}
|
|
5
|
-
const formGroupClasses = generateUtilityClasses('MuiFormGroup', ['root', 'row']);
|
|
5
|
+
const formGroupClasses = generateUtilityClasses('MuiFormGroup', ['root', 'row', 'error']);
|
|
6
6
|
export default formGroupClasses;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
|
|
4
|
+
var _span;
|
|
5
|
+
|
|
3
6
|
const _excluded = ["children", "className", "component", "disabled", "error", "filled", "focused", "margin", "required", "variant"];
|
|
4
7
|
import * as React from 'react';
|
|
5
8
|
import PropTypes from 'prop-types';
|
|
@@ -101,16 +104,11 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
|
|
|
101
104
|
className: clsx(classes.root, className),
|
|
102
105
|
ref: ref
|
|
103
106
|
}, other, {
|
|
104
|
-
children: children === ' ' ?
|
|
105
|
-
/*#__PURE__*/
|
|
106
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
107
|
-
// eslint-disable-next-line react/no-danger
|
|
108
|
-
_jsx("span", {
|
|
107
|
+
children: children === ' ' ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
108
|
+
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
109
109
|
className: "notranslate",
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
}) : children
|
|
110
|
+
children: "\u200B"
|
|
111
|
+
})) : children
|
|
114
112
|
}));
|
|
115
113
|
});
|
|
116
114
|
process.env.NODE_ENV !== "production" ? FormHelperText.propTypes
|
package/Grid/Grid.js
CHANGED
|
@@ -260,10 +260,8 @@ const GridRoot = styled('div', {
|
|
|
260
260
|
|
|
261
261
|
}, ownerState.zeroMinWidth && {
|
|
262
262
|
minWidth: 0
|
|
263
|
-
}, ownerState.wrap
|
|
264
|
-
flexWrap:
|
|
265
|
-
}, ownerState.wrap === 'reverse' && {
|
|
266
|
-
flexWrap: 'wrap-reverse'
|
|
263
|
+
}, ownerState.wrap !== 'wrap' && {
|
|
264
|
+
flexWrap: ownerState.wrap
|
|
267
265
|
}), generateDirection, generateRowGap, generateColumnGap, generateGrid);
|
|
268
266
|
|
|
269
267
|
const useUtilityClasses = ownerState => {
|
package/ImageList/ImageList.js
CHANGED
|
@@ -169,6 +169,8 @@ process.env.NODE_ENV !== "production" ? ImageList.propTypes
|
|
|
169
169
|
* The variant to use.
|
|
170
170
|
* @default 'standard'
|
|
171
171
|
*/
|
|
172
|
-
variant: PropTypes
|
|
172
|
+
variant: PropTypes
|
|
173
|
+
/* @typescript-to-proptypes-ignore */
|
|
174
|
+
.oneOfType([PropTypes.oneOf(['masonry', 'quilted', 'standard', 'woven']), PropTypes.string])
|
|
173
175
|
} : void 0;
|
|
174
176
|
export default ImageList;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
|
|
4
|
+
var _span;
|
|
5
|
+
|
|
3
6
|
const _excluded = ["children", "className", "component", "disablePointerEvents", "disableTypography", "position", "variant"];
|
|
4
7
|
import * as React from 'react';
|
|
5
8
|
import PropTypes from 'prop-types';
|
|
@@ -121,17 +124,11 @@ const InputAdornment = /*#__PURE__*/React.forwardRef(function InputAdornment(inP
|
|
|
121
124
|
children: children
|
|
122
125
|
}) : /*#__PURE__*/_jsxs(React.Fragment, {
|
|
123
126
|
children: [position === 'start' ?
|
|
124
|
-
/*#__PURE__*/
|
|
125
|
-
|
|
126
127
|
/* notranslate needed while Google Translate will not fix zero-width space issue */
|
|
127
|
-
|
|
128
|
-
/* eslint-disable-next-line react/no-danger */
|
|
129
|
-
_jsx("span", {
|
|
128
|
+
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
130
129
|
className: "notranslate",
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
}) : null, children]
|
|
130
|
+
children: "\u200B"
|
|
131
|
+
})) : null, children]
|
|
135
132
|
})
|
|
136
133
|
}))
|
|
137
134
|
});
|
package/Modal/Modal.js
CHANGED
|
@@ -228,7 +228,7 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
228
228
|
|
|
229
229
|
/**
|
|
230
230
|
* If `true`, the modal will not restore focus to previously focused element once
|
|
231
|
-
* modal is hidden.
|
|
231
|
+
* modal is hidden or unmounted.
|
|
232
232
|
* @default false
|
|
233
233
|
*/
|
|
234
234
|
disableRestoreFocus: PropTypes.bool,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
|
|
4
|
+
var _span;
|
|
5
|
+
|
|
3
6
|
const _excluded = ["children", "classes", "className", "label", "notched"];
|
|
4
7
|
import * as React from 'react';
|
|
5
8
|
import PropTypes from 'prop-types';
|
|
@@ -21,14 +24,12 @@ const NotchedOutlineRoot = styled('fieldset')({
|
|
|
21
24
|
overflow: 'hidden',
|
|
22
25
|
minWidth: '0%'
|
|
23
26
|
});
|
|
24
|
-
const NotchedOutlineLegend = styled('legend'
|
|
25
|
-
skipSx: true
|
|
26
|
-
})(({
|
|
27
|
+
const NotchedOutlineLegend = styled('legend')(({
|
|
27
28
|
ownerState,
|
|
28
29
|
theme
|
|
29
30
|
}) => _extends({
|
|
30
31
|
float: 'unset'
|
|
31
|
-
}, ownerState.
|
|
32
|
+
}, !ownerState.withLabel && {
|
|
32
33
|
padding: 0,
|
|
33
34
|
lineHeight: '11px',
|
|
34
35
|
// sync with `height` in `legend` styles
|
|
@@ -36,7 +37,7 @@ const NotchedOutlineLegend = styled('legend', {
|
|
|
36
37
|
duration: 150,
|
|
37
38
|
easing: theme.transitions.easing.easeOut
|
|
38
39
|
})
|
|
39
|
-
}, ownerState.
|
|
40
|
+
}, ownerState.withLabel && _extends({
|
|
40
41
|
display: 'block',
|
|
41
42
|
// Fix conflict with normalize.css and sanitize.css
|
|
42
43
|
width: 'auto',
|
|
@@ -77,9 +78,11 @@ export default function NotchedOutline(props) {
|
|
|
77
78
|
} = props,
|
|
78
79
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
79
80
|
|
|
81
|
+
const withLabel = label != null && label !== '';
|
|
82
|
+
|
|
80
83
|
const ownerState = _extends({}, props, {
|
|
81
84
|
notched,
|
|
82
|
-
|
|
85
|
+
withLabel
|
|
83
86
|
});
|
|
84
87
|
|
|
85
88
|
return /*#__PURE__*/_jsx(NotchedOutlineRoot, _extends({
|
|
@@ -89,18 +92,13 @@ export default function NotchedOutline(props) {
|
|
|
89
92
|
}, other, {
|
|
90
93
|
children: /*#__PURE__*/_jsx(NotchedOutlineLegend, {
|
|
91
94
|
ownerState: ownerState,
|
|
92
|
-
children:
|
|
95
|
+
children: withLabel ? /*#__PURE__*/_jsx("span", {
|
|
93
96
|
children: label
|
|
94
|
-
}) :
|
|
95
|
-
/*#__PURE__*/
|
|
96
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
97
|
-
// eslint-disable-next-line react/no-danger
|
|
98
|
-
_jsx("span", {
|
|
97
|
+
}) : // notranslate needed while Google Translate will not fix zero-width space issue
|
|
98
|
+
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
99
99
|
className: "notranslate",
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
})
|
|
100
|
+
children: "\u200B"
|
|
101
|
+
}))
|
|
104
102
|
})
|
|
105
103
|
}));
|
|
106
104
|
}
|
|
@@ -136,7 +136,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
136
136
|
}, components),
|
|
137
137
|
renderSuffix: state => /*#__PURE__*/_jsx(NotchedOutlineRoot, {
|
|
138
138
|
className: classes.notchedOutline,
|
|
139
|
-
label: label && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
139
|
+
label: label != null && label !== '' && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
140
140
|
children: [label, "\xA0", '*']
|
|
141
141
|
})) : label,
|
|
142
142
|
notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
|
package/README.md
CHANGED
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
|
|
10
10
|
Quickly build beautiful [React](https://reactjs.org/) apps. MUI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with [Material Design](https://material.io/design/introduction/).
|
|
11
11
|
|
|
12
|
-
[](https://github.com/mui
|
|
12
|
+
[](https://github.com/mui/material-ui/blob/HEAD/LICENSE)
|
|
13
13
|
[](https://www.npmjs.com/package/@mui/material)
|
|
14
14
|
[](https://www.npmjs.com/package/@mui/material)
|
|
15
15
|
[](https://www.npmjs.com/package/@mui/material)
|
|
16
|
-
[](https://app.circleci.com/pipelines/github/mui/material-ui?branch=master)
|
|
17
|
+
[](https://codecov.io/gh/mui/material-ui/branch/master)
|
|
18
18
|
[](https://twitter.com/MUI_hq)
|
|
19
|
-
[](https://github.com/mui
|
|
20
|
-
[](https://github.com/mui/material-ui/issues/27062)
|
|
20
|
+
[](https://isitmaintained.com/project/mui/material-ui 'Average time to resolve an issue')
|
|
21
21
|
[](https://translate.mui.com/project/material-ui-docs)
|
|
22
22
|
[](https://opencollective.com/mui)
|
|
23
23
|
|
|
@@ -132,7 +132,7 @@ Although we love giving you the opportunity to put your stamp on MUI, we also ar
|
|
|
132
132
|
|
|
133
133
|
## Changelog
|
|
134
134
|
|
|
135
|
-
If you have recently updated, please read the [changelog](https://github.com/mui
|
|
135
|
+
If you have recently updated, please read the [changelog](https://github.com/mui/material-ui/releases) for details of what has changed.
|
|
136
136
|
|
|
137
137
|
## Roadmap
|
|
138
138
|
|
package/Radio/RadioButtonIcon.js
CHANGED
|
@@ -10,15 +10,11 @@ const RadioButtonIconRoot = styled('span')({
|
|
|
10
10
|
position: 'relative',
|
|
11
11
|
display: 'flex'
|
|
12
12
|
});
|
|
13
|
-
const RadioButtonIconBackground = styled(RadioButtonUncheckedIcon
|
|
14
|
-
skipSx: true
|
|
15
|
-
})({
|
|
13
|
+
const RadioButtonIconBackground = styled(RadioButtonUncheckedIcon)({
|
|
16
14
|
// Scale applied to prevent dot misalignment in Safari
|
|
17
15
|
transform: 'scale(1)'
|
|
18
16
|
});
|
|
19
|
-
const RadioButtonIconDot = styled(RadioButtonCheckedIcon
|
|
20
|
-
skipSx: true
|
|
21
|
-
})(({
|
|
17
|
+
const RadioButtonIconDot = styled(RadioButtonCheckedIcon)(({
|
|
22
18
|
theme,
|
|
23
19
|
ownerState
|
|
24
20
|
}) => _extends({
|
package/Rating/Rating.js
CHANGED
|
@@ -405,7 +405,7 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
|
|
|
405
405
|
|
|
406
406
|
const handleChange = event => {
|
|
407
407
|
let newValue = event.target.value === '' ? null : parseFloat(event.target.value); // Give mouse priority over keyboard
|
|
408
|
-
// Fix https://github.com/mui
|
|
408
|
+
// Fix https://github.com/mui/material-ui/issues/22827
|
|
409
409
|
|
|
410
410
|
if (hover !== -1) {
|
|
411
411
|
newValue = hover;
|
package/Select/Select.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _StyledInput, _StyledFilledInput;
|
|
5
5
|
|
|
6
6
|
const _excluded = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"];
|
|
7
7
|
import * as React from 'react';
|
|
@@ -18,6 +18,7 @@ import FilledInput from '../FilledInput';
|
|
|
18
18
|
import OutlinedInput from '../OutlinedInput';
|
|
19
19
|
import useThemeProps from '../styles/useThemeProps';
|
|
20
20
|
import useForkRef from '../utils/useForkRef';
|
|
21
|
+
import styled, { rootShouldForwardProp } from '../styles/styled';
|
|
21
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
23
|
|
|
23
24
|
const useUtilityClasses = ownerState => {
|
|
@@ -27,6 +28,15 @@ const useUtilityClasses = ownerState => {
|
|
|
27
28
|
return classes;
|
|
28
29
|
};
|
|
29
30
|
|
|
31
|
+
const styledRootConfig = {
|
|
32
|
+
name: 'MuiSelect',
|
|
33
|
+
overridesResolver: (props, styles) => styles.root,
|
|
34
|
+
shouldForwardProp: prop => rootShouldForwardProp(prop) && prop !== 'variant',
|
|
35
|
+
slot: 'Root'
|
|
36
|
+
};
|
|
37
|
+
const StyledInput = styled(Input, styledRootConfig)('');
|
|
38
|
+
const StyledOutlinedInput = styled(OutlinedInput, styledRootConfig)('');
|
|
39
|
+
const StyledFilledInput = styled(FilledInput, styledRootConfig)('');
|
|
30
40
|
const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
31
41
|
const props = useThemeProps({
|
|
32
42
|
name: 'MuiSelect',
|
|
@@ -54,7 +64,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
54
64
|
open,
|
|
55
65
|
renderValue,
|
|
56
66
|
SelectDisplayProps,
|
|
57
|
-
variant:
|
|
67
|
+
variant: variantProp = 'outlined'
|
|
58
68
|
} = props,
|
|
59
69
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
60
70
|
|
|
@@ -65,16 +75,17 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
65
75
|
muiFormControl,
|
|
66
76
|
states: ['variant']
|
|
67
77
|
});
|
|
68
|
-
const variant = fcs.variant ||
|
|
78
|
+
const variant = fcs.variant || variantProp;
|
|
69
79
|
const InputComponent = input || {
|
|
70
|
-
standard:
|
|
71
|
-
outlined: /*#__PURE__*/_jsx(
|
|
80
|
+
standard: _StyledInput || (_StyledInput = /*#__PURE__*/_jsx(StyledInput, {})),
|
|
81
|
+
outlined: /*#__PURE__*/_jsx(StyledOutlinedInput, {
|
|
72
82
|
label: label
|
|
73
83
|
}),
|
|
74
|
-
filled:
|
|
84
|
+
filled: _StyledFilledInput || (_StyledFilledInput = /*#__PURE__*/_jsx(StyledFilledInput, {}))
|
|
75
85
|
}[variant];
|
|
76
86
|
|
|
77
87
|
const ownerState = _extends({}, props, {
|
|
88
|
+
variant,
|
|
78
89
|
classes: classesProp
|
|
79
90
|
});
|
|
80
91
|
|
|
@@ -113,7 +124,8 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
113
124
|
notched: true
|
|
114
125
|
} : {}, {
|
|
115
126
|
ref: inputComponentRef,
|
|
116
|
-
className: clsx(InputComponent.props.className, className)
|
|
127
|
+
className: clsx(InputComponent.props.className, className),
|
|
128
|
+
variant
|
|
117
129
|
}, other));
|
|
118
130
|
});
|
|
119
131
|
process.env.NODE_ENV !== "production" ? Select.propTypes
|
package/Select/SelectInput.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
4
|
+
|
|
5
|
+
var _span;
|
|
6
|
+
|
|
4
7
|
const _excluded = ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultOpen", "defaultValue", "disabled", "displayEmpty", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"];
|
|
5
8
|
import * as React from 'react';
|
|
6
9
|
import { isFragment } from 'react-is';
|
|
@@ -186,6 +189,10 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
186
189
|
}
|
|
187
190
|
}, [autoFocus]);
|
|
188
191
|
React.useEffect(() => {
|
|
192
|
+
if (!labelId) {
|
|
193
|
+
return undefined;
|
|
194
|
+
}
|
|
195
|
+
|
|
189
196
|
const label = ownerDocument(displayRef.current).getElementById(labelId);
|
|
190
197
|
|
|
191
198
|
if (label) {
|
|
@@ -282,7 +289,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
282
289
|
if (onChange) {
|
|
283
290
|
// Redefine target to allow name and value to be read.
|
|
284
291
|
// This allows seamless integration with the most popular form libraries.
|
|
285
|
-
// https://github.com/mui
|
|
292
|
+
// https://github.com/mui/material-ui/issues/13485#issuecomment-676048492
|
|
286
293
|
// Clone the event to not override `target` of the original event.
|
|
287
294
|
const nativeEvent = event.nativeEvent || event;
|
|
288
295
|
const clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
|
|
@@ -482,16 +489,11 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
482
489
|
className: clsx(classes.select, className, SelectDisplayProps.className) // The id is required for proper a11y
|
|
483
490
|
,
|
|
484
491
|
id: buttonId,
|
|
485
|
-
children: isEmpty(display) ?
|
|
486
|
-
/*#__PURE__*/
|
|
487
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
488
|
-
// eslint-disable-next-line react/no-danger
|
|
489
|
-
_jsx("span", {
|
|
492
|
+
children: isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
493
|
+
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
490
494
|
className: "notranslate",
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
}
|
|
494
|
-
}) : display
|
|
495
|
+
children: "\u200B"
|
|
496
|
+
})) : display
|
|
495
497
|
})), /*#__PURE__*/_jsx(SelectNativeInput, _extends({
|
|
496
498
|
value: Array.isArray(value) ? value.join(',') : value,
|
|
497
499
|
name: name,
|
package/Slider/Slider.js
CHANGED
|
@@ -691,7 +691,9 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
691
691
|
* The size of the slider.
|
|
692
692
|
* @default 'medium'
|
|
693
693
|
*/
|
|
694
|
-
size: PropTypes
|
|
694
|
+
size: PropTypes
|
|
695
|
+
/* @typescript-to-proptypes-ignore */
|
|
696
|
+
.oneOfType([PropTypes.oneOf(['small', 'medium']), PropTypes.string]),
|
|
695
697
|
|
|
696
698
|
/**
|
|
697
699
|
* The granularity with which the slider can step through values. (A "discrete" slider.)
|
package/Snackbar/Snackbar.js
CHANGED
|
@@ -290,7 +290,10 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
290
290
|
onMouseEnter: handleMouseEnter,
|
|
291
291
|
onMouseLeave: handleMouseLeave,
|
|
292
292
|
ownerState: ownerState,
|
|
293
|
-
ref: ref
|
|
293
|
+
ref: ref // ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
|
|
294
|
+
// See https://github.com/mui-org/material-ui/issues/29080
|
|
295
|
+
,
|
|
296
|
+
role: "presentation"
|
|
294
297
|
}, other, {
|
|
295
298
|
children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
|
|
296
299
|
appear: true,
|
package/SvgIcon/SvgIcon.js
CHANGED
|
@@ -37,7 +37,7 @@ const SvgIconRoot = styled('svg', {
|
|
|
37
37
|
theme,
|
|
38
38
|
ownerState
|
|
39
39
|
}) => {
|
|
40
|
-
var _theme$palette$ownerS, _theme$palette$ownerS2;
|
|
40
|
+
var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$transitions2$d, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _theme$palette$ownerS, _theme$palette, _theme$palette$ownerS2, _theme$palette2, _theme$palette2$actio, _theme$palette3, _theme$palette3$actio;
|
|
41
41
|
|
|
42
42
|
return {
|
|
43
43
|
userSelect: 'none',
|
|
@@ -46,19 +46,19 @@ const SvgIconRoot = styled('svg', {
|
|
|
46
46
|
display: 'inline-block',
|
|
47
47
|
fill: 'currentColor',
|
|
48
48
|
flexShrink: 0,
|
|
49
|
-
transition: theme.transitions.create('fill', {
|
|
50
|
-
duration: theme.transitions.duration.shorter
|
|
49
|
+
transition: (_theme$transitions = theme.transitions) == null ? void 0 : (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {
|
|
50
|
+
duration: (_theme$transitions2 = theme.transitions) == null ? void 0 : (_theme$transitions2$d = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2$d.shorter
|
|
51
51
|
}),
|
|
52
52
|
fontSize: {
|
|
53
53
|
inherit: 'inherit',
|
|
54
|
-
small: theme.typography.pxToRem(20),
|
|
55
|
-
medium: theme.typography.pxToRem(24),
|
|
56
|
-
large: theme.typography.pxToRem(35)
|
|
54
|
+
small: ((_theme$typography = theme.typography) == null ? void 0 : (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',
|
|
55
|
+
medium: ((_theme$typography2 = theme.typography) == null ? void 0 : (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',
|
|
56
|
+
large: ((_theme$typography3 = theme.typography) == null ? void 0 : (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875'
|
|
57
57
|
}[ownerState.fontSize],
|
|
58
58
|
// TODO v5 deprecate, v6 remove for sx
|
|
59
|
-
color: (_theme$palette$ownerS = (_theme$palette
|
|
60
|
-
action: theme.palette.action.active,
|
|
61
|
-
disabled: theme.palette.action.disabled,
|
|
59
|
+
color: (_theme$palette$ownerS = (_theme$palette = theme.palette) == null ? void 0 : (_theme$palette$ownerS2 = _theme$palette[ownerState.color]) == null ? void 0 : _theme$palette$ownerS2.main) != null ? _theme$palette$ownerS : {
|
|
60
|
+
action: (_theme$palette2 = theme.palette) == null ? void 0 : (_theme$palette2$actio = _theme$palette2.action) == null ? void 0 : _theme$palette2$actio.active,
|
|
61
|
+
disabled: (_theme$palette3 = theme.palette) == null ? void 0 : (_theme$palette3$actio = _theme$palette3.action) == null ? void 0 : _theme$palette3$actio.disabled,
|
|
62
62
|
inherit: undefined
|
|
63
63
|
}[ownerState.color]
|
|
64
64
|
};
|
|
@@ -8,9 +8,7 @@ import styled from '../styles/styled';
|
|
|
8
8
|
import capitalize from '../utils/capitalize';
|
|
9
9
|
import { isHorizontal } from '../Drawer/Drawer';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
const SwipeAreaRoot = styled('div'
|
|
12
|
-
skipSx: true
|
|
13
|
-
})(({
|
|
11
|
+
const SwipeAreaRoot = styled('div')(({
|
|
14
12
|
theme,
|
|
15
13
|
ownerState
|
|
16
14
|
}) => _extends({
|
package/TextField/TextField.js
CHANGED
|
@@ -191,7 +191,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
191
191
|
variant: variant,
|
|
192
192
|
ownerState: ownerState
|
|
193
193
|
}, other, {
|
|
194
|
-
children: [label && /*#__PURE__*/_jsx(InputLabel, _extends({
|
|
194
|
+
children: [label != null && label !== '' && /*#__PURE__*/_jsx(InputLabel, _extends({
|
|
195
195
|
htmlFor: id,
|
|
196
196
|
id: inputLabelId
|
|
197
197
|
}, InputLabelProps, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SxProps } from '@mui/system';
|
|
2
2
|
import { OverridableStringUnion } from '@mui/types';
|
|
3
|
+
import * as React from 'react';
|
|
3
4
|
import { Theme } from '..';
|
|
4
5
|
import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase';
|
|
5
6
|
import { OverrideProps } from '../OverridableComponent';
|
|
@@ -45,6 +46,20 @@ export type ToggleButtonTypeMap<
|
|
|
45
46
|
* @default false
|
|
46
47
|
*/
|
|
47
48
|
fullWidth?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Callback fired when the state changes.
|
|
51
|
+
*
|
|
52
|
+
* @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
|
|
53
|
+
* @param {any} value of the selected button.
|
|
54
|
+
*/
|
|
55
|
+
onChange?: (event: React.MouseEvent<HTMLElement>, value: any) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Callback fired when the button is clicked.
|
|
58
|
+
*
|
|
59
|
+
* @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
|
|
60
|
+
* @param {any} value of the selected button.
|
|
61
|
+
*/
|
|
62
|
+
onClick?: (event: React.MouseEvent<HTMLElement>, value: any) => void;
|
|
48
63
|
/**
|
|
49
64
|
* If `true`, the button is rendered in an active state.
|
|
50
65
|
*/
|
|
@@ -200,12 +200,18 @@ process.env.NODE_ENV !== "production" ? ToggleButton.propTypes
|
|
|
200
200
|
fullWidth: PropTypes.bool,
|
|
201
201
|
|
|
202
202
|
/**
|
|
203
|
-
*
|
|
203
|
+
* Callback fired when the state changes.
|
|
204
|
+
*
|
|
205
|
+
* @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
|
|
206
|
+
* @param {any} value of the selected button.
|
|
204
207
|
*/
|
|
205
208
|
onChange: PropTypes.func,
|
|
206
209
|
|
|
207
210
|
/**
|
|
208
|
-
*
|
|
211
|
+
* Callback fired when the button is clicked.
|
|
212
|
+
*
|
|
213
|
+
* @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
|
|
214
|
+
* @param {any} value of the selected button.
|
|
209
215
|
*/
|
|
210
216
|
onClick: PropTypes.func,
|
|
211
217
|
|
package/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export type StandardProps<
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @internal
|
|
26
|
-
* ONLY USE FROM WITHIN mui
|
|
26
|
+
* ONLY USE FROM WITHIN mui/material-ui
|
|
27
27
|
*
|
|
28
28
|
* Internal helper type for conform (describeConformance) components
|
|
29
29
|
* However, we don't declare classes on this type.
|
|
@@ -74,8 +74,6 @@ export * from './styles';
|
|
|
74
74
|
|
|
75
75
|
export * from './utils';
|
|
76
76
|
|
|
77
|
-
export * from '@mui/base';
|
|
78
|
-
|
|
79
77
|
export { default as Accordion } from './Accordion';
|
|
80
78
|
export * from './Accordion';
|
|
81
79
|
|
|
@@ -328,6 +326,9 @@ export * from './Popover';
|
|
|
328
326
|
export { default as Popper } from './Popper';
|
|
329
327
|
export * from './Popper';
|
|
330
328
|
|
|
329
|
+
export { default as Portal } from './Portal';
|
|
330
|
+
export * from './Portal';
|
|
331
|
+
|
|
331
332
|
export { default as Radio } from './Radio';
|
|
332
333
|
export * from './Radio';
|
|
333
334
|
|
|
@@ -476,3 +477,10 @@ export * from './GlobalStyles';
|
|
|
476
477
|
* @deprecated will be removed in v5.beta, please use StyledEngineProvider from @mui/material/styles instead
|
|
477
478
|
*/
|
|
478
479
|
export { StyledEngineProvider } from './styles';
|
|
480
|
+
|
|
481
|
+
export { default as unstable_composeClasses } from '@mui/base/composeClasses';
|
|
482
|
+
|
|
483
|
+
export { default as generateUtilityClass } from '@mui/base/generateUtilityClass';
|
|
484
|
+
export * from '@mui/base/generateUtilityClass';
|
|
485
|
+
|
|
486
|
+
export { default as generateUtilityClasses } from '@mui/base/generateUtilityClasses';
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.4.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.
|
|
@@ -8,7 +8,6 @@ import * as colors from './colors';
|
|
|
8
8
|
export { colors };
|
|
9
9
|
export * from './styles';
|
|
10
10
|
export * from './utils';
|
|
11
|
-
export * from '@mui/base';
|
|
12
11
|
export { default as Accordion } from './Accordion';
|
|
13
12
|
export * from './Accordion';
|
|
14
13
|
export { default as AccordionActions } from './AccordionActions';
|
|
@@ -175,6 +174,8 @@ export { default as Popover } from './Popover';
|
|
|
175
174
|
export * from './Popover';
|
|
176
175
|
export { default as Popper } from './Popper';
|
|
177
176
|
export * from './Popper';
|
|
177
|
+
export { default as Portal } from './Portal';
|
|
178
|
+
export * from './Portal';
|
|
178
179
|
export { default as Radio } from './Radio';
|
|
179
180
|
export * from './Radio';
|
|
180
181
|
export { default as RadioGroup } from './RadioGroup';
|
|
@@ -273,4 +274,8 @@ export * from './Zoom'; // createFilterOptions is exported from Autocomplete
|
|
|
273
274
|
export { default as useAutocomplete } from './useAutocomplete';
|
|
274
275
|
export { default as GlobalStyles } from './GlobalStyles';
|
|
275
276
|
export * from './GlobalStyles';
|
|
276
|
-
export { StyledEngineProvider } from './styles';
|
|
277
|
+
export { StyledEngineProvider } from './styles';
|
|
278
|
+
export { default as unstable_composeClasses } from '@mui/base/composeClasses';
|
|
279
|
+
export { default as generateUtilityClass } from '@mui/base/generateUtilityClass';
|
|
280
|
+
export * from '@mui/base/generateUtilityClass';
|
|
281
|
+
export { default as generateUtilityClasses } from '@mui/base/generateUtilityClasses';
|