{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "footer-columns",
  "type": "registry:block",
  "title": "Footer, columns",
  "description": "Up to six link columns, with a brand column or a full-width SVG wordmark below, an optional newsletter form, an optional contact block (address, hours), social links, badges and one button, an optional family row of sister sites and a legal line with legal links underneath.",
  "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-columns/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/footer-columns/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, formFields, icon, link, media, t, req, mark } from '../_shared/schema';\n\nconst schema = z.object({\n  brand: t(40),\n  /** Place the brand beside the columns or as a full-width SVG row beneath them; 'links' draws no brand block: full-width columns over a rule, the brand as a small name in the legal row. */\n  brandLayout: z.enum(['column', 'wordmark', 'links']).optional(),\n  /** The brand mark before the wordmark: SVG paths in currentColor (or an image src), cap-height tall, aria-hidden. */\n  mark,\n  /** t(400): a brand story paragraph, not one line (longest real: about 330 characters, the bakery and the trades sites). */\n  tagline: t(400),\n  /** Up to six columns of up to 14 links (Encore has six columns, Allakando twelve links per group). A column title is optional: without one the list is drawn untitled. */\n  columns: z.array(z.object({ title: t(40).optional(), links: z.array(link).max(14) })).max(6),\n  legal: t(120),\n  /** The href of the current page's link, as navbar-simple takes it: that link gets aria-current=\"page\". */\n  current: t(300).optional(),\n  /** Where and when to find them: address, phone, e-mail, opening hours, one line each. A line with an href is a link (tel:, mailto:, https:). */\n  contact: z.object({ title: t(40).optional(), lines: z.array(z.object({ label: t(40).optional(), value: t(160), href: t(300).optional() })).max(8) }).partial().optional(),\n  /** Social profiles: a name and an href; with an icon the name is read by screen readers and the icon is drawn. */\n  social: z.array(z.object({ label: req(40), href: t(300), icon: icon.optional() })).max(8).optional(),\n  /** Badges and certificates (an award, a member logo): a small picture, linked when it has an href. */\n  badges: z.array(z.object({ media, href: t(300).optional() })).max(6).optional(),\n  /** One call to action in the footer (a booking or order button). */\n  action: link.partial().optional(),\n  newsletter: z.object({ title: t(60).optional(), placeholder: req(60), submit: req(24), note: t(160), ...formFields }).optional(),\n  legalLinks: z.array(link).max(6).optional(),\n  /** The other sites and products of the same company, one row above the legal line (\"Klarhimmel: Studio, Builder, Agent\"), so every site's footer names the family the same way. */\n  family: z.object({ label: t(40).default(''), links: z.array(link).max(8).default([]) }).optional(),\n});\n\nexport const spec = defineSpec({\n  type: 'footer-columns',\n  aliases: ['footer/link-columns'],\n  name: 'Footer, columns',\n  category: 'footer',\n  role: 'foot',\n  description: 'Up to six link columns, with a brand column or a full-width SVG wordmark below, an optional newsletter form, an optional contact block (address, hours), social links, badges and one button, an optional family row of sister sites and a legal line with legal links underneath.',\n  schema,\n  // A library row has no endpoint for the newsletter form, so its Subscribe would do nothing (KB-521 cold check): a row offers none.\n  rowOmit: ['newsletter'],\n  defaults: {\n    brand: 'Brand name',\n    tagline: 'Say what you do in one line.',\n    columns: [\n      { title: 'First group', links: [{ label: 'First page', href: '#features' }, { label: 'Second page', href: '#pricing' }, { label: 'Third page', href: '#changelog' }] },\n      { title: 'Second group', links: [{ label: 'First page', href: '#about' }, { label: 'Second page', href: '#careers' }, { label: 'Third page', href: '#contact' }] },\n      { title: 'Third group', links: [{ label: 'First page', href: '#docs' }, { label: 'Second page', href: '#guides' }, { label: 'Third page', href: '#status' }] },\n    ],\n    legal: '© 0000 Company name. All rights reserved.',\n    newsletter: { title: 'Say why to subscribe', placeholder: 'Your email', submit: 'Subscribe', note: 'Say how often you write and that they can leave.' },\n    legalLinks: [\n      { label: 'Privacy', href: '#privacy' },\n      { label: 'Terms', href: '#terms' },\n      { label: 'GitHub', href: '#github' },\n      { label: 'LinkedIn', href: '#linkedin' },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/footer-columns/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/footer-columns/index.tsx",
      "content": "import { Media, Text, withHeadingLevel } from '../../editing';\nimport { safeHref } from '../../ui/button';\nimport { ActionLink, Container, Opt, Gate, Mark, Icon, LinkedValue, useEditing } from '../_shared/kit';\nimport { EmailForm, FOCUS, footCurrentClass } from '../_shared/d-chrome-kit';\nimport { cn } from '../../lib/utils';\nimport { spec } from './spec';\nimport { BrandWordmark } from '../_shared/brand-wordmark';\nimport type { BlockProps } from '../types';\nimport type { z } from 'zod';\n\nexport { spec };\ntype Props = z.infer<typeof spec.schema>;\n\n// Up to four columns keep the compact block beside the brand; five and six open up to the full width.\nconst COLS = ['grid-cols-2', 'grid-cols-2', 'grid-cols-2', 'grid-cols-2 @xl:grid-cols-3', 'grid-cols-2 @xl:grid-cols-4', 'grid-cols-2 @xl:grid-cols-3 @5xl:grid-cols-5', 'grid-cols-2 @xl:grid-cols-3 @5xl:grid-cols-6'];\n\nfunction FooterColumns({ props }: BlockProps<Props>) {\n  const { newsletter, legalLinks = [], family, contact, social = [], badges = [], action } = props;\n  const editing = useEditing();\n  const wide = props.columns.length > 4;\n  const contactLines = (contact?.lines ?? []).filter((l) => l.value || editing);\n  const socials = social.filter((l) => l.label || editing);\n  const hasFamily = !!family && family.links.length > 0;\n  const wordmark = props.brandLayout === 'wordmark';\n  // 'links' shares the wordmark's full-width columns path but draws no brand block: the brand is a small name in the legal row.\n  const flat = wordmark || props.brandLayout === 'links';\n  const newsletterContent = newsletter && <div className=\"mt-8 max-w-sm\">\n    <Opt path={['newsletter', 'title']} value={newsletter.title} as=\"h2\" className=\"text-kh-small font-medium text-kh-ink\" placeholder=\"Newsletter title\" />\n    <EmailForm path={['newsletter']} placeholder={newsletter.placeholder} submit={newsletter.submit} form={newsletter} className=\"mt-3\" />\n    <Text path={['newsletter', 'note']} value={newsletter.note} as=\"p\" className=\"mt-3 text-kh-caption text-kh-muted\" />\n  </div>;\n  const extras = <>\n    {contact && contactLines.length > 0 && (\n      <div className=\"mt-6 max-w-xs\">\n        <Opt path={['contact', 'title']} value={contact.title} as=\"h2\" className=\"text-kh-small font-medium text-kh-ink\" placeholder=\"Contact title\" />\n        <dl className=\"mt-2 space-y-1 text-kh-small text-kh-muted\">\n          {contactLines.map((l, i) => (\n            <div key={i} className=\"flex flex-wrap gap-x-2\">\n              {(l.label || editing) && <dt><Text path={['contact', 'lines', i, 'label']} value={l.label ?? ''} as=\"span\" placeholder=\"Label\" /></dt>}\n              <dd className=\"min-w-0\"><LinkedValue path={['contact', 'lines', i, 'value']} value={l.value} href={l.href} /></dd>\n            </div>\n          ))}\n        </dl>\n      </div>\n    )}\n    {socials.length > 0 && (\n      <ul aria-label=\"Social\" className=\"-mx-2 mt-4 flex flex-wrap\">\n        {socials.map((l, i) => (\n          <li key={i}>\n            <a href={safeHref(l.href)} aria-label={l.icon ? l.label : undefined} className={cn('inline-flex min-h-11 items-center gap-2 rounded-kh-sm px-2 text-kh-small text-kh-muted transition-colors hover:text-kh-ink', FOCUS)}>\n              {l.icon && <Icon name={l.icon} />}\n              <Text path={['social', i, 'label']} value={l.label} as=\"span\" className={l.icon ? 'sr-only' : undefined} />\n            </a>\n          </li>\n        ))}\n      </ul>\n    )}\n    {badges.length > 0 && (\n      <ul aria-label=\"Badges\" className=\"mt-4 flex flex-wrap items-center gap-3\">\n        {badges.map((b, i) => {\n          const pic = <Media path={['badges', i, 'media']} value={b.media} ratio=\"1 / 1\" className=\"size-14\" />;\n          return <li key={i}>{b.href ? <a href={safeHref(b.href)} className={cn('block rounded-kh-sm', FOCUS)}>{pic}</a> : pic}</li>;\n        })}\n      </ul>\n    )}\n    {action && (action.label || editing) && <ActionLink path={['action']} value={{ label: action.label ?? '', href: action.href ?? '' }} variant=\"secondary\" size=\"md\" className=\"mt-6\" />}\n  </>;\n  return (\n    <footer className=\"border-t border-kh-line bg-kh-canvas py-16\">\n      <Container>\n        <div className={cn('grid gap-8', !flat && '@3xl:grid-cols-[minmax(0,1fr)_minmax(0,2.5fr)]')}>\n          {!flat && <div>\n            <p className=\"flex items-center gap-(--kh-mark-gap) text-kh-heading font-semibold tracking-tight\"><Mark mark={props.mark} /><Text path={['brand']} value={props.brand} as=\"span\" /></p>\n            <Text path={['tagline']} value={props.tagline} as=\"p\" className=\"mt-3 max-w-xs text-kh-small text-kh-muted\" />\n            {extras}\n            {newsletterContent}\n          </div>}\n          <div className={cn('grid w-full gap-x-4 gap-y-8', !flat && !wide && 'max-w-[40rem]', COLS[Math.min(props.columns.length, 6)])}>\n            {props.columns.map((col, i) => (\n              <nav key={i} aria-label={col.title || 'Links'}>\n                <Opt path={['columns', i, 'title']} value={col.title} as=\"h2\" className=\"text-kh-small font-medium text-kh-ink\" placeholder=\"Column title\" />\n                <ul className={cn('space-y-1', (col.title || editing) && 'mt-3')}>\n                  {col.links.map((l, j) => (\n                    <Gate key={j} label={l.label}>\n                    <li>\n                      <a href={safeHref(l.href)} aria-current={props.current && l.href === props.current ? 'page' : undefined} className={cn('inline-flex min-h-11 items-center rounded-kh-sm text-kh-small text-kh-muted transition-colors hover:text-kh-ink', props.current && l.href === props.current && footCurrentClass, FOCUS)}>\n                        <Text path={['columns', i, 'links', j, 'label']} value={l.label} as=\"span\" />\n                      </a>\n                    </li>\n                    </Gate>\n                  ))}\n                </ul>\n              </nav>\n            ))}\n          </div>\n        </div>\n        {flat && <>\n          {(contactLines.length > 0 || socials.length > 0 || badges.length > 0 || (action && (action.label || editing))) && <div className=\"mt-8\">{extras}</div>}\n          {newsletterContent}\n          {wordmark && <div className=\"kh-footer-wordmark mt-20 pb-3\"><BrandWordmark brand={props.brand} mark={props.mark} /></div>}\n        </>}\n        {hasFamily && (\n          <nav aria-label={family.label || 'Family'} className={cn('flex flex-wrap items-center gap-x-1 pb-2', flat ? 'mt-6' : 'mt-14')}>\n            <Text path={['family', 'label']} value={family.label} as=\"span\" className=\"me-2 text-kh-caption font-medium text-kh-ink\" />\n            <ul className=\"-mx-2 flex flex-wrap\">\n              {family.links.map((l, i) => (\n                <Gate key={i} label={l.label}>\n                <li>\n                  <a href={safeHref(l.href)} className={cn('inline-flex min-h-11 items-center rounded-kh-sm px-2 text-kh-caption text-kh-muted transition-colors hover:text-kh-ink', FOCUS)}>\n                    <Text path={['family', 'links', i, 'label']} value={l.label} as=\"span\" />\n                  </a>\n                </li>\n                </Gate>\n              ))}\n            </ul>\n          </nav>\n        )}\n        <div className={cn('flex flex-col gap-2 border-t border-kh-line pt-4 @3xl:flex-row @3xl:items-center @3xl:justify-between @3xl:gap-6', !wordmark && !hasFamily && 'mt-14')}>\n          {props.brandLayout === 'links' ? (\n            <div className=\"flex flex-col gap-2 @3xl:flex-row @3xl:items-center @3xl:gap-6\">\n              <p className=\"flex items-center gap-(--kh-mark-gap) text-kh-small font-semibold tracking-tight text-kh-ink\"><Mark mark={props.mark} /><Text path={['brand']} value={props.brand} as=\"span\" /></p>\n              <Text path={['legal']} value={props.legal} as=\"p\" className=\"text-kh-caption text-kh-muted\" />\n            </div>\n          ) : <Text path={['legal']} value={props.legal} as=\"p\" className=\"text-kh-caption text-kh-muted\" />}\n          {legalLinks.length > 0 && (\n            <nav aria-label=\"Legal\">\n              <ul className=\"-mx-2 flex flex-wrap @3xl:mx-0 @3xl:-mr-2\">\n                {legalLinks.map((l, i) => (\n                  <Gate key={i} label={l.label}>\n                  <li>\n                    <a href={safeHref(l.href)} className={cn('inline-flex min-h-11 items-center rounded-kh-sm px-2 text-kh-caption text-kh-muted transition-colors hover:text-kh-ink', FOCUS)}>\n                      <Text path={['legalLinks', i, 'label']} value={l.label} as=\"span\" />\n                    </a>\n                  </li>\n                  </Gate>\n                ))}\n              </ul>\n            </nav>\n          )}\n        </div>\n      </Container>\n    </footer>\n  );\n}\n\nexport default withHeadingLevel(FooterColumns);\n"
    }
  ]
}
