@xsolla/xui-image 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.
@@ -0,0 +1,510 @@
1
+ // ../primitives-native/src/Box.tsx
2
+ import {
3
+ View,
4
+ Pressable,
5
+ Image
6
+ } from "react-native";
7
+ import { jsx } from "react/jsx-runtime";
8
+ var Box = ({
9
+ children,
10
+ onPress,
11
+ onLayout,
12
+ onMoveShouldSetResponder,
13
+ onResponderGrant,
14
+ onResponderMove,
15
+ onResponderRelease,
16
+ onResponderTerminate,
17
+ backgroundColor,
18
+ borderColor,
19
+ borderWidth,
20
+ borderBottomWidth,
21
+ borderBottomColor,
22
+ borderTopWidth,
23
+ borderTopColor,
24
+ borderLeftWidth,
25
+ borderLeftColor,
26
+ borderRightWidth,
27
+ borderRightColor,
28
+ borderRadius,
29
+ borderStyle,
30
+ height,
31
+ padding,
32
+ paddingHorizontal,
33
+ paddingVertical,
34
+ margin,
35
+ marginTop,
36
+ marginBottom,
37
+ marginLeft,
38
+ marginRight,
39
+ flexDirection,
40
+ alignItems,
41
+ justifyContent,
42
+ position,
43
+ top,
44
+ bottom,
45
+ left,
46
+ right,
47
+ width,
48
+ flex,
49
+ overflow,
50
+ zIndex,
51
+ hoverStyle,
52
+ pressStyle,
53
+ style,
54
+ "data-testid": dataTestId,
55
+ testID,
56
+ as,
57
+ src,
58
+ alt,
59
+ ...rest
60
+ }) => {
61
+ const getContainerStyle = (pressed) => ({
62
+ backgroundColor: pressed && pressStyle?.backgroundColor ? pressStyle.backgroundColor : backgroundColor,
63
+ borderColor,
64
+ borderWidth,
65
+ borderBottomWidth,
66
+ borderBottomColor,
67
+ borderTopWidth,
68
+ borderTopColor,
69
+ borderLeftWidth,
70
+ borderLeftColor,
71
+ borderRightWidth,
72
+ borderRightColor,
73
+ borderRadius,
74
+ borderStyle,
75
+ overflow,
76
+ zIndex,
77
+ height,
78
+ width,
79
+ padding,
80
+ paddingHorizontal,
81
+ paddingVertical,
82
+ margin,
83
+ marginTop,
84
+ marginBottom,
85
+ marginLeft,
86
+ marginRight,
87
+ flexDirection,
88
+ alignItems,
89
+ justifyContent,
90
+ position,
91
+ top,
92
+ bottom,
93
+ left,
94
+ right,
95
+ flex,
96
+ ...style
97
+ });
98
+ const finalTestID = dataTestId || testID;
99
+ const {
100
+ role,
101
+ tabIndex,
102
+ onKeyDown,
103
+ onKeyUp,
104
+ "aria-label": _ariaLabel,
105
+ "aria-labelledby": _ariaLabelledBy,
106
+ "aria-current": _ariaCurrent,
107
+ "aria-disabled": _ariaDisabled,
108
+ "aria-live": _ariaLive,
109
+ className,
110
+ "data-testid": _dataTestId,
111
+ ...nativeRest
112
+ } = rest;
113
+ if (as === "img" && src) {
114
+ const imageStyle = {
115
+ width,
116
+ height,
117
+ borderRadius,
118
+ position,
119
+ top,
120
+ bottom,
121
+ left,
122
+ right,
123
+ ...style
124
+ };
125
+ return /* @__PURE__ */ jsx(
126
+ Image,
127
+ {
128
+ source: { uri: src },
129
+ style: imageStyle,
130
+ testID: finalTestID,
131
+ resizeMode: "cover",
132
+ ...nativeRest
133
+ }
134
+ );
135
+ }
136
+ if (onPress) {
137
+ return /* @__PURE__ */ jsx(
138
+ Pressable,
139
+ {
140
+ onPress,
141
+ onLayout,
142
+ onMoveShouldSetResponder,
143
+ onResponderGrant,
144
+ onResponderMove,
145
+ onResponderRelease,
146
+ onResponderTerminate,
147
+ style: ({ pressed }) => getContainerStyle(pressed),
148
+ testID: finalTestID,
149
+ ...nativeRest,
150
+ children
151
+ }
152
+ );
153
+ }
154
+ return /* @__PURE__ */ jsx(
155
+ View,
156
+ {
157
+ style: getContainerStyle(),
158
+ testID: finalTestID,
159
+ onLayout,
160
+ onMoveShouldSetResponder,
161
+ onResponderGrant,
162
+ onResponderMove,
163
+ onResponderRelease,
164
+ onResponderTerminate,
165
+ ...nativeRest,
166
+ children
167
+ }
168
+ );
169
+ };
170
+
171
+ // ../primitives-native/src/Text.tsx
172
+ import { Text as RNText } from "react-native";
173
+ import { jsx as jsx2 } from "react/jsx-runtime";
174
+
175
+ // ../primitives-native/src/Spinner.tsx
176
+ import { ActivityIndicator, View as View2 } from "react-native";
177
+ import { jsx as jsx3 } from "react/jsx-runtime";
178
+ var Spinner = ({
179
+ color,
180
+ size,
181
+ role,
182
+ "aria-label": ariaLabel,
183
+ "aria-live": ariaLive,
184
+ "aria-describedby": ariaDescribedBy,
185
+ testID
186
+ }) => {
187
+ return /* @__PURE__ */ jsx3(
188
+ View2,
189
+ {
190
+ accessible: true,
191
+ accessibilityRole: role === "status" ? "none" : void 0,
192
+ accessibilityLabel: ariaLabel,
193
+ accessibilityLiveRegion: ariaLive === "polite" ? "polite" : ariaLive === "assertive" ? "assertive" : "none",
194
+ testID,
195
+ children: /* @__PURE__ */ jsx3(
196
+ ActivityIndicator,
197
+ {
198
+ color,
199
+ size: typeof size === "number" ? size : "small"
200
+ }
201
+ )
202
+ }
203
+ );
204
+ };
205
+ Spinner.displayName = "Spinner";
206
+
207
+ // ../primitives-native/src/Icon.tsx
208
+ import React from "react";
209
+ import { View as View3 } from "react-native";
210
+ import { jsx as jsx4 } from "react/jsx-runtime";
211
+
212
+ // ../primitives-native/src/Divider.tsx
213
+ import { View as View4 } from "react-native";
214
+ import { jsx as jsx5 } from "react/jsx-runtime";
215
+
216
+ // ../primitives-native/src/Input.tsx
217
+ import { forwardRef } from "react";
218
+ import { TextInput as RNTextInput } from "react-native";
219
+ import { jsx as jsx6 } from "react/jsx-runtime";
220
+ var keyboardTypeMap = {
221
+ text: "default",
222
+ number: "numeric",
223
+ email: "email-address",
224
+ tel: "phone-pad",
225
+ url: "url",
226
+ decimal: "decimal-pad"
227
+ };
228
+ var inputModeToKeyboardType = {
229
+ none: "default",
230
+ text: "default",
231
+ decimal: "decimal-pad",
232
+ numeric: "number-pad",
233
+ tel: "phone-pad",
234
+ search: "default",
235
+ email: "email-address",
236
+ url: "url"
237
+ };
238
+ var autoCompleteToTextContentType = {
239
+ "one-time-code": "oneTimeCode",
240
+ email: "emailAddress",
241
+ username: "username",
242
+ password: "password",
243
+ "new-password": "newPassword",
244
+ tel: "telephoneNumber",
245
+ "postal-code": "postalCode",
246
+ name: "name"
247
+ };
248
+ var InputPrimitive = forwardRef(
249
+ ({
250
+ value,
251
+ placeholder,
252
+ onChange,
253
+ onChangeText,
254
+ onFocus,
255
+ onBlur,
256
+ onKeyDown,
257
+ disabled,
258
+ secureTextEntry,
259
+ style,
260
+ color,
261
+ fontSize,
262
+ placeholderTextColor,
263
+ maxLength,
264
+ name,
265
+ type,
266
+ inputMode,
267
+ autoComplete,
268
+ id,
269
+ "aria-invalid": ariaInvalid,
270
+ "aria-describedby": ariaDescribedBy,
271
+ "aria-labelledby": ariaLabelledBy,
272
+ "aria-label": ariaLabel,
273
+ "aria-disabled": ariaDisabled,
274
+ "data-testid": dataTestId
275
+ }, ref) => {
276
+ const handleChangeText = (text) => {
277
+ onChangeText?.(text);
278
+ if (onChange) {
279
+ const syntheticEvent = {
280
+ target: { value: text },
281
+ currentTarget: { value: text },
282
+ type: "change",
283
+ nativeEvent: { text },
284
+ preventDefault: () => {
285
+ },
286
+ stopPropagation: () => {
287
+ },
288
+ isTrusted: false
289
+ };
290
+ onChange(syntheticEvent);
291
+ }
292
+ };
293
+ const keyboardType = inputMode ? inputModeToKeyboardType[inputMode] || "default" : type ? keyboardTypeMap[type] || "default" : "default";
294
+ const textContentType = autoComplete ? autoCompleteToTextContentType[autoComplete] : void 0;
295
+ return /* @__PURE__ */ jsx6(
296
+ RNTextInput,
297
+ {
298
+ ref,
299
+ value,
300
+ placeholder,
301
+ onChangeText: handleChangeText,
302
+ onFocus,
303
+ onBlur,
304
+ onKeyPress: (e) => {
305
+ if (onKeyDown) {
306
+ onKeyDown({
307
+ key: e.nativeEvent.key,
308
+ preventDefault: () => {
309
+ }
310
+ });
311
+ }
312
+ },
313
+ editable: !disabled,
314
+ secureTextEntry: secureTextEntry || type === "password",
315
+ keyboardType,
316
+ textContentType,
317
+ style: [
318
+ {
319
+ color,
320
+ fontSize: typeof fontSize === "number" ? fontSize : void 0,
321
+ flex: 1,
322
+ padding: 0,
323
+ textAlign: style?.textAlign || "left"
324
+ },
325
+ style
326
+ ],
327
+ placeholderTextColor,
328
+ maxLength,
329
+ testID: dataTestId || id,
330
+ accessibilityLabel: ariaLabel,
331
+ accessibilityHint: ariaDescribedBy,
332
+ accessibilityState: {
333
+ disabled: disabled || ariaDisabled
334
+ },
335
+ accessible: true
336
+ }
337
+ );
338
+ }
339
+ );
340
+ InputPrimitive.displayName = "InputPrimitive";
341
+
342
+ // ../primitives-native/src/TextArea.tsx
343
+ import { forwardRef as forwardRef2 } from "react";
344
+ import { TextInput as RNTextInput2 } from "react-native";
345
+ import { jsx as jsx7 } from "react/jsx-runtime";
346
+ var TextAreaPrimitive = forwardRef2(
347
+ ({
348
+ value,
349
+ placeholder,
350
+ onChange,
351
+ onChangeText,
352
+ onFocus,
353
+ onBlur,
354
+ onKeyDown,
355
+ disabled,
356
+ style,
357
+ color,
358
+ fontSize,
359
+ placeholderTextColor,
360
+ maxLength,
361
+ rows,
362
+ id,
363
+ "aria-invalid": ariaInvalid,
364
+ "aria-describedby": ariaDescribedBy,
365
+ "aria-labelledby": ariaLabelledBy,
366
+ "aria-label": ariaLabel,
367
+ "aria-disabled": ariaDisabled,
368
+ "data-testid": dataTestId
369
+ }, ref) => {
370
+ const handleChangeText = (text) => {
371
+ onChangeText?.(text);
372
+ if (onChange) {
373
+ const syntheticEvent = {
374
+ target: { value: text },
375
+ currentTarget: { value: text },
376
+ type: "change",
377
+ nativeEvent: { text },
378
+ preventDefault: () => {
379
+ },
380
+ stopPropagation: () => {
381
+ },
382
+ isTrusted: false
383
+ };
384
+ onChange(syntheticEvent);
385
+ }
386
+ };
387
+ return /* @__PURE__ */ jsx7(
388
+ RNTextInput2,
389
+ {
390
+ ref,
391
+ value,
392
+ placeholder,
393
+ onChangeText: handleChangeText,
394
+ onFocus,
395
+ onBlur,
396
+ onKeyPress: (e) => {
397
+ if (onKeyDown) {
398
+ onKeyDown({
399
+ key: e.nativeEvent.key,
400
+ preventDefault: () => {
401
+ }
402
+ });
403
+ }
404
+ },
405
+ editable: !disabled,
406
+ multiline: true,
407
+ numberOfLines: rows || 4,
408
+ style: [
409
+ {
410
+ color,
411
+ fontSize: typeof fontSize === "number" ? fontSize : void 0,
412
+ flex: 1,
413
+ padding: 0,
414
+ textAlignVertical: "top",
415
+ textAlign: style?.textAlign || "left"
416
+ },
417
+ style
418
+ ],
419
+ placeholderTextColor,
420
+ maxLength,
421
+ testID: dataTestId || id,
422
+ accessibilityLabel: ariaLabel,
423
+ accessibilityHint: ariaDescribedBy,
424
+ accessibilityState: {
425
+ disabled: disabled || ariaDisabled
426
+ },
427
+ accessible: true
428
+ }
429
+ );
430
+ }
431
+ );
432
+ TextAreaPrimitive.displayName = "TextAreaPrimitive";
433
+
434
+ // src/Image.tsx
435
+ import { useDesignSystem } from "@xsolla/xui-core";
436
+ import { jsx as jsx8, jsxs } from "react/jsx-runtime";
437
+ var ratioMap = {
438
+ "1:1": "1 / 1",
439
+ "2:3": "2 / 3",
440
+ "3:2": "3 / 2",
441
+ "16:9": "16 / 9",
442
+ "4:3": "4 / 3",
443
+ "9:16": "9 / 16"
444
+ };
445
+ var Image2 = ({
446
+ src,
447
+ alt = "",
448
+ ratio = "1:1",
449
+ customRatio,
450
+ slot,
451
+ width = "100%",
452
+ borderRadius = 0,
453
+ style,
454
+ imageStyle
455
+ }) => {
456
+ const { theme } = useDesignSystem();
457
+ const aspectRatio = ratio === "Custom" ? customRatio : ratioMap[ratio];
458
+ return /* @__PURE__ */ jsxs(
459
+ Box,
460
+ {
461
+ width,
462
+ position: "relative",
463
+ overflow: "hidden",
464
+ borderRadius,
465
+ backgroundColor: theme.colors.background.secondary,
466
+ style: {
467
+ ...style,
468
+ aspectRatio,
469
+ display: "block"
470
+ },
471
+ children: [
472
+ src && /* @__PURE__ */ jsx8(
473
+ "img",
474
+ {
475
+ src,
476
+ alt,
477
+ style: {
478
+ position: "absolute",
479
+ top: 0,
480
+ left: 0,
481
+ width: "100%",
482
+ height: "100%",
483
+ objectFit: "cover",
484
+ display: "block",
485
+ ...imageStyle
486
+ }
487
+ }
488
+ ),
489
+ slot && /* @__PURE__ */ jsx8(
490
+ Box,
491
+ {
492
+ position: "absolute",
493
+ top: 0,
494
+ left: 0,
495
+ right: 0,
496
+ bottom: 0,
497
+ alignItems: "center",
498
+ justifyContent: "center",
499
+ zIndex: 1,
500
+ children: slot
501
+ }
502
+ )
503
+ ]
504
+ }
505
+ );
506
+ };
507
+ export {
508
+ Image2 as Image
509
+ };
510
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../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","../../src/Image.tsx"],"sourcesContent":["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","import React from \"react\";\n// @ts-ignore - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\n\nexport type ImageRatio =\n | \"1:1\"\n | \"2:3\"\n | \"3:2\"\n | \"16:9\"\n | \"4:3\"\n | \"9:16\"\n | \"Custom\";\n\nexport interface ImageProps {\n /** Image source URL */\n src?: string;\n /** Image alt text */\n alt?: string;\n /** Aspect ratio of the image. Defaults to '1:1' */\n ratio?: ImageRatio;\n /** Custom aspect ratio as a string (e.g. '21 / 9') or number (e.g. 2.33) if ratio is set to 'Custom' */\n customRatio?: string | number;\n /** Optional slot for overlay or placeholder content */\n slot?: React.ReactNode;\n /** Width of the image container. Defaults to '100%' */\n width?: number | string;\n /** Border radius of the image container. Defaults to 0 */\n borderRadius?: number | string;\n /** Style for the container Box */\n style?: React.CSSProperties;\n /** Style for the img element */\n imageStyle?: React.CSSProperties;\n}\n\nconst ratioMap: Record<Exclude<ImageRatio, \"Custom\">, string> = {\n \"1:1\": \"1 / 1\",\n \"2:3\": \"2 / 3\",\n \"3:2\": \"3 / 2\",\n \"16:9\": \"16 / 9\",\n \"4:3\": \"4 / 3\",\n \"9:16\": \"9 / 16\",\n};\n\n/**\n * Image component with support for various aspect ratios and overlays.\n */\nexport const Image: React.FC<ImageProps> = ({\n src,\n alt = \"\",\n ratio = \"1:1\",\n customRatio,\n slot,\n width = \"100%\",\n borderRadius = 0,\n style,\n imageStyle,\n}) => {\n const { theme } = useDesignSystem();\n const aspectRatio = ratio === \"Custom\" ? customRatio : ratioMap[ratio];\n\n return (\n <Box\n width={width}\n position=\"relative\"\n overflow=\"hidden\"\n borderRadius={borderRadius}\n backgroundColor={theme.colors.background.secondary}\n style={{\n ...style,\n aspectRatio: aspectRatio as any,\n display: \"block\",\n }}\n >\n {src && (\n <img\n src={src}\n alt={alt}\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n display: \"block\",\n ...imageStyle,\n }}\n />\n )}\n {slot && (\n <Box\n position=\"absolute\"\n top={0}\n left={0}\n right={0}\n bottom={0}\n alignItems=\"center\"\n justifyContent=\"center\"\n zIndex={1}\n >\n {slot}\n </Box>\n )}\n </Box>\n );\n};\n"],"mappings":";AACA;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,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,oBAAoB,CAAC,aAAkC;AAAA,IAC3D,iBACE,WAAW,YAAY,kBACnB,WAAW,kBACX;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA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AA,eACC,gBAAAD;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA,OAAO;AAAA,cACL,UAAU;AAAA,cACV,KAAK;AAAA,cACL,MAAM;AAAA,cACN,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,WAAW;AAAA,cACX,SAAS;AAAA,cACT,GAAG;AAAA,YACL;AAAA;AAAA,QACF;AAAA,QAED,QACC,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,UAAS;AAAA,YACT,KAAK;AAAA,YACL,MAAM;AAAA,YACN,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,YAAW;AAAA,YACX,gBAAe;AAAA,YACf,QAAQ;AAAA,YAEP;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["jsx","View","jsx","View","jsx","View","jsx","jsx","forwardRef","RNTextInput","jsx","jsx","Image"]}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@xsolla/xui-image",
3
+ "version": "0.64.0-pr56.1768440195",
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 src/index.tsx --format esm,cjs --dts --env.PLATFORM web --clean",
10
+ "build:native": "PLATFORM=native tsup src/index.tsx --format esm,cjs --dts --env.PLATFORM native --clean"
11
+ },
12
+ "dependencies": {
13
+ "@xsolla/xui-core": "0.64.0-pr56.1768440195",
14
+ "@xsolla/xui-primitives-core": "0.64.0-pr56.1768440195"
15
+ },
16
+ "peerDependencies": {
17
+ "react": ">=16.8.0",
18
+ "styled-components": ">=4"
19
+ },
20
+ "devDependencies": {
21
+ "tsup": "^8.0.0"
22
+ },
23
+ "license": "MIT",
24
+ "react-native": "./native/index.js",
25
+ "exports": {
26
+ ".": {
27
+ "react-native": {
28
+ "types": "./native/index.d.ts",
29
+ "import": "./native/index.mjs",
30
+ "require": "./native/index.js"
31
+ },
32
+ "import": {
33
+ "types": "./web/index.d.ts",
34
+ "default": "./web/index.mjs"
35
+ },
36
+ "require": {
37
+ "types": "./web/index.d.ts",
38
+ "default": "./web/index.js"
39
+ },
40
+ "default": {
41
+ "types": "./web/index.d.ts",
42
+ "default": "./web/index.js"
43
+ }
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+
3
+ type ImageRatio = "1:1" | "2:3" | "3:2" | "16:9" | "4:3" | "9:16" | "Custom";
4
+ interface ImageProps {
5
+ /** Image source URL */
6
+ src?: string;
7
+ /** Image alt text */
8
+ alt?: string;
9
+ /** Aspect ratio of the image. Defaults to '1:1' */
10
+ ratio?: ImageRatio;
11
+ /** Custom aspect ratio as a string (e.g. '21 / 9') or number (e.g. 2.33) if ratio is set to 'Custom' */
12
+ customRatio?: string | number;
13
+ /** Optional slot for overlay or placeholder content */
14
+ slot?: React.ReactNode;
15
+ /** Width of the image container. Defaults to '100%' */
16
+ width?: number | string;
17
+ /** Border radius of the image container. Defaults to 0 */
18
+ borderRadius?: number | string;
19
+ /** Style for the container Box */
20
+ style?: React.CSSProperties;
21
+ /** Style for the img element */
22
+ imageStyle?: React.CSSProperties;
23
+ }
24
+ /**
25
+ * Image component with support for various aspect ratios and overlays.
26
+ */
27
+ declare const Image: React.FC<ImageProps>;
28
+
29
+ export { Image, type ImageProps, type ImageRatio };
package/web/index.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+
3
+ type ImageRatio = "1:1" | "2:3" | "3:2" | "16:9" | "4:3" | "9:16" | "Custom";
4
+ interface ImageProps {
5
+ /** Image source URL */
6
+ src?: string;
7
+ /** Image alt text */
8
+ alt?: string;
9
+ /** Aspect ratio of the image. Defaults to '1:1' */
10
+ ratio?: ImageRatio;
11
+ /** Custom aspect ratio as a string (e.g. '21 / 9') or number (e.g. 2.33) if ratio is set to 'Custom' */
12
+ customRatio?: string | number;
13
+ /** Optional slot for overlay or placeholder content */
14
+ slot?: React.ReactNode;
15
+ /** Width of the image container. Defaults to '100%' */
16
+ width?: number | string;
17
+ /** Border radius of the image container. Defaults to 0 */
18
+ borderRadius?: number | string;
19
+ /** Style for the container Box */
20
+ style?: React.CSSProperties;
21
+ /** Style for the img element */
22
+ imageStyle?: React.CSSProperties;
23
+ }
24
+ /**
25
+ * Image component with support for various aspect ratios and overlays.
26
+ */
27
+ declare const Image: React.FC<ImageProps>;
28
+
29
+ export { Image, type ImageProps, type ImageRatio };