@tamagui/shapes 3.0.0-beta.1313.1 → 3.0.0-beta.1341.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.
- package/dist/cjs/getShapeSize.cjs +2 -2
- package/dist/cjs/getShapeSize.native.cjs +2 -3
- package/dist/cjs/getShapeSize.native.js +2 -3
- package/dist/cjs/getShapeSize.native.js.map +1 -1
- package/dist/esm/getShapeSize.mjs +2 -2
- package/dist/esm/getShapeSize.mjs.map +1 -1
- package/dist/esm/getShapeSize.native.js +2 -3
- package/dist/esm/getShapeSize.native.js.map +1 -1
- package/dist/jsx/getShapeSize.mjs +2 -2
- package/dist/jsx/getShapeSize.mjs.map +1 -1
- package/dist/jsx/getShapeSize.native.cjs +2 -3
- package/dist/jsx/getShapeSize.native.js +2 -3
- package/dist/jsx/getShapeSize.native.js.map +1 -1
- package/package.json +4 -5
- package/src/getShapeSize.tsx +5 -9
- package/types/getShapeSize.d.ts.map +1 -1
|
@@ -21,11 +21,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var getShapeSize_exports = {};
|
|
22
22
|
__export(getShapeSize_exports, { getShapeSize: () => getShapeSize });
|
|
23
23
|
module.exports = __toCommonJS(getShapeSize_exports);
|
|
24
|
-
var import_size = require("@tamagui/size");
|
|
25
24
|
var import_web = require("@tamagui/web");
|
|
26
25
|
const getShapeSize = import_web.styled.dynamic((size, env) => {
|
|
27
26
|
const key = typeof size === "string" ? size.replace(/^\$/, "") : size;
|
|
28
|
-
const resolved = typeof key === "number" ? key : env.tokens.size[key]
|
|
27
|
+
const resolved = typeof key === "number" ? key : env.tokens.size[key];
|
|
28
|
+
if (resolved == null) return;
|
|
29
29
|
const width = resolved;
|
|
30
30
|
const height = resolved;
|
|
31
31
|
return {
|
|
@@ -23,12 +23,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
23
23
|
var getShapeSize_exports = {};
|
|
24
24
|
__export(getShapeSize_exports, { getShapeSize: () => getShapeSize });
|
|
25
25
|
module.exports = __toCommonJS(getShapeSize_exports);
|
|
26
|
-
var import_size = require("@tamagui/size");
|
|
27
26
|
var import_web = require("@tamagui/web");
|
|
28
27
|
var getShapeSize = import_web.styled.dynamic(function(size, env) {
|
|
29
28
|
var key = typeof size === "string" ? size.replace(/^\$/, "") : size;
|
|
30
|
-
var
|
|
31
|
-
|
|
29
|
+
var resolved = typeof key === "number" ? key : env.tokens.size[key];
|
|
30
|
+
if (resolved == null) return;
|
|
32
31
|
var width = resolved;
|
|
33
32
|
var height = resolved;
|
|
34
33
|
return {
|
|
@@ -23,12 +23,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
23
23
|
var getShapeSize_exports = {};
|
|
24
24
|
__export(getShapeSize_exports, { getShapeSize: () => getShapeSize });
|
|
25
25
|
module.exports = __toCommonJS(getShapeSize_exports);
|
|
26
|
-
var import_size = require("@tamagui/size");
|
|
27
26
|
var import_web = require("@tamagui/web");
|
|
28
27
|
var getShapeSize = import_web.styled.dynamic(function(size, env) {
|
|
29
28
|
var key = typeof size === "string" ? size.replace(/^\$/, "") : size;
|
|
30
|
-
var
|
|
31
|
-
|
|
29
|
+
var resolved = typeof key === "number" ? key : env.tokens.size[key];
|
|
30
|
+
if (resolved == null) return;
|
|
32
31
|
var width = resolved;
|
|
33
32
|
var height = resolved;
|
|
34
33
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getShapeSize.native.js","names":[],"sources":["cjs/getShapeSize.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 getShapeSize_exports = {};\n__export(getShapeSize_exports, {\n getShapeSize: () => getShapeSize\n});\nmodule.exports = __toCommonJS(getShapeSize_exports);\nvar
|
|
1
|
+
{"version":3,"file":"getShapeSize.native.js","names":[],"sources":["cjs/getShapeSize.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 getShapeSize_exports = {};\n__export(getShapeSize_exports, {\n getShapeSize: () => getShapeSize\n});\nmodule.exports = __toCommonJS(getShapeSize_exports);\nvar import_web = require(\"@tamagui/web\");\nvar getShapeSize = import_web.styled.dynamic(function(size, env) {\n var key = typeof size === \"string\" ? size.replace(/^\\$/, \"\") : size;\n var resolved = typeof key === \"number\" ? key : env.tokens.size[key];\n if (resolved == null) return;\n var width = resolved;\n var height = resolved;\n return {\n width,\n height,\n minWidth: width,\n maxWidth: width,\n maxHeight: height,\n minHeight: height\n };\n});\n//# sourceMappingURL=getShapeSize.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,uBAAuB,CAAC;AAC5B,SAAS,sBAAsB,EAC7B,oBAAoB,aACtB,CAAC;AACD,OAAO,UAAU,aAAa,oBAAoB;AAClD,IAAI,aAAa,QAAQ,cAAc;AACvC,IAAI,eAAe,WAAW,OAAO,QAAQ,SAAS,MAAM,KAAK;CAC/D,IAAI,MAAM,OAAO,SAAS,WAAW,KAAK,QAAQ,OAAO,EAAE,IAAI;CAC/D,IAAI,WAAW,OAAO,QAAQ,WAAW,MAAM,IAAI,OAAO,KAAK;CAC/D,IAAI,YAAY,MAAM;CACtB,IAAI,QAAQ;CACZ,IAAI,SAAS;CACb,OAAO;EACL;EACA;EACA,UAAU;EACV,UAAU;EACV,WAAW;EACX,WAAW;CACb;AACF,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { resolveSize } from "@tamagui/size";
|
|
2
1
|
import { styled } from "@tamagui/web";
|
|
3
2
|
|
|
4
3
|
const getShapeSize = styled.dynamic((size, env) => {
|
|
5
4
|
const key = typeof size === "string" ? size.replace(/^\$/, "") : size;
|
|
6
|
-
const resolved = typeof key === "number" ? key : env.tokens.size[key]
|
|
5
|
+
const resolved = typeof key === "number" ? key : env.tokens.size[key];
|
|
6
|
+
if (resolved == null) return;
|
|
7
7
|
const width = resolved;
|
|
8
8
|
const height = resolved;
|
|
9
9
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getShapeSize.js","names":[],"sources":["esm/getShapeSize.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"getShapeSize.js","names":[],"sources":["esm/getShapeSize.js"],"sourcesContent":["import { styled } from \"@tamagui/web\";\nconst getShapeSize = styled.dynamic((size, env) => {\n const key = typeof size === \"string\" ? size.replace(/^\\$/, \"\") : size;\n const resolved = typeof key === \"number\" ? key : env.tokens.size[key];\n if (resolved == null) return;\n const width = resolved;\n const height = resolved;\n return {\n width,\n height,\n minWidth: width,\n maxWidth: width,\n maxHeight: height,\n minHeight: height\n };\n});\nexport {\n getShapeSize\n};\n//# sourceMappingURL=getShapeSize.js.map\n"],"mappings":";;;AACA,MAAM,eAAe,OAAO,SAAS,MAAM,QAAQ;CACjD,MAAM,MAAM,OAAO,SAAS,WAAW,KAAK,QAAQ,OAAO,EAAE,IAAI;CACjE,MAAM,WAAW,OAAO,QAAQ,WAAW,MAAM,IAAI,OAAO,KAAK;CACjE,IAAI,YAAY,MAAM;CACtB,MAAM,QAAQ;CACd,MAAM,SAAS;CACf,OAAO;EACL;EACA;EACA,UAAU;EACV,UAAU;EACV,WAAW;EACX,WAAW;CACb;AACF,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { resolveSize } from "@tamagui/size";
|
|
2
1
|
import { styled } from "@tamagui/web";
|
|
3
2
|
|
|
4
3
|
var getShapeSize = styled.dynamic(function(size, env) {
|
|
5
4
|
var key = typeof size === "string" ? size.replace(/^\$/, "") : size;
|
|
6
|
-
var
|
|
7
|
-
|
|
5
|
+
var resolved = typeof key === "number" ? key : env.tokens.size[key];
|
|
6
|
+
if (resolved == null) return;
|
|
8
7
|
var width = resolved;
|
|
9
8
|
var height = resolved;
|
|
10
9
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getShapeSize.native.js","names":[],"sources":["esm/getShapeSize.native.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"getShapeSize.native.js","names":[],"sources":["esm/getShapeSize.native.js"],"sourcesContent":["import { styled } from \"@tamagui/web\";\nvar getShapeSize = styled.dynamic(function(size, env) {\n var key = typeof size === \"string\" ? size.replace(/^\\$/, \"\") : size;\n var resolved = typeof key === \"number\" ? key : env.tokens.size[key];\n if (resolved == null) return;\n var width = resolved;\n var height = resolved;\n return {\n width,\n height,\n minWidth: width,\n maxWidth: width,\n maxHeight: height,\n minHeight: height\n };\n});\nexport {\n getShapeSize\n};\n//# sourceMappingURL=getShapeSize.js.map\n"],"mappings":";;;AACA,IAAI,eAAe,OAAO,QAAQ,SAAS,MAAM,KAAK;CACpD,IAAI,MAAM,OAAO,SAAS,WAAW,KAAK,QAAQ,OAAO,EAAE,IAAI;CAC/D,IAAI,WAAW,OAAO,QAAQ,WAAW,MAAM,IAAI,OAAO,KAAK;CAC/D,IAAI,YAAY,MAAM;CACtB,IAAI,QAAQ;CACZ,IAAI,SAAS;CACb,OAAO;EACL;EACA;EACA,UAAU;EACV,UAAU;EACV,WAAW;EACX,WAAW;CACb;AACF,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { resolveSize } from "@tamagui/size";
|
|
2
1
|
import { styled } from "@tamagui/web";
|
|
3
2
|
|
|
4
3
|
const getShapeSize = styled.dynamic((size, env) => {
|
|
5
4
|
const key = typeof size === "string" ? size.replace(/^\$/, "") : size;
|
|
6
|
-
const resolved = typeof key === "number" ? key : env.tokens.size[key]
|
|
5
|
+
const resolved = typeof key === "number" ? key : env.tokens.size[key];
|
|
6
|
+
if (resolved == null) return;
|
|
7
7
|
const width = resolved;
|
|
8
8
|
const height = resolved;
|
|
9
9
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getShapeSize.js","names":[],"sources":["jsx/getShapeSize.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"getShapeSize.js","names":[],"sources":["jsx/getShapeSize.js"],"sourcesContent":["import { styled } from \"@tamagui/web\";\nconst getShapeSize = styled.dynamic((size, env) => {\n const key = typeof size === \"string\" ? size.replace(/^\\$/, \"\") : size;\n const resolved = typeof key === \"number\" ? key : env.tokens.size[key];\n if (resolved == null) return;\n const width = resolved;\n const height = resolved;\n return {\n width,\n height,\n minWidth: width,\n maxWidth: width,\n maxHeight: height,\n minHeight: height\n };\n});\nexport {\n getShapeSize\n};\n//# sourceMappingURL=getShapeSize.js.map\n"],"mappings":";;;AACA,MAAM,eAAe,OAAO,SAAS,MAAM,QAAQ;CACjD,MAAM,MAAM,OAAO,SAAS,WAAW,KAAK,QAAQ,OAAO,EAAE,IAAI;CACjE,MAAM,WAAW,OAAO,QAAQ,WAAW,MAAM,IAAI,OAAO,KAAK;CACjE,IAAI,YAAY,MAAM;CACtB,MAAM,QAAQ;CACd,MAAM,SAAS;CACf,OAAO;EACL;EACA;EACA,UAAU;EACV,UAAU;EACV,WAAW;EACX,WAAW;CACb;AACF,CAAC"}
|
|
@@ -23,12 +23,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
23
23
|
var getShapeSize_exports = {};
|
|
24
24
|
__export(getShapeSize_exports, { getShapeSize: () => getShapeSize });
|
|
25
25
|
module.exports = __toCommonJS(getShapeSize_exports);
|
|
26
|
-
var import_size = require("@tamagui/size");
|
|
27
26
|
var import_web = require("@tamagui/web");
|
|
28
27
|
var getShapeSize = import_web.styled.dynamic(function(size, env) {
|
|
29
28
|
var key = typeof size === "string" ? size.replace(/^\$/, "") : size;
|
|
30
|
-
var
|
|
31
|
-
|
|
29
|
+
var resolved = typeof key === "number" ? key : env.tokens.size[key];
|
|
30
|
+
if (resolved == null) return;
|
|
32
31
|
var width = resolved;
|
|
33
32
|
var height = resolved;
|
|
34
33
|
return {
|
|
@@ -23,12 +23,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
23
23
|
var getShapeSize_exports = {};
|
|
24
24
|
__export(getShapeSize_exports, { getShapeSize: () => getShapeSize });
|
|
25
25
|
module.exports = __toCommonJS(getShapeSize_exports);
|
|
26
|
-
var import_size = require("@tamagui/size");
|
|
27
26
|
var import_web = require("@tamagui/web");
|
|
28
27
|
var getShapeSize = import_web.styled.dynamic(function(size, env) {
|
|
29
28
|
var key = typeof size === "string" ? size.replace(/^\$/, "") : size;
|
|
30
|
-
var
|
|
31
|
-
|
|
29
|
+
var resolved = typeof key === "number" ? key : env.tokens.size[key];
|
|
30
|
+
if (resolved == null) return;
|
|
32
31
|
var width = resolved;
|
|
33
32
|
var height = resolved;
|
|
34
33
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getShapeSize.native.js","names":[],"sources":["jsx/getShapeSize.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 getShapeSize_exports = {};\n__export(getShapeSize_exports, {\n getShapeSize: () => getShapeSize\n});\nmodule.exports = __toCommonJS(getShapeSize_exports);\nvar
|
|
1
|
+
{"version":3,"file":"getShapeSize.native.js","names":[],"sources":["jsx/getShapeSize.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 getShapeSize_exports = {};\n__export(getShapeSize_exports, {\n getShapeSize: () => getShapeSize\n});\nmodule.exports = __toCommonJS(getShapeSize_exports);\nvar import_web = require(\"@tamagui/web\");\nvar getShapeSize = import_web.styled.dynamic(function(size, env) {\n var key = typeof size === \"string\" ? size.replace(/^\\$/, \"\") : size;\n var resolved = typeof key === \"number\" ? key : env.tokens.size[key];\n if (resolved == null) return;\n var width = resolved;\n var height = resolved;\n return {\n width,\n height,\n minWidth: width,\n maxWidth: width,\n maxHeight: height,\n minHeight: height\n };\n});\n//# sourceMappingURL=getShapeSize.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,uBAAuB,CAAC;AAC5B,SAAS,sBAAsB,EAC7B,oBAAoB,aACtB,CAAC;AACD,OAAO,UAAU,aAAa,oBAAoB;AAClD,IAAI,aAAa,QAAQ,cAAc;AACvC,IAAI,eAAe,WAAW,OAAO,QAAQ,SAAS,MAAM,KAAK;CAC/D,IAAI,MAAM,OAAO,SAAS,WAAW,KAAK,QAAQ,OAAO,EAAE,IAAI;CAC/D,IAAI,WAAW,OAAO,QAAQ,WAAW,MAAM,IAAI,OAAO,KAAK;CAC/D,IAAI,YAAY,MAAM;CACtB,IAAI,QAAQ;CACZ,IAAI,SAAS;CACb,OAAO;EACL;EACA;EACA,UAAU;EACV,UAAU;EACV,WAAW;EACX,WAAW;CACb;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/shapes",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.1341.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -35,12 +35,11 @@
|
|
|
35
35
|
"clean:build": "tamagui-build clean:build"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@tamagui/
|
|
39
|
-
"@tamagui/
|
|
40
|
-
"@tamagui/web": "3.0.0-beta.1313.1"
|
|
38
|
+
"@tamagui/stacks": "3.0.0-beta.1341.1",
|
|
39
|
+
"@tamagui/web": "3.0.0-beta.1341.1"
|
|
41
40
|
},
|
|
42
41
|
"devDependencies": {
|
|
43
|
-
"@tamagui/build": "3.0.0-beta.
|
|
42
|
+
"@tamagui/build": "3.0.0-beta.1341.1",
|
|
44
43
|
"react": "19.2.3"
|
|
45
44
|
},
|
|
46
45
|
"peerDependencies": {
|
package/src/getShapeSize.tsx
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { resolveSize } from '@tamagui/size'
|
|
2
1
|
import { styled, type SizeTokens } from '@tamagui/web'
|
|
3
2
|
|
|
4
|
-
export const getShapeSize = styled.dynamic<SizeTokens | number
|
|
5
|
-
// a number is
|
|
6
|
-
//
|
|
7
|
-
// as tall as a Button "md".
|
|
3
|
+
export const getShapeSize = styled.dynamic<SizeTokens | number>((size, env) => {
|
|
4
|
+
// a number is px, a string is a size token key (v6: `4` is 16px).
|
|
5
|
+
// without a size the shape fits its content, like any stack.
|
|
8
6
|
const key = typeof size === 'string' ? size.replace(/^\$/, '') : size
|
|
9
|
-
const resolved =
|
|
10
|
-
|
|
11
|
-
? key
|
|
12
|
-
: (env.tokens.size[key as any] ?? resolveSize(size, env).controlHeight)
|
|
7
|
+
const resolved = typeof key === 'number' ? key : env.tokens.size[key as any]
|
|
8
|
+
if (resolved == null) return
|
|
13
9
|
const width = resolved
|
|
14
10
|
const height = resolved
|
|
15
11
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getShapeSize.d.ts","sourceRoot":"","sources":["../src/getShapeSize.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getShapeSize.d.ts","sourceRoot":"","sources":["../src/getShapeSize.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,+GAgBvB,CAAA"}
|