-
Notifications
You must be signed in to change notification settings - Fork 844
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
[EuiDatePickerRange][EuiSuperDatePicker] Convert to dogfood EuiFormControlLayoutDelimited
#6705
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_6705/ |
Hey @breehall! Sorry to dump another larger PR on you, but hoping you'd be able to take this on this week and help QA/regression test the listed steps/sections to check for any visual regressions. Thanks a million! |
…d` state on mount - needs a state rerender on mount - ref is insufficient + update tests to use RTL instead of enzyme and move to inline snapshots
- Positioning: prefer a prop instead, so that each usage (e.g. delimited, ranges) can pass in their own custom control over absolute vs static positioning - Side: clean up EuiFormLayoutControlIcons to render separate for left vs right side, which makes for better and more correct DOM order, + clean up classes + misc cleanup
- height/width doesn't appear to be doing anything - The padding is unnecessary / adding extra spacing and doesn't have a non-compressed version
- instead of using its own custom delimiter + add `controlOnly` support to the `EuiDatePicker` to avoid nested control layouts (matches `EuiFieldText/Number`) + add `append/prepend` props for future `EuiSuperDatePicker` use (& DRY out other props shared w/ `EuiFormControlLayoutDelimited`)
- EuiFormControlLayoutDelimited should be doing almost all the CSS heavy lifting at this point
- Remove duplicated `EuiFormControlLayout` - only render if `EuiDateRangePicker` isn't being used - Add `isLoading` display to picker if update button isn't being shown - Fix icons not displaying correctly if `isQuickSelectOnly` is true
…input children + fix extra padding on delimiter arrow when prepend/append exist + clean up/DRY out invalid styling on icons & delimiter
7ae3924
to
ea6619f
Compare
Preview documentation changes for this PR: https://eui.elastic.co/pr_6705/ |
a324802
to
5e4e85c
Compare
…date` state to match Figma
5e4e85c
to
f6dbd09
Compare
Preview documentation changes for this PR: https://eui.elastic.co/pr_6705/ |
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.
This is great work and I'm sure it was quite a task! As recommended, I followed commit by commit and scanned snapshots as well. As a whole, everything looks good, but I wanted to run two things past you to see if they were intended.
- It looks like the alignment of the popover in
EuiSuperDatePicker
has shifted very slightly. The position now changes based on which date you select and in prod it is centered with the input.
(https://eui.elastic.co/pr_6705/#/forms/date-picker#date-picker-range)
- In the super date picker template, it looks like we're now highlighting and changing the color of the range arrow. This remained white in prod.
(https://eui.elastic.co/pr_6705/#/templates/super-date-picker)
Thanks for the super thorough QA Bree, it's much appreciated and makes me feel more confident in a (hopeful) lack of regressions!
Very intentional change - this matches the Figma pattern that the super date picker was apparently supposed to have used this entire time. Plus I think it looks better!
This is not necessarily an intentional change but it is an expected one based on how the underlying If we get any actual end-user reports or complaints I'd be open to revisiting in the future, but in the meanwhile I'd argue this is OK to change as it has minimal to no meaningful UX impact. |
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.
✅ Thanks so much for answering my questions! This is good to go
- instead of applying bg colors to individual delimiter and icon elements, apply it to the parent `__childenWrapper` + simplify default delimited icon to not set its own `color` but instead inherit from its `EuiText` wrapper + update downstream EuiSuperDatePicker CSS
The EuiSuperDatePicker arrow highlight got me thinking of another way to simplify our delimiter CSS a bit more, so I pushed up one last quick cleanup commit. I've tested it thoroughly against the form delimited docs and the super datepicker docs and am confident it's working as before with slightly DRYer CSS, so will do an auto-merge here once CI runs. Thanks again for the review Bree! |
Preview documentation changes for this PR: https://eui.elastic.co/pr_6705/ |
## Summary `[email protected]` ⏩ `[email protected]` Closes elastic/eui#6724 --- ## [`77.2.2`](https://github.com/elastic/eui/tree/v77.2.2) - Updated `EuiFocusTrap` to support the `gapMode` prop configuration (now defaults to `padding`) ([#6744](elastic/eui#6744)) **Bug fixes** - Fixed the `scrollLock` property on `EuiFocusTrap` (and other components using `EuiFocusTrap`, such as `EuiFlyout` and `EuiModal`) to no longer block scrolling on nested portalled content, such as combobox dropdowns ([#6744](elastic/eui#6744)) ## [`77.2.1`](https://github.com/elastic/eui/tree/v77.2.1) **Bug fixes** - Fixed `EuiFieldNumber`'s native browser validity detection causing extra unnecessary rerenders ([#6741](elastic/eui#6741)) ## [`77.2.0`](https://github.com/elastic/eui/tree/v77.2.0) - Updated `EuiFieldNumber` to detect native browser invalid state and show an invalid icon ([#6704](elastic/eui#6704)) - Improved the input widths of `EuiRange` and `EuiDualRange` when `showInput={true}` to account for invalid icons ([#6704](elastic/eui#6704)) - Improved the `isInvalid` styling of `EuiDualRange` when `showInput="inputWithPopover"` ([#6704](elastic/eui#6704)) - Updated `EuiFormControlLayoutIcons` to render left icons in expected DOM order ([#6705](elastic/eui#6705)) - Updated `EuiDatePickerRange`'s `isInvalid` state to match other range inputs ([#6705](elastic/eui#6705)) - Updated `EuiSuperDatePicker`'s `isInvalid` state to match other range inputs ([#6705](elastic/eui#6705)) **Bug fixes** - Fixed `EuiValidatableControl` to correctly display `isInvalid` states on mount ([#6705](elastic/eui#6705)) - Fixed an issue with `EuiSearchBar` where quoted phrases were not quoted when generating an Elasticsearch query. ([#6714](elastic/eui#6714)) --------- Co-authored-by: Constance Chen <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Constance Chen <[email protected]>
Summary
Converting the date range picker components to dogfood
EuiFormControlLayoutDelimited
accomplishes the following:isInvalid
,isLoading
, etc.This PR also cleans up
EuiFormControlLayout
's positioning and side logic/CSS.I strongly recommend following along by commit, mostly because there's a ton of snapshot updates.
closes #2017 - I consider this to be the last major form control component in the list.
Before/After
QA
General checklist
and cypress tests- [ ] Props have proper autodocs (using@default
if default values are missing) and playground toggles- [ ] Added documentation- [ ] Checked Code Sandbox works for any docs examples- [ ] Checked for breaking changes and labeled appropriately- [ ] Checked for accessibility including keyboard-only and screenreader modes