File tree Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,44 @@ export const Tooltip: Story = {
49
49
} ,
50
50
} ;
51
51
52
+ export const TooltipSimple : Story = {
53
+ args : {
54
+ variant : Object . values ( variantsObject [ themeSelected ] . TooltipVariantType || { } ) [ 0 ] as string ,
55
+ title : { content : 'Tootltip title' } ,
56
+ content : {
57
+ content : (
58
+ < div style = { { color : '#fff' } } >
59
+ < div > content first line</ div >
60
+ </ div >
61
+ ) ,
62
+ } ,
63
+ children : 'Hover me' ,
64
+ align : TooltipAlignType . TOP ,
65
+ tooltipAsModal : false ,
66
+ themeArgs : themesObject [ themeSelected ] [ STYLES_NAME . TOOLTIP ] ,
67
+ } ,
68
+ } ;
69
+
70
+ export const TooltipComplex : Story = {
71
+ args : {
72
+ variant : Object . values ( variantsObject [ themeSelected ] . TooltipVariantType || { } ) [ 0 ] as string ,
73
+ title : { content : 'Tootltip title' } ,
74
+ content : {
75
+ content : (
76
+ < div style = { { color : '#fff' } } >
77
+ < div > content first line</ div >
78
+ < div > content second line</ div >
79
+ </ div >
80
+ ) ,
81
+ } ,
82
+ children : 'Hover me' ,
83
+ align : TooltipAlignType . TOP ,
84
+ closeIcon : { icon : ICONS . ICON_PLACEHOLDER , altText : 'Close icon' } ,
85
+ tooltipAsModal : true ,
86
+ themeArgs : themesObject [ themeSelected ] [ STYLES_NAME . TOOLTIP ] ,
87
+ } ,
88
+ } ;
89
+
52
90
export const TooltipWithCtv : Story = {
53
91
args : {
54
92
variant : Object . values ( variantsObject [ themeSelected ] . TooltipVariantType || { } ) [ 0 ] as string ,
Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ const TooltipStandAlone = ({
59
59
const Tooltip = (
60
60
< TooltipExternalContainerStyled
61
61
ref = { props . tooltipRef }
62
- aria-label = { props . tooltipAsModal ? props . tooltipAriaLabel : undefined }
62
+ aria-label = { props . tooltipAriaLabel }
63
+ aria-labelledby = { titleId }
63
64
as = { getHtmlTagForTooltip ( {
64
65
mediaDevice : props . mediaDevice ,
65
66
tooltipAsModal : props . tooltipAsModal ,
@@ -107,7 +108,7 @@ const TooltipStandAlone = ({
107
108
styles = { props . styles }
108
109
>
109
110
< Text
110
- component = { TextComponentType . SPAN }
111
+ component = { TextComponentType . H2 }
111
112
customTypography = { props . styles ?. title }
112
113
dataTestId = { `${ props . dataTestId } TooltipContentTitle` }
113
114
variant = { props . styles . title ?. font_variant }
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ const TooltipUnControlledComponent = React.forwardRef(
151
151
mediaDevice = { mediaDevice }
152
152
popoverOpen = { open }
153
153
styles = { styles }
154
- tooltipAriaLabel = { tooltipAriaLabel ?? helpAriaLabel }
154
+ tooltipAriaLabel = { tooltipAriaLabel }
155
155
tooltipAsModal = { tooltipAsModalValue }
156
156
tooltipRef = { tooltipRef }
157
157
onBlur = { handleBlur }
You can’t perform that action at this time.
0 commit comments