@mui/material 6.4.5 → 6.4.6

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 (73) hide show
  1. package/Accordion/Accordion.d.ts +14 -12
  2. package/Alert/Alert.d.ts +3 -15
  3. package/Backdrop/Backdrop.d.ts +14 -12
  4. package/CHANGELOG.md +38 -0
  5. package/CardHeader/CardHeader.d.ts +4 -20
  6. package/Checkbox/Checkbox.d.ts +45 -9
  7. package/Checkbox/Checkbox.js +51 -21
  8. package/Dialog/Dialog.d.ts +4 -4
  9. package/Drawer/Drawer.d.ts +92 -1
  10. package/Drawer/Drawer.js +108 -36
  11. package/InputBase/inputBaseClasses.d.ts +15 -6
  12. package/Menu/Menu.d.ts +88 -1
  13. package/Menu/Menu.js +58 -19
  14. package/Modal/Modal.js +9 -10
  15. package/Popover/Popover.d.ts +60 -6
  16. package/Popover/Popover.js +78 -51
  17. package/Radio/Radio.d.ts +45 -1
  18. package/Radio/Radio.js +59 -16
  19. package/Select/SelectInput.js +8 -8
  20. package/Snackbar/Snackbar.d.ts +79 -2
  21. package/Snackbar/Snackbar.js +110 -32
  22. package/SpeedDial/SpeedDial.d.ts +8 -6
  23. package/SpeedDialAction/SpeedDialAction.d.ts +82 -1
  24. package/SpeedDialAction/SpeedDialAction.js +108 -30
  25. package/StepContent/StepContent.d.ts +2 -2
  26. package/SwipeableDrawer/SwipeableDrawer.d.ts +28 -2
  27. package/SwipeableDrawer/SwipeableDrawer.js +60 -13
  28. package/Switch/Switch.js +2 -0
  29. package/Tabs/Tabs.d.ts +129 -29
  30. package/Tabs/Tabs.js +120 -52
  31. package/Tabs/tabsClasses.d.ts +4 -0
  32. package/Tabs/tabsClasses.js +1 -1
  33. package/Tooltip/Tooltip.d.ts +20 -12
  34. package/index.js +1 -1
  35. package/internal/SwitchBase.d.ts +35 -1
  36. package/internal/SwitchBase.js +84 -30
  37. package/modern/Checkbox/Checkbox.js +51 -21
  38. package/modern/Drawer/Drawer.js +108 -36
  39. package/modern/Menu/Menu.js +58 -19
  40. package/modern/Modal/Modal.js +9 -10
  41. package/modern/Popover/Popover.js +78 -51
  42. package/modern/Radio/Radio.js +59 -16
  43. package/modern/Select/SelectInput.js +8 -8
  44. package/modern/Snackbar/Snackbar.js +110 -32
  45. package/modern/SpeedDialAction/SpeedDialAction.js +108 -30
  46. package/modern/SwipeableDrawer/SwipeableDrawer.js +60 -13
  47. package/modern/Switch/Switch.js +2 -0
  48. package/modern/Tabs/Tabs.js +120 -52
  49. package/modern/Tabs/tabsClasses.js +1 -1
  50. package/modern/index.js +1 -1
  51. package/modern/internal/SwitchBase.js +84 -30
  52. package/modern/styles/createThemeNoVars.js +7 -2
  53. package/modern/version/index.js +2 -2
  54. package/node/Checkbox/Checkbox.js +51 -21
  55. package/node/Drawer/Drawer.js +108 -36
  56. package/node/Menu/Menu.js +58 -19
  57. package/node/Modal/Modal.js +9 -10
  58. package/node/Popover/Popover.js +78 -51
  59. package/node/Radio/Radio.js +59 -16
  60. package/node/Select/SelectInput.js +8 -8
  61. package/node/Snackbar/Snackbar.js +110 -32
  62. package/node/SpeedDialAction/SpeedDialAction.js +108 -30
  63. package/node/SwipeableDrawer/SwipeableDrawer.js +60 -13
  64. package/node/Switch/Switch.js +2 -0
  65. package/node/Tabs/Tabs.js +120 -52
  66. package/node/Tabs/tabsClasses.js +1 -1
  67. package/node/index.js +1 -1
  68. package/node/internal/SwitchBase.js +84 -30
  69. package/node/styles/createThemeNoVars.js +7 -2
  70. package/node/version/index.js +2 -2
  71. package/package.json +6 -6
  72. package/styles/createThemeNoVars.js +7 -2
  73. package/version/index.js +2 -2
