"use client"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { AnimatePresence, LayoutGroup, motion, useReducedMotion, type Variants, } from "motion/react"; import { useCallback, useId, useState } from "react"; import { EASE_OUT, SPRING_LAYOUT, SPRING_PRESS, SPRING_SWAP } from "@/lib/ease"; import { useHoverCapable } from "@/lib/hooks/use-hover-capable"; import { TOUCH_TARGET_CLASS, TOUCH_TARGET_Y_CLASS } from "@/lib/touch"; import { cn } from "@/lib/utils"; export type PaginationVariant = "numbers" | "dots"; export type PaginationItem = number | "ellipsis"; export interface PaginationProps { /** Total number of pages (1-based). */ total: number; /** Controlled current page (1-based). */ page?: number; /** Initial page for uncontrolled use. */ defaultPage?: number; onPageChange?: (page: number) => void; /** Pages shown on each side of the current page. */ siblings?: number; /** Pages always shown at the start and end. */ boundaries?: number; /** `numbers` renders page buttons; `dots` is a compact indicator row. */ variant?: PaginationVariant; /** Most dots shown at once in the `dots` variant; the window follows the page. */ maxDots?: number; /** Render previous / next controls. */ showControls?: boolean; disabled?: boolean; /** Accessible name for the `