@tamagui/spacer 2.0.0-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 (72) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/Spacer.cjs +64 -0
  3. package/dist/cjs/Spacer.js +56 -0
  4. package/dist/cjs/Spacer.js.map +6 -0
  5. package/dist/cjs/Spacer.native.js +69 -0
  6. package/dist/cjs/Spacer.native.js.map +1 -0
  7. package/dist/cjs/Unspaced.cjs +34 -0
  8. package/dist/cjs/Unspaced.js +29 -0
  9. package/dist/cjs/Unspaced.js.map +6 -0
  10. package/dist/cjs/Unspaced.native.js +37 -0
  11. package/dist/cjs/Unspaced.native.js.map +1 -0
  12. package/dist/cjs/index.cjs +29 -0
  13. package/dist/cjs/index.js +23 -0
  14. package/dist/cjs/index.js.map +6 -0
  15. package/dist/cjs/index.native.js +32 -0
  16. package/dist/cjs/index.native.js.map +1 -0
  17. package/dist/cjs/spacedChildren.cjs +118 -0
  18. package/dist/cjs/spacedChildren.js +98 -0
  19. package/dist/cjs/spacedChildren.js.map +6 -0
  20. package/dist/cjs/spacedChildren.native.js +143 -0
  21. package/dist/cjs/spacedChildren.native.js.map +1 -0
  22. package/dist/cjs/types.cjs +16 -0
  23. package/dist/cjs/types.js +14 -0
  24. package/dist/cjs/types.js.map +6 -0
  25. package/dist/cjs/types.native.js +19 -0
  26. package/dist/cjs/types.native.js.map +1 -0
  27. package/dist/esm/Spacer.js +40 -0
  28. package/dist/esm/Spacer.js.map +6 -0
  29. package/dist/esm/Spacer.mjs +41 -0
  30. package/dist/esm/Spacer.mjs.map +1 -0
  31. package/dist/esm/Spacer.native.js +43 -0
  32. package/dist/esm/Spacer.native.js.map +1 -0
  33. package/dist/esm/Unspaced.js +13 -0
  34. package/dist/esm/Unspaced.js.map +6 -0
  35. package/dist/esm/Unspaced.mjs +10 -0
  36. package/dist/esm/Unspaced.mjs.map +1 -0
  37. package/dist/esm/Unspaced.native.js +10 -0
  38. package/dist/esm/Unspaced.native.js.map +1 -0
  39. package/dist/esm/index.js +7 -0
  40. package/dist/esm/index.js.map +6 -0
  41. package/dist/esm/index.mjs +5 -0
  42. package/dist/esm/index.mjs.map +1 -0
  43. package/dist/esm/index.native.js +5 -0
  44. package/dist/esm/index.native.js.map +1 -0
  45. package/dist/esm/spacedChildren.js +78 -0
  46. package/dist/esm/spacedChildren.js.map +6 -0
  47. package/dist/esm/spacedChildren.mjs +84 -0
  48. package/dist/esm/spacedChildren.mjs.map +1 -0
  49. package/dist/esm/spacedChildren.native.js +106 -0
  50. package/dist/esm/spacedChildren.native.js.map +1 -0
  51. package/dist/esm/types.js +1 -0
  52. package/dist/esm/types.js.map +6 -0
  53. package/dist/esm/types.mjs +2 -0
  54. package/dist/esm/types.mjs.map +1 -0
  55. package/dist/esm/types.native.js +2 -0
  56. package/dist/esm/types.native.js.map +1 -0
  57. package/package.json +52 -0
  58. package/src/Spacer.tsx +42 -0
  59. package/src/Unspaced.tsx +11 -0
  60. package/src/index.ts +4 -0
  61. package/src/spacedChildren.tsx +134 -0
  62. package/src/types.ts +21 -0
  63. package/types/Spacer.d.ts +6 -0
  64. package/types/Spacer.d.ts.map +1 -0
  65. package/types/Unspaced.d.ts +8 -0
  66. package/types/Unspaced.d.ts.map +1 -0
  67. package/types/index.d.ts +5 -0
  68. package/types/index.d.ts.map +1 -0
  69. package/types/spacedChildren.d.ts +4 -0
  70. package/types/spacedChildren.d.ts.map +1 -0
  71. package/types/types.d.ts +19 -0
  72. package/types/types.d.ts.map +1 -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,64 @@
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 Spacer_exports = {};
22
+ __export(Spacer_exports, {
23
+ Spacer: () => Spacer
24
+ });
25
+ module.exports = __toCommonJS(Spacer_exports);
26
+ var import_web = require("@tamagui/web");
27
+ const getSpacerSize = (size, {
28
+ tokens
29
+ }) => {
30
+ size = size === !0 ? "$true" : size;
31
+ const sizePx = tokens.space[size] ?? size;
32
+ return {
33
+ width: sizePx,
34
+ height: sizePx,
35
+ minWidth: sizePx,
36
+ minHeight: sizePx
37
+ };
38
+ },
39
+ Spacer = (0, import_web.styled)(import_web.View, {
40
+ name: "Spacer",
41
+ pointerEvents: "none",
42
+ tag: "span",
43
+ variants: {
44
+ size: {
45
+ "...size": getSpacerSize,
46
+ "...": getSpacerSize
47
+ },
48
+ direction: {
49
+ horizontal: {
50
+ height: 0,
51
+ minHeight: 0
52
+ },
53
+ vertical: {
54
+ width: 0,
55
+ minWidth: 0
56
+ },
57
+ both: {}
58
+ }
59
+ },
60
+ defaultVariants: {
61
+ // @ts-ignore
62
+ size: !0
63
+ }
64
+ });
@@ -0,0 +1,56 @@
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)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var Spacer_exports = {};
16
+ __export(Spacer_exports, {
17
+ Spacer: () => Spacer
18
+ });
19
+ module.exports = __toCommonJS(Spacer_exports);
20
+ var import_web = require("@tamagui/web");
21
+ const getSpacerSize = (size, { tokens }) => {
22
+ size = size === !0 ? "$true" : size;
23
+ const sizePx = tokens.space[size] ?? size;
24
+ return {
25
+ width: sizePx,
26
+ height: sizePx,
27
+ minWidth: sizePx,
28
+ minHeight: sizePx
29
+ };
30
+ }, Spacer = (0, import_web.styled)(import_web.View, {
31
+ name: "Spacer",
32
+ pointerEvents: "none",
33
+ tag: "span",
34
+ variants: {
35
+ size: {
36
+ "...size": getSpacerSize,
37
+ "...": getSpacerSize
38
+ },
39
+ direction: {
40
+ horizontal: {
41
+ height: 0,
42
+ minHeight: 0
43
+ },
44
+ vertical: {
45
+ width: 0,
46
+ minWidth: 0
47
+ },
48
+ both: {}
49
+ }
50
+ },
51
+ defaultVariants: {
52
+ // @ts-ignore
53
+ size: !0
54
+ }
55
+ });
56
+ //# sourceMappingURL=Spacer.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Spacer.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAA8C;AAE9C,MAAM,gBAAgB,CAAC,MAAqC,EAAE,OAAO,MAAM;AACzE,SAAO,SAAS,KAAO,UAAU;AACjC,QAAM,SAAS,OAAO,MAAM,IAAW,KAAK;AAC5C,SAAO;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AACF,GAEa,aAAS,mBAAO,iBAAM;AAAA,EACjC,MAAM;AAAA,EACN,eAAe;AAAA,EACf,KAAK;AAAA,EAEL,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,WAAW;AAAA,MACX,OAAO;AAAA,IACT;AAAA,IAEA,WAAW;AAAA,MACT,YAAY;AAAA,QACV,QAAQ;AAAA,QACR,WAAW;AAAA,MACb;AAAA,MACA,UAAU;AAAA,QACR,OAAO;AAAA,QACP,UAAU;AAAA,MACZ;AAAA,MACA,MAAM,CAAC;AAAA,IACT;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA;AAAA,IAEf,MAAM;AAAA,EACR;AACF,CAAC;",
5
+ "names": []
6
+ }
@@ -0,0 +1,69 @@
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 Spacer_exports = {};
24
+ __export(Spacer_exports, {
25
+ Spacer: () => Spacer
26
+ });
27
+ module.exports = __toCommonJS(Spacer_exports);
28
+ var import_web = require("@tamagui/web"),
29
+ getSpacerSize = function (size, param) {
30
+ var {
31
+ tokens
32
+ } = param;
33
+ size = size === !0 ? "$true" : size;
34
+ var _tokens_space_size,
35
+ sizePx = (_tokens_space_size = tokens.space[size]) !== null && _tokens_space_size !== void 0 ? _tokens_space_size : size;
36
+ return {
37
+ width: sizePx,
38
+ height: sizePx,
39
+ minWidth: sizePx,
40
+ minHeight: sizePx
41
+ };
42
+ },
43
+ Spacer = (0, import_web.styled)(import_web.View, {
44
+ name: "Spacer",
45
+ pointerEvents: "none",
46
+ tag: "span",
47
+ variants: {
48
+ size: {
49
+ "...size": getSpacerSize,
50
+ "...": getSpacerSize
51
+ },
52
+ direction: {
53
+ horizontal: {
54
+ height: 0,
55
+ minHeight: 0
56
+ },
57
+ vertical: {
58
+ width: 0,
59
+ minWidth: 0
60
+ },
61
+ both: {}
62
+ }
63
+ },
64
+ defaultVariants: {
65
+ // @ts-ignore
66
+ size: !0
67
+ }
68
+ });
69
+ //# sourceMappingURL=Spacer.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Spacer_exports","__export","Spacer","module","exports","import_web","require","getSpacerSize","size","param","tokens","_tokens_space_size","sizePx","space","width","height","minWidth","minHeight","styled","View","name","pointerEvents","tag","variants","direction","horizontal","vertical","both","defaultVariants"],"sources":["../../src/Spacer.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;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAA8CT,YAAA,CAAAK,cAAA;AAE9C,IAAAK,UAAM,GAAAC,OAAiB,eAA8C;EAAAC,aAAM,YAAAA,CAAAC,IAAA,EAAAC,KAAA;IACzE;MAAAC;IAAO,IAASD,KAAO;IACvBD,IAAA,GAAMA,IAAA,KAAS,YAAa,GAAAA,IAAW;IACvC,IAAAG,kBAAO;MAAAC,MAAA,IAAAD,kBAAA,GAAAD,MAAA,CAAAG,KAAA,CAAAL,IAAA,eAAAG,kBAAA,cAAAA,kBAAA,GAAAH,IAAA;IAAA,OACL;MACAM,KAAA,EAAAF,MAAQ;MACRG,MAAA,EAAAH,MAAU;MACVI,QAAA,EAAAJ,MAAW;MACbK,SAAA,EAAAL;IACF,CAEa;EAAsB;EACjCV,MAAM,OAAAG,UAAA,CAAAa,MAAA,EAAAb,UAAA,CAAAc,IAAA;IACNC,IAAA;IACAC,aAAK;IAELC,GAAA,QAAU;IAAAC,QACF;MAAAf,IACJ;QACA,SAAO,EAAAD,aAAA;QACT,OAAAA;MAEA;MAAWiB,SACT;QAAYC,UACF;UACRV,MAAA;UACFE,SAAA;QACA;QAAUS,QACR,EAAO;UACPZ,KAAA;UACFE,QAAA;QACA;QACFW,IAAA;MACF;IAEA;IAAiBC,eAAA;MAEf;MACFpB,IAAA;IACD","ignoreList":[]}
@@ -0,0 +1,34 @@
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 Unspaced_exports = {};
22
+ __export(Unspaced_exports, {
23
+ Unspaced: () => Unspaced,
24
+ isUnspaced: () => isUnspaced
25
+ });
26
+ module.exports = __toCommonJS(Unspaced_exports);
27
+ function Unspaced(props) {
28
+ return props.children;
29
+ }
30
+ Unspaced.isUnspaced = !0;
31
+ function isUnspaced(child) {
32
+ const t = child?.type;
33
+ return t?.isVisuallyHidden || t?.isUnspaced;
34
+ }
@@ -0,0 +1,29 @@
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)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var Unspaced_exports = {};
16
+ __export(Unspaced_exports, {
17
+ Unspaced: () => Unspaced,
18
+ isUnspaced: () => isUnspaced
19
+ });
20
+ module.exports = __toCommonJS(Unspaced_exports);
21
+ function Unspaced(props) {
22
+ return props.children;
23
+ }
24
+ Unspaced.isUnspaced = !0;
25
+ function isUnspaced(child) {
26
+ const t = child?.type;
27
+ return t?.isVisuallyHidden || t?.isUnspaced;
28
+ }
29
+ //# sourceMappingURL=Unspaced.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Unspaced.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,SAAS,SAAS,OAA2B;AAClD,SAAO,MAAM;AACf;AAEA,SAAS,aAAgB;AAElB,SAAS,WAAW,OAAwB;AACjD,QAAM,IAAI,OAAQ;AAClB,SAAO,GAAI,oBAAuB,GAAI;AACxC;",
5
+ "names": []
6
+ }
@@ -0,0 +1,37 @@
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 Unspaced_exports = {};
24
+ __export(Unspaced_exports, {
25
+ Unspaced: () => Unspaced,
26
+ isUnspaced: () => isUnspaced
27
+ });
28
+ module.exports = __toCommonJS(Unspaced_exports);
29
+ function Unspaced(props) {
30
+ return props.children;
31
+ }
32
+ Unspaced.isUnspaced = !0;
33
+ function isUnspaced(child) {
34
+ var t = child?.type;
35
+ return t?.isVisuallyHidden || t?.isUnspaced;
36
+ }
37
+ //# sourceMappingURL=Unspaced.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Unspaced_exports","__export","Unspaced","isUnspaced","module","exports","props","children","child","t","type","isVisuallyHidden"],"sources":["../../src/Unspaced.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,gBAAA;AAAAC,QAAA,CAAAD,gBAAA;EAAAE,QAAA,EAAAA,CAAA,KAAAA,QAAA;EAAAC,UAAA,EAAAA,CAAA,KAAAA;AAAA;AACOC,MAAA,CAAAC,OAAS,GAAAV,YAAoC,CAAAK,gBAAA;AAClD,SAAOE,QAAMA,CAAAI,KAAA;EACf,OAAAA,KAAA,CAAAC,QAAA;AAEA;AAEOL,QAAA,CAASC,UAAA,GAAW;AACzB,SAAMA,UAAYA,CAAAK,KAAA;EAClB,IAAAC,CAAA,GAAOD,KAAI,EAAAE,IAAA;EACb,OAAAD,CAAA,EAAAE,gBAAA,IAAAF,CAAA,EAAAN,UAAA","ignoreList":[]}
@@ -0,0 +1,29 @@
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
+ __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
20
+ value: !0
21
+ }), mod);
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
+ spacedChildren: () => import_spacedChildren.spacedChildren
25
+ });
26
+ module.exports = __toCommonJS(index_exports);
27
+ var import_spacedChildren = require("./spacedChildren.cjs");
28
+ __reExport(index_exports, require("./Spacer.cjs"), module.exports);
29
+ __reExport(index_exports, require("./Unspaced.cjs"), module.exports);
@@ -0,0 +1,23 @@
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)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var index_exports = {};
16
+ __export(index_exports, {
17
+ spacedChildren: () => import_spacedChildren.spacedChildren
18
+ });
19
+ module.exports = __toCommonJS(index_exports);
20
+ var import_spacedChildren = require("./spacedChildren");
21
+ __reExport(index_exports, require("./Spacer"), module.exports);
22
+ __reExport(index_exports, require("./Unspaced"), module.exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;AAC/B,0BAAc,qBADd;AAEA,0BAAc,uBAFd;",
5
+ "names": []
6
+ }
@@ -0,0 +1,32 @@
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
+ __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
22
+ value: !0
23
+ }), mod);
24
+ var index_exports = {};
25
+ __export(index_exports, {
26
+ spacedChildren: () => import_spacedChildren.spacedChildren
27
+ });
28
+ module.exports = __toCommonJS(index_exports);
29
+ var import_spacedChildren = require("./spacedChildren.native.js");
30
+ __reExport(index_exports, require("./Spacer.native.js"), module.exports);
31
+ __reExport(index_exports, require("./Unspaced.native.js"), module.exports);
32
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","spacedChildren","import_spacedChildren","module","exports","require","__reExport"],"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,QAAA,CAAAD,aAAA;EAAAE,cAAA,EAAAA,CAAA,KAAAC,qBAAA,CAAAD;AAAA;AAAAE,MAAA,CAAAC,OAAA,GAAAV,YAA+B,CAAAK,aAAA;AAC/B,IAAAG,qBAAA,GAAcG,OAAA,6BADd;AAEAC,UAAA,CAAAP,aAAA,EAAcM,OAAA,wBAAAF,MAFd,CAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1,118 @@
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 spacedChildren_exports = {};
33
+ __export(spacedChildren_exports, {
34
+ spacedChildren: () => spacedChildren
35
+ });
36
+ module.exports = __toCommonJS(spacedChildren_exports);
37
+ var import_web = require("@tamagui/web"),
38
+ import_react = __toESM(require("react"), 1),
39
+ import_Spacer = require("./Spacer.cjs"),
40
+ import_Unspaced = require("./Unspaced.cjs"),
41
+ import_jsx_runtime = require("react/jsx-runtime");
42
+ function spacedChildren(props) {
43
+ const {
44
+ isZStack,
45
+ children,
46
+ space,
47
+ direction,
48
+ spaceFlex,
49
+ separator,
50
+ ensureKeys
51
+ } = props,
52
+ hasSpace = !!(space || spaceFlex),
53
+ hasSeparator = separator != null,
54
+ areChildrenArray = Array.isArray(children);
55
+ if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) return children;
56
+ const childrenList = areChildrenArray ? children : import_react.default.Children.toArray(children);
57
+ if (childrenList.length <= 1 && !isZStack && !childrenList[0]?.type?.shouldForwardSpace) return children;
58
+ const final = [];
59
+ for (let [index, child] of childrenList.entries()) {
60
+ const isEmpty = child == null || Array.isArray(child) && child.length === 0;
61
+ if (!isEmpty && import_react.default.isValidElement(child) && child.type?.shouldForwardSpace && (child = import_react.default.cloneElement(child, {
62
+ space,
63
+ spaceFlex,
64
+ separator,
65
+ key: child.key
66
+ })), isEmpty || !child || child.key && !isZStack ? final.push(child) : final.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.default.Fragment, {
67
+ children: isZStack ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(AbsoluteFill, {
68
+ children: child
69
+ }) : child
70
+ }, `${index}0t`)), (0, import_Unspaced.isUnspaced)(child) && index === 0 || isZStack) continue;
71
+ const next = childrenList[index + 1];
72
+ next && !isEmpty && !(0, import_Unspaced.isUnspaced)(next) && (separator ? (hasSpace && final.push(createSpacer({
73
+ key: `_${index}_00t`,
74
+ direction,
75
+ space,
76
+ spaceFlex
77
+ })), final.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.default.Fragment, {
78
+ children: separator
79
+ }, `${index}03t`)), hasSpace && final.push(createSpacer({
80
+ key: `_${index}01t`,
81
+ direction,
82
+ space,
83
+ spaceFlex
84
+ }))) : final.push(createSpacer({
85
+ key: `_${index}02t`,
86
+ direction,
87
+ space,
88
+ spaceFlex
89
+ })));
90
+ }
91
+ return process.env.NODE_ENV === "development" && props.debug && console.info(" Spaced children", final, props), final;
92
+ }
93
+ function createSpacer({
94
+ key,
95
+ direction,
96
+ space,
97
+ spaceFlex
98
+ }) {
99
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Spacer.Spacer, {
100
+ size: space,
101
+ direction,
102
+ ...(typeof spaceFlex < "u" && {
103
+ flex: spaceFlex === !0 ? 1 : spaceFlex === !1 ? 0 : spaceFlex
104
+ })
105
+ }, key);
106
+ }
107
+ const AbsoluteFill = (0, import_web.createComponent)({
108
+ defaultProps: {
109
+ ...import_web.stackDefaultStyles,
110
+ flexDirection: "column",
111
+ position: "absolute",
112
+ top: 0,
113
+ right: 0,
114
+ bottom: 0,
115
+ left: 0,
116
+ pointerEvents: "box-none"
117
+ }
118
+ });
@@ -0,0 +1,98 @@
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, __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
+ // If the importer is in node compatibility mode or this is not an ESM
17
+ // file that has been converted to a CommonJS file using a Babel-
18
+ // compatible transform (i.e. "__esModule" has not been set), then set
19
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
+ mod
22
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
+ var spacedChildren_exports = {};
24
+ __export(spacedChildren_exports, {
25
+ spacedChildren: () => spacedChildren
26
+ });
27
+ module.exports = __toCommonJS(spacedChildren_exports);
28
+ var import_web = require("@tamagui/web"), import_react = __toESM(require("react"), 1), import_Spacer = require("./Spacer"), import_Unspaced = require("./Unspaced"), import_jsx_runtime = require("react/jsx-runtime");
29
+ function spacedChildren(props) {
30
+ const { isZStack, children, space, direction, spaceFlex, separator, ensureKeys } = props, hasSpace = !!(space || spaceFlex), hasSeparator = separator != null, areChildrenArray = Array.isArray(children);
31
+ if (!ensureKeys && !(hasSpace || hasSeparator || isZStack))
32
+ return children;
33
+ const childrenList = areChildrenArray ? children : import_react.default.Children.toArray(children);
34
+ if (childrenList.length <= 1 && !isZStack && !childrenList[0]?.type?.shouldForwardSpace)
35
+ return children;
36
+ const final = [];
37
+ for (let [index, child] of childrenList.entries()) {
38
+ const isEmpty = child == null || Array.isArray(child) && child.length === 0;
39
+ if (!isEmpty && import_react.default.isValidElement(child) && child.type?.shouldForwardSpace && (child = import_react.default.cloneElement(child, {
40
+ space,
41
+ spaceFlex,
42
+ separator,
43
+ key: child.key
44
+ })), isEmpty || !child || child.key && !isZStack ? final.push(child) : final.push(
45
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: isZStack ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AbsoluteFill, { children: child }) : child }, `${index}0t`)
46
+ ), (0, import_Unspaced.isUnspaced)(child) && index === 0 || isZStack) continue;
47
+ const next = childrenList[index + 1];
48
+ next && !isEmpty && !(0, import_Unspaced.isUnspaced)(next) && (separator ? (hasSpace && final.push(
49
+ createSpacer({
50
+ key: `_${index}_00t`,
51
+ direction,
52
+ space,
53
+ spaceFlex
54
+ })
55
+ ), final.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: separator }, `${index}03t`)), hasSpace && final.push(
56
+ createSpacer({
57
+ key: `_${index}01t`,
58
+ direction,
59
+ space,
60
+ spaceFlex
61
+ })
62
+ )) : final.push(
63
+ createSpacer({
64
+ key: `_${index}02t`,
65
+ direction,
66
+ space,
67
+ spaceFlex
68
+ })
69
+ ));
70
+ }
71
+ return process.env.NODE_ENV === "development" && props.debug && console.info(" Spaced children", final, props), final;
72
+ }
73
+ function createSpacer({ key, direction, space, spaceFlex }) {
74
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
+ import_Spacer.Spacer,
76
+ {
77
+ size: space,
78
+ direction,
79
+ ...typeof spaceFlex < "u" && {
80
+ flex: spaceFlex === !0 ? 1 : spaceFlex === !1 ? 0 : spaceFlex
81
+ }
82
+ },
83
+ key
84
+ );
85
+ }
86
+ const AbsoluteFill = (0, import_web.createComponent)({
87
+ defaultProps: {
88
+ ...import_web.stackDefaultStyles,
89
+ flexDirection: "column",
90
+ position: "absolute",
91
+ top: 0,
92
+ right: 0,
93
+ bottom: 0,
94
+ left: 0,
95
+ pointerEvents: "box-none"
96
+ }
97
+ });
98
+ //# sourceMappingURL=spacedChildren.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/spacedChildren.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAoD,yBACpD,eAAkB,8BAClB,gBAAuB,qBACvB,kBAA2B,uBA6CL;AA1Cf,SAAS,eAAe,OAA4B;AACzD,QAAM,EAAE,UAAU,UAAU,OAAO,WAAW,WAAW,WAAW,WAAW,IAAI,OAC7E,WAAW,CAAC,EAAE,SAAS,YACvB,eAA4C,aAAc,MAC1D,mBAAmB,MAAM,QAAQ,QAAQ;AAE/C,MAAI,CAAC,cAAc,EAAE,YAAY,gBAAgB;AAC/C,WAAO;AAGT,QAAM,eAAe,mBAChB,WACD,aAAAA,QAAM,SAAS,QAAQ,QAAQ;AAGnC,MADY,aAAa,UACd,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,GAAI,MAAU;AACxD,WAAO;AAGT,QAAM,QAA2B,CAAC;AAClC,WAAS,CAAC,OAAO,KAAK,KAAK,aAAa,QAAQ,GAAG;AACjD,UAAM,UACJ,SAAU,QAET,MAAM,QAAQ,KAAK,KAAK,MAAM,WAAW;AA0B5C,QAvBI,CAAC,WAAW,aAAAA,QAAM,eAAe,KAAK,KAAK,MAAM,MAAO,uBAC1D,QAAQ,aAAAA,QAAM,aAAa,OAAO;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA,KAAK,MAAM;AAAA,IACb,CAAQ,IAIN,WAAW,CAAC,SAAU,MAAM,OAAU,CAAC,WACzC,MAAM,KAAK,KAAK,IAEhB,MAAM;AAAA,MACJ,4CAAC,aAAAA,QAAM,UAAN,EACE,qBAAW,4CAAC,gBAAc,iBAAM,IAAkB,SADhC,GAAG,KAAK,IAE7B;AAAA,IACF,OAIE,4BAAW,KAAK,KAAK,UAAU,KAE/B,SAAU;AAEd,UAAM,OAAO,aAAa,QAAQ,CAAC;AAEnC,IAAI,QAAQ,CAAC,WAAW,KAAC,4BAAW,IAAI,MAClC,aACE,YACF,MAAM;AAAA,MACJ,aAAa;AAAA,QACX,KAAK,IAAI,KAAK;AAAA,QACd;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH,GAEF,MAAM,KAAK,4CAAC,aAAAA,QAAM,UAAN,EAAoC,uBAAhB,GAAG,KAAK,KAAkB,CAAiB,GACvE,YACF,MAAM;AAAA,MACJ,aAAa;AAAA,QACX,KAAK,IAAI,KAAK;AAAA,QACd;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH,KAGF,MAAM;AAAA,MACJ,aAAa;AAAA,QACX,KAAK,IAAI,KAAK;AAAA,QACd;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EAGN;AAEA,SAAI,QAAQ,IAAI,aAAa,iBACvB,MAAM,SACR,QAAQ,KAAK,qBAAqB,OAAO,KAAK,GAI3C;AACT;AAIA,SAAS,aAAa,EAAE,KAAK,WAAW,OAAO,UAAU,GAAsB;AAC7E,SACE;AAAA,IAAC;AAAA;AAAA,MAGC,MAAM;AAAA,MAEN;AAAA,MACC,GAAI,OAAO,YAAc,OAAe;AAAA,QACvC,MAAM,cAAc,KAAO,IAAI,cAAc,KAAQ,IAAI;AAAA,MAC3D;AAAA;AAAA,IAPK;AAAA,EAQP;AAEJ;AAEA,MAAM,mBAAoB,4BAAgB;AAAA,EACxC,cAAc;AAAA,IACZ,GAAG;AAAA,IACH,eAAe;AAAA,IACf,UAAU;AAAA,IACV,KAAK;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,eAAe;AAAA,EACjB;AACF,CAAC;",
5
+ "names": ["React"]
6
+ }