@tamagui/shapes 2.7.7 → 3.0.0-beta.1093.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 (66) hide show
  1. package/dist/cjs/Circle.cjs +16 -20
  2. package/dist/cjs/Circle.native.cjs +31 -0
  3. package/dist/cjs/Circle.native.js +16 -19
  4. package/dist/cjs/Circle.native.js.map +1 -1
  5. package/dist/cjs/Square.cjs +23 -30
  6. package/dist/cjs/Square.native.cjs +38 -0
  7. package/dist/cjs/Square.native.js +24 -30
  8. package/dist/cjs/Square.native.js.map +1 -1
  9. package/dist/cjs/getShapeSize.cjs +29 -31
  10. package/dist/cjs/getShapeSize.native.cjs +42 -0
  11. package/dist/cjs/getShapeSize.native.js +31 -34
  12. package/dist/cjs/getShapeSize.native.js.map +1 -1
  13. package/dist/cjs/index.cjs +9 -11
  14. package/dist/cjs/index.native.cjs +22 -0
  15. package/dist/cjs/index.native.js +9 -10
  16. package/dist/cjs/index.native.js.map +1 -1
  17. package/dist/esm/Circle.mjs +4 -2
  18. package/dist/esm/Circle.mjs.map +1 -1
  19. package/dist/esm/Circle.native.js +4 -2
  20. package/dist/esm/Circle.native.js.map +1 -1
  21. package/dist/esm/Square.mjs +13 -14
  22. package/dist/esm/Square.mjs.map +1 -1
  23. package/dist/esm/Square.native.js +13 -14
  24. package/dist/esm/Square.native.js.map +1 -1
  25. package/dist/esm/getShapeSize.mjs +18 -14
  26. package/dist/esm/getShapeSize.mjs.map +1 -1
  27. package/dist/esm/getShapeSize.native.js +19 -17
  28. package/dist/esm/getShapeSize.native.js.map +1 -1
  29. package/dist/esm/index.js +5 -4
  30. package/dist/esm/index.mjs +5 -4
  31. package/dist/esm/index.native.js +5 -4
  32. package/dist/jsx/Circle.mjs +4 -2
  33. package/dist/jsx/Circle.mjs.map +1 -1
  34. package/dist/jsx/Circle.native.cjs +31 -0
  35. package/dist/jsx/Circle.native.js +16 -19
  36. package/dist/jsx/Circle.native.js.map +1 -1
  37. package/dist/jsx/Square.mjs +13 -14
  38. package/dist/jsx/Square.mjs.map +1 -1
  39. package/dist/jsx/Square.native.cjs +38 -0
  40. package/dist/jsx/Square.native.js +24 -30
  41. package/dist/jsx/Square.native.js.map +1 -1
  42. package/dist/jsx/getShapeSize.mjs +18 -14
  43. package/dist/jsx/getShapeSize.mjs.map +1 -1
  44. package/dist/jsx/getShapeSize.native.cjs +42 -0
  45. package/dist/jsx/getShapeSize.native.js +31 -34
  46. package/dist/jsx/getShapeSize.native.js.map +1 -1
  47. package/dist/jsx/index.js +5 -4
  48. package/dist/jsx/index.mjs +5 -4
  49. package/dist/jsx/index.native.cjs +22 -0
  50. package/dist/jsx/index.native.js +9 -10
  51. package/dist/jsx/index.native.js.map +1 -1
  52. package/package.json +7 -5
  53. package/src/Circle.tsx +1 -1
  54. package/src/Square.tsx +16 -6
  55. package/src/getShapeSize.tsx +14 -9
  56. package/types/Circle.d.ts +22 -8
  57. package/types/Circle.d.ts.map +1 -1
  58. package/types/Square.d.ts +22 -8
  59. package/types/Square.d.ts.map +1 -1
  60. package/types/getShapeSize.d.ts +1 -3
  61. package/types/getShapeSize.d.ts.map +1 -1
  62. package/dist/esm/index.js.map +0 -1
  63. package/dist/esm/index.mjs.map +0 -1
  64. package/dist/esm/index.native.js.map +0 -1
  65. package/dist/jsx/index.js.map +0 -1
  66. package/dist/jsx/index.mjs.map +0 -1
