@hakit/components
Version:
A series of components to work with @hakit/core
26 lines (25 loc) • 602 B
JavaScript
import { create as h } from "zustand";
import { DEFAULT_THEME_OPTIONS as e } from "./constants.js";
const m = h((t) => ({
theme: {
hue: e.hue,
lightness: e.lightness,
tint: e.tint,
saturation: e.saturation,
darkMode: e.darkMode,
contrastThreshold: e.contrastThreshold
},
setTheme: (r) => {
t((o) => ({
theme: {
...o.theme,
// Only spread properties that are not undefined
...Object.fromEntries(Object.entries(r).filter(([, s]) => s !== void 0))
}
}));
}
}));
export {
m as useThemeStore
};
//# sourceMappingURL=store.js.map