@calcifer-design/tokens 0.2.0 → 0.3.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/custom-property-scan.d.ts +4 -0
- package/dist/generate.d.ts +14 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.js +419 -47
- package/dist/theme-contrast.d.ts +26 -0
- package/dist/theme.d.ts +61 -0
- package/dist/tokens.css +147 -0
- package/dist/tokens.d.ts +291 -0
- package/package.json +2 -2
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Every `var(--name…)` read in `css` whose name is not in `defined`, deduplicated and sorted. */
|
|
2
|
+
export declare function findUnknownCustomProperties(css: string, defined: ReadonlySet<string>): string[];
|
|
3
|
+
/** Every `--name:` declaration in `css` (a generated sheet or a stylesheet). */
|
|
4
|
+
export declare function customPropertyNamesOf(css: string): Set<string>;
|
package/dist/generate.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Theme, TokenValues } from './theme.js';
|
|
2
|
+
import type { SharedTokens, ThemeTokens, Tokens } from './tokens.js';
|
|
2
3
|
export declare function toKebab(name: string): string;
|
|
4
|
+
/** The mode-independent declarations, one per line, without `color-scheme`. */
|
|
5
|
+
export declare function sharedLinesOf(shared: TokenValues<SharedTokens> | SharedTokens): string[];
|
|
6
|
+
/** One mode's declarations, one per line, without `color-scheme`. */
|
|
7
|
+
export declare function modeLinesOf(mode: TokenValues<ThemeTokens> | ThemeTokens): string[];
|
|
8
|
+
/** The declarations that stop motion under `prefers-reduced-motion`: zero durations, critically damped springs. */
|
|
9
|
+
export declare function reducedMotionLinesOf(shared: TokenValues<SharedTokens> | SharedTokens): string[];
|
|
3
10
|
export declare function tokensToCss(tokens: Tokens): string;
|
|
11
|
+
/**
|
|
12
|
+
* The complete stylesheet for one brand, scoped to its class: the whole shared set and the light
|
|
13
|
+
* mode on the scope, the dark mode under the host's `data-theme`, the OS preference and a pin on the
|
|
14
|
+
* scope element, and reduced motion. Custom tokens ride in the blocks of their mode.
|
|
15
|
+
*/
|
|
16
|
+
export declare function themeToCss(theme: Theme): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
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';
|
|
2
|
+
export type { BreakpointName, ColorName, ElevationName, FontName, FontWeightName, RadiusName, ShadowName, SharedTokens, SizeName, TextSizeName, ThemeName, ThemeTokens, Tokens, } from './tokens.js';
|
|
3
|
+
export { themeToCss, tokensToCss, toKebab } from './generate.js';
|
|
4
4
|
export { contrastRatio, relativeLuminance } from './contrast.js';
|
|
5
5
|
export { findWidthQueryViolations } from './breakpoint-scan.js';
|
|
6
|
+
export { customPropertyNamesOf, findUnknownCustomProperties } from './custom-property-scan.js';
|
|
7
|
+
export { defineTheme, themeBrand } from './theme.js';
|
|
8
|
+
export type { ContrastPair, CustomNameOf, CustomTokens, NoExtraKeys, Theme, ThemeDefinition, TokenOverrides, TokenValues, } from './theme.js';
|
|
9
|
+
export { checkThemeContrast } from './theme-contrast.js';
|
|
10
|
+
export type { ContrastViolation, ExtraContrastPairs } from './theme-contrast.js';
|
package/dist/index.js
CHANGED
|
@@ -37,7 +37,39 @@ const lightColor = {
|
|
|
37
37
|
chartPhase1: '#C9D6F5',
|
|
38
38
|
chartPhase2: '#3B6FE0',
|
|
39
39
|
chartPhase3: '#8FAAEB',
|
|
40
|
-
chartPhase4: '#1F8A5B'
|
|
40
|
+
chartPhase4: '#1F8A5B',
|
|
41
|
+
selected: '#3B6FE0',
|
|
42
|
+
selectedText: '#FFFFFF',
|
|
43
|
+
selectedSoft: 'rgba(59, 111, 224, 0.14)',
|
|
44
|
+
selectedSoftText: '#1C1917',
|
|
45
|
+
inverse: '#1C1917',
|
|
46
|
+
inverseText: '#FFFFFF',
|
|
47
|
+
inverseSoft: 'rgba(255, 255, 255, 0.22)',
|
|
48
|
+
inverseSoftText: '#FFFFFF',
|
|
49
|
+
navText: '#57534E',
|
|
50
|
+
navSelected: 'transparent',
|
|
51
|
+
navSelectedText: '#1C1917',
|
|
52
|
+
tabBar: '#FFFFFF',
|
|
53
|
+
tabBarText: '#57534E',
|
|
54
|
+
tabBarActive: '#3B6FE0',
|
|
55
|
+
tabBarActiveText: '#FFFFFF',
|
|
56
|
+
sheetHandle: 'rgba(28, 25, 23, 0.18)',
|
|
57
|
+
segmentedTrack: '#F4F2EE',
|
|
58
|
+
segmentedBorder: 'rgba(28, 25, 23, 0.18)',
|
|
59
|
+
scrimSheet: 'rgba(28, 25, 23, 0.45)',
|
|
60
|
+
avatarRing: '#FFFFFF',
|
|
61
|
+
avatarFill1: '#ECE9E3',
|
|
62
|
+
avatarFill2: '#ECE9E3',
|
|
63
|
+
avatarFill3: '#ECE9E3',
|
|
64
|
+
avatarFill4: '#ECE9E3',
|
|
65
|
+
avatarFill5: '#ECE9E3',
|
|
66
|
+
avatarFill6: '#ECE9E3',
|
|
67
|
+
avatarInk1: '#57534E',
|
|
68
|
+
avatarInk2: '#57534E',
|
|
69
|
+
avatarInk3: '#57534E',
|
|
70
|
+
avatarInk4: '#57534E',
|
|
71
|
+
avatarInk5: '#57534E',
|
|
72
|
+
avatarInk6: '#57534E'
|
|
41
73
|
};
|
|
42
74
|
const darkColor = {
|
|
43
75
|
surface1: '#0B0D12',
|
|
@@ -71,36 +103,114 @@ const darkColor = {
|
|
|
71
103
|
chartPhase1: '#2B3652',
|
|
72
104
|
chartPhase2: '#7FA4F5',
|
|
73
105
|
chartPhase3: '#4E6BB0',
|
|
74
|
-
chartPhase4: '#4FC38A'
|
|
106
|
+
chartPhase4: '#4FC38A',
|
|
107
|
+
selected: '#7FA4F5',
|
|
108
|
+
selectedText: '#0B0D12',
|
|
109
|
+
selectedSoft: 'rgba(127, 164, 245, 0.18)',
|
|
110
|
+
selectedSoftText: '#EDEEF2',
|
|
111
|
+
inverse: '#EDEEF2',
|
|
112
|
+
inverseText: '#0B0D12',
|
|
113
|
+
inverseSoft: 'rgba(11, 13, 18, 0.22)',
|
|
114
|
+
inverseSoftText: '#0B0D12',
|
|
115
|
+
navText: '#A8ADB8',
|
|
116
|
+
navSelected: 'transparent',
|
|
117
|
+
navSelectedText: '#EDEEF2',
|
|
118
|
+
tabBar: '#111420',
|
|
119
|
+
tabBarText: '#A8ADB8',
|
|
120
|
+
tabBarActive: '#7FA4F5',
|
|
121
|
+
tabBarActiveText: '#0B0D12',
|
|
122
|
+
sheetHandle: 'rgba(255, 255, 255, 0.18)',
|
|
123
|
+
segmentedTrack: '#171B28',
|
|
124
|
+
segmentedBorder: 'rgba(255, 255, 255, 0.18)',
|
|
125
|
+
scrimSheet: 'rgba(3, 4, 6, 0.6)',
|
|
126
|
+
avatarRing: '#111420',
|
|
127
|
+
avatarFill1: '#1F2434',
|
|
128
|
+
avatarFill2: '#1F2434',
|
|
129
|
+
avatarFill3: '#1F2434',
|
|
130
|
+
avatarFill4: '#1F2434',
|
|
131
|
+
avatarFill5: '#1F2434',
|
|
132
|
+
avatarFill6: '#1F2434',
|
|
133
|
+
avatarInk1: '#A8ADB8',
|
|
134
|
+
avatarInk2: '#A8ADB8',
|
|
135
|
+
avatarInk3: '#A8ADB8',
|
|
136
|
+
avatarInk4: '#A8ADB8',
|
|
137
|
+
avatarInk5: '#A8ADB8',
|
|
138
|
+
avatarInk6: '#A8ADB8'
|
|
139
|
+
};
|
|
140
|
+
const lightElevation = {
|
|
141
|
+
1: '0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05)',
|
|
142
|
+
2: '0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)',
|
|
143
|
+
3: '0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)'
|
|
144
|
+
};
|
|
145
|
+
const darkElevation = {
|
|
146
|
+
1: 'inset 0 1px 0 rgba(255, 255, 255, 0.06)',
|
|
147
|
+
2: 'inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18)',
|
|
148
|
+
3: 'inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5)'
|
|
149
|
+
};
|
|
150
|
+
const lightShadow = {
|
|
151
|
+
soft: lightElevation[1],
|
|
152
|
+
chip: lightElevation[1],
|
|
153
|
+
raised: lightElevation[2],
|
|
154
|
+
dialog: lightElevation[3],
|
|
155
|
+
drawer: lightElevation[3],
|
|
156
|
+
sheet: lightElevation[3],
|
|
157
|
+
tabBar: lightElevation[2],
|
|
158
|
+
action: 'none',
|
|
159
|
+
actionInverse: 'none',
|
|
160
|
+
segmented: 'none'
|
|
161
|
+
};
|
|
162
|
+
const darkShadow = {
|
|
163
|
+
soft: darkElevation[1],
|
|
164
|
+
chip: darkElevation[1],
|
|
165
|
+
raised: darkElevation[2],
|
|
166
|
+
dialog: darkElevation[3],
|
|
167
|
+
drawer: darkElevation[3],
|
|
168
|
+
sheet: darkElevation[3],
|
|
169
|
+
tabBar: darkElevation[2],
|
|
170
|
+
action: 'none',
|
|
171
|
+
actionInverse: 'none',
|
|
172
|
+
segmented: 'none'
|
|
75
173
|
};
|
|
76
174
|
const themes = {
|
|
77
175
|
light: {
|
|
78
176
|
color: lightColor,
|
|
79
|
-
elevation:
|
|
80
|
-
|
|
81
|
-
2: '0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)',
|
|
82
|
-
3: '0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)'
|
|
83
|
-
},
|
|
177
|
+
elevation: lightElevation,
|
|
178
|
+
shadow: lightShadow,
|
|
84
179
|
material: {
|
|
85
180
|
glassBg: 'rgba(251, 250, 248, 0.78)'
|
|
86
181
|
}
|
|
87
182
|
},
|
|
88
183
|
dark: {
|
|
89
184
|
color: darkColor,
|
|
90
|
-
elevation:
|
|
91
|
-
|
|
92
|
-
2: 'inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18)',
|
|
93
|
-
3: 'inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5)'
|
|
94
|
-
},
|
|
185
|
+
elevation: darkElevation,
|
|
186
|
+
shadow: darkShadow,
|
|
95
187
|
material: {
|
|
96
188
|
glassBg: 'rgba(11, 13, 18, 0.78)'
|
|
97
189
|
}
|
|
98
190
|
}
|
|
99
191
|
};
|
|
100
|
-
const
|
|
192
|
+
const sansStack = '"Geist Variable", "Geist", -apple-system, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif';
|
|
193
|
+
const tokens_shared = {
|
|
101
194
|
font: {
|
|
102
|
-
sans:
|
|
103
|
-
mono: '"Geist Mono Variable", "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace'
|
|
195
|
+
sans: sansStack,
|
|
196
|
+
mono: '"Geist Mono Variable", "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace',
|
|
197
|
+
display: sansStack,
|
|
198
|
+
body: sansStack
|
|
199
|
+
},
|
|
200
|
+
fontWeight: {
|
|
201
|
+
body: '400',
|
|
202
|
+
label: '500',
|
|
203
|
+
button: '500',
|
|
204
|
+
heading: '600',
|
|
205
|
+
nav: '400',
|
|
206
|
+
navSelected: '500',
|
|
207
|
+
display: '600'
|
|
208
|
+
},
|
|
209
|
+
fontStretch: {
|
|
210
|
+
display: 'normal'
|
|
211
|
+
},
|
|
212
|
+
textTransform: {
|
|
213
|
+
display: 'none'
|
|
104
214
|
},
|
|
105
215
|
text: {
|
|
106
216
|
'2xs': '0.6875rem',
|
|
@@ -149,7 +259,13 @@ const shared = {
|
|
|
149
259
|
md: '0.625rem',
|
|
150
260
|
lg: '0.75rem',
|
|
151
261
|
xl: '1rem',
|
|
152
|
-
full: '999px'
|
|
262
|
+
full: '999px',
|
|
263
|
+
control: '0.625rem',
|
|
264
|
+
option: '0.5rem',
|
|
265
|
+
panel: '0.625rem',
|
|
266
|
+
popup: '0.75rem',
|
|
267
|
+
card: '1rem',
|
|
268
|
+
dialog: '1rem'
|
|
153
269
|
},
|
|
154
270
|
borderWidth: {
|
|
155
271
|
emphasis: '2px',
|
|
@@ -176,7 +292,11 @@ const shared = {
|
|
|
176
292
|
header: '4rem',
|
|
177
293
|
headerWide: '4.5rem',
|
|
178
294
|
pageMax: '75rem',
|
|
179
|
-
pageMaxWide: 'min(112.5rem, 90vw)'
|
|
295
|
+
pageMaxWide: 'min(112.5rem, 90vw)',
|
|
296
|
+
drawer: '28rem',
|
|
297
|
+
control: '44px',
|
|
298
|
+
controlSm: '2.5rem',
|
|
299
|
+
close: '2.25rem'
|
|
180
300
|
},
|
|
181
301
|
measure: '65ch',
|
|
182
302
|
focusRingWidth: '2px',
|
|
@@ -258,6 +378,42 @@ const textContrastPairs = [
|
|
|
258
378
|
[
|
|
259
379
|
'textInverse',
|
|
260
380
|
'surfaceInverse'
|
|
381
|
+
],
|
|
382
|
+
[
|
|
383
|
+
'selectedText',
|
|
384
|
+
'selected'
|
|
385
|
+
],
|
|
386
|
+
[
|
|
387
|
+
'inverseText',
|
|
388
|
+
'inverse'
|
|
389
|
+
],
|
|
390
|
+
[
|
|
391
|
+
'tabBarActiveText',
|
|
392
|
+
'tabBarActive'
|
|
393
|
+
],
|
|
394
|
+
[
|
|
395
|
+
'avatarInk1',
|
|
396
|
+
'avatarFill1'
|
|
397
|
+
],
|
|
398
|
+
[
|
|
399
|
+
'avatarInk2',
|
|
400
|
+
'avatarFill2'
|
|
401
|
+
],
|
|
402
|
+
[
|
|
403
|
+
'avatarInk3',
|
|
404
|
+
'avatarFill3'
|
|
405
|
+
],
|
|
406
|
+
[
|
|
407
|
+
'avatarInk4',
|
|
408
|
+
'avatarFill4'
|
|
409
|
+
],
|
|
410
|
+
[
|
|
411
|
+
'avatarInk5',
|
|
412
|
+
'avatarFill5'
|
|
413
|
+
],
|
|
414
|
+
[
|
|
415
|
+
'avatarInk6',
|
|
416
|
+
'avatarFill6'
|
|
261
417
|
]
|
|
262
418
|
];
|
|
263
419
|
const uiContrastPairs = [
|
|
@@ -348,13 +504,85 @@ const uiContrastPairs = [
|
|
|
348
504
|
[
|
|
349
505
|
'neutral',
|
|
350
506
|
'surface2'
|
|
507
|
+
],
|
|
508
|
+
[
|
|
509
|
+
'selected',
|
|
510
|
+
'surface1'
|
|
511
|
+
],
|
|
512
|
+
[
|
|
513
|
+
'selected',
|
|
514
|
+
'surfaceRaised'
|
|
515
|
+
],
|
|
516
|
+
[
|
|
517
|
+
'tabBarText',
|
|
518
|
+
'tabBar'
|
|
351
519
|
]
|
|
352
520
|
];
|
|
353
521
|
const tokens_tokens = {
|
|
354
522
|
breakpoint: breakpoint,
|
|
355
523
|
themes: themes,
|
|
356
|
-
shared:
|
|
524
|
+
shared: tokens_shared
|
|
357
525
|
};
|
|
526
|
+
const themeBrand = Symbol('calcifer-design-theme');
|
|
527
|
+
const classNamePattern = /^[a-z][a-z0-9-]*$/;
|
|
528
|
+
const prefixPattern = /^[a-z][a-z0-9]*$/;
|
|
529
|
+
const libraryFamilyRoots = new Set([
|
|
530
|
+
...Object.keys(tokens_tokens.shared),
|
|
531
|
+
...Object.keys(tokens_tokens.themes.light)
|
|
532
|
+
].map((key)=>/^[a-z]+/.exec(key)?.[0] ?? key));
|
|
533
|
+
function isPlainTree(value) {
|
|
534
|
+
return 'object' == typeof value && null !== value && !Array.isArray(value);
|
|
535
|
+
}
|
|
536
|
+
function mergeTree(base, overrides) {
|
|
537
|
+
const overrideTree = isPlainTree(overrides) ? overrides : {};
|
|
538
|
+
const merged = {};
|
|
539
|
+
for (const [key, baseValue] of Object.entries(base)){
|
|
540
|
+
const override = Object.hasOwn(overrideTree, key) ? overrideTree[key] : void 0;
|
|
541
|
+
if (isPlainTree(baseValue)) merged[key] = mergeTree(baseValue, override);
|
|
542
|
+
else merged[key] = void 0 === override ? baseValue : override;
|
|
543
|
+
}
|
|
544
|
+
return merged;
|
|
545
|
+
}
|
|
546
|
+
function matchesPattern(value, pattern) {
|
|
547
|
+
return 'string' == typeof value && pattern.test(value);
|
|
548
|
+
}
|
|
549
|
+
function deepFreeze(value) {
|
|
550
|
+
if ('object' == typeof value && null !== value) {
|
|
551
|
+
for (const member of Object.values(value))deepFreeze(member);
|
|
552
|
+
Object.freeze(value);
|
|
553
|
+
}
|
|
554
|
+
return value;
|
|
555
|
+
}
|
|
556
|
+
function defineTheme(definition) {
|
|
557
|
+
const { className, custom, contrastExemptions } = definition;
|
|
558
|
+
if (!matchesPattern(className, classNamePattern)) throw new Error(`defineTheme: className "${className}" must match ${classNamePattern}`);
|
|
559
|
+
if (void 0 !== custom && !matchesPattern(custom.prefix, prefixPattern)) throw new Error(`defineTheme: custom.prefix "${custom.prefix}" must match ${prefixPattern}`);
|
|
560
|
+
if (void 0 !== custom && libraryFamilyRoots.has(custom.prefix)) throw new Error(`defineTheme: custom.prefix "${custom.prefix}" would shadow the library's --${custom.prefix}-* tokens`);
|
|
561
|
+
const theme = {
|
|
562
|
+
className,
|
|
563
|
+
shared: mergeTree(tokens_tokens.shared, definition.shared),
|
|
564
|
+
light: mergeTree(tokens_tokens.themes.light, definition.light),
|
|
565
|
+
dark: mergeTree(tokens_tokens.themes.dark, definition.dark),
|
|
566
|
+
custom: {
|
|
567
|
+
prefix: void 0 === custom ? null : custom.prefix,
|
|
568
|
+
shared: {
|
|
569
|
+
...custom?.shared
|
|
570
|
+
},
|
|
571
|
+
light: {
|
|
572
|
+
...custom?.light
|
|
573
|
+
},
|
|
574
|
+
dark: {
|
|
575
|
+
...custom?.dark
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
contrastExemptions: (contrastExemptions ?? []).map((pair)=>[
|
|
579
|
+
pair[0],
|
|
580
|
+
pair[1]
|
|
581
|
+
]),
|
|
582
|
+
[themeBrand]: true
|
|
583
|
+
};
|
|
584
|
+
return deepFreeze(theme);
|
|
585
|
+
}
|
|
358
586
|
function toKebab(name) {
|
|
359
587
|
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();
|
|
360
588
|
}
|
|
@@ -369,37 +597,55 @@ function block(selector, lines, indent = '') {
|
|
|
369
597
|
const body = lines.map((line)=>`${indent}${line}`).join('\n');
|
|
370
598
|
return `${indent}${selector} {\n${body}\n${indent}}`;
|
|
371
599
|
}
|
|
600
|
+
function sharedLinesOf(shared) {
|
|
601
|
+
const lines = [];
|
|
602
|
+
flatten('--font', shared.font, lines);
|
|
603
|
+
flatten('--font-weight', shared.fontWeight, lines);
|
|
604
|
+
flatten('--font-stretch', shared.fontStretch, lines);
|
|
605
|
+
flatten('--text-transform', shared.textTransform, lines);
|
|
606
|
+
flatten('--text', shared.text, lines);
|
|
607
|
+
flatten('--leading', shared.leading, lines);
|
|
608
|
+
flatten('--tracking', shared.tracking, lines);
|
|
609
|
+
flatten('--space', shared.space, lines);
|
|
610
|
+
flatten('--radius', shared.radius, lines);
|
|
611
|
+
flatten('--border-width', shared.borderWidth, lines);
|
|
612
|
+
flatten('--motion', shared.motion, lines);
|
|
613
|
+
flatten('--size', shared.size, lines);
|
|
614
|
+
flatten('--material', shared.material, lines);
|
|
615
|
+
lines.push(` --measure: ${shared.measure};`);
|
|
616
|
+
lines.push(` --focus-ring-width: ${shared.focusRingWidth};`);
|
|
617
|
+
lines.push(` --focus-ring-offset: ${shared.focusRingOffset};`);
|
|
618
|
+
return lines;
|
|
619
|
+
}
|
|
620
|
+
function modeLinesOf(mode) {
|
|
621
|
+
const lines = [];
|
|
622
|
+
flatten('--color', mode.color, lines);
|
|
623
|
+
flatten('--elevation', mode.elevation, lines);
|
|
624
|
+
flatten('--shadow', mode.shadow, lines);
|
|
625
|
+
flatten('--material', mode.material, lines);
|
|
626
|
+
return lines;
|
|
627
|
+
}
|
|
628
|
+
function reducedMotionLinesOf(shared) {
|
|
629
|
+
return [
|
|
630
|
+
...Object.keys(shared.motion.duration).map((step)=>` --motion-duration-${step}: 0ms;`),
|
|
631
|
+
' --motion-spring-default-damping: 1;',
|
|
632
|
+
' --motion-spring-momentum-damping: 1;'
|
|
633
|
+
];
|
|
634
|
+
}
|
|
635
|
+
function customLinesOf(prefix, values) {
|
|
636
|
+
const lines = [];
|
|
637
|
+
if (null !== prefix) flatten(`--${prefix}`, values, lines);
|
|
638
|
+
return lines;
|
|
639
|
+
}
|
|
372
640
|
function tokensToCss(tokens) {
|
|
373
641
|
const sharedLines = [
|
|
374
|
-
' color-scheme: light dark;'
|
|
642
|
+
' color-scheme: light dark;',
|
|
643
|
+
...sharedLinesOf(tokens.shared)
|
|
375
644
|
];
|
|
376
|
-
|
|
377
|
-
flatten('--text', tokens.shared.text, sharedLines);
|
|
378
|
-
flatten('--leading', tokens.shared.leading, sharedLines);
|
|
379
|
-
flatten('--tracking', tokens.shared.tracking, sharedLines);
|
|
380
|
-
flatten('--space', tokens.shared.space, sharedLines);
|
|
381
|
-
flatten('--radius', tokens.shared.radius, sharedLines);
|
|
382
|
-
flatten('--border-width', tokens.shared.borderWidth, sharedLines);
|
|
383
|
-
flatten('--motion', tokens.shared.motion, sharedLines);
|
|
384
|
-
flatten('--size', tokens.shared.size, sharedLines);
|
|
385
|
-
flatten('--material', tokens.shared.material, sharedLines);
|
|
386
|
-
sharedLines.push(` --measure: ${tokens.shared.measure};`);
|
|
387
|
-
sharedLines.push(` --focus-ring-width: ${tokens.shared.focusRingWidth};`);
|
|
388
|
-
sharedLines.push(` --focus-ring-offset: ${tokens.shared.focusRingOffset};`);
|
|
389
|
-
const lightLines = [];
|
|
390
|
-
flatten('--color', tokens.themes.light.color, lightLines);
|
|
391
|
-
flatten('--elevation', tokens.themes.light.elevation, lightLines);
|
|
392
|
-
flatten('--material', tokens.themes.light.material, lightLines);
|
|
645
|
+
const lightLines = modeLinesOf(tokens.themes.light);
|
|
393
646
|
const darkLines = [
|
|
394
|
-
' color-scheme: dark;'
|
|
395
|
-
|
|
396
|
-
flatten('--color', tokens.themes.dark.color, darkLines);
|
|
397
|
-
flatten('--elevation', tokens.themes.dark.elevation, darkLines);
|
|
398
|
-
flatten('--material', tokens.themes.dark.material, darkLines);
|
|
399
|
-
const reducedMotionLines = [
|
|
400
|
-
...Object.keys(tokens.shared.motion.duration).map((step)=>` --motion-duration-${step}: 0ms;`),
|
|
401
|
-
' --motion-spring-default-damping: 1;',
|
|
402
|
-
' --motion-spring-momentum-damping: 1;'
|
|
647
|
+
' color-scheme: dark;',
|
|
648
|
+
...modeLinesOf(tokens.themes.dark)
|
|
403
649
|
];
|
|
404
650
|
return [
|
|
405
651
|
'/* Generated from packages/tokens/src/tokens.ts. Do not edit. */',
|
|
@@ -412,10 +658,42 @@ function tokensToCss(tokens) {
|
|
|
412
658
|
' color-scheme: light;'
|
|
413
659
|
]),
|
|
414
660
|
`@media (prefers-color-scheme: dark) {\n${block(':root:not([data-theme="light"])', darkLines, ' ')}\n}`,
|
|
415
|
-
`@media (prefers-reduced-motion: reduce) {\n${block(':root',
|
|
661
|
+
`@media (prefers-reduced-motion: reduce) {\n${block(':root', reducedMotionLinesOf(tokens.shared), ' ')}\n}`,
|
|
416
662
|
''
|
|
417
663
|
].join('\n\n');
|
|
418
664
|
}
|
|
665
|
+
function themeToCss(theme) {
|
|
666
|
+
if (true !== theme[themeBrand]) throw new Error('themeToCss: not a theme made by defineTheme');
|
|
667
|
+
const scope = `.${theme.className}`;
|
|
668
|
+
const { prefix } = theme.custom;
|
|
669
|
+
const lightModeLines = modeLinesOf(theme.light);
|
|
670
|
+
const customLightLines = customLinesOf(prefix, theme.custom.light);
|
|
671
|
+
const darkLines = [
|
|
672
|
+
' color-scheme: dark;',
|
|
673
|
+
...modeLinesOf(theme.dark),
|
|
674
|
+
...customLinesOf(prefix, theme.custom.dark)
|
|
675
|
+
];
|
|
676
|
+
const sections = [
|
|
677
|
+
`/* Generated by @calcifer-design/tokens themeToCss for "${scope}". Do not edit. */`,
|
|
678
|
+
block(scope, [
|
|
679
|
+
' color-scheme: light;',
|
|
680
|
+
...sharedLinesOf(theme.shared),
|
|
681
|
+
...lightModeLines,
|
|
682
|
+
...customLinesOf(prefix, theme.custom.shared),
|
|
683
|
+
...customLightLines
|
|
684
|
+
]),
|
|
685
|
+
block(`:root[data-theme="dark"] ${scope}`, darkLines),
|
|
686
|
+
`@media (prefers-color-scheme: dark) {\n${block(`:root:not([data-theme="light"]) ${scope}`, darkLines, ' ')}\n}`,
|
|
687
|
+
block(`:root ${scope}[data-theme="light"]`, [
|
|
688
|
+
' color-scheme: light;',
|
|
689
|
+
...lightModeLines,
|
|
690
|
+
...customLightLines
|
|
691
|
+
]),
|
|
692
|
+
block(`:root ${scope}[data-theme="dark"]`, darkLines),
|
|
693
|
+
`@media (prefers-reduced-motion: reduce) {\n${block(scope, reducedMotionLinesOf(theme.shared), ' ')}\n}`
|
|
694
|
+
];
|
|
695
|
+
return `${sections.join('\n\n')}\n`;
|
|
696
|
+
}
|
|
419
697
|
function channelToLinear(channel) {
|
|
420
698
|
const scaled = channel / 255;
|
|
421
699
|
return scaled <= 0.04045 ? scaled / 12.92 : ((scaled + 0.055) / 1.055) ** 2.4;
|
|
@@ -454,4 +732,98 @@ function findWidthQueryViolations(css, allowedWidths) {
|
|
|
454
732
|
}
|
|
455
733
|
return violations;
|
|
456
734
|
}
|
|
457
|
-
|
|
735
|
+
const readPattern = /var\(\s*(--[A-Za-z0-9_-]+)/g;
|
|
736
|
+
const declarationPattern = /(?:^|[\s;{])(--[A-Za-z0-9_-]+)\s*:/g;
|
|
737
|
+
function findUnknownCustomProperties(css, defined) {
|
|
738
|
+
const unknownNames = new Set();
|
|
739
|
+
for (const match of css.matchAll(readPattern)){
|
|
740
|
+
const name = match[1] ?? '';
|
|
741
|
+
if (!defined.has(name)) unknownNames.add(name);
|
|
742
|
+
}
|
|
743
|
+
return [
|
|
744
|
+
...unknownNames
|
|
745
|
+
].sort();
|
|
746
|
+
}
|
|
747
|
+
function customPropertyNamesOf(css) {
|
|
748
|
+
const names = new Set();
|
|
749
|
+
for (const match of css.matchAll(declarationPattern))names.add(match[1] ?? '');
|
|
750
|
+
return names;
|
|
751
|
+
}
|
|
752
|
+
const hexPattern = /^#[0-9A-Fa-f]{6}$/;
|
|
753
|
+
const modes = [
|
|
754
|
+
'light',
|
|
755
|
+
'dark'
|
|
756
|
+
];
|
|
757
|
+
function isHex(value) {
|
|
758
|
+
return 'string' == typeof value && hexPattern.test(value);
|
|
759
|
+
}
|
|
760
|
+
function pairKey([foreground, background]) {
|
|
761
|
+
return `${foreground}/${background}`;
|
|
762
|
+
}
|
|
763
|
+
function checkThemeContrast(theme, extraPairs = {}) {
|
|
764
|
+
if (true !== theme[themeBrand]) throw new Error('checkThemeContrast: not a theme made by defineTheme');
|
|
765
|
+
const lists = [
|
|
766
|
+
{
|
|
767
|
+
pairs: textContrastPairs,
|
|
768
|
+
required: 4.5
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
pairs: extraPairs.text ?? [],
|
|
772
|
+
required: 4.5
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
pairs: uiContrastPairs,
|
|
776
|
+
required: 3
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
pairs: extraPairs.ui ?? [],
|
|
780
|
+
required: 3
|
|
781
|
+
}
|
|
782
|
+
];
|
|
783
|
+
const exemptKeys = new Set(theme.contrastExemptions.map(pairKey));
|
|
784
|
+
const listedKeys = new Set();
|
|
785
|
+
const violations = [];
|
|
786
|
+
for (const { pairs, required } of lists)for (const pair of pairs){
|
|
787
|
+
const key = pairKey(pair);
|
|
788
|
+
listedKeys.add(key);
|
|
789
|
+
if (exemptKeys.has(key)) continue;
|
|
790
|
+
const [foreground, background] = pair;
|
|
791
|
+
for (const mode of modes){
|
|
792
|
+
const foregroundColor = theme[mode].color[foreground];
|
|
793
|
+
const backgroundColor = theme[mode].color[background];
|
|
794
|
+
if (!isHex(foregroundColor) || !isHex(backgroundColor)) {
|
|
795
|
+
violations.push({
|
|
796
|
+
mode,
|
|
797
|
+
foreground,
|
|
798
|
+
background,
|
|
799
|
+
kind: 'not-hex',
|
|
800
|
+
ratio: null,
|
|
801
|
+
required
|
|
802
|
+
});
|
|
803
|
+
continue;
|
|
804
|
+
}
|
|
805
|
+
const ratio = contrastRatio(foregroundColor, backgroundColor);
|
|
806
|
+
if (ratio < required) violations.push({
|
|
807
|
+
mode,
|
|
808
|
+
foreground,
|
|
809
|
+
background,
|
|
810
|
+
kind: 'ratio',
|
|
811
|
+
ratio,
|
|
812
|
+
required
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
for (const exemption of theme.contrastExemptions)if (!listedKeys.has(pairKey(exemption))) {
|
|
817
|
+
const [foreground, background] = exemption;
|
|
818
|
+
violations.push({
|
|
819
|
+
mode: 'light',
|
|
820
|
+
foreground,
|
|
821
|
+
background,
|
|
822
|
+
kind: 'unknown-exemption',
|
|
823
|
+
ratio: null,
|
|
824
|
+
required: null
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
return violations;
|
|
828
|
+
}
|
|
829
|
+
export { breakpoint, checkThemeContrast, contrastRatio, customPropertyNamesOf, defineTheme, findUnknownCustomProperties, findWidthQueryViolations, relativeLuminance, textContrastPairs, themeBrand, themeToCss, themes, toKebab, tokensToCss, tokens_shared as shared, tokens_tokens as tokens, uiContrastPairs };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ContrastPair, Theme } from './theme.js';
|
|
2
|
+
import type { ColorName, ThemeName } from './tokens.js';
|
|
3
|
+
export interface ContrastViolation {
|
|
4
|
+
readonly mode: ThemeName;
|
|
5
|
+
readonly foreground: ColorName;
|
|
6
|
+
readonly background: ColorName;
|
|
7
|
+
/** `ratio` fell short; a colour is not an opaque six-digit hex; an exemption names no listed pair. */
|
|
8
|
+
readonly kind: 'ratio' | 'not-hex' | 'unknown-exemption';
|
|
9
|
+
/** `null` for `not-hex` and `unknown-exemption`. */
|
|
10
|
+
readonly ratio: number | null;
|
|
11
|
+
/** The list's floor (4.5 text, 3 ui); `null` for `unknown-exemption`. */
|
|
12
|
+
readonly required: 3 | 4.5 | null;
|
|
13
|
+
}
|
|
14
|
+
export interface ExtraContrastPairs {
|
|
15
|
+
readonly text?: ReadonlyArray<ContrastPair>;
|
|
16
|
+
readonly ui?: ReadonlyArray<ContrastPair>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Holds `theme` to the library's contrast pairs plus `extraPairs` (pairs only this theme's values
|
|
20
|
+
* make opaque), in both modes. Pairs in `theme.contrastExemptions` are skipped in both modes; an
|
|
21
|
+
* exemption naming no listed pair is reported, so it cannot outlive its pair.
|
|
22
|
+
*
|
|
23
|
+
* Order (L1-6): text pairs, `extraPairs.text`, ui pairs, `extraPairs.ui`; within a list each pair
|
|
24
|
+
* `light` then `dark`; `unknown-exemption` entries last, one per exemption.
|
|
25
|
+
*/
|
|
26
|
+
export declare function checkThemeContrast(theme: Theme, extraPairs?: ExtraContrastPairs): ContrastViolation[];
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ColorName, SharedTokens, ThemeTokens } from './tokens.js';
|
|
2
|
+
type Leaf = string | number;
|
|
3
|
+
/** Every leaf widened to `string`: the shape of a resolved theme. */
|
|
4
|
+
export type TokenValues<Tree> = {
|
|
5
|
+
readonly [Key in keyof Tree]: Tree[Key] extends Leaf ? string : TokenValues<Tree[Key]>;
|
|
6
|
+
};
|
|
7
|
+
/** Every node optional, every leaf a string: what a brand may override. */
|
|
8
|
+
export type TokenOverrides<Tree> = {
|
|
9
|
+
readonly [Key in keyof Tree]?: Tree[Key] extends Leaf ? string : TokenOverrides<Tree[Key]>;
|
|
10
|
+
};
|
|
11
|
+
/** Maps any key the shape lacks to `never`, recursively through objects (not arrays), so a spread object fails too. */
|
|
12
|
+
export type NoExtraKeys<Candidate, Shape> = {
|
|
13
|
+
readonly [Key in keyof Candidate]: Key extends keyof Shape ? Candidate[Key] extends readonly unknown[] ? Candidate[Key] : Candidate[Key] extends object ? NoExtraKeys<Candidate[Key], NonNullable<Shape[Key]>> : Candidate[Key] : never;
|
|
14
|
+
};
|
|
15
|
+
export type ContrastPair = readonly [ColorName, ColorName];
|
|
16
|
+
/**
|
|
17
|
+
* Brand-only tokens the library never reads, emitted as `--<prefix>-<kebab(name)>` in every block
|
|
18
|
+
* of the scoped sheet. `Name` is inferred from `light` AND `dark`, so a key present on one side and
|
|
19
|
+
* missing on the other does not compile.
|
|
20
|
+
*/
|
|
21
|
+
export interface CustomTokens<Name extends string> {
|
|
22
|
+
/** `/^[a-z][a-z0-9]*$/`: 'wbw' → `--wbw-…`. */
|
|
23
|
+
readonly prefix: string;
|
|
24
|
+
/** Mode-independent brand tokens (type steps, glows the modes share). */
|
|
25
|
+
readonly shared?: Readonly<Record<string, string>>;
|
|
26
|
+
readonly light: Readonly<Record<Name, string>>;
|
|
27
|
+
readonly dark: Readonly<Record<Name, string>>;
|
|
28
|
+
}
|
|
29
|
+
export interface ThemeDefinition<CustomName extends string = never> {
|
|
30
|
+
/** The scope class without the dot. `/^[a-z][a-z0-9-]*$/`, checked at runtime. */
|
|
31
|
+
readonly className: string;
|
|
32
|
+
readonly shared?: TokenOverrides<SharedTokens>;
|
|
33
|
+
readonly light?: TokenOverrides<ThemeTokens>;
|
|
34
|
+
readonly dark?: TokenOverrides<ThemeTokens>;
|
|
35
|
+
readonly custom?: CustomTokens<CustomName>;
|
|
36
|
+
/** Pairs from `textContrastPairs`/`uiContrastPairs`/`extraPairs` this brand keeps as drawn (Q2 b). */
|
|
37
|
+
readonly contrastExemptions?: ReadonlyArray<ContrastPair>;
|
|
38
|
+
}
|
|
39
|
+
export type CustomNameOf<Definition> = Definition extends {
|
|
40
|
+
readonly custom: CustomTokens<infer Name>;
|
|
41
|
+
} ? Name : never;
|
|
42
|
+
/** Exported (declaration emit needs it); `defineTheme` stamps it on every theme it returns. */
|
|
43
|
+
export declare const themeBrand: unique symbol;
|
|
44
|
+
/** The resolved theme: the complete token set with the brand's values laid over the defaults. */
|
|
45
|
+
export interface Theme<CustomName extends string = string> {
|
|
46
|
+
readonly className: string;
|
|
47
|
+
readonly shared: TokenValues<SharedTokens>;
|
|
48
|
+
readonly light: TokenValues<ThemeTokens>;
|
|
49
|
+
readonly dark: TokenValues<ThemeTokens>;
|
|
50
|
+
readonly custom: {
|
|
51
|
+
readonly prefix: string | null;
|
|
52
|
+
readonly shared: Readonly<Record<string, string>>;
|
|
53
|
+
readonly light: Readonly<Record<CustomName, string>>;
|
|
54
|
+
readonly dark: Readonly<Record<CustomName, string>>;
|
|
55
|
+
};
|
|
56
|
+
readonly contrastExemptions: ReadonlyArray<ContrastPair>;
|
|
57
|
+
/** Only `defineTheme` makes one: `ThemeScope` and `themeToCss` refuse a hand-written object. */
|
|
58
|
+
readonly [themeBrand]: true;
|
|
59
|
+
}
|
|
60
|
+
export declare function defineTheme<const Definition extends ThemeDefinition<string>>(definition: Definition & NoExtraKeys<Definition, ThemeDefinition<CustomNameOf<Definition>>>): Theme<CustomNameOf<Definition>>;
|
|
61
|
+
export {};
|
package/dist/tokens.css
CHANGED
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
color-scheme: light dark;
|
|
5
5
|
--font-sans: "Geist Variable", "Geist", -apple-system, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
|
|
6
6
|
--font-mono: "Geist Mono Variable", "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
|
|
7
|
+
--font-display: "Geist Variable", "Geist", -apple-system, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
|
|
8
|
+
--font-body: "Geist Variable", "Geist", -apple-system, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
|
|
9
|
+
--font-weight-body: 400;
|
|
10
|
+
--font-weight-label: 500;
|
|
11
|
+
--font-weight-button: 500;
|
|
12
|
+
--font-weight-heading: 600;
|
|
13
|
+
--font-weight-nav: 400;
|
|
14
|
+
--font-weight-nav-selected: 500;
|
|
15
|
+
--font-weight-display: 600;
|
|
16
|
+
--font-stretch-display: normal;
|
|
17
|
+
--text-transform-display: none;
|
|
7
18
|
--text-2xs: 0.6875rem;
|
|
8
19
|
--text-xs: 0.75rem;
|
|
9
20
|
--text-sm: 0.875rem;
|
|
@@ -43,6 +54,12 @@
|
|
|
43
54
|
--radius-lg: 0.75rem;
|
|
44
55
|
--radius-xl: 1rem;
|
|
45
56
|
--radius-full: 999px;
|
|
57
|
+
--radius-control: 0.625rem;
|
|
58
|
+
--radius-option: 0.5rem;
|
|
59
|
+
--radius-panel: 0.625rem;
|
|
60
|
+
--radius-popup: 0.75rem;
|
|
61
|
+
--radius-card: 1rem;
|
|
62
|
+
--radius-dialog: 1rem;
|
|
46
63
|
--border-width-emphasis: 2px;
|
|
47
64
|
--border-width-strong: 3px;
|
|
48
65
|
--motion-duration-1: 120ms;
|
|
@@ -59,6 +76,10 @@
|
|
|
59
76
|
--size-header-wide: 4.5rem;
|
|
60
77
|
--size-page-max: 75rem;
|
|
61
78
|
--size-page-max-wide: min(112.5rem, 90vw);
|
|
79
|
+
--size-drawer: 28rem;
|
|
80
|
+
--size-control: 44px;
|
|
81
|
+
--size-control-sm: 2.5rem;
|
|
82
|
+
--size-close: 2.25rem;
|
|
62
83
|
--material-glass-blur: blur(20px) saturate(1.4);
|
|
63
84
|
--measure: 65ch;
|
|
64
85
|
--focus-ring-width: 2px;
|
|
@@ -95,9 +116,51 @@
|
|
|
95
116
|
--color-chart-phase-2: #3B6FE0;
|
|
96
117
|
--color-chart-phase-3: #8FAAEB;
|
|
97
118
|
--color-chart-phase-4: #1F8A5B;
|
|
119
|
+
--color-selected: #3B6FE0;
|
|
120
|
+
--color-selected-text: #FFFFFF;
|
|
121
|
+
--color-selected-soft: rgba(59, 111, 224, 0.14);
|
|
122
|
+
--color-selected-soft-text: #1C1917;
|
|
123
|
+
--color-inverse: #1C1917;
|
|
124
|
+
--color-inverse-text: #FFFFFF;
|
|
125
|
+
--color-inverse-soft: rgba(255, 255, 255, 0.22);
|
|
126
|
+
--color-inverse-soft-text: #FFFFFF;
|
|
127
|
+
--color-nav-text: #57534E;
|
|
128
|
+
--color-nav-selected: transparent;
|
|
129
|
+
--color-nav-selected-text: #1C1917;
|
|
130
|
+
--color-tab-bar: #FFFFFF;
|
|
131
|
+
--color-tab-bar-text: #57534E;
|
|
132
|
+
--color-tab-bar-active: #3B6FE0;
|
|
133
|
+
--color-tab-bar-active-text: #FFFFFF;
|
|
134
|
+
--color-sheet-handle: rgba(28, 25, 23, 0.18);
|
|
135
|
+
--color-segmented-track: #F4F2EE;
|
|
136
|
+
--color-segmented-border: rgba(28, 25, 23, 0.18);
|
|
137
|
+
--color-scrim-sheet: rgba(28, 25, 23, 0.45);
|
|
138
|
+
--color-avatar-ring: #FFFFFF;
|
|
139
|
+
--color-avatar-fill-1: #ECE9E3;
|
|
140
|
+
--color-avatar-fill-2: #ECE9E3;
|
|
141
|
+
--color-avatar-fill-3: #ECE9E3;
|
|
142
|
+
--color-avatar-fill-4: #ECE9E3;
|
|
143
|
+
--color-avatar-fill-5: #ECE9E3;
|
|
144
|
+
--color-avatar-fill-6: #ECE9E3;
|
|
145
|
+
--color-avatar-ink-1: #57534E;
|
|
146
|
+
--color-avatar-ink-2: #57534E;
|
|
147
|
+
--color-avatar-ink-3: #57534E;
|
|
148
|
+
--color-avatar-ink-4: #57534E;
|
|
149
|
+
--color-avatar-ink-5: #57534E;
|
|
150
|
+
--color-avatar-ink-6: #57534E;
|
|
98
151
|
--elevation-1: 0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05);
|
|
99
152
|
--elevation-2: 0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08);
|
|
100
153
|
--elevation-3: 0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06);
|
|
154
|
+
--shadow-soft: 0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05);
|
|
155
|
+
--shadow-chip: 0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05);
|
|
156
|
+
--shadow-raised: 0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08);
|
|
157
|
+
--shadow-dialog: 0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06);
|
|
158
|
+
--shadow-drawer: 0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06);
|
|
159
|
+
--shadow-sheet: 0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06);
|
|
160
|
+
--shadow-tab-bar: 0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08);
|
|
161
|
+
--shadow-action: none;
|
|
162
|
+
--shadow-action-inverse: none;
|
|
163
|
+
--shadow-segmented: none;
|
|
101
164
|
--material-glass-bg: rgba(251, 250, 248, 0.78);
|
|
102
165
|
}
|
|
103
166
|
|
|
@@ -135,9 +198,51 @@
|
|
|
135
198
|
--color-chart-phase-2: #7FA4F5;
|
|
136
199
|
--color-chart-phase-3: #4E6BB0;
|
|
137
200
|
--color-chart-phase-4: #4FC38A;
|
|
201
|
+
--color-selected: #7FA4F5;
|
|
202
|
+
--color-selected-text: #0B0D12;
|
|
203
|
+
--color-selected-soft: rgba(127, 164, 245, 0.18);
|
|
204
|
+
--color-selected-soft-text: #EDEEF2;
|
|
205
|
+
--color-inverse: #EDEEF2;
|
|
206
|
+
--color-inverse-text: #0B0D12;
|
|
207
|
+
--color-inverse-soft: rgba(11, 13, 18, 0.22);
|
|
208
|
+
--color-inverse-soft-text: #0B0D12;
|
|
209
|
+
--color-nav-text: #A8ADB8;
|
|
210
|
+
--color-nav-selected: transparent;
|
|
211
|
+
--color-nav-selected-text: #EDEEF2;
|
|
212
|
+
--color-tab-bar: #111420;
|
|
213
|
+
--color-tab-bar-text: #A8ADB8;
|
|
214
|
+
--color-tab-bar-active: #7FA4F5;
|
|
215
|
+
--color-tab-bar-active-text: #0B0D12;
|
|
216
|
+
--color-sheet-handle: rgba(255, 255, 255, 0.18);
|
|
217
|
+
--color-segmented-track: #171B28;
|
|
218
|
+
--color-segmented-border: rgba(255, 255, 255, 0.18);
|
|
219
|
+
--color-scrim-sheet: rgba(3, 4, 6, 0.6);
|
|
220
|
+
--color-avatar-ring: #111420;
|
|
221
|
+
--color-avatar-fill-1: #1F2434;
|
|
222
|
+
--color-avatar-fill-2: #1F2434;
|
|
223
|
+
--color-avatar-fill-3: #1F2434;
|
|
224
|
+
--color-avatar-fill-4: #1F2434;
|
|
225
|
+
--color-avatar-fill-5: #1F2434;
|
|
226
|
+
--color-avatar-fill-6: #1F2434;
|
|
227
|
+
--color-avatar-ink-1: #A8ADB8;
|
|
228
|
+
--color-avatar-ink-2: #A8ADB8;
|
|
229
|
+
--color-avatar-ink-3: #A8ADB8;
|
|
230
|
+
--color-avatar-ink-4: #A8ADB8;
|
|
231
|
+
--color-avatar-ink-5: #A8ADB8;
|
|
232
|
+
--color-avatar-ink-6: #A8ADB8;
|
|
138
233
|
--elevation-1: inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
|
139
234
|
--elevation-2: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18);
|
|
140
235
|
--elevation-3: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5);
|
|
236
|
+
--shadow-soft: inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
|
237
|
+
--shadow-chip: inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
|
238
|
+
--shadow-raised: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18);
|
|
239
|
+
--shadow-dialog: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5);
|
|
240
|
+
--shadow-drawer: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5);
|
|
241
|
+
--shadow-sheet: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5);
|
|
242
|
+
--shadow-tab-bar: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18);
|
|
243
|
+
--shadow-action: none;
|
|
244
|
+
--shadow-action-inverse: none;
|
|
245
|
+
--shadow-segmented: none;
|
|
141
246
|
--material-glass-bg: rgba(11, 13, 18, 0.78);
|
|
142
247
|
}
|
|
143
248
|
|
|
@@ -180,9 +285,51 @@
|
|
|
180
285
|
--color-chart-phase-2: #7FA4F5;
|
|
181
286
|
--color-chart-phase-3: #4E6BB0;
|
|
182
287
|
--color-chart-phase-4: #4FC38A;
|
|
288
|
+
--color-selected: #7FA4F5;
|
|
289
|
+
--color-selected-text: #0B0D12;
|
|
290
|
+
--color-selected-soft: rgba(127, 164, 245, 0.18);
|
|
291
|
+
--color-selected-soft-text: #EDEEF2;
|
|
292
|
+
--color-inverse: #EDEEF2;
|
|
293
|
+
--color-inverse-text: #0B0D12;
|
|
294
|
+
--color-inverse-soft: rgba(11, 13, 18, 0.22);
|
|
295
|
+
--color-inverse-soft-text: #0B0D12;
|
|
296
|
+
--color-nav-text: #A8ADB8;
|
|
297
|
+
--color-nav-selected: transparent;
|
|
298
|
+
--color-nav-selected-text: #EDEEF2;
|
|
299
|
+
--color-tab-bar: #111420;
|
|
300
|
+
--color-tab-bar-text: #A8ADB8;
|
|
301
|
+
--color-tab-bar-active: #7FA4F5;
|
|
302
|
+
--color-tab-bar-active-text: #0B0D12;
|
|
303
|
+
--color-sheet-handle: rgba(255, 255, 255, 0.18);
|
|
304
|
+
--color-segmented-track: #171B28;
|
|
305
|
+
--color-segmented-border: rgba(255, 255, 255, 0.18);
|
|
306
|
+
--color-scrim-sheet: rgba(3, 4, 6, 0.6);
|
|
307
|
+
--color-avatar-ring: #111420;
|
|
308
|
+
--color-avatar-fill-1: #1F2434;
|
|
309
|
+
--color-avatar-fill-2: #1F2434;
|
|
310
|
+
--color-avatar-fill-3: #1F2434;
|
|
311
|
+
--color-avatar-fill-4: #1F2434;
|
|
312
|
+
--color-avatar-fill-5: #1F2434;
|
|
313
|
+
--color-avatar-fill-6: #1F2434;
|
|
314
|
+
--color-avatar-ink-1: #A8ADB8;
|
|
315
|
+
--color-avatar-ink-2: #A8ADB8;
|
|
316
|
+
--color-avatar-ink-3: #A8ADB8;
|
|
317
|
+
--color-avatar-ink-4: #A8ADB8;
|
|
318
|
+
--color-avatar-ink-5: #A8ADB8;
|
|
319
|
+
--color-avatar-ink-6: #A8ADB8;
|
|
183
320
|
--elevation-1: inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
|
184
321
|
--elevation-2: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18);
|
|
185
322
|
--elevation-3: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5);
|
|
323
|
+
--shadow-soft: inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
|
324
|
+
--shadow-chip: inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
|
325
|
+
--shadow-raised: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18);
|
|
326
|
+
--shadow-dialog: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5);
|
|
327
|
+
--shadow-drawer: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5);
|
|
328
|
+
--shadow-sheet: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5);
|
|
329
|
+
--shadow-tab-bar: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18);
|
|
330
|
+
--shadow-action: none;
|
|
331
|
+
--shadow-action-inverse: none;
|
|
332
|
+
--shadow-segmented: none;
|
|
186
333
|
--material-glass-bg: rgba(11, 13, 18, 0.78);
|
|
187
334
|
}
|
|
188
335
|
}
|
package/dist/tokens.d.ts
CHANGED
|
@@ -42,8 +42,60 @@ declare const lightColor: {
|
|
|
42
42
|
readonly chartPhase2: "#3B6FE0";
|
|
43
43
|
readonly chartPhase3: "#8FAAEB";
|
|
44
44
|
readonly chartPhase4: "#1F8A5B";
|
|
45
|
+
readonly selected: "#3B6FE0";
|
|
46
|
+
readonly selectedText: "#FFFFFF";
|
|
47
|
+
readonly selectedSoft: "rgba(59, 111, 224, 0.14)";
|
|
48
|
+
readonly selectedSoftText: "#1C1917";
|
|
49
|
+
readonly inverse: "#1C1917";
|
|
50
|
+
readonly inverseText: "#FFFFFF";
|
|
51
|
+
readonly inverseSoft: "rgba(255, 255, 255, 0.22)";
|
|
52
|
+
readonly inverseSoftText: "#FFFFFF";
|
|
53
|
+
readonly navText: "#57534E";
|
|
54
|
+
readonly navSelected: "transparent";
|
|
55
|
+
readonly navSelectedText: "#1C1917";
|
|
56
|
+
readonly tabBar: "#FFFFFF";
|
|
57
|
+
readonly tabBarText: "#57534E";
|
|
58
|
+
readonly tabBarActive: "#3B6FE0";
|
|
59
|
+
readonly tabBarActiveText: "#FFFFFF";
|
|
60
|
+
readonly sheetHandle: "rgba(28, 25, 23, 0.18)";
|
|
61
|
+
readonly segmentedTrack: "#F4F2EE";
|
|
62
|
+
readonly segmentedBorder: "rgba(28, 25, 23, 0.18)";
|
|
63
|
+
readonly scrimSheet: "rgba(28, 25, 23, 0.45)";
|
|
64
|
+
readonly avatarRing: "#FFFFFF";
|
|
65
|
+
readonly avatarFill1: "#ECE9E3";
|
|
66
|
+
readonly avatarFill2: "#ECE9E3";
|
|
67
|
+
readonly avatarFill3: "#ECE9E3";
|
|
68
|
+
readonly avatarFill4: "#ECE9E3";
|
|
69
|
+
readonly avatarFill5: "#ECE9E3";
|
|
70
|
+
readonly avatarFill6: "#ECE9E3";
|
|
71
|
+
readonly avatarInk1: "#57534E";
|
|
72
|
+
readonly avatarInk2: "#57534E";
|
|
73
|
+
readonly avatarInk3: "#57534E";
|
|
74
|
+
readonly avatarInk4: "#57534E";
|
|
75
|
+
readonly avatarInk5: "#57534E";
|
|
76
|
+
readonly avatarInk6: "#57534E";
|
|
45
77
|
};
|
|
46
78
|
export type ColorName = keyof typeof lightColor;
|
|
79
|
+
declare const lightElevation: {
|
|
80
|
+
readonly 1: "0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05)";
|
|
81
|
+
readonly 2: "0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)";
|
|
82
|
+
readonly 3: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
83
|
+
};
|
|
84
|
+
export type ElevationName = keyof typeof lightElevation;
|
|
85
|
+
/** The shadows components name by role. Each default is the elevation step it replaces. */
|
|
86
|
+
declare const lightShadow: {
|
|
87
|
+
readonly soft: "0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05)";
|
|
88
|
+
readonly chip: "0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05)";
|
|
89
|
+
readonly raised: "0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)";
|
|
90
|
+
readonly dialog: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
91
|
+
readonly drawer: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
92
|
+
readonly sheet: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
93
|
+
readonly tabBar: "0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)";
|
|
94
|
+
readonly action: "none";
|
|
95
|
+
readonly actionInverse: "none";
|
|
96
|
+
readonly segmented: "none";
|
|
97
|
+
};
|
|
98
|
+
export type ShadowName = keyof typeof lightShadow;
|
|
47
99
|
export declare const themes: {
|
|
48
100
|
readonly light: {
|
|
49
101
|
readonly color: {
|
|
@@ -81,12 +133,56 @@ export declare const themes: {
|
|
|
81
133
|
readonly chartPhase2: "#3B6FE0";
|
|
82
134
|
readonly chartPhase3: "#8FAAEB";
|
|
83
135
|
readonly chartPhase4: "#1F8A5B";
|
|
136
|
+
readonly selected: "#3B6FE0";
|
|
137
|
+
readonly selectedText: "#FFFFFF";
|
|
138
|
+
readonly selectedSoft: "rgba(59, 111, 224, 0.14)";
|
|
139
|
+
readonly selectedSoftText: "#1C1917";
|
|
140
|
+
readonly inverse: "#1C1917";
|
|
141
|
+
readonly inverseText: "#FFFFFF";
|
|
142
|
+
readonly inverseSoft: "rgba(255, 255, 255, 0.22)";
|
|
143
|
+
readonly inverseSoftText: "#FFFFFF";
|
|
144
|
+
readonly navText: "#57534E";
|
|
145
|
+
readonly navSelected: "transparent";
|
|
146
|
+
readonly navSelectedText: "#1C1917";
|
|
147
|
+
readonly tabBar: "#FFFFFF";
|
|
148
|
+
readonly tabBarText: "#57534E";
|
|
149
|
+
readonly tabBarActive: "#3B6FE0";
|
|
150
|
+
readonly tabBarActiveText: "#FFFFFF";
|
|
151
|
+
readonly sheetHandle: "rgba(28, 25, 23, 0.18)";
|
|
152
|
+
readonly segmentedTrack: "#F4F2EE";
|
|
153
|
+
readonly segmentedBorder: "rgba(28, 25, 23, 0.18)";
|
|
154
|
+
readonly scrimSheet: "rgba(28, 25, 23, 0.45)";
|
|
155
|
+
readonly avatarRing: "#FFFFFF";
|
|
156
|
+
readonly avatarFill1: "#ECE9E3";
|
|
157
|
+
readonly avatarFill2: "#ECE9E3";
|
|
158
|
+
readonly avatarFill3: "#ECE9E3";
|
|
159
|
+
readonly avatarFill4: "#ECE9E3";
|
|
160
|
+
readonly avatarFill5: "#ECE9E3";
|
|
161
|
+
readonly avatarFill6: "#ECE9E3";
|
|
162
|
+
readonly avatarInk1: "#57534E";
|
|
163
|
+
readonly avatarInk2: "#57534E";
|
|
164
|
+
readonly avatarInk3: "#57534E";
|
|
165
|
+
readonly avatarInk4: "#57534E";
|
|
166
|
+
readonly avatarInk5: "#57534E";
|
|
167
|
+
readonly avatarInk6: "#57534E";
|
|
84
168
|
};
|
|
85
169
|
readonly elevation: {
|
|
86
170
|
readonly 1: "0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05)";
|
|
87
171
|
readonly 2: "0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)";
|
|
88
172
|
readonly 3: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
89
173
|
};
|
|
174
|
+
readonly shadow: {
|
|
175
|
+
readonly soft: "0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05)";
|
|
176
|
+
readonly chip: "0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05)";
|
|
177
|
+
readonly raised: "0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)";
|
|
178
|
+
readonly dialog: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
179
|
+
readonly drawer: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
180
|
+
readonly sheet: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
181
|
+
readonly tabBar: "0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)";
|
|
182
|
+
readonly action: "none";
|
|
183
|
+
readonly actionInverse: "none";
|
|
184
|
+
readonly segmented: "none";
|
|
185
|
+
};
|
|
90
186
|
readonly material: {
|
|
91
187
|
readonly glassBg: "rgba(251, 250, 248, 0.78)";
|
|
92
188
|
};
|
|
@@ -126,12 +222,56 @@ export declare const themes: {
|
|
|
126
222
|
readonly chartPhase2: "#7FA4F5";
|
|
127
223
|
readonly chartPhase3: "#4E6BB0";
|
|
128
224
|
readonly chartPhase4: "#4FC38A";
|
|
225
|
+
readonly selected: "#7FA4F5";
|
|
226
|
+
readonly selectedText: "#0B0D12";
|
|
227
|
+
readonly selectedSoft: "rgba(127, 164, 245, 0.18)";
|
|
228
|
+
readonly selectedSoftText: "#EDEEF2";
|
|
229
|
+
readonly inverse: "#EDEEF2";
|
|
230
|
+
readonly inverseText: "#0B0D12";
|
|
231
|
+
readonly inverseSoft: "rgba(11, 13, 18, 0.22)";
|
|
232
|
+
readonly inverseSoftText: "#0B0D12";
|
|
233
|
+
readonly navText: "#A8ADB8";
|
|
234
|
+
readonly navSelected: "transparent";
|
|
235
|
+
readonly navSelectedText: "#EDEEF2";
|
|
236
|
+
readonly tabBar: "#111420";
|
|
237
|
+
readonly tabBarText: "#A8ADB8";
|
|
238
|
+
readonly tabBarActive: "#7FA4F5";
|
|
239
|
+
readonly tabBarActiveText: "#0B0D12";
|
|
240
|
+
readonly sheetHandle: "rgba(255, 255, 255, 0.18)";
|
|
241
|
+
readonly segmentedTrack: "#171B28";
|
|
242
|
+
readonly segmentedBorder: "rgba(255, 255, 255, 0.18)";
|
|
243
|
+
readonly scrimSheet: "rgba(3, 4, 6, 0.6)";
|
|
244
|
+
readonly avatarRing: "#111420";
|
|
245
|
+
readonly avatarFill1: "#1F2434";
|
|
246
|
+
readonly avatarFill2: "#1F2434";
|
|
247
|
+
readonly avatarFill3: "#1F2434";
|
|
248
|
+
readonly avatarFill4: "#1F2434";
|
|
249
|
+
readonly avatarFill5: "#1F2434";
|
|
250
|
+
readonly avatarFill6: "#1F2434";
|
|
251
|
+
readonly avatarInk1: "#A8ADB8";
|
|
252
|
+
readonly avatarInk2: "#A8ADB8";
|
|
253
|
+
readonly avatarInk3: "#A8ADB8";
|
|
254
|
+
readonly avatarInk4: "#A8ADB8";
|
|
255
|
+
readonly avatarInk5: "#A8ADB8";
|
|
256
|
+
readonly avatarInk6: "#A8ADB8";
|
|
129
257
|
};
|
|
130
258
|
readonly elevation: {
|
|
131
259
|
readonly 1: "inset 0 1px 0 rgba(255, 255, 255, 0.06)";
|
|
132
260
|
readonly 2: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18)";
|
|
133
261
|
readonly 3: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5)";
|
|
134
262
|
};
|
|
263
|
+
readonly shadow: {
|
|
264
|
+
readonly soft: "inset 0 1px 0 rgba(255, 255, 255, 0.06)";
|
|
265
|
+
readonly chip: "inset 0 1px 0 rgba(255, 255, 255, 0.06)";
|
|
266
|
+
readonly raised: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18)";
|
|
267
|
+
readonly dialog: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5)";
|
|
268
|
+
readonly drawer: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5)";
|
|
269
|
+
readonly sheet: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5)";
|
|
270
|
+
readonly tabBar: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18)";
|
|
271
|
+
readonly action: "none";
|
|
272
|
+
readonly actionInverse: "none";
|
|
273
|
+
readonly segmented: "none";
|
|
274
|
+
};
|
|
135
275
|
readonly material: {
|
|
136
276
|
readonly glassBg: "rgba(11, 13, 18, 0.78)";
|
|
137
277
|
};
|
|
@@ -142,6 +282,23 @@ export declare const shared: {
|
|
|
142
282
|
readonly font: {
|
|
143
283
|
readonly sans: "\"Geist Variable\", \"Geist\", -apple-system, \"SF Pro Display\", \"Segoe UI\", Helvetica, Arial, sans-serif";
|
|
144
284
|
readonly mono: "\"Geist Mono Variable\", \"Geist Mono\", ui-monospace, \"SF Mono\", Menlo, Consolas, monospace";
|
|
285
|
+
readonly display: "\"Geist Variable\", \"Geist\", -apple-system, \"SF Pro Display\", \"Segoe UI\", Helvetica, Arial, sans-serif";
|
|
286
|
+
readonly body: "\"Geist Variable\", \"Geist\", -apple-system, \"SF Pro Display\", \"Segoe UI\", Helvetica, Arial, sans-serif";
|
|
287
|
+
};
|
|
288
|
+
readonly fontWeight: {
|
|
289
|
+
readonly body: "400";
|
|
290
|
+
readonly label: "500";
|
|
291
|
+
readonly button: "500";
|
|
292
|
+
readonly heading: "600";
|
|
293
|
+
readonly nav: "400";
|
|
294
|
+
readonly navSelected: "500";
|
|
295
|
+
readonly display: "600";
|
|
296
|
+
};
|
|
297
|
+
readonly fontStretch: {
|
|
298
|
+
readonly display: "normal";
|
|
299
|
+
};
|
|
300
|
+
readonly textTransform: {
|
|
301
|
+
readonly display: "none";
|
|
145
302
|
};
|
|
146
303
|
readonly text: {
|
|
147
304
|
readonly '2xs': "0.6875rem";
|
|
@@ -193,6 +350,12 @@ export declare const shared: {
|
|
|
193
350
|
readonly lg: "0.75rem";
|
|
194
351
|
readonly xl: "1rem";
|
|
195
352
|
readonly full: "999px";
|
|
353
|
+
readonly control: "0.625rem";
|
|
354
|
+
readonly option: "0.5rem";
|
|
355
|
+
readonly panel: "0.625rem";
|
|
356
|
+
readonly popup: "0.75rem";
|
|
357
|
+
readonly card: "1rem";
|
|
358
|
+
readonly dialog: "1rem";
|
|
196
359
|
};
|
|
197
360
|
/**
|
|
198
361
|
* Border widths above the hairline default: `emphasis` is the active/selected indicator
|
|
@@ -227,11 +390,23 @@ export declare const shared: {
|
|
|
227
390
|
readonly pageMax: "75rem";
|
|
228
391
|
/** Page frame max width at the wide tier: the mock's min(1800px, 90vw). */
|
|
229
392
|
readonly pageMaxWide: "min(112.5rem, 90vw)";
|
|
393
|
+
readonly drawer: "28rem";
|
|
394
|
+
readonly control: "44px";
|
|
395
|
+
readonly controlSm: "2.5rem";
|
|
396
|
+
/** The dialog close circle, 36px, the mock's (O-33). */
|
|
397
|
+
readonly close: "2.25rem";
|
|
230
398
|
};
|
|
231
399
|
readonly measure: "65ch";
|
|
232
400
|
readonly focusRingWidth: "2px";
|
|
233
401
|
readonly focusRingOffset: "2px";
|
|
234
402
|
};
|
|
403
|
+
export type SharedTokens = typeof shared;
|
|
404
|
+
export type ThemeTokens = (typeof themes)['light'];
|
|
405
|
+
export type FontName = keyof typeof shared.font;
|
|
406
|
+
export type FontWeightName = keyof typeof shared.fontWeight;
|
|
407
|
+
export type TextSizeName = keyof typeof shared.text;
|
|
408
|
+
export type RadiusName = keyof typeof shared.radius;
|
|
409
|
+
export type SizeName = keyof typeof shared.size;
|
|
235
410
|
/** Text roles on the surfaces they sit on: must meet WCAG AA 4.5:1 in every theme. */
|
|
236
411
|
export declare const textContrastPairs: ReadonlyArray<readonly [ColorName, ColorName]>;
|
|
237
412
|
/** Non-text UI roles (fills, dots, rings) on the surfaces they sit on: WCAG 1.4.11 asks 3:1. */
|
|
@@ -282,12 +457,56 @@ export declare const tokens: {
|
|
|
282
457
|
readonly chartPhase2: "#3B6FE0";
|
|
283
458
|
readonly chartPhase3: "#8FAAEB";
|
|
284
459
|
readonly chartPhase4: "#1F8A5B";
|
|
460
|
+
readonly selected: "#3B6FE0";
|
|
461
|
+
readonly selectedText: "#FFFFFF";
|
|
462
|
+
readonly selectedSoft: "rgba(59, 111, 224, 0.14)";
|
|
463
|
+
readonly selectedSoftText: "#1C1917";
|
|
464
|
+
readonly inverse: "#1C1917";
|
|
465
|
+
readonly inverseText: "#FFFFFF";
|
|
466
|
+
readonly inverseSoft: "rgba(255, 255, 255, 0.22)";
|
|
467
|
+
readonly inverseSoftText: "#FFFFFF";
|
|
468
|
+
readonly navText: "#57534E";
|
|
469
|
+
readonly navSelected: "transparent";
|
|
470
|
+
readonly navSelectedText: "#1C1917";
|
|
471
|
+
readonly tabBar: "#FFFFFF";
|
|
472
|
+
readonly tabBarText: "#57534E";
|
|
473
|
+
readonly tabBarActive: "#3B6FE0";
|
|
474
|
+
readonly tabBarActiveText: "#FFFFFF";
|
|
475
|
+
readonly sheetHandle: "rgba(28, 25, 23, 0.18)";
|
|
476
|
+
readonly segmentedTrack: "#F4F2EE";
|
|
477
|
+
readonly segmentedBorder: "rgba(28, 25, 23, 0.18)";
|
|
478
|
+
readonly scrimSheet: "rgba(28, 25, 23, 0.45)";
|
|
479
|
+
readonly avatarRing: "#FFFFFF";
|
|
480
|
+
readonly avatarFill1: "#ECE9E3";
|
|
481
|
+
readonly avatarFill2: "#ECE9E3";
|
|
482
|
+
readonly avatarFill3: "#ECE9E3";
|
|
483
|
+
readonly avatarFill4: "#ECE9E3";
|
|
484
|
+
readonly avatarFill5: "#ECE9E3";
|
|
485
|
+
readonly avatarFill6: "#ECE9E3";
|
|
486
|
+
readonly avatarInk1: "#57534E";
|
|
487
|
+
readonly avatarInk2: "#57534E";
|
|
488
|
+
readonly avatarInk3: "#57534E";
|
|
489
|
+
readonly avatarInk4: "#57534E";
|
|
490
|
+
readonly avatarInk5: "#57534E";
|
|
491
|
+
readonly avatarInk6: "#57534E";
|
|
285
492
|
};
|
|
286
493
|
readonly elevation: {
|
|
287
494
|
readonly 1: "0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05)";
|
|
288
495
|
readonly 2: "0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)";
|
|
289
496
|
readonly 3: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
290
497
|
};
|
|
498
|
+
readonly shadow: {
|
|
499
|
+
readonly soft: "0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05)";
|
|
500
|
+
readonly chip: "0 2px 8px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.05)";
|
|
501
|
+
readonly raised: "0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)";
|
|
502
|
+
readonly dialog: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
503
|
+
readonly drawer: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
504
|
+
readonly sheet: "0 16px 40px rgba(28, 25, 23, 0.10), 0 2px 6px rgba(28, 25, 23, 0.06)";
|
|
505
|
+
readonly tabBar: "0 6px 16px rgba(28, 25, 23, 0.07), 0 20px 48px rgba(28, 25, 23, 0.08)";
|
|
506
|
+
readonly action: "none";
|
|
507
|
+
readonly actionInverse: "none";
|
|
508
|
+
readonly segmented: "none";
|
|
509
|
+
};
|
|
291
510
|
readonly material: {
|
|
292
511
|
readonly glassBg: "rgba(251, 250, 248, 0.78)";
|
|
293
512
|
};
|
|
@@ -327,12 +546,56 @@ export declare const tokens: {
|
|
|
327
546
|
readonly chartPhase2: "#7FA4F5";
|
|
328
547
|
readonly chartPhase3: "#4E6BB0";
|
|
329
548
|
readonly chartPhase4: "#4FC38A";
|
|
549
|
+
readonly selected: "#7FA4F5";
|
|
550
|
+
readonly selectedText: "#0B0D12";
|
|
551
|
+
readonly selectedSoft: "rgba(127, 164, 245, 0.18)";
|
|
552
|
+
readonly selectedSoftText: "#EDEEF2";
|
|
553
|
+
readonly inverse: "#EDEEF2";
|
|
554
|
+
readonly inverseText: "#0B0D12";
|
|
555
|
+
readonly inverseSoft: "rgba(11, 13, 18, 0.22)";
|
|
556
|
+
readonly inverseSoftText: "#0B0D12";
|
|
557
|
+
readonly navText: "#A8ADB8";
|
|
558
|
+
readonly navSelected: "transparent";
|
|
559
|
+
readonly navSelectedText: "#EDEEF2";
|
|
560
|
+
readonly tabBar: "#111420";
|
|
561
|
+
readonly tabBarText: "#A8ADB8";
|
|
562
|
+
readonly tabBarActive: "#7FA4F5";
|
|
563
|
+
readonly tabBarActiveText: "#0B0D12";
|
|
564
|
+
readonly sheetHandle: "rgba(255, 255, 255, 0.18)";
|
|
565
|
+
readonly segmentedTrack: "#171B28";
|
|
566
|
+
readonly segmentedBorder: "rgba(255, 255, 255, 0.18)";
|
|
567
|
+
readonly scrimSheet: "rgba(3, 4, 6, 0.6)";
|
|
568
|
+
readonly avatarRing: "#111420";
|
|
569
|
+
readonly avatarFill1: "#1F2434";
|
|
570
|
+
readonly avatarFill2: "#1F2434";
|
|
571
|
+
readonly avatarFill3: "#1F2434";
|
|
572
|
+
readonly avatarFill4: "#1F2434";
|
|
573
|
+
readonly avatarFill5: "#1F2434";
|
|
574
|
+
readonly avatarFill6: "#1F2434";
|
|
575
|
+
readonly avatarInk1: "#A8ADB8";
|
|
576
|
+
readonly avatarInk2: "#A8ADB8";
|
|
577
|
+
readonly avatarInk3: "#A8ADB8";
|
|
578
|
+
readonly avatarInk4: "#A8ADB8";
|
|
579
|
+
readonly avatarInk5: "#A8ADB8";
|
|
580
|
+
readonly avatarInk6: "#A8ADB8";
|
|
330
581
|
};
|
|
331
582
|
readonly elevation: {
|
|
332
583
|
readonly 1: "inset 0 1px 0 rgba(255, 255, 255, 0.06)";
|
|
333
584
|
readonly 2: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18)";
|
|
334
585
|
readonly 3: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5)";
|
|
335
586
|
};
|
|
587
|
+
readonly shadow: {
|
|
588
|
+
readonly soft: "inset 0 1px 0 rgba(255, 255, 255, 0.06)";
|
|
589
|
+
readonly chip: "inset 0 1px 0 rgba(255, 255, 255, 0.06)";
|
|
590
|
+
readonly raised: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18)";
|
|
591
|
+
readonly dialog: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5)";
|
|
592
|
+
readonly drawer: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5)";
|
|
593
|
+
readonly sheet: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.5)";
|
|
594
|
+
readonly tabBar: "inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.18)";
|
|
595
|
+
readonly action: "none";
|
|
596
|
+
readonly actionInverse: "none";
|
|
597
|
+
readonly segmented: "none";
|
|
598
|
+
};
|
|
336
599
|
readonly material: {
|
|
337
600
|
readonly glassBg: "rgba(11, 13, 18, 0.78)";
|
|
338
601
|
};
|
|
@@ -342,6 +605,23 @@ export declare const tokens: {
|
|
|
342
605
|
readonly font: {
|
|
343
606
|
readonly sans: "\"Geist Variable\", \"Geist\", -apple-system, \"SF Pro Display\", \"Segoe UI\", Helvetica, Arial, sans-serif";
|
|
344
607
|
readonly mono: "\"Geist Mono Variable\", \"Geist Mono\", ui-monospace, \"SF Mono\", Menlo, Consolas, monospace";
|
|
608
|
+
readonly display: "\"Geist Variable\", \"Geist\", -apple-system, \"SF Pro Display\", \"Segoe UI\", Helvetica, Arial, sans-serif";
|
|
609
|
+
readonly body: "\"Geist Variable\", \"Geist\", -apple-system, \"SF Pro Display\", \"Segoe UI\", Helvetica, Arial, sans-serif";
|
|
610
|
+
};
|
|
611
|
+
readonly fontWeight: {
|
|
612
|
+
readonly body: "400";
|
|
613
|
+
readonly label: "500";
|
|
614
|
+
readonly button: "500";
|
|
615
|
+
readonly heading: "600";
|
|
616
|
+
readonly nav: "400";
|
|
617
|
+
readonly navSelected: "500";
|
|
618
|
+
readonly display: "600";
|
|
619
|
+
};
|
|
620
|
+
readonly fontStretch: {
|
|
621
|
+
readonly display: "normal";
|
|
622
|
+
};
|
|
623
|
+
readonly textTransform: {
|
|
624
|
+
readonly display: "none";
|
|
345
625
|
};
|
|
346
626
|
readonly text: {
|
|
347
627
|
readonly '2xs': "0.6875rem";
|
|
@@ -393,6 +673,12 @@ export declare const tokens: {
|
|
|
393
673
|
readonly lg: "0.75rem";
|
|
394
674
|
readonly xl: "1rem";
|
|
395
675
|
readonly full: "999px";
|
|
676
|
+
readonly control: "0.625rem";
|
|
677
|
+
readonly option: "0.5rem";
|
|
678
|
+
readonly panel: "0.625rem";
|
|
679
|
+
readonly popup: "0.75rem";
|
|
680
|
+
readonly card: "1rem";
|
|
681
|
+
readonly dialog: "1rem";
|
|
396
682
|
};
|
|
397
683
|
/**
|
|
398
684
|
* Border widths above the hairline default: `emphasis` is the active/selected indicator
|
|
@@ -427,6 +713,11 @@ export declare const tokens: {
|
|
|
427
713
|
readonly pageMax: "75rem";
|
|
428
714
|
/** Page frame max width at the wide tier: the mock's min(1800px, 90vw). */
|
|
429
715
|
readonly pageMaxWide: "min(112.5rem, 90vw)";
|
|
716
|
+
readonly drawer: "28rem";
|
|
717
|
+
readonly control: "44px";
|
|
718
|
+
readonly controlSm: "2.5rem";
|
|
719
|
+
/** The dialog close circle, 36px, the mock's (O-33). */
|
|
720
|
+
readonly close: "2.25rem";
|
|
430
721
|
};
|
|
431
722
|
readonly measure: "65ch";
|
|
432
723
|
readonly focusRingWidth: "2px";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@calcifer-design/tokens",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@calcifer-design/tsconfig": "0.0.0",
|
|
37
|
-
"@rslib/core": "1.0.
|
|
37
|
+
"@rslib/core": "1.0.1",
|
|
38
38
|
"fast-glob": "^3.3.3"
|
|
39
39
|
}
|
|
40
40
|
}
|