1
1
import type { TextInputProps } from 'react-native' ;
2
2
import type { StyledProps } from '../../../theme/types' ;
3
- import type {
4
- PlatformProps ,
5
- ThemeComponentSizeType ,
6
- VariantType ,
7
- } from '../../types' ;
3
+ import type { CombinedSizeType , PlatformProps , VariantType } from '../../types' ;
8
4
import type { IBoxProps } from '../Box' ;
9
5
import type { ResponsiveValue } from '../../../components/types' ;
10
6
import type { ISizes } from '../../../theme/base/sizes' ;
11
- import type { CustomProps } from '../../types' ;
12
-
13
- export interface InterfaceInputProps
7
+ import type { IStackProps } from '../../primitives/Stack' ;
8
+ export interface IInputProps
14
9
extends PlatformProps < IInputProps > ,
15
10
Omit < TextInputProps , 'textAlign' > ,
16
11
StyledProps {
@@ -39,9 +34,7 @@ export interface InterfaceInputProps
39
34
* The size of the input.
40
35
* @default 'md'
41
36
*/
42
- size ?:
43
- | ResponsiveValue < ISizes | ( string & { } ) | number >
44
- | ThemeComponentSizeType < 'Input' > ;
37
+ size ?: CombinedSizeType < 'Input' > ; // ResponsiveValue<ISizes | (string & {}) | number>;
45
38
/**
46
39
* This will set aria-required="true" on web when passed in formcontrol.
47
40
*/
@@ -82,27 +75,31 @@ export interface InterfaceInputProps
82
75
/**
83
76
* Passed props will be applied on hovered state.
84
77
*/
85
- _hover ?: Omit < IInputProps , '_hover' > ;
78
+ _hover ?: Omit < Partial < IInputProps > , '_hover' > ;
86
79
/**
87
80
* Passed props will be applied on focused state.
88
81
*/
89
- _focus ?: Omit < IInputProps , '_focus' > ;
82
+ _focus ?: Omit < Partial < IInputProps > , '_focus' > ;
90
83
/**
91
84
* Passed props will be applied on disabled state.
92
85
*/
93
- _disabled ?: Omit < IInputProps , '_disabled' > ;
86
+ _disabled ?: Omit < Partial < IInputProps > , '_disabled' > ;
94
87
/**
95
88
* Passed props will be applied on readOnly state.
96
89
*/
97
- _readOnly ?: Omit < IInputProps , '_readOnly' > ;
90
+ _readOnly ?: Omit < Partial < IInputProps > , '_readOnly' > ;
98
91
/**
99
92
* Passed props will be applied on invalid state.
100
93
*/
101
- _invalid ?: Omit < IInputProps , '_hover' > ;
94
+ _invalid ?: Omit < Partial < IInputProps > , '_hover' > ;
102
95
/**
103
96
* props are passed to InputBase component
104
97
*/
105
- _input ?: { } ;
98
+ _input ?: Partial < IInputProps > ;
99
+ /**
100
+ * Props to be passed to the Stack used inside.
101
+ */
102
+ _stack ?: Partial < IStackProps > ;
106
103
}
107
104
108
105
export interface IInputGroupProps extends IBoxProps < IInputGroupProps > {
@@ -117,5 +114,3 @@ export interface IInputGroupProps extends IBoxProps<IInputGroupProps> {
117
114
*/
118
115
size ?: ResponsiveValue < ISizes | ( string & { } ) | number > ;
119
116
}
120
-
121
- export type IInputProps = InterfaceInputProps | CustomProps < 'Input' > ;
0 commit comments