@@ -0,0 +1,42 @@
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 getShapeSize_exports = {};
24
+ __export(getShapeSize_exports, { getShapeSize: () => getShapeSize });
25
+ module.exports = __toCommonJS(getShapeSize_exports);
26
+ var import_size = require("@tamagui/size");
27
+ var import_web = require("@tamagui/web");
28
+ var getShapeSize = import_web.styled.dynamic(function(size, env) {
29
+ var key = typeof size === "string" ? size.replace(/^\$/, "") : size;
30
+ var _env_tokens_size_key;
31
+ var resolved = typeof key === "number" ? key : (_env_tokens_size_key = env.tokens.size[key]) !== null && _env_tokens_size_key !== void 0 ? _env_tokens_size_key : (0, import_size.resolveSize)(size, env).controlHeight;
32
+ var width = resolved;
33
+ var height = resolved;
34
+ return {
35
+ width,
36
+ height,
37
+ minWidth: width,
38
+ maxWidth: width,
39
+ maxHeight: height,
40
+ minHeight: height
41
+ };
42
+ });
@@ -5,43 +5,40 @@ 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: true
11
- });
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
12
  };
13
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;
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
21
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
23
  var getShapeSize_exports = {};
26
- __export(getShapeSize_exports, {
27
- getShapeSize: () => getShapeSize
28
- });
24
+ __export(getShapeSize_exports, { getShapeSize: () => getShapeSize });
29
25
  module.exports = __toCommonJS(getShapeSize_exports);
30
- var getShapeSize = function (size, param) {
31
- var {
32
- tokens
33
- } = param;
34
- var _tokens_size_size;
35
- var width = (_tokens_size_size = tokens.size[size]) !== null && _tokens_size_size !== void 0 ? _tokens_size_size : size;
36
- var _tokens_size_size1;
37
- var height = (_tokens_size_size1 = tokens.size[size]) !== null && _tokens_size_size1 !== void 0 ? _tokens_size_size1 : size;
38
- return {
39
- width,
40
- height,
41
- minWidth: width,
42
- maxWidth: width,
43
- maxHeight: height,
44
- minHeight: height
45
- };
46
- };
26
+ var import_size = require("@tamagui/size");
27
+ var import_web = require("@tamagui/web");
28
+ var getShapeSize = import_web.styled.dynamic(function(size, env) {
29
+ var key = typeof size === "string" ? size.replace(/^\$/, "") : size;
30
+ var _env_tokens_size_key;
31
+ var resolved = typeof key === "number" ? key : (_env_tokens_size_key = env.tokens.size[key]) !== null && _env_tokens_size_key !== void 0 ? _env_tokens_size_key : (0, import_size.resolveSize)(size, env).controlHeight;
32
+ var width = resolved;
33
+ var height = resolved;
34
+ return {
35
+ width,
36
+ height,
37
+ minWidth: width,
38
+ maxWidth: width,
39
+ maxHeight: height,
40
+ minHeight: height
41
+ };
42
+ });
43
+
47
44
  //# sourceMappingURL=getShapeSize.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key"],"sources":["../../src/getShapeSize.tsx"],"sourcesContent":[null],"mappings":"AAGO,YAAM;;AAIX,IAAAA,SAAM,GAAQC,MAAA,CAAOC,cAAc;AACnC,IAAAC,gBAAe,GAAAF,MAAY,CAAAG,wBAAS;AACpC,IAAAC,iBAAO,GAAAJ,MAAA,CAAAK,mBAAA;AAAA,IACLC,YAAA,GAAAN,MAAA,CAAAO,SAAA,CAAAC,cAAA;AAAA,IACAC,QAAA,GAAAA,CAAAC,MAAA,EAAAC,GAAA;EAAA,KACA,IAAAC,IAAU,IAAAD,GAAA,EACVZ,SAAA,CAAUW,MAAA,EAAAE,IAAA;IAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA;AAAA;AACC,IACXC,WAAW,GAAAA,CAAAC,EAAA,EAAAC,IAAA,EAAAC,MAAA,EAAAC,IAAA;EACb,IAAAF,IAAA,WAAAA,IAAA,wBAAAA,IAAA;IACF,SAAAG,GAAA,IAAAhB,iBAAA,CAAAa,IAAA,G","ignoreList":[]}
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_size = require(\"@tamagui/size\");\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 _env_tokens_size_key;\n var resolved = typeof key === \"number\" ? key : (_env_tokens_size_key = env.tokens.size[key]) !== null && _env_tokens_size_key !== void 0 ? _env_tokens_size_key : (0, import_size.resolveSize)(size, env).controlHeight;\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,cAAc,QAAQ,eAAe;AACzC,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;CACJ,IAAI,WAAW,OAAO,QAAQ,WAAW,OAAO,uBAAuB,IAAI,OAAO,KAAK,UAAU,QAAQ,yBAAyB,KAAK,IAAI,wBAAwB,GAAG,YAAY,YAAW,CAAE,MAAM,GAAG,CAAC,CAAC;CAC1M,IAAI,QAAQ;CACZ,IAAI,SAAS;CACb,OAAO;EACL;EACA;EACA,UAAU;EACV,UAAU;EACV,WAAW;EACX,WAAW;CACb;AACF,CAAC"}
package/dist/jsx/index.js CHANGED
@@ -1,4 +1,5 @@
1
- export * from "./Square.mjs";
2
- export * from "./Circle.mjs";
3
- export * from "./getShapeSize.mjs";
4
- //# sourceMappingURL=index.js.map
1
+ export * from "./Square.mjs"
2
+
3
+ export * from "./Circle.mjs"
4
+
5
+ export * from "./getShapeSize.mjs"
@@ -1,4 +1,5 @@
1
- export * from "./Square.mjs";
2
- export * from "./Circle.mjs";
3
- export * from "./getShapeSize.mjs";
4
- //# sourceMappingURL=index.mjs.map
1
+ export * from "./Square.mjs"
2
+
3
+ export * from "./Circle.mjs"
4
+
5
+ export * from "./getShapeSize.mjs"
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
+ get: () => from[key],
11
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
+ });
13
+ }
14
+ return to;
15
+ };
16
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var index_exports = {};
19
+ module.exports = __toCommonJS(index_exports);
20
+ __reExport(index_exports, require("./Square.native.js"), module.exports);
21
+ __reExport(index_exports, require("./Circle.native.js"), module.exports);
22
+ __reExport(index_exports, require("./getShapeSize.native.js"), module.exports);
@@ -5,21 +5,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
- get: () => from[key],
11
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
- });
13
- }
14
- return to;
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
+ get: () => from[key],
11
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
+ });
13
+ }
14
+ return to;
15
15
  };
