@tamagui/next-theme 1.135.2 → 1.135.4-1761748186554

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.
Files changed (72) hide show
  1. package/dist/cjs/NextThemeProvider.cjs +2 -2
  2. package/dist/cjs/NextThemeProvider.js +1 -1
  3. package/dist/cjs/NextThemeProvider.js.map +1 -1
  4. package/dist/cjs/ThemeSettingContext.cjs +1 -1
  5. package/dist/cjs/ThemeSettingContext.js +1 -1
  6. package/dist/cjs/useRootTheme.cjs +1 -1
  7. package/dist/cjs/useRootTheme.js +1 -1
  8. package/dist/cjs/useRootTheme.js.map +1 -1
  9. package/dist/cjs/useTheme.cjs +1 -1
  10. package/dist/cjs/useTheme.js +1 -1
  11. package/dist/cjs/useTheme.js.map +1 -1
  12. package/package.json +17 -7
  13. package/types/NextTheme.d.ts +10 -0
  14. package/types/NextTheme.d.ts.map +11 -0
  15. package/types/NextThemeProvider.d.ts +5 -0
  16. package/types/NextThemeProvider.d.ts.map +13 -0
  17. package/types/ThemeSettingContext.d.ts +5 -0
  18. package/types/ThemeSettingContext.d.ts.map +13 -0
  19. package/types/UseThemeProps.d.ts +44 -0
  20. package/types/UseThemeProps.d.ts.map +11 -0
  21. package/types/constants.d.ts +5 -0
  22. package/types/constants.d.ts.map +11 -0
  23. package/types/helpers.d.ts +5 -0
  24. package/types/helpers.d.ts.map +11 -0
  25. package/types/index.d.ts +4 -0
  26. package/types/index.d.ts.map +11 -0
  27. package/types/types.d.ts +6 -0
  28. package/types/types.d.ts.map +11 -0
  29. package/types/useRootTheme.d.ts +7 -0
  30. package/types/useRootTheme.d.ts.map +11 -0
  31. package/types/useTheme.d.ts +8 -0
  32. package/types/useTheme.d.ts.map +11 -0
  33. package/dist/cjs/NextTheme.native.js +0 -34
  34. package/dist/cjs/NextTheme.native.js.map +0 -6
  35. package/dist/cjs/NextThemeProvider.native.js +0 -215
  36. package/dist/cjs/NextThemeProvider.native.js.map +0 -6
  37. package/dist/cjs/ThemeSettingContext.native.js +0 -40
  38. package/dist/cjs/ThemeSettingContext.native.js.map +0 -6
  39. package/dist/cjs/UseThemeProps.native.js +0 -15
  40. package/dist/cjs/UseThemeProps.native.js.map +0 -6
  41. package/dist/cjs/constants.native.js +0 -33
  42. package/dist/cjs/constants.native.js.map +0 -6
  43. package/dist/cjs/helpers.native.js +0 -43
  44. package/dist/cjs/helpers.native.js.map +0 -6
  45. package/dist/cjs/index.native.js +0 -22
  46. package/dist/cjs/index.native.js.map +0 -6
  47. package/dist/cjs/types.native.js +0 -15
  48. package/dist/cjs/types.native.js.map +0 -6
  49. package/dist/cjs/useRootTheme.native.js +0 -43
  50. package/dist/cjs/useRootTheme.native.js.map +0 -6
  51. package/dist/cjs/useTheme.native.js +0 -40
  52. package/dist/cjs/useTheme.native.js.map +0 -6
  53. package/dist/esm/NextTheme.native.js +0 -9
  54. package/dist/esm/NextTheme.native.js.map +0 -1
  55. package/dist/esm/NextThemeProvider.native.js +0 -185
  56. package/dist/esm/NextThemeProvider.native.js.map +0 -1
  57. package/dist/esm/ThemeSettingContext.native.js +0 -8
  58. package/dist/esm/ThemeSettingContext.native.js.map +0 -1
  59. package/dist/esm/UseThemeProps.native.js +0 -2
  60. package/dist/esm/UseThemeProps.native.js.map +0 -1
  61. package/dist/esm/constants.native.js +0 -5
  62. package/dist/esm/constants.native.js.map +0 -1
  63. package/dist/esm/helpers.native.js +0 -19
  64. package/dist/esm/helpers.native.js.map +0 -1
  65. package/dist/esm/index.native.js +0 -3
  66. package/dist/esm/index.native.js.map +0 -1
  67. package/dist/esm/types.native.js +0 -2
  68. package/dist/esm/types.native.js.map +0 -1
  69. package/dist/esm/useRootTheme.native.js +0 -15
  70. package/dist/esm/useRootTheme.native.js.map +0 -1
  71. package/dist/esm/useTheme.native.js +0 -10
  72. package/dist/esm/useTheme.native.js.map +0 -1
