@datavac/ui-kit 1.0.3 → 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.css +1 -1
- package/dist/index.js +7 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6723,31 +6723,23 @@ function Ju({ children: e, defaultTheme: t, customThemes: n, applyToRoot: r = !0
|
|
|
6723
6723
|
if (typeof window < "u") {
|
|
6724
6724
|
let e = localStorage.getItem("datavac-theme");
|
|
6725
6725
|
if (e && a[e]) return e;
|
|
6726
|
-
if (window.matchMedia("(prefers-color-scheme: dark)").matches) return "dark";
|
|
6727
6726
|
}
|
|
6728
6727
|
return "light";
|
|
6729
|
-
}), u = a[s] ?? Vu
|
|
6730
|
-
let t = r ? document.documentElement : null;
|
|
6731
|
-
t && (Object.entries(e).forEach(([e, n]) => t.style.setProperty(e, n)), t.classList.toggle("dark", s === "dark"));
|
|
6732
|
-
}, [r, s]);
|
|
6728
|
+
}), u = a[s] ?? Vu;
|
|
6733
6729
|
o(() => {
|
|
6734
|
-
|
|
6735
|
-
}, [
|
|
6736
|
-
|
|
6737
|
-
s,
|
|
6738
|
-
f
|
|
6739
|
-
]);
|
|
6740
|
-
let p = i((e) => {
|
|
6730
|
+
r && document.documentElement.classList.toggle("dark", s === "dark"), localStorage.setItem("datavac-theme", s);
|
|
6731
|
+
}, [s, r]);
|
|
6732
|
+
let f = i((e) => {
|
|
6741
6733
|
a[e] && c(e);
|
|
6742
|
-
}, [a]),
|
|
6734
|
+
}, [a]), p = i(() => {
|
|
6743
6735
|
c((e) => e === "dark" ? "light" : "dark");
|
|
6744
6736
|
}, []);
|
|
6745
6737
|
return /* @__PURE__ */ d(qu.Provider, {
|
|
6746
6738
|
value: {
|
|
6747
6739
|
themeName: s,
|
|
6748
6740
|
tokens: u,
|
|
6749
|
-
setTheme:
|
|
6750
|
-
toggleTheme:
|
|
6741
|
+
setTheme: f,
|
|
6742
|
+
toggleTheme: p
|
|
6751
6743
|
},
|
|
6752
6744
|
children: e
|
|
6753
6745
|
});
|