@brunosouzas/design-system 0.11.0 → 0.12.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 +38 -2
- package/dist/src/pieces/brand-cast.d.ts +17 -0
- package/dist/src/pieces/brand-cast.js +63 -8
- package/dist/src/pieces/index.d.ts +2 -1
- package/dist/src/pieces/index.js +1 -1
- package/dist/src/pieces/library.d.ts +7 -30
- package/dist/src/pieces/library.js +6 -59
- package/dist/src/pieces/paper.d.ts +31 -0
- package/dist/src/pieces/paper.js +72 -0
- package/dist/src/pieces/question-token.d.ts +9 -0
- package/dist/src/pieces/question-token.js +49 -0
- package/dist/tokens/generated/tokens.d.ts +10 -0
- package/dist/tokens/generated/tokens.js +10 -0
- package/package.json +1 -1
- package/tokens/generated/tokens.css +8 -0
- package/tokens/generated/tokens.json +10 -0
- package/tokens/generated/tokens.ts +10 -0
package/README.md
CHANGED
|
@@ -139,6 +139,17 @@ Pub-sub separates `text.ts`, `timeline.ts` and pure `flow.ts` from its data entr
|
|
|
139
139
|
|
|
140
140
|
The components take every colour and size from the tokens, and what is visible at a frame (arrow progress, travelling tokens, focus and dimming, captions, countdown, call results) comes from pure functions in `src/brand/motion.ts`, which the tests check without rendering.
|
|
141
141
|
|
|
142
|
+
The stage every scene shares is in the `scene.*` tokens (0.12.0), in composition pixels (the 16:9 composition is 1920 x 1080) and the same in every format:
|
|
143
|
+
|
|
144
|
+
| Token | Value | What |
|
|
145
|
+
|---|---|---|
|
|
146
|
+
| `scene.ringRadius`, `scene.ringStep`, `scene.ringWidth` | 100, 34, 2.5 | the stage rings: first radius, gap, stroke width |
|
|
147
|
+
| `scene.ringReach` | 1.2 | the rings reach the frame's larger side times this ratio |
|
|
148
|
+
| `scene.pathDash`, `scene.pathGap`, `scene.pathWidth` | 4, 18, 6 | the dashed motion path a travelling object follows, drawn with round caps, so each dash reads as a dot |
|
|
149
|
+
| `scene.pathColor` | `#5C5852` | the path's colour on the light stage, equal to `brand.light.textMuted` (a test keeps the two equal) |
|
|
150
|
+
|
|
151
|
+
`stageRingRadii(width, height, values = tokens.scene)` in `src/brand/motion.ts` gives the ring radii for a frame (65 for 1920 x 1080, 45 for 1080 x 1350), and the `Rings` component draws them; it refuses a size that is not a positive finite number and more than 1000 rings. No component draws the dashed path yet: the first scene that needs it draws it from the tokens.
|
|
152
|
+
|
|
142
153
|
## Illustration pieces and covers
|
|
143
154
|
|
|
144
155
|
`src/pieces/` holds the drawing library. A piece is a function from plain parameters to `{ body, text }`: `body` holds the shapes, drawn inside the outlined group, and `text` the words and glyphs, drawn after every shape so the outline never strokes a letter. Pieces read only the generated tokens and never a file, so a Remotion scene can import them.
|
|
@@ -146,7 +157,7 @@ The components take every colour and size from the tokens, and what is visible a
|
|
|
146
157
|
- `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.
|
|
147
158
|
- `pose(node, { x, y, tilt, squash, hop, scale, shake, opacity })` animates any piece around its base point; a scene recomputes the numbers every frame.
|
|
148
159
|
- 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`.
|
|
149
|
-
- The
|
|
160
|
+
- The 64 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`), `headline` and `questionToken` (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.
|
|
150
161
|
|
|
151
162
|
### Maps and diagrams
|
|
152
163
|
|
|
@@ -185,9 +196,22 @@ Ten pieces draw what the blog's body diagrams need beyond the map pieces: `diagr
|
|
|
185
196
|
The cast of [ADR 0007](docs/adr/0007-mira-and-the-pillar-cast.md) shares one skin (white body, ink outline, a near-black visor with the amber idle eyes, `cast.eyes`); a character's identity is its shape, never a colour. Each takes `x`, `y` (the centre of its ground line), `scale`, `surface`, `expression` (`idle`, `done`, `waiting`, `failed`) and `view` (`front`, `back`):
|
|
186
197
|
|
|
187
198
|
- `mira(…)`: the protagonist, an astrolabe with a screen face; `needleAngle` points the route, `carries` rides a message on the needle's tip.
|
|
188
|
-
- `visor` (AI engineering; `holds`, `points`), `drone` (delivery; `carries`), `kiu` (wiki and series; `steps`), `sinal` (stackledger, without the parent-brand hood tip).
|
|
199
|
+
- `visor` (AI engineering; `holds`, `holdsSheet`, `points`, `facing`), `drone` (delivery; `carries`), `kiu` (wiki and series; `steps`), `sinal` (stackledger, without the parent-brand hood tip).
|
|
189
200
|
- `bankObject({ name, x, y, scale, surface })`: six objects for scenery, `courier`, `lume`, `carga`, `anel`, `modulo`, `hub`, with the cast's idle eyes on their screen and no expression.
|
|
190
201
|
|
|
202
|
+
Visor's two actions of 0.12.0, for the SDD scene of AB#144:
|
|
203
|
+
|
|
204
|
+
- `holdsSheet: { width, height, rows, top, step, label }` puts a sheet in Visor's left hand instead of the card: the `sheet` piece's page (`width` 80 to 300, `height` 80 to 400, 1 to 8 `rows` with `lead`, `bar`, `tail`) and, with `label`, a `pill` on its top edge (a file name such as `proposal.md`). The hand sits over the page's edge; the page's `?` and the label are Visor's `text`, with their own font, so they read the same in a scene. With `holds: true` or `view: "back"` it is refused. The label takes `pill`'s width (150 for `proposal.md`), so give the page at least that width.
|
|
205
|
+
- `facing: "right" | "left"` (default `right`, the drawing of 0.11.0): facing left is the mirror image, so `points` reaches left and the hand holds on the right. Only the body is mirrored: the outline keeps its colour and width, and a held sheet and its words are never mirrored.
|
|
206
|
+
|
|
207
|
+
`questionToken({ cx, cy, scale, surface })` is the open question as an object: the white disc and `?` of a sheet's question row (radius 13, outline `outline.small`, ink on light and `surface.dark.muted` on dark), sized with `scale` (above 0, at most 10). It takes no colour and no text. `countBadge` stays the map's number sticker.
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
import { questionToken, visor } from "@brunosouzas/design-system";
|
|
211
|
+
const agent = visor({ x: 480, y: 440, scale: 1.15, facing: "left", holdsSheet: { width: 150, height: 204, rows: [{ lead: "question", bar: 44 }], label: "proposal.md" } });
|
|
212
|
+
const question = questionToken({ cx: 300, cy: 120, scale: 1.5 });
|
|
213
|
+
```
|
|
214
|
+
|
|
191
215
|
`emote({ kind, x, y, scale, burst, surface })` draws a reaction beside a head, never over the face. Each kind keeps one meaning in every video, like the colours:
|
|
192
216
|
|
|
193
217
|
| `kind` | Shape | Meaning |
|
|
@@ -326,6 +350,18 @@ const github = toSvg(el("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "
|
|
|
326
350
|
|
|
327
351
|
`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.
|
|
328
352
|
|
|
353
|
+
## Upgrading to 0.12.0
|
|
354
|
+
|
|
355
|
+
0.12.0 (card 333, change `sdd-scene-pieces`) adds what the SDD scene of AB#144 needs. Nothing is removed or renamed, and every 0.11.0 call, spec and scene draws the same: the five cast pieces are pinned against their 0.11.0 drawings (`test/fixtures/cast-0.11.0.json`) and the circuit-breaker and publish-subscribe stills are byte-identical.
|
|
356
|
+
|
|
357
|
+
| Added | What |
|
|
358
|
+
|---|---|
|
|
359
|
+
| `visor` `holdsSheet`, `facing` | Visor holds a sheet and faces left or right (see The cast and the emotes); `VISOR_FACINGS`, `VisorFacing` and `VisorHeldSheet` from the root entry |
|
|
360
|
+
| `questionToken` | the open question as an object; `PIECE_NAMES` has 64 names, ending with `headline`, `questionToken`, so a check of the exact list or an exhaustive `switch` over `PieceName` must add it |
|
|
361
|
+
| `scene.*` tokens | the stage rings and the dashed motion path (see How a scene is built), the seventeenth token group: `tokens.scene` and `--ds-scene-*` in `tokens.css` |
|
|
362
|
+
|
|
363
|
+
`pill` and `sheet` moved from `src/pieces/library.ts` to `src/pieces/paper.ts` unchanged; the root entry exports them as before.
|
|
364
|
+
|
|
329
365
|
## Upgrading to 0.10.0
|
|
330
366
|
|
|
331
367
|
0.10.0 (card 325, change `presence-formats`) adds a LinkedIn banner format and the stackledger link icon. Nothing is removed or renamed, and every 0.9.1 spec builds byte-identical.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type SvgNode } from "./node.ts";
|
|
2
2
|
import { type SurfaceName } from "./ink.ts";
|
|
3
|
+
import { type SheetRow } from "./paper.ts";
|
|
3
4
|
import { type Skin } from "./skin.ts";
|
|
4
5
|
export declare const CAST_EXPRESSIONS: readonly ["idle", "done", "waiting", "failed"];
|
|
5
6
|
export type CastExpression = (typeof CAST_EXPRESSIONS)[number];
|
|
@@ -30,6 +31,17 @@ export type MiraParams = {
|
|
|
30
31
|
};
|
|
31
32
|
/** Mira, the protagonist: an astrolabe whose needle points the route each message takes. */
|
|
32
33
|
export declare const mira: import("./piece.ts").Piece<MiraParams>;
|
|
34
|
+
export declare const VISOR_FACINGS: readonly ["right", "left"];
|
|
35
|
+
export type VisorFacing = (typeof VISOR_FACINGS)[number];
|
|
36
|
+
/** The sheet Visor holds: the `sheet` piece's page parameters, plus the file name pill. */
|
|
37
|
+
export type VisorHeldSheet = {
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
rows: SheetRow[];
|
|
41
|
+
top?: number;
|
|
42
|
+
step?: number;
|
|
43
|
+
label?: string;
|
|
44
|
+
};
|
|
33
45
|
export type VisorParams = {
|
|
34
46
|
x: number;
|
|
35
47
|
y: number;
|
|
@@ -37,8 +49,13 @@ export type VisorParams = {
|
|
|
37
49
|
scale?: number;
|
|
38
50
|
expression?: CastExpression;
|
|
39
51
|
view?: CastView;
|
|
52
|
+
/** The small accent card in the left hand. */
|
|
40
53
|
holds?: boolean;
|
|
54
|
+
/** A sheet in the left hand instead of the card; refused with `holds: true` or `view: "back"`. */
|
|
55
|
+
holdsSheet?: VisorHeldSheet;
|
|
41
56
|
points?: boolean;
|
|
57
|
+
/** `right` (the default, the drawing of 0.11.0) or `left`, the mirror image; the held sheet and words stay unmirrored. */
|
|
58
|
+
facing?: VisorFacing;
|
|
42
59
|
};
|
|
43
60
|
export declare const visor: import("./piece.ts").Piece<VisorParams>;
|
|
44
61
|
export type DroneParams = {
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
// (`~/.hermes/cache/scratch/ab267/sheet7.py`, functions `mira`/`peak`/`legs`/`needle`;
|
|
4
4
|
// `casting3.py`'s `face`). Front and back view only (round 7b dropped the
|
|
5
5
|
// side view and the middle leg).
|
|
6
|
+
import { tokens } from "../../tokens/generated/tokens.js";
|
|
6
7
|
import { drawn, el, g } from "./node.js";
|
|
7
|
-
import { surfaceParam } from "./ink.js";
|
|
8
|
-
import {
|
|
8
|
+
import { limits, surfaceParam } from "./ink.js";
|
|
9
|
+
import { pill, sheet, sheetRowSchema } from "./paper.js";
|
|
10
|
+
import { label, pos, num, size } from "./params.js";
|
|
9
11
|
import { definePiece } from "./piece.js";
|
|
10
12
|
import { outlined, skin } from "./skin.js";
|
|
11
13
|
export const CAST_EXPRESSIONS = ["idle", "done", "waiting", "failed"];
|
|
@@ -89,15 +91,45 @@ export const mira = definePiece("mira", {
|
|
|
89
91
|
carries: { kind: "boolean" },
|
|
90
92
|
stride: num({ min: 0, max: 20 }),
|
|
91
93
|
}, drawMira);
|
|
94
|
+
// ---------------------------------------------------------------- Visor (AI pillar)
|
|
95
|
+
// Ported from final.py's `visor()`: an agent at work, the hands do, the face shows the state.
|
|
96
|
+
// `holdsSheet` and `facing` (change sdd-scene-pieces, design §1 to §3): Visor holds
|
|
97
|
+
// a sheet in its left hand instead of the card, and faces left as the mirror image.
|
|
98
|
+
export const VISOR_FACINGS = ["right", "left"];
|
|
99
|
+
// Where the held sheet sits, in Visor's units (design §2): its edge under the
|
|
100
|
+
// left hand (x -98 facing right, 98 facing left), so the hand (x -92, radius 15,
|
|
101
|
+
// outline 8) lies 13 units over the page, clear of a row's lead mark and of a tail check;
|
|
102
|
+
// its bottom 4 above the ground line.
|
|
103
|
+
const HELD_SHEET_EDGE = 98;
|
|
104
|
+
const HELD_SHEET_BOTTOM = -4;
|
|
105
|
+
/**
|
|
106
|
+
* The held sheet: the `sheet` and `pill` pieces' own drawings in one group that
|
|
107
|
+
* gives them Visor's outline (cast pieces set `stroke: none` on their root), so
|
|
108
|
+
* it draws the same in a cover and in a scene. The marks sit on the white page,
|
|
109
|
+
* so they stay ink on the dark surface too (ADR 0009). Its words go to Visor's text.
|
|
110
|
+
*/
|
|
111
|
+
const heldSheet = (held, s, facing) => {
|
|
112
|
+
const x = facing === "right" ? -HELD_SHEET_EDGE - held.width : HELD_SHEET_EDGE;
|
|
113
|
+
const y = HELD_SHEET_BOTTOM - held.height;
|
|
114
|
+
const page = sheet({ x, y, width: held.width, height: held.height, rows: held.rows, top: held.top, step: held.step });
|
|
115
|
+
const tag = held.label === undefined ? null : pill({ x: x + held.width / 2, y, text: held.label });
|
|
116
|
+
// The sheet's marks group (the `g` at outline.small) gets its ink stroke here.
|
|
117
|
+
const body = page.body.map((node) => node.tag === "g" && node.attrs["stroke-width"] === tokens.outline.small && node.attrs.stroke === undefined
|
|
118
|
+
? { ...node, attrs: { ...node.attrs, stroke: tokens.color.ink } }
|
|
119
|
+
: node);
|
|
120
|
+
return drawn([g({ "data-held": "sheet", stroke: s.outline, "stroke-width": tokens.outline.block, "stroke-linejoin": "round" }, ...body, ...(tag?.body ?? []))], [...page.text, ...(tag?.text ?? [])]);
|
|
121
|
+
};
|
|
92
122
|
const drawVisor = (p) => {
|
|
93
123
|
const s = skin(p.surface ?? "light");
|
|
94
124
|
const expression = p.expression ?? "idle", view = p.view ?? "front", back = view === "back";
|
|
95
|
-
const hold = p.holds ?? false, point = p.points ?? true;
|
|
125
|
+
const hold = p.holds ?? false, point = p.points ?? true, facing = p.facing ?? "right";
|
|
126
|
+
const held = p.holdsSheet === undefined ? null : heldSheet(p.holdsSheet, s, facing);
|
|
96
127
|
const handR = point
|
|
97
128
|
? g({ transform: "translate(88,-104) rotate(-35)" }, el("rect", { x: -6, y: -30, width: 12, height: 26, rx: 6, ...outlined(s, 4.5) }), el("circle", { cx: 0, cy: 0, r: 15, ...outlined(s) }))
|
|
98
129
|
: el("circle", { cx: 86, cy: -58, r: 15, ...outlined(s) });
|
|
99
|
-
|
|
100
|
-
|
|
130
|
+
// With a held sheet the card hand stays where it is, without the card, over the sheet's edge.
|
|
131
|
+
const handL = hold || held
|
|
132
|
+
? [...(held ? [] : [el("rect", { x: -106, y: -96, width: 28, height: 24, rx: 5, fill: s.accent })]), el("circle", { cx: -92, cy: -66, r: 15, ...outlined(s) })]
|
|
101
133
|
: [el("circle", { cx: -86, cy: -58, r: 15, ...outlined(s) })];
|
|
102
134
|
const faceG = back ? null : faceAt(-42, -128, 84, 52, s, expression);
|
|
103
135
|
const pk = back
|
|
@@ -106,10 +138,33 @@ const drawVisor = (p) => {
|
|
|
106
138
|
const vent = back
|
|
107
139
|
? el("path", { d: "M-24 -110 H24 M-24 -96 H24 M-24 -82 H24", stroke: s.outline, "stroke-width": 4, "stroke-linecap": "round" })
|
|
108
140
|
: null;
|
|
109
|
-
|
|
110
|
-
|
|
141
|
+
// Facing left mirrors the body only: a uniform -1 scale keeps every stroke width and colour (ADR 0009).
|
|
142
|
+
const body = g(facing === "left" ? { transform: "scale(-1,1)" } : {}, el("rect", { x: -66, y: -114, width: 14, height: 32, rx: 4, fill: s.outline }), el("rect", { x: 52, y: -114, width: 14, height: 32, rx: 4, fill: s.outline }), el("rect", { x: -56, y: -142, width: 112, height: 88, rx: 30, ...outlined(s) }), faceG, vent, pk, el("path", { d: "M-16 -52 H16 L10 -40 H-10 Z", fill: s.outline }), ...handL, handR);
|
|
143
|
+
const transform = `translate(${p.x} ${p.y}) scale(${p.scale ?? 1})`;
|
|
144
|
+
// The words carry their own font, so they read the same in a scene, where no labels group exists.
|
|
145
|
+
const text = held && held.text.length > 0
|
|
146
|
+
? [g({ transform, "font-family": tokens.font.sans, "font-size": tokens.cover.labelSize, "font-weight": tokens.cover.labelWeight, fill: tokens.color.ink, "text-anchor": "middle" }, ...held.text)]
|
|
147
|
+
: [];
|
|
148
|
+
return drawn([g({ "data-piece": "visor", transform, stroke: "none" }, ...(held?.body ?? []), body)], text);
|
|
149
|
+
};
|
|
150
|
+
const visorHeldSheetSchema = {
|
|
151
|
+
width: { kind: "number", required: true, min: 80, max: 300 },
|
|
152
|
+
height: { kind: "number", required: true, min: 80, max: 400 },
|
|
153
|
+
rows: { kind: "array", required: true, minItems: 1, maxItems: 8, of: { kind: "object", fields: sheetRowSchema } },
|
|
154
|
+
top: size(),
|
|
155
|
+
step: size(),
|
|
156
|
+
label: label(false),
|
|
111
157
|
};
|
|
112
|
-
export const visor = definePiece("visor", {
|
|
158
|
+
export const visor = definePiece("visor", {
|
|
159
|
+
x: pos(), y: pos(), surface: surfaceParam, scale: num({ min: 0.25, max: 4 }),
|
|
160
|
+
expression: { kind: "enum", values: CAST_EXPRESSIONS }, view: { kind: "enum", values: CAST_VIEWS },
|
|
161
|
+
holds: { kind: "boolean" },
|
|
162
|
+
holdsSheet: { kind: "object", fields: visorHeldSheetSchema },
|
|
163
|
+
points: { kind: "boolean" },
|
|
164
|
+
facing: { kind: "enum", values: VISOR_FACINGS },
|
|
165
|
+
}, drawVisor,
|
|
166
|
+
// A card or a sheet, not both; the sheet only in front (its back is not designed). The card is named first.
|
|
167
|
+
(p) => p.holdsSheet === undefined ? [] : limits(p.holds === true && { path: "holdsSheet", message: "Visor holds a card or a sheet, not both" }, p.holds !== true && p.view === "back" && { path: "holdsSheet", message: "Visor holds a sheet only in the front view" }));
|
|
113
168
|
const drawDrone = (p) => {
|
|
114
169
|
const s = skin(p.surface ?? "light");
|
|
115
170
|
const expression = p.expression ?? "idle", view = p.view ?? "front", back = view === "back";
|
|
@@ -8,8 +8,9 @@ export { EIP_ICONS, EIP_ICON_NAMES, EIP_ICON_HEIGHT, EIP_ICON_WIDTH, type EipIco
|
|
|
8
8
|
export { FORMATS, LANGUAGE, LINKEDIN_PHOTO_MARGIN, LINKEDIN_PHOTO_ZONES, SAFE_ID, backgroundNames, bannerRingCount, comparePaths, coverTree, diagramRings, validateCoverSpec, type CoverFormat, type CoverOptions, type CoverPiece, type CoverRings, type CoverSpec, type CustomNode, type LinkedinPhotoZone } from "./cover.ts";
|
|
9
9
|
export { tokens, type Tokens } from "../../tokens/generated/tokens.ts";
|
|
10
10
|
export { EMOTE_KINDS, type EmoteKind, type EmoteParams } from "./emote.ts";
|
|
11
|
-
export { CAST_EXPRESSIONS, CAST_VIEWS, type CastExpression, type CastView, type MiraParams, type VisorParams, type DroneParams, type KiuParams, type SinalParams } from "./brand-cast.ts";
|
|
11
|
+
export { CAST_EXPRESSIONS, CAST_VIEWS, VISOR_FACINGS, type CastExpression, type CastView, type MiraParams, type VisorParams, type VisorFacing, type VisorHeldSheet, type DroneParams, type KiuParams, type SinalParams } from "./brand-cast.ts";
|
|
12
12
|
export { BANK_OBJECT_NAMES, type BankObjectName, type BankObjectParams } from "./bank-objects.ts";
|
|
13
13
|
export { type SymbolParams } from "./symbol.ts";
|
|
14
14
|
export { BRAND_NOTATION_ICON_NAMES, type BrandNotationIconName, type BrandNotationIconParams } from "./brand-notation-icons.ts";
|
|
15
15
|
export { CATEGORY_ICON_NAMES, type CategoryIconName, type CategoryIconParams } from "./category-icon.ts";
|
|
16
|
+
export { type QuestionTokenParams } from "./question-token.ts";
|
package/dist/src/pieces/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export { EIP_ICONS, EIP_ICON_NAMES, EIP_ICON_HEIGHT, EIP_ICON_WIDTH } from "./ei
|
|
|
13
13
|
export { FORMATS, LANGUAGE, LINKEDIN_PHOTO_MARGIN, LINKEDIN_PHOTO_ZONES, SAFE_ID, backgroundNames, bannerRingCount, comparePaths, coverTree, diagramRings, validateCoverSpec } from "./cover.js";
|
|
14
14
|
export { tokens } from "../../tokens/generated/tokens.js";
|
|
15
15
|
export { EMOTE_KINDS } from "./emote.js";
|
|
16
|
-
export { CAST_EXPRESSIONS, CAST_VIEWS } from "./brand-cast.js";
|
|
16
|
+
export { CAST_EXPRESSIONS, CAST_VIEWS, VISOR_FACINGS } from "./brand-cast.js";
|
|
17
17
|
export { BANK_OBJECT_NAMES } from "./bank-objects.js";
|
|
18
18
|
export { BRAND_NOTATION_ICON_NAMES } from "./brand-notation-icons.js";
|
|
19
19
|
export { CATEGORY_ICON_NAMES } from "./category-icon.js";
|
|
@@ -5,22 +5,17 @@ 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
7
|
import { headline, type HeadlineParams } from "./headline.ts";
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import { questionToken, type QuestionTokenParams } from "./question-token.ts";
|
|
9
|
+
import { pill, sheet, type PillParams, type SheetParams, type SheetRow } from "./paper.ts";
|
|
10
|
+
export { pill, sheet };
|
|
11
|
+
export type { PillParams, SheetParams, SheetRow };
|
|
12
|
+
export { emote, mira, visor, drone, kiu, sinal, bankObject, symbol, brandNotationIcon, categoryIcon, headline, questionToken };
|
|
13
|
+
export type { MiraParams, VisorParams, DroneParams, KiuParams, SinalParams, BankObjectName, BankObjectParams, SymbolParams, BrandNotationIconName, BrandNotationIconParams, CategoryIconParams, HeadlineParams, QuestionTokenParams };
|
|
10
14
|
export * from "./metro.ts";
|
|
11
15
|
export * from "./diagram.ts";
|
|
12
16
|
export * from "./ui-icons.ts";
|
|
13
17
|
export * from "./link-icons.ts";
|
|
14
18
|
type Point = [number, number];
|
|
15
|
-
export type PillParams = {
|
|
16
|
-
x: number;
|
|
17
|
-
y: number;
|
|
18
|
-
text: string;
|
|
19
|
-
fill?: string;
|
|
20
|
-
width?: number;
|
|
21
|
-
};
|
|
22
|
-
/** Pill label centred on (x, y), usually overlapping the top edge of what it names. Backticks mark code (card 190). */
|
|
23
|
-
export declare const pill: import("./piece.ts").Piece<PillParams>;
|
|
24
19
|
export declare const RING_COUNT = 14;
|
|
25
20
|
/** Most rings one call draws: enough for a banner's farthest corner from any centre a cover spec accepts (548). */
|
|
26
21
|
export declare const MAX_RINGS = 1000;
|
|
@@ -33,25 +28,6 @@ export type RingsParams = {
|
|
|
33
28
|
};
|
|
34
29
|
/** Concentric rings around (cx, cy): `count` rings (14 by default), step and width from the cover tokens. */
|
|
35
30
|
export declare const rings: import("./piece.ts").Piece<RingsParams>;
|
|
36
|
-
export type SheetRow = {
|
|
37
|
-
lead?: "none" | "checkbox" | "checked" | "question";
|
|
38
|
-
bar: number;
|
|
39
|
-
tail?: "none" | "check";
|
|
40
|
-
};
|
|
41
|
-
export type SheetParams = {
|
|
42
|
-
x: number;
|
|
43
|
-
y: number;
|
|
44
|
-
width: number;
|
|
45
|
-
height: number;
|
|
46
|
-
rows: SheetRow[];
|
|
47
|
-
top?: number;
|
|
48
|
-
step?: number;
|
|
49
|
-
fill?: string;
|
|
50
|
-
leadFill?: string;
|
|
51
|
-
tick?: string;
|
|
52
|
-
};
|
|
53
|
-
/** A sheet of paper with rows of text bars, an optional lead mark and an optional tick at the end. */
|
|
54
|
-
export declare const sheet: import("./piece.ts").Piece<SheetParams>;
|
|
55
31
|
declare const CODE_LINE_COLOURS: readonly ["healthy", "caller", "white", "backend"];
|
|
56
32
|
export type CodeLine = {
|
|
57
33
|
indent: number;
|
|
@@ -343,6 +319,7 @@ export declare const PIECES: {
|
|
|
343
319
|
readonly brandNotationIcon: import("./piece.ts").Piece<BrandNotationIconParams>;
|
|
344
320
|
readonly categoryIcon: import("./piece.ts").Piece<CategoryIconParams>;
|
|
345
321
|
readonly headline: import("./piece.ts").Piece<HeadlineParams>;
|
|
322
|
+
readonly questionToken: import("./piece.ts").Piece<QuestionTokenParams>;
|
|
346
323
|
};
|
|
347
324
|
export type PieceName = keyof typeof PIECES;
|
|
348
325
|
export declare const PIECE_NAMES: PieceName[];
|
|
@@ -22,20 +22,17 @@ 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 { headline } from "./headline.js";
|
|
25
|
-
import {
|
|
26
|
-
|
|
25
|
+
import { questionToken } from "./question-token.js";
|
|
26
|
+
import { pill, sheet } from "./paper.js";
|
|
27
|
+
export { pill, sheet };
|
|
28
|
+
export { emote, mira, visor, drone, kiu, sinal, bankObject, symbol, brandNotationIcon, categoryIcon, headline, questionToken };
|
|
27
29
|
export * from "./metro.js";
|
|
28
30
|
export * from "./diagram.js";
|
|
29
31
|
export * from "./ui-icons.js";
|
|
30
32
|
export * from "./link-icons.js";
|
|
31
33
|
const ink = tokens.color.ink;
|
|
32
34
|
const mono = tokens.font.mono;
|
|
33
|
-
|
|
34
|
-
export const pill = definePiece("pill", { x: pos(), y: pos(), text: label(), fill: col(), width: size() }, ({ x, y, text, fill = "color.white", width }) => {
|
|
35
|
-
const h = tokens.cover.pillHeight;
|
|
36
|
-
const w = width ?? Math.max(68, Math.round(codeLength(text) * 10.5 + 34));
|
|
37
|
-
return drawn([el("rect", { x: x - w / 2, y: y - h / 2, width: w, height: h, rx: h / 2, fill: colour(fill, "fill") })], [el("text", { x, y: y + 7 }, ...spans(text))]);
|
|
38
|
-
});
|
|
35
|
+
// ---------- labels and paper: pill and sheet live in paper.ts ----------
|
|
39
36
|
// ---------- background ----------
|
|
40
37
|
export const RING_COUNT = 14;
|
|
41
38
|
/** Most rings one call draws: enough for a banner's farthest corner from any centre a cover spec accepts (548). */
|
|
@@ -44,57 +41,6 @@ export const MAX_RINGS = 1000;
|
|
|
44
41
|
export const rings = definePiece("rings", { cx: pos(), cy: pos(), radius: size(), color: col(), count: count(1, MAX_RINGS) }, ({ cx, cy, radius = tokens.cover.ringRadius, color = "color.ring", count: rings = RING_COUNT }) => drawn([
|
|
45
42
|
g({ fill: "none", stroke: colour(color, "color"), "stroke-width": tokens.cover.ringWidth }, ...Array.from({ length: rings }, (_, i) => el("circle", { cx, cy, r: radius + i * tokens.cover.ringStep }))),
|
|
46
43
|
]));
|
|
47
|
-
const rowSchema = {
|
|
48
|
-
lead: { kind: "enum", values: ["none", "checkbox", "checked", "question"] },
|
|
49
|
-
bar: size(true),
|
|
50
|
-
tail: { kind: "enum", values: ["none", "check"] },
|
|
51
|
-
};
|
|
52
|
-
/** A sheet of paper with rows of text bars, an optional lead mark and an optional tick at the end. */
|
|
53
|
-
export const sheet = definePiece("sheet", {
|
|
54
|
-
x: pos(),
|
|
55
|
-
y: pos(),
|
|
56
|
-
width: size(true, 80),
|
|
57
|
-
height: size(true),
|
|
58
|
-
rows: { kind: "array", required: true, of: { kind: "object", fields: rowSchema } },
|
|
59
|
-
top: size(),
|
|
60
|
-
step: size(),
|
|
61
|
-
fill: col(),
|
|
62
|
-
leadFill: col(),
|
|
63
|
-
tick: col(),
|
|
64
|
-
}, ({ x, y, width, height, rows, top = 46, step = 38, fill = "color.white", leadFill = "color.ink", tick = "color.white" }) => {
|
|
65
|
-
const marks = [];
|
|
66
|
-
const bars = [];
|
|
67
|
-
const ticks = [];
|
|
68
|
-
const glyphs = [];
|
|
69
|
-
rows.forEach((row, i) => {
|
|
70
|
-
const cy = y + top + i * step + 11;
|
|
71
|
-
let barX = x + 22;
|
|
72
|
-
if (row.lead === "checkbox" || row.lead === "checked") {
|
|
73
|
-
const checked = row.lead === "checked";
|
|
74
|
-
marks.push(el("rect", { x: x + 22, y: cy - 11, width: 22, height: 22, rx: 5, fill: checked ? colour(leadFill, "leadFill") : tokens.color.white }));
|
|
75
|
-
if (checked)
|
|
76
|
-
ticks.push(el("path", { d: `M${x + 27},${cy} L${x + 32},${cy + 6} L${x + 40},${cy - 6}`, stroke: colour(tick, "tick") }));
|
|
77
|
-
barX = x + 56;
|
|
78
|
-
}
|
|
79
|
-
else if (row.lead === "question") {
|
|
80
|
-
marks.push(el("circle", { cx: x + 30, cy, r: 13, fill: tokens.color.white }));
|
|
81
|
-
glyphs.push(el("text", { x: x + 30, y: cy + 7, "font-size": 19, "font-weight": tokens.font.weightHeavy }, "?"));
|
|
82
|
-
barX = x + 52;
|
|
83
|
-
}
|
|
84
|
-
bars.push(el("rect", { x: barX, y: cy - 5, width: row.bar, height: 10, rx: 5 }));
|
|
85
|
-
if (row.tail === "check") {
|
|
86
|
-
const tx = x + width - 40;
|
|
87
|
-
marks.push(el("rect", { x: tx, y: cy - 11, width: 22, height: 22, rx: 5, fill: tokens.color.state.healthy }));
|
|
88
|
-
ticks.push(el("path", { d: `M${tx + 5},${cy} L${tx + 10},${cy + 6} L${tx + 18},${cy - 6}`, stroke: ink }));
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
return drawn([
|
|
92
|
-
...shadowed(el("rect", { x, y, width, height, rx: 14, fill: colour(fill, "fill") })),
|
|
93
|
-
g({ "stroke-width": tokens.outline.small }, ...marks),
|
|
94
|
-
g({ fill: "none", "stroke-width": 3.5, "stroke-linecap": "round" }, ...ticks),
|
|
95
|
-
g({ stroke: "none", fill: tokens.illustration.textBar }, ...bars),
|
|
96
|
-
], glyphs);
|
|
97
|
-
});
|
|
98
44
|
// The line kinds of 0.6.x specs, kept so they stay valid (ADR 0009): on the dark card every line is
|
|
99
45
|
// brand.dark.textMuted, a `white` line brand.dark.text, and the `tall` line (the one under review) the accent.
|
|
100
46
|
const CODE_LINE_COLOURS = ["healthy", "caller", "white", "backend"];
|
|
@@ -412,5 +358,6 @@ export const PIECES = {
|
|
|
412
358
|
brandNotationIcon,
|
|
413
359
|
categoryIcon,
|
|
414
360
|
headline,
|
|
361
|
+
questionToken,
|
|
415
362
|
};
|
|
416
363
|
export const PIECE_NAMES = Object.keys(PIECES);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Schema } from "./params.ts";
|
|
2
|
+
export type PillParams = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
text: string;
|
|
6
|
+
fill?: string;
|
|
7
|
+
width?: number;
|
|
8
|
+
};
|
|
9
|
+
/** Pill label centred on (x, y), usually overlapping the top edge of what it names. Backticks mark code (card 190). */
|
|
10
|
+
export declare const pill: import("./piece.ts").Piece<PillParams>;
|
|
11
|
+
export type SheetRow = {
|
|
12
|
+
lead?: "none" | "checkbox" | "checked" | "question";
|
|
13
|
+
bar: number;
|
|
14
|
+
tail?: "none" | "check";
|
|
15
|
+
};
|
|
16
|
+
export type SheetParams = {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
rows: SheetRow[];
|
|
22
|
+
top?: number;
|
|
23
|
+
step?: number;
|
|
24
|
+
fill?: string;
|
|
25
|
+
leadFill?: string;
|
|
26
|
+
tick?: string;
|
|
27
|
+
};
|
|
28
|
+
/** The shape of one sheet row; Visor's held sheet takes the same rows (brand-cast.ts). */
|
|
29
|
+
export declare const sheetRowSchema: Schema;
|
|
30
|
+
/** A sheet of paper with rows of text bars, an optional lead mark and an optional tick at the end. */
|
|
31
|
+
export declare const sheet: import("./piece.ts").Piece<SheetParams>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// The paper pieces, `pill` and `sheet` (spec illustration-pieces, "Piece
|
|
2
|
+
// catalogue"), moved unchanged from library.ts by change sdd-scene-pieces
|
|
3
|
+
// (card 333): Visor draws them in its hand (`holdsSheet`, brand-cast.ts), and
|
|
4
|
+
// brand-cast.ts cannot import library.ts, which imports it. library.ts
|
|
5
|
+
// re-exports both, so the catalogue and its order are the same.
|
|
6
|
+
//
|
|
7
|
+
// What can go wrong: the schemas reject an empty label, a sheet narrower than
|
|
8
|
+
// 80 and an unknown row lead or tail, naming the parameter.
|
|
9
|
+
import { tokens } from "../../tokens/generated/tokens.js";
|
|
10
|
+
import { drawn, el, g, shadowed } from "./node.js";
|
|
11
|
+
import { col, colour, label, pos, size } from "./params.js";
|
|
12
|
+
import { definePiece } from "./piece.js";
|
|
13
|
+
import { codeLength, spans } from "./ink.js";
|
|
14
|
+
const ink = tokens.color.ink;
|
|
15
|
+
/** Pill label centred on (x, y), usually overlapping the top edge of what it names. Backticks mark code (card 190). */
|
|
16
|
+
export const pill = definePiece("pill", { x: pos(), y: pos(), text: label(), fill: col(), width: size() }, ({ x, y, text, fill = "color.white", width }) => {
|
|
17
|
+
const h = tokens.cover.pillHeight;
|
|
18
|
+
const w = width ?? Math.max(68, Math.round(codeLength(text) * 10.5 + 34));
|
|
19
|
+
return drawn([el("rect", { x: x - w / 2, y: y - h / 2, width: w, height: h, rx: h / 2, fill: colour(fill, "fill") })], [el("text", { x, y: y + 7 }, ...spans(text))]);
|
|
20
|
+
});
|
|
21
|
+
/** The shape of one sheet row; Visor's held sheet takes the same rows (brand-cast.ts). */
|
|
22
|
+
export const sheetRowSchema = {
|
|
23
|
+
lead: { kind: "enum", values: ["none", "checkbox", "checked", "question"] },
|
|
24
|
+
bar: size(true),
|
|
25
|
+
tail: { kind: "enum", values: ["none", "check"] },
|
|
26
|
+
};
|
|
27
|
+
/** A sheet of paper with rows of text bars, an optional lead mark and an optional tick at the end. */
|
|
28
|
+
export const sheet = definePiece("sheet", {
|
|
29
|
+
x: pos(),
|
|
30
|
+
y: pos(),
|
|
31
|
+
width: size(true, 80),
|
|
32
|
+
height: size(true),
|
|
33
|
+
rows: { kind: "array", required: true, of: { kind: "object", fields: sheetRowSchema } },
|
|
34
|
+
top: size(),
|
|
35
|
+
step: size(),
|
|
36
|
+
fill: col(),
|
|
37
|
+
leadFill: col(),
|
|
38
|
+
tick: col(),
|
|
39
|
+
}, ({ x, y, width, height, rows, top = 46, step = 38, fill = "color.white", leadFill = "color.ink", tick = "color.white" }) => {
|
|
40
|
+
const marks = [];
|
|
41
|
+
const bars = [];
|
|
42
|
+
const ticks = [];
|
|
43
|
+
const glyphs = [];
|
|
44
|
+
rows.forEach((row, i) => {
|
|
45
|
+
const cy = y + top + i * step + 11;
|
|
46
|
+
let barX = x + 22;
|
|
47
|
+
if (row.lead === "checkbox" || row.lead === "checked") {
|
|
48
|
+
const checked = row.lead === "checked";
|
|
49
|
+
marks.push(el("rect", { x: x + 22, y: cy - 11, width: 22, height: 22, rx: 5, fill: checked ? colour(leadFill, "leadFill") : tokens.color.white }));
|
|
50
|
+
if (checked)
|
|
51
|
+
ticks.push(el("path", { d: `M${x + 27},${cy} L${x + 32},${cy + 6} L${x + 40},${cy - 6}`, stroke: colour(tick, "tick") }));
|
|
52
|
+
barX = x + 56;
|
|
53
|
+
}
|
|
54
|
+
else if (row.lead === "question") {
|
|
55
|
+
marks.push(el("circle", { cx: x + 30, cy, r: 13, fill: tokens.color.white }));
|
|
56
|
+
glyphs.push(el("text", { x: x + 30, y: cy + 7, "font-size": 19, "font-weight": tokens.font.weightHeavy }, "?"));
|
|
57
|
+
barX = x + 52;
|
|
58
|
+
}
|
|
59
|
+
bars.push(el("rect", { x: barX, y: cy - 5, width: row.bar, height: 10, rx: 5 }));
|
|
60
|
+
if (row.tail === "check") {
|
|
61
|
+
const tx = x + width - 40;
|
|
62
|
+
marks.push(el("rect", { x: tx, y: cy - 11, width: 22, height: 22, rx: 5, fill: tokens.color.state.healthy }));
|
|
63
|
+
ticks.push(el("path", { d: `M${tx + 5},${cy} L${tx + 10},${cy + 6} L${tx + 18},${cy - 6}`, stroke: ink }));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return drawn([
|
|
67
|
+
...shadowed(el("rect", { x, y, width, height, rx: 14, fill: colour(fill, "fill") })),
|
|
68
|
+
g({ "stroke-width": tokens.outline.small }, ...marks),
|
|
69
|
+
g({ fill: "none", "stroke-width": 3.5, "stroke-linecap": "round" }, ...ticks),
|
|
70
|
+
g({ stroke: "none", fill: tokens.illustration.textBar }, ...bars),
|
|
71
|
+
], glyphs);
|
|
72
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SurfaceName } from "./ink.ts";
|
|
2
|
+
export type QuestionTokenParams = {
|
|
3
|
+
cx: number;
|
|
4
|
+
cy: number;
|
|
5
|
+
scale?: number;
|
|
6
|
+
surface?: SurfaceName;
|
|
7
|
+
};
|
|
8
|
+
/** The open question as an object: a white disc with a `?`, the mark of a sheet's question row. */
|
|
9
|
+
export declare const questionToken: import("./piece.ts").Piece<QuestionTokenParams>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// `questionToken` (spec illustration-pieces, "Question token", "Question token
|
|
2
|
+
// parameters"; change sdd-scene-pieces, design §4): the open question as an
|
|
3
|
+
// object that travels in a scene or sits on a cover, in the v2 grammar of ADR
|
|
4
|
+
// 0009. Its mark is exactly a `sheet` question row's (a white disc of radius 13
|
|
5
|
+
// outlined at `outline.small`, a `?` at size 19 and weight heavy, baseline +7),
|
|
6
|
+
// because in the SDD scene the token travels into a sheet and becomes a row.
|
|
7
|
+
//
|
|
8
|
+
// Why a piece of its own: `countBadge` is a stackledger map sticker (its face is
|
|
9
|
+
// the surface's panel, its size grows from `textSize` with the map tokens), so
|
|
10
|
+
// the gate-0 storyboard's `?` drawn with it read as a dark disc on the dark
|
|
11
|
+
// surface and tied the scene's object to the map's evolution.
|
|
12
|
+
//
|
|
13
|
+
// The disc carries its own stroke, so it draws the same inside the cover
|
|
14
|
+
// command's outlined group as in a scene; the `?` carries its own font, so it
|
|
15
|
+
// reads the same through `toReact` where no labels group exists. `scale` scales
|
|
16
|
+
// the outline with the disc (as `emote`), so a large token keeps the row's
|
|
17
|
+
// proportions.
|
|
18
|
+
//
|
|
19
|
+
// What can go wrong: the schema rejects a missing position, a scale outside
|
|
20
|
+
// (0, 10], an unknown surface, and any colour or text parameter (the token takes
|
|
21
|
+
// none), naming the parameter.
|
|
22
|
+
import { tokens } from "../../tokens/generated/tokens.js";
|
|
23
|
+
import { drawn, el, g } from "./node.js";
|
|
24
|
+
import { inkOf, surfaceParam } from "./ink.js";
|
|
25
|
+
import { pos } from "./params.js";
|
|
26
|
+
import { definePiece } from "./piece.js";
|
|
27
|
+
/** The radius of a sheet question row's disc (`sheet` in paper.ts). */
|
|
28
|
+
const MARK_RADIUS = 13;
|
|
29
|
+
/** The `?` of a sheet question row: its size, and its baseline below the disc's centre. */
|
|
30
|
+
const GLYPH_SIZE = 19;
|
|
31
|
+
const GLYPH_BASELINE = 7;
|
|
32
|
+
const drawQuestionToken = ({ cx, cy, scale = 1, surface = "light" }) => {
|
|
33
|
+
// The ink line of the surface: ink on light, `surface.dark.muted` on dark (ADR 0009's dark rule).
|
|
34
|
+
const { line } = inkOf({ surface });
|
|
35
|
+
const attrs = scale === 1
|
|
36
|
+
? { "data-piece": "questionToken" }
|
|
37
|
+
: { "data-piece": "questionToken", transform: `translate(${cx} ${cy}) scale(${scale}) translate(${-cx} ${-cy})` };
|
|
38
|
+
return drawn([g(attrs, el("circle", { cx, cy, r: MARK_RADIUS, fill: tokens.color.white, stroke: line, "stroke-width": tokens.outline.small }))], [g(attrs, el("text", {
|
|
39
|
+
x: cx,
|
|
40
|
+
y: cy + GLYPH_BASELINE,
|
|
41
|
+
"font-family": tokens.font.sans,
|
|
42
|
+
"font-size": GLYPH_SIZE,
|
|
43
|
+
"font-weight": tokens.font.weightHeavy,
|
|
44
|
+
fill: tokens.color.ink,
|
|
45
|
+
"text-anchor": "middle",
|
|
46
|
+
}, "?"))]);
|
|
47
|
+
};
|
|
48
|
+
/** The open question as an object: a white disc with a `?`, the mark of a sheet's question row. */
|
|
49
|
+
export const questionToken = definePiece("questionToken", { cx: pos(), cy: pos(), scale: { kind: "number", min: 0, exclusiveMin: true, max: 10 }, surface: surfaceParam }, drawQuestionToken);
|
|
@@ -201,6 +201,16 @@ export declare const tokens: {
|
|
|
201
201
|
readonly pill: 22;
|
|
202
202
|
readonly small: 6;
|
|
203
203
|
};
|
|
204
|
+
readonly scene: {
|
|
205
|
+
readonly pathColor: "#5C5852";
|
|
206
|
+
readonly pathDash: 4;
|
|
207
|
+
readonly pathGap: 18;
|
|
208
|
+
readonly pathWidth: 6;
|
|
209
|
+
readonly ringRadius: 100;
|
|
210
|
+
readonly ringReach: 1.2;
|
|
211
|
+
readonly ringStep: 34;
|
|
212
|
+
readonly ringWidth: 2.5;
|
|
213
|
+
};
|
|
204
214
|
readonly shadow: {
|
|
205
215
|
readonly block: 0;
|
|
206
216
|
readonly pill: 0;
|
|
@@ -202,6 +202,16 @@ export const tokens = {
|
|
|
202
202
|
"pill": 22,
|
|
203
203
|
"small": 6
|
|
204
204
|
},
|
|
205
|
+
"scene": {
|
|
206
|
+
"pathColor": "#5C5852",
|
|
207
|
+
"pathDash": 4,
|
|
208
|
+
"pathGap": 18,
|
|
209
|
+
"pathWidth": 6,
|
|
210
|
+
"ringRadius": 100,
|
|
211
|
+
"ringReach": 1.2,
|
|
212
|
+
"ringStep": 34,
|
|
213
|
+
"ringWidth": 2.5
|
|
214
|
+
},
|
|
205
215
|
"shadow": {
|
|
206
216
|
"block": 0,
|
|
207
217
|
"pill": 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brunosouzas/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.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": {
|
|
@@ -140,6 +140,14 @@
|
|
|
140
140
|
--ds-radius-block: 18px;
|
|
141
141
|
--ds-radius-pill: 22px;
|
|
142
142
|
--ds-radius-small: 6px;
|
|
143
|
+
--ds-scene-path-color: #5C5852;
|
|
144
|
+
--ds-scene-path-dash: 4px;
|
|
145
|
+
--ds-scene-path-gap: 18px;
|
|
146
|
+
--ds-scene-path-width: 6px;
|
|
147
|
+
--ds-scene-ring-radius: 100px;
|
|
148
|
+
--ds-scene-ring-reach: 1.2;
|
|
149
|
+
--ds-scene-ring-step: 34px;
|
|
150
|
+
--ds-scene-ring-width: 2.5px;
|
|
143
151
|
--ds-shadow-block: 0px;
|
|
144
152
|
--ds-shadow-pill: 0px;
|
|
145
153
|
--ds-shadow-small: 0px;
|
|
@@ -201,6 +201,16 @@
|
|
|
201
201
|
"pill": 22,
|
|
202
202
|
"small": 6
|
|
203
203
|
},
|
|
204
|
+
"scene": {
|
|
205
|
+
"pathColor": "#5C5852",
|
|
206
|
+
"pathDash": 4,
|
|
207
|
+
"pathGap": 18,
|
|
208
|
+
"pathWidth": 6,
|
|
209
|
+
"ringRadius": 100,
|
|
210
|
+
"ringReach": 1.2,
|
|
211
|
+
"ringStep": 34,
|
|
212
|
+
"ringWidth": 2.5
|
|
213
|
+
},
|
|
204
214
|
"shadow": {
|
|
205
215
|
"block": 0,
|
|
206
216
|
"pill": 0,
|
|
@@ -203,6 +203,16 @@ export const tokens = {
|
|
|
203
203
|
"pill": 22,
|
|
204
204
|
"small": 6
|
|
205
205
|
},
|
|
206
|
+
"scene": {
|
|
207
|
+
"pathColor": "#5C5852",
|
|
208
|
+
"pathDash": 4,
|
|
209
|
+
"pathGap": 18,
|
|
210
|
+
"pathWidth": 6,
|
|
211
|
+
"ringRadius": 100,
|
|
212
|
+
"ringReach": 1.2,
|
|
213
|
+
"ringStep": 34,
|
|
214
|
+
"ringWidth": 2.5
|
|
215
|
+
},
|
|
206
216
|
"shadow": {
|
|
207
217
|
"block": 0,
|
|
208
218
|
"pill": 0,
|