Skip to content

Commit

Permalink
chore: Update Popover component with deprecated props and types
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Hutchinson committed Aug 28, 2024
1 parent a9ce22c commit b306c95
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 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
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 b306c95

Please sign in to comment.