{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "blog-list",
  "type": "registry:block",
  "title": "Blog, list",
  "description": "Post rows with date, title, excerpt and category, plus a link to the full archive.",
  "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/button.json",
    "https://ui.klarhimmel.com/r/editing.json",
    "https://ui.klarhimmel.com/r/kit-d-chrome.json",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/blog-list/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/blog-list/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, t, req } from '../_shared/schema';\n\nconst post = z.object({ date: t(30), title: req(100), excerpt: t(200), category: t(30), href: t(300) });\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: t(120),\n  description: t(300),\n  posts: z.array(post).min(1).max(8),\n  more: link,\n});\n\nexport const spec = defineSpec({\n  type: 'blog-list',\n  aliases: ['blog/list'],\n  name: 'Blog, list',\n  category: 'blog',\n  role: 'body',\n  description: 'Post rows with date, title, excerpt and category, plus a link to the full archive.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the topic',\n    title: 'Say what posts cover',\n    description: 'Say in one line what the posts are about.',\n    posts: [\n      { date: '1 Jan 0000', title: 'Say what the post is about, as a title', excerpt: 'Say in one or two sentences what the reader gets from the post.', category: 'Category', href: '#post-1' },\n      { date: '1 Jan 0000', title: 'Say what the post is about', excerpt: 'Say in one or two sentences what the reader gets from the post.', category: 'Category', href: '#post-2' },\n      { date: '1 Jan 0000', title: 'Say what the post is about, as a title', excerpt: 'Say in one or two sentences what the reader gets from the post.', category: 'Category', href: '#post-3' },\n      { date: '1 Jan 0000', title: 'Say what the post is about', excerpt: 'Say in one or two sentences what the reader gets from the post.', category: 'Category', href: '#post-4' },\n    ],\n    more: { label: 'Second action', href: '#journal' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/blog-list/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/blog-list/index.tsx",
      "content": "import { useId } from 'react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { Badge } from '../../ui/badge';\nimport { safeHref } from '../../ui/button';\nimport { ActionLink, Container, Section, SectionHeader } from '../_shared/kit';\nimport { FOCUS } from '../_shared/d-chrome-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\nfunction BlogList({ props }: BlockProps<Props>) {\n  const id = useId();\n  return (\n    <Section labelledBy={id}>\n      <Container width=\"narrow\" className=\"@4xl:max-w-kh-page\">\n        <div className=\"flex flex-col justify-between gap-6 @3xl:flex-row @3xl:items-end\">\n          <SectionHeader id={id} eyebrow={props.eyebrow} title={props.title} description={props.description} />\n          <ActionLink path={['more']} value={props.more} variant=\"secondary\" size=\"md\" className=\"self-start @3xl:self-auto\" />\n        </div>\n        <ul className=\"mt-12 border-t border-kh-line\">\n          {props.posts.map((p, i) => (\n            <li key={i}>\n              <article className=\"group relative grid gap-2 border-b border-kh-line py-7 @3xl:grid-cols-[9rem_1fr_auto] @3xl:items-baseline @3xl:gap-8\">\n                <Text path={['posts', i, 'date']} value={p.date} as=\"p\" className=\"text-kh-small text-kh-muted\" />\n                <div className=\"min-w-0\">\n                  <h3 className=\"text-kh-heading font-semibold\">\n                    <a href={safeHref(p.href)} className={cn(\"rounded-kh-sm after:absolute after:inset-0 after:content-[''] group-hover:underline group-hover:[text-decoration-color:var(--kh-edge)] group-hover:underline-offset-4\", FOCUS)}>\n                      <Text path={['posts', i, 'title']} value={p.title} as=\"span\" />\n                    </a>\n                  </h3>\n                  <Text path={['posts', i, 'excerpt']} value={p.excerpt} as=\"p\" className=\"mt-2 max-w-kh-lead text-kh-small text-kh-muted\" />\n                </div>\n                <div>\n                  <Badge tone=\"accent\">\n                    <Text path={['posts', i, 'category']} value={p.category} as=\"span\" />\n                  </Badge>\n                </div>\n              </article>\n            </li>\n          ))}\n        </ul>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(BlogList);\n"
    }
  ]
}
