'use client' import { useState } from 'react' import { ChipInput, type ChipInputProps, cn } from '@sim/emcn' import { Eye, EyeOff } from 'lucide-react' import { AUTH_CONTROL_HEIGHT } from '@/app/(auth)/components/constants' type PasswordInputProps = Omit /** * A {@link ChipInput} that owns the password reveal toggle — the eye button is * driven through the canonical `endAdornment` slot and the field's invalid state * through the `error` prop, so no consumer hand-rolls the relative wrapper + * absolutely positioned button the auth forms previously duplicated four times. */ export function PasswordInput({ error, className, ...props }: PasswordInputProps) { const [visible, setVisible] = useState(false) return ( setVisible((v) => !v)} aria-label={visible ? 'Hide password' : 'Show password'} className='flex shrink-0 text-[var(--text-icon)] transition-colors hover:text-[var(--text-primary)]' > {visible ? : } } /> ) }