@mui/material 5.2.6 → 5.3.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.
Files changed (98) hide show
  1. package/Autocomplete/Autocomplete.d.ts +2 -0
  2. package/Autocomplete/Autocomplete.js +11 -7
  3. package/Avatar/Avatar.d.ts +3 -1
  4. package/Backdrop/Backdrop.js +3 -1
  5. package/Badge/Badge.d.ts +10 -10
  6. package/Badge/Badge.js +6 -7
  7. package/Button/buttonClasses.d.ts +1 -1
  8. package/CHANGELOG.md +240 -33
  9. package/FilledInput/FilledInput.js +4 -1
  10. package/FormControlLabel/FormControlLabel.js +3 -1
  11. package/Input/Input.js +4 -1
  12. package/InputBase/InputBase.js +4 -1
  13. package/InputLabel/InputLabel.js +4 -0
  14. package/ListItem/ListItem.js +3 -1
  15. package/Modal/Modal.js +3 -1
  16. package/README.md +5 -4
  17. package/Select/Select.d.ts +9 -1
  18. package/Select/Select.js +10 -1
  19. package/Select/SelectInput.d.ts +1 -0
  20. package/Select/SelectInput.js +25 -4
  21. package/Slider/Slider.d.ts +2 -0
  22. package/Slider/Slider.js +126 -53
  23. package/StepLabel/StepLabel.js +3 -1
  24. package/SvgIcon/SvgIcon.d.ts +8 -0
  25. package/SvgIcon/SvgIcon.js +28 -12
  26. package/TextField/TextField.d.ts +1 -0
  27. package/TextField/TextField.js +1 -0
  28. package/Tooltip/Tooltip.js +6 -1
  29. package/index.js +1 -1
  30. package/legacy/Autocomplete/Autocomplete.js +11 -7
  31. package/legacy/Backdrop/Backdrop.js +3 -1
  32. package/legacy/Badge/Badge.js +6 -7
  33. package/legacy/FilledInput/FilledInput.js +4 -1
  34. package/legacy/FormControlLabel/FormControlLabel.js +3 -1
  35. package/legacy/Input/Input.js +4 -1
  36. package/legacy/InputBase/InputBase.js +4 -1
  37. package/legacy/InputLabel/InputLabel.js +4 -0
  38. package/legacy/ListItem/ListItem.js +3 -1
  39. package/legacy/Modal/Modal.js +3 -1
  40. package/legacy/Select/Select.js +11 -1
  41. package/legacy/Select/SelectInput.js +29 -7
  42. package/legacy/Slider/Slider.js +127 -54
  43. package/legacy/StepLabel/StepLabel.js +3 -1
  44. package/legacy/SvgIcon/SvgIcon.js +29 -12
  45. package/legacy/TextField/TextField.js +1 -0
  46. package/legacy/Tooltip/Tooltip.js +6 -1
  47. package/legacy/index.js +1 -1
  48. package/legacy/locale/index.js +139 -128
  49. package/legacy/utils/shouldSpreadAdditionalProps.js +7 -0
  50. package/locale/index.js +54 -44
  51. package/modern/Autocomplete/Autocomplete.js +10 -6
  52. package/modern/Backdrop/Backdrop.js +3 -1
  53. package/modern/Badge/Badge.js +6 -7
  54. package/modern/FilledInput/FilledInput.js +4 -1
  55. package/modern/FormControlLabel/FormControlLabel.js +3 -1
  56. package/modern/Input/Input.js +4 -1
  57. package/modern/InputBase/InputBase.js +4 -1
  58. package/modern/InputLabel/InputLabel.js +4 -0
  59. package/modern/ListItem/ListItem.js +3 -1
  60. package/modern/Modal/Modal.js +3 -1
  61. package/modern/Select/Select.js +10 -1
  62. package/modern/Select/SelectInput.js +25 -4
  63. package/modern/Slider/Slider.js +126 -53
  64. package/modern/StepLabel/StepLabel.js +3 -1
  65. package/modern/SvgIcon/SvgIcon.js +27 -11
  66. package/modern/TextField/TextField.js +1 -0
  67. package/modern/Tooltip/Tooltip.js +6 -1
  68. package/modern/index.js +1 -1
  69. package/modern/locale/index.js +54 -44
  70. package/modern/utils/shouldSpreadAdditionalProps.js +7 -0
  71. package/node/Autocomplete/Autocomplete.js +11 -7
  72. package/node/Backdrop/Backdrop.js +3 -1
  73. package/node/Badge/Badge.js +8 -8
  74. package/node/FilledInput/FilledInput.js +4 -1
  75. package/node/FormControlLabel/FormControlLabel.js +3 -1
  76. package/node/Input/Input.js +4 -1
  77. package/node/InputBase/InputBase.js +4 -1
  78. package/node/InputLabel/InputLabel.js +4 -0
  79. package/node/ListItem/ListItem.js +3 -1
  80. package/node/Modal/Modal.js +3 -1
  81. package/node/Select/Select.js +10 -1
  82. package/node/Select/SelectInput.js +25 -4
  83. package/node/Slider/Slider.js +112 -45
  84. package/node/StepLabel/StepLabel.js +3 -1
  85. package/node/SvgIcon/SvgIcon.js +28 -12
  86. package/node/TextField/TextField.js +1 -0
  87. package/node/Tooltip/Tooltip.js +6 -1
  88. package/node/index.js +1 -1
  89. package/node/locale/index.js +54 -44
  90. package/node/utils/shouldSpreadAdditionalProps.js +15 -0
  91. package/package.json +7 -7
  92. package/styles/components.d.ts +452 -113
  93. package/styles/createTheme.d.ts +12 -6
  94. package/styles/overrides.d.ts +16 -4
  95. package/styles/useThemeProps.d.ts +2 -1
  96. package/umd/material-ui.development.js +619 -289
  97. package/umd/material-ui.production.min.js +21 -21
  98. 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.
