@metamask/design-system-twrnc-preset
Version:
1 lines • 1.06 kB
Source Map (JSON)
{"version":3,"file":"ThemeContext.mjs","sourceRoot":"","sources":["../src/ThemeContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc;AACtC,OAAO,EAAE,MAAM,EAAE,cAAc;AAE/B,OAAO,EAAE,sBAAsB,EAAE,8BAA0B;AAC3D,OAAO,EAAE,KAAK,EAAE,0BAAsB;AAWtC,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,EAAE,EAAE,MAAM,CAAC,sBAAsB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/C,KAAK,EAAE,KAAK,CAAC,KAAK;IAClB,WAAW,EAAE,KAAK;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CACvC,wBAAwB,CACzB,CAAC","sourcesContent":["import { createContext } from 'react';\nimport { create } from 'twrnc';\n\nimport { generateTailwindConfig } from './tailwind.config';\nimport { Theme } from './Theme.types';\n\n/**\n * Theme context properties\n */\nexport type ThemeContextProps = {\n tw: ReturnType<typeof create>;\n theme: Theme;\n isPureBlack: boolean;\n};\n\nexport const defaultThemeContextValue = {\n tw: create(generateTailwindConfig(Theme.Light)),\n theme: Theme.Light,\n isPureBlack: false,\n};\n\nexport const ThemeContext = createContext<ThemeContextProps>(\n defaultThemeContextValue,\n);\n"]}