[Emotion] Convert EuiColorPicker#7845
Merged
cee-chen merged 12 commits intoelastic:emotion/color-pickersfrom Jun 25, 2024
Merged
[Emotion] Convert EuiColorPicker#7845cee-chen merged 12 commits intoelastic:emotion/color-pickersfrom
cee-chen merged 12 commits intoelastic:emotion/color-pickersfrom
Conversation
- swap margins to gap instead
- now entirely handled by `EuiFormControlLayout` + remove ignored `icon` prop being passed to EuiFieldText, does nothing if `controlOnly` is passed
- not really worth avoiding the nesting here
- Allows us to remove `margin`s from `EuiHue` - Allows us to remove a bunch of conditional `EuiSpacer`s that didn't account for every possible permutation + remove extra `<div>` wrapper in favor of passing `onKeyDown` events directly to child `EuiHue` and `EuiSaturation` - tweak `EuiHue` to have a single wrapper (to work with flex gap) instead of multiple top level children. DOM shouldn't impact a11y behavior + fix incorrect `compressed` behavior on secondary input display, compressed is always true for that (vs the popover form control)
- remove unnecessary vars and just inline them since they only have 1 usage - remove `.euiColorPicker__swatch-item` - not used anywhere in either EUI or Kibana - remove `.euiColorPicker__swatchSelect` - not used in Kibana and can be replaced with component className instead in EUI
a4a4a5d to
cdee684
Compare
- convert Enzyme to RTL - add `shouldRenderCustomStyles` - update snapshots
e849979 to
27fbfbb
Compare
mgadewoll
approved these changes
Jun 25, 2024
Contributor
mgadewoll
left a comment
There was a problem hiding this comment.
🚢 🐈⬛ Looks great to me, nice cleanups! I didn't see any (unexpected) visual regression 👍
| })); | ||
|
|
||
| const onChange = jest.fn(); | ||
| describe('EuiColorPicker', () => { |
Contributor
There was a problem hiding this comment.
Note for myself: This will conflict with the jest upgrade PR and needs rebasing.
Contributor
Contributor
Author
There was a problem hiding this comment.
Whooaaaaa I only just realized that too!!!! Thank you!!
- make it so user input changes the input (easier to QA/test) and also add an onChange action - allow color/format controls to update the story correctly as expected
- show secondary input automatically if `mode` is set that way - remove double form control layout wrapper - fix clear icon not correctly stacking with invalid icon (needs to be passed to form control layout) - allow compressed state of input to be controlled when `display` is inline, otherwise default to compressed
Contributor
Author
|
I did a quick second pass on Storybook in more browsers and noticed a few friction points in the controls that I pushed up changes for. I think they're pretty minor so going to go ahead and merge, but let me know if you have any comments and I can open up a follow-up PR! |
|
Preview staging links for this PR:
|
Collaborator
💚 Build Succeeded
History
|
20 tasks
cee-chen
added a commit
that referenced
this pull request
Jun 26, 2024
22 tasks
tkajtoch
added a commit
to elastic/kibana
that referenced
this pull request
Jul 13, 2024
`v95.2.0`⏩`v95.3.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)_ --- ## [`v95.3.0`](https://github.com/elastic/eui/releases/v95.3.0) - Updated `EuiThemeProvider`s to allow modifying/setting custom `breakpoint`s in nested usage (as opposed to only at the top `EuiProvider` level) ([#7862](elastic/eui#7862)) **Bug fixes** - Fixed a Chrome/Edge CSS `mask-image` bug that was affecting scroll overflow shadow utilties ([#7855](elastic/eui#7855)) **CSS-in-JS conversions** - Converted `EuiColorPicker` to Emotion; Removed `$euiColorPickerWidth` ([#7845](elastic/eui#7845)) - Converted `EuiColorPickerSwatch` to Emotion ([#7853](elastic/eui#7853)) - Converted `EuiColorPalettePicker` and `EuiColorPaletteDisplay` to Emotion ([#7854](elastic/eui#7854)) - Removed `$euiColorPaletteDisplaySizes` - Removed `@mixin euiColorPaletteInnerBorder` - Removed `$euiColorPickerValueRange0`, `$euiColorPickerValueRange1`, `$euiColorPickerSaturationRange0`, `$euiColorPickerSaturationRange1`, and `$euiColorPickerIndicatorSize` ([#7859](elastic/eui#7859)) **Accessibility** - Updated the `aria-label` attribute for the `EuiFilePicker` remove file button ([#7860](elastic/eui#7860)) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
cee-chen
pushed a commit
to cee-chen/kibana
that referenced
this pull request
Sep 12, 2024
`v95.2.0`⏩`v95.3.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)_ --- - Updated `EuiThemeProvider`s to allow modifying/setting custom `breakpoint`s in nested usage (as opposed to only at the top `EuiProvider` level) ([elastic#7862](elastic/eui#7862)) **Bug fixes** - Fixed a Chrome/Edge CSS `mask-image` bug that was affecting scroll overflow shadow utilties ([elastic#7855](elastic/eui#7855)) **CSS-in-JS conversions** - Converted `EuiColorPicker` to Emotion; Removed `$euiColorPickerWidth` ([elastic#7845](elastic/eui#7845)) - Converted `EuiColorPickerSwatch` to Emotion ([elastic#7853](elastic/eui#7853)) - Converted `EuiColorPalettePicker` and `EuiColorPaletteDisplay` to Emotion ([elastic#7854](elastic/eui#7854)) - Removed `$euiColorPaletteDisplaySizes` - Removed `@mixin euiColorPaletteInnerBorder` - Removed `$euiColorPickerValueRange0`, `$euiColorPickerValueRange1`, `$euiColorPickerSaturationRange0`, `$euiColorPickerSaturationRange1`, and `$euiColorPickerIndicatorSize` ([elastic#7859](elastic/eui#7859)) **Accessibility** - Updated the `aria-label` attribute for the `EuiFilePicker` remove file button ([elastic#7860](elastic/eui#7860)) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Note
This PR merges into a feature branch.
Converts the base
EuiColorPickercomponent to Emotion - more color picker components to come in future PRs.This PR also slightly changes/flattens the DOM structure of the EuiColorPicker popover's elements, allowing for flex gap usage.
QA
The below links should look the same as before with no UI/visual regressions
General checklist
and cypress tests- [ ] If applicable, added the breaking change issue label (and filled out the breaking change checklist)Emotion checklist
General
className(s)read as expected in snapshots and browsersUnit tests
shouldRenderCustomStyles()test was added and passes with parent component and any nestedchildProps(e.g.tooltipProps)Sass/Emotion conversion process
or convertedcomponent-specific Sass vars/mixins to exported JS versionssrc/components/index.scss[ ] Ranyarn compile-scssto update var/mixin JSON files[ ] Simplifiedcalc()tomathWithUnitsif possible (if mixing different unit types, this may not be possible)[ ] Deleted anysrc/amsterdam/overrides/{component}.scssfiles (styles within should have been converted to the baseline Emotion styles)[ ] Converted all global Sass vars/mixins to JS (e.g.$euiSizetoeuiTheme.size.base)[ ] Added an@warndeprecation message within theglobal_styling/mixins/{component}.scssfileCSS tech debt
[ ] Wrapped all animations or transitions ineuiCanAnimategapproperty to add margin between items if using flex-inlineand-blocklogical properties (check inline styles as well as CSS)DOM Cleanup
euiComponent,euiComponent__child).euiColorPicker__popoverPanel--pickerOnlyand.euiColorPicker__popoverPanel--customButtonKibana due diligence
{euiComponent}-(case sensitive) to check for usage of modifier classes - None[ ] If usage exists, consider converting to adataattribute so that consumers still have something to hook into**/target, **/*.snap, **/*.storyshotfor less noise) foreui{Component}(case sensitive) to find:euiBadgeclass on a div instead of simply using theEuiBadgecomponent) - NoneThere's a single custom CSS override, but it appears to apply to a selector that doesn't even exist in EUI anymore 🤷
Extras/nice-to-have
[ ] Optional component/code cleanup: consider splitting up the component into multiple children if it's overly verbose or difficult to reason about[ ] Documentation pass[ ] Check for issues in the backlog that could be a quick fix for that component