diff --git a/docs/data/material/components/dialogs/DraggableDialog.js b/docs/data/material/components/dialogs/DraggableDialog.js index d4bbbc05d17136..6ba2560fe88ca4 100644 --- a/docs/data/material/components/dialogs/DraggableDialog.js +++ b/docs/data/material/components/dialogs/DraggableDialog.js @@ -40,7 +40,11 @@ export default function DraggableDialog() { diff --git a/packages/mui-material/src/Dialog/Dialog.d.ts b/packages/mui-material/src/Dialog/Dialog.d.ts index c4a496abddb3b6..3b20d4a30c4852 100644 --- a/packages/mui-material/src/Dialog/Dialog.d.ts +++ b/packages/mui-material/src/Dialog/Dialog.d.ts @@ -20,20 +20,27 @@ export interface DialogSlots { * The component that renders the paper. * @default Paper */ - paper?: React.JSXElementConstructor; + paper?: React.ElementType; } export interface DialogTransitionSlotPropsOverrides {} export interface DialogPaperSlotPropsOverrides {} + export type DialogSlotsAndSlotProps = CreateSlotsAndSlotProps< DialogSlots, { + /** + * Props forwarded to the transition slot. + */ transition: SlotProps< React.ElementType, DialogTransitionSlotPropsOverrides, DialogOwnerState >; + /** + * Props forwarded to the paper slot. + */ paper: SlotProps< React.ElementType, DialogPaperSlotPropsOverrides, diff --git a/packages/mui-material/src/Dialog/Dialog.js b/packages/mui-material/src/Dialog/Dialog.js index e7517258c5bb9f..599a129e1af1fa 100644 --- a/packages/mui-material/src/Dialog/Dialog.js +++ b/packages/mui-material/src/Dialog/Dialog.js @@ -476,11 +476,13 @@ Dialog.propTypes /* remove-proptypes */ = { /** * The component used to render the body of the dialog. * @default Paper + * @deprecated Use `slotProps.paper.component` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details. */ PaperComponent: PropTypes.elementType, /** * Props applied to the [`Paper`](https://mui.com/material-ui/api/paper/) element. * @default {} + * @deprecated Use `slotProps.paper` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details. */ PaperProps: PropTypes.object, /** @@ -493,6 +495,7 @@ Dialog.propTypes /* remove-proptypes */ = { * @default {} */ slotProps: PropTypes.shape({ + paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), }), /** @@ -500,6 +503,7 @@ Dialog.propTypes /* remove-proptypes */ = { * @default {} */ slots: PropTypes.shape({ + paper: PropTypes.elementType, transition: PropTypes.elementType, }), /** @@ -514,6 +518,7 @@ Dialog.propTypes /* remove-proptypes */ = { * The component used for the transition. * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component. * @default Fade + * @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. */ TransitionComponent: PropTypes.elementType, /** @@ -535,6 +540,7 @@ Dialog.propTypes /* remove-proptypes */ = { /** * Props applied to the transition element. * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component. + * @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. */ TransitionProps: PropTypes.object, };