-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
[Slider] Modernize implementation #583
Merged
Merged
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
55473b0
Convert to namespace types
mj12albert e47af47
Replace useCompound with CompositeList
mj12albert 5f601d3
Update demos
mj12albert ee7e3fc
Apply CSS writing mode on input element
mj12albert 6ba2983
Clean up experiments
mj12albert 6f8e65f
Remove useSliderContext from demos
mj12albert e1709e8
Remove useSliderContext from experiments
mj12albert e7e7141
Unexport Slider hooks and context
mj12albert 8a04fd9
Merge remote-tracking branch 'upstream/master' into refactor/slider-c…
mj12albert f209871
Move proptypes
mj12albert 5014a56
Merge remote-tracking branch 'upstream/master' into refactor/slider-c…
mj12albert 1d2c4d2
Merge remote-tracking branch 'upstream/master' into refactor/slider-c…
mj12albert 97dc5b8
Merge remote-tracking branch 'upstream/master' into refactor/slider-c…
mj12albert 364fea9
Merge remote-tracking branch 'upstream/master' into refactor/slider-c…
mj12albert b78035c
Fix demo css
mj12albert 48ed1ff
Cleanup
mj12albert 129bdec
Revert "Cleanup"
mj12albert 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 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 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 was deleted.
Oops, something went wrong.
This file contains 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 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,99 @@ | ||
.slider { | ||
font-family: | ||
IBM Plex Sans, | ||
sans-serif; | ||
font-size: 1rem; | ||
width: 100%; | ||
align-items: center; | ||
position: relative; | ||
-webkit-tap-highlight-color: transparent; | ||
display: grid; | ||
grid-template-columns: 1fr 1fr; | ||
gap: 1rem; | ||
} | ||
|
||
.output { | ||
text-align: right; | ||
} | ||
|
||
.control { | ||
grid-column: 1/3; | ||
display: flex; | ||
align-items: center; | ||
position: relative; | ||
width: 100%; | ||
height: 16px; | ||
border-radius: 9999px; | ||
touch-action: none; | ||
} | ||
|
||
.track { | ||
width: 100%; | ||
height: 2px; | ||
border-radius: 9999px; | ||
background-color: var(--gray-400); | ||
touch-action: none; | ||
} | ||
|
||
.dark .track { | ||
background-color: var(--gray-700); | ||
} | ||
|
||
.control[data-disabled] { | ||
cursor: not-allowed; | ||
} | ||
|
||
.indicator { | ||
height: 2px; | ||
border-radius: 9999px; | ||
background-color: var(--gray-900); | ||
} | ||
|
||
.dark .indicator { | ||
background-color: var(--gray-100); | ||
} | ||
|
||
.thumb { | ||
width: 16px; | ||
height: 16px; | ||
box-sizing: border-box; | ||
border-radius: 50%; | ||
background-color: var(--gray-900); | ||
touch-action: none; | ||
|
||
&:focus-visible { | ||
outline: 2px solid var(--gray-900); | ||
outline-offset: 2px; | ||
} | ||
|
||
&[data-dragging] { | ||
background-color: pink; | ||
} | ||
|
||
&[data-disabled] { | ||
background-color: var(--gray-300); | ||
} | ||
} | ||
|
||
.dark .thumb { | ||
background-color: var(--gray-100); | ||
|
||
&:focus-visible { | ||
outline-color: var(--gray-300); | ||
outline-width: 1px; | ||
outline-offset: 3px; | ||
} | ||
|
||
&[data-disabled] { | ||
background-color: var(--gray-600); | ||
} | ||
} | ||
|
||
.label { | ||
cursor: unset; | ||
font-weight: bold; | ||
} | ||
|
||
.label[data-disabled='true'] { | ||
color: var(--gray-600); | ||
} |
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.
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.
If there is a legitimate use case for the context, we should export it from the package.
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.
We discussed this and decided to revisit exporting Context(s) after the alpha phase