import * as React from "react"; import { cn } from "@/lib/utils"; const LATIN_INPUT_TYPES = new Set(["password", "email", "url", "tel"]); function wantsLatinDigits(props: React.InputHTMLAttributes): boolean { const type = props.type ?? "text"; if (LATIN_INPUT_TYPES.has(type)) return true; if (props.dir === "ltr") return true; const ac = (props.autoComplete ?? "").toLowerCase(); if ( ac === "username" || ac === "email" || ac.includes("password") || ac === "one-time-code" || ac === "tel" || ac === "url" ) { return true; } const id = `${props.id ?? ""} ${props.name ?? ""}`.toLowerCase(); if (id.includes("captcha") || id.includes("password") || id.includes("username") || id.includes("email")) { return true; } return false; } const Input = React.forwardRef>( ({ className, type, ...props }, ref) => { const latin = wantsLatinDigits({ type, ...props }); return ( ); } ); Input.displayName = "Input"; export { Input };