@tamagui/next-theme 2.0.0-rc.9 → 2.0.0
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.
- package/dist/cjs/NextTheme.cjs +7 -5
- package/dist/cjs/NextThemeProvider.cjs +197 -146
- package/dist/cjs/ThemeSettingContext.cjs +12 -10
- package/dist/cjs/UseThemeProps.cjs +7 -5
- package/dist/cjs/constants.cjs +15 -13
- package/dist/cjs/helpers.cjs +29 -20
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/types.cjs +7 -5
- package/dist/cjs/useRootTheme.cjs +14 -12
- package/dist/cjs/useTheme.cjs +16 -14
- package/dist/esm/NextThemeProvider.mjs +164 -115
- package/dist/esm/NextThemeProvider.mjs.map +1 -1
- package/dist/esm/constants.mjs +3 -3
- package/dist/esm/constants.mjs.map +1 -1
- package/dist/esm/helpers.mjs +17 -10
- package/dist/esm/helpers.mjs.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/useTheme.mjs +2 -2
- package/dist/esm/useTheme.mjs.map +1 -1
- package/package.json +5 -4
- package/types/NextTheme.d.ts.map +2 -2
- package/types/NextThemeProvider.d.ts.map +4 -6
- package/types/ThemeSettingContext.d.ts.map +4 -6
- package/types/UseThemeProps.d.ts.map +2 -2
- package/types/constants.d.ts.map +2 -2
- package/types/helpers.d.ts.map +2 -2
- package/types/index.d.ts.map +2 -2
- package/types/types.d.ts.map +2 -2
- package/types/useRootTheme.d.ts.map +2 -2
- package/types/useTheme.d.ts.map +2 -2
- package/dist/cjs/NextTheme.js +0 -22
- package/dist/cjs/NextTheme.js.map +0 -6
- package/dist/cjs/NextThemeProvider.js +0 -178
- package/dist/cjs/NextThemeProvider.js.map +0 -6
- package/dist/cjs/ThemeSettingContext.js +0 -28
- package/dist/cjs/ThemeSettingContext.js.map +0 -6
- package/dist/cjs/UseThemeProps.js +0 -14
- package/dist/cjs/UseThemeProps.js.map +0 -6
- package/dist/cjs/constants.js +0 -23
- package/dist/cjs/constants.js.map +0 -6
- package/dist/cjs/helpers.js +0 -32
- package/dist/cjs/helpers.js.map +0 -6
- package/dist/cjs/index.js +0 -16
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/types.js +0 -14
- package/dist/cjs/types.js.map +0 -6
- package/dist/cjs/useRootTheme.js +0 -29
- package/dist/cjs/useRootTheme.js.map +0 -6
- package/dist/cjs/useTheme.js +0 -23
- package/dist/cjs/useTheme.js.map +0 -6
- package/dist/esm/NextTheme.js +0 -9
- package/dist/esm/NextTheme.js.map +0 -6
- package/dist/esm/NextThemeProvider.js +0 -162
- package/dist/esm/NextThemeProvider.js.map +0 -6
- package/dist/esm/ThemeSettingContext.js +0 -12
- package/dist/esm/ThemeSettingContext.js.map +0 -6
- package/dist/esm/UseThemeProps.js +0 -1
- package/dist/esm/UseThemeProps.js.map +0 -6
- package/dist/esm/constants.js +0 -7
- package/dist/esm/constants.js.map +0 -6
- package/dist/esm/helpers.js +0 -16
- package/dist/esm/helpers.js.map +0 -6
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +0 -6
- package/dist/esm/useRootTheme.js +0 -14
- package/dist/esm/useRootTheme.js.map +0 -6
- package/dist/esm/useTheme.js +0 -8
- package/dist/esm/useTheme.js.map +0 -6
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/UseThemeProps.tsx"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
9
|
"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
|
|
10
|
+
]
|
|
11
11
|
}
|
package/types/constants.d.ts.map
CHANGED
package/types/helpers.d.ts.map
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/helpers.tsx"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
9
|
"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
|
|
10
|
+
]
|
|
11
11
|
}
|
package/types/index.d.ts.map
CHANGED
package/types/types.d.ts.map
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/useRootTheme.tsx"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
9
|
"import { useState, type Dispatch, type SetStateAction } from 'react'\nimport { isClient } from '@tamagui/constants'\n\nimport type { ColorScheme } from './types'\n\nexport const useRootTheme = ({ fallback = 'light' }: { fallback?: ColorScheme } = {}): [\n ColorScheme,\n Dispatch<SetStateAction<ColorScheme>>,\n] => {\n let initialVal = fallback\n\n if (isClient) {\n const classes = document.documentElement.classList\n initialVal = classes.contains('t_dark')\n ? 'dark'\n : classes.contains('t_light')\n ? 'light'\n : fallback\n }\n\n return useState<ColorScheme>(initialVal)\n}\n"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
10
|
+
]
|
|
11
11
|
}
|
package/types/useTheme.d.ts.map
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/useTheme.tsx"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
9
|
"import { useContext } 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 => useContext(ThemeSettingContext)\n\nexport const useThemeSetting = (): UseThemeProps => useContext(ThemeSettingContext)\n"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
10
|
+
]
|
|
11
11
|
}
|
package/dist/cjs/NextTheme.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
-
return to;
|
|
10
|
-
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
11
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
-
var NextTheme_exports = {};
|
|
13
|
-
module.exports = __toCommonJS(NextTheme_exports);
|
|
14
|
-
__reExport(NextTheme_exports, require("./NextThemeProvider"), module.exports);
|
|
15
|
-
__reExport(NextTheme_exports, require("./ThemeSettingContext"), module.exports);
|
|
16
|
-
__reExport(NextTheme_exports, require("./UseThemeProps"), module.exports);
|
|
17
|
-
__reExport(NextTheme_exports, require("./helpers"), module.exports);
|
|
18
|
-
__reExport(NextTheme_exports, require("./constants"), module.exports);
|
|
19
|
-
__reExport(NextTheme_exports, require("./useTheme"), module.exports);
|
|
20
|
-
__reExport(NextTheme_exports, require("./types"), module.exports);
|
|
21
|
-
__reExport(NextTheme_exports, require("./useRootTheme"), module.exports);
|
|
22
|
-
//# sourceMappingURL=NextTheme.js.map
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var NextThemeProvider_exports = {};
|
|
24
|
-
__export(NextThemeProvider_exports, {
|
|
25
|
-
NextThemeProvider: () => NextThemeProvider
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(NextThemeProvider_exports);
|
|
28
|
-
var import_constants = require("@tamagui/constants"), import_use_event = require("@tamagui/use-event"), import_script = __toESM(require("next/script"), 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
|
-
const NextThemeProvider = (0, import_react.memo)(
|
|
30
|
-
({
|
|
31
|
-
forcedTheme,
|
|
32
|
-
disableTransitionOnChange = !1,
|
|
33
|
-
enableSystem = !0,
|
|
34
|
-
enableColorScheme = !0,
|
|
35
|
-
storageKey = "theme",
|
|
36
|
-
themes = import_constants2.colorSchemes,
|
|
37
|
-
defaultTheme = enableSystem ? "system" : "light",
|
|
38
|
-
attribute = "class",
|
|
39
|
-
skipNextHead,
|
|
40
|
-
onChangeTheme,
|
|
41
|
-
value = {
|
|
42
|
-
dark: "t_dark",
|
|
43
|
-
light: "t_light"
|
|
44
|
-
},
|
|
45
|
-
children
|
|
46
|
-
}) => {
|
|
47
|
-
const [theme, setThemeState] = (0, import_react.useState)(() => (0, import_helpers.getTheme)(storageKey, defaultTheme)), [resolvedTheme, setResolvedTheme] = (0, import_react.useState)(() => (0, import_helpers.getTheme)(storageKey)), attrs = value ? Object.values(value) : themes, handleMediaQuery = (0, import_use_event.useEvent)((e) => {
|
|
48
|
-
const _ = (0, import_helpers.getSystemTheme)(e), update = () => setResolvedTheme(_);
|
|
49
|
-
disableTransitionOnChange ? update() : React.startTransition(() => update()), theme === "system" && !forcedTheme && handleChangeTheme(_, !1);
|
|
50
|
-
}), handleChangeTheme = (0, import_use_event.useEvent)(
|
|
51
|
-
(theme2, updateStorage = !0, updateDOM = !0) => {
|
|
52
|
-
let name = value?.[theme2] || theme2;
|
|
53
|
-
if (updateStorage)
|
|
54
|
-
try {
|
|
55
|
-
localStorage.setItem(storageKey, theme2);
|
|
56
|
-
} catch {
|
|
57
|
-
}
|
|
58
|
-
if (theme2 === "system" && enableSystem) {
|
|
59
|
-
const resolved = (0, import_helpers.getSystemTheme)();
|
|
60
|
-
name = value?.[resolved] || resolved;
|
|
61
|
-
}
|
|
62
|
-
if (onChangeTheme?.(name.replace("t_", "")), updateDOM) {
|
|
63
|
-
const d = document.documentElement;
|
|
64
|
-
attribute === "class" ? (d.classList.remove(...attrs), d.classList.add(name)) : d.setAttribute(attribute, name);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
69
|
-
const media = window.matchMedia(import_constants2.MEDIA);
|
|
70
|
-
return media.addListener(handleMediaQuery), handleMediaQuery(media), () => {
|
|
71
|
-
media.removeListener(handleMediaQuery);
|
|
72
|
-
};
|
|
73
|
-
}, []);
|
|
74
|
-
const set = (0, import_use_event.useEvent)((newTheme) => {
|
|
75
|
-
forcedTheme || (handleChangeTheme(newTheme), setThemeState(newTheme));
|
|
76
|
-
});
|
|
77
|
-
(0, import_react.useEffect)(() => {
|
|
78
|
-
const handleStorage = (e) => {
|
|
79
|
-
if (e.key !== storageKey)
|
|
80
|
-
return;
|
|
81
|
-
const theme2 = e.newValue || defaultTheme;
|
|
82
|
-
set(theme2);
|
|
83
|
-
};
|
|
84
|
-
return window.addEventListener("storage", handleStorage), () => {
|
|
85
|
-
window.removeEventListener("storage", handleStorage);
|
|
86
|
-
};
|
|
87
|
-
}, [defaultTheme, set, storageKey]), (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
88
|
-
if (!enableColorScheme) return;
|
|
89
|
-
const colorScheme = (
|
|
90
|
-
// If theme is forced to light or dark, use that
|
|
91
|
-
forcedTheme && import_constants2.colorSchemes.includes(forcedTheme) ? forcedTheme : (
|
|
92
|
-
// If regular theme is light or dark
|
|
93
|
-
theme && import_constants2.colorSchemes.includes(theme) ? theme : (
|
|
94
|
-
// If theme is system, use the resolved version
|
|
95
|
-
theme === "system" && resolvedTheme || null
|
|
96
|
-
)
|
|
97
|
-
)
|
|
98
|
-
);
|
|
99
|
-
(typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light") !== (colorScheme || "light") && document.documentElement.style.setProperty("color-scheme", colorScheme);
|
|
100
|
-
}, [enableColorScheme, theme, resolvedTheme, forcedTheme]);
|
|
101
|
-
const toggle = (0, import_use_event.useEvent)(() => {
|
|
102
|
-
const order = resolvedTheme === "dark" ? ["system", "light", "dark"] : ["system", "dark", "light"], next = order[(order.indexOf(theme) + 1) % order.length];
|
|
103
|
-
set(next);
|
|
104
|
-
}), systemTheme = enableSystem ? resolvedTheme : void 0, contextValue = (0, import_react.useMemo)(() => ({
|
|
105
|
-
theme,
|
|
106
|
-
current: theme,
|
|
107
|
-
set,
|
|
108
|
-
toggle,
|
|
109
|
-
forcedTheme,
|
|
110
|
-
resolvedTheme: theme === "system" ? resolvedTheme : theme,
|
|
111
|
-
themes: enableSystem ? [...themes, "system"] : themes,
|
|
112
|
-
systemTheme
|
|
113
|
-
}), [
|
|
114
|
-
theme,
|
|
115
|
-
set,
|
|
116
|
-
toggle,
|
|
117
|
-
forcedTheme,
|
|
118
|
-
resolvedTheme,
|
|
119
|
-
enableSystem,
|
|
120
|
-
themes,
|
|
121
|
-
systemTheme
|
|
122
|
-
]);
|
|
123
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ThemeSettingContext.ThemeSettingContext.Provider, { value: contextValue, children: [
|
|
124
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
|
-
ThemeScript,
|
|
126
|
-
{
|
|
127
|
-
forcedTheme,
|
|
128
|
-
storageKey,
|
|
129
|
-
systemTheme: resolvedTheme,
|
|
130
|
-
attribute,
|
|
131
|
-
value,
|
|
132
|
-
enableSystem,
|
|
133
|
-
defaultTheme,
|
|
134
|
-
attrs,
|
|
135
|
-
skipNextHead
|
|
136
|
-
}
|
|
137
|
-
),
|
|
138
|
-
children
|
|
139
|
-
] });
|
|
140
|
-
}
|
|
141
|
-
), ThemeScript = (0, import_react.memo)(
|
|
142
|
-
({
|
|
143
|
-
forcedTheme,
|
|
144
|
-
storageKey,
|
|
145
|
-
attribute,
|
|
146
|
-
enableSystem,
|
|
147
|
-
defaultTheme,
|
|
148
|
-
value,
|
|
149
|
-
attrs,
|
|
150
|
-
skipNextHead
|
|
151
|
-
}) => {
|
|
152
|
-
const optimization = attribute === "class" ? `var d=document.documentElement.classList;${attrs.map((t) => `d.remove('${t}')`).join(";")};` : "var d=document.documentElement;", updateDOM = (name, literal) => {
|
|
153
|
-
name = value?.[name] || name;
|
|
154
|
-
const val = literal ? name : `'${name}'`;
|
|
155
|
-
return attribute === "class" ? `d.add(${val})` : `d.setAttribute('${attribute}', ${val})`;
|
|
156
|
-
}, defaultSystem = defaultTheme === "system", 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(
|
|
157
|
-
"dark"
|
|
158
|
-
)}:${updateDOM("light")}}else if(e){${value ? `var x=${JSON.stringify(value)};` : ""}${updateDOM(value ? "x[e]" : "e", !0)}}${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", !0)}}else{${updateDOM(
|
|
159
|
-
defaultTheme
|
|
160
|
-
)};}}catch(t){}}();`;
|
|
161
|
-
return skipNextHead ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
162
|
-
"script",
|
|
163
|
-
{
|
|
164
|
-
dangerouslySetInnerHTML: { __html: scriptContent }
|
|
165
|
-
},
|
|
166
|
-
"next-themes-script"
|
|
167
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
168
|
-
import_script.default,
|
|
169
|
-
{
|
|
170
|
-
id: "next-themes-script",
|
|
171
|
-
strategy: "beforeInteractive",
|
|
172
|
-
dangerouslySetInnerHTML: { __html: scriptContent }
|
|
173
|
-
}
|
|
174
|
-
);
|
|
175
|
-
},
|
|
176
|
-
(prevProps, nextProps) => prevProps.forcedTheme === nextProps.forcedTheme
|
|
177
|
-
);
|
|
178
|
-
//# sourceMappingURL=NextThemeProvider.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|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B,SAAS,MAAM,GAAG;AAAA,IAC9C,GAEM,gBAAgB,iBAAiB,UAEjC,gBAAgB,cAClB,eAAe,YAAY,GAAG,UAAU,WAAW,CAAC,QACpD,eACE,oBAAoB,YAAY,+BAA+B,UAAU,4BAA4B,aAAa,aAAa,uBAAK,mDAAmD;AAAA,MACrL;AAAA,IACF,CAAC,IAAI,UAAU,OAAO,CAAC,eACrB,QAAQ,SAAS,KAAK,UAAU,KAAK,CAAC,MAAM,EAC9C,GAAG,UAAU,QAAQ,SAAS,KAAK,EAAI,CAAC,IACrC,gBAAqD,KAArC,QAAQ,UAAU,YAAY,CAAC,GAClD,mBACA,mBAAmB,YAAY,+BAA+B,UAAU,YACtE,QAAQ,SAAS,KAAK,UAAU,KAAK,CAAC,MAAM,EAC9C,GAAG,UAAU,QAAQ,SAAS,KAAK,EAAI,CAAC,SAAS;AAAA,MAC/C;AAAA,IACF,CAAC;AAGP,WAAI,eAEA;AAAA,MAAC;AAAA;AAAA,QAEC,yBAAyB,EAAE,QAAQ,cAAc;AAAA;AAAA,MAD7C;AAAA,IAEN,IAKF;AAAA,MAAC,cAAAC;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,UAAS;AAAA,QACT,yBAAyB,EAAE,QAAQ,cAAc;AAAA;AAAA,IACnD;AAAA,EAEJ;AAAA,EACA,CAAC,WAAW,cAGN,UAAU,gBAAgB,UAAU;AAG5C;",
|
|
5
|
-
"names": ["import_constants", "theme", "Script"]
|
|
6
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var ThemeSettingContext_exports = {};
|
|
16
|
-
__export(ThemeSettingContext_exports, {
|
|
17
|
-
ThemeSettingContext: () => ThemeSettingContext
|
|
18
|
-
});
|
|
19
|
-
module.exports = __toCommonJS(ThemeSettingContext_exports);
|
|
20
|
-
var import_react = require("react");
|
|
21
|
-
const ThemeSettingContext = (0, import_react.createContext)({
|
|
22
|
-
toggle: () => {
|
|
23
|
-
},
|
|
24
|
-
set: (_) => {
|
|
25
|
-
},
|
|
26
|
-
themes: []
|
|
27
|
-
});
|
|
28
|
-
//# 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,mBAA4C;AAIrC,MAAM,0BAA8C,4BAA6B;AAAA,EACtF,QAAQ,MAAM;AAAA,EAAC;AAAA,EACf,KAAK,CAAC,MAAM;AAAA,EAAC;AAAA,EACb,QAAQ,CAAC;AACX,CAAC;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
-
return to;
|
|
10
|
-
};
|
|
11
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
-
var UseThemeProps_exports = {};
|
|
13
|
-
module.exports = __toCommonJS(UseThemeProps_exports);
|
|
14
|
-
//# sourceMappingURL=UseThemeProps.js.map
|
package/dist/cjs/constants.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var constants_exports = {};
|
|
16
|
-
__export(constants_exports, {
|
|
17
|
-
MEDIA: () => MEDIA,
|
|
18
|
-
colorSchemes: () => colorSchemes,
|
|
19
|
-
constants: () => constants
|
|
20
|
-
});
|
|
21
|
-
module.exports = __toCommonJS(constants_exports);
|
|
22
|
-
const constants = {}, colorSchemes = ["light", "dark"], MEDIA = "(prefers-color-scheme: dark)";
|
|
23
|
-
//# sourceMappingURL=constants.js.map
|
package/dist/cjs/helpers.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var helpers_exports = {};
|
|
16
|
-
__export(helpers_exports, {
|
|
17
|
-
getSystemTheme: () => getSystemTheme,
|
|
18
|
-
getTheme: () => getTheme,
|
|
19
|
-
helpers: () => helpers
|
|
20
|
-
});
|
|
21
|
-
module.exports = __toCommonJS(helpers_exports);
|
|
22
|
-
var import_constants = require("./constants");
|
|
23
|
-
const helpers = {}, getTheme = (key, fallback) => {
|
|
24
|
-
if (typeof window > "u") return;
|
|
25
|
-
let theme;
|
|
26
|
-
try {
|
|
27
|
-
theme = localStorage.getItem(key) || void 0;
|
|
28
|
-
} catch {
|
|
29
|
-
}
|
|
30
|
-
return theme || fallback;
|
|
31
|
-
}, getSystemTheme = (e) => (e || (e = window.matchMedia(import_constants.MEDIA)), e.matches ? "dark" : "light");
|
|
32
|
-
//# sourceMappingURL=helpers.js.map
|
package/dist/cjs/helpers.js.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/helpers.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB;AAEf,MAAM,UAAU,CAAC,GAGX,WAAW,CAAC,KAAa,aAA2B;AAC/D,MAAI,OAAO,SAAW,IAAa;AACnC,MAAI;AACJ,MAAI;AACF,YAAQ,aAAa,QAAQ,GAAG,KAAK;AAAA,EACvC,QAAY;AAAA,EAEZ;AACA,SAAO,SAAS;AAClB,GAEa,iBAAiB,CAAC,OACxB,MACH,IAAI,OAAO,WAAW,sBAAK,IAGd,EAAE,UACY,SAAS;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
-
return to;
|
|
10
|
-
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
11
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
-
var index_exports = {};
|
|
13
|
-
module.exports = __toCommonJS(index_exports);
|
|
14
|
-
__reExport(index_exports, require("./NextTheme"), module.exports);
|
|
15
|
-
__reExport(index_exports, require("./types"), module.exports);
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
package/dist/cjs/types.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
-
return to;
|
|
10
|
-
};
|
|
11
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
-
var types_exports = {};
|
|
13
|
-
module.exports = __toCommonJS(types_exports);
|
|
14
|
-
//# sourceMappingURL=types.js.map
|
package/dist/cjs/types.js.map
DELETED
package/dist/cjs/useRootTheme.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var useRootTheme_exports = {};
|
|
16
|
-
__export(useRootTheme_exports, {
|
|
17
|
-
useRootTheme: () => useRootTheme
|
|
18
|
-
});
|
|
19
|
-
module.exports = __toCommonJS(useRootTheme_exports);
|
|
20
|
-
var import_react = require("react"), import_constants = require("@tamagui/constants");
|
|
21
|
-
const useRootTheme = ({ fallback = "light" } = {}) => {
|
|
22
|
-
let initialVal = fallback;
|
|
23
|
-
if (import_constants.isClient) {
|
|
24
|
-
const classes = document.documentElement.classList;
|
|
25
|
-
initialVal = classes.contains("t_dark") ? "dark" : classes.contains("t_light") ? "light" : fallback;
|
|
26
|
-
}
|
|
27
|
-
return (0, import_react.useState)(initialVal);
|
|
28
|
-
};
|
|
29
|
-
//# 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,mBAA6D,kBAC7D,mBAAyB;AAIlB,MAAM,eAAe,CAAC,EAAE,WAAW,QAAQ,IAAgC,CAAC,MAG9E;AACH,MAAI,aAAa;AAEjB,MAAI,2BAAU;AACZ,UAAM,UAAU,SAAS,gBAAgB;AACzC,iBAAa,QAAQ,SAAS,QAAQ,IAClC,SACA,QAAQ,SAAS,SAAS,IACxB,UACA;AAAA,EACR;AAEA,aAAO,uBAAsB,UAAU;AACzC;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/cjs/useTheme.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var useTheme_exports = {};
|
|
16
|
-
__export(useTheme_exports, {
|
|
17
|
-
useTheme: () => useTheme,
|
|
18
|
-
useThemeSetting: () => useThemeSetting
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(useTheme_exports);
|
|
21
|
-
var import_react = require("react"), import_ThemeSettingContext = require("./ThemeSettingContext");
|
|
22
|
-
const useTheme = () => (0, import_react.useContext)(import_ThemeSettingContext.ThemeSettingContext), useThemeSetting = () => (0, import_react.useContext)(import_ThemeSettingContext.ThemeSettingContext);
|
|
23
|
-
//# sourceMappingURL=useTheme.js.map
|
package/dist/cjs/useTheme.js.map
DELETED
package/dist/esm/NextTheme.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=NextTheme.js.map
|