Download src/static/css/components.css from anaselamr/yaz: direct link, hf CLI and curl.
- Browser
- Download file 40.9 kB
-
https://huggingface.co/spaces/anaselamr/yaz/resolve/main/src/static/css/components.css
- Command line
-
hf download hf://spaces/anaselamr/yaz/src/static/css/components.css
-
curl -L -o components.css https://huggingface.co/spaces/anaselamr/yaz/resolve/main/src/static/css/components.css
40.9 kB
/* ════════════════════════════════════════════════════════════════
YAZ Component Library — y-* Design System v5
════════════════════════════════════════════════════════════════
Single source of truth for all reusable UI components.
All values derive from tokens.css.
Prefix: y- (universal)
Naming: BEM-inspired — y-block__element--modifier
Components:
1. y-btn — Button system (primary, secondary, ghost, danger)
2. y-input — Text input, textarea, select (+ y-field, y-label)
3. y-card — Surface container
4. y-stat — Stat/metric display card
5. y-badge — Status chip / label
6. y-tabs — Horizontal tab bar
7. y-modal — Dialog overlay
8. y-toast — Notification snackbar
9. y-skeleton — Shimmer loading placeholder
10. y-avatar — User avatar
11. y-empty — Empty state
12. y-divider — Horizontal separator
13. y-progress — Progress bar
14. y-chip — Selectable filter chip
15. y-table — Data table
════════════════════════════════════════════════════════════════ */
/* ── 1. y-btn — Button System ────────────────────────────────── */
.y-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.375rem;
height: var(--btn-height, 36px);
padding: 0 1rem;
border-radius: var(--btn-radius, var(--radius-md));
font-size: var(--btn-font-size, var(--text-sm));
font-weight: var(--btn-font-weight, var(--weight-medium));
font-family: var(--font-sans);
cursor: pointer;
border: 1px solid transparent;
transition:
background var(--duration-fast) var(--ease-default),
border-color var(--duration-fast) var(--ease-default),
color var(--duration-fast) var(--ease-default),
transform var(--duration-fast) var(--ease-spring),
box-shadow var(--duration-fast) var(--ease-default),
opacity var(--duration-fast) var(--ease-default);
white-space: nowrap;
text-decoration: none;
user-select: none;
}
.y-btn:focus-visible {
outline: var(--focus-ring);
outline-offset: var(--focus-ring-offset);
}
.y-btn:active {
transform: scale(0.97) !important;
transition-duration: var(--duration-instant) !important;
}
.y-btn:disabled,
.y-btn[aria-disabled="true"] {
opacity: 0.45;
cursor: not-allowed;
pointer-events: none;
}
/* Variants */
.y-btn--primary {
background: var(--primary);
color: var(--text-inverse);
border-color: var(--primary);
}
.y-btn--primary:hover {
background: var(--primary-hover);
border-color: var(--primary-hover);
transform: translateY(var(--hover-lift));
box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
}
.y-btn--secondary {
background: var(--surface);
color: var(--text);
border-color: var(--border);
}
.y-btn--secondary:hover {
border-color: var(--border-strong);
background: var(--surface-hover);
transform: translateY(var(--hover-lift));
box-shadow: var(--shadow-sm);
}
.y-btn--ghost {
background: transparent;
color: var(--text-muted);
border-color: transparent;
}
.y-btn--ghost:hover {
background: var(--surface-hover);
color: var(--text);
transform: translateY(var(--hover-lift));
}
.y-btn--danger {
background: var(--error);
color: white;
border-color: var(--error);
}
.y-btn--danger:hover {
background: var(--c-error-600);
transform: translateY(var(--hover-lift));
box-shadow: 0 4px 10px color-mix(in srgb, var(--error) 25%, transparent);
}
.y-btn--success {
background: var(--success);
color: white;
border-color: var(--success);
}
.y-btn--success:hover {
background: var(--c-success-600);
transform: translateY(var(--hover-lift));
}
/* Sizes */
.y-btn--sm {
height: var(--btn-height-sm, 28px);
padding: 0 0.625rem;
font-size: var(--text-xs);
}
.y-btn--lg {
height: var(--btn-height-lg, 44px);
padding: 0 1.375rem;
font-size: var(--text-md);
}
/* Icon button */
.y-btn--icon {
padding: 0;
width: var(--btn-height, 36px);
flex-shrink: 0;
}
.y-btn--icon.y-btn--sm { width: var(--btn-height-sm, 28px); }
.y-btn--icon.y-btn--lg { width: var(--btn-height-lg, 44px); }
.y-btn--icon:hover { transform: scale(1.05) !important; }
/* Loading state */
.y-btn.is-loading {
pointer-events: none;
opacity: 0.75;
position: relative;
}
.y-btn.is-loading > :not(.y-btn__spinner) { visibility: hidden; }
.y-btn__spinner {
position: absolute;
width: 1rem; height: 1rem;
border: 2px solid rgba(255,255,255,0.35);
border-top-color: currentColor;
border-radius: 50%;
animation: y-spin 0.7s linear infinite;
}
@keyframes y-spin { to { transform: rotate(360deg); } }
/* Icon sizing within buttons */
.y-btn i[data-lucide],
.y-btn svg {
width: 1rem;
height: 1rem;
flex-shrink: 0;
pointer-events: none;
}
.y-btn--sm i[data-lucide],
.y-btn--sm svg { width: 0.875rem; height: 0.875rem; }
.y-btn--lg i[data-lucide],
.y-btn--lg svg { width: 1.125rem; height: 1.125rem; }
/* ── 2. y-input — Form Controls ──────────────────────────────── */
.y-field {
display: flex;
flex-direction: column;
gap: var(--space-1);
}
.y-label {
font-size: var(--text-xs);
font-weight: var(--weight-semibold);
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: var(--tracking-wider);
}
.y-label--inline {
text-transform: none;
letter-spacing: 0;
font-size: var(--text-sm);
font-weight: var(--weight-medium);
color: var(--text);
}
.y-input {
width: 100%;
padding: 0 0.75rem;
border: 1px solid var(--input-border, var(--border));
border-radius: var(--input-radius, var(--radius-md));
font-size: var(--input-font-size, var(--text-base));
font-family: var(--font-sans);
background: var(--input-bg, var(--surface));
color: var(--text);
height: var(--input-height, 36px);
transition: border-color var(--duration-fast) var(--ease-default),
box-shadow var(--duration-fast) var(--ease-default);
-webkit-appearance: none;
appearance: none;
}
.y-input:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px var(--focus-glow, rgba(92, 107, 192, 0.15));
}
.y-input:focus-visible {
outline: var(--focus-ring);
outline-offset: 0;
box-shadow: 0 0 0 3px var(--focus-glow, rgba(92, 107, 192, 0.15));
}
.y-input:disabled {
opacity: 0.55;
cursor: not-allowed;
background: var(--surface-hover);
}
.y-input::placeholder { color: var(--text-light); }
.y-input.is-error { border-color: var(--error); }
.y-input.is-error:focus { box-shadow: 0 0 0 3px rgba(199, 75, 75, 0.15); }
.y-input.is-success { border-color: var(--success); }
textarea.y-input { height: auto; min-height: 80px; padding: 0.5rem 0.75rem; resize: vertical; }
select.y-input { cursor: pointer; padding-right: 2rem; }
/* ── y-select — Standalone select element (not wrapped in y-input) ── */
.y-select {
display: inline-flex;
height: var(--input-height, 36px);
padding: 0.375rem 2rem 0.375rem 0.75rem;
border-radius: var(--radius-md, 0.5rem);
border: 1px solid var(--border);
background: var(--surface);
color: var(--text);
font-size: var(--text-sm, 0.875rem);
font-weight: var(--weight-normal, 400);
cursor: pointer;
appearance: none;
-webkit-appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.625rem center;
transition: border-color var(--duration-fast, 0.12s), box-shadow var(--duration-fast, 0.12s);
outline: none;
}
.y-select:focus {
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 92 107 192) / 0.15);
}
.y-select:focus-visible {
outline: var(--focus-ring);
outline-offset: 0;
}
.y-select:disabled { opacity: 0.5; cursor: not-allowed; }
.y-select--sm {
height: 28px;
padding: 0.25rem 1.75rem 0.25rem 0.625rem;
font-size: var(--text-xs, 0.75rem);
border-radius: var(--radius-sm, 0.375rem);
}
/* Field hint / error message */
.y-field-hint {
font-size: var(--text-xs);
color: var(--text-muted);
margin-top: var(--space-1);
line-height: var(--leading-normal);
}
.y-field-hint.is-error { color: var(--error); }
/* ── 3. y-card — Surface Container ───────────────────────────── */
.y-card {
background: var(--card-bg, var(--surface));
border: 1px solid var(--card-border, var(--border-subtle));
border-radius: var(--card-radius, var(--radius-lg));
padding: var(--card-padding, var(--space-5));
}
.y-card--hoverable {
cursor: pointer;
transition: box-shadow var(--duration-normal) var(--ease-spring),
border-color var(--duration-fast) var(--ease-default),
transform var(--duration-normal) var(--ease-spring);
}
.y-card--hoverable:hover {
border-color: var(--primary);
box-shadow: var(--shadow-lg);
transform: translateY(-2px);
}
.y-card--hoverable:focus-visible {
outline: var(--focus-ring);
outline-offset: 2px;
border-color: var(--primary);
}
.y-card__header {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
margin-bottom: var(--space-4);
}
.y-card__title {
font-size: var(--text-md);
font-weight: var(--weight-semibold);
color: var(--text);
margin: 0;
line-height: var(--leading-tight);
}
.y-card__body { flex: 1; }
.y-card__footer {
margin-top: var(--space-4);
padding-top: var(--space-4);
border-top: 1px solid var(--border-subtle);
display: flex;
align-items: center;
justify-content: flex-end;
gap: var(--space-2);
}
/* ── 4. y-stat — Metric Display ──────────────────────────────── */
.y-stat {
display: flex;
flex-direction: column;
gap: var(--space-2);
border-top: 3px solid var(--stat-accent, var(--border));
}
.y-stat__header {
display: flex;
align-items: center;
gap: var(--space-1-5);
}
.y-stat__icon {
display: flex;
align-items: center;
flex-shrink: 0;
color: var(--stat-accent, var(--text-muted));
}
.y-stat__icon i[data-lucide],
.y-stat__icon svg { width: var(--icon-sm); height: var(--icon-sm); }
.y-stat__label {
font-size: var(--text-xs);
font-weight: var(--weight-semibold);
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: var(--tracking-wider);
}
.y-stat__value {
font-size: var(--text-2xl);
font-weight: 800;
line-height: 1;
color: var(--text);
font-variant-numeric: tabular-nums;
letter-spacing: -0.02em;
}
.y-stat__trend {
font-size: var(--text-xs);
font-weight: var(--weight-medium);
display: flex;
align-items: center;
gap: var(--space-1);
}
.y-stat__trend--up { color: var(--success); }
.y-stat__trend--down { color: var(--error); }
.y-stat__trend--flat { color: var(--text-muted); }
/* ── 5. y-badge — Status Chip / Label ───────────────────────── */
.y-badge {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: var(--badge-padding, var(--space-0-5) var(--space-2));
border-radius: var(--badge-radius, var(--radius-full));
font-size: var(--badge-font-size, var(--text-xs));
font-weight: var(--badge-font-weight, var(--weight-medium));
line-height: 1;
white-space: nowrap;
border: 1px solid transparent;
}
.y-badge i[data-lucide],
.y-badge svg { width: 0.75rem; height: 0.75rem; flex-shrink: 0; }
/* Semantic variants */
.y-badge--success {
background: var(--success-subtle);
color: var(--c-success-700);
border-color: var(--c-success-100);
}
.y-badge--warning {
background: var(--warning-subtle);
color: var(--c-warning-700);
border-color: var(--c-warning-100);
}
.y-badge--error {
background: var(--error-subtle);
color: var(--c-error-700);
border-color: var(--c-error-100);
}
.y-badge--neutral {
background: var(--surface-hover);
color: var(--text-muted);
border-color: var(--border);
}
.y-badge--primary {
background: var(--primary-subtle);
color: var(--primary-text);
border-color: var(--c-primary-100);
}
/* Dark mode overrides */
[data-theme="dark"] .y-badge--success {
background: rgba(56, 161, 105, 0.15);
color: var(--c-success-400);
border-color: rgba(56, 161, 105, 0.25);
}
[data-theme="dark"] .y-badge--warning {
background: rgba(212, 150, 48, 0.15);
color: var(--c-warning-400);
border-color: rgba(212, 150, 48, 0.25);
}
[data-theme="dark"] .y-badge--error {
background: rgba(199, 75, 75, 0.15);
color: var(--c-error-400);
border-color: rgba(199, 75, 75, 0.25);
}
[data-theme="dark"] .y-badge--primary {
background: rgba(92, 107, 192, 0.15);
color: var(--c-primary-300);
border-color: rgba(92, 107, 192, 0.25);
}
/* Dot indicator shorthand */
.y-badge--dot::before {
content: '';
width: 6px;
height: 6px;
border-radius: 50%;
background: currentColor;
flex-shrink: 0;
}
/* ── 6. y-tabs — Horizontal Tab Bar ──────────────────────────── */
.y-tabs {
display: flex;
gap: 0;
border-bottom: 1px solid var(--border);
padding: 0;
overflow-x: auto;
scrollbar-width: none;
}
.y-tabs::-webkit-scrollbar { display: none; }
.y-tab {
position: relative;
padding: 0.625rem 1rem;
font-size: var(--text-sm);
font-weight: var(--weight-medium);
color: var(--text-muted);
background: none;
border: none;
cursor: pointer;
white-space: nowrap;
transition:
color var(--duration-fast) var(--ease-default),
opacity var(--duration-fast) var(--ease-default);
border-radius: 0;
user-select: none;
text-decoration: none;
}
.y-tab:hover { color: var(--text); }
.y-tab.is-active {
color: var(--text);
font-weight: var(--weight-semibold);
}
.y-tab.is-active::after {
content: '';
position: absolute;
bottom: -1px;
left: 0.375rem;
right: 0.375rem;
height: 2.5px;
background: var(--primary);
border-radius: 2px 2px 0 0;
animation: y-tab-in var(--duration-normal) var(--ease-spring) both;
}
@keyframes y-tab-in {
from { transform: scaleX(0.4); opacity: 0; }
to { transform: scaleX(1); opacity: 1; }
}
.y-tab:focus-visible {
outline: var(--focus-ring);
outline-offset: var(--focus-ring-offset);
}
/* ── 7. y-modal — Dialog Overlay ─────────────────────────────── */
.y-overlay {
position: fixed;
inset: 0;
background: var(--overlay);
z-index: var(--z-overlay, 190);
opacity: 0;
visibility: hidden;
transition:
opacity var(--duration-normal) var(--ease-default),
visibility var(--duration-normal) var(--ease-default);
backdrop-filter: blur(2px);
-webkit-backdrop-filter: blur(2px);
}
.y-overlay.is-open { opacity: 1; visibility: visible; }
.y-modal {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -46%) scale(0.95);
width: min(560px, calc(100vw - 2rem));
max-height: calc(100dvh - 4rem);
background: var(--surface);
border-radius: var(--radius-xl);
box-shadow: var(--shadow-xl), 0 20px 60px rgba(0, 0, 0, 0.18);
z-index: var(--z-modal, 200);
display: flex;
flex-direction: column;
opacity: 0;
visibility: hidden;
transition:
opacity var(--duration-normal) var(--ease-default),
visibility var(--duration-normal) var(--ease-default),
transform var(--duration-slow) var(--ease-spring);
}
.y-modal.is-open {
opacity: 1;
visibility: visible;
transform: translate(-50%, -50%) scale(1);
}
.y-modal__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--space-4) var(--space-5);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.y-modal__title {
font-size: var(--text-md);
font-weight: var(--weight-semibold);
margin: 0;
color: var(--text);
}
.y-modal__body {
padding: var(--space-5);
overflow-y: auto;
flex: 1;
overscroll-behavior: contain;
}
.y-modal__body--centered {
text-align: center;
padding: var(--space-8) var(--space-5);
}
.y-modal__footer {
display: flex;
align-items: center;
justify-content: flex-end;
gap: var(--space-2);
padding: var(--space-3) var(--space-5);
border-top: 1px solid var(--border);
flex-shrink: 0;
}
.y-modal__footer--centered { justify-content: center; }
/* Sizes */
.y-modal--sm { width: min(400px, calc(100vw - 2rem)); }
.y-modal--lg { width: min(720px, calc(100vw - 2rem)); }
.y-modal--xl { width: min(900px, calc(100vw - 2rem)); }
/* ── 8. y-toast — Notification Snackbar ──────────────────────── */
.y-toast-container {
position: fixed;
bottom: calc(var(--bottomnav-h, 56px) + 1rem);
left: 50%;
transform: translateX(-50%);
z-index: var(--z-toast, 300);
display: flex;
flex-direction: column;
gap: var(--space-2);
pointer-events: none;
max-width: calc(100vw - 2rem);
width: max-content;
}
@media (min-width: 769px) {
.y-toast-container {
bottom: 1.5rem;
right: 1.5rem;
left: auto;
transform: none;
}
}
.y-toast {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-3) var(--space-4);
background: var(--c-neutral-900);
color: var(--c-neutral-50);
border-radius: var(--radius-lg);
font-size: var(--text-sm);
font-weight: var(--weight-medium);
box-shadow: var(--shadow-xl);
pointer-events: auto;
min-width: 220px;
animation: y-toast-in var(--duration-normal) var(--ease-spring);
}
[data-theme="dark"] .y-toast {
background: var(--c-neutral-100);
color: var(--c-neutral-900);
}
.y-toast--success { border-left: 3px solid var(--success); }
.y-toast--warning { border-left: 3px solid var(--warning); }
.y-toast--error { border-left: 3px solid var(--error); }
.y-toast__icon {
flex-shrink: 0;
display: flex;
align-items: center;
}
.y-toast__icon svg,
.y-toast__icon i[data-lucide] { width: var(--icon-sm); height: var(--icon-sm); }
.y-toast__close {
margin-left: auto;
background: none;
border: none;
cursor: pointer;
opacity: 0.6;
color: inherit;
padding: 0;
line-height: 1;
flex-shrink: 0;
}
.y-toast__close:hover { opacity: 1; }
@keyframes y-toast-in {
from { opacity: 0; transform: translateY(8px) scale(0.96); }
to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes y-toast-out {
to { opacity: 0; transform: translateY(4px) scale(0.96); }
}
.y-toast.is-leaving { animation: y-toast-out var(--duration-fast) var(--ease-in) forwards; }
/* ── 9. y-skeleton — Shimmer Loading ─────────────────────────── */
.y-skeleton {
position: relative;
overflow: hidden;
background: var(--surface-hover);
border-radius: var(--radius-md);
}
.y-skeleton::after {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(
90deg,
transparent 0%,
rgba(255, 255, 255, 0.08) 40%,
rgba(255, 255, 255, 0.12) 50%,
rgba(255, 255, 255, 0.08) 60%,
transparent 100%
);
background-size: 200% 100%;
animation: y-shimmer 1.6s ease-in-out infinite;
}
[data-theme="dark"] .y-skeleton::after {
background: linear-gradient(
90deg,
transparent 0%,
rgba(255, 255, 255, 0.04) 40%,
rgba(255, 255, 255, 0.07) 50%,
rgba(255, 255, 255, 0.04) 60%,
transparent 100%
);
background-size: 200% 100%;
}
@keyframes y-shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
/* Preset shapes */
.y-skeleton--text { height: 0.875rem; width: 75%; }
.y-skeleton--text-sm { height: 0.75rem; width: 55%; }
.y-skeleton--title { height: 1.25rem; width: 45%; border-radius: var(--radius-sm); }
.y-skeleton--circle { width: 2.5rem; height: 2.5rem; border-radius: var(--radius-full); }
.y-skeleton--rect { height: 44px; }
.y-skeleton--card { height: 80px; border-radius: var(--radius-lg); }
@media (prefers-reduced-motion: reduce) {
.y-skeleton::after { animation: none; }
}
/* ── 10. y-avatar — User Avatar ───────────────────────────────── */
.y-avatar {
width: 2rem;
height: 2rem;
border-radius: var(--radius-full);
background: var(--c-neutral-200);
color: var(--c-neutral-700);
display: flex;
align-items: center;
justify-content: center;
font-size: var(--text-xs);
font-weight: var(--weight-semibold);
flex-shrink: 0;
overflow: hidden;
user-select: none;
}
[data-theme="dark"] .y-avatar {
background: var(--c-neutral-700);
color: var(--c-neutral-200);
}
.y-avatar img { width: 100%; height: 100%; object-fit: cover; }
.y-avatar--sm { width: 1.5rem; height: 1.5rem; font-size: calc(var(--text-xs) - 1px); }
.y-avatar--lg { width: 2.5rem; height: 2.5rem; font-size: var(--text-sm); }
.y-avatar--xl { width: 3.5rem; height: 3.5rem; font-size: var(--text-md); }
/* Avatar stack */
.y-avatar-stack {
display: flex;
flex-direction: row-reverse;
}
.y-avatar-stack .y-avatar {
margin-left: -0.5rem;
border: 2px solid var(--bg);
}
.y-avatar-stack .y-avatar:last-child { margin-left: 0; }
/* ── 11. y-empty — Empty State ────────────────────────────────── */
.y-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: var(--space-12) var(--space-6);
color: var(--text-muted);
}
.y-empty__icon {
width: 3rem;
height: 3rem;
margin-bottom: var(--space-4);
opacity: 0.3;
display: flex;
align-items: center;
justify-content: center;
}
.y-empty__icon svg,
.y-empty__icon i[data-lucide] { width: 100%; height: 100%; }
.y-empty__title {
font-size: var(--text-md);
font-weight: var(--weight-semibold);
color: var(--text);
margin: 0 0 var(--space-2);
}
.y-empty__desc {
font-size: var(--text-sm);
color: var(--text-muted);
line-height: var(--leading-relaxed);
max-width: 360px;
margin: 0 0 var(--space-5);
}
/* ── 12. y-divider — Separator ────────────────────────────────── */
.y-divider {
height: 1px;
background: var(--border-subtle);
border: none;
margin: 0;
}
.y-divider--space { margin: var(--space-4) 0; }
.y-divider--strong { background: var(--border); }
/* Vertical divider */
.y-divider--vertical {
width: 1px;
height: auto;
align-self: stretch;
}
/* Vertical rule inline (use as <span class="y-vr"> in flex rows) */
.y-vr {
display: inline-block;
width: 1px;
height: 16px;
background: var(--text-light);
opacity: 0.3;
align-self: center;
flex-shrink: 0;
}
/* ── 13. y-progress — Progress Bar ───────────────────────────── */
.y-progress {
width: 100%;
height: 6px;
background: var(--surface-active);
border-radius: var(--radius-full);
overflow: hidden;
}
.y-progress__fill {
height: 100%;
background: var(--primary);
border-radius: var(--radius-full);
transition: width var(--duration-slow) var(--ease-out);
}
.y-progress__fill--success { background: var(--success); }
.y-progress__fill--warning { background: var(--warning); }
.y-progress__fill--error { background: var(--error); }
/* Indeterminate */
.y-progress--indeterminate .y-progress__fill {
width: 40% !important;
animation: y-progress-slide 1.4s ease-in-out infinite;
}
@keyframes y-progress-slide {
0% { transform: translateX(-100%); }
65% { transform: translateX(250%); }
100% { transform: translateX(250%); }
}
@media (prefers-reduced-motion: reduce) {
.y-progress--indeterminate .y-progress__fill { animation: none; }
}
/* ── 14. y-chip — Filter Chip ─────────────────────────────────── */
.y-chip {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
padding: var(--space-1) var(--space-3);
border-radius: var(--radius-full);
font-size: var(--text-sm);
font-weight: var(--weight-medium);
border: 1px solid var(--border);
background: var(--surface);
color: var(--text-secondary);
cursor: pointer;
user-select: none;
white-space: nowrap;
transition:
background var(--duration-fast) var(--ease-default),
border-color var(--duration-fast) var(--ease-default),
color var(--duration-fast) var(--ease-default);
text-decoration: none;
}
.y-chip:hover {
border-color: var(--border-strong);
color: var(--text);
}
.y-chip.is-active {
background: var(--text);
color: var(--bg);
border-color: var(--text);
}
.y-chip:focus-visible {
outline: var(--focus-ring);
outline-offset: var(--focus-ring-offset);
}
.y-chip svg,
.y-chip i[data-lucide] { width: 0.875rem; height: 0.875rem; flex-shrink: 0; }
/* ── 15. y-table — Data Table ─────────────────────────────────── */
.y-table-wrap,
.y-table-wrapper {
background: var(--surface);
border: 1px solid var(--border-subtle);
border-radius: var(--radius-lg);
overflow: hidden;
}
.y-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.y-table {
width: 100%;
border-collapse: collapse;
font-size: var(--text-sm);
}
.y-table thead th {
background: var(--surface-sunken);
padding: var(--space-2) var(--space-4);
text-align: left;
font-weight: var(--weight-semibold);
font-size: var(--text-xs);
text-transform: uppercase;
letter-spacing: var(--tracking-wide);
color: var(--text-muted);
border-bottom: 1px solid var(--border);
white-space: nowrap;
}
.y-table tbody td {
padding: var(--space-3) var(--space-4);
border-bottom: 1px solid var(--border-subtle);
color: var(--text);
vertical-align: middle;
}
.y-table tbody tr:last-child td { border-bottom: none; }
.y-table tbody tr:hover { background: var(--surface-hover); }
.y-table tbody tr.is-selected { background: var(--primary-subtle) !important; }
/* Column alignment helpers */
.y-table th.align-right,
.y-table td.align-right { text-align: right; }
.y-table th.align-center,
.y-table td.align-center { text-align: center; }
/* Compact table variant */
.y-table--compact tbody td { padding: var(--space-2) var(--space-3); }
.y-table--compact thead th { padding: var(--space-1-5) var(--space-3); }
/* ── Responsive helpers ───────────────────────────────────────── */
@media (max-width: 640px) {
.y-modal { width: calc(100vw - 1rem); border-radius: var(--radius-xl) var(--radius-xl) 0 0; top: auto; bottom: 0; transform: translateY(4px) scale(0.98); left: 0; }
.y-modal.is-open { transform: translateY(0) scale(1); }
.y-modal--sm,
.y-modal--lg,
.y-modal--xl { width: calc(100vw - 1rem); }
.y-tabs { border-bottom: none; }
}
@media (prefers-reduced-motion: reduce) {
.y-btn,
.y-card--hoverable,
.y-chip,
.y-tab {
transition: none !important;
transform: none !important;
animation: none !important;
}
.y-modal, .y-overlay { transition: none !important; }
.y-tab.is-active::after { animation: none; }
.y-progress--indeterminate .y-progress__fill { animation: none; }
}
/* ── 16. y-verdict — Clinical/Operational Decision Badge ─────── */
.y-verdict {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: var(--space-1) var(--space-3);
border-radius: var(--radius-md);
font-size: var(--text-xs);
font-weight: var(--weight-semibold);
border: 1px solid transparent;
letter-spacing: var(--tracking-wider);
text-transform: uppercase;
white-space: nowrap;
line-height: 1.4;
}
.y-verdict i[data-lucide],
.y-verdict svg { width: 0.75rem; height: 0.75rem; flex-shrink: 0; }
.y-verdict--go {
background: var(--verdict-go-bg);
color: var(--verdict-go-text);
border-color: var(--verdict-go-border);
}
.y-verdict--no-go {
background: var(--verdict-nogo-bg);
color: var(--verdict-nogo-text);
border-color: var(--verdict-nogo-border);
}
.y-verdict--optimize {
background: var(--verdict-optimize-bg);
color: var(--verdict-optimize-text);
border-color: var(--verdict-optimize-border);
}
.y-verdict--hold {
background: var(--verdict-hold-bg);
color: var(--verdict-hold-text);
border-color: var(--verdict-hold-border);
}
.y-verdict--pending {
background: var(--surface-hover);
color: var(--text-muted);
border-color: var(--border);
}
/* ── 17. y-event-badge — Event Type Chip ─────────────────────── */
/* Used in event logs, timelines, activity feeds */
.y-event-badge {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: 2px 8px;
border-radius: var(--radius-sm);
font-size: var(--text-xs);
font-weight: var(--weight-semibold);
text-transform: capitalize;
border: 1px solid transparent;
white-space: nowrap;
}
.y-event-badge--created,
.y-event-badge--completed {
background: var(--verdict-go-bg);
color: var(--verdict-go-text);
border-color: var(--verdict-go-border);
}
.y-event-badge--delayed {
background: var(--verdict-optimize-bg);
color: var(--verdict-optimize-text);
border-color: var(--verdict-optimize-border);
}
.y-event-badge--cancelled {
background: var(--error-subtle);
color: var(--c-error-700);
border-color: var(--c-error-100);
}
.y-event-badge--scheduled {
background: var(--primary-subtle);
color: var(--primary-text);
border-color: var(--c-primary-100);
}
.y-event-badge--default {
background: var(--surface-hover);
color: var(--text-muted);
border-color: var(--border);
}
/* Event card border accent (used on log entry cards) */
.y-event-card--created,
.y-event-card--completed { border-left: 3px solid var(--c-success-400) !important; }
.y-event-card--delayed { border-left: 3px solid var(--c-warning-400) !important; }
.y-event-card--cancelled { border-left: 3px solid var(--c-error-400) !important; }
.y-event-card--scheduled { border-left: 3px solid var(--primary) !important; }
.y-event-card--default { border-left: 3px solid var(--border) !important; }
[data-theme="dark"] .y-event-badge--created,
[data-theme="dark"] .y-event-badge--completed {
background: rgba(30, 111, 66, 0.14);
color: var(--c-success-400);
border-color: rgba(30, 111, 66, 0.25);
}
[data-theme="dark"] .y-event-badge--delayed {
background: rgba(212, 150, 48, 0.14);
color: var(--c-warning-400);
border-color: rgba(212, 150, 48, 0.25);
}
[data-theme="dark"] .y-event-badge--cancelled {
background: rgba(199, 75, 75, 0.14);
color: var(--c-error-400);
border-color: rgba(199, 75, 75, 0.25);
}
[data-theme="dark"] .y-event-badge--scheduled {
background: rgba(92, 107, 192, 0.14);
color: var(--c-primary-300);
border-color: rgba(92, 107, 192, 0.25);
}
/* ── 18. y-priority-dot — Case Priority Indicator ────────────── */
.y-priority-dot {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.y-priority-dot--critical { background: var(--priority-critical); }
.y-priority-dot--high { background: var(--priority-high); }
.y-priority-dot--normal { background: var(--priority-normal); }
.y-priority-dot--low { background: var(--priority-low); }
.y-priority-dot--blocked {
background: var(--status-critical);
box-shadow: 0 0 0 3px var(--error-subtle);
}
/* 10px size variant for section headers */
.y-priority-dot--lg {
width: 10px;
height: 10px;
}
/* ── 19. y-sla — SLA Status Badge ────────────────────────────── */
.y-sla {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: var(--space-0-5) var(--space-2);
border-radius: var(--radius-full);
font-size: var(--text-xs);
font-weight: var(--weight-semibold);
border: 1px solid transparent;
white-space: nowrap;
}
.y-sla--ontime {
background: var(--sla-ontime-bg);
color: var(--sla-ontime-text);
border-color: var(--sla-ontime-border);
}
.y-sla--atrisk {
background: var(--sla-atrisk-bg);
color: var(--sla-atrisk-text);
border-color: var(--sla-atrisk-border);
}
.y-sla--overdue {
background: var(--sla-overdue-bg);
color: var(--sla-overdue-text);
border-color: var(--sla-overdue-border);
}
/* ── y-icon — Lucide Icon Size Utilities ─────────────────────── */
/* Apply directly to <i data-lucide> or a wrapper element */
i[data-lucide].icon-xs, .y-icon-xs { width: var(--icon-xs, 12px); height: var(--icon-xs, 12px); }
i[data-lucide].icon-sm, .y-icon-sm { width: var(--icon-sm, 16px); height: var(--icon-sm, 16px); }
i[data-lucide].icon-md, .y-icon-md { width: var(--icon-md, 20px); height: var(--icon-md, 20px); }
i[data-lucide].icon-lg, .y-icon-lg { width: var(--icon-lg, 24px); height: var(--icon-lg, 24px); }
i[data-lucide].icon-xl, .y-icon-xl { width: var(--icon-xl, 28px); height: var(--icon-xl, 28px); }
/* Icon wrappers — square containers with icon centred */
.y-icon-box {
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: var(--radius-md);
flex-shrink: 0;
}
.y-icon-box--xs { width: 24px; height: 24px; }
.y-icon-box--sm { width: 32px; height: 32px; }
.y-icon-box--md { width: 40px; height: 40px; }
.y-icon-box--lg { width: 48px; height: 48px; }
/* Semantic tints */
.y-icon-box--primary { background: var(--primary-subtle); color: var(--primary); }
.y-icon-box--success { background: var(--success-subtle); color: var(--success); }
.y-icon-box--warning { background: var(--warning-subtle); color: var(--warning); }
.y-icon-box--error { background: var(--error-subtle); color: var(--error); }
.y-icon-box--muted { background: var(--surface-hover); color: var(--text-muted); }
/* ── 20. y-timeline — Vertical Timeline ──────────────────────── */
.y-timeline {
position: relative;
padding-left: var(--space-6);
}
.y-timeline::before {
content: '';
position: absolute;
left: 0.4375rem;
top: 0;
bottom: 0;
width: 2px;
background: var(--border);
}
.y-timeline__item {
position: relative;
margin-bottom: var(--space-3);
}
.y-timeline__item::before {
content: '';
position: absolute;
left: calc(-1 * var(--space-6) + 0.1875rem);
top: 0.25rem;
width: 10px;
height: 10px;
border-radius: 50%;
background: var(--primary);
border: 2px solid var(--bg);
}
.y-timeline__item--error::before { background: var(--c-error-500); }
.y-timeline__item--warning::before { background: var(--c-warning-500); }
.y-timeline__item--success::before { background: var(--c-success-500); }
.y-timeline__item--neutral::before { background: var(--c-neutral-400); }
.y-timeline__card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: var(--space-2) var(--space-3);
}
.y-timeline__header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-1);
}
.y-timeline__event {
font-size: var(--text-sm);
font-weight: var(--weight-semibold);
color: var(--text);
}
.y-timeline__time {
font-size: var(--text-xs);
color: var(--text-muted);
}
.y-timeline__notes {
font-size: var(--text-sm);
color: var(--text);
margin: 0;
line-height: var(--leading-snug);
}
.y-timeline__meta {
font-size: var(--text-xs);
color: var(--text-muted);
margin-top: var(--space-1);
}
/* Timeline milestone quick-tap buttons */
.y-timeline-btn {
padding: var(--space-2) var(--space-3);
border-radius: var(--radius-md);
font-size: var(--text-sm);
font-weight: var(--weight-medium);
cursor: pointer;
white-space: nowrap;
min-height: 40px;
border: 1px solid color-mix(in srgb, var(--btn-color, var(--border)) 40%, transparent);
background: color-mix(in srgb, var(--btn-color, var(--primary)) 10%, transparent);
color: var(--btn-color, var(--primary));
transition: background var(--transition-fast), border-color var(--transition-fast);
font-family: var(--font-sans);
}
.y-timeline-btn:hover {
background: color-mix(in srgb, var(--btn-color, var(--primary)) 20%, transparent);
border-color: color-mix(in srgb, var(--btn-color, var(--border)) 60%, transparent);
}
.y-timeline-btn:focus-visible {
outline: var(--focus-ring);
outline-offset: var(--focus-ring-offset);
}
@media (prefers-reduced-motion: reduce) {
.y-timeline-btn { transition: none !important; }
}
/* ── y-callout — Inline feedback / notification banners ─────────── */
.y-callout {
display: flex;
align-items: flex-start;
gap: var(--space-3);
padding: var(--space-3) var(--space-4);
border-radius: var(--radius-md);
border: 1px solid var(--border-subtle);
background: var(--surface-raised);
color: var(--text);
font-size: var(--text-sm);
line-height: 1.5;
}
.y-callout i[data-lucide],
.y-callout svg {
flex-shrink: 0;
width: var(--icon-sm);
height: var(--icon-sm);
margin-top: 1px;
}
/* Variants */
.y-callout--success {
background: var(--success-subtle);
border-color: var(--c-success-200);
color: var(--c-success-800);
}
.y-callout--success i[data-lucide],
.y-callout--success svg { color: var(--c-success-600); }
.y-callout--warning {
background: var(--warning-subtle);
border-color: var(--c-warning-200);
color: var(--c-warning-800);
}
.y-callout--warning i[data-lucide],
.y-callout--warning svg { color: var(--c-warning-600); }
.y-callout--error {
background: var(--error-subtle);
border-color: var(--c-error-200);
color: var(--c-error-800);
}
.y-callout--error i[data-lucide],
.y-callout--error svg { color: var(--c-error-600); }
/* Dark mode */
[data-theme="dark"] .y-callout {
background: var(--surface-raised);
border-color: var(--border-subtle);
color: var(--text);
}
[data-theme="dark"] .y-callout--success {
background: rgba(var(--c-success-500-rgb, 22,163,74), 0.12);
border-color: rgba(var(--c-success-500-rgb, 22,163,74), 0.25);
color: var(--c-success-300, #86efac);
}
[data-theme="dark"] .y-callout--success i[data-lucide],
[data-theme="dark"] .y-callout--success svg { color: var(--c-success-400, #4ade80); }
[data-theme="dark"] .y-callout--warning {
background: rgba(var(--c-warning-500-rgb, 245,158,11), 0.12);
border-color: rgba(var(--c-warning-500-rgb, 245,158,11), 0.25);
color: var(--c-warning-300, #fcd34d);
}
[data-theme="dark"] .y-callout--warning i[data-lucide],
[data-theme="dark"] .y-callout--warning svg { color: var(--c-warning-400, #fbbf24); }
[data-theme="dark"] .y-callout--error {
background: rgba(var(--c-error-500-rgb, 239,68,68), 0.12);
border-color: rgba(var(--c-error-500-rgb, 239,68,68), 0.25);
color: var(--c-error-300, #fca5a5);
}
[data-theme="dark"] .y-callout--error i[data-lucide],
[data-theme="dark"] .y-callout--error svg { color: var(--c-error-400, #f87171); }
/* ── Forced-colors (Windows High Contrast) ─────────────────────────────────
Ensure all interactive components remain visible in forced-colours mode.
Browsers substitute system colours; we restore borders where needed.
──────────────────────────────────────────────────────────────────────────── */
@media (forced-colors: active) {
.y-btn {
border: 1px solid ButtonText;
forced-color-adjust: none;
background: ButtonFace;
color: ButtonText;
}
.y-btn--primary,
.y-btn--danger {
border: 2px solid ButtonText;
background: Highlight;
color: HighlightText;
}
.y-btn:focus-visible { outline: 3px solid Highlight; }
.y-input,
.y-select { border: 1px solid ButtonText; background: Field; color: FieldText; }
.y-input:focus-visible,
.y-select:focus-visible { outline: 3px solid Highlight; }
.y-card { border: 1px solid ButtonText; }
.y-badge { border: 1px solid ButtonText; }
.y-chip { border: 1px solid ButtonText; }
.y-tab.is-active { border-bottom: 3px solid Highlight; color: Highlight; }
}
/* ════════════════════════════════════════════════════════════════
YAZ Component Library — y-* Design System v5
════════════════════════════════════════════════════════════════
Single source of truth for all reusable UI components.
All values derive from tokens.css.
Prefix: y- (universal)
Naming: BEM-inspired — y-block__element--modifier
Components:
1. y-btn — Button system (primary, secondary, ghost, danger)
2. y-input — Text input, textarea, select (+ y-field, y-label)
3. y-card — Surface container
4. y-stat — Stat/metric display card
5. y-badge — Status chip / label
6. y-tabs — Horizontal tab bar
7. y-modal — Dialog overlay
8. y-toast — Notification snackbar
9. y-skeleton — Shimmer loading placeholder
10. y-avatar — User avatar
11. y-empty — Empty state
12. y-divider — Horizontal separator
13. y-progress — Progress bar
14. y-chip — Selectable filter chip
15. y-table — Data table
════════════════════════════════════════════════════════════════ */
/* ── 1. y-btn — Button System ────────────────────────────────── */
.y-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.375rem;
height: var(--btn-height, 36px);
padding: 0 1rem;
border-radius: var(--btn-radius, var(--radius-md));
font-size: var(--btn-font-size, var(--text-sm));
font-weight: var(--btn-font-weight, var(--weight-medium));
font-family: var(--font-sans);
cursor: pointer;
border: 1px solid transparent;
transition:
background var(--duration-fast) var(--ease-default),
border-color var(--duration-fast) var(--ease-default),
color var(--duration-fast) var(--ease-default),
transform var(--duration-fast) var(--ease-spring),
box-shadow var(--duration-fast) var(--ease-default),
opacity var(--duration-fast) var(--ease-default);
white-space: nowrap;
text-decoration: none;
user-select: none;
}
.y-btn:focus-visible {
outline: var(--focus-ring);
outline-offset: var(--focus-ring-offset);
}
.y-btn:active {
transform: scale(0.97) ;
transition-duration: var(--duration-instant) ;
}
.y-btn:disabled,
.y-btn[aria-disabled="true"] {
opacity: 0.45;
cursor: not-allowed;
pointer-events: none;
}
/* Variants */
.y-btn--primary {
background: var(--primary);
color: var(--text-inverse);
border-color: var(--primary);
}
.y-btn--primary:hover {
background: var(--primary-hover);
border-color: var(--primary-hover);
transform: translateY(var(--hover-lift));
box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
}
.y-btn--secondary {
background: var(--surface);
color: var(--text);
border-color: var(--border);
}
.y-btn--secondary:hover {
border-color: var(--border-strong);
background: var(--surface-hover);
transform: translateY(var(--hover-lift));
box-shadow: var(--shadow-sm);
}
.y-btn--ghost {
background: transparent;
color: var(--text-muted);
border-color: transparent;