Skip to content
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

[Page Layouts] Created EuiPageTemplate to facilitate the new design patterns for page layouts #4525

Merged
merged 70 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
a9e1478
New docs layout
Feb 6, 2021
324d857
Cleanup
Feb 6, 2021
d27f0ec
Updating homepage blockforms
Feb 7, 2021
926613e
Cleanup homepage
Feb 7, 2021
d504194
Som more cleanup and fixing of mobile styles
Feb 7, 2021
eaff2bf
Fix page layout
Feb 8, 2021
ee3dc9e
Fix locale selector
Feb 8, 2021
cb67e0a
Fixed theme selector
Feb 8, 2021
9e71f21
Fix autoscrolls
Feb 8, 2021
290bd97
Fixing overflows and in turn stickies
Feb 10, 2021
7b16459
Move babelfish and fix overflowing page content (again)
Feb 11, 2021
744f870
Some cleanup of spacing
Feb 11, 2021
e684b89
Som initial cleanup of the docs stuff
Feb 11, 2021
d5c31cb
Making design library links based on current theme
Feb 11, 2021
1bcd9e0
Made codesandbox import the current themes css
Feb 11, 2021
0583737
Initial setups with doc examples started
Feb 11, 2021
2e41b1f
Added `grow` prop to EuiPage and created helper for the restrictedWid…
Feb 11, 2021
d16a490
Added `sticky` and `grow` props to EuiPageSideBar
Feb 12, 2021
c42d2c3
Subdue figma link notification
Feb 12, 2021
a6f26a9
No more `grow`
Feb 12, 2021
202eee0
Added `direction` prop to EuiPage
Feb 12, 2021
add779d
Added `paddingSize` and restricted width helper to EuiPageContentBody
Feb 12, 2021
6b00ac5
WIP: Docs
Feb 12, 2021
ac3c7df
Using restrictedWidth helper on EuiPageBody
Feb 12, 2021
2d63933
Added `panelled` and `panelProps` to EuiPageBody
Feb 12, 2021
3295b3f
Fixing up all the examples
Feb 13, 2021
69d07ec
Added EuiPageTemplate component
Feb 13, 2021
b0791b3
Playground
Feb 13, 2021
dd50cac
Propagating paddingSize throughout
Feb 13, 2021
8741cc3
Allowing customization of demo tab displayNames
Feb 14, 2021
8a1c383
Allowing custom code tabs in guide section
Feb 14, 2021
4c7e589
Moved page header docs to it’s own page
Feb 14, 2021
f630325
Cleaning up the demos
Feb 14, 2021
cd3f059
Fixing tabsAtBottom, header z-index, and other full screen docs
Feb 15, 2021
eee6492
Merge remote-tracking branch 'upstream/master' into new/page_layout
Feb 15, 2021
516ca49
Undo dts
Feb 15, 2021
9f399dd
Still trying to fix tabsAtBottom but think some things need to move t…
Feb 15, 2021
6200a5e
Extending EuiButtonEmpty in EuiHeaderSectionItemButton for ease of us…
Feb 15, 2021
6e97d6c
Fixing up some docs stuff
Feb 15, 2021
f00607d
Remove `layout/page` page from a11y testing because of duplicate `<ma…
Feb 15, 2021
8604662
A11y fix for home page
Feb 16, 2021
711e77e
Added `empty` type of template
Feb 16, 2021
97e0c7d
Cleaning up EuiSideBar styles and relativity to EuiPage
Feb 16, 2021
ba6b426
Changed EuiPageRestrictWidth to the internal format of _EuiPageRestri…
Feb 16, 2021
e861be2
Fixed EuiPageBody padding classes
Feb 16, 2021
b3b991f
Fixing up all the EuiPageHeader padding/margin logic
Feb 16, 2021
31da224
Fixing full screen demos
Feb 17, 2021
fe600cd
Move header breadcrumb truncation fix to the base breadcrumb component
Feb 17, 2021
02f7e89
Removing `:hover` states of EuiHeaderSectionItemButtons to align with…
Feb 17, 2021
3c3a623
Cleanup
Feb 17, 2021
324159b
Merge remote-tracking branch 'upstream/master' into new/page_layout
Feb 18, 2021
2d36c0c
Update snap
Feb 18, 2021
59e6696
Updating borders of EuiPageContent
Feb 18, 2021
e49ecfd
Updated borders of EuiPageBody
Feb 18, 2021
b8c027e
Playground and last border fix
Feb 18, 2021
8391d27
Merge remote-tracking branch 'upstream/master' into new/page_layout
Feb 22, 2021
96673fd
A couple quick docs fixes
Feb 22, 2021
a762d4a
Fixing typos
cchaos Feb 22, 2021
49c7e3c
More docs fixes and updates EuiPageHeader.tabs.label prop from `strin…
Feb 22, 2021
160d47d
pretty
Feb 22, 2021
8be464c
Fixing different browsers
Feb 23, 2021
1f7b3c5
Fix codesandbox link to pass the right code of custom tabs
Feb 23, 2021
9c81ffc
cl
Feb 23, 2021
0ff0cb3
Removing `.guideSection__shadedBox` in favor of EuiPanel.subdued
Feb 23, 2021
0c477d1
Fix TS type and remove outdated playground
Feb 25, 2021
58a5847
Merge remote-tracking branch 'upstream/master' into new/page_layout
Feb 25, 2021
f861214
cl
Feb 25, 2021
28d0235
cl
Feb 25, 2021
a195cc4
force
Feb 25, 2021
7372654
cl
Feb 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,27 @@
- Fixed the return type of `getDefaultEuiMarkdownUiPlugins` ([#4567](https://github.com/elastic/eui/pull/4567))
- Fixed inverse handling of boolean sorting in `EuiDataGrid` ([#4561](https://github.com/elastic/eui/pull/4561))

## Feature: EuiPageTemplate ([#4517](https://github.com/elastic/eui/pull/4517))

- Added new `EuiPageTemplate` component as a shortcut for creating the different types of page layout patterns
- Added props `grow` and `direction` to `EuiPage`
- Added props `panelled`, `panelProps`, and `paddingSize` to `EuiPageBody`
- Added props `restrictWidth` and `paddingSize` to `EuiPageBody`
- Added prop `paddingSize` to `EuiPageHeader`
- Updated `tabs` prop of `EuiPageHeaderContent` to render `large` size
- Added prop `sticky` to `EuiPageSideBar`
- Added Sass variable `$euiPageSidebarMinWidth` for changing default `min-width` of `EuiPageSideBar`
- Added `href` and other anchor props to `EuiHeaderSectionItemButton`

**Bug fixes**

- Fixed horizontal overflow of `EuiPageContent`
- Fixed horizontal overflow of `EuiBreadcrumbs`

## [`31.8.0`](https://github.com/elastic/eui/tree/v31.8.0)

- Reverted part of [#4509](https://github.com/elastic/eui/pull/4509) and returned `EuiDataGrid`'s background content area to an empty shade ([#4542](https://github.com/elastic/eui/pull/4542))
- Added exports for all EUI component props matching `EuiComponentProps` name pattern. ([#4517](https://github.com/elastic/eui/pull/4517))
- Added exports for all EUI component props matching `EuiComponentProps` name pattern ([#4517](https://github.com/elastic/eui/pull/4517))
- Added `truncate`, `disabled`, and `emphasize` props to `EuiSideNavItem` ([#4488](https://github.com/elastic/eui/pull/4488))
- Added `truncate` prop to `EuiSideNav` ([#4488](https://github.com/elastic/eui/pull/4488))
- Added support for all `color`s of `EuiPanel` ([#4504](https://github.com/elastic/eui/pull/4504))
Expand All @@ -37,7 +54,7 @@

## [`31.7.0`](https://github.com/elastic/eui/tree/v31.7.0)

- Added `whiteSpace` prop to `EuiCodeBlock`. ([#4475](https://github.com/elastic/eui/pull/4475))
- Added `whiteSpace` prop to `EuiCodeBlock` ([#4475](https://github.com/elastic/eui/pull/4475))
- Added a light background to `EuiDataGrid` and removed unnecessary height on its container ([#4509](https://github.com/elastic/eui/pull/4509))

**Bug fixes**
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="favicon.ico"></head><body class="guideBody"><div id="guide" style="height: 100%"></div><script src="bundle.min.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="favicon.ico"></head><body class="guideBody"><div id="guide"></div><script src="bundle.min.js"></script></body></html>
1 change: 1 addition & 0 deletions scripts/a11y-testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const { AxePuppeteer } = require('@axe-core/puppeteer');
const docsPages = async (root, page) => {
const pagesToSkip = [
`${root}#/layout/resizable-container`,
`${root}#/layout/page`, // Has duplicate `<main>` element
myasonik marked this conversation as resolved.
Show resolved Hide resolved
`${root}#/tabular-content/tables`,
`${root}#/tabular-content/in-memory-tables`,
`${root}#/display/aspect-ratio`,
Expand Down
45 changes: 34 additions & 11 deletions src-docs/src/components/codesandbox/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
listExtraDeps,
} from '../../services';

import { EuiSpacer } from '../../../../src/components';

const pkg = require('../../../../package.json');

const getVersion = (packageName) => {
Expand All @@ -28,19 +26,48 @@ const getVersion = (packageName) => {
* 5. Through regex we read the dependencies of both `content` and `display_toggles` and pass that to CS.
* 6. We pass the files and dependencies as params to CS through a POST call.
* */
import { ThemeContext } from '../with_theme';

const displayTogglesRawCode = require('!!raw-loader!../../views/form_controls/display_toggles')
.default;

export const CodeSandboxLink = ({ ...rest }) => {
return (
<ThemeContext.Consumer>
{(context) => <CodeSandboxLinkComponent context={context} {...rest} />}
</ThemeContext.Consumer>
);
};

/* 1 */
export const CodeSandboxLink = ({ children, content }) => {
export const CodeSandboxLinkComponent = ({
children,
className,
content,
context,
}) => {
let cssFile;
switch (context.theme) {
case 'amsterdam-light':
cssFile = '@elastic/eui/dist/eui_theme_amsterdam_light.css';
break;
case 'amsterdam-dark':
cssFile = '@elastic/eui/dist/eui_theme_amsterdam_dark.css';
break;
case 'dark':
cssFile = '@elastic/eui/dist/eui_theme_dark.css';
break;
default:
cssFile = '@elastic/eui/dist/eui_theme_light.css';
break;
}

let indexContent;

if (!content) {
/* 2 */
indexContent = `import ReactDOM from 'react-dom';
import '@elastic/eui/dist/eui_theme_light.css'
// import '@elastic/eui/dist/eui_theme_dark.css'
import '${cssFile}';
import React from 'react';

import {
Expand Down Expand Up @@ -82,8 +109,7 @@ ReactDOM.render(
// The Code Sanbbox demo needs to import CSS at the top of the document. CS has trouble
// with our dynamic imports so we need to warn the user for now
const exampleStart = `import ReactDOM from 'react-dom';
// import '@elastic/eui/dist/eui_theme_dark.css';
import '@elastic/eui/dist/eui_theme_light.css'`;
import '${cssFile}';`;

// Concat the three pieces of the example into a single string to use for index.js
const cleanedContent = `${exampleStart}
Expand Down Expand Up @@ -155,13 +181,10 @@ ${exampleClose}
action="https://codesandbox.io/api/v1/sandboxes/define"
method="POST"
target="_blank"
className="eui-textRight">
className={className}>
{/* 6 */}
<input type="hidden" name="parameters" value={params} />

<EuiSpacer size="s" />
{childWithSubmit}
<EuiSpacer size="s" />
</form>
);
};
164 changes: 71 additions & 93 deletions src-docs/src/components/guide_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,36 @@
$guideSideNavWidth: 240px;
$guideZLevelHighest: $euiZLevel9 + 1000;

.guideBody {
background: linear-gradient(90deg, $euiPageBackgroundColor 50%, $euiColorEmptyShade 50%);

&--overflowHidden {
overflow: hidden;
}
#guide { // sass-lint:disable-line no-ids
display: flex;
flex-direction: column;
min-height: calc(100vh - #{$euiHeaderHeightCompensation});
}

@include euiHeaderAffordForFixed;

.euiBody--headerIsFixed {
.guideSideNav {
top: $euiHeaderHeightCompensation;
}
}

.euiBody--headerIsFixed--double {
@include euiHeaderAffordForFixed($euiHeaderHeightCompensation * 2);

.guideSideNav {
top: $euiHeaderHeightCompensation * 2;
}

.euiHeader:not(.euiHeader--fixed) {
// Force headers below the full screen.
// This shouldn't be necessary in consuming applications because headers should always be at the top of the page
z-index: 0;
}
}

.guidePage {
padding: 0;
}

.guideSideNav {
width: $guideSideNavWidth;
position: fixed;
top: 0;
bottom: 0;

.guideSideNav__identity {
border-bottom: $euiBorderThin;
padding: $euiSize;
}

.guideSideNav__theme {
font-size: $euiFontSizeS;
color: $euiColorDarkShade;
}
min-width: $guideSideNavWidth;
}

.guideSideNav__content {
@include euiScrollBar;
.guideSideNav__content {
@include euiYScroll;
padding: 0 $euiSizeL $euiSizeL;
}

width: $guideSideNavWidth;
padding: $euiSize;
position: absolute;
bottom: 0;
top: 132px;
overflow-y: auto;
}
.guideSideNav__search {
flex-shrink: 0;
padding: $euiSizeL;
}

.guideSideNav__item {
Expand Down Expand Up @@ -90,31 +60,36 @@ $guideZLevelHighest: $euiZLevel9 + 1000;
color: $euiColorDarkShade;
}

.guidePageContent {
flex: 1 1 auto;
padding: $euiSize $euiSizeXL;
min-height: 100vh;
background-color: $euiColorEmptyShade;
border-left: $euiBorderThin;
max-width: $euiPageDefaultMaxWidth;
margin-left: 240px;
.guideDemo__highlightLayout,
.guideDemo__highlightLayout--playground,
.guideDemo__highlightLayout--legacy {
border: 1px solid transparentize($euiColorPrimary, .9);
overflow: hidden;
height: 460px;
display: flex;

.euiPageSideBar--sticky {
top: 0;
}
}

.guideDemo__highlightLayout {
.euiPageBody {
min-height: 460px;
.guideDemo__highlightLayout--playground > div:not(.euiPage) {
height: 100%;
width: 100%;
padding: 0 !important; // sass-lint:disable-line no-important

> .euiPage--grow {
height: 100%;
}
}

.guideDemo__highlightLayout--legacy {
> div,
> div > div {
background: transparentize($euiColorPrimary, .9);
}
}

.guideDemo__highlightLayout--single {
background: transparentize($euiColorPrimary, .9);
}

.guideDemo__highlightSpacer {
.euiSpacer {
background: transparentize($euiColorPrimary, .9);
Expand All @@ -124,14 +99,14 @@ $guideZLevelHighest: $euiZLevel9 + 1000;
.guideDemo__highlightGrid {
.euiFlexItem {
background: transparentize($euiColorPrimary, .9);
padding: 16px;
padding: $euiSize;
}
}

.guideDemo__highlightGridWrap {
.euiFlexItem div {
background: transparentize($euiColorPrimary, .9);
padding: 16px;
padding: $euiSize;
}
}

Expand Down Expand Up @@ -239,6 +214,25 @@ $guideZLevelHighest: $euiZLevel9 + 1000;
height: 100%;
left: 0;
top: 0;
z-index: $euiZHeader + 1;
overflow: auto;

&--withHeader {
top: $euiHeaderHeightCompensation;
bottom: 0;
height: auto;
z-index: $euiZHeader - 1;
display: flex;
flex-direction: column;

.euiPageSideBar--sticky {
top: 0;
}
}
}

.guideBody--overflowHidden {
overflow: hidden;
}

.euiDataGridRowCell--favoriteFranchise {
Expand All @@ -264,46 +258,30 @@ $guideZLevelHighest: $euiZLevel9 + 1000;
@import 'guide_rule/index';

@include euiBreakpoint('xs', 's') {
.guidePage {
display: block; // Fixes IE
.guideSideNav {
width: 100%;
}

.guideBody {
background: none;
.guideSideNav__content {
padding: 0;
border-top: $euiBorderThin;
}
}

.guideSideNav {
position: static;
width: auto;

// This is a temporary hack till we fix how classes pass into form controls
.euiFormControlLayout,
input[type='search'] {
max-width: 100%;
}

.guideSideNav__content {
position: relative;
width: auto;
top: auto;
bottom: auto;
padding: 0;
overflow-y: hidden;
}
.guideHomePage__blockformCard {
min-width: 200px;
flex-basis: 100% !important;

.guideSideNav__identity {
position: relative;
width: auto;
}
// sass-lint:disable-block mixins-before-declarations
@include euiBreakpoint('s', 'm') {
flex-basis: 45% !important; // sass-lint:disable-line no-important
}

.guideSideNav__mobileToggle {
background: $euiColorPrimary;
color: $euiColorEmptyShade !important;
}
@include euiBreakpoint('l') {
flex-basis: 30% !important; // sass-lint:disable-line no-important
}

.guidePageContent {
margin-left: 0;
width: 100%;
@include euiBreakpoint('xl') {
flex-basis: 22% !important; // sass-lint:disable-line no-important
cchaos marked this conversation as resolved.
Show resolved Hide resolved
}
}
8 changes: 0 additions & 8 deletions src-docs/src/components/guide_components_amsterdam.scss

This file was deleted.

Loading