diff --git a/docs/pages/material-ui/api/step-icon.json b/docs/pages/material-ui/api/step-icon.json index 82d908380447bb..16d31b1020e608 100644 --- a/docs/pages/material-ui/api/step-icon.json +++ b/docs/pages/material-ui/api/step-icon.json @@ -55,7 +55,7 @@ "muiName": "MuiStepIcon", "forwardsRefTo": "SVGSVGElement", "filename": "/packages/mui-material/src/StepIcon/StepIcon.js", - "inheritance": null, + "inheritance": { "component": "SvgIcon", "pathname": "/material-ui/api/svg-icon/" }, "demos": "", "cssComponent": false } diff --git a/packages/mui-material/src/StepIcon/StepIcon.d.ts b/packages/mui-material/src/StepIcon/StepIcon.d.ts index d71906a033977e..eae78f0f3fcc14 100644 --- a/packages/mui-material/src/StepIcon/StepIcon.d.ts +++ b/packages/mui-material/src/StepIcon/StepIcon.d.ts @@ -1,11 +1,13 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { InternalStandardProps as StandardProps } from '..'; +import { InternalStandardProps as StandardProps, SvgIconOwnProps } from '..'; import { Theme } from '../styles'; import { StepIconClasses } from './stepIconClasses'; export interface StepIconProps - extends StandardProps, 'children'> { + // TODO v7: extend React.HTMLAttributes as svg is root component of StepIcon not div + extends StandardProps, 'color' | 'children'>, + Omit { /** * Whether this step is active. * @default false @@ -46,5 +48,6 @@ export type StepIconClasskey = keyof NonNullable; * API: * * - [StepIcon API](https://mui.com/material-ui/api/step-icon/) + * - inherits [SvgIcon API](https://mui.com/material-ui/api/svg-icon/) */ export default function StepIcon(props: StepIconProps): React.JSX.Element; diff --git a/packages/mui-material/src/StepIcon/StepIcon.spec.tsx b/packages/mui-material/src/StepIcon/StepIcon.spec.tsx new file mode 100644 index 00000000000000..3a43cba9d79655 --- /dev/null +++ b/packages/mui-material/src/StepIcon/StepIcon.spec.tsx @@ -0,0 +1,5 @@ +import * as React from 'react'; +import StepIcon from '@mui/material/StepIcon'; + +icon} />; +icon} titleAccess="title" />; diff --git a/packages/mui-material/src/StepIcon/StepIcon.test.js b/packages/mui-material/src/StepIcon/StepIcon.test.js index 1469588b5bba7c..e4e0f7202545e4 100644 --- a/packages/mui-material/src/StepIcon/StepIcon.test.js +++ b/packages/mui-material/src/StepIcon/StepIcon.test.js @@ -2,6 +2,7 @@ import * as React from 'react'; import { expect } from 'chai'; import { createRenderer } from '@mui/internal-test-utils'; import StepIcon, { stepIconClasses as classes } from '@mui/material/StepIcon'; +import SvgIcon from '@mui/material/SvgIcon'; import describeConformance from '../../test/describeConformance'; describe('', () => { @@ -9,7 +10,7 @@ describe('', () => { describeConformance(, () => ({ classes, - inheritComponent: 'svg', + inheritComponent: SvgIcon, render, muiName: 'MuiStepIcon', testVariantProps: { completed: true },