{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pagination",
  "title": "Pagination",
  "description": "One raised key glides between page numbers and the range count rolls.",
  "dependencies": [
    "@ui-sdk/core@0.1.0-beta.2",
    "@ui-sdk/react@0.1.0-beta.2"
  ],
  "registryDependencies": [
    "@keyframery/motion"
  ],
  "files": [
    {
      "path": "registry/components/keyframery/primitives/pagination.tsx",
      "content": "\"use client\"\n\n/* Animated drop-in for `@ui-sdk/react/pagination`: same parts, same props. Swap the import and keep your code.\n   This file adds motion only. Colours, radii, shadows and spacing stay yours.\n\n   - Glide: one current-page key, drawn by the list as its `before:`, glides from page to page on a\n     spring (CSS anchors). Give it your own surface with `before:` classes on PaginationList.\n   - Press: pages and steps give under the pointer and spring back.\n   - Roll: `PaginationRoll` shows a number whose digits roll when it changes, for a count like \"41 to 50\". */\n\nimport {\n  PaginationFirst as PaginationFirstPart,\n  PaginationItem as PaginationItemPart,\n  PaginationLast as PaginationLastPart,\n  PaginationLink as PaginationLinkPart,\n  PaginationList as PaginationListPart,\n  PaginationNext as PaginationNextPart,\n  PaginationPrevious as PaginationPreviousPart,\n} from \"@ui-sdk/react/pagination\"\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport * from \"@ui-sdk/react/pagination\"\n\nfunction PaginationList({ className, ...props }: React.ComponentProps<typeof PaginationListPart>) {\n  return (\n    <PaginationListPart\n      className={cn(\n        \"relative isolate [anchor-scope:--kf-page]\",\n        \"before:pointer-events-none before:absolute before:-z-10 before:opacity-0 before:content-[''] before:[position-anchor:--kf-page]\",\n        \"before:bg-[color-mix(in_oklch,currentColor_9%,transparent)]\",\n        \"before:top-[anchor(top)] before:right-[anchor(right)] before:bottom-[anchor(bottom)] before:left-[anchor(left)]\",\n        \"before:[transition:top_calc(340ms*var(--kf-speed,1))_var(--ease-spring),right_calc(340ms*var(--kf-speed,1))_var(--ease-spring),bottom_calc(340ms*var(--kf-speed,1))_var(--ease-spring),left_calc(340ms*var(--kf-speed,1))_var(--ease-spring),opacity_calc(160ms*var(--kf-speed,1))_var(--ease-house)]\",\n        \"has-[[data-slot=pagination-link][data-current]]:before:opacity-100 motion-reduce:before:[transition:none]!\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* A page that comes into the range as it shifts arrives where it lands. */\nfunction PaginationItem({ className, ...props }: React.ComponentProps<typeof PaginationItemPart>) {\n  return (\n    <PaginationItemPart\n      className={cn(\n        \"transition-[opacity,scale,filter] duration-[calc(300ms*var(--kf-speed,1))] ease-spring starting:scale-75 starting:opacity-0 starting:blur-[3px] motion-reduce:transition-none!\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nconst press =\n  \"transition-[scale] duration-[calc(200ms*var(--kf-speed,1))] ease-pop active:scale-[0.92] data-disabled:active:scale-100 motion-reduce:transition-none!\"\n\n/* The current page names itself as the key's anchor. */\nfunction PaginationLink({ className, ...props }: React.ComponentProps<typeof PaginationLinkPart>) {\n  return (\n    <PaginationLinkPart\n      className={cn(\"data-current:[anchor-name:--kf-page]\", press, className)}\n      {...props}\n    />\n  )\n}\n\nfunction PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationPreviousPart>) {\n  return <PaginationPreviousPart className={cn(press, className)} {...props} />\n}\n\nfunction PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationNextPart>) {\n  return <PaginationNextPart className={cn(press, className)} {...props} />\n}\n\nfunction PaginationFirst({ className, ...props }: React.ComponentProps<typeof PaginationFirstPart>) {\n  return <PaginationFirstPart className={cn(press, className)} {...props} />\n}\n\nfunction PaginationLast({ className, ...props }: React.ComponentProps<typeof PaginationLastPart>) {\n  return <PaginationLastPart className={cn(press, className)} {...props} />\n}\n\n/* Roll: each digit is a column of 0 to 9 that slides to its value on a spring. Screen readers\n   read the plain number. */\nfunction PaginationRoll({\n  value,\n  className,\n  ...props\n}: Omit<React.ComponentProps<\"span\">, \"children\"> & { value: number }) {\n  const digits = String(Math.max(0, Math.round(value))).split(\"\")\n  return (\n    <span data-slot=\"pagination-roll\" className={cn(\"relative inline-flex tabular-nums\", className)} {...props}>\n      <span className=\"sr-only\">{value}</span>\n      <span aria-hidden className=\"inline-flex h-[1lh] overflow-hidden\">\n        {digits.map((digit, index) => (\n          <span\n            key={digits.length - index}\n            style={{ \"--d\": Number(digit) } as React.CSSProperties}\n            className=\"flex flex-col transition-[translate] duration-[calc(500ms*var(--kf-speed,1))] ease-spring [translate:0_calc(var(--d)*-1lh)] motion-reduce:transition-none!\"\n          >\n            {Array.from({ length: 10 }, (_, d) => (\n              <span key={d} className=\"h-[1lh]\">\n                {d}\n              </span>\n            ))}\n          </span>\n        ))}\n      </span>\n    </span>\n  )\n}\n\nexport {\n  PaginationFirst,\n  PaginationItem,\n  PaginationLast,\n  PaginationLink,\n  PaginationList,\n  PaginationNext,\n  PaginationPrevious,\n  PaginationRoll,\n}\n",
      "type": "registry:component",
      "target": "components/keyframery/primitives/pagination.tsx"
    },
    {
      "path": "registry/components/keyframery/pagination.tsx",
      "content": "\"use client\"\n\n/* Styled pagination: the animated primitive plus the Keyframery look. */\n\nimport * as React from \"react\"\n\nimport {\n  Pagination as PaginationRoot,\n  PaginationEllipsis as PaginationEllipsisPart,\n  PaginationFirst as PaginationFirstPart,\n  PaginationItem as PaginationItemPart,\n  PaginationLast as PaginationLastPart,\n  PaginationLink as PaginationLinkPart,\n  PaginationList as PaginationListPart,\n  PaginationNext as PaginationNextPart,\n  PaginationPrevious as PaginationPreviousPart,\n  PaginationRoll,\n  createPaginationController,\n  paginationRange,\n} from \"@/components/keyframery/primitives/pagination\"\nimport { cn } from \"@/lib/utils\"\n\n/* Every button in the row shares one box. */\nconst pageBox =\n  \"relative inline-flex h-8 min-w-8 shrink-0 cursor-pointer items-center justify-center gap-1 rounded-[9px] px-2 text-[13px] leading-none font-medium text-muted-foreground tabular-nums whitespace-nowrap outline-none select-none [&_svg]:size-4 [&_svg]:shrink-0\"\n\n/* The primitive springs a pressed button back; this colours the hover. */\nconst press =\n  \"transition-[color,background-color,scale] duration-[calc(200ms*var(--kf-speed,1))] hover:text-foreground \" +\n  \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-muted motion-reduce:transition-none!\"\n\n/* A step that has reached its end stays focusable but reads as unavailable. */\nconst step = cn(\n  pageBox,\n  press,\n  \"hover:bg-foreground/[0.045] data-disabled:cursor-default data-disabled:opacity-40 data-disabled:hover:bg-transparent data-disabled:hover:text-muted-foreground\",\n)\n\nfunction ChevronLeftIcon() {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n      <path d=\"M9.5 3.5 5 8l4.5 4.5\" />\n    </svg>\n  )\n}\n\nfunction ChevronRightIcon() {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n      <path d=\"M6.5 3.5 11 8l-4.5 4.5\" />\n    </svg>\n  )\n}\n\nfunction ChevronsLeftIcon() {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n      <path d=\"M8 3.5 3.5 8 8 12.5M12.5 3.5 8 8l4.5 4.5\" />\n    </svg>\n  )\n}\n\nfunction ChevronsRightIcon() {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n      <path d=\"M8 3.5 12.5 8 8 12.5M3.5 3.5 8 8l-4.5 4.5\" />\n    </svg>\n  )\n}\n\nfunction Pagination({ className, ...props }: React.ComponentProps<typeof PaginationRoot>) {\n  return <PaginationRoot className={cn(\"flex w-fit\", className)} {...props} />\n}\n\n/* The row is a well, and the current-page key the primitive glides along it is a raised key.\n   Without children it lays out Previous, the pages with their gaps, and Next. */\nfunction PaginationList({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof PaginationListPart>) {\n  return (\n    <PaginationListPart\n      className={cn(\n        \"flex items-center gap-0.5 rounded-[12px] bg-muted p-1\",\n        \"shadow-[inset_0_1px_2px_rgb(0_0_0/0.07),inset_0_0_0_1px_rgb(0_0_0/0.035)]\",\n        \"dark:shadow-[inset_0_1px_2px_rgb(0_0_0/0.5),inset_0_0_0_1px_rgb(255_255_255/0.04)]\",\n        \"before:rounded-[9px] before:bg-background before:shadow-[0_0_0_1px_rgb(0_0_0/0.06),0_1px_1px_rgb(0_0_0/0.05),0_3px_6px_-2px_rgb(0_0_0/0.1)]\",\n        \"dark:before:bg-accent dark:before:shadow-[0_0_0_1px_rgb(255_255_255/0.07),inset_0_1px_0_rgb(255_255_255/0.08),0_2px_6px_-1px_rgb(0_0_0/0.6)]\",\n        className,\n      )}\n      {...props}\n    >\n      {children ??\n        (({ items }) => (\n          <>\n            <PaginationItem>\n              <PaginationPrevious />\n            </PaginationItem>\n            {items.map((item) => (\n              <PaginationItem key={item}>\n                {typeof item === \"number\" ? <PaginationLink page={item} /> : <PaginationEllipsis />}\n              </PaginationItem>\n            ))}\n            <PaginationItem>\n              <PaginationNext />\n            </PaginationItem>\n          </>\n        ))}\n    </PaginationListPart>\n  )\n}\n\nfunction PaginationItem({ className, ...props }: React.ComponentProps<typeof PaginationItemPart>) {\n  return <PaginationItemPart className={cn(\"flex\", className)} {...props} />\n}\n\n/* A page. The current one sits on the key the list glides under it, so it only darkens its number. */\nfunction PaginationLink({ className, ...props }: React.ComponentProps<typeof PaginationLinkPart>) {\n  return (\n    <PaginationLinkPart\n      className={cn(\n        pageBox,\n        press,\n        \"data-current:text-foreground data-current:cursor-default\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction PaginationPrevious({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof PaginationPreviousPart>) {\n  return (\n    <PaginationPreviousPart\n      aria-label={children ? undefined : \"Previous page\"}\n      className={cn(step, className)}\n      {...props}\n    >\n      {children ?? <ChevronLeftIcon />}\n    </PaginationPreviousPart>\n  )\n}\n\nfunction PaginationNext({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof PaginationNextPart>) {\n  return (\n    <PaginationNextPart\n      aria-label={children ? undefined : \"Next page\"}\n      className={cn(step, className)}\n      {...props}\n    >\n      {children ?? <ChevronRightIcon />}\n    </PaginationNextPart>\n  )\n}\n\nfunction PaginationFirst({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof PaginationFirstPart>) {\n  return (\n    <PaginationFirstPart\n      aria-label={children ? undefined : \"First page\"}\n      className={cn(step, className)}\n      {...props}\n    >\n      {children ?? <ChevronsLeftIcon />}\n    </PaginationFirstPart>\n  )\n}\n\nfunction PaginationLast({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof PaginationLastPart>) {\n  return (\n    <PaginationLastPart\n      aria-label={children ? undefined : \"Last page\"}\n      className={cn(step, className)}\n      {...props}\n    >\n      {children ?? <ChevronsRightIcon />}\n    </PaginationLastPart>\n  )\n}\n\n/* The gap: three quiet dots in a page-sized box. */\nfunction PaginationEllipsis({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof PaginationEllipsisPart>) {\n  return (\n    <PaginationEllipsisPart\n      className={cn(\n        \"inline-flex h-8 w-6 items-center justify-center text-muted-foreground/70 select-none [&_svg]:size-4\",\n        className,\n      )}\n      {...props}\n    >\n      {children ?? (\n        <svg viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden>\n          <circle cx=\"3.5\" cy=\"8\" r=\"1\" />\n          <circle cx=\"8\" cy=\"8\" r=\"1\" />\n          <circle cx=\"12.5\" cy=\"8\" r=\"1\" />\n        </svg>\n      )}\n    </PaginationEllipsisPart>\n  )\n}\n\nexport {\n  Pagination,\n  PaginationEllipsis,\n  PaginationFirst,\n  PaginationItem,\n  PaginationLast,\n  PaginationLink,\n  PaginationList,\n  PaginationNext,\n  PaginationPrevious,\n  PaginationRoll,\n  createPaginationController,\n  paginationRange,\n}\n",
      "type": "registry:component",
      "target": "components/keyframery/pagination.tsx"
    }
  ],
  "type": "registry:component"
}