@tamagui/next-theme 1.135.3 → 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.
- package/dist/cjs/NextThemeProvider.cjs +2 -2
- package/dist/cjs/NextThemeProvider.js +1 -1
- package/dist/cjs/NextThemeProvider.js.map +1 -1
- package/dist/cjs/ThemeSettingContext.cjs +1 -1
- package/dist/cjs/ThemeSettingContext.js +1 -1
- package/dist/cjs/useRootTheme.cjs +1 -1
- package/dist/cjs/useRootTheme.js +1 -1
- package/dist/cjs/useRootTheme.js.map +1 -1
- package/dist/cjs/useTheme.cjs +1 -1
- package/dist/cjs/useTheme.js +1 -1
- package/dist/cjs/useTheme.js.map +1 -1
- package/package.json +5 -4
- package/types/NextTheme.d.ts +0 -2
- package/types/NextTheme.d.ts.map +1 -1
- package/types/NextThemeProvider.d.ts.map +1 -1
- package/types/ThemeSettingContext.d.ts.map +1 -1
- package/types/UseThemeProps.d.ts +0 -1
- package/types/UseThemeProps.d.ts.map +2 -5
- package/types/helpers.d.ts +0 -1
- package/types/helpers.d.ts.map +2 -6
- package/types/types.d.ts.map +1 -1
- package/types/useRootTheme.d.ts.map +1 -1
- package/types/useTheme.d.ts.map +1 -1
- package/dist/cjs/NextTheme.native.js +0 -34
- package/dist/cjs/NextTheme.native.js.map +0 -6
- package/dist/cjs/NextThemeProvider.native.js +0 -215
- package/dist/cjs/NextThemeProvider.native.js.map +0 -6
- package/dist/cjs/ThemeSettingContext.native.js +0 -40
- package/dist/cjs/ThemeSettingContext.native.js.map +0 -6
- package/dist/cjs/UseThemeProps.native.js +0 -15
- package/dist/cjs/UseThemeProps.native.js.map +0 -6
- package/dist/cjs/constants.native.js +0 -33
- package/dist/cjs/constants.native.js.map +0 -6
- package/dist/cjs/helpers.native.js +0 -43
- package/dist/cjs/helpers.native.js.map +0 -6
- package/dist/cjs/index.native.js +0 -22
- package/dist/cjs/index.native.js.map +0 -6
- package/dist/cjs/types.native.js +0 -15
- package/dist/cjs/types.native.js.map +0 -6
- package/dist/cjs/useRootTheme.native.js +0 -43
- package/dist/cjs/useRootTheme.native.js.map +0 -6
- package/dist/cjs/useTheme.native.js +0 -40
- package/dist/cjs/useTheme.native.js.map +0 -6
- package/dist/esm/NextTheme.native.js +0 -9
- package/dist/esm/NextTheme.native.js.map +0 -1
- package/dist/esm/NextThemeProvider.native.js +0 -185
- package/dist/esm/NextThemeProvider.native.js.map +0 -1
- package/dist/esm/ThemeSettingContext.native.js +0 -8
- package/dist/esm/ThemeSettingContext.native.js.map +0 -1
- package/dist/esm/UseThemeProps.native.js +0 -2
- package/dist/esm/UseThemeProps.native.js.map +0 -1
- package/dist/esm/constants.native.js +0 -5
- package/dist/esm/constants.native.js.map +0 -1
- package/dist/esm/helpers.native.js +0 -19
- package/dist/esm/helpers.native.js.map +0 -1
- package/dist/esm/index.native.js +0 -3
- package/dist/esm/index.native.js.map +0 -1
- package/dist/esm/types.native.js +0 -2
- package/dist/esm/types.native.js.map +0 -1
- package/dist/esm/useRootTheme.native.js +0 -15
- package/dist/esm/useRootTheme.native.js.map +0 -1
- package/dist/esm/useTheme.native.js +0 -10
- 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
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0C,+BAC1C,mBAAyB,+BACzB,cAAqB,kCACrB,QAAuB,8BACvB,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,WAAW;AAAA,IACzC,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,IACA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QAAQ,SAAS,KAAK,UAAU,KAAK,CAAC,MAAM,EAC9C,GAAG,UAAU,QAAQ,SAAS,KAAK,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"
|
package/dist/cjs/useRootTheme.js
CHANGED
|
@@ -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,
|
|
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
|
}
|
package/dist/cjs/useTheme.cjs
CHANGED
|
@@ -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);
|
package/dist/cjs/useTheme.js
CHANGED
|
@@ -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
|
package/dist/cjs/useTheme.js.map
CHANGED
|
@@ -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,
|
|
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,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/next-theme",
|
|
3
|
-
"version": "1.135.
|
|
3
|
+
"version": "1.135.4-1761748186554",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"sideEffects": false,
|
|
5
6
|
"source": "src/index.ts",
|
|
6
7
|
"types": "./types/index.d.ts",
|
|
@@ -29,12 +30,12 @@
|
|
|
29
30
|
}
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"@tamagui/constants": "1.135.
|
|
33
|
-
"@tamagui/use-event": "1.135.
|
|
33
|
+
"@tamagui/constants": "1.135.4-1761748186554",
|
|
34
|
+
"@tamagui/use-event": "1.135.4-1761748186554",
|
|
34
35
|
"next": "^15.3.1"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@tamagui/build": "1.135.
|
|
38
|
+
"@tamagui/build": "1.135.4-1761748186554",
|
|
38
39
|
"react": "*"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
package/types/NextTheme.d.ts
CHANGED
package/types/NextTheme.d.ts.map
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "AAGA,YAAY,WAAW
|
|
2
|
+
"mappings": "AAGA,YAAY,WAAW;AAOvB,cAAc,0BAAyC;AAEvD,OAAO,cAAMA,mBAAmB,MAAM,kBAAkB",
|
|
3
3
|
"names": [
|
|
4
4
|
"NextThemeProvider: React.FunctionComponent<ThemeProviderProps>"
|
|
5
5
|
],
|
package/types/UseThemeProps.d.ts
CHANGED
|
@@ -38,7 +38,6 @@ export interface ThemeProviderProps {
|
|
|
38
38
|
/** Mapping of theme name to HTML attribute value. Object where key is the theme name and value is the attribute value */
|
|
39
39
|
value?: ValueObject;
|
|
40
40
|
onChangeTheme?: (name: string) => void;
|
|
41
|
-
// avoids warning
|
|
42
41
|
skipNextHead?: boolean;
|
|
43
42
|
}
|
|
44
43
|
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "AAAA,cAAc,mBAAmB
|
|
3
|
-
"names": [
|
|
4
|
-
"theme: string",
|
|
5
|
-
"name: string"
|
|
6
|
-
],
|
|
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": [],
|
|
7
4
|
"sources": [
|
|
8
5
|
"src/UseThemeProps.tsx"
|
|
9
6
|
],
|
package/types/helpers.d.ts
CHANGED
package/types/helpers.d.ts.map
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "AAEA,OAAO,cAAM
|
|
3
|
-
"names": [
|
|
4
|
-
"key: string",
|
|
5
|
-
"fallback?: string",
|
|
6
|
-
"e?: MediaQueryList"
|
|
7
|
-
],
|
|
2
|
+
"mappings": "AAEA,OAAO,cAAM;AAGb,OAAO,cAAM,WAAY,aAAa;AAWtC,OAAO,cAAM,iBAAkB,IAAI,mBAAiB,SAAS",
|
|
3
|
+
"names": [],
|
|
8
4
|
"sources": [
|
|
9
5
|
"src/helpers.tsx"
|
|
10
6
|
],
|
package/types/types.d.ts.map
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "AAAA,OAAO,WAAW
|
|
2
|
+
"mappings": "AAAA,OAAO,WAAW;AAGlB,cAAc,mBAAmB;AAEjC,OAAO,cAAM,eAAgB,EAC3B,aACC;CAAE,WAAW;OACd,aACA,MAAM,SAAS,MAAM,eAAe",
|
|
3
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/useRootTheme.tsx"
|
package/types/useTheme.d.ts.map
CHANGED
|
@@ -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,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,QAAI,uBAAS,WAAW;AACxD,eAAO,yBAAS,UAAU;AAAA,EAC9B,CAAC,GACG,QAAS,QAAiB,OAAO,OAAO,KAAK,IAA5B,QACjB,uBAAmB,2BAAS,SAAS,GAAG;AACxC,QAAI,QAAI,+BAAe,CAAC,GACpB,SAAS,WAAW;AACpB,aAAO,iBAAiB,CAAC;AAAA,IAC7B;AACA,IAAI,4BACA,OAAO,IAEP,MAAM,gBAAgB,WAAW;AAC7B,aAAO,OAAO;AAAA,IAClB,CAAC,GAED,UAAU,YA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AA,QAChE,yBAAyB;AAAA,UACrB,QAAQ,oBAAoB,YAAY,+BAA+B,UAAU,MAAO,gBAAgD,KAAhC,UAAU,YAAY,IAAI,GAAQ,yBAAyB,aAAa,aAAa,uBAAK,mDAAmD,UAAU,MAAM,CAAC,IAAI,UAAU,OAAO,CAAC,eAAe,QAAQ,SAAS,KAAK,UAAU,KAAK,CAAC,MAAM,EAAE,GAAG,UAAU,QAAQ,SAAS,KAAK,EAAI,CAAC;AAAA,QACrY;AAAA,MACJ;AAAA;AAAA,MACA;AAAA,IAAoB,IAAkB,uCAAAA;AAAA,MAAK;AAAA,MAAU;AAAA,QACjD,yBAAyB;AAAA,UACrB,QAAQ,mBAAmB,YAAY,+BAA+B,UAAU,YAAY,QAAQ,SAAS,KAAK,UAAU,KAAK,CAAC,MAAM,EAAE,GAAG,UAAU,QAAQ,SAAS,KAAK,EAAI,CAAC,SAAS,UAAU,YAAY,CAAC;AAAA,QACtN;AAAA,MACJ;AAAA;AAAA,MACA;AAAA,IAAoB;AAAA,EACxB,CAAC;AACD,SAAI,eAAqB,WACJ,uCAAAA,KAAK,YAAAE,SAAU;AAAA,IAChC,UAAU;AAAA,EACd,CAAC;AACL,GAAG,SAAS,WAAW,WAAW;AAG9B,SAAI,UAAU,gBAAgB,UAAU;AAE5C,CAAC;",
|
|
5
|
-
"names": ["import_constants", "theme", "value", "_jsxs", "_jsx", "_Fragment", "NextHead"]
|
|
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 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,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,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
|
-
}
|
package/dist/cjs/index.native.js
DELETED
|
@@ -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
|
package/dist/cjs/types.native.js
DELETED
|
@@ -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,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":[]}
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
3
|
-
import { useEvent } from "@tamagui/use-event";
|
|
4
|
-
import NextHead from "next/head";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
import { memo, useEffect, useMemo, useState } from "react";
|
|
7
|
-
import { MEDIA, colorSchemes } from "./constants.native.js";
|
|
8
|
-
import { getSystemTheme, getTheme } from "./helpers.native.js";
|
|
9
|
-
import { ThemeSettingContext } from "./ThemeSettingContext.native.js";
|
|
10
|
-
var NextThemeProvider = /* @__PURE__ */memo(function (param) {
|
|
11
|
-
var {
|
|
12
|
-
forcedTheme,
|
|
13
|
-
disableTransitionOnChange = !1,
|
|
14
|
-
enableSystem = !0,
|
|
15
|
-
enableColorScheme = !0,
|
|
16
|
-
storageKey = "theme",
|
|
17
|
-
themes = colorSchemes,
|
|
18
|
-
defaultTheme = enableSystem ? "system" : "light",
|
|
19
|
-
attribute = "class",
|
|
20
|
-
skipNextHead,
|
|
21
|
-
onChangeTheme,
|
|
22
|
-
value = {
|
|
23
|
-
dark: "t_dark",
|
|
24
|
-
light: "t_light"
|
|
25
|
-
},
|
|
26
|
-
children
|
|
27
|
-
} = param,
|
|
28
|
-
[theme, setThemeState] = useState(function () {
|
|
29
|
-
return getTheme(storageKey, defaultTheme);
|
|
30
|
-
}),
|
|
31
|
-
[resolvedTheme, setResolvedTheme] = useState(function () {
|
|
32
|
-
return getTheme(storageKey);
|
|
33
|
-
}),
|
|
34
|
-
attrs = value ? Object.values(value) : themes,
|
|
35
|
-
handleMediaQuery = useEvent(function (e) {
|
|
36
|
-
var _ = getSystemTheme(e),
|
|
37
|
-
update = function () {
|
|
38
|
-
return setResolvedTheme(_);
|
|
39
|
-
};
|
|
40
|
-
disableTransitionOnChange ? update() : React.startTransition(function () {
|
|
41
|
-
return update();
|
|
42
|
-
}), theme === "system" && !forcedTheme && handleChangeTheme(_, !1);
|
|
43
|
-
}),
|
|
44
|
-
handleChangeTheme = useEvent(function (theme2) {
|
|
45
|
-
var updateStorage = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0,
|
|
46
|
-
updateDOM = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0,
|
|
47
|
-
name = value?.[theme2] || theme2;
|
|
48
|
-
if (updateStorage) try {
|
|
49
|
-
localStorage.setItem(storageKey, theme2);
|
|
50
|
-
} catch {}
|
|
51
|
-
if (theme2 === "system" && enableSystem) {
|
|
52
|
-
var resolved = getSystemTheme();
|
|
53
|
-
name = value?.[resolved] || resolved;
|
|
54
|
-
}
|
|
55
|
-
if (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
|
-
useIsomorphicLayoutEffect(function () {
|
|
61
|
-
var media = window.matchMedia(MEDIA);
|
|
62
|
-
return media.addListener(handleMediaQuery), handleMediaQuery(media), function () {
|
|
63
|
-
media.removeListener(handleMediaQuery);
|
|
64
|
-
};
|
|
65
|
-
}, []);
|
|
66
|
-
var set = useEvent(function (newTheme) {
|
|
67
|
-
forcedTheme ? handleChangeTheme(newTheme, !0, !1) : handleChangeTheme(newTheme), setThemeState(newTheme);
|
|
68
|
-
});
|
|
69
|
-
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
|
-
}, [defaultTheme, set, storageKey]), useIsomorphicLayoutEffect(function () {
|
|
80
|
-
if (enableColorScheme) {
|
|
81
|
-
var colorScheme =
|
|
82
|
-
// If theme is forced to light or dark, use that
|
|
83
|
-
forcedTheme && colorSchemes.includes(forcedTheme) ? forcedTheme :
|
|
84
|
-
// If regular theme is light or dark
|
|
85
|
-
theme && colorSchemes.includes(theme) ? theme :
|
|
86
|
-
// If theme is system, use the resolved version
|
|
87
|
-
theme === "system" && resolvedTheme || null,
|
|
88
|
-
userPrefers = typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light",
|
|
89
|
-
wePrefer = colorScheme || "light";
|
|
90
|
-
userPrefers !== wePrefer && document.documentElement.style.setProperty("color-scheme", colorScheme);
|
|
91
|
-
}
|
|
92
|
-
}, [enableColorScheme, theme, resolvedTheme, forcedTheme]);
|
|
93
|
-
var toggle = useEvent(function () {
|
|
94
|
-
var order = resolvedTheme === "dark" ? ["system", "light", "dark"] : ["system", "dark", "light"],
|
|
95
|
-
next = order[(order.indexOf(theme) + 1) % order.length];
|
|
96
|
-
set(next);
|
|
97
|
-
}),
|
|
98
|
-
systemTheme = enableSystem ? resolvedTheme : void 0,
|
|
99
|
-
contextValue = useMemo(function () {
|
|
100
|
-
var value2 = {
|
|
101
|
-
theme,
|
|
102
|
-
current: theme,
|
|
103
|
-
set,
|
|
104
|
-
toggle,
|
|
105
|
-
forcedTheme,
|
|
106
|
-
resolvedTheme: theme === "system" ? resolvedTheme : theme,
|
|
107
|
-
themes: enableSystem ? [...themes, "system"] : themes,
|
|
108
|
-
systemTheme
|
|
109
|
-
};
|
|
110
|
-
return value2;
|
|
111
|
-
}, [theme, set, toggle, forcedTheme, resolvedTheme, enableSystem, themes, systemTheme]);
|
|
112
|
-
return /* @__PURE__ */_jsxs(ThemeSettingContext.Provider, {
|
|
113
|
-
value: contextValue,
|
|
114
|
-
children: [/* @__PURE__ */_jsx(ThemeScript, {
|
|
115
|
-
forcedTheme,
|
|
116
|
-
storageKey,
|
|
117
|
-
systemTheme: resolvedTheme,
|
|
118
|
-
attribute,
|
|
119
|
-
value,
|
|
120
|
-
enableSystem,
|
|
121
|
-
defaultTheme,
|
|
122
|
-
attrs,
|
|
123
|
-
skipNextHead
|
|
124
|
-
}), /* because on SSR we re-run and can avoid whole tree re-render */
|
|
125
|
-
useMemo(function () {
|
|
126
|
-
return children;
|
|
127
|
-
}, [children])]
|
|
128
|
-
});
|
|
129
|
-
}),
|
|
130
|
-
ThemeScript = /* @__PURE__ */memo(function (param) {
|
|
131
|
-
var {
|
|
132
|
-
forcedTheme,
|
|
133
|
-
storageKey,
|
|
134
|
-
attribute,
|
|
135
|
-
enableSystem,
|
|
136
|
-
defaultTheme,
|
|
137
|
-
value,
|
|
138
|
-
attrs,
|
|
139
|
-
skipNextHead
|
|
140
|
-
} = param,
|
|
141
|
-
optimization = function () {
|
|
142
|
-
if (attribute === "class") {
|
|
143
|
-
var removeClasses = attrs.map(function (t) {
|
|
144
|
-
return `d.remove('${t}')`;
|
|
145
|
-
}).join(";");
|
|
146
|
-
return `var d=document.documentElement.classList;${removeClasses};`;
|
|
147
|
-
}
|
|
148
|
-
return "var d=document.documentElement;";
|
|
149
|
-
}(),
|
|
150
|
-
updateDOM = function (name, literal) {
|
|
151
|
-
name = value?.[name] || name;
|
|
152
|
-
var val = literal ? name : `'${name}'`;
|
|
153
|
-
return attribute === "class" ? `d.add(${val})` : `d.setAttribute('${attribute}', ${val})`;
|
|
154
|
-
},
|
|
155
|
-
defaultSystem = defaultTheme === "system",
|
|
156
|
-
contents = /* @__PURE__ */_jsx(_Fragment, {
|
|
157
|
-
children: forcedTheme ? /* @__PURE__ */_jsx("script", {
|
|
158
|
-
dangerouslySetInnerHTML: {
|
|
159
|
-
// These are minified via Terser and then updated by hand, don't recommend
|
|
160
|
-
__html: `!function(){${optimization}${updateDOM(forcedTheme)}}()`
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
// nonce={nonce}
|
|
164
|
-
"next-themes-script") : enableSystem ? /* @__PURE__ */_jsx("script", {
|
|
165
|
-
dangerouslySetInnerHTML: {
|
|
166
|
-
__html: `!function(){try {${optimization}var e=localStorage.getItem('${storageKey}');${defaultSystem ? "" : updateDOM(defaultTheme) + ";"}if("system"===e||(!e&&${defaultSystem})){var t="${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){}}()`
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
// nonce={nonce}
|
|
170
|
-
"next-themes-script") : /* @__PURE__ */_jsx("script", {
|
|
171
|
-
dangerouslySetInnerHTML: {
|
|
172
|
-
__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){}}();`
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
// nonce={nonce}
|
|
176
|
-
"next-themes-script")
|
|
177
|
-
});
|
|
178
|
-
return skipNextHead ? contents : /* @__PURE__ */_jsx(NextHead, {
|
|
179
|
-
children: contents
|
|
180
|
-
});
|
|
181
|
-
}, function (prevProps, nextProps) {
|
|
182
|
-
return prevProps.forcedTheme === nextProps.forcedTheme;
|
|
183
|
-
});
|
|
184
|
-
export { NextThemeProvider };
|
|
185
|
-
//# sourceMappingURL=NextThemeProvider.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useIsomorphicLayoutEffect","useEvent","NextHead","React","memo","useEffect","useMemo","useState","MEDIA","colorSchemes","getSystemTheme","getTheme","ThemeSettingContext","NextThemeProvider","param","forcedTheme","disableTransitionOnChange","enableSystem","enableColorScheme","storageKey","themes","defaultTheme","attribute","skipNextHead","onChangeTheme","value","dark","light","children","theme","setThemeState","resolvedTheme","setResolvedTheme","attrs","Object","values","handleMediaQuery","e","_","update","startTransition","handleChangeTheme","theme2","updateStorage","arguments","length","updateDOM","name","localStorage","setItem","resolved","replace","d","document","documentElement","classList","remove","add","setAttribute","media","window","matchMedia","addListener","removeListener","set","newTheme","handleStorage","key","newValue","addEventListener","removeEventListener","colorScheme","includes","userPrefers","matches","wePrefer","style","setProperty","toggle","order","next","indexOf","systemTheme","contextValue","value2","current","Provider","ThemeScript","optimization","removeClasses","map","t","join","literal","val","defaultSystem","contents","dangerouslySetInnerHTML","__html","JSON","stringify"],"sources":["../../src/NextThemeProvider.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAiC,IAAAC,SAAA;AAC1C,SAASC,yBAAgB;AACzB,SAAOC,QAAA,QAAc;AACrB,OAAAC,QAAY,iBAAW;AACvB,YAASC,KAAM,aAAW;AAE1B,SAASC,IAAA,EAAAC,SAAO,EAAAC,OAAA,EAAAC,QAAoB;AACpC,SAASC,KAAA,EAAAC,YAAgB,+BAAgB;AACzC,SAASC,cAAA,EAAAC,QAAA,QAA2B;AAiL9B,SAgEAC,mBAhEA;AA7KC,IAAAC,iBAAM,kBAAiET,IAAA,WAAAU,KAAA;IAC5E,IAAC;QAAAC,WAAA;QAAAC,yBAAA;QAAAC,YAAA;QAAAC,iBAAA;QAAAC,UAAA;QAAAC,MAAA,GAAAX,YAAA;QAAAY,YAAA,GAAAJ,YAAA;QAAAK,SAAA;QAAAC,YAAA;QAAAC,a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
{"version":3,"names":["React","ThemeSettingContext","createContext","toggle","set","_","themes"],"sources":["../../src/ThemeSettingContext.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAIX,IAAAC,mBAAM,kBACLD,KAAA,CAA6BE,aAAA;EACjCC,MAAA,EAAQ,SAAAA,CAAA,EAAM,CAAC;EACfC,GAAA,EAAK,SAAAA,CAAOC,CAAA,GAAC;EACbC,MAAA,EAAQ;AACV,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["constants","colorSchemes"],"sources":["../../src/constants.tsx"],"sourcesContent":[null],"mappings":"AAAO,IAAAA,SAAM,KAAY;EAACC,YACb,I","ignoreList":[]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { MEDIA } from "./constants.native.js";
|
|
2
|
-
var helpers = {},
|
|
3
|
-
getTheme = function (key, fallback) {
|
|
4
|
-
if (!(typeof window > "u")) {
|
|
5
|
-
var theme;
|
|
6
|
-
try {
|
|
7
|
-
theme = localStorage.getItem(key) || void 0;
|
|
8
|
-
} catch {}
|
|
9
|
-
return theme || fallback;
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
getSystemTheme = function (e) {
|
|
13
|
-
e || (e = window.matchMedia(MEDIA));
|
|
14
|
-
var isDark = e.matches,
|
|
15
|
-
systemTheme = isDark ? "dark" : "light";
|
|
16
|
-
return systemTheme;
|
|
17
|
-
};
|
|
18
|
-
export { getSystemTheme, getTheme, helpers };
|
|
19
|
-
//# sourceMappingURL=helpers.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["MEDIA","helpers","getTheme","key","fallback","window","theme","localStorage","getItem"],"sources":["../../src/helpers.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,KAAA,QAAa;AAEf,IAAAC,OAAM,KAAU;EAACC,QAGX,YAAAA,CAAyBC,GAAA,EAAAC,QAA2B;IAC/D,IAAI,SAAOC,MAAA,GAAW,GAAa;MACnC,IAAIC,KAAA;MACJ,IAAI;QACFA,KAAA,GAAQC,YAAa,CAAAC,OAAQ,CAAAL,GAAG,KAAK;MACvC,QAAY,CAEZ;MACA,OAAOG,KAAA,IAASF,QAAA;IAClB","ignoreList":[]}
|
package/dist/esm/index.native.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
|
package/dist/esm/types.native.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { isClient } from "@tamagui/constants";
|
|
3
|
-
var useRootTheme = function () {
|
|
4
|
-
var {
|
|
5
|
-
fallback = "light"
|
|
6
|
-
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
|
|
7
|
-
initialVal = fallback;
|
|
8
|
-
if (isClient) {
|
|
9
|
-
var classes = [...document.documentElement.classList];
|
|
10
|
-
initialVal = classes.includes("t_dark") ? "dark" : classes.includes("t_light") ? "light" : fallback;
|
|
11
|
-
}
|
|
12
|
-
return React.useState(initialVal);
|
|
13
|
-
};
|
|
14
|
-
export { useRootTheme };
|
|
15
|
-
//# sourceMappingURL=useRootTheme.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","isClient","useRootTheme","fallback","arguments","length","initialVal","classes","document","documentElement","classList","includes","useState"],"sources":["../../src/useRootTheme.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAClB,SAASC,QAAA,QAAgB;AAIlB,IAAAC,YAAM,YAAAA,CAAA,EAAgB;EAC3B;MAAAC,QAAW;IAAA,IAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,iBAAAA,SAAA;IAAAE,UAAA,GAAAH,QAAA;EACb,IAAiCF,QAG5B;IACH,IAAIM,OAAA,IAEA,GAAAC,QAAU,CAAAC,eAAA,CAAAC,SAAA,CAEZ;IACAJ,UAAA,GAAaC,OAAA,CAAQI,QAAA,CAAS,QAAQ,IAClC,SACAJ,OAAA,CAAQI,QAAA,CAAS,SAAS,IACxB,UACAR,QAAA;EACR;EAEA,OAAOH,KAAA,CAAMY,QAAA,CAAsBN,UAAU;AAC/C","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ThemeSettingContext } from "./ThemeSettingContext.native.js";
|
|
3
|
-
var useTheme = function () {
|
|
4
|
-
return React.useContext(ThemeSettingContext);
|
|
5
|
-
},
|
|
6
|
-
useThemeSetting = function () {
|
|
7
|
-
return React.useContext(ThemeSettingContext);
|
|
8
|
-
};
|
|
9
|
-
export { useTheme, useThemeSetting };
|
|
10
|
-
//# sourceMappingURL=useTheme.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","ThemeSettingContext","useTheme"],"sources":["../../src/useTheme.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAElB,SAASC,mBAAA,QAA2B;AAO7B,IAAAC,QAAM,YAAAA,CAAA,EAAgC","ignoreList":[]}
|