diff --git a/apps/web/e2e/specs/flows.spec.ts b/apps/web/e2e/specs/flows.spec.ts index 08179e5..a9c8b37 100644 --- a/apps/web/e2e/specs/flows.spec.ts +++ b/apps/web/e2e/specs/flows.spec.ts @@ -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("Send traffic to").fill("http://192.0.2.60:8080"); 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.getByRole("button", { name: "More for notes.home.test" })).toBeVisible(); await beat(page); diff --git a/apps/web/index.html b/apps/web/index.html index d0f2f85..f1509c2 100644 --- a/apps/web/index.html +++ b/apps/web/index.html @@ -2,7 +2,7 @@ - + diff --git a/apps/web/package.json b/apps/web/package.json index b70e353..89d8278 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -14,6 +14,7 @@ "aula:shots": "playwright test --project=aula" }, "dependencies": { + "@domi/ui": "git+https://gitea.marek-novak.cz/mnovak/domi-design.git#v1.0.0", "@ianitor/ui": "workspace:*" }, "devDependencies": { diff --git a/apps/web/src/App.svelte b/apps/web/src/App.svelte index f073ddc..3649e50 100644 --- a/apps/web/src/App.svelte +++ b/apps/web/src/App.svelte @@ -93,7 +93,7 @@ {#if route.view === "signed-in"} {:else} - +
IANITOR DOMI{#if app.phone}{/if}
@@ -152,24 +152,24 @@ diff --git a/apps/web/src/components/ApplyProgress.svelte b/apps/web/src/components/ApplyProgress.svelte index 0659c19..424ce38 100644 --- a/apps/web/src/components/ApplyProgress.svelte +++ b/apps/web/src/components/ApplyProgress.svelte @@ -69,12 +69,12 @@ diff --git a/apps/web/src/components/ChangeBar.svelte b/apps/web/src/components/ChangeBar.svelte index c7c2dcc..329fe76 100644 --- a/apps/web/src/components/ChangeBar.svelte +++ b/apps/web/src/components/ChangeBar.svelte @@ -136,7 +136,7 @@ {/if}
- {#if active.state === "queued"}{:else}{/if} + {#if active.state === "queued"}{:else}{/if} {:else if last}
{#if last.state === "kept"} @@ -161,5 +161,5 @@ {/if} diff --git a/apps/web/src/components/EnginePopover.svelte b/apps/web/src/components/EnginePopover.svelte index 2d28610..dfb52de 100644 --- a/apps/web/src/components/EnginePopover.svelte +++ b/apps/web/src/components/EnginePopover.svelte @@ -117,5 +117,5 @@ diff --git a/apps/web/src/components/HostList.svelte b/apps/web/src/components/HostList.svelte index 94a4554..62c507c 100644 --- a/apps/web/src/components/HostList.svelte +++ b/apps/web/src/components/HostList.svelte @@ -116,7 +116,7 @@ {#if h.certificate.state === "pending"}Waiting for Let's Encrypt to issue the certificate.{/if} {#if h.certificate.state === "failed"} Let's Encrypt could not confirm {h.hostname}. The name must point to this server, and port 80 must be open from the internet. - + {/if} @@ -133,7 +133,7 @@ diff --git a/apps/web/src/views/Hosts.svelte b/apps/web/src/views/Hosts.svelte index 201656f..c8dedd5 100644 --- a/apps/web/src/views/Hosts.svelte +++ b/apps/web/src/views/Hosts.svelte @@ -112,7 +112,7 @@ 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.unpushed}{o.repo.unpushed} changes not yet pushed.{/if} - +

{/if} diff --git a/apps/web/src/views/RenewByHand.svelte b/apps/web/src/views/RenewByHand.svelte index 9be98c9..fc05cf1 100644 --- a/apps/web/src/views/RenewByHand.svelte +++ b/apps/web/src/views/RenewByHand.svelte @@ -4,6 +4,7 @@ - + {#if icon}{/if}{@render children?.()}{#if label}{/if} + diff --git a/packages/ui/src/Segmented.svelte b/packages/ui/src/Segmented.svelte index f7bb877..e9cf482 100644 --- a/packages/ui/src/Segmented.svelte +++ b/packages/ui/src/Segmented.svelte @@ -2,10 +2,14 @@ - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at https://mozilla.org/MPL/2.0/. --> -
- {legend} -
- {#each options as o (o.value)} - - {/each} +
+ {legend} +
+ value, (v) => (value = v as T)} + onchange={(v) => onchange?.(v as T)} + />
-
+
diff --git a/packages/ui/src/components.css b/packages/ui/src/components.css index 23bd0d7..822adcd 100644 --- a/packages/ui/src/components.css +++ b/packages/ui/src/components.css @@ -2,23 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -/* The shared Domi components as drawn (docs/ui-handoff.md §2). Class names follow the - artifact: domi-* from the Domi system, ia-* for Ianitor. */ - -/* ── Fonts (self-hosted, OFL; §1.3) ─────────────────────────────────────── */ -@import "@fontsource/cinzel/latin-500.css"; -@import "@fontsource/cormorant-garamond/latin-500.css"; -@import "@fontsource/cormorant-garamond/latin-600.css"; -@import "@fontsource/manrope/latin-400.css"; -@import "@fontsource/manrope/latin-600.css"; -@import "@fontsource/manrope/latin-700.css"; -/* latin-ext: Czech names and places (č, ř, ů) in host names, device names and messages. */ -@import "@fontsource/cinzel/latin-ext-500.css"; -@import "@fontsource/cormorant-garamond/latin-ext-500.css"; -@import "@fontsource/cormorant-garamond/latin-ext-600.css"; -@import "@fontsource/manrope/latin-ext-400.css"; -@import "@fontsource/manrope/latin-ext-600.css"; -@import "@fontsource/manrope/latin-ext-700.css"; +/* Ianitor's own components as drawn (docs/ui-handoff.md §2), on top of @domi/ui. The controls (buttons, fields, + segmented controls, checkboxes, selects) and the fonts are @domi/ui's (domi-*); everything here is ia-*. */ html, body { margin: 0; } @@ -33,89 +18,65 @@ html, body { margin: 0; } .ia .ia-display { font-family: var(--font-book); font-weight: 500; font-size: var(--fs-display); line-height: var(--lh-display); } .ia .ia-h2 { font-family: var(--font-book); font-weight: 500; font-size: var(--fs-h2); line-height: var(--lh-h2); } .ia .ia-h3 { font-family: var(--font-book); font-weight: 600; font-size: var(--fs-h3); line-height: var(--lh-h3); } -.ia .ia-label { font-weight: 700; font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); } -.ia .ia-muted { color: var(--muted); } -.ia .ia-text2 { color: var(--text-2); } -.ia .ia-hint { color: var(--muted); font-size: var(--fs-hint); line-height: var(--lh-hint); } -.ia .ia-sub { color: var(--muted); font-size: var(--fs-sub); } +.ia .ia-label { font-weight: 700; font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--domi-muted); } +.ia .ia-muted { color: var(--domi-muted); } +.ia .ia-text2 { color: var(--domi-fg-2); } +.ia .ia-hint { color: var(--domi-muted); font-size: var(--fs-hint); line-height: var(--lh-hint); } +.ia .ia-sub { color: var(--domi-muted); font-size: var(--fs-sub); } .ia .ia-wordmark { font-family: var(--font-inscription); font-weight: 500; font-size: var(--fs-wordmark); letter-spacing: var(--tracking-wordmark); color: var(--gilt); } -.ia .ia-code { font-family: var(--font-inscription); font-weight: 500; font-size: var(--fs-code); letter-spacing: 0.16em; color: var(--accent-strong); } -.ia b, .ia strong { font-weight: 700; color: var(--text); } +.ia .ia-code { font-family: var(--font-inscription); font-weight: 500; font-size: var(--fs-code); letter-spacing: 0.16em; color: var(--domi-accent-strong); } +.ia b, .ia strong { font-weight: 700; color: var(--domi-fg); } /* ── Buttons (§2.1) ─────────────────────────────────────────────────────── */ -.ia .domi-btn { - display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; - min-height: var(--target); padding: 0 1.1rem; border-radius: var(--radius-sm); - border: 1px solid var(--control-edge); background: transparent; color: var(--text-2); - font-weight: 600; font-size: var(--fs-button); cursor: pointer; text-decoration: none; - transition: border-color var(--dur-color) var(--ease), background var(--dur-color) var(--ease), - color var(--dur-color) var(--ease), box-shadow var(--dur-lift) var(--ease), transform var(--dur-lift) var(--ease); +/* A button that reads as a link: an action inside a sentence or under a field ("Use wiki.home.test", "Add a rule"). */ +.ia .ia-link { + display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; border: 0; padding: 0.6rem 0; min-height: var(--target); + background: none; color: var(--domi-accent); font: inherit; font-weight: 600; font-size: var(--fs-button); + text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; } -.ia .domi-btn:hover:not([aria-disabled="true"]) { border-color: var(--accent); background: var(--hover-wash); color: var(--text); } -.ia .domi-btn.primary { - min-height: 50px; padding: 0 1.6rem; border-radius: var(--radius); border-color: var(--primary-edge); - background: linear-gradient(180deg, var(--primary-high) 0%, var(--primary-mid) 55%, var(--primary-low) 100%); - color: var(--on-primary); font-weight: 700; box-shadow: var(--leaf-bevel); -} -.ia .domi-btn.primary:hover:not([aria-disabled="true"]) { transform: translateY(-1px); color: var(--on-primary); - background: linear-gradient(180deg, var(--primary-high) 0%, var(--primary-mid) 55%, var(--primary-low) 100%); } -.ia .domi-btn.primary:focus-visible { outline: var(--focus-ring-primary); } -.ia .domi-btn.outline { border-color: var(--edge-outline); color: var(--accent); } -.ia .domi-btn.danger { border-color: var(--edge-down); color: var(--danger); } -.ia .domi-btn.danger:hover:not([aria-disabled="true"]) { background: var(--danger-hover); border-color: var(--danger); color: var(--danger); } -.ia .domi-btn.link { - border: 0; padding: 0.6rem 0; min-height: var(--target); background: none; color: var(--accent); - text-decoration: underline; text-underline-offset: 0.2em; font-weight: 600; -} -.ia .domi-btn.small { min-height: 36px; padding: 0 0.8rem; } -.ia .domi-btn.full { width: 100%; } -.ia .domi-btn[aria-disabled="true"] { color: var(--disabled); border-color: var(--hairline); cursor: not-allowed; box-shadow: none; background: transparent; } -.ia .domi-btn.primary[aria-disabled="true"] { background: var(--surface-2); color: var(--disabled); } -.ia .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ia-spin 0.8s linear infinite; } -@keyframes ia-spin { to { transform: rotate(360deg); } } .ia .ia-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; - border-radius: var(--radius-sm); border: 1px solid transparent; background: none; color: var(--text-2); cursor: pointer; + border-radius: var(--radius-sm); border: 1px solid transparent; background: none; color: var(--domi-fg-2); cursor: pointer; } -.ia .ia-icon-btn:hover { border-color: var(--control-edge); color: var(--text); } +.ia .ia-icon-btn:hover { border-color: var(--domi-edge); color: var(--domi-fg); } .ia svg.ia-icon { width: 18px; height: 18px; flex: none; } /* ── Status (§2.2) ──────────────────────────────────────────────────────── */ .ia .ia-status { display: inline-flex; align-items: center; gap: 8px; } .ia .ia-status .word { font-weight: 700; font-size: var(--fs-state); font-variant-caps: all-small-caps; letter-spacing: var(--tracking-state); } .ia .ia-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; } -.ia [data-s="healthy"] .ia-dot { background: var(--healthy); } -.ia [data-s="healthy"] .word, .ia [data-s="kept"] .word, .ia [data-s="kept"] svg { color: var(--healthy); } -.ia [data-s="degraded"] .ia-dot { border: 2px solid var(--degraded); background: linear-gradient(90deg, var(--degraded) 50%, transparent 50%); } -.ia [data-s="degraded"] .word, .ia [data-s="reverted"] .word, .ia [data-s="reverted"] svg { color: var(--degraded); } +.ia [data-s="healthy"] .ia-dot { background: var(--domi-ok); } +.ia [data-s="healthy"] .word, .ia [data-s="kept"] .word, .ia [data-s="kept"] svg { color: var(--domi-ok); } +.ia [data-s="degraded"] .ia-dot { border: 2px solid var(--domi-warning); background: linear-gradient(90deg, var(--domi-warning) 50%, transparent 50%); } +.ia [data-s="degraded"] .word, .ia [data-s="reverted"] .word, .ia [data-s="reverted"] svg { color: var(--domi-warning); } .ia [data-s="down"] .ia-dot { border: 3px solid var(--down); } .ia [data-s="down"] .word { color: var(--down); } .ia [data-s="unknown"] .ia-dot { border: 2px dashed var(--unknown); } -.ia [data-s="unknown"] .word { color: var(--muted); } +.ia [data-s="unknown"] .word { color: var(--domi-muted); } .ia [data-s="running"] .word, .ia [data-s="running"] svg { color: var(--running); } /* ── Chips (§2.3) ───────────────────────────────────────────────────────── */ .ia .ia-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; } -.ia .ia-chip { border: 1px solid var(--hairline-strong); border-radius: var(--radius-pill); color: var(--text-2); font-size: var(--fs-chip); padding: 1px 10px; white-space: nowrap; } +.ia .ia-chip { border: 1px solid var(--hairline-strong); border-radius: var(--radius-pill); color: var(--domi-fg-2); font-size: var(--fs-chip); padding: 1px 10px; white-space: nowrap; } /* ── Engine chip (§2.4) ─────────────────────────────────────────────────── */ .ia .ia-engine { display: inline-flex; align-items: center; gap: 8px; min-height: var(--target); padding: 0 16px 0 14px; - border: 1px solid var(--control-edge); border-radius: var(--radius-pill); background: var(--surface); - color: var(--text); font-weight: 600; font-size: 0.92rem; cursor: pointer; + border: 1px solid var(--domi-edge); border-radius: var(--radius-pill); background: var(--domi-panel); + color: var(--domi-fg); font-weight: 600; font-size: 0.92rem; cursor: pointer; } -.ia .ia-engine small { color: var(--muted); font-weight: 400; font-size: 0.86rem; } +.ia .ia-engine small { color: var(--domi-muted); font-weight: 400; font-size: 0.86rem; } /* ── Lists and rows (§2.5) ──────────────────────────────────────────────── */ -.ia .ia-list { border: 1px solid var(--hairline); border-radius: var(--radius-lg); } +.ia .ia-list { border: 1px solid var(--domi-line); border-radius: var(--radius-lg); } /* No overflow clipping on the list: a row's menu must reach past it. The end rows carry the corners. */ .ia .ia-list > :first-child { border-top-left-radius: calc(var(--radius-lg) - 1px); border-top-right-radius: calc(var(--radius-lg) - 1px); } .ia .ia-list > :last-child { border-bottom-left-radius: calc(var(--radius-lg) - 1px); border-bottom-right-radius: calc(var(--radius-lg) - 1px); } -.ia .ia-row { display: grid; grid-template-columns: 128px minmax(0, 1.4fr) minmax(0, 1.6fr) 44px; gap: 16px; padding: 12px 10px 12px 18px; align-items: start; border-top: 1px solid var(--hairline); } +.ia .ia-row { display: grid; grid-template-columns: 128px minmax(0, 1.4fr) minmax(0, 1.6fr) 44px; gap: 16px; padding: 12px 10px 12px 18px; align-items: start; border-top: 1px solid var(--domi-line); } .ia .ia-row:first-child { border-top: 0; } -.ia .ia-row.head { background: var(--colonnade); padding-top: 10px; padding-bottom: 10px; align-items: center; } +.ia .ia-row.head { background: var(--domi-chrome); padding-top: 10px; padding-bottom: 10px; align-items: center; } .ia .ia-host { font-weight: 600; font-size: var(--fs-host); overflow-wrap: anywhere; } -.ia .ia-row .problem { color: var(--text-2); } +.ia .ia-row .problem { color: var(--domi-fg-2); } @media (max-width: 719.98px) { .ia .ia-row { grid-template-columns: minmax(0, 1fr) 44px; padding: 12px 6px 12px 14px; gap: 8px; } .ia .ia-row.head { display: none; } @@ -126,36 +87,36 @@ html, body { margin: 0; } .ia .ia-menu-wrap { position: relative; } .ia .ia-menu { position: absolute; right: 0; top: 46px; z-index: 20; min-width: 250px; margin: 0; padding: 6px; list-style: none; - background: var(--colonnade); border: 1px solid var(--hairline-strong); border-radius: var(--radius); box-shadow: var(--shadow-dialog); + background: var(--domi-chrome); border: 1px solid var(--hairline-strong); border-radius: var(--radius); box-shadow: var(--shadow-dialog); } .ia .ia-menu [role="menuitem"] { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); - background: none; color: var(--text-2); font-weight: 600; font-size: 0.92rem; text-align: left; cursor: pointer; + background: none; color: var(--domi-fg-2); font-weight: 600; font-size: 0.92rem; text-align: left; cursor: pointer; } -.ia .ia-menu [role="menuitem"]:hover, .ia .ia-menu [role="menuitem"]:focus { background: var(--surface-2); color: var(--text); outline: none; } +.ia .ia-menu [role="menuitem"]:hover, .ia .ia-menu [role="menuitem"]:focus { background: var(--domi-hover); color: var(--domi-fg); outline: none; } .ia .ia-menu [role="menuitem"]:focus-visible { outline: var(--focus-ring); outline-offset: -2px; } -.ia .ia-menu [role="menuitem"].danger { color: var(--danger); } -.ia .ia-menu [role="menuitem"][aria-disabled="true"] { color: var(--disabled); cursor: not-allowed; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; } -.ia .ia-menu .reason { flex-basis: 100%; padding-left: 28px; font-weight: 400; font-size: var(--fs-sub); color: var(--muted); } -.ia .ia-menu hr { border: 0; border-top: 1px solid var(--hairline); margin: 4px 0; } +.ia .ia-menu [role="menuitem"].danger { color: var(--domi-danger); } +.ia .ia-menu [role="menuitem"][aria-disabled="true"] { color: var(--domi-disabled); cursor: not-allowed; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; } +.ia .ia-menu .reason { flex-basis: 100%; padding-left: 28px; font-weight: 400; font-size: var(--fs-sub); color: var(--domi-muted); } +.ia .ia-menu hr { border: 0; border-top: 1px solid var(--domi-line); margin: 4px 0; } /* ── Bar, banners (§2.7, §2.8) ──────────────────────────────────────────── */ -.ia .ia-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px 10px 18px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); } +.ia .ia-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px 10px 18px; background: var(--domi-panel); border: 1px solid var(--domi-line); border-radius: var(--radius-lg); } .ia .ia-bar .grow { flex: 1 1 260px; min-width: 0; } .ia .ia-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 18px; border-radius: var(--radius-lg); border: 1px solid var(--edge-degraded); background: var(--wash-degraded); } .ia .ia-banner.kept { border-color: var(--edge-kept); background: var(--wash-kept); } .ia .ia-banner.down { border-color: var(--edge-down); background: var(--wash-down); } -.ia .ia-banner .ia-banner-icon { width: 22px; height: 22px; color: var(--degraded); } +.ia .ia-banner .ia-banner-icon { width: 22px; height: 22px; color: var(--domi-warning); } .ia .ia-banner.kept .ia-banner-icon { color: var(--kept); } .ia .ia-banner.down .ia-banner-icon { color: var(--down); } .ia .ia-banner .body { flex: 1 1 280px; min-width: 0; } -.ia .ia-banner .line2 { color: var(--text-2); font-size: 0.9rem; } +.ia .ia-banner .line2 { color: var(--domi-fg-2); font-size: 0.9rem; } .ia .ia-banner .actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; } @media (max-width: 719.98px) { .ia .ia-banner { padding: 12px 14px; } } /* ── Dialogs, panel, popover, sheets (§2.9) ─────────────────────────────── */ .ia dialog.ia-dialog { - background: var(--colonnade); color: var(--text); border: 1px solid var(--hairline-strong); border-radius: var(--radius-lg); + background: var(--domi-chrome); color: var(--domi-fg); border: 1px solid var(--hairline-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-dialog); padding: 22px 24px; width: min(var(--dialog-w), calc(100vw - 32px)); max-height: 90dvh; } .ia dialog.ia-dialog::backdrop { background: var(--scrim); } @@ -172,38 +133,33 @@ html, body { margin: 0; } } /* ── Fields (§2.10) ─────────────────────────────────────────────────────── */ -.ia .domi-field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; } -.ia .domi-field-label, .ia legend.domi-field-label { color: var(--text-2); font-size: var(--fs-field-label); padding: 0; } -.ia .domi-input, .ia select.domi-input, .ia textarea.domi-input { - min-height: var(--target); background: var(--surface); color: var(--text); border: 1px solid var(--control-edge); +/* Text fields, checkboxes, selects and segmented controls are @domi/ui's. Here: a group of controls with its label, + an error under a field, and the inputs @domi/ui 1.0 leaves to the app (a number, a file). */ +.ia .ia-field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; } +/* The same words as @domi/ui's field label (.domi-field__label), so a form's labels read as one. */ +.ia .ia-field-label { color: var(--domi-fg-2); font: 600 13px/18px var(--domi-font-hand); padding: 0; } +.ia .ia-input { + min-height: var(--target); background: var(--domi-panel); color: var(--domi-fg); border: 1px solid var(--domi-edge); border-radius: var(--radius-sm); box-shadow: var(--carved); padding: 0.55rem 0.8rem; font: inherit; width: 100%; } -.ia .domi-input:hover { border-color: var(--muted); } -.ia .domi-input:focus, .ia .domi-input:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--carved), var(--focus-halo); } -.ia .domi-input[aria-invalid="true"] { border-color: var(--danger); } -.ia .domi-error { color: var(--danger); font-size: var(--fs-hint); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; } +.ia .ia-input:hover { border-color: var(--domi-muted); } +.ia .ia-input:focus, .ia .ia-input:focus-visible { outline: none; border-color: var(--domi-accent); box-shadow: var(--carved), var(--focus-halo); } +.ia .ia-input[aria-invalid="true"] { border-color: var(--domi-danger); } +.ia .ia-error { color: var(--domi-danger); font-size: var(--fs-hint); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; } .ia fieldset { border: 0; margin: 0; padding: 0; min-width: 0; } -.ia .ia-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--control-edge); border-radius: var(--radius-sm); background: var(--surface); } -.ia .ia-seg label { display: inline-flex; align-items: center; min-height: 38px; padding: 0 0.9rem; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 0.9rem; cursor: pointer; } -.ia .ia-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; } -.ia .ia-seg label:has(input:checked) { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); } -.ia .ia-seg label:has(input:focus-visible) { outline: var(--focus-ring); outline-offset: 2px; } -.ia .ia-seg label:has(input:disabled) { color: var(--disabled); cursor: not-allowed; } -.ia .ia-check { display: flex; align-items: center; gap: 10px; min-height: var(--target); } -.ia .ia-check input { width: 20px; height: 20px; accent-color: var(--accent); } /* ── Toasts, progress, secret, details (§2.11–2.14) ─────────────────────── */ .ia .ia-toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); } -.ia .ia-toast { display: flex; gap: 10px; align-items: center; background: var(--colonnade); border: 1px solid var(--hairline-strong); border-radius: var(--radius); box-shadow: var(--shadow-dialog); padding: 12px 16px; } +.ia .ia-toast { display: flex; gap: 10px; align-items: center; background: var(--domi-chrome); border: 1px solid var(--hairline-strong); border-radius: var(--radius); box-shadow: var(--shadow-dialog); padding: 12px 16px; } @media (max-width: 719.98px) { .ia .ia-toasts { right: 16px; left: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); } } -.ia .ia-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; } -.ia .ia-progress > span { display: block; height: 100%; background: var(--accent); transition: width var(--dur-tick) linear; } -.ia .ia-secret { display: block; width: 100%; background: var(--surface); border: 1px solid var(--control-edge); border-radius: var(--radius-sm); box-shadow: var(--carved); padding: 12px 14px; font: inherit; font-weight: 600; letter-spacing: 0.02em; word-break: break-all; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--text); resize: none; } -.ia .ia-details pre { background: var(--surface); border-radius: var(--radius-sm); color: var(--muted); font-size: var(--fs-sub); white-space: pre-wrap; padding: 10px 12px; margin: 6px 0; } -.ia .ia-frame { border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 32px; text-align: center; } -.ia .ia-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px 14px; } +.ia .ia-progress { height: 6px; border-radius: 3px; background: var(--domi-hover); overflow: hidden; } +.ia .ia-progress > span { display: block; height: 100%; background: var(--domi-accent); transition: width var(--dur-tick) linear; } +.ia .ia-secret { display: block; width: 100%; background: var(--domi-panel); border: 1px solid var(--domi-edge); border-radius: var(--radius-sm); box-shadow: var(--carved); padding: 12px 14px; font: inherit; font-weight: 600; letter-spacing: 0.02em; word-break: break-all; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--domi-fg); resize: none; } +.ia .ia-details pre { background: var(--domi-panel); border-radius: var(--radius-sm); color: var(--domi-muted); font-size: var(--fs-sub); white-space: pre-wrap; padding: 10px 12px; margin: 6px 0; } +.ia .ia-frame { border: 1px solid var(--domi-line); border-radius: var(--radius-lg); padding: 32px; text-align: center; } +.ia .ia-card { background: var(--domi-panel); border: 1px solid var(--domi-line); border-radius: var(--radius); padding: 12px 14px; } .ia .ia-ornament { max-width: 360px; margin: 8px auto; border: 0; border-top: 1px dotted var(--bronze); opacity: 0.6; } -.ia .ia-placeholder { background: var(--surface-2); border-radius: 6px; height: 14px; } +.ia .ia-placeholder { background: var(--domi-hover); border-radius: 6px; height: 14px; } .ia .ia-qr { background: #fff; padding: 16px; border-radius: var(--radius); width: max-content; } .ia .ia-qr svg { width: 240px; height: 240px; display: block; } .ia .ia-cmd { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.86rem; } diff --git a/packages/ui/src/tokens.css b/packages/ui/src/tokens.css index a6bd520..42c968c 100644 --- a/packages/ui/src/tokens.css +++ b/packages/ui/src/tokens.css @@ -2,68 +2,40 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -/* Design tokens of the dark Domi theme, murex palette (docs/ui-handoff.md §1.1, verbatim). */ +/* Ianitor's own tokens, on top of @domi/ui (docs/ui-handoff.md §1.1). The roles (ground, text, the murex + accent and leaf, ok, warning, danger) come from @domi/ui: data-domi-room="ianitor" on gives them Ianitor's + values, the same hex as before (domi-design docs/PALETTE.md). What is here is Ianitor's alone: status names, + washes, type sizes, spacing, radii and layout. */ .ia { - /* ── Ground and structure: violet-tinted iron black ───────────────────── */ - --ground: #0c0b0f; /* page ground; every ratio is measured on it */ - --colonnade: #121016; /* sidebar, phone bars, menus, dialogs, side panel */ - --surface: #18151d; /* fields, the last-change bar, cards */ - --surface-2: #221d28; /* hover, the current place, a chosen option */ - --hairline: #2c2633; /* dividers only, never a control edge */ + /* ── Structure and metal Ianitor adds to the roles ───────────────────── */ --hairline-strong: #3c3445; /* chip and frame edges (facts, not controls) */ - --control-edge: #7d7189; /* edge of every field, button, segmented control, engine chip */ - - /* ── Text ──────────────────────────────────────────────────────────────── */ - --text: #f1edf3; /* body text, hostnames */ - --text-2: #cfc6d4; /* secondary text, field labels */ - --muted: #a99eb1; /* hints, section labels, times */ - --disabled: #7a7183; /* disabled controls only, never content */ - - /* ── The lead: murex (Tyrian purple) ───────────────────────────────────── */ - --accent: #e0a3dc; /* links, focus ring, the current place, running state */ - --accent-strong: #f2c9ee; /* focus ring on the primary button; match codes */ - --primary-high: #8d3b89; /* primary fill, top */ - --primary-mid: #76306f; /* primary fill, 55 % */ - --primary-low: #5c2257; /* primary fill, foot */ - --primary-edge: #c77cc1; /* primary button edge */ - --on-primary: #ffffff; /* label on the primary fill */ - - /* ── Metal ─────────────────────────────────────────────────────────────── */ --bronze: #b6adbe; /* ornaments: the interpunct rule (iron, not bronze) */ --gilt: #f6f0f7; /* the wordmark only */ - /* ── Second light: quiet iron (Domi's .domi-pill and .domi-status use these) */ - --second: #cfc6d4; - --second-strong: #f1edf3; - --second-edge: #7d7189; + /* ── Second light: quiet iron ───────────────────────────────────────────── */ + --second-strong: var(--domi-fg); + --second-edge: var(--domi-edge); /* ── Status: blue / amber / vermilion, stepped in lightness (L* 84 / 68 / 58) */ - --healthy: #a6d6fa; /* host answers; a change was kept. Filled dot. */ - --kept: #a6d6fa; - --degraded: #d99a35; /* partly failing; a change was reverted or not applied. Half dot. */ - --reverted: #d99a35; - --down: #e2683a; /* not reachable; needs attention; paused; danger actions. Hollow ring. */ - --danger: #e2683a; - --on-danger: #170804; /* text on a filled danger button (none is planned) */ - --unknown: #a99eb1; /* no health check set; waiting for first check. Dashed ring. */ - --running: #e0a3dc; /* queued, applying, watching, switching, waiting for Custos (= accent) */ + --kept: var(--domi-ok); /* host answers; a change was kept. Filled dot. */ + --reverted: var(--domi-warning); /* partly failing; a change was reverted or not applied. Half dot. */ + --down: var(--domi-danger); /* not reachable; needs attention; paused; danger actions. Hollow ring. */ + --unknown: var(--domi-muted); /* no health check set; waiting for first check. Dashed ring. */ + --running: var(--domi-accent); /* queued, applying, watching, switching, waiting for Custos */ - /* Status washes (banner backgrounds) and edges. color-mix() is what the artifact uses; - the resolved hex is in the comment, for tools that need a literal. */ - --wash-degraded: color-mix(in srgb, var(--degraded) 10%, var(--ground)); /* #201913 */ - --wash-kept: color-mix(in srgb, var(--kept) 10%, var(--ground)); /* #1b1f26 */ - --wash-down: color-mix(in srgb, var(--down) 10%, var(--ground)); /* #211413 */ - --edge-degraded: color-mix(in srgb, var(--degraded) 65%, var(--ground)); /* #916828 */ - --edge-kept: color-mix(in srgb, var(--kept) 65%, var(--ground)); /* #708fa8 */ - --edge-down: color-mix(in srgb, var(--down) 80%, var(--ground)); /* #b75531 */ - --edge-outline: color-mix(in srgb, var(--accent) 60%, var(--ground)); /* #8b668a, outline button */ - --hover-wash: color-mix(in srgb, var(--accent) 8%, transparent); /* quiet button hover */ - --danger-hover: color-mix(in srgb, var(--danger) 7%, transparent); + /* Status washes (banner backgrounds) and edges. */ + --wash-degraded: color-mix(in srgb, var(--domi-warning) 10%, var(--domi-bg)); /* #201913 */ + --wash-kept: color-mix(in srgb, var(--kept) 10%, var(--domi-bg)); /* #1b1f26 */ + --wash-down: color-mix(in srgb, var(--down) 10%, var(--domi-bg)); /* #211413 */ + --edge-degraded: color-mix(in srgb, var(--domi-warning) 65%, var(--domi-bg)); /* #916828 */ + --edge-kept: color-mix(in srgb, var(--kept) 65%, var(--domi-bg)); /* #708fa8 */ + --edge-down: color-mix(in srgb, var(--down) 80%, var(--domi-bg)); /* #b75531 */ + --hover-wash: color-mix(in srgb, var(--domi-accent) 8%, transparent); /* menu and nav hover */ - /* ── Type ──────────────────────────────────────────────────────────────── */ - --font-inscription: Cinzel, "Trajan Pro", "Cormorant Garamond", Georgia, "Times New Roman", serif; - --font-book: "Cormorant Garamond", Cormorant, "EB Garamond", Garamond, Georgia, "Times New Roman", serif; - --font-hand: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif; + /* ── Type: the three Domi faces come from @domi/ui (bundled, nothing fetched) */ + --font-inscription: var(--domi-font-inscription); + --font-book: var(--domi-font-book); + --font-hand: var(--domi-font-hand); --fs-display: 2.6rem; --lh-display: 1.1; /* book 500: a view title ("Hosts") */ --fs-h2: 1.9rem; --lh-h2: 1.15; /* book 500: panel title; phone view title uses 2.1rem */ @@ -110,8 +82,8 @@ --scrim: rgba(12,11,15,0.82); /* behind modals */ /* ── Focus ─────────────────────────────────────────────────────────────── */ - --focus-ring: 2px solid var(--accent); /* outline, offset 3px, on every :focus-visible */ - --focus-ring-primary: 2px solid var(--accent-strong); + --focus-ring: 2px solid var(--domi-accent); /* outline, offset 3px, on every :focus-visible */ + --focus-ring-primary: 2px solid var(--domi-accent-strong); --focus-offset: 3px; --focus-halo: 0 0 0 4px rgba(224,163,220,0.16); /* fields: border goes accent, plus this halo */ @@ -134,8 +106,8 @@ --bp-phone: 720px; /* below: phone layout (header + bottom bar) */ color-scheme: dark; - background: var(--ground); - color: var(--text); + background: var(--domi-bg); + color: var(--domi-fg); font-family: var(--font-hand); font-size: var(--fs-body); line-height: var(--lh-body); @@ -145,6 +117,4 @@ .ia :focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); } .ia h1, .ia h2, .ia h3, .ia p { margin: 0; } .ia button { font: inherit; } -@media (prefers-reduced-motion: reduce) { - .ia *, .ia *::before, .ia *::after { animation: none !important; transition: none !important; } -} +/* Reduced motion: @domi/ui base.css (every duration 0; every state still shown). */ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9ffa24b..7d5418e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,6 +10,9 @@ importers: apps/web: dependencies: + '@domi/ui': + specifier: git+https://gitea.marek-novak.cz/mnovak/domi-design.git#v1.0.0 + version: git+https://gitea.marek-novak.cz/mnovak/domi-design.git#a8d69a97f4b32925096f3b773162d2ff4d31e6f7(svelte@5.57.3) '@ianitor/ui': specifier: workspace:* version: link:../../packages/ui @@ -53,15 +56,9 @@ importers: packages/ui: dependencies: - '@fontsource/cinzel': - specifier: ^5.1.0 - version: 5.3.0 - '@fontsource/cormorant-garamond': - specifier: ^5.1.0 - version: 5.3.0 - '@fontsource/manrope': - specifier: ^5.1.0 - version: 5.3.0 + '@domi/ui': + specifier: git+https://gitea.marek-novak.cz/mnovak/domi-design.git#v1.0.0 + version: git+https://gitea.marek-novak.cz/mnovak/domi-design.git#a8d69a97f4b32925096f3b773162d2ff4d31e6f7(svelte@5.57.3) svelte: specifier: ^5.20.0 version: 5.57.3 @@ -111,6 +108,13 @@ packages: resolution: {integrity: sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==} engines: {node: '>=18'} + '@domi/ui@git+https://gitea.marek-novak.cz/mnovak/domi-design.git#a8d69a97f4b32925096f3b773162d2ff4d31e6f7': + resolution: {commit: a8d69a97f4b32925096f3b773162d2ff4d31e6f7, repo: https://gitea.marek-novak.cz/mnovak/domi-design.git, type: git} + version: 1.0.0 + engines: {node: '>=22'} + peerDependencies: + svelte: ^5.20.0 + '@esbuild/aix-ppc64@0.25.12': resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==} engines: {node: '>=18'} @@ -267,14 +271,14 @@ packages: cpu: [x64] os: [win32] - '@fontsource/cinzel@5.3.0': - resolution: {integrity: sha512-KEOYTsrRppW0uRIPWBDPrQgunCS6f8u4nzZxYRBfo9SCknKojLYjK7B0ZoVmJhyVLefz271ZQRF9EOpHZlfhRw==} + '@fontsource-variable/cinzel@5.3.0': + resolution: {integrity: sha512-eFcU0TwaAP5QESF2pV8VoOPJJXJ6sSGm/6mXMwqTdMBPAJMaLhfa6oISHuOtFeddsoHP9RYm4Io0j1j3mNEz2Q==} - '@fontsource/cormorant-garamond@5.3.0': - resolution: {integrity: sha512-weuGsCirGVWBWqpt6YUp0yLThTe4G8YO45noq8wxeJCRvEpq5lFrxNMFSTxcyOyV5k5otzJ8guDzYegdYlcLMQ==} + '@fontsource-variable/cormorant-garamond@5.3.0': + resolution: {integrity: sha512-rgZJ/5w3hi60swAPnrOXpZf5wEH6NTrvm4H8D9Y4b1QIFUqlX14eM3QTMU/eAznjfh0eXpO1QUqsFhiy58aoMg==} - '@fontsource/manrope@5.3.0': - resolution: {integrity: sha512-obJ1Dv3+uCA6HlHgW8u4BGYxJR9In2HW7gjJhlflEvkrj1X1iSEwu0fToL+JYGC/FEKFfIz1sBuPduvcL2gIAA==} + '@fontsource-variable/manrope@5.3.0': + resolution: {integrity: sha512-6D5dgokHsWDDMtmXHznKa0hK229NN+1a4BLPmUCLqcO1Pw5EEhWY5RFt0AcXnVRAljFFPfRtLkJePQj6LSsV6g==} '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} @@ -1048,6 +1052,13 @@ snapshots: '@csstools/css-tokenizer@3.0.4': {} + '@domi/ui@git+https://gitea.marek-novak.cz/mnovak/domi-design.git#a8d69a97f4b32925096f3b773162d2ff4d31e6f7(svelte@5.57.3)': + dependencies: + '@fontsource-variable/cinzel': 5.3.0 + '@fontsource-variable/cormorant-garamond': 5.3.0 + '@fontsource-variable/manrope': 5.3.0 + svelte: 5.57.3 + '@esbuild/aix-ppc64@0.25.12': optional: true @@ -1126,11 +1137,11 @@ snapshots: '@esbuild/win32-x64@0.25.12': 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': dependencies: