@tamagui/stacks 2.7.7 → 3.0.0-beta.637.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 +18 -26
  2. package/dist/cjs/NestingContext.native.cjs +34 -0
  3. package/dist/cjs/NestingContext.native.js +19 -26
  4. package/dist/cjs/NestingContext.native.js.map +1 -1
  5. package/dist/cjs/Stacks.cjs +28 -41
  6. package/dist/cjs/Stacks.native.cjs +51 -0
  7. package/dist/cjs/Stacks.native.js +28 -40
  8. package/dist/cjs/Stacks.native.js.map +1 -1
  9. package/dist/cjs/getElevation.cjs +52 -55
  10. package/dist/cjs/getElevation.native.cjs +71 -0
  11. package/dist/cjs/getElevation.native.js +55 -56
  12. package/dist/cjs/getElevation.native.js.map +1 -1
  13. package/dist/cjs/index.cjs +10 -13
  14. package/dist/cjs/index.native.cjs +23 -0
  15. package/dist/cjs/index.native.js +10 -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 +14 -23
  22. package/dist/esm/Stacks.mjs.map +1 -1
  23. package/dist/esm/Stacks.native.js +14 -23
  24. package/dist/esm/Stacks.native.js.map +1 -1
  25. package/dist/esm/getElevation.mjs +39 -39
  26. package/dist/esm/getElevation.mjs.map +1 -1
  27. package/dist/esm/getElevation.native.js +42 -41
  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 +34 -0
  35. package/dist/jsx/NestingContext.native.js +19 -26
  36. package/dist/jsx/NestingContext.native.js.map +1 -1
  37. package/dist/jsx/Stacks.mjs +14 -23
  38. package/dist/jsx/Stacks.mjs.map +1 -1
  39. package/dist/jsx/Stacks.native.cjs +51 -0
  40. package/dist/jsx/Stacks.native.js +28 -40
  41. package/dist/jsx/Stacks.native.js.map +1 -1
  42. package/dist/jsx/getElevation.mjs +39 -39
  43. package/dist/jsx/getElevation.mjs.map +1 -1
  44. package/dist/jsx/getElevation.native.cjs +71 -0
  45. package/dist/jsx/getElevation.native.js +55 -56
  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 +23 -0
  50. package/dist/jsx/index.native.js +10 -12
  51. package/dist/jsx/index.native.js.map +1 -1
  52. package/package.json +4 -5
  53. package/src/Stacks.tsx +2 -16
  54. package/src/getElevation.tsx +16 -9
  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 -2
  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
