|
1
|
import * as React from "react" |
|
2
|
import * as SliderPrimitive from "@radix-ui/react-slider" |
|
3
|
|
|
4
|
import { cn } from "@/lib/utils" |
|
5
|
|
|
6
|
const Slider = React.forwardRef< |
|
7
|
React.ElementRef<typeof SliderPrimitive.Root>, |
|
8
|
React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> |
|
9
|
>(({ className, ...props }, ref) => ( |
|
10
|
<SliderPrimitive.Root |
|
11
|
ref={ref} |
|
12
|
className={cn( |
|
13
|
"relative flex w-full touch-none select-none items-center", |
|
14
|
className |
|
15
|
)} |
|
16
|
{...props} |
|
17
|
> |
|
18
|
<SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-secondary"> |
|
19
|
<SliderPrimitive.Range className="absolute h-full bg-primary" /> |
|
20
|
</SliderPrimitive.Track> |
|
21
|
<SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" /> |
|
22
|
</SliderPrimitive.Root> |
|
23
|
)) |
|
24
|
Slider.displayName = SliderPrimitive.Root.displayName |
|
25
|
|
|
26
|
export { Slider } |