@controleonline/ui-default 1.0.263 → 1.0.265

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 (61) hide show
  1. package/AGENTS.md +47 -45
  2. package/package.json +20 -20
  3. package/src/react/components/errors/DefaultErrors.js +307 -325
  4. package/src/react/components/files/DefaultFile.js +46 -46
  5. package/src/react/components/filters/CompactFilterSelector.js +78 -24
  6. package/src/react/components/filters/CompactFilterSelector.styles.js +17 -5
  7. package/src/react/components/filters/DefaultColumnFilter.js +191 -57
  8. package/src/react/components/filters/DefaultExternalFilters.js +245 -182
  9. package/src/react/components/filters/DefaultSearch.js +131 -92
  10. package/src/react/components/filters/DefaultSearch.styles.js +65 -70
  11. package/src/react/components/form/DefaultForm.js +172 -151
  12. package/src/react/components/form/DefaultForm.styles.js +71 -66
  13. package/src/react/components/help/DefaultTooltip.js +87 -87
  14. package/src/react/components/help/DefaultTooltip.styles.js +61 -61
  15. package/src/react/components/inputs/DefaultDateInput.js +150 -0
  16. package/src/react/components/inputs/DefaultInput.js +162 -127
  17. package/src/react/components/inputs/DefaultInput.styles.js +6 -0
  18. package/src/react/components/inputs/DefaultSelect.js +320 -152
  19. package/src/react/components/inputs/defaultInputUtils.js +40 -19
  20. package/src/react/components/map/DefaultGoogleMap.styles.js +115 -9
  21. package/src/react/components/map/DefaultGoogleMap.web.js +560 -446
  22. package/src/react/components/map/DefaultMap.native.js +73 -71
  23. package/src/react/components/map/DefaultMap.styles.js +16 -16
  24. package/src/react/components/map/DefaultMap.web.js +68 -66
  25. package/src/react/components/map/DefaultNativeMap.native.js +307 -183
  26. package/src/react/components/map/DefaultNativeMap.shared.js +439 -340
  27. package/src/react/components/map/DefaultNativeMap.styles.js +156 -122
  28. package/src/react/components/table/DefaultColumnMenu.js +108 -0
  29. package/src/react/components/table/DefaultDebug.js +233 -0
  30. package/src/react/components/table/DefaultFiltersModal.js +142 -0
  31. package/src/react/components/table/DefaultModalButton.js +18 -0
  32. package/src/react/components/table/DefaultSearchModal.js +49 -0
  33. package/src/react/components/table/DefaultTable.js +345 -1846
  34. package/src/react/components/table/DefaultTable.styles.js +247 -136
  35. package/src/react/components/table/DefaultTable.utils.js +502 -0
  36. package/src/react/components/table/DefaultTableBody.js +26 -0
  37. package/src/react/components/table/DefaultTableCards.js +171 -0
  38. package/src/react/components/table/DefaultTableControls.js +208 -0
  39. package/src/react/components/table/DefaultTableEmptyState.js +22 -0
  40. package/src/react/components/table/DefaultTableFooter.js +172 -0
  41. package/src/react/components/table/DefaultTableInput.js +145 -0
  42. package/src/react/components/table/DefaultTableRows.js +340 -0
  43. package/src/react/components/table/DefaultTableSearch.js +100 -0
  44. package/src/react/components/table/DefaultTableToolbar.js +98 -0
  45. package/src/react/components/table/DefaultToolbarAction.js +56 -0
  46. package/src/react/components/table/useDefaultTablePagination.js +370 -0
  47. package/src/react/components/table/useDefaultTableSorting.js +126 -0
  48. package/src/react/components/table/useDefaultTableTheme.js +58 -0
  49. package/src/react/index.js +10 -10
  50. package/src/react/utils/tableVisibleColumnsPreferences.js +239 -211
  51. package/src/store/default/actions.js +51 -13
  52. package/src/store/default/getters.js +10 -8
  53. package/src/store/default/mutation_types.js +4 -2
  54. package/src/store/default/mutations.js +10 -1
  55. package/src/tests/react/components/errors/DefaultErrors.test.js +162 -162
  56. package/src/tests/react/components/files/DefaultFile.test.js +80 -80
  57. package/src/tests/react/components/form/DefaultForm.test.js +81 -0
  58. package/src/tests/react/components/inputs/DefaultSelect.test.js +185 -0
  59. package/src/tests/react/components/table/DefaultTable.test.js +1183 -0
  60. package/src/tests/react/store/defaultActions.test.js +59 -0
  61. package/src/tests/react/utils/tableVisibleColumnsPreferences.test.js +247 -168
