@tamagui/input 2.7.7 → 3.0.0-beta.1091.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 (169) hide show
  1. package/dist/cjs/Input.cjs +72 -163
  2. package/dist/cjs/Input.native.cjs +208 -0
  3. package/dist/cjs/Input.native.js +186 -283
  4. package/dist/cjs/Input.native.js.map +1 -1
  5. package/dist/cjs/InputNativeProps.cjs +9 -11
  6. package/dist/cjs/InputNativeProps.native.cjs +18 -0
  7. package/dist/cjs/InputNativeProps.native.js +9 -10
  8. package/dist/cjs/InputNativeProps.native.js.map +1 -1
  9. package/dist/cjs/TextArea.cjs +23 -39
  10. package/dist/cjs/TextArea.native.cjs +38 -0
  11. package/dist/cjs/TextArea.native.js +23 -38
  12. package/dist/cjs/TextArea.native.js.map +1 -1
  13. package/dist/cjs/index.cjs +15 -17
  14. package/dist/cjs/index.native.cjs +32 -0
  15. package/dist/cjs/index.native.js +15 -16
  16. package/dist/cjs/index.native.js.map +1 -1
  17. package/dist/cjs/shared.cjs +74 -124
  18. package/dist/cjs/shared.native.cjs +101 -0
  19. package/dist/cjs/shared.native.js +80 -129
  20. package/dist/cjs/shared.native.js.map +1 -1
  21. package/dist/cjs/types.cjs +9 -11
  22. package/dist/cjs/types.native.cjs +18 -0
  23. package/dist/cjs/types.native.js +9 -10
  24. package/dist/cjs/types.native.js.map +1 -1
  25. package/dist/esm/Input.mjs +59 -139
  26. package/dist/esm/Input.mjs.map +1 -1
  27. package/dist/esm/Input.native.js +174 -261
  28. package/dist/esm/Input.native.js.map +1 -1
  29. package/dist/esm/InputNativeProps.mjs +0 -2
  30. package/dist/esm/InputNativeProps.native.js +0 -2
  31. package/dist/esm/TextArea.mjs +12 -22
  32. package/dist/esm/TextArea.mjs.map +1 -1
  33. package/dist/esm/TextArea.native.js +12 -22
  34. package/dist/esm/TextArea.native.js.map +1 -1
  35. package/dist/esm/index.js +6 -4
  36. package/dist/esm/index.mjs +6 -4
  37. package/dist/esm/index.native.js +6 -4
  38. package/dist/esm/shared.mjs +59 -107
  39. package/dist/esm/shared.mjs.map +1 -1
  40. package/dist/esm/shared.native.js +64 -112
  41. package/dist/esm/shared.native.js.map +1 -1
  42. package/dist/esm/types.mjs +0 -2
  43. package/dist/esm/types.native.js +0 -2
  44. package/dist/jsx/Input.mjs +59 -139
  45. package/dist/jsx/Input.mjs.map +1 -1
  46. package/dist/jsx/Input.native.cjs +208 -0
  47. package/dist/jsx/Input.native.js +186 -283
  48. package/dist/jsx/Input.native.js.map +1 -1
  49. package/dist/jsx/InputNativeProps.mjs +0 -2
  50. package/dist/jsx/InputNativeProps.native.cjs +18 -0
  51. package/dist/jsx/InputNativeProps.native.js +9 -10
  52. package/dist/jsx/InputNativeProps.native.js.map +1 -1
  53. package/dist/jsx/TextArea.mjs +12 -22
  54. package/dist/jsx/TextArea.mjs.map +1 -1
  55. package/dist/jsx/TextArea.native.cjs +38 -0
  56. package/dist/jsx/TextArea.native.js +23 -38
  57. package/dist/jsx/TextArea.native.js.map +1 -1
  58. package/dist/jsx/index.js +6 -4
  59. package/dist/jsx/index.mjs +6 -4
  60. package/dist/jsx/index.native.cjs +32 -0
  61. package/dist/jsx/index.native.js +15 -16
  62. package/dist/jsx/index.native.js.map +1 -1
  63. package/dist/jsx/shared.mjs +59 -107
  64. package/dist/jsx/shared.mjs.map +1 -1
  65. package/dist/jsx/shared.native.cjs +101 -0
  66. package/dist/jsx/shared.native.js +80 -129
  67. package/dist/jsx/shared.native.js.map +1 -1
  68. package/dist/jsx/types.mjs +0 -2
  69. package/dist/jsx/types.native.cjs +18 -0
  70. package/dist/jsx/types.native.js +9 -10
  71. package/dist/jsx/types.native.js.map +1 -1
  72. package/package.json +17 -17
  73. package/src/Input.native.tsx +267 -242
  74. package/src/Input.tsx +150 -154
  75. package/src/TextArea.tsx +9 -18
  76. package/src/shared.tsx +56 -109
  77. package/src/types.ts +2 -2
  78. package/types/Input.d.ts +32 -50
  79. package/types/Input.d.ts.map +1 -1
  80. package/types/Input.native.d.ts +32 -50
  81. package/types/Input.native.d.ts.map +1 -1
  82. package/types/TextArea.d.ts +16 -34
  83. package/types/TextArea.d.ts.map +1 -1
  84. package/types/shared.d.ts +38 -109
  85. package/types/shared.d.ts.map +1 -1
  86. package/types/types.d.ts +2 -2
  87. package/types/types.d.ts.map +1 -1
  88. package/dist/cjs/inputTypes.test-d.cjs +0 -128
  89. package/dist/cjs/inputTypes.test-d.native.js +0 -131
  90. package/dist/cjs/inputTypes.test-d.native.js.map +0 -1
  91. package/dist/cjs/v1/Input.cjs +0 -200
  92. package/dist/cjs/v1/Input.native.js +0 -183
  93. package/dist/cjs/v1/Input.native.js.map +0 -1
  94. package/dist/cjs/v1/TextArea.cjs +0 -52
  95. package/dist/cjs/v1/TextArea.native.js +0 -55
  96. package/dist/cjs/v1/TextArea.native.js.map +0 -1
  97. package/dist/cjs/v1/index.cjs +0 -21
  98. package/dist/cjs/v1/index.native.js +0 -24
  99. package/dist/cjs/v1/index.native.js.map +0 -1
  100. package/dist/cjs/v1/types.cjs +0 -18
  101. package/dist/cjs/v1/types.native.js +0 -21
  102. package/dist/cjs/v1/types.native.js.map +0 -1
  103. package/dist/esm/InputNativeProps.mjs.map +0 -1
  104. package/dist/esm/InputNativeProps.native.js.map +0 -1
  105. package/dist/esm/index.js.map +0 -1
  106. package/dist/esm/index.mjs.map +0 -1
  107. package/dist/esm/index.native.js.map +0 -1
  108. package/dist/esm/inputTypes.test-d.mjs +0 -129
  109. package/dist/esm/inputTypes.test-d.mjs.map +0 -1
  110. package/dist/esm/inputTypes.test-d.native.js +0 -129
  111. package/dist/esm/inputTypes.test-d.native.js.map +0 -1
  112. package/dist/esm/types.mjs.map +0 -1
  113. package/dist/esm/types.native.js.map +0 -1
  114. package/dist/esm/v1/Input.mjs +0 -164
  115. package/dist/esm/v1/Input.mjs.map +0 -1
  116. package/dist/esm/v1/Input.native.js +0 -144
  117. package/dist/esm/v1/Input.native.js.map +0 -1
  118. package/dist/esm/v1/TextArea.mjs +0 -27
  119. package/dist/esm/v1/TextArea.mjs.map +0 -1
  120. package/dist/esm/v1/TextArea.native.js +0 -27
  121. package/dist/esm/v1/TextArea.native.js.map +0 -1
  122. package/dist/esm/v1/index.mjs +0 -3
  123. package/dist/esm/v1/index.mjs.map +0 -1
  124. package/dist/esm/v1/index.native.js +0 -3
  125. package/dist/esm/v1/index.native.js.map +0 -1
  126. package/dist/esm/v1/types.mjs +0 -2
  127. package/dist/esm/v1/types.mjs.map +0 -1
  128. package/dist/esm/v1/types.native.js +0 -2
  129. package/dist/esm/v1/types.native.js.map +0 -1
  130. package/dist/jsx/InputNativeProps.mjs.map +0 -1
  131. package/dist/jsx/index.js.map +0 -1
  132. package/dist/jsx/index.mjs.map +0 -1
  133. package/dist/jsx/inputTypes.test-d.mjs +0 -129
  134. package/dist/jsx/inputTypes.test-d.mjs.map +0 -1
  135. package/dist/jsx/inputTypes.test-d.native.js +0 -131
  136. package/dist/jsx/inputTypes.test-d.native.js.map +0 -1
  137. package/dist/jsx/types.mjs.map +0 -1
  138. package/dist/jsx/v1/Input.mjs +0 -164
  139. package/dist/jsx/v1/Input.mjs.map +0 -1
  140. package/dist/jsx/v1/Input.native.js +0 -183
  141. package/dist/jsx/v1/Input.native.js.map +0 -1
  142. package/dist/jsx/v1/TextArea.mjs +0 -27
  143. package/dist/jsx/v1/TextArea.mjs.map +0 -1
  144. package/dist/jsx/v1/TextArea.native.js +0 -55
  145. package/dist/jsx/v1/TextArea.native.js.map +0 -1
  146. package/dist/jsx/v1/index.mjs +0 -3
  147. package/dist/jsx/v1/index.mjs.map +0 -1
  148. package/dist/jsx/v1/index.native.js +0 -24
  149. package/dist/jsx/v1/index.native.js.map +0 -1
  150. package/dist/jsx/v1/types.mjs +0 -2
  151. package/dist/jsx/v1/types.mjs.map +0 -1
  152. package/dist/jsx/v1/types.native.js +0 -21
  153. package/dist/jsx/v1/types.native.js.map +0 -1
  154. package/src/inputTypes.test-d.ts +0 -245
  155. package/src/v1/Input.native.tsx +0 -153
  156. package/src/v1/Input.tsx +0 -190
  157. package/src/v1/TextArea.tsx +0 -35
  158. package/src/v1/index.ts +0 -3
  159. package/src/v1/types.ts +0 -65
  160. package/types/v1/Input.d.ts +0 -64
  161. package/types/v1/Input.d.ts.map +0 -1
  162. package/types/v1/Input.native.d.ts +0 -63
  163. package/types/v1/Input.native.d.ts.map +0 -1
  164. package/types/v1/TextArea.d.ts +0 -41
  165. package/types/v1/TextArea.d.ts.map +0 -1
  166. package/types/v1/index.d.ts +0 -4
  167. package/types/v1/index.d.ts.map +0 -1
  168. package/types/v1/types.d.ts +0 -39
  169. package/types/v1/types.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["styled","Input","defaultStyles","textAreaSizeVariant","TextArea","name","render","whiteSpace","variants","unstyled","false","height","rows","size","defaultVariants","process","env","TAMAGUI_HEADLESS"],"sources":["../../src/TextArea.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAAwBA,MAAA,QAAc;AACtC,SAASC,KAAA,QAAa;AACtB,SAASC,aAAA,EAAeC,mBAAA,QAA2B;AAM5C,MAAMC,QAAA,GAAWJ,MAAA,CAAOC,KAAA,EAAO;EACpCI,IAAA,EAAM;EACNC,MAAA,EAAQ;EAAA;EAAA;EAIRC,UAAA,EAAY;EAEZC,QAAA,EAAU;IACRC,QAAA,EAAU;MACRC,KAAA,EAAO;QACLC,MAAA,EAAQ;QACR,GAAGT,aAAA;QACHU,IAAA,EAAM;MACR;IACF;IAEAC,IAAA,EAAM;MACJ,WAAWV;IACb;EACF;EAEAW,eAAA,EAAiB;IACfL,QAAA,EAAUM,OAAA,CAAQC,GAAA,CAAIC,gBAAA,KAAqB;EAC7C;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"TextArea.js","names":[],"sources":["jsx/TextArea.js"],"sourcesContent":["import { styled } from \"@tamagui/web\";\nimport { Input } from \"./Input\";\nimport { defaultStyles, resolveTextAreaSize, textAreaSizeVariant } from \"./shared\";\nconst TextAreaFrame = styled(Input, {\n displayName: \"TextArea\",\n render: \"textarea\",\n // this attribute fixes firefox newline issue\n // @ts-ignore\n whiteSpace: \"pre-wrap\",\n height: \"auto\",\n ...defaultStyles,\n rows: 3,\n variants: {\n size: textAreaSizeVariant\n }\n});\nconst TextArea = TextAreaFrame.resolve(resolveTextAreaSize);\nexport {\n TextArea\n};\n//# sourceMappingURL=TextArea.js.map\n"],"mappings":";;;;;AAGA,MAAM,gBAAgB,OAAO,OAAO;CAClC,aAAa;CACb,QAAQ;CAGR,YAAY;CACZ,QAAQ;CACR,GAAG;CACH,MAAM;CACN,UAAU,EACR,MAAM,oBACR;AACF,CAAC;AACD,MAAM,WAAW,cAAc,QAAQ,mBAAmB"}
