@mui/material 5.2.6 → 5.3.1
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 +2 -0
- package/Autocomplete/Autocomplete.js +11 -7
- package/Avatar/Avatar.d.ts +3 -1
- package/Backdrop/Backdrop.js +3 -1
- package/Badge/Badge.d.ts +10 -10
- package/Badge/Badge.js +6 -7
- package/Button/buttonClasses.d.ts +1 -1
- package/CHANGELOG.md +240 -33
- package/FilledInput/FilledInput.js +4 -1
- package/FormControlLabel/FormControlLabel.js +3 -1
- package/Input/Input.js +4 -1
- package/InputBase/InputBase.js +4 -1
- package/InputLabel/InputLabel.js +4 -0
- package/ListItem/ListItem.js +3 -1
- package/Modal/Modal.js +3 -1
- package/README.md +5 -4
- package/Select/Select.d.ts +9 -1
- package/Select/Select.js +10 -1
- package/Select/SelectInput.d.ts +1 -0
- package/Select/SelectInput.js +25 -4
- package/Slider/Slider.d.ts +2 -0
- package/Slider/Slider.js +126 -53
- package/StepLabel/StepLabel.js +3 -1
- package/SvgIcon/SvgIcon.d.ts +8 -0
- package/SvgIcon/SvgIcon.js +28 -12
- package/TextField/TextField.d.ts +1 -0
- package/TextField/TextField.js +1 -0
- package/Tooltip/Tooltip.js +6 -1
- package/index.js +1 -1
- package/legacy/Autocomplete/Autocomplete.js +11 -7
- package/legacy/Backdrop/Backdrop.js +3 -1
- package/legacy/Badge/Badge.js +6 -7
- package/legacy/FilledInput/FilledInput.js +4 -1
- package/legacy/FormControlLabel/FormControlLabel.js +3 -1
- package/legacy/Input/Input.js +4 -1
- package/legacy/InputBase/InputBase.js +4 -1
- package/legacy/InputLabel/InputLabel.js +4 -0
- package/legacy/ListItem/ListItem.js +3 -1
- package/legacy/Modal/Modal.js +3 -1
- package/legacy/Select/Select.js +11 -1
- package/legacy/Select/SelectInput.js +29 -7
- package/legacy/Slider/Slider.js +127 -54
- package/legacy/StepLabel/StepLabel.js +3 -1
- package/legacy/SvgIcon/SvgIcon.js +29 -12
- package/legacy/TextField/TextField.js +1 -0
- package/legacy/Tooltip/Tooltip.js +6 -1
- package/legacy/index.js +1 -1
- package/legacy/locale/index.js +139 -128
- package/legacy/utils/shouldSpreadAdditionalProps.js +7 -0
- package/locale/index.js +54 -44
- package/modern/Autocomplete/Autocomplete.js +10 -6
- package/modern/Backdrop/Backdrop.js +3 -1
- package/modern/Badge/Badge.js +6 -7
- package/modern/FilledInput/FilledInput.js +4 -1
- package/modern/FormControlLabel/FormControlLabel.js +3 -1
- package/modern/Input/Input.js +4 -1
- package/modern/InputBase/InputBase.js +4 -1
- package/modern/InputLabel/InputLabel.js +4 -0
- package/modern/ListItem/ListItem.js +3 -1
- package/modern/Modal/Modal.js +3 -1
- package/modern/Select/Select.js +10 -1
- package/modern/Select/SelectInput.js +25 -4
- package/modern/Slider/Slider.js +126 -53
- package/modern/StepLabel/StepLabel.js +3 -1
- package/modern/SvgIcon/SvgIcon.js +27 -11
- package/modern/TextField/TextField.js +1 -0
- package/modern/Tooltip/Tooltip.js +6 -1
- package/modern/index.js +1 -1
- package/modern/locale/index.js +54 -44
- package/modern/utils/shouldSpreadAdditionalProps.js +7 -0
- package/node/Autocomplete/Autocomplete.js +11 -7
- package/node/Backdrop/Backdrop.js +3 -1
- package/node/Badge/Badge.js +8 -8
- package/node/FilledInput/FilledInput.js +4 -1
- package/node/FormControlLabel/FormControlLabel.js +3 -1
- package/node/Input/Input.js +4 -1
- package/node/InputBase/InputBase.js +4 -1
- package/node/InputLabel/InputLabel.js +4 -0
- package/node/ListItem/ListItem.js +3 -1
- package/node/Modal/Modal.js +3 -1
- package/node/Select/Select.js +10 -1
- package/node/Select/SelectInput.js +25 -4
- package/node/Slider/Slider.js +112 -45
- package/node/StepLabel/StepLabel.js +3 -1
- package/node/SvgIcon/SvgIcon.js +28 -12
- package/node/TextField/TextField.js +1 -0
- package/node/Tooltip/Tooltip.js +6 -1
- package/node/index.js +1 -1
- package/node/locale/index.js +54 -44
- package/node/utils/shouldSpreadAdditionalProps.js +15 -0
- package/package.json +7 -7
- package/styles/components.d.ts +452 -113
- package/styles/createTheme.d.ts +12 -6
- package/styles/overrides.d.ts +16 -4
- package/styles/useThemeProps.d.ts +2 -1
- package/umd/material-ui.development.js +619 -289
- package/umd/material-ui.production.min.js +21 -21
- package/utils/shouldSpreadAdditionalProps.js +7 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { IconButtonProps, InternalStandardProps as StandardProps, Theme } from '@mui/material';
|
|
3
3
|
import { ChipProps, ChipTypeMap } from '@mui/material/Chip';
|
|
4
|
+
import { PaperProps } from '@mui/material/Paper';
|
|
4
5
|
import { PopperProps } from '@mui/material/Popper';
|
|
5
6
|
import { SxProps } from '@mui/system';
|
|
6
7
|
import { OverridableStringUnion } from '@mui/types';
|
|
@@ -101,6 +102,7 @@ export interface AutocompleteProps<
|
|
|
101
102
|
*/
|
|
102
103
|
componentsProps?: {
|
|
103
104
|
clearIndicator?: Partial<IconButtonProps>;
|
|
105
|
+
paper?: PaperProps;
|
|
104
106
|
};
|
|
105
107
|
/**
|
|
106
108
|
* If `true`, the component is disabled.
|
|
@@ -349,7 +349,7 @@ const AutocompleteGroupUl = styled('ul', {
|
|
|
349
349
|
});
|
|
350
350
|
export { createFilterOptions };
|
|
351
351
|
const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps, ref) {
|
|
352
|
-
var _componentsProps$clea;
|
|
352
|
+
var _componentsProps$clea, _componentsProps$pape;
|
|
353
353
|
|
|
354
354
|
const props = useThemeProps({
|
|
355
355
|
props: inProps,
|
|
@@ -570,10 +570,11 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
570
570
|
role: "presentation",
|
|
571
571
|
anchorEl: anchorEl,
|
|
572
572
|
open: true,
|
|
573
|
-
children: /*#__PURE__*/_jsxs(AutocompletePaper, {
|
|
574
|
-
as: PaperComponent,
|
|
575
|
-
className: classes.paper,
|
|
573
|
+
children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
|
|
576
574
|
ownerState: ownerState,
|
|
575
|
+
as: PaperComponent
|
|
576
|
+
}, componentsProps.paper, {
|
|
577
|
+
className: clsx(classes.paper, (_componentsProps$pape = componentsProps.paper) == null ? void 0 : _componentsProps$pape.className),
|
|
577
578
|
children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
|
|
578
579
|
className: classes.loading,
|
|
579
580
|
ownerState: ownerState,
|
|
@@ -604,7 +605,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
604
605
|
return renderListOption(option, index);
|
|
605
606
|
})
|
|
606
607
|
})) : null]
|
|
607
|
-
})
|
|
608
|
+
}))
|
|
608
609
|
}) : null]
|
|
609
610
|
});
|
|
610
611
|
});
|
|
@@ -674,7 +675,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
674
675
|
* If `true`, the input's text is cleared on blur if no value is selected.
|
|
675
676
|
*
|
|
676
677
|
* Set to `true` if you want to help the user enter a new value.
|
|
677
|
-
* Set to `false` if you want to help the user resume
|
|
678
|
+
* Set to `false` if you want to help the user resume their search.
|
|
678
679
|
* @default !props.freeSolo
|
|
679
680
|
*/
|
|
680
681
|
clearOnBlur: PropTypes.bool,
|
|
@@ -705,7 +706,10 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
705
706
|
* The props used for each slot inside.
|
|
706
707
|
* @default {}
|
|
707
708
|
*/
|
|
708
|
-
componentsProps: PropTypes.
|
|
709
|
+
componentsProps: PropTypes.shape({
|
|
710
|
+
clearIndicator: PropTypes.object,
|
|
711
|
+
paper: PropTypes.object
|
|
712
|
+
}),
|
|
709
713
|
|
|
710
714
|
/**
|
|
711
715
|
* The default value. Use when the component is not controlled.
|
package/Avatar/Avatar.d.ts
CHANGED
|
@@ -27,7 +27,9 @@ export interface AvatarTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
|
27
27
|
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes) applied to the `img` element if the component is used to display an image.
|
|
28
28
|
* It can be used to listen for the loading error event.
|
|
29
29
|
*/
|
|
30
|
-
imgProps?: React.ImgHTMLAttributes<HTMLImageElement
|
|
30
|
+
imgProps?: React.ImgHTMLAttributes<HTMLImageElement> & {
|
|
31
|
+
sx?: SxProps<Theme>;
|
|
32
|
+
};
|
|
31
33
|
/**
|
|
32
34
|
* The `sizes` attribute for the `img` element.
|
|
33
35
|
*/
|
package/Backdrop/Backdrop.js
CHANGED
|
@@ -126,7 +126,9 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
|
|
|
126
126
|
* The props used for each slot inside the Backdrop.
|
|
127
127
|
* @default {}
|
|
128
128
|
*/
|
|
129
|
-
componentsProps: PropTypes.
|
|
129
|
+
componentsProps: PropTypes.shape({
|
|
130
|
+
root: PropTypes.object
|
|
131
|
+
}),
|
|
130
132
|
|
|
131
133
|
/**
|
|
132
134
|
* If `true`, the backdrop is invisible.
|
package/Badge/Badge.d.ts
CHANGED
|
@@ -31,25 +31,25 @@ export type BadgeTypeMap<
|
|
|
31
31
|
/** Styles applied to the badge `span` element if `color="warning"`. */
|
|
32
32
|
colorWarning?: string;
|
|
33
33
|
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'right' }} overlap="rectangular"`. */
|
|
34
|
-
anchorOriginTopRightRectangular
|
|
34
|
+
anchorOriginTopRightRectangular?: string;
|
|
35
35
|
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'right' }} overlap="rectangular"`. */
|
|
36
|
-
anchorOriginBottomRightRectangular
|
|
36
|
+
anchorOriginBottomRightRectangular?: string;
|
|
37
37
|
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'left' }} overlap="rectangular"`. */
|
|
38
|
-
anchorOriginTopLeftRectangular
|
|
38
|
+
anchorOriginTopLeftRectangular?: string;
|
|
39
39
|
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'left' }} overlap="rectangular"`. */
|
|
40
|
-
anchorOriginBottomLeftRectangular
|
|
40
|
+
anchorOriginBottomLeftRectangular?: string;
|
|
41
41
|
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'right' }} overlap="circular"`. */
|
|
42
|
-
anchorOriginTopRightCircular
|
|
42
|
+
anchorOriginTopRightCircular?: string;
|
|
43
43
|
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'right' }} overlap="circular"`. */
|
|
44
|
-
anchorOriginBottomRightCircular
|
|
44
|
+
anchorOriginBottomRightCircular?: string;
|
|
45
45
|
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'left' }} overlap="circular"`. */
|
|
46
|
-
anchorOriginTopLeftCircular
|
|
46
|
+
anchorOriginTopLeftCircular?: string;
|
|
47
47
|
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'left' }} overlap="circular"`. */
|
|
48
|
-
anchorOriginBottomLeftCircular
|
|
48
|
+
anchorOriginBottomLeftCircular?: string;
|
|
49
49
|
/** Class name applied to the badge `span` element if `overlap="rectangular"`. */
|
|
50
|
-
overlapRectangular
|
|
50
|
+
overlapRectangular?: string;
|
|
51
51
|
/** Class name applied to the badge `span` element if `overlap="circular"`. */
|
|
52
|
-
overlapCircular
|
|
52
|
+
overlapCircular?: string;
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
55
|
* The color of the component. It supports those theme colors that make sense for this component.
|
package/Badge/Badge.js
CHANGED
|
@@ -5,10 +5,11 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { usePreviousProps } from '@mui/utils';
|
|
8
|
-
import { generateUtilityClasses
|
|
8
|
+
import { generateUtilityClasses } from '@mui/base';
|
|
9
9
|
import BadgeUnstyled, { badgeUnstyledClasses, getBadgeUtilityClass } from '@mui/base/BadgeUnstyled';
|
|
10
10
|
import styled from '../styles/styled';
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
|
+
import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
|
|
12
13
|
import capitalize from '../utils/capitalize';
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
15
|
export const badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular', // TODO: v6 remove the overlap value from these class keys
|
|
@@ -152,11 +153,6 @@ const BadgeBadge = styled('span', {
|
|
|
152
153
|
duration: theme.transitions.duration.leavingScreen
|
|
153
154
|
})
|
|
154
155
|
}));
|
|
155
|
-
|
|
156
|
-
const shouldSpreadAdditionalProps = Slot => {
|
|
157
|
-
return !Slot || !isHostComponent(Slot);
|
|
158
|
-
};
|
|
159
|
-
|
|
160
156
|
const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
161
157
|
var _componentsProps$root, _componentsProps$badg;
|
|
162
158
|
|
|
@@ -300,7 +296,10 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
300
296
|
* The props used for each slot inside the Badge.
|
|
301
297
|
* @default {}
|
|
302
298
|
*/
|
|
303
|
-
componentsProps: PropTypes.
|
|
299
|
+
componentsProps: PropTypes.shape({
|
|
300
|
+
badge: PropTypes.object,
|
|
301
|
+
root: PropTypes.object
|
|
302
|
+
}),
|
|
304
303
|
|
|
305
304
|
/**
|
|
306
305
|
* If `true`, the badge is invisible.
|
|
@@ -47,7 +47,7 @@ export interface ButtonClasses {
|
|
|
47
47
|
outlinedSizeLarge: string;
|
|
48
48
|
/** Styles applied to the root element if `size="small"` and `variant="contained"`. */
|
|
49
49
|
containedSizeSmall: string;
|
|
50
|
-
/** Styles applied to the root element if `size="
|
|
50
|
+
/** Styles applied to the root element if `size="medium"` and `variant="contained"`. */
|
|
51
51
|
containedSizeMedium: string;
|
|
52
52
|
/** Styles applied to the root element if `size="large"` and `variant="contained"`. */
|
|
53
53
|
containedSizeLarge: string;
|