@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
@@ -583,8 +583,11 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
583
583
  .oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
584
584
 
585
585
  /**
586
- * The components used for each slot inside the Slider.
587
- * Either a string to use a HTML element or a component.
586
+ * The components used for each slot inside.
587
+ *
588
+ * This prop is an alias for the `slots` prop.
589
+ * It's recommended to use the `slots` prop instead.
590
+ *
588
591
  * @default {}
589
592
  */
590
593
  components: PropTypes.shape({
@@ -599,7 +602,13 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
599
602
  }),
600
603
 
601
604
  /**
602
- * @ignore
605
+ * The extra props for the slot components.
606
+ * You can override the existing props or add new ones.
607
+ *
608
+ * This prop is an alias for the `slotProps` prop.
609
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
610
+ *
611
+ * @default {}
603
612
  */
604
613
  componentsProps: PropTypes.shape({
605
614
  input: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["children", "className", "componentsProps", "error", "icon", "optional", "StepIconComponent", "StepIconProps"];
3
+ const _excluded = ["children", "className", "componentsProps", "error", "icon", "optional", "slotProps", "StepIconComponent", "StepIconProps"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
@@ -110,6 +110,8 @@ const StepLabelLabelContainer = styled('span', {
110
110
  }
111
111
  }));
112
112
  const StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref) {
113
+ var _slotProps$label;
114
+
113
115
  const props = useThemeProps({
114
116
  props: inProps,
115
117
  name: 'MuiStepLabel'
@@ -122,6 +124,7 @@ const StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref)
122
124
  error = false,
123
125
  icon: iconProp,
124
126
  optional,
127
+ slotProps = {},
125
128
  StepIconComponent: StepIconComponentProp,
126
129
  StepIconProps
127
130
  } = props,
@@ -154,6 +157,7 @@ const StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref)
154
157
  });
155
158
 
156
159
  const classes = useUtilityClasses(ownerState);
160
+ const labelSlotProps = (_slotProps$label = slotProps.label) != null ? _slotProps$label : componentsProps.label;
157
161
  return /*#__PURE__*/_jsxs(StepLabelRoot, _extends({
158
162
  className: clsx(classes.root, className),
159
163
  ref: ref,
@@ -172,9 +176,9 @@ const StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref)
172
176
  className: classes.labelContainer,
173
177
  ownerState: ownerState,
174
178
  children: [children ? /*#__PURE__*/_jsx(StepLabelLabel, _extends({
175
- className: classes.label,
176
179
  ownerState: ownerState
177
- }, componentsProps.label, {
180
+ }, labelSlotProps, {
181
+ className: clsx(classes.label, labelSlotProps == null ? void 0 : labelSlotProps.className),
178
182
  children: children
179
183
  })) : null, optional]
180
184
  })]
@@ -227,6 +231,14 @@ process.env.NODE_ENV !== "production" ? StepLabel.propTypes
227
231
  */
228
232
  optional: PropTypes.node,
229
233
 
234
+ /**
235
+ * The props used for each slot inside.
236
+ * @default {}
237
+ */
238
+ slotProps: PropTypes.shape({
239
+ label: PropTypes.object
240
+ }),
241
+
230
242
  /**
231
243
  * The component to render in place of the [`StepIcon`](/material-ui/api/step-icon/).
232
244
  */
@@ -3,6 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
  const _excluded = ["BackdropProps"],
4
4
  _excluded2 = ["anchor", "disableBackdropTransition", "disableDiscovery", "disableSwipeToOpen", "hideBackdrop", "hysteresis", "minFlingVelocity", "ModalProps", "onClose", "onOpen", "open", "PaperProps", "SwipeAreaProps", "swipeAreaWidth", "transitionDuration", "variant"];
5
5
  import * as React from 'react';
6
+ import { flushSync } from 'react-dom';
6
7
  import PropTypes from 'prop-types';
7
8
  import { elementTypeAcceptingRef } from '@mui/utils';
8
9
  import { useThemeProps } from '@mui/system';
@@ -218,7 +219,9 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
218
219
 
219
220
  claimedSwipeInstance = null;
220
221
  touchDetected.current = false;
221
- setMaybeSwiping(false); // The swipe wasn't started.
222
+ flushSync(() => {
223
+ setMaybeSwiping(false);
224
+ }); // The swipe wasn't started.
222
225
 
