@xsolla/xui-list 0.64.0-pr56.1768440195
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/native/index.d.mts +22 -0
- package/native/index.d.ts +22 -0
- package/native/index.js +593 -0
- package/native/index.js.map +1 -0
- package/native/index.mjs +560 -0
- package/native/index.mjs.map +1 -0
- package/package.json +47 -0
- package/web/index.d.mts +22 -0
- package/web/index.d.ts +22 -0
- package/web/index.js +581 -0
- package/web/index.js.map +1 -0
- package/web/index.mjs +544 -0
- package/web/index.mjs.map +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { BoxProps } from '@xsolla/xui-primitives-core';
|
|
3
|
+
|
|
4
|
+
interface ListProps extends BoxProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface ListRowProps extends BoxProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
hoverable?: boolean;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
onPress?: () => void;
|
|
12
|
+
}
|
|
13
|
+
interface ListTitleProps extends BoxProps {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare const List: React.ForwardRefExoticComponent<ListProps & React.RefAttributes<any>> & {
|
|
18
|
+
Row: React.ForwardRefExoticComponent<ListRowProps & React.RefAttributes<any>>;
|
|
19
|
+
Title: React.ForwardRefExoticComponent<ListTitleProps & React.RefAttributes<any>>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { List, type ListProps, type ListRowProps, type ListTitleProps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { BoxProps } from '@xsolla/xui-primitives-core';
|
|
3
|
+
|
|
4
|
+
interface ListProps extends BoxProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface ListRowProps extends BoxProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
hoverable?: boolean;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
onPress?: () => void;
|
|
12
|
+
}
|
|
13
|
+
interface ListTitleProps extends BoxProps {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare const List: React.ForwardRefExoticComponent<ListProps & React.RefAttributes<any>> & {
|
|
18
|
+
Row: React.ForwardRefExoticComponent<ListRowProps & React.RefAttributes<any>>;
|
|
19
|
+
Title: React.ForwardRefExoticComponent<ListTitleProps & React.RefAttributes<any>>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { List, type ListProps, type ListRowProps, type ListTitleProps };
|
package/native/index.js
ADDED
|
@@ -0,0 +1,593 @@
|
|
|
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
|
+
List: () => List
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
|
|
37
|
+
// src/List.tsx
|
|
38
|
+
var import_react4 = require("react");
|
|
39
|
+
|
|
40
|
+
// ../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
|
+
flex,
|
|
84
|
+
overflow,
|
|
85
|
+
zIndex,
|
|
86
|
+
hoverStyle,
|
|
87
|
+
pressStyle,
|
|
88
|
+
style,
|
|
89
|
+
"data-testid": dataTestId,
|
|
90
|
+
testID,
|
|
91
|
+
as,
|
|
92
|
+
src,
|
|
93
|
+
alt,
|
|
94
|
+
...rest
|
|
95
|
+
}) => {
|
|
96
|
+
const getContainerStyle = (pressed) => ({
|
|
97
|
+
backgroundColor: pressed && pressStyle?.backgroundColor ? pressStyle.backgroundColor : backgroundColor,
|
|
98
|
+
borderColor,
|
|
99
|
+
borderWidth,
|
|
100
|
+
borderBottomWidth,
|
|
101
|
+
borderBottomColor,
|
|
102
|
+
borderTopWidth,
|
|
103
|
+
borderTopColor,
|
|
104
|
+
borderLeftWidth,
|
|
105
|
+
borderLeftColor,
|
|
106
|
+
borderRightWidth,
|
|
107
|
+
borderRightColor,
|
|
108
|
+
borderRadius,
|
|
109
|
+
borderStyle,
|
|
110
|
+
overflow,
|
|
111
|
+
zIndex,
|
|
112
|
+
height,
|
|
113
|
+
width,
|
|
114
|
+
padding,
|
|
115
|
+
paddingHorizontal,
|
|
116
|
+
paddingVertical,
|
|
117
|
+
margin,
|
|
118
|
+
marginTop,
|
|
119
|
+
marginBottom,
|
|
120
|
+
marginLeft,
|
|
121
|
+
marginRight,
|
|
122
|
+
flexDirection,
|
|
123
|
+
alignItems,
|
|
124
|
+
justifyContent,
|
|
125
|
+
position,
|
|
126
|
+
top,
|
|
127
|
+
bottom,
|
|
128
|
+
left,
|
|
129
|
+
right,
|
|
130
|
+
flex,
|
|
131
|
+
...style
|
|
132
|
+
});
|
|
133
|
+
const finalTestID = dataTestId || testID;
|
|
134
|
+
const {
|
|
135
|
+
role,
|
|
136
|
+
tabIndex,
|
|
137
|
+
onKeyDown,
|
|
138
|
+
onKeyUp,
|
|
139
|
+
"aria-label": _ariaLabel,
|
|
140
|
+
"aria-labelledby": _ariaLabelledBy,
|
|
141
|
+
"aria-current": _ariaCurrent,
|
|
142
|
+
"aria-disabled": _ariaDisabled,
|
|
143
|
+
"aria-live": _ariaLive,
|
|
144
|
+
className,
|
|
145
|
+
"data-testid": _dataTestId,
|
|
146
|
+
...nativeRest
|
|
147
|
+
} = rest;
|
|
148
|
+
if (as === "img" && src) {
|
|
149
|
+
const imageStyle = {
|
|
150
|
+
width,
|
|
151
|
+
height,
|
|
152
|
+
borderRadius,
|
|
153
|
+
position,
|
|
154
|
+
top,
|
|
155
|
+
bottom,
|
|
156
|
+
left,
|
|
157
|
+
right,
|
|
158
|
+
...style
|
|
159
|
+
};
|
|
160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
+
import_react_native.Image,
|
|
162
|
+
{
|
|
163
|
+
source: { uri: src },
|
|
164
|
+
style: imageStyle,
|
|
165
|
+
testID: finalTestID,
|
|
166
|
+
resizeMode: "cover",
|
|
167
|
+
...nativeRest
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
if (onPress) {
|
|
172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
173
|
+
import_react_native.Pressable,
|
|
174
|
+
{
|
|
175
|
+
onPress,
|
|
176
|
+
onLayout,
|
|
177
|
+
onMoveShouldSetResponder,
|
|
178
|
+
onResponderGrant,
|
|
179
|
+
onResponderMove,
|
|
180
|
+
onResponderRelease,
|
|
181
|
+
onResponderTerminate,
|
|
182
|
+
style: ({ pressed }) => getContainerStyle(pressed),
|
|
183
|
+
testID: finalTestID,
|
|
184
|
+
...nativeRest,
|
|
185
|
+
children
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
190
|
+
import_react_native.View,
|
|
191
|
+
{
|
|
192
|
+
style: getContainerStyle(),
|
|
193
|
+
testID: finalTestID,
|
|
194
|
+
onLayout,
|
|
195
|
+
onMoveShouldSetResponder,
|
|
196
|
+
onResponderGrant,
|
|
197
|
+
onResponderMove,
|
|
198
|
+
onResponderRelease,
|
|
199
|
+
onResponderTerminate,
|
|
200
|
+
...nativeRest,
|
|
201
|
+
children
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// ../primitives-native/src/Text.tsx
|
|
207
|
+
var import_react_native2 = require("react-native");
|
|
208
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
209
|
+
var roleMap = {
|
|
210
|
+
alert: "alert",
|
|
211
|
+
heading: "header",
|
|
212
|
+
button: "button",
|
|
213
|
+
link: "link",
|
|
214
|
+
text: "text"
|
|
215
|
+
};
|
|
216
|
+
var Text = ({
|
|
217
|
+
children,
|
|
218
|
+
color,
|
|
219
|
+
fontSize,
|
|
220
|
+
fontWeight,
|
|
221
|
+
fontFamily,
|
|
222
|
+
id,
|
|
223
|
+
role,
|
|
224
|
+
...props
|
|
225
|
+
}) => {
|
|
226
|
+
let resolvedFontFamily = fontFamily ? fontFamily.split(",")[0].replace(/['"]/g, "").trim() : void 0;
|
|
227
|
+
if (resolvedFontFamily === "Pilat Wide Bold") {
|
|
228
|
+
resolvedFontFamily = void 0;
|
|
229
|
+
}
|
|
230
|
+
const style = {
|
|
231
|
+
color,
|
|
232
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
233
|
+
fontWeight,
|
|
234
|
+
fontFamily: resolvedFontFamily,
|
|
235
|
+
textDecorationLine: props.textDecoration
|
|
236
|
+
};
|
|
237
|
+
const accessibilityRole = role ? roleMap[role] : void 0;
|
|
238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.Text, { style, testID: id, accessibilityRole, children });
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// ../primitives-native/src/Spinner.tsx
|
|
242
|
+
var import_react_native3 = require("react-native");
|
|
243
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
244
|
+
var Spinner = ({
|
|
245
|
+
color,
|
|
246
|
+
size,
|
|
247
|
+
role,
|
|
248
|
+
"aria-label": ariaLabel,
|
|
249
|
+
"aria-live": ariaLive,
|
|
250
|
+
"aria-describedby": ariaDescribedBy,
|
|
251
|
+
testID
|
|
252
|
+
}) => {
|
|
253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
254
|
+
import_react_native3.View,
|
|
255
|
+
{
|
|
256
|
+
accessible: true,
|
|
257
|
+
accessibilityRole: role === "status" ? "none" : void 0,
|
|
258
|
+
accessibilityLabel: ariaLabel,
|
|
259
|
+
accessibilityLiveRegion: ariaLive === "polite" ? "polite" : ariaLive === "assertive" ? "assertive" : "none",
|
|
260
|
+
testID,
|
|
261
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
262
|
+
import_react_native3.ActivityIndicator,
|
|
263
|
+
{
|
|
264
|
+
color,
|
|
265
|
+
size: typeof size === "number" ? size : "small"
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
};
|
|
271
|
+
Spinner.displayName = "Spinner";
|
|
272
|
+
|
|
273
|
+
// ../primitives-native/src/Icon.tsx
|
|
274
|
+
var import_react = __toESM(require("react"));
|
|
275
|
+
var import_react_native4 = require("react-native");
|
|
276
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
277
|
+
|
|
278
|
+
// ../primitives-native/src/Divider.tsx
|
|
279
|
+
var import_react_native5 = require("react-native");
|
|
280
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
281
|
+
|
|
282
|
+
// ../primitives-native/src/Input.tsx
|
|
283
|
+
var import_react2 = require("react");
|
|
284
|
+
var import_react_native6 = require("react-native");
|
|
285
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
286
|
+
var keyboardTypeMap = {
|
|
287
|
+
text: "default",
|
|
288
|
+
number: "numeric",
|
|
289
|
+
email: "email-address",
|
|
290
|
+
tel: "phone-pad",
|
|
291
|
+
url: "url",
|
|
292
|
+
decimal: "decimal-pad"
|
|
293
|
+
};
|
|
294
|
+
var inputModeToKeyboardType = {
|
|
295
|
+
none: "default",
|
|
296
|
+
text: "default",
|
|
297
|
+
decimal: "decimal-pad",
|
|
298
|
+
numeric: "number-pad",
|
|
299
|
+
tel: "phone-pad",
|
|
300
|
+
search: "default",
|
|
301
|
+
email: "email-address",
|
|
302
|
+
url: "url"
|
|
303
|
+
};
|
|
304
|
+
var autoCompleteToTextContentType = {
|
|
305
|
+
"one-time-code": "oneTimeCode",
|
|
306
|
+
email: "emailAddress",
|
|
307
|
+
username: "username",
|
|
308
|
+
password: "password",
|
|
309
|
+
"new-password": "newPassword",
|
|
310
|
+
tel: "telephoneNumber",
|
|
311
|
+
"postal-code": "postalCode",
|
|
312
|
+
name: "name"
|
|
313
|
+
};
|
|
314
|
+
var InputPrimitive = (0, import_react2.forwardRef)(
|
|
315
|
+
({
|
|
316
|
+
value,
|
|
317
|
+
placeholder,
|
|
318
|
+
onChange,
|
|
319
|
+
onChangeText,
|
|
320
|
+
onFocus,
|
|
321
|
+
onBlur,
|
|
322
|
+
onKeyDown,
|
|
323
|
+
disabled,
|
|
324
|
+
secureTextEntry,
|
|
325
|
+
style,
|
|
326
|
+
color,
|
|
327
|
+
fontSize,
|
|
328
|
+
placeholderTextColor,
|
|
329
|
+
maxLength,
|
|
330
|
+
name,
|
|
331
|
+
type,
|
|
332
|
+
inputMode,
|
|
333
|
+
autoComplete,
|
|
334
|
+
id,
|
|
335
|
+
"aria-invalid": ariaInvalid,
|
|
336
|
+
"aria-describedby": ariaDescribedBy,
|
|
337
|
+
"aria-labelledby": ariaLabelledBy,
|
|
338
|
+
"aria-label": ariaLabel,
|
|
339
|
+
"aria-disabled": ariaDisabled,
|
|
340
|
+
"data-testid": dataTestId
|
|
341
|
+
}, ref) => {
|
|
342
|
+
const handleChangeText = (text) => {
|
|
343
|
+
onChangeText?.(text);
|
|
344
|
+
if (onChange) {
|
|
345
|
+
const syntheticEvent = {
|
|
346
|
+
target: { value: text },
|
|
347
|
+
currentTarget: { value: text },
|
|
348
|
+
type: "change",
|
|
349
|
+
nativeEvent: { text },
|
|
350
|
+
preventDefault: () => {
|
|
351
|
+
},
|
|
352
|
+
stopPropagation: () => {
|
|
353
|
+
},
|
|
354
|
+
isTrusted: false
|
|
355
|
+
};
|
|
356
|
+
onChange(syntheticEvent);
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
const keyboardType = inputMode ? inputModeToKeyboardType[inputMode] || "default" : type ? keyboardTypeMap[type] || "default" : "default";
|
|
360
|
+
const textContentType = autoComplete ? autoCompleteToTextContentType[autoComplete] : void 0;
|
|
361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
362
|
+
import_react_native6.TextInput,
|
|
363
|
+
{
|
|
364
|
+
ref,
|
|
365
|
+
value,
|
|
366
|
+
placeholder,
|
|
367
|
+
onChangeText: handleChangeText,
|
|
368
|
+
onFocus,
|
|
369
|
+
onBlur,
|
|
370
|
+
onKeyPress: (e) => {
|
|
371
|
+
if (onKeyDown) {
|
|
372
|
+
onKeyDown({
|
|
373
|
+
key: e.nativeEvent.key,
|
|
374
|
+
preventDefault: () => {
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
editable: !disabled,
|
|
380
|
+
secureTextEntry: secureTextEntry || type === "password",
|
|
381
|
+
keyboardType,
|
|
382
|
+
textContentType,
|
|
383
|
+
style: [
|
|
384
|
+
{
|
|
385
|
+
color,
|
|
386
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
387
|
+
flex: 1,
|
|
388
|
+
padding: 0,
|
|
389
|
+
textAlign: style?.textAlign || "left"
|
|
390
|
+
},
|
|
391
|
+
style
|
|
392
|
+
],
|
|
393
|
+
placeholderTextColor,
|
|
394
|
+
maxLength,
|
|
395
|
+
testID: dataTestId || id,
|
|
396
|
+
accessibilityLabel: ariaLabel,
|
|
397
|
+
accessibilityHint: ariaDescribedBy,
|
|
398
|
+
accessibilityState: {
|
|
399
|
+
disabled: disabled || ariaDisabled
|
|
400
|
+
},
|
|
401
|
+
accessible: true
|
|
402
|
+
}
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
);
|
|
406
|
+
InputPrimitive.displayName = "InputPrimitive";
|
|
407
|
+
|
|
408
|
+
// ../primitives-native/src/TextArea.tsx
|
|
409
|
+
var import_react3 = require("react");
|
|
410
|
+
var import_react_native7 = require("react-native");
|
|
411
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
412
|
+
var TextAreaPrimitive = (0, import_react3.forwardRef)(
|
|
413
|
+
({
|
|
414
|
+
value,
|
|
415
|
+
placeholder,
|
|
416
|
+
onChange,
|
|
417
|
+
onChangeText,
|
|
418
|
+
onFocus,
|
|
419
|
+
onBlur,
|
|
420
|
+
onKeyDown,
|
|
421
|
+
disabled,
|
|
422
|
+
style,
|
|
423
|
+
color,
|
|
424
|
+
fontSize,
|
|
425
|
+
placeholderTextColor,
|
|
426
|
+
maxLength,
|
|
427
|
+
rows,
|
|
428
|
+
id,
|
|
429
|
+
"aria-invalid": ariaInvalid,
|
|
430
|
+
"aria-describedby": ariaDescribedBy,
|
|
431
|
+
"aria-labelledby": ariaLabelledBy,
|
|
432
|
+
"aria-label": ariaLabel,
|
|
433
|
+
"aria-disabled": ariaDisabled,
|
|
434
|
+
"data-testid": dataTestId
|
|
435
|
+
}, ref) => {
|
|
436
|
+
const handleChangeText = (text) => {
|
|
437
|
+
onChangeText?.(text);
|
|
438
|
+
if (onChange) {
|
|
439
|
+
const syntheticEvent = {
|
|
440
|
+
target: { value: text },
|
|
441
|
+
currentTarget: { value: text },
|
|
442
|
+
type: "change",
|
|
443
|
+
nativeEvent: { text },
|
|
444
|
+
preventDefault: () => {
|
|
445
|
+
},
|
|
446
|
+
stopPropagation: () => {
|
|
447
|
+
},
|
|
448
|
+
isTrusted: false
|
|
449
|
+
};
|
|
450
|
+
onChange(syntheticEvent);
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
454
|
+
import_react_native7.TextInput,
|
|
455
|
+
{
|
|
456
|
+
ref,
|
|
457
|
+
value,
|
|
458
|
+
placeholder,
|
|
459
|
+
onChangeText: handleChangeText,
|
|
460
|
+
onFocus,
|
|
461
|
+
onBlur,
|
|
462
|
+
onKeyPress: (e) => {
|
|
463
|
+
if (onKeyDown) {
|
|
464
|
+
onKeyDown({
|
|
465
|
+
key: e.nativeEvent.key,
|
|
466
|
+
preventDefault: () => {
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
editable: !disabled,
|
|
472
|
+
multiline: true,
|
|
473
|
+
numberOfLines: rows || 4,
|
|
474
|
+
style: [
|
|
475
|
+
{
|
|
476
|
+
color,
|
|
477
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
478
|
+
flex: 1,
|
|
479
|
+
padding: 0,
|
|
480
|
+
textAlignVertical: "top",
|
|
481
|
+
textAlign: style?.textAlign || "left"
|
|
482
|
+
},
|
|
483
|
+
style
|
|
484
|
+
],
|
|
485
|
+
placeholderTextColor,
|
|
486
|
+
maxLength,
|
|
487
|
+
testID: dataTestId || id,
|
|
488
|
+
accessibilityLabel: ariaLabel,
|
|
489
|
+
accessibilityHint: ariaDescribedBy,
|
|
490
|
+
accessibilityState: {
|
|
491
|
+
disabled: disabled || ariaDisabled
|
|
492
|
+
},
|
|
493
|
+
accessible: true
|
|
494
|
+
}
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
);
|
|
498
|
+
TextAreaPrimitive.displayName = "TextAreaPrimitive";
|
|
499
|
+
|
|
500
|
+
// src/List.tsx
|
|
501
|
+
var import_xui_core = require("@xsolla/xui-core");
|
|
502
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
503
|
+
var ListRoot = (0, import_react4.forwardRef)(({ children, ...props }, ref) => {
|
|
504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
505
|
+
Box,
|
|
506
|
+
{
|
|
507
|
+
ref,
|
|
508
|
+
width: "100%",
|
|
509
|
+
flexDirection: "column",
|
|
510
|
+
...props,
|
|
511
|
+
style: { role: "list", ...props.style },
|
|
512
|
+
children
|
|
513
|
+
}
|
|
514
|
+
);
|
|
515
|
+
});
|
|
516
|
+
ListRoot.displayName = "List";
|
|
517
|
+
var ListRow = (0, import_react4.forwardRef)(
|
|
518
|
+
({ children, hoverable, onClick, onPress, ...props }, ref) => {
|
|
519
|
+
const { theme } = (0, import_xui_core.useDesignSystem)();
|
|
520
|
+
const handlePress = onClick || onPress;
|
|
521
|
+
const isInteractive = !!handlePress || hoverable;
|
|
522
|
+
const handleKeyDown = (event) => {
|
|
523
|
+
if (handlePress && (event.key === "Enter" || event.key === " ")) {
|
|
524
|
+
event.preventDefault();
|
|
525
|
+
handlePress();
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
529
|
+
Box,
|
|
530
|
+
{
|
|
531
|
+
ref,
|
|
532
|
+
width: "100%",
|
|
533
|
+
alignItems: "center",
|
|
534
|
+
flexDirection: "row",
|
|
535
|
+
paddingHorizontal: 16,
|
|
536
|
+
paddingVertical: 12,
|
|
537
|
+
onPress: handlePress,
|
|
538
|
+
tabIndex: isInteractive ? 0 : void 0,
|
|
539
|
+
onKeyDown: isInteractive ? handleKeyDown : void 0,
|
|
540
|
+
hoverStyle: isInteractive ? {
|
|
541
|
+
backgroundColor: theme.colors.control.input.bgHover
|
|
542
|
+
} : void 0,
|
|
543
|
+
pressStyle: isInteractive ? {
|
|
544
|
+
backgroundColor: theme.colors.control.input.bgDisable
|
|
545
|
+
} : void 0,
|
|
546
|
+
...props,
|
|
547
|
+
style: {
|
|
548
|
+
cursor: isInteractive ? "pointer" : "default",
|
|
549
|
+
role: "listitem",
|
|
550
|
+
...props.style
|
|
551
|
+
},
|
|
552
|
+
children
|
|
553
|
+
}
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
);
|
|
557
|
+
ListRow.displayName = "List.Row";
|
|
558
|
+
var ListTitle = (0, import_react4.forwardRef)(
|
|
559
|
+
({ children, ...props }, ref) => {
|
|
560
|
+
const { theme } = (0, import_xui_core.useDesignSystem)();
|
|
561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
562
|
+
Box,
|
|
563
|
+
{
|
|
564
|
+
ref,
|
|
565
|
+
width: "100%",
|
|
566
|
+
paddingHorizontal: 16,
|
|
567
|
+
paddingVertical: 8,
|
|
568
|
+
backgroundColor: theme.colors.background.secondary,
|
|
569
|
+
...props,
|
|
570
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
571
|
+
Text,
|
|
572
|
+
{
|
|
573
|
+
color: theme.colors.content.secondary,
|
|
574
|
+
fontSize: 12,
|
|
575
|
+
fontWeight: "500",
|
|
576
|
+
style: { lineHeight: "20px" },
|
|
577
|
+
children
|
|
578
|
+
}
|
|
579
|
+
)
|
|
580
|
+
}
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
);
|
|
584
|
+
ListTitle.displayName = "List.Title";
|
|
585
|
+
var List = Object.assign(ListRoot, {
|
|
586
|
+
Row: ListRow,
|
|
587
|
+
Title: ListTitle
|
|
588
|
+
});
|
|
589
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
590
|
+
0 && (module.exports = {
|
|
591
|
+
List
|
|
592
|
+
});
|
|
593
|
+
//# sourceMappingURL=index.js.map
|