{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "app-access-detail",
  "type": "registry:block",
  "title": "Operations, access detail",
  "description": "An access record with a copyable code, explicit validity, permissions and recorded history; unknown permissions remain distinct from an empty list.",
  "categories": [
    "app"
  ],
  "dependencies": [
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/block-kit.json",
    "https://ui.klarhimmel.com/r/copy-button.json",
    "https://ui.klarhimmel.com/r/editing.json",
    "https://ui.klarhimmel.com/r/source-note.json"
  ],
  "files": [
    {
      "path": "src/blocks/app-access-detail/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/app-access-detail/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, t, req, link } from '../_shared/schema';\nconst schema = z.object({ eyebrow: t(60), title: t(120), description: t(300), code: t(40), copyLabel: req(60), validity: t(120), note: t(200), permissionsTitle: t(60), permissions: z.array(t(80)).max(8).nullable(), unknownPermissions: t(160), emptyPermissions: t(160), historyTitle: t(60), history: z.array(z.object({ time: t(40), event: t(160) })).max(8), emptyHistory: t(160), source: t(100), sourceNote: t(200), action: link, });\nexport const spec = defineSpec({\n  type: 'app-access-detail', aliases: ['app/access-detail'], name: 'Operations, access detail', category: 'app', role: 'body',\n  description: 'An access record with a copyable code, explicit validity, permissions and recorded history; unknown permissions remain distinct from an empty list.', schema,\n  defaults: {\n    \"eyebrow\": \"Selected access\",\n    \"title\": \"Name the access\",\n    \"description\": \"Say what these details cover and what to confirm before the code is shared.\",\n    \"code\": \"XXXX-0000\",\n    \"copyLabel\": \"Copy the access code\",\n    \"validity\": \"Valid 00 Jan–00 Jan, until 00:00\",\n    \"note\": \"Say where the codes and validity come from and what this block does not do.\",\n    \"permissionsTitle\": \"Opens\",\n    \"permissions\": [\n      \"Name the first place\",\n      \"Name the second place\",\n      \"Name the third place\"\n    ],\n    \"unknownPermissions\": \"Say that permissions could not be read and what not to assume.\",\n    \"emptyPermissions\": \"Say that nothing is opened.\",\n    \"historyTitle\": \"Recorded history\",\n    \"history\": [\n      {\n        \"time\": \"1 Jan · 00:00\",\n        \"event\": \"Say what happened and who did it\"\n      },\n      {\n        \"time\": \"1 Jan · 00:00\",\n        \"event\": \"Say the next thing that happened\"\n      }\n    ],\n    \"emptyHistory\": \"Say that no events are recorded.\",\n    \"source\": \"Name the source\",\n    \"sourceNote\": \"Say what the history covers and what it leaves out of the full record.\",\n    \"action\": {\n      \"label\": \"Open the settings\",\n      \"href\": \"https://example.com/access\"\n    }\n  },\n});\n"
    },
    {
      "path": "src/blocks/app-access-detail/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/app-access-detail/index.tsx",
      "content": "import { useId } from 'react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { Container, Section, SectionHeader, ActionLink } 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 { CopyButton } from '../../ui/copy-button';\nimport { SourceNote } from '../../ui/source-note';\nimport { useEditing } from '../_shared/kit';\nfunction AccessDetail({ props }: BlockProps<Props>) {\n const id = useId(); const editing = useEditing();\n return <Section labelledBy={id}><Container className=\"max-w-[54rem]\"><SectionHeader id={id} eyebrow={props.eyebrow} title={props.title} description={props.description} />\n  <div className=\"mt-6 rounded-kh-lg border border-kh-line bg-kh-surface p-6\">\n   <div className=\"flex items-center gap-4\"><Text path={['code']} value={props.code} as=\"span\" className=\"min-w-0 font-kh-mono text-kh-title font-semibold tracking-wide [overflow-wrap:anywhere]\" />{props.code && props.copyLabel && <CopyButton value={props.code} label={props.copyLabel} />}</div>\n   <span className=\"sr-only\"><Text path={['copyLabel']} value={props.copyLabel} as=\"span\" /></span>\n   <Text path={['validity']} value={props.validity} as=\"p\" className=\"mt-3 text-kh-body font-medium\" />\n   <Text path={['note']} value={props.note} as=\"p\" className=\"mt-2 text-kh-small text-kh-muted\" />\n   <div className=\"mt-6 border-t border-kh-line pt-5\"><Text path={['permissionsTitle']} value={props.permissionsTitle} as=\"h3\" className=\"text-kh-heading font-semibold\" />\n    {props.permissions === null ? <Text path={['unknownPermissions']} value={props.unknownPermissions} as=\"p\" className=\"mt-3 text-kh-small text-kh-muted\" /> : props.permissions.length ? <ul className=\"mt-3 space-y-2\">{props.permissions.map((p,i)=><li key={i}><Text path={['permissions',i]} value={p} as=\"span\" /></li>)}</ul> : <Text path={['emptyPermissions']} value={props.emptyPermissions} as=\"p\" className=\"mt-3 text-kh-small text-kh-muted\" />}\n    {editing && <div hidden><Text path={['unknownPermissions']} value={props.unknownPermissions} as=\"span\" /><Text path={['emptyPermissions']} value={props.emptyPermissions} as=\"span\" /></div>}\n   </div>\n   <div className=\"mt-6 border-t border-kh-line pt-5\"><Text path={['historyTitle']} value={props.historyTitle} as=\"h3\" className=\"text-kh-heading font-semibold\" />\n    {props.history.length ? <ol className=\"mt-3 space-y-3\">{props.history.map((h,i)=><li key={i} className=\"grid gap-1 @xl:grid-cols-[9rem_1fr]\"><Text path={['history',i,'time']} value={h.time} as=\"span\" className=\"font-kh-mono text-kh-small text-kh-muted\" /><Text path={['history',i,'event']} value={h.event} as=\"span\" className=\"text-kh-small\" /></li>)}</ol> : <Text path={['emptyHistory']} value={props.emptyHistory} as=\"p\" className=\"mt-3 text-kh-small text-kh-muted\" />}\n    {editing && props.history.length > 0 && <span hidden><Text path={['emptyHistory']} value={props.emptyHistory} as=\"span\" /></span>}\n   </div>\n  </div>\n  <SourceNote className=\"mt-5\" source={<Text path={['source']} value={props.source} as=\"span\" />}><Text path={['sourceNote']} value={props.sourceNote} as=\"p\" /></SourceNote>\n  <ActionLink path={['action']} value={props.action} variant=\"secondary\" className=\"mt-5\" />\n </Container></Section>;\n}\nexport default withHeadingLevel(AccessDetail);\n"
    }
  ]
}