223
226
  if (!swipeInstance.current.isSwiping) {
224
227
  swipeInstance.current.isSwiping = null;
@@ -420,7 +423,9 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
420
423
  claimedSwipeInstance = null;
421
424
  swipeInstance.current.startX = currentX;
422
425
  swipeInstance.current.startY = currentY;
423
- setMaybeSwiping(true);
426
+ flushSync(() => {
427
+ setMaybeSwiping(true);
428
+ });
424
429
 
425
430
  if (!open && paperRef.current) {
426
431
  // The ref may be null when a parent component updates while swiping.
@@ -476,6 +481,8 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
476
481
  BackdropProps: _extends({}, BackdropProps, {
477
482
  ref: backdropRef
478
483
  })
484
+ }, variant === 'temporary' && {
485
+ keepMounted: true
479
486
  }, ModalPropsProp),
480
487
  hideBackdrop: hideBackdrop,
481
488
  PaperProps: _extends({}, PaperProps, {
@@ -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 = ["arrow", "children", "classes", "components", "componentsProps", "describeChild", "disableFocusListener", "disableHoverListener", "disableInteractive", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "followCursor", "id", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "title", "TransitionComponent", "TransitionProps"];
3
+ const _excluded = ["arrow", "children", "classes", "components", "componentsProps", "describeChild", "disableFocusListener", "disableHoverListener", "disableInteractive", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "followCursor", "id", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "slotProps", "slots", "title", "TransitionComponent", "TransitionProps"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
@@ -215,7 +215,7 @@ function composeEventHandler(handler, eventHandler) {
215
215
 
216
216
 
217
217
  const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
218
- var _components$Popper, _ref, _components$Transitio, _components$Tooltip, _components$Arrow, _componentsProps$popp;
218
+ var _ref, _slots$popper, _ref2, _ref3, _slots$transition, _ref4, _slots$tooltip, _ref5, _slots$arrow, _slotProps$popper, _ref6, _slotProps$popper2, _slotProps$transition, _slotProps$tooltip, _ref7, _slotProps$tooltip2, _slotProps$arrow, _ref8, _slotProps$arrow2;
219
219
 
220
220
  const props = useThemeProps({
221
221
  props: inProps,
@@ -245,6 +245,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
245
245
  placement = 'bottom',
246
246
  PopperComponent: PopperComponentProp,
247
247
  PopperProps = {},
248
+ slotProps = {},
249
+ slots = {},
248
250
  title,
249
251
  TransitionComponent: TransitionComponentProp = Grow,
250
252
  TransitionProps
@@ -463,7 +465,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
463
465
  }, [handleClose, open]);
464
466
  const handleRef = useForkRef(children.ref, focusVisibleRef, setChildNode, ref); // There is no point in displaying an empty tooltip.
465
467
 
466
- if (typeof title !== 'number' && !title) {
468
+ if (!title && title !== 0) {
467
469
  open = false;
468
470
  }
469
471
 
@@ -583,14 +585,20 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
583
585
  });
584
586
 
585
587
  const classes = useUtilityClasses(ownerState);
586
- const PopperComponent = (_components$Popper = components.Popper) != null ? _components$Popper : TooltipPopper;
587
- const TransitionComponent = (_ref = (_components$Transitio = components.Transition) != null ? _components$Transitio : TransitionComponentProp) != null ? _ref : Grow;
588
- const TooltipComponent = (_components$Tooltip = components.Tooltip) != null ? _components$Tooltip : TooltipTooltip;
589
- const ArrowComponent = (_components$Arrow = components.Arrow) != null ? _components$Arrow : TooltipArrow;
590
- const popperProps = appendOwnerState(PopperComponent, _extends({}, PopperProps, componentsProps.popper), ownerState);
591
- const transitionProps = appendOwnerState(TransitionComponent, _extends({}, TransitionProps, componentsProps.transition), ownerState);
592
- const tooltipProps = appendOwnerState(TooltipComponent, _extends({}, componentsProps.tooltip), ownerState);
593
- const tooltipArrowProps = appendOwnerState(ArrowComponent, _extends({}, componentsProps.arrow), ownerState);
588
+ const PopperComponent = (_ref = (_slots$popper = slots.popper) != null ? _slots$popper : components.Popper) != null ? _ref : TooltipPopper;
589
+ const TransitionComponent = (_ref2 = (_ref3 = (_slots$transition = slots.transition) != null ? _slots$transition : components.Transition) != null ? _ref3 : TransitionComponentProp) != null ? _ref2 : Grow;
590
+ const TooltipComponent = (_ref4 = (_slots$tooltip = slots.tooltip) != null ? _slots$tooltip : components.Tooltip) != null ? _ref4 : TooltipTooltip;
591
+ const ArrowComponent = (_ref5 = (_slots$arrow = slots.arrow) != null ? _slots$arrow : components.Arrow) != null ? _ref5 : TooltipArrow;
592
+ const popperProps = appendOwnerState(PopperComponent, _extends({}, PopperProps, (_slotProps$popper = slotProps.popper) != null ? _slotProps$popper : componentsProps.popper, {
593
+ className: clsx(classes.popper, PopperProps == null ? void 0 : PopperProps.className, (_ref6 = (_slotProps$popper2 = slotProps.popper) != null ? _slotProps$popper2 : componentsProps.popper) == null ? void 0 : _ref6.className)
594
+ }), ownerState);
595
+ const transitionProps = appendOwnerState(TransitionComponent, _extends({}, TransitionProps, (_slotProps$transition = slotProps.transition) != null ? _slotProps$transition : componentsProps.transition), ownerState);
596
+ const tooltipProps = appendOwnerState(TooltipComponent, _extends({}, (_slotProps$tooltip = slotProps.tooltip) != null ? _slotProps$tooltip : componentsProps.tooltip, {
597
+ className: clsx(classes.tooltip, (_ref7 = (_slotProps$tooltip2 = slotProps.tooltip) != null ? _slotProps$tooltip2 : componentsProps.tooltip) == null ? void 0 : _ref7.className)
598
+ }), ownerState);
599
+ const tooltipArrowProps = appendOwnerState(ArrowComponent, _extends({}, (_slotProps$arrow = slotProps.arrow) != null ? _slotProps$arrow : componentsProps.arrow, {
600
+ className: clsx(classes.arrow, (_ref8 = (_slotProps$arrow2 = slotProps.arrow) != null ? _slotProps$arrow2 : componentsProps.arrow) == null ? void 0 : _ref8.className)
601
+ }), ownerState);
594
602
  return /*#__PURE__*/_jsxs(React.Fragment, {
595
603
  children: [/*#__PURE__*/React.cloneElement(children, childrenProps), /*#__PURE__*/_jsx(PopperComponent, _extends({
596
604
  as: PopperComponentProp != null ? PopperComponentProp : Popper,
@@ -610,25 +618,19 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
610
618
  id: id,
611
619
  transition: true
612
620
  }, interactiveWrapperListeners, popperProps, {
613
- className: clsx(classes.popper, PopperProps == null ? void 0 : PopperProps.className, (_componentsProps$popp = componentsProps.popper) == null ? void 0 : _componentsProps$popp.className),
614
621
  popperOptions: popperOptions,
615
622
  children: ({
616
623
  TransitionProps: TransitionPropsInner
617
- }) => {
618
- var _componentsProps$tool, _componentsProps$arro;
619
-
620
- return /*#__PURE__*/_jsx(TransitionComponent, _extends({
621
- timeout: theme.transitions.duration.shorter
622
- }, TransitionPropsInner, transitionProps, {
623
- children: /*#__PURE__*/_jsxs(TooltipComponent, _extends({}, tooltipProps, {
624
- className: clsx(classes.tooltip, (_componentsProps$tool = componentsProps.tooltip) == null ? void 0 : _componentsProps$tool.className),
625
- children: [title, arrow ? /*#__PURE__*/_jsx(ArrowComponent, _extends({}, tooltipArrowProps, {
626
- className: clsx(classes.arrow, (_componentsProps$arro = componentsProps.arrow) == null ? void 0 : _componentsProps$arro.className),
627
- ref: setArrowRef
628
- })) : null]
629
- }))
630
- }));
631
- }
624
+ }) => /*#__PURE__*/_jsx(TransitionComponent, _extends({
625
+ timeout: theme.transitions.duration.shorter
626
+ }, TransitionPropsInner, transitionProps, {
627
+ "data-foo": "bar",
628
+ children: /*#__PURE__*/_jsxs(TooltipComponent, _extends({}, tooltipProps, {
629
+ children: [title, arrow ? /*#__PURE__*/_jsx(ArrowComponent, _extends({}, tooltipArrowProps, {
630
+ ref: setArrowRef
631
+ })) : null]
632
+ }))
633
+ }))
632
634
  }))]
633
635
  });
634
636
  });
