{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "stats-band",
  "type": "registry:block",
  "title": "Stats, accent band",
  "description": "An edge-to-edge band in the accent colour: a short statement on the left and three or four big figures divided by hairlines on the right. Loud and brief; use it once, between two quiet sections.",
  "categories": [
    "stats"
  ],
  "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/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/stats-band/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/stats-band/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, req, t } from '../_shared/schema';\n\n// KB-178: figures max 4 -> 6 (five and six lay out in rows of three).\nconst schema = z.object({\n  title: req(100),\n  description: t(200),\n  items: z.array(z.object({ value: req(20), label: req(60) })).min(3).max(6),\n});\n\nexport const spec = defineSpec({\n  type: 'stats-band',\n  aliases: ['stats/band'],\n  name: 'Stats, accent band',\n  category: 'stats',\n  role: 'body',\n  description: 'An edge-to-edge band in the accent colour: a short statement on the left and three or four big figures divided by hairlines on the right. Loud and brief; use it once, between two quiet sections.',\n  schema,\n  defaults: {\n    title: 'Say what the numbers add up to',\n    description: 'Say over what period and across whom the numbers count.',\n    items: [\n      { value: '00', label: 'Name the first count' },\n      { value: '00', label: 'Name the second count' },\n      { value: '00', label: 'Name the third count' },\n      { value: '0.0', label: 'Name the fourth measure' },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/stats-band/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/stats-band/index.tsx",
      "content": "import { useId } from 'react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { Container, Opt } from '../_shared/kit';\nimport { cn } from '../../lib/utils';\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 COLS = { 3: '@xl:grid-cols-3', 4: '@xl:grid-cols-2 @3xl:grid-cols-4' } as const; // five and six use the three-column layout\n\nfunction StatsBand({ props }: BlockProps<Props>) {\n  const id = useId();\n  const n = (props.items.length === 4 ? 4 : 3) as 3 | 4;\n  return (\n    <section aria-labelledby={id} data-kh-own-band=\"\" className=\"bg-kh-accent-fill py-16 text-kh-accent-fg @3xl:py-20\">\n      <Container className=\"grid gap-10 @3xl:gap-12\">\n        <div>\n          <div id={id}>\n            <Text path={['title']} value={props.title} as=\"h2\" className=\"text-kh-title font-semibold\" />\n          </div>\n          <Opt path={['description']} value={props.description} className=\"mt-3 text-kh-body\" placeholder=\"Description\" />\n        </div>\n        <dl className={cn('grid gap-y-8 @xl:gap-y-10', COLS[n])}>\n          {props.items.map((item, i) => (\n            <div key={i} className={cn('flex flex-col-reverse gap-1 border-kh-accent-fg/30 @xl:border-l @xl:pl-6', i % (n === 4 ? 2 : 3) === 0 && '@xl:border-l-0 @xl:pl-0', n === 4 && '@3xl:border-l @3xl:pl-6', n === 4 && i === 0 && '@3xl:border-l-0 @3xl:pl-0')}>\n              <dt className=\"text-kh-small\">\n                <Text path={['items', i, 'label']} value={item.label} as=\"span\" />\n              </dt>\n              <dd>\n                <Text path={['items', i, 'value']} value={item.value} as=\"span\" className=\"text-kh-display font-semibold tabular-nums leading-none\" />\n              </dd>\n            </div>\n          ))}\n        </dl>\n      </Container>\n    </section>\n  );\n}\n\nexport default withHeadingLevel(StatsBand);\n"
    }
  ]
}