@@ -3,7 +3,6 @@
3
3
  import * as React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import composeClasses from '@mui/utils/composeClasses';
6
- import useSlotProps from '@mui/utils/useSlotProps';
7
6
  import useSnackbar from "./useSnackbar.js";
8
7
  import ClickAwayListener from "../ClickAwayListener/index.js";
9
8
  import { styled, useTheme } from "../zero-styled/index.js";
@@ -13,6 +12,7 @@ import capitalize from "../utils/capitalize.js";
13
12
  import Grow from "../Grow/index.js";
14
13
  import SnackbarContent from "../SnackbarContent/index.js";
15
14
  import { getSnackbarUtilityClass } from "./snackbarClasses.js";
15
+ import useSlot from "../utils/useSlot.js";
16
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
17
  const useUtilityClasses = ownerState => {
18
18
  const {
@@ -120,8 +120,8 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
120
120
  autoHideDuration = null,
121
121
  children,
122
122
  className,
123
- ClickAwayListenerProps,
124
- ContentProps,
123
+ ClickAwayListenerProps: ClickAwayListenerPropsProp,
124
+ ContentProps: ContentPropsProp,
125
125
  disableWindowBlurListener = false,
126
126
  message,
127
127
  onBlur,
@@ -131,12 +131,14 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
131
131
  onMouseLeave,
132
132
  open,
133
133
  resumeHideDuration,
134
- TransitionComponent = Grow,
134
+ slots = {},
135
+ slotProps = {},
136
+ TransitionComponent: TransitionComponentProp,
135
137
  transitionDuration = defaultTransitionDuration,
136
138
  TransitionProps: {
137
139
  onEnter,
138
140
  onExited,
139
- ...TransitionProps
141
+ ...TransitionPropsProp
140
142
  } = {},
141
143
  ...other
142
144
  } = props;
@@ -148,7 +150,7 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
148
150
  },
149
151
  autoHideDuration,
150
152
  disableWindowBlurListener,
151
- TransitionComponent,
153
+ TransitionComponent: TransitionComponentProp,
152
154
  transitionDuration
153
155
  };
154
156
  const classes = useUtilityClasses(ownerState);
@@ -159,16 +161,6 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
159
161
  ...ownerState
160
162
  });
161
163
  const [exited, setExited] = React.useState(true);
162
- const rootProps = useSlotProps({
163
- elementType: SnackbarRoot,
164
- getSlotProps: getRootProps,
165
- externalForwardedProps: other,
166
- ownerState,
167
- additionalProps: {
168
- ref
169
- },
170
- className: [classes.root, className]
171
- });
172
164
  const handleExited = node => {
173
165
  setExited(true);
174
166
  if (onExited) {
@@ -181,28 +173,84 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
181
173
  onEnter(node, isAppearing);
182
174
  }
183
175
  };