@@ -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,
@@ -570,10 +570,11 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
570
570
  role: "presentation",
571
571
  anchorEl: anchorEl,
572
572
  open: true,
573
- children: /*#__PURE__*/_jsxs(AutocompletePaper, {
574
- as: PaperComponent,
575
- className: classes.paper,
573
+ children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
576
574
  ownerState: ownerState,
575
+ as: PaperComponent
576
+ }, componentsProps.paper, {
577
+ className: clsx(classes.paper, (_componentsProps$pape = componentsProps.paper) == null ? void 0 : _componentsProps$pape.className),
577
578
  children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
578
579
  className: classes.loading,
579
580
  ownerState: ownerState,
@@ -604,7 +605,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
604
605
  return renderListOption(option, index);
605
606
  })
606
607
  })) : null]
607
- })
608
+ }))
608
609
  }) : null]
609
610
  });
610
611
  });
@@ -674,7 +675,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
674
675
  * If `true`, the input's text is cleared on blur if no value is selected.
675
676
  *
676
677
  * 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 his search.
678
+ * Set to `false` if you want to help the user resume their search.
678
679
  * @default !props.freeSolo
679
680
  */
680
681
  clearOnBlur: PropTypes.bool,
@@ -705,7 +706,10 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
705
706
  * The props used for each slot inside.
706
707
  * @default {}
707
708
  */
708
- componentsProps: PropTypes.object,
709
+ componentsProps: PropTypes.shape({
710
+ clearIndicator: PropTypes.object,
711
+ paper: PropTypes.object
712
+ }),
709
713
 
710
714
  /**
711
715
  * The default value. Use when the component is not controlled.
@@ -27,7 +27,9 @@ export interface AvatarTypeMap<P = {}, D extends React.ElementType = 'div'> {
27
27
  * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes) applied to the `img` element if the component is used to display an image.
28
28
  * It can be used to listen for the loading error event.
29
29
  */
30
- imgProps?: React.ImgHTMLAttributes<HTMLImageElement>;
30
+ imgProps?: React.ImgHTMLAttributes<HTMLImageElement> & {
31
+ sx?: SxProps<Theme>;
32
+ };
31
33
  /**
32
34
  * The `sizes` attribute for the `img` element.
33
35
  */
