Skip to content

Commit 0ca14ea

Browse files
authored
Merge pull request #4833 from GeekyAnts/fix/input-stack-type
fix: input _stack type issue
2 parents 0b1c615 + 4453e4c commit 0ca14ea

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

src/components/primitives/Input/types.ts

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import type { TextInputProps } from 'react-native';
22
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';
84
import type { IBoxProps } from '../Box';
95
import type { ResponsiveValue } from '../../../components/types';
106
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
149
extends PlatformProps<IInputProps>,
1510
Omit<TextInputProps, 'textAlign'>,
1611
StyledProps {
@@ -39,9 +34,7 @@ export interface InterfaceInputProps
3934
* The size of the input.
4035
* @default 'md'
4136
*/
42-
size?:
43-
| ResponsiveValue<ISizes | (string & {}) | number>
44-
| ThemeComponentSizeType<'Input'>;
37+
size?: CombinedSizeType<'Input'>; // ResponsiveValue<ISizes | (string & {}) | number>;
4538
/**
4639
* This will set aria-required="true" on web when passed in formcontrol.
4740
*/
@@ -82,27 +75,31 @@ export interface InterfaceInputProps
8275
/**
8376
* Passed props will be applied on hovered state.
8477
*/
85-
_hover?: Omit<IInputProps, '_hover'>;
78+
_hover?: Omit<Partial<IInputProps>, '_hover'>;
8679
/**
8780
* Passed props will be applied on focused state.
8881
*/
89-
_focus?: Omit<IInputProps, '_focus'>;
82+
_focus?: Omit<Partial<IInputProps>, '_focus'>;
9083
/**
9184
* Passed props will be applied on disabled state.
9285
*/
93-
_disabled?: Omit<IInputProps, '_disabled'>;
86+
_disabled?: Omit<Partial<IInputProps>, '_disabled'>;
9487
/**
9588
* Passed props will be applied on readOnly state.
9689
*/
97-
_readOnly?: Omit<IInputProps, '_readOnly'>;
90+
_readOnly?: Omit<Partial<IInputProps>, '_readOnly'>;
9891
/**
9992
* Passed props will be applied on invalid state.
10093
*/
101-
_invalid?: Omit<IInputProps, '_hover'>;
94+
_invalid?: Omit<Partial<IInputProps>, '_hover'>;
10295
/**
10396
* props are passed to InputBase component
10497
*/
105-
_input?: {};
98+
_input?: Partial<IInputProps>;
99+
/**
100+
* Props to be passed to the Stack used inside.
101+
*/
102+
_stack?: Partial<IStackProps>;
106103
}
107104

108105
export interface IInputGroupProps extends IBoxProps<IInputGroupProps> {
@@ -117,5 +114,3 @@ export interface IInputGroupProps extends IBoxProps<IInputGroupProps> {
117114
*/
118115
size?: ResponsiveValue<ISizes | (string & {}) | number>;
119116
}
120-
121-
export type IInputProps = InterfaceInputProps | CustomProps<'Input'>;

0 commit comments

Comments
 (0)