@xsolla/xui-textarea-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.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/TextArea.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 \"./TextArea\";\n","import React, { useState, forwardRef } from \"react\";\n// @ts-ignore - this will be resolved at build time\nimport { Box, Text, TextAreaPrimitive } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, useId } from \"@xsolla/xui-core\";\n\nconst paddingMap: Record<string, number> = {\n xl: 16,\n l: 14,\n m: 12,\n s: 10,\n xs: 10,\n};\n\nexport interface TextAreaProps {\n /** Current value of the textarea */\n value?: string;\n /** Placeholder text when empty */\n placeholder?: string;\n /** Event handler when the text changes */\n onChangeText?: (text: string) => void;\n /** Size of the textarea */\n size?: \"xl\" | \"l\" | \"m\" | \"s\" | \"xs\";\n /** Whether the textarea is disabled */\n disabled?: boolean;\n /** Error message displayed below the textarea */\n errorMessage?: string;\n /** Accessible label for screen readers */\n \"aria-label\"?: string;\n /** ID of element that describes this textarea */\n \"aria-describedby\"?: string;\n /** Unique identifier for the textarea element */\n id?: string;\n /** Test ID for testing frameworks */\n testID?: string;\n}\n\n/**\n * TextArea - An accessible multi-line text input component\n *\n * Renders as a semantic `<textarea>` element with full ARIA support.\n * Supports labels, error states, and various sizes.\n *\n * ## Accessibility Features\n *\n * - **Semantic HTML**: Renders as a native `<textarea>` element\n * - **Keyboard Navigation**: Focusable via Tab\n * - **ARIA States**: Properly announces disabled and error states\n * - **Error Announcements**: Error messages use `role=\"alert\"` for immediate announcement\n * - **Focus Indicator**: Visible focus ring for keyboard navigation\n *\n */\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n value,\n placeholder,\n onChangeText,\n size = \"m\",\n disabled = false,\n errorMessage,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedBy,\n id: externalId,\n testID,\n },\n ref\n ) => {\n const { theme } = useDesignSystem();\n const [isFocused, setIsFocused] = useState(false);\n\n // Generate unique IDs for accessibility linking\n const generatedId = useId();\n const textareaId = externalId || generatedId;\n const errorId = `${textareaId}-error`;\n\n const isError = !!errorMessage;\n\n // Resolve Config from Theme\n // @ts-ignore - theme typing\n const sizeStyles = theme.sizing.textarea(size);\n const inputColors = theme.colors.control.input;\n\n const handleFocus = () => {\n if (!disabled) {\n setIsFocused(true);\n }\n };\n\n const handleBlur = () => {\n if (!disabled) {\n setIsFocused(false);\n }\n };\n\n // Resolve background and border colors based on state\n let backgroundColor = inputColors.bg;\n let borderColor = inputColors.border;\n\n if (disabled) {\n backgroundColor = inputColors.bgDisable;\n borderColor = inputColors.borderDisable;\n } else if (isError) {\n borderColor = theme.colors.border.alert;\n } else if (isFocused) {\n backgroundColor = theme.colors.control.focus.bg;\n borderColor = inputColors.borderHover;\n }\n\n const textColor = disabled ? inputColors.textDisable : inputColors.text;\n const placeholderColor = inputColors.placeholder;\n\n // Build aria-describedby from error and external describedby\n const describedByIds: string[] = [];\n if (isError) {\n describedByIds.push(errorId);\n }\n if (ariaDescribedBy) {\n describedByIds.push(ariaDescribedBy);\n }\n const computedDescribedBy =\n describedByIds.length > 0 ? describedByIds.join(\" \") : undefined;\n\n // Focus outline color\n const outlineColor =\n isFocused && !disabled ? theme.colors.border.brand : undefined;\n\n return (\n <Box flexDirection=\"column\" gap={8} width=\"100%\">\n <Box\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n borderWidth={borderColor !== \"transparent\" ? 1 : 0}\n borderRadius={theme.radius.button}\n height={sizeStyles.height}\n padding={paddingMap[size]}\n flexDirection=\"row\"\n alignItems=\"flex-start\"\n gap={12}\n position=\"relative\"\n cursor={disabled ? \"not-allowed\" : \"text\"}\n style={{\n ...(outlineColor\n ? {\n outline: `2px solid ${outlineColor}`,\n outlineOffset: \"-2px\",\n }\n : {}),\n }}\n hoverStyle={\n !disabled && !isFocused && !isError\n ? {\n backgroundColor: inputColors.bgHover,\n }\n : undefined\n }\n >\n <Box flex={1} height=\"100%\">\n <TextAreaPrimitive\n ref={ref}\n id={textareaId}\n value={value}\n placeholder={placeholder}\n onChangeText={onChangeText}\n onFocus={handleFocus}\n onBlur={handleBlur}\n disabled={disabled}\n color={textColor}\n fontSize={sizeStyles.fontSize}\n placeholderTextColor={placeholderColor}\n aria-label={ariaLabel}\n aria-invalid={isError || undefined}\n aria-disabled={disabled || undefined}\n aria-describedby={computedDescribedBy}\n data-testid={testID}\n />\n </Box>\n </Box>\n\n {isError && (\n <Text\n id={errorId}\n role=\"alert\"\n color={theme.colors.content.alert.primary}\n fontSize={sizeStyles.fontSize - 2}\n >\n {errorMessage}\n </Text>\n )}\n </Box>\n );\n }\n);\n\nTextArea.displayName = \"TextArea\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n alignItems,\n justifyContent,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": _ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": _ariaDisabled,\n \"aria-live\": _ariaLive,\n className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport { Text as RNText, TextStyle, AccessibilityRole } from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web roles to React Native accessibility roles\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n id,\n role,\n ...props\n}) => {\n // Extract the first font name from a comma-separated list (e.g. for web-style font stacks)\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n // On native, if we don't have the custom font loaded, it's better to use the system font\n // to avoid rendering issues or missing text.\n if (resolvedFontFamily === \"Pilat Wide Bold\") {\n resolvedFontFamily = undefined;\n }\n\n const style: TextStyle = {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n };\n\n // Map role to React Native accessibilityRole\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText style={style} testID={id} accessibilityRole={accessibilityRole}>\n {children}\n </RNText>\n );\n};\n","import type React from \"react\";\nimport { ActivityIndicator, View } from \"react-native\";\nimport type { SpinnerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Spinner: React.FC<SpinnerProps> = ({\n color,\n size,\n role,\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive,\n \"aria-describedby\": ariaDescribedBy,\n testID,\n}) => {\n return (\n <View\n accessible={true}\n accessibilityRole={role === \"status\" ? \"none\" : undefined}\n accessibilityLabel={ariaLabel}\n accessibilityLiveRegion={\n ariaLive === \"polite\"\n ? \"polite\"\n : ariaLive === \"assertive\"\n ? \"assertive\"\n : \"none\"\n }\n testID={testID}\n >\n <ActivityIndicator\n color={color}\n size={typeof size === \"number\" ? size : \"small\"}\n />\n </View>\n );\n};\n\nSpinner.displayName = \"Spinner\";\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({ children, color, size }) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n // @ts-ignore - passing color down to potential Text/Icon children\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return <View style={style}>{childrenWithProps}</View>;\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { DividerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Divider: React.FC<DividerProps> = ({\n color,\n height,\n width,\n vertical,\n dashStroke,\n}) => {\n const style: ViewStyle = {\n backgroundColor: dashStroke\n ? \"transparent\"\n : color || \"rgba(255, 255, 255, 0.15)\",\n width: vertical ? (typeof width === \"number\" ? width : 1) : \"100%\",\n height: vertical ? \"100%\" : typeof height === \"number\" ? height : 1,\n ...(dashStroke && {\n borderStyle: \"dashed\",\n borderColor: color || \"rgba(255, 255, 255, 0.15)\",\n borderWidth: 0,\n ...(vertical\n ? { borderLeftWidth: typeof width === \"number\" ? width : 1 }\n : { borderTopWidth: typeof height === \"number\" ? height : 1 }),\n }),\n };\n\n return <View style={style} />;\n};\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web input types to React Native keyboard types\nconst keyboardTypeMap: Record<string, any> = {\n text: \"default\",\n number: \"numeric\",\n email: \"email-address\",\n tel: \"phone-pad\",\n url: \"url\",\n decimal: \"decimal-pad\",\n};\n\n// Map web inputMode to React Native keyboard types\nconst inputModeToKeyboardType: Record<string, any> = {\n none: \"default\",\n text: \"default\",\n decimal: \"decimal-pad\",\n numeric: \"number-pad\",\n tel: \"phone-pad\",\n search: \"default\",\n email: \"email-address\",\n url: \"url\",\n};\n\n// Map web autoComplete to React Native textContentType (iOS)\nconst autoCompleteToTextContentType: Record<string, any> = {\n \"one-time-code\": \"oneTimeCode\",\n email: \"emailAddress\",\n username: \"username\",\n password: \"password\",\n \"new-password\": \"newPassword\",\n tel: \"telephoneNumber\",\n \"postal-code\": \"postalCode\",\n name: \"name\",\n};\n\nexport const InputPrimitive = forwardRef<RNTextInput, InputPrimitiveProps>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n secureTextEntry,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n name,\n type,\n inputMode,\n autoComplete,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n // Create a synthetic event for onChange compatibility\n // Include nativeEvent and no-op methods to prevent runtime errors\n // when consumers expect DOM-like event behavior\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLInputElement>;\n onChange(syntheticEvent);\n }\n };\n\n // Determine keyboard type - inputMode takes precedence over type\n const keyboardType = inputMode\n ? inputModeToKeyboardType[inputMode] || \"default\"\n : type\n ? keyboardTypeMap[type] || \"default\"\n : \"default\";\n\n // Determine textContentType for iOS autofill\n const textContentType = autoComplete\n ? autoCompleteToTextContentType[autoComplete]\n : undefined;\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n // Map onKeyPress to onKeyDown for cross-platform compatibility\n // Include preventDefault to avoid runtime errors when consumers call it\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n secureTextEntry={secureTextEntry || type === \"password\"}\n keyboardType={keyboardType}\n textContentType={textContentType}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n // React Native accessibility props\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { TextAreaPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nexport const TextAreaPrimitive = forwardRef<\n RNTextInput,\n TextAreaPrimitiveProps\n>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n rows,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLTextAreaElement>;\n onChange(syntheticEvent);\n }\n };\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n multiline={true}\n numberOfLines={rows || 4}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlignVertical: \"top\",\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nTextAreaPrimitive.displayName = \"TextAreaPrimitive\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA4C;;;ACC5C,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,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,GAAI;AAAA,EACN;AAEA,QAAM,cAAc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C,WAAW,MAAM,OAAO,OAAO,QAAQ;AAEvD,WACE,8CAAC,OAAI,eAAc,UAAS,KAAK,GAAG,OAAM,QACxC;AAAA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,aAAa,gBAAgB,gBAAgB,IAAI;AAAA,UACjD,cAAc,MAAM,OAAO;AAAA,UAC3B,QAAQ,WAAW;AAAA,UACnB,SAAS,WAAW,IAAI;AAAA,UACxB,eAAc;AAAA,UACd,YAAW;AAAA,UACX,KAAK;AAAA,UACL,UAAS;AAAA,UACT,QAAQ,WAAW,gBAAgB;AAAA,UACnC,OAAO;AAAA,YACL,GAAI,eACA;AAAA,cACE,SAAS,aAAa,YAAY;AAAA,cAClC,eAAe;AAAA,YACjB,IACA,CAAC;AAAA,UACP;AAAA,UACA,YACE,CAAC,YAAY,CAAC,aAAa,CAAC,UACxB;AAAA,YACE,iBAAiB,YAAY;AAAA,UAC/B,IACA;AAAA,UAGN,uDAAC,OAAI,MAAM,GAAG,QAAO,QACnB;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,IAAI;AAAA,cACJ;AAAA,cACA;AAAA,cACA;AAAA,cACA,SAAS;AAAA,cACT,QAAQ;AAAA,cACR;AAAA,cACA,OAAO;AAAA,cACP,UAAU,WAAW;AAAA,cACrB,sBAAsB;AAAA,cACtB,cAAY;AAAA,cACZ,gBAAc,WAAW;AAAA,cACzB,iBAAe,YAAY;AAAA,cAC3B,oBAAkB;AAAA,cAClB,eAAa;AAAA;AAAA,UACf,GACF;AAAA;AAAA,MACF;AAAA,MAEC,WACC;AAAA,QAAC;AAAA;AAAA,UACC,IAAI;AAAA,UACJ,MAAK;AAAA,UACL,OAAO,MAAM,OAAO,QAAQ,MAAM;AAAA,UAClC,UAAU,WAAW,WAAW;AAAA,UAE/B;AAAA;AAAA,MACH;AAAA,OAEJ;AAAA,EAEJ;AACF;AAEA,SAAS,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"]}
package/index.mjs ADDED
@@ -0,0 +1,595 @@
1
+ // src/TextArea.tsx
2
+ import { useState, forwardRef as forwardRef3 } from "react";
3
+
4
+ // ../primitives-native/src/Box.tsx
5
+ import {
6
+ View,
7
+ Pressable,
8
+ Image
9
+ } from "react-native";
10
+ import { jsx } from "react/jsx-runtime";
11
+ var Box = ({
12
+ children,
13
+ onPress,
14
+ onLayout,
15
+ onMoveShouldSetResponder,
16
+ onResponderGrant,
17
+ onResponderMove,
18
+ onResponderRelease,
19
+ onResponderTerminate,
20
+ backgroundColor,
21
+ borderColor,
22
+ borderWidth,
23
+ borderBottomWidth,
24
+ borderBottomColor,
25
+ borderTopWidth,
26
+ borderTopColor,
27
+ borderLeftWidth,
28
+ borderLeftColor,
29
+ borderRightWidth,
30
+ borderRightColor,
31
+ borderRadius,
32
+ borderStyle,
33
+ height,
34
+ padding,
35
+ paddingHorizontal,
36
+ paddingVertical,
37
+ margin,
38
+ marginTop,
39
+ marginBottom,
40
+ marginLeft,
41
+ marginRight,
42
+ flexDirection,
43
+ alignItems,
44
+ justifyContent,
45
+ position,
46
+ top,
47
+ bottom,
48
+ left,
49
+ right,
50
+ width,
51
+ flex,
52
+ overflow,
53
+ zIndex,
54
+ hoverStyle,
55
+ pressStyle,
56
+ style,
57
+ "data-testid": dataTestId,
58
+ testID,
59
+ as,
60
+ src,
61
+ alt,
62
+ ...rest
63
+ }) => {
64
+ const getContainerStyle = (pressed) => ({
65
+ backgroundColor: pressed && pressStyle?.backgroundColor ? pressStyle.backgroundColor : backgroundColor,
66
+ borderColor,
67
+ borderWidth,
68
+ borderBottomWidth,
69
+ borderBottomColor,
70
+ borderTopWidth,
71
+ borderTopColor,
72
+ borderLeftWidth,
73
+ borderLeftColor,
74
+ borderRightWidth,
75
+ borderRightColor,
76
+ borderRadius,
77
+ borderStyle,
78
+ overflow,
79
+ zIndex,
80
+ height,
81
+ width,
82
+ padding,
83
+ paddingHorizontal,
84
+ paddingVertical,
85
+ margin,
86
+ marginTop,
87
+ marginBottom,
88
+ marginLeft,
89
+ marginRight,
90
+ flexDirection,
91
+ alignItems,
92
+ justifyContent,
93
+ position,
94
+ top,
95
+ bottom,
96
+ left,
97
+ right,
98
+ flex,
99
+ ...style
100
+ });
101
+ const finalTestID = dataTestId || testID;
102
+ const {
103
+ role,
104
+ tabIndex,
105
+ onKeyDown,
106
+ onKeyUp,
107
+ "aria-label": _ariaLabel,
108
+ "aria-labelledby": _ariaLabelledBy,
109
+ "aria-current": _ariaCurrent,
110
+ "aria-disabled": _ariaDisabled,
111
+ "aria-live": _ariaLive,
112
+ className,
113
+ "data-testid": _dataTestId,
114
+ ...nativeRest
115
+ } = rest;
116
+ if (as === "img" && src) {
117
+ const imageStyle = {
118
+ width,
119
+ height,
120
+ borderRadius,
121
+ position,
122
+ top,
123
+ bottom,
124
+ left,
125
+ right,
126
+ ...style
127
+ };
128
+ return /* @__PURE__ */ jsx(
129
+ Image,
130
+ {
131
+ source: { uri: src },
132
+ style: imageStyle,
133
+ testID: finalTestID,
134
+ resizeMode: "cover",
135
+ ...nativeRest
136
+ }
137
+ );
138
+ }
139
+ if (onPress) {
140
+ return /* @__PURE__ */ jsx(
141
+ Pressable,
142
+ {
143
+ onPress,
144
+ onLayout,
145
+ onMoveShouldSetResponder,
146
+ onResponderGrant,
147
+ onResponderMove,
148
+ onResponderRelease,
149
+ onResponderTerminate,
150
+ style: ({ pressed }) => getContainerStyle(pressed),
151
+ testID: finalTestID,
152
+ ...nativeRest,
153
+ children
154
+ }
155
+ );
156
+ }
157
+ return /* @__PURE__ */ jsx(
158
+ View,
159
+ {
160
+ style: getContainerStyle(),
161
+ testID: finalTestID,
162
+ onLayout,
163
+ onMoveShouldSetResponder,
164
+ onResponderGrant,
165
+ onResponderMove,
166
+ onResponderRelease,
167
+ onResponderTerminate,
168
+ ...nativeRest,
169
+ children
170
+ }
171
+ );
172
+ };
173
+
174
+ // ../primitives-native/src/Text.tsx
175
+ import { Text as RNText } from "react-native";
176
+ import { jsx as jsx2 } from "react/jsx-runtime";
177
+ var roleMap = {
178
+ alert: "alert",
179
+ heading: "header",
180
+ button: "button",
181
+ link: "link",
182
+ text: "text"
183
+ };
184
+ var Text = ({
185
+ children,
186
+ color,
187
+ fontSize,
188
+ fontWeight,
189
+ fontFamily,
190
+ id,
191
+ role,
192
+ ...props
193
+ }) => {
194
+ let resolvedFontFamily = fontFamily ? fontFamily.split(",")[0].replace(/['"]/g, "").trim() : void 0;
195
+ if (resolvedFontFamily === "Pilat Wide Bold") {
196
+ resolvedFontFamily = void 0;
197
+ }
198
+ const style = {
199
+ color,
200
+ fontSize: typeof fontSize === "number" ? fontSize : void 0,
201
+ fontWeight,
202
+ fontFamily: resolvedFontFamily,
203
+ textDecorationLine: props.textDecoration
204
+ };
205
+ const accessibilityRole = role ? roleMap[role] : void 0;
206
+ return /* @__PURE__ */ jsx2(RNText, { style, testID: id, accessibilityRole, children });
207
+ };
208
+
209
+ // ../primitives-native/src/Spinner.tsx
210
+ import { ActivityIndicator, View as View2 } from "react-native";
211
+ import { jsx as jsx3 } from "react/jsx-runtime";
212
+ var Spinner = ({
213
+ color,
214
+ size,
215
+ role,
216
+ "aria-label": ariaLabel,
217
+ "aria-live": ariaLive,
218
+ "aria-describedby": ariaDescribedBy,
219
+ testID
220
+ }) => {
221
+ return /* @__PURE__ */ jsx3(
222
+ View2,
223
+ {
224
+ accessible: true,
225
+ accessibilityRole: role === "status" ? "none" : void 0,
226
+ accessibilityLabel: ariaLabel,
227
+ accessibilityLiveRegion: ariaLive === "polite" ? "polite" : ariaLive === "assertive" ? "assertive" : "none",
228
+ testID,
229
+ children: /* @__PURE__ */ jsx3(
230
+ ActivityIndicator,
231
+ {
232
+ color,
233
+ size: typeof size === "number" ? size : "small"
234
+ }
235
+ )
236
+ }
237
+ );
238
+ };
239
+ Spinner.displayName = "Spinner";
240
+
241
+ // ../primitives-native/src/Icon.tsx
242
+ import React from "react";
243
+ import { View as View3 } from "react-native";
244
+ import { jsx as jsx4 } from "react/jsx-runtime";
245
+
246
+ // ../primitives-native/src/Divider.tsx
247
+ import { View as View4 } from "react-native";
248
+ import { jsx as jsx5 } from "react/jsx-runtime";
249
+
250
+ // ../primitives-native/src/Input.tsx
251
+ import { forwardRef } from "react";
252
+ import { TextInput as RNTextInput } from "react-native";
253
+ import { jsx as jsx6 } from "react/jsx-runtime";
254
+ var keyboardTypeMap = {
255
+ text: "default",
256
+ number: "numeric",
257
+ email: "email-address",
258
+ tel: "phone-pad",
259
+ url: "url",
260
+ decimal: "decimal-pad"
261
+ };
262
+ var inputModeToKeyboardType = {
263
+ none: "default",
264
+ text: "default",
265
+ decimal: "decimal-pad",
266
+ numeric: "number-pad",
267
+ tel: "phone-pad",
268
+ search: "default",
269
+ email: "email-address",
270
+ url: "url"
271
+ };
272
+ var autoCompleteToTextContentType = {
273
+ "one-time-code": "oneTimeCode",
274
+ email: "emailAddress",
275
+ username: "username",
276
+ password: "password",
277
+ "new-password": "newPassword",
278
+ tel: "telephoneNumber",
279
+ "postal-code": "postalCode",
280
+ name: "name"
281
+ };
282
+ var InputPrimitive = forwardRef(
283
+ ({
284
+ value,
285
+ placeholder,
286
+ onChange,
287
+ onChangeText,
288
+ onFocus,
289
+ onBlur,
290
+ onKeyDown,
291
+ disabled,
292
+ secureTextEntry,
293
+ style,
294
+ color,
295
+ fontSize,
296
+ placeholderTextColor,
297
+ maxLength,
298
+ name,
299
+ type,
300
+ inputMode,
301
+ autoComplete,
302
+ id,
303
+ "aria-invalid": ariaInvalid,
304
+ "aria-describedby": ariaDescribedBy,
305
+ "aria-labelledby": ariaLabelledBy,
306
+ "aria-label": ariaLabel,
307
+ "aria-disabled": ariaDisabled,
308
+ "data-testid": dataTestId
309
+ }, ref) => {
310
+ const handleChangeText = (text) => {
311
+ onChangeText?.(text);
312
+ if (onChange) {
313
+ const syntheticEvent = {
314
+ target: { value: text },
315
+ currentTarget: { value: text },
316
+ type: "change",
317
+ nativeEvent: { text },
318
+ preventDefault: () => {
319
+ },
320
+ stopPropagation: () => {
321
+ },
322
+ isTrusted: false
323
+ };
324
+ onChange(syntheticEvent);
325
+ }
326
+ };
327
+ const keyboardType = inputMode ? inputModeToKeyboardType[inputMode] || "default" : type ? keyboardTypeMap[type] || "default" : "default";
328
+ const textContentType = autoComplete ? autoCompleteToTextContentType[autoComplete] : void 0;
329
+ return /* @__PURE__ */ jsx6(
330
+ RNTextInput,
331
+ {
332
+ ref,
333
+ value,
334
+ placeholder,
335
+ onChangeText: handleChangeText,
336
+ onFocus,
337
+ onBlur,
338
+ onKeyPress: (e) => {
339
+ if (onKeyDown) {
340
+ onKeyDown({
341
+ key: e.nativeEvent.key,
342
+ preventDefault: () => {
343
+ }
344
+ });
345
+ }
346
+ },
347
+ editable: !disabled,
348
+ secureTextEntry: secureTextEntry || type === "password",
349
+ keyboardType,
350
+ textContentType,
351
+ style: [
352
+ {
353
+ color,
354
+ fontSize: typeof fontSize === "number" ? fontSize : void 0,
355
+ flex: 1,
356
+ padding: 0,
357
+ textAlign: style?.textAlign || "left"
358
+ },
359
+ style
360
+ ],
361
+ placeholderTextColor,
362
+ maxLength,
363
+ testID: dataTestId || id,
364
+ accessibilityLabel: ariaLabel,
365
+ accessibilityHint: ariaDescribedBy,
366
+ accessibilityState: {
367
+ disabled: disabled || ariaDisabled
368
+ },
369
+ accessible: true
370
+ }
371
+ );
372
+ }
373
+ );
374
+ InputPrimitive.displayName = "InputPrimitive";
375
+
376
+ // ../primitives-native/src/TextArea.tsx
377
+ import { forwardRef as forwardRef2 } from "react";
378
+ import { TextInput as RNTextInput2 } from "react-native";
379
+ import { jsx as jsx7 } from "react/jsx-runtime";
380
+ var TextAreaPrimitive = forwardRef2(
381
+ ({
382
+ value,
383
+ placeholder,
384
+ onChange,
385
+ onChangeText,
386
+ onFocus,
387
+ onBlur,
388
+ onKeyDown,
389
+ disabled,
390
+ style,
391
+ color,
392
+ fontSize,
393
+ placeholderTextColor,
394
+ maxLength,
395
+ rows,
396
+ id,
397
+ "aria-invalid": ariaInvalid,
398
+ "aria-describedby": ariaDescribedBy,
399
+ "aria-labelledby": ariaLabelledBy,
400
+ "aria-label": ariaLabel,
401
+ "aria-disabled": ariaDisabled,
402
+ "data-testid": dataTestId
403
+ }, ref) => {
404
+ const handleChangeText = (text) => {
405
+ onChangeText?.(text);
406
+ if (onChange) {
407
+ const syntheticEvent = {
408
+ target: { value: text },
409
+ currentTarget: { value: text },
410
+ type: "change",
411
+ nativeEvent: { text },
412
+ preventDefault: () => {
413
+ },
414
+ stopPropagation: () => {
415
+ },
416
+ isTrusted: false
417
+ };
418
+ onChange(syntheticEvent);
419
+ }
420
+ };
421
+ return /* @__PURE__ */ jsx7(
422
+ RNTextInput2,
423
+ {
424
+ ref,
425
+ value,
426
+ placeholder,
427
+ onChangeText: handleChangeText,
428
+ onFocus,
429
+ onBlur,
430
+ onKeyPress: (e) => {
431
+ if (onKeyDown) {
432
+ onKeyDown({
433
+ key: e.nativeEvent.key,
434
+ preventDefault: () => {
435
+ }
436
+ });
437
+ }
438
+ },
439
+ editable: !disabled,
440
+ multiline: true,
441
+ numberOfLines: rows || 4,
442
+ style: [
443
+ {
444
+ color,
445
+ fontSize: typeof fontSize === "number" ? fontSize : void 0,
446
+ flex: 1,
447
+ padding: 0,
448
+ textAlignVertical: "top",
449
+ textAlign: style?.textAlign || "left"
450
+ },
451
+ style
452
+ ],
453
+ placeholderTextColor,
454
+ maxLength,
455
+ testID: dataTestId || id,
456
+ accessibilityLabel: ariaLabel,
457
+ accessibilityHint: ariaDescribedBy,
458
+ accessibilityState: {
459
+ disabled: disabled || ariaDisabled
460
+ },
461
+ accessible: true
462
+ }
463
+ );
464
+ }
465
+ );
466
+ TextAreaPrimitive.displayName = "TextAreaPrimitive";
467
+
468
+ // src/TextArea.tsx
469
+ import { useDesignSystem, useId } from "@xsolla/xui-core";
470
+ import { jsx as jsx8, jsxs } from "react/jsx-runtime";
471
+ var paddingMap = {
472
+ xl: 16,
473
+ l: 14,
474
+ m: 12,
475
+ s: 10,
476
+ xs: 10
477
+ };
478
+ var TextArea = forwardRef3(
479
+ ({
480
+ value,
481
+ placeholder,
482
+ onChangeText,
483
+ size = "m",
484
+ disabled = false,
485
+ errorMessage,
486
+ "aria-label": ariaLabel,
487
+ "aria-describedby": ariaDescribedBy,
488
+ id: externalId,
489
+ testID
490
+ }, ref) => {
491
+ const { theme } = useDesignSystem();
492
+ const [isFocused, setIsFocused] = useState(false);
493
+ const generatedId = useId();
494
+ const textareaId = externalId || generatedId;
495
+ const errorId = `${textareaId}-error`;
496
+ const isError = !!errorMessage;
497
+ const sizeStyles = theme.sizing.textarea(size);
498
+ const inputColors = theme.colors.control.input;
499
+ const handleFocus = () => {
500
+ if (!disabled) {
501
+ setIsFocused(true);
502
+ }
503
+ };
504
+ const handleBlur = () => {
505
+ if (!disabled) {
506
+ setIsFocused(false);
507
+ }
508
+ };
509
+ let backgroundColor = inputColors.bg;
510
+ let borderColor = inputColors.border;
511
+ if (disabled) {
512
+ backgroundColor = inputColors.bgDisable;
513
+ borderColor = inputColors.borderDisable;
514
+ } else if (isError) {
515
+ borderColor = theme.colors.border.alert;
516
+ } else if (isFocused) {
517
+ backgroundColor = theme.colors.control.focus.bg;
518
+ borderColor = inputColors.borderHover;
519
+ }
520
+ const textColor = disabled ? inputColors.textDisable : inputColors.text;
521
+ const placeholderColor = inputColors.placeholder;
522
+ const describedByIds = [];
523
+ if (isError) {
524
+ describedByIds.push(errorId);
525
+ }
526
+ if (ariaDescribedBy) {
527
+ describedByIds.push(ariaDescribedBy);
528
+ }
529
+ const computedDescribedBy = describedByIds.length > 0 ? describedByIds.join(" ") : void 0;
530
+ const outlineColor = isFocused && !disabled ? theme.colors.border.brand : void 0;
531
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: 8, width: "100%", children: [
532
+ /* @__PURE__ */ jsx8(
533
+ Box,
534
+ {
535
+ backgroundColor,
536
+ borderColor,
537
+ borderWidth: borderColor !== "transparent" ? 1 : 0,
538
+ borderRadius: theme.radius.button,
539
+ height: sizeStyles.height,
540
+ padding: paddingMap[size],
541
+ flexDirection: "row",
542
+ alignItems: "flex-start",
543
+ gap: 12,
544
+ position: "relative",
545
+ cursor: disabled ? "not-allowed" : "text",
546
+ style: {
547
+ ...outlineColor ? {
548
+ outline: `2px solid ${outlineColor}`,
549
+ outlineOffset: "-2px"
550
+ } : {}
551
+ },
552
+ hoverStyle: !disabled && !isFocused && !isError ? {
553
+ backgroundColor: inputColors.bgHover
554
+ } : void 0,
555
+ children: /* @__PURE__ */ jsx8(Box, { flex: 1, height: "100%", children: /* @__PURE__ */ jsx8(
556
+ TextAreaPrimitive,
557
+ {
558
+ ref,
559
+ id: textareaId,
560
+ value,
561
+ placeholder,
562
+ onChangeText,
563
+ onFocus: handleFocus,
564
+ onBlur: handleBlur,
565
+ disabled,
566
+ color: textColor,
567
+ fontSize: sizeStyles.fontSize,
568
+ placeholderTextColor: placeholderColor,
569
+ "aria-label": ariaLabel,
570
+ "aria-invalid": isError || void 0,
571
+ "aria-disabled": disabled || void 0,
572
+ "aria-describedby": computedDescribedBy,
573
+ "data-testid": testID
574
+ }
575
+ ) })
576
+ }
577
+ ),
578
+ isError && /* @__PURE__ */ jsx8(
579
+ Text,
580
+ {
581
+ id: errorId,
582
+ role: "alert",
583
+ color: theme.colors.content.alert.primary,
584
+ fontSize: sizeStyles.fontSize - 2,
585
+ children: errorMessage
586
+ }
587
+ )
588
+ ] });
589
+ }
590
+ );
591
+ TextArea.displayName = "TextArea";
592
+ export {
593
+ TextArea
594
+ };
595
+ //# sourceMappingURL=index.mjs.map