Skip to content

Commit

Permalink
diego review
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 committed Mar 12, 2024
1 parent 57791c4 commit 640c0f6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
22 changes: 4 additions & 18 deletions packages/mui-material/src/StepLabel/StepLabel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export type StepLabelSlotsAndSlotProps = CreateSlotsAndSlotProps<

export interface StepLabelOwnerState extends StepLabelProps {}

export interface StepLabelProps extends StandardProps<React.HTMLAttributes<HTMLDivElement>> {
export interface StepLabelProps
extends StandardProps<React.HTMLAttributes<HTMLDivElement>>,
StepLabelSlotsAndSlotProps {
/**
* In most cases will simply be a string containing a title for the label.
*/
Expand Down Expand Up @@ -57,22 +59,6 @@ export interface StepLabelProps extends StandardProps<React.HTMLAttributes<HTMLD
* The optional node to display.
*/
optional?: React.ReactNode;
/**
* The props used for each slot inside.
* @default {}
*/
slotProps?: {
/**
* Props applied to the label element.
* @default {}
*/
label?: React.HTMLProps<HTMLSpanElement>;
};
/**
* The components used for each slot inside.
* @default {}
*/
slots?: {};
/**
* The component to render in place of the [`StepIcon`](/material-ui/api/step-icon/).
*/
Expand All @@ -99,7 +85,7 @@ export type StepLabelClasskey = keyof NonNullable<StepLabelProps['classes']>;
*
* - [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;
};

Expand Down
9 changes: 3 additions & 6 deletions packages/mui-material/src/StepLabel/StepLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -190,12 +190,9 @@ const StepLabel = React.forwardRef(function StepLabel(inProps, ref) {
) : null}
<StepLabelLabelContainer className={classes.labelContainer} ownerState={ownerState}>
{children ? (
<StepLabelLabelSlot
{...stepLabelLabelProps}
className={clsx(classes.label, stepLabelLabelProps?.className)}
>
<LabelSlot {...labelProps} className={clsx(classes.label, labelProps?.className)}>
{children}
</StepLabelLabelSlot>
</LabelSlot>
) : null}
{optional}
</StepLabelLabelContainer>
Expand Down
1 change: 0 additions & 1 deletion packages/mui-material/src/StepLabel/StepLabel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ describe('<StepLabel />', () => {
render,
refInstanceof: window.HTMLSpanElement,
testVariantProps: { error: true },
testLegacyComponentsProp: false,
slots: {
label: { expectedClassName: classes.label },
},
Expand Down

0 comments on commit 640c0f6

Please sign in to comment.