{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "case-study-before-after",
  "type": "registry:block",
  "title": "Case study, before and after",
  "description": "One dated result: client, a metric name, a before and an after figure, a short story, a link and an image.",
  "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/editing.json",
    "https://ui.klarhimmel.com/r/kit-c-proof.json"
  ],
  "files": [
    {
      "path": "src/blocks/case-study-before-after/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/case-study-before-after/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, t } from '../_shared/schema';\n\nconst figure = z.object({\n  label: t(40).describe('Recommended maximum: 16 characters. Use a short label such as Before or After.'),\n  value: t(24).describe('Recommended maximum: 12 characters. Use a compact figure such as 30 hours, not a sentence.'),\n}).describe('Recommended: label at most 16 characters and value at most 12. Put context in the summary.');\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: t(120),\n  client: t(60),\n  date: t(30),\n  metric: t(80).describe('Recommended maximum: 48 characters. Name the measurement, not the whole result.'),\n  showComparison: z.boolean().optional().describe('Show the metric and before/after strip. Defaults to true; false leaves only the illustration.'),\n  before: figure,\n  after: figure,\n  summary: t(300),\n  link,\n  media,\n});\n\nexport const spec = defineSpec({\n  type: 'case-study-before-after',\n  aliases: ['case-study/before-after'],\n  name: 'Case study, before and after',\n  category: 'case-study',\n  role: 'body',\n  description: 'One dated result: client, a metric name, a before and an after figure, a short story, a link and an image.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the section',\n    title: 'Say what changed, from what to what',\n    client: 'Name a client',\n    date: 'Season and year',\n    metric: 'Name what was measured over time',\n    before: { label: 'Before', value: '00 units' },\n    after: { label: 'After', value: '00 units' },\n    summary: 'Say in two sentences what the client did before and what they tried, then what changed. Say who reviews the result now, and how.',\n    link: { label: 'Read about this case', href: '#client' },\n    media: { src: '', alt: 'Show a report with one overall score and what it found' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/case-study-before-after/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/case-study-before-after/index.tsx",
      "content": "import { ArrowDown, ArrowRight } from 'lucide-react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Container, Opt, Section, useEditing } from '../_shared/kit';\nimport { Heading, useHeadingId } from '../_shared/c-proof-kit';\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\nfunction CaseStudyBeforeAfter({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const editing = useEditing();\n  const showComparison = props.showComparison !== false || editing;\n  return (\n    <Section labelledBy={id}>\n      <Container className=\"grid items-center gap-12 @4xl:grid-cols-[1fr_1.1fr] @4xl:gap-16\">\n        <div>\n          <Heading id={id} eyebrow={props.eyebrow} title={props.title} />\n          <p className=\"mt-5 flex flex-wrap items-center gap-x-3 text-kh-small text-kh-muted\">\n            <Text path={['client']} value={props.client} as=\"span\" className=\"font-medium text-kh-ink\" />\n            <Opt path={['date']} value={props.date} as=\"span\" className=\"before:mr-3 before:content-['/'] before:text-kh-line-strong\" placeholder=\"Date\" />\n          </p>\n          <Text path={['summary']} value={props.summary} as=\"p\" multiline className=\"mt-6 max-w-kh-lead text-kh-lead text-kh-muted\" />\n          <ActionLink path={['link']} value={props.link} variant=\"secondary\" size=\"md\" className=\"mt-8\" />\n        </div>\n        <div className=\"@container/comparison overflow-hidden rounded-kh-xl border border-kh-line bg-kh-surface\">\n          <div className={showComparison ? 'rounded-none border-b border-kh-line' : 'rounded-none'}>\n            <Media path={['media']} value={props.media} ratio=\"16 / 9\" />\n          </div>\n          {showComparison && <div>\n          <Opt path={['metric']} value={props.metric} className=\"border-b border-kh-line px-7 py-4 text-kh-small font-medium text-kh-ink-2\" placeholder=\"Metric\" />\n          <dl className=\"grid items-stretch @min-[30rem]/comparison:grid-cols-[1fr_auto_1fr]\">\n            <div className=\"min-w-0 p-5 @min-[30rem]/comparison:p-7\">\n              <dt className=\"text-kh-small text-kh-muted\">\n                <Text path={['before', 'label']} value={props.before.label} as=\"span\" className=\"text-kh-caption font-medium uppercase tracking-wider\" />\n              </dt>\n              <dd className=\"mt-3 text-kh-heading @min-[30rem]/comparison:text-kh-title font-semibold tabular-nums text-kh-muted\">\n                <Text path={['before', 'value']} value={props.before.value} as=\"span\" className=\"[overflow-wrap:anywhere]\" />\n              </dd>\n            </div>\n            <div aria-hidden className=\"flex items-center justify-center border-y border-kh-line px-2 py-1 text-kh-muted @min-[30rem]/comparison:border-x @min-[30rem]/comparison:border-y-0 @min-[30rem]/comparison:px-5 @min-[30rem]/comparison:py-0\">\n              <ArrowDown className=\"size-5 @min-[30rem]/comparison:hidden\" />\n              <ArrowRight className=\"hidden size-5 @min-[30rem]/comparison:block\" />\n            </div>\n            <div className=\"min-w-0 bg-kh-accent-soft p-5 @min-[30rem]/comparison:p-7\">\n              <dt className=\"text-kh-small text-kh-accent-ink\">\n                <Text path={['after', 'label']} value={props.after.label} as=\"span\" className=\"text-kh-caption font-medium uppercase tracking-wider\" />\n              </dt>\n              <dd className=\"mt-3 text-kh-heading @min-[30rem]/comparison:text-kh-title font-semibold tabular-nums text-kh-accent-ink\">\n                <Text path={['after', 'value']} value={props.after.value} as=\"span\" className=\"[overflow-wrap:anywhere]\" />\n              </dd>\n            </div>\n          </dl>\n          </div>}\n        </div>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(CaseStudyBeforeAfter);\n"
    }
  ]
}
