-
Notifications
You must be signed in to change notification settings - Fork 861
[Visual Refresh] Provide hooks for color palette functions #8284
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
mgadewoll
merged 5 commits into
elastic:eui-theme/borealis
from
mgadewoll:eui-theme/palette-hooks
Jan 29, 2025
Merged
[Visual Refresh] Provide hooks for color palette functions #8284
mgadewoll
merged 5 commits into
elastic:eui-theme/borealis
from
mgadewoll:eui-theme/palette-hooks
Jan 29, 2025
Conversation
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
bf18c8e to
069aade
Compare
tkajtoch
approved these changes
Jan 23, 2025
Member
tkajtoch
left a comment
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.
The changes look great! My brain had to adjust to seeing euiPaletteColorBlind-like variable names and not assume it's a function :D
- this fixes some stale palette value outputs that didn't update between theme changes yet
069aade to
f45a7dc
Compare
|
Preview staging links for this PR:
|
Collaborator
💚 Build Succeeded
History
cc @mgadewoll |
mgadewoll
added a commit
that referenced
this pull request
Feb 4, 2025
delanni
pushed a commit
to elastic/kibana
that referenced
this pull request
Feb 13, 2025
`99.1.0-borealis.0` ⏩ `99.2.0-borealis.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) --- ## [`v99.2.0`](https://github.com/elastic/eui/releases/v99.2.0) - Changed `EuiFieldText` styles to prioritize `disabled` styling over `readonly`. ([#8271](elastic/eui#8271)) - Added `plugs` and `web` glyphs to `EuiIcon` ([#8285](elastic/eui#8285)) - Update `title` on `EuiColorPalettePickerPaletteProps` to be optional ([#8289](elastic/eui#8289)) **Bug fixes** - Fixed an issue with EuiDataGrid with auto row height resulting in a table of 0 height ([#8251](elastic/eui#8251)) - Fixed `disabled` behavior of `EuiFieldText` to prevent input changes. ([#8271](elastic/eui#8271)) **Borealis changes** - [Visual Refresh] Provide hooks for color palette functions ([#8284](elastic/eui#8284)) - [Visual Refresh] Make Borealis default theme in EUI ([#8288](elastic/eui#8288)) --- As you can probably tell, there are plenty of updated tests and snapshots this time around. They are the result of the following: 1. We've updated the default theme in `@elastic/eui` v99.2.0 to Borealis, which led to kibana tests using `renderWithTheme`, `mountWithTheme`, and other utility functions that wrap the tested component in `<EuiThemeProvider>` to switch to the correct, new color values. With this change, all tests should now use Borealis, regardless of the testing framework or its configuration. 2. Because of the default theme change in EUI, some class name hash fragments (e.g., `css-`**`wprskz`**`-euiButtonIcon-xs-empty-primary`) regenerated. Most Borealis-related changes in this PR are test env only and have no impact on what users see when using Kibana. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
JoseLuisGJ
added a commit
to JoseLuisGJ/kibana
that referenced
this pull request
Feb 13, 2025
`99.1.0-borealis.0` ⏩ `99.2.0-borealis.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) --- ## [`v99.2.0`](https://github.com/elastic/eui/releases/v99.2.0) - Changed `EuiFieldText` styles to prioritize `disabled` styling over `readonly`. ([elastic#8271](elastic/eui#8271)) - Added `plugs` and `web` glyphs to `EuiIcon` ([elastic#8285](elastic/eui#8285)) - Update `title` on `EuiColorPalettePickerPaletteProps` to be optional ([elastic#8289](elastic/eui#8289)) **Bug fixes** - Fixed an issue with EuiDataGrid with auto row height resulting in a table of 0 height ([elastic#8251](elastic/eui#8251)) - Fixed `disabled` behavior of `EuiFieldText` to prevent input changes. ([elastic#8271](elastic/eui#8271)) **Borealis changes** - [Visual Refresh] Provide hooks for color palette functions ([elastic#8284](elastic/eui#8284)) - [Visual Refresh] Make Borealis default theme in EUI ([elastic#8288](elastic/eui#8288)) --- As you can probably tell, there are plenty of updated tests and snapshots this time around. They are the result of the following: 1. We've updated the default theme in `@elastic/eui` v99.2.0 to Borealis, which led to kibana tests using `renderWithTheme`, `mountWithTheme`, and other utility functions that wrap the tested component in `<EuiThemeProvider>` to switch to the correct, new color values. With this change, all tests should now use Borealis, regardless of the testing framework or its configuration. 2. Because of the default theme change in EUI, some class name hash fragments (e.g., `css-`**`wprskz`**`-euiButtonIcon-xs-empty-primary`) regenerated. Most Borealis-related changes in this PR are test env only and have no impact on what users see when using Kibana. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> ## Summary Summarize your PR. If it involves visual changes include a screenshot or gif. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ...
9 tasks
tkajtoch
added a commit
to tkajtoch/kibana
that referenced
this pull request
Feb 13, 2025
`99.1.0-borealis.0` ⏩ `99.2.0-borealis.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) --- ## [`v99.2.0`](https://github.com/elastic/eui/releases/v99.2.0) - Changed `EuiFieldText` styles to prioritize `disabled` styling over `readonly`. ([elastic#8271](elastic/eui#8271)) - Added `plugs` and `web` glyphs to `EuiIcon` ([elastic#8285](elastic/eui#8285)) - Update `title` on `EuiColorPalettePickerPaletteProps` to be optional ([elastic#8289](elastic/eui#8289)) **Bug fixes** - Fixed an issue with EuiDataGrid with auto row height resulting in a table of 0 height ([elastic#8251](elastic/eui#8251)) - Fixed `disabled` behavior of `EuiFieldText` to prevent input changes. ([elastic#8271](elastic/eui#8271)) **Borealis changes** - [Visual Refresh] Provide hooks for color palette functions ([elastic#8284](elastic/eui#8284)) - [Visual Refresh] Make Borealis default theme in EUI ([elastic#8288](elastic/eui#8288)) --- As you can probably tell, there are plenty of updated tests and snapshots this time around. They are the result of the following: 1. We've updated the default theme in `@elastic/eui` v99.2.0 to Borealis, which led to kibana tests using `renderWithTheme`, `mountWithTheme`, and other utility functions that wrap the tested component in `<EuiThemeProvider>` to switch to the correct, new color values. With this change, all tests should now use Borealis, regardless of the testing framework or its configuration. 2. Because of the default theme change in EUI, some class name hash fragments (e.g., `css-`**`wprskz`**`-euiButtonIcon-xs-empty-primary`) regenerated. Most Borealis-related changes in this PR are test env only and have no impact on what users see when using Kibana. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit e5958a4) # Conflicts: # src/platform/packages/shared/kbn-unified-data-table/src/components/compare_documents/hooks/__snapshots__/use_comparison_css.test.ts.snap # x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/__snapshots__/entry_content.test.tsx.snap # x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/__mocks__/mock.ts
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
skip-changelog
Use on PRs to skip changelog requirement (Don't delete - used for automation)
visual refresh
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.
Summary
Important
This PR merges into a feature branch.
This PR changes the color palette functions to support passing
colorsas argument to enable a more flexible usage outside of a React Context where the EUI default values might not be updated as expected.Additionally this PR adds hooks for the available color palette functions (e.g.
euiPaletteColorBlindandeuiPaletteColorBlindBehindTextandeuiPaletteForStatusetc) for usage in React components.Example added hook:
useEuiPaletteColorBlindThese hooks are mainly a devX addition and they are added to provide a direct input of the theme colors (from the
EuiProviderto the palette functions without having to rely on the temporary middlewareEuiVisColorStorewhich was previously added to support multiple themes in the previously static color palette functions.To ensure vis colors are available for custom usage with palette functions, we also need to ensure to export the vis color definitions object
colorVisfrom the themes.QA
verify updated components update look the same between production and staging
verify docs update on theme changes as expected (showing updated palette colors per theme)