[Amsterdam] Eui(Dual)Range styles #4815
Conversation
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4815/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4815/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4815/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4815/ |
The solution for this will largely come down to how we want to handle truncation. //cc @cchaos |
|
And just to show how strange the native Kapture.2021-06-01.at.15.45.42.mp410, 30, 40, 50 are spot on with a scaling calculation, but 20 is off. Not sure how to account for this with math. |
|
My best attempt was to replace the native thumb with Screen+Recording+2021-06-02+at+12.32+PM.movI think the best solution is if we don't rely on the native I think this is a good example of what we can achieve: https://github.com/sghall/react-compound-slider. What do you think @thompsongl? (Maybe it's not achievable for 7.14). |
|
My preference is to find a compromise that allows continued use of We note in the documentation that sliders are not meant to be used for precision, so there is some precedence for keeping with native elements at the expense of perfection:
|
Looking into this as well. Interestingly, the math that makes the most sense places the thumb exactly where the native thumb would be 😅 |
Although still true, I found a way to enforce desired truncation while achieving the label positioning we need. Still a couple layout discrepancies to work out between default and custom labels, but I hope to have a PR for you tomorrow. |
|
👉 elizabetdev#17 |
Align ticks to thumb
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4815/ |
chandlerprall
left a comment
There was a problem hiding this comment.
Code changes LGTM!
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4815/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4815/ |
|
Thanks @thompsongl for elizabetdev#18. It looks great. 🎉 @cchaos the Safari improvementsThe inline color picker in Safari now shares the same focus states as in other browsers: The single range now has focus states. The only difference in Safari is when we have the "highlight". We need to start moving the thumb to make it focused. In other browsers once we focus the thumb the highlight is focused tight away. Screen+Recording+2021-06-17+at+11.47+AM.movAnother limitation or issue I couldn't solve in Safari is when we click the thumb of the color stops there’s a flash of the outline. I tried different things to solve and no luck. Screen+Recording+2021-06-17+at+11.46+AM.mov |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4815/ |
Maybe this is a terrible idea, but what if we added a transition delay for Screen.Recording.2021-06-17.at.02.23.04.PM.mp4 |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4815/ |
cchaos
left a comment
There was a problem hiding this comment.
😍 I can't express how much I love these new styles!!! Ship it! Feel free to address the Safari idea or do a follow up.
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4815/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4815/ |
|
Thanks @cchaos! As suggested I added the transition delay. Tried different speeds and the outline still appears for me in Safari. I left a very fast transition delay for now (it might solve for some users). I'm merging the PR and then I can follow up on this. |
|
@miukimiu You also have to add an overall transition. In my video, I added |
|
@cchaos it seems that I forgot to commit the But I actually tried with the Screen+Recording+2021-06-18+at+11.23+AM.movI'll follow up with a PR. |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4815/ |


Summary
This PR adds new styles for the Eui(Dual)Range.
Bug Fixes
tickIntervalsand the range is set tofullWidth. The negative margins from.euiRangeTicksget out of the parent container: https://codesandbox.io/s/euirangeticks-overlapping-forked-tk0pr?file=/index.jsAmsterdam Styles
Initially, I started by changing the highlight and thumbs to the primary color. But then I decided to leave the color as it was. This gives more margin to better handle states (like focus).
The changes make the compressed and non-compressed states behave more like other components. When it's compressed, the track, highlight, and ticks get smaller.
The major change is that now the ticks are below the track.
For the focus states we only highlight the thumb that is currently focused and also only the range highlight gets highlighted. This gives us more margin to handle better the focus states on #4776.
Disabled states:
These styles also impact the EuiColorStops
Known issue
We fixed the bug with the ticks not positioning properly, but the levels are also not positioned on the right place.
Checklist
[ ] Props have proper autodocs and playground toggles[ ] Added documentation[ ] Checked Code Sandbox works for the any docs examples[ ] Checked for breaking changes and labeled appropriately[ ] Checked for accessibility including keyboard-only and screenreader modes