@brunosouzas/design-system 0.6.0 → 0.7.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.
Files changed (40) hide show
  1. package/NOTICE +13 -0
  2. package/README.md +75 -40
  3. package/dist/scripts/cover.d.ts +7 -4
  4. package/dist/scripts/cover.js +25 -8
  5. package/dist/src/fonts/embed.d.ts +7 -0
  6. package/dist/src/fonts/embed.js +219 -0
  7. package/dist/src/pieces/bank-objects.d.ts +1 -1
  8. package/dist/src/pieces/bank-objects.js +26 -18
  9. package/dist/src/pieces/cover.js +2 -1
  10. package/dist/src/pieces/diagram.js +3 -3
  11. package/dist/src/pieces/eip-icons.js +27 -27
  12. package/dist/src/pieces/emote.d.ts +13 -0
  13. package/dist/src/pieces/emote.js +88 -0
  14. package/dist/src/pieces/index.d.ts +1 -1
  15. package/dist/src/pieces/index.js +1 -1
  16. package/dist/src/pieces/ink.d.ts +26 -16
  17. package/dist/src/pieces/ink.js +15 -6
  18. package/dist/src/pieces/library.d.ts +9 -15
  19. package/dist/src/pieces/library.js +52 -53
  20. package/dist/src/pieces/link-icons.d.ts +2 -1
  21. package/dist/src/pieces/link-icons.js +10 -18
  22. package/dist/src/pieces/metro.d.ts +4 -2
  23. package/dist/src/pieces/metro.js +14 -13
  24. package/dist/src/pieces/node.d.ts +5 -3
  25. package/dist/src/pieces/node.js +6 -4
  26. package/dist/src/pieces/params.js +2 -2
  27. package/dist/tokens/generated/tokens.d.ts +71 -155
  28. package/dist/tokens/generated/tokens.js +72 -156
  29. package/fonts/OFL.txt +97 -0
  30. package/fonts/SourceCodePro-Bold.ttf +0 -0
  31. package/fonts/SourceCodePro-Regular.ttf +0 -0
  32. package/fonts/SourceSans3-Black.ttf +0 -0
  33. package/fonts/SourceSans3-Bold.ttf +0 -0
  34. package/fonts/SourceSans3-Regular.ttf +0 -0
  35. package/package.json +10 -1
  36. package/tokens/generated/tokens.css +62 -110
  37. package/tokens/generated/tokens.json +72 -156
  38. package/tokens/generated/tokens.ts +72 -156
  39. package/dist/src/pieces/cast.d.ts +0 -35
  40. package/dist/src/pieces/cast.js +0 -333
@@ -12,10 +12,14 @@ export const inkScaleParam = { kind: "number", min: 0.25, max: 8 };
12
12
  export const inkSchema = { surface: surfaceParam, inkScale: inkScaleParam };
13
13
  /** Collects the limits between parameters (piece.ts, `relations`). */
14
14
  export const limits = (...checks) => checks.filter((check) => check !== false);
15
- /** The surface's colours and the ink measures at a scale. */
15
+ /**
16
+ * The surface's colours and the ink measures at a scale. `line` is the colour of
17
+ * an ink stroke on the surface's background or on a dark face: ink on light, the
18
+ * surface's muted grey on dark, where ink vanishes (ADR 0009, the cast's rule).
19
+ */
16
20
  export const inkOf = ({ surface = "light", inkScale = 1 }) => {
17
21
  const s = tokens.surface[surface];
18
- return { s, outline: M.outline * inkScale, rim: s.rimWidth * inkScale, offset: M.shadow * inkScale };
22
+ return { s, line: surface === "dark" ? s.muted : ink, outline: M.outline * inkScale, rim: s.rimWidth * inkScale, offset: M.shadow * inkScale };
19
23
  };
20
24
  /** Outlined shapes need room for their ink: smallest dimension ≥ 4 × outline. */
