@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.esm.js CHANGED
@@ -2633,11 +2633,22 @@ var ThemeWrapper = function ThemeWrapper(_ref) {
2633
2633
  written.push(name);
2634
2634
  }
2635
2635
  }
2636
+ // Expose the active light/dark variant as a data attribute so the
2637
+ // design system (dash-electron's design.css `[data-mode="light"]`
2638
+ // block) can flip its surface/text tokens to match. Nothing else
2639
+ // keys off this today, so it's purely additive.
2640
+ var prevMode = root.getAttribute("data-mode");
2641
+ root.setAttribute("data-mode", themeVariant);
2636
2642
  return function () {
2637
2643
  for (var _i2 = 0, _written = written; _i2 < _written.length; _i2++) {
2638
2644
  var _name = _written[_i2];
2639
2645
  root.style.removeProperty(_name);
2640
2646
  }
2647
+ if (prevMode === null) {
2648
+ root.removeAttribute("data-mode");
2649
+ } else {
2650
+ root.setAttribute("data-mode", prevMode);
2651
+ }
2641
2652
  };
2642
2653
  }, [chosenTheme, themeVariant]);
2643
2654
 
@@ -29611,6 +29622,21 @@ var ThemeModel = function ThemeModel() {
29611
29622
  cssVarsAll["--".concat(type, "-").concat(shade)] = hex;
29612
29623
  }
29613
29624
  }
29625
+ } else {
29626
+ // Named channel (e.g. "blue"): emit the shade-500 (brand) hex so
29627
+ // the design system's accent tokens — `var(--primary-500)` /
29628
+ // `var(--secondary-500)` in dash-electron's design.css — bind to
29629
+ // named themes too. Previously only hex themes produced cssVars,
29630
+ // so the Aurora accent fell back to a hardcoded default under any
29631
+ // named theme. cssValueFor resolves named colors via
29632
+ // TAILWIND_PALETTE and is variant-independent, so the accent stays
29633
+ // the same brand color in both light and dark (only surfaces flip).
29634
+ // Components still render via Tailwind class strings (bg-blue-700),
29635
+ // so this is purely additive — no named-theme rendering changes.
29636
+ var hex500 = cssValueFor(type, 500, channelValue);
29637
+ if (hex500) {
29638
+ cssVarsAll["--".concat(type, "-500")] = hex500;
29639
+ }
29614
29640
  }
29615
29641
  });
29616
29642
  // Merge base channel vars with per-token override vars (collected