{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "case-study-story",
  "type": "registry:block",
  "title": "Case study, story",
  "description": "A narrative case study: headline, one wide photo, then two to four chapters side by side (Challenge, Approach, Result). Words first, no figure wall.",
  "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-story/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/case-study-story/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  media,\n  chapters: z.array(z.object({ label: t(30), title: t(80), text: t(420) })).min(2).max(4),\n  link,\n});\n\nexport const spec = defineSpec({\n  type: 'case-study-story',\n  aliases: ['case-study/story'],\n  name: 'Case study, story',\n  category: 'case-study',\n  role: 'body',\n  description: 'A narrative case study: headline, one wide photo, then two to four chapters side by side (Challenge, Approach, Result). Words first, no figure wall.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the section',\n    client: 'Name a client',\n    title: 'Say how the client went from one state to another',\n    media: { src: '', alt: 'A wide shot of the client or a result' },\n    chapters: [\n      { label: 'Name it', title: 'Name the problem in a few words', text: 'Say in two sentences what the client faced, how they worked and why they could not see it in time. Be concrete about what was missing.' },\n      { label: 'Name it', title: 'Name the approach in a few words', text: 'Say in two sentences what the client changed first, what they published and what they left alone. Keep it concrete.' },\n      { label: 'Name it', title: 'Name the result in a few words', text: 'Say in two sentences what the result was after a season, who it came from and what it replaced. Keep it concrete.' },\n    ],\n    link: { label: 'Read about this case', href: '/customers/client' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/case-study-story/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/case-study-story/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: '@3xl:grid-cols-2', 3: '@3xl:grid-cols-3', 4: '@3xl:grid-cols-2 @5xl:grid-cols-4' } as const;\n\nfunction CaseStudyStory({ props }: BlockProps<Props>) {\n  const id = useId();\n  const editing = useEditing();\n  const n = Math.min(4, Math.max(2, props.chapters.length)) as 2 | 3 | 4;\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        <Eyebrow path={['eyebrow']} value={props.eyebrow} />\n        <Opt path={['client']} value={props.client} as=\"p\" className=\"mb-3 text-kh-small font-medium text-kh-muted\" placeholder=\"Client\" />\n        <div id={id}>\n          <Text path={['title']} value={props.title} as=\"h2\" className=\"max-w-4xl text-kh-title font-semibold\" />\n        </div>\n        <Media path={['media']} value={props.media} ratio=\"21 / 9\" className=\"mt-12 rounded-kh-xl border border-kh-line\" />\n        <div className={cn('mt-12 grid gap-x-10 gap-y-10', COLS[n])}>\n          {props.chapters.map((c, i) => (\n            <section key={i} className=\"border-t border-kh-line-strong pt-5\">\n              <Text path={['chapters', i, 'label']} value={c.label} as=\"p\" className=\"text-kh-caption font-medium uppercase tracking-widest text-kh-accent-ink\" />\n              <Text path={['chapters', i, 'title']} value={c.title} as=\"h3\" className=\"mt-3 text-kh-heading font-semibold\" />\n              <Text path={['chapters', i, 'text']} value={c.text} as=\"p\" multiline className=\"mt-3 text-kh-body text-kh-muted\" />\n            </section>\n          ))}\n        </div>\n        {(props.link.label || editing) && (\n          <a href={safeHref(props.link.href)} className={cn(linkClass(), 'mt-10 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      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(CaseStudyStory);\n"
    }
  ]
}
