{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "uptime-tracker-chart",
  "title": "Uptime Tracker Chart",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-react/components/charts/uptime-tracker-chart/UptimeTrackerChart.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { ChartFrame } from '../shared'\n\n// UptimeTrackerChart — dependency-free status bars\n// ─────────────────────────────────────────────────────────────────────────\n\nexport type DayStatus = 'up' | 'degraded' | 'down' | 'unknown'\n\nexport interface StatusDay {\n  date: string\n  status: DayStatus\n}\n\nexport interface UptimeTrackerChartProps {\n  days: StatusDay[]\n  height?: number | string\n  /** Gap between bars in px. Default 2. */\n  gap?: number\n  /** Bar corner radius in px. Default 2. */\n  rounded?: number\n  /** Show the legend row with the computed uptime %. Default true. */\n  showLegend?: boolean\n  className?: string\n  /** Accessible name announced for the chart image. Defaults to \"Chart\". */\n  ariaLabel?: string\n}\n\nconst COLORS: Record<DayStatus, string> = {\n  up: 'var(--chart-2)',\n  degraded: 'var(--chart-4)',\n  down: 'var(--destructive)',\n  unknown: 'var(--border)',\n}\n\nexport const UptimeTrackerChart = React.forwardRef<HTMLDivElement, UptimeTrackerChartProps>(\n  ({ days, height = 48, gap = 2, rounded = 2, showLegend = true, className, ariaLabel }, ref) => {\n    const uptime = days.length\n      ? `${((days.filter((d) => d.status === 'up').length / days.length) * 100).toFixed(1)}%`\n      : '—'\n    const summary = `${days.filter((d) => d.status === 'up').length} up, ${days.filter((d) => d.status === 'degraded').length} degraded, ${days.filter((d) => d.status === 'down').length} down days`\n\n    return (\n      <ChartFrame\n        ref={ref}\n        height=\"auto\"\n        focusable\n        className={className}\n        ariaLabel={ariaLabel || `Uptime tracker: ${summary}`}\n      >\n        <div\n          className=\"flex min-h-6 w-full items-stretch\"\n          style={{ height: typeof height === 'number' ? `${height}px` : height, gap: `${gap}px` }}\n        >\n          {days.map((d, i) => (\n            <div\n              key={`${d.date}-${i}`}\n              className=\"min-w-0 flex-1\"\n              style={{ background: COLORS[d.status], borderRadius: `${rounded}px` }}\n              title={`${d.date} — ${d.status}`}\n            />\n          ))}\n        </div>\n        {showLegend && (\n          <div className=\"mt-2 flex items-center gap-3 text-xs\">\n            <span className=\"text-foreground font-semibold tabular-nums\">{uptime} uptime</span>\n            <span className=\"text-muted-foreground\">{days.length} days</span>\n            <span className=\"ml-auto flex items-center gap-2\">\n              <span className=\"flex items-center gap-1\">\n                <span className=\"size-2 rounded-[2px]\" style={{ background: COLORS.up }} />\n                Up\n              </span>\n              <span className=\"flex items-center gap-1\">\n                <span className=\"size-2 rounded-[2px]\" style={{ background: COLORS.degraded }} />\n                Degraded\n              </span>\n              <span className=\"flex items-center gap-1\">\n                <span className=\"size-2 rounded-[2px]\" style={{ background: COLORS.down }} />\n                Down\n              </span>\n            </span>\n          </div>\n        )}\n      </ChartFrame>\n    )\n  },\n)\nUptimeTrackerChart.displayName = 'UptimeTrackerChart'\n",
      "type": "registry:ui",
      "target": "~/components/ui/charts/uptime-tracker-chart/UptimeTrackerChart.tsx"
    },
    {
      "path": "packages/registry-react/components/charts/uptime-tracker-chart/index.ts",
      "content": "export { UptimeTrackerChart, type UptimeTrackerChartProps, type StatusDay, type DayStatus } from './UptimeTrackerChart'\n",
      "type": "registry:ui",
      "target": "~/components/ui/charts/uptime-tracker-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/uptime-tracker-chart — see the Vue registry item for the canonical description.",
  "categories": [
    "chart"
  ]
}