@brunosouzas/design-system 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/NOTICE +13 -0
  2. package/README.md +75 -40
  3. package/dist/scripts/cover.d.ts +7 -4
  4. package/dist/scripts/cover.js +25 -8
  5. package/dist/src/fonts/embed.d.ts +7 -0
  6. package/dist/src/fonts/embed.js +219 -0
  7. package/dist/src/pieces/bank-objects.d.ts +1 -1
  8. package/dist/src/pieces/bank-objects.js +26 -18
  9. package/dist/src/pieces/cover.js +2 -1
  10. package/dist/src/pieces/diagram.js +3 -3
  11. package/dist/src/pieces/eip-icons.js +27 -27
  12. package/dist/src/pieces/emote.d.ts +13 -0
  13. package/dist/src/pieces/emote.js +88 -0
  14. package/dist/src/pieces/index.d.ts +1 -1
  15. package/dist/src/pieces/index.js +1 -1
  16. package/dist/src/pieces/ink.d.ts +26 -16
  17. package/dist/src/pieces/ink.js +15 -6
  18. package/dist/src/pieces/library.d.ts +9 -15
  19. package/dist/src/pieces/library.js +52 -53
  20. package/dist/src/pieces/link-icons.d.ts +2 -1
  21. package/dist/src/pieces/link-icons.js +10 -18
  22. package/dist/src/pieces/metro.d.ts +4 -2
  23. package/dist/src/pieces/metro.js +14 -13
  24. package/dist/src/pieces/node.d.ts +5 -3
  25. package/dist/src/pieces/node.js +6 -4
  26. package/dist/src/pieces/params.js +2 -2
  27. package/dist/tokens/generated/tokens.d.ts +68 -156
  28. package/dist/tokens/generated/tokens.js +69 -157
  29. package/fonts/OFL.txt +97 -0
  30. package/fonts/SourceCodePro-Bold.ttf +0 -0
  31. package/fonts/SourceCodePro-Regular.ttf +0 -0
  32. package/fonts/SourceSans3-Black.ttf +0 -0
  33. package/fonts/SourceSans3-Bold.ttf +0 -0
  34. package/fonts/SourceSans3-Regular.ttf +0 -0
  35. package/package.json +10 -1
  36. package/tokens/generated/tokens.css +60 -110
  37. package/tokens/generated/tokens.json +69 -157
  38. package/tokens/generated/tokens.ts +69 -157
  39. package/dist/src/pieces/cast.d.ts +0 -35
  40. package/dist/src/pieces/cast.js +0 -333
@@ -17,9 +17,11 @@ export declare const el: (tag: SvgTag, attrs?: Attrs, ...children: Child[]) => S
17
17
  export declare const g: (attrs: Attrs, ...children: Child[]) => SvgNode;
18
18
  export declare const drawn: (body: readonly SvgNode[], text?: readonly SvgNode[]) => Drawn;
19
19
  /**
20
- * Hard offset shadow (STY-1): an ink copy of the shape translated by `offset`,
21
- * then the shape. Inside the outlined group the copy keeps the outline too, as
22
- * the motion components' shadow does.
20
+ * Hard offset shadow: the pieces draw none since 0.7.0 (ADR 0009, `shadow.block`
21
+ * is 0), so with offset 0 this returns the shape alone and the output carries no
22
+ * hidden node. With an offset above 0, for a caller that still wants one: an ink
23
+ * copy of the shape translated by `offset`, then the shape. Inside the outlined
24
+ * group the copy keeps the outline too.
23
25
  */
24
26
  export declare const shadowed: (shape: SvgNode, offset?: number) => SvgNode[];
25
27
  /** Rounds to two decimals so computed geometry stays short and stable in the output. */
