{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "swap-form-base",
  "type": "registry:component",
  "title": "Swap Form (base)",
  "description": "Theme-ready base variant of 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=\"theme-injected font-sans w-xs sm:w-sm bg-muted shadow-[0_10px_20px_rgba(0,0,0,0.08)] rounded-2xl overflow-hidden border border-border transition-colors\"\n            >\n                <div className=\"p-6 sm:p-8 pb-8 sm:pb-10 border-b bg-card rounded-2xl border-border transition-colors\">\n                    <h2 className=\"font-sans text-2xl sm:text-3xl font-bold text-foreground 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=\"font-sans text-muted-foreground 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=\"font-sans w-full flex shadow-sm items-center justify-center gap-2 sm:gap-3 py-3 px-4 border border-border rounded-xl font-medium text-foreground bg-card hover:bg-muted 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=\"font-sans w-full flex shadow-sm items-center justify-center gap-2 sm:gap-3 py-3 px-4 border border-border rounded-xl font-medium text-foreground bg-card hover:bg-muted 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-linear-to-r from-transparent via-border to-transparent\" />\n                        </div>\n                        <div className=\"relative flex justify-center text-xs uppercase\">\n                            <span className=\"bg-transparent font-sans text-[12px] sm:text-[14px] px-2 text-muted-foreground\">\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=\"font-sans block text-sm font-medium text-foreground mb-1.5\">\n                                Email\n                            </label>\n                            <input\n                                type=\"email\"\n                                placeholder=\"name@example.com\"\n                                className=\"font-sans w-full px-4 py-2.5 rounded-xl border border-border bg-input focus:ring-1 focus:ring-ring outline-none shadow-sm text-[15px] sm:text-base text-foreground\"\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=\"font-sans w-full py-3 sm:py-3.5 bg-primary text-primary-foreground 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-muted py-3 sm:py-4 text-center\">\n                    <p className=\"font-sans text-muted-foreground 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-foreground\"\n                        >\n                            {isSignIn\n                                ? mergedTexts.footerSignInCta\n                                : mergedTexts.footerSignUpCta}\n                        </button>\n                    </p>\n                </div>\n            </motion.div>\n        </AnimatePresence>\n    );\n};"
    }
  ]
}
