@zentrades-ui/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/README.md +192 -0
- package/package.json +16 -0
- package/src/constants.ts +758 -0
- package/src/default-tokens.ts +4 -0
- package/src/index.ts +65 -0
- package/src/schema.ts +65 -0
- package/tokens.json +1240 -0
package/src/constants.ts
ADDED
|
@@ -0,0 +1,758 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token Constants
|
|
3
|
+
* Exported as named constants for use in vanilla-extract CSS files
|
|
4
|
+
* These match the structure from zenith/src/ui/tokens
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// SPACING TOKENS
|
|
9
|
+
// ============================================================================
|
|
10
|
+
|
|
11
|
+
export const SPACING_STEPS = [
|
|
12
|
+
1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 24, 26, 28, 32, 36, 40, 48, 56, 64, 72,
|
|
13
|
+
80, 88, 96, 104, 112, 120, 220,
|
|
14
|
+
] as const;
|
|
15
|
+
|
|
16
|
+
export type SpacingStep = (typeof SPACING_STEPS)[number];
|
|
17
|
+
export type SpacingToken = `${SpacingStep}`;
|
|
18
|
+
|
|
19
|
+
export const pxToRem = (px: number): string => `${px / 16}rem`;
|
|
20
|
+
|
|
21
|
+
export const SPACING_UNITS = Object.fromEntries(
|
|
22
|
+
SPACING_STEPS.map((step) => [`${step}`, step])
|
|
23
|
+
) as Record<SpacingToken, SpacingStep>;
|
|
24
|
+
|
|
25
|
+
export const SPACING_TOKENS = Object.fromEntries(
|
|
26
|
+
SPACING_STEPS.map((step) => {
|
|
27
|
+
const key = `${step}` as SpacingToken;
|
|
28
|
+
return [key, pxToRem(SPACING_UNITS[key])];
|
|
29
|
+
})
|
|
30
|
+
) as Record<SpacingToken, string>;
|
|
31
|
+
|
|
32
|
+
export const SEMANTIC_SPACING = {
|
|
33
|
+
none: "0",
|
|
34
|
+
"2xs": SPACING_TOKENS["2"],
|
|
35
|
+
xs: SPACING_TOKENS["4"],
|
|
36
|
+
sm: SPACING_TOKENS["8"],
|
|
37
|
+
md: SPACING_TOKENS["12"],
|
|
38
|
+
lg: SPACING_TOKENS["16"],
|
|
39
|
+
xl: SPACING_TOKENS["24"],
|
|
40
|
+
"2xl": SPACING_TOKENS["32"],
|
|
41
|
+
"3xl": SPACING_TOKENS["40"],
|
|
42
|
+
"4xl": SPACING_TOKENS["48"],
|
|
43
|
+
"5xl": SPACING_TOKENS["56"],
|
|
44
|
+
"6xl": SPACING_TOKENS["64"],
|
|
45
|
+
"7xl": SPACING_TOKENS["72"],
|
|
46
|
+
"8xl": SPACING_TOKENS["80"],
|
|
47
|
+
"9xl": SPACING_TOKENS["88"],
|
|
48
|
+
"10xl": SPACING_TOKENS["96"],
|
|
49
|
+
"11xl": SPACING_TOKENS["104"],
|
|
50
|
+
"12xl": SPACING_TOKENS["112"],
|
|
51
|
+
section: SPACING_TOKENS["72"],
|
|
52
|
+
page: SPACING_TOKENS["96"],
|
|
53
|
+
container: SPACING_TOKENS["120"],
|
|
54
|
+
} as const;
|
|
55
|
+
|
|
56
|
+
export type SemanticSpacing = keyof typeof SEMANTIC_SPACING;
|
|
57
|
+
|
|
58
|
+
// ============================================================================
|
|
59
|
+
// COLOR TOKENS
|
|
60
|
+
// ============================================================================
|
|
61
|
+
|
|
62
|
+
export const COLORS = {
|
|
63
|
+
brand: {
|
|
64
|
+
100: "#fcdde0",
|
|
65
|
+
200: "#f8bbc2",
|
|
66
|
+
300: "#f599a3",
|
|
67
|
+
400: "#f17785",
|
|
68
|
+
500: "#ee5566",
|
|
69
|
+
600: "#be4452",
|
|
70
|
+
700: "#8f333d",
|
|
71
|
+
800: "#5f2229",
|
|
72
|
+
900: "#301114",
|
|
73
|
+
},
|
|
74
|
+
secondaryBrand: {
|
|
75
|
+
50: "#EFF8FF",
|
|
76
|
+
100: "#cde6f9",
|
|
77
|
+
200: "#9ccef4",
|
|
78
|
+
300: "#6ab5ee",
|
|
79
|
+
400: "#399de9",
|
|
80
|
+
500: "#0784e3",
|
|
81
|
+
600: "#066ab6",
|
|
82
|
+
700: "#044f88",
|
|
83
|
+
800: "#03355b",
|
|
84
|
+
900: "#011a2d",
|
|
85
|
+
},
|
|
86
|
+
blue: {
|
|
87
|
+
25: "#f3f6ff",
|
|
88
|
+
100: "#cfdaff",
|
|
89
|
+
200: "#9eb4ff",
|
|
90
|
+
300: "#6e8fff",
|
|
91
|
+
400: "#3d69ff",
|
|
92
|
+
500: "#0d44ff",
|
|
93
|
+
600: "#0a36cc",
|
|
94
|
+
700: "#082999",
|
|
95
|
+
800: "#051b66",
|
|
96
|
+
900: "#030e33",
|
|
97
|
+
},
|
|
98
|
+
purple: {
|
|
99
|
+
25: "#F9ECFF",
|
|
100
|
+
100: "#e2d1ff",
|
|
101
|
+
200: "#c6a3ff",
|
|
102
|
+
300: "#a975ff",
|
|
103
|
+
400: "#8d47ff",
|
|
104
|
+
450: "#ab00f5",
|
|
105
|
+
500: "#7019ff",
|
|
106
|
+
600: "#5a14cc",
|
|
107
|
+
700: "#430f99",
|
|
108
|
+
800: "#2d0a66",
|
|
109
|
+
900: "#160533",
|
|
110
|
+
},
|
|
111
|
+
violet: {
|
|
112
|
+
100: "#f4d1ff",
|
|
113
|
+
200: "#eaa2ff",
|
|
114
|
+
300: "#df74ff",
|
|
115
|
+
400: "#d545ff",
|
|
116
|
+
500: "#ca17ff",
|
|
117
|
+
600: "#a212cc",
|
|
118
|
+
700: "#790e99",
|
|
119
|
+
800: "#510966",
|
|
120
|
+
900: "#280533",
|
|
121
|
+
},
|
|
122
|
+
red: {
|
|
123
|
+
25: "#fff2f2",
|
|
124
|
+
100: "#fecccc",
|
|
125
|
+
200: "#fd9999",
|
|
126
|
+
300: "#fc6666",
|
|
127
|
+
400: "#fb3333",
|
|
128
|
+
500: "#fa0000",
|
|
129
|
+
600: "#c80000",
|
|
130
|
+
700: "#960000",
|
|
131
|
+
800: "#640000",
|
|
132
|
+
900: "#320000",
|
|
133
|
+
},
|
|
134
|
+
pink: {
|
|
135
|
+
100: "#ffcce7",
|
|
136
|
+
200: "#ff99cf",
|
|
137
|
+
300: "#ff66b8",
|
|
138
|
+
400: "#ff33a0",
|
|
139
|
+
500: "#ff0088",
|
|
140
|
+
600: "#cc006d",
|
|
141
|
+
700: "#990052",
|
|
142
|
+
800: "#660036",
|
|
143
|
+
900: "#33001b",
|
|
144
|
+
},
|
|
145
|
+
orange: {
|
|
146
|
+
25: "#fff8f2",
|
|
147
|
+
100: "#ffe4cc",
|
|
148
|
+
200: "#ffc999",
|
|
149
|
+
300: "#ffad66",
|
|
150
|
+
400: "#ff9233",
|
|
151
|
+
500: "#ff7700",
|
|
152
|
+
600: "#cc5f00",
|
|
153
|
+
700: "#994700",
|
|
154
|
+
800: "#663000",
|
|
155
|
+
900: "#331800",
|
|
156
|
+
},
|
|
157
|
+
yellow: {
|
|
158
|
+
100: "#fff4cc",
|
|
159
|
+
200: "#ffea99",
|
|
160
|
+
300: "#ffdf66",
|
|
161
|
+
400: "#ffd533",
|
|
162
|
+
500: "#ffca00",
|
|
163
|
+
600: "#cca200",
|
|
164
|
+
700: "#997900",
|
|
165
|
+
800: "#665100",
|
|
166
|
+
900: "#332800",
|
|
167
|
+
},
|
|
168
|
+
green: {
|
|
169
|
+
25: "#f2fbf3",
|
|
170
|
+
100: "#ccefd1",
|
|
171
|
+
200: "#99dea3",
|
|
172
|
+
300: "#66ce75",
|
|
173
|
+
400: "#33bd47",
|
|
174
|
+
500: "#00ad19",
|
|
175
|
+
600: "#008a14",
|
|
176
|
+
700: "#00680f",
|
|
177
|
+
800: "#00450a",
|
|
178
|
+
900: "#002305",
|
|
179
|
+
},
|
|
180
|
+
teal: {
|
|
181
|
+
100: "#ccfaf9",
|
|
182
|
+
200: "#99f5f3",
|
|
183
|
+
300: "#66f0ee",
|
|
184
|
+
400: "#33ebe8",
|
|
185
|
+
500: "#00e6e2",
|
|
186
|
+
600: "#00b8b5",
|
|
187
|
+
700: "#008a88",
|
|
188
|
+
800: "#005c5a",
|
|
189
|
+
900: "#002e2d",
|
|
190
|
+
},
|
|
191
|
+
cyan: {
|
|
192
|
+
25: "#f2fbff",
|
|
193
|
+
50: "#effeff",
|
|
194
|
+
100: "#ccefff",
|
|
195
|
+
200: "#99dfff",
|
|
196
|
+
300: "#66ceff",
|
|
197
|
+
400: "#33beff",
|
|
198
|
+
500: "#00aeff",
|
|
199
|
+
600: "#008bcc",
|
|
200
|
+
650: "#007d84",
|
|
201
|
+
700: "#006899",
|
|
202
|
+
800: "#004666",
|
|
203
|
+
900: "#002333",
|
|
204
|
+
},
|
|
205
|
+
neutral: {
|
|
206
|
+
25: "#F7F8F8",
|
|
207
|
+
50: "#f0f1f1",
|
|
208
|
+
100: "#e2e2e2",
|
|
209
|
+
150: "#d3d4d4",
|
|
210
|
+
200: "#c4c5c6",
|
|
211
|
+
250: "#b5b7b8",
|
|
212
|
+
300: "#a7a8a9",
|
|
213
|
+
350: "#989a9b",
|
|
214
|
+
400: "#898b8d",
|
|
215
|
+
450: "#7a7d7e",
|
|
216
|
+
500: "#6c6e70",
|
|
217
|
+
550: "#616365",
|
|
218
|
+
600: "#56585a",
|
|
219
|
+
650: "#4b4d4f",
|
|
220
|
+
700: "#414243",
|
|
221
|
+
750: "#363738",
|
|
222
|
+
800: "#2b2c2d",
|
|
223
|
+
850: "#202122",
|
|
224
|
+
900: "#161616",
|
|
225
|
+
950: "#0b0b0b",
|
|
226
|
+
},
|
|
227
|
+
primary: {
|
|
228
|
+
black: "#000000",
|
|
229
|
+
white: "#ffffff",
|
|
230
|
+
black50: "rgba(0, 0, 0, 0.50)",
|
|
231
|
+
white50: "rgba(255, 255, 255, 0.50)",
|
|
232
|
+
},
|
|
233
|
+
} as const;
|
|
234
|
+
|
|
235
|
+
export const themedColorVars = {
|
|
236
|
+
// Contents
|
|
237
|
+
contentPrimary: { light: COLORS.neutral[950], dark: COLORS.primary.white },
|
|
238
|
+
contentSecondary: { light: COLORS.neutral[800], dark: COLORS.neutral[100] },
|
|
239
|
+
contentTertiary: { light: COLORS.neutral[600], dark: COLORS.neutral[300] },
|
|
240
|
+
contentQuaternary: { light: COLORS.neutral[400], dark: COLORS.neutral[500] },
|
|
241
|
+
contentDefaultWhite: {
|
|
242
|
+
light: COLORS.primary.white,
|
|
243
|
+
dark: COLORS.primary.white,
|
|
244
|
+
},
|
|
245
|
+
contentPrimaryInverse: {
|
|
246
|
+
light: COLORS.primary.white,
|
|
247
|
+
dark: COLORS.neutral[950],
|
|
248
|
+
},
|
|
249
|
+
contentSecondaryInverse: {
|
|
250
|
+
light: COLORS.neutral[100],
|
|
251
|
+
dark: COLORS.neutral[800],
|
|
252
|
+
},
|
|
253
|
+
contentTertiaryInverse: {
|
|
254
|
+
light: COLORS.neutral[300],
|
|
255
|
+
dark: COLORS.neutral[600],
|
|
256
|
+
},
|
|
257
|
+
contentDisabled: { light: COLORS.neutral[250], dark: COLORS.neutral[700] },
|
|
258
|
+
contentBrand: { light: COLORS.brand[500], dark: COLORS.brand[500] },
|
|
259
|
+
contentSecondaryBrand: {
|
|
260
|
+
light: COLORS.secondaryBrand[500],
|
|
261
|
+
dark: COLORS.secondaryBrand[500],
|
|
262
|
+
},
|
|
263
|
+
contentLink: { light: COLORS.blue[500], dark: COLORS.blue[400] },
|
|
264
|
+
contentLinkHover: { light: COLORS.blue[600], dark: COLORS.blue[300] },
|
|
265
|
+
contentLinkPressed: { light: COLORS.blue[700], dark: COLORS.blue[200] },
|
|
266
|
+
contentInfo: { light: COLORS.blue[500], dark: COLORS.blue[400] },
|
|
267
|
+
contentInfoBold: { light: COLORS.blue[600], dark: COLORS.blue[300] },
|
|
268
|
+
contentNotice: { light: COLORS.orange[500], dark: COLORS.orange[400] },
|
|
269
|
+
contentNoticeBold: { light: COLORS.orange[700], dark: COLORS.orange[300] },
|
|
270
|
+
contentNegative: { light: COLORS.red[500], dark: COLORS.red[400] },
|
|
271
|
+
contentNegativeBold: { light: COLORS.red[700], dark: COLORS.red[300] },
|
|
272
|
+
contentPositive: { light: COLORS.green[500], dark: COLORS.green[400] },
|
|
273
|
+
contentPositiveBold: { light: COLORS.green[700], dark: COLORS.green[200] },
|
|
274
|
+
contentAttention: { light: COLORS.purple[450], dark: COLORS.purple[300] },
|
|
275
|
+
contentActive: { light: COLORS.cyan[650], dark: COLORS.cyan[200] },
|
|
276
|
+
|
|
277
|
+
// Backgrounds
|
|
278
|
+
backgroundPrimary: { light: COLORS.primary.white, dark: COLORS.neutral[950] },
|
|
279
|
+
backgroundSecondary: { light: COLORS.neutral[25], dark: COLORS.neutral[900] },
|
|
280
|
+
backgroundHover: { light: COLORS.neutral[100], dark: COLORS.neutral[800] },
|
|
281
|
+
backgroundPressed: { light: COLORS.neutral[100], dark: COLORS.neutral[700] },
|
|
282
|
+
backgroundSelected: { light: COLORS.brand[100], dark: COLORS.brand[700] },
|
|
283
|
+
backgroundSecondarySelected: {
|
|
284
|
+
light: COLORS.secondaryBrand[100],
|
|
285
|
+
dark: COLORS.secondaryBrand[800],
|
|
286
|
+
},
|
|
287
|
+
backgroundDisabled: { light: COLORS.neutral[50], dark: COLORS.neutral[800] },
|
|
288
|
+
backgroundBrand: { light: COLORS.brand[500], dark: COLORS.brand[400] },
|
|
289
|
+
backgroundBrandHover: { light: COLORS.brand[600], dark: COLORS.brand[300] },
|
|
290
|
+
backgroundBrandPressed: { light: COLORS.brand[700], dark: COLORS.brand[200] },
|
|
291
|
+
backgroundSecondaryBrand: {
|
|
292
|
+
light: COLORS.secondaryBrand[500],
|
|
293
|
+
dark: COLORS.secondaryBrand[400],
|
|
294
|
+
},
|
|
295
|
+
backgroundSecondaryBrandHover: {
|
|
296
|
+
light: COLORS.secondaryBrand[600],
|
|
297
|
+
dark: COLORS.secondaryBrand[300],
|
|
298
|
+
},
|
|
299
|
+
backgroundSecondaryBrandPressed: {
|
|
300
|
+
light: COLORS.secondaryBrand[700],
|
|
301
|
+
dark: COLORS.secondaryBrand[200],
|
|
302
|
+
},
|
|
303
|
+
backgroundInfo: { light: COLORS.blue[500], dark: COLORS.blue[400] },
|
|
304
|
+
backgroundInfoSubtle: { light: COLORS.blue[25], dark: COLORS.blue[900] },
|
|
305
|
+
backgroundNotice: { light: COLORS.orange[500], dark: COLORS.orange[400] },
|
|
306
|
+
backgroundNoticeSubtle: { light: COLORS.orange[25], dark: COLORS.orange[900] },
|
|
307
|
+
backgroundNegative: { light: COLORS.red[500], dark: COLORS.red[400] },
|
|
308
|
+
backgroundNegativeHover: { light: COLORS.red[600], dark: COLORS.red[300] },
|
|
309
|
+
backgroundNegativePressed: { light: COLORS.red[700], dark: COLORS.red[200] },
|
|
310
|
+
backgroundNegativeSubtle: { light: COLORS.red[25], dark: COLORS.red[900] },
|
|
311
|
+
backgroundPositive: { light: COLORS.green[500], dark: COLORS.green[400] },
|
|
312
|
+
backgroundPositiveSubtle: { light: COLORS.green[25], dark: COLORS.green[900] },
|
|
313
|
+
backgroundInverse: { light: COLORS.neutral[900], dark: COLORS.primary.white },
|
|
314
|
+
backgroundInverseHover: { light: COLORS.neutral[800], dark: COLORS.neutral[50] },
|
|
315
|
+
backgroundAttention: { light: COLORS.purple[25], dark: COLORS.purple[900] },
|
|
316
|
+
backgroundActive: { light: COLORS.cyan[50], dark: COLORS.cyan[900] },
|
|
317
|
+
backgroundSecondaryBrandSubtle: {
|
|
318
|
+
light: COLORS.secondaryBrand[50],
|
|
319
|
+
dark: COLORS.secondaryBrand[50],
|
|
320
|
+
},
|
|
321
|
+
|
|
322
|
+
// Borders
|
|
323
|
+
borderPrimary: { light: COLORS.neutral[600], dark: COLORS.neutral[400] },
|
|
324
|
+
borderSecondary: { light: COLORS.neutral[400], dark: COLORS.neutral[600] },
|
|
325
|
+
borderTertiary: { light: COLORS.neutral[200], dark: COLORS.neutral[800] },
|
|
326
|
+
borderQuaternary: { light: COLORS.neutral[100], dark: COLORS.neutral[900] },
|
|
327
|
+
borderDisabled: { light: COLORS.neutral[150], dark: COLORS.neutral[700] },
|
|
328
|
+
borderBrand: { light: COLORS.brand[500], dark: COLORS.brand[400] },
|
|
329
|
+
borderSecondaryBrand: {
|
|
330
|
+
light: COLORS.secondaryBrand[500],
|
|
331
|
+
dark: COLORS.secondaryBrand[400],
|
|
332
|
+
},
|
|
333
|
+
borderInverse: { light: COLORS.primary.white, dark: COLORS.neutral[900] },
|
|
334
|
+
borderFocus: { light: COLORS.blue[500], dark: COLORS.blue[400] },
|
|
335
|
+
borderInfo: { light: COLORS.blue[500], dark: COLORS.blue[400] },
|
|
336
|
+
borderNotice: { light: COLORS.orange[500], dark: COLORS.orange[400] },
|
|
337
|
+
borderNegative: { light: COLORS.red[500], dark: COLORS.red[400] },
|
|
338
|
+
borderPositive: { light: COLORS.green[500], dark: COLORS.green[400] },
|
|
339
|
+
borderMono: { light: COLORS.neutral[900], dark: COLORS.primary.white },
|
|
340
|
+
borderAttention: { light: COLORS.purple[450], dark: COLORS.purple[400] },
|
|
341
|
+
borderActive: { light: COLORS.cyan[650], dark: COLORS.cyan[400] },
|
|
342
|
+
|
|
343
|
+
// Surfaces
|
|
344
|
+
surfaceL0: { light: COLORS.primary.white, dark: COLORS.neutral[950] },
|
|
345
|
+
surfaceL1: { light: COLORS.primary.white, dark: COLORS.neutral[900] },
|
|
346
|
+
surfaceL2: { light: COLORS.primary.white, dark: COLORS.neutral[850] },
|
|
347
|
+
surfaceL3: { light: COLORS.primary.white, dark: COLORS.neutral[800] },
|
|
348
|
+
surfaceL4: { light: COLORS.primary.white, dark: COLORS.neutral[750] },
|
|
349
|
+
surfaceL5: { light: COLORS.primary.white, dark: COLORS.neutral[700] },
|
|
350
|
+
surfaceL6: { light: COLORS.primary.white, dark: COLORS.neutral[650] },
|
|
351
|
+
|
|
352
|
+
// Overlays
|
|
353
|
+
overlay50: { light: COLORS.primary.black50, dark: COLORS.primary.white50 },
|
|
354
|
+
overlay50Inverse: { light: COLORS.primary.white50, dark: COLORS.primary.black50 },
|
|
355
|
+
} as const;
|
|
356
|
+
|
|
357
|
+
export type ThemedColorName = keyof typeof themedColorVars;
|
|
358
|
+
export type ThemedColorVariant = (typeof themedColorVars)[ThemedColorName];
|
|
359
|
+
|
|
360
|
+
// ============================================================================
|
|
361
|
+
// TYPOGRAPHY TOKENS
|
|
362
|
+
// ============================================================================
|
|
363
|
+
|
|
364
|
+
export const FONT_FAMILIES = {
|
|
365
|
+
geist: [
|
|
366
|
+
"Geist",
|
|
367
|
+
"-apple-system",
|
|
368
|
+
"BlinkMacSystemFont",
|
|
369
|
+
"Segoe UI",
|
|
370
|
+
"Roboto",
|
|
371
|
+
"sans-serif",
|
|
372
|
+
],
|
|
373
|
+
mono: [
|
|
374
|
+
"Geist Mono",
|
|
375
|
+
"SF Mono",
|
|
376
|
+
"Monaco",
|
|
377
|
+
"Inconsolata",
|
|
378
|
+
"Roboto Mono",
|
|
379
|
+
"monospace",
|
|
380
|
+
],
|
|
381
|
+
} as const;
|
|
382
|
+
|
|
383
|
+
export const FONT_WEIGHTS = {
|
|
384
|
+
regular: 400,
|
|
385
|
+
medium: 500,
|
|
386
|
+
semibold: 600,
|
|
387
|
+
bold: 700,
|
|
388
|
+
} as const;
|
|
389
|
+
|
|
390
|
+
export const FONT_SIZES = {
|
|
391
|
+
xs: SPACING_TOKENS["10"],
|
|
392
|
+
s: SPACING_TOKENS["12"],
|
|
393
|
+
m: SPACING_TOKENS["14"],
|
|
394
|
+
l: SPACING_TOKENS["16"],
|
|
395
|
+
xl: SPACING_TOKENS["18"],
|
|
396
|
+
"2xl": SPACING_TOKENS["20"],
|
|
397
|
+
"3xl": SPACING_TOKENS["24"],
|
|
398
|
+
"4xl": SPACING_TOKENS["28"],
|
|
399
|
+
"5xl": SPACING_TOKENS["32"],
|
|
400
|
+
"6xl": SPACING_TOKENS["40"],
|
|
401
|
+
"7xl": SPACING_TOKENS["48"],
|
|
402
|
+
"8xl": SPACING_TOKENS["56"],
|
|
403
|
+
} as const;
|
|
404
|
+
|
|
405
|
+
export const LINE_HEIGHTS = {
|
|
406
|
+
xs: SPACING_TOKENS["14"],
|
|
407
|
+
s: SPACING_TOKENS["16"],
|
|
408
|
+
m: SPACING_TOKENS["20"],
|
|
409
|
+
l: SPACING_TOKENS["24"],
|
|
410
|
+
xl: SPACING_TOKENS["26"],
|
|
411
|
+
"2xl": SPACING_TOKENS["28"],
|
|
412
|
+
"3xl": SPACING_TOKENS["32"],
|
|
413
|
+
"4xl": SPACING_TOKENS["36"],
|
|
414
|
+
"5xl": SPACING_TOKENS["40"],
|
|
415
|
+
"6xl": SPACING_TOKENS["48"],
|
|
416
|
+
"7xl": SPACING_TOKENS["56"],
|
|
417
|
+
"8xl": SPACING_TOKENS["64"],
|
|
418
|
+
} as const;
|
|
419
|
+
|
|
420
|
+
export const LETTER_SPACINGS = {
|
|
421
|
+
none: "0em",
|
|
422
|
+
xs: pxToRem(-1),
|
|
423
|
+
s: pxToRem(-0.5),
|
|
424
|
+
m: pxToRem(-0.25),
|
|
425
|
+
} as const;
|
|
426
|
+
|
|
427
|
+
export type FontFamily = keyof typeof FONT_FAMILIES;
|
|
428
|
+
export type FontWeight = keyof typeof FONT_WEIGHTS;
|
|
429
|
+
export type FontSize = keyof typeof FONT_SIZES;
|
|
430
|
+
export type LineHeight = keyof typeof LINE_HEIGHTS;
|
|
431
|
+
export type LetterSpacing = keyof typeof LETTER_SPACINGS;
|
|
432
|
+
|
|
433
|
+
// ============================================================================
|
|
434
|
+
// BORDER TOKENS
|
|
435
|
+
// ============================================================================
|
|
436
|
+
|
|
437
|
+
export const BORDER_RADIUS = {
|
|
438
|
+
circle: "50%",
|
|
439
|
+
pill: pxToRem(999),
|
|
440
|
+
xl: pxToRem(24),
|
|
441
|
+
lg: pxToRem(16),
|
|
442
|
+
md: pxToRem(12),
|
|
443
|
+
sm: pxToRem(8),
|
|
444
|
+
xs: pxToRem(4),
|
|
445
|
+
} as const;
|
|
446
|
+
|
|
447
|
+
export const BORDER_WIDTH = {
|
|
448
|
+
none: pxToRem(0),
|
|
449
|
+
xs: pxToRem(0.75),
|
|
450
|
+
s: pxToRem(1),
|
|
451
|
+
m: pxToRem(1.5),
|
|
452
|
+
l: pxToRem(2),
|
|
453
|
+
xl: pxToRem(4),
|
|
454
|
+
} as const;
|
|
455
|
+
|
|
456
|
+
export type BorderRadiusToken = keyof typeof BORDER_RADIUS;
|
|
457
|
+
export type BorderWidthToken = keyof typeof BORDER_WIDTH;
|
|
458
|
+
|
|
459
|
+
// ============================================================================
|
|
460
|
+
// SHADOW TOKENS
|
|
461
|
+
// ============================================================================
|
|
462
|
+
|
|
463
|
+
export const SHADOW_LAYERS = {
|
|
464
|
+
L0: "none",
|
|
465
|
+
L1: "0px 0px 2px 0px rgba(0, 0, 0, 0.06)",
|
|
466
|
+
L2: "0px 0px 2px 0px rgba(0, 0, 0, 0.08), 0px 2px 4px 0px rgba(0, 0, 0, 0.08)",
|
|
467
|
+
L3: "0px 0px 4px 0px rgba(0, 0, 0, 0.08), 0px 4px 8px 0px rgba(0, 0, 0, 0.10)",
|
|
468
|
+
L4: "0px 0px 6px 0px rgba(0, 0, 0, 0.08), 0px 8px 16px 0px rgba(0, 0, 0, 0.10)",
|
|
469
|
+
L5: "0px 0px 8px 0px rgba(0, 0, 0, 0.08), 0px 10px 20px 0px rgba(0, 0, 0, 0.10)",
|
|
470
|
+
L6: "0px 0px 10px 0px rgba(0, 0, 0, 0.08), 0px 12px 24px 0px rgba(0, 0, 0, 0.10)",
|
|
471
|
+
L7: "0px 0px 12px 0px rgba(0, 0, 0, 0.08), 0px 16px 32px 0px rgba(0, 0, 0, 0.10)",
|
|
472
|
+
} as const;
|
|
473
|
+
|
|
474
|
+
export type ShadowLayer = keyof typeof SHADOW_LAYERS;
|
|
475
|
+
|
|
476
|
+
// ============================================================================
|
|
477
|
+
// BREAKPOINTS
|
|
478
|
+
// ============================================================================
|
|
479
|
+
|
|
480
|
+
export const BREAKPOINTS = {
|
|
481
|
+
xs: {},
|
|
482
|
+
sm: { "@media": "screen and (min-width: 640px)" },
|
|
483
|
+
md: { "@media": "screen and (min-width: 768px)" },
|
|
484
|
+
lg: { "@media": "screen and (min-width: 1024px)" },
|
|
485
|
+
xl: { "@media": "screen and (min-width: 1280px)" },
|
|
486
|
+
} as const;
|
|
487
|
+
|
|
488
|
+
export type Breakpoint = keyof typeof BREAKPOINTS;
|
|
489
|
+
|
|
490
|
+
// ============================================================================
|
|
491
|
+
// TYPOGRAPHY STYLES
|
|
492
|
+
// ============================================================================
|
|
493
|
+
|
|
494
|
+
export const LABEL_FONT_SIZES = {
|
|
495
|
+
"2xs": pxToRem(14),
|
|
496
|
+
} as const;
|
|
497
|
+
|
|
498
|
+
export const LABEL_LINE_HEIGHTS = {
|
|
499
|
+
"2xs": pxToRem(14),
|
|
500
|
+
} as const;
|
|
501
|
+
|
|
502
|
+
export const TYPOGRAPHY_STYLES = {
|
|
503
|
+
label: {
|
|
504
|
+
"2xs": {
|
|
505
|
+
medium: {
|
|
506
|
+
fontSize: LABEL_FONT_SIZES["2xs"],
|
|
507
|
+
lineHeight: LABEL_LINE_HEIGHTS["2xs"],
|
|
508
|
+
fontWeight: FONT_WEIGHTS.medium,
|
|
509
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
510
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
heading: {
|
|
515
|
+
"3xl": {
|
|
516
|
+
semibold: {
|
|
517
|
+
fontSize: FONT_SIZES["8xl"],
|
|
518
|
+
lineHeight: LINE_HEIGHTS["8xl"],
|
|
519
|
+
fontWeight: FONT_WEIGHTS.semibold,
|
|
520
|
+
letterSpacing: LETTER_SPACINGS.xs,
|
|
521
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
522
|
+
},
|
|
523
|
+
},
|
|
524
|
+
"2xl": {
|
|
525
|
+
semibold: {
|
|
526
|
+
fontSize: FONT_SIZES["7xl"],
|
|
527
|
+
lineHeight: LINE_HEIGHTS["7xl"],
|
|
528
|
+
fontWeight: FONT_WEIGHTS.semibold,
|
|
529
|
+
letterSpacing: LETTER_SPACINGS.xs,
|
|
530
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
531
|
+
},
|
|
532
|
+
},
|
|
533
|
+
xl: {
|
|
534
|
+
semibold: {
|
|
535
|
+
fontSize: FONT_SIZES["6xl"],
|
|
536
|
+
lineHeight: LINE_HEIGHTS["6xl"],
|
|
537
|
+
fontWeight: FONT_WEIGHTS.semibold,
|
|
538
|
+
letterSpacing: LETTER_SPACINGS.xs,
|
|
539
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
540
|
+
},
|
|
541
|
+
},
|
|
542
|
+
l: {
|
|
543
|
+
semibold: {
|
|
544
|
+
fontSize: FONT_SIZES["5xl"],
|
|
545
|
+
lineHeight: LINE_HEIGHTS["5xl"],
|
|
546
|
+
fontWeight: FONT_WEIGHTS.semibold,
|
|
547
|
+
letterSpacing: LETTER_SPACINGS.s,
|
|
548
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
m: {
|
|
552
|
+
semibold: {
|
|
553
|
+
fontSize: FONT_SIZES["3xl"],
|
|
554
|
+
lineHeight: LINE_HEIGHTS["3xl"],
|
|
555
|
+
fontWeight: FONT_WEIGHTS.semibold,
|
|
556
|
+
letterSpacing: LETTER_SPACINGS.s,
|
|
557
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
558
|
+
},
|
|
559
|
+
},
|
|
560
|
+
s: {
|
|
561
|
+
semibold: {
|
|
562
|
+
fontSize: FONT_SIZES["2xl"],
|
|
563
|
+
lineHeight: LINE_HEIGHTS["2xl"],
|
|
564
|
+
fontWeight: FONT_WEIGHTS.semibold,
|
|
565
|
+
letterSpacing: LETTER_SPACINGS.s,
|
|
566
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
567
|
+
},
|
|
568
|
+
},
|
|
569
|
+
xs: {
|
|
570
|
+
semibold: {
|
|
571
|
+
fontSize: FONT_SIZES.l,
|
|
572
|
+
lineHeight: LINE_HEIGHTS.l,
|
|
573
|
+
fontWeight: FONT_WEIGHTS.semibold,
|
|
574
|
+
letterSpacing: LETTER_SPACINGS.m,
|
|
575
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
576
|
+
},
|
|
577
|
+
medium: {
|
|
578
|
+
fontSize: FONT_SIZES.l,
|
|
579
|
+
lineHeight: LINE_HEIGHTS.l,
|
|
580
|
+
fontWeight: FONT_WEIGHTS.medium,
|
|
581
|
+
letterSpacing: LETTER_SPACINGS.m,
|
|
582
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
583
|
+
},
|
|
584
|
+
},
|
|
585
|
+
"2xs": {
|
|
586
|
+
medium: {
|
|
587
|
+
fontSize: FONT_SIZES.m,
|
|
588
|
+
lineHeight: LINE_HEIGHTS.m,
|
|
589
|
+
fontWeight: FONT_WEIGHTS.medium,
|
|
590
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
591
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
592
|
+
},
|
|
593
|
+
},
|
|
594
|
+
},
|
|
595
|
+
text: {
|
|
596
|
+
"2xl": {
|
|
597
|
+
medium: {
|
|
598
|
+
fontSize: FONT_SIZES["3xl"],
|
|
599
|
+
lineHeight: LINE_HEIGHTS["3xl"],
|
|
600
|
+
fontWeight: FONT_WEIGHTS.medium,
|
|
601
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
602
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
603
|
+
},
|
|
604
|
+
regular: {
|
|
605
|
+
fontSize: FONT_SIZES["3xl"],
|
|
606
|
+
lineHeight: LINE_HEIGHTS["3xl"],
|
|
607
|
+
fontWeight: FONT_WEIGHTS.regular,
|
|
608
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
609
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
610
|
+
},
|
|
611
|
+
},
|
|
612
|
+
xl: {
|
|
613
|
+
medium: {
|
|
614
|
+
fontSize: FONT_SIZES["2xl"],
|
|
615
|
+
lineHeight: LINE_HEIGHTS["2xl"],
|
|
616
|
+
fontWeight: FONT_WEIGHTS.medium,
|
|
617
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
618
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
619
|
+
},
|
|
620
|
+
regular: {
|
|
621
|
+
fontSize: FONT_SIZES["2xl"],
|
|
622
|
+
lineHeight: LINE_HEIGHTS["2xl"],
|
|
623
|
+
fontWeight: FONT_WEIGHTS.regular,
|
|
624
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
625
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
626
|
+
},
|
|
627
|
+
},
|
|
628
|
+
l: {
|
|
629
|
+
medium: {
|
|
630
|
+
fontSize: FONT_SIZES.l,
|
|
631
|
+
lineHeight: LINE_HEIGHTS.l,
|
|
632
|
+
fontWeight: FONT_WEIGHTS.medium,
|
|
633
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
634
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
635
|
+
},
|
|
636
|
+
regular: {
|
|
637
|
+
fontSize: FONT_SIZES.l,
|
|
638
|
+
lineHeight: LINE_HEIGHTS.l,
|
|
639
|
+
fontWeight: FONT_WEIGHTS.regular,
|
|
640
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
641
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
642
|
+
},
|
|
643
|
+
},
|
|
644
|
+
m: {
|
|
645
|
+
medium: {
|
|
646
|
+
fontSize: FONT_SIZES.m,
|
|
647
|
+
lineHeight: LINE_HEIGHTS.m,
|
|
648
|
+
fontWeight: FONT_WEIGHTS.medium,
|
|
649
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
650
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
651
|
+
},
|
|
652
|
+
regular: {
|
|
653
|
+
fontSize: FONT_SIZES.m,
|
|
654
|
+
lineHeight: LINE_HEIGHTS.m,
|
|
655
|
+
fontWeight: FONT_WEIGHTS.regular,
|
|
656
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
657
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
658
|
+
},
|
|
659
|
+
},
|
|
660
|
+
s: {
|
|
661
|
+
medium: {
|
|
662
|
+
fontSize: FONT_SIZES.s,
|
|
663
|
+
lineHeight: LINE_HEIGHTS.s,
|
|
664
|
+
fontWeight: FONT_WEIGHTS.medium,
|
|
665
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
666
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
667
|
+
},
|
|
668
|
+
regular: {
|
|
669
|
+
fontSize: FONT_SIZES.s,
|
|
670
|
+
lineHeight: LINE_HEIGHTS.s,
|
|
671
|
+
fontWeight: FONT_WEIGHTS.regular,
|
|
672
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
673
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
674
|
+
},
|
|
675
|
+
},
|
|
676
|
+
xs: {
|
|
677
|
+
medium: {
|
|
678
|
+
fontSize: FONT_SIZES.xs,
|
|
679
|
+
lineHeight: LINE_HEIGHTS.xs,
|
|
680
|
+
fontWeight: FONT_WEIGHTS.medium,
|
|
681
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
682
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
683
|
+
},
|
|
684
|
+
regular: {
|
|
685
|
+
fontSize: FONT_SIZES.xs,
|
|
686
|
+
lineHeight: LINE_HEIGHTS.xs,
|
|
687
|
+
fontWeight: FONT_WEIGHTS.regular,
|
|
688
|
+
letterSpacing: LETTER_SPACINGS.none,
|
|
689
|
+
fontFamily: FONT_FAMILIES.geist,
|
|
690
|
+
},
|
|
691
|
+
},
|
|
692
|
+
},
|
|
693
|
+
} as const;
|
|
694
|
+
|
|
695
|
+
export type HeadingSize = keyof typeof TYPOGRAPHY_STYLES.heading;
|
|
696
|
+
export type TextSize = keyof typeof TYPOGRAPHY_STYLES.text;
|
|
697
|
+
export type LabelSize = keyof typeof TYPOGRAPHY_STYLES.label;
|
|
698
|
+
|
|
699
|
+
// ============================================================================
|
|
700
|
+
// Z-INDEX TOKENS
|
|
701
|
+
// ============================================================================
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Z-Index Scale
|
|
705
|
+
*
|
|
706
|
+
* Centralized z-index values for consistent layering across the application.
|
|
707
|
+
* Use these constants instead of hardcoding z-index values.
|
|
708
|
+
*
|
|
709
|
+
* Hierarchy (lowest to highest):
|
|
710
|
+
* - BASE: Default positioning (sticky headers, relative elements)
|
|
711
|
+
* - DROPDOWN: Menus, selects, popovers, date pickers
|
|
712
|
+
* - DRAWER: Side panels and their overlays
|
|
713
|
+
* - MODAL: Modal dialogs and their overlays
|
|
714
|
+
* - OVERLAY: Full-screen overlays
|
|
715
|
+
* - POPOVER: Elements that appear above modals (menus inside modals)
|
|
716
|
+
* - TOOLTIP: Contextual hints (always visible over most content)
|
|
717
|
+
* - TOAST: Critical notifications (highest priority)
|
|
718
|
+
*/
|
|
719
|
+
export const Z_INDEX = {
|
|
720
|
+
/** Base layer for sticky elements and relative positioning (z-index: 1) */
|
|
721
|
+
BASE: 1,
|
|
722
|
+
|
|
723
|
+
/** Dropdown menus, selects, and popovers (z-index: 50) */
|
|
724
|
+
DROPDOWN: 50,
|
|
725
|
+
|
|
726
|
+
/** Drawer/Side panel overlay backdrop (z-index: 80) */
|
|
727
|
+
DRAWER_OVERLAY: 80,
|
|
728
|
+
|
|
729
|
+
/** Drawer/Side panel content (z-index: 90) */
|
|
730
|
+
DRAWER_CONTENT: 90,
|
|
731
|
+
|
|
732
|
+
/** Modal overlay backdrop (z-index: 100) */
|
|
733
|
+
MODAL_OVERLAY: 100,
|
|
734
|
+
|
|
735
|
+
/** Modal content (z-index: 110) */
|
|
736
|
+
MODAL_CONTENT: 110,
|
|
737
|
+
|
|
738
|
+
/** Alert dialog overlay (z-index: 120) */
|
|
739
|
+
ALERT_OVERLAY: 120,
|
|
740
|
+
|
|
741
|
+
/** Alert dialog content (z-index: 130) */
|
|
742
|
+
ALERT_CONTENT: 130,
|
|
743
|
+
|
|
744
|
+
/** Full-screen overlay (z-index: 1000) */
|
|
745
|
+
OVERLAY: 1000,
|
|
746
|
+
|
|
747
|
+
/** Popovers that need to appear above overlays - menus inside modals (z-index: 1100) */
|
|
748
|
+
POPOVER: 1100,
|
|
749
|
+
|
|
750
|
+
/** Tooltips - high priority contextual hints (z-index: 1200) */
|
|
751
|
+
TOOLTIP: 1200,
|
|
752
|
+
|
|
753
|
+
/** Toast notifications - highest priority (z-index: 9999) */
|
|
754
|
+
TOAST: 9999,
|
|
755
|
+
} as const;
|
|
756
|
+
|
|
757
|
+
export type ZIndexKey = keyof typeof Z_INDEX;
|
|
758
|
+
export type ZIndexValue = (typeof Z_INDEX)[ZIndexKey];
|