@@ -1,12 +1,12 @@
1
- import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
2
- import {Modal, Pressable, Text, TouchableOpacity, View} from 'react-native';
3
- import {useStore, useStores} from '@store';
4
- import resolveSystemErrorMessage from '@controleonline/ui-common/src/react/utils/systemErrorMessage';
5
-
6
- const AUTO_CLOSE_MS = 5000;
7
-
8
- const resolveText = value => String(value ?? '').trim();
9
-
1
+ import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
2
+ import {Modal, Pressable, Text, TouchableOpacity, View} from 'react-native';
3
+ import {useStore, useStores} from '@store';
4
+ import resolveSystemErrorMessage from '@controleonline/ui-common/src/react/utils/systemErrorMessage';
5
+
6
+ const AUTO_CLOSE_MS = 5000;
7
+
8
+ const resolveText = value => String(value ?? '').trim();
9
+
10
10
  const normalizeStoreNames = (store, stores) => {
11
11
  const resolvedStoreNames = [
12
12
  ...(Array.isArray(store) ? store : store ? [store] : []),
@@ -16,345 +16,327 @@ const normalizeStoreNames = (store, stores) => {
16
16
  return resolvedStoreNames.filter(name => typeof name === 'string' && name.trim()).map(name => name.trim());
17
17
  };
18
18
 
19
- const pickThemeColor = (colors, keys, fallback) => {
20
- for (const key of keys) {
21
- const value = colors?.[key];
22
-
23
- if (typeof value === 'string' && value.trim()) {
24
- return value.trim();
25
- }
26
- }
27
-
28
- return fallback;
29
- };
30
-
31
19
  const DefaultErrors = ({
32
- store = null,
33
- stores = [],
34
- error = null,
35
- title = '',
36
- message = '',
37
- compact = false,
38
- align = 'center',
39
- onRetry = null,
40
- retryLabel = 'Tentar novamente',
41
- containerStyle = null,
42
- contentStyle = null,
43
- titleStyle = null,
44
- messageStyle = null,
45
- retryButtonStyle = null,
46
- retryTextStyle = null,
20
+ store = null,
21
+ stores = [],
22
+ error = null,
23
+ title = '',
24
+ message = '',
25
+ compact = false,
26
+ align = 'center',
27
+ onRetry = null,
28
+ retryLabel = 'Tentar novamente',
29
+ containerStyle = null,
30
+ contentStyle = null,
31
+ titleStyle = null,
32
+ messageStyle = null,
33
+ retryButtonStyle = null,
34
+ retryTextStyle = null,
47
35
  }) => {
48
36
  const themeStore = useStore('theme');
49
37
  const themeColors = themeStore?.getters?.colors || {};
38
+ const palette = useMemo(
39
+ () => ({
40
+ buttonBackground: themeColors.buttonBackground,
41
+ buttonBorder: themeColors.buttonBorder,
42
+ buttonText: themeColors.buttonText,
43
+ inputErrorBorder: themeColors.inputErrorBorder,
44
+ inputErrorText: themeColors.inputErrorText,
45
+ modalBackground: themeColors.modalBackground,
46
+ modalBorder: themeColors.modalBorder,
47
+ modalCloseIcon: themeColors.modalCloseIcon,
48
+ modalOverlay: themeColors.modalOverlay,
49
+ modalText: themeColors.modalText,
50
+ }),
51
+ [themeColors],
52
+ );
50
53
  const allStores = typeof useStores === 'function' ? useStores(state => state) : null;
51
- const storeNames = useMemo(() => normalizeStoreNames(store, stores), [store, stores]);
52
- const watchedStoreEntries = useMemo(() => {
53
- if (!allStores || storeNames.length === 0) {
54
- return [];
55
- }
56
-
57
- return storeNames
58
- .map(storeName => {
59
- const currentStore = allStores?.[storeName] || null;
60
- const storeError = resolveSystemErrorMessage(currentStore?.getters?.error);
61
-
62
- if (!storeError) {
63
- return null;
64
- }
65
-
66
- return {
67
- error: storeError,
68
- name: storeName,
69
- store: currentStore,
70
- };
71
- })
72
- .filter(Boolean);
73
- }, [allStores, storeNames]);
74
-
75
- const explicitTitle = resolveText(title);
76
- const explicitMessage = resolveText(message) || resolveSystemErrorMessage(error);
77
- const hasStoreError = watchedStoreEntries.length > 0;
78
- const activeStoreEntry = watchedStoreEntries[0] || null;
79
- const visibleMessage = hasStoreError ? activeStoreEntry?.error || '' : explicitMessage;
80
- const hasExplicitContent = storeNames.length === 0
81
- ? Boolean(explicitTitle || explicitMessage || typeof onRetry === 'function')
82
- : Boolean(explicitMessage || typeof onRetry === 'function');
83
- const storeDriverSignature = hasStoreError
84
- ? `store:${watchedStoreEntries.map(entry => `${entry.name}:${entry.error}`).join('|')}`
85
- : '';
86
- const explicitDriverSignature = hasExplicitContent
87
- ? `explicit:${[explicitTitle, explicitMessage, typeof onRetry === 'function' ? 'retry' : '']
88
- .map(value => resolveText(value))
89
- .filter(Boolean)
90
- .join('|')}`
91
- : '';
92
- const activeDriverSignature = storeDriverSignature || explicitDriverSignature;
54
+ const storeNames = useMemo(() => normalizeStoreNames(store, stores), [store, stores]);
55
+ const watchedStoreEntries = useMemo(() => {
56
+ if (!allStores || storeNames.length === 0) {
57
+ return [];
58
+ }
59
+
60
+ return storeNames
61
+ .map(storeName => {
62
+ const currentStore = allStores?.[storeName] || null;
63
+ const storeError = resolveSystemErrorMessage(currentStore?.getters?.error);
64
+
65
+ if (!storeError) {
66
+ return null;
67
+ }
68
+
69
+ return {
70
+ error: storeError,
71
+ name: storeName,
72
+ store: currentStore,
73
+ };
74
+ })
75
+ .filter(Boolean);
76
+ }, [allStores, storeNames]);
77
+
78
+ const explicitTitle = resolveText(title);
79
+ const explicitMessage = resolveText(message) || resolveSystemErrorMessage(error);
80
+ const hasStoreError = watchedStoreEntries.length > 0;
81
+ const activeStoreEntry = watchedStoreEntries[0] || null;
82
+ const visibleMessage = hasStoreError ? activeStoreEntry?.error || '' : explicitMessage;
83
+ const hasExplicitContent = storeNames.length === 0
84
+ ? Boolean(explicitTitle || explicitMessage || typeof onRetry === 'function')
85
+ : Boolean(explicitMessage || typeof onRetry === 'function');
86
+ const storeDriverSignature = hasStoreError
87
+ ? `store:${watchedStoreEntries.map(entry => `${entry.name}:${entry.error}`).join('|')}`
88
+ : '';
89
+ const explicitDriverSignature = hasExplicitContent
90
+ ? `explicit:${[explicitTitle, explicitMessage, typeof onRetry === 'function' ? 'retry' : '']
91
+ .map(value => resolveText(value))
92
+ .filter(Boolean)
93
+ .join('|')}`
94
+ : '';
95
+ const activeDriverSignature = storeDriverSignature || explicitDriverSignature;
93
96
  const [dismissedSignatures, setDismissedSignatures] = useState(() => new Set());
94
97
  const timerRef = useRef(null);
95
98
  const textAlign = align === 'left' ? 'left' : 'center';
96
- const accentColor = pickThemeColor(
97
- themeColors,
98
- ['inputErrorBorder', 'textDanger', 'modalBorder', 'primary'],
99
- '#DC2626',
100
- );
101
- const backgroundColor = pickThemeColor(
102
- themeColors,
103
- ['inputErrorBackground', 'modalBackground', 'surface', 'background'],
104
- '#FFFFFF',
105
- );
106
- const overlayColor = pickThemeColor(
107
- themeColors,
108
- ['modalOverlay', 'overlayBackground'],
109
- 'rgba(15, 23, 42, 0.55)',
110
- );
111
- const titleColor = pickThemeColor(
112
- themeColors,
113
- ['inputErrorText', 'textDanger', 'modalHeaderText', 'text'],
114
- '#B91C1C',
115
- );
116
- const messageColor = pickThemeColor(
117
- themeColors,
118
- ['modalText', 'textSecondary', 'text'],
119
- '#334155',
120
- );
121
- const closeColor = pickThemeColor(
122
- themeColors,
123
- ['modalCloseIcon', 'textDanger', 'primary'],
124
- accentColor,
125
- );
126
- const retryAccentColor = pickThemeColor(themeColors, ['primary'], accentColor);
127
-
128
- const clearStoreErrors = useCallback(() => {
129
- watchedStoreEntries.forEach(entry => {
130
- const setError = entry?.store?.actions?.setError;
131
-
132
- if (typeof setError === 'function') {
133
- setError('');
134
- }
135
- });
136
- }, [watchedStoreEntries]);
137
-
138
- const dismissPopup = useCallback(() => {
139
- if (timerRef.current) {
140
- clearTimeout(timerRef.current);
141
- timerRef.current = null;
142
- }
143
-
144
- setDismissedSignatures(previous => {
145
- const next = new Set(previous);
146
-
147
- if (storeDriverSignature) {
148
- next.add(storeDriverSignature);
149
- }
150
-
151
- if (explicitDriverSignature) {
152
- next.add(explicitDriverSignature);
153
- }
154
-
155
- return next;
156
- });
157
-
158
- clearStoreErrors();
159
- }, [clearStoreErrors, explicitDriverSignature, storeDriverSignature]);
160
-
161
- const isVisible = Boolean(activeDriverSignature) && !dismissedSignatures.has(activeDriverSignature);
162
- const hasContent = Boolean(explicitTitle || visibleMessage || typeof onRetry === 'function');
163
-
164
- useEffect(() => {
165
- if (!activeDriverSignature) {
166
- if (timerRef.current) {
167
- clearTimeout(timerRef.current);
168
- timerRef.current = null;
169
- }
170
-
171
- setDismissedSignatures(previous => (previous.size > 0 ? new Set() : previous));
172
- return undefined;
173
- }
174
-
175
- if (!isVisible) {
176
- if (timerRef.current) {
177
- clearTimeout(timerRef.current);
178
- timerRef.current = null;
179
- }
180
-
181
- return undefined;
182
- }
183
-
184
- if (timerRef.current) {
185
- clearTimeout(timerRef.current);
186
- }
187
-
188
- timerRef.current = setTimeout(() => {
189
- dismissPopup();
190
- }, AUTO_CLOSE_MS);
191
-
192
- return () => {
193
- if (timerRef.current) {
194
- clearTimeout(timerRef.current);
195
- timerRef.current = null;
196
- }
197
- };
198
- }, [activeDriverSignature, dismissPopup, isVisible]);
199
-
200
- if (!isVisible || !hasContent) {
201
- return null;
202
- }
203
-
204
- return (
205
- <Modal
206
- animationType="fade"
207
- onRequestClose={dismissPopup}
208
- transparent
209
- visible={isVisible}
210
- >
211
- <Pressable
212
- accessibilityRole="button"
213
- onPress={dismissPopup}
214
- style={[
215
- {
216
- alignItems: 'center',
217
- backgroundColor: overlayColor,
218
- flex: 1,
219
- justifyContent: 'center',
220
- padding: 18,
221
- },
222
- ]}
223
- >
224
- <View
225
- onStartShouldSetResponder={() => true}
226
- style={[
227
- {
228
- backgroundColor,
229
- borderColor: accentColor,
230
- borderRadius: 16,
231
- borderWidth: 1,
232
- maxWidth: compact ? 360 : 440,
233
- padding: compact ? 14 : 16,
234
- shadowColor: accentColor,
235
- shadowOffset: {height: 10, width: 0},
236
- shadowOpacity: 0.12,
237
- shadowRadius: 18,
238
- width: '100%',
239
- elevation: 12,
240
- },
241
- containerStyle,
242
- ]}
243
- >
244
- <View
245
- style={[
246
- {
247
- alignItems: 'flex-start',
248
- flexDirection: 'row',
249
- gap: 10,
250
- justifyContent: 'space-between',
251
- },
252
- contentStyle,
253
- ]}
254
- >
255
- <View style={{flex: 1, gap: explicitTitle ? 10 : 8}}>
256
- {explicitTitle ? (
257
- <Text
258
- style={[
259
- {
260
- color: titleColor,
261
- fontSize: compact ? 14 : 15,
262
- fontWeight: '800',
263
- textAlign,
264
- },
265
- titleStyle,
266
- ]}
267
- >
268
- {explicitTitle}
269
- </Text>
270
- ) : null}
271
-
272
- {visibleMessage ? (
273
- <Text
274
- style={[
275
- {
276
- color: messageColor,
277
- fontSize: compact ? 12 : 13,
278
- lineHeight: compact ? 18 : 19,
279
- textAlign,
280
- },
281
- messageStyle,
282
- ]}
283
- >
284
- {visibleMessage}
285
- </Text>
286
- ) : null}
287
-
288
- {typeof onRetry === 'function' ? (
289
- <TouchableOpacity
290
- accessibilityRole="button"
291
- activeOpacity={0.85}
292
- onPress={onRetry}
293
- style={[
99
+ const accentColor = palette.inputErrorBorder;
100
+ const backgroundColor = palette.modalBackground;
101
+ const overlayColor = palette.modalOverlay;
102
+ const titleColor = palette.inputErrorText;
103
+ const messageColor = palette.modalText;
104
+ const closeColor = palette.modalCloseIcon;
105
+ const retryBackgroundColor = palette.buttonBackground;
106
+ const retryBorderColor = palette.buttonBorder;
107
+ const retryTextColor = palette.buttonText;
108
+
109
+ const clearStoreErrors = useCallback(() => {
110
+ watchedStoreEntries.forEach(entry => {
111
+ const setError = entry?.store?.actions?.setError;
112
+
113
+ if (typeof setError === 'function') {
114
+ setError('');
115
+ }
116
+ });
117
+ }, [watchedStoreEntries]);
118
+
119
+ const dismissPopup = useCallback(() => {
120
+ if (timerRef.current) {
121
+ clearTimeout(timerRef.current);
122
+ timerRef.current = null;
123
+ }
124
+
125
+ setDismissedSignatures(previous => {
126
+ const next = new Set(previous);
127
+
128
+ if (storeDriverSignature) {
129
+ next.add(storeDriverSignature);
130
+ }
131
+
132
+ if (explicitDriverSignature) {
133
+ next.add(explicitDriverSignature);
134
+ }
135
+
136
+ return next;
137
+ });
138
+
139
+ clearStoreErrors();
140
+ }, [clearStoreErrors, explicitDriverSignature, storeDriverSignature]);
141
+
142
+ const isVisible = Boolean(activeDriverSignature) && !dismissedSignatures.has(activeDriverSignature);
143
+ const hasContent = Boolean(explicitTitle || visibleMessage || typeof onRetry === 'function');
144
+
145
+ useEffect(() => {
146
+ if (!activeDriverSignature) {
147
+ if (timerRef.current) {
148
+ clearTimeout(timerRef.current);
149
+ timerRef.current = null;
150
+ }
151
+
152
+ setDismissedSignatures(previous => (previous.size > 0 ? new Set() : previous));
153
+ return undefined;
154
+ }
155
+
156
+ if (!isVisible) {
157
+ if (timerRef.current) {
158
+ clearTimeout(timerRef.current);
159
+ timerRef.current = null;
160
+ }
161
+
162
+ return undefined;
163
+ }
164
+
165
+ if (timerRef.current) {
166
+ clearTimeout(timerRef.current);
167
+ }
168
+
169
+ timerRef.current = setTimeout(() => {
170
+ dismissPopup();
171
+ }, AUTO_CLOSE_MS);
172
+
173
+ return () => {
174
+ if (timerRef.current) {
175
+ clearTimeout(timerRef.current);
176
+ timerRef.current = null;
177
+ }
178
+ };
179
+ }, [activeDriverSignature, dismissPopup, isVisible]);
180
+
181
+ if (!isVisible || !hasContent) {
182
+ return null;
183
+ }
184
+
185
+ return (
186
+ <Modal
187
+ animationType="fade"
188
+ onRequestClose={dismissPopup}
189
+ transparent
190
+ visible={isVisible}
191
+ >
192
+ <Pressable
193
+ accessibilityRole="button"
194
+ onPress={dismissPopup}
195
+ style={[
196
+ {
197
+ alignItems: 'center',
198
+ backgroundColor: overlayColor,
199
+ flex: 1,
200
+ justifyContent: 'center',
201
+ padding: 18,
202
+ },
203
+ ]}
204
+ >
205
+ <View
206
+ onStartShouldSetResponder={() => true}
207
+ style={[
208
+ {
209
+ backgroundColor,
210
+ borderColor: accentColor,
211
+ borderRadius: 16,
212
+ borderWidth: 1,
213
+ maxWidth: compact ? 360 : 440,
214
+ padding: compact ? 14 : 16,
215
+ shadowColor: accentColor,
216
+ shadowOffset: {height: 10, width: 0},
217
+ shadowOpacity: 0.12,
218
+ shadowRadius: 18,
219
+ width: '100%',
220
+ elevation: 12,
221
+ },
222
+ containerStyle,
223
+ ]}
224
+ >
225
+ <View
226
+ style={[
227
+ {
228
+ alignItems: 'flex-start',
229
+ flexDirection: 'row',
230
+ gap: 10,
231
+ justifyContent: 'space-between',
232
+ },
233
+ contentStyle,
234
+ ]}
235
+ >
236
+ <View style={{flex: 1, gap: explicitTitle ? 10 : 8}}>
237
+ {explicitTitle ? (
238
+ <Text
239
+ style={[
240
+ {
241
+ color: titleColor,
242
+ fontSize: compact ? 14 : 15,
243
+ fontWeight: '800',
244
+ textAlign,
245
+ },
246
+ titleStyle,
247
+ ]}
248
+ >
249
+ {explicitTitle}
250
+ </Text>
251
+ ) : null}
252
+
253
+ {visibleMessage ? (
254
+ <Text
255
+ style={[
256
+ {
257
+ color: messageColor,
258
+ fontSize: compact ? 12 : 13,
259
+ lineHeight: compact ? 18 : 19,
260
+ textAlign,
261
+ },
262
+ messageStyle,
263
+ ]}
264
+ >
265
+ {visibleMessage}
266
+ </Text>
267
+ ) : null}
268
+
269
+ {typeof onRetry === 'function' ? (
270
+ <TouchableOpacity
271
+ accessibilityRole="button"
272
+ activeOpacity={0.85}
273
+ onPress={onRetry}
274
+ style={[
294
275
  {
295
276
  alignItems: 'center',
296
277
  alignSelf: textAlign === 'left' ? 'flex-start' : 'center',
297
278
  borderRadius: 999,
298
279
  borderWidth: 1,
299
- borderColor: retryAccentColor,
300
- backgroundColor: `${retryAccentColor}14`,
280
+ borderColor: retryBorderColor,
281
+ backgroundColor: retryBackgroundColor,
301
282
  marginTop: 4,
302
283
  paddingHorizontal: 12,
303
284
  paddingVertical: 8,
304
- },
305
- retryButtonStyle,
306
- ]}
307
- >
308
- <Text
285
+ },
286
+ retryButtonStyle,
287
+ ]}
288
+ >
289
+ <Text
309
290
  style={[
310
291
  {
311
- color: retryAccentColor,
292
+ color: retryTextColor,
312
293
  fontSize: 12,
313
294
  fontWeight: '800',
314
295
  },
315
- retryTextStyle,
316
- ]}
317
- >
318
- {retryLabel}
319
- </Text>
320
- </TouchableOpacity>
321
- ) : null}
322
- </View>
323
-
324
- <TouchableOpacity
325
- accessibilityLabel="Fechar erro"
326
- accessibilityRole="button"
327
- activeOpacity={0.8}
328
- onPress={dismissPopup}
329
- testID="default-errors-close"
330
- style={[
296
+ retryTextStyle,
297
+ ]}
298
+ >
299
+ {retryLabel}
300
+ </Text>
301
+ </TouchableOpacity>
302
+ ) : null}
303
+ </View>
304
+
305
+ <TouchableOpacity
306
+ accessibilityLabel="Fechar erro"
307
+ accessibilityRole="button"
308
+ activeOpacity={0.8}
309
+ onPress={dismissPopup}
310
+ testID="default-errors-close"
311
+ style={[
331
312
  {
332
313
  alignItems: 'center',
333
- borderColor: accentColor,
314
+ backgroundColor,
315
+ borderColor: palette.modalBorder,
334
316
  borderRadius: 999,
335
317
  borderWidth: 1,
336
318
  height: 28,
337
- justifyContent: 'center',
338
- width: 28,
339
- },
340
- ]}
341
- >
342
- <Text
343
- style={{
344
- color: closeColor,
345
- fontSize: 16,
346
- fontWeight: '800',
347
- lineHeight: 16,
348
- }}
349
- >
350
- ×
351
- </Text>
352
- </TouchableOpacity>
353
- </View>
354
- </View>
355
- </Pressable>
356
- </Modal>
357
- );
358
- };
359
-
360
- export default DefaultErrors;
319
+ justifyContent: 'center',
320
+ width: 28,
321
+ },
322
+ ]}
323
+ >
324
+ <Text
325
+ style={{
326
+ color: closeColor,
327
+ fontSize: 16,
328
+ fontWeight: '800',
329
+ lineHeight: 16,
330
+ }}
331
+ >
332
+ ×
333
+ </Text>
334
+ </TouchableOpacity>
335
+ </View>
336
+ </View>
337
+ </Pressable>
338
+ </Modal>
339
+ );
340
+ };
341
+
342
+ export default DefaultErrors;