{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "progress-ring",
  "title": "Progress Ring",
  "author": "VenusUI",
  "description": "Circular progress with the value in the middle, exposed as an accessible progress bar.",
  "files": [
    {
      "path": "registry/default/ui/progress-ring.tsx",
      "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface ProgressRingProps extends Omit<React.ComponentProps<\"div\">, \"children\"> {\n  /** Progress from 0 to `max`. */\n  value: number\n  max?: number\n  /** Diameter in pixels. */\n  size?: number\n  /** Ring thickness in pixels. */\n  strokeWidth?: number\n  /** Accessible name, e.g. \"Upload progress\". */\n  label: string\n  /** Content in the middle. Defaults to the percentage. */\n  children?: React.ReactNode\n}\n\n/**\n * Circular progress with the value in the middle. Exposed as a progressbar\n * with its current value. The ring animates between values unless the user\n * prefers reduced motion.\n */\nfunction ProgressRing({ value, max = 100, size = 96, strokeWidth = 8, label, children, className, ...props }: ProgressRingProps) {\n  const clamped = Math.min(Math.max(value, 0), max)\n  const percent = Math.round((clamped / max) * 100)\n  const radius = (size - strokeWidth) / 2\n  const circumference = 2 * Math.PI * radius\n\n  return (\n    <div\n      role=\"progressbar\"\n      aria-label={label}\n      aria-valuemin={0}\n      aria-valuemax={max}\n      aria-valuenow={clamped}\n      data-slot=\"progress-ring\"\n      className={cn(\"relative inline-flex items-center justify-center\", className)}\n      style={{ width: size, height: size }}\n      {...props}\n    >\n      <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`} aria-hidden=\"true\" className=\"-rotate-90\">\n        <circle cx={size / 2} cy={size / 2} r={radius} fill=\"none\" strokeWidth={strokeWidth} className=\"stroke-muted\" />\n        <circle\n          cx={size / 2}\n          cy={size / 2}\n          r={radius}\n          fill=\"none\"\n          strokeWidth={strokeWidth}\n          strokeLinecap=\"round\"\n          strokeDasharray={circumference}\n          strokeDashoffset={circumference * (1 - clamped / max)}\n          className=\"stroke-primary transition-[stroke-dashoffset] duration-500 ease-out motion-reduce:transition-none\"\n        />\n      </svg>\n      <span aria-hidden=\"true\" className=\"absolute text-sm font-semibold tabular-nums\">\n        {children ?? `${percent}%`}\n      </span>\n    </div>\n  )\n}\n\nexport { ProgressRing, type ProgressRingProps }\n",
      "type": "registry:ui"
    }
  ],
  "meta": {
    "version": "0.1.1"
  },
  "categories": [
    "loaders"
  ],
  "type": "registry:ui"
}