@@ -0,0 +1,38 @@
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 TextArea_exports = {};
24
+ __export(TextArea_exports, { TextArea: () => TextArea });
25
+ module.exports = __toCommonJS(TextArea_exports);
26
+ var import_web = require("@tamagui/web");
27
+ var import_Input = require("./Input.native.js");
28
+ var import_shared = require("./shared.native.js");
29
+ var TextAreaFrame = (0, import_web.styled)(import_Input.Input, {
30
+ displayName: "TextArea",
31
+ render: "textarea",
32
+ whiteSpace: "pre-wrap",
33
+ height: "auto",
34
+ ...import_shared.defaultStyles,
35
+ rows: 3,
36
+ variants: { size: import_shared.textAreaSizeVariant }
37
+ });
38
+ var TextArea = TextAreaFrame.resolve(import_shared.resolveTextAreaSize);
@@ -5,51 +5,36 @@ 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 TextArea_exports = {};
26
- __export(TextArea_exports, {
27
- TextArea: () => TextArea
28
- });
24
+ __export(TextArea_exports, { TextArea: () => TextArea });
29
25
  module.exports = __toCommonJS(TextArea_exports);
30
26
  var import_web = require("@tamagui/web");
31
27
  var import_Input = require("./Input.native.js");
32
28
  var import_shared = require("./shared.native.js");
