@tamagui/input 2.7.7 → 3.0.0-beta.643.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 (168) hide show
  1. package/dist/cjs/Input.cjs +78 -162
  2. package/dist/cjs/Input.native.cjs +209 -0
  3. package/dist/cjs/Input.native.js +186 -282
  4. package/dist/cjs/Input.native.js.map +1 -1
  5. package/dist/cjs/InputNativeProps.cjs +10 -11
  6. package/dist/cjs/InputNativeProps.native.cjs +19 -0
  7. package/dist/cjs/InputNativeProps.native.js +10 -10
  8. package/dist/cjs/InputNativeProps.native.js.map +1 -1
  9. package/dist/cjs/TextArea.cjs +25 -38
  10. package/dist/cjs/TextArea.native.cjs +41 -0
  11. package/dist/cjs/TextArea.native.js +25 -37
  12. package/dist/cjs/TextArea.native.js.map +1 -1
  13. package/dist/cjs/index.cjs +16 -17
  14. package/dist/cjs/index.native.cjs +33 -0
  15. package/dist/cjs/index.native.js +16 -16
  16. package/dist/cjs/index.native.js.map +1 -1
  17. package/dist/cjs/shared.cjs +115 -122
  18. package/dist/cjs/shared.native.cjs +144 -0
  19. package/dist/cjs/shared.native.js +120 -126
  20. package/dist/cjs/shared.native.js.map +1 -1
  21. package/dist/cjs/types.cjs +10 -11
  22. package/dist/cjs/types.native.cjs +19 -0
  23. package/dist/cjs/types.native.js +10 -10
  24. package/dist/cjs/types.native.js.map +1 -1
  25. package/dist/esm/Input.mjs +63 -137
  26. package/dist/esm/Input.mjs.map +1 -1
  27. package/dist/esm/Input.native.js +172 -259
  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 -20
  32. package/dist/esm/TextArea.mjs.map +1 -1
  33. package/dist/esm/TextArea.native.js +12 -20
  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 +99 -104
  39. package/dist/esm/shared.mjs.map +1 -1
  40. package/dist/esm/shared.native.js +104 -109
  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 +63 -137
  45. package/dist/jsx/Input.mjs.map +1 -1
  46. package/dist/jsx/Input.native.cjs +209 -0
  47. package/dist/jsx/Input.native.js +186 -282
  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 +19 -0
  51. package/dist/jsx/InputNativeProps.native.js +10 -10
  52. package/dist/jsx/InputNativeProps.native.js.map +1 -1
  53. package/dist/jsx/TextArea.mjs +12 -20
  54. package/dist/jsx/TextArea.mjs.map +1 -1
  55. package/dist/jsx/TextArea.native.cjs +41 -0
  56. package/dist/jsx/TextArea.native.js +25 -37
  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 +33 -0
  61. package/dist/jsx/index.native.js +16 -16
  62. package/dist/jsx/index.native.js.map +1 -1
  63. package/dist/jsx/shared.mjs +99 -104
  64. package/dist/jsx/shared.mjs.map +1 -1
  65. package/dist/jsx/shared.native.cjs +144 -0
  66. package/dist/jsx/shared.native.js +120 -126
  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 +19 -0
  70. package/dist/jsx/types.native.js +10 -10
  71. package/dist/jsx/types.native.js.map +1 -1
  72. package/package.json +13 -15
  73. package/src/Input.native.tsx +263 -240
  74. package/src/Input.tsx +162 -152
  75. package/src/TextArea.tsx +6 -14
  76. package/src/shared.tsx +65 -70
  77. package/src/types.ts +1 -1
  78. package/types/Input.d.ts +57 -41
  79. package/types/Input.d.ts.map +1 -1
  80. package/types/Input.native.d.ts +57 -41
  81. package/types/Input.native.d.ts.map +1 -1
  82. package/types/TextArea.d.ts +172 -24
  83. package/types/TextArea.d.ts.map +1 -1
  84. package/types/shared.d.ts +14 -99
  85. package/types/shared.d.ts.map +1 -1
  86. package/types/types.d.ts +1 -1
  87. package/dist/cjs/inputTypes.test-d.cjs +0 -128
  88. package/dist/cjs/inputTypes.test-d.native.js +0 -131
  89. package/dist/cjs/inputTypes.test-d.native.js.map +0 -1
  90. package/dist/cjs/v1/Input.cjs +0 -200
  91. package/dist/cjs/v1/Input.native.js +0 -183
  92. package/dist/cjs/v1/Input.native.js.map +0 -1
  93. package/dist/cjs/v1/TextArea.cjs +0 -52
  94. package/dist/cjs/v1/TextArea.native.js +0 -55
  95. package/dist/cjs/v1/TextArea.native.js.map +0 -1
  96. package/dist/cjs/v1/index.cjs +0 -21
  97. package/dist/cjs/v1/index.native.js +0 -24
  98. package/dist/cjs/v1/index.native.js.map +0 -1
  99. package/dist/cjs/v1/types.cjs +0 -18
  100. package/dist/cjs/v1/types.native.js +0 -21
  101. package/dist/cjs/v1/types.native.js.map +0 -1
  102. package/dist/esm/InputNativeProps.mjs.map +0 -1
  103. package/dist/esm/InputNativeProps.native.js.map +0 -1
  104. package/dist/esm/index.js.map +0 -1
  105. package/dist/esm/index.mjs.map +0 -1
  106. package/dist/esm/index.native.js.map +0 -1
  107. package/dist/esm/inputTypes.test-d.mjs +0 -129
  108. package/dist/esm/inputTypes.test-d.mjs.map +0 -1
  109. package/dist/esm/inputTypes.test-d.native.js +0 -129
  110. package/dist/esm/inputTypes.test-d.native.js.map +0 -1
  111. package/dist/esm/types.mjs.map +0 -1
  112. package/dist/esm/types.native.js.map +0 -1
  113. package/dist/esm/v1/Input.mjs +0 -164
  114. package/dist/esm/v1/Input.mjs.map +0 -1
  115. package/dist/esm/v1/Input.native.js +0 -144
  116. package/dist/esm/v1/Input.native.js.map +0 -1
  117. package/dist/esm/v1/TextArea.mjs +0 -27
  118. package/dist/esm/v1/TextArea.mjs.map +0 -1
  119. package/dist/esm/v1/TextArea.native.js +0 -27
  120. package/dist/esm/v1/TextArea.native.js.map +0 -1
  121. package/dist/esm/v1/index.mjs +0 -3
  122. package/dist/esm/v1/index.mjs.map +0 -1
  123. package/dist/esm/v1/index.native.js +0 -3
  124. package/dist/esm/v1/index.native.js.map +0 -1
  125. package/dist/esm/v1/types.mjs +0 -2
  126. package/dist/esm/v1/types.mjs.map +0 -1
  127. package/dist/esm/v1/types.native.js +0 -2
  128. package/dist/esm/v1/types.native.js.map +0 -1
  129. package/dist/jsx/InputNativeProps.mjs.map +0 -1
  130. package/dist/jsx/index.js.map +0 -1
  131. package/dist/jsx/index.mjs.map +0 -1
  132. package/dist/jsx/inputTypes.test-d.mjs +0 -129
  133. package/dist/jsx/inputTypes.test-d.mjs.map +0 -1
  134. package/dist/jsx/inputTypes.test-d.native.js +0 -131
  135. package/dist/jsx/inputTypes.test-d.native.js.map +0 -1
  136. package/dist/jsx/types.mjs.map +0 -1
  137. package/dist/jsx/v1/Input.mjs +0 -164
  138. package/dist/jsx/v1/Input.mjs.map +0 -1
  139. package/dist/jsx/v1/Input.native.js +0 -183
  140. package/dist/jsx/v1/Input.native.js.map +0 -1
  141. package/dist/jsx/v1/TextArea.mjs +0 -27
  142. package/dist/jsx/v1/TextArea.mjs.map +0 -1
  143. package/dist/jsx/v1/TextArea.native.js +0 -55
  144. package/dist/jsx/v1/TextArea.native.js.map +0 -1
  145. package/dist/jsx/v1/index.mjs +0 -3
  146. package/dist/jsx/v1/index.mjs.map +0 -1
  147. package/dist/jsx/v1/index.native.js +0 -24
  148. package/dist/jsx/v1/index.native.js.map +0 -1
  149. package/dist/jsx/v1/types.mjs +0 -2
  150. package/dist/jsx/v1/types.mjs.map +0 -1
  151. package/dist/jsx/v1/types.native.js +0 -21
  152. package/dist/jsx/v1/types.native.js.map +0 -1
  153. package/src/inputTypes.test-d.ts +0 -245
  154. package/src/v1/Input.native.tsx +0 -153
  155. package/src/v1/Input.tsx +0 -190
  156. package/src/v1/TextArea.tsx +0 -35
  157. package/src/v1/index.ts +0 -3
  158. package/src/v1/types.ts +0 -65
  159. package/types/v1/Input.d.ts +0 -64
  160. package/types/v1/Input.d.ts.map +0 -1
  161. package/types/v1/Input.native.d.ts +0 -63
  162. package/types/v1/Input.native.d.ts.map +0 -1
  163. package/types/v1/TextArea.d.ts +0 -41
  164. package/types/v1/TextArea.d.ts.map +0 -1
  165. package/types/v1/index.d.ts +0 -4
  166. package/types/v1/index.d.ts.map +0 -1
  167. package/types/v1/types.d.ts +0 -39
  168. package/types/v1/types.d.ts.map +0 -1
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __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", {
18
- value: true
19
- }), mod);
20
- var v1_exports = {};
21
- module.exports = __toCommonJS(v1_exports);
22
- __reExport(v1_exports, require("./Input.native.js"), module.exports);
23
- __reExport(v1_exports, require("./TextArea.native.js"), module.exports);
24
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","v1_exports","module","exports","__reExport","require"],"sources":["../../../src/v1/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,UAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,UAAA;AACdG,UAAA,CAAAH,UAAA,EAAcI,OAAA,uBAAAH,MADd,CAAAC,OAAA","ignoreList":[]}
@@ -1,18 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
- get: () => from[key],
9
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
- });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
15
- value: true
16
- }), mod);
17
- var types_exports = {};
18
- module.exports = __toCommonJS(types_exports);
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __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 __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
17
- value: true
18
- }), mod);
19
- var types_exports = {};
20
- module.exports = __toCommonJS(types_exports);
21
- //# sourceMappingURL=types.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","types_exports"],"sources":["../../../src/v1/types.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["inputSizeVariant","textAreaSizeVariant"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,SAASA,gBAAA,EAAkBC,mBAAA,QAA2B","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["inputSizeVariant","textAreaSizeVariant"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,SAASA,gBAAA,EAAkBC,mBAAA,QAA2B","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["inputSizeVariant","textAreaSizeVariant"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,SAASA,gBAAA,EAAkBC,mBAAA,QAA2B","ignoreList":[]}
@@ -1,129 +0,0 @@
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 textAlign longhand", () => {
70
- expectTypeOf().toMatchTypeOf();
71
- });
72
- test("accepts size variant", () => {
73
- expectTypeOf().toHaveProperty("size");
74
- });
75
- test("accepts unstyled variant", () => {
76
- expectTypeOf().toHaveProperty("unstyled");
77
- });
78
- });
79
- describe("Input cross-platform props", () => {
80
- test("autoCorrect accepts boolean and string", () => {
81
- expectTypeOf().toMatchTypeOf();
82
- });
83
- test("autoCapitalize accepts native and web values", () => {
84
- expectTypeOf().toMatchTypeOf();
85
- });
86
- test("accepts onChangeText callback", () => {
87
- expectTypeOf().toHaveProperty("onChangeText");
88
- expectTypeOf().toMatchTypeOf();
89
- });
90
- test("accepts onSubmitEditing callback", () => {
91
- expectTypeOf().toHaveProperty("onSubmitEditing");
92
- });
93
- test("accepts placeholderTextColor", () => {
94
- expectTypeOf().toHaveProperty("placeholderTextColor");
95
- });
96
- test("accepts selection prop", () => {
97
- expectTypeOf().toHaveProperty("selection");
98
- });
99
- });
100
- describe("InputRef type", () => {
101
- test("InputRef accepts TextInput", () => {
102
- const _ref = {};
103
- });
104
- test("InputRef rejects plain HTMLDivElement", () => {
105
- const _ref = {};
106
- });
107
- });
108
- describe("TextArea types", () => {
109
- test("TextArea has rows prop", () => {
110
- expectTypeOf().toHaveProperty("rows");
111
- });
112
- test("TextArea accepts style props", () => {
113
- expectTypeOf().toHaveProperty("padding");
114
- expectTypeOf().toHaveProperty("fontSize");
115
- });
116
- test("TextArea accepts HTML input props", () => {
117
- expectTypeOf().toHaveProperty("placeholder");
118
- expectTypeOf().toHaveProperty("value");
119
- });
120
- });
121
- describe("InputProps derivation", () => {
122
- test("InputProps equals GetProps<typeof Input>", () => {
123
- expectTypeOf().toEqualTypeOf();
124
- });
125
- test("TextAreaProps equals GetProps<typeof TextArea>", () => {
126
- expectTypeOf().toEqualTypeOf();
127
- });
128
- });
129
- //# sourceMappingURL=inputTypes.test-d.mjs.map
@@ -1 +0,0 @@
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;IAGj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B;EACvD,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1,129 +0,0 @@
1
- import { expectTypeOf, describe, test } from "vitest";
2
- describe("Input event handler types", function () {
3
- test("onChange event uses HTMLInputElement", function () {
4
- expectTypeOf().toMatchTypeOf();
5
- });
6
- test("onFocus event uses HTMLInputElement", function () {
7
- expectTypeOf().toMatchTypeOf();
8
- });
9
- test("onBlur event uses HTMLInputElement", function () {
10
- expectTypeOf().toMatchTypeOf();
11
- });
12
- test("onKeyDown event uses HTMLInputElement", function () {
13
- expectTypeOf().toMatchTypeOf();
14
- });
15
- test("onClick event uses HTMLInputElement", function () {
16
- expectTypeOf().toMatchTypeOf();
17
- });
18
- test("onChange event is NOT typed with HTMLDivElement", function () {
19
- expectTypeOf().toEqualTypeOf();
20
- });
21
- });
22
- describe("Input HTML props", function () {
23
- test("accepts type prop", function () {
24
- expectTypeOf().toHaveProperty("type");
25
- });
26
- test("accepts placeholder prop", function () {
27
- expectTypeOf().toHaveProperty("placeholder");
28
- });
29
- test("accepts value prop", function () {
30
- expectTypeOf().toHaveProperty("value");
31
- });
32
- test("accepts defaultValue prop", function () {
33
- expectTypeOf().toHaveProperty("defaultValue");
34
- });
35
- test("accepts maxLength prop", function () {
36
- expectTypeOf().toHaveProperty("maxLength");
37
- });
38
- test("accepts pattern prop", function () {
39
- expectTypeOf().toHaveProperty("pattern");
40
- });
41
- test("accepts required prop", function () {
42
- expectTypeOf().toHaveProperty("required");
43
- });
44
- test("accepts readOnly prop", function () {
45
- expectTypeOf().toHaveProperty("readOnly");
46
- });
47
- test("accepts autoComplete prop", function () {
48
- expectTypeOf().toHaveProperty("autoComplete");
49
- });
50
- test("accepts name prop", function () {
51
- expectTypeOf().toHaveProperty("name");
52
- });
53
- });
54
- describe("Input style props", function () {
55
- test("accepts padding style prop", function () {
56
- expectTypeOf().toHaveProperty("padding");
57
- });
58
- test("accepts backgroundColor style prop", function () {
59
- expectTypeOf().toHaveProperty("backgroundColor");
60
- });
61
- test("accepts borderRadius style prop", function () {
62
- expectTypeOf().toHaveProperty("borderRadius");
63
- });
64
- test("accepts text style props", function () {
65
- expectTypeOf().toHaveProperty("fontSize");
66
- expectTypeOf().toHaveProperty("fontWeight");
67
- expectTypeOf().toHaveProperty("color");
68
- });
69
- test("accepts textAlign longhand", function () {
70
- expectTypeOf().toMatchTypeOf();
71
- });
72
- test("accepts size variant", function () {
73
- expectTypeOf().toHaveProperty("size");
74
- });
75
- test("accepts unstyled variant", function () {
76
- expectTypeOf().toHaveProperty("unstyled");
77
- });
78
- });
79
- describe("Input cross-platform props", function () {
80
- test("autoCorrect accepts boolean and string", function () {
81
- expectTypeOf().toMatchTypeOf();
82
- });
83
- test("autoCapitalize accepts native and web values", function () {
84
- expectTypeOf().toMatchTypeOf();
85
- });
86
- test("accepts onChangeText callback", function () {
87
- expectTypeOf().toHaveProperty("onChangeText");
88
- expectTypeOf().toMatchTypeOf();
89
- });
90
- test("accepts onSubmitEditing callback", function () {
91
- expectTypeOf().toHaveProperty("onSubmitEditing");
92
- });
93
- test("accepts placeholderTextColor", function () {
94
- expectTypeOf().toHaveProperty("placeholderTextColor");
95
- });
96
- test("accepts selection prop", function () {
97
- expectTypeOf().toHaveProperty("selection");
98
- });
99
- });
100
- describe("InputRef type", function () {
101
- test("InputRef accepts TextInput", function () {
102
- var _ref = {};
103
- });
104
- test("InputRef rejects plain HTMLDivElement", function () {
105
- var _ref = {};
106
- });
107
- });
108
- describe("TextArea types", function () {
109
- test("TextArea has rows prop", function () {
110
- expectTypeOf().toHaveProperty("rows");
111
- });
112
- test("TextArea accepts style props", function () {
113
- expectTypeOf().toHaveProperty("padding");
114
- expectTypeOf().toHaveProperty("fontSize");
115
- });
116
- test("TextArea accepts HTML input props", function () {
117
- expectTypeOf().toHaveProperty("placeholder");
118
- expectTypeOf().toHaveProperty("value");
119
- });
120
- });
121
- describe("InputProps derivation", function () {
122
- test("InputProps equals GetProps<typeof Input>", function () {
123
- expectTypeOf().toEqualTypeOf();
124
- });
125
- test("TextAreaProps equals GetProps<typeof TextArea>", function () {
126
- expectTypeOf().toEqualTypeOf();
127
- });
128
- });
129
- //# sourceMappingURL=inputTypes.test-d.native.js.map
@@ -1 +0,0 @@
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,YAAM;EAC1CC,IAAA,CAAK,wCAAwC,YAAM;IAGjDF,YAAA,CAAqC,EAAEG,aAAA,CAAgC;EACzE,CAAC;EAEDD,IAAA,CAAK,uCAAuC,YAAM;IAGhDF,YAAA,CAAqC,EAAEG,aAAA,CAAgC;EACzE,CAAC;EAEDD,IAAA,CAAK,sCAAsC,YAAM;IAG/CF,YAAA,CAAqC,EAAEG,aAAA,CAAgC;EACzE,CAAC;EAEDD,IAAA,CAAK,yCAAyC,YAAM;IAGlDF,YAAA,CAAqC,EAAEG,aAAA,CAAgC;EACzE,CAAC;EAEDD,IAAA,CAAK,uCAAuC,YAAM;IAGhDF,YAAA,CAAqC,EAAEG,aAAA,CAAgC;EACzE,CAAC;EAEDD,IAAA,CAAK,mDAAmD,YAAM;IAK5DF,YAAA,CAAsC,EAAEI,aAAA,CAAqB;EAC/D,CAAC;AACH,CAAC;AAMDH,QAAA,CAAS,oBAAoB,YAAM;EACjCC,IAAA,CAAK,qBAAqB,YAAM;IAC9BF,YAAA,CAAyB,EAAEK,cAAA,CAAe,MAAM;EAClD,CAAC;EAEDH,IAAA,CAAK,4BAA4B,YAAM;IACrCF,YAAA,CAAyB,EAAEK,cAAA,CAAe,aAAa;EACzD,CAAC;EAEDH,IAAA,CAAK,sBAAsB,YAAM;IAC/BF,YAAA,CAAyB,EAAEK,cAAA,CAAe,OAAO;EACnD,CAAC;EAEDH,IAAA,CAAK,6BAA6B,YAAM;IACtCF,YAAA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AU;EACzD,CAAC;EAEDH,IAAA,CAAK,qCAAqC,YAAM;IAC9CF,YAAA,CAA4B,EAAEK,cAAA,CAAe,aAAa;IAC1DL,YAAA,CAA4B,EAAEK,cAAA,CAAe,OAAO;EACtD,CAAC;AACH,CAAC;AAMDJ,QAAA,CAAS,yBAAyB,YAAM;EACtCC,IAAA,CAAK,4CAA4C,YAAM;IAErDF,YAAA,CAAyB,EAAEI,aAAA,CAAuB;EACpD,CAAC;EAEDF,IAAA,CAAK,kDAAkD,YAAM;IAE3DF,YAAA,CAA4B,EAAEI,aAAA,CAAuB;EACvD,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
@@ -1,164 +0,0 @@
1
- import { View, styled, useEvent, useTheme } from "@tamagui/core";
2
- import { registerFocusable } from "@tamagui/focusable";
3
- import { useWebRef } from "@tamagui/element";
4
- import React from "react";
5
- import { styledBody } from "../shared.mjs";
6
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
- const StyledInput = styled(View, styledBody[0], styledBody[1]);
8
- const Input = StyledInput.styleable((inProps, forwardedRef) => {
9
- const {
10
- allowFontScaling,
11
- selectTextOnFocus,
12
- showSoftInputOnFocus,
13
- textContentType,
14
- passwordRules,
15
- textBreakStrategy,
16
- underlineColorAndroid,
17
- selection,
18
- lineBreakStrategyIOS,
19
- returnKeyLabel,
20
- disabled,
21
- onSubmitEditing,
22
- caretHidden,
23
- clearButtonMode,
24
- clearTextOnFocus,
25
- contextMenuHidden,
26
- dataDetectorTypes,
27
- id,
28
- enablesReturnKeyAutomatically,
29
- importantForAutofill,
30
- inlineImageLeft,
31
- inlineImagePadding,
32
- inputAccessoryViewID,
33
- keyboardAppearance,
34
- keyboardType,
35
- cursorColor,
36
- disableFullscreenUI,
37
- editable,
38
- maxFontSizeMultiplier,
39
- multiline,
40
- numberOfLines,
41
- onChangeText,
42
- onContentSizeChange,
43
- onEndEditing,
44
- onScroll,
45
- onSelectionChange,
46
- caretColor,
47
- placeholderTextColor,
48
- blurOnSubmit,
49
- enterKeyHint,
50
- returnKeyType,
51
- rejectResponderTermination,
52
- scrollEnabled,
53
- secureTextEntry,
54
- selectionColor,
55
- inputMode,
56
- ...rest
57
- } = inProps;
58
- const {
59
- ref,
60
- composedRef
61
- } = useWebRef(forwardedRef);
62
- const theme = useTheme();
63
- const _onSelectionChange = useEvent(() => {
64
- const start = ref.current?.selectionStart ?? 0;
65
- const end = ref.current?.selectionEnd ?? 0;
66
- onSelectionChange?.({
67
- nativeEvent: {
68
- selection: {
69
- end,
70
- start
71
- }
72
- }
73
- });
74
- });
75
- React.useEffect(() => {
76
- if (onSelectionChange) {
77
- ref.current?.addEventListener("selectionchange", _onSelectionChange);
78
- return () => {
79
- ref.current?.removeEventListener("selectionchange", _onSelectionChange);
80
- };
81
- }
82
- }, []);
83
- React.useEffect(() => {
84
- if (selection) ref.current?.setSelectionRange(selection.start || null, selection.end || null);
85
- }, [selection?.start, selection?.end]);
86
- const finalProps = {
87
- ...rest,
88
- disabled,
89
- caretColor,
90
- id,
91
- enterKeyHint,
92
- type: (() => {
93
- if (rest?.type) return rest.type;
94
- if (secureTextEntry) return "password";
95
- switch (keyboardType) {
96
- case "number-pad":
97
- case "numeric":
98
- return "number";
99
- case "email-address":
100
- return "email";
101
- case "phone-pad":
102
- return "tel";
103
- case "url":
104
- return "url";
105
- default:
106
- return "text";
107
- }
108
- })(),
109
- inputMode: (() => {
110
- switch (keyboardType) {
111
- case "number-pad":
112
- case "numeric":
113
- return "numeric";
114
- case "decimal-pad":
115
- return "decimal";
116
- case "email-address":
117
- return "email";
118
- case "phone-pad":
119
- return "tel";
120
- case "url":
121
- return "url";
122
- default:
123
- return;
124
- }
125
- })(),
126
- style: {
127
- ...rest.style,
128
- ...(placeholderTextColor && {
129
- "--t_placeholderColor": theme[placeholderTextColor]?.variable || placeholderTextColor
130
- }),
131
- ...(selectionColor && {
132
- "--t_selectionBackground": theme[selectionColor]?.variable || selectionColor
133
- })
134
- }
135
- };
136
- React.useEffect(() => {
137
- if (!id) return;
138
- if (disabled) return;
139
- return registerFocusable(id, {
140
- focusAndSelect: () => {
141
- ref.current?.focus();
142
- },
143
- focus: () => {}
144
- });
145
- }, [id, disabled]);
146
- return /* @__PURE__ */jsxs(Fragment, {
147
- children: [/* @__PURE__ */jsx("style", {
148
- children: `
149
- input::selection, textarea::selection {
150
- background-color: var(--t_selectionBackground) !important;
151
- }
152
-
153
- input::placeholder, textarea::placeholder {
154
- color: var(--t_placeholderColor) !important;
155
- }
156
- `
157
- }), /* @__PURE__ */jsx(StyledInput, {
158
- ref: composedRef,
159
- ...finalProps
160
- })]
161
- });
162
- });
163
- export { Input };
164
- //# sourceMappingURL=Input.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["View","styled","useEvent","useTheme","registerFocusable","useWebRef","React","styledBody","Fragment","jsx","jsxs","StyledInput","Input","styleable","inProps","forwardedRef","allowFontScaling","selectTextOnFocus","showSoftInputOnFocus","textContentType","passwordRules","textBreakStrategy","underlineColorAndroid","selection","lineBreakStrategyIOS","returnKeyLabel","disabled","onSubmitEditing","caretHidden","clearButtonMode","clearTextOnFocus","contextMenuHidden","dataDetectorTypes","id","enablesReturnKeyAutomatically","importantForAutofill","inlineImageLeft","inlineImagePadding","inputAccessoryViewID","keyboardAppearance","keyboardType","cursorColor","disableFullscreenUI","editable","maxFontSizeMultiplier","multiline","numberOfLines","onChangeText","onContentSizeChange","onEndEditing","onScroll","onSelectionChange","caretColor","placeholderTextColor","blurOnSubmit","enterKeyHint","returnKeyType","rejectResponderTermination","scrollEnabled","secureTextEntry","selectionColor","inputMode","rest","ref","composedRef","theme","_onSelectionChange","start","current","selectionStart","end","selectionEnd","nativeEvent","useEffect","addEventListener","removeEventListener","setSelectionRange","finalProps","type","style","variable","focusAndSelect","focus","children"],"sources":["Input.mjs"],"sourcesContent":["import { View, styled, useEvent, useTheme } from \"@tamagui/core\";\nimport { registerFocusable } from \"@tamagui/focusable\";\nimport { useWebRef } from \"@tamagui/element\";\nimport React from \"react\";\nimport { styledBody } from \"../shared\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\nconst StyledInput = styled(View, styledBody[0], styledBody[1]);\nconst Input = StyledInput.styleable((inProps, forwardedRef) => {\n\tconst { allowFontScaling, selectTextOnFocus, showSoftInputOnFocus, textContentType, passwordRules, textBreakStrategy, underlineColorAndroid, selection, lineBreakStrategyIOS, returnKeyLabel, disabled, onSubmitEditing, caretHidden, clearButtonMode, clearTextOnFocus, contextMenuHidden, dataDetectorTypes, id, enablesReturnKeyAutomatically, importantForAutofill, inlineImageLeft, inlineImagePadding, inputAccessoryViewID, keyboardAppearance, keyboardType, cursorColor, disableFullscreenUI, editable, maxFontSizeMultiplier, multiline, numberOfLines, onChangeText, onContentSizeChange, onEndEditing, onScroll, onSelectionChange, caretColor, placeholderTextColor, blurOnSubmit, enterKeyHint, returnKeyType, rejectResponderTermination, scrollEnabled, secureTextEntry, selectionColor, inputMode, ...rest } = inProps;\n\tconst { ref, composedRef } = useWebRef(forwardedRef);\n\tconst theme = useTheme();\n\tconst _onSelectionChange = useEvent(() => {\n\t\tconst start = ref.current?.selectionStart ?? 0;\n\t\tconst end = ref.current?.selectionEnd ?? 0;\n\t\tonSelectionChange?.({ nativeEvent: { selection: {\n\t\t\tend,\n\t\t\tstart\n\t\t} } });\n\t});\n\tReact.useEffect(() => {\n\t\tif (onSelectionChange) {\n\t\t\tref.current?.addEventListener(\"selectionchange\", _onSelectionChange);\n\t\t\treturn () => {\n\t\t\t\tref.current?.removeEventListener(\"selectionchange\", _onSelectionChange);\n\t\t\t};\n\t\t}\n\t}, []);\n\tReact.useEffect(() => {\n\t\tif (selection) ref.current?.setSelectionRange(selection.start || null, selection.end || null);\n\t}, [selection?.start, selection?.end]);\n\tconst finalProps = {\n\t\t...rest,\n\t\tdisabled,\n\t\tcaretColor,\n\t\tid,\n\t\tenterKeyHint,\n\t\ttype: (() => {\n\t\t\tif (rest?.type) return rest.type;\n\t\t\tif (secureTextEntry) return \"password\";\n\t\t\tswitch (keyboardType) {\n\t\t\t\tcase \"number-pad\":\n\t\t\t\tcase \"numeric\": return \"number\";\n\t\t\t\tcase \"email-address\": return \"email\";\n\t\t\t\tcase \"phone-pad\": return \"tel\";\n\t\t\t\tcase \"url\": return \"url\";\n\t\t\t\tdefault: return \"text\";\n\t\t\t}\n\t\t})(),\n\t\tinputMode: (() => {\n\t\t\tswitch (keyboardType) {\n\t\t\t\tcase \"number-pad\":\n\t\t\t\tcase \"numeric\": return \"numeric\";\n\t\t\t\tcase \"decimal-pad\": return \"decimal\";\n\t\t\t\tcase \"email-address\": return \"email\";\n\t\t\t\tcase \"phone-pad\": return \"tel\";\n\t\t\t\tcase \"url\": return \"url\";\n\t\t\t\tdefault: return;\n\t\t\t}\n\t\t})(),\n\t\tstyle: {\n\t\t\t...rest.style,\n\t\t\t...placeholderTextColor && { \"--t_placeholderColor\": theme[placeholderTextColor]?.variable || placeholderTextColor },\n\t\t\t...selectionColor && { \"--t_selectionBackground\": theme[selectionColor]?.variable || selectionColor }\n\t\t}\n\t};\n\tReact.useEffect(() => {\n\t\tif (!id) return;\n\t\tif (disabled) return;\n\t\treturn registerFocusable(id, {\n\t\t\tfocusAndSelect: () => {\n\t\t\t\tref.current?.focus();\n\t\t\t},\n\t\t\tfocus: () => {}\n\t\t});\n\t}, [id, disabled]);\n\treturn /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(\"style\", { children: `\n input::selection, textarea::selection {\n background-color: var(--t_selectionBackground) !important;\n }\n\n input::placeholder, textarea::placeholder {\n color: var(--t_placeholderColor) !important;\n }\n ` }), /* @__PURE__ */ jsx(StyledInput, {\n\t\tref: composedRef,\n\t\t...finalProps\n\t})] });\n});\n\nexport { Input };"],"mappings":"AA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