@@ -34,11 +34,13 @@ export const el = (tag, attrs = {}, ...children) => ({
34
34
  export const g = (attrs, ...children) => el("g", attrs, ...children);
35
35
  export const drawn = (body, text = []) => ({ body, text });
36
36
  /**
37
- * Hard offset shadow (STY-1): an ink copy of the shape translated by `offset`,
38
- * then the shape. Inside the outlined group the copy keeps the outline too, as
39
- * the motion components' shadow does.
37
+ * Hard offset shadow: the pieces draw none since 0.7.0 (ADR 0009, `shadow.block`
38
+ * is 0), so with offset 0 this returns the shape alone and the output carries no
39
+ * hidden node. With an offset above 0, for a caller that still wants one: an ink
40
+ * copy of the shape translated by `offset`, then the shape. Inside the outlined
41
+ * group the copy keeps the outline too.
40
42
  */
41
- export const shadowed = (shape, offset = tokens.shadow.block) => [
43
+ export const shadowed = (shape, offset = tokens.shadow.block) => offset === 0 ? [shape] : [
42
44
  {
43
45
  ...shape,
44
46
  attrs: {
@@ -32,7 +32,7 @@ export const isColourLiteral = (value) => COLOUR_LITERAL.test(value);
32
32
  export const colour = (path, name = "colour") => {
33
33
  const value = COLOUR_TOKENS.get(path);
34
34
  if (value === undefined)
35
- throw new RangeError(`${name}: expected a colour token path such as color.healthy, found ${JSON.stringify(path)}`);
35
+ throw new RangeError(`${name}: expected a colour token path such as color.state.healthy, found ${JSON.stringify(path)}`);
36
36
  return value;
37
37
  };
38
38
  const describe = (value) => (value === undefined ? "nothing" : JSON.stringify(value));
@@ -62,7 +62,7 @@ const checkValue = (spec, value, path, out) => {
62
62
  if (isColourLiteral(value))
63
63
  return report("colour literals are not allowed; use a token path");
64
64
  if (!COLOUR_TOKENS.has(value))
65
- return report(`expected a colour token path such as color.healthy, found ${describe(value)}`);
65
+ return report(`expected a colour token path such as color.state.healthy, found ${describe(value)}`);
66
66
  return;
67
67
  case "dataColor":
68
68
  if (typeof value !== "string")
@@ -27,6 +27,7 @@ export declare const tokens: {
27
27
  readonly trackAi: "#1B1F28";
28
28
  readonly trackDelivery: "#18231D";
29
29
  readonly trackIntegration: "#2A1C15";
30
+ readonly trackPersonal: "#29240F";
30
31
  readonly warning: "#EBB34B";
31
32
  };
32
33
  readonly light: {
@@ -41,60 +42,25 @@ export declare const tokens: {
41
42
  readonly success: "#2B7A4B";
42
43
  readonly text: "#121212";
43
44
  readonly textMuted: "#5C5852";
44
- readonly trackAi: "#E2E4EC";
45
- readonly trackDelivery: "#DFE8E1";
46
- readonly trackIntegration: "#F4E4D8";
45
+ readonly trackAi: "#C5CDF2";
46
+ readonly trackDelivery: "#B9DEC3";
47
+ readonly trackIntegration: "#F7C6A1";
48
+ readonly trackPersonal: "#F4DD8E";
47
49
  readonly warning: "#8F5F00";
48
50
  };
49
51
  };
50
52
  readonly cast: {
51
- readonly agent: {
52
- readonly neck: "#E3E8F5";
53
- readonly shine: "#E6ECFF";
54
- };
55
- readonly architect: {
56
- readonly fill: "#22B5A4";
57
- readonly shine: "#9CF0E4";
58
- };
59
- readonly data: {
60
- readonly fill: "#8C6CF0";
61
- readonly lens: "#EAF1FF";
62
- readonly lid: "#C2B1FF";
63
- readonly shine: "#B39CFF";
64
- };
65
- readonly dev: {
66
- readonly chin: "#8FA6FF";
67
- readonly fill: "#5B7CFA";
68
- readonly screen: "#DCE6FF";
69
- };
70
- readonly devops: {
71
- readonly fill: "#D76AA5";
72
- readonly shine: "#F3B8D6";
73
- };
74
53
  readonly emotePop: {
75
54
  readonly damping: 9;
76
55
  readonly mass: 0.7;
77
56
  readonly stiffness: 170;
78
57
  };
79
58
  readonly eyes: "#FFC98A";
80
- readonly glow: "#7FD1FF";
81
- readonly ground: "#D3DBF5";
82
- readonly metal: "#C9D2E8";
83
- readonly mouth: "#B94A3E";
84
- readonly request: {
85
- readonly shine: "#D6E2FF";
86
- };
87
59
  };
88
60
  readonly color: {
89
- readonly backend: "#FF6B6B";
90
- readonly blocked: "#FF8A3D";
91
- readonly caller: "#8FB2FF";
92
- readonly failFast: "#E0661F";
93
- readonly failure: "#E04848";
94
- readonly healthy: "#3DDC84";
95
- readonly ink: "#0A1033";
96
- readonly panel: "#EEF2FF";
97
- readonly ring: "#E0E7FB";
61
+ readonly ink: "#121212";
62
+ readonly panel: "#F6F3EC";
63
+ readonly ring: "#EDE8DE";
98
64
  readonly state: {
99
65
  readonly backend: "#FF6B6B";
100
66
  readonly blocked: "#FF8A3D";
@@ -104,13 +70,12 @@ export declare const tokens: {
104
70
  readonly healthy: "#3DDC84";
105
71
  readonly transitional: "#FFD25A";
106
72
  };
107
- readonly transitional: "#FFD25A";
108
73
  readonly white: "#FFFFFF";
109
74
  };
110
75
  readonly cover: {
111
76
  readonly height: 420;
112
77
  readonly labelSize: 19;
113
- readonly labelWeight: 800;
78
+ readonly labelWeight: 700;
114
79
  readonly pillHeight: 36;
115
80
  readonly ringRadius: 90;
116
81
  readonly ringStep: 28;
@@ -119,122 +84,69 @@ export declare const tokens: {
119
84
  readonly width: 800;
120
85
  };
121
86
  readonly coverBackground: {
122
- readonly blush: {
123
- readonly fill: "#F6CFE0";
124
- readonly ring: "#ECBAD0";
125
- };
126
- readonly cobalt: {
127
- readonly fill: "#1E4FA0";
128
- readonly ring: "#2758AE";
129
- };
130
- readonly cream: {
131
- readonly fill: "#FFF1C9";
132
- readonly ring: "#F4E2AE";
133
- };
134
- readonly deepTeal: {
135
- readonly fill: "#0F6E6E";
136
- readonly ring: "#167A79";
137
- };
138
- readonly emerald: {
139
- readonly fill: "#2F9E6E";
140
- readonly ring: "#38AB79";
141
- };
142
- readonly forest: {
143
- readonly fill: "#24604F";
144
- readonly ring: "#2B6E5B";
87
+ readonly aiLilac: {
88
+ readonly fill: "#DCC7F0";
89
+ readonly ring: "#C3A9DC";
145
90
  };
146
- readonly lavender: {
147
- readonly fill: "#B8A6F0";
148
- readonly ring: "#AC98EA";
91
+ readonly aiSky: {
92
+ readonly fill: "#B5D5F2";
93
+ readonly ring: "#94BBDE";
149
94
  };
150
- readonly lime: {
151
- readonly fill: "#D4EC9C";
152
- readonly ring: "#C4E086";
95
+ readonly deliveryMint: {
96
+ readonly fill: "#A9DCD6";
97
+ readonly ring: "#88C4BD";
153
98
  };
154
- readonly mint: {
155
- readonly fill: "#CDE5D3";
156
- readonly ring: "#BCDAC4";
99
+ readonly deliveryOlive: {
100
+ readonly fill: "#D3DFA8";
101
+ readonly ring: "#B9C78A";
157
102
  };
158
- readonly mustard: {
159
- readonly fill: "#F2C14E";
160
- readonly ring: "#E6B33E";
103
+ readonly integrationClay: {
104
+ readonly fill: "#E9CDBE";
105
+ readonly ring: "#D3B3A3";
161
106
  };
162
- readonly navy: {
163
- readonly fill: "#14215A";
164
- readonly ring: "#1C2D74";
107
+ readonly integrationSand: {
108
+ readonly fill: "#EED7A8";
109
+ readonly ring: "#D8BF8C";
165
110
  };
166
111
  readonly neutral: {
167
112
  readonly fill: "#F6F3EC";
168
113
  readonly ring: "#D8D6D0";
169
114
  };
170
- readonly olive: {
171
- readonly fill: "#8A9A3B";
172
- readonly ring: "#7E8E33";
173
- };
174
- readonly peach: {
175
- readonly fill: "#F4D8BC";
176
- readonly ring: "#EAC7A3";
177
- };
178
- readonly plum: {
179
- readonly fill: "#3D2B66";
180
- readonly ring: "#483577";
181
- };
182
- readonly raspberry: {
183
- readonly fill: "#C94F7C";
184
- readonly ring: "#BE4572";
185
- };
186
- readonly salmon: {
187
- readonly fill: "#FF9E7A";
188
- readonly ring: "#F48D68";
189
- };
190
- readonly sky: {
191
- readonly fill: "#BFE3F7";
192
- readonly ring: "#AAD5EC";
193
- };
194
- readonly slate: {
195
- readonly fill: "#2E3A59";
196
- readonly ring: "#38466A";
197
- };
198
- readonly teal: {
199
- readonly fill: "#1F8A8A";
200
- readonly ring: "#2A9A99";
115
+ readonly personalRose: {
116
+ readonly fill: "#F5C9DA";
117
+ readonly ring: "#E0ABC0";
201
118
  };
202
119
  readonly trackAi: {
203
- readonly fill: "#E2E4EC";
204
- readonly ring: "#C7C9D0";
120
+ readonly fill: "#C5CDF2";
121
+ readonly ring: "#A5AEDA";
205
122
  };
206
123
  readonly trackDelivery: {
207
- readonly fill: "#DFE8E1";
208
- readonly ring: "#C4CCC6";
124
+ readonly fill: "#B9DEC3";
125
+ readonly ring: "#98C6A5";
209
126
  };
210
127
  readonly trackIntegration: {
211
- readonly fill: "#F4E4D8";
212
- readonly ring: "#D7C9BE";
213
- };
214
- readonly violet: {
215
- readonly fill: "#5B3CC4";
216
- readonly ring: "#6748CF";
128
+ readonly fill: "#F7C6A1";
129
+ readonly ring: "#E3AB84";
217
130
  };
218
- readonly wine: {
219
- readonly fill: "#6B2340";
220
- readonly ring: "#7A2D4C";
131
+ readonly trackPersonal: {
132
+ readonly fill: "#F4DD8E";
133
+ readonly ring: "#DDC46C";
221
134
  };
222
135
  };
223
136
  readonly font: {
224
- readonly mono: "ui-monospace, 'SF Mono', Menlo, Consolas, monospace";
225
- readonly sans: "Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif";
137
+ readonly mono: "'Source Code Pro', ui-monospace, 'SF Mono', Menlo, Consolas, monospace";
138
+ readonly sans: "'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif";
139
+ readonly serif: "'Source Serif 4', Georgia, 'Times New Roman', serif";
226
140
  readonly weightBold: 700;
227
141
  readonly weightHeavy: 900;
228
142
  };
229
143
  readonly illustration: {
230
- readonly accent: "#1E6FEB";
231
- readonly codePanel: "#14215A";
232
- readonly healthyShade: "#2BB673";
233
- readonly iconLine: "#B9C3E0";
234
- readonly road: "#5B6478";
235
- readonly tape: "#FFE2C8";
236
- readonly textBar: "#C9D6F5";
237
- readonly transitionalShade: "#E8B830";
144
+ readonly accent: "#E04E17";
145
+ readonly codePanel: "#1D1C1A";
146
+ readonly iconLine: "#D7D1C5";
147
+ readonly road: "#5C5852";
148
+ readonly tape: "#F4E4D8";
149
+ readonly textBar: "#D7D1C5";
238
150
  };
239
151
  readonly map: {
240
152
  readonly badgeHeight: 20;
@@ -253,7 +165,7 @@ export declare const tokens: {
253
165
  readonly nodeRadius: 10;
254
166
  readonly outline: 3;
255
167
  readonly ringWidth: 3;
256
- readonly shadow: 3.5;
168
+ readonly shadow: 0;
257
169
  readonly stopRadius: 12;
258
170
  readonly zonePadding: 32;
259
171
  readonly zoneTitleTint: 0.6;
@@ -288,9 +200,9 @@ export declare const tokens: {
288
200
  readonly small: 6;
289
201
  };
290
202
  readonly shadow: {
291
- readonly block: 10;
292
- readonly pill: 6;
293
- readonly small: 4;
203
+ readonly block: 0;
204
+ readonly pill: 0;
205
+ readonly small: 0;
294
206
  };
295
207
  readonly site: {
296
208
  readonly dark: {
@@ -304,8 +216,8 @@ export declare const tokens: {
304
216
  readonly textLight: "#B4AFB6";
305
217
  };
306
218
  readonly font: {
307
- readonly primary: "Heebo, sans-serif";
308
- readonly secondary: "Signika, sans-serif";
219
+ readonly primary: "'Source Sans 3', sans-serif";
220
+ readonly secondary: "'Source Serif 4', serif";
309
221
  };
310
222
  readonly fontSize: {
311
223
  readonly base: 16;
@@ -342,14 +254,14 @@ export declare const tokens: {
342
254
  readonly backdropPark: "#183F52";
343
255
  readonly backdropWater: "#1E3175";
344
256
  readonly backdropWaterEdge: "#2A3F8A";
345
- readonly background: "#14215A";
346
- readonly grid: "#1C2D74";
347
- readonly muted: "#8F9BD0";
348
- readonly panel: "#1C2D74";
349
- readonly rim: "#EEF2FF";
350
- readonly rimWidth: 1;
351
- readonly shadow: "#4C5CB8";
352
- readonly text: "#EEF2FF";
257
+ readonly background: "#121110";
258
+ readonly grid: "#3B3834";
259
+ readonly muted: "#ADA79D";
260
+ readonly panel: "#1D1C1A";
261
+ readonly rim: "#F1EEE8";
262
+ readonly rimWidth: 0;
263
+ readonly shadow: "#121110";
264
+ readonly text: "#F1EEE8";
353
265
  readonly zoneOpacity: 0.22;
354
266
  };
355
267
  readonly light: {
@@ -357,14 +269,14 @@ export declare const tokens: {
357
269
  readonly backdropPark: "#D4F2DF";
358
270
  readonly backdropWater: "#C9D8FF";
359
271
  readonly backdropWaterEdge: "#B5C7F5";
360
- readonly background: "#EEF2FF";
361
- readonly grid: "#E0E7FB";
362
- readonly muted: "#5B6694";
272
+ readonly background: "#F6F3EC";
273
+ readonly grid: "#EDE8DE";
274
+ readonly muted: "#5C5852";
363
275
  readonly panel: "#FFFFFF";
364
- readonly rim: "#EEF2FF";
276
+ readonly rim: "#F6F3EC";
365
277
  readonly rimWidth: 0;
366
- readonly shadow: "#0A1033";
367
- readonly text: "#0A1033";
278
+ readonly shadow: "#121212";
279
+ readonly text: "#121212";
368
280
  readonly zoneOpacity: 0.12;
369
281
  };
370
282
  };