@trops/dash-core 0.1.635 → 0.1.636

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.js CHANGED
@@ -2651,11 +2651,22 @@ var ThemeWrapper = function ThemeWrapper(_ref) {
2651
2651
  written.push(name);
2652
2652
  }
2653
2653
  }
2654
+ // Expose the active light/dark variant as a data attribute so the
2655
+ // design system (dash-electron's design.css `[data-mode="light"]`
2656
+ // block) can flip its surface/text tokens to match. Nothing else
2657
+ // keys off this today, so it's purely additive.
2658
+ var prevMode = root.getAttribute("data-mode");
2659
+ root.setAttribute("data-mode", themeVariant);
2654
2660
  return function () {
2655
2661
  for (var _i2 = 0, _written = written; _i2 < _written.length; _i2++) {
2656
2662
  var _name = _written[_i2];
2657
2663
  root.style.removeProperty(_name);
2658
2664
  }
2665
+ if (prevMode === null) {
2666
+ root.removeAttribute("data-mode");
2667
+ } else {
2668
+ root.setAttribute("data-mode", prevMode);
2669
+ }
2659
2670
  };
2660
2671
  }, [chosenTheme, themeVariant]);
2661
2672
 
@@ -29629,6 +29640,21 @@ var ThemeModel = function ThemeModel() {
29629
29640
  cssVarsAll["--".concat(type, "-").concat(shade)] = hex;
29630
29641
  }
29631
29642
  }
29643
+ } else {
29644
+ // Named channel (e.g. "blue"): emit the shade-500 (brand) hex so
29645
+ // the design system's accent tokens — `var(--primary-500)` /
29646
+ // `var(--secondary-500)` in dash-electron's design.css — bind to
29647
+ // named themes too. Previously only hex themes produced cssVars,
29648
+ // so the Aurora accent fell back to a hardcoded default under any
29649
+ // named theme. cssValueFor resolves named colors via
29650
+ // TAILWIND_PALETTE and is variant-independent, so the accent stays
29651
+ // the same brand color in both light and dark (only surfaces flip).
29652
+ // Components still render via Tailwind class strings (bg-blue-700),
29653
+ // so this is purely additive — no named-theme rendering changes.
29654
+ var hex500 = cssValueFor(type, 500, channelValue);
29655
+ if (hex500) {
29656
+ cssVarsAll["--".concat(type, "-500")] = hex500;
29657
+ }
29632
29658
  }
29633
29659
  });
29634
29660
  // Merge base channel vars with per-token override vars (collected