From bcebe1d96a717b4d62440c15a4a1bb6abcff8ff3 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Tue, 6 Oct 2026 22:06:43 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=90=20refactor:=20Give=20Sign-In=20Con?= =?UTF-8?q?trols=20Button,=20Input=20and=20Alert=20Variants=20(#16828)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: Give Sign-In Controls Button, Input and Alert Variants * fix: Load the Field Stylesheet From SecretInput * fix: Default the Floating Fields to the Placeholder Sentinel * test: Cover the Sign-In Control Roles in the Default Theme * test: Wait for the Floating Label Transition Before Reading It * test: Read the Floating Label Scale Property * fix: Keep Button Heights on Theme Roles and Honor Reduced Motion in Floating Fields --- client/src/components/Auth/AuthLayout.tsx | 5 +- client/src/components/Auth/ErrorMessage.tsx | 3 +- client/src/components/Auth/LoginForm.tsx | 29 +++-- client/src/components/Auth/Registration.tsx | 29 +++-- .../components/Auth/RequestPasswordReset.tsx | 12 +- client/src/components/Auth/ResetPassword.tsx | 26 +---- .../src/components/Auth/TwoFactorScreen.tsx | 15 ++- client/src/components/Auth/VerifyEmail.tsx | 9 +- client/src/style.css | 13 --- .../mock/scenarios/signin-controls.spec.ts | 104 ++++++++++++++++++ eslint-suppressions.json | 37 +------ packages/client/src/components/Alert.spec.tsx | 15 +++ packages/client/src/components/Alert.tsx | 14 ++- .../client/src/components/Button.spec.tsx | 8 ++ packages/client/src/components/Button.tsx | 17 ++- packages/client/src/components/Field.css | 15 +++ packages/client/src/components/Input.tsx | 10 +- .../src/components/SecretInput.spec.tsx | 12 ++ .../client/src/components/SecretInput.tsx | 13 ++- packages/client/src/components/floating.ts | 14 +++ packages/client/src/components/index.ts | 1 + 21 files changed, 271 insertions(+), 130 deletions(-) create mode 100644 e2e/specs/mock/scenarios/signin-controls.spec.ts create mode 100644 packages/client/src/components/Alert.spec.tsx create mode 100644 packages/client/src/components/floating.ts diff --git a/client/src/components/Auth/AuthLayout.tsx b/client/src/components/Auth/AuthLayout.tsx index fdd43eaea2..b14b7653ec 100644 --- a/client/src/components/Auth/AuthLayout.tsx +++ b/client/src/components/Auth/AuthLayout.tsx @@ -112,10 +112,7 @@ function AuthLayout({ )} > {!hasStartupConfigError && !isFetching && header && ( -

+

{header}

)} diff --git a/client/src/components/Auth/ErrorMessage.tsx b/client/src/components/Auth/ErrorMessage.tsx index 447e01c785..5434e0ebfd 100644 --- a/client/src/components/Auth/ErrorMessage.tsx +++ b/client/src/components/Auth/ErrorMessage.tsx @@ -6,7 +6,8 @@ export const ErrorMessage = ({ children }: { children: React.ReactNode }) => ( icon={false} aria-live="assertive" elevation="raised" - className="mt-6 px-6 py-4 transition-all" + size="roomy" + className="mt-6" > {children} diff --git a/client/src/components/Auth/LoginForm.tsx b/client/src/components/Auth/LoginForm.tsx index 7a6879e85c..a3d3e7a9ba 100644 --- a/client/src/components/Auth/LoginForm.tsx +++ b/client/src/components/Auth/LoginForm.tsx @@ -1,7 +1,15 @@ import React, { useState, useEffect, useContext } from 'react'; import { useForm } from 'react-hook-form'; import { Turnstile } from '@marsidev/react-turnstile'; -import { ThemeContext, SecretInput, Spinner, Button, Input, isDark } from '@librechat/client'; +import { + ThemeContext, + SecretInput, + Spinner, + Button, + Input, + isDark, + floatingLabel, +} from '@librechat/client'; import type { TLoginUser, TStartupConfig } from 'librechat-data-provider'; import type { TAuthContext } from '~/common'; import { useResendVerificationEmail, useGetStartupConfig } from '~/data-provider'; @@ -36,13 +44,6 @@ const LoginForm: React.FC = ({ onSubmit, startupConfig, error, const emailAutoComplete = startupConfig.passkeyLoginEnabled ? `${baseAutoComplete} webauthn` : baseAutoComplete; - const authInputClassName = - 'webkit-dark-styles peer h-auto w-full rounded-2xl border px-3.5 pb-2.5 pt-3 text-text-primary duration-200 focus:border-accent-primary focus-visible:border-accent-primary'; - const authSecretInputClassName = `${authInputClassName} pr-12`; - const authLabelClassName = - 'absolute start-3 top-1.5 z-10 origin-[0] -translate-y-4 scale-75 transform bg-surface-primary px-2 text-sm text-text-secondary-alt duration-200 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-1.5 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 peer-focus:text-accent-primary rtl:peer-focus:left-auto rtl:peer-focus:translate-x-1/4'; - const authSecretButtonClassName = - 'size-9 rounded-xl text-text-secondary-alt hover:bg-transparent hover:text-text-primary'; useEffect(() => { if (error && error.includes('422') && !showResendLink) { @@ -115,10 +116,10 @@ const LoginForm: React.FC = ({ onSubmit, startupConfig, error, : (value) => validateEmail(value, localize('com_auth_email_pattern')), })} aria-invalid={!!errors.email} - className={authInputClassName} + variant="floating" placeholder=" " /> -