@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
@@ -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", "inputComponent", "multiline", "type"];
3
+ const _excluded = ["disableUnderline", "components", "componentsProps", "fullWidth", "inputComponent", "multiline", "slotProps", "slots", "type"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_composeClasses as composeClasses } from '@mui/base';
@@ -111,6 +111,8 @@ const InputInput = styled(InputBaseInput, {
111
111
  overridesResolver: inputBaseInputOverridesResolver
112
112
  })({});
113
113
  const Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
114
+ var _ref, _slots$root, _ref2, _slots$input;
115
+
114
116
  const props = useThemeProps({
115
117
  props: inProps,
116
118
  name: 'MuiInput'
@@ -123,6 +125,8 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
123
125
  fullWidth = false,
124
126
  inputComponent = 'input',
125
127
  multiline = false,
128
+ slotProps,
129
+ slots = {},
126
130
  type = 'text'
127
131
  } = props,
128
132
  other = _objectWithoutPropertiesLoose(props, _excluded);
@@ -136,13 +140,15 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
136
140
  ownerState
137
141
  }
138
142
  };
139
- const componentsProps = componentsPropsProp ? deepmerge(componentsPropsProp, inputComponentsProps) : inputComponentsProps;
143
+ const componentsProps = (slotProps != null ? slotProps : componentsPropsProp) ? deepmerge(slotProps != null ? slotProps : componentsPropsProp, inputComponentsProps) : inputComponentsProps;
144
+ const RootSlot = (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : InputRoot;
145
+ const InputSlot = (_ref2 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref2 : InputInput;
140
146
  return /*#__PURE__*/_jsx(InputBase, _extends({
141
- components: _extends({
142
- Root: InputRoot,
143
- Input: InputInput
144
- }, components),
145
- componentsProps: componentsProps,
147
+ slots: {
148
+ root: RootSlot,
149
+ input: InputSlot
150
+ },
151
+ slotProps: componentsProps,
146
152
  fullWidth: fullWidth,
147
153
  inputComponent: inputComponent,
148
154
  multiline: multiline,
@@ -188,8 +194,11 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
188
194
  .oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
189
195
 
190
196
  /**
191
- * The components used for each slot inside the InputBase.
192
- * Either a string to use a HTML element or a component.
197
+ * The components used for each slot inside.
198
+ *
199
+ * This prop is an alias for the `slots` prop.
200
+ * It's recommended to use the `slots` prop instead.
201
+ *
193
202
  * @default {}
194
203
  */
195
204
  components: PropTypes.shape({
@@ -198,7 +207,12 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
198
207
  }),
199
208
 
200
209
  /**
201
- * The props used for each slot inside the Input.
210
+ * The extra props for the slot components.
211
+ * You can override the existing props or add new ones.
212
+ *
213
+ * This prop is an alias for the `slotProps` prop.
214
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
215
+ *
202
216
  * @default {}
203
217
  */
204
218
  componentsProps: PropTypes.shape({
@@ -320,6 +334,31 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
320
334
  */
321
335
  rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
322
336
 
337
+ /**
338
+ * The extra props for the slot components.
339
+ * You can override the existing props or add new ones.
340
+ *
341
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
342
+ *
343
+ * @default {}
344
+ */
345
+ slotProps: PropTypes.shape({
346
+ input: PropTypes.object,
347
+ root: PropTypes.object
348
+ }),
349
+
350
+ /**
351
+ * The components used for each slot inside.
352
+ *
353
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
354
+ *
355
+ * @default {}
356
+ */
357
+ slots: PropTypes.shape({
358
+ input: PropTypes.elementType,
359
+ root: PropTypes.elementType
360
+ }),
361
+
323
362
  /**
324
363
  * Start `InputAdornment` for this component.
325
364
  */
@@ -1,7 +1,7 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
4
- 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"];
4
+ 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"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import clsx from 'clsx';
@@ -215,6 +215,8 @@ const inputGlobalStyles = /*#__PURE__*/_jsx(GlobalStyles, {
215
215
 
216
216
 
217
217
  const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref) {
218
+ var _slotProps$input;
219
+
218
220
  const props = useThemeProps({
219
221
  props: inProps,
220
222
  name: 'MuiInputBase'
@@ -250,6 +252,8 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
250
252
  readOnly,
251
253
  renderSuffix,
252
254
  rows,
255
+ slotProps = {},
256
+ slots = {},
253
257
  startAdornment,
254
258
  type = 'text',
255
259
  value: valueProp
@@ -453,10 +457,10 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
453
457
  });
454
458
 
455
459
  const classes = useUtilityClasses(ownerState);
456
- const Root = components.Root || InputBaseRoot;
457
- const rootProps = componentsProps.root || {};
458
- const Input = components.Input || InputBaseComponent;
459
- inputProps = _extends({}, inputProps, componentsProps.input);
460
+ const Root = slots.root || components.Root || InputBaseRoot;
461
+ const rootProps = slotProps.root || componentsProps.root || {};
462
+ const Input = slots.input || components.Input || InputBaseComponent;
463
+ inputProps = _extends({}, inputProps, (_slotProps$input = slotProps.input) != null ? _slotProps$input : componentsProps.input);
460
464
  return /*#__PURE__*/_jsxs(React.Fragment, {
461
465
  children: [!disableInjectingGlobalStyles && inputGlobalStyles, /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, !isHostComponent(Root) && {
462
466
  ownerState: _extends({}, ownerState, rootProps.ownerState)
@@ -548,8 +552,11 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
548
552
  .oneOfType([PropTypes.oneOf(['primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
549
553
 
550
554
  /**
551
- * The components used for each slot inside the InputBase.
552
- * Either a string to use a HTML element or a component.
555
+ * The components used for each slot inside.
556
+ *
557
+ * This prop is an alias for the `slots` prop.
558
+ * It's recommended to use the `slots` prop instead.
559
+ *
553
560
  * @default {}
554
561
  */
555
562
  components: PropTypes.shape({
@@ -558,7 +565,12 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
558
565
  }),
559
566
 
560
567
  /**
561
- * The props used for each slot inside the Input.
568
+ * The extra props for the slot components.
569
+ * You can override the existing props or add new ones.
570
+ *
571
+ * This prop is an alias for the `slotProps` prop.
572
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
573
+ *
562
574
  * @default {}
563
575
  */
564
576
  componentsProps: PropTypes.shape({
@@ -726,6 +738,31 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
726
738
  /* @typescript-to-proptypes-ignore */
727
739
  .oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),
728
740
 
741
+ /**
742
+ * The extra props for the slot components.
743
+ * You can override the existing props or add new ones.
744
+ *
745
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
746
+ *
747
+ * @default {}
748
+ */
749
+ slotProps: PropTypes.shape({
750
+ input: PropTypes.object,
751
+ root: PropTypes.object
752
+ }),
753
+
754
+ /**
755
+ * The components used for each slot inside.
756
+ *
757
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
758
+ *
759
+ * @default {}
760
+ */
761
+ slots: PropTypes.shape({
762
+ input: PropTypes.elementType,
763
+ root: PropTypes.elementType
764
+ }),
765
+
729
766
  /**
730
767
  * Start `InputAdornment` for this component.
731
768
  */
@@ -1,7 +1,7 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["className"],
4
- _excluded2 = ["alignItems", "autoFocus", "button", "children", "className", "component", "components", "componentsProps", "ContainerComponent", "ContainerProps", "dense", "disabled", "disableGutters", "disablePadding", "divider", "focusVisibleClassName", "secondaryAction", "selected"];
4
+ _excluded2 = ["alignItems", "autoFocus", "button", "children", "className", "component", "components", "componentsProps", "ContainerComponent", "ContainerProps", "dense", "disabled", "disableGutters", "disablePadding", "divider", "focusVisibleClassName", "secondaryAction", "selected", "slotProps", "slots"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import clsx from 'clsx';
@@ -159,17 +159,19 @@ const ListItem = /*#__PURE__*/React.forwardRef(function ListItem(inProps, ref) {
159
159
  divider = false,
160
160
  focusVisibleClassName,
161
161
  secondaryAction,
162
- selected = false
162
+ selected = false,
163
+ slotProps = {},
164
+ slots = {}
163
165
  } = props,
164
166
  ContainerProps = _objectWithoutPropertiesLoose(props.ContainerProps, _excluded),
165
167
  other = _objectWithoutPropertiesLoose(props, _excluded2);
166
168
 
167
169
  const context = React.useContext(ListContext);
168
- const childContext = {
170
+ const childContext = React.useMemo(() => ({
169
171
  dense: dense || context.dense || false,
170
172
  alignItems,
171
173
  disableGutters
172
- };
174
+ }), [alignItems, context.dense, dense, disableGutters]);
173
175
  const listItemRef = React.useRef(null);
174
176
  useEnhancedEffect(() => {
175
177
  if (autoFocus) {
@@ -199,8 +201,8 @@ const ListItem = /*#__PURE__*/React.forwardRef(function ListItem(inProps, ref) {
199
201
 
200
202
  const classes = useUtilityClasses(ownerState);
201
203
  const handleRef = useForkRef(listItemRef, ref);
202
- const Root = components.Root || ListItemRoot;
203
- const rootProps = componentsProps.root || {};
204
+ const Root = slots.root || components.Root || ListItemRoot;
205
+ const rootProps = slotProps.root || componentsProps.root || {};
204
206
 
205
207
  const componentProps = _extends({
206
208
  className: clsx(classes.root, rootProps.className, className),
@@ -250,8 +252,7 @@ const ListItem = /*#__PURE__*/React.forwardRef(function ListItem(inProps, ref) {
250
252
  value: childContext,
251
253
  children: /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, {
252
254
  as: Component,
253
- ref: handleRef,
254
- ownerState: ownerState
255
+ ref: handleRef
255
256
  }, !isHostComponent(Root) && {
256
257
  ownerState: _extends({}, ownerState, rootProps.ownerState)
257
258
  }, componentProps, {
@@ -334,8 +335,11 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
334
335
  component: PropTypes.elementType,
335
336
 
336
337
  /**
337
- * The components used for each slot inside the InputBase.
338
- * Either a string to use a HTML element or a component.
338
+ * The components used for each slot inside.
339
+ *
340
+ * This prop is an alias for the `slots` prop.
341
+ * It's recommended to use the `slots` prop instead.
342
+ *
339
343
  * @default {}
340
344
  */
341
345
  components: PropTypes.shape({
@@ -343,7 +347,12 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
343
347
  }),
344
348
 
345
349
  /**
346
- * The props used for each slot inside the Input.
350
+ * The extra props for the slot components.
351
+ * You can override the existing props or add new ones.
352
+ *
353
+ * This prop is an alias for the `slotProps` prop.
354
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
355
+ *
347
356
  * @default {}
348
357
  */
349
358
  componentsProps: PropTypes.shape({
@@ -413,6 +422,29 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
413
422
  */
414
423
  selected: PropTypes.bool,
415
424
 
425
+ /**
426
+ * The extra props for the slot components.
427
+ * You can override the existing props or add new ones.
428
+ *
429
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
430
+ *
431
+ * @default {}
432
+ */
433
+ slotProps: PropTypes.shape({
434
+ root: PropTypes.object
435
+ }),
436
+
437
+ /**
438
+ * The components used for each slot inside.
439
+ *
440
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
441
+ *
442
+ * @default {}
443
+ */
444
+ slots: PropTypes.shape({
445
+ root: PropTypes.elementType
446
+ }),
447
+
416
448
  /**
417
449
  * The system prop that allows defining system overrides as well as additional CSS styles.
418
450
  */
@@ -121,11 +121,11 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
121
121
  other = _objectWithoutPropertiesLoose(props, _excluded);
122
122
 
123
123
  const context = React.useContext(ListContext);
124
- const childContext = {
124
+ const childContext = React.useMemo(() => ({
125
125
  dense: dense || context.dense || false,
126
126
  alignItems,
127
127
  disableGutters
128
- };
128
+ }), [alignItems, context.dense, dense, disableGutters]);
129
129
  const listItemRef = React.useRef(null);
130
130
  useEnhancedEffect(() => {
131
131
  if (autoFocus) {
@@ -144,10 +144,10 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
144
144
  other = _objectWithoutPropertiesLoose(props, _excluded);
145
145
 
146
146
  const context = React.useContext(ListContext);
147
- const childContext = {
147
+ const childContext = React.useMemo(() => ({
148
148
  dense: dense || context.dense || false,
149
149
  disableGutters
150
- };
150
+ }), [context.dense, dense, disableGutters]);
151
151
  const menuItemRef = React.useRef(null);
152
152
  useEnhancedEffect(() => {
153
153
  if (autoFocus) {
@@ -188,8 +188,11 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
188
188
  component: PropTypes.elementType,
189
189
 
190
190
  /**
191
- * The components used for each slot inside the Modal.
192
- * Either a string to use a HTML element or a component.
191
+ * The components used for each slot inside.
192
+ *
193
+ * This prop is an alias for the `slots` prop.
194
+ * It's recommended to use the `slots` prop instead.
195
+ *
193
196
  * @default {}
194
197
  */
195
198
  components: PropTypes.shape({
@@ -198,7 +201,12 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
198
201
  }),
199
202
 
200
203
  /**
201
- * The props used for each slot inside the Modal.
204
+ * The extra props for the slot components.
205
+ * You can override the existing props or add new ones.
206
+ *
207
+ * This prop is an alias for the `slotProps` prop.
208
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
209
+ *
202
210
  * @default {}
203
211
  */
204
212
  componentsProps: PropTypes.shape({
@@ -41,12 +41,14 @@ export const nativeSelectSelectStyles = ({
41
41
  borderRadius: 0,
42
42
  // Reset
43
43
  cursor: 'pointer',
44
- '&:focus': {
45
- // Show that it's not an text input
46
- backgroundColor: theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)',
44
+ '&:focus': _extends({}, theme.vars ? {
45
+ backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.05)`
46
+ } : {
47
+ backgroundColor: theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)'
48
+ }, {
47
49
  borderRadius: 0 // Reset Chrome style
48
50
 
49
- },
51
+ }),
50
52
  // Remove IE11 arrow
51
53
  '&::-ms-expand': {
52
54
  display: 'none'
@@ -58,7 +60,7 @@ export const nativeSelectSelectStyles = ({
58
60
  height: 'auto'
59
61
  },
60
62
  '&:not([multiple]) option, &:not([multiple]) optgroup': {
61
- backgroundColor: theme.palette.background.paper
63
+ backgroundColor: (theme.vars || theme).palette.background.paper
62
64
  },
63
65
  // Bump specificity to allow extending custom inputs
64
66
  '&&&': {
@@ -71,9 +73,9 @@ export const nativeSelectSelectStyles = ({
71
73
  paddingRight: 32
72
74
  }
73
75
  }, ownerState.variant === 'outlined' && {
74
- borderRadius: theme.shape.borderRadius,
76
+ borderRadius: (theme.vars || theme).shape.borderRadius,
75
77
  '&:focus': {
76
- borderRadius: theme.shape.borderRadius // Reset the reset for Chrome style
78
+ borderRadius: (theme.vars || theme).shape.borderRadius // Reset the reset for Chrome style
77
79
 
78
80
  },
79
81
  '&&&': {
@@ -105,9 +107,9 @@ export const nativeSelectIconStyles = ({
105
107
  // Center vertically, height is 1em
106
108
  pointerEvents: 'none',
107
109
  // Don't block pointer events on the select under the icon.
108
- color: theme.palette.action.active,
110
+ color: (theme.vars || theme).palette.action.active,
109
111
  [`&.${nativeSelectClasses.disabled}`]: {
110
- color: theme.palette.action.disabled
112
+ color: (theme.vars || theme).palette.action.disabled
111
113
  }
112
114
  }, ownerState.open && {
113
115
  transform: 'rotate(180deg)'
@@ -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 = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "type"];
3
+ const _excluded = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "slots", "type"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { refType } from '@mui/utils';
@@ -119,7 +119,7 @@ const OutlinedInputInput = styled(InputBaseInput, {
119
119
  paddingRight: 0
120
120
  }));
121
121
  const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps, ref) {
122
- var _React$Fragment;
122
+ var _ref, _slots$root, _ref2, _slots$input, _React$Fragment;
123
123
 
124
124
  const props = useThemeProps({
125
125
  props: inProps,
@@ -133,6 +133,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
133
133
  label,
134
134
  multiline = false,
135
135
  notched,
136
+ slots = {},
136
137
  type = 'text'
137
138
  } = props,
138
139
  other = _objectWithoutPropertiesLoose(props, _excluded);
@@ -158,11 +159,13 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
158
159
  type
159
160
  });
160
161
 
162
+ const RootSlot = (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : OutlinedInputRoot;
163
+ const InputSlot = (_ref2 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref2 : OutlinedInputInput;
161
164
  return /*#__PURE__*/_jsx(InputBase, _extends({
162
- components: _extends({
163
- Root: OutlinedInputRoot,
164
- Input: OutlinedInputInput
165
- }, components),
165
+ slots: {
166
+ root: RootSlot,
167
+ input: InputSlot
168
+ },
166
169
  renderSuffix: state => /*#__PURE__*/_jsx(NotchedOutlineRoot, {
167
170
  ownerState: ownerState,
168
171
  className: classes.notchedOutline,
@@ -218,8 +221,11 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes
218
221
  .oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
219
222
 
220
223
  /**
221
- * The components used for each slot inside the InputBase.
222
- * Either a string to use a HTML element or a component.
224
+ * The components used for each slot inside.
225
+ *
226
+ * This prop is an alias for the `slots` prop.
227
+ * It's recommended to use the `slots` prop instead.
228
+ *
223
229
  * @default {}
224
230
  */
225
231
  components: PropTypes.shape({
@@ -347,6 +353,18 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes
347
353
  */
348
354
  rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
349
355
 
356
+ /**
357
+ * The components used for each slot inside.
358
+ *
359
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
360
+ *
361
+ * @default {}
362
+ */
363
+ slots: PropTypes.shape({
364
+ input: PropTypes.elementType,
365
+ root: PropTypes.elementType
366
+ }),
367
+
350
368
  /**
351
369
  * Start `InputAdornment` for this component.
352
370
  */
@@ -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 = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "type", "variant"];
3
+ const _excluded = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "slots", "type", "variant"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
@@ -216,17 +216,13 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
216
216
  className,
217
217
  color = 'standard',
218
218
  component,
219
- components = {
220
- first: FirstPageIcon,
221
- last: LastPageIcon,
222
- next: NavigateNextIcon,
223
- previous: NavigateBeforeIcon
224
- },
219
+ components = {},
225
220
  disabled = false,
226
221
  page,
227
222
  selected = false,
228
223
  shape = 'circular',
229
224
  size = 'medium',
225
+ slots = {},
230
226
  type = 'page',
231
227
  variant = 'text'
232
228
  } = props,
@@ -245,15 +241,15 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
245
241
  const theme = useTheme();
246
242
  const classes = useUtilityClasses(ownerState);
247
243
  const normalizedIcons = theme.direction === 'rtl' ? {
248
- previous: components.next || NavigateNextIcon,
249
- next: components.previous || NavigateBeforeIcon,
250
- last: components.first || FirstPageIcon,
251
- first: components.last || LastPageIcon
244
+ previous: slots.next || components.next || NavigateNextIcon,
245
+ next: slots.previous || components.previous || NavigateBeforeIcon,
246
+ last: slots.first || components.first || FirstPageIcon,
247
+ first: slots.last || components.last || LastPageIcon
252
248
  } : {
253
- previous: components.previous || NavigateBeforeIcon,
254
- next: components.next || NavigateNextIcon,
255
- first: components.first || FirstPageIcon,
256
- last: components.last || LastPageIcon
249
+ previous: slots.previous || components.previous || NavigateBeforeIcon,
250
+ next: slots.next || components.next || NavigateNextIcon,
251
+ first: slots.first || components.first || FirstPageIcon,
252
+ last: slots.last || components.last || LastPageIcon
257
253
  };
258
254
  const Icon = normalizedIcons[type];
259
255
  return type === 'start-ellipsis' || type === 'end-ellipsis' ? /*#__PURE__*/_jsx(PaginationItemEllipsis, {
@@ -315,13 +311,12 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes
315
311
  component: PropTypes.elementType,
316
312
 
317
313
  /**
318
- * The components used for first, last, next & previous item type
319
- * @default {
320
- * first: FirstPageIcon,
321
- * last: LastPageIcon,
322
- * next: NavigateNextIcon,
323
- * previous: NavigateBeforeIcon,
324
- * }
314
+ * The components used for each slot inside.
315
+ *
316
+ * This prop is an alias for the `slots` prop.
317
+ * It's recommended to use the `slots` prop instead.
318
+ *
319
+ * @default {}
325
320
  */
326
321
  components: PropTypes.shape({
327
322
  first: PropTypes.elementType,
@@ -361,6 +356,20 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes
361
356
  /* @typescript-to-proptypes-ignore */
362
357
  .oneOfType([PropTypes.oneOf(['small', 'medium', 'large']), PropTypes.string]),
363
358
 
359
+ /**
360
+ * The components used for each slot inside.
361
+ *
362
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
363
+ *
364
+ * @default {}
365
+ */
366
+ slots: PropTypes.shape({
367
+ first: PropTypes.elementType,
368
+ last: PropTypes.elementType,
369
+ next: PropTypes.elementType,
370
+ previous: PropTypes.elementType
371
+ }),
372
+
364
373
  /**
365
374
  * The system prop that allows defining system overrides as well as additional CSS styles.
366
375
  */
@@ -42,7 +42,8 @@ const RadioRoot = styled(SwitchBase, {
42
42
  theme,
43
43
  ownerState
44
44
  }) => _extends({
45
- color: (theme.vars || theme).palette.text.secondary,
45
+ color: (theme.vars || theme).palette.text.secondary
46
+ }, !ownerState.disableRipple && {
46
47
  '&:hover': {
47
48
  backgroundColor: theme.vars ? `rgba(${ownerState.color === 'default' ? theme.vars.palette.action.activeChannel : theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
48
49
  // Reset on touch devices, it doesn't add specificity
@@ -42,22 +42,22 @@ const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref)
42
42
  }
43
43
  }), []);
44
44
  const handleRef = useForkRef(ref, rootRef);
45
+ const name = useId(nameProp);
46
+ const contextValue = React.useMemo(() => ({
47
+ name,
45
48
 
46
- const handleChange = event => {
47
- setValueState(event.target.value);
49
+ onChange(event) {
50
+ setValueState(event.target.value);
48
51
 
49
- if (onChange) {
50
- onChange(event, event.target.value);
51
- }
52
- };
52
+ if (onChange) {
53
+ onChange(event, event.target.value);
54
+ }
55
+ },
53
56
 
54
- const name = useId(nameProp);
57
+ value
58
+ }), [name, onChange, setValueState, value]);
55
59
  return /*#__PURE__*/_jsx(RadioGroupContext.Provider, {
56
- value: {
57
- name,
58
- onChange: handleChange,
59
- value
60
- },
60
+ value: contextValue,
61
61
  children: /*#__PURE__*/_jsx(FormGroup, _extends({
62
62
  role: "radiogroup",
63
63
  ref: handleRef
@@ -244,14 +244,14 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
244
244
  *
245
245
  * @param {SelectChangeEvent<T>} event The event source of the callback.
246
246
  * You can pull out the new value by accessing `event.target.value` (any).
247
- * **Warning**: This is a generic event not a change event unless the change event is caused by browser autofill.
247
+ * **Warning**: This is a generic event, not a change event, unless the change event is caused by browser autofill.
248
248
  * @param {object} [child] The react element that was selected when `native` is `false` (default).
249
249
  */
250
250
  onChange: PropTypes.func,
251
251
 
252
252
  /**
253
253
  * Callback fired when the component requests to be closed.
254
- * Use in controlled mode (see open).
254
+ * Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapes).
255
255
  *
256
256
  * @param {object} event The event source of the callback.
257
257
  */
@@ -259,7 +259,7 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
259
259
 
260
260
  /**
261
261
  * Callback fired when the component requests to be opened.
262
- * Use in controlled mode (see open).
262
+ * Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select expands).
263
263
  *
264
264
  * @param {object} event The event source of the callback.
265
265
  */