modularize UI
This commit is contained in:
@@ -19,8 +19,9 @@
|
||||
"vendor": "bun run scripts/vendor.ts",
|
||||
"build:prod:win": "bun run build:public:prod && bun build --production src/index.ts --compile --target bun-windows-x64 --outfile dist/overlord-server.exe",
|
||||
"build:prod:linux": "bun run build:public:prod && bun build --production src/index.ts --compile --target bun-linux-x64 --outfile dist/overlord-server-linux-x64",
|
||||
"build:css": "tailwindcss -i ./src/styles.css -o ./public/assets/tailwind.css --minify",
|
||||
"build:css": "tailwindcss -i ./src/styles.css -o ./public/assets/tailwind.css --minify && tailwindcss -i ./src/ui.css -o ./public/assets/ui.css --minify",
|
||||
"watch:css": "tailwindcss -i ./src/styles.css -o ./public/assets/tailwind.css --watch=always",
|
||||
"watch:ui": "tailwindcss -i ./src/ui.css -o ./public/assets/ui.css --watch=always",
|
||||
"minify": "bun run scripts/minify-public.ts",
|
||||
"bench:client-db": "bun run scripts/client-db-stress.ts",
|
||||
"protocol:generate": "bun ../scripts/generate-wire-protocol.ts",
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
||||
:root{--ui-canvas:#04070d;--ui-canvas-raised:#020617;--ui-surface-1:#0f172ab8;--ui-surface-2:#1e293bb3;--ui-surface-hover:#334155c7;--ui-surface-solid:#172033;--ui-surface-solid-hover:#1f2a3e;--ui-popover:#111827;--ui-popover-translucent:#0f172afa;--ui-text:#e2e8f0;--ui-text-strong:#f8fafc;--ui-text-muted:#94a3b8;--ui-text-faint:#64748b;--ui-border-subtle:#334155ad;--ui-border-strong:#475569cc;--ui-accent:#38bdf8;--ui-accent-secondary:#818cf8;--ui-success:#22c55e;--ui-warning:#fbbf24;--ui-danger:#fb7185;--ui-radius-sm:6px;--ui-radius-control:8px;--ui-radius-panel:10px;--ui-radius-full:999px;--ui-control-height:36px;--ui-space-1:4px;--ui-space-2:8px;--ui-space-3:12px;--ui-space-4:16px;--ui-motion-fast:.14s;--ui-motion-normal:.22s;--ui-ease-out:cubic-bezier(.2, .8, .2, 1)}:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid var(--ui-accent)!important;outline-offset:2px!important;box-shadow:0 0 0 3px #38bdf829!important}:where(a,button,input,select,textarea,summary,[tabindex]):focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion:reduce){:where(.ui-card,.ui-button,.ui-icon-button,.ui-popover){scroll-behavior:auto;transition-duration:.01ms!important}}.ui-card{border:1px solid var(--ui-border-subtle);border-radius:var(--ui-radius-panel);background:var(--ui-surface-1);min-width:0;position:relative;overflow:hidden}.ui-card--interactive{cursor:grab}.ui-card--interactive:active{cursor:grabbing}.ui-card--interactive.is-dragging{opacity:.52;border-color:#38bdf89e}.ui-button,.ui-icon-button{border-radius:var(--ui-radius-control);background:var(--ui-surface-solid);color:#cbd5e1;cursor:pointer;border:1px solid #475569b8;transition:transform .15s,border-color .15s,background-color .15s,color .15s}.ui-button:hover,.ui-icon-button:hover{background:var(--ui-surface-solid-hover);color:var(--ui-text-strong);border-color:#818cf88c;transform:translateY(-1px)}.ui-button:disabled,.ui-icon-button:disabled{opacity:.4;cursor:not-allowed;transform:none}.ui-button{min-height:var(--ui-control-height);justify-content:center;align-items:center;gap:var(--ui-space-2);padding:0 var(--ui-space-3);font-size:.8125rem;font-weight:600;display:inline-flex}.ui-icon-button{width:var(--ui-control-height);height:var(--ui-control-height);justify-content:center;align-items:center;padding:0;display:inline-flex}.ui-icon-button[data-size=compact]{background:var(--ui-surface-2);width:34px;height:34px;color:var(--ui-text-muted);border-color:var(--ui-border-subtle)}.ui-icon-button[data-size=compact]:hover{background:var(--ui-surface-hover);color:var(--ui-text);border-color:var(--ui-border-strong);transform:none}.ui-icon-button:has(input:not(:checked)){color:var(--ui-text-faint);background:#0f172abf}.ui-icon-button input{opacity:0;pointer-events:none;position:absolute}.ui-menu[open]>.ui-icon-button{color:var(--ui-accent-secondary);background:#20294a;border-color:#818cf88c}.ui-badge{text-overflow:ellipsis;white-space:nowrap;border-radius:var(--ui-radius-full);color:#cbd5e1;font-variant-numeric:tabular-nums;background:#1e293b8c;border:1px solid #64748b40;flex-shrink:0;align-items:center;max-width:9rem;padding:3px 8px;font-size:.7rem;font-weight:700;display:inline-flex;overflow:hidden}.ui-badge[data-tone=info]{color:#bae6fd;background:#082f4952;border-color:#38bdf838}.ui-status-dot{border-radius:var(--ui-radius-full);background:var(--ui-text-faint);flex:none;width:8px;height:8px;box-shadow:0 0 0 4px #64748b1f}.ui-status-dot:is([data-state=healthy],.is-live){background:var(--ui-success);box-shadow:0 0 0 4px #22c55e21,0 0 16px #22c55e5c}.ui-status-dot:is([data-state=warning],.is-warn){background:var(--ui-warning);box-shadow:0 0 0 4px #fbbf241f,0 0 16px #fbbf244d}.ui-status-dot:is([data-state=danger],.is-bad){background:var(--ui-danger);box-shadow:0 0 0 4px #fb71851f,0 0 16px #fb71854d}.ui-status-dot:is([data-state=neutral],.is-muted){background:var(--ui-text-faint);box-shadow:0 0 0 4px #64748b1a}.ui-popover{top:calc(100% + var(--ui-space-2));z-index:40;gap:var(--ui-space-2);border:1px solid var(--ui-border-strong);border-radius:var(--ui-radius-control);background:var(--ui-popover);flex-direction:column;min-width:220px;padding:10px;display:flex;position:absolute;right:0;box-shadow:0 18px 44px #0206178c}.ui-popover[data-size=compact]{background:var(--ui-popover-translucent);border-color:#334155d1;gap:6px;width:196px;min-width:196px;display:grid;box-shadow:0 18px 38px #0206176b}.ui-toolbar{z-index:20;align-items:center;gap:10px;display:flex;position:relative}.ui-toolbar__search{flex:420px;min-width:240px}.ui-toolbar__actions{flex:none;align-items:center;gap:6px;display:inline-flex}@media (max-width:820px){.ui-toolbar{flex-direction:column;align-items:stretch}.ui-toolbar__search{flex-basis:auto;width:100%}.ui-toolbar__actions{flex-wrap:wrap;justify-content:flex-end;width:100%}}
|
||||
@@ -15,6 +15,7 @@
|
||||
<link rel="stylesheet" href="/vendor/gridstack/gridstack.min.css" />
|
||||
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico" />
|
||||
<link rel="stylesheet" href="/assets/main.css" />
|
||||
<link rel="stylesheet" href="/assets/ui.css" />
|
||||
<link rel="stylesheet" href="/assets/custom.css" />
|
||||
<script defer src="/vendor/animejs/anime.min.js"></script>
|
||||
<script defer src="/vendor/chart.js/chart.umd.js"></script>
|
||||
@@ -36,10 +37,10 @@
|
||||
</div>
|
||||
<div class="dashboard-stats-controls" aria-label="Status overview controls">
|
||||
<details id="dashboard-card-menu" class="dashboard-card-menu">
|
||||
<summary class="dashboard-stats-toggle" title="Dashboard cards" aria-label="Dashboard cards">
|
||||
<summary class="dashboard-stats-toggle ui-icon-button" data-size="compact" title="Dashboard cards" aria-label="Dashboard cards">
|
||||
<i class="fa-solid fa-table-cells-large"></i>
|
||||
</summary>
|
||||
<div id="dashboard-card-menu-panel" class="dashboard-card-menu-panel">
|
||||
<div id="dashboard-card-menu-panel" class="dashboard-card-menu-panel ui-popover" data-size="compact">
|
||||
<label><input type="checkbox" data-dashboard-card-toggle="online" checked /> Online</label>
|
||||
<label><input type="checkbox" data-dashboard-card-toggle="sessions" checked /> Sessions</label>
|
||||
<label><input type="checkbox" data-dashboard-card-toggle="trend" checked /> Clients Online</label>
|
||||
@@ -47,19 +48,19 @@
|
||||
<label><input type="checkbox" data-dashboard-card-toggle="pulse" checked /> Server Pulse</label>
|
||||
</div>
|
||||
</details>
|
||||
<button id="dashboard-stats-reset" class="dashboard-stats-toggle" type="button" title="Reset status overview">
|
||||
<button id="dashboard-stats-reset" class="dashboard-stats-toggle ui-icon-button" data-size="compact" type="button" title="Reset status overview">
|
||||
<i class="fa-solid fa-arrow-rotate-left"></i>
|
||||
</button>
|
||||
<button id="dashboard-stats-toggle" class="dashboard-stats-toggle" type="button" aria-expanded="true" title="Hide status overview">
|
||||
<button id="dashboard-stats-toggle" class="dashboard-stats-toggle ui-icon-button" data-size="compact" type="button" aria-expanded="true" title="Hide status overview">
|
||||
<i class="fa-solid fa-eye-slash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dashboard-stats-content" class="dashboard-stats-content grid-stack">
|
||||
<div class="grid-stack-item" data-dashboard-card="online" gs-id="online" gs-x="0" gs-y="0" gs-w="2" gs-h="2" gs-min-w="2" gs-min-h="1">
|
||||
<div class="grid-stack-item-content dashboard-stat-card dashboard-stat-card--online">
|
||||
<div class="grid-stack-item-content dashboard-stat-card dashboard-stat-card--online ui-card ui-card--interactive">
|
||||
<div class="dashboard-stat-topline">
|
||||
<span class="dashboard-live-dot is-live"></span>
|
||||
<span class="dashboard-live-dot ui-status-dot is-live"></span>
|
||||
<span>Online</span>
|
||||
</div>
|
||||
<div id="dash-online-count" class="dashboard-stat-value">0</div>
|
||||
@@ -70,7 +71,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-stack-item" data-dashboard-card="sessions" gs-id="sessions" gs-x="2" gs-y="0" gs-w="2" gs-h="2" gs-min-w="2" gs-min-h="1">
|
||||
<div class="grid-stack-item-content dashboard-stat-card dashboard-stat-card--sessions">
|
||||
<div class="grid-stack-item-content dashboard-stat-card dashboard-stat-card--sessions ui-card ui-card--interactive">
|
||||
<div class="dashboard-stat-topline">
|
||||
<i class="fa-solid fa-wave-square"></i>
|
||||
<span>Sessions</span>
|
||||
@@ -83,13 +84,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-stack-item" data-dashboard-card="trend" gs-id="trend" gs-x="4" gs-y="0" gs-w="3" gs-h="2" gs-min-w="2" gs-min-h="1">
|
||||
<div class="grid-stack-item-content dashboard-chart-card">
|
||||
<div class="grid-stack-item-content dashboard-chart-card ui-card ui-card--interactive">
|
||||
<div class="dashboard-chart-head">
|
||||
<div>
|
||||
<span class="dashboard-chart-kicker">Past Week</span>
|
||||
<strong>Clients Online</strong>
|
||||
</div>
|
||||
<span id="dash-trend-status" class="dashboard-chart-pill">Live</span>
|
||||
<span id="dash-trend-status" class="dashboard-chart-pill ui-badge" data-tone="info">Live</span>
|
||||
</div>
|
||||
<div class="dashboard-chart-wrap">
|
||||
<canvas id="dash-online-chart"></canvas>
|
||||
@@ -97,13 +98,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-stack-item" data-dashboard-card="fleet" gs-id="fleet" gs-x="7" gs-y="0" gs-w="3" gs-h="2" gs-min-w="2" gs-min-h="1">
|
||||
<div class="grid-stack-item-content dashboard-chart-card">
|
||||
<div class="grid-stack-item-content dashboard-chart-card ui-card ui-card--interactive">
|
||||
<div class="dashboard-chart-head">
|
||||
<div>
|
||||
<span class="dashboard-chart-kicker">Fleet Mix</span>
|
||||
<strong>Operating Systems</strong>
|
||||
</div>
|
||||
<span id="dash-os-leader" class="dashboard-chart-pill">None</span>
|
||||
<span id="dash-os-leader" class="dashboard-chart-pill ui-badge" data-tone="info">None</span>
|
||||
</div>
|
||||
<div class="dashboard-chart-wrap dashboard-chart-wrap--donut">
|
||||
<canvas id="dash-os-chart"></canvas>
|
||||
@@ -111,27 +112,27 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-stack-item" data-dashboard-card="pulse" gs-id="pulse" gs-x="10" gs-y="0" gs-w="2" gs-h="2" gs-min-w="2" gs-min-h="1">
|
||||
<div class="grid-stack-item-content dashboard-health-card">
|
||||
<div class="grid-stack-item-content dashboard-health-card ui-card ui-card--interactive">
|
||||
<div class="dashboard-chart-head">
|
||||
<div>
|
||||
<span class="dashboard-chart-kicker">Status</span>
|
||||
<strong>Server Pulse</strong>
|
||||
</div>
|
||||
<span id="dash-last-refresh" class="dashboard-chart-pill">Waiting</span>
|
||||
<span id="dash-last-refresh" class="dashboard-chart-pill ui-badge" data-tone="info">Waiting</span>
|
||||
</div>
|
||||
<div class="dashboard-health-list">
|
||||
<div class="dashboard-health-row" data-pulse-row="api" draggable="true">
|
||||
<span class="dashboard-live-dot is-live"></span>
|
||||
<span class="dashboard-live-dot ui-status-dot is-live"></span>
|
||||
<span>API</span>
|
||||
<strong id="dash-api-status">Live</strong>
|
||||
</div>
|
||||
<div class="dashboard-health-row" data-pulse-row="memory" draggable="true">
|
||||
<span id="dash-memory-dot" class="dashboard-live-dot is-live"></span>
|
||||
<span id="dash-memory-dot" class="dashboard-live-dot ui-status-dot is-live"></span>
|
||||
<span>Memory</span>
|
||||
<strong id="dash-memory-status">0%</strong>
|
||||
</div>
|
||||
<div class="dashboard-health-row" data-pulse-row="ping" draggable="true">
|
||||
<span id="dash-ping-dot" class="dashboard-live-dot is-muted"></span>
|
||||
<span id="dash-ping-dot" class="dashboard-live-dot ui-status-dot is-muted"></span>
|
||||
<span>Ping Avg</span>
|
||||
<strong id="dash-ping-status">-</strong>
|
||||
</div>
|
||||
@@ -150,10 +151,10 @@
|
||||
<span></span>
|
||||
</div>
|
||||
</section>
|
||||
<div class="dashboard-toolbar">
|
||||
<div class="dashboard-toolbar ui-toolbar">
|
||||
<label
|
||||
id="search-shell"
|
||||
class="dashboard-search flex items-center gap-2 bg-slate-800/70 border border-slate-700/60 rounded-lg px-3 py-2"
|
||||
class="dashboard-search ui-toolbar__search flex items-center gap-2 bg-slate-800/70 border border-slate-700/60 rounded-lg px-3 py-2"
|
||||
>
|
||||
<i class="fa-solid fa-magnifying-glass text-slate-500"></i>
|
||||
<input
|
||||
@@ -163,14 +164,14 @@
|
||||
placeholder="Search by nickname, host, user, id"
|
||||
/>
|
||||
</label>
|
||||
<div class="dashboard-toolbar-actions">
|
||||
<label class="dashboard-toggle" title="Show offline clients">
|
||||
<div class="dashboard-toolbar-actions ui-toolbar__actions">
|
||||
<label class="dashboard-toggle ui-icon-button" title="Show offline clients">
|
||||
<input id="toggle-offline" type="checkbox" checked />
|
||||
<i class="fa-solid fa-power-off"></i>
|
||||
</label>
|
||||
<details class="dashboard-menu">
|
||||
<summary title="Filters"><i class="fa-solid fa-filter"></i></summary>
|
||||
<div class="dashboard-menu-panel dashboard-filter-panel">
|
||||
<details class="dashboard-menu ui-menu">
|
||||
<summary class="ui-icon-button" title="Filters"><i class="fa-solid fa-filter"></i></summary>
|
||||
<div class="dashboard-menu-panel dashboard-filter-panel ui-popover">
|
||||
<select id="filter-status">
|
||||
<option value="all">All Status</option>
|
||||
<option value="online">Online Only</option>
|
||||
@@ -190,9 +191,9 @@
|
||||
<div id="country-picker-anchor" class="relative"></div>
|
||||
</div>
|
||||
</details>
|
||||
<details class="dashboard-menu">
|
||||
<summary title="Sort"><i class="fa-solid fa-arrow-down-wide-short"></i></summary>
|
||||
<div class="dashboard-menu-panel">
|
||||
<details class="dashboard-menu ui-menu">
|
||||
<summary class="ui-icon-button" title="Sort"><i class="fa-solid fa-arrow-down-wide-short"></i></summary>
|
||||
<div class="dashboard-menu-panel ui-popover">
|
||||
<select id="sort">
|
||||
<option value="stable">Default</option>
|
||||
<option value="last_seen_desc">Newest</option>
|
||||
@@ -208,9 +209,9 @@
|
||||
</select>
|
||||
</div>
|
||||
</details>
|
||||
<details class="dashboard-menu">
|
||||
<summary title="Visible fields"><i class="fa-solid fa-sliders"></i></summary>
|
||||
<div id="display-fields-menu" class="dashboard-menu-panel dashboard-fields-panel">
|
||||
<details class="dashboard-menu ui-menu">
|
||||
<summary class="ui-icon-button" title="Visible fields"><i class="fa-solid fa-sliders"></i></summary>
|
||||
<div id="display-fields-menu" class="dashboard-menu-panel dashboard-fields-panel ui-popover">
|
||||
<label><input type="checkbox" data-field="user" checked /> User</label>
|
||||
<label><input type="checkbox" data-field="ip" checked /> IP</label>
|
||||
<label><input type="checkbox" data-field="hwid" /> HWID</label>
|
||||
@@ -222,10 +223,10 @@
|
||||
<label><input type="checkbox" data-field="battery" checked /> Battery</label>
|
||||
</div>
|
||||
</details>
|
||||
<button id="select-all" class="dashboard-icon-btn" title="Select all">
|
||||
<button id="select-all" class="dashboard-icon-btn ui-icon-button" title="Select all">
|
||||
<i class="fa-solid fa-check"></i>
|
||||
</button>
|
||||
<button id="clear-selection" class="dashboard-icon-btn" title="Clear selection">
|
||||
<button id="clear-selection" class="dashboard-icon-btn ui-icon-button" title="Clear selection">
|
||||
<i class="fa-solid fa-xmark"></i>
|
||||
</button>
|
||||
<div id="layout-toggle" role="group" aria-label="Layout" class="inline-flex items-center rounded-lg border border-slate-700/60 bg-slate-800/70 p-0.5">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Development supervisor.
|
||||
*
|
||||
* Keeps the backend and generated Tailwind stylesheet up to date while
|
||||
* Keeps the backend and generated stylesheets up to date while
|
||||
* preserving a single foreground process for the repository launchers.
|
||||
*/
|
||||
|
||||
@@ -45,6 +45,14 @@ const styles = Bun.spawn(["bun", "run", "watch:css"], {
|
||||
stderr: "inherit",
|
||||
});
|
||||
|
||||
const uiStyles = Bun.spawn(["bun", "run", "watch:ui"], {
|
||||
cwd,
|
||||
env,
|
||||
stdin: "inherit",
|
||||
stdout: "inherit",
|
||||
stderr: "inherit",
|
||||
});
|
||||
|
||||
const web = Bun.spawn(["bun", "run", "watch:web"], {
|
||||
cwd,
|
||||
env,
|
||||
@@ -60,6 +68,7 @@ function stop(exitCode = 0): void {
|
||||
stopping = true;
|
||||
backend.kill();
|
||||
styles.kill();
|
||||
uiStyles.kill();
|
||||
web.kill();
|
||||
process.exitCode = exitCode;
|
||||
}
|
||||
@@ -70,6 +79,7 @@ process.on("SIGTERM", () => stop(143));
|
||||
const result = await Promise.race([
|
||||
backend.exited.then((exitCode) => ({ process: "backend", exitCode })),
|
||||
styles.exited.then((exitCode) => ({ process: "Tailwind watcher", exitCode })),
|
||||
uiStyles.exited.then((exitCode) => ({ process: "UI stylesheet watcher", exitCode })),
|
||||
web.exited.then((exitCode) => ({ process: "browser TypeScript watcher", exitCode })),
|
||||
]);
|
||||
|
||||
@@ -78,4 +88,4 @@ if (!stopping) {
|
||||
stop(result.exitCode || 1);
|
||||
}
|
||||
|
||||
await Promise.allSettled([backend.exited, styles.exited, web.exited]);
|
||||
await Promise.allSettled([backend.exited, styles.exited, uiStyles.exited, web.exited]);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
@import "./web/styles/tokens.css";
|
||||
@import "./web/styles/base.css";
|
||||
@import "./web/styles/primitives/cards.css";
|
||||
@import "./web/styles/primitives/buttons.css";
|
||||
@import "./web/styles/primitives/badges.css";
|
||||
@import "./web/styles/primitives/popovers.css";
|
||||
@import "./web/styles/patterns/toolbars.css";
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# Overlord UI styles
|
||||
|
||||
The dashboard is the visual reference for this design system. Source styles are
|
||||
bundled from `src/ui.css` into `public/assets/ui.css`.
|
||||
|
||||
## Layers
|
||||
|
||||
- `tokens.css` contains semantic theme values. Components should consume these
|
||||
variables instead of introducing raw palette values when a token exists.
|
||||
- `base.css` contains application-wide accessibility and motion behavior.
|
||||
- `primitives/` contains reusable controls with no page-specific layout.
|
||||
- `patterns/` composes primitives into recurring structures such as toolbars.
|
||||
- Feature-specific layout belongs in a future `features/` module or the existing
|
||||
feature stylesheet until it is migrated.
|
||||
|
||||
Load order is `tailwind.css`, `main.css`, `ui.css`, then `custom.css`. This lets
|
||||
the design system replace legacy declarations while preserving administrator
|
||||
branding overrides.
|
||||
|
||||
## Conventions
|
||||
|
||||
- Use the `ui-` prefix for reusable components.
|
||||
- Use `data-tone` for semantic color variants and `data-size` for sizing.
|
||||
- Use `is-*` classes for transient JavaScript state during legacy migration.
|
||||
- Keep data fetching in feature modules; UI primitives should only render or
|
||||
manage their own interaction behavior.
|
||||
- Retain a legacy class beside its `ui-*` replacement until all consumers and
|
||||
selectors have migrated, then remove the legacy declaration separately.
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/* A single visible keyboard-focus treatment replaces page-specific resets. */
|
||||
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
|
||||
outline: 2px solid var(--ui-accent) !important;
|
||||
outline-offset: 2px !important;
|
||||
box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16) !important;
|
||||
}
|
||||
|
||||
:where(a, button, input, select, textarea, summary, [tabindex]):focus:not(:focus-visible) {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
:where(.ui-card, .ui-button, .ui-icon-button, .ui-popover) {
|
||||
scroll-behavior: auto;
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
.ui-toolbar {
|
||||
position: relative;
|
||||
z-index: 20;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.ui-toolbar__search {
|
||||
flex: 1 1 420px;
|
||||
min-width: 240px;
|
||||
}
|
||||
|
||||
.ui-toolbar__actions {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
@media (max-width: 820px) {
|
||||
.ui-toolbar {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.ui-toolbar__search {
|
||||
flex-basis: auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ui-toolbar__actions {
|
||||
width: 100%;
|
||||
justify-content: flex-end;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
.ui-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
max-width: 9rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
border: 1px solid rgba(100, 116, 139, 0.25);
|
||||
border-radius: var(--ui-radius-full);
|
||||
background: rgba(30, 41, 59, 0.55);
|
||||
color: #cbd5e1;
|
||||
padding: 3px 8px;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 700;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.ui-badge[data-tone="info"] {
|
||||
border-color: rgba(56, 189, 248, 0.22);
|
||||
background: rgba(8, 47, 73, 0.32);
|
||||
color: #bae6fd;
|
||||
}
|
||||
|
||||
.ui-status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
flex: 0 0 auto;
|
||||
border-radius: var(--ui-radius-full);
|
||||
background: var(--ui-text-faint);
|
||||
box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.12);
|
||||
}
|
||||
|
||||
.ui-status-dot:is([data-state="healthy"], .is-live) {
|
||||
background: var(--ui-success);
|
||||
box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.13), 0 0 16px rgba(34, 197, 94, 0.36);
|
||||
}
|
||||
|
||||
.ui-status-dot:is([data-state="warning"], .is-warn) {
|
||||
background: var(--ui-warning);
|
||||
box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.12), 0 0 16px rgba(251, 191, 36, 0.3);
|
||||
}
|
||||
|
||||
.ui-status-dot:is([data-state="danger"], .is-bad) {
|
||||
background: var(--ui-danger);
|
||||
box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.12), 0 0 16px rgba(251, 113, 133, 0.3);
|
||||
}
|
||||
|
||||
.ui-status-dot:is([data-state="neutral"], .is-muted) {
|
||||
background: var(--ui-text-faint);
|
||||
box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.1);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
.ui-button,
|
||||
.ui-icon-button {
|
||||
border: 1px solid rgba(71, 85, 105, 0.72);
|
||||
border-radius: var(--ui-radius-control);
|
||||
background: var(--ui-surface-solid);
|
||||
color: #cbd5e1;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
transform 150ms ease,
|
||||
border-color 150ms ease,
|
||||
background-color 150ms ease,
|
||||
color 150ms ease;
|
||||
}
|
||||
|
||||
.ui-button:hover,
|
||||
.ui-icon-button:hover {
|
||||
transform: translateY(-1px);
|
||||
border-color: rgba(129, 140, 248, 0.55);
|
||||
background: var(--ui-surface-solid-hover);
|
||||
color: var(--ui-text-strong);
|
||||
}
|
||||
|
||||
.ui-button:disabled,
|
||||
.ui-icon-button:disabled {
|
||||
opacity: 0.4;
|
||||
cursor: not-allowed;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.ui-button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: var(--ui-control-height);
|
||||
gap: var(--ui-space-2);
|
||||
padding: 0 var(--ui-space-3);
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.ui-icon-button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: var(--ui-control-height);
|
||||
height: var(--ui-control-height);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ui-icon-button[data-size="compact"] {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
background: var(--ui-surface-2);
|
||||
color: var(--ui-text-muted);
|
||||
border-color: var(--ui-border-subtle);
|
||||
}
|
||||
|
||||
.ui-icon-button[data-size="compact"]:hover {
|
||||
transform: none;
|
||||
background: var(--ui-surface-hover);
|
||||
color: var(--ui-text);
|
||||
border-color: var(--ui-border-strong);
|
||||
}
|
||||
|
||||
.ui-icon-button:has(input:not(:checked)) {
|
||||
color: var(--ui-text-faint);
|
||||
background: rgba(15, 23, 42, 0.75);
|
||||
}
|
||||
|
||||
.ui-icon-button input {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.ui-menu[open] > .ui-icon-button {
|
||||
color: var(--ui-accent-secondary);
|
||||
border-color: rgba(129, 140, 248, 0.55);
|
||||
background: #20294a;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
.ui-card {
|
||||
position: relative;
|
||||
min-width: 0;
|
||||
border: 1px solid var(--ui-border-subtle);
|
||||
border-radius: var(--ui-radius-panel);
|
||||
background: var(--ui-surface-1);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ui-card--interactive {
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.ui-card--interactive:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.ui-card--interactive.is-dragging {
|
||||
opacity: 0.52;
|
||||
border-color: rgba(56, 189, 248, 0.62);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
.ui-popover {
|
||||
position: absolute;
|
||||
top: calc(100% + var(--ui-space-2));
|
||||
right: 0;
|
||||
z-index: 40;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--ui-space-2);
|
||||
min-width: 220px;
|
||||
padding: 10px;
|
||||
border: 1px solid var(--ui-border-strong);
|
||||
border-radius: var(--ui-radius-control);
|
||||
background: var(--ui-popover);
|
||||
box-shadow: 0 18px 44px rgba(2, 6, 23, 0.55);
|
||||
}
|
||||
|
||||
.ui-popover[data-size="compact"] {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
width: 196px;
|
||||
min-width: 196px;
|
||||
border-color: rgba(51, 65, 85, 0.82);
|
||||
background: var(--ui-popover-translucent);
|
||||
box-shadow: 0 18px 38px rgba(2, 6, 23, 0.42);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
:root {
|
||||
/* Canvas and surfaces */
|
||||
--ui-canvas: #04070d;
|
||||
--ui-canvas-raised: #020617;
|
||||
--ui-surface-1: rgba(15, 23, 42, 0.72);
|
||||
--ui-surface-2: rgba(30, 41, 59, 0.7);
|
||||
--ui-surface-hover: rgba(51, 65, 85, 0.78);
|
||||
--ui-surface-solid: #172033;
|
||||
--ui-surface-solid-hover: #1f2a3e;
|
||||
--ui-popover: #111827;
|
||||
--ui-popover-translucent: rgba(15, 23, 42, 0.98);
|
||||
|
||||
/* Content and borders */
|
||||
--ui-text: #e2e8f0;
|
||||
--ui-text-strong: #f8fafc;
|
||||
--ui-text-muted: #94a3b8;
|
||||
--ui-text-faint: #64748b;
|
||||
--ui-border-subtle: rgba(51, 65, 85, 0.68);
|
||||
--ui-border-strong: rgba(71, 85, 105, 0.8);
|
||||
|
||||
/* Intent */
|
||||
--ui-accent: #38bdf8;
|
||||
--ui-accent-secondary: #818cf8;
|
||||
--ui-success: #22c55e;
|
||||
--ui-warning: #fbbf24;
|
||||
--ui-danger: #fb7185;
|
||||
|
||||
/* Shape, spacing, and motion */
|
||||
--ui-radius-sm: 6px;
|
||||
--ui-radius-control: 8px;
|
||||
--ui-radius-panel: 10px;
|
||||
--ui-radius-full: 999px;
|
||||
--ui-control-height: 36px;
|
||||
--ui-space-1: 4px;
|
||||
--ui-space-2: 8px;
|
||||
--ui-space-3: 12px;
|
||||
--ui-space-4: 16px;
|
||||
--ui-motion-fast: 140ms;
|
||||
--ui-motion-normal: 220ms;
|
||||
--ui-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
|
||||
}
|
||||
Reference in New Issue
Block a user