{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "changelog-timeline",
  "type": "registry:block",
  "title": "Changelog, timeline",
  "description": "A changelog as a vertical timeline: each entry has a date (with an optional version), a title, a paragraph, tags in words and a short list of changes. Entries are articles with the date as a time heading. A link at the end goes to the full history; leave its label empty to drop it.",
  "categories": [
    "changelog"
  ],
  "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",
    "https://ui.klarhimmel.com/r/kit-c-proof.json"
  ],
  "files": [
    {
      "path": "src/blocks/changelog-timeline/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/changelog-timeline/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, t } from '../_shared/schema';\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: t(120),\n  description: t(300),\n  entries: z\n    .array(\n      z.object({\n        /** Shown as written (\"12 June 2026\"). */\n        date: t(24),\n        /** An optional release number (\"2.4\"). */\n        version: t(12).optional(),\n        title: t(100),\n        body: t(300),\n        /** One to three short tags (\"New\", \"Fix\"). Each is a word, never only a colour. */\n        tags: z.array(t(16)).max(3),\n        /** Optional bullets under the text. */\n        changes: z.array(t(120)).max(5),\n      }),\n    )\n    .min(2)\n    .max(6),\n  more: link,\n});\n\nexport const spec = defineSpec({\n  type: 'changelog-timeline',\n  aliases: ['changelog/timeline'],\n  name: 'Changelog, timeline',\n  category: 'changelog',\n  role: 'body',\n  description: 'A changelog as a vertical timeline: each entry has a date (with an optional version), a title, a paragraph, tags in words and a short list of changes. Entries are articles with the date as a time heading. A link at the end goes to the full history; leave its label empty to drop it.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the topic',\n    title: 'Say what the list shows',\n    description: 'Say in one or two sentences how the list is ordered and grouped.',\n    entries: [\n      {\n        date: '00 Month 0000', version: '2.4', title: 'Name the change', tags: ['Name a tag'],\n        body: 'Say in one or two sentences what changed and what difference it makes to them.',\n        changes: ['Name a first detail of the change, in a line', 'Name a second detail of the change', 'Name a third detail of the change'],\n      },\n      {\n        date: '00 Month 0000', version: '2.3', title: 'Name the change', tags: ['Name a tag', 'Name a tag'],\n        body: 'Say in one or two sentences what changed and what difference it makes, and what else was fixed.',\n        changes: ['Name a first detail of the change', 'Name a second detail of the change'],\n      },\n      {\n        date: '00 Month 0000', title: 'Name the change', tags: ['Name a tag'],\n        body: 'Say in one or two sentences what changed and what difference it makes.',\n        changes: [],\n      },\n    ],\n    more: { label: 'Second action', href: '#history' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/changelog-timeline/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/changelog-timeline/index.tsx",
      "content": "import { useId } from 'react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { Badge } from '../../ui/badge';\nimport { ActionLink, Container, Section, useEditing } from '../_shared/kit';\nimport { Heading, 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\nfunction ChangelogTimeline({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const editing = useEditing();\n  const uid = useId();\n  return (\n    <Section labelledBy={id}>\n      <Container width=\"narrow\">\n        <Heading id={id} eyebrow={props.eyebrow} title={props.title} description={props.description} />\n        <ol className=\"mt-14 flex flex-col gap-12\">\n          {props.entries.map((e, i) => (\n            <li key={i} className=\"grid gap-x-8 gap-y-3 @2xl:grid-cols-[9rem_1fr]\">\n              <p className=\"flex flex-wrap items-baseline gap-x-2 text-kh-small @2xl:flex-col @2xl:gap-0 @2xl:pt-1\">\n                <Text path={['entries', i, 'date']} value={e.date} as=\"span\" className=\"font-medium text-kh-ink\" />\n                {(e.version || editing) && (\n                  <span className=\"text-kh-muted\">\n                    v<Text path={['entries', i, 'version']} value={e.version ?? ''} as=\"span\" placeholder=\"2.0\" />\n                  </span>\n                )}\n              </p>\n              <article aria-labelledby={e.title || editing ? `${uid}-${i}` : undefined} className=\"min-w-0 border-l border-kh-line pl-6 @2xl:pl-8\">\n                {(e.title || editing) && (\n                  <h3 id={`${uid}-${i}`} className=\"text-kh-heading font-semibold\">\n                    <Text path={['entries', i, 'title']} value={e.title} as=\"span\" />\n                  </h3>\n                )}\n                {(e.tags.some(Boolean) || editing) && e.tags.length > 0 && (\n                  <ul className=\"mt-2 flex flex-wrap gap-2\">\n                    {e.tags.map((tag, k) =>\n                      !tag && !editing ? null : (\n                        <li key={k}>\n                          <Badge tone={k === 0 ? 'accent' : 'outline'}>\n                            <Text path={['entries', i, 'tags', k]} value={tag} as=\"span\" />\n                          </Badge>\n                        </li>\n                      ),\n                    )}\n                  </ul>\n                )}\n                <Text path={['entries', i, 'body']} value={e.body} as=\"p\" multiline className=\"mt-3 text-kh-body text-kh-muted\" />\n                {e.changes.length > 0 && (\n                  <ul className=\"mt-4 flex list-disc flex-col gap-1.5 pl-5 text-kh-small marker:text-kh-muted\">\n                    {e.changes.map((c, k) => (\n                      <li key={k}>\n                        <Text path={['entries', i, 'changes', k]} value={c} as=\"span\" />\n                      </li>\n                    ))}\n                  </ul>\n                )}\n              </article>\n            </li>\n          ))}\n        </ol>\n        <ActionLink path={['more']} value={props.more} variant=\"secondary\" size=\"md\" className=\"mt-12\" />\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(ChangelogTimeline);\n"
    }
  ]
}
