@lace-cloud/design-tokens 0.28.0 → 0.29.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 CHANGED
@@ -35,19 +35,38 @@ Then reference tokens via CSS custom properties:
35
35
  For programmatic access from JS/TS (e.g. canvas's `pinColor.ts`):
36
36
 
37
37
  ```ts
38
- import { brand, pin, ui } from '@lace-cloud/design-tokens';
38
+ import { brand, pin } from '@lace-cloud/design-tokens';
39
39
 
40
40
  console.log(brand.green); // '#CEFE65'
41
41
  ```
42
42
 
43
+ A consumer that cannot load `tokens.css` — a server-rendered page with no
44
+ stylesheet — reads the themes' semantic colours from `darkTheme` and
45
+ `lightTheme`, keyed by the same custom property names, and declares them in
46
+ rules of its own: `darkTheme` at `:root`, `lightTheme` (the light block's
47
+ overrides) under `[data-theme="light"]`. `tokens.css` is their one owner: the
48
+ package build resolves its semantic tier's aliases and writes the two themes to
49
+ `src/themes.gen.ts`, so a colour changes in the stylesheet and nowhere else.
50
+
51
+ ```ts
52
+ import { darkTheme, lightTheme, themeDeclarations } from '@lace-cloud/design-tokens';
53
+
54
+ const css = `:root{${themeDeclarations(darkTheme)}}[data-theme="light"]{${themeDeclarations(lightTheme)}}`;
55
+ ```
56
+
43
57
  ## Conventions
44
58
 
45
59
  - **Tokens first.** No raw hex in consumer code. If a color isn't in
46
- tokens, add a token here first.
60
+ tokens, add a token here first. The one exception is a third party's
61
+ own brand colour (GitHub's black and white on its sign-in button),
62
+ which is theirs to set and not Lace's to token.
47
63
  - **Three tiers:** primitives (concrete values, e.g. `--lace-color-green-500`),
48
64
  semantic (purpose-named, e.g. `--lace-bg-surface`), component
49
65
  (component-scoped overrides where needed).
50
66
  - **CSS custom property naming:** `--lace-{category}-{role}-{variant?}`.
67
+ - **A semantic colour changes in `tokens.css`,** then
68
+ `pnpm --filter @lace-cloud/design-tokens build` regenerates
69
+ `src/themes.gen.ts`; the package's tests fail while the two disagree.
51
70
 
52
71
  ## License
53
72
 
package/dist/index.cjs CHANGED
@@ -21,10 +21,81 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
23
  brand: () => brand,
24
+ darkTheme: () => darkTheme,
25
+ lightTheme: () => lightTheme,
24
26
  pin: () => pin,
25
- ui: () => ui
27
+ themeDeclarations: () => themeDeclarations
26
28
  });
27
29
  module.exports = __toCommonJS(index_exports);
