@tamagui/stacks 2.7.7 → 3.0.0-beta.1093.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.
Files changed (108) hide show
  1. package/dist/cjs/NestingContext.cjs +17 -26
  2. package/dist/cjs/NestingContext.native.cjs +33 -0
  3. package/dist/cjs/NestingContext.native.js +18 -26
  4. package/dist/cjs/NestingContext.native.js.map +1 -1
  5. package/dist/cjs/Stacks.cjs +24 -41
  6. package/dist/cjs/Stacks.native.cjs +47 -0
  7. package/dist/cjs/Stacks.native.js +24 -40
  8. package/dist/cjs/Stacks.native.js.map +1 -1
  9. package/dist/cjs/getElevation.cjs +42 -57
  10. package/dist/cjs/getElevation.native.cjs +58 -0
  11. package/dist/cjs/getElevation.native.js +44 -58
  12. package/dist/cjs/getElevation.native.js.map +1 -1
  13. package/dist/cjs/index.cjs +9 -13
  14. package/dist/cjs/index.native.cjs +22 -0
  15. package/dist/cjs/index.native.js +9 -12
  16. package/dist/cjs/index.native.js.map +1 -1
  17. package/dist/esm/NestingContext.mjs +2 -0
  18. package/dist/esm/NestingContext.mjs.map +1 -1
  19. package/dist/esm/NestingContext.native.js +3 -1
  20. package/dist/esm/NestingContext.native.js.map +1 -1
  21. package/dist/esm/Stacks.mjs +11 -23
  22. package/dist/esm/Stacks.mjs.map +1 -1
  23. package/dist/esm/Stacks.native.js +11 -23
  24. package/dist/esm/Stacks.native.js.map +1 -1
  25. package/dist/esm/getElevation.mjs +31 -42
  26. package/dist/esm/getElevation.mjs.map +1 -1
  27. package/dist/esm/getElevation.native.js +32 -43
  28. package/dist/esm/getElevation.native.js.map +1 -1
  29. package/dist/esm/index.js +5 -6
  30. package/dist/esm/index.mjs +5 -6
  31. package/dist/esm/index.native.js +5 -6
  32. package/dist/jsx/NestingContext.mjs +2 -0
  33. package/dist/jsx/NestingContext.mjs.map +1 -1
  34. package/dist/jsx/NestingContext.native.cjs +33 -0
  35. package/dist/jsx/NestingContext.native.js +18 -26
  36. package/dist/jsx/NestingContext.native.js.map +1 -1
  37. package/dist/jsx/Stacks.mjs +11 -23
  38. package/dist/jsx/Stacks.mjs.map +1 -1
  39. package/dist/jsx/Stacks.native.cjs +47 -0
  40. package/dist/jsx/Stacks.native.js +24 -40
  41. package/dist/jsx/Stacks.native.js.map +1 -1
  42. package/dist/jsx/getElevation.mjs +31 -42
  43. package/dist/jsx/getElevation.mjs.map +1 -1
  44. package/dist/jsx/getElevation.native.cjs +58 -0
  45. package/dist/jsx/getElevation.native.js +44 -58
  46. package/dist/jsx/getElevation.native.js.map +1 -1
  47. package/dist/jsx/index.js +5 -6
  48. package/dist/jsx/index.mjs +5 -6
  49. package/dist/jsx/index.native.cjs +22 -0
  50. package/dist/jsx/index.native.js +9 -12
  51. package/dist/jsx/index.native.js.map +1 -1
  52. package/package.json +6 -6
  53. package/src/Stacks.tsx +1 -18
  54. package/src/getElevation.tsx +26 -40
  55. package/src/index.ts +0 -2
  56. package/types/Stacks.d.ts +39 -20
  57. package/types/Stacks.d.ts.map +1 -1
  58. package/types/getElevation.d.ts +2 -11
  59. package/types/getElevation.d.ts.map +1 -1
  60. package/types/index.d.ts +0 -2
  61. package/types/index.d.ts.map +1 -1
  62. package/dist/cjs/SizableStack.cjs +0 -52
  63. package/dist/cjs/SizableStack.native.js +0 -55
  64. package/dist/cjs/SizableStack.native.js.map +0 -1
  65. package/dist/cjs/ThemeableStack.cjs +0 -63
  66. package/dist/cjs/ThemeableStack.native.js +0 -66
  67. package/dist/cjs/ThemeableStack.native.js.map +0 -1
  68. package/dist/cjs/variants.cjs +0 -68
  69. package/dist/cjs/variants.native.js +0 -73
  70. package/dist/cjs/variants.native.js.map +0 -1
  71. package/dist/esm/SizableStack.mjs +0 -27
  72. package/dist/esm/SizableStack.mjs.map +0 -1
  73. package/dist/esm/SizableStack.native.js +0 -27
  74. package/dist/esm/SizableStack.native.js.map +0 -1
  75. package/dist/esm/ThemeableStack.mjs +0 -37
  76. package/dist/esm/ThemeableStack.mjs.map +0 -1
  77. package/dist/esm/ThemeableStack.native.js +0 -37
  78. package/dist/esm/ThemeableStack.native.js.map +0 -1
  79. package/dist/esm/index.js.map +0 -1
  80. package/dist/esm/index.mjs.map +0 -1
  81. package/dist/esm/index.native.js.map +0 -1
  82. package/dist/esm/variants.mjs +0 -41
  83. package/dist/esm/variants.mjs.map +0 -1
  84. package/dist/esm/variants.native.js +0 -43
  85. package/dist/esm/variants.native.js.map +0 -1
  86. package/dist/jsx/SizableStack.mjs +0 -27
  87. package/dist/jsx/SizableStack.mjs.map +0 -1
  88. package/dist/jsx/SizableStack.native.js +0 -55
  89. package/dist/jsx/SizableStack.native.js.map +0 -1
  90. package/dist/jsx/ThemeableStack.mjs +0 -37
  91. package/dist/jsx/ThemeableStack.mjs.map +0 -1
  92. package/dist/jsx/ThemeableStack.native.js +0 -66
  93. package/dist/jsx/ThemeableStack.native.js.map +0 -1
  94. package/dist/jsx/index.js.map +0 -1
  95. package/dist/jsx/index.mjs.map +0 -1
  96. package/dist/jsx/variants.mjs +0 -41
  97. package/dist/jsx/variants.mjs.map +0 -1
  98. package/dist/jsx/variants.native.js +0 -73
  99. package/dist/jsx/variants.native.js.map +0 -1
  100. package/src/SizableStack.tsx +0 -33
  101. package/src/ThemeableStack.tsx +0 -47
  102. package/src/variants.tsx +0 -38
  103. package/types/SizableStack.d.ts +0 -14
  104. package/types/SizableStack.d.ts.map +0 -1
  105. package/types/ThemeableStack.d.ts +0 -87
  106. package/types/ThemeableStack.d.ts.map +0 -1
  107. package/types/variants.d.ts +0 -28
  108. package/types/variants.d.ts.map +0 -1
