{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "compliance-checklist",
  "title": "Compliance Checklist",
  "description": "A generic pass/fail/warn/na readiness checklist card, modelled on Digital Waste Tracking compliance.",
  "dependencies": [
    "@untitledui/icons@^0.0.22"
  ],
  "registryDependencies": [
    "@nx-ui/tooltip",
    "@nx-ui/utils"
  ],
  "files": [
    {
      "path": "components/blocks/domain/compliance-checklist/compliance-checklist.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport {\n  AlertTriangle,\n  CheckCircle,\n  HelpCircle,\n  ShieldTick,\n  XCircle,\n} from \"@untitledui/icons\"\n\nimport { cn } from \"@/lib/utils\"\nimport {\n  Tooltip,\n  TooltipContent,\n  TooltipProvider,\n  TooltipTrigger,\n} from \"@/components/ui/tooltip\"\n\nexport type ComplianceStatus = \"pass\" | \"fail\" | \"warn\" | \"na\"\n\nexport interface ComplianceCheck {\n  /** Stable key. */\n  key: string\n  label: string\n  status: ComplianceStatus\n  /** Optional detail shown in a tooltip on the status icon. */\n  detail?: string\n}\n\nexport interface ComplianceChecklistProps {\n  title?: string\n  checks: ComplianceCheck[]\n  /**\n   * Copy for the summary banner. Sensible defaults model Digital Waste Tracking\n   * readiness; override for other domains.\n   */\n  readyLabel?: string\n  /** Called with the count of failing required checks to build the \"not ready\" copy. */\n  notReadyLabel?: (failing: number) => string\n  className?: string\n}\n\nconst STATUS_META: Record<\n  ComplianceStatus,\n  { Icon: React.ComponentType<{ className?: string }>; className: string; label: string }\n> = {\n  pass: { Icon: CheckCircle, className: \"text-utility-green-600\", label: \"Pass\" },\n  fail: { Icon: XCircle, className: \"text-destructive\", label: \"Fail\" },\n  warn: { Icon: AlertTriangle, className: \"text-utility-yellow-600\", label: \"Warning\" },\n  na: { Icon: HelpCircle, className: \"text-muted-foreground\", label: \"Not applicable\" },\n}\n\n/**\n * ComplianceChecklist — a generic pass / fail / warn / n-a readiness card.\n *\n * Modelled on the Nexus \"Digital Waste Tracking readiness\" checklist: a list of\n * labelled rules, each with a status icon (and optional detail tooltip), under a\n * header showing how many passed, and a summary banner that turns green when\n * everything required is captured. Domain-agnostic — pass any `checks` array.\n */\nexport function ComplianceChecklist({\n  title = \"Compliance\",\n  checks,\n  readyLabel = \"DWT-ready — all required fields captured\",\n  notReadyLabel = (failing) =>\n    `${failing} required ${failing === 1 ? \"field\" : \"fields\"} missing`,\n  className,\n}: ComplianceChecklistProps) {\n  const applicable = checks.filter((c) => c.status !== \"na\")\n  const passed = checks.filter((c) => c.status === \"pass\").length\n  const failing = checks.filter((c) => c.status === \"fail\").length\n  const warnings = checks.filter((c) => c.status === \"warn\").length\n\n  const banner: { tone: \"success\" | \"error\" | \"warning\"; text: string } =\n    failing > 0\n      ? { tone: \"error\", text: notReadyLabel(failing) }\n      : warnings > 0\n        ? { tone: \"warning\", text: \"Some optional checks pending\" }\n        : { tone: \"success\", text: readyLabel }\n\n  const bannerStyles = {\n    success: \"bg-utility-green-50 text-utility-green-700 border-utility-green-200\",\n    error: \"bg-utility-red-50 text-utility-red-700 border-utility-red-200\",\n    warning: \"bg-utility-yellow-50 text-utility-yellow-700 border-utility-yellow-200\",\n  }[banner.tone]\n\n  return (\n    <div\n      className={cn(\n        \"flex flex-col overflow-hidden rounded-xl border border-border bg-background shadow-xs\",\n        className\n      )}\n    >\n      <div className=\"flex items-center justify-between gap-3 border-b border-border px-4 py-3\">\n        <div className=\"flex items-center gap-2\">\n          <ShieldTick className=\"size-5 text-muted-foreground\" />\n          <h3 className=\"text-sm font-semibold text-foreground\">{title}</h3>\n        </div>\n        <span className=\"text-xs font-medium text-muted-foreground tabular-nums\">\n          {passed}/{applicable.length} passed\n        </span>\n      </div>\n\n      <ul className=\"flex flex-col divide-y divide-border\">\n        {checks.map((check) => {\n          const meta = STATUS_META[check.status]\n          const { Icon } = meta\n          return (\n            <li key={check.key} className=\"flex items-center gap-3 px-4 py-2.5\">\n              {check.detail ? (\n                <TooltipProvider>\n                  <Tooltip>\n                    <TooltipTrigger\n                      render={\n                        <span\n                          className={cn(\"flex shrink-0\", meta.className)}\n                          aria-label={meta.label}\n                        />\n                      }\n                    >\n                      <Icon className=\"size-4\" />\n                    </TooltipTrigger>\n                    <TooltipContent className=\"max-w-xs\">{check.detail}</TooltipContent>\n                  </Tooltip>\n                </TooltipProvider>\n              ) : (\n                <Icon className={cn(\"size-4 shrink-0\", meta.className)} aria-label={meta.label} />\n              )}\n              <span\n                className={cn(\n                  \"text-sm\",\n                  check.status === \"na\" ? \"text-muted-foreground\" : \"text-foreground\"\n                )}\n              >\n                {check.label}\n              </span>\n            </li>\n          )\n        })}\n      </ul>\n\n      <div className={cn(\"m-3 rounded-lg border px-3 py-2 text-sm font-medium\", bannerStyles)}>\n        {banner.text}\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/blocks/domain/compliance-checklist/compliance-checklist.tsx"
    },
    {
      "path": "components/blocks/domain/compliance-checklist/index.ts",
      "content": "export {\n  ComplianceChecklist,\n  type ComplianceCheck,\n  type ComplianceChecklistProps,\n  type ComplianceStatus,\n} from \"./compliance-checklist\"\n",
      "type": "registry:component",
      "target": "components/blocks/domain/compliance-checklist/index.ts"
    }
  ],
  "type": "registry:block"
}