@parallelworks/ui 0.50.0 → 0.51.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.
Files changed (46) hide show
  1. package/README.md +50 -5
  2. package/dist/ai/components/ModelSelector.js +1 -1
  3. package/dist/ai/components/agent/AgentMessageParts.js +3 -3
  4. package/dist/components/Callout.js +3 -7
  5. package/dist/components/CreateModal.js +1 -1
  6. package/dist/components/DescriptionList.d.ts +31 -17
  7. package/dist/components/DescriptionList.js +83 -31
  8. package/dist/components/Field.js +1 -1
  9. package/dist/components/MenuEntries.d.ts +39 -12
  10. package/dist/components/MenuEntries.js +24 -8
  11. package/dist/components/Meter.js +3 -3
  12. package/dist/components/PageHeader.js +1 -1
  13. package/dist/components/Provider.d.ts +2 -0
  14. package/dist/components/Provider.js +1 -0
  15. package/dist/components/RequiredMark.js +1 -1
  16. package/dist/components/RunStatusIcon.js +2 -2
  17. package/dist/components/StatusIcons.js +2 -2
  18. package/dist/components/ThemeEditor.js +6 -6
  19. package/dist/components/Toast.js +2 -2
  20. package/dist/components/buttonClasses.js +1 -1
  21. package/dist/components/tone.d.ts +5 -2
  22. package/dist/components/tone.js +15 -6
  23. package/dist/form/Wizard/WizardNavigation.js +1 -1
  24. package/dist/form/Wizard/WizardStepIndicator.js +1 -1
  25. package/dist/graph/DependencyGraph.js +1 -1
  26. package/dist/graph/GraphEditor.js +1 -1
  27. package/dist/graph/GraphEditorDialogs.js +1 -1
  28. package/dist/graph/ProblemsButton.js +2 -2
  29. package/dist/graph/ShortcutsButton.js +1 -1
  30. package/dist/graph/editorChrome.js +1 -1
  31. package/dist/graph/fieldProblems.js +1 -1
  32. package/dist/graph/stepWith.js +1 -1
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.js +2 -2
  35. package/dist/list/ActionToolbar.d.ts +2 -2
  36. package/dist/list/ActionToolbar.js +6 -3
  37. package/dist/list/ListPage.js +4 -2
  38. package/dist/list/ListViewControls.js +1 -1
  39. package/dist/list/rowMenu.d.ts +2 -2
  40. package/dist/logviewer/LogViewer.js +1 -1
  41. package/dist/styles/theme.css +24 -10
  42. package/dist/styles.css +1 -1
  43. package/dist/theme/derive.d.ts +1 -1
  44. package/dist/theme/derive.js +46 -21
  45. package/dist/theme/fit.js +10 -4
  46. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { type CodeStyle, type Scheme } from './model.js';
2
- export declare const THEME_TOKENS: readonly ['--theme-app-bg', '--theme-panel-bg', '--theme-panel-hover', '--theme-muted-panel-bg', '--theme-hover', '--theme-input-bg', '--theme-input-disabled-bg', '--theme-app', '--theme-muted-text-color', '--theme-placeholder', '--theme-link', '--theme-border', '--theme-border-strong', '--theme-accent', '--theme-accent-text', '--theme-accent-hover', '--theme-accent-subtle', '--theme-focus', '--theme-focus-ring', '--theme-success', '--theme-success-muted', '--theme-error', '--theme-error-muted', '--theme-warning', '--theme-warning-muted', '--theme-info', '--theme-info-muted', '--theme-favorite', '--theme-favorite-muted', '--theme-shadow-sm', '--theme-shadow', '--theme-shadow-lg', '--theme-shadow-xl', '--theme-sidebar-bg', '--theme-sidebar-text', '--theme-sidebar-hover', '--theme-sidebar-active-bg', '--theme-sidebar-active-text', '--theme-code-bg', '--theme-code-text', '--theme-code-comment', '--theme-code-keyword', '--theme-code-string', '--theme-code-number', '--theme-code-function', '--theme-code-type', '--theme-code-property', '--theme-ansi-black', '--theme-ansi-red', '--theme-ansi-green', '--theme-ansi-yellow', '--theme-ansi-blue', '--theme-ansi-magenta', '--theme-ansi-cyan', '--theme-ansi-white'];
2
+ export declare const THEME_TOKENS: readonly ['--theme-app-bg', '--theme-panel-bg', '--theme-panel-hover', '--theme-muted-panel-bg', '--theme-hover', '--theme-input-bg', '--theme-input-disabled-bg', '--theme-app', '--theme-muted-text-color', '--theme-placeholder', '--theme-link', '--theme-border', '--theme-border-strong', '--theme-accent', '--theme-accent-text', '--theme-accent-hover', '--theme-accent-subtle', '--theme-focus', '--theme-focus-ring', '--theme-success', '--theme-success-text', '--theme-success-solid', '--theme-success-muted', '--theme-error', '--theme-error-text', '--theme-error-solid', '--theme-error-muted', '--theme-warning', '--theme-warning-text', '--theme-warning-solid', '--theme-warning-muted', '--theme-info', '--theme-info-text', '--theme-info-solid', '--theme-info-muted', '--theme-favorite', '--theme-favorite-text', '--theme-favorite-solid', '--theme-favorite-muted', '--theme-shadow-sm', '--theme-shadow', '--theme-shadow-lg', '--theme-shadow-xl', '--theme-sidebar-bg', '--theme-sidebar-text', '--theme-sidebar-hover', '--theme-sidebar-active-bg', '--theme-sidebar-active-text', '--theme-code-bg', '--theme-code-text', '--theme-code-comment', '--theme-code-keyword', '--theme-code-string', '--theme-code-number', '--theme-code-function', '--theme-code-type', '--theme-code-property', '--theme-ansi-black', '--theme-ansi-red', '--theme-ansi-green', '--theme-ansi-yellow', '--theme-ansi-blue', '--theme-ansi-magenta', '--theme-ansi-cyan', '--theme-ansi-white'];
3
3
  export type ThemeToken = (typeof THEME_TOKENS)[number];