@@ -5,70 +5,56 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
12
  };
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
21
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
23
  var getElevation_exports = {};
26
24
  __export(getElevation_exports, {
27
- getElevation: () => getElevation,
28
- getSizedElevation: () => getSizedElevation
25
+ getElevation: () => getElevation,
26
+ getSizedElevation: () => getSizedElevation
29
27
  });
30
28
  module.exports = __toCommonJS(getElevation_exports);
31
29
  var import_core = require("@tamagui/core");
32
- var getElevation = function (size, extras) {
33
- if (!size) return;
34
- var {
35
- tokens
36
- } = extras;
37
- var token = tokens.size[size];
38
- var sizeNum = (0, import_core.isVariable)(token) ? +token.val : size;
39
- return getSizedElevation(sizeNum, extras);
40
- };
41
- var getSizedElevation = function (val, param) {
42
- var {
43
- theme,
44
- tokens
45
- } = param;
46
- var num = 0;
47
- if (val === true) {
48
- var _$val = (0, import_core.getVariableValue)(tokens.size["true"]);
49
- if (typeof _$val === "number") {
50
- num = _$val;
51
- } else {
52
- num = 10;
53
- }
54
- } else {
55
- num = +val;
56
- }
57
- if (num === 0) {
58
- return;
59
- }
60
- var [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
61
- var shadow = {
62
- shadowColor: theme.shadowColor,
63
- shadowRadius,
64
- shadowOffset: {
65
- height,
66
- width: 0
67
- },
68
- ...(import_core.isAndroid ? {
69
- elevationAndroid: 2 * height
70
- } : {})
71
- };
72
- return shadow;
73
- };
30
+ var getElevation = import_core.styled.dynamic(function(size, env) {
31
+ if (!size) return;
32
+ if (typeof size === "number") return getSizedElevation(size, env);
33
+ return getSizedElevation((0, import_core.resolveSize)(size, env).controlHeight, env);
34
+ });
35
+ var getSizedElevation = import_core.styled.dynamic(function(val, env) {
36
+ var { theme } = env;
37
+ var num = 0;
38
+ if (typeof val === "number") {
39
+ num = val;
40
+ } else if (val) {
41
+ num = (0, import_core.resolveSize)(val, env).controlHeight || 10;
42
+ }
43
+ if (num === 0) {
44
+ return;
45
+ }
46
+ var [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
47
+ var _theme_shadowcolor;
48
+ var shadowColor = (_theme_shadowcolor = theme["shadow-color"]) !== null && _theme_shadowcolor !== void 0 ? _theme_shadowcolor : theme.shadowColor;
49
+ return {
50
+ shadowColor,
51
+ shadowRadius,
52
+ shadowOffset: {
53
+ height,
54
+ width: 0
55
+ },
56
+ elevationAndroid: import_core.isAndroid ? 2 * height : void 0
57
+ };
58
+ });
59
+
74
60
  //# sourceMappingURL=getElevation.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","getElevation_exports","__export","getElevation","getSizedElevation","module","exports","import_core","require","size","extras","tokens","token","sizeNum","isVariable","val","param","theme","num","_$val","getVariableValue","height","shadowRadius","Math","round","shadow","shadowColor","shadowOffset"],"sources":["../../src/getElevation.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,oBAAA;AAAAC,QAAA,CAAAD,oBAAA;EAAAE,YAAA,EAAAA,CAAA,KAAAA,YAAA;EAAAC,iBAAA,EAAAA,CAAA,KAAAA;AAAA;AAMAC,MAAA,CAAAC,OAAA,GAAAV,YAAwD,CAAAK,oBAAA;AAEjD,IAAAM,WAAM,GAAAC,OAAsD,gBAAiB;AAClF,IAAAL,YAAW,YAAAA,CAAAM,IAAA,EAAAC,MAAA;EACX,KAAAD,IAAQ;EACR;IAAME;EAAA,CAAQ,GAAAD,MAAO;EACrB,IAAAE,KAAM,GAAAD,MAAA,CAAAF,IAAW,CAAAA,IAAA;EACjB,IAAAI,OAAO,OAAAN,WAAkB,CAAAO,UAAe,EAAAF,KAAA,KAAAA,KAAA,CAAAG,GAAA,GAAAN,IAAA;EAC1C,OAAAL,iBAAA,CAAAS,OAAA,EAAAH,MAAA;AAEO;AAIL,IAAAN,iBAAU,YAAAA,CAAAW,GAAA,EAAAC,KAAA;EACV,IAAI;IAAAC,KAAA;IAAQN;EAAM,IAAAK,KAAA;EAChB,IAAAE,GAAA,GAAM;EACN,IAAAH,GAAI,SAAO;IACT,IAAAI,KAAM,OAAAZ,WAAA,CAAAa,gBAAA,EAAAT,MAAA,CAAAF,IAAA;IACR,WAAOU,KAAA;MACLD,GAAA,GAAMC,KAAA;IACR;MACFD,GAAO;IACL;EACF;IACAA,GAAI,IAAAH,GAAQ;EACV;EACF,IAAAG,GAAA;IACA;EACA;EAAe,IACb,CAAAG,MAAA,EAAAC,YAAmB,KACnBC,IAAA,CAAAC,KAAA,CAAAN,GAAA,WACAK,IAAA,CAAAC,KAAA,CAAAN,GAAc,GAAE,OAAiB;EAE7B,IACEO,MAAA;IACFC,WACC,EAAAT,KAAA,CAAAS,WAAA;IACPJ,YAAA;IACAK,YAAO;MACTN,MAAA","ignoreList":[]}
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 if (typeof size === \"number\") return getSizedElevation(size, env);\n return getSizedElevation((0, import_core.resolveSize)(size, env).controlHeight, env);\n});\nvar getSizedElevation = import_core.styled.dynamic(function(val, env) {\n var { theme } = env;\n var num = 0;\n if (typeof val === \"number\") {\n num = val;\n } else if (val) {\n num = (0, import_core.resolveSize)(val, env).controlHeight || 10;\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,OAAO,SAAS,UAAU,OAAO,kBAAkB,MAAM,GAAG;CAChE,OAAO,mBAAmB,GAAG,YAAY,YAAW,CAAE,MAAM,GAAG,CAAC,CAAC,eAAe,GAAG;AACrF,CAAC;AACD,IAAI,oBAAoB,YAAY,OAAO,QAAQ,SAAS,KAAK,KAAK;CACpE,IAAI,EAAE,UAAU;CAChB,IAAI,MAAM;CACV,IAAI,OAAO,QAAQ,UAAU;EAC3B,MAAM;CACR,OAAO,IAAI,KAAK;EACd,OAAO,GAAG,YAAY,YAAW,CAAE,KAAK,GAAG,CAAC,CAAC,iBAAiB;CAChE;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"}
@@ -3,22 +3,18 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
- get: () => from[key],
9
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
- });
11
- }
12
- return to;
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
+ get: () => from[key],
9
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
+ });
11
+ }
12
+ return to;
13
13
  };
