@soulbatical/tetra-ui 0.4.2 → 0.5.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,7 @@
1
+ /**
2
+ * Verify tokens.css defines all shadcn CSS vars needed by tetra-ui components.
3
+ *
4
+ * Run: npx tsx packages/ui/src/components/__tests__/appshell-tokens.test.ts
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=appshell-tokens.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appshell-tokens.test.d.ts","sourceRoot":"","sources":["../../../src/components/__tests__/appshell-tokens.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Verify tokens.css defines all shadcn CSS vars needed by tetra-ui components.
3
+ *
4
+ * Run: npx tsx packages/ui/src/components/__tests__/appshell-tokens.test.ts
5
+ */
6
+ import { readFileSync } from "fs";
7
+ import { resolve, dirname } from "path";
8
+ import { fileURLToPath } from "url";
9
+ const __dirname = dirname(fileURLToPath(import.meta.url));
10
+ const TOKENS_PATH = resolve(__dirname, "../../styles/tokens.css");
11
+ const tokens = readFileSync(TOKENS_PATH, "utf-8");
12
+ const REQUIRED_TOKENS = [
13
+ "--color-background",
14
+ "--color-foreground",
15
+ "--color-border",
16
+ "--color-input",
17
+ "--color-ring",
18
+ "--color-primary",
19
+ "--color-primary-foreground",
20
+ "--color-secondary",
21
+ "--color-secondary-foreground",
22
+ "--color-muted",
23
+ "--color-muted-foreground",
24
+ "--color-accent",
25
+ "--color-accent-foreground",
26
+ "--color-destructive",
27
+ "--color-destructive-foreground",
28
+ "--color-card",
29
+ "--color-card-foreground",
30
+ "--color-popover",
31
+ "--color-popover-foreground",
32
+ ];
33
+ let missing = [];
34
+ for (const token of REQUIRED_TOKENS) {
35
+ if (!tokens.includes(token + ":")) {
36
+ missing.push(token);
37
+ }
38
+ }
39
+ console.log("\n=== tokens.css shadcn completeness ===\n");
40
+ console.log(`Checked: ${REQUIRED_TOKENS.length} tokens`);
41
+ console.log(`Defined: ${REQUIRED_TOKENS.length - missing.length}`);
42
+ console.log(`Missing: ${missing.length}`);
43
+ if (missing.length > 0) {
44
+ console.log("\nMISSING:\n");
45
+ for (const m of missing)
46
+ console.log(` ${m}`);
47
+ process.exit(1);
48
+ }
49
+ else {
50
+ console.log("\nAll shadcn tokens defined in tokens.css\n");
51
+ }
52
+ //# sourceMappingURL=appshell-tokens.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appshell-tokens.test.js","sourceRoot":"","sources":["../../../src/components/__tests__/appshell-tokens.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAElD,MAAM,eAAe,GAAG;IACtB,oBAAoB;IACpB,oBAAoB;IACpB,gBAAgB;IAChB,eAAe;IACf,cAAc;IACd,iBAAiB;IACjB,4BAA4B;IAC5B,mBAAmB;IACnB,8BAA8B;IAC9B,eAAe;IACf,0BAA0B;IAC1B,gBAAgB;IAChB,2BAA2B;IAC3B,qBAAqB;IACrB,gCAAgC;IAChC,cAAc;IACd,yBAAyB;IACzB,iBAAiB;IACjB,4BAA4B;CAC7B,CAAC;AAEF,IAAI,OAAO,GAAa,EAAE,CAAC;AAC3B,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,GAAG,GAAG,CAAC,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AACH,CAAC;AAED,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;AAC1D,OAAO,CAAC,GAAG,CAAC,YAAY,eAAe,CAAC,MAAM,SAAS,CAAC,CAAC;AACzD,OAAO,CAAC,GAAG,CAAC,YAAY,eAAe,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AACnE,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAE1C,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;IACvB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC5B,KAAK,MAAM,CAAC,IAAI,OAAO;QAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;AAC7D,CAAC"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.4.2",
7
+ "version": "0.5.0",
8
8
  "description": "Shared React frontend framework for Tetra platform projects (Soulbatical BV) — config-driven components, hooks, providers, and styling",
9
9
  "type": "module",
10
10
  "main": "dist/index.js",
@@ -51,3 +51,53 @@
51
51
  --tetra-font: inherit;
52
52
  --tetra-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
53
53
  }
54
+
55
+ /*
56
+ * shadcn/ui compatibility — Tailwind v4 @theme tokens
57
+ *
58
+ * Maps shadcn utility classes (bg-background, text-foreground, border-border, etc.)
59
+ * to the existing --tetra-* tokens above. This means:
60
+ * - All shadcn/ui primitives work out of the box
61
+ * - All tetra-ui components work without project-specific CSS
62
+ * - Projects can override by redefining --color-* in their own @theme block
63
+ * - Dark mode works automatically via dark-mode.css overriding --tetra-* vars
64
+ */
65
+ @theme {
66
+ /* Core */
67
+ --color-background: var(--tetra-bg);
68
+ --color-foreground: var(--tetra-text);
69
+ --color-border: var(--tetra-border);
70
+ --color-input: var(--tetra-border);
71
+ --color-ring: var(--tetra-accent);
72
+
73
+ /* Primary (buttons, badges, links) */
74
+ --color-primary: var(--tetra-accent);
75
+ --color-primary-foreground: var(--tetra-text-inverted);
76
+
77
+ /* Secondary */
78
+ --color-secondary: var(--tetra-bg-muted);
79
+ --color-secondary-foreground: var(--tetra-text);
80
+
81
+ /* Muted (labels, placeholders, disabled) */
82
+ --color-muted: var(--tetra-bg-muted);
83
+ --color-muted-foreground: var(--tetra-text-muted);
84
+
85
+ /* Accent (hover states, active nav items) */
86
+ --color-accent: var(--tetra-accent-subtle);
87
+ --color-accent-foreground: var(--tetra-text);
88
+
89
+ /* Destructive (delete, errors) */
90
+ --color-destructive: var(--tetra-danger);
91
+ --color-destructive-foreground: var(--tetra-text-inverted);
92
+
93
+ /* Card */
94
+ --color-card: var(--tetra-bg);
95
+ --color-card-foreground: var(--tetra-text);
96
+
97
+ /* Popover */
98
+ --color-popover: var(--tetra-bg);
99
+ --color-popover-foreground: var(--tetra-text);
100
+
101
+ /* Radius */
102
+ --radius: var(--tetra-radius);
103
+ }