@maxhealth.tech/prefab 0.2.20 → 0.2.21

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/CHANGELOG.md CHANGED
@@ -2,11 +2,17 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## [Unreleased] — v0.2.20
5
+ ## [Unreleased] — v0.2.21
6
+
7
+ ### Host Theme Adaptation
8
+ - **Fixed**: `[data-theme]` blocks had static-only values, so Claude Desktop's host theme colors were ignored — UI looked plain/unstyled despite receiving host variables
9
+ - Restored 3-tier fallback chain (`MCP Apps → VS Code → static`) in all four theme blocks (`:root`, `@media dark`, `[data-theme="dark"]`, `[data-theme="light"]`)
10
+ - Standalone toggle still works: MCP/VS Code vars undefined → falls to static defaults
11
+
12
+ ## [0.2.20] — 2026-04-29
6
13
 
7
14
  ### Theme Toggle Fix
8
15
  - **Fixed**: dark/light toggle icon flipped but colours didn't change — `@media (prefers-color-scheme: dark) :root:not(...)` at specificity (0,2,0) beat `[data-theme]` at (0,1,0). Bumped to `:root[data-theme="dark/light"]` (0,2,0) so toggle wins by source order
9
- - `[data-theme]` blocks now use static values only (not host var fallback chains) — prevents both themes resolving to the same host variable
10
16
 
11
17
  ### VS Code Theme Sync
12
18
  - `syncVsCodeTheme()` — reads `data-vscode-theme-kind` from `document.body`, maps to `data-theme` on `:root` (`vscode-dark` / `vscode-high-contrast` → `dark`, else `light`)
package/dist/app.d.ts CHANGED
@@ -9,7 +9,7 @@ import type { ComponentJSON } from './core/component.js';
9
9
  import type { Action, ActionJSON } from './actions/types.js';
10
10
  import type { PipeFn } from './rx/pipes.js';
11
11
  /** Package version — injected by build script, updated at release time. */
