| 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("relative flex w-full touch-none select-none items-center", className)} |
| 13 | {...props} |
| 14 | > |
| 15 | <SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-secondary"> |
| 16 | <SliderPrimitive.Range className="absolute h-full bg-primary" /> |
| 17 | </SliderPrimitive.Track> |
| 18 | <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" /> |
| 19 | </SliderPrimitive.Root> |
| 20 | )); |
| 21 | Slider.displayName = SliderPrimitive.Root.displayName; |
| 22 | |
| 23 | export { Slider }; |