@tamagui/next-theme 2.7.7 → 3.0.0-beta.643.1

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 (41) hide show
  1. package/dist/cjs/NextTheme.cjs +10 -11
  2. package/dist/cjs/NextThemeProvider.cjs +182 -201
  3. package/dist/cjs/ThemeSettingContext.cjs +18 -21
  4. package/dist/cjs/UseThemeProps.cjs +10 -11
  5. package/dist/cjs/constants.cjs +17 -18
  6. package/dist/cjs/helpers.cjs +30 -31
  7. package/dist/cjs/index.cjs +10 -11
  8. package/dist/cjs/types.cjs +10 -11
  9. package/dist/cjs/useRootTheme.cjs +22 -27
  10. package/dist/cjs/useTheme.cjs +15 -20
  11. package/dist/esm/NextTheme.mjs +15 -9
  12. package/dist/esm/NextThemeProvider.mjs +166 -175
  13. package/dist/esm/NextThemeProvider.mjs.map +1 -1
  14. package/dist/esm/ThemeSettingContext.mjs +5 -3
  15. package/dist/esm/ThemeSettingContext.mjs.map +1 -1
  16. package/dist/esm/UseThemeProps.mjs +0 -2
  17. package/dist/esm/constants.mjs +1 -0
  18. package/dist/esm/constants.mjs.map +1 -1
  19. package/dist/esm/helpers.mjs +15 -13
  20. package/dist/esm/helpers.mjs.map +1 -1
  21. package/dist/esm/index.js +3 -3
  22. package/dist/esm/index.mjs +3 -3
  23. package/dist/esm/types.mjs +0 -2
  24. package/dist/esm/useRootTheme.mjs +9 -9
  25. package/dist/esm/useRootTheme.mjs.map +1 -1
  26. package/dist/esm/useTheme.mjs +3 -2
  27. package/dist/esm/useTheme.mjs.map +1 -1
  28. package/package.json +5 -5
  29. package/src/NextThemeProvider.tsx +0 -1
  30. package/src/UseThemeProps.tsx +0 -2
  31. package/src/useTheme.tsx +0 -6
  32. package/types/NextThemeProvider.d.ts.map +1 -1
  33. package/types/UseThemeProps.d.ts +0 -2
  34. package/types/UseThemeProps.d.ts.map +2 -2
  35. package/types/useTheme.d.ts +0 -4
  36. package/types/useTheme.d.ts.map +2 -2
  37. package/dist/esm/NextTheme.mjs.map +0 -1
  38. package/dist/esm/UseThemeProps.mjs.map +0 -1
  39. package/dist/esm/index.js.map +0 -1
  40. package/dist/esm/index.mjs.map +0 -1
  41. package/dist/esm/types.mjs.map +0 -1
@@ -1,20 +1,19 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
- get: () => from[key],
9
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
- });
11
- }
12
- return to;
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
9
+ get: () => from[key],
10
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
+ });
12
+ }
13
+ return to;
13
14
  };
14
15
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: true
17
- }), mod);
16
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
17
  var NextTheme_exports = {};
19
18
  module.exports = __toCommonJS(NextTheme_exports);
20
19
  __reExport(NextTheme_exports, require("./NextThemeProvider.cjs"), module.exports);
@@ -24,4 +23,4 @@ __reExport(NextTheme_exports, require("./helpers.cjs"), module.exports);
24
23
  __reExport(NextTheme_exports, require("./constants.cjs"), module.exports);
25
24
  __reExport(NextTheme_exports, require("./useTheme.cjs"), module.exports);
26
25
  __reExport(NextTheme_exports, require("./types.cjs"), module.exports);
27
- __reExport(NextTheme_exports, require("./useRootTheme.cjs"), module.exports);
26
+ __reExport(NextTheme_exports, require("./useRootTheme.cjs"), module.exports);
@@ -1,3 +1,4 @@
1
+
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -5,36 +6,27 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
6
  var __getProtoOf = Object.getPrototypeOf;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: true
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
30
26
  }) : target, mod));
31
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: true
33
- }), mod);
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
28
  var NextThemeProvider_exports = {};
35
- __export(NextThemeProvider_exports, {
36
- NextThemeProvider: () => NextThemeProvider
37
- });
29
+ __export(NextThemeProvider_exports, { NextThemeProvider: () => NextThemeProvider });
38
30
  module.exports = __toCommonJS(NextThemeProvider_exports);
