@innovatorved/code-lab 0.6.0 → 0.6.1

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.
Files changed (51) hide show
  1. package/ARCHITECTURE.md +1 -1
  2. package/CHANGELOG.md +8 -0
  3. package/README.md +1 -1
  4. package/dist/code-lab-sql.css +87 -64
  5. package/dist/code-lab-sql.esm.js +109 -86
  6. package/dist/code-lab-sql.umd.js +110 -87
  7. package/dist/code-lab.css +1 -1
  8. package/dist/code-lab.d.ts +1 -1
  9. package/dist/code-lab.esm.js +601 -248
  10. package/dist/code-lab.js +600 -247
  11. package/dist/code-lab.umd.js +600 -247
  12. package/dist/index.d.ts +1 -1
  13. package/dist/packages/sql/src/styles.d.ts +1 -1
  14. package/dist/packages/ui/src/settings-dialog.d.ts +2 -0
  15. package/dist/preview-sw.js +1 -1
  16. package/dist/runtime.esm.js +1 -1
  17. package/dist/runtime.js +1 -1
  18. package/dist/schemas.d.ts +1 -1
  19. package/dist/shell.esm.js +1 -1
  20. package/dist/shell.js +1 -1
  21. package/dist/terminal.esm.js +1 -1
  22. package/dist/terminal.js +1 -1
  23. package/dist/workbench/index.d.ts +1 -1
  24. package/dist/workbench/intellisense.d.ts +1 -1
  25. package/dist/workbench/styles.d.ts +1 -1
  26. package/package.json +1 -1
  27. package/packages/commands/package.json +1 -1
  28. package/packages/core/package.json +1 -1
  29. package/packages/editor/package.json +1 -1
  30. package/packages/fs/package.json +1 -1
  31. package/packages/preview/package.json +1 -1
  32. package/packages/runtime/package.json +1 -1
  33. package/packages/settings/package.json +1 -1
  34. package/packages/sql/package.json +1 -1
  35. package/packages/sql/src/styles.ts +87 -64
  36. package/packages/terminal/package.json +1 -1
  37. package/packages/ui/package.json +1 -1
  38. package/packages/ui/src/observability.ts +12 -14
  39. package/packages/ui/src/settings-dialog.ts +379 -55
  40. package/packages/ui/src/themes.ts +78 -78
  41. package/src/code-lab.css +750 -309
  42. package/src/index.ts +1 -1
  43. package/src/schemas.ts +1 -1
  44. package/src/workbench/diff-editor.ts +5 -1
  45. package/src/workbench/drawer.ts +5 -5
  46. package/src/workbench/icons.ts +5 -5
  47. package/src/workbench/intellisense.ts +94 -82
  48. package/src/workbench/styles.ts +58 -54
  49. package/src/workbench/toolbar.ts +1 -1
  50. package/src/workbench/xterm-adapter.ts +61 -56
  51. package/src/workbench.ts +98 -92