4
4
  export type ThemeVariables = Record<ThemeToken, string>;
5
5
  /** The tokens the sidebar owns. A host's chrome may supply its own fallbacks, so the stylesheet gives them no defaults. */
@@ -23,14 +23,24 @@ var THEME_TOKENS = [
23
23
  "--theme-focus",
24
24
  "--theme-focus-ring",
25
25
  "--theme-success",
26
+ "--theme-success-text",
27
+ "--theme-success-solid",
26
28
  "--theme-success-muted",
27
29
  "--theme-error",
30
+ "--theme-error-text",
31
+ "--theme-error-solid",
28
32
  "--theme-error-muted",
29
33
  "--theme-warning",
34
+ "--theme-warning-text",
35
+ "--theme-warning-solid",
30
36
  "--theme-warning-muted",
31
37
  "--theme-info",
38
+ "--theme-info-text",
39
+ "--theme-info-solid",
32
40
  "--theme-info-muted",
33
41
  "--theme-favorite",
42
+ "--theme-favorite-text",
43
+ "--theme-favorite-solid",
34
44
  "--theme-favorite-muted",
35
45
  "--theme-shadow-sm",
36
46
  "--theme-shadow",
@@ -131,7 +141,7 @@ function targets(k) {
131
141
  50,
132
142
  65
133
143
  ]),
134
- focus: { wcag: byContrast(k, [
144
+ graphic: { wcag: byContrast(k, [
135
145
  3,
136
146
  3,
137
147
  4.5
@@ -141,9 +151,14 @@ function targets(k) {
141
151
  2.2,
142
152
  3
143
153
  ]) },
144
- onAccent: { wcag: 4.5 }
154
+ label: { wcag: 4.5 }
145
155
  };
146
156
  }
157
+ var WHITE = {
158
+ l: 1,
159
+ c: 0,
160
+ h: 0
161
+ };
147
162
  var STATUS = {
148
163
  success: 150,
149
164
  error: 27,
@@ -217,7 +232,7 @@ function build(scheme, options) {
217
232
  const t = targets(k);
218
233
  const paints = {};
219
234
  const checks = [];
220
- const hexOf = (d) => typeof d === "string" ? toHex(paints[d].color) : compositeHex(paints[d.fill], paints[d.over]);
235
+ const hexOf = (d) => typeof d === "string" ? toHex(paints[d].color) : "fixed" in d ? toHex(d.fixed) : compositeHex(paints[d.fill], paints[d.over]);
221
236
  const set = (token, color, alpha) => {
222
237
  paints[token] = alpha === void 0 ? { color } : {
223
238
  color,
@@ -287,7 +302,7 @@ function build(scheme, options) {
287
302
  "--theme-app-bg",
288
303
  "--theme-panel-bg",
289
304
  "--theme-input-bg"
290
- ], t.focus), dark ? .35 : .25);
305
+ ], t.graphic), dark ? .35 : .25);
291
306
  solved("--theme-border-strong", border, [
292
307
  "--theme-app-bg",
293
308
  "--theme-panel-bg",
@@ -303,18 +318,21 @@ function build(scheme, options) {
303
318
  l: white ? 1 : 0,
304
319
  c: 0,
305
320
  h: 0
306
- }, ["--theme-accent", "--theme-accent-hover"], t.onAccent);
321
+ }, ["--theme-accent", "--theme-accent-hover"], t.label);
307
322
  const mutedAlpha = dark ? .15 : .1;
