fix(ui): unify dashboard surfaces and selection

This commit is contained in:
sam committed 2026-11-24 08:33:07 +11:00
1 parent ba077f3779
commit 16f17f702c
8 files changed
+65 -59

No files matched your search

@@ -109,7 +109,11 @@ function open(row: Row): void {
<template>
<!-- A sticky header sticks to the page's scrolling frame, so the table
must not be a scroll container of its own. -->
<Table class="table-fixed min-w-(--min-lg) max-md:min-w-(--min-md) max-sm:min-w-(--min-sm)" :style="minimums" :container-class="stickyHeader && 'overflow-visible'">
<Table
class="table-fixed min-w-(--min-lg) max-md:min-w-(--min-md) max-sm:min-w-(--min-sm)"
:style="minimums"
:container-class="cn('rounded-lg bg-card ring-1 ring-border', stickyHeader && 'overflow-visible')"
>
<colgroup>
<col v-for="column in shown" :key="column.id" :class="hidden(column)" :style="width(column)" />
<col v-if="trailing" class="w-12" />
@@ -147,7 +147,7 @@ onBeforeUnmount(() => {
:data-type="type"
:data-unchecked="checked ? undefined : ''"
:class="cn(
'border-input dark:bg-input/20 hover:bg-muted/50 data-checked:border-primary/40 data-checked:bg-muted dark:data-checked:bg-muted data-invalid:border-destructive has-[>input:focus-visible]:border-ring has-[>input:focus-visible]:ring-ring gap-2.5 rounded-lg border bg-transparent px-3 py-2.5 text-label has-[>input:focus-visible]:ring-3 group/questionnaire-choice relative flex min-h-11 cursor-pointer items-start text-start transition-colors outline-none select-none',
'border-input dark:bg-input/20 hover:bg-muted/50 data-checked:border-primary/40 data-checked:bg-muted dark:data-checked:bg-muted data-invalid:border-destructive has-[>input:focus-visible]:border-ring has-[>input:focus-visible]:ring-ring gap-2.5 rounded-lg border bg-card px-3 py-2.5 text-label has-[>input:focus-visible]:ring-3 group/questionnaire-choice relative flex min-h-11 cursor-pointer items-start text-start transition-colors outline-none select-none',
'data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50',
props.class,
)"
@@ -150,7 +150,7 @@ onBeforeUnmount(() => {
:type="props.type"
:value="value"
:class="cn(
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-title focus-visible:ring-3 aria-invalid:ring-3 md:text-label min-h-11 w-full min-w-0 transition-[color,box-shadow,background-color] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 sm:min-h-0',
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-card px-2.5 py-1 text-title focus-visible:ring-3 aria-invalid:ring-3 md:text-label min-h-11 w-full min-w-0 transition-[color,box-shadow,background-color] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 sm:min-h-0',
'selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground',
props.class,
)"
+2 -1
View File
@@ -21,8 +21,9 @@ const forwardedProps = useForwardProps(delegatedProps);
cn(
'gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-label font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*=size-])]:size-4 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-fg-muted transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-fg-muted dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0',
'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent',
'group-data-[variant=line]/tabs-list:focus-visible:border-transparent group-data-[variant=line]/tabs-list:focus-visible:ring-0 group-data-[variant=line]/tabs-list:focus-visible:outline-2 group-data-[variant=line]/tabs-list:focus-visible:-outline-offset-2',
'data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground',
'after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100',
'after:absolute after:bg-ring after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100 group-data-[variant=line]/tabs-list:data-active:text-link dark:group-data-[variant=line]/tabs-list:data-active:text-link',
props.class,
)
"
+1 -1
View File
@@ -4,7 +4,7 @@ import { cva } from "class-variance-authority";
export { default as Toggle } from "./Toggle.vue";
export const toggleVariants = cva(
"hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-muted data-[state=on]:ring-2 data-[state=on]:ring-sage-deep gap-1 rounded-lg text-label font-medium transition-all [&_svg:not([class*=size-])]:size-4 group/toggle hover:bg-muted inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
"hover:text-foreground focus-visible:border-ring focus-visible:ring-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-primary-soft data-[state=on]:text-link data-[state=on]:ring-2 data-[state=on]:ring-ring gap-1 rounded-lg text-label font-medium transition-all [&_svg:not([class*=size-])]:size-4 group/toggle hover:bg-muted inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
{
variants: {
variant: {
@@ -29,7 +29,7 @@ function choose(value: string): void {
<template>
<Popover v-model:open="open">
<PopoverTrigger as-child>
<Button :id="id" type="button" variant="outline" class="w-64 justify-between font-normal" :aria-label="ariaLabel" role="combobox" :aria-expanded="open">
<Button :id="id" type="button" variant="outline" class="w-64 justify-between border-input bg-card font-normal" :aria-label="ariaLabel" role="combobox" :aria-expanded="open">
<span class="truncate">{{ label }}</span><ChevronsUpDown data-icon="inline-end" />
</Button>
</PopoverTrigger>
+23 -23
View File
@@ -89,7 +89,7 @@
* does not define (status colours, the subtle foreground, the glass surfaces)
* are ours.
*
* Both themes are Graphite: neutral warm greys and one sage accent, drawn from
* Both themes use neutral surfaces 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.
@@ -250,12 +250,12 @@
[data-theme="light"] {
color-scheme: light;
--background: #e9e7e2;
--background: #e9eaec;
--card: #ffffff;
--card-foreground: #1f1f1d;
--card-foreground: var(--foreground);
--popover: #ffffff;
--popover-foreground: #1f1f1d;
--foreground: #1f1f1d;
--popover-foreground: var(--foreground);
--foreground: #202327;
/* Sage ink is 5.0:1 on the canvas and 5.2:1 on hover surfaces. */
--primary: var(--sage-deep);
@@ -264,25 +264,25 @@
--brand: var(--sage);
--link: var(--sage-ink);
--secondary: #ecebe7;
--secondary-foreground: #1f1f1d;
--muted: #ecebe7;
--muted-foreground: #5c5a55;
--accent: #ecebe7;
--accent-foreground: #1f1f1d;
--secondary: #e7e9ec;
--secondary-foreground: var(--foreground);
--muted: var(--secondary);
--muted-foreground: #585d64;
--accent: var(--secondary);
--accent-foreground: var(--foreground);
--destructive: #b3413a;
--destructive-foreground: #ffffff;
--destructive-soft: rgba(179, 65, 58, 0.08);
--border: #dcdad4;
--border-strong: #c7c4bd;
--input: #8a877f; /* 3.6:1 on the light card */
--border: #d5d8dc;
--border-strong: #bec3c9;
--input: #838890;
/* 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;
--fg-muted: var(--muted-foreground);
--fg-subtle: #656a72;
--ok: var(--sage-ink);
--ok-soft: var(--primary-soft);
@@ -292,17 +292,17 @@
--danger-soft: rgba(179, 65, 58, 0.08);
--info: #3d5f86;
--info-soft: rgba(61, 95, 134, 0.1);
--idle: #5f5d58;
--idle-soft: rgba(95, 93, 88, 0.1);
--idle: #5b6068;
--idle-soft: rgb(91 96 104 / 10%);
--bg-blur: rgba(233, 231, 226, 0.6);
--bg-blur: rgb(233 234 236 / 60%);
--surface-glass: var(--card);
--surface-glass-strong: var(--popover);
--workspace: #f5f4f1;
--hairline: #d6d3cc;
--workspace: #f3f4f5;
--hairline: #d2d5da;
--shadow-sm: 0 1px 2px rgba(31, 31, 29, 0.06);
--shadow-md: 0 8px 28px rgba(31, 31, 29, 0.1);
--shadow-sm: 0 1px 2px rgb(32 35 39 / 6%);
--shadow-md: 0 8px 28px rgb(32 35 39 / 10%);
--shadow-workspace: none;
}