feat(auth): signupm, forgot passowrd, reset password all added

This commit is contained in:
2025-09-25 15:42:35 -05:00
parent a30fa8c9f4
commit 86dea6083e
34 changed files with 3698 additions and 49 deletions

View File

@@ -0,0 +1,52 @@
import { useState } from "react";
import { Label } from "@/components/ui/label";
import { useFieldContext } from "..";
import { Input } from "@/components/ui/input";
import { FieldErrors } from "./FieldErrors";
import { Button } from "@/components/ui/button";
import { Eye, EyeOff } from "lucide-react";
type PasswordInputProps = {
label: string;
required?: boolean;
};
export const InputPassword = ({
label,
required = false,
}: PasswordInputProps) => {
const field = useFieldContext<any>();
const [show, setShow] = useState(false);
return (
<div className="grid gap-3">
<Label htmlFor={field.name}>{label}</Label>
<div className="relative">
<Input
id={field.name}
type={show ? "text" : "password"}
value={field.state.value}
onChange={(e) => field.handleChange(e.target.value)}
onBlur={field.handleBlur}
required={required}
className="pr-10"
/>
<Button
type="button"
variant="ghost"
size="icon"
onClick={() => setShow((p) => !p)}
className="absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7"
tabIndex={-1} // prevent messing with tab order
>
{show ? (
<EyeOff className="h-4 w-4" />
) : (
<Eye className="h-4 w-4" />
)}
</Button>
</div>
<FieldErrors meta={field.state.meta} />
</div>
);
};