@xsolla/xui-b2c-progress-icon 0.156.0-pr297.1779158853
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 +21 -0
- package/native/index.d.ts +21 -0
- package/native/index.js +392 -0
- package/native/index.js.map +1 -0
- package/native/index.mjs +359 -0
- package/native/index.mjs.map +1 -0
- package/package.json +56 -0
- package/web/index.d.mts +21 -0
- package/web/index.d.ts +21 -0
- package/web/index.js +4005 -0
- package/web/index.js.map +1 -0
- package/web/index.mjs +3991 -0
- package/web/index.mjs.map +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
3
|
+
|
|
4
|
+
interface ProgressIconProps extends ThemeOverrideProps {
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
percent?: number;
|
|
7
|
+
size?: number;
|
|
8
|
+
iconSize?: number;
|
|
9
|
+
radius?: number;
|
|
10
|
+
strokeWidth?: number;
|
|
11
|
+
trackColor?: string;
|
|
12
|
+
progressColor?: string;
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
iconColor?: string;
|
|
15
|
+
"aria-label"?: string;
|
|
16
|
+
testID?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare const ProgressIcon: React.FC<ProgressIconProps>;
|
|
20
|
+
|
|
21
|
+
export { ProgressIcon, type ProgressIconProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
3
|
+
|
|
4
|
+
interface ProgressIconProps extends ThemeOverrideProps {
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
percent?: number;
|
|
7
|
+
size?: number;
|
|
8
|
+
iconSize?: number;
|
|
9
|
+
radius?: number;
|
|
10
|
+
strokeWidth?: number;
|
|
11
|
+
trackColor?: string;
|
|
12
|
+
progressColor?: string;
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
iconColor?: string;
|
|
15
|
+
"aria-label"?: string;
|
|
16
|
+
testID?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare const ProgressIcon: React.FC<ProgressIconProps>;
|
|
20
|
+
|
|
21
|
+
export { ProgressIcon, type ProgressIconProps };
|
package/native/index.js
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.tsx
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
ProgressIcon: () => ProgressIcon
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
|
|
37
|
+
// src/ProgressIcon.tsx
|
|
38
|
+
var import_react = __toESM(require("react"));
|
|
39
|
+
|
|
40
|
+
// ../../foundation/primitives-native/src/Box.tsx
|
|
41
|
+
var import_react_native = require("react-native");
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
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
|
+
alignItems,
|
|
76
|
+
justifyContent,
|
|
77
|
+
position,
|
|
78
|
+
top,
|
|
79
|
+
bottom,
|
|
80
|
+
left,
|
|
81
|
+
right,
|
|
82
|
+
width,
|
|
83
|
+
minWidth,
|
|
84
|
+
minHeight,
|
|
85
|
+
maxWidth,
|
|
86
|
+
maxHeight,
|
|
87
|
+
flex,
|
|
88
|
+
overflow,
|
|
89
|
+
zIndex,
|
|
90
|
+
hoverStyle,
|
|
91
|
+
pressStyle,
|
|
92
|
+
style,
|
|
93
|
+
"data-testid": dataTestId,
|
|
94
|
+
testID,
|
|
95
|
+
as,
|
|
96
|
+
src,
|
|
97
|
+
alt,
|
|
98
|
+
...rest
|
|
99
|
+
}) => {
|
|
100
|
+
const getContainerStyle = (pressed) => ({
|
|
101
|
+
backgroundColor: pressed && pressStyle?.backgroundColor ? pressStyle.backgroundColor : backgroundColor,
|
|
102
|
+
borderColor,
|
|
103
|
+
borderWidth,
|
|
104
|
+
borderBottomWidth,
|
|
105
|
+
borderBottomColor,
|
|
106
|
+
borderTopWidth,
|
|
107
|
+
borderTopColor,
|
|
108
|
+
borderLeftWidth,
|
|
109
|
+
borderLeftColor,
|
|
110
|
+
borderRightWidth,
|
|
111
|
+
borderRightColor,
|
|
112
|
+
borderRadius,
|
|
113
|
+
borderStyle,
|
|
114
|
+
overflow,
|
|
115
|
+
zIndex,
|
|
116
|
+
height,
|
|
117
|
+
width,
|
|
118
|
+
minWidth,
|
|
119
|
+
minHeight,
|
|
120
|
+
maxWidth,
|
|
121
|
+
maxHeight,
|
|
122
|
+
padding,
|
|
123
|
+
paddingHorizontal,
|
|
124
|
+
paddingVertical,
|
|
125
|
+
margin,
|
|
126
|
+
marginTop,
|
|
127
|
+
marginBottom,
|
|
128
|
+
marginLeft,
|
|
129
|
+
marginRight,
|
|
130
|
+
flexDirection,
|
|
131
|
+
alignItems,
|
|
132
|
+
justifyContent,
|
|
133
|
+
position,
|
|
134
|
+
top,
|
|
135
|
+
bottom,
|
|
136
|
+
left,
|
|
137
|
+
right,
|
|
138
|
+
flex,
|
|
139
|
+
...style
|
|
140
|
+
});
|
|
141
|
+
const finalTestID = dataTestId || testID;
|
|
142
|
+
const {
|
|
143
|
+
role,
|
|
144
|
+
tabIndex,
|
|
145
|
+
onKeyDown,
|
|
146
|
+
onKeyUp,
|
|
147
|
+
"aria-label": _ariaLabel,
|
|
148
|
+
"aria-labelledby": _ariaLabelledBy,
|
|
149
|
+
"aria-current": _ariaCurrent,
|
|
150
|
+
"aria-disabled": _ariaDisabled,
|
|
151
|
+
"aria-live": _ariaLive,
|
|
152
|
+
className,
|
|
153
|
+
"data-testid": _dataTestId,
|
|
154
|
+
...nativeRest
|
|
155
|
+
} = rest;
|
|
156
|
+
if (as === "img" && src) {
|
|
157
|
+
const imageStyle = {
|
|
158
|
+
width,
|
|
159
|
+
height,
|
|
160
|
+
borderRadius,
|
|
161
|
+
position,
|
|
162
|
+
top,
|
|
163
|
+
bottom,
|
|
164
|
+
left,
|
|
165
|
+
right,
|
|
166
|
+
...style
|
|
167
|
+
};
|
|
168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
169
|
+
import_react_native.Image,
|
|
170
|
+
{
|
|
171
|
+
source: { uri: src },
|
|
172
|
+
style: imageStyle,
|
|
173
|
+
testID: finalTestID,
|
|
174
|
+
resizeMode: "cover",
|
|
175
|
+
...nativeRest
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
if (onPress) {
|
|
180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
181
|
+
import_react_native.Pressable,
|
|
182
|
+
{
|
|
183
|
+
onPress,
|
|
184
|
+
onLayout,
|
|
185
|
+
onMoveShouldSetResponder,
|
|
186
|
+
onResponderGrant,
|
|
187
|
+
onResponderMove,
|
|
188
|
+
onResponderRelease,
|
|
189
|
+
onResponderTerminate,
|
|
190
|
+
style: ({ pressed }) => getContainerStyle(pressed),
|
|
191
|
+
testID: finalTestID,
|
|
192
|
+
...nativeRest,
|
|
193
|
+
children
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
198
|
+
import_react_native.View,
|
|
199
|
+
{
|
|
200
|
+
style: getContainerStyle(),
|
|
201
|
+
testID: finalTestID,
|
|
202
|
+
onLayout,
|
|
203
|
+
onMoveShouldSetResponder,
|
|
204
|
+
onResponderGrant,
|
|
205
|
+
onResponderMove,
|
|
206
|
+
onResponderRelease,
|
|
207
|
+
onResponderTerminate,
|
|
208
|
+
...nativeRest,
|
|
209
|
+
children
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
// src/ProgressIcon.tsx
|
|
215
|
+
var import_xui_core = require("@xsolla/xui-core");
|
|
216
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
217
|
+
var clampPercent = (percent) => Math.min(Math.max(percent, 0), 100);
|
|
218
|
+
var renderIcon = (icon, size, color) => {
|
|
219
|
+
if (!import_react.default.isValidElement(icon)) return icon;
|
|
220
|
+
return import_react.default.cloneElement(
|
|
221
|
+
icon,
|
|
222
|
+
{
|
|
223
|
+
size,
|
|
224
|
+
color
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
};
|
|
228
|
+
var getSegmentFills = (percent) => {
|
|
229
|
+
const value = clampPercent(percent);
|
|
230
|
+
return {
|
|
231
|
+
topRight: Math.min(value, 25) / 25,
|
|
232
|
+
bottomRight: Math.min(Math.max(value - 25, 0), 25) / 25,
|
|
233
|
+
bottomLeft: Math.min(Math.max(value - 50, 0), 25) / 25,
|
|
234
|
+
topLeft: Math.min(Math.max(value - 75, 0), 25) / 25
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
var Segment = ({ fill, color, size, radius, strokeWidth, placement }) => {
|
|
238
|
+
if (fill <= 0) return null;
|
|
239
|
+
const half = size / 2;
|
|
240
|
+
const shared = {
|
|
241
|
+
position: "absolute",
|
|
242
|
+
width: half,
|
|
243
|
+
height: half,
|
|
244
|
+
borderColor: color,
|
|
245
|
+
borderStyle: "solid",
|
|
246
|
+
testID: `progress-icon-segment-${placement}`
|
|
247
|
+
};
|
|
248
|
+
switch (placement) {
|
|
249
|
+
case "topRight":
|
|
250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
251
|
+
Box,
|
|
252
|
+
{
|
|
253
|
+
...shared,
|
|
254
|
+
top: 0,
|
|
255
|
+
right: 0,
|
|
256
|
+
borderTopWidth: strokeWidth,
|
|
257
|
+
borderRightWidth: strokeWidth,
|
|
258
|
+
style: { borderTopRightRadius: radius }
|
|
259
|
+
}
|
|
260
|
+
);
|
|
261
|
+
case "bottomRight":
|
|
262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
263
|
+
Box,
|
|
264
|
+
{
|
|
265
|
+
...shared,
|
|
266
|
+
right: 0,
|
|
267
|
+
bottom: 0,
|
|
268
|
+
borderRightWidth: strokeWidth,
|
|
269
|
+
borderBottomWidth: strokeWidth,
|
|
270
|
+
style: { borderBottomRightRadius: radius }
|
|
271
|
+
}
|
|
272
|
+
);
|
|
273
|
+
case "bottomLeft":
|
|
274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
275
|
+
Box,
|
|
276
|
+
{
|
|
277
|
+
...shared,
|
|
278
|
+
bottom: 0,
|
|
279
|
+
left: 0,
|
|
280
|
+
borderBottomWidth: strokeWidth,
|
|
281
|
+
borderLeftWidth: strokeWidth,
|
|
282
|
+
style: { borderBottomLeftRadius: radius }
|
|
283
|
+
}
|
|
284
|
+
);
|
|
285
|
+
case "topLeft":
|
|
286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
287
|
+
Box,
|
|
288
|
+
{
|
|
289
|
+
...shared,
|
|
290
|
+
top: 0,
|
|
291
|
+
left: 0,
|
|
292
|
+
borderLeftWidth: strokeWidth,
|
|
293
|
+
borderTopWidth: strokeWidth,
|
|
294
|
+
style: { borderTopLeftRadius: radius }
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
var ProgressIcon = ({
|
|
300
|
+
icon,
|
|
301
|
+
percent = 0,
|
|
302
|
+
size = 48,
|
|
303
|
+
iconSize = 20,
|
|
304
|
+
radius = 4,
|
|
305
|
+
strokeWidth = 2,
|
|
306
|
+
trackColor,
|
|
307
|
+
progressColor,
|
|
308
|
+
backgroundColor,
|
|
309
|
+
iconColor,
|
|
310
|
+
"aria-label": ariaLabel = "Progress icon",
|
|
311
|
+
testID,
|
|
312
|
+
themeMode,
|
|
313
|
+
themeProductContext = "b2c"
|
|
314
|
+
}) => {
|
|
315
|
+
const { theme } = (0, import_xui_core.useResolvedTheme)({ themeMode, themeProductContext });
|
|
316
|
+
const clampedPercent = clampPercent(percent);
|
|
317
|
+
const fills = getSegmentFills(clampedPercent);
|
|
318
|
+
const resolvedProgressColor = progressColor || theme.colors.content.brand.primary;
|
|
319
|
+
const resolvedIconColor = iconColor || theme.colors.content.primary;
|
|
320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
321
|
+
Box,
|
|
322
|
+
{
|
|
323
|
+
width: size,
|
|
324
|
+
height: size,
|
|
325
|
+
position: "relative",
|
|
326
|
+
alignItems: "center",
|
|
327
|
+
justifyContent: "center",
|
|
328
|
+
borderRadius: radius,
|
|
329
|
+
backgroundColor: backgroundColor || theme.colors.overlay.mono,
|
|
330
|
+
borderWidth: trackColor ? strokeWidth : 0,
|
|
331
|
+
borderColor: trackColor || "transparent",
|
|
332
|
+
role: "progressbar",
|
|
333
|
+
"aria-label": ariaLabel,
|
|
334
|
+
"aria-valuenow": clampedPercent,
|
|
335
|
+
"aria-valuemin": 0,
|
|
336
|
+
"aria-valuemax": 100,
|
|
337
|
+
testID: testID || "progress-icon",
|
|
338
|
+
children: [
|
|
339
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
340
|
+
Segment,
|
|
341
|
+
{
|
|
342
|
+
placement: "topRight",
|
|
343
|
+
fill: fills.topRight,
|
|
344
|
+
color: resolvedProgressColor,
|
|
345
|
+
size,
|
|
346
|
+
radius,
|
|
347
|
+
strokeWidth
|
|
348
|
+
}
|
|
349
|
+
),
|
|
350
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
351
|
+
Segment,
|
|
352
|
+
{
|
|
353
|
+
placement: "bottomRight",
|
|
354
|
+
fill: fills.bottomRight,
|
|
355
|
+
color: resolvedProgressColor,
|
|
356
|
+
size,
|
|
357
|
+
radius,
|
|
358
|
+
strokeWidth
|
|
359
|
+
}
|
|
360
|
+
),
|
|
361
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
362
|
+
Segment,
|
|
363
|
+
{
|
|
364
|
+
placement: "bottomLeft",
|
|
365
|
+
fill: fills.bottomLeft,
|
|
366
|
+
color: resolvedProgressColor,
|
|
367
|
+
size,
|
|
368
|
+
radius,
|
|
369
|
+
strokeWidth
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
373
|
+
Segment,
|
|
374
|
+
{
|
|
375
|
+
placement: "topLeft",
|
|
376
|
+
fill: fills.topLeft,
|
|
377
|
+
color: resolvedProgressColor,
|
|
378
|
+
size,
|
|
379
|
+
radius,
|
|
380
|
+
strokeWidth
|
|
381
|
+
}
|
|
382
|
+
),
|
|
383
|
+
renderIcon(icon, iconSize, resolvedIconColor)
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
);
|
|
387
|
+
};
|
|
388
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
389
|
+
0 && (module.exports = {
|
|
390
|
+
ProgressIcon
|
|
391
|
+
});
|
|
392
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/ProgressIcon.tsx","../../../../foundation/primitives-native/src/Box.tsx"],"sourcesContent":["export { ProgressIcon } from \"./ProgressIcon\";\nexport type { ProgressIconProps } from \"./types\";\n","import React from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme } from \"@xsolla/xui-core\";\nimport type { ProgressIconProps } from \"./types\";\n\nconst clampPercent = (percent: number) => Math.min(Math.max(percent, 0), 100);\n\nconst renderIcon = (icon: React.ReactNode, size: number, color: string) => {\n if (!React.isValidElement(icon)) return icon;\n\n return React.cloneElement(\n icon as React.ReactElement<{ size?: number | string; color?: string }>,\n {\n size,\n color,\n }\n );\n};\n\nconst getSegmentFills = (percent: number) => {\n const value = clampPercent(percent);\n\n return {\n topRight: Math.min(value, 25) / 25,\n bottomRight: Math.min(Math.max(value - 25, 0), 25) / 25,\n bottomLeft: Math.min(Math.max(value - 50, 0), 25) / 25,\n topLeft: Math.min(Math.max(value - 75, 0), 25) / 25,\n };\n};\n\nconst Segment: React.FC<{\n fill: number;\n color: string;\n size: number;\n radius: number;\n strokeWidth: number;\n placement: \"topRight\" | \"bottomRight\" | \"bottomLeft\" | \"topLeft\";\n}> = ({ fill, color, size, radius, strokeWidth, placement }) => {\n if (fill <= 0) return null;\n\n const half = size / 2;\n const shared = {\n position: \"absolute\" as const,\n width: half,\n height: half,\n borderColor: color,\n borderStyle: \"solid\" as const,\n testID: `progress-icon-segment-${placement}`,\n };\n\n switch (placement) {\n case \"topRight\":\n return (\n <Box\n {...shared}\n top={0}\n right={0}\n borderTopWidth={strokeWidth}\n borderRightWidth={strokeWidth}\n style={{ borderTopRightRadius: radius }}\n />\n );\n case \"bottomRight\":\n return (\n <Box\n {...shared}\n right={0}\n bottom={0}\n borderRightWidth={strokeWidth}\n borderBottomWidth={strokeWidth}\n style={{ borderBottomRightRadius: radius }}\n />\n );\n case \"bottomLeft\":\n return (\n <Box\n {...shared}\n bottom={0}\n left={0}\n borderBottomWidth={strokeWidth}\n borderLeftWidth={strokeWidth}\n style={{ borderBottomLeftRadius: radius }}\n />\n );\n case \"topLeft\":\n return (\n <Box\n {...shared}\n top={0}\n left={0}\n borderLeftWidth={strokeWidth}\n borderTopWidth={strokeWidth}\n style={{ borderTopLeftRadius: radius }}\n />\n );\n }\n};\n\nexport const ProgressIcon: React.FC<ProgressIconProps> = ({\n icon,\n percent = 0,\n size = 48,\n iconSize = 20,\n radius = 4,\n strokeWidth = 2,\n trackColor,\n progressColor,\n backgroundColor,\n iconColor,\n \"aria-label\": ariaLabel = \"Progress icon\",\n testID,\n themeMode,\n themeProductContext = \"b2c\",\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const clampedPercent = clampPercent(percent);\n const fills = getSegmentFills(clampedPercent);\n const resolvedProgressColor =\n progressColor || theme.colors.content.brand.primary;\n const resolvedIconColor = iconColor || theme.colors.content.primary;\n\n return (\n <Box\n width={size}\n height={size}\n position=\"relative\"\n alignItems=\"center\"\n justifyContent=\"center\"\n borderRadius={radius}\n backgroundColor={backgroundColor || theme.colors.overlay.mono}\n borderWidth={trackColor ? strokeWidth : 0}\n borderColor={trackColor || \"transparent\"}\n role=\"progressbar\"\n aria-label={ariaLabel}\n aria-valuenow={clampedPercent}\n aria-valuemin={0}\n aria-valuemax={100}\n testID={testID || \"progress-icon\"}\n >\n <Segment\n placement=\"topRight\"\n fill={fills.topRight}\n color={resolvedProgressColor}\n size={size}\n radius={radius}\n strokeWidth={strokeWidth}\n />\n <Segment\n placement=\"bottomRight\"\n fill={fills.bottomRight}\n color={resolvedProgressColor}\n size={size}\n radius={radius}\n strokeWidth={strokeWidth}\n />\n <Segment\n placement=\"bottomLeft\"\n fill={fills.bottomLeft}\n color={resolvedProgressColor}\n size={size}\n radius={radius}\n strokeWidth={strokeWidth}\n />\n <Segment\n placement=\"topLeft\"\n fill={fills.topLeft}\n color={resolvedProgressColor}\n size={size}\n radius={radius}\n strokeWidth={strokeWidth}\n />\n {renderIcon(icon, iconSize, resolvedIconColor)}\n </Box>\n );\n};\n\nexport { clampPercent };\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\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 alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\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 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 alignItems,\n justifyContent,\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 ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\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 className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\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 resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\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 {...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 {...nativeRest}\n >\n {children}\n </View>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;;;ACClB,0BAQO;AA2ID;AAxIC,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,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;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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