@mui/material 5.2.8 → 5.4.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 +7 -0
- package/Autocomplete/Autocomplete.js +20 -10
- package/AvatarGroup/AvatarGroup.d.ts +10 -0
- package/AvatarGroup/AvatarGroup.js +19 -7
- package/Badge/Badge.js +5 -8
- 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 +308 -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 +9 -9
- package/Radio/RadioButtonIcon.js +2 -6
- package/Rating/Rating.js +1 -1
- package/Select/Select.d.ts +9 -1
- package/Select/Select.js +10 -1
- package/Select/SelectInput.d.ts +1 -0
- package/Select/SelectInput.js +37 -14
- package/Slider/Slider.js +112 -55
- 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/index.d.ts +8 -3
- package/index.js +6 -3
- package/internal/SwitchBase.js +2 -6
- package/legacy/Autocomplete/Autocomplete.js +21 -10
- package/legacy/AvatarGroup/AvatarGroup.js +20 -7
- package/legacy/Badge/Badge.js +6 -8
- 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 +11 -1
- package/legacy/Select/SelectInput.js +41 -17
- package/legacy/Slider/Slider.js +113 -56
- 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/index.js +6 -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/legacy/utils/shouldSpreadAdditionalProps.js +7 -0
- package/modern/Autocomplete/Autocomplete.js +19 -9
- package/modern/AvatarGroup/AvatarGroup.js +17 -7
- package/modern/Badge/Badge.js +5 -8
- 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 +10 -1
- package/modern/Select/SelectInput.js +37 -14
- package/modern/Slider/Slider.js +112 -55
- 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/index.js +6 -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/modern/utils/shouldSpreadAdditionalProps.js +7 -0
- package/node/Autocomplete/Autocomplete.js +20 -10
- package/node/AvatarGroup/AvatarGroup.js +19 -7
- package/node/Badge/Badge.js +7 -9
- 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 +10 -1
- package/node/Select/SelectInput.js +36 -14
- package/node/Slider/Slider.js +98 -47
- 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/index.js +41 -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/node/utils/shouldSpreadAdditionalProps.js +15 -0
- package/package.json +10 -10
- package/styles/ThemeProvider.d.ts +1 -1
- package/styles/components.d.ts +452 -113
- package/styles/createTheme.d.ts +12 -6
- package/styles/makeStyles.js +1 -1
- package/styles/overrides.d.ts +16 -4
- package/styles/useThemeProps.d.ts +2 -1
- package/styles/withStyles.js +1 -1
- package/styles/withTheme.js +1 -1
- package/umd/material-ui.development.js +5099 -7092
- package/umd/material-ui.production.min.js +21 -21
- package/useMediaQuery/useMediaQuery.d.ts +4 -0
- package/useMediaQuery/useMediaQuery.js +69 -27
- 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,
|
|
@@ -706,7 +709,8 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
706
709
|
* @default {}
|
|
707
710
|
*/
|
|
708
711
|
componentsProps: PropTypes.shape({
|
|
709
|
-
clearIndicator: PropTypes.object
|
|
712
|
+
clearIndicator: PropTypes.object,
|
|
713
|
+
paper: PropTypes.object
|
|
710
714
|
}),
|
|
711
715
|
|
|
712
716
|
/**
|
|
@@ -995,6 +999,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
995
999
|
*/
|
|
996
1000
|
popupIcon: PropTypes.node,
|
|
997
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
|
+
|
|
998
1008
|
/**
|
|
999
1009
|
* Render the group.
|
|
1000
1010
|
*
|
|
@@ -3,9 +3,11 @@ import { InternalStandardProps as StandardProps, Theme } from '@mui/material';
|
|
|
3
3
|
import { OverridableStringUnion } from '@mui/types';
|
|
4
4
|
import { SxProps } from '@mui/system';
|
|
5
5
|
import { AvatarGroupClasses } from './avatarGroupClasses';
|
|
6
|
+
import Avatar from '../Avatar';
|
|
6
7
|
|
|
7
8
|
export interface AvatarGroupPropsVariantOverrides {}
|
|
8
9
|
|
|
10
|
+
export interface AvatarGroupComponentsPropsOverrides {}
|
|
9
11
|
export interface AvatarGroupProps extends StandardProps<React.HTMLAttributes<HTMLDivElement>> {
|
|
10
12
|
/**
|
|
11
13
|
* The avatars to stack.
|
|
@@ -15,6 +17,14 @@ export interface AvatarGroupProps extends StandardProps<React.HTMLAttributes<HTM
|
|
|
15
17
|
* Override or extend the styles applied to the component.
|
|
16
18
|
*/
|
|
17
19
|
classes?: Partial<AvatarGroupClasses>;
|
|
20
|
+
/**
|
|
21
|
+
* The props used for each slot inside the AvatarGroup.
|
|
22
|
+
* @default {}
|
|
23
|
+
*/
|
|
24
|
+
componentsProps?: {
|
|
25
|
+
additionalAvatar?: React.ComponentPropsWithRef<typeof Avatar> &
|
|
26
|
+
AvatarGroupComponentsPropsOverrides;
|
|
27
|
+
};
|
|
18
28
|
/**
|
|
19
29
|
* Max avatars to show before +x.
|
|
20
30
|
* @default 5
|
|
@@ -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", "max", "spacing", "total", "variant"];
|
|
3
|
+
const _excluded = ["children", "className", "componentsProps", "max", "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,6 +63,8 @@ const AvatarGroupAvatar = styled(Avatar, {
|
|
|
63
63
|
}
|
|
64
64
|
}));
|
|
65
65
|
const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, ref) {
|
|
66
|
+
var _componentsProps$addi, _componentsProps$addi2;
|
|
67
|
+
|
|
66
68
|
const props = useThemeProps({
|
|
67
69
|
props: inProps,
|
|
68
70
|
name: 'MuiAvatarGroup'
|
|
@@ -71,6 +73,7 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
71
73
|
const {
|
|
72
74
|
children: childrenProp,
|
|
73
75
|
className,
|
|
76
|
+
componentsProps = {},
|
|
74
77
|
max = 5,
|
|
75
78
|
spacing = 'medium',
|
|
76
79
|
total,
|
|
@@ -111,15 +114,16 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
111
114
|
className: clsx(classes.root, className),
|
|
112
115
|
ref: ref
|
|
113
116
|
}, other, {
|
|
114
|
-
children: [extraAvatars ? /*#__PURE__*/_jsxs(AvatarGroupAvatar, {
|
|
117
|
+
children: [extraAvatars ? /*#__PURE__*/_jsxs(AvatarGroupAvatar, _extends({
|
|
115
118
|
ownerState: ownerState,
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
variant: variant
|
|
120
|
+
}, componentsProps.additionalAvatar, {
|
|
121
|
+
className: clsx(classes.avatar, (_componentsProps$addi = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi.className),
|
|
122
|
+
style: _extends({
|
|
118
123
|
marginLeft
|
|
119
|
-
},
|
|
120
|
-
variant: variant,
|
|
124
|
+
}, (_componentsProps$addi2 = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi2.style),
|
|
121
125
|
children: ["+", extraAvatars]
|
|
122
|
-
}) : null, children.slice(0, maxAvatars).reverse().map(child => {
|
|
126
|
+
})) : null, children.slice(0, maxAvatars).reverse().map(child => {
|
|
123
127
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
124
128
|
className: clsx(child.props.className, classes.avatar),
|
|
125
129
|
style: _extends({
|
|
@@ -153,6 +157,14 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
|
|
|
153
157
|
*/
|
|
154
158
|
className: PropTypes.string,
|
|
155
159
|
|
|
160
|
+
/**
|
|
161
|
+
* The props used for each slot inside the AvatarGroup.
|
|
162
|
+
* @default {}
|
|
163
|
+
*/
|
|
164
|
+
componentsProps: PropTypes.shape({
|
|
165
|
+
additionalAvatar: PropTypes.object
|
|
166
|
+
}),
|
|
167
|
+
|
|
156
168
|
/**
|
|
157
169
|
* Max avatars to show before +x.
|
|
158
170
|
* @default 5
|
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
|
|
|
@@ -175,7 +171,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
175
171
|
componentsProps = {},
|
|
176
172
|
overlap: overlapProp = 'rectangular',
|
|
177
173
|
color: colorProp = 'default',
|
|
178
|
-
invisible: invisibleProp,
|
|
174
|
+
invisible: invisibleProp = false,
|
|
179
175
|
badgeContent: badgeContentProp,
|
|
180
176
|
showZero = false,
|
|
181
177
|
variant: variantProp = 'standard'
|
|
@@ -189,7 +185,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
189
185
|
});
|
|
190
186
|
let invisible = invisibleProp;
|
|
191
187
|
|
|
192
|
-
if (invisibleProp
|
|
188
|
+
if (invisibleProp === false && (badgeContentProp === 0 && !showZero || badgeContentProp == null && variantProp !== 'dot')) {
|
|
193
189
|
invisible = true;
|
|
194
190
|
}
|
|
195
191
|
|
|
@@ -307,6 +303,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
307
303
|
|
|
308
304
|
/**
|
|
309
305
|
* If `true`, the badge is invisible.
|
|
306
|
+
* @default false
|
|
310
307
|
*/
|
|
311
308
|
invisible: PropTypes.bool,
|
|
312
309
|
|
|
@@ -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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
3
|
import { Theme } from '../styles';
|
|
4
|
-
import { TouchRippleProps } from './TouchRipple';
|
|
4
|
+
import { TouchRippleActions, TouchRippleProps } from './TouchRipple';
|
|
5
5
|
import { OverrideProps, OverridableComponent, OverridableTypeMap } from '../OverridableComponent';
|
|
6
6
|
import { ButtonBaseClasses } from './buttonBaseClasses';
|
|
7
7
|
|
|
@@ -80,6 +80,10 @@ export interface ButtonBaseTypeMap<P = {}, D extends React.ElementType = 'button
|
|
|
80
80
|
* Props applied to the `TouchRipple` element.
|
|
81
81
|
*/
|
|
82
82
|
TouchRippleProps?: Partial<TouchRippleProps>;
|
|
83
|
+
/**
|
|
84
|
+
* A ref that points to the `TouchRippple` element.
|
|
85
|
+
*/
|
|
86
|
+
touchRippleRef?: React.Ref<TouchRippleActions>;
|
|
83
87
|
};
|
|
84
88
|
defaultComponent: D;
|
|
85
89
|
}
|
package/ButtonBase/ButtonBase.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "type"];
|
|
3
|
+
const _excluded = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "touchRippleRef", "type"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -118,12 +118,14 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
118
118
|
onTouchStart,
|
|
119
119
|
tabIndex = 0,
|
|
120
120
|
TouchRippleProps,
|
|
121
|
+
touchRippleRef,
|
|
121
122
|
type
|
|
122
123
|
} = props,
|
|
123
124
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
124
125
|
|
|
125
126
|
const buttonRef = React.useRef(null);
|
|
126
127
|
const rippleRef = React.useRef(null);
|
|
128
|
+
const handleRippleRef = useForkRef(rippleRef, touchRippleRef);
|
|
127
129
|
const {
|
|
128
130
|
isFocusVisibleRef,
|
|
129
131
|
onFocus: handleFocusVisible,
|
|
@@ -343,7 +345,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
343
345
|
|
|
344
346
|
/* TouchRipple is only needed client-side, x2 boost on the server. */
|
|
345
347
|
_jsx(TouchRipple, _extends({
|
|
346
|
-
ref:
|
|
348
|
+
ref: handleRippleRef,
|
|
347
349
|
center: centerRipple
|
|
348
350
|
}, TouchRippleProps)) : null]
|
|
349
351
|
}));
|
|
@@ -526,6 +528,17 @@ process.env.NODE_ENV !== "production" ? ButtonBase.propTypes
|
|
|
526
528
|
*/
|
|
527
529
|
TouchRippleProps: PropTypes.object,
|
|
528
530
|
|
|
531
|
+
/**
|
|
532
|
+
* A ref that points to the `TouchRippple` element.
|
|
533
|
+
*/
|
|
534
|
+
touchRippleRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
535
|
+
current: PropTypes.shape({
|
|
536
|
+
pulsate: PropTypes.func.isRequired,
|
|
537
|
+
start: PropTypes.func.isRequired,
|
|
538
|
+
stop: PropTypes.func.isRequired
|
|
539
|
+
})
|
|
540
|
+
})]),
|
|
541
|
+
|
|
529
542
|
/**
|
|
530
543
|
* @ignore
|
|
531
544
|
*/
|