[web] Domi UI: the web UI on @domi/ui v1.0.0 (fonts, roles, Button, TextField with seals, Checkbox, Select, Segmented)

This commit is contained in:
2026-11-22 23:24:03 +01:00
parent 8b4570ca1a
commit afade6d98c
24 changed files with 356 additions and 380 deletions
+26 -24
View File
@@ -3,11 +3,17 @@
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<script lang="ts">
import type { Snippet } from "svelte";
import { Button as DomiButton } from "@domi/ui";
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.
// Ianitor's buttons are @domi/ui's Button (struck plate, leaf, states, 48 px on touch). This maps Ianitor's props
// onto it, so the sizes on a desktop stay as they were: an ordinary button 44 px (lg), the primary 50 px (xl),
// a small one 34 px (md). quiet and outline were both bordered buttons here; they are the plate now.
// pending the button shows its work (status loading); a second press does nothing
// disabled not pressable; say elsewhere why (describedby points at that text)
// label the accessible name when it says more than the words ("+ Host" is "Add a host")
// icon one of Ianitor's icons, before the words
let {
variant = "quiet",
icon,
@@ -22,7 +28,7 @@
children,
...rest
}: {
variant?: "primary" | "quiet" | "outline" | "danger" | "link";
variant?: "primary" | "quiet" | "outline" | "danger";
icon?: IconName;
disabled?: boolean;
pending?: boolean;
@@ -31,32 +37,28 @@
small?: boolean;
full?: boolean;
type?: "button" | "submit";
onclick?: (e: MouseEvent) => void;
onclick?: (e: MouseEvent) => unknown;
children?: Snippet;
[key: string]: unknown;
} = $props();
function click(e: MouseEvent) {
if (disabled || pending) {
e.preventDefault();
return;
}
onclick?.(e);
}
const uid = $props.id();
const nameId = `ia-btn-name-${uid}`;
const domiVariant = $derived(variant === "primary" ? "primary" : variant === "danger" ? "danger" : "plate");
const size = $derived(small ? "md" : variant === "primary" ? "xl" : "lg");
</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}
<DomiButton
{...rest}
variant={domiVariant}
{size}
{type}
block={full}
{disabled}
status={pending ? "loading" : undefined}
aria-describedby={describedby}
aria-labelledby={label ? nameId : undefined}
{onclick}
>
{#if pending}<span class="spin" aria-hidden="true"></span>{:else if icon}<Icon name={icon} />{/if}
{@render children?.()}
</button>
{#if icon}<Icon name={icon} />{/if}{@render children?.()}{#if label}<span id={nameId} hidden>{label}</span>{/if}
</DomiButton>
+19 -22
View File
@@ -2,10 +2,14 @@
- 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).
import { Segmented as DomiSegmented } from "@domi/ui";
// Handoff §2.10: a few choices of one thing, with its name shown above them. The control is @domi/ui's Segmented
// (a radio group with one Tab stop; arrows, Home and End move the choice); Ianitor keeps the visible name.
// `name` is kept for the call sites; @domi/ui's group needs none.
let {
legend,
name,
name: _name,
options,
value = $bindable(),
disabled = [],
@@ -20,26 +24,19 @@
describedby?: string;
onchange?: (v: T) => void;
} = $props();
const uid = $props.id();
const choices = $derived(options.map((o) => ({ value: o.value, label: o.label, disabled: disabled.includes(o.value) })));
</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 class="ia-field" role="group" aria-labelledby="ia-seg-{uid}" aria-describedby={describedby}>
<span class="ia-field-label" id="ia-seg-{uid}">{legend}</span>
<div>
<DomiSegmented
label={legend}
options={choices}
bind:value={() => value, (v) => (value = v as T)}
onchange={(v) => onchange?.(v as T)}
/>
</div>
</fieldset>
</div>
+59 -103
View File
@@ -2,23 +2,8 @@
* 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";
/* latin-ext: Czech names and places (č, ř, ů) in host names, device names and messages. */
@import "@fontsource/cinzel/latin-ext-500.css";
@import "@fontsource/cormorant-garamond/latin-ext-500.css";
@import "@fontsource/cormorant-garamond/latin-ext-600.css";
@import "@fontsource/manrope/latin-ext-400.css";
@import "@fontsource/manrope/latin-ext-600.css";
@import "@fontsource/manrope/latin-ext-700.css";
/* Ianitor's own components as drawn (docs/ui-handoff.md §2), on top of @domi/ui. The controls (buttons, fields,
segmented controls, checkboxes, selects) and the fonts are @domi/ui's (domi-*); everything here is ia-*. */
html, body { margin: 0; }
@@ -33,89 +18,65 @@ html, body { margin: 0; }
.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-label { font-weight: 700; font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--domi-muted); }
.ia .ia-muted { color: var(--domi-muted); }
.ia .ia-text2 { color: var(--domi-fg-2); }
.ia .ia-hint { color: var(--domi-muted); font-size: var(--fs-hint); line-height: var(--lh-hint); }
.ia .ia-sub { color: var(--domi-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); }
.ia .ia-code { font-family: var(--font-inscription); font-weight: 500; font-size: var(--fs-code); letter-spacing: 0.16em; color: var(--domi-accent-strong); }
.ia b, .ia strong { font-weight: 700; color: var(--domi-fg); }
/* ── 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);
/* A button that reads as a link: an action inside a sentence or under a field ("Use wiki.home.test", "Add a rule"). */
.ia .ia-link {
display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; border: 0; padding: 0.6rem 0; min-height: var(--target);
background: none; color: var(--domi-accent); font: inherit; font-weight: 600; font-size: var(--fs-button);
text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer;
}
.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;
border-radius: var(--radius-sm); border: 1px solid transparent; background: none; color: var(--domi-fg-2); cursor: pointer;
}
.ia .ia-icon-btn:hover { border-color: var(--control-edge); color: var(--text); }
.ia .ia-icon-btn:hover { border-color: var(--domi-edge); color: var(--domi-fg); }
.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="healthy"] .ia-dot { background: var(--domi-ok); }
.ia [data-s="healthy"] .word, .ia [data-s="kept"] .word, .ia [data-s="kept"] svg { color: var(--domi-ok); }
.ia [data-s="degraded"] .ia-dot { border: 2px solid var(--domi-warning); background: linear-gradient(90deg, var(--domi-warning) 50%, transparent 50%); }
.ia [data-s="degraded"] .word, .ia [data-s="reverted"] .word, .ia [data-s="reverted"] svg { color: var(--domi-warning); }
.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="unknown"] .word { color: var(--domi-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; }
.ia .ia-chip { border: 1px solid var(--hairline-strong); border-radius: var(--radius-pill); color: var(--domi-fg-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;
border: 1px solid var(--domi-edge); border-radius: var(--radius-pill); background: var(--domi-panel);
color: var(--domi-fg); font-weight: 600; font-size: 0.92rem; cursor: pointer;
}
.ia .ia-engine small { color: var(--muted); font-weight: 400; font-size: 0.86rem; }
.ia .ia-engine small { color: var(--domi-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); }
.ia .ia-list { border: 1px solid var(--domi-line); border-radius: var(--radius-lg); }
/* No overflow clipping on the list: a row's menu must reach past it. The end rows carry the corners. */
.ia .ia-list > :first-child { border-top-left-radius: calc(var(--radius-lg) - 1px); border-top-right-radius: calc(var(--radius-lg) - 1px); }
.ia .ia-list > :last-child { border-bottom-left-radius: calc(var(--radius-lg) - 1px); border-bottom-right-radius: calc(var(--radius-lg) - 1px); }
.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 { 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(--domi-line); }
.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-row.head { background: var(--domi-chrome); 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); }
.ia .ia-row .problem { color: var(--domi-fg-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; }
@@ -126,36 +87,36 @@ html, body { margin: 0; }
.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);
background: var(--domi-chrome); 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;
background: none; color: var(--domi-fg-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"]:hover, .ia .ia-menu [role="menuitem"]:focus { background: var(--domi-hover); color: var(--domi-fg); outline: none; }
.ia .ia-menu [role="menuitem"]:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
.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; }
.ia .ia-menu [role="menuitem"].danger { color: var(--domi-danger); }
.ia .ia-menu [role="menuitem"][aria-disabled="true"] { color: var(--domi-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(--domi-muted); }
.ia .ia-menu hr { border: 0; border-top: 1px solid var(--domi-line); 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 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px 10px 18px; background: var(--domi-panel); border: 1px solid var(--domi-line); 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 .ia-banner-icon { width: 22px; height: 22px; color: var(--domi-warning); }
.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 .line2 { color: var(--domi-fg-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);
background: var(--domi-chrome); color: var(--domi-fg); 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); }
@@ -172,38 +133,33 @@ html, body { margin: 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);
/* Text fields, checkboxes, selects and segmented controls are @domi/ui's. Here: a group of controls with its label,
an error under a field, and the inputs @domi/ui 1.0 leaves to the app (a number, a file). */
.ia .ia-field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
/* The same words as @domi/ui's field label (.domi-field__label), so a form's labels read as one. */
.ia .ia-field-label { color: var(--domi-fg-2); font: 600 13px/18px var(--domi-font-hand); padding: 0; }
.ia .ia-input {
min-height: var(--target); background: var(--domi-panel); color: var(--domi-fg); border: 1px solid var(--domi-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 .ia-input:hover { border-color: var(--domi-muted); }
.ia .ia-input:focus, .ia .ia-input:focus-visible { outline: none; border-color: var(--domi-accent); box-shadow: var(--carved), var(--focus-halo); }
.ia .ia-input[aria-invalid="true"] { border-color: var(--domi-danger); }
.ia .ia-error { color: var(--domi-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; }
.ia .ia-toast { display: flex; gap: 10px; align-items: center; background: var(--domi-chrome); 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: inherit; font-weight: 600; letter-spacing: 0.02em; word-break: break-all; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--text); resize: none; }
.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-progress { height: 6px; border-radius: 3px; background: var(--domi-hover); overflow: hidden; }
.ia .ia-progress > span { display: block; height: 100%; background: var(--domi-accent); transition: width var(--dur-tick) linear; }
.ia .ia-secret { display: block; width: 100%; background: var(--domi-panel); border: 1px solid var(--domi-edge); border-radius: var(--radius-sm); box-shadow: var(--carved); padding: 12px 14px; font: inherit; font-weight: 600; letter-spacing: 0.02em; word-break: break-all; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--domi-fg); resize: none; }
.ia .ia-details pre { background: var(--domi-panel); border-radius: var(--radius-sm); color: var(--domi-muted); font-size: var(--fs-sub); white-space: pre-wrap; padding: 10px 12px; margin: 6px 0; }
.ia .ia-frame { border: 1px solid var(--domi-line); border-radius: var(--radius-lg); padding: 32px; text-align: center; }
.ia .ia-card { background: var(--domi-panel); border: 1px solid var(--domi-line); 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-placeholder { background: var(--domi-hover); 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 -60
View File
@@ -2,68 +2,40 @@
* 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). */
/* Ianitor's own tokens, on top of @domi/ui (docs/ui-handoff.md §1.1). The roles (ground, text, the murex
accent and leaf, ok, warning, danger) come from @domi/ui: data-domi-room="ianitor" on <html> gives them Ianitor's
values, the same hex as before (domi-design docs/PALETTE.md). What is here is Ianitor's alone: status names,
washes, type sizes, spacing, radii and layout. */
.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 */
/* ── Structure and metal Ianitor adds to the roles ───────────────────── */
--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;
/* ── Second light: quiet iron ───────────────────────────────────────────── */
--second-strong: var(--domi-fg);
--second-edge: var(--domi-edge);
/* ── 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) */
--kept: var(--domi-ok); /* host answers; a change was kept. Filled dot. */
--reverted: var(--domi-warning); /* partly failing; a change was reverted or not applied. Half dot. */
--down: var(--domi-danger); /* not reachable; needs attention; paused; danger actions. Hollow ring. */
--unknown: var(--domi-muted); /* no health check set; waiting for first check. Dashed ring. */
--running: var(--domi-accent); /* queued, applying, watching, switching, waiting for Custos */
/* 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);
/* Status washes (banner backgrounds) and edges. */
--wash-degraded: color-mix(in srgb, var(--domi-warning) 10%, var(--domi-bg)); /* #201913 */
--wash-kept: color-mix(in srgb, var(--kept) 10%, var(--domi-bg)); /* #1b1f26 */
--wash-down: color-mix(in srgb, var(--down) 10%, var(--domi-bg)); /* #211413 */
--edge-degraded: color-mix(in srgb, var(--domi-warning) 65%, var(--domi-bg)); /* #916828 */
--edge-kept: color-mix(in srgb, var(--kept) 65%, var(--domi-bg)); /* #708fa8 */
--edge-down: color-mix(in srgb, var(--down) 80%, var(--domi-bg)); /* #b75531 */
--hover-wash: color-mix(in srgb, var(--domi-accent) 8%, transparent); /* menu and nav hover */
/* ── 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;
/* ── Type: the three Domi faces come from @domi/ui (bundled, nothing fetched) */
--font-inscription: var(--domi-font-inscription);
--font-book: var(--domi-font-book);
--font-hand: var(--domi-font-hand);
--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 */
@@ -110,8 +82,8 @@
--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-ring: 2px solid var(--domi-accent); /* outline, offset 3px, on every :focus-visible */
--focus-ring-primary: 2px solid var(--domi-accent-strong);
--focus-offset: 3px;
--focus-halo: 0 0 0 4px rgba(224,163,220,0.16); /* fields: border goes accent, plus this halo */
@@ -134,8 +106,8 @@
--bp-phone: 720px; /* below: phone layout (header + bottom bar) */
color-scheme: dark;
background: var(--ground);
color: var(--text);
background: var(--domi-bg);
color: var(--domi-fg);
font-family: var(--font-hand);
font-size: var(--fs-body);
line-height: var(--lh-body);
@@ -145,6 +117,4 @@
.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; }
}
/* Reduced motion: @domi/ui base.css (every duration 0; every state still shown). */