feat: enhance UI components for better accessibility and consistency

This commit is contained in:
Jose Selesan
2026-09-30 10:33:06 -03:00
parent 13c1446977
commit 27bff32e76
6 changed files with 55 additions and 32 deletions

View File

@@ -9,9 +9,11 @@ export function WaitlistTable({ entries }: { entries: GroupWaitlistEntryDto[] })
return (
<table className="w-full table-fixed text-left text-sm">
<thead>
<tr className="border-b border-border/70 text-xs font-semibold text-foreground/80">
<th scope="col" className="w-[47%] px-2 pb-1.5">Nombre</th>
<th scope="col" className="px-2 pb-1.5">Teléfono</th>
{/* `border-foreground/10` y no `border`: en dark `--border` es igual a
`primary-soft`, el fondo de la fila, y el separador desaparecería. */}
<tr className="border-b border-foreground/10 text-xs font-semibold text-foreground/80">
<th scope="col" className="w-[47%] px-3 pb-1.5">Nombre</th>
<th scope="col" className="px-3 pb-1.5">Teléfono</th>
<th scope="col" className="w-8 px-1 pb-1.5">
<span className="sr-only">Detalle</span>
</th>
@@ -22,7 +24,8 @@ export function WaitlistTable({ entries }: { entries: GroupWaitlistEntryDto[] })
<tr
key={entry.id}
tabIndex={0}
className="group cursor-pointer border-b border-border/70 transition-colors last:border-b-0 hover:bg-primary-soft/60 focus-visible:bg-primary-soft focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent"
// El hover va a `surface` porque la fila ya vive sobre `primary-soft`.
className="group cursor-pointer border-b border-foreground/10 transition-colors last:border-b-0 hover:bg-surface/60 focus-visible:bg-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent"
onClick={() => setSelectedWaitlistEntry(entry)}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
@@ -31,7 +34,9 @@ export function WaitlistTable({ entries }: { entries: GroupWaitlistEntryDto[] })
}
}}
>
<td className="px-2 py-2">
{/* `px-3` alinea el texto con el chips y el search de arriba: es el
mismo eje izquierdo de 12px en toda la sección. */}
<td className="px-3 py-2">
<div className="flex min-w-0 items-center gap-2">
<div className="flex size-8 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent">
{entry.fullName.charAt(0).toUpperCase()}
@@ -48,7 +53,7 @@ export function WaitlistTable({ entries }: { entries: GroupWaitlistEntryDto[] })
</div>
</div>
</td>
<td className="min-w-0 px-2 py-2 text-xs text-foreground/70">
<td className="min-w-0 px-3 py-2 text-xs text-foreground/70">
{entry.phone ? (
<span className="block truncate tabular-nums" title={entry.phone}>
{formatPhoneDisplay(entry.phone)}