"use client"
import{j as s}from"./chunk-KDP6L5T4.mjs";import{AnimatePresence as c}from"framer-motion";import{AlertCircle as m,EyeIcon as u,EyeOffIcon as f}from"lucide-react";import x,{useCallback as g,useState as p}from"react";import{jsx as e,jsxs as o}from"react/jsx-runtime";var b=x.forwardRef(({className:i,type:a,...r},l)=>{let[t,n]=p(!1),d=g(()=>n(!t),[t,n]);return o("div",{children:[o("div",{className:"relative flex",children:[e("input",{type:t?"text":a,className:s("w-full max-w-md rounded-md border border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm",r.error&&"border-red-500 focus:border-red-500 focus:ring-red-500",i),ref:l,...r}),e("div",{className:"group absolute inset-y-0 right-2 flex items-center",children:o(c,{children:[r.error&&e(m,{className:"pointer-events-none size-5 flex-none text-white group-hover:hidden",fill:"#ef4444"}),a==="password"&&e("button",{className:s("px-1",r.error&&"hidden group-hover:block"),type:"button",onClick:()=>d(),"aria-label":t?"Hide password":"Show Password",children:t?e(u,{className:"size-4 flex-none text-gray-500 transition hover:text-gray-700","aria-hidden":!0}):e(f,{className:"size-4 flex-none text-gray-500 transition hover:text-gray-700","aria-hidden":!0})})]})})]}),r.error&&e("span",{className:"mt-2 block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});b.displayName="Input";export{b as a};
