@brunosouzas/signwright 0.0.0-stage → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +15 -0
  3. package/README.md +567 -2
  4. package/dist/scripts/cover.d.ts +29 -0
  5. package/dist/scripts/cover.js +186 -0
  6. package/dist/src/fonts/embed.d.ts +7 -0
  7. package/dist/src/fonts/embed.js +221 -0
  8. package/dist/src/pieces/bank-objects.d.ts +12 -0
  9. package/dist/src/pieces/bank-objects.js +52 -0
  10. package/dist/src/pieces/brand-cast.d.ts +105 -0
  11. package/dist/src/pieces/brand-cast.js +221 -0
  12. package/dist/src/pieces/brand-notation-icons.d.ts +12 -0
  13. package/dist/src/pieces/brand-notation-icons.js +79 -0
  14. package/dist/src/pieces/category-icon.d.ts +12 -0
  15. package/dist/src/pieces/category-icon.js +55 -0
  16. package/dist/src/pieces/cover.d.ts +138 -0
  17. package/dist/src/pieces/cover.js +635 -0
  18. package/dist/src/pieces/diagram.d.ts +141 -0
  19. package/dist/src/pieces/diagram.js +201 -0
  20. package/dist/src/pieces/eip-icons.d.ts +12 -0
  21. package/dist/src/pieces/eip-icons.js +468 -0
  22. package/dist/src/pieces/emote.d.ts +13 -0
  23. package/dist/src/pieces/emote.js +88 -0
  24. package/dist/src/pieces/headline.d.ts +11 -0
  25. package/dist/src/pieces/headline.js +37 -0
  26. package/dist/src/pieces/index.d.ts +17 -0
  27. package/dist/src/pieces/index.js +20 -0
  28. package/dist/src/pieces/ink.d.ts +71 -0
  29. package/dist/src/pieces/ink.js +57 -0
  30. package/dist/src/pieces/keyboard.d.ts +9 -0
  31. package/dist/src/pieces/keyboard.js +33 -0
  32. package/dist/src/pieces/library.d.ts +320 -0
  33. package/dist/src/pieces/library.js +355 -0
  34. package/dist/src/pieces/link-icons.d.ts +23 -0
  35. package/dist/src/pieces/link-icons.js +101 -0
  36. package/dist/src/pieces/metro.d.ts +137 -0
  37. package/dist/src/pieces/metro.js +288 -0
  38. package/dist/src/pieces/node.d.ts +29 -0
  39. package/dist/src/pieces/node.js +56 -0
  40. package/dist/src/pieces/paper.d.ts +31 -0
  41. package/dist/src/pieces/paper.js +72 -0
  42. package/dist/src/pieces/params.d.ts +84 -0
  43. package/dist/src/pieces/params.js +158 -0
  44. package/dist/src/pieces/piece.d.ts +9 -0
  45. package/dist/src/pieces/piece.js +28 -0
  46. package/dist/src/pieces/pose.d.ts +16 -0
  47. package/dist/src/pieces/pose.js +30 -0
  48. package/dist/src/pieces/question-token.d.ts +9 -0
  49. package/dist/src/pieces/question-token.js +49 -0
  50. package/dist/src/pieces/react.d.ts +4 -0
  51. package/dist/src/pieces/react.js +13 -0
  52. package/dist/src/pieces/render.d.ts +2 -0
  53. package/dist/src/pieces/render.js +22 -0
  54. package/dist/src/pieces/skin.d.ts +22 -0
  55. package/dist/src/pieces/skin.js +13 -0
  56. package/dist/src/pieces/stamp.d.ts +11 -0
  57. package/dist/src/pieces/stamp.js +29 -0
  58. package/dist/src/pieces/supporting-cast.d.ts +35 -0
  59. package/dist/src/pieces/supporting-cast.js +168 -0
  60. package/dist/src/pieces/symbol.d.ts +13 -0
  61. package/dist/src/pieces/symbol.js +27 -0
  62. package/dist/src/pieces/ui-icons.d.ts +21 -0
  63. package/dist/src/pieces/ui-icons.js +35 -0
  64. package/dist/tokens/generated/tokens.d.ts +299 -0
  65. package/dist/tokens/generated/tokens.js +299 -0
  66. package/fonts/OFL.txt +97 -0
  67. package/fonts/SourceCodePro-Bold.ttf +0 -0
  68. package/fonts/SourceCodePro-Regular.ttf +0 -0
  69. package/fonts/SourceSans3-Black.ttf +0 -0
  70. package/fonts/SourceSans3-Bold.ttf +0 -0
  71. package/fonts/SourceSans3-Regular.ttf +0 -0
  72. package/fonts/SourceSerif4-Bold.ttf +0 -0
  73. package/package.json +88 -4
  74. package/tokens/generated/tokens.css +215 -0
  75. package/tokens/generated/tokens.json +298 -0
  76. package/tokens/generated/tokens.ts +302 -0
