feat(profile-form): refactor form-group styles and update error handling in checkout form

This commit is contained in:
2026-07-08 09:05:15 -03:00
parent b9b8a70ca1
commit 64ade4d595
4 changed files with 39 additions and 47 deletions

View File

@@ -4,14 +4,6 @@
gap: 16px;
max-width: 500px;
}
.form-group {
display: flex;
flex-direction: column;
}
.form-group label {
font-size: 13px;
color: #666666;
}
.form-actions {
display: flex;
gap: 12px;

View File

@@ -5,9 +5,9 @@
(ngSubmit)="submit()"
>
<div class="checkout-form__fields">
<div class="form-field">
<label class="form-field__label" for="checkout-nombre">
Nombre y Apellido <span class="form-field__required" aria-hidden="true">*</span>
<div class="form-group">
<label for="checkout-nombre">
Nombre y Apellido <span class="required" aria-hidden="true">*</span>
</label>
<app-input
id="checkout-nombre"
@@ -19,13 +19,13 @@
(valueChange)="updateField('nombre', $event)"
/>
@if (getControlError('nombre'); as errorMessage) {
<small class="form-field__error">{{ errorMessage }}</small>
<small class="error">{{ errorMessage }}</small>
}
</div>
<div class="form-field">
<label class="form-field__label" for="checkout-email">
Email <span class="form-field__required" aria-hidden="true">*</span>
<div class="form-group">
<label for="checkout-email">
Email <span class="required" aria-hidden="true">*</span>
</label>
<app-input
id="checkout-email"
@@ -37,13 +37,13 @@
(valueChange)="updateField('email', $event)"
/>
@if (getControlError('email'); as errorMessage) {
<small class="form-field__error">{{ errorMessage }}</small>
<small class="error">{{ errorMessage }}</small>
}
</div>
<div class="form-field">
<label class="form-field__label" for="checkout-dni">
DNI <span class="form-field__required" aria-hidden="true">*</span>
<div class="form-group">
<label for="checkout-dni">
DNI <span class="required" aria-hidden="true">*</span>
</label>
<app-input
id="checkout-dni"
@@ -55,13 +55,13 @@
(valueChange)="updateField('dni', $event)"
/>
@if (getControlError('dni'); as errorMessage) {
<small class="form-field__error">{{ errorMessage }}</small>
<small class="error">{{ errorMessage }}</small>
}
</div>
<div class="form-field">
<label class="form-field__label" for="checkout-telefono">
Telefono <span class="form-field__required" aria-hidden="true">*</span>
<div class="form-group">
<label for="checkout-telefono">
Telefono <span class="required" aria-hidden="true">*</span>
</label>
<app-input
id="checkout-telefono"
@@ -73,7 +73,7 @@
(valueChange)="updateField('telefono', $event)"
/>
@if (getControlError('telefono'); as errorMessage) {
<small class="form-field__error">{{ errorMessage }}</small>
<small class="error">{{ errorMessage }}</small>
}
</div>
</div>

View File

@@ -23,26 +23,3 @@
max-width: 290px;
}
}
.form-field {
display: grid;
gap: 0.35rem;
&__label {
font-size: 0.8rem;
font-weight: 600;
color: var(--bs-secondary, #6c757d);
letter-spacing: 0;
}
&__required {
color: var(--bs-danger, #dc3545);
margin-left: 2px;
}
&__error {
font-size: 0.75rem;
color: var(--bs-danger, #dc3545);
}
}

View File

@@ -33,4 +33,27 @@ label {
margin-bottom: 0.375rem;
font-size: 13px;
font-weight: 400;
}
.form-group {
display: flex;
flex-direction: column;
gap: 8px;
label {
font-size: 14px;
color: #888;
font-weight: normal;
margin-bottom: 0;
}
.required {
color: var(--color-danger, #dc3545);
margin-left: 2px;
}
.error {
font-size: 0.75rem;
color: var(--color-danger, #dc3545);
}
}