{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "case-study-section-v2",
  "title": "Case Study Section v2",
  "description": "A case study with a headline above two columns. The left column has a rounded cover image. The right column has a summary and three results, each with a small SVG chart: a stepped adoption line, a burndown against a dashed plan, and a before-and-after stage timeline.",
  "registryDependencies": [
    "https://uiception.com/r/block-media.json"
  ],
  "files": [
    {
      "path": "registry/new-york/blocks/case-study-section-v2/page.tsx",
      "content": "import CaseStudySectionV2 from \"./components/case-study-section-v2\"\n\nexport default function Page() {\n  return <CaseStudySectionV2 />\n}\n",
      "type": "registry:page",
      "target": "app/case-study-section-v2/page.tsx"
    },
    {
      "path": "registry/new-york/blocks/case-study-section-v2/components/case-study-section-v2.tsx",
      "content": "import Image from \"next/image\"\n\nimport { createBlockImage } from \"@/lib/block-media\"\n\nimport { caseStudy, metrics } from \"../lib/config\"\nimport { MetricChart } from \"./metric-chart\"\n\nconst blockImage = createBlockImage(\"case-study-section-v2\")\n\nexport default function CaseStudySectionV2() {\n  return (\n    <section className=\"py-16 md:py-24\">\n      <div className=\"mx-auto max-w-6xl px-6\">\n        <h2 className=\"max-w-2xl text-3xl leading-[1.15] font-medium tracking-tight text-foreground md:text-4xl\">\n          {caseStudy.title}\n        </h2>\n\n        <div className=\"mt-10 grid gap-10 md:grid-cols-12 md:gap-12\">\n          <div className=\"relative aspect-4/3 overflow-hidden rounded-xl bg-muted md:col-span-7 md:aspect-auto md:min-h-96\">\n            <Image\n              src={blockImage(caseStudy.imageFile)}\n              alt={caseStudy.alt}\n              fill\n              unoptimized\n              priority\n              sizes=\"(max-width: 768px) 100vw, 640px\"\n              className=\"object-cover\"\n            />\n          </div>\n\n          <div className=\"flex flex-col md:col-span-5 md:justify-center\">\n            <p className=\"text-[0.9375rem] leading-relaxed text-muted-foreground\">\n              {caseStudy.summary}\n            </p>\n\n            <dl className=\"mt-8 divide-y divide-border\">\n              {metrics.map((metric) => (\n                <div\n                  key={metric.id}\n                  className=\"flex items-center justify-between gap-6 py-4\"\n                >\n                  <div className=\"flex min-w-0 flex-col-reverse gap-0.5\">\n                    <dt className=\"text-sm text-muted-foreground\">\n                      {metric.label}\n                    </dt>\n                    <dd className=\"text-xl font-medium tracking-tight text-foreground tabular-nums\">\n                      {metric.value}\n                    </dd>\n                  </div>\n                  <div\n                    aria-hidden\n                    className=\"aspect-[160/56] w-32 shrink-0 lg:w-40\"\n                  >\n                    <MetricChart chart={metric.chart} />\n                  </div>\n                </div>\n              ))}\n            </dl>\n          </div>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component",
      "target": "app/case-study-section-v2/components/case-study-section-v2.tsx"
    },
    {
      "path": "registry/new-york/blocks/case-study-section-v2/components/metric-chart.tsx",
      "content": "import type { MetricChart as MetricChartData } from \"../lib/config\"\n\n/** Every chart draws into the same 160×56 box so they line up in the list. */\nconst W = 160\nconst H = 56\nconst PLOT = { left: 2, right: W - 6, top: 8, bottom: 42 }\nconst TICK_Y = H - 3\n\nexport function MetricChart({ chart }: { chart: MetricChartData }) {\n  return (\n    <svg\n      viewBox={`0 0 ${W} ${H}`}\n      className=\"size-full overflow-visible text-[8px] tabular-nums\"\n    >\n      {chart.type === \"steps\" && (\n        <StepsChart values={chart.values} ticks={chart.ticks} />\n      )}\n      {chart.type === \"burndown\" && (\n        <BurndownChart values={chart.values} ticks={chart.ticks} />\n      )}\n      {chart.type === \"timeline\" && (\n        <TimelineChart rows={chart.rows} ticks={chart.ticks} />\n      )}\n    </svg>\n  )\n}\n\nfunction scaleX(index: number, count: number) {\n  return PLOT.left + (index / (count - 1)) * (PLOT.right - PLOT.left)\n}\n\nfunction scaleY(value: number, max: number) {\n  return PLOT.bottom - (value / max) * (PLOT.bottom - PLOT.top)\n}\n\nfunction Gridlines() {\n  return (\n    <g className=\"stroke-border\" strokeWidth={1}>\n      {[PLOT.top, (PLOT.top + PLOT.bottom) / 2].map((y) => (\n        <line\n          key={y}\n          x1={PLOT.left}\n          x2={PLOT.right}\n          y1={y}\n          y2={y}\n          strokeDasharray=\"2 3\"\n        />\n      ))}\n      <line x1={PLOT.left} x2={PLOT.right} y1={PLOT.bottom} y2={PLOT.bottom} />\n    </g>\n  )\n}\n\nfunction Ticks({ labels }: { labels: string[] }) {\n  return (\n    <g className=\"fill-muted-foreground\">\n      {labels.map((label, index) => (\n        <text\n          key={label}\n          x={scaleX(index, labels.length)}\n          y={TICK_Y}\n          textAnchor={\n            index === 0\n              ? \"start\"\n              : index === labels.length - 1\n                ? \"end\"\n                : \"middle\"\n          }\n        >\n          {label}\n        </text>\n      ))}\n    </g>\n  )\n}\n\nfunction EndPoint({ x, y }: { x: number; y: number }) {\n  return (\n    <>\n      <circle cx={x} cy={y} r={5} className=\"fill-foreground/10\" />\n      <circle\n        cx={x}\n        cy={y}\n        r={2.5}\n        className=\"fill-foreground stroke-background\"\n        strokeWidth={1.5}\n      />\n    </>\n  )\n}\n\nfunction StepsChart({ values, ticks }: { values: number[]; ticks: string[] }) {\n  const max = Math.max(...values)\n  const points = values.map((value, index) => ({\n    x: scaleX(index, values.length),\n    y: scaleY(value, max),\n  }))\n  const line = points\n    .map((point, index) =>\n      index === 0 ? `M${point.x},${point.y}` : `H${point.x}V${point.y}`\n    )\n    .join(\"\")\n  const last = points[points.length - 1]\n\n  return (\n    <>\n      <Gridlines />\n      <path d={`${line}V${PLOT.bottom}H${PLOT.left}Z`} className=\"fill-muted\" />\n      <path\n        d={line}\n        fill=\"none\"\n        className=\"stroke-foreground\"\n        strokeWidth={1.5}\n        strokeLinejoin=\"round\"\n      />\n      {points.slice(0, -1).map((point, index) => (\n        <circle\n          key={index}\n          cx={point.x}\n          cy={point.y}\n          r={1.25}\n          className=\"fill-muted-foreground\"\n        />\n      ))}\n      <EndPoint x={last.x} y={last.y} />\n      <Ticks labels={ticks} />\n    </>\n  )\n}\n\nfunction BurndownChart({\n  values,\n  ticks,\n}: {\n  values: number[]\n  ticks: string[]\n}) {\n  const max = values[0]\n  const points = values.map((value, index) => ({\n    x: scaleX(index, values.length),\n    y: scaleY(value, max),\n  }))\n  const line = points.map((point) => `${point.x},${point.y}`).join(\" \")\n  const last = points[points.length - 1]\n\n  return (\n    <>\n      <Gridlines />\n      <polygon\n        points={`${PLOT.left},${PLOT.bottom} ${line} ${last.x},${PLOT.bottom}`}\n        className=\"fill-muted\"\n      />\n      <line\n        x1={PLOT.left}\n        y1={PLOT.top}\n        x2={PLOT.right}\n        y2={PLOT.bottom}\n        className=\"stroke-muted-foreground\"\n        strokeWidth={1}\n        strokeDasharray=\"3 2\"\n      />\n      <polyline\n        points={line}\n        fill=\"none\"\n        className=\"stroke-foreground\"\n        strokeWidth={1.5}\n        strokeLinejoin=\"round\"\n        strokeLinecap=\"round\"\n      />\n      <EndPoint x={last.x} y={last.y} />\n      <text\n        x={PLOT.right}\n        y={PLOT.top - 2}\n        textAnchor=\"end\"\n        className=\"fill-muted-foreground\"\n      >\n        Plan\n      </text>\n      <Ticks labels={ticks} />\n    </>\n  )\n}\n\nconst TIMELINE = { labelWidth: 30, rowHeight: 9, rowGap: 7, segmentGap: 1.5 }\n\nfunction TimelineChart({\n  rows,\n  ticks,\n}: {\n  rows: { label: string; stages: number[] }[]\n  ticks: number[]\n}) {\n  const maxDays = Math.max(\n    ...rows.map((row) => row.stages.reduce((sum, days) => sum + days, 0)),\n    ...ticks\n  )\n  const x0 = TIMELINE.labelWidth\n  const dayWidth = (PLOT.right - x0) / maxDays\n  const rowsHeight =\n    rows.length * TIMELINE.rowHeight + (rows.length - 1) * TIMELINE.rowGap\n  const top = PLOT.top + (PLOT.bottom - PLOT.top - rowsHeight) / 2\n\n  return (\n    <>\n      <g className=\"stroke-border\" strokeWidth={1}>\n        {ticks.map((day) => (\n          <line\n            key={day}\n            x1={x0 + day * dayWidth}\n            x2={x0 + day * dayWidth}\n            y1={PLOT.top - 4}\n            y2={PLOT.bottom}\n            strokeDasharray={day === 0 ? undefined : \"2 3\"}\n          />\n        ))}\n      </g>\n\n      {rows.map((row, rowIndex) => {\n        const y = top + rowIndex * (TIMELINE.rowHeight + TIMELINE.rowGap)\n        const isCurrent = rowIndex === rows.length - 1\n        const total = row.stages.reduce((sum, days) => sum + days, 0)\n        const starts = row.stages.map((_, stageIndex) =>\n          row.stages.slice(0, stageIndex).reduce((sum, days) => sum + days, 0)\n        )\n\n        return (\n          <g key={row.label}>\n            <text\n              x={0}\n              y={y + TIMELINE.rowHeight - 1.5}\n              className={\n                isCurrent ? \"fill-foreground\" : \"fill-muted-foreground\"\n              }\n            >\n              {row.label}\n            </text>\n            {row.stages.map((days, stageIndex) => (\n              <rect\n                key={stageIndex}\n                x={x0 + starts[stageIndex] * dayWidth}\n                y={y}\n                width={days * dayWidth - TIMELINE.segmentGap}\n                height={TIMELINE.rowHeight}\n                rx={1.5}\n                className={\n                  isCurrent\n                    ? \"fill-foreground\"\n                    : stageIndex % 2 === 0\n                      ? \"fill-muted-foreground/40\"\n                      : \"fill-muted-foreground/25\"\n                }\n              />\n            ))}\n            {isCurrent && (\n              <text\n                x={x0 + total * dayWidth + 3}\n                y={y + TIMELINE.rowHeight - 1.5}\n                className=\"fill-foreground\"\n              >\n                {total}d\n              </text>\n            )}\n          </g>\n        )\n      })}\n\n      <g className=\"fill-muted-foreground\">\n        {ticks.map((day) => (\n          <text\n            key={day}\n            x={x0 + day * dayWidth}\n            y={TICK_Y}\n            textAnchor={day === 0 ? \"start\" : \"middle\"}\n          >\n            {day === 0 ? \"0\" : `${day}d`}\n          </text>\n        ))}\n      </g>\n    </>\n  )\n}\n",
      "type": "registry:component",
      "target": "app/case-study-section-v2/components/metric-chart.tsx"
    },
    {
      "path": "registry/new-york/blocks/case-study-section-v2/lib/config.ts",
      "content": "export const caseStudy = {\n  title: \"One identity system for Acme's twelve products.\",\n  summary:\n    \"Separate teams built Acme's products, and by last year they used four logo variants and nine type scales. We replaced them with one mark and a shared set of design tokens that every team now uses.\",\n  imageFile: \"image-1.jpg\",\n  alt: \"A brand mark on a soft gray background surrounded by paper shapes\",\n} as const\n\nexport type MetricChart =\n  /** Cumulative count that steps up once per period. */\n  | { type: \"steps\"; values: number[]; ticks: string[] }\n  /** Remaining work per period against a straight-line plan to zero. */\n  | { type: \"burndown\"; values: number[]; ticks: string[] }\n  /** Stage durations in days, before and after, drawn as segmented bars. */\n  | {\n      type: \"timeline\"\n      rows: { label: string; stages: number[] }[]\n      ticks: number[]\n    }\n\nexport type Metric = {\n  id: string\n  value: string\n  label: string\n  chart: MetricChart\n}\n\nexport const metrics: Metric[] = [\n  {\n    id: \"teams\",\n    value: \"14\",\n    label: \"Teams moved over in a year\",\n    chart: {\n      type: \"steps\",\n      values: [2, 3, 3, 5, 6, 8, 9, 11, 12, 14],\n      ticks: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n    },\n  },\n  {\n    id: \"assets\",\n    value: \"340+\",\n    label: \"Old brand assets retired in 12 weeks\",\n    chart: {\n      type: \"burndown\",\n      values: [352, 349, 341, 322, 297, 251, 196, 140, 88, 47, 24, 12],\n      ticks: [\"Wk 1\", \"Wk 12\"],\n    },\n  },\n  {\n    id: \"handoff\",\n    value: \"3 days\",\n    label: \"From design to code, down from 11\",\n    chart: {\n      type: \"timeline\",\n      rows: [\n        { label: \"Before\", stages: [4, 3, 4] },\n        { label: \"Now\", stages: [1, 1, 1] },\n      ],\n      ticks: [0, 5, 10],\n    },\n  },\n]\n",
      "type": "registry:lib",
      "target": "app/case-study-section-v2/lib/config.ts"
    },
    {
      "path": "public/images/blocks/case-study-section-v2/image-1.jpg.gitkeep",
      "content": "Place your asset here. Same base name, any supported format: jpg, jpeg, png, webp, avif, gif, or svg. Remove the .gitkeep extension from the filename.",
      "type": "registry:file",
      "target": "public/images/blocks/case-study-section-v2/image-1.jpg.gitkeep"
    }
  ],
  "type": "registry:block"
}