@@ -0,0 +1,13 @@
1
+ import { type SvgNode } from "./node.ts";
2
+ import { type SurfaceName } from "./ink.ts";
3
+ export type SymbolParams = {
4
+ x: number;
5
+ y: number;
6
+ surface?: SurfaceName;
7
+ scale?: number;
8
+ };
9
+ /** The symbol's three shapes in its 32×32 box: the haste and the ring in `text`, the moon in `moon`. One drawing,
10
+ * shared by `symbol` (favicon, avatar, signature) and the `brunosouzas` link icon (change brand-link-icon). */
11
+ export declare const symbolShapes: (text: string, moon: string) => SvgNode[];
12
+ /** The brand symbol ("b" with a moon, I5), in a 32×32 box before `scale`. Favicon and avatar are built from this. */
13
+ export declare const symbol: import("./piece.ts").Piece<SymbolParams>;
@@ -0,0 +1,27 @@
1
+ // The brand symbol: the "b" with a moon (identity studio I5): the haste and
2
+ // the ring read as a lowercase b, the moon sits on the accent of the ring.
3
+ // Ported from `~/.hermes/cache/scratch/ab267/board4.py`'s `bmoon()`, the
4
+ // approved source (reused unchanged by every later script, through `final.py`).
5
+ import { drawn, el, g } from "./node.js";
6
+ import { surfaceParam } from "./ink.js";
7
+ import { pos, num } from "./params.js";
8
+ import { definePiece } from "./piece.js";
9
+ import { colour } from "./params.js";
10
+ const c = (path) => colour(path);
11
+ /** The symbol's three shapes in its 32×32 box: the haste and the ring in `text`, the moon in `moon`. One drawing,
12
+ * shared by `symbol` (favicon, avatar, signature) and the `brunosouzas` link icon (change brand-link-icon). */
13
+ export const symbolShapes = (text, moon) => [
14
+ el("rect", { x: 5, y: 3, width: 5.5, height: 26, rx: 2.75, fill: text }),
15
+ el("circle", { cx: 17.5, cy: 20.5, r: 7.3, fill: "none", stroke: text, "stroke-width": 4.6 }),
16
+ el("circle", { cx: 27.5, cy: 9, r: 2.8, fill: moon }),
17
+ ];
18
+ const drawSymbol = (p) => {
19
+ const light = (p.surface ?? "light") === "light";
20
+ const color = light ? c("brand.light.text") : c("brand.dark.text");
21
+ const moon = light ? c("brand.light.accent") : c("brand.dark.accent");
22
+ const scale = p.scale ?? 1; // size is in the 32×32 glyph box, scaled like any other piece
23
+ const body = g({ transform: `translate(${p.x} ${p.y}) scale(${scale})` }, ...symbolShapes(color, moon));
24
+ return drawn([body]);
25
+ };
26
+ /** The brand symbol ("b" with a moon, I5), in a 32×32 box before `scale`. Favicon and avatar are built from this. */
27
+ export const symbol = definePiece("symbol", { x: pos(), y: pos(), surface: surfaceParam, scale: num({ min: 0.1, max: 20 }) }, drawSymbol);
@@ -0,0 +1,21 @@
1
+ import type { SvgNode } from "./node.ts";
2
+ export type UiIcon = {
3
+ readonly name: string;
4
+ readonly title: string;
5
+ readonly description: string;
6
+ readonly nodes: readonly SvgNode[];
7
+ };
8
+ /** Every UI icon draws in a 24x24 box. */
9
+ export declare const UI_ICON_SIZE = 24;
10
+ export declare const UI_ICONS: readonly UiIcon[];
11
+ export declare const UI_ICON_NAMES: string[];
12
+ export type UiIconParams = {
13
+ name: string;
14
+ x: number;
15
+ y: number;
16
+ size?: number;
17
+ colour?: string;
18
+ };
19
+ /** One UI icon at (x, y), `size` wide (24 by default), in one token colour (`color.ink` by default)
20
+ * or `currentColor`, so an icon inline in a page follows its element's text colour. */
21
+ export declare const uiIcon: import("./piece.ts").Piece<UiIconParams>;
@@ -0,0 +1,35 @@
1
+ import { el, g, drawn, r2 } from "./node.js";
2
+ import { CURRENT_COLOUR, colOrCurrent, pos, size } from "./params.js";
3
+ import { definePiece } from "./piece.js";
4
+ import { colour } from "./params.js";
5
+ /** Every UI icon draws in a 24x24 box. */
6
+ export const UI_ICON_SIZE = 24;
7
+ const stroked = (d) => el("path", { d, fill: "none", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round" });
8
+ const filled = (d) => el("path", { d, stroke: "none" });
9
+ export const UI_ICONS = [
10
+ {
11
+ name: "sun",
12
+ title: "Sun",
13
+ description: "Light theme: a disc with eight rays.",
14
+ nodes: [el("circle", { cx: 12, cy: 12, r: 4.5, stroke: "none" }), stroked("M12 2.5v2.5M12 19v2.5M2.5 12H5M19 12h2.5M5.3 5.3l1.8 1.8M16.9 16.9l1.8 1.8M5.3 18.7l1.8-1.8M16.9 7.1l1.8-1.8")],
15
+ },
16
+ { name: "moon", title: "Moon", description: "Dark theme: a crescent moon.", nodes: [filled("M20.5 14.6A8.6 8.6 0 0 1 9.4 3.5a8.6 8.6 0 1 0 11.1 11.1Z")] },
17
+ { name: "zoomIn", title: "Zoom in", description: "A magnifier with a plus.", nodes: [stroked("M10.5 4a6.5 6.5 0 1 0 0 13a6.5 6.5 0 1 0 0-13ZM15.3 15.3l5.2 5.2M7.5 10.5h6M10.5 7.5v6")] },
18
+ { name: "zoomOut", title: "Zoom out", description: "A magnifier with a minus.", nodes: [stroked("M10.5 4a6.5 6.5 0 1 0 0 13a6.5 6.5 0 1 0 0-13ZM15.3 15.3l5.2 5.2M7.5 10.5h6")] },
19
+ { name: "reset", title: "Reset", description: "A circular arrow: back to the start.", nodes: [stroked("M4.5 12A7.5 7.5 0 1 0 6.7 6.7M4 3.5v4.5h4.5")] },
20
+ {
21
+ name: "calendar",
22
+ title: "Calendar",
23
+ description: "A calendar page with one day marked.",
24
+ nodes: [stroked("M5.5 5h13a2 2 0 0 1 2 2v11.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2ZM3.5 10h17M8 3v4M16 3v4"), el("rect", { x: 7, y: 13, width: 3, height: 3, rx: 0.5, stroke: "none" })],
25
+ },
26
+ { name: "download", title: "Download", description: "An arrow down into a tray.", nodes: [stroked("M12 3.5v11M7.5 10l4.5 4.5 4.5-4.5M4.5 16.5v3h15v-3")] },
27
+ ];
28
+ export const UI_ICON_NAMES = UI_ICONS.map((icon) => icon.name);
29
+ /** One UI icon at (x, y), `size` wide (24 by default), in one token colour (`color.ink` by default)
30
+ * or `currentColor`, so an icon inline in a page follows its element's text colour. */
31
+ export const uiIcon = definePiece("uiIcon", { name: { kind: "enum", required: true, values: UI_ICON_NAMES }, x: pos(), y: pos(), size: size(), colour: colOrCurrent() }, ({ name, x, y, size: side = UI_ICON_SIZE, colour: path = "color.ink" }) => {
32
+ const icon = UI_ICONS.find((candidate) => candidate.name === name);
33
+ const paint = path === CURRENT_COLOUR ? CURRENT_COLOUR : colour(path, "colour");
34
+ return drawn([g({ transform: `translate(${r2(x)} ${r2(y)}) scale(${side / UI_ICON_SIZE})`, fill: paint, stroke: paint }, ...icon.nodes)]);
35
+ });
@@ -0,0 +1,299 @@
1
+ export declare const tokens: {
2
+ readonly banner: {
3
+ readonly height: 420;
4
+ readonly radius: 20;
5
+ readonly width: 1200;
6
+ };
7
+ readonly bodyDiagram: {
8
+ readonly layoutWidth: 560;
9
+ readonly radius: 14;
10
+ readonly ringRadius: 70;
11
+ readonly startRadius: 11;
12
+ readonly width: 800;
13
+ };
14
+ readonly brand: {
15
+ readonly dark: {
16
+ readonly accent: "#FF7A45";
17
+ readonly accentText: "#FF7A45";
18
+ readonly bg: "#121110";
19
+ readonly border: "#3B3834";
20
+ readonly borderStrong: "#ADA79D";
21
+ readonly cardBg: "#1D1C1A";
22
+ readonly failure: "#FF6696";
23
+ readonly onAccent: "#121110";
24
+ readonly stackledgerAccent: "#7D8CFF";
25
+ readonly success: "#5BBF86";
26
+ readonly text: "#F1EEE8";
27
+ readonly textMuted: "#ADA79D";
28
+ readonly trackAi: "#1B1F28";
29
+ readonly trackDelivery: "#18231D";
30
+ readonly trackIntegration: "#2A1C15";
31
+ readonly trackPersonal: "#29240F";
32
+ readonly warning: "#EBB34B";
33
+ };
34
+ readonly light: {
35
+ readonly accent: "#E04E17";
36
+ readonly accentText: "#B83A0C";
37
+ readonly bg: "#F6F3EC";
38
+ readonly border: "#D7D1C5";
39
+ readonly borderStrong: "#5C5852";
40
+ readonly cardBg: "#FFFFFF";
41
+ readonly failure: "#A1124B";
42
+ readonly onAccent: "#FFFFFF";
43
+ readonly stackledgerAccent: "#3B5BDB";
44
+ readonly success: "#2B7A4B";
45
+ readonly text: "#121212";
46
+ readonly textMuted: "#5C5852";
47
+ readonly trackAi: "#C5CDF2";
48
+ readonly trackDelivery: "#B9DEC3";
49
+ readonly trackIntegration: "#F7C6A1";
50
+ readonly trackPersonal: "#F4DD8E";
51
+ readonly warning: "#8F5F00";
52
+ };
53
+ };
54
+ readonly cast: {
55
+ readonly emotePop: {
56
+ readonly damping: 9;
57
+ readonly mass: 0.7;
58
+ readonly stiffness: 170;
59
+ };
60
+ readonly eyes: "#FFC98A";
61
+ };
62
+ readonly color: {
63
+ readonly ink: "#121212";
64
+ readonly panel: "#F6F3EC";
65
+ readonly ring: "#EDE8DE";
66
+ readonly state: {
67
+ readonly backend: "#FF6B6B";
68
+ readonly blocked: "#FF8A3D";
69
+ readonly caller: "#8FB2FF";
70
+ readonly failFast: "#E0661F";
71
+ readonly failure: "#E04848";
72
+ readonly healthy: "#3DDC84";
73
+ readonly transitional: "#FFD25A";
74
+ };
75
+ readonly white: "#FFFFFF";
76
+ };
77
+ readonly cover: {
78
+ readonly height: 420;
79
+ readonly labelSize: 19;
80
+ readonly labelWeight: 700;
81
+ readonly pillHeight: 36;
82
+ readonly ringRadius: 90;
83
+ readonly ringStep: 28;
84
+ readonly ringWidth: 2;
85
+ readonly signatureMargin: 24;
86
+ readonly width: 800;
87
+ };
88
+ readonly coverBackground: {
89
+ readonly aiLilac: {
90
+ readonly fill: "#DCC7F0";
91
+ readonly ring: "#C3A9DC";
92
+ };
93
+ readonly aiSky: {
94
+ readonly fill: "#B5D5F2";
95
+ readonly ring: "#94BBDE";
96
+ };
97
+ readonly deliveryMint: {
98
+ readonly fill: "#A9DCD6";
99
+ readonly ring: "#88C4BD";
100
+ };
101
+ readonly deliveryOlive: {
102
+ readonly fill: "#D3DFA8";
103
+ readonly ring: "#B9C78A";
104
+ };
105
+ readonly integrationClay: {
106
+ readonly fill: "#E9CDBE";
107
+ readonly ring: "#D3B3A3";
108
+ };
109
+ readonly integrationSand: {
110
+ readonly fill: "#EED7A8";
111
+ readonly ring: "#D8BF8C";
112
+ };
113
+ readonly neutral: {
114
+ readonly fill: "#F6F3EC";
115
+ readonly ring: "#D8D6D0";
116
+ };
117
+ readonly personalRose: {
118
+ readonly fill: "#F5C9DA";
119
+ readonly ring: "#E0ABC0";
120
+ };
121
+ readonly trackAi: {
122
+ readonly fill: "#C5CDF2";
123
+ readonly ring: "#A5AEDA";
124
+ };
125
+ readonly trackDelivery: {
126
+ readonly fill: "#B9DEC3";
127
+ readonly ring: "#98C6A5";
128
+ };
129
+ readonly trackIntegration: {
130
+ readonly fill: "#F7C6A1";
131
+ readonly ring: "#E3AB84";
132
+ };
133
+ readonly trackPersonal: {
134
+ readonly fill: "#F4DD8E";
135
+ readonly ring: "#DDC46C";
136
+ };
137
+ };
138
+ readonly font: {
139
+ readonly mono: "'Source Code Pro', ui-monospace, 'SF Mono', Menlo, Consolas, monospace";
140
+ readonly sans: "'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif";
141
+ readonly serif: "'Source Serif 4', Georgia, 'Times New Roman', serif";
142
+ readonly weightBold: 700;
143
+ readonly weightHeavy: 900;
144
+ };
145
+ readonly illustration: {
146
+ readonly accent: "#E04E17";
147
+ readonly codePanel: "#1D1C1A";
148
+ readonly iconLine: "#D7D1C5";
149
+ readonly road: "#5C5852";
150
+ readonly tape: "#F4E4D8";
151
+ readonly textBar: "#D7D1C5";
152
+ };
153
+ readonly map: {
154
+ readonly badgeHeight: 20;
155
+ readonly badgeTextSize: 12;
156
+ readonly bendRadius: 32;
157
+ readonly casing: 6;
158
+ readonly countHeight: 16;
159
+ readonly countTextSize: 11;
160
+ readonly edgeWidth: 2.5;
161
+ readonly haloWidth: 1.5;
162
+ readonly interchangeExtra: 2;
163
+ readonly labelSize: 13;
164
+ readonly licenceSize: 10;
165
+ readonly lineWidth: 12;
166
+ readonly nodeHeight: 46;
167
+ readonly nodeRadius: 10;
168
+ readonly outline: 3;
169
+ readonly ringWidth: 3;
170
+ readonly shadow: 0;
171
+ readonly stopRadius: 12;
172
+ readonly zonePadding: 32;
173
+ readonly zoneTitleTint: 0.6;
174
+ };
175
+ readonly motion: {
176
+ readonly dimOpacity: 0.42;
177
+ readonly drawArrow: 20;
178
+ readonly fade: 10;
179
+ readonly focus: {
180
+ readonly damping: 200;
181
+ readonly mass: 1;
182
+ readonly stiffness: 120;
183
+ };
184
+ readonly focusScale: 1.06;
185
+ readonly fps: 30;
186
+ readonly pop: {
187
+ readonly damping: 13;
188
+ readonly mass: 0.7;
189
+ readonly stiffness: 140;
190
+ };
191
+ readonly readingHold: 90;
192
+ readonly travel: 22;
193
+ };
194
+ readonly outline: {
195
+ readonly arrow: 4;
196
+ readonly block: 4;
197
+ readonly small: 3;
198
+ };
199
+ readonly radius: {
200
+ readonly block: 18;
201
+ readonly pill: 22;
202
+ readonly small: 6;
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
+ };
214
+ readonly shadow: {
215
+ readonly block: 0;
216
+ readonly pill: 0;
217
+ readonly small: 0;
218
+ };
219
+ readonly site: {
220
+ readonly dark: {
221
+ readonly body: "#121110";
222
+ readonly border: "#3B3834";
223
+ readonly dark: "#F1EEE8";
224
+ readonly light: "#1D1C1A";
225
+ readonly link: "#FF7A45";
226
+ readonly primary: "#F1EEE8";
227
+ readonly text: "#F1EEE8";
228
+ readonly textDark: "#F1EEE8";
229
+ readonly textLight: "#ADA79D";
230
+ };
231
+ readonly font: {
232
+ readonly mono: "'Source Code Pro', monospace";
233
+ readonly primary: "'Source Sans 3', sans-serif";
234
+ readonly secondary: "'Source Serif 4', serif";
235
+ };
236
+ readonly fontSize: {
237
+ readonly base: 16;
238
+ readonly baseSmall: 12.8;
239
+ };
240
+ readonly heading: {
241
+ readonly h1: 2.985984;
242
+ readonly h1Small: 2.6873856;
243
+ readonly h2: 2.48832;
244
+ readonly h2Small: 2.239488;
245
+ readonly h3: 2.0736;
246
+ readonly h3Small: 1.86624;
247
+ readonly h4: 1.728;
248
+ readonly h4Small: 1.5552;
249
+ readonly h5: 1.44;
250
+ readonly h5Small: 1.296;
251
+ readonly h6: 1.2;
252
+ readonly h6Small: 1.08;
253
+ };
254
+ readonly light: {
255
+ readonly body: "#F6F3EC";
256
+ readonly border: "#D7D1C5";
257
+ readonly dark: "#121212";
258
+ readonly light: "#FFFFFF";
259
+ readonly link: "#B83A0C";
260
+ readonly primary: "#121212";
261
+ readonly text: "#121212";
262
+ readonly textDark: "#121212";
263
+ readonly textLight: "#5C5852";
264
+ };
265
+ };
266
+ readonly surface: {
267
+ readonly dark: {
268
+ readonly backdropCredit: "#ADA79D";
269
+ readonly backdropPark: "#1A241D";
270
+ readonly backdropWater: "#1C2733";
271
+ readonly backdropWaterEdge: "#2A3846";
272
+ readonly background: "#121110";
273
+ readonly grid: "#3B3834";
274
+ readonly muted: "#ADA79D";
275
+ readonly panel: "#1D1C1A";
276
+ readonly rim: "#F1EEE8";
277
+ readonly rimWidth: 0;
278
+ readonly shadow: "#121110";
279
+ readonly text: "#F1EEE8";
280
+ readonly zoneOpacity: 0.22;
281
+ };
282
+ readonly light: {
283
+ readonly backdropCredit: "#5C5852";
284
+ readonly backdropPark: "#D6E4CF";
285
+ readonly backdropWater: "#C7DAEA";
286
+ readonly backdropWaterEdge: "#A9C4DA";
287
+ readonly background: "#F6F3EC";
288
+ readonly grid: "#EDE8DE";
289
+ readonly muted: "#5C5852";
290
+ readonly panel: "#FFFFFF";
291
+ readonly rim: "#F6F3EC";
292
+ readonly rimWidth: 0;
293
+ readonly shadow: "#121212";
294
+ readonly text: "#121212";
295
+ readonly zoneOpacity: 0.12;
296
+ };
297
+ };
298
+ };
299
+ export type Tokens = typeof tokens;