Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Improve design tokens (#14607)

Damian Legawiec1ded59b8b8af
diff --git a/CLAUDE.md b/CLAUDE.md
index 66a696c200..6761e45e9c 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -123,6 +123,7 @@ NEVER kill/shut off dev serves already running unless they are broken (eg. migra
- ALWAYS use Yard comments for classes and public methods, with `@param` and `@return` types
- DO NOT generate too much comment noise, be very strict and selective about what gets a comment — only non-obvious public methods, never private methods or internal helpers
- DO NOT use shorthand variable names, readibility by humans is the core principle
+- Always use `ActiveJob::Continuable` when a Background Job iterates over records and perform operations on them
### Code Organization
diff --git a/packages/dashboard-core/src/components/resource-table.tsx b/packages/dashboard-core/src/components/resource-table.tsx
index 45d433e07a..169f1aa47e 100644
--- a/packages/dashboard-core/src/components/resource-table.tsx
+++ b/packages/dashboard-core/src/components/resource-table.tsx
@@ -740,7 +740,11 @@ export function ResourceTable<T extends Record<string, any>>({
// Selected rows carry the hover tint so the selection is
// visible at rest; hovering one goes a step deeper so the
// row still answers the pointer.
- className={isSelected ? 'bg-accent/60 hover:bg-accent' : undefined}
+ className={
+ isSelected
+ ? 'bg-accent-strong/75 hover:bg-accent-strong-hover'
+ : undefined
+ }
>
{selectionEnabled && (
<TableCell className="w-8">
@@ -838,7 +842,7 @@ function SortableRow<T extends Record<string, any>>({
ref={setNodeRef}
style={style}
className={cn(
- 'group/row hover:bg-accent/25 last:*:border-b-0',
+ 'group/row hover:bg-accent-strong/50 last:*:border-b-0',
isDragging && 'relative z-10 opacity-70',
)}
>
diff --git a/packages/dashboard-core/src/components/top-bar.tsx b/packages/dashboard-core/src/components/top-bar.tsx
index 0201c0cbd4..1a727946a8 100644
--- a/packages/dashboard-core/src/components/top-bar.tsx
+++ b/packages/dashboard-core/src/components/top-bar.tsx
@@ -97,7 +97,7 @@ export function TopBar({
>
{/* Size the glyph, not the button — `size="icon-sm"` sets a 28px hit area
and overriding the box would shrink the target to 20px. */}
- <SidebarTrigger className="-ml-1 opacity-50 hover:bg-accent hover:opacity-100 [&_svg]:size-5" />
+ <SidebarTrigger className="-ml-1 opacity-50 hover:bg-accent-strong hover:opacity-100 [&_svg]:size-5" />
{/* A three-column grid keeps the search optically centred whatever the
trail's length, with the trail truncating rather than pushing it. The
@@ -134,15 +134,13 @@ function SearchTrigger() {
// Focus matches the form inputs — the soft blue glow from `--ring`,
// rather than a hard offset ring. It looks like a search field, so it
// should focus like one.
- className="flex w-full max-w-md shrink cursor-pointer items-center gap-1 rounded-xl border border-border p-2 md:py-1.5 text-sm text-muted-foreground outline-none transition-[color,background-color,border-color,box-shadow] duration-100 ease-out hover:bg-accent/50 focus-visible:border-ring focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)]"
+ className="flex w-full max-w-md shrink cursor-pointer items-center gap-2 rounded-xl border border-border p-1.5 pl-3 text-sm text-muted-foreground outline-none transition-[color,background-color,border-color,box-shadow] duration-100 ease-out hover:bg-accent focus-visible:border-ring focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)]"
>
<SearchIcon className="size-4" />
<span className="flex-1 text-left">{t('admin.components.command_palette.placeholder')}</span>
- <kbd className="hidden rounded-lg border bg-background px-2 py-1 font-mono text-xs sm:inline-flex h-7 items-center">
- {IS_MAC ? <CommandIcon size={15} /> : 'Ctrl'}
- </kbd>
- <kbd className="hidden rounded-lg border bg-background px-2 py-1 font-mono text-xs sm:inline-flex h-7 items-center">
- K
+ <kbd className="hidden rounded-md border px-2 py-1 font-mono text-lg sm:inline-flex h-7 items-center gap-1">
+ {IS_MAC ? <CommandIcon size={15} /> : 'CTRL'}
+ <span>K</span>
</kbd>
</button>
)
@@ -207,7 +205,7 @@ export function TopBarUser({
<button
type="button"
aria-label={t('admin.a11y.user_menu')}
- className="flex items-center gap-2 rounded-lg p-1 transition-colors hover:bg-accent"
+ className="flex items-center gap-2 rounded-lg p-1 transition-colors hover:bg-accent-strong"
>
<Avatar className="size-7">
{user.avatar_url && <AvatarImage src={user.avatar_url} alt="" />}
diff --git a/packages/dashboard-core/src/products/variants-options-builder.tsx b/packages/dashboard-core/src/products/variants-options-builder.tsx
index 88965ebd58..566c01c7d2 100644
--- a/packages/dashboard-core/src/products/variants-options-builder.tsx
+++ b/packages/dashboard-core/src/products/variants-options-builder.tsx
@@ -106,7 +106,7 @@ export function VariantsOptionsBuilder({ selected, onChange, extraOptionTypes }:
const isEditing = expandedIndex === i
if (isEditing && optionType) {
return (
- <li key={ot.id} className="rounded-lg border border-border p-3">
+ <li key={ot.id} className="rounded-lg border border-border-subtle p-3">
<OptionPicker
optionType={optionType}
initialValues={ot.values}
@@ -132,7 +132,7 @@ export function VariantsOptionsBuilder({ selected, onChange, extraOptionTypes }:
return (
<li
key={ot.id}
- className="flex items-center gap-3 rounded-lg border border-border px-3 py-2"
+ className="flex items-center gap-3 rounded-lg border border-border-subtle px-3 py-2"
>
<div className="min-w-0 flex-1">
<div className="text-sm font-medium">{ot.label}</div>
@@ -169,7 +169,7 @@ export function VariantsOptionsBuilder({ selected, onChange, extraOptionTypes }:
)}
{isAdding ? (
- <div className="rounded-lg border border-border p-3">
+ <div className="rounded-lg border border-border-subtle p-3">
<AddOptionForm
availableTypes={availableTypes}
allOptionTypes={allOptionTypes}
diff --git a/packages/dashboard-core/src/products/variants-section.tsx b/packages/dashboard-core/src/products/variants-section.tsx
index 07924b7055..9075f602b3 100644
--- a/packages/dashboard-core/src/products/variants-section.tsx
+++ b/packages/dashboard-core/src/products/variants-section.tsx
@@ -386,7 +386,7 @@ export function VariantsSection({ form, seedFromType = false }: Props) {
)}
{fields.length > 0 && !awaitingOptionValues && (
- <div className="overflow-hidden rounded-md border border-border">
+ <div className="overflow-hidden rounded-lg border border-border-subtle">
<DndContext
sensors={sensors}
collisionDetection={closestCenter}
diff --git a/packages/dashboard-ui/src/spree/fulfill-items-form.tsx b/packages/dashboard-ui/src/spree/fulfill-items-form.tsx
index 30d2418f9f..4dd9a9350a 100644
--- a/packages/dashboard-ui/src/spree/fulfill-items-form.tsx
+++ b/packages/dashboard-ui/src/spree/fulfill-items-form.tsx
@@ -48,7 +48,10 @@ function ItemQuantityRow({
return (
<div
- className={cn('my-2 flex items-center gap-3 rounded-lg py-2 pl-2', selected && 'bg-accent')}
+ className={cn(
+ 'my-2 flex items-center gap-3 rounded-lg py-2 pl-2',
+ selected && 'bg-accent-strong',
+ )}
>
<Controller
control={form.control}
diff --git a/packages/dashboard-ui/src/spree/product-membership-list.tsx b/packages/dashboard-ui/src/spree/product-membership-list.tsx
index 321df99428..a786b7d6b9 100644
--- a/packages/dashboard-ui/src/spree/product-membership-list.tsx
+++ b/packages/dashboard-ui/src/spree/product-membership-list.tsx
@@ -351,8 +351,8 @@ function MembershipRow({
// Mirror <TableRow> styling — a plain <tr> is required so dnd-kit's
// setNodeRef attaches (TableRow doesn't forward refs).
className={cn(
- 'group/row last:*:border-b-0 hover:bg-accent/60',
- selected && 'bg-accent/60 hover:bg-accent',
+ 'group/row last:*:border-b-0 hover:bg-accent-strong/50',
+ selected && 'bg-accent-strong/75 hover:bg-accent-strong-hover',
isDragging && 'relative z-10 opacity-70',
removed && 'opacity-60',
)}
diff --git a/packages/dashboard-ui/src/spree/theme-toggle.tsx b/packages/dashboard-ui/src/spree/theme-toggle.tsx
index 64fbc2839d..fb384b985a 100644
--- a/packages/dashboard-ui/src/spree/theme-toggle.tsx
+++ b/packages/dashboard-ui/src/spree/theme-toggle.tsx
@@ -35,7 +35,7 @@ export function ThemeMenuItems() {
onClick={() => setMode(value)}
className={cn(
'flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground hover:bg-accent cursor-pointer',
- active && 'bg-accent text-foreground shadow-sm',
+ active && 'bg-accent-strong text-foreground shadow-sm',
)}
>
<Icon className="size-4" />
diff --git a/packages/dashboard-ui/src/styles.css b/packages/dashboard-ui/src/styles.css
index 5342c2374d..932029fdf3 100644
--- a/packages/dashboard-ui/src/styles.css
+++ b/packages/dashboard-ui/src/styles.css
@@ -47,6 +47,15 @@
* focus signal, which it stops being once every page renders a saturated
* blue button. */
:root {
+ /* Neutrals are Tailwind's **stone** scale — a warm grey. Every neutral here
+ is either an exact stone step (labelled with it) or, where a step could not
+ meet a contrast requirement, a value on stone's own hue so it belongs to
+ the same family. Never introduce a zero-chroma grey or another neutral
+ ramp (zinc, slate, neutral): mixed families read as a colour cast on
+ whichever surface is the odd one out.
+
+ Tokens that must equal another token point at it with var() rather than
+ repeating its value, so the two cannot drift. */
--brand-blue: oklch(0.5967 0.2212 258); /* #0077ff — site accent */
--brand-blue-strong: oklch(0.5106 0.1868 257.7); /* #0060ce — site link hover */
/* Links in body copy. The plain accent measures 4.13:1 on white and 4.21:1
@@ -55,36 +64,61 @@
--link: oklch(0.5106 0.1868 257.7);
--link-hover: oklch(0.44 0.16 257.7);
- --background: oklch(0.9851 0 0); /* #fafafa — chrome sits one step below white */
- --foreground: oklch(0.145 0.0039 49.25); /* stone-950 */
+ --background: oklch(98.5% 0.001 106.423); /* stone-50 — chrome one step below white */
+ --foreground: oklch(14.7% 0.004 49.25); /* stone-950 */
--card: oklch(1 0 0); /* #ffffff — cards and inputs read as raised */
- --card-foreground: oklch(0.145 0.0039 49.25);
- --popover: oklch(1 0 0);
- --popover-foreground: oklch(0.145 0.0039 49.25);
- --primary: oklch(0.145 0.0039 49.25); /* stone-950 — near-black primary CTAs */
- --primary-foreground: oklch(1 0 0);
+ --card-foreground: var(--foreground);
+ --popover: var(--card);
+ --popover-foreground: var(--foreground);
+ --primary: var(--foreground); /* stone-950 — near-black primary CTAs */
+ --primary-foreground: var(--card);
/* Filled surfaces (table headers, badges, secondary buttons) read as a
whisper against the white card rather than a distinct band. */
- --secondary: oklch(0.97 0 0);
- --secondary-foreground: oklch(0.145 0.0039 49.25);
- --muted: oklch(0.9851 0 0);
- /* Between stone-500 and -600. Clears 4.5:1 against every surface this text
- actually lands on — including --accent, the darkest of them — where the
- stone-500 step measured 4.15:1. Dark mode keeps its own value: it already
- passes on all four grounds. */
+ --secondary: oklch(97% 0.001 106.424); /* stone-100 */
+ --secondary-foreground: var(--foreground);
+ --muted: var(--background);
+ /* Between stone-500 and -600, on stone's hue. Clears 4.5:1 against every
+ surface this text lands on — white card 5.19:1, page 4.97:1, secondary and
+ accent 4.75:1 — where the stone-500 step itself measures 4.41:1 on
+ secondary and fails. Dark mode takes stone-400 for the same reason. */
--muted-foreground: oklch(0.535 0.0127 58.071);
- /* Hover/highlight for menu items and table rows. A lighter step than
- stone-200: these sit on white surfaces, where that value reads as a
- pressed state rather than a hover. The sidebar shares this value via
- --sidebar-accent so a highlighted row looks the same wherever it is. */
- --accent: oklch(0.9491 0 0);
- --accent-foreground: oklch(0.145 0.0039 49.25);
+ /* Hover/highlight for menu items and table rows, and the same stone-100 as
+ --secondary: a hover and a filled surface are the same weight of "one step
+ off the card", so they are one value rather than two that drift apart.
+ stone-200 was tried and reads as a pressed state on a white surface.
+
+ It is also the lightest step that keeps --muted-foreground legible on it:
+ the previous bespoke grey measured 4.47:1, just under the 4.5 this file
+ claims everywhere else. The sidebar shares it via --sidebar-accent. */
+ --accent: var(--secondary);
+ --accent-foreground: var(--foreground);
+ /* The *selected* state, and any control that must read as raised while
+ sitting on an already-accented surface: the sidebar's active nav item, a
+ ghost button hovered inside a hovered table row.
+
+ --accent cannot do this job. It is the hover/fill surface, so it has to
+ stay light enough for --muted-foreground to clear 4.5:1 on it — which
+ leaves it at 1.04:1 against the page, invisible as a selection. Two
+ different jobs, two tokens. Nothing but near-black text lands on this
+ one (15.7:1), so it is free to be darker. */
+ --accent-strong: oklch(92.3% 0.003 48.717); /* stone-200 */
+ /* Hover, one step under --accent-strong so a nav item has somewhere to go
+ on hover *and* somewhere further to go when it is the active one. Stone
+ has no step between 100 and 200, so this is interpolated on stone's hue
+ rather than snapped — deliberate, like --border-control.
+
+ --accent is too light to be a hover here: on the sidebar's ground (the
+ page colour, not a card) it measures 1.04:1, which is invisible. */
+ --accent-hover: oklch(94.7% 0.002 56);
+ /* The active item hovered. It darkens rather than lightening: a selected
+ row that goes paler under the pointer reads as being deselected. */
+ --accent-strong-hover: oklch(86.9% 0.005 56.366); /* stone-300 */
--destructive: oklch(0.58 0.22 27); /* red-600 */
- --destructive-foreground: oklch(1 0 0); /* #ffffff */
+ --destructive-foreground: var(--card);
/* The full-strength rule colour. Nothing styles with it directly — the two
tokens below are both a share of it, so neither compounds the other's
reduction. */
- --border-base: oklch(0.922 0 0);
+ --border-base: oklch(92.3% 0.003 48.717); /* stone-200 */
/* A container's own edge. Legible but receding, so a dense table reads as
rows of content rather than a grid. Carries its strength in the token, so
call sites never restate it — an `/80` utility would compound to 64%. */
@@ -115,8 +149,8 @@
so any resting tint either collides with that meaning or (as happened)
lands darker than it and inverts the signal outright. On this palette the
enabled state has to stay on the card colour. */
- --border-control: oklch(0.65 0.006 56);
- --border-field: oklch(0.86 0.004 56);
+ --border-control: oklch(65% 0.01 56.259);
+ --border-field: oklch(86.9% 0.005 56.366); /* stone-300 */
/* A card that *holds* other records — an order's fulfillments, its returns,
its claims — rather than holding content directly.
@@ -137,7 +171,7 @@
the card, not its chrome. */
--card-container: var(--background);
/* Light mode's raised record is simply the card surface. */
- --nested-raised: oklch(1 0 0);
+ --nested-raised: var(--card);
--input: color-mix(in srgb, var(--border-base) 80%, transparent);
--ring: var(--brand-blue);
--chart-1: oklch(0.7663 0.1067 254.4);
@@ -156,6 +190,9 @@
--sidebar-primary-foreground: var(--primary-foreground);
--sidebar-accent: var(--accent);
--sidebar-accent-foreground: var(--accent-foreground);
+ --sidebar-accent-strong: var(--accent-strong);
+ --sidebar-accent-hover: var(--accent-hover);
+ --sidebar-accent-strong-hover: var(--accent-strong-hover);
/* Matches the rule the top bar draws, so every edge framing the shell —
the sidebar's, the top bar's, the settings header's — is one weight. */
--sidebar-border: color-mix(in srgb, var(--border) 75%, transparent);
@@ -202,27 +239,32 @@
.dark {
/* Vercel-style "true black" base, with surfaces stepping up in lightness. */
- --background: oklch(0.1913 0 0);
- --foreground: oklch(0.95 0.0019 106.424); /* stone-100-ish */
- --card: oklch(0.209 0 0);
- --card-foreground: oklch(0.95 0.0019 106.424);
- --popover: oklch(0.209 0 0);
- --popover-foreground: oklch(0.95 0.0019 106.424);
+ --background: oklch(19.13% 0.005 56.043);
+ --foreground: oklch(95% 0.002 106.424);
+ --card: oklch(21.6% 0.006 56.043); /* stone-900 */
+ --card-foreground: var(--foreground);
+ --popover: var(--card);
+ --popover-foreground: var(--foreground);
/* Mirrors the light theme's primary: there a navy fill carries white text,
so here the two swap rather than the button taking on its own colour. */
- --primary: oklch(0.95 0.0019 106.424);
- --primary-foreground: oklch(0.145 0.0039 49.25); /* stone-950 — light theme's primary */
+ --primary: var(--foreground);
+ --primary-foreground: oklch(14.7% 0.004 49.25); /* stone-950 — light theme's primary */
/* Above --card, but only just. These fill elements that sit *on* a card
(combobox chips, badges, secondary buttons, table header rows), so a value
at or under the card's lightness erases them — while too big a step reads
as a bright band across a full-width table header. Dark mode raises where
light mode lowers, since a surface reads as raised by getting lighter. */
- --secondary: oklch(0.225 0.0062 56.043);
- --secondary-foreground: oklch(0.95 0.0019 106.424);
- --muted: oklch(0.185 0.0051 56.043);
- --muted-foreground: oklch(0.62 0.0117 58.071); /* stone-500-ish */
- --accent: oklch(0.2645 0 0);
- --accent-foreground: oklch(0.95 0.0019 106.424);
+ --secondary: oklch(22.5% 0.006 56.043);
+ --secondary-foreground: var(--foreground);
+ --muted: oklch(18.5% 0.005 56.043);
+ /* stone-400. The old value failed 4.5:1 on --accent (4.20:1); this clears
+ every dark ground, the accent included, at 5.87:1. */
+ --muted-foreground: oklch(70.9% 0.01 56.259);
+ --accent: oklch(26.8% 0.007 34.298); /* stone-800 */
+ --accent-foreground: var(--foreground);
+ --accent-strong: oklch(37.4% 0.01 67.558); /* stone-700 */
+ --accent-hover: oklch(31% 0.008 34.298);
+ --accent-strong-hover: oklch(44.4% 0.011 73.639); /* stone-600 */
--destructive: oklch(0.704 0.191 22.216);
--border-base: oklch(1 0 0 / 12%);
--border: color-mix(in srgb, var(--border-base) 80%, transparent);
@@ -230,14 +272,14 @@
/* Light mode darkens the control edge away from the card; dark mode lightens
it. Not the light value inverted — measured on this theme's own surfaces:
3.22:1 on the card, 3.34:1 on the page ground. */
- --border-control: oklch(0.52 0.006 56);
- --border-field: oklch(0.32 0.004 56);
+ --border-control: oklch(52% 0.01 56.259);
+ --border-field: oklch(32% 0.007 34.298);
/* Same arrangement as light — container at the page colour, records raised
above it. 1.118:1 between them here. Records take `--nested-raised` rather
than `--card`: the card token is a step above the page, which is where the
container would sit if it had a fill of its own. */
--card-container: var(--background);
- --nested-raised: oklch(0.235 0 0);
+ --nested-raised: oklch(23.5% 0.006 56.043);
--input: color-mix(in srgb, var(--border-base) 80%, transparent);
--ring: oklch(0.552 0.016 285); /* same blue ring as light, for focus parity */
--link: oklch(0.7 0.16 258);
@@ -253,6 +295,9 @@
--sidebar-primary-foreground: var(--primary-foreground);
--sidebar-accent: var(--accent);
--sidebar-accent-foreground: var(--accent-foreground);
+ --sidebar-accent-strong: var(--accent-strong);
+ --sidebar-accent-hover: var(--accent-hover);
+ --sidebar-accent-strong-hover: var(--accent-strong-hover);
/* Matches the rule the top bar draws, so every edge framing the shell —
the sidebar's, the top bar's, the settings header's — is one weight. */
--sidebar-border: color-mix(in srgb, var(--border) 75%, transparent);
@@ -341,6 +386,9 @@
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
+ --color-sidebar-accent-strong: var(--sidebar-accent-strong);
+ --color-sidebar-accent-hover: var(--sidebar-accent-hover);
+ --color-sidebar-accent-strong-hover: var(--sidebar-accent-strong-hover);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-primary: var(--sidebar-primary);
@@ -362,6 +410,9 @@
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-accent-foreground: var(--accent-foreground);
+ --color-accent-strong: var(--accent-strong);
+ --color-accent-hover: var(--accent-hover);
+ --color-accent-strong-hover: var(--accent-strong-hover);
--color-accent: var(--accent);
--color-muted-foreground: var(--muted-foreground);
--color-muted: var(--muted);
@@ -498,12 +549,12 @@
@layer base {
:root {
- --scrollbar-thumb: oklch(0.78 0.0078 56.259); /* stone-300-ish */
- --scrollbar-thumb-hover: oklch(0.62 0.0117 58.071);
+ --scrollbar-thumb: oklch(86.9% 0.005 56.366); /* stone-300 */
+ --scrollbar-thumb-hover: oklch(70.9% 0.01 56.259); /* stone-400 */
}
.dark {
- --scrollbar-thumb: oklch(0.35 0.0093 67.558); /* stone-700-ish */
- --scrollbar-thumb-hover: oklch(0.45 0.0111 73.639);
+ --scrollbar-thumb: oklch(37.4% 0.01 67.558); /* stone-700 */
+ --scrollbar-thumb-hover: oklch(44.4% 0.011 73.639); /* stone-600 */
}
/* Themed scrollbar inside floating surfaces only — page scrollbar stays
diff --git a/packages/dashboard-ui/src/ui/badge.tsx b/packages/dashboard-ui/src/ui/badge.tsx
index 91a0fdc674..bcd597a1d7 100644
--- a/packages/dashboard-ui/src/ui/badge.tsx
+++ b/packages/dashboard-ui/src/ui/badge.tsx
@@ -171,7 +171,7 @@ function StatusDot({ status, className }: { status: string; className?: string }
return (
<span
aria-hidden
- className={cn('inline-block size-1.5 shrink-0 rounded-full', dotToneClasses[tone], className)}
+ className={cn('inline-block size-2 shrink-0 rounded-full', dotToneClasses[tone], className)}
/>
)
}
diff --git a/packages/dashboard-ui/src/ui/button.tsx b/packages/dashboard-ui/src/ui/button.tsx
index 1c4636f100..b3f3662527 100644
--- a/packages/dashboard-ui/src/ui/button.tsx
+++ b/packages/dashboard-ui/src/ui/button.tsx
@@ -11,7 +11,12 @@ const buttonVariants = cva(
default: 'bg-primary text-primary-foreground hover:bg-primary/85',
outline:
'border-border bg-card shadow-xs text-foreground hover:bg-accent hover:text-foreground aria-expanded:bg-accent',
- ghost: 'hover:bg-accent hover:text-accent-foreground aria-expanded:bg-accent',
+ // `group-hover/row:` — inside a hovered table row the row already wears
+ // --accent, so repeating it here leaves the button at 1.03:1 against its
+ // own background: invisible exactly when the pointer is on it. On a
+ // hovered row it steps to --accent-strong instead.
+ ghost:
+ 'hover:bg-accent hover:text-accent-foreground aria-expanded:bg-accent group-hover/row:hover:bg-accent-strong',
destructive: 'text-destructive bg-card border-border shadow-xs hover:bg-destructive/10',
// Ghost's chrome (none until hover) with destructive's colour. The
// inline remove buttons that sit inside a row or field want no box of
diff --git a/packages/dashboard-ui/src/ui/command.tsx b/packages/dashboard-ui/src/ui/command.tsx
index 1ff9f9a00d..d2de5dd89b 100644
--- a/packages/dashboard-ui/src/ui/command.tsx
+++ b/packages/dashboard-ui/src/ui/command.tsx
@@ -179,7 +179,7 @@ function CommandItem({
<CommandPrimitive.Item
data-slot="command-item"
className={cn(
- "group/command-item relative flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-accent data-selected:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-selected:*:[svg]:text-foreground",
+ "group/command-item relative flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-accent-strong data-selected:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-selected:*:[svg]:text-foreground",
className,
)}
{...props}
diff --git a/packages/dashboard-ui/src/ui/data-table.tsx b/packages/dashboard-ui/src/ui/data-table.tsx
index efb611d96d..1f9cb6f593 100644
--- a/packages/dashboard-ui/src/ui/data-table.tsx
+++ b/packages/dashboard-ui/src/ui/data-table.tsx
@@ -245,7 +245,10 @@ function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
function TableRow({ className, ...props }: React.ComponentProps<'tr'>) {
return (
- <tr className={cn('group/row hover:bg-accent/70 last:*:border-b-0', className)} {...props} />
+ <tr
+ className={cn('group/row hover:bg-accent-strong/50 last:*:border-b-0', className)}
+ {...props}
+ />
)
}
diff --git a/packages/dashboard-ui/src/ui/dialog.tsx b/packages/dashboard-ui/src/ui/dialog.tsx
index 5169e87ec2..83e595d6e1 100644
--- a/packages/dashboard-ui/src/ui/dialog.tsx
+++ b/packages/dashboard-ui/src/ui/dialog.tsx
@@ -83,7 +83,7 @@ function DialogOverlay({
<DialogPrimitive.Backdrop
data-slot="dialog-overlay"
className={cn(
- 'fixed inset-0 isolate z-50 bg-accent/75 dark:bg-black/60 duration-100 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 transition-opacity',
+ 'fixed inset-0 isolate z-50 bg-background/60 dark:bg-black/60 duration-100 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 transition-opacity',
className,
)}
{...props}
diff --git a/packages/dashboard-ui/src/ui/rich-text-editor.tsx b/packages/dashboard-ui/src/ui/rich-text-editor.tsx
index e8554ae5eb..d43a35c9de 100644
--- a/packages/dashboard-ui/src/ui/rich-text-editor.tsx
+++ b/packages/dashboard-ui/src/ui/rich-text-editor.tsx
@@ -348,7 +348,7 @@ function ToolbarButton({
aria-pressed={active}
className={cn(
'inline-flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-foreground transition-colors disabled:opacity-40 disabled:pointer-events-none',
- active && 'bg-accent text-foreground',
+ active && 'bg-accent-strong text-foreground',
)}
>
{children}
diff --git a/packages/dashboard-ui/src/ui/sheet.tsx b/packages/dashboard-ui/src/ui/sheet.tsx
index 08035e99bb..c5c512ef71 100644
--- a/packages/dashboard-ui/src/ui/sheet.tsx
+++ b/packages/dashboard-ui/src/ui/sheet.tsx
@@ -94,7 +94,7 @@ function SheetOverlay({
<SheetPrimitive.Backdrop
data-slot="sheet-overlay"
className={cn(
- 'fixed inset-0 z-50 bg-accent/75 dark:bg-black/60 duration-200 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 transition-opacity',
+ 'fixed inset-0 z-50 bg-background/60 dark:bg-black/60 duration-200 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 transition-opacity',
className,
)}
{...props}
diff --git a/packages/dashboard-ui/src/ui/sidebar.tsx b/packages/dashboard-ui/src/ui/sidebar.tsx
index 1dc38e742c..78590329a3 100644
--- a/packages/dashboard-ui/src/ui/sidebar.tsx
+++ b/packages/dashboard-ui/src/ui/sidebar.tsx
@@ -526,7 +526,7 @@ const sidebarMenuButtonVariants = cva(
// badge. Without it the flex line wraps and the label visibly squashes to two
// lines inside the fixed height until the animation lands. Labels clip
// instead — which is what the `truncate` below already intends.
- 'peer/menu-button group/menu-button flex gap-2 w-full items-center overflow-hidden whitespace-nowrap rounded-lg p-1 text-left text-base text-sidebar-foreground/80 outline-hidden transition-colors duration-100 ease-out group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-10! group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:overflow-visible group-data-[collapsible=icon]:p-0! group-data-[collapsible=icon]:gap-0 group-data-[collapsible=icon]:[&>span:last-child]:hidden hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-foreground data-active:bg-sidebar-accent data-active:text-foreground data-active:font-semibold [&>span:last-child]:truncate',
+ 'peer/menu-button group/menu-button flex gap-2 w-full items-center overflow-hidden whitespace-nowrap rounded-lg p-1 text-left text-base text-sidebar-foreground/80 outline-hidden transition-colors duration-100 ease-out group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-10! group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:overflow-visible group-data-[collapsible=icon]:p-0! group-data-[collapsible=icon]:gap-0 group-data-[collapsible=icon]:[&>span:last-child]:hidden hover:bg-sidebar-accent-hover hover:text-sidebar-foreground focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent-hover data-open:hover:text-sidebar-foreground data-active:bg-sidebar-accent-strong data-active:hover:bg-sidebar-accent-strong-hover data-active:text-foreground data-active:font-semibold [&>span:last-child]:truncate',
{
variants: {
variant: {
@@ -719,7 +719,7 @@ function SidebarMenuSubButton({
data-size={size}
data-active={isActive}
className={cn(
- 'relative flex h-7 in-data-[mobile=true]:h-11 in-data-[mobile=true]:px-2 min-w-0 items-center gap-2 overflow-hidden rounded-lg p-1 text-sidebar-foreground/80 outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-base data-[size=sm]:text-xs data-active:font-semibold data-active:text-foreground data-active:bg-transparent data-active:shadow-none data-active:before:absolute data-active:before:-left-4 data-active:before:top-[10%] data-active:before:h-[80%] data-active:before:w-[3px] data-active:before:rounded-sm data-active:before:bg-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
+ 'relative flex h-7 in-data-[mobile=true]:h-11 in-data-[mobile=true]:px-2 min-w-0 items-center gap-2 overflow-hidden rounded-lg p-1 text-sidebar-foreground/80 outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent-hover hover:text-sidebar-foreground focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-base data-[size=sm]:text-xs data-active:font-semibold data-active:text-foreground data-active:bg-transparent data-active:shadow-none data-active:before:absolute data-active:before:-left-4 data-active:before:top-[10%] data-active:before:h-[80%] data-active:before:w-[3px] data-active:before:rounded-sm data-active:before:bg-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
className,
)}
{...props}
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/index.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/index.tsx
index c685051615..1b95d9fd2b 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/settings/index.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/index.tsx
@@ -90,7 +90,7 @@ function SettingsCard({ entry }: { entry: SettingsNavEntry }) {
const description = resolveNavDescription(entry, t)
return (
- <Card className="p-0 transition-colors hover:bg-accent/80 hover:border-neutral-200 dark:hover:border-neutral-800">
+ <Card className="p-0 transition-colors hover:bg-accent/80 hover:border-border">
{/* The whole card is the target — a small title-only link would fail the
44px minimum on touch and leaves most of the card dead to a click. */}
{/* Paths come from a runtime registry plugins extend, so they can't be
diff --git a/packages/dashboard/src/tables/channels.tsx b/packages/dashboard/src/tables/channels.tsx
index 22ea756e25..3d810f1226 100644
--- a/packages/dashboard/src/tables/channels.tsx
+++ b/packages/dashboard/src/tables/channels.tsx
@@ -41,7 +41,13 @@ defineTable<Channel>('channels', {
filterable: true,
filterType: 'boolean',
default: true,
- render: (channel) => <ActiveBadge active={channel.active} />,
+ render: (channel) => (
+ <ActiveBadge
+ active={channel.active}
+ activeLabel={i18n.t('admin.common.active')}
+ inactiveLabel={i18n.t('admin.common.inactive')}
+ />
+ ),
},
{
key: 'default',
diff --git a/packages/seller-dashboard/src/pages/delivery-methods.tsx b/packages/seller-dashboard/src/pages/delivery-methods.tsx
index b05a5d208b..5214e240ab 100644
--- a/packages/seller-dashboard/src/pages/delivery-methods.tsx
+++ b/packages/seller-dashboard/src/pages/delivery-methods.tsx
@@ -547,7 +547,7 @@ function DeliveryMethodSheet({
return (
<div
key={rule.id ?? `${rule.type}-${index}`}
- className="flex flex-col gap-3 rounded-md border border-border p-3"
+ className="flex flex-col gap-3 rounded-lg border border-border-subtle p-3"
>
<div className="flex items-center justify-between gap-4">
<div className="flex flex-col">
diff --git a/packages/seller-dashboard/src/pages/onboarding.tsx b/packages/seller-dashboard/src/pages/onboarding.tsx
index 0048c53f62..d4d752187a 100644
--- a/packages/seller-dashboard/src/pages/onboarding.tsx
+++ b/packages/seller-dashboard/src/pages/onboarding.tsx
@@ -6,6 +6,10 @@ import {
progressPercentage,
} from '@spree/dashboard-core'
import {
+ Accordion,
+ AccordionContent,
+ AccordionItem,
+ AccordionTrigger,
Badge,
Button,
Card,
@@ -81,6 +85,8 @@ export function OnboardingPage() {
const { progress, requirements, status } = data
const blocking = requirements.filter((requirement) => requirement.blocking)
const submitted = status === 'ready_for_review'
+ const outstanding = firstOutstanding(requirements)
+ const openByDefault = outstanding ? [outstanding.id] : []
return (
<div className="flex flex-col gap-6">
@@ -117,17 +123,45 @@ export function OnboardingPage() {
</Card>
{requirements.length > 0 && (
- <div className="flex flex-col gap-3">
- {requirements.map((requirement) => (
- <RequirementCard
- key={requirement.id}
- requirement={requirement}
- // Open the first outstanding line and collapse the rest: it
- // answers "what do I do next" without the seller hunting for it.
- defaultOpen={requirement.id === firstOutstanding(requirements)?.id}
- />
- ))}
- </div>
+ // One card holding every requirement, matching the operator's getting
+ // started checklist: this is a single list read top to bottom, and a
+ // frame around each line made them read as unrelated things.
+ //
+ // `multiple` because these are independent — a seller does them in any
+ // order — so opening one must not close the one they were reading.
+ // Opens on the first outstanding line, which answers "what next".
+ <Card className="overflow-hidden py-0">
+ <Accordion multiple defaultValue={openByDefault}>
+ {requirements.map((requirement) => (
+ <AccordionItem key={requirement.id} value={requirement.id}>
+ <AccordionTrigger>
+ <StatusIcon status={requirement.status} />
+ <div className="flex min-w-0 flex-col">
+ <span
+ className={
+ requirement.status === 'complete' ? 'text-muted-foreground' : undefined
+ }
+ >
+ {requirement.name}
+ </span>
+ {!requirement.required && (
+ <span className="font-normal text-muted-foreground text-xs">
+ {t('onboarding.optional')}
+ </span>
+ )}
+ </div>
+ <StatusBadge status={requirement.status} />
+ </AccordionTrigger>
+ <AccordionContent className="flex flex-col gap-3 ps-12">
+ {requirement.description && (
+ <p className="text-muted-foreground text-sm">{requirement.description}</p>
+ )}
+ <RequirementAction requirement={requirement} />
+ </AccordionContent>
+ </AccordionItem>
+ ))}
+ </Accordion>
+ </Card>
)}
</div>
)
@@ -137,50 +171,6 @@ function firstOutstanding(requirements: RequirementStatus[]): RequirementStatus
return requirements.find((requirement) => requirement.status !== 'complete')
}
-function RequirementCard({
- requirement,
- defaultOpen,
-}: {
- requirement: RequirementStatus
- defaultOpen: boolean
-}) {
- const { t } = useTranslation()
- const [open, setOpen] = useState(defaultOpen)
-
- return (
- <Card className="overflow-hidden">
- <button
- type="button"
- onClick={() => setOpen((previous) => !previous)}
- className="flex w-full cursor-pointer items-center gap-3 p-4 text-left hover:bg-accent/50"
- >
- <StatusIcon status={requirement.status} />
- <div className="flex min-w-0 flex-col">
- <span className="font-medium text-sm">{requirement.name}</span>
- {!requirement.required && (
- <span className="text-muted-foreground text-xs">{t('onboarding.optional')}</span>
- )}
- </div>
- <StatusBadge status={requirement.status} />
- <ChevronRightIcon
- className={`ml-auto size-4 shrink-0 text-muted-foreground transition-transform ${
- open ? 'rotate-90' : ''
- }`}
- />
- </button>
-
- {open && (
- <CardContent className="flex flex-col gap-3 border-t pt-4">
- {requirement.description && (
- <p className="text-muted-foreground text-sm">{requirement.description}</p>
- )}
- <RequirementAction requirement={requirement} />
- </CardContent>
- )}
- </Card>
- )
-}
-
/**
* What the seller does about one line, keyed off `kind`.
*
@@ -511,15 +501,15 @@ function panelRoute(kind: string): string | undefined {
function StatusIcon({ status }: { status: string }) {
if (status === 'complete') {
- return <CheckCircle2Icon className="size-4 shrink-0 text-green-600" />
+ return <CheckCircle2Icon className="size-5 shrink-0 text-success" />
}
if (status === 'pending') {
- return <ClockIcon className="size-4 shrink-0 text-amber-600" />
+ return <ClockIcon className="size-5 shrink-0 text-warning" />
}
if (status === 'rejected') {
- return <XCircleIcon className="size-4 shrink-0 text-destructive" />
+ return <XCircleIcon className="size-5 shrink-0 text-destructive" />
}
- return <CircleIcon className="size-4 shrink-0 text-muted-foreground" />
+ return <CircleIcon className="size-5 shrink-0 text-muted-foreground" />
}
function StatusBadge({ status }: { status: string }) {
diff --git a/packages/seller-dashboard/src/pages/policies.tsx b/packages/seller-dashboard/src/pages/policies.tsx
index c5d1e92837..a778fd6b78 100644
--- a/packages/seller-dashboard/src/pages/policies.tsx
+++ b/packages/seller-dashboard/src/pages/policies.tsx
@@ -132,7 +132,7 @@ export function PoliciesPage({ search }: { search: ResourceSearch }) {
{outstanding.map((name) => (
<li
key={name}
- className="flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2"
+ className="flex items-center justify-between gap-4 rounded-lg border border-border-subtle px-3 py-2"
>
<span className="font-medium text-sm">{name}</span>
<Button size="sm" variant="outline" onClick={() => setCreatingName(name)}>