- Tokens CSS con variables para ambos temas (dark/light) - 21 componentes reutilizables (buttons, cards, tables, modals, etc.) - 10 pantallas POS (login, catálogo, POS, inventario, clientes, facturación, contabilidad, dashboard, configuración, reportes) - Preview interactivo con selector de tema - Generado por el equipo de Hugo (Milo-UX, Iris-UI, Zara-Frontend)
316 lines
12 KiB
HTML
316 lines
12 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="es" data-theme="industrial">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Nexus Autoparts — Tooltips & Popovers</title>
|
|
<link rel="stylesheet" href="../tokens/tokens.css">
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body { font-family: var(--font-body); background: var(--color-bg-base); color: var(--color-text-primary); padding: var(--space-8); transition: var(--transition-normal); }
|
|
.theme-switcher { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; gap: var(--space-2); padding: var(--space-3) var(--space-4); background: var(--color-bg-elevated); border-bottom: 1px solid var(--color-border); margin: calc(-1 * var(--space-8)); margin-bottom: var(--space-8); }
|
|
.theme-switcher button { padding: var(--space-2) var(--space-4); border: 1px solid var(--color-border); background: var(--color-bg-base); color: var(--color-text-primary); border-radius: var(--radius-md); cursor: pointer; font-family: var(--font-body); font-size: var(--text-body-sm); transition: var(--transition-fast); }
|
|
.theme-switcher button.active { background: var(--color-primary); color: var(--color-text-inverse); border-color: var(--color-primary); }
|
|
h1 { font-family: var(--font-heading); font-size: var(--text-h2); font-weight: var(--heading-weight-primary); margin-bottom: var(--space-2); color: var(--color-text-accent); }
|
|
.subtitle { color: var(--color-text-muted); font-size: var(--text-body); margin-bottom: var(--space-8); }
|
|
section { margin-bottom: var(--space-10); }
|
|
section h2 { font-family: var(--font-heading); font-size: var(--text-h4); font-weight: var(--heading-weight-secondary); color: var(--color-text-secondary); margin-bottom: var(--space-4); padding-bottom: var(--space-2); border-bottom: 1px solid var(--color-border); }
|
|
.label { font-size: var(--text-caption); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: var(--tracking-widest); font-weight: var(--font-weight-semibold); margin-bottom: var(--space-2); }
|
|
.component-row { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: flex-start; margin-bottom: var(--space-6); }
|
|
|
|
/* ====== Tooltip ====== */
|
|
.tooltip-demo {
|
|
position: relative;
|
|
display: inline-flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
|
|
.tooltip-trigger {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: var(--space-3) var(--space-5);
|
|
background: var(--color-bg-elevated);
|
|
border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-md);
|
|
color: var(--color-text-secondary);
|
|
font-family: var(--font-body);
|
|
font-size: var(--text-body-sm);
|
|
cursor: help;
|
|
}
|
|
|
|
[data-theme="industrial"] .tooltip-trigger { border-radius: 0; }
|
|
|
|
.tooltip {
|
|
padding: var(--space-2) var(--space-3);
|
|
background: var(--color-bg-overlay);
|
|
border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-sm);
|
|
box-shadow: var(--shadow-md);
|
|
font-size: var(--text-caption);
|
|
color: var(--color-text-primary);
|
|
white-space: nowrap;
|
|
margin-top: var(--space-2);
|
|
}
|
|
|
|
[data-theme="industrial"] .tooltip {
|
|
border-radius: 0;
|
|
border-left: 2px solid var(--color-primary);
|
|
}
|
|
|
|
.tooltip-arrow {
|
|
text-align: center;
|
|
color: var(--color-border);
|
|
font-size: 10px;
|
|
line-height: 1;
|
|
}
|
|
|
|
/* ====== Popover ====== */
|
|
.popover {
|
|
background: var(--color-bg-elevated);
|
|
border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-md);
|
|
box-shadow: var(--shadow-lg);
|
|
padding: var(--space-4);
|
|
max-width: 300px;
|
|
margin-top: var(--space-2);
|
|
}
|
|
|
|
[data-theme="industrial"] .popover {
|
|
border-radius: 0;
|
|
clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
|
|
}
|
|
|
|
.popover-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: var(--space-3);
|
|
padding-bottom: var(--space-2);
|
|
border-bottom: 1px solid var(--color-border);
|
|
}
|
|
|
|
.popover-title {
|
|
font-weight: var(--font-weight-semibold);
|
|
font-size: var(--text-body-sm);
|
|
color: var(--color-text-primary);
|
|
}
|
|
|
|
.popover-close {
|
|
background: none;
|
|
border: none;
|
|
color: var(--color-text-muted);
|
|
cursor: pointer;
|
|
font-size: var(--text-body-sm);
|
|
}
|
|
|
|
.popover-body {
|
|
font-size: var(--text-body-sm);
|
|
color: var(--color-text-secondary);
|
|
line-height: var(--leading-body-sm);
|
|
}
|
|
|
|
.popover-footer {
|
|
margin-top: var(--space-3);
|
|
padding-top: var(--space-2);
|
|
border-top: 1px solid var(--color-border);
|
|
display: flex;
|
|
gap: var(--space-2);
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
.popover-btn {
|
|
padding: var(--space-1) var(--space-3);
|
|
font-family: var(--font-body);
|
|
font-size: var(--text-caption);
|
|
font-weight: var(--font-weight-semibold);
|
|
border-radius: var(--radius-sm);
|
|
cursor: pointer;
|
|
transition: var(--transition-fast);
|
|
border: 1px solid;
|
|
}
|
|
|
|
[data-theme="industrial"] .popover-btn { border-radius: 0; }
|
|
|
|
.popover-btn-primary {
|
|
background: var(--color-primary);
|
|
color: var(--color-text-inverse);
|
|
border-color: var(--color-primary);
|
|
}
|
|
|
|
.popover-btn-ghost {
|
|
background: transparent;
|
|
color: var(--color-text-muted);
|
|
border-color: var(--color-border);
|
|
}
|
|
|
|
/* ====== Info tooltip (icon) ====== */
|
|
.info-icon {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 18px;
|
|
height: 18px;
|
|
border-radius: var(--radius-full);
|
|
background: var(--color-primary-muted);
|
|
color: var(--color-primary);
|
|
font-size: 11px;
|
|
font-weight: var(--font-weight-bold);
|
|
cursor: help;
|
|
}
|
|
|
|
/* Product info popover */
|
|
.product-info-row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: var(--space-1) 0;
|
|
font-size: var(--text-caption);
|
|
}
|
|
|
|
.product-info-label {
|
|
color: var(--color-text-muted);
|
|
}
|
|
|
|
.product-info-value {
|
|
color: var(--color-text-primary);
|
|
font-weight: var(--font-weight-semibold);
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="theme-switcher">
|
|
<button class="active" onclick="setTheme('industrial')">🔧 Industrial</button>
|
|
<button onclick="setTheme('modern')">⚡ Moderno</button>
|
|
</div>
|
|
|
|
<h1>Tooltips & Popovers</h1>
|
|
<p class="subtitle">Tooltips informativos y popovers interactivos del sistema POS</p>
|
|
|
|
<!-- Basic Tooltips -->
|
|
<section>
|
|
<h2>Tooltips</h2>
|
|
<div class="label">Información rápida al pasar el cursor</div>
|
|
|
|
<div class="component-row">
|
|
<div class="tooltip-demo">
|
|
<div class="tooltip-trigger">🛒 Agregar al carrito</div>
|
|
<div class="tooltip-arrow">▲</div>
|
|
<div class="tooltip">Agrega este producto a la venta actual</div>
|
|
</div>
|
|
|
|
<div class="tooltip-demo">
|
|
<div class="tooltip-trigger">📦 Stock: 12</div>
|
|
<div class="tooltip-arrow">▲</div>
|
|
<div class="tooltip">Unidades disponibles en bodega principal</div>
|
|
</div>
|
|
|
|
<div class="tooltip-demo">
|
|
<div class="tooltip-trigger">🏷️ OEM: 04465-33450</div>
|
|
<div class="tooltip-arrow">▲</div>
|
|
<div class="tooltip">Número de parte original del fabricante</div>
|
|
</div>
|
|
|
|
<div class="tooltip-demo">
|
|
<div class="tooltip-trigger">⚠ Bajo stock</div>
|
|
<div class="tooltip-arrow">▲</div>
|
|
<div class="tooltip">Quedan menos de 5 unidades. Reorden sugerido.</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Info Icon Tooltips -->
|
|
<section>
|
|
<h2>Info Icons</h2>
|
|
<div class="label">Iconos de ayuda con tooltip</div>
|
|
|
|
<div style="display: flex; flex-direction: column; gap: var(--space-4); max-width: 400px;">
|
|
<div style="display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-body-sm);">
|
|
<span>Precio mayoreo</span>
|
|
<span class="info-icon">?</span>
|
|
<span style="font-size: var(--text-caption); color: var(--color-text-muted);">← Precio para compras de 10+ unidades</span>
|
|
</div>
|
|
<div style="display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-body-sm);">
|
|
<span>Margen de ganancia</span>
|
|
<span class="info-icon">?</span>
|
|
<span style="font-size: var(--text-caption); color: var(--color-text-muted);">← Diferencia entre costo y precio de venta</span>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Popovers -->
|
|
<section>
|
|
<h2>Popovers</h2>
|
|
<div class="label">Información detallada con acciones</div>
|
|
|
|
<div class="component-row">
|
|
<!-- Product Info Popover -->
|
|
<div>
|
|
<div class="tooltip-trigger" style="margin-bottom: var(--space-2);">Ver info del producto</div>
|
|
<div class="popover">
|
|
<div class="popover-header">
|
|
<span class="popover-title">Pastillas Brembo P50 042</span>
|
|
<button class="popover-close">✕</button>
|
|
</div>
|
|
<div class="popover-body">
|
|
<div class="product-info-row">
|
|
<span class="product-info-label">SKU</span>
|
|
<span class="product-info-value">BRM-P50042</span>
|
|
</div>
|
|
<div class="product-info-row">
|
|
<span class="product-info-label">OEM</span>
|
|
<span class="product-info-value">04465-33450</span>
|
|
</div>
|
|
<div class="product-info-row">
|
|
<span class="product-info-label">Precio</span>
|
|
<span class="product-info-value" style="color: var(--color-primary);">$1,250.00</span>
|
|
</div>
|
|
<div class="product-info-row">
|
|
<span class="product-info-label">Stock</span>
|
|
<span class="product-info-value" style="color: var(--color-success);">12 uds</span>
|
|
</div>
|
|
<div class="product-info-row">
|
|
<span class="product-info-label">Ubicación</span>
|
|
<span class="product-info-value">Estante A-14</span>
|
|
</div>
|
|
</div>
|
|
<div class="popover-footer">
|
|
<button class="popover-btn popover-btn-ghost">Cerrar</button>
|
|
<button class="popover-btn popover-btn-primary">Agregar a venta</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Confirm Popover -->
|
|
<div>
|
|
<div class="tooltip-trigger" style="margin-bottom: var(--space-2); color: var(--color-error);">🗑️ Eliminar producto</div>
|
|
<div class="popover">
|
|
<div class="popover-header">
|
|
<span class="popover-title">Confirmar eliminación</span>
|
|
<button class="popover-close">✕</button>
|
|
</div>
|
|
<div class="popover-body">
|
|
¿Estás seguro de eliminar este producto? Esta acción no se puede deshacer.
|
|
</div>
|
|
<div class="popover-footer">
|
|
<button class="popover-btn popover-btn-ghost">Cancelar</button>
|
|
<button class="popover-btn" style="background: var(--color-error); color: white; border-color: var(--color-error);">Eliminar</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<script>
|
|
function setTheme(theme) {
|
|
document.documentElement.setAttribute('data-theme', theme);
|
|
document.querySelectorAll('.theme-switcher button').forEach(btn => {
|
|
btn.classList.toggle('active', btn.textContent.includes(theme === 'industrial' ? 'Industrial' : 'Moderno'));
|
|
});
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|