[Visual Refresh][EuiSelectableTemplateSitewide] Add theme prop
#8804
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 should be rebased after the second update PR is merged.
Relates to https://github.com/elastic/eui-private/issues/324
Changes
themeprop onEuiSelectableTemplateSitewidethemesupports the providercolorModevalueslight,dark,inverseas well as more genericdefaultandglobal(defaultwill apply the nearest context'scolorModewhileglobalapply the outermost (global) context'scolorMode)EuiHeaderforEuiSelectableTemplateSitewidesearchWhy are we making this change?
Note
TL;DR: Aligning
EuiSelectableTemplateSitewidestyles with new Visual Refresh specs.The Visual Refresh updates for inputs triggered also a change for how the
EuiSelectableTemplateSitewidesearch input should be displayed insideEuiHeader. Previously the input would be displayed as faux-dark theme when non-focused, but displayed as light theme when focused.ℹ️
EuiHeadercurrently implements a visual-only dark mode (docs) when it has istheme="dark". It does not use aEuiThemeProviderto apply color context. Meaning it'stheme="dark"looks like dark mode but is actually still light mode.With the Visual Refresh this changes towards using the expected visual
colorModebased on context: TheEuiHeaderis (visually only) in dark mode therefore the search input should be in dark mode too for any state, using the form element specific scoped styles instead of usage specific overrides inEuiHeader. The search popover however should follow the overall global colorMode (as it did previously).ℹ️ Eventually this should mean that
EuiHeaderuses a context provider to apply proper color modes, but this requires more investigation as it has bigger implications to consider based on Kibana usage (issue)Screenshots
Toggle screenshots
LIGHT mode
DARK mode
Impact to users
QA
EuiSelectableTemplateSitewide:themeverify that all possible values ('light', 'dark', 'inverse', 'default', 'global') can be applied and result in expected outputEuiSelectableTemplateSitewideuses default input styles and matches design specsEuiHeaderstory "Dark Theme with Sitewide Search":General checklist
Checked for accessibility including keyboard-only and screenreader modes@defaultif default values are missing) and playground togglesChecked Code Sandbox works for any docs examplesAdded or updated jest and cypress testsIf applicable, added the breaking change issue label (and filled out the breaking change checklist)If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)