@pagopa/io-app-design-system 7.0.2 → 7.1.0

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 (182) hide show
  1. package/lib/commonjs/components/alert/Alert.js +6 -5
  2. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  3. package/lib/commonjs/components/banner/Banner.js +7 -6
  4. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  5. package/lib/commonjs/components/buttons/IOButton/IOButton.js +10 -8
  6. package/lib/commonjs/components/buttons/IOButton/IOButton.js.map +1 -1
  7. package/lib/commonjs/components/layout/ContentWrapper.js +5 -4
  8. package/lib/commonjs/components/layout/ContentWrapper.js.map +1 -1
  9. package/lib/commonjs/components/otpInput/OTPInput.js +6 -4
  10. package/lib/commonjs/components/otpInput/OTPInput.js.map +1 -1
  11. package/lib/commonjs/components/searchInput/SearchInput.js +8 -6
  12. package/lib/commonjs/components/searchInput/SearchInput.js.map +1 -1
  13. package/lib/commonjs/components/tabs/TabItem.js +6 -4
  14. package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
  15. package/lib/commonjs/components/textInput/TextInputValidation.js +5 -3
  16. package/lib/commonjs/components/textInput/TextInputValidation.js.map +1 -1
  17. package/lib/commonjs/components/typography/Body.js +8 -5
  18. package/lib/commonjs/components/typography/Body.js.map +1 -1
  19. package/lib/commonjs/components/typography/BodyMonospace.js +4 -5
  20. package/lib/commonjs/components/typography/BodyMonospace.js.map +1 -1
  21. package/lib/commonjs/components/typography/BodySmall.js +8 -5
  22. package/lib/commonjs/components/typography/BodySmall.js.map +1 -1
  23. package/lib/commonjs/components/typography/ButtonText.js +4 -5
  24. package/lib/commonjs/components/typography/ButtonText.js.map +1 -1
  25. package/lib/commonjs/components/typography/Caption.js +4 -5
  26. package/lib/commonjs/components/typography/Caption.js.map +1 -1
  27. package/lib/commonjs/components/typography/H1.js +4 -5
  28. package/lib/commonjs/components/typography/H1.js.map +1 -1
  29. package/lib/commonjs/components/typography/H2.js +4 -5
  30. package/lib/commonjs/components/typography/H2.js.map +1 -1
  31. package/lib/commonjs/components/typography/H3.js +4 -5
  32. package/lib/commonjs/components/typography/H3.js.map +1 -1
  33. package/lib/commonjs/components/typography/H4.js +4 -5
  34. package/lib/commonjs/components/typography/H4.js.map +1 -1
  35. package/lib/commonjs/components/typography/H5.js +4 -5
  36. package/lib/commonjs/components/typography/H5.js.map +1 -1
  37. package/lib/commonjs/components/typography/H6.js +4 -5
  38. package/lib/commonjs/components/typography/H6.js.map +1 -1
  39. package/lib/commonjs/components/typography/Hero.js +4 -5
  40. package/lib/commonjs/components/typography/Hero.js.map +1 -1
  41. package/lib/commonjs/components/typography/IOText.js +16 -14
  42. package/lib/commonjs/components/typography/IOText.js.map +1 -1
  43. package/lib/commonjs/components/typography/LabelMini.js +8 -5
  44. package/lib/commonjs/components/typography/LabelMini.js.map +1 -1
  45. package/lib/commonjs/components/typography/markdown/MdH1.js +4 -5
  46. package/lib/commonjs/components/typography/markdown/MdH1.js.map +1 -1
  47. package/lib/commonjs/components/typography/markdown/MdH2.js +4 -5
  48. package/lib/commonjs/components/typography/markdown/MdH2.js.map +1 -1
  49. package/lib/commonjs/components/typography/markdown/MdH3.js +4 -5
  50. package/lib/commonjs/components/typography/markdown/MdH3.js.map +1 -1
  51. package/lib/commonjs/context/IOThemeContextProvider.js +3 -4
  52. package/lib/commonjs/context/IOThemeContextProvider.js.map +1 -1
  53. package/lib/module/components/alert/Alert.js +5 -5
  54. package/lib/module/components/alert/Alert.js.map +1 -1
  55. package/lib/module/components/banner/Banner.js +6 -6
  56. package/lib/module/components/banner/Banner.js.map +1 -1
  57. package/lib/module/components/buttons/IOButton/IOButton.js +10 -9
  58. package/lib/module/components/buttons/IOButton/IOButton.js.map +1 -1
  59. package/lib/module/components/layout/ContentWrapper.js +4 -4
  60. package/lib/module/components/layout/ContentWrapper.js.map +1 -1
  61. package/lib/module/components/otpInput/OTPInput.js +6 -5
  62. package/lib/module/components/otpInput/OTPInput.js.map +1 -1
  63. package/lib/module/components/searchInput/SearchInput.js +8 -7
  64. package/lib/module/components/searchInput/SearchInput.js.map +1 -1
  65. package/lib/module/components/tabs/TabItem.js +6 -5
  66. package/lib/module/components/tabs/TabItem.js.map +1 -1
  67. package/lib/module/components/textInput/TextInputValidation.js +5 -4
  68. package/lib/module/components/textInput/TextInputValidation.js.map +1 -1
  69. package/lib/module/components/typography/Body.js +7 -5
  70. package/lib/module/components/typography/Body.js.map +1 -1
  71. package/lib/module/components/typography/BodyMonospace.js +3 -5
  72. package/lib/module/components/typography/BodyMonospace.js.map +1 -1
  73. package/lib/module/components/typography/BodySmall.js +7 -5
  74. package/lib/module/components/typography/BodySmall.js.map +1 -1
  75. package/lib/module/components/typography/ButtonText.js +3 -5
  76. package/lib/module/components/typography/ButtonText.js.map +1 -1
  77. package/lib/module/components/typography/Caption.js +3 -5
  78. package/lib/module/components/typography/Caption.js.map +1 -1
  79. package/lib/module/components/typography/H1.js +3 -5
  80. package/lib/module/components/typography/H1.js.map +1 -1
  81. package/lib/module/components/typography/H2.js +3 -5
  82. package/lib/module/components/typography/H2.js.map +1 -1
  83. package/lib/module/components/typography/H3.js +3 -5
  84. package/lib/module/components/typography/H3.js.map +1 -1
  85. package/lib/module/components/typography/H4.js +3 -5
  86. package/lib/module/components/typography/H4.js.map +1 -1
  87. package/lib/module/components/typography/H5.js +3 -5
  88. package/lib/module/components/typography/H5.js.map +1 -1
  89. package/lib/module/components/typography/H6.js +3 -5
  90. package/lib/module/components/typography/H6.js.map +1 -1
  91. package/lib/module/components/typography/Hero.js +3 -5
  92. package/lib/module/components/typography/Hero.js.map +1 -1
  93. package/lib/module/components/typography/IOText.js +16 -15
  94. package/lib/module/components/typography/IOText.js.map +1 -1
  95. package/lib/module/components/typography/LabelMini.js +7 -5
  96. package/lib/module/components/typography/LabelMini.js.map +1 -1
  97. package/lib/module/components/typography/markdown/MdH1.js +3 -5
  98. package/lib/module/components/typography/markdown/MdH1.js.map +1 -1
  99. package/lib/module/components/typography/markdown/MdH2.js +3 -5
  100. package/lib/module/components/typography/markdown/MdH2.js.map +1 -1
  101. package/lib/module/components/typography/markdown/MdH3.js +3 -5
  102. package/lib/module/components/typography/markdown/MdH3.js.map +1 -1
  103. package/lib/module/context/IOThemeContextProvider.js +3 -4
  104. package/lib/module/context/IOThemeContextProvider.js.map +1 -1
  105. package/lib/typescript/components/alert/Alert.d.ts +3 -1
  106. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  107. package/lib/typescript/components/banner/Banner.d.ts +3 -1
  108. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  109. package/lib/typescript/components/buttons/IOButton/IOButton.d.ts +3 -2
  110. package/lib/typescript/components/buttons/IOButton/IOButton.d.ts.map +1 -1
  111. package/lib/typescript/components/layout/ContentWrapper.d.ts +10 -6
  112. package/lib/typescript/components/layout/ContentWrapper.d.ts.map +1 -1
  113. package/lib/typescript/components/otpInput/OTPInput.d.ts +3 -1
  114. package/lib/typescript/components/otpInput/OTPInput.d.ts.map +1 -1
  115. package/lib/typescript/components/searchInput/SearchInput.d.ts +3 -1
  116. package/lib/typescript/components/searchInput/SearchInput.d.ts.map +1 -1
  117. package/lib/typescript/components/tabs/TabItem.d.ts +3 -11
  118. package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
  119. package/lib/typescript/components/textInput/TextInputValidation.d.ts +7 -24
  120. package/lib/typescript/components/textInput/TextInputValidation.d.ts.map +1 -1
  121. package/lib/typescript/components/typography/Body.d.ts +4 -2
  122. package/lib/typescript/components/typography/Body.d.ts.map +1 -1
  123. package/lib/typescript/components/typography/BodyMonospace.d.ts +2 -8
  124. package/lib/typescript/components/typography/BodyMonospace.d.ts.map +1 -1
  125. package/lib/typescript/components/typography/BodySmall.d.ts +4 -2
  126. package/lib/typescript/components/typography/BodySmall.d.ts.map +1 -1
  127. package/lib/typescript/components/typography/ButtonText.d.ts +2 -8
  128. package/lib/typescript/components/typography/ButtonText.d.ts.map +1 -1
  129. package/lib/typescript/components/typography/Caption.d.ts +2 -8
  130. package/lib/typescript/components/typography/Caption.d.ts.map +1 -1
  131. package/lib/typescript/components/typography/H1.d.ts +2 -8
  132. package/lib/typescript/components/typography/H1.d.ts.map +1 -1
  133. package/lib/typescript/components/typography/H2.d.ts +6 -10
  134. package/lib/typescript/components/typography/H2.d.ts.map +1 -1
  135. package/lib/typescript/components/typography/H3.d.ts +2 -8
  136. package/lib/typescript/components/typography/H3.d.ts.map +1 -1
  137. package/lib/typescript/components/typography/H4.d.ts +2 -8
  138. package/lib/typescript/components/typography/H4.d.ts.map +1 -1
  139. package/lib/typescript/components/typography/H5.d.ts +2 -8
  140. package/lib/typescript/components/typography/H5.d.ts.map +1 -1
  141. package/lib/typescript/components/typography/H6.d.ts +2 -8
  142. package/lib/typescript/components/typography/H6.d.ts.map +1 -1
  143. package/lib/typescript/components/typography/Hero.d.ts +2 -8
  144. package/lib/typescript/components/typography/Hero.d.ts.map +1 -1
  145. package/lib/typescript/components/typography/IOText.d.ts +5 -5
  146. package/lib/typescript/components/typography/IOText.d.ts.map +1 -1
  147. package/lib/typescript/components/typography/LabelMini.d.ts +4 -2
  148. package/lib/typescript/components/typography/LabelMini.d.ts.map +1 -1
  149. package/lib/typescript/components/typography/markdown/MdH1.d.ts +2 -8
  150. package/lib/typescript/components/typography/markdown/MdH1.d.ts.map +1 -1
  151. package/lib/typescript/components/typography/markdown/MdH2.d.ts +2 -8
  152. package/lib/typescript/components/typography/markdown/MdH2.d.ts.map +1 -1
  153. package/lib/typescript/components/typography/markdown/MdH3.d.ts +2 -8
  154. package/lib/typescript/components/typography/markdown/MdH3.d.ts.map +1 -1
  155. package/lib/typescript/context/IOThemeContextProvider.d.ts.map +1 -1
  156. package/package.json +6 -7
  157. package/src/components/alert/Alert.tsx +108 -112
  158. package/src/components/banner/Banner.tsx +121 -125
  159. package/src/components/buttons/IOButton/IOButton.tsx +204 -216
  160. package/src/components/layout/ContentWrapper.tsx +21 -24
  161. package/src/components/otpInput/OTPInput.tsx +156 -167
  162. package/src/components/searchInput/SearchInput.tsx +208 -217
  163. package/src/components/tabs/TabItem.tsx +143 -146
  164. package/src/components/textInput/TextInputValidation.tsx +116 -122
  165. package/src/components/typography/Body.tsx +51 -52
  166. package/src/components/typography/BodyMonospace.tsx +19 -24
  167. package/src/components/typography/BodySmall.tsx +51 -52
  168. package/src/components/typography/ButtonText.tsx +14 -20
  169. package/src/components/typography/Caption.tsx +18 -23
  170. package/src/components/typography/H1.tsx +12 -20
  171. package/src/components/typography/H2.tsx +16 -23
  172. package/src/components/typography/H3.tsx +12 -20
  173. package/src/components/typography/H4.tsx +12 -20
  174. package/src/components/typography/H5.tsx +16 -24
  175. package/src/components/typography/H6.tsx +13 -21
  176. package/src/components/typography/Hero.tsx +14 -19
  177. package/src/components/typography/IOText.tsx +54 -59
  178. package/src/components/typography/LabelMini.tsx +45 -49
  179. package/src/components/typography/markdown/MdH1.tsx +14 -19
  180. package/src/components/typography/markdown/MdH2.tsx +14 -19
  181. package/src/components/typography/markdown/MdH3.tsx +14 -19
  182. package/src/context/IOThemeContextProvider.tsx +4 -12
