@xsolla/xui-input-pin 0.114.0 → 0.115.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 +1 -1
- package/native/index.js.map +1 -1
- package/native/index.mjs +1 -1
- package/native/index.mjs.map +1 -1
- package/package.json +4 -4
- package/web/index.js +11 -1
- package/web/index.js.map +1 -1
- package/web/index.mjs +11 -1
- package/web/index.mjs.map +1 -1
package/native/index.js
CHANGED
package/native/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/InputPin.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Input.tsx"],"sourcesContent":["export * from \"./InputPin\";\n","import React, { useState, useRef, useEffect, useCallback } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, InputPrimitive } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, useId } from \"@xsolla/xui-core\";\n\nexport interface OnInputPinCompleteProps {\n isComplete: boolean;\n value: string;\n}\n\nexport interface InputPinProps {\n /** Current value of the input pin */\n value?: string;\n /** Function that will be called when the input value changes */\n onChange?: (props: OnInputPinCompleteProps) => void;\n /** Function that will be called when the input is completed */\n onComplete?: (props: OnInputPinCompleteProps) => void;\n /** The length of the code to be input. Default is 4 */\n codeLength?: number;\n /** @deprecated Use codeLength instead */\n length?: number;\n /** Property for changing the size of the input */\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n /** @deprecated Use disabled and error props instead */\n state?: \"default\" | \"hover\" | \"disable\" | \"error\";\n /** Property for disabling the control */\n disabled?: boolean;\n /** Property for displaying an error state */\n error?: boolean;\n /** Property for displaying a label above the input */\n label?: string;\n /** Property for displaying an error message */\n errorMessage?: string;\n /** @deprecated Use errorMessage instead */\n errorLabel?: string;\n /** Whether to hide the text (like a password field) */\n secureTextEntry?: boolean;\n /** Show dot placeholders in empty inputs */\n showPlaceholderDots?: boolean;\n /** Expands input cells to fill the width of the container */\n flexibleWidth?: boolean;\n /** Boolean value indicating if the input is filled or not */\n isComplete?: boolean;\n /** The current focused input index */\n currentFocus?: number;\n /** Function to add a ref to an input element */\n addRef?: (index: number) => (element: HTMLInputElement | null) => void;\n /** Test identifier for the component */\n testID?: string;\n /** Accessible label for screen readers (use when no visible label) */\n \"aria-label\"?: string;\n}\n\nexport const InputPin: React.FC<InputPinProps> = ({\n value = \"\",\n onChange,\n onComplete,\n codeLength,\n length = 4,\n size = \"md\",\n state: externalState,\n disabled: disabledProp,\n error: errorProp,\n label,\n errorMessage,\n errorLabel,\n secureTextEntry = false,\n showPlaceholderDots = true,\n flexibleWidth = false,\n isComplete: isCompleteProp,\n currentFocus,\n addRef,\n testID,\n \"aria-label\": ariaLabel,\n}) => {\n const { theme } = useDesignSystem();\n const uniqueId = useId();\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const [internalValue, setInternalValue] = useState(value);\n\n // Support both codeLength (new) and length (deprecated)\n const actualLength = codeLength ?? length;\n\n // Support both errorMessage (new) and errorLabel (deprecated)\n const errorText = errorMessage ?? errorLabel;\n\n // Support both new props and deprecated state prop\n // Error state is true if error prop is set, or errorMessage is provided, or state is \"error\"\n const isError = errorProp ?? (!!errorText || externalState === \"error\");\n const isDisabled = disabledProp ?? externalState === \"disable\";\n const isHover = externalState === \"hover\";\n const sizeStyles = theme.sizing.inputPin(size);\n const inputColors = theme.colors.control.input;\n\n const inputs = useRef<(HTMLInputElement | null)[]>([]);\n\n // Sync internal value with external value\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n // Handle currentFocus prop\n useEffect(() => {\n if (\n currentFocus !== undefined &&\n currentFocus >= 0 &&\n currentFocus < actualLength\n ) {\n inputs.current[currentFocus]?.focus();\n }\n }, [currentFocus, actualLength]);\n\n // Calculate isComplete status\n const checkIsComplete = useCallback(\n (val: string) => val.length >= actualLength,\n [actualLength]\n );\n\n // IDs for accessibility\n const labelId = `${uniqueId}-label`;\n const errorId = `${uniqueId}-error`;\n\n const handleTextChange = (text: string, index: number) => {\n // Filter to only alphanumeric characters\n const sanitizedText = text.replace(/[^0-9a-zA-Z]/g, \"\");\n\n // Handle multi-character input (paste on React Native)\n if (sanitizedText.length > 1) {\n const pastedData = sanitizedText.slice(0, actualLength - index);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n // Fill in characters starting from current index\n for (let i = 0; i < pastedData.length && index + i < actualLength; i++) {\n newValue[index + i] = pastedData[i];\n }\n\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the next empty input or the last input\n const nextIndex = Math.min(index + pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n return;\n }\n\n // Handle single character input\n const char = sanitizedText.slice(-1);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n newValue[index] = char;\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n if (char && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handleKeyDown = (\n e: React.KeyboardEvent<HTMLInputElement>,\n index: number\n ) => {\n if (e.key === \"Backspace\") {\n if (!internalValue[index] && index > 0) {\n inputs.current[index - 1]?.focus();\n }\n } else if (e.key === \"ArrowLeft\" && index > 0) {\n inputs.current[index - 1]?.focus();\n } else if (e.key === \"ArrowRight\" && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pastedData = e.clipboardData\n .getData(\"text\")\n .replace(/[^0-9a-zA-Z]/g, \"\")\n .slice(0, actualLength);\n setInternalValue(pastedData);\n\n const complete = checkIsComplete(pastedData);\n const changeProps = { isComplete: complete, value: pastedData };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the last filled input or the first empty one\n const nextIndex = Math.min(pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n };\n\n // Handler for storing refs that can be provided to addRef prop\n const handleRef = (index: number) => (element: HTMLInputElement | null) => {\n inputs.current[index] = element;\n addRef?.(index)(element);\n };\n\n const pinItems = Array.from({ length: actualLength }).map((_, index) => {\n const char = internalValue[index] || \"\";\n const isFocused = focusedIndex === index;\n\n let backgroundColor = inputColors.bg;\n let borderColor = inputColors.border;\n\n if (isDisabled) {\n backgroundColor = inputColors.bgDisable;\n borderColor = inputColors.borderDisable;\n } else if (isError) {\n borderColor = theme.colors.border.alert;\n backgroundColor = isFocused\n ? theme.colors.control.focus.bg\n : inputColors.bg;\n } else if (isFocused) {\n backgroundColor = theme.colors.control.focus.bg;\n borderColor = theme.colors.content.brand.secondary;\n } else if (isHover) {\n backgroundColor = inputColors.bgHover;\n borderColor = inputColors.borderHover;\n } else {\n backgroundColor = inputColors.bg;\n borderColor = inputColors.border;\n }\n\n const textColor = isDisabled ? inputColors.textDisable : inputColors.text;\n\n return (\n <Box\n key={index}\n width={flexibleWidth ? undefined : sizeStyles.size}\n height={sizeStyles.size}\n flex={flexibleWidth ? 1 : undefined}\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n borderWidth={sizeStyles.borderWidth}\n borderRadius={sizeStyles.radius}\n alignItems=\"center\"\n justifyContent=\"center\"\n hoverStyle={\n !isDisabled && !isFocused && !isError\n ? {\n backgroundColor: inputColors.bgHover,\n borderColor: inputColors.borderHover,\n }\n : undefined\n }\n >\n <InputPrimitive\n ref={\n addRef\n ? handleRef(index)\n : (el: any) => (inputs.current[index] = el)\n }\n value={char}\n placeholder={showPlaceholderDots && !isFocused ? \"•\" : undefined}\n onChangeText={(text: string) => handleTextChange(text, index)}\n onFocus={() => setFocusedIndex(index)}\n onBlur={() => setFocusedIndex(null)}\n onKeyDown={(e: any) => handleKeyDown(e, index)}\n disabled={isDisabled}\n secureTextEntry={secureTextEntry}\n color={textColor}\n placeholderTextColor={inputColors.placeholder}\n fontSize={sizeStyles.fontSize}\n style={{ textAlign: \"center\" }}\n maxLength={1}\n inputMode=\"numeric\"\n autoComplete=\"one-time-code\"\n aria-label={\n ariaLabel\n ? `${ariaLabel} digit ${index + 1}`\n : `PIN digit ${index + 1}`\n }\n aria-invalid={isError}\n aria-describedby={isError && errorText ? errorId : undefined}\n data-testid={\n testID ? `${testID}-input-${index}` : `input-pin-input-${index}`\n }\n />\n </Box>\n );\n });\n\n return (\n <Box\n flexDirection=\"column\"\n gap={8}\n data-testid={testID || \"input-pin\"}\n role=\"group\"\n aria-labelledby={label ? labelId : undefined}\n aria-label={!label && ariaLabel ? ariaLabel : undefined}\n >\n {label && (\n <Text\n id={labelId}\n color={theme.colors.content.secondary}\n fontSize={sizeStyles.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n )}\n <Box\n flexDirection=\"row\"\n gap={sizeStyles.gap}\n onPaste={handlePaste}\n width={flexibleWidth ? \"100%\" : undefined}\n >\n {pinItems}\n </Box>\n {isError && errorText && (\n <Text\n id={errorId}\n role=\"alert\"\n color={theme.colors.content.alert.primary}\n fontSize={sizeStyles.fontSize - 2}\n >\n {errorText}\n </Text>\n )}\n </Box>\n );\n};\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 {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: 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 textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAgE;;;ACChE,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,I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BAAc;AAAA,YACd,oBAAkB,WAAW,YAAY,UAAU;AAAA,YACnD,eACE,SAAS,GAAG,MAAM,UAAU,KAAK,KAAK,mBAAmB,KAAK;AAAA;AAAA,QAElE;AAAA;AAAA,MAlDK;AAAA,IAmDP;AAAA,EAEJ,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACd,KAAK;AAAA,MACL,eAAa,UAAU;AAAA,MACvB,MAAK;AAAA,MACL,mBAAiB,QAAQ,UAAU;AAAA,MACnC,cAAY,CAAC,SAAS,YAAY,YAAY;AAAA,MAE7C;AAAA,iBACC;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,OAAO,MAAM,OAAO,QAAQ;AAAA,YAC5B,UAAU,WAAW,WAAW;AAAA,YAChC,YAAW;AAAA,YAEV;AAAA;AAAA,QACH;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACC,eAAc;AAAA,YACd,KAAK,WAAW;AAAA,YAChB,SAAS;AAAA,YACT,OAAO,gBAAgB,SAAS;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA,QACC,WAAW,aACV;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,MAAK;AAAA,YACL,OAAO,MAAM,OAAO,QAAQ,MAAM;AAAA,YAClC,UAAU,WAAW,WAAW;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["import_react","import_react_native","import_jsx_runtime","RNText","import_react_native","import_jsx_runtime","RNTextInput","import_jsx_runtime","newValue","updatedValue","complete","changeProps"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/InputPin.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Input.tsx"],"sourcesContent":["export * from \"./InputPin\";\n","import React, { useState, useRef, useEffect, useCallback } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, InputPrimitive } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, useId } from \"@xsolla/xui-core\";\n\nexport interface OnInputPinCompleteProps {\n isComplete: boolean;\n value: string;\n}\n\nexport interface InputPinProps {\n /** Current value of the input pin */\n value?: string;\n /** Function that will be called when the input value changes */\n onChange?: (props: OnInputPinCompleteProps) => void;\n /** Function that will be called when the input is completed */\n onComplete?: (props: OnInputPinCompleteProps) => void;\n /** The length of the code to be input. Default is 4 */\n codeLength?: number;\n /** @deprecated Use codeLength instead */\n length?: number;\n /** Property for changing the size of the input */\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n /** @deprecated Use disabled and error props instead */\n state?: \"default\" | \"hover\" | \"disable\" | \"error\";\n /** Property for disabling the control */\n disabled?: boolean;\n /** Property for displaying an error state */\n error?: boolean;\n /** Property for displaying a label above the input */\n label?: string;\n /** Property for displaying an error message */\n errorMessage?: string;\n /** @deprecated Use errorMessage instead */\n errorLabel?: string;\n /** Whether to hide the text (like a password field) */\n secureTextEntry?: boolean;\n /** Show dot placeholders in empty inputs */\n showPlaceholderDots?: boolean;\n /** Expands input cells to fill the width of the container */\n flexibleWidth?: boolean;\n /** Boolean value indicating if the input is filled or not */\n isComplete?: boolean;\n /** The current focused input index */\n currentFocus?: number;\n /** Function to add a ref to an input element */\n addRef?: (index: number) => (element: HTMLInputElement | null) => void;\n /** Test identifier for the component */\n testID?: string;\n /** Accessible label for screen readers (use when no visible label) */\n \"aria-label\"?: string;\n}\n\nexport const InputPin: React.FC<InputPinProps> = ({\n value = \"\",\n onChange,\n onComplete,\n codeLength,\n length = 4,\n size = \"md\",\n state: externalState,\n disabled: disabledProp,\n error: errorProp,\n label,\n errorMessage,\n errorLabel,\n secureTextEntry = false,\n showPlaceholderDots = true,\n flexibleWidth = false,\n isComplete: isCompleteProp,\n currentFocus,\n addRef,\n testID,\n \"aria-label\": ariaLabel,\n}) => {\n const { theme } = useDesignSystem();\n const uniqueId = useId();\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const [internalValue, setInternalValue] = useState(value);\n\n // Support both codeLength (new) and length (deprecated)\n const actualLength = codeLength ?? length;\n\n // Support both errorMessage (new) and errorLabel (deprecated)\n const errorText = errorMessage ?? errorLabel;\n\n // Support both new props and deprecated state prop\n // Error state is true if error prop is set, or errorMessage is provided, or state is \"error\"\n const isError = errorProp ?? (!!errorText || externalState === \"error\");\n const isDisabled = disabledProp ?? externalState === \"disable\";\n const isHover = externalState === \"hover\";\n const sizeStyles = theme.sizing.inputPin(size);\n const inputColors = theme.colors.control.input;\n\n const inputs = useRef<(HTMLInputElement | null)[]>([]);\n\n // Sync internal value with external value\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n // Handle currentFocus prop\n useEffect(() => {\n if (\n currentFocus !== undefined &&\n currentFocus >= 0 &&\n currentFocus < actualLength\n ) {\n inputs.current[currentFocus]?.focus();\n }\n }, [currentFocus, actualLength]);\n\n // Calculate isComplete status\n const checkIsComplete = useCallback(\n (val: string) => val.length >= actualLength,\n [actualLength]\n );\n\n // IDs for accessibility\n const labelId = `${uniqueId}-label`;\n const errorId = `${uniqueId}-error`;\n\n const handleTextChange = (text: string, index: number) => {\n // Filter to only alphanumeric characters\n const sanitizedText = text.replace(/[^0-9a-zA-Z]/g, \"\");\n\n // Handle multi-character input (paste on React Native)\n if (sanitizedText.length > 1) {\n const pastedData = sanitizedText.slice(0, actualLength - index);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n // Fill in characters starting from current index\n for (let i = 0; i < pastedData.length && index + i < actualLength; i++) {\n newValue[index + i] = pastedData[i];\n }\n\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the next empty input or the last input\n const nextIndex = Math.min(index + pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n return;\n }\n\n // Handle single character input\n const char = sanitizedText.slice(-1);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n newValue[index] = char;\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n if (char && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handleKeyDown = (\n e: React.KeyboardEvent<HTMLInputElement>,\n index: number\n ) => {\n if (e.key === \"Backspace\") {\n if (!internalValue[index] && index > 0) {\n inputs.current[index - 1]?.focus();\n }\n } else if (e.key === \"ArrowLeft\" && index > 0) {\n inputs.current[index - 1]?.focus();\n } else if (e.key === \"ArrowRight\" && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pastedData = e.clipboardData\n .getData(\"text\")\n .replace(/[^0-9a-zA-Z]/g, \"\")\n .slice(0, actualLength);\n setInternalValue(pastedData);\n\n const complete = checkIsComplete(pastedData);\n const changeProps = { isComplete: complete, value: pastedData };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the last filled input or the first empty one\n const nextIndex = Math.min(pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n };\n\n // Handler for storing refs that can be provided to addRef prop\n const handleRef = (index: number) => (element: HTMLInputElement | null) => {\n inputs.current[index] = element;\n addRef?.(index)(element);\n };\n\n const pinItems = Array.from({ length: actualLength }).map((_, index) => {\n const char = internalValue[index] || \"\";\n const isFocused = focusedIndex === index;\n\n let backgroundColor = inputColors.bg;\n let borderColor = inputColors.border;\n\n if (isDisabled) {\n backgroundColor = inputColors.bgDisable;\n borderColor = inputColors.borderDisable;\n } else if (isError) {\n borderColor = theme.colors.border.alert;\n backgroundColor = isFocused\n ? theme.colors.control.focus.bg\n : inputColors.bg;\n } else if (isFocused) {\n backgroundColor = theme.colors.control.focus.bg;\n borderColor = theme.colors.content.brand.secondary;\n } else if (isHover) {\n backgroundColor = inputColors.bgHover;\n borderColor = inputColors.borderHover;\n } else {\n backgroundColor = inputColors.bg;\n borderColor = inputColors.border;\n }\n\n const textColor = isDisabled ? inputColors.textDisable : inputColors.text;\n\n return (\n <Box\n key={index}\n width={flexibleWidth ? undefined : sizeStyles.size}\n height={sizeStyles.size}\n flex={flexibleWidth ? 1 : undefined}\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n borderWidth={sizeStyles.borderWidth}\n borderRadius={sizeStyles.radius}\n alignItems=\"center\"\n justifyContent=\"center\"\n hoverStyle={\n !isDisabled && !isFocused && !isError\n ? {\n backgroundColor: inputColors.bgHover,\n borderColor: inputColors.borderHover,\n }\n : undefined\n }\n >\n <InputPrimitive\n ref={\n addRef\n ? handleRef(index)\n : (el: any) => (inputs.current[index] = el)\n }\n value={char}\n placeholder={showPlaceholderDots && !isFocused ? \"•\" : undefined}\n onChangeText={(text: string) => handleTextChange(text, index)}\n onFocus={() => setFocusedIndex(index)}\n onBlur={() => setFocusedIndex(null)}\n onKeyDown={(e: any) => handleKeyDown(e, index)}\n disabled={isDisabled}\n secureTextEntry={secureTextEntry}\n color={textColor}\n placeholderTextColor={inputColors.placeholder}\n fontSize={sizeStyles.fontSize}\n style={{ textAlign: \"center\" }}\n maxLength={1}\n inputMode=\"numeric\"\n autoComplete=\"one-time-code\"\n aria-label={\n ariaLabel\n ? `${ariaLabel} digit ${index + 1}`\n : `PIN digit ${index + 1}`\n }\n aria-invalid={isError}\n aria-describedby={isError && errorText ? errorId : undefined}\n data-testid={\n testID ? `${testID}-input-${index}` : `input-pin-input-${index}`\n }\n />\n </Box>\n );\n });\n\n return (\n <Box\n flexDirection=\"column\"\n gap={sizeStyles.fieldGap}\n data-testid={testID || \"input-pin\"}\n role=\"group\"\n aria-labelledby={label ? labelId : undefined}\n aria-label={!label && ariaLabel ? ariaLabel : undefined}\n >\n {label && (\n <Text\n id={labelId}\n color={theme.colors.content.secondary}\n fontSize={sizeStyles.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n )}\n <Box\n flexDirection=\"row\"\n gap={sizeStyles.gap}\n onPaste={handlePaste}\n width={flexibleWidth ? \"100%\" : undefined}\n >\n {pinItems}\n </Box>\n {isError && errorText && (\n <Text\n id={errorId}\n role=\"alert\"\n color={theme.colors.content.alert.primary}\n fontSize={sizeStyles.fontSize - 2}\n >\n {errorText}\n </Text>\n )}\n </Box>\n );\n};\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 {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: 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 textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAgE;;;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;AAAA,YACC,eAAc;AAAA,YACd,KAAK,WAAW;AAAA,YAChB,SAAS;AAAA,YACT,OAAO,gBAAgB,SAAS;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA,QACC,WAAW,aACV;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,MAAK;AAAA,YACL,OAAO,MAAM,OAAO,QAAQ,MAAM;AAAA,YAClC,UAAU,WAAW,WAAW;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["import_react","import_react_native","import_jsx_runtime","RNText","import_react_native","import_jsx_runtime","RNTextInput","import_jsx_runtime","newValue","updatedValue","complete","changeProps"]}
|
package/native/index.mjs
CHANGED
package/native/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/InputPin.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Input.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, useCallback } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, InputPrimitive } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, useId } from \"@xsolla/xui-core\";\n\nexport interface OnInputPinCompleteProps {\n isComplete: boolean;\n value: string;\n}\n\nexport interface InputPinProps {\n /** Current value of the input pin */\n value?: string;\n /** Function that will be called when the input value changes */\n onChange?: (props: OnInputPinCompleteProps) => void;\n /** Function that will be called when the input is completed */\n onComplete?: (props: OnInputPinCompleteProps) => void;\n /** The length of the code to be input. Default is 4 */\n codeLength?: number;\n /** @deprecated Use codeLength instead */\n length?: number;\n /** Property for changing the size of the input */\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n /** @deprecated Use disabled and error props instead */\n state?: \"default\" | \"hover\" | \"disable\" | \"error\";\n /** Property for disabling the control */\n disabled?: boolean;\n /** Property for displaying an error state */\n error?: boolean;\n /** Property for displaying a label above the input */\n label?: string;\n /** Property for displaying an error message */\n errorMessage?: string;\n /** @deprecated Use errorMessage instead */\n errorLabel?: string;\n /** Whether to hide the text (like a password field) */\n secureTextEntry?: boolean;\n /** Show dot placeholders in empty inputs */\n showPlaceholderDots?: boolean;\n /** Expands input cells to fill the width of the container */\n flexibleWidth?: boolean;\n /** Boolean value indicating if the input is filled or not */\n isComplete?: boolean;\n /** The current focused input index */\n currentFocus?: number;\n /** Function to add a ref to an input element */\n addRef?: (index: number) => (element: HTMLInputElement | null) => void;\n /** Test identifier for the component */\n testID?: string;\n /** Accessible label for screen readers (use when no visible label) */\n \"aria-label\"?: string;\n}\n\nexport const InputPin: React.FC<InputPinProps> = ({\n value = \"\",\n onChange,\n onComplete,\n codeLength,\n length = 4,\n size = \"md\",\n state: externalState,\n disabled: disabledProp,\n error: errorProp,\n label,\n errorMessage,\n errorLabel,\n secureTextEntry = false,\n showPlaceholderDots = true,\n flexibleWidth = false,\n isComplete: isCompleteProp,\n currentFocus,\n addRef,\n testID,\n \"aria-label\": ariaLabel,\n}) => {\n const { theme } = useDesignSystem();\n const uniqueId = useId();\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const [internalValue, setInternalValue] = useState(value);\n\n // Support both codeLength (new) and length (deprecated)\n const actualLength = codeLength ?? length;\n\n // Support both errorMessage (new) and errorLabel (deprecated)\n const errorText = errorMessage ?? errorLabel;\n\n // Support both new props and deprecated state prop\n // Error state is true if error prop is set, or errorMessage is provided, or state is \"error\"\n const isError = errorProp ?? (!!errorText || externalState === \"error\");\n const isDisabled = disabledProp ?? externalState === \"disable\";\n const isHover = externalState === \"hover\";\n const sizeStyles = theme.sizing.inputPin(size);\n const inputColors = theme.colors.control.input;\n\n const inputs = useRef<(HTMLInputElement | null)[]>([]);\n\n // Sync internal value with external value\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n // Handle currentFocus prop\n useEffect(() => {\n if (\n currentFocus !== undefined &&\n currentFocus >= 0 &&\n currentFocus < actualLength\n ) {\n inputs.current[currentFocus]?.focus();\n }\n }, [currentFocus, actualLength]);\n\n // Calculate isComplete status\n const checkIsComplete = useCallback(\n (val: string) => val.length >= actualLength,\n [actualLength]\n );\n\n // IDs for accessibility\n const labelId = `${uniqueId}-label`;\n const errorId = `${uniqueId}-error`;\n\n const handleTextChange = (text: string, index: number) => {\n // Filter to only alphanumeric characters\n const sanitizedText = text.replace(/[^0-9a-zA-Z]/g, \"\");\n\n // Handle multi-character input (paste on React Native)\n if (sanitizedText.length > 1) {\n const pastedData = sanitizedText.slice(0, actualLength - index);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n // Fill in characters starting from current index\n for (let i = 0; i < pastedData.length && index + i < actualLength; i++) {\n newValue[index + i] = pastedData[i];\n }\n\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the next empty input or the last input\n const nextIndex = Math.min(index + pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n return;\n }\n\n // Handle single character input\n const char = sanitizedText.slice(-1);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n newValue[index] = char;\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n if (char && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handleKeyDown = (\n e: React.KeyboardEvent<HTMLInputElement>,\n index: number\n ) => {\n if (e.key === \"Backspace\") {\n if (!internalValue[index] && index > 0) {\n inputs.current[index - 1]?.focus();\n }\n } else if (e.key === \"ArrowLeft\" && index > 0) {\n inputs.current[index - 1]?.focus();\n } else if (e.key === \"ArrowRight\" && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pastedData = e.clipboardData\n .getData(\"text\")\n .replace(/[^0-9a-zA-Z]/g, \"\")\n .slice(0, actualLength);\n setInternalValue(pastedData);\n\n const complete = checkIsComplete(pastedData);\n const changeProps = { isComplete: complete, value: pastedData };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the last filled input or the first empty one\n const nextIndex = Math.min(pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n };\n\n // Handler for storing refs that can be provided to addRef prop\n const handleRef = (index: number) => (element: HTMLInputElement | null) => {\n inputs.current[index] = element;\n addRef?.(index)(element);\n };\n\n const pinItems = Array.from({ length: actualLength }).map((_, index) => {\n const char = internalValue[index] || \"\";\n const isFocused = focusedIndex === index;\n\n let backgroundColor = inputColors.bg;\n let borderColor = inputColors.border;\n\n if (isDisabled) {\n backgroundColor = inputColors.bgDisable;\n borderColor = inputColors.borderDisable;\n } else if (isError) {\n borderColor = theme.colors.border.alert;\n backgroundColor = isFocused\n ? theme.colors.control.focus.bg\n : inputColors.bg;\n } else if (isFocused) {\n backgroundColor = theme.colors.control.focus.bg;\n borderColor = theme.colors.content.brand.secondary;\n } else if (isHover) {\n backgroundColor = inputColors.bgHover;\n borderColor = inputColors.borderHover;\n } else {\n backgroundColor = inputColors.bg;\n borderColor = inputColors.border;\n }\n\n const textColor = isDisabled ? inputColors.textDisable : inputColors.text;\n\n return (\n <Box\n key={index}\n width={flexibleWidth ? undefined : sizeStyles.size}\n height={sizeStyles.size}\n flex={flexibleWidth ? 1 : undefined}\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n borderWidth={sizeStyles.borderWidth}\n borderRadius={sizeStyles.radius}\n alignItems=\"center\"\n justifyContent=\"center\"\n hoverStyle={\n !isDisabled && !isFocused && !isError\n ? {\n backgroundColor: inputColors.bgHover,\n borderColor: inputColors.borderHover,\n }\n : undefined\n }\n >\n <InputPrimitive\n ref={\n addRef\n ? handleRef(index)\n : (el: any) => (inputs.current[index] = el)\n }\n value={char}\n placeholder={showPlaceholderDots && !isFocused ? \"•\" : undefined}\n onChangeText={(text: string) => handleTextChange(text, index)}\n onFocus={() => setFocusedIndex(index)}\n onBlur={() => setFocusedIndex(null)}\n onKeyDown={(e: any) => handleKeyDown(e, index)}\n disabled={isDisabled}\n secureTextEntry={secureTextEntry}\n color={textColor}\n placeholderTextColor={inputColors.placeholder}\n fontSize={sizeStyles.fontSize}\n style={{ textAlign: \"center\" }}\n maxLength={1}\n inputMode=\"numeric\"\n autoComplete=\"one-time-code\"\n aria-label={\n ariaLabel\n ? `${ariaLabel} digit ${index + 1}`\n : `PIN digit ${index + 1}`\n }\n aria-invalid={isError}\n aria-describedby={isError && errorText ? errorId : undefined}\n data-testid={\n testID ? `${testID}-input-${index}` : `input-pin-input-${index}`\n }\n />\n </Box>\n );\n });\n\n return (\n <Box\n flexDirection=\"column\"\n gap={8}\n data-testid={testID || \"input-pin\"}\n role=\"group\"\n aria-labelledby={label ? labelId : undefined}\n aria-label={!label && ariaLabel ? ariaLabel : undefined}\n >\n {label && (\n <Text\n id={labelId}\n color={theme.colors.content.secondary}\n fontSize={sizeStyles.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n )}\n <Box\n flexDirection=\"row\"\n gap={sizeStyles.gap}\n onPaste={handlePaste}\n width={flexibleWidth ? \"100%\" : undefined}\n >\n {pinItems}\n </Box>\n {isError && errorText && (\n <Text\n id={errorId}\n role=\"alert\"\n color={theme.colors.content.alert.primary}\n fontSize={sizeStyles.fontSize - 2}\n >\n {errorText}\n </Text>\n )}\n </Box>\n );\n};\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 {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: 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 textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\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"],"mappings":";AAAA,SAAgB,UAAU,QAAQ,WAAW,mBAAmB;;;ACChE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAmID;AAhIC,IAAM,MAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,E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A,YACrB,OAAO,EAAE,WAAW,SAAS;AAAA,YAC7B,WAAW;AAAA,YACX,WAAU;AAAA,YACV,cAAa;AAAA,YACb,cACE,YACI,GAAG,SAAS,UAAU,QAAQ,CAAC,KAC/B,aAAa,QAAQ,CAAC;AAAA,YAE5B,gBAAc;AAAA,YACd,oBAAkB,WAAW,YAAY,UAAU;AAAA,YACnD,eACE,SAAS,GAAG,MAAM,UAAU,KAAK,KAAK,mBAAmB,KAAK;AAAA;AAAA,QAElE;AAAA;AAAA,MAlDK;AAAA,IAmDP;AAAA,EAEJ,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACd,KAAK;AAAA,MACL,eAAa,UAAU;AAAA,MACvB,MAAK;AAAA,MACL,mBAAiB,QAAQ,UAAU;AAAA,MACnC,cAAY,CAAC,SAAS,YAAY,YAAY;AAAA,MAE7C;AAAA,iBACC,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,OAAO,MAAM,OAAO,QAAQ;AAAA,YAC5B,UAAU,WAAW,WAAW;AAAA,YAChC,YAAW;AAAA,YAEV;AAAA;AAAA,QACH;AAAA,QAEF,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,eAAc;AAAA,YACd,KAAK,WAAW;AAAA,YAChB,SAAS;AAAA,YACT,OAAO,gBAAgB,SAAS;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA,QACC,WAAW,aACV,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,MAAK;AAAA,YACL,OAAO,MAAM,OAAO,QAAQ,MAAM;AAAA,YAClC,UAAU,WAAW,WAAW;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["jsx","jsx","jsx","newValue","updatedValue","complete","changeProps"]}
|
|
1
|
+
{"version":3,"sources":["../../src/InputPin.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Input.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, useCallback } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, InputPrimitive } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, useId } from \"@xsolla/xui-core\";\n\nexport interface OnInputPinCompleteProps {\n isComplete: boolean;\n value: string;\n}\n\nexport interface InputPinProps {\n /** Current value of the input pin */\n value?: string;\n /** Function that will be called when the input value changes */\n onChange?: (props: OnInputPinCompleteProps) => void;\n /** Function that will be called when the input is completed */\n onComplete?: (props: OnInputPinCompleteProps) => void;\n /** The length of the code to be input. Default is 4 */\n codeLength?: number;\n /** @deprecated Use codeLength instead */\n length?: number;\n /** Property for changing the size of the input */\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n /** @deprecated Use disabled and error props instead */\n state?: \"default\" | \"hover\" | \"disable\" | \"error\";\n /** Property for disabling the control */\n disabled?: boolean;\n /** Property for displaying an error state */\n error?: boolean;\n /** Property for displaying a label above the input */\n label?: string;\n /** Property for displaying an error message */\n errorMessage?: string;\n /** @deprecated Use errorMessage instead */\n errorLabel?: string;\n /** Whether to hide the text (like a password field) */\n secureTextEntry?: boolean;\n /** Show dot placeholders in empty inputs */\n showPlaceholderDots?: boolean;\n /** Expands input cells to fill the width of the container */\n flexibleWidth?: boolean;\n /** Boolean value indicating if the input is filled or not */\n isComplete?: boolean;\n /** The current focused input index */\n currentFocus?: number;\n /** Function to add a ref to an input element */\n addRef?: (index: number) => (element: HTMLInputElement | null) => void;\n /** Test identifier for the component */\n testID?: string;\n /** Accessible label for screen readers (use when no visible label) */\n \"aria-label\"?: string;\n}\n\nexport const InputPin: React.FC<InputPinProps> = ({\n value = \"\",\n onChange,\n onComplete,\n codeLength,\n length = 4,\n size = \"md\",\n state: externalState,\n disabled: disabledProp,\n error: errorProp,\n label,\n errorMessage,\n errorLabel,\n secureTextEntry = false,\n showPlaceholderDots = true,\n flexibleWidth = false,\n isComplete: isCompleteProp,\n currentFocus,\n addRef,\n testID,\n \"aria-label\": ariaLabel,\n}) => {\n const { theme } = useDesignSystem();\n const uniqueId = useId();\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const [internalValue, setInternalValue] = useState(value);\n\n // Support both codeLength (new) and length (deprecated)\n const actualLength = codeLength ?? length;\n\n // Support both errorMessage (new) and errorLabel (deprecated)\n const errorText = errorMessage ?? errorLabel;\n\n // Support both new props and deprecated state prop\n // Error state is true if error prop is set, or errorMessage is provided, or state is \"error\"\n const isError = errorProp ?? (!!errorText || externalState === \"error\");\n const isDisabled = disabledProp ?? externalState === \"disable\";\n const isHover = externalState === \"hover\";\n const sizeStyles = theme.sizing.inputPin(size);\n const inputColors = theme.colors.control.input;\n\n const inputs = useRef<(HTMLInputElement | null)[]>([]);\n\n // Sync internal value with external value\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n // Handle currentFocus prop\n useEffect(() => {\n if (\n currentFocus !== undefined &&\n currentFocus >= 0 &&\n currentFocus < actualLength\n ) {\n inputs.current[currentFocus]?.focus();\n }\n }, [currentFocus, actualLength]);\n\n // Calculate isComplete status\n const checkIsComplete = useCallback(\n (val: string) => val.length >= actualLength,\n [actualLength]\n );\n\n // IDs for accessibility\n const labelId = `${uniqueId}-label`;\n const errorId = `${uniqueId}-error`;\n\n const handleTextChange = (text: string, index: number) => {\n // Filter to only alphanumeric characters\n const sanitizedText = text.replace(/[^0-9a-zA-Z]/g, \"\");\n\n // Handle multi-character input (paste on React Native)\n if (sanitizedText.length > 1) {\n const pastedData = sanitizedText.slice(0, actualLength - index);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n // Fill in characters starting from current index\n for (let i = 0; i < pastedData.length && index + i < actualLength; i++) {\n newValue[index + i] = pastedData[i];\n }\n\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the next empty input or the last input\n const nextIndex = Math.min(index + pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n return;\n }\n\n // Handle single character input\n const char = sanitizedText.slice(-1);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n newValue[index] = char;\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n if (char && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handleKeyDown = (\n e: React.KeyboardEvent<HTMLInputElement>,\n index: number\n ) => {\n if (e.key === \"Backspace\") {\n if (!internalValue[index] && index > 0) {\n inputs.current[index - 1]?.focus();\n }\n } else if (e.key === \"ArrowLeft\" && index > 0) {\n inputs.current[index - 1]?.focus();\n } else if (e.key === \"ArrowRight\" && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pastedData = e.clipboardData\n .getData(\"text\")\n .replace(/[^0-9a-zA-Z]/g, \"\")\n .slice(0, actualLength);\n setInternalValue(pastedData);\n\n const complete = checkIsComplete(pastedData);\n const changeProps = { isComplete: complete, value: pastedData };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the last filled input or the first empty one\n const nextIndex = Math.min(pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n };\n\n // Handler for storing refs that can be provided to addRef prop\n const handleRef = (index: number) => (element: HTMLInputElement | null) => {\n inputs.current[index] = element;\n addRef?.(index)(element);\n };\n\n const pinItems = Array.from({ length: actualLength }).map((_, index) => {\n const char = internalValue[index] || \"\";\n const isFocused = focusedIndex === index;\n\n let backgroundColor = inputColors.bg;\n let borderColor = inputColors.border;\n\n if (isDisabled) {\n backgroundColor = inputColors.bgDisable;\n borderColor = inputColors.borderDisable;\n } else if (isError) {\n borderColor = theme.colors.border.alert;\n backgroundColor = isFocused\n ? theme.colors.control.focus.bg\n : inputColors.bg;\n } else if (isFocused) {\n backgroundColor = theme.colors.control.focus.bg;\n borderColor = theme.colors.content.brand.secondary;\n } else if (isHover) {\n backgroundColor = inputColors.bgHover;\n borderColor = inputColors.borderHover;\n } else {\n backgroundColor = inputColors.bg;\n borderColor = inputColors.border;\n }\n\n const textColor = isDisabled ? inputColors.textDisable : inputColors.text;\n\n return (\n <Box\n key={index}\n width={flexibleWidth ? undefined : sizeStyles.size}\n height={sizeStyles.size}\n flex={flexibleWidth ? 1 : undefined}\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n borderWidth={sizeStyles.borderWidth}\n borderRadius={sizeStyles.radius}\n alignItems=\"center\"\n justifyContent=\"center\"\n hoverStyle={\n !isDisabled && !isFocused && !isError\n ? {\n backgroundColor: inputColors.bgHover,\n borderColor: inputColors.borderHover,\n }\n : undefined\n }\n >\n <InputPrimitive\n ref={\n addRef\n ? handleRef(index)\n : (el: any) => (inputs.current[index] = el)\n }\n value={char}\n placeholder={showPlaceholderDots && !isFocused ? \"•\" : undefined}\n onChangeText={(text: string) => handleTextChange(text, index)}\n onFocus={() => setFocusedIndex(index)}\n onBlur={() => setFocusedIndex(null)}\n onKeyDown={(e: any) => handleKeyDown(e, index)}\n disabled={isDisabled}\n secureTextEntry={secureTextEntry}\n color={textColor}\n placeholderTextColor={inputColors.placeholder}\n fontSize={sizeStyles.fontSize}\n style={{ textAlign: \"center\" }}\n maxLength={1}\n inputMode=\"numeric\"\n autoComplete=\"one-time-code\"\n aria-label={\n ariaLabel\n ? `${ariaLabel} digit ${index + 1}`\n : `PIN digit ${index + 1}`\n }\n aria-invalid={isError}\n aria-describedby={isError && errorText ? errorId : undefined}\n data-testid={\n testID ? `${testID}-input-${index}` : `input-pin-input-${index}`\n }\n />\n </Box>\n );\n });\n\n return (\n <Box\n flexDirection=\"column\"\n gap={sizeStyles.fieldGap}\n data-testid={testID || \"input-pin\"}\n role=\"group\"\n aria-labelledby={label ? labelId : undefined}\n aria-label={!label && ariaLabel ? ariaLabel : undefined}\n >\n {label && (\n <Text\n id={labelId}\n color={theme.colors.content.secondary}\n fontSize={sizeStyles.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n )}\n <Box\n flexDirection=\"row\"\n gap={sizeStyles.gap}\n onPaste={handlePaste}\n width={flexibleWidth ? \"100%\" : undefined}\n >\n {pinItems}\n </Box>\n {isError && errorText && (\n <Text\n id={errorId}\n role=\"alert\"\n color={theme.colors.content.alert.primary}\n fontSize={sizeStyles.fontSize - 2}\n >\n {errorText}\n </Text>\n )}\n </Box>\n );\n};\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 {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: 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 textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\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"],"mappings":";AAAA,SAAgB,UAAU,QAAQ,WAAW,mBAAmB;;;ACChE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAmID;AAhIC,IAAM,MAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,oBAAoB,CAAC,aAAkC;AAAA,IAC3D,iBACE,WAAW,YAAY,kBACnB,WAAW,kBACX;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI;AAAA,EACN;AAEA,QAAM,cAAc,cA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AAAA;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,OAAO,MAAM,OAAO,QAAQ;AAAA,YAC5B,UAAU,WAAW,WAAW;AAAA,YAChC,YAAW;AAAA,YAEV;AAAA;AAAA,QACH;AAAA,QAEF,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,eAAc;AAAA,YACd,KAAK,WAAW;AAAA,YAChB,SAAS;AAAA,YACT,OAAO,gBAAgB,SAAS;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA,QACC,WAAW,aACV,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,MAAK;AAAA,YACL,OAAO,MAAM,OAAO,QAAQ,MAAM;AAAA,YAClC,UAAU,WAAW,WAAW;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["jsx","jsx","jsx","newValue","updatedValue","complete","changeProps"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-input-pin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.115.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"test:coverage": "vitest run --coverage"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@xsolla/xui-button": "0.
|
|
17
|
-
"@xsolla/xui-core": "0.
|
|
18
|
-
"@xsolla/xui-primitives-core": "0.
|
|
16
|
+
"@xsolla/xui-button": "0.115.0",
|
|
17
|
+
"@xsolla/xui-core": "0.115.0",
|
|
18
|
+
"@xsolla/xui-primitives-core": "0.115.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": ">=16.8.0",
|
package/web/index.js
CHANGED
|
@@ -263,6 +263,16 @@ var StyledInput = import_styled_components3.default.input`
|
|
|
263
263
|
&:disabled {
|
|
264
264
|
cursor: not-allowed;
|
|
265
265
|
}
|
|
266
|
+
|
|
267
|
+
/* Override browser autofill background */
|
|
268
|
+
&:-webkit-autofill,
|
|
269
|
+
&:-webkit-autofill:hover,
|
|
270
|
+
&:-webkit-autofill:focus,
|
|
271
|
+
&:-webkit-autofill:active {
|
|
272
|
+
-webkit-box-shadow: 0 0 0 1000px transparent inset !important;
|
|
273
|
+
-webkit-background-clip: text !important;
|
|
274
|
+
-webkit-text-fill-color: ${(props) => props.color || "inherit"} !important;
|
|
275
|
+
}
|
|
266
276
|
`;
|
|
267
277
|
var InputPrimitive = (0, import_react2.forwardRef)(
|
|
268
278
|
({
|
|
@@ -527,7 +537,7 @@ var InputPin = ({
|
|
|
527
537
|
Box,
|
|
528
538
|
{
|
|
529
539
|
flexDirection: "column",
|
|
530
|
-
gap:
|
|
540
|
+
gap: sizeStyles.fieldGap,
|
|
531
541
|
"data-testid": testID || "input-pin",
|
|
532
542
|
role: "group",
|
|
533
543
|
"aria-labelledby": label ? labelId : void 0,
|
package/web/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/InputPin.tsx","../../../primitives-web/src/Box.tsx","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/Input.tsx"],"sourcesContent":["export * from \"./InputPin\";\n","import React, { useState, useRef, useEffect, useCallback } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, InputPrimitive } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, useId } from \"@xsolla/xui-core\";\n\nexport interface OnInputPinCompleteProps {\n isComplete: boolean;\n value: string;\n}\n\nexport interface InputPinProps {\n /** Current value of the input pin */\n value?: string;\n /** Function that will be called when the input value changes */\n onChange?: (props: OnInputPinCompleteProps) => void;\n /** Function that will be called when the input is completed */\n onComplete?: (props: OnInputPinCompleteProps) => void;\n /** The length of the code to be input. Default is 4 */\n codeLength?: number;\n /** @deprecated Use codeLength instead */\n length?: number;\n /** Property for changing the size of the input */\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n /** @deprecated Use disabled and error props instead */\n state?: \"default\" | \"hover\" | \"disable\" | \"error\";\n /** Property for disabling the control */\n disabled?: boolean;\n /** Property for displaying an error state */\n error?: boolean;\n /** Property for displaying a label above the input */\n label?: string;\n /** Property for displaying an error message */\n errorMessage?: string;\n /** @deprecated Use errorMessage instead */\n errorLabel?: string;\n /** Whether to hide the text (like a password field) */\n secureTextEntry?: boolean;\n /** Show dot placeholders in empty inputs */\n showPlaceholderDots?: boolean;\n /** Expands input cells to fill the width of the container */\n flexibleWidth?: boolean;\n /** Boolean value indicating if the input is filled or not */\n isComplete?: boolean;\n /** The current focused input index */\n currentFocus?: number;\n /** Function to add a ref to an input element */\n addRef?: (index: number) => (element: HTMLInputElement | null) => void;\n /** Test identifier for the component */\n testID?: string;\n /** Accessible label for screen readers (use when no visible label) */\n \"aria-label\"?: string;\n}\n\nexport const InputPin: React.FC<InputPinProps> = ({\n value = \"\",\n onChange,\n onComplete,\n codeLength,\n length = 4,\n size = \"md\",\n state: externalState,\n disabled: disabledProp,\n error: errorProp,\n label,\n errorMessage,\n errorLabel,\n secureTextEntry = false,\n showPlaceholderDots = true,\n flexibleWidth = false,\n isComplete: isCompleteProp,\n currentFocus,\n addRef,\n testID,\n \"aria-label\": ariaLabel,\n}) => {\n const { theme } = useDesignSystem();\n const uniqueId = useId();\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const [internalValue, setInternalValue] = useState(value);\n\n // Support both codeLength (new) and length (deprecated)\n const actualLength = codeLength ?? length;\n\n // Support both errorMessage (new) and errorLabel (deprecated)\n const errorText = errorMessage ?? errorLabel;\n\n // Support both new props and deprecated state prop\n // Error state is true if error prop is set, or errorMessage is provided, or state is \"error\"\n const isError = errorProp ?? (!!errorText || externalState === \"error\");\n const isDisabled = disabledProp ?? externalState === \"disable\";\n const isHover = externalState === \"hover\";\n const sizeStyles = theme.sizing.inputPin(size);\n const inputColors = theme.colors.control.input;\n\n const inputs = useRef<(HTMLInputElement | null)[]>([]);\n\n // Sync internal value with external value\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n // Handle currentFocus prop\n useEffect(() => {\n if (\n currentFocus !== undefined &&\n currentFocus >= 0 &&\n currentFocus < actualLength\n ) {\n inputs.current[currentFocus]?.focus();\n }\n }, [currentFocus, actualLength]);\n\n // Calculate isComplete status\n const checkIsComplete = useCallback(\n (val: string) => val.length >= actualLength,\n [actualLength]\n );\n\n // IDs for accessibility\n const labelId = `${uniqueId}-label`;\n const errorId = `${uniqueId}-error`;\n\n const handleTextChange = (text: string, index: number) => {\n // Filter to only alphanumeric characters\n const sanitizedText = text.replace(/[^0-9a-zA-Z]/g, \"\");\n\n // Handle multi-character input (paste on React Native)\n if (sanitizedText.length > 1) {\n const pastedData = sanitizedText.slice(0, actualLength - index);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n // Fill in characters starting from current index\n for (let i = 0; i < pastedData.length && index + i < actualLength; i++) {\n newValue[index + i] = pastedData[i];\n }\n\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the next empty input or the last input\n const nextIndex = Math.min(index + pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n return;\n }\n\n // Handle single character input\n const char = sanitizedText.slice(-1);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n newValue[index] = char;\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n if (char && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handleKeyDown = (\n e: React.KeyboardEvent<HTMLInputElement>,\n index: number\n ) => {\n if (e.key === \"Backspace\") {\n if (!internalValue[index] && index > 0) {\n inputs.current[index - 1]?.focus();\n }\n } else if (e.key === \"ArrowLeft\" && index > 0) {\n inputs.current[index - 1]?.focus();\n } else if (e.key === \"ArrowRight\" && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pastedData = e.clipboardData\n .getData(\"text\")\n .replace(/[^0-9a-zA-Z]/g, \"\")\n .slice(0, actualLength);\n setInternalValue(pastedData);\n\n const complete = checkIsComplete(pastedData);\n const changeProps = { isComplete: complete, value: pastedData };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the last filled input or the first empty one\n const nextIndex = Math.min(pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n };\n\n // Handler for storing refs that can be provided to addRef prop\n const handleRef = (index: number) => (element: HTMLInputElement | null) => {\n inputs.current[index] = element;\n addRef?.(index)(element);\n };\n\n const pinItems = Array.from({ length: actualLength }).map((_, index) => {\n const char = internalValue[index] || \"\";\n const isFocused = focusedIndex === index;\n\n let backgroundColor = inputColors.bg;\n let borderColor = inputColors.border;\n\n if (isDisabled) {\n backgroundColor = inputColors.bgDisable;\n borderColor = inputColors.borderDisable;\n } else if (isError) {\n borderColor = theme.colors.border.alert;\n backgroundColor = isFocused\n ? theme.colors.control.focus.bg\n : inputColors.bg;\n } else if (isFocused) {\n backgroundColor = theme.colors.control.focus.bg;\n borderColor = theme.colors.content.brand.secondary;\n } else if (isHover) {\n backgroundColor = inputColors.bgHover;\n borderColor = inputColors.borderHover;\n } else {\n backgroundColor = inputColors.bg;\n borderColor = inputColors.border;\n }\n\n const textColor = isDisabled ? inputColors.textDisable : inputColors.text;\n\n return (\n <Box\n key={index}\n width={flexibleWidth ? undefined : sizeStyles.size}\n height={sizeStyles.size}\n flex={flexibleWidth ? 1 : undefined}\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n borderWidth={sizeStyles.borderWidth}\n borderRadius={sizeStyles.radius}\n alignItems=\"center\"\n justifyContent=\"center\"\n hoverStyle={\n !isDisabled && !isFocused && !isError\n ? {\n backgroundColor: inputColors.bgHover,\n borderColor: inputColors.borderHover,\n }\n : undefined\n }\n >\n <InputPrimitive\n ref={\n addRef\n ? handleRef(index)\n : (el: any) => (inputs.current[index] = el)\n }\n value={char}\n placeholder={showPlaceholderDots && !isFocused ? \"•\" : undefined}\n onChangeText={(text: string) => handleTextChange(text, index)}\n onFocus={() => setFocusedIndex(index)}\n onBlur={() => setFocusedIndex(null)}\n onKeyDown={(e: any) => handleKeyDown(e, index)}\n disabled={isDisabled}\n secureTextEntry={secureTextEntry}\n color={textColor}\n placeholderTextColor={inputColors.placeholder}\n fontSize={sizeStyles.fontSize}\n style={{ textAlign: \"center\" }}\n maxLength={1}\n inputMode=\"numeric\"\n autoComplete=\"one-time-code\"\n aria-label={\n ariaLabel\n ? `${ariaLabel} digit ${index + 1}`\n : `PIN digit ${index + 1}`\n }\n aria-invalid={isError}\n aria-describedby={isError && errorText ? errorId : undefined}\n data-testid={\n testID ? `${testID}-input-${index}` : `input-pin-input-${index}`\n }\n />\n </Box>\n );\n });\n\n return (\n <Box\n flexDirection=\"column\"\n gap={8}\n data-testid={testID || \"input-pin\"}\n role=\"group\"\n aria-labelledby={label ? labelId : undefined}\n aria-label={!label && ariaLabel ? ariaLabel : undefined}\n >\n {label && (\n <Text\n id={labelId}\n color={theme.colors.content.secondary}\n fontSize={sizeStyles.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n )}\n <Box\n flexDirection=\"row\"\n gap={sizeStyles.gap}\n onPaste={handlePaste}\n width={flexibleWidth ? \"100%\" : undefined}\n >\n {pinItems}\n </Box>\n {isError && errorText && (\n <Text\n id={errorId}\n role=\"alert\"\n color={theme.colors.content.alert.primary}\n fontSize={sizeStyles.fontSize - 2}\n >\n {errorText}\n </Text>\n )}\n </Box>\n );\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledBox = styled.div<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n type,\n disabled,\n id,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n as={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledText = styled.span<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n numberOfLines: _numberOfLines,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","import React, { forwardRef } from \"react\";\nimport styled from \"styled-components\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledInput = styled.input<InputPrimitiveProps>`\n background: transparent;\n border: none;\n outline: none;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-family: inherit;\n text-align: inherit;\n\n &::placeholder {\n color: ${(props) =>\n props.placeholderTextColor || \"rgba(255, 255, 255, 0.5)\"};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const InputPrimitive = forwardRef<HTMLInputElement, 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 ...rest\n },\n ref\n ) => {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(e);\n }\n if (onChangeText) {\n onChangeText(e.target.value);\n }\n };\n\n // Always pass value to make it a controlled input\n const inputValue = value !== undefined ? value : \"\";\n\n return (\n <StyledInput\n ref={ref}\n id={id}\n value={inputValue}\n name={name}\n placeholder={placeholder}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n disabled={disabled}\n type={secureTextEntry ? \"password\" : type || \"text\"}\n inputMode={inputMode}\n autoComplete={autoComplete}\n style={style}\n color={color}\n fontSize={fontSize}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\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 {...rest}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAgE;;;ACAhE,mBAAkB;AAClB,+BAAmB;AAuMX;AApMR,IAAM,YAAY,yBAAAC,QAAO;AAAA;AAAA;AAAA,sBAGH,CAAC,UAAU,MAAM,mBAAmB,aAAa;AA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K;AAAA,MACL,eAAa,UAAU;AAAA,MACvB,MAAK;AAAA,MACL,mBAAiB,QAAQ,UAAU;AAAA,MACnC,cAAY,CAAC,SAAS,YAAY,YAAY;AAAA,MAE7C;AAAA,iBACC;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,OAAO,MAAM,OAAO,QAAQ;AAAA,YAC5B,UAAU,WAAW,WAAW;AAAA,YAChC,YAAW;AAAA,YAEV;AAAA;AAAA,QACH;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACC,eAAc;AAAA,YACd,KAAK,WAAW;AAAA,YAChB,SAAS;AAAA,YACT,OAAO,gBAAgB,SAAS;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA,QACC,WAAW,aACV;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,MAAK;AAAA,YACL,OAAO,MAAM,OAAO,QAAQ,MAAM;AAAA,YAClC,UAAU,WAAW,WAAW;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["import_react","styled","React","import_styled_components","import_jsx_runtime","styled","import_react","import_styled_components","import_jsx_runtime","styled","import_jsx_runtime","newValue","updatedValue","complete","changeProps"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/InputPin.tsx","../../../primitives-web/src/Box.tsx","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/Input.tsx"],"sourcesContent":["export * from \"./InputPin\";\n","import React, { useState, useRef, useEffect, useCallback } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, InputPrimitive } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, useId } from \"@xsolla/xui-core\";\n\nexport interface OnInputPinCompleteProps {\n isComplete: boolean;\n value: string;\n}\n\nexport interface InputPinProps {\n /** Current value of the input pin */\n value?: string;\n /** Function that will be called when the input value changes */\n onChange?: (props: OnInputPinCompleteProps) => void;\n /** Function that will be called when the input is completed */\n onComplete?: (props: OnInputPinCompleteProps) => void;\n /** The length of the code to be input. Default is 4 */\n codeLength?: number;\n /** @deprecated Use codeLength instead */\n length?: number;\n /** Property for changing the size of the input */\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n /** @deprecated Use disabled and error props instead */\n state?: \"default\" | \"hover\" | \"disable\" | \"error\";\n /** Property for disabling the control */\n disabled?: boolean;\n /** Property for displaying an error state */\n error?: boolean;\n /** Property for displaying a label above the input */\n label?: string;\n /** Property for displaying an error message */\n errorMessage?: string;\n /** @deprecated Use errorMessage instead */\n errorLabel?: string;\n /** Whether to hide the text (like a password field) */\n secureTextEntry?: boolean;\n /** Show dot placeholders in empty inputs */\n showPlaceholderDots?: boolean;\n /** Expands input cells to fill the width of the container */\n flexibleWidth?: boolean;\n /** Boolean value indicating if the input is filled or not */\n isComplete?: boolean;\n /** The current focused input index */\n currentFocus?: number;\n /** Function to add a ref to an input element */\n addRef?: (index: number) => (element: HTMLInputElement | null) => void;\n /** Test identifier for the component */\n testID?: string;\n /** Accessible label for screen readers (use when no visible label) */\n \"aria-label\"?: string;\n}\n\nexport const InputPin: React.FC<InputPinProps> = ({\n value = \"\",\n onChange,\n onComplete,\n codeLength,\n length = 4,\n size = \"md\",\n state: externalState,\n disabled: disabledProp,\n error: errorProp,\n label,\n errorMessage,\n errorLabel,\n secureTextEntry = false,\n showPlaceholderDots = true,\n flexibleWidth = false,\n isComplete: isCompleteProp,\n currentFocus,\n addRef,\n testID,\n \"aria-label\": ariaLabel,\n}) => {\n const { theme } = useDesignSystem();\n const uniqueId = useId();\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const [internalValue, setInternalValue] = useState(value);\n\n // Support both codeLength (new) and length (deprecated)\n const actualLength = codeLength ?? length;\n\n // Support both errorMessage (new) and errorLabel (deprecated)\n const errorText = errorMessage ?? errorLabel;\n\n // Support both new props and deprecated state prop\n // Error state is true if error prop is set, or errorMessage is provided, or state is \"error\"\n const isError = errorProp ?? (!!errorText || externalState === \"error\");\n const isDisabled = disabledProp ?? externalState === \"disable\";\n const isHover = externalState === \"hover\";\n const sizeStyles = theme.sizing.inputPin(size);\n const inputColors = theme.colors.control.input;\n\n const inputs = useRef<(HTMLInputElement | null)[]>([]);\n\n // Sync internal value with external value\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n // Handle currentFocus prop\n useEffect(() => {\n if (\n currentFocus !== undefined &&\n currentFocus >= 0 &&\n currentFocus < actualLength\n ) {\n inputs.current[currentFocus]?.focus();\n }\n }, [currentFocus, actualLength]);\n\n // Calculate isComplete status\n const checkIsComplete = useCallback(\n (val: string) => val.length >= actualLength,\n [actualLength]\n );\n\n // IDs for accessibility\n const labelId = `${uniqueId}-label`;\n const errorId = `${uniqueId}-error`;\n\n const handleTextChange = (text: string, index: number) => {\n // Filter to only alphanumeric characters\n const sanitizedText = text.replace(/[^0-9a-zA-Z]/g, \"\");\n\n // Handle multi-character input (paste on React Native)\n if (sanitizedText.length > 1) {\n const pastedData = sanitizedText.slice(0, actualLength - index);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n // Fill in characters starting from current index\n for (let i = 0; i < pastedData.length && index + i < actualLength; i++) {\n newValue[index + i] = pastedData[i];\n }\n\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the next empty input or the last input\n const nextIndex = Math.min(index + pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n return;\n }\n\n // Handle single character input\n const char = sanitizedText.slice(-1);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n newValue[index] = char;\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n if (char && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handleKeyDown = (\n e: React.KeyboardEvent<HTMLInputElement>,\n index: number\n ) => {\n if (e.key === \"Backspace\") {\n if (!internalValue[index] && index > 0) {\n inputs.current[index - 1]?.focus();\n }\n } else if (e.key === \"ArrowLeft\" && index > 0) {\n inputs.current[index - 1]?.focus();\n } else if (e.key === \"ArrowRight\" && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pastedData = e.clipboardData\n .getData(\"text\")\n .replace(/[^0-9a-zA-Z]/g, \"\")\n .slice(0, actualLength);\n setInternalValue(pastedData);\n\n const complete = checkIsComplete(pastedData);\n const changeProps = { isComplete: complete, value: pastedData };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the last filled input or the first empty one\n const nextIndex = Math.min(pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n };\n\n // Handler for storing refs that can be provided to addRef prop\n const handleRef = (index: number) => (element: HTMLInputElement | null) => {\n inputs.current[index] = element;\n addRef?.(index)(element);\n };\n\n const pinItems = Array.from({ length: actualLength }).map((_, index) => {\n const char = internalValue[index] || \"\";\n const isFocused = focusedIndex === index;\n\n let backgroundColor = inputColors.bg;\n let borderColor = inputColors.border;\n\n if (isDisabled) {\n backgroundColor = inputColors.bgDisable;\n borderColor = inputColors.borderDisable;\n } else if (isError) {\n borderColor = theme.colors.border.alert;\n backgroundColor = isFocused\n ? theme.colors.control.focus.bg\n : inputColors.bg;\n } else if (isFocused) {\n backgroundColor = theme.colors.control.focus.bg;\n borderColor = theme.colors.content.brand.secondary;\n } else if (isHover) {\n backgroundColor = inputColors.bgHover;\n borderColor = inputColors.borderHover;\n } else {\n backgroundColor = inputColors.bg;\n borderColor = inputColors.border;\n }\n\n const textColor = isDisabled ? inputColors.textDisable : inputColors.text;\n\n return (\n <Box\n key={index}\n width={flexibleWidth ? undefined : sizeStyles.size}\n height={sizeStyles.size}\n flex={flexibleWidth ? 1 : undefined}\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n borderWidth={sizeStyles.borderWidth}\n borderRadius={sizeStyles.radius}\n alignItems=\"center\"\n justifyContent=\"center\"\n hoverStyle={\n !isDisabled && !isFocused && !isError\n ? {\n backgroundColor: inputColors.bgHover,\n borderColor: inputColors.borderHover,\n }\n : undefined\n }\n >\n <InputPrimitive\n ref={\n addRef\n ? handleRef(index)\n : (el: any) => (inputs.current[index] = el)\n }\n value={char}\n placeholder={showPlaceholderDots && !isFocused ? \"•\" : undefined}\n onChangeText={(text: string) => handleTextChange(text, index)}\n onFocus={() => setFocusedIndex(index)}\n onBlur={() => setFocusedIndex(null)}\n onKeyDown={(e: any) => handleKeyDown(e, index)}\n disabled={isDisabled}\n secureTextEntry={secureTextEntry}\n color={textColor}\n placeholderTextColor={inputColors.placeholder}\n fontSize={sizeStyles.fontSize}\n style={{ textAlign: \"center\" }}\n maxLength={1}\n inputMode=\"numeric\"\n autoComplete=\"one-time-code\"\n aria-label={\n ariaLabel\n ? `${ariaLabel} digit ${index + 1}`\n : `PIN digit ${index + 1}`\n }\n aria-invalid={isError}\n aria-describedby={isError && errorText ? errorId : undefined}\n data-testid={\n testID ? `${testID}-input-${index}` : `input-pin-input-${index}`\n }\n />\n </Box>\n );\n });\n\n return (\n <Box\n flexDirection=\"column\"\n gap={sizeStyles.fieldGap}\n data-testid={testID || \"input-pin\"}\n role=\"group\"\n aria-labelledby={label ? labelId : undefined}\n aria-label={!label && ariaLabel ? ariaLabel : undefined}\n >\n {label && (\n <Text\n id={labelId}\n color={theme.colors.content.secondary}\n fontSize={sizeStyles.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n )}\n <Box\n flexDirection=\"row\"\n gap={sizeStyles.gap}\n onPaste={handlePaste}\n width={flexibleWidth ? \"100%\" : undefined}\n >\n {pinItems}\n </Box>\n {isError && errorText && (\n <Text\n id={errorId}\n role=\"alert\"\n color={theme.colors.content.alert.primary}\n fontSize={sizeStyles.fontSize - 2}\n >\n {errorText}\n </Text>\n )}\n </Box>\n );\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledBox = styled.div<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n type,\n disabled,\n id,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n as={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledText = styled.span<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n numberOfLines: _numberOfLines,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","import React, { forwardRef } from \"react\";\nimport styled from \"styled-components\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledInput = styled.input<InputPrimitiveProps>`\n background: transparent;\n border: none;\n outline: none;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-family: inherit;\n text-align: inherit;\n\n &::placeholder {\n color: ${(props) =>\n props.placeholderTextColor || \"rgba(255, 255, 255, 0.5)\"};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n\n /* Override browser autofill background */\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n -webkit-box-shadow: 0 0 0 1000px transparent inset !important;\n -webkit-background-clip: text !important;\n -webkit-text-fill-color: ${(props) => props.color || \"inherit\"} !important;\n }\n`;\n\nexport const InputPrimitive = forwardRef<HTMLInputElement, 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 ...rest\n },\n ref\n ) => {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(e);\n }\n if (onChangeText) {\n onChangeText(e.target.value);\n }\n };\n\n // Always pass value to make it a controlled input\n const inputValue = value !== undefined ? value : \"\";\n\n return (\n <StyledInput\n ref={ref}\n id={id}\n value={inputValue}\n name={name}\n placeholder={placeholder}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n disabled={disabled}\n type={secureTextEntry ? \"password\" : type || \"text\"}\n inputMode={inputMode}\n autoComplete={autoComplete}\n style={style}\n color={color}\n fontSize={fontSize}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\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 {...rest}\n />\n );\n }\n);\n\nInputPr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AAU;AAAA,YACV,cAAa;AAAA,YACb,cACE,YACI,GAAG,SAAS,UAAU,QAAQ,CAAC,KAC/B,aAAa,QAAQ,CAAC;AAAA,YAE5B,gBAAc;AAAA,YACd,oBAAkB,WAAW,YAAY,UAAU;AAAA,YACnD,eACE,SAAS,GAAG,MAAM,UAAU,KAAK,KAAK,mBAAmB,KAAK;AAAA;AAAA,QAElE;AAAA;AAAA,MAlDK;AAAA,IAmDP;AAAA,EAEJ,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACd,KAAK,WAAW;AAAA,MAChB,eAAa,UAAU;AAAA,MACvB,MAAK;AAAA,MACL,mBAAiB,QAAQ,UAAU;AAAA,MACnC,cAAY,CAAC,SAAS,YAAY,YAAY;AAAA,MAE7C;AAAA,iBACC;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,OAAO,MAAM,OAAO,QAAQ;AAAA,YAC5B,UAAU,WAAW,WAAW;AAAA,YAChC,YAAW;AAAA,YAEV;AAAA;AAAA,QACH;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACC,eAAc;AAAA,YACd,KAAK,WAAW;AAAA,YAChB,SAAS;AAAA,YACT,OAAO,gBAAgB,SAAS;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA,QACC,WAAW,aACV;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,MAAK;AAAA,YACL,OAAO,MAAM,OAAO,QAAQ,MAAM;AAAA,YAClC,UAAU,WAAW,WAAW;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["import_react","styled","React","import_styled_components","import_jsx_runtime","styled","import_react","import_styled_components","import_jsx_runtime","styled","import_jsx_runtime","newValue","updatedValue","complete","changeProps"]}
|
package/web/index.mjs
CHANGED
|
@@ -227,6 +227,16 @@ var StyledInput = styled3.input`
|
|
|
227
227
|
&:disabled {
|
|
228
228
|
cursor: not-allowed;
|
|
229
229
|
}
|
|
230
|
+
|
|
231
|
+
/* Override browser autofill background */
|
|
232
|
+
&:-webkit-autofill,
|
|
233
|
+
&:-webkit-autofill:hover,
|
|
234
|
+
&:-webkit-autofill:focus,
|
|
235
|
+
&:-webkit-autofill:active {
|
|
236
|
+
-webkit-box-shadow: 0 0 0 1000px transparent inset !important;
|
|
237
|
+
-webkit-background-clip: text !important;
|
|
238
|
+
-webkit-text-fill-color: ${(props) => props.color || "inherit"} !important;
|
|
239
|
+
}
|
|
230
240
|
`;
|
|
231
241
|
var InputPrimitive = forwardRef(
|
|
232
242
|
({
|
|
@@ -491,7 +501,7 @@ var InputPin = ({
|
|
|
491
501
|
Box,
|
|
492
502
|
{
|
|
493
503
|
flexDirection: "column",
|
|
494
|
-
gap:
|
|
504
|
+
gap: sizeStyles.fieldGap,
|
|
495
505
|
"data-testid": testID || "input-pin",
|
|
496
506
|
role: "group",
|
|
497
507
|
"aria-labelledby": label ? labelId : void 0,
|
package/web/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/InputPin.tsx","../../../primitives-web/src/Box.tsx","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/Input.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, useCallback } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, InputPrimitive } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, useId } from \"@xsolla/xui-core\";\n\nexport interface OnInputPinCompleteProps {\n isComplete: boolean;\n value: string;\n}\n\nexport interface InputPinProps {\n /** Current value of the input pin */\n value?: string;\n /** Function that will be called when the input value changes */\n onChange?: (props: OnInputPinCompleteProps) => void;\n /** Function that will be called when the input is completed */\n onComplete?: (props: OnInputPinCompleteProps) => void;\n /** The length of the code to be input. Default is 4 */\n codeLength?: number;\n /** @deprecated Use codeLength instead */\n length?: number;\n /** Property for changing the size of the input */\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n /** @deprecated Use disabled and error props instead */\n state?: \"default\" | \"hover\" | \"disable\" | \"error\";\n /** Property for disabling the control */\n disabled?: boolean;\n /** Property for displaying an error state */\n error?: boolean;\n /** Property for displaying a label above the input */\n label?: string;\n /** Property for displaying an error message */\n errorMessage?: string;\n /** @deprecated Use errorMessage instead */\n errorLabel?: string;\n /** Whether to hide the text (like a password field) */\n secureTextEntry?: boolean;\n /** Show dot placeholders in empty inputs */\n showPlaceholderDots?: boolean;\n /** Expands input cells to fill the width of the container */\n flexibleWidth?: boolean;\n /** Boolean value indicating if the input is filled or not */\n isComplete?: boolean;\n /** The current focused input index */\n currentFocus?: number;\n /** Function to add a ref to an input element */\n addRef?: (index: number) => (element: HTMLInputElement | null) => void;\n /** Test identifier for the component */\n testID?: string;\n /** Accessible label for screen readers (use when no visible label) */\n \"aria-label\"?: string;\n}\n\nexport const InputPin: React.FC<InputPinProps> = ({\n value = \"\",\n onChange,\n onComplete,\n codeLength,\n length = 4,\n size = \"md\",\n state: externalState,\n disabled: disabledProp,\n error: errorProp,\n label,\n errorMessage,\n errorLabel,\n secureTextEntry = false,\n showPlaceholderDots = true,\n flexibleWidth = false,\n isComplete: isCompleteProp,\n currentFocus,\n addRef,\n testID,\n \"aria-label\": ariaLabel,\n}) => {\n const { theme } = useDesignSystem();\n const uniqueId = useId();\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const [internalValue, setInternalValue] = useState(value);\n\n // Support both codeLength (new) and length (deprecated)\n const actualLength = codeLength ?? length;\n\n // Support both errorMessage (new) and errorLabel (deprecated)\n const errorText = errorMessage ?? errorLabel;\n\n // Support both new props and deprecated state prop\n // Error state is true if error prop is set, or errorMessage is provided, or state is \"error\"\n const isError = errorProp ?? (!!errorText || externalState === \"error\");\n const isDisabled = disabledProp ?? externalState === \"disable\";\n const isHover = externalState === \"hover\";\n const sizeStyles = theme.sizing.inputPin(size);\n const inputColors = theme.colors.control.input;\n\n const inputs = useRef<(HTMLInputElement | null)[]>([]);\n\n // Sync internal value with external value\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n // Handle currentFocus prop\n useEffect(() => {\n if (\n currentFocus !== undefined &&\n currentFocus >= 0 &&\n currentFocus < actualLength\n ) {\n inputs.current[currentFocus]?.focus();\n }\n }, [currentFocus, actualLength]);\n\n // Calculate isComplete status\n const checkIsComplete = useCallback(\n (val: string) => val.length >= actualLength,\n [actualLength]\n );\n\n // IDs for accessibility\n const labelId = `${uniqueId}-label`;\n const errorId = `${uniqueId}-error`;\n\n const handleTextChange = (text: string, index: number) => {\n // Filter to only alphanumeric characters\n const sanitizedText = text.replace(/[^0-9a-zA-Z]/g, \"\");\n\n // Handle multi-character input (paste on React Native)\n if (sanitizedText.length > 1) {\n const pastedData = sanitizedText.slice(0, actualLength - index);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n // Fill in characters starting from current index\n for (let i = 0; i < pastedData.length && index + i < actualLength; i++) {\n newValue[index + i] = pastedData[i];\n }\n\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the next empty input or the last input\n const nextIndex = Math.min(index + pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n return;\n }\n\n // Handle single character input\n const char = sanitizedText.slice(-1);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n newValue[index] = char;\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n if (char && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handleKeyDown = (\n e: React.KeyboardEvent<HTMLInputElement>,\n index: number\n ) => {\n if (e.key === \"Backspace\") {\n if (!internalValue[index] && index > 0) {\n inputs.current[index - 1]?.focus();\n }\n } else if (e.key === \"ArrowLeft\" && index > 0) {\n inputs.current[index - 1]?.focus();\n } else if (e.key === \"ArrowRight\" && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pastedData = e.clipboardData\n .getData(\"text\")\n .replace(/[^0-9a-zA-Z]/g, \"\")\n .slice(0, actualLength);\n setInternalValue(pastedData);\n\n const complete = checkIsComplete(pastedData);\n const changeProps = { isComplete: complete, value: pastedData };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the last filled input or the first empty one\n const nextIndex = Math.min(pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n };\n\n // Handler for storing refs that can be provided to addRef prop\n const handleRef = (index: number) => (element: HTMLInputElement | null) => {\n inputs.current[index] = element;\n addRef?.(index)(element);\n };\n\n const pinItems = Array.from({ length: actualLength }).map((_, index) => {\n const char = internalValue[index] || \"\";\n const isFocused = focusedIndex === index;\n\n let backgroundColor = inputColors.bg;\n let borderColor = inputColors.border;\n\n if (isDisabled) {\n backgroundColor = inputColors.bgDisable;\n borderColor = inputColors.borderDisable;\n } else if (isError) {\n borderColor = theme.colors.border.alert;\n backgroundColor = isFocused\n ? theme.colors.control.focus.bg\n : inputColors.bg;\n } else if (isFocused) {\n backgroundColor = theme.colors.control.focus.bg;\n borderColor = theme.colors.content.brand.secondary;\n } else if (isHover) {\n backgroundColor = inputColors.bgHover;\n borderColor = inputColors.borderHover;\n } else {\n backgroundColor = inputColors.bg;\n borderColor = inputColors.border;\n }\n\n const textColor = isDisabled ? inputColors.textDisable : inputColors.text;\n\n return (\n <Box\n key={index}\n width={flexibleWidth ? undefined : sizeStyles.size}\n height={sizeStyles.size}\n flex={flexibleWidth ? 1 : undefined}\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n borderWidth={sizeStyles.borderWidth}\n borderRadius={sizeStyles.radius}\n alignItems=\"center\"\n justifyContent=\"center\"\n hoverStyle={\n !isDisabled && !isFocused && !isError\n ? {\n backgroundColor: inputColors.bgHover,\n borderColor: inputColors.borderHover,\n }\n : undefined\n }\n >\n <InputPrimitive\n ref={\n addRef\n ? handleRef(index)\n : (el: any) => (inputs.current[index] = el)\n }\n value={char}\n placeholder={showPlaceholderDots && !isFocused ? \"•\" : undefined}\n onChangeText={(text: string) => handleTextChange(text, index)}\n onFocus={() => setFocusedIndex(index)}\n onBlur={() => setFocusedIndex(null)}\n onKeyDown={(e: any) => handleKeyDown(e, index)}\n disabled={isDisabled}\n secureTextEntry={secureTextEntry}\n color={textColor}\n placeholderTextColor={inputColors.placeholder}\n fontSize={sizeStyles.fontSize}\n style={{ textAlign: \"center\" }}\n maxLength={1}\n inputMode=\"numeric\"\n autoComplete=\"one-time-code\"\n aria-label={\n ariaLabel\n ? `${ariaLabel} digit ${index + 1}`\n : `PIN digit ${index + 1}`\n }\n aria-invalid={isError}\n aria-describedby={isError && errorText ? errorId : undefined}\n data-testid={\n testID ? `${testID}-input-${index}` : `input-pin-input-${index}`\n }\n />\n </Box>\n );\n });\n\n return (\n <Box\n flexDirection=\"column\"\n gap={8}\n data-testid={testID || \"input-pin\"}\n role=\"group\"\n aria-labelledby={label ? labelId : undefined}\n aria-label={!label && ariaLabel ? ariaLabel : undefined}\n >\n {label && (\n <Text\n id={labelId}\n color={theme.colors.content.secondary}\n fontSize={sizeStyles.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n )}\n <Box\n flexDirection=\"row\"\n gap={sizeStyles.gap}\n onPaste={handlePaste}\n width={flexibleWidth ? \"100%\" : undefined}\n >\n {pinItems}\n </Box>\n {isError && errorText && (\n <Text\n id={errorId}\n role=\"alert\"\n color={theme.colors.content.alert.primary}\n fontSize={sizeStyles.fontSize - 2}\n >\n {errorText}\n </Text>\n )}\n </Box>\n );\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledBox = styled.div<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n type,\n disabled,\n id,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n as={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledText = styled.span<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n numberOfLines: _numberOfLines,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","import React, { forwardRef } from \"react\";\nimport styled from \"styled-components\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledInput = styled.input<InputPrimitiveProps>`\n background: transparent;\n border: none;\n outline: none;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-family: inherit;\n text-align: inherit;\n\n &::placeholder {\n color: ${(props) =>\n props.placeholderTextColor || \"rgba(255, 255, 255, 0.5)\"};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const InputPrimitive = forwardRef<HTMLInputElement, 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 ...rest\n },\n ref\n ) => {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(e);\n }\n if (onChangeText) {\n onChangeText(e.target.value);\n }\n };\n\n // Always pass value to make it a controlled input\n const inputValue = value !== undefined ? value : \"\";\n\n return (\n <StyledInput\n ref={ref}\n id={id}\n value={inputValue}\n name={name}\n placeholder={placeholder}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n disabled={disabled}\n type={secureTextEntry ? \"password\" : type || \"text\"}\n inputMode={inputMode}\n autoComplete={autoComplete}\n style={style}\n color={color}\n fontSize={fontSize}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\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 {...rest}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n"],"mappings":";AAAA,SAAgB,UAAU,QAAQ,WAAW,mBAAmB;;;ACAhE,OAAO,WAAW;AAClB,OAAO,YAAY;AAuMX;AApMR,IAAM,YAAY,OAAO;AAAA;AAAA;AAAA,sBAGH,CAAC,UAAU,MAAM,mBAAmB,aAAa;AAAA,kBACrD,CAAC,UAAU,MAAM,eAAe,aAAa;AAAA,kBAC7C,CAAC,UACf,OAAO,MAAM,gBAAgB,WACzB,GAAG,MAAM,WAAW,OACpB,MAAM,eAAe,CAAC;AAAA;AAAA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MAE7C;AAAA,iBACC,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,OAAO,MAAM,OAAO,QAAQ;AAAA,YAC5B,UAAU,WAAW,WAAW;AAAA,YAChC,YAAW;AAAA,YAEV;AAAA;AAAA,QACH;AAAA,QAEF,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,eAAc;AAAA,YACd,KAAK,WAAW;AAAA,YAChB,SAAS;AAAA,YACT,OAAO,gBAAgB,SAAS;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA,QACC,WAAW,aACV,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,MAAK;AAAA,YACL,OAAO,MAAM,OAAO,QAAQ,MAAM;AAAA,YAClC,UAAU,WAAW,WAAW;AAAA,YAE/B;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["styled","jsx","styled","jsx","jsx","newValue","updatedValue","complete","changeProps"]}
|
|
1
|
+
{"version":3,"sources":["../../src/InputPin.tsx","../../../primitives-web/src/Box.tsx","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/Input.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, useCallback } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, InputPrimitive } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, useId } from \"@xsolla/xui-core\";\n\nexport interface OnInputPinCompleteProps {\n isComplete: boolean;\n value: string;\n}\n\nexport interface InputPinProps {\n /** Current value of the input pin */\n value?: string;\n /** Function that will be called when the input value changes */\n onChange?: (props: OnInputPinCompleteProps) => void;\n /** Function that will be called when the input is completed */\n onComplete?: (props: OnInputPinCompleteProps) => void;\n /** The length of the code to be input. Default is 4 */\n codeLength?: number;\n /** @deprecated Use codeLength instead */\n length?: number;\n /** Property for changing the size of the input */\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n /** @deprecated Use disabled and error props instead */\n state?: \"default\" | \"hover\" | \"disable\" | \"error\";\n /** Property for disabling the control */\n disabled?: boolean;\n /** Property for displaying an error state */\n error?: boolean;\n /** Property for displaying a label above the input */\n label?: string;\n /** Property for displaying an error message */\n errorMessage?: string;\n /** @deprecated Use errorMessage instead */\n errorLabel?: string;\n /** Whether to hide the text (like a password field) */\n secureTextEntry?: boolean;\n /** Show dot placeholders in empty inputs */\n showPlaceholderDots?: boolean;\n /** Expands input cells to fill the width of the container */\n flexibleWidth?: boolean;\n /** Boolean value indicating if the input is filled or not */\n isComplete?: boolean;\n /** The current focused input index */\n currentFocus?: number;\n /** Function to add a ref to an input element */\n addRef?: (index: number) => (element: HTMLInputElement | null) => void;\n /** Test identifier for the component */\n testID?: string;\n /** Accessible label for screen readers (use when no visible label) */\n \"aria-label\"?: string;\n}\n\nexport const InputPin: React.FC<InputPinProps> = ({\n value = \"\",\n onChange,\n onComplete,\n codeLength,\n length = 4,\n size = \"md\",\n state: externalState,\n disabled: disabledProp,\n error: errorProp,\n label,\n errorMessage,\n errorLabel,\n secureTextEntry = false,\n showPlaceholderDots = true,\n flexibleWidth = false,\n isComplete: isCompleteProp,\n currentFocus,\n addRef,\n testID,\n \"aria-label\": ariaLabel,\n}) => {\n const { theme } = useDesignSystem();\n const uniqueId = useId();\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const [internalValue, setInternalValue] = useState(value);\n\n // Support both codeLength (new) and length (deprecated)\n const actualLength = codeLength ?? length;\n\n // Support both errorMessage (new) and errorLabel (deprecated)\n const errorText = errorMessage ?? errorLabel;\n\n // Support both new props and deprecated state prop\n // Error state is true if error prop is set, or errorMessage is provided, or state is \"error\"\n const isError = errorProp ?? (!!errorText || externalState === \"error\");\n const isDisabled = disabledProp ?? externalState === \"disable\";\n const isHover = externalState === \"hover\";\n const sizeStyles = theme.sizing.inputPin(size);\n const inputColors = theme.colors.control.input;\n\n const inputs = useRef<(HTMLInputElement | null)[]>([]);\n\n // Sync internal value with external value\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n // Handle currentFocus prop\n useEffect(() => {\n if (\n currentFocus !== undefined &&\n currentFocus >= 0 &&\n currentFocus < actualLength\n ) {\n inputs.current[currentFocus]?.focus();\n }\n }, [currentFocus, actualLength]);\n\n // Calculate isComplete status\n const checkIsComplete = useCallback(\n (val: string) => val.length >= actualLength,\n [actualLength]\n );\n\n // IDs for accessibility\n const labelId = `${uniqueId}-label`;\n const errorId = `${uniqueId}-error`;\n\n const handleTextChange = (text: string, index: number) => {\n // Filter to only alphanumeric characters\n const sanitizedText = text.replace(/[^0-9a-zA-Z]/g, \"\");\n\n // Handle multi-character input (paste on React Native)\n if (sanitizedText.length > 1) {\n const pastedData = sanitizedText.slice(0, actualLength - index);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n // Fill in characters starting from current index\n for (let i = 0; i < pastedData.length && index + i < actualLength; i++) {\n newValue[index + i] = pastedData[i];\n }\n\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the next empty input or the last input\n const nextIndex = Math.min(index + pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n return;\n }\n\n // Handle single character input\n const char = sanitizedText.slice(-1);\n const newValue = internalValue.split(\"\");\n\n // Ensure the array has the correct length\n while (newValue.length < actualLength) {\n newValue.push(\"\");\n }\n\n newValue[index] = char;\n const updatedValue = newValue.slice(0, actualLength).join(\"\");\n setInternalValue(updatedValue);\n\n const complete = checkIsComplete(updatedValue);\n const changeProps = { isComplete: complete, value: updatedValue };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n if (char && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handleKeyDown = (\n e: React.KeyboardEvent<HTMLInputElement>,\n index: number\n ) => {\n if (e.key === \"Backspace\") {\n if (!internalValue[index] && index > 0) {\n inputs.current[index - 1]?.focus();\n }\n } else if (e.key === \"ArrowLeft\" && index > 0) {\n inputs.current[index - 1]?.focus();\n } else if (e.key === \"ArrowRight\" && index < actualLength - 1) {\n inputs.current[index + 1]?.focus();\n }\n };\n\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pastedData = e.clipboardData\n .getData(\"text\")\n .replace(/[^0-9a-zA-Z]/g, \"\")\n .slice(0, actualLength);\n setInternalValue(pastedData);\n\n const complete = checkIsComplete(pastedData);\n const changeProps = { isComplete: complete, value: pastedData };\n\n onChange?.(changeProps);\n\n if (complete) {\n onComplete?.(changeProps);\n }\n\n // Focus the last filled input or the first empty one\n const nextIndex = Math.min(pastedData.length, actualLength - 1);\n inputs.current[nextIndex]?.focus();\n };\n\n // Handler for storing refs that can be provided to addRef prop\n const handleRef = (index: number) => (element: HTMLInputElement | null) => {\n inputs.current[index] = element;\n addRef?.(index)(element);\n };\n\n const pinItems = Array.from({ length: actualLength }).map((_, index) => {\n const char = internalValue[index] || \"\";\n const isFocused = focusedIndex === index;\n\n let backgroundColor = inputColors.bg;\n let borderColor = inputColors.border;\n\n if (isDisabled) {\n backgroundColor = inputColors.bgDisable;\n borderColor = inputColors.borderDisable;\n } else if (isError) {\n borderColor = theme.colors.border.alert;\n backgroundColor = isFocused\n ? theme.colors.control.focus.bg\n : inputColors.bg;\n } else if (isFocused) {\n backgroundColor = theme.colors.control.focus.bg;\n borderColor = theme.colors.content.brand.secondary;\n } else if (isHover) {\n backgroundColor = inputColors.bgHover;\n borderColor = inputColors.borderHover;\n } else {\n backgroundColor = inputColors.bg;\n borderColor = inputColors.border;\n }\n\n const textColor = isDisabled ? inputColors.textDisable : inputColors.text;\n\n return (\n <Box\n key={index}\n width={flexibleWidth ? undefined : sizeStyles.size}\n height={sizeStyles.size}\n flex={flexibleWidth ? 1 : undefined}\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n borderWidth={sizeStyles.borderWidth}\n borderRadius={sizeStyles.radius}\n alignItems=\"center\"\n justifyContent=\"center\"\n hoverStyle={\n !isDisabled && !isFocused && !isError\n ? {\n backgroundColor: inputColors.bgHover,\n borderColor: inputColors.borderHover,\n }\n : undefined\n }\n >\n <InputPrimitive\n ref={\n addRef\n ? handleRef(index)\n : (el: any) => (inputs.current[index] = el)\n }\n value={char}\n placeholder={showPlaceholderDots && !isFocused ? \"•\" : undefined}\n onChangeText={(text: string) => handleTextChange(text, index)}\n onFocus={() => setFocusedIndex(index)}\n onBlur={() => setFocusedIndex(null)}\n onKeyDown={(e: any) => handleKeyDown(e, index)}\n disabled={isDisabled}\n secureTextEntry={secureTextEntry}\n color={textColor}\n placeholderTextColor={inputColors.placeholder}\n fontSize={sizeStyles.fontSize}\n style={{ textAlign: \"center\" }}\n maxLength={1}\n inputMode=\"numeric\"\n autoComplete=\"one-time-code\"\n aria-label={\n ariaLabel\n ? `${ariaLabel} digit ${index + 1}`\n : `PIN digit ${index + 1}`\n }\n aria-invalid={isError}\n aria-describedby={isError && errorText ? errorId : undefined}\n data-testid={\n testID ? `${testID}-input-${index}` : `input-pin-input-${index}`\n }\n />\n </Box>\n );\n });\n\n return (\n <Box\n flexDirection=\"column\"\n gap={sizeStyles.fieldGap}\n data-testid={testID || \"input-pin\"}\n role=\"group\"\n aria-labelledby={label ? labelId : undefined}\n aria-label={!label && ariaLabel ? ariaLabel : undefined}\n >\n {label && (\n <Text\n id={labelId}\n color={theme.colors.content.secondary}\n fontSize={sizeStyles.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n )}\n <Box\n flexDirection=\"row\"\n gap={sizeStyles.gap}\n onPaste={handlePaste}\n width={flexibleWidth ? \"100%\" : undefined}\n >\n {pinItems}\n </Box>\n {isError && errorText && (\n <Text\n id={errorId}\n role=\"alert\"\n color={theme.colors.content.alert.primary}\n fontSize={sizeStyles.fontSize - 2}\n >\n {errorText}\n </Text>\n )}\n </Box>\n );\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledBox = styled.div<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n type,\n disabled,\n id,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n as={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledText = styled.span<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n numberOfLines: _numberOfLines,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","import React, { forwardRef } from \"react\";\nimport styled from \"styled-components\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledInput = styled.input<InputPrimitiveProps>`\n background: transparent;\n border: none;\n outline: none;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-family: inherit;\n text-align: inherit;\n\n &::placeholder {\n color: ${(props) =>\n props.placeholderTextColor || \"rgba(255, 255, 255, 0.5)\"};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n\n /* Override browser autofill background */\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n -webkit-box-shadow: 0 0 0 1000px transparent inset !important;\n -webkit-background-clip: text !important;\n -webkit-text-fill-color: ${(props) => props.color || \"inherit\"} !important;\n }\n`;\n\nexport const InputPrimitive = forwardRef<HTMLInputElement, 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 ...rest\n },\n ref\n ) => {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(e);\n }\n if (onChangeText) {\n onChangeText(e.target.value);\n }\n };\n\n // Always pass value to make it a controlled input\n const inputValue = value !== undefined ? value : \"\";\n\n return (\n <StyledInput\n ref={ref}\n id={id}\n value={inputValue}\n name={name}\n placeholder={placeholder}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n disabled={disabled}\n type={secureTextEntry ? \"password\" : type || \"text\"}\n inputMode={inputMode}\n autoComplete={autoComplete}\n style={style}\n color={color}\n fontSize={fontSize}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\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 {...rest}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n"],"mappings":";AAAA,SAAgB,UAAU,QAAQ,WAAW,mBAAmB;;;ACAhE,OAAO,WAAW;AAClB,OAAO,YAAY;AAuMX;AApMR,IAAM,YAAY,OAAO;AAAA;AAAA;AAAA,sBAGH,CAAC,UAAU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