{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "blog-post",
  "type": "registry:block",
  "title": "Blog, post",
  "description": "An article: category, title, date and reading time, author, cover image and a reading column of body text.",
  "categories": [
    "blog"
  ],
  "dependencies": [
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/badge.json",
    "https://ui.klarhimmel.com/r/block-kit.json",
    "https://ui.klarhimmel.com/r/editing.json"
  ],
  "files": [
    {
      "path": "src/blocks/blog-post/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/blog-post/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  category: t(30),\n  title: t(140),\n  meta: t(80),\n  author: z.object({ name: t(60), role: t(80), photo: media }),\n  cover: media,\n  body: t(12000).describe('Markdown prose: paragraphs separated by blank lines, ## section headings, ### subheadings, bullet lists, bold, code, links (https or the site\\'s own /pages) and a paragraph that is only ![alt](src) as a picture. Raw HTML stays text.'),\n});\n\nexport const spec = defineSpec({\n  type: 'blog-post',\n  aliases: ['blog/post'],\n  name: 'Blog, post',\n  category: 'blog',\n  role: 'body',\n  description: 'An article: category, title, date and reading time, author, cover image and a reading column of body text.',\n  schema,\n  defaults: {\n    category: 'Category',\n    title: 'Say what the post is about, as a title',\n    meta: '1 Jan 0000 · 0 min read',\n    author: { name: 'Name a person', role: 'Their role and company', photo: { src: '', alt: 'A portrait of the person' } },\n    cover: { src: '', alt: 'Show what the post is about, in one picture' },\n    body: 'Open with the problem the reader knows well, and say plainly why it matters to them and what usually goes wrong.\\n\\nGive the way you do it, in two or three plain sentences, with the steps in the order they happen and the one question that guides each.\\n\\nSay one practical thing they can do before they start, and why it matters more than it seems to.\\n\\nClose with a short line that leaves them with one thing to remember, and an invitation if there is one.',\n  },\n});\n"
    },
    {
      "path": "src/blocks/blog-post/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/blog-post/index.tsx",
      "content": "import { useId } from 'react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { Badge } from '../../ui/badge';\nimport { Container, Section } from '../_shared/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 BlogPost({ props }: BlockProps<Props>) {\n  const id = useId();\n  return (\n    <Section labelledBy={id} className=\"pb-kh-section pt-12 @3xl:pt-16\">\n      <Container width=\"narrow\">\n        <article>\n          <header className=\"mx-auto max-w-kh-prose\">\n            <div className=\"flex flex-wrap items-center gap-3\">\n              <Badge tone=\"accent\">\n                <Text path={['category']} value={props.category} as=\"span\" />\n              </Badge>\n              <Text path={['meta']} value={props.meta} as=\"span\" className=\"text-kh-small text-kh-muted\" />\n            </div>\n            <div id={id}>\n              <Text path={['title']} value={props.title} as=\"h1\" className=\"mt-5 text-kh-title font-semibold leading-tight text-balance\" />\n            </div>\n            <div className=\"mt-8 flex items-center gap-3\">\n              <div className=\"size-11 shrink-0 overflow-hidden rounded-kh-pill\">\n                <Media path={['author', 'photo']} value={props.author.photo} ratio=\"1 / 1\" />\n              </div>\n              <div>\n                <Text path={['author', 'name']} value={props.author.name} as=\"p\" className=\"text-kh-small font-medium\" />\n                <Text path={['author', 'role']} value={props.author.role} as=\"p\" className=\"text-kh-caption text-kh-muted\" />\n              </div>\n            </div>\n          </header>\n          <div className=\"mt-12 overflow-hidden rounded-kh-xl border border-kh-line\">\n            <Media path={['cover']} value={props.cover} ratio=\"16 / 9\" />\n          </div>\n          <Text path={['body']} value={props.body} as=\"div\" multiline markdown className=\"mx-auto mt-12 max-w-kh-prose text-[calc(var(--kh-size)*1.125)] leading-[1.7] text-kh-ink-2\" />\n        </article>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(BlogPost);\n"
    }
  ]
}
