@gtcx/tokens 0.1.0 → 0.2.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.
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/platforms/fifty-four.ts
21
+ var fifty_four_exports = {};
22
+ __export(fifty_four_exports, {
23
+ fiftyFourColors: () => fiftyFourColors,
24
+ fiftyFourPlatformTokens: () => fiftyFourPlatformTokens,
25
+ fiftyFourRadii: () => fiftyFourRadii,
26
+ fiftyFourShadows: () => fiftyFourShadows
27
+ });
28
+ module.exports = __toCommonJS(fifty_four_exports);
29
+ var fiftyFourColors = {
30
+ // Brand — teal accent
31
+ primary: "#00E5C8",
32
+ primaryHover: "#00D4B8",
33
+ primaryActive: "#00BFA8",
34
+ primaryBg: "#0A1F1C",
35
+ secondary: "#A78BFA",
36
+ secondaryHover: "#8B6FE0",
37
+ // Feedback — vivid on dark backgrounds
38
+ success: "#22C55E",
39
+ warning: "#F59E0B",
40
+ error: "#EF4444",
41
+ info: "#3B82F6",
42
+ // Domain-specific
43
+ profit: "#22C55E",
44
+ loss: "#EF4444",
45
+ approved: "#16A34A",
46
+ pending: "#D97706",
47
+ rejected: "#DC2626",
48
+ secure: "#16A34A",
49
+ insecure: "#DC2626",
50
+ // Text — WCAG AA enforced (§1.2)
51
+ textPrimary: "#EDEDF0",
52
+ textSecondary: "#A0A0AB",
53
+ textTertiary: "#71717A",
54
+ textMuted: "#52525B",
55
+ textInverse: "#0E0E11",
56
+ // Backgrounds — elevation stack (§1.1)
57
+ // Level 0: Void (#08090A) — page canvas
58
+ // Level 1: Surface (#111116) — cards, panels, sidebar
59
+ // Level 2: Elevated (#191920) — hover, active panels, drawers
60
+ // Level 3: Raised (#222229) — dropdowns, popovers, command bar
61
+ // Level 4: Overlay (#2A2A32) — modals, dialogs, toasts
62
+ // Level 5: Spotlight (#333340) — tooltips, context menus
63
+ bgPage: "#08090A",
64
+ bgSurface: "#111116",
65
+ bgSurfaceHover: "#191920",
66
+ bgSurfaceTertiary: "#222229",
67
+ bgInverse: "#EDEDF0",
68
+ bgSidebar: "#0E0E13",
69
+ bgHeader: "#0E0E13",
70
+ // Borders — three rgba tiers (§1.4)
71
+ // Subtle: rgba(255, 255, 255, 0.06)
72
+ // Default: rgba(255, 255, 255, 0.10)
73
+ // Emphasis: rgba(255, 255, 255, 0.16)
74
+ //
75
+ // Note: CSS variables use rgba values directly. These hex fallbacks are
76
+ // for JS consumers that require string hex. The CSS generation script
77
+ // outputs the canonical rgba values.
78
+ border: "rgba(255, 255, 255, 0.10)",
79
+ borderLight: "rgba(255, 255, 255, 0.06)",
80
+ borderSecondary: "rgba(255, 255, 255, 0.16)",
81
+ borderFocus: "#00E5C8",
82
+ // Links
83
+ link: "#00E5C8",
84
+ linkHover: "#00D4B8"
85
+ };
86
+ var fiftyFourRadii = {
87
+ component: 6,
88
+ card: 10,
89
+ button: 6,
90
+ input: 6,
91
+ tag: 4,
92
+ avatar: 9999
93
+ };
94
+ var fiftyFourShadows = {
95
+ card: "0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04)",
96
+ dropdown: "0 8px 24px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06)",
97
+ modal: "0 24px 48px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08)"
98
+ };
99
+ var fiftyFourPlatformTokens = {
100
+ colors: fiftyFourColors,
101
+ radii: fiftyFourRadii,
102
+ shadows: fiftyFourShadows
103
+ };
104
+ // Annotate the CommonJS export names for ESM import in node:
105
+ 0 && (module.exports = {
106
+ fiftyFourColors,
107
+ fiftyFourPlatformTokens,
108
+ fiftyFourRadii,
109
+ fiftyFourShadows
110
+ });
@@ -0,0 +1,12 @@
1
+ import {
2
+ fiftyFourColors,
3
+ fiftyFourPlatformTokens,
4
+ fiftyFourRadii,
5
+ fiftyFourShadows
6
+ } from "../chunk-FB6JVSW6.mjs";
7
+ export {
8
+ fiftyFourColors,
9
+ fiftyFourPlatformTokens,
10
+ fiftyFourRadii,
11
+ fiftyFourShadows
12
+ };
package/package.json CHANGED
@@ -1,34 +1,46 @@
1
1
  {
2
2
  "name": "@gtcx/tokens",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "GTCX design tokens — primitives, semantic, platform, and dark theme",
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.js",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js",
12
- "require": "./dist/index.cjs"
13
- }
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ },
14
+ "./platforms/fifty-four": {
15
+ "types": "./dist/platforms/fifty-four.d.ts",
16
+ "import": "./dist/platforms/fifty-four.mjs",
17
+ "require": "./dist/platforms/fifty-four.js"
18
+ },
19
+ "./css": {
20
+ "types": "./dist/css.d.ts",
21
+ "import": "./dist/css.mjs",
22
+ "require": "./dist/css.js"
23
+ },
24
+ "./css/platforms/*": "./css/platforms/*"
14
25
  },
