@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
@@ -1,215 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: !0 });
10
- }, __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from == "object" || typeof from == "function")
12
- for (let key of __getOwnPropNames(from))
13
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
- mod
23
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
- var NextThemeProvider_exports = {};
25
- __export(NextThemeProvider_exports, {
26
- NextThemeProvider: () => NextThemeProvider
27
- });
28
- module.exports = __toCommonJS(NextThemeProvider_exports);
29
- var import_jsx_runtime = require("react/jsx-runtime"), 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"), NextThemeProvider = /* @__PURE__ */ (0, import_react.memo)(function(param) {
30
- var { forcedTheme, disableTransitionOnChange = !1, enableSystem = !0, enableColorScheme = !0, storageKey = "theme", themes = import_constants2.colorSchemes, defaultTheme = enableSystem ? "system" : "light", attribute = "class", skipNextHead, onChangeTheme, value = {
31
- dark: "t_dark",
32
- light: "t_light"
33
- }, children } = param, [theme, setThemeState] = (0, import_react.useState)(function() {
34
- return (0, import_helpers.getTheme)(storageKey, defaultTheme);
35
- }), [resolvedTheme, setResolvedTheme] = (0, import_react.useState)(function() {
36
- return (0, import_helpers.getTheme)(storageKey);
37
- }), attrs = value ? Object.values(value) : themes, handleMediaQuery = (0, import_use_event.useEvent)(function(e) {
38
- var _ = (0, import_helpers.getSystemTheme)(e), update = function() {
39
- return setResolvedTheme(_);
40
- };
41
- disableTransitionOnChange ? update() : React.startTransition(function() {
42
- return update();
43
- }), theme === "system" && !forcedTheme && handleChangeTheme(_, !1);
44
- }), handleChangeTheme = (0, import_use_event.useEvent)(function(theme2) {
45
- var updateStorage = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, updateDOM = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, name = (value == null ? void 0 : value[theme2]) || theme2;
46
- if (updateStorage)
47
- try {
48
- localStorage.setItem(storageKey, theme2);
49
- } catch {
50
- }
51
- if (theme2 === "system" && enableSystem) {
52
- var resolved = (0, import_helpers.getSystemTheme)();
53
- name = (value == null ? void 0 : value[resolved]) || resolved;
54
- }
55
- if (onChangeTheme == null || onChangeTheme(name.replace("t_", "")), updateDOM) {
56
- var d = document.documentElement;
57
- attribute === "class" ? (d.classList.remove(...attrs), d.classList.add(name)) : d.setAttribute(attribute, name);
58
- }
59
- });
60
- (0, import_constants.useIsomorphicLayoutEffect)(function() {
61
- var media = window.matchMedia(import_constants2.MEDIA);
62
- return media.addListener(handleMediaQuery), handleMediaQuery(media), function() {
63
- media.removeListener(handleMediaQuery);
64
- };
65
- }, []);
66
- var set = (0, import_use_event.useEvent)(function(newTheme) {
67
- forcedTheme ? handleChangeTheme(newTheme, !0, !1) : handleChangeTheme(newTheme), setThemeState(newTheme);
68
- });
69
- (0, import_react.useEffect)(function() {
70
- var handleStorage = function(e) {
71
- if (e.key === storageKey) {
72
- var theme2 = e.newValue || defaultTheme;
73
- set(theme2);
74
- }
75
- };
76
- return window.addEventListener("storage", handleStorage), function() {
77
- window.removeEventListener("storage", handleStorage);
78
- };
79
- }, [
80
- defaultTheme,
81
- set,
82
- storageKey
83
- ]), (0, import_constants.useIsomorphicLayoutEffect)(function() {
84
- if (enableColorScheme) {
85
- var colorScheme = (
86
- // If theme is forced to light or dark, use that
87
- forcedTheme && import_constants2.colorSchemes.includes(forcedTheme) ? forcedTheme : (
88
- // If regular theme is light or dark
89
- theme && import_constants2.colorSchemes.includes(theme) ? theme : (
90
- // If theme is system, use the resolved version
91
- theme === "system" && resolvedTheme || null
92
- )
93
- )
94
- ), userPrefers = typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", wePrefer = colorScheme || "light";
95
- userPrefers !== wePrefer && document.documentElement.style.setProperty("color-scheme", colorScheme);
96
- }
97
- }, [
98
- enableColorScheme,
99
- theme,
100
- resolvedTheme,
101
- forcedTheme
102
- ]);
103
- var toggle = (0, import_use_event.useEvent)(function() {
104
- var order = resolvedTheme === "dark" ? [
105
- "system",
106
- "light",
107
- "dark"
108
- ] : [
109
- "system",
110
- "dark",
111
- "light"
112
- ], next = order[(order.indexOf(theme) + 1) % order.length];
113
- set(next);
114
- }), systemTheme = enableSystem ? resolvedTheme : void 0, contextValue = (0, import_react.useMemo)(function() {
115
- var value2 = {
116
- theme,
117
- current: theme,
118
- set,
119
- toggle,
120
- forcedTheme,
121
- resolvedTheme: theme === "system" ? resolvedTheme : theme,
122
- themes: enableSystem ? [
123
- ...themes,
124
- "system"
125
- ] : themes,
126
- systemTheme
127
- };
128
- return value2;
129
- }, [
130
- theme,
131
- set,
132
- toggle,
133
- forcedTheme,
134
- resolvedTheme,
135
- enableSystem,
136
- themes,
137
- systemTheme
138
- ]);
139
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ThemeSettingContext.ThemeSettingContext.Provider, {
140
- value: contextValue,
141
- children: [
142
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeScript, {
143
- forcedTheme,
144
- storageKey,
145
- systemTheme: resolvedTheme,
146
- attribute,
147
- value,
148
- enableSystem,
149
- defaultTheme,
150
- attrs,
151
- skipNextHead
152
- }),
153
- /* because on SSR we re-run and can avoid whole tree re-render */
154
- (0, import_react.useMemo)(function() {
155
- return children;
156
- }, [
157
- children
158
- ])
159
- ]
160
- });
161
- }), ThemeScript = /* @__PURE__ */ (0, import_react.memo)(function(param) {
162
- var { forcedTheme, storageKey, attribute, enableSystem, defaultTheme, value, attrs, skipNextHead } = param, optimization = function() {
163
- if (attribute === "class") {
164
- var removeClasses = attrs.map(function(t) {
165
- return `d.remove('${t}')`;
166
- }).join(";");
167
- return `var d=document.documentElement.classList;${removeClasses};`;
168
- }
169
- return "var d=document.documentElement;";
170
- }(), updateDOM = function(name, literal) {
171
- name = (value == null ? void 0 : value[name]) || name;
172
- var val = literal ? name : `'${name}'`;
173
- return attribute === "class" ? `d.add(${val})` : `d.setAttribute('${attribute}', ${val})`;
174
- }, defaultSystem = defaultTheme === "system", contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
175
- children: forcedTheme ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
176
- "script",
177
- {
178
- dangerouslySetInnerHTML: {
179
- // These are minified via Terser and then updated by hand, don't recommend
180
- __html: `!function(){${optimization}${updateDOM(forcedTheme)}}()`
181
- }
182
- },
183
- // nonce={nonce}
184
- "next-themes-script"
185
- ) : enableSystem ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
186
- "script",
187
- {
188
- dangerouslySetInnerHTML: {
189
- __html: `!function(){try {${optimization}var e=localStorage.getItem('${storageKey}');${defaultSystem ? "" : updateDOM(defaultTheme) + ";"}if("system"===e||(!e&&${defaultSystem})){var t="${import_constants2.MEDIA}",m=window.matchMedia(t);m.media!==t||m.matches?${updateDOM("dark")}:${updateDOM("light")}}else if(e) ${value ? `var x=${JSON.stringify(value)};` : ""}${updateDOM(value ? "x[e]" : "e", !0)}}catch(e){}}()`
190
- }
191
- },
192
- // nonce={nonce}
193
- "next-themes-script"
194
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
195
- "script",
196
- {
197
- dangerouslySetInnerHTML: {
198
- __html: `!function(){try{${optimization}var e=localStorage.getItem("${storageKey}");if(e){${value ? `var x=${JSON.stringify(value)};` : ""}${updateDOM(value ? "x[e]" : "e", !0)}}else{${updateDOM(defaultTheme)};}}catch(t){}}();`
199
- }
200
- },
201
- // nonce={nonce}
202
- "next-themes-script"
203
- )
204
- });
205
- return skipNextHead ? contents : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_head.default, {
206
- children: contents
207
- });
208
- }, function(prevProps, nextProps) {
209
- return prevProps.forcedTheme === nextProps.forcedTheme;
210
- });
211
- // Annotate the CommonJS export names for ESM import in node:
212
- 0 && (module.exports = {
213
- NextThemeProvider
214
- });
215
- //# sourceMappingURL=NextThemeProvider.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/NextThemeProvider.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAkE,8BAClE,mBAA0C,+BAC1C,mBAAyB,+BACzB,cAAqB,+BACrB,QAAuB,2BACvB,eAAmD,kBACnDA,oBAAoC,wBACpC,iBAAyC,sBACzC,6BAAoC,kCACzB,oBAAkC,uCAAK,SAAS,OAAO;AAC9D,MAAI,EAAE,aAAa,4BAA4B,IAAO,eAAe,IAAM,oBAAoB,IAAM,aAAa,SAAS,SAAS,gCAAc,eAAe,eAAe,WAAW,SAAS,YAAY,SAAS,cAAc,eAAe,QAAQ;AAAA,IAC1P,MAAM;AAAA,IACN,OAAO;AAAA,EACX,GAAG,SAAS,IAAI,OACZ,CAAC,OAAO,aAAa,QAAI,uBAAS,WAAW;AAC7C,eAAO,yBAAS,YAAY,YAAY;AAAA,EAC5C,CAAC,GACG,CAAC,eAAe,gBAAgB,QA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
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: !0 });
10
- }, __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from == "object" || typeof from == "function")
12
- for (let key of __getOwnPropNames(from))
13
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
- mod
23
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
- var ThemeSettingContext_exports = {};
25
- __export(ThemeSettingContext_exports, {
26
- ThemeSettingContext: () => ThemeSettingContext
27
- });
28
- module.exports = __toCommonJS(ThemeSettingContext_exports);
29
- var import_react = __toESM(require("react")), ThemeSettingContext = /* @__PURE__ */ import_react.default.createContext({
30
- toggle: function() {
31
- },
32
- set: function(_) {
33
- },
34
- themes: []
35
- });
36
- // Annotate the CommonJS export names for ESM import in node:
37
- 0 && (module.exports = {
38
- ThemeSettingContext
39
- });
40
- //# sourceMappingURL=ThemeSettingContext.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/ThemeSettingContext.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,2BACP,sBAAoC,6BAAAA,QAAM,cAAc;AAAA,EAC/D,QAAQ,WAAW;AAAA,EAAC;AAAA,EACpB,KAAK,SAAS,GAAG;AAAA,EAAC;AAAA,EAClB,QAAQ,CAAC;AACb,CAAC;",
5
- "names": ["React"]
6
- }
@@ -1,15 +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
- };
12
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
13
- var UseThemeProps_exports = {};
14
- module.exports = __toCommonJS(UseThemeProps_exports);
15
- //# sourceMappingURL=UseThemeProps.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/UseThemeProps.tsx"],
4
- "mappings": ";;;;;;;;;;;;AAAA;AAAA;",
5
- "names": []
6
- }
@@ -1,33 +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 __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
- var constants_exports = {};
17
- __export(constants_exports, {
18
- MEDIA: () => MEDIA,
19
- colorSchemes: () => colorSchemes,
20
- constants: () => constants
21
- });
22
- module.exports = __toCommonJS(constants_exports);
23
- var constants = {}, colorSchemes = [
24
- "light",
25
- "dark"
26
- ], MEDIA = "(prefers-color-scheme: dark)";
27
- // Annotate the CommonJS export names for ESM import in node:
28
- 0 && (module.exports = {
29
- MEDIA,
30
- colorSchemes,
31
- constants
32
- });
33
- //# sourceMappingURL=constants.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/constants.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAI,YAAY,CAAC,GACb,eAAe;AAAA,EACtB;AAAA,EACA;AACJ,GACW,QAAQ;",
5
- "names": []
6
- }
@@ -1,43 +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 __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
- var helpers_exports = {};
17
- __export(helpers_exports, {
18
- getSystemTheme: () => getSystemTheme,
19
- getTheme: () => getTheme,
20
- helpers: () => helpers
21
- });
22
- module.exports = __toCommonJS(helpers_exports);
23
- var import_constants = require("./constants"), helpers = {}, getTheme = function(key, fallback) {
24
- if (!(typeof window > "u")) {
25
- var theme;
26
- try {
27
- theme = localStorage.getItem(key) || void 0;
28
- } catch {
29
- }
30
- return theme || fallback;
31
- }
32
- }, getSystemTheme = function(e) {
33
- e || (e = window.matchMedia(import_constants.MEDIA));
34
- var isDark = e.matches, systemTheme = isDark ? "dark" : "light";
35
- return systemTheme;
36
- };
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- getSystemTheme,
40
- getTheme,
41
- helpers
42
- });
43
- //# sourceMappingURL=helpers.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/helpers.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB,wBACX,UAAU,CAAC,GAEX,WAAW,SAAS,KAAK,UAAU;AAC1C,MAAI,SAAO,SAAW,MACtB;AAAA,QAAI;AACJ,QAAI;AACA,cAAQ,aAAa,QAAQ,GAAG,KAAK;AAAA,IACzC,QAAY;AAAA,IAAC;AAEb,WAAO,SAAS;AAAA;AACpB,GACW,iBAAiB,SAAS,GAAG;AACpC,EAAK,MACD,IAAI,OAAO,WAAW,sBAAK;AAE/B,MAAI,SAAS,EAAE,SACX,cAAc,SAAS,SAAS;AACpC,SAAO;AACX;",
5
- "names": []
6
- }
@@ -1,22 +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 index_exports = {};
14
- module.exports = __toCommonJS(index_exports);
15
- __reExport(index_exports, require("./NextTheme"), module.exports);
16
- __reExport(index_exports, require("./types"), module.exports);
17
- // Annotate the CommonJS export names for ESM import in node:
18
- 0 && (module.exports = {
19
- ...require("./NextTheme"),
20
- ...require("./types")
21
- });
22
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,wBAAd;AACA,0BAAc,oBADd;",
5
- "names": []
6
- }
@@ -1,15 +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
- };
12
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
13
- var types_exports = {};
14
- module.exports = __toCommonJS(types_exports);
15
- //# sourceMappingURL=types.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/types.tsx"],
4
- "mappings": ";;;;;;;;;;;;AAAA;AAAA;",
5
- "names": []
6
- }
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: !0 });
10
- }, __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from == "object" || typeof from == "function")
12
- for (let key of __getOwnPropNames(from))
13
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
- mod
23
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
- var useRootTheme_exports = {};
25
- __export(useRootTheme_exports, {
26
- useRootTheme: () => useRootTheme
27
- });
28
- module.exports = __toCommonJS(useRootTheme_exports);
29
- var import_react = __toESM(require("react")), import_constants = require("@tamagui/constants"), useRootTheme = function() {
30
- var { fallback = "light" } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, initialVal = fallback;
31
- if (import_constants.isClient) {
32
- var classes = [
33
- ...document.documentElement.classList
34
- ];
35
- initialVal = classes.includes("t_dark") ? "dark" : classes.includes("t_light") ? "light" : fallback;
36
- }
37
- return import_react.default.useState(initialVal);
38
- };
39
- // Annotate the CommonJS export names for ESM import in node:
40
- 0 && (module.exports = {
41
- useRootTheme
42
- });
43
- //# sourceMappingURL=useRootTheme.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/useRootTheme.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,2BAClB,mBAAyB,+BACd,eAAe,WAAW;AACjC,MAAI,EAAE,WAAW,QAAQ,IAAI,UAAU,SAAS,KAAK,UAAU,CAAC,MAAM,SAAS,UAAU,CAAC,IAAI,CAAC,GAC3F,aAAa;AACjB,MAAI,2BAAU;AAEV,QAAI,UAAU;AAAA,MACV,GAAG,SAAS,gBAAgB;AAAA,IAChC;AACA,iBAAa,QAAQ,SAAS,QAAQ,IAAI,SAAS,QAAQ,SAAS,SAAS,IAAI,UAAU;AAAA,EAC/F;AACA,SAAO,aAAAA,QAAM,SAAS,UAAU;AACpC;",
5
- "names": ["React"]
6
- }
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: !0 });
10
- }, __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from == "object" || typeof from == "function")
12
- for (let key of __getOwnPropNames(from))
13
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
- mod
23
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
- var useTheme_exports = {};
25
- __export(useTheme_exports, {
26
- useTheme: () => useTheme,
27
- useThemeSetting: () => useThemeSetting
28
- });
29
- module.exports = __toCommonJS(useTheme_exports);
30
- var import_react = __toESM(require("react")), import_ThemeSettingContext = require("./ThemeSettingContext"), useTheme = function() {
31
- return import_react.default.useContext(import_ThemeSettingContext.ThemeSettingContext);
32
- }, useThemeSetting = function() {
33
- return import_react.default.useContext(import_ThemeSettingContext.ThemeSettingContext);
34
- };
35
- // Annotate the CommonJS export names for ESM import in node:
36
- 0 && (module.exports = {
37
- useTheme,
38
- useThemeSetting
39
- });
40
- //# sourceMappingURL=useTheme.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/useTheme.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,2BAClB,6BAAoC,kCAGrB,WAAW,WAAW;AACjC,SAAO,aAAAA,QAAM,WAAW,8CAAmB;AAC/C,GACW,kBAAkB,WAAW;AACpC,SAAO,aAAAA,QAAM,WAAW,8CAAmB;AAC/C;",
5
- "names": ["React"]
6
- }
@@ -1,9 +0,0 @@
1
- export * from "./NextThemeProvider.native.js";
2
- export * from "./ThemeSettingContext.native.js";
3
- export * from "./UseThemeProps.native.js";
4
- export * from "./helpers.native.js";
5
- export * from "./constants.native.js";
6
- export * from "./useTheme.native.js";
7
- export * from "./types.native.js";
8
- export * from "./useRootTheme.native.js";
9
- //# sourceMappingURL=NextTheme.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/NextTheme.tsx"],"sourcesContent":[null],"mappings":"AAGA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}