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 dashboard design (#14455)

Damian Legawiec6f01054feeed
diff --git a/packages/dashboard-core/src/components/resource-combobox.tsx b/packages/dashboard-core/src/components/resource-combobox.tsx
index d873e53bcd..7428440037 100644
--- a/packages/dashboard-core/src/components/resource-combobox.tsx
+++ b/packages/dashboard-core/src/components/resource-combobox.tsx
@@ -6,6 +6,7 @@ import {
import { useQuery } from '@tanstack/react-query'
import { useDeferredValue, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
+import { useStore } from '../providers/store-provider'
export type { ComboboxOption } from '@spree/dashboard-ui'
@@ -78,6 +79,9 @@ export function ResourceCombobox<T extends ComboboxOption>({
// `onInputChange` on the Root rather than controlling
// `<ComboboxInput value>` directly — controlling the input blocks Base UI
// from updating it on selection.
+ // Scoped here, not at the call site: results are store-specific, and a caller
+ // passing a constant key would otherwise serve one store's records in another.
+ const { storeId } = useStore()
const [input, setInput] = useState('')
// Defer the search query so a fast typist doesn't fire one request per
// keystroke — React batches the search to the next idle paint.
@@ -85,7 +89,7 @@ export function ResourceCombobox<T extends ComboboxOption>({
const trimmedQuery = deferredInput.trim()
const { data: searchData } = useQuery({
- queryKey: [queryKey, 'search', trimmedQuery],
+ queryKey: [queryKey, storeId, 'search', trimmedQuery],
queryFn: () => search(trimmedQuery),
staleTime: 30_000,
})
@@ -95,7 +99,7 @@ export function ResourceCombobox<T extends ComboboxOption>({
// Skipped when the search results already include the ID.
const searchHasValue = !!(value && searchData?.data.some((r) => r.id === value))
const { data: hydratedData } = useQuery({
- queryKey: [queryKey, 'hydrate', value],
+ queryKey: [queryKey, storeId, 'hydrate', value],
queryFn: () => hydrate([value as string]),
enabled: !!value && !searchHasValue,
staleTime: 60_000,
diff --git a/packages/dashboard-core/src/components/resource-table.tsx b/packages/dashboard-core/src/components/resource-table.tsx
index 1431c11ca3..5f569c1c03 100644
--- a/packages/dashboard-core/src/components/resource-table.tsx
+++ b/packages/dashboard-core/src/components/resource-table.tsx
@@ -28,6 +28,7 @@ import {
EmptyTitle,
Pagination,
type PaginationMeta,
+ Skeleton,
Table,
TableBody,
TableCell,
@@ -502,9 +503,9 @@ export function ResourceTable<T extends Record<string, any>>({
</TableHeader>
<TableBody>
{isLoading ? (
- <TableEmpty colSpan={visibleColumns.length + 1 + (rowActionsEnabled ? 1 : 0)}>
- {t('admin.common.loading')}
- </TableEmpty>
+ <TableSkeletonRows
+ colSpan={visibleColumns.length + 1 + (rowActionsEnabled ? 1 : 0)}
+ />
) : rows.length === 0 ? (
<TableEmpty colSpan={visibleColumns.length + 1 + (rowActionsEnabled ? 1 : 0)}>
<Empty className="border-0 p-0">
@@ -611,15 +612,13 @@ export function ResourceTable<T extends Record<string, any>>({
</TableHeader>
<TableBody>
{isLoading ? (
- <TableEmpty
+ <TableSkeletonRows
colSpan={
visibleColumns.length +
(selectionEnabled ? 1 : 0) +
(rowActionsEnabled ? 1 : 0)
}
- >
- {t('admin.common.loading')}
- </TableEmpty>
+ />
) : rows.length === 0 ? (
<TableEmpty
colSpan={
@@ -651,7 +650,10 @@ export function ResourceTable<T extends Record<string, any>>({
return (
<TableRow
key={(row as any).id ?? i}
- className={isSelected ? 'bg-muted/40' : undefined}
+ // 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}
>
{selectionEnabled && (
<TableCell className="w-8">
@@ -690,6 +692,27 @@ export function ResourceTable<T extends Record<string, any>>({
)
}
+// ============================================================================
+// TableSkeletonRows — placeholder rows while the first page loads. Rows rather
+// than a "Loading…" line so the table keeps its height and the page doesn't
+// jump when data lands.
+// ============================================================================
+
+function TableSkeletonRows({ colSpan, rows = 8 }: { colSpan: number; rows?: number }) {
+ return (
+ <>
+ {Array.from({ length: rows }, (_, i) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: fixed-length placeholder list
+ <tr key={i} className="last:*:border-b-0">
+ <TableCell colSpan={colSpan}>
+ <Skeleton className="h-5 w-full" />
+ </TableCell>
+ </tr>
+ ))}
+ </>
+ )
+}
+
// ============================================================================
// SortableRow — internal row that wires dnd-kit's listeners to a leading
// drag-handle cell. Mirrors the styling of <TableRow> from data-table.tsx.
@@ -718,7 +741,7 @@ function SortableRow<T extends Record<string, any>>({
ref={setNodeRef}
style={style}
className={cn(
- 'group/row hover:bg-muted/60 last:*:border-b-0',
+ 'group/row hover:bg-accent/60 last:*:border-b-0',
isDragging && 'relative z-10 opacity-70',
)}
>
diff --git a/packages/dashboard-core/src/components/table-toolbar.tsx b/packages/dashboard-core/src/components/table-toolbar.tsx
index 5dbb5363e1..fb2e0143a9 100644
--- a/packages/dashboard-core/src/components/table-toolbar.tsx
+++ b/packages/dashboard-core/src/components/table-toolbar.tsx
@@ -179,7 +179,7 @@ export function TableToolbar({
return (
<>
- <div className="flex flex-col lg:flex-row gap-2 items-start lg:items-center justify-between p-3 pl-4 border-b border-border">
+ <div className="flex flex-col lg:flex-row gap-2 items-start lg:items-center justify-between p-3 pl-4 border-b border-border-subtle">
{title && <CardTitle>{title}</CardTitle>}
<div className="flex gap-2 items-center flex-wrap ml-auto">
{/* Search */}
@@ -216,7 +216,12 @@ export function TableToolbar({
<Tooltip>
<TooltipTrigger asChild>
<PopoverTrigger asChild>
- <Button variant="ghost" size="sm" className="h-[2.125rem]">
+ <Button
+ variant="ghost"
+ size="sm"
+ className="h-[2.125rem]"
+ aria-label={t('admin.components.table_toolbar.filters_button')}
+ >
<FilterIcon className="size-4" />
{activeFilterCount > 0 && (
<Badge variant="outline" className="ml-1 px-1.5 py-0 text-xs">
@@ -262,7 +267,7 @@ export function TableToolbar({
{/* Active filter badges */}
{filters.length > 0 && (
- <div className="flex gap-2 flex-wrap px-3 py-2 border-b border-border">
+ <div className="flex flex-wrap items-center gap-2 border-b border-border-subtle px-3 py-2">
{filters.map((filter) => (
<FilterChip
key={filter.id}
@@ -271,13 +276,15 @@ export function TableToolbar({
onRemove={() => onFiltersChange(filters.filter((f) => f.id !== filter.id))}
/>
))}
- <button
+ <Button
type="button"
- className="text-xs text-muted-foreground hover:text-foreground"
+ variant="ghost"
+ size="sm"
+ className="text-muted-foreground hover:text-foreground"
onClick={() => onFiltersChange([])}
>
{t('admin.components.table_toolbar.clear_all')}
- </button>
+ </Button>
</div>
)}
</>
@@ -303,7 +310,7 @@ function FilterChip({
const showValue = !noValueOperators.includes(filter.operator)
return (
- <Badge variant="outline" className="gap-1.5 pr-0.5">
+ <Badge variant="outline" className="h-7 gap-1.5 pr-1 pl-2.5 text-sm">
<span className="font-medium">{col?.label ?? filter.field}</span>
<span className="text-muted-foreground">{opLabel}</span>
{showValue &&
@@ -318,9 +325,13 @@ function FilterChip({
) : (
<span className="font-medium">{filter.value}</span>
))}
+ {/* 20px box around a 12px glyph: the chip's own height caps how large
+ this can be, and the chips are spaced by `gap-2`, which is what the
+ target-size rule asks for when the control itself is under 24px. */}
<button
type="button"
- className="ml-0.5 p-0.5 rounded-full hover:bg-accent"
+ aria-label={t('admin.components.table_toolbar.remove_filter')}
+ className="ml-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50"
onClick={onRemove}
>
<XIcon className="size-3" />
@@ -469,7 +480,12 @@ function SortDropdown({
<Tooltip>
<TooltipTrigger asChild>
<DropdownMenuTrigger asChild>
- <Button variant="ghost" size="sm" className="h-[2.125rem]">
+ <Button
+ variant="ghost"
+ size="sm"
+ className="h-[2.125rem]"
+ aria-label={t('admin.components.table_toolbar.sort_tooltip')}
+ >
<ArrowUpDownIcon className="size-4" />
</Button>
</DropdownMenuTrigger>
@@ -536,7 +552,12 @@ function ColumnSelector({
<Tooltip>
<TooltipTrigger asChild>
<DropdownMenuTrigger asChild>
- <Button variant="ghost" size="sm" className="h-[2.125rem]">
+ <Button
+ variant="ghost"
+ size="sm"
+ className="h-[2.125rem]"
+ aria-label={t('admin.components.table_toolbar.columns_tooltip')}
+ >
<Columns3Icon className="size-4" />
</Button>
</DropdownMenuTrigger>
diff --git a/packages/dashboard-core/src/components/top-bar.tsx b/packages/dashboard-core/src/components/top-bar.tsx
index 2eef9066d5..93e93edbc8 100644
--- a/packages/dashboard-core/src/components/top-bar.tsx
+++ b/packages/dashboard-core/src/components/top-bar.tsx
@@ -78,7 +78,7 @@ export function TopBar({
return (
<header
className={cn(
- 'sticky top-0 z-40 flex h-header-height shrink-0 items-center gap-3 bg-background/90 px-4 border-b backdrop-blur supports-[backdrop-filter]:bg-background/75',
+ 'sticky top-0 z-40 flex h-header-height shrink-0 items-center gap-3 bg-background/90 px-4 border-b border-border/75 backdrop-blur supports-[backdrop-filter]:bg-background/75',
'transition-transform duration-200 ease-out motion-reduce:transition-none',
hidden && '-translate-y-full',
)}
@@ -86,7 +86,9 @@ export function TopBar({
// so keyboard focus can't land on a control the user cannot see.
inert={hidden || undefined}
>
- <SidebarTrigger className="-ml-1 h-6 w-6 opacity-60 hover:opacity-100 hover:bg-accent" />
+ {/* 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" />
<div className="flex flex-1 justify-center">
<SearchTrigger />
diff --git a/packages/dashboard-core/src/locales/ar.json b/packages/dashboard-core/src/locales/ar.json
index 60ea28e6cc..b8a9641cce 100644
--- a/packages/dashboard-core/src/locales/ar.json
+++ b/packages/dashboard-core/src/locales/ar.json
@@ -29,6 +29,8 @@
"invite": "دعوة",
"more_actions": "المزيد من الإجراءات",
"remove": "إزالة",
+ "remove_item": "إزالة {{label}}",
+ "remove_rule": "إزالة القاعدة",
"reset": "إعادة تعيين",
"revoke": "إلغاء التفويض",
"save": "حفظ",
@@ -447,6 +449,7 @@
"visible_columns": "الأعمدة المرئية",
"reset_to_default": "إعادة إلى الافتراضي",
"clear_all": "مسح الكل",
+ "remove_filter": "إزالة الفلتر",
"no_filters": "لا توجد فلاتر. انقر أدناه لإضافة واحد.",
"add_filter": "إضافة فلتر",
"operators": {
diff --git a/packages/dashboard-core/src/locales/de.json b/packages/dashboard-core/src/locales/de.json
index 041957f782..72431746cd 100644
--- a/packages/dashboard-core/src/locales/de.json
+++ b/packages/dashboard-core/src/locales/de.json
@@ -29,6 +29,8 @@
"invite": "Einladen",
"more_actions": "Weitere Aktionen",
"remove": "Entfernen",
+ "remove_item": "{{label}} entfernen",
+ "remove_rule": "Regel entfernen",
"reset": "Zurücksetzen",
"revoke": "Widerrufen",
"save": "Speichern",
@@ -447,6 +449,7 @@
"visible_columns": "Sichtbare Spalten",
"reset_to_default": "Auf Standard zurücksetzen",
"clear_all": "Alle löschen",
+ "remove_filter": "Filter entfernen",
"no_filters": "Keine Filter. Klicken Sie unten, um einen hinzuzufügen.",
"add_filter": "Filter hinzufügen",
"operators": {
diff --git a/packages/dashboard-core/src/locales/en.json b/packages/dashboard-core/src/locales/en.json
index 5716f6ee50..0d37b304cd 100644
--- a/packages/dashboard-core/src/locales/en.json
+++ b/packages/dashboard-core/src/locales/en.json
@@ -29,6 +29,8 @@
"invite": "Invite",
"more_actions": "More actions",
"remove": "Remove",
+ "remove_item": "Remove {{label}}",
+ "remove_rule": "Remove rule",
"reset": "Reset",
"revoke": "Revoke",
"save": "Save",
@@ -447,6 +449,7 @@
"visible_columns": "Visible columns",
"reset_to_default": "Reset to default",
"clear_all": "Clear all",
+ "remove_filter": "Remove filter",
"no_filters": "No filters. Click below to add one.",
"add_filter": "Add filter",
"operators": {
diff --git a/packages/dashboard-core/src/locales/fr.json b/packages/dashboard-core/src/locales/fr.json
index 016580c37e..32ff1122de 100644
--- a/packages/dashboard-core/src/locales/fr.json
+++ b/packages/dashboard-core/src/locales/fr.json
@@ -29,6 +29,8 @@
"invite": "Inviter",
"more_actions": "Plus d'actions",
"remove": "Retirer",
+ "remove_item": "Supprimer {{label}}",
+ "remove_rule": "Supprimer la règle",
"reset": "Réinitialiser",
"revoke": "Révoquer",
"save": "Enregistrer",
@@ -447,6 +449,7 @@
"visible_columns": "Colonnes visibles",
"reset_to_default": "Réinitialiser",
"clear_all": "Tout effacer",
+ "remove_filter": "Supprimer le filtre",
"no_filters": "Aucun filtre. Cliquez ci-dessous pour en ajouter un.",
"add_filter": "Ajouter un filtre",
"operators": {
diff --git a/packages/dashboard-core/src/locales/pl.json b/packages/dashboard-core/src/locales/pl.json
index 87018d3568..abe55e14c5 100644
--- a/packages/dashboard-core/src/locales/pl.json
+++ b/packages/dashboard-core/src/locales/pl.json
@@ -29,6 +29,8 @@
"invite": "Zaproś",
"more_actions": "Więcej akcji",
"remove": "Usuń",
+ "remove_item": "Usuń {{label}}",
+ "remove_rule": "Usuń regułę",
"reset": "Resetuj",
"revoke": "Cofnij",
"save": "Zapisz",
@@ -447,6 +449,7 @@
"visible_columns": "Widoczne kolumny",
"reset_to_default": "Przywróć domyślne",
"clear_all": "Wyczyść wszystko",
+ "remove_filter": "Usuń filtr",
"no_filters": "Brak filtrów. Kliknij poniżej, aby dodać filtr.",
"add_filter": "Dodaj filtr",
"operators": {
diff --git a/packages/dashboard-core/src/locales/zh-CN.json b/packages/dashboard-core/src/locales/zh-CN.json
index 0a1cf2169f..7c7b194e65 100644
--- a/packages/dashboard-core/src/locales/zh-CN.json
+++ b/packages/dashboard-core/src/locales/zh-CN.json
@@ -29,6 +29,8 @@
"invite": "邀请",
"more_actions": "更多操作",
"remove": "移除",
+ "remove_item": "移除 {{label}}",
+ "remove_rule": "移除规则",
"reset": "重置",
"revoke": "撤销",
"save": "保存",
@@ -447,6 +449,7 @@
"visible_columns": "可见列",
"reset_to_default": "重置为默认值",
"clear_all": "全部清除",
+ "remove_filter": "移除筛选",
"no_filters": "暂无筛选条件。点击下方添加。",
"add_filter": "添加筛选条件",
"operators": {
diff --git a/packages/dashboard-ui/src/styles.css b/packages/dashboard-ui/src/styles.css
index d65160f278..26d46df1ab 100644
--- a/packages/dashboard-ui/src/styles.css
+++ b/packages/dashboard-ui/src/styles.css
@@ -29,12 +29,11 @@
Adapted from spree/admin Tailwind design system to match look & feel.
============================================================================ */
-/* Brand palette, taken from spreecommerce.org.
+/* Brand palette.
*
- * The marketing site is built on a warm sand neutral ramp (hue ~80) rather
- * than a pure greyscale, with a single blue accent. Neutrals below carry a
- * small amount of chroma on that hue so surfaces, borders and text read as
- * one family; the accent is the only saturated colour in the palette.
+ * Surfaces, borders and text are Tailwind's `neutral` ramp — true greyscale,
+ * zero chroma — so the single blue accent is the only colour in the palette
+ * and reads unmistakably as interaction.
*
* Primary CTAs stay near-black rather than adopting the site's blue button:
* in a dense admin UI the blue has to stay meaningful as a selection and
@@ -44,34 +43,43 @@
--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 */
- --background: oklch(0.9858 0.0045 78.3); /* #fcfaf7 — site page background */
- --foreground: oklch(0.2136 0.0555 255.9); /* #061932 — site body text */
- --card: oklch(1 0 0); /* white cards, as on the site */
- --card-foreground: oklch(0.2136 0.0555 255.9);
+ --background: oklch(0.97 0 0); /* neutral-100 */
+ --foreground: oklch(0.145 0 0); /* neutral-950 */
+ --card: oklch(1 0 0); /* white cards, one step above the page */
+ --card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
- --popover-foreground: oklch(0.2136 0.0555 255.9);
- --primary: oklch(0.2136 0.0555 255.9); /* near-black navy for primary CTAs */
+ --popover-foreground: oklch(0.145 0 0);
+ --primary: oklch(0.145 0 0); /* neutral-950 — near-black primary CTAs */
--primary-foreground: oklch(1 0 0);
- /* Halfway from the site's #f7f5f2 to white — filled surfaces (table headers,
- badges, secondary buttons) read as a whisper against the card rather than
- a distinct band. */
- --secondary: oklch(0.9854 0.0022 78.3);
- --secondary-foreground: oklch(0.2136 0.0555 255.9);
- --muted: oklch(0.9854 0.0022 78.3);
- --muted-foreground: oklch(0.5232 0.0122 76.5); /* warm mid-grey on the same ramp */
- /* Hover/highlight for menu items and table rows. Deliberately a lighter step
- than the site's #e9e5dd: these sit on white surfaces, where that value is
- a ~8% drop in lightness and reads as a pressed state rather than a hover.
- The sidebar keeps the stronger tone via --sidebar-accent, since it sits on
- the sand sidebar rather than on white. */
- --accent: oklch(0.965 0.006 84.6);
- --accent-foreground: oklch(0.2136 0.0555 255.9);
+ /* 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); /* neutral-100 */
+ --secondary-foreground: oklch(0.145 0 0);
+ --muted: oklch(0.985 0 0); /* neutral-50 */
+ /* Between neutral-500 and -600. Clears 4.5:1 against every surface this text
+ actually lands on — including --accent, the darkest of them — where the
+ neutral-500 step measured 4.15:1. Dark mode keeps its own value: it already
+ passes on all four grounds. */
+ --muted-foreground: oklch(0.535 0 0);
+ /* Hover/highlight for menu items and table rows. A lighter step than
+ neutral-200: these sit on white surfaces, where that value reads as a
+ pressed state rather than a hover. The sidebar keeps the stronger tone
+ via --sidebar-accent, since it sits on the grey sidebar rather than on
+ white. */
+ --accent: oklch(0.955 0 0);
+ --accent-foreground: oklch(0.145 0 0);
--destructive: oklch(0.58 0.22 27); /* red-600 */
--destructive-foreground: oklch(1 0 0); /* #ffffff */
- /* A quarter of the way from the site's #e2dfd8 to white — rules stay legible
- but recede, so a dense table reads as rows of content rather than a grid. */
- --border: oklch(0.928 0.0075 87.5);
- --input: oklch(0.928 0.0075 87.5);
+ /* neutral-200 — rules stay legible but recede, so a dense table reads as
+ rows of content rather than a grid. */
+ --border: oklch(0.922 0 0);
+ /* Half-strength rule for dividers *inside* a container — card header/footer
+ splits, dialog and sheet separators, table chrome. Distinct from --border,
+ which draws a container's own edge. Resolved to a real colour rather than
+ an opacity utility so it also works inside arbitrary values such as the
+ sticky table header's inset shadow, where `/50` has no effect. */
+ --border-subtle: color-mix(in srgb, var(--border) 50%, transparent);
+ --input: oklch(0.922 0 0);
--ring: var(--brand-blue);
--chart-1: oklch(0.7663 0.1067 254.4);
--chart-2: oklch(0.5967 0.2212 258); /* brand blue */
@@ -80,14 +88,14 @@
--chart-5: oklch(0.3358 0.118 257.1);
--radius: 0.75rem;
- /* Sidebar — the site's raised warm surface, one step off the page. */
- --sidebar: oklch(97.1% 0.005 78.3);
- --sidebar-foreground: oklch(0.2136 0.0555 255.9);
- --sidebar-primary: oklch(0.2136 0.0555 255.9);
+ /* Sidebar — one step off the page, so it reads as its own surface. */
+ --sidebar: oklch(0.97 0 0); /* neutral-100 */
+ --sidebar-foreground: oklch(0.145 0 0);
+ --sidebar-primary: oklch(0.145 0 0);
--sidebar-primary-foreground: oklch(1 0 0);
- --sidebar-accent: oklch(92.1% 0.011 76.6);
- --sidebar-accent-foreground: oklch(0.2136 0.0555 255.9);
- --sidebar-border: oklch(90.4% 0.01 87.5);
+ --sidebar-accent: oklch(0.922 0 0); /* neutral-200 */
+ --sidebar-accent-foreground: oklch(0.145 0 0);
+ --sidebar-border: oklch(0.9 0 0);
--sidebar-ring: var(--brand-blue);
/* Status ramps, following Vercel's Geist colour system.
@@ -140,7 +148,7 @@
/* 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 0);
- --primary-foreground: oklch(0.2136 0.0555 255.9); /* #061932 — light theme's primary */
+ --primary-foreground: oklch(0.145 0 0); /* neutral-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
@@ -154,6 +162,7 @@
--accent-foreground: oklch(0.95 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 12%);
+ --border-subtle: color-mix(in srgb, var(--border) 50%, transparent);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.552 0.016 285); /* same blue ring as light, for focus parity */
--chart-1: oklch(0.809 0.105 251.813);
@@ -164,7 +173,7 @@
--sidebar: oklch(0.145 0 0); /* #0a0a0a — slightly elevated from background */
--sidebar-foreground: oklch(0.95 0 0);
--sidebar-primary: oklch(0.95 0 0);
- --sidebar-primary-foreground: oklch(0.2136 0.0555 255.9);
+ --sidebar-primary-foreground: oklch(0.145 0 0);
--sidebar-accent: oklch(0.27 0 0);
--sidebar-accent-foreground: oklch(0.95 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
@@ -248,6 +257,7 @@
--color-ring: var(--ring);
--color-input: var(--input);
--color-border: var(--border);
+ --color-border-subtle: var(--border-subtle);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-accent-foreground: var(--accent-foreground);
@@ -385,8 +395,8 @@
@layer base {
:root {
- --scrollbar-thumb: oklch(0.78 0.012 84.6); /* warm sand, sits on the brand ramp */
- --scrollbar-thumb-hover: oklch(0.62 0.014 84.6);
+ --scrollbar-thumb: oklch(0.78 0 0); /* neutral-300-ish */
+ --scrollbar-thumb-hover: oklch(0.62 0 0);
}
.dark {
--scrollbar-thumb: oklch(0.35 0 0); /* zinc-700-ish */
diff --git a/packages/dashboard-ui/src/ui/card.tsx b/packages/dashboard-ui/src/ui/card.tsx
index a11956d1a8..922d68a6c9 100644
--- a/packages/dashboard-ui/src/ui/card.tsx
+++ b/packages/dashboard-ui/src/ui/card.tsx
@@ -20,7 +20,7 @@ function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
<div
data-slot="card-header"
className={cn(
- 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] px-3 py-2.5 border-b border-border rounded-t-[calc(var(--radius-2xl)-1px)]',
+ 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] px-3 py-2.5 border-b border-border-subtle rounded-t-[calc(var(--radius-2xl)-1px)]',
className,
)}
{...props}
@@ -61,7 +61,7 @@ function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
<div
data-slot="card-footer"
className={cn(
- 'flex items-center p-3 bg-transparent border-t border-border rounded-b-[calc(var(--radius-xl)-1px)]',
+ 'flex items-center p-3 bg-transparent border-t border-border-subtle rounded-b-[calc(var(--radius-xl)-1px)]',
className,
)}
{...props}
diff --git a/packages/dashboard-ui/src/ui/combobox.tsx b/packages/dashboard-ui/src/ui/combobox.tsx
index 506287063c..c4f4c58584 100644
--- a/packages/dashboard-ui/src/ui/combobox.tsx
+++ b/packages/dashboard-ui/src/ui/combobox.tsx
@@ -1,6 +1,7 @@
'use client'
import { Combobox as ComboboxPrimitive } from '@base-ui/react'
+import i18n from 'i18next'
import { CheckIcon, ChevronDownIcon, XIcon } from 'lucide-react'
import * as React from 'react'
import { cn } from '../lib/utils'
@@ -240,6 +241,16 @@ function ComboboxChip({
render={<Button variant="ghost" size="icon-xs" />}
className="opacity-50 hover:opacity-100"
data-slot="combobox-chip-remove"
+ // Names the chip it clears ("Remove Wholesale") rather than a bare
+ // "Remove": several sit side by side, and a dialog's own submit
+ // button is often called Remove too. An `aria-label` rather than an
+ // `sr-only` span, so the chip's text isn't duplicated as a second
+ // text node beside the one already visible.
+ aria-label={
+ typeof children === 'string'
+ ? i18n.t('admin.actions.remove_item', { label: children })
+ : i18n.t('admin.actions.remove')
+ }
>
<XIcon className="pointer-events-none" />
</ComboboxPrimitive.ChipRemove>
diff --git a/packages/dashboard-ui/src/ui/command.tsx b/packages/dashboard-ui/src/ui/command.tsx
index 27a19b463d..33c6ccf29b 100644
--- a/packages/dashboard-ui/src/ui/command.tsx
+++ b/packages/dashboard-ui/src/ui/command.tsx
@@ -11,7 +11,7 @@ function Command({ className, ...props }: React.ComponentProps<typeof CommandPri
<CommandPrimitive
data-slot="command"
className={cn(
- 'flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground',
+ 'flex size-full flex-col overflow-hidden rounded-2xl! bg-popover p-1 text-popover-foreground',
className,
)}
{...props}
@@ -54,7 +54,10 @@ function CommandInput({
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
return (
<div data-slot="command-input-wrapper" className="p-1 pb-0">
- <InputGroup className="h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!">
+ {/* One step inside the dialog's own radius, so the field's corners stay
+ concentric with the panel's rather than reading as a tighter shape
+ floating in the padding. */}
+ <InputGroup className="h-8! rounded-xl! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!">
<CommandPrimitive.Input
data-slot="command-input"
className={cn(
diff --git a/packages/dashboard-ui/src/ui/data-table.tsx b/packages/dashboard-ui/src/ui/data-table.tsx
index deeb4236c8..4da50a0780 100644
--- a/packages/dashboard-ui/src/ui/data-table.tsx
+++ b/packages/dashboard-ui/src/ui/data-table.tsx
@@ -18,6 +18,13 @@ interface TableProps extends React.ComponentProps<'table'> {
* main content — inside cards, sheets or dialogs, keep the default.
*/
stickyHeader?: boolean
+ /**
+ * Rounds the last row's outer corners. Opt-in, because it only reads
+ * correctly when the table is the last thing inside a rounded container —
+ * anything below it (a pagination footer, a card action row) leaves the
+ * curve floating mid-surface.
+ */
+ roundedBottom?: boolean
}
/**
@@ -41,11 +48,23 @@ interface TableProps extends React.ComponentProps<'table'> {
* rounding), and a scroll listener mirrors the body's `scrollLeft` onto the
* pinned table so the header tracks horizontal scrolling.
*/
-function Table({ className, children, stickyHeader = false, ...props }: TableProps) {
+function Table({
+ className,
+ children,
+ stickyHeader = false,
+ roundedBottom = false,
+ ...props
+}: TableProps) {
const scrollRef = useRef<HTMLDivElement | null>(null)
const bodyTableRef = useRef<HTMLTableElement | null>(null)
const pinnedTableRef = useRef<HTMLTableElement | null>(null)
+ // Applied on the table so it reaches the last row's edge cells without
+ // every TableCell paying for the selector.
+ const roundedClasses = roundedBottom
+ ? '[&_tbody_tr:last-child_td:first-child]:rounded-bl-xl [&_tbody_tr:last-child_td:last-child]:rounded-br-xl'
+ : undefined
+
const kids = Children.toArray(children)
const headerElement = kids.find(
(kid): kid is ReactElement<React.ComponentProps<'thead'>> =>
@@ -98,7 +117,10 @@ function Table({ className, children, stickyHeader = false, ...props }: TablePro
// keep `auto`, where scrolling a wide table sideways matters more than a
// sticky header.
<div className="overflow-x-auto md:overflow-x-clip">
- <table className={cn('w-full align-top text-foreground', className)} {...props}>
+ <table
+ className={cn('w-full align-top text-foreground', roundedClasses, className)}
+ {...props}
+ >
{children}
</table>
</div>
@@ -107,7 +129,7 @@ function Table({ className, children, stickyHeader = false, ...props }: TablePro
// `w-max` + `min-w-full`: size to the content, but never narrower than the
// card, so a table with few columns still fills the width.
- const tableClasses = cn('w-max min-w-full align-top text-foreground', className)
+ const tableClasses = cn('w-max min-w-full align-top text-foreground', roundedClasses, className)
return (
<div className="relative">
@@ -182,7 +204,7 @@ function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
function TableRow({ className, ...props }: React.ComponentProps<'tr'>) {
return (
- <tr className={cn('group/row hover:bg-muted/60 last:*:border-b-0', className)} {...props} />
+ <tr className={cn('group/row hover:bg-accent/25 last:*:border-b-0', className)} {...props} />
)
}
@@ -197,7 +219,7 @@ function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
<th
className={cn(
'text-left text-sm font-medium text-muted-foreground bg-muted p-2 whitespace-nowrap first:pl-4 last:pr-4',
- 'shadow-[inset_0_-1px_0_0_var(--color-border)]',
+ 'shadow-[inset_0_-1px_0_0_var(--border-subtle)]',
className,
)}
{...props}
@@ -225,7 +247,7 @@ function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
return (
<td
className={cn(
- 'py-3 px-2 border-b border-border align-middle first:pl-4 last:pr-4 group-last/row:first:rounded-bl-xl group-last/row:last:rounded-br-xl',
+ 'py-3 px-2 border-b border-border-subtle align-middle first:pl-4 last:pr-4',
className,
)}
{...props}
diff --git a/packages/dashboard-ui/src/ui/dialog.tsx b/packages/dashboard-ui/src/ui/dialog.tsx
index 48f1b4aa21..c8cd62ef90 100644
--- a/packages/dashboard-ui/src/ui/dialog.tsx
+++ b/packages/dashboard-ui/src/ui/dialog.tsx
@@ -132,7 +132,7 @@ function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
return (
<div
data-slot="dialog-header"
- className={cn('flex flex-col gap-1.5 border-b p-4', className)}
+ className={cn('flex flex-col gap-1.5 border-b border-border-subtle p-4', className)}
{...props}
/>
)
@@ -160,7 +160,7 @@ function DialogFooter({
<div
data-slot="dialog-footer"
className={cn(
- 'flex flex-col-reverse gap-2 border-t bg-muted/50 p-4 sm:flex-row sm:justify-end',
+ 'flex flex-col-reverse gap-2 border-t border-border-subtle bg-muted/50 p-4 sm:flex-row sm:justify-end',
className,
)}
{...props}
diff --git a/packages/dashboard-ui/src/ui/dropdown-menu.tsx b/packages/dashboard-ui/src/ui/dropdown-menu.tsx
index cf0ad441e9..ac8e2f7ca0 100644
--- a/packages/dashboard-ui/src/ui/dropdown-menu.tsx
+++ b/packages/dashboard-ui/src/ui/dropdown-menu.tsx
@@ -160,7 +160,7 @@ function DropdownMenuCheckboxItem({
data-slot="dropdown-menu-checkbox-item"
data-inset={inset}
className={cn(
- "relative flex cursor-default items-center gap-3 rounded-xl py-2 pr-8 pl-2.5 text-sm outline-hidden select-none transition-colors duration-75 focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "relative flex cursor-default items-center gap-3 rounded-xl py-1.5 pr-8 pl-2.5 text-sm outline-hidden select-none transition-colors duration-75 focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
)}
checked={checked}
@@ -246,7 +246,7 @@ function DropdownMenuSeparator({
return (
<MenuPrimitive.Separator
data-slot="dropdown-menu-separator"
- className={cn('-mx-1 my-1 h-px bg-border', className)}
+ className={cn('mx-1 my-1 h-px bg-border-subtle', className)}
{...props}
/>
)
diff --git a/packages/dashboard-ui/src/ui/field.tsx b/packages/dashboard-ui/src/ui/field.tsx
index c6907d7bff..521081e530 100644
--- a/packages/dashboard-ui/src/ui/field.tsx
+++ b/packages/dashboard-ui/src/ui/field.tsx
@@ -95,6 +95,14 @@ function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>)
data-slot="field-label"
className={cn(
'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-blue-500/30 has-data-checked:bg-blue-500/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-blue-500/20 dark:has-data-checked:bg-blue-500/10',
+ // Card-shaped labels (the ones wrapping a whole `Field`) are clickable
+ // targets, so they need the affordance a bare text label doesn't:
+ // a pointer and a hover tint. Scoped by `has-[>[data-slot=field]]` so
+ // plain field labels keep their default cursor, and excluded on the
+ // checked card by `not-has-data-checked` — a competing hover rule of
+ // equal specificity would just race the selected tint and win.
+ 'has-[>[data-slot=field]]:cursor-pointer has-[>[data-slot=field]]:transition-colors',
+ 'has-[>[data-slot=field]]:not-has-data-checked:hover:border-border has-[>[data-slot=field]]:not-has-data-checked:hover:bg-accent/60',
'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col',
className,
)}
diff --git a/packages/dashboard-ui/src/ui/pagination.tsx b/packages/dashboard-ui/src/ui/pagination.tsx
index 6f155fcf68..92b6a65845 100644
--- a/packages/dashboard-ui/src/ui/pagination.tsx
+++ b/packages/dashboard-ui/src/ui/pagination.tsx
@@ -37,7 +37,7 @@ export function Pagination({
if (meta.pages <= 1 && !onPageSizeChange) return null
return (
- <div className="flex items-center justify-between border-t border-border px-3 py-2.5">
+ <div className="flex items-center justify-between border-t border-border-subtle pr-3 pl-4 py-2">
<div className="text-sm text-muted-foreground">
{t('admin.components.pagination.range', {
from: meta.from,
diff --git a/packages/dashboard-ui/src/ui/select.tsx b/packages/dashboard-ui/src/ui/select.tsx
index f49eed100c..561fa65904 100644
--- a/packages/dashboard-ui/src/ui/select.tsx
+++ b/packages/dashboard-ui/src/ui/select.tsx
@@ -98,7 +98,7 @@ function SelectContent({
data-slot="select-content"
data-align-trigger={position === 'item-aligned'}
className={cn(
- 'relative z-[100] max-h-[var(--available-height)] min-w-[var(--anchor-width)] overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[starting-style]:opacity-0 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:scale-95 transition-[opacity,transform]',
+ 'relative z-[100] max-h-[var(--available-height)] min-w-[var(--anchor-width)] overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[starting-style]:opacity-0 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:scale-95 transition-[opacity,transform]',
position === 'popper' &&
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
className,
diff --git a/packages/dashboard-ui/src/ui/separator.tsx b/packages/dashboard-ui/src/ui/separator.tsx
index b03d3213e9..60592156ca 100644
--- a/packages/dashboard-ui/src/ui/separator.tsx
+++ b/packages/dashboard-ui/src/ui/separator.tsx
@@ -20,7 +20,7 @@ function Separator({
orientation={orientation}
data-orientation={orientation}
className={cn(
- 'shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px',
+ 'shrink-0 bg-border-subtle data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px',
className,
)}
{...props}
diff --git a/packages/dashboard-ui/src/ui/sheet.tsx b/packages/dashboard-ui/src/ui/sheet.tsx
index 4fe5e34928..63b7f5d188 100644
--- a/packages/dashboard-ui/src/ui/sheet.tsx
+++ b/packages/dashboard-ui/src/ui/sheet.tsx
@@ -160,7 +160,10 @@ function SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {
return (
<div
data-slot="sheet-header"
- className={cn('relative flex flex-col gap-1.5 border-b p-4 pr-12', className)}
+ className={cn(
+ 'relative flex flex-col gap-1.5 border-b border-border-subtle p-4 pr-12',
+ className,
+ )}
{...props}
/>
)
@@ -171,7 +174,7 @@ function SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {
<div
data-slot="sheet-footer"
className={cn(
- 'flex flex-col-reverse gap-2 border-t bg-muted/50 p-4 sm:flex-row sm:justify-end rounded-b-xl',
+ 'flex flex-col-reverse gap-2 border-t border-border-subtle bg-muted/50 p-4 sm:flex-row sm:justify-end rounded-b-xl',
className,
)}
{...props}
diff --git a/packages/dashboard-ui/src/ui/skeleton.tsx b/packages/dashboard-ui/src/ui/skeleton.tsx
index 03435e853a..82efa8f6e3 100644
--- a/packages/dashboard-ui/src/ui/skeleton.tsx
+++ b/packages/dashboard-ui/src/ui/skeleton.tsx
@@ -4,7 +4,9 @@ function Skeleton({ className, ...props }: React.ComponentProps<'div'>) {
return (
<div
data-slot="skeleton"
- className={cn('animate-pulse rounded-md bg-muted', className)}
+ // `accent`, not `muted`: muted sits ~1.5% off white, which reads as nothing
+ // on a card. A skeleton has to be visible to do its job.
+ className={cn('animate-pulse rounded-md bg-accent', className)}
{...props}
/>
)
diff --git a/packages/dashboard/e2e/order-fulfillments.spec.ts b/packages/dashboard/e2e/order-fulfillments.spec.ts
index 48f0d7c88e..459905b4f5 100644
--- a/packages/dashboard/e2e/order-fulfillments.spec.ts
+++ b/packages/dashboard/e2e/order-fulfillments.spec.ts
@@ -15,7 +15,7 @@ async function createDraftOrder(page: Page, storeId: string) {
await page.locator('#order-email').fill(`e2e-fulfillment-${Date.now()}@example.com`)
await page.getByPlaceholder(/search variant/i).fill(FIXTURE_PROMO_PRODUCT)
await page
- .getByRole('button', { name: new RegExp(FIXTURE_PROMO_PRODUCT, 'i') })
+ .getByRole('option', { name: new RegExp(FIXTURE_PROMO_PRODUCT, 'i') })
.first()
.click()
diff --git a/packages/dashboard/e2e/orders.spec.ts b/packages/dashboard/e2e/orders.spec.ts
index c91468a164..a4a38f32b1 100644
--- a/packages/dashboard/e2e/orders.spec.ts
+++ b/packages/dashboard/e2e/orders.spec.ts
@@ -54,10 +54,11 @@ async function fillNewOrderForm(page: Page, email: string) {
// service needs (no addresses required for a draft).
await page.locator('#order-email').fill(email)
- // Variant typeahead requires 3+ chars and renders a flyout of buttons.
+ // Variant typeahead is a combobox: results are `role="option"`, so they are
+ // reachable by keyboard as well as click.
await page.getByPlaceholder(/search variant/i).fill(FIXTURE_PROMO_PRODUCT)
await page
- .getByRole('button', { name: new RegExp(FIXTURE_PROMO_PRODUCT, 'i') })
+ .getByRole('option', { name: new RegExp(FIXTURE_PROMO_PRODUCT, 'i') })
.first()
.click()
}
diff --git a/packages/dashboard/src/components/spree/command-palette/command-palette.tsx b/packages/dashboard/src/components/spree/command-palette/command-palette.tsx
index 6c13089fd6..a035cf3336 100644
--- a/packages/dashboard/src/components/spree/command-palette/command-palette.tsx
+++ b/packages/dashboard/src/components/spree/command-palette/command-palette.tsx
@@ -85,7 +85,7 @@ function CommandPaletteContent({ setOpen }: { setOpen: (open: boolean) => void }
<DialogDescription>{t('admin.components.command_palette.description')}</DialogDescription>
</DialogHeader>
<DialogContent
- className="top-1/3 translate-y-0 overflow-hidden p-0 sm:max-w-2xl"
+ className="top-1/3 translate-y-0 overflow-hidden rounded-2xl p-0 sm:max-w-2xl"
showCloseButton={false}
// Don't restore focus to the trigger after navigating — the trigger is
// gone (we navigated away) and focus would land on the first sidebar
diff --git a/packages/dashboard/src/components/spree/imports/import-wizard-dialog.tsx b/packages/dashboard/src/components/spree/imports/import-wizard-dialog.tsx
index e8909e6f51..0695289665 100644
--- a/packages/dashboard/src/components/spree/imports/import-wizard-dialog.tsx
+++ b/packages/dashboard/src/components/spree/imports/import-wizard-dialog.tsx
@@ -255,7 +255,7 @@ function MappingStep({ imp }: { imp: Import }) {
<CardContent className="flex flex-col gap-4 p-0">
<div className="overflow-x-auto">
<Table>
- <TableHeader className="border-b">
+ <TableHeader>
<TableRow>
<TableHead>{t('admin.imports.mapping.field')}</TableHead>
<TableHead>{t('admin.imports.mapping.file_column')}</TableHead>
@@ -525,7 +525,7 @@ function FailedRowsCard({ imp }: { imp: Import }) {
<>
<div className="overflow-x-auto">
<Table>
- <TableHeader className="border-b">
+ <TableHeader>
<TableRow>
<TableHead className="w-16">
{t('admin.imports.failed_rows.row_number')}
diff --git a/packages/dashboard/src/components/spree/order-post-sale-cards.tsx b/packages/dashboard/src/components/spree/order-post-sale-cards.tsx
index a7d6110a63..0296bc079a 100644
--- a/packages/dashboard/src/components/spree/order-post-sale-cards.tsx
+++ b/packages/dashboard/src/components/spree/order-post-sale-cards.tsx
@@ -101,6 +101,7 @@ export function OrderExchangesCard({ order }: { order: Order }) {
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon-xs">
<EllipsisVerticalIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.actions_menu')}</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
@@ -247,6 +248,7 @@ export function OrderClaimsCard({ order }: { order: Order }) {
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon-xs">
<EllipsisVerticalIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.actions_menu')}</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
diff --git a/packages/dashboard/src/components/spree/order-returns-card.tsx b/packages/dashboard/src/components/spree/order-returns-card.tsx
index 1fba6325ae..0d732c0e5d 100644
--- a/packages/dashboard/src/components/spree/order-returns-card.tsx
+++ b/packages/dashboard/src/components/spree/order-returns-card.tsx
@@ -122,6 +122,7 @@ export function OrderReturnsCard({ order }: { order: Order }) {
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon-xs">
<EllipsisVerticalIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.actions_menu')}</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
diff --git a/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx b/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx
index 9a1020489d..0918b489d7 100644
--- a/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx
+++ b/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx
@@ -450,6 +450,7 @@ function FulfillmentRow({ order, fulfillment }: { order: Order; fulfillment: Ful
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon-xs">
<EllipsisVerticalIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.actions_menu')}</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
diff --git a/packages/dashboard/src/components/spree/orders/order-customer-card.tsx b/packages/dashboard/src/components/spree/orders/order-customer-card.tsx
index 01812d5921..ec4857a6f7 100644
--- a/packages/dashboard/src/components/spree/orders/order-customer-card.tsx
+++ b/packages/dashboard/src/components/spree/orders/order-customer-card.tsx
@@ -60,6 +60,7 @@ export function CustomerCard({ order }: { order: Order }) {
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon-xs">
<EllipsisVerticalIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.actions_menu')}</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
diff --git a/packages/dashboard/src/components/spree/orders/order-edit-items-table.tsx b/packages/dashboard/src/components/spree/orders/order-edit-items-table.tsx
index 61a11cdd3b..a99b48d38c 100644
--- a/packages/dashboard/src/components/spree/orders/order-edit-items-table.tsx
+++ b/packages/dashboard/src/components/spree/orders/order-edit-items-table.tsx
@@ -40,7 +40,7 @@ export function OrderEditItemsTable({
return (
<Table>
- <TableHeader className="border-b">
+ <TableHeader>
<TableRow>
<TableHead>{t('admin.orders.edit.columns.product')}</TableHead>
<TableHead className="text-right">{t('admin.orders.edit.columns.unit_price')}</TableHead>
diff --git a/packages/dashboard/src/components/spree/orders/order-notes-cards.tsx b/packages/dashboard/src/components/spree/orders/order-notes-cards.tsx
index c610240c8d..c7b5a1beb5 100644
--- a/packages/dashboard/src/components/spree/orders/order-notes-cards.tsx
+++ b/packages/dashboard/src/components/spree/orders/order-notes-cards.tsx
@@ -41,6 +41,7 @@ export function SpecialInstructionsCard({ order }: { order: Order }) {
<CardAction>
<Button variant="ghost" size="icon-xs" onClick={() => setEditing(!editing)}>
<PencilIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.edit')}</span>
</Button>
</CardAction>
</CardHeader>
@@ -91,6 +92,7 @@ export function TagsCard({ order }: { order: Order }) {
}}
>
<PencilIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.edit')}</span>
</Button>
</CardAction>
</CardHeader>
@@ -160,6 +162,7 @@ export function InternalNoteCard({ order }: { order: Order }) {
<CardAction>
<Button variant="ghost" size="icon-xs" onClick={() => setEditing(!editing)}>
<PencilIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.edit')}</span>
</Button>
</CardAction>
</CardHeader>
diff --git a/packages/dashboard/src/components/spree/orders/order-payments-card.tsx b/packages/dashboard/src/components/spree/orders/order-payments-card.tsx
index 098cb4be2f..0bbdc3d27a 100644
--- a/packages/dashboard/src/components/spree/orders/order-payments-card.tsx
+++ b/packages/dashboard/src/components/spree/orders/order-payments-card.tsx
@@ -30,6 +30,12 @@ import {
SelectValue,
StatusBadge,
Switch,
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
useConfirm,
} from '@spree/dashboard-ui'
import { useQuery } from '@tanstack/react-query'
@@ -76,95 +82,88 @@ export function PaymentsCard({ order }: { order: Order }) {
</p>
</CardContent>
) : (
- <div className="overflow-x-auto">
- <table className="w-full text-sm">
- <thead>
- <tr className="border-b bg-muted/50 text-muted-foreground">
- <th className="p-3 pl-5 text-left font-normal">
- {t('admin.orders.detail.payments_table.number')}
- </th>
- <th className="p-3 text-left font-normal">
- {t('admin.orders.detail.payments_table.method')}
- </th>
- <th className="p-3 text-left font-normal">
- {t('admin.orders.detail.payments_table.state')}
- </th>
- <th className="p-3 text-right font-normal">{t('admin.fields.amount.label')}</th>
- <th className="p-3 pr-5 w-10" />
- </tr>
- </thead>
- <tbody>
- {payments.map((payment) => (
- <tr key={payment.id} className="border-b last:border-b-0">
- <td className="p-3 pl-5 font-medium">{payment.number}</td>
- <td className="p-3 text-muted-foreground">
- {payment.payment_method?.name ?? '—'}
- </td>
- <td className="p-3">
- <StatusBadge status={payment.status} />
- </td>
- <td className="p-3 text-right font-medium whitespace-nowrap">
- {payment.display_amount}
- </td>
- <td className="p-3 pr-5">
- {(payment.status === 'checkout' ||
- payment.status === 'pending' ||
- payment.status === 'completed') && (
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button variant="ghost" size="icon-xs">
- <EllipsisVerticalIcon className="size-4" />
- </Button>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end">
- {(payment.status === 'checkout' || payment.status === 'pending') && (
- <DropdownMenuItem
- onClick={async () => {
- if (
- await confirm({
- message: t('admin.orders.detail.confirm.capture_message'),
- variant: 'default',
- confirmLabel: t('admin.pages.orders.detail.actions.capture'),
- })
- ) {
- captureMutation.mutate(payment.id)
- }
- }}
- >
- <CreditCardIcon className="size-4" />
- {t('admin.pages.orders.detail.actions.capture')}
- </DropdownMenuItem>
- )}
- {(payment.status === 'checkout' ||
- payment.status === 'pending' ||
- payment.status === 'completed') && (
- <DropdownMenuItem
- className="text-destructive focus:text-destructive"
- onClick={async () => {
- if (
- await confirm({
- message: t('admin.orders.detail.confirm.void_message'),
- variant: 'destructive',
- confirmLabel: t('admin.pages.orders.detail.actions.void'),
- })
- ) {
- voidMutation.mutate(payment.id)
- }
- }}
- >
- <XCircleIcon className="size-4" />
- {t('admin.pages.orders.detail.actions.void')}
- </DropdownMenuItem>
- )}
- </DropdownMenuContent>
- </DropdownMenu>
- )}
- </td>
- </tr>
- ))}
- </tbody>
- </table>
- </div>
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead>{t('admin.orders.detail.payments_table.number')}</TableHead>
+ <TableHead>{t('admin.orders.detail.payments_table.method')}</TableHead>
+ <TableHead>{t('admin.orders.detail.payments_table.state')}</TableHead>
+ <TableHead className="text-right">{t('admin.fields.amount.label')}</TableHead>
+ <TableHead className="w-10" />
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {payments.map((payment) => (
+ <TableRow key={payment.id}>
+ <TableCell className="font-medium">{payment.number}</TableCell>
+ <TableCell className="text-muted-foreground">
+ {payment.payment_method?.name ?? '—'}
+ </TableCell>
+ <TableCell>
+ <StatusBadge status={payment.status} />
+ </TableCell>
+ <TableCell className="text-right font-medium whitespace-nowrap tabular-nums">
+ {payment.display_amount}
+ </TableCell>
+ <TableCell>
+ {(payment.status === 'checkout' ||
+ payment.status === 'pending' ||
+ payment.status === 'completed') && (
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button variant="ghost" size="icon-xs">
+ <EllipsisVerticalIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.actions_menu')}</span>
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end">
+ {(payment.status === 'checkout' || payment.status === 'pending') && (
+ <DropdownMenuItem
+ onClick={async () => {
+ if (
+ await confirm({
+ message: t('admin.orders.detail.confirm.capture_message'),
+ variant: 'default',
+ confirmLabel: t('admin.pages.orders.detail.actions.capture'),
+ })
+ ) {
+ captureMutation.mutate(payment.id)
+ }
+ }}
+ >
+ <CreditCardIcon className="size-4" />
+ {t('admin.pages.orders.detail.actions.capture')}
+ </DropdownMenuItem>
+ )}
+ {(payment.status === 'checkout' ||
+ payment.status === 'pending' ||
+ payment.status === 'completed') && (
+ <DropdownMenuItem
+ className="text-destructive focus:text-destructive"
+ onClick={async () => {
+ if (
+ await confirm({
+ message: t('admin.orders.detail.confirm.void_message'),
+ variant: 'destructive',
+ confirmLabel: t('admin.pages.orders.detail.actions.void'),
+ })
+ ) {
+ voidMutation.mutate(payment.id)
+ }
+ }}
+ >
+ <XCircleIcon className="size-4" />
+ {t('admin.pages.orders.detail.actions.void')}
+ </DropdownMenuItem>
+ )}
+ </DropdownMenuContent>
+ </DropdownMenu>
+ )}
+ </TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
)}
<AddPaymentDialog order={order} open={addOpen} onOpenChange={setAddOpen} />
</Card>
diff --git a/packages/dashboard/src/components/spree/price-list-editors/price-list-form.tsx b/packages/dashboard/src/components/spree/price-list-editors/price-list-form.tsx
index da4f7f5303..2087d194e7 100644
--- a/packages/dashboard/src/components/spree/price-list-editors/price-list-form.tsx
+++ b/packages/dashboard/src/components/spree/price-list-editors/price-list-form.tsx
@@ -605,6 +605,10 @@ function RuleRow({
className="text-destructive hover:bg-destructive/10 hover:text-destructive"
>
<TrashIcon className="size-4" />
+ {/* "Remove rule", not "Remove": the confirm dialog this opens has
+ its own Remove button, and two identical names in one view is
+ ambiguous for screen readers and test locators alike. */}
+ <span className="sr-only">{t('admin.actions.remove_rule')}</span>
</Button>
</div>
</Can>
diff --git a/packages/dashboard/src/components/spree/product-membership-card.tsx b/packages/dashboard/src/components/spree/product-membership-card.tsx
index a03e9f24fc..980cb9fd9e 100644
--- a/packages/dashboard/src/components/spree/product-membership-card.tsx
+++ b/packages/dashboard/src/components/spree/product-membership-card.tsx
@@ -393,8 +393,8 @@ function ProductRow({
// 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-muted/60',
- selected && 'bg-muted/40',
+ 'group/row last:*:border-b-0 hover:bg-accent/60',
+ selected && 'bg-accent/60 hover:bg-accent',
isDragging && 'relative z-10 opacity-70',
)}
>
diff --git a/packages/dashboard/src/components/spree/promotion-editors/promotion-form.tsx b/packages/dashboard/src/components/spree/promotion-editors/promotion-form.tsx
index d005892921..8db332d9e5 100644
--- a/packages/dashboard/src/components/spree/promotion-editors/promotion-form.tsx
+++ b/packages/dashboard/src/components/spree/promotion-editors/promotion-form.tsx
@@ -772,6 +772,10 @@ function RuleRow({
className="text-destructive hover:bg-destructive/10 hover:text-destructive"
>
<TrashIcon className="size-4" />
+ {/* "Remove rule", not "Remove": the confirm dialog this opens has
+ its own Remove button, and two identical names in one view is
+ ambiguous for screen readers and test locators alike. */}
+ <span className="sr-only">{t('admin.actions.remove_rule')}</span>
</Button>
</div>
</Can>
@@ -1147,6 +1151,10 @@ function ActionRow({
className="text-destructive hover:bg-destructive/10 hover:text-destructive"
>
<TrashIcon className="size-4" />
+ {/* "Remove rule", not "Remove": the confirm dialog this opens has
+ its own Remove button, and two identical names in one view is
+ ambiguous for screen readers and test locators alike. */}
+ <span className="sr-only">{t('admin.actions.remove_rule')}</span>
</Button>
</div>
</Can>
diff --git a/packages/dashboard/src/components/spree/route-pending.tsx b/packages/dashboard/src/components/spree/route-pending.tsx
new file mode 100644
index 0000000000..0286c8c059
--- /dev/null
+++ b/packages/dashboard/src/components/spree/route-pending.tsx
@@ -0,0 +1,65 @@
+import { Skeleton } from '@spree/dashboard-ui'
+import { useTranslation } from 'react-i18next'
+
+/**
+ * Router-wide fallback while a route's code chunk or loader resolves.
+ *
+ * Deliberately generic: it stands in for pages whose shape isn't known here,
+ * so it sketches the one thing they all share — a title, then a body — rather
+ * than pretending to know a page's real layout. Pages that can do better ship
+ * their own pending UI.
+ */
+export function RoutePending() {
+ const { t } = useTranslation()
+ return (
+ <div className="flex flex-col gap-4 p-4 lg:p-6" aria-busy="true">
+ {/* `aria-busy` marks the region pending but announces nothing on its own —
+ screen readers need actual text to read out. */}
+ <span role="status" className="sr-only">
+ {t('admin.common.loading')}
+ </span>
+ <div className="flex flex-col gap-2">
+ <Skeleton className="h-7 w-48" />
+ <Skeleton className="h-4 w-72" />
+ </div>
+ <Skeleton className="h-64 w-full rounded-xl" />
+ </div>
+ )
+}
+
+/**
+ * Placeholder for a detail page whose record is still loading. Mirrors
+ * `ResourceLayout`: a header block, then the main/sidebar split — so the page
+ * doesn't reflow when the real content replaces it.
+ */
+export function ResourceDetailSkeleton({ sidebar = true }: { sidebar?: boolean }) {
+ const { t } = useTranslation()
+ return (
+ <div className="flex flex-col gap-6" aria-busy="true">
+ <span role="status" className="sr-only">
+ {t('admin.common.loading')}
+ </span>
+ <div className="flex flex-col gap-2">
+ <Skeleton className="h-8 w-64" />
+ <Skeleton className="h-4 w-40" />
+ </div>
+ {sidebar ? (
+ <div className="grid grid-cols-12 gap-6">
+ <div className="col-span-12 flex flex-col gap-6 lg:col-span-8">
+ <Skeleton className="h-48 w-full rounded-xl" />
+ <Skeleton className="h-64 w-full rounded-xl" />
+ </div>
+ <div className="col-span-12 flex flex-col gap-6 lg:col-span-4">
+ <Skeleton className="h-40 w-full rounded-xl" />
+ <Skeleton className="h-32 w-full rounded-xl" />
+ </div>
+ </div>
+ ) : (
+ <div className="flex flex-col gap-6">
+ <Skeleton className="h-48 w-full rounded-xl" />
+ <Skeleton className="h-64 w-full rounded-xl" />
+ </div>
+ )}
+ </div>
+ )
+}
diff --git a/packages/dashboard/src/components/spree/tax-exemption-certificates-card.tsx b/packages/dashboard/src/components/spree/tax-exemption-certificates-card.tsx
index 4b37833826..8dd54bc80f 100644
--- a/packages/dashboard/src/components/spree/tax-exemption-certificates-card.tsx
+++ b/packages/dashboard/src/components/spree/tax-exemption-certificates-card.tsx
@@ -274,6 +274,7 @@ export function TaxExemptionCertificatesCard({
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon-xs">
<EllipsisVerticalIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.actions_menu')}</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
diff --git a/packages/dashboard/src/components/spree/tax-identifiers-card.tsx b/packages/dashboard/src/components/spree/tax-identifiers-card.tsx
index 4d8d77f3b9..44105bbcfc 100644
--- a/packages/dashboard/src/components/spree/tax-identifiers-card.tsx
+++ b/packages/dashboard/src/components/spree/tax-identifiers-card.tsx
@@ -172,6 +172,7 @@ export function TaxIdentifiersCard({
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon-xs">
<EllipsisVerticalIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.actions_menu')}</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
diff --git a/packages/dashboard/src/create-router.ts b/packages/dashboard/src/create-router.ts
index 0081c21b76..f48f935e89 100644
--- a/packages/dashboard/src/create-router.ts
+++ b/packages/dashboard/src/create-router.ts
@@ -4,6 +4,7 @@ import {
type RouterConstructorOptions,
type RouterHistory,
} from '@tanstack/react-router'
+import { RoutePending } from './components/spree/route-pending'
/**
* Build the dashboard's router from a generated route tree.
@@ -49,5 +50,14 @@ export function createDashboardRouter<TRouteTree extends AnyRoute>(
RouterHistory,
Record<string, unknown>
>
- return createRouter(options)
+ return createRouter({
+ ...options,
+ // Every route inherits this while its chunk or loader resolves. Without it
+ // TanStack renders a bare "Loading…" string on an otherwise blank page.
+ defaultPendingComponent: RoutePending,
+ // Long enough that a fast navigation never flashes a skeleton, short enough
+ // that a slow one doesn't look frozen.
+ defaultPendingMs: 300,
+ defaultPendingMinMs: 400,
+ })
}
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/companies/$companyId.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/companies/$companyId.tsx
index 10e63c8048..9c1a6e9058 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/companies/$companyId.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/companies/$companyId.tsx
@@ -31,6 +31,7 @@ import { useEffect, useState } from 'react'
import { useForm } from 'react-hook-form'
import { useTranslation } from 'react-i18next'
import { CompanyLocationSheet } from '../../../../components/spree/company-location-sheet'
+import { ResourceDetailSkeleton } from '../../../../components/spree/route-pending'
import { TaxExemptionCertificatesCard } from '../../../../components/spree/tax-exemption-certificates-card'
import { TaxIdentifiersCard } from '../../../../components/spree/tax-identifiers-card'
import {
@@ -60,7 +61,7 @@ function CompanyDetailPage() {
const { companyId } = Route.useParams()
const { data: company, isLoading, error, refetch } = useCompany(companyId)
- if (isLoading) return <p className="text-muted-foreground">{t('admin.common.loading')}</p>
+ if (isLoading) return <ResourceDetailSkeleton />
if (error || !company) {
return (
<ErrorState
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/companies/locations.$locationId.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/companies/locations.$locationId.tsx
index da56687bf5..560f7768b8 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/companies/locations.$locationId.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/companies/locations.$locationId.tsx
@@ -39,6 +39,7 @@ import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { CompanyLocationSheet } from '../../../../components/spree/company-location-sheet'
import { EnterpriseUpsell } from '../../../../components/spree/enterprise-upsell'
+import { ResourceDetailSkeleton } from '../../../../components/spree/route-pending'
import {
useCompanyLocation,
useCompanyLocationContacts,
@@ -57,7 +58,7 @@ function CompanyLocationDetailPage() {
const { locationId } = Route.useParams()
const { data: location, isLoading, error, refetch } = useCompanyLocation(locationId)
- if (isLoading) return <p className="text-muted-foreground">{t('admin.common.loading')}</p>
+ if (isLoading) return <ResourceDetailSkeleton />
if (error || !location) {
return (
<ErrorState
@@ -245,6 +246,7 @@ function ContactsCard({ location, canEdit }: { location: CompanyLocation; canEdi
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon-xs">
<EllipsisVerticalIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.actions_menu')}</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/customers/$customerId.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/customers/$customerId.tsx
index a277df6258..a2b8de2b9e 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/customers/$customerId.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/customers/$customerId.tsx
@@ -56,6 +56,12 @@ import {
SheetHeader,
SheetTitle,
StatusBadge,
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
Textarea,
Thumbnail,
useConfirm,
@@ -80,6 +86,7 @@ import {
CustomFieldsInlineCard,
EditableApiCustomFieldsProvider,
} from '../../../../components/spree/custom-fields/custom-fields-inline'
+import { ResourceDetailSkeleton } from '../../../../components/spree/route-pending'
import { TaxIdentifiersCard } from '../../../../components/spree/tax-identifiers-card'
import { useCurrencyLocale } from '../../../../hooks/use-currency-locale'
import {
@@ -129,7 +136,7 @@ function CustomerDetailPage() {
const { customerId } = Route.useParams()
const { data: customer, isLoading, error, refetch } = useCustomer(customerId)
- if (isLoading) return <p className="text-muted-foreground">{t('admin.common.loading')}</p>
+ if (isLoading) return <ResourceDetailSkeleton />
if (error || !customer) {
return (
<ErrorState
@@ -733,25 +740,19 @@ function OrdersCard({
</CardContent>
) : (
<CardContent className="p-0">
- <table className="w-full text-sm">
- <thead>
- <tr className="border-b text-muted-foreground text-left">
- <th className="px-6 py-2 font-normal">
- {t('admin.customers.detail.orders_table.order')}
- </th>
- <th className="px-6 py-2 font-normal">
- {t('admin.customers.detail.orders_table.date')}
- </th>
- <th className="px-6 py-2 font-normal">{t('admin.fields.status.label')}</th>
- <th className="px-6 py-2 font-normal text-right">
- {t('admin.fields.total.label')}
- </th>
- </tr>
- </thead>
- <tbody>
+ <Table roundedBottom>
+ <TableHeader>
+ <TableRow>
+ <TableHead>{t('admin.customers.detail.orders_table.order')}</TableHead>
+ <TableHead>{t('admin.customers.detail.orders_table.date')}</TableHead>
+ <TableHead>{t('admin.fields.status.label')}</TableHead>
+ <TableHead className="text-right">{t('admin.fields.total.label')}</TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
{orders.map((order: Order) => (
- <tr key={order.id} className="border-b last:border-b-0">
- <td className="px-6 py-3">
+ <TableRow key={order.id}>
+ <TableCell>
<Link
to={'/$storeId/orders/$orderId' as string}
params={{ orderId: order.id }}
@@ -759,11 +760,11 @@ function OrdersCard({
>
#{order.number}
</Link>
- </td>
- <td className="px-6 py-3 text-muted-foreground">
+ </TableCell>
+ <TableCell className="text-muted-foreground">
<RelativeTime iso={order.completed_at ?? order.created_at} />
- </td>
- <td className="px-6 py-3">
+ </TableCell>
+ <TableCell>
<span className="inline-flex gap-1">
<StatusBadge status={order.status} />
{order.payment_status && <StatusBadge status={order.payment_status} />}
@@ -771,14 +772,14 @@ function OrdersCard({
<StatusBadge status={order.fulfillment_status} />
)}
</span>
- </td>
- <td className="px-6 py-3 text-right font-medium tabular-nums">
+ </TableCell>
+ <TableCell className="text-right font-medium tabular-nums">
{order.display_total}
- </td>
- </tr>
+ </TableCell>
+ </TableRow>
))}
- </tbody>
- </table>
+ </TableBody>
+ </Table>
</CardContent>
)}
</Card>
@@ -977,6 +978,7 @@ function AddressesCard({ customer }: { customer: Customer }) {
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon-xs">
<EllipsisVerticalIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.actions_menu')}</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
@@ -1135,44 +1137,39 @@ function StoreCreditsCard({ customer }: { customer: Customer }) {
</CardContent>
) : (
<CardContent className="p-0">
- <table className="w-full text-sm">
- <thead>
- <tr className="border-b text-muted-foreground text-left">
- <th className="px-6 py-2 font-normal">{t('admin.fields.amount.label')}</th>
- <th className="px-6 py-2 font-normal">
- {t('admin.customers.detail.store_credit.table.used')}
- </th>
- <th className="px-6 py-2 font-normal">
- {t('admin.customers.detail.store_credit.table.remaining')}
- </th>
- <th className="px-6 py-2 font-normal">
- {t('admin.customers.detail.store_credit.table.category')}
- </th>
- <th className="px-6 py-2 font-normal">
- {t('admin.customers.detail.store_credit.table.memo')}
- </th>
- <th className="px-6 py-2 w-10" />
- </tr>
- </thead>
- <tbody>
+ <Table roundedBottom>
+ <TableHeader>
+ <TableRow>
+ <TableHead>{t('admin.fields.amount.label')}</TableHead>
+ <TableHead>{t('admin.customers.detail.store_credit.table.used')}</TableHead>
+ <TableHead>{t('admin.customers.detail.store_credit.table.remaining')}</TableHead>
+ <TableHead>{t('admin.customers.detail.store_credit.table.category')}</TableHead>
+ <TableHead>{t('admin.customers.detail.store_credit.table.memo')}</TableHead>
+ <TableHead className="w-10" />
+ </TableRow>
+ </TableHeader>
+ <TableBody>
{credits.map((sc: StoreCredit) => (
- <tr key={sc.id} className="border-b last:border-b-0">
- <td className="px-6 py-3 font-medium tabular-nums">
+ <TableRow key={sc.id}>
+ <TableCell className="font-medium tabular-nums">
{sc.display_amount ?? sc.amount}
- </td>
- <td className="px-6 py-3 tabular-nums">
+ </TableCell>
+ <TableCell className="tabular-nums">
{sc.display_amount_used ?? sc.amount_used}
- </td>
- <td className="px-6 py-3 tabular-nums">
+ </TableCell>
+ <TableCell className="tabular-nums">
{sc.display_amount_remaining ?? sc.amount_remaining}
- </td>
- <td className="px-6 py-3 text-muted-foreground">{sc.category_name ?? '—'}</td>
- <td className="px-6 py-3 text-muted-foreground">{sc.memo ?? '—'}</td>
- <td className="px-6 py-3 text-right">
+ </TableCell>
+ <TableCell className="text-muted-foreground">
+ {sc.category_name ?? '—'}
+ </TableCell>
+ <TableCell className="text-muted-foreground">{sc.memo ?? '—'}</TableCell>
+ <TableCell className="text-right">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon-xs">
<EllipsisVerticalIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.actions_menu')}</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
@@ -1201,11 +1198,11 @@ function StoreCreditsCard({ customer }: { customer: Customer }) {
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
- </td>
- </tr>
+ </TableCell>
+ </TableRow>
))}
- </tbody>
- </table>
+ </TableBody>
+ </Table>
</CardContent>
)}
</Card>
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/index.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/index.tsx
index 067b3818d9..b33bcd4975 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/index.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/index.tsx
@@ -13,6 +13,12 @@ import {
type DateRange,
DateRangePicker,
Skeleton,
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
Thumbnail,
} from '@spree/dashboard-ui'
import { useQuery } from '@tanstack/react-query'
@@ -164,23 +170,19 @@ function TopProducts({ products }: { products: DashboardAnalytics['top_products'
<CardDescription>{t('admin.pages.home.top_products_description')}</CardDescription>
</CardHeader>
<CardContent className="p-0">
- <table className="w-full text-sm">
- <thead>
- <tr className="border-b text-left text-muted-foreground">
- <th className="px-4 py-2 font-medium">{t('admin.pages.home.columns.product')}</th>
- <th className="px-4 py-2 text-right font-medium">
- {t('admin.pages.home.columns.price')}
- </th>
- <th className="px-4 py-2 text-right font-medium">
- {t('admin.pages.home.columns.sold')}
- </th>
- <th className="px-4 py-2 text-right font-medium">{t('admin.fields.total.label')}</th>
- </tr>
- </thead>
- <tbody>
+ <Table roundedBottom>
+ <TableHeader>
+ <TableRow>
+ <TableHead>{t('admin.pages.home.columns.product')}</TableHead>
+ <TableHead className="text-right">{t('admin.pages.home.columns.price')}</TableHead>
+ <TableHead className="text-right">{t('admin.pages.home.columns.sold')}</TableHead>
+ <TableHead className="text-right">{t('admin.fields.total.label')}</TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
{products.map((product) => (
- <tr key={product.id} className="border-b last:border-0">
- <td className="px-4 py-3">
+ <TableRow key={product.id}>
+ <TableCell>
<Link
to="/$storeId/products/$productId"
params={(prev) => ({
@@ -192,16 +194,18 @@ function TopProducts({ products }: { products: DashboardAnalytics['top_products'
<Thumbnail src={product.image_url} fallback={<PackageIcon />} />
<span className="font-medium">{product.name}</span>
</Link>
- </td>
- <td className="px-4 py-3 text-right text-muted-foreground">
+ </TableCell>
+ <TableCell className="text-right text-muted-foreground tabular-nums">
{product.price ?? '-'}
- </td>
- <td className="px-4 py-3 text-right">{product.quantity}</td>
- <td className="px-4 py-3 text-right font-medium">{product.total}</td>
- </tr>
+ </TableCell>
+ <TableCell className="text-right tabular-nums">{product.quantity}</TableCell>
+ <TableCell className="text-right font-medium tabular-nums">
+ {product.total}
+ </TableCell>
+ </TableRow>
))}
- </tbody>
- </table>
+ </TableBody>
+ </Table>
</CardContent>
</Card>
)
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/orders/$orderId/edit.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/orders/$orderId/edit.tsx
index a523608e92..8d233fa6d6 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/orders/$orderId/edit.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/orders/$orderId/edit.tsx
@@ -57,12 +57,10 @@ function OrderTotalsCard({ order }: { order: Order }) {
return (
<Card className="gap-0 py-0">
- <CardHeader className="px-5 py-4">
+ <CardHeader>
<CardTitle>{t('admin.orders.edit.totals_title')}</CardTitle>
</CardHeader>
- <Separator />
-
<div className="py-2">
<TotalRow label={t('admin.fields.subtotal.label')} value={order.display_item_total} />
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/orders/new.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/orders/new.tsx
index dba1940a13..07b43996a0 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/orders/new.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/orders/new.tsx
@@ -20,12 +20,18 @@ import {
Input,
ResourceLayout,
Switch,
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
Textarea,
} from '@spree/dashboard-ui'
-import { useMutation, useQuery } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { createFileRoute, useNavigate } from '@tanstack/react-router'
import { TrashIcon } from 'lucide-react'
-import { useState } from 'react'
+import { useRef, useState } from 'react'
import { useForm } from 'react-hook-form'
import { useTranslation } from 'react-i18next'
import { ChannelSelect } from '../../../../components/spree/channel-select'
@@ -56,8 +62,11 @@ function NewOrderPage() {
// typeahead button list, items table), not standard form fields.
const [customer, setCustomer] = useState<Customer | null>(null)
const [items, setItems] = useState<PendingItem[]>([])
- const [variantSearch, setVariantSearch] = useState('')
const [useDefaultAddress, setUseDefaultAddress] = useState(true)
+ // `onChange` hands back only the option id, so keep the records the search
+ // returned to resolve it. A ref, not state: it's a lookup table, and writing
+ // it must not re-render the form mid-search.
+ const variantById = useRef(new Map<string, Variant>())
const form = useForm<NewOrderFormValues>({
resolver: zodResolver(newOrderFormSchema),
@@ -65,15 +74,6 @@ function NewOrderPage() {
})
const { errors } = form.formState
- // Variant typeahead
- const { data: variantsData } = useQuery({
- queryKey: ['variants', 'search', variantSearch],
- queryFn: () => adminClient.variants.list({ search: variantSearch, limit: 8 }),
- enabled: variantSearch.length >= 3,
- staleTime: 30_000,
- })
- const variantResults = variantsData?.data ?? []
-
const { data: channelsData } = useChannels()
const channels = channelsData?.data ?? []
@@ -121,7 +121,6 @@ function NewOrderPage() {
} else {
setItems([...items, { variant, quantity: 1 }])
}
- setVariantSearch('')
}
function updateQuantity(variantId: string, quantity: number) {
@@ -200,56 +199,59 @@ function NewOrderPage() {
<FieldGroup>
<Field>
<FieldLabel>{t('admin.orders.new.add_variant')}</FieldLabel>
- <Input
+ {/* Combobox rather than a bare input over a list of
+ buttons: arrow-key navigation, `aria-activedescendant`
+ and Enter-to-pick come from the primitive. Selecting
+ adds the row and clears the field, so no value is
+ held — the picker is an action, not a bound input. */}
+ <ResourceCombobox<Variant>
+ queryKey="new-order-variant-picker"
+ value=""
+ onChange={(id) => {
+ const variant = id ? variantById.current.get(id) : undefined
+ if (variant) addItem(variant)
+ }}
+ search={async (query) => {
+ const res = await adminClient.variants.list({ search: query, limit: 8 })
+ for (const v of res.data) variantById.current.set(v.id, v)
+ return res
+ }}
+ hydrate={async () => ({ data: [] })}
+ getOptionLabel={(v) => v.product_name ?? v.sku ?? v.id}
+ renderOption={(v) => (
+ <div className="flex flex-col">
+ <span className="font-medium">{v.product_name ?? v.sku ?? v.id}</span>
+ <span className="text-xs text-muted-foreground">
+ {t('admin.orders.new.items_table.sku')} {v.sku} · {formatPrice(v.price)}
+ </span>
+ </div>
+ )}
placeholder={t('admin.pages.orders.new.search_variant')}
- value={variantSearch}
- onChange={(e) => setVariantSearch(e.target.value)}
/>
- {variantSearch.length >= 3 && variantResults.length > 0 && (
- <div className="mt-1 rounded-lg border border-border bg-popover text-popover-foreground shadow-xs max-h-[280px] overflow-y-auto">
- {variantResults.map((v) => (
- <button
- key={v.id}
- type="button"
- onClick={() => addItem(v)}
- className="block w-full px-3 py-2.5 text-left text-sm hover:bg-muted transition-colors border-b last:border-0"
- >
- <div className="font-medium">{v.product_name ?? v.sku ?? v.id}</div>
- <div className="text-xs text-muted-foreground">
- SKU {v.sku} · {formatPrice(v.price)}
- </div>
- </button>
- ))}
- </div>
- )}
</Field>
</FieldGroup>
{items.length > 0 && (
<div className="mt-4 overflow-x-auto">
- <table className="w-full text-sm">
- <thead>
- <tr className="border-b bg-muted/50 text-muted-foreground">
- <th className="p-3 pl-5 text-left font-normal">
- {t('admin.orders.new.items_table.variant')}
- </th>
- <th className="p-3 text-left font-normal">
- {t('admin.orders.new.items_table.sku')}
- </th>
- <th className="p-3 text-right font-normal">
+ <Table roundedBottom>
+ <TableHeader>
+ <TableRow>
+ <TableHead>{t('admin.orders.new.items_table.variant')}</TableHead>
+ <TableHead>{t('admin.orders.new.items_table.sku')}</TableHead>
+ <TableHead className="text-right">
{t('admin.orders.new.items_table.qty')}
- </th>
- <th className="p-3 pr-5 w-10" />
- </tr>
- </thead>
- <tbody>
+ </TableHead>
+ <TableHead className="w-10" />
+ </TableRow>
+ </TableHeader>
+ <TableBody>
{items.map(({ variant, quantity }) => (
- <tr key={variant.id} className="border-b last:border-b-0">
- <td className="p-3 pl-5 font-medium">
+ <TableRow key={variant.id}>
+ <TableCell className="font-medium">
{variant.product_name ?? variant.sku ?? variant.id}
- </td>
- <td className="p-3 text-muted-foreground">{variant.sku}</td>
- <td className="p-3 text-right">
+ </TableCell>
+ <TableCell className="text-muted-foreground">{variant.sku}</TableCell>
+ <TableCell className="text-right">
<Input
type="number"
min={1}
@@ -257,8 +259,8 @@ function NewOrderPage() {
onChange={(e) => updateQuantity(variant.id, Number(e.target.value))}
className="w-20 text-right ml-auto"
/>
- </td>
- <td className="p-3 pr-5 text-right">
+ </TableCell>
+ <TableCell className="text-right">
<Button
type="button"
size="icon-xs"
@@ -266,12 +268,13 @@ function NewOrderPage() {
onClick={() => removeItem(variant.id)}
>
<TrashIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.remove')}</span>
</Button>
- </td>
- </tr>
+ </TableCell>
+ </TableRow>
))}
- </tbody>
- </table>
+ </TableBody>
+ </Table>
</div>
)}
</CardContent>
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers.tsx
index 77e78dcf7b..43a8230210 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/products/transfers.tsx
@@ -3,6 +3,7 @@ import {
adminClient,
Can,
formatPrice,
+ ResourceCombobox,
ResourceTable,
resourceSearchSchema,
Subject,
@@ -32,13 +33,18 @@ import {
SheetFooter,
SheetHeader,
SheetTitle,
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
useConfirm,
useRowClickBridge,
} from '@spree/dashboard-ui'
-import { useQuery } from '@tanstack/react-query'
import { createFileRoute, useNavigate } from '@tanstack/react-router'
import { ArrowLeftRightIcon, EyeIcon, PlusIcon, TrashIcon } from 'lucide-react'
-import { useMemo, useState } from 'react'
+import { useMemo, useRef, useState } from 'react'
import { Trans, useTranslation } from 'react-i18next'
import { z } from 'zod/v4'
import { useStockLocations } from '../../../../hooks/use-stock-locations'
@@ -164,15 +170,9 @@ function CreateStockTransferSheet({
const [destinationId, setDestinationId] = useState<string>('')
const [reference, setReference] = useState('')
const [items, setItems] = useState<PendingItem[]>([])
- const [variantSearch, setVariantSearch] = useState('')
-
- const { data: variantsData } = useQuery({
- queryKey: ['variants', 'search', variantSearch],
- queryFn: () => adminClient.variants.list({ search: variantSearch, limit: 8 }),
- enabled: variantSearch.length >= 3,
- staleTime: 30_000,
- })
- const variantResults = variantsData?.data ?? []
+ // `onChange` hands back only the option id, so keep the records the search
+ // returned to resolve it. A ref, not state: it's a lookup table.
+ const variantById = useRef(new Map<string, Variant>())
const isExternalReceive = sourceId === SOURCE_NONE
const canSubmit =
@@ -186,7 +186,7 @@ function CreateStockTransferSheet({
setDestinationId('')
setReference('')
setItems([])
- setVariantSearch('')
+ variantById.current.clear()
}
function addItem(variant: Variant) {
@@ -198,7 +198,6 @@ function CreateStockTransferSheet({
} else {
setItems([...items, { variant, quantity: 1 }])
}
- setVariantSearch('')
}
function updateQuantity(variantId: string, quantity: number) {
@@ -304,56 +303,59 @@ function CreateStockTransferSheet({
<Field>
<FieldLabel>{t('admin.pages.products.transfers.section_items')}</FieldLabel>
- <Input
+ {/* Combobox rather than a bare input over a list of buttons:
+ arrow-key navigation, `aria-activedescendant` and
+ Enter-to-pick come from the primitive. Selecting adds the row
+ and clears the field, so no value is held. */}
+ <ResourceCombobox<Variant>
+ queryKey="transfer-variant-picker"
+ value=""
+ onChange={(id) => {
+ const variant = id ? variantById.current.get(id) : undefined
+ if (variant) addItem(variant)
+ }}
+ search={async (query) => {
+ const res = await adminClient.variants.list({ search: query, limit: 8 })
+ for (const v of res.data) variantById.current.set(v.id, v)
+ return res
+ }}
+ hydrate={async () => ({ data: [] })}
+ getOptionLabel={(v) => v.product_name ?? v.sku ?? v.id}
+ renderOption={(v) => (
+ <div className="flex flex-col">
+ <span className="font-medium">{v.product_name ?? v.sku ?? v.id}</span>
+ <span className="text-xs text-muted-foreground">
+ {t('admin.products.transfers.items_table.sku')} {v.sku} ·{' '}
+ {formatPrice(v.price)}
+ </span>
+ </div>
+ )}
placeholder={t('admin.products.transfers.search_items_placeholder')}
- value={variantSearch}
- onChange={(e) => setVariantSearch(e.target.value)}
/>
- {variantSearch.length >= 3 && variantResults.length > 0 && (
- <div className="mt-1 rounded-lg border border-border bg-popover text-popover-foreground shadow-xs max-h-[280px] overflow-y-auto">
- {variantResults.map((v) => (
- <button
- key={v.id}
- type="button"
- onClick={() => addItem(v)}
- className="block w-full px-3 py-2.5 text-left text-sm hover:bg-muted transition-colors border-b last:border-0"
- >
- <div className="font-medium">{v.product_name ?? v.sku ?? v.id}</div>
- <div className="text-xs text-muted-foreground">
- SKU {v.sku} · {formatPrice(v.price)}
- </div>
- </button>
- ))}
- </div>
- )}
</Field>
</FieldGroup>
{items.length > 0 && (
<div className="overflow-x-auto rounded-md border">
- <table className="w-full text-sm">
- <thead>
- <tr className="border-b bg-muted/50 text-muted-foreground">
- <th className="p-3 pl-5 text-left font-normal">
- {t('admin.products.transfers.items_table.variant')}
- </th>
- <th className="p-3 text-left font-normal">
- {t('admin.products.transfers.items_table.sku')}
- </th>
- <th className="p-3 text-right font-normal">
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead>{t('admin.products.transfers.items_table.variant')}</TableHead>
+ <TableHead>{t('admin.products.transfers.items_table.sku')}</TableHead>
+ <TableHead className="text-right">
{t('admin.products.transfers.items_table.qty')}
- </th>
- <th className="p-3 pr-5 w-10" />
- </tr>
- </thead>
- <tbody>
+ </TableHead>
+ <TableHead className="w-10" />
+ </TableRow>
+ </TableHeader>
+ <TableBody>
{items.map(({ variant, quantity }) => (
- <tr key={variant.id} className="border-b last:border-b-0">
- <td className="p-3 pl-5 font-medium">
+ <TableRow key={variant.id}>
+ <TableCell className="font-medium">
{variant.product_name ?? variant.sku ?? variant.id}
- </td>
- <td className="p-3 text-muted-foreground">{variant.sku}</td>
- <td className="p-3 text-right">
+ </TableCell>
+ <TableCell className="text-muted-foreground">{variant.sku}</TableCell>
+ <TableCell className="text-right">
<Input
type="number"
min={1}
@@ -361,8 +363,8 @@ function CreateStockTransferSheet({
onChange={(e) => updateQuantity(variant.id, Number(e.target.value))}
className="w-20 text-right ml-auto"
/>
- </td>
- <td className="p-3 pr-5 text-right">
+ </TableCell>
+ <TableCell className="text-right">
<Button
type="button"
size="icon-xs"
@@ -370,12 +372,13 @@ function CreateStockTransferSheet({
onClick={() => removeItem(variant.id)}
>
<TrashIcon className="size-4" />
+ <span className="sr-only">{t('admin.actions.remove')}</span>
</Button>
- </td>
- </tr>
+ </TableCell>
+ </TableRow>
))}
- </tbody>
- </table>
+ </TableBody>
+ </Table>
</div>
)}
</div>
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/sellers/$sellerId.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/sellers/$sellerId.tsx
index 94e3731f92..4e7a0c8f58 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/sellers/$sellerId.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/sellers/$sellerId.tsx
@@ -54,6 +54,7 @@ import { type ReactNode, useEffect, useState } from 'react'
import { Controller, useForm } from 'react-hook-form'
import { useTranslation } from 'react-i18next'
import { ResourceImageField } from '../../../../components/spree/resource-image-field'
+import { ResourceDetailSkeleton } from '../../../../components/spree/route-pending'
import {
useApproveSeller,
useDeleteSeller,
@@ -84,7 +85,7 @@ function SellerDetailPage() {
const { sellerId } = Route.useParams()
const { data: seller, isLoading, error, refetch } = useSeller(sellerId)
- if (isLoading) return <p className="text-muted-foreground">{t('admin.common.loading')}</p>
+ if (isLoading) return <ResourceDetailSkeleton />
if (error || !seller) {
return (
<ErrorState
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/api-keys.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/api-keys.tsx
index 3af066c4d4..c476473f15 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/settings/api-keys.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/api-keys.tsx
@@ -224,8 +224,8 @@ function ApiKeyTable({
</EmptyHeader>
</Empty>
) : (
- <Table>
- <TableHeader className="border-b">
+ <Table roundedBottom>
+ <TableHeader>
<TableRow>
<TableHead>{t('admin.fields.name.label')}</TableHead>
<TableHead>{t('admin.pages.settings.api_keys.table.key')}</TableHead>
@@ -894,15 +894,10 @@ function ScopePicker({
}
return (
- <div
- className={cn(
- 'flex flex-col gap-3 rounded-md border border-border',
- disabled && 'opacity-70',
- )}
- >
+ <div className={cn('flex flex-col gap-3', disabled && 'opacity-70')}>
{/* Quick access: write_all / read_all toggles. Selecting one blocks the
per-resource grid because the catch-all already covers it. */}
- <div className="flex flex-col gap-2 border-b border-border bg-muted/30 p-3">
+ <div className="flex flex-col gap-2 rounded-md border border-border bg-muted/30 p-3">
<label htmlFor="scope-write-all" className="flex cursor-pointer items-center gap-2 text-sm">
<Checkbox
id="scope-write-all"
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/reasons.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/reasons.tsx
index 58e97099cc..a72596dfdb 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/settings/reasons.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/reasons.tsx
@@ -165,8 +165,8 @@ function ReasonSection({
</EmptyHeader>
</Empty>
) : (
- <Table>
- <TableHeader className="border-b">
+ <Table roundedBottom>
+ <TableHeader>
<TableRow>
<TableHead>{t('admin.fields.name.label')}</TableHead>
<TableHead>{t('admin.fields.status.label')}</TableHead>
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/roles.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/roles.tsx
index 74192eb7e0..9e8012fbd5 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/settings/roles.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/roles.tsx
@@ -99,7 +99,7 @@ function RolesSettingsPage() {
</EmptyHeader>
</Empty>
) : (
- <Table>
+ <Table roundedBottom>
<TableHeader>
<TableRow>
<TableHead>{t('admin.pages.roles.table.role')}</TableHead>
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/staff.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/staff.tsx
index 7cd9ce5933..0ef94d090a 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/settings/staff.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/staff.tsx
@@ -147,7 +147,7 @@ function StaffCard({ staff, loading }: { staff: AdminUser[]; loading: boolean })
</EmptyHeader>
</Empty>
) : (
- <Table>
+ <Table roundedBottom>
<TableHeader>
<TableRow>
<TableHead>{t('admin.pages.staff.table.member')}</TableHead>
@@ -271,7 +271,7 @@ function PendingInvitationsCard({
<Skeleton className="h-10 w-full" />
</div>
) : (
- <Table>
+ <Table roundedBottom>
<TableHeader>
<TableRow>
<TableHead>{t('admin.fields.email.label')}</TableHead>
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/stock-locations.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/stock-locations.tsx
index ceec398dad..d6179302eb 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/settings/stock-locations.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/stock-locations.tsx
@@ -40,6 +40,12 @@ import {
SheetHeader,
SheetTitle,
Switch,
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
Textarea,
useConfirm,
useRowClickBridge,
@@ -460,27 +466,23 @@ function ProductGroup({ group, defaultOpen }: { group: StockItemGroup; defaultOp
</div>
</CollapsibleTrigger>
<CollapsibleContent>
- <table className="w-full text-sm">
- <thead className="sticky top-0 bg-card text-xs text-muted-foreground">
- <tr className="border-y">
- <th className="px-4 py-2 text-left font-medium">
- {t('admin.stock_locations.stock_items.table.variant')}
- </th>
- <th className="px-3 py-2 text-right font-medium">
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead>{t('admin.stock_locations.stock_items.table.variant')}</TableHead>
+ <TableHead className="text-right">
{t('admin.stock_locations.stock_items.table.on_hand')}
- </th>
- <th className="px-3 py-2 text-left font-medium">
- {t('admin.stock_locations.stock_items.table.backorder')}
- </th>
- <th className="px-3 py-2" />
- </tr>
- </thead>
- <tbody>
+ </TableHead>
+ <TableHead>{t('admin.stock_locations.stock_items.table.backorder')}</TableHead>
+ <TableHead className="w-10" />
+ </TableRow>
+ </TableHeader>
+ <TableBody>
{group.items.map((item) => (
<StockItemRow key={item.id} item={item} />
))}
- </tbody>
- </table>
+ </TableBody>
+ </Table>
</CollapsibleContent>
</Collapsible>
)
@@ -515,8 +517,8 @@ function StockItemRow({ item }: { item: StockItem }) {
}
return (
- <tr className="border-b last:border-b-0">
- <td className="px-4 py-2">
+ <TableRow>
+ <TableCell>
<div className="min-w-0">
{productId ? (
<Link
@@ -531,8 +533,8 @@ function StockItemRow({ item }: { item: StockItem }) {
)}
{sku && <div className="text-xs text-muted-foreground">SKU {sku}</div>}
</div>
- </td>
- <td className="px-3 py-2 text-right">
+ </TableCell>
+ <TableCell className="text-right">
<Input
type="number"
value={count}
@@ -540,15 +542,15 @@ function StockItemRow({ item }: { item: StockItem }) {
className={`ml-auto w-20 text-right ${isLowStock ? 'border-amber-500' : ''}`}
aria-label={`On hand for ${variantLabel}`}
/>
- </td>
- <td className="px-3 py-2">
+ </TableCell>
+ <TableCell>
<Switch
checked={backorderable}
onCheckedChange={setBackorderable}
aria-label={`Backorderable for ${variantLabel}`}
/>
- </td>
- <td className="px-3 py-2 text-right">
+ </TableCell>
+ <TableCell className="text-right">
<Button
type="button"
size="sm"
@@ -558,8 +560,8 @@ function StockItemRow({ item }: { item: StockItem }) {
>
{updateMutation.isPending ? '…' : t('admin.actions.save')}
</Button>
- </td>
- </tr>
+ </TableCell>
+ </TableRow>
)
}