@xsolla/xui-b2c-progress-bar 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 +5 -0
- package/native/index.d.mts +44 -0
- package/native/index.d.ts +44 -0
- package/native/index.js +468 -0
- package/native/index.js.map +1 -0
- package/native/index.mjs +448 -0
- package/native/index.mjs.map +1 -0
- package/package.json +56 -0
- package/web/index.d.mts +44 -0
- package/web/index.d.ts +44 -0
- package/web/index.js +4040 -0
- package/web/index.js.map +1 -0
- package/web/index.mjs +4026 -0
- package/web/index.mjs.map +1 -0
package/native/index.mjs
ADDED
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
// ../../foundation/primitives-native/src/Box.tsx
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Pressable,
|
|
5
|
+
Image
|
|
6
|
+
} from "react-native";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var roleToAccessibilityRole = {
|
|
9
|
+
button: "button",
|
|
10
|
+
link: "link",
|
|
11
|
+
img: "image",
|
|
12
|
+
image: "image",
|
|
13
|
+
summary: "summary",
|
|
14
|
+
switch: "switch",
|
|
15
|
+
checkbox: "checkbox",
|
|
16
|
+
radio: "radio",
|
|
17
|
+
heading: "header",
|
|
18
|
+
text: "text",
|
|
19
|
+
search: "search",
|
|
20
|
+
alert: "alert",
|
|
21
|
+
none: "none",
|
|
22
|
+
presentation: "none",
|
|
23
|
+
progressbar: "progressbar",
|
|
24
|
+
scrollbar: "scrollbar",
|
|
25
|
+
adjustable: "adjustable",
|
|
26
|
+
tab: "tab",
|
|
27
|
+
menu: "menu",
|
|
28
|
+
menuitem: "menuitem",
|
|
29
|
+
list: "list",
|
|
30
|
+
timer: "timer"
|
|
31
|
+
};
|
|
32
|
+
var toGapValue = (gap) => {
|
|
33
|
+
if (gap === void 0) return void 0;
|
|
34
|
+
if (typeof gap === "number") return gap;
|
|
35
|
+
const pxMatch = /^(\d+(?:\.\d+)?)px$/.exec(gap);
|
|
36
|
+
if (pxMatch) return Number(pxMatch[1]);
|
|
37
|
+
const asNumber = Number(gap);
|
|
38
|
+
return Number.isFinite(asNumber) ? asNumber : void 0;
|
|
39
|
+
};
|
|
40
|
+
var Box = ({
|
|
41
|
+
children,
|
|
42
|
+
onPress,
|
|
43
|
+
onLayout,
|
|
44
|
+
onMoveShouldSetResponder,
|
|
45
|
+
onResponderGrant,
|
|
46
|
+
onResponderMove,
|
|
47
|
+
onResponderRelease,
|
|
48
|
+
onResponderTerminate,
|
|
49
|
+
backgroundColor,
|
|
50
|
+
borderColor,
|
|
51
|
+
borderWidth,
|
|
52
|
+
borderBottomWidth,
|
|
53
|
+
borderBottomColor,
|
|
54
|
+
borderTopWidth,
|
|
55
|
+
borderTopColor,
|
|
56
|
+
borderLeftWidth,
|
|
57
|
+
borderLeftColor,
|
|
58
|
+
borderRightWidth,
|
|
59
|
+
borderRightColor,
|
|
60
|
+
borderRadius,
|
|
61
|
+
borderStyle,
|
|
62
|
+
height,
|
|
63
|
+
padding,
|
|
64
|
+
paddingHorizontal,
|
|
65
|
+
paddingVertical,
|
|
66
|
+
margin,
|
|
67
|
+
marginTop,
|
|
68
|
+
marginBottom,
|
|
69
|
+
marginLeft,
|
|
70
|
+
marginRight,
|
|
71
|
+
flexDirection,
|
|
72
|
+
flexWrap,
|
|
73
|
+
alignItems,
|
|
74
|
+
justifyContent,
|
|
75
|
+
alignSelf,
|
|
76
|
+
position,
|
|
77
|
+
top,
|
|
78
|
+
bottom,
|
|
79
|
+
left,
|
|
80
|
+
right,
|
|
81
|
+
width,
|
|
82
|
+
minWidth,
|
|
83
|
+
minHeight,
|
|
84
|
+
maxWidth,
|
|
85
|
+
maxHeight,
|
|
86
|
+
flex,
|
|
87
|
+
flexShrink,
|
|
88
|
+
gap,
|
|
89
|
+
overflow,
|
|
90
|
+
opacity,
|
|
91
|
+
zIndex,
|
|
92
|
+
hoverStyle,
|
|
93
|
+
pressStyle,
|
|
94
|
+
style,
|
|
95
|
+
disabled,
|
|
96
|
+
"data-testid": dataTestId,
|
|
97
|
+
testID,
|
|
98
|
+
as,
|
|
99
|
+
src,
|
|
100
|
+
alt,
|
|
101
|
+
...rest
|
|
102
|
+
}) => {
|
|
103
|
+
const getContainerStyle = (pressed) => ({
|
|
104
|
+
backgroundColor: pressed && pressStyle?.backgroundColor ? pressStyle.backgroundColor : backgroundColor,
|
|
105
|
+
borderColor,
|
|
106
|
+
borderWidth,
|
|
107
|
+
borderBottomWidth,
|
|
108
|
+
borderBottomColor,
|
|
109
|
+
borderTopWidth,
|
|
110
|
+
borderTopColor,
|
|
111
|
+
borderLeftWidth,
|
|
112
|
+
borderLeftColor,
|
|
113
|
+
borderRightWidth,
|
|
114
|
+
borderRightColor,
|
|
115
|
+
borderRadius,
|
|
116
|
+
borderStyle,
|
|
117
|
+
overflow,
|
|
118
|
+
opacity: opacity ?? (disabled ? 0.5 : void 0),
|
|
119
|
+
zIndex,
|
|
120
|
+
height,
|
|
121
|
+
width,
|
|
122
|
+
minWidth,
|
|
123
|
+
minHeight,
|
|
124
|
+
maxWidth,
|
|
125
|
+
maxHeight,
|
|
126
|
+
padding,
|
|
127
|
+
paddingHorizontal,
|
|
128
|
+
paddingVertical,
|
|
129
|
+
margin,
|
|
130
|
+
marginTop,
|
|
131
|
+
marginBottom,
|
|
132
|
+
marginLeft,
|
|
133
|
+
marginRight,
|
|
134
|
+
flexDirection,
|
|
135
|
+
flexWrap,
|
|
136
|
+
alignItems,
|
|
137
|
+
justifyContent,
|
|
138
|
+
alignSelf,
|
|
139
|
+
position,
|
|
140
|
+
top,
|
|
141
|
+
bottom,
|
|
142
|
+
left,
|
|
143
|
+
right,
|
|
144
|
+
flex,
|
|
145
|
+
flexShrink,
|
|
146
|
+
gap: toGapValue(gap),
|
|
147
|
+
...style
|
|
148
|
+
});
|
|
149
|
+
const finalTestID = dataTestId || testID;
|
|
150
|
+
const {
|
|
151
|
+
role,
|
|
152
|
+
tabIndex,
|
|
153
|
+
onKeyDown,
|
|
154
|
+
onKeyUp,
|
|
155
|
+
"aria-label": ariaLabel,
|
|
156
|
+
"aria-labelledby": _ariaLabelledBy,
|
|
157
|
+
"aria-current": _ariaCurrent,
|
|
158
|
+
"aria-disabled": ariaDisabled,
|
|
159
|
+
"aria-live": ariaLive,
|
|
160
|
+
"aria-busy": ariaBusy,
|
|
161
|
+
className,
|
|
162
|
+
"data-testid": _dataTestId,
|
|
163
|
+
cursor: _cursor,
|
|
164
|
+
type: _type,
|
|
165
|
+
...nativeRest
|
|
166
|
+
} = rest;
|
|
167
|
+
const accessibilityRole = typeof role === "string" && roleToAccessibilityRole[role] || (as === "button" ? "button" : void 0);
|
|
168
|
+
const isDisabled = Boolean(disabled || ariaDisabled);
|
|
169
|
+
const accessibilityState = {
|
|
170
|
+
disabled: isDisabled || void 0,
|
|
171
|
+
busy: Boolean(ariaBusy) || void 0
|
|
172
|
+
};
|
|
173
|
+
const accessibilityLiveRegion = ariaLive === "polite" || ariaLive === "assertive" ? ariaLive : void 0;
|
|
174
|
+
if (as === "img" && src) {
|
|
175
|
+
const imageStyle = {
|
|
176
|
+
width,
|
|
177
|
+
height,
|
|
178
|
+
borderRadius,
|
|
179
|
+
position,
|
|
180
|
+
top,
|
|
181
|
+
bottom,
|
|
182
|
+
left,
|
|
183
|
+
right,
|
|
184
|
+
...style
|
|
185
|
+
};
|
|
186
|
+
return /* @__PURE__ */ jsx(
|
|
187
|
+
Image,
|
|
188
|
+
{
|
|
189
|
+
source: { uri: src },
|
|
190
|
+
style: imageStyle,
|
|
191
|
+
testID: finalTestID,
|
|
192
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : alt,
|
|
193
|
+
resizeMode: "cover",
|
|
194
|
+
...nativeRest
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
if (onPress || as === "button") {
|
|
199
|
+
return /* @__PURE__ */ jsx(
|
|
200
|
+
Pressable,
|
|
201
|
+
{
|
|
202
|
+
onPress: !isDisabled && onPress ? onPress : void 0,
|
|
203
|
+
disabled: isDisabled,
|
|
204
|
+
onLayout,
|
|
205
|
+
onMoveShouldSetResponder,
|
|
206
|
+
onResponderGrant,
|
|
207
|
+
onResponderMove,
|
|
208
|
+
onResponderRelease,
|
|
209
|
+
onResponderTerminate,
|
|
210
|
+
style: ({ pressed }) => getContainerStyle(pressed),
|
|
211
|
+
testID: finalTestID,
|
|
212
|
+
accessibilityRole,
|
|
213
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : void 0,
|
|
214
|
+
accessibilityState,
|
|
215
|
+
accessibilityLiveRegion,
|
|
216
|
+
...nativeRest,
|
|
217
|
+
children
|
|
218
|
+
}
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
return /* @__PURE__ */ jsx(
|
|
222
|
+
View,
|
|
223
|
+
{
|
|
224
|
+
style: getContainerStyle(),
|
|
225
|
+
testID: finalTestID,
|
|
226
|
+
onLayout,
|
|
227
|
+
onMoveShouldSetResponder,
|
|
228
|
+
onResponderGrant,
|
|
229
|
+
onResponderMove,
|
|
230
|
+
onResponderRelease,
|
|
231
|
+
onResponderTerminate,
|
|
232
|
+
accessibilityRole,
|
|
233
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : void 0,
|
|
234
|
+
accessibilityState,
|
|
235
|
+
accessibilityLiveRegion,
|
|
236
|
+
...nativeRest,
|
|
237
|
+
children
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// ../../foundation/primitives-native/src/Text.tsx
|
|
243
|
+
import {
|
|
244
|
+
Text as RNText,
|
|
245
|
+
StyleSheet
|
|
246
|
+
} from "react-native";
|
|
247
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
248
|
+
var roleMap = {
|
|
249
|
+
alert: "alert",
|
|
250
|
+
heading: "header",
|
|
251
|
+
button: "button",
|
|
252
|
+
link: "link",
|
|
253
|
+
text: "text"
|
|
254
|
+
};
|
|
255
|
+
var parseNumericValue = (value) => {
|
|
256
|
+
if (value === void 0) return void 0;
|
|
257
|
+
if (typeof value === "number") return value;
|
|
258
|
+
const parsed = parseFloat(value);
|
|
259
|
+
return isNaN(parsed) ? void 0 : parsed;
|
|
260
|
+
};
|
|
261
|
+
var Text = ({
|
|
262
|
+
children,
|
|
263
|
+
color,
|
|
264
|
+
fontSize,
|
|
265
|
+
fontWeight,
|
|
266
|
+
fontFamily,
|
|
267
|
+
textAlign,
|
|
268
|
+
lineHeight,
|
|
269
|
+
numberOfLines,
|
|
270
|
+
id,
|
|
271
|
+
role,
|
|
272
|
+
testID,
|
|
273
|
+
"data-testid": dataTestId,
|
|
274
|
+
style: styleProp,
|
|
275
|
+
...props
|
|
276
|
+
}) => {
|
|
277
|
+
let resolvedFontFamily = fontFamily ? fontFamily.split(",")[0].replace(/['"]/g, "").trim() : void 0;
|
|
278
|
+
if (resolvedFontFamily === "Pilat Wide" || resolvedFontFamily === "Pilat Wide Bold" || resolvedFontFamily === "Aktiv Grotesk") {
|
|
279
|
+
resolvedFontFamily = void 0;
|
|
280
|
+
}
|
|
281
|
+
const incomingStyle = StyleSheet.flatten(styleProp);
|
|
282
|
+
const baseStyle = {
|
|
283
|
+
color: color ?? incomingStyle?.color,
|
|
284
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
285
|
+
fontWeight,
|
|
286
|
+
fontFamily: resolvedFontFamily,
|
|
287
|
+
textDecorationLine: props.textDecoration,
|
|
288
|
+
textAlign: textAlign ?? incomingStyle?.textAlign,
|
|
289
|
+
lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),
|
|
290
|
+
marginTop: parseNumericValue(
|
|
291
|
+
incomingStyle?.marginTop
|
|
292
|
+
),
|
|
293
|
+
marginBottom: parseNumericValue(
|
|
294
|
+
incomingStyle?.marginBottom
|
|
295
|
+
)
|
|
296
|
+
};
|
|
297
|
+
const accessibilityRole = role ? roleMap[role] : void 0;
|
|
298
|
+
return /* @__PURE__ */ jsx2(
|
|
299
|
+
RNText,
|
|
300
|
+
{
|
|
301
|
+
style: baseStyle,
|
|
302
|
+
numberOfLines,
|
|
303
|
+
testID: dataTestId || testID || id,
|
|
304
|
+
accessibilityRole,
|
|
305
|
+
children
|
|
306
|
+
}
|
|
307
|
+
);
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
// src/ProgressBar.tsx
|
|
311
|
+
import { useResolvedTheme, radiusScale } from "@xsolla/xui-core";
|
|
312
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
313
|
+
var clampFullness = (fullness) => Math.min(Math.max(fullness, 0), 100);
|
|
314
|
+
var SIZE_METRICS = {
|
|
315
|
+
sm: { gap: 8, headerGap: 8, title: 14, caption: 12, value: 28 },
|
|
316
|
+
lg: { gap: 12, headerGap: 12, title: 16, caption: 14, value: 32 }
|
|
317
|
+
};
|
|
318
|
+
var HATCH_STRIPE = 2;
|
|
319
|
+
var HATCH_PITCH = 6;
|
|
320
|
+
var hatchGradient = (color) => `repeating-linear-gradient(135deg, ${color} 0, ${color} ${HATCH_STRIPE}px, transparent ${HATCH_STRIPE}px, transparent ${HATCH_PITCH}px)`;
|
|
321
|
+
var ProgressBar = ({
|
|
322
|
+
fullness = 0,
|
|
323
|
+
header = false,
|
|
324
|
+
title,
|
|
325
|
+
caption,
|
|
326
|
+
icon,
|
|
327
|
+
value,
|
|
328
|
+
currency,
|
|
329
|
+
size = "lg",
|
|
330
|
+
height = 24,
|
|
331
|
+
radius = radiusScale["999"],
|
|
332
|
+
trackColor,
|
|
333
|
+
hatchColor,
|
|
334
|
+
fillColor,
|
|
335
|
+
"aria-label": ariaLabel = "Progress",
|
|
336
|
+
testID = "progress-bar",
|
|
337
|
+
themeMode,
|
|
338
|
+
themeProductContext = "b2c"
|
|
339
|
+
}) => {
|
|
340
|
+
const { theme } = useResolvedTheme({ themeMode, themeProductContext });
|
|
341
|
+
const metrics = SIZE_METRICS[size];
|
|
342
|
+
const clamped = clampFullness(fullness);
|
|
343
|
+
const resolvedTrackColor = trackColor || theme.colors.overlay.mono;
|
|
344
|
+
const resolvedHatchColor = hatchColor || theme.colors.border.secondary;
|
|
345
|
+
const resolvedFillColor = fillColor || theme.colors.background.brand.primary;
|
|
346
|
+
const hasValue = Boolean(value) || Boolean(currency);
|
|
347
|
+
const showHeader = header && Boolean(icon || title || caption || hasValue);
|
|
348
|
+
return /* @__PURE__ */ jsxs(
|
|
349
|
+
Box,
|
|
350
|
+
{
|
|
351
|
+
flexDirection: "column",
|
|
352
|
+
width: "100%",
|
|
353
|
+
gap: metrics.gap,
|
|
354
|
+
role: "progressbar",
|
|
355
|
+
"aria-label": ariaLabel,
|
|
356
|
+
"aria-valuenow": clamped,
|
|
357
|
+
"aria-valuemin": 0,
|
|
358
|
+
"aria-valuemax": 100,
|
|
359
|
+
testID,
|
|
360
|
+
children: [
|
|
361
|
+
showHeader && /* @__PURE__ */ jsxs(
|
|
362
|
+
Box,
|
|
363
|
+
{
|
|
364
|
+
flexDirection: "row",
|
|
365
|
+
alignItems: "center",
|
|
366
|
+
justifyContent: "space-between",
|
|
367
|
+
gap: metrics.headerGap,
|
|
368
|
+
testID: `${testID}-header`,
|
|
369
|
+
children: [
|
|
370
|
+
/* @__PURE__ */ jsxs(
|
|
371
|
+
Box,
|
|
372
|
+
{
|
|
373
|
+
flexDirection: "row",
|
|
374
|
+
alignItems: "center",
|
|
375
|
+
gap: metrics.headerGap,
|
|
376
|
+
children: [
|
|
377
|
+
icon,
|
|
378
|
+
(title || caption) && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
379
|
+
title && /* @__PURE__ */ jsx3(
|
|
380
|
+
Text,
|
|
381
|
+
{
|
|
382
|
+
color: theme.colors.content.primary,
|
|
383
|
+
fontSize: metrics.title,
|
|
384
|
+
fontWeight: "500",
|
|
385
|
+
testID: `${testID}-title`,
|
|
386
|
+
children: title
|
|
387
|
+
}
|
|
388
|
+
),
|
|
389
|
+
caption && /* @__PURE__ */ jsx3(
|
|
390
|
+
Text,
|
|
391
|
+
{
|
|
392
|
+
color: theme.colors.content.tertiary,
|
|
393
|
+
fontSize: metrics.caption,
|
|
394
|
+
fontWeight: "400",
|
|
395
|
+
testID: `${testID}-caption`,
|
|
396
|
+
children: caption
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
] })
|
|
400
|
+
]
|
|
401
|
+
}
|
|
402
|
+
),
|
|
403
|
+
hasValue && /* @__PURE__ */ jsxs(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: [
|
|
404
|
+
value && /* @__PURE__ */ jsx3(
|
|
405
|
+
Text,
|
|
406
|
+
{
|
|
407
|
+
color: theme.colors.content.primary,
|
|
408
|
+
fontSize: metrics.value,
|
|
409
|
+
fontWeight: "600",
|
|
410
|
+
testID: `${testID}-value`,
|
|
411
|
+
children: value
|
|
412
|
+
}
|
|
413
|
+
),
|
|
414
|
+
currency
|
|
415
|
+
] })
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
),
|
|
419
|
+
/* @__PURE__ */ jsx3(
|
|
420
|
+
Box,
|
|
421
|
+
{
|
|
422
|
+
width: "100%",
|
|
423
|
+
height,
|
|
424
|
+
borderRadius: radius,
|
|
425
|
+
overflow: "hidden",
|
|
426
|
+
backgroundColor: resolvedTrackColor,
|
|
427
|
+
testID: `${testID}-track`,
|
|
428
|
+
style: { backgroundImage: hatchGradient(resolvedHatchColor) },
|
|
429
|
+
children: clamped > 0 && /* @__PURE__ */ jsx3(
|
|
430
|
+
Box,
|
|
431
|
+
{
|
|
432
|
+
height: "100%",
|
|
433
|
+
borderRadius: radius,
|
|
434
|
+
backgroundColor: resolvedFillColor,
|
|
435
|
+
testID: `${testID}-fill`,
|
|
436
|
+
style: { width: `${clamped}%` }
|
|
437
|
+
}
|
|
438
|
+
)
|
|
439
|
+
}
|
|
440
|
+
)
|
|
441
|
+
]
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
};
|
|
445
|
+
export {
|
|
446
|
+
ProgressBar
|
|
447
|
+
};
|
|
448
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../src/ProgressBar.tsx"],"sourcesContent":["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","import React from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, radiusScale } from \"@xsolla/xui-core\";\nimport type { ProgressBarProps, ProgressBarSize } from \"./types\";\n\nconst clampFullness = (fullness: number) =>\n Math.min(Math.max(fullness, 0), 100);\n\ninterface SizeMetrics {\n gap: number;\n headerGap: number;\n title: number;\n caption: number;\n value: number;\n}\n\nconst SIZE_METRICS: Record<ProgressBarSize, SizeMetrics> = {\n sm: { gap: 8, headerGap: 8, title: 14, caption: 12, value: 28 },\n lg: { gap: 12, headerGap: 12, title: 16, caption: 14, value: 32 },\n};\n\nconst HATCH_STRIPE = 2;\nconst HATCH_PITCH = 6;\n\n/**\n * Diagonal hatching for the unfilled groove. Web-only: React Native ignores\n * `backgroundImage`, so native falls back to the solid `trackColor`.\n */\nconst hatchGradient = (color: string) =>\n `repeating-linear-gradient(135deg, ${color} 0, ${color} ${HATCH_STRIPE}px, transparent ${HATCH_STRIPE}px, transparent ${HATCH_PITCH}px)`;\n\nexport const ProgressBar: React.FC<ProgressBarProps> = ({\n fullness = 0,\n header = false,\n title,\n caption,\n icon,\n value,\n currency,\n size = \"lg\",\n height = 24,\n radius = radiusScale[\"999\"],\n trackColor,\n hatchColor,\n fillColor,\n \"aria-label\": ariaLabel = \"Progress\",\n testID = \"progress-bar\",\n themeMode,\n themeProductContext = \"b2c\",\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const metrics = SIZE_METRICS[size];\n const clamped = clampFullness(fullness);\n\n const resolvedTrackColor = trackColor || theme.colors.overlay.mono;\n const resolvedHatchColor = hatchColor || theme.colors.border.secondary;\n const resolvedFillColor = fillColor || theme.colors.background.brand.primary;\n\n const hasValue = Boolean(value) || Boolean(currency);\n const showHeader =\n header && Boolean(icon || title || caption || hasValue);\n\n return (\n <Box\n flexDirection=\"column\"\n width=\"100%\"\n gap={metrics.gap}\n role=\"progressbar\"\n aria-label={ariaLabel}\n aria-valuenow={clamped}\n aria-valuemin={0}\n aria-valuemax={100}\n testID={testID}\n >\n {showHeader && (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n gap={metrics.headerGap}\n testID={`${testID}-header`}\n >\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={metrics.headerGap}\n >\n {icon}\n {(title || caption) && (\n <Box flexDirection=\"column\">\n {title && (\n <Text\n color={theme.colors.content.primary}\n fontSize={metrics.title}\n fontWeight=\"500\"\n testID={`${testID}-title`}\n >\n {title}\n </Text>\n )}\n {caption && (\n <Text\n color={theme.colors.content.tertiary}\n fontSize={metrics.caption}\n fontWeight=\"400\"\n testID={`${testID}-caption`}\n >\n {caption}\n </Text>\n )}\n </Box>\n )}\n </Box>\n {hasValue && (\n <Box flexDirection=\"row\" alignItems=\"center\" gap={4}>\n {value && (\n <Text\n color={theme.colors.content.primary}\n fontSize={metrics.value}\n fontWeight=\"600\"\n testID={`${testID}-value`}\n >\n {value}\n </Text>\n )}\n {currency}\n </Box>\n )}\n </Box>\n )}\n\n <Box\n width=\"100%\"\n height={height}\n borderRadius={radius}\n overflow=\"hidden\"\n backgroundColor={resolvedTrackColor}\n testID={`${testID}-track`}\n style={{ backgroundImage: hatchGradient(resolvedHatchColor) }}\n >\n {clamped > 0 && (\n <Box\n height=\"100%\"\n borderRadius={radius}\n backgroundColor={resolvedFillColor}\n testID={`${testID}-fill`}\n style={{ width: `${clamped}%` }}\n />\n )}\n </Box>\n </Box>\n );\n};\n\nexport { clampFullness };\n"],"mappings":";AACA;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;AA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MAAM,OAAO,QAAQ;AAAA,oBAC5B,UAAU,QAAQ;AAAA,oBAClB,YAAW;AAAA,oBACX,QAAQ,GAAG,MAAM;AAAA,oBAEhB;AAAA;AAAA,gBACH;AAAA,gBAED;AAAA,iBACH;AAAA;AAAA;AAAA,QAEJ;AAAA,QAGF,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,OAAM;AAAA,YACN;AAAA,YACA,cAAc;AAAA,YACd,UAAS;AAAA,YACT,iBAAiB;AAAA,YACjB,QAAQ,GAAG,MAAM;AAAA,YACjB,OAAO,EAAE,iBAAiB,cAAc,kBAAkB,EAAE;AAAA,YAE3D,oBAAU,KACT,gBAAAA;AAAA,cAAC;AAAA;AAAA,gBACC,QAAO;AAAA,gBACP,cAAc;AAAA,gBACd,iBAAiB;AAAA,gBACjB,QAAQ,GAAG,MAAM;AAAA,gBACjB,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI;AAAA;AAAA,YAChC;AAAA;AAAA,QAEJ;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["jsx","jsx"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xsolla/xui-b2c-progress-bar",
|
|
3
|
+
"version": "0.217.0",
|
|
4
|
+
"main": "./web/index.js",
|
|
5
|
+
"module": "./web/index.mjs",
|
|
6
|
+
"types": "./web/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "yarn build:web && yarn build:native",
|
|
9
|
+
"build:web": "PLATFORM=web tsup",
|
|
10
|
+
"build:native": "PLATFORM=native tsup",
|
|
11
|
+
"test": "vitest",
|
|
12
|
+
"test:run": "vitest run",
|
|
13
|
+
"test:coverage": "vitest run --coverage"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@xsolla/xui-core": "0.217.0",
|
|
17
|
+
"@xsolla/xui-primitives-core": "0.217.0"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"react": ">=16.8.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
24
|
+
"@testing-library/react": "^14.1.2",
|
|
25
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
26
|
+
"jsdom": "^24.0.0",
|
|
27
|
+
"react": "^18.0.0",
|
|
28
|
+
"react-dom": "^18.0.0",
|
|
29
|
+
"tsup": "^8.0.0",
|
|
30
|
+
"vitest": "^4.0.18"
|
|
31
|
+
},
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"sideEffects": false,
|
|
34
|
+
"react-native": "./native/index.js",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"react-native": {
|
|
38
|
+
"types": "./native/index.d.ts",
|
|
39
|
+
"import": "./native/index.mjs",
|
|
40
|
+
"require": "./native/index.js"
|
|
41
|
+
},
|
|
42
|
+
"import": {
|
|
43
|
+
"types": "./web/index.d.ts",
|
|
44
|
+
"default": "./web/index.mjs"
|
|
45
|
+
},
|
|
46
|
+
"require": {
|
|
47
|
+
"types": "./web/index.d.ts",
|
|
48
|
+
"default": "./web/index.js"
|
|
49
|
+
},
|
|
50
|
+
"default": {
|
|
51
|
+
"types": "./web/index.d.ts",
|
|
52
|
+
"default": "./web/index.js"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
package/web/index.d.mts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Figma `Size` variant on `.item-progressBar-header`:
|
|
6
|
+
* `sm` = the 320-390 range, `lg` = the 390-916 range.
|
|
7
|
+
*/
|
|
8
|
+
type ProgressBarSize = "sm" | "lg";
|
|
9
|
+
interface ProgressBarProps extends ThemeOverrideProps {
|
|
10
|
+
/** Progress value, 0-100. Values outside the range are clamped. */
|
|
11
|
+
fullness?: number;
|
|
12
|
+
/** Renders the header row above the groove. */
|
|
13
|
+
header?: boolean;
|
|
14
|
+
/** Header title. Only rendered when `header` is true. */
|
|
15
|
+
title?: ReactNode;
|
|
16
|
+
/** Header caption, rendered under the title. */
|
|
17
|
+
caption?: ReactNode;
|
|
18
|
+
/** Leading header slot, typically an icon button. */
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
/** Trailing header value, e.g. `50/200`. */
|
|
21
|
+
value?: ReactNode;
|
|
22
|
+
/** Trailing header slot after `value`, typically a `CurrencyTag`. */
|
|
23
|
+
currency?: ReactNode;
|
|
24
|
+
/** Header density. Does not affect the groove. */
|
|
25
|
+
size?: ProgressBarSize;
|
|
26
|
+
/** Groove height in pixels. */
|
|
27
|
+
height?: number;
|
|
28
|
+
/** Groove and fill corner radius. */
|
|
29
|
+
radius?: number;
|
|
30
|
+
/** Groove base colour behind the hatching. */
|
|
31
|
+
trackColor?: string;
|
|
32
|
+
/** Colour of the diagonal hatch stripes. */
|
|
33
|
+
hatchColor?: string;
|
|
34
|
+
/** Progress fill colour. */
|
|
35
|
+
fillColor?: string;
|
|
36
|
+
/** Accessible label describing what the bar tracks. */
|
|
37
|
+
"aria-label"?: string;
|
|
38
|
+
/** Test identifier applied to the root element. */
|
|
39
|
+
testID?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare const ProgressBar: React.FC<ProgressBarProps>;
|
|
43
|
+
|
|
44
|
+
export { ProgressBar, type ProgressBarProps, type ProgressBarSize };
|
package/web/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Figma `Size` variant on `.item-progressBar-header`:
|
|
6
|
+
* `sm` = the 320-390 range, `lg` = the 390-916 range.
|
|
7
|
+
*/
|
|
8
|
+
type ProgressBarSize = "sm" | "lg";
|
|
9
|
+
interface ProgressBarProps extends ThemeOverrideProps {
|
|
10
|
+
/** Progress value, 0-100. Values outside the range are clamped. */
|
|
11
|
+
fullness?: number;
|
|
12
|
+
/** Renders the header row above the groove. */
|
|
13
|
+
header?: boolean;
|
|
14
|
+
/** Header title. Only rendered when `header` is true. */
|
|
15
|
+
title?: ReactNode;
|
|
16
|
+
/** Header caption, rendered under the title. */
|
|
17
|
+
caption?: ReactNode;
|
|
18
|
+
/** Leading header slot, typically an icon button. */
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
/** Trailing header value, e.g. `50/200`. */
|
|
21
|
+
value?: ReactNode;
|
|
22
|
+
/** Trailing header slot after `value`, typically a `CurrencyTag`. */
|
|
23
|
+
currency?: ReactNode;
|
|
24
|
+
/** Header density. Does not affect the groove. */
|
|
25
|
+
size?: ProgressBarSize;
|
|
26
|
+
/** Groove height in pixels. */
|
|
27
|
+
height?: number;
|
|
28
|
+
/** Groove and fill corner radius. */
|
|
29
|
+
radius?: number;
|
|
30
|
+
/** Groove base colour behind the hatching. */
|
|
31
|
+
trackColor?: string;
|
|
32
|
+
/** Colour of the diagonal hatch stripes. */
|
|
33
|
+
hatchColor?: string;
|
|
34
|
+
/** Progress fill colour. */
|
|
35
|
+
fillColor?: string;
|
|
36
|
+
/** Accessible label describing what the bar tracks. */
|
|
37
|
+
"aria-label"?: string;
|
|
38
|
+
/** Test identifier applied to the root element. */
|
|
39
|
+
testID?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare const ProgressBar: React.FC<ProgressBarProps>;
|
|
43
|
+
|
|
44
|
+
export { ProgressBar, type ProgressBarProps, type ProgressBarSize };
|