@tamagui/input 2.7.7 → 3.0.0-beta.1093.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,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;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,EA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,IAAA,CAAK,8BAA8B,MAAM;IACvC,MAAMI,IAAA,GAAiB,CAAC;EAC1B,CAAC;EAEDJ,IAAA,CAAK,yCAAyC,MAAM;IAElD,MAAMI,IAAA,GAAiB,CAAC;EAC1B,CAAC;AACH,CAAC;AAMDL,QAAA,CAAS,kBAAkB,MAAM;EAC/BC,IAAA,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":[]}
@@ -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;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","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":"AAAA,SAASA,IAAI,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,eAAe;AAChE,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,eAAW;AACtC,SAASC,QAAQ,EAAEC,GAAG,EAAEC,IAAI,QAAQ,mBAAmB;AAEvD,MAAMC,WAAW,GAAGV,MAAM,CAACD,IAAI,EAAEO,UAAU,CAAC,CAAC,CAAC,EAAEA,UAAU,CAAC,CAAC,CAAC,CAAC;AAC9D,MAAMK,KAAK,GAAGD,WAAW,CAACE,SAAS,CAAC,CAACC,OAAO,EAAEC,YAAY,K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AAS;MACV;IACD,CAAC,EAAE,CAAC;IACJuC,KAAK,EAAE;MACN,GAAGjB,IAAI,CAACiB,KAAK;MACb,IAAG1B,oBAAoB,IAAI;QAAE,sBAAsB,EAAEY,KAAK,CAACZ,oBAAoB,CAAC,EAAE2B,QAAQ,IAAI3B;MAAqB,CAAC;MACpH,IAAGO,cAAc,IAAI;QAAE,yBAAyB,EAAEK,KAAK,CAACL,cAAc,CAAC,EAAEoB,QAAQ,IAAIpB;MAAe,CAAC;IACtG;EACD,CAAC;EACDtD,KAAK,CAACmE,SAAS,CAAC,MAAM;IACrB,IAAI,CAACxC,EAAE,EAAE;IACT,IAAIP,QAAQ,EAAE;IACd,OAAOtB,iBAAiB,CAAC6B,EAAE,EAAE;MAC5BgD,cAAc,EAAEA,CAAA,KAAM;QACrBlB,GAAG,CAACK,OAAO,EAAEc,KAAK,CAAC,CAAC;MACrB,CAAC;MACDA,KAAK,EAAEA,CAAA,KAAM,CAAC;IACf,CAAC,CAAC;EACH,CAAC,EAAE,CAACjD,EAAE,EAAEP,QAAQ,CAAC,CAAC;EAClB,OAAO,eAAgBhB,IAAI,CAACF,QAAQ,EAAE;IAAE2E,QAAQ,EAAE,CAAC,eAAgB1E,GAAG,CAAC,OAAO,EAAE;MAAE0E,QAAQ,EAAE;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IAAQ,CAAC,CAAC,EAAE,eAAgB1E,GAAG,CAACE,WAAW,EAAE;MAC3CoD,GAAG,EAAEC,WAAW;MAChB,GAAGa;IACJ,CAAC,CAAC;EAAE,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,SAASjE,KAAK","ignoreList":[]}
@@ -1,144 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import React from "react";
3
- import { styled } from "@tamagui/core";
4
- import { registerFocusable } from "@tamagui/focusable";
5
- import { useNativeInputRef } from "@tamagui/element";
6
- import { TextInput } from "react-native";
7
- import { styledBody } from "../shared.native.js";
8
- var StyledInput = styled(TextInput, styledBody[0], styledBody[1]);
9
- var Input = StyledInput.styleable(function (inProps, forwardedRef) {
10
- var {
11
- // some of destructed props are just to avoid passing them to ...rest because they are not in native.
12
- type,
13
- //@ts-ignore
14
- dirname,
15
- max,
16
- min,
17
- minLength,
18
- multiple,
19
- name,
20
- required,
21
- step,
22
- disabled,
23
- id,
24
- // @ts-ignore
25
- caretColor,
26
- onChange,
27
- onInput,
28
- rows,
29
- enterKeyHint,
30
- returnKeyType,
31
- onKeyDown,
32
- inputMode,
33
- render,
34
- ...rest
35
- } = inProps;
36
- var {
37
- ref,
38
- composedRef
39
- } = useNativeInputRef(forwardedRef);
40
- var secureTextEntry = false;
41
- var cursorColor = caretColor;
42
- var _returnKeyType = returnKeyType;
43
- var _enterKeyHint = enterKeyHint;
44
- if (enterKeyHint === "go") {
45
- _returnKeyType = "go";
46
- _enterKeyHint = void 0;
47
- }
48
- var _inputMode = inputMode;
49
- if (type === "email") {
50
- _inputMode = "email";
51
- } else if (type === "tel") {
52
- _inputMode = "tel";
53
- } else if (type === "search") {
54
- _inputMode = "search";
55
- } else if (type === "url") {
56
- _inputMode = "url";
57
- } else if (type === "password") {
58
- secureTextEntry = true;
59
- _inputMode = "text";
60
- } else if (type === "number") {
61
- _inputMode = "numeric";
62
- } else {
63
- _inputMode = "text";
64
- }
65
- var showSoftInputOnFocus = true;
66
- if (inputMode === "none") {
67
- showSoftInputOnFocus = false;
68
- }
69
- var finalProps = {
70
- ...rest,
71
- inputMode: _inputMode,
72
- showSoftInputOnFocus,
73
- disabled,
74
- id,
75
- cursorColor,
76
- enterKeyHint: _enterKeyHint,
77
- returnKeyType: _returnKeyType,
78
- secureTextEntry,
79
- numberOfLines: rows || rest.numberOfLines
80
- };
81
- if (render === "textarea") {
82
- finalProps.multiline = true;
83
- }
84
- if (onKeyDown) {
85
- finalProps.onKeyPress = function (e) {
86
- var {
87
- key
88
- } = e.nativeEvent;
89
- if (key === "Backspace" || render === "textarea" && key === "Enter" || key.length === 1) {
90
- onKeyDown({
91
- key,
92
- type: "keydown"
93
- });
94
- }
95
- };
96
- finalProps.onSubmitEditing = function (e) {
97
- onKeyDown({
98
- key: "Enter",
99
- type: "keydown"
100
- });
101
- };
102
- }
103
- if (onChange || onInput) {
104
- finalProps.onChange = function (e) {
105
- var {
106
- text
107
- } = e.nativeEvent;
108
- if (onChange) {
109
- onChange({
110
- target: {
111
- value: text
112
- },
113
- type: "change"
114
- });
115
- }
116
- if (onInput != null) {
117
- onInput({
118
- target: {
119
- value: text
120
- },
121
- type: "input"
122
- });
123
- }
124
- };
125
- }
126
- React.useEffect(function () {
127
- if (!id) return;
128
- if (disabled) return;
129
- return registerFocusable(id, {
130
- focusAndSelect: function () {
131
- var _ref_current;
132
- (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
133
- },
134
- focus: function () {}
135
- });
136
- }, [id, disabled]);
137
- return /* @__PURE__ */_jsx(StyledInput, {
138
- onChange: function (e) {},
139
- ref: composedRef,
140
- ...finalProps
141
- });
142
- });
143
- export { Input };
144
- //# sourceMappingURL=Input.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["jsx","_jsx","React","styled","registerFocusable","useNativeInputRef","TextInput","styledBody","StyledInput","Input","styleable","inProps","forwardedRef","type","dirname","max","min","minLength","multiple","name","required","step","disabled","id","caretColor","onChange","onInput","rows","enterKeyHint","returnKeyType","onKeyDown","inputMode","render","rest","ref","composedRef","secureTextEntry","cursorColor","_returnKeyType","_enterKeyHint","_inputMode","showSoftInputOnFocus","finalProps","numberOfLines","multiline","onKeyPress","e","key","nativeEvent","length","onSubmitEditing","text","target","value","useEffect","focusAndSelect","_ref_current","current","focus"],"sources":["../../../src/v1/Input.native.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,GAAA,IAAOC,IAAA,QAAY;AAC5B,OAAOC,KAAA,MAAW;AAClB,SAASC,MAAA,QAAc;AACvB,SAASC,iBAAA,QAAyB;AAClC,SAASC,iBAAA,QAAyB;AA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;MACL;IACJ;EACJ;EACAX,KAAA,CAAMoD,SAAA,CAAU,YAAW;IACvB,IAAI,CAAC/B,EAAA,EAAI;IACT,IAAID,QAAA,EAAU;IACd,OAAOlB,iBAAA,CAAkBmB,EAAA,EAAI;MACzBgC,cAAA,EAAgB,SAAAA,CAAA,EAAW;QACvB,IAAIC,YAAA;QACJ,CAACA,YAAA,GAAetB,GAAA,CAAIuB,OAAA,MAAa,QAAQD,YAAA,KAAiB,SAAS,SAASA,YAAA,CAAaE,KAAA,CAAM;MACnG;MACAA,KAAA,EAAO,SAAAA,CAAA,EAAW,CAAC;IACvB,CAAC;EACL,GAAG,CACCnC,EAAA,EACAD,QAAA,CACH;EACD,OAAqB,eAAArB,IAAA,CAAKO,WAAA,EAAa;IACnCiB,QAAA,EAAU,SAAAA,CAASqB,CAAA,EAAG,CAAC;IACvBZ,GAAA,EAAKC,WAAA;IACL,GAAGO;EACP,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,27 +0,0 @@
1
- import { styled } from "@tamagui/web";
2
- import { Input } from "./Input.mjs";
3
- import { defaultStyles, textAreaSizeVariant } from "../shared.mjs";
4
- const TextArea = styled(Input, {
5
- name: "TextArea",
6
- render: "textarea",
7
- // this attribute fixes firefox newline issue
8
- // @ts-ignore
9
- whiteSpace: "pre-wrap",
10
- variants: {
11
- unstyled: {
12
- false: {
13
- height: "auto",
14
- ...defaultStyles,
15
- numberOfLines: 3
16
- }
17
- },
18
- size: {
19
- "...size": textAreaSizeVariant
20
- }
21
- },
22
- defaultVariants: {
23
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
24
- }
25
- });
26
- export { TextArea };
27
- //# sourceMappingURL=TextArea.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["styled","Input","defaultStyles","textAreaSizeVariant","TextArea","name","render","whiteSpace","variants","unstyled","false","height","numberOfLines","size","defaultVariants","process","env","TAMAGUI_HEADLESS"],"sources":["../../../src/v1/TextArea.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,MAAA,QAAc;AACvB,SAASC,KAAA,QAAa;AACtB,SAASC,aAAA,EAAeC,mBAAA,QAA2B;AAO5C,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,aAAA,EAAe;MACjB;IACF;IAEAC,IAAA,EAAM;MACJ,WAAWV;IACb;EACF;EAEAW,eAAA,EAAiB;IACfL,QAAA,EAAUM,OAAA,CAAQC,GAAA,CAAIC,gBAAA,KAAqB;EAC7C;AACF,CAAC","ignoreList":[]}