39
31
  var import_constants = require("@tamagui/constants");
40
32
  var import_use_event = require("@tamagui/use-event");
@@ -45,181 +37,170 @@ var import_constants2 = require("./constants.cjs");
45
37
  var import_helpers = require("./helpers.cjs");
46
38
  var import_ThemeSettingContext = require("./ThemeSettingContext.cjs");
47
39
  var import_jsx_runtime = require("react/jsx-runtime");
48
- const NextThemeProvider = (0, import_react.memo)(({
49
- forcedTheme,
50
- disableTransitionOnChange = false,
51
- enableSystem = true,
52
- enableColorScheme = true,
53
- storageKey = "theme",
54
- themes = import_constants2.colorSchemes,
55
- defaultTheme = enableSystem ? "system" : "light",
56
- attribute = "class",
57
- skipNextHead,
58
- onChangeTheme,
59
- value = {
60
- dark: "t_dark",
61
- light: "t_light"
62
- },
63
- children
64
- }) => {
65
- const [theme, setThemeState] = (0, import_react.useState)(() => (0, import_helpers.getTheme)(storageKey, defaultTheme));
66
- const [resolvedTheme, setResolvedTheme] = (0, import_react.useState)(() => (0, import_helpers.getTheme)(storageKey));
67
- const attrs = !value ? themes : Object.values(value);
68
- const handleMediaQuery = (0, import_use_event.useEvent)(e => {
69
- const _ = (0, import_helpers.getSystemTheme)(e);
70
- const update = () => setResolvedTheme(_);
71
- if (disableTransitionOnChange) {
72
- update();
73
- } else {
74
- React.startTransition(() => update());
75
- }
76
- if (theme === "system" && !forcedTheme) {
77
- handleChangeTheme(_, false);
78
- }
79
- });
80
- const handleChangeTheme = (0, import_use_event.useEvent)((theme2, updateStorage = true, updateDOM = true) => {
81
- let name = value?.[theme2] || theme2;
82
- if (updateStorage) {
83
- try {
84
- localStorage.setItem(storageKey, theme2);
85
- } catch (e) {}
86
- }
87
- if (theme2 === "system" && enableSystem) {
88
- const resolved = (0, import_helpers.getSystemTheme)();
89
- name = value?.[resolved] || resolved;
90
- }
91
- onChangeTheme?.(name.replace("t_", ""));
92
- if (updateDOM) {
93
- const d = document.documentElement;
94
- if (attribute === "class") {
95
- d.classList.remove(...attrs);
96
- d.classList.add(name);
97
- } else {
98
- d.setAttribute(attribute, name);
99
- }
100
- }
101
- });
102
- (0, import_constants.useIsomorphicLayoutEffect)(() => {
103
- const media = window.matchMedia(import_constants2.MEDIA);
104
- media.addListener(handleMediaQuery);
105
- handleMediaQuery(media);
106
- return () => {
107
- media.removeListener(handleMediaQuery);
108
- };
109
- }, []);
110
- const set = (0, import_use_event.useEvent)(newTheme => {
111
- if (forcedTheme) {
112
- return;
113
- }
114
- handleChangeTheme(newTheme);
115
- setThemeState(newTheme);
116
- });
117
- (0, import_react.useEffect)(() => {
118
- const handleStorage = e => {
119
- if (e.key !== storageKey) {
120
- return;
121
- }
122
- const theme2 = e.newValue || defaultTheme;
123
- set(theme2);
124
- };
125
- window.addEventListener("storage", handleStorage);
126
- return () => {
127
- window.removeEventListener("storage", handleStorage);
128
- };
129
- }, [defaultTheme, set, storageKey]);
130
- (0, import_constants.useIsomorphicLayoutEffect)(() => {
131
- if (!enableColorScheme) return;
132
- const colorScheme =
133
- // If theme is forced to light or dark, use that
134
- forcedTheme && import_constants2.colorSchemes.includes(forcedTheme) ? forcedTheme :
135
- // If regular theme is light or dark
136
- theme && import_constants2.colorSchemes.includes(theme) ? theme :
137
- // If theme is system, use the resolved version
138
- theme === "system" ? resolvedTheme || null : null;
139
- const userPrefers = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
140
- const wePrefer = colorScheme || "light";
141
- if (userPrefers !== wePrefer) {
142
- document.documentElement.style.setProperty("color-scheme", colorScheme);
143
- }
144
- }, [enableColorScheme, theme, resolvedTheme, forcedTheme]);
145
- const toggle = (0, import_use_event.useEvent)(() => {
146
- const order = resolvedTheme === "dark" ? ["system", "light", "dark"] : ["system", "dark", "light"];
147
- const next = order[(order.indexOf(theme) + 1) % order.length];
148
- set(next);
149
- });
150
- const systemTheme = enableSystem ? resolvedTheme : void 0;
151
- const contextValue = (0, import_react.useMemo)(() => {
152
- const value2 = {
153
- theme,
154
- current: theme,
155
- set,
156
- toggle,
157
- forcedTheme,
158
- resolvedTheme: theme === "system" ? resolvedTheme : theme,
159
- themes: enableSystem ? [...themes, "system"] : themes,
160
- systemTheme
161
- };
162
- return value2;
163
- }, [theme, set, toggle, forcedTheme, resolvedTheme, enableSystem, themes, systemTheme]);
164
- return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_ThemeSettingContext.ThemeSettingContext.Provider, {
165
- value: contextValue,
166
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(ThemeScript, {
167
- ...{
168
- forcedTheme,
169
- storageKey,
170
- systemTheme: resolvedTheme,
171
- attribute,
172
- value,
173
- enableSystem,
174
- defaultTheme,
175
- attrs,
176
- skipNextHead
177
- }
178
- }), children]
179
- });
40
+ const NextThemeProvider = (0, import_react.memo)(({ forcedTheme, disableTransitionOnChange = false, enableSystem = true, enableColorScheme = true, storageKey = "theme", themes = import_constants2.colorSchemes, defaultTheme = enableSystem ? "system" : "light", attribute = "class", skipNextHead, onChangeTheme, value = {
41
+ dark: "t_dark",
42
+ light: "t_light"
43
+ }, children }) => {
44
+ const [theme, setThemeState] = (0, import_react.useState)(() => (0, import_helpers.getTheme)(storageKey, defaultTheme));
45
+ const [resolvedTheme, setResolvedTheme] = (0, import_react.useState)(() => (0, import_helpers.getTheme)(storageKey));
46
+ const attrs = !value ? themes : Object.values(value);
47
+ const handleMediaQuery = (0, import_use_event.useEvent)((e) => {
48
+ const _ = (0, import_helpers.getSystemTheme)(e);
49
+ const update = () => setResolvedTheme(_);
50
+ if (disableTransitionOnChange) {
51
+ update();
52
+ } else {
53
+ React.startTransition(() => update());
54
+ }
55
+ if (theme === "system" && !forcedTheme) {
56
+ handleChangeTheme(_, false);
57
+ }
58
+ });
59
+ const handleChangeTheme = (0, import_use_event.useEvent)((theme2, updateStorage = true, updateDOM = true) => {
60
+ let name = value?.[theme2] || theme2;
61
+ if (updateStorage) {
62
+ try {
63
+ localStorage.setItem(storageKey, theme2);
64
+ } catch (e) {}
65
+ }
66
+ if (theme2 === "system" && enableSystem) {
67
+ const resolved = (0, import_helpers.getSystemTheme)();
68
+ name = value?.[resolved] || resolved;
69
+ }
70
+ onChangeTheme?.(name.replace("t_", ""));
71
+ if (updateDOM) {
72
+ const d = document.documentElement;
73
+ if (attribute === "class") {
74
+ d.classList.remove(...attrs);
75
+ d.classList.add(name);
76
+ } else {
77
+ d.setAttribute(attribute, name);
78
+ }
79
+ }
80
+ });
81
+ (0, import_constants.useIsomorphicLayoutEffect)(() => {
82
+ const media = window.matchMedia(import_constants2.MEDIA);
83
+ media.addListener(handleMediaQuery);
84
+ handleMediaQuery(media);
85
+ return () => {
86
+ media.removeListener(handleMediaQuery);
87
+ };
88
+ }, []);
89
+ const set = (0, import_use_event.useEvent)((newTheme) => {
90
+ if (forcedTheme) {
91
+ return;
92
+ }
93
+ handleChangeTheme(newTheme);
94
+ setThemeState(newTheme);
95
+ });
96
+ (0, import_react.useEffect)(() => {
97
+ const handleStorage = (e) => {
98
+ if (e.key !== storageKey) {
99
+ return;
100
+ }
101
+ const theme2 = e.newValue || defaultTheme;
102
+ set(theme2);
103
+ };
104
+ window.addEventListener("storage", handleStorage);
105
+ return () => {
106
+ window.removeEventListener("storage", handleStorage);
107
+ };
108
+ }, [
109
+ defaultTheme,
110
+ set,
111
+ storageKey
112
+ ]);
113
+ (0, import_constants.useIsomorphicLayoutEffect)(() => {
114
+ if (!enableColorScheme) return;
115
+ const colorScheme = forcedTheme && import_constants2.colorSchemes.includes(forcedTheme) ? forcedTheme : theme && import_constants2.colorSchemes.includes(theme) ? theme : theme === "system" ? resolvedTheme || null : null;
116
+ const userPrefers = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
117
+ const wePrefer = colorScheme || "light";
118
+ if (userPrefers !== wePrefer) {
119
+ document.documentElement.style.setProperty("color-scheme", colorScheme);
120
+ }
121
+ }, [
122
+ enableColorScheme,
123
+ theme,
124
+ resolvedTheme,
125
+ forcedTheme
126
+ ]);
127
+ const toggle = (0, import_use_event.useEvent)(() => {
128
+ const order = resolvedTheme === "dark" ? [
129
+ "system",
130
+ "light",
131
+ "dark"
132
+ ] : [
133
+ "system",
134
+ "dark",
135
+ "light"
136
+ ];
137
+ const next = order[(order.indexOf(theme) + 1) % order.length];
138
+ set(next);
139
+ });
140
+ const systemTheme = enableSystem ? resolvedTheme : void 0;
141
+ const contextValue = (0, import_react.useMemo)(() => {
142
+ const value2 = {
143
+ current: theme,
144
+ set,
145
+ toggle,
146
+ forcedTheme,
147
+ resolvedTheme: theme === "system" ? resolvedTheme : theme,
148
+ themes: enableSystem ? [...themes, "system"] : themes,
149
+ systemTheme
150
+ };
151
+ return value2;
152
+ }, [
153
+ theme,
154
+ set,
155
+ toggle,
156
+ forcedTheme,
157
+ resolvedTheme,
158
+ enableSystem,
159
+ themes,
160
+ systemTheme
161
+ ]);
162
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ThemeSettingContext.ThemeSettingContext.Provider, {
163
+ value: contextValue,
164
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeScript, { ...{
165
+ forcedTheme,
166
+ storageKey,
167
+ systemTheme: resolvedTheme,
168
+ attribute,
169
+ value,
170
+ enableSystem,
171
+ defaultTheme,
172
+ attrs,
173
+ skipNextHead
174
+ } }), children]
175
+ });
180
176
  });
