Skip to content

Commit

Permalink
fix(core): update login page & error message styles (#1505)
Browse files Browse the repository at this point in the history
* fix(core): improve responsive design for login page

* fix(core): update error message size & colour on form fields
  • Loading branch information
bc-alexsaiannyi authored Oct 25, 2024
1 parent ea01e3b commit 691ec2b
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 29 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-balloons-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bigcommerce/catalyst-core": patch
---

update login page & error message styles
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const ChangePasswordForm = ({ customerId, customerToken }: Props) => {
/>
</FieldControl>
<FieldMessage
className="absolute inset-x-0 bottom-0 inline-flex w-full text-sm text-gray-500"
className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs text-gray-500"
match={(value: string) => value !== newPassword}
>
{t('confirmPasswordValidationMessage')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const LoginForm = () => {
<p>{t('Form.error')}</p>
</Message>
)}
<Form action={formAction} className="mb-14 flex flex-col gap-3 md:p-8 lg:p-0">
<Form action={formAction} className="mb-8 flex flex-col gap-3 md:mb-14">
<Field className="relative space-y-2 pb-7" name="email">
<FieldLabel htmlFor="email">{t('Form.emailLabel')}</FieldLabel>
<FieldControl asChild>
Expand All @@ -90,7 +90,7 @@ export const LoginForm = () => {
/>
</FieldControl>
<FieldMessage
className="absolute inset-x-0 bottom-0 inline-flex w-full text-sm text-error"
className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs text-error"
match="valueMissing"
>
{t('Form.enterEmailMessage')}
Expand All @@ -109,18 +109,18 @@ export const LoginForm = () => {
/>
</FieldControl>
<FieldMessage
className="absolute inset-x-0 bottom-0 inline-flex w-full text-sm text-error"
className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs text-error"
match="valueMissing"
>
{t('Form.entePasswordMessage')}
</FieldMessage>
</Field>
<div className="flex flex-col items-start md:flex-row md:items-center md:justify-start md:gap-10">
<div className="flex flex-col items-start md:flex-row md:items-center md:justify-start md:gap-2">
<FormSubmit asChild>
<SubmitButton />
</FormSubmit>
<Link
className="my-5 inline-flex items-center justify-start font-semibold text-primary hover:text-secondary md:my-0"
className="mx-auto my-5 inline-flex items-center justify-start px-8 py-3 font-semibold text-primary hover:text-secondary md:mx-0 md:my-0"
href="/login/forgot-password"
>
{t('Form.forgotPassword')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const ResetPasswordForm = ({ reCaptchaSettings }: Props) => {
/>
</FieldControl>
<FieldMessage
className="absolute inset-x-0 bottom-0 inline-flex w-full text-sm text-gray-500"
className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs text-gray-500"
match="valueMissing"
>
{t('emailValidationMessage')}
Expand Down
6 changes: 3 additions & 3 deletions core/app/[locale]/(default)/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ export default function Login({ params }: Props) {

return (
<div className="mx-auto my-6 max-w-4xl">
<h2 className="text-h2 mb-8 text-4xl font-black lg:text-5xl">{t('heading')}</h2>
<h2 className="text-h3 mb-8 text-3xl font-black lg:text-4xl">{t('heading')}</h2>
<div className="mb-12 grid grid-cols-1 lg:grid-cols-2 lg:gap-x-8">
<LoginForm />
<div className="flex flex-col gap-4 bg-gray-100 p-8">
<h3 className="text-h5 mb-3">{t('CreateAccount.heading')}</h3>
<h3 className="mb-3 text-xl font-bold lg:text-2xl">{t('CreateAccount.heading')}</h3>
<p className="text-base font-semibold">{t('CreateAccount.accountBenefits')}</p>
<ul className="list-disc ps-4">
<ul className="mb-4 list-disc ps-4">
<li>{t('CreateAccount.fastCheckout')}</li>
<li>{t('CreateAccount.multipleAddresses')}</li>
<li>{t('CreateAccount.ordersHistory')}</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const TextField = ({
</FieldControl>
{isRequired && (
<FieldMessage
className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs font-normal text-error-secondary"
className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs font-normal text-error"
match="valueMissing"
>
{t(fieldNameById ?? 'empty')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const ChangePasswordForm = () => {
/>
</FieldControl>
<FieldMessage
className="absolute inset-x-0 bottom-0 inline-flex w-full text-sm text-error"
className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs text-error"
match="valueMissing"
>
{t('notEmptyMessage')}
Expand All @@ -202,13 +202,13 @@ export const ChangePasswordForm = () => {
/>
</FieldControl>
<FieldMessage
className="absolute inset-x-0 bottom-0 inline-flex w-full text-sm text-error"
className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs text-error"
match="valueMissing"
>
{t('notEmptyMessage')}
</FieldMessage>
{!isNewPasswordValid && (
<FieldMessage className="absolute inset-x-0 inline-flex w-full text-sm text-error md:bottom-0">
<FieldMessage className="absolute inset-x-0 inline-flex w-full text-xs text-error md:bottom-0">
{t('newPasswordValidationMessage')}
</FieldMessage>
)}
Expand All @@ -229,13 +229,13 @@ export const ChangePasswordForm = () => {
/>
</FieldControl>
<FieldMessage
className="absolute inset-x-0 bottom-0 inline-flex w-full text-sm text-error"
className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs text-error"
match="valueMissing"
>
{t('notEmptyMessage')}
</FieldMessage>
{!isConfirmPasswordValid && (
<FieldMessage className="absolute inset-x-0 bottom-0 inline-flex w-full text-sm text-error">
<FieldMessage className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs text-error">
{t('confirmPasswordValidationMessage')}
</FieldMessage>
)}
Expand Down
2 changes: 1 addition & 1 deletion core/components/form-fields/checkboxes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const Checkboxes = ({
</div>
<div className="relative h-7">
{validationError && (
<FieldMessage className="inline-flex w-full text-xs font-normal text-error-secondary">
<FieldMessage className="inline-flex w-full text-xs font-normal text-error">
{t('empty')}
</FieldMessage>
)}
Expand Down
2 changes: 1 addition & 1 deletion core/components/form-fields/date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const DateField = ({
/>
<div className="relative h-7">
{validationError && (
<FieldMessage className="inline-flex w-full text-xs font-normal text-error-secondary">
<FieldMessage className="inline-flex w-full text-xs font-normal text-error">
{t('empty')}
</FieldMessage>
)}
Expand Down
2 changes: 1 addition & 1 deletion core/components/form-fields/multiline-text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const MultilineText = ({
<div className="relative h-7">
{field.isRequired && (
<FieldMessage
className="inline-flex w-full text-xs font-normal text-error-secondary"
className="inline-flex w-full text-xs font-normal text-error"
match="valueMissing"
>
{t('empty')}
Expand Down
8 changes: 4 additions & 4 deletions core/components/form-fields/numbers-only.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,29 @@ export const NumbersOnly = ({ defaultValue, field, isValid, name, onChange }: Nu
<div className="relative h-7">
{field.isRequired && (
<FieldMessage
className="inline-flex w-full text-xs font-normal text-error-secondary"
className="inline-flex w-full text-xs font-normal text-error"
match="valueMissing"
>
{t('empty')}
</FieldMessage>
)}
<FieldMessage
className="inline-flex w-full text-xs font-normal text-error-secondary"
className="inline-flex w-full text-xs font-normal text-error"
match="typeMismatch"
>
{t('numbersOnly')}
</FieldMessage>
{Boolean(field.minNumber) && (
<FieldMessage
className="inline-flex w-full text-xs font-normal text-error-secondary"
className="inline-flex w-full text-xs font-normal text-error"
match="rangeUnderflow"
>
{t('numbersUnderflow', { min: field.minNumber })}
</FieldMessage>
)}
{Boolean(field.maxNumber) && (
<FieldMessage
className="inline-flex w-full text-xs font-normal text-error-secondary"
className="inline-flex w-full text-xs font-normal text-error"
match="rangeOverflow"
>
{t('numbersOverflow', { max: field.maxNumber })}
Expand Down
4 changes: 2 additions & 2 deletions core/components/form-fields/password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ export const Password = ({ defaultValue, field, isValid, name, onChange }: Passw
<div className="relative h-7">
{field.isRequired && (
<FieldMessage
className="inline-flex w-full text-xs font-normal text-error-secondary"
className="inline-flex w-full text-xs font-normal text-error"
match="valueMissing"
>
{t('password')}
</FieldMessage>
)}
{fieldName === 'confirmPassword' && (
<FieldMessage
className="inline-flex w-full text-xs font-normal text-error-secondary"
className="inline-flex w-full text-xs font-normal text-error"
match={() => {
return !isValid;
}}
Expand Down
2 changes: 1 addition & 1 deletion core/components/form-fields/picklist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const Picklist = ({
</FieldControl>
<div className="relative h-7">
{validationError && (
<FieldMessage className="inline-flex w-full text-xs font-normal text-error-secondary">
<FieldMessage className="inline-flex w-full text-xs font-normal text-error">
{t('empty')}
</FieldMessage>
)}
Expand Down
2 changes: 1 addition & 1 deletion core/components/form-fields/radio-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const RadioButtons = ({
/>
<div className="relative h-7">
{validationError && (
<FieldMessage className="inline-flex w-full text-xs font-normal text-error-secondary">
<FieldMessage className="inline-flex w-full text-xs font-normal text-error">
{t('empty')}
</FieldMessage>
)}
Expand Down
4 changes: 2 additions & 2 deletions core/components/form-fields/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ export const Text = ({ defaultValue, field, isValid, name, onChange, type }: Tex
<div className="relative h-7">
{field.isRequired && (
<FieldMessage
className="inline-flex w-full text-xs font-normal text-error-secondary"
className="inline-flex w-full text-xs font-normal text-error"
match="valueMissing"
>
{t(fieldName ?? 'empty')}
</FieldMessage>
)}
{fieldName === 'email' && (
<FieldMessage
className="inline-flex w-full text-xs font-normal text-error-secondary"
className="inline-flex w-full text-xs font-normal text-error"
match="typeMismatch"
>
{t('email')}
Expand Down

0 comments on commit 691ec2b

Please sign in to comment.