UNPKG

@hitachivantara/uikit-react-shared

Version:
29 lines (28 loc) 782 B
import { createContext, useContext } from "react"; import createCache from "@emotion/cache"; //#region src/context/EmotionContext.ts var defaultCacheKey = "hv"; var defaultEmotionCache = createCache({ key: "hv", prepend: true }); var EmotionContext = createContext({ cache: defaultEmotionCache }); //#endregion //#region src/context/ThemeContext.ts var HvThemeContext = createContext({ activeTheme: void 0, colorModes: [], selectedMode: "light", changeMode: () => {}, rootId: void 0, themes: [], selectedTheme: "", changeTheme() {} }); //#endregion //#region src/hooks/useEmotionCache.ts function useEmotionCache() { return useContext(EmotionContext).cache; } //#endregion export { EmotionContext, HvThemeContext, defaultCacheKey, defaultEmotionCache, useEmotionCache };