{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "docs-pager",
  "type": "registry:block",
  "title": "Docs, pager",
  "description": "Previous and next cards that close a documentation page, with optional actions (Copy for AI, Edit on GitHub) and a last-updated line. A card with no title is left out.",
  "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/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/docs-pager/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/docs-pager/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, t } from '../_shared/schema';\n\nconst step = z.object({ label: t(20), title: t(80), href: t(300) });\n\nconst schema = z.object({\n  prev: step,\n  next: step,\n  actions: z.array(link).max(3),\n  updated: t(40),\n});\n\nexport const spec = defineSpec({\n  type: 'docs-pager',\n  aliases: ['docs/pager'],\n  name: 'Docs, pager',\n  category: 'docs',\n  role: 'body',\n  description: 'Previous and next cards that close a documentation page, with optional actions (Copy for AI, Edit on GitHub) and a last-updated line. A card with no title is left out.',\n  schema,\n  defaults: {\n    prev: { label: 'Previous', title: 'Name prior page', href: '#installation' },\n    next: { label: 'Next', title: 'Name next page', href: '#theming' },\n    actions: [\n      { label: 'Main action', href: '#copy' },\n      { label: 'Second action', href: '#edit' },\n    ],\n    updated: 'Say when it was updated',\n  },\n});\n"
    },
    {
      "path": "src/blocks/docs-pager/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/docs-pager/index.tsx",
      "content": "import { ArrowLeft, ArrowRight } from 'lucide-react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { safeHref } from '../../ui/button';\nimport { cn } from '../../lib/utils';\nimport { ActionLink, Container, Opt, Section, useEditing } from '../_shared/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 StepCard({ side, step }: { side: 'prev' | 'next'; step: Props['prev'] }) {\n  const editing = useEditing();\n  if (!step.title && !editing) return <span aria-hidden className=\"hidden\" />;\n  const next = side === 'next';\n  return (\n    <a\n      href={safeHref(step.href)}\n      className={cn(\n        'group flex min-h-11 flex-col gap-1 rounded-kh-lg border border-kh-line bg-kh-surface p-5 transition-colors duration-(--kh-dur) hover:border-kh-line-strong hover:bg-kh-surface-2',\n        'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--kh-focus)',\n        next && 'items-end text-right @md:col-start-2',\n      )}\n    >\n      <span className=\"inline-flex items-center gap-1.5 text-kh-small text-kh-muted\">\n        {!next && <ArrowLeft aria-hidden className=\"size-4 transition-transform duration-(--kh-dur) group-hover:-translate-x-0.5\" />}\n        <Text path={[side, 'label']} value={step.label} as=\"span\" />\n        {next && <ArrowRight aria-hidden className=\"size-4 transition-transform duration-(--kh-dur) group-hover:translate-x-0.5\" />}\n      </span>\n      <Text path={[side, 'title']} value={step.title} as=\"span\" className=\"text-kh-heading font-medium\" />\n    </a>\n  );\n}\n\nfunction DocsPager({ props }: BlockProps<Props>) {\n  const editing = useEditing();\n  const hasMeta = props.actions.length > 0 || !!props.updated || editing;\n  return (\n    <Section className=\"py-10 @3xl:py-14\">\n      <Container>\n        <nav aria-label=\"Page navigation\" className=\"grid gap-4 @md:grid-cols-2\">\n          <StepCard side=\"prev\" step={props.prev} />\n          <StepCard side=\"next\" step={props.next} />\n        </nav>\n        {hasMeta && (\n          <div className=\"mt-6 flex flex-wrap items-center justify-between gap-x-6 gap-y-3 border-t border-kh-line pt-6\">\n            <div className=\"-ml-4 flex flex-wrap gap-3\">\n              {props.actions.map((a, i) => (\n                <ActionLink key={i} path={['actions', i]} value={a} variant=\"ghost\" size=\"md\" />\n              ))}\n            </div>\n            <Opt path={['updated']} value={props.updated} className=\"text-kh-small text-kh-muted\" placeholder=\"Last updated\" />\n          </div>\n        )}\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(DocsPager);\n"
    }
  ]
}
