{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pagination-animated",
  "dependencies": [
    "lucide-react",
    "motion",
    "react-icons"
  ],
  "files": [
    {
      "path": "src/components/watermelon-ui/pagination-animated.tsx",
      "content": "\"use client\";\n\nimport { useState, useEffect, type FC } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { HiOutlineArrowLeft, HiOutlineArrowRight } from \"react-icons/hi2\";\nimport { Sun, Moon } from \"lucide-react\";\n\n/* --- Props --- */\ninterface PaginationProps {\n  totalPages?: number;\n  initialPage?: number;\n}\n\n/* --- Main Component --- */\nexport const Pagination: FC<PaginationProps> = ({ totalPages = 15, initialPage = 1 }) => {\n    const [page, setPage] = useState<number>(initialPage);\n    const [direction, setDirection] = useState<number>(0);\n    const [isDark, setIsDark] = useState<boolean>(false);\n\n    // Theme Sync logic\n    useEffect(() => {\n        if (isDark) {\n            document.documentElement.classList.add('dark');\n        } else {\n            document.documentElement.classList.remove('dark');\n        }\n    }, [isDark]);\n\n    const paginate = (dir: number) => {\n        if ((page === 1 && dir === -1) || (page === totalPages && dir === 1)) return;\n        setDirection(dir);\n        setPage((p) => Math.min(totalPages, Math.max(1, p + dir)));\n    };\n\n    return (\n        <div className=\"w-full h-screen flex flex-col justify-center items-center bg-white dark:bg-zinc-950 transition-colors duration-500\">\n            \n            {/* Theme Toggle Button */}\n            <button \n                onClick={() => setIsDark(!isDark)}\n                className=\"mb-12 p-3 rounded-full bg-zinc-100 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 transition-all active:scale-90 shadow-sm\"\n                aria-label=\"Toggle Theme\"\n            >\n                {isDark ? <Sun className=\"text-yellow-400\" size={20} /> : <Moon className=\"text-zinc-500\" size={20} />}\n            </button>\n\n            <div className=\"flex justify-center\">\n                <div className=\"flex items-center gap-3 px-1 py-1 rounded-full bg-[#F0EFF6] dark:bg-zinc-900 border border-[#f0eff6dd] dark:border-zinc-800\">\n\n                    {/* Left Button */}\n                    <motion.button\n                        whileHover={{\n                            backgroundColor: isDark ? \"#fff\" : \"#000\",\n                            color: isDark ? \"#000\" : \"#fff\",\n                        }}\n                        whileTap={{ scale: 0.9 }}\n                        transition={{ type: \"spring\", stiffness: 400, damping: 20 }}\n                        onClick={() => paginate(-1)}\n                        disabled={page === 1}\n                        className={`w-14 h-14 rounded-full bg-white dark:bg-zinc-800 text-[#030303] dark:text-white shadow flex items-center justify-center text-xl transition-colors duration-200 \n                            ${page === 1 ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}`}\n                    >\n                        <HiOutlineArrowLeft size={28} strokeWidth={1.5} />\n                    </motion.button>\n\n\n                    {/* Counter Section */}\n                    <div className=\"flex items-center justify-center pr-1 mr-1 text-[#59585F] dark:text-zinc-400 text-xl font-bold leading-none select-none\">\n\n                        {/* Animated Page Number */}\n                        <div className=\"relative w-8 h-8 flex items-center justify-center overflow-hidden\">\n                            <AnimatePresence mode=\"popLayout\" initial={false}>\n                                <motion.span\n                                    key={page}\n                                    initial={{\n                                        y: direction > 0 ? 12 : -12,\n                                        opacity: 0,\n                                        filter: \"blur(4px)\",\n                                    }}\n                                    animate={{\n                                        y: 0,\n                                        opacity: 1,\n                                        filter: \"blur(0px)\",\n                                    }}\n                                    exit={{\n                                        y: direction > 0 ? -12 : 12,\n                                        opacity: 0,\n                                        filter: \"blur(4px)\",\n                                    }}\n                                    transition={{\n                                        type: \"spring\",\n                                        stiffness: 220,   \n                                        damping: 22,     \n                                        mass: 0.45,       \n                                    }}\n                                    className=\"absolute inset-0 flex items-center justify-center text-[#030303] dark:text-white\"\n                                >\n                                    {page}\n                                </motion.span>\n                            </AnimatePresence>\n                        </div>\n\n                        {/* Static text */}\n                        <span className=\"flex items-center h-8 leading-none ml-1\">\n                            of {totalPages}\n                        </span>\n                    </div>\n\n\n                    {/* Right Button */}\n                    <motion.button\n                        whileHover={{\n                            backgroundColor: isDark ? \"#fff\" : \"#000\",\n                            color: isDark ? \"#000\" : \"#fff\",\n                        }}\n                        whileTap={{ scale: 0.9 }}\n                        transition={{ type: \"spring\", stiffness: 400, damping: 20 }}\n                        onClick={() => paginate(1)}\n                        disabled={page === totalPages}\n                        className={`w-14 h-14 rounded-full bg-white dark:bg-zinc-800 text-[#030303] dark:text-white shadow flex items-center justify-center text-xl transition-colors duration-200\n                            ${page === totalPages ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}`}\n                    >\n                        <HiOutlineArrowRight size={28} strokeWidth={1.5} />\n                    </motion.button>\n\n                </div>\n            </div>\n        </div>\n    );\n}\n\n",
      "type": "registry:ui",
      "target": "components/ui/pagination-animated.tsx"
    }
  ],
  "type": "registry:ui"
}
