{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "snapshot-profile",
  "type": "registry:block",
  "title": "Snapshot, profile",
  "description": "A compact card shown first in a snapshot: the site's name, what it does in a few sentences, and its trade, region and language when known. Text only (the data is read from a crawl); an empty field is left out.",
  "categories": [
    "snapshot"
  ],
  "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/kit-snapshot.json"
  ],
  "files": [
    {
      "path": "src/blocks/snapshot-profile/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/snapshot-profile/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, req, t } from '../_shared/schema';\n\nconst schema = z.object({\n  /** The site's name as the research found it. */\n  name: req(120),\n  summary: t(800),\n  trade: t(120),\n  region: t(120),\n  language: t(40),\n  /** The labels in front of trade, region and language; a missing word uses the English default. */\n  words: z.object({ trade: t(40), region: t(40), language: t(40) }).partial().optional(),\n});\n\nexport const spec = defineSpec({\n  type: 'snapshot-profile',\n  headingSlot: 'name',\n  aliases: ['snapshot/profile'],\n  name: 'Snapshot, profile',\n  category: 'snapshot',\n  role: 'body',\n  description: 'A compact card shown first in a snapshot: the site\\'s name, what it does in a few sentences, and its trade, region and language when known. Text only (the data is read from a crawl); an empty field is left out.',\n  schema,\n  defaults: {\n    name: 'Name the site',\n    summary: 'Say in two or three sentences what the site is and does, who it serves, and what it offers.',\n    trade: 'Name the trade',\n    region: 'Name the region',\n    language: 'Name language',\n    words: { trade: 'Trade', region: 'Region', language: 'Language' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/snapshot-profile/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/snapshot-profile/index.tsx",
      "content": "import { useId } from 'react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { Container, Opt, Section, useEditing } from '../_shared/kit';\nimport { WRAP } from '../_shared/snapshot-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>;\nconst WORDS = { trade: 'Trade', region: 'Region', language: 'Language' };\n\nfunction SnapshotProfile({ props }: BlockProps<Props>) {\n  const id = useId();\n  const editing = useEditing();\n  const words = { ...WORDS, ...props.words };\n  const facts = (['trade', 'region', 'language'] as const).filter((k) => props[k] || editing);\n  return (\n    <Section labelledBy={id} className=\"py-6 @3xl:py-8\">\n      <Container width=\"narrow\">\n        <div className={`rounded-kh-xl border border-kh-line bg-kh-surface p-5 shadow-kh-1 @2xl:p-7 ${WRAP}`}>\n          <div id={id}>\n            <Text path={['name']} value={props.name} as=\"h2\" className=\"text-kh-heading font-semibold\" />\n          </div>\n          <Opt path={['summary']} value={props.summary} multiline className=\"mt-2 max-w-kh-lead text-kh-body text-kh-muted\" placeholder=\"Summary\" />\n          {facts.length > 0 && (\n            <dl className=\"mt-4 flex flex-wrap gap-x-8 gap-y-2 text-kh-small\">\n              {facts.map((k) => (\n                <div key={k} className=\"min-w-0\">\n                  <dt className=\"text-kh-caption text-kh-muted\"><Text path={['words', k]} value={words[k]} as=\"span\" /></dt>\n                  <dd className=\"font-medium\"><Opt path={[k]} value={props[k]} as=\"span\" placeholder={words[k]} /></dd>\n                </div>\n              ))}\n            </dl>\n          )}\n        </div>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(SnapshotProfile, 'name');\n"
    }
  ]
}
