@spree/dashboard-ui 1.0.0-rc.6 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +3 -3
- package/src/spree/form-actions.tsx +5 -3
- package/src/spree/icons.ts +1 -0
- package/src/ui/badge.tsx +9 -0
- package/src/ui/tabs.tsx +17 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Spree Dashboard design system. Shadcn primitives + headless composed components + design tokens.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Docs: [React Dashboard](https://spreecommerce.org/docs/developer/dashboard/overview).
|
|
6
6
|
|
|
7
7
|
## What's inside
|
|
8
8
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spree/dashboard-ui",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "Spree Dashboard design system — shadcn primitives, headless composed components, and design tokens. Source-only package; consumers compile via their own Vite/Tailwind setup.
|
|
4
|
+
"version": "6.0.0",
|
|
5
|
+
"description": "Spree Dashboard design system — shadcn primitives, headless composed components, and design tokens. Source-only package; consumers compile via their own Vite/Tailwind setup.",
|
|
6
6
|
"author": "Vendo Connect Inc.",
|
|
7
7
|
"homepage": "https://spreecommerce.org",
|
|
8
8
|
"repository": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"shadcn": "4.22.1",
|
|
87
87
|
"tailwind-merge": "3.7.0",
|
|
88
88
|
"tw-animate-css": "1.4.0",
|
|
89
|
-
"@spree/core": "^0.
|
|
89
|
+
"@spree/core": "^6.0.0"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@types/react": "^19.2.14",
|
|
@@ -39,9 +39,11 @@ export function FormSaveButton<TFieldValues extends FieldValues>({
|
|
|
39
39
|
return (
|
|
40
40
|
<Button type="submit" disabled={!(isDirty || dirty) || isSubmitting}>
|
|
41
41
|
{isSubmitting && <Loader2Icon className="animate-spin" />}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
<span>
|
|
43
|
+
{isSubmitting
|
|
44
|
+
? (savingLabel ?? t('admin.actions.saving'))
|
|
45
|
+
: (label ?? t('admin.actions.save'))}
|
|
46
|
+
</span>
|
|
45
47
|
</Button>
|
|
46
48
|
)
|
|
47
49
|
}
|
package/src/spree/icons.ts
CHANGED
package/src/ui/badge.tsx
CHANGED
|
@@ -188,6 +188,15 @@ const statusToneMap: Record<string, StatusTone> = {
|
|
|
188
188
|
// same green/red the rest of the app uses saves them parsing the word.
|
|
189
189
|
true: 'success',
|
|
190
190
|
false: 'destructive',
|
|
191
|
+
// Maintenance task runs: amber while a worker holds or is about to release
|
|
192
|
+
// the run, blue while it waits for one.
|
|
193
|
+
enqueued: 'info',
|
|
194
|
+
running: 'warning',
|
|
195
|
+
interrupted: 'info',
|
|
196
|
+
cancelling: 'warning',
|
|
197
|
+
cancelled: 'destructive',
|
|
198
|
+
succeeded: 'success',
|
|
199
|
+
errored: 'destructive',
|
|
191
200
|
} satisfies Record<BuiltInStatus, StatusTone> & Record<string, StatusTone>
|
|
192
201
|
|
|
193
202
|
// Dot fills, by tone. These read the same `--status-*` ramps the tinted Badge
|
package/src/ui/tabs.tsx
CHANGED
|
@@ -41,7 +41,17 @@ function TabsList({
|
|
|
41
41
|
)
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
/**
|
|
45
|
+
* A tab. Pass `count` to append a tally — the number of steps outstanding, or
|
|
46
|
+
* of records in the panel — which is what tells an operator whether a tab is
|
|
47
|
+
* worth opening before they open it.
|
|
48
|
+
*/
|
|
49
|
+
function TabsTrigger({
|
|
50
|
+
className,
|
|
51
|
+
children,
|
|
52
|
+
count,
|
|
53
|
+
...props
|
|
54
|
+
}: React.ComponentProps<typeof TabsPrimitive.Tab> & { count?: number }) {
|
|
45
55
|
return (
|
|
46
56
|
<TabsPrimitive.Tab
|
|
47
57
|
data-slot="tabs-trigger"
|
|
@@ -67,7 +77,12 @@ function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPr
|
|
|
67
77
|
className,
|
|
68
78
|
)}
|
|
69
79
|
{...props}
|
|
70
|
-
|
|
80
|
+
>
|
|
81
|
+
{children}
|
|
82
|
+
{count !== undefined && (
|
|
83
|
+
<span className="rounded-full bg-muted px-1.5 py-0.5 text-xs tabular-nums">{count}</span>
|
|
84
|
+
)}
|
|
85
|
+
</TabsPrimitive.Tab>
|
|
71
86
|
)
|
|
72
87
|
}
|
|
73
88
|
|