16
16
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
18
- value: true
19
- }), mod);
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
18
  var index_exports = {};
21
19
  module.exports = __toCommonJS(index_exports);
22
20
  __reExport(index_exports, require("./Square.native.js"), module.exports);
23
21
  __reExport(index_exports, require("./Circle.native.js"), module.exports);
24
22
  __reExport(index_exports, require("./getShapeSize.native.js"), module.exports);
23
+
25
24
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;AACA,IAAAA,SAAA,GAAcC,MAAA,CAAAC,cAAA;AACd,IAAAC,gBAAc,GAAAF,MAAA,CAAAG,wBAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["jsx/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(\"./Square\"), module.exports);\n__reExport(index_exports, require(\"./Circle\"), module.exports);\n__reExport(index_exports, require(\"./getShapeSize\"), 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;AAC7D,WAAW,eAAe,QAAQ,oBAAU,GAAG,OAAO,OAAO;AAC7D,WAAW,eAAe,QAAQ,0BAAgB,GAAG,OAAO,OAAO"}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@tamagui/shapes",
3
- "version": "2.7.7",
3
+ "version": "3.0.0-beta.1093.1",
4
+ "license": "MIT",
4
5
  "source": "src/index.ts",
5
6
  "files": [
6
7
  "src",
@@ -34,12 +35,13 @@
34
35
  "clean:build": "tamagui-build clean:build"
35
36
  },
36
37
  "dependencies": {
37
- "@tamagui/stacks": "2.7.7",
38
- "@tamagui/web": "2.7.7"
38
+ "@tamagui/size": "3.0.0-beta.1093.1",
39
+ "@tamagui/stacks": "3.0.0-beta.1093.1",
40
+ "@tamagui/web": "3.0.0-beta.1093.1"
39
41
  },
40
42
  "devDependencies": {
41
- "@tamagui/build": "2.7.7",
42
- "react": ">=19"
43
+ "@tamagui/build": "3.0.0-beta.1093.1",
44
+ "react": "19.2.3"
43
45
  },
