{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "docs-header",
  "type": "registry:block",
  "title": "Docs, page header",
  "description": "Breadcrumbs, title and description, with an optional status badge, install command and result preview (demo or image). Opens a documentation page.",
  "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-header/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/docs-header/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  breadcrumbs: z.array(link).min(1).max(4),\n  status: t(24).optional(),\n  title: t(80),\n  description: t(300),\n  command: t(120).optional(),\n  /** Result preview below the header (a recipe's finished page, a component in use). A demo id wins over the image. */\n  demo: t(64).optional(),\n  preview: media.optional(),\n});\n\nexport const spec = defineSpec({\n  type: 'docs-header',\n  aliases: ['docs/header'],\n  name: 'Docs, page header',\n  category: 'docs',\n  role: 'body',\n  description: 'Breadcrumbs, title and description, with an optional status badge, install command and result preview (demo or image). Opens a documentation page.',\n  schema,\n  defaults: {\n    breadcrumbs: [\n      { label: 'First page', href: '#docs' },\n      { label: 'Second page', href: '#components' },\n      { label: 'Third page', href: '#button' },\n    ],\n    status: 'Stable',\n    title: 'Name the page',\n    description: 'Say in one or two sentences what this is, how it comes and what to know before using it.',\n    command: 'npm create your-app@latest',\n  },\n});\n"
    },
    {
      "path": "src/blocks/docs-header/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/docs-header/index.tsx",
      "content": "import { useId } from 'react';\nimport { ChevronRight } from 'lucide-react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { safeHref } from '../../ui/button';\nimport { CommandBlock, Container, Opt, useEditing, Gate } from '../_shared/kit';\nimport { Stage } 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 DocsHeader({ props }: BlockProps<Props>) {\n  const id = useId();\n  const editing = useEditing();\n  const last = props.breadcrumbs.length - 1;\n  return (\n    <header aria-labelledby={id} className=\"pt-10 pb-10 @3xl:pt-14\">\n      <Container>\n        <nav aria-label=\"Breadcrumb\">\n          <ol className=\"flex flex-wrap items-center gap-1 text-kh-small text-kh-muted\">\n            {props.breadcrumbs.map((b, i) => (\n              <Gate key={i} label={b.label}>\n              <li className=\"flex items-center gap-1\">\n                {i === last ? (\n                  <span aria-current=\"page\" className=\"text-kh-ink\">\n                    <Text path={['breadcrumbs', i, 'label']} value={b.label} as=\"span\" />\n                  </span>\n                ) : (\n                  <>\n                    <a href={safeHref(b.href)} className=\"inline-flex min-h-9 items-center rounded-kh-sm hover:text-kh-ink focus-visible:outline-2 focus-visible:outline-(--kh-focus)\">\n                      <Text path={['breadcrumbs', i, 'label']} value={b.label} as=\"span\" />\n                    </a>\n                    <ChevronRight aria-hidden className=\"size-3.5\" />\n                  </>\n                )}\n              </li>\n              </Gate>\n            ))}\n          </ol>\n        </nav>\n        <div className=\"mt-6 flex flex-wrap items-center gap-3\">\n          <div id={id}>\n            <Text path={['title']} value={props.title} as=\"h1\" className=\"text-kh-title font-semibold\" />\n          </div>\n          <Opt path={['status']} value={props.status} as=\"span\" className=\"inline-flex items-center rounded-kh-pill bg-kh-accent-soft px-2.5 py-0.5 text-kh-caption font-medium text-kh-accent-ink\" placeholder=\"Status\" />\n        </div>\n        <Text path={['description']} value={props.description} as=\"p\" multiline className=\"mt-4 max-w-kh-prose text-kh-lead text-kh-muted\" />\n        {(props.command || editing) && <CommandBlock path={['command']} value={props.command ?? ''} className=\"mt-8 max-w-md\" />}\n        {(props.demo || props.preview) && (\n          <div className=\"mt-10 overflow-hidden rounded-kh-xl border border-kh-line\">\n            <Stage demoPath={['demo']} demo={props.demo} mediaPath={['preview']} media={props.preview} ratio=\"16 / 7\" />\n          </div>\n        )}\n      </Container>\n    </header>\n  );\n}\n\nexport default withHeadingLevel(DocsHeader);\n"
    }
  ]
}
