Skip to content

Commit

Permalink
revert-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 committed Jun 1, 2024
1 parent c614d73 commit a327ab1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
6 changes: 4 additions & 2 deletions docs/translations/api-docs/modal/modal.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@
"onTransitionEnter": { "description": "A function called when a transition enters." },
"onTransitionExited": { "description": "A function called when a transition has exited." },
"open": { "description": "If <code>true</code>, the component is shown." },
"slotProps": { "description": "The props used for each slot inside." },
"slots": { "description": "The components used for each slot inside." },
"slotProps": { "description": "The props used for each slot inside the Modal." },
"slots": {
"description": "The components used for each slot inside the Modal. Either a string to use a HTML element or a component."
},
"sx": {
"description": "The system prop that allows defining system overrides as well as additional CSS styles."
}
Expand Down
27 changes: 15 additions & 12 deletions packages/mui-material/src/Modal/Modal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Theme } from '../styles';
import Backdrop, { BackdropProps } from '../Backdrop';
import { OverridableComponent } from '../OverridableComponent';
import { ModalClasses } from './modalClasses';
import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';

export interface ModalComponentsPropsOverrides {}

Expand All @@ -27,15 +26,7 @@ export interface ModalSlots {
backdrop?: React.ElementType;
}

export type ModalSlotsAndSlotProps = CreateSlotsAndSlotProps<
ModalSlots,
{
root: SlotProps<'div', ModalComponentsPropsOverrides, ModalOwnerState>;
backdrop: SlotProps<typeof Backdrop, ModalComponentsPropsOverrides, ModalOwnerState>;
}
>;

export interface ModalOwnProps extends ModalSlotsAndSlotProps {
export interface ModalOwnProps {
/**
* A backdrop component. This prop enables custom backdrop rendering.
* @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
Expand Down Expand Up @@ -187,6 +178,20 @@ export interface ModalOwnProps extends ModalSlotsAndSlotProps {
* If `true`, the component is shown.
*/
open: boolean;
/**
* The components used for each slot inside the Modal.
* Either a string to use a HTML element or a component.
* @default {}
*/
slots?: ModalSlots;
/**
* The props used for each slot inside the Modal.
* @default {}
*/
slotProps?: {
root?: SlotComponentProps<'div', ModalComponentsPropsOverrides, ModalOwnerState>;
backdrop?: SlotComponentProps<typeof Backdrop, ModalComponentsPropsOverrides, ModalOwnerState>;
};
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
Expand Down Expand Up @@ -235,6 +240,4 @@ export type ModalProps<
component?: React.ElementType;
};

export interface ModalOwnerState extends ModalProps {}

export default Modal;
5 changes: 3 additions & 2 deletions packages/mui-material/src/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,16 @@ Modal.propTypes /* remove-proptypes */ = {
*/
open: PropTypes.bool.isRequired,
/**
* The props used for each slot inside.
* The props used for each slot inside the Modal.
* @default {}
*/
slotProps: PropTypes.shape({
backdrop: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
}),
/**
* The components used for each slot inside.
* The components used for each slot inside the Modal.
* Either a string to use a HTML element or a component.
* @default {}
*/
slots: PropTypes.shape({
Expand Down

0 comments on commit a327ab1

Please sign in to comment.