@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
@@ -44,7 +44,7 @@ var BackdropRoot = styled('div', {
44
44
  });
45
45
  });
46
46
  var Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
47
- var _components$Root, _componentsProps$root;
47
+ var _slotProps$root, _ref2, _slots$root;
48
48
 
49
49
  var props = useThemeProps({
50
50
  props: inProps,
@@ -62,10 +62,14 @@ var Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
62
62
  _props$invisible = props.invisible,
63
63
  invisible = _props$invisible === void 0 ? false : _props$invisible,
64
64
  open = props.open,
65
+ _props$slotProps = props.slotProps,
66
+ slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
67
+ _props$slots = props.slots,
68
+ slots = _props$slots === void 0 ? {} : _props$slots,
65
69
  transitionDuration = props.transitionDuration,
66
70
  _props$TransitionComp = props.TransitionComponent,
67
71
  TransitionComponent = _props$TransitionComp === void 0 ? Fade : _props$TransitionComp,
68
- other = _objectWithoutProperties(props, ["children", "component", "components", "componentsProps", "className", "invisible", "open", "transitionDuration", "TransitionComponent"]);
72
+ other = _objectWithoutProperties(props, ["children", "component", "components", "componentsProps", "className", "invisible", "open", "slotProps", "slots", "transitionDuration", "TransitionComponent"]);
69
73
 
70
74
  var ownerState = _extends({}, props, {
71
75
  component: component,
@@ -73,19 +77,21 @@ var Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
73
77
  });
74
78
 
75
79
  var classes = useUtilityClasses(ownerState);
80
+ var rootSlotProps = (_slotProps$root = slotProps.root) != null ? _slotProps$root : componentsProps.root;
76
81
  return /*#__PURE__*/_jsx(TransitionComponent, _extends({
77
82
  in: open,
78
83
  timeout: transitionDuration
79
84
  }, other, {
80
- children: /*#__PURE__*/_jsx(BackdropRoot, {
81
- "aria-hidden": true,
82
- as: (_components$Root = components.Root) != null ? _components$Root : component,
83
- className: clsx(classes.root, className),
84
- 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: (_ref2 = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref2 : component,
89
+ className: clsx(classes.root, className, rootSlotProps == null ? void 0 : rootSlotProps.className),
90
+ ownerState: _extends({}, ownerState, rootSlotProps == null ? void 0 : rootSlotProps.ownerState),
85
91
  classes: classes,
86
92
  ref: ref,
87
93
  children: children
88
- })
94
+ }))
89
95
  }));
90
96
  });
91
97
  process.env.NODE_ENV !== "production" ? Backdrop.propTypes
@@ -118,8 +124,11 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
118
124
  component: PropTypes.elementType,
119
125
 
120
126
  /**
121
- * The components used for each slot inside the Backdrop.
122
- * 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
+ *
123
132
  * @default {}
124
133
  */
125
134
  components: PropTypes.shape({
@@ -127,7 +136,12 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
127
136
  }),
128
137
 
129
138
  /**
130
- * 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
+ *
131
145
  * @default {}
132
146
  */