@@ -662,8 +664,11 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
662
664
  className: PropTypes.string,
663
665
 
664
666
  /**
665
- * The components used for each slot inside the Tooltip.
666
- * Either a string to use a HTML element or a component.
667
+ * The components used for each slot inside.
668
+ *
669
+ * This prop is an alias for the `slots` prop.
670
+ * It's recommended to use the `slots` prop instead.
671
+ *
667
672
  * @default {}
668
673
  */
669
674
  components: PropTypes.shape({
@@ -674,9 +679,12 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
674
679
  }),
675
680
 
676
681
  /**
677
- * The props used for each slot inside the Tooltip.
678
- * Note that `componentsProps.popper` prop values win over `PopperProps`
679
- * and `componentsProps.transition` prop values win over `TransitionProps` if both are applied.
682
+ * The extra props for the slot components.
683
+ * You can override the existing props or add new ones.
684
+ *
685
+ * This prop is an alias for the `slotProps` prop.
686
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
687
+ *
680
688
  * @default {}
681
689
  */
682
690
  componentsProps: PropTypes.shape({
@@ -799,6 +807,35 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
799
807
  */
800
808
  PopperProps: PropTypes.object,
801
809
 
810
+ /**
811
+ * The extra props for the slot components.
812
+ * You can override the existing props or add new ones.
813
+ *
814
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
815
+ *
816
+ * @default {}
817
+ */
818
+ slotProps: PropTypes.shape({
819
+ arrow: PropTypes.object,
820
+ popper: PropTypes.object,
821
+ tooltip: PropTypes.object,
822
+ transition: PropTypes.object
823
+ }),
824
+
825
+ /**
826
+ * The components used for each slot inside.
827
+ *
828
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
829
+ *
830
+ * @default {}
831
+ */
832
+ slots: PropTypes.shape({
833
+ arrow: PropTypes.elementType,
834
+ popper: PropTypes.elementType,
835
+ tooltip: PropTypes.elementType,
836
+ transition: PropTypes.elementType
837
+ }),
838
+
802
839
  /**
803
840
  * The system prop that allows defining system overrides as well as additional CSS styles.
804
841
  */
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.10.11
1
+ /** @license MUI v5.10.13
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -127,7 +127,7 @@ var defaultIconMapping = {
127
127
  })
128
128
  };
129
129
  var Alert = /*#__PURE__*/React.forwardRef(function Alert(inProps, ref) {
130
- var _components$CloseButt, _components$CloseIcon;
130
+ var _ref4, _slots$closeButton, _ref5, _slots$closeIcon, _slotProps$closeButto, _slotProps$closeIcon;
131
131
 
132
132
  var props = useThemeProps({
133
133
  props: inProps,
@@ -152,9 +152,13 @@ var Alert = /*#__PURE__*/React.forwardRef(function Alert(inProps, ref) {
152
152
  role = _props$role === void 0 ? 'alert' : _props$role,
153
153
  _props$severity = props.severity,
154
154
  severity = _props$severity === void 0 ? 'success' : _props$severity,
155
+ _props$slotProps = props.slotProps,
156
+ slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
157
+ _props$slots = props.slots,
158
+ slots = _props$slots === void 0 ? {} : _props$slots,
155
159
  _props$variant = props.variant,
156
160
  variant = _props$variant === void 0 ? 'standard' : _props$variant,
157
- other = _objectWithoutProperties(props, ["action", "children", "className", "closeText", "color", "components", "componentsProps", "icon", "iconMapping", "onClose", "role", "severity", "variant"]);
161
+ other = _objectWithoutProperties(props, ["action", "children", "className", "closeText", "color", "components", "componentsProps", "icon", "iconMapping", "onClose", "role", "severity", "slotProps", "slots", "variant"]);
158
162
 
159
163
  var ownerState = _extends({}, props, {
160
164
  color: color,
@@ -163,8 +167,10 @@ var Alert = /*#__PURE__*/React.forwardRef(function Alert(inProps, ref) {
163
167
  });
164
168
 
165
169
  var classes = useUtilityClasses(ownerState);
166
- var AlertCloseButton = (_components$CloseButt = components.CloseButton) != null ? _components$CloseButt : IconButton;
167
- var AlertCloseIcon = (_components$CloseIcon = components.CloseIcon) != null ? _components$CloseIcon : CloseIcon;
170
+ var AlertCloseButton = (_ref4 = (_slots$closeButton = slots.closeButton) != null ? _slots$closeButton : components.CloseButton) != null ? _ref4 : IconButton;
171
+ var AlertCloseIcon = (_ref5 = (_slots$closeIcon = slots.closeIcon) != null ? _slots$closeIcon : components.CloseIcon) != null ? _ref5 : CloseIcon;
172
+ var closeButtonProps = (_slotProps$closeButto = slotProps.closeButton) != null ? _slotProps$closeButto : componentsProps.closeButton;
173
+ var closeIconProps = (_slotProps$closeIcon = slotProps.closeIcon) != null ? _slotProps$closeIcon : componentsProps.closeIcon;
168
174
  return /*#__PURE__*/_jsxs(AlertRoot, _extends({
169
175
  role: role,
170
176
  elevation: 0,
@@ -193,10 +199,10 @@ var Alert = /*#__PURE__*/React.forwardRef(function Alert(inProps, ref) {
193
199
  title: closeText,
194
200
  color: "inherit",
195
201
  onClick: onClose
196
- }, componentsProps.closeButton, {
202
+ }, closeButtonProps, {
197
203
  children: /*#__PURE__*/_jsx(AlertCloseIcon, _extends({
198
204
  fontSize: "small"
199
- }, componentsProps.closeIcon))
205
+ }, closeIconProps))
200
206
  }))
201
207
  }) : null]
202
208
  }));
@@ -247,8 +253,11 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes
247
253
  .oneOfType([PropTypes.oneOf(['error', 'info', 'success', 'warning']), PropTypes.string]),
248
254
 
249
255
  /**
250
- * The components used for each slot inside the Alert.
251
- * Either a string to use a HTML element or a component.
256
+ * The components used for each slot inside.
257
+ *
258
+ * This prop is an alias for the `slots` prop.
259
+ * It's recommended to use the `slots` prop instead.
260
+ *
252
261
  * @default {}
253
262
  */
254
263
  components: PropTypes.shape({
@@ -257,7 +266,12 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes
257
266
  }),
258
267
 
259
268
  /**
260
- * The props used for each slot inside.
269
+ * The extra props for the slot components.
270
+ * You can override the existing props or add new ones.
271
+ *
272
+ * This prop is an alias for the `slotProps` prop.
273
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
274
+ *
261
275
  * @default {}
262
276
  */
263
277
  componentsProps: PropTypes.shape({
@@ -304,6 +318,31 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes
304
318
  */
305
319
  severity: PropTypes.oneOf(['error', 'info', 'success', 'warning']),
306
320
 
321
+ /**
322
+ * The extra props for the slot components.
323
+ * You can override the existing props or add new ones.
324
+ *
325
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
326
+ *
327
+ * @default {}
328
+ */
329
+ slotProps: PropTypes.shape({
330
+ closeButton: PropTypes.object,
331
+ closeIcon: PropTypes.object
332
+ }),
333
+
334
+ /**
335
+ * The components used for each slot inside.
336
+ *
337
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
338
+ *
339
+ * @default {}
340
+ */
341
+ slots: PropTypes.shape({
342
+ closeButton: PropTypes.elementType,
343
+ closeIcon: PropTypes.elementType
344
+ }),
345
+
307
346
  /**
308
347
  * The system prop that allows defining system overrides as well as additional CSS styles.
309
348
  */
@@ -320,7 +320,7 @@ var AutocompleteGroupUl = styled('ul', {
320
320
  }));
321
321
  export { createFilterOptions };
322
322
  var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps, ref) {
323
- var _componentsProps$clea, _componentsProps$popu, _componentsProps$popp, _componentsProps$pape;
323
+ var _slotProps$clearIndic, _slotProps$paper, _slotProps$popper, _slotProps$popupIndic;
324
324
 
325
325
  var props = useThemeProps({
326
326
  props: inProps,
@@ -434,8 +434,10 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
434
434
  selectOnFocus = _props$selectOnFocus === void 0 ? !props.freeSolo : _props$selectOnFocus,
435
435
  _props$size = props.size,
436
436
  size = _props$size === void 0 ? 'medium' : _props$size,
437
+ _props$slotProps = props.slotProps,
438
+ slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
437
439
  valueProp = props.value,
438
- other = _objectWithoutProperties(props, ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "readOnly", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"]);
440
+ other = _objectWithoutProperties(props, ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "readOnly", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "slotProps", "value"]);
439
441
  /* eslint-enable @typescript-eslint/no-unused-vars */
440
442
 
441
443
 
@@ -550,6 +552,10 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
550
552
  });
551
553
  };
552
554
 
555
+ var clearIndicatorSlotProps = (_slotProps$clearIndic = slotProps.clearIndicator) != null ? _slotProps$clearIndic : componentsProps.clearIndicator;
556
+ var paperSlotProps = (_slotProps$paper = slotProps.paper) != null ? _slotProps$paper : componentsProps.paper;
557
+ var popperSlotProps = (_slotProps$popper = slotProps.popper) != null ? _slotProps$popper : componentsProps.popper;
558
+ var popupIndicatorSlotProps = (_slotProps$popupIndic = slotProps.popupIndicator) != null ? _slotProps$popupIndic : componentsProps.popupIndicator;
553
559
  return /*#__PURE__*/_jsxs(React.Fragment, {
554
560
  children: [/*#__PURE__*/_jsx(AutocompleteRoot, _extends({
555
561
  ref: ref,
@@ -574,16 +580,16 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
574
580
  "aria-label": clearText,
575
581
  title: clearText,
576
582
  ownerState: ownerState
577
- }, componentsProps.clearIndicator, {
578
- className: clsx(classes.clearIndicator, (_componentsProps$clea = componentsProps.clearIndicator) == null ? void 0 : _componentsProps$clea.className),
583
+ }, clearIndicatorSlotProps, {
584
+ className: clsx(classes.clearIndicator, clearIndicatorSlotProps == null ? void 0 : clearIndicatorSlotProps.className),
579
585
  children: clearIcon
580
586
  })) : null, hasPopupIcon ? /*#__PURE__*/_jsx(AutocompletePopupIndicator, _extends({}, getPopupIndicatorProps(), {
581
587
  disabled: disabled,
582
588
  "aria-label": popupOpen ? closeText : openText,
583
589
  title: popupOpen ? closeText : openText,
584
590
  ownerState: ownerState
585
- }, componentsProps.popupIndicator, {
586
- className: clsx(classes.popupIndicator, (_componentsProps$popu = componentsProps.popupIndicator) == null ? void 0 : _componentsProps$popu.className),
591
+ }, popupIndicatorSlotProps, {
592
+ className: clsx(classes.popupIndicator, popupIndicatorSlotProps == null ? void 0 : popupIndicatorSlotProps.className),
587
593
  children: popupIcon
588
594
  })) : null]
589
595
  })
@@ -604,13 +610,13 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
604
610
  role: "presentation",
605
611
  anchorEl: anchorEl,
606
612
  open: popupOpen
607
- }, componentsProps.popper, {
608
- className: clsx(classes.popper, (_componentsProps$popp = componentsProps.popper) == null ? void 0 : _componentsProps$popp.className),
613
+ }, popperSlotProps, {
614
+ className: clsx(classes.popper, popperSlotProps == null ? void 0 : popperSlotProps.className),
609
615
  children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
610
616
  ownerState: ownerState,
611
617
  as: PaperComponent
612
- }, componentsProps.paper, {
613
- className: clsx(classes.paper, (_componentsProps$pape = componentsProps.paper) == null ? void 0 : _componentsProps$pape.className),
618
+ }, paperSlotProps, {
619
+ className: clsx(classes.paper, paperSlotProps == null ? void 0 : paperSlotProps.className),
614
620
  children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
615
621
  className: classes.loading,
616
622
  ownerState: ownerState,
@@ -1096,6 +1102,17 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
1096
1102
  /* @typescript-to-proptypes-ignore */
1097
1103
  .oneOfType([PropTypes.oneOf(['small', 'medium']), PropTypes.string]),
1098
1104
 
1105
+ /**
1106
+ * The props used for each slot inside.
1107
+ * @default {}
1108
+ */
1109
+ slotProps: PropTypes.shape({
1110
+ clearIndicator: PropTypes.object,
1111
+ paper: PropTypes.object,
1112
+ popper: PropTypes.object,
1113
+ popupIndicator: PropTypes.object
1114
+ }),
1115
+
1099
1116
  /**
1100
1117
  * The system prop that allows defining system overrides as well as additional CSS styles.
1101
1118
  */
@@ -63,7 +63,7 @@ var AvatarGroupAvatar = styled(Avatar, {
63
63
  };
64
64
  });
65
65
  var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, ref) {
66
- var _componentsProps$addi, _componentsProps$addi2;
66
+ var _slotProps$additional;
67
67
 
68
68
  var props = useThemeProps({
69
69
  props: inProps,
@@ -78,12 +78,14 @@ var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, re
78
78
  componentsProps = _props$componentsProp === void 0 ? {} : _props$componentsProp,
79
79
  _props$max = props.max,
80
80
  max = _props$max === void 0 ? 5 : _props$max,
81
+ _props$slotProps = props.slotProps,
82
+ slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
81
83
  _props$spacing = props.spacing,
82
84
  spacing = _props$spacing === void 0 ? 'medium' : _props$spacing,
83
85
  total = props.total,
84
86
  _props$variant = props.variant,
85
87
  variant = _props$variant === void 0 ? 'circular' : _props$variant,
86
- other = _objectWithoutProperties(props, ["children", "className", "component", "componentsProps", "max", "spacing", "total", "variant"]);
88
+ other = _objectWithoutProperties(props, ["children", "className", "component", "componentsProps", "max", "slotProps", "spacing", "total", "variant"]);
87
89
 
88
90
  var clampedMax = max < 2 ? 2 : max;
89
91
 
@@ -114,6 +116,7 @@ var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, re
114
116
  var maxAvatars = Math.min(children.length, clampedMax - 1);
115
117
  var extraAvatars = Math.max(totalAvatars - clampedMax, totalAvatars - maxAvatars, 0);
116
118
  var marginLeft = spacing && SPACINGS[spacing] !== undefined ? SPACINGS[spacing] : -spacing;
119
+ var additionalAvatarSlotProps = (_slotProps$additional = slotProps.additionalAvatar) != null ? _slotProps$additional : componentsProps.additionalAvatar;
117
120
  return /*#__PURE__*/_jsxs(AvatarGroupRoot, _extends({
118
121
  as: component,
119
122
  ownerState: ownerState,
@@ -123,11 +126,11 @@ var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, re
123
126
  children: [extraAvatars ? /*#__PURE__*/_jsxs(AvatarGroupAvatar, _extends({
124
127
  ownerState: ownerState,
125
128
  variant: variant
126
- }, componentsProps.additionalAvatar, {
127
- className: clsx(classes.avatar, (_componentsProps$addi = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi.className),
129
+ }, additionalAvatarSlotProps, {
130
+ className: clsx(classes.avatar, additionalAvatarSlotProps == null ? void 0 : additionalAvatarSlotProps.className),
128
131
  style: _extends({
129
132
  marginLeft: marginLeft
130
- }, (_componentsProps$addi2 = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi2.style),
133
+ }, additionalAvatarSlotProps == null ? void 0 : additionalAvatarSlotProps.style),
131
134
  children: ["+", extraAvatars]
132
135
  })) : null, children.slice(0, maxAvatars).reverse().map(function (child, index) {
133
136
  return /*#__PURE__*/React.cloneElement(child, {
@@ -172,7 +175,12 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
172
175
  component: PropTypes.elementType,
173
176
 
174
177
  /**
175
- * The props used for each slot inside the AvatarGroup.
178
+ * The extra props for the slot components.
179
+ * You can override the existing props or add new ones.
180
+ *
181
+ * This prop is an alias for the `slotProps` prop.
182
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
183
+ *
176
184
  * @default {}
177
185
  */
178
186
  componentsProps: PropTypes.shape({
@@ -191,6 +199,18 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
191
199
  return null;
192
200
  }),
193
201
 
202
+ /**
203
+ * The extra props for the slot components.
204
+ * You can override the existing props or add new ones.
205
+ *
206
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
207
+ *
208
+ * @default {}
209
+ */
210
+ slotProps: PropTypes.shape({
211
+ additionalAvatar: PropTypes.object
212
+ }),
213
+
194
214
  /**
195
215
  * Spacing between avatars.
196
216
  * @default 'medium'