33
- var TextArea = (0, import_web.styled)(import_Input.Input, {
34
- name: "TextArea",
35
- render: "textarea",
36
- // this attribute fixes firefox newline issue
37
- // @ts-ignore
38
- whiteSpace: "pre-wrap",
39
- variants: {
40
- unstyled: {
41
- false: {
42
- height: "auto",
43
- ...import_shared.defaultStyles,
44
- rows: 3
45
- }
46
- },
47
- size: {
48
- "...size": import_shared.textAreaSizeVariant
49
- }
50
- },
51
- defaultVariants: {
52
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
53
- }
29
+ var TextAreaFrame = (0, import_web.styled)(import_Input.Input, {
30
+ displayName: "TextArea",
31
+ render: "textarea",
32
+ whiteSpace: "pre-wrap",
33
+ height: "auto",
34
+ ...import_shared.defaultStyles,
35
+ rows: 3,
36
+ variants: { size: import_shared.textAreaSizeVariant }
54
37
  });
38
+ var TextArea = TextAreaFrame.resolve(import_shared.resolveTextAreaSize);
39
+
55
40
  //# sourceMappingURL=TextArea.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","call","__toCommonJS","mod","value","TextArea_exports","TextArea","module","exports","import_web","require","import_Input"],"sources":["../../src/TextArea.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAwB;;AACxB,IAAAA,SAAS,GAAAC,MAAa,CAAAC,cAAA;AACtB,IAAAC,gBAAS,GAAAF,MAAe,CAAAG,wBAA2B;AAM5C,IAAAC,iBAAiB,GAAOJ,MAAA,CAAOK,mBAAA;AAAA,IACpCC,YAAM,GAAAN,MAAA,CAAAO,SAAA,CAAAC,cAAA;AAAA,IACNC,QAAQ,GAAAA,CAAAC,MAAA,EAAAC,GAAA;EAAA,SAAAC,IAAA,IAAAD,GAAA,EAAAZ,SAAA,CAAAW,MAAA,EAAAE,IAAA;IAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA;AAAA;AAII,IAEZC,WAAU,GAAAA,CAAAC,EAAA,EAAAC,IAAA,EAAAC,MAAA,EAAAC,IAAA;EAAA,IACRF,IAAA,IAAU,OAAAA,IAAA,wBAAAA,IAAA;IAAA,KACR,IAAOG,GAAA,IAAAhB,iBAAA,CAAAa,IAAA,OACL,CAAAX,YAAQ,CAAAe,IAAA,CAAAL,EAAA,EAAAI,GAAA,KAAAA,GAAA,KAAAF,MAAA,EACRnB,SAAG,CAAAiB,EAAA,EAAAI,GAAA;MAAAP,GAAA,EAAAA,CAAA,KAAAI,IAAA,CAAAG,GAAA;MAAAN,UAAA,IAAAK,IAAA,GAAAjB,gBAAA,CAAAe,IAAA,EAAAG,GAAA,MAAAD,IAAA,CAAAL;IAAA;EAAA;EACG,OACRE,EAAA;AAAA;AACF,IAEAM,YAAM,GAAAC,GAAA,IAAAR,WAAA,CAAAhB,SAAA;EAAAyB,KAAA;AAAA,IAAAD,GAAA;AAAA,IAAAE,gBACO;AAAAhB,QACb,CAAAgB,gBAAA;EACFC,QAAA,EAAAA,CAAA,KAAAA;AAAA,EAEA;AAAiBC,MACf,CAAAC,OAAU,GAAAN,YAAY,CAAAG,gBAAA,CAAqB;AAAA,IAC7CI,UAAA,GAAAC,OAAA;AACF,IAACC,YAAA,GAAAD,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"TextArea.native.js","names":[],"sources":["jsx/TextArea.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 TextArea_exports = {};\n__export(TextArea_exports, {\n TextArea: () => TextArea\n});\nmodule.exports = __toCommonJS(TextArea_exports);\nvar import_web = require(\"@tamagui/web\");\nvar import_Input = require(\"./Input\");\nvar import_shared = require(\"./shared\");\nvar TextAreaFrame = (0, import_web.styled)(import_Input.Input, {\n displayName: \"TextArea\",\n render: \"textarea\",\n // this attribute fixes firefox newline issue\n // @ts-ignore\n whiteSpace: \"pre-wrap\",\n height: \"auto\",\n ...import_shared.defaultStyles,\n rows: 3,\n variants: {\n size: import_shared.textAreaSizeVariant\n }\n});\nvar TextArea = TextAreaFrame.resolve(import_shared.resolveTextAreaSize);\n//# sourceMappingURL=TextArea.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,EACzB,gBAAgB,SAClB,CAAC;AACD,OAAO,UAAU,aAAa,gBAAgB;AAC9C,IAAI,aAAa,QAAQ,cAAc;AACvC,IAAI,eAAe,QAAQ,mBAAS;AACpC,IAAI,gBAAgB,QAAQ,oBAAU;AACtC,IAAI,iBAAiB,GAAG,WAAW,OAAM,CAAE,aAAa,OAAO;CAC7D,aAAa;CACb,QAAQ;CAGR,YAAY;CACZ,QAAQ;CACR,GAAG,cAAc;CACjB,MAAM;CACN,UAAU,EACR,MAAM,cAAc,oBACtB;AACF,CAAC;AACD,IAAI,WAAW,cAAc,QAAQ,cAAc,mBAAmB"}
package/dist/jsx/index.js CHANGED
@@ -1,5 +1,7 @@
1
- export * from "./Input.mjs";
2
- export * from "./TextArea.mjs";
3
1
  import { inputSizeVariant, textAreaSizeVariant } from "./shared.mjs";
4
- export { inputSizeVariant, textAreaSizeVariant };
5
- //# sourceMappingURL=index.js.map
2
+
3
+ export * from "./Input.mjs"
4
+
5
+ export * from "./TextArea.mjs"
6
+
7
+ export { inputSizeVariant, textAreaSizeVariant };
@@ -1,5 +1,7 @@
1
- export * from "./Input.mjs";
2
- export * from "./TextArea.mjs";
3
1
  import { inputSizeVariant, textAreaSizeVariant } from "./shared.mjs";
4
- export { inputSizeVariant, textAreaSizeVariant };
5
- //# sourceMappingURL=index.mjs.map
2
+
3
+ export * from "./Input.mjs"
4
+
5
+ export * from "./TextArea.mjs"
6
+
7
+ export { inputSizeVariant, textAreaSizeVariant };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: 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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
+ var index_exports = {};
25
+ __export(index_exports, {
26
+ inputSizeVariant: () => import_shared.inputSizeVariant,
27
+ textAreaSizeVariant: () => import_shared.textAreaSizeVariant
28
+ });
29
+ module.exports = __toCommonJS(index_exports);
30
+ __reExport(index_exports, require("./Input.native.js"), module.exports);
31
+ __reExport(index_exports, require("./TextArea.native.js"), module.exports);
32
+ var import_shared = require("./shared.native.js");
@@ -5,31 +5,30 @@ 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
22
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
23
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
24
- value: true
25
- }), mod);
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
26
24
  var index_exports = {};
