@tamagui/stacks 3.0.0-beta.831.1 → 3.0.0-beta.889.1
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/Stacks.cjs +1 -4
- package/dist/cjs/Stacks.native.cjs +1 -4
- package/dist/cjs/Stacks.native.js +1 -4
- package/dist/cjs/Stacks.native.js.map +1 -1
- package/dist/cjs/getElevation.cjs +9 -10
- package/dist/cjs/getElevation.native.cjs +9 -10
- package/dist/cjs/getElevation.native.js +9 -10
- package/dist/cjs/getElevation.native.js.map +1 -1
- package/dist/esm/Stacks.mjs +1 -4
- package/dist/esm/Stacks.mjs.map +1 -1
- package/dist/esm/Stacks.native.js +1 -4
- package/dist/esm/Stacks.native.js.map +1 -1
- package/dist/esm/getElevation.mjs +10 -11
- package/dist/esm/getElevation.mjs.map +1 -1
- package/dist/esm/getElevation.native.js +10 -11
- package/dist/esm/getElevation.native.js.map +1 -1
- package/dist/jsx/Stacks.mjs +1 -4
- package/dist/jsx/Stacks.mjs.map +1 -1
- package/dist/jsx/Stacks.native.cjs +1 -4
- package/dist/jsx/Stacks.native.js +1 -4
- package/dist/jsx/Stacks.native.js.map +1 -1
- package/dist/jsx/getElevation.mjs +10 -11
- package/dist/jsx/getElevation.mjs.map +1 -1
- package/dist/jsx/getElevation.native.cjs +9 -10
- package/dist/jsx/getElevation.native.js +9 -10
- package/dist/jsx/getElevation.native.js.map +1 -1
- package/package.json +4 -4
- package/src/Stacks.tsx +1 -4
- package/src/getElevation.tsx +38 -43
- package/types/Stacks.d.ts +9 -9
- package/types/Stacks.d.ts.map +1 -1
- package/types/getElevation.d.ts +2 -11
- package/types/getElevation.d.ts.map +1 -1
package/dist/cjs/Stacks.cjs
CHANGED
|
@@ -27,10 +27,7 @@ __export(Stacks_exports, {
|
|
|
27
27
|
module.exports = __toCommonJS(Stacks_exports);
|
|
28
28
|
var import_core = require("@tamagui/core");
|
|
29
29
|
var import_getElevation = require("./getElevation.cjs");
|
|
30
|
-
const variants = { elevation:
|
|
31
|
-
number: import_getElevation.getElevation,
|
|
32
|
-
Size: import_getElevation.getElevation
|
|
33
|
-
} };
|
|
30
|
+
const variants = { elevation: import_getElevation.getElevation };
|
|
34
31
|
const YStack = (0, import_core.styled)(import_core.View, {
|
|
35
32
|
flexDirection: "column",
|
|
36
33
|
variants
|
|
@@ -29,10 +29,7 @@ __export(Stacks_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(Stacks_exports);
|
|
30
30
|
var import_core = require("@tamagui/core");
|
|
31
31
|
var import_getElevation = require("./getElevation.native.js");
|
|
32
|
-
var variants = { elevation:
|
|
33
|
-
number: import_getElevation.getElevation,
|
|
34
|
-
Size: import_getElevation.getElevation
|
|
35
|
-
} };
|
|
32
|
+
var variants = { elevation: import_getElevation.getElevation };
|
|
36
33
|
var YStack = (0, import_core.styled)(import_core.View, {
|
|
37
34
|
flexDirection: "column",
|
|
38
35
|
variants
|
|
@@ -29,10 +29,7 @@ __export(Stacks_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(Stacks_exports);
|
|
30
30
|
var import_core = require("@tamagui/core");
|
|
31
31
|
var import_getElevation = require("./getElevation.native.js");
|
|
32
|
-
var variants = { elevation:
|
|
33
|
-
number: import_getElevation.getElevation,
|
|
34
|
-
Size: import_getElevation.getElevation
|
|
35
|
-
} };
|
|
32
|
+
var variants = { elevation: import_getElevation.getElevation };
|
|
36
33
|
var YStack = (0, import_core.styled)(import_core.View, {
|
|
37
34
|
flexDirection: "column",
|
|
38
35
|
variants
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stacks.native.js","names":[],"sources":["cjs/Stacks.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Stacks_exports = {};\n__export(Stacks_exports, {\n XStack: () => XStack,\n YStack: () => YStack,\n ZStack: () => ZStack\n});\nmodule.exports = __toCommonJS(Stacks_exports);\nvar import_core = require(\"@tamagui/core\");\nvar import_getElevation = require(\"./getElevation\");\nvar variants = {\n elevation:
|
|
1
|
+
{"version":3,"file":"Stacks.native.js","names":[],"sources":["cjs/Stacks.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Stacks_exports = {};\n__export(Stacks_exports, {\n XStack: () => XStack,\n YStack: () => YStack,\n ZStack: () => ZStack\n});\nmodule.exports = __toCommonJS(Stacks_exports);\nvar import_core = require(\"@tamagui/core\");\nvar import_getElevation = require(\"./getElevation\");\nvar variants = {\n elevation: import_getElevation.getElevation\n};\nvar YStack = (0, import_core.styled)(import_core.View, {\n flexDirection: \"column\",\n variants\n});\nYStack[\"displayName\"] = \"YStack\";\nvar XStack = (0, import_core.styled)(import_core.View, {\n flexDirection: \"row\",\n variants\n});\nXStack[\"displayName\"] = \"XStack\";\nvar ZStack = (0, import_core.styled)(YStack, {\n position: \"relative\"\n}, {\n neverFlatten: true,\n isZStack: true\n});\nZStack[\"displayName\"] = \"ZStack\";\n//# sourceMappingURL=Stacks.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,iBAAiB,CAAC;AACtB,SAAS,gBAAgB;CACvB,cAAc;CACd,cAAc;CACd,cAAc;AAChB,CAAC;AACD,OAAO,UAAU,aAAa,cAAc;AAC5C,IAAI,cAAc,QAAQ,eAAe;AACzC,IAAI,sBAAsB,QAAQ,0BAAgB;AAClD,IAAI,WAAW,EACb,WAAW,oBAAoB,aACjC;AACA,IAAI,UAAU,GAAG,YAAY,OAAM,CAAE,YAAY,MAAM;CACrD,eAAe;CACf;AACF,CAAC;AACD,OAAO,iBAAiB;AACxB,IAAI,UAAU,GAAG,YAAY,OAAM,CAAE,YAAY,MAAM;CACrD,eAAe;CACf;AACF,CAAC;AACD,OAAO,iBAAiB;AACxB,IAAI,UAAU,GAAG,YAAY,OAAM,CAAE,QAAQ,EAC3C,UAAU,WACZ,GAAG;CACD,cAAc;CACd,UAAU;AACZ,CAAC;AACD,OAAO,iBAAiB"}
|
|
@@ -25,16 +25,16 @@ __export(getElevation_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(getElevation_exports);
|
|
27
27
|
var import_core = require("@tamagui/core");
|
|
28
|
-
const getElevation = (size,
|
|
28
|
+
const getElevation = import_core.styled.dynamic((size, env) => {
|
|
29
29
|
if (!size) return;
|
|
30
|
-
const { tokens } =
|
|
30
|
+
const { tokens } = env;
|
|
31
31
|
const sizeToken = (0, import_core.resolveSizeToken)(size, "size");
|
|
32
|
-
if (typeof sizeToken === "number") return getSizedElevation(sizeToken,
|
|
32
|
+
if (typeof sizeToken === "number") return getSizedElevation(sizeToken, env);
|
|
33
33
|
const token = tokens.size[sizeToken];
|
|
34
34
|
const sizeNum = (0, import_core.isVariable)(token) ? +token.val : size;
|
|
35
|
-
return getSizedElevation(sizeNum,
|
|
36
|
-
};
|
|
37
|
-
const getSizedElevation = (val, { theme, tokens }) => {
|
|
35
|
+
return getSizedElevation(sizeNum, env);
|
|
36
|
+
});
|
|
37
|
+
const getSizedElevation = import_core.styled.dynamic((val, { theme, tokens }) => {
|
|
38
38
|
let num = 0;
|
|
39
39
|
if (typeof val === "number") {
|
|
40
40
|
num = val;
|
|
@@ -53,14 +53,13 @@ const getSizedElevation = (val, { theme, tokens }) => {
|
|
|
53
53
|
}
|
|
54
54
|
const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
|
|
55
55
|
const shadowColor = theme["shadow-color"] ?? theme.shadowColor;
|
|
56
|
-
|
|
56
|
+
return {
|
|
57
57
|
shadowColor,
|
|
58
58
|
shadowRadius,
|
|
59
59
|
shadowOffset: {
|
|
60
60
|
height,
|
|
61
61
|
width: 0
|
|
62
62
|
},
|
|
63
|
-
|
|
63
|
+
elevationAndroid: import_core.isAndroid ? 2 * height : void 0
|
|
64
64
|
};
|
|
65
|
-
|
|
66
|
-
};
|
|
65
|
+
});
|
|
@@ -27,16 +27,16 @@ __export(getElevation_exports, {
|
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(getElevation_exports);
|
|
29
29
|
var import_core = require("@tamagui/core");
|
|
30
|
-
var getElevation = function(size,
|
|
30
|
+
var getElevation = import_core.styled.dynamic(function(size, env) {
|
|
31
31
|
if (!size) return;
|
|
32
|
-
var { tokens } =
|
|
32
|
+
var { tokens } = env;
|
|
33
33
|
var sizeToken = (0, import_core.resolveSizeToken)(size, "size");
|
|
34
|
-
if (typeof sizeToken === "number") return getSizedElevation(sizeToken,
|
|
34
|
+
if (typeof sizeToken === "number") return getSizedElevation(sizeToken, env);
|
|
35
35
|
var token = tokens.size[sizeToken];
|
|
36
36
|
var sizeNum = (0, import_core.isVariable)(token) ? +token.val : size;
|
|
37
|
-
return getSizedElevation(sizeNum,
|
|
38
|
-
};
|
|
39
|
-
var getSizedElevation = function(val, param) {
|
|
37
|
+
return getSizedElevation(sizeNum, env);
|
|
38
|
+
});
|
|
39
|
+
var getSizedElevation = import_core.styled.dynamic(function(val, param) {
|
|
40
40
|
var { theme, tokens } = param;
|
|
41
41
|
var num = 0;
|
|
42
42
|
if (typeof val === "number") {
|
|
@@ -57,14 +57,13 @@ var getSizedElevation = function(val, param) {
|
|
|
57
57
|
var [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
|
|
58
58
|
var _theme_shadowcolor;
|
|
59
59
|
var shadowColor = (_theme_shadowcolor = theme["shadow-color"]) !== null && _theme_shadowcolor !== void 0 ? _theme_shadowcolor : theme.shadowColor;
|
|
60
|
-
|
|
60
|
+
return {
|
|
61
61
|
shadowColor,
|
|
62
62
|
shadowRadius,
|
|
63
63
|
shadowOffset: {
|
|
64
64
|
height,
|
|
65
65
|
width: 0
|
|
66
66
|
},
|
|
67
|
-
|
|
67
|
+
elevationAndroid: import_core.isAndroid ? 2 * height : void 0
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
};
|
|
69
|
+
});
|
|
@@ -27,16 +27,16 @@ __export(getElevation_exports, {
|
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(getElevation_exports);
|
|
29
29
|
var import_core = require("@tamagui/core");
|
|
30
|
-
var getElevation = function(size,
|
|
30
|
+
var getElevation = import_core.styled.dynamic(function(size, env) {
|
|
31
31
|
if (!size) return;
|
|
32
|
-
var { tokens } =
|
|
32
|
+
var { tokens } = env;
|
|
33
33
|
var sizeToken = (0, import_core.resolveSizeToken)(size, "size");
|
|
34
|
-
if (typeof sizeToken === "number") return getSizedElevation(sizeToken,
|
|
34
|
+
if (typeof sizeToken === "number") return getSizedElevation(sizeToken, env);
|
|
35
35
|
var token = tokens.size[sizeToken];
|
|
36
36
|
var sizeNum = (0, import_core.isVariable)(token) ? +token.val : size;
|
|
37
|
-
return getSizedElevation(sizeNum,
|
|
38
|
-
};
|
|
39
|
-
var getSizedElevation = function(val, param) {
|
|
37
|
+
return getSizedElevation(sizeNum, env);
|
|
38
|
+
});
|
|
39
|
+
var getSizedElevation = import_core.styled.dynamic(function(val, param) {
|
|
40
40
|
var { theme, tokens } = param;
|
|
41
41
|
var num = 0;
|
|
42
42
|
if (typeof val === "number") {
|
|
@@ -57,16 +57,15 @@ var getSizedElevation = function(val, param) {
|
|
|
57
57
|
var [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
|
|
58
58
|
var _theme_shadowcolor;
|
|
59
59
|
var shadowColor = (_theme_shadowcolor = theme["shadow-color"]) !== null && _theme_shadowcolor !== void 0 ? _theme_shadowcolor : theme.shadowColor;
|
|
60
|
-
|
|
60
|
+
return {
|
|
61
61
|
shadowColor,
|
|
62
62
|
shadowRadius,
|
|
63
63
|
shadowOffset: {
|
|
64
64
|
height,
|
|
65
65
|
width: 0
|
|
66
66
|
},
|
|
67
|
-
|
|
67
|
+
elevationAndroid: import_core.isAndroid ? 2 * height : void 0
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
};
|
|
69
|
+
});
|
|
71
70
|
|
|
72
71
|
//# sourceMappingURL=getElevation.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElevation.native.js","names":[],"sources":["cjs/getElevation.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar getElevation_exports = {};\n__export(getElevation_exports, {\n getElevation: () => getElevation,\n getSizedElevation: () => getSizedElevation\n});\nmodule.exports = __toCommonJS(getElevation_exports);\nvar import_core = require(\"@tamagui/core\");\nvar getElevation = function(size,
|
|
1
|
+
{"version":3,"file":"getElevation.native.js","names":[],"sources":["cjs/getElevation.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar getElevation_exports = {};\n__export(getElevation_exports, {\n getElevation: () => getElevation,\n getSizedElevation: () => getSizedElevation\n});\nmodule.exports = __toCommonJS(getElevation_exports);\nvar import_core = require(\"@tamagui/core\");\nvar getElevation = import_core.styled.dynamic(function(size, env) {\n if (!size) return;\n var { tokens } = env;\n var sizeToken = (0, import_core.resolveSizeToken)(size, \"size\");\n if (typeof sizeToken === \"number\") return getSizedElevation(sizeToken, env);\n var token = tokens.size[sizeToken];\n var sizeNum = (0, import_core.isVariable)(token) ? +token.val : size;\n return getSizedElevation(sizeNum, env);\n});\nvar getSizedElevation = import_core.styled.dynamic(function(val, param) {\n var { theme, tokens } = param;\n var num = 0;\n if (typeof val === \"number\") {\n num = val;\n } else if (val) {\n var sizeToken = (0, import_core.resolveSizeToken)(val, \"size\");\n var token = typeof sizeToken === \"number\" ? sizeToken : tokens.size[sizeToken];\n var tokenValue = (0, import_core.getVariableValue)(token);\n if (typeof tokenValue === \"number\") {\n num = tokenValue;\n } else {\n num = 10;\n }\n }\n if (num === 0) {\n return;\n }\n var [height, shadowRadius] = [\n Math.round(num / 4 + 1),\n Math.round(num / 2 + 2)\n ];\n var _theme_shadowcolor;\n var shadowColor = (_theme_shadowcolor = theme[\"shadow-color\"]) !== null && _theme_shadowcolor !== void 0 ? _theme_shadowcolor : theme.shadowColor;\n return {\n shadowColor,\n shadowRadius,\n shadowOffset: {\n height,\n width: 0\n },\n elevationAndroid: import_core.isAndroid ? 2 * height : void 0\n };\n});\n//# sourceMappingURL=getElevation.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,uBAAuB,CAAC;AAC5B,SAAS,sBAAsB;CAC7B,oBAAoB;CACpB,yBAAyB;AAC3B,CAAC;AACD,OAAO,UAAU,aAAa,oBAAoB;AAClD,IAAI,cAAc,QAAQ,eAAe;AACzC,IAAI,eAAe,YAAY,OAAO,QAAQ,SAAS,MAAM,KAAK;CAChE,IAAI,CAAC,MAAM;CACX,IAAI,EAAE,WAAW;CACjB,IAAI,aAAa,GAAG,YAAY,iBAAgB,CAAE,MAAM,MAAM;CAC9D,IAAI,OAAO,cAAc,UAAU,OAAO,kBAAkB,WAAW,GAAG;CAC1E,IAAI,QAAQ,OAAO,KAAK;CACxB,IAAI,WAAW,GAAG,YAAY,WAAU,CAAE,KAAK,IAAI,CAAC,MAAM,MAAM;CAChE,OAAO,kBAAkB,SAAS,GAAG;AACvC,CAAC;AACD,IAAI,oBAAoB,YAAY,OAAO,QAAQ,SAAS,KAAK,OAAO;CACtE,IAAI,EAAE,OAAO,WAAW;CACxB,IAAI,MAAM;CACV,IAAI,OAAO,QAAQ,UAAU;EAC3B,MAAM;CACR,OAAO,IAAI,KAAK;EACd,IAAI,aAAa,GAAG,YAAY,iBAAgB,CAAE,KAAK,MAAM;EAC7D,IAAI,QAAQ,OAAO,cAAc,WAAW,YAAY,OAAO,KAAK;EACpE,IAAI,cAAc,GAAG,YAAY,iBAAgB,CAAE,KAAK;EACxD,IAAI,OAAO,eAAe,UAAU;GAClC,MAAM;EACR,OAAO;GACL,MAAM;EACR;CACF;CACA,IAAI,QAAQ,GAAG;EACb;CACF;CACA,IAAI,CAAC,QAAQ,gBAAgB,CAC3B,KAAK,MAAM,MAAM,IAAI,CAAC,GACtB,KAAK,MAAM,MAAM,IAAI,CAAC,CACxB;CACA,IAAI;CACJ,IAAI,eAAe,qBAAqB,MAAM,qBAAqB,QAAQ,uBAAuB,KAAK,IAAI,qBAAqB,MAAM;CACtI,OAAO;EACL;EACA;EACA,cAAc;GACZ;GACA,OAAO;EACT;EACA,kBAAkB,YAAY,YAAY,IAAI,SAAS,KAAK;CAC9D;AACF,CAAC"}
|
package/dist/esm/Stacks.mjs
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { View, styled } from "@tamagui/core";
|
|
2
2
|
import { getElevation } from "./getElevation.mjs";
|
|
3
3
|
|
|
4
|
-
const variants = { elevation:
|
|
5
|
-
number: getElevation,
|
|
6
|
-
Size: getElevation
|
|
7
|
-
} };
|
|
4
|
+
const variants = { elevation: getElevation };
|
|
8
5
|
const YStack = styled(View, {
|
|
9
6
|
flexDirection: "column",
|
|
10
7
|
variants
|
package/dist/esm/Stacks.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stacks.js","names":[],"sources":["esm/Stacks.js"],"sourcesContent":["import { View, styled } from \"@tamagui/core\";\nimport { getElevation } from \"./getElevation\";\nconst variants = {\n elevation:
|
|
1
|
+
{"version":3,"file":"Stacks.js","names":[],"sources":["esm/Stacks.js"],"sourcesContent":["import { View, styled } from \"@tamagui/core\";\nimport { getElevation } from \"./getElevation\";\nconst variants = {\n elevation: getElevation\n};\nconst YStack = styled(View, {\n flexDirection: \"column\",\n variants\n});\nYStack[\"displayName\"] = \"YStack\";\nconst XStack = styled(View, {\n flexDirection: \"row\",\n variants\n});\nXStack[\"displayName\"] = \"XStack\";\nconst ZStack = styled(\n YStack,\n {\n position: \"relative\"\n },\n {\n neverFlatten: true,\n isZStack: true\n }\n);\nZStack[\"displayName\"] = \"ZStack\";\nexport {\n XStack,\n YStack,\n ZStack\n};\n//# sourceMappingURL=Stacks.js.map\n"],"mappings":";;;;AAEA,MAAM,WAAW,EACf,WAAW,aACb;AACA,MAAM,SAAS,OAAO,MAAM;CAC1B,eAAe;CACf;AACF,CAAC;AACD,OAAO,iBAAiB;AACxB,MAAM,SAAS,OAAO,MAAM;CAC1B,eAAe;CACf;AACF,CAAC;AACD,OAAO,iBAAiB;AACxB,MAAM,SAAS,OACb,QACA,EACE,UAAU,WACZ,GACA;CACE,cAAc;CACd,UAAU;AACZ,CACF;AACA,OAAO,iBAAiB"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { View, styled } from "@tamagui/core";
|
|
2
2
|
import { getElevation } from "./getElevation.native.js";
|
|
3
3
|
|
|
4
|
-
var variants = { elevation:
|
|
5
|
-
number: getElevation,
|
|
6
|
-
Size: getElevation
|
|
7
|
-
} };
|
|
4
|
+
var variants = { elevation: getElevation };
|
|
8
5
|
var YStack = styled(View, {
|
|
9
6
|
flexDirection: "column",
|
|
10
7
|
variants
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stacks.native.js","names":[],"sources":["esm/Stacks.native.js"],"sourcesContent":["import { View, styled } from \"@tamagui/core\";\nimport { getElevation } from \"./getElevation\";\nvar variants = {\n elevation:
|
|
1
|
+
{"version":3,"file":"Stacks.native.js","names":[],"sources":["esm/Stacks.native.js"],"sourcesContent":["import { View, styled } from \"@tamagui/core\";\nimport { getElevation } from \"./getElevation\";\nvar variants = {\n elevation: getElevation\n};\nvar YStack = styled(View, {\n flexDirection: \"column\",\n variants\n});\nYStack[\"displayName\"] = \"YStack\";\nvar XStack = styled(View, {\n flexDirection: \"row\",\n variants\n});\nXStack[\"displayName\"] = \"XStack\";\nvar ZStack = styled(YStack, {\n position: \"relative\"\n}, {\n neverFlatten: true,\n isZStack: true\n});\nZStack[\"displayName\"] = \"ZStack\";\nexport {\n XStack,\n YStack,\n ZStack\n};\n//# sourceMappingURL=Stacks.js.map\n"],"mappings":";;;;AAEA,IAAI,WAAW,EACb,WAAW,aACb;AACA,IAAI,SAAS,OAAO,MAAM;CACxB,eAAe;CACf;AACF,CAAC;AACD,OAAO,iBAAiB;AACxB,IAAI,SAAS,OAAO,MAAM;CACxB,eAAe;CACf;AACF,CAAC;AACD,OAAO,iBAAiB;AACxB,IAAI,SAAS,OAAO,QAAQ,EAC1B,UAAU,WACZ,GAAG;CACD,cAAc;CACd,UAAU;AACZ,CAAC;AACD,OAAO,iBAAiB"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { getVariableValue, isAndroid, isVariable, resolveSizeToken } from "@tamagui/core";
|
|
1
|
+
import { getVariableValue, isAndroid, isVariable, resolveSizeToken, styled } from "@tamagui/core";
|
|
2
2
|
|
|
3
|
-
const getElevation = (size,
|
|
3
|
+
const getElevation = styled.dynamic((size, env) => {
|
|
4
4
|
if (!size) return;
|
|
5
|
-
const { tokens } =
|
|
5
|
+
const { tokens } = env;
|
|
6
6
|
const sizeToken = resolveSizeToken(size, "size");
|
|
7
|
-
if (typeof sizeToken === "number") return getSizedElevation(sizeToken,
|
|
7
|
+
if (typeof sizeToken === "number") return getSizedElevation(sizeToken, env);
|
|
8
8
|
const token = tokens.size[sizeToken];
|
|
9
9
|
const sizeNum = isVariable(token) ? +token.val : size;
|
|
10
|
-
return getSizedElevation(sizeNum,
|
|
11
|
-
};
|
|
12
|
-
const getSizedElevation = (val, { theme, tokens }) => {
|
|
10
|
+
return getSizedElevation(sizeNum, env);
|
|
11
|
+
});
|
|
12
|
+
const getSizedElevation = styled.dynamic((val, { theme, tokens }) => {
|
|
13
13
|
let num = 0;
|
|
14
14
|
if (typeof val === "number") {
|
|
15
15
|
num = val;
|
|
@@ -28,17 +28,16 @@ const getSizedElevation = (val, { theme, tokens }) => {
|
|
|
28
28
|
}
|
|
29
29
|
const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
|
|
30
30
|
const shadowColor = theme["shadow-color"] ?? theme.shadowColor;
|
|
31
|
-
|
|
31
|
+
return {
|
|
32
32
|
shadowColor,
|
|
33
33
|
shadowRadius,
|
|
34
34
|
shadowOffset: {
|
|
35
35
|
height,
|
|
36
36
|
width: 0
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
elevationAndroid: isAndroid ? 2 * height : void 0
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
};
|
|
40
|
+
});
|
|
42
41
|
|
|
43
42
|
export { getElevation, getSizedElevation };
|
|
44
43
|
//# sourceMappingURL=getElevation.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElevation.js","names":[],"sources":["esm/getElevation.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"getElevation.js","names":[],"sources":["esm/getElevation.js"],"sourcesContent":["import {\n getVariableValue,\n isAndroid,\n isVariable,\n resolveSizeToken,\n styled\n} from \"@tamagui/core\";\nconst getElevation = styled.dynamic((size, env) => {\n if (!size) return;\n const { tokens } = env;\n const sizeToken = resolveSizeToken(size, \"size\");\n if (typeof sizeToken === \"number\") return getSizedElevation(sizeToken, env);\n const token = tokens.size[sizeToken];\n const sizeNum = isVariable(token) ? +token.val : size;\n return getSizedElevation(sizeNum, env);\n});\nconst getSizedElevation = styled.dynamic(\n (val, { theme, tokens }) => {\n let num = 0;\n if (typeof val === \"number\") {\n num = val;\n } else if (val) {\n const sizeToken = resolveSizeToken(val, \"size\");\n const token = typeof sizeToken === \"number\" ? sizeToken : tokens.size[sizeToken];\n const tokenValue = getVariableValue(token);\n if (typeof tokenValue === \"number\") {\n num = tokenValue;\n } else {\n num = 10;\n }\n }\n if (num === 0) {\n return;\n }\n const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];\n const shadowColor = theme[\"shadow-color\"] ?? theme.shadowColor;\n return {\n shadowColor,\n shadowRadius,\n shadowOffset: { height, width: 0 },\n elevationAndroid: isAndroid ? 2 * height : void 0\n };\n }\n);\nexport {\n getElevation,\n getSizedElevation\n};\n//# sourceMappingURL=getElevation.js.map\n"],"mappings":";;;AAOA,MAAM,eAAe,OAAO,SAAS,MAAM,QAAQ;CACjD,IAAI,CAAC,MAAM;CACX,MAAM,EAAE,WAAW;CACnB,MAAM,YAAY,iBAAiB,MAAM,MAAM;CAC/C,IAAI,OAAO,cAAc,UAAU,OAAO,kBAAkB,WAAW,GAAG;CAC1E,MAAM,QAAQ,OAAO,KAAK;CAC1B,MAAM,UAAU,WAAW,KAAK,IAAI,CAAC,MAAM,MAAM;CACjD,OAAO,kBAAkB,SAAS,GAAG;AACvC,CAAC;AACD,MAAM,oBAAoB,OAAO,SAC9B,KAAK,EAAE,OAAO,aAAa;CAC1B,IAAI,MAAM;CACV,IAAI,OAAO,QAAQ,UAAU;EAC3B,MAAM;CACR,OAAO,IAAI,KAAK;EACd,MAAM,YAAY,iBAAiB,KAAK,MAAM;EAC9C,MAAM,QAAQ,OAAO,cAAc,WAAW,YAAY,OAAO,KAAK;EACtE,MAAM,aAAa,iBAAiB,KAAK;EACzC,IAAI,OAAO,eAAe,UAAU;GAClC,MAAM;EACR,OAAO;GACL,MAAM;EACR;CACF;CACA,IAAI,QAAQ,GAAG;EACb;CACF;CACA,MAAM,CAAC,QAAQ,gBAAgB,CAAC,KAAK,MAAM,MAAM,IAAI,CAAC,GAAG,KAAK,MAAM,MAAM,IAAI,CAAC,CAAC;CAChF,MAAM,cAAc,MAAM,mBAAmB,MAAM;CACnD,OAAO;EACL;EACA;EACA,cAAc;GAAE;GAAQ,OAAO;EAAE;EACjC,kBAAkB,YAAY,IAAI,SAAS,KAAK;CAClD;AACF,CACF"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { getVariableValue, isAndroid, isVariable, resolveSizeToken } from "@tamagui/core";
|
|
1
|
+
import { getVariableValue, isAndroid, isVariable, resolveSizeToken, styled } from "@tamagui/core";
|
|
2
2
|
|
|
3
|
-
var getElevation = function(size,
|
|
3
|
+
var getElevation = styled.dynamic(function(size, env) {
|
|
4
4
|
if (!size) return;
|
|
5
|
-
var { tokens } =
|
|
5
|
+
var { tokens } = env;
|
|
6
6
|
var sizeToken = resolveSizeToken(size, "size");
|
|
7
|
-
if (typeof sizeToken === "number") return getSizedElevation(sizeToken,
|
|
7
|
+
if (typeof sizeToken === "number") return getSizedElevation(sizeToken, env);
|
|
8
8
|
var token = tokens.size[sizeToken];
|
|
9
9
|
var sizeNum = isVariable(token) ? +token.val : size;
|
|
10
|
-
return getSizedElevation(sizeNum,
|
|
11
|
-
};
|
|
12
|
-
var getSizedElevation = function(val, param) {
|
|
10
|
+
return getSizedElevation(sizeNum, env);
|
|
11
|
+
});
|
|
12
|
+
var getSizedElevation = styled.dynamic(function(val, param) {
|
|
13
13
|
var { theme, tokens } = param;
|
|
14
14
|
var num = 0;
|
|
15
15
|
if (typeof val === "number") {
|
|
@@ -30,17 +30,16 @@ var getSizedElevation = function(val, param) {
|
|
|
30
30
|
var [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
|
|
31
31
|
var _theme_shadowcolor;
|
|
32
32
|
var shadowColor = (_theme_shadowcolor = theme["shadow-color"]) !== null && _theme_shadowcolor !== void 0 ? _theme_shadowcolor : theme.shadowColor;
|
|
33
|
-
|
|
33
|
+
return {
|
|
34
34
|
shadowColor,
|
|
35
35
|
shadowRadius,
|
|
36
36
|
shadowOffset: {
|
|
37
37
|
height,
|
|
38
38
|
width: 0
|
|
39
39
|
},
|
|
40
|
-
|
|
40
|
+
elevationAndroid: isAndroid ? 2 * height : void 0
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
};
|
|
42
|
+
});
|
|
44
43
|
|
|
45
44
|
export { getElevation, getSizedElevation };
|
|
46
45
|
//# sourceMappingURL=getElevation.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElevation.native.js","names":[],"sources":["esm/getElevation.native.js"],"sourcesContent":["import { getVariableValue, isAndroid, isVariable, resolveSizeToken } from \"@tamagui/core\";\nvar getElevation = function(size,
|
|
1
|
+
{"version":3,"file":"getElevation.native.js","names":[],"sources":["esm/getElevation.native.js"],"sourcesContent":["import { getVariableValue, isAndroid, isVariable, resolveSizeToken, styled } from \"@tamagui/core\";\nvar getElevation = styled.dynamic(function(size, env) {\n if (!size) return;\n var { tokens } = env;\n var sizeToken = resolveSizeToken(size, \"size\");\n if (typeof sizeToken === \"number\") return getSizedElevation(sizeToken, env);\n var token = tokens.size[sizeToken];\n var sizeNum = isVariable(token) ? +token.val : size;\n return getSizedElevation(sizeNum, env);\n});\nvar getSizedElevation = styled.dynamic(function(val, param) {\n var { theme, tokens } = param;\n var num = 0;\n if (typeof val === \"number\") {\n num = val;\n } else if (val) {\n var sizeToken = resolveSizeToken(val, \"size\");\n var token = typeof sizeToken === \"number\" ? sizeToken : tokens.size[sizeToken];\n var tokenValue = getVariableValue(token);\n if (typeof tokenValue === \"number\") {\n num = tokenValue;\n } else {\n num = 10;\n }\n }\n if (num === 0) {\n return;\n }\n var [height, shadowRadius] = [\n Math.round(num / 4 + 1),\n Math.round(num / 2 + 2)\n ];\n var _theme_shadowcolor;\n var shadowColor = (_theme_shadowcolor = theme[\"shadow-color\"]) !== null && _theme_shadowcolor !== void 0 ? _theme_shadowcolor : theme.shadowColor;\n return {\n shadowColor,\n shadowRadius,\n shadowOffset: {\n height,\n width: 0\n },\n elevationAndroid: isAndroid ? 2 * height : void 0\n };\n});\nexport {\n getElevation,\n getSizedElevation\n};\n//# sourceMappingURL=getElevation.js.map\n"],"mappings":";;;AACA,IAAI,eAAe,OAAO,QAAQ,SAAS,MAAM,KAAK;CACpD,IAAI,CAAC,MAAM;CACX,IAAI,EAAE,WAAW;CACjB,IAAI,YAAY,iBAAiB,MAAM,MAAM;CAC7C,IAAI,OAAO,cAAc,UAAU,OAAO,kBAAkB,WAAW,GAAG;CAC1E,IAAI,QAAQ,OAAO,KAAK;CACxB,IAAI,UAAU,WAAW,KAAK,IAAI,CAAC,MAAM,MAAM;CAC/C,OAAO,kBAAkB,SAAS,GAAG;AACvC,CAAC;AACD,IAAI,oBAAoB,OAAO,QAAQ,SAAS,KAAK,OAAO;CAC1D,IAAI,EAAE,OAAO,WAAW;CACxB,IAAI,MAAM;CACV,IAAI,OAAO,QAAQ,UAAU;EAC3B,MAAM;CACR,OAAO,IAAI,KAAK;EACd,IAAI,YAAY,iBAAiB,KAAK,MAAM;EAC5C,IAAI,QAAQ,OAAO,cAAc,WAAW,YAAY,OAAO,KAAK;EACpE,IAAI,aAAa,iBAAiB,KAAK;EACvC,IAAI,OAAO,eAAe,UAAU;GAClC,MAAM;EACR,OAAO;GACL,MAAM;EACR;CACF;CACA,IAAI,QAAQ,GAAG;EACb;CACF;CACA,IAAI,CAAC,QAAQ,gBAAgB,CAC3B,KAAK,MAAM,MAAM,IAAI,CAAC,GACtB,KAAK,MAAM,MAAM,IAAI,CAAC,CACxB;CACA,IAAI;CACJ,IAAI,eAAe,qBAAqB,MAAM,qBAAqB,QAAQ,uBAAuB,KAAK,IAAI,qBAAqB,MAAM;CACtI,OAAO;EACL;EACA;EACA,cAAc;GACZ;GACA,OAAO;EACT;EACA,kBAAkB,YAAY,IAAI,SAAS,KAAK;CAClD;AACF,CAAC"}
|
package/dist/jsx/Stacks.mjs
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { View, styled } from "@tamagui/core";
|
|
2
2
|
import { getElevation } from "./getElevation.mjs";
|
|
3
3
|
|
|
4
|
-
const variants = { elevation:
|
|
5
|
-
number: getElevation,
|
|
6
|
-
Size: getElevation
|
|
7
|
-
} };
|
|
4
|
+
const variants = { elevation: getElevation };
|
|
8
5
|
const YStack = styled(View, {
|
|
9
6
|
flexDirection: "column",
|
|
10
7
|
variants
|
package/dist/jsx/Stacks.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stacks.js","names":[],"sources":["jsx/Stacks.js"],"sourcesContent":["import { View, styled } from \"@tamagui/core\";\nimport { getElevation } from \"./getElevation\";\nconst variants = {\n elevation:
|
|
1
|
+
{"version":3,"file":"Stacks.js","names":[],"sources":["jsx/Stacks.js"],"sourcesContent":["import { View, styled } from \"@tamagui/core\";\nimport { getElevation } from \"./getElevation\";\nconst variants = {\n elevation: getElevation\n};\nconst YStack = styled(View, {\n flexDirection: \"column\",\n variants\n});\nYStack[\"displayName\"] = \"YStack\";\nconst XStack = styled(View, {\n flexDirection: \"row\",\n variants\n});\nXStack[\"displayName\"] = \"XStack\";\nconst ZStack = styled(\n YStack,\n {\n position: \"relative\"\n },\n {\n neverFlatten: true,\n isZStack: true\n }\n);\nZStack[\"displayName\"] = \"ZStack\";\nexport {\n XStack,\n YStack,\n ZStack\n};\n//# sourceMappingURL=Stacks.js.map\n"],"mappings":";;;;AAEA,MAAM,WAAW,EACf,WAAW,aACb;AACA,MAAM,SAAS,OAAO,MAAM;CAC1B,eAAe;CACf;AACF,CAAC;AACD,OAAO,iBAAiB;AACxB,MAAM,SAAS,OAAO,MAAM;CAC1B,eAAe;CACf;AACF,CAAC;AACD,OAAO,iBAAiB;AACxB,MAAM,SAAS,OACb,QACA,EACE,UAAU,WACZ,GACA;CACE,cAAc;CACd,UAAU;AACZ,CACF;AACA,OAAO,iBAAiB"}
|
|
@@ -29,10 +29,7 @@ __export(Stacks_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(Stacks_exports);
|
|
30
30
|
var import_core = require("@tamagui/core");
|
|
31
31
|
var import_getElevation = require("./getElevation.native.js");
|
|
32
|
-
var variants = { elevation:
|
|
33
|
-
number: import_getElevation.getElevation,
|
|
34
|
-
Size: import_getElevation.getElevation
|
|
35
|
-
} };
|
|
32
|
+
var variants = { elevation: import_getElevation.getElevation };
|
|
36
33
|
var YStack = (0, import_core.styled)(import_core.View, {
|
|
37
34
|
flexDirection: "column",
|
|
38
35
|
variants
|
|
@@ -29,10 +29,7 @@ __export(Stacks_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(Stacks_exports);
|
|
30
30
|
var import_core = require("@tamagui/core");
|
|
31
31
|
var import_getElevation = require("./getElevation.native.js");
|
|
32
|
-
var variants = { elevation:
|
|
33
|
-
number: import_getElevation.getElevation,
|
|
34
|
-
Size: import_getElevation.getElevation
|
|
35
|
-
} };
|
|
32
|
+
var variants = { elevation: import_getElevation.getElevation };
|
|
36
33
|
var YStack = (0, import_core.styled)(import_core.View, {
|
|
37
34
|
flexDirection: "column",
|
|
38
35
|
variants
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stacks.native.js","names":[],"sources":["jsx/Stacks.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Stacks_exports = {};\n__export(Stacks_exports, {\n XStack: () => XStack,\n YStack: () => YStack,\n ZStack: () => ZStack\n});\nmodule.exports = __toCommonJS(Stacks_exports);\nvar import_core = require(\"@tamagui/core\");\nvar import_getElevation = require(\"./getElevation\");\nvar variants = {\n elevation:
|
|
1
|
+
{"version":3,"file":"Stacks.native.js","names":[],"sources":["jsx/Stacks.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Stacks_exports = {};\n__export(Stacks_exports, {\n XStack: () => XStack,\n YStack: () => YStack,\n ZStack: () => ZStack\n});\nmodule.exports = __toCommonJS(Stacks_exports);\nvar import_core = require(\"@tamagui/core\");\nvar import_getElevation = require(\"./getElevation\");\nvar variants = {\n elevation: import_getElevation.getElevation\n};\nvar YStack = (0, import_core.styled)(import_core.View, {\n flexDirection: \"column\",\n variants\n});\nYStack[\"displayName\"] = \"YStack\";\nvar XStack = (0, import_core.styled)(import_core.View, {\n flexDirection: \"row\",\n variants\n});\nXStack[\"displayName\"] = \"XStack\";\nvar ZStack = (0, import_core.styled)(YStack, {\n position: \"relative\"\n}, {\n neverFlatten: true,\n isZStack: true\n});\nZStack[\"displayName\"] = \"ZStack\";\n//# sourceMappingURL=Stacks.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,iBAAiB,CAAC;AACtB,SAAS,gBAAgB;CACvB,cAAc;CACd,cAAc;CACd,cAAc;AAChB,CAAC;AACD,OAAO,UAAU,aAAa,cAAc;AAC5C,IAAI,cAAc,QAAQ,eAAe;AACzC,IAAI,sBAAsB,QAAQ,0BAAgB;AAClD,IAAI,WAAW,EACb,WAAW,oBAAoB,aACjC;AACA,IAAI,UAAU,GAAG,YAAY,OAAM,CAAE,YAAY,MAAM;CACrD,eAAe;CACf;AACF,CAAC;AACD,OAAO,iBAAiB;AACxB,IAAI,UAAU,GAAG,YAAY,OAAM,CAAE,YAAY,MAAM;CACrD,eAAe;CACf;AACF,CAAC;AACD,OAAO,iBAAiB;AACxB,IAAI,UAAU,GAAG,YAAY,OAAM,CAAE,QAAQ,EAC3C,UAAU,WACZ,GAAG;CACD,cAAc;CACd,UAAU;AACZ,CAAC;AACD,OAAO,iBAAiB"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { getVariableValue, isAndroid, isVariable, resolveSizeToken } from "@tamagui/core";
|
|
1
|
+
import { getVariableValue, isAndroid, isVariable, resolveSizeToken, styled } from "@tamagui/core";
|
|
2
2
|
|
|
3
|
-
const getElevation = (size,
|
|
3
|
+
const getElevation = styled.dynamic((size, env) => {
|
|
4
4
|
if (!size) return;
|
|
5
|
-
const { tokens } =
|
|
5
|
+
const { tokens } = env;
|
|
6
6
|
const sizeToken = resolveSizeToken(size, "size");
|
|
7
|
-
if (typeof sizeToken === "number") return getSizedElevation(sizeToken,
|
|
7
|
+
if (typeof sizeToken === "number") return getSizedElevation(sizeToken, env);
|
|
8
8
|
const token = tokens.size[sizeToken];
|
|
9
9
|
const sizeNum = isVariable(token) ? +token.val : size;
|
|
10
|
-
return getSizedElevation(sizeNum,
|
|
11
|
-
};
|
|
12
|
-
const getSizedElevation = (val, { theme, tokens }) => {
|
|
10
|
+
return getSizedElevation(sizeNum, env);
|
|
11
|
+
});
|
|
12
|
+
const getSizedElevation = styled.dynamic((val, { theme, tokens }) => {
|
|
13
13
|
let num = 0;
|
|
14
14
|
if (typeof val === "number") {
|
|
15
15
|
num = val;
|
|
@@ -28,17 +28,16 @@ const getSizedElevation = (val, { theme, tokens }) => {
|
|
|
28
28
|
}
|
|
29
29
|
const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
|
|
30
30
|
const shadowColor = theme["shadow-color"] ?? theme.shadowColor;
|
|
31
|
-
|
|
31
|
+
return {
|
|
32
32
|
shadowColor,
|
|
33
33
|
shadowRadius,
|
|
34
34
|
shadowOffset: {
|
|
35
35
|
height,
|
|
36
36
|
width: 0
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
elevationAndroid: isAndroid ? 2 * height : void 0
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
};
|
|
40
|
+
});
|
|
42
41
|
|
|
43
42
|
export { getElevation, getSizedElevation };
|
|
44
43
|
//# sourceMappingURL=getElevation.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElevation.js","names":[],"sources":["jsx/getElevation.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"getElevation.js","names":[],"sources":["jsx/getElevation.js"],"sourcesContent":["import {\n getVariableValue,\n isAndroid,\n isVariable,\n resolveSizeToken,\n styled\n} from \"@tamagui/core\";\nconst getElevation = styled.dynamic((size, env) => {\n if (!size) return;\n const { tokens } = env;\n const sizeToken = resolveSizeToken(size, \"size\");\n if (typeof sizeToken === \"number\") return getSizedElevation(sizeToken, env);\n const token = tokens.size[sizeToken];\n const sizeNum = isVariable(token) ? +token.val : size;\n return getSizedElevation(sizeNum, env);\n});\nconst getSizedElevation = styled.dynamic(\n (val, { theme, tokens }) => {\n let num = 0;\n if (typeof val === \"number\") {\n num = val;\n } else if (val) {\n const sizeToken = resolveSizeToken(val, \"size\");\n const token = typeof sizeToken === \"number\" ? sizeToken : tokens.size[sizeToken];\n const tokenValue = getVariableValue(token);\n if (typeof tokenValue === \"number\") {\n num = tokenValue;\n } else {\n num = 10;\n }\n }\n if (num === 0) {\n return;\n }\n const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];\n const shadowColor = theme[\"shadow-color\"] ?? theme.shadowColor;\n return {\n shadowColor,\n shadowRadius,\n shadowOffset: { height, width: 0 },\n elevationAndroid: isAndroid ? 2 * height : void 0\n };\n }\n);\nexport {\n getElevation,\n getSizedElevation\n};\n//# sourceMappingURL=getElevation.js.map\n"],"mappings":";;;AAOA,MAAM,eAAe,OAAO,SAAS,MAAM,QAAQ;CACjD,IAAI,CAAC,MAAM;CACX,MAAM,EAAE,WAAW;CACnB,MAAM,YAAY,iBAAiB,MAAM,MAAM;CAC/C,IAAI,OAAO,cAAc,UAAU,OAAO,kBAAkB,WAAW,GAAG;CAC1E,MAAM,QAAQ,OAAO,KAAK;CAC1B,MAAM,UAAU,WAAW,KAAK,IAAI,CAAC,MAAM,MAAM;CACjD,OAAO,kBAAkB,SAAS,GAAG;AACvC,CAAC;AACD,MAAM,oBAAoB,OAAO,SAC9B,KAAK,EAAE,OAAO,aAAa;CAC1B,IAAI,MAAM;CACV,IAAI,OAAO,QAAQ,UAAU;EAC3B,MAAM;CACR,OAAO,IAAI,KAAK;EACd,MAAM,YAAY,iBAAiB,KAAK,MAAM;EAC9C,MAAM,QAAQ,OAAO,cAAc,WAAW,YAAY,OAAO,KAAK;EACtE,MAAM,aAAa,iBAAiB,KAAK;EACzC,IAAI,OAAO,eAAe,UAAU;GAClC,MAAM;EACR,OAAO;GACL,MAAM;EACR;CACF;CACA,IAAI,QAAQ,GAAG;EACb;CACF;CACA,MAAM,CAAC,QAAQ,gBAAgB,CAAC,KAAK,MAAM,MAAM,IAAI,CAAC,GAAG,KAAK,MAAM,MAAM,IAAI,CAAC,CAAC;CAChF,MAAM,cAAc,MAAM,mBAAmB,MAAM;CACnD,OAAO;EACL;EACA;EACA,cAAc;GAAE;GAAQ,OAAO;EAAE;EACjC,kBAAkB,YAAY,IAAI,SAAS,KAAK;CAClD;AACF,CACF"}
|
|
@@ -27,16 +27,16 @@ __export(getElevation_exports, {
|
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(getElevation_exports);
|
|
29
29
|
var import_core = require("@tamagui/core");
|
|
30
|
-
var getElevation = function(size,
|
|
30
|
+
var getElevation = import_core.styled.dynamic(function(size, env) {
|
|
31
31
|
if (!size) return;
|
|
32
|
-
var { tokens } =
|
|
32
|
+
var { tokens } = env;
|
|
33
33
|
var sizeToken = (0, import_core.resolveSizeToken)(size, "size");
|
|
34
|
-
if (typeof sizeToken === "number") return getSizedElevation(sizeToken,
|
|
34
|
+
if (typeof sizeToken === "number") return getSizedElevation(sizeToken, env);
|
|
35
35
|
var token = tokens.size[sizeToken];
|
|
36
36
|
var sizeNum = (0, import_core.isVariable)(token) ? +token.val : size;
|
|
37
|
-
return getSizedElevation(sizeNum,
|
|
38
|
-
};
|
|
39
|
-
var getSizedElevation = function(val, param) {
|
|
37
|
+
return getSizedElevation(sizeNum, env);
|
|
38
|
+
});
|
|
39
|
+
var getSizedElevation = import_core.styled.dynamic(function(val, param) {
|
|
40
40
|
var { theme, tokens } = param;
|
|
41
41
|
var num = 0;
|
|
42
42
|
if (typeof val === "number") {
|
|
@@ -57,14 +57,13 @@ var getSizedElevation = function(val, param) {
|
|
|
57
57
|
var [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
|
|
58
58
|
var _theme_shadowcolor;
|
|
59
59
|
var shadowColor = (_theme_shadowcolor = theme["shadow-color"]) !== null && _theme_shadowcolor !== void 0 ? _theme_shadowcolor : theme.shadowColor;
|
|
60
|
-
|
|
60
|
+
return {
|
|
61
61
|
shadowColor,
|
|
62
62
|
shadowRadius,
|
|
63
63
|
shadowOffset: {
|
|
64
64
|
height,
|
|
65
65
|
width: 0
|
|
66
66
|
},
|
|
67
|
-
|
|
67
|
+
elevationAndroid: import_core.isAndroid ? 2 * height : void 0
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
};
|
|
69
|
+
});
|
|
@@ -27,16 +27,16 @@ __export(getElevation_exports, {
|
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(getElevation_exports);
|
|
29
29
|
var import_core = require("@tamagui/core");
|
|
30
|
-
var getElevation = function(size,
|
|
30
|
+
var getElevation = import_core.styled.dynamic(function(size, env) {
|
|
31
31
|
if (!size) return;
|
|
32
|
-
var { tokens } =
|
|
32
|
+
var { tokens } = env;
|
|
33
33
|
var sizeToken = (0, import_core.resolveSizeToken)(size, "size");
|
|
34
|
-
if (typeof sizeToken === "number") return getSizedElevation(sizeToken,
|
|
34
|
+
if (typeof sizeToken === "number") return getSizedElevation(sizeToken, env);
|
|
35
35
|
var token = tokens.size[sizeToken];
|
|
36
36
|
var sizeNum = (0, import_core.isVariable)(token) ? +token.val : size;
|
|
37
|
-
return getSizedElevation(sizeNum,
|
|
38
|
-
};
|
|
39
|
-
var getSizedElevation = function(val, param) {
|
|
37
|
+
return getSizedElevation(sizeNum, env);
|
|
38
|
+
});
|
|
39
|
+
var getSizedElevation = import_core.styled.dynamic(function(val, param) {
|
|
40
40
|
var { theme, tokens } = param;
|
|
41
41
|
var num = 0;
|
|
42
42
|
if (typeof val === "number") {
|
|
@@ -57,16 +57,15 @@ var getSizedElevation = function(val, param) {
|
|
|
57
57
|
var [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
|
|
58
58
|
var _theme_shadowcolor;
|
|
59
59
|
var shadowColor = (_theme_shadowcolor = theme["shadow-color"]) !== null && _theme_shadowcolor !== void 0 ? _theme_shadowcolor : theme.shadowColor;
|
|
60
|
-
|
|
60
|
+
return {
|
|
61
61
|
shadowColor,
|
|
62
62
|
shadowRadius,
|
|
63
63
|
shadowOffset: {
|
|
64
64
|
height,
|
|
65
65
|
width: 0
|
|
66
66
|
},
|
|
67
|
-
|
|
67
|
+
elevationAndroid: import_core.isAndroid ? 2 * height : void 0
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
};
|
|
69
|
+
});
|
|
71
70
|
|
|
72
71
|
//# sourceMappingURL=getElevation.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElevation.native.js","names":[],"sources":["jsx/getElevation.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar getElevation_exports = {};\n__export(getElevation_exports, {\n getElevation: () => getElevation,\n getSizedElevation: () => getSizedElevation\n});\nmodule.exports = __toCommonJS(getElevation_exports);\nvar import_core = require(\"@tamagui/core\");\nvar getElevation = function(size,
|
|
1
|
+
{"version":3,"file":"getElevation.native.js","names":[],"sources":["jsx/getElevation.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar getElevation_exports = {};\n__export(getElevation_exports, {\n getElevation: () => getElevation,\n getSizedElevation: () => getSizedElevation\n});\nmodule.exports = __toCommonJS(getElevation_exports);\nvar import_core = require(\"@tamagui/core\");\nvar getElevation = import_core.styled.dynamic(function(size, env) {\n if (!size) return;\n var { tokens } = env;\n var sizeToken = (0, import_core.resolveSizeToken)(size, \"size\");\n if (typeof sizeToken === \"number\") return getSizedElevation(sizeToken, env);\n var token = tokens.size[sizeToken];\n var sizeNum = (0, import_core.isVariable)(token) ? +token.val : size;\n return getSizedElevation(sizeNum, env);\n});\nvar getSizedElevation = import_core.styled.dynamic(function(val, param) {\n var { theme, tokens } = param;\n var num = 0;\n if (typeof val === \"number\") {\n num = val;\n } else if (val) {\n var sizeToken = (0, import_core.resolveSizeToken)(val, \"size\");\n var token = typeof sizeToken === \"number\" ? sizeToken : tokens.size[sizeToken];\n var tokenValue = (0, import_core.getVariableValue)(token);\n if (typeof tokenValue === \"number\") {\n num = tokenValue;\n } else {\n num = 10;\n }\n }\n if (num === 0) {\n return;\n }\n var [height, shadowRadius] = [\n Math.round(num / 4 + 1),\n Math.round(num / 2 + 2)\n ];\n var _theme_shadowcolor;\n var shadowColor = (_theme_shadowcolor = theme[\"shadow-color\"]) !== null && _theme_shadowcolor !== void 0 ? _theme_shadowcolor : theme.shadowColor;\n return {\n shadowColor,\n shadowRadius,\n shadowOffset: {\n height,\n width: 0\n },\n elevationAndroid: import_core.isAndroid ? 2 * height : void 0\n };\n});\n//# sourceMappingURL=getElevation.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,uBAAuB,CAAC;AAC5B,SAAS,sBAAsB;CAC7B,oBAAoB;CACpB,yBAAyB;AAC3B,CAAC;AACD,OAAO,UAAU,aAAa,oBAAoB;AAClD,IAAI,cAAc,QAAQ,eAAe;AACzC,IAAI,eAAe,YAAY,OAAO,QAAQ,SAAS,MAAM,KAAK;CAChE,IAAI,CAAC,MAAM;CACX,IAAI,EAAE,WAAW;CACjB,IAAI,aAAa,GAAG,YAAY,iBAAgB,CAAE,MAAM,MAAM;CAC9D,IAAI,OAAO,cAAc,UAAU,OAAO,kBAAkB,WAAW,GAAG;CAC1E,IAAI,QAAQ,OAAO,KAAK;CACxB,IAAI,WAAW,GAAG,YAAY,WAAU,CAAE,KAAK,IAAI,CAAC,MAAM,MAAM;CAChE,OAAO,kBAAkB,SAAS,GAAG;AACvC,CAAC;AACD,IAAI,oBAAoB,YAAY,OAAO,QAAQ,SAAS,KAAK,OAAO;CACtE,IAAI,EAAE,OAAO,WAAW;CACxB,IAAI,MAAM;CACV,IAAI,OAAO,QAAQ,UAAU;EAC3B,MAAM;CACR,OAAO,IAAI,KAAK;EACd,IAAI,aAAa,GAAG,YAAY,iBAAgB,CAAE,KAAK,MAAM;EAC7D,IAAI,QAAQ,OAAO,cAAc,WAAW,YAAY,OAAO,KAAK;EACpE,IAAI,cAAc,GAAG,YAAY,iBAAgB,CAAE,KAAK;EACxD,IAAI,OAAO,eAAe,UAAU;GAClC,MAAM;EACR,OAAO;GACL,MAAM;EACR;CACF;CACA,IAAI,QAAQ,GAAG;EACb;CACF;CACA,IAAI,CAAC,QAAQ,gBAAgB,CAC3B,KAAK,MAAM,MAAM,IAAI,CAAC,GACtB,KAAK,MAAM,MAAM,IAAI,CAAC,CACxB;CACA,IAAI;CACJ,IAAI,eAAe,qBAAqB,MAAM,qBAAqB,QAAQ,uBAAuB,KAAK,IAAI,qBAAqB,MAAM;CACtI,OAAO;EACL;EACA;EACA,cAAc;GACZ;GACA,OAAO;EACT;EACA,kBAAkB,YAAY,YAAY,IAAI,SAAS,KAAK;CAC9D;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/stacks",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.889.1",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"clean:build": "tamagui-build clean:build"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@tamagui/core": "3.0.0-beta.
|
|
39
|
-
"@tamagui/web": "3.0.0-beta.
|
|
38
|
+
"@tamagui/core": "3.0.0-beta.889.1",
|
|
39
|
+
"@tamagui/web": "3.0.0-beta.889.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@tamagui/build": "3.0.0-beta.
|
|
42
|
+
"@tamagui/build": "3.0.0-beta.889.1",
|
|
43
43
|
"react": "19.2.3"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
package/src/Stacks.tsx
CHANGED
package/src/getElevation.tsx
CHANGED
|
@@ -1,54 +1,49 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { SizeTokens } from '@tamagui/core'
|
|
2
|
+
import {
|
|
3
|
+
getVariableValue,
|
|
4
|
+
isAndroid,
|
|
5
|
+
isVariable,
|
|
6
|
+
resolveSizeToken,
|
|
7
|
+
styled,
|
|
6
8
|
} from '@tamagui/core'
|
|
7
|
-
import { getVariableValue, isAndroid, isVariable, resolveSizeToken } from '@tamagui/core'
|
|
8
9
|
|
|
9
|
-
export const getElevation
|
|
10
|
+
export const getElevation = styled.dynamic<SizeTokens | number | boolean>((size, env) => {
|
|
10
11
|
if (!size) return
|
|
11
|
-
const { tokens } =
|
|
12
|
+
const { tokens } = env
|
|
12
13
|
const sizeToken = resolveSizeToken(size, 'size')
|
|
13
14
|
// elevation={10} means 10px, not size token '10'. the size scale is keyed by
|
|
14
15
|
// numeric-looking strings, so only a non-numeric token may be looked up.
|
|
15
|
-
if (typeof sizeToken === 'number') return getSizedElevation(sizeToken,
|
|
16
|
+
if (typeof sizeToken === 'number') return getSizedElevation(sizeToken, env)
|
|
16
17
|
const token = tokens.size[sizeToken]
|
|
17
18
|
const sizeNum = (isVariable(token) ? +token.val : size) as number
|
|
18
|
-
return getSizedElevation(sizeNum,
|
|
19
|
-
}
|
|
19
|
+
return getSizedElevation(sizeNum, env)
|
|
20
|
+
})
|
|
20
21
|
|
|
21
|
-
export const getSizedElevation = (
|
|
22
|
-
val
|
|
23
|
-
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
export const getSizedElevation = styled.dynamic<SizeTokens | number | boolean>(
|
|
23
|
+
(val, { theme, tokens }) => {
|
|
24
|
+
let num = 0
|
|
25
|
+
if (typeof val === 'number') {
|
|
26
|
+
num = val
|
|
27
|
+
} else if (val) {
|
|
28
|
+
const sizeToken = resolveSizeToken(val, 'size')
|
|
29
|
+
const token = typeof sizeToken === 'number' ? sizeToken : tokens.size[sizeToken]
|
|
30
|
+
const tokenValue = getVariableValue(token)
|
|
31
|
+
if (typeof tokenValue === 'number') {
|
|
32
|
+
num = tokenValue
|
|
33
|
+
} else {
|
|
34
|
+
num = 10
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (num === 0) {
|
|
38
|
+
return
|
|
39
|
+
}
|
|
40
|
+
const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)]
|
|
41
|
+
const shadowColor = (theme as any)['shadow-color'] ?? (theme as any).shadowColor
|
|
42
|
+
return {
|
|
43
|
+
shadowColor,
|
|
44
|
+
shadowRadius,
|
|
45
|
+
shadowOffset: { height, width: 0 },
|
|
46
|
+
elevationAndroid: isAndroid ? 2 * height : undefined,
|
|
36
47
|
}
|
|
37
48
|
}
|
|
38
|
-
|
|
39
|
-
return
|
|
40
|
-
}
|
|
41
|
-
const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)]
|
|
42
|
-
const shadowColor = theme['shadow-color'] ?? theme.shadowColor
|
|
43
|
-
const shadow = {
|
|
44
|
-
shadowColor,
|
|
45
|
-
shadowRadius,
|
|
46
|
-
shadowOffset: { height, width: 0 },
|
|
47
|
-
...(isAndroid
|
|
48
|
-
? {
|
|
49
|
-
elevationAndroid: 2 * height,
|
|
50
|
-
}
|
|
51
|
-
: {}),
|
|
52
|
-
}
|
|
53
|
-
return shadow
|
|
54
|
-
}
|
|
49
|
+
)
|
package/types/Stacks.d.ts
CHANGED
|
@@ -10,14 +10,14 @@ export type ZStackProps = YStackProps;
|
|
|
10
10
|
* @see — Docs https://tamagui.dev/ui/stacks#xstack-ystack-zstack
|
|
11
11
|
*/
|
|
12
12
|
export declare const YStack: import("react").FunctionComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
|
|
13
|
-
elevation?: number | import("@tamagui/core").Size | undefined;
|
|
13
|
+
elevation?: number | false | import("@tamagui/core").Size | undefined;
|
|
14
14
|
}> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & {
|
|
15
15
|
ref?: import("react").Ref<import("@tamagui/core").TamaguiElement> | undefined;
|
|
16
16
|
}> & import("@tamagui/core").StaticComponentObject<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
|
|
17
|
-
elevation?: number | import("@tamagui/core").Size | undefined;
|
|
17
|
+
elevation?: number | false | import("@tamagui/core").Size | undefined;
|
|
18
18
|
}, import("@tamagui/core").StaticConfigPublic> & Omit<import("@tamagui/core").StaticConfigPublic, "staticConfig"> & {
|
|
19
19
|
__tama: [import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
|
|
20
|
-
elevation?: number | import("@tamagui/core").Size | undefined;
|
|
20
|
+
elevation?: number | false | import("@tamagui/core").Size | undefined;
|
|
21
21
|
}, import("@tamagui/core").StaticConfigPublic];
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
@@ -25,14 +25,14 @@ export declare const YStack: import("react").FunctionComponent<Omit<import("@tam
|
|
|
25
25
|
* @see — Docs https://tamagui.dev/ui/stacks#xstack-ystack-zstack
|
|
26
26
|
*/
|
|
27
27
|
export declare const XStack: import("react").FunctionComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
|
|
28
|
-
elevation?: number | import("@tamagui/core").Size | undefined;
|
|
28
|
+
elevation?: number | false | import("@tamagui/core").Size | undefined;
|
|
29
29
|
}> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & {
|
|
30
30
|
ref?: import("react").Ref<import("@tamagui/core").TamaguiElement> | undefined;
|
|
31
31
|
}> & import("@tamagui/core").StaticComponentObject<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
|
|
32
|
-
elevation?: number | import("@tamagui/core").Size | undefined;
|
|
32
|
+
elevation?: number | false | import("@tamagui/core").Size | undefined;
|
|
33
33
|
}, import("@tamagui/core").StaticConfigPublic> & Omit<import("@tamagui/core").StaticConfigPublic, "staticConfig"> & {
|
|
34
34
|
__tama: [import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
|
|
35
|
-
elevation?: number | import("@tamagui/core").Size | undefined;
|
|
35
|
+
elevation?: number | false | import("@tamagui/core").Size | undefined;
|
|
36
36
|
}, import("@tamagui/core").StaticConfigPublic];
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
@@ -40,11 +40,11 @@ export declare const XStack: import("react").FunctionComponent<Omit<import("@tam
|
|
|
40
40
|
* @see — Docs https://tamagui.dev/ui/stacks#xstack-ystack-zstack
|
|
41
41
|
*/
|
|
42
42
|
export declare const ZStack: import("react").FunctionComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
|
|
43
|
-
elevation?: number | import("@tamagui/core").Size | undefined;
|
|
43
|
+
elevation?: number | false | import("@tamagui/core").Size | undefined;
|
|
44
44
|
}> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & {
|
|
45
45
|
ref?: import("react").Ref<import("@tamagui/core").TamaguiElement> | undefined;
|
|
46
46
|
}> & import("@tamagui/core").StaticComponentObject<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
|
|
47
|
-
elevation?: number | import("@tamagui/core").Size | undefined;
|
|
47
|
+
elevation?: number | false | import("@tamagui/core").Size | undefined;
|
|
48
48
|
}, import("@tamagui/core").StaticConfigPublic & {
|
|
49
49
|
neverFlatten: true;
|
|
50
50
|
isZStack: true;
|
|
@@ -53,7 +53,7 @@ export declare const ZStack: import("react").FunctionComponent<Omit<import("@tam
|
|
|
53
53
|
isZStack: true;
|
|
54
54
|
}, "staticConfig"> & {
|
|
55
55
|
__tama: [import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
|
|
56
|
-
elevation?: number | import("@tamagui/core").Size | undefined;
|
|
56
|
+
elevation?: number | false | import("@tamagui/core").Size | undefined;
|
|
57
57
|
}, import("@tamagui/core").StaticConfigPublic & {
|
|
58
58
|
neverFlatten: true;
|
|
59
59
|
isZStack: true;
|
package/types/Stacks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stacks.d.ts","sourceRoot":"","sources":["../src/Stacks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAKzD,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;CAChC;AAED,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,MAAM,CAAC,EAAE,MAAM,aAAa,CAAC,GAC1E,aAAa,CAAA;AAEf,MAAM,MAAM,WAAW,GAAG,WAAW,CAAA;AACrC,MAAM,MAAM,WAAW,GAAG,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"Stacks.d.ts","sourceRoot":"","sources":["../src/Stacks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAKzD,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;CAChC;AAED,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,MAAM,CAAC,EAAE,MAAM,aAAa,CAAC,GAC1E,aAAa,CAAA;AAEf,MAAM,MAAM,WAAW,GAAG,WAAW,CAAA;AACrC,MAAM,MAAM,WAAW,GAAG,WAAW,CAAA;AAMrC;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;CAGjB,CAAA;AAIF;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;CAGjB,CAAA;AAIF;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;CASlB,CAAA"}
|
package/types/getElevation.d.ts
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const getSizedElevation: (val: SizeTokens | number | boolean, { theme, tokens }: VariantSpreadExtras<any>) => {
|
|
4
|
-
shadowColor: import("@tamagui/core").Variable<any> | import("@tamagui/core").Variable<string> | import("@tamagui/core").Variable<number> | import("@tamagui/core").Variable<import("@tamagui/core").PxValue> | import("@tamagui/core").Variable<import("@tamagui/core").VariableValGeneric>;
|
|
5
|
-
shadowRadius: number;
|
|
6
|
-
shadowOffset: {
|
|
7
|
-
height: number;
|
|
8
|
-
width: number;
|
|
9
|
-
};
|
|
10
|
-
elevationAndroid?: number | undefined;
|
|
11
|
-
} | undefined;
|
|
1
|
+
export declare const getElevation: import("@tamagui/web/types/types").StyledDynamicFn<number | false | import("@tamagui/core").Size, Record<string, any>>;
|
|
2
|
+
export declare const getSizedElevation: import("@tamagui/web/types/types").StyledDynamicFn<number | false | import("@tamagui/core").Size, Record<string, any>>;
|
|
12
3
|
//# sourceMappingURL=getElevation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElevation.d.ts","sourceRoot":"","sources":["../src/getElevation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getElevation.d.ts","sourceRoot":"","sources":["../src/getElevation.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,YAAY,wHAUvB,CAAA;AAEF,eAAO,MAAM,iBAAiB,wHA2B7B,CAAA"}
|