Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/data/material/components/selects/MultipleSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import Select from '@mui/material/Select';
const ITEM_HEIGHT = 48;
const ITEM_PADDING_TOP = 8;
const MenuProps = {
PaperProps: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
slotProps: {
paper: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
},
},
},
};
Expand Down
10 changes: 6 additions & 4 deletions docs/data/material/components/selects/MultipleSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import Select, { SelectChangeEvent } from '@mui/material/Select';
const ITEM_HEIGHT = 48;
const ITEM_PADDING_TOP = 8;
const MenuProps = {
PaperProps: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
slotProps: {
paper: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import CheckBoxIcon from '@mui/icons-material/CheckBox';
const ITEM_HEIGHT = 48;
const ITEM_PADDING_TOP = 8;
const MenuProps = {
PaperProps: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
slotProps: {
paper: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import CheckBoxIcon from '@mui/icons-material/CheckBox';
const ITEM_HEIGHT = 48;
const ITEM_PADDING_TOP = 8;
const MenuProps = {
PaperProps: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
slotProps: {
paper: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
},
},
},
};
Expand Down
10 changes: 6 additions & 4 deletions docs/data/material/components/selects/MultipleSelectChip.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import Chip from '@mui/material/Chip';
const ITEM_HEIGHT = 48;
const ITEM_PADDING_TOP = 8;
const MenuProps = {
PaperProps: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
slotProps: {
paper: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
},
},
},
};
Expand Down
10 changes: 6 additions & 4 deletions docs/data/material/components/selects/MultipleSelectChip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import Chip from '@mui/material/Chip';
const ITEM_HEIGHT = 48;
const ITEM_PADDING_TOP = 8;
const MenuProps = {
PaperProps: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
slotProps: {
paper: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import Select from '@mui/material/Select';
const ITEM_HEIGHT = 48;
const ITEM_PADDING_TOP = 8;
const MenuProps = {
PaperProps: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
slotProps: {
paper: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import Select, { SelectChangeEvent } from '@mui/material/Select';
const ITEM_HEIGHT = 48;
const ITEM_PADDING_TOP = 8;
const MenuProps = {
PaperProps: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
slotProps: {
paper: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
},
},
},
};
Expand Down
64 changes: 64 additions & 0 deletions docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,70 @@ Use the `slotProps` prop instead:
+ },
```

#### Menu deprecated props removed

The following deprecated props have been removed:

- `MenuListProps` — use `slotProps.list` instead
- `PaperProps` — use `slotProps.paper` instead
- `TransitionProps` — use `slotProps.transition` instead

```diff
<Menu
- MenuListProps={{ disablePadding: true }}
- PaperProps={{ elevation: 12 }}
- TransitionProps={{ timeout: 500 }}
+ slotProps={{
+ list: { disablePadding: true },
+ paper: { elevation: 12 },
+ transition: { timeout: 500 },
+ }}
/>
```

If you pass these props via `Select`'s `MenuProps`, update them the same way:

```diff
<Select
MenuProps={{
- PaperProps: { style: { maxHeight: 200 } },
- MenuListProps: { disablePadding: true },
- TransitionProps: { timeout: 500 },
+ slotProps: {
+ paper: { style: { maxHeight: 200 } },
+ list: { disablePadding: true },
+ transition: { timeout: 500 },
+ },
}}
/>
```

#### Popover deprecated props removed

The following deprecated props have been removed:

- `BackdropComponent` — use `slots.backdrop` instead
- `BackdropProps` — use `slotProps.backdrop` instead
- `PaperProps` — use `slotProps.paper` instead
- `TransitionComponent` — use `slots.transition` instead
- `TransitionProps` — use `slotProps.transition` instead

```diff
<Popover
- BackdropComponent={CustomBackdrop}
- BackdropProps={{ invisible: true }}
- PaperProps={{ elevation: 12 }}
- TransitionComponent={CustomTransition}
- TransitionProps={{ timeout: 500 }}
+ slots={{ backdrop: CustomBackdrop, transition: CustomTransition }}
+ slotProps={{
+ backdrop: { invisible: true },
+ paper: { elevation: 12 },
+ transition: { timeout: 500 },
+ }}
/>
```

#### Tabs deprecated props removed

Use the [tabs-props codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#tabs-props) below to migrate the code as described in the following section:
Expand Down
12 changes: 0 additions & 12 deletions docs/pages/material-ui/api/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
"children": { "type": { "name": "node" } },
"classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
"disableAutoFocusItem": { "type": { "name": "bool" }, "default": "false" },
"MenuListProps": {
"type": { "name": "object" },
"default": "{}",
"deprecated": true,
"deprecationInfo": "use the <code>slotProps.list</code> prop instead. This prop will be removed in a future major release. See <a href=\"https://mui.com/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
},
"onClose": {
"type": { "name": "func" },
"signature": {
Expand Down Expand Up @@ -48,12 +42,6 @@
},
"default": "'auto'"
},
"TransitionProps": {
"type": { "name": "object" },
"default": "{}",
"deprecated": true,
"deprecationInfo": "use the <code>slotProps.transition</code> prop instead. This prop will be removed in a future major release. See <a href=\"https://mui.com/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
},
"variant": {
"type": { "name": "enum", "description": "'menu'<br>&#124;&nbsp;'selectedMenu'" },
"default": "'selectedMenu'"
Expand Down
29 changes: 0 additions & 29 deletions docs/pages/material-ui/api/popover.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,13 @@
},
"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>slots.backdrop</code> instead. This prop will be removed in a future major release. See <a href=\"https://mui.com/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
},
"BackdropProps": {
"type": { "name": "object" },
"deprecated": true,
"deprecationInfo": "Use <code>slotProps.backdrop</code> instead. This prop will be removed in a future major release. See <a href=\"https://mui.com/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
},
"children": { "type": { "name": "node" } },
"classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
"container": { "type": { "name": "union", "description": "HTML element<br>&#124;&nbsp;func" } },
"disableScrollLock": { "type": { "name": "bool" }, "default": "false" },
"elevation": { "type": { "name": "custom", "description": "integer" }, "default": "8" },
"marginThreshold": { "type": { "name": "number" }, "default": "16" },
"onClose": { "type": { "name": "func" } },
"PaperProps": {
"type": { "name": "shape", "description": "{ component?: element type }" },
"default": "{}",
"deprecated": true,
"deprecationInfo": "Use <code>slotProps.paper</code> instead."
},
"slotProps": {
"type": {
"name": "shape",
Expand Down Expand Up @@ -72,24 +55,12 @@
},
"default": "{\n vertical: 'top',\n horizontal: 'left',\n}"
},
"TransitionComponent": {
"type": { "name": "elementType" },
"default": "Grow",
"deprecated": true,
"deprecationInfo": "use the <code>slots.transition</code> prop instead. This prop will be removed in a future major release. See <a href=\"https://mui.com/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
},
"transitionDuration": {
"type": {
"name": "union",
"description": "'auto'<br>&#124;&nbsp;number<br>&#124;&nbsp;{ appear?: number, enter?: number, exit?: number }"
},
"default": "'auto'"
},
"TransitionProps": {
"type": { "name": "object" },
"default": "{}",
"deprecated": true,
"deprecationInfo": "use the <code>slotProps.transition</code> prop instead. This prop will be removed in a future major release. See <a href=\"https://mui.com/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
}
},
"name": "Popover",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/home/MaterialDesignComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ export default function MaterialDesignComponents() {
open={Boolean(anchor)}
anchorEl={anchor}
onClose={() => setAnchor(null)}
PaperProps={{ variant: 'outlined', elevation: 0 }}
slotProps={{ paper: { variant: 'outlined', elevation: 0 } }}
>
<MenuItem>
<ListItemIcon>
Expand Down
6 changes: 0 additions & 6 deletions docs/translations/api-docs/menu/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"disableAutoFocusItem": {
"description": "When opening the menu will not focus the active item but the <code>[role=&quot;menu&quot;]</code> unless <code>autoFocus</code> is also set to <code>false</code>. Not using the default means not following WAI-ARIA authoring practices. Please be considerate about possible accessibility implications."
},
"MenuListProps": {
"description": "Props applied to the <a href=\"https://mui.com/material-ui/api/menu-list/\"><code>MenuList</code></a> element."
},
"onClose": {
"description": "Callback fired when the component requests to be closed.",
"typeDescriptions": {
Expand All @@ -37,9 +34,6 @@
"transitionDuration": {
"description": "The length of the transition in <code>ms</code>, or &#39;auto&#39;"
},
"TransitionProps": {
"description": "Props applied to the transition element. By default, the element is based on this <a href=\"https://reactcommunity.org/react-transition-group/transition/\"><code>Transition</code></a> component."
},
"variant": {
"description": "The variant to use. Use <code>menu</code> to prevent selected items from impacting the initial focus."
}
Expand Down
15 changes: 0 additions & 15 deletions docs/translations/api-docs/popover/popover.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
"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 All @@ -36,9 +30,6 @@
"description": "Callback fired when the component requests to be closed. The <code>reason</code> parameter can optionally be used to control the response to <code>onClose</code>."
},
"open": { "description": "If <code>true</code>, the component is shown." },
"PaperProps": {
"description": "Props applied to the <a href=\"https://mui.com/material-ui/api/paper/\"><code>Paper</code></a> element.<br>This prop is an alias for <code>slotProps.paper</code> and will be overridden by it if both are used."
},
"slotProps": { "description": "The props used for each slot inside." },
"slots": { "description": "The components used for each slot inside." },
"sx": {
Expand All @@ -47,14 +38,8 @@
"transformOrigin": {
"description": "This is the point on the popover which will attach to the anchor&#39;s origin.<br>Options: vertical: [top, center, bottom, x(px)]; horizontal: [left, center, right, x(px)]."
},
"TransitionComponent": {
"description": "The component used for the transition. <a href=\"https://mui.com/material-ui/transitions/#transitioncomponent-prop\">Follow this guide</a> to learn more about the requirements for this component."
},
"transitionDuration": {
"description": "Set to &#39;auto&#39; to automatically calculate transition time based on height."
},
"TransitionProps": {
"description": "Props applied to the transition element. By default, the element is based on this <a href=\"https://reactcommunity.org/react-transition-group/transition/\"><code>Transition</code></a> component."
}
},
"classDescriptions": {},
Expand Down
13 changes: 0 additions & 13 deletions packages/mui-material/src/Menu/Menu.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ export interface MenuProps
* @default false
*/
disableAutoFocusItem?: boolean | undefined;
/**
* Props applied to the [`MenuList`](https://mui.com/material-ui/api/menu-list/) element.
* @deprecated use the `slotProps.list` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
* @default {}
*/
MenuListProps?: Partial<MenuListProps> | undefined;
/**
* Callback fired when the component requests to be closed.
*
Expand All @@ -150,13 +144,6 @@ export interface MenuProps
* @default 'auto'
*/
transitionDuration?: TransitionProps['timeout'] | 'auto' | undefined;
/**
* 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 the `slotProps.transition` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
* @default {}
*/
TransitionProps?: TransitionProps | undefined;
/**
* The variant to use. Use `menu` to prevent selected items from impacting the initial focus.
* @default 'selectedMenu'
Expand Down
Loading
Loading