181
- const ThemeScript = (0, import_react.memo)(({
182
- forcedTheme,
183
- storageKey,
184
- attribute,
185
- enableSystem,
186
- defaultTheme,
187
- value,
188
- attrs,
189
- skipNextHead
190
- }) => {
191
- const optimization = (() => {
192
- if (attribute === "class") {
193
- const removeClasses = attrs.map(t => `d.remove('${t}')`).join(";");
194
- return `var d=document.documentElement.classList;${removeClasses};`;
195
- }
196
- return `var d=document.documentElement;`;
197
- })();
198
- const updateDOM = (name, literal) => {
199
- name = value?.[name] || name;
200
- const val = literal ? name : `'${name}'`;
201
- if (attribute === "class") {
202
- return `d.add(${val})`;
203
- }
204
- return `d.setAttribute('${attribute}', ${val})`;
205
- };
206
- const defaultSystem = defaultTheme === "system";
207
- const scriptContent = forcedTheme ? `!function(){${optimization}${updateDOM(forcedTheme)}}()` : enableSystem ? `!function(){try {${optimization}var e=localStorage.getItem('${storageKey}');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", true)}}${!defaultSystem ? `else{${updateDOM(defaultTheme)}}` : ""}}catch(e){}}()` : `!function(){try{${optimization}var e=localStorage.getItem("${storageKey}");if(e){${value ? `var x=${JSON.stringify(value)};` : ""}${updateDOM(value ? "x[e]" : "e", true)}}else{${updateDOM(defaultTheme)};}}catch(t){}}();`;
208
- if (skipNextHead) {
209
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)("script", {
210
- dangerouslySetInnerHTML: {
211
- __html: scriptContent
212
- }
213
- }, "next-themes-script");
214
- }
215
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_script.default, {
216
- id: "next-themes-script",
217
- strategy: "beforeInteractive",
218
- dangerouslySetInnerHTML: {
219
- __html: scriptContent
220
- }
221
- });
177
+ const ThemeScript = (0, import_react.memo)(({ forcedTheme, storageKey, attribute, enableSystem, defaultTheme, value, attrs, skipNextHead }) => {
178
+ const optimization = (() => {
179
+ if (attribute === "class") {
180
+ const removeClasses = attrs.map((t) => `d.remove('${t}')`).join(";");
181
+ return `var d=document.documentElement.classList;${removeClasses};`;
182
+ }
183
+ return `var d=document.documentElement;`;
184
+ })();
185
+ const updateDOM = (name, literal) => {
186
+ name = value?.[name] || name;
187
+ const val = literal ? name : `'${name}'`;
188
+ if (attribute === "class") {
189
+ return `d.add(${val})`;
190
+ }
191
+ return `d.setAttribute('${attribute}', ${val})`;
192
+ };
193
+ const defaultSystem = defaultTheme === "system";
194
+ const scriptContent = forcedTheme ? `!function(){${optimization}${updateDOM(forcedTheme)}}()` : enableSystem ? `!function(){try {${optimization}var e=localStorage.getItem('${storageKey}');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", true)}}${!defaultSystem ? `else{${updateDOM(defaultTheme)}}` : ""}}catch(e){}}()` : `!function(){try{${optimization}var e=localStorage.getItem("${storageKey}");if(e){${value ? `var x=${JSON.stringify(value)};` : ""}${updateDOM(value ? "x[e]" : "e", true)}}else{${updateDOM(defaultTheme)};}}catch(t){}}();`;
195
+ if (skipNextHead) {
196
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("script", { dangerouslySetInnerHTML: { __html: scriptContent } }, "next-themes-script");
197
+ }
198
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_script.default, {
199
+ id: "next-themes-script",
200
+ strategy: "beforeInteractive",
201
+ dangerouslySetInnerHTML: { __html: scriptContent }
202
+ });
222
203
  }, (prevProps, nextProps) => {
223
- if (prevProps.forcedTheme !== nextProps.forcedTheme) return false;
224
- return true;
225
- });
204
+ if (prevProps.forcedTheme !== nextProps.forcedTheme) return false;
205
+ return true;
206
+ });
@@ -1,33 +1,30 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
10
11
  };
