-
Notifications
You must be signed in to change notification settings - Fork 841
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
[Feature] EuiPage and EuiPageTemplate Updates #5768
Conversation
…5625) * [Docs] Create new section for “Templates” - Moves Page Template, SuperDatePicker, and Searchable Sitewide Template - Stubs in placeholder page for in lower level page components - Fixes routes
# Conflicts: # scripts/a11y-testing.js # src-docs/src/views/page/page_example.js
* Added `exampleToggles` to GuideSectionExample for easily passing through custom controls
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
…uiPageBody padding defaults (#5769) * Removed nested page header styles when within EuiPageBody (improved way of doing this coming later) * [NEW] EuiPageSection to replace EuiPageContent & EuiPageContentBody * Added `exampleToggles` to GuideSectionExample for easily passing through custom controls * Added `euiPaddingStyles` and `euiBackgroundColorStyles` global styling functions * Added deprecation comments to EuiPageContent and EuiPageContentBody
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
This gets the className output to render the key name. Same with `useEuiBackgroundColorCSS`. Also fixed usage in `EuiPageSection`. Also fixed docs `exampleToggles` pass through from GuideSection to example
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
…gm as EuiPageSection (#5857) * [EuiPageHeader] Refactoring to support same `bottomBorder`, `restrictWidth` and `paddingSize` props as EuiPageSection * Converted EuiPageHeaderContent to Emotion * Consolidate more styles including ensuring max-width is applied as `style` tag
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Preview documentation changes for this PR: https://eui.elastic.co/pr_5768/ |
Justification for new template structure
While implementing the original EuiPageTemplate in Kibana, we realized that it is very rigid and doesn't allow for certain configurations like:
This new template is based on React context to pass through unified props like
paddingSize
andrestrictWidth
while still be configurable at every level. It also removes the necessity to provide page header contents through props. It is also built as a namespaced component and therefore the context will only be passed to those that are namespaced in case of complete custom layouts.The best way to justify is to showcase the new capabilities. Take the following layout which couldn't be achieved by the previous version of EuiPageTemplate and would need to be completely custom contents that would then no longer be tied to cascading props:
Now you can easily achieve this with the following setup:
Based solely on the presence of a fixed EuiHeader, the template will also ensure the layout affords for this offset without needing to apply custom styles and use of a Sass mixin.
More example conversions to the new EuiPageTemplate
`template = default` with sidebar and a bottom bar
`template = centeredBody`
`template = centeredContent` with sidebar
`template = empty` (no content panelling)
PR Summaries:
exampleToggles
to GuideSectionExample for easily passing through custom controlseuiPaddingStyles
andeuiBackgroundColorStyles
global styling functionsbottomBorder
,restrictWidth
andpaddingSize
props as EuiPageSectionstyle
tag/page
and exportrestrictWidth
styles of EuiPageContentBodyheight
as optional prop to alleuiYScroll
mixinsstyle
main
updatemainProps
to EuiPageTemplate for allowing customization of things likeid
(for skip link)Checklist