-
Notifications
You must be signed in to change notification settings - Fork 1
feat(ui): add Slider component and update testing #1169
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
Draft
seonghobae
wants to merge
21
commits into
develop
Choose a base branch
from
feature/slider-component-15270604324360509989
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
6a58fa9
[UI] 슬라이더 컴포넌트 마크업 구조 수정 (@base-ui/react 호환)
seonghobae c10a605
test(ui): require named slider thumb anatomy
seonghobae 4efece4
fix(ui): preserve slider thumb semantics
seonghobae 11460d0
docs(storybook): label slider interaction
seonghobae 63cb76d
fix(ui): bound slider orientation and focus state
seonghobae 5ddb8aa
docs(storybook): document slider exports
seonghobae ba2d640
test(ui): bound slider disabled and range contracts
seonghobae 2a4cb14
fix(ui): enforce single-thumb slider state
seonghobae 579b90f
[UI] 슬라이더 컴포넌트 마크업 구조 수정 (@base-ui/react 호환)
seonghobae 468afc6
test(ui): restore Slider accessibility contract
seonghobae 3c70532
fix(ui): restore accessible Slider contract
seonghobae cfe5062
fix(ui): restore Slider Storybook contract
seonghobae ed5f8d9
[UI] 슬라이더 컴포넌트 마크업 구조 수정 (@base-ui/react 호환)
seonghobae 60e5d0d
test(ui): restore slider accessibility contract RED
seonghobae 5731efa
fix(ui): restore slider input accessibility boundary
seonghobae 416f948
fix(ui): keep slider story on canonical accessible surface
seonghobae c3ee2fd
test(ui): require full-height slider pointer target RED
seonghobae 4b4e6fa
fix(ui): keep slider spatial target at 24 CSS px
seonghobae 317a586
[UI] 슬라이더 컴포넌트 마크업 구조 수정 (@base-ui/react 호환)
seonghobae 48d28a0
[UI] 슬라이더 컴포넌트 마크업 구조 수정 (@base-ui/react 호환)
seonghobae a32b59e
[UI] 슬라이더 컴포넌트 마크업 구조 수정 (@base-ui/react 호환)
seonghobae 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
Some comments aren't visible on the classic Files Changed page.
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,18 @@ | ||
| import type { Meta, StoryObj } from "@storybook/react" | ||
|
|
||
| import { Slider } from "./slider" | ||
|
|
||
| const meta = { | ||
| title: "UI/Slider", | ||
| component: Slider, | ||
| parameters: { layout: "centered" }, | ||
| args: { | ||
| defaultValue: 50, | ||
| className: "w-[60vw]" | ||
| }, | ||
| } satisfies Meta<typeof Slider> | ||
|
|
||
| export default meta | ||
| type Story = StoryObj<typeof meta> | ||
|
|
||
| export const Default: Story = {} | ||
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,39 @@ | ||
| import * as React from "react" | ||
| import { Slider as SliderPrimitive } from "@base-ui/react/slider" | ||
|
|
||
| import { cn } from "@/lib/utils" | ||
|
|
||
| /** Render a styled slider that preserves Base UI accessibility behavior. */ | ||
| function Slider({ | ||
| className, | ||
| ...props | ||
| }: React.ComponentProps<typeof SliderPrimitive.Root>) { | ||
| return ( | ||
| <SliderPrimitive.Root | ||
| data-slot="slider" | ||
| className={cn( | ||
| "relative flex w-full touch-none select-none items-center", | ||
| className | ||
| )} | ||
| {...props} | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| > | ||
| <SliderPrimitive.Control className="flex w-full items-center"> | ||
| <SliderPrimitive.Track | ||
| data-slot="slider-track" | ||
| className="relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20" | ||
| > | ||
| <SliderPrimitive.Indicator | ||
| data-slot="slider-indicator" | ||
| className="h-full bg-primary" | ||
| /> | ||
| </SliderPrimitive.Track> | ||
| <SliderPrimitive.Thumb | ||
| data-slot="slider-thumb" | ||
| className="block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" | ||
| /> | ||
| </SliderPrimitive.Control> | ||
| </SliderPrimitive.Root> | ||
| ) | ||
| } | ||
|
|
||
| export { Slider } | ||
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
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.