@@ -8,8 +8,10 @@ import {Divider} from './Divider'
88import { Description } from './Description'
99import Avatar from '../Avatar'
1010import { FileDirectoryIcon , HeartFillIcon } from '@primer/octicons-react'
11+ import { TabContainerElement } from '@github/tab-container-element'
1112import { Stack } from '../Stack'
1213import { AnchoredOverlay } from '../AnchoredOverlay'
14+ import createComponent from '../utils/create-component'
1315
1416export default {
1517 title : 'Components/ActionList/Dev' ,
@@ -375,3 +377,45 @@ export const OverlayWrapping = () => {
375377 </ div >
376378 )
377379}
380+
381+ const TabContainerComponent = createComponent ( TabContainerElement , 'tab-container' )
382+
383+ export const TabListRoles = ( ) => (
384+ < TabContainerComponent >
385+ < ActionList role = "tablist" aria-label = "Tabs example" >
386+ < ActionList . Item role = "tab" > Tab 1</ ActionList . Item >
387+ < ActionList . Item role = "tab" > Tab 2</ ActionList . Item >
388+ < ActionList . Item role = "tab" aria-selected >
389+ Tab 3
390+ </ ActionList . Item >
391+ </ ActionList >
392+ < div role = "tabpanel" data-tab-container-no-tabstop >
393+ Panel 1
394+ </ div >
395+ < div role = "tabpanel" data-tab-container-no-tabstop hidden >
396+ Panel 2
397+ </ div >
398+ < div role = "tabpanel" data-tab-container-no-tabstop hidden >
399+ Panel 3
400+ </ div >
401+ </ TabContainerComponent >
402+ )
403+
404+ export const TabListInfersItemRole = ( ) => (
405+ < TabContainerComponent >
406+ < ActionList role = "tablist" aria-label = "Tabs example" >
407+ < ActionList . Item > Tab 1</ ActionList . Item >
408+ < ActionList . Item > Tab 2</ ActionList . Item >
409+ < ActionList . Item > Tab 3</ ActionList . Item >
410+ </ ActionList >
411+ < div role = "tabpanel" data-tab-container-no-tabstop >
412+ Panel 1
413+ </ div >
414+ < div role = "tabpanel" data-tab-container-no-tabstop hidden >
415+ Panel 2
416+ </ div >
417+ < div role = "tabpanel" data-tab-container-no-tabstop hidden >
418+ Panel 3
419+ </ div >
420+ </ TabContainerComponent >
421+ )
0 commit comments