15
26
  "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
27
  "devDependencies": {
24
28
  "tsup": "^8.0.0",
25
29
  "typescript": "^5.0.0"
26
30
  },
27
31
  "files": [
28
32
  "dist",
33
+ "css",
29
34
  "README.md"
30
35
  ],
31
36
  "publishConfig": {
32
37
  "access": "public"
38
+ },
39
+ "scripts": {
40
+ "build": "tsup src/index.ts src/platforms/fifty-four.ts src/css.ts --format esm,cjs --dts && node scripts/generate-css.mjs",
41
+ "dev": "tsup src/index.ts src/platforms/fifty-four.ts src/css.ts --format esm,cjs --dts --watch",
42
+ "lint": "eslint src/",
43
+ "typecheck": "tsc --noEmit",
44
+ "test": "vitest run"
33
45
  }
34
- }
46
+ }
package/dist/index.cjs DELETED
@@ -1,384 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- borderRadiusPrimitives: () => borderRadiusPrimitives,
24
- colorPrimitives: () => colorPrimitives,
25
- darkColors: () => darkColors,
26
- fontFamilyPrimitives: () => fontFamilyPrimitives,
27
- fontSizePrimitives: () => fontSizePrimitives,
28
- fontWeightPrimitives: () => fontWeightPrimitives,
29
- letterSpacingPrimitives: () => letterSpacingPrimitives,
30
- lineHeightPrimitives: () => lineHeightPrimitives,
31
- platformColors: () => platformColors,
32
- platformSpacing: () => platformSpacing,
33
- semanticTokens: () => semanticTokens,
34
- shadowPrimitives: () => shadowPrimitives,
35
- spacingPrimitives: () => spacingPrimitives
36
- });
37
- module.exports = __toCommonJS(index_exports);
38
-
39
- // src/primitives.ts
40
- var colorPrimitives = {
41
- // GTCX brand primary (sky blue)
42
- primary: {
43
- 50: "#f0f9ff",
44
- 100: "#e0f2fe",
45
- 200: "#bae6fd",
46
- 300: "#7dd3fc",
47
- 400: "#38bdf8",
48
- 500: "#0ea5e9",
49
- 600: "#0284c7",
50
- 700: "#0369a1",
51
- 800: "#075985",
52
- 900: "#0c4a6e",
53
- 950: "#082f49"
54
- },
55
- secondary: {
56
- 50: "#faf5ff",
57
- 100: "#f3e8ff",
58
- 200: "#e9d5ff",
59
- 300: "#d8b4fe",
60
- 400: "#c084fc",
61
- 500: "#a855f7",
62
- 600: "#9333ea",
63
- 700: "#7c3aed",
64
- 800: "#6b21a8",
65
- 900: "#581c87",
66
- 950: "#3b0764"
67
- },
68
- success: {
69
- 50: "#f0fdf4",
70
- 100: "#dcfce7",
71
- 200: "#bbf7d0",
72
- 300: "#86efac",
73
- 400: "#4ade80",
74
- 500: "#22c55e",
75
- 600: "#16a34a",
76
- 700: "#15803d",
77
- 800: "#166534",
78
- 900: "#14532d",
79
- 950: "#052e16"
80
- },
81
- warning: {
82
- 50: "#fffbeb",
83
- 100: "#fef3c7",
84
- 200: "#fde68a",
85
- 300: "#fcd34d",
86
- 400: "#fbbf24",
87
- 500: "#f59e0b",
88
- 600: "#d97706",
89
- 700: "#b45309",
90
- 800: "#92400e",
91
- 900: "#78350f",
92
- 950: "#451a03"
93
- },
94
- error: {
95
- 50: "#fef2f2",
96
- 100: "#fee2e2",
97
- 200: "#fecaca",
98
- 300: "#fca5a5",
99
- 400: "#f87171",
100
- 500: "#ef4444",
101
- 600: "#dc2626",
102
- 700: "#b91c1c",
103
- 800: "#991b1b",
104
- 900: "#7f1d1d",
105
- 950: "#450a0a"
106
- },
107
- info: {
108
- 50: "#eff6ff",
109
- 100: "#dbeafe",
110
- 200: "#bfdbfe",
111
- 300: "#93c5fd",
112
- 400: "#60a5fa",
113
- 500: "#3b82f6",
114
- 600: "#2563eb",
115
- 700: "#1d4ed8",
116
- 800: "#1e40af",
117
- 900: "#1e3a8a",
118
- 950: "#172554"
119
- },
120
- neutral: {
121
- 50: "#fafafa",
122
- 100: "#f5f5f5",
123
- 200: "#e5e5e5",
124
- 300: "#d4d4d4",
125
- 400: "#a3a3a3",
126
- 500: "#737373",
127
- 600: "#525252",
128
- 700: "#404040",
129
- 800: "#262626",
130
- 900: "#171717",
131
- 950: "#0a0a0a"
132
- },
133
- white: "#ffffff",
134
- black: "#000000"
135
- };
136
- var spacingPrimitives = {
137
- 0: 0,
138
- 1: 4,
139
- 2: 8,
140
- 3: 12,
141
- 4: 16,
142
- 5: 20,
143
- 6: 24,
144
- 8: 32,
145
- 10: 40,
146
- 12: 48,
147
- 16: 64,
148
- 20: 80,
149
- 24: 96,
150
- 32: 128
151
- };
152
- var fontSizePrimitives = {
153
- xs: 12,
154
- sm: 14,
155
- base: 16,
156
- lg: 18,
157
- xl: 20,
158
- "2xl": 24,
159
- "3xl": 30,
160
- "4xl": 36,
161
- "5xl": 48
162
- };
163
- var fontWeightPrimitives = {
164
- normal: 400,
165
- medium: 500,
166
- semibold: 600,
167
- bold: 700
168
- };
169
- var lineHeightPrimitives = {
170
- tight: 1.2,
171
- normal: 1.5,
172
- relaxed: 1.7
173
- };
174
- var letterSpacingPrimitives = {
175
- tight: "-0.025em",
176
- normal: "0em",
177
- wide: "0.025em"
178
- };
179
- var borderRadiusPrimitives = {
180
- none: 0,
181
- sm: 2,
182
- md: 4,
183
- lg: 8,
184
- xl: 12,
185
- full: 9999
186
- };
187
- var shadowPrimitives = {
188
- none: "none",
189
- sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
190
- md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
191
- lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"
192
- };
193
- var fontFamilyPrimitives = {
194
- sans: "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
195
- mono: "JetBrains Mono, Fira Code, Consolas, monospace",
196
- serif: "Georgia, 'Times New Roman', serif"
197
- };
198
-
199
- // src/semantic.ts
200
- var semanticTokens = {
201
- colors: {
202
- // Brand
203
- primary: colorPrimitives.primary[500],
204
- primaryHover: colorPrimitives.primary[600],
205
- primaryActive: colorPrimitives.primary[700],
206
- primaryBg: colorPrimitives.primary[50],
207
- secondary: colorPrimitives.secondary[500],
208
- secondaryHover: colorPrimitives.secondary[600],
209
- // Feedback
210
- success: colorPrimitives.success[500],
211
- warning: colorPrimitives.warning[500],
212
- error: colorPrimitives.error[500],
213
- info: colorPrimitives.info[500],
214
- // Domain-specific semantic colors
215
- profit: "#10b981",
216
- loss: "#ef4444",
217
- approved: "#059669",
218
- pending: "#d97706",
219
- rejected: "#dc2626",
220
- secure: "#059669",
221
- insecure: "#dc2626",
222
- // Text
223
- textPrimary: colorPrimitives.neutral[900],
224
- textSecondary: colorPrimitives.neutral[600],
225
- textTertiary: colorPrimitives.neutral[500],
226
- textMuted: colorPrimitives.neutral[400],
227
- textInverse: colorPrimitives.neutral[50],
228
- // Backgrounds
229
- bgPage: colorPrimitives.neutral[50],
230
- bgSurface: colorPrimitives.white,
231
- bgSurfaceHover: colorPrimitives.neutral[100],
232
- bgSurfaceTertiary: colorPrimitives.neutral[200],
233
- bgInverse: colorPrimitives.neutral[900],
234
- bgSidebar: colorPrimitives.white,
235
- bgHeader: colorPrimitives.white,
236
- // Borders
237
- border: colorPrimitives.neutral[200],
238
- borderLight: colorPrimitives.neutral[100],
239
- borderSecondary: colorPrimitives.neutral[300],
240
- borderFocus: colorPrimitives.primary[500],
241
- // Links
242
- link: colorPrimitives.primary[600],
243
- linkHover: colorPrimitives.primary[700]
244
- },
245
- spacing: {
246
- pageGutter: spacingPrimitives[6],
247
- cardPadding: spacingPrimitives[4],
248
- sectionGap: spacingPrimitives[6],
249
- componentGap: spacingPrimitives[3],
250
- inlineGap: spacingPrimitives[2],
251
- component: {
252
- button: { paddingX: spacingPrimitives[4], paddingY: spacingPrimitives[2], gap: spacingPrimitives[2] },
253
- input: { paddingX: spacingPrimitives[3], paddingY: spacingPrimitives[2] },
254
- card: { padding: spacingPrimitives[6], gap: spacingPrimitives[4] },
255
- form: { fieldGap: spacingPrimitives[4], sectionGap: spacingPrimitives[8], labelGap: spacingPrimitives[2] },
256
- modal: { padding: spacingPrimitives[6], gap: spacingPrimitives[4] },
257
- table: { cellPadding: spacingPrimitives[4], headerPadding: spacingPrimitives[4] }
258
- },
259
- layout: {
260
- container: { paddingX: spacingPrimitives[4], paddingY: spacingPrimitives[6] },
261
- section: { marginY: spacingPrimitives[12], gap: spacingPrimitives[8] },
262
- page: { marginY: spacingPrimitives[16], paddingX: spacingPrimitives[6] }
263
- }
264
- },
265
- typography: {
266
- fontFamily: fontFamilyPrimitives.sans,
267
- fontFamilyCode: fontFamilyPrimitives.mono,
268
- fontFamilySerif: fontFamilyPrimitives.serif,
269
- display: {
270
- lg: { fontSize: fontSizePrimitives["5xl"], fontWeight: fontWeightPrimitives.bold, lineHeight: lineHeightPrimitives.tight, letterSpacing: letterSpacingPrimitives.tight },
271
- md: { fontSize: fontSizePrimitives["4xl"], fontWeight: fontWeightPrimitives.bold, lineHeight: lineHeightPrimitives.tight },
272
- sm: { fontSize: fontSizePrimitives["3xl"], fontWeight: fontWeightPrimitives.semibold, lineHeight: lineHeightPrimitives.tight }
273
- },
274
- heading: {
275
- h1: { fontSize: fontSizePrimitives["3xl"], fontWeight: fontWeightPrimitives.bold, lineHeight: lineHeightPrimitives.tight },
276
- h2: { fontSize: fontSizePrimitives["2xl"], fontWeight: fontWeightPrimitives.semibold, lineHeight: lineHeightPrimitives.tight },
277
- h3: { fontSize: fontSizePrimitives.xl, fontWeight: fontWeightPrimitives.semibold, lineHeight: lineHeightPrimitives.normal },
278
- h4: { fontSize: fontSizePrimitives.lg, fontWeight: fontWeightPrimitives.medium, lineHeight: lineHeightPrimitives.normal }
279
- },
280
- body: {
281
- lg: { fontSize: fontSizePrimitives.lg, fontWeight: fontWeightPrimitives.normal, lineHeight: lineHeightPrimitives.relaxed },
282
- md: { fontSize: fontSizePrimitives.base, fontWeight: fontWeightPrimitives.normal, lineHeight: lineHeightPrimitives.normal },
283
- sm: { fontSize: fontSizePrimitives.sm, fontWeight: fontWeightPrimitives.normal, lineHeight: lineHeightPrimitives.normal }
284
- },
285
- caption: { fontSize: fontSizePrimitives.xs, fontWeight: fontWeightPrimitives.normal, lineHeight: lineHeightPrimitives.normal },
286
- button: {
287
- lg: { fontSize: fontSizePrimitives.lg, fontWeight: fontWeightPrimitives.medium },
288
- md: { fontSize: fontSizePrimitives.base, fontWeight: fontWeightPrimitives.medium },
289
- sm: { fontSize: fontSizePrimitives.sm, fontWeight: fontWeightPrimitives.medium }
290
- }
291
- },
292
- radii: {
293
- component: borderRadiusPrimitives.md,
294
- card: borderRadiusPrimitives.lg,
295
- button: borderRadiusPrimitives.md,
296
- input: borderRadiusPrimitives.md,
297
- tag: borderRadiusPrimitives.sm,
298
- avatar: borderRadiusPrimitives.full
299
- },
300
- shadows: {
301
- card: shadowPrimitives.sm,
302
- dropdown: shadowPrimitives.md,
303
- modal: shadowPrimitives.lg
304
- },
305
- layout: {
306
- sidebarWidth: 240,
307
- sidebarCollapsedWidth: 72,
308
- headerHeight: 56,
309
- contentMaxWidth: 1440
310
- }
311
- };
312
-
313
- // src/platform.ts
314
- var platformColors = {
315
- crx: {
316
- primary: colorPrimitives.primary[600],
317
- secondary: colorPrimitives.secondary[600],
318
- accent: colorPrimitives.info[500],
319
- gradient: "linear-gradient(135deg, #1e293b 0%, #0f172a 100%)"
320
- },
321
- sgx: {
322
- primary: colorPrimitives.primary[700],
323
- secondary: colorPrimitives.secondary[700],
324
- accent: colorPrimitives.warning[500],
325
- gradient: "linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%)"
326
- },
327
- agx: {
328
- primary: colorPrimitives.primary[500],
329
- secondary: colorPrimitives.secondary[500],
330
- accent: colorPrimitives.success[500],
331
- gradient: "linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%)"
332
- }
333
- };
334
- var platformSpacing = {
335
- crx: {
336
- density: "comfortable",
337
- basePadding: spacingPrimitives[5],
338
- baseGap: spacingPrimitives[4]
339
- },
340
- sgx: {
341
- density: "spacious",
342
- basePadding: spacingPrimitives[6],
343
- baseGap: spacingPrimitives[5]
344
- },
345
- agx: {
346
- density: "compact",
347
- basePadding: spacingPrimitives[4],
348
- baseGap: spacingPrimitives[3]
349
- }
350
- };
351
-
352
- // src/dark.ts
353
- var darkColors = {
354
- text: {
355
- primary: colorPrimitives.neutral[50],
356
- secondary: colorPrimitives.neutral[300],
357
- tertiary: colorPrimitives.neutral[400]
358
- },
359
- background: {
360
- primary: colorPrimitives.neutral[900],
361
- secondary: colorPrimitives.neutral[800],
362
- tertiary: colorPrimitives.neutral[700]
363
- },
364
- border: {
365
- primary: colorPrimitives.neutral[700],
366
- secondary: colorPrimitives.neutral[600]
367
- }
368
- };
369
- // Annotate the CommonJS export names for ESM import in node:
370
- 0 && (module.exports = {
371
- borderRadiusPrimitives,
372
- colorPrimitives,
373
- darkColors,
374
- fontFamilyPrimitives,
375
- fontSizePrimitives,
376
- fontWeightPrimitives,
377
- letterSpacingPrimitives,
378
- lineHeightPrimitives,
379
- platformColors,
380
- platformSpacing,
381
- semanticTokens,
382
- shadowPrimitives,
383
- spacingPrimitives
384
- });