14
14
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: true
17
- }), mod);
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
16
  var index_exports = {};
19
17
  module.exports = __toCommonJS(index_exports);
20
18
  __reExport(index_exports, require("./Stacks.cjs"), module.exports);
21
- __reExport(index_exports, require("./ThemeableStack.cjs"), module.exports);
22
- __reExport(index_exports, require("./SizableStack.cjs"), module.exports);
23
19
  __reExport(index_exports, require("./NestingContext.cjs"), module.exports);
24
- __reExport(index_exports, require("./getElevation.cjs"), module.exports);
20
+ __reExport(index_exports, require("./getElevation.cjs"), module.exports);
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
+ get: () => from[key],
11
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
+ });
13
+ }
14
+ return to;
15
+ };
16
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var index_exports = {};
19
+ module.exports = __toCommonJS(index_exports);
20
+ __reExport(index_exports, require("./Stacks.native.js"), module.exports);
21
+ __reExport(index_exports, require("./NestingContext.native.js"), module.exports);
22
+ __reExport(index_exports, require("./getElevation.native.js"), module.exports);
@@ -5,23 +5,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
- get: () => from[key],
11
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
- });
13
- }
14
- return to;
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
+ get: () => from[key],
11
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
+ });
13
+ }
14
+ return to;
15
15
  };
