@xsolla/xui-spinner-native 0.64.0-pr56.1768348754

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/index.d.mts ADDED
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+
3
+ interface SpinnerProps {
4
+ /**
5
+ * The size of the spinner.
6
+ * @default 'm'
7
+ */
8
+ size?: "xl" | "l" | "m" | "s" | "xs";
9
+ /**
10
+ * The color of the spinner.
11
+ * If not provided, it will use the default text color from the theme.
12
+ */
13
+ color?: string;
14
+ /**
15
+ * Accessible label for screen readers.
16
+ * @default 'Loading'
17
+ */
18
+ "aria-label"?: string;
19
+ /**
20
+ * ID of the element being loaded (for aria-describedby on the loading container).
21
+ */
22
+ "aria-describedby"?: string;
23
+ /**
24
+ * Test ID for testing frameworks.
25
+ */
26
+ testID?: string;
27
+ }
28
+ /**
29
+ * Spinner - An accessible loading indicator component
30
+ *
31
+ * Displays a spinning animation to indicate loading state.
32
+ *
33
+ * ## Accessibility Features
34
+ *
35
+ * - **role="status"**: Announces to screen readers that this is a status indicator
36
+ * - **aria-live="polite"**: Screen readers will announce when the spinner appears
37
+ * - **aria-label**: Provides accessible name for the spinner (defaults to "Loading")
38
+ *
39
+ * ## Sizes
40
+ *
41
+ * - xl: 96px
42
+ * - l: 48px
43
+ * - m: 24px (default)
44
+ * - s: 16px
45
+ * - xs: 8px
46
+ */
47
+ declare const Spinner: React.FC<SpinnerProps>;
48
+
49
+ export { Spinner, type SpinnerProps };
package/index.d.ts ADDED
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+
3
+ interface SpinnerProps {
4
+ /**
5
+ * The size of the spinner.
6
+ * @default 'm'
7
+ */
8
+ size?: "xl" | "l" | "m" | "s" | "xs";
9
+ /**
10
+ * The color of the spinner.
11
+ * If not provided, it will use the default text color from the theme.
12
+ */
13
+ color?: string;
14
+ /**
15
+ * Accessible label for screen readers.
16
+ * @default 'Loading'
17
+ */
18
+ "aria-label"?: string;
19
+ /**
20
+ * ID of the element being loaded (for aria-describedby on the loading container).
21
+ */
22
+ "aria-describedby"?: string;
23
+ /**
24
+ * Test ID for testing frameworks.
25
+ */
26
+ testID?: string;
27
+ }
28
+ /**
29
+ * Spinner - An accessible loading indicator component
30
+ *
31
+ * Displays a spinning animation to indicate loading state.
32
+ *
33
+ * ## Accessibility Features
34
+ *
35
+ * - **role="status"**: Announces to screen readers that this is a status indicator
36
+ * - **aria-live="polite"**: Screen readers will announce when the spinner appears
37
+ * - **aria-label**: Provides accessible name for the spinner (defaults to "Loading")
38
+ *
39
+ * ## Sizes
40
+ *
41
+ * - xl: 96px
42
+ * - l: 48px
43
+ * - m: 24px (default)
44
+ * - s: 16px
45
+ * - xs: 8px
46
+ */
47
+ declare const Spinner: React.FC<SpinnerProps>;
48
+
49
+ export { Spinner, type SpinnerProps };
package/index.js ADDED
@@ -0,0 +1,336 @@
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
+ Spinner: () => Spinner2
34
+ });
35
+ module.exports = __toCommonJS(index_exports);
36
+
37
+ // ../primitives-native/src/Box.tsx
38
+ var import_react_native = require("react-native");
39
+ var import_jsx_runtime = require("react/jsx-runtime");
40
+
41
+ // ../primitives-native/src/Text.tsx
42
+ var import_react_native2 = require("react-native");
43
+ var import_jsx_runtime2 = require("react/jsx-runtime");
44
+
45
+ // ../primitives-native/src/Spinner.tsx
46
+ var import_react_native3 = require("react-native");
47
+ var import_jsx_runtime3 = require("react/jsx-runtime");
48
+ var Spinner = ({
49
+ color,
50
+ size,
51
+ role,
52
+ "aria-label": ariaLabel,
53
+ "aria-live": ariaLive,
54
+ "aria-describedby": ariaDescribedBy,
55
+ testID
56
+ }) => {
57
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
58
+ import_react_native3.View,
59
+ {
60
+ accessible: true,
61
+ accessibilityRole: role === "status" ? "none" : void 0,
62
+ accessibilityLabel: ariaLabel,
63
+ accessibilityLiveRegion: ariaLive === "polite" ? "polite" : ariaLive === "assertive" ? "assertive" : "none",
64
+ testID,
65
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
66
+ import_react_native3.ActivityIndicator,
67
+ {
68
+ color,
69
+ size: typeof size === "number" ? size : "small"
70
+ }
71
+ )
72
+ }
73
+ );
74
+ };
75
+ Spinner.displayName = "Spinner";
76
+
77
+ // ../primitives-native/src/Icon.tsx
78
+ var import_react = __toESM(require("react"));
79
+ var import_react_native4 = require("react-native");
80
+ var import_jsx_runtime4 = require("react/jsx-runtime");
81
+
82
+ // ../primitives-native/src/Divider.tsx
83
+ var import_react_native5 = require("react-native");
84
+ var import_jsx_runtime5 = require("react/jsx-runtime");
85
+
86
+ // ../primitives-native/src/Input.tsx
87
+ var import_react2 = require("react");
88
+ var import_react_native6 = require("react-native");
89
+ var import_jsx_runtime6 = require("react/jsx-runtime");
90
+ var keyboardTypeMap = {
91
+ text: "default",
92
+ number: "numeric",
93
+ email: "email-address",
94
+ tel: "phone-pad",
95
+ url: "url",
96
+ decimal: "decimal-pad"
97
+ };
98
+ var inputModeToKeyboardType = {
99
+ none: "default",
100
+ text: "default",
101
+ decimal: "decimal-pad",
102
+ numeric: "number-pad",
103
+ tel: "phone-pad",
104
+ search: "default",
105
+ email: "email-address",
106
+ url: "url"
107
+ };
108
+ var autoCompleteToTextContentType = {
109
+ "one-time-code": "oneTimeCode",
110
+ email: "emailAddress",
111
+ username: "username",
112
+ password: "password",
113
+ "new-password": "newPassword",
114
+ tel: "telephoneNumber",
115
+ "postal-code": "postalCode",
116
+ name: "name"
117
+ };
118
+ var InputPrimitive = (0, import_react2.forwardRef)(
119
+ ({
120
+ value,
121
+ placeholder,
122
+ onChange,
123
+ onChangeText,
124
+ onFocus,
125
+ onBlur,
126
+ onKeyDown,
127
+ disabled,
128
+ secureTextEntry,
129
+ style,
130
+ color,
131
+ fontSize,
132
+ placeholderTextColor,
133
+ maxLength,
134
+ name,
135
+ type,
136
+ inputMode,
137
+ autoComplete,
138
+ id,
139
+ "aria-invalid": ariaInvalid,
140
+ "aria-describedby": ariaDescribedBy,
141
+ "aria-labelledby": ariaLabelledBy,
142
+ "aria-label": ariaLabel,
143
+ "aria-disabled": ariaDisabled,
144
+ "data-testid": dataTestId
145
+ }, ref) => {
146
+ const handleChangeText = (text) => {
147
+ onChangeText?.(text);
148
+ if (onChange) {
149
+ const syntheticEvent = {
150
+ target: { value: text },
151
+ currentTarget: { value: text },
152
+ type: "change",
153
+ nativeEvent: { text },
154
+ preventDefault: () => {
155
+ },
156
+ stopPropagation: () => {
157
+ },
158
+ isTrusted: false
159
+ };
160
+ onChange(syntheticEvent);
161
+ }
162
+ };
163
+ const keyboardType = inputMode ? inputModeToKeyboardType[inputMode] || "default" : type ? keyboardTypeMap[type] || "default" : "default";
164
+ const textContentType = autoComplete ? autoCompleteToTextContentType[autoComplete] : void 0;
165
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
166
+ import_react_native6.TextInput,
167
+ {
168
+ ref,
169
+ value,
170
+ placeholder,
171
+ onChangeText: handleChangeText,
172
+ onFocus,
173
+ onBlur,
174
+ onKeyPress: (e) => {
175
+ if (onKeyDown) {
176
+ onKeyDown({
177
+ key: e.nativeEvent.key,
178
+ preventDefault: () => {
179
+ }
180
+ });
181
+ }
182
+ },
183
+ editable: !disabled,
184
+ secureTextEntry: secureTextEntry || type === "password",
185
+ keyboardType,
186
+ textContentType,
187
+ style: [
188
+ {
189
+ color,
190
+ fontSize: typeof fontSize === "number" ? fontSize : void 0,
191
+ flex: 1,
192
+ padding: 0,
193
+ textAlign: style?.textAlign || "left"
194
+ },
195
+ style
196
+ ],
197
+ placeholderTextColor,
198
+ maxLength,
199
+ testID: dataTestId || id,
200
+ accessibilityLabel: ariaLabel,
201
+ accessibilityHint: ariaDescribedBy,
202
+ accessibilityState: {
203
+ disabled: disabled || ariaDisabled
204
+ },
205
+ accessible: true
206
+ }
207
+ );
208
+ }
209
+ );
210
+ InputPrimitive.displayName = "InputPrimitive";
211
+
212
+ // ../primitives-native/src/TextArea.tsx
213
+ var import_react3 = require("react");
214
+ var import_react_native7 = require("react-native");
215
+ var import_jsx_runtime7 = require("react/jsx-runtime");
216
+ var TextAreaPrimitive = (0, import_react3.forwardRef)(
217
+ ({
218
+ value,
219
+ placeholder,
220
+ onChange,
221
+ onChangeText,
222
+ onFocus,
223
+ onBlur,
224
+ onKeyDown,
225
+ disabled,
226
+ style,
227
+ color,
228
+ fontSize,
229
+ placeholderTextColor,
230
+ maxLength,
231
+ rows,
232
+ id,
233
+ "aria-invalid": ariaInvalid,
234
+ "aria-describedby": ariaDescribedBy,
235
+ "aria-labelledby": ariaLabelledBy,
236
+ "aria-label": ariaLabel,
237
+ "aria-disabled": ariaDisabled,
238
+ "data-testid": dataTestId
239
+ }, ref) => {
240
+ const handleChangeText = (text) => {
241
+ onChangeText?.(text);
242
+ if (onChange) {
243
+ const syntheticEvent = {
244
+ target: { value: text },
245
+ currentTarget: { value: text },
246
+ type: "change",
247
+ nativeEvent: { text },
248
+ preventDefault: () => {
249
+ },
250
+ stopPropagation: () => {
251
+ },
252
+ isTrusted: false
253
+ };
254
+ onChange(syntheticEvent);
255
+ }
256
+ };
257
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
258
+ import_react_native7.TextInput,
259
+ {
260
+ ref,
261
+ value,
262
+ placeholder,
263
+ onChangeText: handleChangeText,
264
+ onFocus,
265
+ onBlur,
266
+ onKeyPress: (e) => {
267
+ if (onKeyDown) {
268
+ onKeyDown({
269
+ key: e.nativeEvent.key,
270
+ preventDefault: () => {
271
+ }
272
+ });
273
+ }
274
+ },
275
+ editable: !disabled,
276
+ multiline: true,
277
+ numberOfLines: rows || 4,
278
+ style: [
279
+ {
280
+ color,
281
+ fontSize: typeof fontSize === "number" ? fontSize : void 0,
282
+ flex: 1,
283
+ padding: 0,
284
+ textAlignVertical: "top",
285
+ textAlign: style?.textAlign || "left"
286
+ },
287
+ style
288
+ ],
289
+ placeholderTextColor,
290
+ maxLength,
291
+ testID: dataTestId || id,
292
+ accessibilityLabel: ariaLabel,
293
+ accessibilityHint: ariaDescribedBy,
294
+ accessibilityState: {
295
+ disabled: disabled || ariaDisabled
296
+ },
297
+ accessible: true
298
+ }
299
+ );
300
+ }
301
+ );
302
+ TextAreaPrimitive.displayName = "TextAreaPrimitive";
303
+
304
+ // src/Spinner.tsx
305
+ var import_xui_core = require("@xsolla/xui-core");
306
+ var import_jsx_runtime8 = require("react/jsx-runtime");
307
+ var Spinner2 = ({
308
+ size = "m",
309
+ color,
310
+ "aria-label": ariaLabel = "Loading",
311
+ "aria-describedby": ariaDescribedBy,
312
+ testID
313
+ }) => {
314
+ const { theme } = (0, import_xui_core.useDesignSystem)();
315
+ const sizeConfig = theme.sizing.spinner(size);
316
+ const defaultColor = theme.colors.content.primary;
317
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
318
+ Spinner,
319
+ {
320
+ size: sizeConfig.size,
321
+ strokeWidth: sizeConfig.strokeWidth,
322
+ color: color || defaultColor,
323
+ role: "status",
324
+ "aria-live": "polite",
325
+ "aria-label": ariaLabel,
326
+ "aria-describedby": ariaDescribedBy,
327
+ testID
328
+ }
329
+ );
330
+ };
331
+ Spinner2.displayName = "Spinner";
332
+ // Annotate the CommonJS export names for ESM import in node:
333
+ 0 && (module.exports = {
334
+ Spinner
335
+ });
336
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.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","../../src/Spinner.tsx"],"sourcesContent":["export * from \"./Spinner\";\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","import type React from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Spinner as SpinnerPrimitive } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\n\nexport interface SpinnerProps {\n /**\n * The size of the spinner.\n * @default 'm'\n */\n size?: \"xl\" | \"l\" | \"m\" | \"s\" | \"xs\";\n /**\n * The color of the spinner.\n * If not provided, it will use the default text color from the theme.\n */\n color?: string;\n /**\n * Accessible label for screen readers.\n * @default 'Loading'\n */\n \"aria-label\"?: string;\n /**\n * ID of the element being loaded (for aria-describedby on the loading container).\n */\n \"aria-describedby\"?: string;\n /**\n * Test ID for testing frameworks.\n */\n testID?: string;\n}\n\n/**\n * Spinner - An accessible loading indicator component\n *\n * Displays a spinning animation to indicate loading state.\n *\n * ## Accessibility Features\n *\n * - **role=\"status\"**: Announces to screen readers that this is a status indicator\n * - **aria-live=\"polite\"**: Screen readers will announce when the spinner appears\n * - **aria-label**: Provides accessible name for the spinner (defaults to \"Loading\")\n *\n * ## Sizes\n *\n * - xl: 96px\n * - l: 48px\n * - m: 24px (default)\n * - s: 16px\n * - xs: 8px\n */\nexport const Spinner: React.FC<SpinnerProps> = ({\n size = \"m\",\n color,\n \"aria-label\": ariaLabel = \"Loading\",\n \"aria-describedby\": ariaDescribedBy,\n testID,\n}) => {\n const { theme } = useDesignSystem();\n\n const sizeConfig = theme.sizing.spinner(size);\n const defaultColor = theme.colors.content.primary;\n\n return (\n <SpinnerPrimitive\n size={sizeConfig.size}\n strokeWidth={sizeConfig.strokeWidth}\n color={color || defaultColor}\n role=\"status\"\n aria-live=\"polite\"\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n testID={testID}\n />\n );\n};\n\nSpinner.displayName = \"Spinner\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAA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jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react","import_react_native","import_jsx_runtime","RNTextInput","import_react","import_react_native","import_jsx_runtime","RNTextInput","import_jsx_runtime","Spinner"]}
package/index.mjs ADDED
@@ -0,0 +1,303 @@
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
+
9
+ // ../primitives-native/src/Text.tsx
10
+ import { Text as RNText } from "react-native";
11
+ import { jsx as jsx2 } from "react/jsx-runtime";
12
+
13
+ // ../primitives-native/src/Spinner.tsx
14
+ import { ActivityIndicator, View as View2 } from "react-native";
15
+ import { jsx as jsx3 } from "react/jsx-runtime";
16
+ var Spinner = ({
17
+ color,
18
+ size,
19
+ role,
20
+ "aria-label": ariaLabel,
21
+ "aria-live": ariaLive,
22
+ "aria-describedby": ariaDescribedBy,
23
+ testID
24
+ }) => {
25
+ return /* @__PURE__ */ jsx3(
26
+ View2,
27
+ {
28
+ accessible: true,
29
+ accessibilityRole: role === "status" ? "none" : void 0,
30
+ accessibilityLabel: ariaLabel,
31
+ accessibilityLiveRegion: ariaLive === "polite" ? "polite" : ariaLive === "assertive" ? "assertive" : "none",
32
+ testID,
33
+ children: /* @__PURE__ */ jsx3(
34
+ ActivityIndicator,
35
+ {
36
+ color,
37
+ size: typeof size === "number" ? size : "small"
38
+ }
39
+ )
40
+ }
41
+ );
42
+ };
43
+ Spinner.displayName = "Spinner";
44
+
45
+ // ../primitives-native/src/Icon.tsx
46
+ import React from "react";
47
+ import { View as View3 } from "react-native";
48
+ import { jsx as jsx4 } from "react/jsx-runtime";
49
+
50
+ // ../primitives-native/src/Divider.tsx
51
+ import { View as View4 } from "react-native";
52
+ import { jsx as jsx5 } from "react/jsx-runtime";
53
+
54
+ // ../primitives-native/src/Input.tsx
55
+ import { forwardRef } from "react";
56
+ import { TextInput as RNTextInput } from "react-native";
57
+ import { jsx as jsx6 } from "react/jsx-runtime";
58
+ var keyboardTypeMap = {
59
+ text: "default",
60
+ number: "numeric",
61
+ email: "email-address",
62
+ tel: "phone-pad",
63
+ url: "url",
64
+ decimal: "decimal-pad"
65
+ };
66
+ var inputModeToKeyboardType = {
67
+ none: "default",
68
+ text: "default",
69
+ decimal: "decimal-pad",
70
+ numeric: "number-pad",
71
+ tel: "phone-pad",
72
+ search: "default",
73
+ email: "email-address",
74
+ url: "url"
75
+ };
76
+ var autoCompleteToTextContentType = {
77
+ "one-time-code": "oneTimeCode",
78
+ email: "emailAddress",
79
+ username: "username",
80
+ password: "password",
81
+ "new-password": "newPassword",
82
+ tel: "telephoneNumber",
83
+ "postal-code": "postalCode",
84
+ name: "name"
85
+ };
86
+ var InputPrimitive = forwardRef(
87
+ ({
88
+ value,
89
+ placeholder,
90
+ onChange,
91
+ onChangeText,
92
+ onFocus,
93
+ onBlur,
94
+ onKeyDown,
95
+ disabled,
96
+ secureTextEntry,
97
+ style,
98
+ color,
99
+ fontSize,
100
+ placeholderTextColor,
101
+ maxLength,
102
+ name,
103
+ type,
104
+ inputMode,
105
+ autoComplete,
106
+ id,
107
+ "aria-invalid": ariaInvalid,
108
+ "aria-describedby": ariaDescribedBy,
109
+ "aria-labelledby": ariaLabelledBy,
110
+ "aria-label": ariaLabel,
111
+ "aria-disabled": ariaDisabled,
112
+ "data-testid": dataTestId
113
+ }, ref) => {
114
+ const handleChangeText = (text) => {
115
+ onChangeText?.(text);
116
+ if (onChange) {
117
+ const syntheticEvent = {
118
+ target: { value: text },
119
+ currentTarget: { value: text },
120
+ type: "change",
121
+ nativeEvent: { text },
122
+ preventDefault: () => {
123
+ },
124
+ stopPropagation: () => {
125
+ },
126
+ isTrusted: false
127
+ };
128
+ onChange(syntheticEvent);
129
+ }
130
+ };
131
+ const keyboardType = inputMode ? inputModeToKeyboardType[inputMode] || "default" : type ? keyboardTypeMap[type] || "default" : "default";
132
+ const textContentType = autoComplete ? autoCompleteToTextContentType[autoComplete] : void 0;
133
+ return /* @__PURE__ */ jsx6(
134
+ RNTextInput,
135
+ {
136
+ ref,
137
+ value,
138
+ placeholder,
139
+ onChangeText: handleChangeText,
140
+ onFocus,
141
+ onBlur,
142
+ onKeyPress: (e) => {
143
+ if (onKeyDown) {
144
+ onKeyDown({
145
+ key: e.nativeEvent.key,
146
+ preventDefault: () => {
147
+ }
148
+ });
149
+ }
150
+ },
151
+ editable: !disabled,
152
+ secureTextEntry: secureTextEntry || type === "password",
153
+ keyboardType,
154
+ textContentType,
155
+ style: [
156
+ {
157
+ color,
158
+ fontSize: typeof fontSize === "number" ? fontSize : void 0,
159
+ flex: 1,
160
+ padding: 0,
161
+ textAlign: style?.textAlign || "left"
162
+ },
163
+ style
164
+ ],
165
+ placeholderTextColor,
166
+ maxLength,
167
+ testID: dataTestId || id,
168
+ accessibilityLabel: ariaLabel,
169
+ accessibilityHint: ariaDescribedBy,
170
+ accessibilityState: {
171
+ disabled: disabled || ariaDisabled
172
+ },
173
+ accessible: true
174
+ }
175
+ );
176
+ }
177
+ );
178
+ InputPrimitive.displayName = "InputPrimitive";
179
+
180
+ // ../primitives-native/src/TextArea.tsx
181
+ import { forwardRef as forwardRef2 } from "react";
182
+ import { TextInput as RNTextInput2 } from "react-native";
183
+ import { jsx as jsx7 } from "react/jsx-runtime";
184
+ var TextAreaPrimitive = forwardRef2(
185
+ ({
186
+ value,
187
+ placeholder,
188
+ onChange,
189
+ onChangeText,
190
+ onFocus,
191
+ onBlur,
192
+ onKeyDown,
193
+ disabled,
194
+ style,
195
+ color,
196
+ fontSize,
197
+ placeholderTextColor,
198
+ maxLength,
199
+ rows,
200
+ id,
201
+ "aria-invalid": ariaInvalid,
202
+ "aria-describedby": ariaDescribedBy,
203
+ "aria-labelledby": ariaLabelledBy,
204
+ "aria-label": ariaLabel,
205
+ "aria-disabled": ariaDisabled,
206
+ "data-testid": dataTestId
207
+ }, ref) => {
208
+ const handleChangeText = (text) => {
209
+ onChangeText?.(text);
210
+ if (onChange) {
211
+ const syntheticEvent = {
212
+ target: { value: text },
213
+ currentTarget: { value: text },
214
+ type: "change",
215
+ nativeEvent: { text },
216
+ preventDefault: () => {
217
+ },
218
+ stopPropagation: () => {
219
+ },
220
+ isTrusted: false
221
+ };
222
+ onChange(syntheticEvent);
223
+ }
224
+ };
225
+ return /* @__PURE__ */ jsx7(
226
+ RNTextInput2,
227
+ {
228
+ ref,
229
+ value,
230
+ placeholder,
231
+ onChangeText: handleChangeText,
232
+ onFocus,
233
+ onBlur,
234
+ onKeyPress: (e) => {
235
+ if (onKeyDown) {
236
+ onKeyDown({
237
+ key: e.nativeEvent.key,
238
+ preventDefault: () => {
239
+ }
240
+ });
241
+ }
242
+ },
243
+ editable: !disabled,
244
+ multiline: true,
245
+ numberOfLines: rows || 4,
246
+ style: [
247
+ {
248
+ color,
249
+ fontSize: typeof fontSize === "number" ? fontSize : void 0,
250
+ flex: 1,
251
+ padding: 0,
252
+ textAlignVertical: "top",
253
+ textAlign: style?.textAlign || "left"
254
+ },
255
+ style
256
+ ],
257
+ placeholderTextColor,
258
+ maxLength,
259
+ testID: dataTestId || id,
260
+ accessibilityLabel: ariaLabel,
261
+ accessibilityHint: ariaDescribedBy,
262
+ accessibilityState: {
263
+ disabled: disabled || ariaDisabled
264
+ },
265
+ accessible: true
266
+ }
267
+ );
268
+ }
269
+ );
270
+ TextAreaPrimitive.displayName = "TextAreaPrimitive";
271
+
272
+ // src/Spinner.tsx
273
+ import { useDesignSystem } from "@xsolla/xui-core";
274
+ import { jsx as jsx8 } from "react/jsx-runtime";
275
+ var Spinner2 = ({
276
+ size = "m",
277
+ color,
278
+ "aria-label": ariaLabel = "Loading",
279
+ "aria-describedby": ariaDescribedBy,
280
+ testID
281
+ }) => {
282
+ const { theme } = useDesignSystem();
283
+ const sizeConfig = theme.sizing.spinner(size);
284
+ const defaultColor = theme.colors.content.primary;
285
+ return /* @__PURE__ */ jsx8(
286
+ Spinner,
287
+ {
288
+ size: sizeConfig.size,
289
+ strokeWidth: sizeConfig.strokeWidth,
290
+ color: color || defaultColor,
291
+ role: "status",
292
+ "aria-live": "polite",
293
+ "aria-label": ariaLabel,
294
+ "aria-describedby": ariaDescribedBy,
295
+ testID
296
+ }
297
+ );
298
+ };
299
+ Spinner2.displayName = "Spinner";
300
+ export {
301
+ Spinner2 as Spinner
302
+ };
303
+ //# sourceMappingURL=index.mjs.map
package/index.mjs.map ADDED
@@ -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/Spinner.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 type React from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Spinner as SpinnerPrimitive } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\n\nexport interface SpinnerProps {\n /**\n * The size of the spinner.\n * @default 'm'\n */\n size?: \"xl\" | \"l\" | \"m\" | \"s\" | \"xs\";\n /**\n * The color of the spinner.\n * If not provided, it will use the default text color from the theme.\n */\n color?: string;\n /**\n * Accessible label for screen readers.\n * @default 'Loading'\n */\n \"aria-label\"?: string;\n /**\n * ID of the element being loaded (for aria-describedby on the loading container).\n */\n \"aria-describedby\"?: string;\n /**\n * Test ID for testing frameworks.\n */\n testID?: string;\n}\n\n/**\n * Spinner - An accessible loading indicator component\n *\n * Displays a spinning animation to indicate loading state.\n *\n * ## Accessibility Features\n *\n * - **role=\"status\"**: Announces to screen readers that this is a status indicator\n * - **aria-live=\"polite\"**: Screen readers will announce when the spinner appears\n * - **aria-label**: Provides accessible name for the spinner (defaults to \"Loading\")\n *\n * ## Sizes\n *\n * - xl: 96px\n * - l: 48px\n * - m: 24px (default)\n * - s: 16px\n * - xs: 8px\n */\nexport const Spinner: React.FC<SpinnerProps> = ({\n size = \"m\",\n color,\n \"aria-label\": ariaLabel = \"Loading\",\n \"aria-describedby\": ariaDescribedBy,\n testID,\n}) => {\n const { theme } = useDesignSystem();\n\n const sizeConfig = theme.sizing.spinner(size);\n const defaultColor = theme.colors.content.primary;\n\n return (\n <SpinnerPrimitive\n size={sizeConfig.size}\n strokeWidth={sizeConfig.strokeWidth}\n color={color || defaultColor}\n role=\"status\"\n aria-live=\"polite\"\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n testID={testID}\n />\n );\n};\n\nSpinner.displayName = \"Spinner\";\n"],"mappings":";AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAmID;;;AC3IN,SAAS,QAAQ,cAA4C;AA6CzD,gBAAAA,YAAA;;;AC7CJ,SAAS,mBAAmB,QAAAC,aAAY;AA0BlC,gBAAAC,YAAA;AAvBC,IAAM,UAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,aAAa;AAAA,EACb,oBAAoB;AAAA,EACpB;AACF,M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A,UAAU,CAAC;AAAA,QACX,WAAW;AAAA,QACX,eAAe,QAAQ;AAAA,QACvB,OAAO;AAAA,UACL;AAAA,YACE;AAAA,YACA,UAAU,OAAO,aAAa,WAAW,WAAW;AAAA,YACpD,MAAM;AAAA,YACN,SAAS;AAAA,YACT,mBAAmB;AAAA,YACnB,WAAY,OAAe,aAAa;AAAA,UAC1C;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACA;AAAA,QACA,QAAQ,cAAc;AAAA,QACtB,oBAAoB;AAAA,QACpB,mBAAmB;AAAA,QACnB,oBAAoB;AAAA,UAClB,UAAU,YAAY;AAAA,QACxB;AAAA,QACA,YAAY;AAAA;AAAA,IACd;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;;;AC5FhC,SAAS,uBAAuB;AA4D5B,gBAAAE,YAAA;AAbG,IAAMC,WAAkC,CAAC;AAAA,EAC9C,OAAO;AAAA,EACP;AAAA,EACA,cAAc,YAAY;AAAA,EAC1B,oBAAoB;AAAA,EACpB;AACF,MAAM;AACJ,QAAM,EAAE,MAAM,IAAI,gBAAgB;AAElC,QAAM,aAAa,MAAM,OAAO,QAAQ,IAAI;AAC5C,QAAM,eAAe,MAAM,OAAO,QAAQ;AAE1C,SACE,gBAAAD;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,WAAW;AAAA,MACjB,aAAa,WAAW;AAAA,MACxB,OAAO,SAAS;AAAA,MAChB,MAAK;AAAA,MACL,aAAU;AAAA,MACV,cAAY;AAAA,MACZ,oBAAkB;AAAA,MAClB;AAAA;AAAA,EACF;AAEJ;AAEAC,SAAQ,cAAc;","names":["jsx","View","jsx","View","jsx","View","jsx","jsx","forwardRef","RNTextInput","jsx","jsx","Spinner"]}
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@xsolla/xui-spinner-native",
3
+ "version": "0.64.0-pr56.1768348754",
4
+ "main": "./index.js",
5
+ "module": "./index.mjs",
6
+ "types": "./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.1768348754",
14
+ "@xsolla/xui-primitives-core": "0.64.0-pr56.1768348754"
15
+ },
16
+ "peerDependencies": {
17
+ "react": ">=16.8.0",
18
+ "styled-components": ">=4",
19
+ "react-native": "*"
20
+ },
21
+ "devDependencies": {
22
+ "tsup": "^8.0.0"
23
+ },
24
+ "license": "MIT"
25
+ }