{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "report-timeline",
  "type": "registry:block",
  "title": "Report, timeline",
  "description": "What happened and when: a dated list with a title and a few lines for each entry.",
  "categories": [
    "report"
  ],
  "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-report.json"
  ],
  "files": [
    {
      "path": "src/blocks/report-timeline/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/report-timeline/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, t } from '../_shared/schema';\n\nconst schema = z.object({\n  title: t(100),\n  lead: t(300),\n  items: z.array(z.object({ date: t(40), title: z.string().min(1).max(160), text: t(700) })).min(1).max(24),\n});\n\nexport const spec = defineSpec({\n  type: 'report-timeline',\n  aliases: ['report/timeline'],\n  name: 'Report, timeline',\n  category: 'report',\n  role: 'body',\n  description: 'What happened and when: a dated list with a title and a few lines for each entry.',\n  schema,\n  defaults: {\n    title: 'Name the timeline',\n    lead: '',\n    items: [\n      { date: '1 Jan', title: 'Name the first event', text: 'Say what happened and what it changed, in a sentence' },\n      { date: '2 Jan, morning', title: 'Name the second event', text: 'Say what happened and what it changed, in a sentence' },\n      { date: '2 Jan, afternoon', title: 'Name the third event', text: 'Say what happened and what it changed, in a sentence' },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/report-timeline/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/report-timeline/index.tsx",
      "content": "import { useId } from 'react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { Opt } from '../_shared/kit';\nimport { ReportSection, ReportTitle } from '../_shared/report-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 ReportTimeline({ props }: BlockProps<Props>) {\n  const id = useId();\n  const last = props.items.length - 1;\n  return (\n    <ReportSection labelledBy={id}>\n      <ReportTitle id={id} title={props.title} lead={props.lead} />\n      <ol className=\"mt-6\">\n        {props.items.map((item, i) => (\n          <li key={i} className=\"relative grid grid-cols-[1.25rem_1fr] gap-x-4 pb-7 last:pb-0 print:break-inside-avoid @xl:grid-cols-[7.5rem_1.25rem_1fr] @xl:gap-x-5\">\n            <div className=\"col-span-2 empty:hidden @xl:col-span-1 @xl:pt-0.5 @xl:text-right @xl:empty:block\">\n              <Opt path={['items', i, 'date']} value={item.date} as=\"p\" className=\"mb-1 text-kh-small font-medium text-kh-accent-ink @xl:mb-0\" placeholder=\"Date\" />\n            </div>\n            <span aria-hidden className=\"relative flex justify-center\">\n              <span className=\"z-[1] mt-2 size-2.5 rounded-kh-pill border-2 border-kh-ink bg-kh-canvas\" />\n              {i < last && <span className=\"absolute bottom-[-1.75rem] top-5 w-px bg-kh-line-strong\" />}\n            </span>\n            <div className=\"min-w-0\">\n              <Text path={['items', i, 'title']} value={item.title} as=\"h3\" rich className=\"text-kh-body font-semibold\" />\n              <Opt path={['items', i, 'text']} value={item.text} rich className=\"mt-1 text-kh-small text-kh-muted\" placeholder=\"Text\" />\n            </div>\n          </li>\n        ))}\n      </ol>\n    </ReportSection>\n  );\n}\n\nexport default withHeadingLevel(ReportTimeline);\n"
    }
  ]
}
