@tamagui/input 2.0.0-rc.9 → 2.0.0
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.
- package/dist/cjs/Input.cjs +165 -153
- package/dist/cjs/Input.native.js +256 -233
- package/dist/cjs/Input.native.js.map +1 -1
- package/dist/cjs/InputNativeProps.cjs +7 -5
- package/dist/cjs/InputNativeProps.native.js +7 -5
- package/dist/cjs/InputNativeProps.native.js.map +1 -1
- package/dist/cjs/TextArea.cjs +15 -13
- package/dist/cjs/TextArea.native.js +34 -32
- package/dist/cjs/TextArea.native.js.map +1 -1
- package/dist/cjs/index.cjs +13 -11
- package/dist/cjs/index.native.js +13 -11
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/inputTypes.test-d.cjs +125 -0
- package/dist/cjs/inputTypes.test-d.native.js +128 -0
- package/dist/cjs/inputTypes.test-d.native.js.map +1 -0
- package/dist/cjs/shared.cjs +119 -104
- package/dist/cjs/shared.native.js +125 -110
- package/dist/cjs/shared.native.js.map +1 -1
- package/dist/cjs/types.cjs +7 -5
- package/dist/cjs/types.native.js +7 -5
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/v1/Input.cjs +177 -170
- package/dist/cjs/v1/Input.native.js +154 -112
- package/dist/cjs/v1/Input.native.js.map +1 -1
- package/dist/cjs/v1/TextArea.cjs +15 -13
- package/dist/cjs/v1/TextArea.native.js +34 -32
- package/dist/cjs/v1/TextArea.native.js.map +1 -1
- package/dist/cjs/v1/index.cjs +7 -5
- package/dist/cjs/v1/index.native.js +7 -5
- package/dist/cjs/v1/index.native.js.map +1 -1
- package/dist/cjs/v1/types.cjs +7 -5
- package/dist/cjs/v1/types.native.js +7 -5
- package/dist/cjs/v1/types.native.js.map +1 -1
- package/dist/esm/Input.mjs +134 -124
- package/dist/esm/Input.mjs.map +1 -1
- package/dist/esm/Input.native.js +225 -204
- package/dist/esm/Input.native.js.map +1 -1
- package/dist/esm/TextArea.mjs.map +1 -1
- package/dist/esm/TextArea.native.js.map +1 -1
- package/dist/esm/index.js +4 -7
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/inputTypes.test-d.mjs +126 -0
- package/dist/esm/inputTypes.test-d.mjs.map +1 -0
- package/dist/esm/inputTypes.test-d.native.js +126 -0
- package/dist/esm/inputTypes.test-d.native.js.map +1 -0
- package/dist/esm/shared.mjs +102 -89
- package/dist/esm/shared.mjs.map +1 -1
- package/dist/esm/shared.native.js +107 -94
- package/dist/esm/shared.native.js.map +1 -1
- package/dist/esm/v1/Input.mjs +146 -141
- package/dist/esm/v1/Input.mjs.map +1 -1
- package/dist/esm/v1/Input.native.js +123 -83
- package/dist/esm/v1/Input.native.js.map +1 -1
- package/dist/jsx/Input.mjs +134 -124
- package/dist/jsx/Input.mjs.map +1 -1
- package/dist/jsx/Input.native.js +256 -233
- package/dist/jsx/Input.native.js.map +1 -1
- package/dist/jsx/InputNativeProps.native.js +7 -5
- package/dist/jsx/TextArea.mjs.map +1 -1
- package/dist/jsx/TextArea.native.js +34 -32
- package/dist/jsx/TextArea.native.js.map +1 -1
- package/dist/jsx/index.js +4 -7
- package/dist/jsx/index.js.map +1 -6
- package/dist/jsx/index.native.js +13 -11
- package/dist/jsx/inputTypes.test-d.mjs +126 -0
- package/dist/jsx/inputTypes.test-d.mjs.map +1 -0
- package/dist/jsx/inputTypes.test-d.native.js +128 -0
- package/dist/jsx/inputTypes.test-d.native.js.map +1 -0
- package/dist/jsx/shared.mjs +102 -89
- package/dist/jsx/shared.mjs.map +1 -1
- package/dist/jsx/shared.native.js +125 -110
- package/dist/jsx/shared.native.js.map +1 -1
- package/dist/jsx/types.native.js +7 -5
- package/dist/jsx/v1/Input.mjs +146 -141
- package/dist/jsx/v1/Input.mjs.map +1 -1
- package/dist/jsx/v1/Input.native.js +154 -112
- package/dist/jsx/v1/Input.native.js.map +1 -1
- package/dist/jsx/v1/TextArea.native.js +34 -32
- package/dist/jsx/v1/TextArea.native.js.map +1 -1
- package/dist/jsx/v1/index.native.js +7 -5
- package/dist/jsx/v1/types.native.js +7 -5
- package/package.json +20 -19
- package/src/Input.native.tsx +2 -2
- package/src/Input.tsx +7 -5
- package/src/TextArea.tsx +3 -3
- package/src/index.ts +1 -1
- package/src/inputTypes.test-d.ts +237 -0
- package/src/shared.tsx +6 -0
- package/src/types.ts +24 -14
- package/src/v1/Input.tsx +4 -4
- package/types/Input.d.ts +14 -12
- package/types/Input.d.ts.map +1 -1
- package/types/Input.native.d.ts +12 -12
- package/types/Input.native.d.ts.map +1 -1
- package/types/TextArea.d.ts +8 -7
- package/types/TextArea.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/shared.d.ts +5 -0
- package/types/shared.d.ts.map +1 -1
- package/types/types.d.ts +14 -4
- package/types/types.d.ts.map +1 -1
- package/types/v1/Input.d.ts +12 -12
- package/types/v1/Input.native.d.ts +12 -12
- package/types/v1/TextArea.d.ts +6 -6
- package/dist/cjs/Input.js +0 -143
- package/dist/cjs/Input.js.map +0 -6
- package/dist/cjs/InputNativeProps.js +0 -14
- package/dist/cjs/InputNativeProps.js.map +0 -6
- package/dist/cjs/TextArea.js +0 -43
- package/dist/cjs/TextArea.js.map +0 -6
- package/dist/cjs/index.js +0 -24
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/shared.js +0 -111
- package/dist/cjs/shared.js.map +0 -6
- package/dist/cjs/types.js +0 -14
- package/dist/cjs/types.js.map +0 -6
- package/dist/cjs/v1/Input.js +0 -171
- package/dist/cjs/v1/Input.js.map +0 -6
- package/dist/cjs/v1/TextArea.js +0 -43
- package/dist/cjs/v1/TextArea.js.map +0 -6
- package/dist/cjs/v1/index.js +0 -16
- package/dist/cjs/v1/index.js.map +0 -6
- package/dist/cjs/v1/types.js +0 -14
- package/dist/cjs/v1/types.js.map +0 -6
- package/dist/esm/Input.js +0 -124
- package/dist/esm/Input.js.map +0 -6
- package/dist/esm/InputNativeProps.js +0 -1
- package/dist/esm/InputNativeProps.js.map +0 -6
- package/dist/esm/TextArea.js +0 -29
- package/dist/esm/TextArea.js.map +0 -6
- package/dist/esm/shared.js +0 -99
- package/dist/esm/shared.js.map +0 -6
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +0 -6
- package/dist/esm/v1/Input.js +0 -152
- package/dist/esm/v1/Input.js.map +0 -6
- package/dist/esm/v1/TextArea.js +0 -29
- package/dist/esm/v1/TextArea.js.map +0 -6
- package/dist/esm/v1/index.js +0 -3
- package/dist/esm/v1/index.js.map +0 -6
- package/dist/esm/v1/types.js +0 -1
- package/dist/esm/v1/types.js.map +0 -6
- package/dist/jsx/Input.js +0 -124
- package/dist/jsx/Input.js.map +0 -6
- package/dist/jsx/InputNativeProps.js +0 -1
- package/dist/jsx/InputNativeProps.js.map +0 -6
- package/dist/jsx/TextArea.js +0 -29
- package/dist/jsx/TextArea.js.map +0 -6
- package/dist/jsx/shared.js +0 -99
- package/dist/jsx/shared.js.map +0 -6
- package/dist/jsx/types.js +0 -1
- package/dist/jsx/types.js.map +0 -6
- package/dist/jsx/v1/Input.js +0 -152
- package/dist/jsx/v1/Input.js.map +0 -6
- package/dist/jsx/v1/TextArea.js +0 -29
- package/dist/jsx/v1/TextArea.js.map +0 -6
- package/dist/jsx/v1/index.js +0 -3
- package/dist/jsx/v1/index.js.map +0 -6
- package/dist/jsx/v1/types.js +0 -1
- package/dist/jsx/v1/types.js.map +0 -6
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type tests for Input component.
|
|
3
|
+
*
|
|
4
|
+
* Verifies that:
|
|
5
|
+
* 1. Event handlers are typed with HTMLInputElement (not HTMLDivElement)
|
|
6
|
+
* 2. HTML input-specific props are available (type, placeholder, etc.)
|
|
7
|
+
* 3. Tamagui style props and variants still work
|
|
8
|
+
* 4. Cross-platform props (autoCorrect, autoCapitalize) are present
|
|
9
|
+
* 5. InputRef includes both HTMLInputElement and TextInput
|
|
10
|
+
*
|
|
11
|
+
* Run with: npx vitest typecheck --run
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { expectTypeOf, describe, test } from 'vitest'
|
|
15
|
+
import type { GetProps } from '@tamagui/web'
|
|
16
|
+
import type { TextInput } from 'react-native'
|
|
17
|
+
import {
|
|
18
|
+
Input,
|
|
19
|
+
type InputProps,
|
|
20
|
+
type InputRef,
|
|
21
|
+
TextArea,
|
|
22
|
+
type TextAreaProps,
|
|
23
|
+
} from './index'
|
|
24
|
+
|
|
25
|
+
// helper: extract event param type
|
|
26
|
+
type EventParam<T> = T extends (event: infer E) => any ? E : never
|
|
27
|
+
type IsAssignable<T, U> = T extends U ? true : false
|
|
28
|
+
|
|
29
|
+
// =============================================================================
|
|
30
|
+
// Test: event handlers are typed with HTMLInputElement
|
|
31
|
+
// =============================================================================
|
|
32
|
+
|
|
33
|
+
describe('Input event handler types', () => {
|
|
34
|
+
test('onChange event uses HTMLInputElement', () => {
|
|
35
|
+
type OnChange = NonNullable<InputProps['onChange']>
|
|
36
|
+
type Event = EventParam<OnChange>
|
|
37
|
+
expectTypeOf<Event['currentTarget']>().toMatchTypeOf<HTMLInputElement>()
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
test('onFocus event uses HTMLInputElement', () => {
|
|
41
|
+
type OnFocus = NonNullable<InputProps['onFocus']>
|
|
42
|
+
type Event = EventParam<OnFocus>
|
|
43
|
+
expectTypeOf<Event['currentTarget']>().toMatchTypeOf<HTMLInputElement>()
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
test('onBlur event uses HTMLInputElement', () => {
|
|
47
|
+
type OnBlur = NonNullable<InputProps['onBlur']>
|
|
48
|
+
type Event = EventParam<OnBlur>
|
|
49
|
+
expectTypeOf<Event['currentTarget']>().toMatchTypeOf<HTMLInputElement>()
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
test('onKeyDown event uses HTMLInputElement', () => {
|
|
53
|
+
type OnKeyDown = NonNullable<InputProps['onKeyDown']>
|
|
54
|
+
type Event = EventParam<OnKeyDown>
|
|
55
|
+
expectTypeOf<Event['currentTarget']>().toMatchTypeOf<HTMLInputElement>()
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
test('onClick event uses HTMLInputElement', () => {
|
|
59
|
+
type OnClick = NonNullable<InputProps['onClick']>
|
|
60
|
+
type Event = EventParam<OnClick>
|
|
61
|
+
expectTypeOf<Event['currentTarget']>().toMatchTypeOf<HTMLInputElement>()
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
test('onChange event is NOT typed with HTMLDivElement', () => {
|
|
65
|
+
type OnChange = NonNullable<InputProps['onChange']>
|
|
66
|
+
type Event = EventParam<OnChange>
|
|
67
|
+
// HTMLDivElement should NOT be assignable to the currentTarget
|
|
68
|
+
type DivMatchesCurrentTarget = IsAssignable<HTMLDivElement, Event['currentTarget']>
|
|
69
|
+
expectTypeOf<DivMatchesCurrentTarget>().toEqualTypeOf<false>()
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
// =============================================================================
|
|
74
|
+
// Test: HTML input-specific props
|
|
75
|
+
// =============================================================================
|
|
76
|
+
|
|
77
|
+
describe('Input HTML props', () => {
|
|
78
|
+
test('accepts type prop', () => {
|
|
79
|
+
expectTypeOf<InputProps>().toHaveProperty('type')
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
test('accepts placeholder prop', () => {
|
|
83
|
+
expectTypeOf<InputProps>().toHaveProperty('placeholder')
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
test('accepts value prop', () => {
|
|
87
|
+
expectTypeOf<InputProps>().toHaveProperty('value')
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
test('accepts defaultValue prop', () => {
|
|
91
|
+
expectTypeOf<InputProps>().toHaveProperty('defaultValue')
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
test('accepts maxLength prop', () => {
|
|
95
|
+
expectTypeOf<InputProps>().toHaveProperty('maxLength')
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
test('accepts pattern prop', () => {
|
|
99
|
+
expectTypeOf<InputProps>().toHaveProperty('pattern')
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
test('accepts required prop', () => {
|
|
103
|
+
expectTypeOf<InputProps>().toHaveProperty('required')
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
test('accepts readOnly prop', () => {
|
|
107
|
+
expectTypeOf<InputProps>().toHaveProperty('readOnly')
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
test('accepts autoComplete prop', () => {
|
|
111
|
+
expectTypeOf<InputProps>().toHaveProperty('autoComplete')
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
test('accepts name prop', () => {
|
|
115
|
+
expectTypeOf<InputProps>().toHaveProperty('name')
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
// =============================================================================
|
|
120
|
+
// Test: Tamagui style props still work
|
|
121
|
+
// =============================================================================
|
|
122
|
+
|
|
123
|
+
describe('Input style props', () => {
|
|
124
|
+
test('accepts padding style prop', () => {
|
|
125
|
+
expectTypeOf<InputProps>().toHaveProperty('padding')
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
test('accepts backgroundColor style prop', () => {
|
|
129
|
+
expectTypeOf<InputProps>().toHaveProperty('backgroundColor')
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
test('accepts borderRadius style prop', () => {
|
|
133
|
+
expectTypeOf<InputProps>().toHaveProperty('borderRadius')
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
test('accepts text style props', () => {
|
|
137
|
+
expectTypeOf<InputProps>().toHaveProperty('fontSize')
|
|
138
|
+
expectTypeOf<InputProps>().toHaveProperty('fontWeight')
|
|
139
|
+
expectTypeOf<InputProps>().toHaveProperty('color')
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
test('accepts size variant', () => {
|
|
143
|
+
expectTypeOf<InputProps>().toHaveProperty('size')
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
test('accepts unstyled variant', () => {
|
|
147
|
+
expectTypeOf<InputProps>().toHaveProperty('unstyled')
|
|
148
|
+
})
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
// =============================================================================
|
|
152
|
+
// Test: cross-platform props
|
|
153
|
+
// =============================================================================
|
|
154
|
+
|
|
155
|
+
describe('Input cross-platform props', () => {
|
|
156
|
+
test('autoCorrect accepts boolean and string', () => {
|
|
157
|
+
expectTypeOf<InputProps['autoCorrect']>().toMatchTypeOf<
|
|
158
|
+
boolean | 'on' | 'off' | undefined
|
|
159
|
+
>()
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
test('autoCapitalize accepts native and web values', () => {
|
|
163
|
+
expectTypeOf<InputProps['autoCapitalize']>().toMatchTypeOf<
|
|
164
|
+
'none' | 'sentences' | 'words' | 'characters' | 'off' | 'on' | undefined
|
|
165
|
+
>()
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
test('accepts onChangeText callback', () => {
|
|
169
|
+
expectTypeOf<InputProps>().toHaveProperty('onChangeText')
|
|
170
|
+
expectTypeOf<NonNullable<InputProps['onChangeText']>>().toMatchTypeOf<
|
|
171
|
+
(text: string) => void
|
|
172
|
+
>()
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
test('accepts onSubmitEditing callback', () => {
|
|
176
|
+
expectTypeOf<InputProps>().toHaveProperty('onSubmitEditing')
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
test('accepts placeholderTextColor', () => {
|
|
180
|
+
expectTypeOf<InputProps>().toHaveProperty('placeholderTextColor')
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
test('accepts selection prop', () => {
|
|
184
|
+
expectTypeOf<InputProps>().toHaveProperty('selection')
|
|
185
|
+
})
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
// =============================================================================
|
|
189
|
+
// Test: InputRef type
|
|
190
|
+
// =============================================================================
|
|
191
|
+
|
|
192
|
+
describe('InputRef type', () => {
|
|
193
|
+
test('InputRef accepts TextInput', () => {
|
|
194
|
+
const _ref: InputRef = {} as TextInput
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
test('InputRef rejects plain HTMLDivElement', () => {
|
|
198
|
+
// @ts-expect-error - HTMLDivElement should not be assignable to InputRef
|
|
199
|
+
const _ref: InputRef = {} as HTMLDivElement
|
|
200
|
+
})
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
// =============================================================================
|
|
204
|
+
// Test: TextArea types
|
|
205
|
+
// =============================================================================
|
|
206
|
+
|
|
207
|
+
describe('TextArea types', () => {
|
|
208
|
+
test('TextArea has rows prop', () => {
|
|
209
|
+
expectTypeOf<TextAreaProps>().toHaveProperty('rows')
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
test('TextArea accepts style props', () => {
|
|
213
|
+
expectTypeOf<TextAreaProps>().toHaveProperty('padding')
|
|
214
|
+
expectTypeOf<TextAreaProps>().toHaveProperty('fontSize')
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
test('TextArea accepts HTML input props', () => {
|
|
218
|
+
expectTypeOf<TextAreaProps>().toHaveProperty('placeholder')
|
|
219
|
+
expectTypeOf<TextAreaProps>().toHaveProperty('value')
|
|
220
|
+
})
|
|
221
|
+
})
|
|
222
|
+
|
|
223
|
+
// =============================================================================
|
|
224
|
+
// Test: InputProps derived from GetProps (not manually defined)
|
|
225
|
+
// =============================================================================
|
|
226
|
+
|
|
227
|
+
describe('InputProps derivation', () => {
|
|
228
|
+
test('InputProps equals GetProps<typeof Input>', () => {
|
|
229
|
+
type Derived = GetProps<typeof Input>
|
|
230
|
+
expectTypeOf<InputProps>().toEqualTypeOf<Derived>()
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
test('TextAreaProps equals GetProps<typeof TextArea>', () => {
|
|
234
|
+
type Derived = GetProps<typeof TextArea>
|
|
235
|
+
expectTypeOf<TextAreaProps>().toEqualTypeOf<Derived>()
|
|
236
|
+
})
|
|
237
|
+
})
|
package/src/shared.tsx
CHANGED
|
@@ -109,6 +109,12 @@ export const styledBody = [
|
|
|
109
109
|
render: 'input',
|
|
110
110
|
variants: {
|
|
111
111
|
unstyled: {
|
|
112
|
+
true: {
|
|
113
|
+
// reset browser <input>/<textarea> defaults
|
|
114
|
+
outlineWidth: 0,
|
|
115
|
+
borderWidth: 0,
|
|
116
|
+
backgroundColor: 'transparent',
|
|
117
|
+
},
|
|
112
118
|
false: defaultStyles,
|
|
113
119
|
},
|
|
114
120
|
|
package/src/types.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import type { ColorTokens,
|
|
1
|
+
import type { ColorTokens, TextStyle, TamaguiElementMethods } from '@tamagui/web'
|
|
2
|
+
import type { TextInput } from 'react-native'
|
|
2
3
|
import type { InputNativeProps } from './InputNativeProps'
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
6
|
+
* Extra props that Input adds on top of the base styled component.
|
|
7
|
+
* Used with .styleable<InputExtraProps>() - the Styleable merge
|
|
8
|
+
* (`Omit<BaseProps, keyof CustomProps> & CustomProps`) automatically overrides
|
|
9
|
+
* base event handlers (HTMLDivElement) with these (HTMLInputElement).
|
|
10
|
+
* Consumer-facing InputProps is derived via GetProps<typeof Input>.
|
|
7
11
|
*/
|
|
8
12
|
|
|
9
13
|
type HTMLInputProps = React.InputHTMLAttributes<HTMLInputElement>
|
|
@@ -25,17 +29,16 @@ type InputTextStyleProps = Pick<
|
|
|
25
29
|
// props that have different types on web vs native and need cross-platform definitions
|
|
26
30
|
type OverlappingNativeProps = 'autoCorrect' | 'autoCapitalize' | 'spellCheck'
|
|
27
31
|
|
|
28
|
-
export type
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
> &
|
|
32
|
+
export type InputExtraProps = Omit<
|
|
33
|
+
HTMLInputProps,
|
|
34
|
+
| 'size'
|
|
35
|
+
| 'color'
|
|
36
|
+
| 'style'
|
|
37
|
+
| 'children'
|
|
38
|
+
| 'className'
|
|
39
|
+
| keyof InputTextStyleProps
|
|
40
|
+
| OverlappingNativeProps
|
|
41
|
+
> &
|
|
39
42
|
InputTextStyleProps &
|
|
40
43
|
Omit<InputNativeProps, OverlappingNativeProps> & {
|
|
41
44
|
/**
|
|
@@ -129,6 +132,13 @@ export type InputProps = ViewProps &
|
|
|
129
132
|
textContentType?: InputTextContentType
|
|
130
133
|
}
|
|
131
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Cross-platform ref type for Input.
|
|
137
|
+
* On web: HTMLInputElement with Tamagui methods (measure, focus, blur).
|
|
138
|
+
* On native: TextInput.
|
|
139
|
+
*/
|
|
140
|
+
export type InputRef = (HTMLInputElement & TamaguiElementMethods) | TextInput
|
|
141
|
+
|
|
132
142
|
/**
|
|
133
143
|
* iOS text content types for autofill
|
|
134
144
|
*/
|
package/src/v1/Input.tsx
CHANGED
|
@@ -147,11 +147,11 @@ export const Input = StyledInput.styleable<InputProps>((inProps, forwardedRef) =
|
|
|
147
147
|
style: {
|
|
148
148
|
...(rest.style as any),
|
|
149
149
|
...(placeholderTextColor && {
|
|
150
|
-
'--
|
|
150
|
+
'--t_placeholderColor':
|
|
151
151
|
theme[placeholderTextColor]?.variable || placeholderTextColor,
|
|
152
152
|
}),
|
|
153
153
|
...(selectionColor && {
|
|
154
|
-
'--
|
|
154
|
+
'--t_selectionBackground': theme[selectionColor]?.variable || selectionColor,
|
|
155
155
|
}),
|
|
156
156
|
},
|
|
157
157
|
} as any
|
|
@@ -174,11 +174,11 @@ export const Input = StyledInput.styleable<InputProps>((inProps, forwardedRef) =
|
|
|
174
174
|
<style>
|
|
175
175
|
{`
|
|
176
176
|
input::selection, textarea::selection {
|
|
177
|
-
background-color: var(--
|
|
177
|
+
background-color: var(--t_selectionBackground) !important;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
input::placeholder, textarea::placeholder {
|
|
181
|
-
color: var(--
|
|
181
|
+
color: var(--t_placeholderColor) !important;
|
|
182
182
|
}
|
|
183
183
|
`}
|
|
184
184
|
</style>
|
package/types/Input.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
+
import { type GetProps } from '@tamagui/core';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
/**
|
|
3
4
|
* A web-aligned input component.
|
|
4
5
|
* @see — Docs https://tamagui.dev/ui/inputs#input
|
|
5
6
|
*/
|
|
6
7
|
export declare const Input: import("@tamagui/core").TamaguiComponent<Omit<import("@tamagui/core").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase & {
|
|
7
|
-
readonly placeholderTextColor?:
|
|
8
|
-
readonly selectionColor?:
|
|
9
|
-
readonly cursorColor?:
|
|
10
|
-
readonly selectionHandleColor?:
|
|
11
|
-
readonly underlineColorAndroid?:
|
|
8
|
+
readonly placeholderTextColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
9
|
+
readonly selectionColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
10
|
+
readonly cursorColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
11
|
+
readonly selectionHandleColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
12
|
+
readonly underlineColorAndroid?: import("@tamagui/core").ColorTokens | undefined;
|
|
12
13
|
}, {
|
|
13
14
|
size?: import("@tamagui/core").SizeTokens | undefined;
|
|
14
15
|
disabled?: boolean | undefined;
|
|
15
16
|
unstyled?: boolean | undefined;
|
|
16
|
-
}>, "color" |
|
|
17
|
+
}>, "tabIndex" | "color" | "onMouseEnter" | "onMouseLeave" | "onMouseDown" | "onMouseUp" | "onMouseMove" | "onMouseOver" | "onMouseOut" | "onFocus" | "onBlur" | "onClick" | "onDoubleClick" | "onContextMenu" | "onWheel" | "onKeyDown" | "onKeyUp" | "onChange" | "onInput" | "onBeforeInput" | "onScroll" | "onCopy" | "onCut" | "onPaste" | "onDrag" | "onDragStart" | "onDragEnd" | "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop" | "onPointerDown" | "onPointerMove" | "onPointerUp" | "onPointerCancel" | "rel" | "dir" | "allowFontScaling" | "id" | "numberOfLines" | "maxFontSizeMultiplier" | "lineBreakStrategyIOS" | "disabled" | "selectionColor" | "textBreakStrategy" | "aria-label" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "aria-hidden" | "aria-modal" | "role" | "aria-labelledby" | "aria-live" | "content" | "verticalAlign" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "textAlign" | "textTransform" | "height" | "width" | "textAlignVertical" | "dangerouslySetInnerHTML" | "list" | "max" | "min" | "form" | "slot" | "title" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerMoveCapture" | "onPointerCancelCapture" | "onPointerDownCapture" | "onPointerUpCapture" | "hidden" | "value" | "name" | "returnKeyType" | "submitBehavior" | "blurOnSubmit" | "caretHidden" | "contextMenuHidden" | "selectTextOnFocus" | "secureTextEntry" | "onEndEditing" | "onContentSizeChange" | "onKeyPress" | "multiline" | "keyboardType" | "autoCapitalize" | "autoCorrect" | "autoFocusNative" | "keyboardAppearance" | "clearButtonMode" | "clearTextOnFocus" | "enablesReturnKeyAutomatically" | "dataDetectorTypes" | "scrollEnabled" | "passwordRules" | "rejectResponderTermination" | "spellCheck" | "lineBreakModeIOS" | "smartInsertDelete" | "inputAccessoryViewID" | "inputAccessoryViewButtonLabel" | "disableKeyboardShortcuts" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "maxLength" | "minLength" | "multiple" | "pattern" | "placeholder" | "readOnly" | "required" | "src" | "step" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "rev" | "typeof" | "vocab" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-dropeffect" | "aria-errormessage" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-setsize" | "aria-sort" | "onCopyCapture" | "onCutCapture" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInputCapture" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenuCapture" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeaveCapture" | "onDragOverCapture" | "onDragStartCapture" | "onDropCapture" | "onMouseDownCapture" | "onMouseMoveCapture" | "onMouseOutCapture" | "onMouseOverCapture" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancelCapture" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "cursorColor" | "selectionHandleColor" | "underlineColorAndroid" | "importantForAutofill" | "disableFullscreenUI" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "showSoftInputOnFocus" | "placeholderTextColor" | "onChangeText" | "onSelectionChange" | "onSubmitEditing" | "selection" | "textContentType" | "rows"> & Omit<React.InputHTMLAttributes<HTMLInputElement>, "color" | "size" | "children" | "style" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "textAlign" | "textTransform" | "className" | ("autoCapitalize" | "autoCorrect" | "spellCheck")> & {
|
|
17
18
|
color?: "unset" | import("react-native").OpaqueColorValue | import("@tamagui/core").GetThemeValueForKey<"color"> | undefined;
|
|
18
19
|
fontFamily?: "unset" | import("@tamagui/core").GetThemeValueForKey<"fontFamily"> | undefined;
|
|
19
20
|
fontSize?: "unset" | import("@tamagui/core").GetThemeValueForKey<"fontSize"> | undefined;
|
|
@@ -48,7 +49,7 @@ export declare const Input: import("@tamagui/core").TamaguiComponent<Omit<import
|
|
|
48
49
|
};
|
|
49
50
|
}) => void;
|
|
50
51
|
textContentType?: import("./types").InputTextContentType;
|
|
51
|
-
}, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps &
|
|
52
|
+
}, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "color" | "size" | "children" | "style" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "textAlign" | "textTransform" | "className" | ("autoCapitalize" | "autoCorrect" | "spellCheck")> & {
|
|
52
53
|
color?: "unset" | import("react-native").OpaqueColorValue | import("@tamagui/core").GetThemeValueForKey<"color"> | undefined;
|
|
53
54
|
fontFamily?: "unset" | import("@tamagui/core").GetThemeValueForKey<"fontFamily"> | undefined;
|
|
54
55
|
fontSize?: "unset" | import("@tamagui/core").GetThemeValueForKey<"fontSize"> | undefined;
|
|
@@ -84,11 +85,11 @@ export declare const Input: import("@tamagui/core").TamaguiComponent<Omit<import
|
|
|
84
85
|
}) => void;
|
|
85
86
|
textContentType?: import("./types").InputTextContentType;
|
|
86
87
|
}, import("@tamagui/core").StackStyleBase & {
|
|
87
|
-
readonly placeholderTextColor?:
|
|
88
|
-
readonly selectionColor?:
|
|
89
|
-
readonly cursorColor?:
|
|
90
|
-
readonly selectionHandleColor?:
|
|
91
|
-
readonly underlineColorAndroid?:
|
|
88
|
+
readonly placeholderTextColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
89
|
+
readonly selectionColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
90
|
+
readonly cursorColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
91
|
+
readonly selectionHandleColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
92
|
+
readonly underlineColorAndroid?: import("@tamagui/core").ColorTokens | undefined;
|
|
92
93
|
}, {
|
|
93
94
|
size?: import("@tamagui/core").SizeTokens | undefined;
|
|
94
95
|
disabled?: boolean | undefined;
|
|
@@ -106,4 +107,5 @@ export declare const Input: import("@tamagui/core").TamaguiComponent<Omit<import
|
|
|
106
107
|
[key: string]: boolean;
|
|
107
108
|
} | undefined;
|
|
108
109
|
}>;
|
|
110
|
+
export type InputProps = GetProps<typeof Input>;
|
|
109
111
|
//# sourceMappingURL=Input.d.ts.map
|
package/types/Input.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../src/Input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../src/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAA0B,MAAM,eAAe,CAAA;AAGrE,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB;;;GAGG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAuHJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCb,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAA"}
|
package/types/Input.native.d.ts
CHANGED
|
@@ -5,16 +5,16 @@ import { TextInput, type TextInputProps as RNTextInputProps } from 'react-native
|
|
|
5
5
|
* @see — Docs https://tamagui.dev/ui/inputs#input
|
|
6
6
|
*/
|
|
7
7
|
export declare const Input: import("@tamagui/core").TamaguiComponent<Omit<import("@tamagui/core").GetFinalProps<import("@tamagui/core").TamaguiComponentPropsBaseBase & RNTextInputProps, import("@tamagui/core").TextStylePropsBase & {
|
|
8
|
-
readonly placeholderTextColor?:
|
|
9
|
-
readonly selectionColor?:
|
|
10
|
-
readonly cursorColor?:
|
|
11
|
-
readonly selectionHandleColor?:
|
|
12
|
-
readonly underlineColorAndroid?:
|
|
8
|
+
readonly placeholderTextColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
9
|
+
readonly selectionColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
10
|
+
readonly cursorColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
11
|
+
readonly selectionHandleColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
12
|
+
readonly underlineColorAndroid?: import("@tamagui/core").ColorTokens | undefined;
|
|
13
13
|
}, {
|
|
14
14
|
size?: import("@tamagui/core").SizeTokens | undefined;
|
|
15
15
|
disabled?: boolean | undefined;
|
|
16
16
|
unstyled?: boolean | undefined;
|
|
17
|
-
}>, "color" |
|
|
17
|
+
}>, "tabIndex" | "color" | "onMouseEnter" | "onMouseLeave" | "onMouseDown" | "onMouseUp" | "onMouseMove" | "onMouseOver" | "onMouseOut" | "onFocus" | "onBlur" | "onClick" | "onDoubleClick" | "onContextMenu" | "onWheel" | "onKeyDown" | "onKeyUp" | "onChange" | "onInput" | "onBeforeInput" | "onScroll" | "onCopy" | "onCut" | "onPaste" | "onDrag" | "onDragStart" | "onDragEnd" | "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop" | "onPointerDown" | "onPointerMove" | "onPointerUp" | "onPointerCancel" | "rel" | "dir" | "allowFontScaling" | "id" | "numberOfLines" | "maxFontSizeMultiplier" | "lineBreakStrategyIOS" | "disabled" | "selectionColor" | "textBreakStrategy" | "aria-label" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "aria-hidden" | "aria-modal" | "role" | "aria-labelledby" | "aria-live" | "content" | "verticalAlign" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "textAlign" | "textTransform" | "height" | "width" | "textAlignVertical" | "dangerouslySetInnerHTML" | "list" | "max" | "min" | "form" | "slot" | "title" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerMoveCapture" | "onPointerCancelCapture" | "onPointerDownCapture" | "onPointerUpCapture" | "hidden" | "value" | "name" | "returnKeyType" | "submitBehavior" | "blurOnSubmit" | "caretHidden" | "contextMenuHidden" | "selectTextOnFocus" | "secureTextEntry" | "onEndEditing" | "onContentSizeChange" | "onKeyPress" | "multiline" | "keyboardType" | "autoCapitalize" | "autoCorrect" | "autoFocusNative" | "keyboardAppearance" | "clearButtonMode" | "clearTextOnFocus" | "enablesReturnKeyAutomatically" | "dataDetectorTypes" | "scrollEnabled" | "passwordRules" | "rejectResponderTermination" | "spellCheck" | "lineBreakModeIOS" | "smartInsertDelete" | "inputAccessoryViewID" | "inputAccessoryViewButtonLabel" | "disableKeyboardShortcuts" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "maxLength" | "minLength" | "multiple" | "pattern" | "placeholder" | "readOnly" | "required" | "src" | "step" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "rev" | "typeof" | "vocab" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-dropeffect" | "aria-errormessage" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-setsize" | "aria-sort" | "onCopyCapture" | "onCutCapture" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInputCapture" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenuCapture" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeaveCapture" | "onDragOverCapture" | "onDragStartCapture" | "onDropCapture" | "onMouseDownCapture" | "onMouseMoveCapture" | "onMouseOutCapture" | "onMouseOverCapture" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancelCapture" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "cursorColor" | "selectionHandleColor" | "underlineColorAndroid" | "importantForAutofill" | "disableFullscreenUI" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "showSoftInputOnFocus" | "placeholderTextColor" | "onChangeText" | "onSelectionChange" | "onSubmitEditing" | "selection" | "textContentType" | "rows"> & Omit<React.InputHTMLAttributes<HTMLInputElement>, "color" | "size" | "children" | "style" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "textAlign" | "textTransform" | "className" | ("autoCapitalize" | "autoCorrect" | "spellCheck")> & {
|
|
18
18
|
color?: "unset" | import("react-native").OpaqueColorValue | import("@tamagui/core").GetThemeValueForKey<"color"> | undefined;
|
|
19
19
|
fontFamily?: "unset" | import("@tamagui/core").GetThemeValueForKey<"fontFamily"> | undefined;
|
|
20
20
|
fontSize?: "unset" | import("@tamagui/core").GetThemeValueForKey<"fontSize"> | undefined;
|
|
@@ -49,7 +49,7 @@ export declare const Input: import("@tamagui/core").TamaguiComponent<Omit<import
|
|
|
49
49
|
};
|
|
50
50
|
}) => void;
|
|
51
51
|
textContentType?: import("./types").InputTextContentType;
|
|
52
|
-
}, TextInput, import("@tamagui/core").TamaguiComponentPropsBaseBase & RNTextInputProps &
|
|
52
|
+
}, TextInput, import("@tamagui/core").TamaguiComponentPropsBaseBase & RNTextInputProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "color" | "size" | "children" | "style" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "textAlign" | "textTransform" | "className" | ("autoCapitalize" | "autoCorrect" | "spellCheck")> & {
|
|
53
53
|
color?: "unset" | import("react-native").OpaqueColorValue | import("@tamagui/core").GetThemeValueForKey<"color"> | undefined;
|
|
54
54
|
fontFamily?: "unset" | import("@tamagui/core").GetThemeValueForKey<"fontFamily"> | undefined;
|
|
55
55
|
fontSize?: "unset" | import("@tamagui/core").GetThemeValueForKey<"fontSize"> | undefined;
|
|
@@ -85,11 +85,11 @@ export declare const Input: import("@tamagui/core").TamaguiComponent<Omit<import
|
|
|
85
85
|
}) => void;
|
|
86
86
|
textContentType?: import("./types").InputTextContentType;
|
|
87
87
|
}, import("@tamagui/core").TextStylePropsBase & {
|
|
88
|
-
readonly placeholderTextColor?:
|
|
89
|
-
readonly selectionColor?:
|
|
90
|
-
readonly cursorColor?:
|
|
91
|
-
readonly selectionHandleColor?:
|
|
92
|
-
readonly underlineColorAndroid?:
|
|
88
|
+
readonly placeholderTextColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
89
|
+
readonly selectionColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
90
|
+
readonly cursorColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
91
|
+
readonly selectionHandleColor?: import("@tamagui/core").ColorTokens | undefined;
|
|
92
|
+
readonly underlineColorAndroid?: import("@tamagui/core").ColorTokens | undefined;
|
|
93
93
|
}, {
|
|
94
94
|
size?: import("@tamagui/core").SizeTokens | undefined;
|
|
95
95
|
disabled?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.native.d.ts","sourceRoot":"","sources":["../src/Input.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAA;AASjF;;;GAGG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Input.native.d.ts","sourceRoot":"","sources":["../src/Input.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAA;AASjF;;;GAGG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA2HO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkJxB,CAAA"}
|
package/types/TextArea.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { type GetProps } from '@tamagui/web';
|
|
2
2
|
/**
|
|
3
3
|
* A web-aligned textarea component (multi-line input).
|
|
4
4
|
* @see — Docs https://tamagui.dev/ui/inputs#textarea
|
|
5
5
|
*/
|
|
6
|
-
export declare const TextArea: import("@tamagui/web").TamaguiComponent<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps &
|
|
6
|
+
export declare const TextArea: import("@tamagui/web").TamaguiComponent<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "color" | "size" | "children" | "style" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "textAlign" | "textTransform" | "className" | ("autoCapitalize" | "autoCorrect" | "spellCheck")> & {
|
|
7
7
|
color?: "unset" | import("react-native").OpaqueColorValue | import("@tamagui/web").GetThemeValueForKey<"color"> | undefined;
|
|
8
8
|
fontFamily?: "unset" | import("@tamagui/web").GetThemeValueForKey<"fontFamily"> | undefined;
|
|
9
9
|
fontSize?: "unset" | import("@tamagui/web").GetThemeValueForKey<"fontSize"> | undefined;
|
|
@@ -39,11 +39,11 @@ export declare const TextArea: import("@tamagui/web").TamaguiComponent<import("@
|
|
|
39
39
|
}) => void;
|
|
40
40
|
textContentType?: import("./types").InputTextContentType;
|
|
41
41
|
}, import("@tamagui/web").StackStyleBase & {
|
|
42
|
-
readonly placeholderTextColor?:
|
|
43
|
-
readonly selectionColor?:
|
|
44
|
-
readonly cursorColor?:
|
|
45
|
-
readonly selectionHandleColor?:
|
|
46
|
-
readonly underlineColorAndroid?:
|
|
42
|
+
readonly placeholderTextColor?: import("@tamagui/web").ColorTokens | undefined;
|
|
43
|
+
readonly selectionColor?: import("@tamagui/web").ColorTokens | undefined;
|
|
44
|
+
readonly cursorColor?: import("@tamagui/web").ColorTokens | undefined;
|
|
45
|
+
readonly selectionHandleColor?: import("@tamagui/web").ColorTokens | undefined;
|
|
46
|
+
readonly underlineColorAndroid?: import("@tamagui/web").ColorTokens | undefined;
|
|
47
47
|
}, {
|
|
48
48
|
size?: import("@tamagui/web").SizeTokens | undefined;
|
|
49
49
|
disabled?: boolean | undefined;
|
|
@@ -61,4 +61,5 @@ export declare const TextArea: import("@tamagui/web").TamaguiComponent<import("@
|
|
|
61
61
|
[key: string]: boolean;
|
|
62
62
|
} | undefined;
|
|
63
63
|
} & import("@tamagui/web").StaticConfigPublic>;
|
|
64
|
+
export type TextAreaProps = GetProps<typeof TextArea>;
|
|
64
65
|
//# sourceMappingURL=TextArea.d.ts.map
|
package/types/TextArea.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../src/TextArea.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../src/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAU,MAAM,cAAc,CAAA;AAIpD;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;WA4BslF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAH1mF,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAA"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './Input';
|
|
2
2
|
export * from './TextArea';
|
|
3
3
|
export { inputSizeVariant, textAreaSizeVariant } from './shared';
|
|
4
|
-
export type {
|
|
4
|
+
export type { InputExtraProps, InputRef, InputTextContentType } from './types';
|
|
5
5
|
export type { InputNativeProps, InputIOSProps, InputAndroidProps, InputDataDetectorTypes, InputReturnKeyType, InputKeyboardType, } from './InputNativeProps';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAChE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAChE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9E,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,oBAAoB,CAAA"}
|
package/types/shared.d.ts
CHANGED
|
@@ -50,6 +50,11 @@ export declare const styledBody: readonly [{
|
|
|
50
50
|
readonly render: "input";
|
|
51
51
|
readonly variants: {
|
|
52
52
|
readonly unstyled: {
|
|
53
|
+
readonly true: {
|
|
54
|
+
readonly outlineWidth: 0;
|
|
55
|
+
readonly borderWidth: 0;
|
|
56
|
+
readonly backgroundColor: "transparent";
|
|
57
|
+
};
|
|
53
58
|
readonly false: {
|
|
54
59
|
readonly borderColor: "$borderColor";
|
|
55
60
|
readonly backgroundColor: "$background";
|