@tamagui/spacer 2.0.0-rc.4 → 2.0.0-rc.40

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 (49) hide show
  1. package/dist/cjs/Spacer.cjs +47 -45
  2. package/dist/cjs/Spacer.native.js +51 -49
  3. package/dist/cjs/Spacer.native.js.map +1 -1
  4. package/dist/cjs/Unspaced.cjs +15 -13
  5. package/dist/cjs/Unspaced.native.js +15 -13
  6. package/dist/cjs/Unspaced.native.js.map +1 -1
  7. package/dist/cjs/index.cjs +13 -11
  8. package/dist/cjs/index.native.js +13 -11
  9. package/dist/cjs/index.native.js.map +1 -1
  10. package/dist/cjs/spacedChildren.cjs +106 -73
  11. package/dist/cjs/spacedChildren.native.js +122 -87
  12. package/dist/cjs/spacedChildren.native.js.map +1 -1
  13. package/dist/cjs/types.cjs +7 -5
  14. package/dist/cjs/types.native.js +7 -5
  15. package/dist/cjs/types.native.js.map +1 -1
  16. package/dist/esm/Spacer.mjs +35 -35
  17. package/dist/esm/Spacer.mjs.map +1 -1
  18. package/dist/esm/Spacer.native.js +37 -37
  19. package/dist/esm/Spacer.native.js.map +1 -1
  20. package/dist/esm/Unspaced.mjs +3 -3
  21. package/dist/esm/Unspaced.mjs.map +1 -1
  22. package/dist/esm/Unspaced.native.js +3 -3
  23. package/dist/esm/Unspaced.native.js.map +1 -1
  24. package/dist/esm/index.js +4 -6
  25. package/dist/esm/index.js.map +1 -6
  26. package/dist/esm/spacedChildren.mjs +78 -47
  27. package/dist/esm/spacedChildren.mjs.map +1 -1
  28. package/dist/esm/spacedChildren.native.js +94 -61
  29. package/dist/esm/spacedChildren.native.js.map +1 -1
  30. package/package.json +7 -10
  31. package/src/spacedChildren.tsx +2 -2
  32. package/dist/cjs/Spacer.js +0 -56
  33. package/dist/cjs/Spacer.js.map +0 -6
  34. package/dist/cjs/Unspaced.js +0 -29
  35. package/dist/cjs/Unspaced.js.map +0 -6
  36. package/dist/cjs/index.js +0 -23
  37. package/dist/cjs/index.js.map +0 -6
  38. package/dist/cjs/spacedChildren.js +0 -98
  39. package/dist/cjs/spacedChildren.js.map +0 -6
  40. package/dist/cjs/types.js +0 -14
  41. package/dist/cjs/types.js.map +0 -6
  42. package/dist/esm/Spacer.js +0 -40
  43. package/dist/esm/Spacer.js.map +0 -6
  44. package/dist/esm/Unspaced.js +0 -13
  45. package/dist/esm/Unspaced.js.map +0 -6
  46. package/dist/esm/spacedChildren.js +0 -78
  47. package/dist/esm/spacedChildren.js.map +0 -6
  48. package/dist/esm/types.js +0 -1
  49. package/dist/esm/types.js.map +0 -6
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
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, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var Spacer_exports = {};
22
24
  __export(Spacer_exports, {
@@ -25,40 +27,40 @@ __export(Spacer_exports, {
25
27
  module.exports = __toCommonJS(Spacer_exports);
26
28
  var import_web = require("@tamagui/web");
27
29
  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
- render: "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
- }
30
+ tokens
31
+ }) => {
32
+ size = size === true ? "$true" : size;
33
+ const sizePx = tokens.space[size] ?? size;
34
+ return {
35
+ width: sizePx,
36
+ height: sizePx,
37
+ minWidth: sizePx,
38
+ minHeight: sizePx
39
+ };
40
+ };
41
+ const Spacer = (0, import_web.styled)(import_web.View, {
42
+ name: "Spacer",
43
+ pointerEvents: "none",
44
+ render: "span",
45
+ variants: {
46
+ size: {
47
+ "...size": getSpacerSize,
48
+ "...": getSpacerSize
59
49
  },
60
- defaultVariants: {
61
- // @ts-ignore
62
- size: !0
50
+ direction: {
51
+ horizontal: {
52
+ height: 0,
53
+ minHeight: 0
54
+ },
55
+ vertical: {
56
+ width: 0,
57
+ minWidth: 0
58
+ },
59
+ both: {}
63
60
  }
64
- });
61
+ },
62
+ defaultVariants: {
63
+ // @ts-ignore
64
+ size: true
65
+ }
66
+ });
@@ -5,65 +5,67 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !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, {
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, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: !0
23
+ value: true
22
24
  }), mod);
23
25
  var Spacer_exports = {};
24
26
  __export(Spacer_exports, {
25
27
  Spacer: () => Spacer
26
28
  });
27
29
  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