@@ -112,27 +112,27 @@ function sanitizeLogType(type?: string): string {
112
112
  export function getXtermTheme(mode: string = 'dark'): ITheme {
113
113
  if (mode === 'light') {
114
114
  return {
115
- background: '#f8f8f8',
116
- foreground: '#3b3b3b',
117
- cursor: '#3b3b3b',
118
- cursorAccent: '#f8f8f8',
119
- selectionBackground: 'rgba(0, 95, 184, 0.24)',
120
- black: '#000000',
121
- red: '#cd3131',
122
- green: '#008000',
123
- yellow: '#795e26',
124
- blue: '#0451a5',
125
- magenta: '#bc05bc',
126
- cyan: '#0598bc',
127
- white: '#555555',
128
- brightBlack: '#666666',
129
- brightRed: '#cd3131',
130
- brightGreen: '#14ce14',
131
- brightYellow: '#b5ba00',
132
- brightBlue: '#0451a5',
133
- brightMagenta: '#bc05bc',
134
- brightCyan: '#0598bc',
135
- brightWhite: '#3b3b3b'
115
+ background: '#ffffff',
116
+ foreground: '#18181b',
117
+ cursor: '#18181b',
118
+ cursorAccent: '#ffffff',
119
+ selectionBackground: 'rgba(24, 24, 27, 0.14)',
120
+ black: '#18181b',
121
+ red: '#b42318',
122
+ green: '#067647',
123
+ yellow: '#b54708',
124
+ blue: '#1d4ed8',
125
+ magenta: '#6d28d9',
126
+ cyan: '#0f766e',
127
+ white: '#52525b',
128
+ brightBlack: '#6e6a64',
129
+ brightRed: '#dc2626',
130
+ brightGreen: '#059669',
131
+ brightYellow: '#d97706',
132
+ brightBlue: '#2563eb',
133
+ brightMagenta: '#7c3aed',
134
+ brightCyan: '#0d9488',
135
+ brightWhite: '#09090b'
136
136
  };
137
137
  }
138
138
  if (mode === 'hc' || mode === 'high-contrast') {
@@ -143,44 +143,44 @@ export function getXtermTheme(mode: string = 'dark'): ITheme {
143
143
  cursorAccent: '#000000',
144
144
  selectionBackground: 'rgba(255, 255, 255, 0.35)',
145
145
  black: '#000000',
146
- red: '#f48771',
147
- green: '#89d185',
148
- yellow: '#ffd370',
149
- blue: '#75beff',
150
- magenta: '#b180d7',
151
- cyan: '#4ec9b0',
146
+ red: '#f87171',
147
+ green: '#34d399',
148
+ yellow: '#fbbf24',
149
+ blue: '#93c5fd',
150
+ magenta: '#c084fc',
151
+ cyan: '#2dd4bf',
152
152
  white: '#ffffff',
153
- brightBlack: '#808080',
154
- brightRed: '#f48771',
155
- brightGreen: '#89d185',
156
- brightYellow: '#ffd370',
157
- brightBlue: '#75beff',
158
- brightMagenta: '#b180d7',
159
- brightCyan: '#4ec9b0',
153
+ brightBlack: '#a1a1aa',
154
+ brightRed: '#f87171',
155
+ brightGreen: '#34d399',
156
+ brightYellow: '#fbbf24',
157
+ brightBlue: '#93c5fd',
158
+ brightMagenta: '#c084fc',
159
+ brightCyan: '#2dd4bf',
160
160
  brightWhite: '#ffffff'
161
161
  };
162
162
  }
163
163
  return {
164
- background: '#181818',
165
- foreground: '#cccccc',
166
- cursor: '#cccccc',
167
- cursorAccent: '#181818',
168
- selectionBackground: 'rgba(38, 79, 120, 0.55)',
169
- black: '#000000',
170
- red: '#cd3131',
171
- green: '#0dbc79',
172
- yellow: '#e5e510',
173
- blue: '#2472c8',
174
- magenta: '#bc3fbc',
175
- cyan: '#11a8cd',
176
- white: '#e5e5e5',
177
- brightBlack: '#666666',
178
- brightRed: '#f14c4c',
179
- brightGreen: '#23d18b',
180
- brightYellow: '#f5f543',
181
- brightBlue: '#3b8eea',
182
- brightMagenta: '#d670d6',
183
- brightCyan: '#29b8db',
164
+ background: '#0f0f10',
165
+ foreground: '#f4f4f5',
166
+ cursor: '#f4f4f5',
167
+ cursorAccent: '#0f0f10',
168
+ selectionBackground: 'rgba(244, 244, 245, 0.22)',
169
+ black: '#18181a',
170
+ red: '#f87171',
171
+ green: '#34d399',
172
+ yellow: '#fbbf24',
173
+ blue: '#93c5fd',
174
+ magenta: '#c084fc',
175
+ cyan: '#2dd4bf',
176
+ white: '#d4d4d8',
177
+ brightBlack: '#8e8e97',
178
+ brightRed: '#fca5a5',
179
+ brightGreen: '#6ee7b7',
180
+ brightYellow: '#fde047',
181
+ brightBlue: '#bfdbfe',
182
+ brightMagenta: '#d8b4fe',
183
+ brightCyan: '#5eead4',
184
184
  brightWhite: '#ffffff'
185
185
  };
186
186
  }
@@ -310,7 +310,7 @@ export class XtermTerminalEngine {
310
310
  : rawCwd.startsWith('/home/codelab/')
311
311
  ? '~' + rawCwd.slice('/home/codelab'.length)
312
312
  : rawCwd;
313
- return `\x1b[1;32mcodelab\x1b[0m:\x1b[1;34m${displayCwd}\x1b[0m$ `;
313
+ return `\x1b[1;32mcodelab\x1b[0m:\x1b[1m${displayCwd}\x1b[0m$ `;
314
314
  }
315
315
 
316
316
  public setPrompt(p: string | null): void {
@@ -717,10 +717,15 @@ export class XtermTerminalEngine {
717
717
  if (xtermMount && canUseXtermInEnvironment(xtermMount)) {
718
718
  const { Terminal: XtermTerminal, FitAddon: XtermFitAddon, WebLinksAddon: XtermWebLinksAddon } =
719
719
  getXtermRuntimeClasses();
720
+ const computedMono =
721
+ typeof window !== 'undefined' && typeof window.getComputedStyle === 'function'
722
+ ? window.getComputedStyle(xtermMount).getPropertyValue('--cl-font-mono').trim()
723
+ : '';
720
724
  const term = new XtermTerminal({
721
725
  fontFamily:
722
726
  this.options.fontFamily ||
723
- "'JetBrains Mono', 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace",
727
+ computedMono ||
728
+ '"Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace',
724
729
  fontSize: this.options.fontSize || 13,
725
730
  lineHeight: 1.35,
726
731
  cursorBlink: true,
package/src/workbench.ts CHANGED
@@ -83,7 +83,7 @@
83
83
 
84
84
  // The bundler rewrites this literal from package.json at build time. Keeping
85
85
  // the fallback in sync lets tests require src/workbench.js directly.
86
- const CODELAB_VERSION = '0.6.0';
86
+ const CODELAB_VERSION = '0.6.1';
87
87
 
88
88
  // Ambient TypeScript declarations for Node.js built-ins inside Monaco
89
89
  const NODE_AMBIENT_DTS = `
@@ -1019,36 +1019,37 @@ declare module 'bun:sqlite' {
1019
1019
  reject(new Error('Monaco failed to initialize'));
1020
1020
  return;
1021
1021
  }
1022
- // Define custom themes synced with Ved Gupta Monochrome Neutral Design System (Geist)
1022
+ // Define custom themes synced with Ved Gupta Monochrome Charcoal Ink & Warm Paper Design System (Geist)
1023
1023
  m.editor.defineTheme('codelab-dark', {
1024
1024
  base: 'vs-dark',
1025
1025
  inherit: true,
1026
1026
  rules: [
1027
- { token: 'comment', foreground: '666666', fontStyle: 'italic' },
1028
- { token: 'keyword', foreground: 'ff7b72' },
1029
- { token: 'string', foreground: 'a5d6ff' },
1030
- { token: 'number', foreground: '79c0ff' },
1031
- { token: 'type', foreground: 'ffa657' }
1027
+ { token: 'comment', foreground: '8e8e97', fontStyle: 'italic' },
1028
+ { token: 'keyword', foreground: 'f87171' },
1029
+ { token: 'string', foreground: '86efac' },
1030
+ { token: 'number', foreground: 'fcd34d' },
1031
+ { token: 'type', foreground: 'fb923c' },
1032
+ { token: 'function', foreground: 'c084fc' }
1032
1033
  ],
1033
1034
  colors: {
1034
- 'editor.background': '#000000',
1035
- 'editor.foreground': '#f2f2f2',
1036
- 'editorGutter.background': '#000000',
1037
- 'editorLineNumber.foreground': '#525252',
1038
- 'editorLineNumber.activeForeground': '#ffffff',
1039
- 'editor.lineHighlightBackground': '#0a0a0a',
1040
- 'editor.lineHighlightBorder': '#171717',
1041
- 'editor.selectionBackground': '#262626',
1042
- 'editor.inactiveSelectionBackground': '#171717',
1043
- 'editorCursor.foreground': '#ffffff',
1044
- 'editorIndentGuide.background1': '#171717',
1045
- 'editorIndentGuide.activeBackground1': '#262626',
1046
- 'editorWidget.background': '#0a0a0a',
1047
- 'editorWidget.border': '#262626',
1048
- 'editorHoverWidget.background': '#0a0a0a',
1049
- 'editorHoverWidget.border': '#262626',
1050
- 'scrollbarSlider.background': '#26262680',
1051
- 'scrollbarSlider.hoverBackground': '#404040aa'
1035
+ 'editor.background': '#0f0f10',
1036
+ 'editor.foreground': '#f4f4f5',
1037
+ 'editorGutter.background': '#0f0f10',
1038
+ 'editorLineNumber.foreground': '#6e6e77',
1039
+ 'editorLineNumber.activeForeground': '#f4f4f5',
1040
+ 'editor.lineHighlightBackground': '#18181a99',
1041
+ 'editor.lineHighlightBorder': '#00000000',
1042
+ 'editor.selectionBackground': '#28282b',
1043
+ 'editor.inactiveSelectionBackground': '#1f1f22',
1044
+ 'editorCursor.foreground': '#f4f4f5',
1045
+ 'editorIndentGuide.background1': '#27272a80',
1046
+ 'editorIndentGuide.activeBackground1': '#3a3a3e',
1047
+ 'editorWidget.background': '#18181a',
1048
+ 'editorWidget.border': '#27272a',
1049
+ 'editorHoverWidget.background': '#18181a',
1050
+ 'editorHoverWidget.border': '#27272a',
1051
+ 'scrollbarSlider.background': '#3a3a3e66',
1052
+ 'scrollbarSlider.hoverBackground': '#52525b99'
1052
1053
  }
1053
1054
  });
1054
1055
 
@@ -1056,25 +1057,30 @@ declare module 'bun:sqlite' {
1056
1057
  base: 'vs',
1057
1058
  inherit: true,
1058
1059
  rules: [
1059
- { token: 'comment', foreground: '666666', fontStyle: 'italic' }
1060
+ { token: 'comment', foreground: '6e6a64', fontStyle: 'italic' },
1061
+ { token: 'keyword', foreground: 'c2410c' },
1062
+ { token: 'string', foreground: '067647' },
1063
+ { token: 'number', foreground: 'b54708' },
1064
+ { token: 'type', foreground: '9a3412' },
1065
+ { token: 'function', foreground: '6d28d9' }
1060
1066
  ],
1061
1067
  colors: {
1062
1068
  'editor.background': '#ffffff',
1063
- 'editor.foreground': '#0a0a0a',
1069
+ 'editor.foreground': '#18181b',
1064
1070
  'editorGutter.background': '#ffffff',
1065
- 'editorLineNumber.foreground': '#8f8f8f',
1066
- 'editorLineNumber.activeForeground': '#0a0a0a',
1067
- 'editor.lineHighlightBackground': '#fafafa',
1068
- 'editor.lineHighlightBorder': '#f5f5f5',
1069
- 'editor.selectionBackground': '#e5e5e5',
1070
- 'editor.inactiveSelectionBackground': '#f5f5f5',
1071
- 'editorCursor.foreground': '#000000',
1072
- 'editorIndentGuide.background1': '#f0f0f0',
1073
- 'editorIndentGuide.activeBackground1': '#d4d4d4',
1074
- 'editorWidget.background': '#fafafa',
1075
- 'editorWidget.border': '#e5e5e5',
1076
- 'editorHoverWidget.background': '#fafafa',
1077
- 'editorHoverWidget.border': '#e5e5e5'
1071
+ 'editorLineNumber.foreground': '#8a8680',
1072
+ 'editorLineNumber.activeForeground': '#18181b',
1073
+ 'editor.lineHighlightBackground': '#f7f7f5',
1074
+ 'editor.lineHighlightBorder': '#00000000',
1075
+ 'editor.selectionBackground': '#e6e4df',
1076
+ 'editor.inactiveSelectionBackground': '#f1f1ee',
1077
+ 'editorCursor.foreground': '#18181b',
1078
+ 'editorIndentGuide.background1': '#e6e4df',
1079
+ 'editorIndentGuide.activeBackground1': '#d3d0c9',
1080
+ 'editorWidget.background': '#f7f7f5',
1081
+ 'editorWidget.border': '#e6e4df',
1082
+ 'editorHoverWidget.background': '#f7f7f5',
1083
+ 'editorHoverWidget.border': '#e6e4df'
1078
1084
  }
1079
1085
  });
1080
1086
 
@@ -5288,7 +5294,7 @@ int main() {
5288
5294
  </div>
5289
5295
  ` : `
5290
5296
  <div class="codelab-guide__footer-row">
5291
- <span style="font-size:11.5px;color:var(--cl-fg-muted);">100% In-Browser Web Worker Sandbox</span>
5297
+ <span class="cl-ui-muted-note">100% In-Browser Web Worker Sandbox</span>
5292
5298
  </div>
5293
5299
  `}
5294
5300
  `;
@@ -6073,7 +6079,7 @@ int main() {
6073
6079
  <button type="button" class="codelab-pkg-btn" data-cl-action="open-packages" title="Manage Dependencies &amp; Built-ins">
6074
6080
  ${CL_ICONS.package}
6075
6081
  <span>Packages</span>
6076
- <span class="codelab-drawer__pill" style="padding:0 5px;font-size:10px;">${pkgBadge}</span>
6082
+ <span class="codelab-drawer__pill">${pkgBadge}</span>
6077
6083
  </button>
6078
6084
  `;
6079
6085
 
@@ -6981,12 +6987,12 @@ int main() {
6981
6987
 
6982
6988
  if (this.drawerTab === 'stdin') {
6983
6989
  bodyEl.innerHTML = `
6984
- <div class="codelab-stdin-panel" style="padding:10px;height:100%;display:flex;flex-direction:column;box-sizing:border-box;">
6985
- <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;font-size:12px;color:var(--cl-fg-muted);">
6990
+ <div class="codelab-stdin-panel">
6991
+ <div class="codelab-stdin-panel__header">
6986
6992
  <span>Standard Input (std::cin / sys.stdin / process.stdin)</span>
6987
- <button type="button" class="codelab-btn codelab-btn--sm" id="cl-stdin-clear-btn" style="padding:2px 8px;font-size:11px;">Clear</button>
6993
+ <button type="button" class="codelab-btn codelab-btn--sm" id="cl-stdin-clear-btn">Clear</button>
6988
6994
  </div>
6989
- <textarea id="cl-stdin-textarea" class="codelab-stdin-textarea" style="flex:1;width:100%;background:var(--cl-bg-input, #1e1e1e);color:var(--cl-fg, #d4d4d4);border:1px solid var(--cl-border, #333);border-radius:4px;padding:8px;font-family:var(--cl-font-mono, monospace);font-size:12px;resize:none;outline:none;box-sizing:border-box;" placeholder="Enter or paste custom stdin here (used by std::cin, sys.stdin, fs.readFileSync(0))...">${escapeHtml(this.customStdin || '')}</textarea>
6995
+ <textarea id="cl-stdin-textarea" class="codelab-stdin-textarea codelab-stdin-panel__textarea" placeholder="Enter or paste custom stdin here (used by std::cin, sys.stdin, fs.readFileSync(0))...">${escapeHtml(this.customStdin || '')}</textarea>
6990
6996
  </div>
6991
6997
  `;
6992
6998
  const ta = bodyEl.querySelector('#cl-stdin-textarea');
@@ -7022,9 +7028,9 @@ int main() {
7022
7028
  <div class="codelab-test-summary ${passed === total ? 'all-pass' : 'has-fail'}">
7023
7029
  <div>
7024
7030
  <strong>${passed === total ? `All ${total} Tests Passing` : `${passed} of ${total} Tests Passing`}</strong>
7025
- ${this.steps.length ? `<span style="margin-left:8px;font-size:12px;opacity:0.8;">(${this.completedSteps.size}/${this.steps.length} Guided Steps Complete)</span>` : ''}
7031
+ ${this.steps.length ? `<span class="cl-ui-meta-inline">(${this.completedSteps.size}/${this.steps.length} Guided Steps Complete)</span>` : ''}
7026
7032
  </div>
7027
- <span style="font-family:var(--cl-font-mono);font-size:12px;">${totalMs} ms</span>
7033
+ <span class="cl-ui-metric">${totalMs} ms</span>
7028
7034
  </div>
7029
7035
  <div class="codelab-test-list">
7030
7036
  ${this.lastTestResults.map(t => `
@@ -7059,7 +7065,7 @@ int main() {
7059
7065
  const html = ansiToHtml ? ansiToHtml(item.text || '') : escapeHtml(item.text || '');
7060
7066
  return `<div class="codelab-log-line ${escapeHtml(item.type || '')}">${html}</div>`;
7061
7067
  }).join('')
7062
- : `<div style="color:var(--cl-fg-muted);font-size:12px;">No output messages yet. Run your code or workspace tasks to inspect output logs.</div>`;
7068
+ : `<div class="cl-ui-muted-note">No output messages yet. Run your code or workspace tasks to inspect output logs.</div>`;
7063
7069
  bodyEl.innerHTML = `<div class="codelab-output-panel" id="cl-output-surface" style="font-size:${termFontPx}px;line-height:1.5;">${linesHtml}</div>`;
7064
7070
  bodyEl.scrollTop = bodyEl.scrollHeight;
7065
7071
  return;
@@ -7250,7 +7256,7 @@ int main() {
7250
7256
  <span style="display:inline-flex;align-items:center;gap:6px;">${CL_ICONS.database}<span>Virtual POSIX File System (${tmpFiles.length} files)</span></span>
7251
7257
  <span>In-Memory VFS</span>
7252
7258
  </div>
7253
- ${tmpFiles.length === 0 ? `<div style="color:var(--cl-fg-muted);font-size:12px;">Run Demo or Tests to inspect virtual files (e.g. /tmp WAL segments &amp; SSTables).</div>` : ''}
7259
+ ${tmpFiles.length === 0 ? `<div class="cl-ui-muted-note">Run Demo or Tests to inspect virtual files (e.g. /tmp WAL segments &amp; SSTables).</div>` : ''}
7254
7260
  ${tmpFiles.map(f => `
7255
7261
  <div class="codelab-vfs-item">
7256
7262
  <div class="codelab-vfs-item__head">
@@ -7268,7 +7274,7 @@ int main() {
7268
7274
  <span style="display:inline-flex;align-items:center;gap:6px;">${CL_ICONS.globe}<span>Virtual Loopback HTTP Trace (${this.lastHttpTrace.length} requests)</span></span>
7269
7275
  <span>127.0.0.1</span>
7270
7276
  </div>
7271
- ${this.lastHttpTrace.length === 0 ? `<div style="color:var(--cl-fg-muted);font-size:12px;">Virtual HTTP loopback requests (e.g., Layer-7 Load Balancer traffic &amp; active health probes) appear here.</div>` : ''}
7277
+ ${this.lastHttpTrace.length === 0 ? `<div class="cl-ui-muted-note">Virtual HTTP loopback requests (e.g., Layer-7 Load Balancer traffic &amp; active health probes) appear here.</div>` : ''}
7272
7278
  ${this.lastHttpTrace.map(req => `
7273
7279
  <div class="codelab-vfs-item">
7274
7280
  <div class="codelab-vfs-item__head">
@@ -7299,13 +7305,13 @@ int main() {
7299
7305
  ? `<div class="codelab-test-summary ${res.verification.passed ? 'all-pass' : 'has-fail'}" style="margin-bottom:10px;">
7300
7306
  <div>
7301
7307
  <strong>${res.verification.passed ? '✓ Step Verification Passed' : '✖ Step Verification Failed'}</strong>
7302
- ${res.verification.message ? `<span style="margin-left:8px;font-size:12px;">${escapeHtml(res.verification.message)}</span>` : ''}
7308
+ ${res.verification.message ? `<span class="cl-ui-meta-inline">${escapeHtml(res.verification.message)}</span>` : ''}
7303
7309
  </div>
7304
- <span style="font-family:var(--cl-font-mono);font-size:12px;">${typeof res.durationMs === 'number' ? `${res.durationMs.toFixed(1)} ms` : ''}</span>
7310
+ <span class="cl-ui-metric">${typeof res.durationMs === 'number' ? `${res.durationMs.toFixed(1)} ms` : ''}</span>
7305
7311
  </div>`
7306
7312
  : '';
7307
7313
  const errHtml = res.error
7308
- ? `<div role="alert" style="padding:10px 12px;margin-bottom:10px;border-radius:6px;border:1px solid rgba(239,68,68,0.45);background:rgba(239,68,68,0.12);color:var(--cl-red,#f87171);font-family:var(--cl-font-mono);font-size:12px;white-space:pre-wrap;">${escapeHtml(typeof res.error === 'string' ? res.error : (res.error.message || String(res.error)))}</div>`
7314
+ ? `<div role="alert" class="cl-ui-alert-error">${escapeHtml(typeof res.error === 'string' ? res.error : (res.error.message || String(res.error)))}</div>`
7309
7315
  : '';
7310
7316
  const cols = Array.isArray(res.columns) ? res.columns : [];
7311
7317
  const rows = Array.isArray(res.rows) ? res.rows : [];
@@ -7339,12 +7345,12 @@ int main() {
7339
7345
  </table>
7340
7346
  </div>`
7341
7347
  : (!res.error
7342
- ? `<div style="color:var(--cl-fg-muted);font-size:12px;padding:8px 2px;">Statement executed (${escapeHtml(rowSummary)}).</div>`
7348
+ ? `<div class="cl-ui-muted-note" style="padding:8px 2px;">Statement executed (${escapeHtml(rowSummary)}).</div>`
7343
7349
  : '');
7344
7350
  const planHtml = res.plan
7345
7351
  ? `<div style="margin-top:10px;">
7346
- <div style="font-size:11px;font-weight:600;color:var(--cl-fg-muted);margin-bottom:4px;text-transform:uppercase;letter-spacing:0.05em;">Query Execution Plan</div>
7347
- <pre style="margin:0;padding:10px;border-radius:6px;border:1px solid var(--cl-border,#262626);background:var(--cl-bg,#0a0a0a);color:var(--cl-fg,#f5f5f5);font-family:var(--cl-font-mono);font-size:11.5px;overflow:auto;">${escapeHtml(typeof res.plan === 'string' ? res.plan : JSON.stringify(res.plan, null, 2))}</pre>
7352
+ <div class="cl-ui-section-label">Query Execution Plan</div>
7353
+ <pre class="cl-ui-code-box">${escapeHtml(typeof res.plan === 'string' ? res.plan : JSON.stringify(res.plan, null, 2))}</pre>
7348
7354
  </div>`
7349
7355
  : '';
7350
7356
  bodyEl.innerHTML = `<div style="padding:10px;">${verificationHtml}${errHtml}${tableHtml}${planHtml}</div>`;
@@ -7363,7 +7369,7 @@ int main() {
7363
7369
  workerStatus: this.runtimeStatusText || 'Idle'
7364
7370
  });
7365
7371
  } else {
7366
- bodyEl.innerHTML = `<div style="padding:14px;color:var(--cl-fg-muted);font-size:12px;">Observability kernel is not initialized.</div>`;
7372
+ bodyEl.innerHTML = `<div class="cl-ui-muted-note" style="padding:14px;">Observability kernel is not initialized.</div>`;
7367
7373
  }
7368
7374
  return;
7369
7375
  }
@@ -8142,8 +8148,8 @@ int main() {
8142
8148
  if (servers.length === 0) {
8143
8149
  serversHtml = `
8144
8150
  <div class="codelab-ports-empty">
8145
- <p style="margin:0 0 6px 0;font-weight:500;">No active port listeners</p>
8146
- <span style="font-size:12px;color:var(--cl-fg-muted);">
8151
+ <p class="cl-ui-body-p">No active port listeners</p>
8152
+ <span class="cl-ui-muted-note">
8147
8153
  Run an HTTP or WebSocket server in the terminal (e.g. <code>node server.js &amp;</code> or <code>bun run server.ts &amp;</code>) to bind a virtual port.
8148
8154
  </span>
8149
8155
  </div>
@@ -8266,7 +8272,7 @@ int main() {
8266
8272
  <div class="codelab-panel-section">
8267
8273
  <div class="codelab-section-title">
8268
8274
  <span>${CL_ICONS.send || ''} Mini HTTP Client</span>
8269
- <span style="font-size:11px;color:var(--cl-fg-muted);">Virtual Loopback (127.0.0.1)</span>
8275
+ <span class="cl-ui-muted-xs">Virtual Loopback (127.0.0.1)</span>
8270
8276
  </div>
8271
8277
  <div class="codelab-http-client">
8272
8278
  <div class="codelab-http-url-bar">
@@ -8415,7 +8421,7 @@ int main() {
8415
8421
 
8416
8422
  topologyHtml = `
8417
8423
  <div class="codelab-topo-bar">
8418
- <div class="codelab-topo-nodes">${nodePills || '<span style="font-size:11px;color:var(--cl-fg-muted);">No listening servers</span>'}</div>
8424
+ <div class="codelab-topo-nodes">${nodePills || '<span class="cl-ui-muted-xs">No listening servers</span>'}</div>
8419
8425
  ${edgePills ? `<div class="codelab-topo-edges">${edgePills}</div>` : ''}
8420
8426
  </div>
8421
8427
  `;
@@ -8467,8 +8473,8 @@ int main() {
8467
8473
  <td><span class="codelab-method-badge codelab-method-${(t.method || 'GET').toLowerCase()}">${escapeHtml(t.method || 'GET')}</span></td>
8468
8474
  <td class="codelab-net-path" title="${escapeHtml(t.url || '/')}">${escapeHtml(t.url || '/')}</td>
8469
8475
  <td><code>${escapeHtml(hopLabel)}</code></td>
8470
- <td style="white-space:nowrap;font-family:var(--cl-font-mono);font-size:11.5px;">${(t.durationMs || 0).toFixed(1)} ms</td>
8471
- <td style="white-space:nowrap;font-family:var(--cl-font-mono);font-size:11.5px;">${t.size != null ? t.size : 0} B</td>
8476
+ <td class="cl-ui-metric-cell">${(t.durationMs || 0).toFixed(1)} ms</td>
8477
+ <td class="cl-ui-metric-cell">${t.size != null ? t.size : 0} B</td>
8472
8478
  <td class="codelab-waterfall-cell">
8473
8479
  <div class="codelab-waterfall-track">
8474
8480
  <div class="codelab-waterfall-bar" style="width:${widthPct}%;"></div>
@@ -8583,7 +8589,7 @@ int main() {
8583
8589
  <option value="5xx" ${filter.status === '5xx' ? 'selected' : ''}>5xx / Network Fault</option>
8584
8590
  </select>
8585
8591
  <button type="button" class="codelab-btn" data-cl-action="clear-net-traces">Clear</button>
8586
- <span id="cl-net-count" style="margin-left:auto;font-size:11.5px;color:var(--cl-fg-muted);">${filtered.length} of ${traces.length} requests</span>
8592
+ <span id="cl-net-count" class="cl-ui-net-count">${filtered.length} of ${traces.length} requests</span>
8587
8593
  </div>
8588
8594
  <div class="codelab-net-main">
8589
8595
  <div class="codelab-net-table-container">
@@ -8665,8 +8671,8 @@ int main() {
8665
8671
  <td><span class="codelab-method-badge codelab-method-${(t.method || 'GET').toLowerCase()}">${escapeHtml(t.method || 'GET')}</span></td>
8666
8672
  <td class="codelab-net-path" title="${escapeHtml(t.url || '/')}">${escapeHtml(t.url || '/')}</td>
8667
8673
  <td><code>${escapeHtml(hopLabel)}</code></td>
8668
- <td style="white-space:nowrap;font-family:var(--cl-font-mono);font-size:11.5px;">${(t.durationMs || 0).toFixed(1)} ms</td>
8669
- <td style="white-space:nowrap;font-family:var(--cl-font-mono);font-size:11.5px;">${t.size != null ? t.size : 0} B</td>
8674
+ <td class="cl-ui-metric-cell">${(t.durationMs || 0).toFixed(1)} ms</td>
8675
+ <td class="cl-ui-metric-cell">${t.size != null ? t.size : 0} B</td>
8670
8676
  <td class="codelab-waterfall-cell">
8671
8677
  <div class="codelab-waterfall-track">
8672
8678
  <div class="codelab-waterfall-bar" style="width:${widthPct}%;"></div>
@@ -14002,7 +14008,7 @@ int main() {
14002
14008
  type: 'symbol',
14003
14009
  id: `${activeTarget}:${sym.line}:${sym.name}`,
14004
14010
  label: `${sym.name} (${sym.kind})`,
14005
- labelHtml: `${escapeHtml(sym.name)} <span style="opacity:0.6;font-size:11px;">${escapeHtml(sym.kind)} · Ln ${sym.line}</span>`,
14011
+ labelHtml: `${escapeHtml(sym.name)} <span class="cl-ui-palette-sub">${escapeHtml(sym.kind)} · Ln ${sym.line}</span>`,
14006
14012
  shortcut: activeTarget || '',
14007
14013
  action: () => {
14008
14014
  if (activeTarget) {
@@ -14029,7 +14035,7 @@ int main() {
14029
14035
  type: 'symbol',
14030
14036
  id: `${file}:${sym.line}:${sym.name}`,
14031
14037
  label: `${sym.name} — ${file}`,
14032
- labelHtml: `${escapeHtml(sym.name)} <span style="opacity:0.6;font-size:11px;">${escapeHtml(file)}:${sym.line}</span>`,
14038
+ labelHtml: `${escapeHtml(sym.name)} <span class="cl-ui-palette-sub">${escapeHtml(file)}:${sym.line}</span>`,
14033
14039
  shortcut: sym.kind,
14034
14040
  action: () => {
14035
14041
  this.openFile(file);
@@ -15065,37 +15071,37 @@ int main() {
15065
15071
  <button type="button" class="codelab-btn" data-cl-action="close-modal">Close (Esc)</button>
15066
15072
  </div>
15067
15073
  </div>
15068
- <div class="codelab-modal__body" style="font-family:var(--cl-font-sans);">
15069
- <div style="display:flex;gap:8px;margin-bottom:16px;">
15070
- <input id="cl-pkg-input" type="text" placeholder="Add npm package (e.g. zod, lru-cache, nanoid@5.0.0)..." style="flex:1;height:32px;padding:0 10px;background:var(--cl-bg);border:1px solid var(--cl-border-strong);border-radius:var(--cl-radius-sm);color:var(--cl-fg);font-family:var(--cl-font-mono);font-size:12px;outline:none;" />
15074
+ <div class="codelab-modal__body">
15075
+ <div class="cl-ui-form-row">
15076
+ <input id="cl-pkg-input" class="cl-ui-input cl-ui-input--mono" type="text" placeholder="Add npm package (e.g. zod, lru-cache, nanoid@5.0.0)..." />
15071
15077
  <button type="button" class="codelab-btn codelab-btn--primary" data-cl-action="add-package">+ Add Dependency</button>
15072
15078
  </div>
15073
15079
  <div style="margin-bottom:16px;">
15074
- <div style="font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:var(--cl-fg-muted);margin-bottom:8px;">
15080
+ <div class="cl-ui-section-label">
15075
15081
  External NPM Packages (${pkgs.length})
15076
15082
  </div>
15077
15083
  ${pkgs.length === 0 ? `
15078
- <div style="padding:12px;border:1px solid var(--cl-border);border-radius:var(--cl-radius-sm);background:var(--cl-bg);color:var(--cl-fg-muted);font-size:12.5px;">
15084
+ <div class="cl-ui-card-note">
15079
15085
  No external npm packages imported yet. Any <code>import ... from 'pkg'</code> or <code>require('pkg')</code> in your code is automatically resolved via <strong>jsDelivr</strong> when you run or test.
15080
15086
  </div>
15081
15087
  ` : `
15082
- <div style="display:flex;flex-direction:column;gap:6px;">
15088
+ <div class="cl-ui-stack-xs">
15083
15089
  ${pkgs.map(p => `
15084
- <div style="display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border:1px solid var(--cl-border);border-radius:var(--cl-radius-sm);background:var(--cl-bg);font-family:var(--cl-font-mono);font-size:12px;">
15085
- <span style="color:var(--cl-fg);font-weight:600;">${escapeHtml(p.name)}</span>
15086
- <span style="color:var(--cl-accent);">${escapeHtml(p.version)} · jsDelivr</span>
15090
+ <div class="cl-ui-pkg-row">
15091
+ <span class="cl-ui-pkg-row__name">${escapeHtml(p.name)}</span>
15092
+ <span class="cl-ui-pkg-row__meta">${escapeHtml(p.version)} · jsDelivr</span>
15087
15093
  </div>
15088
15094
  `).join('')}
15089
15095
  </div>
15090
15096
  `}
15091
15097
  </div>
15092
15098
  <div>
15093
- <div style="font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:var(--cl-fg-muted);margin-bottom:8px;">
15099
+ <div class="cl-ui-section-label">
15094
15100
  Built-in Virtual Node.js Modules (Zero-Latency In-Memory VFS)
15095
15101
  </div>
15096
- <div style="display:flex;flex-wrap:wrap;gap:6px;">
15102
+ <div class="cl-ui-chip-wrap">
15097
15103
  ${builtins.map(b => `
15098
- <span style="padding:3px 8px;border:1px solid var(--cl-border);border-radius:4px;background:var(--cl-bg);font-family:var(--cl-font-mono);font-size:11px;color:var(--cl-fg-muted);">${b}</span>
15104
+ <span class="cl-ui-chip">${b}</span>
15099
15105
  `).join('')}
15100
15106
  </div>
15101
15107
  </div>
@@ -18226,7 +18232,7 @@ int main() {
18226
18232
  <button type="button" class="codelab-btn codelab-btn--icon" data-cl-action="close-modal" title="Close" aria-label="Close">&times;</button>
18227
18233
  </div>
18228
18234
  <div class="codelab-modal__body">
18229
- <p id="cl-discard-modal-desc" style="margin:0 0 14px;font-size:13px;line-height:1.5;">${escapeHtml(desc)}</p>
18235
+ <p id="cl-discard-modal-desc" class="cl-ui-modal-desc">${escapeHtml(desc)}</p>
18230
18236
  <div style="display:flex;justify-content:flex-end;gap:8px;">
18231
18237
  <button type="button" class="codelab-btn" id="cl-discard-cancel-btn" data-cl-action="close-modal">Cancel</button>
18232
18238
  <button type="button" class="codelab-btn codelab-btn--danger" id="cl-discard-confirm-btn">Discard Changes</button>
@@ -19758,12 +19764,12 @@ int main() {
19758
19764
  this._captureModalReturnFocus();
19759
19765
  const rowsHtml = list.length > 0
19760
19766
  ? list.map((ws) => `
19761
- <button type="button" class="codelab-recent-ws-item" data-cl-workspace="${escapeHtml(ws.labId)}" style="display:flex;width:100%;align-items:center;justify-content:space-between;padding:8px 10px;border:1px solid var(--cl-border);border-radius:var(--cl-radius-sm);background:var(--cl-surface);color:var(--cl-fg);cursor:pointer;text-align:left;">
19767
+ <button type="button" class="codelab-recent-ws-item" data-cl-workspace="${escapeHtml(ws.labId)}">
19762
19768
  <span>
19763
19769
  <strong>${escapeHtml(ws.title || ws.labId)}</strong>
19764
- ${ws.labId === this.labId ? '<span style="opacity:0.7;margin-left:6px;">(Current)</span>' : ''}
19770
+ ${ws.labId === this.labId ? '<span class="cl-ui-meta-inline">(Current)</span>' : ''}
19765
19771
  </span>
19766
- <code style="font-size:11px;opacity:0.75;">${escapeHtml(ws.labId)}</code>
19772
+ <code class="cl-ui-chip">${escapeHtml(ws.labId)}</code>
19767
19773
  </button>
19768
19774
  `).join('')
19769
19775
  : '<p style="margin:0;color:var(--cl-fg-muted);">No saved workspaces found yet.</p>';
@@ -20231,8 +20237,8 @@ int main() {
20231
20237
  <button type="button" class="codelab-btn" data-cl-action="close-modal">Close (Esc)</button>
20232
20238
  </div>
20233
20239
  <div class="codelab-modal__body">
20234
- <div style="display:grid;grid-template-columns:1fr auto;gap:6px 16px;font-size:12px;">
20235
- ${rows.map(([label, kbd]) => `<span>${escapeHtml(label)}</span><kbd style="font-family:var(--cl-font-mono);">${escapeHtml(kbd)}</kbd>`).join('')}
20240
+ <div class="cl-ui-shortcuts-grid">
20241
+ ${rows.map(([label, kbd]) => `<span>${escapeHtml(label)}</span><kbd class="cl-ui-kbd">${escapeHtml(kbd)}</kbd>`).join('')}
20236
20242
  </div>
20237
20243
  </div>
20238
20244
  </div>
@@ -20253,9 +20259,9 @@ int main() {
20253
20259
  <span>About CodeLab</span>
20254
20260
  <button type="button" class="codelab-btn" data-cl-action="close-modal">Close (Esc)</button>
20255
20261
  </div>
20256
- <div class="codelab-modal__body" style="font-size:13px;line-height:1.5;">
20257
- <p style="margin:0 0 8px;"><strong>@innovatorved/code-lab</strong> — Full-featured in-browser IDE &amp; runtime workbench.</p>
20258
- <p style="margin:0;color:var(--cl-fg-muted);font-size:12px;">Node.js v22 Worker · TypeScript 5.x · C++20 WASI · Python 3.12 WASI · SQLite / PostgreSQL · Git</p>
20262
+ <div class="codelab-modal__body">
20263
+ <p class="cl-ui-body-p"><strong>@innovatorved/code-lab</strong> — Full-featured in-browser IDE &amp; runtime workbench.</p>
20264
+ <p class="cl-ui-muted-note">Node.js v22 Worker · TypeScript 5.x · C++20 WASI · Python 3.12 WASI · SQLite / PostgreSQL · Git</p>
20259
20265
  </div>
20260
20266
  </div>
20261
20267
  </dialog>
@@ -20747,8 +20753,8 @@ int main() {
20747
20753
  <span id="cl-clone-modal-title" style="display:inline-flex;align-items:center;gap:6px;">${CL_ICONS.gitBranch || CL_ICONS.terminal || CL_ICONS.folder}<span>Clone Public GitHub Repository</span></span>
20748
20754
  <button type="button" class="codelab-btn" id="cl-clone-close-btn" data-cl-action="close-modal" aria-label="Close">✕</button>
20749
20755
  </div>
20750
- <div class="codelab-modal__body" style="font-family:var(--cl-font-sans);">
20751
- <p id="cl-clone-modal-desc" style="margin:0 0 12px;font-size:12.5px;color:var(--cl-fg-muted);line-height:1.45;">
20756
+ <div class="codelab-modal__body">
20757
+ <p id="cl-clone-modal-desc" class="cl-ui-modal-desc">
20752
20758
  Enter a public GitHub repository URL or <code>owner/repo</code> slug. Files are cloned transactionally into the Virtual Filesystem (VFS).
20753
20759
  </p>
20754
20760
  <form id="cl-clone-repo-form" class="codelab-clone-form" novalidate>