"use client";
import * as ProgressPrimitive from '@radix-ui/react-progress';
import * as React from 'react';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { jsx } from 'react/jsx-runtime';

function cn(...inputs) {
  return twMerge(clsx(inputs));
}
var Progress = React.forwardRef(({ className, value, max = 100, ...props }, ref) => {
  const pct = Math.max(0, Math.min(100, (value ?? 0) / max * 100));
  return /* @__PURE__ */ jsx(
    ProgressPrimitive.Root,
    {
      ref,
      value: value ?? 0,
      max,
      className: cn(
        "relative h-2 w-full overflow-hidden rounded-full border border-foreground/[0.08] bg-secondary",
        className
      ),
      ...props,
      children: /* @__PURE__ */ jsx(
        ProgressPrimitive.Indicator,
        {
          className: "h-full w-full flex-1 bg-primary transition-transform duration-500 ease-out",
          style: { transform: `translateX(-${100 - pct}%)` }
        }
      )
    }
  );
});
Progress.displayName = "Progress";

export { Progress };
//# sourceMappingURL=progress.js.map
//# sourceMappingURL=progress.js.map