@tamagui/spacer 3.0.0-beta.924.1 → 3.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.
- package/dist/cjs/Spacer.cjs +3 -4
- package/dist/cjs/Spacer.native.cjs +3 -6
- package/dist/cjs/Spacer.native.js +3 -6
- package/dist/cjs/Spacer.native.js.map +1 -1
- package/dist/cjs/index.cjs +0 -9
- package/dist/cjs/index.native.cjs +0 -9
- package/dist/cjs/index.native.js +0 -9
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/Spacer.mjs +3 -4
- package/dist/esm/Spacer.mjs.map +1 -1
- package/dist/esm/Spacer.native.js +3 -6
- package/dist/esm/Spacer.native.js.map +1 -1
- package/dist/esm/index.js +0 -6
- package/dist/esm/index.mjs +0 -6
- package/dist/esm/index.native.js +0 -6
- package/package.json +7 -6
- package/src/Spacer.tsx +14 -13
- package/src/index.ts +0 -3
- package/types/Spacer.d.ts +5 -5
- package/types/Spacer.d.ts.map +1 -1
- package/types/index.d.ts +0 -3
- package/types/index.d.ts.map +1 -1
- package/dist/cjs/Unspaced.cjs +0 -34
- package/dist/cjs/Unspaced.native.cjs +0 -36
- package/dist/cjs/Unspaced.native.js +0 -38
- package/dist/cjs/Unspaced.native.js.map +0 -1
- package/dist/cjs/spacedChildren.cjs +0 -119
- package/dist/cjs/spacedChildren.native.cjs +0 -141
- package/dist/cjs/spacedChildren.native.js +0 -143
- package/dist/cjs/spacedChildren.native.js.map +0 -1
- package/dist/cjs/types.cjs +0 -16
- package/dist/cjs/types.native.cjs +0 -18
- package/dist/cjs/types.native.js +0 -20
- package/dist/cjs/types.native.js.map +0 -1
- package/dist/esm/Unspaced.mjs +0 -11
- package/dist/esm/Unspaced.mjs.map +0 -1
- package/dist/esm/Unspaced.native.js +0 -11
- package/dist/esm/Unspaced.native.js.map +0 -1
- package/dist/esm/spacedChildren.mjs +0 -94
- package/dist/esm/spacedChildren.mjs.map +0 -1
- package/dist/esm/spacedChildren.native.js +0 -114
- package/dist/esm/spacedChildren.native.js.map +0 -1
- package/dist/esm/types.mjs +0 -0
- package/dist/esm/types.native.js +0 -0
- package/src/Unspaced.tsx +0 -11
- package/src/spacedChildren.tsx +0 -134
- package/src/types.ts +0 -21
- package/types/Unspaced.d.ts +0 -9
- package/types/Unspaced.d.ts.map +0 -1
- package/types/spacedChildren.d.ts +0 -4
- package/types/spacedChildren.d.ts.map +0 -1
- package/types/types.d.ts +0 -19
- package/types/types.d.ts.map +0 -1
package/dist/cjs/Spacer.cjs
CHANGED
|
@@ -21,11 +21,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var Spacer_exports = {};
|
|
22
22
|
__export(Spacer_exports, { Spacer: () => Spacer });
|
|
23
23
|
module.exports = __toCommonJS(Spacer_exports);
|
|
24
|
-
var import_size = require("@tamagui/size");
|
|
25
24
|
var import_web = require("@tamagui/web");
|
|
26
|
-
const getSpacerSize = import_web.styled.dynamic((size,
|
|
27
|
-
|
|
28
|
-
const sizePx = tokens.space[
|
|
25
|
+
const getSpacerSize = import_web.styled.dynamic((size, env) => {
|
|
26
|
+
if (size === false) return;
|
|
27
|
+
const sizePx = typeof size === "number" ? size : env.tokens.space[size === true ? "4" : String(size).replace(/^\$/, "")];
|
|
29
28
|
return {
|
|
30
29
|
width: sizePx,
|
|
31
30
|
height: sizePx,
|
|
@@ -23,13 +23,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
23
23
|
var Spacer_exports = {};
|
|
24
24
|
__export(Spacer_exports, { Spacer: () => Spacer });
|
|
25
25
|
module.exports = __toCommonJS(Spacer_exports);
|
|
26
|
-
var import_size = require("@tamagui/size");
|
|
27
26
|
var import_web = require("@tamagui/web");
|
|
28
|
-
var getSpacerSize = import_web.styled.dynamic(function(size,
|
|
29
|
-
|
|
30
|
-
var
|
|
31
|
-
var _tokens_space_sizeToken;
|
|
32
|
-
var sizePx = (_tokens_space_sizeToken = tokens.space[sizeToken]) !== null && _tokens_space_sizeToken !== void 0 ? _tokens_space_sizeToken : sizeToken;
|
|
27
|
+
var getSpacerSize = import_web.styled.dynamic(function(size, env) {
|
|
28
|
+
if (size === false) return;
|
|
29
|
+
var sizePx = typeof size === "number" ? size : env.tokens.space[size === true ? "4" : String(size).replace(/^\$/, "")];
|
|
33
30
|
return {
|
|
34
31
|
width: sizePx,
|
|
35
32
|
height: sizePx,
|
|
@@ -23,13 +23,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
23
23
|
var Spacer_exports = {};
|
|
24
24
|
__export(Spacer_exports, { Spacer: () => Spacer });
|
|
25
25
|
module.exports = __toCommonJS(Spacer_exports);
|
|
26
|
-
var import_size = require("@tamagui/size");
|
|
27
26
|
var import_web = require("@tamagui/web");
|
|
28
|
-
var getSpacerSize = import_web.styled.dynamic(function(size,
|
|
29
|
-
|
|
30
|
-
var
|
|
31
|
-
var _tokens_space_sizeToken;
|
|
32
|
-
var sizePx = (_tokens_space_sizeToken = tokens.space[sizeToken]) !== null && _tokens_space_sizeToken !== void 0 ? _tokens_space_sizeToken : sizeToken;
|
|
27
|
+
var getSpacerSize = import_web.styled.dynamic(function(size, env) {
|
|
28
|
+
if (size === false) return;
|
|
29
|
+
var sizePx = typeof size === "number" ? size : env.tokens.space[size === true ? "4" : String(size).replace(/^\$/, "")];
|
|
33
30
|
return {
|
|
34
31
|
width: sizePx,
|
|
35
32
|
height: sizePx,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spacer.native.js","names":[],"sources":["cjs/Spacer.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Spacer_exports = {};\n__export(Spacer_exports, {\n Spacer: () => Spacer\n});\nmodule.exports = __toCommonJS(Spacer_exports);\nvar
|
|
1
|
+
{"version":3,"file":"Spacer.native.js","names":[],"sources":["cjs/Spacer.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Spacer_exports = {};\n__export(Spacer_exports, {\n Spacer: () => Spacer\n});\nmodule.exports = __toCommonJS(Spacer_exports);\nvar import_web = require(\"@tamagui/web\");\nvar getSpacerSize = import_web.styled.dynamic(function(size, env) {\n if (size === false) return;\n var sizePx = typeof size === \"number\" ? size : env.tokens.space[size === true ? \"4\" : String(size).replace(/^\\$/, \"\")];\n return {\n width: sizePx,\n height: sizePx,\n minWidth: sizePx,\n minHeight: sizePx\n };\n});\nvar Spacer = (0, import_web.styled)(import_web.View, {\n displayName: \"Spacer\",\n pointerEvents: \"none\",\n render: \"span\",\n variants: {\n size: getSpacerSize,\n direction: {\n horizontal: {\n height: 0,\n minHeight: 0\n },\n vertical: {\n width: 0,\n minWidth: 0\n },\n both: {}\n }\n },\n defaultVariants: {\n // @ts-ignore\n size: true\n }\n});\n//# sourceMappingURL=Spacer.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,iBAAiB,CAAC;AACtB,SAAS,gBAAgB,EACvB,cAAc,OAChB,CAAC;AACD,OAAO,UAAU,aAAa,cAAc;AAC5C,IAAI,aAAa,QAAQ,cAAc;AACvC,IAAI,gBAAgB,WAAW,OAAO,QAAQ,SAAS,MAAM,KAAK;CAChE,IAAI,SAAS,OAAO;CACpB,IAAI,SAAS,OAAO,SAAS,WAAW,OAAO,IAAI,OAAO,MAAM,SAAS,OAAO,MAAM,OAAO,IAAI,CAAC,CAAC,QAAQ,OAAO,EAAE;CACpH,OAAO;EACL,OAAO;EACP,QAAQ;EACR,UAAU;EACV,WAAW;CACb;AACF,CAAC;AACD,IAAI,UAAU,GAAG,WAAW,OAAM,CAAE,WAAW,MAAM;CACnD,aAAa;CACb,eAAe;CACf,QAAQ;CACR,UAAU;EACR,MAAM;EACN,WAAW;GACT,YAAY;IACV,QAAQ;IACR,WAAW;GACb;GACA,UAAU;IACR,OAAO;IACP,UAAU;GACZ;GACA,MAAM,CAAC;EACT;CACF;CACA,iBAAiB,EAEf,MAAM,KACR;AACF,CAAC"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -2,12 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
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: true
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
5
|
var __copyProps = (to, from, except, desc) => {
|
|
12
6
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
7
|
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
@@ -20,8 +14,5 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
20
14
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
15
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
16
|
var index_exports = {};
|
|
23
|
-
__export(index_exports, { spacedChildren: () => import_spacedChildren.spacedChildren });
|
|
24
17
|
module.exports = __toCommonJS(index_exports);
|
|
25
|
-
var import_spacedChildren = require("./spacedChildren.cjs");
|
|
26
18
|
__reExport(index_exports, require("./Spacer.cjs"), module.exports);
|
|
27
|
-
__reExport(index_exports, require("./Unspaced.cjs"), module.exports);
|
|
@@ -4,12 +4,6 @@ var __defProp = Object.defineProperty;
|
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
7
|
var __copyProps = (to, from, except, desc) => {
|
|
14
8
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
9
|
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
@@ -22,8 +16,5 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
22
16
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
23
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
18
|
var index_exports = {};
|
|
25
|
-
__export(index_exports, { spacedChildren: () => import_spacedChildren.spacedChildren });
|
|
26
19
|
module.exports = __toCommonJS(index_exports);
|
|
27
|
-
var import_spacedChildren = require("./spacedChildren.native.js");
|
|
28
20
|
__reExport(index_exports, require("./Spacer.native.js"), module.exports);
|
|
29
|
-
__reExport(index_exports, require("./Unspaced.native.js"), module.exports);
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -4,12 +4,6 @@ var __defProp = Object.defineProperty;
|
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
7
|
var __copyProps = (to, from, except, desc) => {
|
|
14
8
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
9
|
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
@@ -22,10 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
22
16
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
23
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
18
|
var index_exports = {};
|
|
25
|
-
__export(index_exports, { spacedChildren: () => import_spacedChildren.spacedChildren });
|
|
26
19
|
module.exports = __toCommonJS(index_exports);
|
|
27
|
-
var import_spacedChildren = require("./spacedChildren.native.js");
|
|
28
20
|
__reExport(index_exports, require("./Spacer.native.js"), module.exports);
|
|
29
|
-
__reExport(index_exports, require("./Unspaced.native.js"), module.exports);
|
|
30
21
|
|
|
31
22
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./Spacer\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,oBAAU,GAAG,OAAO,OAAO"}
|
package/dist/esm/Spacer.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { resolveSizeToken } from "@tamagui/size";
|
|
2
1
|
import { View, styled } from "@tamagui/web";
|
|
3
2
|
|
|
4
|
-
const getSpacerSize = styled.dynamic((size,
|
|
5
|
-
|
|
6
|
-
const sizePx = tokens.space[
|
|
3
|
+
const getSpacerSize = styled.dynamic((size, env) => {
|
|
4
|
+
if (size === false) return;
|
|
5
|
+
const sizePx = typeof size === "number" ? size : env.tokens.space[size === true ? "4" : String(size).replace(/^\$/, "")];
|
|
7
6
|
return {
|
|
8
7
|
width: sizePx,
|
|
9
8
|
height: sizePx,
|
package/dist/esm/Spacer.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spacer.js","names":[],"sources":["esm/Spacer.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Spacer.js","names":[],"sources":["esm/Spacer.js"],"sourcesContent":["import { styled, View } from \"@tamagui/web\";\nconst getSpacerSize = styled.dynamic((size, env) => {\n if (size === false) return;\n const sizePx = typeof size === \"number\" ? size : env.tokens.space[size === true ? \"4\" : String(size).replace(/^\\$/, \"\")];\n return {\n width: sizePx,\n height: sizePx,\n minWidth: sizePx,\n minHeight: sizePx\n };\n});\nconst Spacer = styled(View, {\n displayName: \"Spacer\",\n pointerEvents: \"none\",\n render: \"span\",\n variants: {\n size: getSpacerSize,\n direction: {\n horizontal: {\n height: 0,\n minHeight: 0\n },\n vertical: {\n width: 0,\n minWidth: 0\n },\n both: {}\n }\n },\n defaultVariants: {\n // @ts-ignore\n size: true\n }\n});\nexport {\n Spacer\n};\n//# sourceMappingURL=Spacer.js.map\n"],"mappings":";;;AACA,MAAM,gBAAgB,OAAO,SAAS,MAAM,QAAQ;CAClD,IAAI,SAAS,OAAO;CACpB,MAAM,SAAS,OAAO,SAAS,WAAW,OAAO,IAAI,OAAO,MAAM,SAAS,OAAO,MAAM,OAAO,IAAI,CAAC,CAAC,QAAQ,OAAO,EAAE;CACtH,OAAO;EACL,OAAO;EACP,QAAQ;EACR,UAAU;EACV,WAAW;CACb;AACF,CAAC;AACD,MAAM,SAAS,OAAO,MAAM;CAC1B,aAAa;CACb,eAAe;CACf,QAAQ;CACR,UAAU;EACR,MAAM;EACN,WAAW;GACT,YAAY;IACV,QAAQ;IACR,WAAW;GACb;GACA,UAAU;IACR,OAAO;IACP,UAAU;GACZ;GACA,MAAM,CAAC;EACT;CACF;CACA,iBAAiB,EAEf,MAAM,KACR;AACF,CAAC"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { resolveSizeToken } from "@tamagui/size";
|
|
2
1
|
import { View, styled } from "@tamagui/web";
|
|
3
2
|
|
|
4
|
-
var getSpacerSize = styled.dynamic(function(size,
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
var _tokens_space_sizeToken;
|
|
8
|
-
var sizePx = (_tokens_space_sizeToken = tokens.space[sizeToken]) !== null && _tokens_space_sizeToken !== void 0 ? _tokens_space_sizeToken : sizeToken;
|
|
3
|
+
var getSpacerSize = styled.dynamic(function(size, env) {
|
|
4
|
+
if (size === false) return;
|
|
5
|
+
var sizePx = typeof size === "number" ? size : env.tokens.space[size === true ? "4" : String(size).replace(/^\$/, "")];
|
|
9
6
|
return {
|
|
10
7
|
width: sizePx,
|
|
11
8
|
height: sizePx,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spacer.native.js","names":[],"sources":["esm/Spacer.native.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Spacer.native.js","names":[],"sources":["esm/Spacer.native.js"],"sourcesContent":["import { styled, View } from \"@tamagui/web\";\nvar getSpacerSize = styled.dynamic(function(size, env) {\n if (size === false) return;\n var sizePx = typeof size === \"number\" ? size : env.tokens.space[size === true ? \"4\" : String(size).replace(/^\\$/, \"\")];\n return {\n width: sizePx,\n height: sizePx,\n minWidth: sizePx,\n minHeight: sizePx\n };\n});\nvar Spacer = styled(View, {\n displayName: \"Spacer\",\n pointerEvents: \"none\",\n render: \"span\",\n variants: {\n size: getSpacerSize,\n direction: {\n horizontal: {\n height: 0,\n minHeight: 0\n },\n vertical: {\n width: 0,\n minWidth: 0\n },\n both: {}\n }\n },\n defaultVariants: {\n // @ts-ignore\n size: true\n }\n});\nexport {\n Spacer\n};\n//# sourceMappingURL=Spacer.js.map\n"],"mappings":";;;AACA,IAAI,gBAAgB,OAAO,QAAQ,SAAS,MAAM,KAAK;CACrD,IAAI,SAAS,OAAO;CACpB,IAAI,SAAS,OAAO,SAAS,WAAW,OAAO,IAAI,OAAO,MAAM,SAAS,OAAO,MAAM,OAAO,IAAI,CAAC,CAAC,QAAQ,OAAO,EAAE;CACpH,OAAO;EACL,OAAO;EACP,QAAQ;EACR,UAAU;EACV,WAAW;CACb;AACF,CAAC;AACD,IAAI,SAAS,OAAO,MAAM;CACxB,aAAa;CACb,eAAe;CACf,QAAQ;CACR,UAAU;EACR,MAAM;EACN,WAAW;GACT,YAAY;IACV,QAAQ;IACR,WAAW;GACb;GACA,UAAU;IACR,OAAO;IACP,UAAU;GACZ;GACA,MAAM,CAAC;EACT;CACF;CACA,iBAAiB,EAEf,MAAM,KACR;AACF,CAAC"}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.mjs
CHANGED
package/dist/esm/index.native.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/spacer",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"files": [
|
|
5
6
|
"src",
|
|
6
7
|
"types",
|
|
@@ -33,13 +34,12 @@
|
|
|
33
34
|
"clean:build": "tamagui-build clean:build"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"@tamagui/
|
|
37
|
-
"@tamagui/web": "3.0.0-beta.924.1"
|
|
37
|
+
"@tamagui/web": "3.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@tamagui/build": "3.0.0
|
|
40
|
+
"@tamagui/build": "3.0.0",
|
|
41
41
|
"react": "19.2.3",
|
|
42
|
-
"react-native": "0.
|
|
42
|
+
"react-native": "0.87.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": ">=19"
|
|
@@ -48,5 +48,6 @@
|
|
|
48
48
|
"type": "git",
|
|
49
49
|
"url": "git+https://github.com/tamagui/tamagui.git",
|
|
50
50
|
"directory": "code/ui/spacer"
|
|
51
|
-
}
|
|
51
|
+
},
|
|
52
|
+
"releaseSourceCommit": "15fbca480b143f876f6975601e23a17d3f90d2ee"
|
|
52
53
|
}
|
package/src/Spacer.tsx
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { styled, View, type SizeTokens } from '@tamagui/web'
|
|
1
|
+
import { styled, View, type SpaceTokens } from '@tamagui/web'
|
|
3
2
|
|
|
4
|
-
const getSpacerSize = styled.dynamic<
|
|
5
|
-
(size
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
const getSpacerSize = styled.dynamic<SpaceTokens | number | false>((size, env) => {
|
|
4
|
+
if (size === false) return
|
|
5
|
+
// a number is px. `true` is the default gap, else a space token key.
|
|
6
|
+
const sizePx =
|
|
7
|
+
typeof size === 'number'
|
|
8
|
+
? size
|
|
9
|
+
: env.tokens.space[size === true ? '4' : String(size).replace(/^\$/, '')]
|
|
10
|
+
return {
|
|
11
|
+
width: sizePx,
|
|
12
|
+
height: sizePx,
|
|
13
|
+
minWidth: sizePx,
|
|
14
|
+
minHeight: sizePx,
|
|
14
15
|
}
|
|
15
|
-
)
|
|
16
|
+
})
|
|
16
17
|
|
|
17
18
|
export const Spacer = styled(View, {
|
|
18
19
|
displayName: 'Spacer',
|
package/src/index.ts
CHANGED
package/types/Spacer.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export declare const Spacer: import("react").FunctionComponent<Omit<import("@tamagui/web").StackNonStyleProps, "
|
|
1
|
+
export declare const Spacer: import("react").FunctionComponent<Omit<import("@tamagui/web").StackNonStyleProps, "direction" | "size"> & Omit<import("@tamagui/web").WithThemeValues<Omit<import("@tamagui/web").StackStyleBase, "direction" | "size">> & import("@tamagui/web").WithFlatVariantValues<{
|
|
2
2
|
direction?: "both" | "horizontal" | "vertical" | undefined;
|
|
3
|
-
size?: number | false | import("@tamagui/web").
|
|
4
|
-
}> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase
|
|
3
|
+
size?: number | false | import("@tamagui/web").Space | undefined;
|
|
4
|
+
}> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>>, keyof import("@tamagui/web").StackNonStyleProps> & {
|
|
5
5
|
ref?: import("react").Ref<import("@tamagui/web").TamaguiElement> | undefined;
|
|
6
6
|
}> & import("@tamagui/web").StaticComponentObject<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiElement, import("@tamagui/web").StackNonStyleProps, import("@tamagui/web").StackStyleBase, {
|
|
7
7
|
direction?: "both" | "horizontal" | "vertical" | undefined;
|
|
8
|
-
size?: number | false | import("@tamagui/web").
|
|
8
|
+
size?: number | false | import("@tamagui/web").Space | undefined;
|
|
9
9
|
}, import("@tamagui/web").StaticConfigPublic> & Omit<import("@tamagui/web").StaticConfigPublic, "staticConfig"> & {
|
|
10
10
|
__tama: [import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiElement, import("@tamagui/web").StackNonStyleProps, import("@tamagui/web").StackStyleBase, {
|
|
11
11
|
direction?: "both" | "horizontal" | "vertical" | undefined;
|
|
12
|
-
size?: number | false | import("@tamagui/web").
|
|
12
|
+
size?: number | false | import("@tamagui/web").Space | undefined;
|
|
13
13
|
}, import("@tamagui/web").StaticConfigPublic];
|
|
14
14
|
};
|
|
15
15
|
//# sourceMappingURL=Spacer.d.ts.map
|
package/types/Spacer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spacer.d.ts","sourceRoot":"","sources":["../src/Spacer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Spacer.d.ts","sourceRoot":"","sources":["../src/Spacer.tsx"],"names":[],"mappings":"AAiBA,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAyBjB,CAAA"}
|
package/types/index.d.ts
CHANGED
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
package/dist/cjs/Unspaced.cjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
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: 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, {
|
|
14
|
-
get: () => from[key],
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), 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"] = true;
|
|
31
|
-
function isUnspaced(child) {
|
|
32
|
-
const t = child?.["type"];
|
|
33
|
-
return t?.["isVisuallyHidden"] || t?.["isUnspaced"];
|
|
34
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
-
get: () => from[key],
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), 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"] = true;
|
|
33
|
-
function isUnspaced(child) {
|
|
34
|
-
var t = child === null || child === void 0 ? void 0 : child["type"];
|
|
35
|
-
return (t === null || t === void 0 ? void 0 : t["isVisuallyHidden"]) || (t === null || t === void 0 ? void 0 : t["isUnspaced"]);
|
|
36
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
-
get: () => from[key],
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), 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"] = true;
|
|
33
|
-
function isUnspaced(child) {
|
|
34
|
-
var t = child === null || child === void 0 ? void 0 : child["type"];
|
|
35
|
-
return (t === null || t === void 0 ? void 0 : t["isVisuallyHidden"]) || (t === null || t === void 0 ? void 0 : t["isUnspaced"]);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=Unspaced.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Unspaced.native.js","names":[],"sources":["cjs/Unspaced.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Unspaced_exports = {};\n__export(Unspaced_exports, {\n Unspaced: () => Unspaced,\n isUnspaced: () => isUnspaced\n});\nmodule.exports = __toCommonJS(Unspaced_exports);\nfunction Unspaced(props) {\n return props.children;\n}\nUnspaced[\"isUnspaced\"] = true;\nfunction isUnspaced(child) {\n var t = child === null || child === void 0 ? void 0 : child[\"type\"];\n return (t === null || t === void 0 ? void 0 : t[\"isVisuallyHidden\"]) || (t === null || t === void 0 ? void 0 : t[\"isUnspaced\"]);\n}\n//# sourceMappingURL=Unspaced.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,mBAAmB,CAAC;AACxB,SAAS,kBAAkB;CACzB,gBAAgB;CAChB,kBAAkB;AACpB,CAAC;AACD,OAAO,UAAU,aAAa,gBAAgB;AAC9C,SAAS,SAAS,OAAO;CACvB,OAAO,MAAM;AACf;AACA,SAAS,gBAAgB;AACzB,SAAS,WAAW,OAAO;CACzB,IAAI,IAAI,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;CAC5D,QAAQ,MAAM,QAAQ,MAAM,KAAK,IAAI,KAAK,IAAI,EAAE,yBAAyB,MAAM,QAAQ,MAAM,KAAK,IAAI,KAAK,IAAI,EAAE;AACnH"}
|
|
@@ -1,119 +0,0 @@
|
|
|
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
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
-
get: () => from[key],
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
25
|
-
}) : target, mod));
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var spacedChildren_exports = {};
|
|
28
|
-
__export(spacedChildren_exports, { spacedChildren: () => spacedChildren });
|
|
29
|
-
module.exports = __toCommonJS(spacedChildren_exports);
|
|
30
|
-
var import_web = require("@tamagui/web");
|
|
31
|
-
var import_react = __toESM(require("react"), 1);
|
|
32
|
-
var import_Spacer = require("./Spacer.cjs");
|
|
33
|
-
var import_Unspaced = require("./Unspaced.cjs");
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
-
function spacedChildren(props) {
|
|
36
|
-
const { isZStack, children, space, direction, spaceFlex, separator, ensureKeys } = props;
|
|
37
|
-
const hasSpace = !!(space || spaceFlex);
|
|
38
|
-
const hasSeparator = !(separator === void 0 || separator === null);
|
|
39
|
-
const areChildrenArray = Array.isArray(children);
|
|
40
|
-
if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) {
|
|
41
|
-
return children;
|
|
42
|
-
}
|
|
43
|
-
const childrenList = areChildrenArray ? children : import_react.default.Children.toArray(children);
|
|
44
|
-
const len = childrenList.length;
|
|
45
|
-
if (len <= 1 && !isZStack && !childrenList[0]?.["type"]?.["shouldForwardSpace"]) {
|
|
46
|
-
return children;
|
|
47
|
-
}
|
|
48
|
-
const final = [];
|
|
49
|
-
for (let [index, child] of childrenList.entries()) {
|
|
50
|
-
const isEmpty = child === null || child === void 0 || Array.isArray(child) && child.length === 0;
|
|
51
|
-
if (!isEmpty && import_react.default.isValidElement(child) && child.type?.["shouldForwardSpace"]) {
|
|
52
|
-
child = import_react.default.cloneElement(child, {
|
|
53
|
-
space,
|
|
54
|
-
spaceFlex,
|
|
55
|
-
separator,
|
|
56
|
-
key: child.key
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
if (isEmpty || !child || child["key"] && !isZStack) {
|
|
60
|
-
final.push(child);
|
|
61
|
-
} else {
|
|
62
|
-
final.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: isZStack ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AbsoluteFill, { children: child }) : child }, `${index}0t`));
|
|
63
|
-
}
|
|
64
|
-
if ((0, import_Unspaced.isUnspaced)(child) && index === 0) continue;
|
|
65
|
-
if (isZStack) continue;
|
|
66
|
-
const next = childrenList[index + 1];
|
|
67
|
-
if (next && !isEmpty && !(0, import_Unspaced.isUnspaced)(next)) {
|
|
68
|
-
if (separator) {
|
|
69
|
-
if (hasSpace) {
|
|
70
|
-
final.push(createSpacer({
|
|
71
|
-
key: `_${index}_00t`,
|
|
72
|
-
direction,
|
|
73
|
-
space,
|
|
74
|
-
spaceFlex
|
|
75
|
-
}));
|
|
76
|
-
}
|
|
77
|
-
final.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: separator }, `${index}03t`));
|
|
78
|
-
if (hasSpace) {
|
|
79
|
-
final.push(createSpacer({
|
|
80
|
-
key: `_${index}01t`,
|
|
81
|
-
direction,
|
|
82
|
-
space,
|
|
83
|
-
spaceFlex
|
|
84
|
-
}));
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
final.push(createSpacer({
|
|
88
|
-
key: `_${index}02t`,
|
|
89
|
-
direction,
|
|
90
|
-
space,
|
|
91
|
-
spaceFlex
|
|
92
|
-
}));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
if (process.env.NODE_ENV === "development") {
|
|
97
|
-
if (props.debug) {
|
|
98
|
-
console.info(` Spaced children`, final, props);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return final;
|
|
102
|
-
}
|
|
103
|
-
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
104
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Spacer.Spacer, {
|
|
105
|
-
size: space,
|
|
106
|
-
direction,
|
|
107
|
-
...typeof spaceFlex !== "undefined" && { flex: spaceFlex === true ? 1 : spaceFlex === false ? 0 : spaceFlex }
|
|
108
|
-
}, key);
|
|
109
|
-
}
|
|
110
|
-
const AbsoluteFill = (0, import_web.createComponent)({ defaultProps: {
|
|
111
|
-
display: "flex",
|
|
112
|
-
flexDirection: "column",
|
|
113
|
-
position: "absolute",
|
|
114
|
-
top: 0,
|
|
115
|
-
right: 0,
|
|
116
|
-
bottom: 0,
|
|
117
|
-
left: 0,
|
|
118
|
-
pointerEvents: "box-none"
|
|
119
|
-
} });
|