import { Toolbar, toolbarMenuBehavior, Accessibility, ToolbarMenuBehaviorProps } from '@fluentui/react-northstar'; import * as React from 'react'; import { CallVideoIcon, MoreIcon, SkypeLogoIcon } from '@fluentui/react-icons-northstar'; // behavior is overridden, as focus was causing inconsistency in displaying focus outline for screener tests const notAutoFocusToolbarMenuBehavior: Accessibility = props => { const behavior = toolbarMenuBehavior(props); behavior.focusZone.props.shouldFocusOnMount = false; return behavior; }; const ToolbarExampleVariables = () => { return ( }, { key: 'item-variables', active: true, icon: , variables: { foregroundActive: 'orange' } }, ], }, // kind="toggle" is just ToolbarItem // --- // ToolbarCustomItem { kind: 'custom', key: 'custom', content: 'Custom' }, { kind: 'custom', key: 'custom-variables', content: 'Custom', variables: { background: 'pink' } }, // ToolbarItem { // switched to svg icon icon: , key: 'item', active: true, }, { icon: , key: 'item-variables', active: true, variables: { foregroundActive: 'green' }, }, // ToolbarItem with menu { icon: , key: 'item-menu', menu: { accessibility: notAutoFocusToolbarMenuBehavior, items: [ // ToolbarMenuDivider { kind: 'divider', key: 'divider' }, { kind: 'divider', key: 'divider-variables', variables: { menuDividerBorder: 'orange' } }, // ToolbarMenuItem { key: 'item', content: 'Item' }, { key: 'item-variables', content: 'Item', variables: { menuItemForeground: 'orange' } }, // ToolbarMenuItem with menu { key: 'item-menu', content: 'Item', menu: { accessibility: notAutoFocusToolbarMenuBehavior, items: [ { key: 'item', content: 'Item' }, { key: 'item-variables', content: 'Item', variables: { menuItemForeground: 'gold' } }, ], styles: { width: '100px' /* decrease width to fit other menus */ }, }, menuOpen: true, }, { key: 'item-menu-variables', content: 'Item', menu: { accessibility: notAutoFocusToolbarMenuBehavior, items: [ { key: 'item', content: 'Item' }, { key: 'item-variables', content: 'Item', variables: { menuItemForeground: 'gold' } }, ], styles: { width: '100px' /* decrease width to fit other menus */ }, }, menuOpen: true, variables: { menuItemForeground: 'orange', menuBackground: 'grey' }, styles: { marginTop: '100px' /* avoid collision with other opened menu */, }, }, ], styles: { width: '100px' /* decrease width to fit other menus */ }, }, menuOpen: true, styles: { marginRight: '200px' /* avoid collision with other opened menu */ }, }, { icon: , key: 'item-menu-variables', menu: { accessibility: notAutoFocusToolbarMenuBehavior, items: [ { kind: 'divider', key: 'divider' }, { kind: 'divider', key: 'divider-variables', variables: { menuDividerBorder: 'orange' } }, // ToolbarMenuItem { key: 'item', content: 'Item' }, { key: 'item-variables', content: 'Item', variables: { menuItemForeground: 'orange' } }, // ToolbarMenuItem with menu { key: 'item-menu', content: 'Item', menu: { accessibility: notAutoFocusToolbarMenuBehavior, items: [ { key: 'item', content: 'Item' }, { key: 'item-variables', content: 'Item', variables: { menuItemForeground: 'gold' } }, ], styles: { width: '100px' /* decrease width to fit other menus */ }, }, menuOpen: true, }, { key: 'item-menu-variables', content: 'Item', menu: { accessibility: notAutoFocusToolbarMenuBehavior, items: [ { key: 'item', content: 'Item' }, { key: 'item-variables', content: 'Item', variables: { menuItemForeground: 'gold' } }, ], styles: { width: '100px' /* decrease width to fit other menus */ }, }, menuOpen: true, variables: { menuItemForeground: 'orange', menuBackground: 'grey' }, styles: { marginTop: '100px' /* avoid collision with other opened menu */ }, }, ], styles: { width: '100px' /* decrease width to fit other menus */ }, }, menuOpen: true, variables: { menuBackground: 'pink', menuDividerBorder: 'white', menuItemForeground: 'olive' }, }, ]} /> ); }; export default ToolbarExampleVariables;