@tamagui/web 1.15.22 → 1.15.24
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/createComponent.js +28 -22
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/helpers/ThemeManager.js +5 -2
- package/dist/cjs/helpers/ThemeManager.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js +2 -1
- package/dist/cjs/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/cjs/views/Theme.js +1 -1
- package/dist/cjs/views/Theme.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.js +5 -3
- package/dist/cjs/views/ThemeDebug.js.map +1 -1
- package/dist/esm/createComponent.js +28 -22
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/createComponent.mjs +28 -22
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/helpers/ThemeManager.js +5 -2
- package/dist/esm/helpers/ThemeManager.js.map +1 -1
- package/dist/esm/helpers/ThemeManager.mjs +5 -2
- package/dist/esm/helpers/ThemeManager.mjs.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js +2 -1
- package/dist/esm/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +2 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/views/Theme.js +1 -1
- package/dist/esm/views/Theme.js.map +1 -1
- package/dist/esm/views/Theme.mjs +1 -1
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/ThemeDebug.js +5 -3
- package/dist/esm/views/ThemeDebug.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +5 -3
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/package.json +9 -9
- package/src/createComponent.tsx +30 -24
- package/src/helpers/ThemeManager.tsx +7 -2
- package/src/helpers/getThemeCSSRules.ts +2 -1
- package/src/views/Theme.tsx +1 -1
- package/src/views/ThemeDebug.tsx +5 -3
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/ThemeManager.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/views/ThemeDebug.d.ts.map +1 -1
- package/dist/cjs/addTheme.js +0 -78
- package/dist/cjs/addTheme.js.map +0 -6
- package/dist/cjs/updateTheme.js +0 -47
- package/dist/cjs/updateTheme.js.map +0 -6
- package/dist/esm/addTheme.js +0 -54
- package/dist/esm/addTheme.js.map +0 -6
- package/dist/esm/addTheme.mjs +0 -54
- package/dist/esm/addTheme.mjs.map +0 -6
- package/dist/esm/updateTheme.js +0 -23
- package/dist/esm/updateTheme.js.map +0 -6
- package/dist/esm/updateTheme.mjs +0 -23
- package/dist/esm/updateTheme.mjs.map +0 -6
- package/types/addTheme.d.ts +0 -33
- package/types/addTheme.d.ts.map +0 -1
- package/types/updateTheme.d.ts +0 -31
- package/types/updateTheme.d.ts.map +0 -1
package/dist/cjs/addTheme.js
DELETED
|
@@ -1,78 +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: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var addTheme_exports = {};
|
|
20
|
-
__export(addTheme_exports, {
|
|
21
|
-
addTheme: () => addTheme
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(addTheme_exports);
|
|
24
|
-
var import_constants = require("@tamagui/constants");
|
|
25
|
-
var import_config = require("./config.js");
|
|
26
|
-
var import_getThemeCSSRules = require("./helpers/getThemeCSSRules");
|
|
27
|
-
var import_themes = require("./helpers/themes.js");
|
|
28
|
-
function addTheme(props) {
|
|
29
|
-
var _a;
|
|
30
|
-
const config = (0, import_config.getConfig)();
|
|
31
|
-
if (process.env.NODE_ENV === "development") {
|
|
32
|
-
if (!config) {
|
|
33
|
-
throw new Error("No config");
|
|
34
|
-
}
|
|
35
|
-
const theme2 = config.themes[props.name];
|
|
36
|
-
if (!props.update && theme2) {
|
|
37
|
-
return { theme: theme2 };
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const { name: themeName, theme: themeIn, insertCSS } = props;
|
|
41
|
-
const theme = { ...themeIn };
|
|
42
|
-
for (const key in theme) {
|
|
43
|
-
(0, import_themes.ensureThemeVariable)(theme, key);
|
|
44
|
-
}
|
|
45
|
-
const themeProxied = (0, import_themes.proxyThemeToParents)(themeName, theme, config.themes);
|
|
46
|
-
config.themes[themeName] = themeProxied;
|
|
47
|
-
let cssRules = [];
|
|
48
|
-
if (import_constants.isWeb) {
|
|
49
|
-
if (insertCSS) {
|
|
50
|
-
cssRules = (0, import_getThemeCSSRules.getThemeCSSRules)({
|
|
51
|
-
// @ts-ignore this works but should be fixed types
|
|
52
|
-
config,
|
|
53
|
-
themeName,
|
|
54
|
-
names: [themeName],
|
|
55
|
-
theme
|
|
56
|
-
});
|
|
57
|
-
const id = `t_theme_style_${themeName}`;
|
|
58
|
-
const existing = document.querySelector(`#${id}`);
|
|
59
|
-
const style = document.createElement("style");
|
|
60
|
-
style.id = id;
|
|
61
|
-
style.appendChild(document.createTextNode(cssRules.join("\n")));
|
|
62
|
-
document.head.appendChild(style);
|
|
63
|
-
if (existing) {
|
|
64
|
-
(_a = existing.parentElement) == null ? void 0 : _a.removeChild(existing);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
(0, import_config.updateConfig)("themes", { ...config.themes, [themeName]: themeProxied });
|
|
69
|
-
return {
|
|
70
|
-
theme: themeProxied,
|
|
71
|
-
cssRules
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
-
0 && (module.exports = {
|
|
76
|
-
addTheme
|
|
77
|
-
});
|
|
78
|
-
//# sourceMappingURL=addTheme.js.map
|
package/dist/cjs/addTheme.js.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/addTheme.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB;AAEtB,oBAAwC;AACxC,8BAAiC;AACjC,oBAAyD;AAIlD,SAAS,SAAS,OAKtB;AAbH;AAcE,QAAM,aAAS,yBAAU;AAEzB,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,MAAM,WAAW;AAAA,IAC7B;AACA,UAAMA,SAAQ,OAAO,OAAO,MAAM,IAAI;AACtC,QAAI,CAAC,MAAM,UAAUA,QAAO;AAC1B,aAAO,EAAE,OAAAA,OAAM;AAAA,IACjB;AAAA,EACF;AAEA,QAAM,EAAE,MAAM,WAAW,OAAO,SAAS,UAAU,IAAI;AACvD,QAAM,QAAQ,EAAE,GAAG,QAAQ;AAC3B,aAAW,OAAO,OAAO;AACvB,2CAAoB,OAAO,GAAG;AAAA,EAChC;AAEA,QAAM,mBAAe,mCAAoB,WAAW,OAAO,OAAO,MAAM;AACxE,SAAO,OAAO,SAAS,IAAI;AAE3B,MAAI,WAAqB,CAAC;AAE1B,MAAI,wBAAO;AACT,QAAI,WAAW;AACb,qBAAW,0CAAiB;AAAA;AAAA,QAE1B;AAAA,QACA;AAAA,QACA,OAAO,CAAC,SAAS;AAAA,QACjB;AAAA,MACF,CAAC;AACD,YAAM,KAAK,iBAAiB;AAC5B,YAAM,WAAW,SAAS,cAAc,IAAI,IAAI;AAChD,YAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,YAAM,KAAK;AACX,YAAM,YAAY,SAAS,eAAe,SAAS,KAAK,IAAI,CAAC,CAAC;AAC9D,eAAS,KAAK,YAAY,KAAK;AAC/B,UAAI,UAAU;AACZ,uBAAS,kBAAT,mBAAwB,YAAY;AAAA,MACtC;AAAA,IACF;AAAA,EACF;AAEA,kCAAa,UAAU,EAAE,GAAG,OAAO,QAAQ,CAAC,SAAS,GAAG,aAAa,CAAC;AAGtE,SAAO;AAAA,IACL,OAAO;AAAA,IACP;AAAA,EACF;AACF;",
|
|
5
|
-
"names": ["theme"]
|
|
6
|
-
}
|
package/dist/cjs/updateTheme.js
DELETED
|
@@ -1,47 +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: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var updateTheme_exports = {};
|
|
20
|
-
__export(updateTheme_exports, {
|
|
21
|
-
updateTheme: () => updateTheme
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(updateTheme_exports);
|
|
24
|
-
var import_addTheme = require("./addTheme.js");
|
|
25
|
-
var import_useTheme = require("./hooks/useTheme.js");
|
|
26
|
-
function updateTheme({
|
|
27
|
-
name,
|
|
28
|
-
theme
|
|
29
|
-
}) {
|
|
30
|
-
const next = (0, import_addTheme.addTheme)({ name, theme, insertCSS: true, update: true });
|
|
31
|
-
if (process.env.TAMAGUI_TARGET === "native") {
|
|
32
|
-
import_useTheme.activeThemeManagers.forEach((manager) => {
|
|
33
|
-
if (manager.state.name === name) {
|
|
34
|
-
manager.updateState({
|
|
35
|
-
name,
|
|
36
|
-
forceTheme: next.theme
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
return next;
|
|
42
|
-
}
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
updateTheme
|
|
46
|
-
});
|
|
47
|
-
//# sourceMappingURL=updateTheme.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/updateTheme.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AACzB,sBAAoC;AAI7B,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AACF,GAGG;AACD,QAAM,WAAO,0BAAS,EAAE,MAAM,OAAO,WAAW,MAAM,QAAQ,KAAK,CAAC;AAEpE,MAAI,QAAQ,IAAI,mBAAmB,UAAU;AAC3C,wCAAoB,QAAQ,CAAC,YAAY;AACvC,UAAI,QAAQ,MAAM,SAAS,MAAM;AAC/B,gBAAQ,YAAY;AAAA,UAClB;AAAA,UACA,YAAY,KAAK;AAAA,QACnB,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/esm/addTheme.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { isWeb } from "@tamagui/constants";
|
|
2
|
-
import { getConfig, updateConfig } from "./config.js";
|
|
3
|
-
import { getThemeCSSRules } from "./helpers/getThemeCSSRules";
|
|
4
|
-
import { ensureThemeVariable, proxyThemeToParents } from "./helpers/themes.js";
|
|
5
|
-
function addTheme(props) {
|
|
6
|
-
var _a;
|
|
7
|
-
const config = getConfig();
|
|
8
|
-
if (process.env.NODE_ENV === "development") {
|
|
9
|
-
if (!config) {
|
|
10
|
-
throw new Error("No config");
|
|
11
|
-
}
|
|
12
|
-
const theme2 = config.themes[props.name];
|
|
13
|
-
if (!props.update && theme2) {
|
|
14
|
-
return { theme: theme2 };
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const { name: themeName, theme: themeIn, insertCSS } = props;
|
|
18
|
-
const theme = { ...themeIn };
|
|
19
|
-
for (const key in theme) {
|
|
20
|
-
ensureThemeVariable(theme, key);
|
|
21
|
-
}
|
|
22
|
-
const themeProxied = proxyThemeToParents(themeName, theme, config.themes);
|
|
23
|
-
config.themes[themeName] = themeProxied;
|
|
24
|
-
let cssRules = [];
|
|
25
|
-
if (isWeb) {
|
|
26
|
-
if (insertCSS) {
|
|
27
|
-
cssRules = getThemeCSSRules({
|
|
28
|
-
// @ts-ignore this works but should be fixed types
|
|
29
|
-
config,
|
|
30
|
-
themeName,
|
|
31
|
-
names: [themeName],
|
|
32
|
-
theme
|
|
33
|
-
});
|
|
34
|
-
const id = `t_theme_style_${themeName}`;
|
|
35
|
-
const existing = document.querySelector(`#${id}`);
|
|
36
|
-
const style = document.createElement("style");
|
|
37
|
-
style.id = id;
|
|
38
|
-
style.appendChild(document.createTextNode(cssRules.join("\n")));
|
|
39
|
-
document.head.appendChild(style);
|
|
40
|
-
if (existing) {
|
|
41
|
-
(_a = existing.parentElement) == null ? void 0 : _a.removeChild(existing);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
updateConfig("themes", { ...config.themes, [themeName]: themeProxied });
|
|
46
|
-
return {
|
|
47
|
-
theme: themeProxied,
|
|
48
|
-
cssRules
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
export {
|
|
52
|
-
addTheme
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=addTheme.js.map
|
package/dist/esm/addTheme.js.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/addTheme.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,WAAW,oBAAoB;AACxC,SAAS,wBAAwB;AACjC,SAAS,qBAAqB,2BAA2B;AAIlD,SAAS,SAAS,OAKtB;AAbH;AAcE,QAAM,SAAS,UAAU;AAEzB,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,MAAM,WAAW;AAAA,IAC7B;AACA,UAAMA,SAAQ,OAAO,OAAO,MAAM,IAAI;AACtC,QAAI,CAAC,MAAM,UAAUA,QAAO;AAC1B,aAAO,EAAE,OAAAA,OAAM;AAAA,IACjB;AAAA,EACF;AAEA,QAAM,EAAE,MAAM,WAAW,OAAO,SAAS,UAAU,IAAI;AACvD,QAAM,QAAQ,EAAE,GAAG,QAAQ;AAC3B,aAAW,OAAO,OAAO;AACvB,wBAAoB,OAAO,GAAG;AAAA,EAChC;AAEA,QAAM,eAAe,oBAAoB,WAAW,OAAO,OAAO,MAAM;AACxE,SAAO,OAAO,SAAS,IAAI;AAE3B,MAAI,WAAqB,CAAC;AAE1B,MAAI,OAAO;AACT,QAAI,WAAW;AACb,iBAAW,iBAAiB;AAAA;AAAA,QAE1B;AAAA,QACA;AAAA,QACA,OAAO,CAAC,SAAS;AAAA,QACjB;AAAA,MACF,CAAC;AACD,YAAM,KAAK,iBAAiB;AAC5B,YAAM,WAAW,SAAS,cAAc,IAAI,IAAI;AAChD,YAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,YAAM,KAAK;AACX,YAAM,YAAY,SAAS,eAAe,SAAS,KAAK,IAAI,CAAC,CAAC;AAC9D,eAAS,KAAK,YAAY,KAAK;AAC/B,UAAI,UAAU;AACZ,uBAAS,kBAAT,mBAAwB,YAAY;AAAA,MACtC;AAAA,IACF;AAAA,EACF;AAEA,eAAa,UAAU,EAAE,GAAG,OAAO,QAAQ,CAAC,SAAS,GAAG,aAAa,CAAC;AAGtE,SAAO;AAAA,IACL,OAAO;AAAA,IACP;AAAA,EACF;AACF;",
|
|
5
|
-
"names": ["theme"]
|
|
6
|
-
}
|
package/dist/esm/addTheme.mjs
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { isWeb } from "@tamagui/constants";
|
|
2
|
-
import { getConfig, updateConfig } from "./config.js";
|
|
3
|
-
import { getThemeCSSRules } from "./helpers/getThemeCSSRules";
|
|
4
|
-
import { ensureThemeVariable, proxyThemeToParents } from "./helpers/themes.js";
|
|
5
|
-
function addTheme(props) {
|
|
6
|
-
var _a;
|
|
7
|
-
const config = getConfig();
|
|
8
|
-
if (process.env.NODE_ENV === "development") {
|
|
9
|
-
if (!config) {
|
|
10
|
-
throw new Error("No config");
|
|
11
|
-
}
|
|
12
|
-
const theme2 = config.themes[props.name];
|
|
13
|
-
if (!props.update && theme2) {
|
|
14
|
-
return { theme: theme2 };
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const { name: themeName, theme: themeIn, insertCSS } = props;
|
|
18
|
-
const theme = { ...themeIn };
|
|
19
|
-
for (const key in theme) {
|
|
20
|
-
ensureThemeVariable(theme, key);
|
|
21
|
-
}
|
|
22
|
-
const themeProxied = proxyThemeToParents(themeName, theme, config.themes);
|
|
23
|
-
config.themes[themeName] = themeProxied;
|
|
24
|
-
let cssRules = [];
|
|
25
|
-
if (isWeb) {
|
|
26
|
-
if (insertCSS) {
|
|
27
|
-
cssRules = getThemeCSSRules({
|
|
28
|
-
// @ts-ignore this works but should be fixed types
|
|
29
|
-
config,
|
|
30
|
-
themeName,
|
|
31
|
-
names: [themeName],
|
|
32
|
-
theme
|
|
33
|
-
});
|
|
34
|
-
const id = `t_theme_style_${themeName}`;
|
|
35
|
-
const existing = document.querySelector(`#${id}`);
|
|
36
|
-
const style = document.createElement("style");
|
|
37
|
-
style.id = id;
|
|
38
|
-
style.appendChild(document.createTextNode(cssRules.join("\n")));
|
|
39
|
-
document.head.appendChild(style);
|
|
40
|
-
if (existing) {
|
|
41
|
-
(_a = existing.parentElement) == null ? void 0 : _a.removeChild(existing);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
updateConfig("themes", { ...config.themes, [themeName]: themeProxied });
|
|
46
|
-
return {
|
|
47
|
-
theme: themeProxied,
|
|
48
|
-
cssRules
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
export {
|
|
52
|
-
addTheme
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=addTheme.mjs.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/addTheme.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,WAAW,oBAAoB;AACxC,SAAS,wBAAwB;AACjC,SAAS,qBAAqB,2BAA2B;AAIlD,SAAS,SAAS,OAKtB;AAbH;AAcE,QAAM,SAAS,UAAU;AAEzB,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,MAAM,WAAW;AAAA,IAC7B;AACA,UAAMA,SAAQ,OAAO,OAAO,MAAM,IAAI;AACtC,QAAI,CAAC,MAAM,UAAUA,QAAO;AAC1B,aAAO,EAAE,OAAAA,OAAM;AAAA,IACjB;AAAA,EACF;AAEA,QAAM,EAAE,MAAM,WAAW,OAAO,SAAS,UAAU,IAAI;AACvD,QAAM,QAAQ,EAAE,GAAG,QAAQ;AAC3B,aAAW,OAAO,OAAO;AACvB,wBAAoB,OAAO,GAAG;AAAA,EAChC;AAEA,QAAM,eAAe,oBAAoB,WAAW,OAAO,OAAO,MAAM;AACxE,SAAO,OAAO,SAAS,IAAI;AAE3B,MAAI,WAAqB,CAAC;AAE1B,MAAI,OAAO;AACT,QAAI,WAAW;AACb,iBAAW,iBAAiB;AAAA;AAAA,QAE1B;AAAA,QACA;AAAA,QACA,OAAO,CAAC,SAAS;AAAA,QACjB;AAAA,MACF,CAAC;AACD,YAAM,KAAK,iBAAiB;AAC5B,YAAM,WAAW,SAAS,cAAc,IAAI,IAAI;AAChD,YAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,YAAM,KAAK;AACX,YAAM,YAAY,SAAS,eAAe,SAAS,KAAK,IAAI,CAAC,CAAC;AAC9D,eAAS,KAAK,YAAY,KAAK;AAC/B,UAAI,UAAU;AACZ,uBAAS,kBAAT,mBAAwB,YAAY;AAAA,MACtC;AAAA,IACF;AAAA,EACF;AAEA,eAAa,UAAU,EAAE,GAAG,OAAO,QAAQ,CAAC,SAAS,GAAG,aAAa,CAAC;AAGtE,SAAO;AAAA,IACL,OAAO;AAAA,IACP;AAAA,EACF;AACF;",
|
|
5
|
-
"names": ["theme"]
|
|
6
|
-
}
|
package/dist/esm/updateTheme.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { addTheme } from "./addTheme.js";
|
|
2
|
-
import { activeThemeManagers } from "./hooks/useTheme.js";
|
|
3
|
-
function updateTheme({
|
|
4
|
-
name,
|
|
5
|
-
theme
|
|
6
|
-
}) {
|
|
7
|
-
const next = addTheme({ name, theme, insertCSS: true, update: true });
|
|
8
|
-
if (process.env.TAMAGUI_TARGET === "native") {
|
|
9
|
-
activeThemeManagers.forEach((manager) => {
|
|
10
|
-
if (manager.state.name === name) {
|
|
11
|
-
manager.updateState({
|
|
12
|
-
name,
|
|
13
|
-
forceTheme: next.theme
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return next;
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
updateTheme
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=updateTheme.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/updateTheme.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AAI7B,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AACF,GAGG;AACD,QAAM,OAAO,SAAS,EAAE,MAAM,OAAO,WAAW,MAAM,QAAQ,KAAK,CAAC;AAEpE,MAAI,QAAQ,IAAI,mBAAmB,UAAU;AAC3C,wBAAoB,QAAQ,CAAC,YAAY;AACvC,UAAI,QAAQ,MAAM,SAAS,MAAM;AAC/B,gBAAQ,YAAY;AAAA,UAClB;AAAA,UACA,YAAY,KAAK;AAAA,QACnB,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/esm/updateTheme.mjs
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { addTheme } from "./addTheme.js";
|
|
2
|
-
import { activeThemeManagers } from "./hooks/useTheme.js";
|
|
3
|
-
function updateTheme({
|
|
4
|
-
name,
|
|
5
|
-
theme
|
|
6
|
-
}) {
|
|
7
|
-
const next = addTheme({ name, theme, insertCSS: true, update: true });
|
|
8
|
-
if (process.env.TAMAGUI_TARGET === "native") {
|
|
9
|
-
activeThemeManagers.forEach((manager) => {
|
|
10
|
-
if (manager.state.name === name) {
|
|
11
|
-
manager.updateState({
|
|
12
|
-
name,
|
|
13
|
-
forceTheme: next.theme
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return next;
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
updateTheme
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=updateTheme.mjs.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/updateTheme.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AAI7B,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AACF,GAGG;AACD,QAAM,OAAO,SAAS,EAAE,MAAM,OAAO,WAAW,MAAM,QAAQ,KAAK,CAAC;AAEpE,MAAI,QAAQ,IAAI,mBAAmB,UAAU;AAC3C,wBAAoB,QAAQ,CAAC,YAAY;AACvC,UAAI,QAAQ,MAAM,SAAS,MAAM;AAC/B,gBAAQ,YAAY;AAAA,UAClB;AAAA,UACA,YAAY,KAAK;AAAA,QACnB,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/types/addTheme.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ThemeDefinition } from './types.js';
|
|
2
|
-
/** @deprecated import from @tamagui/theme instead */
|
|
3
|
-
export declare function addTheme(props: {
|
|
4
|
-
name: string;
|
|
5
|
-
theme: Partial<Record<keyof ThemeDefinition, any>>;
|
|
6
|
-
insertCSS?: boolean;
|
|
7
|
-
update?: boolean;
|
|
8
|
-
}): {
|
|
9
|
-
theme: {
|
|
10
|
-
[x: string]: import("./createVariable.js").Variable<any>;
|
|
11
|
-
background?: import("./createVariable.js").Variable<any> | undefined;
|
|
12
|
-
backgroundHover?: import("./createVariable.js").Variable<any> | undefined;
|
|
13
|
-
backgroundPress?: import("./createVariable.js").Variable<any> | undefined;
|
|
14
|
-
backgroundFocus?: import("./createVariable.js").Variable<any> | undefined;
|
|
15
|
-
color?: import("./createVariable.js").Variable<any> | undefined;
|
|
16
|
-
colorHover?: import("./createVariable.js").Variable<any> | undefined;
|
|
17
|
-
colorPress?: import("./createVariable.js").Variable<any> | undefined;
|
|
18
|
-
colorFocus?: import("./createVariable.js").Variable<any> | undefined;
|
|
19
|
-
borderColor?: import("./createVariable.js").Variable<any> | undefined;
|
|
20
|
-
borderColorHover?: import("./createVariable.js").Variable<any> | undefined;
|
|
21
|
-
borderColorPress?: import("./createVariable.js").Variable<any> | undefined;
|
|
22
|
-
borderColorFocus?: import("./createVariable.js").Variable<any> | undefined;
|
|
23
|
-
shadowColor?: import("./createVariable.js").Variable<any> | undefined;
|
|
24
|
-
shadowColorHover?: import("./createVariable.js").Variable<any> | undefined;
|
|
25
|
-
shadowColorPress?: import("./createVariable.js").Variable<any> | undefined;
|
|
26
|
-
shadowColorFocus?: import("./createVariable.js").Variable<any> | undefined;
|
|
27
|
-
};
|
|
28
|
-
cssRules?: undefined;
|
|
29
|
-
} | {
|
|
30
|
-
theme: any;
|
|
31
|
-
cssRules: string[];
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=addTheme.d.ts.map
|
package/types/addTheme.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addTheme.d.ts","sourceRoot":"","sources":["../src/addTheme.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAe,MAAM,YAAY,CAAA;AAEzD,qDAAqD;AACrD,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,eAAe,EAAE,GAAG,CAAC,CAAC,CAAA;IAClD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;;;;;;;;;;;;;;;;;;;;;;;;EAoDA"}
|
package/types/updateTheme.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { ThemeDefinition } from './types.js';
|
|
2
|
-
/** @deprecated import from @tamagui/theme instead */
|
|
3
|
-
export declare function updateTheme({ name, theme, }: {
|
|
4
|
-
name: string;
|
|
5
|
-
theme: Partial<Record<keyof ThemeDefinition, any>>;
|
|
6
|
-
}): {
|
|
7
|
-
theme: {
|
|
8
|
-
[x: string]: import("./createVariable.js").Variable<any>;
|
|
9
|
-
background?: import("./createVariable.js").Variable<any> | undefined;
|
|
10
|
-
backgroundHover?: import("./createVariable.js").Variable<any> | undefined;
|
|
11
|
-
backgroundPress?: import("./createVariable.js").Variable<any> | undefined;
|
|
12
|
-
backgroundFocus?: import("./createVariable.js").Variable<any> | undefined;
|
|
13
|
-
color?: import("./createVariable.js").Variable<any> | undefined;
|
|
14
|
-
colorHover?: import("./createVariable.js").Variable<any> | undefined;
|
|
15
|
-
colorPress?: import("./createVariable.js").Variable<any> | undefined;
|
|
16
|
-
colorFocus?: import("./createVariable.js").Variable<any> | undefined;
|
|
17
|
-
borderColor?: import("./createVariable.js").Variable<any> | undefined;
|
|
18
|
-
borderColorHover?: import("./createVariable.js").Variable<any> | undefined;
|
|
19
|
-
borderColorPress?: import("./createVariable.js").Variable<any> | undefined;
|
|
20
|
-
borderColorFocus?: import("./createVariable.js").Variable<any> | undefined;
|
|
21
|
-
shadowColor?: import("./createVariable.js").Variable<any> | undefined;
|
|
22
|
-
shadowColorHover?: import("./createVariable.js").Variable<any> | undefined;
|
|
23
|
-
shadowColorPress?: import("./createVariable.js").Variable<any> | undefined;
|
|
24
|
-
shadowColorFocus?: import("./createVariable.js").Variable<any> | undefined;
|
|
25
|
-
};
|
|
26
|
-
cssRules?: undefined;
|
|
27
|
-
} | {
|
|
28
|
-
theme: any;
|
|
29
|
-
cssRules: string[];
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=updateTheme.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateTheme.d.ts","sourceRoot":"","sources":["../src/updateTheme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,qDAAqD;AACrD,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,KAAK,GACN,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,eAAe,EAAE,GAAG,CAAC,CAAC,CAAA;CACnD;;;;;;;;;;;;;;;;;;;;;;;;EAeA"}
|