{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "case-study-metrics",
  "type": "registry:block",
  "title": "Case study, metrics",
  "description": "One customer story led by its numbers: headline and summary, a row of two to four big metrics, then a quote beside a photo and a link to the full story.",
  "categories": [
    "case-study"
  ],
  "dependencies": [
    "lucide-react@^1.49.0",
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/block-kit.json",
    "https://ui.klarhimmel.com/r/button.json",
    "https://ui.klarhimmel.com/r/editing.json",
    "https://ui.klarhimmel.com/r/text-link.json",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/case-study-metrics/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/case-study-metrics/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  eyebrow: t(60),\n  client: t(60),\n  title: t(140),\n  summary: t(400),\n  metrics: z.array(z.object({ value: t(20), label: t(80) })).min(2).max(4),\n  quote: t(320),\n  name: t(60),\n  role: t(80),\n  media,\n  link,\n});\n\nexport const spec = defineSpec({\n  type: 'case-study-metrics',\n  aliases: ['case-study/metrics'],\n  name: 'Case study, metrics',\n  category: 'case-study',\n  role: 'body',\n  description: 'One customer story led by its numbers: headline and summary, a row of two to four big metrics, then a quote beside a photo and a link to the full story.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the section',\n    client: 'Name a client',\n    title: 'Say what the client achieved, with a number, in a short line',\n    summary: 'Say in two sentences what the client struggled with, what they changed and what it did. Name the first change, then the second.',\n    metrics: [\n      { value: '0.0x', label: 'Name the first result' },\n      { value: '00%', label: 'Name the second result' },\n      { value: '00 min', label: 'Name the third result' },\n      { value: '0.0', label: 'Name the fourth result' },\n    ],\n    quote: 'Quote the client, in their words, on what changed for them in practice.',\n    name: 'Name a person',\n    role: 'Their role, and the business',\n    media: { src: '', alt: 'A close shot of the client at work, or of their result' },\n    link: { label: 'Read about this case', href: '/customers/client' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/case-study-metrics/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/case-study-metrics/index.tsx",
      "content": "import { useId } from 'react';\nimport { ArrowRight } from 'lucide-react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { safeHref } from '../../ui/button';\nimport { linkClass } from '../../ui/text-link';\nimport { Container, Eyebrow, Opt, Section, useEditing } from '../_shared/kit';\nimport { cn } from '../../lib/utils';\nimport { spec } from './spec';\nimport type { BlockProps } from '../types';\nimport type { z } from 'zod';\n\nexport { spec };\ntype Props = z.infer<typeof spec.schema>;\n\nconst COLS = { 2: '@md:grid-cols-2', 3: '@md:grid-cols-3', 4: '@md:grid-cols-2 @4xl:grid-cols-4' } as const;\n\nfunction CaseStudyMetrics({ props }: BlockProps<Props>) {\n  const id = useId();\n  const editing = useEditing();\n  const n = Math.min(4, Math.max(2, props.metrics.length)) as 2 | 3 | 4;\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        <div className=\"grid gap-6 @4xl:grid-cols-[1.2fr_1fr] @4xl:gap-20\">\n          <div>\n            <Eyebrow path={['eyebrow']} value={props.eyebrow} />\n            <div id={id}>\n              <Text path={['title']} value={props.title} as=\"h2\" className=\"text-kh-title font-semibold\" />\n            </div>\n          </div>\n          <div>\n            <Text path={['client']} value={props.client} as=\"p\" className=\"text-kh-small font-medium text-kh-muted\" />\n            <Opt path={['summary']} value={props.summary} multiline className=\"mt-2 text-kh-body text-kh-muted\" placeholder=\"Summary\" />\n          </div>\n        </div>\n        <dl className={cn('mt-12 grid grid-cols-1 divide-y divide-kh-line border-y border-kh-line @md:divide-x @md:divide-y-0', COLS[n])}>\n          {props.metrics.map((m, i) => (\n            <div key={i} className=\"flex flex-col-reverse justify-end gap-1 px-0 py-7 @md:px-7 @md:first:pl-0\">\n              <dt className=\"text-kh-small text-kh-muted\">\n                <Text path={['metrics', i, 'label']} value={m.label} as=\"span\" />\n              </dt>\n              <dd>\n                <Text path={['metrics', i, 'value']} value={m.value} as=\"span\" className={cn('font-semibold tabular-nums leading-none text-kh-accent-ink', n === 4 ? 'text-kh-title' : 'text-kh-display')} />\n              </dd>\n            </div>\n          ))}\n        </dl>\n        <div className=\"mt-12 grid items-center gap-8 @3xl:grid-cols-[1fr_1.2fr] @3xl:gap-14\">\n          <Media path={['media']} value={props.media} ratio=\"4 / 3\" className=\"rounded-kh-xl border border-kh-line\" />\n          <figure>\n            <blockquote>\n              <Text path={['quote']} value={props.quote} as=\"p\" multiline className=\"text-kh-lead font-medium leading-snug @3xl:text-kh-title @3xl:leading-tight\" />\n            </blockquote>\n            <figcaption className=\"mt-6 text-kh-small\">\n              <Text path={['name']} value={props.name} as=\"span\" className=\"block font-medium\" />\n              <Text path={['role']} value={props.role} as=\"span\" className=\"block text-kh-muted\" />\n            </figcaption>\n            {(props.link.label || editing) && (\n              <a href={safeHref(props.link.href)} className={cn(linkClass(), 'mt-6 inline-flex min-h-11 items-center gap-2 text-kh-small font-medium no-underline')}>\n                <Text path={['link', 'label']} value={props.link.label} as=\"span\" placeholder=\"Label\" />\n                <ArrowRight aria-hidden className=\"size-4\" />\n              </a>\n            )}\n          </figure>\n        </div>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(CaseStudyMetrics);\n"
    }
  ]
}
