Skip to content

Commit 357ffcc

Browse files
committed
Fix types
1 parent 50d5da3 commit 357ffcc

5 files changed

Lines changed: 11 additions & 8 deletions

File tree

packages/mui-material/src/Drawer/Drawer.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ export type DrawerSlotsAndSlotProps = CreateSlotsAndSlotProps<
8585
* By default, the available props are based on the [Slide](https://mui.com/material-ui/api/slide/#props) component.
8686
*/
8787
transition: SlotProps<
88-
React.ElementType<TransitionProps>,
89-
TransitionProps & DrawerTransitionSlotPropsOverrides,
88+
React.ElementType<SlideProps>,
89+
Omit<SlideProps, 'children'> & DrawerTransitionSlotPropsOverrides,
9090
DrawerOwnerState
9191
>;
9292
}

packages/mui-material/src/Drawer/Drawer.spec.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function Test() {
1515
<React.Fragment>
1616
<Drawer open />;
1717
<Drawer open slotProps={{ paper: paperProps }} />;
18+
<Drawer open slotProps={{ transition: { direction: 'left' } }} />;
1819
<Drawer
1920
open
2021
slotProps={{
@@ -42,6 +43,8 @@ function Test() {
4243
'aria-hidden': true,
4344
},
4445
transition: {
46+
container: document.body,
47+
direction: 'left',
4548
timeout: 500,
4649
},
4750
}}

packages/mui-material/src/Popover/Popover.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react';
22
import { SxProps } from '@mui/system';
33
import { SlotComponentProps } from '@mui/utils/types';
44
import { BackdropProps } from '../Backdrop';
5+
import { GrowProps } from '../Grow';
56
import { Theme } from '../styles';
67
import { InternalStandardProps as StandardProps } from '../internal';
78
import Paper, { PaperProps } from '../Paper';
@@ -57,8 +58,8 @@ export type PopoverSlotsAndSlotProps = CreateSlotsAndSlotProps<
5758
*/
5859
transition: SlotComponentProps<
5960
// use SlotComponentProps because transition slot does not support `component` and `sx` prop
60-
React.ElementType<TransitionProps>,
61-
TransitionProps & PopoverTransitionSlotPropsOverrides,
61+
React.ElementType<GrowProps>,
62+
Omit<GrowProps, 'children'> & PopoverTransitionSlotPropsOverrides,
6263
PopoverOwnerState
6364
>;
6465
/**

packages/mui-material/src/Popover/Popover.spec.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ function Test() {
1313
return (
1414
<React.Fragment>
1515
<Popover open />;
16-
<Popover open slotProps={{ paper: paperProps }} />;
16+
<Popover open PaperProps={paperProps} />;
17+
<Popover open anchorEl={document.body} slotProps={{ transition: { timeout: 'auto' } }} />;
1718
<Popover
1819
open
1920
slotProps={{

packages/mui-material/src/StepContent/StepContent.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ export interface StepContentSlots {
1414
* @default Collapse
1515
*/
1616
transition?:
17-
| React.JSXElementConstructor<
18-
TransitionProps & { children?: React.ReactElement<unknown, any> | undefined }
19-
>
17+
| React.JSXElementConstructor<TransitionProps & { children: React.ReactElement<unknown, any> }>
2018
| undefined;
2119
}
2220

0 commit comments

Comments
 (0)