{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "docs-props-table",
  "type": "registry:block",
  "title": "Docs, props table",
  "description": "A table of a component API: name, type, default and description. Scrolls sideways in narrow containers.",
  "categories": [
    "docs"
  ],
  "dependencies": [
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/block-kit.json",
    "https://ui.klarhimmel.com/r/editing.json"
  ],
  "files": [
    {
      "path": "src/blocks/docs-props-table/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/docs-props-table/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, t } from '../_shared/schema';\n\nconst schema = z.object({\n  title: t(80),\n  description: t(300),\n  rows: z.array(z.object({ name: t(40), type: t(80), fallback: t(40), description: t(400) })).min(1).max(30),\n});\n\nexport const spec = defineSpec({\n  type: 'docs-props-table',\n  aliases: ['docs/props-table'],\n  name: 'Docs, props table',\n  category: 'docs',\n  role: 'body',\n  description: 'A table of a component API: name, type, default and description. Scrolls sideways in narrow containers.',\n  schema,\n  defaults: {\n    title: 'Name the API',\n    description: 'Say in one or two sentences which fields are required and what else applies.',\n    rows: [\n      { name: 'Field one', type: \"'first' | 'second' | 'third' | 'fourth'\", fallback: \"'first'\", description: 'Say what the field changes' },\n      { name: 'Field two', type: \"'a' | 'b' | 'c'\", fallback: \"'b'\", description: 'Say what the field changes and its limits' },\n      { name: 'Field three', type: 'Node type', fallback: '-', description: 'Say what the field changes' },\n      { name: 'Field four', type: 'Node type', fallback: '-', description: 'Say what the field changes' },\n      { name: 'Field five', type: 'boolean', fallback: 'false', description: 'Say what the field changes and its limits' },\n      { name: 'Field six', type: 'boolean', fallback: 'false', description: 'Say what the field changes and its limits' },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/docs-props-table/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/docs-props-table/index.tsx",
      "content": "import { useId } from 'react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { Container, Section, SectionHeader } 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\nconst HEAD = ['Prop', 'Type', 'Default', 'Description'];\n\nfunction DocsPropsTable({ props }: BlockProps<Props>) {\n  const id = useId();\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        {/* focusable so keyboard users can scroll it sideways */}\n        <div tabIndex={0} role=\"region\" aria-labelledby={id} className=\"mt-8 overflow-x-auto rounded-kh-lg border border-kh-line focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--kh-focus)\">\n          <table className=\"w-full min-w-[40rem] border-collapse text-left text-kh-small\">\n            <thead className=\"bg-kh-surface-2 text-kh-muted\">\n              <tr>\n                {HEAD.map((h) => (\n                  <th key={h} scope=\"col\" className=\"px-4 py-3 font-medium\">\n                    {h}\n                  </th>\n                ))}\n              </tr>\n            </thead>\n            <tbody className=\"divide-y divide-kh-line bg-kh-surface\">\n              {props.rows.map((r, i) => (\n                <tr key={i} className=\"align-top\">\n                  <th scope=\"row\" className=\"px-4 py-3.5 font-normal\">\n                    <Text path={['rows', i, 'name']} value={r.name} as=\"code\" className=\"rounded-kh-sm bg-kh-surface-2 px-1.5 py-0.5 font-kh-mono text-kh-caption\" />\n                  </th>\n                  <td className=\"px-4 py-3.5\">\n                    <Text path={['rows', i, 'type']} value={r.type} as=\"code\" className=\"font-kh-mono text-kh-caption text-kh-accent-ink\" />\n                  </td>\n                  <td className=\"px-4 py-3.5\">\n                    <Text path={['rows', i, 'fallback']} value={r.fallback} as=\"code\" className=\"font-kh-mono text-kh-caption text-kh-muted\" />\n                  </td>\n                  <td className=\"px-4 py-3.5 text-kh-muted\">\n                    <Text path={['rows', i, 'description']} value={r.description} as=\"span\" />\n                  </td>\n                </tr>\n              ))}\n            </tbody>\n          </table>\n        </div>\n        <p aria-hidden className=\"mt-2 text-kh-caption text-kh-muted @3xl:hidden\">Scroll sideways for the other columns.</p>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(DocsPropsTable);\n"
    }
  ]
}
