{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "case-study-card",
  "type": "registry:block",
  "title": "Case studies, cards",
  "description": "A collection of up to twelve project cards in a responsive three-column grid: image, client, a headline figure with its label, a short summary and a link. featured makes the first one a full-width lead card with its picture beside the text.",
  "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/kit-c-proof.json",
    "https://ui.klarhimmel.com/r/kit-d-chrome.json",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/case-study-card/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/case-study-card/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  title: t(120),\n  description: t(300).optional(),\n  /** The first case is the lead: a full-width card with its picture beside the text, so a set of cards opens with one that differs (the rest fill rows of three best at 4 or 7 items). */\n  featured: z.boolean().optional(),\n  items: z.array(z.object({ client: t(60), figure: t(24), label: t(60), summary: t(240), link, media })).min(1).max(12),\n});\n\nexport const spec = defineSpec({\n  type: 'case-study-card',\n  aliases: ['case-study/card'],\n  name: 'Case studies, cards',\n  category: 'case-study',\n  role: 'body',\n  description: 'A collection of up to twelve project cards in a responsive three-column grid: image, client, a headline figure with its label, a short summary and a link. featured makes the first one a full-width lead card with its picture beside the text.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the topic',\n    title: 'Say what the work changed for clients',\n    items: [\n      { client: 'Name a client', figure: '00%', label: 'Name what improved', summary: 'Say what the client had before and what they have now, in one sentence.', link: { label: 'Read more', href: '#first' }, media: { src: '', alt: 'Show a report with one overall score and what it found' } },\n      { client: 'Name a client', figure: '0x', label: 'Name what improved', summary: 'Say what the client had before and what they have now, in one sentence.', link: { label: 'Read more', href: '#second' }, media: { src: '', alt: 'Show a calendar view with one day chosen' } },\n      { client: 'Name a client', figure: '00', label: 'Name what improved', summary: 'Say what the client had before and what they have now, in one sentence.', link: { label: 'Read more', href: '#third' }, media: { src: '', alt: 'Show a calendar view with one day chosen' } },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/case-study-card/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/case-study-card/index.tsx",
      "content": "import { ArrowRight } from 'lucide-react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { Container, Section, useEditing } from '../_shared/kit';\nimport { FOCUS } from '../_shared/d-chrome-kit';\nimport { Heading, useHeadingId } from '../_shared/c-proof-kit';\nimport { safeHref } from '../../ui/button';\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 = { 1: '', 2: '@2xl:grid-cols-2', 3: '@2xl:grid-cols-2 @4xl:grid-cols-3' } as const;\n\nfunction CaseStudyCard({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const editing = useEditing();\n  const n = Math.min(3, Math.max(1, props.items.length)) as 1 | 2 | 3;\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        <Heading id={id} eyebrow={props.eyebrow} title={props.title} description={props.description} />\n        <ul className={cn('mt-14 grid gap-5', COLS[n])}>\n          {props.items.map((item, i) => {\n            const linked = Boolean(item.link.label && item.link.href);\n            const Wrapper = linked ? 'a' : 'div';\n            const lead = props.featured && i === 0 && n > 1;\n            return (\n            <li key={i} className={cn('flex flex-col rounded-kh-xl border border-kh-line bg-kh-surface', lead && 'col-span-full', linked && 'transition-[transform,box-shadow,border-color] hover:-translate-y-1 hover:border-kh-accent hover:shadow-md motion-reduce:transform-none motion-reduce:transition-none')}>\n              <Wrapper {...(linked ? { href: safeHref(item.link.href), 'aria-label': item.figure || item.client || item.link.label } : {})} className={cn('flex flex-1 flex-col overflow-hidden rounded-kh-xl', lead && '@3xl:grid @3xl:grid-cols-2', linked && FOCUS)}>\n              <div className={cn('rounded-none border-b border-kh-line', lead && '@3xl:border-b-0 @3xl:border-r @3xl:[&_.kh-media]:h-full')}>\n                <Media path={['items', i, 'media']} value={item.media} ratio=\"16 / 10\" />\n              </div>\n              <article className={cn('flex flex-1 flex-col p-7', lead && '@3xl:justify-center @3xl:p-10')}>\n                <Text path={['items', i, 'client']} value={item.client} as=\"p\" className=\"text-kh-small font-medium text-kh-muted\" />\n                <p className=\"mt-5 flex flex-wrap items-baseline gap-x-3\">\n                  <Text path={['items', i, 'figure']} value={item.figure} as=\"span\" className={cn('font-semibold tabular-nums', lead ? 'text-kh-display' : 'text-kh-title')} />\n                  <Text path={['items', i, 'label']} value={item.label} as=\"span\" className=\"text-kh-small text-kh-muted\" />\n                </p>\n                <Text path={['items', i, 'summary']} value={item.summary} as=\"p\" className=\"mt-4 text-kh-body text-kh-muted\" />\n                {(item.link.label || editing) && (\n                  <div className=\"mt-auto inline-flex min-h-11 items-center gap-2 self-start pt-6 text-kh-small font-medium\">\n                    <Text path={['items', i, 'link', 'label']} value={item.link.label} as=\"span\" placeholder=\"Label\" />\n                    <ArrowRight aria-hidden className=\"size-4\" />\n                  </div>\n                )}\n              </article>\n              </Wrapper>\n            </li>\n          ); })}\n        </ul>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(CaseStudyCard);\n"
    }
  ]
}
