@calcifer-design/tokens 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/dist/breakpoint-scan.d.ts +1 -0
- package/dist/contrast.d.ts +2 -0
- package/dist/generate.d.ts +3 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +455 -0
- package/dist/tokens.css +197 -0
- package/dist/tokens.d.ts +427 -0
- package/package.json +40 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function findWidthQueryViolations(css: string, allowedWidths: ReadonlySet<string>): string[];
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { breakpoint, themes, shared, textContrastPairs, uiContrastPairs, tokens } from './tokens.js';
|
|
2
|
+
export type { BreakpointName, ColorName, ThemeName, Tokens } from './tokens.js';
|
|
3
|
+
export { tokensToCss, toKebab } from './generate.js';
|
|
4
|
+
export { contrastRatio, relativeLuminance } from './contrast.js';
|
|
5
|
+
export { findWidthQueryViolations } from './breakpoint-scan.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
const breakpoint = {
|
|
2
|
+
sm: '40rem',
|
|
3
|
+
md: '48rem',
|
|
4
|
+
lg: '64rem',
|
|
5
|
+
xl: '80rem',
|
|
6
|
+
'2xl': '112.5rem'
|
|
7
|
+
};
|
|
8
|
+
const lightColor = {
|
|
9
|
+
surface1: '#FBFAF8',
|
|
10
|
+
surfaceRaised: '#FFFFFF',
|
|
11
|
+
surface2: '#F4F2EE',
|
|
12
|
+
surface3: '#ECE9E3',
|
|
13
|
+
surfaceInput: '#FFFFFF',
|
|
14
|
+
surfaceInverse: '#1C1917',
|
|
15
|
+
text: '#1C1917',
|
|
16
|
+
textMuted: '#57534E',
|
|
17
|
+
textSubtle: '#6B6560',
|
|
18
|
+
textInverse: '#FFFFFF',
|
|
19
|
+
link: '#2F5FCC',
|
|
20
|
+
accent: '#3B6FE0',
|
|
21
|
+
accentHover: '#2F5FCC',
|
|
22
|
+
accentText: '#FFFFFF',
|
|
23
|
+
accentSoft: 'rgba(59, 111, 224, 0.14)',
|
|
24
|
+
accentWash: 'rgba(59, 111, 224, 0.035)',
|
|
25
|
+
border: 'rgba(28, 25, 23, 0.08)',
|
|
26
|
+
borderStrong: 'rgba(28, 25, 23, 0.18)',
|
|
27
|
+
borderAccent: 'rgba(59, 111, 224, 0.28)',
|
|
28
|
+
cardBorder: 'transparent',
|
|
29
|
+
focus: '#3B6FE0',
|
|
30
|
+
success: '#1F8A5B',
|
|
31
|
+
warning: '#B7791F',
|
|
32
|
+
danger: '#D23B3B',
|
|
33
|
+
dangerSurface: 'rgba(210, 59, 59, 0.06)',
|
|
34
|
+
dangerBorder: 'rgba(210, 59, 59, 0.35)',
|
|
35
|
+
neutral: '#8A8580',
|
|
36
|
+
chartPhase1: '#C9D6F5',
|
|
37
|
+
chartPhase2: '#3B6FE0',
|
|
38
|
+
chartPhase3: '#8FAAEB',
|
|
39
|
+
chartPhase4: '#1F8A5B'
|
|
40
|
+
};
|
|
41
|
+
const darkColor = {
|
|
42
|
+
surface1: '#0B0D12',
|
|
43
|
+
surfaceRaised: '#111420',
|
|
44
|
+
surface2: '#171B28',
|
|
45
|
+
surface3: '#1F2434',
|
|
46
|
+
surfaceInput: '#171B28',
|
|
47
|
+
surfaceInverse: '#EDEEF2',
|
|
48
|
+
text: '#EDEEF2',
|
|
49
|
+
textMuted: '#A8ADB8',
|
|
50
|
+
textSubtle: '#8A909C',
|
|
51
|
+
textInverse: '#0B0D12',
|
|
52
|
+
link: '#9DB8F7',
|
|
53
|
+
accent: '#7FA4F5',
|
|
54
|
+
accentHover: '#98B6F8',
|
|
55
|
+
accentText: '#0B0D12',
|
|
56
|
+
accentSoft: 'rgba(127, 164, 245, 0.18)',
|
|
57
|
+
accentWash: 'rgba(127, 164, 245, 0.05)',
|
|
58
|
+
border: 'rgba(255, 255, 255, 0.08)',
|
|
59
|
+
borderStrong: 'rgba(255, 255, 255, 0.18)',
|
|
60
|
+
borderAccent: 'rgba(127, 164, 245, 0.32)',
|
|
61
|
+
cardBorder: 'rgba(255, 255, 255, 0.08)',
|
|
62
|
+
focus: '#7FA4F5',
|
|
63
|
+
success: '#4FC38A',
|
|
64
|
+
warning: '#E0B04A',
|
|
65
|
+
danger: '#F07070',
|
|
66
|
+
dangerSurface: 'rgba(240, 112, 112, 0.10)',
|
|
67
|
+
dangerBorder: 'rgba(240, 112, 112, 0.35)',
|
|
68
|
+
neutral: '#6B7280',
|
|
69
|
+
chartPhase1: '#2B3652',
|
|
70
|
+
chartPhase2: '#7FA4F5',
|
|
71
|
+
chartPhase3: '#4E6BB0',
|
|
72
|
+
chartPhase4: '#4FC38A'
|
|
73
|
+
};
|
|
74
|
+
const themes = {
|
|
75
|
+
light: {
|
|
76
|
+
color: lightColor,
|
|
77
|
+
elevation: {
|
|
78
|
+
1: '0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05)',
|
|
79
|
+
2: '0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)',
|
|
80
|
+
3: '0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)'
|
|
81
|
+
},
|
|
82
|
+
material: {
|
|
83
|
+
glassBg: 'rgba(251, 250, 248, 0.78)'
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
dark: {
|
|
87
|
+
color: darkColor,
|
|
88
|
+
elevation: {
|
|
89
|
+
1: 'inset 0 1px 0 rgba(255, 255, 255, 0.06)',
|
|
90
|
+
2: 'inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18)',
|
|
91
|
+
3: 'inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5)'
|
|
92
|
+
},
|
|
93
|
+
material: {
|
|
94
|
+
glassBg: 'rgba(11, 13, 18, 0.78)'
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const shared = {
|
|
99
|
+
font: {
|
|
100
|
+
sans: '"Geist Variable", "Geist", -apple-system, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif',
|
|
101
|
+
mono: '"Geist Mono Variable", "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace'
|
|
102
|
+
},
|
|
103
|
+
text: {
|
|
104
|
+
'2xs': '0.6875rem',
|
|
105
|
+
xs: '0.75rem',
|
|
106
|
+
sm: '0.875rem',
|
|
107
|
+
md: '1rem',
|
|
108
|
+
lg: '1.125rem',
|
|
109
|
+
xl: 'clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem)',
|
|
110
|
+
statement: 'clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem)',
|
|
111
|
+
h3: '1.25rem',
|
|
112
|
+
h2Feature: '1.75rem',
|
|
113
|
+
h2: 'clamp(1.875rem, 1.6rem + 1.25vw, 2.5rem)',
|
|
114
|
+
h1: 'clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem)',
|
|
115
|
+
display: 'clamp(2.75rem, 2rem + 3.5vw, 4.5rem)',
|
|
116
|
+
displayWide: '5.5rem'
|
|
117
|
+
},
|
|
118
|
+
leading: {
|
|
119
|
+
display: '1.05',
|
|
120
|
+
tight: '1.15',
|
|
121
|
+
snug: '1.3',
|
|
122
|
+
prose: '1.55',
|
|
123
|
+
body: '1.6'
|
|
124
|
+
},
|
|
125
|
+
tracking: {
|
|
126
|
+
display: '-0.03em',
|
|
127
|
+
h1: '-0.025em',
|
|
128
|
+
heading: '-0.015em',
|
|
129
|
+
body: '0',
|
|
130
|
+
wide: '0.08em'
|
|
131
|
+
},
|
|
132
|
+
space: {
|
|
133
|
+
1: '0.25rem',
|
|
134
|
+
2: '0.5rem',
|
|
135
|
+
3: '0.75rem',
|
|
136
|
+
4: '1rem',
|
|
137
|
+
5: '1.5rem',
|
|
138
|
+
6: '2rem',
|
|
139
|
+
7: '3rem',
|
|
140
|
+
8: '4rem',
|
|
141
|
+
9: '6rem',
|
|
142
|
+
10: '8rem',
|
|
143
|
+
pageInlineWide: 'clamp(4rem, 5vw, 8rem)'
|
|
144
|
+
},
|
|
145
|
+
radius: {
|
|
146
|
+
sm: '0.5rem',
|
|
147
|
+
md: '0.625rem',
|
|
148
|
+
lg: '0.75rem',
|
|
149
|
+
xl: '1rem',
|
|
150
|
+
full: '999px'
|
|
151
|
+
},
|
|
152
|
+
borderWidth: {
|
|
153
|
+
emphasis: '2px',
|
|
154
|
+
strong: '3px'
|
|
155
|
+
},
|
|
156
|
+
motion: {
|
|
157
|
+
duration: {
|
|
158
|
+
1: '120ms',
|
|
159
|
+
2: '200ms',
|
|
160
|
+
3: '320ms',
|
|
161
|
+
4: '520ms'
|
|
162
|
+
},
|
|
163
|
+
ease: 'cubic-bezier(0.2, 0, 0, 1)',
|
|
164
|
+
springDefaultDamping: '0.8',
|
|
165
|
+
springDefaultResponse: '0.35',
|
|
166
|
+
springMomentumDamping: '0.8',
|
|
167
|
+
springMomentumResponse: '0.35'
|
|
168
|
+
},
|
|
169
|
+
material: {
|
|
170
|
+
glassBlur: 'blur(20px) saturate(1.4)'
|
|
171
|
+
},
|
|
172
|
+
size: {
|
|
173
|
+
touch: '44px',
|
|
174
|
+
header: '4rem',
|
|
175
|
+
headerWide: '4.5rem',
|
|
176
|
+
pageMax: '75rem',
|
|
177
|
+
pageMaxWide: 'min(112.5rem, 90vw)'
|
|
178
|
+
},
|
|
179
|
+
measure: '65ch',
|
|
180
|
+
focusRingWidth: '2px',
|
|
181
|
+
focusRingOffset: '2px'
|
|
182
|
+
};
|
|
183
|
+
const textContrastPairs = [
|
|
184
|
+
[
|
|
185
|
+
'text',
|
|
186
|
+
'surface1'
|
|
187
|
+
],
|
|
188
|
+
[
|
|
189
|
+
'text',
|
|
190
|
+
'surface2'
|
|
191
|
+
],
|
|
192
|
+
[
|
|
193
|
+
'text',
|
|
194
|
+
'surface3'
|
|
195
|
+
],
|
|
196
|
+
[
|
|
197
|
+
'text',
|
|
198
|
+
'surfaceRaised'
|
|
199
|
+
],
|
|
200
|
+
[
|
|
201
|
+
'textMuted',
|
|
202
|
+
'surface1'
|
|
203
|
+
],
|
|
204
|
+
[
|
|
205
|
+
'textMuted',
|
|
206
|
+
'surface2'
|
|
207
|
+
],
|
|
208
|
+
[
|
|
209
|
+
'textMuted',
|
|
210
|
+
'surface3'
|
|
211
|
+
],
|
|
212
|
+
[
|
|
213
|
+
'textMuted',
|
|
214
|
+
'surfaceRaised'
|
|
215
|
+
],
|
|
216
|
+
[
|
|
217
|
+
'textSubtle',
|
|
218
|
+
'surface1'
|
|
219
|
+
],
|
|
220
|
+
[
|
|
221
|
+
'textSubtle',
|
|
222
|
+
'surface2'
|
|
223
|
+
],
|
|
224
|
+
[
|
|
225
|
+
'textSubtle',
|
|
226
|
+
'surface3'
|
|
227
|
+
],
|
|
228
|
+
[
|
|
229
|
+
'textSubtle',
|
|
230
|
+
'surfaceRaised'
|
|
231
|
+
],
|
|
232
|
+
[
|
|
233
|
+
'link',
|
|
234
|
+
'surface1'
|
|
235
|
+
],
|
|
236
|
+
[
|
|
237
|
+
'link',
|
|
238
|
+
'surface2'
|
|
239
|
+
],
|
|
240
|
+
[
|
|
241
|
+
'link',
|
|
242
|
+
'surface3'
|
|
243
|
+
],
|
|
244
|
+
[
|
|
245
|
+
'link',
|
|
246
|
+
'surfaceRaised'
|
|
247
|
+
],
|
|
248
|
+
[
|
|
249
|
+
'accentText',
|
|
250
|
+
'accent'
|
|
251
|
+
],
|
|
252
|
+
[
|
|
253
|
+
'accentText',
|
|
254
|
+
'accentHover'
|
|
255
|
+
],
|
|
256
|
+
[
|
|
257
|
+
'textInverse',
|
|
258
|
+
'surfaceInverse'
|
|
259
|
+
]
|
|
260
|
+
];
|
|
261
|
+
const uiContrastPairs = [
|
|
262
|
+
[
|
|
263
|
+
'accent',
|
|
264
|
+
'surface1'
|
|
265
|
+
],
|
|
266
|
+
[
|
|
267
|
+
'accent',
|
|
268
|
+
'surface2'
|
|
269
|
+
],
|
|
270
|
+
[
|
|
271
|
+
'accent',
|
|
272
|
+
'surface3'
|
|
273
|
+
],
|
|
274
|
+
[
|
|
275
|
+
'accent',
|
|
276
|
+
'surfaceRaised'
|
|
277
|
+
],
|
|
278
|
+
[
|
|
279
|
+
'focus',
|
|
280
|
+
'surface1'
|
|
281
|
+
],
|
|
282
|
+
[
|
|
283
|
+
'focus',
|
|
284
|
+
'surface2'
|
|
285
|
+
],
|
|
286
|
+
[
|
|
287
|
+
'focus',
|
|
288
|
+
'surface3'
|
|
289
|
+
],
|
|
290
|
+
[
|
|
291
|
+
'focus',
|
|
292
|
+
'surfaceRaised'
|
|
293
|
+
],
|
|
294
|
+
[
|
|
295
|
+
'success',
|
|
296
|
+
'surface1'
|
|
297
|
+
],
|
|
298
|
+
[
|
|
299
|
+
'success',
|
|
300
|
+
'surface2'
|
|
301
|
+
],
|
|
302
|
+
[
|
|
303
|
+
'success',
|
|
304
|
+
'surface3'
|
|
305
|
+
],
|
|
306
|
+
[
|
|
307
|
+
'success',
|
|
308
|
+
'surfaceRaised'
|
|
309
|
+
],
|
|
310
|
+
[
|
|
311
|
+
'warning',
|
|
312
|
+
'surface1'
|
|
313
|
+
],
|
|
314
|
+
[
|
|
315
|
+
'warning',
|
|
316
|
+
'surface2'
|
|
317
|
+
],
|
|
318
|
+
[
|
|
319
|
+
'warning',
|
|
320
|
+
'surface3'
|
|
321
|
+
],
|
|
322
|
+
[
|
|
323
|
+
'warning',
|
|
324
|
+
'surfaceRaised'
|
|
325
|
+
],
|
|
326
|
+
[
|
|
327
|
+
'danger',
|
|
328
|
+
'surface1'
|
|
329
|
+
],
|
|
330
|
+
[
|
|
331
|
+
'danger',
|
|
332
|
+
'surface2'
|
|
333
|
+
],
|
|
334
|
+
[
|
|
335
|
+
'danger',
|
|
336
|
+
'surface3'
|
|
337
|
+
],
|
|
338
|
+
[
|
|
339
|
+
'danger',
|
|
340
|
+
'surfaceRaised'
|
|
341
|
+
],
|
|
342
|
+
[
|
|
343
|
+
'neutral',
|
|
344
|
+
'surface1'
|
|
345
|
+
],
|
|
346
|
+
[
|
|
347
|
+
'neutral',
|
|
348
|
+
'surface2'
|
|
349
|
+
]
|
|
350
|
+
];
|
|
351
|
+
const tokens_tokens = {
|
|
352
|
+
breakpoint: breakpoint,
|
|
353
|
+
themes: themes,
|
|
354
|
+
shared: shared
|
|
355
|
+
};
|
|
356
|
+
function toKebab(name) {
|
|
357
|
+
return name.replace(/([a-z])([A-Z])/g, '$1-$2').replace(/(\d)([A-Z])/g, '$1-$2').replace(/([a-zA-Z]{2,})(\d)/g, '$1-$2').toLowerCase();
|
|
358
|
+
}
|
|
359
|
+
function flatten(prefix, tree, output) {
|
|
360
|
+
for (const [key, value] of Object.entries(tree)){
|
|
361
|
+
const name = `${prefix}-${toKebab(key)}`;
|
|
362
|
+
if ('object' == typeof value) flatten(name, value, output);
|
|
363
|
+
else output.push(` ${name}: ${value};`);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
function block(selector, lines, indent = '') {
|
|
367
|
+
const body = lines.map((line)=>`${indent}${line}`).join('\n');
|
|
368
|
+
return `${indent}${selector} {\n${body}\n${indent}}`;
|
|
369
|
+
}
|
|
370
|
+
function tokensToCss(tokens) {
|
|
371
|
+
const sharedLines = [
|
|
372
|
+
' color-scheme: light dark;'
|
|
373
|
+
];
|
|
374
|
+
flatten('--font', tokens.shared.font, sharedLines);
|
|
375
|
+
flatten('--text', tokens.shared.text, sharedLines);
|
|
376
|
+
flatten('--leading', tokens.shared.leading, sharedLines);
|
|
377
|
+
flatten('--tracking', tokens.shared.tracking, sharedLines);
|
|
378
|
+
flatten('--space', tokens.shared.space, sharedLines);
|
|
379
|
+
flatten('--radius', tokens.shared.radius, sharedLines);
|
|
380
|
+
flatten('--border-width', tokens.shared.borderWidth, sharedLines);
|
|
381
|
+
flatten('--motion', tokens.shared.motion, sharedLines);
|
|
382
|
+
flatten('--size', tokens.shared.size, sharedLines);
|
|
383
|
+
flatten('--material', tokens.shared.material, sharedLines);
|
|
384
|
+
sharedLines.push(` --measure: ${tokens.shared.measure};`);
|
|
385
|
+
sharedLines.push(` --focus-ring-width: ${tokens.shared.focusRingWidth};`);
|
|
386
|
+
sharedLines.push(` --focus-ring-offset: ${tokens.shared.focusRingOffset};`);
|
|
387
|
+
const lightLines = [];
|
|
388
|
+
flatten('--color', tokens.themes.light.color, lightLines);
|
|
389
|
+
flatten('--elevation', tokens.themes.light.elevation, lightLines);
|
|
390
|
+
flatten('--material', tokens.themes.light.material, lightLines);
|
|
391
|
+
const darkLines = [
|
|
392
|
+
' color-scheme: dark;'
|
|
393
|
+
];
|
|
394
|
+
flatten('--color', tokens.themes.dark.color, darkLines);
|
|
395
|
+
flatten('--elevation', tokens.themes.dark.elevation, darkLines);
|
|
396
|
+
flatten('--material', tokens.themes.dark.material, darkLines);
|
|
397
|
+
const reducedMotionLines = [
|
|
398
|
+
...Object.keys(tokens.shared.motion.duration).map((step)=>` --motion-duration-${step}: 0ms;`),
|
|
399
|
+
' --motion-spring-default-damping: 1;',
|
|
400
|
+
' --motion-spring-momentum-damping: 1;'
|
|
401
|
+
];
|
|
402
|
+
return [
|
|
403
|
+
'/* Generated from packages/tokens/src/tokens.ts. Do not edit. */',
|
|
404
|
+
block(':root', [
|
|
405
|
+
...sharedLines,
|
|
406
|
+
...lightLines
|
|
407
|
+
]),
|
|
408
|
+
block(':root[data-theme="dark"]', darkLines),
|
|
409
|
+
block(':root[data-theme="light"]', [
|
|
410
|
+
' color-scheme: light;'
|
|
411
|
+
]),
|
|
412
|
+
`@media (prefers-color-scheme: dark) {\n${block(':root:not([data-theme="light"])', darkLines, ' ')}\n}`,
|
|
413
|
+
`@media (prefers-reduced-motion: reduce) {\n${block(':root', reducedMotionLines, ' ')}\n}`,
|
|
414
|
+
''
|
|
415
|
+
].join('\n\n');
|
|
416
|
+
}
|
|
417
|
+
function channelToLinear(channel) {
|
|
418
|
+
const scaled = channel / 255;
|
|
419
|
+
return scaled <= 0.04045 ? scaled / 12.92 : ((scaled + 0.055) / 1.055) ** 2.4;
|
|
420
|
+
}
|
|
421
|
+
function hexToRgb(hex) {
|
|
422
|
+
const cleaned = hex.replace('#', '');
|
|
423
|
+
const expanded = 3 === cleaned.length ? cleaned.split('').map((digit)=>digit + digit).join('') : cleaned;
|
|
424
|
+
const value = Number.parseInt(expanded, 16);
|
|
425
|
+
return [
|
|
426
|
+
value >> 16 & 255,
|
|
427
|
+
value >> 8 & 255,
|
|
428
|
+
255 & value
|
|
429
|
+
];
|
|
430
|
+
}
|
|
431
|
+
function relativeLuminance(hex) {
|
|
432
|
+
const [red, green, blue] = hexToRgb(hex);
|
|
433
|
+
return 0.2126 * channelToLinear(red) + 0.7152 * channelToLinear(green) + 0.0722 * channelToLinear(blue);
|
|
434
|
+
}
|
|
435
|
+
function contrastRatio(hexA, hexB) {
|
|
436
|
+
const luminanceA = relativeLuminance(hexA);
|
|
437
|
+
const luminanceB = relativeLuminance(hexB);
|
|
438
|
+
const lighter = Math.max(luminanceA, luminanceB);
|
|
439
|
+
const darker = Math.min(luminanceA, luminanceB);
|
|
440
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
441
|
+
}
|
|
442
|
+
function findWidthQueryViolations(css, allowedWidths) {
|
|
443
|
+
const queryPattern = /\((min|max)-width:\s*([^)\s]+)\)/g;
|
|
444
|
+
const violations = [];
|
|
445
|
+
for (const match of css.matchAll(queryPattern)){
|
|
446
|
+
const [, boundType, width] = match;
|
|
447
|
+
const widthValue = width ?? '';
|
|
448
|
+
if ('max' === boundType) violations.push(`found max-width: ${widthValue}; use min-width only`);
|
|
449
|
+
if (!allowedWidths.has(widthValue)) violations.push(`found ${boundType}-width: ${widthValue}; allowed: ${[
|
|
450
|
+
...allowedWidths
|
|
451
|
+
].join(', ')}`);
|
|
452
|
+
}
|
|
453
|
+
return violations;
|
|
454
|
+
}
|
|
455
|
+
export { breakpoint, contrastRatio, findWidthQueryViolations, relativeLuminance, shared, textContrastPairs, themes, toKebab, tokensToCss, tokens_tokens as tokens, uiContrastPairs };
|
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/* Generated from packages/tokens/src/tokens.ts. Do not edit. */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
color-scheme: light dark;
|
|
5
|
+
--font-sans: "Geist Variable", "Geist", -apple-system, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
|
|
6
|
+
--font-mono: "Geist Mono Variable", "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
|
|
7
|
+
--text-2xs: 0.6875rem;
|
|
8
|
+
--text-xs: 0.75rem;
|
|
9
|
+
--text-sm: 0.875rem;
|
|
10
|
+
--text-md: 1rem;
|
|
11
|
+
--text-lg: 1.125rem;
|
|
12
|
+
--text-xl: clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem);
|
|
13
|
+
--text-statement: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
|
|
14
|
+
--text-h3: 1.25rem;
|
|
15
|
+
--text-h2-feature: 1.75rem;
|
|
16
|
+
--text-h2: clamp(1.875rem, 1.6rem + 1.25vw, 2.5rem);
|
|
17
|
+
--text-h1: clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem);
|
|
18
|
+
--text-display: clamp(2.75rem, 2rem + 3.5vw, 4.5rem);
|
|
19
|
+
--text-display-wide: 5.5rem;
|
|
20
|
+
--leading-display: 1.05;
|
|
21
|
+
--leading-tight: 1.15;
|
|
22
|
+
--leading-snug: 1.3;
|
|
23
|
+
--leading-prose: 1.55;
|
|
24
|
+
--leading-body: 1.6;
|
|
25
|
+
--tracking-display: -0.03em;
|
|
26
|
+
--tracking-h1: -0.025em;
|
|
27
|
+
--tracking-heading: -0.015em;
|
|
28
|
+
--tracking-body: 0;
|
|
29
|
+
--tracking-wide: 0.08em;
|
|
30
|
+
--space-1: 0.25rem;
|
|
31
|
+
--space-2: 0.5rem;
|
|
32
|
+
--space-3: 0.75rem;
|
|
33
|
+
--space-4: 1rem;
|
|
34
|
+
--space-5: 1.5rem;
|
|
35
|
+
--space-6: 2rem;
|
|
36
|
+
--space-7: 3rem;
|
|
37
|
+
--space-8: 4rem;
|
|
38
|
+
--space-9: 6rem;
|
|
39
|
+
--space-10: 8rem;
|
|
40
|
+
--space-page-inline-wide: clamp(4rem, 5vw, 8rem);
|
|
41
|
+
--radius-sm: 0.5rem;
|
|
42
|
+
--radius-md: 0.625rem;
|
|
43
|
+
--radius-lg: 0.75rem;
|
|
44
|
+
--radius-xl: 1rem;
|
|
45
|
+
--radius-full: 999px;
|
|
46
|
+
--border-width-emphasis: 2px;
|
|
47
|
+
--border-width-strong: 3px;
|
|
48
|
+
--motion-duration-1: 120ms;
|
|
49
|
+
--motion-duration-2: 200ms;
|
|
50
|
+
--motion-duration-3: 320ms;
|
|
51
|
+
--motion-duration-4: 520ms;
|
|
52
|
+
--motion-ease: cubic-bezier(0.2, 0, 0, 1);
|
|
53
|
+
--motion-spring-default-damping: 0.8;
|
|
54
|
+
--motion-spring-default-response: 0.35;
|
|
55
|
+
--motion-spring-momentum-damping: 0.8;
|
|
56
|
+
--motion-spring-momentum-response: 0.35;
|
|
57
|
+
--size-touch: 44px;
|
|
58
|
+
--size-header: 4rem;
|
|
59
|
+
--size-header-wide: 4.5rem;
|
|
60
|
+
--size-page-max: 75rem;
|
|
61
|
+
--size-page-max-wide: min(112.5rem, 90vw);
|
|
62
|
+
--material-glass-blur: blur(20px) saturate(1.4);
|
|
63
|
+
--measure: 65ch;
|
|
64
|
+
--focus-ring-width: 2px;
|
|
65
|
+
--focus-ring-offset: 2px;
|
|
66
|
+
--color-surface-1: #FBFAF8;
|
|
67
|
+
--color-surface-raised: #FFFFFF;
|
|
68
|
+
--color-surface-2: #F4F2EE;
|
|
69
|
+
--color-surface-3: #ECE9E3;
|
|
70
|
+
--color-surface-input: #FFFFFF;
|
|
71
|
+
--color-surface-inverse: #1C1917;
|
|
72
|
+
--color-text: #1C1917;
|
|
73
|
+
--color-text-muted: #57534E;
|
|
74
|
+
--color-text-subtle: #6B6560;
|
|
75
|
+
--color-text-inverse: #FFFFFF;
|
|
76
|
+
--color-link: #2F5FCC;
|
|
77
|
+
--color-accent: #3B6FE0;
|
|
78
|
+
--color-accent-hover: #2F5FCC;
|
|
79
|
+
--color-accent-text: #FFFFFF;
|
|
80
|
+
--color-accent-soft: rgba(59, 111, 224, 0.14);
|
|
81
|
+
--color-accent-wash: rgba(59, 111, 224, 0.035);
|
|
82
|
+
--color-border: rgba(28, 25, 23, 0.08);
|
|
83
|
+
--color-border-strong: rgba(28, 25, 23, 0.18);
|
|
84
|
+
--color-border-accent: rgba(59, 111, 224, 0.28);
|
|
85
|
+
--color-card-border: transparent;
|
|
86
|
+
--color-focus: #3B6FE0;
|
|
87
|
+
--color-success: #1F8A5B;
|
|
88
|
+
--color-warning: #B7791F;
|
|
89
|
+
--color-danger: #D23B3B;
|
|
90
|
+
--color-danger-surface: rgba(210, 59, 59, 0.06);
|
|
91
|
+
--color-danger-border: rgba(210, 59, 59, 0.35);
|
|
92
|
+
--color-neutral: #8A8580;
|
|
93
|
+
--color-chart-phase-1: #C9D6F5;
|
|
94
|
+
--color-chart-phase-2: #3B6FE0;
|
|
95
|
+
--color-chart-phase-3: #8FAAEB;
|
|
96
|
+
--color-chart-phase-4: #1F8A5B;
|
|
97
|
+
--elevation-1: 0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05);
|
|
98
|
+
--elevation-2: 0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08);
|
|
99
|
+
--elevation-3: 0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06);
|
|
100
|
+
--material-glass-bg: rgba(251, 250, 248, 0.78);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:root[data-theme="dark"] {
|
|
104
|
+
color-scheme: dark;
|
|
105
|
+
--color-surface-1: #0B0D12;
|
|
106
|
+
--color-surface-raised: #111420;
|
|
107
|
+
--color-surface-2: #171B28;
|
|
108
|
+
--color-surface-3: #1F2434;
|
|
109
|
+
--color-surface-input: #171B28;
|
|
110
|
+
--color-surface-inverse: #EDEEF2;
|
|
111
|
+
--color-text: #EDEEF2;
|
|
112
|
+
--color-text-muted: #A8ADB8;
|
|
113
|
+
--color-text-subtle: #8A909C;
|
|
114
|
+
--color-text-inverse: #0B0D12;
|
|
115
|
+
--color-link: #9DB8F7;
|
|
116
|
+
--color-accent: #7FA4F5;
|
|
117
|
+
--color-accent-hover: #98B6F8;
|
|
118
|
+
--color-accent-text: #0B0D12;
|
|
119
|
+
--color-accent-soft: rgba(127, 164, 245, 0.18);
|
|
120
|
+
--color-accent-wash: rgba(127, 164, 245, 0.05);
|
|
121
|
+
--color-border: rgba(255, 255, 255, 0.08);
|
|
122
|
+
--color-border-strong: rgba(255, 255, 255, 0.18);
|
|
123
|
+
--color-border-accent: rgba(127, 164, 245, 0.32);
|
|
124
|
+
--color-card-border: rgba(255, 255, 255, 0.08);
|
|
125
|
+
--color-focus: #7FA4F5;
|
|
126
|
+
--color-success: #4FC38A;
|
|
127
|
+
--color-warning: #E0B04A;
|
|
128
|
+
--color-danger: #F07070;
|
|
129
|
+
--color-danger-surface: rgba(240, 112, 112, 0.10);
|
|
130
|
+
--color-danger-border: rgba(240, 112, 112, 0.35);
|
|
131
|
+
--color-neutral: #6B7280;
|
|
132
|
+
--color-chart-phase-1: #2B3652;
|
|
133
|
+
--color-chart-phase-2: #7FA4F5;
|
|
134
|
+
--color-chart-phase-3: #4E6BB0;
|
|
135
|
+
--color-chart-phase-4: #4FC38A;
|
|
136
|
+
--elevation-1: inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
|
137
|
+
--elevation-2: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18);
|
|
138
|
+
--elevation-3: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5);
|
|
139
|
+
--material-glass-bg: rgba(11, 13, 18, 0.78);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:root[data-theme="light"] {
|
|
143
|
+
color-scheme: light;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@media (prefers-color-scheme: dark) {
|
|
147
|
+
:root:not([data-theme="light"]) {
|
|
148
|
+
color-scheme: dark;
|
|
149
|
+
--color-surface-1: #0B0D12;
|
|
150
|
+
--color-surface-raised: #111420;
|
|
151
|
+
--color-surface-2: #171B28;
|
|
152
|
+
--color-surface-3: #1F2434;
|
|
153
|
+
--color-surface-input: #171B28;
|
|
154
|
+
--color-surface-inverse: #EDEEF2;
|
|
155
|
+
--color-text: #EDEEF2;
|
|
156
|
+
--color-text-muted: #A8ADB8;
|
|
157
|
+
--color-text-subtle: #8A909C;
|
|
158
|
+
--color-text-inverse: #0B0D12;
|
|
159
|
+
--color-link: #9DB8F7;
|
|
160
|
+
--color-accent: #7FA4F5;
|
|
161
|
+
--color-accent-hover: #98B6F8;
|
|
162
|
+
--color-accent-text: #0B0D12;
|
|
163
|
+
--color-accent-soft: rgba(127, 164, 245, 0.18);
|
|
164
|
+
--color-accent-wash: rgba(127, 164, 245, 0.05);
|
|
165
|
+
--color-border: rgba(255, 255, 255, 0.08);
|
|
166
|
+
--color-border-strong: rgba(255, 255, 255, 0.18);
|
|
167
|
+
--color-border-accent: rgba(127, 164, 245, 0.32);
|
|
168
|
+
--color-card-border: rgba(255, 255, 255, 0.08);
|
|
169
|
+
--color-focus: #7FA4F5;
|
|
170
|
+
--color-success: #4FC38A;
|
|
171
|
+
--color-warning: #E0B04A;
|
|
172
|
+
--color-danger: #F07070;
|
|
173
|
+
--color-danger-surface: rgba(240, 112, 112, 0.10);
|
|
174
|
+
--color-danger-border: rgba(240, 112, 112, 0.35);
|
|
175
|
+
--color-neutral: #6B7280;
|
|
176
|
+
--color-chart-phase-1: #2B3652;
|
|
177
|
+
--color-chart-phase-2: #7FA4F5;
|
|
178
|
+
--color-chart-phase-3: #4E6BB0;
|
|
179
|
+
--color-chart-phase-4: #4FC38A;
|
|
180
|
+
--elevation-1: inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
|
181
|
+
--elevation-2: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18);
|
|
182
|
+
--elevation-3: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5);
|
|
183
|
+
--material-glass-bg: rgba(11, 13, 18, 0.78);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
@media (prefers-reduced-motion: reduce) {
|
|
188
|
+
:root {
|
|
189
|
+
--motion-duration-1: 0ms;
|
|
190
|
+
--motion-duration-2: 0ms;
|
|
191
|
+
--motion-duration-3: 0ms;
|
|
192
|
+
--motion-duration-4: 0ms;
|
|
193
|
+
--motion-spring-default-damping: 1;
|
|
194
|
+
--motion-spring-momentum-damping: 1;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
package/dist/tokens.d.ts
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
export declare const breakpoint: {
|
|
2
|
+
readonly sm: "40rem";
|
|
3
|
+
readonly md: "48rem";
|
|
4
|
+
readonly lg: "64rem";
|
|
5
|
+
readonly xl: "80rem";
|
|
6
|
+
/** Revised mock: "wide" tier at 1800px — wider page frame, larger gutters. */
|
|
7
|
+
readonly '2xl': "112.5rem";
|
|
8
|
+
};
|
|
9
|
+
export type BreakpointName = keyof typeof breakpoint;
|
|
10
|
+
declare const lightColor: {
|
|
11
|
+
readonly surface1: "#FBFAF8";
|
|
12
|
+
readonly surfaceRaised: "#FFFFFF";
|
|
13
|
+
readonly surface2: "#F4F2EE";
|
|
14
|
+
readonly surface3: "#ECE9E3";
|
|
15
|
+
readonly surfaceInput: "#FFFFFF";
|
|
16
|
+
readonly surfaceInverse: "#1C1917";
|
|
17
|
+
readonly text: "#1C1917";
|
|
18
|
+
readonly textMuted: "#57534E";
|
|
19
|
+
readonly textSubtle: "#6B6560";
|
|
20
|
+
readonly textInverse: "#FFFFFF";
|
|
21
|
+
readonly link: "#2F5FCC";
|
|
22
|
+
readonly accent: "#3B6FE0";
|
|
23
|
+
readonly accentHover: "#2F5FCC";
|
|
24
|
+
readonly accentText: "#FFFFFF";
|
|
25
|
+
readonly accentSoft: "rgba(59, 111, 224, 0.14)";
|
|
26
|
+
/** The remote-boundary frame fill: a wash far fainter than accentSoft (the mock's --rbg). */
|
|
27
|
+
readonly accentWash: "rgba(59, 111, 224, 0.035)";
|
|
28
|
+
readonly border: "rgba(28, 25, 23, 0.08)";
|
|
29
|
+
readonly borderStrong: "rgba(28, 25, 23, 0.18)";
|
|
30
|
+
readonly borderAccent: "rgba(59, 111, 224, 0.28)";
|
|
31
|
+
readonly cardBorder: "transparent";
|
|
32
|
+
readonly focus: "#3B6FE0";
|
|
33
|
+
readonly success: "#1F8A5B";
|
|
34
|
+
readonly warning: "#B7791F";
|
|
35
|
+
readonly danger: "#D23B3B";
|
|
36
|
+
readonly dangerSurface: "rgba(210, 59, 59, 0.06)";
|
|
37
|
+
readonly dangerBorder: "rgba(210, 59, 59, 0.35)";
|
|
38
|
+
readonly neutral: "#8A8580";
|
|
39
|
+
readonly chartPhase1: "#C9D6F5";
|
|
40
|
+
readonly chartPhase2: "#3B6FE0";
|
|
41
|
+
readonly chartPhase3: "#8FAAEB";
|
|
42
|
+
readonly chartPhase4: "#1F8A5B";
|
|
43
|
+
};
|
|
44
|
+
export type ColorName = keyof typeof lightColor;
|
|
45
|
+
export declare const themes: {
|
|
46
|
+
readonly light: {
|
|
47
|
+
readonly color: {
|
|
48
|
+
readonly surface1: "#FBFAF8";
|
|
49
|
+
readonly surfaceRaised: "#FFFFFF";
|
|
50
|
+
readonly surface2: "#F4F2EE";
|
|
51
|
+
readonly surface3: "#ECE9E3";
|
|
52
|
+
readonly surfaceInput: "#FFFFFF";
|
|
53
|
+
readonly surfaceInverse: "#1C1917";
|
|
54
|
+
readonly text: "#1C1917";
|
|
55
|
+
readonly textMuted: "#57534E";
|
|
56
|
+
readonly textSubtle: "#6B6560";
|
|
57
|
+
readonly textInverse: "#FFFFFF";
|
|
58
|
+
readonly link: "#2F5FCC";
|
|
59
|
+
readonly accent: "#3B6FE0";
|
|
60
|
+
readonly accentHover: "#2F5FCC";
|
|
61
|
+
readonly accentText: "#FFFFFF";
|
|
62
|
+
readonly accentSoft: "rgba(59, 111, 224, 0.14)";
|
|
63
|
+
/** The remote-boundary frame fill: a wash far fainter than accentSoft (the mock's --rbg). */
|
|
64
|
+
readonly accentWash: "rgba(59, 111, 224, 0.035)";
|
|
65
|
+
readonly border: "rgba(28, 25, 23, 0.08)";
|
|
66
|
+
readonly borderStrong: "rgba(28, 25, 23, 0.18)";
|
|
67
|
+
readonly borderAccent: "rgba(59, 111, 224, 0.28)";
|
|
68
|
+
readonly cardBorder: "transparent";
|
|
69
|
+
readonly focus: "#3B6FE0";
|
|
70
|
+
readonly success: "#1F8A5B";
|
|
71
|
+
readonly warning: "#B7791F";
|
|
72
|
+
readonly danger: "#D23B3B";
|
|
73
|
+
readonly dangerSurface: "rgba(210, 59, 59, 0.06)";
|
|
74
|
+
readonly dangerBorder: "rgba(210, 59, 59, 0.35)";
|
|
75
|
+
readonly neutral: "#8A8580";
|
|
76
|
+
readonly chartPhase1: "#C9D6F5";
|
|
77
|
+
readonly chartPhase2: "#3B6FE0";
|
|
78
|
+
readonly chartPhase3: "#8FAAEB";
|
|
79
|
+
readonly chartPhase4: "#1F8A5B";
|
|
80
|
+
};
|
|
81
|
+
readonly elevation: {
|
|
82
|
+
readonly 1: "0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05)";
|
|
83
|
+
readonly 2: "0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)";
|
|
84
|
+
readonly 3: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
85
|
+
};
|
|
86
|
+
readonly material: {
|
|
87
|
+
readonly glassBg: "rgba(251, 250, 248, 0.78)";
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
readonly dark: {
|
|
91
|
+
readonly color: {
|
|
92
|
+
readonly surface1: "#0B0D12";
|
|
93
|
+
readonly surfaceRaised: "#111420";
|
|
94
|
+
readonly surface2: "#171B28";
|
|
95
|
+
readonly surface3: "#1F2434";
|
|
96
|
+
readonly surfaceInput: "#171B28";
|
|
97
|
+
readonly surfaceInverse: "#EDEEF2";
|
|
98
|
+
readonly text: "#EDEEF2";
|
|
99
|
+
readonly textMuted: "#A8ADB8";
|
|
100
|
+
readonly textSubtle: "#8A909C";
|
|
101
|
+
readonly textInverse: "#0B0D12";
|
|
102
|
+
readonly link: "#9DB8F7";
|
|
103
|
+
readonly accent: "#7FA4F5";
|
|
104
|
+
readonly accentHover: "#98B6F8";
|
|
105
|
+
readonly accentText: "#0B0D12";
|
|
106
|
+
readonly accentSoft: "rgba(127, 164, 245, 0.18)";
|
|
107
|
+
readonly accentWash: "rgba(127, 164, 245, 0.05)";
|
|
108
|
+
readonly border: "rgba(255, 255, 255, 0.08)";
|
|
109
|
+
readonly borderStrong: "rgba(255, 255, 255, 0.18)";
|
|
110
|
+
readonly borderAccent: "rgba(127, 164, 245, 0.32)";
|
|
111
|
+
readonly cardBorder: "rgba(255, 255, 255, 0.08)";
|
|
112
|
+
readonly focus: "#7FA4F5";
|
|
113
|
+
readonly success: "#4FC38A";
|
|
114
|
+
readonly warning: "#E0B04A";
|
|
115
|
+
readonly danger: "#F07070";
|
|
116
|
+
readonly dangerSurface: "rgba(240, 112, 112, 0.10)";
|
|
117
|
+
readonly dangerBorder: "rgba(240, 112, 112, 0.35)";
|
|
118
|
+
readonly neutral: "#6B7280";
|
|
119
|
+
readonly chartPhase1: "#2B3652";
|
|
120
|
+
readonly chartPhase2: "#7FA4F5";
|
|
121
|
+
readonly chartPhase3: "#4E6BB0";
|
|
122
|
+
readonly chartPhase4: "#4FC38A";
|
|
123
|
+
};
|
|
124
|
+
readonly elevation: {
|
|
125
|
+
readonly 1: "inset 0 1px 0 rgba(255, 255, 255, 0.06)";
|
|
126
|
+
readonly 2: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18)";
|
|
127
|
+
readonly 3: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5)";
|
|
128
|
+
};
|
|
129
|
+
readonly material: {
|
|
130
|
+
readonly glassBg: "rgba(11, 13, 18, 0.78)";
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
export type ThemeName = keyof typeof themes;
|
|
135
|
+
export declare const shared: {
|
|
136
|
+
readonly font: {
|
|
137
|
+
readonly sans: "\"Geist Variable\", \"Geist\", -apple-system, \"SF Pro Display\", \"Segoe UI\", Helvetica, Arial, sans-serif";
|
|
138
|
+
readonly mono: "\"Geist Mono Variable\", \"Geist Mono\", ui-monospace, \"SF Mono\", Menlo, Consolas, monospace";
|
|
139
|
+
};
|
|
140
|
+
readonly text: {
|
|
141
|
+
readonly '2xs': "0.6875rem";
|
|
142
|
+
readonly xs: "0.75rem";
|
|
143
|
+
readonly sm: "0.875rem";
|
|
144
|
+
readonly md: "1rem";
|
|
145
|
+
readonly lg: "1.125rem";
|
|
146
|
+
readonly xl: "clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem)";
|
|
147
|
+
readonly statement: "clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem)";
|
|
148
|
+
readonly h3: "1.25rem";
|
|
149
|
+
readonly h2Feature: "1.75rem";
|
|
150
|
+
readonly h2: "clamp(1.875rem, 1.6rem + 1.25vw, 2.5rem)";
|
|
151
|
+
readonly h1: "clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem)";
|
|
152
|
+
/** The mock's --d1: 44–56px on phones, 72px on desktop; `displayWide` is its 88px wide tier. */
|
|
153
|
+
readonly display: "clamp(2.75rem, 2rem + 3.5vw, 4.5rem)";
|
|
154
|
+
readonly displayWide: "5.5rem";
|
|
155
|
+
};
|
|
156
|
+
readonly leading: {
|
|
157
|
+
readonly display: "1.05";
|
|
158
|
+
readonly tight: "1.15";
|
|
159
|
+
readonly snug: "1.3";
|
|
160
|
+
readonly prose: "1.55";
|
|
161
|
+
readonly body: "1.6";
|
|
162
|
+
};
|
|
163
|
+
readonly tracking: {
|
|
164
|
+
readonly display: "-0.03em";
|
|
165
|
+
readonly h1: "-0.025em";
|
|
166
|
+
readonly heading: "-0.015em";
|
|
167
|
+
readonly body: "0";
|
|
168
|
+
readonly wide: "0.08em";
|
|
169
|
+
};
|
|
170
|
+
readonly space: {
|
|
171
|
+
readonly 1: "0.25rem";
|
|
172
|
+
readonly 2: "0.5rem";
|
|
173
|
+
readonly 3: "0.75rem";
|
|
174
|
+
readonly 4: "1rem";
|
|
175
|
+
readonly 5: "1.5rem";
|
|
176
|
+
readonly 6: "2rem";
|
|
177
|
+
readonly 7: "3rem";
|
|
178
|
+
readonly 8: "4rem";
|
|
179
|
+
readonly 9: "6rem";
|
|
180
|
+
readonly 10: "8rem";
|
|
181
|
+
/** Page side padding at the wide tier: the mock's clamp(64px, 5vw, 128px). */
|
|
182
|
+
readonly pageInlineWide: "clamp(4rem, 5vw, 8rem)";
|
|
183
|
+
};
|
|
184
|
+
readonly radius: {
|
|
185
|
+
readonly sm: "0.5rem";
|
|
186
|
+
readonly md: "0.625rem";
|
|
187
|
+
readonly lg: "0.75rem";
|
|
188
|
+
readonly xl: "1rem";
|
|
189
|
+
readonly full: "999px";
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Border widths above the hairline default: `emphasis` is the active/selected indicator
|
|
193
|
+
* (nav underline, selected tab), `strong` the accent rail down the side of a block.
|
|
194
|
+
*/
|
|
195
|
+
readonly borderWidth: {
|
|
196
|
+
readonly emphasis: "2px";
|
|
197
|
+
readonly strong: "3px";
|
|
198
|
+
};
|
|
199
|
+
readonly motion: {
|
|
200
|
+
readonly duration: {
|
|
201
|
+
readonly 1: "120ms";
|
|
202
|
+
readonly 2: "200ms";
|
|
203
|
+
readonly 3: "320ms";
|
|
204
|
+
readonly 4: "520ms";
|
|
205
|
+
};
|
|
206
|
+
readonly ease: "cubic-bezier(0.2, 0, 0, 1)";
|
|
207
|
+
readonly springDefaultDamping: "0.8";
|
|
208
|
+
readonly springDefaultResponse: "0.35";
|
|
209
|
+
readonly springMomentumDamping: "0.8";
|
|
210
|
+
readonly springMomentumResponse: "0.35";
|
|
211
|
+
};
|
|
212
|
+
readonly material: {
|
|
213
|
+
readonly glassBlur: "blur(20px) saturate(1.4)";
|
|
214
|
+
};
|
|
215
|
+
readonly size: {
|
|
216
|
+
readonly touch: "44px";
|
|
217
|
+
/** Sticky header height: the mock's --hh (64px desktop, 72px at the wide tier). */
|
|
218
|
+
readonly header: "4rem";
|
|
219
|
+
readonly headerWide: "4.5rem";
|
|
220
|
+
/** Page frame max width: the mock's 1200px column. */
|
|
221
|
+
readonly pageMax: "75rem";
|
|
222
|
+
/** Page frame max width at the wide tier: the mock's min(1800px, 90vw). */
|
|
223
|
+
readonly pageMaxWide: "min(112.5rem, 90vw)";
|
|
224
|
+
};
|
|
225
|
+
readonly measure: "65ch";
|
|
226
|
+
readonly focusRingWidth: "2px";
|
|
227
|
+
readonly focusRingOffset: "2px";
|
|
228
|
+
};
|
|
229
|
+
/** Text roles on the surfaces they sit on: must meet WCAG AA 4.5:1 in every theme. */
|
|
230
|
+
export declare const textContrastPairs: ReadonlyArray<readonly [ColorName, ColorName]>;
|
|
231
|
+
/** Non-text UI roles (fills, dots, rings) on the surfaces they sit on: WCAG 1.4.11 asks 3:1. */
|
|
232
|
+
export declare const uiContrastPairs: ReadonlyArray<readonly [ColorName, ColorName]>;
|
|
233
|
+
export declare const tokens: {
|
|
234
|
+
readonly breakpoint: {
|
|
235
|
+
readonly sm: "40rem";
|
|
236
|
+
readonly md: "48rem";
|
|
237
|
+
readonly lg: "64rem";
|
|
238
|
+
readonly xl: "80rem";
|
|
239
|
+
/** Revised mock: "wide" tier at 1800px — wider page frame, larger gutters. */
|
|
240
|
+
readonly '2xl': "112.5rem";
|
|
241
|
+
};
|
|
242
|
+
readonly themes: {
|
|
243
|
+
readonly light: {
|
|
244
|
+
readonly color: {
|
|
245
|
+
readonly surface1: "#FBFAF8";
|
|
246
|
+
readonly surfaceRaised: "#FFFFFF";
|
|
247
|
+
readonly surface2: "#F4F2EE";
|
|
248
|
+
readonly surface3: "#ECE9E3";
|
|
249
|
+
readonly surfaceInput: "#FFFFFF";
|
|
250
|
+
readonly surfaceInverse: "#1C1917";
|
|
251
|
+
readonly text: "#1C1917";
|
|
252
|
+
readonly textMuted: "#57534E";
|
|
253
|
+
readonly textSubtle: "#6B6560";
|
|
254
|
+
readonly textInverse: "#FFFFFF";
|
|
255
|
+
readonly link: "#2F5FCC";
|
|
256
|
+
readonly accent: "#3B6FE0";
|
|
257
|
+
readonly accentHover: "#2F5FCC";
|
|
258
|
+
readonly accentText: "#FFFFFF";
|
|
259
|
+
readonly accentSoft: "rgba(59, 111, 224, 0.14)";
|
|
260
|
+
/** The remote-boundary frame fill: a wash far fainter than accentSoft (the mock's --rbg). */
|
|
261
|
+
readonly accentWash: "rgba(59, 111, 224, 0.035)";
|
|
262
|
+
readonly border: "rgba(28, 25, 23, 0.08)";
|
|
263
|
+
readonly borderStrong: "rgba(28, 25, 23, 0.18)";
|
|
264
|
+
readonly borderAccent: "rgba(59, 111, 224, 0.28)";
|
|
265
|
+
readonly cardBorder: "transparent";
|
|
266
|
+
readonly focus: "#3B6FE0";
|
|
267
|
+
readonly success: "#1F8A5B";
|
|
268
|
+
readonly warning: "#B7791F";
|
|
269
|
+
readonly danger: "#D23B3B";
|
|
270
|
+
readonly dangerSurface: "rgba(210, 59, 59, 0.06)";
|
|
271
|
+
readonly dangerBorder: "rgba(210, 59, 59, 0.35)";
|
|
272
|
+
readonly neutral: "#8A8580";
|
|
273
|
+
readonly chartPhase1: "#C9D6F5";
|
|
274
|
+
readonly chartPhase2: "#3B6FE0";
|
|
275
|
+
readonly chartPhase3: "#8FAAEB";
|
|
276
|
+
readonly chartPhase4: "#1F8A5B";
|
|
277
|
+
};
|
|
278
|
+
readonly elevation: {
|
|
279
|
+
readonly 1: "0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05)";
|
|
280
|
+
readonly 2: "0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)";
|
|
281
|
+
readonly 3: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
282
|
+
};
|
|
283
|
+
readonly material: {
|
|
284
|
+
readonly glassBg: "rgba(251, 250, 248, 0.78)";
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
readonly dark: {
|
|
288
|
+
readonly color: {
|
|
289
|
+
readonly surface1: "#0B0D12";
|
|
290
|
+
readonly surfaceRaised: "#111420";
|
|
291
|
+
readonly surface2: "#171B28";
|
|
292
|
+
readonly surface3: "#1F2434";
|
|
293
|
+
readonly surfaceInput: "#171B28";
|
|
294
|
+
readonly surfaceInverse: "#EDEEF2";
|
|
295
|
+
readonly text: "#EDEEF2";
|
|
296
|
+
readonly textMuted: "#A8ADB8";
|
|
297
|
+
readonly textSubtle: "#8A909C";
|
|
298
|
+
readonly textInverse: "#0B0D12";
|
|
299
|
+
readonly link: "#9DB8F7";
|
|
300
|
+
readonly accent: "#7FA4F5";
|
|
301
|
+
readonly accentHover: "#98B6F8";
|
|
302
|
+
readonly accentText: "#0B0D12";
|
|
303
|
+
readonly accentSoft: "rgba(127, 164, 245, 0.18)";
|
|
304
|
+
readonly accentWash: "rgba(127, 164, 245, 0.05)";
|
|
305
|
+
readonly border: "rgba(255, 255, 255, 0.08)";
|
|
306
|
+
readonly borderStrong: "rgba(255, 255, 255, 0.18)";
|
|
307
|
+
readonly borderAccent: "rgba(127, 164, 245, 0.32)";
|
|
308
|
+
readonly cardBorder: "rgba(255, 255, 255, 0.08)";
|
|
309
|
+
readonly focus: "#7FA4F5";
|
|
310
|
+
readonly success: "#4FC38A";
|
|
311
|
+
readonly warning: "#E0B04A";
|
|
312
|
+
readonly danger: "#F07070";
|
|
313
|
+
readonly dangerSurface: "rgba(240, 112, 112, 0.10)";
|
|
314
|
+
readonly dangerBorder: "rgba(240, 112, 112, 0.35)";
|
|
315
|
+
readonly neutral: "#6B7280";
|
|
316
|
+
readonly chartPhase1: "#2B3652";
|
|
317
|
+
readonly chartPhase2: "#7FA4F5";
|
|
318
|
+
readonly chartPhase3: "#4E6BB0";
|
|
319
|
+
readonly chartPhase4: "#4FC38A";
|
|
320
|
+
};
|
|
321
|
+
readonly elevation: {
|
|
322
|
+
readonly 1: "inset 0 1px 0 rgba(255, 255, 255, 0.06)";
|
|
323
|
+
readonly 2: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18)";
|
|
324
|
+
readonly 3: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5)";
|
|
325
|
+
};
|
|
326
|
+
readonly material: {
|
|
327
|
+
readonly glassBg: "rgba(11, 13, 18, 0.78)";
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
readonly shared: {
|
|
332
|
+
readonly font: {
|
|
333
|
+
readonly sans: "\"Geist Variable\", \"Geist\", -apple-system, \"SF Pro Display\", \"Segoe UI\", Helvetica, Arial, sans-serif";
|
|
334
|
+
readonly mono: "\"Geist Mono Variable\", \"Geist Mono\", ui-monospace, \"SF Mono\", Menlo, Consolas, monospace";
|
|
335
|
+
};
|
|
336
|
+
readonly text: {
|
|
337
|
+
readonly '2xs': "0.6875rem";
|
|
338
|
+
readonly xs: "0.75rem";
|
|
339
|
+
readonly sm: "0.875rem";
|
|
340
|
+
readonly md: "1rem";
|
|
341
|
+
readonly lg: "1.125rem";
|
|
342
|
+
readonly xl: "clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem)";
|
|
343
|
+
readonly statement: "clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem)";
|
|
344
|
+
readonly h3: "1.25rem";
|
|
345
|
+
readonly h2Feature: "1.75rem";
|
|
346
|
+
readonly h2: "clamp(1.875rem, 1.6rem + 1.25vw, 2.5rem)";
|
|
347
|
+
readonly h1: "clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem)";
|
|
348
|
+
/** The mock's --d1: 44–56px on phones, 72px on desktop; `displayWide` is its 88px wide tier. */
|
|
349
|
+
readonly display: "clamp(2.75rem, 2rem + 3.5vw, 4.5rem)";
|
|
350
|
+
readonly displayWide: "5.5rem";
|
|
351
|
+
};
|
|
352
|
+
readonly leading: {
|
|
353
|
+
readonly display: "1.05";
|
|
354
|
+
readonly tight: "1.15";
|
|
355
|
+
readonly snug: "1.3";
|
|
356
|
+
readonly prose: "1.55";
|
|
357
|
+
readonly body: "1.6";
|
|
358
|
+
};
|
|
359
|
+
readonly tracking: {
|
|
360
|
+
readonly display: "-0.03em";
|
|
361
|
+
readonly h1: "-0.025em";
|
|
362
|
+
readonly heading: "-0.015em";
|
|
363
|
+
readonly body: "0";
|
|
364
|
+
readonly wide: "0.08em";
|
|
365
|
+
};
|
|
366
|
+
readonly space: {
|
|
367
|
+
readonly 1: "0.25rem";
|
|
368
|
+
readonly 2: "0.5rem";
|
|
369
|
+
readonly 3: "0.75rem";
|
|
370
|
+
readonly 4: "1rem";
|
|
371
|
+
readonly 5: "1.5rem";
|
|
372
|
+
readonly 6: "2rem";
|
|
373
|
+
readonly 7: "3rem";
|
|
374
|
+
readonly 8: "4rem";
|
|
375
|
+
readonly 9: "6rem";
|
|
376
|
+
readonly 10: "8rem";
|
|
377
|
+
/** Page side padding at the wide tier: the mock's clamp(64px, 5vw, 128px). */
|
|
378
|
+
readonly pageInlineWide: "clamp(4rem, 5vw, 8rem)";
|
|
379
|
+
};
|
|
380
|
+
readonly radius: {
|
|
381
|
+
readonly sm: "0.5rem";
|
|
382
|
+
readonly md: "0.625rem";
|
|
383
|
+
readonly lg: "0.75rem";
|
|
384
|
+
readonly xl: "1rem";
|
|
385
|
+
readonly full: "999px";
|
|
386
|
+
};
|
|
387
|
+
/**
|
|
388
|
+
* Border widths above the hairline default: `emphasis` is the active/selected indicator
|
|
389
|
+
* (nav underline, selected tab), `strong` the accent rail down the side of a block.
|
|
390
|
+
*/
|
|
391
|
+
readonly borderWidth: {
|
|
392
|
+
readonly emphasis: "2px";
|
|
393
|
+
readonly strong: "3px";
|
|
394
|
+
};
|
|
395
|
+
readonly motion: {
|
|
396
|
+
readonly duration: {
|
|
397
|
+
readonly 1: "120ms";
|
|
398
|
+
readonly 2: "200ms";
|
|
399
|
+
readonly 3: "320ms";
|
|
400
|
+
readonly 4: "520ms";
|
|
401
|
+
};
|
|
402
|
+
readonly ease: "cubic-bezier(0.2, 0, 0, 1)";
|
|
403
|
+
readonly springDefaultDamping: "0.8";
|
|
404
|
+
readonly springDefaultResponse: "0.35";
|
|
405
|
+
readonly springMomentumDamping: "0.8";
|
|
406
|
+
readonly springMomentumResponse: "0.35";
|
|
407
|
+
};
|
|
408
|
+
readonly material: {
|
|
409
|
+
readonly glassBlur: "blur(20px) saturate(1.4)";
|
|
410
|
+
};
|
|
411
|
+
readonly size: {
|
|
412
|
+
readonly touch: "44px";
|
|
413
|
+
/** Sticky header height: the mock's --hh (64px desktop, 72px at the wide tier). */
|
|
414
|
+
readonly header: "4rem";
|
|
415
|
+
readonly headerWide: "4.5rem";
|
|
416
|
+
/** Page frame max width: the mock's 1200px column. */
|
|
417
|
+
readonly pageMax: "75rem";
|
|
418
|
+
/** Page frame max width at the wide tier: the mock's min(1800px, 90vw). */
|
|
419
|
+
readonly pageMaxWide: "min(112.5rem, 90vw)";
|
|
420
|
+
};
|
|
421
|
+
readonly measure: "65ch";
|
|
422
|
+
readonly focusRingWidth: "2px";
|
|
423
|
+
readonly focusRingOffset: "2px";
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
export type Tokens = typeof tokens;
|
|
427
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@calcifer-design/tokens",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/juansrodz/calcifer-design.git",
|
|
9
|
+
"directory": "packages/tokens"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://juansrodz.github.io/calcifer-design/",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"./dist/tokens.css"
|
|
20
|
+
],
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./tokens.css": "./dist/tokens.css"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "rslib build && bun scripts/write-css.ts",
|
|
30
|
+
"dev": "bun scripts/dev.ts",
|
|
31
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
32
|
+
"test": "vitest run",
|
|
33
|
+
"test:dist": "vitest run --config vitest.dist.config.ts"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@calcifer-design/tsconfig": "0.0.0",
|
|
37
|
+
"@rslib/core": "1.0.0",
|
|
38
|
+
"fast-glob": "^3.3.3"
|
|
39
|
+
}
|
|
40
|
+
}
|