16
16
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
18
- value: true
19
- }), mod);
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
18
  var index_exports = {};
21
19
  module.exports = __toCommonJS(index_exports);
22
20
  __reExport(index_exports, require("./Stacks.native.js"), module.exports);
23
- __reExport(index_exports, require("./ThemeableStack.native.js"), module.exports);
24
- __reExport(index_exports, require("./SizableStack.native.js"), module.exports);
25
21
  __reExport(index_exports, require("./NestingContext.native.js"), module.exports);
26
22
  __reExport(index_exports, require("./getElevation.native.js"), module.exports);
23
+
27
24
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA;AACdG,UAAA,CAAAH,aAAA,EAAcI,OAAA,wBAAAH,MAAA,CAAAC,OADd;AAEAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,8BAFd,EAAAH,MAAA,CAAAC,OAAA;AAGAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,8BAAAH,MAHd,CAAAC,OAAA;AAIAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,8BAJd,EAAAH,MAAA,CAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./Stacks\"), module.exports);\n__reExport(index_exports, require(\"./NestingContext\"), module.exports);\n__reExport(index_exports, require(\"./getElevation\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,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,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,oBAAU,GAAG,OAAO,OAAO;AAC7D,WAAW,eAAe,QAAQ,4BAAkB,GAAG,OAAO,OAAO;AACrE,WAAW,eAAe,QAAQ,0BAAgB,GAAG,OAAO,OAAO"}
@@ -1,4 +1,6 @@
1
1
  import React from "react";
2
+
2
3
  const ButtonNestingContext = React.createContext(false);
4
+
3
5
  export { ButtonNestingContext };
4
6
  //# sourceMappingURL=NestingContext.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","ButtonNestingContext","createContext"],"sources":["../../src/NestingContext.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAEX,MAAMC,oBAAA,GAAuBD,KAAA,CAAME,aAAA,CAAc,KAAK","ignoreList":[]}
1
+ {"version":3,"file":"NestingContext.js","names":[],"sources":["esm/NestingContext.js"],"sourcesContent":["import React from \"react\";\nconst ButtonNestingContext = React.createContext(false);\nexport {\n ButtonNestingContext\n};\n//# sourceMappingURL=NestingContext.js.map\n"],"mappings":";;;AACA,MAAM,uBAAuB,MAAM,cAAc,KAAK"}
@@ -1,4 +1,6 @@
1
1
  import React from "react";
2
- var ButtonNestingContext = /* @__PURE__ */React.createContext(false);
2
+
3
+ var ButtonNestingContext = /* @__PURE__ */ React.createContext(false);
4
+
3
5
  export { ButtonNestingContext };
4
6
  //# sourceMappingURL=NestingContext.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","ButtonNestingContext","createContext"],"sources":["../../src/NestingContext.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAEX,IAAAC,oBAAM,kBAA6BD,KAAA,CAAcE,aAAK","ignoreList":[]}
1
+ {"version":3,"file":"NestingContext.native.js","names":[],"sources":["esm/NestingContext.native.js"],"sourcesContent":["import React from \"react\";\nvar ButtonNestingContext = /* @__PURE__ */ React.createContext(false);\nexport {\n ButtonNestingContext\n};\n//# sourceMappingURL=NestingContext.js.map\n"],"mappings":";;;AACA,IAAI,uBAAuC,sBAAM,cAAc,KAAK"}
@@ -1,34 +1,22 @@
1
1
  import { View, styled } from "@tamagui/core";
2
2
  import { getElevation } from "./getElevation.mjs";
3
- const fullscreenStyle = {
4
- position: "absolute",
5
- inset: 0
6
- };
7
- const variants = {
8
- fullscreen: {
9
- true: fullscreenStyle
10
- },
11
- elevation: {
12
- "...size": getElevation,
13
- ":number": getElevation
14
- }
15
- };
3
+
4
+ const variants = { elevation: getElevation };
16
5
  const YStack = styled(View, {
17
- flexDirection: "column",
18
- variants
6
+ flexDirection: "column",
7
+ variants
19
8
  });
20
9
  YStack["displayName"] = "YStack";
21
10
  const XStack = styled(View, {
22
- flexDirection: "row",
23
- variants
11
+ flexDirection: "row",
12
+ variants
24
13
  });
25
14
  XStack["displayName"] = "XStack";
