"use client"; import * as React from "react"; import { Eye, EyeOff } from "lucide-react"; import { Input } from "@/components/ui/input"; import { cn } from "@/lib/utils"; export function PasswordInput({ className, ...props }: React.InputHTMLAttributes) { const [show, setShow] = React.useState(false); return (
); } export const PASSWORD_RULES = [ { id: "len", label: "At least 10 characters", test: (p: string) => p.length >= 10 }, { id: "case", label: "Upper and lower case letters", test: (p: string) => /[a-z]/.test(p) && /[A-Z]/.test(p) }, { id: "num", label: "A number or symbol", test: (p: string) => /[\d\W_]/.test(p) }, ]; export function PasswordRequirements({ password }: { password: string }) { return ( ); } export function passwordStrong(p: string): boolean { return PASSWORD_RULES.every((r) => r.test(p)); }