Skip to content

The Open Source DocuSign Alternative.

refactor: password input component

nafees nazik4733f1e84bdb
diff --git a/packages/ui/primitives/input.tsx b/packages/ui/primitives/input.tsx
index ac739c984..1a5fba1bb 100644
--- a/packages/ui/primitives/input.tsx
+++ b/packages/ui/primitives/input.tsx
@@ -1,9 +1,6 @@
import * as React from 'react';
-import { Eye, EyeOff } from 'lucide-react';
-
import { cn } from '../lib/utils';
-import { Button } from './button';
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
@@ -28,38 +25,4 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
Input.displayName = 'Input';
-const PasswordInput = React.forwardRef<HTMLInputElement, InputProps>(
- ({ className, ...props }, ref) => {
- const [showPassword, setShowPassword] = React.useState(false);
-
- return (
- <div className="relative">
- <Input
- id="password"
- type={showPassword ? 'text' : 'password'}
- className={cn('pr-10', className)}
- ref={ref}
- {...props}
- />
-
- <Button
- variant="link"
- type="button"
- className="absolute right-0 top-0 flex h-full items-center justify-center pr-3"
- aria-label={showPassword ? 'Mask password' : 'Reveal password'}
- onClick={() => setShowPassword((show) => !show)}
- >
- {showPassword ? (
- <EyeOff aria-hidden className="text-muted-foreground h-5 w-5" />
- ) : (
- <Eye aria-hidden className="text-muted-foreground h-5 w-5" />
- )}
- </Button>
- </div>
- );
- },
-);
-
-PasswordInput.displayName = 'Input';
-
-export { Input, PasswordInput };
+export { Input };