feat: add accessible Tooltip component with hover, focus, and tap support
This commit is contained in:
954
.interface-design/group-detail-redesign.html
Normal file
954
.interface-design/group-detail-redesign.html
Normal file
@@ -0,0 +1,954 @@
|
||||
<!doctype html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Gruperly — Rediseño detalle de grupo (2 estados)</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/lucide@0.469.0/dist/umd/lucide.min.js"></script>
|
||||
<style type="text/tailwindcss">
|
||||
@theme inline {
|
||||
--color-background: var(--background);
|
||||
--color-surface: var(--surface);
|
||||
--color-primary: var(--primary);
|
||||
--color-primary-soft: var(--primary-soft);
|
||||
--color-foreground: var(--foreground);
|
||||
--color-accent: var(--accent);
|
||||
--color-accent-strong: var(--accent-strong);
|
||||
--color-accent-soft: var(--accent-soft);
|
||||
--color-accent-fg: var(--accent-fg);
|
||||
--color-border: var(--border);
|
||||
--color-on-accent: var(--on-accent);
|
||||
--color-success: var(--success);
|
||||
--color-success-soft: var(--success-soft);
|
||||
--color-warning: var(--warning);
|
||||
--color-warning-soft: var(--warning-soft);
|
||||
--color-danger: var(--danger);
|
||||
--color-danger-soft: var(--danger-soft);
|
||||
--radius-xl: 0.75rem;
|
||||
--font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
|
||||
--animate-fade-in: fade-in 0.2s ease-out;
|
||||
@keyframes fade-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
--background: #020617;
|
||||
--surface: #0f172a;
|
||||
--primary: #f1f5f9;
|
||||
--primary-soft: #1e293b;
|
||||
--foreground: #94a3b8;
|
||||
--accent: #2544ea;
|
||||
--accent-strong: #1d33d8;
|
||||
--accent-soft: color-mix(in srgb, #3b63f5 15%, transparent);
|
||||
--accent-fg: #93b4fd;
|
||||
--border: #1e293b;
|
||||
--on-accent: #ffffff;
|
||||
--success: #34d399;
|
||||
--success-soft: color-mix(in srgb, #34d399 15%, transparent);
|
||||
--warning: #fcd34d;
|
||||
--warning-soft: color-mix(in srgb, #fcd34d 15%, transparent);
|
||||
--danger: #fb7185;
|
||||
--danger-soft: color-mix(in srgb, #fb7185 15%, transparent);
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
background: var(--background);
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.frames {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 32px;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.frame {
|
||||
width: 390px;
|
||||
}
|
||||
.screen {
|
||||
background: var(--background);
|
||||
border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
|
||||
border-radius: 24px;
|
||||
padding: 16px 12px 24px;
|
||||
overflow: hidden;
|
||||
}
|
||||
/* Botón (equivalente a components/ui/button.tsx, clases ya fusionadas) */
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
white-space: nowrap;
|
||||
border-radius: 0.75rem;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
padding: 0 16px;
|
||||
height: 44px;
|
||||
cursor: pointer;
|
||||
border: 0;
|
||||
font-family: inherit;
|
||||
}
|
||||
.btn-outline {
|
||||
border: 1px solid var(--border);
|
||||
background: var(--surface);
|
||||
color: var(--primary);
|
||||
}
|
||||
.btn-ghost {
|
||||
background: transparent;
|
||||
color: var(--primary);
|
||||
}
|
||||
.btn-primary {
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
}
|
||||
.btn-block {
|
||||
width: 100%;
|
||||
}
|
||||
.chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
min-height: 44px;
|
||||
border-radius: 9999px;
|
||||
border: 1px solid var(--border);
|
||||
padding: 0 14px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
background: var(--surface);
|
||||
color: color-mix(in srgb, var(--foreground) 80%, transparent);
|
||||
cursor: pointer;
|
||||
}
|
||||
.chip-active {
|
||||
border-color: transparent;
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
|
||||
}
|
||||
.pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 9999px;
|
||||
padding: 2px 6px;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.pill-warn {
|
||||
background: var(--warning-soft);
|
||||
color: var(--warning);
|
||||
}
|
||||
.pill-neutral {
|
||||
background: var(--primary-soft);
|
||||
color: color-mix(in srgb, var(--foreground) 60%, transparent);
|
||||
}
|
||||
.pill-on-accent {
|
||||
background: color-mix(in srgb, var(--on-accent) 25%, transparent);
|
||||
color: var(--on-accent);
|
||||
}
|
||||
.label-cell {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.02em;
|
||||
color: color-mix(in srgb, var(--foreground) 70%, transparent);
|
||||
}
|
||||
.avatar {
|
||||
display: flex;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 9999px;
|
||||
background: color-mix(in srgb, var(--accent) 10%, transparent);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--accent);
|
||||
}
|
||||
.row {
|
||||
border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
|
||||
cursor: pointer;
|
||||
}
|
||||
.row:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
table-layout: fixed;
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
}
|
||||
th {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: color-mix(in srgb, var(--foreground) 80%, transparent);
|
||||
padding: 0 12px 8px;
|
||||
}
|
||||
td {
|
||||
padding: 10px 12px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.truncate {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.tabular {
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
svg.lucide {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
stroke-width: 2;
|
||||
}
|
||||
.icon-20 svg.lucide,
|
||||
svg.icon-20 {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
.icon-40 svg.lucide,
|
||||
svg.icon-40 {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="antialiased">
|
||||
<div class="mx-auto max-w-[1780px] px-6 py-8">
|
||||
<header class="mb-8 max-w-3xl">
|
||||
<p class="text-xs font-semibold uppercase tracking-wide text-accent-fg">
|
||||
Gruperly · /groups/$groupId
|
||||
</p>
|
||||
<h1 class="mt-1 text-2xl font-bold text-primary">Rediseño del detalle de grupo</h1>
|
||||
<p class="mt-2 text-sm leading-relaxed text-foreground/80">
|
||||
Dos pestañas (<strong class="text-primary">Miembros</strong> ·
|
||||
<strong class="text-primary">Pendientes</strong>), tarjeta de info con lectura
|
||||
Horario → Cupo → Cobro, un solo foco primario por estado y objetivos táctiles de 44px.
|
||||
Tema oscuro, tokens reales de <code class="text-accent-fg">apps/web/src/index.css</code>.
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<div class="frames">
|
||||
<!-- ═══════════════ ESTADO 1 · MIEMBROS ═══════════════ -->
|
||||
<div class="frame">
|
||||
<p class="mb-2 text-sm font-semibold text-primary">
|
||||
1 · Con miembros + pre-inscripciones — pestaña “Miembros”
|
||||
</p>
|
||||
<div class="screen">
|
||||
<section class="space-y-5">
|
||||
<!-- Header -->
|
||||
<div>
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="min-w-0">
|
||||
<h1 class="text-2xl font-bold leading-tight text-primary">Tai Chi Martes</h1>
|
||||
<p class="mt-1.5 text-sm leading-relaxed text-foreground/80">
|
||||
Tai chi para principiantes. Trae ropa cómoda.
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span
|
||||
class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full bg-success-soft px-2.5 py-0.5 text-[11px] font-medium text-success"
|
||||
>
|
||||
<span class="size-1.5 rounded-full bg-success"></span>Activo
|
||||
</span>
|
||||
<span
|
||||
class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full bg-warning-soft px-2.5 py-0.5 text-[11px] font-medium text-warning"
|
||||
>
|
||||
<span class="size-1.5 rounded-full bg-warning"></span>Riesgo moderado
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Acciones: dos outline + "Agregar" ghost (no compite) -->
|
||||
<div class="mt-4 grid grid-cols-2 gap-2.5">
|
||||
<button class="btn btn-outline btn-block">
|
||||
<i data-lucide="bar-chart-3" class="text-accent"></i><span>Estadísticas</span>
|
||||
</button>
|
||||
<button class="btn btn-outline btn-block">
|
||||
<i data-lucide="share-2" class="text-accent"></i><span>Compartir Link</span>
|
||||
</button>
|
||||
<button class="btn btn-ghost btn-block col-span-2">
|
||||
<i data-lucide="user-plus" class="text-accent"></i
|
||||
><span>Agregar Miembros</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tarjeta de info: Horario → Cupo → Cobro -->
|
||||
<div
|
||||
class="divide-y divide-border/70 rounded-2xl bg-primary-soft p-4"
|
||||
>
|
||||
<div class="flex items-start gap-3 py-3 first:pt-0">
|
||||
<i data-lucide="calendar-clock" class="icon-20 mt-0.5 shrink-0 text-accent"></i>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="label-cell">Horario</p>
|
||||
<p class="mt-1 text-base font-semibold leading-snug text-primary">Martes</p>
|
||||
<p class="mt-0.5 text-sm tabular text-foreground">18:00 - 19:30</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-start gap-3 py-3">
|
||||
<i data-lucide="users" class="icon-20 mt-0.5 shrink-0 text-accent"></i>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="label-cell">Miembros & Cupo</p>
|
||||
<p
|
||||
class="mt-1 flex items-baseline text-2xl font-semibold leading-none tracking-tight tabular text-primary"
|
||||
>
|
||||
<span>3</span><span class="text-base font-medium text-foreground/70">/4</span>
|
||||
</p>
|
||||
<div
|
||||
class="mt-2 h-1.5 w-full max-w-[9rem] overflow-hidden rounded-full bg-accent/15"
|
||||
>
|
||||
<div class="h-full w-3/4 rounded-full bg-accent"></div>
|
||||
</div>
|
||||
<p class="mt-1.5 text-sm text-foreground">1 lugar libre · 1 en espera</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-start gap-3 py-3 last:pb-0">
|
||||
<div
|
||||
class="mt-0.5 flex size-5 shrink-0 items-center justify-center text-sm font-bold leading-none text-accent"
|
||||
>
|
||||
$
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="label-cell">Cobro</p>
|
||||
<p class="mt-1 text-base font-semibold tabular text-primary">$450.00</p>
|
||||
<p class="mt-0.5 text-sm text-foreground">Vence el día 10 de cada mes</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Listados -->
|
||||
<div class="rounded-2xl bg-primary-soft p-2">
|
||||
<div class="space-y-2 p-2">
|
||||
<div class="flex flex-col gap-2.5">
|
||||
<div class="flex w-full flex-wrap items-center gap-2">
|
||||
<button class="chip chip-active">
|
||||
<i data-lucide="users"></i><span>Miembros</span
|
||||
><span class="pill pill-on-accent">3</span>
|
||||
</button>
|
||||
<button class="chip">
|
||||
<i data-lucide="inbox"></i><span>Pendientes</span
|
||||
><span class="pill pill-warn">3</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="relative w-full">
|
||||
<i
|
||||
data-lucide="search"
|
||||
class="absolute left-3 top-1/2 -translate-y-1/2 text-foreground/70"
|
||||
></i>
|
||||
<input
|
||||
class="h-11 w-full rounded-lg border border-transparent bg-surface pl-9 pr-3 text-base text-primary shadow-xs placeholder:text-foreground/80 focus:outline-none"
|
||||
placeholder="Buscar por nombre o teléfono..."
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-xs leading-relaxed text-foreground/80">
|
||||
Listado de todos los miembros incorporados al grupo.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg bg-surface p-1 shadow-xs">
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="border-b border-border/70">
|
||||
<th scope="col" class="w-[48%]">Nombre</th>
|
||||
<th scope="col">Teléfono</th>
|
||||
<th scope="col" class="w-9 px-1"><span class="sr-only">Detalle</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row">
|
||||
<td>
|
||||
<div class="flex min-w-0 items-center gap-2.5">
|
||||
<div class="avatar">A</div>
|
||||
<span class="min-w-0 truncate font-medium text-primary">Ana López</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="min-w-0 text-foreground/80">
|
||||
<span class="block truncate tabular">55 1234 5678</span>
|
||||
</td>
|
||||
<td class="w-9 px-1 text-foreground/50">
|
||||
<i data-lucide="chevron-right" class="ml-auto block"></i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row">
|
||||
<td>
|
||||
<div class="flex min-w-0 items-center gap-2.5">
|
||||
<div class="avatar">C</div>
|
||||
<span class="min-w-0 truncate font-medium text-primary"
|
||||
>Carlos Mendoza</span
|
||||
>
|
||||
</div>
|
||||
</td>
|
||||
<td class="min-w-0 text-foreground/80">
|
||||
<span class="block truncate tabular">55 2345 6789</span>
|
||||
</td>
|
||||
<td class="w-9 px-1 text-foreground/50">
|
||||
<i data-lucide="chevron-right" class="ml-auto block"></i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row">
|
||||
<td>
|
||||
<div class="flex min-w-0 items-center gap-2.5">
|
||||
<div class="avatar">L</div>
|
||||
<span class="min-w-0 truncate font-medium text-primary"
|
||||
>Lucía Hernández</span
|
||||
>
|
||||
</div>
|
||||
</td>
|
||||
<td class="min-w-0 text-foreground/80">
|
||||
<span class="block truncate tabular">55 3456 7890</span>
|
||||
</td>
|
||||
<td class="w-9 px-1 text-foreground/50">
|
||||
<i data-lucide="chevron-right" class="ml-auto block"></i>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<p class="mt-3 text-xs leading-relaxed text-foreground/70">
|
||||
Un solo tono activo: el chip “Miembros”. “Agregar Miembros” es
|
||||
<code class="text-foreground/80">ghost</code> — disponible, no dominante. Cupo
|
||||
escaneable como <strong class="text-primary">3/4</strong> + barra.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- ═══════════════ ESTADO 1 · PENDIENTES ═══════════════ -->
|
||||
<div class="frame">
|
||||
<p class="mb-2 text-sm font-semibold text-primary">
|
||||
1 · Con miembros + pre-inscripciones — pestaña “Pendientes”
|
||||
</p>
|
||||
<div class="screen">
|
||||
<section class="space-y-5">
|
||||
<div>
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="min-w-0">
|
||||
<h1 class="text-2xl font-bold leading-tight text-primary">Tai Chi Martes</h1>
|
||||
<p class="mt-1.5 text-sm leading-relaxed text-foreground/80">
|
||||
Tai chi para principiantes. Trae ropa cómoda.
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span
|
||||
class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full bg-success-soft px-2.5 py-0.5 text-[11px] font-medium text-success"
|
||||
>
|
||||
<span class="size-1.5 rounded-full bg-success"></span>Activo
|
||||
</span>
|
||||
<span
|
||||
class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full bg-warning-soft px-2.5 py-0.5 text-[11px] font-medium text-warning"
|
||||
>
|
||||
<span class="size-1.5 rounded-full bg-warning"></span>Riesgo moderado
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 grid grid-cols-2 gap-2.5">
|
||||
<button class="btn btn-outline btn-block">
|
||||
<i data-lucide="bar-chart-3" class="text-accent"></i><span>Estadísticas</span>
|
||||
</button>
|
||||
<button class="btn btn-outline btn-block">
|
||||
<i data-lucide="share-2" class="text-accent"></i><span>Compartir Link</span>
|
||||
</button>
|
||||
<button class="btn btn-ghost btn-block col-span-2">
|
||||
<i data-lucide="user-plus" class="text-accent"></i
|
||||
><span>Agregar Miembros</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="divide-y divide-border/70 rounded-2xl bg-primary-soft p-4">
|
||||
<div class="flex items-start gap-3 py-3 first:pt-0">
|
||||
<i data-lucide="calendar-clock" class="icon-20 mt-0.5 shrink-0 text-accent"></i>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="label-cell">Horario</p>
|
||||
<p class="mt-1 text-base font-semibold leading-snug text-primary">Martes</p>
|
||||
<p class="mt-0.5 text-sm tabular text-foreground">18:00 - 19:30</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-start gap-3 py-3">
|
||||
<i data-lucide="users" class="icon-20 mt-0.5 shrink-0 text-accent"></i>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="label-cell">Miembros & Cupo</p>
|
||||
<p
|
||||
class="mt-1 flex items-baseline text-2xl font-semibold leading-none tracking-tight tabular text-primary"
|
||||
>
|
||||
<span>3</span><span class="text-base font-medium text-foreground/70">/4</span>
|
||||
</p>
|
||||
<div
|
||||
class="mt-2 h-1.5 w-full max-w-[9rem] overflow-hidden rounded-full bg-accent/15"
|
||||
>
|
||||
<div class="h-full w-3/4 rounded-full bg-accent"></div>
|
||||
</div>
|
||||
<p class="mt-1.5 text-sm text-foreground">1 lugar libre · 1 en espera</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-start gap-3 py-3 last:pb-0">
|
||||
<div
|
||||
class="mt-0.5 flex size-5 shrink-0 items-center justify-center text-sm font-bold leading-none text-accent"
|
||||
>
|
||||
$
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="label-cell">Cobro</p>
|
||||
<p class="mt-1 text-base font-semibold tabular text-primary">$450.00</p>
|
||||
<p class="mt-0.5 text-sm text-foreground">Vence el día 10 de cada mes</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rounded-2xl bg-primary-soft p-2">
|
||||
<div class="space-y-2 p-2">
|
||||
<div class="flex flex-col gap-2.5">
|
||||
<div class="flex w-full flex-wrap items-center gap-2">
|
||||
<button class="chip">
|
||||
<i data-lucide="users"></i><span>Miembros</span
|
||||
><span class="pill pill-neutral">3</span>
|
||||
</button>
|
||||
<button class="chip chip-active">
|
||||
<i data-lucide="inbox"></i><span>Pendientes</span
|
||||
><span class="pill pill-on-accent">3</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="relative w-full">
|
||||
<i
|
||||
data-lucide="search"
|
||||
class="absolute left-3 top-1/2 -translate-y-1/2 text-foreground/70"
|
||||
></i>
|
||||
<input
|
||||
class="h-11 w-full rounded-lg border border-transparent bg-surface pl-9 pr-3 text-base text-primary shadow-xs placeholder:text-foreground/80 focus:outline-none"
|
||||
placeholder="Buscar por nombre o teléfono..."
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-xs leading-relaxed text-foreground/80">
|
||||
Pre-inscripciones que esperan tu aprobación y personas en lista de espera por
|
||||
un cupo libre.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg bg-surface p-1 shadow-xs">
|
||||
<!-- Pre-inscripciones -->
|
||||
<section>
|
||||
<div class="flex items-center gap-2 border-b border-border/70 px-3 pb-2 pt-3">
|
||||
<i data-lucide="user-check" class="shrink-0 text-accent"></i>
|
||||
<h3 class="text-xs font-semibold uppercase tracking-wide text-foreground/70">
|
||||
Pre-inscripciones
|
||||
</h3>
|
||||
<span class="pill pill-warn ml-auto">2</span>
|
||||
</div>
|
||||
<div class="pt-1">
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="border-b border-border/70">
|
||||
<th scope="col" class="w-[46%]">Nombre</th>
|
||||
<th scope="col">Teléfono</th>
|
||||
<th scope="col" class="hidden w-9 px-1 sm:table-cell"
|
||||
><span class="sr-only">Detalle</span></th
|
||||
>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row">
|
||||
<td>
|
||||
<div class="flex min-w-0 items-center gap-2.5">
|
||||
<div class="avatar">J</div>
|
||||
<div class="min-w-0">
|
||||
<p class="truncate font-medium text-primary">Jorge Ramírez</p>
|
||||
<p class="truncate text-xs text-foreground/70">
|
||||
jorge.r@correo.mx
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="min-w-0 text-foreground/80">
|
||||
<span class="block truncate tabular">55 4567 8901</span>
|
||||
</td>
|
||||
<td class="w-9 px-1 text-foreground/50">
|
||||
<i data-lucide="chevron-right" class="ml-auto block"></i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row">
|
||||
<td>
|
||||
<div class="flex min-w-0 items-center gap-2.5">
|
||||
<div class="avatar">S</div>
|
||||
<div class="min-w-0">
|
||||
<p class="truncate font-medium text-primary">Sofía Torres</p>
|
||||
<p class="truncate text-xs text-foreground/70">
|
||||
sofia.t@correo.mx
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="min-w-0 text-foreground/80">
|
||||
<span class="block truncate tabular">55 5678 9012</span>
|
||||
</td>
|
||||
<td class="w-9 px-1 text-foreground/50">
|
||||
<i data-lucide="chevron-right" class="ml-auto block"></i>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Lista de espera -->
|
||||
<section>
|
||||
<div class="flex items-center gap-2 border-b border-border/70 px-3 pb-2 pt-3">
|
||||
<i data-lucide="clock" class="shrink-0 text-accent"></i>
|
||||
<h3 class="text-xs font-semibold uppercase tracking-wide text-foreground/70">
|
||||
Lista de espera
|
||||
</h3>
|
||||
<span class="pill pill-neutral ml-auto">1</span>
|
||||
</div>
|
||||
<div class="pt-1">
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="border-b border-border/70">
|
||||
<th scope="col" class="w-[48%]">Nombre</th>
|
||||
<th scope="col">Teléfono</th>
|
||||
<th scope="col" class="w-9 px-1"
|
||||
><span class="sr-only">Detalle</span></th
|
||||
>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row">
|
||||
<td>
|
||||
<div class="flex min-w-0 items-center gap-2.5">
|
||||
<div class="avatar">D</div>
|
||||
<div class="min-w-0">
|
||||
<p class="truncate font-medium text-primary">Diego Peña</p>
|
||||
<p class="truncate text-xs text-foreground/70">
|
||||
Prefiere horario de 19:00
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="min-w-0 text-foreground/80">
|
||||
<span class="block truncate tabular">55 6789 0123</span>
|
||||
</td>
|
||||
<td class="w-9 px-1 text-foreground/50">
|
||||
<i data-lucide="chevron-right" class="ml-auto block"></i>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<p class="mt-3 text-xs leading-relaxed text-foreground/70">
|
||||
“Pendientes” agrupa Pre-inscripciones (pill ámbar = requiere decisión) y Lista de
|
||||
espera como secciones apiladas — sin una tercera pestaña.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- ═══════════════ ESTADO 2 · VACÍO (MIEMBROS) ═══════════════ -->
|
||||
<div class="frame">
|
||||
<p class="mb-2 text-sm font-semibold text-primary">
|
||||
2 · Estado vacío — pestaña “Miembros” (sin miembros ni pre-inscripciones)
|
||||
</p>
|
||||
<div class="screen">
|
||||
<section class="space-y-5">
|
||||
<div>
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="min-w-0">
|
||||
<h1 class="text-2xl font-bold leading-tight text-primary">Tai Chi Martes</h1>
|
||||
<p class="mt-1.5 text-sm leading-relaxed text-foreground/80">
|
||||
Tai chi para principiantes. Trae ropa cómoda.
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span
|
||||
class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full bg-success-soft px-2.5 py-0.5 text-[11px] font-medium text-success"
|
||||
>
|
||||
<span class="size-1.5 rounded-full bg-success"></span>Activo
|
||||
</span>
|
||||
<span
|
||||
class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full bg-warning-soft px-2.5 py-0.5 text-[11px] font-medium text-warning"
|
||||
>
|
||||
<span class="size-1.5 rounded-full bg-warning"></span>Riesgo moderado
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Grupo vacío: el header no repite Compartir/Agregar; los lleva el empty state. -->
|
||||
<div class="mt-4 grid grid-cols-2 gap-2.5">
|
||||
<button class="btn btn-outline btn-block">
|
||||
<i data-lucide="bar-chart-3" class="text-accent"></i><span>Estadísticas</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tarjeta vacía: 0/4 -->
|
||||
<div class="divide-y divide-border/70 rounded-2xl bg-primary-soft p-4">
|
||||
<div class="flex items-start gap-3 py-3 first:pt-0">
|
||||
<i data-lucide="calendar-clock" class="icon-20 mt-0.5 shrink-0 text-accent"></i>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="label-cell">Horario</p>
|
||||
<p class="mt-1 text-base font-semibold leading-snug text-primary">Martes</p>
|
||||
<p class="mt-0.5 text-sm tabular text-foreground">18:00 - 19:30</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-start gap-3 py-3">
|
||||
<i data-lucide="users" class="icon-20 mt-0.5 shrink-0 text-accent"></i>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="label-cell">Miembros & Cupo</p>
|
||||
<p
|
||||
class="mt-1 flex items-baseline text-2xl font-semibold leading-none tracking-tight tabular text-primary"
|
||||
>
|
||||
<span>0</span><span class="text-base font-medium text-foreground/70">/4</span>
|
||||
</p>
|
||||
<div
|
||||
class="mt-2 h-1.5 w-full max-w-[9rem] overflow-hidden rounded-full bg-accent/15"
|
||||
>
|
||||
<div class="h-full w-0 rounded-full bg-accent"></div>
|
||||
</div>
|
||||
<p class="mt-1.5 text-sm text-foreground">4 lugares libres</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-start gap-3 py-3 last:pb-0">
|
||||
<div
|
||||
class="mt-0.5 flex size-5 shrink-0 items-center justify-center text-sm font-bold leading-none text-accent"
|
||||
>
|
||||
$
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="label-cell">Cobro</p>
|
||||
<p class="mt-1 text-base font-semibold tabular text-primary">$450.00</p>
|
||||
<p class="mt-0.5 text-sm text-foreground">Vence el día 10 de cada mes</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rounded-2xl bg-primary-soft p-2">
|
||||
<div class="space-y-2 p-2">
|
||||
<div class="flex flex-col gap-2.5">
|
||||
<div class="flex w-full flex-wrap items-center gap-2">
|
||||
<button class="chip chip-active">
|
||||
<i data-lucide="users"></i><span>Miembros</span>
|
||||
</button>
|
||||
<button class="chip">
|
||||
<i data-lucide="inbox"></i><span>Pendientes</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="relative w-full">
|
||||
<i
|
||||
data-lucide="search"
|
||||
class="absolute left-3 top-1/2 -translate-y-1/2 text-foreground/70"
|
||||
></i>
|
||||
<input
|
||||
class="h-11 w-full rounded-lg border border-transparent bg-surface pl-9 pr-3 text-base text-primary shadow-xs placeholder:text-foreground/80 focus:outline-none"
|
||||
placeholder="Buscar por nombre o teléfono..."
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-xs leading-relaxed text-foreground/80">
|
||||
Listado de todos los miembros incorporados al grupo.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg bg-surface p-1 shadow-xs">
|
||||
<div class="rounded-lg bg-primary-soft/50 px-4 py-10 text-center">
|
||||
<i
|
||||
data-lucide="users"
|
||||
class="icon-40 mx-auto mb-2 block text-foreground/40"
|
||||
></i>
|
||||
<p class="text-sm font-semibold text-primary">
|
||||
Todavía no hay miembros en este grupo
|
||||
</p>
|
||||
<p class="mx-auto mt-1 max-w-sm text-sm text-foreground/80">
|
||||
Puedes compartir el enlace de invitación único o agregar miembros de forma
|
||||
manual o masiva.
|
||||
</p>
|
||||
<div class="mt-4 flex flex-col gap-2.5">
|
||||
<button class="btn btn-outline btn-block">
|
||||
<i data-lucide="share-2"></i><span>Compartir Enlace</span>
|
||||
</button>
|
||||
<button class="btn btn-primary btn-block">
|
||||
<i data-lucide="plus"></i><span>Agregar Miembros</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<p class="mt-3 text-xs leading-relaxed text-foreground/70">
|
||||
Exactamente <strong class="text-primary">un primario</strong>: “Agregar Miembros” en el
|
||||
empty state. El header no repite Compartir/Agregar —solo queda Estadísticas—, así que
|
||||
no compiten dos CTA idénticos.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- ═══════════════ ESTADO 2 · VACÍO (PENDIENTES) ═══════════════ -->
|
||||
<div class="frame">
|
||||
<p class="mb-2 text-sm font-semibold text-primary">
|
||||
2 · Estado vacío — pestaña “Pendientes”
|
||||
</p>
|
||||
<div class="screen">
|
||||
<section class="space-y-5">
|
||||
<div>
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="min-w-0">
|
||||
<h1 class="text-2xl font-bold leading-tight text-primary">Tai Chi Martes</h1>
|
||||
<p class="mt-1.5 text-sm leading-relaxed text-foreground/80">
|
||||
Tai chi para principiantes. Trae ropa cómoda.
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span
|
||||
class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full bg-success-soft px-2.5 py-0.5 text-[11px] font-medium text-success"
|
||||
>
|
||||
<span class="size-1.5 rounded-full bg-success"></span>Activo
|
||||
</span>
|
||||
<span
|
||||
class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full bg-warning-soft px-2.5 py-0.5 text-[11px] font-medium text-warning"
|
||||
>
|
||||
<span class="size-1.5 rounded-full bg-warning"></span>Riesgo moderado
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Grupo vacío: el header no repite Compartir/Agregar; los lleva el empty state. -->
|
||||
<div class="mt-4 grid grid-cols-2 gap-2.5">
|
||||
<button class="btn btn-outline btn-block">
|
||||
<i data-lucide="bar-chart-3" class="text-accent"></i><span>Estadísticas</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="divide-y divide-border/70 rounded-2xl bg-primary-soft p-4">
|
||||
<div class="flex items-start gap-3 py-3 first:pt-0">
|
||||
<i data-lucide="calendar-clock" class="icon-20 mt-0.5 shrink-0 text-accent"></i>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="label-cell">Horario</p>
|
||||
<p class="mt-1 text-base font-semibold leading-snug text-primary">Martes</p>
|
||||
<p class="mt-0.5 text-sm tabular text-foreground">18:00 - 19:30</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-start gap-3 py-3">
|
||||
<i data-lucide="users" class="icon-20 mt-0.5 shrink-0 text-accent"></i>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="label-cell">Miembros & Cupo</p>
|
||||
<p
|
||||
class="mt-1 flex items-baseline text-2xl font-semibold leading-none tracking-tight tabular text-primary"
|
||||
>
|
||||
<span>0</span><span class="text-base font-medium text-foreground/70">/4</span>
|
||||
</p>
|
||||
<div
|
||||
class="mt-2 h-1.5 w-full max-w-[9rem] overflow-hidden rounded-full bg-accent/15"
|
||||
>
|
||||
<div class="h-full w-0 rounded-full bg-accent"></div>
|
||||
</div>
|
||||
<p class="mt-1.5 text-sm text-foreground">4 lugares libres</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-start gap-3 py-3 last:pb-0">
|
||||
<div
|
||||
class="mt-0.5 flex size-5 shrink-0 items-center justify-center text-sm font-bold leading-none text-accent"
|
||||
>
|
||||
$
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="label-cell">Cobro</p>
|
||||
<p class="mt-1 text-base font-semibold tabular text-primary">$450.00</p>
|
||||
<p class="mt-0.5 text-sm text-foreground">Vence el día 10 de cada mes</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rounded-2xl bg-primary-soft p-2">
|
||||
<div class="space-y-2 p-2">
|
||||
<div class="flex flex-col gap-2.5">
|
||||
<div class="flex w-full flex-wrap items-center gap-2">
|
||||
<button class="chip">
|
||||
<i data-lucide="users"></i><span>Miembros</span>
|
||||
</button>
|
||||
<button class="chip chip-active">
|
||||
<i data-lucide="inbox"></i><span>Pendientes</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="relative w-full">
|
||||
<i
|
||||
data-lucide="search"
|
||||
class="absolute left-3 top-1/2 -translate-y-1/2 text-foreground/70"
|
||||
></i>
|
||||
<input
|
||||
class="h-11 w-full rounded-lg border border-transparent bg-surface pl-9 pr-3 text-base text-primary shadow-xs placeholder:text-foreground/80 focus:outline-none"
|
||||
placeholder="Buscar por nombre o teléfono..."
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-xs leading-relaxed text-foreground/80">
|
||||
Pre-inscripciones que esperan tu aprobación y personas en lista de espera por
|
||||
un cupo libre.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg bg-surface p-1 shadow-xs">
|
||||
<div class="rounded-lg bg-primary-soft/50 px-4 py-10 text-center">
|
||||
<i
|
||||
data-lucide="inbox"
|
||||
class="icon-40 mx-auto mb-2 block text-foreground/40"
|
||||
></i>
|
||||
<p class="text-sm font-semibold text-primary">No hay pendientes</p>
|
||||
<p class="mx-auto mt-1 max-w-sm text-sm text-foreground/80">
|
||||
Las pre-inscripciones que lleguen por el enlace compartido y las personas en
|
||||
lista de espera aparecerán aquí para que las revises.
|
||||
</p>
|
||||
<div class="mt-4 flex justify-center">
|
||||
<button class="btn btn-primary btn-block">
|
||||
<i data-lucide="share-2"></i><span>Compartir Enlace</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<p class="mt-3 text-xs leading-relaxed text-foreground/70">
|
||||
Cada pestaña vacía explica qué aparecerá ahí y ofrece
|
||||
<strong class="text-primary">una</strong> acción primaria concreta.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="mt-10 max-w-3xl border-t border-border pt-6 text-xs leading-relaxed text-foreground/70">
|
||||
<p>
|
||||
<strong class="text-primary">Jerarquía de la tarjeta:</strong> label 11px · dato 16px ·
|
||||
cupo 24px (único hero). Orden de lectura: Horario → Cupo → Cobro.
|
||||
<strong class="text-primary">Objetivos táctiles:</strong> chips, botones y buscador a
|
||||
44px; filas de tabla ~56px. <strong class="text-primary">Badges</strong> “Activo” y
|
||||
“Riesgo moderado” conservados.
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.addEventListener('load', () => {
|
||||
if (window.lucide) window.lucide.createIcons();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
.interface-design/group-detail-redesign.png
Normal file
BIN
.interface-design/group-detail-redesign.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 314 KiB |
@@ -36,14 +36,21 @@ accent azul; copy en español, verbos en infinitivo.
|
||||
## Patrón focal
|
||||
|
||||
**Un punto focal por bloque y por estado.** La tarjeta de info manda con el cupo; el header
|
||||
de grupo no tiene ningún `primary` (las tres acciones son `outline`) y el `primary` vive en
|
||||
de grupo no tiene ningún `primary` (Estadísticas y Compartir son `outline` y **Agregar es
|
||||
`ghost`**: con miembros en el grupo deja de competir con el listado) y el `primary` vive en
|
||||
el empty state de la vista que lo explica. Así nunca hay dos elementos azules compitiendo.
|
||||
|
||||
**Objetivos táctiles ≥ 44px** en esta pantalla: chips (`min-h-11`), botones del header y del
|
||||
empty state (`h-11`), buscador (`h-11`). Filas de tabla ~56px.
|
||||
|
||||
Preview visual de los dos estados (con miembros + vacío):
|
||||
`group-detail-redesign.html` / `.png` (mismo directorio).
|
||||
|
||||
## Componentes (valores exactos)
|
||||
|
||||
### Chip de sección — `detail/SectionChips.tsx`
|
||||
- Contenedor: `flex w-full flex-wrap items-center gap-2` + `role="group"` (no tablist).
|
||||
- Chip: `min-h-10 rounded-full border px-3 text-xs font-semibold gap-1.5`,
|
||||
- Chip: `min-h-11 rounded-full border px-3.5 text-xs font-semibold gap-1.5`,
|
||||
activo `border-transparent bg-accent text-on-accent shadow-xs`,
|
||||
inactivo `border-border bg-surface text-foreground/80 hover:border-accent/40 hover:bg-primary-soft hover:text-primary`,
|
||||
focus `ring-2 ring-accent ring-offset-2 ring-offset-primary-soft`.
|
||||
@@ -53,7 +60,10 @@ el empty state de la vista que lo explica. Así nunca hay dos elementos azules c
|
||||
- `aria-pressed` en cada chip. Envuelve en 1–3 filas según ancho: nunca recorta.
|
||||
|
||||
### Acciones de cabecera — `detail/GroupHeader.tsx`
|
||||
- `variant="outline"` con icono `text-accent`; `md` (`h-10 px-4`). `primary` solo en empty states.
|
||||
- Estadísticas y Compartir: `variant="outline"` con icono `text-accent`; **Agregar Miembros:
|
||||
`variant="ghost"`** (disponible, no dominante). Todas `h-11` (44px).
|
||||
- **Grupo vacío** (0 miembros + 0 pendientes): el header muestra **solo Estadísticas** —
|
||||
Compartir y Agregar los ofrecen los empty states, que ya llevan su primario explicado.
|
||||
- Móvil: `grid grid-cols-2 gap-2.5` (tercera acción `col-span-2`); `sm+`: `flex justify-end`.
|
||||
- Badges de estado: `rounded-full px-2.5 py-0.5 text-[11px]` + punto `size-1.5`.
|
||||
|
||||
@@ -76,7 +86,7 @@ el empty state de la vista que lo explica. Así nunca hay dos elementos azules c
|
||||
### Empty state
|
||||
`rounded-lg bg-primary-soft/50 px-4 py-10 text-center` · icono `size-10 text-foreground/40` ·
|
||||
título `text-sm font-semibold text-primary` · cuerpo `max-w-sm text-sm text-foreground/80` ·
|
||||
acciones: **una** `primary` + el resto `outline`.
|
||||
acciones: **una** `primary` + el resto `outline`, todas `h-11`.
|
||||
|
||||
### Tablas — `detail/*Table.tsx`
|
||||
`table-fixed text-sm` · nombre `w-[48%]` · chevron `w-9` · filas `px-3 py-2.5`
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
export { Avatar, type AvatarProps } from './avatar'
|
||||
export { Button, type ButtonProps, type ButtonVariant, type ButtonSize } from './button'
|
||||
export { Badge, type BadgeProps, type BadgeVariant } from './badge'
|
||||
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from './button'
|
||||
export { Input, type InputProps } from './input'
|
||||
export { Label, type LabelProps } from './label'
|
||||
export { Modal, type ModalProps } from './modal'
|
||||
export { ToastProvider, useToast, type ToastType, type Toast } from './toast'
|
||||
export { type Toast, ToastProvider, type ToastType, useToast } from './toast'
|
||||
export { Tooltip, type TooltipProps } from './tooltip'
|
||||
|
||||
|
||||
67
apps/web/src/components/ui/tooltip.tsx
Normal file
67
apps/web/src/components/ui/tooltip.tsx
Normal file
@@ -0,0 +1,67 @@
|
||||
import { type ReactNode, useId, useState } from 'react'
|
||||
import { cn } from '../../lib/utils'
|
||||
|
||||
export type TooltipProps = {
|
||||
/** Texto explicativo que se muestra al hacer hover, foco de teclado o tap. */
|
||||
content: ReactNode
|
||||
/** Contenido del disparador. Queda dentro de un <button> para ser accesible. */
|
||||
children: ReactNode
|
||||
className?: string
|
||||
/** Posicionamiento alternativo del globo (por defecto: abajo, anclado a la derecha en sm+). */
|
||||
tooltipClassName?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Tooltip accesible sin dependencias: hover (ratón), foco (teclado) y tap
|
||||
* (táctil, vía focus). Se cierra con Escape, al salir el puntero o al perder
|
||||
* el foco. El globo se ancla abajo del disparador para no tapar el contenido.
|
||||
*/
|
||||
export function Tooltip({ content, children, className, tooltipClassName }: TooltipProps) {
|
||||
const [open, setOpen] = useState(false)
|
||||
const id = useId()
|
||||
|
||||
const show = () => setOpen(true)
|
||||
const hide = () => setOpen(false)
|
||||
|
||||
return (
|
||||
<span className="relative inline-flex">
|
||||
<button
|
||||
type="button"
|
||||
aria-describedby={open ? id : undefined}
|
||||
// El hover solo aplica a punteros de ratón: en táctil no hay "hover
|
||||
// persistente" y el tap se resuelve con focus + click.
|
||||
onPointerEnter={(e) => {
|
||||
if (e.pointerType === 'mouse') show()
|
||||
}}
|
||||
onPointerLeave={(e) => {
|
||||
if (e.pointerType === 'mouse') hide()
|
||||
}}
|
||||
onFocus={show}
|
||||
onBlur={hide}
|
||||
onClick={show}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Escape') hide()
|
||||
}}
|
||||
className={cn(
|
||||
'inline-flex cursor-help rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent',
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
|
||||
{open ? (
|
||||
<span
|
||||
id={id}
|
||||
role="tooltip"
|
||||
className={cn(
|
||||
'absolute top-full left-0 z-50 mt-1.5 w-max max-w-[min(16rem,calc(100vw_-_2rem))] rounded-lg border border-border bg-surface px-2.5 py-2 text-xs leading-snug text-foreground shadow-sm animate-fade-in sm:left-auto sm:right-0',
|
||||
tooltipClassName,
|
||||
)}
|
||||
>
|
||||
{content}
|
||||
</span>
|
||||
) : null}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import type { GroupDto, GroupRiskLevel } from '@gruperly/shared'
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import { CalendarClock, Users } from 'lucide-react'
|
||||
import { Badge, Button } from '../../components/ui'
|
||||
import { Badge, Button, Tooltip } from '../../components/ui'
|
||||
import { BILLING_LABELS, formatPrice, formatSchedule } from '../../lib/format'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { RISK_LABELS } from './constants'
|
||||
import { RISK_HINT, RISK_LABELS } from './constants'
|
||||
|
||||
export function GroupCard({
|
||||
group,
|
||||
@@ -28,16 +28,20 @@ export function GroupCard({
|
||||
</div>
|
||||
<div className="flex flex-col items-end gap-1.5">
|
||||
{hasRisk ? (
|
||||
<Badge variant={riskLevel === 'HIGH' ? 'danger' : 'warning'} className="gap-1.5">
|
||||
<span
|
||||
className={cn(
|
||||
'size-2 rounded-full',
|
||||
riskLevel === 'HIGH' ? 'bg-danger' : 'bg-warning',
|
||||
)}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
{RISK_LABELS[riskLevel]}
|
||||
</Badge>
|
||||
// Mismo tooltip que en el detalle: el badge es corto y la
|
||||
// explicación (abandono, no cobranza) la da el tooltip.
|
||||
<Tooltip content={RISK_HINT} tooltipClassName="left-auto right-0">
|
||||
<Badge variant={riskLevel === 'HIGH' ? 'danger' : 'warning'} className="gap-1.5">
|
||||
<span
|
||||
className={cn(
|
||||
'size-2 rounded-full',
|
||||
riskLevel === 'HIGH' ? 'bg-danger' : 'bg-warning',
|
||||
)}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
{RISK_LABELS[riskLevel]}
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
) : null}
|
||||
<Badge variant="success">Activo</Badge>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { StudentAtRiskDto } from '@gruperly/shared'
|
||||
import { MessageCircle, MoreVertical, Pause, UserMinus } from 'lucide-react'
|
||||
import { Avatar, Badge, Button } from '../../../components/ui'
|
||||
import { cn } from '../../../lib/utils'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
|
||||
export type StatusAction = { student: StudentAtRiskDto; status: 'PAUSED' | 'DROPPED' } | null
|
||||
|
||||
@@ -32,8 +32,10 @@ export function AtRiskStudentCard({
|
||||
<div className="min-w-0">
|
||||
<p className="truncate text-sm font-semibold text-primary">{student.fullName}</p>
|
||||
<p className="mt-0.5 text-xs text-foreground/50">
|
||||
{student.phone ?? 'Sin teléfono'} · {student.monthlyAttendanceRate}% de asistencia
|
||||
mensual
|
||||
{student.phone
|
||||
? `${formatPhoneDisplay(student.phone)} · `
|
||||
: 'Sin teléfono · '}
|
||||
{student.monthlyAttendanceRate}% de asistencia mensual
|
||||
</p>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
@@ -4,3 +4,8 @@ export const RISK_LABELS: Record<Exclude<GroupRiskLevel, 'NONE'>, string> = {
|
||||
HIGH: 'Riesgo alto',
|
||||
MEDIUM: 'Riesgo moderado',
|
||||
}
|
||||
|
||||
/* El badge solo dice "Riesgo moderado"; esta frase explica de qué habla
|
||||
(abandono de un miembro, no fraude ni cobranza) y vive en el tooltip. */
|
||||
export const RISK_HINT =
|
||||
'Riesgo de abandono: probabilidad estimada de que algún miembro abandone el grupo.'
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
UserMinus,
|
||||
} from 'lucide-react'
|
||||
import { Button } from '../../../components/ui'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
import { AttendeeAttendanceStats } from './AttendeeAttendanceStats'
|
||||
import { useAttendeeDetail } from './AttendeeDetailProvider'
|
||||
import { DetailRow } from './DetailRow'
|
||||
@@ -97,7 +98,7 @@ export function AttendeeDetailPage() {
|
||||
<DetailRow icon={<Phone className="size-4 text-accent" />} label="Teléfono">
|
||||
{attendee.phone ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-primary">{attendee.phone}</span>
|
||||
<span className="text-primary">{formatPhoneDisplay(attendee.phone)}</span>
|
||||
<a
|
||||
href={`https://wa.me/${attendee.phone.replace(/\D/g, '')}`}
|
||||
target="_blank"
|
||||
@@ -136,7 +137,7 @@ export function AttendeeDetailPage() {
|
||||
{attendee.guardianPhone ? (
|
||||
<DetailRow icon={<Phone className="size-4 text-accent" />} label="Tel. Responsable">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-primary">{attendee.guardianPhone}</span>
|
||||
<span className="text-primary">{formatPhoneDisplay(attendee.guardianPhone)}</span>
|
||||
<a
|
||||
href={`https://wa.me/${attendee.guardianPhone.replace(/\D/g, '')}`}
|
||||
target="_blank"
|
||||
|
||||
@@ -1,15 +1,33 @@
|
||||
import { Link, useNavigate } from '@tanstack/react-router'
|
||||
import { ArrowLeft, BarChart3, Share2, UserPlus } from 'lucide-react'
|
||||
import { Badge, Button } from '../../../components/ui'
|
||||
import { Badge, Button, Tooltip } from '../../../components/ui'
|
||||
import { cn } from '../../../lib/utils'
|
||||
import { RISK_LABELS } from '../constants'
|
||||
import { RISK_HINT, RISK_LABELS } from '../constants'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
|
||||
export function GroupHeader() {
|
||||
const { group, groupId, riskLevel, openInviteModal } = useGroupDetail()
|
||||
const {
|
||||
group,
|
||||
groupId,
|
||||
riskLevel,
|
||||
openInviteModal,
|
||||
attendeesTotal,
|
||||
attendeesPending,
|
||||
preRegistrationsTotal,
|
||||
preRegistrationsPending,
|
||||
waitlistTotal,
|
||||
waitlistPending,
|
||||
} = useGroupDetail()
|
||||
const navigate = useNavigate()
|
||||
const hasRisk = riskLevel === 'HIGH' || riskLevel === 'MEDIUM'
|
||||
|
||||
// Grupo recién creado (sin miembros ni pendientes): los empty states de cada
|
||||
// pestaña ya ofrecen "Compartir" y "Agregar" con su primario explicado, así
|
||||
// que el header no repite las mismas acciones una segunda vez.
|
||||
const listLoading = attendeesPending || preRegistrationsPending || waitlistPending
|
||||
const isEmptyGroup =
|
||||
!listLoading && attendeesTotal === 0 && preRegistrationsTotal === 0 && waitlistTotal === 0
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Link
|
||||
@@ -38,54 +56,67 @@ export function GroupHeader() {
|
||||
Activo
|
||||
</Badge>
|
||||
{hasRisk ? (
|
||||
<Badge
|
||||
variant={riskLevel === 'HIGH' ? 'danger' : 'warning'}
|
||||
className="gap-1.5 text-[11px]"
|
||||
>
|
||||
<span
|
||||
className={cn('size-1.5 rounded-full', riskLevel === 'HIGH' ? 'bg-danger' : 'bg-warning')}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
{RISK_LABELS[riskLevel]}
|
||||
</Badge>
|
||||
// El badge no puede llevar texto largo sin ensuciar el header: la
|
||||
// explicación (riesgo de abandono, no de cobranza) vive en el tooltip.
|
||||
<Tooltip content={RISK_HINT}>
|
||||
<Badge
|
||||
variant={riskLevel === 'HIGH' ? 'danger' : 'warning'}
|
||||
className="gap-1.5 text-[11px]"
|
||||
>
|
||||
<span
|
||||
className={cn(
|
||||
'size-1.5 rounded-full',
|
||||
riskLevel === 'HIGH' ? 'bg-danger' : 'bg-warning',
|
||||
)}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
{RISK_LABELS[riskLevel]}
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 grid grid-cols-2 gap-2.5 sm:mt-5 sm:flex sm:flex-wrap sm:items-center sm:justify-end sm:gap-2.5">
|
||||
{/* `h-11` (44px) para todos: objetivo táctil mínimo. */}
|
||||
{!isEmptyGroup ? (
|
||||
// Un solo primario por pantalla: "Agregar" encabeza la jerarquía y
|
||||
// las acciones de apoyo quedan debajo en outline.
|
||||
<Button
|
||||
variant="primary"
|
||||
onClick={() =>
|
||||
void navigate({ to: '/groups/$groupId/attendees/new', params: { groupId } })
|
||||
}
|
||||
className="col-span-2 h-11 w-full justify-center sm:w-auto"
|
||||
>
|
||||
<UserPlus className="size-4" />
|
||||
<span>Agregar miembro</span>
|
||||
</Button>
|
||||
) : null}
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => void navigate({ to: '/groups/$groupId/analytics', params: { groupId } })}
|
||||
className="w-full justify-center border-border sm:w-auto"
|
||||
className={cn(
|
||||
'h-11 w-full justify-center border-border sm:w-auto',
|
||||
// En grupo vacío es la única acción del header: ocupa la fila entera.
|
||||
isEmptyGroup && 'col-span-2',
|
||||
)}
|
||||
>
|
||||
<BarChart3 className="size-4 text-accent" />
|
||||
<span>Estadísticas</span>
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={openInviteModal}
|
||||
className="w-full justify-center border-border sm:w-auto"
|
||||
>
|
||||
<Share2 className="size-4 text-accent" />
|
||||
<span>
|
||||
Compartir <span className="hidden sm:inline">Link</span>
|
||||
</span>
|
||||
</Button>
|
||||
{/* Acciones de nivel secundario: con miembros en el grupo el foco es el
|
||||
listado, no el botón. El `primary` de "Agregar" vive en el empty
|
||||
state, que es donde la acción necesita explicarse. */}
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() =>
|
||||
void navigate({ to: '/groups/$groupId/attendees/new', params: { groupId } })
|
||||
}
|
||||
className="col-span-2 w-full justify-center sm:w-auto"
|
||||
>
|
||||
<UserPlus className="size-4 text-accent" />
|
||||
<span>
|
||||
Agregar <span className="hidden sm:inline">Miembros</span>
|
||||
</span>
|
||||
</Button>
|
||||
{!isEmptyGroup ? (
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={openInviteModal}
|
||||
className="h-11 w-full justify-center border-border sm:w-auto"
|
||||
>
|
||||
<Share2 className="size-4 text-accent" />
|
||||
<span>
|
||||
Compartir <span className="hidden sm:inline">Link</span>
|
||||
</span>
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -9,9 +9,10 @@ import { useGroupDetail } from './GroupDetailProvider'
|
||||
|
||||
/* Escala de la tarjeta: label 11 (etiqueta) · valor 16 (dato) · hero 24
|
||||
(cupo). El cupo es lo único que se escanea de un vistazo, por eso es el
|
||||
único que sube de nivel; el resto se lee en línea. */
|
||||
único que sube de nivel; el resto se lee en línea. El ritmo vertical está
|
||||
apretado a propósito (~24px menos que antes) sin bajar la legibilidad. */
|
||||
const LABEL_CLASS = 'text-[11px] font-semibold uppercase tracking-wide text-foreground/70'
|
||||
const CELL_CLASS = 'flex items-start gap-3 py-3 first:pt-0 last:pb-0 md:py-0'
|
||||
const CELL_CLASS = 'flex items-start gap-3 py-2.5 first:pt-0 last:pb-0 md:py-0'
|
||||
|
||||
export function GroupInfoCard() {
|
||||
const { group, attendeesTotal, attendeesPending, waitlistTotal } = useGroupDetail()
|
||||
@@ -32,12 +33,12 @@ export function GroupInfoCard() {
|
||||
const waitlistMeta = waitlistTotal > 0 ? ` · ${waitlistTotal} en espera` : ''
|
||||
|
||||
return (
|
||||
<div className="divide-y divide-border/70 rounded-2xl bg-primary-soft p-4 sm:p-5 md:grid md:grid-cols-3 md:divide-x md:divide-y-0">
|
||||
<div className="divide-y divide-border/70 rounded-2xl bg-primary-soft p-3.5 sm:p-4 md:grid md:grid-cols-3 md:divide-x md:divide-y-0">
|
||||
<div className={cn(CELL_CLASS, 'md:pr-6')}>
|
||||
<CalendarClock className="mt-0.5 size-5 shrink-0 text-accent" />
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className={LABEL_CLASS}>Horario</p>
|
||||
<p className="mt-1 text-base font-semibold leading-snug text-primary">
|
||||
<p className="mt-0.5 text-base font-semibold leading-snug text-primary">
|
||||
{daysLabel || 'Sin horario definido'}
|
||||
</p>
|
||||
{daysLabel && group.time ? (
|
||||
@@ -50,7 +51,7 @@ export function GroupInfoCard() {
|
||||
<Users className="mt-0.5 size-5 shrink-0 text-accent" />
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className={LABEL_CLASS}>Miembros & Cupo</p>
|
||||
<p className="mt-1 flex items-baseline text-2xl font-semibold leading-none tracking-tight tabular-nums text-primary">
|
||||
<p className="mt-0.5 flex items-baseline text-2xl font-semibold leading-none tracking-tight tabular-nums text-primary">
|
||||
<span>{attendeesPending ? '—' : attendeesTotal}</span>
|
||||
{capacity ? (
|
||||
<span className="text-base font-medium text-foreground/70">/{capacity}</span>
|
||||
@@ -65,7 +66,7 @@ export function GroupInfoCard() {
|
||||
aria-valuemax={capacity}
|
||||
aria-valuenow={attendeesPending ? 0 : attendeesTotal}
|
||||
aria-valuetext={`${attendeesTotal} de ${capacity}`}
|
||||
className="mt-2 h-1.5 w-full max-w-[9rem] overflow-hidden rounded-full bg-accent/15"
|
||||
className="mt-1.5 h-1.5 w-full max-w-[9rem] overflow-hidden rounded-full bg-accent/15"
|
||||
>
|
||||
<div
|
||||
className={cn(
|
||||
@@ -78,7 +79,7 @@ export function GroupInfoCard() {
|
||||
) : null}
|
||||
|
||||
{!attendeesPending ? (
|
||||
<p className={cn('mt-1.5 text-sm', isFull ? 'text-warning' : 'text-foreground')}>
|
||||
<p className={cn('mt-1 text-sm', isFull ? 'text-warning' : 'text-foreground')}>
|
||||
{capacityMeta}
|
||||
{waitlistMeta}
|
||||
</p>
|
||||
@@ -92,7 +93,7 @@ export function GroupInfoCard() {
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className={LABEL_CLASS}>Cobro</p>
|
||||
<p className="mt-1 text-base font-semibold tabular-nums text-primary">
|
||||
<p className="mt-0.5 text-base font-semibold tabular-nums text-primary">
|
||||
{group.price != null ? formatPrice(group.price) : 'Sin precio'}
|
||||
</p>
|
||||
{billingMeta && group.price != null ? (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { AttendeeDto } from '@gruperly/shared'
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import { ChevronRight } from 'lucide-react'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
|
||||
export function MembersTable({ attendees }: { attendees: AttendeeDto[] }) {
|
||||
@@ -15,9 +16,9 @@ export function MembersTable({ attendees }: { attendees: AttendeeDto[] }) {
|
||||
<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-[48%] px-3 pb-2">Nombre</th>
|
||||
<th scope="col" className="px-3 pb-2">Teléfono</th>
|
||||
<th scope="col" className="w-9 px-1 pb-2">
|
||||
<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>
|
||||
<th scope="col" className="w-8 px-1 pb-1.5">
|
||||
<span className="sr-only">Detalle</span>
|
||||
</th>
|
||||
</tr>
|
||||
@@ -26,31 +27,43 @@ export function MembersTable({ attendees }: { attendees: AttendeeDto[] }) {
|
||||
{attendees.map((attendee) => (
|
||||
<tr
|
||||
key={attendee.id}
|
||||
className="group cursor-pointer border-b border-border/70 transition-colors last:border-b-0 hover:bg-primary-soft/60"
|
||||
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"
|
||||
onClick={() => openAttendee(attendee.id)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault()
|
||||
openAttendee(attendee.id)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<td className="px-3 py-2.5">
|
||||
<div className="flex min-w-0 items-center gap-2.5">
|
||||
<div className="flex size-9 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent">
|
||||
<td className="px-2 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">
|
||||
{attendee.fullName.charAt(0).toUpperCase()}
|
||||
</div>
|
||||
{/* `truncate` solo recorta lo pintado: el texto completo sigue en
|
||||
el DOM para lectores de pantalla, y `title` lo muestra al hover. */}
|
||||
<span className="min-w-0 truncate font-medium text-primary" title={attendee.fullName}>
|
||||
<span
|
||||
className="min-w-0 truncate font-semibold text-primary"
|
||||
title={attendee.fullName}
|
||||
>
|
||||
{attendee.fullName}
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td className="min-w-0 px-3 py-2.5 text-foreground/80">
|
||||
{/* El nombre manda; el teléfono es un dato secundario: un nivel
|
||||
más abajo en la escala de color, en un tamaño menor. */}
|
||||
<td className="min-w-0 px-2 py-2 text-xs text-foreground/70">
|
||||
{attendee.phone ? (
|
||||
<span className="block truncate tabular-nums" title={attendee.phone}>
|
||||
{attendee.phone}
|
||||
{formatPhoneDisplay(attendee.phone)}
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-foreground/60">—</span>
|
||||
)}
|
||||
</td>
|
||||
<td className="w-9 px-1 py-2.5 text-foreground/50">
|
||||
<td className="w-8 px-1 py-2 text-foreground/50">
|
||||
<ChevronRight className="ml-auto size-4 transition-colors group-hover:text-accent" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -38,7 +38,7 @@ export function MembersView() {
|
||||
masiva.
|
||||
</p>
|
||||
<div className="mt-4 flex flex-col gap-2.5 sm:flex-row sm:items-center sm:justify-center sm:gap-3">
|
||||
<Button variant="outline" onClick={openInviteModal} className="w-full sm:w-auto">
|
||||
<Button variant="outline" onClick={openInviteModal} className="h-11 w-full sm:w-auto">
|
||||
<Share2 className="size-4" />
|
||||
Compartir Enlace
|
||||
</Button>
|
||||
@@ -47,7 +47,7 @@ export function MembersView() {
|
||||
onClick={() =>
|
||||
void navigate({ to: '/groups/$groupId/attendees/new', params: { groupId } })
|
||||
}
|
||||
className="w-full sm:w-auto"
|
||||
className="h-11 w-full sm:w-auto"
|
||||
>
|
||||
<Plus className="size-4" />
|
||||
Agregar Miembros
|
||||
|
||||
@@ -24,12 +24,14 @@ export function MembersWaitlistSection() {
|
||||
value={searchFilter}
|
||||
onChange={(e) => setSearchFilter(e.target.value)}
|
||||
aria-label="Buscar en el listado"
|
||||
className="h-10 rounded-lg border-transparent pl-9 shadow-xs placeholder:text-foreground/80"
|
||||
className="h-11 rounded-lg border-transparent pl-9 shadow-xs placeholder:text-foreground/80"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className="text-xs leading-relaxed text-foreground/80">
|
||||
{/* Copia de apoyo: un solo bloque, ancho acotado y sin competir con
|
||||
los datos. Explica la diferencia entre ambos estados. */}
|
||||
<p className="max-w-2xl text-xs leading-snug text-foreground/80">
|
||||
{listSection === 'members'
|
||||
? 'Listado de todos los miembros incorporados al grupo.'
|
||||
: 'Pre-inscripciones que esperan tu aprobación y personas en lista de espera por un cupo libre.'}
|
||||
|
||||
@@ -45,7 +45,7 @@ export function PendingView() {
|
||||
espera aparecerán aquí para que las revises.
|
||||
</p>
|
||||
<div className="mt-4 flex justify-center">
|
||||
<Button variant="primary" onClick={openInviteModal} className="w-full sm:w-auto">
|
||||
<Button variant="primary" onClick={openInviteModal} className="h-11 w-full sm:w-auto">
|
||||
<Share2 className="size-4" />
|
||||
Compartir Enlace
|
||||
</Button>
|
||||
@@ -88,14 +88,18 @@ export function PendingView() {
|
||||
{sections.map((section) => {
|
||||
const Icon = section.icon
|
||||
const hasRows = section.count > 0
|
||||
const titleId = `pending-${section.title.replace(/\s+/g, '-').toLowerCase()}`
|
||||
// Con búsqueda activa, las secciones sin coincidencias se ocultan.
|
||||
if (!hasRows && query) return null
|
||||
|
||||
return (
|
||||
<section key={section.key}>
|
||||
<div className="flex items-center gap-2 border-b border-border/70 px-3 pb-2 pt-3">
|
||||
<Icon className="size-4 shrink-0 text-accent" />
|
||||
<h3 className="text-xs font-semibold uppercase tracking-wide text-foreground/70">
|
||||
<section key={section.key} aria-labelledby={titleId}>
|
||||
<div className="flex items-center gap-2 border-b border-border/70 px-3 pb-1.5 pt-2">
|
||||
<Icon className="size-4 shrink-0 text-accent" aria-hidden="true" />
|
||||
<h3
|
||||
id={titleId}
|
||||
className="text-xs font-semibold uppercase tracking-wide text-foreground/70"
|
||||
>
|
||||
{section.title}
|
||||
</h3>
|
||||
{hasRows ? (
|
||||
@@ -104,7 +108,7 @@ export function PendingView() {
|
||||
'ml-auto inline-flex items-center justify-center rounded-full px-1.5 py-0.5 text-[10px] font-bold leading-none tabular-nums',
|
||||
section.attention
|
||||
? 'bg-warning-soft text-warning'
|
||||
: 'bg-primary-soft text-foreground/60',
|
||||
: 'bg-primary-soft text-foreground/70',
|
||||
)}
|
||||
>
|
||||
{section.count}
|
||||
@@ -113,9 +117,9 @@ export function PendingView() {
|
||||
</div>
|
||||
|
||||
{hasRows ? (
|
||||
<div className="pt-1">{section.table}</div>
|
||||
<div className="pt-0.5">{section.table}</div>
|
||||
) : (
|
||||
<p className="px-3 py-3 text-xs text-foreground/70">{section.emptyNote}</p>
|
||||
<p className="px-3 py-2 text-xs text-foreground/70">{section.emptyNote}</p>
|
||||
)}
|
||||
</section>
|
||||
)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Ban, Loader2, Mail, MessageCircle, Phone, UserCheck } from 'lucide-react'
|
||||
import { Button, Modal } from '../../../components/ui'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
import { DetailRow } from './DetailRow'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
|
||||
@@ -45,7 +46,7 @@ export function PreRegistrationDetailModal() {
|
||||
<div className="space-y-1 divide-y divide-border rounded-xl border border-border bg-primary-soft/30">
|
||||
<DetailRow icon={<Phone className="size-4 text-accent" />} label="Teléfono">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-primary">{selectedPreRegistration.phone}</span>
|
||||
<span className="text-primary">{formatPhoneDisplay(selectedPreRegistration.phone)}</span>
|
||||
<a
|
||||
href={`https://wa.me/${selectedPreRegistration.phone.replace(/\D/g, '')}`}
|
||||
target="_blank"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { GroupPreRegistrationDto } from '@gruperly/shared'
|
||||
import { ChevronRight } from 'lucide-react'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
|
||||
export function PreRegistrationsTable({ entries }: { entries: GroupPreRegistrationDto[] }) {
|
||||
@@ -9,11 +10,11 @@ export function PreRegistrationsTable({ entries }: { entries: GroupPreRegistrati
|
||||
<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-[46%] px-3 pb-2">Nombre</th>
|
||||
<th scope="col" className="px-3 pb-2">Teléfono</th>
|
||||
<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>
|
||||
{/* En móvil el teléfono manda: la fecha vive en el detalle. */}
|
||||
<th scope="col" className="hidden px-3 pb-2 sm:table-cell">Solicitado</th>
|
||||
<th scope="col" className="w-9 px-1 pb-2">
|
||||
<th scope="col" className="hidden px-2 pb-1.5 sm:table-cell">Solicitado</th>
|
||||
<th scope="col" className="w-8 px-1 pb-1.5">
|
||||
<span className="sr-only">Detalle</span>
|
||||
</th>
|
||||
</tr>
|
||||
@@ -22,16 +23,23 @@ export function PreRegistrationsTable({ entries }: { entries: GroupPreRegistrati
|
||||
{entries.map((entry) => (
|
||||
<tr
|
||||
key={entry.id}
|
||||
className="group cursor-pointer border-b border-border/70 transition-colors last:border-b-0 hover:bg-primary-soft/60"
|
||||
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"
|
||||
onClick={() => setSelectedPreRegistration(entry)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault()
|
||||
setSelectedPreRegistration(entry)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<td className="px-3 py-2.5">
|
||||
<div className="flex min-w-0 items-center gap-2.5">
|
||||
<div className="flex size-9 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent">
|
||||
<td className="px-2 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()}
|
||||
</div>
|
||||
<div className="min-w-0">
|
||||
<p className="truncate font-medium text-primary" title={entry.fullName}>
|
||||
<p className="truncate font-semibold text-primary" title={entry.fullName}>
|
||||
{entry.fullName}
|
||||
</p>
|
||||
{entry.email ? (
|
||||
@@ -42,18 +50,18 @@ export function PreRegistrationsTable({ entries }: { entries: GroupPreRegistrati
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="min-w-0 px-3 py-2.5 text-foreground/80">
|
||||
<td className="min-w-0 px-2 py-2 text-xs text-foreground/70">
|
||||
<span className="block truncate tabular-nums" title={entry.phone}>
|
||||
{entry.phone}
|
||||
{formatPhoneDisplay(entry.phone)}
|
||||
</span>
|
||||
</td>
|
||||
<td className="hidden min-w-0 px-3 py-2.5 text-xs text-foreground/70 sm:table-cell">
|
||||
<td className="hidden min-w-0 px-2 py-2 text-xs text-foreground/70 sm:table-cell">
|
||||
{new Date(entry.createdAt).toLocaleDateString('es-ES', {
|
||||
day: 'numeric',
|
||||
month: 'short',
|
||||
})}
|
||||
</td>
|
||||
<td className="w-9 px-1 py-2.5 text-foreground/50">
|
||||
<td className="w-8 px-1 py-2 text-foreground/50">
|
||||
<ChevronRight className="ml-auto size-4 transition-colors group-hover:text-accent" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { AttendeeDto, GroupWaitlistEntryDto } from '@gruperly/shared'
|
||||
import { Clock, Loader2, Trash2, UserCheck, UserMinus } from 'lucide-react'
|
||||
import { Button, Modal } from '../../../components/ui'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
|
||||
type RemoveAttendeeModalProps = {
|
||||
attendee: AttendeeDto | null
|
||||
@@ -37,7 +38,9 @@ export function RemoveAttendeeModal({
|
||||
<strong className="text-primary">{groupName}</strong>
|
||||
{firstWaitlistEntry ? ' y el cupo quedará libre.' : '.'}
|
||||
{attendee.phone ? (
|
||||
<span className="mt-1 block text-xs text-foreground/50">Teléfono: {attendee.phone}</span>
|
||||
<span className="mt-1 block text-xs text-foreground/50">
|
||||
Teléfono: {formatPhoneDisplay(attendee.phone)}
|
||||
</span>
|
||||
) : null}
|
||||
</p>
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ export function SectionChips() {
|
||||
aria-pressed={isActive}
|
||||
onClick={() => setListSection(section.id)}
|
||||
className={cn(
|
||||
'inline-flex min-h-10 items-center gap-1.5 rounded-full border px-3 text-xs font-semibold',
|
||||
// min-h-11 (44px): objetivo táctil mínimo de iOS/Android.
|
||||
'inline-flex min-h-11 items-center gap-1.5 rounded-full border px-3.5 text-xs font-semibold',
|
||||
'transition-[background-color,color,border-color,box-shadow] duration-150',
|
||||
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-primary-soft',
|
||||
isActive
|
||||
@@ -63,7 +64,7 @@ export function SectionChips() {
|
||||
? 'bg-on-accent/25 text-on-accent'
|
||||
: isAttention
|
||||
? 'bg-warning-soft text-warning'
|
||||
: 'bg-primary-soft text-foreground/60',
|
||||
: 'bg-primary-soft text-foreground/70',
|
||||
)}
|
||||
>
|
||||
{count}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Loader2, Mail, MessageCircle, Phone, StickyNote, Trash2, UserCheck } from 'lucide-react'
|
||||
import { Button, Modal } from '../../../components/ui'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
import { DetailRow } from './DetailRow'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
|
||||
@@ -44,7 +45,7 @@ export function WaitlistEntryDetailModal() {
|
||||
<DetailRow icon={<Phone className="size-4 text-accent" />} label="Teléfono">
|
||||
{selectedWaitlistEntry.phone ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-primary">{selectedWaitlistEntry.phone}</span>
|
||||
<span className="text-primary">{formatPhoneDisplay(selectedWaitlistEntry.phone)}</span>
|
||||
<a
|
||||
href={`https://wa.me/${selectedWaitlistEntry.phone.replace(/\D/g, '')}`}
|
||||
target="_blank"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { GroupWaitlistEntryDto } from '@gruperly/shared'
|
||||
import { ChevronRight } from 'lucide-react'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
|
||||
export function WaitlistTable({ entries }: { entries: GroupWaitlistEntryDto[] }) {
|
||||
@@ -9,9 +10,9 @@ export function WaitlistTable({ entries }: { entries: GroupWaitlistEntryDto[] })
|
||||
<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-[48%] px-3 pb-2">Nombre</th>
|
||||
<th scope="col" className="px-3 pb-2">Teléfono</th>
|
||||
<th scope="col" className="w-9 px-1 pb-2">
|
||||
<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>
|
||||
<th scope="col" className="w-8 px-1 pb-1.5">
|
||||
<span className="sr-only">Detalle</span>
|
||||
</th>
|
||||
</tr>
|
||||
@@ -20,16 +21,23 @@ export function WaitlistTable({ entries }: { entries: GroupWaitlistEntryDto[] })
|
||||
{entries.map((entry) => (
|
||||
<tr
|
||||
key={entry.id}
|
||||
className="group cursor-pointer border-b border-border/70 transition-colors last:border-b-0 hover:bg-primary-soft/60"
|
||||
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"
|
||||
onClick={() => setSelectedWaitlistEntry(entry)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault()
|
||||
setSelectedWaitlistEntry(entry)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<td className="px-3 py-2.5">
|
||||
<div className="flex min-w-0 items-center gap-2.5">
|
||||
<div className="flex size-9 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent">
|
||||
<td className="px-2 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()}
|
||||
</div>
|
||||
<div className="min-w-0">
|
||||
<p className="truncate font-medium text-primary" title={entry.fullName}>
|
||||
<p className="truncate font-semibold text-primary" title={entry.fullName}>
|
||||
{entry.fullName}
|
||||
</p>
|
||||
{entry.notes ? (
|
||||
@@ -40,16 +48,16 @@ export function WaitlistTable({ entries }: { entries: GroupWaitlistEntryDto[] })
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="min-w-0 px-3 py-2.5 text-foreground/80">
|
||||
<td className="min-w-0 px-2 py-2 text-xs text-foreground/70">
|
||||
{entry.phone ? (
|
||||
<span className="block truncate tabular-nums" title={entry.phone}>
|
||||
{entry.phone}
|
||||
{formatPhoneDisplay(entry.phone)}
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-foreground/60">—</span>
|
||||
)}
|
||||
</td>
|
||||
<td className="w-9 px-1 py-2.5 text-foreground/50">
|
||||
<td className="w-8 px-1 py-2 text-foreground/50">
|
||||
<ChevronRight className="ml-auto size-4 transition-colors group-hover:text-accent" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -49,9 +49,83 @@ export function formatSchedule(days: readonly WeekDay[], time: string | null): s
|
||||
return time ? `${dayNames.join(', ')} · ${time}` : dayNames.join(', ')
|
||||
}
|
||||
|
||||
export function formatPrice(price: number | null): string {
|
||||
/* Moneda por defecto de la app (Argentina). Solo define cómo se pinta: el
|
||||
valor persistido no cambia. La firma acepta la moneda para que el paso a
|
||||
multi-moneda no obligue a tocar los call sites. */
|
||||
export const DEFAULT_CURRENCY = 'ARS'
|
||||
|
||||
export function formatPrice(price: number | null, currency: string = DEFAULT_CURRENCY): string {
|
||||
if (price == null) return '—'
|
||||
return price.toLocaleString('es-MX', { style: 'currency', currency: 'MXN' })
|
||||
// Importes enteros sin decimales ($50.000); con centavos se respetan.
|
||||
const hasCents = !Number.isInteger(price)
|
||||
return new Intl.NumberFormat('es-AR', {
|
||||
style: 'currency',
|
||||
currency,
|
||||
minimumFractionDigits: hasCents ? 2 : 0,
|
||||
maximumFractionDigits: 2,
|
||||
})
|
||||
.format(price)
|
||||
// es-AR separa el símbolo con un espacio duro (U+00A0): preferimos "$50.000".
|
||||
.replace(/\u00A0/g, '')
|
||||
}
|
||||
|
||||
/* Presentación de teléfonos (Argentina). Nunca altera el valor persistido:
|
||||
es maquillaje de salida, y los links wa.me siguen usando los dígitos crudos.
|
||||
|
||||
Estrategia: se normalizan los prefijos conocidos (0054 / 54 / 0 nacional y
|
||||
el 9 de móvil argentino). Si el resultado no parece un número plausible
|
||||
(6 a 10 dígitos nacionales) se devuelve el valor original tal cual: es
|
||||
preferible un número sin maquillar a uno inventado. */
|
||||
export function formatPhoneDisplay(value: string | null | undefined): string | null {
|
||||
if (value == null) return null
|
||||
const raw = value.trim()
|
||||
if (!raw) return null
|
||||
|
||||
let digits = raw.replace(/\D/g, '')
|
||||
if (digits.length < 6) return raw
|
||||
|
||||
let isAr = false
|
||||
let isMobile = false
|
||||
|
||||
if (digits.startsWith('0054')) {
|
||||
digits = digits.slice(4)
|
||||
isAr = true
|
||||
} else if (digits.startsWith('54') && digits.length >= 12) {
|
||||
digits = digits.slice(2)
|
||||
isAr = true
|
||||
}
|
||||
|
||||
// Móvil argentino: 9 + 10 dígitos nacionales.
|
||||
if (digits.length === 11 && digits.startsWith('9')) {
|
||||
digits = digits.slice(1)
|
||||
isMobile = true
|
||||
isAr = true
|
||||
}
|
||||
|
||||
// 0 de trunk nacional (0 + 10 dígitos; o 0 + 9 tras el 9 de móvil).
|
||||
if (digits.startsWith('0') && digits.length >= 9) {
|
||||
digits = digits.slice(1)
|
||||
isAr = true
|
||||
}
|
||||
|
||||
if (digits.length < 6 || digits.length > 10) return raw
|
||||
|
||||
const local = groupArNational(digits)
|
||||
if (!isAr) return local
|
||||
return isMobile ? `+54 9 ${local}` : `+54 ${local}`
|
||||
}
|
||||
|
||||
function groupArNational(digits: string): string {
|
||||
if (digits.length === 10) {
|
||||
// 11 es el único área de 2 dígitos (Gran Buenos Aires); el resto se
|
||||
// agrupa 4-2-4, que es el patrón de las áreas de 4 dígitos.
|
||||
return digits.startsWith('11')
|
||||
? `${digits.slice(0, 2)} ${digits.slice(2, 6)}-${digits.slice(6)}`
|
||||
: `${digits.slice(0, 4)} ${digits.slice(4, 6)}-${digits.slice(6)}`
|
||||
}
|
||||
if (digits.length === 9) return `${digits.slice(0, 3)} ${digits.slice(3, 5)}-${digits.slice(5)}`
|
||||
if (digits.length <= 8) return `${digits.slice(0, 4)} ${digits.slice(4)}`
|
||||
return digits
|
||||
}
|
||||
|
||||
// El vencimiento se cuenta como frase ("Vence el día 10 de cada mes") en vez
|
||||
|
||||
Reference in New Issue
Block a user