@xsolla/xui-status 0.89.0 → 0.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/native/index.js CHANGED
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
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
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
 
30
20
  // src/index.tsx
@@ -35,7 +25,7 @@ __export(index_exports, {
35
25
  module.exports = __toCommonJS(index_exports);
36
26
 
37
27
  // src/Status.tsx
38
- var import_react4 = require("react");
28
+ var import_react = require("react");
39
29
 
40
30
  // ../primitives-native/src/Box.tsx
41
31
  var import_react_native = require("react-native");
@@ -238,262 +228,9 @@ var Text = ({
238
228
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.Text, { style, testID: id, accessibilityRole, children });
239
229
  };
240
230
 
241
- // ../primitives-native/src/Spinner.tsx
242
- var import_react_native3 = require("react-native");
243
- var import_jsx_runtime3 = require("react/jsx-runtime");
244
- var Spinner = ({
245
- color,
246
- size,
247
- role,
248
- "aria-label": ariaLabel,
249
- "aria-live": ariaLive,
250
- testID
251
- }) => {
252
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
253
- import_react_native3.View,
254
- {
255
- accessible: true,
256
- accessibilityRole: role === "status" ? "none" : void 0,
257
- accessibilityLabel: ariaLabel,
258
- accessibilityLiveRegion: ariaLive === "polite" ? "polite" : ariaLive === "assertive" ? "assertive" : "none",
259
- testID,
260
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
261
- import_react_native3.ActivityIndicator,
262
- {
263
- color,
264
- size: typeof size === "number" ? size : "small"
265
- }
266
- )
267
- }
268
- );
269
- };
270
- Spinner.displayName = "Spinner";
271
-
272
- // ../primitives-native/src/Icon.tsx
273
- var import_react = __toESM(require("react"));
274
- var import_react_native4 = require("react-native");
275
- var import_jsx_runtime4 = require("react/jsx-runtime");
276
-
277
- // ../primitives-native/src/Divider.tsx
278
- var import_react_native5 = require("react-native");
279
- var import_jsx_runtime5 = require("react/jsx-runtime");
280
-
281
- // ../primitives-native/src/Input.tsx
282
- var import_react2 = require("react");
283
- var import_react_native6 = require("react-native");
284
- var import_jsx_runtime6 = require("react/jsx-runtime");
285
- var keyboardTypeMap = {
286
- text: "default",
287
- number: "numeric",
288
- email: "email-address",
289
- tel: "phone-pad",
290
- url: "url",
291
- decimal: "decimal-pad"
292
- };
293
- var inputModeToKeyboardType = {
294
- none: "default",
295
- text: "default",
296
- decimal: "decimal-pad",
297
- numeric: "number-pad",
298
- tel: "phone-pad",
299
- search: "default",
300
- email: "email-address",
301
- url: "url"
302
- };
303
- var autoCompleteToTextContentType = {
304
- "one-time-code": "oneTimeCode",
305
- email: "emailAddress",
306
- username: "username",
307
- password: "password",
308
- "new-password": "newPassword",
309
- tel: "telephoneNumber",
310
- "postal-code": "postalCode",
311
- name: "name"
312
- };
313
- var InputPrimitive = (0, import_react2.forwardRef)(
314
- ({
315
- value,
316
- placeholder,
317
- onChange,
318
- onChangeText,
319
- onFocus,
320
- onBlur,
321
- onKeyDown,
322
- disabled,
323
- secureTextEntry,
324
- style,
325
- color,
326
- fontSize,
327
- placeholderTextColor,
328
- maxLength,
329
- type,
330
- inputMode,
331
- autoComplete,
332
- id,
333
- "aria-describedby": ariaDescribedBy,
334
- "aria-label": ariaLabel,
335
- "aria-disabled": ariaDisabled,
336
- "data-testid": dataTestId
337
- }, ref) => {
338
- const handleChangeText = (text) => {
339
- onChangeText?.(text);
340
- if (onChange) {
341
- const syntheticEvent = {
342
- target: { value: text },
343
- currentTarget: { value: text },
344
- type: "change",
345
- nativeEvent: { text },
346
- preventDefault: () => {
347
- },
348
- stopPropagation: () => {
349
- },
350
- isTrusted: false
351
- };
352
- onChange(syntheticEvent);
353
- }
354
- };
355
- const keyboardType = inputMode ? inputModeToKeyboardType[inputMode] || "default" : type ? keyboardTypeMap[type] || "default" : "default";
356
- const textContentType = autoComplete ? autoCompleteToTextContentType[autoComplete] : void 0;
357
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
358
- import_react_native6.TextInput,
359
- {
360
- ref,
361
- value,
362
- placeholder,
363
- onChangeText: handleChangeText,
364
- onFocus,
365
- onBlur,
366
- onKeyPress: (e) => {
367
- if (onKeyDown) {
368
- onKeyDown({
369
- key: e.nativeEvent.key,
370
- preventDefault: () => {
371
- }
372
- });
373
- }
374
- },
375
- editable: !disabled,
376
- secureTextEntry: secureTextEntry || type === "password",
377
- keyboardType,
378
- textContentType,
379
- style: [
380
- {
381
- color,
382
- fontSize: typeof fontSize === "number" ? fontSize : void 0,
383
- flex: 1,
384
- padding: 0,
385
- textAlign: style?.textAlign || "left"
386
- },
387
- style
388
- ],
389
- placeholderTextColor,
390
- maxLength,
391
- testID: dataTestId || id,
392
- accessibilityLabel: ariaLabel,
393
- accessibilityHint: ariaDescribedBy,
394
- accessibilityState: {
395
- disabled: disabled || ariaDisabled
396
- },
397
- accessible: true
398
- }
399
- );
400
- }
401
- );
402
- InputPrimitive.displayName = "InputPrimitive";
403
-
404
- // ../primitives-native/src/TextArea.tsx
405
- var import_react3 = require("react");
406
- var import_react_native7 = require("react-native");
407
- var import_jsx_runtime7 = require("react/jsx-runtime");
408
- var TextAreaPrimitive = (0, import_react3.forwardRef)(
409
- ({
410
- value,
411
- placeholder,
412
- onChange,
413
- onChangeText,
414
- onFocus,
415
- onBlur,
416
- onKeyDown,
417
- disabled,
418
- style,
419
- color,
420
- fontSize,
421
- placeholderTextColor,
422
- maxLength,
423
- rows,
424
- id,
425
- "aria-describedby": ariaDescribedBy,
426
- "aria-label": ariaLabel,
427
- "aria-disabled": ariaDisabled,
428
- "data-testid": dataTestId
429
- }, ref) => {
430
- const handleChangeText = (text) => {
431
- onChangeText?.(text);
432
- if (onChange) {
433
- const syntheticEvent = {
434
- target: { value: text },
435
- currentTarget: { value: text },
436
- type: "change",
437
- nativeEvent: { text },
438
- preventDefault: () => {
439
- },
440
- stopPropagation: () => {
441
- },
442
- isTrusted: false
443
- };
444
- onChange(syntheticEvent);
445
- }
446
- };
447
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
448
- import_react_native7.TextInput,
449
- {
450
- ref,
451
- value,
452
- placeholder,
453
- onChangeText: handleChangeText,
454
- onFocus,
455
- onBlur,
456
- onKeyPress: (e) => {
457
- if (onKeyDown) {
458
- onKeyDown({
459
- key: e.nativeEvent.key,
460
- preventDefault: () => {
461
- }
462
- });
463
- }
464
- },
465
- editable: !disabled,
466
- multiline: true,
467
- numberOfLines: rows || 4,
468
- style: [
469
- {
470
- color,
471
- fontSize: typeof fontSize === "number" ? fontSize : void 0,
472
- flex: 1,
473
- padding: 0,
474
- textAlignVertical: "top",
475
- textAlign: style?.textAlign || "left"
476
- },
477
- style
478
- ],
479
- placeholderTextColor,
480
- maxLength,
481
- testID: dataTestId || id,
482
- accessibilityLabel: ariaLabel,
483
- accessibilityHint: ariaDescribedBy,
484
- accessibilityState: {
485
- disabled: disabled || ariaDisabled
486
- },
487
- accessible: true
488
- }
489
- );
490
- }
491
- );
492
- TextAreaPrimitive.displayName = "TextAreaPrimitive";
493
-
494
231
  // src/Status.tsx
