@dloizides/ui-feedback 1.8.0 → 1.12.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.
- package/CHANGELOG.md +37 -0
- package/dist/index.d.mts +38 -6
- package/dist/index.d.ts +38 -6
- package/dist/index.js +252 -156
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +236 -136
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createContext, useMemo, useContext, useCallback, useState, useEffect, useSyncExternalStore, Component, useRef } from 'react';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { StyleSheet, Platform,
|
|
3
|
+
import { StyleSheet, Platform, TouchableOpacity, Text, View, ActivityIndicator, Modal, Animated } from 'react-native';
|
|
4
|
+
import { Skeleton } from '@dloizides/ui-motion';
|
|
4
5
|
|
|
5
6
|
// src/context/FeedbackUiContext.tsx
|
|
6
7
|
var DEFAULT_FEEDBACK_VALUE = {
|
|
@@ -57,57 +58,146 @@ var FEEDBACK_TEST_IDS = {
|
|
|
57
58
|
warmingOverlay: "warming-overlay",
|
|
58
59
|
errorBoundary: "error-boundary"
|
|
59
60
|
};
|
|
60
|
-
var
|
|
61
|
-
var
|
|
61
|
+
var WELL_SIZE = 56;
|
|
62
|
+
var WELL_MARGIN_BOTTOM = 16;
|
|
63
|
+
var WELL_TINT_OPACITY = 0.12;
|
|
62
64
|
var BUTTON_MARGIN_TOP = 12;
|
|
63
65
|
var BUTTON_PADDING_V = 8;
|
|
64
66
|
var BUTTON_PADDING_H = 16;
|
|
65
67
|
var BUTTON_BORDER_RADIUS = 6;
|
|
68
|
+
var BUTTON_BORDER_WIDTH = 1;
|
|
66
69
|
var BUTTON_FONT_SIZE = 14;
|
|
67
70
|
var styles = StyleSheet.create({
|
|
71
|
+
well: {
|
|
72
|
+
width: WELL_SIZE,
|
|
73
|
+
height: WELL_SIZE,
|
|
74
|
+
borderRadius: WELL_SIZE / 2,
|
|
75
|
+
marginBottom: WELL_MARGIN_BOTTOM,
|
|
76
|
+
alignItems: "center",
|
|
77
|
+
justifyContent: "center",
|
|
78
|
+
overflow: "hidden"
|
|
79
|
+
},
|
|
80
|
+
wellTint: {
|
|
81
|
+
...StyleSheet.absoluteFillObject,
|
|
82
|
+
opacity: WELL_TINT_OPACITY
|
|
83
|
+
},
|
|
84
|
+
secondaryButton: {
|
|
85
|
+
marginTop: BUTTON_MARGIN_TOP,
|
|
86
|
+
paddingVertical: BUTTON_PADDING_V,
|
|
87
|
+
paddingHorizontal: BUTTON_PADDING_H,
|
|
88
|
+
borderRadius: BUTTON_BORDER_RADIUS,
|
|
89
|
+
borderWidth: BUTTON_BORDER_WIDTH
|
|
90
|
+
},
|
|
91
|
+
secondaryText: {
|
|
92
|
+
fontSize: BUTTON_FONT_SIZE,
|
|
93
|
+
fontWeight: "600"
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
var ErrorStateIconWell = ({ icon, tint, testID }) => /* @__PURE__ */ jsxs(View, { "aria-hidden": true, style: styles.well, testID, children: [
|
|
97
|
+
/* @__PURE__ */ jsx(View, { style: [styles.wellTint, { backgroundColor: tint }] }),
|
|
98
|
+
icon
|
|
99
|
+
] });
|
|
100
|
+
var ErrorStateSecondaryButton = ({
|
|
101
|
+
action,
|
|
102
|
+
theme
|
|
103
|
+
}) => /* @__PURE__ */ jsx(
|
|
104
|
+
TouchableOpacity,
|
|
105
|
+
{
|
|
106
|
+
accessibilityHint: action.hint,
|
|
107
|
+
accessibilityLabel: action.label,
|
|
108
|
+
accessibilityRole: "button",
|
|
109
|
+
style: [styles.secondaryButton, { borderColor: theme.colors.border }],
|
|
110
|
+
testID: action.testID,
|
|
111
|
+
onPress: action.onPress,
|
|
112
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles.secondaryText, { color: theme.colors.text }], children: action.label })
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
var MESSAGE_FONT_SIZE = 16;
|
|
116
|
+
var CONTAINER_PADDING = 20;
|
|
117
|
+
var BUTTON_MARGIN_TOP2 = 12;
|
|
118
|
+
var BUTTON_PADDING_V2 = 8;
|
|
119
|
+
var BUTTON_PADDING_H2 = 16;
|
|
120
|
+
var BUTTON_BORDER_RADIUS2 = 6;
|
|
121
|
+
var BUTTON_FONT_SIZE2 = 14;
|
|
122
|
+
var TITLE_FONT_SIZE = 20;
|
|
123
|
+
var TITLE_MARGIN_BOTTOM = 8;
|
|
124
|
+
var ACTION_GAP = 12;
|
|
125
|
+
var styles2 = StyleSheet.create({
|
|
68
126
|
container: {
|
|
69
127
|
flex: 1,
|
|
70
128
|
justifyContent: "center",
|
|
71
129
|
alignItems: "center",
|
|
72
130
|
padding: CONTAINER_PADDING
|
|
73
131
|
},
|
|
132
|
+
title: {
|
|
133
|
+
fontSize: TITLE_FONT_SIZE,
|
|
134
|
+
fontWeight: "600",
|
|
135
|
+
textAlign: "center",
|
|
136
|
+
marginBottom: TITLE_MARGIN_BOTTOM
|
|
137
|
+
},
|
|
74
138
|
message: {
|
|
75
139
|
fontSize: MESSAGE_FONT_SIZE,
|
|
76
140
|
textAlign: "center"
|
|
77
141
|
},
|
|
142
|
+
actions: {
|
|
143
|
+
flexDirection: "row",
|
|
144
|
+
flexWrap: "wrap",
|
|
145
|
+
justifyContent: "center",
|
|
146
|
+
columnGap: ACTION_GAP
|
|
147
|
+
},
|
|
78
148
|
retryButton: {
|
|
79
|
-
marginTop:
|
|
80
|
-
paddingVertical:
|
|
81
|
-
paddingHorizontal:
|
|
82
|
-
borderRadius:
|
|
149
|
+
marginTop: BUTTON_MARGIN_TOP2,
|
|
150
|
+
paddingVertical: BUTTON_PADDING_V2,
|
|
151
|
+
paddingHorizontal: BUTTON_PADDING_H2,
|
|
152
|
+
borderRadius: BUTTON_BORDER_RADIUS2
|
|
83
153
|
},
|
|
84
154
|
retryText: {
|
|
85
|
-
fontSize:
|
|
155
|
+
fontSize: BUTTON_FONT_SIZE2,
|
|
86
156
|
fontWeight: "600"
|
|
87
157
|
}
|
|
88
158
|
});
|
|
89
159
|
var ErrorState = ({
|
|
90
160
|
message,
|
|
91
161
|
onRetry,
|
|
92
|
-
testID = FEEDBACK_TEST_IDS.errorState
|
|
162
|
+
testID = FEEDBACK_TEST_IDS.errorState,
|
|
163
|
+
title,
|
|
164
|
+
icon,
|
|
165
|
+
secondaryAction
|
|
93
166
|
}) => {
|
|
94
167
|
const { theme, t } = useFeedbackUi();
|
|
95
168
|
const errorColor = theme.semantic.error["500"];
|
|
96
169
|
const primary = theme.palette.primary["500"];
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
170
|
+
const hasTitle = typeof title === "string" && title !== "";
|
|
171
|
+
const hasIcon = icon !== void 0 && icon !== null;
|
|
172
|
+
const messageColor = hasTitle ? theme.colors.textSecondary : errorColor;
|
|
173
|
+
const retry = typeof onRetry === "function" ? /* @__PURE__ */ jsx(
|
|
174
|
+
TouchableOpacity,
|
|
175
|
+
{
|
|
176
|
+
accessibilityHint: t("common.retryHint"),
|
|
177
|
+
accessibilityLabel: t("common.retry"),
|
|
178
|
+
accessibilityRole: "button",
|
|
179
|
+
style: [styles2.retryButton, { backgroundColor: primary }],
|
|
180
|
+
testID: FEEDBACK_TEST_IDS.errorStateRetry,
|
|
181
|
+
onPress: onRetry,
|
|
182
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles2.retryText, { color: theme.colors.surfaceElevated }], children: t("common.retry") })
|
|
183
|
+
}
|
|
184
|
+
) : null;
|
|
185
|
+
return /* @__PURE__ */ jsxs(View, { style: styles2.container, testID, children: [
|
|
186
|
+
hasIcon ? /* @__PURE__ */ jsx(ErrorStateIconWell, { icon, testID: `${testID}-icon`, tint: errorColor }) : null,
|
|
187
|
+
hasTitle ? /* @__PURE__ */ jsx(
|
|
188
|
+
Text,
|
|
101
189
|
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
testID: FEEDBACK_TEST_IDS.errorStateRetry,
|
|
107
|
-
onPress: onRetry,
|
|
108
|
-
children: /* @__PURE__ */ jsx(Text, { style: [styles.retryText, { color: theme.colors.surfaceElevated }], children: t("common.retry") })
|
|
190
|
+
accessibilityRole: "header",
|
|
191
|
+
style: [styles2.title, { color: theme.colors.text }],
|
|
192
|
+
testID: `${testID}-title`,
|
|
193
|
+
children: title
|
|
109
194
|
}
|
|
110
|
-
) : null
|
|
195
|
+
) : null,
|
|
196
|
+
/* @__PURE__ */ jsx(Text, { style: [styles2.message, { color: messageColor }], children: message }),
|
|
197
|
+
secondaryAction === void 0 ? retry : /* @__PURE__ */ jsxs(View, { style: styles2.actions, children: [
|
|
198
|
+
retry,
|
|
199
|
+
/* @__PURE__ */ jsx(ErrorStateSecondaryButton, { action: secondaryAction, theme })
|
|
200
|
+
] })
|
|
111
201
|
] });
|
|
112
202
|
};
|
|
113
203
|
var MESSAGE_FONT_SIZE2 = 16;
|
|
@@ -117,7 +207,7 @@ var CTA_PADDING_HORIZONTAL = 20;
|
|
|
117
207
|
var CTA_BORDER_RADIUS = 8;
|
|
118
208
|
var CTA_FONT_SIZE = 14;
|
|
119
209
|
var CONTAINER_PADDING2 = 32;
|
|
120
|
-
var
|
|
210
|
+
var styles3 = StyleSheet.create({
|
|
121
211
|
container: {
|
|
122
212
|
flex: 1,
|
|
123
213
|
justifyContent: "center",
|
|
@@ -153,25 +243,25 @@ var EmptyListState = ({
|
|
|
153
243
|
if (typeof ctaRoute === "string" && typeof navigate === "function") navigate(ctaRoute);
|
|
154
244
|
}, [navigate, ctaRoute]);
|
|
155
245
|
const showCta = typeof ctaTextKey === "string" && typeof ctaHintKey === "string" && typeof ctaRoute === "string";
|
|
156
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
157
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
246
|
+
return /* @__PURE__ */ jsxs(View, { style: styles3.container, testID, children: [
|
|
247
|
+
/* @__PURE__ */ jsx(Text, { style: [styles3.message, { color: colors.textSecondary }], children: t(messageKey) }),
|
|
158
248
|
showCta ? /* @__PURE__ */ jsx(
|
|
159
249
|
TouchableOpacity,
|
|
160
250
|
{
|
|
161
251
|
accessibilityHint: t(ctaHintKey),
|
|
162
252
|
accessibilityLabel: t(ctaTextKey),
|
|
163
253
|
accessibilityRole: "button",
|
|
164
|
-
style: [
|
|
254
|
+
style: [styles3.ctaButton, { backgroundColor: primary }],
|
|
165
255
|
testID: FEEDBACK_TEST_IDS.emptyListCta,
|
|
166
256
|
onPress: handlePress,
|
|
167
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
257
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles3.ctaText, { color: colors.background }], children: t(ctaTextKey) })
|
|
168
258
|
}
|
|
169
259
|
) : null
|
|
170
260
|
] });
|
|
171
261
|
};
|
|
172
262
|
var FULLSCREEN_MIN_HEIGHT = 300;
|
|
173
263
|
var CONTAINER_MIN_HEIGHT = 100;
|
|
174
|
-
var
|
|
264
|
+
var styles4 = StyleSheet.create({
|
|
175
265
|
container: {
|
|
176
266
|
flex: 1,
|
|
177
267
|
justifyContent: "center",
|
|
@@ -192,36 +282,36 @@ var LoadingFallback = ({ fullScreen = false, size = "large" }) => {
|
|
|
192
282
|
accessibilityHint: t("loadingFallback.hint"),
|
|
193
283
|
accessibilityLabel: t("loadingFallback.label"),
|
|
194
284
|
accessibilityRole: "progressbar",
|
|
195
|
-
style: [
|
|
285
|
+
style: [styles4.container, fullScreen && styles4.fullScreen, { backgroundColor: colors.background }],
|
|
196
286
|
testID: FEEDBACK_TEST_IDS.loadingFallback,
|
|
197
287
|
children: /* @__PURE__ */ jsx(ActivityIndicator, { color: primary, size })
|
|
198
288
|
}
|
|
199
289
|
);
|
|
200
290
|
};
|
|
201
|
-
var ANIMATION_DURATION_MS = 1200;
|
|
202
291
|
var SKELETON_BORDER_RADIUS = 4;
|
|
203
|
-
var
|
|
204
|
-
var SKELETON_OPACITY_END = 0.7;
|
|
292
|
+
var CARD_BORDER_RADIUS = 8;
|
|
205
293
|
var DEFAULT_ROWS = 5;
|
|
206
|
-
var
|
|
294
|
+
var HEADER_HEIGHT = 32;
|
|
295
|
+
var HEADER_WIDTH = "60%";
|
|
296
|
+
var AVATAR_SIZE = 48;
|
|
297
|
+
var AVATAR_BORDER_RADIUS = 24;
|
|
298
|
+
var TEXT_LINE_HEIGHT = 16;
|
|
299
|
+
var TEXT_LINE_FULL_WIDTH = "100%";
|
|
300
|
+
var TEXT_LINE_SHORT_WIDTH = "70%";
|
|
301
|
+
var CARD_HEIGHT = 120;
|
|
302
|
+
var styles5 = StyleSheet.create({
|
|
207
303
|
container: {
|
|
208
304
|
flex: 1,
|
|
209
305
|
padding: 16
|
|
210
306
|
},
|
|
211
307
|
header: {
|
|
212
|
-
|
|
213
|
-
borderRadius: SKELETON_BORDER_RADIUS,
|
|
214
|
-
marginBottom: 24,
|
|
215
|
-
width: "60%"
|
|
308
|
+
marginBottom: 24
|
|
216
309
|
},
|
|
217
310
|
row: {
|
|
218
311
|
flexDirection: "row",
|
|
219
312
|
marginBottom: 16
|
|
220
313
|
},
|
|
221
314
|
avatar: {
|
|
222
|
-
width: 48,
|
|
223
|
-
height: 48,
|
|
224
|
-
borderRadius: 24,
|
|
225
315
|
marginRight: 12
|
|
226
316
|
},
|
|
227
317
|
textContainer: {
|
|
@@ -229,19 +319,9 @@ var styles4 = StyleSheet.create({
|
|
|
229
319
|
justifyContent: "center"
|
|
230
320
|
},
|
|
231
321
|
textLine: {
|
|
232
|
-
height: 16,
|
|
233
|
-
borderRadius: SKELETON_BORDER_RADIUS,
|
|
234
322
|
marginBottom: 8
|
|
235
323
|
},
|
|
236
|
-
textLineShort: {
|
|
237
|
-
width: "70%"
|
|
238
|
-
},
|
|
239
|
-
textLineFull: {
|
|
240
|
-
width: "100%"
|
|
241
|
-
},
|
|
242
324
|
card: {
|
|
243
|
-
height: 120,
|
|
244
|
-
borderRadius: 8,
|
|
245
325
|
marginBottom: 16
|
|
246
326
|
}
|
|
247
327
|
});
|
|
@@ -252,40 +332,51 @@ var PageSkeleton = ({
|
|
|
252
332
|
}) => {
|
|
253
333
|
const { theme, t } = useFeedbackUi();
|
|
254
334
|
const colors = theme.colors;
|
|
255
|
-
const animatedValue = React3.useRef(new Animated.Value(0)).current;
|
|
256
|
-
React3.useEffect(() => {
|
|
257
|
-
const animation = Animated.loop(
|
|
258
|
-
Animated.sequence([
|
|
259
|
-
Animated.timing(animatedValue, {
|
|
260
|
-
toValue: 1,
|
|
261
|
-
duration: ANIMATION_DURATION_MS,
|
|
262
|
-
easing: Easing.inOut(Easing.ease),
|
|
263
|
-
useNativeDriver: Platform.OS !== "web"
|
|
264
|
-
}),
|
|
265
|
-
Animated.timing(animatedValue, {
|
|
266
|
-
toValue: 0,
|
|
267
|
-
duration: ANIMATION_DURATION_MS,
|
|
268
|
-
easing: Easing.inOut(Easing.ease),
|
|
269
|
-
useNativeDriver: Platform.OS !== "web"
|
|
270
|
-
})
|
|
271
|
-
])
|
|
272
|
-
);
|
|
273
|
-
animation.start();
|
|
274
|
-
return () => animation.stop();
|
|
275
|
-
}, [animatedValue]);
|
|
276
|
-
const opacity = animatedValue.interpolate({
|
|
277
|
-
inputRange: [0, 1],
|
|
278
|
-
outputRange: [SKELETON_OPACITY_START, SKELETON_OPACITY_END]
|
|
279
|
-
});
|
|
280
335
|
const skeletonColor = String(colors.border);
|
|
281
|
-
const renderListRow = (index) => /* @__PURE__ */ jsxs(View, { style:
|
|
282
|
-
/* @__PURE__ */ jsx(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
336
|
+
const renderListRow = (index) => /* @__PURE__ */ jsxs(View, { style: styles5.row, children: [
|
|
337
|
+
/* @__PURE__ */ jsx(
|
|
338
|
+
Skeleton,
|
|
339
|
+
{
|
|
340
|
+
backgroundColor: skeletonColor,
|
|
341
|
+
borderRadius: AVATAR_BORDER_RADIUS,
|
|
342
|
+
height: AVATAR_SIZE,
|
|
343
|
+
style: styles5.avatar,
|
|
344
|
+
width: AVATAR_SIZE
|
|
345
|
+
}
|
|
346
|
+
),
|
|
347
|
+
/* @__PURE__ */ jsxs(View, { style: styles5.textContainer, children: [
|
|
348
|
+
/* @__PURE__ */ jsx(
|
|
349
|
+
Skeleton,
|
|
350
|
+
{
|
|
351
|
+
backgroundColor: skeletonColor,
|
|
352
|
+
borderRadius: SKELETON_BORDER_RADIUS,
|
|
353
|
+
height: TEXT_LINE_HEIGHT,
|
|
354
|
+
style: styles5.textLine,
|
|
355
|
+
width: TEXT_LINE_FULL_WIDTH
|
|
356
|
+
}
|
|
357
|
+
),
|
|
358
|
+
/* @__PURE__ */ jsx(
|
|
359
|
+
Skeleton,
|
|
360
|
+
{
|
|
361
|
+
backgroundColor: skeletonColor,
|
|
362
|
+
borderRadius: SKELETON_BORDER_RADIUS,
|
|
363
|
+
height: TEXT_LINE_HEIGHT,
|
|
364
|
+
style: styles5.textLine,
|
|
365
|
+
width: TEXT_LINE_SHORT_WIDTH
|
|
366
|
+
}
|
|
367
|
+
)
|
|
286
368
|
] })
|
|
287
369
|
] }, index);
|
|
288
|
-
const renderCard = (index) => /* @__PURE__ */ jsx(
|
|
370
|
+
const renderCard = (index) => /* @__PURE__ */ jsx(
|
|
371
|
+
Skeleton,
|
|
372
|
+
{
|
|
373
|
+
backgroundColor: skeletonColor,
|
|
374
|
+
borderRadius: CARD_BORDER_RADIUS,
|
|
375
|
+
height: CARD_HEIGHT,
|
|
376
|
+
style: styles5.card
|
|
377
|
+
},
|
|
378
|
+
index
|
|
379
|
+
);
|
|
289
380
|
const rowElements = Array.from({ length: rows }, (_, i) => variant === "cards" ? renderCard(i) : renderListRow(i));
|
|
290
381
|
return /* @__PURE__ */ jsxs(
|
|
291
382
|
View,
|
|
@@ -293,10 +384,19 @@ var PageSkeleton = ({
|
|
|
293
384
|
accessibilityHint: t("pageSkeleton.loadingHint"),
|
|
294
385
|
accessibilityLabel: t("pageSkeleton.loadingLabel"),
|
|
295
386
|
accessibilityState: { busy: true },
|
|
296
|
-
style: [
|
|
387
|
+
style: [styles5.container, { backgroundColor: colors.background }],
|
|
297
388
|
testID: FEEDBACK_TEST_IDS.pageSkeleton,
|
|
298
389
|
children: [
|
|
299
|
-
showHeader ? /* @__PURE__ */ jsx(
|
|
390
|
+
showHeader ? /* @__PURE__ */ jsx(
|
|
391
|
+
Skeleton,
|
|
392
|
+
{
|
|
393
|
+
backgroundColor: skeletonColor,
|
|
394
|
+
borderRadius: SKELETON_BORDER_RADIUS,
|
|
395
|
+
height: HEADER_HEIGHT,
|
|
396
|
+
style: styles5.header,
|
|
397
|
+
width: HEADER_WIDTH
|
|
398
|
+
}
|
|
399
|
+
) : null,
|
|
300
400
|
rowElements
|
|
301
401
|
]
|
|
302
402
|
}
|
|
@@ -318,7 +418,7 @@ var AsyncSurface = ({
|
|
|
318
418
|
return children;
|
|
319
419
|
};
|
|
320
420
|
var DIALOG_MAX_WIDTH = 400;
|
|
321
|
-
var
|
|
421
|
+
var styles6 = StyleSheet.create({
|
|
322
422
|
overlay: {
|
|
323
423
|
flex: 1,
|
|
324
424
|
backgroundColor: MODAL_OVERLAY_COLOR,
|
|
@@ -408,17 +508,17 @@ var ConfirmDialog = ({
|
|
|
408
508
|
animationType: "fade",
|
|
409
509
|
visible,
|
|
410
510
|
onRequestClose: onCancel,
|
|
411
|
-
children: /* @__PURE__ */ jsx(View, { style:
|
|
511
|
+
children: /* @__PURE__ */ jsx(View, { style: styles6.overlay, testID: FEEDBACK_TEST_IDS.confirmDialog, children: /* @__PURE__ */ jsxs(
|
|
412
512
|
View,
|
|
413
513
|
{
|
|
414
514
|
accessibilityViewIsModal: true,
|
|
415
515
|
"aria-label": title,
|
|
416
516
|
role: "dialog",
|
|
417
|
-
style: [
|
|
517
|
+
style: [styles6.dialog, colorStyles.dialog],
|
|
418
518
|
children: [
|
|
419
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
420
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
421
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
519
|
+
/* @__PURE__ */ jsx(Text, { style: [styles6.title, colorStyles.title], children: title }),
|
|
520
|
+
/* @__PURE__ */ jsx(Text, { style: [styles6.message, colorStyles.message], children: message }),
|
|
521
|
+
/* @__PURE__ */ jsxs(View, { style: styles6.buttonRow, children: [
|
|
422
522
|
/* @__PURE__ */ jsx(
|
|
423
523
|
TouchableOpacity,
|
|
424
524
|
{
|
|
@@ -426,13 +526,13 @@ var ConfirmDialog = ({
|
|
|
426
526
|
accessibilityLabel: resolvedCancelLabel,
|
|
427
527
|
accessibilityRole: "button",
|
|
428
528
|
style: [
|
|
429
|
-
|
|
430
|
-
|
|
529
|
+
styles6.button,
|
|
530
|
+
styles6.cancelButton,
|
|
431
531
|
colorStyles.cancelButton
|
|
432
532
|
],
|
|
433
533
|
testID: FEEDBACK_TEST_IDS.cancelConfirmButton,
|
|
434
534
|
onPress: onCancel,
|
|
435
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
535
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles6.buttonText, colorStyles.cancelButtonText], children: resolvedCancelLabel })
|
|
436
536
|
}
|
|
437
537
|
),
|
|
438
538
|
/* @__PURE__ */ jsx(
|
|
@@ -444,10 +544,10 @@ var ConfirmDialog = ({
|
|
|
444
544
|
accessibilityState: { disabled: isConfirmDisabled },
|
|
445
545
|
disabled: isConfirmDisabled,
|
|
446
546
|
style: [
|
|
447
|
-
|
|
448
|
-
|
|
547
|
+
styles6.button,
|
|
548
|
+
styles6.confirmButton,
|
|
449
549
|
colorStyles.confirmButton,
|
|
450
|
-
isConfirmDisabled &&
|
|
550
|
+
isConfirmDisabled && styles6.disabledButton
|
|
451
551
|
],
|
|
452
552
|
testID: FEEDBACK_TEST_IDS.confirmButton,
|
|
453
553
|
onPress: onConfirm,
|
|
@@ -461,7 +561,7 @@ var ConfirmDialog = ({
|
|
|
461
561
|
) : /* @__PURE__ */ jsx(
|
|
462
562
|
Text,
|
|
463
563
|
{
|
|
464
|
-
style: [
|
|
564
|
+
style: [styles6.buttonText, colorStyles.confirmButtonText],
|
|
465
565
|
children: resolvedConfirmLabel
|
|
466
566
|
}
|
|
467
567
|
)
|
|
@@ -493,7 +593,7 @@ var C1_CONTROL_END = 159;
|
|
|
493
593
|
var ZERO_WIDTH_START = 8203;
|
|
494
594
|
var ZERO_WIDTH_END = 8207;
|
|
495
595
|
var BYTE_ORDER_MARK = 65279;
|
|
496
|
-
var
|
|
596
|
+
var styles7 = StyleSheet.create({
|
|
497
597
|
container: {
|
|
498
598
|
position: "absolute",
|
|
499
599
|
top: Platform.OS === "web" ? TOAST_TOP_WEB : TOAST_TOP_MOBILE,
|
|
@@ -558,9 +658,9 @@ var ToastItem = ({ message, onDone, colors, durationMs, fadeMs, testID }) => {
|
|
|
558
658
|
{
|
|
559
659
|
accessibilityLiveRegion: isError ? "assertive" : "polite",
|
|
560
660
|
role: isError ? "alert" : "status",
|
|
561
|
-
style: [
|
|
661
|
+
style: [styles7.toast, { backgroundColor, transform: [{ translateY }], opacity }],
|
|
562
662
|
testID,
|
|
563
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
663
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles7.text, { color: colors.text }], children: message.text })
|
|
564
664
|
}
|
|
565
665
|
);
|
|
566
666
|
};
|
|
@@ -598,7 +698,7 @@ var ToastHost = ({
|
|
|
598
698
|
}, []);
|
|
599
699
|
useEffect(() => subscribe(push), [subscribe, push]);
|
|
600
700
|
if (messages.length === 0) return null;
|
|
601
|
-
return /* @__PURE__ */ jsx(View, { style:
|
|
701
|
+
return /* @__PURE__ */ jsx(View, { style: styles7.container, children: messages.map((m) => /* @__PURE__ */ jsx(
|
|
602
702
|
ToastItem,
|
|
603
703
|
{
|
|
604
704
|
colors,
|
|
@@ -669,12 +769,12 @@ function getWarmingSnapshot() {
|
|
|
669
769
|
}
|
|
670
770
|
var OVERLAY_Z_INDEX = 1e5;
|
|
671
771
|
var CARD_GAP = 12;
|
|
672
|
-
var
|
|
772
|
+
var TITLE_FONT_SIZE2 = 20;
|
|
673
773
|
var SUBTITLE_FONT_SIZE = 15;
|
|
674
774
|
var ATTEMPT_FONT_SIZE = 13;
|
|
675
775
|
var CARD_PADDING = 24;
|
|
676
776
|
var NO_ATTEMPT = 0;
|
|
677
|
-
var
|
|
777
|
+
var styles8 = StyleSheet.create({
|
|
678
778
|
overlay: {
|
|
679
779
|
position: "absolute",
|
|
680
780
|
top: 0,
|
|
@@ -693,7 +793,7 @@ var styles7 = StyleSheet.create({
|
|
|
693
793
|
maxWidth: 320
|
|
694
794
|
},
|
|
695
795
|
title: {
|
|
696
|
-
fontSize:
|
|
796
|
+
fontSize: TITLE_FONT_SIZE2,
|
|
697
797
|
fontWeight: "700",
|
|
698
798
|
textAlign: "center"
|
|
699
799
|
},
|
|
@@ -731,13 +831,13 @@ var WarmingOverlay = ({
|
|
|
731
831
|
{
|
|
732
832
|
accessibilityLabel: mergedLabels.accessibilityLabel,
|
|
733
833
|
accessibilityRole: "alert",
|
|
734
|
-
style: [
|
|
834
|
+
style: [styles8.overlay, { backgroundColor: colors.background }],
|
|
735
835
|
testID: testIdPrefix,
|
|
736
|
-
children: /* @__PURE__ */ jsxs(View, { style:
|
|
836
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles8.card, children: [
|
|
737
837
|
/* @__PURE__ */ jsx(ActivityIndicator, { color: primary, size: "large" }),
|
|
738
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
739
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
740
|
-
showHint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
838
|
+
/* @__PURE__ */ jsx(Text, { style: [styles8.title, { color: colors.text }], testID: `${testIdPrefix}-title`, children: mergedLabels.title }),
|
|
839
|
+
/* @__PURE__ */ jsx(Text, { style: [styles8.subtitle, { color: colors.textSecondary }], testID: `${testIdPrefix}-subtitle`, children: mergedLabels.subtitle }),
|
|
840
|
+
showHint ? /* @__PURE__ */ jsx(Text, { style: [styles8.attempt, { color: colors.textSecondary }], testID: `${testIdPrefix}-attempt`, children: mergedLabels.attemptHint(snapshot2.attempt) }) : null
|
|
741
841
|
] })
|
|
742
842
|
}
|
|
743
843
|
);
|
|
@@ -771,8 +871,8 @@ function createToastBus() {
|
|
|
771
871
|
}
|
|
772
872
|
var CONTAINER_PADDING3 = 20;
|
|
773
873
|
var CONTENT_MAX_WIDTH = 400;
|
|
774
|
-
var
|
|
775
|
-
var
|
|
874
|
+
var TITLE_FONT_SIZE3 = 24;
|
|
875
|
+
var TITLE_MARGIN_BOTTOM2 = 12;
|
|
776
876
|
var DETAILS_PADDING = 12;
|
|
777
877
|
var DETAILS_BORDER_RADIUS = 8;
|
|
778
878
|
var DETAILS_BORDER_WIDTH = 1;
|
|
@@ -780,12 +880,12 @@ var DETAILS_MARGIN_VERTICAL = 16;
|
|
|
780
880
|
var DETAILS_TITLE_FONT_SIZE = 14;
|
|
781
881
|
var DETAILS_TITLE_MARGIN_BOTTOM = 4;
|
|
782
882
|
var DETAILS_TEXT_FONT_SIZE = 12;
|
|
783
|
-
var
|
|
784
|
-
var
|
|
785
|
-
var
|
|
786
|
-
var
|
|
787
|
-
var
|
|
788
|
-
var
|
|
883
|
+
var BUTTON_PADDING_H3 = 24;
|
|
884
|
+
var BUTTON_PADDING_V3 = 12;
|
|
885
|
+
var BUTTON_BORDER_RADIUS3 = 8;
|
|
886
|
+
var BUTTON_MARGIN_TOP3 = 12;
|
|
887
|
+
var BUTTON_FONT_SIZE3 = 16;
|
|
888
|
+
var styles9 = StyleSheet.create({
|
|
789
889
|
container: {
|
|
790
890
|
flex: 1,
|
|
791
891
|
justifyContent: "center",
|
|
@@ -797,9 +897,9 @@ var styles8 = StyleSheet.create({
|
|
|
797
897
|
alignItems: "center"
|
|
798
898
|
},
|
|
799
899
|
title: {
|
|
800
|
-
fontSize:
|
|
900
|
+
fontSize: TITLE_FONT_SIZE3,
|
|
801
901
|
fontWeight: "bold",
|
|
802
|
-
marginBottom:
|
|
902
|
+
marginBottom: TITLE_MARGIN_BOTTOM2,
|
|
803
903
|
textAlign: "center"
|
|
804
904
|
},
|
|
805
905
|
details: {
|
|
@@ -819,13 +919,13 @@ var styles8 = StyleSheet.create({
|
|
|
819
919
|
fontFamily: "monospace"
|
|
820
920
|
},
|
|
821
921
|
button: {
|
|
822
|
-
paddingHorizontal:
|
|
823
|
-
paddingVertical:
|
|
824
|
-
borderRadius:
|
|
825
|
-
marginTop:
|
|
922
|
+
paddingHorizontal: BUTTON_PADDING_H3,
|
|
923
|
+
paddingVertical: BUTTON_PADDING_V3,
|
|
924
|
+
borderRadius: BUTTON_BORDER_RADIUS3,
|
|
925
|
+
marginTop: BUTTON_MARGIN_TOP3
|
|
826
926
|
},
|
|
827
927
|
buttonText: {
|
|
828
|
-
fontSize:
|
|
928
|
+
fontSize: BUTTON_FONT_SIZE3,
|
|
829
929
|
fontWeight: "600"
|
|
830
930
|
}
|
|
831
931
|
});
|
|
@@ -853,10 +953,10 @@ var ErrorBoundaryFallback = ({
|
|
|
853
953
|
accessibilityHint: labels.tryAgainHint,
|
|
854
954
|
accessibilityLabel: labels.tryAgain,
|
|
855
955
|
accessibilityRole: "button",
|
|
856
|
-
style: [
|
|
956
|
+
style: [styles9.button, reloadIsPrimary ? secondaryFill : primaryFill],
|
|
857
957
|
testID: `${testIDPrefix}-retry-button`,
|
|
858
958
|
onPress: onRetry,
|
|
859
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
959
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles9.buttonText, reloadIsPrimary ? secondaryInk : primaryInk], children: labels.tryAgain })
|
|
860
960
|
}
|
|
861
961
|
) : null;
|
|
862
962
|
const reloadButton = typeof onReload === "function" ? /* @__PURE__ */ jsx(
|
|
@@ -865,10 +965,10 @@ var ErrorBoundaryFallback = ({
|
|
|
865
965
|
accessibilityHint: labels.reloadHint,
|
|
866
966
|
accessibilityLabel: labels.reload,
|
|
867
967
|
accessibilityRole: "button",
|
|
868
|
-
style: [
|
|
968
|
+
style: [styles9.button, reloadIsPrimary ? primaryFill : secondaryFill],
|
|
869
969
|
testID: `${testIDPrefix}-reload-button`,
|
|
870
970
|
onPress: onReload,
|
|
871
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
971
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles9.buttonText, reloadIsPrimary ? primaryInk : secondaryInk], children: labels.reload })
|
|
872
972
|
}
|
|
873
973
|
) : null;
|
|
874
974
|
return /* @__PURE__ */ jsx(
|
|
@@ -876,19 +976,19 @@ var ErrorBoundaryFallback = ({
|
|
|
876
976
|
{
|
|
877
977
|
accessibilityLiveRegion: "assertive",
|
|
878
978
|
role: "alert",
|
|
879
|
-
style: [
|
|
979
|
+
style: [styles9.container, { backgroundColor: theme.colors.background }],
|
|
880
980
|
testID: testIDPrefix,
|
|
881
|
-
children: /* @__PURE__ */ jsxs(View, { style:
|
|
882
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
981
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles9.content, children: [
|
|
982
|
+
/* @__PURE__ */ jsx(Text, { style: [styles9.title, { color: theme.colors.text }], children: labels.title }),
|
|
883
983
|
/* @__PURE__ */ jsx(ErrorState, { message: labels.message, testID: `${testIDPrefix}-message` }),
|
|
884
984
|
hasDetails ? /* @__PURE__ */ jsxs(
|
|
885
985
|
View,
|
|
886
986
|
{
|
|
887
|
-
style: [
|
|
987
|
+
style: [styles9.details, { backgroundColor: theme.colors.surface, borderColor: warningColor }],
|
|
888
988
|
testID: `${testIDPrefix}-details`,
|
|
889
989
|
children: [
|
|
890
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
891
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
990
|
+
/* @__PURE__ */ jsx(Text, { style: [styles9.detailsTitle, { color: warningColor }], children: labels.errorDetails }),
|
|
991
|
+
/* @__PURE__ */ jsx(Text, { style: [styles9.detailsText, { color: theme.colors.textSecondary }], children: error.message })
|
|
892
992
|
]
|
|
893
993
|
}
|
|
894
994
|
) : null,
|
|
@@ -901,7 +1001,7 @@ var ErrorBoundaryFallback = ({
|
|
|
901
1001
|
var CONTAINER_PADDING4 = 20;
|
|
902
1002
|
var MESSAGE_FONT_SIZE3 = 16;
|
|
903
1003
|
var MESSAGE_MARGIN_TOP = 12;
|
|
904
|
-
var
|
|
1004
|
+
var styles10 = StyleSheet.create({
|
|
905
1005
|
container: {
|
|
906
1006
|
flex: 1,
|
|
907
1007
|
justifyContent: "center",
|
|
@@ -924,11 +1024,11 @@ var ErrorBoundaryRecovering = ({
|
|
|
924
1024
|
{
|
|
925
1025
|
accessibilityLiveRegion: "polite",
|
|
926
1026
|
role: "status",
|
|
927
|
-
style: [
|
|
1027
|
+
style: [styles10.container, { backgroundColor: theme.colors.background }],
|
|
928
1028
|
testID,
|
|
929
1029
|
children: [
|
|
930
1030
|
/* @__PURE__ */ jsx(ActivityIndicator, { color: theme.palette.primary["500"], size: "large" }),
|
|
931
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1031
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.message, { color: theme.colors.textSecondary }], children: message })
|
|
932
1032
|
]
|
|
933
1033
|
}
|
|
934
1034
|
);
|