@momo-kits/foundation 0.81.1-beta.5 → 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
@@ -1,4 +1,10 @@
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,
4
10
  TextInput,
@@ -6,11 +12,11 @@ import {
6
12
  TouchableOpacity,
7
13
  View,
8
14
  } from 'react-native';
9
- import {ApplicationContext} from '../Application';
10
- import styles from './styles';
15
+ import {ApplicationContext, ComponentContext} from '../Application';
16
+ import {Icon} from '../Icon';
11
17
  import {ErrorView, FloatingView, getBorderColor, getSizeStyle} from './common';
12
18
  import {InputMoneyProps} from './index';
13
- import {Icon} from '../Icon';
19
+ import styles from './styles';
14
20
  import {formatMoneyToNumber, formatNumberToMoney} from './utils';
15
21
 
16
22
  const InputMoney = forwardRef(
@@ -24,36 +30,56 @@ const InputMoney = forwardRef(
24
30
  onFocus,
25
31
  errorMessage,
26
32
  icon,
27
- disabled,
33
+ disabled = false,
28
34
  floatingIconColor,
29
35
  iconColor,
30
- required,
36
+ required = false,
31
37
  errorSpacing,
32
38
  style,
39
+ params,
40
+ defaultValue = '',
41
+ accessibilityLabel,
42
+ hintText,
33
43
  ...props
34
44
  }: InputMoneyProps,
35
45
  ref,
36
46
  ) => {
37
47
  const {theme} = useContext(ApplicationContext);
38
48
  const [focused, setFocused] = useState(false);
39
- const inputRef = (ref as React.RefObject<TextInput>) ?? useRef<TextInput>();
40
- const [value, setValue] = useState('');
41
- const accessibilityLabel = `InputMoney/${floatingValue}`;
49
+ const inputRef = useRef<TextInput>(null);
50
+
51
+ const validateText = (text: string) => {
52
+ const valueFormat = formatMoneyToNumber(text, 'đ');
53
+ return formatNumberToMoney(valueFormat, 'đ');
54
+ };
55
+
56
+ const [value, setValue] = useState(
57
+ defaultValue ? validateText(defaultValue) : '',
58
+ );
42
59
 
43
60
  const onClearText = () => {
44
61
  inputRef?.current?.clear();
45
62
  setValue('');
46
63
  onChangeText?.('');
47
64
  };
65
+
48
66
  const _onChangeText = (text: string) => {
49
67
  if (text.length < value.length && value.indexOf(text) === 0) {
50
68
  text = value.slice(0, -2) + 'đ';
51
69
  }
52
- const valueFormat = formatMoneyToNumber(text, 'đ');
53
- setValue(formatNumberToMoney(valueFormat, 'đ'));
70
+ setValue(validateText(text));
54
71
  onChangeText?.(formatMoneyToNumber(text, 'đ').toString());
55
72
  };
56
73
 
74
+ useImperativeHandle(ref, () => {
75
+ return {
76
+ clear: onClearText,
77
+ focus: () => inputRef.current?.focus(),
78
+ blur: () => inputRef.current?.blur(),
79
+ setText: _onChangeText,
80
+ };
81
+ });
82
+
57
83
  const _onFocus = (e: NativeSyntheticEvent<TextInputFocusEventData>) => {
58
84
  setFocused(true);
59
85
  onFocus?.(e);
@@ -96,7 +122,6 @@ const InputMoney = forwardRef(
96
122
  {...props}
97
123
  accessibilityLabel={accessibilityLabel}
98
124
  editable={!disabled}
99
- textAlignVertical="top"
100
125
  ref={inputRef}
101
126
  keyboardType={'number-pad'}
102
127
  style={[
@@ -132,13 +157,37 @@ const InputMoney = forwardRef(
132
157
  );
133
158
  };
134
159
 
160
+ let inputState = 'active';
161
+
162
+ if (value && value?.length > 0) {
163
+ inputState = 'filled';
164
+ }
165
+ if (errorMessage && errorMessage?.length > 0) {
166
+ inputState = 'error';
167
+ }
168
+
169
+ if (disabled) {
170
+ inputState = 'disabled';
171
+ }
172
+
135
173
  return (
136
- <View
137
- style={[style, styles.wrapper]}
138
- accessibilityLabel={accessibilityLabel}>
139
- {renderInputView()}
140
- <ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
141
- </View>
174
+ <ComponentContext.Provider
175
+ value={{
176
+ componentName: 'InputMoney',
177
+ params,
178
+ componentLabel: floatingValue,
179
+ state: inputState,
180
+ componentId: accessibilityLabel,
181
+ }}>
182
+ <View style={[style, styles.wrapper]}>
183
+ {renderInputView()}
184
+ <ErrorView
185
+ errorMessage={errorMessage}
186
+ errorSpacing={errorSpacing}
187
+ hintText={hintText}
188
+ />
189
+ </View>
190
+ </ComponentContext.Provider>
142
191
  );
143
192
  },
144
193
  );
@@ -1,4 +1,12 @@
1
- import React, {FC, useContext, useEffect, useRef, useState} from 'react';
1
+ import React, {
2
+ FC,
3
+ forwardRef,
4
+ useContext,
5
+ useEffect,
6
+ useImperativeHandle,
7
+ useRef,
8
+ useState,
9
+ } from 'react';
2
10
  import {
3
11
  Animated,
4
12
  NativeSyntheticEvent,
@@ -7,12 +15,12 @@ import {
7
15
  TouchableOpacity,
8
16
  View,
9
17
  } from 'react-native';
10
- import {CaretProps, InputOTPProps} from './index';
18
+ import {ApplicationContext, ComponentContext} from '../Application';
19
+ import {Spacing} from '../Consts';
11
20
  import {scaleSize, Text} from '../Text';
12
- import styles from './styles';
13
21
  import {ErrorView, getBorderColor} from './common';
14
- import {ApplicationContext} from '../Application';
15
- import {Spacing} from '../Consts';
22
+ import {CaretProps, InputOTPProps} from './index';
23
+ import styles from './styles';
16
24
 
17
25
  const OTPCaret: FC<CaretProps> = ({index, length}) => {
18
26
  const DURATION = 300;
@@ -49,163 +57,201 @@ const OTPCaret: FC<CaretProps> = ({index, length}) => {
49
57
  opacity,
50
58
  }}
51
59
  />
52
- <Text color={theme.colors.text.hint} typography={'paragraph_default'}>
60
+ <Text color={theme.colors.text.hint} typography={'body_default_regular'}>
53
61
  -
54
62
  </Text>
55
63
  </View>
56
64
  );
57
65
  };
58
66
 
59
- const InputOTP: FC<InputOTPProps> = ({
60
- length,
61
- errorMessage,
62
- errorSpacing,
63
- floatingValue,
64
- floatingIconColor,
65
- floatingIcon,
66
- placeholder,
67
- onChangeText,
68
- onFocus,
69
- onBlur,
70
- dataType = 'number',
71
- style,
72
- ...props
73
- }) => {
74
- const MAX_LENGTH = 10;
75
- const [value, setValue] = useState('');
76
- const [focused, setFocused] = useState(false);
77
- const inputRef = useRef<TextInput>(null);
78
- const {theme} = useContext(ApplicationContext);
79
- const accessibilityLabel = `InputOTP/${floatingValue ?? placeholder}`;
80
-
81
- const onFocusInput = () => {
82
- setFocused(true);
83
- inputRef.current?.focus();
84
- };
85
-
86
- const onBlurInput = (e: NativeSyntheticEvent<TextInputFocusEventData>) => {
87
- setFocused(false);
88
- onBlur?.(e);
89
- };
90
-
91
- const _onChangeText = (text: string) => {
92
- if (text.length > MAX_LENGTH) return;
93
- if (dataType === 'number' && isNaN(Number(text))) return;
94
- if (
95
- !isNaN(Number(text)) &&
96
- value.length >= Number(length) &&
97
- text.length >= value.length
98
- )
99
- return;
100
-
101
- setValue(text);
102
- onChangeText?.(text);
103
- };
104
-
105
- const renderInputs = (length: number) => {
106
- const TextInputs: React.ReactNode[] = [];
107
- for (let i = 0; i < length; i++) {
108
- TextInputs.push(
109
- <View>
110
- {focused && value.length === i ? (
111
- <OTPCaret index={i} length={length} />
112
- ) : (
113
- <Text
114
- style={i !== length - 1 && {marginRight: Spacing.L}}
115
- color={
116
- !!value[i] ? theme.colors.text.default : theme.colors.text.hint
117
- }
118
- typography={!!value[i] ? 'title_s' : 'paragraph_default'}>
119
- {value[i] || '-'}
120
- </Text>
121
- )}
122
- </View>,
123
- );
124
- }
125
- return TextInputs;
126
- };
67
+ const InputOTP = forwardRef(
68
+ (
69
+ {
70
+ length,
71
+ errorMessage,
72
+ errorSpacing,
73
+ floatingValue = 'Label',
74
+ floatingIconColor,
75
+ floatingIcon,
76
+ placeholder,
77
+ onChangeText,
78
+ onFocus,
79
+ onBlur,
80
+ dataType = 'number',
81
+ params,
82
+ style,
83
+ accessibilityLabel,
84
+ hintText,
85
+ ...props
86
+ }: InputOTPProps,
87
+ ref,
88
+ ) => {
89
+ const MAX_LENGTH = 10;
90
+ const [value, setValue] = useState('');
91
+ const [focused, setFocused] = useState(false);
92
+ const inputRef = useRef<TextInput | null>(null);
93
+ const {theme} = useContext(ApplicationContext);
127
94
 
128
- const renderUnidentifiedInputs = () => {
129
- const splitValue = value.split('');
95
+ useImperativeHandle(ref, () => ({
96
+ onChangeText: (text: string) => {
97
+ _onChangeText(text);
98
+ },
99
+ focus: () => inputRef.current?.focus(),
100
+ blur: () => inputRef.current?.blur(),
101
+ setText: (text: string) => _onChangeText(text),
102
+ }));
130
103
 
131
- if (!focused && value.length === 0 && !!placeholder) {
132
- return (
133
- <Text color={theme.colors.text.hint} typography={'description_s'}>
134
- {placeholder}
135
- </Text>
136
- );
137
- }
104
+ const onFocusInput = () => {
105
+ setFocused(true);
106
+ inputRef.current?.focus();
107
+ };
138
108
 
139
- return (
140
- <View style={{flexDirection: 'row'}}>
141
- {splitValue.map((letter, index) => {
142
- return (
143
- <Text
144
- style={
145
- (index !== value.length - 1 ||
146
- (focused && value.length !== MAX_LENGTH)) && {
147
- marginRight: Spacing.L,
109
+ const onBlurInput = (e: NativeSyntheticEvent<TextInputFocusEventData>) => {
110
+ setFocused(false);
111
+ onBlur?.(e);
112
+ };
113
+
114
+ const _onChangeText = (text: string) => {
115
+ if (text.length > MAX_LENGTH) return;
116
+ if (dataType === 'number' && isNaN(Number(text))) return;
117
+ if (
118
+ !isNaN(Number(text)) &&
119
+ value.length >= Number(length) &&
120
+ text.length >= value.length
121
+ )
122
+ return;
123
+
124
+ setValue(text);
125
+ onChangeText?.(text);
126
+ };
127
+
128
+ const renderInputs = (length: number) => {
129
+ const TextInputs: React.ReactNode[] = [];
130
+ for (let i = 0; i < length; i++) {
131
+ TextInputs.push(
132
+ <View>
133
+ {focused && value.length === i ? (
134
+ <OTPCaret index={i} length={length} />
135
+ ) : (
136
+ <Text
137
+ style={i !== length - 1 && {marginRight: Spacing.L}}
138
+ color={
139
+ !!value[i]
140
+ ? theme.colors.text.default
141
+ : theme.colors.text.hint
148
142
  }
149
- }
150
- typography={'title_s'}>
151
- {letter}
152
- </Text>
153
- );
154
- })}
155
- {focused && value.length !== MAX_LENGTH && <OTPCaret />}
156
- </View>
157
- );
158
- };
143
+ typography={
144
+ !!value[i] ? 'header_m_bold' : 'body_default_regular'
145
+ }>
146
+ {value[i] || '-'}
147
+ </Text>
148
+ )}
149
+ </View>,
150
+ );
151
+ }
152
+ return TextInputs;
153
+ };
159
154
 
160
- const renderInputView = () => {
161
- return (
162
- <View
163
- style={[
164
- styles.otpInput,
165
- {backgroundColor: theme.colors.background.surface},
166
- getBorderColor(theme, focused, errorMessage),
167
- ]}>
168
- {!!floatingValue && (
169
- <View
170
- style={[
171
- styles.otpFloatingView,
172
- {backgroundColor: theme.colors.background.surface},
173
- ]}>
174
- <Text typography={'description_s'}>{floatingValue}</Text>
155
+ const renderUnidentifiedInputs = () => {
156
+ const splitValue = value.split('');
157
+
158
+ if (!focused && value.length === 0 && !!placeholder) {
159
+ return (
160
+ <Text
161
+ color={theme.colors.text.hint}
162
+ typography={'description_default_regular'}>
163
+ {placeholder}
164
+ </Text>
165
+ );
166
+ }
167
+
168
+ return (
169
+ <View style={{flexDirection: 'row'}}>
170
+ {splitValue.map((letter, index) => {
171
+ return (
172
+ <Text
173
+ style={
174
+ (index !== value.length - 1 ||
175
+ (focused && value.length !== MAX_LENGTH)) && {
176
+ marginRight: Spacing.L,
177
+ }
178
+ }
179
+ typography={'header_m_bold'}>
180
+ {letter}
181
+ </Text>
182
+ );
183
+ })}
184
+ {focused && value.length !== MAX_LENGTH && <OTPCaret />}
185
+ </View>
186
+ );
187
+ };
188
+
189
+ const renderInputView = () => {
190
+ return (
191
+ <View
192
+ style={[
193
+ styles.otpInput,
194
+ {backgroundColor: theme.colors.background.surface},
195
+ getBorderColor(theme, focused, errorMessage),
196
+ ]}>
197
+ {!!floatingValue && (
198
+ <View
199
+ style={[
200
+ styles.otpFloatingView,
201
+ {backgroundColor: theme.colors.background.surface},
202
+ ]}>
203
+ <Text
204
+ typography={'description_default_regular'}
205
+ color={theme.colors.text.hint}>
206
+ {floatingValue}
207
+ </Text>
208
+ </View>
209
+ )}
210
+ <View style={styles.otpInputsView}>
211
+ {length ? renderInputs(length) : renderUnidentifiedInputs()}
212
+ </View>
213
+ <View style={styles.inputView}>
214
+ <TextInput
215
+ {...props}
216
+ accessibilityLabel={accessibilityLabel}
217
+ ref={inputRef}
218
+ value={value}
219
+ onChangeText={_onChangeText}
220
+ keyboardType={dataType === 'number' ? 'number-pad' : 'default'}
221
+ onFocus={onFocusInput}
222
+ onBlur={onBlurInput}
223
+ style={{opacity: 0}}
224
+ selectionColor={theme.colors.primary}
225
+ placeholderTextColor={theme.colors.text.hint}
226
+ />
175
227
  </View>
176
- )}
177
- <View style={styles.otpInputsView}>
178
- {length ? renderInputs(length) : renderUnidentifiedInputs()}
179
228
  </View>
180
- <View style={styles.inputView}>
181
- <TextInput
182
- {...props}
183
- accessibilityLabel={accessibilityLabel}
184
- ref={inputRef}
185
- value={value}
186
- onChangeText={_onChangeText}
187
- keyboardType={dataType === 'number' ? 'number-pad' : 'default'}
188
- onFocus={onFocusInput}
189
- onBlur={onBlurInput}
190
- style={{opacity: 0}}
191
- selectionColor={theme.colors.primary}
192
- placeholderTextColor={theme.colors.text.hint}
229
+ );
230
+ };
231
+
232
+ return (
233
+ <ComponentContext.Provider
234
+ value={{
235
+ componentName: 'InputOTP',
236
+ params,
237
+ componentLabel: floatingValue,
238
+ state: 'enabled',
239
+ componentId: accessibilityLabel,
240
+ }}>
241
+ <TouchableOpacity
242
+ activeOpacity={1}
243
+ onPress={onFocusInput}
244
+ style={[style, styles.otpWrapper]}>
245
+ {renderInputView()}
246
+ <ErrorView
247
+ errorMessage={errorMessage}
248
+ errorSpacing={errorSpacing}
249
+ hintText={hintText}
193
250
  />
194
- </View>
195
- </View>
251
+ </TouchableOpacity>
252
+ </ComponentContext.Provider>
196
253
  );
197
- };
198
-
199
- return (
200
- <TouchableOpacity
201
- activeOpacity={1}
202
- onPress={onFocusInput}
203
- style={[style, styles.otpWrapper]}
204
- accessibilityLabel={accessibilityLabel}>
205
- {renderInputView()}
206
- <ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
207
- </TouchableOpacity>
208
- );
209
- };
254
+ },
255
+ );
210
256
 
211
257
  export default InputOTP;
@@ -1,4 +1,10 @@
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,
4
10
  TextInput,
@@ -6,11 +12,11 @@ import {
6
12
  TouchableOpacity,
7
13
  View,
8
14
  } from 'react-native';
9
- import {InputSearchProps} from './index';
10
- import {ApplicationContext} from '../Application';
11
- import styles from './styles';
15
+ import {ApplicationContext, ComponentContext} from '../Application';
12
16
  import {Icon} from '../Icon';
13
17
  import {Text} from '../Text';
18
+ import {InputSearchProps} from './index';
19
+ import styles from './styles';
14
20
  import {checkTyping} from './utils';
15
21
 
16
22
  const InputSearch = forwardRef(
@@ -25,10 +31,12 @@ const InputSearch = forwardRef(
25
31
  icon,
26
32
  buttonText = 'Hủy',
27
33
  showButtonText = true,
28
- showBorder = true,
29
34
  style,
30
35
  defaultValue,
31
36
  onPressButtonText,
37
+ params,
38
+ hasColorBG = false,
39
+ accessibilityLabel,
32
40
  ...props
33
41
  }: InputSearchProps,
34
42
  ref,
@@ -36,8 +44,7 @@ const InputSearch = forwardRef(
36
44
  const {theme} = useContext(ApplicationContext);
37
45
  const [focused, setFocused] = useState(false);
38
46
  const [haveValue, setHaveValue] = useState(!!value || !!defaultValue);
39
- const inputRef = (ref as React.RefObject<TextInput>) ?? useRef<TextInput>();
40
- const accessibilityLabel = `InputMoney/${placeholder}`;
47
+ const inputRef = useRef<TextInput | null>(null);
41
48
 
42
49
  const _onFocus = (e: NativeSyntheticEvent<TextInputFocusEventData>) => {
43
50
  setFocused(true);
@@ -59,12 +66,21 @@ const InputSearch = forwardRef(
59
66
  onChangeText?.(text);
60
67
  };
61
68
 
69
+ useImperativeHandle(ref, () => {
70
+ return {
71
+ clear: onClearText,
72
+ focus: () => inputRef.current?.focus(),
73
+ blur: () => inputRef.current?.blur(),
74
+ setText: (text: string) => _onChangeText(text),
75
+ };
76
+ });
77
+
62
78
  const renderInputView = () => {
63
79
  return (
64
80
  <TextInput
65
81
  {...props}
66
82
  accessibilityLabel={accessibilityLabel}
67
- textAlignVertical="top"
83
+ textAlignVertical="center"
68
84
  ref={inputRef}
69
85
  style={[
70
86
  styles.searchInput,
@@ -118,36 +134,56 @@ const InputSearch = forwardRef(
118
134
  </View>
119
135
  );
120
136
  };
137
+
138
+ let inputState = 'empty';
139
+
140
+ if (focused) {
141
+ inputState = 'focus';
142
+ }
143
+
144
+ if (value && value?.length > 0) {
145
+ inputState = 'filled';
146
+ }
147
+
148
+ const backgroundColor = hasColorBG
149
+ ? theme.colors.background.default
150
+ : theme.colors.background.surface;
151
+
121
152
  return (
122
- <View
123
- style={[style, styles.searchInputContainer]}
124
- accessibilityLabel={accessibilityLabel}>
125
- <View
126
- style={[
127
- styles.searchInputWrapper,
128
- {
129
- backgroundColor: theme.colors.background.surface,
130
- borderColor: theme.colors.background.surface,
131
- },
132
- showBorder && {borderColor: theme.colors.border.default},
133
- focused && {borderColor: theme.colors.primary},
134
- ]}>
135
- <Icon
136
- source={'navigation_search'}
137
- size={24}
138
- color={theme.colors.text.hint}
139
- />
140
- {renderInputView()}
141
- {renderIconView()}
153
+ <ComponentContext.Provider
154
+ value={{
155
+ componentName: 'InputSearch',
156
+ params,
157
+ state: inputState,
158
+ componentId: accessibilityLabel,
159
+ }}>
160
+ <View style={[style, styles.searchInputContainer]}>
161
+ <View
162
+ style={[
163
+ styles.searchInputWrapper,
164
+ {
165
+ backgroundColor,
166
+ },
167
+ ]}>
168
+ <Icon
169
+ source={'navigation_search'}
170
+ size={24}
171
+ color={theme.colors.text.hint}
172
+ />
173
+ {renderInputView()}
174
+ {renderIconView()}
175
+ </View>
176
+ {showButtonText && (
177
+ <TouchableOpacity onPress={onPressButtonText}>
178
+ <Text
179
+ typography={'action_default_bold'}
180
+ style={styles.textButton}>
181
+ {buttonText}
182
+ </Text>
183
+ </TouchableOpacity>
184
+ )}
142
185
  </View>
143
- {showButtonText && (
144
- <TouchableOpacity onPress={onPressButtonText}>
145
- <Text typography={'action_default'} style={styles.textButton}>
146
- {buttonText}
147
- </Text>
148
- </TouchableOpacity>
149
- )}
150
- </View>
186
+ </ComponentContext.Provider>
151
187
  );
152
188
  },
153
189
  );