495
232
  var import_xui_core = require("@xsolla/xui-core");
496
- var import_jsx_runtime8 = require("react/jsx-runtime");
233
+ var import_jsx_runtime3 = require("react/jsx-runtime");
497
234
  var dotSizeMap = {
498
235
  sm: 4,
499
236
  md: 6,
@@ -535,7 +272,7 @@ var getDotColor = (palette, theme) => {
535
272
  return theme.colors.content.tertiary;
536
273
  }
537
274
  };
538
- var Status = (0, import_react4.forwardRef)(
275
+ var Status = (0, import_react.forwardRef)(
539
276
  ({
540
277
  children,
541
278
  palette = "default",
@@ -557,7 +294,7 @@ var Status = (0, import_react4.forwardRef)(
557
294
  const isStringChildren = typeof children === "string";
558
295
  const computedAriaLabel = ariaLabel || (isStringChildren ? `${semanticStatus}: ${children}` : children ? void 0 : `Status: ${semanticStatus}`);
559
296
  const role = ariaLive === "off" ? void 0 : ariaLive === "assertive" ? "alert" : "status";
560
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
297
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
561
298
  Box,
562
299
  {
563
300
  ref,
@@ -570,7 +307,7 @@ var Status = (0, import_react4.forwardRef)(
570
307
  alignItems: "center",
571
308
  gap: gapSize,
572
309
  children: [
573
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
310
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
574
311
  Box,
575
312
  {
576
313
  width: dotSize,
@@ -580,7 +317,7 @@ var Status = (0, import_react4.forwardRef)(
580
317
  "aria-hidden": true
581
318
  }
582
319
  ),
583
- children && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
320
+ children && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
584
321
  Text,
585
322
  {
586
323
  color: labelColor,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx","../../src/Status.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":["export * from \"./Status\";\nexport * from \"./types\";\n","import { forwardRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport type { StatusPalette, StatusSize, StatusProps } from \"./types\";\n\nconst dotSizeMap: Record<StatusSize, number> = {\n sm: 4,\n md: 6,\n lg: 8,\n};\n\nconst gapSizeMap: Record<StatusSize, number> = {\n sm: 4,\n md: 6,\n lg: 8,\n};\n\nconst fontSizeMap: Record<StatusSize, number> = {\n sm: 12,\n md: 14,\n lg: 16,\n};\n\nconst lineHeightMap: Record<StatusSize, number> = {\n sm: 16,\n md: 20,\n lg: 24,\n};\n\nconst paletteSemantics: Record<StatusPalette, string> = {\n default: \"inactive\",\n success: \"success\",\n warning: \"warning\",\n alert: \"error\",\n neutral: \"neutral\",\n};\n\nconst getDotColor = (palette: StatusPalette, theme: any): string => {\n switch (palette) {\n case \"success\":\n return theme.colors.content.success.primary;\n case \"warning\":\n return theme.colors.content.warning.primary;\n case \"alert\":\n return theme.colors.content.alert.primary;\n case \"neutral\":\n return theme.colors.content.neutral.primary;\n default:\n return theme.colors.content.tertiary;\n }\n};\n\n/**\n * Status - An accessible status indicator component\n *\n * Displays a colored dot with optional label to indicate status.\n *\n * ## Accessibility Features\n *\n * - **Semantic Role**: Uses `role=\"status\"` by default (implies `aria-live=\"polite\"`)\n * - **ARIA Label**: Auto-generates for string children; provide explicit `aria-label` for complex children or localization\n * - **Live Region**: `aria-live=\"assertive\"` switches to `role=\"alert\"`, `\"off\"` disables announcements\n *\n */\nexport const Status = forwardRef<HTMLDivElement, StatusProps>(\n (\n {\n children,\n palette = \"default\",\n size = \"md\",\n labelType = \"primary\",\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive,\n testID,\n id,\n },\n ref\n ) => {\n const { theme } = useDesignSystem();\n\n const dotSize = dotSizeMap[size];\n const gapSize = gapSizeMap[size];\n const fontSize = fontSizeMap[size];\n const lineHeight = lineHeightMap[size];\n const dotColor = getDotColor(palette, theme);\n const labelColor =\n labelType === \"dot-color\" ? dotColor : theme.colors.content.primary;\n\n // Generate accessible label from palette and children if not provided\n // For complex children (non-string), require explicit aria-label for full accessibility\n const semanticStatus = paletteSemantics[palette];\n const isStringChildren = typeof children === \"string\";\n const computedAriaLabel =\n ariaLabel ||\n (isStringChildren\n ? `${semanticStatus}: ${children}`\n : children\n ? undefined // Let screen reader read the visible text naturally\n : `Status: ${semanticStatus}`); // Dot-only: provide context\n\n // Determine role based on aria-live to avoid conflicts:\n // - role=\"status\" implies aria-live=\"polite\" (default)\n // - role=\"alert\" implies aria-live=\"assertive\"\n // - aria-live=\"off\" means no live region role\n const role =\n ariaLive === \"off\"\n ? undefined\n : ariaLive === \"assertive\"\n ? \"alert\"\n : \"status\";\n\n return (\n <Box\n ref={ref}\n id={id}\n role={role}\n aria-label={computedAriaLabel}\n testID={testID}\n display=\"inline-flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={gapSize}\n >\n <Box\n width={dotSize}\n height={dotSize}\n borderRadius={50}\n backgroundColor={dotColor}\n aria-hidden={true}\n />\n {children && (\n <Text\n color={labelColor}\n fontSize={fontSize}\n fontWeight=\"400\"\n aria-hidden={computedAriaLabel ? true : undefined}\n style={{\n lineHeight: `${lineHeight}px`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {children}\n </Text>\n )}\n </Box>\n );\n }\n);\n\nStatus.displayName = \"Status\";\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 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 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 type,\n inputMode,\n autoComplete,\n id,\n \"aria-describedby\": ariaDescribedBy,\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-describedby\": ariaDescribedBy,\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;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA2B;;;ACC3B,0BAQO;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,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OAAO,aAAa;AAC7C,UAAM,oBACJ,cACC,mBACG,GAAG,cAAc,KAAK,QAAQ,KAC9B,WACE,SACA,WAAW,cAAc;AAMjC,UAAM,OACJ,aAAa,QACT,SACA,aAAa,cACX,UACA;AAER,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,cAAY;AAAA,QACZ;AAAA,QACA,SAAQ;AAAA,QACR,eAAc;AAAA,QACd,YAAW;AAAA,QACX,KAAK;AAAA,QAEL;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,cAAc;AAAA,cACd,iBAAiB;AAAA,cACjB,eAAa;AAAA;AAAA,UACf;AAAA,UACC,YACC;AAAA,YAAC;AAAA;AAAA,cACC,OAAO;AAAA,cACP;AAAA,cACA,YAAW;AAAA,cACX,eAAa,oBAAoB,OAAO;AAAA,cACxC,OAAO;AAAA,gBACL,YAAY,GAAG,UAAU;AAAA,gBACzB,SAAS;AAAA,gBACT,YAAY;AAAA,gBACZ,gBAAgB;AAAA,cAClB;AAAA,cAEC;AAAA;AAAA,UACH;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;","names":["import_react","import_react_native","import_jsx_runtime","RNText","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"]}
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/Status.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx"],"sourcesContent":["export * from \"./Status\";\nexport * from \"./types\";\n","import { forwardRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport type { StatusPalette, StatusSize, StatusProps } from \"./types\";\n\nconst dotSizeMap: Record<StatusSize, number> = {\n sm: 4,\n md: 6,\n lg: 8,\n};\n\nconst gapSizeMap: Record<StatusSize, number> = {\n sm: 4,\n md: 6,\n lg: 8,\n};\n\nconst fontSizeMap: Record<StatusSize, number> = {\n sm: 12,\n md: 14,\n lg: 16,\n};\n\nconst lineHeightMap: Record<StatusSize, number> = {\n sm: 16,\n md: 20,\n lg: 24,\n};\n\nconst paletteSemantics: Record<StatusPalette, string> = {\n default: \"inactive\",\n success: \"success\",\n warning: \"warning\",\n alert: \"error\",\n neutral: \"neutral\",\n};\n\nconst getDotColor = (palette: StatusPalette, theme: any): string => {\n switch (palette) {\n case \"success\":\n return theme.colors.content.success.primary;\n case \"warning\":\n return theme.colors.content.warning.primary;\n case \"alert\":\n return theme.colors.content.alert.primary;\n case \"neutral\":\n return theme.colors.content.neutral.primary;\n default:\n return theme.colors.content.tertiary;\n }\n};\n\n/**\n * Status - An accessible status indicator component\n *\n * Displays a colored dot with optional label to indicate status.\n *\n * ## Accessibility Features\n *\n * - **Semantic Role**: Uses `role=\"status\"` by default (implies `aria-live=\"polite\"`)\n * - **ARIA Label**: Auto-generates for string children; provide explicit `aria-label` for complex children or localization\n * - **Live Region**: `aria-live=\"assertive\"` switches to `role=\"alert\"`, `\"off\"` disables announcements\n *\n */\nexport const Status = forwardRef<HTMLDivElement, StatusProps>(\n (\n {\n children,\n palette = \"default\",\n size = \"md\",\n labelType = \"primary\",\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive,\n testID,\n id,\n },\n ref\n ) => {\n const { theme } = useDesignSystem();\n\n const dotSize = dotSizeMap[size];\n const gapSize = gapSizeMap[size];\n const fontSize = fontSizeMap[size];\n const lineHeight = lineHeightMap[size];\n const dotColor = getDotColor(palette, theme);\n const labelColor =\n labelType === \"dot-color\" ? dotColor : theme.colors.content.primary;\n\n // Generate accessible label from palette and children if not provided\n // For complex children (non-string), require explicit aria-label for full accessibility\n const semanticStatus = paletteSemantics[palette];\n const isStringChildren = typeof children === \"string\";\n const computedAriaLabel =\n ariaLabel ||\n (isStringChildren\n ? `${semanticStatus}: ${children}`\n : children\n ? undefined // Let screen reader read the visible text naturally\n : `Status: ${semanticStatus}`); // Dot-only: provide context\n\n // Determine role based on aria-live to avoid conflicts:\n // - role=\"status\" implies aria-live=\"polite\" (default)\n // - role=\"alert\" implies aria-live=\"assertive\"\n // - aria-live=\"off\" means no live region role\n const role =\n ariaLive === \"off\"\n ? undefined\n : ariaLive === \"assertive\"\n ? \"alert\"\n : \"status\";\n\n return (\n <Box\n ref={ref}\n id={id}\n role={role}\n aria-label={computedAriaLabel}\n testID={testID}\n display=\"inline-flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={gapSize}\n >\n <Box\n width={dotSize}\n height={dotSize}\n borderRadius={50}\n backgroundColor={dotColor}\n aria-hidden={true}\n />\n {children && (\n <Text\n color={labelColor}\n fontSize={fontSize}\n fontWeight=\"400\"\n aria-hidden={computedAriaLabel ? true : undefined}\n style={{\n lineHeight: `${lineHeight}px`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {children}\n </Text>\n )}\n </Box>\n );\n }\n);\n\nStatus.displayName = \"Status\";\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA2B;;;ACC3B,0BAQO;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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