Skip to content

[Page Templates Feature] Added EuiPageSection and updated EuiPage & EuiPageBody padding defaults#5769

Merged
cchaos merged 23 commits intoelastic:feature/page_templatesfrom
cchaos:page_templates_feature/page_section
Apr 20, 2022
Merged

[Page Templates Feature] Added EuiPageSection and updated EuiPage & EuiPageBody padding defaults#5769
cchaos merged 23 commits intoelastic:feature/page_templatesfrom
cchaos:page_templates_feature/page_section

Conversation

@cchaos
Copy link
Copy Markdown
Contributor

@cchaos cchaos commented Apr 6, 2022

This PR's specific commits starts at: cd2c512
The EuiPageTemplate are slightly broken at this point, don't look there yet 🙈

[Breaking] Changed default padding of EuiPage from m to none

  • And removed nested page header styles when within EuiPageBody (improved way of doing this coming later)

[NEW] EuiPageSection to replace EuiPageContent & EuiPageContentBody

This component handles all the restrictWidth and border options for page sections to ensure proper extension of the border.

Screen Shot 2022-04-10 at 23 50 20 PM

Deprecated EuiPageContent & EuiPageContentBody

Screen Shot 2022-04-11 at 00 31 24 AM

[NEW] Added euiPaddingStyles and euiBackgroundColorStyles global styling functions

I've added these new helpers in an attempt to consolidate any component's usage of padding or background colors to use a single global style option. Right now these require passing in the EuiTheme, but once #5754 merges, we'll have an easy way to create a hook version too. (That's also when we'll publicly document it).

Basic usage:

const inlinePadding = euiPaddingStyles(useTheme, 'inline');
const blockPadding = euiPaddingStyles(useTheme, 'block');
const colors = euiBackgroundColorStyles(useTheme);

Docs

  • Updated Page section to include page body and sidebar descriptions
  • Added a section for new Page sections
  • Added a section about complex configurations of page components

Checklist

  • Checked in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs and playground toggles
  • Added documentation
  • Checked Code Sandbox works for any docs examples
  • Added or updated jest and cypress tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • Updated the Figma library counterpart
  • A changelog entry exists and is marked appropriately

cchaos and others added 15 commits February 15, 2022 17:33
Setup pattern for demo toggles
…tes/page_docs_toggles

# Conflicts:
#	scripts/a11y-testing.js
#	src-docs/src/views/page/page_template_example.js
#	src-docs/src/views/panel/panel_example.js
…eature_page_templates/page_docs_toggles

# Conflicts:
#	scripts/a11y-testing.js
#	src-docs/src/views/page/page_template_example.js
#	src-docs/src/views/panel/panel_example.js
- Removed nested page header styles when within EuiPageBody (improved way of doing this coming later)
…ugh custom controls

Update EuiPage’s example usage to use GuideSection directly
# Conflicts:
#	src-docs/src/views/page/page_example.js
and added EuiPageSidebar description to first example
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5769/

@cchaos cchaos added the deprecations PRs that contains deprecations. Add them to the deprecations meta ticket after merge. label Apr 11, 2022
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5769/

@cchaos cchaos marked this pull request as ready for review April 12, 2022 03:02
@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Apr 12, 2022

This feature branch PR is ready for review!

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5769/

Copy link
Copy Markdown
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉

Tested in Chrome, Safari, Edge, and Firefox. Found some small issues but nothing that prevents it from merging.

@elizabetdev
Copy link
Copy Markdown
Contributor

elizabetdev commented Apr 14, 2022

@cchaos I just noticed that because we're now using the EuiPageSection in src-docs/src/components/guide_page/guide_page.js and src-docs/src/components/guide_tabbed_page/guide_tabbed_page.tsx the CI is failing with:
page must have one main landmark.

Should the EuiPageBody be by default <main role="main" /> instead of a div?

@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Apr 20, 2022

Thanks @miukimiu ! I've addressed your comments. As for the role issue, I'm trying to decide whether we require each EuiPageSection to contain a role attribute or make EuiPageHeader actually render a div by default with the ability to change the role. For now I've added role="main" to the docs' EuiPageBody and removed the docs' EuiPageHeader's role with role="none" since you can't have nested roles.

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5769/

@cchaos cchaos merged commit 229fc99 into elastic:feature/page_templates Apr 20, 2022
@cchaos cchaos deleted the page_templates_feature/page_section branch April 20, 2022 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecations PRs that contains deprecations. Add them to the deprecations meta ticket after merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants