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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/cjs/Input.cjs +165 -153
  2. package/dist/cjs/Input.native.js +255 -257
  3. package/dist/cjs/Input.native.js.map +1 -1
  4. package/dist/cjs/InputNativeProps.cjs +7 -5
  5. package/dist/cjs/InputNativeProps.native.js +7 -5
  6. package/dist/cjs/InputNativeProps.native.js.map +1 -1
  7. package/dist/cjs/TextArea.cjs +15 -13
  8. package/dist/cjs/TextArea.native.js +34 -32
  9. package/dist/cjs/TextArea.native.js.map +1 -1
  10. package/dist/cjs/index.cjs +13 -11
  11. package/dist/cjs/index.native.js +13 -11
  12. package/dist/cjs/index.native.js.map +1 -1
  13. package/dist/cjs/inputTypes.test-d.cjs +125 -0
  14. package/dist/cjs/inputTypes.test-d.native.js +128 -0
  15. package/dist/cjs/inputTypes.test-d.native.js.map +1 -0
  16. package/dist/cjs/shared.cjs +113 -101
  17. package/dist/cjs/shared.native.js +119 -107
  18. package/dist/cjs/shared.native.js.map +1 -1
  19. package/dist/cjs/types.cjs +7 -5
  20. package/dist/cjs/types.native.js +7 -5
  21. package/dist/cjs/types.native.js.map +1 -1
  22. package/dist/cjs/v1/Input.cjs +175 -168
  23. package/dist/cjs/v1/Input.native.js +154 -112
  24. package/dist/cjs/v1/Input.native.js.map +1 -1
  25. package/dist/cjs/v1/TextArea.cjs +15 -13
  26. package/dist/cjs/v1/TextArea.native.js +34 -32
  27. package/dist/cjs/v1/TextArea.native.js.map +1 -1
  28. package/dist/cjs/v1/index.cjs +7 -5
  29. package/dist/cjs/v1/index.native.js +7 -5
  30. package/dist/cjs/v1/index.native.js.map +1 -1
  31. package/dist/cjs/v1/types.cjs +7 -5
  32. package/dist/cjs/v1/types.native.js +7 -5
  33. package/dist/cjs/v1/types.native.js.map +1 -1
  34. package/dist/esm/Input.mjs +134 -124
  35. package/dist/esm/Input.mjs.map +1 -1
  36. package/dist/esm/Input.native.js +225 -229
  37. package/dist/esm/Input.native.js.map +1 -1
  38. package/dist/esm/TextArea.mjs.map +1 -1
  39. package/dist/esm/TextArea.native.js.map +1 -1
  40. package/dist/esm/index.js +4 -7
  41. package/dist/esm/index.js.map +1 -6
  42. package/dist/esm/inputTypes.test-d.mjs +126 -0
  43. package/dist/esm/inputTypes.test-d.mjs.map +1 -0
  44. package/dist/esm/inputTypes.test-d.native.js +126 -0
  45. package/dist/esm/inputTypes.test-d.native.js.map +1 -0
  46. package/dist/esm/shared.mjs +96 -86
  47. package/dist/esm/shared.mjs.map +1 -1
  48. package/dist/esm/shared.native.js +101 -91
  49. package/dist/esm/shared.native.js.map +1 -1
  50. package/dist/esm/v1/Input.mjs +144 -139
  51. package/dist/esm/v1/Input.mjs.map +1 -1
  52. package/dist/esm/v1/Input.native.js +123 -83
  53. package/dist/esm/v1/Input.native.js.map +1 -1
  54. package/dist/jsx/Input.mjs +134 -124
  55. package/dist/jsx/Input.mjs.map +1 -1
  56. package/dist/jsx/Input.native.js +255 -257
  57. package/dist/jsx/Input.native.js.map +1 -1
  58. package/dist/jsx/InputNativeProps.native.js +7 -5
  59. package/dist/jsx/TextArea.mjs.map +1 -1
  60. package/dist/jsx/TextArea.native.js +34 -32
  61. package/dist/jsx/TextArea.native.js.map +1 -1
  62. package/dist/jsx/index.js +4 -7
  63. package/dist/jsx/index.js.map +1 -6
  64. package/dist/jsx/index.native.js +13 -11
  65. package/dist/jsx/inputTypes.test-d.mjs +126 -0
  66. package/dist/jsx/inputTypes.test-d.mjs.map +1 -0
  67. package/dist/jsx/inputTypes.test-d.native.js +128 -0
  68. package/dist/jsx/inputTypes.test-d.native.js.map +1 -0
  69. package/dist/jsx/shared.mjs +96 -86
  70. package/dist/jsx/shared.mjs.map +1 -1
  71. package/dist/jsx/shared.native.js +119 -107
  72. package/dist/jsx/shared.native.js.map +1 -1
  73. package/dist/jsx/types.native.js +7 -5
  74. package/dist/jsx/v1/Input.mjs +144 -139
  75. package/dist/jsx/v1/Input.mjs.map +1 -1
  76. package/dist/jsx/v1/Input.native.js +154 -112
  77. package/dist/jsx/v1/Input.native.js.map +1 -1
  78. package/dist/jsx/v1/TextArea.native.js +34 -32
  79. package/dist/jsx/v1/TextArea.native.js.map +1 -1
  80. package/dist/jsx/v1/index.native.js +7 -5
  81. package/dist/jsx/v1/types.native.js +7 -5
  82. package/package.json +20 -22
  83. package/src/Input.native.tsx +3 -30
  84. package/src/Input.tsx +5 -3
  85. package/src/TextArea.tsx +3 -3
  86. package/src/index.ts +1 -1
  87. package/src/inputTypes.test-d.ts +237 -0
  88. package/src/shared.tsx +3 -0
  89. package/src/types.ts +24 -14
  90. package/types/Input.d.ts +17 -6
  91. package/types/Input.d.ts.map +1 -1
  92. package/types/Input.native.d.ts +15 -6
  93. package/types/Input.native.d.ts.map +1 -1
  94. package/types/TextArea.d.ts +11 -4
  95. package/types/TextArea.d.ts.map +1 -1
  96. package/types/index.d.ts +1 -1
  97. package/types/index.d.ts.map +1 -1
  98. package/types/shared.d.ts +3 -0
  99. package/types/shared.d.ts.map +1 -1
  100. package/types/types.d.ts +14 -4
  101. package/types/types.d.ts.map +1 -1
  102. package/types/v1/Input.d.ts +15 -6
  103. package/types/v1/Input.d.ts.map +1 -1
  104. package/types/v1/Input.native.d.ts +15 -6
  105. package/types/v1/Input.native.d.ts.map +1 -1
  106. package/types/v1/TextArea.d.ts +9 -3
  107. package/types/v1/TextArea.d.ts.map +1 -1
  108. package/dist/cjs/Input.js +0 -143
  109. package/dist/cjs/Input.js.map +0 -6
  110. package/dist/cjs/InputNativeProps.js +0 -14
  111. package/dist/cjs/InputNativeProps.js.map +0 -6
  112. package/dist/cjs/TextArea.js +0 -43
  113. package/dist/cjs/TextArea.js.map +0 -6
  114. package/dist/cjs/index.js +0 -24
  115. package/dist/cjs/index.js.map +0 -6
  116. package/dist/cjs/shared.js +0 -108
  117. package/dist/cjs/shared.js.map +0 -6
  118. package/dist/cjs/types.js +0 -14
  119. package/dist/cjs/types.js.map +0 -6
  120. package/dist/cjs/v1/Input.js +0 -171
  121. package/dist/cjs/v1/Input.js.map +0 -6
  122. package/dist/cjs/v1/TextArea.js +0 -43
  123. package/dist/cjs/v1/TextArea.js.map +0 -6
  124. package/dist/cjs/v1/index.js +0 -16
  125. package/dist/cjs/v1/index.js.map +0 -6
  126. package/dist/cjs/v1/types.js +0 -14
  127. package/dist/cjs/v1/types.js.map +0 -6
  128. package/dist/esm/Input.js +0 -124
  129. package/dist/esm/Input.js.map +0 -6
  130. package/dist/esm/InputNativeProps.js +0 -1
  131. package/dist/esm/InputNativeProps.js.map +0 -6
  132. package/dist/esm/TextArea.js +0 -29
  133. package/dist/esm/TextArea.js.map +0 -6
  134. package/dist/esm/shared.js +0 -96
  135. package/dist/esm/shared.js.map +0 -6
  136. package/dist/esm/types.js +0 -1
  137. package/dist/esm/types.js.map +0 -6
  138. package/dist/esm/v1/Input.js +0 -152
  139. package/dist/esm/v1/Input.js.map +0 -6
  140. package/dist/esm/v1/TextArea.js +0 -29
  141. package/dist/esm/v1/TextArea.js.map +0 -6
  142. package/dist/esm/v1/index.js +0 -3
  143. package/dist/esm/v1/index.js.map +0 -6
  144. package/dist/esm/v1/types.js +0 -1
  145. package/dist/esm/v1/types.js.map +0 -6
  146. package/dist/jsx/Input.js +0 -124
  147. package/dist/jsx/Input.js.map +0 -6
  148. package/dist/jsx/InputNativeProps.js +0 -1
  149. package/dist/jsx/InputNativeProps.js.map +0 -6
  150. package/dist/jsx/TextArea.js +0 -29
  151. package/dist/jsx/TextArea.js.map +0 -6
  152. package/dist/jsx/shared.js +0 -96
  153. package/dist/jsx/shared.js.map +0 -6
  154. package/dist/jsx/types.js +0 -1
  155. package/dist/jsx/types.js.map +0 -6
  156. package/dist/jsx/v1/Input.js +0 -152
  157. package/dist/jsx/v1/Input.js.map +0 -6
  158. package/dist/jsx/v1/TextArea.js +0 -29
  159. package/dist/jsx/v1/TextArea.js.map +0 -6
  160. package/dist/jsx/v1/index.js +0 -3
  161. package/dist/jsx/v1/index.js.map +0 -6
  162. package/dist/jsx/v1/types.js +0 -1
  163. package/dist/jsx/v1/types.js.map +0 -6
