-
Notifications
You must be signed in to change notification settings - Fork 8
feat(slider): new TEDI-Ready component #13 #607
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9a76096
feat(slider): new TEDI-Ready component #13
airikej 3312e19
feat(slider): add final story #13
airikej 7207fae
feat(slider): fix story #13
airikej a9f5727
fix(slider): fix slider drag states, improve tooltip handling #13
airikej 2aa11de
fix(slider): code review fixes #13
airikej c30c72f
fix(slider): fix tests #13
airikej 186f36f
fix(slider): fix track hover/active colors, hide invalid story, impro…
airikej 5e72428
fix(slider): fix slider thumb focus ring thickness #13
airikej 2517201
fix(slider): code review fixes #13
airikej a04294f
fix(slider): improve mobile stories, improve track click area #13
airikej 109397a
Merge branch 'rc' into feat/13-slider-new-tedi-ready-component
airikej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,221 @@ | ||
| .tedi-slider { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: var(--form-field-outer-spacing); | ||
| width: 100%; | ||
| } | ||
|
|
||
| .tedi-slider__container { | ||
| display: flex; | ||
| gap: var(--form-slider-inner-spacing); | ||
| align-items: center; | ||
| width: 100%; | ||
| } | ||
|
|
||
| .tedi-slider__track-row { | ||
| display: flex; | ||
| flex: 1 0 0; | ||
| gap: var(--layout-grid-gutters-08); | ||
| align-items: center; | ||
| min-width: 0; | ||
| } | ||
|
|
||
| .tedi-slider__range-label { | ||
| flex-shrink: 0; | ||
| font-size: var(--body-regular-size); | ||
| line-height: var(--body-regular-line-height); | ||
| color: var(--form-slider-range-label-text); | ||
| white-space: nowrap; | ||
| } | ||
|
|
||
| .tedi-slider__track { | ||
| --tedi-slider-progress: 0%; | ||
| --tedi-slider-progress-ratio: 0; | ||
|
|
||
| position: relative; | ||
| flex: 1 0 0; | ||
| min-width: 0; | ||
| height: var(--form-slider-height); | ||
| background: linear-gradient( | ||
| to right, | ||
| var(--form-slider-active-background-default) 0%, | ||
| var(--form-slider-active-background-default) var(--tedi-slider-progress), | ||
| var(--form-slider-passive-background-default) var(--tedi-slider-progress), | ||
| var(--form-slider-passive-background-default) 100% | ||
| ); | ||
| border: 1px solid var(--form-slider-border-default); | ||
| border-radius: var(--form-slider-radius); | ||
| } | ||
|
|
||
| .tedi-slider__thumb-anchor { | ||
| position: absolute; | ||
| top: 50%; | ||
| left: calc( | ||
| var(--form-slider-thumb-size) / 2 + var(--tedi-slider-progress-ratio) * (100% - var(--form-slider-thumb-size)) | ||
| ); | ||
| display: block; | ||
| width: var(--form-slider-thumb-size); | ||
| height: var(--form-slider-thumb-size); | ||
| pointer-events: none; | ||
| transform: translate(-50%, -50%); | ||
| } | ||
|
|
||
| .tedi-slider__input { | ||
| --tedi-slider-hit-padding: 0.625rem; | ||
|
|
||
| position: absolute; | ||
| inset: calc(var(--tedi-slider-hit-padding) * -1) 0; | ||
| width: 100%; | ||
| padding: 0; | ||
| margin: 0; | ||
| appearance: none; | ||
| cursor: pointer; | ||
| background: transparent; | ||
| border: 0; | ||
| border-radius: inherit; | ||
| outline: none; | ||
|
|
||
|
airikej marked this conversation as resolved.
|
||
| &::-webkit-slider-runnable-track { | ||
| width: 100%; | ||
| height: 100%; | ||
| background: transparent; | ||
| border: 0; | ||
| } | ||
|
|
||
| &::-moz-range-track { | ||
| width: 100%; | ||
| height: 100%; | ||
| background: transparent; | ||
| border: 0; | ||
| } | ||
|
|
||
| &::-webkit-slider-thumb { | ||
| width: var(--form-slider-thumb-size); | ||
| height: var(--form-slider-thumb-size); | ||
| margin-top: calc((var(--form-slider-height) - var(--form-slider-thumb-size)) / 2 + var(--tedi-slider-hit-padding)); | ||
| appearance: none; | ||
| cursor: pointer; | ||
| background: var(--form-slider-thumb-background-default); | ||
| border: var(--tedi-borders-02) solid var(--form-slider-thumb-border-default); | ||
| border-radius: 50%; | ||
| } | ||
|
|
||
| &::-moz-range-thumb { | ||
| box-sizing: border-box; | ||
| width: var(--form-slider-thumb-size); | ||
| height: var(--form-slider-thumb-size); | ||
| cursor: pointer; | ||
| background: var(--form-slider-thumb-background-default); | ||
| border: var(--tedi-borders-02) solid var(--form-slider-thumb-border-default); | ||
| border-radius: 50%; | ||
| } | ||
|
|
||
| &:hover:not(:disabled)::-webkit-slider-thumb { | ||
| background: var(--form-slider-thumb-background-hover); | ||
| border-color: var(--form-slider-thumb-border-hover); | ||
| } | ||
|
|
||
| &:hover:not(:disabled)::-moz-range-thumb { | ||
| background: var(--form-slider-thumb-background-hover); | ||
| border-color: var(--form-slider-thumb-border-hover); | ||
| } | ||
|
|
||
| &:focus-visible:not(:disabled)::-webkit-slider-thumb { | ||
| background: var(--form-slider-thumb-background-focus); | ||
| border-color: var(--form-slider-thumb-border-focus); | ||
| } | ||
|
|
||
| &:focus-visible:not(:disabled)::-moz-range-thumb { | ||
| background: var(--form-slider-thumb-background-focus); | ||
| border-color: var(--form-slider-thumb-border-focus); | ||
| } | ||
|
|
||
| &:active:not(:disabled)::-webkit-slider-thumb, | ||
| &.tedi-slider__input--dragging:not(:disabled)::-webkit-slider-thumb { | ||
| background: var(--form-slider-thumb-background-active); | ||
| border-color: var(--form-slider-thumb-border-active); | ||
| } | ||
|
|
||
| &:active:not(:disabled)::-moz-range-thumb, | ||
| &.tedi-slider__input--dragging:not(:disabled)::-moz-range-thumb { | ||
| background: var(--form-slider-thumb-background-active); | ||
| border-color: var(--form-slider-thumb-border-active); | ||
| } | ||
|
|
||
| &:focus-visible:not(:disabled)::-webkit-slider-thumb, | ||
| &.tedi-slider__input--dragging:not(:disabled)::-webkit-slider-thumb { | ||
| box-shadow: 0 0 0 var(--tedi-borders-01) var(--tedi-neutral-100), | ||
|
ly-tempel-bitweb marked this conversation as resolved.
|
||
| 0 0 0 calc(var(--tedi-borders-01) + var(--tedi-borders-02)) var(--form-slider-thumb-border-focus); | ||
| } | ||
|
|
||
| &:focus-visible:not(:disabled)::-moz-range-thumb, | ||
| &.tedi-slider__input--dragging:not(:disabled)::-moz-range-thumb { | ||
| box-shadow: 0 0 0 var(--tedi-borders-01) var(--tedi-neutral-100), | ||
| 0 0 0 calc(var(--tedi-borders-01) + var(--tedi-borders-02)) var(--form-slider-thumb-border-focus); | ||
| } | ||
| } | ||
|
|
||
| .tedi-slider__addon { | ||
| display: flex; | ||
| flex-shrink: 0; | ||
| align-items: center; | ||
| } | ||
|
|
||
| .tedi-slider__feedback { | ||
| margin-top: var(--form-field-outer-spacing); | ||
| } | ||
|
|
||
| .tedi-slider:hover:not(.tedi-slider--disabled) .tedi-slider__track { | ||
| background: linear-gradient( | ||
| to right, | ||
| var(--form-slider-active-background-hover) 0%, | ||
| var(--form-slider-active-background-hover) var(--tedi-slider-progress), | ||
| var(--form-slider-passive-background-default) var(--tedi-slider-progress), | ||
| var(--form-slider-passive-background-default) 100% | ||
| ); | ||
| } | ||
|
|
||
| .tedi-slider--dragging:not(.tedi-slider--disabled) .tedi-slider__track, | ||
| .tedi-slider:active:not(.tedi-slider--disabled) .tedi-slider__track { | ||
| background: linear-gradient( | ||
| to right, | ||
| var(--form-slider-active-background-active) 0%, | ||
| var(--form-slider-active-background-active) var(--tedi-slider-progress), | ||
| var(--form-slider-passive-background-default) var(--tedi-slider-progress), | ||
| var(--form-slider-passive-background-default) 100% | ||
| ); | ||
| } | ||
|
|
||
| .tedi-slider--disabled { | ||
| .tedi-slider__track { | ||
| background: linear-gradient( | ||
| to right, | ||
| var(--form-slider-active-background-disabled) 0%, | ||
| var(--form-slider-active-background-disabled) var(--tedi-slider-progress), | ||
| var(--form-slider-passive-background-default) var(--tedi-slider-progress), | ||
| var(--form-slider-passive-background-default) 100% | ||
| ); | ||
| } | ||
|
|
||
| .tedi-slider__input { | ||
| cursor: not-allowed; | ||
|
|
||
| &::-webkit-slider-thumb { | ||
| cursor: not-allowed; | ||
| background: var(--form-slider-thumb-background-disabled); | ||
| border-color: var(--form-slider-thumb-border-disabled); | ||
| } | ||
|
|
||
| &::-moz-range-thumb { | ||
| cursor: not-allowed; | ||
| background: var(--form-slider-thumb-background-disabled); | ||
| border-color: var(--form-slider-thumb-border-disabled); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .tedi-slider--invalid:not(.tedi-slider--disabled) { | ||
| .tedi-slider__track { | ||
| border-color: var(--form-general-feedback-error-border); | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.