From 7e3f875f35939b55a65449edb266436d2adcfecd Mon Sep 17 00:00:00 2001 From: rajun Date: Tue, 27 Oct 2026 16:28:56 +0530 Subject: [PATCH] feat: add password input with show and hide --- app/components/auth/form/password-input.tsx | 39 +++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 app/components/auth/form/password-input.tsx diff --git a/app/components/auth/form/password-input.tsx b/app/components/auth/form/password-input.tsx new file mode 100644 index 0000000..71cd84b --- /dev/null +++ b/app/components/auth/form/password-input.tsx @@ -0,0 +1,39 @@ +import { useState } from 'react'; +import { Lock } from 'lucide-react'; +import { Button } from '~/components/ui/button'; +import { IconInput } from '~/components/ui/icon-input'; +import { InlineMessage } from '~/components/ui/inline-message'; +import type { InputProps } from '~/components/ui/input'; + +export function PasswordInput(props: Omit) { + const [visible, setVisible] = useState(false); + const [capsLock, setCapsLock] = useState(false); + + return ( + <> + setCapsLock(e.getModifierState('CapsLock'))} + trailing={ + + } + {...props} + onBlur={(e) => { + setCapsLock(false); + props.onBlur?.(e); + }} + /> + {capsLock && Caps Lock is on} + + ); +}