@spunto/design-system 0.7.2 → 0.9.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 CHANGED
@@ -55,10 +55,46 @@ const nextConfig = { transpilePackages: ["@spunto/design-system"] }
55
55
  xterm.js surface: mount, shared dark ANSI theme, fit-on-resize. No opinion on where
56
56
  bytes come from (WebSocket, SSE, a static string) — feed it via the `write`/`writeln`
57
57
  ref handle. Opt-in addons through `options` (currently `webLinks`, clickable URLs).
58
+ - _ImagePull_ — `ImagePull` (+`PullLayer`, `PullLayerStatus`, `ImagePullState`), a Docker
59
+ image pull drawn as a real UI instead of ANSI art redrawn in a terminal: **one** overall
60
+ bar whose colour follows the phase (flame downloading → amber unpacking over it → solid
61
+ green), with the per-layer detail in an expandable list. Presentational only — hand it a
62
+ snapshot, it draws; throughput and ETA are derived internally. Same `#09090b` surface and
63
+ ANSI palette as `Terminal`, so the two stack into one object.
58
64
  - **`SpuntoProvider` + `toast()`** — the imperative toast system (see below). The
59
65
  provider is also the umbrella that mounts the tooltip delay group and the overlay
60
66
  portal container the dialogs/selects render into.
61
67
 
68
+ ## Domain components — `@spunto/design-system/workers`
69
+
70
+ Everything above is domain-free: a `Button` knows nothing about Spunto. Components
71
+ that **do** know a Spunto concept live behind their own entry point, so the root
72
+ export stays primitives-only and a third-party consumer never carries the notion
73
+ of a worker. **The rule for what comes next: any new component that knows a domain
74
+ concept goes behind a domain sub-export, never in the root entry.**
75
+
76
+ ```tsx
77
+ import { Button, Card } from "@spunto/design-system" // primitives
78
+ import { WorkerCard } from "@spunto/design-system/workers" // domain
79
+ ```
80
+
81
+ - **`WorkerCard`** — a Spunto worker as a card: state, author, node, setup
82
+ progress, git branches, resources, banners, actions. **Purely presentational** —
83
+ hand it a snapshot plus slots and it draws. The rule that keeps it that way:
84
+ *everything that CALLS the API is a slot or a callback; everything that DRAWS is
85
+ in the component.* So the `⋯` menu (`actions`), the footer (`footer`), the link
86
+ (`href` + `render.link`, never `next/link`), the rebuild (`onRebuild`) and the
87
+ tag persistence (`onAddTag`/`onRemoveTag`) all stay in the app.
88
+ - **Its bricks, exported individually** because the table view assembles them
89
+ differently: `WorkerStatusDot`/`WorkerStatusPill` (+`resolveWorkerStatus`,
90
+ `workerStatusConfig`), `SetupProgress` (+`setupProgress`, `phaseLabel`,
91
+ `setupTotalMs`), `StepIndicator`, `ResourceBars`, `GitBranchChips`/
92
+ `GitStatusSummary`, `TagChips` (+`tagColor`), `CreatorAvatar`.
93
+ - **Types are structural**, never the apps' OpenAPI types: the dashboard and
94
+ Spunto Lite model a worker differently, so `WorkerCardWorker` asks for the
95
+ minimum, everything optional but `id`, and an unknown state falls back to
96
+ `pending` instead of throwing.
97
+
62
98
  ## Toasts — `SpuntoProvider` + `toast()`
63
99
 
64
100
  `SpuntoProvider` is the design system's client umbrella provider. Mount it once
@@ -131,3 +167,7 @@ automatically (see `showcase/vite-plugin-llms.ts`).
131
167
  ## Peer requirements
132
168
 
133
169
  - React 19+, and a **Tailwind CSS v4** pipeline in the consuming app.
170
+ - `lucide-react` is a **regular dependency** (since `0.9.0`): the worker
171
+ components use ~15 icons, and inlining them as SVG or passing them all as props
172
+ would have been worse than the dependency. It's tree-shakable and both apps
173
+ already ship it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spunto/design-system",
3
- "version": "0.7.2",
3
+ "version": "0.9.0",
4
4
  "description": "Spunto's shared design system — warm/flame tokens, color constants, and UI primitives.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -33,6 +33,10 @@
33
33
  "types": "./src/colors.ts",
34
34
  "import": "./src/colors.ts"
35
35
  },
36
+ "./workers": {
37
+ "types": "./src/components/workers/index.ts",
38
+ "import": "./src/components/workers/index.ts"
39
+ },
36
40
  "./fonts": {
37
41
  "types": "./src/components/fonts.tsx",
38
42
  "import": "./src/components/fonts.tsx"
@@ -53,6 +57,7 @@
53
57
  "@xterm/xterm": "^6.0.0",
54
58
  "class-variance-authority": "^0.7.1",
55
59
  "clsx": "^2.1.1",
60
+ "lucide-react": "^1.7.0",
56
61
  "tailwind-merge": "^3.6.0"
57
62
  },
58
63
  "peerDependencies": {