@@ -126,7 +126,9 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
126
126
  * The props used for each slot inside the Backdrop.
127
127
  * @default {}
128
128
  */
129
- componentsProps: PropTypes.object,
129
+ componentsProps: PropTypes.shape({
130
+ root: PropTypes.object
131
+ }),
130
132
 
131
133
  /**
132
134
  * If `true`, the backdrop is invisible.
package/Badge/Badge.d.ts CHANGED
@@ -31,25 +31,25 @@ export type BadgeTypeMap<
31
31
  /** Styles applied to the badge `span` element if `color="warning"`. */
32
32
  colorWarning?: string;
33
33
  /** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'right' }} overlap="rectangular"`. */
34
- anchorOriginTopRightRectangular: string;
34
+ anchorOriginTopRightRectangular?: string;
35
35
  /** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'right' }} overlap="rectangular"`. */
36
- anchorOriginBottomRightRectangular: string;
36
+ anchorOriginBottomRightRectangular?: string;
37
37
  /** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'left' }} overlap="rectangular"`. */
38
- anchorOriginTopLeftRectangular: string;
38
+ anchorOriginTopLeftRectangular?: string;
39
39
  /** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'left' }} overlap="rectangular"`. */
40
- anchorOriginBottomLeftRectangular: string;
40
+ anchorOriginBottomLeftRectangular?: string;
41
41
  /** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'right' }} overlap="circular"`. */
42
- anchorOriginTopRightCircular: string;
42
+ anchorOriginTopRightCircular?: string;
43
43
  /** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'right' }} overlap="circular"`. */
44
- anchorOriginBottomRightCircular: string;
44
+ anchorOriginBottomRightCircular?: string;
45
45
  /** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'left' }} overlap="circular"`. */
46
- anchorOriginTopLeftCircular: string;
46
+ anchorOriginTopLeftCircular?: string;
47
47
  /** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'left' }} overlap="circular"`. */
48
- anchorOriginBottomLeftCircular: string;
48
+ anchorOriginBottomLeftCircular?: string;
49
49
  /** Class name applied to the badge `span` element if `overlap="rectangular"`. */
50
- overlapRectangular: string;
50
+ overlapRectangular?: string;
51
51
  /** Class name applied to the badge `span` element if `overlap="circular"`. */
52
- overlapCircular: string;
52
+ overlapCircular?: string;
53
53
  };
54
54
  /**
55
55
  * The color of the component. It supports those theme colors that make sense for this component.
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, isHostComponent } from '@mui/base';
8
+ import { generateUtilityClasses } from '@mui/base';
9
9
  import BadgeUnstyled, { badgeUnstyledClasses, getBadgeUtilityClass } from '@mui/base/BadgeUnstyled';
10
10
  import styled from '../styles/styled';
11
11
  import useThemeProps from '../styles/useThemeProps';
12
+ import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
12
13
  import capitalize from '../utils/capitalize';
13
14
  import { jsx as _jsx } from "react/jsx-runtime";
14
15
  export const badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular', // TODO: v6 remove the overlap value from these class keys
@@ -152,11 +153,6 @@ const BadgeBadge = styled('span', {
152
153
  duration: theme.transitions.duration.leavingScreen
153
154
  })
154
155
  }));
155
-
156
- const shouldSpreadAdditionalProps = Slot => {
157
- return !Slot || !isHostComponent(Slot);
158
- };
159
-
160
156
  const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
161
157
  var _componentsProps$root, _componentsProps$badg;
162
158
 
@@ -300,7 +296,10 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
300
296
  * The props used for each slot inside the Badge.
301
297
  * @default {}
302
298
  */
303
- componentsProps: PropTypes.object,
299
+ componentsProps: PropTypes.shape({
300
+ badge: PropTypes.object,
301
+ root: PropTypes.object
302
+ }),
304
303
 
305
304
  /**
306
305
  * If `true`, the badge is invisible.
@@ -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="small"` and `variant="contained"`. */
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;