27
25
  __export(index_exports, {
28
- inputSizeVariant: () => import_shared.inputSizeVariant,
29
- textAreaSizeVariant: () => import_shared.textAreaSizeVariant
26
+ inputSizeVariant: () => import_shared.inputSizeVariant,
27
+ textAreaSizeVariant: () => import_shared.textAreaSizeVariant
30
28
  });
31
29
  module.exports = __toCommonJS(index_exports);
32
30
  __reExport(index_exports, require("./Input.native.js"), module.exports);
33
31
  __reExport(index_exports, require("./TextArea.native.js"), module.exports);
34
32
  var import_shared = require("./shared.native.js");
33
+
35
34
  //# 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,gBAAS,GAAAF,MAAkB,CAAAG,wBAA2B","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 __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 __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 = {};\n__export(index_exports, {\n inputSizeVariant: () => import_shared.inputSizeVariant,\n textAreaSizeVariant: () => import_shared.textAreaSizeVariant\n});\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./Input\"), module.exports);\n__reExport(index_exports, require(\"./TextArea\"), module.exports);\nvar import_shared = require(\"./shared\");\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,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,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,SAAS,eAAe;CACtB,wBAAwB,cAAc;CACtC,2BAA2B,cAAc;AAC3C,CAAC;AACD,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,mBAAS,GAAG,OAAO,OAAO;AAC5D,WAAW,eAAe,QAAQ,sBAAY,GAAG,OAAO,OAAO;AAC/D,IAAI,gBAAgB,QAAQ,oBAAU"}
