From aec21d2b1e639ed1cb4308c8403474d4975bd56f Mon Sep 17 00:00:00 2001 From: root Date: Mon, 2 Feb 2026 23:39:24 -0500 Subject: [PATCH] fix: replace Radix UI slider with custom implementation to avoid dependency --- components/ui/slider.tsx | 67 +++++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 22 deletions(-) diff --git a/components/ui/slider.tsx b/components/ui/slider.tsx index c31c2b3..4b1a9a2 100644 --- a/components/ui/slider.tsx +++ b/components/ui/slider.tsx @@ -1,28 +1,51 @@ "use client" import * as React from "react" -import * as SliderPrimitive from "@radix-ui/react-slider" - import { cn } from "@/lib/utils" -const Slider = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - - - - - - -)) -Slider.displayName = SliderPrimitive.Root.displayName +interface SliderProps { + value: number[]; + onValueChange: (value: number[]) => void; + min: number; + max: number; + step: number; + className?: string; +} -export { Slider } +export function Slider({ value, onValueChange, min, max, step, className }: SliderProps) { + const handleChange = (e: React.ChangeEvent) => { + onValueChange([parseInt(e.target.value)]); + }; + + return ( +
+ + +
+ ); +}