@xsolla/xui-b2c-streaming-selector 0.217.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/README.md +3 -0
- package/native/index.d.mts +50 -0
- package/native/index.d.ts +50 -0
- package/native/index.js +635 -0
- package/native/index.js.map +1 -0
- package/native/index.mjs +615 -0
- package/native/index.mjs.map +1 -0
- package/package.json +57 -0
- package/web/index.d.mts +50 -0
- package/web/index.d.ts +50 -0
- package/web/index.js +4207 -0
- package/web/index.js.map +1 -0
- package/web/index.mjs +4193 -0
- package/web/index.mjs.map +1 -0
package/native/index.mjs
ADDED
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
// src/StreamingSelector.tsx
|
|
2
|
+
import { useCallback, useRef, useState } from "react";
|
|
3
|
+
|
|
4
|
+
// ../../foundation/primitives-native/src/Box.tsx
|
|
5
|
+
import {
|
|
6
|
+
View,
|
|
7
|
+
Pressable,
|
|
8
|
+
Image
|
|
9
|
+
} from "react-native";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var roleToAccessibilityRole = {
|
|
12
|
+
button: "button",
|
|
13
|
+
link: "link",
|
|
14
|
+
img: "image",
|
|
15
|
+
image: "image",
|
|
16
|
+
summary: "summary",
|
|
17
|
+
switch: "switch",
|
|
18
|
+
checkbox: "checkbox",
|
|
19
|
+
radio: "radio",
|
|
20
|
+
heading: "header",
|
|
21
|
+
text: "text",
|
|
22
|
+
search: "search",
|
|
23
|
+
alert: "alert",
|
|
24
|
+
none: "none",
|
|
25
|
+
presentation: "none",
|
|
26
|
+
progressbar: "progressbar",
|
|
27
|
+
scrollbar: "scrollbar",
|
|
28
|
+
adjustable: "adjustable",
|
|
29
|
+
tab: "tab",
|
|
30
|
+
menu: "menu",
|
|
31
|
+
menuitem: "menuitem",
|
|
32
|
+
list: "list",
|
|
33
|
+
timer: "timer"
|
|
34
|
+
};
|
|
35
|
+
var toGapValue = (gap) => {
|
|
36
|
+
if (gap === void 0) return void 0;
|
|
37
|
+
if (typeof gap === "number") return gap;
|
|
38
|
+
const pxMatch = /^(\d+(?:\.\d+)?)px$/.exec(gap);
|
|
39
|
+
if (pxMatch) return Number(pxMatch[1]);
|
|
40
|
+
const asNumber = Number(gap);
|
|
41
|
+
return Number.isFinite(asNumber) ? asNumber : void 0;
|
|
42
|
+
};
|
|
43
|
+
var Box = ({
|
|
44
|
+
children,
|
|
45
|
+
onPress,
|
|
46
|
+
onLayout,
|
|
47
|
+
onMoveShouldSetResponder,
|
|
48
|
+
onResponderGrant,
|
|
49
|
+
onResponderMove,
|
|
50
|
+
onResponderRelease,
|
|
51
|
+
onResponderTerminate,
|
|
52
|
+
backgroundColor,
|
|
53
|
+
borderColor,
|
|
54
|
+
borderWidth,
|
|
55
|
+
borderBottomWidth,
|
|
56
|
+
borderBottomColor,
|
|
57
|
+
borderTopWidth,
|
|
58
|
+
borderTopColor,
|
|
59
|
+
borderLeftWidth,
|
|
60
|
+
borderLeftColor,
|
|
61
|
+
borderRightWidth,
|
|
62
|
+
borderRightColor,
|
|
63
|
+
borderRadius,
|
|
64
|
+
borderStyle,
|
|
65
|
+
height,
|
|
66
|
+
padding,
|
|
67
|
+
paddingHorizontal,
|
|
68
|
+
paddingVertical,
|
|
69
|
+
margin,
|
|
70
|
+
marginTop,
|
|
71
|
+
marginBottom,
|
|
72
|
+
marginLeft,
|
|
73
|
+
marginRight,
|
|
74
|
+
flexDirection,
|
|
75
|
+
flexWrap,
|
|
76
|
+
alignItems,
|
|
77
|
+
justifyContent,
|
|
78
|
+
alignSelf,
|
|
79
|
+
position,
|
|
80
|
+
top,
|
|
81
|
+
bottom,
|
|
82
|
+
left,
|
|
83
|
+
right,
|
|
84
|
+
width,
|
|
85
|
+
minWidth,
|
|
86
|
+
minHeight,
|
|
87
|
+
maxWidth,
|
|
88
|
+
maxHeight,
|
|
89
|
+
flex,
|
|
90
|
+
flexShrink,
|
|
91
|
+
gap,
|
|
92
|
+
overflow,
|
|
93
|
+
opacity,
|
|
94
|
+
zIndex,
|
|
95
|
+
hoverStyle,
|
|
96
|
+
pressStyle,
|
|
97
|
+
style,
|
|
98
|
+
disabled,
|
|
99
|
+
"data-testid": dataTestId,
|
|
100
|
+
testID,
|
|
101
|
+
as,
|
|
102
|
+
src,
|
|
103
|
+
alt,
|
|
104
|
+
...rest
|
|
105
|
+
}) => {
|
|
106
|
+
const getContainerStyle = (pressed) => ({
|
|
107
|
+
backgroundColor: pressed && pressStyle?.backgroundColor ? pressStyle.backgroundColor : backgroundColor,
|
|
108
|
+
borderColor,
|
|
109
|
+
borderWidth,
|
|
110
|
+
borderBottomWidth,
|
|
111
|
+
borderBottomColor,
|
|
112
|
+
borderTopWidth,
|
|
113
|
+
borderTopColor,
|
|
114
|
+
borderLeftWidth,
|
|
115
|
+
borderLeftColor,
|
|
116
|
+
borderRightWidth,
|
|
117
|
+
borderRightColor,
|
|
118
|
+
borderRadius,
|
|
119
|
+
borderStyle,
|
|
120
|
+
overflow,
|
|
121
|
+
opacity: opacity ?? (disabled ? 0.5 : void 0),
|
|
122
|
+
zIndex,
|
|
123
|
+
height,
|
|
124
|
+
width,
|
|
125
|
+
minWidth,
|
|
126
|
+
minHeight,
|
|
127
|
+
maxWidth,
|
|
128
|
+
maxHeight,
|
|
129
|
+
padding,
|
|
130
|
+
paddingHorizontal,
|
|
131
|
+
paddingVertical,
|
|
132
|
+
margin,
|
|
133
|
+
marginTop,
|
|
134
|
+
marginBottom,
|
|
135
|
+
marginLeft,
|
|
136
|
+
marginRight,
|
|
137
|
+
flexDirection,
|
|
138
|
+
flexWrap,
|
|
139
|
+
alignItems,
|
|
140
|
+
justifyContent,
|
|
141
|
+
alignSelf,
|
|
142
|
+
position,
|
|
143
|
+
top,
|
|
144
|
+
bottom,
|
|
145
|
+
left,
|
|
146
|
+
right,
|
|
147
|
+
flex,
|
|
148
|
+
flexShrink,
|
|
149
|
+
gap: toGapValue(gap),
|
|
150
|
+
...style
|
|
151
|
+
});
|
|
152
|
+
const finalTestID = dataTestId || testID;
|
|
153
|
+
const {
|
|
154
|
+
role,
|
|
155
|
+
tabIndex,
|
|
156
|
+
onKeyDown,
|
|
157
|
+
onKeyUp,
|
|
158
|
+
"aria-label": ariaLabel,
|
|
159
|
+
"aria-labelledby": _ariaLabelledBy,
|
|
160
|
+
"aria-current": _ariaCurrent,
|
|
161
|
+
"aria-disabled": ariaDisabled,
|
|
162
|
+
"aria-live": ariaLive,
|
|
163
|
+
"aria-busy": ariaBusy,
|
|
164
|
+
className,
|
|
165
|
+
"data-testid": _dataTestId,
|
|
166
|
+
cursor: _cursor,
|
|
167
|
+
type: _type,
|
|
168
|
+
...nativeRest
|
|
169
|
+
} = rest;
|
|
170
|
+
const accessibilityRole = typeof role === "string" && roleToAccessibilityRole[role] || (as === "button" ? "button" : void 0);
|
|
171
|
+
const isDisabled = Boolean(disabled || ariaDisabled);
|
|
172
|
+
const accessibilityState = {
|
|
173
|
+
disabled: isDisabled || void 0,
|
|
174
|
+
busy: Boolean(ariaBusy) || void 0
|
|
175
|
+
};
|
|
176
|
+
const accessibilityLiveRegion = ariaLive === "polite" || ariaLive === "assertive" ? ariaLive : void 0;
|
|
177
|
+
if (as === "img" && src) {
|
|
178
|
+
const imageStyle = {
|
|
179
|
+
width,
|
|
180
|
+
height,
|
|
181
|
+
borderRadius,
|
|
182
|
+
position,
|
|
183
|
+
top,
|
|
184
|
+
bottom,
|
|
185
|
+
left,
|
|
186
|
+
right,
|
|
187
|
+
...style
|
|
188
|
+
};
|
|
189
|
+
return /* @__PURE__ */ jsx(
|
|
190
|
+
Image,
|
|
191
|
+
{
|
|
192
|
+
source: { uri: src },
|
|
193
|
+
style: imageStyle,
|
|
194
|
+
testID: finalTestID,
|
|
195
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : alt,
|
|
196
|
+
resizeMode: "cover",
|
|
197
|
+
...nativeRest
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
if (onPress || as === "button") {
|
|
202
|
+
return /* @__PURE__ */ jsx(
|
|
203
|
+
Pressable,
|
|
204
|
+
{
|
|
205
|
+
onPress: !isDisabled && onPress ? onPress : void 0,
|
|
206
|
+
disabled: isDisabled,
|
|
207
|
+
onLayout,
|
|
208
|
+
onMoveShouldSetResponder,
|
|
209
|
+
onResponderGrant,
|
|
210
|
+
onResponderMove,
|
|
211
|
+
onResponderRelease,
|
|
212
|
+
onResponderTerminate,
|
|
213
|
+
style: ({ pressed }) => getContainerStyle(pressed),
|
|
214
|
+
testID: finalTestID,
|
|
215
|
+
accessibilityRole,
|
|
216
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : void 0,
|
|
217
|
+
accessibilityState,
|
|
218
|
+
accessibilityLiveRegion,
|
|
219
|
+
...nativeRest,
|
|
220
|
+
children
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
return /* @__PURE__ */ jsx(
|
|
225
|
+
View,
|
|
226
|
+
{
|
|
227
|
+
style: getContainerStyle(),
|
|
228
|
+
testID: finalTestID,
|
|
229
|
+
onLayout,
|
|
230
|
+
onMoveShouldSetResponder,
|
|
231
|
+
onResponderGrant,
|
|
232
|
+
onResponderMove,
|
|
233
|
+
onResponderRelease,
|
|
234
|
+
onResponderTerminate,
|
|
235
|
+
accessibilityRole,
|
|
236
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : void 0,
|
|
237
|
+
accessibilityState,
|
|
238
|
+
accessibilityLiveRegion,
|
|
239
|
+
...nativeRest,
|
|
240
|
+
children
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
// ../../foundation/primitives-native/src/Text.tsx
|
|
246
|
+
import {
|
|
247
|
+
Text as RNText,
|
|
248
|
+
StyleSheet
|
|
249
|
+
} from "react-native";
|
|
250
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
251
|
+
var roleMap = {
|
|
252
|
+
alert: "alert",
|
|
253
|
+
heading: "header",
|
|
254
|
+
button: "button",
|
|
255
|
+
link: "link",
|
|
256
|
+
text: "text"
|
|
257
|
+
};
|
|
258
|
+
var parseNumericValue = (value) => {
|
|
259
|
+
if (value === void 0) return void 0;
|
|
260
|
+
if (typeof value === "number") return value;
|
|
261
|
+
const parsed = parseFloat(value);
|
|
262
|
+
return isNaN(parsed) ? void 0 : parsed;
|
|
263
|
+
};
|
|
264
|
+
var Text = ({
|
|
265
|
+
children,
|
|
266
|
+
color,
|
|
267
|
+
fontSize,
|
|
268
|
+
fontWeight,
|
|
269
|
+
fontFamily,
|
|
270
|
+
textAlign,
|
|
271
|
+
lineHeight,
|
|
272
|
+
numberOfLines,
|
|
273
|
+
id,
|
|
274
|
+
role,
|
|
275
|
+
testID,
|
|
276
|
+
"data-testid": dataTestId,
|
|
277
|
+
style: styleProp,
|
|
278
|
+
...props
|
|
279
|
+
}) => {
|
|
280
|
+
let resolvedFontFamily = fontFamily ? fontFamily.split(",")[0].replace(/['"]/g, "").trim() : void 0;
|
|
281
|
+
if (resolvedFontFamily === "Pilat Wide" || resolvedFontFamily === "Pilat Wide Bold" || resolvedFontFamily === "Aktiv Grotesk") {
|
|
282
|
+
resolvedFontFamily = void 0;
|
|
283
|
+
}
|
|
284
|
+
const incomingStyle = StyleSheet.flatten(styleProp);
|
|
285
|
+
const baseStyle = {
|
|
286
|
+
color: color ?? incomingStyle?.color,
|
|
287
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
288
|
+
fontWeight,
|
|
289
|
+
fontFamily: resolvedFontFamily,
|
|
290
|
+
textDecorationLine: props.textDecoration,
|
|
291
|
+
textAlign: textAlign ?? incomingStyle?.textAlign,
|
|
292
|
+
lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),
|
|
293
|
+
marginTop: parseNumericValue(
|
|
294
|
+
incomingStyle?.marginTop
|
|
295
|
+
),
|
|
296
|
+
marginBottom: parseNumericValue(
|
|
297
|
+
incomingStyle?.marginBottom
|
|
298
|
+
)
|
|
299
|
+
};
|
|
300
|
+
const accessibilityRole = role ? roleMap[role] : void 0;
|
|
301
|
+
return /* @__PURE__ */ jsx2(
|
|
302
|
+
RNText,
|
|
303
|
+
{
|
|
304
|
+
style: baseStyle,
|
|
305
|
+
numberOfLines,
|
|
306
|
+
testID: dataTestId || testID || id,
|
|
307
|
+
accessibilityRole,
|
|
308
|
+
children
|
|
309
|
+
}
|
|
310
|
+
);
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
// src/StreamingSelector.tsx
|
|
314
|
+
import { useResolvedTheme } from "@xsolla/xui-core";
|
|
315
|
+
import { Play } from "@xsolla/xui-icons";
|
|
316
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
317
|
+
var sizeConfig = {
|
|
318
|
+
desktop: {
|
|
319
|
+
width: 456,
|
|
320
|
+
coverHeight: 257,
|
|
321
|
+
footerPaddingX: 16,
|
|
322
|
+
footerPaddingY: 12,
|
|
323
|
+
footerGap: 12,
|
|
324
|
+
avatarSize: 40,
|
|
325
|
+
nameFontSize: 16,
|
|
326
|
+
nameLineHeight: 20,
|
|
327
|
+
metaFontSize: 12,
|
|
328
|
+
metaLineHeight: 16,
|
|
329
|
+
watchHeight: 36,
|
|
330
|
+
watchPaddingX: 12,
|
|
331
|
+
watchFontSize: 14,
|
|
332
|
+
watchIconSize: 14
|
|
333
|
+
},
|
|
334
|
+
mobile: {
|
|
335
|
+
width: 328,
|
|
336
|
+
coverHeight: 185,
|
|
337
|
+
footerPaddingX: 16,
|
|
338
|
+
footerPaddingY: 12,
|
|
339
|
+
footerGap: 12,
|
|
340
|
+
avatarSize: 32,
|
|
341
|
+
nameFontSize: 14,
|
|
342
|
+
nameLineHeight: 18,
|
|
343
|
+
metaFontSize: 12,
|
|
344
|
+
metaLineHeight: 16,
|
|
345
|
+
watchHeight: 32,
|
|
346
|
+
watchPaddingX: 10,
|
|
347
|
+
watchFontSize: 13,
|
|
348
|
+
watchIconSize: 13
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
var StreamingSelector = ({
|
|
352
|
+
streamerName,
|
|
353
|
+
gameName,
|
|
354
|
+
coverSrc,
|
|
355
|
+
coverAlt = "",
|
|
356
|
+
avatarSrc,
|
|
357
|
+
avatarAlt = "",
|
|
358
|
+
avatarFallback,
|
|
359
|
+
live = true,
|
|
360
|
+
liveLabel = "Live",
|
|
361
|
+
previewSlot,
|
|
362
|
+
watchLabel = "Watch",
|
|
363
|
+
watchIcon,
|
|
364
|
+
onWatchPress,
|
|
365
|
+
onPress,
|
|
366
|
+
platform = "desktop",
|
|
367
|
+
fullWidth = false,
|
|
368
|
+
disabled = false,
|
|
369
|
+
"aria-label": ariaLabel,
|
|
370
|
+
testID,
|
|
371
|
+
themeMode,
|
|
372
|
+
themeProductContext = "b2c"
|
|
373
|
+
}) => {
|
|
374
|
+
const { theme } = useResolvedTheme({ themeMode, themeProductContext });
|
|
375
|
+
const config = sizeConfig[platform];
|
|
376
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
377
|
+
const suppressCardPressRef = useRef(false);
|
|
378
|
+
const isInteractive = Boolean(onPress) && !disabled;
|
|
379
|
+
const isWatchInteractive = Boolean(onWatchPress) && !disabled;
|
|
380
|
+
const handleWatchPress = useCallback(() => {
|
|
381
|
+
if (!isWatchInteractive) return;
|
|
382
|
+
suppressCardPressRef.current = true;
|
|
383
|
+
onWatchPress?.();
|
|
384
|
+
}, [isWatchInteractive, onWatchPress]);
|
|
385
|
+
const handleCardPress = useCallback(() => {
|
|
386
|
+
if (suppressCardPressRef.current) {
|
|
387
|
+
suppressCardPressRef.current = false;
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
onPress?.();
|
|
391
|
+
}, [onPress]);
|
|
392
|
+
const showPreview = Boolean(previewSlot) && isHovered && platform === "desktop";
|
|
393
|
+
return /* @__PURE__ */ jsxs(
|
|
394
|
+
Box,
|
|
395
|
+
{
|
|
396
|
+
width: fullWidth ? "100%" : config.width,
|
|
397
|
+
maxWidth: "100%",
|
|
398
|
+
flexDirection: "column",
|
|
399
|
+
borderRadius: 4,
|
|
400
|
+
borderWidth: 1,
|
|
401
|
+
borderStyle: "solid",
|
|
402
|
+
borderColor: theme.colors.border.secondary,
|
|
403
|
+
backgroundColor: theme.colors.overlay.mono,
|
|
404
|
+
overflow: "hidden",
|
|
405
|
+
opacity: disabled ? 0.72 : 1,
|
|
406
|
+
cursor: isInteractive ? "pointer" : void 0,
|
|
407
|
+
role: isInteractive ? "button" : "group",
|
|
408
|
+
"aria-label": ariaLabel,
|
|
409
|
+
"aria-disabled": disabled || void 0,
|
|
410
|
+
tabIndex: isInteractive ? 0 : void 0,
|
|
411
|
+
onPress: isInteractive ? handleCardPress : void 0,
|
|
412
|
+
onMouseEnter: () => setIsHovered(true),
|
|
413
|
+
onMouseLeave: () => setIsHovered(false),
|
|
414
|
+
hoverStyle: isInteractive ? { backgroundColor: theme.colors.overlay.monoHover } : void 0,
|
|
415
|
+
testID: testID || "streaming-selector",
|
|
416
|
+
children: [
|
|
417
|
+
/* @__PURE__ */ jsxs(
|
|
418
|
+
Box,
|
|
419
|
+
{
|
|
420
|
+
width: "100%",
|
|
421
|
+
height: fullWidth ? void 0 : config.coverHeight,
|
|
422
|
+
position: "relative",
|
|
423
|
+
overflow: "hidden",
|
|
424
|
+
backgroundColor: theme.colors.background.secondary,
|
|
425
|
+
style: fullWidth ? { aspectRatio: "16 / 9" } : void 0,
|
|
426
|
+
children: [
|
|
427
|
+
showPreview ? /* @__PURE__ */ jsx3(
|
|
428
|
+
Box,
|
|
429
|
+
{
|
|
430
|
+
width: "100%",
|
|
431
|
+
height: "100%",
|
|
432
|
+
position: "absolute",
|
|
433
|
+
top: 0,
|
|
434
|
+
left: 0,
|
|
435
|
+
overflow: "hidden",
|
|
436
|
+
testID: "streaming-selector-preview",
|
|
437
|
+
children: previewSlot
|
|
438
|
+
}
|
|
439
|
+
) : coverSrc && /* @__PURE__ */ jsx3(
|
|
440
|
+
Box,
|
|
441
|
+
{
|
|
442
|
+
as: "img",
|
|
443
|
+
src: coverSrc,
|
|
444
|
+
alt: coverAlt,
|
|
445
|
+
width: "100%",
|
|
446
|
+
height: "100%",
|
|
447
|
+
testID: "streaming-selector-cover"
|
|
448
|
+
}
|
|
449
|
+
),
|
|
450
|
+
live && /* @__PURE__ */ jsxs(
|
|
451
|
+
Box,
|
|
452
|
+
{
|
|
453
|
+
position: "absolute",
|
|
454
|
+
top: 8,
|
|
455
|
+
left: 8,
|
|
456
|
+
zIndex: 2,
|
|
457
|
+
flexDirection: "row",
|
|
458
|
+
alignItems: "center",
|
|
459
|
+
gap: 4,
|
|
460
|
+
paddingHorizontal: 6,
|
|
461
|
+
paddingVertical: 3,
|
|
462
|
+
borderRadius: 4,
|
|
463
|
+
backgroundColor: theme.colors.layer.scrim,
|
|
464
|
+
testID: "streaming-selector-live-tag",
|
|
465
|
+
children: [
|
|
466
|
+
/* @__PURE__ */ jsx3(
|
|
467
|
+
Box,
|
|
468
|
+
{
|
|
469
|
+
width: 6,
|
|
470
|
+
height: 6,
|
|
471
|
+
borderRadius: 999,
|
|
472
|
+
backgroundColor: theme.colors.background.alert.primary
|
|
473
|
+
}
|
|
474
|
+
),
|
|
475
|
+
/* @__PURE__ */ jsx3(
|
|
476
|
+
Text,
|
|
477
|
+
{
|
|
478
|
+
color: theme.colors.content.static.light,
|
|
479
|
+
fontFamily: theme.fonts.body,
|
|
480
|
+
fontSize: 12,
|
|
481
|
+
lineHeight: 14,
|
|
482
|
+
fontWeight: "500",
|
|
483
|
+
numberOfLines: 1,
|
|
484
|
+
children: liveLabel
|
|
485
|
+
}
|
|
486
|
+
)
|
|
487
|
+
]
|
|
488
|
+
}
|
|
489
|
+
)
|
|
490
|
+
]
|
|
491
|
+
}
|
|
492
|
+
),
|
|
493
|
+
/* @__PURE__ */ jsxs(
|
|
494
|
+
Box,
|
|
495
|
+
{
|
|
496
|
+
width: "100%",
|
|
497
|
+
flexDirection: "row",
|
|
498
|
+
alignItems: "center",
|
|
499
|
+
gap: config.footerGap,
|
|
500
|
+
paddingHorizontal: config.footerPaddingX,
|
|
501
|
+
paddingVertical: config.footerPaddingY,
|
|
502
|
+
children: [
|
|
503
|
+
avatarSrc ? /* @__PURE__ */ jsx3(
|
|
504
|
+
Box,
|
|
505
|
+
{
|
|
506
|
+
as: "img",
|
|
507
|
+
src: avatarSrc,
|
|
508
|
+
alt: avatarAlt,
|
|
509
|
+
width: config.avatarSize,
|
|
510
|
+
height: config.avatarSize,
|
|
511
|
+
borderRadius: 999,
|
|
512
|
+
flexShrink: 0,
|
|
513
|
+
testID: "streaming-selector-avatar"
|
|
514
|
+
}
|
|
515
|
+
) : /* @__PURE__ */ jsx3(
|
|
516
|
+
Box,
|
|
517
|
+
{
|
|
518
|
+
width: config.avatarSize,
|
|
519
|
+
height: config.avatarSize,
|
|
520
|
+
borderRadius: 999,
|
|
521
|
+
flexShrink: 0,
|
|
522
|
+
alignItems: "center",
|
|
523
|
+
justifyContent: "center",
|
|
524
|
+
overflow: "hidden",
|
|
525
|
+
backgroundColor: theme.colors.background.neutral.secondary,
|
|
526
|
+
testID: "streaming-selector-avatar",
|
|
527
|
+
children: avatarFallback
|
|
528
|
+
}
|
|
529
|
+
),
|
|
530
|
+
/* @__PURE__ */ jsxs(Box, { flex: 1, minWidth: 0, flexDirection: "column", gap: 2, children: [
|
|
531
|
+
/* @__PURE__ */ jsx3(
|
|
532
|
+
Text,
|
|
533
|
+
{
|
|
534
|
+
color: theme.colors.content.primary,
|
|
535
|
+
fontFamily: theme.fonts.body,
|
|
536
|
+
fontSize: config.nameFontSize,
|
|
537
|
+
lineHeight: config.nameLineHeight,
|
|
538
|
+
fontWeight: "500",
|
|
539
|
+
numberOfLines: 1,
|
|
540
|
+
testID: "streaming-selector-name",
|
|
541
|
+
children: streamerName
|
|
542
|
+
}
|
|
543
|
+
),
|
|
544
|
+
gameName && /* @__PURE__ */ jsxs(
|
|
545
|
+
Text,
|
|
546
|
+
{
|
|
547
|
+
color: theme.colors.content.secondary,
|
|
548
|
+
fontFamily: theme.fonts.body,
|
|
549
|
+
fontSize: config.metaFontSize,
|
|
550
|
+
lineHeight: config.metaLineHeight,
|
|
551
|
+
numberOfLines: 1,
|
|
552
|
+
testID: "streaming-selector-game",
|
|
553
|
+
children: [
|
|
554
|
+
"Playing ",
|
|
555
|
+
gameName
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
)
|
|
559
|
+
] }),
|
|
560
|
+
/* @__PURE__ */ jsxs(
|
|
561
|
+
Box,
|
|
562
|
+
{
|
|
563
|
+
height: config.watchHeight,
|
|
564
|
+
flexShrink: 0,
|
|
565
|
+
flexDirection: "row",
|
|
566
|
+
alignItems: "center",
|
|
567
|
+
justifyContent: "center",
|
|
568
|
+
gap: 6,
|
|
569
|
+
paddingHorizontal: config.watchPaddingX,
|
|
570
|
+
borderRadius: 4,
|
|
571
|
+
backgroundColor: theme.colors.control.mono.secondary.bg,
|
|
572
|
+
cursor: isWatchInteractive ? "pointer" : void 0,
|
|
573
|
+
role: isWatchInteractive ? "button" : void 0,
|
|
574
|
+
"aria-disabled": disabled || void 0,
|
|
575
|
+
tabIndex: isWatchInteractive ? 0 : void 0,
|
|
576
|
+
onPress: isWatchInteractive ? handleWatchPress : void 0,
|
|
577
|
+
hoverStyle: isWatchInteractive ? { backgroundColor: theme.colors.control.mono.secondary.bgHover } : void 0,
|
|
578
|
+
pressStyle: {
|
|
579
|
+
backgroundColor: theme.colors.control.mono.secondary.bgPress
|
|
580
|
+
},
|
|
581
|
+
testID: "streaming-selector-watch",
|
|
582
|
+
children: [
|
|
583
|
+
watchIcon ?? /* @__PURE__ */ jsx3(
|
|
584
|
+
Play,
|
|
585
|
+
{
|
|
586
|
+
size: config.watchIconSize,
|
|
587
|
+
color: theme.colors.control.mono.text.secondary
|
|
588
|
+
}
|
|
589
|
+
),
|
|
590
|
+
/* @__PURE__ */ jsx3(
|
|
591
|
+
Text,
|
|
592
|
+
{
|
|
593
|
+
color: theme.colors.control.mono.text.secondary,
|
|
594
|
+
fontFamily: theme.fonts.body,
|
|
595
|
+
fontSize: config.watchFontSize,
|
|
596
|
+
lineHeight: config.watchFontSize + 4,
|
|
597
|
+
fontWeight: "500",
|
|
598
|
+
numberOfLines: 1,
|
|
599
|
+
children: watchLabel
|
|
600
|
+
}
|
|
601
|
+
)
|
|
602
|
+
]
|
|
603
|
+
}
|
|
604
|
+
)
|
|
605
|
+
]
|
|
606
|
+
}
|
|
607
|
+
)
|
|
608
|
+
]
|
|
609
|
+
}
|
|
610
|
+
);
|
|
611
|
+
};
|
|
612
|
+
export {
|
|
613
|
+
StreamingSelector
|
|
614
|
+
};
|
|
615
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/StreamingSelector.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx"],"sourcesContent":["import React, { useCallback, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme } from \"@xsolla/xui-core\";\nimport { Play } from \"@xsolla/xui-icons\";\nimport type { StreamingSelectorPlatform, StreamingSelectorProps } from \"./types\";\n\nconst sizeConfig: Record<\n StreamingSelectorPlatform,\n {\n width: number;\n coverHeight: number;\n footerPaddingX: number;\n footerPaddingY: number;\n footerGap: number;\n avatarSize: number;\n nameFontSize: number;\n nameLineHeight: number;\n metaFontSize: number;\n metaLineHeight: number;\n watchHeight: number;\n watchPaddingX: number;\n watchFontSize: number;\n watchIconSize: number;\n }\n> = {\n desktop: {\n width: 456,\n coverHeight: 257,\n footerPaddingX: 16,\n footerPaddingY: 12,\n footerGap: 12,\n avatarSize: 40,\n nameFontSize: 16,\n nameLineHeight: 20,\n metaFontSize: 12,\n metaLineHeight: 16,\n watchHeight: 36,\n watchPaddingX: 12,\n watchFontSize: 14,\n watchIconSize: 14,\n },\n mobile: {\n width: 328,\n coverHeight: 185,\n footerPaddingX: 16,\n footerPaddingY: 12,\n footerGap: 12,\n avatarSize: 32,\n nameFontSize: 14,\n nameLineHeight: 18,\n metaFontSize: 12,\n metaLineHeight: 16,\n watchHeight: 32,\n watchPaddingX: 10,\n watchFontSize: 13,\n watchIconSize: 13,\n },\n};\n\nexport const StreamingSelector: React.FC<StreamingSelectorProps> = ({\n streamerName,\n gameName,\n coverSrc,\n coverAlt = \"\",\n avatarSrc,\n avatarAlt = \"\",\n avatarFallback,\n live = true,\n liveLabel = \"Live\",\n previewSlot,\n watchLabel = \"Watch\",\n watchIcon,\n onWatchPress,\n onPress,\n platform = \"desktop\",\n fullWidth = false,\n disabled = false,\n \"aria-label\": ariaLabel,\n testID,\n themeMode,\n themeProductContext = \"b2c\",\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const config = sizeConfig[platform];\n const [isHovered, setIsHovered] = useState(false);\n\n // The Watch action sits inside the pressable plate, so its click bubbles up\n // to the card's own handler. The inner handler always runs first, so it can\n // raise this flag and have the card handler skip exactly one press.\n const suppressCardPressRef = useRef(false);\n\n const isInteractive = Boolean(onPress) && !disabled;\n const isWatchInteractive = Boolean(onWatchPress) && !disabled;\n\n const handleWatchPress = useCallback(() => {\n if (!isWatchInteractive) return;\n suppressCardPressRef.current = true;\n onWatchPress?.();\n }, [isWatchInteractive, onWatchPress]);\n\n const handleCardPress = useCallback(() => {\n if (suppressCardPressRef.current) {\n suppressCardPressRef.current = false;\n return;\n }\n onPress?.();\n }, [onPress]);\n\n const showPreview = Boolean(previewSlot) && isHovered && platform === \"desktop\";\n\n return (\n <Box\n width={fullWidth ? \"100%\" : config.width}\n maxWidth=\"100%\"\n flexDirection=\"column\"\n borderRadius={4}\n borderWidth={1}\n borderStyle=\"solid\"\n borderColor={theme.colors.border.secondary}\n backgroundColor={theme.colors.overlay.mono}\n overflow=\"hidden\"\n opacity={disabled ? 0.72 : 1}\n cursor={isInteractive ? \"pointer\" : undefined}\n role={isInteractive ? \"button\" : \"group\"}\n aria-label={ariaLabel}\n aria-disabled={disabled || undefined}\n tabIndex={isInteractive ? 0 : undefined}\n onPress={isInteractive ? handleCardPress : undefined}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n hoverStyle={\n isInteractive\n ? { backgroundColor: theme.colors.overlay.monoHover }\n : undefined\n }\n testID={testID || \"streaming-selector\"}\n >\n <Box\n width=\"100%\"\n height={fullWidth ? undefined : config.coverHeight}\n position=\"relative\"\n overflow=\"hidden\"\n backgroundColor={theme.colors.background.secondary}\n style={fullWidth ? { aspectRatio: \"16 / 9\" } : undefined}\n >\n {showPreview ? (\n <Box\n width=\"100%\"\n height=\"100%\"\n position=\"absolute\"\n top={0}\n left={0}\n overflow=\"hidden\"\n testID=\"streaming-selector-preview\"\n >\n {previewSlot}\n </Box>\n ) : (\n coverSrc && (\n <Box\n as=\"img\"\n src={coverSrc}\n alt={coverAlt}\n width=\"100%\"\n height=\"100%\"\n testID=\"streaming-selector-cover\"\n />\n )\n )}\n {live && (\n <Box\n position=\"absolute\"\n top={8}\n left={8}\n zIndex={2}\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={4}\n paddingHorizontal={6}\n paddingVertical={3}\n borderRadius={4}\n backgroundColor={theme.colors.layer.scrim}\n testID=\"streaming-selector-live-tag\"\n >\n <Box\n width={6}\n height={6}\n borderRadius={999}\n backgroundColor={theme.colors.background.alert.primary}\n />\n <Text\n color={theme.colors.content.static.light}\n fontFamily={theme.fonts.body}\n fontSize={12}\n lineHeight={14}\n fontWeight=\"500\"\n numberOfLines={1}\n >\n {liveLabel}\n </Text>\n </Box>\n )}\n </Box>\n\n <Box\n width=\"100%\"\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={config.footerGap}\n paddingHorizontal={config.footerPaddingX}\n paddingVertical={config.footerPaddingY}\n >\n {avatarSrc ? (\n <Box\n as=\"img\"\n src={avatarSrc}\n alt={avatarAlt}\n width={config.avatarSize}\n height={config.avatarSize}\n borderRadius={999}\n flexShrink={0}\n testID=\"streaming-selector-avatar\"\n />\n ) : (\n <Box\n width={config.avatarSize}\n height={config.avatarSize}\n borderRadius={999}\n flexShrink={0}\n alignItems=\"center\"\n justifyContent=\"center\"\n overflow=\"hidden\"\n backgroundColor={theme.colors.background.neutral.secondary}\n testID=\"streaming-selector-avatar\"\n >\n {avatarFallback}\n </Box>\n )}\n\n <Box flex={1} minWidth={0} flexDirection=\"column\" gap={2}>\n <Text\n color={theme.colors.content.primary}\n fontFamily={theme.fonts.body}\n fontSize={config.nameFontSize}\n lineHeight={config.nameLineHeight}\n fontWeight=\"500\"\n numberOfLines={1}\n testID=\"streaming-selector-name\"\n >\n {streamerName}\n </Text>\n {gameName && (\n <Text\n color={theme.colors.content.secondary}\n fontFamily={theme.fonts.body}\n fontSize={config.metaFontSize}\n lineHeight={config.metaLineHeight}\n numberOfLines={1}\n testID=\"streaming-selector-game\"\n >\n Playing {gameName}\n </Text>\n )}\n </Box>\n\n <Box\n height={config.watchHeight}\n flexShrink={0}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap={6}\n paddingHorizontal={config.watchPaddingX}\n borderRadius={4}\n backgroundColor={theme.colors.control.mono.secondary.bg}\n cursor={isWatchInteractive ? \"pointer\" : undefined}\n role={isWatchInteractive ? \"button\" : undefined}\n aria-disabled={disabled || undefined}\n tabIndex={isWatchInteractive ? 0 : undefined}\n onPress={isWatchInteractive ? handleWatchPress : undefined}\n hoverStyle={\n isWatchInteractive\n ? { backgroundColor: theme.colors.control.mono.secondary.bgHover }\n : undefined\n }\n pressStyle={{\n backgroundColor: theme.colors.control.mono.secondary.bgPress,\n }}\n testID=\"streaming-selector-watch\"\n >\n {watchIcon ?? (\n <Play\n size={config.watchIconSize}\n color={theme.colors.control.mono.text.secondary}\n />\n )}\n <Text\n color={theme.colors.control.mono.text.secondary}\n fontFamily={theme.fonts.body}\n fontSize={config.watchFontSize}\n lineHeight={config.watchFontSize + 4}\n fontWeight=\"500\"\n numberOfLines={1}\n >\n {watchLabel}\n </Text>\n </Box>\n </Box>\n </Box>\n );\n};\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n AccessibilityRole,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleToAccessibilityRole: Record<string, AccessibilityRole> = {\n button: \"button\",\n link: \"link\",\n img: \"image\",\n image: \"image\",\n summary: \"summary\",\n switch: \"switch\",\n checkbox: \"checkbox\",\n radio: \"radio\",\n heading: \"header\",\n text: \"text\",\n search: \"search\",\n alert: \"alert\",\n none: \"none\",\n presentation: \"none\",\n progressbar: \"progressbar\",\n scrollbar: \"scrollbar\",\n adjustable: \"adjustable\",\n tab: \"tab\",\n menu: \"menu\",\n menuitem: \"menuitem\",\n list: \"list\",\n timer: \"timer\",\n};\n\n/** RN ViewStyle.gap is typed as number (Yoga gap), not DimensionValue. */\nconst toGapValue = (gap: number | string | undefined): number | undefined => {\n if (gap === undefined) return undefined;\n if (typeof gap === \"number\") return gap;\n const pxMatch = /^(\\d+(?:\\.\\d+)?)px$/.exec(gap);\n if (pxMatch) return Number(pxMatch[1]);\n const asNumber = Number(gap);\n return Number.isFinite(asNumber) ? asNumber : undefined;\n};\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n opacity,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n opacity: opacity ?? (disabled ? 0.5 : undefined),\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n"],"mappings":";AAAA,SAAgB,aAAa,QAAQ,gBAAgB;;;ACCrD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAwMD;AArMN,IAAM,0BAA6D;AAAA,EACjE,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,cAAc;AAAA,EACd,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AACT;AAGA,IAAM,aAAa,CAAC,QAAyD;AAC3E,MAAI,QAAQ,OAAW,QAAO;AAC9B,MAAI,OAAO,QAAQ,SAAU,QAAO;AACpC,QAAM,UAAU,sBAAsB,KAAK,GAAG;AAC9C,MAAI,QAAS,QAAO,OAAO,QAAQ,CAAC,CAAC;AACrC,QAAM,WAAW,OAAO,GAAG;AAC3B,SAAO,OAAO,SAAS,QAAQ,IAAI,WAAW;AAChD;AAEO,IAAM,MAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,oBAAoB,CAAC,aAAkC;AAAA,IAC3D,iBACE,WAAW,YAAY,kBACnB,WAAW,kBACX;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS,YAAY,WAAW,MAAM;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,KAAK,WAAW,G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