@@ -1,115 +1,67 @@
1
- import { Text } from "@tamagui/core";
2
- import { getVariableValue, isWeb } from "@tamagui/core";
3
- import { getButtonSized } from "@tamagui/get-button-sized";
1
+ import { getVariableValue, isWeb, resolveSize, styled } from "@tamagui/core";
4
2
  import { getFontSized } from "@tamagui/get-font-sized";
5
- import { getSpace } from "@tamagui/get-token";
3
+
6
4
  const defaultStyles = {
7
- size: "$true",
8
- fontFamily: "$body",
9
- borderWidth: 1,
10
- outlineWidth: 0,
11
- color: "$color",
12
- ...(isWeb ? {
13
- tabIndex: 0
14
- } : {
15
- focusable: true
16
- }),
17
- borderColor: "$borderColor",
18
- backgroundColor: "$background",
19
- // this fixes a flex bug where it overflows container
20
- minWidth: 0,
21
- hoverStyle: {
22
- borderColor: "$borderColorHover"
23
- },
24
- focusStyle: {
25
- borderColor: "$borderColorFocus"
26
- },
27
- focusVisibleStyle: {
28
- outlineColor: "$outlineColor",
29
- outlineWidth: 2,
30
- outlineStyle: "solid"
31
- }
5
+ size: true,
6
+ outlineWidth: 0,
7
+ tabIndex: 0,
8
+ minWidth: 0
32
9
  };
