{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "report-audit-modules",
  "type": "registry:block",
  "title": "Audit, module scores",
  "description": "A grid of audit modules with explicit scored, unavailable and pending states; findings stay next to their score.",
  "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/score-ring.json"
  ],
  "files": [
    {
      "path": "src/blocks/report-audit-modules/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/report-audit-modules/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, t, req } from '../_shared/schema';\nconst schema = z.object({ eyebrow: t(60), title: t(120), description: t(300), modules: z.array(z.object({ title: req(60), state: z.enum(['scored', 'unavailable', 'pending']), score: z.number().min(0).max(100).nullable(), status: t(100), findings: z.array(t(160)).max(5) })).min(1).max(8), });\nexport const spec = defineSpec({\n  type: 'report-audit-modules', aliases: ['report/audit-modules'], name: 'Audit, module scores', category: 'report', role: 'body',\n  description: 'A grid of audit modules with explicit scored, unavailable and pending states; findings stay next to their score.', schema,\n  defaults: {\n  \"eyebrow\": \"Name the section\",\n  \"title\": \"Say what was assessed\",\n  \"description\": \"Say how to read the modules, and what a missing result means.\",\n  \"modules\": [\n    {\n      \"title\": \"Name the first module\",\n      \"state\": \"scored\",\n      \"score\": 82,\n      \"status\": \"Assessed\",\n      \"findings\": [\n        \"Say one thing that was found\",\n        \"Say a second thing that was found, briefly\"\n      ]\n    },\n    {\n      \"title\": \"Name the second module\",\n      \"state\": \"scored\",\n      \"score\": 45,\n      \"status\": \"Needs attention\",\n      \"findings\": [\n        \"Say one thing that was found\",\n        \"Say a second thing that was found, briefly\"\n      ]\n    },\n    {\n      \"title\": \"Name the third module\",\n      \"state\": \"unavailable\",\n      \"score\": null,\n      \"status\": \"Say why it was not scored and what that means\",\n      \"findings\": [\n        \"Say what could not be checked, and why\"\n      ]\n    },\n    {\n      \"title\": \"Name the fourth module\",\n      \"state\": \"pending\",\n      \"score\": null,\n      \"status\": \"Say what it is waiting for\",\n      \"findings\": []\n    }\n  ]\n},\n});\n"
    },
    {
      "path": "src/blocks/report-audit-modules/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/report-audit-modules/index.tsx",
      "content": "import { useId } from 'react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { Container, Section, SectionHeader } from '../_shared/kit';\nimport { spec } from './spec';\nimport type { BlockProps } from '../types';\nimport type { z } from 'zod';\nexport { spec };\ntype Props = z.infer<typeof spec.schema>;\nimport { ScoreRing } from '../../ui/score-ring';\nfunction AuditModules({ props }: BlockProps<Props>) {\n const id = useId();\n return <Section labelledBy={id}><Container><SectionHeader id={id} eyebrow={props.eyebrow} title={props.title} description={props.description} />\n  <div className=\"mt-8 grid gap-4 @3xl:grid-cols-2\">{props.modules.map((m,i)=><article key={i} className=\"min-w-0 rounded-kh-lg border border-kh-line bg-kh-surface p-6\">\n   <div className=\"flex flex-wrap items-start justify-between gap-5\">\n    <div className=\"min-w-0 flex-1\"><Text path={['modules',i,'title']} value={m.title} as=\"h3\" className=\"text-kh-heading font-semibold\" /><Text path={['modules',i,'status']} value={m.status} as=\"p\" className=\"mt-2 text-kh-small text-kh-muted\" /></div>\n    <ScoreRing value={m.state === 'scored' ? m.score : null} label={<span className=\"sr-only\"><Text path={['modules',i,'title']} value={m.title} as=\"span\" /></span>} unavailable={<span className=\"sr-only\"><Text path={['modules',i,'status']} value={m.status} as=\"span\" /></span>} className=\"[&>div]:size-20 [&_figcaption]:max-w-40\" />\n   </div>\n   <ul className=\"mt-4 space-y-2 text-kh-small text-kh-ink-2\">{m.findings.map((f,j)=><li key={j} className=\"flex gap-2\"><span aria-hidden>·</span><Text path={['modules',i,'findings',j]} value={f} as=\"span\" /></li>)}</ul>\n  </article>)}</div>\n </Container></Section>;\n}\nexport default withHeadingLevel(AuditModules);\n"
    }
  ]
}
