@houssemdi2000/design-system 1.3.7 → 1.3.9

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.
@@ -3,5 +3,5 @@ export interface Theme {
3
3
  background: string;
4
4
  text: string;
5
5
  border: string;
6
- mode: "light" | "dark";
6
+ mode: string;
7
7
  }
package/dist/index.esm.js CHANGED
@@ -278,9 +278,10 @@ const ThemeProvider = ({ children, }) => {
278
278
  background: tco.background,
279
279
  text: tco.text,
280
280
  border: tco.border,
281
- mode: "light",
281
+ mode: localStorage.getItem("mode") || "light",
282
282
  });
283
283
  const toggleDarkMode = () => {
284
+ localStorage.setItem("mode", localStorage.getItem("mode") === "light" ? "dark" : "light");
284
285
  setTheme((prev) => (Object.assign(Object.assign({}, prev), { mode: prev.mode === "light" ? "dark" : "light", background: prev.mode === "light" ? tco.backgroundDark : tco.background, text: prev.mode === "light" ? tco.textDark : tco.text })));
285
286
  };
286
287
  const setCustomTheme = (t) => {