33
- const inputSizeVariant = (val = "$true", extras) => {
34
- if (extras.props.tag === "textarea" || extras.props.rows > 1 || extras.props.multiline || extras.props.numberOfLines > 1) {
35
- return textAreaSizeVariant(val, extras);
36
- }
37
- const buttonStyles = getButtonSized(val, extras);
38
- const paddingHorizontal = getSpace(val, {
39
- shift: -1,
40
- bounds: [2]
41
- });
42
- const fontStyle = getFontSized(val, extras);
43
- if (!isWeb && fontStyle) {
44
- delete fontStyle["lineHeight"];
45
- }
46
- return {
47
- ...fontStyle,
48
- ...buttonStyles,
49
- paddingHorizontal
50
- };
10
+ const inputSizeVariant = styled.dynamic((val = true, env) => {
11
+ const { frame } = resolveSize(val, env);
12
+ const fontStyle = getFontSized(val, env);
13
+ return {
14
+ color: fontStyle?.color,
15
+ fontFamily: fontStyle?.fontFamily,
16
+ fontSize: fontStyle?.fontSize,
17
+ fontStyle: fontStyle?.fontStyle,
18
+ fontWeight: fontStyle?.fontWeight,
19
+ letterSpacing: fontStyle?.letterSpacing,
20
+ lineHeight: isWeb ? fontStyle?.lineHeight : void 0,
21
+ textTransform: fontStyle?.textTransform,
22
+ ...frame
23
+ };
24
+ });
25
+ const textAreaSizeVariant = styled.dynamic((val = true, env) => {
26
+ return {
27
+ ...inputSizeVariant(val, env),
28
+ height: "auto"
29
+ };
30
+ });
31
+ const resolveTextAreaSize = (props, env) => {
32
+ const sized = textAreaSizeVariant(props.size ?? true, env);
33
+ const fontStyle = getFontSized(props.size ?? true, env);
34
+ const lines = props.rows ?? props.numberOfLines;
35
+ const height = typeof lines === "number" ? lines * getVariableValue(fontStyle?.lineHeight) : sized?.height;
36
+ return {
37
+ borderRadius: sized?.borderRadius,
38
+ color: sized?.color,
39
+ fontFamily: sized?.fontFamily,
40
+ fontSize: sized?.fontSize,
41
+ fontStyle: sized?.fontStyle,
42
+ fontWeight: sized?.fontWeight,
43
+ letterSpacing: sized?.letterSpacing,
44
+ lineHeight: sized?.lineHeight,
45
+ textTransform: sized?.textTransform,
46
+ paddingVertical: sized?.paddingVertical,
47
+ paddingHorizontal: sized?.paddingHorizontal,
48
+ height
49
+ };
51
50
  };
52
- const textAreaSizeVariant = (val = "$true", extras) => {
53
- const {
54
- props
55
- } = extras;
56
- const buttonStyles = getButtonSized(val, extras);
57
- const fontStyle = getFontSized(val, extras);
58
- const lines = props.rows ?? props.numberOfLines;
59
- const height = typeof lines === "number" ? lines * getVariableValue(fontStyle.lineHeight) : "auto";
60
- if (!isWeb && fontStyle) {
61
- delete fontStyle["lineHeight"];
62
- }
63
- const paddingVertical = getSpace(val, {
64
- shift: -2,
65
- bounds: [2]
66
- });
67
- const paddingHorizontal = getSpace(val, {
68
- shift: -1,
69
- bounds: [2]
70
- });
71
- return {
72
- ...buttonStyles,
73
- ...fontStyle,
74
- paddingVertical,
75
- paddingHorizontal,
76
- height
77
- };
51
+ const resolveMultilineInputSize = (props, env) => {
52
+ if (!(props.rows > 1 || props.multiline || props.numberOfLines > 1)) return;
53
+ return resolveTextAreaSize(props, env);
78
54
  };
79
55
  const INPUT_NAME = "Input";
80
56
  const styledBody = [{
81
- name: INPUT_NAME,
82
- render: "input",
83
- variants: {
84
- unstyled: {
85
- true: {
86
- // reset browser <input>/<textarea> defaults
87
- outlineWidth: 0,
88
- borderWidth: 0,
89
- backgroundColor: "transparent"
90
- },
91
- false: defaultStyles
92
- },
93
- size: {
94
- "...size": inputSizeVariant
95
- },
96
- disabled: {
97
- true: {}
98
- }
99
- },
100
- defaultVariants: {
101
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
102
- }
103
- }, {
104
- isInput: true,
105
- accept: {
106
- placeholderTextColor: "color",
107
- selectionColor: "color",
108
- cursorColor: "color",
109
- selectionHandleColor: "color",
110
- underlineColorAndroid: "color"
111
- },
112
- validStyles: Text.staticConfig.validStyles
113
- }];
114
- export { INPUT_NAME, defaultStyles, inputSizeVariant, styledBody, textAreaSizeVariant };
57
+ name: INPUT_NAME,
58
+ render: "input",
59
+ ...defaultStyles,
60
+ variants: {
61
+ size: inputSizeVariant,
62
+ disabled: { true: {} }
63
+ }
64
+ }, { isInput: true }];
65
+
66
+ export { INPUT_NAME, defaultStyles, inputSizeVariant, resolveMultilineInputSize, resolveTextAreaSize, styledBody, textAreaSizeVariant };
115
67
  //# sourceMappingURL=shared.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["Text","getVariableValue","isWeb","getButtonSized","getFontSized","getSpace","defaultStyles","size","fontFamily","borderWidth","outlineWidth","color","tabIndex","focusable","borderColor","backgroundColor","minWidth","hoverStyle","focusStyle","focusVisibleStyle","outlineColor","outlineStyle","inputSizeVariant","val","extras","props","tag","rows","multiline","numberOfLines","textAreaSizeVariant","buttonStyles","paddingHorizontal","shift","bounds","fontStyle","lines","height","lineHeight","paddingVertical","INPUT_NAME","styledBody","name","render","variants","unstyled","true","false","disabled","defaultVariants","process","env","TAMAGUI_HEADLESS","isInput","accept","placeholderTextColor","selectionColor","cursorColor","selectionHandleColor","underlineColorAndroid","validStyles","staticConfig"],"sources":["../../src/shared.tsx"],"sourcesContent":[null],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"shared.js","names":[],"sources":["jsx/shared.js"],"sourcesContent":["import { getVariableValue, isWeb, resolveSize, styled } from \"@tamagui/core\";\nimport { getFontSized } from \"@tamagui/get-font-sized\";\nconst defaultStyles = {\n size: true,\n outlineWidth: 0,\n tabIndex: 0,\n // this fixes a flex bug where it overflows container\n minWidth: 0\n};\nconst inputSizeVariant = styled.dynamic((val = true, env) => {\n const { frame } = resolveSize(val, env);\n const fontStyle = getFontSized(val, env);\n return {\n color: fontStyle?.color,\n fontFamily: fontStyle?.fontFamily,\n fontSize: fontStyle?.fontSize,\n fontStyle: fontStyle?.fontStyle,\n fontWeight: fontStyle?.fontWeight,\n letterSpacing: fontStyle?.letterSpacing,\n lineHeight: isWeb ? fontStyle?.lineHeight : void 0,\n textTransform: fontStyle?.textTransform,\n ...frame\n };\n});\nconst textAreaSizeVariant = styled.dynamic((val = true, env) => {\n return {\n ...inputSizeVariant(val, env),\n height: \"auto\"\n };\n});\nconst resolveTextAreaSize = (props, env) => {\n const sized = textAreaSizeVariant(props.size ?? true, env);\n const fontStyle = getFontSized(props.size ?? true, env);\n const lines = props.rows ?? props.numberOfLines;\n const height = typeof lines === \"number\" ? lines * getVariableValue(fontStyle?.lineHeight) : sized?.height;\n return {\n borderRadius: sized?.borderRadius,\n color: sized?.color,\n fontFamily: sized?.fontFamily,\n fontSize: sized?.fontSize,\n fontStyle: sized?.fontStyle,\n fontWeight: sized?.fontWeight,\n letterSpacing: sized?.letterSpacing,\n lineHeight: sized?.lineHeight,\n textTransform: sized?.textTransform,\n paddingVertical: sized?.paddingVertical,\n paddingHorizontal: sized?.paddingHorizontal,\n height\n };\n};\nconst resolveMultilineInputSize = (props, env) => {\n if (!(props.rows > 1 || props.multiline || props.numberOfLines > 1)) return;\n return resolveTextAreaSize(props, env);\n};\nconst INPUT_NAME = \"Input\";\nconst styledBody = [\n {\n name: INPUT_NAME,\n render: \"input\",\n ...defaultStyles,\n variants: {\n size: inputSizeVariant,\n disabled: {\n true: {}\n }\n }\n },\n {\n isInput: true\n }\n];\nexport {\n INPUT_NAME,\n defaultStyles,\n inputSizeVariant,\n resolveMultilineInputSize,\n resolveTextAreaSize,\n styledBody,\n textAreaSizeVariant\n};\n//# sourceMappingURL=shared.js.map\n"],"mappings":";;;;AAEA,MAAM,gBAAgB;CACpB,MAAM;CACN,cAAc;CACd,UAAU;CAEV,UAAU;AACZ;AACA,MAAM,mBAAmB,OAAO,SAAS,MAAM,MAAM,QAAQ;CAC3D,MAAM,EAAE,UAAU,YAAY,KAAK,GAAG;CACtC,MAAM,YAAY,aAAa,KAAK,GAAG;CACvC,OAAO;EACL,OAAO,WAAW;EAClB,YAAY,WAAW;EACvB,UAAU,WAAW;EACrB,WAAW,WAAW;EACtB,YAAY,WAAW;EACvB,eAAe,WAAW;EAC1B,YAAY,QAAQ,WAAW,aAAa,KAAK;EACjD,eAAe,WAAW;EAC1B,GAAG;CACL;AACF,CAAC;AACD,MAAM,sBAAsB,OAAO,SAAS,MAAM,MAAM,QAAQ;CAC9D,OAAO;EACL,GAAG,iBAAiB,KAAK,GAAG;EAC5B,QAAQ;CACV;AACF,CAAC;AACD,MAAM,uBAAuB,OAAO,QAAQ;CAC1C,MAAM,QAAQ,oBAAoB,MAAM,QAAQ,MAAM,GAAG;CACzD,MAAM,YAAY,aAAa,MAAM,QAAQ,MAAM,GAAG;CACtD,MAAM,QAAQ,MAAM,QAAQ,MAAM;CAClC,MAAM,SAAS,OAAO,UAAU,WAAW,QAAQ,iBAAiB,WAAW,UAAU,IAAI,OAAO;CACpG,OAAO;EACL,cAAc,OAAO;EACrB,OAAO,OAAO;EACd,YAAY,OAAO;EACnB,UAAU,OAAO;EACjB,WAAW,OAAO;EAClB,YAAY,OAAO;EACnB,eAAe,OAAO;EACtB,YAAY,OAAO;EACnB,eAAe,OAAO;EACtB,iBAAiB,OAAO;EACxB,mBAAmB,OAAO;EAC1B;CACF;AACF;AACA,MAAM,6BAA6B,OAAO,QAAQ;CAChD,IAAI,EAAE,MAAM,OAAO,KAAK,MAAM,aAAa,MAAM,gBAAgB,IAAI;CACrE,OAAO,oBAAoB,OAAO,GAAG;AACvC;AACA,MAAM,aAAa;AACnB,MAAM,aAAa,CACjB;CACE,MAAM;CACN,QAAQ;CACR,GAAG;CACH,UAAU;EACR,MAAM;EACN,UAAU,EACR,MAAM,CAAC,EACT;CACF;AACF,GACA,EACE,SAAS,KACX,CACF"}
