{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "features-bento-cards",
  "type": "registry:block",
  "title": "Features, bento cards",
  "description": "A centred heading and line over a bento grid of bordered cards in three rows: a tall picture card beside two icon cards, a wide picture card with a full-width button, then two icon cards beside a tall picture card. Every row stacks on a phone.",
  "categories": [
    "features"
  ],
  "dependencies": [
    "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/features-bento-cards/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/features-bento-cards/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, icon, link, media, t } from '../_shared/schema';\n\nconst pictureCard = z.object({\n  /** The picture fills the top of the card, the text sits below it. */\n  media,\n  title: t(40),\n  description: t(180),\n});\n\nconst iconCard = z.object({\n  icon,\n  title: t(40),\n  description: t(200),\n});\n\nconst schema = z.object({\n  title: t(60),\n  description: t(160),\n  /** Row one, left: a tall card with a picture on top. */\n  lead: pictureCard,\n  /** Row one, right: exactly two icon cards, stacked. */\n  sideCards: z.array(iconCard).min(2).max(2),\n  /** Row two: a wide card with a picture on the left, text and a full-width button on the right. */\n  wide: z.object({ media, title: t(40), description: t(180), action: link }),\n  /** Row three, left: exactly two icon cards, stacked. */\n  stackCards: z.array(iconCard).min(2).max(2),\n  /** Row three, right: a tall card with a picture above its text. */\n  tall: pictureCard,\n});\n\nexport const spec = defineSpec({\n  type: 'features-bento-cards',\n  aliases: ['features/bento-cards'],\n  name: 'Features, bento cards',\n  category: 'features',\n  role: 'body',\n  description: 'A centred heading and line over a bento grid of bordered cards in three rows: a tall picture card beside two icon cards, a wide picture card with a full-width button, then two icon cards beside a tall picture card. Every row stacks on a phone.',\n  schema,\n  defaults: {\n    title: 'Say what the benefits add up to',\n    description: 'Say in one or two sentences what changes for the reader and what the reader can do about it.',\n    lead: { media: { src: '', alt: 'Show the shift the reader is living through' }, title: 'Name the shift', description: 'Say in two lines what is changing and what the reader sees of it.' },\n    sideCards: [\n      { icon: 'zap', title: 'Name the first benefit', description: 'Say in a sentence or two what the reader gains and how soon.' },\n      { icon: 'shield', title: 'Name the second benefit', description: 'Say in a sentence or two what the reader gains and what it protects.' },\n    ],\n    wide: { media: { src: '', alt: 'Show the idea at the centre of the offer' }, title: 'Name the central idea', description: 'Say in two lines what the idea is and why the old way is not enough.', action: { label: 'Take the next step', href: '#next' } },\n    stackCards: [\n      { icon: 'chart', title: 'Name the third benefit', description: 'Say in a sentence or two what the reader gets back from it.' },\n      { icon: 'layers', title: 'Name the fourth benefit', description: 'Say in a sentence or two how the reader can measure it.' },\n    ],\n    tall: { media: { src: '', alt: 'Show what the reader misses without this' }, title: 'Name the cost of waiting', description: 'Say in two lines what the reader loses by not acting.' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/features-bento-cards/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/features-bento-cards/index.tsx",
      "content": "import { Media, Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Icon, Section } from '../_shared/kit';\nimport { 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\nconst card = 'overflow-hidden rounded-kh-lg border border-kh-line bg-kh-surface';\n\nfunction PictureCard({ path, c }: { path: (string | number)[]; c: Props['lead'] }) {\n  return (\n    <article className={`${card} flex flex-col`}>\n      <Media path={[...path, 'media']} value={c.media} ratio=\"4 / 3\" className=\"w-full\" />\n      <div className=\"flex flex-col gap-2 p-7\">\n        <Text path={[...path, 'title']} value={c.title} as=\"h3\" className=\"text-kh-heading font-semibold\" />\n        <Text path={[...path, 'description']} value={c.description} as=\"p\" multiline className=\"text-kh-muted\" />\n      </div>\n    </article>\n  );\n}\n\nfunction IconCard({ path, c }: { path: (string | number)[]; c: Props['sideCards'][number] }) {\n  return (\n    <article className={`${card} flex flex-1 flex-col justify-center gap-3 p-7`}>\n      <span className=\"grid size-12 place-items-center rounded-kh-md bg-kh-accent-soft text-kh-accent\">\n        <Icon name={c.icon} />\n      </span>\n      <Text path={[...path, 'title']} value={c.title} as=\"h3\" className=\"mt-2 text-kh-heading font-semibold\" />\n      <Text path={[...path, 'description']} value={c.description} as=\"p\" multiline className=\"text-kh-muted\" />\n    </article>\n  );\n}\n\nfunction FeaturesBentoCards({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  return (\n    <Section labelledBy={id}>\n      <div className=\"mx-auto w-full max-w-[75rem] px-kh-gutter\">\n        <div id={id}>\n          <Text path={['title']} value={props.title} as=\"h2\" className=\"text-center text-kh-display font-semibold leading-[1.1] tracking-tight\" />\n        </div>\n        <Text path={['description']} value={props.description} as=\"p\" multiline className=\"mx-auto mt-4 max-w-kh-lead text-center text-kh-lead text-kh-muted\" />\n        <div className=\"mt-12 flex flex-col gap-5\">\n          <div className=\"grid gap-5 @4xl:grid-cols-5\">\n            <div className=\"flex flex-col @4xl:col-span-2 [&>article]:flex-1\">\n              <PictureCard path={['lead']} c={props.lead} />\n            </div>\n            <div className=\"flex flex-col gap-5 @4xl:col-span-3\">\n              {props.sideCards.slice(0, 2).map((c, i) => <IconCard key={i} path={['sideCards', i]} c={c} />)}\n            </div>\n          </div>\n          <article className={`${card} grid @4xl:grid-cols-2`}>\n            <Media path={['wide', 'media']} value={props.wide.media} ratio=\"4 / 3\" className=\"h-full w-full\" />\n            <div className=\"flex flex-col gap-2 p-7\">\n              <Text path={['wide', 'title']} value={props.wide.title} as=\"h3\" className=\"text-kh-heading font-semibold\" />\n              <Text path={['wide', 'description']} value={props.wide.description} as=\"p\" multiline className=\"text-kh-muted\" />\n              <div className=\"mt-auto pt-10 [&_a]:w-full [&_a]:justify-center\">\n                <ActionLink path={['wide', 'action']} value={props.wide.action} variant=\"primary\" className=\"w-full justify-center\" />\n              </div>\n            </div>\n          </article>\n          <div className=\"grid gap-5 @4xl:grid-cols-5\">\n            <div className=\"flex flex-col gap-5 @4xl:col-span-3\">\n              {props.stackCards.slice(0, 2).map((c, i) => <IconCard key={i} path={['stackCards', i]} c={c} />)}\n            </div>\n            <div className=\"flex flex-col @4xl:col-span-2 [&>article]:flex-1\">\n              <PictureCard path={['tall']} c={props.tall} />\n            </div>\n          </div>\n        </div>\n      </div>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(FeaturesBentoCards);\n"
    }
  ]
}