12
- export declare const VERSION = "0.2.20";
12
+ export declare const VERSION = "0.2.21";
13
13
  export interface Theme {
14
14
  light?: Record<string, string>;
15
15
  dark?: Record<string, string>;
package/dist/app.js CHANGED
@@ -7,7 +7,7 @@
7
7
  import {} from './core/component.js';
8
8
  import { drainAutoState } from './rx/state-collector.js';
9
9
  /** Package version — injected by build script, updated at release time. */
10
- export const VERSION = '0.2.20';
10
+ export const VERSION = '0.2.21';
11
11
  export class PrefabApp {
12
12
  title;
13
13
  view;
package/dist/prefab.css CHANGED
@@ -113,80 +113,83 @@
113
113
 
114
114
  /* Explicit dark override via data-theme attribute.
115
115
  Specificity (0,2,0) via :root[...] to beat the @media dark :root:not(...) rule.
116
- Static values only host vars live in :root / @media dark.
117
- applyHostTheme() inline styles win over these when a host is present. */
116
+ Full fallback chain: MCP Apps VS Code static.
117
+ In hosted mode (Claude/VS Code): applyHostTheme() sets both data-theme AND
118
+ the inline MCP Apps vars, so the chain resolves to host values.
119
+ In standalone mode: MCP Apps / VS Code vars are undefined → static wins,
120
+ so the manual theme toggle produces correct colors. */
118
121
  :root[data-theme="dark"] {
119
- --background: #09090b;
120
- --foreground: #fafafa;
122
+ --background: var(--color-background-primary, var(--vscode-editor-background, #09090b));
123
+ --foreground: var(--color-text-primary, var(--vscode-editor-foreground, #fafafa));
121
124
 
122
- --card: #111113;
123
- --card-foreground: #fafafa;
125
+ --card: var(--color-background-secondary, var(--vscode-editorWidget-background, #111113));
126
+ --card-foreground: var(--color-text-primary, var(--vscode-editorWidget-foreground, #fafafa));
124
127
 
125
- --popover: #111113;
126
- --popover-foreground: #fafafa;
128
+ --popover: var(--color-background-secondary, var(--vscode-editorHoverWidget-background, #111113));
129
+ --popover-foreground: var(--color-text-primary, var(--vscode-editorHoverWidget-foreground, #fafafa));
127
130
 
128
- --primary: #60a5fa;
129
- --primary-foreground: #09090b;
131
+ --primary: var(--color-background-info, var(--vscode-button-background, #60a5fa));
132
+ --primary-foreground: var(--color-text-inverse, var(--vscode-button-foreground, #09090b));
130
133
 
131
- --secondary: #1f2937;
132
- --secondary-foreground: #f3f4f6;
134
+ --secondary: var(--color-background-tertiary, var(--vscode-button-secondaryBackground, #1f2937));
135
+ --secondary-foreground: var(--color-text-secondary, var(--vscode-button-secondaryForeground, #f3f4f6));
133
136
 
134
- --muted: #1f2937;
135
- --muted-foreground: #9ca3af;
137
+ --muted: var(--color-background-tertiary, var(--vscode-editorWidget-background, #1f2937));
138
+ --muted-foreground: var(--color-text-tertiary, var(--vscode-descriptionForeground, #9ca3af));
136
139
 
137
- --accent: #1e3a5f;
138
- --accent-foreground: #93c5fd;
140
+ --accent: var(--color-background-ghost, var(--vscode-list-hoverBackground, #1e3a5f));
141
+ --accent-foreground: var(--color-text-info, var(--vscode-list-hoverForeground, #93c5fd));
139
142
 
140
- --destructive: #f87171;
141
- --destructive-foreground: #09090b;
143
+ --destructive: var(--color-background-danger, var(--vscode-errorForeground, #f87171));
144
+ --destructive-foreground: var(--color-text-inverse, #09090b);
142
145
 
143
- --success: #4ade80;
144
- --success-foreground: #09090b;
146
+ --success: var(--color-background-success, #4ade80);
147
+ --success-foreground: var(--color-text-inverse, #09090b);
145
148
 
146
- --warning: #fbbf24;
147
- --warning-foreground: #09090b;
149
+ --warning: var(--color-background-warning, #fbbf24);
150
+ --warning-foreground: var(--color-text-inverse, #09090b);
148
151
 
149
- --border: #27272a;
150
- --input: #27272a;
151
- --ring: #60a5fa;
152
+ --border: var(--color-border-primary, var(--vscode-panel-border, #27272a));
153
+ --input: var(--color-border-secondary, var(--vscode-input-background, #27272a));
154
+ --ring: var(--color-ring-primary, var(--vscode-focusBorder, #60a5fa));
152
155
  }
153
156
 
154
157
  /* Explicit light override via data-theme attribute.
155
- Same specificity bump as dark block above. */
158
+ Same specificity + fallback strategy as the dark block above. */
156
159
  :root[data-theme="light"] {
157
- --background: #ffffff;
158
- --foreground: #09090b;
160
+ --background: var(--color-background-primary, var(--vscode-editor-background, #ffffff));
161
+ --foreground: var(--color-text-primary, var(--vscode-editor-foreground, #09090b));
159
162
 
160
- --card: #ffffff;
161
- --card-foreground: #09090b;
163
+ --card: var(--color-background-secondary, var(--vscode-editorWidget-background, #ffffff));
164
+ --card-foreground: var(--color-text-primary, var(--vscode-editorWidget-foreground, #09090b));
162
165
 
163
- --popover: #ffffff;
164
- --popover-foreground: #09090b;
166
+ --popover: var(--color-background-secondary, var(--vscode-editorHoverWidget-background, #ffffff));
167
+ --popover-foreground: var(--color-text-primary, var(--vscode-editorHoverWidget-foreground, #09090b));
165
168
 
166
- --primary: #3b82f6;
167
- --primary-foreground: #ffffff;
169
+ --primary: var(--color-background-info, var(--vscode-button-background, #3b82f6));
170
+ --primary-foreground: var(--color-text-inverse, var(--vscode-button-foreground, #ffffff));
168
171
 
169
- --secondary: #f3f4f6;
170
- --secondary-foreground: #1f2937;
172
+ --secondary: var(--color-background-tertiary, var(--vscode-button-secondaryBackground, #f3f4f6));
173
+ --secondary-foreground: var(--color-text-secondary, var(--vscode-button-secondaryForeground, #1f2937));
171
174
 
172
- --muted: #f3f4f6;
173
- --muted-foreground: #6b7280;
175
+ --muted: var(--color-background-tertiary, var(--vscode-editorWidget-background, #f3f4f6));
176
+ --muted-foreground: var(--color-text-tertiary, var(--vscode-descriptionForeground, #6b7280));
174
177
 
175
- --accent: #eff6ff;
176
- --accent-foreground: #1e40af;
178
+ --accent: var(--color-background-ghost, var(--vscode-list-hoverBackground, #eff6ff));
179
+ --accent-foreground: var(--color-text-info, var(--vscode-list-hoverForeground, #1e40af));
177
180
 
178
- --destructive: #ef4444;
179
- --destructive-foreground: #ffffff;
181
+ --destructive: var(--color-background-danger, var(--vscode-errorForeground, #ef4444));
182
+ --destructive-foreground: var(--color-text-inverse, #ffffff);
180
183
 
181
- --success: #22c55e;
182
- --success-foreground: #ffffff;
184
+ --success: var(--color-background-success, #22c55e);
185
+ --success-foreground: var(--color-text-inverse, #ffffff);
183
186
 
184
- --warning: #f59e0b;
185
- --warning-foreground: #ffffff;
187
+ --warning: var(--color-background-warning, #f59e0b);
188
+ --warning-foreground: var(--color-text-inverse, #ffffff);
186
189
 
187
- --border: #e5e7eb;
188
- --input: #e5e7eb;
189
- --ring: #3b82f6;
190
+ --border: var(--color-border-primary, var(--vscode-panel-border, #e5e7eb));
191
+ --input: var(--color-border-secondary, var(--vscode-input-background, #e5e7eb));
192
+ --ring: var(--color-ring-primary, var(--vscode-focusBorder, #3b82f6));
190
193
  }
191
194
 
192
195
  /* ═══════════════════════════════════════════════════════════════════════════
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxhealth.tech/prefab",
3
- "version": "0.2.20",
3
+ "version": "0.2.21",
4
4
  "description": "TypeScript declarative UI component library for MCP apps. Wire-compatible with Python prefab-ui.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",