30
+
31
+ // src/themes.gen.ts
32
+ var darkTheme = {
33
+ "--lace-color-bg-canvas": "#161616",
34
+ "--lace-color-bg-surface": "#1e1e1e",
35
+ "--lace-color-bg-surface-alt": "#252526",
36
+ "--lace-color-bg-input": "#0f0f0f",
37
+ "--lace-color-bg-context-menu": "#1a1a1a",
38
+ "--lace-color-border-default": "#333333",
39
+ "--lace-color-border-subtle": "#3c3c3c",
40
+ "--lace-color-border-input": "#555555",
41
+ "--lace-color-border-input-hover": "#888888",
42
+ "--lace-color-text-primary": "#ecefed",
43
+ "--lace-color-text-label": "#e6e6e6",
44
+ "--lace-color-text-muted": "#999999",
45
+ "--lace-color-text-description": "#9ca3af",
46
+ "--lace-color-text-accent": "#cefe65",
47
+ "--lace-color-text-link": "#60a5fa",
48
+ "--lace-color-text-danger": "#e5484d",
49
+ "--lace-color-text-danger-soft": "#f87171",
50
+ "--lace-color-accent": "#cefe65",
51
+ "--lace-color-text-on-accent": "#111111",
52
+ "--lace-color-accent-alpha-subtle": "rgba(206, 254, 101, 0.1)",
53
+ "--lace-color-accent-alpha-medium": "rgba(206, 254, 101, 0.2)",
54
+ "--lace-color-accent-strong": "#e0ff8a",
55
+ "--lace-color-success": "#4ade80",
56
+ "--lace-color-success-hover": "#22c55e",
57
+ "--lace-color-success-strong": "#16a34a",
58
+ "--lace-color-danger": "#e5484d",
59
+ "--lace-color-danger-bg-soft": "rgba(248, 113, 113, 0.12)",
60
+ "--lace-color-danger-fg": "#f87171",
61
+ "--lace-color-warning-bg": "#3b2507",
62
+ "--lace-color-warning-fg": "#fbbf24",
63
+ "--lace-color-focus-ring": "#cefe65"
64
+ };
65
+ var lightTheme = {
66
+ "--lace-color-bg-canvas": "#ffffff",
67
+ "--lace-color-bg-surface": "#f8fafc",
68
+ "--lace-color-bg-surface-alt": "#f1f5f9",
69
+ "--lace-color-bg-input": "#ffffff",
70
+ "--lace-color-bg-context-menu": "#ffffff",
71
+ "--lace-color-border-default": "#cbd5e1",
72
+ "--lace-color-border-subtle": "#e2e8f0",
73
+ "--lace-color-border-input": "#cbd5e1",
74
+ "--lace-color-border-input-hover": "#94a3b8",
75
+ "--lace-color-text-primary": "#0f172a",
76
+ "--lace-color-text-label": "#1f2937",
77
+ "--lace-color-text-muted": "#64748b",
78
+ "--lace-color-text-description": "#475569",
79
+ "--lace-color-text-accent": "#3d6600",
80
+ "--lace-color-text-link": "#2563eb",
81
+ "--lace-color-text-danger": "#dc2626",
82
+ "--lace-color-text-danger-soft": "#ef4444",
83
+ "--lace-color-accent": "#3d6600",
84
+ "--lace-color-accent-alpha-subtle": "rgba(132, 204, 22, 0.08)",
85
+ "--lace-color-accent-alpha-medium": "rgba(132, 204, 22, 0.16)",
86
+ "--lace-color-accent-strong": "#2d4a00",
87
+ "--lace-color-success": "#047857",
88
+ "--lace-color-success-hover": "#065f46",
89
+ "--lace-color-success-strong": "#064e3b",
90
+ "--lace-color-danger": "#dc2626",
91
+ "--lace-color-danger-bg-soft": "#fef2f2",
92
+ "--lace-color-danger-fg": "#b91c1c",
93
+ "--lace-color-warning-bg": "#fffbeb",
94
+ "--lace-color-warning-fg": "#b45309",
95
+ "--lace-color-focus-ring": "#3d6600"
96
+ };
97
+
98
+ // src/index.ts
28
99
  var brand = {
29
100
  green: "#CEFE65",
30
101
  greenBright: "#e0ff8a",
@@ -43,25 +114,15 @@ var pin = {
43
114
  object: { fill: "#FF8A4C", stroke: "#8A3A10" },
44
115
  any: { fill: "#9BA19E", stroke: "#4A4F4C" }
45
116
  };
46
- var ui = {
47
- btnPrimary: "#1f6feb",
48
- btnPrimaryDim: "#1a4d8f",
49
- btnSuccess: "#1a7f37",
50
- btnSuccessHover: "#3ab653",
51
- btnDangerBg: "#6e2b2b",
52
- textDanger: "#e5484d",
53
- textDangerLight: "#f87171",
54
- bgSurface: "#1e1e1e",
55
- bgSurfaceAlt: "#252526",
56
- bgInput: "#0f0f0f",
57
- borderDefault: "#333333",
58
- borderInput: "#555555",
59
- borderSubtle: "#3c3c3c"
60
- };
117
+ function themeDeclarations(theme) {
118
+ return Object.entries(theme).map(([name, value]) => `${name}:${value}`).join(";");
119
+ }
61
120
  // Annotate the CommonJS export names for ESM import in node:
62
121
  0 && (module.exports = {
63
122
  brand,
123
+ darkTheme,
124
+ lightTheme,
64
125
  pin,
65
- ui
126
+ themeDeclarations
66
127
  });
67
128
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @lace-cloud/design-tokens — JS/TS token exports\n// Primary distribution is tokens.css; use this for JS/TS consumers that\n// need programmatic access to token values (e.g., pinColor.ts).\n\nexport const brand = {\n green: '#CEFE65',\n greenBright: '#e0ff8a',\n gunmetal: '#153238',\n gunmetalLight: '#1a3f47',\n night: '#161616',\n cyan: '#95E7FF',\n grey: '#ECEFED',\n} as const;\n\nexport const pin = {\n string: { fill: '#95E7FF', stroke: '#2C9DB9' },\n number: { fill: '#F5A623', stroke: '#8A5A10' },\n bool: { fill: '#B084F0', stroke: '#5C3E9A' },\n list: { fill: '#CEFE65', stroke: '#5E8A1A' },\n map: { fill: '#F288C6', stroke: '#8A2E5C' },\n object: { fill: '#FF8A4C', stroke: '#8A3A10' },\n any: { fill: '#9BA19E', stroke: '#4A4F4C' },\n} as const;\n\nexport const ui = {\n btnPrimary: '#1f6feb',\n btnPrimaryDim: '#1a4d8f',\n btnSuccess: '#1a7f37',\n btnSuccessHover: '#3ab653',\n btnDangerBg: '#6e2b2b',\n textDanger: '#e5484d',\n textDangerLight: '#f87171',\n bgSurface: '#1e1e1e',\n bgSurfaceAlt: '#252526',\n bgInput: '#0f0f0f',\n borderDefault: '#333333',\n borderInput: '#555555',\n borderSubtle: '#3c3c3c',\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,QAAQ;AAAA,EACnB,OAAO;AAAA,EACP,aAAa;AAAA,EACb,UAAU;AAAA,EACV,eAAe;AAAA,EACf,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEO,IAAM,MAAM;AAAA,EACjB,QAAQ,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC7C,QAAQ,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC7C,MAAM,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC3C,MAAM,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC3C,KAAK,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC1C,QAAQ,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC7C,KAAK,EAAE,MAAM,WAAW,QAAQ,UAAU;AAC5C;AAEO,IAAM,KAAK;AAAA,EAChB,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,SAAS;AAAA,EACT,eAAe;AAAA,EACf,aAAa;AAAA,EACb,cAAc;AAChB;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/themes.gen.ts"],"sourcesContent":["// @lace-cloud/design-tokens — JS/TS token exports\n// Primary distribution is tokens.css; use this for JS/TS consumers that\n// need programmatic access to token values (e.g., pinColor.ts).\n\nexport const brand = {\n green: '#CEFE65',\n greenBright: '#e0ff8a',\n gunmetal: '#153238',\n gunmetalLight: '#1a3f47',\n night: '#161616',\n cyan: '#95E7FF',\n grey: '#ECEFED',\n} as const;\n\nexport const pin = {\n string: { fill: '#95E7FF', stroke: '#2C9DB9' },\n number: { fill: '#F5A623', stroke: '#8A5A10' },\n bool: { fill: '#B084F0', stroke: '#5C3E9A' },\n list: { fill: '#CEFE65', stroke: '#5E8A1A' },\n map: { fill: '#F288C6', stroke: '#8A2E5C' },\n object: { fill: '#FF8A4C', stroke: '#8A3A10' },\n any: { fill: '#9BA19E', stroke: '#4A4F4C' },\n} as const;\n\n// The themes' semantic colours, generated from tokens.css at build\n// (`src/themes-source.ts`): `darkTheme` and `lightTheme`, for a consumer that\n// cannot load the stylesheet.\nexport { darkTheme, lightTheme } from './themes.gen.ts';\n\n/** A theme's colours as the declarations of one CSS rule, `name:value` joined\n * by `;`, for a page that declares the tokens in a rule of its own. */\nexport function themeDeclarations(theme: Readonly<Record<string, string>>): string {\n return Object.entries(theme)\n .map(([name, value]) => `${name}:${value}`)\n .join(';');\n}\n","// Generated from tokens.css by scripts/gen-themes.mjs; `pnpm --filter @lace-cloud/design-tokens build`\n// rewrites it. Edit tokens.css, never this file.\n\n/**\n * The dark theme's semantic colours — every `--lace-color-*` of tokens.css's semantic tier, at the\n * value it resolves to in the default (dark) theme — for a consumer that cannot load tokens.css: a\n * server-rendered page declares them in its own `:root` and reads them by the names the\n * stylesheet uses.\n */\nexport const darkTheme = {\n '--lace-color-bg-canvas': '#161616',\n '--lace-color-bg-surface': '#1e1e1e',\n '--lace-color-bg-surface-alt': '#252526',\n '--lace-color-bg-input': '#0f0f0f',\n '--lace-color-bg-context-menu': '#1a1a1a',\n '--lace-color-border-default': '#333333',\n '--lace-color-border-subtle': '#3c3c3c',\n '--lace-color-border-input': '#555555',\n '--lace-color-border-input-hover': '#888888',\n '--lace-color-text-primary': '#ecefed',\n '--lace-color-text-label': '#e6e6e6',\n '--lace-color-text-muted': '#999999',\n '--lace-color-text-description': '#9ca3af',\n '--lace-color-text-accent': '#cefe65',\n '--lace-color-text-link': '#60a5fa',\n '--lace-color-text-danger': '#e5484d',\n '--lace-color-text-danger-soft': '#f87171',\n '--lace-color-accent': '#cefe65',\n '--lace-color-text-on-accent': '#111111',\n '--lace-color-accent-alpha-subtle': 'rgba(206, 254, 101, 0.1)',\n '--lace-color-accent-alpha-medium': 'rgba(206, 254, 101, 0.2)',\n '--lace-color-accent-strong': '#e0ff8a',\n '--lace-color-success': '#4ade80',\n '--lace-color-success-hover': '#22c55e',\n '--lace-color-success-strong': '#16a34a',\n '--lace-color-danger': '#e5484d',\n '--lace-color-danger-bg-soft': 'rgba(248, 113, 113, 0.12)',\n '--lace-color-danger-fg': '#f87171',\n '--lace-color-warning-bg': '#3b2507',\n '--lace-color-warning-fg': '#fbbf24',\n '--lace-color-focus-ring': '#cefe65',\n} as const;\n\n/**\n * The light theme's semantic colours — every `--lace-color-*` tokens.css's `[data-theme=\"light\"]`\n * block overrides, at the value it resolves to there — declared after `darkTheme` under the\n * page's own `[data-theme=\"light\"]`.\n */\nexport const lightTheme = {\n '--lace-color-bg-canvas': '#ffffff',\n '--lace-color-bg-surface': '#f8fafc',\n '--lace-color-bg-surface-alt': '#f1f5f9',\n '--lace-color-bg-input': '#ffffff',\n '--lace-color-bg-context-menu': '#ffffff',\n '--lace-color-border-default': '#cbd5e1',\n '--lace-color-border-subtle': '#e2e8f0',\n '--lace-color-border-input': '#cbd5e1',\n '--lace-color-border-input-hover': '#94a3b8',\n '--lace-color-text-primary': '#0f172a',\n '--lace-color-text-label': '#1f2937',\n '--lace-color-text-muted': '#64748b',\n '--lace-color-text-description': '#475569',\n '--lace-color-text-accent': '#3d6600',\n '--lace-color-text-link': '#2563eb',\n '--lace-color-text-danger': '#dc2626',\n '--lace-color-text-danger-soft': '#ef4444',\n '--lace-color-accent': '#3d6600',\n '--lace-color-accent-alpha-subtle': 'rgba(132, 204, 22, 0.08)',\n '--lace-color-accent-alpha-medium': 'rgba(132, 204, 22, 0.16)',\n '--lace-color-accent-strong': '#2d4a00',\n '--lace-color-success': '#047857',\n '--lace-color-success-hover': '#065f46',\n '--lace-color-success-strong': '#064e3b',\n '--lace-color-danger': '#dc2626',\n '--lace-color-danger-bg-soft': '#fef2f2',\n '--lace-color-danger-fg': '#b91c1c',\n '--lace-color-warning-bg': '#fffbeb',\n '--lace-color-warning-fg': '#b45309',\n '--lace-color-focus-ring': '#3d6600',\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,IAAM,YAAY;AAAA,EACvB,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,+BAA+B;AAAA,EAC/B,yBAAyB;AAAA,EACzB,gCAAgC;AAAA,EAChC,+BAA+B;AAAA,EAC/B,8BAA8B;AAAA,EAC9B,6BAA6B;AAAA,EAC7B,mCAAmC;AAAA,EACnC,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,iCAAiC;AAAA,EACjC,4BAA4B;AAAA,EAC5B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,iCAAiC;AAAA,EACjC,uBAAuB;AAAA,EACvB,+BAA+B;AAAA,EAC/B,oCAAoC;AAAA,EACpC,oCAAoC;AAAA,EACpC,8BAA8B;AAAA,EAC9B,wBAAwB;AAAA,EACxB,8BAA8B;AAAA,EAC9B,+BAA+B;AAAA,EAC/B,uBAAuB;AAAA,EACvB,+BAA+B;AAAA,EAC/B,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,2BAA2B;AAC7B;AAOO,IAAM,aAAa;AAAA,EACxB,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,+BAA+B;AAAA,EAC/B,yBAAyB;AAAA,EACzB,gCAAgC;AAAA,EAChC,+BAA+B;AAAA,EAC/B,8BAA8B;AAAA,EAC9B,6BAA6B;AAAA,EAC7B,mCAAmC;AAAA,EACnC,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,iCAAiC;AAAA,EACjC,4BAA4B;AAAA,EAC5B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,iCAAiC;AAAA,EACjC,uBAAuB;AAAA,EACvB,oCAAoC;AAAA,EACpC,oCAAoC;AAAA,EACpC,8BAA8B;AAAA,EAC9B,wBAAwB;AAAA,EACxB,8BAA8B;AAAA,EAC9B,+BAA+B;AAAA,EAC/B,uBAAuB;AAAA,EACvB,+BAA+B;AAAA,EAC/B,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,2BAA2B;AAC7B;;;AD3EO,IAAM,QAAQ;AAAA,EACnB,OAAO;AAAA,EACP,aAAa;AAAA,EACb,UAAU;AAAA,EACV,eAAe;AAAA,EACf,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEO,IAAM,MAAM;AAAA,EACjB,QAAQ,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC7C,QAAQ,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC7C,MAAM,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC3C,MAAM,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC3C,KAAK,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC1C,QAAQ,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC7C,KAAK,EAAE,MAAM,WAAW,QAAQ,UAAU;AAC5C;AASO,SAAS,kBAAkB,OAAiD;AACjF,SAAO,OAAO,QAAQ,KAAK,EACxB,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,GAAG,IAAI,IAAI,KAAK,EAAE,EACzC,KAAK,GAAG;AACb;","names":[]}
@@ -0,0 +1,122 @@
1
+ /**
2
+ * The dark theme's semantic colours — every `--lace-color-*` of tokens.css's semantic tier, at the
3
+ * value it resolves to in the default (dark) theme — for a consumer that cannot load tokens.css: a
4
+ * server-rendered page declares them in its own `:root` and reads them by the names the
5
+ * stylesheet uses.
6
+ */
7
+ declare const darkTheme: {
8
+ readonly '--lace-color-bg-canvas': "#161616";
9
+ readonly '--lace-color-bg-surface': "#1e1e1e";
10
+ readonly '--lace-color-bg-surface-alt': "#252526";
11
+ readonly '--lace-color-bg-input': "#0f0f0f";
12
+ readonly '--lace-color-bg-context-menu': "#1a1a1a";
13
+ readonly '--lace-color-border-default': "#333333";
14
+ readonly '--lace-color-border-subtle': "#3c3c3c";
15
+ readonly '--lace-color-border-input': "#555555";
16
+ readonly '--lace-color-border-input-hover': "#888888";
17
+ readonly '--lace-color-text-primary': "#ecefed";
18
+ readonly '--lace-color-text-label': "#e6e6e6";
19
+ readonly '--lace-color-text-muted': "#999999";
20
+ readonly '--lace-color-text-description': "#9ca3af";
21
+ readonly '--lace-color-text-accent': "#cefe65";
22
+ readonly '--lace-color-text-link': "#60a5fa";
23
+ readonly '--lace-color-text-danger': "#e5484d";
24
+ readonly '--lace-color-text-danger-soft': "#f87171";
25
+ readonly '--lace-color-accent': "#cefe65";
26
+ readonly '--lace-color-text-on-accent': "#111111";
27
+ readonly '--lace-color-accent-alpha-subtle': "rgba(206, 254, 101, 0.1)";
28
+ readonly '--lace-color-accent-alpha-medium': "rgba(206, 254, 101, 0.2)";
29
+ readonly '--lace-color-accent-strong': "#e0ff8a";
30
+ readonly '--lace-color-success': "#4ade80";
31
+ readonly '--lace-color-success-hover': "#22c55e";
32
+ readonly '--lace-color-success-strong': "#16a34a";
33
+ readonly '--lace-color-danger': "#e5484d";
34
+ readonly '--lace-color-danger-bg-soft': "rgba(248, 113, 113, 0.12)";
35
+ readonly '--lace-color-danger-fg': "#f87171";
36
+ readonly '--lace-color-warning-bg': "#3b2507";
37
+ readonly '--lace-color-warning-fg': "#fbbf24";
38
+ readonly '--lace-color-focus-ring': "#cefe65";
39
+ };
40
+ /**
41
+ * The light theme's semantic colours — every `--lace-color-*` tokens.css's `[data-theme="light"]`
42
+ * block overrides, at the value it resolves to there — declared after `darkTheme` under the
43
+ * page's own `[data-theme="light"]`.
44
+ */
45
+ declare const lightTheme: {
46
+ readonly '--lace-color-bg-canvas': "#ffffff";
47
+ readonly '--lace-color-bg-surface': "#f8fafc";
48
+ readonly '--lace-color-bg-surface-alt': "#f1f5f9";
49
+ readonly '--lace-color-bg-input': "#ffffff";
50
+ readonly '--lace-color-bg-context-menu': "#ffffff";
51
+ readonly '--lace-color-border-default': "#cbd5e1";
52
+ readonly '--lace-color-border-subtle': "#e2e8f0";
53
+ readonly '--lace-color-border-input': "#cbd5e1";
54
+ readonly '--lace-color-border-input-hover': "#94a3b8";
55
+ readonly '--lace-color-text-primary': "#0f172a";
56
+ readonly '--lace-color-text-label': "#1f2937";
57
+ readonly '--lace-color-text-muted': "#64748b";
58
+ readonly '--lace-color-text-description': "#475569";
59
+ readonly '--lace-color-text-accent': "#3d6600";
60
+ readonly '--lace-color-text-link': "#2563eb";
61
+ readonly '--lace-color-text-danger': "#dc2626";
62
+ readonly '--lace-color-text-danger-soft': "#ef4444";
63
+ readonly '--lace-color-accent': "#3d6600";
64
+ readonly '--lace-color-accent-alpha-subtle': "rgba(132, 204, 22, 0.08)";
65
+ readonly '--lace-color-accent-alpha-medium': "rgba(132, 204, 22, 0.16)";
66
+ readonly '--lace-color-accent-strong': "#2d4a00";
67
+ readonly '--lace-color-success': "#047857";
68
+ readonly '--lace-color-success-hover': "#065f46";
69
+ readonly '--lace-color-success-strong': "#064e3b";
70
+ readonly '--lace-color-danger': "#dc2626";
71
+ readonly '--lace-color-danger-bg-soft': "#fef2f2";
72
+ readonly '--lace-color-danger-fg': "#b91c1c";
73
+ readonly '--lace-color-warning-bg': "#fffbeb";
74
+ readonly '--lace-color-warning-fg': "#b45309";
75
+ readonly '--lace-color-focus-ring': "#3d6600";
76
+ };
77
+
78
+ declare const brand: {
79
+ readonly green: "#CEFE65";
80
+ readonly greenBright: "#e0ff8a";
81
+ readonly gunmetal: "#153238";
82
+ readonly gunmetalLight: "#1a3f47";
83
+ readonly night: "#161616";
84
+ readonly cyan: "#95E7FF";
85
+ readonly grey: "#ECEFED";
86
+ };
87
+ declare const pin: {
88
+ readonly string: {
89
+ readonly fill: "#95E7FF";
90
+ readonly stroke: "#2C9DB9";
91
+ };
92
+ readonly number: {
93
+ readonly fill: "#F5A623";
94
+ readonly stroke: "#8A5A10";
95
+ };
96
+ readonly bool: {
97
+ readonly fill: "#B084F0";
98
+ readonly stroke: "#5C3E9A";
99
+ };
100
+ readonly list: {
101
+ readonly fill: "#CEFE65";
102
+ readonly stroke: "#5E8A1A";
103
+ };
104
+ readonly map: {
105
+ readonly fill: "#F288C6";
106
+ readonly stroke: "#8A2E5C";
107
+ };
108
+ readonly object: {
109
+ readonly fill: "#FF8A4C";
110
+ readonly stroke: "#8A3A10";
111
+ };
112
+ readonly any: {
113
+ readonly fill: "#9BA19E";
114
+ readonly stroke: "#4A4F4C";
115
+ };
116
+ };
117
+
118
+ /** A theme's colours as the declarations of one CSS rule, `name:value` joined
119
+ * by `;`, for a page that declares the tokens in a rule of its own. */
120
+ declare function themeDeclarations(theme: Readonly<Record<string, string>>): string;
121
+
122
+ export { brand, darkTheme, lightTheme, pin, themeDeclarations };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,80 @@
1
+ /**
2
+ * The dark theme's semantic colours — every `--lace-color-*` of tokens.css's semantic tier, at the
3
+ * value it resolves to in the default (dark) theme — for a consumer that cannot load tokens.css: a
4
+ * server-rendered page declares them in its own `:root` and reads them by the names the
5
+ * stylesheet uses.
6
+ */
7
+ declare const darkTheme: {
8
+ readonly '--lace-color-bg-canvas': "#161616";
9
+ readonly '--lace-color-bg-surface': "#1e1e1e";
10
+ readonly '--lace-color-bg-surface-alt': "#252526";
11
+ readonly '--lace-color-bg-input': "#0f0f0f";
12
+ readonly '--lace-color-bg-context-menu': "#1a1a1a";
13
+ readonly '--lace-color-border-default': "#333333";
14
+ readonly '--lace-color-border-subtle': "#3c3c3c";
15
+ readonly '--lace-color-border-input': "#555555";
16
+ readonly '--lace-color-border-input-hover': "#888888";
17
+ readonly '--lace-color-text-primary': "#ecefed";
18
+ readonly '--lace-color-text-label': "#e6e6e6";
19
+ readonly '--lace-color-text-muted': "#999999";
20
+ readonly '--lace-color-text-description': "#9ca3af";
21
+ readonly '--lace-color-text-accent': "#cefe65";
22
+ readonly '--lace-color-text-link': "#60a5fa";
23
+ readonly '--lace-color-text-danger': "#e5484d";
24
+ readonly '--lace-color-text-danger-soft': "#f87171";
25
+ readonly '--lace-color-accent': "#cefe65";
26
+ readonly '--lace-color-text-on-accent': "#111111";
27
+ readonly '--lace-color-accent-alpha-subtle': "rgba(206, 254, 101, 0.1)";
28
+ readonly '--lace-color-accent-alpha-medium': "rgba(206, 254, 101, 0.2)";
29
+ readonly '--lace-color-accent-strong': "#e0ff8a";
30
+ readonly '--lace-color-success': "#4ade80";
31
+ readonly '--lace-color-success-hover': "#22c55e";
32
+ readonly '--lace-color-success-strong': "#16a34a";
33
+ readonly '--lace-color-danger': "#e5484d";
34
+ readonly '--lace-color-danger-bg-soft': "rgba(248, 113, 113, 0.12)";
35
+ readonly '--lace-color-danger-fg': "#f87171";
36
+ readonly '--lace-color-warning-bg': "#3b2507";
37
+ readonly '--lace-color-warning-fg': "#fbbf24";
38
+ readonly '--lace-color-focus-ring': "#cefe65";
39
+ };
40
+ /**
41
+ * The light theme's semantic colours — every `--lace-color-*` tokens.css's `[data-theme="light"]`
42
+ * block overrides, at the value it resolves to there — declared after `darkTheme` under the
43
+ * page's own `[data-theme="light"]`.
44
+ */
45
+ declare const lightTheme: {
46
+ readonly '--lace-color-bg-canvas': "#ffffff";
47
+ readonly '--lace-color-bg-surface': "#f8fafc";
48
+ readonly '--lace-color-bg-surface-alt': "#f1f5f9";
49
+ readonly '--lace-color-bg-input': "#ffffff";
50
+ readonly '--lace-color-bg-context-menu': "#ffffff";
51
+ readonly '--lace-color-border-default': "#cbd5e1";
52
+ readonly '--lace-color-border-subtle': "#e2e8f0";
53
+ readonly '--lace-color-border-input': "#cbd5e1";
54
+ readonly '--lace-color-border-input-hover': "#94a3b8";
55
+ readonly '--lace-color-text-primary': "#0f172a";
56
+ readonly '--lace-color-text-label': "#1f2937";
57
+ readonly '--lace-color-text-muted': "#64748b";
58
+ readonly '--lace-color-text-description': "#475569";
59
+ readonly '--lace-color-text-accent': "#3d6600";
60
+ readonly '--lace-color-text-link': "#2563eb";
61
+ readonly '--lace-color-text-danger': "#dc2626";
62
+ readonly '--lace-color-text-danger-soft': "#ef4444";
63
+ readonly '--lace-color-accent': "#3d6600";
64
+ readonly '--lace-color-accent-alpha-subtle': "rgba(132, 204, 22, 0.08)";
65
+ readonly '--lace-color-accent-alpha-medium': "rgba(132, 204, 22, 0.16)";
66
+ readonly '--lace-color-accent-strong': "#2d4a00";
67
+ readonly '--lace-color-success': "#047857";
68
+ readonly '--lace-color-success-hover': "#065f46";
69
+ readonly '--lace-color-success-strong': "#064e3b";
70
+ readonly '--lace-color-danger': "#dc2626";
71
+ readonly '--lace-color-danger-bg-soft': "#fef2f2";
72
+ readonly '--lace-color-danger-fg': "#b91c1c";
73
+ readonly '--lace-color-warning-bg': "#fffbeb";
74
+ readonly '--lace-color-warning-fg': "#b45309";
75
+ readonly '--lace-color-focus-ring': "#3d6600";
76
+ };
77
+
1
78
  declare const brand: {
2
79
  readonly green: "#CEFE65";
3
80
  readonly greenBright: "#e0ff8a";
@@ -37,20 +114,9 @@ declare const pin: {
37
114
  readonly stroke: "#4A4F4C";
38
115
  };
39
116
  };
40
- declare const ui: {
41
- readonly btnPrimary: "#1f6feb";
42
- readonly btnPrimaryDim: "#1a4d8f";
43
- readonly btnSuccess: "#1a7f37";
44
- readonly btnSuccessHover: "#3ab653";
45
- readonly btnDangerBg: "#6e2b2b";
46
- readonly textDanger: "#e5484d";
47
- readonly textDangerLight: "#f87171";
48
- readonly bgSurface: "#1e1e1e";
49
- readonly bgSurfaceAlt: "#252526";
50
- readonly bgInput: "#0f0f0f";
51
- readonly borderDefault: "#333333";
52
- readonly borderInput: "#555555";
53
- readonly borderSubtle: "#3c3c3c";
54
- };
55
117
 
56
- export { brand, pin, ui };
118
+ /** A theme's colours as the declarations of one CSS rule, `name:value` joined
119
+ * by `;`, for a page that declares the tokens in a rule of its own. */
120
+ declare function themeDeclarations(theme: Readonly<Record<string, string>>): string;
121
+
122
+ export { brand, darkTheme, lightTheme, pin, themeDeclarations };
package/dist/index.mjs CHANGED
@@ -1,3 +1,70 @@
1
+ // src/themes.gen.ts
2
+ var darkTheme = {
3
+ "--lace-color-bg-canvas": "#161616",
4
+ "--lace-color-bg-surface": "#1e1e1e",
5
+ "--lace-color-bg-surface-alt": "#252526",
6
+ "--lace-color-bg-input": "#0f0f0f",
7
+ "--lace-color-bg-context-menu": "#1a1a1a",
8
+ "--lace-color-border-default": "#333333",
9
+ "--lace-color-border-subtle": "#3c3c3c",
10
+ "--lace-color-border-input": "#555555",
11
+ "--lace-color-border-input-hover": "#888888",
12
+ "--lace-color-text-primary": "#ecefed",
13
+ "--lace-color-text-label": "#e6e6e6",
14
+ "--lace-color-text-muted": "#999999",
15
+ "--lace-color-text-description": "#9ca3af",
16
+ "--lace-color-text-accent": "#cefe65",
17
+ "--lace-color-text-link": "#60a5fa",
18
+ "--lace-color-text-danger": "#e5484d",
19
+ "--lace-color-text-danger-soft": "#f87171",
20
+ "--lace-color-accent": "#cefe65",
21
+ "--lace-color-text-on-accent": "#111111",
22
+ "--lace-color-accent-alpha-subtle": "rgba(206, 254, 101, 0.1)",
23
+ "--lace-color-accent-alpha-medium": "rgba(206, 254, 101, 0.2)",
24
+ "--lace-color-accent-strong": "#e0ff8a",
25
+ "--lace-color-success": "#4ade80",
26
+ "--lace-color-success-hover": "#22c55e",
27
+ "--lace-color-success-strong": "#16a34a",
28
+ "--lace-color-danger": "#e5484d",
29
+ "--lace-color-danger-bg-soft": "rgba(248, 113, 113, 0.12)",
30
+ "--lace-color-danger-fg": "#f87171",
31
+ "--lace-color-warning-bg": "#3b2507",
32
+ "--lace-color-warning-fg": "#fbbf24",
33
+ "--lace-color-focus-ring": "#cefe65"
34
+ };
35
+ var lightTheme = {
36
+ "--lace-color-bg-canvas": "#ffffff",
37
+ "--lace-color-bg-surface": "#f8fafc",
38
+ "--lace-color-bg-surface-alt": "#f1f5f9",
39
+ "--lace-color-bg-input": "#ffffff",
40
+ "--lace-color-bg-context-menu": "#ffffff",
41
+ "--lace-color-border-default": "#cbd5e1",
42
+ "--lace-color-border-subtle": "#e2e8f0",
43
+ "--lace-color-border-input": "#cbd5e1",
44
+ "--lace-color-border-input-hover": "#94a3b8",
45
+ "--lace-color-text-primary": "#0f172a",
46
+ "--lace-color-text-label": "#1f2937",
47
+ "--lace-color-text-muted": "#64748b",
48
+ "--lace-color-text-description": "#475569",
49
+ "--lace-color-text-accent": "#3d6600",
50
+ "--lace-color-text-link": "#2563eb",
51
+ "--lace-color-text-danger": "#dc2626",
52
+ "--lace-color-text-danger-soft": "#ef4444",
53
+ "--lace-color-accent": "#3d6600",
54
+ "--lace-color-accent-alpha-subtle": "rgba(132, 204, 22, 0.08)",
55
+ "--lace-color-accent-alpha-medium": "rgba(132, 204, 22, 0.16)",
56
+ "--lace-color-accent-strong": "#2d4a00",
57
+ "--lace-color-success": "#047857",
58
+ "--lace-color-success-hover": "#065f46",
59
+ "--lace-color-success-strong": "#064e3b",
60
+ "--lace-color-danger": "#dc2626",
61
+ "--lace-color-danger-bg-soft": "#fef2f2",
62
+ "--lace-color-danger-fg": "#b91c1c",
63
+ "--lace-color-warning-bg": "#fffbeb",
64
+ "--lace-color-warning-fg": "#b45309",
65
+ "--lace-color-focus-ring": "#3d6600"
66
+ };
67
+
1
68
  // src/index.ts
2
69
  var brand = {
3
70
  green: "#CEFE65",
@@ -17,24 +84,14 @@ var pin = {
17
84
  object: { fill: "#FF8A4C", stroke: "#8A3A10" },
18
85
  any: { fill: "#9BA19E", stroke: "#4A4F4C" }
19
86
  };
20
- var ui = {
21
- btnPrimary: "#1f6feb",
22
- btnPrimaryDim: "#1a4d8f",
23
- btnSuccess: "#1a7f37",
24
- btnSuccessHover: "#3ab653",
25
- btnDangerBg: "#6e2b2b",
26
- textDanger: "#e5484d",
27
- textDangerLight: "#f87171",
28
- bgSurface: "#1e1e1e",
29
- bgSurfaceAlt: "#252526",
30
- bgInput: "#0f0f0f",
31
- borderDefault: "#333333",
32
- borderInput: "#555555",
33
- borderSubtle: "#3c3c3c"
34
- };
87
+ function themeDeclarations(theme) {
88
+ return Object.entries(theme).map(([name, value]) => `${name}:${value}`).join(";");
89
+ }
35
90
  export {
36
91
  brand,
92
+ darkTheme,
93
+ lightTheme,
37
94
  pin,
38
- ui
95
+ themeDeclarations
39
96
  };
40
97
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @lace-cloud/design-tokens — JS/TS token exports\n// Primary distribution is tokens.css; use this for JS/TS consumers that\n// need programmatic access to token values (e.g., pinColor.ts).\n\nexport const brand = {\n green: '#CEFE65',\n greenBright: '#e0ff8a',\n gunmetal: '#153238',\n gunmetalLight: '#1a3f47',\n night: '#161616',\n cyan: '#95E7FF',\n grey: '#ECEFED',\n} as const;\n\nexport const pin = {\n string: { fill: '#95E7FF', stroke: '#2C9DB9' },\n number: { fill: '#F5A623', stroke: '#8A5A10' },\n bool: { fill: '#B084F0', stroke: '#5C3E9A' },\n list: { fill: '#CEFE65', stroke: '#5E8A1A' },\n map: { fill: '#F288C6', stroke: '#8A2E5C' },\n object: { fill: '#FF8A4C', stroke: '#8A3A10' },\n any: { fill: '#9BA19E', stroke: '#4A4F4C' },\n} as const;\n\nexport const ui = {\n btnPrimary: '#1f6feb',\n btnPrimaryDim: '#1a4d8f',\n btnSuccess: '#1a7f37',\n btnSuccessHover: '#3ab653',\n btnDangerBg: '#6e2b2b',\n textDanger: '#e5484d',\n textDangerLight: '#f87171',\n bgSurface: '#1e1e1e',\n bgSurfaceAlt: '#252526',\n bgInput: '#0f0f0f',\n borderDefault: '#333333',\n borderInput: '#555555',\n borderSubtle: '#3c3c3c',\n} as const;\n"],"mappings":";AAIO,IAAM,QAAQ;AAAA,EACnB,OAAO;AAAA,EACP,aAAa;AAAA,EACb,UAAU;AAAA,EACV,eAAe;AAAA,EACf,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEO,IAAM,MAAM;AAAA,EACjB,QAAQ,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC7C,QAAQ,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC7C,MAAM,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC3C,MAAM,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC3C,KAAK,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC1C,QAAQ,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC7C,KAAK,EAAE,MAAM,WAAW,QAAQ,UAAU;AAC5C;AAEO,IAAM,KAAK;AAAA,EAChB,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,SAAS;AAAA,EACT,eAAe;AAAA,EACf,aAAa;AAAA,EACb,cAAc;AAChB;","names":[]}
1
+ {"version":3,"sources":["../src/themes.gen.ts","../src/index.ts"],"sourcesContent":["// Generated from tokens.css by scripts/gen-themes.mjs; `pnpm --filter @lace-cloud/design-tokens build`\n// rewrites it. Edit tokens.css, never this file.\n\n/**\n * The dark theme's semantic colours — every `--lace-color-*` of tokens.css's semantic tier, at the\n * value it resolves to in the default (dark) theme — for a consumer that cannot load tokens.css: a\n * server-rendered page declares them in its own `:root` and reads them by the names the\n * stylesheet uses.\n */\nexport const darkTheme = {\n '--lace-color-bg-canvas': '#161616',\n '--lace-color-bg-surface': '#1e1e1e',\n '--lace-color-bg-surface-alt': '#252526',\n '--lace-color-bg-input': '#0f0f0f',\n '--lace-color-bg-context-menu': '#1a1a1a',\n '--lace-color-border-default': '#333333',\n '--lace-color-border-subtle': '#3c3c3c',\n '--lace-color-border-input': '#555555',\n '--lace-color-border-input-hover': '#888888',\n '--lace-color-text-primary': '#ecefed',\n '--lace-color-text-label': '#e6e6e6',\n '--lace-color-text-muted': '#999999',\n '--lace-color-text-description': '#9ca3af',\n '--lace-color-text-accent': '#cefe65',\n '--lace-color-text-link': '#60a5fa',\n '--lace-color-text-danger': '#e5484d',\n '--lace-color-text-danger-soft': '#f87171',\n '--lace-color-accent': '#cefe65',\n '--lace-color-text-on-accent': '#111111',\n '--lace-color-accent-alpha-subtle': 'rgba(206, 254, 101, 0.1)',\n '--lace-color-accent-alpha-medium': 'rgba(206, 254, 101, 0.2)',\n '--lace-color-accent-strong': '#e0ff8a',\n '--lace-color-success': '#4ade80',\n '--lace-color-success-hover': '#22c55e',\n '--lace-color-success-strong': '#16a34a',\n '--lace-color-danger': '#e5484d',\n '--lace-color-danger-bg-soft': 'rgba(248, 113, 113, 0.12)',\n '--lace-color-danger-fg': '#f87171',\n '--lace-color-warning-bg': '#3b2507',\n '--lace-color-warning-fg': '#fbbf24',\n '--lace-color-focus-ring': '#cefe65',\n} as const;\n\n/**\n * The light theme's semantic colours — every `--lace-color-*` tokens.css's `[data-theme=\"light\"]`\n * block overrides, at the value it resolves to there — declared after `darkTheme` under the\n * page's own `[data-theme=\"light\"]`.\n */\nexport const lightTheme = {\n '--lace-color-bg-canvas': '#ffffff',\n '--lace-color-bg-surface': '#f8fafc',\n '--lace-color-bg-surface-alt': '#f1f5f9',\n '--lace-color-bg-input': '#ffffff',\n '--lace-color-bg-context-menu': '#ffffff',\n '--lace-color-border-default': '#cbd5e1',\n '--lace-color-border-subtle': '#e2e8f0',\n '--lace-color-border-input': '#cbd5e1',\n '--lace-color-border-input-hover': '#94a3b8',\n '--lace-color-text-primary': '#0f172a',\n '--lace-color-text-label': '#1f2937',\n '--lace-color-text-muted': '#64748b',\n '--lace-color-text-description': '#475569',\n '--lace-color-text-accent': '#3d6600',\n '--lace-color-text-link': '#2563eb',\n '--lace-color-text-danger': '#dc2626',\n '--lace-color-text-danger-soft': '#ef4444',\n '--lace-color-accent': '#3d6600',\n '--lace-color-accent-alpha-subtle': 'rgba(132, 204, 22, 0.08)',\n '--lace-color-accent-alpha-medium': 'rgba(132, 204, 22, 0.16)',\n '--lace-color-accent-strong': '#2d4a00',\n '--lace-color-success': '#047857',\n '--lace-color-success-hover': '#065f46',\n '--lace-color-success-strong': '#064e3b',\n '--lace-color-danger': '#dc2626',\n '--lace-color-danger-bg-soft': '#fef2f2',\n '--lace-color-danger-fg': '#b91c1c',\n '--lace-color-warning-bg': '#fffbeb',\n '--lace-color-warning-fg': '#b45309',\n '--lace-color-focus-ring': '#3d6600',\n} as const;\n","// @lace-cloud/design-tokens — JS/TS token exports\n// Primary distribution is tokens.css; use this for JS/TS consumers that\n// need programmatic access to token values (e.g., pinColor.ts).\n\nexport const brand = {\n green: '#CEFE65',\n greenBright: '#e0ff8a',\n gunmetal: '#153238',\n gunmetalLight: '#1a3f47',\n night: '#161616',\n cyan: '#95E7FF',\n grey: '#ECEFED',\n} as const;\n\nexport const pin = {\n string: { fill: '#95E7FF', stroke: '#2C9DB9' },\n number: { fill: '#F5A623', stroke: '#8A5A10' },\n bool: { fill: '#B084F0', stroke: '#5C3E9A' },\n list: { fill: '#CEFE65', stroke: '#5E8A1A' },\n map: { fill: '#F288C6', stroke: '#8A2E5C' },\n object: { fill: '#FF8A4C', stroke: '#8A3A10' },\n any: { fill: '#9BA19E', stroke: '#4A4F4C' },\n} as const;\n\n// The themes' semantic colours, generated from tokens.css at build\n// (`src/themes-source.ts`): `darkTheme` and `lightTheme`, for a consumer that\n// cannot load the stylesheet.\nexport { darkTheme, lightTheme } from './themes.gen.ts';\n\n/** A theme's colours as the declarations of one CSS rule, `name:value` joined\n * by `;`, for a page that declares the tokens in a rule of its own. */\nexport function themeDeclarations(theme: Readonly<Record<string, string>>): string {\n return Object.entries(theme)\n .map(([name, value]) => `${name}:${value}`)\n .join(';');\n}\n"],"mappings":";AASO,IAAM,YAAY;AAAA,EACvB,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,+BAA+B;AAAA,EAC/B,yBAAyB;AAAA,EACzB,gCAAgC;AAAA,EAChC,+BAA+B;AAAA,EAC/B,8BAA8B;AAAA,EAC9B,6BAA6B;AAAA,EAC7B,mCAAmC;AAAA,EACnC,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,iCAAiC;AAAA,EACjC,4BAA4B;AAAA,EAC5B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,iCAAiC;AAAA,EACjC,uBAAuB;AAAA,EACvB,+BAA+B;AAAA,EAC/B,oCAAoC;AAAA,EACpC,oCAAoC;AAAA,EACpC,8BAA8B;AAAA,EAC9B,wBAAwB;AAAA,EACxB,8BAA8B;AAAA,EAC9B,+BAA+B;AAAA,EAC/B,uBAAuB;AAAA,EACvB,+BAA+B;AAAA,EAC/B,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,2BAA2B;AAC7B;AAOO,IAAM,aAAa;AAAA,EACxB,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,+BAA+B;AAAA,EAC/B,yBAAyB;AAAA,EACzB,gCAAgC;AAAA,EAChC,+BAA+B;AAAA,EAC/B,8BAA8B;AAAA,EAC9B,6BAA6B;AAAA,EAC7B,mCAAmC;AAAA,EACnC,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,iCAAiC;AAAA,EACjC,4BAA4B;AAAA,EAC5B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,iCAAiC;AAAA,EACjC,uBAAuB;AAAA,EACvB,oCAAoC;AAAA,EACpC,oCAAoC;AAAA,EACpC,8BAA8B;AAAA,EAC9B,wBAAwB;AAAA,EACxB,8BAA8B;AAAA,EAC9B,+BAA+B;AAAA,EAC/B,uBAAuB;AAAA,EACvB,+BAA+B;AAAA,EAC/B,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,2BAA2B;AAC7B;;;AC3EO,IAAM,QAAQ;AAAA,EACnB,OAAO;AAAA,EACP,aAAa;AAAA,EACb,UAAU;AAAA,EACV,eAAe;AAAA,EACf,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEO,IAAM,MAAM;AAAA,EACjB,QAAQ,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC7C,QAAQ,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC7C,MAAM,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC3C,MAAM,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC3C,KAAK,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC1C,QAAQ,EAAE,MAAM,WAAW,QAAQ,UAAU;AAAA,EAC7C,KAAK,EAAE,MAAM,WAAW,QAAQ,UAAU;AAC5C;AASO,SAAS,kBAAkB,OAAiD;AACjF,SAAO,OAAO,QAAQ,KAAK,EACxB,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,GAAG,IAAI,IAAI,KAAK,EAAE,EACzC,KAAK,GAAG;AACb;","names":[]}
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@lace-cloud/design-tokens",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "license": "BUSL-1.1",
5
+ "type": "module",
5
6
  "main": "./dist/index.cjs",
6
7
  "types": "./dist/index.d.ts",
7
8
  "devDependencies": {
@@ -23,7 +24,7 @@
23
24
  "directory": "packages/design-tokens"
24
25
  },
25
26
  "scripts": {
26
- "build": "tsup",
27
+ "build": "node scripts/gen-themes.mjs && tsup",
27
28
  "clean": "rm -rf dist",
28
29
  "test": "vitest run"
29
30
  },
package/tokens.css CHANGED
@@ -48,6 +48,9 @@
48
48
  --lace-color-neutral-975: #0a0a0c;
49
49
  --lace-color-neutral-black: #000000;
50
50
 
51
+ /* ── Palette: warm neutral ── */
52
+ --lace-color-warm-900: #1a1815;
53
+
51
54
  /* ── Palette: semantic accents ── */
52
55
  --lace-color-teal-700: #153238;
53
56
  --lace-color-teal-600: #1a3f47;
@@ -356,6 +359,11 @@
356
359
  --lace-cyan: var(--lace-color-cyan-500);
357
360
  --lace-grey: var(--lace-color-neutral-100);
358
361
 
362
+ /* ── Chat ── */
363
+ /* The one surface the chat panel sits on, the same in both themes: a warm
364
+ * near-black its tiles are cut from and its mark's face is drawn in. */
365
+ --lace-chat-surface: var(--lace-color-warm-900);
366
+
359
367
  /* ── Surface aliases (prefer semantic tokens) ── */
360
368
  --lace-bg-surface: var(--lace-color-bg-surface);
361
369
  --lace-bg-surface-alt: var(--lace-color-bg-surface-alt);
package/dist/index.d.mts DELETED
@@ -1,56 +0,0 @@
1
- declare const brand: {
2
- readonly green: "#CEFE65";
3
- readonly greenBright: "#e0ff8a";
4
- readonly gunmetal: "#153238";
5
- readonly gunmetalLight: "#1a3f47";
6
- readonly night: "#161616";
7
- readonly cyan: "#95E7FF";
8
- readonly grey: "#ECEFED";
9
- };
10
- declare const pin: {
11
- readonly string: {
12
- readonly fill: "#95E7FF";
13
- readonly stroke: "#2C9DB9";
14
- };
15
- readonly number: {
16
- readonly fill: "#F5A623";
17
- readonly stroke: "#8A5A10";
18
- };
19
- readonly bool: {
20
- readonly fill: "#B084F0";
21
- readonly stroke: "#5C3E9A";
22
- };
23
- readonly list: {
24
- readonly fill: "#CEFE65";
25
- readonly stroke: "#5E8A1A";
26
- };
27
- readonly map: {
28
- readonly fill: "#F288C6";
29
- readonly stroke: "#8A2E5C";
30
- };
31
- readonly object: {
32
- readonly fill: "#FF8A4C";
33
- readonly stroke: "#8A3A10";
34
- };
35
- readonly any: {
36
- readonly fill: "#9BA19E";
37
- readonly stroke: "#4A4F4C";
38
- };
39
- };
40
- declare const ui: {
41
- readonly btnPrimary: "#1f6feb";
42
- readonly btnPrimaryDim: "#1a4d8f";
43
- readonly btnSuccess: "#1a7f37";
44
- readonly btnSuccessHover: "#3ab653";
45
- readonly btnDangerBg: "#6e2b2b";
46
- readonly textDanger: "#e5484d";
47
- readonly textDangerLight: "#f87171";
48
- readonly bgSurface: "#1e1e1e";
49
- readonly bgSurfaceAlt: "#252526";
50
- readonly bgInput: "#0f0f0f";
51
- readonly borderDefault: "#333333";
52
- readonly borderInput: "#555555";
53
- readonly borderSubtle: "#3c3c3c";
54
- };
55
-
56
- export { brand, pin, ui };