21
25
  export const roomFor = (name, smallest, inkParams) => {
@@ -23,15 +27,20 @@ export const roomFor = (name, smallest, inkParams) => {
23
27
  return smallest < need && { path: name, message: `leaves no room for the outline: needs at least ${r2(need)} at this ink scale` };
24
28
  };
25
29
  export const atLeast = (name, value, least, what) => value < least && { path: name, message: `must be at least ${what} (${r2(least)}), found ${r2(value)}` };
26
- /** The ink sticker (metro-and-diagram-pieces design §3): shadow copy, rim on dark, then the face. */
30
+ /**
31
+ * The ink sticker (metro-and-diagram-pieces design §3): a shadow copy when the
32
+ * offset is above 0 (`map.shadow` is 0 since ADR 0009, so none), a rim when the
33
+ * surface has one (none while `rimWidth` is 0), then the face outlined in the
34
+ * surface's ink line.
35
+ */
27
36
  export const sticker = (shape, face, inkParams) => {
28
- const { s, outline, rim, offset } = inkOf(inkParams);
37
+ const { s, line, outline, rim, offset } = inkOf(inkParams);
29
38
  const wide = r2(outline + 2 * rim);
30
39
  return [
31
40
  // Joins are set here, so a sticker draws the same inside any group.
32
- shape(offset, offset, { fill: s.shadow, stroke: s.shadow, "stroke-width": wide, "stroke-linejoin": "round" }),
41
+ ...(offset > 0 ? [shape(offset, offset, { fill: s.shadow, stroke: s.shadow, "stroke-width": wide, "stroke-linejoin": "round" })] : []),
33
42
  ...(s.rimWidth > 0 ? [shape(0, 0, { fill: s.rim, stroke: s.rim, "stroke-width": wide, "stroke-linejoin": "round" })] : []),
34
- shape(0, 0, { fill: face, stroke: ink, "stroke-width": r2(outline), "stroke-linejoin": "round" }),
43
+ shape(0, 0, { fill: face, stroke: line, "stroke-width": r2(outline), "stroke-linejoin": "round" }),
35
44
  ];
36
45
  };
37
46
  /** Backticks mark code (body-diagram-pieces design §4; the pill since card 190): with an even number of them, each part between backticks becomes a tspan in
@@ -1,10 +1,10 @@
1
- import { emote, mascot } from "./cast.ts";
1
+ import { emote } from "./emote.ts";
2
2
  import { mira, visor, drone, kiu, sinal, type MiraParams, type VisorParams, type DroneParams, type KiuParams, type SinalParams } from "./brand-cast.ts";
3
3
  import { bankObject, type BankObjectName, type BankObjectParams } from "./bank-objects.ts";
4
4
  import { symbol, type SymbolParams } from "./symbol.ts";
5
5
  import { brandNotationIcon, type BrandNotationIconName, type BrandNotationIconParams } from "./brand-notation-icons.ts";
6
6
  import { categoryIcon, type CategoryIconParams } from "./category-icon.ts";
7
- export { emote, mascot, mira, visor, drone, kiu, sinal, bankObject, symbol, brandNotationIcon, categoryIcon };
7
+ export { emote, mira, visor, drone, kiu, sinal, bankObject, symbol, brandNotationIcon, categoryIcon };
8
8
  export type { MiraParams, VisorParams, DroneParams, KiuParams, SinalParams, BankObjectName, BankObjectParams, SymbolParams, BrandNotationIconName, BrandNotationIconParams, CategoryIconParams };
9
9
  export * from "./metro.ts";
10
10
  export * from "./diagram.ts";
@@ -51,16 +51,11 @@ export type SheetParams = {
51
51
  };
52
52
  /** A sheet of paper with rows of text bars, an optional lead mark and an optional tick at the end. */
53
53
  export declare const sheet: import("./piece.ts").Piece<SheetParams>;
54
- declare const CODE_COLOURS: {
55
- readonly healthy: "#3DDC84";
56
- readonly caller: "#8FB2FF";
57
- readonly white: "#FFFFFF";
58
- readonly backend: "#FF6B6B";
59
- };
54
+ declare const CODE_LINE_COLOURS: readonly ["healthy", "caller", "white", "backend"];
60
55
  export type CodeLine = {
61
56
  indent: number;
62
57
  w: number;
63
- color: keyof typeof CODE_COLOURS;
58
+ color: (typeof CODE_LINE_COLOURS)[number];
64
59
  tall?: boolean;
65
60
  };
66
61
  export type CodePanelParams = {
@@ -72,7 +67,7 @@ export type CodePanelParams = {
72
67
  top?: number;
73
68
  step?: number;
74
69
  };
75
- /** Dark code panel with coloured lines; a tall line marks the one under review. */
70
+ /** Dark code panel with neutral lines; a tall line, the one under review, takes the accent (ADR 0009). */
76
71
  export declare const codePanel: import("./piece.ts").Piece<CodePanelParams>;
77
72
  export type SpeechBubbleParams = {
78
73
  x: number;
@@ -81,7 +76,7 @@ export type SpeechBubbleParams = {
81
76
  height: number;
82
77
  fill?: string;
83
78
  };
84
- /** Chat slip with a tail at the bottom left and one white text line. */
79
+ /** Chat slip with a tail at the bottom left and one text line. */
85
80
  export declare const speechBubble: import("./piece.ts").Piece<SpeechBubbleParams>;
86
81
  export type BrowserWindowParams = {
87
82
  x: number;
@@ -194,7 +189,7 @@ export type RobotParams = {
194
189
  cx: number;
195
190
  top: number;
196
191
  };
197
- /** Robot: antenna, ears, green body with a visor and two eyes, mouth bars. Scale it with pose. */
192
+ /** Robot in the v2 grammar: white body and ears, a dark visor with the cast's idle eyes, one grille bar, the accent on the antenna tip. Scale it with pose. */
198
193
  export declare const robot: import("./piece.ts").Piece<RobotParams>;
199
194
  export type MagnifierParams = {
200
195
  cx: number;
@@ -228,7 +223,7 @@ export type GearParams = {
228
223
  teeth?: number;
229
224
  fill?: string;
230
225
  };
231
- /** Gear with square teeth and a white hub, as on the maven-release cover. */
226
+ /** Gear with square teeth and a hub, as on the maven-release cover. */
232
227
  export declare const gear: import("./piece.ts").Piece<GearParams>;
233
228
  export type ParcelParams = {
234
229
  x: number;
@@ -336,8 +331,7 @@ export declare const PIECES: {
336
331
  readonly uiIcon: import("./piece.ts").Piece<import("./ui-icons.ts").UiIconParams>;
337
332
  readonly linkIcon: import("./piece.ts").Piece<import("./link-icons.ts").LinkIconParams>;
338
333
  readonly stateStart: import("./piece.ts").Piece<import("./diagram.ts").StateStartParams>;
339
- readonly mascot: import("./piece.ts").Piece<import("./cast.ts").MascotParams>;
340
- readonly emote: import("./piece.ts").Piece<import("./cast.ts").EmoteParams>;
334
+ readonly emote: import("./piece.ts").Piece<import("./emote.ts").EmoteParams>;
341
335
  readonly mira: import("./piece.ts").Piece<MiraParams>;
342
336
  readonly visor: import("./piece.ts").Piece<VisorParams>;
343
337
  readonly drone: import("./piece.ts").Piece<DroneParams>;
@@ -15,14 +15,14 @@ import { METRO_PIECES } from "./metro.js";
15
15
  import { DIAGRAM_PIECES, stateStart } from "./diagram.js";
16
16
  import { uiIcon } from "./ui-icons.js";
17
17
  import { linkIcon } from "./link-icons.js";
18
- import { emote, mascot } from "./cast.js";
18
+ import { emote } from "./emote.js";
19
19
  import { mira, visor, drone, kiu, sinal } from "./brand-cast.js";
20
20
  import { bankObject } from "./bank-objects.js";
21
21
  import { symbol } from "./symbol.js";
22
22
  import { brandNotationIcon } from "./brand-notation-icons.js";
23
23
  import { categoryIcon } from "./category-icon.js";
24
24
  import { codeLength, spans } from "./ink.js";
25
- export { emote, mascot, mira, visor, drone, kiu, sinal, bankObject, symbol, brandNotationIcon, categoryIcon };
25
+ export { emote, mira, visor, drone, kiu, sinal, bankObject, symbol, brandNotationIcon, categoryIcon };
26
26
  export * from "./metro.js";
27
27
  export * from "./diagram.js";
28
28
  export * from "./ui-icons.js";
@@ -60,7 +60,7 @@ export const sheet = definePiece("sheet", {
60
60
  fill: col(),
61
61
  leadFill: col(),
62
62
  tick: col(),
63
- }, ({ x, y, width, height, rows, top = 46, step = 38, fill = "color.white", leadFill = "color.caller", tick = "illustration.accent" }) => {
63
+ }, ({ x, y, width, height, rows, top = 46, step = 38, fill = "color.white", leadFill = "color.ink", tick = "color.white" }) => {
64
64
  const marks = [];
65
65
  const bars = [];
66
66
  const ticks = [];
@@ -76,14 +76,14 @@ export const sheet = definePiece("sheet", {
76
76
  barX = x + 56;
77
77
  }
78
78
  else if (row.lead === "question") {
79
- marks.push(el("circle", { cx: x + 30, cy, r: 13, fill: tokens.color.transitional }));
79
+ marks.push(el("circle", { cx: x + 30, cy, r: 13, fill: tokens.color.white }));
80
80
  glyphs.push(el("text", { x: x + 30, y: cy + 7, "font-size": 19, "font-weight": tokens.font.weightHeavy }, "?"));
81
81
  barX = x + 52;
82
82
  }
83
83
  bars.push(el("rect", { x: barX, y: cy - 5, width: row.bar, height: 10, rx: 5 }));
84
84
  if (row.tail === "check") {
85
85
  const tx = x + width - 40;
86
- marks.push(el("rect", { x: tx, y: cy - 11, width: 22, height: 22, rx: 5, fill: tokens.color.healthy }));
86
+ marks.push(el("rect", { x: tx, y: cy - 11, width: 22, height: 22, rx: 5, fill: tokens.color.state.healthy }));
87
87
  ticks.push(el("path", { d: `M${tx + 5},${cy} L${tx + 10},${cy + 6} L${tx + 18},${cy - 6}`, stroke: ink }));
88
88
  }
89
89
  });
@@ -94,8 +94,10 @@ export const sheet = definePiece("sheet", {
94
94
  g({ stroke: "none", fill: tokens.illustration.textBar }, ...bars),
95
95
  ], glyphs);
96
96
  });
97
- const CODE_COLOURS = { healthy: tokens.color.healthy, caller: tokens.color.caller, white: tokens.color.white, backend: tokens.color.backend };
98
- /** Dark code panel with coloured lines; a tall line marks the one under review. */
97
+ // The line kinds of 0.6.x specs, kept so they stay valid (ADR 0009): on the dark card every line is
98
+ // brand.dark.textMuted, a `white` line brand.dark.text, and the `tall` line (the one under review) the accent.
99
+ const CODE_LINE_COLOURS = ["healthy", "caller", "white", "backend"];
100
+ /** Dark code panel with neutral lines; a tall line, the one under review, takes the accent (ADR 0009). */
99
101
  export const codePanel = definePiece("codePanel", {
100
102
  x: pos(),
101
103
  y: pos(),
@@ -106,7 +108,7 @@ export const codePanel = definePiece("codePanel", {
106
108
  required: true,
107
109
  of: {
108
110
  kind: "object",
109
- fields: { indent: { kind: "number", required: true, min: 0, max: MAX_SIZE }, w: size(true), color: { kind: "enum", required: true, values: Object.keys(CODE_COLOURS) }, tall: { kind: "boolean" } },
111
+ fields: { indent: { kind: "number", required: true, min: 0, max: MAX_SIZE }, w: size(true), color: { kind: "enum", required: true, values: CODE_LINE_COLOURS }, tall: { kind: "boolean" } },
110
112
  },
111
113
  },
112
114
  top: size(),
@@ -119,25 +121,25 @@ export const codePanel = definePiece("codePanel", {
119
121
  width: line.w,
120
122
  height: line.tall ? 16 : 10,
121
123
  rx: line.tall ? 8 : 5,
122
- fill: CODE_COLOURS[line.color],
124
+ fill: line.tall ? tokens.brand.dark.accent : line.color === "white" ? tokens.brand.dark.text : tokens.brand.dark.textMuted,
123
125
  }))),
124
126
  ]));
125
- /** Chat slip with a tail at the bottom left and one white text line. */
126
- export const speechBubble = definePiece("speechBubble", { x: pos(), y: pos(), width: size(true, 60), height: size(true, 50), fill: col() }, ({ x, y, width: w, height: h, fill = "color.caller" }) => {
127
+ /** Chat slip with a tail at the bottom left and one text line. */
128
+ export const speechBubble = definePiece("speechBubble", { x: pos(), y: pos(), width: size(true, 60), height: size(true, 50), fill: col() }, ({ x, y, width: w, height: h, fill = "color.white" }) => {
127
129
  const r = 12;
128
130
  const b = y + h;
129
131
  const d = `M${x},${y + r} Q${x},${y} ${x + r},${y} H${x + w - r} Q${x + w},${y} ${x + w},${y + r} V${b - r} Q${x + w},${b} ${x + w - r},${b} H${x + 44} L${x + 20},${b + 20} L${x + 24},${b} H${x + r} Q${x},${b} ${x},${b - r} Z`;
130
132
  return drawn([
131
133
  ...shadowed(el("path", { d, fill: colour(fill, "fill") })),
132
- el("rect", { x: x + 22, y: y + 31, width: w - 44, height: 13, rx: 6.5, fill: tokens.color.white, stroke: "none" }),
134
+ el("rect", { x: x + 22, y: y + 31, width: w - 44, height: 13, rx: 6.5, fill: tokens.illustration.textBar, stroke: "none" }),
133
135
  ]);
134
136
  });
135
137
  /** Browser window: title bar with three dots, a hero block and two text lines. */
136
138
  export const browserWindow = definePiece("browserWindow", { x: pos(), y: pos(), width: size(false, 60), height: size(false, 130) }, ({ x, y, width: w = 200, height: h = 140 }) => drawn([
137
139
  ...shadowed(el("rect", { x, y, width: w, height: h, rx: 12, fill: tokens.color.white })),
138
140
  el("path", { d: `M${x},${y + 30} H${x + w}`, fill: "none" }),
139
- ...[tokens.color.backend, tokens.color.transitional, tokens.color.healthy].map((fill, i) => el("circle", { cx: x + 18 + i * 16, cy: y + 15, r: 5, fill, "stroke-width": 2.5 })),
140
- el("rect", { x: x + 20, y: y + 46, width: w - 40, height: 40, rx: 8, fill: tokens.color.caller, "stroke-width": tokens.outline.small }),
141
+ ...[tokens.color.white, tokens.color.white, tokens.color.white].map((fill, i) => el("circle", { cx: x + 18 + i * 16, cy: y + 15, r: 5, fill, "stroke-width": 2.5 })),
142
+ el("rect", { x: x + 20, y: y + 46, width: w - 40, height: 40, rx: 8, fill: tokens.brand.light.bg, "stroke-width": tokens.outline.small }),
141
143
  el("rect", { x: x + 20, y: y + 100, width: r2(w * 0.6), height: 10, rx: 5, fill: tokens.illustration.textBar, stroke: "none" }),
142
144
  el("rect", { x: x + 20, y: y + 118, width: r2(w * 0.4), height: 10, rx: 5, fill: tokens.illustration.textBar, stroke: "none" }),
143
145
  ]));
@@ -148,17 +150,16 @@ export const folder = definePiece("folder", { x: pos(), y: pos(), scale: size()
148
150
  const front = `M${p(-6, 64)} Q${p(-6, 52)} ${p(6, 52)} L${p(184, 52)} Q${p(196, 52)} ${p(196, 64)} L${p(190, 198)} L${p(0, 198)} Z`;
149
151
  const paper = (dx, dy, rot) => el("rect", { x: r2(x + dx * s), y: r2(y + dy * s), width: r2(96 * s), height: r2(120 * s), rx: 8, fill: tokens.color.white, transform: `rotate(${rot} ${r2(x + (dx + 48) * s)} ${r2(y + (dy + 60) * s)})` });
150
152
  return drawn([
151
- ...shadowed(el("path", { d: back, fill: tokens.illustration.transitionalShade })),
153
+ ...shadowed(el("path", { d: back, fill: tokens.brand.light.border })),
152
154
  paper(24, -8, -8),
153
155
  paper(66, -16, 6),
154
- el("path", { d: front, fill: tokens.color.transitional }),
156
+ el("path", { d: front, fill: tokens.color.white }),
155
157
  ]);
156
158
  });
157
159
  /** A closed book seen from the front: back page, front cover, spine and page edges. */
158
160
  export const book = definePiece("book", { x: pos(), y: pos(), width: size(false, 30), height: size(false, 30) }, ({ x, y, width: w = 120, height: h = 200 }) => drawn([
159
- el("rect", { x: x + 18, y: y + 14, width: w - 2, height: h, rx: 8, fill: ink, stroke: "none" }),
161
+ // The back page stays white; no ink shape behind or offset from the front cover (it read as the old shadow, ADR 0009).
160
162
  el("rect", { x: x + 14, y: y + 10, width: w - 2, height: h, rx: 8, fill: tokens.color.white }),
161
- el("rect", { x, y, width: w, height: h, rx: 8, fill: ink, stroke: "none" }),
162
163
  el("rect", { x, y, width: w, height: h, rx: 8, fill: tokens.color.white }),
163
164
  el("rect", { x, y, width: 20, height: h, rx: 8, fill: ink }),
164
165
  el("path", { d: `M${x + w + 4},${y + 16} V${y + h - 6} M${x + w + 8},${y + 20} V${y + h - 2}`, "stroke-width": 2 }),
@@ -174,7 +175,7 @@ export const blockArrow = definePiece("blockArrow", { x: pos(), y: pos(), length
174
175
  ]);
175
176
  });
176
177
  /** Curved arrow (cubic Bézier) with a chevron head at `to`; solid or dashed. */
177
- export const arcArrow = definePiece("arcArrow", { from: { kind: "point", required: true }, c1: { kind: "point", required: true }, c2: { kind: "point", required: true }, to: { kind: "point", required: true }, color: col(), dashed: { kind: "boolean" }, width: size() }, ({ from, c1, c2, to, color = "color.white", dashed = false, width }) => {
178
+ export const arcArrow = definePiece("arcArrow", { from: { kind: "point", required: true }, c1: { kind: "point", required: true }, c2: { kind: "point", required: true }, to: { kind: "point", required: true }, color: col(), dashed: { kind: "boolean" }, width: size() }, ({ from, c1, c2, to, color = "color.ink", dashed = false, width }) => {
178
179
  const stroke = colour(color, "color");
179
180
  const strokeWidth = width ?? (dashed ? 4 : 6);
180
181
  const angle = Math.atan2(to[1] - c2[1], to[0] - c2[0]);
@@ -190,9 +191,9 @@ export const arcArrow = definePiece("arcArrow", { from: { kind: "point", require
190
191
  ]);
191
192
  });
192
193
  /** A rail (track) with square nodes spread along it. */
193
- export const rail = definePiece("rail", { x: pos(), y: pos(), width: size(true, 100), nodes: { kind: "array", required: true, minItems: 1, of: { kind: "color" } }, fill: col(), thickness: size() }, ({ x, y, width: w, nodes, fill = "illustration.codePanel", thickness: t = 44 }) => drawn([
194
- ...shadowed(el("rect", { x, y, width: w, height: t, rx: t / 2, fill: colour(fill, "fill") }), 8),
195
- el("path", { d: `M${x + 30},${y + t / 2} H${x + w - 30}`, fill: "none", stroke: tokens.color.white, "stroke-width": tokens.outline.small }),
194
+ export const rail = definePiece("rail", { x: pos(), y: pos(), width: size(true, 100), nodes: { kind: "array", required: true, minItems: 1, of: { kind: "color" } }, fill: col(), thickness: size() }, ({ x, y, width: w, nodes, fill = "color.white", thickness: t = 44 }) => drawn([
195
+ el("rect", { x, y, width: w, height: t, rx: t / 2, fill: colour(fill, "fill") }),
196
+ el("path", { d: `M${x + 30},${y + t / 2} H${x + w - 30}`, fill: "none", stroke: tokens.brand.light.border, "stroke-width": tokens.outline.small }),
196
197
  ...nodes.map((node, i) => el("rect", { x: r2(x + 40 + i * ((w - 100) / Math.max(1, nodes.length - 1)) - 10), y: y + t / 2 - 10, width: 20, height: 20, rx: 4, fill: colour(node, `nodes[${i}]`), "stroke-width": tokens.outline.small })),
197
198
  ]));
198
199
  /** A road: a wide grey band along a path with white dashes in the middle. */
@@ -203,7 +204,7 @@ export const road = definePiece("road", { d: { kind: "string", required: true, n
203
204
  const PIN_SIZE = 18;
204
205
  /** A pin standing on (x, y): a stem and a round head with a short label. `size` is the head's radius (18) and
205
206
  * scales the head, its outline and the label together (card 190). */
206
- export const milestonePin = definePiece("milestonePin", { x: pos(), y: pos(), text: label(), fill: col(), stem: size(), size: { kind: "number", min: 6, max: 48 } }, ({ x, y, text, fill = "color.healthy", stem = 44, size: r }) => {
207
+ export const milestonePin = definePiece("milestonePin", { x: pos(), y: pos(), text: label(), fill: col(), stem: size(), size: { kind: "number", min: 6, max: 48 } }, ({ x, y, text, fill = "color.white", stem = 44, size: r }) => {
207
208
  // Without `size`, the 0.5.0 expressions exactly (no rounding), so every 0.5.0 call keeps its bytes.
208
209
  const k = (r ?? PIN_SIZE) / PIN_SIZE;
209
210
  const at = r === undefined ? (v) => v : r2;
@@ -218,56 +219,55 @@ export const priceTag = definePiece("priceTag", { x: pos(), y: pos(), text: labe
218
219
  const d = `M${x + 20},${top} L${right - 10},${top} Q${right},${top} ${right},${top + 10} L${right},${bottom - 10} Q${right},${bottom} ${right - 10},${bottom} L${x + 20},${bottom} L${x},${y} Z`;
219
220
  const body = [];
220
221
  if (stringFrom) {
221
- body.push(el("path", { d: `M${stringFrom[0]},${stringFrom[1]} C${stringFrom[0] - 14},${r2((stringFrom[1] + y) / 2)} ${x + 2},${y + 4} ${x + 20},${y}`, fill: "none", stroke: tokens.color.white, "stroke-width": tokens.outline.block }));
222
+ body.push(el("path", { d: `M${stringFrom[0]},${stringFrom[1]} C${stringFrom[0] - 14},${r2((stringFrom[1] + y) / 2)} ${x + 2},${y + 4} ${x + 20},${y}`, fill: "none", stroke: ink, "stroke-width": tokens.outline.block }));
222
223
  }
223
- body.push(...shadowed(el("path", { d, fill: colour(fill, "fill") }), 6), el("circle", { cx: x + 16, cy: y, r: 5, fill: ink, stroke: "none" }));
224
+ body.push(el("path", { d, fill: colour(fill, "fill") }), el("circle", { cx: x + 16, cy: y, r: 5, fill: ink, stroke: "none" }));
224
225
  return drawn(body, [el("text", { x: r2(x + 20 + (w - 20) / 2 - 2), y: y + 8, "font-family": mono, "font-size": 22 }, text)]);
225
226
  });
226
227
  /** A name tag hanging on a string from (hangX, hangY), showing one EIP icon. */
227
- export const nameTag = definePiece("nameTag", { hangX: pos(), hangY: pos(), cx: pos(), top: pos(), rotate: { kind: "number" }, icon: { kind: "enum", required: true, values: EIP_ICON_NAMES }, fill: col() }, ({ hangX: sx, hangY: sy, cx, top, rotate = 0, icon, fill = "color.transitional" }) => {
228
+ export const nameTag = definePiece("nameTag", { hangX: pos(), hangY: pos(), cx: pos(), top: pos(), rotate: { kind: "number" }, icon: { kind: "enum", required: true, values: EIP_ICON_NAMES }, fill: col() }, ({ hangX: sx, hangY: sy, cx, top, rotate = 0, icon, fill = "color.white" }) => {
228
229
  const w = 96;
229
230
  const h = 92;
230
231
  const x = cx - w / 2;
231
232
  const d = `M${x},${top + 14} L${x + 18},${top} H${x + w - 18} L${x + w},${top + 14} V${top + h - 6} Q${x + w},${top + h} ${x + w - 6},${top + h} H${x + 6} Q${x},${top + h} ${x},${top + h - 6} Z`;
232
233
  return drawn([
233
234
  el("path", { d: `M${sx},${sy} C${sx - 13},${sy + 28} ${sx + 6},${sy + 36} ${cx},${top + 20}`, fill: "none", "stroke-width": tokens.outline.small }),
234
- g({ transform: `rotate(${rotate} ${cx} ${top + 20})` }, ...shadowed(el("path", { d, fill: colour(fill, "fill") }), 8), el("circle", { cx, cy: top + 14, r: 5, fill: tokens.color.white, "stroke-width": tokens.outline.small }), ...eipIcon({ name: icon, x: cx - 38, y: top + 27, scale: 1.18 }).body),
235
+ g({ transform: `rotate(${rotate} ${cx} ${top + 20})` }, el("path", { d, fill: colour(fill, "fill") }), el("circle", { cx, cy: top + 14, r: 5, fill: tokens.color.white, "stroke-width": tokens.outline.small }), ...eipIcon({ name: icon, x: cx - 38, y: top + 27, scale: 1.18 }).body),
235
236
  ]);
236
237
  });
237
238
  /** Green round badge with a tick. */
238
239
  export const checkBadge = definePiece("checkBadge", { cx: pos(), cy: pos(), r: size() }, ({ cx, cy, r = 16 }) => drawn([
239
- el("circle", { cx, cy, r, fill: tokens.color.healthy, "stroke-width": tokens.outline.small }),
240
+ el("circle", { cx, cy, r, fill: tokens.color.state.healthy, "stroke-width": tokens.outline.small }),
240
241
  el("path", { d: `M${r2(cx - r * 0.42)},${cy} L${r2(cx - r * 0.1)},${r2(cy + r * 0.34)} L${r2(cx + r * 0.45)},${r2(cy - r * 0.32)}`, fill: "none", "stroke-width": 3.5, "stroke-linecap": "round" }),
241
242
  ]));
242
243
  /** Rubber stamp, round (dashed inner ring) or rectangular, tilted, with one word. */
243
- export const stamp = definePiece("stamp", { cx: pos(), cy: pos(), word: label(), fill: col(), r: size(false, 12), rotate: { kind: "number" }, shape: { kind: "enum", values: ["round", "rect"] } }, ({ cx, cy, word, fill = "color.healthy", r = 40, rotate = -12, shape = "round" }) => {
244
+ export const stamp = definePiece("stamp", { cx: pos(), cy: pos(), word: label(), fill: col(), r: size(false, 12), rotate: { kind: "number" }, shape: { kind: "enum", values: ["round", "rect"] } }, ({ cx, cy, word, fill = "color.state.healthy", r = 40, rotate = -12, shape = "round" }) => {
244
245
  const turn = `rotate(${rotate} ${cx} ${cy})`;
245
246
  const face = shape === "round"
246
247
  ? [
247
- ...shadowed(el("circle", { cx, cy, r, fill: colour(fill, "fill") }), 8),
248
+ el("circle", { cx, cy, r, fill: colour(fill, "fill") }),
248
249
  el("circle", { cx, cy, r: r - 10, fill: "none", stroke: tokens.color.white, "stroke-width": tokens.outline.small, "stroke-dasharray": "6 5" }),
249
250
  ]
250
251
  : [
251
- ...shadowed(el("rect", { x: cx - r * 1.6, y: cy - r * 0.7, width: r * 3.2, height: r * 1.4, rx: 8, fill: colour(fill, "fill") }), 8),
252
+ el("rect", { x: cx - r * 1.6, y: cy - r * 0.7, width: r * 3.2, height: r * 1.4, rx: 8, fill: colour(fill, "fill") }),
252
253
  el("rect", { x: cx - r * 1.6 + 8, y: cy - r * 0.7 + 8, width: r * 3.2 - 16, height: r * 1.4 - 16, rx: 4, fill: "none", stroke: tokens.color.white, "stroke-width": tokens.outline.small }),
253
254
  ];
254
255
  return drawn([g({ transform: turn }, ...face)], [el("text", { x: cx, y: cy + 10, "font-size": 27, "font-weight": tokens.font.weightHeavy, transform: turn }, word)]);
255
256
  });
256
- /** Robot: antenna, ears, green body with a visor and two eyes, mouth bars. Scale it with pose. */
257
+ /** Robot in the v2 grammar: white body and ears, a dark visor with the cast's idle eyes, one grille bar, the accent on the antenna tip. Scale it with pose. */
257
258
  export const robot = definePiece("robot", { cx: pos(), top: pos() }, ({ cx, top }) => {
258
259
  const w = 160;
259
260
  const h = 152;
260
261
  const x = cx - w / 2;
261
262
  return drawn([
262
263
  el("line", { x1: cx, y1: top, x2: cx, y2: top - 28 }),
263
- el("circle", { cx, cy: top - 34, r: 10, fill: tokens.color.blocked }),
264
- el("rect", { x: x - 16, y: top + 44, width: 20, height: 52, rx: 6, fill: tokens.illustration.healthyShade }),
265
- el("rect", { x: x + w - 4, y: top + 44, width: 20, height: 52, rx: 6, fill: tokens.illustration.healthyShade }),
266
- ...shadowed(el("rect", { x, y: top, width: w, height: h, rx: 22, fill: tokens.color.healthy })),
267
- el("rect", { x: x + 22, y: top + 22, width: w - 44, height: 72, rx: 14, fill: ink }),
268
- el("circle", { cx: cx - 23, cy: top + 58, r: 11, fill: tokens.color.healthy, stroke: "none" }),
269
- el("circle", { cx: cx + 23, cy: top + 58, r: 11, fill: tokens.color.healthy, stroke: "none" }),
270
- g({ stroke: "none", fill: ink }, el("rect", { x: x + 30, y: top + 108, width: 44, height: 9, rx: 4.5 }), el("rect", { x: x + 82, y: top + 108, width: 48, height: 9, rx: 4.5 }), el("rect", { x: x + 42, y: top + 124, width: 60, height: 9, rx: 4.5 })),
264
+ el("circle", { cx, cy: top - 34, r: 10, fill: tokens.brand.light.accent }),
265
+ el("rect", { x: x - 16, y: top + 44, width: 20, height: 52, rx: 6, fill: tokens.color.white }),
266
+ el("rect", { x: x + w - 4, y: top + 44, width: 20, height: 52, rx: 6, fill: tokens.color.white }),
267
+ el("rect", { x, y: top, width: w, height: h, rx: 22, fill: tokens.color.white }),
268
+ el("rect", { x: x + 22, y: top + 22, width: w - 44, height: 72, rx: 14, fill: tokens.brand.light.text }),
269
+ ...[-23, 23].map((dx) => el("rect", { x: r2(cx + dx - 6.4), y: top + 43, width: 12.8, height: 30, rx: 6.4, fill: tokens.cast.eyes, stroke: "none" })),
270
+ g({ stroke: "none", fill: tokens.brand.light.border }, el("rect", { x: x + 44, y: top + 114, width: 72, height: 9, rx: 4.5 })),
271
271
  ]);
272
272
  });
273
273
  /** Magnifier: lens centred on (cx, cy), handle to the bottom right. */
@@ -284,25 +284,25 @@ export const magnifier = definePiece("magnifier", { cx: pos(), cy: pos(), r: siz
284
284
  ]);
285
285
  });
286
286
  /** Stack of server units; the `failing` unit (0-based) shows a red light. */
287
- export const serverStack = definePiece("serverStack", { x: pos(), y: pos(), width: size(), units: count(1, 20), fill: col(), failing: count(0, 19) }, ({ x, y, width: w = 150, units = 3, fill = "color.backend", failing }) => {
287
+ export const serverStack = definePiece("serverStack", { x: pos(), y: pos(), width: size(), units: count(1, 20), fill: col(), failing: count(0, 19) }, ({ x, y, width: w = 150, units = 3, fill = "color.white", failing }) => {
288
288
  const uh = 40;
289
289
  const gap = 10;
290
290
  return drawn(Array.from({ length: units }, (_, i) => {
291
291
  const uy = y + i * (uh + gap);
292
292
  return [
293
293
  ...shadowed(el("rect", { x, y: uy, width: w, height: uh, rx: 8, fill: colour(fill, "fill") })),
294
- el("rect", { x: x + 16, y: uy + 15, width: r2(w * 0.5), height: 10, rx: 5, fill: tokens.color.white, stroke: "none" }),
295
- el("circle", { cx: x + w - 24, cy: uy + 20, r: 6, fill: i === failing ? tokens.color.failure : tokens.color.white, "stroke-width": tokens.outline.small }),
294
+ el("rect", { x: x + 16, y: uy + 15, width: r2(w * 0.5), height: 10, rx: 5, fill: tokens.illustration.textBar, stroke: "none" }),
295
+ el("circle", { cx: x + w - 24, cy: uy + 20, r: 6, fill: i === failing ? tokens.color.state.failure : tokens.color.white, "stroke-width": tokens.outline.small }),
296
296
  ];
297
297
  }).flat());
298
298
  });
299
299
  export const cloud = definePiece("cloud", { cx: pos(), cy: pos(), scale: size(), fill: col() }, ({ cx, cy, scale: s = 1, fill = "color.white" }) => {
300
300
  const p = (dx, dy) => `${r2(cx + dx * s)},${r2(cy + dy * s)}`;
301
301
  const d = `M${p(-70, 30)} Q${p(-96, 30)} ${p(-94, 4)} Q${p(-90, -20)} ${p(-62, -18)} Q${p(-52, -58)} ${p(-10, -54)} Q${p(26, -52)} ${p(36, -24)} Q${p(86, -30)} ${p(90, 6)} Q${p(92, 30)} ${p(66, 30)} Z`;
302
- return drawn(shadowed(el("path", { d, fill: colour(fill, "fill") }), 8));
302
+ return drawn([el("path", { d, fill: colour(fill, "fill") })]);
303
303
  });
304
- /** Gear with square teeth and a white hub, as on the maven-release cover. */
305
- export const gear = definePiece("gear", { cx: pos(), cy: pos(), r: size(), teeth: count(4, 64), fill: col() }, ({ cx, cy, r = 84, teeth = 12, fill = "color.transitional" }) => {
304
+ /** Gear with square teeth and a hub, as on the maven-release cover. */
305
+ export const gear = definePiece("gear", { cx: pos(), cy: pos(), r: size(), teeth: count(4, 64), fill: col() }, ({ cx, cy, r = 84, teeth = 12, fill = "color.white" }) => {
306
306
  const root = r * 0.78;
307
307
  const points = [];
308
308
  const step = (2 * Math.PI) / teeth;
@@ -311,18 +311,18 @@ export const gear = definePiece("gear", { cx: pos(), cy: pos(), r: size(), teeth
311
311
  const a = i * step;
312
312
  points.push(at(root, a - step * 0.3), at(r, a - step * 0.18), at(r, a + step * 0.18), at(root, a + step * 0.3));
313
313
  }
314
- return drawn([...shadowed(el("polygon", { points: points.join(" "), fill: colour(fill, "fill") })), el("circle", { cx, cy, r: r2(r * 0.36), fill: tokens.color.white })]);
314
+ return drawn([...shadowed(el("polygon", { points: points.join(" "), fill: colour(fill, "fill") })), el("circle", { cx, cy, r: r2(r * 0.36), fill: tokens.brand.light.bg })]);
315
315
  });
316
316
  /** Parcel (box) with a lid line and a tape strip. */
317
- export const parcel = definePiece("parcel", { x: pos(), y: pos(), size: size(), fill: col() }, ({ x, y, size: s = 96, fill = "color.blocked" }) => drawn([
317
+ export const parcel = definePiece("parcel", { x: pos(), y: pos(), size: size(), fill: col() }, ({ x, y, size: s = 96, fill = "color.white" }) => drawn([
318
318
  ...shadowed(el("rect", { x, y, width: s, height: r2(s * 0.8), rx: 6, fill: colour(fill, "fill") })),
319
319
  el("path", { d: `M${x},${r2(y + s * 0.3)} H${x + s}`, fill: "none", "stroke-width": tokens.outline.small }),
320
320
  el("rect", { x: x + s / 2 - 12, y, width: 24, height: r2(s * 0.8), fill: tokens.illustration.tape, "stroke-width": tokens.outline.small }),
321
321
  ]));
322
322
  /** Steps climbing to the right from the bottom-left corner (x, y), as on the obsidian-to-site guide cover. */
323
- export const steps = definePiece("steps", { x: pos(), y: pos(), count: count(1, 20), width: size(), rise: size(), fill: col() }, ({ x, y, count = 4, width: w = 145, rise = 40, fill = "color.caller" }) => {
323
+ export const steps = definePiece("steps", { x: pos(), y: pos(), count: count(1, 20), width: size(), rise: size(), fill: col() }, ({ x, y, count = 4, width: w = 145, rise = 40, fill = "color.white" }) => {
324
324
  const blocks = Array.from({ length: count }, (_, i) => el("rect", { x: x + i * w, y: y - rise * (i + 1), width: w, height: rise * (i + 1), rx: 10, fill: colour(fill, "fill") }));
325
- return drawn([...blocks.map((b) => ({ ...b, attrs: { ...b.attrs, fill: ink, transform: `translate(${tokens.shadow.block} ${tokens.shadow.block})` } })), ...blocks]);
325
+ return drawn(blocks);
326
326
  });
327
327
  const muleGlyph = (kind, cx, cy) => {
328
328
  const line = { fill: "none", "stroke-linecap": "round" };
@@ -345,7 +345,7 @@ export const muleFlow = definePiece("muleFlow", {
345
345
  tiles: { kind: "array", required: true, minItems: 1, of: { kind: "object", fields: { x: pos(), kind: { kind: "enum", required: true, values: ["scatter-gather", "choice", "for-each"] } } } },
346
346
  tileWidth: size(false, 40),
347
347
  fill: col(),
348
- }, ({ x, y, width: w, height: h = 104, tiles, tileWidth = 86, fill = "color.caller" }) => {
348
+ }, ({ x, y, width: w, height: h = 104, tiles, tileWidth = 86, fill = "brand.light.bg" }) => {
349
349
  const cy = y + h / 2;
350
350
  const links = [`M${x + 18},${cy} H${tiles[0].x - 6}`];
351
351
  const heads = [];
@@ -358,7 +358,7 @@ export const muleFlow = definePiece("muleFlow", {
358
358
  ...shadowed(el("rect", { x, y, width: w, height: h, rx: 22, fill: colour(fill, "fill") })),
359
359
  el("path", { d: links.join(" "), "stroke-linecap": "round" }),
360
360
  ...heads,
361
- ...tiles.flatMap((tile) => shadowed(el("rect", { x: tile.x, y: y + 14, width: tileWidth, height: h - 28, rx: 14, fill: tokens.color.white }), 6)),
361
+ ...tiles.map((tile) => el("rect", { x: tile.x, y: y + 14, width: tileWidth, height: h - 28, rx: 14, fill: tokens.color.white })),
362
362
  ...tiles.flatMap((tile) => muleGlyph(tile.kind, tile.x + tileWidth / 2, cy)),
363
363
  ]);
364
364
  });
@@ -400,7 +400,6 @@ export const PIECES = {
400
400
  linkIcon,
401
401
  ...DIAGRAM_PIECES,
402
402
  stateStart,
403
- mascot,
404
403
  emote,
405
404
  mira,
406
405
  visor,
@@ -3,7 +3,8 @@ import { type SurfaceName } from "./metro.ts";
3
3
  export type LinkIcon = {
4
4
  readonly name: string;
5
5
  readonly title: string;
6
- readonly description: string; /** A colour token path. */
6
+ readonly description: string;
7
+ /** The face colour of the site's 0.6 sticker, a colour token path; since 0.7.0 `linkIcon` draws every face white. */
7
8
  readonly face: string;
8
9
  readonly glyph: readonly SvgNode[];
9
10
  };
@@ -2,8 +2,10 @@
2
2
  // of stackledger-map-and-link-pieces): the social stickers of brunosouzas.com
3
3
  // (public/images/home/social-*.svg at e29b3dd), with every colour replaced by
4
4
  // its token, plus a `website` globe in the same style. `linkIcon` draws the
5
- // site's frame (light, or dark with its rim) around the face and the glyph, at
6
- // the site's measures (46 box, face 38 at 2, radius 9, outline 2.5).
5
+ // face white with its outline and no frame behind it (ADR 0009: no hard shadow,
6
+ // colour only where it means something), then the glyph, at the site's measures
7
+ // (46 box, face 38 at 2, radius 9, outline 2.5). On the dark surface the face's
8
+ // outline is surface.dark.muted; the glyph, inside the white face, stays ink.
7
9
  //
8
10
  // Credit: the GitHub mark is Font Awesome's (fontawesome.com), licensed
9
11
  // CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); its description
@@ -13,7 +15,7 @@
13
15
  // a link, a style, a script or a URL, so the output can ship as a static file.
14
16
  import { tokens } from "../../tokens/generated/tokens.js";
15
17
  import { drawn, el, g, r2 } from "./node.js";
16
- import { colour, pos, size } from "./params.js";
18
+ import { pos, size } from "./params.js";
17
19
  import { definePiece } from "./piece.js";
18
20
  import { SURFACES } from "./metro.js";
19
21
  const C = tokens.color;
@@ -32,7 +34,7 @@ export const LINK_ICONS = [
32
34
  name: "linkedin",
33
35
  title: "LinkedIn",
34
36
  description: "LinkedIn icon.",
35
- face: "color.caller",
37
+ face: "color.state.caller",
36
38
  glyph: [
37
39
  el("rect", { x: 12, y: 18.5, width: 4, height: 11.5, rx: 1, fill: INK, stroke: "none" }),
38
40
  el("circle", { cx: 14, cy: 13.8, r: 2.4, fill: INK, stroke: "none" }),
@@ -43,7 +45,7 @@ export const LINK_ICONS = [
43
45
  name: "email",
44
46
  title: "Email",
45
47
  description: "Email icon.",
46
- face: "color.transitional",
48
+ face: "color.state.transitional",
47
49
  glyph: [
48
50
  el("rect", { x: 9, y: 13, width: 24, height: 17, rx: 3, fill: C.white, stroke: INK, "stroke-width": 2.5 }),
49
51
  el("path", { d: "M10,15 L21,23 L32,15", fill: "none", stroke: INK, "stroke-width": 2.5, "stroke-linejoin": "round" }),
@@ -53,7 +55,7 @@ export const LINK_ICONS = [
53
55
  name: "website",
54
56
  title: "Website",
55
57
  description: "Website icon: a globe.",
56
- face: "color.healthy",
58
+ face: "color.state.healthy",
57
59
  glyph: [
58
60
  el("circle", { cx: 21, cy: 21, r: 10.5, fill: C.white, stroke: INK, "stroke-width": 2.5 }),
59
61
  el("ellipse", { cx: 21, cy: 21, rx: 4.6, ry: 10.5, fill: "none", stroke: INK, "stroke-width": 2 }),
@@ -62,19 +64,9 @@ export const LINK_ICONS = [
62
64
  },
63
65
  ];
64
66
  export const LINK_ICON_NAMES = LINK_ICONS.map((icon) => icon.name);
65
- /** The site's frame: the shadow (and on dark the rim) behind the face. */
66
- const frame = (surface) => {
67
- const s = tokens.surface[surface];
68
- return s.rimWidth > 0
69
- ? [
70
- el("rect", { x: 4, y: 4, width: 41, height: 41, rx: 11, fill: s.shadow, stroke: "none" }),
71
- el("rect", { x: 0.5, y: 0.5, width: 41, height: 41, rx: 11, fill: s.rim, stroke: "none" }),
72
- ]
73
- : [el("rect", { x: 5, y: 5, width: 38, height: 38, rx: 9, fill: s.shadow, stroke: "none" })];
74
- };
75
67
  /** One link sticker at (x, y), `size` wide (46 by default), on the light or the dark page. */
76
68
  export const linkIcon = definePiece("linkIcon", { icon: { kind: "enum", required: true, values: LINK_ICON_NAMES }, x: pos(), y: pos(), size: size(), surface: { kind: "enum", values: SURFACES } }, ({ icon, x, y, size: side = LINK_ICON_SIZE, surface = "light" }) => {
77
69
  const data = LINK_ICONS.find((candidate) => candidate.name === icon);
78
- const face = el("rect", { x: 2, y: 2, width: 38, height: 38, rx: 9, fill: colour(data.face, "face"), stroke: INK, "stroke-width": 2.5 });
79
- return drawn([g({ transform: `translate(${r2(x)} ${r2(y)}) scale(${side / LINK_ICON_SIZE})`, stroke: "none" }, ...frame(surface), face, ...data.glyph)]);
70
+ const face = el("rect", { x: 2, y: 2, width: 38, height: 38, rx: 9, fill: C.white, stroke: surface === "dark" ? tokens.surface.dark.muted : INK, "stroke-width": 2.5 });
71
+ return drawn([g({ transform: `translate(${r2(x)} ${r2(y)}) scale(${side / LINK_ICON_SIZE})`, stroke: "none" }, face, ...data.glyph)]);
80
72
  });
@@ -82,7 +82,8 @@ export type LedgerMarkParams = {
82
82
  surface?: SurfaceName;
83
83
  };
84
84
  /** stackledger's mark (favicon, header): an ink square with a bent line and two stations, 32 units scaled to `size`.
85
- * On a surface with a rim (dark), a light rim of 2 × rimWidth lines the square inside its 32 box (card 167). */
85
+ * On the dark surface a 2-unit band in surface.dark.muted lines the square inside its 32 box, whatever rimWidth is,
86
+ * so the ink square never sits bare on the dark background (ADR 0009). The stations inside the square stay ink. */
86
87
  export declare const ledgerMark: import("./piece.ts").Piece<LedgerMarkParams>;
87
88
  export type RenewalRingParams = Ink & {
88
89
  cx: number;
@@ -90,7 +91,8 @@ export type RenewalRingParams = Ink & {
90
91
  r: number;
91
92
  width?: number;
92
93
  };
93
- /** The renewal ring: bands like a bent pipe round a station (rim on dark, ink, then color.blocked), no shadow. */
94
+ /** The renewal ring: bands like a bent pipe round a station (a rim when the surface has one, the ink line, then
95
+ * color.state.blocked), no shadow. */
94
96
  export declare const renewalRing: import("./piece.ts").Piece<RenewalRingParams>;
95
97
  export type SuggestedHaloParams = {
96
98
  cx: number;
@@ -29,10 +29,10 @@ export const lineBadge = definePiece("lineBadge", { x: pos(), y: pos(), text: la
29
29
  const { x, y, text, fill, height = M.badgeHeight, flat = false } = params;
30
30
  const width = badgeWidth(params);
31
31
  const face = paint(fill);
32
- const { outline } = inkOf(params);
32
+ const { line, outline } = inkOf(params);
33
33
  const inset = flat ? outline / 2 : 0;
34
34
  const shape = pill(x - width / 2 + inset, y - height / 2 + inset, width - 2 * inset, height - 2 * inset);
35
- const body = flat ? [shape(0, 0, { fill: face, stroke: ink, "stroke-width": r2(outline), "stroke-linejoin": "round" })] : sticker(shape, face, params);
35
+ const body = flat ? [shape(0, 0, { fill: face, stroke: line, "stroke-width": r2(outline), "stroke-linejoin": "round" })] : sticker(shape, face, params);
36
36
  return drawn(body, text === undefined ? [] : [words(x, y + 4.5, text, { fill: white, "font-size": M.badgeTextSize, "font-weight": bold, "text-anchor": "middle" })]);
37
37
  }, (params) => {
38
38
  const height = params.height ?? M.badgeHeight;
@@ -141,7 +141,7 @@ const drawNode = (kind, params) => {
141
141
  words(x + inset, middle - 3, title, { fill: titleFill, "font-size": M.labelSize, "font-weight": bold, "text-anchor": "start" }),
142
142
  words(x + inset, middle + 14, subtitle, { fill: focus ? ink : s.muted, "font-size": 11, "font-weight": 400, "text-anchor": "start" }),
143
143
  ];
144
- return drawn(sticker(shape, focus ? tokens.color.caller : s.panel, params), text);
144
+ return drawn(sticker(shape, focus ? tokens.color.state.caller : s.panel, params), text);
145
145
  };
146
146
  /** A diagram box (a skill, a software item): rounded rect with a title and an optional subtitle. */
147
147
  export const nodeBlock = definePiece("nodeBlock", { ...nodeSchema, radius: { kind: "number", min: 0, max: MAX_SIZE } }, (p) => drawNode("box", p), nodeLimits("box"));
@@ -165,7 +165,7 @@ export const messageArrow = definePiece("messageArrow", {
165
165
  surface: surfaceParam,
166
166
  }, ({ from, to, curve = "bezier", controls, head = true, heads = "end", dashed, label: text, width = M.edgeWidth, kind = "message", surface = "light" }) => {
167
167
  const s = tokens.surface[surface];
168
- const paint_ = kind === "failure" ? tokens.color.failure : kind === "failFast" ? tokens.color.failFast : s.text;
168
+ const paint_ = kind === "failure" ? tokens.color.state.failure : kind === "failFast" ? tokens.color.state.failFast : s.text;
169
169
  const length = 5 * width;
170
170
  const distance = Math.hypot(to[0] - from[0], to[1] - from[1]);
171
171
  const dx = to[0] - from[0];
@@ -221,13 +221,13 @@ export const messageArrow = definePiece("messageArrow", {
221
221
  return limits(head === false && heads !== undefined && { path: "heads", message: "cannot be combined with head: false" }, distance === 0 && { path: "to", message: "must differ from from" }, distance > 0 && head && distance < need && { path: "to", message: `is too close to from for the ${heads === "both" ? "heads" : "head"}: needs at least ${r2(need)}, found ${r2(distance)}` }, controls !== undefined && curve !== undefined && { path: "controls", message: "cannot be combined with curve" });
222
222
  });
223
223
  /** stackledger's mark (favicon, header): an ink square with a bent line and two stations, 32 units scaled to `size`.
224
- * On a surface with a rim (dark), a light rim of 2 × rimWidth lines the square inside its 32 box (card 167). */
224
+ * On the dark surface a 2-unit band in surface.dark.muted lines the square inside its 32 box, whatever rimWidth is,
225
+ * so the ink square never sits bare on the dark background (ADR 0009). The stations inside the square stay ink. */
225
226
  export const ledgerMark = definePiece("ledgerMark", { x: pos(), y: pos(), size: { kind: "number", min: 12, max: 512 }, line: col(), surface: surfaceParam }, ({ x, y, size: side = 32, line = "illustration.accent", surface = "light" }) => {
226
- const { rimWidth, rim } = tokens.surface[surface];
227
- const band = 2 * rimWidth;
228
- const square = rimWidth > 0
227
+ const band = 2;
228
+ const square = surface === "dark"
229
229
  ? [
230
- el("rect", { x: 0, y: 0, width: 32, height: 32, rx: 7, fill: rim, stroke: "none" }),
230
+ el("rect", { x: 0, y: 0, width: 32, height: 32, rx: 7, fill: tokens.surface.dark.muted, stroke: "none" }),
231
231
  el("rect", { x: band, y: band, width: 32 - 2 * band, height: 32 - 2 * band, rx: 7 - band, fill: ink, stroke: "none" }),
232
232
  ]
233
233
  : [el("rect", { x: 0, y: 0, width: 32, height: 32, rx: 7, fill: ink, stroke: "none" })];
@@ -235,13 +235,14 @@ export const ledgerMark = definePiece("ledgerMark", { x: pos(), y: pos(), size:
235
235
  g({ transform: `translate(${r2(x)} ${r2(y)}) scale(${side / 32})` }, ...square, el("path", { d: "M7 23 L14 16 L25 16", fill: "none", stroke: colour(line, "line"), "stroke-width": 4.5, "stroke-linecap": "round", "stroke-linejoin": "round" }), el("circle", { cx: 14, cy: 16, r: 4, fill: white, stroke: ink, "stroke-width": 2 }), el("circle", { cx: 25, cy: 16, r: 2.6, fill: white, stroke: ink, "stroke-width": 1.6 })),
236
236
  ]);
237
237
  });
238
- /** The renewal ring: bands like a bent pipe round a station (rim on dark, ink, then color.blocked), no shadow. */
238
+ /** The renewal ring: bands like a bent pipe round a station (a rim when the surface has one, the ink line, then
239
+ * color.state.blocked), no shadow. */
239
240
  export const renewalRing = definePiece("renewalRing", { cx: pos(), cy: pos(), r: size(true), width: { kind: "number", min: 0, exclusiveMin: true, max: 50 }, ...inkSchema }, (params) => {
240
241
  const { cx, cy, r, width = M.ringWidth } = params;
241
- const { s, outline, rim } = inkOf(params);
242
+ const { s, line, outline, rim } = inkOf(params);
242
243
  // Radius and band widths as given, like pipe's widths: a valid hairline must not round to zero.
243
244
  const band = (stroke, strokeWidth) => el("circle", { cx: r2(cx), cy: r2(cy), r, fill: "none", stroke, "stroke-width": strokeWidth });
244
- return drawn([...(s.rimWidth > 0 ? [band(s.rim, width + outline + 2 * rim)] : []), band(ink, width + outline), band(tokens.color.blocked, width)]);
245
+ return drawn([...(s.rimWidth > 0 ? [band(s.rim, width + outline + 2 * rim)] : []), band(line, width + outline), band(tokens.color.state.blocked, width)]);
245
246
  }, (params) => {
246
247
  const { outline, rim } = inkOf(params);
247
248
  const need = ((params.width ?? M.ringWidth) + outline + 2 * rim) / 2;
@@ -253,7 +254,7 @@ export const suggestedHalo = definePiece("suggestedHalo", { cx: pos(), cy: pos()
253
254
  export const licenceMark = definePiece("licenceMark", { cx: pos(), cy: pos(), state: { kind: "enum", values: ["owned", "toBuy"] }, size: size(), ...inkSchema }, (params) => {
254
255
  const { cx, cy, state = "owned", size: side = M.licenceSize } = params;
255
256
  const shape = (dx, dy, attrs) => el("circle", { cx: r2(cx + dx), cy: r2(cy + dy), r: r2(side / 2), ...attrs });
256
- return drawn(sticker(shape, state === "owned" ? tokens.color.healthy : white, params));
257
+ return drawn(sticker(shape, state === "owned" ? tokens.color.state.healthy : white, params));
257
258
  }, (params) => {
258
259
  const need = 3 * inkOf(params).outline;
259
260
  const side = params.size ?? M.licenceSize;