@alea-design/tokens 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/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "@alea-design/tokens",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Alea design tokens: CSS variables (dark and light), JSON, JS and Figma variables from one W3C source.",
5
+ "keywords": [
6
+ "design tokens",
7
+ "css variables",
8
+ "figma variables",
9
+ "dark mode",
10
+ "design system"
11
+ ],
12
+ "homepage": "https://alea.alevasquez.dev",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/alevascha/alea-design.git",
16
+ "directory": "packages/tokens"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/alevascha/alea-design/issues"
20
+ },
21
+ "author": "Alejandro Vasquez (https://alevasquez.dev)",
22
+ "license": "MIT",
23
+ "type": "module",
24
+ "main": "dist/index.js",
25
+ "types": "dist/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "default": "./dist/index.js"
30
+ },
31
+ "./tokens.css": "./dist/tokens.css",
32
+ "./tokens.json": "./dist/tokens.json",
33
+ "./figma.json": "./dist/figma.json",
34
+ "./css-data.json": "./dist/alea.css-data.json"
35
+ },
36
+ "files": [
37
+ "dist",
38
+ "src",
39
+ "LICENSE",
40
+ "README.md"
41
+ ],
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "scripts": {
46
+ "primitives": "node scripts/generate-primitives.mjs",
47
+ "build": "node scripts/build.mjs",
48
+ "test": "node scripts/build.mjs && node --test test/*.test.mjs"
49
+ }
50
+ }
package/src/base.json ADDED
@@ -0,0 +1,449 @@
1
+ {
2
+ "spacing": {
3
+ "$type": "dimension",
4
+ "base": {
5
+ "$value": "0.25rem",
6
+ "$description": "The base of the space scale, in rem (1rem = 16px): 0.25rem (4px) in Comfy, 0.125rem (2px) in Compact (set data-density=\"compact\"). space-<N> is N x this; in Compact an odd pixel result is rounded up to the next even number of pixels.",
7
+ "$extensions": { "fun.lab": { "compact": "0.125rem" } }
8
+ }
9
+ },
10
+ "space": {
11
+ "$type": "dimension",
12
+ "$description": "The space scale, in rem (1rem = 16px). Comfy: step N is N x 0.25rem (4px; space-4 = 1rem = 16px). Compact (data-density=\"compact\"): N x 0.125rem (2px), an odd pixel result of a whole step rounded up to the next even number of pixels; the half steps (0-5, 1-5, 2-5, 3-5) are literal, base x N: 1, 3, 5 and 7px (0.0625rem, 0.1875rem, 0.3125rem, 0.4375rem); the hairline 0-25 is 1px (0.0625rem) in both.",
13
+ "0": {
14
+ "$value": "0rem"
15
+ },
16
+ "0-25": {
17
+ "$value": "0.0625rem",
18
+ "$description": "Hairline: 1px in Comfy and in Compact (a 0.5px hairline renders blurry, hairlines do not compact). Padding and gaps of 1px."
19
+ },
20
+ "0-5": {
21
+ "$value": "0.125rem"
22
+ },
23
+ "1-5": {
24
+ "$value": "0.375rem",
25
+ "$description": "Half step: 6px (Compact 3px). With 0-5, 2-5 and 3-5 the only Comfy values that are not multiples of 4px."
26
+ },
27
+ "2-5": {
28
+ "$value": "0.625rem",
29
+ "$description": "Half step: 10px (Compact 5px)."
30
+ },
31
+ "3-5": {
32
+ "$value": "0.875rem",
33
+ "$description": "Half step: 14px (Compact 7px)."
34
+ },
35
+ "1": {
36
+ "$value": "0.25rem"
37
+ },
38
+ "2": {
39
+ "$value": "0.5rem"
40
+ },
41
+ "3": {
42
+ "$value": "0.75rem"
43
+ },
44
+ "4": {
45
+ "$value": "1rem"
46
+ },
47
+ "5": {
48
+ "$value": "1.25rem"
49
+ },
50
+ "6": {
51
+ "$value": "1.5rem"
52
+ },
53
+ "7": {
54
+ "$value": "1.75rem"
55
+ },
56
+ "8": {
57
+ "$value": "2rem"
58
+ },
59
+ "10": {
60
+ "$value": "2.5rem"
61
+ },
62
+ "12": {
63
+ "$value": "3rem"
64
+ },
65
+ "16": {
66
+ "$value": "4rem"
67
+ },
68
+ "20": {
69
+ "$value": "5rem"
70
+ },
71
+ "22": {
72
+ "$value": "5.5rem",
73
+ "$description": "88px (Compact 44px)."
74
+ },
75
+ "24": {
76
+ "$value": "6rem"
77
+ }
78
+ },
79
+ "radius": {
80
+ "$type": "dimension",
81
+ "3xs": {
82
+ "$value": "0.0625rem",
83
+ "$description": "1px: hairline shapes (QR modules, thin rules)"
84
+ },
85
+ "2xs": {
86
+ "$value": "0.125rem",
87
+ "$description": "2px: thin bars, progress segments"
88
+ },
89
+ "xs": {
90
+ "$value": "4px",
91
+ "$description": "Tags, small chips, checkboxes"
92
+ },
93
+ "sm": {
94
+ "$value": "6px",
95
+ "$description": "Menus, tooltips, small cards"
96
+ },
97
+ "field": {
98
+ "$value": "8px",
99
+ "$description": "Text fields and selects"
100
+ },
101
+ "md": {
102
+ "$value": "10px",
103
+ "$description": "Tight cards, popovers"
104
+ },
105
+ "lg": {
106
+ "$value": "12px",
107
+ "$description": "Cards, dialogs"
108
+ },
109
+ "xl": {
110
+ "$value": "16px",
111
+ "$description": "Hero panels"
112
+ },
113
+ "2xl": {
114
+ "$value": "1.25rem",
115
+ "$description": "20px: component set frames and tiles. The same in every look."
116
+ },
117
+ "3xl": {
118
+ "$value": "1.5rem",
119
+ "$description": "24px: cards and avatars with a fixed 24px corner. The same in every look."
120
+ },
121
+ "4xl": {
122
+ "$value": "2rem",
123
+ "$description": "32px: large avatars and panels with a fixed 32px corner. The same in every look."
124
+ },
125
+ "full": {
126
+ "$value": "9999px",
127
+ "$description": "Buttons, pills, avatars"
128
+ }
129
+ },
130
+ "font": {
131
+ "family": {
132
+ "$type": "fontFamily",
133
+ "display": {
134
+ "$value": [
135
+ "Crimson Pro",
136
+ "Georgia",
137
+ "Times New Roman",
138
+ "serif"
139
+ ],
140
+ "$description": "Headlines, at weight 300"
141
+ },
142
+ "body": {
143
+ "$value": [
144
+ "Inter",
145
+ "-apple-system",
146
+ "BlinkMacSystemFont",
147
+ "Segoe UI",
148
+ "Roboto",
149
+ "sans-serif"
150
+ ]
151
+ },
152
+ "mono": {
153
+ "$value": [
154
+ "JetBrains Mono",
155
+ "ui-monospace",
156
+ "SFMono-Regular",
157
+ "Menlo",
158
+ "monospace"
159
+ ]
160
+ }
161
+ },
162
+ "size": {
163
+ "$type": "dimension",
164
+ "2xs": {
165
+ "$value": "11px"
166
+ },
167
+ "xs": {
168
+ "$value": "12px",
169
+ "$description": "Eyebrows, badges"
170
+ },
171
+ "sm": {
172
+ "$value": "13px",
173
+ "$description": "Labels, small text"
174
+ },
175
+ "md": {
176
+ "$value": "14px",
177
+ "$description": "Buttons, dense UI"
178
+ },
179
+ "base": {
180
+ "$value": "16px",
181
+ "$description": "Body text, inputs"
182
+ },
183
+ "lg": {
184
+ "$value": "18px"
185
+ },
186
+ "xl": {
187
+ "$value": "20px"
188
+ },
189
+ "2xl": {
190
+ "$value": "24px"
191
+ },
192
+ "3xl": {
193
+ "$value": "28px",
194
+ "$description": "Card titles"
195
+ },
196
+ "4xl": {
197
+ "$value": "36px"
198
+ },
199
+ "5xl": {
200
+ "$value": "48px"
201
+ },
202
+ "6xl": {
203
+ "$value": "64px"
204
+ },
205
+ "7xl": {
206
+ "$value": "80px",
207
+ "$description": "Hero headlines"
208
+ }
209
+ },
210
+ "weight": {
211
+ "$type": "fontWeight",
212
+ "light": {
213
+ "$value": 300,
214
+ "$description": "Crimson Pro display"
215
+ },
216
+ "regular": {
217
+ "$value": 400
218
+ },
219
+ "medium": {
220
+ "$value": 500
221
+ },
222
+ "semibold": {
223
+ "$value": 600
224
+ }
225
+ },
226
+ "leading": {
227
+ "$type": "number",
228
+ "tight": {
229
+ "$value": 1.1
230
+ },
231
+ "snug": {
232
+ "$value": 1.3
233
+ },
234
+ "normal": {
235
+ "$value": 1.5
236
+ },
237
+ "relaxed": {
238
+ "$value": 1.6
239
+ }
240
+ },
241
+ "tracking": {
242
+ "$type": "dimension",
243
+ "display": {
244
+ "$value": "-0.02em"
245
+ },
246
+ "tight": {
247
+ "$value": "-0.01em"
248
+ },
249
+ "normal": {
250
+ "$value": "0em"
251
+ },
252
+ "eyebrow": {
253
+ "$value": "0.08em"
254
+ }
255
+ }
256
+ },
257
+ "motion": {
258
+ "ease": {
259
+ "$type": "cubicBezier",
260
+ "out": {
261
+ "$value": [
262
+ 0.16,
263
+ 1,
264
+ 0.3,
265
+ 1
266
+ ],
267
+ "$description": "The Alea ease: quick start, long soft landing"
268
+ },
269
+ "in-out": {
270
+ "$value": [
271
+ 0.65,
272
+ 0,
273
+ 0.35,
274
+ 1
275
+ ]
276
+ },
277
+ "standard": {
278
+ "$value": [
279
+ 0.2,
280
+ 0,
281
+ 0,
282
+ 1
283
+ ]
284
+ },
285
+ "emphasized": {
286
+ "$value": "{motion.ease.spring}",
287
+ "$description": "An alias of spring: a soft overshoot that settles at once, for indicators that glide, toggles, checks"
288
+ },
289
+ "spring": {
290
+ "$value": [
291
+ 0.22,
292
+ 1.2,
293
+ 0.36,
294
+ 1
295
+ ],
296
+ "$description": "A soft spring: a mild overshoot (about 1 percent) that settles at once, for chevrons and page dots; reduced motion swaps it for ease-out"
297
+ },
298
+ "in": {
299
+ "$value": [
300
+ 0.4,
301
+ 0,
302
+ 1,
303
+ 1
304
+ ],
305
+ "$description": "Exits: things leaving speed up"
306
+ }
307
+ },
308
+ "duration": {
309
+ "$type": "duration",
310
+ "instant": {
311
+ "$value": "120ms",
312
+ "$description": "Hover color changes and presses"
313
+ },
314
+ "fast": {
315
+ "$value": "200ms",
316
+ "$description": "Exits, tooltips, small state changes"
317
+ },
318
+ "base": {
319
+ "$value": "320ms",
320
+ "$description": "Popovers, menus, selects, indicators"
321
+ },
322
+ "slow": {
323
+ "$value": "480ms",
324
+ "$description": "Dialogs, drawers, toasts, expanding panels"
325
+ },
326
+ "slower": {
327
+ "$value": "720ms",
328
+ "$description": "Page-level reveals, charts drawing"
329
+ }
330
+ },
331
+ "distance": {
332
+ "$type": "dimension",
333
+ "sm": {
334
+ "$value": "8px",
335
+ "$description": "Popovers and items come from this far"
336
+ },
337
+ "md": {
338
+ "$value": "12px",
339
+ "$description": "Toasts and panels"
340
+ },
341
+ "lg": {
342
+ "$value": "24px",
343
+ "$description": "Dialogs rise this far"
344
+ }
345
+ },
346
+ "scale": {
347
+ "$type": "number",
348
+ "from": {
349
+ "$value": 0.92,
350
+ "$description": "Overlays grow from this size"
351
+ },
352
+ "press": {
353
+ "$value": 0.96,
354
+ "$description": "Pressed controls shrink to this"
355
+ }
356
+ },
357
+ "stagger": {
358
+ "$type": "duration",
359
+ "$value": "40ms",
360
+ "$description": "Delay between items entering one after another"
361
+ },
362
+ "lift": {
363
+ "$type": "dimension",
364
+ "$value": "-4px",
365
+ "$description": "Clickable surfaces rise this much on hover"
366
+ },
367
+ "spring": {
368
+ "$type": "easing",
369
+ "$value": "linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 1)",
370
+ "$description": "A real spring (overshoots and settles): badges popping in, toggles, glide"
371
+ },
372
+ "blur": {
373
+ "$type": "dimension",
374
+ "sm": {
375
+ "$value": "4px",
376
+ "$description": "Swap and reveal start this blurred"
377
+ },
378
+ "md": {
379
+ "$value": "8px",
380
+ "$description": "Dissolve and route"
381
+ },
382
+ "lg": {
383
+ "$value": "16px",
384
+ "$description": "Glass and backdrops"
385
+ }
386
+ }
387
+ },
388
+ "z": {
389
+ "$type": "number",
390
+ "dropdown": {
391
+ "$value": 1000
392
+ },
393
+ "sticky": {
394
+ "$value": 1100
395
+ },
396
+ "overlay": {
397
+ "$value": 1200
398
+ },
399
+ "modal": {
400
+ "$value": 1300
401
+ },
402
+ "toast": {
403
+ "$value": 1400
404
+ },
405
+ "tooltip": {
406
+ "$value": 1500
407
+ }
408
+ },
409
+ "breakpoint": {
410
+ "$type": "dimension",
411
+ "sm": {
412
+ "$value": "640px"
413
+ },
414
+ "md": {
415
+ "$value": "768px"
416
+ },
417
+ "lg": {
418
+ "$value": "1024px"
419
+ },
420
+ "xl": {
421
+ "$value": "1280px"
422
+ }
423
+ },
424
+ "size": {
425
+ "$type": "dimension",
426
+ "$description": "Control heights",
427
+ "control-sm": {
428
+ "$value": "32px"
429
+ },
430
+ "control-md": {
431
+ "$value": "40px"
432
+ },
433
+ "control-lg": {
434
+ "$value": "48px"
435
+ },
436
+ "field": {
437
+ "$value": "44px"
438
+ },
439
+ "icon-sm": {
440
+ "$value": "16px"
441
+ },
442
+ "icon-md": {
443
+ "$value": "20px"
444
+ },
445
+ "icon-lg": {
446
+ "$value": "24px"
447
+ }
448
+ }
449
+ }