@@ -1 +0,0 @@
1
- {"version":3,"names":["styled","YStack","bordered","circular","elevate","chromelessStyle","backgroundColor","borderColor","shadowColor","hoverStyle","themeableVariants","true","transparent","chromeless","all","pressStyle","focusStyle","ThemeableStack","variants"],"sources":["../../src/ThemeableStack.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,MAAA,QAAc;AAEvB,SAASC,MAAA,QAAc;AAEvB,SAASC,QAAA,EAAUC,QAAA,EAAUC,OAAA,QAAe;AAE5C,MAAMC,eAAA,GAAkB;EACtBC,eAAA,EAAiB;EACjBC,WAAA,EAAa;EACbC,WAAA,EAAa;EAEbC,UAAA,EAAY;IACVF,WAAA,EAAa;EACf;AACF;AAEO,MAAMG,iBAAA,GAAoB;EAC/BP,QAAA;EACAC,OAAA;EAEAF,QAAA,EAAU;IACRS,IAAA,EAAMT;EACR;EAEAU,WAAA,EAAa;IACXD,IAAA,EAAM;MACJL,eAAA,EAAiB;IACnB;EACF;EAEAO,UAAA,EAAY;IACVF,IAAA,EAAMN,eAAA;IACNS,GAAA,EAAK;MACH,GAAGT,eAAA;MACHI,UAAA,EAAYJ,eAAA;MACZU,UAAA,EAAYV,eAAA;MACZW,UAAA,EAAYX;IACd;EACF;AACF;AAEO,MAAMY,cAAA,GAAiBjB,MAAA,CAAOC,MAAA,EAAQ;EAC3CiB,QAAA,EAAUR;AACZ,CAAC","ignoreList":[]}
@@ -1,66 +0,0 @@
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 __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
12
- };
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;
21
- };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
25
- var ThemeableStack_exports = {};
26
- __export(ThemeableStack_exports, {
27
- ThemeableStack: () => ThemeableStack,
28
- themeableVariants: () => themeableVariants
29
- });
30
- module.exports = __toCommonJS(ThemeableStack_exports);
31
- var import_core = require("@tamagui/core");
32
- var import_Stacks = require("./Stacks.native.js");
33
- var import_variants = require("./variants.native.js");
34
- var chromelessStyle = {
35
- backgroundColor: "transparent",
36
- borderColor: "transparent",
37
- shadowColor: "transparent",
38
- hoverStyle: {
39
- borderColor: "transparent"
40
- }
41
- };
42
- var themeableVariants = {
43
- circular: import_variants.circular,
44
- elevate: import_variants.elevate,
45
- bordered: {
46
- true: import_variants.bordered
47
- },
48
- transparent: {
49
- true: {
50
- backgroundColor: "transparent"
51
- }
52
- },
53
- chromeless: {
54
- true: chromelessStyle,
55
- all: {
56
- ...chromelessStyle,
57
- hoverStyle: chromelessStyle,
58
- pressStyle: chromelessStyle,
59
- focusStyle: chromelessStyle
60
- }
61
- }
62
- };
63
- var ThemeableStack = (0, import_core.styled)(import_Stacks.YStack, {
64
- variants: themeableVariants
65
- });
66
- //# sourceMappingURL=ThemeableStack.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","ThemeableStack_exports","ThemeableStack","themeableVariants","module","exports","import_core","require","import_Stacks","import_variants","chromelessStyle","backgroundColor","borderColor","shadowColor","hoverStyle"],"sources":["../../src/ThemeableStack.tsx"],"sourcesContent":[null],"mappings":"AACA,YAAS;;AAET,IAAAA,SAAS,GAAAC,MAAA,CAAcC,cAAA;AAEvB,IAAAC,gBAAmB,GAAAF,MAAU,CAAAG,wBAAe;AAE5C,IAAAC,iBAAM,GAAkBJ,MAAA,CAAAK,mBAAA;AAAA,IACtBC,YAAA,GAAiBN,MAAA,CAAAO,SAAA,CAAAC,cAAA;AAAA,IACjBC,QAAA,GAAaA,CAAAC,MAAA,EAAAC,GAAA;EACb,SAAAC,IAAa,IAAAD,GAAA,EAEbZ,SAAA,CAAYW,MAAA,EAAAE,IAAA;IAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA;AAAA;AACG,IACfC,WAAA,GAAAA,CAAAC,EAAA,EAAAC,IAAA,EAAAC,MAAA,EAAAC,IAAA;EACF,IAAAF,IAAA,WAAAA,IAAA,wBAAAA,IAAA;IAEO,KAAM,IAAAG,GAAA,IAAAhB,iBAAoB,CAAAa,IAAA,GAC/B,KAAAX,YAAA,CAAAe,IAAA,CAAAL,EAAA,EAAAI,GAAA,KAAAA,GAAA,KAAAF,MAAA,EACAnB,SAAA,CAAAiB,EAAA,EAAAI,GAAA;MAAAP,GAAA,EAAAA,CAAA,KAAAI,IAAA,CAAAG,GAAA;MAAAN,UAAA,IAAAK,IAAA,GAAAjB,gBAAA,CAAAe,IAAA,EAAAG,GAAA,MAAAD,IAAA,CAAAL;IAAA;EAEA;EAAU,OACRE,EAAM;AAAA;AACR,IAEAM,YAAa,GAAAC,GAAA,IAAAR,WAAA,CAAAhB,SAAA;EAAAyB,KAAA;AAAA,IAAAD,GAAA;AAAA,IACXE,sBAAM;AAAAhB,QACJ,CAAAgB,sBAAiB;EAAAC,cACnB,EAAAA,CAAA,KAAAA,cAAA;EACFC,iBAAA,EAAAA,CAAA,KAAAA;AAAA,EAEA;AAAYC,MACV,CAAAC,OAAM,GAAAP,YAAA,CAAAG,sBAAA;AAAA,IACNK,WAAK,GAAAC,OAAA;AAAA,IAAAC,aACA,GAAAD,OAAA;AAAA,IAAAE,eACS,GAAAF,OAAA;AAAA,IAAAG,eACA;EAAAC,eACZ,EAAY;EAAAC,WACd;EACFC,WAAA;EACFC,UAAA;IAEOF,WAAM;EACX;AACF,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
@@ -1,41 +0,0 @@
1
- import { getElevation } from "./getElevation.mjs";
2
- const elevate = {
3
- true: (_, extras) => {
4
- return getElevation(extras.props["size"], extras);
5
- }
6
- };
7
- const bordered = (val, {
8
- props
9
- }) => {
10
- return {
11
- // TODO size it with size in '...size'
12
- borderWidth: typeof val === "number" ? val : 1,
13
- borderColor: "$borderColor"
14
- };
15
- };
16
- const circularStyle = {
17
- borderRadius: 1e5,
18
- padding: 0
19
- };
20
- const circular = {
21
- true: (_, {
22
- props,
23
- tokens
24
- }) => {
25
- if (!("size" in props)) {
26
- return circularStyle;
27
- }
28
- const size = typeof props.size === "number" ? props.size : tokens.size[props.size];
29
- return {
30
- ...circularStyle,
31
- width: size,
32
- height: size,
33
- maxWidth: size,
34
- maxHeight: size,
35
- minWidth: size,
36
- minHeight: size
37
- };
38
- }
39
- };
40
- export { bordered, circular, elevate };
41
- //# sourceMappingURL=variants.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["getElevation","elevate","true","_","extras","props","bordered","val","borderWidth","borderColor","circularStyle","borderRadius","padding","circular","tokens","size","width","height","maxWidth","maxHeight","minWidth","minHeight"],"sources":["../../src/variants.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,YAAA,QAAoB;AAEtB,MAAMC,OAAA,GAAU;EACrBC,IAAA,EAAMA,CAACC,CAAA,EAAYC,MAAA,KAAgB;IACjC,OAAOJ,YAAA,CAAaI,MAAA,CAAOC,KAAA,CAAM,MAAM,GAAGD,MAAM;EAClD;AACF;AAEO,MAAME,QAAA,GAAWA,CAACC,GAAA,EAAuB;EAAEF;AAAM,MAAM;EAC5D,OAAO;IAAA;IAELG,WAAA,EAAa,OAAOD,GAAA,KAAQ,WAAWA,GAAA,GAAM;IAC7CE,WAAA,EAAa;EACf;AACF;AAEA,MAAMC,aAAA,GAAgB;EACpBC,YAAA,EAAc;EACdC,OAAA,EAAS;AACX;AAEO,MAAMC,QAAA,GAAW;EACtBX,IAAA,EAAMA,CAACC,CAAA,EAAG;IAAEE,KAAA;IAAOS;EAAO,MAAM;IAC9B,IAAI,EAAE,UAAUT,KAAA,GAAQ;MACtB,OAAOK,aAAA;IACT;IACA,MAAMK,IAAA,GAAO,OAAOV,KAAA,CAAMU,IAAA,KAAS,WAAWV,KAAA,CAAMU,IAAA,GAAOD,MAAA,CAAOC,IAAA,CAAKV,KAAA,CAAMU,IAAI;IACjF,OAAO;MACL,GAAGL,aAAA;MACHM,KAAA,EAAOD,IAAA;MACPE,MAAA,EAAQF,IAAA;MACRG,QAAA,EAAUH,IAAA;MACVI,SAAA,EAAWJ,IAAA;MACXK,QAAA,EAAUL,IAAA;MACVM,SAAA,EAAWN;IACb;EACF;AACF","ignoreList":[]}
@@ -1,73 +0,0 @@
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 __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
12
- };
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;
21
- };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
25
- var variants_exports = {};
26
- __export(variants_exports, {
27
- bordered: () => bordered,
28
- circular: () => circular,
29
- elevate: () => elevate
30
- });
31
- module.exports = __toCommonJS(variants_exports);
32
- var import_getElevation = require("./getElevation.native.js");
33
- var elevate = {
34
- true: function (_, extras) {
35
- return (0, import_getElevation.getElevation)(extras.props["size"], extras);
36
- }
37
- };
38
- var bordered = function (val, param) {
39
- var {
40
- props
41
- } = param;
42
- return {
43
- // TODO size it with size in '...size'
44
- borderWidth: typeof val === "number" ? val : 1,
45
- borderColor: "$borderColor"
46
- };
47
- };
48
- var circularStyle = {
49
- borderRadius: 1e5,
50
- padding: 0
51
- };
52
- var circular = {
53
- true: function (_, param) {
54
- var {
55
- props,
56
- tokens
57
- } = param;
58
- if (!("size" in props)) {
59
- return circularStyle;
60
- }
61
- var size = typeof props.size === "number" ? props.size : tokens.size[props.size];
62
- return {
63
- ...circularStyle,
64
- width: size,
65
- height: size,
66
- maxWidth: size,
67
- maxHeight: size,
68
- minWidth: size,
69
- minHeight: size
70
- };
71
- }
72
- };
73
- //# sourceMappingURL=variants.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","variants_exports","bordered","circular","elevate","module","exports","import_getElevation","require","true","_","extras","getElevation","props","val","param"],"sources":["../../src/variants.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAS;;AAEF,IAAAA,SAAM,GAAUC,MAAA,CAAAC,cAAA;AAAA,IACrBC,gBAAmB,GAAgBF,MAAA,CAAAG,wBAAA;AACjC,IAAAC,iBAAO,GAAaJ,MAAA,CAAOK,mBAAe;AAAM,IAClDC,YAAA,GAAAN,MAAA,CAAAO,SAAA,CAAAC,cAAA;AACF,IAAAC,QAAA,GAAAA,CAAAC,MAAA,EAAAC,GAAA;EAEO,KAAM,IAAAC,IAAA,IAAYD,GAAA,EACvBZ,SAAO,CAAAW,MAAA,EAAAE,IAAA;IAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA;AAAA;AAAA,IAELC,WAAA,GAAaA,CAAAC,EAAA,EAAAC,IAAO,EAAAC,MAAQ,EAAAC,IAAA,KAAW;EAAM,IAC7CF,IAAA,WAAaA,IAAA,wBAAAA,IAAA;IACf,SAAAG,GAAA,IAAAhB,iBAAA,CAAAa,IAAA,GACF,KAAAX,YAAA,CAAAe,IAAA,CAAAL,EAAA,EAAAI,GAAA,KAAAA,GAAA,KAAAF,MAAA,EAEMnB,SAAA,CAAAiB,EAAA,EAAgBI,GAAA;MAAAP,GAAA,EAAAA,CAAA,KAAAI,IAAA,CAAAG,GAAA;MAAAN,UAAA,IAAAK,IAAA,GAAAjB,gBAAA,CAAAe,IAAA,EAAAG,GAAA,MAAAD,IAAA,CAAAL;IAAA;EACpB;EACA,OAAAE,EAAS;AACX;AAEO,IAAAM,YAAM,GAAWC,GAAA,IAAAR,WAAA,CAAAhB,SAAA;EAAAyB,KAAA;AAAA,IAAAD,GAAA;AAAA,IACtBE,gBAAY,GAAO;AACjBhB,QAAI,CAAAgB,gBAAY;EACdC,QAAA,EAAAA,CAAA,KAAOA,QAAA;EAAAC,QACT,EAAAA,CAAA,KAAAA,QAAA;EACAC,OAAA,EAAMA,CAAA,KAAOA;AACb;AAAOC,MACL,CAAAC,OAAG,GAAAR,YAAA,CAAAG,gBAAA;AAAA,IAAAM,mBACI,GAAAC,OAAA;AAAA,IAAAJ,OACP,GAAQ;EAAAK,IACR,WAAAA,CAAUC,CAAA,EAAAC,MAAA;IAAA,OACV,IAAAJ,mBAAW,CAAAK,YAAA,EAAAD,MAAA,CAAAE,KAAA,UAAAF,MAAA;EAAA;AACD;AACC,IACbT,QAAA,YAAAA,CAAAY,GAAA,EAAAC,KAAA;EACF;IAAAF;EAAA,IAAAE,KAAA;EACF","ignoreList":[]}
@@ -1,33 +0,0 @@
1
- import { styled } from '@tamagui/core'
2
- import { getButtonSized } from '@tamagui/get-button-sized'
3
- import type { GetProps } from '@tamagui/web'
4
- import { ThemeableStack } from './ThemeableStack'
5
- import { bordered, circular, elevate } from './variants'
6
-
7
- export const SizableStack = styled(ThemeableStack, {
8
- name: 'SizableStack',
9
-
10
- variants: {
11
- unstyled: {
12
- true: {
13
- elevate: false,
14
- bordered: false,
15
- },
16
- },
17
-
18
- circular,
19
- elevate,
20
-
21
- bordered: {
22
- true: bordered,
23
- },
24
-
25
- size: {
26
- '...size': (val, extras) => {
27
- return getButtonSized(val, extras)
28
- },
29
- },
30
- } as const,
31
- })
32
-
33
- export type SizableStackProps = GetProps<typeof SizableStack>
@@ -1,47 +0,0 @@
1
- import type { GetProps } from '@tamagui/core'
2
- import { styled } from '@tamagui/core'
3
-
4
- import { YStack } from './Stacks'
5
-
6
- import { bordered, circular, elevate } from './variants'
7
-
8
- const chromelessStyle = {
9
- backgroundColor: 'transparent',
10
- borderColor: 'transparent',
11
- shadowColor: 'transparent',
12
-
13
- hoverStyle: {
14
- borderColor: 'transparent',
15
- },
16
- }
17
-
18
- export const themeableVariants = {
19
- circular,
20
- elevate,
21
-
22
- bordered: {
23
- true: bordered,
24
- },
25
-
26
- transparent: {
27
- true: {
28
- backgroundColor: 'transparent',
29
- },
30
- },
31
-
32
- chromeless: {
33
- true: chromelessStyle,
34
- all: {
35
- ...chromelessStyle,
36
- hoverStyle: chromelessStyle,
37
- pressStyle: chromelessStyle,
38
- focusStyle: chromelessStyle,
39
- },
40
- },
41
- } as const
42
-
43
- export const ThemeableStack = styled(YStack, {
44
- variants: themeableVariants,
45
- })
46
-
47
- export type ThemeableStackProps = GetProps<typeof ThemeableStack>
package/src/variants.tsx DELETED
@@ -1,38 +0,0 @@
1
- import { getElevation } from './getElevation'
2
-
3
- export const elevate = {
4
- true: (_: boolean, extras: any) => {
5
- return getElevation(extras.props['size'], extras) as any
6
- },
7
- }
8
-
9
- export const bordered = (val: boolean | number, { props }) => {
10
- return {
11
- // TODO size it with size in '...size'
12
- borderWidth: typeof val === 'number' ? val : 1,
13
- borderColor: '$borderColor',
14
- }
15
- }
16
-
17
- const circularStyle = {
18
- borderRadius: 100_000,
19
- padding: 0,
20
- }
21
-
22
- export const circular = {
23
- true: (_, { props, tokens }) => {
24
- if (!('size' in props)) {
25
- return circularStyle
26
- }
27
- const size = typeof props.size === 'number' ? props.size : tokens.size[props.size]
28
- return {
29
- ...circularStyle,
30
- width: size,
31
- height: size,
32
- maxWidth: size,
33
- maxHeight: size,
34
- minWidth: size,
35
- minHeight: size,
36
- }
37
- },
38
- }
@@ -1,14 +0,0 @@
1
- import type { GetProps } from '@tamagui/web';
2
- export declare const SizableStack: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
3
- size?: import("@tamagui/core").SizeTokens | undefined;
4
- unstyled?: boolean | undefined;
5
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
6
- transparent?: boolean | undefined;
7
- fullscreen?: boolean | undefined;
8
- circular?: boolean | undefined;
9
- elevate?: boolean | undefined;
10
- bordered?: boolean | undefined;
11
- chromeless?: boolean | "all" | undefined;
12
- }, import("@tamagui/core").StaticConfigPublic>;
13
- export type SizableStackProps = GetProps<typeof SizableStack>;
14
- //# sourceMappingURL=SizableStack.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SizableStack.d.ts","sourceRoot":"","sources":["../src/SizableStack.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAI5C,eAAO,MAAM,YAAY;;;;;;;;;;8CAwBvB,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAA"}
@@ -1,87 +0,0 @@
1
- import type { GetProps } from '@tamagui/core';
2
- export declare const themeableVariants: {
3
- readonly circular: {
4
- true: (_: any, { props, tokens }: {
5
- props: any;
6
- tokens: any;
7
- }) => {
8
- borderRadius: number;
9
- padding: number;
10
- } | {
11
- width: any;
12
- height: any;
13
- maxWidth: any;
14
- maxHeight: any;
15
- minWidth: any;
16
- minHeight: any;
17
- borderRadius: number;
18
- padding: number;
19
- };
20
- };
21
- readonly elevate: {
22
- true: (_: boolean, extras: any) => any;
23
- };
24
- readonly bordered: {
25
- readonly true: (val: boolean | number, { props }: {
26
- props: any;
27
- }) => {
28
- borderWidth: number;
29
- borderColor: string;
30
- };
31
- };
32
- readonly transparent: {
33
- readonly true: {
34
- readonly backgroundColor: "transparent";
35
- };
36
- };
37
- readonly chromeless: {
38
- readonly true: {
39
- backgroundColor: string;
40
- borderColor: string;
41
- shadowColor: string;
42
- hoverStyle: {
43
- borderColor: string;
44
- };
45
- };
46
- readonly all: {
47
- readonly hoverStyle: {
48
- backgroundColor: string;
49
- borderColor: string;
50
- shadowColor: string;
51
- hoverStyle: {
52
- borderColor: string;
53
- };
54
- };
55
- readonly pressStyle: {
56
- backgroundColor: string;
57
- borderColor: string;
58
- shadowColor: string;
59
- hoverStyle: {
60
- borderColor: string;
61
- };
62
- };
63
- readonly focusStyle: {
64
- backgroundColor: string;
65
- borderColor: string;
66
- shadowColor: string;
67
- hoverStyle: {
68
- borderColor: string;
69
- };
70
- };
71
- readonly backgroundColor: string;
72
- readonly borderColor: string;
73
- readonly shadowColor: string;
74
- };
75
- };
76
- };
77
- export declare const ThemeableStack: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
78
- elevation?: number | import("@tamagui/core").SizeTokens | undefined;
79
- transparent?: boolean | undefined;
80
- fullscreen?: boolean | undefined;
81
- circular?: boolean | undefined;
82
- elevate?: boolean | undefined;
83
- bordered?: boolean | undefined;
84
- chromeless?: boolean | "all" | undefined;
85
- }, import("@tamagui/core").StaticConfigPublic>;
86
- export type ThemeableStackProps = GetProps<typeof ThemeableStack>;
87
- //# sourceMappingURL=ThemeableStack.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ThemeableStack.d.ts","sourceRoot":"","sources":["../src/ThemeableStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAiB7C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBpB,CAAA;AAEV,eAAO,MAAM,cAAc;;;;;;;;8CAEzB,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAA"}
@@ -1,28 +0,0 @@
1
- export declare const elevate: {
2
- true: (_: boolean, extras: any) => any;
3
- };
4
- export declare const bordered: (val: boolean | number, { props }: {
5
- props: any;
6
- }) => {
7
- borderWidth: number;
8
- borderColor: string;
9
- };
10
- export declare const circular: {
11
- true: (_: any, { props, tokens }: {
12
- props: any;
13
- tokens: any;
14
- }) => {
15
- borderRadius: number;
16
- padding: number;
17
- } | {
18
- width: any;
19
- height: any;
20
- maxWidth: any;
21
- maxHeight: any;
22
- minWidth: any;
23
- minHeight: any;
24
- borderRadius: number;
25
- padding: number;
26
- };
27
- };
28
- //# sourceMappingURL=variants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../src/variants.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO;cACR,OAAO,UAAU,GAAG,KACyB,GAAG;CAE3D,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,KAAK,OAAO,GAAG,MAAM,EAAE;;CAAS;;;CAMxD,CAAA;AAOD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;CAgBpB,CAAA"}