@wmoney/ui-kit 1.0.4 → 1.0.5

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
@@ -12921,14 +12921,16 @@ function hx({ password: e }) {
12921
12921
  //#endregion
12922
12922
  //#region src/lib/ThemeTokensProvider.tsx
12923
12923
  var gx = n(void 0), _x = () => o(gx), vx = ({ children: e, tokens: n }) => (t.useEffect(() => {
12924
- if (n) {
12925
- let e = document.documentElement;
12926
- Object.entries(n).forEach(([t, n]) => {
12927
- Object.entries(n).forEach(([n, r]) => {
12928
- e.style.setProperty(`--${t}-${n}`, r);
12929
- });
12930
- });
12931
- }
12924
+ if (!n) return;
12925
+ let e = "wmoney-theme-tokens", t = document.getElementById(e);
12926
+ t || (t = document.createElement("style"), t.id = e, document.head.appendChild(t));
12927
+ let r = {
12928
+ light: ":root",
12929
+ dark: ".dark"
12930
+ }, i = Object.entries(n).map(([e, t]) => `${r[e] ?? ":root"} {\n${Object.entries(t).map(([e, t]) => ` --${e}: ${t};`).join("\n")}\n}`).join("\n");
12931
+ return t.textContent = i, () => {
12932
+ t?.remove();
12933
+ };
12932
12934
  }, [n]), /* @__PURE__ */ h(gx.Provider, {
12933
12935
  value: n,
12934
12936
  children: e