@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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-present GTCX Protocol
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,92 @@
1
+ /* Auto-generated by @gtcx/tokens — do not edit manually */
2
+ /* Platform: fifty-four | Mode: dark */
3
+ /* Spec: docs/specs/_project/theme-spec.md */
4
+ /* Generated: 2026-03-08 */
5
+
6
+ :root {
7
+ /* ── Colors ──────────────────────────────────────── */
8
+ --gtcx-primary: #00E5C8;
9
+ --gtcx-primary-hover: #00D4B8;
10
+ --gtcx-primary-active: #00BFA8;
11
+ --gtcx-primary-bg: #0A1F1C;
12
+ --gtcx-secondary: #A78BFA;
13
+ --gtcx-secondary-hover: #8B6FE0;
14
+ --gtcx-success: #22C55E;
15
+ --gtcx-warning: #F59E0B;
16
+ --gtcx-error: #EF4444;
17
+ --gtcx-info: #3B82F6;
18
+ --gtcx-profit: #22C55E;
19
+ --gtcx-loss: #EF4444;
20
+ --gtcx-approved: #16A34A;
21
+ --gtcx-pending: #D97706;
22
+ --gtcx-rejected: #DC2626;
23
+ --gtcx-secure: #16A34A;
24
+ --gtcx-insecure: #DC2626;
25
+ --gtcx-text-primary: #EDEDF0;
26
+ --gtcx-text-secondary: #A0A0AB;
27
+ --gtcx-text-tertiary: #71717A;
28
+ --gtcx-text-muted: #52525B;
29
+ --gtcx-text-inverse: #0E0E11;
30
+ --gtcx-bg-inverse: #EDEDF0;
31
+ --gtcx-bg-sidebar: #0E0E13;
32
+ --gtcx-bg-header: #0E0E13;
33
+ --gtcx-border: rgba(255, 255, 255, 0.10);
34
+ --gtcx-border-light: rgba(255, 255, 255, 0.06);
35
+ --gtcx-border-secondary: rgba(255, 255, 255, 0.16);
36
+ --gtcx-border-focus: #00E5C8;
37
+ --gtcx-link: #00E5C8;
38
+ --gtcx-link-hover: #00D4B8;
39
+
40
+ /* ── Elevation Stack (§1.1) ─────────────────── */
41
+ --gtcx-bg-void: #08090A;
42
+ --gtcx-bg-surface: #111116;
43
+ --gtcx-bg-elevated: #191920;
44
+ --gtcx-bg-raised: #222229;
45
+ --gtcx-bg-overlay: #2A2A32;
46
+ --gtcx-bg-spotlight: #333340;
47
+
48
+ /* ── Border Tiers (§1.4) ────────────────────── */
49
+ --gtcx-border-subtle: rgba(255, 255, 255, 0.06);
50
+ --gtcx-border-default: rgba(255, 255, 255, 0.10);
51
+ --gtcx-border-emphasis: rgba(255, 255, 255, 0.16);
52
+
53
+ /* ── Accent States (§1.3) ────────────────────── */
54
+ --gtcx-accent-default: #00E5C8;
55
+ --gtcx-accent-hover: #00D4B8;
56
+ --gtcx-accent-active: #00BFA8;
57
+ --gtcx-accent-muted: rgba(0, 229, 200, 0.15);
58
+ --gtcx-accent-glow: rgba(0, 229, 200, 0.08);
59
+
60
+ /* ── Signal Colors (§1.3) ────────────────────── */
61
+ --gtcx-signal-green: #22C55E;
62
+ --gtcx-signal-red: #EF4444;
63
+ --gtcx-signal-amber: #F59E0B;
64
+ --gtcx-signal-blue: #3B82F6;
65
+ --gtcx-signal-purple: #A78BFA;
66
+
67
+ /* ── Radii (§3.1) ───────────────────────────── */
68
+ --gtcx-radius-component: 6px;
69
+ --gtcx-radius-card: 10px;
70
+ --gtcx-radius-button: 6px;
71
+ --gtcx-radius-input: 6px;
72
+ --gtcx-radius-tag: 4px;
73
+ --gtcx-radius-modal: 16px;
74
+ --gtcx-radius-avatar: 9999px;
75
+
76
+ /* ── Shadows (§3.2) ─────────────────────────── */
77
+ --gtcx-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04);
78
+ --gtcx-shadow-dropdown: 0 8px 24px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
79
+ --gtcx-shadow-modal: 0 24px 48px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
80
+ --gtcx-shadow-glow: 0 0 0 1px rgba(0, 229, 200, 0.08), 0 0 20px -4px rgba(0, 229, 200, 0.06);
81
+
82
+ /* ── Motion (§5) ────────────────────────────── */
83
+ --gtcx-motion-instant: 80ms;
84
+ --gtcx-motion-fast: 150ms;
85
+ --gtcx-motion-base: 220ms;
86
+ --gtcx-motion-slow: 320ms;
87
+ --gtcx-motion-deliberate: 500ms;
88
+ --gtcx-motion-ease-default: cubic-bezier(0.22, 1, 0.36, 1);
89
+ --gtcx-motion-ease-in: cubic-bezier(0.55, 0, 1, 0.45);
90
+ --gtcx-motion-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
91
+ --gtcx-motion-ease-linear: linear;
92
+ }
@@ -0,0 +1,25 @@
1
+ // src/css.ts
2
+ function camelToKebab(key) {
3
+ return key.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
4
+ }
5
+ function generateCSSVariables(tokens) {
6
+ const { colors, radii, shadows } = tokens;
7
+ const lines = [":root {"];
8
+ for (const [key, value] of Object.entries(colors)) {
9
+ lines.push(` --gtcx-${camelToKebab(key)}: ${value};`);
10
+ }
11
+ lines.push("");
12
+ for (const [key, value] of Object.entries(radii)) {
13
+ lines.push(` --gtcx-radius-${camelToKebab(key)}: ${value}px;`);
14
+ }
15
+ lines.push("");
16
+ for (const [key, value] of Object.entries(shadows)) {
17
+ lines.push(` --gtcx-shadow-${camelToKebab(key)}: ${value};`);
18
+ }
19
+ lines.push("}");
20
+ return lines.join("\n");
21
+ }
22
+
23
+ export {
24
+ generateCSSVariables
25
+ };
@@ -0,0 +1,83 @@
1
+ // src/platforms/fifty-four.ts
2
+ var fiftyFourColors = {
3
+ // Brand — teal accent
4
+ primary: "#00E5C8",
5
+ primaryHover: "#00D4B8",
6
+ primaryActive: "#00BFA8",
7
+ primaryBg: "#0A1F1C",
8
+ secondary: "#A78BFA",
9
+ secondaryHover: "#8B6FE0",
10
+ // Feedback — vivid on dark backgrounds
11
+ success: "#22C55E",
12
+ warning: "#F59E0B",
13
+ error: "#EF4444",
14
+ info: "#3B82F6",
15
+ // Domain-specific
16
+ profit: "#22C55E",
17
+ loss: "#EF4444",
18
+ approved: "#16A34A",
19
+ pending: "#D97706",
20
+ rejected: "#DC2626",
21
+ secure: "#16A34A",
22
+ insecure: "#DC2626",
23
+ // Text — WCAG AA enforced (§1.2)
24
+ textPrimary: "#EDEDF0",
25
+ textSecondary: "#A0A0AB",
26
+ textTertiary: "#71717A",
27
+ textMuted: "#52525B",
28
+ textInverse: "#0E0E11",
29
+ // Backgrounds — elevation stack (§1.1)
30
+ // Level 0: Void (#08090A) — page canvas
31
+ // Level 1: Surface (#111116) — cards, panels, sidebar
32
+ // Level 2: Elevated (#191920) — hover, active panels, drawers
33
+ // Level 3: Raised (#222229) — dropdowns, popovers, command bar
34
+ // Level 4: Overlay (#2A2A32) — modals, dialogs, toasts
35
+ // Level 5: Spotlight (#333340) — tooltips, context menus
36
+ bgPage: "#08090A",
37
+ bgSurface: "#111116",
38
+ bgSurfaceHover: "#191920",
39
+ bgSurfaceTertiary: "#222229",
40
+ bgInverse: "#EDEDF0",
41
+ bgSidebar: "#0E0E13",
42
+ bgHeader: "#0E0E13",
43
+ // Borders — three rgba tiers (§1.4)
44
+ // Subtle: rgba(255, 255, 255, 0.06)
45
+ // Default: rgba(255, 255, 255, 0.10)
46
+ // Emphasis: rgba(255, 255, 255, 0.16)
47
+ //
48
+ // Note: CSS variables use rgba values directly. These hex fallbacks are
49
+ // for JS consumers that require string hex. The CSS generation script
50
+ // outputs the canonical rgba values.
51
+ border: "rgba(255, 255, 255, 0.10)",
52
+ borderLight: "rgba(255, 255, 255, 0.06)",
53
+ borderSecondary: "rgba(255, 255, 255, 0.16)",
54
+ borderFocus: "#00E5C8",
55
+ // Links
56
+ link: "#00E5C8",
57
+ linkHover: "#00D4B8"
58
+ };
59
+ var fiftyFourRadii = {
60
+ component: 6,
61
+ card: 10,
62
+ button: 6,
63
+ input: 6,
64
+ tag: 4,
65
+ avatar: 9999
66
+ };
67
+ var fiftyFourShadows = {
68
+ card: "0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04)",
69
+ dropdown: "0 8px 24px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06)",
70
+ modal: "0 24px 48px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08)"
71
+ };
72
+ var fiftyFourPlatformTokens = {
73
+ colors: fiftyFourColors,
74
+ radii: fiftyFourRadii,
75
+ shadows: fiftyFourShadows
76
+ };
77
+
78
+ export {
79
+ fiftyFourColors,
80
+ fiftyFourRadii,
81
+ fiftyFourShadows,
82
+ fiftyFourPlatformTokens
83
+ };
package/dist/css.d.mts ADDED
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @module css
3
+ *
4
+ * CSS custom property generator for design tokens.
5
+ *
6
+ * Converts semantic token JS objects into CSS custom property strings.
7
+ * This is the bridge between the JS token system and CSS-based consumers
8
+ * (Tailwind, vanilla CSS, etc.).
9
+ *
10
+ * Canonical spec: fifty-four/docs/specs/_project/theme-spec.md
11
+ *
12
+ * Usage:
13
+ * ```ts
14
+ * import { generateCSSVariables } from '@gtcx/tokens/css';
15
+ * import { fiftyFourPlatformTokens } from '@gtcx/tokens/platforms/fifty-four';
16
+ *
17
+ * const css = generateCSSVariables(fiftyFourPlatformTokens);
18
+ * // Returns: ":root { --gtcx-primary: #00E5C8; ... }"
19
+ * ```
20
+ */
21
+ interface PlatformTokenColors {
22
+ [key: string]: string;
23
+ }
24
+ interface PlatformTokenRadii {
25
+ [key: string]: number;
26
+ }
27
+ interface PlatformTokenShadows {
28
+ [key: string]: string;
29
+ }
30
+ interface PlatformTokens {
31
+ colors: PlatformTokenColors;
32
+ radii: PlatformTokenRadii;
33
+ shadows: PlatformTokenShadows;
34
+ }
35
+ /**
36
+ * Generate a CSS string of `--gtcx-*` custom properties from a platform
37
+ * token override object.
38
+ *
39
+ * The output is a plain CSS `:root {}` block suitable for direct injection
40
+ * into a stylesheet or `<style>` tag.
41
+ */
42
+ declare function generateCSSVariables(tokens: PlatformTokens): string;
43
+
44
+ export { generateCSSVariables };
package/dist/css.d.ts ADDED
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @module css
3
+ *
4
+ * CSS custom property generator for design tokens.
5
+ *
6
+ * Converts semantic token JS objects into CSS custom property strings.
7
+ * This is the bridge between the JS token system and CSS-based consumers
8
+ * (Tailwind, vanilla CSS, etc.).
9
+ *
10
+ * Canonical spec: fifty-four/docs/specs/_project/theme-spec.md
11
+ *
12
+ * Usage:
13
+ * ```ts
14
+ * import { generateCSSVariables } from '@gtcx/tokens/css';
15
+ * import { fiftyFourPlatformTokens } from '@gtcx/tokens/platforms/fifty-four';
16
+ *
17
+ * const css = generateCSSVariables(fiftyFourPlatformTokens);
18
+ * // Returns: ":root { --gtcx-primary: #00E5C8; ... }"
19
+ * ```
20
+ */
21
+ interface PlatformTokenColors {
22
+ [key: string]: string;
23
+ }
24
+ interface PlatformTokenRadii {
25
+ [key: string]: number;
26
+ }
27
+ interface PlatformTokenShadows {
28
+ [key: string]: string;
29
+ }
30
+ interface PlatformTokens {
31
+ colors: PlatformTokenColors;
32
+ radii: PlatformTokenRadii;
33
+ shadows: PlatformTokenShadows;
34
+ }
35
+ /**
36
+ * Generate a CSS string of `--gtcx-*` custom properties from a platform
37
+ * token override object.
38
+ *
39
+ * The output is a plain CSS `:root {}` block suitable for direct injection
40
+ * into a stylesheet or `<style>` tag.
41
+ */
42
+ declare function generateCSSVariables(tokens: PlatformTokens): string;
43
+
44
+ export { generateCSSVariables };
package/dist/css.js ADDED
@@ -0,0 +1,49 @@
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/css.ts
21
+ var css_exports = {};
22
+ __export(css_exports, {
23
+ generateCSSVariables: () => generateCSSVariables
24
+ });
25
+ module.exports = __toCommonJS(css_exports);
26
+ function camelToKebab(key) {
27
+ return key.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
28
+ }
29
+ function generateCSSVariables(tokens) {
30
+ const { colors, radii, shadows } = tokens;
31
+ const lines = [":root {"];
32
+ for (const [key, value] of Object.entries(colors)) {
33
+ lines.push(` --gtcx-${camelToKebab(key)}: ${value};`);
34
+ }
35
+ lines.push("");
36
+ for (const [key, value] of Object.entries(radii)) {
37
+ lines.push(` --gtcx-radius-${camelToKebab(key)}: ${value}px;`);
38
+ }
39
+ lines.push("");
40
+ for (const [key, value] of Object.entries(shadows)) {
41
+ lines.push(` --gtcx-shadow-${camelToKebab(key)}: ${value};`);
42
+ }
43
+ lines.push("}");
44
+ return lines.join("\n");
45
+ }
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ generateCSSVariables
49
+ });
package/dist/css.mjs ADDED
@@ -0,0 +1,6 @@
1
+ import {
2
+ generateCSSVariables
3
+ } from "./chunk-5IDFVTYK.mjs";
4
+ export {
5
+ generateCSSVariables
6
+ };