Skip to content

Commit

Permalink
typescript formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 committed Jan 6, 2025
1 parent 3a71f67 commit 13c0dae
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
6 changes: 5 additions & 1 deletion docs/data/material/components/dialogs/DraggableDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export default function DraggableDialog() {
<Dialog
open={open}
onClose={handleClose}
PaperComponent={PaperComponent}
slotProps={{
paper: {
component: PaperComponent,
},
}}
aria-labelledby="draggable-dialog-title"
>
<DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">
Expand Down
9 changes: 8 additions & 1 deletion packages/mui-material/src/Dialog/Dialog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,27 @@ export interface DialogSlots {
* The component that renders the paper.
* @default Paper
*/
paper?: React.JSXElementConstructor<PaperProps>;
paper?: React.ElementType<PaperProps>;
}

export interface DialogTransitionSlotPropsOverrides {}

export interface DialogPaperSlotPropsOverrides {}

export type DialogSlotsAndSlotProps = CreateSlotsAndSlotProps<
DialogSlots,
{
/**
* Props forwarded to the transition slot.
*/
transition: SlotProps<
React.ElementType<TransitionProps>,
DialogTransitionSlotPropsOverrides,
DialogOwnerState
>;
/**
* Props forwarded to the paper slot.
*/
paper: SlotProps<
React.ElementType<PaperProps>,
DialogPaperSlotPropsOverrides,
Expand Down
6 changes: 6 additions & 0 deletions packages/mui-material/src/Dialog/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
/**
Expand All @@ -493,13 +495,15 @@ Dialog.propTypes /* remove-proptypes */ = {
* @default {}
*/
slotProps: PropTypes.shape({
paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
}),
/**
* The components used for each slot inside.
* @default {}
*/
slots: PropTypes.shape({
paper: PropTypes.elementType,
transition: PropTypes.elementType,
}),
/**
Expand All @@ -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,
/**
Expand All @@ -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,
};
Expand Down

0 comments on commit 13c0dae

Please sign in to comment.