@@ -0,0 +1,101 @@
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 shared_exports = {};
24
+ __export(shared_exports, {
25
+ INPUT_NAME: () => INPUT_NAME,
26
+ defaultStyles: () => defaultStyles,
27
+ inputSizeVariant: () => inputSizeVariant,
28
+ resolveMultilineInputSize: () => resolveMultilineInputSize,
29
+ resolveTextAreaSize: () => resolveTextAreaSize,
30
+ styledBody: () => styledBody,
31
+ textAreaSizeVariant: () => textAreaSizeVariant
32
+ });
33
+ module.exports = __toCommonJS(shared_exports);
34
+ var import_core = require("@tamagui/core");
35
+ var import_get_font_sized = require("@tamagui/get-font-sized");
36
+ var defaultStyles = {
37
+ size: true,
38
+ outlineWidth: 0,
39
+ tabIndex: 0,
40
+ minWidth: 0
41
+ };
42
+ var inputSizeVariant = import_core.styled.dynamic(function() {
43
+ var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, env = arguments.length > 1 ? arguments[1] : void 0;
44
+ var { frame } = (0, import_core.resolveSize)(val, env);
45
+ var fontStyle = (0, import_get_font_sized.getFontSized)(val, env);
46
+ return {
47
+ color: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.color,
48
+ fontFamily: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontFamily,
49
+ fontSize: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontSize,
50
+ fontStyle: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontStyle,
51
+ fontWeight: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontWeight,
52
+ letterSpacing: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.letterSpacing,
53
+ lineHeight: import_core.isWeb ? fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.lineHeight : void 0,
54
+ textTransform: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.textTransform,
55
+ ...frame
56
+ };
57
+ });
58
+ var textAreaSizeVariant = import_core.styled.dynamic(function() {
59
+ var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, env = arguments.length > 1 ? arguments[1] : void 0;
60
+ return {
61
+ ...inputSizeVariant(val, env),
62
+ height: "auto"
63
+ };
64
+ });
65
+ var resolveTextAreaSize = function(props, env) {
66
+ var _props_size;
67
+ var sized = textAreaSizeVariant((_props_size = props.size) !== null && _props_size !== void 0 ? _props_size : true, env);
68
+ var _props_size1;
69
+ var fontStyle = (0, import_get_font_sized.getFontSized)((_props_size1 = props.size) !== null && _props_size1 !== void 0 ? _props_size1 : true, env);
70
+ var _props_rows;
71
+ var lines = (_props_rows = props.rows) !== null && _props_rows !== void 0 ? _props_rows : props.numberOfLines;
72
+ var height = typeof lines === "number" ? lines * (0, import_core.getVariableValue)(fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.lineHeight) : sized === null || sized === void 0 ? void 0 : sized.height;
73
+ return {
74
+ borderRadius: sized === null || sized === void 0 ? void 0 : sized.borderRadius,
75
+ color: sized === null || sized === void 0 ? void 0 : sized.color,
76
+ fontFamily: sized === null || sized === void 0 ? void 0 : sized.fontFamily,
77
+ fontSize: sized === null || sized === void 0 ? void 0 : sized.fontSize,
78
+ fontStyle: sized === null || sized === void 0 ? void 0 : sized.fontStyle,
79
+ fontWeight: sized === null || sized === void 0 ? void 0 : sized.fontWeight,
80
+ letterSpacing: sized === null || sized === void 0 ? void 0 : sized.letterSpacing,
81
+ lineHeight: sized === null || sized === void 0 ? void 0 : sized.lineHeight,
82
+ textTransform: sized === null || sized === void 0 ? void 0 : sized.textTransform,
83
+ paddingVertical: sized === null || sized === void 0 ? void 0 : sized.paddingVertical,
84
+ paddingHorizontal: sized === null || sized === void 0 ? void 0 : sized.paddingHorizontal,
85
+ height
86
+ };
87
+ };
88
+ var resolveMultilineInputSize = function(props, env) {
89
+ if (!(props.rows > 1 || props.multiline || props.numberOfLines > 1)) return;
90
+ return resolveTextAreaSize(props, env);
91
+ };
92
+ var INPUT_NAME = "Input";
93
+ var styledBody = [{
94
+ name: INPUT_NAME,
95
+ render: "input",
96
+ ...defaultStyles,
97
+ variants: {
98
+ size: inputSizeVariant,
99
+ disabled: { true: {} }
100
+ }
101
+ }, { isInput: true }];