@@ -5,49 +5,51 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: !0
23
+ value: true
22
24
  }), mod);
23
25
  var TextArea_exports = {};
24
26
  __export(TextArea_exports, {
25
27
  TextArea: () => TextArea
26
28
  });
27
29
  module.exports = __toCommonJS(TextArea_exports);
28
- var import_web = require("@tamagui/web"),
29
- import_Input = require("./Input.native.js"),
30
- import_shared = require("./shared.native.js"),
31
- TextArea = (0, import_web.styled)(import_Input.Input, {
32
- name: "TextArea",
33
- render: "textarea",
34
- // this attribute fixes firefox newline issue
35
- // @ts-ignore
36
- whiteSpace: "pre-wrap",
37
- variants: {
38
- unstyled: {
39
- false: {
40
- height: "auto",
41
- ...import_shared.defaultStyles,
42
- rows: 3
43
- }
44
- },
45
- size: {
46
- "...size": import_shared.textAreaSizeVariant
30
+ var import_web = require("@tamagui/web");
31
+ var import_Input = require("./Input.native.js");
32
+ 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
47
45
  }
48
46
  },
49
- defaultVariants: {
50
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
47
+ size: {
48
+ "...size": import_shared.textAreaSizeVariant
51
49
  }
52
- });
50
+ },
51
+ defaultVariants: {
52
+ unstyled: process.env.TAMAGUI_HEADLESS === "1"
53
+ }
54
+ });
53
55
  //# 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","import_shared","styled","Input","render"],"sources":["../../src/TextArea.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAS;;AACT,IAAAA,SAAS,GAAAC,MAAa,CAAAC,cAAA;AACtB,IAAAC,gBAAS,GAAAF,MAAe,CAAAG,wBAA2B;AAQ5C,IAAAC,iBAAiB,GAAOJ,MAAA,CAAOK,mBAAA;AAAA,IACpCC,YAAM,GAAAN,MAAA,CAAAO,SAAA,CAAAC,cAAA;AAAA,IACNC,QAAQ,GAAAA,CAAAC,MAAA,EAAAC,GAAA;IAAA,SAAAC,IAAA,IAAAD,GAAA,EAAAZ,SAAA,CAAAW,MAAA,EAAAE,IAAA;MAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;MAAAE,UAAA;IAAA;EAAA;EAIRC,WAAY,GAAAA,CAAAC,EAAA,EAAAC,IAAA,EAAAC,MAAA,EAAAC,IAAA;IAEZ,IAAAF,IAAA,IAAU,OAAAA,IAAA,uBAAAA,IAAA,gBACR,SAAAG,GAAU,IAAAhB,iBAAA,CAAAa,IAAA,GACR,CAAAX,YAAO,CAAAe,IAAA,CAAAL,EAAA,EAAAI,GAAA,KAAAA,GAAA,KAAAF,MAAA,IAAAnB,SAAA,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;IAAA,OACLE,EAAA;EAAQ;AACL,IAAAM,YACG,GAAAC,GAAA,IAAAR,WAAA,CAAAhB,SAAA;EAAAyB,KAAA;AAAA,IAAAD,GAAA;AAAA,IAAAE,gBACR;AAAAhB,QACF,CAAAgB,gBAAA;EAAAC,QAEM,EAAAA,CAAA,KAAAA;AAAA;AACOC,MACb,CAAAC,OAAA,GAAAN,YAAA,CAAAG,gBAAA;AAAA,IACFI,UAAA,GAAAC,OAAA;EAAAC,YAAA,GAAAD,OAAA;EAAAE,aAAA,GAAAF,OAAA;EAAAJ,QAAA,OAAAG,UAAA,CAAAI,MAAA,EAAAF,YAAA,CAAAG,KAAA;IAEAtB,IAAA;IAAiBuB,MACf,YAAU;IACZ;IACD","ignoreList":[]}
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,MAA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
- export * from "./TextArea";
3
- import { inputSizeVariant, textAreaSizeVariant } from "./shared";
4
- export {
5
- inputSizeVariant,
6
- textAreaSizeVariant
7
- };
1
+ export * from "./Input.mjs";
2
+ export * from "./TextArea.mjs";
3
+ import { inputSizeVariant, textAreaSizeVariant } from "./shared.mjs";
4
+ export { inputSizeVariant, textAreaSizeVariant };
8
5
  //# sourceMappingURL=index.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;AACd,cAAc;AACd,SAAS,kBAAkB,2BAA2B;",
