File tree 6 files changed +40
-2
lines changed
6 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -8,3 +8,4 @@ export { default as IconButton } from './main/IconButton';
8
8
export { default as Checkbox } from './main/Checkbox' ;
9
9
export { default as Radio } from './main/Radio' ;
10
10
export { default as FormControl } from './main/FormControl' ;
11
+ export { default as TextInput } from './main/TextInput' ;
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { TextInput as TextInputRN } from 'react-native' ;
3
+ import { useComponentPropsResolver , useStyleFromPropsResolver } from '../../../hooks' ;
4
+ import type { ITextInputProps } from './types' ;
5
+
6
+ const TextInput = ( props : ITextInputProps ) => {
7
+ const resolvedProps = useComponentPropsResolver ( 'TextInput' , props ) ;
8
+ const [ style , restProps ] = useStyleFromPropsResolver ( 'TextInput' , resolvedProps ) ;
9
+ return < TextInputRN style = { style } { ...restProps } /> ;
10
+ } ;
11
+
12
+ export default TextInput ;
Original file line number Diff line number Diff line change
1
+ import type { TextInputProps } from 'react-native' ;
2
+ import type { ComponentStyledProps } from '../../../core/components/types' ;
3
+
4
+ export interface ITextInputProps extends Omit < TextInputProps , 'textAlign' > , ComponentStyledProps < 'TextInput' > { }
Original file line number Diff line number Diff line change 1
1
import type { StyledProps } from '../../theme/types' ;
2
2
3
3
export type ComponentName = 'Text' | 'Box' | 'Stack' | 'Button' | 'Pressable' | 'Icon' | 'Checkbox'
4
- | 'IconButton' | 'Radio' | 'FormControl' ;
4
+ | 'IconButton' | 'Radio' | 'FormControl' | 'TextInput' ;
5
5
6
6
export type VariantName = string ;
7
7
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export {
15
15
Text ,
16
16
Checkbox ,
17
17
Radio ,
18
- FormControl
18
+ FormControl ,
19
+ TextInput
19
20
} from './components' ;
20
21
export { UIKitIcon } ;
Original file line number Diff line number Diff line change
1
+ import { render } from '@testing-library/react-native' ;
2
+ import React from 'react' ;
3
+ import TextInput from '../../../src/components/main/TextInput' ;
4
+ import WithThemeProvider from '../../support/withThemeProvider' ;
5
+
6
+ const { itBehavesLike } = require ( '../../support/sharedExamples' ) ;
7
+
8
+ describe ( 'TextInput' , ( ) => {
9
+ const renderTextInput = props => render (
10
+ < TextInput testID = 'test-text-input' { ...props } /> ,
11
+ { wrapper : WithThemeProvider }
12
+ ) ;
13
+
14
+ itBehavesLike ( 'aStyledSystemComponent' ,
15
+ {
16
+ renderComponent : props => renderTextInput ( props ) ,
17
+ testId : 'test-text-input' ,
18
+ omitProps : [ 'gap' , 'tintColor' ]
19
+ } ) ;
20
+ } ) ;
You can’t perform that action at this time.
0 commit comments