@gtcx/tokens 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,583 @@
1
+ // src/primitives.ts
2
+ var colorPrimitives = {
3
+ /** GTCX brand primary — sky blue */
4
+ primary: {
5
+ 50: "#f0f9ff",
6
+ 100: "#e0f2fe",
7
+ 200: "#bae6fd",
8
+ 300: "#7dd3fc",
9
+ 400: "#38bdf8",
10
+ 500: "#0ea5e9",
11
+ 600: "#0284c7",
12
+ 700: "#0369a1",
13
+ 800: "#075985",
14
+ 900: "#0c4a6e",
15
+ 950: "#082f49"
16
+ },
17
+ /** GTCX brand secondary — purple */
18
+ secondary: {
19
+ 50: "#faf5ff",
20
+ 100: "#f3e8ff",
21
+ 200: "#e9d5ff",
22
+ 300: "#d8b4fe",
23
+ 400: "#c084fc",
24
+ 500: "#a855f7",
25
+ 600: "#9333ea",
26
+ 700: "#7c3aed",
27
+ 800: "#6b21a8",
28
+ 900: "#581c87",
29
+ 950: "#3b0764"
30
+ },
31
+ /** Positive feedback, approvals, profit */
32
+ success: {
33
+ 50: "#f0fdf4",
34
+ 100: "#dcfce7",
35
+ 200: "#bbf7d0",
36
+ 300: "#86efac",
37
+ 400: "#4ade80",
38
+ 500: "#22c55e",
39
+ 600: "#16a34a",
40
+ 700: "#15803d",
41
+ 800: "#166534",
42
+ 900: "#14532d",
43
+ 950: "#052e16"
44
+ },
45
+ /** Caution states, pending actions */
46
+ warning: {
47
+ 50: "#fffbeb",
48
+ 100: "#fef3c7",
49
+ 200: "#fde68a",
50
+ 300: "#fcd34d",
51
+ 400: "#fbbf24",
52
+ 500: "#f59e0b",
53
+ 600: "#d97706",
54
+ 700: "#b45309",
55
+ 800: "#92400e",
56
+ 900: "#78350f",
57
+ 950: "#451a03"
58
+ },
59
+ /** Destructive actions, rejections, loss */
60
+ error: {
61
+ 50: "#fef2f2",
62
+ 100: "#fee2e2",
63
+ 200: "#fecaca",
64
+ 300: "#fca5a5",
65
+ 400: "#f87171",
66
+ 500: "#ef4444",
67
+ 600: "#dc2626",
68
+ 700: "#b91c1c",
69
+ 800: "#991b1b",
70
+ 900: "#7f1d1d",
71
+ 950: "#450a0a"
72
+ },
73
+ /** Informational, links */
74
+ info: {
75
+ 50: "#eff6ff",
76
+ 100: "#dbeafe",
77
+ 200: "#bfdbfe",
78
+ 300: "#93c5fd",
79
+ 400: "#60a5fa",
80
+ 500: "#3b82f6",
81
+ 600: "#2563eb",
82
+ 700: "#1d4ed8",
83
+ 800: "#1e40af",
84
+ 900: "#1e3a8a",
85
+ 950: "#172554"
86
+ },
87
+ /** Grays for text, backgrounds, borders */
88
+ neutral: {
89
+ 50: "#fafafa",
90
+ 100: "#f5f5f5",
91
+ 200: "#e5e5e5",
92
+ 300: "#d4d4d4",
93
+ 400: "#a3a3a3",
94
+ 500: "#737373",
95
+ 600: "#525252",
96
+ 700: "#404040",
97
+ 800: "#262626",
98
+ 900: "#171717",
99
+ 950: "#0a0a0a"
100
+ },
101
+ white: "#ffffff",
102
+ black: "#000000"
103
+ };
104
+ var spacingPrimitives = {
105
+ 0: 0,
106
+ 1: 4,
107
+ 2: 8,
108
+ 3: 12,
109
+ 4: 16,
110
+ 5: 20,
111
+ 6: 24,
112
+ 8: 32,
113
+ 10: 40,
114
+ 12: 48,
115
+ 16: 64,
116
+ 20: 80,
117
+ 24: 96,
118
+ 32: 128
119
+ };
120
+ var fontSizePrimitives = {
121
+ xs: 12,
122
+ sm: 14,
123
+ base: 16,
124
+ lg: 18,
125
+ xl: 20,
126
+ "2xl": 24,
127
+ "3xl": 30,
128
+ "4xl": 36,
129
+ "5xl": 48
130
+ };
131
+ var fontWeightPrimitives = {
132
+ normal: 400,
133
+ medium: 500,
134
+ semibold: 600,
135
+ bold: 700
136
+ };
137
+ var lineHeightPrimitives = {
138
+ tight: 1.2,
139
+ normal: 1.5,
140
+ relaxed: 1.7
141
+ };
142
+ var letterSpacingPrimitives = {
143
+ tight: "-0.025em",
144
+ normal: "0em",
145
+ wide: "0.025em"
146
+ };
147
+ var fontFamilyPrimitives = {
148
+ sans: "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
149
+ mono: "JetBrains Mono, Fira Code, Consolas, monospace",
150
+ serif: "Georgia, 'Times New Roman', serif"
151
+ };
152
+ var borderRadiusPrimitives = {
153
+ none: 0,
154
+ sm: 2,
155
+ md: 4,
156
+ lg: 8,
157
+ xl: 12,
158
+ full: 9999
159
+ };
160
+ var shadowPrimitives = {
161
+ none: "none",
162
+ sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
163
+ md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
164
+ lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"
165
+ };
166
+ var breakpointPrimitives = {
167
+ xs: 480,
168
+ sm: 576,
169
+ md: 768,
170
+ lg: 992,
171
+ xl: 1200,
172
+ xxl: 1600
173
+ };
174
+ var zIndexPrimitives = {
175
+ dropdown: 1e3,
176
+ sticky: 1020,
177
+ fixed: 1030,
178
+ modal: 1040,
179
+ popover: 1050,
180
+ tooltip: 1060
181
+ };
182
+ var transitionPrimitives = {
183
+ fast: "150ms ease",
184
+ normal: "250ms ease",
185
+ slow: "350ms ease"
186
+ };
187
+ var opacityPrimitives = {
188
+ /** Disabled controls */
189
+ disabled: 0.4,
190
+ /** Hover state overlays */
191
+ hover: 0.08,
192
+ /** Active/pressed state overlays */
193
+ pressed: 0.12,
194
+ /** Modal backdrop overlay */
195
+ overlay: 0.5,
196
+ /** Loading state content fade */
197
+ loading: 0.65
198
+ };
199
+ var focusPrimitives = {
200
+ /** Ring width in pixels */
201
+ ringWidth: 2,
202
+ /** Ring offset from element edge in pixels */
203
+ ringOffset: 2,
204
+ /** Ring color — uses primary brand color */
205
+ ringColor: colorPrimitives.primary[500],
206
+ /** Ring border-style */
207
+ ringStyle: "solid"
208
+ };
209
+ var motionPrimitives = {
210
+ /** Quick micro-interactions (hover, focus) */
211
+ durationFast: 150,
212
+ /** Standard transitions (expand, collapse) */
213
+ durationNormal: 250,
214
+ /** Deliberate animations (page transitions, modals) */
215
+ durationSlow: 350,
216
+ /** Default easing — deceleration curve */
217
+ easeDefault: "cubic-bezier(0.4, 0, 0.2, 1)",
218
+ /** Entrance easing — elements entering the viewport */
219
+ easeIn: "cubic-bezier(0.4, 0, 1, 1)",
220
+ /** Exit easing — elements leaving the viewport */
221
+ easeOut: "cubic-bezier(0, 0, 0.2, 1)",
222
+ /** Symmetric easing — elements that enter and exit */
223
+ easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)"
224
+ };
225
+
226
+ // src/semantic.ts
227
+ var semanticColors = {
228
+ // Brand
229
+ /** Primary brand action color */
230
+ primary: colorPrimitives.primary[500],
231
+ /** Primary hover state */
232
+ primaryHover: colorPrimitives.primary[600],
233
+ /** Primary active/pressed state */
234
+ primaryActive: colorPrimitives.primary[700],
235
+ /** Primary tinted background (selected rows, badges) */
236
+ primaryBg: colorPrimitives.primary[50],
237
+ /** Secondary brand color */
238
+ secondary: colorPrimitives.secondary[500],
239
+ /** Secondary hover state */
240
+ secondaryHover: colorPrimitives.secondary[600],
241
+ // Feedback
242
+ /** Positive outcome (approvals, passing checks) */
243
+ success: colorPrimitives.success[500],
244
+ /** Caution state (pending review, warnings) */
245
+ warning: colorPrimitives.warning[500],
246
+ /** Destructive/failure state */
247
+ error: colorPrimitives.error[500],
248
+ /** Informational state */
249
+ info: colorPrimitives.info[500],
250
+ // Domain-specific — all traced to primitive scales
251
+ /** Financial gain */
252
+ profit: colorPrimitives.success[500],
253
+ /** Financial loss */
254
+ loss: colorPrimitives.error[500],
255
+ /** Compliance approved */
256
+ approved: colorPrimitives.success[600],
257
+ /** Compliance pending */
258
+ pending: colorPrimitives.warning[600],
259
+ /** Compliance rejected */
260
+ rejected: colorPrimitives.error[600],
261
+ /** Security verified */
262
+ secure: colorPrimitives.success[600],
263
+ /** Security compromised */
264
+ insecure: colorPrimitives.error[600],
265
+ // Text
266
+ /** Primary body text */
267
+ textPrimary: colorPrimitives.neutral[900],
268
+ /** Secondary/supporting text */
269
+ textSecondary: colorPrimitives.neutral[600],
270
+ /** Tertiary/label text */
271
+ textTertiary: colorPrimitives.neutral[500],
272
+ /** Muted/placeholder text */
273
+ textMuted: colorPrimitives.neutral[400],
274
+ /** Text on dark backgrounds */
275
+ textInverse: colorPrimitives.neutral[50],
276
+ // Backgrounds
277
+ /** Page-level background */
278
+ bgPage: colorPrimitives.neutral[50],
279
+ /** Card/surface background */
280
+ bgSurface: colorPrimitives.white,
281
+ /** Surface hover state */
282
+ bgSurfaceHover: colorPrimitives.neutral[100],
283
+ /** Tertiary surface (nested cards, wells) */
284
+ bgSurfaceTertiary: colorPrimitives.neutral[200],
285
+ /** Inverse background (dark sections) */
286
+ bgInverse: colorPrimitives.neutral[900],
287
+ /** Sidebar background */
288
+ bgSidebar: colorPrimitives.white,
289
+ /** Header background */
290
+ bgHeader: colorPrimitives.white,
291
+ // Borders
292
+ /** Default border */
293
+ border: colorPrimitives.neutral[200],
294
+ /** Light/subtle border */
295
+ borderLight: colorPrimitives.neutral[100],
296
+ /** Emphasized border */
297
+ borderSecondary: colorPrimitives.neutral[300],
298
+ /** Focus ring border */
299
+ borderFocus: colorPrimitives.primary[500],
300
+ // Links
301
+ /** Default link color */
302
+ link: colorPrimitives.primary[600],
303
+ /** Link hover state */
304
+ linkHover: colorPrimitives.primary[700]
305
+ };
306
+ var semanticSpacing = {
307
+ /** Horizontal page gutter */
308
+ pageGutter: spacingPrimitives[6],
309
+ /** Internal card padding */
310
+ cardPadding: spacingPrimitives[4],
311
+ /** Gap between page sections */
312
+ sectionGap: spacingPrimitives[6],
313
+ /** Gap between sibling components */
314
+ componentGap: spacingPrimitives[3],
315
+ /** Inline element gap (icon + label) */
316
+ inlineGap: spacingPrimitives[2],
317
+ /** Per-component spacing presets */
318
+ component: {
319
+ button: {
320
+ paddingX: spacingPrimitives[4],
321
+ paddingY: spacingPrimitives[2],
322
+ gap: spacingPrimitives[2]
323
+ },
324
+ input: {
325
+ paddingX: spacingPrimitives[3],
326
+ paddingY: spacingPrimitives[2]
327
+ },
328
+ card: {
329
+ padding: spacingPrimitives[6],
330
+ gap: spacingPrimitives[4]
331
+ },
332
+ form: {
333
+ fieldGap: spacingPrimitives[4],
334
+ sectionGap: spacingPrimitives[8],
335
+ labelGap: spacingPrimitives[2]
336
+ },
337
+ modal: {
338
+ padding: spacingPrimitives[6],
339
+ gap: spacingPrimitives[4]
340
+ },
341
+ table: {
342
+ cellPadding: spacingPrimitives[4],
343
+ headerPadding: spacingPrimitives[4]
344
+ }
345
+ },
346
+ /** Layout-level spacing presets */
347
+ layout: {
348
+ container: {
349
+ paddingX: spacingPrimitives[4],
350
+ paddingY: spacingPrimitives[6]
351
+ },
352
+ section: {
353
+ marginY: spacingPrimitives[12],
354
+ gap: spacingPrimitives[8]
355
+ },
356
+ page: {
357
+ marginY: spacingPrimitives[16],
358
+ paddingX: spacingPrimitives[6]
359
+ }
360
+ }
361
+ };
362
+ var semanticTypography = {
363
+ /** Default sans-serif font stack */
364
+ fontFamily: fontFamilyPrimitives.sans,
365
+ /** Monospace font stack for code */
366
+ fontFamilyCode: fontFamilyPrimitives.mono,
367
+ /** Serif font stack for editorial content */
368
+ fontFamilySerif: fontFamilyPrimitives.serif,
369
+ /** Display type scale — hero sections, feature numbers */
370
+ display: {
371
+ lg: {
372
+ fontSize: fontSizePrimitives["5xl"],
373
+ fontWeight: fontWeightPrimitives.bold,
374
+ lineHeight: lineHeightPrimitives.tight,
375
+ letterSpacing: letterSpacingPrimitives.tight
376
+ },
377
+ md: {
378
+ fontSize: fontSizePrimitives["4xl"],
379
+ fontWeight: fontWeightPrimitives.bold,
380
+ lineHeight: lineHeightPrimitives.tight,
381
+ letterSpacing: letterSpacingPrimitives.normal
382
+ },
383
+ sm: {
384
+ fontSize: fontSizePrimitives["3xl"],
385
+ fontWeight: fontWeightPrimitives.semibold,
386
+ lineHeight: lineHeightPrimitives.tight,
387
+ letterSpacing: letterSpacingPrimitives.normal
388
+ }
389
+ },
390
+ /** Heading type scale — page/section/card headings */
391
+ heading: {
392
+ h1: {
393
+ fontSize: fontSizePrimitives["3xl"],
394
+ fontWeight: fontWeightPrimitives.bold,
395
+ lineHeight: lineHeightPrimitives.tight
396
+ },
397
+ h2: {
398
+ fontSize: fontSizePrimitives["2xl"],
399
+ fontWeight: fontWeightPrimitives.semibold,
400
+ lineHeight: lineHeightPrimitives.tight
401
+ },
402
+ h3: {
403
+ fontSize: fontSizePrimitives.xl,
404
+ fontWeight: fontWeightPrimitives.semibold,
405
+ lineHeight: lineHeightPrimitives.normal
406
+ },
407
+ h4: {
408
+ fontSize: fontSizePrimitives.lg,
409
+ fontWeight: fontWeightPrimitives.medium,
410
+ lineHeight: lineHeightPrimitives.normal
411
+ }
412
+ },
413
+ /** Body type scale — paragraphs, descriptions */
414
+ body: {
415
+ lg: {
416
+ fontSize: fontSizePrimitives.lg,
417
+ fontWeight: fontWeightPrimitives.normal,
418
+ lineHeight: lineHeightPrimitives.relaxed
419
+ },
420
+ md: {
421
+ fontSize: fontSizePrimitives.base,
422
+ fontWeight: fontWeightPrimitives.normal,
423
+ lineHeight: lineHeightPrimitives.normal
424
+ },
425
+ sm: {
426
+ fontSize: fontSizePrimitives.sm,
427
+ fontWeight: fontWeightPrimitives.normal,
428
+ lineHeight: lineHeightPrimitives.normal
429
+ }
430
+ },
431
+ /** Caption — footnotes, timestamps, fine print */
432
+ caption: {
433
+ fontSize: fontSizePrimitives.xs,
434
+ fontWeight: fontWeightPrimitives.normal,
435
+ lineHeight: lineHeightPrimitives.normal
436
+ },
437
+ /** Button label type scale */
438
+ button: {
439
+ lg: {
440
+ fontSize: fontSizePrimitives.lg,
441
+ fontWeight: fontWeightPrimitives.medium,
442
+ lineHeight: lineHeightPrimitives.normal
443
+ },
444
+ md: {
445
+ fontSize: fontSizePrimitives.base,
446
+ fontWeight: fontWeightPrimitives.medium,
447
+ lineHeight: lineHeightPrimitives.normal
448
+ },
449
+ sm: {
450
+ fontSize: fontSizePrimitives.sm,
451
+ fontWeight: fontWeightPrimitives.medium,
452
+ lineHeight: lineHeightPrimitives.normal
453
+ }
454
+ }
455
+ };
456
+ var semanticRadii = {
457
+ /** Default component radius */
458
+ component: borderRadiusPrimitives.md,
459
+ /** Card/panel radius */
460
+ card: borderRadiusPrimitives.lg,
461
+ /** Button radius */
462
+ button: borderRadiusPrimitives.md,
463
+ /** Input/select radius */
464
+ input: borderRadiusPrimitives.md,
465
+ /** Tag/badge radius */
466
+ tag: borderRadiusPrimitives.sm,
467
+ /** Avatar — fully round */
468
+ avatar: borderRadiusPrimitives.full
469
+ };
470
+ var semanticShadows = {
471
+ /** Card/panel elevation */
472
+ card: shadowPrimitives.sm,
473
+ /** Dropdown/popover elevation */
474
+ dropdown: shadowPrimitives.md,
475
+ /** Modal/dialog elevation */
476
+ modal: shadowPrimitives.lg
477
+ };
478
+ var semanticLayout = {
479
+ /** Sidebar expanded width */
480
+ sidebarWidth: 240,
481
+ /** Sidebar collapsed width */
482
+ sidebarCollapsedWidth: 72,
483
+ /** Top header height */
484
+ headerHeight: 56,
485
+ /** Maximum content area width */
486
+ contentMaxWidth: 1440
487
+ };
488
+ var semanticTokens = {
489
+ colors: semanticColors,
490
+ spacing: semanticSpacing,
491
+ typography: semanticTypography,
492
+ radii: semanticRadii,
493
+ shadows: semanticShadows,
494
+ layout: semanticLayout
495
+ };
496
+
497
+ // src/dark.ts
498
+ var darkSemanticColors = {
499
+ // Brand — shifted lighter for contrast on dark backgrounds
500
+ primary: colorPrimitives.primary[400],
501
+ primaryHover: colorPrimitives.primary[300],
502
+ primaryActive: colorPrimitives.primary[500],
503
+ primaryBg: colorPrimitives.primary[950],
504
+ secondary: colorPrimitives.secondary[400],
505
+ secondaryHover: colorPrimitives.secondary[300],
506
+ // Feedback — shifted to 400 for readability
507
+ success: colorPrimitives.success[400],
508
+ warning: colorPrimitives.warning[400],
509
+ error: colorPrimitives.error[400],
510
+ info: colorPrimitives.info[400],
511
+ // Domain-specific
512
+ profit: colorPrimitives.success[400],
513
+ loss: colorPrimitives.error[400],
514
+ approved: colorPrimitives.success[400],
515
+ pending: colorPrimitives.warning[400],
516
+ rejected: colorPrimitives.error[400],
517
+ secure: colorPrimitives.success[400],
518
+ insecure: colorPrimitives.error[400],
519
+ // Text — light on dark
520
+ textPrimary: colorPrimitives.neutral[50],
521
+ textSecondary: colorPrimitives.neutral[300],
522
+ textTertiary: colorPrimitives.neutral[400],
523
+ textMuted: colorPrimitives.neutral[500],
524
+ textInverse: colorPrimitives.neutral[900],
525
+ // Backgrounds — dark
526
+ bgPage: colorPrimitives.neutral[950],
527
+ bgSurface: colorPrimitives.neutral[900],
528
+ bgSurfaceHover: colorPrimitives.neutral[800],
529
+ bgSurfaceTertiary: colorPrimitives.neutral[700],
530
+ bgInverse: colorPrimitives.neutral[50],
531
+ bgSidebar: colorPrimitives.neutral[900],
532
+ bgHeader: colorPrimitives.neutral[900],
533
+ // Borders — subtle on dark
534
+ border: colorPrimitives.neutral[700],
535
+ borderLight: colorPrimitives.neutral[800],
536
+ borderSecondary: colorPrimitives.neutral[600],
537
+ borderFocus: colorPrimitives.primary[400],
538
+ // Links
539
+ link: colorPrimitives.primary[400],
540
+ linkHover: colorPrimitives.primary[300]
541
+ };
542
+ var darkColors = {
543
+ text: {
544
+ primary: darkSemanticColors.textPrimary,
545
+ secondary: darkSemanticColors.textSecondary,
546
+ tertiary: darkSemanticColors.textTertiary
547
+ },
548
+ background: {
549
+ primary: darkSemanticColors.bgPage,
550
+ secondary: darkSemanticColors.bgSurface,
551
+ tertiary: darkSemanticColors.bgSurfaceTertiary
552
+ },
553
+ border: {
554
+ primary: darkSemanticColors.border,
555
+ secondary: darkSemanticColors.borderSecondary
556
+ }
557
+ };
558
+ export {
559
+ borderRadiusPrimitives,
560
+ breakpointPrimitives,
561
+ colorPrimitives,
562
+ darkColors,
563
+ darkSemanticColors,
564
+ focusPrimitives,
565
+ fontFamilyPrimitives,
566
+ fontSizePrimitives,
567
+ fontWeightPrimitives,
568
+ letterSpacingPrimitives,
569
+ lineHeightPrimitives,
570
+ motionPrimitives,
571
+ opacityPrimitives,
572
+ semanticColors,
573
+ semanticLayout,
574
+ semanticRadii,
575
+ semanticShadows,
576
+ semanticSpacing,
577
+ semanticTokens,
578
+ semanticTypography,
579
+ shadowPrimitives,
580
+ spacingPrimitives,
581
+ transitionPrimitives,
582
+ zIndexPrimitives
583
+ };
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@gtcx/tokens",
3
+ "version": "0.1.0",
4
+ "description": "GTCX design tokens — primitives, semantic, platform, and dark theme",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs"
13
+ }
14
+ },
15
+ "sideEffects": false,
16
+ "scripts": {
17
+ "build": "tsup src/index.ts --format esm,cjs --dts",
18
+ "dev": "tsup src/index.ts --format esm,cjs --dts --watch",
19
+ "lint": "eslint src/",
20
+ "typecheck": "tsc --noEmit",
21
+ "test": "vitest run"
22
+ },
23
+ "devDependencies": {
24
+ "tsup": "^8.0.0",
25
+ "typescript": "^5.0.0"
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "README.md"
30
+ ],
31
+ "publishConfig": {
32
+ "access": "public"
33
+ }
34
+ }