@xsolla/xui-b2c-payment-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 +4 -0
- package/native/index.d.mts +57 -0
- package/native/index.d.ts +57 -0
- package/native/index.js +479 -0
- package/native/index.js.map +1 -0
- package/native/index.mjs +459 -0
- package/native/index.mjs.map +1 -0
- package/package.json +56 -0
- package/web/index.d.mts +57 -0
- package/web/index.d.ts +57 -0
- package/web/index.js +4051 -0
- package/web/index.js.map +1 -0
- package/web/index.mjs +4037 -0
- package/web/index.mjs.map +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* `amount` is a top-up denomination tile (big price + optional currency value).
|
|
6
|
+
* `payment` is a payment-method tile (brand logo + method name).
|
|
7
|
+
*/
|
|
8
|
+
type PaymentSelectorType = "amount" | "payment";
|
|
9
|
+
type PaymentSelectorState = "default" | "hover" | "selected";
|
|
10
|
+
interface PaymentSelectorProps extends ThemeOverrideProps {
|
|
11
|
+
/** Which tile layout to render. Defaults to `amount`. */
|
|
12
|
+
type?: PaymentSelectorType;
|
|
13
|
+
/**
|
|
14
|
+
* The tile's headline. For `amount` this is the price (e.g. `"$ 1500"`),
|
|
15
|
+
* rendered in heading/h4; for `payment` it is the method name
|
|
16
|
+
* (e.g. `"Klarna"`), rendered in body-lg/accent. Truncates to one line.
|
|
17
|
+
*/
|
|
18
|
+
label: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* `amount` only — the secondary currency row under the price, e.g. the
|
|
21
|
+
* virtual-currency amount the top-up grants. Figma exposes this as a
|
|
22
|
+
* `CurrencyValue` instance, so pass a `CurrencyTag` (or any node).
|
|
23
|
+
*/
|
|
24
|
+
currency?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* `payment` only — the provider's brand mark. Rendered in a fixed 32×32
|
|
27
|
+
* slot with a 4 px radius, so pass an `img`, an SVG logo or a brand icon.
|
|
28
|
+
*/
|
|
29
|
+
logo?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Optional chip pinned to the top-right corner (Figma's `Show Tag`
|
|
32
|
+
* boolean). The slot is unopinionated — pass a `Tag`, a discount badge or
|
|
33
|
+
* any node. Omit it to hide the corner entirely.
|
|
34
|
+
*/
|
|
35
|
+
tag?: ReactNode;
|
|
36
|
+
/** Whether the tile is the chosen option. Drives `aria-pressed`. */
|
|
37
|
+
selected?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Visual state override. Web resolves hover and selection on its own —
|
|
40
|
+
* pass this explicitly only for design review and visual tests.
|
|
41
|
+
*/
|
|
42
|
+
state?: PaymentSelectorState;
|
|
43
|
+
/** Figma `Mobile?=On`: drops the payment label to 16/20. */
|
|
44
|
+
compact?: boolean;
|
|
45
|
+
/** Removes interactivity and dims the tile. */
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
/** Selects this option. Required for the tile to be interactive. */
|
|
48
|
+
onPress?: () => void;
|
|
49
|
+
/** Tile width. Defaults to the 148 px Figma frame; pass `"100%"` to fill a grid cell. */
|
|
50
|
+
width?: number | string;
|
|
51
|
+
"aria-label"?: string;
|
|
52
|
+
testID?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare const PaymentSelector: React.FC<PaymentSelectorProps>;
|
|
56
|
+
|
|
57
|
+
export { PaymentSelector, type PaymentSelectorProps, type PaymentSelectorState, type PaymentSelectorType };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* `amount` is a top-up denomination tile (big price + optional currency value).
|
|
6
|
+
* `payment` is a payment-method tile (brand logo + method name).
|
|
7
|
+
*/
|
|
8
|
+
type PaymentSelectorType = "amount" | "payment";
|
|
9
|
+
type PaymentSelectorState = "default" | "hover" | "selected";
|
|
10
|
+
interface PaymentSelectorProps extends ThemeOverrideProps {
|
|
11
|
+
/** Which tile layout to render. Defaults to `amount`. */
|
|
12
|
+
type?: PaymentSelectorType;
|
|
13
|
+
/**
|
|
14
|
+
* The tile's headline. For `amount` this is the price (e.g. `"$ 1500"`),
|
|
15
|
+
* rendered in heading/h4; for `payment` it is the method name
|
|
16
|
+
* (e.g. `"Klarna"`), rendered in body-lg/accent. Truncates to one line.
|
|
17
|
+
*/
|
|
18
|
+
label: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* `amount` only — the secondary currency row under the price, e.g. the
|
|
21
|
+
* virtual-currency amount the top-up grants. Figma exposes this as a
|
|
22
|
+
* `CurrencyValue` instance, so pass a `CurrencyTag` (or any node).
|
|
23
|
+
*/
|
|
24
|
+
currency?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* `payment` only — the provider's brand mark. Rendered in a fixed 32×32
|
|
27
|
+
* slot with a 4 px radius, so pass an `img`, an SVG logo or a brand icon.
|
|
28
|
+
*/
|
|
29
|
+
logo?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Optional chip pinned to the top-right corner (Figma's `Show Tag`
|
|
32
|
+
* boolean). The slot is unopinionated — pass a `Tag`, a discount badge or
|
|
33
|
+
* any node. Omit it to hide the corner entirely.
|
|
34
|
+
*/
|
|
35
|
+
tag?: ReactNode;
|
|
36
|
+
/** Whether the tile is the chosen option. Drives `aria-pressed`. */
|
|
37
|
+
selected?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Visual state override. Web resolves hover and selection on its own —
|
|
40
|
+
* pass this explicitly only for design review and visual tests.
|
|
41
|
+
*/
|
|
42
|
+
state?: PaymentSelectorState;
|
|
43
|
+
/** Figma `Mobile?=On`: drops the payment label to 16/20. */
|
|
44
|
+
compact?: boolean;
|
|
45
|
+
/** Removes interactivity and dims the tile. */
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
/** Selects this option. Required for the tile to be interactive. */
|
|
48
|
+
onPress?: () => void;
|
|
49
|
+
/** Tile width. Defaults to the 148 px Figma frame; pass `"100%"` to fill a grid cell. */
|
|
50
|
+
width?: number | string;
|
|
51
|
+
"aria-label"?: string;
|
|
52
|
+
testID?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare const PaymentSelector: React.FC<PaymentSelectorProps>;
|
|
56
|
+
|
|
57
|
+
export { PaymentSelector, type PaymentSelectorProps, type PaymentSelectorState, type PaymentSelectorType };
|
package/native/index.js
ADDED
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.tsx
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
PaymentSelector: () => PaymentSelector
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
|
|
27
|
+
// ../../foundation/primitives-native/src/Box.tsx
|
|
28
|
+
var import_react_native = require("react-native");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
var roleToAccessibilityRole = {
|
|
31
|
+
button: "button",
|
|
32
|
+
link: "link",
|
|
33
|
+
img: "image",
|
|
34
|
+
image: "image",
|
|
35
|
+
summary: "summary",
|
|
36
|
+
switch: "switch",
|
|
37
|
+
checkbox: "checkbox",
|
|
38
|
+
radio: "radio",
|
|
39
|
+
heading: "header",
|
|
40
|
+
text: "text",
|
|
41
|
+
search: "search",
|
|
42
|
+
alert: "alert",
|
|
43
|
+
none: "none",
|
|
44
|
+
presentation: "none",
|
|
45
|
+
progressbar: "progressbar",
|
|
46
|
+
scrollbar: "scrollbar",
|
|
47
|
+
adjustable: "adjustable",
|
|
48
|
+
tab: "tab",
|
|
49
|
+
menu: "menu",
|
|
50
|
+
menuitem: "menuitem",
|
|
51
|
+
list: "list",
|
|
52
|
+
timer: "timer"
|
|
53
|
+
};
|
|
54
|
+
var toGapValue = (gap) => {
|
|
55
|
+
if (gap === void 0) return void 0;
|
|
56
|
+
if (typeof gap === "number") return gap;
|
|
57
|
+
const pxMatch = /^(\d+(?:\.\d+)?)px$/.exec(gap);
|
|
58
|
+
if (pxMatch) return Number(pxMatch[1]);
|
|
59
|
+
const asNumber = Number(gap);
|
|
60
|
+
return Number.isFinite(asNumber) ? asNumber : void 0;
|
|
61
|
+
};
|
|
62
|
+
var Box = ({
|
|
63
|
+
children,
|
|
64
|
+
onPress,
|
|
65
|
+
onLayout,
|
|
66
|
+
onMoveShouldSetResponder,
|
|
67
|
+
onResponderGrant,
|
|
68
|
+
onResponderMove,
|
|
69
|
+
onResponderRelease,
|
|
70
|
+
onResponderTerminate,
|
|
71
|
+
backgroundColor,
|
|
72
|
+
borderColor,
|
|
73
|
+
borderWidth,
|
|
74
|
+
borderBottomWidth,
|
|
75
|
+
borderBottomColor,
|
|
76
|
+
borderTopWidth,
|
|
77
|
+
borderTopColor,
|
|
78
|
+
borderLeftWidth,
|
|
79
|
+
borderLeftColor,
|
|
80
|
+
borderRightWidth,
|
|
81
|
+
borderRightColor,
|
|
82
|
+
borderRadius,
|
|
83
|
+
borderStyle,
|
|
84
|
+
height,
|
|
85
|
+
padding,
|
|
86
|
+
paddingHorizontal,
|
|
87
|
+
paddingVertical,
|
|
88
|
+
margin,
|
|
89
|
+
marginTop,
|
|
90
|
+
marginBottom,
|
|
91
|
+
marginLeft,
|
|
92
|
+
marginRight,
|
|
93
|
+
flexDirection,
|
|
94
|
+
flexWrap,
|
|
95
|
+
alignItems,
|
|
96
|
+
justifyContent,
|
|
97
|
+
alignSelf,
|
|
98
|
+
position,
|
|
99
|
+
top,
|
|
100
|
+
bottom,
|
|
101
|
+
left,
|
|
102
|
+
right,
|
|
103
|
+
width,
|
|
104
|
+
minWidth,
|
|
105
|
+
minHeight,
|
|
106
|
+
maxWidth,
|
|
107
|
+
maxHeight,
|
|
108
|
+
flex,
|
|
109
|
+
flexShrink,
|
|
110
|
+
gap,
|
|
111
|
+
overflow,
|
|
112
|
+
opacity,
|
|
113
|
+
zIndex,
|
|
114
|
+
hoverStyle,
|
|
115
|
+
pressStyle,
|
|
116
|
+
style,
|
|
117
|
+
disabled,
|
|
118
|
+
"data-testid": dataTestId,
|
|
119
|
+
testID,
|
|
120
|
+
as,
|
|
121
|
+
src,
|
|
122
|
+
alt,
|
|
123
|
+
...rest
|
|
124
|
+
}) => {
|
|
125
|
+
const getContainerStyle = (pressed) => ({
|
|
126
|
+
backgroundColor: pressed && pressStyle?.backgroundColor ? pressStyle.backgroundColor : backgroundColor,
|
|
127
|
+
borderColor,
|
|
128
|
+
borderWidth,
|
|
129
|
+
borderBottomWidth,
|
|
130
|
+
borderBottomColor,
|
|
131
|
+
borderTopWidth,
|
|
132
|
+
borderTopColor,
|
|
133
|
+
borderLeftWidth,
|
|
134
|
+
borderLeftColor,
|
|
135
|
+
borderRightWidth,
|
|
136
|
+
borderRightColor,
|
|
137
|
+
borderRadius,
|
|
138
|
+
borderStyle,
|
|
139
|
+
overflow,
|
|
140
|
+
opacity: opacity ?? (disabled ? 0.5 : void 0),
|
|
141
|
+
zIndex,
|
|
142
|
+
height,
|
|
143
|
+
width,
|
|
144
|
+
minWidth,
|
|
145
|
+
minHeight,
|
|
146
|
+
maxWidth,
|
|
147
|
+
maxHeight,
|
|
148
|
+
padding,
|
|
149
|
+
paddingHorizontal,
|
|
150
|
+
paddingVertical,
|
|
151
|
+
margin,
|
|
152
|
+
marginTop,
|
|
153
|
+
marginBottom,
|
|
154
|
+
marginLeft,
|
|
155
|
+
marginRight,
|
|
156
|
+
flexDirection,
|
|
157
|
+
flexWrap,
|
|
158
|
+
alignItems,
|
|
159
|
+
justifyContent,
|
|
160
|
+
alignSelf,
|
|
161
|
+
position,
|
|
162
|
+
top,
|
|
163
|
+
bottom,
|
|
164
|
+
left,
|
|
165
|
+
right,
|
|
166
|
+
flex,
|
|
167
|
+
flexShrink,
|
|
168
|
+
gap: toGapValue(gap),
|
|
169
|
+
...style
|
|
170
|
+
});
|
|
171
|
+
const finalTestID = dataTestId || testID;
|
|
172
|
+
const {
|
|
173
|
+
role,
|
|
174
|
+
tabIndex,
|
|
175
|
+
onKeyDown,
|
|
176
|
+
onKeyUp,
|
|
177
|
+
"aria-label": ariaLabel,
|
|
178
|
+
"aria-labelledby": _ariaLabelledBy,
|
|
179
|
+
"aria-current": _ariaCurrent,
|
|
180
|
+
"aria-disabled": ariaDisabled,
|
|
181
|
+
"aria-live": ariaLive,
|
|
182
|
+
"aria-busy": ariaBusy,
|
|
183
|
+
className,
|
|
184
|
+
"data-testid": _dataTestId,
|
|
185
|
+
cursor: _cursor,
|
|
186
|
+
type: _type,
|
|
187
|
+
...nativeRest
|
|
188
|
+
} = rest;
|
|
189
|
+
const accessibilityRole = typeof role === "string" && roleToAccessibilityRole[role] || (as === "button" ? "button" : void 0);
|
|
190
|
+
const isDisabled = Boolean(disabled || ariaDisabled);
|
|
191
|
+
const accessibilityState = {
|
|
192
|
+
disabled: isDisabled || void 0,
|
|
193
|
+
busy: Boolean(ariaBusy) || void 0
|
|
194
|
+
};
|
|
195
|
+
const accessibilityLiveRegion = ariaLive === "polite" || ariaLive === "assertive" ? ariaLive : void 0;
|
|
196
|
+
if (as === "img" && src) {
|
|
197
|
+
const imageStyle = {
|
|
198
|
+
width,
|
|
199
|
+
height,
|
|
200
|
+
borderRadius,
|
|
201
|
+
position,
|
|
202
|
+
top,
|
|
203
|
+
bottom,
|
|
204
|
+
left,
|
|
205
|
+
right,
|
|
206
|
+
...style
|
|
207
|
+
};
|
|
208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
209
|
+
import_react_native.Image,
|
|
210
|
+
{
|
|
211
|
+
source: { uri: src },
|
|
212
|
+
style: imageStyle,
|
|
213
|
+
testID: finalTestID,
|
|
214
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : alt,
|
|
215
|
+
resizeMode: "cover",
|
|
216
|
+
...nativeRest
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
if (onPress || as === "button") {
|
|
221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
222
|
+
import_react_native.Pressable,
|
|
223
|
+
{
|
|
224
|
+
onPress: !isDisabled && onPress ? onPress : void 0,
|
|
225
|
+
disabled: isDisabled,
|
|
226
|
+
onLayout,
|
|
227
|
+
onMoveShouldSetResponder,
|
|
228
|
+
onResponderGrant,
|
|
229
|
+
onResponderMove,
|
|
230
|
+
onResponderRelease,
|
|
231
|
+
onResponderTerminate,
|
|
232
|
+
style: ({ pressed }) => getContainerStyle(pressed),
|
|
233
|
+
testID: finalTestID,
|
|
234
|
+
accessibilityRole,
|
|
235
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : void 0,
|
|
236
|
+
accessibilityState,
|
|
237
|
+
accessibilityLiveRegion,
|
|
238
|
+
...nativeRest,
|
|
239
|
+
children
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
244
|
+
import_react_native.View,
|
|
245
|
+
{
|
|
246
|
+
style: getContainerStyle(),
|
|
247
|
+
testID: finalTestID,
|
|
248
|
+
onLayout,
|
|
249
|
+
onMoveShouldSetResponder,
|
|
250
|
+
onResponderGrant,
|
|
251
|
+
onResponderMove,
|
|
252
|
+
onResponderRelease,
|
|
253
|
+
onResponderTerminate,
|
|
254
|
+
accessibilityRole,
|
|
255
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : void 0,
|
|
256
|
+
accessibilityState,
|
|
257
|
+
accessibilityLiveRegion,
|
|
258
|
+
...nativeRest,
|
|
259
|
+
children
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
// ../../foundation/primitives-native/src/Text.tsx
|
|
265
|
+
var import_react_native2 = require("react-native");
|
|
266
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
267
|
+
var roleMap = {
|
|
268
|
+
alert: "alert",
|
|
269
|
+
heading: "header",
|
|
270
|
+
button: "button",
|
|
271
|
+
link: "link",
|
|
272
|
+
text: "text"
|
|
273
|
+
};
|
|
274
|
+
var parseNumericValue = (value) => {
|
|
275
|
+
if (value === void 0) return void 0;
|
|
276
|
+
if (typeof value === "number") return value;
|
|
277
|
+
const parsed = parseFloat(value);
|
|
278
|
+
return isNaN(parsed) ? void 0 : parsed;
|
|
279
|
+
};
|
|
280
|
+
var Text = ({
|
|
281
|
+
children,
|
|
282
|
+
color,
|
|
283
|
+
fontSize,
|
|
284
|
+
fontWeight,
|
|
285
|
+
fontFamily,
|
|
286
|
+
textAlign,
|
|
287
|
+
lineHeight,
|
|
288
|
+
numberOfLines,
|
|
289
|
+
id,
|
|
290
|
+
role,
|
|
291
|
+
testID,
|
|
292
|
+
"data-testid": dataTestId,
|
|
293
|
+
style: styleProp,
|
|
294
|
+
...props
|
|
295
|
+
}) => {
|
|
296
|
+
let resolvedFontFamily = fontFamily ? fontFamily.split(",")[0].replace(/['"]/g, "").trim() : void 0;
|
|
297
|
+
if (resolvedFontFamily === "Pilat Wide" || resolvedFontFamily === "Pilat Wide Bold" || resolvedFontFamily === "Aktiv Grotesk") {
|
|
298
|
+
resolvedFontFamily = void 0;
|
|
299
|
+
}
|
|
300
|
+
const incomingStyle = import_react_native2.StyleSheet.flatten(styleProp);
|
|
301
|
+
const baseStyle = {
|
|
302
|
+
color: color ?? incomingStyle?.color,
|
|
303
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
304
|
+
fontWeight,
|
|
305
|
+
fontFamily: resolvedFontFamily,
|
|
306
|
+
textDecorationLine: props.textDecoration,
|
|
307
|
+
textAlign: textAlign ?? incomingStyle?.textAlign,
|
|
308
|
+
lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),
|
|
309
|
+
marginTop: parseNumericValue(
|
|
310
|
+
incomingStyle?.marginTop
|
|
311
|
+
),
|
|
312
|
+
marginBottom: parseNumericValue(
|
|
313
|
+
incomingStyle?.marginBottom
|
|
314
|
+
)
|
|
315
|
+
};
|
|
316
|
+
const accessibilityRole = role ? roleMap[role] : void 0;
|
|
317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
318
|
+
import_react_native2.Text,
|
|
319
|
+
{
|
|
320
|
+
style: baseStyle,
|
|
321
|
+
numberOfLines,
|
|
322
|
+
testID: dataTestId || testID || id,
|
|
323
|
+
accessibilityRole,
|
|
324
|
+
children
|
|
325
|
+
}
|
|
326
|
+
);
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
// src/PaymentSelector.tsx
|
|
330
|
+
var import_xui_core = require("@xsolla/xui-core");
|
|
331
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
332
|
+
var TILE_WIDTH = 148;
|
|
333
|
+
var TILE_HEIGHT = 128;
|
|
334
|
+
var TILE_PADDING = 12;
|
|
335
|
+
var TILE_RADIUS = 8;
|
|
336
|
+
var LOGO_SIZE = 32;
|
|
337
|
+
var LOGO_RADIUS = 4;
|
|
338
|
+
var AMOUNT_GAP = 4;
|
|
339
|
+
var PAYMENT_GAP = 12;
|
|
340
|
+
var TITLE_TYPOGRAPHY = {
|
|
341
|
+
amount: { fontSize: 24, lineHeight: 24, fontWeight: "700" },
|
|
342
|
+
payment: { fontSize: 18, lineHeight: 24, fontWeight: "500" },
|
|
343
|
+
paymentCompact: { fontSize: 16, lineHeight: 20, fontWeight: "500" }
|
|
344
|
+
};
|
|
345
|
+
var resolveSurface = (state, theme) => {
|
|
346
|
+
if (state === "selected") {
|
|
347
|
+
return {
|
|
348
|
+
backgroundColor: theme.colors.control.mono.secondary.bg,
|
|
349
|
+
overlay: theme.colors.overlay.brand,
|
|
350
|
+
borderColor: theme.colors.border.brand
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
return {
|
|
354
|
+
backgroundColor: state === "hover" ? theme.colors.overlay.monoHover : theme.colors.overlay.mono,
|
|
355
|
+
// Default and Hover hide the stroke in Figma, but the 1 px border is kept
|
|
356
|
+
// transparent so selecting a tile does not shift its content by a pixel.
|
|
357
|
+
overlay: void 0,
|
|
358
|
+
borderColor: "transparent"
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
var asPlainText = (value) => typeof value === "string" ? value : void 0;
|
|
362
|
+
var PaymentSelector = ({
|
|
363
|
+
type = "amount",
|
|
364
|
+
label,
|
|
365
|
+
currency,
|
|
366
|
+
logo,
|
|
367
|
+
tag,
|
|
368
|
+
selected = false,
|
|
369
|
+
state,
|
|
370
|
+
compact = false,
|
|
371
|
+
disabled,
|
|
372
|
+
onPress,
|
|
373
|
+
width = TILE_WIDTH,
|
|
374
|
+
"aria-label": ariaLabel,
|
|
375
|
+
testID,
|
|
376
|
+
themeMode,
|
|
377
|
+
themeProductContext = "b2c"
|
|
378
|
+
}) => {
|
|
379
|
+
const { theme } = (0, import_xui_core.useResolvedTheme)({ themeMode, themeProductContext });
|
|
380
|
+
const isDisabled = Boolean(disabled);
|
|
381
|
+
const isInteractive = Boolean(onPress) && !isDisabled;
|
|
382
|
+
const isAmount = type === "amount";
|
|
383
|
+
const resolvedState = state ?? (selected ? "selected" : "default");
|
|
384
|
+
const isSelected = resolvedState === "selected";
|
|
385
|
+
const surface = resolveSurface(resolvedState, theme);
|
|
386
|
+
const titleStyle = isAmount ? TITLE_TYPOGRAPHY.amount : compact ? TITLE_TYPOGRAPHY.paymentCompact : TITLE_TYPOGRAPHY.payment;
|
|
387
|
+
const hoverSurface = resolveSurface("hover", theme);
|
|
388
|
+
const selectedSurface = resolveSurface("selected", theme);
|
|
389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
390
|
+
Box,
|
|
391
|
+
{
|
|
392
|
+
width,
|
|
393
|
+
height: TILE_HEIGHT,
|
|
394
|
+
flexDirection: "column",
|
|
395
|
+
justifyContent: isAmount ? "flex-end" : "space-between",
|
|
396
|
+
gap: isAmount ? AMOUNT_GAP : PAYMENT_GAP,
|
|
397
|
+
padding: TILE_PADDING,
|
|
398
|
+
borderRadius: TILE_RADIUS,
|
|
399
|
+
borderWidth: 1,
|
|
400
|
+
borderStyle: "solid",
|
|
401
|
+
borderColor: surface.borderColor,
|
|
402
|
+
backgroundColor: surface.backgroundColor,
|
|
403
|
+
position: "relative",
|
|
404
|
+
overflow: "hidden",
|
|
405
|
+
opacity: isDisabled ? 0.48 : 1,
|
|
406
|
+
cursor: isInteractive ? "pointer" : void 0,
|
|
407
|
+
role: isInteractive ? "button" : "group",
|
|
408
|
+
"aria-pressed": isInteractive ? isSelected : void 0,
|
|
409
|
+
"aria-label": ariaLabel || asPlainText(label),
|
|
410
|
+
"aria-disabled": isDisabled || void 0,
|
|
411
|
+
tabIndex: isInteractive ? 0 : void 0,
|
|
412
|
+
onPress: isInteractive ? onPress : void 0,
|
|
413
|
+
hoverStyle: isInteractive && !isSelected ? { backgroundColor: hoverSurface.backgroundColor } : void 0,
|
|
414
|
+
pressStyle: isInteractive ? {
|
|
415
|
+
backgroundColor: selectedSurface.backgroundColor,
|
|
416
|
+
borderColor: selectedSurface.borderColor
|
|
417
|
+
} : void 0,
|
|
418
|
+
style: surface.overlay ? {
|
|
419
|
+
backgroundImage: `linear-gradient(${surface.overlay}, ${surface.overlay})`
|
|
420
|
+
} : void 0,
|
|
421
|
+
testID: testID || "payment-selector",
|
|
422
|
+
children: [
|
|
423
|
+
!isAmount && logo && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
424
|
+
Box,
|
|
425
|
+
{
|
|
426
|
+
width: LOGO_SIZE,
|
|
427
|
+
height: LOGO_SIZE,
|
|
428
|
+
flexShrink: 0,
|
|
429
|
+
borderRadius: LOGO_RADIUS,
|
|
430
|
+
overflow: "hidden",
|
|
431
|
+
alignItems: "center",
|
|
432
|
+
justifyContent: "center",
|
|
433
|
+
testID: "payment-selector-logo",
|
|
434
|
+
children: logo
|
|
435
|
+
}
|
|
436
|
+
),
|
|
437
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box, { flexDirection: "column", gap: AMOUNT_GAP, children: [
|
|
438
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
439
|
+
Text,
|
|
440
|
+
{
|
|
441
|
+
color: theme.colors.content.primary,
|
|
442
|
+
fontFamily: isAmount ? theme.fonts.heading : theme.fonts.body,
|
|
443
|
+
fontSize: titleStyle.fontSize,
|
|
444
|
+
lineHeight: titleStyle.lineHeight,
|
|
445
|
+
fontWeight: titleStyle.fontWeight,
|
|
446
|
+
numberOfLines: 1,
|
|
447
|
+
testID: "payment-selector-label",
|
|
448
|
+
children: label
|
|
449
|
+
}
|
|
450
|
+
),
|
|
451
|
+
isAmount && currency && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
452
|
+
Box,
|
|
453
|
+
{
|
|
454
|
+
flexDirection: "row",
|
|
455
|
+
alignItems: "center",
|
|
456
|
+
testID: "payment-selector-currency",
|
|
457
|
+
children: currency
|
|
458
|
+
}
|
|
459
|
+
)
|
|
460
|
+
] }),
|
|
461
|
+
tag && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
462
|
+
Box,
|
|
463
|
+
{
|
|
464
|
+
position: "absolute",
|
|
465
|
+
top: TILE_PADDING,
|
|
466
|
+
right: TILE_PADDING,
|
|
467
|
+
testID: "payment-selector-tag",
|
|
468
|
+
children: tag
|
|
469
|
+
}
|
|
470
|
+
)
|
|
471
|
+
]
|
|
472
|
+
}
|
|
473
|
+
);
|
|
474
|
+
};
|
|
475
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
476
|
+
0 && (module.exports = {
|
|
477
|
+
PaymentSelector
|
|
478
|
+
});
|
|
479
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../src/PaymentSelector.tsx"],"sourcesContent":["export { PaymentSelector } from \"./PaymentSelector\";\n\nexport type {\n PaymentSelectorProps,\n PaymentSelectorState,\n PaymentSelectorType,\n} from \"./types\";\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","import React 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 type { PaymentSelectorProps, PaymentSelectorState } from \"./types\";\n\ntype ResolvedTheme = ReturnType<typeof useResolvedTheme>[\"theme\"];\n\n/** Figma `PaymentSelector` (5618:6779): 148×128 frame, 12 px padding, 8 px radius. */\nconst TILE_WIDTH = 148;\nconst TILE_HEIGHT = 128;\nconst TILE_PADDING = 12;\nconst TILE_RADIUS = 8;\n/** Figma: the brand mark is a fixed 32×32 chip with a 4 px radius. */\nconst LOGO_SIZE = 32;\nconst LOGO_RADIUS = 4;\n/** Figma: `amount` stacks title + currency 4 px apart; `payment` spaces logo and title 12 px apart. */\nconst AMOUNT_GAP = 4;\nconst PAYMENT_GAP = 12;\n\n/**\n * Figma pins the title to a text style per `Type` (and per `Mobile?`):\n * `amount` -> heading/h4 (24/24/700, display face);\n * `payment` -> basic/body-lg/accent (18/24/500, body face), dropping to\n * body-md/accent (16/20/500) when `Mobile?=On`.\n */\nconst TITLE_TYPOGRAPHY = {\n amount: { fontSize: 24, lineHeight: 24, fontWeight: \"700\" as const },\n payment: { fontSize: 18, lineHeight: 24, fontWeight: \"500\" as const },\n paymentCompact: { fontSize: 16, lineHeight: 20, fontWeight: \"500\" as const },\n};\n\ninterface Surface {\n backgroundColor: string;\n /** Second fill stacked over `backgroundColor`, mirroring Figma's two-fill Selected state. */\n overlay?: string;\n borderColor: string;\n}\n\nconst resolveSurface = (\n state: PaymentSelectorState,\n theme: ResolvedTheme\n): Surface => {\n if (state === \"selected\") {\n // Figma paints Selected as TWO stacked fills — an opaque\n // control/mono/secondary base with overlay/brand on top — then adds the\n // brand border. A single translucent overlay/brand over the page would\n // read several steps darker, so both layers are reproduced.\n return {\n backgroundColor: theme.colors.control.mono.secondary.bg,\n overlay: theme.colors.overlay.brand,\n borderColor: theme.colors.border.brand,\n };\n }\n\n return {\n backgroundColor:\n state === \"hover\"\n ? theme.colors.overlay.monoHover\n : theme.colors.overlay.mono,\n // Default and Hover hide the stroke in Figma, but the 1 px border is kept\n // transparent so selecting a tile does not shift its content by a pixel.\n overlay: undefined,\n borderColor: \"transparent\",\n };\n};\n\nconst asPlainText = (value: React.ReactNode): string | undefined =>\n typeof value === \"string\" ? value : undefined;\n\nexport const PaymentSelector: React.FC<PaymentSelectorProps> = ({\n type = \"amount\",\n label,\n currency,\n logo,\n tag,\n selected = false,\n state,\n compact = false,\n disabled,\n onPress,\n width = TILE_WIDTH,\n \"aria-label\": ariaLabel,\n testID,\n themeMode,\n themeProductContext = \"b2c\",\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n\n const isDisabled = Boolean(disabled);\n const isInteractive = Boolean(onPress) && !isDisabled;\n const isAmount = type === \"amount\";\n\n const resolvedState: PaymentSelectorState =\n state ?? (selected ? \"selected\" : \"default\");\n const isSelected = resolvedState === \"selected\";\n const surface = resolveSurface(resolvedState, theme);\n\n const titleStyle = isAmount\n ? TITLE_TYPOGRAPHY.amount\n : compact\n ? TITLE_TYPOGRAPHY.paymentCompact\n : TITLE_TYPOGRAPHY.payment;\n\n const hoverSurface = resolveSurface(\"hover\", theme);\n const selectedSurface = resolveSurface(\"selected\", theme);\n\n return (\n <Box\n width={width}\n height={TILE_HEIGHT}\n flexDirection=\"column\"\n // Figma: `amount` bottom-aligns its stack (MAX); `payment` pins the logo\n // to the top and the label to the bottom (SPACE_BETWEEN).\n justifyContent={isAmount ? \"flex-end\" : \"space-between\"}\n gap={isAmount ? AMOUNT_GAP : PAYMENT_GAP}\n padding={TILE_PADDING}\n borderRadius={TILE_RADIUS}\n borderWidth={1}\n borderStyle=\"solid\"\n borderColor={surface.borderColor}\n backgroundColor={surface.backgroundColor}\n position=\"relative\"\n overflow=\"hidden\"\n opacity={isDisabled ? 0.48 : 1}\n cursor={isInteractive ? \"pointer\" : undefined}\n role={isInteractive ? \"button\" : \"group\"}\n aria-pressed={isInteractive ? isSelected : undefined}\n aria-label={ariaLabel || asPlainText(label)}\n aria-disabled={isDisabled || undefined}\n tabIndex={isInteractive ? 0 : undefined}\n onPress={isInteractive ? onPress : undefined}\n hoverStyle={\n isInteractive && !isSelected\n ? { backgroundColor: hoverSurface.backgroundColor }\n : undefined\n }\n pressStyle={\n isInteractive\n ? {\n backgroundColor: selectedSurface.backgroundColor,\n borderColor: selectedSurface.borderColor,\n }\n : undefined\n }\n // The second Figma fill is painted as a flat gradient over the base\n // colour rather than an extra absolutely-positioned layer, so it cannot\n // stack above the tile's own content or the Tag slot.\n style={\n surface.overlay\n ? {\n backgroundImage: `linear-gradient(${surface.overlay}, ${surface.overlay})`,\n }\n : undefined\n }\n testID={testID || \"payment-selector\"}\n >\n {!isAmount && logo && (\n <Box\n width={LOGO_SIZE}\n height={LOGO_SIZE}\n flexShrink={0}\n borderRadius={LOGO_RADIUS}\n overflow=\"hidden\"\n alignItems=\"center\"\n justifyContent=\"center\"\n testID=\"payment-selector-logo\"\n >\n {logo}\n </Box>\n )}\n\n <Box flexDirection=\"column\" gap={AMOUNT_GAP}>\n <Text\n color={theme.colors.content.primary}\n fontFamily={isAmount ? theme.fonts.heading : theme.fonts.body}\n fontSize={titleStyle.fontSize}\n lineHeight={titleStyle.lineHeight}\n fontWeight={titleStyle.fontWeight}\n numberOfLines={1}\n testID=\"payment-selector-label\"\n >\n {label}\n </Text>\n\n {isAmount && currency && (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n testID=\"payment-selector-currency\"\n >\n {currency}\n </Box>\n )}\n </Box>\n\n {tag && (\n <Box\n position=\"absolute\"\n top={TILE_PADDING}\n right={TILE_PADDING}\n testID=\"payment-selector-tag\"\n >\n {tag}\n </Box>\n )}\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,0BASO;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,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