@hanzogui/stacks 2.0.0

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 (97) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/NestingContext.cjs +38 -0
  3. package/dist/cjs/NestingContext.native.js +41 -0
  4. package/dist/cjs/NestingContext.native.js.map +1 -0
  5. package/dist/cjs/SizableStack.cjs +48 -0
  6. package/dist/cjs/SizableStack.native.js +53 -0
  7. package/dist/cjs/SizableStack.native.js.map +1 -0
  8. package/dist/cjs/Stacks.cjs +60 -0
  9. package/dist/cjs/Stacks.native.js +63 -0
  10. package/dist/cjs/Stacks.native.js.map +1 -0
  11. package/dist/cjs/ThemeableStack.cjs +61 -0
  12. package/dist/cjs/ThemeableStack.native.js +64 -0
  13. package/dist/cjs/ThemeableStack.native.js.map +1 -0
  14. package/dist/cjs/getElevation.cjs +59 -0
  15. package/dist/cjs/getElevation.native.js +66 -0
  16. package/dist/cjs/getElevation.native.js.map +1 -0
  17. package/dist/cjs/index.cjs +22 -0
  18. package/dist/cjs/index.native.js +25 -0
  19. package/dist/cjs/index.native.js.map +1 -0
  20. package/dist/cjs/variants.cjs +60 -0
  21. package/dist/cjs/variants.native.js +69 -0
  22. package/dist/cjs/variants.native.js.map +1 -0
  23. package/dist/esm/NestingContext.mjs +4 -0
  24. package/dist/esm/NestingContext.mjs.map +1 -0
  25. package/dist/esm/NestingContext.native.js +4 -0
  26. package/dist/esm/NestingContext.native.js.map +1 -0
  27. package/dist/esm/SizableStack.mjs +25 -0
  28. package/dist/esm/SizableStack.mjs.map +1 -0
  29. package/dist/esm/SizableStack.native.js +27 -0
  30. package/dist/esm/SizableStack.native.js.map +1 -0
  31. package/dist/esm/Stacks.mjs +34 -0
  32. package/dist/esm/Stacks.mjs.map +1 -0
  33. package/dist/esm/Stacks.native.js +34 -0
  34. package/dist/esm/Stacks.native.js.map +1 -0
  35. package/dist/esm/ThemeableStack.mjs +37 -0
  36. package/dist/esm/ThemeableStack.mjs.map +1 -0
  37. package/dist/esm/ThemeableStack.native.js +37 -0
  38. package/dist/esm/ThemeableStack.native.js.map +1 -0
  39. package/dist/esm/getElevation.mjs +35 -0
  40. package/dist/esm/getElevation.mjs.map +1 -0
  41. package/dist/esm/getElevation.native.js +39 -0
  42. package/dist/esm/getElevation.native.js.map +1 -0
  43. package/dist/esm/index.js +6 -0
  44. package/dist/esm/index.js.map +1 -0
  45. package/dist/esm/index.mjs +6 -0
  46. package/dist/esm/index.mjs.map +1 -0
  47. package/dist/esm/index.native.js +6 -0
  48. package/dist/esm/index.native.js.map +1 -0
  49. package/dist/esm/variants.mjs +35 -0
  50. package/dist/esm/variants.mjs.map +1 -0
  51. package/dist/esm/variants.native.js +41 -0
  52. package/dist/esm/variants.native.js.map +1 -0
  53. package/dist/jsx/NestingContext.mjs +4 -0
  54. package/dist/jsx/NestingContext.mjs.map +1 -0
  55. package/dist/jsx/NestingContext.native.js +41 -0
  56. package/dist/jsx/NestingContext.native.js.map +1 -0
  57. package/dist/jsx/SizableStack.mjs +25 -0
  58. package/dist/jsx/SizableStack.mjs.map +1 -0
  59. package/dist/jsx/SizableStack.native.js +53 -0
  60. package/dist/jsx/SizableStack.native.js.map +1 -0
  61. package/dist/jsx/Stacks.mjs +34 -0
  62. package/dist/jsx/Stacks.mjs.map +1 -0
  63. package/dist/jsx/Stacks.native.js +63 -0
  64. package/dist/jsx/Stacks.native.js.map +1 -0
  65. package/dist/jsx/ThemeableStack.mjs +37 -0
  66. package/dist/jsx/ThemeableStack.mjs.map +1 -0
  67. package/dist/jsx/ThemeableStack.native.js +64 -0
  68. package/dist/jsx/ThemeableStack.native.js.map +1 -0
  69. package/dist/jsx/getElevation.mjs +35 -0
  70. package/dist/jsx/getElevation.mjs.map +1 -0
  71. package/dist/jsx/getElevation.native.js +66 -0
  72. package/dist/jsx/getElevation.native.js.map +1 -0
  73. package/dist/jsx/index.js +6 -0
  74. package/dist/jsx/index.js.map +1 -0
  75. package/dist/jsx/index.mjs +6 -0
  76. package/dist/jsx/index.mjs.map +1 -0
  77. package/dist/jsx/index.native.js +25 -0
  78. package/dist/jsx/index.native.js.map +1 -0
  79. package/dist/jsx/variants.mjs +35 -0
  80. package/dist/jsx/variants.mjs.map +1 -0
  81. package/dist/jsx/variants.native.js +69 -0
  82. package/dist/jsx/variants.native.js.map +1 -0
  83. package/package.json +52 -0
  84. package/src/NestingContext.tsx +3 -0
  85. package/src/SizableStack.tsx +33 -0
  86. package/src/Stacks.tsx +74 -0
  87. package/src/ThemeableStack.tsx +47 -0
  88. package/src/getElevation.tsx +47 -0
  89. package/src/index.ts +5 -0
  90. package/src/variants.tsx +38 -0
  91. package/types/NestingContext.d.ts +3 -0
  92. package/types/SizableStack.d.ts +14 -0
  93. package/types/Stacks.d.ts +43 -0
  94. package/types/ThemeableStack.d.ts +87 -0
  95. package/types/getElevation.d.ts +12 -0
  96. package/types/index.d.ts +6 -0
  97. package/types/variants.d.ts +28 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Nate Wienert
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,38 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf,
6
+ __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
+ value: mod,
27
+ enumerable: !0
28
+ }) : target, mod)),
29
+ __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
+ value: !0
31
+ }), mod);
32
+ var NestingContext_exports = {};
33
+ __export(NestingContext_exports, {
34
+ ButtonNestingContext: () => ButtonNestingContext
35
+ });
36
+ module.exports = __toCommonJS(NestingContext_exports);
37
+ var import_react = __toESM(require("react"), 1);
38
+ const ButtonNestingContext = import_react.default.createContext(!1);
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf,
8
+ __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: !0
13
+ });
14
+ },
15
+ __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: !0
30
+ }) : target, mod)),
31
+ __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: !0
33
+ }), mod);
34
+ var NestingContext_exports = {};
35
+ __export(NestingContext_exports, {
36
+ ButtonNestingContext: () => ButtonNestingContext
37
+ });
38
+ module.exports = __toCommonJS(NestingContext_exports);
39
+ var import_react = __toESM(require("react"), 1),
40
+ ButtonNestingContext = /* @__PURE__ */import_react.default.createContext(!1);
41
+ //# sourceMappingURL=NestingContext.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","NestingContext_exports","__export","ButtonNestingContext","module","exports","import_react","__toESM","require","default","createContext"],"sources":["../../src/NestingContext.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;IAAAC,KAAA;EAAA,IAAAH,GAAA;AAAA,IAAAI,sBAAA;AAAAC,QAAA,CAAAD,sBAAA;EAAAE,oBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAkB,CAAAK,sBAAA;AAEX,IAAAK,YAAM,GAAAC,OAAA,CAAAC,OAAuB;EAAAL,oBAAyB,kBAAAG,YAAA,CAAAG,OAAA,CAAAC,aAAA","ignoreList":[]}
@@ -0,0 +1,48 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var SizableStack_exports = {};
22
+ __export(SizableStack_exports, {
23
+ SizableStack: () => SizableStack
24
+ });
25
+ module.exports = __toCommonJS(SizableStack_exports);
26
+ var import_gui_core = require("@hanzo/gui-core"),
27
+ import_gui_get_button_sized = require("@hanzo/gui-get-button-sized"),
28
+ import_ThemeableStack = require("./ThemeableStack.cjs"),
29
+ import_variants = require("./variants.cjs");
30
+ const SizableStack = (0, import_gui_core.styled)(import_ThemeableStack.ThemeableStack, {
31
+ name: "SizableStack",
32
+ variants: {
33
+ unstyled: {
34
+ true: {
35
+ elevate: !1,
36
+ bordered: !1
37
+ }
38
+ },
39
+ circular: import_variants.circular,
40
+ elevate: import_variants.elevate,
41
+ bordered: {
42
+ true: import_variants.bordered
43
+ },
44
+ size: {
45
+ "...size": (val, extras) => (0, import_gui_get_button_sized.getButtonSized)(val, extras)
46
+ }
47
+ }
48
+ });
@@ -0,0 +1,53 @@
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: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: !0
22
+ }), mod);
23
+ var SizableStack_exports = {};
24
+ __export(SizableStack_exports, {
25
+ SizableStack: () => SizableStack
26
+ });
27
+ module.exports = __toCommonJS(SizableStack_exports);
28
+ var import_gui_core = require("@hanzo/gui-core"),
29
+ import_gui_get_button_sized = require("@hanzo/gui-get-button-sized"),
30
+ import_ThemeableStack = require("./ThemeableStack.native.js"),
31
+ import_variants = require("./variants.native.js"),
32
+ SizableStack = (0, import_gui_core.styled)(import_ThemeableStack.ThemeableStack, {
33
+ name: "SizableStack",
34
+ variants: {
35
+ unstyled: {
36
+ true: {
37
+ elevate: !1,
38
+ bordered: !1
39
+ }
40
+ },
41
+ circular: import_variants.circular,
42
+ elevate: import_variants.elevate,
43
+ bordered: {
44
+ true: import_variants.bordered
45
+ },
46
+ size: {
47
+ "...size": function (val, extras) {
48
+ return (0, import_gui_get_button_sized.getButtonSized)(val, extras);
49
+ }
50
+ }
51
+ }
52
+ });
53
+ //# sourceMappingURL=SizableStack.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","SizableStack_exports","__export","SizableStack","module","exports","import_gui_core","require","import_gui_get_button_sized","import_ThemeableStack","import_variants","styled","ThemeableStack","name","variants","unstyled","true","elevate","bordered","circular","size","...size","val","extras","getButtonSized"],"sources":["../../src/SizableStack.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;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAuB,CAAAK,oBACvB;AAKO,IAAAK,eAAM,GAAAC,OAAe;EAAOC,2BAAA,GAAAD,OAAgB;EAAAE,qBAAA,GAAAF,OAAA;EAAAG,eAAA,GAAAH,OAAA;EAAAJ,YAAA,OAAAG,eAAA,CAAAK,MAAA,EAAAF,qBAAA,CAAAG,cAAA;IACjDC,IAAA,EAAM;IAENC,QAAA,EAAU;MACRC,QAAA,EAAU;QACRC,IAAA,EAAM;UACJC,OAAA,EAAS;UACTC,QAAA,EAAU;QACZ;MACF;MAEAC,QAAA,EAAAT,eAAA,CAAAS,QAAA;MACAF,OAAA,EAAAP,eAAA,CAAAO,OAAA;MAEAC,QAAA,EAAU;QACRF,IAAA,EAAMN,eAAA,CAAAQ;MACR;MAEAE,IAAA,EAAM;QACJ,WAAW,SAAAC,CAAMC,GAAA,EAAAC,MAAA,EACR;UAEX,WAAAf,2BAAA,CAAAgB,cAAA,EAAAF,GAAA,EAAAC,MAAA;QACF;MACD","ignoreList":[]}
@@ -0,0 +1,60 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var Stacks_exports = {};
22
+ __export(Stacks_exports, {
23
+ XStack: () => XStack,
24
+ YStack: () => YStack,
25
+ ZStack: () => ZStack,
26
+ fullscreenStyle: () => fullscreenStyle
27
+ });
28
+ module.exports = __toCommonJS(Stacks_exports);
29
+ var import_gui_core = require("@hanzo/gui-core"),
30
+ import_getElevation = require("./getElevation.cjs");
31
+ const fullscreenStyle = {
32
+ position: "absolute",
33
+ inset: 0
34
+ },
35
+ variants = {
36
+ fullscreen: {
37
+ true: fullscreenStyle
38
+ },
39
+ elevation: {
40
+ "...size": import_getElevation.getElevation,
41
+ ":number": import_getElevation.getElevation
42
+ }
43
+ },
44
+ YStack = (0, import_gui_core.styled)(import_gui_core.View, {
45
+ flexDirection: "column",
46
+ variants
47
+ });
48
+ YStack.displayName = "YStack";
49
+ const XStack = (0, import_gui_core.styled)(import_gui_core.View, {
50
+ flexDirection: "row",
51
+ variants
52
+ });
53
+ XStack.displayName = "XStack";
54
+ const ZStack = (0, import_gui_core.styled)(YStack, {
55
+ position: "relative"
56
+ }, {
57
+ neverFlatten: !0,
58
+ isZStack: !0
59
+ });
60
+ ZStack.displayName = "ZStack";
@@ -0,0 +1,63 @@
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: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: !0
22
+ }), mod);
23
+ var Stacks_exports = {};
24
+ __export(Stacks_exports, {
25
+ XStack: () => XStack,
26
+ YStack: () => YStack,
27
+ ZStack: () => ZStack,
28
+ fullscreenStyle: () => fullscreenStyle
29
+ });
30
+ module.exports = __toCommonJS(Stacks_exports);
31
+ var import_gui_core = require("@hanzo/gui-core"),
32
+ import_getElevation = require("./getElevation.native.js"),
33
+ fullscreenStyle = {
34
+ position: "absolute",
35
+ inset: 0
36
+ },
37
+ variants = {
38
+ fullscreen: {
39
+ true: fullscreenStyle
40
+ },
41
+ elevation: {
42
+ "...size": import_getElevation.getElevation,
43
+ ":number": import_getElevation.getElevation
44
+ }
45
+ },
46
+ YStack = (0, import_gui_core.styled)(import_gui_core.View, {
47
+ flexDirection: "column",
48
+ variants
49
+ });
50
+ YStack.displayName = "YStack";
51
+ var XStack = (0, import_gui_core.styled)(import_gui_core.View, {
52
+ flexDirection: "row",
53
+ variants
54
+ });
55
+ XStack.displayName = "XStack";
56
+ var ZStack = (0, import_gui_core.styled)(YStack, {
57
+ position: "relative"
58
+ }, {
59
+ neverFlatten: !0,
60
+ isZStack: !0
61
+ });
62
+ ZStack.displayName = "ZStack";
63
+ //# sourceMappingURL=Stacks.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Stacks_exports","__export","XStack","YStack","ZStack","fullscreenStyle","module","exports","import_gui_core","require","import_getElevation","position","inset","variants","fullscreen","true","elevation","getElevation","styled","View","flexDirection","displayName","neverFlatten","isZStack"],"sources":["../../src/Stacks.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,cAAA;AAAAC,QAAA,CAAAD,cAAA;EAAAE,MAAA,EAAAA,CAAA,KAAAA,MAAA;EAAAC,MAAA,EAAAA,CAAA,KAAAA,MAAA;EAAAC,MAAA,EAAAA,CAAA,KAAAA,MAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAAZ,YAA6B,CAAAK,cAAA;AAmBtB,IAAAQ,eAAM,GAAAC,OAAkB;EAAAC,mBAAA,GAAAD,OAAA;EAAAJ,eAAA;IAC7BM,QAAA,EAAU;IACVC,KAAA,EAAO;EACT;EAEMC,QAAA,GAAW;IACfC,UAAA,EAAY;MACVC,IAAA,EAAMV;IACR;IAEAW,SAAA,EAAW;MACT,WAAWN,mBAAA,CAAAO,YAAA;MACX,WAAWP,mBAAA,CAAAO;IACb;EACF;EAMad,MAAA,OAASK,eAAA,CAAAU,MAAA,EAAOV,eAAA,CAAAW,IAAA,EAAM;IACjCC,aAAA,EAAe;IACfP;EACF,CAAC;AAEDV,MAAA,CAAOkB,WAAA,GAAiB;AAMjB,IAAAnB,MAAM,OAAAM,eAAS,CAAAU,MAAA,EAAAV,eAAO,CAAAW,IAAA;EAC3BC,aAAA,EAAe;EACfP;AACF,CAAC;AAEDX,MAAA,CAAOmB,WAAA,GAAiB;AAMjB,IAAAjB,MAAM,OAAAI,eAAS,CAAAU,MAAA,EAAAf,MAAA;EACpBQ,QAAA;AAAA,GACA;EAAAW,YACY;EACZC,QAAA;AAAA,EACA;AAAAnB,MACE,CAAAiB,WAAc","ignoreList":[]}
@@ -0,0 +1,61 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var ThemeableStack_exports = {};
22
+ __export(ThemeableStack_exports, {
23
+ ThemeableStack: () => ThemeableStack,
24
+ themeableVariants: () => themeableVariants
25
+ });
26
+ module.exports = __toCommonJS(ThemeableStack_exports);
27
+ var import_gui_core = require("@hanzo/gui-core"),
28
+ import_Stacks = require("./Stacks.cjs"),
29
+ import_variants = require("./variants.cjs");
30
+ const chromelessStyle = {
31
+ backgroundColor: "transparent",
32
+ borderColor: "transparent",
33
+ shadowColor: "transparent",
34
+ hoverStyle: {
35
+ borderColor: "transparent"
36
+ }
37
+ },
38
+ themeableVariants = {
39
+ circular: import_variants.circular,
40
+ elevate: import_variants.elevate,
41
+ bordered: {
42
+ true: import_variants.bordered
43
+ },
44
+ transparent: {
45
+ true: {
46
+ backgroundColor: "transparent"
47
+ }
48
+ },
49
+ chromeless: {
50
+ true: chromelessStyle,
51
+ all: {
52
+ ...chromelessStyle,
53
+ hoverStyle: chromelessStyle,
54
+ pressStyle: chromelessStyle,
55
+ focusStyle: chromelessStyle
56
+ }
57
+ }
58
+ },
59
+ ThemeableStack = (0, import_gui_core.styled)(import_Stacks.YStack, {
60
+ variants: themeableVariants
61
+ });
@@ -0,0 +1,64 @@
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: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: !0
22
+ }), mod);
23
+ var ThemeableStack_exports = {};
24
+ __export(ThemeableStack_exports, {
25
+ ThemeableStack: () => ThemeableStack,
26
+ themeableVariants: () => themeableVariants
27
+ });
28
+ module.exports = __toCommonJS(ThemeableStack_exports);
29
+ var import_gui_core = require("@hanzo/gui-core"),
30
+ import_Stacks = require("./Stacks.native.js"),
31
+ import_variants = require("./variants.native.js"),
32
+ chromelessStyle = {
33
+ backgroundColor: "transparent",
34
+ borderColor: "transparent",
35
+ shadowColor: "transparent",
36
+ hoverStyle: {
37
+ borderColor: "transparent"
38
+ }
39
+ },
40
+ themeableVariants = {
41
+ circular: import_variants.circular,
42
+ elevate: import_variants.elevate,
43
+ bordered: {
44
+ true: import_variants.bordered
45
+ },
46
+ transparent: {
47
+ true: {
48
+ backgroundColor: "transparent"
49
+ }
50
+ },
51
+ chromeless: {
52
+ true: chromelessStyle,
53
+ all: {
54
+ ...chromelessStyle,
55
+ hoverStyle: chromelessStyle,
56
+ pressStyle: chromelessStyle,
57
+ focusStyle: chromelessStyle
58
+ }
59
+ }
60
+ },
61
+ ThemeableStack = (0, import_gui_core.styled)(import_Stacks.YStack, {
62
+ variants: themeableVariants
63
+ });
64
+ //# sourceMappingURL=ThemeableStack.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","ThemeableStack_exports","__export","ThemeableStack","themeableVariants","module","exports","import_gui_core","require","import_Stacks","import_variants","chromelessStyle","backgroundColor","borderColor","shadowColor","hoverStyle","circular","elevate","bordered","true","transparent","chromeless","all","pressStyle","focusStyle","styled","YStack","variants"],"sources":["../../src/ThemeableStack.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,sBAAA;AAAAC,QAAA,CAAAD,sBAAA;EAAAE,cAAA,EAAAA,CAAA,KAAAA,cAAA;EAAAC,iBAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAAV,YAAuB,CAAAK,sBAEvB;AAIA,IAAAM,eAAM,GAAAC,OAAkB;EAAAC,aAAA,GAAAD,OAAA;EAAAE,eAAA,GAAAF,OAAA;EAAAG,eAAA;IACtBC,eAAA,EAAiB;IACjBC,WAAA,EAAa;IACbC,WAAA,EAAa;IAEbC,UAAA,EAAY;MACVF,WAAA,EAAa;IACf;EACF;EAEaT,iBAAA,GAAoB;IAC/BY,QAAA,EAAAN,eAAA,CAAAM,QAAA;IACAC,OAAA,EAAAP,eAAA,CAAAO,OAAA;IAEAC,QAAA,EAAU;MACRC,IAAA,EAAMT,eAAA,CAAAQ;IACR;IAEAE,WAAA,EAAa;MACXD,IAAA,EAAM;QACJP,eAAA,EAAiB;MACnB;IACF;IAEAS,UAAA,EAAY;MACVF,IAAA,EAAMR,eAAA;MACNW,GAAA,EAAK;QACH,GAAGX,eAAA;QACHI,UAAA,EAAYJ,eAAA;QACZY,UAAA,EAAYZ,eAAA;QACZa,UAAA,EAAYb;MACd;IACF;EACF;EAEaR,cAAA,OAAiBI,eAAA,CAAAkB,MAAA,EAAOhB,aAAA,CAAAiB,MAAA,EAAQ;IAC3CC,QAAA,EAAUvB;EACZ,CAAC","ignoreList":[]}
@@ -0,0 +1,59 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var getElevation_exports = {};
22
+ __export(getElevation_exports, {
23
+ getElevation: () => getElevation,
24
+ getSizedElevation: () => getSizedElevation
25
+ });
26
+ module.exports = __toCommonJS(getElevation_exports);
27
+ var import_gui_core = require("@hanzo/gui-core");
28
+ const getElevation = (size, extras) => {
29
+ if (!size) return;
30
+ const {
31
+ tokens
32
+ } = extras,
33
+ token = tokens.size[size],
34
+ sizeNum = (0, import_gui_core.isVariable)(token) ? +token.val : size;
35
+ return getSizedElevation(sizeNum, extras);
36
+ },
37
+ getSizedElevation = (val, {
38
+ theme,
39
+ tokens
40
+ }) => {
41
+ let num = 0;
42
+ if (val === !0) {
43
+ const val2 = (0, import_gui_core.getVariableValue)(tokens.size.true);
44
+ typeof val2 == "number" ? num = val2 : num = 10;
45
+ } else num = +val;
46
+ if (num === 0) return;
47
+ const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
48
+ return {
49
+ shadowColor: theme.shadowColor,
50
+ shadowRadius,
51
+ shadowOffset: {
52
+ height,
53
+ width: 0
54
+ },
55
+ ...(import_gui_core.isAndroid ? {
56
+ elevationAndroid: 2 * height
57
+ } : {})
58
+ };
59
+ };
@@ -0,0 +1,66 @@
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: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: !0
22
+ }), mod);
23
+ var getElevation_exports = {};
24
+ __export(getElevation_exports, {
25
+ getElevation: () => getElevation,
26
+ getSizedElevation: () => getSizedElevation
27
+ });
28
+ module.exports = __toCommonJS(getElevation_exports);
29
+ var import_gui_core = require("@hanzo/gui-core"),
30
+ getElevation = function (size, extras) {
31
+ if (size) {
32
+ var {
33
+ tokens
34
+ } = extras,
35
+ token = tokens.size[size],
36
+ sizeNum = (0, import_gui_core.isVariable)(token) ? +token.val : size;
37
+ return getSizedElevation(sizeNum, extras);
38
+ }
39
+ },
40
+ getSizedElevation = function (val, param) {
41
+ var {
42
+ theme,
43
+ tokens
44
+ } = param,
45
+ num = 0;
46
+ if (val === !0) {
47
+ var _$val = (0, import_gui_core.getVariableValue)(tokens.size.true);
48
+ typeof _$val == "number" ? num = _$val : num = 10;
49
+ } else num = +val;
50
+ if (num !== 0) {
51
+ var [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)],
52
+ shadow = {
53
+ shadowColor: theme.shadowColor,
54
+ shadowRadius,
55
+ shadowOffset: {
56
+ height,
57
+ width: 0
58
+ },
59
+ ...(import_gui_core.isAndroid ? {
60
+ elevationAndroid: 2 * height
61
+ } : {})
62
+ };
63
+ return shadow;
64
+ }
65
+ };
66
+ //# sourceMappingURL=getElevation.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","getElevation_exports","__export","getElevation","getSizedElevation","module","exports","import_gui_core","require","size","extras","tokens","token","sizeNum","isVariable","val","param","theme","num","_$val","getVariableValue","true","height","shadowRadius","Math","round","shadow","shadowColor","shadowOffset","width"],"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,eAAM,GAAsDC,OAAM,kBAAW;EAAAL,YAAA,YAAAA,CAAAM,IAAA,EAAAC,MAAA;IAClF,IAAID,IAAC,EAAM;MACX,IAAM;UAAEE;QAAO,IAAID,MAAA;QACbE,KAAA,GAAQD,MAAA,CAAOF,IAAA,CAAKA,IAAI;QACxBI,OAAA,OAAWN,eAAA,CAAAO,UAAA,EAAWF,KAAK,IAAI,CAACA,KAAA,CAAMG,GAAA,GAAMN,IAAA;MAClD,OAAOL,iBAAkB,CAAAS,OAAS,EAAAH,MAAM;IAC1C;EAME;EAAAN,iBAAU,YAAAA,CAAAW,GAAA,EAAAC,KAAA;IACV,IAAI;QAAAC,KAAA;QAAQN;MAAM,IAAAK,KAAA;MAAAE,GAAA;IAChB,IAAAH,GAAA,KAAM;MACF,IAAAI,KAAO,OAAQZ,eACjB,CAAMa,gBAEA,EAAAT,MAAA,CAAAF,IAAA,CAAAY,IAAA;MAEV,OAAAF,KAAA,eAAAD,GAAA,GAAAC,KAAA,GAAAD,GAAA;IACE,OAEFA,GAAI,IAAAH,GAAQ;IACV,IAAAG,GAAA;MAEF,IAAM,CAACI,MAAA,EAAQC,YAAY,IAAI,CAW/BC,IAVe,CAAAC,KAAA,CAAAP,GAAA,WACbM,IAAA,CAAAC,KAAA,CAAaP,GAAA,GAAM,OACnB;QAAAQ,MAAA;UACAC,WAAA,EAAcV,KAAE,CAAAU,WAAe;UAC/BJ,YAAI;UAEEK,YAAA;YAEFN,MAAC;YACPO,KAAA;UAEF","ignoreList":[]}
@@ -0,0 +1,22 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
7
+ get: () => from[key],
8
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
9
+ });
10
+ return to;
11
+ },
12
+ __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
14
+ value: !0
15
+ }), mod);
16
+ var index_exports = {};
17
+ module.exports = __toCommonJS(index_exports);
18
+ __reExport(index_exports, require("./Stacks.cjs"), module.exports);
19
+ __reExport(index_exports, require("./ThemeableStack.cjs"), module.exports);
20
+ __reExport(index_exports, require("./SizableStack.cjs"), module.exports);
21
+ __reExport(index_exports, require("./NestingContext.cjs"), module.exports);
22
+ __reExport(index_exports, require("./getElevation.cjs"), module.exports);
@@ -0,0 +1,25 @@
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") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
9
+ get: () => from[key],
10
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
+ });
12
+ return to;
13
+ },
14
+ __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
+ value: !0
17
+ }), 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("./ThemeableStack.native.js"), module.exports);
22
+ __reExport(index_exports, require("./SizableStack.native.js"), module.exports);
23
+ __reExport(index_exports, require("./NestingContext.native.js"), module.exports);
24
+ __reExport(index_exports, require("./getElevation.native.js"), module.exports);
25
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +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":[]}