[web] The web UI: hosts, add/edit with apply progress, undo, history and restore, share links, engine switch, certificates and device installs, signing by hand, settings and tokens; smoke test counts every §4 flow's clicks

This commit is contained in:
2026-11-07 23:44:27 +01:00
parent aed5fbfcff
commit 3e326e85a0
47 changed files with 7868 additions and 3 deletions
+22
View File
@@ -0,0 +1,22 @@
{
"name": "@ianitor/ui",
"version": "0.1.0",
"private": true,
"license": "MPL-2.0",
"description": "The shared dark Domi theme (murex palette) and its Svelte components.",
"type": "module",
"svelte": "./src/index.ts",
"exports": {
".": { "svelte": "./src/index.ts", "default": "./src/index.ts" },
"./tokens.css": "./src/tokens.css",
"./components.css": "./src/components.css"
},
"dependencies": {
"@fontsource/cinzel": "^5.1.0",
"@fontsource/cormorant-garamond": "^5.1.0",
"@fontsource/manrope": "^5.1.0"
},
"peerDependencies": {
"svelte": "^5.20.0"
}
}
+48
View File
@@ -0,0 +1,48 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<script lang="ts">
import type { Snippet } from "svelte";
import Icon from "./Icon.svelte";
import type { IconName } from "./icons";
// Handoff §2.8. `live` is set only for banners that appear while the user is on the page.
let {
tone = "notice",
icon,
live,
label,
title,
children,
actions,
ondismiss,
}: {
tone?: "notice" | "kept" | "down";
icon?: IconName;
live?: "alert" | "status";
label?: string;
title?: Snippet;
children?: Snippet;
actions?: Snippet;
ondismiss?: () => void;
} = $props();
const shown: IconName = $derived(
icon ?? (tone === "kept" ? "check" : tone === "down" ? "ring" : "clock"),
);
</script>
<section class="ia-banner {tone === 'notice' ? '' : tone}" role={live} aria-label={label}>
<Icon name={shown} class="ia-banner-icon" />
<div class="body">
{#if title}<div>{@render title()}</div>{/if}
{#if children}<div class="line2">{@render children()}</div>{/if}
</div>
{#if actions || ondismiss}
<div class="actions">
{@render actions?.()}
{#if ondismiss}
<button type="button" class="ia-icon-btn" aria-label="Dismiss" onclick={ondismiss}><Icon name="close" /></button>
{/if}
</div>
{/if}
</section>
+62
View File
@@ -0,0 +1,62 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<script lang="ts">
import type { Snippet } from "svelte";
import Icon from "./Icon.svelte";
import type { IconName } from "./icons";
// Handoff §2.1: disabled is aria-disabled (it stays focusable and its reason is read through
// aria-describedby); pending keeps the label, adds a spinner and ignores clicks.
let {
variant = "quiet",
icon,
disabled = false,
pending = false,
describedby,
label,
small = false,
full = false,
type = "button",
onclick,
children,
...rest
}: {
variant?: "primary" | "quiet" | "outline" | "danger" | "link";
icon?: IconName;
disabled?: boolean;
pending?: boolean;
describedby?: string;
label?: string;
small?: boolean;
full?: boolean;
type?: "button" | "submit";
onclick?: (e: MouseEvent) => void;
children?: Snippet;
[key: string]: unknown;
} = $props();
function click(e: MouseEvent) {
if (disabled || pending) {
e.preventDefault();
return;
}
onclick?.(e);
}
</script>
<button
{type}
class="domi-btn {variant === 'quiet' ? '' : variant}"
class:small
class:full
aria-disabled={disabled || pending ? "true" : undefined}
aria-busy={pending ? "true" : undefined}
aria-describedby={describedby}
aria-label={label}
onclick={click}
{...rest}
>
{#if pending}<span class="spin" aria-hidden="true"></span>{:else if icon}<Icon name={icon} />{/if}
{@render children?.()}
</button>
+32
View File
@@ -0,0 +1,32 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<script lang="ts">
// Handoff §2.14: the technical text behind "Show details". It never holds a secret.
let { detail, reference }: { detail: string; reference?: string } = $props();
let open = $state(false);
const id = "det-" + Math.random().toString(36).slice(2, 9);
const text = $derived(detail + (reference ? `\nReference: ${reference}` : ""));
</script>
<div class="ia-details">
<button
type="button"
class="domi-btn link"
aria-expanded={open}
aria-controls={id}
onclick={() => (open = !open)}
>
{open ? "Hide details" : "Show details"}
</button>
{#if open}
<div {id}>
<pre>{text}</pre>
<button
type="button"
class="domi-btn small"
onclick={() => navigator.clipboard?.writeText(text)}>Copy details</button
>
</div>
{/if}
</div>
+73
View File
@@ -0,0 +1,73 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<script lang="ts">
import type { Snippet } from "svelte";
import { onMount } from "svelte";
import Icon from "./Icon.svelte";
// Handoff §2.9: a native <dialog>, modal (showModal) or not (the engine popover). Focus goes
// to the first field (or the element marked data-autofocus), and back to the opener on close.
let {
title,
kind = "dialog",
modal = true,
role,
onclose,
escape = true,
closable = true,
children,
footer,
}: {
title: string;
kind?: "dialog" | "panel" | "popover";
modal?: boolean;
role?: "dialog" | "alertdialog";
onclose: () => void;
escape?: boolean;
closable?: boolean;
children?: Snippet;
footer?: Snippet;
} = $props();
let el: HTMLDialogElement | undefined = $state();
const id = "dlg-" + Math.random().toString(36).slice(2, 9);
onMount(() => {
const opener = document.activeElement;
if (el) {
if (modal && typeof el.showModal === "function") el.showModal();
else if (typeof el.show === "function") el.show();
else el.setAttribute("open", "");
const first = el.querySelector<HTMLElement>(
"[data-autofocus], input:not([type=hidden]):not([readonly]):not([type=radio]), textarea, select",
);
(first ?? el.querySelector<HTMLElement>(".ia-dialog-title"))?.focus();
}
return () => {
if (opener instanceof HTMLElement && document.contains(opener)) opener.focus();
};
});
function cancel(e: Event) {
e.preventDefault();
if (escape) onclose();
}
</script>
<dialog
bind:this={el}
class="ia-dialog {kind === 'panel' ? 'ia-panel' : kind === 'popover' ? 'ia-popover' : ''}"
aria-labelledby={id}
{role}
oncancel={cancel}
>
<div class="ia-dialog-head">
<h2 class="ia-h3 ia-dialog-title" id={id} tabindex="-1">{title}</h2>
{#if closable}
<button type="button" class="ia-icon-btn" aria-label="Close" onclick={() => onclose()}><Icon name="close" /></button>
{/if}
</div>
<div class="ia-panel-body">{@render children?.()}</div>
{#if footer}<div class="ia-dialog-foot">{@render footer()}</div>{/if}
</dialog>
+10
View File
@@ -0,0 +1,10 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<script lang="ts">
import { ICONS, type IconName } from "./icons";
let { name, class: cls = "" }: { name: IconName; class?: string } = $props();
</script>
<svg class="ia-icon {cls}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d={ICONS[name]} /></svg>
+21
View File
@@ -0,0 +1,21 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<script lang="ts">
// Handoff §2.12: the value text follows the countdown; nothing is announced per second.
let { label, max, now, text }: { label: string; max: number; now: number; text: string } =
$props();
const pct = $derived(max > 0 ? Math.min(100, Math.max(0, (now / max) * 100)) : 0);
</script>
<div
class="ia-progress"
role="progressbar"
aria-label={label}
aria-valuemin="0"
aria-valuemax={max}
aria-valuenow={now}
aria-valuetext={text}
>
<span style="width: {pct}%"></span>
</div>
+45
View File
@@ -0,0 +1,45 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<script lang="ts" generics="T extends string">
// Handoff §2.10: a radio group in a fieldset; arrows move and select (native radios).
let {
legend,
name,
options,
value = $bindable(),
disabled = [],
describedby,
onchange,
}: {
legend: string;
name: string;
options: { value: T; label: string }[];
value: T;
disabled?: T[];
describedby?: string;
onchange?: (v: T) => void;
} = $props();
</script>
<fieldset class="domi-field" aria-describedby={describedby}>
<legend class="domi-field-label">{legend}</legend>
<div class="ia-seg">
{#each options as o (o.value)}
<label>
<input
type="radio"
{name}
value={o.value}
checked={value === o.value}
disabled={disabled.includes(o.value)}
onchange={() => {
value = o.value;
onchange?.(o.value);
}}
/>
{o.label}
</label>
{/each}
</div>
</fieldset>
+14
View File
@@ -0,0 +1,14 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<script lang="ts">
import Icon from "./Icon.svelte";
import type { StatusKind } from "./status";
// Handoff §2.2: always the pair, a shape and a word; the word is the accessible text.
let { kind, word }: { kind: StatusKind; word: string } = $props();
</script>
<span class="ia-status" data-s={kind}>
{#if kind === "kept"}<Icon name="check" />{:else if kind === "reverted"}<Icon name="undo" />{:else if kind === "running"}<Icon name="clock" />{:else}<span class="ia-dot" aria-hidden="true"></span>{/if}
<span class="word">{word}</span>
</span>
+196
View File
@@ -0,0 +1,196 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
/* The shared Domi components as drawn (docs/ui-handoff.md §2). Class names follow the
artifact: domi-* from the Domi system, ia-* for Ianitor. */
/* ── Fonts (self-hosted, OFL; §1.3) ─────────────────────────────────────── */
@import "@fontsource/cinzel/latin-500.css";
@import "@fontsource/cormorant-garamond/latin-500.css";
@import "@fontsource/cormorant-garamond/latin-600.css";
@import "@fontsource/manrope/latin-400.css";
@import "@fontsource/manrope/latin-600.css";
@import "@fontsource/manrope/latin-700.css";
.ia .sr-only {
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.ia .skip { position: absolute; left: 8px; top: -60px; z-index: 50; }
.ia .skip:focus { top: 8px; }
/* ── Type helpers ───────────────────────────────────────────────────────── */
.ia .ia-display { font-family: var(--font-book); font-weight: 500; font-size: var(--fs-display); line-height: var(--lh-display); }
.ia .ia-h2 { font-family: var(--font-book); font-weight: 500; font-size: var(--fs-h2); line-height: var(--lh-h2); }
.ia .ia-h3 { font-family: var(--font-book); font-weight: 600; font-size: var(--fs-h3); line-height: var(--lh-h3); }
.ia .ia-label { font-weight: 700; font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); }
.ia .ia-muted { color: var(--muted); }
.ia .ia-text2 { color: var(--text-2); }
.ia .ia-hint { color: var(--muted); font-size: var(--fs-hint); line-height: var(--lh-hint); }
.ia .ia-sub { color: var(--muted); font-size: var(--fs-sub); }
.ia .ia-wordmark { font-family: var(--font-inscription); font-weight: 500; font-size: var(--fs-wordmark); letter-spacing: var(--tracking-wordmark); color: var(--gilt); }
.ia .ia-code { font-family: var(--font-inscription); font-weight: 500; font-size: var(--fs-code); letter-spacing: 0.16em; color: var(--accent-strong); }
.ia b, .ia strong { font-weight: 700; color: var(--text); }
/* ── Buttons (§2.1) ─────────────────────────────────────────────────────── */
.ia .domi-btn {
display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
min-height: var(--target); padding: 0 1.1rem; border-radius: var(--radius-sm);
border: 1px solid var(--control-edge); background: transparent; color: var(--text-2);
font-weight: 600; font-size: var(--fs-button); cursor: pointer; text-decoration: none;
transition: border-color var(--dur-color) var(--ease), background var(--dur-color) var(--ease),
color var(--dur-color) var(--ease), box-shadow var(--dur-lift) var(--ease), transform var(--dur-lift) var(--ease);
}
.ia .domi-btn:hover:not([aria-disabled="true"]) { border-color: var(--accent); background: var(--hover-wash); color: var(--text); }
.ia .domi-btn.primary {
min-height: 50px; padding: 0 1.6rem; border-radius: var(--radius); border-color: var(--primary-edge);
background: linear-gradient(180deg, var(--primary-high) 0%, var(--primary-mid) 55%, var(--primary-low) 100%);
color: var(--on-primary); font-weight: 700; box-shadow: var(--leaf-bevel);
}
.ia .domi-btn.primary:hover:not([aria-disabled="true"]) { transform: translateY(-1px); color: var(--on-primary);
background: linear-gradient(180deg, var(--primary-high) 0%, var(--primary-mid) 55%, var(--primary-low) 100%); }
.ia .domi-btn.primary:focus-visible { outline: var(--focus-ring-primary); }
.ia .domi-btn.outline { border-color: var(--edge-outline); color: var(--accent); }
.ia .domi-btn.danger { border-color: var(--edge-down); color: var(--danger); }
.ia .domi-btn.danger:hover:not([aria-disabled="true"]) { background: var(--danger-hover); border-color: var(--danger); color: var(--danger); }
.ia .domi-btn.link {
border: 0; padding: 0.6rem 0; min-height: var(--target); background: none; color: var(--accent);
text-decoration: underline; text-underline-offset: 0.2em; font-weight: 600;
}
.ia .domi-btn.small { min-height: 36px; padding: 0 0.8rem; }
.ia .domi-btn.full { width: 100%; }
.ia .domi-btn[aria-disabled="true"] { color: var(--disabled); border-color: var(--hairline); cursor: not-allowed; box-shadow: none; background: transparent; }
.ia .domi-btn.primary[aria-disabled="true"] { background: var(--surface-2); color: var(--disabled); }
.ia .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ia-spin 0.8s linear infinite; }
@keyframes ia-spin { to { transform: rotate(360deg); } }
.ia .ia-icon-btn {
display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
border-radius: var(--radius-sm); border: 1px solid transparent; background: none; color: var(--text-2); cursor: pointer;
}
.ia .ia-icon-btn:hover { border-color: var(--control-edge); color: var(--text); }
.ia svg.ia-icon { width: 18px; height: 18px; flex: none; }
/* ── Status (§2.2) ──────────────────────────────────────────────────────── */
.ia .ia-status { display: inline-flex; align-items: center; gap: 8px; }
.ia .ia-status .word { font-weight: 700; font-size: var(--fs-state); font-variant-caps: all-small-caps; letter-spacing: var(--tracking-state); }
.ia .ia-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; }
.ia [data-s="healthy"] .ia-dot { background: var(--healthy); }
.ia [data-s="healthy"] .word, .ia [data-s="kept"] .word, .ia [data-s="kept"] svg { color: var(--healthy); }
.ia [data-s="degraded"] .ia-dot { border: 2px solid var(--degraded); background: linear-gradient(90deg, var(--degraded) 50%, transparent 50%); }
.ia [data-s="degraded"] .word, .ia [data-s="reverted"] .word, .ia [data-s="reverted"] svg { color: var(--degraded); }
.ia [data-s="down"] .ia-dot { border: 3px solid var(--down); }
.ia [data-s="down"] .word { color: var(--down); }
.ia [data-s="unknown"] .ia-dot { border: 2px dashed var(--unknown); }
.ia [data-s="unknown"] .word { color: var(--muted); }
.ia [data-s="running"] .word, .ia [data-s="running"] svg { color: var(--running); }
/* ── Chips (§2.3) ───────────────────────────────────────────────────────── */
.ia .ia-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ia .ia-chip { border: 1px solid var(--hairline-strong); border-radius: var(--radius-pill); color: var(--text-2); font-size: var(--fs-chip); padding: 1px 10px; white-space: nowrap; }
/* ── Engine chip (§2.4) ─────────────────────────────────────────────────── */
.ia .ia-engine {
display: inline-flex; align-items: center; gap: 8px; min-height: var(--target); padding: 0 16px 0 14px;
border: 1px solid var(--control-edge); border-radius: var(--radius-pill); background: var(--surface);
color: var(--text); font-weight: 600; font-size: 0.92rem; cursor: pointer;
}
.ia .ia-engine small { color: var(--muted); font-weight: 400; font-size: 0.86rem; }
/* ── Lists and rows (§2.5) ──────────────────────────────────────────────── */
.ia .ia-list { border: 1px solid var(--hairline); border-radius: var(--radius-lg); overflow: hidden; }
.ia .ia-row { display: grid; grid-template-columns: 128px minmax(0, 1.4fr) minmax(0, 1.6fr) 44px; gap: 16px; padding: 12px 10px 12px 18px; align-items: start; border-top: 1px solid var(--hairline); }
.ia .ia-row:first-child { border-top: 0; }
.ia .ia-row.head { background: var(--colonnade); padding-top: 10px; padding-bottom: 10px; align-items: center; }
.ia .ia-host { font-weight: 600; font-size: var(--fs-host); overflow-wrap: anywhere; }
.ia .ia-row .problem { color: var(--text-2); }
@media (max-width: 719.98px) {
.ia .ia-row { grid-template-columns: minmax(0, 1fr) 44px; padding: 12px 6px 12px 14px; gap: 8px; }
.ia .ia-row.head { display: none; }
.ia .ia-row .col-status { display: none; }
}
/* ── Menu (§2.6) ────────────────────────────────────────────────────────── */
.ia .ia-menu-wrap { position: relative; }
.ia .ia-menu {
position: absolute; right: 0; top: 46px; z-index: 20; min-width: 250px; margin: 0; padding: 6px; list-style: none;
background: var(--colonnade); border: 1px solid var(--hairline-strong); border-radius: var(--radius); box-shadow: var(--shadow-dialog);
}
.ia .ia-menu [role="menuitem"] {
display: flex; gap: 10px; align-items: center; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-sm);
background: none; color: var(--text-2); font-weight: 600; font-size: 0.92rem; text-align: left; cursor: pointer;
}
.ia .ia-menu [role="menuitem"]:hover, .ia .ia-menu [role="menuitem"]:focus { background: var(--surface-2); color: var(--text); outline: none; }
.ia .ia-menu [role="menuitem"].danger { color: var(--danger); }
.ia .ia-menu [role="menuitem"][aria-disabled="true"] { color: var(--disabled); cursor: not-allowed; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.ia .ia-menu .reason { flex-basis: 100%; padding-left: 28px; font-weight: 400; font-size: var(--fs-sub); color: var(--muted); }
.ia .ia-menu hr { border: 0; border-top: 1px solid var(--hairline); margin: 4px 0; }
/* ── Bar, banners (§2.7, §2.8) ──────────────────────────────────────────── */
.ia .ia-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px 10px 18px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); }
.ia .ia-bar .grow { flex: 1 1 260px; min-width: 0; }
.ia .ia-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 18px; border-radius: var(--radius-lg); border: 1px solid var(--edge-degraded); background: var(--wash-degraded); }
.ia .ia-banner.kept { border-color: var(--edge-kept); background: var(--wash-kept); }
.ia .ia-banner.down { border-color: var(--edge-down); background: var(--wash-down); }
.ia .ia-banner .ia-banner-icon { width: 22px; height: 22px; color: var(--degraded); }
.ia .ia-banner.kept .ia-banner-icon { color: var(--kept); }
.ia .ia-banner.down .ia-banner-icon { color: var(--down); }
.ia .ia-banner .body { flex: 1 1 280px; min-width: 0; }
.ia .ia-banner .line2 { color: var(--text-2); font-size: 0.9rem; }
.ia .ia-banner .actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
@media (max-width: 719.98px) { .ia .ia-banner { padding: 12px 14px; } }
/* ── Dialogs, panel, popover, sheets (§2.9) ─────────────────────────────── */
.ia dialog.ia-dialog {
background: var(--colonnade); color: var(--text); border: 1px solid var(--hairline-strong); border-radius: var(--radius-lg);
box-shadow: var(--shadow-dialog); padding: 22px 24px; width: min(var(--dialog-w), calc(100vw - 32px)); max-height: 90dvh;
}
.ia dialog.ia-dialog::backdrop { background: var(--scrim); }
.ia dialog.ia-dialog[open] { display: flex; flex-direction: column; gap: 14px; animation: ia-enter var(--dur-enter) var(--ease); }
.ia dialog.ia-panel { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(var(--panel-w), 100vw); border-radius: 0; border-width: 0 0 0 1px; }
.ia dialog.ia-popover { position: fixed; inset: 70px 32px auto auto; margin: 0; width: min(var(--popover-w), calc(100vw - 32px)); z-index: 30; }
.ia .ia-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ia .ia-dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); margin-top: auto; padding-top: 12px; }
.ia .ia-panel-body { display: flex; flex-direction: column; gap: 16px; overflow: auto; flex: 1; }
@keyframes ia-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 719.98px) {
.ia dialog.ia-dialog, .ia dialog.ia-popover { margin: auto 0 0 0; inset: auto 0 0 0; width: 100vw; max-width: 100vw; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.ia dialog.ia-panel { width: 100vw; border-radius: 0; }
}
/* ── Fields (§2.10) ─────────────────────────────────────────────────────── */
.ia .domi-field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.ia .domi-field-label, .ia legend.domi-field-label { color: var(--text-2); font-size: var(--fs-field-label); padding: 0; }
.ia .domi-input, .ia select.domi-input, .ia textarea.domi-input {
min-height: var(--target); background: var(--surface); color: var(--text); border: 1px solid var(--control-edge);
border-radius: var(--radius-sm); box-shadow: var(--carved); padding: 0.55rem 0.8rem; font: inherit; width: 100%;
}
.ia .domi-input:hover { border-color: var(--muted); }
.ia .domi-input:focus, .ia .domi-input:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--carved), var(--focus-halo); }
.ia .domi-input[aria-invalid="true"] { border-color: var(--danger); }
.ia .domi-error { color: var(--danger); font-size: var(--fs-hint); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.ia fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ia .ia-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--control-edge); border-radius: var(--radius-sm); background: var(--surface); }
.ia .ia-seg label { display: inline-flex; align-items: center; min-height: 38px; padding: 0 0.9rem; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.ia .ia-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ia .ia-seg label:has(input:checked) { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.ia .ia-seg label:has(input:focus-visible) { outline: var(--focus-ring); outline-offset: 2px; }
.ia .ia-seg label:has(input:disabled) { color: var(--disabled); cursor: not-allowed; }
.ia .ia-check { display: flex; align-items: center; gap: 10px; min-height: var(--target); }
.ia .ia-check input { width: 20px; height: 20px; accent-color: var(--accent); }
/* ── Toasts, progress, secret, details (§2.11–2.14) ─────────────────────── */
.ia .ia-toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); }
.ia .ia-toast { display: flex; gap: 10px; align-items: center; background: var(--colonnade); border: 1px solid var(--hairline-strong); border-radius: var(--radius); box-shadow: var(--shadow-dialog); padding: 12px 16px; }
@media (max-width: 719.98px) { .ia .ia-toasts { right: 16px; left: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); } }
.ia .ia-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.ia .ia-progress > span { display: block; height: 100%; background: var(--accent); transition: width var(--dur-tick) linear; }
.ia .ia-secret { display: block; width: 100%; background: var(--surface); border: 1px solid var(--control-edge); border-radius: var(--radius-sm); box-shadow: var(--carved); padding: 12px 14px; font-weight: 600; letter-spacing: 0.02em; word-break: break-all; color: var(--text); font: inherit; }
.ia .ia-details pre { background: var(--surface); border-radius: var(--radius-sm); color: var(--muted); font-size: var(--fs-sub); white-space: pre-wrap; padding: 10px 12px; margin: 6px 0; }
.ia .ia-frame { border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 32px; text-align: center; }
.ia .ia-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px 14px; }
.ia .ia-ornament { max-width: 360px; margin: 8px auto; border: 0; border-top: 1px dotted var(--bronze); opacity: 0.6; }
.ia .ia-placeholder { background: var(--surface-2); border-radius: 6px; height: 14px; }
.ia .ia-qr { background: #fff; padding: 16px; border-radius: var(--radius); width: max-content; }
.ia .ia-qr svg { width: 240px; height: 240px; display: block; }
.ia .ia-cmd { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.86rem; }
+30
View File
@@ -0,0 +1,30 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
/** The stroke icons of the design (handoff §2.1), as SVG path data on a 24-unit grid. */
export const ICONS = {
plus: "M12 5v14M5 12h14",
undo: "M9 14 4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3",
check: "M5 12.5l4.5 4.5L19 7.5",
clock: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 7v5l3 2",
link: "M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1",
pencil: "M4 20h4L19 9l-4-4L4 16v4ZM14 6l4 4",
history: "M3 12a9 9 0 1 0 3-6.7L3 8M3 3v5h5M12 7v5l3 2",
trash: "M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13",
key: "M15 9a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM12 12v9M12 17h3M12 20h2",
gear: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1",
building: "M4 21V5l8-3 8 3v16M9 21v-5h6v5M8 8h2M14 8h2M8 12h2M14 12h2",
swap: "M7 7h13l-4-4M17 17H4l4 4",
copy: "M9 9h11v11H9zM5 15H4V4h11v1",
chevron: "M6 9l6 6 6-6",
dots: "M5 12h.01M12 12h.01M19 12h.01",
close: "M6 6l12 12M18 6 6 18",
ring: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM5.6 18.4 18.4 5.6",
phone: "M8 3h8v18H8zM11 18h2",
laptop: "M5 5h14v10H5zM3 19h18",
app: "M5 5h6v6H5zM13 5h6v6h-6zM5 13h6v6H5zM13 13h6v6h-6z",
shield: "M12 3 5 6v6c0 4 3 7.5 7 9 4-1.5 7-5 7-9V6l-7-3Z",
} as const;
export type IconName = keyof typeof ICONS;
+14
View File
@@ -0,0 +1,14 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
export { default as Icon } from "./Icon.svelte";
export { default as Button } from "./Button.svelte";
export { default as Status } from "./Status.svelte";
export { default as Banner } from "./Banner.svelte";
export { default as Dialog } from "./Dialog.svelte";
export { default as Segmented } from "./Segmented.svelte";
export { default as Progress } from "./Progress.svelte";
export { default as Details } from "./Details.svelte";
export type { IconName } from "./icons";
export type { StatusKind } from "./status";
+13
View File
@@ -0,0 +1,13 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
/** The status kinds of handoff §2.2. */
export type StatusKind =
| "healthy"
| "kept"
| "degraded"
| "reverted"
| "down"
| "unknown"
| "running";
+150
View File
@@ -0,0 +1,150 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
/* Design tokens of the dark Domi theme, murex palette (docs/ui-handoff.md §1.1, verbatim). */
.ia {
/* ── Ground and structure: violet-tinted iron black ───────────────────── */
--ground: #0c0b0f; /* page ground; every ratio is measured on it */
--colonnade: #121016; /* sidebar, phone bars, menus, dialogs, side panel */
--surface: #18151d; /* fields, the last-change bar, cards */
--surface-2: #221d28; /* hover, the current place, a chosen option */
--hairline: #2c2633; /* dividers only, never a control edge */
--hairline-strong: #3c3445; /* chip and frame edges (facts, not controls) */
--control-edge: #7d7189; /* edge of every field, button, segmented control, engine chip */
/* ── Text ──────────────────────────────────────────────────────────────── */
--text: #f1edf3; /* body text, hostnames */
--text-2: #cfc6d4; /* secondary text, field labels */
--muted: #a99eb1; /* hints, section labels, times */
--disabled: #7a7183; /* disabled controls only, never content */
/* ── The lead: murex (Tyrian purple) ───────────────────────────────────── */
--accent: #e0a3dc; /* links, focus ring, the current place, running state */
--accent-strong: #f2c9ee; /* focus ring on the primary button; match codes */
--primary-high: #8d3b89; /* primary fill, top */
--primary-mid: #76306f; /* primary fill, 55 % */
--primary-low: #5c2257; /* primary fill, foot */
--primary-edge: #c77cc1; /* primary button edge */
--on-primary: #ffffff; /* label on the primary fill */
/* ── Metal ─────────────────────────────────────────────────────────────── */
--bronze: #b6adbe; /* ornaments: the interpunct rule (iron, not bronze) */
--gilt: #f6f0f7; /* the wordmark only */
/* ── Second light: quiet iron (Domi's .domi-pill and .domi-status use these) */
--second: #cfc6d4;
--second-strong: #f1edf3;
--second-edge: #7d7189;
/* ── Status: blue / amber / vermilion, stepped in lightness (L* 84 / 68 / 58) */
--healthy: #a6d6fa; /* host answers; a change was kept. Filled dot. */
--kept: #a6d6fa;
--degraded: #d99a35; /* partly failing; a change was reverted or not applied. Half dot. */
--reverted: #d99a35;
--down: #e2683a; /* not reachable; needs attention; paused; danger actions. Hollow ring. */
--danger: #e2683a;
--on-danger: #170804; /* text on a filled danger button (none is planned) */
--unknown: #a99eb1; /* no health check set; waiting for first check. Dashed ring. */
--running: #e0a3dc; /* queued, applying, watching, switching, waiting for Custos (= accent) */
/* Status washes (banner backgrounds) and edges. color-mix() is what the artifact uses;
the resolved hex is in the comment, for tools that need a literal. */
--wash-degraded: color-mix(in srgb, var(--degraded) 10%, var(--ground)); /* #201913 */
--wash-kept: color-mix(in srgb, var(--kept) 10%, var(--ground)); /* #1b1f26 */
--wash-down: color-mix(in srgb, var(--down) 10%, var(--ground)); /* #211413 */
--edge-degraded: color-mix(in srgb, var(--degraded) 65%, var(--ground)); /* #916828 */
--edge-kept: color-mix(in srgb, var(--kept) 65%, var(--ground)); /* #708fa8 */
--edge-down: color-mix(in srgb, var(--down) 80%, var(--ground)); /* #b75531 */
--edge-outline: color-mix(in srgb, var(--accent) 60%, var(--ground)); /* #8b668a, outline button */
--hover-wash: color-mix(in srgb, var(--accent) 8%, transparent); /* quiet button hover */
--danger-hover: color-mix(in srgb, var(--danger) 7%, transparent);
/* ── Type ──────────────────────────────────────────────────────────────── */
--font-inscription: Cinzel, "Trajan Pro", "Cormorant Garamond", Georgia, "Times New Roman", serif;
--font-book: "Cormorant Garamond", Cormorant, "EB Garamond", Garamond, Georgia, "Times New Roman", serif;
--font-hand: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
--fs-display: 2.6rem; --lh-display: 1.1; /* book 500: a view title ("Hosts") */
--fs-h2: 1.9rem; --lh-h2: 1.15; /* book 500: panel title; phone view title uses 2.1rem */
--fs-h3: 1.45rem; --lh-h3: 1.15; /* book 600: dialog and section titles */
--fs-body: 0.9375rem; --lh-body: 1.6; /* hand 400: everything read (15 px) */
--fs-host: 0.98rem; /* hand 600: hostname in a row */
--fs-button: 0.95rem; /* hand 600; 700 on primary */
--fs-field-label: 0.92rem; /* hand 400, text-2 */
--fs-hint: 0.88rem; --lh-hint: 1.5; /* hand 400, muted: hints, notes */
--fs-sub: 0.86rem; /* hand 400, muted: row sub-lines, times */
--fs-chip: 0.78rem; /* 12.5 px, hand 400, text-2 */
--fs-state: 0.95rem; /* hand 700, all-small-caps, tracking 0.12em */
--fs-label: 0.74rem; /* hand 700, tracking 0.26em: SECTION LABELS */
--fs-nav: 0.95rem; /* sidebar item, hand 600 */
--fs-tab-phone: 0.78rem; /* bottom-bar label, hand 600 */
--fs-wordmark: 0.8125rem; /* 13 px Cinzel 500, tracking 0.3em; phone 12 px, 0.26em */
--fs-code: 2.2rem; /* Cinzel 500, tracking 0.16em: Custos match code */
--tracking-state: 0.12em;
--tracking-label: 0.26em;
--tracking-wordmark: 0.3em;
/* ── Spacing (Domi) ────────────────────────────────────────────────────── */
--space-1: 0.35rem; /* label to its field */
--space-2: 0.6rem; /* between buttons in a row, list items */
--space-3: 1rem; /* field to field */
--space-4: 1.4rem; /* panel padding */
--space-5: 2rem; /* between sections of a view */
--space-6: 3.5rem; /* a view's bottom padding */
--target: 44px; /* minimum height and width of every control and touch target */
/* ── Radii ─────────────────────────────────────────────────────────────── */
--radius-chip: 6px;
--radius-sm: 10px; /* quiet buttons, fields, nav items, menu items */
--radius: 12px; /* primary button, cards inside panels */
--radius-lg: 18px; /* panels, banners, the bar, the host list, dialogs */
--radius-pill: 999px; /* chips, the engine chip */
/* ── Shadows ───────────────────────────────────────────────────────────── */
--leaf-bevel: 0 0 0 1px rgba(199,124,193,0.25), 0 12px 40px -14px rgba(141,59,137,0.6),
inset 0 1px 0 rgba(255,220,250,0.30), inset 0 -2px 0 #3a1237; /* primary button */
--carved: inset 0 2px 6px rgba(12,11,15,0.8), inset 0 -1px 0 rgba(182,173,190,0.16); /* fields */
--inset-lit: inset 0 0 18px rgba(224,163,220,0.07); /* current nav item */
--shadow-dialog: 0 40px 100px -40px rgba(0,0,0,0.95); /* dialogs, menus, popover */
--scrim: rgba(12,11,15,0.82); /* behind modals */
/* ── Focus ─────────────────────────────────────────────────────────────── */
--focus-ring: 2px solid var(--accent); /* outline, offset 3px, on every :focus-visible */
--focus-ring-primary: 2px solid var(--accent-strong);
--focus-offset: 3px;
--focus-halo: 0 0 0 4px rgba(224,163,220,0.16); /* fields: border goes accent, plus this halo */
/* ── Motion (Domi's transitions; the last three are new for this UI) ──── */
--dur-color: 0.3s; /* border, background, colour */
--dur-lift: 0.45s; /* box-shadow, transform (primary hover lifts 1px) */
--ease: ease;
--dur-tick: 1s; /* watch progress bar: linear, one step per second */
--dur-enter: 0.18s; /* dialog, panel, menu, toast enter (opacity + 8px) */
--dur-exit: 0.12s;
/* ── Layout ────────────────────────────────────────────────────────────── */
--sidebar-w: 232px;
--main-pad: 26px 32px 40px; /* desktop; phone 18px 16px 20px */
--gutter-phone: 16px;
--panel-w: 480px; /* add/edit host side panel */
--dialog-w: 520px; /* share, token, device dialogs */
--popover-w: 420px; /* engine popover */
--phone-bar-h: 56px; /* bottom navigation item height */
--bp-phone: 720px; /* below: phone layout (header + bottom bar) */
color-scheme: dark;
background: var(--ground);
color: var(--text);
font-family: var(--font-hand);
font-size: var(--fs-body);
line-height: var(--lh-body);
font-variant-numeric: tabular-nums;
}
.ia *, .ia *::before, .ia *::after { box-sizing: border-box; }
.ia :focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.ia h1, .ia h2, .ia h3, .ia p { margin: 0; }
.ia button { font: inherit; }
@media (prefers-reduced-motion: reduce) {
.ia *, .ia *::before, .ia *::after { animation: none !important; transition: none !important; }
}