File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed
docs/pages/material-ui/api
packages/mui-material/src/StepIcon Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 55
55
"muiName" : " MuiStepIcon" ,
56
56
"forwardsRefTo" : " SVGSVGElement" ,
57
57
"filename" : " /packages/mui-material/src/StepIcon/StepIcon.js" ,
58
- "inheritance" : null ,
58
+ "inheritance" : { "component" : " SvgIcon " , "pathname" : " /material-ui/api/svg-icon/ " } ,
59
59
"demos" : " <ul><li><a href=\" /material-ui/react-stepper/\" >Stepper</a></li></ul>" ,
60
60
"cssComponent" : false
61
61
}
Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
2
import { SxProps } from '@mui/system' ;
3
- import { InternalStandardProps as StandardProps } from '..' ;
3
+ import { InternalStandardProps as StandardProps , SvgIconOwnProps } from '..' ;
4
4
import { Theme } from '../styles' ;
5
5
import { StepIconClasses } from './stepIconClasses' ;
6
6
7
7
export interface StepIconProps
8
- extends StandardProps < React . HTMLAttributes < HTMLDivElement > , 'children' > {
8
+ // TODO v7: extend React.HTMLAttributes<SVGSVGElement> as svg is root component of StepIcon not div
9
+ extends StandardProps < React . HTMLAttributes < HTMLDivElement > , 'color' | 'children' > ,
10
+ Omit < SvgIconOwnProps , 'children' > {
9
11
/**
10
12
* Whether this step is active.
11
13
* @default false
@@ -46,5 +48,6 @@ export type StepIconClasskey = keyof NonNullable<StepIconProps['classes']>;
46
48
* API:
47
49
*
48
50
* - [StepIcon API](https://mui.com/material-ui/api/step-icon/)
51
+ * - inherits [SvgIcon API](https://mui.com/material-ui/api/svg-icon/)
49
52
*/
50
53
export default function StepIcon ( props : StepIconProps ) : React . JSX . Element ;
Original file line number Diff line number Diff line change
1
+ import * as React from 'react' ;
2
+ import StepIcon from '@mui/material/StepIcon' ;
3
+
4
+ < StepIcon icon = { < div > icon</ div > } /> ;
5
+ < StepIcon icon = { < div > icon</ div > } titleAccess = "title" /> ;
Original file line number Diff line number Diff line change @@ -2,14 +2,15 @@ import * as React from 'react';
2
2
import { expect } from 'chai' ;
3
3
import { createRenderer } from '@mui/internal-test-utils' ;
4
4
import StepIcon , { stepIconClasses as classes } from '@mui/material/StepIcon' ;
5
+ import SvgIcon from '@mui/material/SvgIcon' ;
5
6
import describeConformance from '../../test/describeConformance' ;
6
7
7
8
describe ( '<StepIcon />' , ( ) => {
8
9
const { render } = createRenderer ( ) ;
9
10
10
11
describeConformance ( < StepIcon icon = { 1 } /> , ( ) => ( {
11
12
classes,
12
- inheritComponent : 'svg' ,
13
+ inheritComponent : SvgIcon ,
13
14
render,
14
15
muiName : 'MuiStepIcon' ,
15
16
testVariantProps : { completed : true } ,
You can’t perform that action at this time.
0 commit comments