@brunosouzas/design-system 0.0.0-stage → 0.1.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/LICENSE +202 -0
- package/README.md +210 -2
- package/dist/scripts/cover.d.ts +25 -0
- package/dist/scripts/cover.js +157 -0
- package/dist/src/pieces/cover.d.ts +32 -0
- package/dist/src/pieces/cover.js +250 -0
- package/dist/src/pieces/eip-icons.d.ts +12 -0
- package/dist/src/pieces/eip-icons.js +525 -0
- package/dist/src/pieces/index.d.ts +9 -0
- package/dist/src/pieces/index.js +14 -0
- package/dist/src/pieces/library.d.ts +297 -0
- package/dist/src/pieces/library.js +377 -0
- package/dist/src/pieces/metro.d.ts +93 -0
- package/dist/src/pieces/metro.js +205 -0
- package/dist/src/pieces/node.d.ts +27 -0
- package/dist/src/pieces/node.js +52 -0
- package/dist/src/pieces/params.d.ts +76 -0
- package/dist/src/pieces/params.js +147 -0
- package/dist/src/pieces/piece.d.ts +9 -0
- package/dist/src/pieces/piece.js +11 -0
- package/dist/src/pieces/pose.d.ts +16 -0
- package/dist/src/pieces/pose.js +30 -0
- package/dist/src/pieces/react.d.ts +4 -0
- package/dist/src/pieces/react.js +13 -0
- package/dist/src/pieces/render.d.ts +2 -0
- package/dist/src/pieces/render.js +21 -0
- package/dist/tokens/generated/tokens.d.ts +244 -0
- package/dist/tokens/generated/tokens.js +244 -0
- package/package.json +78 -4
- package/tokens/generated/tokens.css +160 -0
- package/tokens/generated/tokens.json +243 -0
- package/tokens/generated/tokens.ts +247 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
export * from "./metro.ts";
|
|
2
|
+
type Point = [number, number];
|
|
3
|
+
export type PillParams = {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
text: string;
|
|
7
|
+
fill?: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
};
|
|
10
|
+
/** Pill label centred on (x, y), usually overlapping the top edge of what it names. */
|
|
11
|
+
export declare const pill: import("./piece.ts").Piece<PillParams>;
|
|
12
|
+
export declare const RING_COUNT = 14;
|
|
13
|
+
export type RingsParams = {
|
|
14
|
+
cx: number;
|
|
15
|
+
cy: number;
|
|
16
|
+
radius?: number;
|
|
17
|
+
color?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Concentric rings around (cx, cy): 14 rings, step and width from the cover tokens. */
|
|
20
|
+
export declare const rings: import("./piece.ts").Piece<RingsParams>;
|
|
21
|
+
export type SheetRow = {
|
|
22
|
+
lead?: "none" | "checkbox" | "checked" | "question";
|
|
23
|
+
bar: number;
|
|
24
|
+
tail?: "none" | "check";
|
|
25
|
+
};
|
|
26
|
+
export type SheetParams = {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
rows: SheetRow[];
|
|
32
|
+
top?: number;
|
|
33
|
+
step?: number;
|
|
34
|
+
fill?: string;
|
|
35
|
+
leadFill?: string;
|
|
36
|
+
tick?: string;
|
|
37
|
+
};
|
|
38
|
+
/** A sheet of paper with rows of text bars, an optional lead mark and an optional tick at the end. */
|
|
39
|
+
export declare const sheet: import("./piece.ts").Piece<SheetParams>;
|
|
40
|
+
declare const CODE_COLOURS: {
|
|
41
|
+
readonly healthy: "#3DDC84";
|
|
42
|
+
readonly caller: "#8FB2FF";
|
|
43
|
+
readonly white: "#FFFFFF";
|
|
44
|
+
readonly backend: "#FF6B6B";
|
|
45
|
+
};
|
|
46
|
+
export type CodeLine = {
|
|
47
|
+
indent: number;
|
|
48
|
+
w: number;
|
|
49
|
+
color: keyof typeof CODE_COLOURS;
|
|
50
|
+
tall?: boolean;
|
|
51
|
+
};
|
|
52
|
+
export type CodePanelParams = {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
lines: CodeLine[];
|
|
58
|
+
top?: number;
|
|
59
|
+
step?: number;
|
|
60
|
+
};
|
|
61
|
+
/** Dark code panel with coloured lines; a tall line marks the one under review. */
|
|
62
|
+
export declare const codePanel: import("./piece.ts").Piece<CodePanelParams>;
|
|
63
|
+
export type SpeechBubbleParams = {
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
width: number;
|
|
67
|
+
height: number;
|
|
68
|
+
fill?: string;
|
|
69
|
+
};
|
|
70
|
+
/** Chat slip with a tail at the bottom left and one white text line. */
|
|
71
|
+
export declare const speechBubble: import("./piece.ts").Piece<SpeechBubbleParams>;
|
|
72
|
+
export type BrowserWindowParams = {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
width?: number;
|
|
76
|
+
height?: number;
|
|
77
|
+
};
|
|
78
|
+
/** Browser window: title bar with three dots, a hero block and two text lines. */
|
|
79
|
+
export declare const browserWindow: import("./piece.ts").Piece<BrowserWindowParams>;
|
|
80
|
+
export type FolderParams = {
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
scale?: number;
|
|
84
|
+
};
|
|
85
|
+
/** Open folder with two sheets peeking out, measured from the write-in-obsidian cover (190x198 at scale 1). */
|
|
86
|
+
export declare const folder: import("./piece.ts").Piece<FolderParams>;
|
|
87
|
+
export type BookParams = {
|
|
88
|
+
x: number;
|
|
89
|
+
y: number;
|
|
90
|
+
width?: number;
|
|
91
|
+
height?: number;
|
|
92
|
+
};
|
|
93
|
+
/** A closed book seen from the front: back page, front cover, spine and page edges. */
|
|
94
|
+
export declare const book: import("./piece.ts").Piece<BookParams>;
|
|
95
|
+
export type BlockArrowParams = {
|
|
96
|
+
x: number;
|
|
97
|
+
y: number;
|
|
98
|
+
length?: number;
|
|
99
|
+
fill?: string;
|
|
100
|
+
};
|
|
101
|
+
/** Chunky arrow pointing right, centred vertically on y. */
|
|
102
|
+
export declare const blockArrow: import("./piece.ts").Piece<BlockArrowParams>;
|
|
103
|
+
export type ArcArrowParams = {
|
|
104
|
+
from: Point;
|
|
105
|
+
c1: Point;
|
|
106
|
+
c2: Point;
|
|
107
|
+
to: Point;
|
|
108
|
+
color?: string;
|
|
109
|
+
dashed?: boolean;
|
|
110
|
+
width?: number;
|
|
111
|
+
};
|
|
112
|
+
/** Curved arrow (cubic Bézier) with a chevron head at `to`; solid or dashed. */
|
|
113
|
+
export declare const arcArrow: import("./piece.ts").Piece<ArcArrowParams>;
|
|
114
|
+
export type RailParams = {
|
|
115
|
+
x: number;
|
|
116
|
+
y: number;
|
|
117
|
+
width: number;
|
|
118
|
+
nodes: string[];
|
|
119
|
+
fill?: string;
|
|
120
|
+
thickness?: number;
|
|
121
|
+
};
|
|
122
|
+
/** A rail (track) with square nodes spread along it. */
|
|
123
|
+
export declare const rail: import("./piece.ts").Piece<RailParams>;
|
|
124
|
+
export type RoadParams = {
|
|
125
|
+
d: string;
|
|
126
|
+
};
|
|
127
|
+
/** A road: a wide grey band along a path with white dashes in the middle. */
|
|
128
|
+
export declare const road: import("./piece.ts").Piece<RoadParams>;
|
|
129
|
+
export type MilestonePinParams = {
|
|
130
|
+
x: number;
|
|
131
|
+
y: number;
|
|
132
|
+
text: string;
|
|
133
|
+
fill?: string;
|
|
134
|
+
stem?: number;
|
|
135
|
+
};
|
|
136
|
+
/** A pin standing on (x, y): a stem and a round head with a short label. */
|
|
137
|
+
export declare const milestonePin: import("./piece.ts").Piece<MilestonePinParams>;
|
|
138
|
+
export type PriceTagParams = {
|
|
139
|
+
x: number;
|
|
140
|
+
y: number;
|
|
141
|
+
text: string;
|
|
142
|
+
width?: number;
|
|
143
|
+
fill?: string;
|
|
144
|
+
stringFrom?: Point;
|
|
145
|
+
};
|
|
146
|
+
/** Price or version tag pointing left from its tip (x, y), with a hole and an optional string. */
|
|
147
|
+
export declare const priceTag: import("./piece.ts").Piece<PriceTagParams>;
|
|
148
|
+
export type NameTagParams = {
|
|
149
|
+
hangX: number;
|
|
150
|
+
hangY: number;
|
|
151
|
+
cx: number;
|
|
152
|
+
top: number;
|
|
153
|
+
rotate?: number;
|
|
154
|
+
icon: string;
|
|
155
|
+
fill?: string;
|
|
156
|
+
};
|
|
157
|
+
/** A name tag hanging on a string from (hangX, hangY), showing one EIP icon. */
|
|
158
|
+
export declare const nameTag: import("./piece.ts").Piece<NameTagParams>;
|
|
159
|
+
export type CheckBadgeParams = {
|
|
160
|
+
cx: number;
|
|
161
|
+
cy: number;
|
|
162
|
+
r?: number;
|
|
163
|
+
};
|
|
164
|
+
/** Green round badge with a tick. */
|
|
165
|
+
export declare const checkBadge: import("./piece.ts").Piece<CheckBadgeParams>;
|
|
166
|
+
export type StampParams = {
|
|
167
|
+
cx: number;
|
|
168
|
+
cy: number;
|
|
169
|
+
word: string;
|
|
170
|
+
fill?: string;
|
|
171
|
+
r?: number;
|
|
172
|
+
rotate?: number;
|
|
173
|
+
shape?: "round" | "rect";
|
|
174
|
+
};
|
|
175
|
+
/** Rubber stamp, round (dashed inner ring) or rectangular, tilted, with one word. */
|
|
176
|
+
export declare const stamp: import("./piece.ts").Piece<StampParams>;
|
|
177
|
+
export type RobotParams = {
|
|
178
|
+
cx: number;
|
|
179
|
+
top: number;
|
|
180
|
+
};
|
|
181
|
+
/** Robot: antenna, ears, green body with a visor and two eyes, mouth bars. Scale it with pose. */
|
|
182
|
+
export declare const robot: import("./piece.ts").Piece<RobotParams>;
|
|
183
|
+
export type MagnifierParams = {
|
|
184
|
+
cx: number;
|
|
185
|
+
cy: number;
|
|
186
|
+
r?: number;
|
|
187
|
+
color?: string;
|
|
188
|
+
};
|
|
189
|
+
/** Magnifier: lens centred on (cx, cy), handle to the bottom right. */
|
|
190
|
+
export declare const magnifier: import("./piece.ts").Piece<MagnifierParams>;
|
|
191
|
+
export type ServerStackParams = {
|
|
192
|
+
x: number;
|
|
193
|
+
y: number;
|
|
194
|
+
width?: number;
|
|
195
|
+
units?: number;
|
|
196
|
+
fill?: string;
|
|
197
|
+
failing?: number;
|
|
198
|
+
};
|
|
199
|
+
/** Stack of server units; the `failing` unit (0-based) shows a red light. */
|
|
200
|
+
export declare const serverStack: import("./piece.ts").Piece<ServerStackParams>;
|
|
201
|
+
export type CloudParams = {
|
|
202
|
+
cx: number;
|
|
203
|
+
cy: number;
|
|
204
|
+
scale?: number;
|
|
205
|
+
fill?: string;
|
|
206
|
+
};
|
|
207
|
+
export declare const cloud: import("./piece.ts").Piece<CloudParams>;
|
|
208
|
+
export type GearParams = {
|
|
209
|
+
cx: number;
|
|
210
|
+
cy: number;
|
|
211
|
+
r?: number;
|
|
212
|
+
teeth?: number;
|
|
213
|
+
fill?: string;
|
|
214
|
+
};
|
|
215
|
+
/** Gear with square teeth and a white hub, as on the maven-release cover. */
|
|
216
|
+
export declare const gear: import("./piece.ts").Piece<GearParams>;
|
|
217
|
+
export type ParcelParams = {
|
|
218
|
+
x: number;
|
|
219
|
+
y: number;
|
|
220
|
+
size?: number;
|
|
221
|
+
fill?: string;
|
|
222
|
+
};
|
|
223
|
+
/** Parcel (box) with a lid line and a tape strip. */
|
|
224
|
+
export declare const parcel: import("./piece.ts").Piece<ParcelParams>;
|
|
225
|
+
export type StepsParams = {
|
|
226
|
+
x: number;
|
|
227
|
+
y: number;
|
|
228
|
+
count?: number;
|
|
229
|
+
width?: number;
|
|
230
|
+
rise?: number;
|
|
231
|
+
fill?: string;
|
|
232
|
+
};
|
|
233
|
+
/** Steps climbing to the right from the bottom-left corner (x, y), as on the obsidian-to-site guide cover. */
|
|
234
|
+
export declare const steps: import("./piece.ts").Piece<StepsParams>;
|
|
235
|
+
export type MuleTile = {
|
|
236
|
+
x: number;
|
|
237
|
+
kind: "scatter-gather" | "choice" | "for-each";
|
|
238
|
+
};
|
|
239
|
+
export type MuleFlowParams = {
|
|
240
|
+
x: number;
|
|
241
|
+
y: number;
|
|
242
|
+
width: number;
|
|
243
|
+
height?: number;
|
|
244
|
+
tiles: MuleTile[];
|
|
245
|
+
tileWidth?: number;
|
|
246
|
+
fill?: string;
|
|
247
|
+
};
|
|
248
|
+
/** A Mule flow: a bar with processor tiles linked left to right, each with its glyph. */
|
|
249
|
+
export declare const muleFlow: import("./piece.ts").Piece<MuleFlowParams>;
|
|
250
|
+
export type EipIconParams = {
|
|
251
|
+
name: string;
|
|
252
|
+
x: number;
|
|
253
|
+
y: number;
|
|
254
|
+
scale?: number;
|
|
255
|
+
};
|
|
256
|
+
/** One of the 26 EIP icons (64x40), placed at (x, y) and scaled; the cover's outline does not leak in. */
|
|
257
|
+
export declare const eipIcon: import("./piece.ts").Piece<EipIconParams>;
|
|
258
|
+
/** Every piece, by name, in catalogue order (spec illustration-pieces, "Piece catalogue"). */
|
|
259
|
+
export declare const PIECES: {
|
|
260
|
+
readonly lineBadge: import("./piece.ts").Piece<import("./metro.ts").LineBadgeParams>;
|
|
261
|
+
readonly stationMarker: import("./piece.ts").Piece<import("./metro.ts").StationMarkerParams>;
|
|
262
|
+
readonly pipe: import("./piece.ts").Piece<import("./metro.ts").PipeParams>;
|
|
263
|
+
readonly countBadge: import("./piece.ts").Piece<import("./metro.ts").CountBadgeParams>;
|
|
264
|
+
readonly nodeBlock: import("./piece.ts").Piece<import("./metro.ts").NodeBlockParams>;
|
|
265
|
+
readonly pillNode: import("./piece.ts").Piece<import("./metro.ts").NodeParams>;
|
|
266
|
+
readonly hexNode: import("./piece.ts").Piece<import("./metro.ts").NodeParams>;
|
|
267
|
+
readonly messageArrow: import("./piece.ts").Piece<import("./metro.ts").MessageArrowParams>;
|
|
268
|
+
readonly ledgerMark: import("./piece.ts").Piece<import("./metro.ts").LedgerMarkParams>;
|
|
269
|
+
readonly pill: import("./piece.ts").Piece<PillParams>;
|
|
270
|
+
readonly rings: import("./piece.ts").Piece<RingsParams>;
|
|
271
|
+
readonly sheet: import("./piece.ts").Piece<SheetParams>;
|
|
272
|
+
readonly blockArrow: import("./piece.ts").Piece<BlockArrowParams>;
|
|
273
|
+
readonly arcArrow: import("./piece.ts").Piece<ArcArrowParams>;
|
|
274
|
+
readonly rail: import("./piece.ts").Piece<RailParams>;
|
|
275
|
+
readonly checkBadge: import("./piece.ts").Piece<CheckBadgeParams>;
|
|
276
|
+
readonly priceTag: import("./piece.ts").Piece<PriceTagParams>;
|
|
277
|
+
readonly nameTag: import("./piece.ts").Piece<NameTagParams>;
|
|
278
|
+
readonly codePanel: import("./piece.ts").Piece<CodePanelParams>;
|
|
279
|
+
readonly serverStack: import("./piece.ts").Piece<ServerStackParams>;
|
|
280
|
+
readonly cloud: import("./piece.ts").Piece<CloudParams>;
|
|
281
|
+
readonly stamp: import("./piece.ts").Piece<StampParams>;
|
|
282
|
+
readonly robot: import("./piece.ts").Piece<RobotParams>;
|
|
283
|
+
readonly magnifier: import("./piece.ts").Piece<MagnifierParams>;
|
|
284
|
+
readonly gear: import("./piece.ts").Piece<GearParams>;
|
|
285
|
+
readonly parcel: import("./piece.ts").Piece<ParcelParams>;
|
|
286
|
+
readonly road: import("./piece.ts").Piece<RoadParams>;
|
|
287
|
+
readonly milestonePin: import("./piece.ts").Piece<MilestonePinParams>;
|
|
288
|
+
readonly browserWindow: import("./piece.ts").Piece<BrowserWindowParams>;
|
|
289
|
+
readonly speechBubble: import("./piece.ts").Piece<SpeechBubbleParams>;
|
|
290
|
+
readonly steps: import("./piece.ts").Piece<StepsParams>;
|
|
291
|
+
readonly folder: import("./piece.ts").Piece<FolderParams>;
|
|
292
|
+
readonly book: import("./piece.ts").Piece<BookParams>;
|
|
293
|
+
readonly muleFlow: import("./piece.ts").Piece<MuleFlowParams>;
|
|
294
|
+
readonly eipIcon: import("./piece.ts").Piece<EipIconParams>;
|
|
295
|
+
};
|
|
296
|
+
export type PieceName = keyof typeof PIECES;
|
|
297
|
+
export declare const PIECE_NAMES: PieceName[];
|