323
+ const statusOn = [
324
+ "--theme-app-bg",
325
+ "--theme-panel-bg",
326
+ "--theme-panel-hover",
327
+ "--theme-muted-panel-bg",
328
+ "--theme-hover",
329
+ "--theme-input-bg"
330
+ ];
308
331
  for (const [name, hue] of Object.entries(STATUS)) {
309
332
  const token = `--theme-${name}`;
310
333
  const muted = `--theme-${name}-muted`;
311
- const plain = [
312
- "--theme-app-bg",
313
- "--theme-panel-bg",
314
- "--theme-muted-panel-bg"
315
- ];
316
334
  const on = [
317
- ...plain,
335
+ ...statusOn,
318
336
  {
319
337
  fill: muted,
320
338
  over: "--theme-app-bg"
@@ -324,18 +342,24 @@ function build(scheme, options) {
324
342
  over: "--theme-panel-bg"
325
343
  }
326
344
  ];
327
- let color = solve({
328
- l: dark ? .75 : .55,
329
- c: .17,
345
+ let vivid = solve({
346
+ l: dark ? .7 : .66,
347
+ c: .2,
330
348
  h: hue
331
- }, plain.map(hexOf), t.secondary);
349
+ }, statusOn.map(hexOf), t.graphic);
332
350
  for (let round = 0; round < 6; round++) {
333
- set(muted, color, mutedAlpha);
334
- const next = solve(color, on.map(hexOf), t.secondary);
335
- if (next === color) break;
336
- color = next;
351
+ set(muted, vivid, mutedAlpha);
352
+ const next = solve(vivid, on.map(hexOf), t.graphic);
353
+ if (next === vivid) break;
354
+ vivid = next;
337
355
  }
338
- keep(token, color, on, t.secondary);
356
+ keep(token, vivid, on, t.graphic);
357
+ solved(`--theme-${name}-text`, {
358
+ l: dark ? .75 : .55,
359
+ c: .17,
360
+ h: hue
361
+ }, on, t.secondary);
362
+ solved(`--theme-${name}-solid`, vivid, [{ fixed: WHITE }], t.label);
339
363
  }
340
364
  const sidebarBase = scheme.sidebar?.base ? oklch(scheme.sidebar.base) : neutral(dark ? Math.max(.08, base.l - .035 * s) : base.l - .035 * s);
341
365
  const sidebarAccent = scheme.sidebar?.accent ? oklch(scheme.sidebar.accent) : accent;
@@ -431,6 +455,7 @@ function p3Overrides(paints, checks) {
431
455
  const show = (token) => shown(paints[token].color, gamutOf(token));
432
456
  const backdrop = (d) => {
433
457
  if (typeof d === "string") return show(d);
458
+ if ("fixed" in d) return shown(d.fixed, "srgb");
434
459
  const fill = paints[d.fill];
435
460
  return over(show(d.fill), fill.alpha ?? 1, rendered(paints[d.over].color, gamutOf(d.over)));
436
461
  };
@@ -443,7 +468,7 @@ function p3Overrides(paints, checks) {
443
468
  changed = true;
444
469
  if (passes(check)) continue;
445
470
  }
446
- for (const d of check.on) for (const token of typeof d === "string" ? [d] : [d.fill, d.over]) changed = wide.delete(token) || changed;
471
+ for (const d of check.on) for (const token of typeof d === "string" ? [d] : "fixed" in d ? [] : [d.fill, d.over]) changed = wide.delete(token) || changed;
447
472
  }
448
473
  if (!changed) break;
449
474
  }
package/dist/theme/fit.js CHANGED
@@ -19,10 +19,16 @@ var FLOORS = {
19
19
  "--theme-placeholder": ["--theme-input-bg", 3],
20
20
  "--theme-focus": ["--theme-app-bg", 3],
21
21
  "--theme-accent-text": ["--theme-accent", 4.5],
22
- "--theme-success": ["--theme-app-bg", 4.5],
23
- "--theme-error": ["--theme-app-bg", 4.5],
24
- "--theme-warning": ["--theme-app-bg", 4.5],
25
- "--theme-info": ["--theme-app-bg", 4.5],
22
+ "--theme-success": ["--theme-app-bg", 3],
23
+ "--theme-success-text": ["--theme-app-bg", 4.5],
24
+ "--theme-error": ["--theme-app-bg", 3],
25
+ "--theme-error-text": ["--theme-app-bg", 4.5],
26
+ "--theme-warning": ["--theme-app-bg", 3],
27
+ "--theme-warning-text": ["--theme-app-bg", 4.5],
28
+ "--theme-info": ["--theme-app-bg", 3],
29
+ "--theme-info-text": ["--theme-app-bg", 4.5],
30
+ "--theme-favorite": ["--theme-app-bg", 3],
31
+ "--theme-favorite-text": ["--theme-app-bg", 4.5],
26
32
  "--theme-sidebar-text": ["--theme-sidebar-bg", 4.5],
27
33
  "--theme-sidebar-active-text": ["--theme-sidebar-active-bg", 4.5],
28
34
  "--theme-code-text": ["--theme-code-bg", 4.5],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/ui",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "description": "React UI components: a theme contract, icons, brand logos, primitives, lists, forms, a job graph, a code editor, a log viewer, a file explorer and an AI chat, each on its own subpath",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {