@momo-kits/foundation 0.81.1-beta.6 → 0.81.1-optimize.10

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 (77) hide show
  1. package/Application/BottomSheet.tsx +225 -0
  2. package/Application/BottomTab/BottomTabBar.tsx +291 -0
  3. package/Application/BottomTab/index.tsx +138 -0
  4. package/Application/Components.tsx +274 -211
  5. package/Application/ModalScreen.tsx +10 -226
  6. package/Application/Navigation.ts +17 -6
  7. package/Application/NavigationContainer.tsx +66 -65
  8. package/Application/Navigator.ts +106 -53
  9. package/Application/StackScreen.tsx +123 -28
  10. package/Application/index.ts +15 -9
  11. package/Application/types.ts +55 -31
  12. package/Application/utils.tsx +36 -6
  13. package/Assets/icon.json +83 -5
  14. package/Assets/icon_bank.json +506 -0
  15. package/Assets/language.json +3 -1
  16. package/Badge/Badge.tsx +56 -0
  17. package/Badge/BadgeDot.tsx +11 -0
  18. package/Badge/BadgeRibbon.tsx +125 -0
  19. package/Badge/Shape.tsx +29 -0
  20. package/Badge/index.tsx +7 -0
  21. package/Badge/styles.ts +58 -0
  22. package/Badge/types.ts +63 -0
  23. package/Button/index.tsx +60 -24
  24. package/Button/styles.ts +19 -0
  25. package/CheckBox/index.tsx +37 -27
  26. package/CheckBox/types.ts +5 -3
  27. package/Consts/colors+spacing+radius.ts +17 -3
  28. package/Icon/index.tsx +14 -9
  29. package/Icon/types.ts +4 -3
  30. package/IconButton/index.tsx +24 -15
  31. package/Image/index.tsx +61 -55
  32. package/Image/styles.ts +1 -9
  33. package/Image/types.ts +5 -1
  34. package/Input/Input.tsx +102 -25
  35. package/Input/InputDropDown.tsx +32 -23
  36. package/Input/InputMoney.tsx +67 -18
  37. package/Input/InputOTP.tsx +194 -148
  38. package/Input/InputSearch.tsx +72 -36
  39. package/Input/InputTextArea.tsx +33 -18
  40. package/Input/common.tsx +25 -16
  41. package/Input/index.tsx +62 -16
  42. package/Input/styles.ts +5 -8
  43. package/Layout/Card.tsx +20 -11
  44. package/Layout/FloatingButton.tsx +168 -0
  45. package/Layout/GridSystem.tsx +1 -2
  46. package/Layout/Item.tsx +0 -1
  47. package/Layout/ItemList.tsx +39 -40
  48. package/Layout/ItemSectionList.tsx +39 -0
  49. package/Layout/Screen.tsx +151 -65
  50. package/Layout/Section.tsx +17 -19
  51. package/Layout/index.ts +2 -1
  52. package/Layout/styles.ts +20 -15
  53. package/Layout/types.ts +2 -5
  54. package/Layout/utils.ts +2 -2
  55. package/Pagination/PaginationNumber.tsx +1 -1
  56. package/Pagination/PaginationScroll.tsx +0 -1
  57. package/Popup/PopupNotify.tsx +105 -37
  58. package/Popup/PopupPromotion.tsx +44 -9
  59. package/Popup/types.ts +12 -9
  60. package/Radio/index.tsx +35 -21
  61. package/Radio/types.ts +5 -3
  62. package/Skeleton/index.tsx +1 -1
  63. package/Switch/index.tsx +32 -19
  64. package/Switch/types.ts +5 -3
  65. package/Tag/index.tsx +2 -4
  66. package/Text/index.tsx +26 -6
  67. package/Text/styles.ts +38 -0
  68. package/Text/types.ts +25 -13
  69. package/Title/index.tsx +172 -63
  70. package/Title/styles.ts +48 -15
  71. package/Title/types.ts +16 -47
  72. package/code-scanner.js +131 -39
  73. package/index.ts +9 -0
  74. package/migrate_typo.js +56 -0
  75. package/package.json +8 -8
  76. package/verify.js +24 -6
  77. package/Application/BottomTab.tsx +0 -65
