@vegastack/design 0.13.0 → 0.14.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/bin/doctor.mjs CHANGED
@@ -1188,6 +1188,35 @@ function lineIndex(text) {
1188
1188
  };
1189
1189
  }
1190
1190
 
1191
+ /**
1192
+ * COL-25 (operator, 2026-11-13): every check is the blue accent and never green. The lucide check
1193
+ * icons, by the name they are imported under, and the inks that make one green.
1194
+ */
1195
+ const CHECK_ICON =
1196
+ /^(?:Check|CheckCheck|CircleCheck|CircleCheckBig|CheckCircle2?|BookmarkCheck|SquareCheck|SquareCheckBig|ListChecks|CopyCheck|BadgeCheck)(?:Icon)?$/;
1197
+ // Read against a class token's utility (variants removed), so a word like "success" in a label or
1198
+ // a comparison is not an ink.
1199
+ const GREEN_INK =
1200
+ /^-?(?:text|bg|fill|stroke|border|ring|outline|decoration)-(?:success|green|emerald|tag-green)(?:-|\/|$)/;
1201
+ const greenToken = (token) => GREEN_INK.test(utilityOf(token));
1202
+ const greenClasses = (text) =>
1203
+ [...text.matchAll(/(["'`])((?:(?!\1)[^\\]|\\.)*)\1/g)]
1204
+ .flatMap((m) => m[2].split(/\s+/))
1205
+ .filter((token) => token && greenToken(token));
1206
+
1207
+ /** The local names a file imports lucide's check icons under. */
1208
+ export function checkIconLocals(src) {
1209
+ const names = new Set();
1210
+ for (const m of src.matchAll(
1211
+ /\bimport\s+(?:type\s+)?\{([^}]*)\}\s*from\s*["']lucide-react["']/g,
1212
+ ))
1213
+ for (const part of m[1].split(",")) {
1214
+ const p = /^\s*(?:type\s+)?([\w$]+)(?:\s+as\s+([\w$]+))?\s*$/.exec(part);
1215
+ if (p && CHECK_ICON.test(p[1])) names.add(p[2] ?? p[1]);
1216
+ }
1217
+ return names;
1218
+ }
1219
+
1191
1220
  /**
1192
1221
  * The four composition rules over the project's own source (the ui alias dirs, node_modules and
1193
1222
  * build output skipped): `!` on a DS part, a width class on a popover or menu popup, a hand-written
@@ -1236,6 +1265,7 @@ export function scanComposition(root, { skipDirs = [], uiAlias = null } = {}) {
1236
1265
  const important = [];
1237
1266
  const widths = [];
1238
1267
  const headers = [];
1268
+ const greenChecks = [];
1239
1269
  const pages = [];
1240
1270
  const map = new Map();
1241
1271
  const conflicts = [];
@@ -1267,6 +1297,26 @@ export function scanComposition(root, { skipDirs = [], uiAlias = null } = {}) {
1267
1297
  hint: `${known.file}:${known.line} already says "${known.width}"`,
1268
1298
  });
1269
1299
  }
1300
+ const checks = checkIconLocals(src);
1301
+ if (checks.size > 0) {
1302
+ // A check icon paired with a green class in one object — `{ icon: CircleCheck, tone:
1303
+ // "text-success-text" }` — the map a status table renders from.
1304
+ const names = [...checks].join("|");
1305
+ for (const m of src.matchAll(
1306
+ new RegExp(`\\{[^{}]*\\b(?:${names})\\b[^{}]*\\}`, "g"),
1307
+ )) {
1308
+ // A JSX expression (`{ok && <CircleCheck … />}`) is the tag rule's, not a map.
1309
+ if (m[0].includes("<")) continue;
1310
+ const [green] = greenClasses(m[0]);
1311
+ if (green)
1312
+ greenChecks.push({
1313
+ file,
1314
+ line: lineAt(m.index + m[0].indexOf(green)),
1315
+ match: green,
1316
+ hint: "a check icon paired with a green class",
1317
+ });
1318
+ }
1319
+ }
1270
1320
  if (!/\.[jt]sx$/.test(full) || !read.includes("<")) continue;
1271
1321
 
1272
1322
  const imports = uiImports(src, full, { uiAliases, uiDirs });
@@ -1281,6 +1331,62 @@ export function scanComposition(root, { skipDirs = [], uiAlias = null } = {}) {
1281
1331
  }
1282
1332
  continue;
1283
1333
  }
1334
+ if (checks.has(tag.name)) {
1335
+ const cls = tagAttributes(tag, scan).get("className");
1336
+ if (cls && cls.kind !== "flag") {
1337
+ for (const { token, at } of classTokens(cls, scan, read))
1338
+ if (greenToken(token))
1339
+ greenChecks.push({
1340
+ file,
1341
+ line: lineAt(at),
1342
+ match: `<${tag.name}> ${token}`,
1343
+ });
1344
+ // `className={cls}`: the nearest `const cls = …` above the tag (its own scope in
1345
+ // practice), read to the end of its initializer, across lines.
1346
+ const name =
1347
+ cls.kind === "expr"
1348
+ ? /^\s*([\w$]+)\s*$/.exec(scan.slice(cls.from, cls.to))?.[1]
1349
+ : null;
1350
+ if (name) {
1351
+ // The nearest declaration still in scope at the tag: one whose block has not closed
1352
+ // between it and the tag (braces counted on the string- and comment-masked source).
1353
+ const visible = (at) => {
1354
+ let depth = 0;
1355
+ for (let k = at; k < tag.index; k += 1) {
1356
+ if (scan[k] === "{") depth += 1;
1357
+ else if (scan[k] === "}" && (depth -= 1) < 0) return false;
1358
+ }
1359
+ return true;
1360
+ };
1361
+ let decl = null;
1362
+ for (const d of scan.matchAll(
1363
+ new RegExp(`\\b(?:const|let)\\s+${name}\\s*=`, "g"),
1364
+ ))
1365
+ if (d.index < tag.index && visible(d.index)) decl = d;
1366
+ if (decl) {
1367
+ let depth = 0;
1368
+ let k = decl.index + decl[0].length;
1369
+ for (; k < scan.length; k += 1) {
1370
+ const c = scan[k];
1371
+ if ("([{".includes(c)) depth += 1;
1372
+ else if (")]}".includes(c)) {
1373
+ if (depth === 0) break;
1374
+ depth -= 1;
1375
+ } else if ((c === ";" || c === "\n") && depth === 0) break;
1376
+ }
1377
+ for (const token of greenClasses(
1378
+ src.slice(decl.index + decl[0].length, k),
1379
+ ))
1380
+ greenChecks.push({
1381
+ file,
1382
+ line: lineAt(tag.index),
1383
+ match: `<${tag.name}> ${token}`,
1384
+ hint: `via ${name}`,
1385
+ });
1386
+ }
1387
+ }
1388
+ }
1389
+ }
1284
1390
  if (tag.name === "header" && overlays.length > 0) {
1285
1391
  const inside = overlays[overlays.length - 1];
1286
1392
  headers.push({
@@ -1380,6 +1486,7 @@ export function scanComposition(root, { skipDirs = [], uiAlias = null } = {}) {
1380
1486
  important: important.sort(byPlace),
1381
1487
  widths: widths.sort(byPlace),
1382
1488
  headers: headers.sort(byPlace),
1489
+ greenChecks: greenChecks.sort(byPlace),
1383
1490
  routeMap: {
1384
1491
  rows: map.size,
1385
1492
  files: [...new Set([...map.values()].map((r) => r.file))].sort(),
@@ -1674,6 +1781,21 @@ export function main(argv = []) {
1674
1781
  "use the overlay's own header part (SheetHeader · DrawerHeader · DialogHeader · AlertDialogHeader), or RecordPeek for a record panel",
1675
1782
  "no overlay content hand-writes a <header> (same-file nesting only)",
1676
1783
  );
1784
+ // A green check is a failure whatever --strict says (COL-25): the rule is the operator's, and a
1785
+ // check has one colour.
1786
+ if (composition.greenChecks.length === 0)
1787
+ ok("check colour", "no check icon is drawn in a success or green ink");
1788
+ else
1789
+ results.push({
1790
+ level: "fail",
1791
+ name: "check colour",
1792
+ detail: `${composition.greenChecks.length} check icon(s) in a success or green ink`,
1793
+ fix: "a check is the blue accent — `text-info-text`, or the StatusGlyph registry item — never `text-success*` or green (COL-25)",
1794
+ findings: composition.greenChecks.map(
1795
+ (f) =>
1796
+ `${f.file}:${f.line} ${f.match}${f.hint ? ` → ${f.hint}` : ""}`,
1797
+ ),
1798
+ });
1677
1799
  const rm = composition.routeMap;
1678
1800
  const coverage = `${rm.compared} App Router page/layout size(s) compared${
1679
1801
  rm.dynamic ? `, ${rm.dynamic} dynamic size={…} skipped` : ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vegastack/design",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "VegaStack design system — cn utility, icon runtime, Tailwind v4 preset, and the vegastack-design CLI (tokens ship separately as @vegastack/design-tokens)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -70,7 +70,7 @@
70
70
  "test": "node test/compare.test.mjs && node test/check-updates.test.mjs && node test/skills-install.test.mjs && node test/doctor.test.mjs && node --test test/merge-refs.test.mjs test/registry-credentials.test.mjs test/registry-fetch.test.mjs"
71
71
  },
72
72
  "dependencies": {
73
- "@vegastack/design-tokens": "^0.11.0",
73
+ "@vegastack/design-tokens": "^0.14.0",
74
74
  "clsx": "^2.1.1",
75
75
  "tailwind-merge": "^3.6.0",
76
76
  "tsconfig-paths": "^4.2.0",
@@ -394,6 +394,12 @@ contract.
394
394
  - Use `Icon`/`BrandIcon` from `@vegastack/design/icons`, or `lucide-react` directly for internal
395
395
  chrome.
396
396
  - Implement every applicable state: default, hover, focus, loading, empty, error, success, disabled.
397
+ - Draw every check — done, selected, approved, allowed, uploaded — in the blue accent
398
+ (`text-info-text`, or `StatusGlyph`), never green; in agent UI a status hue is a glyph or words,
399
+ never a fill, and a card is `ChatCard` only for something to act on or open (COL-25). The
400
+ doctor fails on a green check.
401
+ - In a chat, move on the chat motion set (`duration-quick|state|layout`, `ease-enter|exit`) and show
402
+ one loader per turn, the braille `TextSpinner`; a running row is a still ◐ (MOT-14).
397
403
  - Put `truncate` on an inner span, with `min-w-0` on the flex container.
398
404
  - Let the parent decide a form control's width — every control is `w-full`.
399
405
  - Give a row's, card's or inline block's actions `secondary` (the main one) and `outline` (the
@@ -3,7 +3,7 @@
3
3
  <!-- GENERATED — do not hand-edit. Regenerated from the design system's component contract,
4
4
  which is the authority for membership and counts. -->
5
5
 
6
- **202 components**, plus 467 animated-icon items, 18 hooks (`use-animation-replay`, `use-announcer`, `use-async-search`, `use-drag-reorder`, `use-file-drop`, `use-grid-selection`, `use-inline-edit`, `use-list-nav`, `use-media-query`, `use-mobile`, `use-modal-inert`, `use-optimistic-action`, `use-overflow-fold`, `use-overflow`, `use-platform`, `use-record-peek-row`, `use-tabs-swipe`, `use-view-transition`), 15 starter blocks (`app-shell-01`, `board-01`, `issue-detail-01`, `page-editor-01`, `command-search-01`, `list-page-01`, `library-01`, `login-01`, `notifications-01`, `review-split-01`, `settings-01`, `settings-02`, `status-pages-01`, `email-kit`, `share-01`), 68 chart blocks across 7 families, and 22 data libs (`code-highlight`, `date-time`, `grid-clipboard`, `geo-data`, `emoji-data`, `drag-item`, `text-anchor`, `text-anchor-doc`, `text-edit-grammar`, `embed-providers`, `text-edit-schema`, `text-edit-markdown`, `file-kind`, `upload-progress`, `media-probe`, `page-layout`, `tile-overlay`, `disclosure-trigger`, `icon-data`, `icon-components`, `picker-search`, `picker-preferences`) — 792 registry items in total.
6
+ **220 components**, plus 467 animated-icon items, 19 hooks (`use-animation-replay`, `use-announcer`, `use-async-search`, `use-drag-reorder`, `use-file-drop`, `use-grid-selection`, `use-inline-edit`, `use-list-nav`, `use-media-query`, `use-mobile`, `use-modal-inert`, `use-optimistic-action`, `use-overflow-fold`, `use-overflow`, `use-platform`, `use-record-peek-row`, `use-stick-to-bottom`, `use-tabs-swipe`, `use-view-transition`), 15 starter blocks (`app-shell-01`, `board-01`, `issue-detail-01`, `page-editor-01`, `command-search-01`, `list-page-01`, `library-01`, `login-01`, `notifications-01`, `review-split-01`, `settings-01`, `settings-02`, `status-pages-01`, `email-kit`, `share-01`), 68 chart blocks across 7 families, and 23 data libs (`code-highlight`, `date-time`, `disclosure-trigger`, `drag-item`, `embed-providers`, `emoji-data`, `file-kind`, `geo-data`, `grid-clipboard`, `icon-components`, `icon-data`, `markdown-as-typed`, `media-probe`, `page-layout`, `picker-preferences`, `picker-search`, `text-anchor`, `text-anchor-doc`, `text-edit-grammar`, `text-edit-markdown`, `text-edit-schema`, `tile-overlay`, `upload-progress`) — 812 registry items in total.
7
7
 
8
8
  Install any of them with `shadcn add @vegastack/<name>`. Animated icons install as
9
9
  `@vegastack/icon-<name>`; the bare name is reserved for components, so a component whose name
@@ -63,16 +63,20 @@ starts with `icon-` is a component and never an icon.
63
63
  - **`activity-feed`** — A record's history, Linear style: comment threads and activity events ("Priya changed status from Open to Done · 2h") in one list, with an All / Comments / Activity filter, an order toggle, one actor's runs of changes as one line (a chain of one field's values, or "made 3 changes" expanding), collapsible event groups, a New divider, a floating Jump to latest, J/K/X keyboard navigation and a skeleton.
64
64
  - **`block-header`** — A live block's header row in a page — icon · title · controls (View ▾, Filter) · ⋯ · ↗ Open — with an empty state that hosts the source picker ("Pick a table…").
65
65
  - **`block-view`** — The frame TextEdit and MarkdownView draw a fenced block in when a blockViews entry renders its language: label, Preview / Code, split on a wide editable block, Expand with pan and pinch, and a ⋯ menu.
66
+ - **`brand-logo`** — A provider, tool or channel's mark in a small monochrome tile (muted fill, foreground ink): a Simple Icons (CC0) path through BrandIcon's mono variant, or the brand's first letter where no CC0 mark exists; decorative beside its name or an image named by label. Server-safe.
66
67
  - **`chip`** — The one labelled pill primitive — 10 decorative hues, two tiers, an optional selection rung, and a real 24x24 remove control. Behind Tag and FilterChip; ComboboxChip is Base UI's own chip, not this primitive.
67
68
  - **`code-block`** — A code panel with a language header and copy affordance — the shared code surface for chat transcripts, docs, and examples.
68
69
  - **`comment-margin`** — Comment cards laid beside the text they are about — level with their highlight, stacked without overlap, the active card aligned with its text — and a CommentPopover anchored to a highlight for narrow screens.
69
70
  - **`comments`** — A record's comments, Linear style: thread cards (first comment, Show N more replies, indented replies over hairlines, a flat reply row with the viewer's avatar), a bordered composer with a toolbar row and file drop, day labels, a list with a count, order toggle, Load earlier, skeleton and empty states, edit/delete/copy link/copy text, emoji reactions and an attachments slot.
70
71
  - **`diff-view`** — What changed between two texts — changed lines, then the words inside them, removed struck through and added tinted — with the sanctioned diff engine in its own lazily loaded chunk; line-only above 200 KB.
71
72
  - **`entry-list`** — A short, compact list of plain entries in a sheet, dialog or popover: a line of text, its muted details and small actions at its end.
73
+ - **`heatmap`** — Counts over two dimensions (weekday × hour, agent × day) as a keyboard-navigable grid of cells in five quintile steps of the single-series chart ink, with row and column headers, a tooltip per cell and an optional legend.
74
+ - **`kpi-card`** — A dashboard KPI tile — a large Stat in Card chrome with an optional hint, delta line, sparkline and whole-tile link — plus KpiGrid, the grid of tiles sized by its container width.
72
75
  - **`member-list`** — The people in a team, a space or a share list — an add row (picker · optional role · Add) and 36px rows (avatar · name over a muted sub line · role chip menu or text · ⋯ with Remove) that scroll after eight.
73
76
  - **`mermaid-block`** — A mermaid diagram drawn in the browser with the engine loaded lazily and its configuration pinned (strict security, SVG labels, dagre), in token colours for light and dark, keeping the last diagram that worked on an error — plus renderMermaid, useMermaidSvg and the ready blockViews entry for TextEdit and MarkdownView.
74
77
  - **`meta-line`** — An icon + text meta line under a record title: wrapping facts such as type, date and time, duration and owner, in the muted ink.
75
78
  - **`qr-code`** — A QR code for a value, drawn as one crisp SVG path — dark modules on a light rounded tile in both themes, with the standard quiet zone — encoded during render (server or client) by uqr; an empty or unencodable value draws the empty tile.
79
+ - **`rating-bars`** — A short qualitative rating: a label, max segments of which value are lit (primary on the muted track) and a word after them; one role=meter named by label with aria-valuetext set to the word. Server-safe, no motion.
76
80
  - **`reactions`** — Slack-style emoji reactions: pills with counts that toggle, a hover card naming who reacted, and an add-reaction button with quick reactions.
77
81
  - **`record-header`** — One head for every record, on its page and in a peek.
78
82
  - **`stat`** — A labelled value block — muted label over a value, honest faint empty state, optional delta line. Two scales.
@@ -163,6 +167,7 @@ starts with `icon-` is a component and never an icon.
163
167
  - **`command`** — A searchable command palette — filtered, grouped items with keyboard navigation, optionally inside a ⌘K dialog.
164
168
  - **`folder-tree`** — A Notion-style navigation tree for a file library — sections of folders, pages and files; folders that load their children on first open with loading, error, empty and Show all rows; one tab stop with tree arrow keys and typeahead; a ⋯ menu per row; pointer drag into a folder or section; and a folders-only picker mode for Move dialogs.
165
169
  - **`help-menu`** — The sidebar-footer Help item — one menu with What's new (an unread dot), Docs, Keyboard shortcuts and Contact support, and the build version; an icon with a tooltip in the collapsed rail. Links render through your router's link.
170
+ - **`link-provider`** — One rule for every link, set once at the app root: an in-app link opens in place through the host router, a modified click stays the browser's, another origin opens a new tab.
166
171
  - **`menubar`** — A persistent horizontal bar of menus — application-style File / Edit / View navigation.
167
172
  - **`multi-step-form`** — A guarded, branching flow around a Stepper — conditional steps, sync and async advance guards, locking, reachability-derived deep links and resume, and a phone layout chosen from the same predicate. Owns no fields and no validator.
168
173
  - **`navigation-menu`** — A collection of links for navigating websites — triggers that open one shared panel, and plain links styled to match.
@@ -222,13 +227,26 @@ starts with `icon-` is a component and never an icon.
222
227
 
223
228
  - **`agent-edit-banner`** — The strip under a document's header after an agent changed it: the agent's hexagon, "Edited by Claude for Manoj · 3 changes · 2m ago", View changes, Approve, Undo and a dismiss — with the approving, undoing, refused, created and read-only states and the other agents behind +N.
224
229
  - **`agent-panel`** — An agent on a record: identity, acting for, state with its actions, instructions, latest, reply and runs with Undo; plus slot, chip, badge, ring and hover card.
225
- - **`agent-question-form`** — An agent asks one to five questions at once: options with their descriptions in view, the first recommended, own words and a note per question, previews, steps and a review; and the read-only answers.
230
+ - **`agent-question-form`** — An agent asks one to five questions at once: options with their descriptions in view, the first recommended unless turned off, own words and a note per question, previews, steps and a review; and the read-only answers.
226
231
  - **`approval-card`** — An agent asks its owner to approve a risky action: who asks, the action in words, the records it touches, its reason, a reassurance, the expiry, and one Approve / Decline for the whole request — then the outcome.
232
+ - **`chat-card`** — The chat's one card surface (ChatCard), one line of work (ChatRow) and a fold of work that opens and closes smoothly (ChatGroup).
233
+ - **`chat-chip`** — A compact pill for background work and counts on the chat card surface, with an attention tone that never fills.
227
234
  - **`chat-composer`** — The box a person talks to an agent in: chips for what travels with the message, the text with mentions, and Send, which turns into Stop while the agent answers.
235
+ - **`chat-menu`** — A menu with the chat's density: tight rows, a blue ✓ and a number shortcut in one right slot, submenus that open on hover or →.
228
236
  - **`cited-list`** — An answer as numbered points, each a sentence followed by its sources as small muted chips — links by default, or any element through render.
237
+ - **`composer-chip`** — A round toolbar chip for the chat composer: a toggle (Plan), a menu trigger with a chevron (the model), or read-only words, with an optional tooltip.
238
+ - **`context-ring`** — How full a chat's working memory is: a ring for the composer's toolbar in three tones (blue under 75%, amber from 75%, red from 90%) and an empty outline, with a breakdown and Summarize now.
229
239
  - **`delegate-popover`** — Delegate a record or rows to an agent: search agents (disabled with a reason), instructions, When finished, Connect an agent; bulk, empty and loading states.
240
+ - **`effect-pill`** — A small pill naming one plan step's effect (read, draft, change, send, remove, spend) with an icon, hued by reach; icon-only for narrow columns.
241
+ - **`memory-note`** — One quiet row under a chat message saying what an agent remembered, updated, suggested or forgot in a memory notebook, with Undo, Edit, Why? and a filled Keep for suggestions, and its settled outcomes.
230
242
  - **`message-parts`** — What an agent's answer is made of beyond its text: steps, a plan checklist, status and notice lines, changes with Undo, a hand-off divider, sources, the disclaimer, actions, a version switch and a fold.
243
+ - **`plan-card`** — An agent's plan put to the person: goal, steps with effect pills and touches, assumptions, won't do, will ask, risk, a version diff, per-step comments, four answers and settled lines.
244
+ - **`request-card`** — One card for every question an agent asks before it acts — Allow once · Always allow (one step wider from its menu) · Decline (with a note, or Never allow this) — its settled line in the same words on every channel, and What I've allowed with uses and Revoke.
245
+ - **`run-usage`** — What one agent run used: a chip under the answer (steps, context, cache, optional money), a panel by model with cache per step and Subagents, and a table with one row per model call.
246
+ - **`status-glyph`** — One glyph per state in agent UI: ✓ done in the blue accent, ◌ not started, ◐ running (still), ⊘ skipped, ✗ failed, ⚠ needs you.
231
247
  - **`suggestion-card`** — An agent offers one person a next step, in a card only they see: items with optional ticks, the host's own buttons, a menu, a footnote, its outcomes and a compact row.
248
+ - **`task-list`** — An agent's live checklist for a longer job: the live item on top, the next two, finished items folded into a count and the rest into +N more, a waiting badge, Subagent progress, and a sticky progress bar.
249
+ - **`text-spinner`** — The one inline text loader: a monospace braille spinner one character wide, or three dots, CSS only, a still … under reduced motion.
232
250
  - **`tool-call-chip`** — An agent-activity chip — tool action label + muted result meta, optionally rendered as a button.
233
251
 
234
252
  ## Communication