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