diff --git a/packages/mui-material/src/StepLabel/StepLabel.d.ts b/packages/mui-material/src/StepLabel/StepLabel.d.ts index fa9235d2624239..bd389907657f0d 100644 --- a/packages/mui-material/src/StepLabel/StepLabel.d.ts +++ b/packages/mui-material/src/StepLabel/StepLabel.d.ts @@ -23,7 +23,9 @@ export type StepLabelSlotsAndSlotProps = CreateSlotsAndSlotProps< export interface StepLabelOwnerState extends StepLabelProps {} -export interface StepLabelProps extends StandardProps> { +export interface StepLabelProps + extends StandardProps>, + StepLabelSlotsAndSlotProps { /** * In most cases will simply be a string containing a title for the label. */ @@ -57,22 +59,6 @@ export interface StepLabelProps extends StandardProps; - }; - /** - * The components used for each slot inside. - * @default {} - */ - slots?: {}; /** * The component to render in place of the [`StepIcon`](/material-ui/api/step-icon/). */ @@ -99,7 +85,7 @@ export type StepLabelClasskey = keyof NonNullable; * * - [StepLabel API](https://mui.com/material-ui/api/step-label/) */ -declare const StepLabel: ((props: StepLabelProps & StepLabelSlotsAndSlotProps) => JSX.Element) & { +declare const StepLabel: ((props: StepLabelProps) => JSX.Element) & { muiName: string; }; diff --git a/packages/mui-material/src/StepLabel/StepLabel.js b/packages/mui-material/src/StepLabel/StepLabel.js index 280190f6669b10..1daf1a459b7228 100644 --- a/packages/mui-material/src/StepLabel/StepLabel.js +++ b/packages/mui-material/src/StepLabel/StepLabel.js @@ -164,7 +164,7 @@ const StepLabel = React.forwardRef(function StepLabel(inProps, ref) { }, }; - const [StepLabelLabelSlot, stepLabelLabelProps] = useSlot('label', { + const [LabelSlot, labelProps] = useSlot('label', { elementType: StepLabelLabel, externalForwardedProps, ownerState, @@ -190,12 +190,9 @@ const StepLabel = React.forwardRef(function StepLabel(inProps, ref) { ) : null} {children ? ( - + {children} - + ) : null} {optional} diff --git a/packages/mui-material/src/StepLabel/StepLabel.test.js b/packages/mui-material/src/StepLabel/StepLabel.test.js index a3e11babb82f4a..912a1a2b98d578 100644 --- a/packages/mui-material/src/StepLabel/StepLabel.test.js +++ b/packages/mui-material/src/StepLabel/StepLabel.test.js @@ -18,7 +18,6 @@ describe('', () => { render, refInstanceof: window.HTMLSpanElement, testVariantProps: { error: true }, - testLegacyComponentsProp: false, slots: { label: { expectedClassName: classes.label }, },