feat: build dashboard design system

This commit is contained in:
vince 2026-06-18 18:27:54 +02:00
parent 171cb05305
commit fb266cf17a
23 changed files with 1449 additions and 84 deletions

View file

@ -0,0 +1,89 @@
<script lang="ts">
import type { UiStatusItem } from "../types";
let { item }: { item: UiStatusItem } = $props();
let target = $derived(item.link?.external ? "_blank" : undefined);
let rel = $derived(item.link?.external ? "noreferrer" : undefined);
</script>
{#snippet cellContent()}
<span>{item.label}</span>
<strong>{item.value}</strong>
{/snippet}
{#if item.link}
<a
class="footer-cell"
data-severity={item.severity || "neutral"}
href={item.link.href}
target={target}
rel={rel}
aria-label={item.link.label}
>
{@render cellContent()}
</a>
{:else}
<div class="footer-cell" data-severity={item.severity || "neutral"}>
{@render cellContent()}
</div>
{/if}
<style>
.footer-cell {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
min-height: 2.65rem;
align-items: center;
background: rgba(2, 3, 2, 0.92);
color: inherit;
text-decoration: none;
}
span,
strong {
min-width: 0;
padding: var(--ui-space-2) var(--ui-space-3);
overflow-wrap: anywhere;
text-transform: uppercase;
}
span {
height: 100%;
border-right: var(--ui-border);
color: var(--ui-color-muted);
font-size: 0.68rem;
font-weight: 800;
}
strong {
color: var(--ui-color-text);
font-size: 0.76rem;
}
.footer-cell[data-severity="ok"] strong {
background: var(--ui-color-accent);
color: #060706;
}
.footer-cell[data-severity="warning"] strong {
color: var(--ui-color-warning);
}
.footer-cell[data-severity="danger"] strong {
color: var(--ui-color-danger);
}
.footer-cell[data-severity="stale"] strong,
.footer-cell[data-severity="unavailable"] strong {
color: var(--ui-color-stale);
}
.footer-cell[data-severity="loading"] strong {
color: var(--ui-color-accent);
}
.footer-cell:where(a):hover strong {
color: var(--ui-color-accent);
}
</style>