176
+ const externalForwardedProps = {
177
+ slots: {
178
+ transition: TransitionComponentProp,
179
+ ...slots
180
+ },
181
+ slotProps: {
182
+ content: ContentPropsProp,
183
+ clickAwayListener: ClickAwayListenerPropsProp,
184
+ transition: TransitionPropsProp,
185
+ ...slotProps
186
+ }
187
+ };
188
+ const [Root, rootProps] = useSlot('root', {
189
+ ref,
190
+ className: [classes.root, className],
191
+ elementType: SnackbarRoot,
192
+ getSlotProps: getRootProps,
193
+ externalForwardedProps: {
194
+ ...externalForwardedProps,
195
+ ...other
196
+ },
197
+ ownerState
198
+ });
199
+ const [ClickAwaySlot, clickAwayListenerProps] = useSlot('clickAwayListener', {
200
+ elementType: ClickAwayListener,
201
+ externalForwardedProps,
202
+ getSlotProps: handlers => ({
203
+ onClickAway: (...params) => {
204
+ handlers.onClickAway?.(...params);
205
+ onClickAway(...params);
206
+ }
207
+ }),
208
+ ownerState
209
+ });
210
+ const [ContentSlot, contentSlotProps] = useSlot('content', {
211
+ elementType: SnackbarContent,
212
+ shouldForwardComponentProp: true,
213
+ externalForwardedProps,
214
+ additionalProps: {
215
+ message,
216
+ action
217
+ },
218
+ ownerState
219
+ });
220
+ const [TransitionSlot, transitionProps] = useSlot('transition', {
221
+ elementType: Grow,
222
+ externalForwardedProps,
223
+ getSlotProps: handlers => ({
224
+ onEnter: (...params) => {
225
+ handlers.onEnter?.(...params);
226
+ handleEnter(...params);
227
+ },
228
+ onExited: (...params) => {
229
+ handlers.onExited?.(...params);
230
+ handleExited(...params);
231
+ }
232
+ }),
233
+ additionalProps: {
234
+ appear: true,
235
+ in: open,
236
+ timeout: transitionDuration,
237
+ direction: vertical === 'top' ? 'down' : 'up'
238
+ },
239
+ ownerState
240
+ });
184
241
 
185
242
  // So we only render active snackbars.
186
243
  if (!open && exited) {
187
244
  return null;
188
245
  }
