{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "docs-prompt",
  "type": "registry:block",
  "title": "Docs, prompt",
  "description": "A prompt to copy, with {variables} highlighted. The first action copies the prompt; the others are links (Open in Claude, ChatGPT, v0). An optional result image shows what it produced.",
  "categories": [
    "docs"
  ],
  "dependencies": [
    "lucide-react@^1.49.0",
    "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-a-docs.json"
  ],
  "files": [
    {
      "path": "src/blocks/docs-prompt/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/docs-prompt/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  title: t(60),\n  description: t(300),\n  label: t(20),\n  prompt: t(1500),\n  actions: z.array(link).max(4),\n  result: media,\n  resultCaption: t(160),\n});\n\nexport const spec = defineSpec({\n  type: 'docs-prompt',\n  aliases: ['docs/prompt'],\n  name: 'Docs, prompt',\n  category: 'docs',\n  role: 'body',\n  description: 'A prompt to copy, with {variables} highlighted. The first action copies the prompt; the others are links (Open in Claude, ChatGPT, v0). An optional result image shows what it produced.',\n  schema,\n  defaults: {\n    title: 'Name this task',\n    description: 'Say what to fill in, then where to paste it.',\n    label: 'Prompt name',\n    prompt: 'Build a {thing} for {audience}. Show {parts} in {format}, ordered {order}. Mark {highlight} as the main point. End with {closing} and one call to action: {cta}.',\n    actions: [\n      { label: 'Main action', href: '' },\n      { label: 'Second action', href: '#claude' },\n      { label: 'Third action', href: '#chatgpt' },\n    ],\n    result: { src: '', alt: 'Show what the prompt produced, whole' },\n    resultCaption: 'Say in one line what a good result looks like here.',\n  },\n});\n"
    },
    {
      "path": "src/blocks/docs-prompt/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/docs-prompt/index.tsx",
      "content": "import { useId } from 'react';\nimport { ArrowUpRight } from 'lucide-react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { ButtonLink } from '../../ui/button';\nimport { Container, Opt, Section, SectionHeader, useEditing, Gate } from '../_shared/kit';\nimport { CopyAction, Variables, hasMedia } from '../_shared/a-docs-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>;\n\nfunction DocsPrompt({ props }: BlockProps<Props>) {\n  const id = useId();\n  const editing = useEditing();\n  const [copy, ...links] = props.actions;\n  return (\n    <Section labelledBy={id} className=\"py-10 @3xl:py-14\">\n      <Container>\n        <SectionHeader id={id} title={props.title} description={props.description} />\n        <div className=\"mt-8 overflow-hidden rounded-kh-xl border border-kh-line bg-kh-surface\">\n          <div className=\"border-b border-kh-line bg-kh-surface-2 px-5 py-3\">\n            <Text path={['label']} value={props.label} as=\"p\" className=\"text-kh-caption font-medium uppercase tracking-wider text-kh-muted\" />\n          </div>\n          <div className=\"px-5 py-5 @3xl:px-7 @3xl:py-6\">\n            <div>\n              {editing ? (\n                <Text path={['prompt']} value={props.prompt} as=\"p\" multiline className=\"max-w-[72ch] whitespace-pre-line text-kh-body leading-relaxed\" />\n              ) : (\n                <p className=\"max-w-[72ch] whitespace-pre-line text-kh-body leading-relaxed\"><Variables text={props.prompt} /></p>\n              )}\n            </div>\n          </div>\n          {props.actions.length > 0 && (\n            <div className=\"flex flex-wrap items-center gap-3 border-t border-kh-line px-5 py-4\">\n              {copy && <CopyAction path={['actions', 0, 'label']} label={copy.label} value={props.prompt} />}\n              {links.map((a, i) => (\n                <Gate key={i} label={a.label}>\n                  <ButtonLink href={a.href} variant=\"secondary\" size=\"md\" iconEnd={<ArrowUpRight aria-hidden className=\"size-4\" />}>\n                    <Text path={['actions', i + 1, 'label']} value={a.label} as=\"span\" />\n                  </ButtonLink>\n                </Gate>\n              ))}\n            </div>\n          )}\n        </div>\n        {(hasMedia(props.result) || editing) && (\n          <figure className=\"mt-8\">\n            <Media path={['result']} value={props.result} ratio=\"16 / 8\" className=\"rounded-kh-xl border border-kh-line\" />\n            <Opt path={['resultCaption']} value={props.resultCaption} as=\"figcaption\" className=\"mt-3 text-kh-small text-kh-muted\" placeholder=\"Caption\" />\n          </figure>\n        )}\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(DocsPrompt);\n"
    }
  ]
}
