{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "grid-footer",
  "type": "registry:block",
  "title": "Grid Footer Block",
  "description": "A Grid Footer Block component for displaying a grid footer section.",
  "files": [
    {
      "path": "src/registry/blocks/grid-footer.tsx",
      "type": "registry:block",
      "content": "\"use client\";\n\nimport { useId, useState, type ComponentProps, type FormEvent } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { cn } from \"@/lib/utils\";\n\nexport type GridFooterLink = { label: string; href: string };\nexport type GridFooterColumn = { title: string; links: GridFooterLink[] };\nexport type GridFooterNewsletterValues = { email: string };\n\nexport type GridFooterProps = {\n  brand?: string;\n  description?: string;\n  columns?: GridFooterColumn[];\n  newsletterTitle?: string;\n  newsletterNote?: string;\n  onSubmit?: (values: GridFooterNewsletterValues) => void | Promise<void>;\n  year?: number;\n} & Omit<ComponentProps<\"footer\">, \"onSubmit\">;\n\nconst DEFAULT_COLUMNS: GridFooterColumn[] = [\n  {\n    title: \"Product\",\n    links: [\n      { label: \"Invoicing\", href: \"#\" },\n      { label: \"Expenses\", href: \"#\" },\n      { label: \"Month-end close\", href: \"#\" },\n      { label: \"Pricing\", href: \"#\" },\n    ],\n  },\n  {\n    title: \"Help\",\n    links: [\n      { label: \"Guides\", href: \"#\" },\n      { label: \"VAT calendar\", href: \"#\" },\n      { label: \"Talk to an accountant\", href: \"#\" },\n      { label: \"Status\", href: \"#\" },\n    ],\n  },\n  {\n    title: \"Company\",\n    links: [\n      { label: \"About\", href: \"#\" },\n      { label: \"Careers\", href: \"#\" },\n      { label: \"Privacy\", href: \"#\" },\n      { label: \"Terms\", href: \"#\" },\n    ],\n  },\n];\n\nconst linkClass =\n  \"underline-offset-4 outline-none hover:underline focus-visible:underline focus-visible:ring-2 focus-visible:ring-ring\";\n\n/**\n * Strict bordered grid footer: every region sits in a hairline cell,\n * including a newsletter mini-form.\n */\nexport function GridFooter({\n  brand = \"Ledgerline\",\n  description = \"Bookkeeping for studios of 2 to 40 people. Invoices out, receipts matched, books closed by the 5th.\",\n  columns = DEFAULT_COLUMNS,\n  newsletterTitle = \"The Monthly Close\",\n  newsletterNote = \"One email on the first Monday of the month. Deadlines, rate changes, nothing else.\",\n  onSubmit,\n  year = 2026,\n  className,\n  ...props\n}: GridFooterProps) {\n  const inputId = useId();\n  const [state, setState] = useState<\"idle\" | \"sending\" | \"done\">(\"idle\");\n\n  async function handleSubmit(event: FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    const form = event.currentTarget;\n    const email = String(new FormData(form).get(\"email\") ?? \"\");\n    setState(\"sending\");\n    try {\n      await onSubmit?.({ email });\n      form.reset();\n      setState(\"done\");\n    } catch {\n      setState(\"idle\");\n    }\n  }\n\n  return (\n    <footer\n      data-slot=\"grid-footer\"\n      className={cn(\"w-full bg-background text-foreground\", className)}\n      {...props}\n    >\n      <div className=\"mx-auto max-w-6xl px-6 py-20 md:py-28\">\n        <div className=\"grid grid-cols-1 border-l border-t sm:grid-cols-2 lg:grid-cols-4\">\n          <div className=\"border-b border-r p-6 sm:col-span-2 lg:col-span-2\">\n            <h2 className=\"text-2xl font-semibold tracking-tight\">{brand}</h2>\n            <p className=\"mt-3 max-w-sm text-sm leading-relaxed text-muted-foreground\">\n              {description}\n            </p>\n          </div>\n\n          <div className=\"border-b border-r p-6 sm:col-span-2 lg:col-span-2\">\n            <form onSubmit={handleSubmit} className=\"space-y-3\">\n              <Label\n                htmlFor={inputId}\n                className=\"font-mono text-xs uppercase tracking-wider text-muted-foreground\"\n              >\n                {newsletterTitle}\n              </Label>\n              <div className=\"flex gap-2\">\n                <Input\n                  id={inputId}\n                  name=\"email\"\n                  type=\"email\"\n                  required\n                  autoComplete=\"email\"\n                  placeholder=\"you@studio.com\"\n                  disabled={state === \"sending\"}\n                />\n                <Button type=\"submit\" disabled={state === \"sending\"}>\n                  {state === \"sending\" ? \"Subscribing…\" : \"Subscribe\"}\n                </Button>\n              </div>\n              <p aria-live=\"polite\" className=\"text-xs text-muted-foreground\">\n                {state === \"done\"\n                  ? \"You're on the list. First issue lands next month.\"\n                  : newsletterNote}\n              </p>\n            </form>\n          </div>\n\n          {columns.map((column, index) => (\n            <nav\n              key={column.title}\n              aria-label={column.title}\n              className=\"border-b border-r p-6\"\n            >\n              <p className=\"flex justify-between font-mono text-xs uppercase tracking-wider text-muted-foreground\">\n                <span>{column.title}</span>\n                <span className=\"tabular-nums\">\n                  {String(index + 1).padStart(2, \"0\")}\n                </span>\n              </p>\n              <ul className=\"mt-6 space-y-2.5 text-sm\">\n                {column.links.map((link) => (\n                  <li key={link.label}>\n                    <a href={link.href} className={linkClass}>\n                      {link.label}\n                    </a>\n                  </li>\n                ))}\n              </ul>\n            </nav>\n          ))}\n\n          <div className=\"flex flex-col justify-end border-b border-r bg-muted p-6 text-xs text-muted-foreground\">\n            <p className=\"tabular-nums\">© {year} {brand} Ltd.</p>\n            <p className=\"mt-1\">Registered in England, No. 11842907.</p>\n          </div>\n        </div>\n      </div>\n    </footer>\n  );\n}\n"
    }
  ],
  "registryDependencies": [
    "button",
    "input",
    "label"
  ]
}
