{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pagination",
  "title": "Pagination",
  "description": "Page navigation with previous and next links, numbered pages and an ellipsis.",
  "dependencies": [
    "lucide-react@^1.27.0"
  ],
  "registryDependencies": [
    "@pestoui/button",
    "@pestoui/style",
    "@pestoui/utils"
  ],
  "files": [
    {
      "path": "pestoui/ui/pagination.tsx",
      "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from \"lucide-react\"\n\nfunction Pagination({ className, ...props }: React.ComponentProps<\"nav\">) {\n  return (\n    <nav\n      role=\"navigation\"\n      aria-label=\"pagination\"\n      data-slot=\"pagination\"\n      className={cn(\"mx-auto flex w-full justify-center\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction PaginationContent({\n  className,\n  ...props\n}: React.ComponentProps<\"ul\">) {\n  return (\n    <ul\n      data-slot=\"pagination-content\"\n      className={cn(\"flex items-center gap-0.5\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<\"li\">) {\n  return <li data-slot=\"pagination-item\" {...props} />\n}\n\ntype PaginationLinkProps = {\n  isActive?: boolean\n} & Pick<React.ComponentProps<typeof Button>, \"size\"> &\n  React.ComponentProps<\"a\">\n\n/* No motion of its own on the page numbers. Rendering through `Button` already\n   brings the press spring and the hover/active colour tween, and the\n   current-page treatment below is plain colour and border, so it cross-fades on\n   that same transition when the page changes. Adding a second press here would\n   double the scale, and a page number that pops when it becomes current is a lot\n   of ceremony for something a reader passes over ten times a row. Nor does the\n   current-page fill slide between numbers: each page is its own link and the\n   page usually re-renders on navigation, so there is no one indicator to move.\n\n   The one addition is on Previous and Next, below: their chevron leans the way\n   it points while the button is held. */\nfunction PaginationLink({\n  className,\n  isActive,\n  size = \"icon\",\n  ...props\n}: PaginationLinkProps) {\n  return (\n    <Button\n      asChild\n      variant={isActive ? \"outline\" : \"ghost\"}\n      size={size}\n      className={cn(\n        isActive && \"border-selected/30 bg-selected/8 text-selected-ink shadow-none hover:bg-selected/12 hover:text-selected-ink\",\n        className\n      )}\n    >\n      <a\n        aria-current={isActive ? \"page\" : undefined}\n        data-slot=\"pagination-link\"\n        data-active={isActive}\n        {...props}\n      />\n    </Button>\n  )\n}\n\n/* While held, the chevron leans half a --press-lean the way it points — the\n   Switch knob's \"about to go there\", spent on the only part of a pagination\n   control that has a direction. Half, because the glyph is 16px and sits beside\n   a label; the full 4px would read as the icon coming loose. It is `translate`\n   on the svg, which leaves Button's own press (scale and translate-y on the\n   anchor) alone, and the svg is already pointer-events-none, so the click and\n   the navigation are untouched. Under reduced motion --press-lean is 0px and\n   the lean is gone. */\nconst chevronLean =\n  \"transition-[translate] duration-fast ease-out-expo group-active/button:duration-spring-press group-active/button:ease-spring-press\"\n\nfunction PaginationPrevious({\n  className,\n  text = \"Previous\",\n  ...props\n}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {\n  return (\n    <PaginationLink\n      aria-label=\"Go to previous page\"\n      size=\"default\"\n      className={cn(\"pl-1.5!\", className)}\n      {...props}\n    >\n      <ChevronLeftIcon\n        data-icon=\"inline-start\"\n        className={cn(\n          chevronLean,\n          \"group-active/button:translate-x-[calc(var(--press-lean)/-2)]\"\n        )}\n      />\n      <span className=\"hidden sm:block\">{text}</span>\n    </PaginationLink>\n  )\n}\n\nfunction PaginationNext({\n  className,\n  text = \"Next\",\n  ...props\n}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {\n  return (\n    <PaginationLink\n      aria-label=\"Go to next page\"\n      size=\"default\"\n      className={cn(\"pr-1.5!\", className)}\n      {...props}\n    >\n      <span className=\"hidden sm:block\">{text}</span>\n      <ChevronRightIcon\n        data-icon=\"inline-end\"\n        className={cn(\n          chevronLean,\n          \"group-active/button:translate-x-[calc(var(--press-lean)/2)]\"\n        )}\n      />\n    </PaginationLink>\n  )\n}\n\nfunction PaginationEllipsis({\n  className,\n  ...props\n}: React.ComponentProps<\"span\">) {\n  return (\n    <span\n      aria-hidden\n      data-slot=\"pagination-ellipsis\"\n      className={cn(\n        \"flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    >\n      <MoreHorizontalIcon\n      />\n      <span className=\"sr-only\">More pages</span>\n    </span>\n  )\n}\n\nexport {\n  Pagination,\n  PaginationContent,\n  PaginationEllipsis,\n  PaginationItem,\n  PaginationLink,\n  PaginationNext,\n  PaginationPrevious,\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}