diff --git a/packages/mui-joy/src/Drawer/DrawerProps.ts b/packages/mui-joy/src/Drawer/DrawerProps.ts index 573a55837480cb..bc72b1d720e0c0 100644 --- a/packages/mui-joy/src/Drawer/DrawerProps.ts +++ b/packages/mui-joy/src/Drawer/DrawerProps.ts @@ -1,10 +1,10 @@ import * as React from 'react'; import { OverridableStringUnion, OverrideProps } from '@mui/types'; import { ColorPaletteProp, VariantProp, ApplyColorInversion } from '../styles/types'; -import { ModalOwnProps } from '../Modal'; +import { ModalOwnProps } from '../Modal/ModalProps'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; -export type DrawerSlot = 'root' | 'label' | 'action' | 'startDecorator' | 'endDecorator'; +export type DrawerSlot = 'root' | 'backdrop' | 'content'; export interface DrawerSlots { /** diff --git a/packages/mui-joy/src/styles/components.d.ts b/packages/mui-joy/src/styles/components.d.ts index dd53c6ffd45614..f12a710f7ee8c6 100644 --- a/packages/mui-joy/src/styles/components.d.ts +++ b/packages/mui-joy/src/styles/components.d.ts @@ -101,6 +101,7 @@ import { DialogTitleOwnerState, DialogTitleSlot, } from '../DialogTitle/DialogTitleProps'; +import { DrawerProps, DrawerOwnerState, DrawerSlot } from '../Drawer/DrawerProps'; import { ScopedCssBaselineProps, ScopedCssBaselineOwnerState, @@ -349,6 +350,10 @@ export interface Components { defaultProps?: Partial; styleOverrides?: StyleOverrides; }; + JoyDrawer?: { + defaultProps?: Partial; + styleOverrides?: StyleOverrides; + }; JoyScopedCssBaseline?: { defaultProps?: Partial; styleOverrides?: StyleOverrides; diff --git a/packages/mui-joy/src/styles/extendTheme.spec.ts b/packages/mui-joy/src/styles/extendTheme.spec.ts index 7192f859fd1089..73e42542bd3583 100644 --- a/packages/mui-joy/src/styles/extendTheme.spec.ts +++ b/packages/mui-joy/src/styles/extendTheme.spec.ts @@ -27,6 +27,7 @@ import { DialogActionsOwnerState } from '@mui/joy/DialogActions'; import { DialogContentOwnerState } from '@mui/joy/DialogContent'; import { DialogTitleOwnerState } from '@mui/joy/DialogTitle'; import { DividerOwnerState } from '@mui/joy/Divider'; +import { DrawerOwnerState } from '@mui/joy/Drawer'; import { FormControlOwnerState } from '@mui/joy/FormControl'; import { FormHelperTextOwnerState } from '@mui/joy/FormHelperText'; import { FormLabelOwnerState } from '@mui/joy/FormLabel'; @@ -634,6 +635,26 @@ extendTheme({ }, }, }, + JoyDrawer: { + defaultProps: { + variant: 'plain', + color: 'neutral', + }, + styleOverrides: { + root: ({ ownerState }) => { + expectType, typeof ownerState>(ownerState); + return {}; + }, + backdrop: ({ ownerState }) => { + expectType, typeof ownerState>(ownerState); + return {}; + }, + content: ({ ownerState }) => { + expectType, typeof ownerState>(ownerState); + return {}; + }, + }, + }, JoyFormControl: { styleOverrides: { root: ({ ownerState }) => {