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

[EuiProvider] Add new componentDefaults configuration #6995

Merged
merged 9 commits into from
Aug 4, 2023

Conversation

cee-chen
Copy link
Contributor

@cee-chen cee-chen commented Jul 25, 2023

Summary

This feature branch merges into main the following already-reviewed PRs:

As a reminder, the new <EuiProvider componentDefaults> API is in beta, and is currently only releasing with a limited number of supported components initially to test out usage and developer experience. In the future, EUI would potentially be open to either accepting specific requests for configurable component defaults, or (very pie in the sky) configuring all props across all EUI components to accept custom consumer defaults.

QA

In theory this work should already be thoroughly QA'd by each preceding branch, but feel free to do a quick final pass/read through of https://eui.elastic.co/pr_6995/#/utilities/provider#component-defaults to ensure our documentation of this new prop is understandable.

General checklist

- [ ] A changelog entry exists and is marked appropriately N/A - each preceding feature branch PR should have added its own changelog

@kibanamachine
Copy link

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

@cee-chen cee-chen force-pushed the feature/provider/component-defaults branch from e76c8da to 1a3a35e Compare July 25, 2023 23:32
@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@cee-chen cee-chen force-pushed the feature/provider/component-defaults branch from 1a3a35e to 92f1d8b Compare July 26, 2023 01:19
@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@cee-chen cee-chen force-pushed the feature/provider/component-defaults branch from 92f1d8b to 839b68d Compare August 1, 2023 18:50
@kibanamachine
Copy link

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

1 similar comment
@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@cee-chen cee-chen force-pushed the feature/provider/component-defaults branch from 839b68d to 8f11a68 Compare August 1, 2023 19:53
@kibanamachine
Copy link

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

1 similar comment
@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@cee-chen
Copy link
Contributor Author

cee-chen commented Aug 1, 2023

buildkite test this

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

cee-chen and others added 8 commits August 3, 2023 14:51
…on (#6923)

* Set up `EuiComponentDefaultsProvider`

+ light tests - actual defaults/override tests should be written per-component

* Add documentation

* Add support for beta/new badges to subitems in nav and subheadings

* changelog
…ponentDefaults` (#6941)

* [EuiPortal] Add global settings for Portal-Based Components

* changelog

* Remove `PortalProvider` usage in favor of `EuiComponentDefaultsProvider`

Update EuiPortal component

- update class naming to match other instances in EUI for consistency (e.g. EuiAccordionClass)

- update function component typing and syntax

- minor object spread syntax nit

* Add EuiPortal tests for provided `insert` behavior

- has to be Cypress, as our current version of jest/jsdom does not support `insertAdjacentElement`

+ clarify in comments of the new provider test how individual component tests should be handled

* changelog

* Clean up types

- not super necessary to have a separate file for it, these types are only used within EuiPortal

- use `as const` array and typeof instead of `keyof`

- simplify insert positions map typing

---------

Co-authored-by: y1j2x34 <y1j2x34@qq.com>
…d via `EuiProvider.componentDefaults` (#6942)

* [cleanup] Fix EuiFocusTrap's props / props table

- it's kind of a dumpster fire right now with many props not being picked up so I'm wholesale rearranging many things

- storybook props/controls also throws its own special brand of fun into this

* [cleanup] Update existing Storybook stories to account for new props controls

- we can remove the specified `crossFrame` arg now that it actually exists as a prop

- default `returnFocus` to a boolean, since it can also take a function

- add an `onDeactivation` state update (useful when testing `clickOutsideDisables=true`)

* [cleanup] Remove skipped focus trap Jest tests

- these were already converted to Cypress tests, so there's no point / no need to keep them

* [cleanup] Convert Jest tests to RTL

+ add a `shouldRenderCustomStyles` to confirm that react-focus-on accepts className/css/style props

* Configure `EuiFocusTrap` to accept component defaults

* Add Cypress test for `gapMode`

* Add Storybook story for `crossFrame` & misc EuiProvider QA

* changelog
…rovider.componentProps` (#6951)

Co-authored-by: Tomasz Kajtoch <tomasz.kajtoch@elastic.co>
@cee-chen cee-chen force-pushed the feature/provider/component-defaults branch from 6acdd1d to 72c7e0b Compare August 3, 2023 21:51
@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@cee-chen cee-chen marked this pull request as ready for review August 3, 2023 22:53
@cee-chen cee-chen requested a review from tkajtoch August 3, 2023 22:54
Copy link
Member

@tkajtoch tkajtoch left a comment

Choose a reason for hiding this comment

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

I've gone through all commits again to make sure I didn't miss anything before. The changes look great!

Co-authored-by: Tomasz Kajtoch <tomek@kajto.ch>
@cee-chen
Copy link
Contributor Author

cee-chen commented Aug 4, 2023

Thanks a million Tomasz! Based on the comments on that keep coming in elastic/kibana#56406, people will really be happy about this in Kibana! :)

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@cee-chen cee-chen merged commit e9f4483 into main Aug 4, 2023
@cee-chen cee-chen deleted the feature/provider/component-defaults branch August 4, 2023 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants