@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
@@ -45,7 +45,7 @@ var _inputBaseClasses = _interopRequireWildcard(require("./inputBaseClasses"));
45
45
 
46
46
  var _jsxRuntime = require("react/jsx-runtime");
47
47
 
48
- const _excluded = ["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"];
48
+ const _excluded = ["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"];
49
49
 
50
50
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
51
51
 
@@ -249,6 +249,8 @@ const inputGlobalStyles = /*#__PURE__*/(0, _jsxRuntime.jsx)(_GlobalStyles.defaul
249
249
  */
250
250
 
251
251
  const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref) {
252
+ var _slotProps$input;
253
+
252
254
  const props = (0, _useThemeProps.default)({
253
255
  props: inProps,
254
256
  name: 'MuiInputBase'
@@ -283,6 +285,8 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
283
285
  readOnly,
284
286
  renderSuffix,
285
287
  rows,
288
+ slotProps = {},
289
+ slots = {},
286
290
  startAdornment,
287
291
  type = 'text',
288
292
  value: valueProp
@@ -483,10 +487,10 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
483
487
  type
484
488
  });
485
489
  const classes = useUtilityClasses(ownerState);
486
- const Root = components.Root || InputBaseRoot;
487
- const rootProps = componentsProps.root || {};
488
- const Input = components.Input || InputBaseComponent;
489
- inputProps = (0, _extends2.default)({}, inputProps, componentsProps.input);
490
+ const Root = slots.root || components.Root || InputBaseRoot;
491
+ const rootProps = slotProps.root || componentsProps.root || {};
492
+ const Input = slots.input || components.Input || InputBaseComponent;
493
+ inputProps = (0, _extends2.default)({}, inputProps, (_slotProps$input = slotProps.input) != null ? _slotProps$input : componentsProps.input);
490
494
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
491
495
  children: [!disableInjectingGlobalStyles && inputGlobalStyles, /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, (0, _extends2.default)({}, rootProps, !(0, _base.isHostComponent)(Root) && {
492
496
  ownerState: (0, _extends2.default)({}, ownerState, rootProps.ownerState)
@@ -578,8 +582,11 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
578
582
  .oneOfType([_propTypes.default.oneOf(['primary', 'secondary', 'error', 'info', 'success', 'warning']), _propTypes.default.string]),
579
583
 
580
584
  /**
581
- * The components used for each slot inside the InputBase.
582
- * Either a string to use a HTML element or a component.
585
+ * The components used for each slot inside.
586
+ *
587
+ * This prop is an alias for the `slots` prop.
588
+ * It's recommended to use the `slots` prop instead.
589
+ *
583
590
  * @default {}
584
591
  */
585
592
  components: _propTypes.default.shape({
@@ -588,7 +595,12 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
588
595
  }),
589
596
 
590
597
  /**
591
- * The props used for each slot inside the Input.
598
+ * The extra props for the slot components.
599
+ * You can override the existing props or add new ones.
600
+ *
601
+ * This prop is an alias for the `slotProps` prop.
602
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
603
+ *
592
604
  * @default {}
593
605
  */
594
606
  componentsProps: _propTypes.default.shape({
@@ -756,6 +768,31 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
756
768
  /* @typescript-to-proptypes-ignore */
757
769
  .oneOfType([_propTypes.default.oneOf(['medium', 'small']), _propTypes.default.string]),
758
770
 
771
+ /**
772
+ * The extra props for the slot components.
773
+ * You can override the existing props or add new ones.
774
+ *
775
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
776
+ *
777
+ * @default {}
778
+ */
779
+ slotProps: _propTypes.default.shape({
780
+ input: _propTypes.default.object,
781
+ root: _propTypes.default.object
782
+ }),
783
+
784
+ /**
785
+ * The components used for each slot inside.
786
+ *
787
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
788
+ *
789
+ * @default {}
790
+ */
791
+ slots: _propTypes.default.shape({
792
+ input: _propTypes.default.elementType,
793
+ root: _propTypes.default.elementType
794
+ }),
795
+
759
796
  /**
760
797
  * Start `InputAdornment` for this component.
761
798
  */
@@ -88,20 +88,49 @@ export interface ListItemTypeMap<P, D extends React.ElementType> {
88
88
  props: P &
89
89
  ListItemBaseProps & {
90
90
  /**
91
- * The components used for each slot inside the InputBase.
92
- * Either a string to use a HTML element or a component.
91
+ * The components used for each slot inside.
92
+ *
93
+ * This prop is an alias for the `slots` prop.
94
+ * It's recommended to use the `slots` prop instead.
95
+ *
93
96
  * @default {}
94
97
  */
95
98
  components?: {
96
99
  Root?: React.ElementType;
97
100
  };
98
101
  /**
99
- * The props used for each slot inside the Input.
102
+ * The extra props for the slot components.
103
+ * You can override the existing props or add new ones.
104
+ *
105
+ * This prop is an alias for the `slotProps` prop.
106
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
107
+ *
100
108
  * @default {}
101
109
  */
102
110
  componentsProps?: {
103
111
  root?: React.HTMLAttributes<HTMLDivElement> & ListItemComponentsPropsOverrides;
104
112
  };
113
+ /**
114
+ * The extra props for the slot components.
115
+ * You can override the existing props or add new ones.
116
+ *
117
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
118
+ *
119
+ * @default {}
120
+ */
121
+ slotProps?: {
122
+ root?: React.HTMLAttributes<HTMLDivElement> & ListItemComponentsPropsOverrides;
123
+ };
124
+ /**
125
+ * The components used for each slot inside.
126
+ *
127
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
128
+ *
129
+ * @default {}
130
+ */
131
+ slots?: {
132
+ root?: React.ElementType;
133
+ };
105
134
  };
106
135
  defaultComponent: D;
107
136
  }
@@ -46,7 +46,7 @@ var _ListItemSecondaryAction = _interopRequireDefault(require("../ListItemSecond
46
46
  var _jsxRuntime = require("react/jsx-runtime");
47
47
 
48
48
  const _excluded = ["className"],
49
- _excluded2 = ["alignItems", "autoFocus", "button", "children", "className", "component", "components", "componentsProps", "ContainerComponent", "ContainerProps", "dense", "disabled", "disableGutters", "disablePadding", "divider", "focusVisibleClassName", "secondaryAction", "selected"];
49
+ _excluded2 = ["alignItems", "autoFocus", "button", "children", "className", "component", "components", "componentsProps", "ContainerComponent", "ContainerProps", "dense", "disabled", "disableGutters", "disablePadding", "divider", "focusVisibleClassName", "secondaryAction", "selected", "slotProps", "slots"];
50
50
 
51
51
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
52
52
 
@@ -193,16 +193,18 @@ const ListItem = /*#__PURE__*/React.forwardRef(function ListItem(inProps, ref) {
193
193
  divider = false,
194
194
  focusVisibleClassName,
195
195
  secondaryAction,
196
- selected = false
196
+ selected = false,
197
+ slotProps = {},
198
+ slots = {}
197
199
  } = props,
198
200
  ContainerProps = (0, _objectWithoutPropertiesLoose2.default)(props.ContainerProps, _excluded),
199
201
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
200
202
  const context = React.useContext(_ListContext.default);
201
- const childContext = {
203
+ const childContext = React.useMemo(() => ({
202
204
  dense: dense || context.dense || false,
203
205
  alignItems,
204
206
  disableGutters
205
- };
207
+ }), [alignItems, context.dense, dense, disableGutters]);
206
208
  const listItemRef = React.useRef(null);
207
209
  (0, _useEnhancedEffect.default)(() => {
208
210
  if (autoFocus) {
@@ -230,8 +232,8 @@ const ListItem = /*#__PURE__*/React.forwardRef(function ListItem(inProps, ref) {
230
232
  });
231
233
  const classes = useUtilityClasses(ownerState);
232
234
  const handleRef = (0, _useForkRef.default)(listItemRef, ref);
233
- const Root = components.Root || ListItemRoot;
234
- const rootProps = componentsProps.root || {};
235
+ const Root = slots.root || components.Root || ListItemRoot;
236
+ const rootProps = slotProps.root || componentsProps.root || {};
235
237
  const componentProps = (0, _extends2.default)({
236
238
  className: (0, _clsx.default)(classes.root, rootProps.className, className),
237
239
  disabled
@@ -279,8 +281,7 @@ const ListItem = /*#__PURE__*/React.forwardRef(function ListItem(inProps, ref) {
279
281
  value: childContext,
280
282
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, (0, _extends2.default)({}, rootProps, {
281
283
  as: Component,
282
- ref: handleRef,
283
- ownerState: ownerState
284
+ ref: handleRef
284
285
  }, !(0, _base.isHostComponent)(Root) && {
285
286
  ownerState: (0, _extends2.default)({}, ownerState, rootProps.ownerState)
286
287
  }, componentProps, {
@@ -363,8 +364,11 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
363
364
  component: _propTypes.default.elementType,
364
365
 
365
366
  /**
366
- * The components used for each slot inside the InputBase.
367
- * Either a string to use a HTML element or a component.
367
+ * The components used for each slot inside.
368
+ *
369
+ * This prop is an alias for the `slots` prop.
370
+ * It's recommended to use the `slots` prop instead.
371
+ *
368
372
  * @default {}
369
373
  */
370
374
  components: _propTypes.default.shape({
@@ -372,7 +376,12 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
372
376
  }),
373
377
 
374
378
  /**
375
- * The props used for each slot inside the Input.
379
+ * The extra props for the slot components.
380
+ * You can override the existing props or add new ones.
381
+ *
382
+ * This prop is an alias for the `slotProps` prop.
383
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
384
+ *
376
385
  * @default {}
377
386
  */
378
387
  componentsProps: _propTypes.default.shape({
@@ -442,6 +451,29 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
442
451
  */
443
452
  selected: _propTypes.default.bool,
444
453
 
454
+ /**
455
+ * The extra props for the slot components.
456
+ * You can override the existing props or add new ones.
457
+ *
458
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
459
+ *
460
+ * @default {}
461
+ */
462
+ slotProps: _propTypes.default.shape({
463
+ root: _propTypes.default.object
464
+ }),
465
+
466
+ /**
467
+ * The components used for each slot inside.
468
+ *
469
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
470
+ *
471
+ * @default {}
472
+ */
473
+ slots: _propTypes.default.shape({
474
+ root: _propTypes.default.elementType
475
+ }),
476
+
445
477
  /**
446
478
  * The system prop that allows defining system overrides as well as additional CSS styles.
447
479
  */
@@ -150,11 +150,11 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
150
150
  } = props,
151
151
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
152
152
  const context = React.useContext(_ListContext.default);
153
- const childContext = {
153
+ const childContext = React.useMemo(() => ({
154
154
  dense: dense || context.dense || false,
155
155
  alignItems,
156
156
  disableGutters
157
- };
157
+ }), [alignItems, context.dense, dense, disableGutters]);
158
158
  const listItemRef = React.useRef(null);
159
159
  (0, _useEnhancedEffect.default)(() => {
160
160
  if (autoFocus) {
@@ -176,10 +176,10 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
176
176
  } = props,
177
177
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
178
178
  const context = React.useContext(_ListContext.default);
179
- const childContext = {
179
+ const childContext = React.useMemo(() => ({
180
180
  dense: dense || context.dense || false,
181
181
  disableGutters
182
- };
182
+ }), [context.dense, dense, disableGutters]);
183
183
  const menuItemRef = React.useRef(null);
184
184
  (0, _useEnhancedEffect.default)(() => {
185
185
  if (autoFocus) {
package/Modal/Modal.d.ts CHANGED
@@ -32,8 +32,11 @@ export type ModalTypeMap<D extends React.ElementType = 'div', P = {}> = ExtendMo
32
32
  */
33
33
  BackdropProps?: Partial<BackdropProps>;
34
34
  /**
35
- * The components used for each slot inside the Modal.
36
- * Either a string to use a HTML element or a component.
35
+ * The components used for each slot inside.
36
+ *
37
+ * This prop is an alias for the `slots` prop.
38
+ * It's recommended to use the `slots` prop instead.
39
+ *
37
40
  * @default {}
38
41
  */
39
42
  components?: {
@@ -41,7 +44,12 @@ export type ModalTypeMap<D extends React.ElementType = 'div', P = {}> = ExtendMo
41
44
  Backdrop?: React.ElementType;
42
45
  };
43
46
  /**
44
- * The props used for each slot inside the Modal.
47
+ * The extra props for the slot components.
48
+ * You can override the existing props or add new ones.
49
+ *
50
+ * This prop is an alias for the `slotProps` prop.
51
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
52
+ *
45
53
  * @default {}
46
54
  */
47
55
  componentsProps?: ModalUnstyledTypeMap['props']['slotProps'];
package/Modal/Modal.js CHANGED
@@ -210,8 +210,11 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
210
210
  component: _propTypes.default.elementType,
211
211
 
212
212
  /**
213
- * The components used for each slot inside the Modal.
214
- * Either a string to use a HTML element or a component.
213
+ * The components used for each slot inside.
214
+ *
215
+ * This prop is an alias for the `slots` prop.
216
+ * It's recommended to use the `slots` prop instead.
217
+ *
215
218
  * @default {}
216
219
  */
217
220
  components: _propTypes.default.shape({
@@ -220,7 +223,12 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
220
223
  }),
221
224
 
222
225
  /**
223
- * The props used for each slot inside the Modal.
226
+ * The extra props for the slot components.
227
+ * You can override the existing props or add new ones.
228
+ *
229
+ * This prop is an alias for the `slotProps` prop.
230
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
231
+ *
224
232
  * @default {}
225
233
  */
226
234
  componentsProps: _propTypes.default.shape({
@@ -64,12 +64,14 @@ const nativeSelectSelectStyles = ({
64
64
  borderRadius: 0,
65
65
  // Reset
66
66
  cursor: 'pointer',
67
- '&:focus': {
68
- // Show that it's not an text input
69
- backgroundColor: theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)',
67
+ '&:focus': (0, _extends2.default)({}, theme.vars ? {
68
+ backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.05)`
69
+ } : {
70
+ backgroundColor: theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)'
71
+ }, {
70
72
  borderRadius: 0 // Reset Chrome style
71
73
 
72
- },
74
+ }),
73
75
  // Remove IE11 arrow
74
76
  '&::-ms-expand': {
75
77
  display: 'none'
@@ -81,7 +83,7 @@ const nativeSelectSelectStyles = ({
81
83
  height: 'auto'
82
84
  },
83
85
  '&:not([multiple]) option, &:not([multiple]) optgroup': {
84
- backgroundColor: theme.palette.background.paper
86
+ backgroundColor: (theme.vars || theme).palette.background.paper
85
87
  },
86
88
  // Bump specificity to allow extending custom inputs
87
89
  '&&&': {
@@ -94,9 +96,9 @@ const nativeSelectSelectStyles = ({
94
96
  paddingRight: 32
95
97
  }
96
98
  }, ownerState.variant === 'outlined' && {
97
- borderRadius: theme.shape.borderRadius,
99
+ borderRadius: (theme.vars || theme).shape.borderRadius,
98
100
  '&:focus': {
99
- borderRadius: theme.shape.borderRadius // Reset the reset for Chrome style
101
+ borderRadius: (theme.vars || theme).shape.borderRadius // Reset the reset for Chrome style
100
102
 
101
103
  },
102
104
  '&&&': {
@@ -131,9 +133,9 @@ const nativeSelectIconStyles = ({
131
133
  // Center vertically, height is 1em
132
134
  pointerEvents: 'none',
133
135
  // Don't block pointer events on the select under the icon.
134
- color: theme.palette.action.active,
136
+ color: (theme.vars || theme).palette.action.active,
135
137
  [`&.${_nativeSelectClasses.default.disabled}`]: {
136
- color: theme.palette.action.disabled
138
+ color: (theme.vars || theme).palette.action.disabled
137
139
  }
138
140
  }, ownerState.open && {
139
141
  transform: 'rotate(180deg)'
@@ -35,7 +35,7 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
35
35
 
36
36
  var _jsxRuntime = require("react/jsx-runtime");
37
37
 
38
- const _excluded = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "type"];
38
+ const _excluded = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "slots", "type"];
39
39
 
40
40
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
41
41
 
@@ -145,7 +145,7 @@ const OutlinedInputInput = (0, _styled.default)(_InputBase.InputBaseComponent, {
145
145
  paddingRight: 0
146
146
  }));
147
147
  const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps, ref) {
148
- var _React$Fragment;
148
+ var _ref, _slots$root, _ref2, _slots$input, _React$Fragment;
149
149
 
150
150
  const props = (0, _useThemeProps.default)({
151
151
  props: inProps,
@@ -158,6 +158,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
158
158
  label,
159
159
  multiline = false,
160
160
  notched,
161
+ slots = {},
161
162
  type = 'text'
162
163
  } = props,
163
164
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
@@ -180,11 +181,13 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
180
181
  size: fcs.size,
181
182
  type
182
183
  });
184
+ const RootSlot = (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : OutlinedInputRoot;
185
+ const InputSlot = (_ref2 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref2 : OutlinedInputInput;
183
186
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputBase.default, (0, _extends2.default)({
184
- components: (0, _extends2.default)({
185
- Root: OutlinedInputRoot,
186
- Input: OutlinedInputInput
187
- }, components),
187
+ slots: {
188
+ root: RootSlot,
189
+ input: InputSlot
190
+ },
188
191
  renderSuffix: state => /*#__PURE__*/(0, _jsxRuntime.jsx)(NotchedOutlineRoot, {
189
192
  ownerState: ownerState,
190
193
  className: classes.notchedOutline,
@@ -240,8 +243,11 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes
240
243
  .oneOfType([_propTypes.default.oneOf(['primary', 'secondary']), _propTypes.default.string]),
241
244
 
242
245
  /**
243
- * The components used for each slot inside the InputBase.
244
- * Either a string to use a HTML element or a component.
246
+ * The components used for each slot inside.
247
+ *
248
+ * This prop is an alias for the `slots` prop.
249
+ * It's recommended to use the `slots` prop instead.
250
+ *
245
251
  * @default {}
246
252
  */
247
253
  components: _propTypes.default.shape({
@@ -369,6 +375,18 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes
369
375
  */
370
376
  rows: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
371
377
 
378
+ /**
379
+ * The components used for each slot inside.
380
+ *
381
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
382
+ *
383
+ * @default {}
384
+ */
385
+ slots: _propTypes.default.shape({
386
+ input: _propTypes.default.elementType,
387
+ root: _propTypes.default.elementType
388
+ }),
389
+
372
390
  /**
373
391
  * Start `InputAdornment` for this component.
374
392
  */
@@ -29,13 +29,12 @@ export interface PaginationItemTypeMap<P = {}, D extends React.ElementType = 'di
29
29
  PaginationItemPropsColorOverrides
30
30
  >;
31
31
  /**
32
- * The components used for first, last, next & previous item type
33
- * @default {
34
- * first: FirstPageIcon,
35
- * last: LastPageIcon,
36
- * next: NavigateNextIcon,
37
- * previous: NavigateBeforeIcon,
38
- * }
32
+ * The components used for each slot inside.
33
+ *
34
+ * This prop is an alias for the `slots` prop.
35
+ * It's recommended to use the `slots` prop instead.
36
+ *
37
+ * @default {}
39
38
  */
40
39
  components?: {
41
40
  first?: React.ElementType;
@@ -67,6 +66,19 @@ export interface PaginationItemTypeMap<P = {}, D extends React.ElementType = 'di
67
66
  * @default 'medium'
68
67
  */
69
68
  size?: OverridableStringUnion<'small' | 'medium' | 'large', PaginationItemPropsSizeOverrides>;
69
+ /**
70
+ * The components used for each slot inside.
71
+ *
72
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
73
+ *
74
+ * @default {}
75
+ */
76
+ slots?: {
77
+ first?: React.ElementType;
78
+ last?: React.ElementType;
79
+ next?: React.ElementType;
80
+ previous?: React.ElementType;
81
+ };
70
82
  /**
71
83
  * The system prop that allows defining system overrides as well as additional CSS styles.
72
84
  */
@@ -43,7 +43,7 @@ var _styled = _interopRequireDefault(require("../styles/styled"));
43
43
 
44
44
  var _jsxRuntime = require("react/jsx-runtime");
45
45
 
46
- const _excluded = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "type", "variant"];
46
+ const _excluded = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "slots", "type", "variant"];
47
47
 
48
48
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
49
49
 
@@ -245,17 +245,13 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
245
245
  className,
246
246
  color = 'standard',
247
247
  component,
248
- components = {
249
- first: _FirstPage.default,
250
- last: _LastPage.default,
251
- next: _NavigateNext.default,
252
- previous: _NavigateBefore.default
253
- },
248
+ components = {},
254
249
  disabled = false,
255
250
  page,
256
251
  selected = false,
257
252
  shape = 'circular',
258
253
  size = 'medium',
254
+ slots = {},
259
255
  type = 'page',
260
256
  variant = 'text'
261
257
  } = props,
@@ -272,15 +268,15 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
272
268
  const theme = (0, _useTheme.default)();
273
269
  const classes = useUtilityClasses(ownerState);
274
270
  const normalizedIcons = theme.direction === 'rtl' ? {
275
- previous: components.next || _NavigateNext.default,
276
- next: components.previous || _NavigateBefore.default,
277
- last: components.first || _FirstPage.default,
278
- first: components.last || _LastPage.default
271
+ previous: slots.next || components.next || _NavigateNext.default,
272
+ next: slots.previous || components.previous || _NavigateBefore.default,
273
+ last: slots.first || components.first || _FirstPage.default,
274
+ first: slots.last || components.last || _LastPage.default
279
275
  } : {
280
- previous: components.previous || _NavigateBefore.default,
281
- next: components.next || _NavigateNext.default,
282
- first: components.first || _FirstPage.default,
283
- last: components.last || _LastPage.default
276
+ previous: slots.previous || components.previous || _NavigateBefore.default,
277
+ next: slots.next || components.next || _NavigateNext.default,
278
+ first: slots.first || components.first || _FirstPage.default,
279
+ last: slots.last || components.last || _LastPage.default
284
280
  };
285
281
  const Icon = normalizedIcons[type];
286
282
  return type === 'start-ellipsis' || type === 'end-ellipsis' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PaginationItemEllipsis, {
@@ -342,13 +338,12 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes
342
338
  component: _propTypes.default.elementType,
343
339
 
344
340
  /**
345
- * The components used for first, last, next & previous item type
346
- * @default {
347
- * first: FirstPageIcon,
348
- * last: LastPageIcon,
349
- * next: NavigateNextIcon,
350
- * previous: NavigateBeforeIcon,
351
- * }
341
+ * The components used for each slot inside.
342
+ *
343
+ * This prop is an alias for the `slots` prop.
344
+ * It's recommended to use the `slots` prop instead.
345
+ *
346
+ * @default {}
352
347
  */
353
348
  components: _propTypes.default.shape({
354
349
  first: _propTypes.default.elementType,
@@ -388,6 +383,20 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes
388
383
  /* @typescript-to-proptypes-ignore */
389
384
  .oneOfType([_propTypes.default.oneOf(['small', 'medium', 'large']), _propTypes.default.string]),
390
385
 
386
+ /**
387
+ * The components used for each slot inside.
388
+ *
389
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
390
+ *
391
+ * @default {}
392
+ */
393
+ slots: _propTypes.default.shape({
394
+ first: _propTypes.default.elementType,
395
+ last: _propTypes.default.elementType,
396
+ next: _propTypes.default.elementType,
397
+ previous: _propTypes.default.elementType
398
+ }),
399
+
391
400
  /**
392
401
  * The system prop that allows defining system overrides as well as additional CSS styles.
393
402
  */
package/README.md CHANGED
@@ -140,6 +140,7 @@ via [OpenCollective](https://opencollective.com/mui) or via [Patreon](https://ww
140
140
  <a href="https://www.dialmycalls.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/dialmycalls/f5ae9ab/avatar/192.png" alt="dialmycalls.com" title="Send text messages, calls & emails to thousands with ease." loading="lazy" /></a>
141
141
  <a href="https://goread.io/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/goread_io/eb6337d/logo/192.png" alt="goread.io" title="Instagram followers, likes, power likes, views, comments, saves in minutes." loading="lazy" /></a>
142
142
  <a href="https://icons8.com?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/icons8/7fa1641/logo/192.png" alt="Icons8" title="We provide the neat icons, photos, illustrations, and music. Developers, use our API to insert all the content we have into your apps." loading="lazy"></a>
143
+ <a href="https://ipinfo.ai?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/ipinfoai/04f41d5/logo/192.png" alt="ipinfo.ai" title="We offer various IP data API services, including IP Geolocation Data, ASN Data, Company Data, IP Ranges Data, Abuse Contacts Data, Anonymous Browsing Detection, etc." loading="lazy"></a>
143
144
  </p>
144
145
 
145
146
  Gold Sponsors are those who have pledged \$500/month or more to MUI.
package/Radio/Radio.js CHANGED
@@ -72,7 +72,8 @@ const RadioRoot = (0, _styled.default)(_SwitchBase.default, {
72
72
  theme,
73
73
  ownerState
74
74
  }) => (0, _extends2.default)({
75
- color: (theme.vars || theme).palette.text.secondary,
75
+ color: (theme.vars || theme).palette.text.secondary
76
+ }, !ownerState.disableRipple && {
76
77
  '&:hover': {
77
78
  backgroundColor: theme.vars ? `rgba(${ownerState.color === 'default' ? theme.vars.palette.action.activeChannel : theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _system.alpha)(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
78
79
  // Reset on touch devices, it doesn't add specificity