6 Commits

77 changed files with 8603 additions and 381 deletions
+2 -1
View File
@@ -9,7 +9,8 @@ crates/core config model, schema, compilers (Pingora runtime + Caddy JSON),
crates/edge Pingora data plane. Reads compiled config, serves traffic. Never decides policy. crates/edge Pingora data plane. Reads compiled config, serves traffic. Never decides policy.
crates/control API, git routes repo, apply/rollback, share links, PKI flows. Loopback only. Never serves public traffic. crates/control API, git routes repo, apply/rollback, share links, PKI flows. Loopback only. Never serves public traffic.
apps/web Svelte 5 (runes, TypeScript strict). A client of the API; no logic. apps/web Svelte 5 (runes, TypeScript strict). A client of the API; no logic.
packages/ui shared dark Domi theme, murex palette. packages/ui Ianitor's own components on @domi/ui (docs/domi-ui.md).
packages/domi-ui @domi/ui, the shared Domi design system, vendored at a tag by its tools/vendor.mjs. Never edit it here.
tests/diff same requests against Ianitor and Caddy, responses compared. tests/diff same requests against Ianitor and Caddy, responses compared.
tests/support shared test fixtures (test CA, upstreams, mock Authelia, clients); test-only. tests/support shared test fixtures (test CA, upstreams, mock Authelia, clients); test-only.
tests/fuzz cargo-fuzz targets. tests/fuzz cargo-fuzz targets.
+1 -1
View File
@@ -35,7 +35,7 @@ test("Add a host: + Host → fill → Apply = 2 clicks, kept", { annotation: { t
await page.getByLabel("Hostname").pressSequentially("notes.home.test"); await page.getByLabel("Hostname").pressSequentially("notes.home.test");
await page.getByLabel("Send traffic to").fill("http://192.0.2.60:8080"); await page.getByLabel("Send traffic to").fill("http://192.0.2.60:8080");
await beat(page); await beat(page);
await c.click(page.getByRole("button", { name: "Apply" })); await c.click(page.getByRole("button", { name: "Apply", exact: true }));
await expect(page.locator("dialog.ia-panel")).toHaveCount(0, { timeout: 10_000 }); await expect(page.locator("dialog.ia-panel")).toHaveCount(0, { timeout: 10_000 });
await expect(page.getByRole("button", { name: "More for notes.home.test" })).toBeVisible(); await expect(page.getByRole("button", { name: "More for notes.home.test" })).toBeVisible();
await beat(page); await beat(page);
+1 -1
View File
@@ -2,7 +2,7 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- 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 - 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/. --> - file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<html lang="en"> <html lang="en" data-domi-room="ianitor">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" /> <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
+1
View File
@@ -14,6 +14,7 @@
"aula:shots": "playwright test --project=aula" "aula:shots": "playwright test --project=aula"
}, },
"dependencies": { "dependencies": {
"@domi/ui": "workspace:*",
"@ianitor/ui": "workspace:*" "@ianitor/ui": "workspace:*"
}, },
"devDependencies": { "devDependencies": {
+12 -12
View File
@@ -93,7 +93,7 @@
{#if route.view === "signed-in"} {#if route.view === "signed-in"}
<SignedIn /> <SignedIn />
{:else} {:else}
<a class="skip domi-btn" href="#main">Skip to content</a> <a class="skip ia-link" href="#main">Skip to content</a>
<div class="shell"> <div class="shell">
<nav class="sidebar" aria-label="Main"> <nav class="sidebar" aria-label="Main">
<div class="ia-wordmark brand">IANITOR DOMI</div> <div class="ia-wordmark brand">IANITOR DOMI</div>
@@ -103,7 +103,7 @@
<div class="foot ia-muted"> <div class="foot ia-muted">
<p>{viewer?.via === "authelia" ? `Signed in as ${viewer.name} through Authelia` : viewer ? `Using the API token "${viewer.name}"` : "Signed in through Authelia"}</p> <p>{viewer?.via === "authelia" ? `Signed in as ${viewer.name} through Authelia` : viewer ? `Using the API token "${viewer.name}"` : "Signed in through Authelia"}</p>
<p>Control on 127.0.0.1 only</p> <p>Control on 127.0.0.1 only</p>
{#if app.overview?.site?.auth_logout_url}<a class="domi-btn link" href={app.overview.site.auth_logout_url}>Sign out</a>{/if} {#if app.overview?.site?.auth_logout_url}<a class="ia-link" href={app.overview.site.auth_logout_url}>Sign out</a>{/if}
</div> </div>
</nav> </nav>
<header class="topbar"><span class="ia-wordmark">IANITOR DOMI</span>{#if app.phone}<EngineChip />{/if}</header> <header class="topbar"><span class="ia-wordmark">IANITOR DOMI</span>{#if app.phone}<EngineChip />{/if}</header>
@@ -152,24 +152,24 @@
<style> <style>
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; } .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: var(--colonnade); border-right: 1px solid var(--hairline); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; } .sidebar { background: var(--domi-chrome); border-right: 1px solid var(--domi-line); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; }
.brand { padding: 4px 10px 18px; } .brand { padding: 4px 10px 18px; }
.nav { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; font-size: var(--fs-nav); text-decoration: none; border: 1px solid transparent; } .nav { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--domi-fg-2); font-weight: 600; font-size: var(--fs-nav); text-decoration: none; border: 1px solid transparent; }
.nav:hover { background: var(--surface); color: var(--text); } .nav:hover { background: var(--domi-panel); color: var(--domi-fg); }
.nav[aria-current="page"] { background: var(--surface-2); color: var(--text); box-shadow: var(--inset-lit); border-color: color-mix(in srgb, var(--accent) 30%, transparent); } .nav[aria-current="page"] { background: var(--domi-hover); color: var(--domi-fg); box-shadow: var(--inset-lit); border-color: color-mix(in srgb, var(--domi-accent) 30%, transparent); }
.nav[aria-current="page"] :global(svg) { color: var(--accent); } .nav[aria-current="page"] :global(svg) { color: var(--domi-accent); }
.foot { margin-top: auto; font-size: 0.82rem; display: flex; flex-direction: column; gap: 4px; padding: 0 10px; } .foot { margin-top: auto; font-size: 0.82rem; display: flex; flex-direction: column; gap: 4px; padding: 0 10px; }
main { padding: var(--main-pad); display: flex; flex-direction: column; gap: 18px; min-width: 0; outline: none; } main { padding: var(--main-pad); display: flex; flex-direction: column; gap: 18px; min-width: 0; outline: none; }
.topbar, .bottombar { display: none; } .topbar, .bottombar { display: none; }
@media (max-width: 719.98px) { @media (max-width: 719.98px) {
.shell { grid-template-columns: minmax(0, 1fr); } .shell { grid-template-columns: minmax(0, 1fr); }
.sidebar { display: none; } .sidebar { display: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; background: var(--colonnade); border-bottom: 1px solid var(--hairline); padding: 10px 16px; } .topbar { display: flex; align-items: center; justify-content: space-between; background: var(--domi-chrome); border-bottom: 1px solid var(--domi-line); padding: 10px 16px; }
.topbar .ia-wordmark { font-size: 12px; letter-spacing: 0.26em; } .topbar .ia-wordmark { font-size: 12px; letter-spacing: 0.26em; }
main { padding: 18px 16px calc(90px + env(safe-area-inset-bottom)); gap: 14px; } main { padding: 18px 16px calc(90px + env(safe-area-inset-bottom)); gap: 14px; }
.bottombar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--colonnade); border-top: 1px solid var(--hairline); padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); z-index: 40; } .bottombar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--domi-chrome); border-top: 1px solid var(--domi-line); padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); z-index: 40; }
.bottombar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--phone-bar-h); border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; font-size: var(--fs-tab-phone); text-decoration: none; } .bottombar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--phone-bar-h); border-radius: var(--radius-sm); color: var(--domi-fg-2); font-weight: 600; font-size: var(--fs-tab-phone); text-decoration: none; }
.bottombar a[aria-current="page"] { background: var(--surface-2); color: var(--text); } .bottombar a[aria-current="page"] { background: var(--domi-hover); color: var(--domi-fg); }
.bottombar a[aria-current="page"] :global(svg) { color: var(--accent); } .bottombar a[aria-current="page"] :global(svg) { color: var(--domi-accent); }
} }
</style> </style>
+6 -6
View File
@@ -69,12 +69,12 @@
<style> <style>
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; } .steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 10px; align-items: center; } .steps li { display: flex; gap: 10px; align-items: center; }
.steps li.pending { color: var(--muted); } .steps li.pending { color: var(--domi-muted); }
.steps li.running { color: var(--text); } .steps li.running { color: var(--domi-fg); }
.steps li.running :global(svg) { color: var(--accent); } .steps li.running :global(svg) { color: var(--domi-accent); }
.steps li.done { color: var(--text-2); } .steps li.done { color: var(--domi-fg-2); }
.steps li.done :global(svg) { color: var(--kept); } .steps li.done :global(svg) { color: var(--kept); }
.steps li.failed :global(svg) { color: var(--down); } .steps li.failed :global(svg) { color: var(--down); }
.steps li.skipped { color: var(--muted); } .steps li.skipped { color: var(--domi-muted); }
.hollow { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); margin: 2px; } .hollow { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--domi-muted); margin: 2px; }
</style> </style>
+2 -2
View File
@@ -136,7 +136,7 @@
<Progress label="Health watch" max={total} now={total - watchLeft} text="{watchLeft} seconds left" /> <Progress label="Health watch" max={total} now={total - watchLeft} text="{watchLeft} seconds left" />
{/if} {/if}
</div> </div>
{#if active.state === "queued"}<Button onclick={() => cancel(active.id)}>Cancel</Button>{:else}<button type="button" class="domi-btn link" onclick={() => onshowsteps(active.id)}>Show steps</button>{/if} {#if active.state === "queued"}<Button onclick={() => cancel(active.id)}>Cancel</Button>{:else}<button type="button" class="ia-link" onclick={() => onshowsteps(active.id)}>Show steps</button>{/if}
{:else if last} {:else if last}
<div class="grow"> <div class="grow">
{#if last.state === "kept"} {#if last.state === "kept"}
@@ -161,5 +161,5 @@
{/if} {/if}
<style> <style>
.warn { color: var(--degraded); } .warn { color: var(--domi-warning); }
</style> </style>
+1 -1
View File
@@ -117,5 +117,5 @@
</Dialog> </Dialog>
<style> <style>
ul { margin: 6px 0 0; padding-left: 1.1rem; color: var(--text-2); } ul { margin: 6px 0 0; padding-left: 1.1rem; color: var(--domi-fg-2); }
</style> </style>
+2 -2
View File
@@ -116,7 +116,7 @@
{#if h.certificate.state === "pending"}<span class="ia-sub" style="display:block">Waiting for Let's Encrypt to issue the certificate.</span>{/if} {#if h.certificate.state === "pending"}<span class="ia-sub" style="display:block">Waiting for Let's Encrypt to issue the certificate.</span>{/if}
{#if h.certificate.state === "failed"} {#if h.certificate.state === "failed"}
<span class="ia-sub" style="display:block;color:var(--down)">Let's Encrypt could not confirm <strong>{h.hostname}</strong>. The name must point to this server, and port 80 must be open from the internet. <span class="ia-sub" style="display:block;color:var(--down)">Let's Encrypt could not confirm <strong>{h.hostname}</strong>. The name must point to this server, and port 80 must be open from the internet.
<button type="button" class="domi-btn link" onclick={() => onretry(h.hostname)}>Try again</button></span> <button type="button" class="ia-link" onclick={() => onretry(h.hostname)}>Try again</button></span>
{/if} {/if}
</span> </span>
<span role="cell"> <span role="cell">
@@ -133,7 +133,7 @@
<style> <style>
.phone, .phone-dot { display: none; } .phone, .phone-dot { display: none; }
.problem { color: var(--text-2) !important; } .problem { color: var(--domi-fg-2) !important; }
@media (max-width: 719.98px) { @media (max-width: 719.98px) {
.desktop { display: none !important; } .desktop { display: none !important; }
.phone { display: block; padding-left: 22px; } .phone { display: block; padding-left: 22px; }
+71 -58
View File
@@ -5,6 +5,7 @@
// Handoff §6 and §7: the add/edit panel, its validation on blur, Apply, and the progress and // Handoff §6 and §7: the add/edit panel, its validation on blur, Apply, and the progress and
// outcome of the apply it starts. Every decision comes from control; the form only carries it. // outcome of the apply it starts. Every decision comes from control; the form only carries it.
import { onDestroy, onMount } from "svelte"; import { onDestroy, onMount } from "svelte";
import { Checkbox, Select, TextField } from "@domi/ui";
import { Banner, Button, Details, Dialog, Icon, Segmented } from "@ianitor/ui"; import { Banner, Button, Details, Dialog, Icon, Segmented } from "@ianitor/ui";
import ApplyProgress from "./ApplyProgress.svelte"; import ApplyProgress from "./ApplyProgress.svelte";
import { ApiError, call, del, get, newKey, sentence } from "../lib/api"; import { ApiError, call, del, get, newKey, sentence } from "../lib/api";
@@ -60,6 +61,24 @@
let idem = newKey(); let idem = newKey();
let lastBody = ""; let lastBody = "";
// Every text field carries its seal (domi-design TextField): `next` moves to the next field, and the last text
// field of the form applies it, as the Apply button does. The last one depends on what is shown.
const lastField = $derived.by(() => {
const keys = ["hostname", ...host.upstreams.map((_, i) => `upstreams[${i}]`)];
if (more) {
if (host.hc) keys.push("health_check.path");
for (const [list, rules, secrets] of [["request_headers", host.req, true], ["response_headers", host.resp, false]] as const) {
rules.forEach((r, i) => {
keys.push(`${list}[${i}].name`);
if (r.action === "set" && !(secrets && r.kind === "secret")) keys.push(`${list}[${i}].value`);
});
}
}
return keys.at(-1);
});
const seal = (key: string) =>
key === lastField ? { action: "save" as const, actionLabel: "Apply this host" } : { action: "next" as const, actionLabel: undefined };
// ---- the apply // ---- the apply
let apply = $state<ApplyView | null>(null); let apply = $state<ApplyView | null>(null);
let restoring = $state(false); let restoring = $state(false);
@@ -392,43 +411,36 @@
{#if topError.body.detail}<Details detail={topError.body.detail} reference={topError.requestId} />{/if} {#if topError.body.detail}<Details detail={topError.body.detail} reference={topError.requestId} />{/if}
{/if} {/if}
<div class="domi-field"> <div class="ia-field" onfocusout={() => blur("hostname")}>
<label class="domi-field-label" for={fieldId("hostname")}>Hostname</label> <TextField id={fieldId("hostname")} label="Hostname" bind:value={host.hostname} readonly={!!hostname}
<input id={fieldId("hostname")} class="domi-input" bind:value={host.hostname} readonly={!!hostname} spellcheck={false} inputmode="url" autocomplete="off" {...seal("hostname")}
autocapitalize="none" spellcheck="false" inputmode="url" autocomplete="off" error={errAt("hostname") && touched["hostname"] ? errAt("hostname").message : undefined}
aria-invalid={errAt("hostname") && touched["hostname"] ? "true" : undefined} hint={hostname ? "To use another address, add a new host and remove this one." : undefined} />
aria-describedby="{fieldId('hostname')}-e {fieldId('hostname')}-h" onblur={() => blur("hostname")} /> {#if errAt("hostname") && touched["hostname"] && errAt("hostname").params?.suggestion}
{#if errAt("hostname") && touched["hostname"]} <div><button type="button" class="ia-link" onclick={() => { host.hostname = errAt("hostname").params.suggestion; blur("hostname"); }}>Use {errAt("hostname").params.suggestion}</button></div>
<p class="domi-error" id="{fieldId('hostname')}-e"><Icon name="ring" />{errAt("hostname").message}
{#if errAt("hostname").params?.suggestion}
<button type="button" class="domi-btn link" onclick={() => { host.hostname = errAt("hostname").params.suggestion; blur("hostname"); }}>Use {errAt("hostname").params.suggestion}</button>
{/if} {/if}
</p>
{/if}
{#if hostname}<p class="ia-hint" id="{fieldId('hostname')}-h">To use another address, add a new host and remove this one.</p>{/if}
</div> </div>
{#each host.upstreams as _, i (i)} {#each host.upstreams as _, i (i)}
{@const f = `upstreams[${i}]`} {@const f = `upstreams[${i}]`}
{@const err = errAt(f) ?? (i === 0 ? errAt("upstreams") : undefined)} {@const err = errAt(f) ?? (i === 0 ? errAt("upstreams") : undefined)}
<div class="domi-field"> {@const shown = err && (touched[f] || touched["upstreams"])}
{#if i === 0}<label class="domi-field-label" for={fieldId(f)}>Send traffic to</label>{/if} <div class="ia-field" onfocusout={() => blur(f)}>
<div class="row"> <div class="row">
<input id={fieldId(f)} class="domi-input" bind:value={host.upstreams[i]} autocapitalize="none" spellcheck="false" inputmode="url" autocomplete="off" <div class="grow">
aria-label={i === 0 ? undefined : `Also send traffic to, address ${i + 1}`} <TextField id={fieldId(f)} label={i === 0 ? "Send traffic to" : `Also send traffic to, address ${i + 1}`} hideLabel={i > 0}
aria-invalid={err && (touched[f] || touched["upstreams"]) ? "true" : undefined} bind:value={host.upstreams[i]} spellcheck={false} inputmode="url" autocomplete="off" {...seal(f)}
aria-describedby="{fieldId(f)}-e" onblur={() => blur(f)} /> error={shown ? err.message : undefined}
hint={i === 0 && host.upstreams.length === 1 ? "Add another address later for a second server." : undefined} />
</div>
{#if i > 0}<button type="button" class="ia-icon-btn" aria-label="Remove this address" onclick={() => host.upstreams.splice(i, 1)}><Icon name="trash" /></button>{/if} {#if i > 0}<button type="button" class="ia-icon-btn" aria-label="Remove this address" onclick={() => host.upstreams.splice(i, 1)}><Icon name="trash" /></button>{/if}
</div> </div>
{#if err && (touched[f] || touched["upstreams"])} {#if shown && err.params?.suggestion}
<p class="domi-error" id="{fieldId(f)}-e"><Icon name="ring" />{err.message} <div><button type="button" class="ia-link" onclick={() => { host.upstreams[i] = err.params.suggestion; blur(f); }}>Use {err.params.suggestion}</button></div>
{#if err.params?.suggestion}<button type="button" class="domi-btn link" onclick={() => { host.upstreams[i] = err.params.suggestion; blur(f); }}>Use {err.params.suggestion}</button>{/if}
</p>
{/if} {/if}
{#if i === 0 && host.upstreams.length === 1}<p class="ia-hint">Add another address later for a second server.</p>{/if}
</div> </div>
{/each} {/each}
<div><button type="button" class="domi-btn link" onclick={() => host.upstreams.push("")}>Add another address</button></div> <div><button type="button" class="ia-link" onclick={() => host.upstreams.push("")}>Add another address</button></div>
<Segmented legend="Certificate" name="tls" bind:value={host.tls} <Segmented legend="Certificate" name="tls" bind:value={host.tls}
options={[{ value: "domi", label: "Domi certificate" }, { value: "letsencrypt", label: "Let's Encrypt" }]} /> options={[{ value: "domi", label: "Domi certificate" }, { value: "letsencrypt", label: "Let's Encrypt" }]} />
@@ -437,77 +449,77 @@
<Segmented legend="Who can open it" name="auth" bind:value={host.auth} disabled={signinOk ? [] : ["forward-auth"]} <Segmented legend="Who can open it" name="auth" bind:value={host.auth} disabled={signinOk ? [] : ["forward-auth"]}
options={[{ value: "forward-auth", label: "Sign in first" }, { value: "none", label: "Anyone" }]} /> options={[{ value: "forward-auth", label: "Sign in first" }, { value: "none", label: "Anyone" }]} />
{#if !signinOk}<p class="ia-hint">Sign-in is not set up on this server yet, so choose Anyone for now. To set it up, add the Authelia address to ianitor.toml in the routes repository.</p>{/if} {#if !signinOk}<p class="ia-hint">Sign-in is not set up on this server yet, so choose Anyone for now. To set it up, add the Authelia address to ianitor.toml in the routes repository.</p>{/if}
{#if errAt("auth")}<p class="domi-error"><Icon name="ring" />{errAt("auth").message}</p>{/if} {#if errAt("auth")}<p class="ia-error"><Icon name="ring" />{errAt("auth").message}</p>{/if}
<div> <div>
<button type="button" class="domi-btn link" aria-expanded={more} aria-controls="more-options" onclick={() => (more = !more)}> <button type="button" class="ia-link" aria-expanded={more} aria-controls="more-options" onclick={() => (more = !more)}>
More options: headers, websockets, health check, share links, visit log More options: headers, websockets, health check, share links, visit log
</button> </button>
</div> </div>
{#if more} {#if more}
<div id="more-options" class="more"> <div id="more-options" class="more">
<div class="domi-field"> <div class="ia-field">
<span class="domi-field-label">Health check</span> <span class="ia-field-label">Health check</span>
<label class="ia-check"><input type="checkbox" bind:checked={host.hc} /> Check that it answers</label> <Checkbox bind:checked={host.hc} label="Check that it answers" />
<p class="ia-hint">Ianitor asks this address regularly and shows the result on the main screen.</p> <p class="ia-hint">Ianitor asks this address regularly and shows the result on the main screen.</p>
</div> </div>
{#if host.hc} {#if host.hc}
<div class="domi-field"> <div class="ia-field" onfocusout={() => blur("health_check.path")}>
<label class="domi-field-label" for={fieldId("health_check.path")}>Health check address</label> <TextField id={fieldId("health_check.path")} label="Health check address" bind:value={host.hcPath} spellcheck={false}
<input id={fieldId("health_check.path")} class="domi-input" bind:value={host.hcPath} aria-invalid={errAt("health_check.path") ? "true" : undefined} onblur={() => blur("health_check.path")} /> autocomplete="off" {...seal("health_check.path")} error={errAt("health_check.path")?.message}
{#if errAt("health_check.path")}<p class="domi-error"><Icon name="ring" />{errAt("health_check.path").message}</p>{/if} hint="Use an address that answers without signing in, like /health." />
<p class="ia-hint">Use an address that answers without signing in, like /health.</p>
</div> </div>
<div class="domi-field"> <div class="ia-field">
<label class="domi-field-label" for={fieldId("health_check.interval_secs")}>Checks every</label> <label class="ia-field-label" for={fieldId("health_check.interval_secs")}>Checks every</label>
<div class="row"><input id={fieldId("health_check.interval_secs")} class="domi-input narrow" type="number" min="1" max="3600" bind:value={host.hcEvery} onblur={() => blur("health_check.interval_secs")} /> <span class="ia-text2">seconds</span></div> <div class="row"><input id={fieldId("health_check.interval_secs")} class="ia-input narrow" type="number" min="1" max="3600" bind:value={host.hcEvery} onblur={() => blur("health_check.interval_secs")} /> <span class="ia-text2">seconds</span></div>
{#if errAt("health_check.interval_secs")}<p class="domi-error"><Icon name="ring" />{errAt("health_check.interval_secs").message}</p>{/if} {#if errAt("health_check.interval_secs")}<p class="ia-error"><Icon name="ring" />{errAt("health_check.interval_secs").message}</p>{/if}
</div> </div>
{/if} {/if}
<div class="domi-field"> <div class="ia-field">
<span class="domi-field-label">Websockets</span> <span class="ia-field-label">Websockets</span>
<label class="ia-check"><input type="checkbox" bind:checked={host.websockets} /> Allow websockets</label> <Checkbox bind:checked={host.websockets} label="Allow websockets" />
<p class="ia-hint">Live updates for apps like Home Assistant. Leave on unless you know the app does not need them.</p> <p class="ia-hint">Live updates for apps like Home Assistant. Leave on unless you know the app does not need them.</p>
</div> </div>
<div class="domi-field"> <div class="ia-field">
<span class="domi-field-label">Share links</span> <span class="ia-field-label">Share links</span>
<label class="ia-check"><input type="checkbox" bind:checked={host.share_links} /> Allow share links</label> <Checkbox bind:checked={host.share_links} label="Allow share links" />
<p class="ia-hint">Lets you make links that open this host without signing in, until they expire.</p> <p class="ia-hint">Lets you make links that open this host without signing in, until they expire.</p>
{#if shareWarning}<p class="ia-hint">Anyone can already open {name}, so a share link changes nothing.</p>{/if} {#if shareWarning}<p class="ia-hint">Anyone can already open {name}, so a share link changes nothing.</p>{/if}
</div> </div>
<div class="domi-field"> <div class="ia-field">
<span class="domi-field-label">Device certificates</span> <span class="ia-field-label">Device certificates</span>
<label class="ia-check"><input type="checkbox" bind:checked={host.device_certs} /> Only devices with a Domi device certificate</label> <Checkbox bind:checked={host.device_certs} label="Only devices with a Domi device certificate" />
<p class="ia-hint">Phones, computers and apps need a certificate from Certificates before they can open it.</p> <p class="ia-hint">Phones, computers and apps need a certificate from Certificates before they can open it.</p>
</div> </div>
<Segmented legend="Visit log" name="access_log" bind:value={host.access_log} options={[{ value: "off", label: "Off" }, { value: "truncated", label: "On" }]} /> <Segmented legend="Visit log" name="access_log" bind:value={host.access_log} options={[{ value: "off", label: "Off" }, { value: "truncated", label: "On" }]} />
<p class="ia-hint">On keeps a log on this server, with visitor addresses shortened.</p> <p class="ia-hint">On keeps a log on this server, with visitor addresses shortened.</p>
{#each [{ list: "request_headers", rules: host.req, title: "Header rules sent to your service", secrets: true }, { list: "response_headers", rules: host.resp, title: "Header rules sent back to visitors", secrets: false }] as group (group.list)} {#each [{ list: "request_headers", rules: host.req, title: "Header rules sent to your service", secrets: true }, { list: "response_headers", rules: host.resp, title: "Header rules sent back to visitors", secrets: false }] as group (group.list)}
<div class="domi-field"> <div class="ia-field">
<span class="domi-field-label">{group.title}</span> <span class="ia-field-label">{group.title}</span>
{#each group.rules as r, i (i)} {#each group.rules as r, i (i)}
{@const p = `${group.list}[${i}]`} {@const p = `${group.list}[${i}]`}
<div class="rule ia-card"> <div class="rule ia-card">
<Segmented legend="Rule {i + 1}" name="{p}-action" bind:value={r.action} options={[{ value: "set", label: "Set" }, { value: "remove", label: "Remove" }]} /> <Segmented legend="Rule {i + 1}" name="{p}-action" bind:value={r.action} options={[{ value: "set", label: "Set" }, { value: "remove", label: "Remove" }]} />
<label class="domi-field-label" for={fieldId(p + ".name")}>Header name</label> <div onfocusout={() => blur(p + ".name")}>
<input id={fieldId(p + ".name")} class="domi-input" bind:value={r.name} onblur={() => blur(p + ".name")} /> <TextField id={fieldId(p + ".name")} label="Header name" bind:value={r.name} spellcheck={false} autocomplete="off" {...seal(p + ".name")} />
</div>
{#if r.action === "set"} {#if r.action === "set"}
{#if group.secrets} {#if group.secrets}
<Segmented legend="Value" name="{p}-kind" bind:value={r.kind} disabled={(site?.secrets.length ?? 0) === 0 ? ["secret"] : []} options={[{ value: "value", label: "Fixed value" }, { value: "secret", label: "Secret" }]} /> <Segmented legend="Value" name="{p}-kind" bind:value={r.kind} disabled={(site?.secrets.length ?? 0) === 0 ? ["secret"] : []} options={[{ value: "value", label: "Fixed value" }, { value: "secret", label: "Secret" }]} />
{/if} {/if}
{#if r.kind === "secret" && group.secrets} {#if r.kind === "secret" && group.secrets}
<select class="domi-input" bind:value={r.secret} aria-label="Secret"> <Select label="Secret" bind:value={r.secret} options={(site?.secrets ?? []).map((s) => ({ value: s, label: s }))} />
{#each site?.secrets ?? [] as s (s)}<option value={s}>{s}</option>{/each}
</select>
{:else} {:else}
<input class="domi-input" bind:value={r.value} aria-label="Value" onblur={() => blur(p + ".value")} /> <div onfocusout={() => blur(p + ".value")}>
<TextField label="Value" hideLabel bind:value={r.value} spellcheck={false} autocomplete="off" {...seal(p + ".value")} />
</div>
{/if} {/if}
{/if} {/if}
{#each Object.entries(errors).filter(([k]) => k.startsWith(p)) as [, e] (e.code + e.field)}<p class="domi-error"><Icon name="ring" />{e.message}</p>{/each} {#each Object.entries(errors).filter(([k]) => k.startsWith(p)) as [, e] (e.code + e.field)}<p class="ia-error"><Icon name="ring" />{e.message}</p>{/each}
<button type="button" class="ia-icon-btn" aria-label="Remove this rule" onclick={() => group.rules.splice(i, 1)}><Icon name="trash" /></button> <button type="button" class="ia-icon-btn" aria-label="Remove this rule" onclick={() => group.rules.splice(i, 1)}><Icon name="trash" /></button>
</div> </div>
{/each} {/each}
<div><button type="button" class="domi-btn link" onclick={() => group.rules.push({ action: "set", name: "", kind: "value", value: "", secret: site?.secrets[0] ?? "" })}>Add a rule</button></div> <div><button type="button" class="ia-link" onclick={() => group.rules.push({ action: "set", name: "", kind: "value", value: "", secret: site?.secrets[0] ?? "" })}>Add a rule</button></div>
{#if group.secrets && (site?.secrets.length ?? 0) === 0}<p class="ia-hint">No secrets are listed in ianitor.toml.</p>{/if} {#if group.secrets && (site?.secrets.length ?? 0) === 0}<p class="ia-hint">No secrets are listed in ianitor.toml.</p>{/if}
</div> </div>
{/each} {/each}
@@ -531,6 +543,7 @@
<style> <style>
form { display: flex; flex-direction: column; gap: 16px; } form { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; } .row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.more { display: flex; flex-direction: column; gap: 16px; } .more { display: flex; flex-direction: column; gap: 16px; }
.rule { display: flex; flex-direction: column; gap: 8px; } .rule { display: flex; flex-direction: column; gap: 8px; }
.narrow { max-width: 8rem; } .narrow { max-width: 8rem; }
+21 -16
View File
@@ -7,6 +7,7 @@
// Links off: "Turn on share links" applies the change, then Copy link (4 clicks: open // Links off: "Turn on share links" applies the change, then Copy link (4 clicks: open
// question Q1 is not decided, so this is the fallback path the design allows). // question Q1 is not decided, so this is the fallback path the design allows).
import { onDestroy, onMount } from "svelte"; import { onDestroy, onMount } from "svelte";
import { DomiError, TextField } from "@domi/ui";
import { Banner, Button, Dialog, Icon, Segmented } from "@ianitor/ui"; import { Banner, Button, Dialog, Icon, Segmented } from "@ianitor/ui";
import ApplyProgress from "./ApplyProgress.svelte"; import ApplyProgress from "./ApplyProgress.svelte";
import { ApiError, call, del, newKey, patch, sentence } from "../lib/api"; import { ApiError, call, del, newKey, patch, sentence } from "../lib/api";
@@ -64,6 +65,12 @@
} }
} }
// The seals of the two fields (domi-design TextField): a new link with this prefix or password, or the reason not.
async function remint(field: "path_prefix" | "password") {
await mint();
if (fieldErr?.field === field) throw new DomiError(fieldErr.message);
}
async function copy() { async function copy() {
if (!link) return; if (!link) return;
try { try {
@@ -111,7 +118,7 @@
{:else} {:else}
<p><strong>Share links are off for {hostname}.</strong></p> <p><strong>Share links are off for {hostname}.</strong></p>
<p class="ia-text2">Turning them on is a change to the host, checked like any other.</p> <p class="ia-text2">Turning them on is a change to the host, checked like any other.</p>
{#if problem}<p class="domi-error" role="alert"><Icon name="ring" />{problem}</p>{/if} {#if problem}<p class="ia-error" role="alert"><Icon name="ring" />{problem}</p>{/if}
<div><Button variant="outline" onclick={turnOn} disabled={!!app.overview?.paused}>Turn on share links</Button></div> <div><Button variant="outline" onclick={turnOn} disabled={!!app.overview?.paused}>Turn on share links</Button></div>
{/if} {/if}
{:else} {:else}
@@ -130,34 +137,32 @@
<p class="ia-status" data-s="kept" role="status"><Icon name="check" /><span>Copied</span></p> <p class="ia-status" data-s="kept" role="status"><Icon name="check" /><span>Copied</span></p>
<p class="ia-hint">Expires on {longDate(link?.expires_at)}. To stop it sooner: Settings, Share links, Stop this link.</p> <p class="ia-hint">Expires on {longDate(link?.expires_at)}. To stop it sooner: Settings, Share links, Stop this link.</p>
{:else} {:else}
<Button variant="primary" full icon="copy" onclick={copy} disabled={!link || minting} data-autofocus>Copy link</Button> <Button variant="primary" full icon="copy" onclick={copy} pending={minting || (!link && !problem && !fieldErr)} disabled={!link && !minting && !!(problem || fieldErr)} data-autofocus>Copy link</Button>
{/if} {/if}
{#if refused}<p class="ia-hint" role="alert">Your browser did not allow copying. Press Ctrl+C to copy the selected link.</p>{/if} {#if refused}<p class="ia-hint" role="alert">Your browser did not allow copying. Press Ctrl+C to copy the selected link.</p>{/if}
{#if copiedBefore && !copied}<p class="ia-hint">The link you copied before is stopped. Copy this one.</p>{/if} {#if copiedBefore && !copied}<p class="ia-hint">The link you copied before is stopped. Copy this one.</p>{/if}
<Segmented legend="Expires after" name="expiry" bind:value={days} onchange={() => mint()} <Segmented legend="Expires after" name="expiry" bind:value={days} onchange={() => mint()}
options={[{ value: "1", label: "1 day" }, { value: "7", label: "7 days" }, { value: "30", label: "30 days" }]} /> options={[{ value: "1", label: "1 day" }, { value: "7", label: "7 days" }, { value: "30", label: "30 days" }]} />
<div class="domi-field"> <div class="ia-field" onfocusout={(e) => { if (!e.currentTarget.contains(e.relatedTarget as Node | null)) void mint(); }}>
<label class="domi-field-label" for="share-prefix">Only addresses starting with</label> <TextField id="share-prefix" label="Only addresses starting with" bind:value={prefix} spellcheck={false} autocomplete="off"
<input id="share-prefix" class="domi-input" bind:value={prefix} onblur={() => mint()} onkeydown={(e) => { if (e.key === "Enter") { e.preventDefault(); void mint(); } }} action="save" actionLabel="Make the link for these addresses" onsend={() => remint("path_prefix")}
aria-invalid={fieldErr?.field === "path_prefix" ? "true" : undefined} /> error={fieldErr?.field === "path_prefix" ? fieldErr.message : undefined}
{#if fieldErr?.field === "path_prefix"}<p class="domi-error"><Icon name="ring" />{fieldErr.message}</p>{/if} hint="/ shares the whole site. Try /share/summer-2026 for one album." />
<p class="ia-hint">/ shares the whole site. Try /share/summer-2026 for one album.</p>
</div> </div>
{#if usingPassword} {#if usingPassword}
<p class="ia-hint">This link asks for the password.</p> <p class="ia-hint">This link asks for the password.</p>
<div><button type="button" class="domi-btn link" onclick={() => { usingPassword = false; password = ""; void mint(); }}>Remove the password</button></div> <div><button type="button" class="ia-link" onclick={() => { usingPassword = false; password = ""; void mint(); }}>Remove the password</button></div>
{:else if showPassword} {:else if showPassword}
<div class="domi-field"> <div class="ia-field">
<label class="domi-field-label" for="share-password">Password</label> <TextField id="share-password" label="Password" type="password" autocomplete="new-password" bind:value={password}
<input id="share-password" class="domi-input" type="password" autocomplete="new-password" bind:value={password} action="save" actionLabel="Ask for this password on the link" onsend={() => { usingPassword = true; return remint("password"); }}
aria-invalid={fieldErr?.field === "password" ? "true" : undefined} /> error={fieldErr?.field === "password" ? fieldErr.message : undefined}
{#if fieldErr?.field === "password"}<p class="domi-error"><Icon name="ring" />{fieldErr.message}</p>{/if} hint="At least 8 characters. Send it to them separately." />
<p class="ia-hint">At least 8 characters. Send it to them separately.</p>
<div><Button onclick={() => { usingPassword = true; void mint(); }}>Use this password</Button></div> <div><Button onclick={() => { usingPassword = true; void mint(); }}>Use this password</Button></div>
</div> </div>
{:else} {:else}
<div><button type="button" class="domi-btn link" onclick={() => (showPassword = true)}>Add a password</button></div> <div><button type="button" class="ia-link" onclick={() => (showPassword = true)}>Add a password</button></div>
{/if} {/if}
{/if} {/if}
</Dialog> </Dialog>
+3
View File
@@ -2,6 +2,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // 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/. // file, You can obtain one at https://mozilla.org/MPL/2.0/.
// The styles, once: @domi/ui (the Domi faces, the roles with Ianitor's values from data-domi-room="ianitor" on
// <html>, the controls), then Ianitor's own tokens and components on top.
import "@domi/ui/domi.css";
import "@ianitor/ui/tokens.css"; import "@ianitor/ui/tokens.css";
import "@ianitor/ui/components.css"; import "@ianitor/ui/components.css";
import { mount } from "svelte"; import { mount } from "svelte";
+6 -8
View File
@@ -6,6 +6,7 @@
// the install (the accepted 4th click). Until Custos can approve, approval is the server // the install (the accepted 4th click). Until Custos can approve, approval is the server
// command control names (docs/pki.md). // command control names (docs/pki.md).
import { onDestroy, onMount } from "svelte"; import { onDestroy, onMount } from "svelte";
import { TextField } from "@domi/ui";
import { Banner, Button, Dialog, Icon, Segmented, Status } from "@ianitor/ui"; import { Banner, Button, Dialog, Icon, Segmented, Status } from "@ianitor/ui";
import HostMenu from "../components/HostMenu.svelte"; import HostMenu from "../components/HostMenu.svelte";
import IntermediateBanner from "../components/IntermediateBanner.svelte"; import IntermediateBanner from "../components/IntermediateBanner.svelte";
@@ -184,12 +185,9 @@
<Dialog title="New device certificate" kind="panel" onclose={closeForm}> <Dialog title="New device certificate" kind="panel" onclose={closeForm}>
{#if !request} {#if !request}
<form id="device-form" onsubmit={issue} class="form"> <form id="device-form" onsubmit={issue} class="form">
<div class="domi-field"> <TextField id="device-name" label="Device name" bind:value={name} autocomplete="off" action="send"
<label class="domi-field-label" for="device-name">Device name</label> actionLabel="Request the certificate" clearOnSend={false} error={nameErr ?? undefined}
<input id="device-name" class="domi-input" bind:value={name} autocomplete="off" aria-invalid={nameErr ? "true" : undefined} aria-describedby="device-name-h" /> hint="Shown in this list and inside the certificate." />
{#if nameErr}<p class="domi-error"><Icon name="ring" />{nameErr}</p>{/if}
<p class="ia-hint" id="device-name-h">Shown in this list and inside the certificate.</p>
</div>
<Segmented legend="What is it" name="kind" bind:value={kind} options={[{ value: "phone", label: "Phone or tablet" }, { value: "computer", label: "Computer" }, { value: "app", label: "Domi app" }]} /> <Segmented legend="What is it" name="kind" bind:value={kind} options={[{ value: "phone", label: "Phone or tablet" }, { value: "computer", label: "Computer" }, { value: "app", label: "Domi app" }]} />
<p class="ia-hint">{#if capped}Valid until {until}, when the Domi intermediate certificate ends (renew it to issue for a full year).{:else}Valid for {lifetime} days, until {until}.{/if} It lets this device into hosts that ask for a Domi device certificate.</p> <p class="ia-hint">{#if capped}Valid until {until}, when the Domi intermediate certificate ends (renew it to issue for a full year).{:else}Valid for {lifetime} days, until {until}.{/if} It lets this device into hosts that ask for a Domi device certificate.</p>
</form> </form>
@@ -245,8 +243,8 @@
<style> <style>
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; } .head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.devices { list-style: none; margin: 0; padding: 0; border: 1px solid var(--hairline); border-radius: var(--radius-lg); } .devices { list-style: none; margin: 0; padding: 0; border: 1px solid var(--domi-line); border-radius: var(--radius-lg); }
.devices li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; min-height: 56px; padding: 6px 10px 6px 16px; border-top: 1px solid var(--hairline); } .devices li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; min-height: 56px; padding: 6px 10px 6px 16px; border-top: 1px solid var(--domi-line); }
.devices li:first-child { border-top: 0; } .devices li:first-child { border-top: 0; }
.dname { font-weight: 600; flex: 1 1 140px; } .dname { font-weight: 600; flex: 1 1 140px; }
.confirm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-basis: 100%; } .confirm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-basis: 100%; }
+5 -5
View File
@@ -98,7 +98,7 @@
</script> </script>
<h1 class="ia-display">{host ? `History of ${host}` : "History"}</h1> <h1 class="ia-display">{host ? `History of ${host}` : "History"}</h1>
{#if host}<div><button type="button" class="domi-btn link" onclick={() => navigate("/history")}>Show all changes</button></div>{/if} {#if host}<div><button type="button" class="ia-link" onclick={() => navigate("/history")}>Show all changes</button></div>{/if}
{#if problem}<Banner tone="notice" live="status">{#snippet title()}{problem}{/snippet}</Banner>{/if} {#if problem}<Banner tone="notice" live="status">{#snippet title()}{problem}{/snippet}</Banner>{/if}
<div class="cols"> <div class="cols">
@@ -168,11 +168,11 @@
.cols { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; } .cols { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.list { flex: 1 1 360px; max-width: 520px; display: flex; flex-direction: column; gap: 8px; } .list { flex: 1 1 360px; max-width: 520px; display: flex; flex-direction: column; gap: 8px; }
.entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; } .entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.entry { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid transparent; background: none; color: var(--text); text-align: left; cursor: pointer; } .entry { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid transparent; background: none; color: var(--domi-fg); text-align: left; cursor: pointer; }
.entry:hover { background: var(--surface); } .entry:hover { background: var(--domi-panel); }
.entry[aria-current="true"] { background: var(--surface-2); border-color: color-mix(in srgb, var(--accent) 55%, transparent); } .entry[aria-current="true"] { background: var(--domi-hover); border-color: color-mix(in srgb, var(--domi-accent) 55%, transparent); }
.sum { font-weight: 600; } .sum { font-weight: 600; }
.detail { flex: 2 1 360px; background: var(--colonnade); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 10px; } .detail { flex: 2 1 360px; background: var(--domi-chrome); border: 1px solid var(--domi-line); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.detail ul { margin: 0; padding-left: 1.1rem; } .detail ul { margin: 0; padding-left: 1.1rem; }
.buttons { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; } .buttons { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
</style> </style>
+1 -1
View File
@@ -112,7 +112,7 @@
Routes live in the {o.repo.name} repository, one file per host. Routes live in the {o.repo.name} repository, one file per host.
{#if o.repo.last_push_at}Last pushed to Gitea {atTime(o.repo.last_push_at, app.now)}.{/if} {#if o.repo.last_push_at}Last pushed to Gitea {atTime(o.repo.last_push_at, app.now)}.{/if}
{#if o.repo.unpushed}{o.repo.unpushed} changes not yet pushed.{/if} {#if o.repo.unpushed}{o.repo.unpushed} changes not yet pushed.{/if}
<button type="button" class="domi-btn link" onclick={() => navigate("/history")}>See history</button> <button type="button" class="ia-link" onclick={() => navigate("/history")}>See history</button>
</p> </p>
{/if} {/if}
+10 -11
View File
@@ -4,6 +4,7 @@
<script lang="ts"> <script lang="ts">
// Handoff §13.6: signing the intermediate by hand on the offline computer (the temporary step // Handoff §13.6: signing the intermediate by hand on the offline computer (the temporary step
// until Custos can sign, docs/pki.md). The root key never comes to this server. // until Custos can sign, docs/pki.md). The root key never comes to this server.
import { TextField } from "@domi/ui";
import { Banner, Button, Icon } from "@ianitor/ui"; import { Banner, Button, Icon } from "@ianitor/ui";
import { ApiError, post, put, sentence } from "../lib/api"; import { ApiError, post, put, sentence } from "../lib/api";
import { app, navigate, refresh } from "../lib/app.svelte"; import { app, navigate, refresh } from "../lib/app.svelte";
@@ -120,24 +121,22 @@
<p class="ia-label">Step 3</p> <p class="ia-label">Step 3</p>
<h2 class="ia-h3">Upload the signed certificate</h2> <h2 class="ia-h3">Upload the signed certificate</h2>
{#if paste} {#if paste}
<div class="domi-field"> <TextField id="cert-paste" label="Signed certificate" multiline rows={8} enterSends="never" spellcheck={false} bind:value={pem}
<label class="domi-field-label" for="cert-paste">Signed certificate</label> action="send" actionLabel="Use the pasted certificate" clearOnSend={false} onsend={() => { void use(); }} />
<textarea id="cert-paste" class="domi-input" rows="8" bind:value={pem} aria-invalid={err ? "true" : undefined}></textarea>
</div>
{:else} {:else}
<div class="domi-field"> <div class="ia-field">
<label class="domi-field-label" for="cert-file">Signed certificate (.crt)</label> <label class="ia-field-label" for="cert-file">Signed certificate (.crt)</label>
<input id="cert-file" class="domi-input" type="file" accept=".crt,.pem" onchange={file} aria-invalid={err ? "true" : undefined} /> <input id="cert-file" class="ia-input" type="file" accept=".crt,.pem" onchange={file} aria-invalid={err ? "true" : undefined} />
<div><button type="button" class="domi-btn link" onclick={() => (paste = true)}>Paste it instead</button></div> <div><button type="button" class="ia-link" onclick={() => (paste = true)}>Paste it instead</button></div>
</div> </div>
{/if} {/if}
{#if err}<p class="domi-error" role="alert"><Icon name="ring" />{err}</p>{/if} {#if err}<p class="ia-error" role="alert"><Icon name="ring" />{err}</p>{/if}
<div><Button variant="primary" onclick={use} {pending} disabled={!pem.includes("BEGIN CERTIFICATE")}>Use this certificate</Button></div> <div><Button variant="primary" onclick={use} {pending} disabled={!pem.includes("BEGIN CERTIFICATE")}>Use this certificate</Button></div>
</section> </section>
{/if} {/if}
<style> <style>
.row { display: flex; gap: 8px; flex-wrap: wrap; } .row { display: flex; gap: 8px; flex-wrap: wrap; }
.step { border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 10px; } .step { border: 1px solid var(--domi-line); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.fp { word-break: break-all; color: var(--accent-strong); } .fp { word-break: break-all; color: var(--domi-accent-strong); }
</style> </style>
+28 -23
View File
@@ -5,6 +5,7 @@
// Handoff §8.3: Settings with General, API (⚙ → API → New token = 3 clicks, Copy token the // Handoff §8.3: Settings with General, API (⚙ → API → New token = 3 clicks, Copy token the
// accepted 4th), Share links and About. // accepted 4th), Share links and About.
import { onMount } from "svelte"; import { onMount } from "svelte";
import { DomiError, TextField } from "@domi/ui";
import { Banner, Button, Dialog, Segmented } from "@ianitor/ui"; import { Banner, Button, Dialog, Segmented } from "@ianitor/ui";
import { ApiError, call, del, get, newKey, patch, post, sentence } from "../lib/api"; import { ApiError, call, del, get, newKey, patch, post, sentence } from "../lib/api";
import { app, navigate, toast } from "../lib/app.svelte"; import { app, navigate, toast } from "../lib/app.svelte";
@@ -92,23 +93,30 @@
} }
} }
// Renames the new token now (its field's seal) or when the dialog closes. False when the name was refused.
async function rename(): Promise<boolean> {
if (!made || !tokenName.trim() || tokenName.trim() === made.name) return true;
nameErr = null;
try {
await patch(`/tokens/${encodeURIComponent(made.id)}`, { name: tokenName.trim() });
made.name = tokenName.trim();
toast("Renamed.");
} catch (e) {
if (e instanceof ApiError && e.code === "token.name") {
nameErr = e.body.message;
return false;
}
}
return true;
}
async function closeToken(force = false) { async function closeToken(force = false) {
if (!made) return; if (!made) return;
if (!tokenCopied && !force) { if (!tokenCopied && !force) {
askClose = true; askClose = true;
return; return;
} }
if (tokenName.trim() && tokenName !== made.name) { if (!(await rename())) return;
try {
await patch(`/tokens/${encodeURIComponent(made.id)}`, { name: tokenName.trim() });
toast("Renamed.");
} catch (e) {
if (e instanceof ApiError && e.code === "token.name") {
nameErr = e.body.message;
return;
}
}
}
// The token leaves memory with the dialog. // The token leaves memory with the dialog.
made = null; made = null;
tokenName = ""; tokenName = "";
@@ -169,7 +177,7 @@
<p>{settings?.watch_seconds ?? app.overview?.site?.watch_seconds ?? 60} seconds</p> <p>{settings?.watch_seconds ?? app.overview?.site?.watch_seconds ?? 60} seconds</p>
<p class="ia-label">Signed in</p> <p class="ia-label">Signed in</p>
<p>{viewer ? (viewer.via === "authelia" ? `${viewer.name} through Authelia` : `API token "${viewer.name}"`) : "Through Authelia"}</p> <p>{viewer ? (viewer.via === "authelia" ? `${viewer.name} through Authelia` : `API token "${viewer.name}"`) : "Through Authelia"}</p>
{#if app.overview?.site?.auth_logout_url}<p><a class="domi-btn link" href={app.overview.site.auth_logout_url}>Sign out</a></p>{/if} {#if app.overview?.site?.auth_logout_url}<p><a class="ia-link" href={app.overview.site.auth_logout_url}>Sign out</a></p>{/if}
{:else if tab === "api"} {:else if tab === "api"}
<div class="row"> <div class="row">
<h2 class="ia-h3">API tokens</h2> <h2 class="ia-h3">API tokens</h2>
@@ -236,7 +244,7 @@
<p>Ianitor Domi 0.1.0</p> <p>Ianitor Domi 0.1.0</p>
<p>MPL-2.0</p> <p>MPL-2.0</p>
<p>Built, tested and signed by Fabrica Domi</p> <p>Built, tested and signed by Fabrica Domi</p>
<p><a class="domi-btn link" href="https://gitea.marek-novak.cz/mnovak/Ianitor" rel="noreferrer">Source on Gitea</a></p> <p><a class="ia-link" href="https://gitea.marek-novak.cz/mnovak/Ianitor" rel="noreferrer">Source on Gitea</a></p>
{/if} {/if}
</div> </div>
@@ -246,12 +254,9 @@
<p class="ia-text2">Ianitor cannot show it again; if it is lost, make a new one and revoke this one.</p> <p class="ia-text2">Ianitor cannot show it again; if it is lost, make a new one and revoke this one.</p>
<input class="ia-secret" readonly value={made.token} aria-label="New API token" onfocus={(e) => (e.currentTarget as HTMLInputElement).select()} /> <input class="ia-secret" readonly value={made.token} aria-label="New API token" onfocus={(e) => (e.currentTarget as HTMLInputElement).select()} />
<div class="grid"> <div class="grid">
<div class="domi-field"> <TextField id="token-name" label="Name" bind:value={tokenName} autocomplete="off" action="save" actionLabel="Rename the token"
<label class="domi-field-label" for="token-name">Name</label> onsend={async () => { if (!(await rename())) throw new DomiError(nameErr ?? "That name was not accepted."); }}
<input id="token-name" class="domi-input" bind:value={tokenName} aria-invalid={nameErr ? "true" : undefined} /> error={nameErr ?? undefined} hint="Rename it now or later, so you know what uses it." />
{#if nameErr}<p class="domi-error">{nameErr}</p>{/if}
<p class="ia-hint">Rename it now or later, so you know what uses it.</p>
</div>
<Button variant={tokenCopied ? "quiet" : "primary"} icon="copy" onclick={copyToken} data-autofocus>{tokenCopied ? "Copy again" : "Copy token"}</Button> <Button variant={tokenCopied ? "quiet" : "primary"} icon="copy" onclick={copyToken} data-autofocus>{tokenCopied ? "Copy again" : "Copy token"}</Button>
</div> </div>
{#if tokenCopied}<p role="status">Copied. Paste it into Custos now. Ianitor cannot show it again.</p>{/if} {#if tokenCopied}<p role="status">Copied. Paste it into Custos now. Ianitor cannot show it again.</p>{/if}
@@ -266,15 +271,15 @@
<style> <style>
.tabs { display: flex; gap: 4px; overflow-x: auto; } .tabs { display: flex; gap: 4px; overflow-x: auto; }
.tabs [role="tab"] { min-height: 44px; padding: 0 1rem; border-radius: var(--radius-sm); border: 0; background: none; color: var(--text-2); font-weight: 600; cursor: pointer; } .tabs [role="tab"] { min-height: 44px; padding: 0 1rem; border-radius: var(--radius-sm); border: 0; background: none; color: var(--domi-fg-2); font-weight: 600; cursor: pointer; }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface-2); color: var(--text); } .tabs [role="tab"][aria-selected="true"] { background: var(--domi-hover); color: var(--domi-fg); }
.panel { display: flex; flex-direction: column; gap: 10px; } .panel { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; } .row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.rows { list-style: none; margin: 0; padding: 0; } .rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-height: 44px; padding: 8px 0; border-top: 1px solid var(--hairline); } .rows li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-height: 44px; padding: 8px 0; border-top: 1px solid var(--domi-line); }
.grow { flex: 1 1 200px; min-width: 0; } .grow { flex: 1 1 200px; min-width: 0; }
.tname { font-weight: 600; } .tname { font-weight: 600; }
.struck { text-decoration: line-through; color: var(--muted); } .struck { text-decoration: line-through; color: var(--domi-muted); }
.grid { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; } .grid { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 719.98px) { .grid { grid-template-columns: 1fr; } } @media (max-width: 719.98px) { .grid { grid-template-columns: 1fr; } }
</style> </style>
+2
View File
@@ -12,6 +12,8 @@
"verbatimModuleSyntax": true, "verbatimModuleSyntax": true,
"isolatedModules": true, "isolatedModules": true,
"skipLibCheck": true, "skipLibCheck": true,
"allowJs": true,
"checkJs": false,
"types": ["vite/client"], "types": ["vite/client"],
"lib": ["ES2022", "DOM", "DOM.Iterable"] "lib": ["ES2022", "DOM", "DOM.Iterable"]
}, },
+4 -1
View File
@@ -18,6 +18,8 @@ stdenv.mkDerivation (finalAttrs: {
../../pnpm-lock.yaml ../../pnpm-lock.yaml
../../apps/web ../../apps/web
../../packages/ui ../../packages/ui
# @domi/ui, vendored from domi-design at a tag (docs/domi-ui.md): nothing is fetched from Gitea.
../../packages/domi-ui
]; ];
}; };
@@ -27,7 +29,8 @@ stdenv.mkDerivation (finalAttrs: {
inherit (finalAttrs) pname version src; inherit (finalAttrs) pname version src;
pnpm = pnpm_11; pnpm = pnpm_11;
fetcherVersion = 4; fetcherVersion = 4;
hash = "sha256-Hq6LE6Bwb1AeMSMDF0RUbCSX+mMAl8uLt9rPwV6tKBs="; # lib.fakeHash until a machine with Nix reports the hash for this lockfile (docs/domi-ui.md).
hash = lib.fakeHash;
}; };
buildPhase = '' buildPhase = ''
+15
View File
@@ -170,6 +170,21 @@ Identity gate, tunnel, Domi templates, ACME server, HTTP/3, migrating public sit
## 10. Handover ## 10. Handover
(Rewritten at the end of every session: what changed, what was not verified, which build is deployed, the next step.) (Rewritten at the end of every session: what changed, what was not verified, which build is deployed, the next step.)
**2026-11-22: the web UI on @domi/ui, the shared Domi design system (docs/domi-ui.md). Open as a PR, not merged.**
- **Changed:** `@domi/ui` v1.0.2 vendored in packages/domi-ui (domi-design tools/vendor.mjs; MPL-2.0) and used as `workspace:*`; its fonts, roles (`data-domi-room="ianitor"`,
the same hex) and controls replace Ianitor's copies. Buttons are its Button through Ianitor's adapter (desktop sizes
kept); every text field is its TextField with a seal; checkboxes, the secret picker and segmented controls are its
components. Ianitor's 22 role names are renamed to `--domi-*`; its own tokens and components stay in packages/ui.
Disabled buttons are natively disabled now (their reasons are visible text). apps/web's tsconfig sets `allowJs`
for @domi/ui's script-less Strike.svelte.
- **Tests:** vitest 21; svelte-check clean; Playwright web 6/6 (the Apply lookup is exact now), aula 5/5; 13 screens
compared before and after (in the PR). No Rust change.
- **Deployed:** nothing.
- **Before merging:** `fetchPnpmDeps`'s hash in deploy/nixos/web.nix is `lib.fakeHash` (no Nix here; the vendored
package means the Nix build needs no Gitea login). Paste the hash `nix build .#ianitor-web` reports, then merge.
- **Not verified:** the Nix build; Fabrica's runners installing @domi/ui; a phone (the 48 px touch sizes).
**2026-11-22: Phase 4, hardening and release.** **2026-11-22: Phase 4, hardening and release.**
- **Changed:** - **Changed:**
- Edge: a 60 s header deadline (slowloris), lookups on its own bounded resolver threads with one lookup per name, pipelining on both listeners, a proxy socket (`/run/ianitor-proxy/edge.sock`, sticky 3770) on which edge trusts Caddy's X-Forwarded-For, and `unix:` upstreams with a strict charset. - Edge: a 60 s header deadline (slowloris), lookups on its own bounded resolver threads with one lookup per name, pipelining on both listeners, a proxy socket (`/run/ianitor-proxy/edge.sock`, sticky 3770) on which edge trusts Caddy's X-Forwarded-For, and `unix:` upstreams with a strict charset.
+87
View File
@@ -0,0 +1,87 @@
# Ianitor on @domi/ui
The web UI's controls and roles come from **@domi/ui**, the shared Domi design system (Gitea `mnovak/domi-design`,
its `docs/INTEGRATE.md` §6a and `docs/MIGRATION.md`). It is **vendored** at a tag in `packages/domi-ui` (MPL-2.0,
like Ianitor; `VERSION` names the tag, v1.0.2) and used as a workspace package by `apps/web` and `packages/ui`:
```json
"@domi/ui": "workspace:*"
```
Why vendored: domi-design is private on Gitea, and the Nix build (`deploy/nixos/web.nix`) fetches the pnpm
dependencies in a sandbox without credentials. A token there would land in the world-readable Nix store and be needed
on every builder. The vendored copy is offline, reproducible and secret-free; the lockfile names no Gitea repository.
**Do not edit `packages/domi-ui`.** Changes go to domi-design as a PR. To upgrade, read the next tag's CHANGELOG.md,
then from a clone of domi-design run `node tools/vendor.mjs <this repo>/packages/domi-ui vX.Y.Z`, `pnpm install`, and
update `fetchPnpmDeps`'s hash in `deploy/nixos/web.nix` (`lib.fakeHash`, build, paste the hash Nix reports).
## What comes from where
| Part | From | Notes |
| :-- | :-- | :-- |
| Fonts (Cinzel, Cormorant Garamond, Manrope; latin and latin-ext) | @domi/ui `domi.css` | bundled from npm, nothing fetched at run time. The `@fontsource` packages are gone |
| Roles: ground, text, accent, leaf, ok, warning, danger | @domi/ui, `data-domi-room="ianitor"` on `<html>` | the same hex as before (domi-design PALETTE.md). Ianitor's old names are renamed to `--domi-*` (MIGRATION.md, ianitor table); no legacy alias file |
| Buttons | @domi/ui `Button`, through Ianitor's `Button.svelte` | see the mapping below |
| Text fields | @domi/ui `TextField`, every one with its seal | see the actions below |
| Checkboxes, the secret picker, segmented controls | @domi/ui `Checkbox`, `Select`, `Segmented` | Ianitor's `Segmented.svelte` keeps the visible name above the choices |
| Banners, dialogs, status, chips, lists, menus, toasts, the number and file inputs | Ianitor (`packages/ui`, `ia-*`) | Ianitor's own tokens (status names, washes, type sizes, spacing, radii) stay in `packages/ui/src/tokens.css` |
`packages/ui` is now Ianitor's own components on top of @domi/ui. Its old `.domi-btn`, `.domi-field` and
`.domi-input` rules are gone (they had the same class names as @domi/ui's); the link-style button is `.ia-link`.
## Buttons
| Ianitor | @domi/ui | Desktop height |
| :-- | :-- | :-- |
| default (`quiet`), `outline` | `plate`, size `lg` | 44 px, as before |
| `primary` | `primary` (the leaf), size `xl` | 50 px, as before |
| `danger` | `danger`, size `lg` | 44 px |
| `small` | size `md` | 34 px (was 36) |
| `full` | `block` | |
| `pending` | `status="loading"` (the interpuncts) | |
| `label` | the accessible name, through `aria-labelledby` | "+ Host" is still "Add a host" |
On a touch screen every button is at least 48 px (@domi/ui). An `onclick` that returns a Promise shows loading,
then a check or a refusal, by itself.
**A change in behaviour:** a disabled button is now natively disabled, so it is skipped by Tab. Before, it was
`aria-disabled` and stayed focusable so its reason could be read. Every disabled button with a reason (Apply,
Restore this version, + Host while changes are blocked) shows that reason as visible text beside it, which is
@domi/ui's rule ("say elsewhere why"). Copy link is *working*, not disabled, while the link is being made, so the
share dialog still opens with the focus on it.
## Text fields and their seals
| Field | Seal | Enter |
| :-- | :-- | :-- |
| Host form: every text field but the last | `next` | goes to the next field |
| Host form: the last text field shown | `save`, "Apply this host" | applies the form, as Apply does |
| Share link: only addresses starting with | `save`, "Make the link for these addresses" | makes a new link (as leaving the field did) |
| Share link: password | `save`, "Ask for this password on the link" | as Use this password |
| Device name | `send`, "Request the certificate" | as Issue |
| New token's name | `save`, "Rename the token" | renames it now (before, only when the dialog closed) |
| Signed certificate (pasted) | `send`, "Use the pasted certificate" | a new line (`enterSends="never"`); Ctrl+Enter or the seal uses it |
The host form still checks a field when the focus leaves it, now when it leaves the field and its seal.
## Type checking
@domi/ui's `Strike.svelte` has no `<script lang="ts">`, so TypeScript reads it as JavaScript. `apps/web/tsconfig.json`
sets `allowJs` (with `checkJs` off), as domi-design's own tsconfig does; without it a strict svelte-check refuses the
import (implicit any).
## Risks
- **The Nix hash is not filled in yet.** `fetchPnpmDeps`'s hash in `deploy/nixos/web.nix` is `lib.fakeHash` because
no machine here has Nix. The first `nix build .#ianitor-web` fails and prints the hash to paste. **Do not merge
before it is pasted and the build passes.**
- A visual change Mark has not seen beyond the asked-for controls: the field labels are @domi/ui's (13 px, 600),
and Ianitor's group labels (Certificate, Visit log, What is it) follow them so a form reads as one; the
segmented controls are as wide as their choices, not the panel.
## Atrium Domi
Ianitor runs on the home server; Atrium Domi lists programs on Mark's PC (Atrium `docs/APP_CONTRACT.md`), so
Ianitor has no room there and no `domi-app.toml`. If it ever gets one: `free = true` (Mark's pricing: Ianitor is
free).
+3
View File
@@ -119,6 +119,9 @@ That is a remote API with its own authentication (control's API tokens, docs/api
So Ianitor stops before Part A. If a Domi app ever needs to ask Ianitor for something, the answer is a scoped API So Ianitor stops before Part A. If a Domi app ever needs to ask Ianitor for something, the answer is a scoped API
token and a documented call, written in its own design doc. token and a documented call, written in its own design doc.
For the same reason Ianitor has no room in Atrium Domi, which lists programs on Mark's PC. Mark's pricing, should it
ever get one: Ianitor is free (`free = true`; docs/domi-ui.md).
## 5. Showcase: the e2e suite, screenshots and videos ## 5. Showcase: the e2e suite, screenshots and videos
`apps/web/playwright.config.ts`, `apps/web/e2e/`: `apps/web/playwright.config.ts`, `apps/web/e2e/`:
+4
View File
@@ -39,6 +39,10 @@ Conventions in this file:
## 1. Design tokens (packages/ui) ## 1. Design tokens (packages/ui)
> Since 2026-11-22 the roles, fonts and controls come from @domi/ui (docs/domi-ui.md): the colours below are its
> `--domi-*` roles with Ianitor's values, and the buttons and fields are its components. The rest of this section
> still describes what Ianitor keeps.
### 1.1 The block to paste ### 1.1 The block to paste
`packages/ui/src/tokens.css`. Apply the class `ia` to `<body>` (the artifact puts the tokens on `.ia`; `packages/ui/src/tokens.css`. Apply the class `ia` to `<body>` (the artifact puts the tokens on `.ia`;
+34
View File
@@ -0,0 +1,34 @@
# Changelog
## 1.0.2 (2026-11-22)
- Licensed under the Mozilla Public License 2.0 (was unlicensed), so a public Domi app may carry a copy (Mark allowed
it for Rosea). `LICENSE` and `CHANGELOG.md` ship with the package; INTEGRATE.md gains "Vendoring". No code or
visual change.
## 1.0.1 (2026-11-22)
- Fix: the primary leaf's hover gradient lightened every stop by mixing in white, which dropped a white label below
4.5:1 on the top stop (Arena Domi 3.94:1; also Atrium Domi, Liber, Calenda and other white-label leaves). The hover
stops are now computed per app and theme in the token build (`--domi-leaf-hover-hi|mid|lo-<app>`), keep the
1.0.0 mix where the label still reads, and are checked to 4.5:1 like the resting stops. Leaves with a dark label
look exactly as before. Reported by the Arena Domi session.
## 1.0.0 (2026-11-22)
First release.
- Audit of every Domi app's styles (docs/AUDIT.md, audit/raw.json).
- Palette of 29 apps by role, from their code (Arena Domi: a proposed teal, it has no code yet); shared dark theme (ink) and a new light theme (parchment) with every
accent derived to WCAG AA; rooms keep each app's own dark ground. CSS, JSON, WPF XAML; PALETTE.md with contrast.
- Foundation tokens: type (Cinzel, Cormorant Garamond, Manrope from npm), space, radius, sizes with a 48 dp touch
floor, motion with reduced motion.
- Components (Svelte 5 and plain CSS): Button (plate, primary leaf, quiet, danger, armed confirm; loading, success,
error; glint, press sink, seal impression; keyboard press), TextField with the integrated send seal (send, search,
save, next; single and multi-line; sending, sent, error; Enter and Shift+Enter; soft keyboard rule), Checkbox,
Radio, Switch, Select, Segmented, Icon.
- Legacy aliases per app (`@domi/ui/legacy/<app>.css`) and MIGRATION.md.
- Showcase; unit tests; screenshot tests per component and state (baselines attached to the release).
Not in 1.0: the desktop window frame (`.win`, `WindowFrame.svelte`), dialogs, menus, non-text inputs (number
stepper, date, colour).
+373
View File
@@ -0,0 +1,373 @@
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
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/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
+1
View File
@@ -0,0 +1 @@
v1.0.2
+37
View File
@@ -0,0 +1,37 @@
{
"name": "@domi/ui",
"version": "1.0.2",
"description": "The Domi design system: tokens for every Domi app, struck buttons and fields with an integrated send button, Svelte 5 components. Vendored copy of v1.0.2: do not edit here; change domi-design and vendor the next tag.",
"license": "MPL-2.0",
"type": "module",
"svelte": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": {
"types": "./src/index.ts",
"svelte": "./src/index.ts",
"default": "./src/index.ts"
},
"./tokens": {
"types": "./src/tokens/generated.ts",
"default": "./src/tokens/generated.ts"
},
"./domi.css": "./src/css/domi.css",
"./tokens.css": "./src/css/tokens.css",
"./base.css": "./src/css/base.css",
"./components.css": "./src/css/components.css",
"./fonts.css": "./src/css/fonts.css",
"./legacy/*": "./src/css/legacy/*"
},
"sideEffects": [
"**/*.css"
],
"peerDependencies": {
"svelte": "^5.20.0"
},
"dependencies": {
"@fontsource-variable/cinzel": "5.3.0",
"@fontsource-variable/cormorant-garamond": "5.3.0",
"@fontsource-variable/manrope": "5.3.0"
}
}
@@ -0,0 +1,151 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import type { HTMLButtonAttributes } from 'svelte/elements';
import Icon from './Icon.svelte';
import Strike from './Strike.svelte';
import { strike } from '../lib/strike';
import { failureText, type ButtonState } from '../lib/keys';
import type { IconName } from '../lib/icons';
interface Props extends Omit<HTMLButtonAttributes, 'onclick' | 'class' | 'children'> {
/** plate: every ordinary action. primary: the one leaf per screen. quiet: toolbars and third actions. danger: deletes. */
variant?: 'plate' | 'primary' | 'quiet' | 'danger';
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
icon?: IconName;
/** Icon only: the label becomes the accessible name and the tooltip. */
iconOnly?: boolean;
/** The words on the button. Required for iconOnly (it is the accessible name), else use children. */
label?: string;
block?: boolean;
/** Set to drive the state yourself. Left unset, a Promise returned by onclick drives it. */
status?: ButtonState;
/** May return a Promise: the button shows loading, then success (briefly) or error. */
onclick?: (event: MouseEvent) => unknown;
/**
* Two-step confirmation for danger: the first press arms the button and shows this text ("Press again to
* delete"); a second press within confirmFor ms runs onclick. Escape, blur or the timeout disarms it.
*/
confirm?: string;
confirmFor?: number;
/** Announced while working, when done, and when it failed (unless the error is a DomiError with its own text). */
busyText?: string;
doneText?: string;
failText?: string;
/** Showcase and tests only: show hover, press or focus without the pointer. */
force?: string;
class?: string;
children?: Snippet;
}
let {
variant = 'plate',
size = 'md',
icon,
iconOnly = false,
label,
block = false,
status,
onclick,
confirm,
confirmFor = 4000,
busyText = 'Working',
doneText = 'Done',
failText = 'That did not work. Try again.',
force,
class: cls = '',
disabled = false,
type = 'button',
children,
...rest
}: Props = $props();
let auto = $state<ButtonState>('idle');
let armed = $state(false);
let said = $state('');
let timer: ReturnType<typeof setTimeout> | undefined;
let armTimer: ReturnType<typeof setTimeout> | undefined;
const shown = $derived<ButtonState>(status ?? auto);
const busy = $derived(shown === 'loading');
function hold(): number {
const v = getComputedStyle(document.documentElement).getPropertyValue('--domi-dur-hold');
return Math.max(900, parseFloat(v) || 1400);
}
function disarm() {
armed = false;
clearTimeout(armTimer);
}
async function press(event: MouseEvent) {
if (disabled || busy) {
event.preventDefault();
return;
}
if (confirm && !armed) {
armed = true;
said = confirm;
clearTimeout(armTimer);
armTimer = setTimeout(disarm, confirmFor);
return;
}
disarm();
const result = onclick?.(event);
const thenable = result != null && typeof (result as PromiseLike<unknown>).then === 'function';
if (!thenable || status !== undefined) return;
clearTimeout(timer);
auto = 'loading';
said = busyText;
try {
await result;
auto = 'success';
said = doneText;
timer = setTimeout(() => (auto = 'idle'), hold());
} catch (err) {
auto = 'error';
said = failureText(err, failText);
}
}
$effect(() => () => {
clearTimeout(timer);
clearTimeout(armTimer);
});
</script>
<button
{...rest}
{type}
{disabled}
class={[
'domi-btn',
variant !== 'plate' && `domi-btn--${variant}`,
size !== 'md' && `domi-btn--${size}`,
iconOnly && 'domi-btn--icon',
block && 'domi-btn--block',
cls,
]}
data-state={shown === 'idle' ? undefined : shown}
data-armed={armed ? '' : undefined}
data-force={force}
aria-busy={busy ? 'true' : undefined}
aria-disabled={busy ? 'true' : undefined}
aria-label={iconOnly ? (armed ? confirm : label) : undefined}
title={iconOnly ? (armed ? confirm : label) : undefined}
onclick={press}
onkeydown={(e) => e.key === 'Escape' && armed && disarm()}
onblur={disarm}
use:strike
>
<span class="domi-btn__label">
{#if shown === 'error'}<Icon name="alert" />{:else if icon}<Icon name={icon} />{/if}
{#if !iconOnly}
{#if armed}{confirm}{:else if children}{@render children()}{:else}{label}{/if}
{/if}
</span>
<span class="domi-btn__state domi-btn__state--loading"><Strike /></span>
<span class="domi-btn__state domi-btn__state--success">
{#if shown === 'success'}<Icon name="check" draw />{/if}
</span>
</button>
<span class="domi-sr" role="status">{said}</span>
@@ -0,0 +1,59 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import { icons } from '../lib/icons';
interface Props {
checked?: boolean;
/** Part of a group is chosen: shows a bar and reads as "mixed". */
indeterminate?: boolean;
label?: string;
hint?: string;
name?: string;
value?: string;
disabled?: boolean;
required?: boolean;
onchange?: (checked: boolean) => void;
force?: string;
class?: string;
children?: Snippet;
}
let {
checked = $bindable(false),
indeterminate = $bindable(false),
label,
hint,
name,
value,
disabled = false,
required = false,
onchange,
force,
class: cls = '',
children,
}: Props = $props();
const uid = $props.id();
</script>
<label class={['domi-choice', cls]} data-force={force}>
<span class="domi-choice__control">
<input
class="domi-choice__input"
type="checkbox"
bind:checked
bind:indeterminate
{name}
{value}
{disabled}
{required}
aria-describedby={hint ? `domi-hint-${uid}` : undefined}
onchange={() => onchange?.(checked)}
/>
<svg class="domi-choice__mark" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d={indeterminate ? icons.minus : icons.check} />
</svg>
</span>
<span class="domi-choice__text">
<span>{#if children}{@render children()}{:else}{label}{/if}</span>
{#if hint}<span class="domi-choice__hint" id={`domi-hint-${uid}`}>{hint}</span>{/if}
</span>
</label>
@@ -0,0 +1,22 @@
<script lang="ts">
import { icons, type IconName } from '../lib/icons';
interface Props {
name: IconName;
/** Draws the path in one stroke when it appears (the check of a finished action). */
draw?: boolean;
class?: string;
}
let { name, draw = false, class: cls = '' }: Props = $props();
</script>
<svg
class={['domi-icon', draw && 'domi-check-draw', cls]}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.8"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
focusable="false"><path d={icons[name]} /></svg>
@@ -0,0 +1,39 @@
<script lang="ts">
import type { Snippet } from 'svelte';
interface Props {
/** The group's chosen value. Bind the same variable on every radio of the group: bind:group. */
group?: string;
value: string;
name: string;
label?: string;
hint?: string;
disabled?: boolean;
onchange?: (value: string) => void;
force?: string;
class?: string;
children?: Snippet;
}
let { group = $bindable(''), value, name, label, hint, disabled = false, onchange, force, class: cls = '', children }: Props = $props();
const uid = $props.id();
</script>
<label class={['domi-choice', 'domi-choice--radio', cls]} data-force={force}>
<span class="domi-choice__control">
<input
class="domi-choice__input"
type="radio"
bind:group
{value}
{name}
{disabled}
aria-describedby={hint ? `domi-hint-${uid}` : undefined}
onchange={() => onchange?.(value)}
/>
<span class="domi-choice__mark" aria-hidden="true"></span>
</span>
<span class="domi-choice__text">
<span>{#if children}{@render children()}{:else}{label}{/if}</span>
{#if hint}<span class="domi-choice__hint" id={`domi-hint-${uid}`}>{hint}</span>{/if}
</span>
</label>
@@ -0,0 +1,62 @@
<script lang="ts">
import Icon from './Icon.svelte';
import { strike } from '../lib/strike';
import type { DomiOption } from '../types';
interface Props {
value?: string;
/** Names the group for a screen reader: "View". */
label: string;
options: DomiOption[];
disabled?: boolean;
onchange?: (value: string) => void;
/** Showcase only: value → forced state for that segment. */
force?: Record<string, string>;
class?: string;
}
let { value = $bindable(''), label, options, disabled = false, onchange, force = {}, class: cls = '' }: Props = $props();
let group: HTMLDivElement | undefined = $state();
const enabled = $derived(options.filter((o) => !o.disabled && !disabled));
function choose(v: string) {
if (v === value) return;
value = v;
onchange?.(v);
}
// A radio group: one tab stop; arrows move the choice and the focus, Home and End jump.
function keydown(e: KeyboardEvent) {
const i = enabled.findIndex((o) => o.value === value);
let j = i;
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') j = (i + 1) % enabled.length;
else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') j = (i - 1 + enabled.length) % enabled.length;
else if (e.key === 'Home') j = 0;
else if (e.key === 'End') j = enabled.length - 1;
else return;
e.preventDefault();
const next = enabled[j];
if (!next) return;
choose(next.value);
group?.querySelector<HTMLButtonElement>(`[data-value="${CSS.escape(next.value)}"]`)?.focus();
}
</script>
<div bind:this={group} class={['domi-segmented', cls]} role="radiogroup" aria-label={label} tabindex="-1" onkeydown={keydown}>
{#each options as o (o.value)}
<button
type="button"
role="radio"
class="domi-segmented__item"
data-value={o.value}
data-force={force[o.value]}
aria-checked={o.value === value}
tabindex={o.value === value || (!value && o === enabled[0]) ? 0 : -1}
disabled={disabled || o.disabled}
onclick={() => choose(o.value)}
use:strike
>
{#if o.icon}<Icon name={o.icon} />{/if}{o.label}
</button>
{/each}
</div>
@@ -0,0 +1,44 @@
<script lang="ts">
import Icon from './Icon.svelte';
import type { DomiOption } from '../types';
interface Props {
/** Left unset, the first option is chosen. */
value?: string;
label: string;
hideLabel?: boolean;
options: DomiOption[];
hint?: string;
name?: string;
disabled?: boolean;
required?: boolean;
onchange?: (value: string) => void;
force?: string;
class?: string;
}
let { value = $bindable(), label, hideLabel = false, options, hint, name, disabled = false, required = false, onchange, force, class: cls = '' }: Props = $props();
const uid = $props.id();
</script>
<!-- A native select: on Android and iOS it opens the system picker, which is the right control for a thumb. -->
<div class={['domi-field', cls]}>
<label class={['domi-field__label', hideLabel && 'domi-sr']} for={`domi-select-${uid}`}>{label}</label>
<div class="domi-select" data-force={force}>
<select
class="domi-select__input"
id={`domi-select-${uid}`}
bind:value
{name}
{disabled}
{required}
aria-describedby={hint ? `domi-hint-${uid}` : undefined}
onchange={() => onchange?.(value ?? '')}
>
{#each options as o (o.value)}
<option value={o.value} disabled={o.disabled}>{o.label}</option>
{/each}
</select>
<Icon name="chevron-down" />
</div>
{#if hint}<p class="domi-field__hint" id={`domi-hint-${uid}`}>{hint}</p>{/if}
</div>
@@ -0,0 +1,2 @@
<!-- The loading mark: three Roman interpuncts struck in turn. Decorative; the state is announced in words. -->
<span class="domi-strike" aria-hidden="true"><i></i><i></i><i></i></span>
@@ -0,0 +1,23 @@
<script lang="ts">
interface Props {
checked?: boolean;
/** Says what is on: "Sync over mobile data". The switch reads as on or off after it. */
label: string;
disabled?: boolean;
onchange?: (checked: boolean) => void;
force?: string;
class?: string;
}
let { checked = $bindable(false), label, disabled = false, onchange, force, class: cls = '' }: Props = $props();
function toggle() {
if (disabled) return;
checked = !checked;
onchange?.(checked);
}
</script>
<button type="button" role="switch" class={['domi-switch', cls]} aria-checked={checked} {disabled} data-force={force} onclick={toggle}>
<span class="domi-switch__track" aria-hidden="true"><span class="domi-switch__knob"></span></span>
<span>{label}</span>
</button>
@@ -0,0 +1,324 @@
<script lang="ts">
import type { HTMLInputAttributes } from 'svelte/elements';
import Icon from './Icon.svelte';
import Strike from './Strike.svelte';
import { strike } from '../lib/strike';
import { canSend, enterAction, failureText, isSoftKeyboard, type FieldState } from '../lib/keys';
import type { IconName } from '../lib/icons';
type Action = 'send' | 'search' | 'next' | 'save';
interface Props {
/** The text. Bind it: bind:value. */
value?: string;
/** The visible label. Every field has one; hideLabel keeps it for screen readers only (a chat composer). */
label: string;
hideLabel?: boolean;
hint?: string;
/** An error you show (validation). The field also shows its own when onsend fails. */
error?: string;
placeholder?: string;
type?: 'text' | 'email' | 'url' | 'password' | 'search' | 'tel' | 'number';
/** A multi-line field that grows with its text up to `rows` lines. */
multiline?: boolean;
rows?: number;
/**
* What the seal does. send (arrow): sends and clears. search (glass): searches. save (check): saves and keeps
* the text. next (chevron): in a form, goes to the next field; the last field of a form uses send or save.
*/
action?: Action;
/** The seal's accessible name, the words a screen reader says: "Send message", "Search books". */
actionLabel?: string;
/** Runs on Enter or the seal. Return a Promise to show sending, then sent or the error. */
onsend?: (value: string) => unknown;
/** Empty the field after a successful send. Default: true for send, false otherwise. */
clearOnSend?: boolean;
enterSends?: 'auto' | 'always' | 'never';
/** Set to drive the state yourself. */
status?: FieldState;
sendingText?: string;
sentText?: string;
failText?: string;
size?: 'md' | 'lg';
optional?: boolean;
disabled?: boolean;
readonly?: boolean;
required?: boolean;
name?: string;
id?: string;
autocomplete?: HTMLInputAttributes['autocomplete'];
inputmode?: HTMLInputAttributes['inputmode'];
maxlength?: number;
spellcheck?: boolean;
autofocus?: boolean;
/** Showcase and tests only: 'hover', 'focus' on the field, 'press'/'hover'/'focus' on the seal via sendForce. */
force?: string;
sendForce?: string;
class?: string;
/** The input element, for focusing it from outside. */
input?: HTMLInputElement | HTMLTextAreaElement | null;
}
let {
value = $bindable(''),
label,
hideLabel = false,
hint,
error,
placeholder,
type = 'text',
multiline = false,
rows = 6,
action = 'send',
actionLabel,
onsend,
clearOnSend,
enterSends = 'auto',
status,
sendingText,
sentText,
failText,
size = 'md',
optional = false,
disabled = false,
readonly = false,
required = false,
name,
id,
autocomplete,
inputmode,
maxlength,
spellcheck,
autofocus = false,
force,
sendForce,
class: cls = '',
input = $bindable(null),
}: Props = $props();
const uid = $props.id();
const fieldId = $derived(id ?? `domi-field-${uid}`);
const hintId = `domi-hint-${uid}`;
const errorId = `domi-error-${uid}`;
const words: Record<Action, { label: string; icon: IconName; key: 'send' | 'search' | 'next' | 'done'; busy: string; done: string; fail: string }> = {
send: { label: 'Send', icon: 'send', key: 'send', busy: 'Sending', done: 'Sent', fail: 'Could not send. Try again.' },
search: { label: 'Search', icon: 'search', key: 'search', busy: 'Searching', done: 'Searched', fail: 'Could not search. Try again.' },
save: { label: 'Save', icon: 'save', key: 'done', busy: 'Saving', done: 'Saved', fail: 'Could not save. Try again.' },
next: { label: 'Next field', icon: 'next', key: 'next', busy: 'Checking', done: '', fail: 'Check this field.' },
};
const w = $derived(words[action]);
let auto = $state<FieldState>('idle');
let failure = $state('');
let said = $state('');
let revealed = $state(false);
let timer: ReturnType<typeof setTimeout> | undefined;
const shown = $derived<FieldState>(status ?? auto);
const empty = $derived(value.trim().length === 0);
const sendable = $derived(canSend(value, shown, disabled || readonly));
// While sending and just after, the seal stays lit (with the interpuncts, then the check) though it cannot be pressed.
const lit = $derived(sendable || shown === 'sending' || shown === 'sent');
const message = $derived(error ?? (shown === 'error' ? failure : ''));
const described = $derived([hint && hintId, message && errorId].filter(Boolean).join(' ') || undefined);
const inputType = $derived(type === 'password' && revealed ? 'text' : type);
const clears = $derived(clearOnSend ?? action === 'send');
function hold(): number {
const v = getComputedStyle(document.documentElement).getPropertyValue('--domi-dur-hold');
return Math.max(900, parseFloat(v) || 1400);
}
function nextField(from: HTMLElement) {
const scope = from.closest('form') ?? document;
const all = [...scope.querySelectorAll<HTMLElement>('.domi-field__input, input, textarea, select')].filter(
(el) => !el.hasAttribute('disabled') && el.getAttribute('type') !== 'hidden',
);
const i = all.indexOf(from);
all[i + 1]?.focus();
}
async function submit() {
if (!sendable || !input) return;
const el = input;
const text = value;
clearTimeout(timer);
failure = '';
if (!onsend) {
// No handler: behave like the form's own submit (or, for next, move on).
if (action === 'next') nextField(el);
else el.form?.requestSubmit();
return;
}
const result = onsend(text);
const thenable = result != null && typeof (result as PromiseLike<unknown>).then === 'function';
if (status !== undefined) return;
if (!thenable) return done(el);
auto = 'sending';
said = sendingText ?? w.busy;
try {
await result;
done(el);
} catch (err) {
auto = 'error';
failure = failureText(err, failText ?? w.fail);
said = failure;
el.focus();
}
}
function done(el: HTMLInputElement | HTMLTextAreaElement) {
if (clears) value = '';
if (action === 'next') {
auto = 'idle';
nextField(el);
return;
}
auto = 'sent';
said = sentText ?? w.done;
timer = setTimeout(() => (auto = 'idle'), hold());
if (document.activeElement !== el && el.isConnected) el.focus();
}
function keydown(e: KeyboardEvent) {
if (e.key === 'Escape' && shown === 'error' && status === undefined) {
auto = 'idle';
failure = '';
return;
}
const r = enterAction(e, { multiline, enterSends, softKeyboard: isSoftKeyboard() });
if (r === 'send') {
e.preventDefault();
if (shown !== 'sending') void submit();
} else if (r === 'ignore' && e.key === 'Enter' && e.altKey && !multiline) {
// Alt+Enter must not submit the form. An Enter that ends an input method's composition is left alone.
e.preventDefault();
}
}
function typed() {
if (shown === 'error' && status === undefined) {
auto = 'idle';
failure = '';
}
if (shown === 'sent' && status === undefined) auto = 'idle';
grow();
}
// field-sizing: content grows the textarea in Chromium (WebView2, Android WebView); elsewhere, grow it here.
const sizesItself = typeof CSS !== 'undefined' && CSS.supports?.('field-sizing', 'content');
function grow() {
if (!multiline || sizesItself || !input) return;
input.style.height = 'auto';
input.style.height = `${input.scrollHeight}px`;
}
$effect(() => {
void value;
grow();
});
$effect(() => () => clearTimeout(timer));
$effect(() => {
if (autofocus) input?.focus();
});
function focusInput(e: MouseEvent) {
if (e.target === e.currentTarget) input?.focus();
}
</script>
<div
class={['domi-field', multiline && 'domi-field--multiline', size === 'lg' && 'domi-field--lg', cls]}
data-state={shown === 'idle' ? undefined : shown}
data-empty={empty ? '' : undefined}
data-disabled={disabled ? '' : undefined}
>
<label class={['domi-field__label', hideLabel && 'domi-sr']} for={fieldId}>
{label}{#if optional}<span class="domi-field__optional">{" (optional)"}</span>{/if}
</label>
<!-- svelte-ignore a11y_click_events_have_key_events a11y_no_static_element_interactions -->
<div class="domi-field__well" role="presentation" data-force={force} onclick={focusInput}>
{#if multiline}
<textarea
bind:this={input}
bind:value
class="domi-field__input"
id={fieldId}
{name}
{placeholder}
{disabled}
readonly={readonly || shown === 'sending'}
{required}
{maxlength}
{spellcheck}
rows="1"
style:--_rows-max={rows}
enterkeyhint={w.key === 'done' ? 'done' : 'enter'}
aria-invalid={message ? 'true' : undefined}
aria-describedby={described}
onkeydown={keydown}
oninput={typed}
></textarea>
{:else}
<input
bind:this={input}
bind:value
class="domi-field__input"
id={fieldId}
type={inputType}
{name}
{placeholder}
{disabled}
readonly={readonly || shown === 'sending'}
{required}
{maxlength}
{spellcheck}
{autocomplete}
{inputmode}
enterkeyhint={w.key === 'done' ? 'done' : w.key}
aria-invalid={message ? 'true' : undefined}
aria-describedby={described}
onkeydown={keydown}
oninput={typed}
/>
{/if}
{#if type === 'password'}
<button
type="button"
class="domi-field__tool"
aria-label={revealed ? 'Hide password' : 'Show password'}
aria-pressed={revealed}
aria-controls={fieldId}
{disabled}
onclick={() => (revealed = !revealed)}
>
<Icon name={revealed ? 'eye-off' : 'eye'} />
</button>
{/if}
<button
type="button"
class="domi-send"
aria-label={actionLabel ?? w.label}
aria-disabled={lit ? undefined : 'true'}
aria-busy={shown === 'sending' ? 'true' : undefined}
aria-controls={fieldId}
tabindex={lit ? undefined : -1}
title={actionLabel ?? w.label}
data-state={shown === 'sending' ? 'sending' : undefined}
data-force={sendForce}
onclick={() => void submit()}
use:strike
>
{#if shown === 'sending'}
<Strike />
{:else if shown === 'sent'}
<Icon name="check" draw />
{:else}
<Icon name={w.icon} />
{/if}
</button>
</div>
{#if hint}<p class="domi-field__hint" id={hintId}>{hint}</p>{/if}
{#if message}<p class="domi-field__error" id={errorId}><Icon name="alert" />{message}</p>{/if}
<span class="domi-sr" role="status">{said}</span>
</div>
+229
View File
@@ -0,0 +1,229 @@
/*
* @domi/ui base: the tokens derived from the roles, the touch floor, focus, and the motion every component shares.
* Load after tokens.css. Hand-written; the roles come from tokens.css.
*
* Derived tokens are declared on every element that can change roles (the root, data-domi-app, data-domi-room),
* because a custom property holding var() is resolved where it is declared: declared on :root only, a tile with
* data-domi-app="culina" would keep the root's tint.
*/
:root,
[data-domi-app],
[data-domi-room] {
--domi-tint: color-mix(in srgb, var(--domi-accent) 13%, transparent);
--domi-tint-strong: color-mix(in srgb, var(--domi-accent) 22%, transparent);
--domi-edge-accent: color-mix(in srgb, var(--domi-accent) 55%, transparent);
--domi-edge-danger: color-mix(in srgb, var(--domi-danger) 60%, transparent);
--domi-edge-ok: color-mix(in srgb, var(--domi-ok) 60%, transparent);
--domi-tint-danger: color-mix(in srgb, var(--domi-danger) 9%, transparent);
--domi-halo: 0 0 0 4px color-mix(in srgb, var(--domi-accent) 22%, transparent);
/* The leaf: the app's metal beaten thin over the one primary action of a screen. */
--domi-leaf: linear-gradient(180deg, var(--domi-leaf-hi) 0%, var(--domi-leaf-mid) 52%, var(--domi-leaf-lo) 100%);
/* Hover stops come from the token build, checked so the label keeps 4.5:1 (v1.0.1). */
--domi-leaf-hover: linear-gradient(180deg, var(--domi-leaf-hover-hi) 0%, var(--domi-leaf-hover-mid) 52%, var(--domi-leaf-hover-lo) 100%);
--domi-leaf-press: linear-gradient(180deg, var(--domi-leaf-lo) 0%, var(--domi-leaf-mid) 60%, var(--domi-leaf-hi) 100%);
--domi-leaf-bevel: 0 0 0 1px color-mix(in srgb, var(--domi-leaf-edge) 24%, transparent),
0 14px 34px -14px color-mix(in srgb, var(--domi-leaf-mid) 70%, transparent),
inset 0 1px 0 color-mix(in srgb, var(--domi-leaf-hi) 40%, white), inset 0 -2px 0 color-mix(in srgb, var(--domi-leaf-lo) 62%, black);
--domi-leaf-bevel-press: 0 0 0 1px color-mix(in srgb, var(--domi-leaf-edge) 24%, transparent),
0 6px 16px -10px color-mix(in srgb, var(--domi-leaf-mid) 55%, transparent),
inset 0 2px 4px color-mix(in srgb, var(--domi-leaf-lo) 50%, black);
/* The plate: every other button, struck from the ground's own stone. */
--domi-plate: linear-gradient(180deg, var(--domi-plate-top), var(--domi-plate-bottom));
--domi-plate-hover: linear-gradient(180deg, var(--domi-plate-top-hover), var(--domi-plate-bottom-hover));
--domi-plate-press: linear-gradient(180deg, var(--domi-plate-bottom), var(--domi-plate-top));
--domi-sheen: color-mix(in srgb, var(--domi-fg) 10%, transparent);
--domi-sheen-strong: color-mix(in srgb, var(--domi-fg) 18%, transparent);
--domi-glint: color-mix(in srgb, white 22%, transparent);
--domi-glint-leaf: color-mix(in srgb, white 42%, transparent);
--domi-impression: color-mix(in srgb, var(--domi-fg) 22%, transparent);
--domi-impression-leaf: color-mix(in srgb, var(--domi-leaf-lo) 55%, black);
--domi-plate-shadow: inset 0 1px 0 var(--domi-sheen), inset 0 -1px 0 rgb(0 0 0 / 0.45), 0 1px 0 rgb(0 0 0 / 0.55),
0 8px 18px -12px rgb(0 0 0 / 0.9);
--domi-plate-shadow-hover: inset 0 1px 0 var(--domi-sheen-strong), inset 0 -1px 0 rgb(0 0 0 / 0.45), 0 1px 0 rgb(0 0 0 / 0.55),
0 10px 22px -12px rgb(0 0 0 / 0.95);
--domi-plate-shadow-press: inset 0 2px 5px rgb(0 0 0 / 0.65), inset 0 -1px 0 var(--domi-sheen);
/* A field is cut into the stone. */
--domi-carved: inset 0 2px 6px rgb(0 0 0 / 0.55), inset 0 -1px 0 var(--domi-sheen);
--domi-dialog-shadow: 0 40px 100px -40px rgb(0 0 0 / 0.95);
}
/* On parchment the light falls the same way, but the shade is umber and softer. */
:root[data-domi-theme='light'],
:root[data-domi-theme='light'] [data-domi-app],
:root[data-domi-theme='light'] [data-domi-room] {
--domi-sheen: rgb(255 255 255 / 0.85);
--domi-sheen-strong: rgb(255 255 255 / 1);
--domi-glint: rgb(255 255 255 / 0.7);
--domi-impression: color-mix(in srgb, var(--domi-fg) 14%, transparent);
--domi-plate-shadow: inset 0 1px 0 var(--domi-sheen), inset 0 -1px 0 rgb(90 66 30 / 0.16), 0 1px 0 rgb(90 66 30 / 0.12),
0 8px 16px -12px rgb(90 66 30 / 0.45);
--domi-plate-shadow-hover: inset 0 1px 0 var(--domi-sheen-strong), inset 0 -1px 0 rgb(90 66 30 / 0.18), 0 1px 0 rgb(90 66 30 / 0.14),
0 10px 20px -12px rgb(90 66 30 / 0.5);
--domi-plate-shadow-press: inset 0 2px 5px rgb(90 66 30 / 0.28), inset 0 -1px 0 var(--domi-sheen);
--domi-carved: inset 0 2px 5px rgb(90 66 30 / 0.16), inset 0 -1px 0 var(--domi-sheen);
--domi-dialog-shadow: 0 30px 80px -36px rgb(90 66 30 / 0.55);
}
@media (prefers-color-scheme: light) {
:root[data-domi-theme='auto'],
:root[data-domi-theme='auto'] [data-domi-app],
:root[data-domi-theme='auto'] [data-domi-room] {
--domi-sheen: rgb(255 255 255 / 0.85);
--domi-sheen-strong: rgb(255 255 255 / 1);
--domi-glint: rgb(255 255 255 / 0.7);
--domi-impression: color-mix(in srgb, var(--domi-fg) 14%, transparent);
--domi-plate-shadow: inset 0 1px 0 var(--domi-sheen), inset 0 -1px 0 rgb(90 66 30 / 0.16), 0 1px 0 rgb(90 66 30 / 0.12),
0 8px 16px -12px rgb(90 66 30 / 0.45);
--domi-plate-shadow-hover: inset 0 1px 0 var(--domi-sheen-strong), inset 0 -1px 0 rgb(90 66 30 / 0.18),
0 1px 0 rgb(90 66 30 / 0.14), 0 10px 20px -12px rgb(90 66 30 / 0.5);
--domi-plate-shadow-press: inset 0 2px 5px rgb(90 66 30 / 0.28), inset 0 -1px 0 var(--domi-sheen);
--domi-carved: inset 0 2px 5px rgb(90 66 30 / 0.16), inset 0 -1px 0 var(--domi-sheen);
--domi-dialog-shadow: 0 30px 80px -36px rgb(90 66 30 / 0.55);
}
}
/*
* The touch floor. On a coarse pointer (Android, a touch screen) every control is at least 48 px and every field
* 56 px; on a mouse and keyboard the desktop sizes hold. data-domi-density forces one or the other.
*/
:root {
--domi-target: 0px;
--domi-field-target: 0px;
--domi-send-target: 0px;
}
@media (pointer: coarse) {
:root {
--domi-target: var(--domi-size-touch);
--domi-field-target: var(--domi-size-field-touch);
--domi-send-target: var(--domi-size-send-touch);
}
}
:root[data-domi-density='touch'] {
--domi-target: var(--domi-size-touch);
--domi-field-target: var(--domi-size-field-touch);
--domi-send-target: var(--domi-size-send-touch);
}
:root[data-domi-density='pointer'] {
--domi-target: 0px;
--domi-field-target: 0px;
--domi-send-target: 0px;
}
/* A page that opts in to the Domi ground. */
.domi-page {
min-height: 100%;
margin: 0;
background: var(--domi-bg);
color: var(--domi-fg);
font: 400 var(--domi-text-md) / var(--domi-leading-md) var(--domi-font-hand);
-webkit-font-smoothing: antialiased;
}
.domi-wordmark {
font-family: var(--domi-font-inscription);
font-weight: 500;
letter-spacing: var(--domi-tracking-inscription);
color: var(--domi-accent-strong);
}
/* Hidden from sight, read by a screen reader: state announcements. */
.domi-sr {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
/* Shared motion. Every keyframe moves something (transform, or the chisel line's position) or fades a decorative
layer; none animates a colour. */
@keyframes domi-glint {
from {
transform: translateX(-130%) skewX(-18deg);
}
to {
transform: translateX(130%) skewX(-18deg);
}
}
@keyframes domi-impress {
from {
transform: scale(0.2);
opacity: 0.9;
}
to {
transform: scale(1);
opacity: 0;
}
}
@keyframes domi-strike {
0%,
60%,
100% {
transform: translateY(0) scale(0.7);
}
25% {
transform: translateY(2px) scale(1.15);
}
}
@keyframes domi-shake {
0%,
100% {
transform: translateX(0);
}
20%,
60% {
transform: translateX(-4px);
}
40%,
80% {
transform: translateX(4px);
}
}
/* The chisel line runs inside the field (background-position, so nothing leaves the field). */
@keyframes domi-carve {
from {
background-position: -70% 0;
}
to {
background-position: 170% 0;
}
}
@keyframes domi-draw {
from {
stroke-dashoffset: 24;
}
to {
stroke-dashoffset: 0;
}
}
@keyframes domi-rise {
from {
transform: translateY(3px) scale(0.86);
}
to {
transform: none;
}
}
/* Reduced motion: nothing moves, nothing is hidden for it; every state is still shown, at once. */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0ms !important;
}
}
:root[data-domi-motion='reduce'] *,
:root[data-domi-motion='reduce'] *::before,
:root[data-domi-motion='reduce'] *::after {
animation-duration: 0ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0ms !important;
}
File diff suppressed because it is too large Load Diff
+7
View File
@@ -0,0 +1,7 @@
/* @domi/ui, everything: fonts, tokens, base, components. Import once at the app root.
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/. */
@import './fonts.css';
@import './tokens.css';
@import './base.css';
@import './components.css';
+9
View File
@@ -0,0 +1,9 @@
/*
* The three Domi faces, bundled from npm (@fontsource-variable, SIL Open Font License 1.1). Nothing is fetched at
* run time. A bundler (Vite) resolves these imports; for a stack without one, copy the woff2 files named in
* docs/INTEGRATE.md and point @font-face at them. Families: 'Cinzel Variable', 'Cormorant Garamond Variable',
* 'Manrope Variable'; the token stacks fall back to the plain names the apps used before.
*/
@import '@fontsource-variable/cinzel/wght.css';
@import '@fontsource-variable/cormorant-garamond/wght.css';
@import '@fontsource-variable/manrope/wght.css';
@@ -0,0 +1,24 @@
/* amicitia's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--ground: var(--domi-bg);
--colonnade: var(--domi-chrome);
--surface: var(--domi-panel);
--surface-2: var(--domi-hover);
--hairline: var(--domi-line);
--control-edge: var(--domi-edge);
--text: var(--domi-fg);
--text-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--primary-high: var(--domi-leaf-hi);
--primary-mid: var(--domi-leaf-mid);
--primary-low: var(--domi-leaf-lo);
--primary-edge: var(--domi-leaf-edge);
--on-primary: var(--domi-leaf-fg);
--second: var(--domi-second);
--danger: var(--domi-danger);
--ok: var(--domi-ok);
}
+48
View File
@@ -0,0 +1,48 @@
/* arca's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,48 @@
/* atrium's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
+21
View File
@@ -0,0 +1,21 @@
/* aula's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--panel: var(--domi-panel);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--p-leaf1: var(--domi-leaf-hi);
--p-leaf2: var(--domi-leaf-mid);
--p-leaf3: var(--domi-leaf-lo);
--p-leaf-edge: var(--domi-leaf-edge);
--p-on-leaf: var(--domi-leaf-fg);
--second: var(--domi-second);
}
@@ -0,0 +1,22 @@
/* calenda's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--sidebar: var(--domi-chrome);
--surface: var(--domi-panel);
--surface-2: var(--domi-hover);
--line: var(--domi-line);
--line-control: var(--domi-edge);
--text: var(--domi-fg);
--muted: var(--domi-muted);
--accent-strong: var(--domi-accent);
--accent-edge: var(--domi-leaf-hi);
--accent: var(--domi-leaf-mid);
--lacquer-deep: var(--domi-leaf-lo);
--bronze: var(--domi-leaf-edge);
--on-accent: var(--domi-leaf-fg);
--person-text: var(--domi-second);
--danger: var(--domi-danger);
--on-danger: var(--domi-danger-fg);
--warning: var(--domi-warning);
}
@@ -0,0 +1,48 @@
/* culina's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,48 @@
/* custos's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,48 @@
/* domi-office's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,48 @@
/* epistula's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,48 @@
/* fabrica's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,24 @@
/* famulus's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--famulus-ground: var(--domi-bg);
--famulus-night-high: var(--domi-chrome);
--famulus-surface: var(--domi-panel);
--famulus-row-hover: var(--domi-hover);
--famulus-line: var(--domi-line);
--famulus-field: var(--domi-field);
--famulus-text: var(--domi-fg);
--famulus-soft: var(--domi-fg-2);
--famulus-quiet: var(--domi-muted);
--famulus-quieter: var(--domi-disabled);
--famulus-gold: var(--domi-accent);
--famulus-gold-bright: var(--domi-accent-strong);
--famulus-leaf-light: var(--domi-leaf-hi);
--famulus-leaf-mid: var(--domi-leaf-mid);
--famulus-leaf-shadow: var(--domi-leaf-lo);
--famulus-glint: var(--domi-leaf-edge);
--famulus-on-gold: var(--domi-leaf-fg);
--famulus-gold-deep: var(--domi-rim);
--famulus-moonlight: var(--domi-second);
--famulus-sage: var(--domi-ok);
}
@@ -0,0 +1,48 @@
/* fiscus's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,48 @@
/* fundamentum's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
.theme-fundamentum {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,26 @@
/* ianitor's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
.ia {
--ground: var(--domi-bg);
--colonnade: var(--domi-chrome);
--surface: var(--domi-panel);
--surface-2: var(--domi-hover);
--hairline: var(--domi-line);
--control-edge: var(--domi-edge);
--text: var(--domi-fg);
--text-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--primary-high: var(--domi-leaf-hi);
--primary-mid: var(--domi-leaf-mid);
--primary-low: var(--domi-leaf-lo);
--primary-edge: var(--domi-leaf-edge);
--on-primary: var(--domi-leaf-fg);
--second: var(--domi-second);
--danger: var(--domi-danger);
--on-danger: var(--domi-danger-fg);
--healthy: var(--domi-ok);
--degraded: var(--domi-warning);
}
@@ -0,0 +1,48 @@
/* lapilli's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
+25
View File
@@ -0,0 +1,25 @@
/* liber's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--lb-ground: var(--domi-bg);
--lb-colonnade: var(--domi-chrome);
--lb-surface: var(--domi-panel);
--lb-surface-2: var(--domi-hover);
--lb-hairline: var(--domi-line);
--lb-control-edge: var(--domi-edge);
--lb-text: var(--domi-fg);
--lb-text-2: var(--domi-fg-2);
--lb-muted: var(--domi-muted);
--lb-disabled: var(--domi-disabled);
--lb-accent: var(--domi-accent);
--lb-accent-strong: var(--domi-accent-strong);
--lb-primary-high: var(--domi-leaf-hi);
--lb-primary-mid: var(--domi-leaf-mid);
--lb-primary-low: var(--domi-leaf-lo);
--lb-primary-edge: var(--domi-leaf-edge);
--lb-on-primary: var(--domi-leaf-fg);
--lb-copper: var(--domi-second);
--lb-danger: var(--domi-danger);
--lb-success: var(--domi-ok);
--lb-warning: var(--domi-warning);
}
+21
View File
@@ -0,0 +1,21 @@
/* ludus's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--lu-ground-app: var(--domi-bg);
--lu-ground-sunken: var(--domi-chrome);
--lu-ground-card: var(--domi-panel);
--lu-surface: var(--domi-hover);
--lu-hairline: var(--domi-line);
--lu-blue-border: var(--domi-edge);
--lu-ground-deepest: var(--domi-field);
--lu-text-primary: var(--domi-fg);
--lu-text-body: var(--domi-fg-2);
--lu-text-secondary: var(--domi-muted);
--lu-text-tertiary: var(--domi-disabled);
--lu-primary-accent: var(--domi-accent);
--lu-primary-bright: var(--domi-leaf-hi);
--lu-primary: var(--domi-leaf-mid);
--lu-primary-mid: var(--domi-leaf-lo);
--lu-gold: var(--domi-leaf-edge);
--lu-text-on-primary: var(--domi-leaf-fg);
}
@@ -0,0 +1,27 @@
/* medicus's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--md-bg: var(--domi-bg);
--md-sidebar: var(--domi-chrome);
--md-surface: var(--domi-panel);
--md-surface-2: var(--domi-hover);
--md-border: var(--domi-line);
--md-control-edge: var(--domi-edge);
--md-text: var(--domi-fg);
--md-text-2: var(--domi-fg-2);
--md-text-muted: var(--domi-muted);
--md-text-disabled: var(--domi-disabled);
--md-accent: var(--domi-accent);
--md-accent-strong: var(--domi-accent-strong);
--md-primary-high: var(--domi-leaf-hi);
--md-primary-mid: var(--domi-leaf-mid);
--md-primary-low: var(--domi-leaf-lo);
--md-primary-edge: var(--domi-leaf-edge);
--md-on-primary: var(--domi-leaf-fg);
--md-red-fill-edge: var(--domi-rim);
--md-secondary-text: var(--domi-second);
--md-danger: var(--domi-danger);
--md-on-danger: var(--domi-danger-fg);
--md-success: var(--domi-ok);
--md-warning: var(--domi-warning);
}
@@ -0,0 +1,20 @@
/* memoria's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--memoria-bg: var(--domi-bg);
--memoria-colonnade: var(--domi-chrome);
--memoria-surface: var(--domi-panel);
--memoria-raised: var(--domi-hover);
--memoria-line: var(--domi-line);
--memoria-edge: var(--domi-edge);
--memoria-ink: var(--domi-fg);
--memoria-ink-quiet: var(--domi-fg-2);
--memoria-muted: var(--domi-muted);
--memoria-accent: var(--domi-accent);
--memoria-aerugo-strong: var(--domi-accent-strong);
--memoria-leaf: var(--domi-leaf);
--memoria-aerugo-ink: var(--domi-leaf-fg);
--memoria-aerugo-deep: var(--domi-rim);
--memoria-purpura: var(--domi-second);
--memoria-danger: var(--domi-danger);
}
@@ -0,0 +1,48 @@
/* pictor's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,20 @@
/* postea's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--postea-color-bg-app: var(--domi-bg);
--postea-color-bg-panel: var(--domi-chrome);
--postea-color-bg-surface: var(--domi-panel);
--postea-color-rule-base: var(--domi-line);
--postea-color-accent-dim: var(--domi-edge);
--postea-color-text-heading: var(--domi-fg);
--postea-color-text-soft: var(--domi-fg-2);
--postea-color-text-muted: var(--domi-muted);
--postea-color-text-faint: var(--domi-disabled);
--postea-color-accent-base: var(--domi-accent);
--postea-color-accent-bright: var(--domi-accent-strong);
--postea-color-primary-base: var(--domi-leaf-mid);
--postea-color-primary-deep: var(--domi-leaf-lo);
--postea-color-accent-mid: var(--domi-leaf-edge);
--postea-color-gold-base: var(--domi-second);
--postea-color-risk-onDark: var(--domi-danger);
}
@@ -0,0 +1,23 @@
/* respicio's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--colonnade: var(--domi-chrome);
--surface: var(--domi-panel);
--surface-2: var(--domi-hover);
--border: var(--domi-line);
--field-edge: var(--domi-edge);
--text: var(--domi-fg);
--text-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--leaf-mid: var(--domi-leaf-mid);
--leaf-low: var(--domi-leaf-lo);
--leaf-edge: var(--domi-leaf-edge);
--ink: var(--domi-leaf-fg);
--info: var(--domi-second);
--danger: var(--domi-danger);
--ok: var(--domi-ok);
}
@@ -0,0 +1,18 @@
/* tabula's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--tbl-window: var(--domi-bg);
--tbl-panel: var(--domi-chrome);
--tbl-card: var(--domi-panel);
--tbl-rule: var(--domi-line);
--tbl-gold-dim: var(--domi-edge);
--tbl-field: var(--domi-field);
--tbl-ink: var(--domi-fg);
--tbl-ink-dim: var(--domi-fg-2);
--tbl-ink-muted: var(--domi-muted);
--tbl-ink-faint: var(--domi-disabled);
--tbl-gold: var(--domi-accent);
--tbl-gold-light: var(--domi-accent-strong);
--tbl-gold-deep: var(--domi-leaf-lo);
--tbl-gold-pale: var(--domi-leaf-edge);
}
@@ -0,0 +1,24 @@
/* tectum's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--td-bg: var(--domi-bg);
--td-sidebar: var(--domi-chrome);
--td-surface: var(--domi-panel);
--td-surface-2: var(--domi-hover);
--td-border: var(--domi-line);
--td-control-edge: var(--domi-edge);
--td-text: var(--domi-fg);
--td-text-2: var(--domi-fg-2);
--td-text-muted: var(--domi-muted);
--td-accent: var(--domi-accent);
--td-accent-hover: var(--domi-accent-strong);
--td-leaf-high: var(--domi-leaf-hi);
--td-leaf-mid: var(--domi-leaf-mid);
--td-leaf-low: var(--domi-leaf-lo);
--td-leaf-edge: var(--domi-leaf-edge);
--td-on-accent: var(--domi-leaf-fg);
--td-legal: var(--domi-second);
--td-danger: var(--domi-danger);
--td-success: var(--domi-ok);
--td-warning: var(--domi-warning);
}
File diff suppressed because it is too large Load Diff
+20
View File
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: MPL-2.0
// @domi/ui: import the components here and the styles once, at the app root:
// import '@domi/ui/domi.css';
// import { Button, TextField } from '@domi/ui';
export { default as Button } from './components/Button.svelte';
export { default as TextField } from './components/TextField.svelte';
export { default as Checkbox } from './components/Checkbox.svelte';
export { default as Radio } from './components/Radio.svelte';
export { default as Switch } from './components/Switch.svelte';
export { default as Select } from './components/Select.svelte';
export { default as Segmented } from './components/Segmented.svelte';
export { default as Icon } from './components/Icon.svelte';
export { default as Strike } from './components/Strike.svelte';
export { strike } from './lib/strike';
export { icons, type IconName } from './lib/icons';
export { enterAction, canSend, isSoftKeyboard, failureText, DomiError } from './lib/keys';
export type { EnterKey, EnterContext, EnterResult, FieldState, ButtonState } from './lib/keys';
export type { DomiOption, ButtonVariant, ControlSize, FieldAction, DomiTheme, DomiDensity } from './types';
export { tokens, appIds, type DomiAppId } from './tokens/generated';
+28
View File
@@ -0,0 +1,28 @@
/**
* The Domi icon set: 24-unit stroke paths, drawn with stroke="currentColor", 1.8 wide, round caps and joins.
* Icons sit beside words; an icon alone always comes with an accessible name on its button.
*/
export const icons = {
send: 'M4.5 12h13M12.5 6.5 18 12l-5.5 5.5',
search: 'M10.5 17a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13ZM15.5 15.5 20 20',
next: 'M6 9.5 12 15l6-5.5',
save: 'M5 12.5 10 17.5 19 7',
check: 'M5 12.5 10 17.5 19 7',
close: 'M6.5 6.5 17.5 17.5M17.5 6.5 6.5 17.5',
plus: 'M12 5v14M5 12h14',
minus: 'M5 12h14',
trash: 'M5 7h14M10 7V5h4v2M7 7l1 12h8l1-12M10.5 10.5v5.5M13.5 10.5v5.5',
alert: 'M12 4 21 19.5H3L12 4ZM12 10v4.5M12 17.2v.1',
info: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 11v5.5M12 7.8v.1',
eye: 'M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z',
'eye-off': 'M4 4l16 16M9.9 5.8A8.8 8.8 0 0 1 12 5.5c6 0 9.5 6.5 9.5 6.5a16 16 0 0 1-3 3.8M6.5 7.3A15.6 15.6 0 0 0 2.5 12S6 18.5 12 18.5c1.7 0 3.2-.5 4.4-1.2M10 10a3 3 0 0 0 4 4',
'chevron-down': 'M6 9.5 12 15l6-5.5',
'chevron-right': 'M9.5 6 15 12l-5.5 6',
'arrow-left': 'M19.5 12h-13M11.5 6.5 6 12l5.5 5.5',
retry: 'M4.5 12a7.5 7.5 0 1 0 2.2-5.3M4.5 4.5v4h4',
edit: 'M4.5 19.5 5.5 15 15.5 5a2.1 2.1 0 0 1 3 3l-10 10-4 1.5ZM13.5 7l3 3',
copy: 'M9 9h10.5v10.5H9zM15 9V4.5H4.5V15H9',
lock: 'M6 11h12v9H6zM8.5 11V8a3.5 3.5 0 1 1 7 0v3',
} as const;
export type IconName = keyof typeof icons;
+67
View File
@@ -0,0 +1,67 @@
/** What Enter does in a field with a send button. Pure, so the flow is tested without a browser. */
export type EnterResult = 'send' | 'newline' | 'ignore';
export interface EnterKey {
key: string;
shiftKey?: boolean;
ctrlKey?: boolean;
metaKey?: boolean;
altKey?: boolean;
/** True while an input method (Chinese, Japanese, a phone keyboard's suggestion) is composing. */
isComposing?: boolean;
keyCode?: number;
}
export interface EnterContext {
multiline: boolean;
/**
* 'auto' (default): Enter sends, except in a multi-line field on a touch-only device, where a soft keyboard has
* no Shift: there Enter makes a new line and the seal sends. 'always': Enter always sends (Shift+Enter is a new
* line). 'never': Enter never sends (a multi-line field for long writing; Ctrl/Cmd+Enter still sends).
*/
enterSends?: 'auto' | 'always' | 'never';
/** True on a device whose only pointer is coarse (a phone). */
softKeyboard?: boolean;
}
export function enterAction(e: EnterKey, ctx: EnterContext): EnterResult {
if (e.key !== 'Enter') return 'ignore';
// keyCode 229 is the IME's own Enter on some Android keyboards and Safari.
if (e.isComposing || e.keyCode === 229) return 'ignore';
if (e.ctrlKey || e.metaKey) return 'send';
if (!ctx.multiline) return e.altKey ? 'ignore' : 'send';
if (e.shiftKey || e.altKey) return 'newline';
const mode = ctx.enterSends ?? 'auto';
if (mode === 'never') return 'newline';
if (mode === 'auto' && ctx.softKeyboard) return 'newline';
return 'send';
}
/** A field can send when it holds more than white space and is not already busy. */
export function canSend(value: string, state: FieldState, disabled = false): boolean {
return !disabled && state !== 'sending' && value.trim().length > 0;
}
export type FieldState = 'idle' | 'sending' | 'sent' | 'error';
export type ButtonState = 'idle' | 'loading' | 'success' | 'error';
/** Only a phone-like device: no fine pointer anywhere. Safe to call during SSR. */
export function isSoftKeyboard(): boolean {
if (typeof matchMedia !== 'function') return false;
return matchMedia('(pointer: coarse)').matches && !matchMedia('(any-pointer: fine)').matches;
}
/** The plain message for a failed send: the error's own text when it is meant for people, else a default. */
export function failureText(err: unknown, fallback: string): string {
if (err instanceof DomiError) return err.message;
if (typeof err === 'string' && err.trim()) return err;
return fallback;
}
/** Throw this from onsend / onclick to show its message to the person. Any other error shows the default. */
export class DomiError extends Error {
constructor(message: string) {
super(message);
this.name = 'DomiError';
}
}
+50
View File
@@ -0,0 +1,50 @@
import type { Action } from 'svelte/action';
/**
* The press flow of every Domi button: on pointer down it places the seal impression where the press landed
* (--_px, --_py) and replays it (data-struck); Enter and Space show the sunk plate while held (data-pressed), so a
* keyboard press looks like a pointer press. Reduced motion is handled in CSS (no impression, no movement).
*/
export const strike: Action<HTMLElement> = (node) => {
const replay = (x: string, y: string) => {
node.style.setProperty('--_px', x);
node.style.setProperty('--_py', y);
node.removeAttribute('data-struck');
// Force a style flush so the animation restarts on a quick second press.
void node.offsetWidth;
node.setAttribute('data-struck', '');
};
const down = (e: PointerEvent) => {
if (e.button !== 0 || isInert(node)) return;
const r = node.getBoundingClientRect();
replay(`${e.clientX - r.left}px`, `${e.clientY - r.top}px`);
};
const keydown = (e: KeyboardEvent) => {
if ((e.key === 'Enter' || e.key === ' ') && !e.repeat && !isInert(node)) {
node.setAttribute('data-pressed', '');
replay('50%', '50%');
}
};
const release = () => node.removeAttribute('data-pressed');
const end = (e: AnimationEvent) => {
if (e.target === node && e.pseudoElement === '::after') node.removeAttribute('data-struck');
};
node.addEventListener('pointerdown', down);
node.addEventListener('keydown', keydown);
node.addEventListener('keyup', release);
node.addEventListener('blur', release);
node.addEventListener('animationend', end);
return {
destroy() {
node.removeEventListener('pointerdown', down);
node.removeEventListener('keydown', keydown);
node.removeEventListener('keyup', release);
node.removeEventListener('blur', release);
node.removeEventListener('animationend', end);
},
};
};
function isInert(node: HTMLElement): boolean {
return (node as HTMLButtonElement).disabled === true || node.getAttribute('aria-disabled') === 'true';
}
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
import type { IconName } from './lib/icons';
/** One choice of a Select or a Segmented control. */
export interface DomiOption {
value: string;
label: string;
icon?: IconName;
disabled?: boolean;
}
export type ButtonVariant = 'plate' | 'primary' | 'quiet' | 'danger';
export type ControlSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
export type FieldAction = 'send' | 'search' | 'next' | 'save';
export type DomiTheme = 'dark' | 'light' | 'auto';
export type DomiDensity = 'pointer' | 'touch';
+6 -5
View File
@@ -3,18 +3,19 @@
"version": "0.2.0", "version": "0.2.0",
"private": true, "private": true,
"license": "MPL-2.0", "license": "MPL-2.0",
"description": "The shared dark Domi theme (murex palette) and its Svelte components.", "description": "Ianitor's own components on top of @domi/ui (the shared Domi design system): banners, dialogs, status, and adapters for Button and Segmented.",
"type": "module", "type": "module",
"svelte": "./src/index.ts", "svelte": "./src/index.ts",
"exports": { "exports": {
".": { "svelte": "./src/index.ts", "default": "./src/index.ts" }, ".": {
"svelte": "./src/index.ts",
"default": "./src/index.ts"
},
"./tokens.css": "./src/tokens.css", "./tokens.css": "./src/tokens.css",
"./components.css": "./src/components.css" "./components.css": "./src/components.css"
}, },
"dependencies": { "dependencies": {
"@fontsource/cinzel": "^5.1.0", "@domi/ui": "workspace:*"
"@fontsource/cormorant-garamond": "^5.1.0",
"@fontsource/manrope": "^5.1.0"
}, },
"peerDependencies": { "peerDependencies": {
"svelte": "^5.20.0" "svelte": "^5.20.0"
+26 -24
View File
@@ -3,11 +3,17 @@
- file, You can obtain one at https://mozilla.org/MPL/2.0/. --> - file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<script lang="ts"> <script lang="ts">
import type { Snippet } from "svelte"; import type { Snippet } from "svelte";
import { Button as DomiButton } from "@domi/ui";
import Icon from "./Icon.svelte"; import Icon from "./Icon.svelte";
import type { IconName } from "./icons"; import type { IconName } from "./icons";
// Handoff §2.1: disabled is aria-disabled (it stays focusable and its reason is read through // Ianitor's buttons are @domi/ui's Button (struck plate, leaf, states, 48 px on touch). This maps Ianitor's props
// aria-describedby); pending keeps the label, adds a spinner and ignores clicks. // 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 { let {
variant = "quiet", variant = "quiet",
icon, icon,
@@ -22,7 +28,7 @@
children, children,
...rest ...rest
}: { }: {
variant?: "primary" | "quiet" | "outline" | "danger" | "link"; variant?: "primary" | "quiet" | "outline" | "danger";
icon?: IconName; icon?: IconName;
disabled?: boolean; disabled?: boolean;
pending?: boolean; pending?: boolean;
@@ -31,32 +37,28 @@
small?: boolean; small?: boolean;
full?: boolean; full?: boolean;
type?: "button" | "submit"; type?: "button" | "submit";
onclick?: (e: MouseEvent) => void; onclick?: (e: MouseEvent) => unknown;
children?: Snippet; children?: Snippet;
[key: string]: unknown; [key: string]: unknown;
} = $props(); } = $props();
function click(e: MouseEvent) { const uid = $props.id();
if (disabled || pending) { const nameId = `ia-btn-name-${uid}`;
e.preventDefault(); const domiVariant = $derived(variant === "primary" ? "primary" : variant === "danger" ? "danger" : "plate");
return; const size = $derived(small ? "md" : variant === "primary" ? "xl" : "lg");
}
onclick?.(e);
}
</script> </script>
<button <DomiButton
{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} {...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} {#if icon}<Icon name={icon} />{/if}{@render children?.()}{#if label}<span id={nameId} hidden>{label}</span>{/if}
{@render children?.()} </DomiButton>
</button>
+18 -21
View File
@@ -2,10 +2,14 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this - 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/. --> - file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<script lang="ts" generics="T extends string"> <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 { let {
legend, legend,
name, name: _name,
options, options,
value = $bindable(), value = $bindable(),
disabled = [], disabled = [],
@@ -20,26 +24,19 @@
describedby?: string; describedby?: string;
onchange?: (v: T) => void; onchange?: (v: T) => void;
} = $props(); } = $props();
const uid = $props.id();
const choices = $derived(options.map((o) => ({ value: o.value, label: o.label, disabled: disabled.includes(o.value) })));
</script> </script>
<fieldset class="domi-field" aria-describedby={describedby}> <div class="ia-field" role="group" aria-labelledby="ia-seg-{uid}" aria-describedby={describedby}>
<legend class="domi-field-label">{legend}</legend> <span class="ia-field-label" id="ia-seg-{uid}">{legend}</span>
<div class="ia-seg"> <div>
{#each options as o (o.value)} <DomiSegmented
<label> label={legend}
<input options={choices}
type="radio" bind:value={() => value, (v) => (value = v as T)}
{name} onchange={(v) => onchange?.(v as T)}
value={o.value}
checked={value === o.value}
disabled={disabled.includes(o.value)}
onchange={() => {
value = o.value;
onchange?.(o.value);
}}
/> />
{o.label}
</label>
{/each}
</div> </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 * 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/. */ * 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 /* Ianitor's own components as drawn (docs/ui-handoff.md §2), on top of @domi/ui. The controls (buttons, fields,
artifact: domi-* from the Domi system, ia-* for Ianitor. */ segmented controls, checkboxes, selects) and the fonts are @domi/ui's (domi-*); everything here is ia-*. */
/* ── 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";
html, body { margin: 0; } 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-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-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-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-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(--muted); } .ia .ia-muted { color: var(--domi-muted); }
.ia .ia-text2 { color: var(--text-2); } .ia .ia-text2 { color: var(--domi-fg-2); }
.ia .ia-hint { color: var(--muted); font-size: var(--fs-hint); line-height: var(--lh-hint); } .ia .ia-hint { color: var(--domi-muted); font-size: var(--fs-hint); line-height: var(--lh-hint); }
.ia .ia-sub { color: var(--muted); font-size: var(--fs-sub); } .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-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 .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(--text); } .ia b, .ia strong { font-weight: 700; color: var(--domi-fg); }
/* ── Buttons (§2.1) ─────────────────────────────────────────────────────── */ /* ── Buttons (§2.1) ─────────────────────────────────────────────────────── */
.ia .domi-btn { /* A button that reads as a link: an action inside a sentence or under a field ("Use wiki.home.test", "Add a rule"). */
display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; .ia .ia-link {
min-height: var(--target); padding: 0 1.1rem; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; border: 0; padding: 0.6rem 0; min-height: var(--target);
border: 1px solid var(--control-edge); background: transparent; color: var(--text-2); background: none; color: var(--domi-accent); font: inherit; font-weight: 600; font-size: var(--fs-button);
font-weight: 600; font-size: var(--fs-button); cursor: pointer; text-decoration: none; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer;
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 { .ia .ia-icon-btn {
display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; 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; } .ia svg.ia-icon { width: 18px; height: 18px; flex: none; }
/* ── Status (§2.2) ──────────────────────────────────────────────────────── */ /* ── Status (§2.2) ──────────────────────────────────────────────────────── */
.ia .ia-status { display: inline-flex; align-items: center; gap: 8px; } .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-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 .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"] .ia-dot { background: var(--domi-ok); }
.ia [data-s="healthy"] .word, .ia [data-s="kept"] .word, .ia [data-s="kept"] svg { color: var(--healthy); } .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(--degraded); background: linear-gradient(90deg, var(--degraded) 50%, transparent 50%); } .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(--degraded); } .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"] .ia-dot { border: 3px solid var(--down); }
.ia [data-s="down"] .word { color: 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"] .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); } .ia [data-s="running"] .word, .ia [data-s="running"] svg { color: var(--running); }
/* ── Chips (§2.3) ───────────────────────────────────────────────────────── */ /* ── Chips (§2.3) ───────────────────────────────────────────────────────── */
.ia .ia-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; } .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) ─────────────────────────────────────────────────── */ /* ── Engine chip (§2.4) ─────────────────────────────────────────────────── */
.ia .ia-engine { .ia .ia-engine {
display: inline-flex; align-items: center; gap: 8px; min-height: var(--target); padding: 0 16px 0 14px; 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); border: 1px solid var(--domi-edge); border-radius: var(--radius-pill); background: var(--domi-panel);
color: var(--text); font-weight: 600; font-size: 0.92rem; cursor: pointer; 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) ──────────────────────────────────────────────── */ /* ── 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. */ /* 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 > :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-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: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-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) { @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 { grid-template-columns: minmax(0, 1fr) 44px; padding: 12px 6px 12px 14px; gap: 8px; }
.ia .ia-row.head { display: none; } .ia .ia-row.head { display: none; }
@@ -126,36 +87,36 @@ html, body { margin: 0; }
.ia .ia-menu-wrap { position: relative; } .ia .ia-menu-wrap { position: relative; }
.ia .ia-menu { .ia .ia-menu {
position: absolute; right: 0; top: 46px; z-index: 20; min-width: 250px; margin: 0; padding: 6px; list-style: none; 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"] { .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); 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"]:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
.ia .ia-menu [role="menuitem"].danger { color: var(--danger); } .ia .ia-menu [role="menuitem"].danger { color: var(--domi-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 [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(--muted); } .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(--hairline); margin: 4px 0; } .ia .ia-menu hr { border: 0; border-top: 1px solid var(--domi-line); margin: 4px 0; }
/* ── Bar, banners (§2.7, §2.8) ──────────────────────────────────────────── */ /* ── 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-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 { 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.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.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.kept .ia-banner-icon { color: var(--kept); }
.ia .ia-banner.down .ia-banner-icon { color: var(--down); } .ia .ia-banner.down .ia-banner-icon { color: var(--down); }
.ia .ia-banner .body { flex: 1 1 280px; min-width: 0; } .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; } .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; } } @media (max-width: 719.98px) { .ia .ia-banner { padding: 12px 14px; } }
/* ── Dialogs, panel, popover, sheets (§2.9) ─────────────────────────────── */ /* ── Dialogs, panel, popover, sheets (§2.9) ─────────────────────────────── */
.ia dialog.ia-dialog { .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; 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::backdrop { background: var(--scrim); }
@@ -172,38 +133,33 @@ html, body { margin: 0; }
} }
/* ── Fields (§2.10) ─────────────────────────────────────────────────────── */ /* ── Fields (§2.10) ─────────────────────────────────────────────────────── */
.ia .domi-field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; } /* Text fields, checkboxes, selects and segmented controls are @domi/ui's. Here: a group of controls with its label,
.ia .domi-field-label, .ia legend.domi-field-label { color: var(--text-2); font-size: var(--fs-field-label); padding: 0; } an error under a field, and the inputs @domi/ui 1.0 leaves to the app (a number, a file). */
.ia .domi-input, .ia select.domi-input, .ia textarea.domi-input { .ia .ia-field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
min-height: var(--target); background: var(--surface); color: var(--text); border: 1px solid var(--control-edge); /* 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%; 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 .ia-input:hover { border-color: var(--domi-muted); }
.ia .domi-input:focus, .ia .domi-input:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--carved), var(--focus-halo); } .ia .ia-input:focus, .ia .ia-input:focus-visible { outline: none; border-color: var(--domi-accent); box-shadow: var(--carved), var(--focus-halo); }
.ia .domi-input[aria-invalid="true"] { border-color: var(--danger); } .ia .ia-input[aria-invalid="true"] { border-color: var(--domi-danger); }
.ia .domi-error { color: var(--danger); font-size: var(--fs-hint); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; } .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 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) ─────────────────────── */ /* ── 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-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)); } } @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 { height: 6px; border-radius: 3px; background: var(--domi-hover); overflow: hidden; }
.ia .ia-progress > span { display: block; height: 100%; background: var(--accent); transition: width var(--dur-tick) linear; } .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(--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-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(--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-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(--hairline); border-radius: var(--radius-lg); padding: 32px; text-align: center; } .ia .ia-frame { border: 1px solid var(--domi-line); 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-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-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 { background: #fff; padding: 16px; border-radius: var(--radius); width: max-content; }
.ia .ia-qr svg { width: 240px; height: 240px; display: block; } .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; } .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 * 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/. */ * 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 { .ia {
/* ── Ground and structure: violet-tinted iron black ───────────────────── */ /* ── Structure and metal Ianitor adds to the roles ───────────────────── */
--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) */ --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) */ --bronze: #b6adbe; /* ornaments: the interpunct rule (iron, not bronze) */
--gilt: #f6f0f7; /* the wordmark only */ --gilt: #f6f0f7; /* the wordmark only */
/* ── Second light: quiet iron (Domi's .domi-pill and .domi-status use these) */ /* ── Second light: quiet iron ───────────────────────────────────────────── */
--second: #cfc6d4; --second-strong: var(--domi-fg);
--second-strong: #f1edf3; --second-edge: var(--domi-edge);
--second-edge: #7d7189;
/* ── Status: blue / amber / vermilion, stepped in lightness (L* 84 / 68 / 58) */ /* ── Status: blue / amber / vermilion, stepped in lightness (L* 84 / 68 / 58) */
--healthy: #a6d6fa; /* host answers; a change was kept. Filled dot. */ --kept: var(--domi-ok); /* host answers; a change was kept. Filled dot. */
--kept: #a6d6fa; --reverted: var(--domi-warning); /* partly failing; a change was reverted or not applied. Half dot. */
--degraded: #d99a35; /* partly failing; a change was reverted or not applied. Half dot. */ --down: var(--domi-danger); /* not reachable; needs attention; paused; danger actions. Hollow ring. */
--reverted: #d99a35; --unknown: var(--domi-muted); /* no health check set; waiting for first check. Dashed ring. */
--down: #e2683a; /* not reachable; needs attention; paused; danger actions. Hollow ring. */ --running: var(--domi-accent); /* queued, applying, watching, switching, waiting for Custos */
--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; /* Status washes (banner backgrounds) and edges. */
the resolved hex is in the comment, for tools that need a literal. */ --wash-degraded: color-mix(in srgb, var(--domi-warning) 10%, var(--domi-bg)); /* #201913 */
--wash-degraded: color-mix(in srgb, var(--degraded) 10%, var(--ground)); /* #201913 */ --wash-kept: color-mix(in srgb, var(--kept) 10%, var(--domi-bg)); /* #1b1f26 */
--wash-kept: color-mix(in srgb, var(--kept) 10%, var(--ground)); /* #1b1f26 */ --wash-down: color-mix(in srgb, var(--down) 10%, var(--domi-bg)); /* #211413 */
--wash-down: color-mix(in srgb, var(--down) 10%, var(--ground)); /* #211413 */ --edge-degraded: color-mix(in srgb, var(--domi-warning) 65%, var(--domi-bg)); /* #916828 */
--edge-degraded: color-mix(in srgb, var(--degraded) 65%, var(--ground)); /* #916828 */ --edge-kept: color-mix(in srgb, var(--kept) 65%, var(--domi-bg)); /* #708fa8 */
--edge-kept: color-mix(in srgb, var(--kept) 65%, var(--ground)); /* #708fa8 */ --edge-down: color-mix(in srgb, var(--down) 80%, var(--domi-bg)); /* #b75531 */
--edge-down: color-mix(in srgb, var(--down) 80%, var(--ground)); /* #b75531 */ --hover-wash: color-mix(in srgb, var(--domi-accent) 8%, transparent); /* menu and nav hover */
--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 ──────────────────────────────────────────────────────────────── */ /* ── Type: the three Domi faces come from @domi/ui (bundled, nothing fetched) */
--font-inscription: Cinzel, "Trajan Pro", "Cormorant Garamond", Georgia, "Times New Roman", serif; --font-inscription: var(--domi-font-inscription);
--font-book: "Cormorant Garamond", Cormorant, "EB Garamond", Garamond, Georgia, "Times New Roman", serif; --font-book: var(--domi-font-book);
--font-hand: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif; --font-hand: var(--domi-font-hand);
--fs-display: 2.6rem; --lh-display: 1.1; /* book 500: a view title ("Hosts") */ --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-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 */ --scrim: rgba(12,11,15,0.82); /* behind modals */
/* ── Focus ─────────────────────────────────────────────────────────────── */ /* ── Focus ─────────────────────────────────────────────────────────────── */
--focus-ring: 2px solid var(--accent); /* outline, offset 3px, on every :focus-visible */ --focus-ring: 2px solid var(--domi-accent); /* outline, offset 3px, on every :focus-visible */
--focus-ring-primary: 2px solid var(--accent-strong); --focus-ring-primary: 2px solid var(--domi-accent-strong);
--focus-offset: 3px; --focus-offset: 3px;
--focus-halo: 0 0 0 4px rgba(224,163,220,0.16); /* fields: border goes accent, plus this halo */ --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) */ --bp-phone: 720px; /* below: phone layout (header + bottom bar) */
color-scheme: dark; color-scheme: dark;
background: var(--ground); background: var(--domi-bg);
color: var(--text); color: var(--domi-fg);
font-family: var(--font-hand); font-family: var(--font-hand);
font-size: var(--fs-body); font-size: var(--fs-body);
line-height: var(--lh-body); line-height: var(--lh-body);
@@ -145,6 +117,4 @@
.ia :focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); } .ia :focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.ia h1, .ia h2, .ia h3, .ia p { margin: 0; } .ia h1, .ia h2, .ia h3, .ia p { margin: 0; }
.ia button { font: inherit; } .ia button { font: inherit; }
@media (prefers-reduced-motion: reduce) { /* Reduced motion: @domi/ui base.css (every duration 0; every state still shown). */
.ia *, .ia *::before, .ia *::after { animation: none !important; transition: none !important; }
}
+30 -18
View File
@@ -10,6 +10,9 @@ importers:
apps/web: apps/web:
dependencies: dependencies:
'@domi/ui':
specifier: workspace:*
version: link:../../packages/domi-ui
'@ianitor/ui': '@ianitor/ui':
specifier: workspace:* specifier: workspace:*
version: link:../../packages/ui version: link:../../packages/ui
@@ -51,17 +54,26 @@ importers:
specifier: ^3.0.5 specifier: ^3.0.5
version: 3.2.7(@types/node@22.20.5)(jsdom@26.1.0) version: 3.2.7(@types/node@22.20.5)(jsdom@26.1.0)
packages/domi-ui:
dependencies:
'@fontsource-variable/cinzel':
specifier: 5.3.0
version: 5.3.0
'@fontsource-variable/cormorant-garamond':
specifier: 5.3.0
version: 5.3.0
'@fontsource-variable/manrope':
specifier: 5.3.0
version: 5.3.0
svelte:
specifier: ^5.20.0
version: 5.57.3
packages/ui: packages/ui:
dependencies: dependencies:
'@fontsource/cinzel': '@domi/ui':
specifier: ^5.1.0 specifier: workspace:*
version: 5.3.0 version: link:../domi-ui
'@fontsource/cormorant-garamond':
specifier: ^5.1.0
version: 5.3.0
'@fontsource/manrope':
specifier: ^5.1.0
version: 5.3.0
svelte: svelte:
specifier: ^5.20.0 specifier: ^5.20.0
version: 5.57.3 version: 5.57.3
@@ -267,14 +279,14 @@ packages:
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
'@fontsource/cinzel@5.3.0': '@fontsource-variable/cinzel@5.3.0':
resolution: {integrity: sha512-KEOYTsrRppW0uRIPWBDPrQgunCS6f8u4nzZxYRBfo9SCknKojLYjK7B0ZoVmJhyVLefz271ZQRF9EOpHZlfhRw==} resolution: {integrity: sha512-eFcU0TwaAP5QESF2pV8VoOPJJXJ6sSGm/6mXMwqTdMBPAJMaLhfa6oISHuOtFeddsoHP9RYm4Io0j1j3mNEz2Q==}
'@fontsource/cormorant-garamond@5.3.0': '@fontsource-variable/cormorant-garamond@5.3.0':
resolution: {integrity: sha512-weuGsCirGVWBWqpt6YUp0yLThTe4G8YO45noq8wxeJCRvEpq5lFrxNMFSTxcyOyV5k5otzJ8guDzYegdYlcLMQ==} resolution: {integrity: sha512-rgZJ/5w3hi60swAPnrOXpZf5wEH6NTrvm4H8D9Y4b1QIFUqlX14eM3QTMU/eAznjfh0eXpO1QUqsFhiy58aoMg==}
'@fontsource/manrope@5.3.0': '@fontsource-variable/manrope@5.3.0':
resolution: {integrity: sha512-obJ1Dv3+uCA6HlHgW8u4BGYxJR9In2HW7gjJhlflEvkrj1X1iSEwu0fToL+JYGC/FEKFfIz1sBuPduvcL2gIAA==} resolution: {integrity: sha512-6D5dgokHsWDDMtmXHznKa0hK229NN+1a4BLPmUCLqcO1Pw5EEhWY5RFt0AcXnVRAljFFPfRtLkJePQj6LSsV6g==}
'@jridgewell/gen-mapping@0.3.13': '@jridgewell/gen-mapping@0.3.13':
resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==}
@@ -1126,11 +1138,11 @@ snapshots:
'@esbuild/win32-x64@0.25.12': '@esbuild/win32-x64@0.25.12':
optional: true optional: true
'@fontsource/cinzel@5.3.0': {} '@fontsource-variable/cinzel@5.3.0': {}
'@fontsource/cormorant-garamond@5.3.0': {} '@fontsource-variable/cormorant-garamond@5.3.0': {}
'@fontsource/manrope@5.3.0': {} '@fontsource-variable/manrope@5.3.0': {}
'@jridgewell/gen-mapping@0.3.13': '@jridgewell/gen-mapping@0.3.13':
dependencies: dependencies: