{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "stats-section-v6",
  "title": "Stats Section v6",
  "description": "A support stats section with a bento grid of waffle charts. The left column has the title and description. The right column has one tile per support channel, sized by rank, with its share, wait time, and a small 10 by 10 grid. Each grid lights only that channel's squares, in the same spots they hold in the full 100, so the four grids add up to one chart. The two smallest channels show only the two rows that hold their squares, drawn at full tile width so they read at the same scale as the others. Lit squares fill in on load, then breathe in a slow diagonal shimmer. Static data, no API.",
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/new-york/blocks/stats-section-v6/page.tsx",
      "content": "import StatsSectionV6 from \"./components/stats-section-v6\"\n\nexport default function Page() {\n  return <StatsSectionV6 />\n}\n",
      "type": "registry:page",
      "target": "app/stats-section-v6/page.tsx"
    },
    {
      "path": "registry/new-york/blocks/stats-section-v6/components/stats-section-v6.tsx",
      "content": "import { groups, sectionHeader } from \"../lib/config\"\nimport { type TileSize, TierTile } from \"./tier-tile\"\nimport \"../styles/stats-section-v6.css\"\n\n/** Bento placement by rank: the biggest group gets the big tile. */\nconst tiles: { size: TileSize; className: string }[] = [\n  { size: \"feature\", className: \"col-span-2 md:row-span-2\" },\n  { size: \"wide\", className: \"col-span-2\" },\n  { size: \"compact\", className: \"col-span-1\" },\n  { size: \"compact\", className: \"col-span-1\" },\n]\n\nexport default function StatsSectionV6() {\n  return (\n    <section className=\"py-16 md:py-24\">\n      <div className=\"mx-auto grid max-w-6xl gap-12 px-6 lg:grid-cols-12\">\n        <div className=\"flex flex-col lg:col-span-4\">\n          <h2 className=\"text-3xl leading-[1.15] font-medium tracking-tight text-foreground md:text-4xl\">\n            {sectionHeader.title}\n          </h2>\n          <p className=\"mt-4 text-[0.9375rem] leading-relaxed text-muted-foreground\">\n            {sectionHeader.description}\n          </p>\n        </div>\n\n        <dl className=\"grid grid-cols-2 gap-px border border-border bg-border md:grid-cols-4 md:grid-rows-[repeat(2,16rem)] lg:col-span-8\">\n          {groups.map((group, index) => (\n            <TierTile\n              key={group.id}\n              group={group}\n              groupIndex={index}\n              size={tiles[index].size}\n              className={tiles[index].className}\n            />\n          ))}\n        </dl>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component",
      "target": "app/stats-section-v6/components/stats-section-v6.tsx"
    },
    {
      "path": "registry/new-york/blocks/stats-section-v6/components/tier-tile.tsx",
      "content": "import { cn } from \"@/lib/utils\"\n\nimport { type Group, zoomWindow } from \"../lib/config\"\nimport { MiniWaffle } from \"./mini-waffle\"\n\nexport type TileSize = \"feature\" | \"wide\" | \"compact\"\n\nconst tileClass = \"flex flex-col justify-between gap-6 bg-background p-5\"\n\nconst valueClass =\n  \"leading-none font-semibold tracking-tight text-foreground tabular-nums\"\n\nfunction TileLabel({ group, className }: { group: Group; className?: string }) {\n  return (\n    <dt className={cn(\"flex flex-col text-base\", className)}>\n      <span className=\"font-medium text-foreground\">{group.channel}</span>\n      <span className=\"text-muted-foreground\">{group.wait}</span>\n    </dt>\n  )\n}\n\nexport function TierTile({\n  group,\n  groupIndex,\n  size,\n  className,\n}: {\n  group: Group\n  groupIndex: number\n  size: TileSize\n  className?: string\n}) {\n  if (size === \"wide\") {\n    return (\n      // On desktop the tile is a two-column grid: label above value on the\n      // left, chart on the right. The chart column shrinks before it can\n      // overlap the label. `md:contents` lets the dd's children join the grid.\n      <div\n        className={cn(\n          tileClass,\n          \"md:grid md:grid-cols-[auto_minmax(0,1fr)] md:grid-rows-[auto_1fr] md:gap-x-6\",\n          className\n        )}\n      >\n        <TileLabel group={group} className=\"md:col-start-1 md:row-start-1\" />\n        <dd className=\"flex items-center justify-between gap-6 md:contents\">\n          <span\n            className={cn(\n              valueClass,\n              \"text-4xl md:col-start-1 md:row-start-2 md:self-end md:text-5xl\"\n            )}\n          >\n            {group.share}%\n          </span>\n          <MiniWaffle\n            groupIndex={groupIndex}\n            className=\"w-44 gap-[3px] md:col-start-2 md:row-span-2 md:row-start-1 md:w-full md:max-w-44 md:self-center md:justify-self-end\"\n          />\n        </dd>\n      </div>\n    )\n  }\n\n  // The feature and compact tiles read top to bottom: label, grid, value.\n  // Their values sit on the bottom edge, so they line up across the row.\n  // The compact tiles hold too few squares to read in a full grid, so they\n  // draw only the band of rows that holds them, at full tile width.\n  const isFeature = size === \"feature\"\n\n  return (\n    <div className={cn(tileClass, className)}>\n      <TileLabel group={group} />\n      <dd\n        className={cn(\n          \"flex gap-6 md:flex-1 md:flex-col md:items-start\",\n          isFeature\n            ? \"flex-row-reverse items-center justify-between\"\n            : \"flex-col\"\n        )}\n      >\n        <span className=\"flex w-full items-center md:flex-1\">\n          {isFeature ? (\n            <MiniWaffle\n              groupIndex={groupIndex}\n              className=\"ml-auto w-44 max-w-full gap-[3px] md:ml-0 md:w-64\"\n            />\n          ) : (\n            <MiniWaffle\n              groupIndex={groupIndex}\n              rows={zoomWindow(groupIndex)}\n              className=\"-mx-2 w-[calc(100%+1rem)] gap-[2px]\"\n            />\n          )}\n        </span>\n        <span\n          className={cn(\n            valueClass,\n            \"shrink-0\",\n            isFeature ? \"text-5xl md:text-6xl\" : \"text-3xl md:text-4xl\"\n          )}\n        >\n          {group.share}%\n        </span>\n      </dd>\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "app/stats-section-v6/components/tier-tile.tsx"
    },
    {
      "path": "registry/new-york/blocks/stats-section-v6/components/mini-waffle.tsx",
      "content": "import type { CSSProperties } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { cellOrder, cells, GRID_SIZE, groups } from \"../lib/config\"\n\n/** Delay between lit squares in the fill-in, in milliseconds. */\nconst FILL_STEP_MS = 10\n/** Delay per diagonal step in the breathing shimmer, in milliseconds. */\nconst SHIMMER_STEP_MS = 120\n\nexport type RowWindow = { start: number; count: number }\n\n/**\n * A 10-column grid that lights only one group's squares, in the same spots\n * they hold in the full 100. Laid side by side, the four grids add up to one\n * chart. `rows` draws only a band of rows, for groups too small to read in\n * the full grid.\n */\nexport function MiniWaffle({\n  groupIndex,\n  rows = { start: 0, count: GRID_SIZE },\n  className,\n}: {\n  groupIndex: number\n  rows?: RowWindow\n  className?: string\n}) {\n  const color = groups[groupIndex].color\n  const first = rows.start * GRID_SIZE\n  const visible = cells.slice(first, first + rows.count * GRID_SIZE)\n\n  return (\n    <div aria-hidden className={cn(\"shrink-0\", className)}>\n      <div className=\"grid grid-cols-10 gap-[inherit]\">\n        {visible.map((cellGroup, offset) => {\n          const index = first + offset\n\n          if (cellGroup !== groupIndex) {\n            return (\n              <span\n                key={index}\n                className=\"aspect-square rounded-[2px] bg-muted\"\n              />\n            )\n          }\n\n          return (\n            <span\n              key={index}\n              className=\"ssv6-dot aspect-square rounded-[2px]\"\n              style={\n                {\n                  backgroundColor: color,\n                  \"--ssv6-fill-delay\": `${cellOrder[index] * FILL_STEP_MS}ms`,\n                  \"--ssv6-shimmer-delay\": `${\n                    ((index % GRID_SIZE) + Math.floor(index / GRID_SIZE)) *\n                    SHIMMER_STEP_MS\n                  }ms`,\n                } as CSSProperties\n              }\n            />\n          )\n        })}\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "app/stats-section-v6/components/mini-waffle.tsx"
    },
    {
      "path": "registry/new-york/blocks/stats-section-v6/lib/config.ts",
      "content": "export const sectionHeader = {\n  title: \"Most customers get an answer in under five minutes.\",\n  description:\n    \"We tracked the last 10,000 support requests to Acme. In each grid, one square is one customer out of 100.\",\n} as const\n\nexport type Group = {\n  id: string\n  /** Where the customer got their answer. */\n  channel: string\n  /** How long they waited for it. */\n  wait: string\n  /** Customers out of 100. The four shares add up to 100. */\n  share: number\n  /** One teal hue, lightest for the fastest answer. Reads on light and dark backgrounds. */\n  color: string\n}\n\nexport const groups: Group[] = [\n  {\n    id: \"help-center\",\n    channel: \"Help center\",\n    wait: \"Instant\",\n    share: 64,\n    color: \"oklch(0.82 0.11 190)\",\n  },\n  {\n    id: \"chat\",\n    channel: \"Live chat\",\n    wait: \"Under 5 minutes\",\n    share: 24,\n    color: \"oklch(0.68 0.12 195)\",\n  },\n  {\n    id: \"email\",\n    channel: \"Email\",\n    wait: \"Same day\",\n    share: 9,\n    color: \"oklch(0.54 0.11 205)\",\n  },\n  {\n    id: \"engineer\",\n    channel: \"Engineer\",\n    wait: \"Within 2 days\",\n    share: 3,\n    color: \"oklch(0.42 0.09 215)\",\n  },\n]\n\nexport const GRID_SIZE = 10\n\n/** One entry per square, filled row by row from the fastest group to the slowest. */\nexport const cells: number[] = groups.flatMap((group, groupIndex) =>\n  Array.from({ length: group.share }, () => groupIndex)\n)\n\n/** Rows shown in the zoomed-in view for the smallest groups. */\nexport const ZOOM_ROWS = 2\n\n/** The band of rows that holds a group's squares, kept inside the grid. */\nexport function zoomWindow(groupIndex: number) {\n  const firstRow = Math.floor(cells.indexOf(groupIndex) / GRID_SIZE)\n  return {\n    start: Math.min(firstRow, GRID_SIZE - ZOOM_ROWS),\n    count: ZOOM_ROWS,\n  }\n}\n\n/** Each square's position within its own group, used to stagger animations. */\nexport const cellOrder: number[] = groups.flatMap((group) =>\n  Array.from({ length: group.share }, (_, index) => index)\n)\n",
      "type": "registry:lib",
      "target": "app/stats-section-v6/lib/config.ts"
    },
    {
      "path": "registry/new-york/blocks/stats-section-v6/styles/stats-section-v6.css",
      "content": "/* Lit squares fill in one after another, then breathe. The breathing delay\n   follows the square's diagonal, so a slow shimmer sweeps across each grid.\n   `backwards` applies the fill's start state during its delay. */\n.ssv6-dot {\n  animation:\n    ssv6-fill 420ms cubic-bezier(0.22, 1, 0.36, 1) var(--ssv6-fill-delay, 0ms)\n      backwards,\n    ssv6-breathe 3.6s ease-in-out calc(var(--ssv6-shimmer-delay, 0ms) + 1200ms)\n      infinite;\n}\n\n@keyframes ssv6-fill {\n  from {\n    opacity: 0;\n    transform: scale(0.4);\n  }\n  to {\n    opacity: 1;\n    transform: scale(1);\n  }\n}\n\n@keyframes ssv6-breathe {\n  0%,\n  100% {\n    opacity: 1;\n  }\n  50% {\n    opacity: 0.55;\n  }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .ssv6-dot {\n    animation: none;\n  }\n}\n",
      "type": "registry:file",
      "target": "app/stats-section-v6/styles/stats-section-v6.css"
    }
  ],
  "type": "registry:block"
}