{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "progress-ring-chart",
  "title": "Progress Ring Chart",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-react/components/charts/progress-ring-chart/ProgressRingChart.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { cn } from '@/lib/utils'\nimport { ChartFrame } from '../shared'\n\n// ProgressRingChart — dependency-free SVG gauge\n// ─────────────────────────────────────────────────────────────────────────\n\nexport interface ProgressRing {\n  /** 0..100. */\n  value: number\n  /** Defaults to chart-1..N tokens. */\n  color?: string\n  label?: string\n}\n\nexport interface ProgressRingChartProps {\n  rings: ProgressRing[]\n  height?: number | string\n  /** Ring thickness in SVG units. Default 14. */\n  stroke?: number\n  /** Show the centre label (first ring value or custom). Default true. */\n  showLabel?: boolean\n  /** Centre label override. */\n  centerLabel?: string\n  colors?: string[]\n  className?: string\n  /** Accessible name announced for the chart image. Defaults to \"Chart\". */\n  ariaLabel?: string\n}\n\nconst DEFAULT_COLORS = ['var(--chart-1)', 'var(--chart-2)', 'var(--chart-3)', 'var(--chart-4)', 'var(--chart-5)']\nconst C = 2 * Math.PI * 80\n\nexport const ProgressRingChart = React.forwardRef<HTMLDivElement, ProgressRingChartProps>(\n  (\n    { rings, height = 220, stroke = 14, showLabel = true, centerLabel, colors = DEFAULT_COLORS, className, ariaLabel },\n    ref,\n  ) => {\n    const arcs = rings.map((r, i) => {\n      const pct = Math.max(0, Math.min(100, r.value)) / 100\n      return {\n        dash: `${(pct * C).toFixed(1)} ${C.toFixed(1)}`,\n        color: r.color ?? colors[i % colors.length],\n        r: 80 - i * (stroke + 6),\n        value: r.value,\n      }\n    })\n    const view = 200 + (rings.length - 1) * (stroke + 6) * 2\n    const center = view / 2\n    const summary =\n      centerLabel ?? (rings.length === 1 ? `${Math.round(rings[0]?.value ?? 0)}%` : `${rings.length} rings`)\n\n    return (\n      <ChartFrame\n        ref={ref}\n        height={height}\n        className={cn('flex items-center justify-center', className)}\n        ariaLabel={\n          ariaLabel ||\n          `Progress ring chart: ${rings.map((r) => `${r.label ?? 'value'} ${Math.round(r.value)}%`).join(', ')}`\n        }\n      >\n        <svg viewBox={`0 0 ${view} ${view}`} className=\"aspect-square h-full max-h-full\" role=\"presentation\">\n          <g transform={`rotate(-90 ${center} ${center})`}>\n            {arcs.map((a, i) => (\n              <circle\n                key={`t${i}`}\n                cx={center}\n                cy={center}\n                r={a.r}\n                fill=\"none\"\n                stroke=\"currentColor\"\n                strokeWidth={stroke}\n                className=\"text-border\"\n                opacity=\"0.35\"\n              />\n            ))}\n            {arcs.map((a, i) => (\n              <circle\n                key={`v${i}`}\n                cx={center}\n                cy={center}\n                r={a.r}\n                fill=\"none\"\n                stroke={a.color}\n                strokeWidth={stroke}\n                strokeLinecap=\"round\"\n                strokeDasharray={a.dash}\n              />\n            ))}\n          </g>\n          {showLabel && (\n            <text\n              x={center}\n              y={center}\n              textAnchor=\"middle\"\n              dominantBaseline=\"middle\"\n              className=\"fill-foreground\"\n              fontSize=\"26\"\n              fontWeight=\"700\"\n            >\n              {summary}\n            </text>\n          )}\n        </svg>\n      </ChartFrame>\n    )\n  },\n)\nProgressRingChart.displayName = 'ProgressRingChart'\n",
      "type": "registry:ui",
      "target": "~/components/ui/charts/progress-ring-chart/ProgressRingChart.tsx"
    },
    {
      "path": "packages/registry-react/components/charts/progress-ring-chart/index.ts",
      "content": "export { ProgressRingChart, type ProgressRingChartProps, type ProgressRing } from './ProgressRingChart'\n",
      "type": "registry:ui",
      "target": "~/components/ui/charts/progress-ring-chart/index.ts"
    },
    {
      "path": "packages/registry-react/components/charts/shared.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport * as echartsCore from 'echarts/core'\nimport { use } from 'echarts/core'\nimport { CanvasRenderer } from 'echarts/renderers'\nimport {\n  LineChart as EChartsLineChart,\n  BarChart as EChartsBarChart,\n  PieChart as EChartsPieChart,\n  ScatterChart as EChartsScatterChart,\n  EffectScatterChart as EChartsEffectScatter,\n  PictorialBarChart as EChartsPictorialBar,\n  RadarChart as EChartsRadarChart,\n  GaugeChart as EChartsGaugeChart,\n  HeatmapChart as EChartsHeatmap,\n  TreemapChart as EChartsTreemapChart,\n  FunnelChart as EChartsFunnelChart,\n  BoxplotChart as EChartsBoxplotChart,\n  CandlestickChart as EChartsCandlestickChart,\n  CustomChart as EChartsCustomChart,\n  ChordChart as EChartsChordChart,\n  MapChart as EChartsMapChart,\n  GraphChart as EChartsGraphChart,\n  ParallelChart as EChartsParallelChart,\n  SankeyChart as EChartsSankeyChart,\n  SunburstChart as EChartsSunburstChart,\n  ThemeRiverChart,\n  TreeChart as EChartsTreeChart,\n} from 'echarts/charts'\nimport {\n  GridComponent,\n  PolarComponent,\n  TooltipComponent,\n  LegendComponent,\n  MarkLineComponent,\n  MarkAreaComponent,\n  MarkPointComponent,\n  GraphicComponent,\n  RadarComponent,\n  VisualMapComponent,\n  CalendarComponent,\n  DataZoomComponent,\n  ParallelComponent,\n  SingleAxisComponent,\n  TitleComponent,\n} from 'echarts/components'\nimport ReactECharts from 'echarts-for-react/esm/core'\nimport { cn } from '@/lib/utils'\n\nexport function heightToStyle(height: number | string): string {\n  return /^\\d+$/.test(String(height)) ? `${height}px` : String(height)\n}\n\ninterface ChartFrameProps {\n  height: number | string\n  className?: string\n  /** Apply the accessible role/tabindex/focus-ring chrome. Some chart\n   *  wrappers ship a bare `w-full` frame -- pass `false` for those. */\n  focusable?: boolean\n  /** Accessible name for role=\"img\". Defaults to \"Chart\". */\n  ariaLabel?: string\n}\n\n/** Shared `<div>` wrapper around the ECharts canvas. */\nexport const ChartFrame = React.forwardRef<HTMLDivElement, ChartFrameProps & { children: React.ReactNode }>(\n  ({ height, className, focusable = true, ariaLabel, children }, ref) => (\n    <div\n      ref={ref}\n      role=\"img\"\n      aria-label={ariaLabel || 'Chart'}\n      tabIndex={focusable ? 0 : undefined}\n      style={{ height: heightToStyle(height) }}\n      className={\n        focusable\n          ? cn('focus-visible:ring-ring w-full focus-visible:ring-2 focus-visible:outline-none', className)\n          : cn('w-full', className)\n      }\n    >\n      {children}\n    </div>\n  ),\n)\nChartFrame.displayName = 'ChartFrame'\n\n/** ECharts canvas filling its parent frame. */\nexport function EChart({ option }: { option: any }) {\n  return (\n    <ReactECharts\n      echarts={echartsCore as any}\n      option={option}\n      notMerge\n      lazyUpdate\n      style={{ width: '100%', height: '100%' }}\n    />\n  )\n}\n\nexport const echartsCoreModule = echartsCore\n\n// Register every chart type the wrappers need once at module load.\nuse([\n  CanvasRenderer,\n  EChartsLineChart,\n  EChartsBarChart,\n  EChartsPieChart,\n  EChartsScatterChart,\n  EChartsEffectScatter,\n  EChartsPictorialBar,\n  EChartsRadarChart,\n  EChartsGaugeChart,\n  EChartsHeatmap,\n  EChartsTreemapChart,\n  EChartsFunnelChart,\n  EChartsBoxplotChart,\n  EChartsCandlestickChart,\n  EChartsCustomChart,\n  EChartsChordChart,\n  EChartsMapChart,\n  EChartsGraphChart,\n  EChartsParallelChart,\n  EChartsSankeyChart,\n  EChartsSunburstChart,\n  ThemeRiverChart,\n  EChartsTreeChart,\n  GridComponent,\n  PolarComponent,\n  TooltipComponent,\n  LegendComponent,\n  MarkLineComponent,\n  MarkAreaComponent,\n  MarkPointComponent,\n  GraphicComponent,\n  RadarComponent,\n  VisualMapComponent,\n  CalendarComponent,\n  DataZoomComponent,\n  ParallelComponent,\n  SingleAxisComponent,\n  TitleComponent,\n])\n",
      "type": "registry:ui",
      "target": "~/components/ui/charts/shared.tsx"
    }
  ],
  "dependencies": [
    "echarts",
    "echarts-for-react"
  ],
  "devDependencies": [],
  "registryDependencies": [],
  "description": "React mirror of @uipkge/progress-ring-chart — see the Vue registry item for the canonical description.",
  "categories": [
    "chart"
  ]
}