189
- return /*#__PURE__*/_jsx(ClickAwayListener, {
190
- onClickAway: onClickAway,
191
- ...ClickAwayListenerProps,
192
- children: /*#__PURE__*/_jsx(SnackbarRoot, {
246
+ return /*#__PURE__*/_jsx(ClickAwaySlot, {
247
+ ...clickAwayListenerProps,
248
+ children: /*#__PURE__*/_jsx(Root, {
193
249
  ...rootProps,
194
- children: /*#__PURE__*/_jsx(TransitionComponent, {
195
- appear: true,
196
- in: open,
197
- timeout: transitionDuration,
198
- direction: vertical === 'top' ? 'down' : 'up',
199
- onEnter: handleEnter,
200
- onExited: handleExited,
201
- ...TransitionProps,
202
- children: children || /*#__PURE__*/_jsx(SnackbarContent, {
203
- message: message,
204
- action: action,
205
- ...ContentProps
250
+ children: /*#__PURE__*/_jsx(TransitionSlot, {
251
+ ...transitionProps,
252
+ children: children || /*#__PURE__*/_jsx(ContentSlot, {
253
+ ...contentSlotProps
206
254
  })
207
255
  })
208
256
  })
@@ -249,10 +297,12 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
249
297
  className: PropTypes.string,
250
298
  /**
251
299
  * Props applied to the `ClickAwayListener` element.
300
+ * @deprecated Use `slotProps.clickAwayListener` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
252
301
  */
253
302
  ClickAwayListenerProps: PropTypes.object,
254
303
  /**
255
304
  * Props applied to the [`SnackbarContent`](https://mui.com/material-ui/api/snackbar-content/) element.
305
+ * @deprecated Use `slotProps.content` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
256
306
  */
257
307
  ContentProps: PropTypes.object,
258
308
  /**
@@ -309,6 +359,32 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
309
359
  * we default to `autoHideDuration / 2` ms.
310
360
  */
311
361
  resumeHideDuration: PropTypes.number,
362
+ /**
363
+ * The props used for each slot inside.
364
+ * @default {}
365
+ */
366
+ slotProps: PropTypes.shape({
367
+ clickAwayListener: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
368
+ children: PropTypes.element.isRequired,
369
+ disableReactTree: PropTypes.bool,
370
+ mouseEvent: PropTypes.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]),
371
+ onClickAway: PropTypes.func,
372
+ touchEvent: PropTypes.oneOf(['onTouchEnd', 'onTouchStart', false])
373
+ })]),
374
+ content: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
375
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
376
+ transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
377
+ }),
378
+ /**
379
+ * The components used for each slot inside.
380
+ * @default {}
381
+ */
382
+ slots: PropTypes.shape({
383
+ clickAwayListener: PropTypes.elementType,
384
+ content: PropTypes.elementType,
385
+ root: PropTypes.elementType,
386
+ transition: PropTypes.elementType
387
+ }),
312
388
  /**
313
389
  * The system prop that allows defining system overrides as well as additional CSS styles.
314
390
  */
@@ -316,6 +392,7 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
316
392
  /**
317
393
  * The component used for the transition.
318
394
  * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
395
+ * @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
319
396
  * @default Grow
320
397
  */
321
398
  TransitionComponent: PropTypes.elementType,
@@ -335,6 +412,7 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
335
412
  /**
336
413
  * Props applied to the transition element.
337
414
  * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
415
+ * @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
338
416
  * @default {}
339
417
  */
340
418
  TransitionProps: PropTypes.object
@@ -5,7 +5,7 @@ import { InternalStandardProps as StandardProps } from '..';
5
5
  import { FabProps } from '../Fab';
6
6
  import { TransitionProps } from '../transitions';
7
7
  import { SpeedDialClasses } from './speedDialClasses';
8
- import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
8
+ import { CreateSlotsAndSlotProps, SlotComponentProps } from '../utils/types';
9
9
 
10
10
  export type CloseReason = 'toggle' | 'blur' | 'mouseLeave' | 'escapeKeyDown';
11
11
  export type OpenReason = 'toggle' | 'focus' | 'mouseEnter';
@@ -14,17 +14,19 @@ export interface SpeedDialSlots {
14
14
  /**
15
15
  * The component that renders the transition.
16
16
  * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
17
- * @default {}
17
+ * @default Zoom
18
18
  */
19
- transition: React.JSXElementConstructor<
20
- TransitionProps & { children: React.ReactElement<unknown, any> }
21
- >;
19
+ transition: React.ElementType;
22
20
  }
23
21
 
24
22
  export type SpeedDialSlotsAndSlotProps = CreateSlotsAndSlotProps<
25
23
  SpeedDialSlots,
26
24
  {
27
- transition: SlotProps<React.JSXElementConstructor<TransitionProps>, {}, SpeedDialOwnerState>;
25
+ /**
26
+ * Props forwarded to the transition slot.
27
+ * By default, the avaible props are based on the [Zoom](https://mui.com/material-ui/api/zoom/#props) component.
28
+ */
29
+ transition: SlotComponentProps<React.ElementType, TransitionProps, SpeedDialOwnerState>;
28
30
  }
29
31
  >;
30
32
 
@@ -5,8 +5,81 @@ import { InternalStandardProps as StandardProps } from '..';
5
5
  import { FabProps } from '../Fab';
6
6
  import { TooltipProps } from '../Tooltip';
7
7
  import { SpeedDialActionClasses } from './speedDialActionClasses';
8
+ import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
8
9
 
9
- export interface SpeedDialActionProps extends StandardProps<Partial<TooltipProps>, 'children'> {
10
+ export interface SpeedDialActionSlots {
11
+ /**
12
+ * The component that renders the fab.
13
+ * @default Fab
14
+ */
15
+ fab?: React.ElementType;
16
+ /**
17
+ * The component that renders the tooltip.
18
+ * @default Tooltip
19
+ */
20
+ tooltip?: React.ElementType;
21
+ /**
22
+ * The component that renders the static tooltip.
23
+ * @default 'span'
24
+ */
25
+ staticTooltip?: React.ElementType;
26
+ /**
27
+ * The component that renders the static tooltip label.
28
+ * @default 'span'
29
+ */
30
+ staticTooltipLabel?: React.ElementType;
31
+ }
32
+
33
+ export interface SpeedDialActionFabSlotPropsOverrides {}
34
+ export interface SpeedDialActionTooltipSlotPropsOverrides {}
35
+ export interface SpeedDialActionStaticTooltipSlotPropsOverrides {}
36
+ export interface SpeedDialActionStaticTooltipLabelSlotPropsOverrides {}
37
+
38
+ export type SpeedDialActionSlotsAndSlotProps = CreateSlotsAndSlotProps<
39
+ SpeedDialActionSlots,
40
+ {
41
+ /**
42
+ * Props forwarded to the fab slot.
43
+ * By default, the avaible props are based on the [Fab](https://mui.com/material-ui/api/fab/#props) component.
44
+ */
45
+ fab: SlotProps<
46
+ React.ElementType<FabProps>,
47
+ SpeedDialActionFabSlotPropsOverrides,
48
+ SpeedDialActionOwnerState
49
+ >;
50
+ /**
51
+ * Props forwarded to the tooltip slot.
52
+ * By default, the avaible props are based on the [Tooltip](https://mui.com/material-ui/api/tooltip/#props) component.
53
+ */
54
+ tooltip: SlotProps<
55
+ React.ElementType<TooltipProps>,
56
+ SpeedDialActionTooltipSlotPropsOverrides,
57
+ SpeedDialActionOwnerState
58
+ >;
59
+ /**
60
+ * Props forwarded to the static tooltip slot.
61
+ * By default, the avaible props are based on a span element.
62
+ */
63
+ staticTooltip: SlotProps<
64
+ 'span',
65
+ SpeedDialActionStaticTooltipSlotPropsOverrides,
66
+ SpeedDialActionOwnerState
67
+ >;
68
+ /**
69
+ * Props forwarded to the static tooltip label slot.
70
+ * By default, the avaible props are based on a span element.
71
+ */
72
+ staticTooltipLabel: SlotProps<
73
+ 'span',
74
+ SpeedDialActionStaticTooltipLabelSlotPropsOverrides,
75
+ SpeedDialActionOwnerState
76
+ >;
77
+ }
78
+ >;
79
+
80
+ export interface SpeedDialActionProps
81
+ extends Omit<StandardProps<Partial<TooltipProps>, 'children'>, 'slotProps' | 'slots'>,
82
+ SpeedDialActionSlotsAndSlotProps {
10
83
  /**
11
84
  * Override or extend the styles applied to the component.
12
85
  */
@@ -14,6 +87,7 @@ export interface SpeedDialActionProps extends StandardProps<Partial<TooltipProps
14
87
  /**
15
88
  * Props applied to the [`Fab`](https://mui.com/material-ui/api/fab/) component.
16
89
  * @default {}
90
+ * @deprecated Use `slotProps.fab` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
17
91
  */
18
92
  FabProps?: Partial<FabProps>;
19
93
  /**
@@ -31,20 +105,24 @@ export interface SpeedDialActionProps extends StandardProps<Partial<TooltipProps
31
105
  sx?: SxProps<Theme>;
32
106
  /**
33
107
  * `classes` prop applied to the [`Tooltip`](https://mui.com/material-ui/api/tooltip/) element.
108
+ * @deprecated Use `slotProps.tooltip.classes` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
34
109
  */
35
110
  TooltipClasses?: TooltipProps['classes'];
36
111
  /**
37
112
  * Placement of the tooltip.
38
113
  * @default 'left'
114
+ * @deprecated Use `slotProps.tooltip.placement` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
39
115
  */
40
116
  tooltipPlacement?: TooltipProps['placement'];
41
117
  /**
42
118
  * Label to display in the tooltip.
119
+ * @deprecated Use `slotProps.tooltip.title` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
43
120
  */
44
121
  tooltipTitle?: React.ReactNode;
45
122
  /**
46
123
  * Make the tooltip always visible when the SpeedDial is open.
47
124
  * @default false
125
+ * @deprecated Use `slotProps.tooltip.open` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
48
126
  */
49
127
  tooltipOpen?: boolean;
50
128
  }
@@ -61,3 +139,6 @@ export interface SpeedDialActionProps extends StandardProps<Partial<TooltipProps
61
139
  * - inherits [Tooltip API](https://mui.com/material-ui/api/tooltip/)
62
140
  */
63
141
  export default function SpeedDialAction(props: SpeedDialActionProps): React.JSX.Element;
142
+
143
+ export interface SpeedDialActionOwnerState
144
+ extends Omit<SpeedDialActionProps, 'slots' | 'slotProps'> {}
@@ -13,6 +13,8 @@ import Fab from "../Fab/index.js";
13
13
  import Tooltip from "../Tooltip/index.js";
14
14
  import capitalize from "../utils/capitalize.js";
15
15
  import speedDialActionClasses, { getSpeedDialActionUtilityClass } from "./speedDialActionClasses.js";
16
+ import useSlot from "../utils/useSlot.js";
17
+ import { mergeSlotProps } from "../utils/index.js";
16
18
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
19
  const useUtilityClasses = ownerState => {
18
20
  const {
@@ -147,6 +149,8 @@ const SpeedDialAction = /*#__PURE__*/React.forwardRef(function SpeedDialAction(i
147
149
  tooltipOpen: tooltipOpenProp = false,
148
150
  tooltipPlacement = 'left',
149
151
  tooltipTitle,
152
+ slots = {},
153
+ slotProps = {},
150
154
  ...other
151
155
  } = props;
152
156
  const ownerState = {
@@ -154,7 +158,20 @@ const SpeedDialAction = /*#__PURE__*/React.forwardRef(function SpeedDialAction(i
154
158
  tooltipPlacement
155
159
  };
156
160
  const classes = useUtilityClasses(ownerState);
157
- const [tooltipOpen, setTooltipOpen] = React.useState(tooltipOpenProp);
161
+ const externalForwardedProps = {
162
+ slots,
163
+ slotProps: {
164
+ fab: FabProps,
165
+ ...slotProps,
166
+ tooltip: mergeSlotProps(typeof slotProps.tooltip === 'function' ? slotProps.tooltip(ownerState) : slotProps.tooltip, {
167
+ title: tooltipTitle,
168
+ open: tooltipOpenProp,
169
+ placement: tooltipPlacement,
170
+ classes: TooltipClasses
171
+ })
172
+ }
173
+ };
174
+ const [tooltipOpen, setTooltipOpen] = React.useState(externalForwardedProps.slotProps.tooltip?.open);
158
175
  const handleTooltipClose = () => {
159
176
  setTooltipOpen(false);
160
177
  };
@@ -164,32 +181,71 @@ const SpeedDialAction = /*#__PURE__*/React.forwardRef(function SpeedDialAction(i
164
181
  const transitionStyle = {
165
182
  transitionDelay: `${delay}ms`
166
183
  };
167
- const fab = /*#__PURE__*/_jsx(SpeedDialActionFab, {
168
- size: "small",
184
+ const [FabSlot, fabSlotProps] = useSlot('fab', {
185
+ elementType: SpeedDialActionFab,
186
+ externalForwardedProps,
187
+ ownerState,
188
+ shouldForwardComponentProp: true,
169
189
  className: clsx(classes.fab, className),
170
- tabIndex: -1,
171
- role: "menuitem",
172
- ownerState: ownerState,
173
- ...FabProps,
174
- style: {
175
- ...transitionStyle,
176
- ...FabProps.style
190
+ additionalProps: {
191
+ style: transitionStyle,
192
+ tabIndex: -1,
193
+ role: 'menuitem',
194
+ size: 'small'
195
+ }
196
+ });
197
+ const [TooltipSlot, tooltipSlotProps] = useSlot('tooltip', {
198
+ elementType: Tooltip,
199
+ externalForwardedProps,
200
+ shouldForwardComponentProp: true,
201
+ ref,
202
+ additionalProps: {
203
+ id
177
204
  },
205
+ ownerState,
206
+ getSlotProps: handlers => ({
207
+ ...handlers,
208
+ onClose: event => {
209
+ handlers.onClose?.(event);
210
+ handleTooltipClose();
211
+ },
212
+ onOpen: event => {
213
+ handlers.onOpen?.(event);
214
+ handleTooltipOpen();
215
+ }
216
+ })
217
+ });
218
+ const [StaticTooltipSlot, staticTooltipSlotProps] = useSlot('staticTooltip', {
219
+ elementType: SpeedDialActionStaticTooltip,
220
+ externalForwardedProps,
221
+ ownerState,
222
+ ref,
223
+ className: classes.staticTooltip,
224
+ additionalProps: {
225
+ id
226
+ }
227
+ });
228
+ const [StaticTooltipLabelSlot, staticTooltipLabelSlotProps] = useSlot('staticTooltipLabel', {
229
+ elementType: SpeedDialActionStaticTooltipLabel,
230
+ externalForwardedProps,
231
+ ownerState,
232
+ className: classes.staticTooltipLabel,
233
+ additionalProps: {
234
+ style: transitionStyle,
235
+ id: `${id}-label`
236
+ }
237
+ });
238
+ const fab = /*#__PURE__*/_jsx(FabSlot, {
239
+ ...fabSlotProps,
178
240
  children: icon
179
241
  });
180
- if (tooltipOpenProp) {
181
- return /*#__PURE__*/_jsxs(SpeedDialActionStaticTooltip, {
182
- id: id,
183
- ref: ref,
184
- className: classes.staticTooltip,
185
- ownerState: ownerState,
242
+ if (tooltipSlotProps.open) {
243
+ return /*#__PURE__*/_jsxs(StaticTooltipSlot, {
244
+ ...staticTooltipSlotProps,
186
245
  ...other,
187
- children: [/*#__PURE__*/_jsx(SpeedDialActionStaticTooltipLabel, {
188
- style: transitionStyle,
189
- id: `${id}-label`,
190
- className: classes.staticTooltipLabel,
191
- ownerState: ownerState,
192
- children: tooltipTitle
246
+ children: [/*#__PURE__*/_jsx(StaticTooltipLabelSlot, {
247
+ ...staticTooltipLabelSlotProps,
248
+ children: tooltipSlotProps.title
193
249
  }), /*#__PURE__*/React.cloneElement(fab, {
194
250
  'aria-labelledby': `${id}-label`
195
251
  })]
@@ -198,15 +254,12 @@ const SpeedDialAction = /*#__PURE__*/React.forwardRef(function SpeedDialAction(i
198
254
  if (!open && tooltipOpen) {
199
255
  setTooltipOpen(false);
200
256
  }
201
- return /*#__PURE__*/_jsx(Tooltip, {
202
- id: id,
203
- ref: ref,
204
- title: tooltipTitle,
205
- placement: tooltipPlacement,
206
- onClose: handleTooltipClose,
207
- onOpen: handleTooltipOpen,
257
+ return /*#__PURE__*/_jsx(TooltipSlot, {
258
+ ...tooltipSlotProps,
259
+ title: tooltipSlotProps.title,
208
260
  open: open && tooltipOpen,
209
- classes: TooltipClasses,
261
+ placement: tooltipSlotProps.placement,
262
+ classes: tooltipSlotProps.classes,
210
263
  ...other,
211
264
  children: fab
212
265
  });
@@ -232,6 +285,7 @@ process.env.NODE_ENV !== "production" ? SpeedDialAction.propTypes /* remove-prop
232
285
  /**
233
286
  * Props applied to the [`Fab`](https://mui.com/material-ui/api/fab/) component.
234
287
  * @default {}
288
+ * @deprecated Use `slotProps.fab` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
235
289
  */
236
290
  FabProps: PropTypes.object,
237
291
  /**
@@ -247,26 +301,50 @@ process.env.NODE_ENV !== "production" ? SpeedDialAction.propTypes /* remove-prop
247
301
  * If `true`, the component is shown.
248
302
  */
249
303
  open: PropTypes.bool,
304
+ /**
305
+ * The props used for each slot inside.
306
+ * @default {}
307
+ */
308
+ slotProps: PropTypes.shape({
309
+ fab: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
310
+ staticTooltip: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
311
+ staticTooltipLabel: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
312
+ tooltip: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
313
+ }),
314
+ /**
315
+ * The components used for each slot inside.
316
+ * @default {}
317
+ */
318
+ slots: PropTypes.shape({
319
+ fab: PropTypes.elementType,
320
+ staticTooltip: PropTypes.elementType,
321
+ staticTooltipLabel: PropTypes.elementType,
322
+ tooltip: PropTypes.elementType
323
+ }),
250
324
  /**
251
325
  * The system prop that allows defining system overrides as well as additional CSS styles.
252
326
  */
253
327
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
254
328
  /**
255
329
  * `classes` prop applied to the [`Tooltip`](https://mui.com/material-ui/api/tooltip/) element.
330
+ * @deprecated Use `slotProps.tooltip.classes` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
256
331
  */
257
332
  TooltipClasses: PropTypes.object,
258
333
  /**
259
334
  * Make the tooltip always visible when the SpeedDial is open.
260
335
  * @default false
336
+ * @deprecated Use `slotProps.tooltip.open` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
261
337
  */
262
338
  tooltipOpen: PropTypes.bool,
263
339
  /**
264
340
  * Placement of the tooltip.
265
341
  * @default 'left'
342
+ * @deprecated Use `slotProps.tooltip.placement` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
266
343
  */
267
344
  tooltipPlacement: PropTypes.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
268
345
  /**
269
346
  * Label to display in the tooltip.
347
+ * @deprecated Use `slotProps.tooltip.title` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
270
348
  */
271
349
  tooltipTitle: PropTypes.node
272
350
  } : void 0;
@@ -4,7 +4,7 @@ import { CollapseProps, InternalStandardProps as StandardProps } from '..';
4
4
  import { Theme } from '../styles';
5
5
  import { TransitionProps } from '../transitions/transition';
6
6
  import { StepContentClasses } from './stepContentClasses';
7
- import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
7
+ import { CreateSlotsAndSlotProps, SlotComponentProps } from '../utils/types';
8
8
 
9
9
  export interface StepContentSlots {
10
10
  /**
@@ -24,7 +24,7 @@ export type StepContentSlotsAndSlotProps = CreateSlotsAndSlotProps<
24
24
  * Props forwared to the transition slot.
25
25
  * By default, the available props are based on the [Collapse](https://mui.com/material-ui/api/collapse/#props) component
26
26
  */
27
- transition: SlotProps<React.ElementType<CollapseProps>, {}, StepContentOwnerState>;
27
+ transition: SlotComponentProps<React.ElementType, CollapseProps, StepContentOwnerState>;
28
28
  }
29
29
  >;
30
30
 
@@ -1,7 +1,32 @@
1
1
  import * as React from 'react';
2
- import { DrawerProps } from '../Drawer';
2
+ import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
3
+ import { DrawerProps, DrawerOwnerState, DrawerSlotsAndSlotProps } from '../Drawer';
3
4
 
4
- export interface SwipeableDrawerProps extends Omit<DrawerProps, 'onClose' | 'open'> {
5
+ export interface SwipeableDrawerSwipeAreaSlotPropsOverrides {}
6
+
7
+ export interface SwipeableDrawerSlots {
8
+ /**
9
+ * The component used for the swipeArea slot.
10
+ * @default div
11
+ */
12
+ swipeArea?: React.ElementType;
13
+ }
14
+
15
+ type SwipeableDrawerSlotsAndSlotProps = DrawerSlotsAndSlotProps &
16
+ CreateSlotsAndSlotProps<
17
+ SwipeableDrawerSlots,
18
+ {
19
+ /**
20
+ * Props forwarded to the docked slot.
21
+ * By default, the avaible props are based on a div element.
22
+ */
23
+ swipeArea: SlotProps<'div', SwipeableDrawerSwipeAreaSlotPropsOverrides, DrawerOwnerState>;
24
+ }
25
+ >;
26
+
27
+ export interface SwipeableDrawerProps
28
+ extends Omit<DrawerProps, 'onClose' | 'open' | 'slots' | 'slotProps'>,
29
+ SwipeableDrawerSlotsAndSlotProps {
5
30
  /**
6
31
  * If set to true, the swipe event will open the drawer even if the user begins the swipe on one of the drawer's children.
7
32
  * This can be useful in scenarios where the drawer is partially visible.
@@ -67,6 +92,7 @@ export interface SwipeableDrawerProps extends Omit<DrawerProps, 'onClose' | 'ope
67
92
  open?: boolean;
68
93
  /**
69
94
  * The element is used to intercept the touch events on the edge.
95
+ * @deprecated use the `slotProps.swipeArea` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
70
96
  */
71
97
  SwipeAreaProps?: object;
72
98
  /**