{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pagination",
  "title": "Pagination",
  "description": "A pagination component for navigating pages.",
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "src/components/ui/pagination.tsx",
      "content": "\"use client\";\n\nimport React, { forwardRef } from \"react\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"@/stories/lib/utils\";\n// Corrected: Import `VariantProps` and pass `buttonVariants` as the type argument.\nimport { buttonVariants } from \"./button\";\nimport type { VariantProps } from \"class-variance-authority\";\n\nimport { Button } from \"./button\";\nimport { CaretLeft, CaretRight, DotsThree } from \"phosphor-react\";\n\n// Main pagination wrapper\nconst Pagination = ({ className, ...props }: ComponentProps<\"nav\">) => (\n  <nav\n    role=\"navigation\"\n    aria-label=\"pagination\"\n    className={cn(\"flex justify-center\", className)}\n    {...props}\n  />\n);\nPagination.displayName = \"Pagination\";\n\n// Pagination content (ul)\nconst PaginationContent = forwardRef<HTMLUListElement, ComponentProps<\"ul\">>(\n  ({ className, ...props }, ref) => (\n    <ul\n      ref={ref}\n      className={cn(\"flex flex-row items-center gap-1\", className)}\n      {...props}\n    />\n  ),\n);\nPaginationContent.displayName = \"PaginationContent\";\n\n// List item wrapper\nconst PaginationItem = forwardRef<HTMLLIElement, ComponentProps<\"li\">>(\n  ({ className, ...props }, ref) => (\n    <li ref={ref} className={cn(\"\", className)} {...props} />\n  ),\n);\nPaginationItem.displayName = \"PaginationItem\";\n\n// Link button\ntype PaginationLinkProps = {\n  isActive?: boolean;\n  year?: string;\n  children?: React.ReactNode; // ✅ Must accept children\n} & Pick<VariantProps<typeof buttonVariants>, \"size\"> & // Corrected: Pass `buttonVariants` here\n  ComponentProps<\"button\">;\n\nconst PaginationLink = ({\n  className,\n  isActive,\n  size = \"md\",\n  year,\n  children,\n  ...props\n}: PaginationLinkProps) => (\n  <div className=\"flex flex-col items-center justify-center\">\n    <Button\n      size={size}\n      variant={isActive ? \"primary\" : \"white\"}\n      className={cn(\n        \"flex h-9 w-9  items-center justify-center rounded-full text-sm font-medium transition-colors focus-visible:outline-none focus:outline-transparent disabled:pointer-events-none disabled:opacity-50 disabled:bg-transparent hover:bg-accent hover:text-accent-foreground\",\n        isActive && \"bg-primary text-primary-foreground\",\n        className,\n      )}\n      type=\"button\"\n      aria-current={isActive ? \"page\" : undefined}\n      {...props}\n    >\n      {children}\n    </Button>\n    {year && (\n      <span className=\"text-muted-foreground text-center text-sm\">{year}</span>\n    )}\n  </div>\n);\nPaginationLink.displayName = \"PaginationLink\";\n\n// Previous Button with icon\nconst PaginationPrevious = ({\n  className,\n  children,\n  ...props\n}: ComponentProps<typeof PaginationLink>) => (\n  <PaginationLink\n    aria-label=\"Go to previous page\"\n    className={cn(\"gap-1 pl-2.5 h-auto w-auto\", className)}\n    {...props}\n  >\n    {children ?? (\n      <>\n        <CaretLeft className=\"size-6 text-primary\" />\n        <span className=\"sr-only\">Previous</span>\n      </>\n    )}\n  </PaginationLink>\n);\n\nPaginationPrevious.displayName = \"PaginationPrevious\";\n\n// Next Button with icon\nconst PaginationNext = ({\n  className,\n  children,\n  ...props\n}: ComponentProps<typeof PaginationLink>) => (\n  <PaginationLink\n    aria-label=\"Go to next page\"\n    className={cn(\"gap-1 pr-2.5 h-auto w-auto\", className)}\n    {...props}\n  >\n    {children ?? (\n      <>\n        <span className=\"sr-only\">Next</span>\n        <CaretRight className=\"size-6 text-primary\" />\n      </>\n    )}\n  </PaginationLink>\n);\n\nPaginationNext.displayName = \"PaginationNext\";\n\n// Ellipsis\nconst PaginationEllipsis = ({\n  className,\n  ...props\n}: ComponentProps<\"span\">) => (\n  <span\n    aria-hidden\n    className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n    {...props}\n  >\n    <DotsThree className=\"size-5\" />\n    <span className=\"sr-only\">More pages</span>\n  </span>\n);\nPaginationEllipsis.displayName = \"PaginationEllipsis\";\n\n// ✅ Export everything\nexport {\n  Pagination,\n  PaginationContent,\n  PaginationLink,\n  PaginationItem,\n  PaginationPrevious,\n  PaginationNext,\n  PaginationEllipsis,\n};\n",
      "type": "registry:ui",
      "target": "components/ui/pagination.tsx"
    }
  ],
  "type": "registry:ui"
}