Skip to content

Commit

Permalink
[material-ui][Menu,Popover] Fix Backdrop props descriptions (#43503)
Browse files Browse the repository at this point in the history
Co-authored-by: ZeeshanTamboli <[email protected]>
  • Loading branch information
Michael-Hutchinson and ZeeshanTamboli authored Aug 30, 2024
1 parent c1e89d9 commit 8b8732e
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
11 changes: 11 additions & 0 deletions docs/pages/material-ui/api/popover.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@
},
"default": "'anchorEl'"
},
"BackdropComponent": {
"type": { "name": "elementType" },
"default": "styled(Backdrop, {\n name: 'MuiModal',\n slot: 'Backdrop',\n overridesResolver: (props, styles) => {\n return styles.backdrop;\n },\n})({\n zIndex: -1,\n})",
"deprecated": true,
"deprecationInfo": "Use <code>slotProps.root.slots.backdrop</code> instead. While this prop currently works, it will be removed in the next major version."
},
"BackdropProps": {
"type": { "name": "object" },
"deprecated": true,
"deprecationInfo": "Use <code>slotProps.root.slotProps.backdrop</code> instead."
},
"children": { "type": { "name": "node" } },
"classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
"container": { "type": { "name": "union", "description": "HTML element<br>&#124;&nbsp;func" } },
Expand Down
6 changes: 6 additions & 0 deletions docs/translations/api-docs/popover/popover.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"anchorReference": {
"description": "This determines which anchor prop to refer to when setting the position of the popover."
},
"BackdropComponent": {
"description": "A backdrop component. This prop enables custom backdrop rendering."
},
"BackdropProps": {
"description": "Props applied to the <a href=\"/material-ui/api/backdrop/\"><code>Backdrop</code></a> element."
},
"children": { "description": "The content of the component." },
"classes": { "description": "Override or extend the styles applied to the component." },
"container": {
Expand Down
27 changes: 25 additions & 2 deletions packages/mui-material/src/Popover/Popover.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { SxProps } from '@mui/system';
import { InternalStandardProps as StandardProps } from '..';
import { BackdropProps, InternalStandardProps as StandardProps } from '..';
import Paper, { PaperProps } from '../Paper';
import Modal, { ModalOwnerState, ModalProps } from '../Modal';
import { Theme } from '../styles';
Expand Down Expand Up @@ -39,7 +39,10 @@ interface PopoverVirtualElement {
}

export interface PopoverProps
extends StandardProps<Omit<ModalProps, 'slots' | 'slotProps'>, 'children'>,
extends StandardProps<
Omit<ModalProps, 'slots' | 'slotProps' | 'BackdropProps' | 'BackdropComponent'>,
'children'
>,
PopoverSlotsAndSlotProps {
/**
* A ref for imperative actions.
Expand Down Expand Up @@ -82,6 +85,26 @@ export interface PopoverProps
* @default 'anchorEl'
*/
anchorReference?: PopoverReference;
/**
* A backdrop component. This prop enables custom backdrop rendering.
* @deprecated Use `slotProps.root.slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
* Use the `slotProps.root.slots.backdrop` prop to make your application ready for the next version of Material UI.
* @default styled(Backdrop, {
* name: 'MuiModal',
* slot: 'Backdrop',
* overridesResolver: (props, styles) => {
* return styles.backdrop;
* },
* })({
* zIndex: -1,
* })
*/
BackdropComponent?: React.ElementType<BackdropProps>;
/**
* Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
* @deprecated Use `slotProps.root.slotProps.backdrop` instead.
*/
BackdropProps?: Partial<BackdropProps>;
/**
* The content of the component.
*/
Expand Down
20 changes: 20 additions & 0 deletions packages/mui-material/src/Popover/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,26 @@ Popover.propTypes /* remove-proptypes */ = {
* @default 'anchorEl'
*/
anchorReference: PropTypes.oneOf(['anchorEl', 'anchorPosition', 'none']),
/**
* A backdrop component. This prop enables custom backdrop rendering.
* @deprecated Use `slotProps.root.slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
* Use the `slotProps.root.slots.backdrop` prop to make your application ready for the next version of Material UI.
* @default styled(Backdrop, {
* name: 'MuiModal',
* slot: 'Backdrop',
* overridesResolver: (props, styles) => {
* return styles.backdrop;
* },
* })({
* zIndex: -1,
* })
*/
BackdropComponent: PropTypes.elementType,
/**
* Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
* @deprecated Use `slotProps.root.slotProps.backdrop` instead.
*/
BackdropProps: PropTypes.object,
/**
* The content of the component.
*/
Expand Down

0 comments on commit 8b8732e

Please sign in to comment.