@mui/material 5.2.7 → 5.4.0
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 +7 -0
- package/Autocomplete/Autocomplete.js +22 -10
- package/Backdrop/Backdrop.js +3 -1
- package/Badge/Badge.js +6 -7
- package/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/Button/buttonClasses.d.ts +1 -1
- package/ButtonBase/TouchRipple.js +1 -2
- package/CHANGELOG.md +284 -33
- package/FilledInput/FilledInput.js +4 -1
- package/FormControlLabel/FormControlLabel.js +14 -4
- 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/Input/Input.js +4 -1
- package/InputAdornment/InputAdornment.js +6 -9
- 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/OutlinedInput/NotchedOutline.js +14 -16
- package/OutlinedInput/OutlinedInput.js +1 -1
- package/README.md +5 -4
- package/Radio/RadioButtonIcon.js +2 -6
- package/Select/Select.d.ts +9 -1
- package/Select/Select.js +10 -1
- package/Select/SelectInput.d.ts +1 -0
- package/Select/SelectInput.js +32 -13
- package/Slider/Slider.d.ts +2 -0
- package/Slider/Slider.js +126 -53
- package/StepLabel/StepLabel.js +3 -1
- package/SvgIcon/SvgIcon.js +9 -9
- package/SwipeableDrawer/SwipeArea.js +1 -3
- package/TextField/TextField.d.ts +1 -0
- package/TextField/TextField.js +2 -1
- package/Tooltip/Tooltip.js +6 -1
- package/index.d.ts +7 -2
- package/index.js +6 -3
- package/internal/SwitchBase.js +2 -6
- package/legacy/Autocomplete/Autocomplete.js +23 -10
- package/legacy/Backdrop/Backdrop.js +3 -1
- package/legacy/Badge/Badge.js +6 -7
- package/legacy/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/legacy/ButtonBase/TouchRipple.js +1 -2
- package/legacy/FilledInput/FilledInput.js +4 -1
- package/legacy/FormControlLabel/FormControlLabel.js +14 -4
- 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/Input/Input.js +4 -1
- package/legacy/InputAdornment/InputAdornment.js +6 -9
- 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/OutlinedInput/NotchedOutline.js +14 -16
- package/legacy/OutlinedInput/OutlinedInput.js +1 -1
- package/legacy/Radio/RadioButtonIcon.js +2 -6
- package/legacy/Select/Select.js +11 -1
- package/legacy/Select/SelectInput.js +36 -16
- package/legacy/Slider/Slider.js +127 -54
- package/legacy/StepLabel/StepLabel.js +3 -1
- package/legacy/SvgIcon/SvgIcon.js +9 -9
- package/legacy/SwipeableDrawer/SwipeArea.js +1 -3
- package/legacy/TextField/TextField.js +2 -1
- package/legacy/Tooltip/Tooltip.js +6 -1
- package/legacy/index.js +6 -3
- package/legacy/internal/SwitchBase.js +2 -6
- package/legacy/useMediaQuery/useMediaQuery.js +86 -31
- package/legacy/utils/shouldSpreadAdditionalProps.js +7 -0
- package/modern/Autocomplete/Autocomplete.js +21 -9
- package/modern/Backdrop/Backdrop.js +3 -1
- package/modern/Badge/Badge.js +6 -7
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/modern/ButtonBase/TouchRipple.js +1 -2
- package/modern/FilledInput/FilledInput.js +4 -1
- package/modern/FormControlLabel/FormControlLabel.js +14 -4
- 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/Input/Input.js +4 -1
- package/modern/InputAdornment/InputAdornment.js +6 -9
- 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/OutlinedInput/NotchedOutline.js +14 -16
- package/modern/OutlinedInput/OutlinedInput.js +1 -1
- package/modern/Radio/RadioButtonIcon.js +2 -6
- package/modern/Select/Select.js +10 -1
- package/modern/Select/SelectInput.js +32 -13
- package/modern/Slider/Slider.js +126 -53
- package/modern/StepLabel/StepLabel.js +3 -1
- package/modern/SvgIcon/SvgIcon.js +8 -8
- package/modern/SwipeableDrawer/SwipeArea.js +1 -3
- package/modern/TextField/TextField.js +2 -1
- package/modern/Tooltip/Tooltip.js +6 -1
- package/modern/index.js +6 -3
- package/modern/internal/SwitchBase.js +2 -6
- package/modern/useMediaQuery/useMediaQuery.js +68 -26
- package/modern/utils/shouldSpreadAdditionalProps.js +7 -0
- package/node/Autocomplete/Autocomplete.js +22 -10
- package/node/Backdrop/Backdrop.js +3 -1
- package/node/Badge/Badge.js +8 -8
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/node/ButtonBase/TouchRipple.js +1 -2
- package/node/FilledInput/FilledInput.js +4 -1
- package/node/FormControlLabel/FormControlLabel.js +15 -4
- 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/Input/Input.js +4 -1
- package/node/InputAdornment/InputAdornment.js +5 -9
- 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/OutlinedInput/NotchedOutline.js +12 -16
- package/node/OutlinedInput/OutlinedInput.js +1 -1
- package/node/Radio/RadioButtonIcon.js +2 -6
- package/node/Select/Select.js +10 -1
- package/node/Select/SelectInput.js +31 -13
- package/node/Slider/Slider.js +112 -45
- package/node/StepLabel/StepLabel.js +3 -1
- package/node/SvgIcon/SvgIcon.js +9 -9
- package/node/SwipeableDrawer/SwipeArea.js +1 -3
- package/node/TextField/TextField.js +2 -1
- package/node/Tooltip/Tooltip.js +6 -1
- package/node/index.js +41 -16
- package/node/internal/SwitchBase.js +2 -6
- package/node/useMediaQuery/useMediaQuery.js +68 -26
- package/node/utils/shouldSpreadAdditionalProps.js +15 -0
- package/package.json +7 -7
- package/styles/ThemeProvider.d.ts +1 -1
- 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 +2988 -4926
- package/umd/material-ui.production.min.js +21 -21
- package/useMediaQuery/useMediaQuery.d.ts +4 -0
- package/useMediaQuery/useMediaQuery.js +68 -26
- 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.
|
|
@@ -187,6 +189,11 @@ export interface AutocompleteProps<
|
|
|
187
189
|
* @default <ArrowDropDownIcon />
|
|
188
190
|
*/
|
|
189
191
|
popupIcon?: React.ReactNode;
|
|
192
|
+
/**
|
|
193
|
+
* If `true`, the component becomes readonly. It is also supported for multiple tags where the tag cannot be deleted.
|
|
194
|
+
* @default false
|
|
195
|
+
*/
|
|
196
|
+
readOnly?: boolean;
|
|
190
197
|
/**
|
|
191
198
|
* Render the group.
|
|
192
199
|
*
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
|
|
4
4
|
var _ClearIcon, _ArrowDropDownIcon;
|
|
5
5
|
|
|
6
|
-
const _excluded = ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"];
|
|
6
|
+
const _excluded = ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "readOnly", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import clsx from 'clsx';
|
|
@@ -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,
|
|
@@ -404,6 +404,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
404
404
|
PaperComponent = Paper,
|
|
405
405
|
PopperComponent = Popper,
|
|
406
406
|
popupIcon = _ArrowDropDownIcon || (_ArrowDropDownIcon = /*#__PURE__*/_jsx(ArrowDropDownIcon, {})),
|
|
407
|
+
readOnly = false,
|
|
407
408
|
renderGroup: renderGroupProp,
|
|
408
409
|
renderInput,
|
|
409
410
|
renderOption: renderOptionProp,
|
|
@@ -437,7 +438,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
437
438
|
} = useAutocomplete(_extends({}, props, {
|
|
438
439
|
componentName: 'Autocomplete'
|
|
439
440
|
}));
|
|
440
|
-
const hasClearIcon = !disableClearable && !disabled && dirty;
|
|
441
|
+
const hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
|
|
441
442
|
const hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
|
|
442
443
|
|
|
443
444
|
const ownerState = _extends({}, props, {
|
|
@@ -556,7 +557,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
556
557
|
},
|
|
557
558
|
inputProps: _extends({
|
|
558
559
|
className: clsx(classes.input),
|
|
559
|
-
disabled
|
|
560
|
+
disabled,
|
|
561
|
+
readOnly
|
|
560
562
|
}, getInputProps())
|
|
561
563
|
})
|
|
562
564
|
})), popupOpen && anchorEl ? /*#__PURE__*/_jsx(AutocompletePopper, {
|
|
@@ -570,10 +572,11 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
570
572
|
role: "presentation",
|
|
571
573
|
anchorEl: anchorEl,
|
|
572
574
|
open: true,
|
|
573
|
-
children: /*#__PURE__*/_jsxs(AutocompletePaper, {
|
|
574
|
-
as: PaperComponent,
|
|
575
|
-
className: classes.paper,
|
|
575
|
+
children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
|
|
576
576
|
ownerState: ownerState,
|
|
577
|
+
as: PaperComponent
|
|
578
|
+
}, componentsProps.paper, {
|
|
579
|
+
className: clsx(classes.paper, (_componentsProps$pape = componentsProps.paper) == null ? void 0 : _componentsProps$pape.className),
|
|
577
580
|
children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
|
|
578
581
|
className: classes.loading,
|
|
579
582
|
ownerState: ownerState,
|
|
@@ -604,7 +607,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
604
607
|
return renderListOption(option, index);
|
|
605
608
|
})
|
|
606
609
|
})) : null]
|
|
607
|
-
})
|
|
610
|
+
}))
|
|
608
611
|
}) : null]
|
|
609
612
|
});
|
|
610
613
|
});
|
|
@@ -674,7 +677,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
674
677
|
* If `true`, the input's text is cleared on blur if no value is selected.
|
|
675
678
|
*
|
|
676
679
|
* 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
|
|
680
|
+
* Set to `false` if you want to help the user resume their search.
|
|
678
681
|
* @default !props.freeSolo
|
|
679
682
|
*/
|
|
680
683
|
clearOnBlur: PropTypes.bool,
|
|
@@ -705,7 +708,10 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
705
708
|
* The props used for each slot inside.
|
|
706
709
|
* @default {}
|
|
707
710
|
*/
|
|
708
|
-
componentsProps: PropTypes.
|
|
711
|
+
componentsProps: PropTypes.shape({
|
|
712
|
+
clearIndicator: PropTypes.object,
|
|
713
|
+
paper: PropTypes.object
|
|
714
|
+
}),
|
|
709
715
|
|
|
710
716
|
/**
|
|
711
717
|
* The default value. Use when the component is not controlled.
|
|
@@ -993,6 +999,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
993
999
|
*/
|
|
994
1000
|
popupIcon: PropTypes.node,
|
|
995
1001
|
|
|
1002
|
+
/**
|
|
1003
|
+
* If `true`, the component becomes readonly. It is also supported for multiple tags where the tag cannot be deleted.
|
|
1004
|
+
* @default false
|
|
1005
|
+
*/
|
|
1006
|
+
readOnly: PropTypes.bool,
|
|
1007
|
+
|
|
996
1008
|
/**
|
|
997
1009
|
* Render the group.
|
|
998
1010
|
*
|
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.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.
|
|
@@ -6,9 +6,7 @@ import styled from '../styles/styled';
|
|
|
6
6
|
import MoreHorizIcon from '../internal/svg-icons/MoreHoriz';
|
|
7
7
|
import ButtonBase from '../ButtonBase';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const BreadcrumbCollapsedButton = styled(ButtonBase
|
|
10
|
-
skipSx: true
|
|
11
|
-
})(({
|
|
9
|
+
const BreadcrumbCollapsedButton = styled(ButtonBase)(({
|
|
12
10
|
theme
|
|
13
11
|
}) => _extends({
|
|
14
12
|
display: 'flex',
|
|
@@ -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;
|