@mui/material 5.3.1 → 5.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Autocomplete/Autocomplete.d.ts +5 -0
- package/Autocomplete/Autocomplete.js +11 -3
- package/AvatarGroup/AvatarGroup.d.ts +10 -0
- package/AvatarGroup/AvatarGroup.js +19 -7
- package/Badge/Badge.js +3 -2
- package/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/ButtonBase/ButtonBase.d.ts +5 -1
- package/ButtonBase/ButtonBase.js +15 -2
- package/ButtonBase/TouchRipple.js +1 -2
- package/CHANGELOG.md +295 -27
- package/Dialog/Dialog.d.ts +4 -1
- package/Dialog/Dialog.js +10 -6
- package/Drawer/Drawer.d.ts +4 -1
- package/Drawer/Drawer.js +11 -9
- package/Fab/Fab.d.ts +4 -1
- package/Fab/Fab.js +8 -20
- package/Fab/fabClasses.js +1 -1
- package/Fade/Fade.d.ts +2 -2
- package/Fade/Fade.js +8 -8
- package/FormControlLabel/FormControlLabel.js +11 -3
- package/FormControlLabel/formControlLabelClasses.d.ts +2 -0
- package/FormControlLabel/formControlLabelClasses.js +1 -1
- package/FormGroup/FormGroup.js +14 -3
- package/FormGroup/formGroupClasses.d.ts +2 -0
- package/FormGroup/formGroupClasses.js +1 -1
- package/FormHelperText/FormHelperText.js +7 -9
- package/Grid/Grid.js +2 -4
- package/ImageList/ImageList.js +3 -1
- package/InputAdornment/InputAdornment.js +6 -9
- package/Modal/Modal.js +1 -1
- package/OutlinedInput/NotchedOutline.js +14 -16
- package/OutlinedInput/OutlinedInput.js +1 -1
- package/README.md +6 -6
- package/Radio/RadioButtonIcon.js +2 -6
- package/Rating/Rating.js +1 -1
- package/Select/Select.js +19 -7
- package/Select/SelectInput.js +12 -10
- package/Slide/Slide.d.ts +4 -4
- package/Slide/Slide.js +14 -14
- package/Slider/Slider.js +3 -1
- package/Snackbar/Snackbar.d.ts +2 -2
- package/Snackbar/Snackbar.js +12 -9
- package/SpeedDial/SpeedDial.d.ts +2 -2
- package/SpeedDial/SpeedDial.js +9 -7
- package/Step/StepContext.d.ts +20 -0
- package/Step/StepContext.js +10 -2
- package/Step/index.d.ts +3 -0
- package/Step/index.js +3 -1
- package/SwipeableDrawer/SwipeArea.js +1 -3
- package/SwipeableDrawer/SwipeableDrawer.js +8 -6
- package/TextField/TextField.js +1 -1
- package/ToggleButton/ToggleButton.d.ts +15 -0
- package/ToggleButton/ToggleButton.js +8 -2
- package/Zoom/Zoom.d.ts +2 -2
- package/Zoom/Zoom.js +8 -8
- package/index.d.ts +11 -3
- package/index.js +8 -3
- package/internal/SwitchBase.js +2 -6
- package/legacy/Autocomplete/Autocomplete.js +12 -3
- package/legacy/AvatarGroup/AvatarGroup.js +20 -7
- package/legacy/Badge/Badge.js +4 -2
- package/legacy/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/legacy/ButtonBase/ButtonBase.js +15 -2
- package/legacy/ButtonBase/TouchRipple.js +1 -2
- package/legacy/Dialog/Dialog.js +10 -6
- package/legacy/Drawer/Drawer.js +11 -9
- package/legacy/Fab/Fab.js +8 -20
- package/legacy/Fab/fabClasses.js +1 -1
- package/legacy/Fade/Fade.js +8 -8
- package/legacy/FormControlLabel/FormControlLabel.js +11 -3
- package/legacy/FormControlLabel/formControlLabelClasses.js +1 -1
- package/legacy/FormGroup/FormGroup.js +14 -3
- package/legacy/FormGroup/formGroupClasses.js +1 -1
- package/legacy/FormHelperText/FormHelperText.js +7 -9
- package/legacy/Grid/Grid.js +2 -4
- package/legacy/ImageList/ImageList.js +3 -1
- package/legacy/InputAdornment/InputAdornment.js +6 -9
- package/legacy/Modal/Modal.js +1 -1
- package/legacy/OutlinedInput/NotchedOutline.js +14 -16
- package/legacy/OutlinedInput/OutlinedInput.js +1 -1
- package/legacy/Radio/RadioButtonIcon.js +2 -6
- package/legacy/Rating/Rating.js +1 -1
- package/legacy/Select/Select.js +23 -7
- package/legacy/Select/SelectInput.js +12 -10
- package/legacy/Slide/Slide.js +14 -14
- package/legacy/Slider/Slider.js +3 -1
- package/legacy/Snackbar/Snackbar.js +12 -9
- package/legacy/SpeedDial/SpeedDial.js +9 -7
- package/legacy/Step/StepContext.js +10 -2
- package/legacy/Step/index.js +3 -1
- package/legacy/SwipeableDrawer/SwipeArea.js +1 -3
- package/legacy/SwipeableDrawer/SwipeableDrawer.js +8 -6
- package/legacy/TextField/TextField.js +1 -1
- package/legacy/ToggleButton/ToggleButton.js +8 -2
- package/legacy/Zoom/Zoom.js +8 -8
- package/legacy/index.js +8 -3
- package/legacy/internal/SwitchBase.js +2 -6
- package/legacy/locale/index.js +86 -78
- 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/locale/index.js +12 -6
- package/modern/Autocomplete/Autocomplete.js +11 -3
- package/modern/AvatarGroup/AvatarGroup.js +17 -7
- package/modern/Badge/Badge.js +3 -2
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/modern/ButtonBase/ButtonBase.js +15 -2
- package/modern/ButtonBase/TouchRipple.js +1 -2
- package/modern/Dialog/Dialog.js +10 -6
- package/modern/Drawer/Drawer.js +11 -9
- package/modern/Fab/Fab.js +8 -20
- package/modern/Fab/fabClasses.js +1 -1
- package/modern/Fade/Fade.js +8 -8
- package/modern/FormControlLabel/FormControlLabel.js +11 -3
- package/modern/FormControlLabel/formControlLabelClasses.js +1 -1
- package/modern/FormGroup/FormGroup.js +14 -3
- package/modern/FormGroup/formGroupClasses.js +1 -1
- package/modern/FormHelperText/FormHelperText.js +7 -9
- package/modern/Grid/Grid.js +2 -4
- package/modern/ImageList/ImageList.js +3 -1
- package/modern/InputAdornment/InputAdornment.js +6 -9
- package/modern/Modal/Modal.js +1 -1
- package/modern/OutlinedInput/NotchedOutline.js +14 -16
- package/modern/OutlinedInput/OutlinedInput.js +1 -1
- package/modern/Radio/RadioButtonIcon.js +2 -6
- package/modern/Rating/Rating.js +1 -1
- package/modern/Select/Select.js +19 -7
- package/modern/Select/SelectInput.js +12 -10
- package/modern/Slide/Slide.js +14 -14
- package/modern/Slider/Slider.js +3 -1
- package/modern/Snackbar/Snackbar.js +12 -9
- package/modern/SpeedDial/SpeedDial.js +9 -7
- package/modern/Step/StepContext.js +10 -2
- package/modern/Step/index.js +3 -1
- package/modern/SwipeableDrawer/SwipeArea.js +1 -3
- package/modern/SwipeableDrawer/SwipeableDrawer.js +8 -6
- package/modern/TextField/TextField.js +1 -1
- package/modern/ToggleButton/ToggleButton.js +8 -2
- package/modern/Zoom/Zoom.js +8 -8
- package/modern/index.js +8 -3
- package/modern/internal/SwitchBase.js +2 -6
- package/modern/locale/index.js +12 -6
- package/modern/styles/makeStyles.js +1 -1
- package/modern/styles/withStyles.js +1 -1
- package/modern/styles/withTheme.js +1 -1
- package/modern/useMediaQuery/useMediaQuery.js +69 -27
- package/node/Autocomplete/Autocomplete.js +11 -3
- package/node/AvatarGroup/AvatarGroup.js +19 -7
- package/node/Badge/Badge.js +3 -2
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/node/ButtonBase/ButtonBase.js +15 -2
- package/node/ButtonBase/TouchRipple.js +1 -2
- package/node/Dialog/Dialog.js +11 -7
- package/node/Drawer/Drawer.js +11 -10
- package/node/Fab/Fab.js +8 -20
- package/node/Fab/fabClasses.js +1 -1
- package/node/Fade/Fade.js +7 -9
- package/node/FormControlLabel/FormControlLabel.js +12 -3
- package/node/FormControlLabel/formControlLabelClasses.js +1 -1
- package/node/FormGroup/FormGroup.js +15 -3
- package/node/FormGroup/formGroupClasses.js +1 -1
- package/node/FormHelperText/FormHelperText.js +6 -9
- package/node/Grid/Grid.js +2 -4
- package/node/ImageList/ImageList.js +3 -1
- package/node/InputAdornment/InputAdornment.js +5 -9
- package/node/Modal/Modal.js +1 -1
- package/node/OutlinedInput/NotchedOutline.js +12 -16
- package/node/OutlinedInput/OutlinedInput.js +1 -1
- package/node/Radio/RadioButtonIcon.js +2 -6
- package/node/Rating/Rating.js +1 -1
- package/node/Select/Select.js +22 -9
- package/node/Select/SelectInput.js +11 -10
- package/node/Slide/Slide.js +14 -16
- package/node/Slider/Slider.js +3 -1
- package/node/Snackbar/Snackbar.js +12 -10
- package/node/SpeedDial/SpeedDial.js +9 -7
- package/node/Step/StepContext.js +11 -1
- package/node/Step/index.js +22 -1
- package/node/SwipeableDrawer/SwipeArea.js +1 -3
- package/node/SwipeableDrawer/SwipeableDrawer.js +8 -7
- package/node/TextField/TextField.js +1 -1
- package/node/ToggleButton/ToggleButton.js +8 -2
- package/node/Zoom/Zoom.js +7 -9
- package/node/index.js +62 -16
- package/node/internal/SwitchBase.js +2 -6
- package/node/locale/index.js +12 -6
- package/node/styles/makeStyles.js +1 -1
- package/node/styles/withStyles.js +1 -1
- package/node/styles/withTheme.js +1 -1
- package/node/useMediaQuery/useMediaQuery.js +69 -27
- package/package.json +8 -8
- package/styles/ThemeProvider.d.ts +1 -1
- package/styles/index.d.ts +3 -0
- package/styles/makeStyles.js +1 -1
- package/styles/withStyles.js +1 -1
- package/styles/withTheme.js +1 -1
- package/umd/material-ui.development.js +5022 -7146
- package/umd/material-ui.production.min.js +21 -21
- package/useMediaQuery/useMediaQuery.d.ts +4 -0
- package/useMediaQuery/useMediaQuery.js +69 -27
|
@@ -189,6 +189,11 @@ export interface AutocompleteProps<
|
|
|
189
189
|
* @default <ArrowDropDownIcon />
|
|
190
190
|
*/
|
|
191
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;
|
|
192
197
|
/**
|
|
193
198
|
* Render the group.
|
|
194
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';
|
|
@@ -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, {
|
|
@@ -997,6 +999,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
997
999
|
*/
|
|
998
1000
|
popupIcon: PropTypes.node,
|
|
999
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
|
+
|
|
1000
1008
|
/**
|
|
1001
1009
|
* Render the group.
|
|
1002
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
|
@@ -171,7 +171,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
171
171
|
componentsProps = {},
|
|
172
172
|
overlap: overlapProp = 'rectangular',
|
|
173
173
|
color: colorProp = 'default',
|
|
174
|
-
invisible: invisibleProp,
|
|
174
|
+
invisible: invisibleProp = false,
|
|
175
175
|
badgeContent: badgeContentProp,
|
|
176
176
|
showZero = false,
|
|
177
177
|
variant: variantProp = 'standard'
|
|
@@ -185,7 +185,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
185
185
|
});
|
|
186
186
|
let invisible = invisibleProp;
|
|
187
187
|
|
|
188
|
-
if (invisibleProp
|
|
188
|
+
if (invisibleProp === false && (badgeContentProp === 0 && !showZero || badgeContentProp == null && variantProp !== 'dot')) {
|
|
189
189
|
invisible = true;
|
|
190
190
|
}
|
|
191
191
|
|
|
@@ -303,6 +303,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
303
303
|
|
|
304
304
|
/**
|
|
305
305
|
* If `true`, the badge is invisible.
|
|
306
|
+
* @default false
|
|
306
307
|
*/
|
|
307
308
|
invisible: PropTypes.bool,
|
|
308
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',
|
|
@@ -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 `TouchRipple` 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 `TouchRipple` 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
|
*/
|