@mui/material 5.10.11 → 5.10.13

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