Royal-Navy / design-system

Build web applications that meet the Royal Navy service standards
https://storybook.design-system.navy.digital.mod.uk
Apache License 2.0
103 stars 32 forks source link

feat(RangeSliderE): Base implementation with feature parity #2845

Closed m7kvqbe1 closed 2 years ago

m7kvqbe1 commented 2 years ago

Related issue

Closes #2436

Overview

Create new experimental RangeSliderE component based on design spec.

Link to preview

https://61a8f4b587ed053ee108b405--rangeslidere.netlify.app

Reason

Implement new RangeSliderE component and reach feature parity with legacy.

Work carried out

Screenshot

Screenshot 2021-11-29 at 16 01 45

Developer notes

The design spec changes the way threshold functionality works when combined with multiple handles.

Needs discussion with design authority to elaborate on desired behaviour.

This will be implemented as part of a seperate PR: https://github.com/defencedigital/mod-uk-design-system/issues/2849

k9dh3zij commented 2 years ago

Thanks @m7kvqbe1, looking great! Minor style tweaks:

  1. When at the lowest / highest value, the handle should be mid-aligned to the visual start / end of the scale. It's currently a few pixels off: image image

  2. Clicking anywhere on the slider (causing the handle to move) or grabbing and moving the number input box should cause the slider handle to get the focus. Currently it only gets the focus if I grab the handle itself or tab to it.

https://user-images.githubusercontent.com/73531035/144046648-ca1a3f48-b091-4301-a1b9-b707cda755bb.mov

  1. Clicking exactly on a tickmark doesn't cause the slider to move there (notice the second click in the video above).

  2. Apologies this wasn't called out in the spec, but can you ensure a 12px padding between the icons and the edges of the slider track please? image

jpveooys commented 2 years ago

@m7kvqbe1 FYI the Chromatic build failed for IE11:

image

m7kvqbe1 commented 2 years ago

Removed CSS variables optimization because IE11 polyfills do not work with styled-components.

k9dh3zij commented 2 years ago

Thanks for the fixes @m7kvqbe1 - looking great! 👍

I assume this is part of #2849 but just so it doesn't get lost:

Tickmarks with thresholds currently disappear behind the filled track. Current: image Spec: image

All earlier points have been addressed, thank you! :)

sonarcloud[bot] commented 2 years ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

97.5% 97.5% Coverage
13.0% 13.0% Duplication