44
46
  "peerDependencies": {
45
47
  "react": ">=19"
package/src/Circle.tsx CHANGED
@@ -4,7 +4,7 @@ import { styled } from '@tamagui/web'
4
4
  import { Square } from './Square'
5
5
 
6
6
  export const Circle = styled(Square, {
7
- name: 'Circle',
7
+ displayName: 'Circle',
8
8
  borderRadius: 100_000_000,
9
9
  })
10
10
 
package/src/Square.tsx CHANGED
@@ -1,20 +1,30 @@
1
- import { ThemeableStack } from '@tamagui/stacks'
1
+ import { YStack } from '@tamagui/stacks'
2
2
  import type { GetProps } from '@tamagui/web'
3
3
  import { styled } from '@tamagui/web'
4
4
 
5
5
  import { getShapeSize } from './getShapeSize'
6
6
 
7
7
  export const Square = styled(
8
- ThemeableStack,
8
+ YStack,
9
9
  {
10
- name: 'Square',
10
+ displayName: 'Square',
11
11
  alignItems: 'center',
12
12
  justifyContent: 'center',
13
13
 
14
14
  variants: {
15
- size: {
16
- '...size': getShapeSize,
17
- ':number': getShapeSize,
15
+ size: getShapeSize,
16
+
17
+ // shape modifiers formerly inherited from ThemeableStack (now removed).
18
+ circular: {
19
+ true: {
20
+ borderRadius: 100_000,
21
+ },
22
+ },
23
+
24
+ transparent: {
25
+ true: {
26
+ backgroundColor: 'transparent',
27
+ },
18
28
  },
19
29
  } as const,
20
30
  },
@@ -1,12 +1,17 @@
1
- import type { SizableStackProps } from '@tamagui/stacks'
2
- import type { SizeVariantSpreadFunction } from '@tamagui/web'
1
+ import { resolveSize } from '@tamagui/size'
2
+ import { styled, type SizeTokens } from '@tamagui/web'
3
3
 
4
- export const getShapeSize: SizeVariantSpreadFunction<SizableStackProps> = (
5
- size,
6
- { tokens }
7
- ) => {
8
- const width = tokens.size[size] ?? size
9
- const height = tokens.size[size] ?? size
4
+ export const getShapeSize = styled.dynamic<SizeTokens | number | true>((size, env) => {
5
+ // a number is pixels. a token key is the size scale (v6: `4` is 16px). a
6
+ // named size or `true` is that size's control height, so a Square "md" is
7
+ // as tall as a Button "md".
8
+ const key = typeof size === 'string' ? size.replace(/^\$/, '') : size
9
+ const resolved =
10
+ typeof key === 'number'
11
+ ? key
12
+ : (env.tokens.size[key as any] ?? resolveSize(size, env).controlHeight)
13
+ const width = resolved
14
+ const height = resolved
10
15
  return {
11
16
  width,
12
17
  height,
@@ -15,4 +20,4 @@ export const getShapeSize: SizeVariantSpreadFunction<SizableStackProps> = (
15
20
  maxHeight: height,
16
21
  minHeight: height,
17
22
  }
18
- }
23
+ })
package/types/Circle.d.ts CHANGED
@@ -1,15 +1,29 @@
1
1
  import type { GetProps } from '@tamagui/web';
2
- export declare const Circle: import("@tamagui/web").TamaguiComponent<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
3
- elevation?: number | import("@tamagui/web").SizeTokens | undefined;
4
- size?: number | import("@tamagui/web").SizeTokens | undefined;
2
+ export declare const Circle: import("react").FunctionComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "circular" | "elevation" | "size" | "transparent" | keyof import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithFlatVariantValues<{
3
+ circular?: boolean | undefined;
4
+ elevation?: number | false | import("@tamagui/web").Size | undefined;
5
+ size?: number | import("@tamagui/web").Size | undefined;
5
6
  transparent?: boolean | undefined;
6
- fullscreen?: boolean | undefined;
7
+ }> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>> & {
8
+ ref?: import("react").Ref<import("@tamagui/web").TamaguiElement> | undefined;
9
+ }> & import("@tamagui/web").StaticComponentObject<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
7
10
  circular?: boolean | undefined;
8
- elevate?: boolean | undefined;
9
- bordered?: boolean | undefined;
10
- chromeless?: boolean | "all" | undefined;
11
+ elevation?: number | false | import("@tamagui/web").Size | undefined;
12
+ size?: number | import("@tamagui/web").Size | undefined;
13
+ transparent?: boolean | undefined;
11
14
  }, import("@tamagui/web").StaticConfigPublic & {
12
15
  memo: true;
13
- }>;
16
+ }> & Omit<import("@tamagui/web").StaticConfigPublic & {
17
+ memo: true;
18
+ }, "staticConfig"> & {
19
+ __tama: [import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
20
+ circular?: boolean | undefined;
21
+ elevation?: number | false | import("@tamagui/web").Size | undefined;
22
+ size?: number | import("@tamagui/web").Size | undefined;
23
+ transparent?: boolean | undefined;
24
+ }, import("@tamagui/web").StaticConfigPublic & {
25
+ memo: true;
26
+ }];
27
+ };
14
28
  export type CircleProps = GetProps<typeof Circle>;
15
29
  //# sourceMappingURL=Circle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["../src/Circle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAK5C,eAAO,MAAM,MAAM;;;;;;;;;;;EAGjB,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA"}
1
+ {"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["../src/Circle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAK5C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;CAGjB,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA"}
package/types/Square.d.ts CHANGED
@@ -1,15 +1,29 @@
1
1
  import type { GetProps } from '@tamagui/web';
2
- export declare const Square: import("@tamagui/web").TamaguiComponent<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
3
- elevation?: number | import("@tamagui/web").SizeTokens | undefined;
4
- size?: number | import("@tamagui/web").SizeTokens | undefined;
2
+ export declare const Square: import("react").FunctionComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "circular" | "elevation" | "size" | "transparent" | keyof import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithFlatVariantValues<{
3
+ circular?: boolean | undefined;
4
+ elevation?: number | false | import("@tamagui/web").Size | undefined;
5
+ size?: number | import("@tamagui/web").Size | undefined;
5
6
  transparent?: boolean | undefined;
6
- fullscreen?: boolean | undefined;
7
+ }> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>> & {
8
+ ref?: import("react").Ref<import("@tamagui/web").TamaguiElement> | undefined;
9
+ }> & import("@tamagui/web").StaticComponentObject<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
7
10
  circular?: boolean | undefined;
8
- elevate?: boolean | undefined;
9
- bordered?: boolean | undefined;
10
- chromeless?: boolean | "all" | undefined;
11
+ elevation?: number | false | import("@tamagui/web").Size | undefined;
12
+ size?: number | import("@tamagui/web").Size | undefined;
13
+ transparent?: boolean | undefined;
11
14
  }, import("@tamagui/web").StaticConfigPublic & {
12
15
  memo: true;
13
- }>;
16
+ }> & Omit<import("@tamagui/web").StaticConfigPublic & {
17
+ memo: true;
18
+ }, "staticConfig"> & {
19
+ __tama: [import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
20
+ circular?: boolean | undefined;
21
+ elevation?: number | false | import("@tamagui/web").Size | undefined;
22
+ size?: number | import("@tamagui/web").Size | undefined;
23
+ transparent?: boolean | undefined;
24
+ }, import("@tamagui/web").StaticConfigPublic & {
25
+ memo: true;
26
+ }];
27
+ };
14
28
  export type SquareProps = GetProps<typeof Square>;
15
29
  //# sourceMappingURL=Square.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Square.d.ts","sourceRoot":"","sources":["../src/Square.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAK5C,eAAO,MAAM,MAAM;;;;;;;;;;;EAiBlB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA"}
1
+ {"version":3,"file":"Square.d.ts","sourceRoot":"","sources":["../src/Square.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAK5C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;CA2BlB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA"}
@@ -1,4 +1,2 @@
1
- import type { SizableStackProps } from '@tamagui/stacks';
2
- import type { SizeVariantSpreadFunction } from '@tamagui/web';
3
- export declare const getShapeSize: SizeVariantSpreadFunction<SizableStackProps>;
1
+ export declare const getShapeSize: import("@tamagui/web/types/types").StyledDynamicFn<number | import("@tamagui/web").Size, Record<string, any>>;
4
2
  //# sourceMappingURL=getShapeSize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getShapeSize.d.ts","sourceRoot":"","sources":["../src/getShapeSize.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAE7D,eAAO,MAAM,YAAY,EAAE,yBAAyB,CAAC,iBAAiB,CAcrE,CAAA"}
1
+ {"version":3,"file":"getShapeSize.d.ts","sourceRoot":"","sources":["../src/getShapeSize.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,+GAmBvB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}