File tree Expand file tree Collapse file tree 3 files changed +41
-18
lines changed
Expand file tree Collapse file tree 3 files changed +41
-18
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @linode/manager " : Fixed
3+ ---
4+
5+ Disabled Tab + Tooltip styles & accessibility ([ #13113 ] ( https://github.com/linode/manager/pull/13113 ) )
Original file line number Diff line number Diff line change @@ -54,13 +54,6 @@ const TabbedPanel = React.memo((props: TabbedPanelProps) => {
5454
5555 const [ tabIndex , setTabIndex ] = useState < number | undefined > ( initTab ) ;
5656
57- const sxHelpIcon = {
58- height : 20 ,
59- m : 0.5 ,
60- verticalAlign : 'sub' ,
61- width : 20 ,
62- } ;
63-
6457 const tabChangeHandler = ( index : number ) => {
6558 setTabIndex ( index ) ;
6659 if ( handleTabChange ) {
@@ -99,20 +92,39 @@ const TabbedPanel = React.memo((props: TabbedPanelProps) => {
9992 < StyledTabs index = { tabIndex } onChange = { tabChangeHandler } >
10093 < StyledTabList >
10194 { tabs . map ( ( tab , idx ) => (
102- < StyledTab
103- data-pendo-id = { tab . title }
104- disabled = { tab . disabled }
105- key = { `tabs-${ tab . title } -${ idx } ` }
106- >
107- { tab . title }
95+ < >
96+ < StyledTab
97+ data-pendo-id = { tab . title }
98+ disabled = { tab . disabled }
99+ key = { `tabs-${ tab . title } -${ idx } ` }
100+ >
101+ { tab . title }
102+ </ StyledTab >
108103 { tab . disabled && props . tabDisabledMessage && (
109- < Tooltip title = { props . tabDisabledMessage } >
110- < span >
111- < HelpOutline fontSize = "small" sx = { sxHelpIcon } />
112- </ span >
104+ < Tooltip tabIndex = { 0 } title = { props . tabDisabledMessage } >
105+ < Box
106+ sx = { ( theme ) => ( {
107+ marginLeft : `-${ theme . spacingFunction ( 12 ) } ` ,
108+ marginTop : theme . spacingFunction ( 10 ) ,
109+ } ) }
110+ >
111+ < HelpOutline
112+ fontSize = "small"
113+ sx = { ( theme ) => ( {
114+ height : 20 ,
115+ m : 0.5 ,
116+ width : 20 ,
117+ color : theme . tokens . component . Tab . Disabled . Icon ,
118+ '&:hover' : {
119+ color : theme . tokens . component . Tab . Hover . Icon ,
120+ cursor : 'pointer' ,
121+ } ,
122+ } ) }
123+ />
124+ </ Box >
113125 </ Tooltip >
114126 ) }
115- </ StyledTab >
127+ </ >
116128 ) ) }
117129 </ StyledTabList >
118130 < TabPanels >
Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ const useStyles = makeStyles()((theme: Theme) => ({
1414 '&:hover' : {
1515 backgroundColor : theme . color . grey7 ,
1616 } ,
17+ '&:disabled' : {
18+ opacity : 1 ,
19+ color : theme . tokens . component . Tab . Disabled . Text ,
20+ cursor : 'not-allowed' ,
21+ pointerEvents : 'none' ,
22+ } ,
1723 alignItems : 'center' ,
1824 borderBottom : '2px solid transparent' ,
1925 color : theme . textColors . linkActiveLight ,
You can’t perform that action at this time.
0 commit comments