@xsolla/xui-checkbox-tag-group 0.75.0-pr113.1769650222
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 +30 -0
- package/native/index.d.ts +30 -0
- package/native/index.js +610 -0
- package/native/index.js.flow +62 -0
- package/native/index.js.map +1 -0
- package/native/index.mjs +577 -0
- package/native/index.mjs.map +1 -0
- package/package.json +56 -0
- package/web/index.d.mts +30 -0
- package/web/index.d.ts +30 -0
- package/web/index.js +598 -0
- package/web/index.js.flow +62 -0
- package/web/index.js.map +1 -0
- package/web/index.mjs +561 -0
- package/web/index.mjs.map +1 -0
package/native/index.mjs
ADDED
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
// src/CheckboxTagGroup.tsx
|
|
2
|
+
import { useState, useId } from "react";
|
|
3
|
+
|
|
4
|
+
// ../primitives-native/src/Box.tsx
|
|
5
|
+
import {
|
|
6
|
+
View,
|
|
7
|
+
Pressable,
|
|
8
|
+
Image
|
|
9
|
+
} from "react-native";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var Box = ({
|
|
12
|
+
children,
|
|
13
|
+
onPress,
|
|
14
|
+
onLayout,
|
|
15
|
+
onMoveShouldSetResponder,
|
|
16
|
+
onResponderGrant,
|
|
17
|
+
onResponderMove,
|
|
18
|
+
onResponderRelease,
|
|
19
|
+
onResponderTerminate,
|
|
20
|
+
backgroundColor,
|
|
21
|
+
borderColor,
|
|
22
|
+
borderWidth,
|
|
23
|
+
borderBottomWidth,
|
|
24
|
+
borderBottomColor,
|
|
25
|
+
borderTopWidth,
|
|
26
|
+
borderTopColor,
|
|
27
|
+
borderLeftWidth,
|
|
28
|
+
borderLeftColor,
|
|
29
|
+
borderRightWidth,
|
|
30
|
+
borderRightColor,
|
|
31
|
+
borderRadius,
|
|
32
|
+
borderStyle,
|
|
33
|
+
height,
|
|
34
|
+
padding,
|
|
35
|
+
paddingHorizontal,
|
|
36
|
+
paddingVertical,
|
|
37
|
+
margin,
|
|
38
|
+
marginTop,
|
|
39
|
+
marginBottom,
|
|
40
|
+
marginLeft,
|
|
41
|
+
marginRight,
|
|
42
|
+
flexDirection,
|
|
43
|
+
alignItems,
|
|
44
|
+
justifyContent,
|
|
45
|
+
position,
|
|
46
|
+
top,
|
|
47
|
+
bottom,
|
|
48
|
+
left,
|
|
49
|
+
right,
|
|
50
|
+
width,
|
|
51
|
+
flex,
|
|
52
|
+
overflow,
|
|
53
|
+
zIndex,
|
|
54
|
+
hoverStyle,
|
|
55
|
+
pressStyle,
|
|
56
|
+
style,
|
|
57
|
+
"data-testid": dataTestId,
|
|
58
|
+
testID,
|
|
59
|
+
as,
|
|
60
|
+
src,
|
|
61
|
+
alt,
|
|
62
|
+
...rest
|
|
63
|
+
}) => {
|
|
64
|
+
const getContainerStyle = (pressed) => ({
|
|
65
|
+
backgroundColor: pressed && pressStyle?.backgroundColor ? pressStyle.backgroundColor : backgroundColor,
|
|
66
|
+
borderColor,
|
|
67
|
+
borderWidth,
|
|
68
|
+
borderBottomWidth,
|
|
69
|
+
borderBottomColor,
|
|
70
|
+
borderTopWidth,
|
|
71
|
+
borderTopColor,
|
|
72
|
+
borderLeftWidth,
|
|
73
|
+
borderLeftColor,
|
|
74
|
+
borderRightWidth,
|
|
75
|
+
borderRightColor,
|
|
76
|
+
borderRadius,
|
|
77
|
+
borderStyle,
|
|
78
|
+
overflow,
|
|
79
|
+
zIndex,
|
|
80
|
+
height,
|
|
81
|
+
width,
|
|
82
|
+
padding,
|
|
83
|
+
paddingHorizontal,
|
|
84
|
+
paddingVertical,
|
|
85
|
+
margin,
|
|
86
|
+
marginTop,
|
|
87
|
+
marginBottom,
|
|
88
|
+
marginLeft,
|
|
89
|
+
marginRight,
|
|
90
|
+
flexDirection,
|
|
91
|
+
alignItems,
|
|
92
|
+
justifyContent,
|
|
93
|
+
position,
|
|
94
|
+
top,
|
|
95
|
+
bottom,
|
|
96
|
+
left,
|
|
97
|
+
right,
|
|
98
|
+
flex,
|
|
99
|
+
...style
|
|
100
|
+
});
|
|
101
|
+
const finalTestID = dataTestId || testID;
|
|
102
|
+
const {
|
|
103
|
+
role,
|
|
104
|
+
tabIndex,
|
|
105
|
+
onKeyDown,
|
|
106
|
+
onKeyUp,
|
|
107
|
+
"aria-label": _ariaLabel,
|
|
108
|
+
"aria-labelledby": _ariaLabelledBy,
|
|
109
|
+
"aria-current": _ariaCurrent,
|
|
110
|
+
"aria-disabled": _ariaDisabled,
|
|
111
|
+
"aria-live": _ariaLive,
|
|
112
|
+
className,
|
|
113
|
+
"data-testid": _dataTestId,
|
|
114
|
+
...nativeRest
|
|
115
|
+
} = rest;
|
|
116
|
+
if (as === "img" && src) {
|
|
117
|
+
const imageStyle = {
|
|
118
|
+
width,
|
|
119
|
+
height,
|
|
120
|
+
borderRadius,
|
|
121
|
+
position,
|
|
122
|
+
top,
|
|
123
|
+
bottom,
|
|
124
|
+
left,
|
|
125
|
+
right,
|
|
126
|
+
...style
|
|
127
|
+
};
|
|
128
|
+
return /* @__PURE__ */ jsx(
|
|
129
|
+
Image,
|
|
130
|
+
{
|
|
131
|
+
source: { uri: src },
|
|
132
|
+
style: imageStyle,
|
|
133
|
+
testID: finalTestID,
|
|
134
|
+
resizeMode: "cover",
|
|
135
|
+
...nativeRest
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
if (onPress) {
|
|
140
|
+
return /* @__PURE__ */ jsx(
|
|
141
|
+
Pressable,
|
|
142
|
+
{
|
|
143
|
+
onPress,
|
|
144
|
+
onLayout,
|
|
145
|
+
onMoveShouldSetResponder,
|
|
146
|
+
onResponderGrant,
|
|
147
|
+
onResponderMove,
|
|
148
|
+
onResponderRelease,
|
|
149
|
+
onResponderTerminate,
|
|
150
|
+
style: ({ pressed }) => getContainerStyle(pressed),
|
|
151
|
+
testID: finalTestID,
|
|
152
|
+
...nativeRest,
|
|
153
|
+
children
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
return /* @__PURE__ */ jsx(
|
|
158
|
+
View,
|
|
159
|
+
{
|
|
160
|
+
style: getContainerStyle(),
|
|
161
|
+
testID: finalTestID,
|
|
162
|
+
onLayout,
|
|
163
|
+
onMoveShouldSetResponder,
|
|
164
|
+
onResponderGrant,
|
|
165
|
+
onResponderMove,
|
|
166
|
+
onResponderRelease,
|
|
167
|
+
onResponderTerminate,
|
|
168
|
+
...nativeRest,
|
|
169
|
+
children
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
// ../primitives-native/src/Text.tsx
|
|
175
|
+
import { Text as RNText } from "react-native";
|
|
176
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
177
|
+
var roleMap = {
|
|
178
|
+
alert: "alert",
|
|
179
|
+
heading: "header",
|
|
180
|
+
button: "button",
|
|
181
|
+
link: "link",
|
|
182
|
+
text: "text"
|
|
183
|
+
};
|
|
184
|
+
var Text = ({
|
|
185
|
+
children,
|
|
186
|
+
color,
|
|
187
|
+
fontSize,
|
|
188
|
+
fontWeight,
|
|
189
|
+
fontFamily,
|
|
190
|
+
id,
|
|
191
|
+
role,
|
|
192
|
+
...props
|
|
193
|
+
}) => {
|
|
194
|
+
let resolvedFontFamily = fontFamily ? fontFamily.split(",")[0].replace(/['"]/g, "").trim() : void 0;
|
|
195
|
+
if (resolvedFontFamily === "Pilat Wide Bold") {
|
|
196
|
+
resolvedFontFamily = void 0;
|
|
197
|
+
}
|
|
198
|
+
const style = {
|
|
199
|
+
color,
|
|
200
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
201
|
+
fontWeight,
|
|
202
|
+
fontFamily: resolvedFontFamily,
|
|
203
|
+
textDecorationLine: props.textDecoration
|
|
204
|
+
};
|
|
205
|
+
const accessibilityRole = role ? roleMap[role] : void 0;
|
|
206
|
+
return /* @__PURE__ */ jsx2(RNText, { style, testID: id, accessibilityRole, children });
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
// ../primitives-native/src/Spinner.tsx
|
|
210
|
+
import { ActivityIndicator, View as View2 } from "react-native";
|
|
211
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
212
|
+
var Spinner = ({
|
|
213
|
+
color,
|
|
214
|
+
size,
|
|
215
|
+
role,
|
|
216
|
+
"aria-label": ariaLabel,
|
|
217
|
+
"aria-live": ariaLive,
|
|
218
|
+
"aria-describedby": ariaDescribedBy,
|
|
219
|
+
testID
|
|
220
|
+
}) => {
|
|
221
|
+
return /* @__PURE__ */ jsx3(
|
|
222
|
+
View2,
|
|
223
|
+
{
|
|
224
|
+
accessible: true,
|
|
225
|
+
accessibilityRole: role === "status" ? "none" : void 0,
|
|
226
|
+
accessibilityLabel: ariaLabel,
|
|
227
|
+
accessibilityLiveRegion: ariaLive === "polite" ? "polite" : ariaLive === "assertive" ? "assertive" : "none",
|
|
228
|
+
testID,
|
|
229
|
+
children: /* @__PURE__ */ jsx3(
|
|
230
|
+
ActivityIndicator,
|
|
231
|
+
{
|
|
232
|
+
color,
|
|
233
|
+
size: typeof size === "number" ? size : "small"
|
|
234
|
+
}
|
|
235
|
+
)
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
};
|
|
239
|
+
Spinner.displayName = "Spinner";
|
|
240
|
+
|
|
241
|
+
// ../primitives-native/src/Icon.tsx
|
|
242
|
+
import React from "react";
|
|
243
|
+
import { View as View3 } from "react-native";
|
|
244
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
245
|
+
|
|
246
|
+
// ../primitives-native/src/Divider.tsx
|
|
247
|
+
import { View as View4 } from "react-native";
|
|
248
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
249
|
+
|
|
250
|
+
// ../primitives-native/src/Input.tsx
|
|
251
|
+
import { forwardRef } from "react";
|
|
252
|
+
import { TextInput as RNTextInput } from "react-native";
|
|
253
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
254
|
+
var keyboardTypeMap = {
|
|
255
|
+
text: "default",
|
|
256
|
+
number: "numeric",
|
|
257
|
+
email: "email-address",
|
|
258
|
+
tel: "phone-pad",
|
|
259
|
+
url: "url",
|
|
260
|
+
decimal: "decimal-pad"
|
|
261
|
+
};
|
|
262
|
+
var inputModeToKeyboardType = {
|
|
263
|
+
none: "default",
|
|
264
|
+
text: "default",
|
|
265
|
+
decimal: "decimal-pad",
|
|
266
|
+
numeric: "number-pad",
|
|
267
|
+
tel: "phone-pad",
|
|
268
|
+
search: "default",
|
|
269
|
+
email: "email-address",
|
|
270
|
+
url: "url"
|
|
271
|
+
};
|
|
272
|
+
var autoCompleteToTextContentType = {
|
|
273
|
+
"one-time-code": "oneTimeCode",
|
|
274
|
+
email: "emailAddress",
|
|
275
|
+
username: "username",
|
|
276
|
+
password: "password",
|
|
277
|
+
"new-password": "newPassword",
|
|
278
|
+
tel: "telephoneNumber",
|
|
279
|
+
"postal-code": "postalCode",
|
|
280
|
+
name: "name"
|
|
281
|
+
};
|
|
282
|
+
var InputPrimitive = forwardRef(
|
|
283
|
+
({
|
|
284
|
+
value,
|
|
285
|
+
placeholder,
|
|
286
|
+
onChange,
|
|
287
|
+
onChangeText,
|
|
288
|
+
onFocus,
|
|
289
|
+
onBlur,
|
|
290
|
+
onKeyDown,
|
|
291
|
+
disabled,
|
|
292
|
+
secureTextEntry,
|
|
293
|
+
style,
|
|
294
|
+
color,
|
|
295
|
+
fontSize,
|
|
296
|
+
placeholderTextColor,
|
|
297
|
+
maxLength,
|
|
298
|
+
name,
|
|
299
|
+
type,
|
|
300
|
+
inputMode,
|
|
301
|
+
autoComplete,
|
|
302
|
+
id,
|
|
303
|
+
"aria-invalid": ariaInvalid,
|
|
304
|
+
"aria-describedby": ariaDescribedBy,
|
|
305
|
+
"aria-labelledby": ariaLabelledBy,
|
|
306
|
+
"aria-label": ariaLabel,
|
|
307
|
+
"aria-disabled": ariaDisabled,
|
|
308
|
+
"data-testid": dataTestId
|
|
309
|
+
}, ref) => {
|
|
310
|
+
const handleChangeText = (text) => {
|
|
311
|
+
onChangeText?.(text);
|
|
312
|
+
if (onChange) {
|
|
313
|
+
const syntheticEvent = {
|
|
314
|
+
target: { value: text },
|
|
315
|
+
currentTarget: { value: text },
|
|
316
|
+
type: "change",
|
|
317
|
+
nativeEvent: { text },
|
|
318
|
+
preventDefault: () => {
|
|
319
|
+
},
|
|
320
|
+
stopPropagation: () => {
|
|
321
|
+
},
|
|
322
|
+
isTrusted: false
|
|
323
|
+
};
|
|
324
|
+
onChange(syntheticEvent);
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
const keyboardType = inputMode ? inputModeToKeyboardType[inputMode] || "default" : type ? keyboardTypeMap[type] || "default" : "default";
|
|
328
|
+
const textContentType = autoComplete ? autoCompleteToTextContentType[autoComplete] : void 0;
|
|
329
|
+
return /* @__PURE__ */ jsx6(
|
|
330
|
+
RNTextInput,
|
|
331
|
+
{
|
|
332
|
+
ref,
|
|
333
|
+
value,
|
|
334
|
+
placeholder,
|
|
335
|
+
onChangeText: handleChangeText,
|
|
336
|
+
onFocus,
|
|
337
|
+
onBlur,
|
|
338
|
+
onKeyPress: (e) => {
|
|
339
|
+
if (onKeyDown) {
|
|
340
|
+
onKeyDown({
|
|
341
|
+
key: e.nativeEvent.key,
|
|
342
|
+
preventDefault: () => {
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
editable: !disabled,
|
|
348
|
+
secureTextEntry: secureTextEntry || type === "password",
|
|
349
|
+
keyboardType,
|
|
350
|
+
textContentType,
|
|
351
|
+
style: [
|
|
352
|
+
{
|
|
353
|
+
color,
|
|
354
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
355
|
+
flex: 1,
|
|
356
|
+
padding: 0,
|
|
357
|
+
textAlign: style?.textAlign || "left"
|
|
358
|
+
},
|
|
359
|
+
style
|
|
360
|
+
],
|
|
361
|
+
placeholderTextColor,
|
|
362
|
+
maxLength,
|
|
363
|
+
testID: dataTestId || id,
|
|
364
|
+
accessibilityLabel: ariaLabel,
|
|
365
|
+
accessibilityHint: ariaDescribedBy,
|
|
366
|
+
accessibilityState: {
|
|
367
|
+
disabled: disabled || ariaDisabled
|
|
368
|
+
},
|
|
369
|
+
accessible: true
|
|
370
|
+
}
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
);
|
|
374
|
+
InputPrimitive.displayName = "InputPrimitive";
|
|
375
|
+
|
|
376
|
+
// ../primitives-native/src/TextArea.tsx
|
|
377
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
378
|
+
import { TextInput as RNTextInput2 } from "react-native";
|
|
379
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
380
|
+
var TextAreaPrimitive = forwardRef2(
|
|
381
|
+
({
|
|
382
|
+
value,
|
|
383
|
+
placeholder,
|
|
384
|
+
onChange,
|
|
385
|
+
onChangeText,
|
|
386
|
+
onFocus,
|
|
387
|
+
onBlur,
|
|
388
|
+
onKeyDown,
|
|
389
|
+
disabled,
|
|
390
|
+
style,
|
|
391
|
+
color,
|
|
392
|
+
fontSize,
|
|
393
|
+
placeholderTextColor,
|
|
394
|
+
maxLength,
|
|
395
|
+
rows,
|
|
396
|
+
id,
|
|
397
|
+
"aria-invalid": ariaInvalid,
|
|
398
|
+
"aria-describedby": ariaDescribedBy,
|
|
399
|
+
"aria-labelledby": ariaLabelledBy,
|
|
400
|
+
"aria-label": ariaLabel,
|
|
401
|
+
"aria-disabled": ariaDisabled,
|
|
402
|
+
"data-testid": dataTestId
|
|
403
|
+
}, ref) => {
|
|
404
|
+
const handleChangeText = (text) => {
|
|
405
|
+
onChangeText?.(text);
|
|
406
|
+
if (onChange) {
|
|
407
|
+
const syntheticEvent = {
|
|
408
|
+
target: { value: text },
|
|
409
|
+
currentTarget: { value: text },
|
|
410
|
+
type: "change",
|
|
411
|
+
nativeEvent: { text },
|
|
412
|
+
preventDefault: () => {
|
|
413
|
+
},
|
|
414
|
+
stopPropagation: () => {
|
|
415
|
+
},
|
|
416
|
+
isTrusted: false
|
|
417
|
+
};
|
|
418
|
+
onChange(syntheticEvent);
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
return /* @__PURE__ */ jsx7(
|
|
422
|
+
RNTextInput2,
|
|
423
|
+
{
|
|
424
|
+
ref,
|
|
425
|
+
value,
|
|
426
|
+
placeholder,
|
|
427
|
+
onChangeText: handleChangeText,
|
|
428
|
+
onFocus,
|
|
429
|
+
onBlur,
|
|
430
|
+
onKeyPress: (e) => {
|
|
431
|
+
if (onKeyDown) {
|
|
432
|
+
onKeyDown({
|
|
433
|
+
key: e.nativeEvent.key,
|
|
434
|
+
preventDefault: () => {
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
editable: !disabled,
|
|
440
|
+
multiline: true,
|
|
441
|
+
numberOfLines: rows || 4,
|
|
442
|
+
style: [
|
|
443
|
+
{
|
|
444
|
+
color,
|
|
445
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
446
|
+
flex: 1,
|
|
447
|
+
padding: 0,
|
|
448
|
+
textAlignVertical: "top",
|
|
449
|
+
textAlign: style?.textAlign || "left"
|
|
450
|
+
},
|
|
451
|
+
style
|
|
452
|
+
],
|
|
453
|
+
placeholderTextColor,
|
|
454
|
+
maxLength,
|
|
455
|
+
testID: dataTestId || id,
|
|
456
|
+
accessibilityLabel: ariaLabel,
|
|
457
|
+
accessibilityHint: ariaDescribedBy,
|
|
458
|
+
accessibilityState: {
|
|
459
|
+
disabled: disabled || ariaDisabled
|
|
460
|
+
},
|
|
461
|
+
accessible: true
|
|
462
|
+
}
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
);
|
|
466
|
+
TextAreaPrimitive.displayName = "TextAreaPrimitive";
|
|
467
|
+
|
|
468
|
+
// src/CheckboxTagGroup.tsx
|
|
469
|
+
import { useDesignSystem } from "@xsolla/xui-core";
|
|
470
|
+
import { jsx as jsx8, jsxs } from "react/jsx-runtime";
|
|
471
|
+
var CheckboxTagGroup = ({
|
|
472
|
+
options,
|
|
473
|
+
value,
|
|
474
|
+
defaultValue = [],
|
|
475
|
+
onChange,
|
|
476
|
+
size = "md",
|
|
477
|
+
disabled = false,
|
|
478
|
+
errorMessage,
|
|
479
|
+
"aria-label": ariaLabel
|
|
480
|
+
}) => {
|
|
481
|
+
const { theme } = useDesignSystem();
|
|
482
|
+
const sizeConfig = theme.sizing.checkboxTagGroup(size);
|
|
483
|
+
const fieldGap = theme.sizing.input(size).fieldGap;
|
|
484
|
+
const errorId = useId();
|
|
485
|
+
const [selectedValues, setSelectedValues] = useState(defaultValue);
|
|
486
|
+
const currentValues = value !== void 0 ? value : selectedValues;
|
|
487
|
+
const hasError = Boolean(errorMessage);
|
|
488
|
+
const handleToggle = (optionValue) => {
|
|
489
|
+
if (disabled) return;
|
|
490
|
+
const isSelected = currentValues.includes(optionValue);
|
|
491
|
+
const newValues = isSelected ? currentValues.filter((v) => v !== optionValue) : [...currentValues, optionValue];
|
|
492
|
+
if (value === void 0) {
|
|
493
|
+
setSelectedValues(newValues);
|
|
494
|
+
}
|
|
495
|
+
onChange?.(newValues);
|
|
496
|
+
};
|
|
497
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: fieldGap, children: [
|
|
498
|
+
/* @__PURE__ */ jsx8(
|
|
499
|
+
Box,
|
|
500
|
+
{
|
|
501
|
+
role: "group",
|
|
502
|
+
"aria-label": ariaLabel,
|
|
503
|
+
flexDirection: "row",
|
|
504
|
+
flexWrap: "wrap",
|
|
505
|
+
alignItems: "center",
|
|
506
|
+
gap: sizeConfig.gap,
|
|
507
|
+
children: options.map((option) => {
|
|
508
|
+
const isActive = currentValues.includes(option.value);
|
|
509
|
+
const isDisabled = disabled || option.disabled;
|
|
510
|
+
const bgColor = isDisabled ? "transparent" : isActive ? theme.colors.background.primary : theme.colors.overlay.mono;
|
|
511
|
+
const borderColor = isDisabled ? "transparent" : theme.colors.border.secondary;
|
|
512
|
+
const textColor = isDisabled ? theme.colors.content.tertiary : theme.colors.content.primary;
|
|
513
|
+
return /* @__PURE__ */ jsx8(
|
|
514
|
+
Box,
|
|
515
|
+
{
|
|
516
|
+
as: "button",
|
|
517
|
+
role: "checkbox",
|
|
518
|
+
"aria-checked": isActive,
|
|
519
|
+
"aria-disabled": isDisabled,
|
|
520
|
+
"aria-describedby": hasError ? errorId : void 0,
|
|
521
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
522
|
+
onPress: () => !isDisabled && handleToggle(option.value),
|
|
523
|
+
backgroundColor: bgColor,
|
|
524
|
+
borderWidth: 1,
|
|
525
|
+
borderColor,
|
|
526
|
+
borderStyle: "solid",
|
|
527
|
+
borderRadius: sizeConfig.borderRadius,
|
|
528
|
+
paddingHorizontal: sizeConfig.paddingHorizontal,
|
|
529
|
+
paddingVertical: sizeConfig.paddingVertical,
|
|
530
|
+
flexDirection: "row",
|
|
531
|
+
alignItems: "center",
|
|
532
|
+
justifyContent: "center",
|
|
533
|
+
gap: sizeConfig.gap,
|
|
534
|
+
hoverStyle: !isDisabled && !isActive ? {
|
|
535
|
+
backgroundColor: theme.colors.overlay.mono,
|
|
536
|
+
borderColor: "transparent"
|
|
537
|
+
} : void 0,
|
|
538
|
+
style: {
|
|
539
|
+
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
540
|
+
flexShrink: 0
|
|
541
|
+
},
|
|
542
|
+
children: /* @__PURE__ */ jsx8(
|
|
543
|
+
Text,
|
|
544
|
+
{
|
|
545
|
+
color: textColor,
|
|
546
|
+
fontSize: sizeConfig.fontSize,
|
|
547
|
+
fontWeight: "400",
|
|
548
|
+
textAlign: "center",
|
|
549
|
+
style: {
|
|
550
|
+
lineHeight: `${sizeConfig.lineHeight}px`
|
|
551
|
+
},
|
|
552
|
+
children: option.label
|
|
553
|
+
}
|
|
554
|
+
)
|
|
555
|
+
},
|
|
556
|
+
option.value
|
|
557
|
+
);
|
|
558
|
+
})
|
|
559
|
+
}
|
|
560
|
+
),
|
|
561
|
+
errorMessage && /* @__PURE__ */ jsx8(
|
|
562
|
+
Text,
|
|
563
|
+
{
|
|
564
|
+
id: errorId,
|
|
565
|
+
role: "alert",
|
|
566
|
+
color: theme.colors.content.alert.primary,
|
|
567
|
+
fontSize: sizeConfig.fontSize - 2,
|
|
568
|
+
children: errorMessage
|
|
569
|
+
}
|
|
570
|
+
)
|
|
571
|
+
] });
|
|
572
|
+
};
|
|
573
|
+
CheckboxTagGroup.displayName = "CheckboxTagGroup";
|
|
574
|
+
export {
|
|
575
|
+
CheckboxTagGroup
|
|
576
|
+
};
|
|
577
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/CheckboxTagGroup.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Spinner.tsx","../../../primitives-native/src/Icon.tsx","../../../primitives-native/src/Divider.tsx","../../../primitives-native/src/Input.tsx","../../../primitives-native/src/TextArea.tsx"],"sourcesContent":["import React, { useState, useId } from \"react\";\n// @ts-ignore - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport type { CheckboxTagGroupProps } from \"./types\";\n\nexport const CheckboxTagGroup: React.FC<CheckboxTagGroupProps> = ({\n options,\n value,\n defaultValue = [],\n onChange,\n size = \"md\",\n disabled = false,\n errorMessage,\n \"aria-label\": ariaLabel,\n}) => {\n const { theme } = useDesignSystem();\n const sizeConfig = theme.sizing.checkboxTagGroup(size);\n const fieldGap = theme.sizing.input(size).fieldGap;\n const errorId = useId();\n\n const [selectedValues, setSelectedValues] = useState<string[]>(defaultValue);\n const currentValues = value !== undefined ? value : selectedValues;\n const hasError = Boolean(errorMessage);\n\n const handleToggle = (optionValue: string) => {\n if (disabled) return;\n\n const isSelected = currentValues.includes(optionValue);\n const newValues = isSelected\n ? currentValues.filter((v) => v !== optionValue)\n : [...currentValues, optionValue];\n\n // Update internal state for uncontrolled mode\n if (value === undefined) {\n setSelectedValues(newValues);\n }\n\n onChange?.(newValues);\n };\n\n return (\n <Box flexDirection=\"column\" gap={fieldGap}>\n <Box\n role=\"group\"\n aria-label={ariaLabel}\n flexDirection=\"row\"\n flexWrap=\"wrap\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n >\n {options.map((option) => {\n const isActive = currentValues.includes(option.value);\n const isDisabled = disabled || option.disabled;\n\n const bgColor = isDisabled\n ? \"transparent\"\n : isActive\n ? theme.colors.background.primary\n : theme.colors.overlay.mono;\n\n const borderColor = isDisabled\n ? \"transparent\"\n : theme.colors.border.secondary;\n\n const textColor = isDisabled\n ? theme.colors.content.tertiary\n : theme.colors.content.primary;\n\n return (\n <Box\n key={option.value}\n as=\"button\"\n role=\"checkbox\"\n aria-checked={isActive}\n aria-disabled={isDisabled}\n aria-describedby={hasError ? errorId : undefined}\n tabIndex={isDisabled ? -1 : 0}\n onPress={() => !isDisabled && handleToggle(option.value)}\n backgroundColor={bgColor}\n borderWidth={1}\n borderColor={borderColor}\n borderStyle=\"solid\"\n borderRadius={sizeConfig.borderRadius}\n paddingHorizontal={sizeConfig.paddingHorizontal}\n paddingVertical={sizeConfig.paddingVertical}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap={sizeConfig.gap}\n hoverStyle={\n !isDisabled && !isActive\n ? {\n backgroundColor: theme.colors.overlay.mono,\n borderColor: \"transparent\",\n }\n : undefined\n }\n style={{\n cursor: isDisabled ? \"not-allowed\" : \"pointer\",\n flexShrink: 0,\n }}\n >\n <Text\n color={textColor}\n fontSize={sizeConfig.fontSize}\n fontWeight=\"400\"\n textAlign=\"center\"\n style={{\n lineHeight: `${sizeConfig.lineHeight}px`,\n }}\n >\n {option.label}\n </Text>\n </Box>\n );\n })}\n </Box>\n\n {errorMessage && (\n <Text\n id={errorId}\n role=\"alert\"\n color={theme.colors.content.alert.primary}\n fontSize={sizeConfig.fontSize - 2}\n >\n {errorMessage}\n </Text>\n )}\n </Box>\n );\n};\n\nCheckboxTagGroup.displayName = \"CheckboxTagGroup\";\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 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 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","import React from \"react\";\nimport { Text as RNText, TextStyle, AccessibilityRole } from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web roles to React Native accessibility roles\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n id,\n role,\n ...props\n}) => {\n // Extract the first font name from a comma-separated list (e.g. for web-style font stacks)\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n // On native, if we don't have the custom font loaded, it's better to use the system font\n // to avoid rendering issues or missing text.\n if (resolvedFontFamily === \"Pilat Wide Bold\") {\n resolvedFontFamily = undefined;\n }\n\n const style: TextStyle = {\n 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 };\n\n // Map role to React Native accessibilityRole\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText style={style} testID={id} accessibilityRole={accessibilityRole}>\n {children}\n </RNText>\n );\n};\n","import type React from \"react\";\nimport { ActivityIndicator, View } from \"react-native\";\nimport type { SpinnerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Spinner: React.FC<SpinnerProps> = ({\n color,\n size,\n role,\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive,\n \"aria-describedby\": ariaDescribedBy,\n testID,\n}) => {\n return (\n <View\n accessible={true}\n accessibilityRole={role === \"status\" ? \"none\" : undefined}\n accessibilityLabel={ariaLabel}\n accessibilityLiveRegion={\n ariaLive === \"polite\"\n ? \"polite\"\n : ariaLive === \"assertive\"\n ? \"assertive\"\n : \"none\"\n }\n testID={testID}\n >\n <ActivityIndicator\n color={color}\n size={typeof size === \"number\" ? size : \"small\"}\n />\n </View>\n );\n};\n\nSpinner.displayName = \"Spinner\";\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({ children, color, size }) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n // @ts-ignore - passing color down to potential Text/Icon children\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return <View style={style}>{childrenWithProps}</View>;\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { DividerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Divider: React.FC<DividerProps> = ({\n color,\n height,\n width,\n vertical,\n dashStroke,\n}) => {\n const style: ViewStyle = {\n backgroundColor: dashStroke\n ? \"transparent\"\n : color || \"rgba(255, 255, 255, 0.15)\",\n width: vertical ? (typeof width === \"number\" ? width : 1) : \"100%\",\n height: vertical ? \"100%\" : typeof height === \"number\" ? height : 1,\n ...(dashStroke && {\n borderStyle: \"dashed\",\n borderColor: color || \"rgba(255, 255, 255, 0.15)\",\n borderWidth: 0,\n ...(vertical\n ? { borderLeftWidth: typeof width === \"number\" ? width : 1 }\n : { borderTopWidth: typeof height === \"number\" ? height : 1 }),\n }),\n };\n\n return <View style={style} />;\n};\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web input types to React Native keyboard types\nconst keyboardTypeMap: Record<string, any> = {\n text: \"default\",\n number: \"numeric\",\n email: \"email-address\",\n tel: \"phone-pad\",\n url: \"url\",\n decimal: \"decimal-pad\",\n};\n\n// Map web inputMode to React Native keyboard types\nconst inputModeToKeyboardType: Record<string, any> = {\n none: \"default\",\n text: \"default\",\n decimal: \"decimal-pad\",\n numeric: \"number-pad\",\n tel: \"phone-pad\",\n search: \"default\",\n email: \"email-address\",\n url: \"url\",\n};\n\n// Map web autoComplete to React Native textContentType (iOS)\nconst autoCompleteToTextContentType: Record<string, any> = {\n \"one-time-code\": \"oneTimeCode\",\n email: \"emailAddress\",\n username: \"username\",\n password: \"password\",\n \"new-password\": \"newPassword\",\n tel: \"telephoneNumber\",\n \"postal-code\": \"postalCode\",\n name: \"name\",\n};\n\nexport const InputPrimitive = forwardRef<RNTextInput, InputPrimitiveProps>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n secureTextEntry,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n name,\n type,\n inputMode,\n autoComplete,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n // Create a synthetic event for onChange compatibility\n // Include nativeEvent and no-op methods to prevent runtime errors\n // when consumers expect DOM-like event behavior\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLInputElement>;\n onChange(syntheticEvent);\n }\n };\n\n // Determine keyboard type - inputMode takes precedence over type\n const keyboardType = inputMode\n ? inputModeToKeyboardType[inputMode] || \"default\"\n : type\n ? keyboardTypeMap[type] || \"default\"\n : \"default\";\n\n // Determine textContentType for iOS autofill\n const textContentType = autoComplete\n ? autoCompleteToTextContentType[autoComplete]\n : undefined;\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n // Map onKeyPress to onKeyDown for cross-platform compatibility\n // Include preventDefault to avoid runtime errors when consumers call it\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n secureTextEntry={secureTextEntry || type === \"password\"}\n keyboardType={keyboardType}\n textContentType={textContentType}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n // React Native accessibility props\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { TextAreaPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nexport const TextAreaPrimitive = forwardRef<\n RNTextInput,\n TextAreaPrimitiveProps\n>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n rows,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLTextAreaElement>;\n onChange(syntheticEvent);\n }\n };\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n multiline={true}\n numberOfLines={rows || 4}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlignVertical: \"top\",\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nTextAreaPrimitive.displayName = \"TextAreaPrimitive\";\n"],"mappings":";AAAA,SAAgB,UAAU,aAAa;;;ACCvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAmID;AAhIC,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,E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AAY;AAAA,cACd;AAAA,cAEA,0BAAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,OAAO;AAAA,kBACP,UAAU,WAAW;AAAA,kBACrB,YAAW;AAAA,kBACX,WAAU;AAAA,kBACV,OAAO;AAAA,oBACL,YAAY,GAAG,WAAW,UAAU;AAAA,kBACtC;AAAA,kBAEC,iBAAO;AAAA;AAAA,cACV;AAAA;AAAA,YA1CK,OAAO;AAAA,UA2Cd;AAAA,QAEJ,CAAC;AAAA;AAAA,IACH;AAAA,IAEC,gBACC,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,IAAI;AAAA,QACJ,MAAK;AAAA,QACL,OAAO,MAAM,OAAO,QAAQ,MAAM;AAAA,QAClC,UAAU,WAAW,WAAW;AAAA,QAE/B;AAAA;AAAA,IACH;AAAA,KAEJ;AAEJ;AAEA,iBAAiB,cAAc;","names":["jsx","View","jsx","View","jsx","View","jsx","jsx","forwardRef","RNTextInput","jsx","jsx"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xsolla/xui-checkbox-tag-group",
|
|
3
|
+
"version": "0.75.0-pr113.1769650222",
|
|
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.75.0-pr113.1769650222",
|
|
17
|
+
"@xsolla/xui-primitives-core": "0.75.0-pr113.1769650222"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"react": ">=16.8.0",
|
|
21
|
+
"styled-components": ">=4"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
25
|
+
"@testing-library/react": "^14.1.2",
|
|
26
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
27
|
+
"jsdom": "^24.0.0",
|
|
28
|
+
"react": "^18.0.0",
|
|
29
|
+
"react-dom": "^18.0.0",
|
|
30
|
+
"tsup": "^8.0.0",
|
|
31
|
+
"vitest": "^4.0.18"
|
|
32
|
+
},
|
|
33
|
+
"license": "MIT",
|
|
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
|
+
}
|