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