@vegastack/design 0.13.1 → 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.
|
|
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.
|
|
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
|
-
**
|
|
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
|
|
@@ -227,13 +227,26 @@ starts with `icon-` is a component and never an icon.
|
|
|
227
227
|
|
|
228
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.
|
|
229
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.
|
|
230
|
-
- **`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.
|
|
231
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.
|
|
232
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 →.
|
|
233
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.
|
|
234
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.
|
|
235
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.
|
|
236
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.
|
|
237
250
|
- **`tool-call-chip`** — An agent-activity chip — tool action label + muted result meta, optionally rendered as a button.
|
|
238
251
|
|
|
239
252
|
## Communication
|