@brunosouzas/design-system 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NOTICE CHANGED
@@ -7,6 +7,8 @@ This package ships third-party font files, unmodified, in fonts/:
7
7
  SourceSans3-Black.ttf), from https://github.com/adobe-fonts/source-sans
8
8
  - Source Code Pro, release 2.042R (SourceCodePro-Regular.ttf,
9
9
  SourceCodePro-Bold.ttf), from https://github.com/adobe-fonts/source-code-pro
10
+ - Source Serif 4, release 4.005R (SourceSerif4-Bold.ttf), from
11
+ https://github.com/adobe-fonts/source-serif
10
12
 
11
13
  Copyright Adobe, with Reserved Font Name 'Source'. Licensed under the SIL Open
12
14
  Font License, Version 1.1: fonts/OFL.txt. The cover command embeds a subset of
package/README.md CHANGED
@@ -25,7 +25,7 @@ The visual identity of [brunosouzas.com](https://brunosouzas.com): design tokens
25
25
 
26
26
  ## Status
27
27
 
28
- Early. The first change of the [roadmap](docs/roadmap.md) is implemented: the token source and its CSS, TypeScript and JSON exports, the motion components, and the circuit-breaker state machine as the first catalogue scene (16:9 and 4:5, Portuguese and English), with commands to render its stills and videos. The first variety scene, `publish-subscribe`, is implemented with independent message copies, Publish acceptance, two ACKs and a local invoice NACK. Its owner stills/video approval is pending; implementation is not visual approval. The illustration pieces (roadmap item 3), the metro and diagram pieces (item 6) stackledger's map markers, zones and icons (AB#167, 0.3.0) and the body diagram pieces (AB#141, 0.3.2) are implemented: the static drawing library that covers, banners, diagrams and scenes share, with a command that builds a blog cover from a JSON spec. The published covers are not ported to it yet (item 5). Mira, the four pillar characters, the bank objects and the emotes are pieces too ([ADR 0007](docs/adr/0007-mira-and-the-pillar-cast.md)); new videos are language-neutral by default ([ADR 0005](docs/adr/0005-neutral-videos-and-the-cast.md)). Since 0.7.0 every piece follows one grammar ([ADR 0009](docs/adr/0009-one-piece-grammar.md)) and every written SVG carries its Source faces ([ADR 0008](docs/adr/0008-type-inside-the-image.md)); see [Upgrading to 0.7.0](#upgrading-to-070). 0.8.0 maps the site palette onto the brand roles and adds the category badges; see [Upgrading to 0.8.0](#upgrading-to-080).
28
+ Early. The first change of the [roadmap](docs/roadmap.md) is implemented: the token source and its CSS, TypeScript and JSON exports, the motion components, and the circuit-breaker state machine as the first catalogue scene (16:9 and 4:5, Portuguese and English), with commands to render its stills and videos. The first variety scene, `publish-subscribe`, is implemented with independent message copies, Publish acceptance, two ACKs and a local invoice NACK. Its owner stills/video approval is pending; implementation is not visual approval. The illustration pieces (roadmap item 3), the metro and diagram pieces (item 6) stackledger's map markers, zones and icons (AB#167, 0.3.0) and the body diagram pieces (AB#141, 0.3.2) are implemented: the static drawing library that covers, banners, diagrams and scenes share, with a command that builds a blog cover from a JSON spec. The published covers are not ported to it yet (item 5). Mira, the four pillar characters, the bank objects and the emotes are pieces too ([ADR 0007](docs/adr/0007-mira-and-the-pillar-cast.md)); new videos are language-neutral by default ([ADR 0005](docs/adr/0005-neutral-videos-and-the-cast.md)). Since 0.7.0 every piece follows one grammar ([ADR 0009](docs/adr/0009-one-piece-grammar.md)) and every written SVG carries its Source faces ([ADR 0008](docs/adr/0008-type-inside-the-image.md)); see [Upgrading to 0.7.0](#upgrading-to-070). 0.8.0 maps the site palette onto the brand roles and adds the category badges; see [Upgrading to 0.8.0](#upgrading-to-080). 0.8.1 adds stackledger's accent, retunes the city backdrop to the v2 neutrals and redraws `ledgerMark` as a white page; see [Upgrading to 0.8.1](#upgrading-to-081).
29
29
 
30
30
  ## What it is
31
31
 
@@ -78,7 +78,7 @@ The package also installs the cover command as `brunosouzas-cover <spec.json> --
78
78
 
79
79
  ### Type in a written image
80
80
 
81
- An SVG shown through `<img>` cannot load web fonts, so a written image carries its own: `embedFonts(tree)` adds one `<style>` after the `<desc>` with a `@font-face` per Source face the tree's text uses, each a subset holding only the glyphs drawn ([ADR 0008](docs/adr/0008-type-inside-the-image.md)). The cover command and `npm run pieces:sheet` call it before they write; a tree without Source text is returned unchanged. It is async, reads only the faces it needs, and rejects naming the font file or `harfbuzzjs` when one fails to load. It lives in its own entry so the root entry stays importable in a browser. Its output is for written files and `<img>`: when you inline a piece's SVG in an HTML page, skip `embedFonts` and let the page's fonts apply, because an inline `<style>` with `@font-face` applies to the whole document and would replace the page's Source faces with a subset.
81
+ An SVG shown through `<img>` cannot load web fonts, so a written image carries its own: `embedFonts(tree)` adds one `<style>` after the `<desc>` with a `@font-face` per Source face the tree's text uses (the package ships Source Sans 3 Regular, Bold and Black, Source Code Pro Regular and Bold, and, since 0.9.0, Source Serif 4 Bold for `headline`), each a subset holding only the glyphs drawn ([ADR 0008](docs/adr/0008-type-inside-the-image.md)). The cover command and `npm run pieces:sheet` call it before they write; a tree without Source text is returned unchanged. It is async, reads only the faces it needs, and rejects naming the font file or `harfbuzzjs` when one fails to load. It lives in its own entry so the root entry stays importable in a browser. Its output is for written files and `<img>`: when you inline a piece's SVG in an HTML page, skip `embedFonts` and let the page's fonts apply, because an inline `<style>` with `@font-face` applies to the whole document and would replace the page's Source faces with a subset.
82
82
 
83
83
  ```ts
84
84
  import { coverTree, toSvg } from "@brunosouzas/design-system";
@@ -144,11 +144,11 @@ The components take every colour and size from the tokens, and what is visible a
144
144
  - `toSvg(node)` writes a tree as SVG text; `toReact(node)` turns the same tree into React elements. Both describe the same elements, attributes and text, which the tests check.
145
145
  - `pose(node, { x, y, tilt, squash, hop, scale, shake, opacity })` animates any piece around its base point; a scene recomputes the numbers every frame.
146
146
  - Every colour parameter is a token path (`"color.state.healthy"`, `"illustration.accent"`), never a hex value, except the three data fills of the map pieces below. Each piece checks its parameters before drawing and names the first wrong one. Positions and points take any finite number, because a map has no edge; sizes stay within 10000. A drawing that would hold a non-finite number throws `<piece>: the drawing overflows`.
147
- - The 62 pieces, with their anchors, parameters and defaults, are listed in [design §4](openspec/changes/archive/2026-10-23-illustration-pieces/design.md) (the 26 cover pieces), in [design §3](openspec/changes/archive/2026-10-23-metro-and-diagram-pieces/design.md) of `metro-and-diagram-pieces` (the nine map and diagram pieces) and in [design §3, §5 and §6](openspec/changes/archive/2026-10-23-stackledger-map-and-link-pieces/design.md) of `stackledger-map-and-link-pieces` (the six markers, zones and icons) and in [design §3 to §5](openspec/changes/archive/2026-10-23-body-diagram-pieces/design.md) of `body-diagram-pieces` (the ten body diagram pieces), plus `stateStart` ([design §4](openspec/changes/archive/2026-10-24-designer-formats/design.md) of `designer-formats`); the rules are in [`openspec/specs/illustration-pieces/`](openspec/specs/illustration-pieces/spec.md). `npm run pieces:sheet -- --out <file.svg>` draws them all, and `--surface dark` draws every piece that takes `surface` on the dark surface.
147
+ - The 63 pieces, with their anchors, parameters and defaults, are listed in [design §4](openspec/changes/archive/2026-10-23-illustration-pieces/design.md) (the 26 cover pieces), in [design §3](openspec/changes/archive/2026-10-23-metro-and-diagram-pieces/design.md) of `metro-and-diagram-pieces` (the nine map and diagram pieces) and in [design §3, §5 and §6](openspec/changes/archive/2026-10-23-stackledger-map-and-link-pieces/design.md) of `stackledger-map-and-link-pieces` (the six markers, zones and icons) and in [design §3 to §5](openspec/changes/archive/2026-10-23-body-diagram-pieces/design.md) of `body-diagram-pieces` (the ten body diagram pieces), plus `stateStart` ([design §4](openspec/changes/archive/2026-10-24-designer-formats/design.md) of `designer-formats`) and `headline` (below); the rules are in [`openspec/specs/illustration-pieces/`](openspec/specs/illustration-pieces/spec.md). `npm run pieces:sheet -- --out <file.svg>` draws them all, and `--surface dark` draws every piece that takes `surface` on the dark surface.
148
148
 
149
149
  ### Maps and diagrams
150
150
 
151
- Thirteen pieces draw a metro map and its page diagrams, for [stackledger](https://github.com/brunosouzas/stackledger) and any other map in this style: `lineBadge`, `stationMarker` (stop, interchange as a capsule, deprecated), `pipe`, `countBadge`, `nodeBlock`, `pillNode`, `hexNode` (normal, focus, placeholder), `messageArrow` (curved, straight or through two `controls` points, with a head and an optional label; `kind` `reply`, `failure` or `failFast` dashes it and paints it as ADR 0003 says; `heads: "start"` or `"both"` puts heads at `from`, `dashed` overrides the kind's dash), `ledgerMark` (stackledger's mark; on `surface: "dark"` a muted band lines its ink square), `renewalRing` (orange bands round a station), `suggestedHalo` (a dashed muted circle), `licenceMark` (a 10-unit disc, green when held, white to buy) and `zone` (the outline the caller gives, widened by a round 32-unit stroke at the surface's zone opacity, with an optional title). They paint what the caller lays out: positions, hulls, text measurement and truncation stay with the map engine.
151
+ Thirteen pieces draw a metro map and its page diagrams, for [stackledger](https://github.com/brunosouzas/stackledger) and any other map in this style: `lineBadge`, `stationMarker` (stop, interchange as a capsule, deprecated), `pipe`, `countBadge`, `nodeBlock`, `pillNode`, `hexNode` (normal, focus, placeholder), `messageArrow` (curved, straight or through two `controls` points, with a head and an optional label; `kind` `reply`, `failure` or `failFast` dashes it and paints it as ADR 0003 says; `heads: "start"` or `"both"` puts heads at `from`, `dashed` overrides the kind's dash), `ledgerMark` (stackledger's mark: a white page with one outline, ink on light and `surface.dark.muted` on `surface: "dark"`, with the bent line and two stations), `renewalRing` (orange bands round a station), `suggestedHalo` (a dashed muted circle), `licenceMark` (a 10-unit disc, green when held, white to buy) and `zone` (the outline the caller gives, widened by a round 32-unit stroke at the surface's zone opacity, with an optional title). They paint what the caller lays out: positions, hulls, text measurement and truncation stay with the map engine.
152
152
 
153
153
  - A `placeholder` node may have a `subtitle` (drawn like a normal node's, all muted), and `lineBadge` may have no `text` (the pill alone, 30 wide by default).
154
154
  - The licence's disc is small, so it has its own room rule: `size` at least three outlines (9 at ink scale 1).
@@ -158,7 +158,7 @@ Thirteen pieces draw a metro map and its page diagrams, for [stackledger](https:
158
158
  - `countBadge` takes `textSize` (6 to 48, default 11): without `height`, the height, width and baseline grow with it.
159
159
  - A line's colour comes from the map's data, so `pipe.fill`, `lineBadge.fill` and `zone.fill` also accept `#RRGGBB`. Every other colour is a token path, and a cover spec rejects any hex.
160
160
  - `map.bendRadius` (32) is the radius of a bundle's centre line at a 45° or 90° bend; no piece reads it, the map engine draws the arcs (`pipe.d` takes `A`).
161
- - The `map.*` tokens hold the measures (outline 3, shadow 0, line 12, casing 6, badge 20, node 46, ring 3, halo 1.5, licence 10, zone padding 32, bend radius 32…), `surface.*.zoneOpacity` the zone's opacity (0.12, dark 0.22), `surface.*.backdropWater`, `backdropWaterEdge`, `backdropPark` and `backdropCredit` the colours of a city backdrop behind a map and its OpenStreetMap credit (no piece draws it; stackledger does), and `site.*` the page palette, fonts and type scale of brunosouzas.com in light and dark. Since 0.8.0 each `site` colour is the brand role it stands for (ADR 0006, amended): `primary`, `dark`, `text` and `textDark` are `brand.<theme>.text`, `body` is `bg`, `light` is `cardBg`, `border` is `border`, `textLight` is `textMuted` and `link` is `accentText`; `site.font` names Source Sans 3 (`primary`), Source Serif 4 (`secondary`) and Source Code Pro (`mono`). Against body text a link is 3.25:1 in light and 2.23:1 in dark, so a page keeps its link underline: colour alone does not mark a link (WCAG 1.4.1).
161
+ - The `map.*` tokens hold the measures (outline 3, shadow 0, line 12, casing 6, badge 20, node 46, ring 3, halo 1.5, licence 10, zone padding 32, bend radius 32…), `surface.*.zoneOpacity` the zone's opacity (0.12, dark 0.22), `surface.*.backdropWater`, `backdropWaterEdge`, `backdropPark` and `backdropCredit` the colours of a city backdrop behind a map and its OpenStreetMap credit (no piece draws it; stackledger does): since 0.8.1 the v2 neutrals, water `#C7DAEA` / `#1C2733`, its edge `#A9C4DA` / `#2A3846`, parks `#D6E4CF` / `#1A241D`, and the credit the muted text role, `brand.<theme>.textMuted` (`#5C5852` / `#ADA79D`), checked equal by a test. `site.*` holds the page palette, fonts and type scale of brunosouzas.com in light and dark. Since 0.8.0 each `site` colour is the brand role it stands for (ADR 0006, amended): `primary`, `dark`, `text` and `textDark` are `brand.<theme>.text`, `body` is `bg`, `light` is `cardBg`, `border` is `border`, `textLight` is `textMuted` and `link` is `accentText`; `site.font` names Source Sans 3 (`primary`), Source Serif 4 (`secondary`) and Source Code Pro (`mono`). Against body text a link is 3.25:1 in light and 2.23:1 in dark, so a page keeps its link underline: colour alone does not mark a link (WCAG 1.4.1). `brand.<theme>.stackledgerAccent` (`#3B5BDB` / `#7D8CFF`, `--ds-brand-<theme>-stackledger-accent`) is stackledger's product accent, at least 4.5:1 on `site.<theme>.body` and `site.<theme>.light` (ADR 0006, amended 2026-11-07); no piece draws it by default, a spec names it where the product's line is meant (`pipe` `fill: "brand.light.stackledgerAccent"`).
162
162
 
163
163
  ```ts
164
164
  import { lineBadge, pipe, stationMarker, toSvg } from "@brunosouzas/design-system";
@@ -276,6 +276,10 @@ npx --yes --package @brunosouzas/design-system@<version> brunosouzas-cover desig
276
276
  - **Text tables.** `"text": { "pt": { "open": ["taxa de falha", "> limite"] }, "en": { ... } }` holds one table per language with the same keys; any string `"@open"` elsewhere in the spec (pieces, `title`, `description`, even `id`) is replaced by that key's value for the language passed with `--lang <code>`. Every language must define every key, and the ids in the output gain the language (`<id>-pt`). Without `text`, strings are drawn as written, so `"@home"` stays a label.
277
277
  - Like a cover, a diagram or icon is a standalone image: `uiIcon` `colour: "currentColor"` is refused in every format.
278
278
 
279
+ ### Titles
280
+
281
+ `headline({ x, y, lines, size, anchor, surface })` writes a title of one to four `lines` in Source Serif 4 Bold (`font.serif`), the first baseline at (`x`, `y`), the next ones 1.1 × `size` lower; `size` is an integer from 24 to 160 (default 64), `anchor` is `start` (default), `middle` or `end`, and the colour is `brand.<surface>.text`. It draws only words (`text`), so a cover, banner, LinkedIn card, og or diagram spec writes it outside the outlined group, and the written image embeds the serif subset. With `text` tables, `"lines": "@slogan"` takes a line array per language. `test/fixtures/covers/og-headline.json` is brunosouzas.com's default share image.
282
+
279
283
  ### A new piece
280
284
 
281
285
  Add it to `src/pieces/library.ts` (or `src/pieces/metro.ts` for a map or diagram piece) with `definePiece(name, schema, draw)`, take its colours and sizes from the tokens (a new colour goes to `tokens/source.json` first), register it in `PIECES`, and give it a sample in `scripts/pieces-sheet.ts`. The catalogue test then checks that it draws with only its required parameters and uses token colours only.
@@ -296,6 +300,26 @@ const github = toSvg(el("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "
296
300
 
297
301
  `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.
298
302
 
303
+ ## Upgrading to 0.9.0
304
+
305
+ 0.9.0 (card 307) adds a serif title. Nothing is removed or renamed, and every 0.8.1 spec builds byte-identical.
306
+
307
+ | Added | What |
308
+ |---|---|
309
+ | `headline` | a title in Source Serif 4 Bold, one to four lines (see Titles, above); `PIECES` has 63 names, so a check of the exact list must add it |
310
+ | `fonts/SourceSerif4-Bold.ttf` | Adobe's Source Serif 4 4.005R Bold, unmodified, its SHA-256 pinned; an image embeds only the glyphs it draws ([ADR 0008](docs/adr/0008-type-inside-the-image.md), amended) |
311
+
312
+ ## Upgrading to 0.8.1
313
+
314
+ 0.8.1 (card 303) adds stackledger's product layer. Nothing is removed or renamed; images and pages that use the backdrop tokens or `ledgerMark` change appearance on rebuild.
315
+
316
+ | Changed | Before | Now |
317
+ |---|---|---|
318
+ | `brand.light.stackledgerAccent`, `brand.dark.stackledgerAccent` (`--ds-brand-<theme>-stackledger-accent`) | absent | `#3B5BDB`, `#7D8CFF`; a check of the exact list of brand roles must add it |
319
+ | `surface.light.backdropWater`, `backdropWaterEdge`, `backdropPark`, `backdropCredit` | `#C9D8FF`, `#B5C7F5`, `#D4F2DF`, `#5A6385` | `#C7DAEA`, `#A9C4DA`, `#D6E4CF`, `#5C5852` |
320
+ | `surface.dark.backdropWater`, `backdropWaterEdge`, `backdropPark`, `backdropCredit` | `#1E3175`, `#2A3F8A`, `#183F52`, `#9AA6D6` | `#1C2733`, `#2A3846`, `#1A241D`, `#ADA79D` |
321
+ | `ledgerMark` | an ink square (on dark, lined by a band in `surface.dark.muted`) | a white page with one outline, ink on light and `surface.dark.muted` on dark |
322
+
299
323
  ## Upgrading to 0.8.0
300
324
 
301
325
  0.8.0 (card 302) changes what the site palette holds and the category icon's call.
@@ -30,6 +30,8 @@ const FACES = [
30
30
  { family: "Source Sans 3", weight: 400, upTo: 549, range: "100 549", file: "SourceSans3-Regular.ttf" },
31
31
  { family: "Source Sans 3", weight: 700, upTo: 799, range: "550 799", file: "SourceSans3-Bold.ttf" },
32
32
  { family: "Source Sans 3", weight: 900, upTo: Infinity, range: "800 900", file: "SourceSans3-Black.ttf" },
33
+ // One serif face, the bold the `headline` piece draws (change headline-piece): every weight takes it.
34
+ { family: "Source Serif 4", weight: 700, upTo: Infinity, range: "100 900", file: "SourceSerif4-Bold.ttf" },
33
35
  ];
34
36
  // FACES is already in the order of the rules: family name by code point, then weight.
35
37
  /** Subtrees whose strings are never drawn. */
@@ -0,0 +1,11 @@
1
+ import { type SurfaceName } from "./ink.ts";
2
+ export type HeadlineParams = {
3
+ x: number;
4
+ y: number;
5
+ lines: string[];
6
+ size?: number;
7
+ anchor?: "start" | "middle" | "end";
8
+ surface?: SurfaceName;
9
+ };
10
+ /** One to four lines of a title in Source Serif 4 Bold, the first baseline at (x, y). */
11
+ export declare const headline: import("./piece.ts").Piece<HeadlineParams>;
@@ -0,0 +1,37 @@
1
+ // A title in the brand's serif (change headline-piece, card 307; studio
2
+ // decision I9: Source Serif 4 for titles). The default share image of
3
+ // brunosouzas.com is its first use: the slogan in three lines on an `og` image.
4
+ //
5
+ // Like `edgeLabel`, it draws nothing in `body`: its group is `text`, which a
6
+ // cover-frame format writes in the labels group, outside the ink-outlined
7
+ // group, so no stroke reaches the letters. One `g` carries every shared
8
+ // attribute (overriding the labels group's size, weight, fill and anchor), and
9
+ // one `text` per line carries only its position. Values match the approved
10
+ // preview: −0.01 em tracking, written in user units, and a 1.1 × size step.
11
+ import { tokens } from "../../tokens/generated/tokens.js";
12
+ import { surfaceParam } from "./ink.js";
13
+ import { drawn, el, g, r2 } from "./node.js";
14
+ import { label, num, pos } from "./params.js";
15
+ import { definePiece } from "./piece.js";
16
+ /** Line step as a share of the size. */
17
+ const LEADING = 1.1;
18
+ const drawHeadline = ({ x, y, lines, size = 64, anchor = "start", surface = "light" }) => drawn([], [
19
+ g({
20
+ "data-piece": "headline",
21
+ "font-family": tokens.font.serif,
22
+ "font-size": size,
23
+ "font-weight": tokens.font.weightBold,
24
+ "letter-spacing": r2(-size / 100),
25
+ fill: tokens.brand[surface].text,
26
+ "text-anchor": anchor,
27
+ }, ...lines.map((line, i) => el("text", { x, y: r2(y + i * LEADING * size) }, line))),
28
+ ]);
29
+ /** One to four lines of a title in Source Serif 4 Bold, the first baseline at (x, y). */
30
+ export const headline = definePiece("headline", {
31
+ x: pos(),
32
+ y: pos(),
33
+ lines: { kind: "array", required: true, minItems: 1, maxItems: 4, of: label() },
34
+ size: num({ min: 24, max: 160, integer: true }),
35
+ anchor: { kind: "enum", values: ["start", "middle", "end"] },
36
+ surface: surfaceParam,
37
+ }, drawHeadline);
@@ -19,10 +19,10 @@ export declare const limits: (...checks: (Problem | false)[]) => Problem[];
19
19
  */
20
20
  export declare const inkOf: ({ surface, inkScale }: Ink) => {
21
21
  s: {
22
- readonly backdropCredit: "#9AA6D6";
23
- readonly backdropPark: "#183F52";
24
- readonly backdropWater: "#1E3175";
25
- readonly backdropWaterEdge: "#2A3F8A";
22
+ readonly backdropCredit: "#ADA79D";
23
+ readonly backdropPark: "#1A241D";
24
+ readonly backdropWater: "#1C2733";
25
+ readonly backdropWaterEdge: "#2A3846";
26
26
  readonly background: "#121110";
27
27
  readonly grid: "#3B3834";
28
28
  readonly muted: "#ADA79D";
@@ -33,10 +33,10 @@ export declare const inkOf: ({ surface, inkScale }: Ink) => {
33
33
  readonly text: "#F1EEE8";
34
34
  readonly zoneOpacity: 0.22;
35
35
  } | {
36
- readonly backdropCredit: "#5A6385";
37
- readonly backdropPark: "#D4F2DF";
38
- readonly backdropWater: "#C9D8FF";
39
- readonly backdropWaterEdge: "#B5C7F5";
36
+ readonly backdropCredit: "#5C5852";
37
+ readonly backdropPark: "#D6E4CF";
38
+ readonly backdropWater: "#C7DAEA";
39
+ readonly backdropWaterEdge: "#A9C4DA";
40
40
  readonly background: "#F6F3EC";
41
41
  readonly grid: "#EDE8DE";
42
42
  readonly muted: "#5C5852";
@@ -4,8 +4,9 @@ import { bankObject, type BankObjectName, type BankObjectParams } from "./bank-o
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, mira, visor, drone, kiu, sinal, bankObject, symbol, brandNotationIcon, categoryIcon };
8
- export type { MiraParams, VisorParams, DroneParams, KiuParams, SinalParams, BankObjectName, BankObjectParams, SymbolParams, BrandNotationIconName, BrandNotationIconParams, CategoryIconParams };
7
+ import { headline, type HeadlineParams } from "./headline.ts";
8
+ export { emote, mira, visor, drone, kiu, sinal, bankObject, symbol, brandNotationIcon, categoryIcon, headline };
9
+ export type { MiraParams, VisorParams, DroneParams, KiuParams, SinalParams, BankObjectName, BankObjectParams, SymbolParams, BrandNotationIconName, BrandNotationIconParams, CategoryIconParams, HeadlineParams };
9
10
  export * from "./metro.ts";
10
11
  export * from "./diagram.ts";
11
12
  export * from "./ui-icons.ts";
@@ -341,6 +342,7 @@ export declare const PIECES: {
341
342
  readonly symbol: import("./piece.ts").Piece<SymbolParams>;
342
343
  readonly brandNotationIcon: import("./piece.ts").Piece<BrandNotationIconParams>;
343
344
  readonly categoryIcon: import("./piece.ts").Piece<CategoryIconParams>;
345
+ readonly headline: import("./piece.ts").Piece<HeadlineParams>;
344
346
  };
345
347
  export type PieceName = keyof typeof PIECES;
346
348
  export declare const PIECE_NAMES: PieceName[];
@@ -21,8 +21,9 @@ 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
+ import { headline } from "./headline.js";
24
25
  import { codeLength, spans } from "./ink.js";
25
- export { emote, mira, visor, drone, kiu, sinal, bankObject, symbol, brandNotationIcon, categoryIcon };
26
+ export { emote, mira, visor, drone, kiu, sinal, bankObject, symbol, brandNotationIcon, categoryIcon, headline };
26
27
  export * from "./metro.js";
27
28
  export * from "./diagram.js";
28
29
  export * from "./ui-icons.js";
@@ -410,5 +411,6 @@ export const PIECES = {
410
411
  symbol,
411
412
  brandNotationIcon,
412
413
  categoryIcon,
414
+ headline,
413
415
  };
414
416
  export const PIECE_NAMES = Object.keys(PIECES);
@@ -81,9 +81,10 @@ export type LedgerMarkParams = {
81
81
  line?: string;
82
82
  surface?: SurfaceName;
83
83
  };
84
- /** stackledger's mark (favicon, header): an ink square with a bent line and two stations, 32 units scaled to `size`.
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. */
84
+ /** stackledger's mark (favicon, header), the "Folha" of card 303: a white page with one outline, a bent line and
85
+ * two stations, 32 units scaled to `size`. The outline is ink on the light surface and surface.dark.muted on the dark
86
+ * one, so the page keeps one outline that reads on either background (ADR 0009); the stations sit on the white page
87
+ * and stay ink. */
87
88
  export declare const ledgerMark: import("./piece.ts").Piece<LedgerMarkParams>;
88
89
  export type RenewalRingParams = Ink & {
89
90
  cx: number;
@@ -220,19 +220,26 @@ export const messageArrow = definePiece("messageArrow", {
220
220
  const need = (heads === "both" ? 20 : 10) * width;
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
- /** stackledger's mark (favicon, header): an ink square with a bent line and two stations, 32 units scaled to `size`.
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. */
223
+ /** stackledger's mark (favicon, header), the "Folha" of card 303: a white page with one outline, a bent line and
224
+ * two stations, 32 units scaled to `size`. The outline is ink on the light surface and surface.dark.muted on the dark
225
+ * one, so the page keeps one outline that reads on either background (ADR 0009); the stations sit on the white page
226
+ * and stay ink. */
226
227
  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" }) => {
227
- const band = 2;
228
- const square = surface === "dark"
229
- ? [
230
- el("rect", { x: 0, y: 0, width: 32, height: 32, rx: 7, fill: tokens.surface.dark.muted, stroke: "none" }),
231
- el("rect", { x: band, y: band, width: 32 - 2 * band, height: 32 - 2 * band, rx: 7 - band, fill: ink, stroke: "none" }),
232
- ]
233
- : [el("rect", { x: 0, y: 0, width: 32, height: 32, rx: 7, fill: ink, stroke: "none" })];
228
+ // The stroke is centred on the rect's edge: inset by half the outline, the page stays inside the 32 box.
229
+ const outline = 1.25;
230
+ const inset = outline / 2;
231
+ const page = el("rect", {
232
+ x: inset,
233
+ y: inset,
234
+ width: 32 - outline,
235
+ height: 32 - outline,
236
+ rx: 6.6,
237
+ fill: white,
238
+ stroke: surface === "dark" ? tokens.surface.dark.muted : ink,
239
+ "stroke-width": outline,
240
+ });
234
241
  return drawn([
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 })),
242
+ g({ transform: `translate(${r2(x)} ${r2(y)}) scale(${side / 32})` }, page, 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
243
  ]);
237
244
  });
238
245
  /** The renewal ring: bands like a bent pipe round a station (a rim when the surface has one, the ink line, then
@@ -21,6 +21,7 @@ export declare const tokens: {
21
21
  readonly cardBg: "#1D1C1A";
22
22
  readonly failure: "#FF6696";
23
23
  readonly onAccent: "#121110";
24
+ readonly stackledgerAccent: "#7D8CFF";
24
25
  readonly success: "#5BBF86";
25
26
  readonly text: "#F1EEE8";
26
27
  readonly textMuted: "#ADA79D";
@@ -39,6 +40,7 @@ export declare const tokens: {
39
40
  readonly cardBg: "#FFFFFF";
40
41
  readonly failure: "#A1124B";
41
42
  readonly onAccent: "#FFFFFF";
43
+ readonly stackledgerAccent: "#3B5BDB";
42
44
  readonly success: "#2B7A4B";
43
45
  readonly text: "#121212";
44
46
  readonly textMuted: "#5C5852";
@@ -253,10 +255,10 @@ export declare const tokens: {
253
255
  };
254
256
  readonly surface: {
255
257
  readonly dark: {
256
- readonly backdropCredit: "#9AA6D6";
257
- readonly backdropPark: "#183F52";
258
- readonly backdropWater: "#1E3175";
259
- readonly backdropWaterEdge: "#2A3F8A";
258
+ readonly backdropCredit: "#ADA79D";
259
+ readonly backdropPark: "#1A241D";
260
+ readonly backdropWater: "#1C2733";
261
+ readonly backdropWaterEdge: "#2A3846";
260
262
  readonly background: "#121110";
261
263
  readonly grid: "#3B3834";
262
264
  readonly muted: "#ADA79D";
@@ -268,10 +270,10 @@ export declare const tokens: {
268
270
  readonly zoneOpacity: 0.22;
269
271
  };
270
272
  readonly light: {
271
- readonly backdropCredit: "#5A6385";
272
- readonly backdropPark: "#D4F2DF";
273
- readonly backdropWater: "#C9D8FF";
274
- readonly backdropWaterEdge: "#B5C7F5";
273
+ readonly backdropCredit: "#5C5852";
274
+ readonly backdropPark: "#D6E4CF";
275
+ readonly backdropWater: "#C7DAEA";
276
+ readonly backdropWaterEdge: "#A9C4DA";
275
277
  readonly background: "#F6F3EC";
276
278
  readonly grid: "#EDE8DE";
277
279
  readonly muted: "#5C5852";
@@ -22,6 +22,7 @@ export const tokens = {
22
22
  "cardBg": "#1D1C1A",
23
23
  "failure": "#FF6696",
24
24
  "onAccent": "#121110",
25
+ "stackledgerAccent": "#7D8CFF",
25
26
  "success": "#5BBF86",
26
27
  "text": "#F1EEE8",
27
28
  "textMuted": "#ADA79D",
@@ -40,6 +41,7 @@ export const tokens = {
40
41
  "cardBg": "#FFFFFF",
41
42
  "failure": "#A1124B",
42
43
  "onAccent": "#FFFFFF",
44
+ "stackledgerAccent": "#3B5BDB",
43
45
  "success": "#2B7A4B",
44
46
  "text": "#121212",
45
47
  "textMuted": "#5C5852",
@@ -254,10 +256,10 @@ export const tokens = {
254
256
  },
255
257
  "surface": {
256
258
  "dark": {
257
- "backdropCredit": "#9AA6D6",
258
- "backdropPark": "#183F52",
259
- "backdropWater": "#1E3175",
260
- "backdropWaterEdge": "#2A3F8A",
259
+ "backdropCredit": "#ADA79D",
260
+ "backdropPark": "#1A241D",
261
+ "backdropWater": "#1C2733",
262
+ "backdropWaterEdge": "#2A3846",
261
263
  "background": "#121110",
262
264
  "grid": "#3B3834",
263
265
  "muted": "#ADA79D",
@@ -269,10 +271,10 @@ export const tokens = {
269
271
  "zoneOpacity": 0.22
270
272
  },
271
273
  "light": {
272
- "backdropCredit": "#5A6385",
273
- "backdropPark": "#D4F2DF",
274
- "backdropWater": "#C9D8FF",
275
- "backdropWaterEdge": "#B5C7F5",
274
+ "backdropCredit": "#5C5852",
275
+ "backdropPark": "#D6E4CF",
276
+ "backdropWater": "#C7DAEA",
277
+ "backdropWaterEdge": "#A9C4DA",
276
278
  "background": "#F6F3EC",
277
279
  "grid": "#EDE8DE",
278
280
  "muted": "#5C5852",
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brunosouzas/design-system",
3
- "version": "0.8.0",
3
+ "version": "0.9.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": {
@@ -16,6 +16,7 @@
16
16
  --ds-brand-dark-card-bg: #1D1C1A;
17
17
  --ds-brand-dark-failure: #FF6696;
18
18
  --ds-brand-dark-on-accent: #121110;
19
+ --ds-brand-dark-stackledger-accent: #7D8CFF;
19
20
  --ds-brand-dark-success: #5BBF86;
20
21
  --ds-brand-dark-text: #F1EEE8;
21
22
  --ds-brand-dark-text-muted: #ADA79D;
@@ -32,6 +33,7 @@
32
33
  --ds-brand-light-card-bg: #FFFFFF;
33
34
  --ds-brand-light-failure: #A1124B;
34
35
  --ds-brand-light-on-accent: #FFFFFF;
36
+ --ds-brand-light-stackledger-accent: #3B5BDB;
35
37
  --ds-brand-light-success: #2B7A4B;
36
38
  --ds-brand-light-text: #121212;
37
39
  --ds-brand-light-text-muted: #5C5852;
@@ -176,10 +178,10 @@
176
178
  --ds-site-light-text: #121212;
177
179
  --ds-site-light-text-dark: #121212;
178
180
  --ds-site-light-text-light: #5C5852;
179
- --ds-surface-dark-backdrop-credit: #9AA6D6;
180
- --ds-surface-dark-backdrop-park: #183F52;
181
- --ds-surface-dark-backdrop-water: #1E3175;
182
- --ds-surface-dark-backdrop-water-edge: #2A3F8A;
181
+ --ds-surface-dark-backdrop-credit: #ADA79D;
182
+ --ds-surface-dark-backdrop-park: #1A241D;
183
+ --ds-surface-dark-backdrop-water: #1C2733;
184
+ --ds-surface-dark-backdrop-water-edge: #2A3846;
183
185
  --ds-surface-dark-background: #121110;
184
186
  --ds-surface-dark-grid: #3B3834;
185
187
  --ds-surface-dark-muted: #ADA79D;
@@ -189,10 +191,10 @@
189
191
  --ds-surface-dark-shadow: #121110;
190
192
  --ds-surface-dark-text: #F1EEE8;
191
193
  --ds-surface-dark-zone-opacity: 0.22;
192
- --ds-surface-light-backdrop-credit: #5A6385;
193
- --ds-surface-light-backdrop-park: #D4F2DF;
194
- --ds-surface-light-backdrop-water: #C9D8FF;
195
- --ds-surface-light-backdrop-water-edge: #B5C7F5;
194
+ --ds-surface-light-backdrop-credit: #5C5852;
195
+ --ds-surface-light-backdrop-park: #D6E4CF;
196
+ --ds-surface-light-backdrop-water: #C7DAEA;
197
+ --ds-surface-light-backdrop-water-edge: #A9C4DA;
196
198
  --ds-surface-light-background: #F6F3EC;
197
199
  --ds-surface-light-grid: #EDE8DE;
198
200
  --ds-surface-light-muted: #5C5852;
@@ -21,6 +21,7 @@
21
21
  "cardBg": "#1D1C1A",
22
22
  "failure": "#FF6696",
23
23
  "onAccent": "#121110",
24
+ "stackledgerAccent": "#7D8CFF",
24
25
  "success": "#5BBF86",
25
26
  "text": "#F1EEE8",
26
27
  "textMuted": "#ADA79D",
@@ -39,6 +40,7 @@
39
40
  "cardBg": "#FFFFFF",
40
41
  "failure": "#A1124B",
41
42
  "onAccent": "#FFFFFF",
43
+ "stackledgerAccent": "#3B5BDB",
42
44
  "success": "#2B7A4B",
43
45
  "text": "#121212",
44
46
  "textMuted": "#5C5852",
@@ -253,10 +255,10 @@
253
255
  },
254
256
  "surface": {
255
257
  "dark": {
256
- "backdropCredit": "#9AA6D6",
257
- "backdropPark": "#183F52",
258
- "backdropWater": "#1E3175",
259
- "backdropWaterEdge": "#2A3F8A",
258
+ "backdropCredit": "#ADA79D",
259
+ "backdropPark": "#1A241D",
260
+ "backdropWater": "#1C2733",
261
+ "backdropWaterEdge": "#2A3846",
260
262
  "background": "#121110",
261
263
  "grid": "#3B3834",
262
264
  "muted": "#ADA79D",
@@ -268,10 +270,10 @@
268
270
  "zoneOpacity": 0.22
269
271
  },
270
272
  "light": {
271
- "backdropCredit": "#5A6385",
272
- "backdropPark": "#D4F2DF",
273
- "backdropWater": "#C9D8FF",
274
- "backdropWaterEdge": "#B5C7F5",
273
+ "backdropCredit": "#5C5852",
274
+ "backdropPark": "#D6E4CF",
275
+ "backdropWater": "#C7DAEA",
276
+ "backdropWaterEdge": "#A9C4DA",
275
277
  "background": "#F6F3EC",
276
278
  "grid": "#EDE8DE",
277
279
  "muted": "#5C5852",
@@ -23,6 +23,7 @@ export const tokens = {
23
23
  "cardBg": "#1D1C1A",
24
24
  "failure": "#FF6696",
25
25
  "onAccent": "#121110",
26
+ "stackledgerAccent": "#7D8CFF",
26
27
  "success": "#5BBF86",
27
28
  "text": "#F1EEE8",
28
29
  "textMuted": "#ADA79D",
@@ -41,6 +42,7 @@ export const tokens = {
41
42
  "cardBg": "#FFFFFF",
42
43
  "failure": "#A1124B",
43
44
  "onAccent": "#FFFFFF",
45
+ "stackledgerAccent": "#3B5BDB",
44
46
  "success": "#2B7A4B",
45
47
  "text": "#121212",
46
48
  "textMuted": "#5C5852",
@@ -255,10 +257,10 @@ export const tokens = {
255
257
  },
256
258
  "surface": {
257
259
  "dark": {
258
- "backdropCredit": "#9AA6D6",
259
- "backdropPark": "#183F52",
260
- "backdropWater": "#1E3175",
261
- "backdropWaterEdge": "#2A3F8A",
260
+ "backdropCredit": "#ADA79D",
261
+ "backdropPark": "#1A241D",
262
+ "backdropWater": "#1C2733",
263
+ "backdropWaterEdge": "#2A3846",
262
264
  "background": "#121110",
263
265
  "grid": "#3B3834",
264
266
  "muted": "#ADA79D",
@@ -270,10 +272,10 @@ export const tokens = {
270
272
  "zoneOpacity": 0.22
271
273
  },
272
274
  "light": {
273
- "backdropCredit": "#5A6385",
274
- "backdropPark": "#D4F2DF",
275
- "backdropWater": "#C9D8FF",
276
- "backdropWaterEdge": "#B5C7F5",
275
+ "backdropCredit": "#5C5852",
276
+ "backdropPark": "#D6E4CF",
277
+ "backdropWater": "#C7DAEA",
278
+ "backdropWaterEdge": "#A9C4DA",
277
279
  "background": "#F6F3EC",
278
280
  "grid": "#EDE8DE",
279
281
  "muted": "#5C5852",