-
Notifications
You must be signed in to change notification settings - Fork 889
[EuiHeader] Increase z-index value #8325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 14 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d17cf70
Change header z-index from 1000 to 2000
acstll e93bd4d
Use levels.flyout (instead of .header) for EuiDataGrid cell popover
acstll bd33e72
Update snapshots
acstll 139ee24
Add example to docs for testing purposes
acstll fa41243
Revert changing levels.header value
acstll 8216ed0
Increase fixed EuiHeader z-index by 1
acstll f70c52d
Changelog
acstll 530902d
Merge remote-tracking branch 'upstream/main' into header-z-index-8206
acstll 49c1ae5
Add spec to test fixed Header is above Flyout
acstll 7686c05
Update hint text in EuiCollapsibleNavBeta story
acstll cf1f070
Add focusable items to EuiCollapsibleNavBeta flyout story
acstll 192efcc
Only one item in the changelog
acstll cdebce0
Include EuiCollapsibleNavBeta in flyout shards spec
acstll 108ab90
Merge remote-tracking branch 'upstream/main' into header-z-index-8206
acstll 3026d8a
Remove testing example from docs
acstll 1c98683
Include EuiCollapsibleNav in flyout shards spec
acstll bb61e92
Skip failing spec
acstll 59bdf51
Add links to comment in skipped test
acstll 0123868
refactor(EuiHeader): update shadow to xs
mgadewoll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| **Bug fixes** | ||
|
|
||
| - Fixed a bug in `EuiHeader` where the navigation of `EuiCollapsibleNavBeta` would render below the `EuiFlyout`'s overlay | ||
360 changes: 360 additions & 0 deletions
360
packages/eui/src-docs/src/views/header/header_elastic_pattern_project.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,360 @@ | ||
| import React, { useState } from 'react'; | ||
| // import { css } from '@emotion/css'; | ||
| import { Link } from 'react-router-dom'; | ||
|
|
||
| import { | ||
| EuiAvatar, | ||
| // EuiBadge, | ||
| EuiButton, | ||
| // EuiCollapsibleNav, | ||
| EuiCollapsibleNavBeta, | ||
| EuiCollapsibleNavGroup, | ||
| EuiFlexItem, | ||
| EuiFlyout, | ||
| EuiFlyoutBody, | ||
| EuiFlyoutHeader, | ||
| EuiHeader, | ||
| EuiHeaderLink, | ||
| EuiHeaderLinks, | ||
| EuiHeaderLogo, | ||
| EuiHeaderSectionItemButton, | ||
| EuiIcon, | ||
| EuiListGroupItem, | ||
| EuiPopover, | ||
| EuiPortal, | ||
| EuiShowFor, | ||
| EuiText, | ||
| EuiTitle, | ||
| EuiSelectableTemplateSitewide, | ||
| EuiSelectableMessage, | ||
| // useEuiTheme, | ||
| useGeneratedHtmlId, | ||
| } from '../../../../src'; | ||
|
|
||
| // @ts-ignore Not TS yet | ||
| import { ExampleContext } from '../../services'; | ||
|
|
||
| // FIXME this is temporary, for testing purposes — if we want to keep it, it'll need polish | ||
|
mgadewoll marked this conversation as resolved.
Outdated
|
||
|
|
||
| export default () => { | ||
| // const { euiTheme } = useEuiTheme(); | ||
| const guideHeaderCollapsibleNavId = useGeneratedHtmlId({ | ||
| prefix: 'guideHeaderCollapsibleNav', | ||
| }); | ||
| const guideHeaderAlertFlyoutId = useGeneratedHtmlId({ | ||
| prefix: 'guideHeaderAlertFlyout', | ||
| }); | ||
| const guideHeaderAlertFlyoutTitleId = useGeneratedHtmlId({ | ||
| prefix: 'guideHeaderAlertFlyoutTitle', | ||
| }); | ||
| const guideHeaderUserPopoverId = useGeneratedHtmlId({ | ||
| prefix: 'guideHeaderUserPopover', | ||
| }); | ||
| const guideHeaderSpacesPopoverId = useGeneratedHtmlId({ | ||
| prefix: 'guideHeaderSpacesPopover', | ||
| }); | ||
|
|
||
| /** | ||
| * Collapsible Nav | ||
| */ | ||
| const [navIsOpen, setNavIsOpen] = useState( | ||
| JSON.parse(String(localStorage.getItem('navIsDocked'))) || false | ||
| ); | ||
| const [navIsDocked, setNavIsDocked] = useState( | ||
| JSON.parse(String(localStorage.getItem('navIsDocked'))) || false | ||
| ); | ||
| const collapsibleNavContent = ( | ||
| <> | ||
| <EuiFlexItem className="eui-yScroll"> | ||
| {/* Docs callout */} | ||
| <EuiCollapsibleNavGroup background="none" title="EuiCollapsibleNav"> | ||
| <EuiText size="s" color="subdued" style={{ padding: '0 8px 8px' }}> | ||
| <p> | ||
| Please see the component page for{' '} | ||
| <Link to="/navigation/collapsible-nav"> | ||
| <strong>EuiCollapsibleNav</strong> | ||
| </Link>{' '} | ||
| on how to configure your navigation. | ||
| </p> | ||
| </EuiText> | ||
| </EuiCollapsibleNavGroup> | ||
| </EuiFlexItem> | ||
| <EuiFlexItem grow={false}> | ||
| {/* Docking button only for larger screens that can support it*/} | ||
| <EuiShowFor sizes={['l', 'xl']}> | ||
| <EuiCollapsibleNavGroup> | ||
| <EuiListGroupItem | ||
| size="xs" | ||
| color="subdued" | ||
| label={`${navIsDocked ? 'Undock' : 'Dock'} navigation`} | ||
| onClick={() => { | ||
| setNavIsDocked(!navIsDocked); | ||
| localStorage.setItem( | ||
| 'navIsDocked', | ||
| JSON.stringify(!navIsDocked) | ||
| ); | ||
| }} | ||
| iconType={navIsDocked ? 'lock' : 'lockOpen'} | ||
| /> | ||
| </EuiCollapsibleNavGroup> | ||
| </EuiShowFor> | ||
| </EuiFlexItem> | ||
| </> | ||
| ); | ||
| // const collapsibleNavOld = ( | ||
| // <EuiCollapsibleNav | ||
| // id={guideHeaderCollapsibleNavId} | ||
| // aria-label="Main navigation" | ||
| // isOpen={navIsOpen} | ||
| // isDocked={navIsDocked} | ||
| // button={ | ||
| // <EuiHeaderSectionItemButton | ||
| // aria-label="Toggle main navigation" | ||
| // onClick={() => setNavIsOpen(!navIsOpen)} | ||
| // > | ||
| // <EuiIcon type={'menu'} size="m" aria-hidden="true" /> | ||
| // </EuiHeaderSectionItemButton> | ||
| // } | ||
| // onClose={() => setNavIsOpen(false)} | ||
| // > | ||
| // {collapsibleNavContent} | ||
| // </EuiCollapsibleNav> | ||
| // ); | ||
| const collapsibleNav = ( | ||
| <EuiCollapsibleNavBeta | ||
| id={guideHeaderCollapsibleNavId} | ||
| aria-label="Main navigation" | ||
| isCollapsed={!navIsOpen} | ||
| onCollapseToggle={() => setNavIsOpen(!navIsOpen)} | ||
| > | ||
| {navIsOpen ? ( | ||
| collapsibleNavContent | ||
| ) : ( | ||
| <a href="#" style={{ padding: '0.875rem' }}> | ||
| OK | ||
| </a> | ||
| )} | ||
| </EuiCollapsibleNavBeta> | ||
| ); | ||
|
|
||
| /** | ||
| * Header Alerts | ||
| */ | ||
| const [isAlertFlyoutVisible, setIsAlertFlyoutVisible] = useState(false); | ||
| const headerAlerts = ( | ||
| <EuiPortal> | ||
| <EuiFlyout | ||
| onClose={() => setIsAlertFlyoutVisible(false)} | ||
| size="s" | ||
| id={guideHeaderAlertFlyoutId} | ||
| aria-labelledby={guideHeaderAlertFlyoutTitleId} | ||
| includeFixedHeadersInFocusTrap={true} | ||
| > | ||
| <EuiFlyoutHeader hasBorder> | ||
| <EuiTitle size="s"> | ||
| <h2 id={guideHeaderAlertFlyoutTitleId}>EuiHeaderAlert</h2> | ||
| </EuiTitle> | ||
| </EuiFlyoutHeader> | ||
| <EuiFlyoutBody> | ||
| <EuiText size="s" color="subdued"> | ||
| <p> | ||
| Please see the component page for{' '} | ||
| <Link to="/layout/header"> | ||
| <strong>EuiHeaderAlert</strong> | ||
| </Link>{' '} | ||
| on how to configure your alerts. | ||
| </p> | ||
| </EuiText> | ||
| </EuiFlyoutBody> | ||
| </EuiFlyout> | ||
| </EuiPortal> | ||
| ); | ||
|
|
||
| /** | ||
| * User Menu | ||
| */ | ||
| const [isUserMenuVisible, setIsUserMenuVisible] = useState(false); | ||
| const userMenu = ( | ||
| <EuiPopover | ||
| id={guideHeaderUserPopoverId} | ||
| repositionOnScroll | ||
| button={ | ||
| <EuiHeaderSectionItemButton | ||
| aria-controls={guideHeaderUserPopoverId} | ||
| aria-expanded={isUserMenuVisible} | ||
| aria-haspopup="true" | ||
| aria-label="User menu" | ||
| onClick={() => setIsUserMenuVisible(!isUserMenuVisible)} | ||
| > | ||
| <EuiAvatar name="John Username" size="s" /> | ||
| </EuiHeaderSectionItemButton> | ||
| } | ||
| isOpen={isUserMenuVisible} | ||
| anchorPosition="downRight" | ||
| closePopover={() => setIsUserMenuVisible(false)} | ||
| > | ||
| <div style={{ width: 320 }}> | ||
| <EuiText size="s" color="subdued"> | ||
| <p> | ||
| Please see the component page for{' '} | ||
| <Link to="/layout/header"> | ||
| <strong>EuiHeader</strong> | ||
| </Link>{' '} | ||
| on how to configure your user menu. | ||
| </p> | ||
| </EuiText> | ||
| </div> | ||
| </EuiPopover> | ||
| ); | ||
|
|
||
| /** | ||
| * Spaces Menu | ||
| */ | ||
| const [isSpacesMenuVisible, setIsSpacesMenuVisible] = useState(false); | ||
| const spacesMenu = ( | ||
| <EuiPopover | ||
| id={guideHeaderSpacesPopoverId} | ||
| repositionOnScroll | ||
| button={ | ||
| <EuiHeaderSectionItemButton | ||
| aria-controls={guideHeaderSpacesPopoverId} | ||
| aria-expanded={isSpacesMenuVisible} | ||
| aria-haspopup="true" | ||
| aria-label="Spaces menu" | ||
| onClick={() => setIsSpacesMenuVisible(!isSpacesMenuVisible)} | ||
| > | ||
| <EuiAvatar type="space" name="Default Space" size="s" /> | ||
| </EuiHeaderSectionItemButton> | ||
| } | ||
| isOpen={isSpacesMenuVisible} | ||
| anchorPosition="downRight" | ||
| closePopover={() => setIsSpacesMenuVisible(false)} | ||
| > | ||
| <div style={{ width: 320 }}> | ||
| <EuiText size="s" color="subdued"> | ||
| <p> | ||
| Please see the component page for{' '} | ||
| <Link to="/layout/header"> | ||
| <strong>EuiHeader</strong> | ||
| </Link>{' '} | ||
| on how to configure your spaces menu. | ||
| </p> | ||
| </EuiText> | ||
| </div> | ||
| </EuiPopover> | ||
| ); | ||
|
|
||
| /** | ||
| * Sitewide search | ||
| */ | ||
| const search = ( | ||
| <EuiSelectableTemplateSitewide | ||
| options={[]} | ||
| searchProps={{ | ||
| append: '⌘K', | ||
| compressed: true, | ||
| }} | ||
| popoverButton={ | ||
| <EuiHeaderSectionItemButton aria-label="Sitewide search"> | ||
| <EuiIcon type="search" size="m" /> | ||
| </EuiHeaderSectionItemButton> | ||
| } | ||
| popoverButtonBreakpoints={['xs', 's']} | ||
| popoverProps={{ | ||
| repositionOnScroll: true, // Necessary when placing search in a fixed component | ||
| }} | ||
| emptyMessage={ | ||
| <EuiSelectableMessage style={{ minHeight: 300 }}> | ||
| <p> | ||
| Please see the component page for{' '} | ||
| <Link to="/forms/selectable"> | ||
| <strong>EuiSelectableTemplateSitewide</strong> | ||
| </Link>{' '} | ||
| on how to configure your sitewide search. | ||
| </p> | ||
| </EuiSelectableMessage> | ||
| } | ||
| /> | ||
| ); | ||
|
|
||
| const logo = <EuiHeaderLogo iconType="logoElastic" href="" />; | ||
|
|
||
| return ( | ||
| <> | ||
| {/* <EuiHeader | ||
| theme="dark" | ||
| position="fixed" | ||
| sections={[ | ||
| { | ||
| items: [ | ||
| <EuiHeaderLogo iconType="logoElastic" href=""> | ||
| Elastic | ||
| </EuiHeaderLogo>, | ||
| deploymentMenu, | ||
| ], | ||
| }, | ||
| { | ||
| items: [<EuiShowFor sizes={['m', 'l', 'xl']}>{search}</EuiShowFor>], | ||
| }, | ||
| ]} | ||
| /> */} | ||
| <EuiHeader | ||
| position="fixed" | ||
| sections={[ | ||
| { | ||
| items: [collapsibleNav, logo, spacesMenu], | ||
| breadcrumbs: [ | ||
| { | ||
| text: 'Management 1', | ||
| onClick: () => {}, | ||
| }, | ||
| { | ||
| text: 'Users 2', | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| items: [ | ||
| <EuiHeaderLinks | ||
| popoverProps={{ | ||
| repositionOnScroll: true, // Necessary when placing search in a fixed component | ||
| }} | ||
| > | ||
| <EuiHeaderLink color="primary">Share</EuiHeaderLink> | ||
| <EuiHeaderLink color="primary">Clone</EuiHeaderLink> | ||
| <ExampleContext.Consumer> | ||
| {({ parentPath }: { parentPath: string }) => ( | ||
| <EuiButton | ||
| iconType="exit" | ||
| style={{ minWidth: 80 }} | ||
| size="s" | ||
| color="primary" | ||
| href={`#${parentPath}`} | ||
| > | ||
| Exit fullscreen | ||
| </EuiButton> | ||
| )} | ||
| </ExampleContext.Consumer> | ||
| </EuiHeaderLinks>, | ||
| ], | ||
| }, | ||
| { | ||
| items: [ | ||
| <EuiShowFor sizes={['xs', 's']}>{search}</EuiShowFor>, | ||
| <EuiHeaderSectionItemButton | ||
| notification={true} | ||
| aria-label="Notifications: Updates available" | ||
| onClick={() => setIsAlertFlyoutVisible(!isAlertFlyoutVisible)} | ||
| > | ||
| <EuiIcon type="cheer" size="m" /> | ||
| </EuiHeaderSectionItemButton>, | ||
| userMenu, | ||
| ], | ||
| }, | ||
| ]} | ||
| /> | ||
|
|
||
| {isAlertFlyoutVisible ? headerAlerts : null} | ||
| </> | ||
| ); | ||
| }; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.