feat(ui): new Archie mark, shared sage accent, theme follows the OS (#1858)
This commit is contained in:
19 files changed
+256
-175
No files matched your search
@@ -1,19 +1,34 @@
|
||||
<script setup lang="ts">
|
||||
import { onBeforeUnmount, onMounted, ref } from "vue";
|
||||
import Logo from "./Logo.vue";
|
||||
import BrandName from "./BrandName.vue";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { useAccountsStore } from "@/accounts/accounts";
|
||||
|
||||
const accounts = useAccountsStore();
|
||||
|
||||
// The name shows briefly on load, then folds to the mark until hovered or
|
||||
// focused, so the topbar keeps its room for navigation.
|
||||
const hovered = ref(false);
|
||||
const intro = ref(false);
|
||||
let fold: ReturnType<typeof setTimeout> | undefined;
|
||||
|
||||
onMounted(() => {
|
||||
intro.value = true;
|
||||
fold = setTimeout(() => (intro.value = false), 3000);
|
||||
});
|
||||
onBeforeUnmount(() => clearTimeout(fold));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<RouterLink
|
||||
to="/"
|
||||
class="flex items-center gap-2 rounded-md px-1 py-1 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
||||
@mouseenter="hovered = true"
|
||||
@mouseleave="hovered = false"
|
||||
@focus="hovered = true"
|
||||
@blur="hovered = false"
|
||||
>
|
||||
<Logo />
|
||||
<BrandName class="hidden sm:inline" />
|
||||
<Logo :open="intro || hovered" cycle />
|
||||
<Badge v-if="accounts.instance" variant="info">{{ accounts.instance }}</Badge>
|
||||
</RouterLink>
|
||||
</template>
|
||||
@@ -1,3 +0,0 @@
|
||||
<template>
|
||||
<span class="text-title font-semibold tracking-tight">Archie</span>
|
||||
</template>
|
||||
@@ -1,22 +1,71 @@
|
||||
<script setup lang="ts">
|
||||
withDefaults(defineProps<{ size?: number }>(), { size: 22 });
|
||||
import { nextTick, onBeforeUnmount, ref, watch } from "vue";
|
||||
|
||||
/**
|
||||
* The mark stands in for the A of the name. Closed, only the mark shows; open,
|
||||
* the rest of the name slides out from behind it and, with `cycle`, steps
|
||||
* through the product family.
|
||||
*/
|
||||
const props = withDefaults(defineProps<{ open?: boolean; cycle?: boolean }>(), {
|
||||
open: true,
|
||||
cycle: false,
|
||||
});
|
||||
|
||||
const NAMES = ["rchie", "rchitect", "rchimedes", "rchipelago"];
|
||||
|
||||
const index = ref(0);
|
||||
const swapping = ref(false);
|
||||
const width = ref("0px");
|
||||
const text = ref<HTMLElement>();
|
||||
let timer: ReturnType<typeof setInterval> | undefined;
|
||||
|
||||
async function fit(): Promise<void> {
|
||||
await nextTick();
|
||||
width.value = props.open && text.value ? `${Math.ceil(text.value.getBoundingClientRect().width)}px` : "0px";
|
||||
}
|
||||
|
||||
function next(): void {
|
||||
swapping.value = true;
|
||||
setTimeout(() => {
|
||||
index.value = (index.value + 1) % NAMES.length;
|
||||
swapping.value = false;
|
||||
void fit();
|
||||
}, 200);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.open,
|
||||
(open) => {
|
||||
clearInterval(timer);
|
||||
if (open && props.cycle) timer = setInterval(next, 1800);
|
||||
// Reset to Archie once the name has folded away, not while it is visible.
|
||||
if (!open) setTimeout(() => !props.open && (index.value = 0), 460);
|
||||
void fit();
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
onBeforeUnmount(() => clearInterval(timer));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<svg
|
||||
:width="size"
|
||||
:height="size"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
aria-hidden="true"
|
||||
class="text-link shrink-0"
|
||||
>
|
||||
<path d="M12 2.5 21 20h-4.1L12 10.6 7.1 20H3l9-17.5Z" fill="currentColor" />
|
||||
<path
|
||||
d="M8.6 16.2h6.8"
|
||||
stroke="var(--background)"
|
||||
stroke-width="1.6"
|
||||
stroke-linecap="round"
|
||||
/>
|
||||
</svg>
|
||||
<span class="text-foreground inline-flex items-baseline text-title leading-none font-semibold tracking-tight whitespace-nowrap">
|
||||
<svg viewBox="2 3 20 18" aria-hidden="true" class="h-[0.698em] w-[0.776em] shrink-0 self-baseline overflow-visible">
|
||||
<path d="M2 21h4l8-18h-4z" fill="currentColor" />
|
||||
<path d="M14.9 5.03 22 21h-4l-5.1-11.47z" fill="currentColor" />
|
||||
<path d="M10.47 15h3.06l1.11 2.5H9.36z" class="fill-brand" />
|
||||
</svg>
|
||||
<span class="sr-only">Archie</span>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
class="-mb-[0.25em] inline-block overflow-hidden pb-[0.25em] transition-[max-width] duration-[460ms] ease-[cubic-bezier(0.2,0.7,0.2,1)]"
|
||||
:style="{ maxWidth: width }"
|
||||
>
|
||||
<span
|
||||
ref="text"
|
||||
class="inline-block w-max pl-[0.02em] transition-[opacity,translate] duration-200"
|
||||
:class="swapping && 'translate-y-[0.18em] opacity-0'"
|
||||
>{{ NAMES[index] }}</span
|
||||
>
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
@@ -6,7 +6,6 @@ import { Building2, LayoutDashboard, ListChecks, Menu, Server, Workflow, Zap, ty
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet";
|
||||
import { activeNavPath, navTree, type NavEntry } from "@/lib/nav";
|
||||
import BrandName from "./BrandName.vue";
|
||||
import Logo from "./Logo.vue";
|
||||
|
||||
/** The section list at phone width, where the strip has no room to show a
|
||||
@@ -48,7 +47,7 @@ watch(() => route.path, () => (open.value = false));
|
||||
</SheetTrigger>
|
||||
<SheetContent @close-auto-focus="onCloseAutoFocus" side="left" class="w-64 gap-0 p-0">
|
||||
<SheetHeader class="border-b px-4 py-3">
|
||||
<SheetTitle class="flex items-center gap-2"><Logo /><BrandName /></SheetTitle>
|
||||
<SheetTitle class="flex items-center"><Logo /></SheetTitle>
|
||||
</SheetHeader>
|
||||
<nav aria-label="Sections" class="flex flex-col gap-0.5 p-2">
|
||||
<RouterLink
|
||||
|
||||
@@ -17,7 +17,7 @@ export const badgeVariants = cva(
|
||||
"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
||||
ghost:
|
||||
"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
||||
link: "text-primary underline-offset-4 hover:underline",
|
||||
link: "text-link underline-offset-4 hover:underline",
|
||||
// Status. The five semantic kinds the dashboard's pills used, and the
|
||||
// only place status colour is decided: a task state, a gate result, a
|
||||
// log level and a trend all draw from the same ramp, so the same
|
||||
|
||||
@@ -17,7 +17,7 @@ export const buttonVariants = cva(
|
||||
"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",
|
||||
destructive:
|
||||
"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",
|
||||
link: "text-primary underline-offset-4 hover:underline",
|
||||
link: "text-link underline-offset-4 hover:underline",
|
||||
// An action that exists because something needs attention has to look
|
||||
// unlike one that is always present. `destructive` would overstate it:
|
||||
// nothing is broken, it is waiting.
|
||||
|
||||
@@ -11,7 +11,7 @@ const props = defineProps<{
|
||||
<p
|
||||
data-slot="item-description"
|
||||
:class="cn(
|
||||
'text-muted-foreground text-left text-sm leading-normal group-data-[size=xs]/item:text-xs line-clamp-2 font-normal [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
|
||||
'text-muted-foreground text-left text-sm leading-normal group-data-[size=xs]/item:text-xs line-clamp-2 font-normal [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-link',
|
||||
props.class,
|
||||
)"
|
||||
>
|
||||
|
||||
@@ -63,7 +63,7 @@ function resolveTheme(preference: Theme): ResolvedTheme {
|
||||
|
||||
export const useAppearanceStore = defineStore("appearance", () => {
|
||||
const theme = ref<Theme>(
|
||||
storedChoice(THEME_KEY, ["system", "dark", "light"], "dark"),
|
||||
storedChoice(THEME_KEY, ["system", "dark", "light"], "system"),
|
||||
);
|
||||
const density = ref<Density>(
|
||||
storedChoice(DENSITY_KEY, ["comfortable", "compact"], "comfortable"),
|
||||
|
||||
+38
-25
@@ -36,9 +36,9 @@
|
||||
}
|
||||
|
||||
/*
|
||||
* Design tokens. Dark is the default because archied is a daemon you check at
|
||||
* odd hours; light is a toggle, not an afterthought, so both themes define the
|
||||
* same variable set and nothing else in the app references a raw colour.
|
||||
* Design tokens. The theme follows the operator's OS unless they pick one, so
|
||||
* both themes define the same variable set and nothing else in the app
|
||||
* references a raw colour.
|
||||
*
|
||||
* Semantic names only. Never `--violet`; always `--primary` or `--ok`, so a
|
||||
* palette change is one file rather than a grep.
|
||||
@@ -48,11 +48,21 @@
|
||||
* does not define (status colours, the subtle foreground, the glass surfaces)
|
||||
* are ours.
|
||||
*
|
||||
* The dark theme is Graphite (docs/design/ui-redesign/tokens/tokens.css):
|
||||
* neutral warm greys and one low-chroma accent. Every foreground is
|
||||
* Both themes are Graphite: neutral warm greys and one sage accent, drawn from
|
||||
* the brand primitives below so sage looks the same in either. Every foreground is
|
||||
* checked against every surface it lands on, hover states included, at AA
|
||||
* (4.5:1), and the ratios in the comments are the measured ones.
|
||||
*/
|
||||
/* Brand primitives. Only the theme blocks below read these; components use the
|
||||
semantic names. One hue (OKLCH 163) at three lightness steps: the mark and
|
||||
accents, the button fill, and text on light surfaces. */
|
||||
:root {
|
||||
--sage: #51a580;
|
||||
--sage-deep: #2e795a;
|
||||
--sage-deeper: #277354;
|
||||
--sage-ink: #0c6f4d;
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
--font-sans: "IBM Plex Sans Variable", system-ui, sans-serif;
|
||||
--font-heading: var(--font-sans);
|
||||
@@ -73,6 +83,7 @@
|
||||
--color-primary: var(--primary);
|
||||
--color-primary-foreground: var(--primary-foreground);
|
||||
--color-primary-soft: var(--primary-soft);
|
||||
--color-brand: var(--brand);
|
||||
--color-link: var(--link);
|
||||
--color-secondary: var(--secondary);
|
||||
--color-secondary-foreground: var(--secondary-foreground);
|
||||
@@ -113,7 +124,7 @@
|
||||
--radius-xl: 12px;
|
||||
}
|
||||
|
||||
/* ── Dark (default) ─────────────────────────────────────────────────────── */
|
||||
/* ── Dark ─────────────────────────────────────────────────────────────── */
|
||||
:root,
|
||||
[data-theme="dark"] {
|
||||
color-scheme: dark;
|
||||
@@ -127,14 +138,14 @@
|
||||
--popover-foreground: #e8e6e1;
|
||||
--foreground: #e8e6e1;
|
||||
|
||||
/* The one accent. Everything that marks "active", "focused", "on" or the
|
||||
primary action derives from --primary, so swapping this line (steel
|
||||
#8aa4c2, sand #d4a373, muted violet #a397c9) retints the whole app.
|
||||
Ink #101412 on sage is 8.1:1. */
|
||||
--primary: #86b5a0;
|
||||
--primary-foreground: #101412;
|
||||
--primary-soft: rgba(134, 181, 160, 0.12);
|
||||
--link: var(--primary);
|
||||
/* The primary fill is the same deep sage in both themes: white on it is
|
||||
5.3:1. --brand is the mark and accent colour; as text it is 5.7:1 on
|
||||
the card and 5.0:1 on hover surfaces. */
|
||||
--primary: var(--sage-deep);
|
||||
--primary-foreground: #ffffff;
|
||||
--primary-soft: rgba(81, 165, 128, 0.12);
|
||||
--brand: var(--sage);
|
||||
--link: var(--sage);
|
||||
|
||||
/* shadcn's `accent` is the hover surface, not the brand colour. */
|
||||
--secondary: #26282c;
|
||||
@@ -151,13 +162,13 @@
|
||||
--border: #313338;
|
||||
--border-strong: #3c3f45;
|
||||
--input: #35373c;
|
||||
--ring: var(--primary);
|
||||
--ring: var(--sage);
|
||||
|
||||
--fg-muted: #a6a39b;
|
||||
/* The dimmest text allowed: 5.7:1 on the card, 5.0:1 on hover surfaces; hints and captions only. */
|
||||
--fg-subtle: #99968f;
|
||||
|
||||
--ok: var(--primary);
|
||||
--ok: var(--sage);
|
||||
--ok-soft: var(--primary-soft);
|
||||
--warn: #d9a45b;
|
||||
--warn-soft: rgba(217, 164, 91, 0.08);
|
||||
@@ -184,8 +195,8 @@
|
||||
}
|
||||
|
||||
/* ── Light ──────────────────────────────────────────────────────────────── */
|
||||
/* Not part of the Graphite handoff: the same neutral rules on paper, with a
|
||||
darker sage so white labels and accent text clear AA. */
|
||||
/* The same neutral rules on paper. Sage text steps down to --sage-ink so it
|
||||
clears AA on paper; fills and the mark stay as in dark. */
|
||||
[data-theme="light"] {
|
||||
color-scheme: light;
|
||||
|
||||
@@ -196,11 +207,12 @@
|
||||
--popover-foreground: #1f1f1d;
|
||||
--foreground: #1f1f1d;
|
||||
|
||||
/* White on #3f6f5a is 5.8:1; as text on the canvas, 4.7:1. */
|
||||
--primary: #3f6f5a;
|
||||
/* Sage ink is 5.0:1 on the canvas and 5.2:1 on hover surfaces. */
|
||||
--primary: var(--sage-deep);
|
||||
--primary-foreground: #ffffff;
|
||||
--primary-soft: rgba(63, 111, 90, 0.1);
|
||||
--link: var(--primary);
|
||||
--primary-soft: rgba(46, 121, 90, 0.1);
|
||||
--brand: var(--sage);
|
||||
--link: var(--sage-ink);
|
||||
|
||||
--secondary: #ecebe7;
|
||||
--secondary-foreground: #1f1f1d;
|
||||
@@ -216,12 +228,13 @@
|
||||
--border: #dcdad4;
|
||||
--border-strong: #c7c4bd;
|
||||
--input: #d4d1ca;
|
||||
--ring: var(--primary);
|
||||
/* The bright sage is 2.4:1 on paper, under the 3:1 a focus ring needs. */
|
||||
--ring: var(--sage-deep);
|
||||
|
||||
--fg-muted: #5c5a55;
|
||||
--fg-subtle: #66635d;
|
||||
|
||||
--ok: var(--primary);
|
||||
--ok: var(--sage-ink);
|
||||
--ok-soft: var(--primary-soft);
|
||||
--warn: #8a5a12;
|
||||
--warn-soft: rgba(138, 90, 18, 0.1);
|
||||
@@ -257,7 +270,7 @@
|
||||
user. `:focus-visible` rather than `:focus` so a mouse click does not
|
||||
draw a ring around what was clicked. */
|
||||
:focus-visible {
|
||||
outline: 2px solid var(--primary);
|
||||
outline: 2px solid var(--ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
/* Rows in a floating menu are the one thing a finger cannot aim at with a
|
||||
|
||||
@@ -82,7 +82,7 @@ const nodeClass = computed(() =>
|
||||
the row. -->
|
||||
<span
|
||||
class="min-w-0 text-sm font-medium break-words hover:underline"
|
||||
:class="props.selected ? 'text-primary' : ''"
|
||||
:class="props.selected ? 'text-link' : ''"
|
||||
>{{ stage.name || "(unnamed stage)" }}</span
|
||||
>
|
||||
<!-- The node's colour already says ok; only a status that needs
|
||||
|
||||
@@ -118,7 +118,7 @@ function commitRename(event: Event): void {
|
||||
<div class="px-3 py-2.5" @click="data.onToggle?.()">
|
||||
<div class="flex items-center gap-1.5">
|
||||
<Badge variant="outline" class="max-w-40 gap-1 bg-background">
|
||||
<component :is="badge.icon" class="text-primary" aria-hidden="true" /><span class="truncate" :title="badge.label">{{ badge.label }}</span>
|
||||
<component :is="badge.icon" class="text-link" aria-hidden="true" /><span class="truncate" :title="badge.label">{{ badge.label }}</span>
|
||||
</Badge>
|
||||
<span v-if="data.run?.duration_ms !== undefined" class="ml-auto font-mono text-caption text-fg-subtle">{{ duration(data.run.duration_ms) }}</span>
|
||||
<component :is="status.icon" v-if="status" class="size-4 shrink-0" :class="[status.class, data.run?.duration_ms === undefined && 'ml-auto']" :aria-label="status.label" :title="data.run?.error || status.label" />
|
||||
|
||||
Reference in new issue
Block a user