add text input validation
Build & Push / Pipeline Tests (push) Failing after 1m5s
Build & Push / Build & Push Docker Image (push) Has been skipped
Test / Type Check (all packages) (push) Failing after 52s
Test / API Unit Tests (push) Has been skipped
Test / Homepage Unit Tests (push) Has been skipped
Test / Carplace Unit Tests (push) Has been skipped
Test / Admin Unit Tests (push) Has been skipped
Test / Dashboard Unit Tests (push) Has been skipped
Test / API Integration Tests (push) Has been skipped

This commit is contained in:
root
2026-08-31 22:51:44 -04:00
parent b99e8d0be4
commit 057d41e1c2
61 changed files with 968 additions and 302 deletions
@@ -210,6 +210,7 @@ function ResetPasswordContent({ locale }: { locale: Locale }) {
type={showPassword ? 'text' : 'password'}
required
minLength={8}
maxLength={128}
value={password}
onChange={(e) => setPassword(e.target.value)}
placeholder="••••••••"
@@ -243,6 +244,7 @@ function ResetPasswordContent({ locale }: { locale: Locale }) {
type={showConfirm ? 'text' : 'password'}
required
minLength={8}
maxLength={128}
value={confirm}
onChange={(e) => setConfirm(e.target.value)}
placeholder="••••••••"
@@ -268,6 +268,7 @@ export function SignInForm({
id="signin-password"
type={showPassword ? 'text' : 'password'}
required
maxLength={128}
value={password}
onChange={(e) => setPassword(e.target.value)}
placeholder="••••••••"
@@ -22,11 +22,15 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(function T
ref,
) {
const dir = bidiValue || type === 'email' || type === 'tel' || type === 'url' ? 'ltr' : undefined;
const maxLength = props.maxLength ?? (type === 'email' ? 254 : type === 'tel' ? 20 : undefined);
const pattern = props.pattern ?? (type === 'tel' ? '^(?:(?:\\+|00)212|0)\\s?[5-7](?:\\s?\\d){8}$' : undefined);
return (
<input
ref={ref}
type={type}
dir={dir}
maxLength={maxLength}
pattern={pattern}
className={classNames(styles.control, className)}
aria-invalid={invalid || undefined}
aria-describedby={describedBy}