@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
package/Slider/Slider.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["components", "componentsProps", "color", "size"];
|
|
3
|
+
const _excluded = ["component", "components", "componentsProps", "color", "size"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { chainPropTypes } from '@mui/utils';
|
|
8
|
-
import { generateUtilityClasses
|
|
8
|
+
import { generateUtilityClasses } from '@mui/base';
|
|
9
9
|
import SliderUnstyled, { SliderValueLabelUnstyled, sliderUnstyledClasses, getSliderUtilityClass } from '@mui/base/SliderUnstyled';
|
|
10
10
|
import { alpha, lighten, darken } from '@mui/system';
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
12
|
import styled, { slotShouldForwardProp } from '../styles/styled';
|
|
13
13
|
import useTheme from '../styles/useTheme';
|
|
14
|
+
import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
|
|
14
15
|
import capitalize from '../utils/capitalize';
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
17
|
export const sliderClasses = _extends({}, sliderUnstyledClasses, generateUtilityClasses('MuiSlider', ['colorPrimary', 'colorSecondary', 'thumbColorPrimary', 'thumbColorSecondary', 'sizeSmall', 'thumbSizeSmall']));
|
|
17
|
-
|
|
18
|
+
const SliderRoot = styled('span', {
|
|
18
19
|
name: 'MuiSlider',
|
|
19
20
|
slot: 'Root',
|
|
20
21
|
overridesResolver: (props, styles) => {
|
|
@@ -80,7 +81,21 @@ export const SliderRoot = styled('span', {
|
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
}));
|
|
83
|
-
|
|
84
|
+
process.env.NODE_ENV !== "production" ? SliderRoot.propTypes
|
|
85
|
+
/* remove-proptypes */
|
|
86
|
+
= {
|
|
87
|
+
// ----------------------------- Warning --------------------------------
|
|
88
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
89
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
90
|
+
// ----------------------------------------------------------------------
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @ignore
|
|
94
|
+
*/
|
|
95
|
+
children: PropTypes.node
|
|
96
|
+
} : void 0;
|
|
97
|
+
export { SliderRoot };
|
|
98
|
+
const SliderRail = styled('span', {
|
|
84
99
|
name: 'MuiSlider',
|
|
85
100
|
slot: 'Rail',
|
|
86
101
|
overridesResolver: (props, styles) => styles.rail
|
|
@@ -105,7 +120,21 @@ export const SliderRail = styled('span', {
|
|
|
105
120
|
}, ownerState.track === 'inverted' && {
|
|
106
121
|
opacity: 1
|
|
107
122
|
}));
|
|
108
|
-
|
|
123
|
+
process.env.NODE_ENV !== "production" ? SliderRail.propTypes
|
|
124
|
+
/* remove-proptypes */
|
|
125
|
+
= {
|
|
126
|
+
// ----------------------------- Warning --------------------------------
|
|
127
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
128
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
129
|
+
// ----------------------------------------------------------------------
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* @ignore
|
|
133
|
+
*/
|
|
134
|
+
children: PropTypes.node
|
|
135
|
+
} : void 0;
|
|
136
|
+
export { SliderRail };
|
|
137
|
+
const SliderTrack = styled('span', {
|
|
109
138
|
name: 'MuiSlider',
|
|
110
139
|
slot: 'Track',
|
|
111
140
|
overridesResolver: (props, styles) => styles.track
|
|
@@ -141,7 +170,21 @@ export const SliderTrack = styled('span', {
|
|
|
141
170
|
borderColor: color
|
|
142
171
|
});
|
|
143
172
|
});
|
|
144
|
-
|
|
173
|
+
process.env.NODE_ENV !== "production" ? SliderTrack.propTypes
|
|
174
|
+
/* remove-proptypes */
|
|
175
|
+
= {
|
|
176
|
+
// ----------------------------- Warning --------------------------------
|
|
177
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
178
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
179
|
+
// ----------------------------------------------------------------------
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @ignore
|
|
183
|
+
*/
|
|
184
|
+
children: PropTypes.node
|
|
185
|
+
} : void 0;
|
|
186
|
+
export { SliderTrack };
|
|
187
|
+
const SliderThumb = styled('span', {
|
|
145
188
|
name: 'MuiSlider',
|
|
146
189
|
slot: 'Thumb',
|
|
147
190
|
overridesResolver: (props, styles) => {
|
|
@@ -213,7 +256,21 @@ export const SliderThumb = styled('span', {
|
|
|
213
256
|
}
|
|
214
257
|
}
|
|
215
258
|
}));
|
|
216
|
-
|
|
259
|
+
process.env.NODE_ENV !== "production" ? SliderThumb.propTypes
|
|
260
|
+
/* remove-proptypes */
|
|
261
|
+
= {
|
|
262
|
+
// ----------------------------- Warning --------------------------------
|
|
263
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
264
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
265
|
+
// ----------------------------------------------------------------------
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @ignore
|
|
269
|
+
*/
|
|
270
|
+
children: PropTypes.node
|
|
271
|
+
} : void 0;
|
|
272
|
+
export { SliderThumb };
|
|
273
|
+
const SliderValueLabel = styled(SliderValueLabelUnstyled, {
|
|
217
274
|
name: 'MuiSlider',
|
|
218
275
|
slot: 'ValueLabel',
|
|
219
276
|
overridesResolver: (props, styles) => styles.valueLabel
|
|
@@ -257,7 +314,21 @@ export const SliderValueLabel = styled(SliderValueLabelUnstyled, {
|
|
|
257
314
|
backgroundColor: 'inherit'
|
|
258
315
|
}
|
|
259
316
|
}));
|
|
260
|
-
|
|
317
|
+
process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes
|
|
318
|
+
/* remove-proptypes */
|
|
319
|
+
= {
|
|
320
|
+
// ----------------------------- Warning --------------------------------
|
|
321
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
322
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
323
|
+
// ----------------------------------------------------------------------
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* @ignore
|
|
327
|
+
*/
|
|
328
|
+
children: PropTypes.node
|
|
329
|
+
} : void 0;
|
|
330
|
+
export { SliderValueLabel };
|
|
331
|
+
const SliderMark = styled('span', {
|
|
261
332
|
name: 'MuiSlider',
|
|
262
333
|
slot: 'Mark',
|
|
263
334
|
shouldForwardProp: prop => slotShouldForwardProp(prop) && prop !== 'markActive',
|
|
@@ -282,7 +353,21 @@ export const SliderMark = styled('span', {
|
|
|
282
353
|
backgroundColor: theme.palette.background.paper,
|
|
283
354
|
opacity: 0.8
|
|
284
355
|
}));
|
|
285
|
-
|
|
356
|
+
process.env.NODE_ENV !== "production" ? SliderMark.propTypes
|
|
357
|
+
/* remove-proptypes */
|
|
358
|
+
= {
|
|
359
|
+
// ----------------------------- Warning --------------------------------
|
|
360
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
361
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
362
|
+
// ----------------------------------------------------------------------
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* @ignore
|
|
366
|
+
*/
|
|
367
|
+
children: PropTypes.node
|
|
368
|
+
} : void 0;
|
|
369
|
+
export { SliderMark };
|
|
370
|
+
const SliderMarkLabel = styled('span', {
|
|
286
371
|
name: 'MuiSlider',
|
|
287
372
|
slot: 'MarkLabel',
|
|
288
373
|
shouldForwardProp: prop => slotShouldForwardProp(prop) && prop !== 'markLabelActive',
|
|
@@ -310,7 +395,9 @@ export const SliderMarkLabel = styled('span', {
|
|
|
310
395
|
}, markLabelActive && {
|
|
311
396
|
color: theme.palette.text.primary
|
|
312
397
|
}));
|
|
313
|
-
|
|
398
|
+
process.env.NODE_ENV !== "production" ? SliderMarkLabel.propTypes
|
|
399
|
+
/* remove-proptypes */
|
|
400
|
+
= {
|
|
314
401
|
// ----------------------------- Warning --------------------------------
|
|
315
402
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
316
403
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
@@ -319,40 +406,9 @@ SliderRoot.propTypes = {
|
|
|
319
406
|
/**
|
|
320
407
|
* @ignore
|
|
321
408
|
*/
|
|
322
|
-
children: PropTypes.node
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
* @ignore
|
|
326
|
-
*/
|
|
327
|
-
ownerState: PropTypes.shape({
|
|
328
|
-
'aria-label': PropTypes.string,
|
|
329
|
-
'aria-labelledby': PropTypes.string,
|
|
330
|
-
'aria-valuetext': PropTypes.string,
|
|
331
|
-
classes: PropTypes.object,
|
|
332
|
-
color: PropTypes.oneOf(['primary', 'secondary']),
|
|
333
|
-
defaultValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
|
|
334
|
-
disabled: PropTypes.bool,
|
|
335
|
-
getAriaLabel: PropTypes.func,
|
|
336
|
-
getAriaValueText: PropTypes.func,
|
|
337
|
-
isRtl: PropTypes.bool,
|
|
338
|
-
marks: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.shape({
|
|
339
|
-
label: PropTypes.node,
|
|
340
|
-
value: PropTypes.number.isRequired
|
|
341
|
-
})), PropTypes.bool]),
|
|
342
|
-
max: PropTypes.number,
|
|
343
|
-
min: PropTypes.number,
|
|
344
|
-
name: PropTypes.string,
|
|
345
|
-
onChange: PropTypes.func,
|
|
346
|
-
onChangeCommitted: PropTypes.func,
|
|
347
|
-
orientation: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
348
|
-
scale: PropTypes.func,
|
|
349
|
-
step: PropTypes.number,
|
|
350
|
-
track: PropTypes.oneOf(['inverted', 'normal', false]),
|
|
351
|
-
value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
|
|
352
|
-
valueLabelDisplay: PropTypes.oneOf(['auto', 'off', 'on']),
|
|
353
|
-
valueLabelFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
354
|
-
})
|
|
355
|
-
};
|
|
409
|
+
children: PropTypes.node
|
|
410
|
+
} : void 0;
|
|
411
|
+
export { SliderMarkLabel };
|
|
356
412
|
|
|
357
413
|
const extendUtilityClasses = ownerState => {
|
|
358
414
|
const {
|
|
@@ -366,21 +422,19 @@ const extendUtilityClasses = ownerState => {
|
|
|
366
422
|
});
|
|
367
423
|
};
|
|
368
424
|
|
|
369
|
-
const
|
|
370
|
-
return !Component || !isHostComponent(Component);
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
const Slider = /*#__PURE__*/React.forwardRef(function Slider(sliderProps, ref) {
|
|
425
|
+
const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
374
426
|
var _componentsProps$root, _componentsProps$thum, _componentsProps$trac, _componentsProps$valu;
|
|
375
427
|
|
|
376
428
|
const props = useThemeProps({
|
|
377
|
-
props:
|
|
429
|
+
props: inputProps,
|
|
378
430
|
name: 'MuiSlider'
|
|
379
431
|
});
|
|
380
432
|
const theme = useTheme();
|
|
381
433
|
const isRtl = theme.direction === 'rtl';
|
|
382
434
|
|
|
383
435
|
const {
|
|
436
|
+
// eslint-disable-next-line react/prop-types
|
|
437
|
+
component = 'span',
|
|
384
438
|
components = {},
|
|
385
439
|
componentsProps = {},
|
|
386
440
|
color = 'primary',
|
|
@@ -406,25 +460,26 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(sliderProps, ref) {
|
|
|
406
460
|
MarkLabel: SliderMarkLabel
|
|
407
461
|
}, components),
|
|
408
462
|
componentsProps: _extends({}, componentsProps, {
|
|
409
|
-
root: _extends({}, componentsProps.root,
|
|
463
|
+
root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
|
|
464
|
+
as: component,
|
|
410
465
|
ownerState: _extends({}, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.ownerState, {
|
|
411
466
|
color,
|
|
412
467
|
size
|
|
413
468
|
})
|
|
414
469
|
}),
|
|
415
|
-
thumb: _extends({}, componentsProps.thumb,
|
|
470
|
+
thumb: _extends({}, componentsProps.thumb, shouldSpreadAdditionalProps(components.Thumb) && {
|
|
416
471
|
ownerState: _extends({}, (_componentsProps$thum = componentsProps.thumb) == null ? void 0 : _componentsProps$thum.ownerState, {
|
|
417
472
|
color,
|
|
418
473
|
size
|
|
419
474
|
})
|
|
420
475
|
}),
|
|
421
|
-
track: _extends({}, componentsProps.track,
|
|
476
|
+
track: _extends({}, componentsProps.track, shouldSpreadAdditionalProps(components.Track) && {
|
|
422
477
|
ownerState: _extends({}, (_componentsProps$trac = componentsProps.track) == null ? void 0 : _componentsProps$trac.ownerState, {
|
|
423
478
|
color,
|
|
424
479
|
size
|
|
425
480
|
})
|
|
426
481
|
}),
|
|
427
|
-
valueLabel: _extends({}, componentsProps.valueLabel,
|
|
482
|
+
valueLabel: _extends({}, componentsProps.valueLabel, shouldSpreadAdditionalProps(components.ValueLabel) && {
|
|
428
483
|
ownerState: _extends({}, (_componentsProps$valu = componentsProps.valueLabel) == null ? void 0 : _componentsProps$valu.ownerState, {
|
|
429
484
|
color,
|
|
430
485
|
size
|
|
@@ -636,7 +691,9 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
636
691
|
* The size of the slider.
|
|
637
692
|
* @default 'medium'
|
|
638
693
|
*/
|
|
639
|
-
size: PropTypes
|
|
694
|
+
size: PropTypes
|
|
695
|
+
/* @typescript-to-proptypes-ignore */
|
|
696
|
+
.oneOfType([PropTypes.oneOf(['small', 'medium']), PropTypes.string]),
|
|
640
697
|
|
|
641
698
|
/**
|
|
642
699
|
* The granularity with which the slider can step through values. (A "discrete" slider.)
|
package/Snackbar/Snackbar.js
CHANGED
|
@@ -290,7 +290,10 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
290
290
|
onMouseEnter: handleMouseEnter,
|
|
291
291
|
onMouseLeave: handleMouseLeave,
|
|
292
292
|
ownerState: ownerState,
|
|
293
|
-
ref: ref
|
|
293
|
+
ref: ref // ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
|
|
294
|
+
// See https://github.com/mui-org/material-ui/issues/29080
|
|
295
|
+
,
|
|
296
|
+
role: "presentation"
|
|
294
297
|
}, other, {
|
|
295
298
|
children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
|
|
296
299
|
appear: true,
|
package/SvgIcon/SvgIcon.js
CHANGED
|
@@ -37,7 +37,7 @@ const SvgIconRoot = styled('svg', {
|
|
|
37
37
|
theme,
|
|
38
38
|
ownerState
|
|
39
39
|
}) => {
|
|
40
|
-
var _theme$palette$ownerS, _theme$palette$ownerS2;
|
|
40
|
+
var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$transitions2$d, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _theme$palette$ownerS, _theme$palette, _theme$palette$ownerS2, _theme$palette2, _theme$palette2$actio, _theme$palette3, _theme$palette3$actio;
|
|
41
41
|
|
|
42
42
|
return {
|
|
43
43
|
userSelect: 'none',
|
|
@@ -46,19 +46,19 @@ const SvgIconRoot = styled('svg', {
|
|
|
46
46
|
display: 'inline-block',
|
|
47
47
|
fill: 'currentColor',
|
|
48
48
|
flexShrink: 0,
|
|
49
|
-
transition: theme.transitions.create('fill', {
|
|
50
|
-
duration: theme.transitions.duration.shorter
|
|
49
|
+
transition: (_theme$transitions = theme.transitions) == null ? void 0 : (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {
|
|
50
|
+
duration: (_theme$transitions2 = theme.transitions) == null ? void 0 : (_theme$transitions2$d = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2$d.shorter
|
|
51
51
|
}),
|
|
52
52
|
fontSize: {
|
|
53
53
|
inherit: 'inherit',
|
|
54
|
-
small: theme.typography.pxToRem(20),
|
|
55
|
-
medium: theme.typography.pxToRem(24),
|
|
56
|
-
large: theme.typography.pxToRem(35)
|
|
54
|
+
small: ((_theme$typography = theme.typography) == null ? void 0 : (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',
|
|
55
|
+
medium: ((_theme$typography2 = theme.typography) == null ? void 0 : (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',
|
|
56
|
+
large: ((_theme$typography3 = theme.typography) == null ? void 0 : (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875'
|
|
57
57
|
}[ownerState.fontSize],
|
|
58
58
|
// TODO v5 deprecate, v6 remove for sx
|
|
59
|
-
color: (_theme$palette$ownerS = (_theme$palette
|
|
60
|
-
action: theme.palette.action.active,
|
|
61
|
-
disabled: theme.palette.action.disabled,
|
|
59
|
+
color: (_theme$palette$ownerS = (_theme$palette = theme.palette) == null ? void 0 : (_theme$palette$ownerS2 = _theme$palette[ownerState.color]) == null ? void 0 : _theme$palette$ownerS2.main) != null ? _theme$palette$ownerS : {
|
|
60
|
+
action: (_theme$palette2 = theme.palette) == null ? void 0 : (_theme$palette2$actio = _theme$palette2.action) == null ? void 0 : _theme$palette2$actio.active,
|
|
61
|
+
disabled: (_theme$palette3 = theme.palette) == null ? void 0 : (_theme$palette3$actio = _theme$palette3.action) == null ? void 0 : _theme$palette3$actio.disabled,
|
|
62
62
|
inherit: undefined
|
|
63
63
|
}[ownerState.color]
|
|
64
64
|
};
|
|
@@ -8,9 +8,7 @@ import styled from '../styles/styled';
|
|
|
8
8
|
import capitalize from '../utils/capitalize';
|
|
9
9
|
import { isHorizontal } from '../Drawer/Drawer';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
const SwipeAreaRoot = styled('div'
|
|
12
|
-
skipSx: true
|
|
13
|
-
})(({
|
|
11
|
+
const SwipeAreaRoot = styled('div')(({
|
|
14
12
|
theme,
|
|
15
13
|
ownerState
|
|
16
14
|
}) => _extends({
|
package/TextField/TextField.js
CHANGED
|
@@ -191,7 +191,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
191
191
|
variant: variant,
|
|
192
192
|
ownerState: ownerState
|
|
193
193
|
}, other, {
|
|
194
|
-
children: [label && /*#__PURE__*/_jsx(InputLabel, _extends({
|
|
194
|
+
children: [label != null && label !== '' && /*#__PURE__*/_jsx(InputLabel, _extends({
|
|
195
195
|
htmlFor: id,
|
|
196
196
|
id: inputLabelId
|
|
197
197
|
}, InputLabelProps, {
|
package/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export type StandardProps<
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @internal
|
|
26
|
-
* ONLY USE FROM WITHIN mui
|
|
26
|
+
* ONLY USE FROM WITHIN mui/material-ui
|
|
27
27
|
*
|
|
28
28
|
* Internal helper type for conform (describeConformance) components
|
|
29
29
|
* However, we don't declare classes on this type.
|
|
@@ -74,8 +74,6 @@ export * from './styles';
|
|
|
74
74
|
|
|
75
75
|
export * from './utils';
|
|
76
76
|
|
|
77
|
-
export * from '@mui/base';
|
|
78
|
-
|
|
79
77
|
export { default as Accordion } from './Accordion';
|
|
80
78
|
export * from './Accordion';
|
|
81
79
|
|
|
@@ -476,3 +474,10 @@ export * from './GlobalStyles';
|
|
|
476
474
|
* @deprecated will be removed in v5.beta, please use StyledEngineProvider from @mui/material/styles instead
|
|
477
475
|
*/
|
|
478
476
|
export { StyledEngineProvider } from './styles';
|
|
477
|
+
|
|
478
|
+
export { default as unstable_composeClasses } from '@mui/base/composeClasses';
|
|
479
|
+
|
|
480
|
+
export { default as generateUtilityClass } from '@mui/base/generateUtilityClass';
|
|
481
|
+
export * from '@mui/base/generateUtilityClass';
|
|
482
|
+
|
|
483
|
+
export { default as generateUtilityClasses } from '@mui/base/generateUtilityClasses';
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.4.1
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -8,7 +8,6 @@ import * as colors from './colors';
|
|
|
8
8
|
export { colors };
|
|
9
9
|
export * from './styles';
|
|
10
10
|
export * from './utils';
|
|
11
|
-
export * from '@mui/base';
|
|
12
11
|
export { default as Accordion } from './Accordion';
|
|
13
12
|
export * from './Accordion';
|
|
14
13
|
export { default as AccordionActions } from './AccordionActions';
|
|
@@ -273,4 +272,8 @@ export * from './Zoom'; // createFilterOptions is exported from Autocomplete
|
|
|
273
272
|
export { default as useAutocomplete } from './useAutocomplete';
|
|
274
273
|
export { default as GlobalStyles } from './GlobalStyles';
|
|
275
274
|
export * from './GlobalStyles';
|
|
276
|
-
export { StyledEngineProvider } from './styles';
|
|
275
|
+
export { StyledEngineProvider } from './styles';
|
|
276
|
+
export { default as unstable_composeClasses } from '@mui/base/composeClasses';
|
|
277
|
+
export { default as generateUtilityClass } from '@mui/base/generateUtilityClass';
|
|
278
|
+
export * from '@mui/base/generateUtilityClass';
|
|
279
|
+
export { default as generateUtilityClasses } from '@mui/base/generateUtilityClasses';
|
package/internal/SwitchBase.js
CHANGED
|
@@ -29,9 +29,7 @@ const useUtilityClasses = ownerState => {
|
|
|
29
29
|
return composeClasses(slots, getSwitchBaseUtilityClass, classes);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const SwitchBaseRoot = styled(ButtonBase
|
|
33
|
-
skipSx: true
|
|
34
|
-
})(({
|
|
32
|
+
const SwitchBaseRoot = styled(ButtonBase)(({
|
|
35
33
|
ownerState
|
|
36
34
|
}) => _extends({
|
|
37
35
|
padding: 9,
|
|
@@ -41,9 +39,7 @@ const SwitchBaseRoot = styled(ButtonBase, {
|
|
|
41
39
|
}, ownerState.edge === 'end' && {
|
|
42
40
|
marginRight: ownerState.size === 'small' ? -3 : -12
|
|
43
41
|
}));
|
|
44
|
-
const SwitchBaseInput = styled('input'
|
|
45
|
-
skipSx: true
|
|
46
|
-
})({
|
|
42
|
+
const SwitchBaseInput = styled('input')({
|
|
47
43
|
cursor: 'inherit',
|
|
48
44
|
position: 'absolute',
|
|
49
45
|
opacity: 0,
|
|
@@ -316,7 +316,7 @@ var AutocompleteGroupUl = styled('ul', {
|
|
|
316
316
|
}));
|
|
317
317
|
export { createFilterOptions };
|
|
318
318
|
var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps, ref) {
|
|
319
|
-
var _componentsProps$clea;
|
|
319
|
+
var _componentsProps$clea, _componentsProps$pape;
|
|
320
320
|
|
|
321
321
|
var props = useThemeProps({
|
|
322
322
|
props: inProps,
|
|
@@ -420,6 +420,8 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
420
420
|
PopperComponent = _props$PopperComponen === void 0 ? Popper : _props$PopperComponen,
|
|
421
421
|
_props$popupIcon = props.popupIcon,
|
|
422
422
|
popupIcon = _props$popupIcon === void 0 ? _ArrowDropDownIcon || (_ArrowDropDownIcon = /*#__PURE__*/_jsx(ArrowDropDownIcon, {})) : _props$popupIcon,
|
|
423
|
+
_props$readOnly = props.readOnly,
|
|
424
|
+
readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
|
|
423
425
|
renderGroupProp = props.renderGroup,
|
|
424
426
|
renderInput = props.renderInput,
|
|
425
427
|
renderOptionProp = props.renderOption,
|
|
@@ -429,7 +431,7 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
429
431
|
_props$size = props.size,
|
|
430
432
|
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
431
433
|
valueProp = props.value,
|
|
432
|
-
other = _objectWithoutProperties(props, ["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"]);
|
|
434
|
+
other = _objectWithoutProperties(props, ["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"]);
|
|
433
435
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
434
436
|
|
|
435
437
|
|
|
@@ -455,7 +457,7 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
455
457
|
inputValue = _useAutocomplete.inputValue,
|
|
456
458
|
groupedOptions = _useAutocomplete.groupedOptions;
|
|
457
459
|
|
|
458
|
-
var hasClearIcon = !disableClearable && !disabled && dirty;
|
|
460
|
+
var hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
|
|
459
461
|
var hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
|
|
460
462
|
|
|
461
463
|
var ownerState = _extends({}, props, {
|
|
@@ -582,7 +584,8 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
582
584
|
},
|
|
583
585
|
inputProps: _extends({
|
|
584
586
|
className: clsx(classes.input),
|
|
585
|
-
disabled: disabled
|
|
587
|
+
disabled: disabled,
|
|
588
|
+
readOnly: readOnly
|
|
586
589
|
}, getInputProps())
|
|
587
590
|
})
|
|
588
591
|
})), popupOpen && anchorEl ? /*#__PURE__*/_jsx(AutocompletePopper, {
|
|
@@ -596,10 +599,11 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
596
599
|
role: "presentation",
|
|
597
600
|
anchorEl: anchorEl,
|
|
598
601
|
open: true,
|
|
599
|
-
children: /*#__PURE__*/_jsxs(AutocompletePaper, {
|
|
600
|
-
as: PaperComponent,
|
|
601
|
-
className: classes.paper,
|
|
602
|
+
children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
|
|
602
603
|
ownerState: ownerState,
|
|
604
|
+
as: PaperComponent
|
|
605
|
+
}, componentsProps.paper, {
|
|
606
|
+
className: clsx(classes.paper, (_componentsProps$pape = componentsProps.paper) == null ? void 0 : _componentsProps$pape.className),
|
|
603
607
|
children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
|
|
604
608
|
className: classes.loading,
|
|
605
609
|
ownerState: ownerState,
|
|
@@ -632,7 +636,7 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
632
636
|
return renderListOption(option, index);
|
|
633
637
|
})
|
|
634
638
|
})) : null]
|
|
635
|
-
})
|
|
639
|
+
}))
|
|
636
640
|
}) : null]
|
|
637
641
|
});
|
|
638
642
|
});
|
|
@@ -702,7 +706,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
702
706
|
* If `true`, the input's text is cleared on blur if no value is selected.
|
|
703
707
|
*
|
|
704
708
|
* Set to `true` if you want to help the user enter a new value.
|
|
705
|
-
* Set to `false` if you want to help the user resume
|
|
709
|
+
* Set to `false` if you want to help the user resume their search.
|
|
706
710
|
* @default !props.freeSolo
|
|
707
711
|
*/
|
|
708
712
|
clearOnBlur: PropTypes.bool,
|
|
@@ -734,7 +738,8 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
734
738
|
* @default {}
|
|
735
739
|
*/
|
|
736
740
|
componentsProps: PropTypes.shape({
|
|
737
|
-
clearIndicator: PropTypes.object
|
|
741
|
+
clearIndicator: PropTypes.object,
|
|
742
|
+
paper: PropTypes.object
|
|
738
743
|
}),
|
|
739
744
|
|
|
740
745
|
/**
|
|
@@ -1023,6 +1028,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
1023
1028
|
*/
|
|
1024
1029
|
popupIcon: PropTypes.node,
|
|
1025
1030
|
|
|
1031
|
+
/**
|
|
1032
|
+
* If `true`, the component becomes readonly. It is also supported for multiple tags where the tag cannot be deleted.
|
|
1033
|
+
* @default false
|
|
1034
|
+
*/
|
|
1035
|
+
readOnly: PropTypes.bool,
|
|
1036
|
+
|
|
1026
1037
|
/**
|
|
1027
1038
|
* Render the group.
|
|
1028
1039
|
*
|
|
@@ -63,6 +63,8 @@ var AvatarGroupAvatar = styled(Avatar, {
|
|
|
63
63
|
};
|
|
64
64
|
});
|
|
65
65
|
var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, ref) {
|
|
66
|
+
var _componentsProps$addi, _componentsProps$addi2;
|
|
67
|
+
|
|
66
68
|
var props = useThemeProps({
|
|
67
69
|
props: inProps,
|
|
68
70
|
name: 'MuiAvatarGroup'
|
|
@@ -70,6 +72,8 @@ var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, re
|
|
|
70
72
|
|
|
71
73
|
var childrenProp = props.children,
|
|
72
74
|
className = props.className,
|
|
75
|
+
_props$componentsProp = props.componentsProps,
|
|
76
|
+
componentsProps = _props$componentsProp === void 0 ? {} : _props$componentsProp,
|
|
73
77
|
_props$max = props.max,
|
|
74
78
|
max = _props$max === void 0 ? 5 : _props$max,
|
|
75
79
|
_props$spacing = props.spacing,
|
|
@@ -77,7 +81,7 @@ var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, re
|
|
|
77
81
|
total = props.total,
|
|
78
82
|
_props$variant = props.variant,
|
|
79
83
|
variant = _props$variant === void 0 ? 'circular' : _props$variant,
|
|
80
|
-
other = _objectWithoutProperties(props, ["children", "className", "max", "spacing", "total", "variant"]);
|
|
84
|
+
other = _objectWithoutProperties(props, ["children", "className", "componentsProps", "max", "spacing", "total", "variant"]);
|
|
81
85
|
|
|
82
86
|
var clampedMax = max < 2 ? 2 : max;
|
|
83
87
|
|
|
@@ -112,15 +116,16 @@ var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, re
|
|
|
112
116
|
className: clsx(classes.root, className),
|
|
113
117
|
ref: ref
|
|
114
118
|
}, other, {
|
|
115
|
-
children: [extraAvatars ? /*#__PURE__*/_jsxs(AvatarGroupAvatar, {
|
|
119
|
+
children: [extraAvatars ? /*#__PURE__*/_jsxs(AvatarGroupAvatar, _extends({
|
|
116
120
|
ownerState: ownerState,
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
variant: variant
|
|
122
|
+
}, componentsProps.additionalAvatar, {
|
|
123
|
+
className: clsx(classes.avatar, (_componentsProps$addi = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi.className),
|
|
124
|
+
style: _extends({
|
|
119
125
|
marginLeft: marginLeft
|
|
120
|
-
},
|
|
121
|
-
variant: variant,
|
|
126
|
+
}, (_componentsProps$addi2 = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi2.style),
|
|
122
127
|
children: ["+", extraAvatars]
|
|
123
|
-
}) : null, children.slice(0, maxAvatars).reverse().map(function (child) {
|
|
128
|
+
})) : null, children.slice(0, maxAvatars).reverse().map(function (child) {
|
|
124
129
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
125
130
|
className: clsx(child.props.className, classes.avatar),
|
|
126
131
|
style: _extends({
|
|
@@ -154,6 +159,14 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
|
|
|
154
159
|
*/
|
|
155
160
|
className: PropTypes.string,
|
|
156
161
|
|
|
162
|
+
/**
|
|
163
|
+
* The props used for each slot inside the AvatarGroup.
|
|
164
|
+
* @default {}
|
|
165
|
+
*/
|
|
166
|
+
componentsProps: PropTypes.shape({
|
|
167
|
+
additionalAvatar: PropTypes.object
|
|
168
|
+
}),
|
|
169
|
+
|
|
157
170
|
/**
|
|
158
171
|
* Max avatars to show before +x.
|
|
159
172
|
* @default 5
|
package/legacy/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 var badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular', // TODO: v6 remove the overlap value from these class keys
|
|
@@ -144,11 +145,6 @@ var BadgeBadge = styled('span', {
|
|
|
144
145
|
})
|
|
145
146
|
});
|
|
146
147
|
});
|
|
147
|
-
|
|
148
|
-
var shouldSpreadAdditionalProps = function shouldSpreadAdditionalProps(Slot) {
|
|
149
|
-
return !Slot || !isHostComponent(Slot);
|
|
150
|
-
};
|
|
151
|
-
|
|
152
148
|
var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
153
149
|
var _componentsProps$root, _componentsProps$badg;
|
|
154
150
|
|
|
@@ -172,7 +168,8 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
172
168
|
overlapProp = _props$overlap === void 0 ? 'rectangular' : _props$overlap,
|
|
173
169
|
_props$color = props.color,
|
|
174
170
|
colorProp = _props$color === void 0 ? 'default' : _props$color,
|
|
175
|
-
|
|
171
|
+
_props$invisible = props.invisible,
|
|
172
|
+
invisibleProp = _props$invisible === void 0 ? false : _props$invisible,
|
|
176
173
|
badgeContentProp = props.badgeContent,
|
|
177
174
|
_props$showZero = props.showZero,
|
|
178
175
|
showZero = _props$showZero === void 0 ? false : _props$showZero,
|
|
@@ -187,7 +184,7 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
187
184
|
});
|
|
188
185
|
var invisible = invisibleProp;
|
|
189
186
|
|
|
190
|
-
if (invisibleProp
|
|
187
|
+
if (invisibleProp === false && (badgeContentProp === 0 && !showZero || badgeContentProp == null && variantProp !== 'dot')) {
|
|
191
188
|
invisible = true;
|
|
192
189
|
}
|
|
193
190
|
|
|
@@ -307,6 +304,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
307
304
|
|
|
308
305
|
/**
|
|
309
306
|
* If `true`, the badge is invisible.
|
|
307
|
+
* @default false
|
|
310
308
|
*/
|
|
311
309
|
invisible: PropTypes.bool,
|
|
312
310
|
|
|
@@ -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
|
-
var BreadcrumbCollapsedButton = styled(ButtonBase
|
|
10
|
-
skipSx: true
|
|
11
|
-
})(function (_ref) {
|
|
9
|
+
var BreadcrumbCollapsedButton = styled(ButtonBase)(function (_ref) {
|
|
12
10
|
var theme = _ref.theme;
|
|
13
11
|
return _extends({
|
|
14
12
|
display: 'flex',
|