@mui/material 5.10.11 → 5.10.13
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/Alert/Alert.d.ts +34 -3
- package/Alert/Alert.js +46 -9
- package/Autocomplete/Autocomplete.d.ts +10 -0
- package/Autocomplete/Autocomplete.js +27 -11
- package/AvatarGroup/AvatarGroup.d.ts +18 -1
- package/AvatarGroup/AvatarGroup.js +25 -6
- package/Backdrop/Backdrop.d.ts +33 -3
- package/Backdrop/Backdrop.js +46 -11
- package/Badge/Badge.d.ts +11 -3
- package/Badge/Badge.js +11 -3
- package/ButtonBase/TouchRipple.js +1 -1
- package/CHANGELOG.md +134 -0
- package/Chip/Chip.js +8 -4
- package/FilledInput/FilledInput.js +48 -9
- package/FormControl/FormControl.js +29 -29
- package/FormControlLabel/FormControlLabel.d.ts +12 -0
- package/FormControlLabel/FormControlLabel.js +17 -5
- package/Input/Input.js +49 -10
- package/InputBase/InputBase.d.ts +34 -3
- package/InputBase/InputBase.js +45 -8
- package/ListItem/ListItem.d.ts +32 -3
- package/ListItem/ListItem.js +43 -11
- package/ListItemButton/ListItemButton.js +2 -2
- package/MenuItem/MenuItem.js +2 -2
- package/Modal/Modal.d.ts +11 -3
- package/Modal/Modal.js +11 -3
- package/NativeSelect/NativeSelectInput.js +11 -9
- package/OutlinedInput/OutlinedInput.js +26 -8
- package/PaginationItem/PaginationItem.d.ts +19 -7
- package/PaginationItem/PaginationItem.js +31 -22
- package/README.md +1 -0
- package/Radio/Radio.js +2 -1
- package/RadioGroup/RadioGroup.js +12 -12
- package/Select/Select.d.ts +3 -3
- package/Select/Select.js +3 -3
- package/Slider/Slider.d.ts +14 -2
- package/Slider/Slider.js +12 -3
- package/StepLabel/StepLabel.d.ts +11 -0
- package/StepLabel/StepLabel.js +15 -3
- package/SwipeableDrawer/SwipeableDrawer.js +10 -2
- package/Tooltip/Tooltip.d.ts +43 -6
- package/Tooltip/Tooltip.js +69 -32
- package/Unstable_Grid2/Grid2Props.d.ts +1 -1
- package/esm/Alert/Alert.js +46 -9
- package/esm/Autocomplete/Autocomplete.js +27 -11
- package/esm/AvatarGroup/AvatarGroup.js +25 -6
- package/esm/Backdrop/Backdrop.js +46 -11
- package/esm/Badge/Badge.js +11 -3
- package/esm/ButtonBase/TouchRipple.js +1 -1
- package/esm/Chip/Chip.js +8 -4
- package/esm/FilledInput/FilledInput.js +48 -9
- package/esm/FormControl/FormControl.js +29 -29
- package/esm/FormControlLabel/FormControlLabel.js +17 -5
- package/esm/Input/Input.js +49 -10
- package/esm/InputBase/InputBase.js +45 -8
- package/esm/ListItem/ListItem.js +43 -11
- package/esm/ListItemButton/ListItemButton.js +2 -2
- package/esm/MenuItem/MenuItem.js +2 -2
- package/esm/Modal/Modal.js +11 -3
- package/esm/NativeSelect/NativeSelectInput.js +11 -9
- package/esm/OutlinedInput/OutlinedInput.js +26 -8
- package/esm/PaginationItem/PaginationItem.js +31 -22
- package/esm/Radio/Radio.js +2 -1
- package/esm/RadioGroup/RadioGroup.js +12 -12
- package/esm/Select/Select.js +3 -3
- package/esm/Slider/Slider.js +12 -3
- package/esm/StepLabel/StepLabel.js +15 -3
- package/esm/SwipeableDrawer/SwipeableDrawer.js +9 -2
- package/esm/Tooltip/Tooltip.js +69 -32
- package/index.js +1 -1
- package/legacy/Alert/Alert.js +48 -9
- package/legacy/Autocomplete/Autocomplete.js +27 -10
- package/legacy/AvatarGroup/AvatarGroup.js +26 -6
- package/legacy/Backdrop/Backdrop.js +48 -11
- package/legacy/Badge/Badge.js +11 -3
- package/legacy/ButtonBase/TouchRipple.js +1 -1
- package/legacy/Chip/Chip.js +8 -4
- package/legacy/FilledInput/FilledInput.js +49 -9
- package/legacy/FormControl/FormControl.js +29 -29
- package/legacy/FormControlLabel/FormControlLabel.js +17 -4
- package/legacy/Input/Input.js +50 -10
- package/legacy/InputBase/InputBase.js +47 -8
- package/legacy/ListItem/ListItem.js +49 -13
- package/legacy/ListItemButton/ListItemButton.js +7 -5
- package/legacy/MenuItem/MenuItem.js +6 -4
- package/legacy/Modal/Modal.js +11 -3
- package/legacy/NativeSelect/NativeSelectInput.js +11 -9
- package/legacy/OutlinedInput/OutlinedInput.js +27 -8
- package/legacy/PaginationItem/PaginationItem.js +32 -22
- package/legacy/Radio/Radio.js +2 -1
- package/legacy/RadioGroup/RadioGroup.js +14 -14
- package/legacy/Select/Select.js +3 -3
- package/legacy/Slider/Slider.js +12 -3
- package/legacy/StepLabel/StepLabel.js +16 -3
- package/legacy/SwipeableDrawer/SwipeableDrawer.js +9 -2
- package/legacy/Tooltip/Tooltip.js +64 -23
- package/legacy/index.js +1 -1
- package/modern/Alert/Alert.js +45 -8
- package/modern/Autocomplete/Autocomplete.js +26 -10
- package/modern/AvatarGroup/AvatarGroup.js +24 -5
- package/modern/Backdrop/Backdrop.js +45 -10
- package/modern/Badge/Badge.js +11 -3
- package/modern/ButtonBase/TouchRipple.js +1 -1
- package/modern/Chip/Chip.js +8 -4
- package/modern/FilledInput/FilledInput.js +46 -9
- package/modern/FormControl/FormControl.js +29 -29
- package/modern/FormControlLabel/FormControlLabel.js +15 -5
- package/modern/Input/Input.js +47 -10
- package/modern/InputBase/InputBase.js +43 -8
- package/modern/ListItem/ListItem.js +43 -11
- package/modern/ListItemButton/ListItemButton.js +2 -2
- package/modern/MenuItem/MenuItem.js +2 -2
- package/modern/Modal/Modal.js +11 -3
- package/modern/NativeSelect/NativeSelectInput.js +11 -9
- package/modern/OutlinedInput/OutlinedInput.js +25 -7
- package/modern/PaginationItem/PaginationItem.js +31 -22
- package/modern/Radio/Radio.js +2 -1
- package/modern/RadioGroup/RadioGroup.js +12 -12
- package/modern/Select/Select.js +3 -3
- package/modern/Slider/Slider.js +12 -3
- package/modern/StepLabel/StepLabel.js +13 -3
- package/modern/SwipeableDrawer/SwipeableDrawer.js +9 -2
- package/modern/Tooltip/Tooltip.js +59 -18
- package/modern/index.js +1 -1
- package/package.json +4 -4
- package/umd/material-ui.development.js +617 -234
- package/umd/material-ui.production.min.js +20 -20
|
@@ -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", "readOnly", "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", "slotProps", "value"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import clsx from 'clsx';
|
|
@@ -353,7 +353,7 @@ const AutocompleteGroupUl = styled('ul', {
|
|
|
353
353
|
});
|
|
354
354
|
export { createFilterOptions };
|
|
355
355
|
const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps, ref) {
|
|
356
|
-
var
|
|
356
|
+
var _slotProps$clearIndic, _slotProps$paper, _slotProps$popper, _slotProps$popupIndic;
|
|
357
357
|
|
|
358
358
|
const props = useThemeProps({
|
|
359
359
|
props: inProps,
|
|
@@ -414,7 +414,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
414
414
|
renderOption: renderOptionProp,
|
|
415
415
|
renderTags,
|
|
416
416
|
selectOnFocus = !props.freeSolo,
|
|
417
|
-
size = 'medium'
|
|
417
|
+
size = 'medium',
|
|
418
|
+
slotProps = {}
|
|
418
419
|
} = props,
|
|
419
420
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
420
421
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -523,6 +524,10 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
523
524
|
});
|
|
524
525
|
};
|
|
525
526
|
|
|
527
|
+
const clearIndicatorSlotProps = (_slotProps$clearIndic = slotProps.clearIndicator) != null ? _slotProps$clearIndic : componentsProps.clearIndicator;
|
|
528
|
+
const paperSlotProps = (_slotProps$paper = slotProps.paper) != null ? _slotProps$paper : componentsProps.paper;
|
|
529
|
+
const popperSlotProps = (_slotProps$popper = slotProps.popper) != null ? _slotProps$popper : componentsProps.popper;
|
|
530
|
+
const popupIndicatorSlotProps = (_slotProps$popupIndic = slotProps.popupIndicator) != null ? _slotProps$popupIndic : componentsProps.popupIndicator;
|
|
526
531
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
527
532
|
children: [/*#__PURE__*/_jsx(AutocompleteRoot, _extends({
|
|
528
533
|
ref: ref,
|
|
@@ -547,16 +552,16 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
547
552
|
"aria-label": clearText,
|
|
548
553
|
title: clearText,
|
|
549
554
|
ownerState: ownerState
|
|
550
|
-
},
|
|
551
|
-
className: clsx(classes.clearIndicator,
|
|
555
|
+
}, clearIndicatorSlotProps, {
|
|
556
|
+
className: clsx(classes.clearIndicator, clearIndicatorSlotProps == null ? void 0 : clearIndicatorSlotProps.className),
|
|
552
557
|
children: clearIcon
|
|
553
558
|
})) : null, hasPopupIcon ? /*#__PURE__*/_jsx(AutocompletePopupIndicator, _extends({}, getPopupIndicatorProps(), {
|
|
554
559
|
disabled: disabled,
|
|
555
560
|
"aria-label": popupOpen ? closeText : openText,
|
|
556
561
|
title: popupOpen ? closeText : openText,
|
|
557
562
|
ownerState: ownerState
|
|
558
|
-
},
|
|
559
|
-
className: clsx(classes.popupIndicator,
|
|
563
|
+
}, popupIndicatorSlotProps, {
|
|
564
|
+
className: clsx(classes.popupIndicator, popupIndicatorSlotProps == null ? void 0 : popupIndicatorSlotProps.className),
|
|
560
565
|
children: popupIcon
|
|
561
566
|
})) : null]
|
|
562
567
|
})
|
|
@@ -577,13 +582,13 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
577
582
|
role: "presentation",
|
|
578
583
|
anchorEl: anchorEl,
|
|
579
584
|
open: popupOpen
|
|
580
|
-
},
|
|
581
|
-
className: clsx(classes.popper,
|
|
585
|
+
}, popperSlotProps, {
|
|
586
|
+
className: clsx(classes.popper, popperSlotProps == null ? void 0 : popperSlotProps.className),
|
|
582
587
|
children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
|
|
583
588
|
ownerState: ownerState,
|
|
584
589
|
as: PaperComponent
|
|
585
|
-
},
|
|
586
|
-
className: clsx(classes.paper,
|
|
590
|
+
}, paperSlotProps, {
|
|
591
|
+
className: clsx(classes.paper, paperSlotProps == null ? void 0 : paperSlotProps.className),
|
|
587
592
|
children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
|
|
588
593
|
className: classes.loading,
|
|
589
594
|
ownerState: ownerState,
|
|
@@ -1067,6 +1072,17 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
1067
1072
|
/* @typescript-to-proptypes-ignore */
|
|
1068
1073
|
.oneOfType([PropTypes.oneOf(['small', 'medium']), PropTypes.string]),
|
|
1069
1074
|
|
|
1075
|
+
/**
|
|
1076
|
+
* The props used for each slot inside.
|
|
1077
|
+
* @default {}
|
|
1078
|
+
*/
|
|
1079
|
+
slotProps: PropTypes.shape({
|
|
1080
|
+
clearIndicator: PropTypes.object,
|
|
1081
|
+
paper: PropTypes.object,
|
|
1082
|
+
popper: PropTypes.object,
|
|
1083
|
+
popupIndicator: PropTypes.object
|
|
1084
|
+
}),
|
|
1085
|
+
|
|
1070
1086
|
/**
|
|
1071
1087
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1072
1088
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["children", "className", "component", "componentsProps", "max", "spacing", "total", "variant"];
|
|
3
|
+
const _excluded = ["children", "className", "component", "componentsProps", "max", "slotProps", "spacing", "total", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { isFragment } from 'react-is';
|
|
@@ -63,7 +63,7 @@ const AvatarGroupAvatar = styled(Avatar, {
|
|
|
63
63
|
}
|
|
64
64
|
}));
|
|
65
65
|
const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, ref) {
|
|
66
|
-
var
|
|
66
|
+
var _slotProps$additional;
|
|
67
67
|
|
|
68
68
|
const props = useThemeProps({
|
|
69
69
|
props: inProps,
|
|
@@ -76,6 +76,7 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
76
76
|
component = 'div',
|
|
77
77
|
componentsProps = {},
|
|
78
78
|
max = 5,
|
|
79
|
+
slotProps = {},
|
|
79
80
|
spacing = 'medium',
|
|
80
81
|
total,
|
|
81
82
|
variant = 'circular'
|
|
@@ -111,6 +112,7 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
111
112
|
const maxAvatars = Math.min(children.length, clampedMax - 1);
|
|
112
113
|
const extraAvatars = Math.max(totalAvatars - clampedMax, totalAvatars - maxAvatars, 0);
|
|
113
114
|
const marginLeft = spacing && SPACINGS[spacing] !== undefined ? SPACINGS[spacing] : -spacing;
|
|
115
|
+
const additionalAvatarSlotProps = (_slotProps$additional = slotProps.additionalAvatar) != null ? _slotProps$additional : componentsProps.additionalAvatar;
|
|
114
116
|
return /*#__PURE__*/_jsxs(AvatarGroupRoot, _extends({
|
|
115
117
|
as: component,
|
|
116
118
|
ownerState: ownerState,
|
|
@@ -120,11 +122,11 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
120
122
|
children: [extraAvatars ? /*#__PURE__*/_jsxs(AvatarGroupAvatar, _extends({
|
|
121
123
|
ownerState: ownerState,
|
|
122
124
|
variant: variant
|
|
123
|
-
},
|
|
124
|
-
className: clsx(classes.avatar,
|
|
125
|
+
}, additionalAvatarSlotProps, {
|
|
126
|
+
className: clsx(classes.avatar, additionalAvatarSlotProps == null ? void 0 : additionalAvatarSlotProps.className),
|
|
125
127
|
style: _extends({
|
|
126
128
|
marginLeft
|
|
127
|
-
},
|
|
129
|
+
}, additionalAvatarSlotProps == null ? void 0 : additionalAvatarSlotProps.style),
|
|
128
130
|
children: ["+", extraAvatars]
|
|
129
131
|
})) : null, children.slice(0, maxAvatars).reverse().map((child, index) => {
|
|
130
132
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
@@ -169,7 +171,12 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
|
|
|
169
171
|
component: PropTypes.elementType,
|
|
170
172
|
|
|
171
173
|
/**
|
|
172
|
-
* The props
|
|
174
|
+
* The extra props for the slot components.
|
|
175
|
+
* You can override the existing props or add new ones.
|
|
176
|
+
*
|
|
177
|
+
* This prop is an alias for the `slotProps` prop.
|
|
178
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
179
|
+
*
|
|
173
180
|
* @default {}
|
|
174
181
|
*/
|
|
175
182
|
componentsProps: PropTypes.shape({
|
|
@@ -188,6 +195,18 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
|
|
|
188
195
|
return null;
|
|
189
196
|
}),
|
|
190
197
|
|
|
198
|
+
/**
|
|
199
|
+
* The extra props for the slot components.
|
|
200
|
+
* You can override the existing props or add new ones.
|
|
201
|
+
*
|
|
202
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
203
|
+
*
|
|
204
|
+
* @default {}
|
|
205
|
+
*/
|
|
206
|
+
slotProps: PropTypes.shape({
|
|
207
|
+
additionalAvatar: PropTypes.object
|
|
208
|
+
}),
|
|
209
|
+
|
|
191
210
|
/**
|
|
192
211
|
* Spacing between avatars.
|
|
193
212
|
* @default 'medium'
|
package/esm/Backdrop/Backdrop.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["children", "component", "components", "componentsProps", "className", "invisible", "open", "transitionDuration", "TransitionComponent"];
|
|
3
|
+
const _excluded = ["children", "component", "components", "componentsProps", "className", "invisible", "open", "slotProps", "slots", "transitionDuration", "TransitionComponent"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -48,7 +48,7 @@ const BackdropRoot = styled('div', {
|
|
|
48
48
|
backgroundColor: 'transparent'
|
|
49
49
|
}));
|
|
50
50
|
const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
|
|
51
|
-
var
|
|
51
|
+
var _slotProps$root, _ref, _slots$root;
|
|
52
52
|
|
|
53
53
|
const props = useThemeProps({
|
|
54
54
|
props: inProps,
|
|
@@ -63,6 +63,8 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
|
|
|
63
63
|
className,
|
|
64
64
|
invisible = false,
|
|
65
65
|
open,
|
|
66
|
+
slotProps = {},
|
|
67
|
+
slots = {},
|
|
66
68
|
transitionDuration,
|
|
67
69
|
// eslint-disable-next-line react/prop-types
|
|
68
70
|
TransitionComponent = Fade
|
|
@@ -75,19 +77,21 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
|
|
|
75
77
|
});
|
|
76
78
|
|
|
77
79
|
const classes = useUtilityClasses(ownerState);
|
|
80
|
+
const rootSlotProps = (_slotProps$root = slotProps.root) != null ? _slotProps$root : componentsProps.root;
|
|
78
81
|
return /*#__PURE__*/_jsx(TransitionComponent, _extends({
|
|
79
82
|
in: open,
|
|
80
83
|
timeout: transitionDuration
|
|
81
84
|
}, other, {
|
|
82
|
-
children: /*#__PURE__*/_jsx(BackdropRoot, {
|
|
83
|
-
"aria-hidden": true
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
children: /*#__PURE__*/_jsx(BackdropRoot, _extends({
|
|
86
|
+
"aria-hidden": true
|
|
87
|
+
}, rootSlotProps, {
|
|
88
|
+
as: (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : component,
|
|
89
|
+
className: clsx(classes.root, className, rootSlotProps == null ? void 0 : rootSlotProps.className),
|
|
90
|
+
ownerState: _extends({}, ownerState, rootSlotProps == null ? void 0 : rootSlotProps.ownerState),
|
|
87
91
|
classes: classes,
|
|
88
92
|
ref: ref,
|
|
89
93
|
children: children
|
|
90
|
-
})
|
|
94
|
+
}))
|
|
91
95
|
}));
|
|
92
96
|
});
|
|
93
97
|
process.env.NODE_ENV !== "production" ? Backdrop.propTypes
|
|
@@ -120,8 +124,11 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
|
|
|
120
124
|
component: PropTypes.elementType,
|
|
121
125
|
|
|
122
126
|
/**
|
|
123
|
-
* The components used for each slot inside
|
|
124
|
-
*
|
|
127
|
+
* The components used for each slot inside.
|
|
128
|
+
*
|
|
129
|
+
* This prop is an alias for the `slots` prop.
|
|
130
|
+
* It's recommended to use the `slots` prop instead.
|
|
131
|
+
*
|
|
125
132
|
* @default {}
|
|
126
133
|
*/
|
|
127
134
|
components: PropTypes.shape({
|
|
@@ -129,7 +136,12 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
|
|
|
129
136
|
}),
|
|
130
137
|
|
|
131
138
|
/**
|
|
132
|
-
* The props
|
|
139
|
+
* The extra props for the slot components.
|
|
140
|
+
* You can override the existing props or add new ones.
|
|
141
|
+
*
|
|
142
|
+
* This prop is an alias for the `slotProps` prop.
|
|
143
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
144
|
+
*
|
|
133
145
|
* @default {}
|
|
134
146
|
*/
|
|
135
147
|
componentsProps: PropTypes.shape({
|
|
@@ -148,6 +160,29 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
|
|
|
148
160
|
*/
|
|
149
161
|
open: PropTypes.bool.isRequired,
|
|
150
162
|
|
|
163
|
+
/**
|
|
164
|
+
* The extra props for the slot components.
|
|
165
|
+
* You can override the existing props or add new ones.
|
|
166
|
+
*
|
|
167
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
168
|
+
*
|
|
169
|
+
* @default {}
|
|
170
|
+
*/
|
|
171
|
+
slotProps: PropTypes.shape({
|
|
172
|
+
root: PropTypes.object
|
|
173
|
+
}),
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The components used for each slot inside.
|
|
177
|
+
*
|
|
178
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
179
|
+
*
|
|
180
|
+
* @default {}
|
|
181
|
+
*/
|
|
182
|
+
slots: PropTypes.shape({
|
|
183
|
+
root: PropTypes.elementType
|
|
184
|
+
}),
|
|
185
|
+
|
|
151
186
|
/**
|
|
152
187
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
153
188
|
*/
|
package/esm/Badge/Badge.js
CHANGED
|
@@ -316,8 +316,11 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
316
316
|
component: PropTypes.elementType,
|
|
317
317
|
|
|
318
318
|
/**
|
|
319
|
-
* The components used for each slot inside
|
|
320
|
-
*
|
|
319
|
+
* The components used for each slot inside.
|
|
320
|
+
*
|
|
321
|
+
* This prop is an alias for the `slots` prop.
|
|
322
|
+
* It's recommended to use the `slots` prop instead.
|
|
323
|
+
*
|
|
321
324
|
* @default {}
|
|
322
325
|
*/
|
|
323
326
|
components: PropTypes.shape({
|
|
@@ -326,7 +329,12 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
326
329
|
}),
|
|
327
330
|
|
|
328
331
|
/**
|
|
329
|
-
* The props
|
|
332
|
+
* The extra props for the slot components.
|
|
333
|
+
* You can override the existing props or add new ones.
|
|
334
|
+
*
|
|
335
|
+
* This prop is an alias for the `slotProps` prop.
|
|
336
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
337
|
+
*
|
|
330
338
|
* @default {}
|
|
331
339
|
*/
|
|
332
340
|
componentsProps: PropTypes.shape({
|
|
@@ -191,7 +191,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
|
|
|
191
191
|
nextKey.current += 1;
|
|
192
192
|
rippleCallback.current = cb;
|
|
193
193
|
}, [classes]);
|
|
194
|
-
const start = React.useCallback((event = {}, options = {}, cb) => {
|
|
194
|
+
const start = React.useCallback((event = {}, options = {}, cb = () => {}) => {
|
|
195
195
|
const {
|
|
196
196
|
pulsate = false,
|
|
197
197
|
center = centerProp || options.pulsate,
|
package/esm/Chip/Chip.js
CHANGED
|
@@ -23,6 +23,7 @@ const useUtilityClasses = ownerState => {
|
|
|
23
23
|
disabled,
|
|
24
24
|
size,
|
|
25
25
|
color,
|
|
26
|
+
iconColor,
|
|
26
27
|
onDelete,
|
|
27
28
|
clickable,
|
|
28
29
|
variant
|
|
@@ -31,7 +32,7 @@ const useUtilityClasses = ownerState => {
|
|
|
31
32
|
root: ['root', variant, disabled && 'disabled', `size${capitalize(size)}`, `color${capitalize(color)}`, clickable && 'clickable', clickable && `clickableColor${capitalize(color)}`, onDelete && 'deletable', onDelete && `deletableColor${capitalize(color)}`, `${variant}${capitalize(color)}`],
|
|
32
33
|
label: ['label', `label${capitalize(size)}`],
|
|
33
34
|
avatar: ['avatar', `avatar${capitalize(size)}`, `avatarColor${capitalize(color)}`],
|
|
34
|
-
icon: ['icon', `icon${capitalize(size)}`, `iconColor${capitalize(
|
|
35
|
+
icon: ['icon', `icon${capitalize(size)}`, `iconColor${capitalize(iconColor)}`],
|
|
35
36
|
deleteIcon: ['deleteIcon', `deleteIcon${capitalize(size)}`, `deleteIconColor${capitalize(color)}`, `deleteIcon${capitalize(variant)}Color${capitalize(color)}`]
|
|
36
37
|
};
|
|
37
38
|
return composeClasses(slots, getChipUtilityClass, classes);
|
|
@@ -46,6 +47,7 @@ const ChipRoot = styled('div', {
|
|
|
46
47
|
} = props;
|
|
47
48
|
const {
|
|
48
49
|
color,
|
|
50
|
+
iconColor,
|
|
49
51
|
clickable,
|
|
50
52
|
onDelete,
|
|
51
53
|
size,
|
|
@@ -62,7 +64,7 @@ const ChipRoot = styled('div', {
|
|
|
62
64
|
}, {
|
|
63
65
|
[`& .${chipClasses.icon}`]: styles[`icon${capitalize(size)}`]
|
|
64
66
|
}, {
|
|
65
|
-
[`& .${chipClasses.icon}`]: styles[`iconColor${capitalize(
|
|
67
|
+
[`& .${chipClasses.icon}`]: styles[`iconColor${capitalize(iconColor)}`]
|
|
66
68
|
}, {
|
|
67
69
|
[`& .${chipClasses.deleteIcon}`]: styles.deleteIcon
|
|
68
70
|
}, {
|
|
@@ -131,16 +133,17 @@ const ChipRoot = styled('div', {
|
|
|
131
133
|
fontSize: theme.typography.pxToRem(10)
|
|
132
134
|
},
|
|
133
135
|
[`& .${chipClasses.icon}`]: _extends({
|
|
134
|
-
color: theme.vars ? theme.vars.palette.Chip.defaultIconColor : textColor,
|
|
135
136
|
marginLeft: 5,
|
|
136
137
|
marginRight: -6
|
|
137
138
|
}, ownerState.size === 'small' && {
|
|
138
139
|
fontSize: 18,
|
|
139
140
|
marginLeft: 4,
|
|
140
141
|
marginRight: -4
|
|
142
|
+
}, ownerState.iconColor === ownerState.color && _extends({
|
|
143
|
+
color: theme.vars ? theme.vars.palette.Chip.defaultIconColor : textColor
|
|
141
144
|
}, ownerState.color !== 'default' && {
|
|
142
145
|
color: 'inherit'
|
|
143
|
-
}),
|
|
146
|
+
})),
|
|
144
147
|
[`& .${chipClasses.deleteIcon}`]: _extends({
|
|
145
148
|
WebkitTapHighlightColor: 'transparent',
|
|
146
149
|
color: theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / 0.26)` : deleteIconColor,
|
|
@@ -346,6 +349,7 @@ const Chip = /*#__PURE__*/React.forwardRef(function Chip(inProps, ref) {
|
|
|
346
349
|
disabled,
|
|
347
350
|
size,
|
|
348
351
|
color,
|
|
352
|
+
iconColor: /*#__PURE__*/React.isValidElement(iconProp) ? iconProp.props.color || color : color,
|
|
349
353
|
onDelete: !!onDelete,
|
|
350
354
|
clickable,
|
|
351
355
|
variant
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "type"];
|
|
3
|
+
const _excluded = ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "slotProps", "slots", "type"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { refType, deepmerge } from '@mui/utils';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -181,6 +181,8 @@ const FilledInputInput = styled(InputBaseInput, {
|
|
|
181
181
|
paddingBottom: 9
|
|
182
182
|
}));
|
|
183
183
|
const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps, ref) {
|
|
184
|
+
var _ref, _slots$root, _ref2, _slots$input;
|
|
185
|
+
|
|
184
186
|
const props = useThemeProps({
|
|
185
187
|
props: inProps,
|
|
186
188
|
name: 'MuiFilledInput'
|
|
@@ -193,6 +195,8 @@ const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps,
|
|
|
193
195
|
// declare here to prevent spreading to DOM
|
|
194
196
|
inputComponent = 'input',
|
|
195
197
|
multiline = false,
|
|
198
|
+
slotProps,
|
|
199
|
+
slots = {},
|
|
196
200
|
type = 'text'
|
|
197
201
|
} = props,
|
|
198
202
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -213,12 +217,14 @@ const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps,
|
|
|
213
217
|
ownerState
|
|
214
218
|
}
|
|
215
219
|
};
|
|
216
|
-
const componentsProps = componentsPropsProp ? deepmerge(componentsPropsProp, filledInputComponentsProps) : filledInputComponentsProps;
|
|
220
|
+
const componentsProps = (slotProps != null ? slotProps : componentsPropsProp) ? deepmerge(slotProps != null ? slotProps : componentsPropsProp, filledInputComponentsProps) : filledInputComponentsProps;
|
|
221
|
+
const RootSlot = (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : FilledInputRoot;
|
|
222
|
+
const InputSlot = (_ref2 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref2 : FilledInputInput;
|
|
217
223
|
return /*#__PURE__*/_jsx(InputBase, _extends({
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
},
|
|
224
|
+
slots: {
|
|
225
|
+
root: RootSlot,
|
|
226
|
+
input: InputSlot
|
|
227
|
+
},
|
|
222
228
|
componentsProps: componentsProps,
|
|
223
229
|
fullWidth: fullWidth,
|
|
224
230
|
inputComponent: inputComponent,
|
|
@@ -265,8 +271,11 @@ process.env.NODE_ENV !== "production" ? FilledInput.propTypes
|
|
|
265
271
|
.oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
|
|
266
272
|
|
|
267
273
|
/**
|
|
268
|
-
* The components used for each slot inside
|
|
269
|
-
*
|
|
274
|
+
* The components used for each slot inside.
|
|
275
|
+
*
|
|
276
|
+
* This prop is an alias for the `slots` prop.
|
|
277
|
+
* It's recommended to use the `slots` prop instead.
|
|
278
|
+
*
|
|
270
279
|
* @default {}
|
|
271
280
|
*/
|
|
272
281
|
components: PropTypes.shape({
|
|
@@ -275,7 +284,12 @@ process.env.NODE_ENV !== "production" ? FilledInput.propTypes
|
|
|
275
284
|
}),
|
|
276
285
|
|
|
277
286
|
/**
|
|
278
|
-
* The props
|
|
287
|
+
* The extra props for the slot components.
|
|
288
|
+
* You can override the existing props or add new ones.
|
|
289
|
+
*
|
|
290
|
+
* This prop is an alias for the `slotProps` prop.
|
|
291
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
292
|
+
*
|
|
279
293
|
* @default {}
|
|
280
294
|
*/
|
|
281
295
|
componentsProps: PropTypes.shape({
|
|
@@ -405,6 +419,31 @@ process.env.NODE_ENV !== "production" ? FilledInput.propTypes
|
|
|
405
419
|
*/
|
|
406
420
|
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
407
421
|
|
|
422
|
+
/**
|
|
423
|
+
* The extra props for the slot components.
|
|
424
|
+
* You can override the existing props or add new ones.
|
|
425
|
+
*
|
|
426
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
427
|
+
*
|
|
428
|
+
* @default {}
|
|
429
|
+
*/
|
|
430
|
+
slotProps: PropTypes.shape({
|
|
431
|
+
input: PropTypes.object,
|
|
432
|
+
root: PropTypes.object
|
|
433
|
+
}),
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* The components used for each slot inside.
|
|
437
|
+
*
|
|
438
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
439
|
+
*
|
|
440
|
+
* @default {}
|
|
441
|
+
*/
|
|
442
|
+
slots: PropTypes.shape({
|
|
443
|
+
input: PropTypes.elementType,
|
|
444
|
+
root: PropTypes.elementType
|
|
445
|
+
}),
|
|
446
|
+
|
|
408
447
|
/**
|
|
409
448
|
* Start `InputAdornment` for this component.
|
|
410
449
|
*/
|
|
@@ -182,35 +182,35 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
};
|
|
185
|
+
const childContext = React.useMemo(() => {
|
|
186
|
+
return {
|
|
187
|
+
adornedStart,
|
|
188
|
+
setAdornedStart,
|
|
189
|
+
color,
|
|
190
|
+
disabled,
|
|
191
|
+
error,
|
|
192
|
+
filled,
|
|
193
|
+
focused,
|
|
194
|
+
fullWidth,
|
|
195
|
+
hiddenLabel,
|
|
196
|
+
size,
|
|
197
|
+
onBlur: () => {
|
|
198
|
+
setFocused(false);
|
|
199
|
+
},
|
|
200
|
+
onEmpty: () => {
|
|
201
|
+
setFilled(false);
|
|
202
|
+
},
|
|
203
|
+
onFilled: () => {
|
|
204
|
+
setFilled(true);
|
|
205
|
+
},
|
|
206
|
+
onFocus: () => {
|
|
207
|
+
setFocused(true);
|
|
208
|
+
},
|
|
209
|
+
registerEffect,
|
|
210
|
+
required,
|
|
211
|
+
variant
|
|
212
|
+
};
|
|
213
|
+
}, [adornedStart, color, disabled, error, filled, focused, fullWidth, hiddenLabel, registerEffect, required, size, variant]);
|
|
214
214
|
return /*#__PURE__*/_jsx(FormControlContext.Provider, {
|
|
215
215
|
value: childContext,
|
|
216
216
|
children: /*#__PURE__*/_jsx(FormControlRoot, _extends({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "value"];
|
|
3
|
+
const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "slotProps", "value"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -81,6 +81,8 @@ export const FormControlLabelRoot = styled('label', {
|
|
|
81
81
|
*/
|
|
82
82
|
|
|
83
83
|
const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel(inProps, ref) {
|
|
84
|
+
var _slotProps$typography;
|
|
85
|
+
|
|
84
86
|
const props = useThemeProps({
|
|
85
87
|
props: inProps,
|
|
86
88
|
name: 'MuiFormControlLabel'
|
|
@@ -93,7 +95,8 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
93
95
|
disabled: disabledProp,
|
|
94
96
|
disableTypography,
|
|
95
97
|
label: labelProp,
|
|
96
|
-
labelPlacement = 'end'
|
|
98
|
+
labelPlacement = 'end',
|
|
99
|
+
slotProps = {}
|
|
97
100
|
} = props,
|
|
98
101
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
99
102
|
|
|
@@ -129,13 +132,14 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
129
132
|
});
|
|
130
133
|
|
|
131
134
|
const classes = useUtilityClasses(ownerState);
|
|
135
|
+
const typographySlotProps = (_slotProps$typography = slotProps.typography) != null ? _slotProps$typography : componentsProps.typography;
|
|
132
136
|
let label = labelProp;
|
|
133
137
|
|
|
134
138
|
if (label != null && label.type !== Typography && !disableTypography) {
|
|
135
139
|
label = /*#__PURE__*/_jsx(Typography, _extends({
|
|
136
|
-
component: "span"
|
|
137
|
-
|
|
138
|
-
|
|
140
|
+
component: "span"
|
|
141
|
+
}, typographySlotProps, {
|
|
142
|
+
className: clsx(classes.label, typographySlotProps == null ? void 0 : typographySlotProps.className),
|
|
139
143
|
children: label
|
|
140
144
|
}));
|
|
141
145
|
}
|
|
@@ -223,6 +227,14 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes
|
|
|
223
227
|
*/
|
|
224
228
|
onChange: PropTypes.func,
|
|
225
229
|
|
|
230
|
+
/**
|
|
231
|
+
* The props used for each slot inside.
|
|
232
|
+
* @default {}
|
|
233
|
+
*/
|
|
234
|
+
slotProps: PropTypes.shape({
|
|
235
|
+
typography: PropTypes.object
|
|
236
|
+
}),
|
|
237
|
+
|
|
226
238
|
/**
|
|
227
239
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
228
240
|
*/
|