@@ -16,6 +16,7 @@ import { EuiText } from '../text';
1616import { EuiFlyout } from './flyout' ;
1717import { EuiFlyoutBody } from './flyout_body' ;
1818import { EuiFlyoutMenu , EuiFlyoutMenuProps } from './flyout_menu' ;
19+ import { EuiFlyoutHeader } from './flyout_header' ;
1920
2021interface Args extends EuiFlyoutMenuProps {
2122 showCustomActions : boolean ;
@@ -26,6 +27,7 @@ const meta: Meta<Args> = {
2627 title : 'Layout/EuiFlyout/EuiFlyoutMenu' ,
2728 component : EuiFlyoutMenu ,
2829 argTypes : {
30+ hideTitle : { control : 'boolean' } ,
2931 showBackButton : { control : 'boolean' } ,
3032 showCustomActions : { control : 'boolean' } ,
3133 'aria-label' : { table : { disable : true } } ,
@@ -38,13 +40,15 @@ const meta: Meta<Args> = {
3840 showBackButton : true ,
3941 showCustomActions : true ,
4042 showHistoryItems : true ,
43+ hideTitle : true ,
4144 } ,
4245} ;
4346
4447export default meta ;
4548
4649const MenuBarFlyout = ( args : Args ) => {
4750 const {
51+ hideTitle,
4852 hideCloseButton,
4953 showBackButton,
5054 showCustomActions,
@@ -80,6 +84,8 @@ const MenuBarFlyout = (args: Args) => {
8084 'aria-label' : `${ iconType } action` ,
8185 } ) ) ;
8286
87+ const titleId = 'menu-bar-example-main-title' ;
88+
8389 return (
8490 < >
8591 < EuiButton onClick = { openFlyout } disabled = { isFlyoutOpen } >
@@ -94,15 +100,25 @@ const MenuBarFlyout = (args: Args) => {
94100 type = "overlay"
95101 outsideClickCloses = { false }
96102 ownFocus
103+ aria-labelledby = { titleId }
97104 flyoutMenuProps = { {
98105 title : 'Flyout title' ,
106+ titleId,
107+ hideTitle,
99108 hideCloseButton,
100109 showBackButton,
101110 backButtonProps,
102111 historyItems,
103112 customActions : showCustomActions ? customActions : undefined ,
104113 } }
105114 >
115+ { hideTitle && (
116+ < EuiFlyoutHeader hasBorder >
117+ < EuiText >
118+ < h2 id = { titleId } > Simple flyout header</ h2 >
119+ </ EuiText >
120+ </ EuiFlyoutHeader >
121+ ) }
106122 < EuiFlyoutBody >
107123 < EuiText >
108124 < p > Simple flyout content.</ p >
0 commit comments