5
- "names": []
6
- }
1
+ {"version":3,"names":["inputSizeVariant","textAreaSizeVariant"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,SAASA,gBAAA,EAAkBC,mBAAA,QAA2B","ignoreList":[]}
@@ -5,21 +5,23 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- },
20
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
+ }
20
+ return to;
21
+ };
22
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
23
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
22
- value: !0
24
+ value: true
23
25
  }), mod);
24
26
  var index_exports = {};
25
27
  __export(index_exports, {
@@ -0,0 +1,126 @@
1
+ import { expectTypeOf, describe, test } from "vitest";
2
+ describe("Input event handler types", () => {
3
+ test("onChange event uses HTMLInputElement", () => {
4
+ expectTypeOf().toMatchTypeOf();
5
+ });
6
+ test("onFocus event uses HTMLInputElement", () => {
7
+ expectTypeOf().toMatchTypeOf();
8
+ });
9
+ test("onBlur event uses HTMLInputElement", () => {
10
+ expectTypeOf().toMatchTypeOf();
11
+ });
12
+ test("onKeyDown event uses HTMLInputElement", () => {
13
+ expectTypeOf().toMatchTypeOf();
14
+ });
15
+ test("onClick event uses HTMLInputElement", () => {
16
+ expectTypeOf().toMatchTypeOf();
17
+ });
18
+ test("onChange event is NOT typed with HTMLDivElement", () => {
19
+ expectTypeOf().toEqualTypeOf();
20
+ });
21
+ });
22
+ describe("Input HTML props", () => {
23
+ test("accepts type prop", () => {
24
+ expectTypeOf().toHaveProperty("type");
25
+ });
26
+ test("accepts placeholder prop", () => {
27
+ expectTypeOf().toHaveProperty("placeholder");
28
+ });
29
+ test("accepts value prop", () => {
30
+ expectTypeOf().toHaveProperty("value");
31
+ });
32
+ test("accepts defaultValue prop", () => {
33
+ expectTypeOf().toHaveProperty("defaultValue");
34
+ });
35
+ test("accepts maxLength prop", () => {
36
+ expectTypeOf().toHaveProperty("maxLength");
37
+ });
38
+ test("accepts pattern prop", () => {
39
+ expectTypeOf().toHaveProperty("pattern");
40
+ });
41
+ test("accepts required prop", () => {
42
+ expectTypeOf().toHaveProperty("required");
43
+ });
44
+ test("accepts readOnly prop", () => {
45
+ expectTypeOf().toHaveProperty("readOnly");
46
+ });
47
+ test("accepts autoComplete prop", () => {
48
+ expectTypeOf().toHaveProperty("autoComplete");
49
+ });
50
+ test("accepts name prop", () => {
51
+ expectTypeOf().toHaveProperty("name");
52
+ });
53
+ });
54
+ describe("Input style props", () => {
55
+ test("accepts padding style prop", () => {
56
+ expectTypeOf().toHaveProperty("padding");
57
+ });
58
+ test("accepts backgroundColor style prop", () => {
59
+ expectTypeOf().toHaveProperty("backgroundColor");
60
+ });
61
+ test("accepts borderRadius style prop", () => {
62
+ expectTypeOf().toHaveProperty("borderRadius");
63
+ });
64
+ test("accepts text style props", () => {
65
+ expectTypeOf().toHaveProperty("fontSize");
66
+ expectTypeOf().toHaveProperty("fontWeight");
67
+ expectTypeOf().toHaveProperty("color");
68
+ });
69
+ test("accepts size variant", () => {
70
+ expectTypeOf().toHaveProperty("size");
71
+ });
72
+ test("accepts unstyled variant", () => {
73
+ expectTypeOf().toHaveProperty("unstyled");
74
+ });
75
+ });
76
+ describe("Input cross-platform props", () => {
77
+ test("autoCorrect accepts boolean and string", () => {
78
+ expectTypeOf().toMatchTypeOf();
79
+ });
80
+ test("autoCapitalize accepts native and web values", () => {
81
+ expectTypeOf().toMatchTypeOf();
82
+ });
83
+ test("accepts onChangeText callback", () => {
84
+ expectTypeOf().toHaveProperty("onChangeText");
85
+ expectTypeOf().toMatchTypeOf();
86
+ });
87
+ test("accepts onSubmitEditing callback", () => {
88
+ expectTypeOf().toHaveProperty("onSubmitEditing");
89
+ });
90
+ test("accepts placeholderTextColor", () => {
91
+ expectTypeOf().toHaveProperty("placeholderTextColor");
92
+ });
93
+ test("accepts selection prop", () => {
94
+ expectTypeOf().toHaveProperty("selection");
95
+ });
96
+ });
97
+ describe("InputRef type", () => {
98
+ test("InputRef accepts TextInput", () => {
99
+ const _ref = {};
100
+ });
101
+ test("InputRef rejects plain HTMLDivElement", () => {
102
+ const _ref = {};
103
+ });
104
+ });
105
+ describe("TextArea types", () => {
106
+ test("TextArea has rows prop", () => {
107
+ expectTypeOf().toHaveProperty("rows");
108
+ });
109
+ test("TextArea accepts style props", () => {
110
+ expectTypeOf().toHaveProperty("padding");
111
+ expectTypeOf().toHaveProperty("fontSize");
112
+ });
113
+ test("TextArea accepts HTML input props", () => {
114
+ expectTypeOf().toHaveProperty("placeholder");
115
+ expectTypeOf().toHaveProperty("value");
116
+ });
117
+ });
118
+ describe("InputProps derivation", () => {
119
+ test("InputProps equals GetProps<typeof Input>", () => {
120
+ expectTypeOf().toEqualTypeOf();
121
+ });
122
+ test("TextAreaProps equals GetProps<typeof TextArea>", () => {
123
+ expectTypeOf().toEqualTypeOf();
124
+ });
125
+ });
126
+ //# sourceMappingURL=inputTypes.test-d.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["expectTypeOf","describe","test","toMatchTypeOf","toEqualTypeOf","toHaveProperty","_ref"],"sources":["../../src/inputTypes.test-d.ts"],"sourcesContent":[null],"mappings":"AAaA,SAASA,YAAA,EAAcC,QAAA,EAAUC,IAAA,QAAY;AAmB7CD,QAAA,CAAS,6BAA6B,MAAM;EAC1CC,IAAA,CAAK,wCAAwC,MAAM;IAGjDF,YAAA,CAAqC,EAAEG,aAAA,CAAgC;EACzE,CAAC;EAEDD,IAAA,CAAK,uCAAuC,MAAM;IAGhDF,YAAA,CAAqC,EAAEG,aAAA,CAAgC;EACzE,CAAC;EAEDD,IAAA,CAAK,sCAAsC,MAAM;IAG/CF,YAAA,CAAqC,EAAEG,aAAA,CAAgC;EACzE,CAAC;EAEDD,IAAA,CAAK,yCAAyC,MAAM;IAGlDF,YAAA,CAAqC,EAAEG,aAAA,CAAgC;EACzE,CAAC;EAEDD,IAAA,CAAK,uCAAuC,MAAM;IAGhDF,YAAA,CAAqC,EAAEG,aAAA,CAAgC;EACzE,CAAC;EAEDD,IAAA,CAAK,mDAAmD,MAAM;IAK5DF,YAAA,CAAsC,EAAEI,aAAA,CAAqB;EAC/D,CAAC;AACH,CAAC;AAMDH,QAAA,CAAS,oBAAoB,MAAM;EACjCC,IAAA,CAAK,qBAAqB,MAAM;IAC9BF,YAAA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A,CAAK,0BAA0B,MAAM;IACnCF,YAAA,CAA4B,EAAEK,cAAA,CAAe,MAAM;EACrD,CAAC;EAEDH,IAAA,CAAK,gCAAgC,MAAM;IACzCF,YAAA,CAA4B,EAAEK,cAAA,CAAe,SAAS;IACtDL,YAAA,CAA4B,EAAEK,cAAA,CAAe,UAAU;EACzD,CAAC;EAEDH,IAAA,CAAK,qCAAqC,MAAM;IAC9CF,YAAA,CAA4B,EAAEK,cAAA,CAAe,aAAa;IAC1DL,YAAA,CAA4B,EAAEK,cAAA,CAAe,OAAO;EACtD,CAAC;AACH,CAAC;AAMDJ,QAAA,CAAS,yBAAyB,MAAM;EACtCC,IAAA,CAAK,4CAA4C,MAAM;IAErDF,YAAA,CAAyB,EAAEI,aAAA,CAAuB;EACpD,CAAC;EAEDF,IAAA,CAAK,kDAAkD,MAAM;IAE3DF,YAAA,CAA4B,EAAEI,aAAA,CAAuB;EACvD,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+
3
+ var import_vitest = require("vitest");
4
+ (0, import_vitest.describe)("Input event handler types", function () {
5
+ (0, import_vitest.test)("onChange event uses HTMLInputElement", function () {
6
+ (0, import_vitest.expectTypeOf)().toMatchTypeOf();
7
+ });
8
+ (0, import_vitest.test)("onFocus event uses HTMLInputElement", function () {
9
+ (0, import_vitest.expectTypeOf)().toMatchTypeOf();
10
+ });
11
+ (0, import_vitest.test)("onBlur event uses HTMLInputElement", function () {
12
+ (0, import_vitest.expectTypeOf)().toMatchTypeOf();
13
+ });
14
+ (0, import_vitest.test)("onKeyDown event uses HTMLInputElement", function () {
15
+ (0, import_vitest.expectTypeOf)().toMatchTypeOf();
16
+ });
17
+ (0, import_vitest.test)("onClick event uses HTMLInputElement", function () {
18
+ (0, import_vitest.expectTypeOf)().toMatchTypeOf();
19
+ });
20
+ (0, import_vitest.test)("onChange event is NOT typed with HTMLDivElement", function () {
21
+ (0, import_vitest.expectTypeOf)().toEqualTypeOf();
22
+ });
23
+ });
24
+ (0, import_vitest.describe)("Input HTML props", function () {
25
+ (0, import_vitest.test)("accepts type prop", function () {
26
+ (0, import_vitest.expectTypeOf)().toHaveProperty("type");
27
+ });
28
+ (0, import_vitest.test)("accepts placeholder prop", function () {
29
+ (0, import_vitest.expectTypeOf)().toHaveProperty("placeholder");
30
+ });
31
+ (0, import_vitest.test)("accepts value prop", function () {
32
+ (0, import_vitest.expectTypeOf)().toHaveProperty("value");
33
+ });
34
+ (0, import_vitest.test)("accepts defaultValue prop", function () {
35
+ (0, import_vitest.expectTypeOf)().toHaveProperty("defaultValue");
36
+ });
37
+ (0, import_vitest.test)("accepts maxLength prop", function () {
38
+ (0, import_vitest.expectTypeOf)().toHaveProperty("maxLength");
39
+ });
40
+ (0, import_vitest.test)("accepts pattern prop", function () {
41
+ (0, import_vitest.expectTypeOf)().toHaveProperty("pattern");
42
+ });
43
+ (0, import_vitest.test)("accepts required prop", function () {
44
+ (0, import_vitest.expectTypeOf)().toHaveProperty("required");
45
+ });
46
+ (0, import_vitest.test)("accepts readOnly prop", function () {
47
+ (0, import_vitest.expectTypeOf)().toHaveProperty("readOnly");
48
+ });
49
+ (0, import_vitest.test)("accepts autoComplete prop", function () {
50
+ (0, import_vitest.expectTypeOf)().toHaveProperty("autoComplete");
51
+ });
52
+ (0, import_vitest.test)("accepts name prop", function () {
53
+ (0, import_vitest.expectTypeOf)().toHaveProperty("name");
54
+ });
55
+ });
56
+ (0, import_vitest.describe)("Input style props", function () {
57
+ (0, import_vitest.test)("accepts padding style prop", function () {
58
+ (0, import_vitest.expectTypeOf)().toHaveProperty("padding");
59
+ });
60
+ (0, import_vitest.test)("accepts backgroundColor style prop", function () {
61
+ (0, import_vitest.expectTypeOf)().toHaveProperty("backgroundColor");
62
+ });
63
+ (0, import_vitest.test)("accepts borderRadius style prop", function () {
64
+ (0, import_vitest.expectTypeOf)().toHaveProperty("borderRadius");
65
+ });
66
+ (0, import_vitest.test)("accepts text style props", function () {
67
+ (0, import_vitest.expectTypeOf)().toHaveProperty("fontSize");
68
+ (0, import_vitest.expectTypeOf)().toHaveProperty("fontWeight");
69
+ (0, import_vitest.expectTypeOf)().toHaveProperty("color");
70
+ });
71
+ (0, import_vitest.test)("accepts size variant", function () {
72
+ (0, import_vitest.expectTypeOf)().toHaveProperty("size");
73
+ });
74
+ (0, import_vitest.test)("accepts unstyled variant", function () {
75
+ (0, import_vitest.expectTypeOf)().toHaveProperty("unstyled");
76
+ });
77
+ });
78
+ (0, import_vitest.describe)("Input cross-platform props", function () {
79
+ (0, import_vitest.test)("autoCorrect accepts boolean and string", function () {
80
+ (0, import_vitest.expectTypeOf)().toMatchTypeOf();
81
+ });
82
+ (0, import_vitest.test)("autoCapitalize accepts native and web values", function () {
83
+ (0, import_vitest.expectTypeOf)().toMatchTypeOf();
84
+ });
85
+ (0, import_vitest.test)("accepts onChangeText callback", function () {
86
+ (0, import_vitest.expectTypeOf)().toHaveProperty("onChangeText");
87
+ (0, import_vitest.expectTypeOf)().toMatchTypeOf();
88
+ });
89
+ (0, import_vitest.test)("accepts onSubmitEditing callback", function () {
90
+ (0, import_vitest.expectTypeOf)().toHaveProperty("onSubmitEditing");
91
+ });
92
+ (0, import_vitest.test)("accepts placeholderTextColor", function () {
93
+ (0, import_vitest.expectTypeOf)().toHaveProperty("placeholderTextColor");
94
+ });
95
+ (0, import_vitest.test)("accepts selection prop", function () {
96
+ (0, import_vitest.expectTypeOf)().toHaveProperty("selection");
97
+ });
98
+ });
99
+ (0, import_vitest.describe)("InputRef type", function () {
100
+ (0, import_vitest.test)("InputRef accepts TextInput", function () {
101
+ var _ref = {};
102
+ });
103
+ (0, import_vitest.test)("InputRef rejects plain HTMLDivElement", function () {
104
+ var _ref = {};
105
+ });
106
+ });
107
+ (0, import_vitest.describe)("TextArea types", function () {
108
+ (0, import_vitest.test)("TextArea has rows prop", function () {
109
+ (0, import_vitest.expectTypeOf)().toHaveProperty("rows");
110
+ });
111
+ (0, import_vitest.test)("TextArea accepts style props", function () {
112
+ (0, import_vitest.expectTypeOf)().toHaveProperty("padding");
113
+ (0, import_vitest.expectTypeOf)().toHaveProperty("fontSize");
114
+ });
115
+ (0, import_vitest.test)("TextArea accepts HTML input props", function () {
116
+ (0, import_vitest.expectTypeOf)().toHaveProperty("placeholder");
117
+ (0, import_vitest.expectTypeOf)().toHaveProperty("value");
118
+ });
119
+ });
120
+ (0, import_vitest.describe)("InputProps derivation", function () {
121
+ (0, import_vitest.test)("InputProps equals GetProps<typeof Input>", function () {
122
+ (0, import_vitest.expectTypeOf)().toEqualTypeOf();
123
+ });
124
+ (0, import_vitest.test)("TextAreaProps equals GetProps<typeof TextArea>", function () {
125
+ (0, import_vitest.expectTypeOf)().toEqualTypeOf();
126
+ });
127
+ });
128
+ //# sourceMappingURL=inputTypes.test-d.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["import_vitest","require","describe","test","expectTypeOf","toMatchTypeOf","toEqualTypeOf","toHaveProperty","_ref"],"sources":["../../src/inputTypes.test-d.ts"],"sourcesContent":[null],"mappings":"AAaA,YAAS;;AAmBT,IAAAA,aAAS,GAAAC,OAAA;AACP,IAAAD,aAAK,CAAAE,QAAA,6BAA8C;EAGjD,IAAAF,aAAuC,CAAAG,IAAA,wCAAgC;IACxE,IAAAH,aAAA,CAAAI,YAAA,IAAAC,aAAA;EAED;EAGE,IAAAL,aAAuC,CAAAG,IAAA,uCAAgC;IACxE,IAAAH,aAAA,CAAAI,YAAA,IAAAC,aAAA;EAED;EAGE,IAAAL,aAAuC,CAAAG,IAAA,sCAAgC;IACxE,IAAAH,aAAA,CAAAI,YAAA,IAAAC,aAAA;EAED;EAGE,IAAAL,aAAuC,CAAAG,IAAA,yCAAgC;IACxE,IAAAH,aAAA,CAAAI,YAAA,IAAAC,aAAA;EAED;EAGE,IAAAL,aAAuC,CAAAG,IAAA,uCAAgC;IACxE,IAAAH,aAAA,CAAAI,YAAA,IAAAC,aAAA;EAED;EAKE,IAAAL,aAAwC,CAAA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A;EAED;EAEE,IAAAR,aAAwB,CAAAG,IAAA;IACzB,IAAAK,IAAA;EACF;AAMD;AACE,IAAAR,aAAK,CAAAE,QAAA,kBAAgC;EACnC,IAAAF,aAA8B,CAAAG,IAAA,0BAAqB;IACpD,IAAAH,aAAA,CAAAI,YAAA,IAAAG,cAAA;EAED;EACE,IAAAP,aAA8B,CAAAG,IAAA,gCAAwB;IACtD,IAAAH,aAA8B,CAAAI,YAAe,IAAAG,cAAU;IACxD,IAAAP,aAAA,CAAAI,YAAA,IAAAG,cAAA;EAED;EACE,IAAAP,aAA8B,CAAAG,IAAA,qCAA4B;IAC1D,IAAAH,aAA8B,CAAAI,YAAe,IAAAG,cAAO;IACrD,IAAAP,aAAA,CAAAI,YAAA,IAAAG,cAAA;EACF;AAMD;AACE,IAAAP,aAAK,CAAAE,QAAA,yBAA4C,cAAM;EAErD,IAAAF,aAA2B,CAAAG,IAAA,4CAAuB;IACnD,IAAAH,aAAA,CAAAI,YAAA,IAAAE,aAAA;EAED;EAEE,IAAAN,aAA8B,CAAAG,IAAA,kDAAuB;IACtD,IAAAH,aAAA,CAAAI,YAAA,IAAAE,aAAA;EACF","ignoreList":[]}
@@ -4,96 +4,106 @@ import { getButtonSized } from "@tamagui/get-button-sized";
4
4
  import { getFontSized } from "@tamagui/get-font-sized";
5
5
  import { getSpace } from "@tamagui/get-token";
6
6
  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: !0
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"
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
+ }
32
+ };
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
+ };
51
+ };
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
+ };
78
+ };
79
+ const INPUT_NAME = "Input";
80
+ const styledBody = [{
81
+ name: INPUT_NAME,
82
+ render: "input",
83
+ variants: {
84
+ unstyled: {
85
+ false: defaultStyles
23
86
  },
24
- focusStyle: {
25
- borderColor: "$borderColorFocus"
87
+ size: {
88
+ "...size": inputSizeVariant
26
89
  },
27
- focusVisibleStyle: {
28
- outlineColor: "$outlineColor",
29
- outlineWidth: 2,
30
- outlineStyle: "solid"
90
+ disabled: {
91
+ true: {}
31
92
  }
32
93
  },
33
- inputSizeVariant = (val = "$true", extras) => {
34
- if (extras.props.tag === "textarea" || extras.props.rows > 1 || extras.props.multiline || extras.props.numberOfLines > 1) return textAreaSizeVariant(val, extras);
35
- const buttonStyles = getButtonSized(val, extras),
36
- paddingHorizontal = getSpace(val, {
37
- shift: -1,
38
- bounds: [2]
39
- }),
40
- fontStyle = getFontSized(val, extras);
41
- return !isWeb && fontStyle && delete fontStyle.lineHeight, {
42
- ...fontStyle,
43
- ...buttonStyles,
44
- paddingHorizontal
45
- };
46
- },
47
- textAreaSizeVariant = (val = "$true", extras) => {
48
- const {
49
- props
50
- } = extras,
51
- buttonStyles = getButtonSized(val, extras),
52
- fontStyle = getFontSized(val, extras),
53
- lines = props.rows ?? props.numberOfLines,
54
- height = typeof lines == "number" ? lines * getVariableValue(fontStyle.lineHeight) : "auto";
55
- !isWeb && fontStyle && delete fontStyle.lineHeight;
56
- const paddingVertical = getSpace(val, {
57
- shift: -2,
58
- bounds: [2]
59
- }),
60
- paddingHorizontal = getSpace(val, {
61
- shift: -1,
62
- bounds: [2]
63
- });
64
- return {
65
- ...buttonStyles,
66
- ...fontStyle,
67
- paddingVertical,
68
- paddingHorizontal,
69
- height
70
- };
94
+ defaultVariants: {
95
+ unstyled: process.env.TAMAGUI_HEADLESS === "1"
96
+ }
97
+ }, {
98
+ isInput: true,
99
+ accept: {
100
+ placeholderTextColor: "color",
101
+ selectionColor: "color",
102
+ cursorColor: "color",
103
+ selectionHandleColor: "color",
104
+ underlineColorAndroid: "color"
71
105
  },
72
- INPUT_NAME = "Input",
73
- styledBody = [{
74
- name: INPUT_NAME,
75
- render: "input",
76
- variants: {
77
- unstyled: {
78
- false: defaultStyles
79
- },
80
- size: {
81
- "...size": inputSizeVariant
82
- },
83
- disabled: {
84
- true: {}
85
- }
86
- },
87
- defaultVariants: {
88
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
89
- }
90
- }, {
91
- isInput: !0,
92
- accept: {
93
- placeholderTextColor: "color",
94
- selectionColor: "color"
95
- },
96
- validStyles: Text.staticConfig.validStyles
97
- }];
106
+ validStyles: Text.staticConfig.validStyles
107
+ }];
98
108
  export { INPUT_NAME, defaultStyles, inputSizeVariant, styledBody, textAreaSizeVariant };
99
109
  //# 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","lineHeight","lines","height","paddingVertical","INPUT_NAME","styledBody","name","render","variants","unstyled","false","disabled","true","defaultVariants","process","env","TAMAGUI_HEADLESS","isInput","accept","placeholderTextColor","selectionColor","validStyles","staticConfig"],"sources":["../../src/shared.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,IAAA,QAAY;AACrB,SAASC,gBAAA,EAAkBC,KAAA,QAAa;AACxC,SAASC,cAAA,QAAsB;AAC/B,SAASC,YAAA,QAAoB;AAC7B,SAASC,QAAA,QAAgB;AAElB,MAAMC,aAAA,GAAgB;IAC3BC,IAAA,EAAM;IACNC,UAAA,EAAY;IACZC,WAAA,EAAa;IACbC,YAAA,EAAc;IACdC,KAAA,EAAO;IAEP,IAAIT,KAAA,GACA;MACEU,QAAA,EAAU;IACZ,IACA;MACEC,SAAA,EAAW;IACb;IAEJC,WAAA,EAAa;IACbC,eAAA,EAAiB;IAAA;IAGjBC,QAAA,EAA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AAA,IACZ,OAAOA,SAAA,CAAUC,UAAA;IAEnB,MAAMG,eAAA,GAAkBlC,QAAA,CAASkB,GAAA,EAAK;QACpCU,KAAA,EAAO;QACPC,MAAA,EAAQ,CAAC,CAAC;MACZ,CAAC;MACKF,iBAAA,GAAoB3B,QAAA,CAASkB,GAAA,EAAK;QACtCU,KAAA,EAAO;QACPC,MAAA,EAAQ,CAAC,CAAC;MACZ,CAAC;IACD,OAAO;MACL,GAAGH,YAAA;MACH,GAAGI,SAAA;MACHI,eAAA;MACAP,iBAAA;MACAM;IACF;EACF;EACaE,UAAA,GAAa;EAEbC,UAAA,GAAa,CACxB;IACEC,IAAA,EAAMF,UAAA;IACNG,MAAA,EAAQ;IACRC,QAAA,EAAU;MACRC,QAAA,EAAU;QACRC,KAAA,EAAOxC;MACT;MAEAC,IAAA,EAAM;QACJ,WAAWe;MACb;MAEAyB,QAAA,EAAU;QACRC,IAAA,EAAM,CAAC;MACT;IACF;IAEAC,eAAA,EAAiB;MACfJ,QAAA,EAAUK,OAAA,CAAQC,GAAA,CAAIC,gBAAA,KAAqB;IAC7C;EACF,GAEA;IACEC,OAAA,EAAS;IACTC,MAAA,EAAQ;MACNC,oBAAA,EAAsB;MACtBC,cAAA,EAAgB;IAClB;IAEAC,WAAA,EAAazD,IAAA,CAAK0D,YAAA,CAAaD;EACjC,EACF","ignoreList":[]}
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","false","disabled","true","defaultVariants","process","env","TAMAGUI_HEADLESS","isInput","accept","placeholderTextColor","selectionColor","cursorColor","selectionHandleColor","underlineColorAndroid","validStyles","staticConfig"],"sources":["../../src/shared.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,IAAA,QAAY;AACrB,SAASC,gBAAA,EAAkBC,KAAA,QAAa;AACxC,SAASC,cAAA,QAAsB;AAC/B,SAASC,YAAA,QAAoB;AAC7B,SAASC,QAAA,QAAgB;AAElB,MAAMC,aAAA,GAAgB;EAC3BC,IAAA,EAAM;EACNC,UAAA,EAAY;EACZC,WAAA,EAAa;EACbC,YAAA,EAAc;EACdC,KAAA,EAAO;EAEP,IAAIT,KAAA,GACA;IACEU,QAAA,EAAU;EACZ,IACA;IACEC,SAAA,EAAW;EACb;EAEJC,WAAA,EAAa;EACbC,eAAA,EAAiB;EAAA;EAGjBC,QAAA,EAAU;EAEVC,UAAA,EAAY;IACVH,WAAA,EAAa;EACf;EAEAI,UAAA,EAAY;IACVJ,WAAA,EAAa;EACf;EAEAK,iBAAA,EAAmB;IACjBC,YAAA,EAAc;IACdV,YAAA,EAAc;IACdW,YAAA,EAAc;EAChB;AACF;AAEO,MAAMC,gBAAA,GAAmDA,CAC9DC,GAAA,GAAM,SACNC,MAAA,KACG;EAEH,IACEA,MAAA,CAAOC,KAAA,CAAMC,GAAA,KAAQ,cACrBF,MAAA,CAAOC,KAAA,CAAME,IAAA,GAAO,KACpBH,MAAA,CAAOC,KAAA,CAAMG,SAAA,IACbJ,MAAA,CAAOC,KAAA,CAAMI,aAAA,GAAgB,GAC7B;IACA,OAAOC,mBAAA,CAAoBP,GAAA,EAAKC,MAAM;EACxC;EACA,MAAMO,YAAA,GAAe5B,cAAA,CAAeoB,GAAA,EAAKC,MAAM;EAC/C,MAAMQ,iBAAA,GAAoB3B,QAAA,CAASkB,GAAA,EAAK;IACtCU,KAAA,EAAO;IACPC,MAAA,EAAQ,CAAC,CAAC;EACZ,CAAC;EACD,MAAMC,SAAA,GAAY/B,YAAA,CAAamB,GAAA,EAAYC,MAAM;EAEjD,IAAI,CAACtB,KAAA,IAAS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