26
- const ZStack = styled(YStack, {
27
- position: "relative"
28
- }, {
29
- neverFlatten: true,
30
- isZStack: true
15
+ const ZStack = styled(YStack, { position: "relative" }, {
16
+ neverFlatten: true,
17
+ isZStack: true
31
18
  });
32
19
  ZStack["displayName"] = "ZStack";
33
- export { XStack, YStack, ZStack, fullscreenStyle };
20
+
21
+ export { XStack, YStack, ZStack };
34
22
  //# sourceMappingURL=Stacks.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["View","styled","getElevation","fullscreenStyle","position","inset","variants","fullscreen","true","elevation","YStack","flexDirection","XStack","ZStack","neverFlatten","isZStack"],"sources":["../../src/Stacks.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,IAAA,EAAMC,MAAA,QAAc;AAE7B,SAASC,YAAA,QAAoB;AAiBtB,MAAMC,eAAA,GAAkB;EAC7BC,QAAA,EAAU;EACVC,KAAA,EAAO;AACT;AAEA,MAAMC,QAAA,GAAW;EACfC,UAAA,EAAY;IACVC,IAAA,EAAML;EACR;EAEAM,SAAA,EAAW;IACT,WAAWP,YAAA;IACX,WAAWA;EACb;AACF;AAMO,MAAMQ,MAAA,GAAST,MAAA,CAAOD,IAAA,EAAM;EACjCW,aAAA,EAAe;EACfL;AACF,CAAC;AAEDI,MAAA,CAAO,aAAa,IAAI;AAMjB,MAAME,MAAA,GAASX,MAAA,CAAOD,IAAA,EAAM;EACjCW,aAAA,EAAe;EACfL;AACF,CAAC;AAEDM,MAAA,CAAO,aAAa,IAAI;AAMjB,MAAMC,MAAA,GAASZ,MAAA,CACpBS,MAAA,EACA;EACEN,QAAA,EAAU;AACZ,GACA;EACEU,YAAA,EAAc;EACdC,QAAA,EAAU;AACZ,CACF;AAEAF,MAAA,CAAO,aAAa,IAAI","ignoreList":[]}
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,34 +1,22 @@
1
1
  import { View, styled } from "@tamagui/core";
2
2
  import { getElevation } from "./getElevation.native.js";
3
- var fullscreenStyle = {
4
- position: "absolute",
5
- inset: 0
6
- };
7
- var variants = {
8
- fullscreen: {
9
- true: fullscreenStyle
10
- },
11
- elevation: {
12
- "...size": getElevation,
13
- ":number": getElevation
14
- }
15
- };
3
+
4
+ var variants = { elevation: getElevation };
16
5
  var YStack = styled(View, {
17
- flexDirection: "column",
18
- variants
6
+ flexDirection: "column",
7
+ variants
19
8
  });
20
9
  YStack["displayName"] = "YStack";
21
10
  var XStack = styled(View, {
22
- flexDirection: "row",
23
- variants
11
+ flexDirection: "row",
12
+ variants
24
13
  });
25
14
  XStack["displayName"] = "XStack";
26
- var ZStack = styled(YStack, {
27
- position: "relative"
28
- }, {
29
- neverFlatten: true,
30
- isZStack: true
15
+ var ZStack = styled(YStack, { position: "relative" }, {
16
+ neverFlatten: true,
17
+ isZStack: true
31
18
  });
32
19
  ZStack["displayName"] = "ZStack";
33
- export { XStack, YStack, ZStack, fullscreenStyle };
20
+
21
+ export { XStack, YStack, ZStack };
34
22
  //# sourceMappingURL=Stacks.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["View","styled","getElevation","fullscreenStyle","position","inset","variants","fullscreen","true","elevation","YStack","flexDirection","XStack","ZStack","neverFlatten","isZStack"],"sources":["../../src/Stacks.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,IAAA,EAAMC,MAAA,QAAc;AAE7B,SAASC,YAAA,QAAoB;AAiBtB,IAAAC,eAAM;EACXC,QAAA,EAAU;EACVC,KAAA,EAAO;AACT;AAEA,IAAAC,QAAM;EACJC,UAAA,EAAY;IACVC,IAAA,EAAML;EACR;EAEAM,SAAA,EAAW;IACT,WAAWP,YAAA;IACX,WAAWA;EACb;AACF;AAMO,IAAAQ,MAAM,GAAAT,MAAS,CAAAD,IAAO;EAC3BW,aAAA,EAAe;EACfL;AACF,CAAC;AAEDI,MAAA,CAAO,aAAa,IAAI;AAMjB,IAAAE,MAAM,GAAAX,MAAS,CAAAD,IAAO;EAC3BW,aAAA,EAAe;EACfL;AACF,CAAC;AAEDM,MAAA,CAAO,aAAa,IAAI;AAMjB,IAAAC,MAAM,GAAAZ,MAAS,CAAAS,MAAA;EACpBN,QAAA;AAAA,GACA;EAAAU,YACY;EACZC,QAAA;AAAA,EACA;AAAAF,MACE,cAAc;AAAA,SAEhBD,MAAA,EACFF,MAAA,EAEAG,MAAO,E","ignoreList":[]}
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,44 +1,33 @@
1
- import { getVariableValue, isAndroid, isVariable } from "@tamagui/core";
2
- const getElevation = (size, extras) => {
3
- if (!size) return;
4
- const {
5
- tokens
6
- } = extras;
7
- const token = tokens.size[size];
8
- const sizeNum = isVariable(token) ? +token.val : size;
9
- return getSizedElevation(sizeNum, extras);
10
- };
11
- const getSizedElevation = (val, {
12
- theme,
13
- tokens
14
- }) => {
15
- let num = 0;
16
- if (val === true) {
17
- const val2 = getVariableValue(tokens.size["true"]);
18
- if (typeof val2 === "number") {
19
- num = val2;
20
- } else {
21
- num = 10;
22
- }
23
- } else {
24
- num = +val;
25
- }
26
- if (num === 0) {
27
- return;
28
- }
29
- const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
30
- const shadow = {
31
- shadowColor: theme.shadowColor,
32
- shadowRadius,
33
- shadowOffset: {
34
- height,
35
- width: 0
36
- },
37
- ...(isAndroid ? {
38
- elevationAndroid: 2 * height
39
- } : {})
40
- };
41
- return shadow;
42
- };
1
+ import { isAndroid, resolveSize, styled } from "@tamagui/core";
2
+
3
+ const getElevation = styled.dynamic((size, env) => {
4
+ if (!size) return;
5
+ if (typeof size === "number") return getSizedElevation(size, env);
6
+ return getSizedElevation(resolveSize(size, env).controlHeight, env);
7
+ });
8
+ const getSizedElevation = styled.dynamic((val, env) => {
9
+ const { theme } = env;
10
+ let num = 0;
11
+ if (typeof val === "number") {
12
+ num = val;
13
+ } else if (val) {
14
+ num = resolveSize(val, env).controlHeight || 10;
15
+ }
16
+ if (num === 0) {
17
+ return;
18
+ }
19
+ const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
20
+ const shadowColor = theme["shadow-color"] ?? theme.shadowColor;
21
+ return {
22
+ shadowColor,
23
+ shadowRadius,
24
+ shadowOffset: {
25
+ height,
26
+ width: 0
27
+ },
28
+ elevationAndroid: isAndroid ? 2 * height : void 0
29
+ };
30
+ });
31
+
43
32
  export { getElevation, getSizedElevation };
44
33
  //# sourceMappingURL=getElevation.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["getVariableValue","isAndroid","isVariable","getElevation","size","extras","tokens","token","sizeNum","val","getSizedElevation","theme","num","height","shadowRadius","Math","round","shadow","shadowColor","shadowOffset","width","elevationAndroid"],"sources":["../../src/getElevation.tsx"],"sourcesContent":[null],"mappings":"AAMA,SAASA,gBAAA,EAAkBC,SAAA,EAAWC,UAAA,QAAkB;AAEjD,MAAMC,YAAA,GAAqDA,CAACC,IAAA,EAAMC,MAAA,KAAW;EAClF,IAAI,CAACD,IAAA,EAAM;EACX,MAAM;IAAEE;EAAO,IAAID,MAAA;EACnB,MAAME,KAAA,GAAQD,MAAA,CAAOF,IAAA,CAAKA,IAAI;EAC9B,MAAMI,OAAA,GAAWN,UAAA,CAAWK,KAAK,IAAI,CAACA,KAAA,CAAME,GAAA,GAAML,IAAA;EAClD,OAAOM,iBAAA,CAAkBF,OAAA,EAASH,MAAM;AAC1C;AAEO,MAAMK,iBAAA,GAAoBA,CAC/BD,GAAA,EACA;EAAEE,KAAA;EAAOL;AAAO,MACb;EACH,IAAIM,GAAA,GAAM;EACV,IAAIH,GAAA,KAAQ,MAAM;IAChB,MAAMA,IAAA,GAAMT,gBAAA,CAAiBM,MAAA,CAAOF,IAAA,CAAK,MAAM,CAAC;IAChD,IAAI,OAAOK,IAAA,KAAQ,UAAU;MAC3BG,GAAA,GAAMH,IAAA;IACR,OAAO;MACLG,GAAA,GAAM;IACR;EACF,OAAO;IACLA,GAAA,GAAM,CAACH,GAAA;EACT;EACA,IAAIG,GAAA,KAAQ,GAAG;IACb;EACF;EACA,MAAM,CAACC,MAAA,EAAQC,YAAY,IAAI,CAACC,IAAA,CAAKC,KAAA,CAAMJ,GAAA,GAAM,IAAI,CAAC,GAAGG,IAAA,CAAKC,KAAA,CAAMJ,GAAA,GAAM,IAAI,CAAC,CAAC;EAChF,MAAMK,MAAA,GAAS;IACbC,WAAA,EAAaP,KAAA,CAAMO,WAAA;IACnBJ,YAAA;IACAK,YAAA,EAAc;MAAEN,MAAA;MAAQO,KAAA,EAAO;IAAE;IACjC,IAAInB,SAAA,GACA;MACEoB,gBAAA,EAAkB,IAAIR;IACxB,IACA,CAAC;EACP;EACA,OAAOI,MAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"getElevation.js","names":[],"sources":["esm/getElevation.js"],"sourcesContent":["import { isAndroid, resolveSize, styled } from \"@tamagui/core\";\nconst getElevation = styled.dynamic((size, env) => {\n if (!size) return;\n if (typeof size === \"number\") return getSizedElevation(size, env);\n return getSizedElevation(resolveSize(size, env).controlHeight, env);\n});\nconst getSizedElevation = styled.dynamic(\n (val, env) => {\n const { theme } = env;\n let num = 0;\n if (typeof val === \"number\") {\n num = val;\n } else if (val) {\n num = resolveSize(val, env).controlHeight || 10;\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":";;;AACA,MAAM,eAAe,OAAO,SAAS,MAAM,QAAQ;CACjD,IAAI,CAAC,MAAM;CACX,IAAI,OAAO,SAAS,UAAU,OAAO,kBAAkB,MAAM,GAAG;CAChE,OAAO,kBAAkB,YAAY,MAAM,GAAG,CAAC,CAAC,eAAe,GAAG;AACpE,CAAC;AACD,MAAM,oBAAoB,OAAO,SAC9B,KAAK,QAAQ;CACZ,MAAM,EAAE,UAAU;CAClB,IAAI,MAAM;CACV,IAAI,OAAO,QAAQ,UAAU;EAC3B,MAAM;CACR,OAAO,IAAI,KAAK;EACd,MAAM,YAAY,KAAK,GAAG,CAAC,CAAC,iBAAiB;CAC/C;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,45 +1,34 @@
1
- import { getVariableValue, isAndroid, isVariable } from "@tamagui/core";
2
- var getElevation = function (size, extras) {
3
- if (!size) return;
4
- var {
5
- tokens
6
- } = extras;
7
- var token = tokens.size[size];
8
- var sizeNum = isVariable(token) ? +token.val : size;
9
- return getSizedElevation(sizeNum, extras);
10
- };
11
- var getSizedElevation = function (val, param) {
12
- var {
13
- theme,
14
- tokens
15
- } = param;
16
- var num = 0;
17
- if (val === true) {
18
- var _$val = getVariableValue(tokens.size["true"]);
19
- if (typeof _$val === "number") {
20
- num = _$val;
21
- } else {
22
- num = 10;
23
- }
24
- } else {
25
- num = +val;
26
- }
27
- if (num === 0) {
28
- return;
29
- }
30
- var [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
31
- var shadow = {
32
- shadowColor: theme.shadowColor,
33
- shadowRadius,
34
- shadowOffset: {
35
- height,
36
- width: 0
37
- },
38
- ...(isAndroid ? {
39
- elevationAndroid: 2 * height
40
- } : {})
41
- };
42
- return shadow;
43
- };
1
+ import { isAndroid, resolveSize, styled } from "@tamagui/core";
2
+
3
+ var getElevation = styled.dynamic(function(size, env) {
4
+ if (!size) return;
5
+ if (typeof size === "number") return getSizedElevation(size, env);
6
+ return getSizedElevation(resolveSize(size, env).controlHeight, env);
7
+ });
8
+ var getSizedElevation = styled.dynamic(function(val, env) {
9
+ var { theme } = env;
10
+ var num = 0;
11
+ if (typeof val === "number") {
12
+ num = val;
13
+ } else if (val) {
14
+ num = resolveSize(val, env).controlHeight || 10;
15
+ }
16
+ if (num === 0) {
17
+ return;
18
+ }
19
+ var [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
20
+ var _theme_shadowcolor;
21
+ var shadowColor = (_theme_shadowcolor = theme["shadow-color"]) !== null && _theme_shadowcolor !== void 0 ? _theme_shadowcolor : theme.shadowColor;
22
+ return {
23
+ shadowColor,
24
+ shadowRadius,
25
+ shadowOffset: {
26
+ height,
27
+ width: 0
28
+ },
29
+ elevationAndroid: isAndroid ? 2 * height : void 0
30
+ };
31
+ });
32
+
44
33
  export { getElevation, getSizedElevation };
45
34
  //# sourceMappingURL=getElevation.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getVariableValue","isAndroid","isVariable","getElevation","size","extras","tokens","token","sizeNum","val","getSizedElevation","param","theme","num","_$val","height","shadowRadius","Math","round","shadow","shadowColor","shadowOffset","width"],"sources":["../../src/getElevation.tsx"],"sourcesContent":[null],"mappings":"AAMA,SAASA,gBAAA,EAAkBC,SAAA,EAAWC,UAAA,QAAkB;AAEjD,IAAAC,YAAM,YAAAA,CAA4DC,IAAA,EAAAC,MAAW;EAClF,IAAI,CAACD,IAAA,EAAM;EACX;IAAME;EAAE,IAAOD,MAAI;EACnB,IAAAE,KAAM,GAAAD,MAAQ,CAAAF,IAAO,CAAAA,IAAK;EAC1B,IAAAI,OAAM,GAAAN,UAAW,CAAAK,KAAW,IAAK,CAAAA,KAAK,CAAAE,GAAM,GAAAL,IAAM;EAClD,OAAOM,iBAAA,CAAkBF,OAAA,EAASH,MAAM;AAC1C;AAEO,IAAAK,iBAAM,YAAAA,CAEXD,GAAE,EAAAE,KAAO;EAET,IAAI;IAAAC,KAAM;IAAAN;EAAA,IAAAK,KAAA;EACV,IAAIE,GAAA;EACF,IAAAJ,GAAA,KAAM,IAAM;IACZ,IAAIK,KAAA,GAAOd,gBAAQ,CAAAM,MAAU,CAAAF,IAAA;IAC3B,WAAMU,KAAA;MACRD,GAAA,GAAOC,KAAA;IACL;MACFD,GAAA;IACF;EACE;IACFA,GAAA,IAAAJ,GAAA;EACA;EACE,IAAAI,GAAA;IACF;EACA;EACA,KAAAE,MAAM,EAAAC,YAAS,KACbC,IAAA,CAAAC,KAAA,CAAAL,GAAa,OAAM,IACnBI,IAAA,CAAAC,KAAA,CAAAL,GAAA;EACiC,IACjCM,MAAI;IACAC,WACE,EAAAR,KAAA,CAAAQ,WAAsB;IACxBJ,YACC;IACPK,YAAA;MACAN,MAAO;MACTO,KAAA","ignoreList":[]}
1
+ {"version":3,"file":"getElevation.native.js","names":[],"sources":["esm/getElevation.native.js"],"sourcesContent":["import { isAndroid, resolveSize, styled } from \"@tamagui/core\";\nvar getElevation = styled.dynamic(function(size, env) {\n if (!size) return;\n if (typeof size === \"number\") return getSizedElevation(size, env);\n return getSizedElevation(resolveSize(size, env).controlHeight, env);\n});\nvar getSizedElevation = styled.dynamic(function(val, env) {\n var { theme } = env;\n var num = 0;\n if (typeof val === \"number\") {\n num = val;\n } else if (val) {\n num = resolveSize(val, env).controlHeight || 10;\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,OAAO,SAAS,UAAU,OAAO,kBAAkB,MAAM,GAAG;CAChE,OAAO,kBAAkB,YAAY,MAAM,GAAG,CAAC,CAAC,eAAe,GAAG;AACpE,CAAC;AACD,IAAI,oBAAoB,OAAO,QAAQ,SAAS,KAAK,KAAK;CACxD,IAAI,EAAE,UAAU;CAChB,IAAI,MAAM;CACV,IAAI,OAAO,QAAQ,UAAU;EAC3B,MAAM;CACR,OAAO,IAAI,KAAK;EACd,MAAM,YAAY,KAAK,GAAG,CAAC,CAAC,iBAAiB;CAC/C;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/esm/index.js CHANGED
@@ -1,6 +1,5 @@
1
- export * from "./Stacks.mjs";
2
- export * from "./ThemeableStack.mjs";
3
- export * from "./SizableStack.mjs";
4
- export * from "./NestingContext.mjs";
5
- export * from "./getElevation.mjs";
6
- //# sourceMappingURL=index.js.map
1
+ export * from "./Stacks.mjs"
2
+
3
+ export * from "./NestingContext.mjs"
4
+
5
+ export * from "./getElevation.mjs"
@@ -1,6 +1,5 @@
1
- export * from "./Stacks.mjs";
2
- export * from "./ThemeableStack.mjs";
3
- export * from "./SizableStack.mjs";
4
- export * from "./NestingContext.mjs";
5
- export * from "./getElevation.mjs";
6
- //# sourceMappingURL=index.mjs.map
1
+ export * from "./Stacks.mjs"
2
+
3
+ export * from "./NestingContext.mjs"
4
+
5
+ export * from "./getElevation.mjs"
@@ -1,6 +1,5 @@
1
- export * from "./Stacks.native.js";
2
- export * from "./ThemeableStack.native.js";
3
- export * from "./SizableStack.native.js";
4
- export * from "./NestingContext.native.js";
5
- export * from "./getElevation.native.js";
6
- //# sourceMappingURL=index.native.js.map
1
+ export * from "./Stacks.native.js"
2
+
3
+ export * from "./NestingContext.native.js"
4
+
5
+ export * from "./getElevation.native.js"
@@ -1,4 +1,6 @@
1
1
  import React from "react";
2
+
2
3
  const ButtonNestingContext = React.createContext(false);
4
+
3
5
  export { ButtonNestingContext };
4
6
  //# sourceMappingURL=NestingContext.mjs.map