@@ -11,23 +11,28 @@ const ITEM_CLASS = 'TabNav-item'
1111const SELECTED_CLASS = 'selected'
1212
1313const TabNavBase = styled . div < SxProp > `
14- margin-top: 0;
15- border-bottom: 1px solid ${ get ( 'colors.border.default' ) } ;
1614 ${ sx }
1715`
1816
19- const TabNavBody = styled . nav `
17+ const TabNavTabList = styled . div `
2018 display: flex;
2119 margin-bottom: -1px;
2220 overflow: auto;
2321`
2422
23+ const TabNavNav = styled . nav `
24+ margin-top: 0;
25+ border-bottom: 1px solid ${ get ( 'colors.border.default' ) } ;
26+ `
27+
2528export type TabNavProps = ComponentProps < typeof TabNavBase >
2629
2730function TabNav ( { children, 'aria-label' : ariaLabel , ...rest } : TabNavProps ) {
2831 return (
2932 < TabNavBase { ...rest } >
30- < TabNavBody aria-label = { ariaLabel } > { children } </ TabNavBody >
33+ < TabNavNav aria-label = { ariaLabel } >
34+ < TabNavTabList role = "tablist" > { children } </ TabNavTabList >
35+ </ TabNavNav >
3136 </ TabNavBase >
3237 )
3338}
@@ -39,7 +44,8 @@ type StyledTabNavLinkProps = {
3944
4045const TabNavLink = styled . a . attrs < StyledTabNavLinkProps > ( props => ( {
4146 activeClassName : typeof props . to === 'string' ? 'selected' : '' ,
42- className : classnames ( ITEM_CLASS , props . selected && SELECTED_CLASS , props . className )
47+ className : classnames ( ITEM_CLASS , props . selected && SELECTED_CLASS , props . className ) ,
48+ role : 'tab'
4349} ) ) < StyledTabNavLinkProps > `
4450 padding: 8px 12px;
4551 font-size: ${ get ( 'fontSizes.1' ) } ;
0 commit comments