{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "navigation-13",
  "type": "registry:block",
  "description": "Table pagination with rows-per-page select and page numbers, plus previous/next chapter article navigation cards.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/designali/blocks/navigation/navigation-13.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport {\n  ArrowLeft,\n  ArrowRight,\n  ChevronLeft,\n  ChevronRight,\n} from \"@designali/icons\"\n\nimport { cn } from \"@workspace/ui/lib/utils\"\n\nfunction pageList(current: number, total: number): (number | \"gap\")[] {\n  if (total <= 7) return Array.from({ length: total }, (_, index) => index + 1)\n  if (current <= 4) return [1, 2, 3, 4, 5, \"gap\", total]\n  if (current >= total - 3) return [1, \"gap\", total - 4, total - 3, total - 2, total - 1, total]\n  return [1, \"gap\", current - 1, current, current + 1, \"gap\", total]\n}\n\nexport default function Navigation13() {\n  const [page, setPage] = useState(6)\n  const [perPage, setPerPage] = useState(20)\n\n  const TOTAL = Math.ceil(468 / perPage)\n  const start = (page - 1) * perPage + 1\n  const end = Math.min(page * perPage, 468)\n\n  return (\n    <section className=\"w-full bg-background py-16\">\n      <div className=\"mx-auto max-w-5xl space-y-12 px-6\">\n        <div className=\"space-y-4\">\n          <p className=\"text-xs tracking-widest text-muted-foreground uppercase\">Table pagination</p>\n          <div className=\"flex flex-col gap-4 border p-4 sm:flex-row sm:items-center sm:justify-between\">\n            <p className=\"text-sm text-muted-foreground\">\n              Showing <span className=\"text-foreground tabular-nums\">{start}-{end}</span> of{\" \"}\n              <span className=\"text-foreground tabular-nums\">468</span> Designali blocks\n            </p>\n            <div className=\"flex items-center gap-4\">\n              <label className=\"hidden items-center gap-2 text-sm text-muted-foreground md:flex\">\n                Rows\n                <select\n                  value={perPage}\n                  onChange={(event) => {\n                    setPerPage(Number(event.target.value))\n                    setPage(1)\n                  }}\n                  className=\"h-8 border bg-background px-2 text-foreground\"\n                >\n                  {[10, 20, 50].map((value) => (\n                    <option key={value} value={value}>{value}</option>\n                  ))}\n                </select>\n              </label>\n              <nav aria-label=\"Pagination\" className=\"flex items-center\">\n                <button\n                  type=\"button\"\n                  aria-label=\"Previous page\"\n                  disabled={page === 1}\n                  onClick={() => setPage(page - 1)}\n                  className=\"flex size-8 items-center justify-center border disabled:opacity-40\"\n                >\n                  <ChevronLeft className=\"size-4\" />\n                </button>\n                {pageList(page, TOTAL).map((item, index) =>\n                  item === \"gap\" ? (\n                    <span key={`gap-${index}`} className=\"flex size-8 items-center justify-center text-sm text-muted-foreground\">\n                      &hellip;\n                    </span>\n                  ) : (\n                    <button\n                      key={item}\n                      type=\"button\"\n                      onClick={() => setPage(item)}\n                      aria-current={page === item ? \"page\" : undefined}\n                      className={cn(\n                        \"hidden size-8 items-center justify-center text-sm tabular-nums transition-colors sm:flex\",\n                        page === item\n                          ? \"flex bg-foreground text-background\"\n                          : \"text-muted-foreground hover:bg-muted hover:text-foreground\"\n                      )}\n                    >\n                      {item}\n                    </button>\n                  )\n                )}\n                <button\n                  type=\"button\"\n                  aria-label=\"Next page\"\n                  disabled={page === TOTAL}\n                  onClick={() => setPage(page + 1)}\n                  className=\"flex size-8 items-center justify-center border disabled:opacity-40\"\n                >\n                  <ChevronRight className=\"size-4\" />\n                </button>\n              </nav>\n            </div>\n          </div>\n        </div>\n\n        <div className=\"space-y-4\">\n          <p className=\"text-xs tracking-widest text-muted-foreground uppercase\">Article navigation</p>\n          <nav aria-label=\"Chapters\" className=\"grid border sm:grid-cols-2\">\n            <a href=\"#\" className=\"group flex flex-col gap-3 border-b p-6 transition-colors hover:bg-muted/50 sm:border-e sm:border-b-0\">\n              <span className=\"flex items-center gap-2 text-xs text-muted-foreground\">\n                <ArrowLeft className=\"size-3.5 transition-transform group-hover:-translate-x-1\" />\n                Chapter 3\n              </span>\n              <span className=\"text-lg font-medium\">Designing the block in Figma</span>\n            </a>\n            <a href=\"#\" className=\"group flex flex-col items-end gap-3 p-6 text-end transition-colors hover:bg-muted/50\">\n              <span className=\"flex items-center gap-2 text-xs text-muted-foreground\">\n                Chapter 5\n                <ArrowRight className=\"size-3.5 transition-transform group-hover:translate-x-1\" />\n              </span>\n              <span className=\"text-lg font-medium\">Shipping it with Next.js</span>\n            </a>\n          </nav>\n          <div className=\"flex items-center gap-3\">\n            <span className=\"text-xs text-muted-foreground tabular-nums\">4 / 12</span>\n            <div className=\"h-1 flex-1 bg-muted\">\n              <div className=\"h-full w-1/3 bg-foreground\" />\n            </div>\n          </div>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "500px"
  },
  "categories": [
    "navigation"
  ]
}