@@ -1,11 +1,5 @@
1
1
  /* eslint-disable functional/immutable-data */
2
- import {
3
- forwardRef,
4
- useCallback,
5
- useImperativeHandle,
6
- useRef,
7
- useState
8
- } from "react";
2
+ import { Ref, useCallback, useImperativeHandle, useRef, useState } from "react";
9
3
  import {
10
4
  ColorValue,
11
5
  Dimensions,
@@ -76,6 +70,7 @@ type SearchInputActionProps =
76
70
  };
77
71
 
78
72
  type SearchInputProps = WithTestID<{
73
+ ref?: Ref<SearchInputRef>;
79
74
  accessibilityLabel: TextInputProps["accessibilityLabel"];
80
75
  cancelButtonLabel: string;
81
76
  clearAccessibilityLabel: string;
@@ -96,246 +91,242 @@ const inputWithTimingConfig = {
96
91
  easing: Easing.inOut(Easing.cubic)
97
92
  };
98
93
 
99
- export const SearchInput = forwardRef<SearchInputRef, SearchInputProps>(
100
- (
101
- {
102
- accessibilityLabel,
103
- cancelButtonLabel,
104
- clearAccessibilityLabel,
105
- placeholder,
106
- autoFocus,
107
- keepCancelVisible = false,
108
- onCancel,
109
- onChangeText,
110
- pressable,
111
- testID,
112
- value = ""
113
- },
114
- ref
115
- ) => {
116
- const searchInputRef = useRef<TextInput>(null);
117
- const { newTypefaceEnabled } = useIONewTypeface();
94
+ export const SearchInput = ({
95
+ accessibilityLabel,
96
+ cancelButtonLabel,
97
+ clearAccessibilityLabel,
98
+ placeholder,
99
+ autoFocus,
100
+ keepCancelVisible = false,
101
+ onCancel,
102
+ onChangeText,
103
+ pressable,
104
+ testID,
105
+ value = "",
106
+ ref
107
+ }: SearchInputProps) => {
108
+ const searchInputRef = useRef<TextInput>(null);
109
+ const { newTypefaceEnabled } = useIONewTypeface();
118
110
 
119
- /* Component visual attributes */
120
- const theme = useIOTheme();
121
- const inputCaretColor = IOColors[theme["interactiveElem-default"]];
111
+ /* Component visual attributes */
112
+ const theme = useIOTheme();
113
+ const inputCaretColor = IOColors[theme["interactiveElem-default"]];
122
114
 
123
- const inputBgColorDefault: ColorValue =
124
- IOColors[theme["appBackground-secondary"]];
125
- const inputBgColorFocused: ColorValue =
126
- IOColors[theme["appBackground-tertiary"]];
127
- const inputColorPlaceholder: ColorValue =
128
- IOColors[theme["textBody-tertiary"]];
129
- const iconColor: IOColors = theme["textBody-tertiary"];
115
+ const inputBgColorDefault: ColorValue =
116
+ IOColors[theme["appBackground-secondary"]];
117
+ const inputBgColorFocused: ColorValue =
118
+ IOColors[theme["appBackground-tertiary"]];
119
+ const inputColorPlaceholder: ColorValue =
120
+ IOColors[theme["textBody-tertiary"]];
121
+ const iconColor: IOColors = theme["textBody-tertiary"];
130
122
 
131
- /* Widths used for the transition:
123
+ /* Widths used for the transition:
132
124
  - `SearchInput` entire width
133
125
  - `Cancel` button */
134
- const inputWidth: number =
135
- Dimensions.get("window").width - IOVisualCostants.appMarginDefault * 2;
136
-
137
- const [cancelButtonWidth, setCancelButtonWidth] =
138
- useState<LayoutRectangle["width"]>(0);
126
+ const inputWidth: number =
127
+ Dimensions.get("window").width - IOVisualCostants.appMarginDefault * 2;
139
128
 
140
- const getCancelButtonWidth = ({ nativeEvent }: LayoutChangeEvent) => {
141
- setCancelButtonWidth(nativeEvent.layout.width);
142
- };
129
+ const [cancelButtonWidth, setCancelButtonWidth] =
130
+ useState<LayoutRectangle["width"]>(0);
143
131
 
144
- const inputWidthWithCancel: number = inputWidth - cancelButtonWidth;
132
+ const getCancelButtonWidth = ({ nativeEvent }: LayoutChangeEvent) => {
133
+ setCancelButtonWidth(nativeEvent.layout.width);
134
+ };
145
135
 
146
- useImperativeHandle(
147
- ref,
148
- () => ({
149
- focus() {
150
- searchInputRef.current?.focus();
151
- }
152
- }),
153
- []
154
- );
136
+ const inputWidthWithCancel: number = inputWidth - cancelButtonWidth;
155
137
 
156
- /* Reanimated styles */
157
- const inputAnimatedWidth = useSharedValue<number>(inputWidth);
158
- const isFocused = useSharedValue(0);
138
+ useImperativeHandle(
139
+ ref,
140
+ () => ({
141
+ focus() {
142
+ searchInputRef.current?.focus();
143
+ }
144
+ }),
145
+ []
146
+ );
159
147
 
160
- /* Applied to the `SearchInput` */
161
- const animatedStyle = useAnimatedStyle(() => ({
162
- width: withTiming(inputAnimatedWidth.value, inputWithTimingConfig),
163
- backgroundColor: interpolateColor(
164
- isFocused.value,
165
- [0, 1],
166
- [inputBgColorDefault, inputBgColorFocused]
167
- )
168
- }));
148
+ /* Reanimated styles */
149
+ const inputAnimatedWidth = useSharedValue<number>(inputWidth);
150
+ const isFocused = useSharedValue(0);
169
151
 
170
- /* Applied to the `Cancel` button */
171
- const cancelButtonAnimatedStyle = useAnimatedStyle(() => {
172
- const showCancelButton =
173
- !pressable && keepCancelVisible ? 1 : isFocused.value;
152
+ /* Applied to the `SearchInput` */
153
+ const animatedStyle = useAnimatedStyle(() => ({
154
+ width: withTiming(inputAnimatedWidth.value, inputWithTimingConfig),
155
+ backgroundColor: interpolateColor(
156
+ isFocused.value,
157
+ [0, 1],
158
+ [inputBgColorDefault, inputBgColorFocused]
159
+ )
160
+ }));
174
161
 
175
- return {
176
- transform: [
177
- {
178
- translateX: interpolate(
179
- showCancelButton,
180
- [0, 1],
181
- [cancelButtonWidth + IOVisualCostants.appMarginDefault, 0],
182
- Extrapolation.CLAMP
183
- )
184
- }
185
- ],
186
- opacity: interpolate(showCancelButton, [0, 1], [0.5, 1])
187
- };
188
- });
162
+ /* Applied to the `Cancel` button */
163
+ const cancelButtonAnimatedStyle = useAnimatedStyle(() => {
164
+ const showCancelButton =
165
+ !pressable && keepCancelVisible ? 1 : isFocused.value;
189
166
 
190
- /* Applied to the `Clear` button inside the `SearchInput` */
191
- const clearButtonAnimatedStyle = useAnimatedStyle(() => {
192
- const showClearButton = value.length > 0;
167
+ return {
168
+ transform: [
169
+ {
170
+ translateX: interpolate(
171
+ showCancelButton,
172
+ [0, 1],
173
+ [cancelButtonWidth + IOVisualCostants.appMarginDefault, 0],
174
+ Extrapolation.CLAMP
175
+ )
176
+ }
177
+ ],
178
+ opacity: interpolate(showCancelButton, [0, 1], [0.5, 1])
179
+ };
180
+ });
193
181
 
194
- return {
195
- transform: [
196
- {
197
- scale: showClearButton
198
- ? withTiming(1, inputWithTimingConfig)
199
- : withTiming(0.5, inputWithTimingConfig)
200
- }
201
- ],
202
- opacity: withTiming(showClearButton ? 1 : 0, inputWithTimingConfig)
203
- };
204
- }, [value]);
182
+ /* Applied to the `Clear` button inside the `SearchInput` */
183
+ const clearButtonAnimatedStyle = useAnimatedStyle(() => {
184
+ const showClearButton = value.length > 0;
205
185
 
206
- /* Related event handlers */
207
- const handleFocus = () => {
208
- isFocused.value = withTiming(1, inputWithTimingConfig);
209
- inputAnimatedWidth.value = inputWidthWithCancel;
186
+ return {
187
+ transform: [
188
+ {
189
+ scale: showClearButton
190
+ ? withTiming(1, inputWithTimingConfig)
191
+ : withTiming(0.5, inputWithTimingConfig)
192
+ }
193
+ ],
194
+ opacity: withTiming(showClearButton ? 1 : 0, inputWithTimingConfig)
210
195
  };
196
+ }, [value]);
211
197
 
212
- const handleBlur = () => {
213
- isFocused.value = withTiming(0, inputWithTimingConfig);
214
- inputAnimatedWidth.value = keepCancelVisible
215
- ? inputWidthWithCancel
216
- : inputWidth;
217
- };
198
+ /* Related event handlers */
199
+ const handleFocus = () => {
200
+ isFocused.value = withTiming(1, inputWithTimingConfig);
201
+ inputAnimatedWidth.value = inputWidthWithCancel;
202
+ };
218
203
 
219
- const handleCancel = useCallback(
220
- (event: GestureResponderEvent) => {
221
- onChangeText?.("");
222
- onCancel?.(event);
223
- },
224
- [onCancel, onChangeText]
225
- );
204
+ const handleBlur = () => {
205
+ isFocused.value = withTiming(0, inputWithTimingConfig);
206
+ inputAnimatedWidth.value = keepCancelVisible
207
+ ? inputWidthWithCancel
208
+ : inputWidth;
209
+ };
226
210
 
227
- const handleClear = useCallback(() => {
211
+ const handleCancel = useCallback(
212
+ (event: GestureResponderEvent) => {
228
213
  onChangeText?.("");
229
- searchInputRef.current?.clear();
230
- }, [onChangeText]);
214
+ onCancel?.(event);
215
+ },
216
+ [onCancel, onChangeText]
217
+ );
218
+
219
+ const handleClear = useCallback(() => {
220
+ onChangeText?.("");
221
+ searchInputRef.current?.clear();
222
+ }, [onChangeText]);
231
223
 
232
- const handleChangeText = useCallback(
233
- (text: string) => onChangeText?.(text),
234
- [onChangeText]
235
- );
224
+ const handleChangeText = useCallback(
225
+ (text: string) => onChangeText?.(text),
226
+ [onChangeText]
227
+ );
236
228
 
237
- const renderSearchBar = () => (
229
+ const renderSearchBar = () => (
230
+ <Animated.View
231
+ importantForAccessibility={pressable ? "no-hide-descendants" : "auto"}
232
+ style={styles.searchBar}
233
+ >
238
234
  <Animated.View
239
- importantForAccessibility={pressable ? "no-hide-descendants" : "auto"}
240
- style={styles.searchBar}
235
+ style={[styles.searchInput, animatedStyle]}
236
+ pointerEvents={pressable ? "none" : "auto"}
241
237
  >
242
- <Animated.View
243
- style={[styles.searchInput, animatedStyle]}
244
- pointerEvents={pressable ? "none" : "auto"}
245
- >
246
- <View style={styles.iconContainer}>
247
- <Icon
248
- allowFontScaling
249
- name="search"
250
- size={iconSize}
251
- color={iconColor}
252
- />
253
- </View>
254
- <AnimatedTextInput
255
- testID={testID}
256
- ref={searchInputRef}
257
- inputMode="search"
258
- returnKeyType="search"
259
- accessibilityRole={"search"}
260
- accessibilityLabel={accessibilityLabel}
261
- numberOfLines={1}
262
- style={[
263
- {
264
- color: IOColors[theme["textBody-default"]],
265
- ...makeFontStyleObject(
266
- inputFontSizePlaceholder,
267
- newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
268
- undefined,
269
- "Regular"
270
- )
271
- },
272
- styles.textInput,
273
- Platform.OS === "ios"
274
- ? styles.textInputIOS
275
- : styles.textInputAndroid
276
- ]}
277
- selectionColor={inputCaretColor}
278
- cursorColor={inputCaretColor}
279
- placeholder={placeholder}
280
- placeholderTextColor={inputColorPlaceholder}
281
- onFocus={handleFocus}
282
- onBlur={handleBlur}
283
- onChangeText={handleChangeText}
284
- value={value}
285
- autoFocus={autoFocus}
286
- maxFontSizeMultiplier={IOMaxFontSizeMultiplier}
238
+ <View style={styles.iconContainer}>
239
+ <Icon
240
+ allowFontScaling
241
+ name="search"
242
+ size={iconSize}
243
+ color={iconColor}
287
244
  />
245
+ </View>
246
+ <AnimatedTextInput
247
+ testID={testID}
248
+ ref={searchInputRef}
249
+ inputMode="search"
250
+ returnKeyType="search"
251
+ accessibilityRole={"search"}
252
+ accessibilityLabel={accessibilityLabel}
253
+ numberOfLines={1}
254
+ style={[
255
+ {
256
+ color: IOColors[theme["textBody-default"]],
257
+ ...makeFontStyleObject(
258
+ inputFontSizePlaceholder,
259
+ newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
260
+ undefined,
261
+ "Regular"
262
+ )
263
+ },
264
+ styles.textInput,
265
+ Platform.OS === "ios"
266
+ ? styles.textInputIOS
267
+ : styles.textInputAndroid
268
+ ]}
269
+ selectionColor={inputCaretColor}
270
+ cursorColor={inputCaretColor}
271
+ placeholder={placeholder}
272
+ placeholderTextColor={inputColorPlaceholder}
273
+ onFocus={handleFocus}
274
+ onBlur={handleBlur}
275
+ onChangeText={handleChangeText}
276
+ value={value}
277
+ autoFocus={autoFocus}
278
+ maxFontSizeMultiplier={IOMaxFontSizeMultiplier}
279
+ />
288
280
 
289
- <AnimatedPressable
290
- style={[styles.clearButton, clearButtonAnimatedStyle]}
291
- onPress={handleClear}
292
- accessibilityLabel={clearAccessibilityLabel}
293
- accessibilityRole="button"
294
- hitSlop={16}
295
- >
296
- <Icon name="closeSmall" size={iconCloseSize} color={iconColor} />
297
- </AnimatedPressable>
298
- </Animated.View>
299
- <Animated.View
300
- onLayout={getCancelButtonWidth}
301
- style={[styles.cancelButton, cancelButtonAnimatedStyle]}
281
+ <AnimatedPressable
282
+ style={[styles.clearButton, clearButtonAnimatedStyle]}
283
+ onPress={handleClear}
284
+ accessibilityLabel={clearAccessibilityLabel}
285
+ accessibilityRole="button"
286
+ hitSlop={16}
302
287
  >
303
- <Pressable
304
- accessibilityRole="button"
305
- accessibilityLabel={cancelButtonLabel}
306
- onPress={handleCancel}
288
+ <Icon name="closeSmall" size={iconCloseSize} color={iconColor} />
289
+ </AnimatedPressable>
290
+ </Animated.View>
291
+ <Animated.View
292
+ onLayout={getCancelButtonWidth}
293
+ style={[styles.cancelButton, cancelButtonAnimatedStyle]}
294
+ >
295
+ <Pressable
296
+ accessibilityRole="button"
297
+ accessibilityLabel={cancelButtonLabel}
298
+ onPress={handleCancel}
299
+ >
300
+ <IOText
301
+ color={theme["interactiveElem-default"]}
302
+ weight={"Semibold"}
303
+ size={buttonTextFontSize}
304
+ lineHeight={buttonTextLineHeight}
305
+ numberOfLines={1}
306
+ accessible={false}
307
+ accessibilityElementsHidden
308
+ importantForAccessibility="no-hide-descendants"
307
309
  >
308
- <IOText
309
- color={theme["interactiveElem-default"]}
310
- weight={"Semibold"}
311
- size={buttonTextFontSize}
312
- lineHeight={buttonTextLineHeight}
313
- numberOfLines={1}
314
- accessible={false}
315
- accessibilityElementsHidden
316
- importantForAccessibility="no-hide-descendants"
317
- >
318
- {cancelButtonLabel}
319
- </IOText>
320
- </Pressable>
321
- </Animated.View>
310
+ {cancelButtonLabel}
311
+ </IOText>
312
+ </Pressable>
322
313
  </Animated.View>
323
- );
314
+ </Animated.View>
315
+ );
324
316
 
325
- return pressable ? (
326
- <Pressable
327
- accessible={true}
328
- accessibilityRole="button"
329
- accessibilityLabel={placeholder}
330
- onPress={pressable.onPress}
331
- >
332
- {renderSearchBar()}
333
- </Pressable>
334
- ) : (
335
- renderSearchBar()
336
- );
337
- }
338
- );
317
+ return pressable ? (
318
+ <Pressable
319
+ accessible={true}
320
+ accessibilityRole="button"
321
+ accessibilityLabel={placeholder}
322
+ onPress={pressable.onPress}
323
+ >
324
+ {renderSearchBar()}
325
+ </Pressable>
326
+ ) : (
327
+ renderSearchBar()
328
+ );
329
+ };
339
330
 
340
331
  const styles = StyleSheet.create({
341
332
  searchBar: {