{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "footer-centered",
  "type": "registry:block",
  "title": "Footer, centered",
  "description": "A centred footer: brand and one-line tagline, a row of page links, a row of social links, then the legal line. For sites with five or six pages and no need for link columns.",
  "categories": [
    "footer"
  ],
  "dependencies": [
    "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-d-chrome.json",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/footer-centered/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/footer-centered/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, t } from '../_shared/schema';\n\nconst schema = z.object({\n  brand: t(40),\n  tagline: t(160),\n  links: z.array(link).min(1).max(6),\n  social: z.array(link).max(4),\n  legal: t(160),\n});\n\nexport const spec = defineSpec({\n  type: 'footer-centered',\n  aliases: ['footer/centered'],\n  name: 'Footer, centered',\n  category: 'footer',\n  role: 'foot',\n  description: 'A centred footer: brand and one-line tagline, a row of page links, a row of social links, then the legal line. For sites with five or six pages and no need for link columns.',\n  schema,\n  defaults: {\n    brand: 'Brand name',\n    tagline: 'Say what you do in one line.',\n    links: [\n      { label: 'First page', href: '/product' },\n      { label: 'Second page', href: '/pricing' },\n      { label: 'Third page', href: '/customers' },\n      { label: 'Fourth page', href: '/help' },\n      { label: 'Fifth page', href: '/contact' },\n    ],\n    social: [\n      { label: 'First profile', href: 'https://example.com/linkedin' },\n      { label: 'Second profile', href: 'https://example.com/instagram' },\n      { label: 'Third profile', href: 'https://example.com/youtube' },\n    ],\n    legal: '© 0000 Company name. All rights reserved.',\n  },\n});\n"
    },
    {
      "path": "src/blocks/footer-centered/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/footer-centered/index.tsx",
      "content": "import { Text, withHeadingLevel } from '../../editing';\nimport { safeHref } from '../../ui/button';\nimport { Container, Opt, useEditing } from '../_shared/kit';\nimport { FOCUS } from '../_shared/d-chrome-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\nfunction LinkRow({ base, items, label, className }: { base: 'links' | 'social'; items: Props['links']; label: string; className?: string }) {\n  const editing = useEditing();\n  // A link without a label would be an empty tab stop: drop it (the editor still shows it so it can be filled in).\n  const shown = items.map((l, i) => ({ l, i })).filter(({ l }) => l.label || editing);\n  if (!shown.length) return null;\n  return (\n    <nav aria-label={label}>\n      <ul className=\"-mx-3 flex flex-wrap justify-center\">\n        {shown.map(({ l, i }) => (\n          <li key={i}>\n            <a href={safeHref(l.href)} className={cn('inline-flex min-h-11 items-center rounded-kh px-3 transition-colors hover:text-kh-ink', FOCUS, className)}>\n              <Text path={[base, i, 'label']} value={l.label} as=\"span\" />\n            </a>\n          </li>\n        ))}\n      </ul>\n    </nav>\n  );\n}\n\nfunction FooterCentered({ props }: BlockProps<Props>) {\n  const editing = useEditing();\n  return (\n    <footer className=\"border-t border-kh-line bg-kh-canvas py-14 text-center\">\n      <Container className=\"flex flex-col items-center\">\n        <Text path={['brand']} value={props.brand} as=\"p\" className=\"text-kh-heading font-semibold tracking-tight\" />\n        <Opt path={['tagline']} value={props.tagline} className=\"mt-2 max-w-kh-lead text-kh-small text-kh-muted\" placeholder=\"Tagline\" />\n        <div className=\"mt-8 flex flex-col items-center gap-2 empty:mt-0\">\n          <LinkRow base=\"links\" items={props.links} label=\"Footer\" className=\"text-kh-small text-kh-ink\" />\n          <LinkRow base=\"social\" items={props.social} label=\"Social\" className=\"text-kh-small text-kh-muted\" />\n        </div>\n        {(props.legal || editing) && (\n          <Text path={['legal']} value={props.legal} as=\"p\" className=\"mt-10 border-t border-kh-line pt-6 text-kh-caption text-kh-muted\" />\n        )}\n      </Container>\n    </footer>\n  );\n}\n\nexport default withHeadingLevel(FooterCentered);\n"
    }
  ]
}
