"use client"
import{j as o}from"./chunk-BOVR64ZR.mjs";import{EyeIcon as d,EyeOffIcon as c}from"lucide-react";import u,{useCallback as m,useState as p}from"react";import{jsx as t,jsxs as x}from"react/jsx-runtime";var f=u.forwardRef(({className:n,type:s,...r},i)=>{let[e,a]=p(!1),l=m(()=>a(!e),[e,a]);return x("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(d,{className:"size-4 flex-none text-gray-500 transition hover:text-gray-700","aria-hidden":!0}):t(c,{className:"size-4 flex-none text-gray-500 transition hover:text-gray-700","aria-hidden":!0})}),r.error&&t("span",{className:"block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});f.displayName="Input";export{f as a};
