@tamagui/web 1.48.7 → 1.48.8
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/createTamagui.js +2 -1
- package/dist/cjs/createTamagui.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeToParents.js +75 -0
- package/dist/cjs/helpers/proxyThemeToParents.js.map +6 -0
- package/dist/cjs/helpers/themes.js +2 -49
- package/dist/cjs/helpers/themes.js.map +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/createTamagui.js +3 -2
- package/dist/esm/createTamagui.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.js +49 -0
- package/dist/esm/helpers/proxyThemeToParents.js.map +6 -0
- package/dist/esm/helpers/themes.js +1 -46
- package/dist/esm/helpers/themes.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +9 -9
- package/src/createTamagui.ts +3 -2
- package/src/helpers/proxyThemeToParents.ts +66 -0
- package/src/helpers/themes.ts +0 -78
- package/src/index.ts +1 -0
- package/types/createTamagui.d.ts.map +1 -1
- package/types/helpers/proxyThemeToParents.d.ts +5 -0
- package/types/helpers/proxyThemeToParents.d.ts.map +1 -0
- package/types/helpers/themes.d.ts +0 -3
- package/types/helpers/themes.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
|
@@ -26,6 +26,7 @@ var import_config = require("./config");
|
|
|
26
26
|
var import_createVariables = require("./createVariables");
|
|
27
27
|
var import_getThemeCSSRules = require("./helpers/getThemeCSSRules");
|
|
28
28
|
var import_insertStyleRule = require("./helpers/insertStyleRule");
|
|
29
|
+
var import_proxyThemeToParents = require("./helpers/proxyThemeToParents");
|
|
29
30
|
var import_registerCSSVariable = require("./helpers/registerCSSVariable");
|
|
30
31
|
var import_themes = require("./helpers/themes");
|
|
31
32
|
var import_useMedia = require("./hooks/useMedia");
|
|
@@ -132,7 +133,7 @@ ${JSON.stringify(
|
|
|
132
133
|
}
|
|
133
134
|
const themesIn = { ...configIn.themes };
|
|
134
135
|
const dedupedThemes = foundThemes ?? getThemesDeduped(themesIn);
|
|
135
|
-
const themes = (0,
|
|
136
|
+
const themes = (0, import_proxyThemeToParents.proxyThemesToParents)(dedupedThemes);
|
|
136
137
|
return {
|
|
137
138
|
themes,
|
|
138
139
|
cssRuleSets,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createTamagui.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB;AAEtB,oBAA2C;AAE3C,6BAAgC;AAChC,8BAAiC;AACjC,6BAIO;AACP,iCAAmD;AACnD,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB;AAEtB,oBAA2C;AAE3C,6BAAgC;AAChC,8BAAiC;AACjC,6BAIO;AACP,iCAAqC;AACrC,iCAAmD;AACnD,oBAAoC;AACpC,sBAA+B;AAC/B,wBAAiD;AACjD,qBAAwB;AAaxB,MAAM,iBAAiB,oBAAI,QAAsB;AAE1C,SAAS,cACd,UAC0B;AAjC5B;AAkCE,MAAI,eAAe,IAAI,QAAQ,GAAG;AAChC,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC,SAAS,QAAQ;AACpB,YAAM,IAAI,MAAM,oBAAoB;AAAA,IACtC;AACA,QAAI,CAAC,SAAS,QAAQ;AACpB,YAAM,IAAI,MAAM,oBAAoB;AAAA,IACtC;AACA,QAAI,CAAC,SAAS,OAAO;AACnB,YAAM,IAAI,MAAM,mBAAmB;AAAA,IACrC;AAAA,EACF;AAGA,QAAM,eAAoB,OAAO;AAAA,IAC/B,OAAO,QAAQ,SAAS,MAAM,EA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;AAE9B,UAAM,4BAA4B,UAAU,WAAW,MAAM,IACzD,SACA,UAAU,WAAW,OAAO,IAC5B,UACA;AAEJ,UAAM,WAAW,OAAO,SAAS;AAIjC,UAAM,MAAM,4BAA4B,KAAK,UAAU,QAAQ;AAG/D,QAAI,SAAS,IAAI,GAAG,GAAG;AACrB,YAAM,IAAI,SAAS,IAAI,GAAG;AAC1B,QAAE,MAAM,KAAK,SAAS;AACtB;AAAA,IACF;AAIA,UAAM,QAAQ,EAAE,GAAG,SAAS;AAE5B,eAAWC,QAAO,OAAO;AAEvB,6CAAoB,OAAOA,IAAG;AAAA,IAChC;AAGA,UAAM,UAAwB;AAAA,MAC5B,OAAO,CAAC,SAAS;AAAA,MACjB;AAAA,IACF;AACA,kBAAc,KAAK,OAAO;AAC1B,aAAS,IAAI,KAAK,OAAO;AAAA,EAC3B;AAEA,SAAO;AACT;",
|
|
5
5
|
"names": ["k", "v", "declarationsToRuleSet", "declarations", "key"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
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 proxyThemeToParents_exports = {};
|
|
20
|
+
__export(proxyThemeToParents_exports, {
|
|
21
|
+
proxyThemeToParents: () => proxyThemeToParents,
|
|
22
|
+
proxyThemesToParents: () => proxyThemesToParents,
|
|
23
|
+
themesRaw: () => themesRaw
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(proxyThemeToParents_exports);
|
|
26
|
+
var import_config = require("../config");
|
|
27
|
+
var import_getThemeUnwrapped = require("../hooks/getThemeUnwrapped");
|
|
28
|
+
const themesRaw = {};
|
|
29
|
+
function proxyThemesToParents(dedupedThemes) {
|
|
30
|
+
for (const { names, theme } of dedupedThemes) {
|
|
31
|
+
for (const name of names) {
|
|
32
|
+
themesRaw[name] = theme;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const themes = {};
|
|
36
|
+
for (const { names, theme } of dedupedThemes) {
|
|
37
|
+
for (const themeName of names) {
|
|
38
|
+
const proxiedTheme = proxyThemeToParents(themeName, theme);
|
|
39
|
+
themes[themeName] = proxiedTheme;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return themes;
|
|
43
|
+
}
|
|
44
|
+
function proxyThemeToParents(themeName, theme) {
|
|
45
|
+
const cur = [];
|
|
46
|
+
const parents = themeName.split("_").slice(0, -1).map((part) => {
|
|
47
|
+
cur.push(part);
|
|
48
|
+
return cur.join("_");
|
|
49
|
+
});
|
|
50
|
+
const numParents = parents.length;
|
|
51
|
+
return new Proxy(theme, {
|
|
52
|
+
get(target, key) {
|
|
53
|
+
if (key === import_getThemeUnwrapped.GetThemeUnwrapped)
|
|
54
|
+
return theme;
|
|
55
|
+
if (Reflect.has(target, key))
|
|
56
|
+
return Reflect.get(target, key);
|
|
57
|
+
for (let i = numParents - 1; i >= 0; i--) {
|
|
58
|
+
const parent = themesRaw[parents[i]];
|
|
59
|
+
if (!parent)
|
|
60
|
+
continue;
|
|
61
|
+
if (Reflect.has(parent, key)) {
|
|
62
|
+
return Reflect.get(parent, key);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return (0, import_config.getToken)(key) ?? Reflect.get(target, key);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
+
0 && (module.exports = {
|
|
71
|
+
proxyThemeToParents,
|
|
72
|
+
proxyThemesToParents,
|
|
73
|
+
themesRaw
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=proxyThemeToParents.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/proxyThemeToParents.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAyB;AACzB,+BAAkC;AAG3B,MAAM,YAAyC,CAAC;AAIhD,SAAS,qBACd,eAC6B;AAE7B,aAAW,EAAE,OAAO,MAAM,KAAK,eAAe;AAC5C,eAAW,QAAQ,OAAO;AACxB,gBAAU,IAAI,IAAI;AAAA,IACpB;AAAA,EACF;AAEA,QAAM,SAAsC,CAAC;AAM7C,aAAW,EAAE,OAAO,MAAM,KAAK,eAAe;AAC5C,eAAW,aAAa,OAAO;AAC7B,YAAM,eAAe,oBAAoB,WAAW,KAAK;AACzD,aAAO,SAAS,IAAI;AAAA,IACtB;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,oBAAoB,WAAmB,OAAoB;AACzE,QAAM,MAAgB,CAAC;AAIvB,QAAM,UAAU,UACb,MAAM,GAAG,EACT,MAAM,GAAG,EAAE,EACX,IAAI,CAAC,SAAS;AACb,QAAI,KAAK,IAAI;AACb,WAAO,IAAI,KAAK,GAAG;AAAA,EACrB,CAAC;AAEH,QAAM,aAAa,QAAQ;AAG3B,SAAO,IAAI,MAAM,OAAO;AAAA,IACtB,IAAI,QAAQ,KAAK;AACf,UAAI,QAAQ;AAAmB,eAAO;AACtC,UAAI,QAAQ,IAAI,QAAQ,GAAG;AAAG,eAAO,QAAQ,IAAI,QAAQ,GAAG;AAE5D,eAAS,IAAI,aAAa,GAAG,KAAK,GAAG,KAAK;AACxC,cAAM,SAAS,UAAU,QAAQ,CAAC,CAAC;AACnC,YAAI,CAAC;AAAQ;AACb,YAAI,QAAQ,IAAI,QAAQ,GAAG,GAAG;AAC5B,iBAAO,QAAQ,IAAI,QAAQ,GAAG;AAAA,QAChC;AAAA,MACF;AACA,iBAAO,wBAAS,GAAU,KAAK,QAAQ,IAAI,QAAQ,GAAG;AAAA,IACxD;AAAA,EACF,CAAC;AACH;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -18,14 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var themes_exports = {};
|
|
20
20
|
__export(themes_exports, {
|
|
21
|
-
ensureThemeVariable: () => ensureThemeVariable
|
|
22
|
-
proxyThemeToParents: () => proxyThemeToParents,
|
|
23
|
-
proxyThemesToParents: () => proxyThemesToParents
|
|
21
|
+
ensureThemeVariable: () => ensureThemeVariable
|
|
24
22
|
});
|
|
25
23
|
module.exports = __toCommonJS(themes_exports);
|
|
26
|
-
var import_config = require("../config");
|
|
27
24
|
var import_createVariable = require("../createVariable");
|
|
28
|
-
var import_getThemeUnwrapped = require("../hooks/getThemeUnwrapped");
|
|
29
25
|
function ensureThemeVariable(theme, key) {
|
|
30
26
|
const val = theme[key];
|
|
31
27
|
const themeKey = key;
|
|
@@ -45,51 +41,8 @@ function ensureThemeVariable(theme, key) {
|
|
|
45
41
|
}
|
|
46
42
|
}
|
|
47
43
|
}
|
|
48
|
-
const themesRaw = {};
|
|
49
|
-
function proxyThemesToParents(dedupedThemes, tokens) {
|
|
50
|
-
for (const { names, theme } of dedupedThemes) {
|
|
51
|
-
for (const name of names) {
|
|
52
|
-
themesRaw[name] = theme;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
const themes = {};
|
|
56
|
-
for (const { names, theme } of dedupedThemes) {
|
|
57
|
-
for (const themeName of names) {
|
|
58
|
-
const proxiedTheme = proxyThemeToParents(themeName, theme, tokens);
|
|
59
|
-
themes[themeName] = proxiedTheme;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return themes;
|
|
63
|
-
}
|
|
64
|
-
function proxyThemeToParents(themeName, theme, tokens = (0, import_config.getConfig)().tokensParsed) {
|
|
65
|
-
const cur = [];
|
|
66
|
-
const parents = themeName.split("_").slice(0, -1).map((part) => {
|
|
67
|
-
cur.push(part);
|
|
68
|
-
return cur.join("_");
|
|
69
|
-
});
|
|
70
|
-
const numParents = parents.length;
|
|
71
|
-
return new Proxy(theme, {
|
|
72
|
-
get(target, key) {
|
|
73
|
-
if (key === import_getThemeUnwrapped.GetThemeUnwrapped)
|
|
74
|
-
return theme;
|
|
75
|
-
if (Reflect.has(target, key))
|
|
76
|
-
return Reflect.get(target, key);
|
|
77
|
-
for (let i = numParents - 1; i >= 0; i--) {
|
|
78
|
-
const parent = themesRaw[parents[i]];
|
|
79
|
-
if (!parent)
|
|
80
|
-
continue;
|
|
81
|
-
if (Reflect.has(parent, key)) {
|
|
82
|
-
return Reflect.get(parent, key);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return Reflect.get(tokens, key);
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
44
|
// Annotate the CommonJS export names for ESM import in node:
|
|
90
45
|
0 && (module.exports = {
|
|
91
|
-
ensureThemeVariable
|
|
92
|
-
proxyThemeToParents,
|
|
93
|
-
proxyThemesToParents
|
|
46
|
+
ensureThemeVariable
|
|
94
47
|
});
|
|
95
48
|
//# sourceMappingURL=themes.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/themes.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA2C;AAIpC,SAAS,oBAAoB,OAAY,KAAa;AAC3D,QAAM,MAAM,MAAM,GAAG;AACrB,QAAM,WAAW;AACjB,MAAI,KAAC,kCAAW,GAAG,GAAG;AACpB,UAAM,GAAG,QAAI,sCAAe;AAAA,MAC1B,KAAK;AAAA,MACL,MAAM;AAAA,MACN;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,QAAI,IAAI,SAAS,UAAU;AAEzB,YAAM,GAAG,QAAI,sCAAe;AAAA,QAC1B,KAAK,IAAI;AAAA,QACT,MAAM;AAAA,QACN,KAAK,IAAI;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -64,6 +64,7 @@ __reExport(src_exports, require("./helpers/matchMedia"), module.exports);
|
|
|
64
64
|
__reExport(src_exports, require("./helpers/mergeProps"), module.exports);
|
|
65
65
|
__reExport(src_exports, require("./helpers/normalizeColor"), module.exports);
|
|
66
66
|
__reExport(src_exports, require("./helpers/proxyThemeVariables"), module.exports);
|
|
67
|
+
__reExport(src_exports, require("./helpers/proxyThemeToParents"), module.exports);
|
|
67
68
|
__reExport(src_exports, require("./helpers/pseudoDescriptors"), module.exports);
|
|
68
69
|
__reExport(src_exports, require("./helpers/themeable"), module.exports);
|
|
69
70
|
__reExport(src_exports, require("./helpers/themes"), module.exports);
|
|
@@ -138,6 +139,7 @@ __reExport(src_exports, require("./setupHooks"), module.exports);
|
|
|
138
139
|
...require("./helpers/mergeProps"),
|
|
139
140
|
...require("./helpers/normalizeColor"),
|
|
140
141
|
...require("./helpers/proxyThemeVariables"),
|
|
142
|
+
...require("./helpers/proxyThemeToParents"),
|
|
141
143
|
...require("./helpers/pseudoDescriptors"),
|
|
142
144
|
...require("./helpers/themeable"),
|
|
143
145
|
...require("./helpers/themes"),
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,sBAAd;AACA,wBAAc,8BADd;AAEA,wBAAc,+BAFd;AAGA,wBAAc,0BAHd;AAIA,wBAAc,4BAJd;AAKA,wBAAc,yBALd;AAMA,wBAAc,2BANd;AAOA,wBAAc,6BAPd;AAQA,wBAAc,8BARd;AASA,wBAAc,yBATd;AAUA,wBAAc,qBAVd;AAWA,wBAAc,oBAXd;AAYA,wBAAc,+BAZd;AAcA,oBAOO;AAEP,wBAAc,kCAvBd;AAyBA,wBAAc,0CAzBd;AA0BA,wBAAc,mCA1Bd;AA2BA,wBAAc,iCA3Bd;AA4BA,wBAAc,yCA5Bd;AA6BA,wBAAc,4CA7Bd;AA8BA,wBAAc,qCA9Bd;AA+BA,wBAAc,sCA/Bd;AAgCA,wBAAc,uCAhCd;AAiCA,wBAAc,uCAjCd;AAkCA,wBAAc,yCAlCd;AAmCA,wBAAc,uCAnCd;AAoCA,wBAAc,iCApCd;AAqCA,wBAAc,iCArCd;AAsCA,wBAAc,qCAtCd;AAuCA,wBAAc,0CAvCd;AAwCA,wBAAc,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,sBAAd;AACA,wBAAc,8BADd;AAEA,wBAAc,+BAF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gFA,wBAAc,6BAhFd;AAiFA,wBAAc,+BAjFd;AAmFA,wBAAc,yBAnFd;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -7,8 +7,9 @@ import {
|
|
|
7
7
|
listenForSheetChanges,
|
|
8
8
|
scanAllSheets
|
|
9
9
|
} from "./helpers/insertStyleRule";
|
|
10
|
+
import { proxyThemesToParents } from "./helpers/proxyThemeToParents";
|
|
10
11
|
import { registerCSSVariable, variableToCSS } from "./helpers/registerCSSVariable";
|
|
11
|
-
import { ensureThemeVariable
|
|
12
|
+
import { ensureThemeVariable } from "./helpers/themes";
|
|
12
13
|
import { configureMedia } from "./hooks/useMedia";
|
|
13
14
|
import { parseFont, registerFontVariables } from "./insertFont";
|
|
14
15
|
import { Tamagui } from "./Tamagui";
|
|
@@ -113,7 +114,7 @@ ${JSON.stringify(
|
|
|
113
114
|
}
|
|
114
115
|
const themesIn = { ...configIn.themes };
|
|
115
116
|
const dedupedThemes = foundThemes ?? getThemesDeduped(themesIn);
|
|
116
|
-
const themes = proxyThemesToParents(dedupedThemes
|
|
117
|
+
const themes = proxyThemesToParents(dedupedThemes);
|
|
117
118
|
return {
|
|
118
119
|
themes,
|
|
119
120
|
cssRuleSets,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createTamagui.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,iBAAiB,iBAAiB;AAE3C,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB,qBAAqB;AACnD,SAAS,
|
|
4
|
+
"mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,iBAAiB,iBAAiB;AAE3C,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4B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{ getToken } from "../config";
|
|
2
|
+
import { GetThemeUnwrapped } from "../hooks/getThemeUnwrapped";
|
|
3
|
+
const themesRaw = {};
|
|
4
|
+
function proxyThemesToParents(dedupedThemes) {
|
|
5
|
+
for (const { names, theme } of dedupedThemes) {
|
|
6
|
+
for (const name of names) {
|
|
7
|
+
themesRaw[name] = theme;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const themes = {};
|
|
11
|
+
for (const { names, theme } of dedupedThemes) {
|
|
12
|
+
for (const themeName of names) {
|
|
13
|
+
const proxiedTheme = proxyThemeToParents(themeName, theme);
|
|
14
|
+
themes[themeName] = proxiedTheme;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return themes;
|
|
18
|
+
}
|
|
19
|
+
function proxyThemeToParents(themeName, theme) {
|
|
20
|
+
const cur = [];
|
|
21
|
+
const parents = themeName.split("_").slice(0, -1).map((part) => {
|
|
22
|
+
cur.push(part);
|
|
23
|
+
return cur.join("_");
|
|
24
|
+
});
|
|
25
|
+
const numParents = parents.length;
|
|
26
|
+
return new Proxy(theme, {
|
|
27
|
+
get(target, key) {
|
|
28
|
+
if (key === GetThemeUnwrapped)
|
|
29
|
+
return theme;
|
|
30
|
+
if (Reflect.has(target, key))
|
|
31
|
+
return Reflect.get(target, key);
|
|
32
|
+
for (let i = numParents - 1; i >= 0; i--) {
|
|
33
|
+
const parent = themesRaw[parents[i]];
|
|
34
|
+
if (!parent)
|
|
35
|
+
continue;
|
|
36
|
+
if (Reflect.has(parent, key)) {
|
|
37
|
+
return Reflect.get(parent, key);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return getToken(key) ?? Reflect.get(target, key);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
proxyThemeToParents,
|
|
46
|
+
proxyThemesToParents,
|
|
47
|
+
themesRaw
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=proxyThemeToParents.js.map
|
|
@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AAAA,EACF,CAAC;AACH;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { getConfig } from "../config";
|
|
2
1
|
import { createVariable, isVariable } from "../createVariable";
|
|
3
|
-
import { GetThemeUnwrapped } from "../hooks/getThemeUnwrapped";
|
|
4
2
|
function ensureThemeVariable(theme, key) {
|
|
5
3
|
const val = theme[key];
|
|
6
4
|
const themeKey = key;
|
|
@@ -20,50 +18,7 @@ function ensureThemeVariable(theme, key) {
|
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
|
-
const themesRaw = {};
|
|
24
|
-
function proxyThemesToParents(dedupedThemes, tokens) {
|
|
25
|
-
for (const { names, theme } of dedupedThemes) {
|
|
26
|
-
for (const name of names) {
|
|
27
|
-
themesRaw[name] = theme;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
const themes = {};
|
|
31
|
-
for (const { names, theme } of dedupedThemes) {
|
|
32
|
-
for (const themeName of names) {
|
|
33
|
-
const proxiedTheme = proxyThemeToParents(themeName, theme, tokens);
|
|
34
|
-
themes[themeName] = proxiedTheme;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return themes;
|
|
38
|
-
}
|
|
39
|
-
function proxyThemeToParents(themeName, theme, tokens = getConfig().tokensParsed) {
|
|
40
|
-
const cur = [];
|
|
41
|
-
const parents = themeName.split("_").slice(0, -1).map((part) => {
|
|
42
|
-
cur.push(part);
|
|
43
|
-
return cur.join("_");
|
|
44
|
-
});
|
|
45
|
-
const numParents = parents.length;
|
|
46
|
-
return new Proxy(theme, {
|
|
47
|
-
get(target, key) {
|
|
48
|
-
if (key === GetThemeUnwrapped)
|
|
49
|
-
return theme;
|
|
50
|
-
if (Reflect.has(target, key))
|
|
51
|
-
return Reflect.get(target, key);
|
|
52
|
-
for (let i = numParents - 1; i >= 0; i--) {
|
|
53
|
-
const parent = themesRaw[parents[i]];
|
|
54
|
-
if (!parent)
|
|
55
|
-
continue;
|
|
56
|
-
if (Reflect.has(parent, key)) {
|
|
57
|
-
return Reflect.get(parent, key);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return Reflect.get(tokens, key);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
21
|
export {
|
|
65
|
-
ensureThemeVariable
|
|
66
|
-
proxyThemeToParents,
|
|
67
|
-
proxyThemesToParents
|
|
22
|
+
ensureThemeVariable
|
|
68
23
|
};
|
|
69
24
|
//# sourceMappingURL=themes.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/themes.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,
|
|
4
|
+
"mappings": "AAAA,SAAS,gBAAgB,kBAAkB;AAIpC,SAAS,oBAAoB,OAAY,KAAa;AAC3D,QAAM,MAAM,MAAM,GAAG;AACrB,QAAM,WAAW;AACjB,MAAI,CAAC,WAAW,GAAG,GAAG;AACpB,UAAM,GAAG,IAAI,eAAe;AAAA,MAC1B,KAAK;AAAA,MACL,MAAM;AAAA,MACN;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,QAAI,IAAI,SAAS,UAAU;AAEzB,YAAM,GAAG,IAAI,eAAe;AAAA,QAC1B,KAAK,IAAI;AAAA,QACT,MAAM;AAAA,QACN,KAAK,IAAI;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -35,6 +35,7 @@ export * from "./helpers/matchMedia";
|
|
|
35
35
|
export * from "./helpers/mergeProps";
|
|
36
36
|
export * from "./helpers/normalizeColor";
|
|
37
37
|
export * from "./helpers/proxyThemeVariables";
|
|
38
|
+
export * from "./helpers/proxyThemeToParents";
|
|
38
39
|
export * from "./helpers/pseudoDescriptors";
|
|
39
40
|
export * from "./helpers/themeable";
|
|
40
41
|
export * from "./helpers/themes";
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAEd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;",
|
|
4
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAEd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/web",
|
|
3
|
-
"version": "1.48.
|
|
3
|
+
"version": "1.48.8",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"reset.css"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tamagui/compose-refs": "1.48.
|
|
31
|
-
"@tamagui/constants": "1.48.
|
|
32
|
-
"@tamagui/helpers": "1.48.
|
|
33
|
-
"@tamagui/normalize-css-color": "1.48.
|
|
34
|
-
"@tamagui/use-did-finish-ssr": "1.48.
|
|
35
|
-
"@tamagui/use-event": "1.48.
|
|
36
|
-
"@tamagui/use-force-update": "1.48.
|
|
30
|
+
"@tamagui/compose-refs": "1.48.8",
|
|
31
|
+
"@tamagui/constants": "1.48.8",
|
|
32
|
+
"@tamagui/helpers": "1.48.8",
|
|
33
|
+
"@tamagui/normalize-css-color": "1.48.8",
|
|
34
|
+
"@tamagui/use-did-finish-ssr": "1.48.8",
|
|
35
|
+
"@tamagui/use-event": "1.48.8",
|
|
36
|
+
"@tamagui/use-force-update": "1.48.8"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "*"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@tamagui/build": "1.48.
|
|
42
|
+
"@tamagui/build": "1.48.8",
|
|
43
43
|
"@testing-library/react": "^13.4.0",
|
|
44
44
|
"csstype": "^3.0.10",
|
|
45
45
|
"react": "^18.2.0",
|
package/src/createTamagui.ts
CHANGED
|
@@ -9,8 +9,9 @@ import {
|
|
|
9
9
|
listenForSheetChanges,
|
|
10
10
|
scanAllSheets,
|
|
11
11
|
} from './helpers/insertStyleRule'
|
|
12
|
+
import { proxyThemesToParents } from './helpers/proxyThemeToParents'
|
|
12
13
|
import { registerCSSVariable, variableToCSS } from './helpers/registerCSSVariable'
|
|
13
|
-
import { ensureThemeVariable
|
|
14
|
+
import { ensureThemeVariable } from './helpers/themes'
|
|
14
15
|
import { configureMedia } from './hooks/useMedia'
|
|
15
16
|
import { parseFont, registerFontVariables } from './insertFont'
|
|
16
17
|
import { Tamagui } from './Tamagui'
|
|
@@ -155,7 +156,7 @@ export function createTamagui<Conf extends CreateTamaguiProps>(
|
|
|
155
156
|
|
|
156
157
|
const themesIn = { ...configIn.themes } as ThemesLikeObject
|
|
157
158
|
const dedupedThemes = foundThemes ?? getThemesDeduped(themesIn)
|
|
158
|
-
const themes = proxyThemesToParents(dedupedThemes
|
|
159
|
+
const themes = proxyThemesToParents(dedupedThemes)
|
|
159
160
|
|
|
160
161
|
return {
|
|
161
162
|
themes,
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { getToken } from '../config'
|
|
2
|
+
import { GetThemeUnwrapped } from '../hooks/getThemeUnwrapped'
|
|
3
|
+
import { DedupedThemes, ThemeParsed } from '../types'
|
|
4
|
+
|
|
5
|
+
export const themesRaw: Record<string, ThemeParsed> = {}
|
|
6
|
+
|
|
7
|
+
// this seems expensive but its necessary to do two loops unless we want to refactor a variety of things again
|
|
8
|
+
// not *too* much work but not a big cost doing the two loops
|
|
9
|
+
export function proxyThemesToParents(
|
|
10
|
+
dedupedThemes: DedupedThemes
|
|
11
|
+
): Record<string, ThemeParsed> {
|
|
12
|
+
// fill it in so we can look it up next
|
|
13
|
+
for (const { names, theme } of dedupedThemes) {
|
|
14
|
+
for (const name of names) {
|
|
15
|
+
themesRaw[name] = theme
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const themes: Record<string, ThemeParsed> = {}
|
|
20
|
+
// now go back and re-fill it in
|
|
21
|
+
// we do have to call this once per non-duplicated theme!
|
|
22
|
+
// because they could have different parent chains
|
|
23
|
+
// despite being the same theme
|
|
24
|
+
|
|
25
|
+
for (const { names, theme } of dedupedThemes) {
|
|
26
|
+
for (const themeName of names) {
|
|
27
|
+
const proxiedTheme = proxyThemeToParents(themeName, theme)
|
|
28
|
+
themes[themeName] = proxiedTheme
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return themes
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function proxyThemeToParents(themeName: string, theme: ThemeParsed) {
|
|
36
|
+
const cur: string[] = []
|
|
37
|
+
|
|
38
|
+
// if theme is dark_blue_alt1_Button
|
|
39
|
+
// this will be the parent names in order: ['dark', 'dark_blue', 'dark_blue_alt1"]
|
|
40
|
+
const parents = themeName
|
|
41
|
+
.split('_')
|
|
42
|
+
.slice(0, -1)
|
|
43
|
+
.map((part) => {
|
|
44
|
+
cur.push(part)
|
|
45
|
+
return cur.join('_')
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const numParents = parents.length
|
|
49
|
+
|
|
50
|
+
// proxy fallback values to parent theme values
|
|
51
|
+
return new Proxy(theme, {
|
|
52
|
+
get(target, key) {
|
|
53
|
+
if (key === GetThemeUnwrapped) return theme
|
|
54
|
+
if (Reflect.has(target, key)) return Reflect.get(target, key)
|
|
55
|
+
// check parents
|
|
56
|
+
for (let i = numParents - 1; i >= 0; i--) {
|
|
57
|
+
const parent = themesRaw[parents[i]]
|
|
58
|
+
if (!parent) continue
|
|
59
|
+
if (Reflect.has(parent, key)) {
|
|
60
|
+
return Reflect.get(parent, key)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return getToken(key as any) ?? Reflect.get(target, key)
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
}
|
package/src/helpers/themes.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import { getConfig } from '../config'
|
|
2
1
|
import { createVariable, isVariable } from '../createVariable'
|
|
3
|
-
import { GetThemeUnwrapped } from '../hooks/getThemeUnwrapped'
|
|
4
|
-
import {
|
|
5
|
-
CreateTamaguiProps,
|
|
6
|
-
DedupedThemes,
|
|
7
|
-
ThemeParsed,
|
|
8
|
-
Tokens,
|
|
9
|
-
TokensParsed,
|
|
10
|
-
} from '../types'
|
|
11
2
|
|
|
12
3
|
// mutates, freeze after
|
|
13
4
|
// shared by createTamagui so extracted here
|
|
@@ -31,72 +22,3 @@ export function ensureThemeVariable(theme: any, key: string) {
|
|
|
31
22
|
}
|
|
32
23
|
}
|
|
33
24
|
}
|
|
34
|
-
|
|
35
|
-
const themesRaw: Record<string, ThemeParsed> = {}
|
|
36
|
-
|
|
37
|
-
// this seems expensive but its necessary to do two loops unless we want to refactor a variety of things again
|
|
38
|
-
// not *too* much work but not a big cost doing the two loops
|
|
39
|
-
export function proxyThemesToParents(
|
|
40
|
-
dedupedThemes: DedupedThemes,
|
|
41
|
-
tokens: Tokens
|
|
42
|
-
): Record<string, ThemeParsed> {
|
|
43
|
-
// fill it in so we can look it up next
|
|
44
|
-
for (const { names, theme } of dedupedThemes) {
|
|
45
|
-
for (const name of names) {
|
|
46
|
-
themesRaw[name] = theme
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const themes: Record<string, ThemeParsed> = {}
|
|
51
|
-
// now go back and re-fill it in
|
|
52
|
-
// we do have to call this once per non-duplicated theme!
|
|
53
|
-
// because they could have different parent chains
|
|
54
|
-
// despite being the same theme
|
|
55
|
-
|
|
56
|
-
for (const { names, theme } of dedupedThemes) {
|
|
57
|
-
for (const themeName of names) {
|
|
58
|
-
const proxiedTheme = proxyThemeToParents(themeName, theme, tokens)
|
|
59
|
-
themes[themeName] = proxiedTheme
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return themes
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function proxyThemeToParents(
|
|
67
|
-
themeName: string,
|
|
68
|
-
theme: ThemeParsed,
|
|
69
|
-
tokens: TokensParsed = getConfig().tokensParsed
|
|
70
|
-
) {
|
|
71
|
-
const cur: string[] = []
|
|
72
|
-
|
|
73
|
-
// if theme is dark_blue_alt1_Button
|
|
74
|
-
// this will be the parent names in order: ['dark', 'dark_blue', 'dark_blue_alt1"]
|
|
75
|
-
const parents = themeName
|
|
76
|
-
.split('_')
|
|
77
|
-
.slice(0, -1)
|
|
78
|
-
.map((part) => {
|
|
79
|
-
cur.push(part)
|
|
80
|
-
return cur.join('_')
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
const numParents = parents.length
|
|
84
|
-
|
|
85
|
-
// TODO maybe faster to just object spread? needs profiling on native + web
|
|
86
|
-
// proxy fallback values to parent theme values
|
|
87
|
-
return new Proxy(theme, {
|
|
88
|
-
get(target, key) {
|
|
89
|
-
if (key === GetThemeUnwrapped) return theme
|
|
90
|
-
if (Reflect.has(target, key)) return Reflect.get(target, key)
|
|
91
|
-
// check parents
|
|
92
|
-
for (let i = numParents - 1; i >= 0; i--) {
|
|
93
|
-
const parent = themesRaw[parents[i]]
|
|
94
|
-
if (!parent) continue
|
|
95
|
-
if (Reflect.has(parent, key)) {
|
|
96
|
-
return Reflect.get(parent, key)
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return Reflect.get(tokens, key)
|
|
100
|
-
},
|
|
101
|
-
})
|
|
102
|
-
}
|
package/src/index.ts
CHANGED
|
@@ -38,6 +38,7 @@ export * from './helpers/matchMedia'
|
|
|
38
38
|
export * from './helpers/mergeProps'
|
|
39
39
|
export * from './helpers/normalizeColor'
|
|
40
40
|
export * from './helpers/proxyThemeVariables'
|
|
41
|
+
export * from './helpers/proxyThemeToParents'
|
|
41
42
|
export * from './helpers/pseudoDescriptors'
|
|
42
43
|
export * from './helpers/themeable'
|
|
43
44
|
export * from './helpers/themes'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTamagui.d.ts","sourceRoot":"","sources":["../src/createTamagui.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createTamagui.d.ts","sourceRoot":"","sources":["../src/createTamagui.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,kBAAkB,EAIlB,kBAAkB,EAInB,MAAM,SAAS,CAAA;AAKhB,wBAAgB,aAAa,CAAC,IAAI,SAAS,kBAAkB,EAC3D,QAAQ,EAAE,IAAI,GACb,kBAAkB,CAAC,IAAI,CAAC,CAyP1B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DedupedThemes, ThemeParsed } from '../types';
|
|
2
|
+
export declare const themesRaw: Record<string, ThemeParsed>;
|
|
3
|
+
export declare function proxyThemesToParents(dedupedThemes: DedupedThemes): Record<string, ThemeParsed>;
|
|
4
|
+
export declare function proxyThemeToParents(themeName: string, theme: ThemeParsed): ThemeParsed;
|
|
5
|
+
//# sourceMappingURL=proxyThemeToParents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxyThemeToParents.d.ts","sourceRoot":"","sources":["../../src/helpers/proxyThemeToParents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAErD,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAM,CAAA;AAIxD,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,aAAa,GAC3B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAsB7B;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,eA+BxE"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import { DedupedThemes, ThemeParsed, Tokens, TokensParsed } from '../types';
|
|
2
1
|
export declare function ensureThemeVariable(theme: any, key: string): void;
|
|
3
|
-
export declare function proxyThemesToParents(dedupedThemes: DedupedThemes, tokens: Tokens): Record<string, ThemeParsed>;
|
|
4
|
-
export declare function proxyThemeToParents(themeName: string, theme: ThemeParsed, tokens?: TokensParsed): ThemeParsed;
|
|
5
2
|
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/helpers/themes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/helpers/themes.ts"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,QAmB1D"}
|
package/types/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export * from './helpers/matchMedia';
|
|
|
28
28
|
export * from './helpers/mergeProps';
|
|
29
29
|
export * from './helpers/normalizeColor';
|
|
30
30
|
export * from './helpers/proxyThemeVariables';
|
|
31
|
+
export * from './helpers/proxyThemeToParents';
|
|
31
32
|
export * from './helpers/pseudoDescriptors';
|
|
32
33
|
export * from './helpers/themeable';
|
|
33
34
|
export * from './helpers/themes';
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"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