@@ -153,9 +153,9 @@ const Spacing = {
153
153
  L: 16,
154
154
  XL: 24,
155
155
  XXL: 32,
156
- Size48: 48,
157
- Size56: 56,
158
- Size64: 64,
156
+ Size3XL: 48,
157
+ Size4XL: 56,
158
+ Size5XL: 64,
159
159
  };
160
160
 
161
161
  const Radius = {
@@ -213,6 +213,20 @@ const Shadow = {
213
213
  elevation: 6,
214
214
  },
215
215
  }),
216
+
217
+ Pink: Platform.select({
218
+ ios: {
219
+ shadowColor: '#e27eb5',
220
+ shadowOffset: {width: 0, height: 6},
221
+ shadowOpacity: 0.25,
222
+ shadowRadius: 8,
223
+ },
224
+ android: {
225
+ elevation: 16,
226
+ shadowColor: '#e27eb5',
227
+ shadowOpacity: 0.25,
228
+ },
229
+ }),
216
230
  };
217
231
 
218
232
  export {Colors, Spacing, Radius, Shadow};
package/Icon/index.tsx CHANGED
@@ -1,10 +1,16 @@
1
1
  import React, {useContext} from 'react';
2
2
  import IconSources from '../Assets/icon.json';
3
+ import IconBankSources from '../Assets/icon_bank.json';
3
4
  import {IconProps} from './types';
4
5
  import {ApplicationContext} from '../Application';
5
6
  import {Image} from '../Image';
6
7
 
