{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "report-prose",
  "type": "registry:block",
  "title": "Report, prose",
  "description": "A headed section of text for everything else in a report: paragraphs, a smaller heading, bulleted and numbered lists, a quote, a code block. **bold**, `code` and [links](https://…) work inside the text.",
  "categories": [
    "report"
  ],
  "dependencies": [
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "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-report.json"
  ],
  "files": [
    {
      "path": "src/blocks/report-prose/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/report-prose/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(400),\n  blocks: z.array(z.object({\n    kind: z.enum(['p', 'h3', 'ul', 'ol', 'quote', 'code', 'cmd']),\n    text: t(4000),\n    items: z.array(t(800)).max(40),\n  })).max(60),\n});\n\nexport const spec = defineSpec({\n  type: 'report-prose',\n  aliases: ['report/prose'],\n  name: 'Report, prose',\n  category: 'report',\n  role: 'body',\n  description: 'A headed section of text for everything else in a report: paragraphs, a smaller heading, bulleted and numbered lists, a quote, a code block. **bold**, `code` and [links](https://…) work inside the text.',\n  schema,\n  defaults: {\n    title: 'Name the section',\n    lead: '',\n    blocks: [\n      { kind: 'p', text: 'Say in a sentence or two what was done and why it matters, with the **key term** in bold.', items: [] },\n      { kind: 'h3', text: 'Name the list', items: [] },\n      { kind: 'ol', text: '', items: ['Say the first step, in a line', 'Say the second step, in a line', 'Say the third step, in a line'] },\n      { kind: 'quote', text: 'Quote a line worth keeping', items: [] },\n      { kind: 'code', text: 'npm run your-command --open', items: [] },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/report-prose/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/report-prose/index.tsx",
      "content": "import { useId } from 'react';\nimport { Button } from '../../ui/button';\nimport { Text, withHeadingLevel } from '../../editing';\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>;\ntype Piece = Props['blocks'][number];\n\nfunction Piece({ b, i }: { b: Piece; i: number }) {\n  const at = ['blocks', i];\n  if (b.kind === 'ul' || b.kind === 'ol') {\n    const List = b.kind;\n    return (\n      <List className={`max-w-kh-prose space-y-1.5 pl-6 text-kh-body marker:text-kh-muted ${b.kind === 'ul' ? 'list-disc' : 'list-decimal'}`}>\n        {b.items.map((item, j) => (\n          <li key={j} className=\"pl-1\"><Text path={[...at, 'items', j]} value={item} as=\"span\" rich /></li>\n        ))}\n      </List>\n    );\n  }\n  const text = b.text;\n  if (b.kind === 'h3') return <Text path={[...at, 'text']} value={text} as=\"h3\" rich className=\"pt-2 text-kh-body font-semibold\" />;\n  if (b.kind === 'quote') return <blockquote className=\"max-w-kh-prose border-l-2 border-kh-line-strong pl-4 text-kh-body text-kh-muted\"><Text path={[...at, 'text']} value={text} as=\"p\" rich /></blockquote>;\n  // a command to run (a sh fence, UI-39): the command, Copy (shown by kh-report's report-copy.js), and where to run it\n  if (b.kind === 'cmd') {\n    return (\n      <div data-kh-cmd=\"\" className=\"max-w-full rounded-kh-lg border border-kh-line bg-kh-surface-2 print:break-inside-avoid\">\n        <div className=\"flex items-start gap-3 p-3 pl-4\">\n          <pre tabIndex={0} className=\"min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap py-1 font-kh-mono text-kh-small [overflow-wrap:anywhere] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--kh-focus)\">\n            <Text path={[...at, 'text']} value={text} as=\"code\" multiline />\n          </pre>\n          <Button type=\"button\" variant=\"secondary\" size=\"sm\" data-kh-cmd-copy=\"\" hidden className=\"shrink-0\">Copy</Button>\n        </div>\n        <p className=\"border-t border-kh-line px-4 py-2 text-kh-caption text-kh-muted\">Run it in your own terminal.</p>\n      </div>\n    );\n  }\n  if (b.kind === 'code') {\n    return (\n      <pre tabIndex={0} className=\"max-w-full overflow-x-auto whitespace-pre-wrap rounded-kh-lg border border-kh-line bg-kh-surface-2 p-4 font-kh-mono text-kh-small [overflow-wrap:anywhere] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--kh-focus) print:break-inside-avoid\">\n        <Text path={[...at, 'text']} value={text} as=\"code\" multiline />\n      </pre>\n    );\n  }\n  return <Text path={[...at, 'text']} value={text} as=\"p\" rich className=\"max-w-kh-prose text-kh-body\" />;\n}\n\nfunction ReportProse({ props }: BlockProps<Props>) {\n  const id = useId();\n  return (\n    <ReportSection labelledBy={id}>\n      <ReportTitle id={id} title={props.title} lead={props.lead} />\n      <div className=\"mt-5 flex flex-col gap-4\">\n        {props.blocks.map((b, i) => <Piece key={i} b={b} i={i} />)}\n      </div>\n    </ReportSection>\n  );\n}\n\nexport default withHeadingLevel(ReportProse);\n"
    }
  ]
}
