@brunosouzas/design-system 0.16.0 → 0.17.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
@@ -33,7 +33,7 @@ The blog's articles explain how systems behave: a circuit breaker opening, a pip
33
33
 
34
34
  - **Design tokens, one source.** Colours with fixed meanings (green healthy, orange blocked, yellow transitional, red the failure path, under `color.state.*`), the brand palette, the Source type stacks (Source Sans 3, Source Code Pro, Source Serif 4), the thick ink outline, radii, and motion timings. Exported as CSS variables for the site, TypeScript for the animations and JSON for anything else (the SVG generators of the static diagrams).
35
35
  - **Motion components.** React components for [Remotion](https://www.remotion.dev): an ink block, a pill label, an arrow that draws itself, a token travelling along a transition, call-result squares, a countdown ring. Flow primitives in `src/brand/flow-components.tsx` add a white hexagonal `Exchange`, rail-ended `Queue`, white-tab `TaggedContainer` and persistent `PositionedToken` (stationary or path-positioned; an optional `radius`, 17 by default). `FailureRateBar` (`src/brand/rate-bar.tsx`, its pure shapes in `rate-bar-shape.ts`) draws a failure rate against a threshold: a white track, a `color.state.failure` fill at least as wide as its height and never wider than the track, and an ink tick; a rate outside [0, 1], a threshold outside (0, 1) or a size that is not a positive finite number throws a `RangeError` naming the prop. Copy identities, splits and ACK/NACK rules belong to scenes, not to a generic message engine.
36
- - **Illustration pieces.** The objects the blog's covers and diagrams draw again and again (pill label, sheet, code panel, robot, server stack, gear, road, the 26 EIP icons and more), each a pure TypeScript function that returns an SVG node tree from the tokens. The same tree becomes an SVG file for a cover and React elements for a scene, and a scene animates a piece by recomputing its parameters every frame. See [Illustration pieces and covers](#illustration-pieces-and-covers).
36
+ - **Illustration pieces.** The objects the blog's covers and diagrams draw again and again (pill label, sheet, code panel, robot, server stack, gear, road, the 27 EIP icons and more), each a pure TypeScript function that returns an SVG node tree from the tokens. The same tree becomes an SVG file for a cover and React elements for a scene, and a scene animates a piece by recomputing its parameters every frame. See [Illustration pieces and covers](#illustration-pieces-and-covers).
37
37
  - **A cast and emotes.** Mira, four pillar characters (Visor, Drone, Kiu, Sinal) and two supporting characters for the human roles (Balão, the requester and approver; Chaves, the developer), six bank objects for scenery, and eight reaction symbols with a fixed meaning, so a video can tell its story without words. See [The cast and the emotes](#the-cast-and-the-emotes).
38
38
  - **A catalogue of scenes.** Each scene animates something a published article already says. The first two are in 16:9 (article) and 4:5 (LinkedIn), in Portuguese and English from one text table; new scenes are one language-neutral 16:9 video ([ADR 0005](docs/adr/0005-neutral-videos-and-the-cast.md)). The first is the [circuit-breaker state machine](docs/spikes/2026-10-22-motion-pilot/README.md).
39
39
 
@@ -41,8 +41,10 @@ The style started from the illustration covers of the [Spotify Engineering blog]
41
41
 
42
42
  ## How it works
43
43
 
44
+ The context, the flows and the module map are in [docs/architecture.md](docs/architecture.md).
45
+
44
46
  ```text
45
- tokens/source.json ──► tokens/generated/tokens.css ──► brunosouzas.com (site repository, planned)
47
+ tokens/source.json ──► tokens/generated/tokens.css ──► brunosouzas.com (site repository)
46
48
  ├─► tokens/generated/tokens.ts ──► src/brand (motion components) ──► src/scenes ──► MP4 per format (and language, for a localised scene)
47
49
  └─► tokens/generated/tokens.json ──► other scripts
48
50
 
@@ -422,7 +424,7 @@ Add it to `src/pieces/library.ts` (or `src/pieces/metro.ts` for a map or diagram
422
424
 
423
425
  - `uiIcon({ name, x, y, size, colour })` draws one of seven glyphs of the sites' chrome in a 24-unit box and one token colour: `sun`, `moon`, `zoomIn`, `zoomOut`, `reset`, `calendar`, `download` (data in `UI_ICONS`). `colour: "currentColor"` makes the icon follow its element's text colour (a button that inverts on hover, say); it only works when the SVG is inline in the page, since an `<img>` does not inherit the page's colour, and a cover spec refuses it.
424
426
  - `linkIcon({ icon, x, y, size, surface })` draws a link sticker in a 46-unit box, a white face with its outline and no frame (on dark the outline takes `surface.dark.muted`): `github`, `linkedin`, `email`, `website`, `stackledger` and `brunosouzas` (data in `LINK_ICONS`, names in `LINK_ICON_NAMES`). `stackledger` is the product's mark on the white face: `ledgerMark`'s bent line in `illustration.accent` through its two white stations with ink outlines, the face being the page, so one outline. `brunosouzas` is the brand symbol, the b with the moon of the favicon and the avatar (`symbol`'s own shapes, at 0.875 and centred on the face), in the light symbol's colours on both surfaces; title `brunosouzas.com`. Use it for every link to brunosouzas.com, so the link needs no words; `website` stays the generic globe for any other site. Every link icon is its own piece and its own file (an icon spec with one `linkIcon` writes it alone); the package has no combined icon or row, so a consumer lays out the separate icons itself. The GitHub mark is from [Font Awesome](https://fontawesome.com/), licensed [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
425
- - `categoryIcon({ category, x, y, scale })` draws the site's category badge in a 42-unit box: a disc in the default tone of the category's track (`coverBackground.<track>.fill`, ringed in its `.ring`) with a glyph on it, the same on light and dark pages. `integration` (`trackIntegration`, the notation's `pointToPointChannel`), `delivery` (`trackDelivery`, `gateToProduction`), `aiEngineering` (`trackAi`, `contextWindow`), `personalTools` (`trackPersonal`, its own wrench and screwdriver); names in `CATEGORY_ICON_NAMES`. At `scale` 4 it is the 168-pixel badge the site shows.
427
+ - `categoryIcon({ category, x, y, scale })` draws the site's category badge in a 42-unit box: a disc in the default tone of the category's track (`coverBackground.<track>.fill`, ringed in its `.ring`) with a glyph on it, the same on light and dark pages. `integration` (`trackIntegration`, the notation's `pointToPointChannel`), `delivery` (`trackDelivery`, `gateToProduction`), `aiEngineering` (`trackAi`, `contextWindow`), `personalTools` (`trackPersonal`, its own wrench and screwdriver), and the projects page's `mulesoft` (`trackIntegration`, its own systems joined by an API) and `contributions` (`trackDelivery`, its own pull request); names in `CATEGORY_ICON_NAMES`. At `scale` 4 it is the 168-pixel badge the site shows.
426
428
  - None holds a link, a style, a script or a URL, so a consumer can write one with `toSvg` inside its own `<svg xmlns=…>` and ship it as a static file.
427
429
 
428
430
  ```ts
@@ -432,7 +434,7 @@ const github = toSvg(el("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "
432
434
 
433
435
  ### EIP icons
434
436
 
435
- `src/pieces/eip-icons.ts` holds the 26 Enterprise Integration Patterns icons as data. They are redrawn from the icons by Gregor Hohpe and Bobby Woolf ([enterpriseintegrationpatterns.com](https://www.enterpriseintegrationpatterns.com/)), licensed [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/); each icon keeps that credit in its description. Like every other piece, they draw no hard offset shadow (ADR 0009): the 46 ink copies the published notation drew under its faces were removed in change `flat-eip-icons-and-empty-queue`, so `eipIcon`, `nameTag` and any cover or scene that draws an icon look flat from the next release. The tests in `test/pieces/eip-icons.test.ts` and "Every cover piece is flat" in `test/pieces/node.test.ts` apply the rule in `test/pieces/eip-shadows.ts` and find any such copy again.
437
+ `src/pieces/eip-icons.ts` holds 27 Enterprise Integration Patterns icons as data. They are redrawn from the icons by Gregor Hohpe and Bobby Woolf ([enterpriseintegrationpatterns.com](https://www.enterpriseintegrationpatterns.com/)), licensed [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/); each icon keeps that credit in its description. Like every other piece, they draw no hard offset shadow (ADR 0009): the 46 ink copies the published notation drew under its faces were removed in change `flat-eip-icons-and-empty-queue`, so `eipIcon`, `nameTag` and any cover or scene that draws an icon look flat from the next release. The tests in `test/pieces/eip-icons.test.ts` and "Every cover piece is flat" in `test/pieces/node.test.ts` apply the rule in `test/pieces/eip-shadows.ts` and find any such copy again.
436
438
 
437
439
  ## Upgrading to 0.13.0
438
440
 
@@ -1,6 +1,6 @@
1
1
  // The brand notation: 19 icons (13 EIP + 3 delivery + 3 AI), one grammar,
2
2
  // used on covers, home, LinkedIn and GitHub (identity studio I11). Separate
3
- // from the 26 body-diagram icons (`eip-icons.ts`): never shared, never the
3
+ // from the 27 body-diagram icons (`eip-icons.ts`): never shared, never the
4
4
  // same export (review finding S of card 268's spec round). Redraws each
5
5
  // pattern's market-recognised silhouette in the new ink-outline grammar —
6
6
  // never the EIP book's own artwork, per the brand strategy.
@@ -1,4 +1,4 @@
1
- export declare const CATEGORY_ICON_NAMES: readonly ["integration", "delivery", "aiEngineering", "personalTools"];
1
+ export declare const CATEGORY_ICON_NAMES: readonly ["integration", "delivery", "aiEngineering", "personalTools", "mulesoft", "contributions"];
2
2
  export type CategoryIconName = (typeof CATEGORY_ICON_NAMES)[number];
3
3
  /** The badge's box before `scale` (spec cover-cli, "Icon output"). */
4
4
  export declare const CATEGORY_ICON_SIZE = 42;
@@ -8,5 +8,5 @@ export type CategoryIconParams = {
8
8
  y: number;
9
9
  scale?: number;
10
10
  };
11
- /** One of the site's four category badges: the glyph on a disc in its track's default tone, a 42×42 box before `scale`. */
11
+ /** One of the site's category badges: the glyph on a disc in its track's default tone, a 42×42 box before `scale`. */
12
12
  export declare const categoryIcon: import("./piece.ts").Piece<CategoryIconParams>;
@@ -1,16 +1,19 @@
1
1
  // The site's category badge (change site-palette-and-category-badges, design.md
2
- // Decision 2; owner's choice Q7 of card 302): a disc in the default tone of the
3
- // category's track family, ringed in that tone's cover ring, with a glyph on
4
- // it. Integration, delivery and AI take a brand notation glyph; personal tools
5
- // keeps its own (a wrench crossing a screwdriver, a ring for the bolt), ported
6
- // from `~/.hermes/cache/scratch/ab267/phase4.py`'s `cat_icon()`. The geometry is
7
- // the approved preview (`~/.hermes/cache/scratch/ab302/cat/cat.mjs`, 168 x 168)
8
- // at a quarter: a 42 x 42 box before `scale`.
2
+ // Decision 2; owner's choice Q7 of card 302): a disc in the default tone of a
3
+ // track family, ringed in that tone's cover ring, with a glyph on it, in a
4
+ // 42 x 42 box before `scale`. Integration, delivery and AI take a brand
5
+ // notation glyph. Personal tools keeps its own (a wrench crossing a
6
+ // screwdriver, a ring for the bolt), ported from
7
+ // `~/.hermes/cache/scratch/ab267/phase4.py`'s `cat_icon()`. The disc and those
8
+ // four glyphs are the approved preview
9
+ // (`~/.hermes/cache/scratch/ab302/cat/cat.mjs`, 168 x 168) at a quarter. The
10
+ // projects page's MuleSoft and Contributions draw their own glyphs (change
11
+ // project-category-and-recipient-list-icons).
9
12
  import { brandNotationIcon } from "./brand-notation-icons.js";
10
13
  import { drawn, el, g } from "./node.js";
11
14
  import { colour, num, pos } from "./params.js";
12
15
  import { definePiece } from "./piece.js";
13
- export const CATEGORY_ICON_NAMES = ["integration", "delivery", "aiEngineering", "personalTools"];
16
+ export const CATEGORY_ICON_NAMES = ["integration", "delivery", "aiEngineering", "personalTools", "mulesoft", "contributions"];
14
17
  /** The badge's box before `scale` (spec cover-cli, "Icon output"). */
15
18
  export const CATEGORY_ICON_SIZE = 42;
16
19
  const TRACK = {
@@ -18,20 +21,35 @@ const TRACK = {
18
21
  delivery: "trackDelivery",
19
22
  aiEngineering: "trackAi",
20
23
  personalTools: "trackPersonal",
24
+ // The projects page's own categories repeat two track tones; the glyph tells them apart.
25
+ mulesoft: "trackIntegration",
26
+ contributions: "trackDelivery",
21
27
  };
22
28
  const GLYPH = {
23
29
  integration: "pointToPointChannel",
24
30
  delivery: "gateToProduction",
25
31
  aiEngineering: "contextWindow",
26
32
  };
27
- const KEBAB = { integration: "integration", delivery: "delivery", aiEngineering: "ai-engineering", personalTools: "personal-tools" };
33
+ const KEBAB = { integration: "integration", delivery: "delivery", aiEngineering: "ai-engineering", personalTools: "personal-tools", mulesoft: "mulesoft", contributions: "contributions" };
28
34
  /** Personal tools' own glyph, in its 48 x 48 box, at 9, 9 and scale 0.5 like a notation glyph. */
29
35
  const personalToolsGlyph = () => g({ transform: "translate(9 9) scale(0.5)", stroke: "none" }, el("path", { d: "M12 36 L28 20 M24 12 L36 24", stroke: colour("brand.light.text"), "stroke-width": 5, "stroke-linecap": "round", "stroke-linejoin": "round", fill: "none" }), el("circle", { cx: 16, cy: 32, r: 6, fill: "none", stroke: colour("brand.light.accent"), "stroke-width": 3.5 }));
36
+ const line = (d, width) => el("path", { d, stroke: colour("brand.light.text"), "stroke-width": width, "stroke-linecap": "round", "stroke-linejoin": "round", fill: "none" });
37
+ const dot = (cx, cy, r, token = "brand.light.text") => el("circle", { cx, cy, r, fill: colour(token) });
38
+ const ring = (cx, cy) => el("circle", { cx, cy, r: 5, fill: colour("brand.light.bg"), stroke: colour("brand.light.text"), "stroke-width": 3.5 });
39
+ const ownGlyph = (...shapes) => g({ transform: "translate(9 9) scale(0.5)", stroke: "none" }, ...shapes);
40
+ /** The glyphs that are not brand notation, in the same 48 x 48 box: tools, systems joined by an API, a pull request. */
41
+ const OWN_GLYPH = {
42
+ personalTools: personalToolsGlyph,
43
+ mulesoft: () => ownGlyph(line("M8 12 L24 24 L8 36 M24 24 H40", 4), dot(8, 12, 5), dot(8, 36, 5), dot(24, 24, 7, "brand.light.accent"), ring(41, 24)),
44
+ contributions: () => ownGlyph(line("M14 14 V34", 4), line("M34 18 C34 30 14 24 14 34", 3.5), ring(14, 10), ring(14, 38), dot(34, 13, 6, "brand.light.accent")),
45
+ };
30
46
  const drawCategoryIcon = (p) => {
31
47
  const track = TRACK[p.category];
32
48
  const disc = el("circle", { cx: 21, cy: 21, r: 19.5, fill: colour(`coverBackground.${track}.fill`), stroke: colour(`coverBackground.${track}.ring`), "stroke-width": 1 });
33
- const glyph = p.category === "personalTools" ? personalToolsGlyph() : brandNotationIcon({ name: GLYPH[p.category], x: 9, y: 9, scale: 0.5, surface: "light" }).body[0];
49
+ const glyph = p.category === "integration" || p.category === "delivery" || p.category === "aiEngineering"
50
+ ? brandNotationIcon({ name: GLYPH[p.category], x: 9, y: 9, scale: 0.5, surface: "light" }).body[0]
51
+ : OWN_GLYPH[p.category]();
34
52
  return drawn([g({ "data-piece": `category-icon-${KEBAB[p.category]}`, transform: `translate(${p.x} ${p.y}) scale(${p.scale ?? 1})` }, disc, glyph)]);
35
53
  };
36
- /** One of the site's four category badges: the glyph on a disc in its track's default tone, a 42×42 box before `scale`. */
54
+ /** One of the site's category badges: the glyph on a disc in its track's default tone, a 42×42 box before `scale`. */
37
55
  export const categoryIcon = definePiece("categoryIcon", { category: { kind: "enum", required: true, values: CATEGORY_ICON_NAMES }, x: pos(), y: pos(), scale: num({ min: 0.25, max: 8 }) }, drawCategoryIcon);
@@ -1,5 +1,5 @@
1
- // The 26 EIP icons of the blog, as data (spec illustration-pieces, "EIP icons
2
- // as data"; design §5). Imported once from the published icon files
1
+ // The 27 EIP icons of the blog, as data (spec illustration-pieces, "EIP icons
2
+ // as data"; design §5). The first 26 were imported once from the published icon files
3
3
  // (integration-patterns-in-mulesoft/images/icons/eip-*.svg) with every colour
4
4
  // replaced by its token; this module is now the source and is edited by hand.
5
5
  //
@@ -353,6 +353,27 @@ export const EIP_ICONS = [
353
353
  ]),
354
354
  ],
355
355
  },
356
+ {
357
+ name: "recipient-list",
358
+ title: "Recipient List",
359
+ description: "Icon of the Recipient List pattern: a component whose list sends one message to several outputs. Redrawn from the Enterprise Integration Patterns icon by Gregor Hohpe and Bobby Woolf, enterpriseintegrationpatterns.com, CC BY 4.0.",
360
+ nodes: [
361
+ n("rect", { x: "6", y: "4", width: "52", height: "30", rx: "3", fill: C.state.healthy, stroke: C.ink, "stroke-width": "2" }),
362
+ n("rect", { x: "11", y: "9", width: "15", height: "20", fill: C.white, stroke: C.ink, "stroke-width": "1.5", "stroke-linejoin": "round" }),
363
+ n("polyline", { points: "14,14 23,14", fill: "none", stroke: C.ink, "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }),
364
+ n("polyline", { points: "14,19 23,19", fill: "none", stroke: C.ink, "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }),
365
+ n("polyline", { points: "14,24 23,24", fill: "none", stroke: C.ink, "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }),
366
+ n("polyline", { points: "26,19.5 42,10", fill: "none", stroke: C.ink, "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" }),
367
+ n("polyline", { points: "26,19.5 42,19.5", fill: "none", stroke: C.ink, "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" }),
368
+ n("polyline", { points: "26,19.5 42,29", fill: "none", stroke: C.ink, "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" }),
369
+ n("polygon", { points: "42.00,7.40 44.60,10.00 42.00,12.60 39.40,10.00", fill: C.ink }),
370
+ n("polyline", { points: "42,10 58,10", fill: "none", stroke: C.ink, "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" }),
371
+ n("polygon", { points: "42.00,16.90 44.60,19.50 42.00,22.10 39.40,19.50", fill: C.ink }),
372
+ n("polyline", { points: "42,19.5 58,19.5", fill: "none", stroke: C.ink, "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" }),
373
+ n("polygon", { points: "42.00,26.40 44.60,29.00 42.00,31.60 39.40,29.00", fill: C.ink }),
374
+ n("polyline", { points: "42,29 58,29", fill: "none", stroke: C.ink, "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" }),
375
+ ],
376
+ },
356
377
  {
357
378
  name: "request-reply",
358
379
  title: "Request-Reply",
@@ -233,7 +233,7 @@ export type EipIconParams = {
233
233
  y: number;
234
234
  scale?: number;
235
235
  };
236
- /** One of the 26 EIP icons (64x40), placed at (x, y) and scaled; the cover's outline does not leak in. */
236
+ /** One of the 27 EIP icons (64x40), placed at (x, y) and scaled; the cover's outline does not leak in. */
237
237
  export declare const eipIcon: import("./piece.ts").Piece<EipIconParams>;
238
238
  /** Every piece, by name, in catalogue order (spec illustration-pieces, "Piece catalogue"). */
239
239
  export declare const PIECES: {
@@ -298,7 +298,7 @@ export const muleFlow = definePiece("muleFlow", {
298
298
  ...tiles.flatMap((tile) => muleGlyph(tile.kind, tile.x + tileWidth / 2, cy)),
299
299
  ]);
300
300
  });
301
- /** One of the 26 EIP icons (64x40), placed at (x, y) and scaled; the cover's outline does not leak in. */
301
+ /** One of the 27 EIP icons (64x40), placed at (x, y) and scaled; the cover's outline does not leak in. */
302
302
  export const eipIcon = definePiece("eipIcon", { name: { kind: "enum", required: true, values: EIP_ICON_NAMES }, x: pos(), y: pos(), scale: size() }, ({ name, x, y, scale = 1 }) => {
303
303
  const icon = EIP_ICONS.find((candidate) => candidate.name === name);
304
304
  return drawn([g({ transform: `translate(${x} ${y}) scale(${scale})`, stroke: "none" }, ...icon.nodes)]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brunosouzas/design-system",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Design tokens and illustration pieces of brunosouzas.com: tokens as CSS, JSON and TypeScript, pieces that draw SVG (and React), and a cover command.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {