'use client';

// src/components/Slider/Slider.tsx
import * as React from "react";
import { cn } from "@paalan/react-shared/lib";
import * as SliderPrimitive from "@radix-ui/react-slider";
import { jsx, jsxs } from "react/jsx-runtime";
var sliderVariant = {
  primary: {
    track: "bg-primary/20",
    range: "bg-primary",
    thumb: "border-primary/50"
  },
  secondary: {
    track: "bg-secondary/20",
    range: "bg-secondary",
    thumb: "border-secondary/50"
  },
  tertiary: {
    track: "bg-tertiary/20",
    range: "bg-tertiary",
    thumb: "border-tertiary/50"
  },
  danger: {
    track: "bg-danger/20",
    range: "bg-danger",
    thumb: "border-danger/50"
  },
  warning: {
    track: "bg-warning/20",
    range: "bg-warning",
    thumb: "border-warning/50"
  },
  success: {
    track: "bg-success/20",
    range: "bg-success",
    thumb: "border-success/50"
  },
  info: {
    track: "bg-info/20",
    range: "bg-info",
    thumb: "border-info/50"
  }
};
var Slider = React.forwardRef(
  ({ className, variant = "primary", ...props }, ref) => {
    const sliderVariantColor = sliderVariant[variant || "primary"];
    return /* @__PURE__ */ jsxs(
      SliderPrimitive.Root,
      {
        ref,
        className: cn("relative flex w-full touch-none select-none items-center", className),
        ...props,
        children: [
          /* @__PURE__ */ jsx(
            SliderPrimitive.Track,
            {
              className: cn("relative h-1.5 w-full grow overflow-hidden rounded-full", sliderVariantColor.track),
              children: /* @__PURE__ */ jsx(SliderPrimitive.Range, { className: cn("absolute h-full", sliderVariantColor.range) })
            }
          ),
          /* @__PURE__ */ jsx(
            SliderPrimitive.Thumb,
            {
              className: cn(
                "block h-4 w-4 rounded-full border bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
                sliderVariantColor.thumb
              )
            }
          )
        ]
      }
    );
  }
);
Slider.displayName = SliderPrimitive.Root.displayName;
export {
  Slider,
  sliderVariant
};