133
147
  componentsProps: PropTypes.shape({
@@ -146,6 +160,29 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
146
160
  */
147
161
  open: PropTypes.bool.isRequired,
148
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
+
149
186
  /**
150
187
  * The system prop that allows defining system overrides as well as additional CSS styles.
151
188
  */
@@ -318,8 +318,11 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
318
318
  component: PropTypes.elementType,
319
319
 
320
320
  /**
321
- * The components used for each slot inside the Badge.
322
- * Either a string to use a HTML element or a component.
321
+ * The components used for each slot inside.
322
+ *
323
+ * This prop is an alias for the `slots` prop.
324
+ * It's recommended to use the `slots` prop instead.
325
+ *
323
326
  * @default {}
324
327
  */
325
328
  components: PropTypes.shape({
@@ -328,7 +331,12 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
328
331
  }),
329
332
 
330
333
  /**
331
- * The props used for each slot inside the Badge.
334
+ * The extra props for the slot components.
335
+ * You can override the existing props or add new ones.
336
+ *
337
+ * This prop is an alias for the `slotProps` prop.
338
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
339
+ *
332
340
  * @default {}
333
341
  */
334
342
  componentsProps: PropTypes.shape({
@@ -125,7 +125,7 @@ var TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, re
125
125
  var start = React.useCallback(function () {
126
126
  var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
127
127
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
128
- var cb = arguments.length > 2 ? arguments[2] : undefined;
128
+ var cb = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
129
129
  var _options$pulsate = options.pulsate,
130
130
  pulsate = _options$pulsate === void 0 ? false : _options$pulsate,
131
131
  _options$center = options.center,
@@ -22,6 +22,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
22
22
  disabled = ownerState.disabled,
23
23
  size = ownerState.size,
24
24
  color = ownerState.color,
25
+ iconColor = ownerState.iconColor,
25
26
  onDelete = ownerState.onDelete,
26
27
  clickable = ownerState.clickable,
27
28
  variant = ownerState.variant;
@@ -29,7 +30,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
29
30
  root: ['root', variant, disabled && 'disabled', "size".concat(capitalize(size)), "color".concat(capitalize(color)), clickable && 'clickable', clickable && "clickableColor".concat(capitalize(color)), onDelete && 'deletable', onDelete && "deletableColor".concat(capitalize(color)), "".concat(variant).concat(capitalize(color))],
30
31
  label: ['label', "label".concat(capitalize(size))],
31
32
  avatar: ['avatar', "avatar".concat(capitalize(size)), "avatarColor".concat(capitalize(color))],
32
- icon: ['icon', "icon".concat(capitalize(size)), "iconColor".concat(capitalize(color))],
33
+ icon: ['icon', "icon".concat(capitalize(size)), "iconColor".concat(capitalize(iconColor))],
33
34
  deleteIcon: ['deleteIcon', "deleteIcon".concat(capitalize(size)), "deleteIconColor".concat(capitalize(color)), "deleteIcon".concat(capitalize(variant), "Color").concat(capitalize(color))]
34
35
  };
35
36
  return composeClasses(slots, getChipUtilityClass, classes);
@@ -41,11 +42,12 @@ var ChipRoot = styled('div', {
41
42
  overridesResolver: function overridesResolver(props, styles) {
42
43
  var ownerState = props.ownerState;
43
44
  var color = ownerState.color,
45
+ iconColor = ownerState.iconColor,
44
46
  clickable = ownerState.clickable,
45
47
  onDelete = ownerState.onDelete,
46
48
  size = ownerState.size,
47
49
  variant = ownerState.variant;
48
- return [_defineProperty({}, "& .".concat(chipClasses.avatar), styles.avatar), _defineProperty({}, "& .".concat(chipClasses.avatar), styles["avatar".concat(capitalize(size))]), _defineProperty({}, "& .".concat(chipClasses.avatar), styles["avatarColor".concat(capitalize(color))]), _defineProperty({}, "& .".concat(chipClasses.icon), styles.icon), _defineProperty({}, "& .".concat(chipClasses.icon), styles["icon".concat(capitalize(size))]), _defineProperty({}, "& .".concat(chipClasses.icon), styles["iconColor".concat(capitalize(color))]), _defineProperty({}, "& .".concat(chipClasses.deleteIcon), styles.deleteIcon), _defineProperty({}, "& .".concat(chipClasses.deleteIcon), styles["deleteIcon".concat(capitalize(size))]), _defineProperty({}, "& .".concat(chipClasses.deleteIcon), styles["deleteIconColor".concat(capitalize(color))]), _defineProperty({}, "& .".concat(chipClasses.deleteIcon), styles["deleteIcon".concat(capitalize(variant), "Color").concat(capitalize(color))]), styles.root, styles["size".concat(capitalize(size))], styles["color".concat(capitalize(color))], clickable && styles.clickable, clickable && color !== 'default' && styles["clickableColor".concat(capitalize(color), ")")], onDelete && styles.deletable, onDelete && color !== 'default' && styles["deletableColor".concat(capitalize(color))], styles[variant], styles["".concat(variant).concat(capitalize(color))]];
50
+ return [_defineProperty({}, "& .".concat(chipClasses.avatar), styles.avatar), _defineProperty({}, "& .".concat(chipClasses.avatar), styles["avatar".concat(capitalize(size))]), _defineProperty({}, "& .".concat(chipClasses.avatar), styles["avatarColor".concat(capitalize(color))]), _defineProperty({}, "& .".concat(chipClasses.icon), styles.icon), _defineProperty({}, "& .".concat(chipClasses.icon), styles["icon".concat(capitalize(size))]), _defineProperty({}, "& .".concat(chipClasses.icon), styles["iconColor".concat(capitalize(iconColor))]), _defineProperty({}, "& .".concat(chipClasses.deleteIcon), styles.deleteIcon), _defineProperty({}, "& .".concat(chipClasses.deleteIcon), styles["deleteIcon".concat(capitalize(size))]), _defineProperty({}, "& .".concat(chipClasses.deleteIcon), styles["deleteIconColor".concat(capitalize(color))]), _defineProperty({}, "& .".concat(chipClasses.deleteIcon), styles["deleteIcon".concat(capitalize(variant), "Color").concat(capitalize(color))]), styles.root, styles["size".concat(capitalize(size))], styles["color".concat(capitalize(color))], clickable && styles.clickable, clickable && color !== 'default' && styles["clickableColor".concat(capitalize(color), ")")], onDelete && styles.deletable, onDelete && color !== 'default' && styles["deletableColor".concat(capitalize(color))], styles[variant], styles["".concat(variant).concat(capitalize(color))]];
49
51
  }
50
52
  })(function (_ref11) {
51
53
  var _extends2;
@@ -101,16 +103,17 @@ var ChipRoot = styled('div', {
101
103
  height: 18,
102
104
  fontSize: theme.typography.pxToRem(10)
103
105
  }), _defineProperty(_extends2, "& .".concat(chipClasses.icon), _extends({
104
- color: theme.vars ? theme.vars.palette.Chip.defaultIconColor : textColor,
105
106
  marginLeft: 5,
106
107
  marginRight: -6
107
108
  }, ownerState.size === 'small' && {
108
109
  fontSize: 18,
109
110
  marginLeft: 4,
110
111
  marginRight: -4
112
+ }, ownerState.iconColor === ownerState.color && _extends({
113
+ color: theme.vars ? theme.vars.palette.Chip.defaultIconColor : textColor
111
114
  }, ownerState.color !== 'default' && {
112
115
  color: 'inherit'
113
- })), _defineProperty(_extends2, "& .".concat(chipClasses.deleteIcon), _extends({
116
+ }))), _defineProperty(_extends2, "& .".concat(chipClasses.deleteIcon), _extends({
114
117
  WebkitTapHighlightColor: 'transparent',
115
118
  color: theme.vars ? "rgba(".concat(theme.vars.palette.text.primaryChannel, " / 0.26)") : deleteIconColor,
116
119
  fontSize: 22,
@@ -300,6 +303,7 @@ var Chip = /*#__PURE__*/React.forwardRef(function Chip(inProps, ref) {
300
303
  disabled: disabled,
301
304
  size: size,
302
305
  color: color,
306
+ iconColor: /*#__PURE__*/React.isValidElement(iconProp) ? iconProp.props.color || color : color,
303
307
  onDelete: !!onDelete,
304
308
  clickable: clickable,
305
309
  variant: variant
@@ -172,6 +172,8 @@ var FilledInputInput = styled(InputBaseInput, {
172
172
  });
173
173
  });
174
174
  var FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps, ref) {
175
+ var _ref5, _slots$root, _ref6, _slots$input;
176
+
175
177
  var props = useThemeProps({
176
178
  props: inProps,
177
179
  name: 'MuiFilledInput'
@@ -188,9 +190,12 @@ var FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps, re
188
190
  inputComponent = _props$inputComponent === void 0 ? 'input' : _props$inputComponent,
189
191
  _props$multiline = props.multiline,
190
192
  multiline = _props$multiline === void 0 ? false : _props$multiline,
193
+ slotProps = props.slotProps,
194
+ _props$slots = props.slots,
195
+ slots = _props$slots === void 0 ? {} : _props$slots,
191
196
  _props$type = props.type,
192
197
  type = _props$type === void 0 ? 'text' : _props$type,
193
- other = _objectWithoutProperties(props, ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "type"]);
198
+ other = _objectWithoutProperties(props, ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "slotProps", "slots", "type"]);
194
199
 
195
200
  var ownerState = _extends({}, props, {
196
201
  fullWidth: fullWidth,
@@ -208,12 +213,14 @@ var FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps, re
208
213
  ownerState: ownerState
209
214
  }
210
215
  };
211
- var componentsProps = componentsPropsProp ? deepmerge(componentsPropsProp, filledInputComponentsProps) : filledInputComponentsProps;
216
+ var componentsProps = (slotProps != null ? slotProps : componentsPropsProp) ? deepmerge(slotProps != null ? slotProps : componentsPropsProp, filledInputComponentsProps) : filledInputComponentsProps;
217
+ var RootSlot = (_ref5 = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref5 : FilledInputRoot;
218
+ var InputSlot = (_ref6 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref6 : FilledInputInput;
212
219
  return /*#__PURE__*/_jsx(InputBase, _extends({
213
- components: _extends({
214
- Root: FilledInputRoot,
215
- Input: FilledInputInput
216
- }, components),
220
+ slots: {
221
+ root: RootSlot,
222
+ input: InputSlot
223
+ },
217
224
  componentsProps: componentsProps,
218
225
  fullWidth: fullWidth,
219
226
  inputComponent: inputComponent,
@@ -260,8 +267,11 @@ process.env.NODE_ENV !== "production" ? FilledInput.propTypes
260
267
  .oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
261
268
 
262
269
  /**
263
- * The components used for each slot inside the InputBase.
264
- * Either a string to use a HTML element or a component.
270
+ * The components used for each slot inside.
271
+ *
272
+ * This prop is an alias for the `slots` prop.
273
+ * It's recommended to use the `slots` prop instead.
274
+ *
265
275
  * @default {}
266
276
  */
267
277
  components: PropTypes.shape({
@@ -270,7 +280,12 @@ process.env.NODE_ENV !== "production" ? FilledInput.propTypes
270
280
  }),
271
281
 
272
282
  /**
273
- * The props used for each slot inside the Input.
283
+ * The extra props for the slot components.
284
+ * You can override the existing props or add new ones.
285
+ *
286
+ * This prop is an alias for the `slotProps` prop.
287
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
288
+ *
274
289
  * @default {}
275
290
  */
276
291
  componentsProps: PropTypes.shape({
@@ -400,6 +415,31 @@ process.env.NODE_ENV !== "production" ? FilledInput.propTypes
400
415
  */
401
416
  rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
402
417
 
418
+ /**
419
+ * The extra props for the slot components.
420
+ * You can override the existing props or add new ones.
421
+ *
422
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
423
+ *
424
+ * @default {}
425
+ */
426
+ slotProps: PropTypes.shape({
427
+ input: PropTypes.object,
428
+ root: PropTypes.object
429
+ }),
430
+
431
+ /**
432
+ * The components used for each slot inside.
433
+ *
434
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
435
+ *
436
+ * @default {}
437
+ */
438
+ slots: PropTypes.shape({
439
+ input: PropTypes.elementType,
440
+ root: PropTypes.elementType
441
+ }),
442
+
403
443
  /**
404
444
  * Start `InputAdornment` for this component.
405
445
  */
@@ -196,35 +196,35 @@ var FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps, re
196
196
  };
197
197
  }
198
198
 
199
- var onFilled = React.useCallback(function () {
200
- setFilled(true);
201
- }, []);
202
- var onEmpty = React.useCallback(function () {
203
- setFilled(false);
204
- }, []);
205
- var childContext = {
206
- adornedStart: adornedStart,
207
- setAdornedStart: setAdornedStart,
208
- color: color,
209
- disabled: disabled,
210
- error: error,
211
- filled: filled,
212
- focused: focused,
213
- fullWidth: fullWidth,
214
- hiddenLabel: hiddenLabel,
215
- size: size,
216
- onBlur: function onBlur() {
217
- setFocused(false);
218
- },
219
- onEmpty: onEmpty,
220
- onFilled: onFilled,
221
- onFocus: function onFocus() {
222
- setFocused(true);
223
- },
224
- registerEffect: registerEffect,
225
- required: required,
226
- variant: variant
227
- };
199
+ var childContext = React.useMemo(function () {
200
+ return {
201
+ adornedStart: adornedStart,
202
+ setAdornedStart: setAdornedStart,
203
+ color: color,
204
+ disabled: disabled,
205
+ error: error,
206
+ filled: filled,
207
+ focused: focused,
208
+ fullWidth: fullWidth,
209
+ hiddenLabel: hiddenLabel,
210
+ size: size,
211
+ onBlur: function onBlur() {
212
+ setFocused(false);
213
+ },
214
+ onEmpty: function onEmpty() {
215
+ setFilled(false);
216
+ },
217
+ onFilled: function onFilled() {
218
+ setFilled(true);
219
+ },
220
+ onFocus: function onFocus() {
221
+ setFocused(true);
222
+ },
223
+ registerEffect: registerEffect,
224
+ required: required,
225
+ variant: variant
226
+ };
227
+ }, [adornedStart, color, disabled, error, filled, focused, fullWidth, hiddenLabel, registerEffect, required, size, variant]);
228
228
  return /*#__PURE__*/_jsx(FormControlContext.Provider, {
229
229
  value: childContext,
230
230
  children: /*#__PURE__*/_jsx(FormControlRoot, _extends({
@@ -70,6 +70,8 @@ export var FormControlLabelRoot = styled('label', {
70
70
  */
71
71
 
72
72
  var FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel(inProps, ref) {
73
+ var _slotProps$typography;
74
+
73
75
  var props = useThemeProps({
74
76
  props: inProps,
75
77
  name: 'MuiFormControlLabel'
@@ -88,8 +90,10 @@ var FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel(i
88
90
  labelPlacement = _props$labelPlacement === void 0 ? 'end' : _props$labelPlacement,
89
91
  name = props.name,
90
92
  onChange = props.onChange,
93
+ _props$slotProps = props.slotProps,
94
+ slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
91
95
  value = props.value,
92
- other = _objectWithoutProperties(props, ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "value"]);
96
+ other = _objectWithoutProperties(props, ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "slotProps", "value"]);
93
97
 
94
98
  var muiFormControl = useFormControl();
95
99
  var disabled = disabledProp;
@@ -123,13 +127,14 @@ var FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel(i
123
127
  });
124
128
 
125
129
  var classes = useUtilityClasses(ownerState);
130
+ var typographySlotProps = (_slotProps$typography = slotProps.typography) != null ? _slotProps$typography : componentsProps.typography;
126
131
  var label = labelProp;
127
132
 
128
133
  if (label != null && label.type !== Typography && !disableTypography) {
129
134
  label = /*#__PURE__*/_jsx(Typography, _extends({
130
- component: "span",
131
- className: classes.label
132
- }, componentsProps.typography, {
135
+ component: "span"
136
+ }, typographySlotProps, {
137
+ className: clsx(classes.label, typographySlotProps == null ? void 0 : typographySlotProps.className),
133
138
  children: label
134
139
  }));
135
140
  }
@@ -217,6 +222,14 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes
217
222
  */
218
223
  onChange: PropTypes.func,
219
224
 
225
+ /**
226
+ * The props used for each slot inside.
227
+ * @default {}
228
+ */
229
+ slotProps: PropTypes.shape({
230
+ typography: PropTypes.object
231
+ }),
232
+
220
233
  /**
221
234
  * The system prop that allows defining system overrides as well as additional CSS styles.
222
235
  */
@@ -106,6 +106,8 @@ var InputInput = styled(InputBaseInput, {
106
106
  overridesResolver: inputBaseInputOverridesResolver
107
107
  })({});
108
108
  var Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
109
+ var _ref3, _slots$root, _ref4, _slots$input;
110
+
109
111
  var props = useThemeProps({
110
112
  props: inProps,
111
113
  name: 'MuiInput'
@@ -121,9 +123,12 @@ var Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
121
123
  inputComponent = _props$inputComponent === void 0 ? 'input' : _props$inputComponent,
122
124
  _props$multiline = props.multiline,
123
125
  multiline = _props$multiline === void 0 ? false : _props$multiline,
126
+ slotProps = props.slotProps,
127
+ _props$slots = props.slots,
128
+ slots = _props$slots === void 0 ? {} : _props$slots,
124
129
  _props$type = props.type,
125
130
  type = _props$type === void 0 ? 'text' : _props$type,
126
- other = _objectWithoutProperties(props, ["disableUnderline", "components", "componentsProps", "fullWidth", "inputComponent", "multiline", "type"]);
131
+ other = _objectWithoutProperties(props, ["disableUnderline", "components", "componentsProps", "fullWidth", "inputComponent", "multiline", "slotProps", "slots", "type"]);
127
132
 
128
133
  var classes = useUtilityClasses(props);
129
134
  var ownerState = {
@@ -134,13 +139,15 @@ var Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
134
139
  ownerState: ownerState
135
140
  }
136
141
  };
137
- var componentsProps = componentsPropsProp ? deepmerge(componentsPropsProp, inputComponentsProps) : inputComponentsProps;
142
+ var componentsProps = (slotProps != null ? slotProps : componentsPropsProp) ? deepmerge(slotProps != null ? slotProps : componentsPropsProp, inputComponentsProps) : inputComponentsProps;
143
+ var RootSlot = (_ref3 = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref3 : InputRoot;
144
+ var InputSlot = (_ref4 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref4 : InputInput;
138
145
  return /*#__PURE__*/_jsx(InputBase, _extends({
139
- components: _extends({
140
- Root: InputRoot,
141
- Input: InputInput
142
- }, components),
143
- componentsProps: componentsProps,
146
+ slots: {
147
+ root: RootSlot,
148
+ input: InputSlot
149
+ },
150
+ slotProps: componentsProps,
144
151
  fullWidth: fullWidth,
145
152
  inputComponent: inputComponent,
146
153
  multiline: multiline,
@@ -186,8 +193,11 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
186
193
  .oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
187
194
 
188
195
  /**
189
- * The components used for each slot inside the InputBase.
190
- * Either a string to use a HTML element or a component.
196
+ * The components used for each slot inside.
197
+ *
198
+ * This prop is an alias for the `slots` prop.
199
+ * It's recommended to use the `slots` prop instead.
200
+ *
191
201
  * @default {}
192
202
  */
193
203
  components: PropTypes.shape({
@@ -196,7 +206,12 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
196
206
  }),
197
207
 
198
208
  /**
199
- * The props used for each slot inside the Input.
209
+ * The extra props for the slot components.
210
+ * You can override the existing props or add new ones.
211
+ *
212
+ * This prop is an alias for the `slotProps` prop.
213
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
214
+ *
200
215
  * @default {}
201
216
  */
202
217
  componentsProps: PropTypes.shape({
@@ -318,6 +333,31 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
318
333
  */
319
334
  rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
320
335
 
336
+ /**
337
+ * The extra props for the slot components.
338
+ * You can override the existing props or add new ones.
339
+ *
340
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
341
+ *
342
+ * @default {}
343
+ */
344
+ slotProps: PropTypes.shape({
345
+ input: PropTypes.object,
346
+ root: PropTypes.object
347
+ }),
348
+
349
+ /**
350
+ * The components used for each slot inside.
351
+ *
352
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
353
+ *
354
+ * @default {}
355
+ */
356
+ slots: PropTypes.shape({
357
+ input: PropTypes.elementType,
358
+ root: PropTypes.elementType
359
+ }),
360
+
321
361
  /**
322
362
  * Start `InputAdornment` for this component.
323
363
  */
@@ -206,6 +206,8 @@ var inputGlobalStyles = /*#__PURE__*/_jsx(GlobalStyles, {
206
206
 
207
207
 
208
208
  var InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref) {
209
+ var _slotProps$input;
210
+
209
211
  var props = useThemeProps({
210
212
  props: inProps,
211
213
  name: 'MuiInputBase'
@@ -250,11 +252,15 @@ var InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref) {
250
252
  renderSuffix = props.renderSuffix,
251
253
  rows = props.rows,
252
254
  size = props.size,
255
+ _props$slotProps = props.slotProps,
256
+ slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
257
+ _props$slots = props.slots,
258
+ slots = _props$slots === void 0 ? {} : _props$slots,
253
259
  startAdornment = props.startAdornment,
254
260
  _props$type = props.type,
255
261
  type = _props$type === void 0 ? 'text' : _props$type,
256
262
  valueProp = props.value,
257
- other = _objectWithoutProperties(props, ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "startAdornment", "type", "value"]);
263
+ other = _objectWithoutProperties(props, ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "slotProps", "slots", "startAdornment", "type", "value"]);
258
264
 
259
265
  var value = inputPropsProp.value != null ? inputPropsProp.value : valueProp;
260
266
 
@@ -462,10 +468,10 @@ var InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref) {
462
468
  });
463
469
 
464
470
  var classes = useUtilityClasses(ownerState);
465
- var Root = components.Root || InputBaseRoot;
466
- var rootProps = componentsProps.root || {};
467
- var Input = components.Input || InputBaseComponent;
468
- inputProps = _extends({}, inputProps, componentsProps.input);
471
+ var Root = slots.root || components.Root || InputBaseRoot;
472
+ var rootProps = slotProps.root || componentsProps.root || {};
473
+ var Input = slots.input || components.Input || InputBaseComponent;
474
+ inputProps = _extends({}, inputProps, (_slotProps$input = slotProps.input) != null ? _slotProps$input : componentsProps.input);
469
475
  return /*#__PURE__*/_jsxs(React.Fragment, {
470
476
  children: [!disableInjectingGlobalStyles && inputGlobalStyles, /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, !isHostComponent(Root) && {
471
477
  ownerState: _extends({}, ownerState, rootProps.ownerState)
@@ -557,8 +563,11 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
557
563
  .oneOfType([PropTypes.oneOf(['primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
558
564
 
559
565
  /**
560
- * The components used for each slot inside the InputBase.
561
- * Either a string to use a HTML element or a component.
566
+ * The components used for each slot inside.
567
+ *
568
+ * This prop is an alias for the `slots` prop.
569
+ * It's recommended to use the `slots` prop instead.
570
+ *
562
571
  * @default {}
563
572
  */
564
573
  components: PropTypes.shape({
@@ -567,7 +576,12 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
567
576
  }),
568
577
 
569
578
  /**
570
- * The props used for each slot inside the Input.
579
+ * The extra props for the slot components.
580
+ * You can override the existing props or add new ones.
581
+ *
582
+ * This prop is an alias for the `slotProps` prop.
583
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
584
+ *
571
585
  * @default {}
572
586
  */
573
587
  componentsProps: PropTypes.shape({
@@ -735,6 +749,31 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
735
749
  /* @typescript-to-proptypes-ignore */
736
750
  .oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),
737
751
 
752
+ /**
753
+ * The extra props for the slot components.
754
+ * You can override the existing props or add new ones.
755
+ *
756
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
757
+ *
758
+ * @default {}
759
+ */
760
+ slotProps: PropTypes.shape({
761
+ input: PropTypes.object,
762
+ root: PropTypes.object
763
+ }),
764
+
765
+ /**
766
+ * The components used for each slot inside.
767
+ *
768
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
769
+ *
770
+ * @default {}
771
+ */
772
+ slots: PropTypes.shape({
773
+ input: PropTypes.elementType,
774
+ root: PropTypes.elementType
775
+ }),
776
+
738
777
  /**
739
778
  * Start `InputAdornment` for this component.
740
779
  */