@chances-ai/ui-core 23.0.2 → 24.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.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/theme/builtins.d.ts +25 -0
- package/dist/theme/builtins.d.ts.map +1 -0
- package/dist/theme/builtins.js +207 -0
- package/dist/theme/builtins.js.map +1 -0
- package/dist/theme/color.d.ts +68 -0
- package/dist/theme/color.d.ts.map +1 -0
- package/dist/theme/color.js +190 -0
- package/dist/theme/color.js.map +1 -0
- package/dist/theme/contrast.d.ts +18 -0
- package/dist/theme/contrast.d.ts.map +1 -0
- package/dist/theme/contrast.js +25 -0
- package/dist/theme/contrast.js.map +1 -0
- package/dist/theme/index.d.ts +29 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +42 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/project.d.ts +14 -0
- package/dist/theme/project.d.ts.map +1 -0
- package/dist/theme/project.js +37 -0
- package/dist/theme/project.js.map +1 -0
- package/dist/theme/resolve.d.ts +11 -0
- package/dist/theme/resolve.d.ts.map +1 -0
- package/dist/theme/resolve.js +143 -0
- package/dist/theme/resolve.js.map +1 -0
- package/dist/theme/schema.d.ts +60 -0
- package/dist/theme/schema.d.ts.map +1 -0
- package/dist/theme/schema.js +81 -0
- package/dist/theme/schema.js.map +1 -0
- package/dist/theme/tokens.d.ts +39 -0
- package/dist/theme/tokens.d.ts.map +1 -0
- package/dist/theme/tokens.js +111 -0
- package/dist/theme/tokens.js.map +1 -0
- package/dist/theme.d.ts +10 -29
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +19 -73
- package/dist/theme.js.map +1 -1
- package/dist/view-model.d.ts +1 -1
- package/dist/view-model.d.ts.map +1 -1
- package/dist/web-theme.d.ts +6 -6
- package/dist/web-theme.d.ts.map +1 -1
- package/dist/web-theme.js +18 -37
- package/dist/web-theme.js.map +1 -1
- package/package.json +3 -3
package/dist/theme.d.ts
CHANGED
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* (5.9 / v14; v17 ui-core) The single home for the visual-language literals:
|
|
3
|
-
* glyphs + color palettes. Pure module — NO React, NO Ink, **NO `node:*` / no
|
|
4
|
-
* `process.*`** — so it is browser-safe and shared verbatim across the TUI, the
|
|
5
|
-
* web/desktop client, and the server-side highlight path. The Node-bound
|
|
6
|
-
* conveniences (env-reading `isNoColor`/`resolveTheme` defaults + the
|
|
7
|
-
* `process.platform`-derived `GLYPHS` constant) live in the TUI's `theme.ts`
|
|
8
|
-
* shim, which injects `process.*` into these pure functions.
|
|
9
|
-
*
|
|
10
|
-
* Colors are emitted as `rgb(r,g,b)` strings; the TUI renders them through Ink +
|
|
11
|
-
* chalk (truecolor → 256/16 downsample by terminal level), the web renders them
|
|
12
|
-
* as CSS — one truecolor palette per mode, consumers degrade. There is no
|
|
13
|
-
* hand-rolled 16-ANSI fallback table (5.9 §0).
|
|
14
|
-
*
|
|
15
|
-
* `NO_COLOR` (https://no-color.org) is honored via {@link isNoColor}: when set,
|
|
16
|
-
* `resolveTheme` returns a palette whose every color is `undefined`, so consumers
|
|
17
|
-
* emit no `color`/`backgroundColor` and meaning is carried by glyphs + sigils
|
|
18
|
-
* alone (the diff `+`/`-`, the `⏺`/`⎿` shapes).
|
|
19
|
-
*
|
|
20
|
-
* Dark RGB values are the facts of claude-code's `darkTheme` visual language;
|
|
21
|
-
* light values track its `lightTheme`. Syntax colors are an OneDark-ish set
|
|
22
|
-
* legible on the respective background.
|
|
23
|
-
*/
|
|
24
1
|
/** A resolved palette. Every field optional: `undefined` ⇒ emit no color for
|
|
25
|
-
* that role (terminal default fg / no bg). The NO_COLOR palette is all-undefined.
|
|
2
|
+
* that role (terminal default fg / no bg). The NO_COLOR palette is all-undefined.
|
|
3
|
+
* Values are `rgb(r,g,b)` (truecolor, chalk downsamples) or `ansi:<name>` (the
|
|
4
|
+
* ANSI-16 theme; the TUI shim maps these to chalk's named colors). */
|
|
26
5
|
export interface Theme {
|
|
27
6
|
/** Claude accent (orange). Running tool dot, top-level headings, links, spinner glyph. */
|
|
28
7
|
accent?: string;
|
|
@@ -60,9 +39,10 @@ export interface Theme {
|
|
|
60
39
|
synTitle?: string;
|
|
61
40
|
synAttr?: string;
|
|
62
41
|
}
|
|
63
|
-
/** Theme selection as it arrives from config. `'auto'` resolves to `'dark'`
|
|
64
|
-
*
|
|
65
|
-
|
|
42
|
+
/** Theme selection as it arrives from config. `'auto'` resolves to `'dark'`
|
|
43
|
+
* (terminal-background detection is a later lever). 7.3 adds the daltonized +
|
|
44
|
+
* ansi-16 accessibility variants. */
|
|
45
|
+
export type ThemeSetting = "dark" | "light" | "auto" | "daltonized" | "dark-daltonized" | "light-daltonized" | "ansi" | "dark-ansi" | "light-ansi";
|
|
66
46
|
/** The minimal env shape {@link isNoColor} reads. Browser-safe: NOT
|
|
67
47
|
* `NodeJS.ProcessEnv` (that drags `@types/node` into the ui-core graph). A
|
|
68
48
|
* `process.env` satisfies it structurally; so does `{}` or `{ NO_COLOR: "1" }`. */
|
|
@@ -74,8 +54,9 @@ export interface NoColorEnv {
|
|
|
74
54
|
* is injected (the TUI shim passes `process.env`); no `process.*` here. */
|
|
75
55
|
export declare function isNoColor(env: NoColorEnv): boolean;
|
|
76
56
|
/**
|
|
77
|
-
* Resolve a palette. `NO_COLOR` wins over any setting; otherwise
|
|
78
|
-
*
|
|
57
|
+
* Resolve a palette. `NO_COLOR` wins over any setting; otherwise the setting
|
|
58
|
+
* selects a built-in theme + mode (engine-backed since 7.3), and the resolved
|
|
59
|
+
* tokens are projected to the 23-field `Theme`. `env` is injected.
|
|
79
60
|
*/
|
|
80
61
|
export declare function resolveTheme(setting: ThemeSetting | undefined, env: NoColorEnv): Theme;
|
|
81
62
|
export interface Glyphs {
|
package/dist/theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAkBA;;;uEAGuE;AACvE,MAAM,WAAW,KAAK;IACpB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sCAAsC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;sCAEsC;AAC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ui-core) The single home for the visual-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
2
|
+
* (5.9 / v14; v17 ui-core; 7.3 engine-backed) The single home for the visual-
|
|
3
|
+
* language literals + the public TUI palette API. As of 7.3 (task 03) the actual
|
|
4
|
+
* color values come from the **seed-driven OKLCH engine** in `./theme/` — this
|
|
5
|
+
* module is the back-compat shim that keeps the long-standing public surface
|
|
6
|
+
* (`Theme`, `ThemeSetting`, `Glyphs`, `resolveTheme`, `isNoColor`, `SPINNER_*`)
|
|
7
|
+
* byte-identical for every existing TUI/client import. Pure — NO React, NO Ink,
|
|
8
|
+
* **NO `node:*` / no `process.*`** (browser-safe). The Node-bound conveniences
|
|
9
|
+
* live in the TUI's `theme.ts` shim.
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `NO_COLOR` (https://no-color.org) is honored via {@link isNoColor}: when set,
|
|
16
|
-
* `resolveTheme` returns a palette whose every color is `undefined`, so consumers
|
|
17
|
-
* emit no `color`/`backgroundColor` and meaning is carried by glyphs + sigils
|
|
18
|
-
* alone (the diff `+`/`-`, the `⏺`/`⎿` shapes).
|
|
19
|
-
*
|
|
20
|
-
* Dark RGB values are the facts of claude-code's `darkTheme` visual language;
|
|
21
|
-
* light values track its `lightTheme`. Syntax colors are an OneDark-ish set
|
|
22
|
-
* legible on the respective background.
|
|
11
|
+
* `resolveTheme(setting)` now selects a built-in theme + mode (the `default`
|
|
12
|
+
* theme PINS every role below to today's exact RGB ⇒ zero regression), resolves
|
|
13
|
+
* its tokens, and projects them to the 23-field `Theme`. `NO_COLOR` still wins
|
|
14
|
+
* over any setting and yields an all-undefined palette (glyphs/sigils carry
|
|
15
|
+
* meaning). New settings (`daltonized`, `ansi`, …) are additive.
|
|
23
16
|
*/
|
|
24
|
-
|
|
25
|
-
accent: "rgb(215,119,87)",
|
|
26
|
-
success: "rgb(78,186,101)",
|
|
27
|
-
error: "rgb(255,107,128)",
|
|
28
|
-
warning: "rgb(255,193,7)",
|
|
29
|
-
permission: "rgb(177,185,249)",
|
|
30
|
-
planMode: "rgb(72,150,140)",
|
|
31
|
-
autoAccept: "rgb(175,135,255)",
|
|
32
|
-
bashPink: "rgb(253,93,177)",
|
|
33
|
-
diffAddedBg: "rgb(34,92,43)",
|
|
34
|
-
diffRemovedBg: "rgb(122,41,54)",
|
|
35
|
-
diffAddedWordBg: "rgb(56,166,96)",
|
|
36
|
-
diffRemovedWordBg: "rgb(179,89,107)",
|
|
37
|
-
userMessageBg: "rgb(55,55,55)",
|
|
38
|
-
stall: "rgb(171,43,63)",
|
|
39
|
-
synKeyword: "rgb(198,120,221)",
|
|
40
|
-
synString: "rgb(152,195,121)",
|
|
41
|
-
synComment: "rgb(106,115,125)",
|
|
42
|
-
synNumber: "rgb(209,154,102)",
|
|
43
|
-
synFunction: "rgb(97,175,239)",
|
|
44
|
-
synType: "rgb(229,192,123)",
|
|
45
|
-
synLiteral: "rgb(86,182,194)",
|
|
46
|
-
synTitle: "rgb(97,175,239)",
|
|
47
|
-
synAttr: "rgb(209,154,102)",
|
|
48
|
-
};
|
|
49
|
-
const lightTheme = {
|
|
50
|
-
accent: "rgb(215,119,87)",
|
|
51
|
-
success: "rgb(44,122,57)",
|
|
52
|
-
error: "rgb(171,43,63)",
|
|
53
|
-
warning: "rgb(150,108,30)",
|
|
54
|
-
permission: "rgb(87,105,247)",
|
|
55
|
-
planMode: "rgb(0,102,102)",
|
|
56
|
-
autoAccept: "rgb(135,0,255)",
|
|
57
|
-
bashPink: "rgb(255,0,135)",
|
|
58
|
-
diffAddedBg: "rgb(105,219,124)",
|
|
59
|
-
diffRemovedBg: "rgb(255,168,180)",
|
|
60
|
-
diffAddedWordBg: "rgb(47,157,68)",
|
|
61
|
-
diffRemovedWordBg: "rgb(209,69,75)",
|
|
62
|
-
userMessageBg: "rgb(240,240,240)",
|
|
63
|
-
stall: "rgb(171,43,63)",
|
|
64
|
-
synKeyword: "rgb(166,38,164)",
|
|
65
|
-
synString: "rgb(80,161,79)",
|
|
66
|
-
synComment: "rgb(160,161,167)",
|
|
67
|
-
synNumber: "rgb(152,104,1)",
|
|
68
|
-
synFunction: "rgb(64,120,242)",
|
|
69
|
-
synType: "rgb(193,132,1)",
|
|
70
|
-
synLiteral: "rgb(1,132,188)",
|
|
71
|
-
synTitle: "rgb(64,120,242)",
|
|
72
|
-
synAttr: "rgb(152,104,1)",
|
|
73
|
-
};
|
|
17
|
+
import { parseThemeSetting, resolveThemeTokens, toTuiTheme } from "./theme/index.js";
|
|
74
18
|
/** Every color undefined ⇒ no color props emitted (glyphs/sigils carry meaning). */
|
|
75
19
|
const noColorTheme = {};
|
|
76
20
|
/** `NO_COLOR` (https://no-color.org): present and NON-EMPTY ⇒ disable color,
|
|
@@ -81,13 +25,15 @@ export function isNoColor(env) {
|
|
|
81
25
|
return typeof v === "string" && v.length > 0;
|
|
82
26
|
}
|
|
83
27
|
/**
|
|
84
|
-
* Resolve a palette. `NO_COLOR` wins over any setting; otherwise
|
|
85
|
-
*
|
|
28
|
+
* Resolve a palette. `NO_COLOR` wins over any setting; otherwise the setting
|
|
29
|
+
* selects a built-in theme + mode (engine-backed since 7.3), and the resolved
|
|
30
|
+
* tokens are projected to the 23-field `Theme`. `env` is injected.
|
|
86
31
|
*/
|
|
87
32
|
export function resolveTheme(setting, env) {
|
|
88
33
|
if (isNoColor(env))
|
|
89
34
|
return noColorTheme;
|
|
90
|
-
|
|
35
|
+
const { themeId, mode } = parseThemeSetting(setting);
|
|
36
|
+
return toTuiTheme(resolveThemeTokens(themeId, mode));
|
|
91
37
|
}
|
|
92
38
|
/** Build the glyph set for a platform. `platform` is injected (the TUI shim
|
|
93
39
|
* passes `process.platform`); only the `dot` differs (`darwin` → `⏺`, else
|
package/dist/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAkErF,oFAAoF;AACpF,MAAM,YAAY,GAAU,EAAE,CAAC;AAE/B;;4EAE4E;AAC5E,MAAM,UAAU,SAAS,CAAC,GAAe;IACvC,MAAM,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC;IACvB,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAAiC,EAAE,GAAe;IAC7E,IAAI,SAAS,CAAC,GAAG,CAAC;QAAE,OAAO,YAAY,CAAC;IACxC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACrD,OAAO,UAAU,CAAC,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAU,CAAC;AAChE,CAAC;AA4BD;;qFAEqF;AACrF,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,OAAO;QACL,GAAG,EAAE,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;QACtC,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,GAAG;QACX,UAAU,EAAE,GAAG;QACf,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,IAAI;QACZ,IAAI,EAAE,GAAG;QACT,EAAE,EAAE,GAAG;QACP,MAAM,EAAE,GAAG;QACX,QAAQ,EAAE,GAAG;QACb,SAAS,EAAE,GAAG;QACd,OAAO,EAAE,GAAG;KACb,CAAC;AACJ,CAAC;AAED;4EAC4E;AAC5E,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAC7D,MAAM,CAAC,MAAM,cAAc,GAAsB,CAAC,GAAG,YAAY,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAEnG,mFAAmF;AACnF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC"}
|
package/dist/view-model.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ApprovalMode, ApprovalState } from "@chances-ai/runtime";
|
|
2
2
|
import type { AppEventBus } from "./event-bus.js";
|
|
3
|
-
import type { AuthorizationDecision, PermissionDecision, PermissionRequest, QuestionDecision } from "@chances-ai/tools";
|
|
3
|
+
import type { AuthorizationDecision, PermissionDecision, PermissionRequest, QuestionDecision } from "@chances-ai/engine/tools";
|
|
4
4
|
import { type FrameScheduler } from "./frame-scheduler.js";
|
|
5
5
|
/** (5.9) Extract the `linesDiff` block (from the first `@@ -d` hunk header to
|
|
6
6
|
* the end) out of a write/edit permission summary, or null when the summary
|
package/dist/view-model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-model.d.ts","sourceRoot":"","sources":["../src/view-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,
|
|
1
|
+
{"version":3,"file":"view-model.d.ts","sourceRoot":"","sources":["../src/view-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAA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AK5B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK7B;;;;;;;;4CAQwC;IACxC,UAAU,IAAI,IAAI;IAUlB,MAAM,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAgH9B;;;;;;;;;;;;;OAaG;IACH,MAAM,IAAI,IAAI;IAed,OAAO,CAAC,QAAQ,CAAS;IAEzB;4EACwE;IACxE,iBAAiB,GAAI,KAAK,iBAAiB,KAAG,OAAO,CAAC,kBAAkB,CAAC,CAWvE;IAEF;;;;;;;OAOG;IACH,iBAAiB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAqBxD;;;;;OAKG;IACH,eAAe,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAkBjD,oEAAoE;IACpE,IAAI,YAAY,IAAI,YAAY,CAE/B;IAED;;;;;;;;;;;OAWG;IACH,iBAAiB,IAAI,IAAI;IAYzB;;;;8DAI0D;IAC1D,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;CAQ3C"}
|
package/dist/web-theme.d.ts
CHANGED
|
@@ -7,14 +7,14 @@ export interface WebSurface {
|
|
|
7
7
|
/** Border / divider color. */
|
|
8
8
|
border: string;
|
|
9
9
|
}
|
|
10
|
-
/** Chrome surface colors per mode (
|
|
10
|
+
/** Chrome surface colors per mode (the legacy `--ch-bg`/`--ch-fg`/`--ch-border`
|
|
11
|
+
* anchors; the `default` theme pins `bgBase`/`textBase`/`borderBase` to these). */
|
|
11
12
|
export declare const WEB_SURFACE: Record<WebMode, WebSurface>;
|
|
12
13
|
/**
|
|
13
|
-
* Emit the palette for `mode` as `--ch-*` CSS custom
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* surface). Spread onto an element's inline `style`.
|
|
14
|
+
* Emit the `default` theme's palette for `mode` as `--ch-*` CSS custom
|
|
15
|
+
* properties: the full ~66-token set (`--ch-accent`, `--ch-surface-raised`,
|
|
16
|
+
* `--ch-diff-added-bg`, …) PLUS the legacy surface aliases (`--ch-bg` / `--ch-fg`
|
|
17
|
+
* / `--ch-border`). Spread onto an element's inline `style`.
|
|
18
18
|
*/
|
|
19
19
|
export declare function themeCssVars(mode: WebMode): Record<`--${string}`, string>;
|
|
20
20
|
//# sourceMappingURL=web-theme.d.ts.map
|
package/dist/web-theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-theme.d.ts","sourceRoot":"","sources":["../src/web-theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"web-theme.d.ts","sourceRoot":"","sources":["../src/web-theme.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;AAEvC,MAAM,WAAW,UAAU;IACzB,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;oFACoF;AACpF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,CAGnD,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE,MAAM,CAAC,CAQzE"}
|
package/dist/web-theme.js
CHANGED
|
@@ -1,53 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (v22 / docs/6.5b §C1) Web/desktop chrome
|
|
3
|
-
* deriver.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `
|
|
10
|
-
*
|
|
11
|
-
* including inline styles that read `var(--ch-bg)` etc. — resolves without a
|
|
12
|
-
* global stylesheet (and an isolated `renderToStaticMarkup` smoke degrades to the
|
|
13
|
-
* CSS fallback rather than crashing). HeroUI v3 components keep their own theme;
|
|
14
|
-
* these vars drive only OUR bespoke panel chrome + are available for Tailwind
|
|
15
|
-
* arbitrary values. Pure + deterministic; no `node:*`. Values pass through as
|
|
16
|
-
* `rgb(...)`/hex (HeroUI v3 accepts any CSS color) — an OKLCH conversion is
|
|
17
|
-
* deferred until contrast math needs it (docs/6.5b §4).
|
|
2
|
+
* (v22 / docs/6.5b §C1; 7.3 engine-backed) Web/desktop chrome palette + a CSS-
|
|
3
|
+
* custom-property deriver. As of 7.3 (task 03) the values come from the seed
|
|
4
|
+
* OKLCH engine (`./theme/`): `themeCssVars(mode)` now emits the WHOLE ~66-token
|
|
5
|
+
* set as `--ch-*` (the design-system's tv classes read these via the `@theme`
|
|
6
|
+
* bridge), value-identical to the TUI palette (true single source). The legacy
|
|
7
|
+
* `--ch-bg` / `--ch-fg` / `--ch-border` surface aliases + the `WEB_SURFACE`
|
|
8
|
+
* constant are PRESERVED byte-for-byte so existing panel chrome + the v22 tests
|
|
9
|
+
* keep working. Pure; no `node:*`. The panel root spreads these onto inline
|
|
10
|
+
* `style`, so the subtree resolves without a global stylesheet.
|
|
18
11
|
*/
|
|
19
|
-
import {
|
|
20
|
-
/** Chrome surface colors per mode (
|
|
12
|
+
import { resolveThemeTokens, toCssVars } from "./theme/index.js";
|
|
13
|
+
/** Chrome surface colors per mode (the legacy `--ch-bg`/`--ch-fg`/`--ch-border`
|
|
14
|
+
* anchors; the `default` theme pins `bgBase`/`textBase`/`borderBase` to these). */
|
|
21
15
|
export const WEB_SURFACE = {
|
|
22
16
|
dark: { background: "#000000", foreground: "#ffffff", border: "#555555" },
|
|
23
17
|
light: { background: "#ffffff", foreground: "#000000", border: "#cccccc" },
|
|
24
18
|
};
|
|
25
|
-
/** camelCase `Theme` role → kebab CSS-var suffix (`diffAddedBg` → `diff-added-bg`). */
|
|
26
|
-
function kebab(s) {
|
|
27
|
-
return s.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
28
|
-
}
|
|
29
19
|
/**
|
|
30
|
-
* Emit the palette for `mode` as `--ch-*` CSS custom
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* surface). Spread onto an element's inline `style`.
|
|
20
|
+
* Emit the `default` theme's palette for `mode` as `--ch-*` CSS custom
|
|
21
|
+
* properties: the full ~66-token set (`--ch-accent`, `--ch-surface-raised`,
|
|
22
|
+
* `--ch-diff-added-bg`, …) PLUS the legacy surface aliases (`--ch-bg` / `--ch-fg`
|
|
23
|
+
* / `--ch-border`). Spread onto an element's inline `style`.
|
|
35
24
|
*/
|
|
36
25
|
export function themeCssVars(mode) {
|
|
37
|
-
const palette = resolveTheme(mode, {});
|
|
38
26
|
const surface = WEB_SURFACE[mode];
|
|
39
|
-
|
|
40
|
-
// `style` (CSSProperties accepts `--*` custom properties) with no cast, while
|
|
41
|
-
// ui-core stays React-free.
|
|
42
|
-
const vars = {
|
|
27
|
+
return {
|
|
43
28
|
"--ch-bg": surface.background,
|
|
44
29
|
"--ch-fg": surface.foreground,
|
|
45
30
|
"--ch-border": surface.border,
|
|
31
|
+
...toCssVars(resolveThemeTokens("default", mode)),
|
|
46
32
|
};
|
|
47
|
-
for (const [role, value] of Object.entries(palette)) {
|
|
48
|
-
if (value !== undefined)
|
|
49
|
-
vars[`--ch-${kebab(role)}`] = value;
|
|
50
|
-
}
|
|
51
|
-
return vars;
|
|
52
33
|
}
|
|
53
34
|
//# sourceMappingURL=web-theme.js.map
|
package/dist/web-theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-theme.js","sourceRoot":"","sources":["../src/web-theme.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"web-theme.js","sourceRoot":"","sources":["../src/web-theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAajE;oFACoF;AACpF,MAAM,CAAC,MAAM,WAAW,GAAgC;IACtD,IAAI,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE;IACzE,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE;CAC3E,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAa;IACxC,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO;QACL,SAAS,EAAE,OAAO,CAAC,UAAU;QAC7B,SAAS,EAAE,OAAO,CAAC,UAAU;QAC7B,aAAa,EAAE,OAAO,CAAC,MAAM;QAC7B,GAAG,SAAS,CAAC,kBAAkB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;KAClD,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chances-ai/ui-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@chances-ai/
|
|
18
|
-
"@chances-ai/
|
|
17
|
+
"@chances-ai/engine": "24.1.0",
|
|
18
|
+
"@chances-ai/runtime": "24.1.0",
|
|
19
19
|
"diff": "^9.0.0",
|
|
20
20
|
"highlight.js": "^11.11.1",
|
|
21
21
|
"marked": "^18.0.0"
|