@brunosouzas/design-system 0.6.0 → 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 +71 -155
  28. package/dist/tokens/generated/tokens.js +72 -156
  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 +62 -110
  37. package/tokens/generated/tokens.json +72 -156
  38. package/tokens/generated/tokens.ts +72 -156
  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,118 +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
- readonly olive: {
167
- readonly fill: "#8A9A3B";
168
- readonly ring: "#7E8E33";
111
+ readonly neutral: {
112
+ readonly fill: "#F6F3EC";
113
+ readonly ring: "#D8D6D0";
169
114
  };
170
- readonly peach: {
171
- readonly fill: "#F4D8BC";
172
- readonly ring: "#EAC7A3";
173
- };
174
- readonly plum: {
175
- readonly fill: "#3D2B66";
176
- readonly ring: "#483577";
177
- };
178
- readonly raspberry: {
179
- readonly fill: "#C94F7C";
180
- readonly ring: "#BE4572";
181
- };
182
- readonly salmon: {
183
- readonly fill: "#FF9E7A";
184
- readonly ring: "#F48D68";
185
- };
186
- readonly sky: {
187
- readonly fill: "#BFE3F7";
188
- readonly ring: "#AAD5EC";
189
- };
190
- readonly slate: {
191
- readonly fill: "#2E3A59";
192
- readonly ring: "#38466A";
193
- };
194
- readonly teal: {
195
- readonly fill: "#1F8A8A";
196
- readonly ring: "#2A9A99";
115
+ readonly personalRose: {
116
+ readonly fill: "#F5C9DA";
117
+ readonly ring: "#E0ABC0";
197
118
  };
198
119
  readonly trackAi: {
199
- readonly fill: "#E2E4EC";
200
- readonly ring: "#C7C9D0";
120
+ readonly fill: "#C5CDF2";
121
+ readonly ring: "#A5AEDA";
201
122
  };
202
123
  readonly trackDelivery: {
203
- readonly fill: "#DFE8E1";
204
- readonly ring: "#C4CCC6";
124
+ readonly fill: "#B9DEC3";
125
+ readonly ring: "#98C6A5";
205
126
  };
206
127
  readonly trackIntegration: {
207
- readonly fill: "#F4E4D8";
208
- readonly ring: "#D7C9BE";
209
- };
210
- readonly violet: {
211
- readonly fill: "#5B3CC4";
212
- readonly ring: "#6748CF";
128
+ readonly fill: "#F7C6A1";
129
+ readonly ring: "#E3AB84";
213
130
  };
214
- readonly wine: {
215
- readonly fill: "#6B2340";
216
- readonly ring: "#7A2D4C";
131
+ readonly trackPersonal: {
132
+ readonly fill: "#F4DD8E";
133
+ readonly ring: "#DDC46C";
217
134
  };
218
135
  };
219
136
  readonly font: {
220
- readonly mono: "ui-monospace, 'SF Mono', Menlo, Consolas, monospace";
221
- 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";
222
140
  readonly weightBold: 700;
223
141
  readonly weightHeavy: 900;
224
142
  };
225
143
  readonly illustration: {
226
- readonly accent: "#1E6FEB";
227
- readonly codePanel: "#14215A";
228
- readonly healthyShade: "#2BB673";
229
- readonly iconLine: "#B9C3E0";
230
- readonly road: "#5B6478";
231
- readonly tape: "#FFE2C8";
232
- readonly textBar: "#C9D6F5";
233
- 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";
234
150
  };
235
151
  readonly map: {
236
152
  readonly badgeHeight: 20;
@@ -249,7 +165,7 @@ export declare const tokens: {
249
165
  readonly nodeRadius: 10;
250
166
  readonly outline: 3;
251
167
  readonly ringWidth: 3;
252
- readonly shadow: 3.5;
168
+ readonly shadow: 0;
253
169
  readonly stopRadius: 12;
254
170
  readonly zonePadding: 32;
255
171
  readonly zoneTitleTint: 0.6;
@@ -284,9 +200,9 @@ export declare const tokens: {
284
200
  readonly small: 6;
285
201
  };
286
202
  readonly shadow: {
287
- readonly block: 10;
288
- readonly pill: 6;
289
- readonly small: 4;
203
+ readonly block: 0;
204
+ readonly pill: 0;
205
+ readonly small: 0;
290
206
  };
291
207
  readonly site: {
292
208
  readonly dark: {
@@ -300,8 +216,8 @@ export declare const tokens: {
300
216
  readonly textLight: "#B4AFB6";
301
217
  };
302
218
  readonly font: {
303
- readonly primary: "Heebo, sans-serif";
304
- readonly secondary: "Signika, sans-serif";
219
+ readonly primary: "'Source Sans 3', sans-serif";
220
+ readonly secondary: "'Source Serif 4', serif";
305
221
  };
306
222
  readonly fontSize: {
307
223
  readonly base: 16;
@@ -338,14 +254,14 @@ export declare const tokens: {
338
254
  readonly backdropPark: "#183F52";
339
255
  readonly backdropWater: "#1E3175";
340
256
  readonly backdropWaterEdge: "#2A3F8A";
341
- readonly background: "#14215A";
342
- readonly grid: "#1C2D74";
343
- readonly muted: "#8F9BD0";
344
- readonly panel: "#1C2D74";
345
- readonly rim: "#EEF2FF";
346
- readonly rimWidth: 1;
347
- readonly shadow: "#4C5CB8";
348
- 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";
349
265
  readonly zoneOpacity: 0.22;
350
266
  };
351
267
  readonly light: {
@@ -353,14 +269,14 @@ export declare const tokens: {
353
269
  readonly backdropPark: "#D4F2DF";
354
270
  readonly backdropWater: "#C9D8FF";
355
271
  readonly backdropWaterEdge: "#B5C7F5";
356
- readonly background: "#EEF2FF";
357
- readonly grid: "#E0E7FB";
358
- readonly muted: "#5B6694";
272
+ readonly background: "#F6F3EC";
273
+ readonly grid: "#EDE8DE";
274
+ readonly muted: "#5C5852";
359
275
  readonly panel: "#FFFFFF";
360
- readonly rim: "#EEF2FF";
276
+ readonly rim: "#F6F3EC";
361
277
  readonly rimWidth: 0;
362
- readonly shadow: "#0A1033";
363
- readonly text: "#0A1033";
278
+ readonly shadow: "#121212";
279
+ readonly text: "#121212";
364
280
  readonly zoneOpacity: 0.12;
365
281
  };
366
282
  };