@parallelworks/ui 0.59.0 → 0.61.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.
@@ -402,6 +402,10 @@ function build(scheme, options) {
402
402
  }
403
403
  const sidebarBase = scheme.sidebar?.base ? oklch(scheme.sidebar.base) : neutral(dark ? Math.max(.08, base.l - .035 * s) : base.l - .035 * s);
404
404
  const sidebarAccent = scheme.sidebar?.accent ? oklch(scheme.sidebar.accent) : accent;
405
+ const activeTint = sidebarAccent.c < .02 ? sidebarBase : {
406
+ ...sidebarAccent,
407
+ c: Math.min(sidebarAccent.c, .08)
408
+ };
405
409
  const sidebarDark = isDarkColor(toHex(sidebarBase));
406
410
  const sidebarDir = sidebarDark ? 1 : -1;
407
411
  set("--theme-sidebar-bg", sidebarBase);
@@ -409,17 +413,18 @@ function build(scheme, options) {
409
413
  ...sidebarBase,
410
414
  l: sidebarBase.l + sidebarDir * (sidebarDark ? .08 : .05) * s
411
415
  });
412
- const activeAt = (f) => ({
413
- l: sidebarBase.l + sidebarDir * (sidebarDark ? .12 : .07) * s * f,
414
- c: Math.min(sidebarAccent.c, .08),
415
- h: sidebarAccent.h
416
+ const activeAt = (dir) => (f) => ({
417
+ l: sidebarBase.l + dir * (sidebarDark ? .12 : .07) * s * f,
418
+ c: activeTint.c,
419
+ h: activeTint.h
416
420
  });
417
- set("--theme-sidebar-active-bg", activeAt(roomFor(activeAt, t.primary)));
421
+ const [active, room] = [activeAt(sidebarDir), activeAt(-sidebarDir)].map((fill) => [fill, roomFor(fill, t.primary)]).reduce((a, b) => b[1] > a[1] ? b : a);
422
+ set("--theme-sidebar-active-bg", active(room));
418
423
  solved("--theme-sidebar-text", inkFor(sidebarBase, sidebarBase, sidebarDark), ["--theme-sidebar-bg", "--theme-sidebar-hover"], t.primary);
419
424
  solved("--theme-sidebar-active-text", {
420
425
  l: sidebarBase.l,
421
- c: Math.min(sidebarAccent.c, .04),
422
- h: sidebarAccent.h
426
+ c: Math.min(activeTint.c, .04),
427
+ h: activeTint.h
423
428
  }, ["--theme-sidebar-active-bg"], t.primary);
424
429
  const style = options.code ?? "balanced";
425
430
  set("--theme-code-bg", mutedPanel);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/ui",
3
- "version": "0.59.0",
3
+ "version": "0.61.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": {