File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,17 @@ export const argtypes = (
41
41
category : CATEGORY_CONTROL . CONTENT ,
42
42
} ,
43
43
} ,
44
+ component : {
45
+ description : 'Component' ,
46
+ type : { name : 'string' } ,
47
+ control : { type : 'text' } ,
48
+ table : {
49
+ type : {
50
+ summary : 'string | React.ComponentType<any>' ,
51
+ } ,
52
+ category : CATEGORY_CONTROL . CUSTOMIZATION ,
53
+ } ,
54
+ } ,
44
55
dataTestId : {
45
56
description : 'Test id' ,
46
57
type : { name : 'string' } ,
Original file line number Diff line number Diff line change @@ -14,7 +14,13 @@ const TagStandAloneComponent = (
14
14
) : JSX . Element => {
15
15
const ariaProps = pickAriaProps ( props ) ;
16
16
return (
17
- < TagContainerStyled ref = { ref } data-testid = { dataTestId } styles = { props . styles } { ...ariaProps } >
17
+ < TagContainerStyled
18
+ ref = { ref }
19
+ as = { props . component }
20
+ data-testid = { dataTestId }
21
+ styles = { props . styles }
22
+ { ...ariaProps }
23
+ >
18
24
< ElementOrIcon customIconStyles = { props . styles . icon } { ...props . icon } />
19
25
< Text
20
26
component = { TextComponentType . SPAN }
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ export interface ITagStandAlone extends TagAriaAttributes {
21
21
styles : TagPropsStylesType ;
22
22
icon ?: IElementOrIcon ;
23
23
label ?: TagLabelType ;
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
+ component ?: string | React . ComponentType < any > ;
24
26
dataTestId ?: string ;
25
27
}
26
28
You can’t perform that action at this time.
0 commit comments