{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "swap-form",
  "type": "registry:component",
  "title": "Swap Form",
  "description": "A dynamic authentication form that transitions between Sign In and Sign Up modes with elegant blur and scale effects.",
  "dependencies": [
    "motion",
    "react-icons"
  ],
  "files": [
    {
      "path": "components/watermelon/swap-form.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport { type FC } from \"react\";\nimport { AnimatePresence, motion, type Variants } from \"motion/react\";\nimport { FaGoogle, FaApple } from \"react-icons/fa\";\n\n/*  TYPES  */\n\ninterface SwapFormTexts {\n    signInTitle: string;\n    signUpTitle: string;\n    signInSubtitle: string;\n    signUpSubtitle: string;\n    signInButton: string;\n    signUpButton: string;\n    footerSignIn: string;\n    footerSignUp: string;\n    footerSignInCta: string;\n    footerSignUpCta: string;\n}\n\ninterface SwapFormProps {\n    isSignIn: boolean;\n    onModeChange: (isSignIn: boolean) => void;\n    texts?: Partial<SwapFormTexts>;\n}\n\n/*  DEFAULT TEXTS  */\n\nconst DEFAULT_TEXTS: SwapFormTexts = {\n    signInTitle: \"Sign In\",\n    signUpTitle: \"Create Account\",\n    signInSubtitle: \"Hey friend, welcome back!\",\n    signUpSubtitle: \"Just one more step to get started!\",\n    signInButton: \"Get Sign In Code\",\n    signUpButton: \"Create Account\",\n    footerSignIn: \"Don't have account?\",\n    footerSignUp: \"Already have account?\",\n    footerSignInCta: \"Create Account\",\n    footerSignUpCta: \"Sign In\",\n};\n\n/*  COMPONENT  */\n\nexport const SwapForm: FC<SwapFormProps> = ({\n    isSignIn,\n    onModeChange,\n    texts = {},\n}) => {\n    const mergedTexts = { ...DEFAULT_TEXTS, ...texts };\n\n    /* Animations */\n    const variants: Variants = {\n        initial: {\n            opacity: 0,\n            y: -30,\n            scale: 0.97,\n            filter: \"blur(4px)\",\n        },\n        animate: {\n            opacity: 1,\n            y: 0,\n            scale: 1,\n            filter: \"blur(0px)\",\n        },\n        exit: {\n            opacity: 0,\n            y: -30,\n            scale: 0.97,\n            filter: \"blur(4px)\",\n        },\n    };\n\n    return (\n        <AnimatePresence mode=\"wait\">\n            <motion.div\n                key={isSignIn ? \"signin\" : \"signup\"}\n                variants={variants}\n                initial=\"initial\"\n                animate=\"animate\"\n                exit=\"exit\"\n                transition={{\n                    ease: \"easeIn\",\n                    duration: 0.3,\n                }}\n                className=\"w-xs sm:w-sm bg-[#F6F5FA] dark:bg-zinc-900 shadow-[0_10px_20px_rgba(0,0,0,0.08)] rounded-[32px] overflow-hidden border-[1.5px] border-[#E6E6EF] dark:border-zinc-800 transition-colors\"\n            >\n                <div className=\"p-6 sm:p-8 pb-8 sm:pb-10 border-b-[1.2px] bg-[#FEFEFE] dark:bg-zinc-950 rounded-[28px] border-[#E6E6EF] dark:border-zinc-800 transition-colors\">\n                    <h2 className=\"text-2xl sm:text-3xl font-bold text-[#191919] dark:text-zinc-100 mb-1.5 sm:mb-2 text-center sm:text-left\">\n                        {isSignIn\n                            ? mergedTexts.signInTitle\n                            : mergedTexts.signUpTitle}\n                    </h2>\n\n                    <p className=\"text-[#ADADB0] dark:text-zinc-500 text-[15px] sm:text-[17px] mb-4 sm:mb-6 text-center sm:text-left\">\n                        {isSignIn\n                            ? mergedTexts.signInSubtitle\n                            : mergedTexts.signUpSubtitle}\n                    </p>\n\n                    {/* Social Buttons */}\n                    <div className=\"space-y-2.5 sm:space-y-3\">\n                        <button className=\"w-full flex shadow-sm items-center justify-center gap-2 sm:gap-3 py-3 px-4 border-[1.2px] border-[#E7E7E7] dark:border-zinc-800 rounded-xl font-medium text-[#131313] dark:text-zinc-200 bg-white dark:bg-zinc-900 hover:bg-gray-50 dark:hover:bg-zinc-800 transition-colors text-[15px] sm:text-base\">\n                            <FaGoogle className=\"text-lg sm:text-xl\" />\n                            Continue with Google\n                        </button>\n\n                        <button className=\"w-full flex shadow-sm items-center justify-center gap-2 sm:gap-3 py-3 px-4 border-[1.2px] border-[#E7E7E7] dark:border-zinc-800 rounded-xl font-medium text-[#131313] dark:text-zinc-200 bg-white dark:bg-zinc-900 hover:bg-gray-50 dark:hover:bg-zinc-800 transition-colors text-[15px] sm:text-base\">\n                            <FaApple className=\"text-[22px] sm:text-[26px]\" />\n                            Continue with Apple\n                        </button>\n                    </div>\n\n                    {/* Divider */}\n                    <div className=\"relative my-5 sm:my-6\">\n                        <div className=\"absolute inset-0 flex items-center\">\n                            <div className=\"w-full h-px bg-gradient-to-r from-transparent via-[#ECEBEE] dark:via-zinc-800 to-transparent\" />\n                        </div>\n                        <div className=\"relative flex justify-center text-xs uppercase\">\n                            <span className=\"bg-white dark:bg-zinc-950 text-[12px] sm:text-[14px] px-2 text-gray-400 dark:text-zinc-600\">\n                                OR\n                            </span>\n                        </div>\n                    </div>\n\n                    {/* Email */}\n                    <div className=\"space-y-6 sm:space-y-8\">\n                        <div>\n                            <label className=\"block text-sm font-medium text-[#0B0B0B] dark:text-zinc-300 mb-1.5\">\n                                Email\n                            </label>\n                            <input\n                                type=\"email\"\n                                placeholder=\"name@example.com\"\n                                className=\"w-full px-4 py-2.5 rounded-xl border-[1.2px] border-[#E7E7E7] dark:border-zinc-800 bg-white dark:bg-zinc-900 focus:ring-1 focus:ring-black dark:focus:ring-zinc-400 outline-none shadow-sm text-[15px] sm:text-base\"\n                            />\n                        </div>\n\n                        <motion.button\n                            whileHover={{ scale: 1.015 }}\n                            whileTap={{ scale: 0.97 }}\n                            transition={{ type: \"spring\", stiffness: 400, damping: 25 }}\n                            className=\"w-full py-3 sm:py-3.5 bg-[#030303] dark:bg-zinc-100 text-[#FAFAFA] dark:text-zinc-900 rounded-xl font-semibold shadow-lg text-[15px] sm:text-base\"\n                        >\n                            {isSignIn\n                                ? mergedTexts.signInButton\n                                : mergedTexts.signUpButton}\n                        </motion.button>\n                    </div>\n                </div>\n\n                {/* Footer */}\n                <div className=\"bg-[#F6F5FA] dark:bg-zinc-900 py-3 sm:py-4 text-center\">\n                    <p className=\"text-[#a8a7b0] dark:text-zinc-500 text-[13px] sm:text-[14px]\">\n                        {isSignIn\n                            ? mergedTexts.footerSignIn\n                            : mergedTexts.footerSignUp}\n                        <button\n                            onClick={() => onModeChange(!isSignIn)}\n                            className=\"ml-1 font-medium text-black dark:text-white\"\n                        >\n                            {isSignIn\n                                ? mergedTexts.footerSignInCta\n                                : mergedTexts.footerSignUpCta}\n                        </button>\n                    </p>\n                </div>\n            </motion.div>\n        </AnimatePresence>\n    );\n};"
    }
  ]
}
