{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "waffle-chart",
  "type": "registry:ui",
  "title": "Waffle chart",
  "description": "Waffle chart that fills a 10 column grid of squares to show a value out of a total, with a label and count above. Clear for adoption rates and percentages.",
  "dependencies": [],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/ui/waffle-chart.tsx",
      "type": "registry:ui",
      "target": "components/ui/waffle-chart.tsx",
      "content": "\"use client\"\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nfunction WaffleChart({\n  value = 42,\n  total = 100,\n  label = \"Adoption\",\n  className,\n}: {\n  value?: number\n  total?: number\n  label?: string\n  className?: string\n}) {\n  const cells = Array.from({ length: total }, (_, i) => i < value)\n  return (\n    <div data-slot=\"waffle-chart\" className={cn(\"space-y-2\", className)}>\n      <div className=\"flex justify-between text-xs\">\n        <span className=\"font-medium text-fg\">{label}</span>\n        <span className=\"tabular-nums text-fg-muted\">{value}/{total}</span>\n      </div>\n      <div className=\"grid grid-cols-10 gap-1\" role=\"img\" aria-label={`${label}: ${value} of ${total}`}>\n        {cells.map((on, i) => (\n          <div key={i} className={cn(\"aspect-square rounded-[2px]\", on ? \"bg-accent\" : \"bg-sunken\")} />\n        ))}\n      </div>\n    </div>\n  )\n}\nexport { WaffleChart }\n"
    }
  ]
}
