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.

Overall dashboard improvements, polishing (#14522)

Damian Legawiecf91b4d5353a3
diff --git a/packages/README.md b/packages/README.md
index 95178689f4..50d915ed1c 100644
--- a/packages/README.md
+++ b/packages/README.md
@@ -7,7 +7,7 @@ For monorepo-wide conventions (type generation pipeline, code style, testing) se
## Status legend
| Badge | Meaning |
-|---|---|
+| --- | --- |
| **Stable** | Published to npm, follows semver, safe for production. |
| **Developer Preview** | Published to npm but API may change between minor versions. Pin exact versions. |
| **In Development** | Active work for an upcoming Spree release. Not yet published or only published behind a `next` dist-tag. |
@@ -16,7 +16,7 @@ For monorepo-wide conventions (type generation pipeline, code style, testing) se
## Packages
| Package | npm | Status | Description |
-|---|---|---|---|
+| --- | --- | --- | --- |
| [`sdk`](./sdk) | [`@spree/sdk`](https://www.npmjs.com/package/@spree/sdk) | **Stable** (1.x) | TypeScript client for the customer-facing **Store API v3**. |
| [`admin-sdk`](./admin-sdk) | [`@spree/admin-sdk`](https://www.npmjs.com/package/@spree/admin-sdk) | **Developer Preview** (0.x) | TypeScript client for the **Admin API v3** (Spree 5.5+). Published under the `next` dist-tag. |
| [`dashboard`](./dashboard) | `@spree/dashboard` (not yet published) | **In Development** | React SPA admin dashboard for Spree 6.0. Will replace the legacy Rails `spree/admin` engine. Currently private in the workspace; will be published as `@spree/dashboard` once ready. |
diff --git a/packages/dashboard-core/src/components/page-header.tsx b/packages/dashboard-core/src/components/page-header.tsx
index d367061c90..eb4a568d45 100644
--- a/packages/dashboard-core/src/components/page-header.tsx
+++ b/packages/dashboard-core/src/components/page-header.tsx
@@ -5,7 +5,6 @@ import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
- DropdownMenuSeparator,
DropdownMenuTrigger,
useConfirm,
useCopyToClipboard,
@@ -57,11 +56,20 @@ interface PageHeaderProps {
/** Primary action buttons (rightmost, before the dropdown). Most pages use this for "Save". */
actions?: ReactNode
/**
- * Domain-specific items to render at the top of the more-actions dropdown
- * (e.g., Complete/Approve/Cancel on orders). Rendered above the
- * `page.actions_dropdown` slot and the auto-wired Copy ID / Delete items.
+ * Domain-specific items for the top group of the more-actions dropdown
+ * (e.g. Preview, Resend, Approve on orders). Rendered above the
+ * `page.actions_dropdown` slot and the standard Copy ID / JSON items.
+ *
+ * Destructive entries belong in `destructiveItems`, not here — the dropdown
+ * orders its three groups itself so every page reads the same way.
*/
dropdownItems?: ReactNode
+ /**
+ * Destructive domain actions (Cancel order, a delete with its own confirm).
+ * Always rendered last, in the same group as the auto-wired Delete, so a
+ * page can never put a red item above the standard actions.
+ */
+ destructiveItems?: ReactNode
/**
* The resource being edited. When supplied, PageHeader renders the legacy
* "more actions" dropdown (Copy ID, Copy number, Delete). When omitted, the
@@ -102,6 +110,7 @@ export function PageHeader({
badges,
actions,
dropdownItems,
+ destructiveItems,
resource,
slotContext,
onDelete,
@@ -110,7 +119,9 @@ export function PageHeader({
}: PageHeaderProps) {
const { t } = useTranslation()
const slotCtx = { ...slotContext, resource }
- const showDropdown = Boolean(resource || onDelete || dropdownItems || jsonPreview)
+ const showDropdown = Boolean(
+ resource || onDelete || dropdownItems || destructiveItems || jsonPreview,
+ )
const [jsonOpen, setJsonOpen] = useState(false)
// Latches true on first open so the drawer (and its lazy JsonView chunk)
// doesn't mount until the user actually invokes it, but stays mounted
@@ -208,6 +219,7 @@ export function PageHeader({
resource={resource}
slotContext={slotCtx}
dropdownItems={dropdownItems}
+ destructiveItems={destructiveItems}
onDelete={onDelete}
deleteLabel={deleteLabel ?? t('admin.actions.delete')}
onOpenJson={jsonPreview ? openJson : undefined}
@@ -232,6 +244,7 @@ interface PageActionsDropdownProps {
resource?: PageHeaderResource
slotContext: Record<string, unknown>
dropdownItems?: ReactNode
+ destructiveItems?: ReactNode
onDelete?: () => void | Promise<void>
deleteLabel: string
onOpenJson?: () => void
@@ -241,6 +254,7 @@ function PageActionsDropdown({
resource,
slotContext,
dropdownItems,
+ destructiveItems,
onDelete,
deleteLabel,
onOpenJson,
@@ -255,32 +269,49 @@ function PageActionsDropdown({
<EllipsisVerticalIcon className="size-4" />
</Button>
</DropdownMenuTrigger>
- <DropdownMenuContent align="end">
- {dropdownItems}
- <Slot name="page.actions_dropdown" context={slotContext} />
+ {/* Three fixed groups, in this order: domain actions, standard actions,
+ destructive actions. The order lives here rather than in each caller
+ so every record page's menu reads the same way.
- {onOpenJson && (
- <DropdownMenuItem onClick={onOpenJson}>
- <BracesIcon className="size-4" />
- {t('admin.components.page_header.view_as_json')}
- </DropdownMenuItem>
- )}
- {resource?.number && (
- <CopyToClipboardItem
- label={t('admin.components.page_header.copy_number')}
- value={resource.number}
- />
- )}
- {resource && (
- <CopyToClipboardItem
- label={t('admin.components.page_header.copy_id')}
- value={resource.id}
- />
- )}
+ Dividers are drawn by CSS (`:not(:empty) ~ :not(:empty)`) rather than
+ by rendering a <DropdownMenuSeparator> between groups. A group's
+ content can be present as a value but render nothing — an all-false
+ fragment, or a plugin slot with no registrations — which a JS check
+ reads as "has content" and would leave a divider floating against the
+ menu's edge. `:empty` asks the DOM what actually rendered. */}
+ <DropdownMenuContent
+ align="end"
+ className="[&>[data-menu-group]:not(:empty)~[data-menu-group]:not(:empty)]:mt-1 [&>[data-menu-group]:not(:empty)~[data-menu-group]:not(:empty)]:border-t [&>[data-menu-group]:not(:empty)~[data-menu-group]:not(:empty)]:border-border-subtle [&>[data-menu-group]:not(:empty)~[data-menu-group]:not(:empty)]:pt-1"
+ >
+ <div data-menu-group>
+ {dropdownItems}
+ <Slot name="page.actions_dropdown" context={slotContext} />
+ </div>
- {onDelete && (
- <>
- <DropdownMenuSeparator />
+ <div data-menu-group>
+ {onOpenJson && (
+ <DropdownMenuItem onClick={onOpenJson}>
+ <BracesIcon className="size-4" />
+ {t('admin.components.page_header.view_as_json')}
+ </DropdownMenuItem>
+ )}
+ {resource?.number && (
+ <CopyToClipboardItem
+ label={t('admin.components.page_header.copy_number')}
+ value={resource.number}
+ />
+ )}
+ {resource && (
+ <CopyToClipboardItem
+ label={t('admin.components.page_header.copy_id')}
+ value={resource.id}
+ />
+ )}
+ </div>
+
+ <div data-menu-group>
+ {destructiveItems}
+ {onDelete && (
<DropdownMenuItem
variant="destructive"
onClick={async () => {
@@ -298,8 +329,8 @@ function PageActionsDropdown({
<TrashIcon className="size-4" />
{deleteLabel}
</DropdownMenuItem>
- </>
- )}
+ )}
+ </div>
</DropdownMenuContent>
</DropdownMenu>
)
diff --git a/packages/dashboard-core/src/components/preferences-form.tsx b/packages/dashboard-core/src/components/preferences-form.tsx
index 49cabf711b..f758372001 100644
--- a/packages/dashboard-core/src/components/preferences-form.tsx
+++ b/packages/dashboard-core/src/components/preferences-form.tsx
@@ -389,10 +389,9 @@ function TierRow({
<Button
type="button"
size="icon-sm"
- variant="ghost"
+ variant="destructive-ghost"
onClick={onRemove}
aria-label={t('admin.components.preferences_form.tiers.remove_tier')}
- className="text-destructive hover:bg-destructive/10 hover:text-destructive"
>
<TrashIcon className="size-4" />
</Button>
diff --git a/packages/dashboard-core/src/components/resource-table.tsx b/packages/dashboard-core/src/components/resource-table.tsx
index a72af8db23..673559de77 100644
--- a/packages/dashboard-core/src/components/resource-table.tsx
+++ b/packages/dashboard-core/src/components/resource-table.tsx
@@ -483,7 +483,7 @@ export function ResourceTable<T extends Record<string, any>>({
// the gutter the page container applies, and the frame drops to a plain
// surface — background only, no border, radius or shadow. Scoped to this
// card so every other card on the page keeps its frame.
- <Card className="-mx-4 rounded-none border-0 bg-transparent sm:bg-card shadow-none sm:mx-0 sm:rounded-xl sm:border sm:shadow-sm">
+ <Card className="-mx-4 rounded-none border-0 bg-transparent sm:bg-card sm:mx-0 sm:rounded-xl sm:border">
<TableToolbar
columns={displayableColumns}
visibleColumns={visibleColumnKeys}
@@ -815,7 +815,7 @@ function SortableRow<T extends Record<string, any>>({
ref={setNodeRef}
style={style}
className={cn(
- 'group/row hover:bg-accent/60 last:*:border-b-0',
+ 'group/row hover:bg-accent/25 last:*:border-b-0',
isDragging && 'relative z-10 opacity-70',
)}
>
diff --git a/packages/dashboard-core/src/components/top-bar.tsx b/packages/dashboard-core/src/components/top-bar.tsx
index df538b3052..9d6cf10065 100644
--- a/packages/dashboard-core/src/components/top-bar.tsx
+++ b/packages/dashboard-core/src/components/top-bar.tsx
@@ -126,14 +126,14 @@ function SearchTrigger() {
// Focus matches the form inputs — the soft blue glow from `--ring`,
// rather than a hard offset ring. It looks like a search field, so it
// should focus like one.
- className="flex w-full max-w-md shrink cursor-pointer items-center gap-1 rounded-xl border border-border p-2 md:py-1.5 text-sm text-muted-foreground outline-none transition-[color,background-color,border-color,box-shadow] duration-100 ease-out hover:bg-accent focus-visible:border-ring focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)]"
+ className="flex w-full max-w-md shrink cursor-pointer items-center gap-1 rounded-xl border border-border p-2 md:py-1.5 text-sm text-muted-foreground outline-none transition-[color,background-color,border-color,box-shadow] duration-100 ease-out hover:bg-accent/50 focus-visible:border-ring focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)]"
>
<SearchIcon className="size-4" />
<span className="flex-1 text-left">{t('admin.components.command_palette.placeholder')}</span>
- <kbd className="hidden rounded-lg border bg-background px-2 py-1 font-mono text-xs sm:inline-flex shadow-xs h-full">
+ <kbd className="hidden rounded-lg border bg-background px-2 py-1 font-mono text-xs sm:inline-flex h-7 items-center">
{IS_MAC ? <CommandIcon size={15} /> : 'Ctrl'}
</kbd>
- <kbd className="hidden rounded-lg border bg-background px-2 py-1 font-mono text-xs sm:inline-flex shadow-xs">
+ <kbd className="hidden rounded-lg border bg-background px-2 py-1 font-mono text-xs sm:inline-flex h-7 items-center">
K
</kbd>
</button>
@@ -261,7 +261,7 @@ export function TopBarUser({
{t('admin.account.contact_support')}
</DropdownMenuItem>
<DropdownMenuSeparator />
- <DropdownMenuItem onClick={logout} className="text-destructive focus:text-destructive">
+ <DropdownMenuItem onClick={logout} variant="destructive">
<LogOutIcon className="size-4" />
{t('admin.account.log_out')}
</DropdownMenuItem>
diff --git a/packages/dashboard-starter/public/android-chrome-192x192.png b/packages/dashboard-starter/public/android-chrome-192x192.png
new file mode 100644
index 0000000000..f933649807
Binary files /dev/null and b/packages/dashboard-starter/public/android-chrome-192x192.png differ
diff --git a/packages/dashboard-starter/public/android-chrome-512x512.png b/packages/dashboard-starter/public/android-chrome-512x512.png
new file mode 100644
index 0000000000..86886366b8
Binary files /dev/null and b/packages/dashboard-starter/public/android-chrome-512x512.png differ
diff --git a/packages/dashboard-starter/public/apple-touch-icon.png b/packages/dashboard-starter/public/apple-touch-icon.png
index f0d223ec7d..392ee39949 100644
Binary files a/packages/dashboard-starter/public/apple-touch-icon.png and b/packages/dashboard-starter/public/apple-touch-icon.png differ
diff --git a/packages/dashboard-starter/public/favicon-16x16.png b/packages/dashboard-starter/public/favicon-16x16.png
new file mode 100644
index 0000000000..80529945f6
Binary files /dev/null and b/packages/dashboard-starter/public/favicon-16x16.png differ
diff --git a/packages/dashboard-starter/public/favicon-32x32.png b/packages/dashboard-starter/public/favicon-32x32.png
index 17270e998d..ea59c171b3 100644
Binary files a/packages/dashboard-starter/public/favicon-32x32.png and b/packages/dashboard-starter/public/favicon-32x32.png differ
diff --git a/packages/dashboard-starter/public/favicon.ico b/packages/dashboard-starter/public/favicon.ico
new file mode 100644
index 0000000000..1230bdf46e
Binary files /dev/null and b/packages/dashboard-starter/public/favicon.ico differ
diff --git a/packages/dashboard-starter/public/favicon.svg b/packages/dashboard-starter/public/favicon.svg
index 3aee087a3f..3f7f622846 100644
--- a/packages/dashboard-starter/public/favicon.svg
+++ b/packages/dashboard-starter/public/favicon.svg
@@ -1,9 +1,9 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="-50.5 13 220 220">
- <style>
- /* Tabs render on light or dark chrome; a single fixed colour disappears
- against one of them. */
- path { fill: #061932; }
- @media (prefers-color-scheme: dark) { path { fill: #fcfaf7; } }
- </style>
- <path d="m67.1952 155.931c-7.4439 0-14.8975-.251-22.3268.078-6.8002.3-10.7399-2.546-13.0437-8.906-3.0928-8.528-6.9744-16.77-10.1107-25.289-1.3939-3.785-3.5138-5.14-7.3568-4.714-2.0279.223-4.172.174-6.17094-.223-5.04809-.997-8.077907-4.036-8.18438672-9.37-.09679938-4.937 3.56706672-9.0747 8.86198672-9.3796 5.97254-.3485 11.99344-.2662 17.97564-.0242 4.2592.1694 7.2019 2.4198 8.833 6.5918 3.6106 9.225 7.6132 18.295 11.127 27.554 1.2875 3.388 2.9331 4.826 6.7082 4.719 9.2976-.271 18.6097-.295 27.9025.015 3.8332.126 5.3481-1.399 6.6162-4.743 3.4315-9.071 7.1825-18.02 10.9674-26.949 2.6422-6.2295 7.2742-8.5091 12.6802-6.5731 5.557 1.9891 7.691 6.6311 5.228 13.1501-4.889 12.928-10.082 25.744-15.329 38.531-1.679 4.095-5.3186 5.532-9.5681 5.537-8.2716.015-16.5382 0-24.8097 0z"/><path d="m57.4414 74.7414c0-9.1815 0-18.3629 0-27.5395 0-4.961-.1065-9.922.0242-14.8781.1694-6.3307 4.8012-11.2239 10.1833-10.9819 5.4691.2468 9.3847 4.6463 9.4282 10.9335.0823 12.1919.0242 24.3838.0242 36.5709v7.5649c4.1769-3.9833 7.3858-6.9599 10.4979-10.0333 4.748-4.6899 10.8803-5.3385 14.8638-1.4907 4.269 4.1236 4.152 9.6799-.77 14.7038-8.8182 8.9976-17.7286 17.9031-26.8181 26.625-5.1158 4.908-10.1107 4.695-15.2797-.358-8.8572-8.6639-17.6272-17.4146-26.3246-26.2331-5.0626-5.1352-5.3143-10.4011-.9922-14.5974 4.1139-3.9978 10.0139-3.6348 14.8103 1.2875 2.9669 3.0443 5.4837 6.5339 8.2037 9.8251.7163-.4646 1.4278-.9244 2.1441-1.389z"/><path d="m66.9811 223.999c-11.2965-.6-21.5718-4.187-30.1772-12.013-4.4528-4.051-5.1498-9.752-1.6747-13.731 3.0637-3.509 9.2444-3.683 13.4745-.377 13.1502 10.28 24.5677 10.323 37.2339.145 4.7577-3.824 10.2946-3.737 13.8568.213 3.3446 3.707 2.6086 9.748-1.5827 13.774-8.6538 8.315-19.2921 11.428-31.1258 11.984z"/><path d="m46.1606 165.786c6.05.01 10.7302 4.545 10.677 10.343-.0484 5.542-5.2078 10.416-10.89 10.285-5.4062-.121-10.2655-4.908-10.3623-10.193-.1065-5.818 4.5883-10.449 10.5753-10.44z"/><path d="m99.2824 176.157c-.0484 5.44-4.8255 10.183-10.343 10.265-5.8419.087-10.6722-4.714-10.5947-10.532.0822-6.137 4.5689-10.309 10.856-10.096 5.7935.199 10.1349 4.656 10.0865 10.367z"/>
+<svg width="257" height="257" viewBox="0 0 257 257" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0.5 60C0.5 26.8629 27.3629 0 60.5 0H196.5C229.637 0 256.5 26.8629 256.5 60V196C256.5 229.137 229.637 256 196.5 256H60.5C27.3629 256 0.5 229.137 0.5 196V60Z" fill="black"/>
+<path d="M0.5 0H256.5H0.5M257 196C257 229.413 229.913 256.5 196.5 256.5H60.5C27.0868 256.5 0 229.413 0 196H1C1 228.861 27.6391 255.5 60.5 255.5H196.5C229.361 255.5 256 228.861 256 196H257ZM60.5 256.5C27.0868 256.5 0 229.413 0 196V60.5C0 27.0868 27.0868 0 60.5 0C27.6391 0 1 26.8629 1 60V196C1 228.861 27.6391 255.5 60.5 255.5V256.5ZM196.5 0C229.913 0 257 27.0868 257 60.5V196C257 229.413 229.913 256.5 196.5 256.5V255.5C229.361 255.5 256 228.861 256 196V60C256 26.8629 229.361 0 196.5 0Z" fill="#EAEAEA"/>
+<path d="M132.462 155.713C125.076 155.713 117.681 155.463 110.309 155.79C103.562 156.088 99.6534 153.264 97.3675 146.954C94.299 138.492 90.4476 130.314 87.3358 121.862C85.9528 118.107 83.8495 116.763 80.0366 117.185C78.0245 117.406 75.8971 117.358 73.9138 116.964C68.9052 115.975 65.899 112.959 65.7934 107.667C65.6973 102.769 69.3326 98.6632 74.5861 98.3607C80.512 98.0149 86.4859 98.0965 92.4213 98.3366C96.6472 98.5047 99.5669 100.738 101.185 104.877C104.768 114.03 108.739 123.029 112.225 132.216C113.503 135.577 115.136 137.004 118.881 136.898C128.106 136.629 137.346 136.605 146.566 136.912C150.369 137.037 151.872 135.525 153.13 132.206C156.535 123.207 160.257 114.328 164.012 105.468C166.634 99.2875 171.23 97.0256 176.594 98.9465C182.106 100.92 184.224 105.525 181.78 111.994C176.93 124.821 171.777 137.537 166.571 150.224C164.905 154.287 161.294 155.713 157.078 155.718C148.871 155.732 140.669 155.718 132.462 155.718V155.713Z" fill="white"/>
+<path d="M122.784 75.1574C122.784 66.0477 122.784 56.9379 122.784 47.833C122.784 42.9108 122.678 37.9886 122.808 33.0712C122.976 26.7899 127.572 21.9349 132.912 22.175C138.338 22.4199 142.223 26.7851 142.266 33.0231C142.348 45.1198 142.29 57.2165 142.29 69.3083C142.29 71.3012 142.29 73.2941 142.29 76.8141C146.435 72.8619 149.618 69.9086 152.706 66.8592C157.417 62.2059 163.502 61.5624 167.454 65.3802C171.689 69.4716 171.574 74.9845 166.69 79.9691C157.941 88.8964 149.1 97.7324 140.081 106.386C135.006 111.255 130.05 111.044 124.921 106.031C116.133 97.4346 107.432 88.7523 98.8021 80.0028C93.779 74.9077 93.5293 69.6829 97.8176 65.5194C101.899 61.5528 107.753 61.913 112.512 66.7968C115.456 69.8174 117.953 73.2797 120.652 76.5452C121.363 76.0842 122.069 75.628 122.779 75.167L122.784 75.1574Z" fill="white"/>
+<path d="M132.249 223.249C121.041 222.654 110.846 219.095 102.308 211.33C97.8898 207.311 97.1982 201.654 100.646 197.707C103.686 194.225 109.818 194.052 114.015 197.332C127.063 207.532 138.391 207.575 150.958 197.476C155.679 193.682 161.173 193.769 164.707 197.687C168.025 201.366 167.295 207.359 163.137 211.354C154.55 219.604 143.995 222.692 132.254 223.244L132.249 223.249Z" fill="white"/>
+<path d="M111.591 165.491C117.594 165.501 122.238 170 122.185 175.753C122.137 181.252 117.018 186.088 111.38 185.958C106.016 185.838 101.195 181.089 101.099 175.845C100.993 170.072 105.651 165.477 111.591 165.486V165.491Z" fill="white"/>
+<path d="M164.298 175.78C164.25 181.178 159.51 185.884 154.036 185.966C148.24 186.052 143.447 181.288 143.524 175.516C143.606 169.427 148.057 165.288 154.295 165.499C160.044 165.696 164.351 170.119 164.303 175.785L164.298 175.78Z" fill="white"/>
</svg>
diff --git a/packages/dashboard-ui/src/spree/address-book-row.tsx b/packages/dashboard-ui/src/spree/address-book-row.tsx
index c07266cf7f..11fe4b9ca4 100644
--- a/packages/dashboard-ui/src/spree/address-book-row.tsx
+++ b/packages/dashboard-ui/src/spree/address-book-row.tsx
@@ -84,10 +84,7 @@ export function AddressBookRow({
{t('admin.address_book.set_default_shipping')}
</DropdownMenuItem>
)}
- <DropdownMenuItem
- className="text-destructive focus:text-destructive"
- onClick={onRemove}
- >
+ <DropdownMenuItem variant="destructive" onClick={onRemove}>
<TrashIcon className="size-4" />
{t('admin.actions.delete')}
</DropdownMenuItem>
diff --git a/packages/dashboard-ui/src/spree/row-actions.tsx b/packages/dashboard-ui/src/spree/row-actions.tsx
index bc74af1ae9..570fe403aa 100644
--- a/packages/dashboard-ui/src/spree/row-actions.tsx
+++ b/packages/dashboard-ui/src/spree/row-actions.tsx
@@ -73,7 +73,7 @@ export function RowActions({ actions }: RowActionsProps) {
key={action.key}
onClick={action.onSelect}
disabled={action.disabled}
- className={action.destructive ? 'text-destructive focus:text-destructive' : undefined}
+ variant={action.destructive ? 'destructive' : undefined}
>
{action.icon ?? BUILTIN_ICONS[action.key]}
{action.label ?? t(`admin.row_actions.${action.key}`)}
diff --git a/packages/dashboard-ui/src/spree/theme-toggle.tsx b/packages/dashboard-ui/src/spree/theme-toggle.tsx
index 1658e54265..5dd5d0f565 100644
--- a/packages/dashboard-ui/src/spree/theme-toggle.tsx
+++ b/packages/dashboard-ui/src/spree/theme-toggle.tsx
@@ -34,8 +34,8 @@ export function ThemeMenuItems() {
title={t(labelKey)}
onClick={() => setMode(value)}
className={cn(
- 'flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground',
- active && 'bg-background text-foreground shadow-sm',
+ 'flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground hover:bg-accent cursor-pointer',
+ active && 'bg-accent text-foreground shadow-sm',
)}
>
<Icon className="size-4" />
diff --git a/packages/dashboard-ui/src/styles.css b/packages/dashboard-ui/src/styles.css
index 037b3ac3f3..305c76198e 100644
--- a/packages/dashboard-ui/src/styles.css
+++ b/packages/dashboard-ui/src/styles.css
@@ -43,7 +43,7 @@
--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(98.5% 0 none); /* neutral-100 */
+ --background: oklch(98.5% 0 none); /* neutral-50 */
--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);
@@ -63,10 +63,9 @@
--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);
+ pressed state rather than a hover. The sidebar shares this value via
+ --sidebar-accent so a highlighted row looks the same wherever it is. */
+ --accent: oklch(0.95 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 */
@@ -89,8 +88,8 @@
--radius: 0.75rem;
/* Sidebar — one step off the page, so it reads as its own surface. */
- --sidebar: oklch(98.5% 0 none); /* neutral-100 */
- --sidebar-foreground: oklch(0.145 0 0);
+ --sidebar: oklch(97% 0 none); /* neutral-100 */
+ --sidebar-foreground: oklch(37.1% 0 none);
--sidebar-primary: oklch(0.145 0 0);
--sidebar-primary-foreground: oklch(1 0 0);
--sidebar-accent: oklch(0.922 0 0); /* neutral-200 */
@@ -117,8 +116,8 @@
* needs, so green's fill drops one step to clear it. The difference is
* invisible beside the other three but keeps the whole set measurably legible
* rather than passing only by eye. */
- --status-green-bg: var(--color-green-50);
- --status-green-border: var(--color-green-100);
+ --status-green-bg: var(--color-green-100);
+ --status-green-border: var(--color-green-200);
--status-green-fg: var(--color-green-700);
--status-amber-bg: var(--color-amber-100);
@@ -221,10 +220,35 @@
--text-3xl: 1.75rem;
--text-4xl: 2rem;
- /* Shadows — subtle like Rails admin */
- --shadow-xs: rgba(43, 34, 51, 0.05) 0px 1px 1px;
- --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
- --shadow-nav: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.04) 0px 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 1px 2px -1px, rgba(0, 0, 0, 0.02) 0px 2px 4px 0px;
+ /* Shadows are retired rather than removed. A card already carries its own
+ border, so the extra 1px of depth under it added no information — it just
+ softened an edge the border was drawing cleanly. The tokens stay defined,
+ at effectively nothing, so the components still carrying `shadow-xs`
+ flatten with the rest instead of each needing to be found and edited.
+ Floating surfaces are the exception and set their own shadow: a menu or
+ dialog genuinely is above the page, and that is the one place depth is
+ telling the truth. */
+ --shadow-xs: 0 0 0 0 transparent;
+ --shadow-sm: 0 0 0 0 transparent;
+ --shadow-nav: 0 0 0 1px var(--border);
+
+ /* Floating surfaces — menus, popovers, dialogs, sheets. Wide and faint
+ rather than tight and dark: the job is to say "this is above the page",
+ which a large soft spread does without drawing an edge of its own. A
+ hairline ring carries the actual boundary. */
+ --shadow-md: 0 4px 16px -4px rgb(0 0 0 / 0.08), 0 1px 4px -2px rgb(0 0 0 / 0.05);
+ --shadow-lg: 0 8px 32px -8px rgb(0 0 0 / 0.10), 0 2px 8px -4px rgb(0 0 0 / 0.06);
+
+ /* Radius scale, remapped one step rounder than Tailwind's defaults.
+ Corner radius is most of what reads as "soft", and remapping the scale
+ reaches every `rounded-lg`/`rounded-xl` already written in the components
+ — including the `calc(var(--radius-2xl) - 1px)` a card header derives its
+ own corner from, which would drift out of alignment if the components
+ were each edited by hand instead. */
+ --radius-md: 0.5rem;
+ --radius-lg: 0.625rem;
+ --radius-xl: 0.875rem;
+ --radius-2xl: 1.125rem;
/* Sidebar + header tokens */
--spacing-sidebar-width: 220px;
diff --git a/packages/dashboard-ui/src/ui/badge.tsx b/packages/dashboard-ui/src/ui/badge.tsx
index ee7cbcbccc..1458ce98f0 100644
--- a/packages/dashboard-ui/src/ui/badge.tsx
+++ b/packages/dashboard-ui/src/ui/badge.tsx
@@ -31,7 +31,7 @@ const badgeVariants = cva(
info: 'border-info-border bg-info-bg text-info [a]:hover:bg-info-border',
warning: 'border-warning-border bg-warning-bg text-warning [a]:hover:bg-warning-border',
outline:
- 'border-border text-foreground/75 [a]:hover:bg-muted [a]:hover:text-muted-foreground',
+ 'border-border bg-card/50 text-foreground/75 [a]:hover:bg-muted [a]:hover:text-muted-foreground',
ghost:
'border-transparent hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50',
link: 'border-transparent text-primary underline-offset-4 hover:underline',
diff --git a/packages/dashboard-ui/src/ui/button.tsx b/packages/dashboard-ui/src/ui/button.tsx
index 407fdcffcc..0336c5914f 100644
--- a/packages/dashboard-ui/src/ui/button.tsx
+++ b/packages/dashboard-ui/src/ui/button.tsx
@@ -4,15 +4,20 @@ import { cn } from '../lib/utils'
import { Slot } from './slot'
const buttonVariants = cva(
- "group/button inline-flex shrink-0 items-center justify-center gap-2 rounded-xl border border-transparent text-sm font-medium whitespace-nowrap cursor-pointer select-none no-underline transition-[color,background-color,border-color,box-shadow,transform,translate,scale] duration-100 ease-out outline-none active:scale-[0.98] motion-reduce:active:scale-100 focus-visible:border-blue-500 focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)] disabled:pointer-events-none disabled:opacity-70 disabled:cursor-not-allowed aria-invalid:border-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "group/button inline-flex shrink-0 items-center justify-center gap-2 rounded-lg border border-transparent text-sm font-medium whitespace-nowrap cursor-pointer select-none no-underline transition-[color,background-color,border-color,box-shadow,transform,translate,scale] duration-100 ease-out outline-none active:scale-[0.98] motion-reduce:active:scale-100 focus-visible:border-blue-500 focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)] disabled:pointer-events-none disabled:opacity-70 disabled:cursor-not-allowed aria-invalid:border-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
{
variants: {
variant: {
- default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/85',
+ default: 'bg-primary text-primary-foreground hover:bg-primary/85',
outline:
- 'border-border bg-muted text-foreground shadow-xs hover:bg-accent hover:text-foreground aria-expanded:bg-accent',
+ 'border-border bg-muted text-foreground hover:bg-accent hover:text-foreground aria-expanded:bg-accent',
ghost: 'hover:bg-accent hover:text-accent-foreground aria-expanded:bg-accent',
destructive: 'text-destructive bg-muted border-border shadow-xs hover:bg-destructive/10',
+ // Ghost's chrome (none until hover) with destructive's colour. The
+ // inline remove buttons that sit inside a row or field want no box of
+ // their own, but still need the red tint on hover rather than ghost's
+ // neutral grey — several had been reproducing exactly this by hand.
+ 'destructive-ghost': 'text-destructive hover:bg-destructive/10 hover:text-destructive',
link: 'text-primary underline-offset-4 hover:underline',
},
size: {
diff --git a/packages/dashboard-ui/src/ui/card.tsx b/packages/dashboard-ui/src/ui/card.tsx
index 39878ae30e..c8f6a84629 100644
--- a/packages/dashboard-ui/src/ui/card.tsx
+++ b/packages/dashboard-ui/src/ui/card.tsx
@@ -12,7 +12,7 @@ function Card({ className, ...props }: React.ComponentProps<'div'>) {
// the document, laying the whole page out wider than the viewport. `clip`
// rather than `hidden` so `overflow-y` stays `visible` and sticky
// descendants keep resolving against the page.
- 'group/card flex flex-col min-w-0 overflow-x-clip break-words bg-card text-card-foreground border border-border rounded-xl shadow-xs',
+ 'group/card flex flex-col min-w-0 overflow-x-clip break-words bg-card text-card-foreground border border-border rounded-xl',
className,
)}
{...props}
diff --git a/packages/dashboard-ui/src/ui/combobox.tsx b/packages/dashboard-ui/src/ui/combobox.tsx
index a9e932b33e..e7eb8246d7 100644
--- a/packages/dashboard-ui/src/ui/combobox.tsx
+++ b/packages/dashboard-ui/src/ui/combobox.tsx
@@ -309,7 +309,12 @@ function ComboboxChip({
// Height comes from the content rather than a fixed 21px: the old value
// was shorter than the remove button inside it, and left the label with
// no vertical breathing room at any screen size.
- 'flex min-h-8 w-fit max-w-full items-center justify-center gap-1 rounded-md bg-muted py-1 pl-2.5 pr-2 text-sm font-medium text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-1',
+ //
+ // Fill matches the highlighted row in the list below (`bg-accent`): a
+ // chip and a selected option are the same thing at two moments, so they
+ // read as the same thing. `bg-muted` sat within 1.03:1 of the field it
+ // sits on, which left the chips barely visible.
+ 'flex min-h-8 w-fit max-w-full items-center justify-center gap-1 rounded-md bg-accent py-1 pl-2.5 pr-2 text-sm font-medium text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-1',
className,
)}
{...props}
diff --git a/packages/dashboard-ui/src/ui/data-table.tsx b/packages/dashboard-ui/src/ui/data-table.tsx
index 1e8b422b0a..3e6c3a8e84 100644
--- a/packages/dashboard-ui/src/ui/data-table.tsx
+++ b/packages/dashboard-ui/src/ui/data-table.tsx
@@ -227,7 +227,7 @@ function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
return (
<th
className={cn(
- 'text-left text-sm font-medium text-muted-foreground bg-muted px-3 py-2.5 sm:p-2 whitespace-nowrap first:pl-4 last:pr-4',
+ 'text-left text-sm font-normal text-muted-foreground bg-card px-3 py-2.5 h-9 sm:p-2 whitespace-nowrap first:pl-4 last:pr-4',
'shadow-[inset_0_-1px_0_0_var(--border-subtle)]',
className,
)}
diff --git a/packages/dashboard-ui/src/ui/dropdown-menu.tsx b/packages/dashboard-ui/src/ui/dropdown-menu.tsx
index 2acf664e04..608e445842 100644
--- a/packages/dashboard-ui/src/ui/dropdown-menu.tsx
+++ b/packages/dashboard-ui/src/ui/dropdown-menu.tsx
@@ -83,7 +83,7 @@ function DropdownMenuContent({
className={cn(
// `origin-(--transform-origin)` so the menu grows out of its
// trigger rather than its own centre.
- 'z-50 max-h-[var(--available-height)] min-w-40 max-w-80 overflow-x-hidden overflow-y-auto rounded-2xl border border-border bg-popover p-1 text-popover-foreground shadow-lg origin-(--transform-origin) duration-100 ease-out data-[starting-style]:opacity-0 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:scale-95 transition-[opacity,transform,translate,scale]',
+ 'z-50 max-h-[var(--available-height)] min-w-40 max-w-80 overflow-x-hidden overflow-y-auto rounded-xl border border-border bg-popover p-1 text-popover-foreground shadow-lg origin-(--transform-origin) duration-100 ease-out data-[starting-style]:opacity-0 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:scale-95 transition-[opacity,transform,translate,scale]',
className,
)}
{...props}
@@ -119,7 +119,7 @@ function DropdownMenuItem({
data-variant={variant}
render={children}
className={cn(
- "group/dropdown-menu-item relative flex cursor-pointer items-center gap-3 rounded-xl px-2 py-1.5 text-sm outline-hidden select-none transition-colors duration-75 focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "group/dropdown-menu-item relative flex cursor-pointer items-center gap-3 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none transition-colors duration-75 focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
)}
{...props}
@@ -133,7 +133,7 @@ function DropdownMenuItem({
data-inset={inset}
data-variant={variant}
className={cn(
- "group/dropdown-menu-item relative flex cursor-pointer items-center gap-3 rounded-xl px-2 py-1.5 text-sm outline-hidden select-none transition-colors duration-75 focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "group/dropdown-menu-item relative flex cursor-pointer items-center gap-3 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none transition-colors duration-75 focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
)}
{...props}
@@ -160,7 +160,7 @@ function DropdownMenuCheckboxItem({
data-slot="dropdown-menu-checkbox-item"
data-inset={inset}
className={cn(
- "relative flex cursor-pointer 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",
+ "relative flex cursor-pointer items-center gap-3 rounded-lg 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}
@@ -199,7 +199,7 @@ function DropdownMenuRadioItem({
data-slot="dropdown-menu-radio-item"
data-inset={inset}
className={cn(
- "relative flex cursor-pointer 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",
+ "relative flex cursor-pointer items-center gap-3 rounded-lg 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,
)}
{...props}
@@ -294,7 +294,7 @@ function DropdownMenuSubTrigger({
data-slot="dropdown-menu-sub-trigger"
data-inset={inset}
className={cn(
- "flex cursor-pointer items-center gap-3 rounded-xl px-2 py-1.5 text-sm outline-hidden select-none transition-colors duration-75 focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "flex cursor-pointer items-center gap-3 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none transition-colors duration-75 focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
)}
{...props}
@@ -321,7 +321,7 @@ function DropdownMenuSubContent({
className={cn(
// `origin-(--transform-origin)` so the submenu grows out of its
// parent item rather than its own centre.
- 'z-50 min-w-[96px] overflow-hidden rounded-2xl border border-border bg-popover p-1 text-popover-foreground shadow-lg origin-(--transform-origin) duration-100 ease-out data-[starting-style]:opacity-0 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:scale-95 transition-[opacity,transform,translate,scale]',
+ 'z-50 min-w-[96px] overflow-hidden rounded-xl border border-border bg-popover p-1 text-popover-foreground shadow-lg origin-(--transform-origin) duration-100 ease-out data-[starting-style]:opacity-0 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:scale-95 transition-[opacity,transform,translate,scale]',
className,
)}
{...props}
diff --git a/packages/dashboard-ui/src/ui/input.tsx b/packages/dashboard-ui/src/ui/input.tsx
index 14e6c00f81..04aca58281 100644
--- a/packages/dashboard-ui/src/ui/input.tsx
+++ b/packages/dashboard-ui/src/ui/input.tsx
@@ -8,7 +8,7 @@ function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
type={type}
data-slot="input"
className={cn(
- 'block w-full min-w-0 min-h-8 rounded-lg border border-border bg-card py-1.5 px-2.5 text-base font-normal leading-normal text-foreground shadow-xs transition-[color,background-color,border-color,box-shadow] duration-100 ease-out outline-none placeholder:text-muted-foreground focus:border-blue-500 focus:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-muted disabled:border-border disabled:text-muted-foreground disabled:shadow-none aria-invalid:border-destructive file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground',
+ 'block w-full min-w-0 min-h-8 rounded-lg border border-border bg-card py-1.5 px-2.5 text-base font-normal leading-normal text-foreground transition-[color,background-color,border-color,box-shadow] duration-100 ease-out outline-none placeholder:text-muted-foreground focus:border-blue-500 focus:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-muted disabled:border-border disabled:text-muted-foreground disabled:shadow-none aria-invalid:border-destructive file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground',
className,
)}
{...props}
diff --git a/packages/dashboard-ui/src/ui/sidebar.tsx b/packages/dashboard-ui/src/ui/sidebar.tsx
index 788eaa0673..29880f4ccb 100644
--- a/packages/dashboard-ui/src/ui/sidebar.tsx
+++ b/packages/dashboard-ui/src/ui/sidebar.tsx
@@ -508,7 +508,7 @@ const sidebarMenuButtonVariants = cva(
// badge. Without it the flex line wraps and the label visibly squashes to two
// lines inside the fixed height until the animation lands. Labels clip
// instead — which is what the `truncate` below already intends.
- 'peer/menu-button group/menu-button flex gap-2 w-full items-center overflow-hidden whitespace-nowrap rounded-xl p-1 text-left text-base text-sidebar-foreground/80 outline-hidden transition-colors duration-100 ease-out group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-10! group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:overflow-visible group-data-[collapsible=icon]:p-0! group-data-[collapsible=icon]:gap-0 group-data-[collapsible=icon]:[&>span:last-child]:hidden hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-foreground data-active:bg-sidebar-accent data-active:text-foreground data-active:font-semibold [&>span:last-child]:truncate',
+ 'peer/menu-button group/menu-button flex gap-2 w-full items-center overflow-hidden whitespace-nowrap rounded-lg p-1 text-left text-base text-sidebar-foreground/80 outline-hidden transition-colors duration-100 ease-out group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-10! group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:overflow-visible group-data-[collapsible=icon]:p-0! group-data-[collapsible=icon]:gap-0 group-data-[collapsible=icon]:[&>span:last-child]:hidden hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-foreground data-active:bg-sidebar-accent data-active:text-foreground data-active:font-semibold [&>span:last-child]:truncate',
{
variants: {
variant: {
@@ -701,7 +701,7 @@ function SidebarMenuSubButton({
data-size={size}
data-active={isActive}
className={cn(
- 'relative flex h-7 in-data-[mobile=true]:h-11 in-data-[mobile=true]:px-2 min-w-0 items-center gap-2 overflow-hidden rounded-xl p-1 text-sidebar-foreground/80 outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-base data-[size=sm]:text-xs data-active:font-semibold data-active:text-foreground data-active:bg-transparent data-active:shadow-none data-active:before:absolute data-active:before:-left-4 data-active:before:top-[10%] data-active:before:h-[80%] data-active:before:w-[3px] data-active:before:rounded-sm data-active:before:bg-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
+ 'relative flex h-7 in-data-[mobile=true]:h-11 in-data-[mobile=true]:px-2 min-w-0 items-center gap-2 overflow-hidden rounded-lg p-1 text-sidebar-foreground/80 outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_15%,transparent)] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-base data-[size=sm]:text-xs data-active:font-semibold data-active:text-foreground data-active:bg-transparent data-active:shadow-none data-active:before:absolute data-active:before:-left-4 data-active:before:top-[10%] data-active:before:h-[80%] data-active:before:w-[3px] data-active:before:rounded-sm data-active:before:bg-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
className,
)}
{...props}
diff --git a/packages/dashboard/public/android-chrome-192x192.png b/packages/dashboard/public/android-chrome-192x192.png
new file mode 100644
index 0000000000..f933649807
Binary files /dev/null and b/packages/dashboard/public/android-chrome-192x192.png differ
diff --git a/packages/dashboard/public/android-chrome-512x512.png b/packages/dashboard/public/android-chrome-512x512.png
new file mode 100644
index 0000000000..86886366b8
Binary files /dev/null and b/packages/dashboard/public/android-chrome-512x512.png differ
diff --git a/packages/dashboard/public/apple-touch-icon.png b/packages/dashboard/public/apple-touch-icon.png
index f0d223ec7d..392ee39949 100644
Binary files a/packages/dashboard/public/apple-touch-icon.png and b/packages/dashboard/public/apple-touch-icon.png differ
diff --git a/packages/dashboard/public/favicon-16x16.png b/packages/dashboard/public/favicon-16x16.png
new file mode 100644
index 0000000000..80529945f6
Binary files /dev/null and b/packages/dashboard/public/favicon-16x16.png differ
diff --git a/packages/dashboard/public/favicon-32x32.png b/packages/dashboard/public/favicon-32x32.png
index 17270e998d..ea59c171b3 100644
Binary files a/packages/dashboard/public/favicon-32x32.png and b/packages/dashboard/public/favicon-32x32.png differ
diff --git a/packages/dashboard/public/favicon.ico b/packages/dashboard/public/favicon.ico
new file mode 100644
index 0000000000..1230bdf46e
Binary files /dev/null and b/packages/dashboard/public/favicon.ico differ
diff --git a/packages/dashboard/public/favicon.svg b/packages/dashboard/public/favicon.svg
index 3aee087a3f..3f7f622846 100644
--- a/packages/dashboard/public/favicon.svg
+++ b/packages/dashboard/public/favicon.svg
@@ -1,9 +1,9 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="-50.5 13 220 220">
- <style>
- /* Tabs render on light or dark chrome; a single fixed colour disappears
- against one of them. */
- path { fill: #061932; }
- @media (prefers-color-scheme: dark) { path { fill: #fcfaf7; } }
- </style>
- <path d="m67.1952 155.931c-7.4439 0-14.8975-.251-22.3268.078-6.8002.3-10.7399-2.546-13.0437-8.906-3.0928-8.528-6.9744-16.77-10.1107-25.289-1.3939-3.785-3.5138-5.14-7.3568-4.714-2.0279.223-4.172.174-6.17094-.223-5.04809-.997-8.077907-4.036-8.18438672-9.37-.09679938-4.937 3.56706672-9.0747 8.86198672-9.3796 5.97254-.3485 11.99344-.2662 17.97564-.0242 4.2592.1694 7.2019 2.4198 8.833 6.5918 3.6106 9.225 7.6132 18.295 11.127 27.554 1.2875 3.388 2.9331 4.826 6.7082 4.719 9.2976-.271 18.6097-.295 27.9025.015 3.8332.126 5.3481-1.399 6.6162-4.743 3.4315-9.071 7.1825-18.02 10.9674-26.949 2.6422-6.2295 7.2742-8.5091 12.6802-6.5731 5.557 1.9891 7.691 6.6311 5.228 13.1501-4.889 12.928-10.082 25.744-15.329 38.531-1.679 4.095-5.3186 5.532-9.5681 5.537-8.2716.015-16.5382 0-24.8097 0z"/><path d="m57.4414 74.7414c0-9.1815 0-18.3629 0-27.5395 0-4.961-.1065-9.922.0242-14.8781.1694-6.3307 4.8012-11.2239 10.1833-10.9819 5.4691.2468 9.3847 4.6463 9.4282 10.9335.0823 12.1919.0242 24.3838.0242 36.5709v7.5649c4.1769-3.9833 7.3858-6.9599 10.4979-10.0333 4.748-4.6899 10.8803-5.3385 14.8638-1.4907 4.269 4.1236 4.152 9.6799-.77 14.7038-8.8182 8.9976-17.7286 17.9031-26.8181 26.625-5.1158 4.908-10.1107 4.695-15.2797-.358-8.8572-8.6639-17.6272-17.4146-26.3246-26.2331-5.0626-5.1352-5.3143-10.4011-.9922-14.5974 4.1139-3.9978 10.0139-3.6348 14.8103 1.2875 2.9669 3.0443 5.4837 6.5339 8.2037 9.8251.7163-.4646 1.4278-.9244 2.1441-1.389z"/><path d="m66.9811 223.999c-11.2965-.6-21.5718-4.187-30.1772-12.013-4.4528-4.051-5.1498-9.752-1.6747-13.731 3.0637-3.509 9.2444-3.683 13.4745-.377 13.1502 10.28 24.5677 10.323 37.2339.145 4.7577-3.824 10.2946-3.737 13.8568.213 3.3446 3.707 2.6086 9.748-1.5827 13.774-8.6538 8.315-19.2921 11.428-31.1258 11.984z"/><path d="m46.1606 165.786c6.05.01 10.7302 4.545 10.677 10.343-.0484 5.542-5.2078 10.416-10.89 10.285-5.4062-.121-10.2655-4.908-10.3623-10.193-.1065-5.818 4.5883-10.449 10.5753-10.44z"/><path d="m99.2824 176.157c-.0484 5.44-4.8255 10.183-10.343 10.265-5.8419.087-10.6722-4.714-10.5947-10.532.0822-6.137 4.5689-10.309 10.856-10.096 5.7935.199 10.1349 4.656 10.0865 10.367z"/>
+<svg width="257" height="257" viewBox="0 0 257 257" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0.5 60C0.5 26.8629 27.3629 0 60.5 0H196.5C229.637 0 256.5 26.8629 256.5 60V196C256.5 229.137 229.637 256 196.5 256H60.5C27.3629 256 0.5 229.137 0.5 196V60Z" fill="black"/>
+<path d="M0.5 0H256.5H0.5M257 196C257 229.413 229.913 256.5 196.5 256.5H60.5C27.0868 256.5 0 229.413 0 196H1C1 228.861 27.6391 255.5 60.5 255.5H196.5C229.361 255.5 256 228.861 256 196H257ZM60.5 256.5C27.0868 256.5 0 229.413 0 196V60.5C0 27.0868 27.0868 0 60.5 0C27.6391 0 1 26.8629 1 60V196C1 228.861 27.6391 255.5 60.5 255.5V256.5ZM196.5 0C229.913 0 257 27.0868 257 60.5V196C257 229.413 229.913 256.5 196.5 256.5V255.5C229.361 255.5 256 228.861 256 196V60C256 26.8629 229.361 0 196.5 0Z" fill="#EAEAEA"/>
+<path d="M132.462 155.713C125.076 155.713 117.681 155.463 110.309 155.79C103.562 156.088 99.6534 153.264 97.3675 146.954C94.299 138.492 90.4476 130.314 87.3358 121.862C85.9528 118.107 83.8495 116.763 80.0366 117.185C78.0245 117.406 75.8971 117.358 73.9138 116.964C68.9052 115.975 65.899 112.959 65.7934 107.667C65.6973 102.769 69.3326 98.6632 74.5861 98.3607C80.512 98.0149 86.4859 98.0965 92.4213 98.3366C96.6472 98.5047 99.5669 100.738 101.185 104.877C104.768 114.03 108.739 123.029 112.225 132.216C113.503 135.577 115.136 137.004 118.881 136.898C128.106 136.629 137.346 136.605 146.566 136.912C150.369 137.037 151.872 135.525 153.13 132.206C156.535 123.207 160.257 114.328 164.012 105.468C166.634 99.2875 171.23 97.0256 176.594 98.9465C182.106 100.92 184.224 105.525 181.78 111.994C176.93 124.821 171.777 137.537 166.571 150.224C164.905 154.287 161.294 155.713 157.078 155.718C148.871 155.732 140.669 155.718 132.462 155.718V155.713Z" fill="white"/>
+<path d="M122.784 75.1574C122.784 66.0477 122.784 56.9379 122.784 47.833C122.784 42.9108 122.678 37.9886 122.808 33.0712C122.976 26.7899 127.572 21.9349 132.912 22.175C138.338 22.4199 142.223 26.7851 142.266 33.0231C142.348 45.1198 142.29 57.2165 142.29 69.3083C142.29 71.3012 142.29 73.2941 142.29 76.8141C146.435 72.8619 149.618 69.9086 152.706 66.8592C157.417 62.2059 163.502 61.5624 167.454 65.3802C171.689 69.4716 171.574 74.9845 166.69 79.9691C157.941 88.8964 149.1 97.7324 140.081 106.386C135.006 111.255 130.05 111.044 124.921 106.031C116.133 97.4346 107.432 88.7523 98.8021 80.0028C93.779 74.9077 93.5293 69.6829 97.8176 65.5194C101.899 61.5528 107.753 61.913 112.512 66.7968C115.456 69.8174 117.953 73.2797 120.652 76.5452C121.363 76.0842 122.069 75.628 122.779 75.167L122.784 75.1574Z" fill="white"/>
+<path d="M132.249 223.249C121.041 222.654 110.846 219.095 102.308 211.33C97.8898 207.311 97.1982 201.654 100.646 197.707C103.686 194.225 109.818 194.052 114.015 197.332C127.063 207.532 138.391 207.575 150.958 197.476C155.679 193.682 161.173 193.769 164.707 197.687C168.025 201.366 167.295 207.359 163.137 211.354C154.55 219.604 143.995 222.692 132.254 223.244L132.249 223.249Z" fill="white"/>
+<path d="M111.591 165.491C117.594 165.501 122.238 170 122.185 175.753C122.137 181.252 117.018 186.088 111.38 185.958C106.016 185.838 101.195 181.089 101.099 175.845C100.993 170.072 105.651 165.477 111.591 165.486V165.491Z" fill="white"/>
+<path d="M164.298 175.78C164.25 181.178 159.51 185.884 154.036 185.966C148.24 186.052 143.447 181.288 143.524 175.516C143.606 169.427 148.057 165.288 154.295 165.499C160.044 165.696 164.351 170.119 164.303 175.785L164.298 175.78Z" fill="white"/>
</svg>
diff --git a/packages/dashboard/src/components/spree/api-keys/api-key-table.tsx b/packages/dashboard/src/components/spree/api-keys/api-key-table.tsx
index 4a15229332..b35ae3c61f 100644
--- a/packages/dashboard/src/components/spree/api-keys/api-key-table.tsx
+++ b/packages/dashboard/src/components/spree/api-keys/api-key-table.tsx
@@ -291,6 +291,10 @@ function ApiKeyRow({
icon: <BanIcon className="size-4" />,
visible: !isRevoked,
disabled: revokeMutation.isPending,
+ // Revoking kills a live credential, and its confirm is already
+ // destructive — the row should say so before the click, not only
+ // in the dialog after it.
+ destructive: true,
onSelect: handleRevoke,
},
{
diff --git a/packages/dashboard/src/components/spree/customers/customer-store-credits-card.tsx b/packages/dashboard/src/components/spree/customers/customer-store-credits-card.tsx
index 127e3aa6e9..960802c325 100644
--- a/packages/dashboard/src/components/spree/customers/customer-store-credits-card.tsx
+++ b/packages/dashboard/src/components/spree/customers/customer-store-credits-card.tsx
@@ -127,7 +127,7 @@ export function CustomerStoreCreditsCard({ customer }: { customer: Customer }) {
{t('admin.actions.edit')}
</DropdownMenuItem>
<DropdownMenuItem
- className="text-destructive focus:text-destructive"
+ variant="destructive"
onClick={async () => {
if (
await confirm({
diff --git a/packages/dashboard/src/components/spree/deferred-product-membership-card.tsx b/packages/dashboard/src/components/spree/deferred-product-membership-card.tsx
index 7aec340ce0..ef86df428c 100644
--- a/packages/dashboard/src/components/spree/deferred-product-membership-card.tsx
+++ b/packages/dashboard/src/components/spree/deferred-product-membership-card.tsx
@@ -163,9 +163,8 @@ export function DeferredProductMembershipCard({
(selected.length > 0 ? (
<Button
type="button"
- variant="outline"
+ variant="destructive"
size="sm"
- className="text-destructive hover:text-destructive"
onClick={() => stageRemove(selected)}
>
<Trash2Icon className="size-4" />
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 0296bc079a..41295ce7b4 100644
--- a/packages/dashboard/src/components/spree/order-post-sale-cards.tsx
+++ b/packages/dashboard/src/components/spree/order-post-sale-cards.tsx
@@ -131,7 +131,7 @@ export function OrderExchangesCard({ order }: { order: Order }) {
<>
<DropdownMenuSeparator />
<DropdownMenuItem
- className="text-destructive focus:text-destructive"
+ variant="destructive"
onClick={async () => {
if (
await confirm({
@@ -264,17 +264,30 @@ export function OrderClaimsCard({ order }: { order: Order }) {
{t('admin.pages.orders.detail.claims.actions.resolve')}
</DropdownMenuItem>
)}
+ {['open', 'approved'].includes(claim.status) && <DropdownMenuSeparator />}
{claim.status === 'open' && (
- <DropdownMenuItem onClick={() => deny.mutate({ claimId: claim.id })}>
+ <DropdownMenuItem
+ variant="destructive"
+ onClick={async () => {
+ if (
+ await confirm({
+ message: t('admin.pages.orders.detail.claims.confirm.deny'),
+ variant: 'destructive',
+ confirmLabel: t('admin.pages.orders.detail.claims.actions.deny'),
+ })
+ ) {
+ deny.mutate({ claimId: claim.id })
+ }
+ }}
+ >
<XCircleIcon className="size-4" />
{t('admin.pages.orders.detail.claims.actions.deny')}
</DropdownMenuItem>
)}
{['open', 'approved'].includes(claim.status) && (
<>
- <DropdownMenuSeparator />
<DropdownMenuItem
- className="text-destructive focus:text-destructive"
+ variant="destructive"
onClick={async () => {
if (
await confirm({
diff --git a/packages/dashboard/src/components/spree/order-returns-card.tsx b/packages/dashboard/src/components/spree/order-returns-card.tsx
index 0d732c0e5d..b01920baf1 100644
--- a/packages/dashboard/src/components/spree/order-returns-card.tsx
+++ b/packages/dashboard/src/components/spree/order-returns-card.tsx
@@ -148,7 +148,7 @@ export function OrderReturnsCard({ order }: { order: Order }) {
<>
<DropdownMenuSeparator />
<DropdownMenuItem
- className="text-destructive focus:text-destructive"
+ variant="destructive"
onClick={async () => {
if (
await confirm({
diff --git a/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx b/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx
index 49c912275e..e78317424a 100644
--- a/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx
+++ b/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx
@@ -491,7 +491,7 @@ function FulfillmentRow({ order, fulfillment }: { order: Order; fulfillment: Ful
<>
<DropdownMenuSeparator />
<DropdownMenuItem
- className="text-destructive focus:text-destructive"
+ variant="destructive"
onClick={async () => {
if (
await confirm({
diff --git a/packages/dashboard/src/components/spree/orders/order-adjustments-cards.tsx b/packages/dashboard/src/components/spree/orders/order-adjustments-cards.tsx
index 854466b42f..03783a88d2 100644
--- a/packages/dashboard/src/components/spree/orders/order-adjustments-cards.tsx
+++ b/packages/dashboard/src/components/spree/orders/order-adjustments-cards.tsx
@@ -78,10 +78,7 @@ function AdjustmentDeleteCell({
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
- <DropdownMenuItem
- className="text-destructive focus:text-destructive"
- onClick={onDelete}
- >
+ <DropdownMenuItem variant="destructive" onClick={onDelete}>
<TrashIcon className="size-4" />
{i18n.t('admin.actions.delete')}
</DropdownMenuItem>
diff --git a/packages/dashboard/src/components/spree/orders/order-header.tsx b/packages/dashboard/src/components/spree/orders/order-header.tsx
index 51662ca736..a783da6824 100644
--- a/packages/dashboard/src/components/spree/orders/order-header.tsx
+++ b/packages/dashboard/src/components/spree/orders/order-header.tsx
@@ -3,7 +3,6 @@ import { adminClient, PageHeader, useResourceMutation, useStore } from '@spree/d
import {
Button,
DropdownMenuItem,
- DropdownMenuSeparator,
RelativeTime,
StatusBadge,
useConfirm,
@@ -124,9 +123,13 @@ export function OrderHeader({ order }: { order: Order }) {
<MailIcon className="size-4" />
{t('admin.orders.detail.dropdown.resend_confirmation')}
</DropdownMenuItem>
- <DropdownMenuSeparator />
</>
)}
+ </>
+ )
+
+ const destructiveItems = (
+ <>
{order.status !== 'canceled' && (
<DropdownMenuItem
variant="destructive"
@@ -191,6 +194,7 @@ export function OrderHeader({ order }: { order: Order }) {
</>
}
dropdownItems={dropdownItems}
+ destructiveItems={destructiveItems}
resource={{ id: order.id, number: order.number }}
jsonPreview={{
title: `Order ${order.number}`,
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 0bbdc3d27a..a9d69b98d6 100644
--- a/packages/dashboard/src/components/spree/orders/order-payments-card.tsx
+++ b/packages/dashboard/src/components/spree/orders/order-payments-card.tsx
@@ -139,7 +139,7 @@ export function PaymentsCard({ order }: { order: Order }) {
payment.status === 'pending' ||
payment.status === 'completed') && (
<DropdownMenuItem
- className="text-destructive focus:text-destructive"
+ variant="destructive"
onClick={async () => {
if (
await confirm({
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 50816cd47c..38375baeee 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
@@ -201,10 +201,10 @@ export function PriceListForm({
}
backTo="products/price-lists"
badges={priceList && <PriceListStatusBadge priceList={priceList} />}
- // `dropdownItems` rather than `onDelete`: the caller already runs
+ // `destructiveItems` rather than `onDelete`: the caller already runs
// its own confirm, naming the price list being deleted, and
// `onDelete` would stack the header's generic prompt in front of it.
- dropdownItems={
+ destructiveItems={
mode === 'edit' && onDelete && canDelete ? (
<DropdownMenuItem
variant="destructive"
@@ -663,13 +663,7 @@ function RuleRow({
</button>
<Can I="destroy" a={Subject.PriceRule}>
<div className="flex items-center pr-1.5">
- <Button
- type="button"
- size="icon-xs"
- variant="ghost"
- onClick={handleRemove}
- className="text-destructive hover:bg-destructive/10 hover:text-destructive"
- >
+ <Button type="button" size="icon-xs" variant="destructive-ghost" onClick={handleRemove}>
<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
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 03bb657d74..98dba347e9 100644
--- a/packages/dashboard/src/components/spree/promotion-editors/promotion-form.tsx
+++ b/packages/dashboard/src/components/spree/promotion-editors/promotion-form.tsx
@@ -246,10 +246,10 @@ export function PromotionForm({
// Delete lives in the more-actions menu, not beside Save: a
// destructive action next to the primary one is easy to hit by
// mistake, and the menu is where every other record page puts it.
- // `dropdownItems` rather than `onDelete`: the caller already runs
+ // `destructiveItems` rather than `onDelete`: the caller already runs
// its own confirm, naming the promotion being deleted, and
// `onDelete` would stack the header's generic prompt in front of it.
- dropdownItems={
+ destructiveItems={
mode === 'edit' && onDelete && canDelete ? (
<DropdownMenuItem variant="destructive" disabled={deletePending} onClick={onDelete}>
{t('admin.actions.delete')}
@@ -786,13 +786,7 @@ function RuleRow({
</button>
<Can I="destroy" a={Subject.PromotionRule}>
<div className="flex items-center pr-1.5">
- <Button
- type="button"
- size="icon-xs"
- variant="ghost"
- onClick={handleRemove}
- className="text-destructive hover:bg-destructive/10 hover:text-destructive"
- >
+ <Button type="button" size="icon-xs" variant="destructive-ghost" onClick={handleRemove}>
<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
@@ -1165,13 +1159,7 @@ function ActionRow({
</button>
<Can I="destroy" a={Subject.PromotionAction}>
<div className="flex items-center pr-1.5">
- <Button
- type="button"
- size="icon-xs"
- variant="ghost"
- onClick={handleRemove}
- className="text-destructive hover:bg-destructive/10 hover:text-destructive"
- >
+ <Button type="button" size="icon-xs" variant="destructive-ghost" onClick={handleRemove}>
<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
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 8b17d69de8..da58038e6b 100644
--- a/packages/dashboard/src/components/spree/tax-exemption-certificates-card.tsx
+++ b/packages/dashboard/src/components/spree/tax-exemption-certificates-card.tsx
@@ -297,7 +297,7 @@ export function TaxExemptionCertificatesCard({
)}
{canEdit && certificate.status !== 'revoked' && (
<DropdownMenuItem
- className="text-destructive focus:text-destructive"
+ variant="destructive"
disabled={revokeMutation.isPending}
onClick={() => handleRevoke(certificate)}
>
@@ -307,7 +307,7 @@ export function TaxExemptionCertificatesCard({
)}
{canEdit && certificate.can_be_deleted && (
<DropdownMenuItem
- className="text-destructive focus:text-destructive"
+ variant="destructive"
onClick={() => handleDelete(certificate)}
>
<TrashIcon className="size-4" />
diff --git a/packages/dashboard/src/components/spree/tax-identifiers-card.tsx b/packages/dashboard/src/components/spree/tax-identifiers-card.tsx
index 8d1fc30fe2..cc3f672538 100644
--- a/packages/dashboard/src/components/spree/tax-identifiers-card.tsx
+++ b/packages/dashboard/src/components/spree/tax-identifiers-card.tsx
@@ -188,7 +188,7 @@ export function TaxIdentifiersCard({
{t('admin.actions.edit')}
</DropdownMenuItem>
<DropdownMenuItem
- className="text-destructive focus:text-destructive"
+ variant="destructive"
onClick={() => handleDelete(identifier)}
>
<TrashIcon className="size-4" />
diff --git a/packages/dashboard/src/locales/ar.json b/packages/dashboard/src/locales/ar.json
index 2e7d9ab6d2..6a39abd028 100644
--- a/packages/dashboard/src/locales/ar.json
+++ b/packages/dashboard/src/locales/ar.json
@@ -2798,6 +2798,9 @@
"resolve_refund": "الحل بالاسترداد",
"resolve_replacement": "الحل بالاستبدال"
},
+ "confirm": {
+ "deny": "هل تريد رفض هذه المطالبة؟ لن يحصل العميل على استرداد أو استبدال."
+ },
"create_title": "مطالبة جديدة",
"empty": "لا توجد مطالبات لهذا الطلب.",
"refund_amount": "مبلغ الاسترداد",
diff --git a/packages/dashboard/src/locales/de.json b/packages/dashboard/src/locales/de.json
index 4342494c00..45adad401e 100644
--- a/packages/dashboard/src/locales/de.json
+++ b/packages/dashboard/src/locales/de.json
@@ -2785,6 +2785,9 @@
"resolve_refund": "Mit Erstattung lösen",
"resolve_replacement": "Mit Ersatz lösen"
},
+ "confirm": {
+ "deny": "Diese Reklamation ablehnen? Die Kundin oder der Kunde erhält weder eine Rückerstattung noch Ersatz."
+ },
"create_title": "Neue Reklamation",
"empty": "Keine Reklamationen für diese Bestellung.",
"refund_amount": "Erstattungsbetrag",
diff --git a/packages/dashboard/src/locales/en.json b/packages/dashboard/src/locales/en.json
index 9759bce4f6..a527e8dee8 100644
--- a/packages/dashboard/src/locales/en.json
+++ b/packages/dashboard/src/locales/en.json
@@ -2785,6 +2785,9 @@
"resolve_refund": "Resolve with refund",
"resolve_replacement": "Resolve with replacement"
},
+ "confirm": {
+ "deny": "Deny this claim? The customer will not receive a refund or replacement."
+ },
"create_title": "New claim",
"empty": "No claims for this order.",
"refund_amount": "Refund amount",
diff --git a/packages/dashboard/src/locales/fr.json b/packages/dashboard/src/locales/fr.json
index 517d55ef73..6d2c20b915 100644
--- a/packages/dashboard/src/locales/fr.json
+++ b/packages/dashboard/src/locales/fr.json
@@ -2785,6 +2785,9 @@
"resolve_refund": "Résoudre par remboursement",
"resolve_replacement": "Résoudre par remplacement"
},
+ "confirm": {
+ "deny": "Refuser cette réclamation ? Le client ne recevra ni remboursement ni remplacement."
+ },
"create_title": "Nouvelle réclamation",
"empty": "Aucune réclamation pour cette commande.",
"refund_amount": "Montant du remboursement",
diff --git a/packages/dashboard/src/locales/pl.json b/packages/dashboard/src/locales/pl.json
index ab09a1c874..95e833919f 100644
--- a/packages/dashboard/src/locales/pl.json
+++ b/packages/dashboard/src/locales/pl.json
@@ -2811,6 +2811,9 @@
"resolve_refund": "Rozwiąż zwrotem płatności",
"resolve_replacement": "Rozwiąż zamiennikiem"
},
+ "confirm": {
+ "deny": "Odrzucić to zgłoszenie? Klient nie otrzyma zwrotu pieniędzy ani wymiany."
+ },
"create_title": "Nowa reklamacja",
"empty": "Brak reklamacji dla tego zamówienia.",
"refund_amount": "Kwota zwrotu",
diff --git a/packages/dashboard/src/locales/zh-CN.json b/packages/dashboard/src/locales/zh-CN.json
index d4e5ad67ae..1de1a9d496 100644
--- a/packages/dashboard/src/locales/zh-CN.json
+++ b/packages/dashboard/src/locales/zh-CN.json
@@ -2778,6 +2778,9 @@
"resolve_refund": "以退款解决",
"resolve_replacement": "以换货解决"
},
+ "confirm": {
+ "deny": "拒绝此索赔?客户将不会收到退款或补发商品。"
+ },
"create_title": "新建索赔",
"empty": "此订单暂无索赔。",
"refund_amount": "退款金额",
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/companies/$companyId.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/companies/$companyId.tsx
index 16c5451a99..0189f2feb0 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/companies/$companyId.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/companies/$companyId.tsx
@@ -680,7 +680,7 @@ function MembersCard({ company, canEdit }: { company: Company; canEdit: boolean
context={{ membership, companyId: company.id }}
/>
<DropdownMenuItem
- className="text-destructive focus:text-destructive"
+ variant="destructive"
onClick={() => handleRemove(membership)}
>
<TrashIcon className="size-4" />
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/getting-started.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/getting-started.tsx
index b2ab6e7053..1efee1655a 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/getting-started.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/getting-started.tsx
@@ -91,7 +91,7 @@ function GettingStartedPage() {
return (
<Card key={task.name} className="overflow-hidden py-0">
<Collapsible defaultOpen={task.name === firstPending}>
- <CollapsibleTrigger className="group flex w-full cursor-pointer items-center gap-3 p-4 text-left hover:bg-muted/50">
+ <CollapsibleTrigger className="group flex w-full cursor-pointer items-center gap-3 p-4 text-left hover:bg-accent">
{task.done ? (
<CheckCircle2Icon className="size-5 shrink-0 text-green-600" />
) : (
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/products/options.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/products/options.tsx
index 0132b8fad0..500f4c3fab 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/products/options.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/products/options.tsx
@@ -695,12 +695,11 @@ function SortableOptionValueRow({
<TableCell className="w-10 text-right">
<Button
type="button"
- variant="ghost"
+ variant="destructive-ghost"
size="icon-sm"
aria-label={t('admin.a11y.remove_value')}
onPointerDown={(e) => e.stopPropagation()}
onClick={onRemove}
- className="text-destructive hover:bg-destructive/10 hover:text-destructive"
>
<Trash2Icon className="size-4" />
</Button>
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/sellers/$sellerId.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/sellers/$sellerId.tsx
index 2836f3caba..debe23ae93 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/sellers/$sellerId.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/sellers/$sellerId.tsx
@@ -198,20 +198,27 @@ function SellerBody({ seller }: { seller: Seller }) {
const dropdownItems = canEdit ? (
<>
- {canSuspend && (
- <DropdownMenuItem onClick={handleSuspend}>
- <PauseIcon className="size-4" />
- {t('admin.sellers.actions.suspend')}
- </DropdownMenuItem>
- )}
{status === 'ready_for_review' && (
<DropdownMenuItem onClick={handleReopenOnboarding}>
<UndoIcon className="size-4" />
{t('admin.sellers.actions.reopen_onboarding')}
</DropdownMenuItem>
)}
+ </>
+ ) : null
+
+ // Suspend and Reject both confirm destructively, so they read as destructive
+ // in the menu too rather than as plain rows above the standard actions.
+ const destructiveItems = canEdit ? (
+ <>
+ {canSuspend && (
+ <DropdownMenuItem variant="destructive" onClick={handleSuspend}>
+ <PauseIcon className="size-4" />
+ {t('admin.sellers.actions.suspend')}
+ </DropdownMenuItem>
+ )}
{canReject && (
- <DropdownMenuItem onClick={handleReject}>
+ <DropdownMenuItem variant="destructive" onClick={handleReject}>
<BanIcon className="size-4" />
{t('admin.sellers.actions.reject')}
</DropdownMenuItem>
@@ -242,6 +249,7 @@ function SellerBody({ seller }: { seller: Seller }) {
}
actions={primaryAction}
dropdownItems={dropdownItems}
+ destructiveItems={destructiveItems}
resource={{ id: seller.id }}
jsonPreview={{
title: `Seller ${seller.name}`,
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/index.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/index.tsx
index 4605885b1c..6327261ea5 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/settings/index.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/index.tsx
@@ -90,7 +90,7 @@ function SettingsCard({ entry }: { entry: SettingsNavEntry }) {
const description = resolveNavDescription(entry, t)
return (
- <Card className="p-0 transition-colors hover:bg-accent/20">
+ <Card className="p-0 transition-colors hover:bg-accent hover:border-neutral-300 dark:hover:border-neutral-800">
{/* The whole card is the target — a small title-only link would fail the
44px minimum on touch and leaves most of the card dead to a click. */}
{/* Paths come from a runtime registry plugins extend, so they can't be
diff --git a/packages/seller-dashboard/src/pages/home.tsx b/packages/seller-dashboard/src/pages/home.tsx
index 0d1554d6ba..d5663f4212 100644
--- a/packages/seller-dashboard/src/pages/home.tsx
+++ b/packages/seller-dashboard/src/pages/home.tsx
@@ -1,4 +1,4 @@
-import { progressPercentage } from '@spree/dashboard-core'
+import { PageHeader, progressPercentage } from '@spree/dashboard-core'
import {
Button,
Card,
@@ -54,10 +54,7 @@ export function HomePage() {
return (
<div className="flex flex-col gap-6">
- <div>
- <h1 className="font-medium text-2xl">{t('home.title', { name: profile.name })}</h1>
- <p className="text-muted-foreground text-sm">{t('home.subtitle')}</p>
- </div>
+ <PageHeader title={t('home.title', { name: profile.name })} subtitle={t('home.subtitle')} />
{/* Setup leads while it is unfinished — until a seller is approved it is
the only thing on this page that matters. It drops away once done
diff --git a/packages/seller-dashboard/src/pages/onboarding.tsx b/packages/seller-dashboard/src/pages/onboarding.tsx
index 188688ecdf..b1258b5ca3 100644
--- a/packages/seller-dashboard/src/pages/onboarding.tsx
+++ b/packages/seller-dashboard/src/pages/onboarding.tsx
@@ -2,6 +2,7 @@ import {
EMPTY_FILE_UPLOAD_VALUE,
FileUploadField,
type FileUploadValue,
+ PageHeader,
progressPercentage,
} from '@spree/dashboard-core'
import {
@@ -82,10 +83,7 @@ export function OnboardingPage() {
return (
<div className="flex flex-col gap-6">
- <div>
- <h1 className="font-medium text-2xl">{t('onboarding.title')}</h1>
- <p className="text-muted-foreground text-sm">{t('onboarding.subtitle')}</p>
- </div>
+ <PageHeader title={t('onboarding.title')} subtitle={t('onboarding.subtitle')} />
<Card>
<CardHeader className="flex-row items-center justify-between gap-4">
diff --git a/packages/seller-dashboard/src/pages/order.tsx b/packages/seller-dashboard/src/pages/order.tsx
index daad9b8fee..5e9ffd532d 100644
--- a/packages/seller-dashboard/src/pages/order.tsx
+++ b/packages/seller-dashboard/src/pages/order.tsx
@@ -1,3 +1,4 @@
+import { PageHeader } from '@spree/dashboard-core'
import {
AddressBlock,
Button,
@@ -6,6 +7,7 @@ import {
CardContent,
CardHeader,
CardTitle,
+ DropdownMenuItem,
Field,
FieldLabel,
Input,
@@ -73,22 +75,28 @@ export function OrderPage() {
return (
<div className="flex flex-col gap-4">
- <div className="flex items-start justify-between gap-4">
- <div>
- <h1 className="font-medium text-2xl">{order.number}</h1>
- <p className="text-muted-foreground text-sm">
- {order.completed_at ? new Date(order.completed_at).toLocaleString() : null}
- </p>
- </div>
- <div className="flex items-center gap-2">
- {order.fulfillment_status && <StatusBadge status={order.fulfillment_status} />}
- {cancelable && (
- <Button variant="outline" disabled={cancel.isPending} onClick={handleCancel}>
+ {/* Cancel goes in the menu's destructive group rather than beside the
+ title: a destructive action sitting next to the page's own heading is
+ easy to hit by mistake, and this is where the operator dashboard puts
+ the same action. */}
+ <PageHeader
+ title={order.number}
+ backTo="orders"
+ subtitle={order.completed_at ? new Date(order.completed_at).toLocaleString() : undefined}
+ badges={order.fulfillment_status && <StatusBadge status={order.fulfillment_status} />}
+ resource={{ id: order.id, number: order.number }}
+ destructiveItems={
+ cancelable ? (
+ <DropdownMenuItem
+ variant="destructive"
+ disabled={cancel.isPending}
+ onClick={handleCancel}
+ >
{t('orders.cancel')}
- </Button>
- )}
- </div>
- </div>
+ </DropdownMenuItem>
+ ) : undefined
+ }
+ />
<Card>
<CardHeader>
diff --git a/packages/seller-dashboard/src/pages/orders.tsx b/packages/seller-dashboard/src/pages/orders.tsx
index c533f9e572..61bcddd03e 100644
--- a/packages/seller-dashboard/src/pages/orders.tsx
+++ b/packages/seller-dashboard/src/pages/orders.tsx
@@ -1,4 +1,4 @@
-import { ExportButton, type ResourceSearch, ResourceTable } from '@spree/dashboard-core'
+import { ExportButton, PageHeader, type ResourceSearch, ResourceTable } from '@spree/dashboard-core'
import { useRowClickBridge } from '@spree/dashboard-ui'
import type { Order } from '@spree/seller-sdk'
import { useNavigate, useParams } from '@tanstack/react-router'
@@ -18,7 +18,7 @@ export function OrdersPage({ search }: { search: ResourceSearch }) {
return (
<div className="flex flex-col gap-4">
- <h1 className="font-medium text-2xl">{t('orders.title')}</h1>
+ <PageHeader title={t('orders.title')} />
<ResourceTable<Order>
tableKey="seller-orders"
diff --git a/packages/seller-dashboard/src/pages/policies.tsx b/packages/seller-dashboard/src/pages/policies.tsx
index 48db002358..73fb351c0e 100644
--- a/packages/seller-dashboard/src/pages/policies.tsx
+++ b/packages/seller-dashboard/src/pages/policies.tsx
@@ -1,4 +1,5 @@
import {
+ PageHeader,
type ResourceSearch,
ResourceTable,
useResourceKey,
@@ -118,10 +119,7 @@ export function PoliciesPage({ search }: { search: ResourceSearch }) {
return (
<div className="flex flex-col gap-6">
- <div>
- <h1 className="font-medium text-2xl">{t('policies.title')}</h1>
- <p className="text-muted-foreground text-sm">{t('policies.description')}</p>
- </div>
+ <PageHeader title={t('policies.title')} subtitle={t('policies.description')} />
{outstanding.length > 0 && (
<Card>
diff --git a/packages/seller-dashboard/src/pages/products.tsx b/packages/seller-dashboard/src/pages/products.tsx
index 8cda8ab2a3..e7c74d8827 100644
--- a/packages/seller-dashboard/src/pages/products.tsx
+++ b/packages/seller-dashboard/src/pages/products.tsx
@@ -8,6 +8,7 @@ import {
ExportButton,
ImportButton,
ImportWizardDialog,
+ PageHeader,
ResourceTable,
Subject,
} from '@spree/dashboard-core'
@@ -147,7 +148,7 @@ export function ProductsPage({ search }: { search: ResourceSearch & { import?: s
return (
<div className="flex flex-col gap-4">
- <h1 className="font-medium text-2xl">{t('products.title')}</h1>
+ <PageHeader title={t('products.title')} />
<ResourceTable<Product>
tableKey="seller-products"
diff --git a/packages/seller-dashboard/src/pages/profile.tsx b/packages/seller-dashboard/src/pages/profile.tsx
index aef9190fb7..bac6251dcb 100644
--- a/packages/seller-dashboard/src/pages/profile.tsx
+++ b/packages/seller-dashboard/src/pages/profile.tsx
@@ -1,3 +1,4 @@
+import { PageHeader } from '@spree/dashboard-core'
import {
Button,
Card,
@@ -81,12 +82,7 @@ export function ProfilePage() {
return (
<>
<ResourceLayout
- header={
- <div>
- <h1 className="font-medium text-2xl">{profile.name}</h1>
- <p className="text-muted-foreground text-sm">{t('profile.subtitle')}</p>
- </div>
- }
+ header={<PageHeader title={profile.name} subtitle={t('profile.subtitle')} />}
main={<BrandCard profile={profile} onEdit={() => setEditing(true)} />}
sidebar={
<>
diff --git a/packages/seller-dashboard/src/pages/team.tsx b/packages/seller-dashboard/src/pages/team.tsx
index bc59479d5c..de30faae45 100644
--- a/packages/seller-dashboard/src/pages/team.tsx
+++ b/packages/seller-dashboard/src/pages/team.tsx
@@ -1,4 +1,4 @@
-import { Can, getInitials, Slot } from '@spree/dashboard-core'
+import { Can, getInitials, PageHeader, Slot } from '@spree/dashboard-core'
import {
Avatar,
AvatarFallback,
@@ -86,26 +86,26 @@ export function TeamPage() {
return (
<div className="flex flex-col gap-6">
- <div className="flex items-start justify-between gap-4">
- <div>
- <h1 className="font-medium text-2xl">{t('team.title')}</h1>
- <p className="text-muted-foreground text-sm">{t('team.subtitle')}</p>
- </div>
- {/* Purely a UX gate — the API refuses the write regardless. Same
- `<Can>` the operator's dashboard uses, reading the CanCanCan rules
- the seller `/me` serializes. */}
- <div className="flex items-center gap-2">
- {/* A marketplace adds its own actions here via
- `defineDashboardPlugin({ slots: { 'seller.team.actions': [...] } })`. */}
- <Slot name="seller.team.actions" context={{ sellerId }} />
- <Can I="update" a="seller_profile">
- <Button size="sm" onClick={() => setInviteOpen(true)}>
- <PlusIcon className="size-4" />
- {t('team.invite_cta')}
- </Button>
- </Can>
- </div>
- </div>
+ <PageHeader
+ title={t('team.title')}
+ subtitle={t('team.subtitle')}
+ actions={
+ <>
+ {/* A marketplace adds its own actions here via
+ `defineDashboardPlugin({ slots: { 'seller.team.actions': [...] } })`. */}
+ <Slot name="seller.team.actions" context={{ sellerId }} />
+ {/* Purely a UX gate — the API refuses the write regardless. Same
+ `<Can>` the operator's dashboard uses, reading the CanCanCan rules
+ the seller `/me` serializes. */}
+ <Can I="update" a="seller_profile">
+ <Button size="sm" onClick={() => setInviteOpen(true)}>
+ <PlusIcon className="size-4" />
+ {t('team.invite_cta')}
+ </Button>
+ </Can>
+ </>
+ }
+ />
<MembersCard members={members.data?.data ?? []} loading={members.isLoading} />