11
12
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
19
20
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
22
  var ThemeSettingContext_exports = {};
24
- __export(ThemeSettingContext_exports, {
25
- ThemeSettingContext: () => ThemeSettingContext
26
- });
23
+ __export(ThemeSettingContext_exports, { ThemeSettingContext: () => ThemeSettingContext });
27
24
  module.exports = __toCommonJS(ThemeSettingContext_exports);
28
25
  var import_react = require("react");
29
26
  const ThemeSettingContext = (0, import_react.createContext)({
30
- toggle: () => {},
31
- set: _ => {},
32
- themes: []
33
- });
27
+ toggle: () => {},
28
+ set: (_) => {},
29
+ themes: []
30
+ });
@@ -1,18 +1,17 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
- get: () => from[key],
9
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
- });
11
- }
12
- return to;
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
9
+ get: () => from[key],
10
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
+ });
12
+ }
13
+ return to;
13
14
  };
14
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
15
- value: true
16
- }), mod);
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
17
16
  var UseThemeProps_exports = {};
18
- module.exports = __toCommonJS(UseThemeProps_exports);
17
+ module.exports = __toCommonJS(UseThemeProps_exports);
@@ -1,32 +1,31 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
10
11
  };
11
12
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
19
20
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
22
  var constants_exports = {};
24
23
  __export(constants_exports, {
25
- MEDIA: () => MEDIA,
26
- colorSchemes: () => colorSchemes,
27
- constants: () => constants
24
+ MEDIA: () => MEDIA,
25
+ colorSchemes: () => colorSchemes,
26
+ constants: () => constants
28
27
  });
29
28
  module.exports = __toCommonJS(constants_exports);
30
29
  const constants = {};
31
30
  const colorSchemes = ["light", "dark"];
32
- const MEDIA = "(prefers-color-scheme: dark)";
31
+ const MEDIA = "(prefers-color-scheme: dark)";