- render: "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
- }
30
+ var import_web = require("@tamagui/web");
31
+ var getSpacerSize = function (size, param) {
32
+ var {
33
+ tokens
34
+ } = param;
35
+ size = size === true ? "$true" : size;
36
+ var _tokens_space_size;
37
+ var sizePx = (_tokens_space_size = tokens.space[size]) !== null && _tokens_space_size !== void 0 ? _tokens_space_size : size;
38
+ return {
39
+ width: sizePx,
40
+ height: sizePx,
41
+ minWidth: sizePx,
42
+ minHeight: sizePx
43
+ };
44
+ };
45
+ var Spacer = (0, import_web.styled)(import_web.View, {
46
+ name: "Spacer",
47
+ pointerEvents: "none",
48
+ render: "span",
49
+ variants: {
50
+ size: {
51
+ "...size": getSpacerSize,
52
+ "...": getSpacerSize
63
53
  },
64
- defaultVariants: {
65
- // @ts-ignore
66
- size: !0
54
+ direction: {
55
+ horizontal: {
56
+ height: 0,
57
+ minHeight: 0
58
+ },
59
+ vertical: {
60
+ width: 0,
61
+ minWidth: 0
62
+ },
63
+ both: {}
67
64
  }
68
- });
65
+ },
66
+ defaultVariants: {
67
+ // @ts-ignore
68
+ size: true
69
+ }
70
+ });
69
71
  //# sourceMappingURL=Spacer.native.js.map
@@ -1 +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","render","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,aAAQ;IAERC,MAAA,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":[]}
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","render","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;AACnE,IAAAC,aAAO,GAAS,SAAAA,CAAOC,IAAA,EAAUC,KAAA;EACjC;IAAMC;EAAA,IAASD,KAAO;EACtBD,IAAA,GAAOA,IAAA,sBAAAA,IAAA;EAAA,IACLG,kBAAO;EAAA,IACPC,MAAQ,IAAAD,kBAAA,GAAAD,MAAA,CAAAG,KAAA,CAAAL,IAAA,eAAAG,kBAAA,cAAAA,kBAAA,GAAAH,IAAA;EAAA,OACR;IACAM,KAAA,EAAAF,MAAW;IACbG,MAAA,EAAAH,MAAA;IACFI,QAAA,EAAAJ,MAAA;IAEOK,SAAM,EAAAL;EACX;AAAM;AACS,IACfV,MAAQ,OAAAG,UAAA,CAAAa,MAAA,EAAAb,UAAA,CAAAc,IAAA;EAERC,IAAA,UAAU;EAAAC,aACF;EAAAC,MACJ;EAAWC,QACX;IACFf,IAAA;MAEA,SAAW,EAAAD,aAAA;MACT,OAAAA;IAAY;IACFiB,SACR;MACFC,UAAA;QACAV,MAAA,EAAU;QACRE,SAAO;MAAA;MAETS,QAAA;QACAZ,KAAO;QACTE,QAAA;MACF;MAEAW,IAAA;IAAiB;EAAA;EAGjBC,eAAA;IACD","ignoreList":[]}
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
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, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var Unspaced_exports = {};
22
24
  __export(Unspaced_exports, {
@@ -27,8 +29,8 @@ module.exports = __toCommonJS(Unspaced_exports);
27
29
  function Unspaced(props) {
28
30
  return props.children;
29
31
  }
30
- Unspaced.isUnspaced = !0;
32
+ Unspaced["isUnspaced"] = true;
31
33
  function isUnspaced(child) {
32
- const t = child?.type;
33
- return t?.isVisuallyHidden || t?.isUnspaced;
34
+ const t = child?.["type"];
35
+ return t?.["isVisuallyHidden"] || t?.["isUnspaced"];
34
36
  }
@@ -5,20 +5,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !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, {
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, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: !0
23
+ value: true
22
24
  }), mod);
23
25
  var Unspaced_exports = {};
24
26
  __export(Unspaced_exports, {
@@ -29,9 +31,9 @@ module.exports = __toCommonJS(Unspaced_exports);
29
31
  function Unspaced(props) {
30
32
  return props.children;
31
33
  }
32
- Unspaced.isUnspaced = !0;
34
+ Unspaced["isUnspaced"] = true;
33
35
  function isUnspaced(child) {
34
- var t = child?.type;
35
- return t?.isVisuallyHidden || t?.isUnspaced;
36
+ var t = child === null || child === void 0 ? void 0 : child["type"];
37
+ return (t === null || t === void 0 ? void 0 : t["isVisuallyHidden"]) || (t === null || t === void 0 ? void 0 : t["isUnspaced"]);
36
38
  }
37
39
  //# sourceMappingURL=Unspaced.native.js.map
@@ -1 +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":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Unspaced_exports","__export","Unspaced","isUnspaced","module","exports","props","children","child","t"],"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,CAAS,YAAW,QAAwB;AACjD,SAAMC,UAAIA,CAAQK,KAAA,EAAM;EACxB,IAAAC,CAAA,GAAOD,KAAI,aAAAA,KAAkB,KAAK,KAAI,SAAY,IAAAA,KAAA;EACpD,QAAAC,CAAA,aAAAA,CAAA,uBAAAA,CAAA,0BAAAA,CAAA,aAAAA,CAAA,uBAAAA,CAAA","ignoreList":[]}
@@ -3,21 +3,23 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
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, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- },
18
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
+ }
18
+ return to;
19
+ };
20
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
21
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
20
- value: !0
22
+ value: true
21
23
  }), mod);
