feat: agregar design system completo con 2 temas (Industrial + Moderno)
- 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)
This commit is contained in:
458
docs/design/design-system/components/buttons.html
Normal file
458
docs/design/design-system/components/buttons.html
Normal file
@@ -0,0 +1,458 @@
|
||||
<!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 — Buttons</title>
|
||||
<link rel="stylesheet" href="../tokens/tokens.css">
|
||||
<style>
|
||||
/* ====== Page Layout ====== */
|
||||
* { 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);
|
||||
}
|
||||
|
||||
.component-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-4);
|
||||
align-items: center;
|
||||
margin-bottom: var(--space-6);
|
||||
}
|
||||
|
||||
.component-row.vertical {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.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);
|
||||
}
|
||||
|
||||
/* ====== Button Base ====== */
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: var(--space-2);
|
||||
padding: var(--space-3) var(--space-6);
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-body);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
line-height: 1;
|
||||
border: 2px solid transparent;
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
transition: var(--transition-fast);
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.btn:focus-visible {
|
||||
outline: none;
|
||||
box-shadow: var(--shadow-focus);
|
||||
}
|
||||
|
||||
.btn:active {
|
||||
transform: scale(0.97);
|
||||
}
|
||||
|
||||
.btn:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
/* ====== Sizes ====== */
|
||||
.btn-sm {
|
||||
padding: var(--space-2) var(--space-4);
|
||||
font-size: var(--text-body-sm);
|
||||
}
|
||||
|
||||
.btn-lg {
|
||||
padding: var(--space-4) var(--space-8);
|
||||
font-size: var(--text-body-lg);
|
||||
}
|
||||
|
||||
.btn-xl {
|
||||
padding: var(--space-5) var(--space-10);
|
||||
font-size: var(--text-h5);
|
||||
}
|
||||
|
||||
/* ====== Primary ====== */
|
||||
.btn-primary {
|
||||
background: var(--btn-primary-bg);
|
||||
color: var(--btn-primary-text);
|
||||
border-color: var(--btn-primary-border);
|
||||
}
|
||||
|
||||
.btn-primary:hover:not(:disabled) {
|
||||
background: var(--btn-primary-bg-hover);
|
||||
}
|
||||
|
||||
.btn-primary:active:not(:disabled) {
|
||||
background: var(--btn-primary-bg-active);
|
||||
}
|
||||
|
||||
/* Industrial clip-path on primary buttons */
|
||||
[data-theme="industrial"] .btn-primary {
|
||||
clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
/* ====== Secondary ====== */
|
||||
.btn-secondary {
|
||||
background: var(--btn-secondary-bg);
|
||||
color: var(--btn-secondary-text);
|
||||
border-color: var(--btn-secondary-border);
|
||||
}
|
||||
|
||||
.btn-secondary:hover:not(:disabled) {
|
||||
background: var(--btn-secondary-bg-hover);
|
||||
}
|
||||
|
||||
/* ====== Danger ====== */
|
||||
.btn-danger {
|
||||
background: var(--btn-danger-bg);
|
||||
color: var(--btn-danger-text);
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.btn-danger:hover:not(:disabled) {
|
||||
background: var(--color-error-dark);
|
||||
}
|
||||
|
||||
[data-theme="industrial"] .btn-danger {
|
||||
clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
/* ====== Ghost ====== */
|
||||
.btn-ghost {
|
||||
background: var(--btn-ghost-bg);
|
||||
color: var(--btn-ghost-text);
|
||||
border-color: var(--btn-ghost-border);
|
||||
}
|
||||
|
||||
.btn-ghost:hover:not(:disabled) {
|
||||
background: var(--color-surface-2);
|
||||
}
|
||||
|
||||
/* ====== Icon Button ====== */
|
||||
.btn-icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
padding: 0;
|
||||
border: 1px solid var(--color-border);
|
||||
background: var(--color-bg-elevated);
|
||||
color: var(--color-text-secondary);
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
transition: var(--transition-fast);
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.btn-icon:hover:not(:disabled) {
|
||||
background: var(--color-primary-muted);
|
||||
color: var(--color-primary);
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.btn-icon:focus-visible {
|
||||
outline: none;
|
||||
box-shadow: var(--shadow-focus);
|
||||
}
|
||||
|
||||
.btn-icon.btn-icon-sm {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.btn-icon.btn-icon-lg {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
/* ====== Button Group ====== */
|
||||
.btn-group {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.btn-group .btn {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.btn-group .btn:first-child {
|
||||
border-radius: var(--radius-md) 0 0 var(--radius-md);
|
||||
}
|
||||
|
||||
.btn-group .btn:last-child {
|
||||
border-radius: 0 var(--radius-md) var(--radius-md) 0;
|
||||
}
|
||||
|
||||
.btn-group .btn + .btn {
|
||||
margin-left: -2px;
|
||||
}
|
||||
|
||||
/* ====== Loading State ====== */
|
||||
.btn-loading {
|
||||
position: relative;
|
||||
color: transparent !important;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.btn-loading::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border: 2px solid currentColor;
|
||||
border-right-color: transparent;
|
||||
border-radius: var(--radius-full);
|
||||
animation: spin 0.6s linear infinite;
|
||||
}
|
||||
|
||||
.btn-primary.btn-loading::after {
|
||||
border-color: var(--btn-primary-text);
|
||||
border-right-color: transparent;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
/* ====== Full Width ====== */
|
||||
.btn-block {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Theme Switcher -->
|
||||
<div class="theme-switcher">
|
||||
<button class="active" onclick="setTheme('industrial')">Industrial Robusto</button>
|
||||
<button onclick="setTheme('modern')">Tecnico Moderno</button>
|
||||
</div>
|
||||
|
||||
<h1>Buttons</h1>
|
||||
<p class="subtitle">Componentes de boton para Nexus Autoparts POS. Todos los estilos, tamanos y estados.</p>
|
||||
|
||||
<!-- Primary Buttons -->
|
||||
<section>
|
||||
<h2>Primary Button</h2>
|
||||
<p class="label">Accion principal — confirmar venta, agregar producto, guardar</p>
|
||||
<div class="component-row">
|
||||
<button class="btn btn-primary btn-sm">Pequeno</button>
|
||||
<button class="btn btn-primary">Normal</button>
|
||||
<button class="btn btn-primary btn-lg">Grande</button>
|
||||
<button class="btn btn-primary btn-xl">Extra Grande</button>
|
||||
</div>
|
||||
<div class="component-row">
|
||||
<button class="btn btn-primary" disabled>Deshabilitado</button>
|
||||
<button class="btn btn-primary btn-loading">Cargando</button>
|
||||
</div>
|
||||
<div class="component-row">
|
||||
<button class="btn btn-primary btn-block">Boton Full Width — Confirmar Venta</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Secondary Buttons -->
|
||||
<section>
|
||||
<h2>Secondary Button</h2>
|
||||
<p class="label">Accion secundaria — cancelar, ver detalles, filtrar</p>
|
||||
<div class="component-row">
|
||||
<button class="btn btn-secondary btn-sm">Pequeno</button>
|
||||
<button class="btn btn-secondary">Normal</button>
|
||||
<button class="btn btn-secondary btn-lg">Grande</button>
|
||||
</div>
|
||||
<div class="component-row">
|
||||
<button class="btn btn-secondary" disabled>Deshabilitado</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Danger Buttons -->
|
||||
<section>
|
||||
<h2>Danger Button</h2>
|
||||
<p class="label">Accion destructiva — eliminar, cancelar venta, borrar cliente</p>
|
||||
<div class="component-row">
|
||||
<button class="btn btn-danger btn-sm">Eliminar</button>
|
||||
<button class="btn btn-danger">Cancelar Venta</button>
|
||||
<button class="btn btn-danger btn-lg">Borrar Inventario</button>
|
||||
</div>
|
||||
<div class="component-row">
|
||||
<button class="btn btn-danger" disabled>Deshabilitado</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Ghost Buttons -->
|
||||
<section>
|
||||
<h2>Ghost Button</h2>
|
||||
<p class="label">Accion terciaria — enlaces, acciones sutiles, navegacion</p>
|
||||
<div class="component-row">
|
||||
<button class="btn btn-ghost btn-sm">Pequeno</button>
|
||||
<button class="btn btn-ghost">Normal</button>
|
||||
<button class="btn btn-ghost btn-lg">Grande</button>
|
||||
</div>
|
||||
<div class="component-row">
|
||||
<button class="btn btn-ghost" disabled>Deshabilitado</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Icon Buttons -->
|
||||
<section>
|
||||
<h2>Icon Button</h2>
|
||||
<p class="label">Acciones con icono — editar, eliminar, configuracion, carrito</p>
|
||||
<div class="component-row">
|
||||
<button class="btn-icon btn-icon-sm" title="Editar">✎</button>
|
||||
<button class="btn-icon" title="Eliminar">✕</button>
|
||||
<button class="btn-icon btn-icon-lg" title="Carrito">🛒</button>
|
||||
<button class="btn-icon" title="Configuracion">⚙</button>
|
||||
<button class="btn-icon" title="Buscar">🔍</button>
|
||||
<button class="btn-icon" title="Imprimir">🖨</button>
|
||||
</div>
|
||||
<div class="component-row">
|
||||
<button class="btn-icon" disabled title="Deshabilitado">✕</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Button with Icon + Text -->
|
||||
<section>
|
||||
<h2>Button con Icono + Texto</h2>
|
||||
<p class="label">Combinacion de icono y texto para acciones comunes en POS</p>
|
||||
<div class="component-row">
|
||||
<button class="btn btn-primary"><span>✚</span> Agregar Producto</button>
|
||||
<button class="btn btn-secondary"><span>🔍</span> Buscar Parte</button>
|
||||
<button class="btn btn-danger"><span>🗑</span> Eliminar</button>
|
||||
<button class="btn btn-ghost"><span>🖨</span> Imprimir Ticket</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Button Group -->
|
||||
<section>
|
||||
<h2>Button Group</h2>
|
||||
<p class="label">Grupo de botones para acciones relacionadas — vistas, filtros</p>
|
||||
<div class="component-row">
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-secondary">Lista</button>
|
||||
<button class="btn btn-primary">Grid</button>
|
||||
<button class="btn btn-secondary">Tabla</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-row">
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-ghost btn-sm">Hoy</button>
|
||||
<button class="btn btn-ghost btn-sm">Semana</button>
|
||||
<button class="btn btn-ghost btn-sm">Mes</button>
|
||||
<button class="btn btn-ghost btn-sm">Ano</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Practical POS Examples -->
|
||||
<section>
|
||||
<h2>Ejemplos POS</h2>
|
||||
<p class="label">Combinaciones reales de la interfaz del punto de venta</p>
|
||||
<div class="component-row" style="background: var(--color-bg-elevated); padding: var(--space-6); border-radius: var(--radius-lg); border: 1px solid var(--color-border); width: 100%;">
|
||||
<div style="display: flex; gap: var(--space-3); width: 100%; justify-content: flex-end;">
|
||||
<button class="btn btn-ghost">Cancelar</button>
|
||||
<button class="btn btn-secondary">Guardar Borrador</button>
|
||||
<button class="btn btn-primary btn-lg">Cobrar $1,250.00</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="component-row" style="background: var(--color-bg-elevated); padding: var(--space-6); border-radius: var(--radius-lg); border: 1px solid var(--color-border); width: 100%;">
|
||||
<div style="display: flex; gap: var(--space-3); width: 100%; align-items: center;">
|
||||
<button class="btn btn-primary"><span>✚</span> Nueva Venta</button>
|
||||
<button class="btn btn-secondary"><span>🔍</span> Buscar Cliente</button>
|
||||
<div style="flex: 1;"></div>
|
||||
<button class="btn-icon" title="Filtros">☰</button>
|
||||
<button class="btn-icon" title="Exportar">📦</button>
|
||||
</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.toLowerCase().includes(theme === 'industrial' ? 'industrial' : 'tecnico'));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user