@tamagui/core 1.0.0-alpha.59 → 1.0.0-alpha.64
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 +6 -6
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createTamagui.js +1 -1
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createVariable.js +7 -2
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +4 -4
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/extendStaticConfig.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.js +4 -4
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/hooks/useTheme.js +2 -2
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/tamagui-base.css +3 -0
- package/dist/cjs/tamagui-base.css.map +2 -2
- package/dist/esm/createComponent.js +6 -6
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createTamagui.js +2 -2
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createVariable.js +7 -2
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +5 -5
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/extendStaticConfig.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +4 -4
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/hooks/useTheme.js +3 -3
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/tamagui-base.css +3 -0
- package/dist/esm/tamagui-base.css.map +2 -2
- package/dist/jsx/createComponent.js +6 -6
- package/dist/jsx/createTamagui.js +2 -2
- package/dist/jsx/createVariable.js +7 -2
- package/dist/jsx/helpers/createPropMapper.js +5 -5
- package/dist/jsx/helpers/getSplitStyles.js +4 -4
- package/dist/jsx/hooks/useTheme.js +3 -3
- package/dist/jsx/tamagui-base.css +3 -0
- package/package.json +6 -6
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/createVariable.d.ts +3 -1
- package/types/createVariable.d.ts.map +1 -1
- package/types/helpers/extendStaticConfig.d.ts +1 -1
- package/types/helpers/extendStaticConfig.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/styled.d.ts +7 -7
- package/types/styled.d.ts.map +1 -1
|
@@ -188,7 +188,7 @@ function createComponent(configIn) {
|
|
|
188
188
|
const className = concatClassName(...classList);
|
|
189
189
|
if (process.env.NODE_ENV === "development") {
|
|
190
190
|
if (props["debug"]) {
|
|
191
|
-
console.log("\
|
|
191
|
+
console.log("\xBB className", { style, styles, classList, stylesClassNames, className: className.trim().split(" ") });
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
viewProps.className = className;
|
|
@@ -329,11 +329,11 @@ function createComponent(configIn) {
|
|
|
329
329
|
if (process.env.NODE_ENV === "development") {
|
|
330
330
|
if (props["debug"]) {
|
|
331
331
|
viewProps["debug"] = true;
|
|
332
|
-
console.log("\
|
|
333
|
-
console.log("\
|
|
334
|
-
console.log("\
|
|
332
|
+
console.log("\xBB props in:", props);
|
|
333
|
+
console.log("\xBB props out:", viewProps, (_a = viewProps.className) == null ? void 0 : _a.split(" "));
|
|
334
|
+
console.log("\xBB etc:", { shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls });
|
|
335
335
|
if (typeof window !== "undefined") {
|
|
336
|
-
console.log("\
|
|
336
|
+
console.log("\xBB component info", { staticConfig, tamaguiConfig });
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
}
|
|
@@ -350,7 +350,7 @@ function createComponent(configIn) {
|
|
|
350
350
|
const shouldDebug = (_a = staticConfig.defaultProps) == null ? void 0 : _a.debug;
|
|
351
351
|
tamaguiConfig = conf;
|
|
352
352
|
initialTheme = conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]];
|
|
353
|
-
const { classNames, pseudos, style, viewProps } = getSplitStyles(staticConfig.defaultProps, staticConfig, initialTheme
|
|
353
|
+
const { classNames, pseudos, style, viewProps } = getSplitStyles(staticConfig.defaultProps, staticConfig, initialTheme);
|
|
354
354
|
if (isWeb) {
|
|
355
355
|
if (classNames) {
|
|
356
356
|
defaultsClassName += classNames + " ";
|
|
@@ -4,7 +4,7 @@ import { getStyleRules } from "@tamagui/helpers";
|
|
|
4
4
|
import { configListeners, getHasConfigured, setConfig } from "./conf";
|
|
5
5
|
import { PREFIX } from "./constants/constants";
|
|
6
6
|
import { isWeb } from "./constants/platform";
|
|
7
|
-
import { Variable, createVariable } from "./createVariable";
|
|
7
|
+
import { Variable, createVariable, isVariable } from "./createVariable";
|
|
8
8
|
import { createTamaguiProvider } from "./helpers/createTamaguiProvider";
|
|
9
9
|
import { configureMedia } from "./hooks/useMedia";
|
|
10
10
|
const createdConfigs = /* @__PURE__ */ new WeakMap();
|
|
@@ -145,7 +145,7 @@ const parseTokens = /* @__PURE__ */ __name((tokens) => {
|
|
|
145
145
|
}, "parseTokens");
|
|
146
146
|
function ensureThemeVariable(theme, key) {
|
|
147
147
|
const val = theme[key];
|
|
148
|
-
if (!(val
|
|
148
|
+
if (!isVariable(val)) {
|
|
149
149
|
theme[key] = createVariable({
|
|
150
150
|
name: key,
|
|
151
151
|
val
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
var _a;
|
|
3
4
|
import { isWeb } from "./constants/platform";
|
|
5
|
+
const IS_VARIABLE_SYMBOL = "__isVariable__";
|
|
4
6
|
class Variable {
|
|
5
7
|
constructor({ val, name }) {
|
|
6
|
-
this
|
|
8
|
+
this[_a] = true;
|
|
9
|
+
this.val = isVariable(val) ? val.val : val;
|
|
7
10
|
this.name = name;
|
|
8
11
|
this.variable = isWeb ? `var(--${name})` : this.val;
|
|
9
12
|
}
|
|
@@ -12,12 +15,14 @@ class Variable {
|
|
|
12
15
|
}
|
|
13
16
|
}
|
|
14
17
|
__name(Variable, "Variable");
|
|
18
|
+
_a = IS_VARIABLE_SYMBOL;
|
|
15
19
|
const createVariable = /* @__PURE__ */ __name((props) => new Variable(props), "createVariable");
|
|
16
20
|
function isVariable(v) {
|
|
17
|
-
return v instanceof Variable;
|
|
21
|
+
return v instanceof Variable || v && v[IS_VARIABLE_SYMBOL];
|
|
18
22
|
}
|
|
19
23
|
__name(isVariable, "isVariable");
|
|
20
24
|
export {
|
|
25
|
+
IS_VARIABLE_SYMBOL,
|
|
21
26
|
Variable,
|
|
22
27
|
createVariable,
|
|
23
28
|
isVariable
|
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
import { getTamagui } from "../conf";
|
|
4
4
|
import { isWeb } from "../constants/platform";
|
|
5
|
-
import {
|
|
5
|
+
import { isVariable } from "../createVariable";
|
|
6
6
|
import { isObj } from "./isObj";
|
|
7
7
|
const createPropMapper = /* @__PURE__ */ __name((c) => {
|
|
8
8
|
const variants = c.variants;
|
|
@@ -40,7 +40,7 @@ const createPropMapper = /* @__PURE__ */ __name((c) => {
|
|
|
40
40
|
shouldReturn = true;
|
|
41
41
|
value = getToken(key, value, conf, theme, fontFamily);
|
|
42
42
|
}
|
|
43
|
-
if (value
|
|
43
|
+
if (isVariable(value)) {
|
|
44
44
|
shouldReturn = true;
|
|
45
45
|
value = value.variable;
|
|
46
46
|
}
|
|
@@ -57,7 +57,7 @@ const resolveTokens = /* @__PURE__ */ __name((input, conf, theme, fontFamily) =>
|
|
|
57
57
|
for (const rKey in input) {
|
|
58
58
|
const fKey = conf.shorthands[rKey] || rKey;
|
|
59
59
|
const val = input[rKey];
|
|
60
|
-
if (val
|
|
60
|
+
if (isVariable(val)) {
|
|
61
61
|
res[fKey] = val.variable;
|
|
62
62
|
} else if (typeof val === "string") {
|
|
63
63
|
const fVal = val[0] === "$" ? getToken(fKey, val, conf, theme, fontFamily) : val;
|
|
@@ -100,7 +100,7 @@ const getToken = /* @__PURE__ */ __name((key, value, { tokensParsed, themeParsed
|
|
|
100
100
|
valOrVar = ((_e = tokensParsed.font[fontFamily]) == null ? void 0 : _e.weight[value]) || value;
|
|
101
101
|
}
|
|
102
102
|
if (typeof valOrVar !== "undefined") {
|
|
103
|
-
if (valOrVar
|
|
103
|
+
if (isVariable(valOrVar)) {
|
|
104
104
|
return valOrVar.variable;
|
|
105
105
|
} else {
|
|
106
106
|
return valOrVar;
|
|
@@ -124,7 +124,7 @@ const getToken = /* @__PURE__ */ __name((key, value, { tokensParsed, themeParsed
|
|
|
124
124
|
return spaceVar.variable;
|
|
125
125
|
}
|
|
126
126
|
if (value && value[0] === "$") {
|
|
127
|
-
console.warn(
|
|
127
|
+
console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, value);
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
130
130
|
return value;
|
|
@@ -13,7 +13,7 @@ import { createMediaStyle } from "./createMediaStyle";
|
|
|
13
13
|
import { fixNativeShadow } from "./fixNativeShadow";
|
|
14
14
|
import { getStylesAtomic } from "./getStylesAtomic";
|
|
15
15
|
import { insertStyleRule } from "./insertStyleRule";
|
|
16
|
-
const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme
|
|
16
|
+
const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme) => {
|
|
17
17
|
const validStyleProps = staticConfig.isText ? stylePropsText : validStyles;
|
|
18
18
|
const viewProps = {};
|
|
19
19
|
const style = [];
|
|
@@ -34,7 +34,7 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, isSpl
|
|
|
34
34
|
const mediaStyles = getStylesAtomic(mediaStyle);
|
|
35
35
|
if (process.env.NODE_ENV === "development") {
|
|
36
36
|
if (props["debug"]) {
|
|
37
|
-
console.log("mediaStyles", keyInit, { mediaProps, mediaStyle
|
|
37
|
+
console.log("mediaStyles", keyInit, { mediaProps, mediaStyle });
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
for (const style2 of mediaStyles) {
|
|
@@ -44,7 +44,7 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, isSpl
|
|
|
44
44
|
AllRules.add(out2.styleRule);
|
|
45
45
|
insertStyleRule(out2.styleRule);
|
|
46
46
|
if (process.env.NODE_ENV === "development" && props["debug"]) {
|
|
47
|
-
console.log("mediaProp", style2.identifier, out2
|
|
47
|
+
console.log("mediaProp", style2.identifier, out2.styleRule);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
} else {
|
|
@@ -108,7 +108,7 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, isSpl
|
|
|
108
108
|
}
|
|
109
109
|
if (process.env.NODE_ENV === "development") {
|
|
110
110
|
if (props["debug"]) {
|
|
111
|
-
console.log("
|
|
111
|
+
console.log(" splitProps:", { props, viewProps, style });
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
return {
|
|
@@ -4,7 +4,7 @@ import { useForceUpdate } from "@tamagui/use-force-update";
|
|
|
4
4
|
import { useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { GET_DEFAULT_THEME } from "../constants/constants";
|
|
6
6
|
import { useIsomorphicLayoutEffect } from "../constants/platform";
|
|
7
|
-
import {
|
|
7
|
+
import { isVariable } from "../createVariable";
|
|
8
8
|
import { ThemeContext } from "../views/ThemeContext";
|
|
9
9
|
import { ThemeManagerContext } from "../views/ThemeManagerContext";
|
|
10
10
|
const areEqualSets = /* @__PURE__ */ __name((a, b) => {
|
|
@@ -73,10 +73,10 @@ const useTheme = /* @__PURE__ */ __name(() => {
|
|
|
73
73
|
const val = activeTheme[key];
|
|
74
74
|
if (process.env.NODE_ENV === "development") {
|
|
75
75
|
if (typeof val === "undefined") {
|
|
76
|
-
console.warn(`No theme value "${String(key)}" in`, activeTheme
|
|
76
|
+
console.warn(`No theme value "${String(key)}" in`, activeTheme);
|
|
77
77
|
return null;
|
|
78
78
|
}
|
|
79
|
-
if (!(val
|
|
79
|
+
if (!isVariable(val)) {
|
|
80
80
|
console.warn("Non variable!", val);
|
|
81
81
|
}
|
|
82
82
|
if (val.name !== key) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.64",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@tamagui/helpers": "^1.0.0-alpha.
|
|
20
|
+
"@tamagui/helpers": "^1.0.0-alpha.64",
|
|
21
21
|
"@tamagui/ow": "^0.28.1",
|
|
22
|
-
"@tamagui/use-debounce": "^1.0.0-alpha.
|
|
23
|
-
"@tamagui/use-force-update": "^1.0.0-alpha.
|
|
22
|
+
"@tamagui/use-debounce": "^1.0.0-alpha.64",
|
|
23
|
+
"@tamagui/use-force-update": "^1.0.0-alpha.64",
|
|
24
24
|
"react": "*",
|
|
25
25
|
"react-dom": "*"
|
|
26
26
|
},
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"react-native-web": "*"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@tamagui/build": "^1.0.0-alpha.
|
|
31
|
+
"@tamagui/build": "^1.0.0-alpha.64",
|
|
32
32
|
"@types/react": "^17.0.35",
|
|
33
33
|
"csstype": "^3.0.10",
|
|
34
34
|
"esbuild": "^0.13.12",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "9363f43117f9504de9bd4949ca210cd1ebbf753b"
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAe3B,OAAO,EAA0B,SAAS,EAAE,MAAM,cAAc,CAAA;AAYhE,OAAO,EAEL,eAAe,EACf,YAAY,EACZ,kBAAkB,EAEnB,MAAM,SAAS,CAAA;AAGhB,eAAO,MAAM,QAAQ,eAAsB,CAAA;AAS3C,aAAK,YAAY,GAAG,EAAE,CAAA;AAuBtB,wBAAgB,eAAe,CAAC,kBAAkB,SAAS,MAAM,GAAG,YAAY,EAC9E,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,kBAAkB,
|
|
1
|
+
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAe3B,OAAO,EAA0B,SAAS,EAAE,MAAM,cAAc,CAAA;AAYhE,OAAO,EAEL,eAAe,EACf,YAAY,EACZ,kBAAkB,EAEnB,MAAM,SAAS,CAAA;AAGhB,eAAO,MAAM,QAAQ,eAAsB,CAAA;AAS3C,aAAK,YAAY,GAAG,EAAE,CAAA;AAuBtB,wBAAgB,eAAe,CAAC,kBAAkB,SAAS,MAAM,GAAG,YAAY,EAC9E,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,kBAAkB,sEAodrD;AAOD,eAAO,MAAM,MAAM;;;iCAyBjB,CAAA;AAEF,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,aAAa,GACd,EAAE;IACD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,GAAG,CAAA;IACb,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,CAAA;CAC3C,OA0CA;AAED,eAAO,MAAM,YAAY,UAAW,GAAG,gBAKpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTamagui.d.ts","sourceRoot":"","sources":["../src/createTamagui.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"createTamagui.d.ts","sourceRoot":"","sources":["../src/createTamagui.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAA8B,MAAM,kBAAkB,CAAA;AAGvE,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAEhB,oBAAY,kBAAkB,GAAG,oBAAoB,GAEnD,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,QAAQ,GAAG,QAAQ,CAAC,CAAC,GAAG;IACzD,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG;YACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;SAC1C,CAAA;KACF,CAAA;IAED,uBAAuB,CAAC,EAAE,aAAa,EAAE,CAAA;CAC1C,CAAA;AAIH,wBAAgB,aAAa,CAAC,IAAI,SAAS,kBAAkB,EAC3D,MAAM,EAAE,IAAI,GACX,IAAI,SAAS,mBAAmB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GACnE,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GACjC,OAAO,CAyIV"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export declare const IS_VARIABLE_SYMBOL = "__isVariable__";
|
|
1
2
|
export declare class Variable {
|
|
3
|
+
[IS_VARIABLE_SYMBOL]: boolean;
|
|
2
4
|
name: string;
|
|
3
5
|
val: string | number;
|
|
4
6
|
variable: string | number;
|
|
@@ -6,7 +8,7 @@ export declare class Variable {
|
|
|
6
8
|
toString(): string;
|
|
7
9
|
}
|
|
8
10
|
declare type VariableIn = {
|
|
9
|
-
val: string | number;
|
|
11
|
+
val: string | number | Variable;
|
|
10
12
|
name: string;
|
|
11
13
|
};
|
|
12
14
|
export declare const createVariable: (props: VariableIn) => Variable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createVariable.d.ts","sourceRoot":"","sources":["../src/createVariable.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAQ;
|
|
1
|
+
{"version":3,"file":"createVariable.d.ts","sourceRoot":"","sources":["../src/createVariable.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,mBAAmB,CAAA;AAElD,qBAAa,QAAQ;IAInB,CAAC,kBAAkB,CAAC,UAAO;IAE3B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;gBAEb,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,UAAU;IAOrC,QAAQ;CAGT;AAED,aAAK,UAAU,GAAG;IAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEnE,eAAO,MAAM,cAAc,UAAW,UAAU,aAAwB,CAAA;AAExE,wBAAgB,UAAU,CAAC,CAAC,EAAE,QAAQ,GAAG,GAAG,GAAG,CAAC,IAAI,QAAQ,CAE3D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StaticComponent, StaticConfig, StaticConfigParsed } from '../types';
|
|
3
|
-
export declare function extendStaticConfig(Component?: StaticComponent | React.Component<any
|
|
3
|
+
export declare function extendStaticConfig(Component?: StaticComponent | React.Component<any> | ((props: any) => any), config?: StaticConfig): StaticConfigParsed | null;
|
|
4
4
|
export declare const parseStaticConfig: (config: StaticConfig) => StaticConfigParsed;
|
|
5
5
|
//# sourceMappingURL=extendStaticConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extendStaticConfig.d.ts","sourceRoot":"","sources":["../../src/helpers/extendStaticConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAG5E,wBAAgB,kBAAkB,CAGhC,SAAS,CAAC,EAAE,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"extendStaticConfig.d.ts","sourceRoot":"","sources":["../../src/helpers/extendStaticConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAG5E,wBAAgB,kBAAkB,CAGhC,SAAS,CAAC,EAAE,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC,EAC1E,MAAM,GAAE,YAAiB,GACxB,kBAAkB,GAAG,IAAI,CAkD3B;AAED,eAAO,MAAM,iBAAiB,WAAY,YAAY,KAAG,kBAMxD,CAAA"}
|
|
@@ -3,7 +3,7 @@ import { StaticConfigParsed, ThemeObject } from '../types';
|
|
|
3
3
|
export declare type SplitStyles = ReturnType<typeof getSplitStyles>;
|
|
4
4
|
export declare const getSplitStyles: (props: {
|
|
5
5
|
[key: string]: any;
|
|
6
|
-
}, staticConfig: StaticConfigParsed, theme: ThemeObject
|
|
6
|
+
}, staticConfig: StaticConfigParsed, theme: ThemeObject) => {
|
|
7
7
|
viewProps: Record<string, any>;
|
|
8
8
|
style: any[];
|
|
9
9
|
pseudos: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAIxC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAM1D,oBAAY,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAI3D,eAAO,MAAM,cAAc;;iBAEX,kBAAkB,SACzB,WAAW;;;;;;;;
|
|
1
|
+
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAIxC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAM1D,oBAAY,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAI3D,eAAO,MAAM,cAAc;;iBAEX,kBAAkB,SACzB,WAAW;;;;;;;;CAqInB,CAAA"}
|
package/types/styled.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MediaProps, PseudoProps, StaticComponent, StaticConfig, TamaguiConfig, Themes, Tokens } from './types';
|
|
3
|
-
export declare function styled<ParentComponent extends StaticComponent | React.Component<any>, Variants extends GetVariants<ParentComponent
|
|
3
|
+
export declare function styled<Props, ParentComponent extends StaticComponent | React.Component<any>, Variants extends GetVariants<GetProps<ParentComponent>>>(Component: ParentComponent, options?: GetProps<ParentComponent> & {
|
|
4
4
|
variants?: Variants;
|
|
5
|
-
}, staticExtractionOptions?: StaticConfig): StaticComponent<keyof GetVariantProps<Variants> extends never ? GetProps<ParentComponent> : Omit<GetProps<ParentComponent>, keyof GetVariantProps<Variants>> & GetVariantProps<Variants> & MediaProps<GetVariantProps<Variants>> & PseudoProps<GetVariantProps<Variants>>, void, import("./types").StaticConfigParsed, any>;
|
|
6
|
-
export declare type GetProps<A> = A extends StaticComponent<infer Props> ? Props : A extends React.Component<infer Props> ? Props : {};
|
|
7
|
-
export declare type GetVariants<
|
|
5
|
+
}, staticExtractionOptions?: StaticConfig): StaticComponent<keyof GetVariantProps<Variants> extends never ? Props extends Object ? Props : GetProps<ParentComponent> : Omit<Props extends Object ? Props : GetProps<ParentComponent>, keyof GetVariantProps<Variants>> & GetVariantProps<Variants> & MediaProps<GetVariantProps<Variants>> & PseudoProps<GetVariantProps<Variants>>, void, import("./types").StaticConfigParsed, any>;
|
|
6
|
+
export declare type GetProps<A> = A extends StaticComponent<infer Props> ? Props : A extends React.Component<infer Props> ? Props : A extends (props: infer Props) => any ? Props : {};
|
|
7
|
+
export declare type GetVariants<Props> = void | {
|
|
8
8
|
[key: string]: {
|
|
9
|
-
[key: string]: Partial<
|
|
9
|
+
[key: string]: Partial<Props> | ((val: any, config: {
|
|
10
10
|
tokens: TamaguiConfig['tokens'];
|
|
11
11
|
theme: Themes extends {
|
|
12
12
|
[key: string]: infer B;
|
|
13
13
|
} ? B : unknown;
|
|
14
|
-
props:
|
|
15
|
-
}) => Partial<
|
|
14
|
+
props: Props;
|
|
15
|
+
}) => Partial<Props>);
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
export declare type GetVariantProps<Variants> = Variants extends void ? {} : {
|
package/types/styled.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../src/styled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EACL,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,EACZ,aAAa,EACb,MAAM,EACN,MAAM,EACP,M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