22
24
  var index_exports = {};
23
25
  __export(index_exports, {
@@ -5,21 +5,23 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !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, {
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, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- },
20
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
+ }
20
+ return to;
21
+ };
22
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
23
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
22
- value: !0
24
+ value: true
23
25
  }), mod);
24
26
  var index_exports = {};
25
27
  __export(index_exports, {
@@ -1 +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":[]}
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":[]}
@@ -2,93 +2,126 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !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, {
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, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  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);
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: true
30
+ }) : target, mod));
31
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: true
33
+ }), mod);
32
34
  var spacedChildren_exports = {};
33
35
  __export(spacedChildren_exports, {
34
36
  spacedChildren: () => spacedChildren
35
37
  });
36
38
  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");
39
+ var import_web = require("@tamagui/web");
40
+ var import_react = __toESM(require("react"), 1);
41
+ var import_Spacer = require("./Spacer.cjs");
42
+ var import_Unspaced = require("./Unspaced.cjs");
43
+ var import_jsx_runtime = require("react/jsx-runtime");
42
44
  function spacedChildren(props) {
43
45
  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;
46
+ isZStack,
47
+ children,
48
+ space,
49
+ direction,
50
+ spaceFlex,
51
+ separator,
52
+ ensureKeys
53
+ } = props;
54
+ const hasSpace = !!(space || spaceFlex);
55
+ const hasSeparator = !(separator === void 0 || separator === null);
56
+ const areChildrenArray = Array.isArray(children);
57
+ if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) {
58
+ return children;
59
+ }
56
60
  const childrenList = areChildrenArray ? children : import_react.default.Children.toArray(children);
57
- if (childrenList.length <= 1 && !isZStack && !childrenList[0]?.type?.shouldForwardSpace) return children;
61
+ const len = childrenList.length;
62
+ if (len <= 1 && !isZStack && !childrenList[0]?.["type"]?.["shouldForwardSpace"]) {
63
+ return children;
64
+ }
58
65
  const final = [];
59
66
  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;
67
+ const isEmpty = child === null || child === void 0 || Array.isArray(child) && child.length === 0;
68
+ if (!isEmpty && import_react.default.isValidElement(child) && child.type?.["shouldForwardSpace"]) {
69
+ child = import_react.default.cloneElement(child, {
70
+ space,
71
+ spaceFlex,
72
+ separator,
73
+ key: child.key
74
+ });
75
+ }
76
+ if (isEmpty || !child || child["key"] && !isZStack) {
77
+ final.push(child);
78
+ } else {
79
+ final.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.default.Fragment, {
80
+ children: isZStack ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(AbsoluteFill, {
81
+ children: child
82
+ }) : child
83
+ }, `${index}0t`));
84
+ }
85
+ if ((0, import_Unspaced.isUnspaced)(child) && index === 0) continue;
86
+ if (isZStack) continue;
71
87
  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
- })));
88
+ if (next && !isEmpty && !(0, import_Unspaced.isUnspaced)(next)) {
89
+ if (separator) {
90
+ if (hasSpace) {
91
+ final.push(createSpacer({
92
+ key: `_${index}_00t`,
93
+ direction,
94
+ space,
95
+ spaceFlex
96
+ }));
97
+ }
98
+ final.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.default.Fragment, {
99
+ children: separator
100
+ }, `${index}03t`));
101
+ if (hasSpace) {
102
+ final.push(createSpacer({
103
+ key: `_${index}01t`,
104
+ direction,
105
+ space,
106
+ spaceFlex
107
+ }));
108
+ }
109
+ } else {
110
+ final.push(createSpacer({
111
+ key: `_${index}02t`,
112
+ direction,
113
+ space,
114
+ spaceFlex
115
+ }));
116
+ }
117
+ }
118
+ }
119
+ if (process.env.NODE_ENV === "development") {
120
+ if (props.debug) {
121
+ console.info(` Spaced children`, final, props);
122
+ }
90
123
  }
91
- return process.env.NODE_ENV === "development" && props.debug && console.info(" Spaced children", final, props), final;
124
+ return final;
92
125
  }
93
126
  function createSpacer({
94
127
  key,
@@ -99,14 +132,14 @@ function createSpacer({
99
132
  return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Spacer.Spacer, {
100
133
  size: space,
101
134
  direction,
102
- ...(typeof spaceFlex < "u" && {
103
- flex: spaceFlex === !0 ? 1 : spaceFlex === !1 ? 0 : spaceFlex
135
+ ...(typeof spaceFlex !== "undefined" && {
136
+ flex: spaceFlex === true ? 1 : spaceFlex === false ? 0 : spaceFlex
104
137
  })
105
138
  }, key);
106
139
  }
107
140
  const AbsoluteFill = (0, import_web.createComponent)({
108
141
  defaultProps: {
109
- ...import_web.viewDefaultStyles,
142
+ display: "flex",
110
143
  flexDirection: "column",
111
144
  position: "absolute",
112
145
  top: 0,