7
- const Icon: React.FC<IconProps> = ({source, size, color, style = {}}) => {
8
+ const Icon: React.FC<IconProps> = ({
9
+ source = 'ic_back',
10
+ size = 24,
11
+ color,
12
+ style = {},
13
+ }) => {
8
14
  const {theme} = useContext(ApplicationContext);
9
15
 
10
16
  /**
@@ -18,20 +24,19 @@ const Icon: React.FC<IconProps> = ({source, size, color, style = {}}) => {
18
24
  return {uri: source};
19
25
  };
20
26
 
27
+ const tintColorProps = color !== null && {
28
+ tintColor: color ?? theme.colors.text.default,
29
+ };
30
+
21
31
  return (
22
32
  <Image
23
- accessibilityLabel={`Icon/${getIconSource()?.uri}`}
24
33
  loading={false}
25
34
  source={getIconSource()}
26
35
  style={[style, {width: size, height: size}]}
27
- tintColor={color ?? theme.colors.text.default}
36
+ resizeMode='contain'
37
+ {...tintColorProps}
28
38
  />
29
39
  );
30
40
  };
31
41
 
32
- Icon.defaultProps = {
33
- source: 'ic_back',
34
- size: 24,
35
- };
36
-
37
- export {Icon, IconSources};
42
+ export {Icon, IconSources, IconBankSources};
package/Icon/types.ts CHANGED
@@ -1,4 +1,5 @@
1
- import {ViewStyle} from 'react-native';
1
+ import {ImageStyle} from 'react-native-fast-image';
2
+ import {StyleProp} from "react-native";
2
3
 
3
4
  export type IconProps = {
4
5
  /**
@@ -17,11 +18,11 @@ export type IconProps = {
17
18
  * Optional. Represents the color of the icon.
18
19
  * It can be any valid color in @momo-kits/foundation.
19
20
  */
20
- color?: string;
21
+ color?: string | null;
21
22
 
22
23
  /**
23
24
  * Optional. Used to apply custom styling to the Icon component.
24
25
  * Accepts an object of style properties.
25
26
  */
26
- style?: ViewStyle;
27
+ style?: StyleProp<ImageStyle>;
27
28
  };
@@ -5,7 +5,7 @@ import {
5
5
  TouchableOpacity,
6
6
  TouchableOpacityProps,
7
7
  } from 'react-native';
8
- import {ApplicationContext} from '../Application';
8
+ import {ApplicationContext, ComponentContext} from '../Application';
9
9
  import {Colors} from '../Consts';
10
10
  import {Icon} from '../Icon';
11
11
  import styles from './styles';
@@ -26,13 +26,17 @@ export interface IconButtonProps extends TouchableOpacityProps {
26
26
  * Optional. Defines the size of the IconButton.
27
27
  */
28
28
  size?: 'large' | 'small';
29
+
30
+ params?: any;
29
31
  }
30
32
 
31
33
  const IconButton: React.FC<IconButtonProps> = ({
32
- type,
34
+ type = 'primary',
33
35
  icon,
34
36
  size,
35
37
  onPress,
38
+ params,
39
+ accessibilityLabel,
36
40
  ...rest
37
41
  }) => {
38
42
  const {theme} = useContext(ApplicationContext);
@@ -121,20 +125,25 @@ const IconButton: React.FC<IconButtonProps> = ({
121
125
  const iconSize = size === 'small' ? 16 : 24;
122
126
 
123
127
  return (
124
- <TouchableOpacity
125
- {...rest}
126
- accessibilityLabel={`IconButton/${icon}`}
127
- activeOpacity={activeOpacity}
128
- onPress={onPressButton}
129
- style={buttonStyle}>
130
- <Icon size={iconSize} source={icon} color={getIconColor()} />
131
- </TouchableOpacity>
128
+ <ComponentContext.Provider
129
+ value={{
130
+ componentName: 'IconButton',
131
+ params,
132
+ state: type === 'disabled' ? 'disabled' : 'enabled',
133
+ componentId: accessibilityLabel,
134
+ componentValue: icon,
135
+ action: 'click',
136
+ }}>
137
+ <TouchableOpacity
138
+ {...rest}
139
+ accessibilityLabel={accessibilityLabel}
140
+ activeOpacity={activeOpacity}
141
+ onPress={onPressButton}
142
+ style={buttonStyle}>
143
+ <Icon size={iconSize} source={icon} color={getIconColor()} />
144
+ </TouchableOpacity>
145
+ </ComponentContext.Provider>
132
146
  );
133
147
  };
134
148
 
135
- IconButton.defaultProps = {
136
- type: 'primary',
137
- disabled: false,
138
- };
139
-
140
149
  export {IconButton};
package/Image/index.tsx CHANGED
@@ -1,92 +1,98 @@
1
- import React, {useContext, useRef, useState} from 'react';
2
- import {StyleProp, StyleSheet, View, ViewStyle} from 'react-native';
3
- import FastImage from 'react-native-fast-image';
1
+ import React, {useContext, useEffect, useRef, useState} from 'react';
2
+ import {StyleSheet, View} from 'react-native';
3
+ import FastImage, {Source} from 'react-native-fast-image';
4
4
  import styles from './styles';
5
- import {ApplicationContext} from '../Application';
5
+ import {
6
+ ApplicationContext,
7
+ ComponentContext,
8
+ MiniAppContext,
9
+ } from '../Application';
6
10
  import {Skeleton} from '../Skeleton';
7
11
  import {Icon} from '../Icon';
8
12
  import {Styles} from '../Consts';
9
- import {FastImagePropsWithoutStyle} from './types';
10
-
11
- export interface ImageProps extends FastImagePropsWithoutStyle {
12
- style?: StyleProp<ViewStyle>;
13
- loading?: boolean;
14
- accessibilityLabel?: string;
15
- }
13
+ import {ImageProps} from './types';
16
14
 
17
15
  type Status = 'success' | 'loading' | 'error';
18
16
 
19
17
  const Image: React.FC<ImageProps> = ({
20
18
  style,
21
19
  source,
20
+ loading = true,
21
+ children,
22
+ params,
22
23
  accessibilityLabel,
23
24
  ...rest
24
25
  }) => {
25
26
  const {theme} = useContext(ApplicationContext);
27
+ const app = useContext<any>(MiniAppContext);
28
+ const component = useContext<any>(ComponentContext);
26
29
  const error = useRef(false);
27
- const [status, setStatus] = useState<Status>(
28
- rest.loading ? 'loading' : 'success',
29
- );
30
+ const [status, setStatus] = useState<Status>('success');
31
+
32
+ const test: any = {
33
+ accessibilityLabel: accessibilityLabel || `img|${(source as Source).uri}`,
34
+ };
35
+
36
+ useEffect(() => {
37
+ if (app.enableAutoId) {
38
+ component?.addChildren?.(test.accessibilityLabel, 'add');
39
+ return () => component?.addChildren?.(test.accessibilityLabel, 'remove');
40
+ }
41
+ }, []);
30
42
 
31
43
  /**
32
44
  * render content loading | fail | rendered
33
45
  */
34
46
  const renderContent = () => {
35
- if (status == 'loading' || status == 'error') {
36
- let content = (
37
- <Skeleton style={[StyleSheet.absoluteFill, styles.image]} />
38
- );
39
- if (status == 'error') {
47
+ if (status === 'loading' || status === 'error') {
48
+ let content = <Skeleton />;
49
+ if (status === 'error') {
40
50
  content = (
41
- <View style={Styles.flexCenter}>
42
- <Icon source="media_fail" color={theme.colors.text.disable} />
43
- </View>
51
+ <Icon source="media_fail" color={theme.colors.text.disable} />
44
52
  );
45
53
  }
46
54
  return (
47
- <View
48
- style={[
49
- StyleSheet.absoluteFill,
50
- styles.image,
51
- {backgroundColor: theme.colors.background.disable},
52
- ]}>
55
+ <View style={[StyleSheet.absoluteFill, Styles.flexCenter]}>
53
56
  {content}
54
57
  </View>
55
58
  );
56
59
  }
60
+ return children;
57
61
  };
58
62
 
59
63
  return (
60
- <View
64
+ <FastImage
65
+ {...rest}
66
+ {...test}
67
+ source={source}
61
68
  style={[styles.container, style]}
62
- accessibilityLabel={`Image/${
63
- accessibilityLabel ?? (typeof source === 'number' ? source : source.uri)
64
- }`}>
65
- <FastImage
66
- {...rest}
67
- source={source}
68
- style={styles.image}
69
- onLoadStart={() => {
70
- error.current = false;
71
- }}
72
- onLoadEnd={() => {
73
- if (error.current) {
74
- setStatus('error');
75
- } else {
76
- setStatus('success');
77
- }
78
- }}
79
- onError={() => {
80
- error.current = true;
81
- }}
82
- />
69
+ onProgress={() => {
70
+ error.current = false;
71
+ if (status !== 'loading' && loading) {
72
+ setStatus('loading');
73
+ }
74
+ }}
75
+ onLoadStart={() => {
76
+ error.current = false;
77
+ }}
78
+ onLoad={() => {
79
+ error.current = false;
80
+ }}
81
+ onLoadEnd={() => {
82
+ let current: Status = 'success';
83
+ if (error.current) {
84
+ current = 'error';
85
+ }
86
+ if (status !== current) {
87
+ setStatus(current);
88
+ }
89
+ }}
90
+ onError={() => {
91
+ error.current = true;
92
+ }}>
83
93
  {renderContent()}
84
- </View>
94
+ </FastImage>
85
95
  );
86
96
  };
87
97
 
88
- Image.defaultProps = {
89
- loading: true,
90
- };
91
-
92
98
  export {Image};
package/Image/styles.ts CHANGED
@@ -1,13 +1,5 @@
1
1
  import {StyleSheet} from 'react-native';
2
2
 
3
3
  export default StyleSheet.create({
4
- container: {
5
- overflow: 'hidden',
6
- alignItems: 'center',
7
- justifyContent: 'center',
8
- },
9
- image: {
10
- width: '100%',
11
- height: '100%',
12
- },
4
+ container: {},
13
5
  });
package/Image/types.ts CHANGED
@@ -1,3 +1,7 @@
1
1
  import {FastImageProps} from 'react-native-fast-image';
2
2
 
3
- export type FastImagePropsWithoutStyle = Omit<FastImageProps, 'style'>;
3
+ export interface ImageProps extends FastImageProps {
4
+ loading?: boolean;
5
+ accessibilityLabel?: string;
6
+ params?: any;
7
+ }
package/Input/Input.tsx CHANGED
@@ -1,18 +1,25 @@
1
- import React, {forwardRef, useContext, useRef, useState} from 'react';
1
+ import React, {
2
+ forwardRef,
3
+ useContext,
4
+ useImperativeHandle,
5
+ useRef,
6
+ useState,
7
+ } from 'react';
2
8
  import {
3
9
  NativeSyntheticEvent,
10
+ Platform,
4
11
  TextInput,
5
12
  TextInputFocusEventData,
6
13
  TouchableOpacity,
7
14
  View,
8
15
  } from 'react-native';
9
- import {ApplicationContext} from '../Application';
10
- import styles from './styles';
16
+ import {ApplicationContext, ComponentContext} from '../Application';
17
+ import {Icon} from '../Icon';
18
+ import {Loader} from '../Loader';
11
19
  import {ErrorView, FloatingView, getBorderColor, getSizeStyle} from './common';
12
20
  import {InputProps} from './index';
13
- import {Icon} from '../Icon';
21
+ import styles from './styles';
14
22
  import {checkTyping} from './utils';
15
- import {Loader} from '../Loader';
16
23
 
17
24
  const Input = forwardRef(
18
25
  (
@@ -21,21 +28,29 @@ const Input = forwardRef(
21
28
  onChangeText,
22
29
  floatingValue,
23
30
  floatingIcon,
24
- size,
31
+ size = 'small',
25
32
  placeholder,
26
33
  onBlur,
27
34
  onFocus,
28
35
  errorMessage,
29
36
  icon,
30
- disabled,
37
+ disabled = false,
31
38
  floatingIconColor,
32
39
  iconColor,
33
- required,
40
+ required = false,
34
41
  errorSpacing,
35
- loading,
42
+ loading = false,
36
43
  leadingIcon,
37
44
  leadingIconColor,
45
+ fontWeight = 'Regular',
46
+ onPressIcon,
47
+ secureTextEntry,
48
+ keyboardType,
38
49
  style,
50
+ params,
51
+ hintText,
52
+ accessibilityLabel,
53
+ editable = true,
39
54
  ...props
40
55
  }: InputProps,
41
56
  ref,
@@ -43,8 +58,8 @@ const Input = forwardRef(
43
58
  const {theme} = useContext(ApplicationContext);
44
59
  const [focused, setFocused] = useState(false);
45
60
  const [haveValue, setHaveValue] = useState(!!value || !!props.defaultValue);
46
- const inputRef = (ref as React.RefObject<TextInput>) ?? useRef<TextInput>();
47
- const accessibilityLabel = `Input/${floatingValue ?? placeholder}`;
61
+ const [secureTextInput, setSecureTextInput] = useState(secureTextEntry);
62
+ const inputRef = useRef<TextInput | null>(null);
48
63
 
49
64
  const onClearText = () => {
50
65
  inputRef?.current?.clear();
@@ -66,17 +81,49 @@ const Input = forwardRef(
66
81
  onBlur?.(e);
67
82
  };
68
83
 
84
+ useImperativeHandle(ref, () => {
85
+ return {
86
+ clear: onClearText,
87
+ focus: () => inputRef.current?.focus(),
88
+ blur: () => inputRef.current?.blur(),
89
+ setText: (text: string) => _onChangeText(text),
90
+ };
91
+ });
92
+
69
93
  const renderIcon = (color: string | undefined) => {
70
94
  if (loading) {
71
- return <Loader type={'spinner'} color={color} />;
95
+ return <Loader type={'spinner'} color={color} style={styles.icon} />;
96
+ }
97
+ if (secureTextEntry) {
98
+ return (
99
+ <TouchableOpacity
100
+ onPress={() => setSecureTextInput(!secureTextInput)}
101
+ style={styles.icon}>
102
+ <Icon
103
+ color={color}
104
+ size={24}
105
+ source={
106
+ secureTextInput ? '24_security_eye_off' : '24_security_eye_open'
107
+ }
108
+ />
109
+ </TouchableOpacity>
110
+ );
72
111
  }
73
112
  if (icon) {
74
- return <Icon color={color} source={icon} size={24} />;
113
+ return (
114
+ <TouchableOpacity
115
+ onPress={onPressIcon}
116
+ disabled={!onPressIcon}
117
+ style={styles.icon}>
118
+ <Icon color={color} source={icon} size={24} />
119
+ </TouchableOpacity>
120
+ );
75
121
  }
76
122
  };
77
123
 
78
124
  const renderInputView = () => {
79
125
  const disabledColor = theme.colors.text.disable;
126
+ const secure = secureTextInput && secureTextEntry;
80
127
  let textColor = theme.colors.text.default;
81
128
  let placeholderColor = theme.colors.text.hint;
82
129
  let iconTintColor = iconColor;
@@ -87,6 +134,13 @@ const Input = forwardRef(
87
134
  iconTintColor = disabledColor;
88
135
  }
89
136
 
137
+ if (secureTextEntry) {
138
+ keyboardType = Platform.select({
139
+ ios: 'ascii-capable',
140
+ android: 'visible-password',
141
+ });
142
+ }
143
+
90
144
  return (
91
145
  <View
92
146
  style={[
@@ -115,15 +169,17 @@ const Input = forwardRef(
115
169
  <TextInput
116
170
  {...props}
117
171
  accessibilityLabel={accessibilityLabel}
118
- editable={!disabled}
172
+ editable={editable && !disabled}
173
+ secureTextEntry={secure}
119
174
  textAlignVertical="center"
120
175
  ref={inputRef}
121
176
  style={[
122
177
  styles.input,
123
178
  {
124
179
  color: textColor,
125
- fontFamily: `${theme.font}-Regular`,
180
+ fontFamily: `${theme.font}-${fontWeight}`,
126
181
  },
182
+ secure && haveValue && {fontSize: size === 'small' ? 18 : 22},
127
183
  ]}
128
184
  textBreakStrategy="highQuality"
129
185
  value={value}
@@ -133,6 +189,7 @@ const Input = forwardRef(
133
189
  placeholder={placeholder}
134
190
  selectionColor={theme.colors.primary}
135
191
  placeholderTextColor={placeholderColor}
192
+ keyboardType={keyboardType}
136
193
  />
137
194
  </View>
138
195
  <View style={styles.iconView}>
@@ -153,19 +210,39 @@ const Input = forwardRef(
153
210
  );
154
211
  };
155
212
 
213
+ let inputState = 'active';
214
+
215
+ if (value && value?.length > 0) {
216
+ inputState = 'filled';
217
+ }
218
+ if (errorMessage && errorMessage?.length > 0) {
219
+ inputState = 'error';
220
+ }
221
+
222
+ if (disabled) {
223
+ inputState = 'disabled';
224
+ }
225
+
156
226
  return (
157
- <View
158
- style={[style, styles.wrapper]}
159
- accessibilityLabel={accessibilityLabel}>
160
- {renderInputView()}
161
- <ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
162
- </View>
227
+ <ComponentContext.Provider
228
+ value={{
229
+ componentName: 'Input',
230
+ params,
231
+ componentLabel: floatingValue,
232
+ state: inputState,
233
+ componentId: accessibilityLabel,
234
+ }}>
235
+ <View style={[style, styles.wrapper]}>
236
+ {renderInputView()}
237
+ <ErrorView
238
+ errorMessage={errorMessage}
239
+ errorSpacing={errorSpacing}
240
+ hintText={hintText}
241
+ />
242
+ </View>
243
+ </ComponentContext.Provider>
163
244
  );
164
245
  },
165
246
  );
166
247
 
167
- Input.defaultProps = {
168
- size: 'small',
169
- };
170
-
171
248
  export default Input;
@@ -1,36 +1,38 @@
1
1
  import React, {useContext} from 'react';
2
2
  import {TextInput, TouchableOpacity, View} from 'react-native';
3
- import {ApplicationContext} from '../Application';
4
- import styles from './styles';
5
- import {ErrorView, FloatingView, getBorderColor, getSizeStyle} from './common';
6
- import {InputDropDownProps} from './index';
3
+ import {ApplicationContext, ComponentContext} from '../Application';
4
+ import {Styles} from '../Consts';
7
5
  import {Icon} from '../Icon';
8
6
  import {Loader} from '../Loader';
9
- import {Styles} from '../Consts';
7
+ import {ErrorView, FloatingView, getBorderColor, getSizeStyle} from './common';
8
+ import {InputDropDownProps} from './index';
9
+ import styles from './styles';
10
10
 
11
11
  const InputDropDown = ({
12
12
  value,
13
13
  floatingValue,
14
14
  floatingIcon,
15
- size,
15
+ size = 'small',
16
16
  onPress,
17
17
  placeholder,
18
18
  errorMessage,
19
19
  icon = 'arrow_chevron_down_small',
20
- disabled,
20
+ disabled = false,
21
21
  floatingIconColor,
22
22
  iconColor,
23
- required,
23
+ required = false,
24
24
  errorSpacing,
25
- loading,
25
+ loading = false,
26
26
  leadingIcon,
27
27
  leadingIconColor,
28
28
  style,
29
+ params,
30
+ accessibilityLabel,
31
+ hintText,
29
32
  ...props
30
33
  }: InputDropDownProps) => {
31
34
  const {theme} = useContext(ApplicationContext);
32
35
  const full = !!value || !!placeholder;
33
- const accessibilityLabel = `InputDropDown/${floatingValue ?? placeholder}`;
34
36
 
35
37
  const renderIcon = (color: string | undefined) => {
36
38
  if (loading) {
@@ -81,10 +83,9 @@ const InputDropDown = ({
81
83
  {full && (
82
84
  <TextInput
83
85
  {...props}
84
- onPressIn={onPress}
85
86
  accessibilityLabel={accessibilityLabel}
87
+ onPressIn={onPress}
86
88
  editable={false}
87
- textAlignVertical="top"
88
89
  style={[
89
90
  styles.input,
90
91
  {
@@ -106,18 +107,26 @@ const InputDropDown = ({
106
107
  };
107
108
 
108
109
  return (
109
- <TouchableOpacity
110
- onPress={onPress}
111
- style={[style, full && styles.wrapper]}
112
- accessibilityLabel={accessibilityLabel}>
113
- {renderInputView()}
114
- <ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
115
- </TouchableOpacity>
110
+ <ComponentContext.Provider
111
+ value={{
112
+ componentName: 'InputDropDown',
113
+ params,
114
+ state: 'enabled',
115
+ componentLabel: floatingValue,
116
+ componentId: accessibilityLabel,
117
+ }}>
118
+ <TouchableOpacity
119
+ onPress={onPress}
120
+ style={[style, full && styles.wrapper]}>
121
+ {renderInputView()}
122
+ <ErrorView
123
+ errorMessage={errorMessage}
124
+ errorSpacing={errorSpacing}
125
+ hintText={hintText}
126
+ />
127
+ </TouchableOpacity>
128
+ </ComponentContext.Provider>
116
129
  );
117
130
  };
118
131
 
119
- InputDropDown.defaultProps = {
120
- size: 'small',
121
- };
122
-
123
132
  export default InputDropDown;