@@ -36,8 +36,8 @@ __export(NextThemeProvider_exports, {
36
36
  module.exports = __toCommonJS(NextThemeProvider_exports);
37
37
  var import_constants = require("@tamagui/constants"),
38
38
  import_use_event = require("@tamagui/use-event"),
39
- import_head = __toESM(require("next/head")),
40
- React = __toESM(require("react")),
39
+ import_head = __toESM(require("next/head"), 1),
40
+ React = __toESM(require("react"), 1),
41
41
  import_react = require("react"),
42
42
  import_constants2 = require("./constants.cjs"),
43
43
  import_helpers = require("./helpers.cjs"),
@@ -25,7 +25,7 @@ __export(NextThemeProvider_exports, {
25
25
  NextThemeProvider: () => NextThemeProvider
26
26
  });
27
27
  module.exports = __toCommonJS(NextThemeProvider_exports);
28
- var import_constants = require("@tamagui/constants"), import_use_event = require("@tamagui/use-event"), import_head = __toESM(require("next/head")), React = __toESM(require("react")), import_react = require("react"), import_constants2 = require("./constants"), import_helpers = require("./helpers"), import_ThemeSettingContext = require("./ThemeSettingContext"), import_jsx_runtime = require("react/jsx-runtime");
28
+ var import_constants = require("@tamagui/constants"), import_use_event = require("@tamagui/use-event"), import_head = __toESM(require("next/head"), 1), React = __toESM(require("react"), 1), import_react = require("react"), import_constants2 = require("./constants"), import_helpers = require("./helpers"), import_ThemeSettingContext = require("./ThemeSettingContext"), import_jsx_runtime = require("react/jsx-runtime");
29
29
  const NextThemeProvider = (0, import_react.memo)(
30
30
  ({
31
31
  forcedTheme,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/NextThemeProvider.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0C,+BAC1C,mBAAyB,+BACzB,cAAqB,+BACrB,QAAuB,2BACvB,eAAmD,kBAEnDA,oBAAoC,wBACpC,iBAAyC,sBACzC,6BAAoC,kCAiL9B;AA7KC,MAAM,wBAAiE;AAAA,EAC5E,CAAC;AAAA,IACC;AAAA,IACA,4BAA4B;AAAA,IAC5B,eAAe;AAAA,IACf,oBAAoB;AAAA,IACpB,aAAa;AAAA,IACb,SAAS;AAAA,IACT,eAAe,eAAe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AK,EAAI,CAAC;AAAA,QAC1C;AAAA;AAAA,MATI;AAAA,IAUN,IAEA;AAAA,MAAC;AAAA;AAAA,QAGC,yBAAyB;AAAA,UACvB,QAAQ,mBAAmB,YAAY,+BAA+B,UAAU,YAC9E,QAAQ,SAAS,KAAK,UAAU,KAAK,CAAC,MAAM,EAC9C,GAAG,UAAU,QAAQ,SAAS,KAAK,EAAI,CAAC,SAAS;AAAA,YAC/C;AAAA,UACF,CAAC;AAAA,QACH;AAAA;AAAA,MAPI;AAAA,IAQN,GAEJ;AAGF,WAAI,eAAqB,WAElB,4CAAC,YAAAC,SAAA,EAAU,oBAAS;AAAA,EAC7B;AAAA,EACA,CAAC,WAAW,cAGN,UAAU,gBAAgB,UAAU;AAG5C;",
5
5
  "names": ["import_constants", "theme", "NextHead"]
6
6
  }
@@ -34,7 +34,7 @@ __export(ThemeSettingContext_exports, {
34
34
  ThemeSettingContext: () => ThemeSettingContext
35
35
  });
36
36
  module.exports = __toCommonJS(ThemeSettingContext_exports);
37
- var import_react = __toESM(require("react"));
37
+ var import_react = __toESM(require("react"), 1);
38
38
  const ThemeSettingContext = import_react.default.createContext({
39
39
  toggle: () => {},
40
40
  set: _ => {},
@@ -25,7 +25,7 @@ __export(ThemeSettingContext_exports, {
25
25
  ThemeSettingContext: () => ThemeSettingContext
26
26
  });
27
27
  module.exports = __toCommonJS(ThemeSettingContext_exports);
28
- var import_react = __toESM(require("react"));
28
+ var import_react = __toESM(require("react"), 1);
29
29
  const ThemeSettingContext = import_react.default.createContext({
30
30
  toggle: () => {
31
31
  },
@@ -34,7 +34,7 @@ __export(useRootTheme_exports, {
34
34
  useRootTheme: () => useRootTheme
35
35
  });
36
36
  module.exports = __toCommonJS(useRootTheme_exports);
37
- var import_react = __toESM(require("react")),
37
+ var import_react = __toESM(require("react"), 1),
38
38
  import_constants = require("@tamagui/constants");
39
39
  const useRootTheme = ({
40
40
  fallback = "light"
@@ -25,7 +25,7 @@ __export(useRootTheme_exports, {
25
25
  useRootTheme: () => useRootTheme
26
26
  });
27
27
  module.exports = __toCommonJS(useRootTheme_exports);
28
- var import_react = __toESM(require("react")), import_constants = require("@tamagui/constants");
28
+ var import_react = __toESM(require("react"), 1), import_constants = require("@tamagui/constants");
29
29
  const useRootTheme = ({
30
30
  fallback = "light"
31
31
  } = {}) => {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/useRootTheme.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,2BAClB,mBAAyB;AAIlB,MAAM,eAAe,CAAC;AAAA,EAC3B,WAAW;AACb,IAAgC,CAAC,MAG5B;AACH,MAAI,aAAa;AAEjB,MAAI,2BAAU;AAEZ,UAAM,UAAU,CAAC,GAAG,SAAS,gBAAgB,SAAS;AACtD,iBAAa,QAAQ,SAAS,QAAQ,IAClC,SACA,QAAQ,SAAS,SAAS,IACxB,UACA;AAAA,EACR;AAEA,SAAO,aAAAA,QAAM,SAAsB,UAAU;AAC/C;",
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,8BAClB,mBAAyB;AAIlB,MAAM,eAAe,CAAC;AAAA,EAC3B,WAAW;AACb,IAAgC,CAAC,MAG5B;AACH,MAAI,aAAa;AAEjB,MAAI,2BAAU;AAEZ,UAAM,UAAU,CAAC,GAAG,SAAS,gBAAgB,SAAS;AACtD,iBAAa,QAAQ,SAAS,QAAQ,IAClC,SACA,QAAQ,SAAS,SAAS,IACxB,UACA;AAAA,EACR;AAEA,SAAO,aAAAA,QAAM,SAAsB,UAAU;AAC/C;",
5
5
  "names": ["React"]
6
6
  }
@@ -35,7 +35,7 @@ __export(useTheme_exports, {
35
35
  useThemeSetting: () => useThemeSetting
36
36
  });
37
37
  module.exports = __toCommonJS(useTheme_exports);
38
- var import_react = __toESM(require("react")),
38
+ var import_react = __toESM(require("react"), 1),
39
39
  import_ThemeSettingContext = require("./ThemeSettingContext.cjs");
40
40
  const useTheme = () => import_react.default.useContext(import_ThemeSettingContext.ThemeSettingContext),
41
41
  useThemeSetting = () => import_react.default.useContext(import_ThemeSettingContext.ThemeSettingContext);
@@ -26,6 +26,6 @@ __export(useTheme_exports, {
26
26
  useThemeSetting: () => useThemeSetting
27
27
  });
28
28
  module.exports = __toCommonJS(useTheme_exports);
29
- var import_react = __toESM(require("react")), import_ThemeSettingContext = require("./ThemeSettingContext");
29
+ var import_react = __toESM(require("react"), 1), import_ThemeSettingContext = require("./ThemeSettingContext");
30
30
  const useTheme = () => import_react.default.useContext(import_ThemeSettingContext.ThemeSettingContext), useThemeSetting = () => import_react.default.useContext(import_ThemeSettingContext.ThemeSettingContext);
31
31
  //# sourceMappingURL=useTheme.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/useTheme.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,2BAElB,6BAAoC;AAO7B,MAAM,WAAW,MAAqB,aAAAA,QAAM,WAAW,8CAAmB,GAEpE,kBAAkB,MAAqB,aAAAA,QAAM,WAAW,8CAAmB;",
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,8BAElB,6BAAoC;AAO7B,MAAM,WAAW,MAAqB,aAAAA,QAAM,WAAW,8CAAmB,GAEpE,kBAAkB,MAAqB,aAAAA,QAAM,WAAW,8CAAmB;",
5
5
  "names": ["React"]
6
6
  }
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@tamagui/next-theme",
3
- "version": "1.135.2",
3
+ "version": "1.135.4-1761748186554",
4
+ "type": "module",
4
5
  "sideEffects": false,
5
6
  "source": "src/index.ts",
6
- "types": "./src/index.ts",
7
+ "types": "./types/index.d.ts",
7
8
  "main": "dist/cjs",
8
9
  "module": "dist/esm",
9
10
  "files": [
@@ -12,20 +13,29 @@
12
13
  "dist"
13
14
  ],
14
15
  "scripts": {
15
- "build": "tamagui-build --skip-types",
16
- "watch": "tamagui-build --skip-types --watch",
16
+ "build": "tamagui-build --skip-native",
17
+ "watch": "tamagui-build --skip-native --watch",
17
18
  "lint": "biome check src",
18
19
  "lint:fix": "biome check --write src",
19
20
  "clean": "tamagui-build clean",
20
21
  "clean:build": "tamagui-build clean:build"
21
22
  },
23
+ "exports": {
24
+ "./package.json": "./package.json",
25
+ ".": {
26
+ "types": "./types/index.d.ts",
27
+ "import": "./dist/esm/index.mjs",
28
+ "require": "./dist/cjs/index.cjs",
29
+ "default": "./dist/cjs/index.js"
30
+ }
31
+ },
22
32
  "dependencies": {
23
- "@tamagui/constants": "1.135.2",
24
- "@tamagui/use-event": "1.135.2",
33
+ "@tamagui/constants": "1.135.4-1761748186554",
34
+ "@tamagui/use-event": "1.135.4-1761748186554",
25
35
  "next": "^15.3.1"
26
36
  },
27
37
  "devDependencies": {
28
- "@tamagui/build": "1.135.2",
38
+ "@tamagui/build": "1.135.4-1761748186554",
29
39
  "react": "*"
30
40
  },
31
41
  "peerDependencies": {
@@ -0,0 +1,10 @@
1
+ export * from "./NextThemeProvider";
2
+ export * from "./ThemeSettingContext";
3
+ export * from "./UseThemeProps";
4
+ export * from "./helpers";
5
+ export * from "./constants";
6
+ export * from "./useTheme";
7
+ export * from "./types";
8
+ export * from "./useRootTheme";
9
+
10
+ //# sourceMappingURL=NextTheme.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAGA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc",
3
+ "names": [],
4
+ "sources": [
5
+ "src/NextTheme.tsx"
6
+ ],
7
+ "sourcesContent": [
8
+ "// https://raw.githubusercontent.com/pacocoursey/next-themes/master/index.tsx\n// forked temporarily\n\nexport * from './NextThemeProvider'\nexport * from './ThemeSettingContext'\nexport * from './UseThemeProps'\nexport * from './helpers'\nexport * from './constants'\nexport * from './useTheme'\nexport * from './types'\nexport * from './useRootTheme'\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ import type { ThemeProviderProps } from "./UseThemeProps";
3
+ export declare const NextThemeProvider: React.FunctionComponent<ThemeProviderProps>;
4
+
5
+ //# sourceMappingURL=NextThemeProvider.d.ts.map
@@ -0,0 +1,13 @@
1
+ {
2
+ "mappings": "AAGA,YAAY,WAAW;AAOvB,cAAc,0BAAyC;AAEvD,OAAO,cAAMA,mBAAmB,MAAM,kBAAkB",
3
+ "names": [
4
+ "NextThemeProvider: React.FunctionComponent<ThemeProviderProps>"
5
+ ],
6
+ "sources": [
7
+ "src/NextThemeProvider.tsx"
8
+ ],
9
+ "sourcesContent": [
10
+ "import { useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { useEvent } from '@tamagui/use-event'\nimport NextHead from 'next/head'\nimport * as React from 'react'\nimport { memo, useEffect, useMemo, useState } from 'react'\n\nimport { MEDIA, colorSchemes } from './constants'\nimport { getSystemTheme, getTheme } from './helpers'\nimport { ThemeSettingContext } from './ThemeSettingContext'\nimport type { ValueObject } from './types'\nimport type { ThemeProviderProps, UseThemeProps } from './UseThemeProps'\n\nexport const NextThemeProvider: React.FunctionComponent<ThemeProviderProps> = memo(\n ({\n forcedTheme,\n disableTransitionOnChange = false,\n enableSystem = true,\n enableColorScheme = true,\n storageKey = 'theme',\n themes = colorSchemes,\n defaultTheme = enableSystem ? 'system' : 'light',\n attribute = 'class',\n skipNextHead,\n onChangeTheme,\n value = {\n dark: 't_dark',\n light: 't_light',\n },\n children,\n }) => {\n const [theme, setThemeState] = useState(() => getTheme(storageKey, defaultTheme))\n const [resolvedTheme, setResolvedTheme] = useState(() => getTheme(storageKey))\n const attrs = !value ? themes : Object.values(value)\n\n const handleMediaQuery = useEvent((e?) => {\n const _ = getSystemTheme(e)\n const update = () => setResolvedTheme(_)\n if (disableTransitionOnChange) {\n update()\n } else {\n React.startTransition(() => update())\n }\n if (theme === 'system' && !forcedTheme) {\n handleChangeTheme(_, false)\n }\n })\n\n const handleChangeTheme = useEvent(\n (theme, updateStorage = true, updateDOM = true) => {\n let name = value?.[theme] || theme\n\n if (updateStorage) {\n try {\n localStorage.setItem(storageKey, theme)\n } catch (e) {\n // Unsupported\n }\n }\n\n if (theme === 'system' && enableSystem) {\n const resolved = getSystemTheme()\n name = value?.[resolved] || resolved\n }\n\n onChangeTheme?.(name.replace('t_', ''))\n\n if (updateDOM) {\n const d = document.documentElement\n if (attribute === 'class') {\n d.classList.remove(...attrs)\n d.classList.add(name)\n } else {\n d.setAttribute(attribute, name)\n }\n }\n }\n )\n\n useIsomorphicLayoutEffect(() => {\n // Always listen to System preference\n const media = window.matchMedia(MEDIA)\n // Intentionally use deprecated listener methods to support iOS & old browsers\n media.addListener(handleMediaQuery)\n handleMediaQuery(media)\n return () => {\n media.removeListener(handleMediaQuery)\n }\n }, [])\n\n const set = useEvent((newTheme) => {\n if (forcedTheme) {\n handleChangeTheme(newTheme, true, false)\n } else {\n handleChangeTheme(newTheme)\n }\n setThemeState(newTheme)\n })\n\n // localStorage event handling\n useEffect(() => {\n const handleStorage = (e: StorageEvent) => {\n if (e.key !== storageKey) {\n return\n }\n // If default theme set, use it if localstorage === null (happens on local storage manual deletion)\n const theme = e.newValue || defaultTheme\n set(theme)\n }\n window.addEventListener('storage', handleStorage)\n return () => {\n window.removeEventListener('storage', handleStorage)\n }\n }, [defaultTheme, set, storageKey])\n\n // color-scheme handling\n useIsomorphicLayoutEffect(() => {\n if (!enableColorScheme) return\n\n const colorScheme =\n // If theme is forced to light or dark, use that\n forcedTheme && colorSchemes.includes(forcedTheme as 'light' | 'dark')\n ? forcedTheme\n : // If regular theme is light or dark\n theme && colorSchemes.includes(theme)\n ? theme\n : // If theme is system, use the resolved version\n theme === 'system'\n ? resolvedTheme || null\n : null\n\n // color-scheme tells browser how to render built-in elements like forms, scrollbars, etc.\n // if color-scheme is null, this will remove the property\n const userPrefers =\n typeof window !== 'undefined' &&\n window.matchMedia &&\n window.matchMedia('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light'\n\n const wePrefer = colorScheme || 'light'\n\n // avoid running this because it causes full page reflow\n if (userPrefers !== wePrefer) {\n document.documentElement.style.setProperty('color-scheme', colorScheme)\n }\n }, [enableColorScheme, theme, resolvedTheme, forcedTheme])\n\n const toggle = useEvent(() => {\n const order =\n resolvedTheme === 'dark'\n ? ['system', 'light', 'dark']\n : ['system', 'dark', 'light']\n const next = order[(order.indexOf(theme) + 1) % order.length]\n set(next)\n })\n\n const systemTheme = (enableSystem ? resolvedTheme : undefined) as\n | 'light'\n | 'dark'\n | undefined\n\n const contextValue = useMemo(() => {\n const value: UseThemeProps = {\n theme,\n current: theme,\n set,\n toggle,\n forcedTheme,\n resolvedTheme: theme === 'system' ? resolvedTheme : theme,\n themes: enableSystem ? [...themes, 'system'] : (themes as string[]),\n systemTheme,\n } as const\n return value\n }, [\n theme,\n set,\n toggle,\n forcedTheme,\n resolvedTheme,\n enableSystem,\n themes,\n systemTheme,\n ])\n\n return (\n <ThemeSettingContext.Provider value={contextValue}>\n <ThemeScript\n {...{\n forcedTheme,\n storageKey,\n systemTheme: resolvedTheme,\n attribute,\n value,\n enableSystem,\n defaultTheme,\n attrs,\n skipNextHead,\n }}\n />\n {/* because on SSR we re-run and can avoid whole tree re-render */}\n {useMemo(() => children, [children])}\n </ThemeSettingContext.Provider>\n )\n }\n)\n\nconst ThemeScript = memo(\n ({\n forcedTheme,\n storageKey,\n attribute,\n enableSystem,\n defaultTheme,\n value,\n attrs,\n skipNextHead,\n }: {\n forcedTheme?: string\n storageKey: string\n attribute?: string\n enableSystem?: boolean\n defaultTheme: string\n value?: ValueObject\n attrs: any\n skipNextHead?: boolean\n }) => {\n // Code-golfing the amount of characters in the script\n const optimization = (() => {\n if (attribute === 'class') {\n const removeClasses = attrs.map((t: string) => `d.remove('${t}')`).join(';')\n return `var d=document.documentElement.classList;${removeClasses};`\n }\n return `var d=document.documentElement;`\n })()\n\n const updateDOM = (name: string, literal?: boolean) => {\n name = value?.[name] || name\n const val = literal ? name : `'${name}'`\n\n if (attribute === 'class') {\n return `d.add(${val})`\n }\n\n return `d.setAttribute('${attribute}', ${val})`\n }\n\n const defaultSystem = defaultTheme === 'system'\n\n const contents = (\n <>\n {forcedTheme ? (\n <script\n // nonce={nonce}\n key=\"next-themes-script\"\n dangerouslySetInnerHTML={{\n // These are minified via Terser and then updated by hand, don't recommend\n __html: `!function(){${optimization}${updateDOM(forcedTheme)}}()`,\n }}\n />\n ) : enableSystem ? (\n <script\n // nonce={nonce}\n key=\"next-themes-script\"\n dangerouslySetInnerHTML={{\n __html: `!function(){try {${optimization}var e=localStorage.getItem('${storageKey}');${\n !defaultSystem ? updateDOM(defaultTheme) + ';' : ''\n }if(\"system\"===e||(!e&&${defaultSystem})){var t=\"${MEDIA}\",m=window.matchMedia(t);m.media!==t||m.matches?${updateDOM(\n 'dark'\n )}:${updateDOM('light')}}else if(e) ${\n value ? `var x=${JSON.stringify(value)};` : ''\n }${updateDOM(value ? 'x[e]' : 'e', true)}}catch(e){}}()`,\n }}\n />\n ) : (\n <script\n // nonce={nonce}\n key=\"next-themes-script\"\n dangerouslySetInnerHTML={{\n __html: `!function(){try{${optimization}var e=localStorage.getItem(\"${storageKey}\");if(e){${\n value ? `var x=${JSON.stringify(value)};` : ''\n }${updateDOM(value ? 'x[e]' : 'e', true)}}else{${updateDOM(\n defaultTheme\n )};}}catch(t){}}();`,\n }}\n />\n )}\n </>\n )\n\n if (skipNextHead) return contents\n\n return <NextHead>{contents}</NextHead>\n },\n (prevProps, nextProps) => {\n // Only re-render when forcedTheme changes\n // the rest of the props should be completely stable\n if (prevProps.forcedTheme !== nextProps.forcedTheme) return false\n return true\n }\n)\n"
11
+ ],
12
+ "version": 3
13
+ }
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import type { UseThemeProps } from "./UseThemeProps";
3
+ export declare const ThemeSettingContext: React.Context<UseThemeProps>;
4
+
5
+ //# sourceMappingURL=ThemeSettingContext.d.ts.map
@@ -0,0 +1,13 @@
1
+ {
2
+ "mappings": "AAAA,OAAO,WAAW;AAElB,cAAc,qBAAqB;AAEnC,OAAO,cAAMA,qBAAqB,MAAM,QAAQ",
3
+ "names": [
4
+ "ThemeSettingContext: React.Context<UseThemeProps>"
5
+ ],
6
+ "sources": [
7
+ "src/ThemeSettingContext.tsx"
8
+ ],
9
+ "sourcesContent": [
10
+ "import React from 'react'\n\nimport type { UseThemeProps } from './UseThemeProps'\n\nexport const ThemeSettingContext: React.Context<UseThemeProps> =\n React.createContext<UseThemeProps>({\n toggle: () => {},\n set: (_) => {},\n themes: [],\n })\n"
11
+ ],
12
+ "version": 3
13
+ }
@@ -0,0 +1,44 @@
1
+ import type { ValueObject } from "./types";
2
+ export interface UseThemeProps {
3
+ /** List of all available theme names */
4
+ themes: string[];
5
+ /** Forced theme name for the current page */
6
+ forcedTheme?: string;
7
+ /** Update the theme */
8
+ set: (theme: string) => void;
9
+ toggle: () => void;
10
+ /** Active theme name - will return "system" if not overriden, see "resolvedTheme" for getting resolved system value */
11
+ current?: string;
12
+ /** @deprecated Use `current` instead (deprecating avoid confusion with useTheme) */
13
+ theme?: string;
14
+ /** If `enableSystem` is true and the active theme is "system", this returns whether the system preference resolved to "dark" or "light". Otherwise, identical to `theme` */
15
+ resolvedTheme?: string;
16
+ /** If enableSystem is true, returns the System theme preference ("dark" or "light"), regardless what the active theme is */
17
+ systemTheme?: "dark" | "light";
18
+ }
19
+ export interface ThemeProviderProps {
20
+ children?: any;
21
+ /** List of all available theme names */
22
+ themes?: string[];
23
+ /** Forced theme name for the current page */
24
+ forcedTheme?: string;
25
+ /** Whether to switch between dark and light themes based on prefers-color-scheme */
26
+ enableSystem?: boolean;
27
+ systemTheme?: string;
28
+ /** Disable all CSS transitions when switching themes */
29
+ disableTransitionOnChange?: boolean;
30
+ /** Whether to indicate to browsers which color scheme is used (dark or light) for built-in UI like inputs and buttons */
31
+ enableColorScheme?: boolean;
32
+ /** Key used to store theme setting in localStorage */
33
+ storageKey?: string;
34
+ /** Default theme name (for v0.0.12 and lower the default was light). If `enableSystem` is false, the default theme is light */
35
+ defaultTheme?: string;
36
+ /** HTML attribute modified based on the active theme. Accepts `class` and `data-*` (meaning any data attribute, `data-mode`, `data-color`, etc.) */
37
+ attribute?: string | "class";
38
+ /** Mapping of theme name to HTML attribute value. Object where key is the theme name and value is the attribute value */
39
+ value?: ValueObject;
40
+ onChangeTheme?: (name: string) => void;
41
+ skipNextHead?: boolean;
42
+ }
43
+
44
+ //# sourceMappingURL=UseThemeProps.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,cAAc,mBAAmB;AAEjC,iBAAiB,cAAc;;CAE7B;;CAEA;;CAEA,MAAM;CACN;;CAEA;;CAEA;;CAEA;;CAEA,cAAc,SAAS;;AAGzB,iBAAiB,mBAAmB;CAClC;;CAEA;;CAEA;;CAEA;CACA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA,qBAAqB;;CAErB,QAAQ;CACR,iBAAiB;CAGjB",
3
+ "names": [],
4
+ "sources": [
5
+ "src/UseThemeProps.tsx"
6
+ ],
7
+ "sourcesContent": [
8
+ "import type { ValueObject } from './types'\n\nexport interface UseThemeProps {\n /** List of all available theme names */\n themes: string[]\n /** Forced theme name for the current page */\n forcedTheme?: string\n /** Update the theme */\n set: (theme: string) => void\n toggle: () => void\n /** Active theme name - will return \"system\" if not overriden, see \"resolvedTheme\" for getting resolved system value */\n current?: string\n /** @deprecated Use `current` instead (deprecating avoid confusion with useTheme) */\n theme?: string\n /** If `enableSystem` is true and the active theme is \"system\", this returns whether the system preference resolved to \"dark\" or \"light\". Otherwise, identical to `theme` */\n resolvedTheme?: string\n /** If enableSystem is true, returns the System theme preference (\"dark\" or \"light\"), regardless what the active theme is */\n systemTheme?: 'dark' | 'light'\n}\n\nexport interface ThemeProviderProps {\n children?: any\n /** List of all available theme names */\n themes?: string[]\n /** Forced theme name for the current page */\n forcedTheme?: string\n /** Whether to switch between dark and light themes based on prefers-color-scheme */\n enableSystem?: boolean\n systemTheme?: string\n /** Disable all CSS transitions when switching themes */\n disableTransitionOnChange?: boolean\n /** Whether to indicate to browsers which color scheme is used (dark or light) for built-in UI like inputs and buttons */\n enableColorScheme?: boolean\n /** Key used to store theme setting in localStorage */\n storageKey?: string\n /** Default theme name (for v0.0.12 and lower the default was light). If `enableSystem` is false, the default theme is light */\n defaultTheme?: string\n /** HTML attribute modified based on the active theme. Accepts `class` and `data-*` (meaning any data attribute, `data-mode`, `data-color`, etc.) */\n attribute?: string | 'class'\n /** Mapping of theme name to HTML attribute value. Object where key is the theme name and value is the attribute value */\n value?: ValueObject\n onChangeTheme?: (name: string) => void\n\n // avoids warning\n skipNextHead?: boolean\n}\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,5 @@
1
+ export declare const constants: {};
2
+ export declare const colorSchemes: readonly ["light", "dark"];
3
+ export declare const MEDIA = "(prefers-color-scheme: dark)";
4
+
5
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,OAAO,cAAM;AACb,OAAO,cAAM,wBAAgB,SAAS;AACtC,OAAO,cAAM,QAAQ",
3
+ "names": [],
4
+ "sources": [
5
+ "src/constants.tsx"
6
+ ],
7
+ "sourcesContent": [
8
+ "export const constants = {}\nexport const colorSchemes = ['light', 'dark'] as const\nexport const MEDIA = '(prefers-color-scheme: dark)'\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,5 @@
1
+ export declare const helpers: {};
2
+ export declare const getTheme: (key: string, fallback?: string) => any;
3
+ export declare const getSystemTheme: (e?: MediaQueryList) => "dark" | "light";
4
+
5
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAEA,OAAO,cAAM;AAGb,OAAO,cAAM,WAAY,aAAa;AAWtC,OAAO,cAAM,iBAAkB,IAAI,mBAAiB,SAAS",
3
+ "names": [],
4
+ "sources": [
5
+ "src/helpers.tsx"
6
+ ],
7
+ "sourcesContent": [
8
+ "import { MEDIA } from './constants'\n\nexport const helpers = {}\n// Helpers\n\nexport const getTheme = (key: string, fallback?: string): any => {\n if (typeof window === 'undefined') return undefined\n let theme\n try {\n theme = localStorage.getItem(key) || undefined\n } catch (e) {\n // Unsupported\n }\n return theme || fallback\n}\n\nexport const getSystemTheme = (e?: MediaQueryList): 'dark' | 'light' => {\n if (!e) {\n e = window.matchMedia(MEDIA)\n }\n\n const isDark = e.matches\n const systemTheme = isDark ? 'dark' : 'light'\n return systemTheme\n}\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./NextTheme";
2
+ export * from "./types";
3
+
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,cAAc;AACd,cAAc",
3
+ "names": [],
4
+ "sources": [
5
+ "src/index.ts"
6
+ ],
7
+ "sourcesContent": [
8
+ "export * from './NextTheme'\nexport * from './types'\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,6 @@
1
+ export type ColorScheme = "dark" | "light";
2
+ export interface ValueObject {
3
+ [themeName: string]: string;
4
+ }
5
+
6
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,YAAY,cAAc,SAAS;AAEnC,iBAAiB,YAAY",
3
+ "names": [],
4
+ "sources": [
5
+ "src/types.tsx"
6
+ ],
7
+ "sourcesContent": [
8
+ "export type ColorScheme = 'dark' | 'light'\n\nexport interface ValueObject {\n [themeName: string]: string\n}\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import type { ColorScheme } from "./types";
3
+ export declare const useRootTheme: ({ fallback }?: {
4
+ fallback?: ColorScheme;
5
+ }) => [ColorScheme, React.Dispatch<React.SetStateAction<ColorScheme>>];
6
+
7
+ //# sourceMappingURL=useRootTheme.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,OAAO,WAAW;AAGlB,cAAc,mBAAmB;AAEjC,OAAO,cAAM,eAAgB,EAC3B,aACC;CAAE,WAAW;OACd,aACA,MAAM,SAAS,MAAM,eAAe",
3
+ "names": [],
4
+ "sources": [
5
+ "src/useRootTheme.tsx"
6
+ ],
7
+ "sourcesContent": [
8
+ "import React from 'react'\nimport { isClient } from '@tamagui/constants'\n\nimport type { ColorScheme } from './types'\n\nexport const useRootTheme = ({\n fallback = 'light',\n}: { fallback?: ColorScheme } = {}): [\n ColorScheme,\n React.Dispatch<React.SetStateAction<ColorScheme>>,\n] => {\n let initialVal = fallback\n\n if (isClient) {\n // @ts-ignore\n const classes = [...document.documentElement.classList]\n initialVal = classes.includes(`t_dark`)\n ? 'dark'\n : classes.includes(`t_light`)\n ? 'light'\n : fallback\n }\n\n return React.useState<ColorScheme>(initialVal)\n}\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,8 @@
1
+ import type { UseThemeProps } from "./UseThemeProps";
2
+ /**
3
+ * @deprecated renamed to `useThemeSetting` to avoid confusion with core `useTheme` hook
4
+ */
5
+ export declare const useTheme: () => UseThemeProps;
6
+ export declare const useThemeSetting: () => UseThemeProps;
7
+
8
+ //# sourceMappingURL=useTheme.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAGA,cAAc,qBAAqB;;;;AAMnC,OAAO,cAAM,gBAAe;AAE5B,OAAO,cAAM,uBAAsB",
3
+ "names": [],
4
+ "sources": [
5
+ "src/useTheme.tsx"
6
+ ],
7
+ "sourcesContent": [
8
+ "import React from 'react'\n\nimport { ThemeSettingContext } from './ThemeSettingContext'\nimport type { UseThemeProps } from './UseThemeProps'\n\n/**\n * @deprecated renamed to `useThemeSetting` to avoid confusion with core `useTheme` hook\n */\n\nexport const useTheme = (): UseThemeProps => React.useContext(ThemeSettingContext)\n\nexport const useThemeSetting = (): UseThemeProps => React.useContext(ThemeSettingContext)\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -1,34 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from == "object" || typeof from == "function")
8
- for (let key of __getOwnPropNames(from))
9
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- return to;
11
- }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
12
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
13
- var NextTheme_exports = {};
14
- module.exports = __toCommonJS(NextTheme_exports);
15
- __reExport(NextTheme_exports, require("./NextThemeProvider"), module.exports);
16
- __reExport(NextTheme_exports, require("./ThemeSettingContext"), module.exports);
17
- __reExport(NextTheme_exports, require("./UseThemeProps"), module.exports);
18
- __reExport(NextTheme_exports, require("./helpers"), module.exports);
19
- __reExport(NextTheme_exports, require("./constants"), module.exports);
20
- __reExport(NextTheme_exports, require("./useTheme"), module.exports);
21
- __reExport(NextTheme_exports, require("./types"), module.exports);
22
- __reExport(NextTheme_exports, require("./useRootTheme"), module.exports);
23
- // Annotate the CommonJS export names for ESM import in node:
24
- 0 && (module.exports = {
25
- ...require("./NextThemeProvider"),
26
- ...require("./ThemeSettingContext"),
27
- ...require("./UseThemeProps"),
28
- ...require("./helpers"),
29
- ...require("./constants"),
30
- ...require("./useTheme"),
31
- ...require("./types"),
32
- ...require("./useRootTheme")
33
- });
34
- //# sourceMappingURL=NextTheme.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/NextTheme.tsx"],
4
- "mappings": ";;;;;;;;;;;;AAAA;AAAA;AAEA,8BAAc,gCAFd;AAGA,8BAAc,kCAHd;AAIA,8BAAc,4BAJd;AAKA,8BAAc,sBALd;AAMA,8BAAc,wBANd;AAOA,8BAAc,uBAPd;AAQA,8BAAc,oBARd;AASA,8BAAc,2BATd;",
5
- "names": []
6
- }