"use client"
import{h as o}from"./chunk-APCYPH3V.mjs";import{EyeIcon as d,EyeOffIcon as c}from"lucide-react";import m,{useCallback as u,useState as p}from"react";import{jsx as t,jsxs as b}from"react/jsx-runtime";var f=m.forwardRef(({className:n,type:s,...r},i)=>{let[e,a]=p(!1),l=u(()=>a(!e),[e,a]);return b("div",{className:"relative",children:[t("input",{type:e?"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",n),ref:i,...r}),s==="password"&&t("button",{className:"absolute inset-y-0 right-0 flex items-center rounded-lg px-2.5",type:"button",onClick:()=>l(),"aria-label":e?"Hide password":"Show Password",children:e?t(c,{className:"h-5 w-5 flex-none transition","aria-hidden":!0}):t(d,{className:"h-5 w-5 flex-none transition","aria-hidden":!0})}),r.error&&t("span",{className:"mt-2 block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});f.displayName="Input";export{f as a};
