fix(ui): toggle password en login + fondo blanco card talento
Fix A: botón inline con ícono SVG (ojo/ojo tachado) en el campo password de /login, alterna type password/text, aria-label según estado. Sin librería nueva. Fix B: .db-widget-star pierde el gradiente, hereda background blanco de .db-widget igual que los demás cards. Borde y título teal intactos.
This commit is contained in:
@@ -964,7 +964,6 @@ body {
|
|||||||
/* ── Card destacada (estrella) ── */
|
/* ── Card destacada (estrella) ── */
|
||||||
.db-widget-star {
|
.db-widget-star {
|
||||||
border-color: var(--color-re-teal);
|
border-color: var(--color-re-teal);
|
||||||
background: linear-gradient(135deg, #dff4f5, #ffffff);
|
|
||||||
}
|
}
|
||||||
.db-widget-star .db-widget-title { color: var(--color-re-teal); }
|
.db-widget-star .db-widget-title { color: var(--color-re-teal); }
|
||||||
|
|
||||||
@@ -1093,6 +1092,26 @@ body {
|
|||||||
color: var(--color-text);
|
color: var(--color-text);
|
||||||
}
|
}
|
||||||
.login-error { margin: 0; }
|
.login-error { margin: 0; }
|
||||||
|
.login-password-wrapper { position: relative; }
|
||||||
|
.login-password-wrapper .text-short-input { padding-right: 40px; }
|
||||||
|
.login-password-toggle {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
right: 8px;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
padding: 0;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
border-radius: var(--radius);
|
||||||
|
color: var(--color-text-muted);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.login-password-toggle:hover { color: var(--color-text); }
|
||||||
.login-submit {
|
.login-submit {
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { useRouter } from 'next/navigation'
|
|||||||
export default function LoginPage() {
|
export default function LoginPage() {
|
||||||
const [isPending, setIsPending] = useState(false)
|
const [isPending, setIsPending] = useState(false)
|
||||||
const [error, setError] = useState<string | null>(null)
|
const [error, setError] = useState<string | null>(null)
|
||||||
|
const [showPassword, setShowPassword] = useState(false)
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const supabase = createBrowserClient(
|
const supabase = createBrowserClient(
|
||||||
@@ -54,15 +55,36 @@ export default function LoginPage() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="login-field">
|
<div className="login-field">
|
||||||
<label htmlFor="password" className="login-label">Contraseña</label>
|
<label htmlFor="password" className="login-label">Contraseña</label>
|
||||||
|
<div className="login-password-wrapper">
|
||||||
<input
|
<input
|
||||||
id="password"
|
id="password"
|
||||||
name="password"
|
name="password"
|
||||||
type="password"
|
type={showPassword ? 'text' : 'password'}
|
||||||
autoComplete="current-password"
|
autoComplete="current-password"
|
||||||
required
|
required
|
||||||
disabled={isPending}
|
disabled={isPending}
|
||||||
className="text-short-input"
|
className="text-short-input"
|
||||||
/>
|
/>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="login-password-toggle"
|
||||||
|
onClick={() => setShowPassword((v) => !v)}
|
||||||
|
aria-label={showPassword ? 'Ocultar contraseña' : 'Mostrar contraseña'}
|
||||||
|
>
|
||||||
|
{showPassword ? (
|
||||||
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
||||||
|
<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z" />
|
||||||
|
<circle cx="12" cy="12" r="3" />
|
||||||
|
</svg>
|
||||||
|
) : (
|
||||||
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
||||||
|
<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z" />
|
||||||
|
<circle cx="12" cy="12" r="3" />
|
||||||
|
<path d="M3 3l18 18" />
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{error && (
|
{error && (
|
||||||
<p role="alert" className="field-error login-error">{error}</p>
|
<p role="alert" className="field-error login-error">{error}</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user