{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "feed-masonry",
  "type": "registry:block",
  "title": "Feed, two columns",
  "description": "A heading and a line over two columns of cards, each a picture as tall as its shape with a caption and a small arrow under it, fading out at the bottom. Use to show a body of work or many examples at a glance.",
  "categories": [
    "gallery"
  ],
  "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/feed-masonry/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/feed-masonry/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  title: t(48),\n  description: t(120),\n  items: z.array(z.object({\n    /** Frame shape: 'tall' 9:16 for a vertical clip, 'wide' 16:9 for a landscape one. Mix them; the two columns take the items in turn. */\n    shape: z.enum(['tall', 'wide']),\n    media,\n    /** One or two sentences on what this piece is and what it asked for; shown under the picture, with a small round arrow beside it. */\n    caption: t(160),\n  })).min(4).max(12),\n});\n\nconst item = (shape: 'tall' | 'wide', alt: string) => ({ shape, media: { src: '', alt }, caption: 'Say in a sentence or two what this piece is, who it was for and what it asked of you' });\n\nexport const spec = defineSpec({\n  type: 'feed-masonry',\n  aliases: ['gallery/feed-masonry'],\n  name: 'Feed, two columns',\n  category: 'gallery',\n  role: 'body',\n  description: 'A heading and a line over two columns of cards, each a picture as tall as its shape with a caption and a small arrow under it, fading out at the bottom. Use to show a body of work or many examples at a glance.',\n  schema,\n  defaults: {\n    title: 'Name what the wall shows',\n    description: 'Say whose work this is and what it has in common',\n    items: [\n      item('tall', 'A tall piece of work, as it was delivered'),\n      item('wide', 'A wide piece of work, as it was delivered'),\n      item('wide', 'A second wide piece, as it was delivered'),\n      item('tall', 'A second tall piece, as it was delivered'),\n      item('wide', 'A third wide piece, as it was delivered'),\n      item('tall', 'A third tall piece, as it was delivered'),\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/feed-masonry/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/feed-masonry/index.tsx",
      "content": "import { ArrowUp } from 'lucide-react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { Container, 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 RATIO = { tall: '9 / 16', wide: '16 / 9' } as const;\n\nfunction FeedMasonry({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  // Two columns on every width, the items dealt out in turn, so the original's phone arrangement holds too.\n  const columns = [0, 1].map((c) => props.items.map((item, i) => ({ item, i })).filter(({ i }) => i % 2 === c));\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        <div className=\"text-center\">\n          <div id={id}><Text path={['title']} value={props.title} as=\"h2\" className=\"text-kh-title font-semibold\" /></div>\n          <Text path={['description']} value={props.description} as=\"p\" multiline className=\"mt-3 text-kh-lead text-kh-muted\" />\n        </div>\n        <div className=\"mt-12 flex max-h-[76rem] gap-3 overflow-hidden [mask-image:linear-gradient(to_bottom,black_calc(100%-10rem),transparent)] @md:gap-5\">\n          {columns.map((col, c) => (\n            <ul key={c} className=\"flex min-w-0 flex-1 flex-col gap-3 @md:gap-5\">\n              {col.map(({ item, i }) => (\n                <li key={i}>\n                  <figure className=\"overflow-hidden rounded-kh-lg border border-kh-line bg-kh-surface shadow-kh-3\">\n                    <Media path={['items', i, 'media']} value={item.media} ratio={RATIO[item.shape]} />\n                    <figcaption className=\"flex items-end gap-3 p-4\">\n                      <Text path={['items', i, 'caption']} value={item.caption} as=\"p\" multiline className=\"min-w-0 flex-1 text-kh-small text-kh-muted\" />\n                      <span aria-hidden className=\"grid size-7 flex-none place-items-center rounded-kh-sm bg-kh-surface-2 text-kh-ink\">\n                        <ArrowUp className=\"size-4\" strokeWidth={1.5} aria-hidden=\"true\" />\n                      </span>\n                    </figcaption>\n                  </figure>\n                </li>\n              ))}\n            </ul>\n          ))}\n        </div>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(FeedMasonry);\n"
    }
  ]
}
