{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "activity-log",
  "type": "registry:block",
  "title": "Activity log",
  "description": "A heading beside a timed log of work: time, actor, one-line event and a status badge per row, with an optional highlighted row that needs the reader and one action. Static, no animation.",
  "categories": [
    "features"
  ],
  "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/activity-log/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/activity-log/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, t } from '../_shared/schema';\n\nconst badgeTone = z.enum(['neutral', 'accent', 'outline']);\nconst row = z.object({ time: t(12), actor: t(24), event: t(140), badge: t(20), badgeTone });\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: t(120),\n  description: t(300),\n  link,\n  rows: z.array(row).min(2).max(8),\n  /** One highlighted row that waits on the reader, with one action. Left out when absent. */\n  needsYou: row.extend({ action: link }).optional(),\n});\n\nexport const spec = defineSpec({\n  type: 'activity-log',\n  aliases: ['features/activity-log'],\n  name: 'Activity log',\n  category: 'features',\n  role: 'body',\n  description: 'A heading beside a timed log of work: time, actor, one-line event and a status badge per row, with an optional highlighted row that needs the reader and one action. Static, no animation.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the section',\n    title: 'Say what this log records',\n    description: 'Say in one sentence what the log shows and over what time. Add that nothing changes without a line here.',\n    link: { label: 'Read more', href: '#log' },\n    rows: [\n      { time: '00:00', actor: 'Actor', event: 'Say what happened first, and its result.', badge: 'Status', badgeTone: 'neutral' },\n      { time: '00:00', actor: 'Actor', event: 'Say what went wrong, what was done about it and how it was checked.', badge: 'Status', badgeTone: 'outline' },\n      { time: '00:00', actor: 'Actor', event: 'Say what routine work was done, in one line.', badge: 'Status', badgeTone: 'neutral' },\n      { time: '00:00', actor: 'Actor', event: 'Say what a person checked.', badge: 'Status', badgeTone: 'neutral' },\n      { time: '00:00', actor: 'Actor', event: 'Say what was reported and what is still open.', badge: 'Status', badgeTone: 'neutral' },\n    ],\n    needsYou: {\n      time: '00:00', actor: 'Actor', event: 'Say what needs a decision from a person.', badge: 'Needs action', badgeTone: 'accent',\n      action: { label: 'Main action', href: '#review' },\n    },\n  },\n});\n"
    },
    {
      "path": "src/blocks/activity-log/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/activity-log/index.tsx",
      "content": "import { useId } from 'react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { Badge } from '../../ui/badge';\nimport type { PropPath } from '../../editing';\nimport { ActionLink, Container, Section, SectionHeader } 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>;\ntype Row = Props['rows'][number];\n\nfunction LogRow({ row, path, highlight, children }: { row: Row; path: PropPath; highlight?: boolean; children?: React.ReactNode }) {\n  return (\n    <li\n      className={`relative grid grid-cols-[3.5rem_1fr] gap-x-4 gap-y-1 px-5 py-4 @xl:grid-cols-[3.5rem_5.5rem_1fr_auto] @xl:items-baseline ${\n        highlight ? 'bg-kh-surface-2' : ''\n      }`}\n    >\n      {highlight && <span aria-hidden className=\"absolute inset-y-0 start-0 w-1 bg-kh-accent\" />}\n      <Text path={[...path, 'time']} value={row.time} as=\"span\" className=\"font-kh-mono text-kh-small tabular-nums text-kh-muted\" />\n      <Text path={[...path, 'actor']} value={row.actor} as=\"span\" className=\"text-kh-small font-medium text-kh-ink\" />\n      <div className=\"col-span-2 @xl:col-span-1\">\n        <Text path={[...path, 'event']} value={row.event} as=\"p\" className=\"text-kh-small text-kh-ink\" />\n      </div>\n      <div className=\"col-span-2 @xl:col-span-1 @xl:justify-self-end\">\n        <Badge tone={row.badgeTone}>\n          <Text path={[...path, 'badge']} value={row.badge} as=\"span\" />\n        </Badge>\n      </div>\n      {children && <div className=\"col-span-2 @xl:col-start-3 @xl:col-end-5\">{children}</div>}\n    </li>\n  );\n}\n\nfunction ActivityLog({ props }: BlockProps<Props>) {\n  const id = useId();\n  return (\n    <Section labelledBy={id}>\n      <Container className=\"grid gap-12 @4xl:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] @4xl:items-start\">\n        <div>\n          <SectionHeader id={id} eyebrow={props.eyebrow} title={props.title} description={props.description} />\n          <ActionLink path={['link']} value={props.link} variant=\"secondary\" size=\"md\" className=\"mt-8\" />\n        </div>\n        <ol className=\"divide-y divide-kh-line overflow-hidden rounded-kh-lg border border-kh-line bg-kh-surface\">\n          {props.rows.map((row, i) => (\n            <LogRow key={i} row={row} path={['rows', i]} />\n          ))}\n          {props.needsYou && (\n            <LogRow row={props.needsYou} path={['needsYou']} highlight>\n              <ActionLink path={['needsYou', 'action']} value={props.needsYou.action} variant=\"primary\" size=\"sm\" className=\"mt-2\" />\n            </LogRow>\n          )}\n        </ol>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(ActivityLog);\n"
    }
  ]
}
