@xsolla/xui-color-picker 0.72.0 → 0.73.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 +6 -6
- package/web/index.js +1 -1
- package/web/index.js.map +1 -1
- package/web/index.mjs +1 -1
- package/web/index.mjs.map +1 -1
package/native/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ColorPicker.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Spinner.tsx","../../../primitives-native/src/Icon.tsx","../../../primitives-native/src/Divider.tsx","../../../primitives-native/src/Input.tsx","../../../primitives-native/src/TextArea.tsx","../../src/ColorPickerArea.tsx","../../src/colorUtils.ts","../../src/utils.ts","../../src/ColorPickerSlider.tsx","../../src/ColorPickerInput.tsx","../../src/ColorPickerHexInput.tsx","../../src/ColorPickerEyedropper.tsx"],"sourcesContent":["import React, { forwardRef, useRef, useState } from \"react\";\n// @ts-ignore\nimport { Box, Icon } from \"@xsolla/xui-primitives\";\n// @ts-ignore\nimport { Select } from \"@xsolla/xui-select\";\n// @ts-ignore\nimport { IconButton } from \"@xsolla/xui-button\";\nimport { useDesignSystem, isNative } from \"@xsolla/xui-core\";\nimport { ColorPickerArea } from \"./ColorPickerArea\";\nimport { ColorPickerSlider } from \"./ColorPickerSlider\";\nimport { ColorPickerInput } from \"./ColorPickerInput\";\nimport { ColorPickerHexInput } from \"./ColorPickerHexInput\";\nimport { ColorPickerEyedropper } from \"./ColorPickerEyedropper\";\nimport { parseColor, type ColorChannel, type ColorValue } from \"./colorUtils\";\nimport type { ColorFormat, ColorPickerProps, InputColorFormat } from \"./types\";\nimport { useUpdatableState } from \"./utils\";\n\nconst DEFAULT_VALUE = \"#66E6FFFF\";\n\nconst supportedFormats: InputColorFormat[] = [\"hex\", \"hsl\", \"rgb\", \"hsb\"];\n\nconst addAlfaToChannel = (\n channelName: InputColorFormat,\n alpha: boolean\n): ColorFormat => (alpha ? `${channelName}a` : channelName) as ColorFormat;\n\nconst removeAlfaFromChannel = (channelName: ColorFormat): InputColorFormat =>\n channelName.slice(0, 3) as InputColorFormat;\n\nconst CopyIcon = () => (\n <svg\n viewBox=\"0 0 24 24\"\n width={18}\n height={18}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\" />\n <path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\" />\n </svg>\n);\n\nconst CheckIcon = () => (\n <svg\n viewBox=\"0 0 24 24\"\n width={18}\n height={18}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n);\n\nconst ResetIcon = () => (\n <svg\n viewBox=\"0 0 24 24\"\n width={18}\n height={18}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <polyline points=\"3 3 3 8 8 8\" />\n </svg>\n);\n\nexport const ColorPicker = forwardRef<any, ColorPickerProps>(\n (\n {\n colorFormat: defaultColorFormat = \"hex\",\n alpha = true,\n value: propValue,\n onChange,\n selectableFormats = supportedFormats,\n copiedIcon,\n eyedropper = false,\n bottomContent,\n testID,\n },\n ref\n ) => {\n const { theme } = useDesignSystem();\n const prevColorRef = useRef(propValue);\n const prevHueRef = useRef<number | null>(null);\n\n const [innerValue, setInnerValue] = useUpdatableState<ColorValue>(\n (prevState) => {\n if (prevColorRef.current === propValue && prevState) return prevState;\n const parsedColor = parseColor(propValue || DEFAULT_VALUE);\n return parsedColor;\n },\n [propValue],\n true\n );\n\n const [initialValue] = useState<ColorValue>(() => innerValue);\n const [isValueCopied, setValueCopied] = useState(false);\n\n const [colorFormat, setColorFormat] = useUpdatableState<ColorFormat>(\n () => addAlfaToChannel(defaultColorFormat, alpha),\n [defaultColorFormat, alpha],\n true\n );\n\n const handleChange = (\n newColorString: string,\n currentFormat: ColorFormat = colorFormat\n ) => {\n if (!newColorString) return;\n const newColor = parseColor(newColorString);\n const valueInInitialFormat = newColor.toString(\n addAlfaToChannel(defaultColorFormat, alpha)\n );\n const valueInCurrentFormat = newColor.toString(currentFormat);\n\n setInnerValue(newColor);\n prevColorRef.current = valueInInitialFormat;\n\n onChange?.({\n valueInInitialFormat,\n currentColorFormat: removeAlfaFromChannel(currentFormat),\n valueInCurrentFormat,\n });\n };\n\n const handleChangeFormat = (newFormat: string) => {\n setColorFormat(newFormat as ColorFormat);\n handleChange(innerValue.toString(), newFormat as ColorFormat);\n };\n\n const onCopy = async () => {\n if (isNative) {\n // Native clipboard needs a library like react-native-clipboard\n console.warn(\"Clipboard not yet implemented for native\");\n return;\n }\n try {\n await navigator.clipboard.writeText(innerValue.toString(colorFormat));\n setValueCopied(true);\n setTimeout(() => setValueCopied(false), 2000);\n } catch (err) {\n console.error(\"Failed to copy:\", err);\n }\n };\n\n const onReset = () => handleChange(initialValue.toString());\n\n const selectFormatOptions = selectableFormats\n .map((f) => addAlfaToChannel(f, alpha))\n .map((f) => ({\n label: f.toUpperCase(),\n value: f,\n }));\n\n const channels: ColorChannel[] = colorFormat.includes(\"hex\")\n ? []\n : colorFormat.includes(\"rgb\")\n ? [\"red\", \"green\", \"blue\"]\n : colorFormat.includes(\"hsl\")\n ? [\"hue\", \"saturation\", \"lightness\"]\n : [\"hue\", \"saturation\", \"brightness\"];\n\n return (\n <Box\n ref={ref}\n testID={testID}\n backgroundColor={theme.colors.background.secondary}\n borderRadius={8}\n padding={16}\n gap={16}\n width={312}\n style={{ boxShadow: \"0px 4px 16px 0px rgba(7, 7, 8, 0.1)\" }}\n >\n <ColorPickerArea\n value={innerValue.toString()}\n onChange={handleChange}\n />\n\n <Box flexDirection=\"row\" gap={8} alignItems=\"center\">\n {eyedropper && <ColorPickerEyedropper onColorPick={handleChange} />}\n <Box flex={1} gap={8}>\n <ColorPickerSlider\n channel=\"hue\"\n value={innerValue.toString()}\n onChange={handleChange}\n />\n {alpha && (\n <ColorPickerSlider\n channel=\"alpha\"\n value={innerValue.toString()}\n onChange={handleChange}\n />\n )}\n </Box>\n </Box>\n\n <Box flexDirection=\"row\" gap={8} alignItems=\"center\">\n <Box width={80}>\n <Select\n size=\"sm\"\n // @ts-ignore\n options={selectFormatOptions}\n value={colorFormat}\n onValueChange={handleChangeFormat}\n />\n </Box>\n\n <Box flex={1} flexDirection=\"row\" gap={4}>\n {colorFormat.includes(\"hex\") ? (\n <ColorPickerHexInput\n value={innerValue.toString(colorFormat)}\n onChange={handleChange}\n />\n ) : (\n channels.map((channel) => (\n <ColorPickerInput\n key={channel}\n value={innerValue}\n valueType={\n innerValue.getChannelRange(channel).maxValue === 100\n ? \"percentage\"\n : \"number\"\n }\n channel={channel}\n onChange={handleChange}\n />\n ))\n )}\n {alpha && (\n <ColorPickerInput\n channel=\"alpha\"\n value={innerValue}\n valueType=\"percentage\"\n onChange={handleChange}\n />\n )}\n </Box>\n\n <Box flexDirection=\"row\" gap={4}>\n <IconButton\n size=\"sm\"\n variant=\"secondary\"\n tone=\"mono\"\n onPress={onCopy}\n icon={isValueCopied ? copiedIcon || <CheckIcon /> : <CopyIcon />}\n aria-label=\"Copy color\"\n />\n <IconButton\n size=\"sm\"\n variant=\"secondary\"\n tone=\"mono\"\n onPress={onReset}\n icon={<ResetIcon />}\n aria-label=\"Reset color\"\n />\n </Box>\n </Box>\n\n {bottomContent}\n </Box>\n );\n }\n);\n\nColorPicker.displayName = \"ColorPicker\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n alignItems,\n justifyContent,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": _ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": _ariaDisabled,\n \"aria-live\": _ariaLive,\n className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport { Text as RNText, TextStyle, AccessibilityRole } from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web roles to React Native accessibility roles\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n id,\n role,\n ...props\n}) => {\n // Extract the first font name from a comma-separated list (e.g. for web-style font stacks)\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n // On native, if we don't have the custom font loaded, it's better to use the system font\n // to avoid rendering issues or missing text.\n if (resolvedFontFamily === \"Pilat Wide Bold\") {\n resolvedFontFamily = undefined;\n }\n\n const style: TextStyle = {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n };\n\n // Map role to React Native accessibilityRole\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText style={style} testID={id} accessibilityRole={accessibilityRole}>\n {children}\n </RNText>\n );\n};\n","import type React from \"react\";\nimport { ActivityIndicator, View } from \"react-native\";\nimport type { SpinnerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Spinner: React.FC<SpinnerProps> = ({\n color,\n size,\n role,\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive,\n \"aria-describedby\": ariaDescribedBy,\n testID,\n}) => {\n return (\n <View\n accessible={true}\n accessibilityRole={role === \"status\" ? \"none\" : undefined}\n accessibilityLabel={ariaLabel}\n accessibilityLiveRegion={\n ariaLive === \"polite\"\n ? \"polite\"\n : ariaLive === \"assertive\"\n ? \"assertive\"\n : \"none\"\n }\n testID={testID}\n >\n <ActivityIndicator\n color={color}\n size={typeof size === \"number\" ? size : \"small\"}\n />\n </View>\n );\n};\n\nSpinner.displayName = \"Spinner\";\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({ children, color, size }) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n // @ts-ignore - passing color down to potential Text/Icon children\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return <View style={style}>{childrenWithProps}</View>;\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { DividerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Divider: React.FC<DividerProps> = ({\n color,\n height,\n width,\n vertical,\n dashStroke,\n}) => {\n const style: ViewStyle = {\n backgroundColor: dashStroke\n ? \"transparent\"\n : color || \"rgba(255, 255, 255, 0.15)\",\n width: vertical ? (typeof width === \"number\" ? width : 1) : \"100%\",\n height: vertical ? \"100%\" : typeof height === \"number\" ? height : 1,\n ...(dashStroke && {\n borderStyle: \"dashed\",\n borderColor: color || \"rgba(255, 255, 255, 0.15)\",\n borderWidth: 0,\n ...(vertical\n ? { borderLeftWidth: typeof width === \"number\" ? width : 1 }\n : { borderTopWidth: typeof height === \"number\" ? height : 1 }),\n }),\n };\n\n return <View style={style} />;\n};\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web input types to React Native keyboard types\nconst keyboardTypeMap: Record<string, any> = {\n text: \"default\",\n number: \"numeric\",\n email: \"email-address\",\n tel: \"phone-pad\",\n url: \"url\",\n decimal: \"decimal-pad\",\n};\n\n// Map web inputMode to React Native keyboard types\nconst inputModeToKeyboardType: Record<string, any> = {\n none: \"default\",\n text: \"default\",\n decimal: \"decimal-pad\",\n numeric: \"number-pad\",\n tel: \"phone-pad\",\n search: \"default\",\n email: \"email-address\",\n url: \"url\",\n};\n\n// Map web autoComplete to React Native textContentType (iOS)\nconst autoCompleteToTextContentType: Record<string, any> = {\n \"one-time-code\": \"oneTimeCode\",\n email: \"emailAddress\",\n username: \"username\",\n password: \"password\",\n \"new-password\": \"newPassword\",\n tel: \"telephoneNumber\",\n \"postal-code\": \"postalCode\",\n name: \"name\",\n};\n\nexport const InputPrimitive = forwardRef<RNTextInput, InputPrimitiveProps>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n secureTextEntry,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n name,\n type,\n inputMode,\n autoComplete,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n // Create a synthetic event for onChange compatibility\n // Include nativeEvent and no-op methods to prevent runtime errors\n // when consumers expect DOM-like event behavior\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLInputElement>;\n onChange(syntheticEvent);\n }\n };\n\n // Determine keyboard type - inputMode takes precedence over type\n const keyboardType = inputMode\n ? inputModeToKeyboardType[inputMode] || \"default\"\n : type\n ? keyboardTypeMap[type] || \"default\"\n : \"default\";\n\n // Determine textContentType for iOS autofill\n const textContentType = autoComplete\n ? autoCompleteToTextContentType[autoComplete]\n : undefined;\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n // Map onKeyPress to onKeyDown for cross-platform compatibility\n // Include preventDefault to avoid runtime errors when consumers call it\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n secureTextEntry={secureTextEntry || type === \"password\"}\n keyboardType={keyboardType}\n textContentType={textContentType}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n // React Native accessibility props\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { TextAreaPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nexport const TextAreaPrimitive = forwardRef<\n RNTextInput,\n TextAreaPrimitiveProps\n>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n rows,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLTextAreaElement>;\n onChange(syntheticEvent);\n }\n };\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n multiline={true}\n numberOfLines={rows || 4}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlignVertical: \"top\",\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nTextAreaPrimitive.displayName = \"TextAreaPrimitive\";\n","import React, {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type ForwardedRef,\n} from \"react\";\n// @ts-ignore\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, isWeb, isNative } from \"@xsolla/xui-core\";\nimport { createColorFromHsb, parseColor } from \"./colorUtils\";\nimport type { CustomColorAreaProps } from \"./types\";\nimport { clamp, snapValueToStep, useMergedRefs } from \"./utils\";\n\nexport const ColorPickerArea = forwardRef(function CustomColorArea(\n props: CustomColorAreaProps,\n ref: ForwardedRef<any>\n) {\n const {\n xChannelStep = 0.1,\n yChannelStep = 0.1,\n value,\n defaultValue,\n onChange,\n onChangeEnd,\n className,\n } = props;\n\n const internalRef = useRef<any>(null);\n const containerRef = useMergedRefs(ref, internalRef);\n const [layout, setLayout] = useState({ width: 0, height: 0 });\n const [isDragging, setIsDragging] = useState(false);\n const [currentColor, setCurrentColor] = useState(() => {\n const initialValue = value || defaultValue || \"#ffffff\";\n return parseColor(initialValue);\n });\n\n useEffect(() => {\n if (value !== undefined) {\n setCurrentColor(parseColor(value));\n }\n }, [value]);\n\n const hsb = currentColor.toHsb();\n const hue = hsb.h;\n\n const saturation = hsb.s * 100;\n const brightness = hsb.b * 100;\n const thumbX = (saturation / 100) * 100;\n const thumbY = 100 - (brightness / 100) * 100;\n\n const updateColor = useCallback(\n (x: number, y: number) => {\n const newSaturation = snapValueToStep(x * 100, 0, 100, xChannelStep);\n const newBrightness = snapValueToStep(\n (1 - y) * 100,\n 0,\n 100,\n yChannelStep\n );\n\n const newColor = createColorFromHsb(\n hue,\n newSaturation,\n newBrightness,\n hsb.a\n );\n setCurrentColor(newColor);\n onChange?.(newColor.toString());\n return newColor;\n },\n [hue, hsb.a, xChannelStep, yChannelStep, onChange]\n );\n\n // Web mouse handlers\n const handleMouseDown = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isNative) return;\n setIsDragging(true);\n const rect = e.currentTarget.getBoundingClientRect();\n const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);\n const y = clamp((e.clientY - rect.top) / rect.height, 0, 1);\n updateColor(x, y);\n },\n [updateColor]\n );\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n if (!isDragging || isNative) return;\n const rect = (internalRef.current as any)?.getBoundingClientRect?.();\n if (!rect) return;\n const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);\n const y = clamp((e.clientY - rect.top) / rect.height, 0, 1);\n updateColor(x, y);\n },\n [isDragging, updateColor]\n );\n\n const handleMouseUp = useCallback(() => {\n if (isDragging) {\n setIsDragging(false);\n onChangeEnd?.(currentColor.toString());\n }\n }, [isDragging, currentColor, onChangeEnd]);\n\n useEffect(() => {\n if (isWeb && isDragging) {\n document.addEventListener(\"mousemove\", handleMouseMove);\n document.addEventListener(\"mouseup\", handleMouseUp);\n return () => {\n document.removeEventListener(\"mousemove\", handleMouseMove);\n document.removeEventListener(\"mouseup\", handleMouseUp);\n };\n }\n }, [isDragging, handleMouseMove, handleMouseUp]);\n\n // Native responder handlers\n const handleResponderMove = useCallback(\n (e: any) => {\n const { locationX, locationY } = e.nativeEvent;\n const x = clamp(locationX / layout.width, 0, 1);\n const y = clamp(locationY / layout.height, 0, 1);\n updateColor(x, y);\n },\n [layout, updateColor]\n );\n\n const handleResponderRelease = useCallback(() => {\n setIsDragging(false);\n onChangeEnd?.(currentColor.toString());\n }, [currentColor, onChangeEnd]);\n\n const gradientStyle = isWeb\n ? {\n background: `linear-gradient(to top, \n hsl(${hue}, 100%, 0%), \n hsl(${hue}, 100%, 50%)),\n linear-gradient(to right, \n hsla(${hue}, 0%, 50%, 1), \n hsla(${hue}, 100%, 50%, 1))`,\n }\n : {\n backgroundColor: `hsl(${hue}, 100%, 50%)`, // Fallback for native without LinearGradient\n };\n\n const thumbColor = currentColor.toString(\"hex\");\n\n return (\n <Box\n data-testid=\"color-picker-color-area\"\n ref={containerRef}\n className={className}\n borderRadius={8}\n height={240}\n cursor=\"pointer\"\n position=\"relative\"\n style={gradientStyle as any}\n onMouseDown={handleMouseDown}\n onLayout={(e: any) => {\n if (isNative) {\n setLayout(e.nativeEvent.layout);\n }\n }}\n onMoveShouldSetResponder={() => isNative}\n onResponderGrant={(e: any) => {\n setIsDragging(true);\n handleResponderMove(e);\n }}\n onResponderMove={handleResponderMove}\n onResponderRelease={handleResponderRelease}\n onResponderTerminate={handleResponderRelease}\n >\n <Box width=\"100%\" height=\"100%\" position=\"relative\">\n <Box\n data-testid=\"color-picker-color-area-thumb\"\n position=\"absolute\"\n width={16}\n height={16}\n borderRadius={8}\n borderWidth={2}\n borderColor=\"#ffffff\"\n style={\n {\n left: `${thumbX}%`,\n top: `${thumbY}%`,\n transform: isWeb\n ? \"translate(-50%, -50%)\"\n : ([{ translateX: -8 }, { translateY: -8 }] as any),\n backgroundColor: thumbColor,\n boxShadow: \"0 0 4px rgba(0,0,0,0.3)\",\n } as any\n }\n />\n </Box>\n </Box>\n );\n});\n","export type ColorChannel =\n | \"hue\"\n | \"saturation\"\n | \"brightness\"\n | \"lightness\"\n | \"red\"\n | \"green\"\n | \"blue\"\n | \"alpha\";\n\nexport interface ColorValue {\n getChannelValue(channel: ColorChannel): number;\n setChannelValue(channel: ColorChannel, value: number): ColorValue;\n getChannelRange(channel: ColorChannel): {\n minValue: number;\n maxValue: number;\n step: number;\n pageSize: number;\n };\n getColorChannels(): ColorChannel[];\n toFormat(format: string): string;\n toString(format?: string): string;\n toHsb(): { h: number; s: number; b: number; a: number };\n toRgb(): { r: number; g: number; b: number; a: number };\n toHsl(): { h: number; s: number; l: number; a: number };\n}\n\n// Basic color conversion functions\nfunction hsbToRgb(h: number, s: number, b: number, a: number = 1) {\n s /= 100;\n b /= 100;\n const k = (n: number) => (n + h / 60) % 6;\n const f = (n: number) =>\n b * (1 - s * Math.max(0, Math.min(k(n), 4 - k(n), 1)));\n return {\n r: Math.round(255 * f(5)),\n g: Math.round(255 * f(3)),\n b: Math.round(255 * f(1)),\n a,\n };\n}\n\nfunction rgbToHsb(r: number, g: number, b: number, a: number = 1) {\n r /= 255;\n g /= 255;\n b /= 255;\n const v = Math.max(r, g, b);\n const n = v - Math.min(r, g, b);\n const h =\n n === 0\n ? 0\n : n && v === r\n ? (g - b) / n\n : v === g\n ? 2 + (b - r) / n\n : 4 + (r - g) / n;\n return {\n h: Math.round(60 * (h < 0 ? h + 6 : h)),\n s: Math.round(v && (n / v) * 100),\n b: Math.round(v * 100),\n a,\n };\n}\n\nfunction rgbToHex(r: number, g: number, b: number, a: number = 1) {\n const toHex = (n: number) => n.toString(16).padStart(2, \"0\");\n const alpha = a === 1 ? \"\" : toHex(Math.round(a * 255));\n return `#${toHex(r)}${toHex(g)}${toHex(b)}${alpha}`.toUpperCase();\n}\n\nfunction hexToRgb(hex: string) {\n hex = hex.replace(/^#/, \"\");\n if (hex.length === 3)\n hex = hex\n .split(\"\")\n .map((s) => s + s)\n .join(\"\");\n if (hex.length === 4)\n hex = hex\n .split(\"\")\n .map((s) => s + s)\n .join(\"\");\n\n const r = parseInt(hex.slice(0, 2), 16);\n const g = parseInt(hex.slice(2, 4), 16);\n const b = parseInt(hex.slice(4, 6), 16);\n const a = hex.length === 8 ? parseInt(hex.slice(6, 8), 16) / 255 : 1;\n\n return { r, g, b, a: parseFloat(a.toFixed(2)) };\n}\n\nfunction rgbToHsl(r: number, g: number, b: number, a: number = 1) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n let h = 0,\n s = 0,\n l = (max + min) / 2;\n\n if (max !== min) {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n\n return {\n h: Math.round(h * 360),\n s: Math.round(s * 100),\n l: Math.round(l * 100),\n a,\n };\n}\n\nclass ColorValueImpl implements ColorValue {\n private h: number;\n private s: number;\n private b: number;\n private a: number;\n\n constructor(h: number, s: number, b: number, a: number = 1) {\n this.h = h;\n this.s = s;\n this.b = b;\n this.a = a;\n }\n\n getChannelValue(channel: ColorChannel): number {\n switch (channel) {\n case \"hue\":\n return this.h;\n case \"saturation\":\n return this.s;\n case \"brightness\":\n return this.b;\n case \"alpha\":\n return this.a;\n case \"red\":\n return hsbToRgb(this.h, this.s, this.b, this.a).r;\n case \"green\":\n return hsbToRgb(this.h, this.s, this.b, this.a).g;\n case \"blue\":\n return hsbToRgb(this.h, this.s, this.b, this.a).b;\n case \"lightness\":\n return rgbToHsl(\n hsbToRgb(this.h, this.s, this.b, this.a).r,\n hsbToRgb(this.h, this.s, this.b, this.a).g,\n hsbToRgb(this.h, this.s, this.b, this.a).b\n ).l;\n default:\n return 0;\n }\n }\n\n setChannelValue(channel: ColorChannel, value: number): ColorValue {\n if (channel === \"hue\")\n return new ColorValueImpl(value, this.s, this.b, this.a);\n if (channel === \"saturation\")\n return new ColorValueImpl(this.h, value, this.b, this.a);\n if (channel === \"brightness\")\n return new ColorValueImpl(this.h, this.s, value, this.a);\n if (channel === \"alpha\")\n return new ColorValueImpl(this.h, this.s, this.b, value);\n\n // For RGB/HSL channels, convert to RGB, update, then back to HSB\n const rgb = hsbToRgb(this.h, this.s, this.b, this.a);\n if (channel === \"red\") rgb.r = value;\n else if (channel === \"green\") rgb.g = value;\n else if (channel === \"blue\") rgb.b = value;\n\n const hsb = rgbToHsb(rgb.r, rgb.g, rgb.b, rgb.a);\n return new ColorValueImpl(hsb.h, hsb.s, hsb.b, hsb.a);\n }\n\n getChannelRange(channel: ColorChannel) {\n switch (channel) {\n case \"hue\":\n return { minValue: 0, maxValue: 360, step: 1, pageSize: 15 };\n case \"alpha\":\n return { minValue: 0, maxValue: 1, step: 0.01, pageSize: 0.1 };\n case \"red\":\n case \"green\":\n case \"blue\":\n return { minValue: 0, maxValue: 255, step: 1, pageSize: 17 };\n default:\n return { minValue: 0, maxValue: 100, step: 1, pageSize: 10 };\n }\n }\n\n getColorChannels(): ColorChannel[] {\n return [\"red\", \"green\", \"blue\"];\n }\n\n toFormat(format: string): string {\n const rgb = hsbToRgb(this.h, this.s, this.b, this.a);\n if (format === \"hex\" || format === \"hexa\")\n return rgbToHex(rgb.r, rgb.g, rgb.b, this.a);\n if (format === \"rgb\") return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;\n if (format === \"rgba\")\n return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${this.a})`;\n if (format === \"hsl\") {\n const hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);\n return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;\n }\n if (format === \"hsla\") {\n const hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);\n return `hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${this.a})`;\n }\n if (format === \"hsb\") return `hsb(${this.h}, ${this.s}%, ${this.b}%)`;\n if (format === \"hsba\")\n return `hsba(${this.h}, ${this.s}%, ${this.b}%, ${this.a})`;\n return rgbToHex(rgb.r, rgb.g, rgb.b, this.a);\n }\n\n toString(format?: string): string {\n return this.toFormat(format || \"hex\");\n }\n\n toHsb() {\n return { h: this.h, s: this.s / 100, b: this.b / 100, a: this.a };\n }\n toRgb() {\n return hsbToRgb(this.h, this.s, this.b, this.a);\n }\n toHsl() {\n const rgb = this.toRgb();\n return rgbToHsl(rgb.r, rgb.g, rgb.b, this.a);\n }\n}\n\nexport function parseColor(color: string): ColorValue {\n if (color.startsWith(\"#\")) {\n const rgb = hexToRgb(color);\n const hsb = rgbToHsb(rgb.r, rgb.g, rgb.b, rgb.a);\n return new ColorValueImpl(hsb.h, hsb.s, hsb.b, hsb.a);\n }\n // Basic support for hsb/rgb/hsl strings if needed, otherwise default to white\n return new ColorValueImpl(0, 0, 100, 1);\n}\n\nexport function createColorFromHsb(\n h: number,\n s: number,\n b: number,\n a: number = 1\n): ColorValue {\n return new ColorValueImpl(h, s, b, a);\n}\n","import { useRef, useEffect, useState, useCallback } from \"react\";\n\nexport function clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nexport function snapValueToStep(\n value: number,\n min: number | undefined,\n max: number | undefined,\n step: number\n): number {\n const remainder = (value - (min ?? 0)) % step;\n let snappedValue =\n Math.abs(remainder) * 2 >= step\n ? value + Math.sign(remainder) * (step - Math.abs(remainder))\n : value - remainder;\n\n if (min !== undefined && snappedValue < min) {\n snappedValue = min;\n } else if (max !== undefined && snappedValue > max) {\n snappedValue = max;\n }\n\n return snappedValue;\n}\n\nexport function useMergedRefs<T>(...refs: Array<any>) {\n return useCallback((node: T) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref != null) {\n ref.current = node;\n }\n });\n }, refs);\n}\n\nexport function useUpdatableState<T>(\n updater: (prevState: T | undefined) => T,\n deps: any[],\n initialUpdate = false\n): [T, (value: T) => void] {\n const [state, setState] = useState<T>(() => updater(undefined));\n const isFirstRender = useRef(true);\n\n useEffect(() => {\n if (isFirstRender.current && !initialUpdate) {\n isFirstRender.current = false;\n return;\n }\n setState(updater);\n }, deps);\n\n return [state, setState];\n}\n","import React, { useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-ignore\nimport { Box, Icon } from \"@xsolla/xui-primitives\";\nimport { isWeb, isNative, useDesignSystem } from \"@xsolla/xui-core\";\nimport { createColorFromHsb, parseColor } from \"./colorUtils\";\nimport { clamp, snapValueToStep } from \"./utils\";\n\ntype ColorPickerSliderProps = {\n channel: \"hue\" | \"alpha\";\n value: string;\n onChange?: (color: string) => void;\n onChangeEnd?: (color: string) => void;\n};\n\nexport const ColorPickerSlider: React.FC<ColorPickerSliderProps> = ({\n channel,\n value,\n onChange,\n onChangeEnd,\n}) => {\n const { theme } = useDesignSystem();\n const trackRef = useRef<any>(null);\n const [layout, setLayout] = useState({ width: 0, height: 0 });\n const [isDragging, setIsDragging] = useState(false);\n const currentColor = parseColor(value);\n const hsb = currentColor.toHsb();\n\n const getChannelValue = () => {\n if (channel === \"hue\") return hsb.h;\n return hsb.a * 100;\n };\n\n const getMaxValue = () => (channel === \"hue\" ? 360 : 100);\n\n const channelValue = getChannelValue();\n const maxValue = getMaxValue();\n const thumbPosition = (channelValue / maxValue) * 100;\n\n const updateColor = useCallback(\n (x: number) => {\n const newValue = snapValueToStep(x * maxValue, 0, maxValue, 1);\n let newColor;\n if (channel === \"hue\") {\n newColor = createColorFromHsb(\n newValue,\n hsb.s * 100,\n hsb.b * 100,\n hsb.a\n );\n } else {\n newColor = createColorFromHsb(\n hsb.h,\n hsb.s * 100,\n hsb.b * 100,\n newValue / 100\n );\n }\n onChange?.(newColor.toString());\n return newColor;\n },\n [channel, maxValue, hsb, onChange]\n );\n\n // Web mouse handlers\n const handleMouseDown = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isNative) return;\n setIsDragging(true);\n const rect = e.currentTarget.getBoundingClientRect();\n const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);\n updateColor(x);\n },\n [updateColor]\n );\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n if (!isDragging || isNative) return;\n const rect = (trackRef.current as any)?.getBoundingClientRect?.();\n if (!rect) return;\n const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);\n updateColor(x);\n },\n [isDragging, updateColor]\n );\n\n const handleMouseUp = useCallback(() => {\n if (isDragging) {\n setIsDragging(false);\n onChangeEnd?.(currentColor.toString());\n }\n }, [isDragging, currentColor, onChangeEnd]);\n\n useEffect(() => {\n if (isWeb && isDragging) {\n document.addEventListener(\"mousemove\", handleMouseMove);\n document.addEventListener(\"mouseup\", handleMouseUp);\n return () => {\n document.removeEventListener(\"mousemove\", handleMouseMove);\n document.removeEventListener(\"mouseup\", handleMouseUp);\n };\n }\n }, [isDragging, handleMouseMove, handleMouseUp]);\n\n // Native responder handlers\n const handleResponderMove = useCallback(\n (e: any) => {\n const { locationX } = e.nativeEvent;\n const x = clamp(locationX / layout.width, 0, 1);\n updateColor(x);\n },\n [layout, updateColor]\n );\n\n const handleResponderRelease = useCallback(() => {\n setIsDragging(false);\n onChangeEnd?.(currentColor.toString());\n }, [currentColor, onChangeEnd]);\n\n const getGradient = () => {\n if (channel === \"hue\") {\n return \"linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)\";\n }\n const colorHex = currentColor.toString(\"hex\");\n return `linear-gradient(to right, transparent 0%, ${colorHex} 100%)`;\n };\n\n const thumbColor =\n channel === \"hue\"\n ? createColorFromHsb(channelValue, 100, 100, 1).toString(\"hex\")\n : currentColor.toString(\"hex\");\n\n return (\n <Box\n height={12}\n borderRadius={6}\n position=\"relative\"\n style={\n isWeb\n ? { background: getGradient() }\n : ({ backgroundColor: theme.colors.background.primary } as any)\n }\n onLayout={(e: any) => {\n if (isNative) {\n setLayout(e.nativeEvent.layout);\n }\n }}\n onMouseDown={handleMouseDown}\n onMoveShouldSetResponder={() => isNative}\n onResponderGrant={(e: any) => {\n setIsDragging(true);\n handleResponderMove(e);\n }}\n onResponderMove={handleResponderMove}\n onResponderRelease={handleResponderRelease}\n onResponderTerminate={handleResponderRelease}\n >\n <Box ref={trackRef} width=\"100%\" height=\"100%\" position=\"relative\">\n <Box\n position=\"absolute\"\n width={16}\n height={16}\n borderRadius={8}\n borderWidth={2}\n borderColor=\"#ffffff\"\n style={\n {\n left: `${thumbPosition}%`,\n top: \"50%\",\n transform: isWeb\n ? \"translate(-50%, -50%)\"\n : ([{ translateX: -8 }, { translateY: -8 }] as any),\n backgroundColor: thumbColor,\n boxShadow: \"0 0 4px rgba(0,0,0,0.3)\",\n } as any\n }\n />\n </Box>\n </Box>\n );\n};\n","import React, { useEffect, useState } from \"react\";\n// @ts-ignore\nimport { Input } from \"@xsolla/xui-input\";\n// @ts-ignore\nimport { Box } from \"@xsolla/xui-primitives\";\nimport type { ColorChannel, ColorValue } from \"./colorUtils\";\n\ntype ColorPickerInputProps = {\n value: ColorValue;\n valueType: \"number\" | \"percentage\";\n channel: ColorChannel;\n onChange: (color: string) => void;\n};\n\nexport const ColorPickerInput: React.FC<ColorPickerInputProps> = ({\n value,\n valueType,\n channel,\n onChange,\n}) => {\n const channelValue = value.getChannelValue(channel);\n const channelRange = value.getChannelRange(channel);\n const intValue = channel === \"alpha\" ? channelValue * 100 : channelValue;\n const roundedValue = Math.round(intValue);\n\n const [inputValue, setInputValue] = useState(String(roundedValue));\n\n useEffect(() => {\n setInputValue(String(roundedValue));\n }, [roundedValue]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const text = e.target.value.replace(/[^0-9]/g, \"\");\n setInputValue(text);\n\n const parsedValue = parseInt(text, 10);\n if (!isNaN(parsedValue)) {\n let newValue = channel === \"alpha\" ? parsedValue / 100 : parsedValue;\n const min = channel === \"alpha\" ? 0 : channelRange.minValue;\n const max = channel === \"alpha\" ? 100 : channelRange.maxValue;\n\n const clampedValue = Math.min(Math.max(parsedValue, min), max);\n const colorValue =\n channel === \"alpha\" ? clampedValue / 100 : clampedValue;\n\n const newColor = value.setChannelValue(channel, colorValue);\n onChange(newColor.toString());\n }\n };\n\n const handleBlur = () => {\n setInputValue(String(roundedValue));\n };\n\n return (\n <Box flex={1} minWidth={40}>\n <Input\n size=\"sm\"\n value={valueType === \"percentage\" ? `${inputValue}%` : inputValue}\n onChange={handleChange}\n onBlur={handleBlur}\n />\n </Box>\n );\n};\n","import React, { useEffect, useState } from \"react\";\n// @ts-ignore\nimport { Input } from \"@xsolla/xui-input\";\n// @ts-ignore\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { parseColor } from \"./colorUtils\";\n\ntype ColorPickerHexInputProps = {\n value: string;\n onChange: (color: string) => void;\n};\n\nexport const ColorPickerHexInput: React.FC<ColorPickerHexInputProps> = ({\n value,\n onChange,\n}) => {\n const [inputValue, setInputValue] = useState(value);\n\n useEffect(() => {\n setInputValue(value);\n }, [value]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setInputValue(newValue);\n\n try {\n const color = parseColor(newValue);\n if (color) {\n onChange(color.toString(\"hex\"));\n }\n } catch {\n // Invalid color\n }\n };\n\n const handleBlur = () => {\n try {\n const color = parseColor(inputValue);\n if (color) {\n onChange(color.toString(\"hex\"));\n } else {\n setInputValue(value);\n }\n } catch {\n setInputValue(value);\n }\n };\n\n return (\n <Box flex={1}>\n <Input\n size=\"sm\"\n value={inputValue}\n onChange={handleChange}\n onBlur={handleBlur}\n />\n </Box>\n );\n};\n","import React from \"react\";\n// @ts-ignore\nimport { IconButton } from \"@xsolla/xui-button\";\n// @ts-ignore\nimport { Icon } from \"@xsolla/xui-primitives\";\nimport { parseColor } from \"./colorUtils\";\n\nconst DropletIcon = () => (\n <svg\n viewBox=\"0 0 24 24\"\n width={18}\n height={18}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5s-3 3.5-3 5.5a7 7 0 0 0 7 7z\" />\n </svg>\n);\n\ndeclare let EyeDropper: {\n new (): {\n open(): Promise<{ sRGBHex: string }>;\n };\n};\n\ntype Props = {\n onColorPick: (color: string) => void;\n};\n\nexport const ColorPickerEyedropper: React.FC<Props> = ({ onColorPick }) => {\n const onEyedropperButtonClick = () => {\n if (typeof EyeDropper !== \"undefined\") {\n new EyeDropper().open().then((result) => {\n const pickedColor = parseColor(result.sRGBHex);\n const hsb = pickedColor.toHsb();\n const hsbString = `hsb(${Math.round(hsb.h)}, ${Math.round(hsb.s * 100)}%, ${Math.round(hsb.b * 100)}%)`;\n onColorPick(hsbString);\n });\n }\n };\n\n if (typeof EyeDropper === \"undefined\") return null;\n\n return (\n <IconButton\n size=\"sm\"\n variant=\"secondary\"\n tone=\"mono\"\n onPress={onEyedropperButtonClick}\n icon={<DropletIcon />}\n aria-label=\"Pick color from screen\"\n />\n );\n};\n"],"mappings":";AAAA,SAAgB,cAAAA,aAAY,UAAAC,SAAQ,YAAAC,iBAAgB;;;ACCpD;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,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AAAA,cACb;AAAA,cACA,gBAAAA;AAAA,gBAACM;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,SAAS;AAAA,kBACT,MAAM,gBAAAN,MAAC,aAAU;AAAA,kBACjB,cAAW;AAAA;AAAA,cACb;AAAA,eACF;AAAA,aACF;AAAA,UAEC;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":["forwardRef","useRef","useState","jsx","View","jsx","View","jsx","View","jsx","jsx","forwardRef","RNTextInput","jsx","IconButton","useDesignSystem","isNative","forwardRef","useCallback","useEffect","useRef","useState","jsx","forwardRef","useRef","useState","useEffect","useCallback","useCallback","useEffect","useRef","useState","isWeb","isNative","useDesignSystem","jsx","useDesignSystem","useRef","useState","useCallback","isNative","useEffect","isWeb","useEffect","useState","jsx","useState","useEffect","useEffect","useState","Input","jsx","useState","useEffect","Input","jsx","jsx","forwardRef","useDesignSystem","useRef","useState","isNative","IconButton"]}
|
|
1
|
+
{"version":3,"sources":["../../src/ColorPicker.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Spinner.tsx","../../../primitives-native/src/Icon.tsx","../../../primitives-native/src/Divider.tsx","../../../primitives-native/src/Input.tsx","../../../primitives-native/src/TextArea.tsx","../../src/ColorPickerArea.tsx","../../src/colorUtils.ts","../../src/utils.ts","../../src/ColorPickerSlider.tsx","../../src/ColorPickerInput.tsx","../../src/ColorPickerHexInput.tsx","../../src/ColorPickerEyedropper.tsx"],"sourcesContent":["import React, { forwardRef, useRef, useState } from \"react\";\n// @ts-ignore\nimport { Box, Icon } from \"@xsolla/xui-primitives\";\n// @ts-ignore\nimport { Select } from \"@xsolla/xui-select\";\n// @ts-ignore\nimport { IconButton } from \"@xsolla/xui-button\";\nimport { useDesignSystem, isNative } from \"@xsolla/xui-core\";\nimport { ColorPickerArea } from \"./ColorPickerArea\";\nimport { ColorPickerSlider } from \"./ColorPickerSlider\";\nimport { ColorPickerInput } from \"./ColorPickerInput\";\nimport { ColorPickerHexInput } from \"./ColorPickerHexInput\";\nimport { ColorPickerEyedropper } from \"./ColorPickerEyedropper\";\nimport { parseColor, type ColorChannel, type ColorValue } from \"./colorUtils\";\nimport type { ColorFormat, ColorPickerProps, InputColorFormat } from \"./types\";\nimport { useUpdatableState } from \"./utils\";\n\nconst DEFAULT_VALUE = \"#66E6FFFF\";\n\nconst supportedFormats: InputColorFormat[] = [\"hex\", \"hsl\", \"rgb\", \"hsb\"];\n\nconst addAlfaToChannel = (\n channelName: InputColorFormat,\n alpha: boolean\n): ColorFormat => (alpha ? `${channelName}a` : channelName) as ColorFormat;\n\nconst removeAlfaFromChannel = (channelName: ColorFormat): InputColorFormat =>\n channelName.slice(0, 3) as InputColorFormat;\n\nconst CopyIcon = () => (\n <svg\n viewBox=\"0 0 24 24\"\n width={18}\n height={18}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\" />\n <path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\" />\n </svg>\n);\n\nconst CheckIcon = () => (\n <svg\n viewBox=\"0 0 24 24\"\n width={18}\n height={18}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n);\n\nconst ResetIcon = () => (\n <svg\n viewBox=\"0 0 24 24\"\n width={18}\n height={18}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <polyline points=\"3 3 3 8 8 8\" />\n </svg>\n);\n\nexport const ColorPicker = forwardRef<any, ColorPickerProps>(\n (\n {\n colorFormat: defaultColorFormat = \"hex\",\n alpha = true,\n value: propValue,\n onChange,\n selectableFormats = supportedFormats,\n copiedIcon,\n eyedropper = false,\n bottomContent,\n testID,\n },\n ref\n ) => {\n const { theme } = useDesignSystem();\n const prevColorRef = useRef(propValue);\n const prevHueRef = useRef<number | null>(null);\n\n const [innerValue, setInnerValue] = useUpdatableState<ColorValue>(\n (prevState) => {\n if (prevColorRef.current === propValue && prevState) return prevState;\n const parsedColor = parseColor(propValue || DEFAULT_VALUE);\n return parsedColor;\n },\n [propValue],\n true\n );\n\n const [initialValue] = useState<ColorValue>(() => innerValue);\n const [isValueCopied, setValueCopied] = useState(false);\n\n const [colorFormat, setColorFormat] = useUpdatableState<ColorFormat>(\n () => addAlfaToChannel(defaultColorFormat, alpha),\n [defaultColorFormat, alpha],\n true\n );\n\n const handleChange = (\n newColorString: string,\n currentFormat: ColorFormat = colorFormat\n ) => {\n if (!newColorString) return;\n const newColor = parseColor(newColorString);\n const valueInInitialFormat = newColor.toString(\n addAlfaToChannel(defaultColorFormat, alpha)\n );\n const valueInCurrentFormat = newColor.toString(currentFormat);\n\n setInnerValue(newColor);\n prevColorRef.current = valueInInitialFormat;\n\n onChange?.({\n valueInInitialFormat,\n currentColorFormat: removeAlfaFromChannel(currentFormat),\n valueInCurrentFormat,\n });\n };\n\n const handleChangeFormat = (newFormat: string) => {\n setColorFormat(newFormat as ColorFormat);\n handleChange(innerValue.toString(), newFormat as ColorFormat);\n };\n\n const onCopy = async () => {\n if (isNative) {\n // Native clipboard needs a library like react-native-clipboard\n console.warn(\"Clipboard not yet implemented for native\");\n return;\n }\n try {\n await navigator.clipboard.writeText(innerValue.toString(colorFormat));\n setValueCopied(true);\n setTimeout(() => setValueCopied(false), 2000);\n } catch (err) {\n console.error(\"Failed to copy:\", err);\n }\n };\n\n const onReset = () => handleChange(initialValue.toString());\n\n const selectFormatOptions = selectableFormats\n .map((f) => addAlfaToChannel(f, alpha))\n .map((f) => ({\n label: f.toUpperCase(),\n value: f,\n }));\n\n const channels: ColorChannel[] = colorFormat.includes(\"hex\")\n ? []\n : colorFormat.includes(\"rgb\")\n ? [\"red\", \"green\", \"blue\"]\n : colorFormat.includes(\"hsl\")\n ? [\"hue\", \"saturation\", \"lightness\"]\n : [\"hue\", \"saturation\", \"brightness\"];\n\n return (\n <Box\n ref={ref}\n testID={testID}\n backgroundColor={theme.colors.background.secondary}\n borderRadius={8}\n padding={16}\n gap={16}\n width={312}\n style={{ boxShadow: \"0px 4px 16px 0px rgba(7, 7, 8, 0.1)\" }}\n >\n <ColorPickerArea\n value={innerValue.toString()}\n onChange={handleChange}\n />\n\n <Box flexDirection=\"row\" gap={8} alignItems=\"center\">\n {eyedropper && <ColorPickerEyedropper onColorPick={handleChange} />}\n <Box flex={1} gap={8}>\n <ColorPickerSlider\n channel=\"hue\"\n value={innerValue.toString()}\n onChange={handleChange}\n />\n {alpha && (\n <ColorPickerSlider\n channel=\"alpha\"\n value={innerValue.toString()}\n onChange={handleChange}\n />\n )}\n </Box>\n </Box>\n\n <Box flexDirection=\"row\" gap={8} alignItems=\"center\">\n <Box width={80}>\n <Select\n size=\"sm\"\n // @ts-ignore\n options={selectFormatOptions}\n value={colorFormat}\n onChange={handleChangeFormat}\n />\n </Box>\n\n <Box flex={1} flexDirection=\"row\" gap={4}>\n {colorFormat.includes(\"hex\") ? (\n <ColorPickerHexInput\n value={innerValue.toString(colorFormat)}\n onChange={handleChange}\n />\n ) : (\n channels.map((channel) => (\n <ColorPickerInput\n key={channel}\n value={innerValue}\n valueType={\n innerValue.getChannelRange(channel).maxValue === 100\n ? \"percentage\"\n : \"number\"\n }\n channel={channel}\n onChange={handleChange}\n />\n ))\n )}\n {alpha && (\n <ColorPickerInput\n channel=\"alpha\"\n value={innerValue}\n valueType=\"percentage\"\n onChange={handleChange}\n />\n )}\n </Box>\n\n <Box flexDirection=\"row\" gap={4}>\n <IconButton\n size=\"sm\"\n variant=\"secondary\"\n tone=\"mono\"\n onPress={onCopy}\n icon={isValueCopied ? copiedIcon || <CheckIcon /> : <CopyIcon />}\n aria-label=\"Copy color\"\n />\n <IconButton\n size=\"sm\"\n variant=\"secondary\"\n tone=\"mono\"\n onPress={onReset}\n icon={<ResetIcon />}\n aria-label=\"Reset color\"\n />\n </Box>\n </Box>\n\n {bottomContent}\n </Box>\n );\n }\n);\n\nColorPicker.displayName = \"ColorPicker\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n alignItems,\n justifyContent,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": _ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": _ariaDisabled,\n \"aria-live\": _ariaLive,\n className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport { Text as RNText, TextStyle, AccessibilityRole } from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web roles to React Native accessibility roles\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n id,\n role,\n ...props\n}) => {\n // Extract the first font name from a comma-separated list (e.g. for web-style font stacks)\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n // On native, if we don't have the custom font loaded, it's better to use the system font\n // to avoid rendering issues or missing text.\n if (resolvedFontFamily === \"Pilat Wide Bold\") {\n resolvedFontFamily = undefined;\n }\n\n const style: TextStyle = {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n };\n\n // Map role to React Native accessibilityRole\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText style={style} testID={id} accessibilityRole={accessibilityRole}>\n {children}\n </RNText>\n );\n};\n","import type React from \"react\";\nimport { ActivityIndicator, View } from \"react-native\";\nimport type { SpinnerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Spinner: React.FC<SpinnerProps> = ({\n color,\n size,\n role,\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive,\n \"aria-describedby\": ariaDescribedBy,\n testID,\n}) => {\n return (\n <View\n accessible={true}\n accessibilityRole={role === \"status\" ? \"none\" : undefined}\n accessibilityLabel={ariaLabel}\n accessibilityLiveRegion={\n ariaLive === \"polite\"\n ? \"polite\"\n : ariaLive === \"assertive\"\n ? \"assertive\"\n : \"none\"\n }\n testID={testID}\n >\n <ActivityIndicator\n color={color}\n size={typeof size === \"number\" ? size : \"small\"}\n />\n </View>\n );\n};\n\nSpinner.displayName = \"Spinner\";\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({ children, color, size }) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n // @ts-ignore - passing color down to potential Text/Icon children\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return <View style={style}>{childrenWithProps}</View>;\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { DividerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Divider: React.FC<DividerProps> = ({\n color,\n height,\n width,\n vertical,\n dashStroke,\n}) => {\n const style: ViewStyle = {\n backgroundColor: dashStroke\n ? \"transparent\"\n : color || \"rgba(255, 255, 255, 0.15)\",\n width: vertical ? (typeof width === \"number\" ? width : 1) : \"100%\",\n height: vertical ? \"100%\" : typeof height === \"number\" ? height : 1,\n ...(dashStroke && {\n borderStyle: \"dashed\",\n borderColor: color || \"rgba(255, 255, 255, 0.15)\",\n borderWidth: 0,\n ...(vertical\n ? { borderLeftWidth: typeof width === \"number\" ? width : 1 }\n : { borderTopWidth: typeof height === \"number\" ? height : 1 }),\n }),\n };\n\n return <View style={style} />;\n};\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web input types to React Native keyboard types\nconst keyboardTypeMap: Record<string, any> = {\n text: \"default\",\n number: \"numeric\",\n email: \"email-address\",\n tel: \"phone-pad\",\n url: \"url\",\n decimal: \"decimal-pad\",\n};\n\n// Map web inputMode to React Native keyboard types\nconst inputModeToKeyboardType: Record<string, any> = {\n none: \"default\",\n text: \"default\",\n decimal: \"decimal-pad\",\n numeric: \"number-pad\",\n tel: \"phone-pad\",\n search: \"default\",\n email: \"email-address\",\n url: \"url\",\n};\n\n// Map web autoComplete to React Native textContentType (iOS)\nconst autoCompleteToTextContentType: Record<string, any> = {\n \"one-time-code\": \"oneTimeCode\",\n email: \"emailAddress\",\n username: \"username\",\n password: \"password\",\n \"new-password\": \"newPassword\",\n tel: \"telephoneNumber\",\n \"postal-code\": \"postalCode\",\n name: \"name\",\n};\n\nexport const InputPrimitive = forwardRef<RNTextInput, InputPrimitiveProps>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n secureTextEntry,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n name,\n type,\n inputMode,\n autoComplete,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n // Create a synthetic event for onChange compatibility\n // Include nativeEvent and no-op methods to prevent runtime errors\n // when consumers expect DOM-like event behavior\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLInputElement>;\n onChange(syntheticEvent);\n }\n };\n\n // Determine keyboard type - inputMode takes precedence over type\n const keyboardType = inputMode\n ? inputModeToKeyboardType[inputMode] || \"default\"\n : type\n ? keyboardTypeMap[type] || \"default\"\n : \"default\";\n\n // Determine textContentType for iOS autofill\n const textContentType = autoComplete\n ? autoCompleteToTextContentType[autoComplete]\n : undefined;\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n // Map onKeyPress to onKeyDown for cross-platform compatibility\n // Include preventDefault to avoid runtime errors when consumers call it\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n secureTextEntry={secureTextEntry || type === \"password\"}\n keyboardType={keyboardType}\n textContentType={textContentType}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n // React Native accessibility props\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { TextAreaPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nexport const TextAreaPrimitive = forwardRef<\n RNTextInput,\n TextAreaPrimitiveProps\n>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n rows,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLTextAreaElement>;\n onChange(syntheticEvent);\n }\n };\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n multiline={true}\n numberOfLines={rows || 4}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlignVertical: \"top\",\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nTextAreaPrimitive.displayName = \"TextAreaPrimitive\";\n","import React, {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type ForwardedRef,\n} from \"react\";\n// @ts-ignore\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, isWeb, isNative } from \"@xsolla/xui-core\";\nimport { createColorFromHsb, parseColor } from \"./colorUtils\";\nimport type { CustomColorAreaProps } from \"./types\";\nimport { clamp, snapValueToStep, useMergedRefs } from \"./utils\";\n\nexport const ColorPickerArea = forwardRef(function CustomColorArea(\n props: CustomColorAreaProps,\n ref: ForwardedRef<any>\n) {\n const {\n xChannelStep = 0.1,\n yChannelStep = 0.1,\n value,\n defaultValue,\n onChange,\n onChangeEnd,\n className,\n } = props;\n\n const internalRef = useRef<any>(null);\n const containerRef = useMergedRefs(ref, internalRef);\n const [layout, setLayout] = useState({ width: 0, height: 0 });\n const [isDragging, setIsDragging] = useState(false);\n const [currentColor, setCurrentColor] = useState(() => {\n const initialValue = value || defaultValue || \"#ffffff\";\n return parseColor(initialValue);\n });\n\n useEffect(() => {\n if (value !== undefined) {\n setCurrentColor(parseColor(value));\n }\n }, [value]);\n\n const hsb = currentColor.toHsb();\n const hue = hsb.h;\n\n const saturation = hsb.s * 100;\n const brightness = hsb.b * 100;\n const thumbX = (saturation / 100) * 100;\n const thumbY = 100 - (brightness / 100) * 100;\n\n const updateColor = useCallback(\n (x: number, y: number) => {\n const newSaturation = snapValueToStep(x * 100, 0, 100, xChannelStep);\n const newBrightness = snapValueToStep(\n (1 - y) * 100,\n 0,\n 100,\n yChannelStep\n );\n\n const newColor = createColorFromHsb(\n hue,\n newSaturation,\n newBrightness,\n hsb.a\n );\n setCurrentColor(newColor);\n onChange?.(newColor.toString());\n return newColor;\n },\n [hue, hsb.a, xChannelStep, yChannelStep, onChange]\n );\n\n // Web mouse handlers\n const handleMouseDown = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isNative) return;\n setIsDragging(true);\n const rect = e.currentTarget.getBoundingClientRect();\n const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);\n const y = clamp((e.clientY - rect.top) / rect.height, 0, 1);\n updateColor(x, y);\n },\n [updateColor]\n );\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n if (!isDragging || isNative) return;\n const rect = (internalRef.current as any)?.getBoundingClientRect?.();\n if (!rect) return;\n const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);\n const y = clamp((e.clientY - rect.top) / rect.height, 0, 1);\n updateColor(x, y);\n },\n [isDragging, updateColor]\n );\n\n const handleMouseUp = useCallback(() => {\n if (isDragging) {\n setIsDragging(false);\n onChangeEnd?.(currentColor.toString());\n }\n }, [isDragging, currentColor, onChangeEnd]);\n\n useEffect(() => {\n if (isWeb && isDragging) {\n document.addEventListener(\"mousemove\", handleMouseMove);\n document.addEventListener(\"mouseup\", handleMouseUp);\n return () => {\n document.removeEventListener(\"mousemove\", handleMouseMove);\n document.removeEventListener(\"mouseup\", handleMouseUp);\n };\n }\n }, [isDragging, handleMouseMove, handleMouseUp]);\n\n // Native responder handlers\n const handleResponderMove = useCallback(\n (e: any) => {\n const { locationX, locationY } = e.nativeEvent;\n const x = clamp(locationX / layout.width, 0, 1);\n const y = clamp(locationY / layout.height, 0, 1);\n updateColor(x, y);\n },\n [layout, updateColor]\n );\n\n const handleResponderRelease = useCallback(() => {\n setIsDragging(false);\n onChangeEnd?.(currentColor.toString());\n }, [currentColor, onChangeEnd]);\n\n const gradientStyle = isWeb\n ? {\n background: `linear-gradient(to top, \n hsl(${hue}, 100%, 0%), \n hsl(${hue}, 100%, 50%)),\n linear-gradient(to right, \n hsla(${hue}, 0%, 50%, 1), \n hsla(${hue}, 100%, 50%, 1))`,\n }\n : {\n backgroundColor: `hsl(${hue}, 100%, 50%)`, // Fallback for native without LinearGradient\n };\n\n const thumbColor = currentColor.toString(\"hex\");\n\n return (\n <Box\n data-testid=\"color-picker-color-area\"\n ref={containerRef}\n className={className}\n borderRadius={8}\n height={240}\n cursor=\"pointer\"\n position=\"relative\"\n style={gradientStyle as any}\n onMouseDown={handleMouseDown}\n onLayout={(e: any) => {\n if (isNative) {\n setLayout(e.nativeEvent.layout);\n }\n }}\n onMoveShouldSetResponder={() => isNative}\n onResponderGrant={(e: any) => {\n setIsDragging(true);\n handleResponderMove(e);\n }}\n onResponderMove={handleResponderMove}\n onResponderRelease={handleResponderRelease}\n onResponderTerminate={handleResponderRelease}\n >\n <Box width=\"100%\" height=\"100%\" position=\"relative\">\n <Box\n data-testid=\"color-picker-color-area-thumb\"\n position=\"absolute\"\n width={16}\n height={16}\n borderRadius={8}\n borderWidth={2}\n borderColor=\"#ffffff\"\n style={\n {\n left: `${thumbX}%`,\n top: `${thumbY}%`,\n transform: isWeb\n ? \"translate(-50%, -50%)\"\n : ([{ translateX: -8 }, { translateY: -8 }] as any),\n backgroundColor: thumbColor,\n boxShadow: \"0 0 4px rgba(0,0,0,0.3)\",\n } as any\n }\n />\n </Box>\n </Box>\n );\n});\n","export type ColorChannel =\n | \"hue\"\n | \"saturation\"\n | \"brightness\"\n | \"lightness\"\n | \"red\"\n | \"green\"\n | \"blue\"\n | \"alpha\";\n\nexport interface ColorValue {\n getChannelValue(channel: ColorChannel): number;\n setChannelValue(channel: ColorChannel, value: number): ColorValue;\n getChannelRange(channel: ColorChannel): {\n minValue: number;\n maxValue: number;\n step: number;\n pageSize: number;\n };\n getColorChannels(): ColorChannel[];\n toFormat(format: string): string;\n toString(format?: string): string;\n toHsb(): { h: number; s: number; b: number; a: number };\n toRgb(): { r: number; g: number; b: number; a: number };\n toHsl(): { h: number; s: number; l: number; a: number };\n}\n\n// Basic color conversion functions\nfunction hsbToRgb(h: number, s: number, b: number, a: number = 1) {\n s /= 100;\n b /= 100;\n const k = (n: number) => (n + h / 60) % 6;\n const f = (n: number) =>\n b * (1 - s * Math.max(0, Math.min(k(n), 4 - k(n), 1)));\n return {\n r: Math.round(255 * f(5)),\n g: Math.round(255 * f(3)),\n b: Math.round(255 * f(1)),\n a,\n };\n}\n\nfunction rgbToHsb(r: number, g: number, b: number, a: number = 1) {\n r /= 255;\n g /= 255;\n b /= 255;\n const v = Math.max(r, g, b);\n const n = v - Math.min(r, g, b);\n const h =\n n === 0\n ? 0\n : n && v === r\n ? (g - b) / n\n : v === g\n ? 2 + (b - r) / n\n : 4 + (r - g) / n;\n return {\n h: Math.round(60 * (h < 0 ? h + 6 : h)),\n s: Math.round(v && (n / v) * 100),\n b: Math.round(v * 100),\n a,\n };\n}\n\nfunction rgbToHex(r: number, g: number, b: number, a: number = 1) {\n const toHex = (n: number) => n.toString(16).padStart(2, \"0\");\n const alpha = a === 1 ? \"\" : toHex(Math.round(a * 255));\n return `#${toHex(r)}${toHex(g)}${toHex(b)}${alpha}`.toUpperCase();\n}\n\nfunction hexToRgb(hex: string) {\n hex = hex.replace(/^#/, \"\");\n if (hex.length === 3)\n hex = hex\n .split(\"\")\n .map((s) => s + s)\n .join(\"\");\n if (hex.length === 4)\n hex = hex\n .split(\"\")\n .map((s) => s + s)\n .join(\"\");\n\n const r = parseInt(hex.slice(0, 2), 16);\n const g = parseInt(hex.slice(2, 4), 16);\n const b = parseInt(hex.slice(4, 6), 16);\n const a = hex.length === 8 ? parseInt(hex.slice(6, 8), 16) / 255 : 1;\n\n return { r, g, b, a: parseFloat(a.toFixed(2)) };\n}\n\nfunction rgbToHsl(r: number, g: number, b: number, a: number = 1) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n let h = 0,\n s = 0,\n l = (max + min) / 2;\n\n if (max !== min) {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n\n return {\n h: Math.round(h * 360),\n s: Math.round(s * 100),\n l: Math.round(l * 100),\n a,\n };\n}\n\nclass ColorValueImpl implements ColorValue {\n private h: number;\n private s: number;\n private b: number;\n private a: number;\n\n constructor(h: number, s: number, b: number, a: number = 1) {\n this.h = h;\n this.s = s;\n this.b = b;\n this.a = a;\n }\n\n getChannelValue(channel: ColorChannel): number {\n switch (channel) {\n case \"hue\":\n return this.h;\n case \"saturation\":\n return this.s;\n case \"brightness\":\n return this.b;\n case \"alpha\":\n return this.a;\n case \"red\":\n return hsbToRgb(this.h, this.s, this.b, this.a).r;\n case \"green\":\n return hsbToRgb(this.h, this.s, this.b, this.a).g;\n case \"blue\":\n return hsbToRgb(this.h, this.s, this.b, this.a).b;\n case \"lightness\":\n return rgbToHsl(\n hsbToRgb(this.h, this.s, this.b, this.a).r,\n hsbToRgb(this.h, this.s, this.b, this.a).g,\n hsbToRgb(this.h, this.s, this.b, this.a).b\n ).l;\n default:\n return 0;\n }\n }\n\n setChannelValue(channel: ColorChannel, value: number): ColorValue {\n if (channel === \"hue\")\n return new ColorValueImpl(value, this.s, this.b, this.a);\n if (channel === \"saturation\")\n return new ColorValueImpl(this.h, value, this.b, this.a);\n if (channel === \"brightness\")\n return new ColorValueImpl(this.h, this.s, value, this.a);\n if (channel === \"alpha\")\n return new ColorValueImpl(this.h, this.s, this.b, value);\n\n // For RGB/HSL channels, convert to RGB, update, then back to HSB\n const rgb = hsbToRgb(this.h, this.s, this.b, this.a);\n if (channel === \"red\") rgb.r = value;\n else if (channel === \"green\") rgb.g = value;\n else if (channel === \"blue\") rgb.b = value;\n\n const hsb = rgbToHsb(rgb.r, rgb.g, rgb.b, rgb.a);\n return new ColorValueImpl(hsb.h, hsb.s, hsb.b, hsb.a);\n }\n\n getChannelRange(channel: ColorChannel) {\n switch (channel) {\n case \"hue\":\n return { minValue: 0, maxValue: 360, step: 1, pageSize: 15 };\n case \"alpha\":\n return { minValue: 0, maxValue: 1, step: 0.01, pageSize: 0.1 };\n case \"red\":\n case \"green\":\n case \"blue\":\n return { minValue: 0, maxValue: 255, step: 1, pageSize: 17 };\n default:\n return { minValue: 0, maxValue: 100, step: 1, pageSize: 10 };\n }\n }\n\n getColorChannels(): ColorChannel[] {\n return [\"red\", \"green\", \"blue\"];\n }\n\n toFormat(format: string): string {\n const rgb = hsbToRgb(this.h, this.s, this.b, this.a);\n if (format === \"hex\" || format === \"hexa\")\n return rgbToHex(rgb.r, rgb.g, rgb.b, this.a);\n if (format === \"rgb\") return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;\n if (format === \"rgba\")\n return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${this.a})`;\n if (format === \"hsl\") {\n const hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);\n return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;\n }\n if (format === \"hsla\") {\n const hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);\n return `hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${this.a})`;\n }\n if (format === \"hsb\") return `hsb(${this.h}, ${this.s}%, ${this.b}%)`;\n if (format === \"hsba\")\n return `hsba(${this.h}, ${this.s}%, ${this.b}%, ${this.a})`;\n return rgbToHex(rgb.r, rgb.g, rgb.b, this.a);\n }\n\n toString(format?: string): string {\n return this.toFormat(format || \"hex\");\n }\n\n toHsb() {\n return { h: this.h, s: this.s / 100, b: this.b / 100, a: this.a };\n }\n toRgb() {\n return hsbToRgb(this.h, this.s, this.b, this.a);\n }\n toHsl() {\n const rgb = this.toRgb();\n return rgbToHsl(rgb.r, rgb.g, rgb.b, this.a);\n }\n}\n\nexport function parseColor(color: string): ColorValue {\n if (color.startsWith(\"#\")) {\n const rgb = hexToRgb(color);\n const hsb = rgbToHsb(rgb.r, rgb.g, rgb.b, rgb.a);\n return new ColorValueImpl(hsb.h, hsb.s, hsb.b, hsb.a);\n }\n // Basic support for hsb/rgb/hsl strings if needed, otherwise default to white\n return new ColorValueImpl(0, 0, 100, 1);\n}\n\nexport function createColorFromHsb(\n h: number,\n s: number,\n b: number,\n a: number = 1\n): ColorValue {\n return new ColorValueImpl(h, s, b, a);\n}\n","import { useRef, useEffect, useState, useCallback } from \"react\";\n\nexport function clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nexport function snapValueToStep(\n value: number,\n min: number | undefined,\n max: number | undefined,\n step: number\n): number {\n const remainder = (value - (min ?? 0)) % step;\n let snappedValue =\n Math.abs(remainder) * 2 >= step\n ? value + Math.sign(remainder) * (step - Math.abs(remainder))\n : value - remainder;\n\n if (min !== undefined && snappedValue < min) {\n snappedValue = min;\n } else if (max !== undefined && snappedValue > max) {\n snappedValue = max;\n }\n\n return snappedValue;\n}\n\nexport function useMergedRefs<T>(...refs: Array<any>) {\n return useCallback((node: T) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref != null) {\n ref.current = node;\n }\n });\n }, refs);\n}\n\nexport function useUpdatableState<T>(\n updater: (prevState: T | undefined) => T,\n deps: any[],\n initialUpdate = false\n): [T, (value: T) => void] {\n const [state, setState] = useState<T>(() => updater(undefined));\n const isFirstRender = useRef(true);\n\n useEffect(() => {\n if (isFirstRender.current && !initialUpdate) {\n isFirstRender.current = false;\n return;\n }\n setState(updater);\n }, deps);\n\n return [state, setState];\n}\n","import React, { useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-ignore\nimport { Box, Icon } from \"@xsolla/xui-primitives\";\nimport { isWeb, isNative, useDesignSystem } from \"@xsolla/xui-core\";\nimport { createColorFromHsb, parseColor } from \"./colorUtils\";\nimport { clamp, snapValueToStep } from \"./utils\";\n\ntype ColorPickerSliderProps = {\n channel: \"hue\" | \"alpha\";\n value: string;\n onChange?: (color: string) => void;\n onChangeEnd?: (color: string) => void;\n};\n\nexport const ColorPickerSlider: React.FC<ColorPickerSliderProps> = ({\n channel,\n value,\n onChange,\n onChangeEnd,\n}) => {\n const { theme } = useDesignSystem();\n const trackRef = useRef<any>(null);\n const [layout, setLayout] = useState({ width: 0, height: 0 });\n const [isDragging, setIsDragging] = useState(false);\n const currentColor = parseColor(value);\n const hsb = currentColor.toHsb();\n\n const getChannelValue = () => {\n if (channel === \"hue\") return hsb.h;\n return hsb.a * 100;\n };\n\n const getMaxValue = () => (channel === \"hue\" ? 360 : 100);\n\n const channelValue = getChannelValue();\n const maxValue = getMaxValue();\n const thumbPosition = (channelValue / maxValue) * 100;\n\n const updateColor = useCallback(\n (x: number) => {\n const newValue = snapValueToStep(x * maxValue, 0, maxValue, 1);\n let newColor;\n if (channel === \"hue\") {\n newColor = createColorFromHsb(\n newValue,\n hsb.s * 100,\n hsb.b * 100,\n hsb.a\n );\n } else {\n newColor = createColorFromHsb(\n hsb.h,\n hsb.s * 100,\n hsb.b * 100,\n newValue / 100\n );\n }\n onChange?.(newColor.toString());\n return newColor;\n },\n [channel, maxValue, hsb, onChange]\n );\n\n // Web mouse handlers\n const handleMouseDown = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (isNative) return;\n setIsDragging(true);\n const rect = e.currentTarget.getBoundingClientRect();\n const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);\n updateColor(x);\n },\n [updateColor]\n );\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n if (!isDragging || isNative) return;\n const rect = (trackRef.current as any)?.getBoundingClientRect?.();\n if (!rect) return;\n const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);\n updateColor(x);\n },\n [isDragging, updateColor]\n );\n\n const handleMouseUp = useCallback(() => {\n if (isDragging) {\n setIsDragging(false);\n onChangeEnd?.(currentColor.toString());\n }\n }, [isDragging, currentColor, onChangeEnd]);\n\n useEffect(() => {\n if (isWeb && isDragging) {\n document.addEventListener(\"mousemove\", handleMouseMove);\n document.addEventListener(\"mouseup\", handleMouseUp);\n return () => {\n document.removeEventListener(\"mousemove\", handleMouseMove);\n document.removeEventListener(\"mouseup\", handleMouseUp);\n };\n }\n }, [isDragging, handleMouseMove, handleMouseUp]);\n\n // Native responder handlers\n const handleResponderMove = useCallback(\n (e: any) => {\n const { locationX } = e.nativeEvent;\n const x = clamp(locationX / layout.width, 0, 1);\n updateColor(x);\n },\n [layout, updateColor]\n );\n\n const handleResponderRelease = useCallback(() => {\n setIsDragging(false);\n onChangeEnd?.(currentColor.toString());\n }, [currentColor, onChangeEnd]);\n\n const getGradient = () => {\n if (channel === \"hue\") {\n return \"linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)\";\n }\n const colorHex = currentColor.toString(\"hex\");\n return `linear-gradient(to right, transparent 0%, ${colorHex} 100%)`;\n };\n\n const thumbColor =\n channel === \"hue\"\n ? createColorFromHsb(channelValue, 100, 100, 1).toString(\"hex\")\n : currentColor.toString(\"hex\");\n\n return (\n <Box\n height={12}\n borderRadius={6}\n position=\"relative\"\n style={\n isWeb\n ? { background: getGradient() }\n : ({ backgroundColor: theme.colors.background.primary } as any)\n }\n onLayout={(e: any) => {\n if (isNative) {\n setLayout(e.nativeEvent.layout);\n }\n }}\n onMouseDown={handleMouseDown}\n onMoveShouldSetResponder={() => isNative}\n onResponderGrant={(e: any) => {\n setIsDragging(true);\n handleResponderMove(e);\n }}\n onResponderMove={handleResponderMove}\n onResponderRelease={handleResponderRelease}\n onResponderTerminate={handleResponderRelease}\n >\n <Box ref={trackRef} width=\"100%\" height=\"100%\" position=\"relative\">\n <Box\n position=\"absolute\"\n width={16}\n height={16}\n borderRadius={8}\n borderWidth={2}\n borderColor=\"#ffffff\"\n style={\n {\n left: `${thumbPosition}%`,\n top: \"50%\",\n transform: isWeb\n ? \"translate(-50%, -50%)\"\n : ([{ translateX: -8 }, { translateY: -8 }] as any),\n backgroundColor: thumbColor,\n boxShadow: \"0 0 4px rgba(0,0,0,0.3)\",\n } as any\n }\n />\n </Box>\n </Box>\n );\n};\n","import React, { useEffect, useState } from \"react\";\n// @ts-ignore\nimport { Input } from \"@xsolla/xui-input\";\n// @ts-ignore\nimport { Box } from \"@xsolla/xui-primitives\";\nimport type { ColorChannel, ColorValue } from \"./colorUtils\";\n\ntype ColorPickerInputProps = {\n value: ColorValue;\n valueType: \"number\" | \"percentage\";\n channel: ColorChannel;\n onChange: (color: string) => void;\n};\n\nexport const ColorPickerInput: React.FC<ColorPickerInputProps> = ({\n value,\n valueType,\n channel,\n onChange,\n}) => {\n const channelValue = value.getChannelValue(channel);\n const channelRange = value.getChannelRange(channel);\n const intValue = channel === \"alpha\" ? channelValue * 100 : channelValue;\n const roundedValue = Math.round(intValue);\n\n const [inputValue, setInputValue] = useState(String(roundedValue));\n\n useEffect(() => {\n setInputValue(String(roundedValue));\n }, [roundedValue]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const text = e.target.value.replace(/[^0-9]/g, \"\");\n setInputValue(text);\n\n const parsedValue = parseInt(text, 10);\n if (!isNaN(parsedValue)) {\n let newValue = channel === \"alpha\" ? parsedValue / 100 : parsedValue;\n const min = channel === \"alpha\" ? 0 : channelRange.minValue;\n const max = channel === \"alpha\" ? 100 : channelRange.maxValue;\n\n const clampedValue = Math.min(Math.max(parsedValue, min), max);\n const colorValue =\n channel === \"alpha\" ? clampedValue / 100 : clampedValue;\n\n const newColor = value.setChannelValue(channel, colorValue);\n onChange(newColor.toString());\n }\n };\n\n const handleBlur = () => {\n setInputValue(String(roundedValue));\n };\n\n return (\n <Box flex={1} minWidth={40}>\n <Input\n size=\"sm\"\n value={valueType === \"percentage\" ? `${inputValue}%` : inputValue}\n onChange={handleChange}\n onBlur={handleBlur}\n />\n </Box>\n );\n};\n","import React, { useEffect, useState } from \"react\";\n// @ts-ignore\nimport { Input } from \"@xsolla/xui-input\";\n// @ts-ignore\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { parseColor } from \"./colorUtils\";\n\ntype ColorPickerHexInputProps = {\n value: string;\n onChange: (color: string) => void;\n};\n\nexport const ColorPickerHexInput: React.FC<ColorPickerHexInputProps> = ({\n value,\n onChange,\n}) => {\n const [inputValue, setInputValue] = useState(value);\n\n useEffect(() => {\n setInputValue(value);\n }, [value]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setInputValue(newValue);\n\n try {\n const color = parseColor(newValue);\n if (color) {\n onChange(color.toString(\"hex\"));\n }\n } catch {\n // Invalid color\n }\n };\n\n const handleBlur = () => {\n try {\n const color = parseColor(inputValue);\n if (color) {\n onChange(color.toString(\"hex\"));\n } else {\n setInputValue(value);\n }\n } catch {\n setInputValue(value);\n }\n };\n\n return (\n <Box flex={1}>\n <Input\n size=\"sm\"\n value={inputValue}\n onChange={handleChange}\n onBlur={handleBlur}\n />\n </Box>\n );\n};\n","import React from \"react\";\n// @ts-ignore\nimport { IconButton } from \"@xsolla/xui-button\";\n// @ts-ignore\nimport { Icon } from \"@xsolla/xui-primitives\";\nimport { parseColor } from \"./colorUtils\";\n\nconst DropletIcon = () => (\n <svg\n viewBox=\"0 0 24 24\"\n width={18}\n height={18}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5s-3 3.5-3 5.5a7 7 0 0 0 7 7z\" />\n </svg>\n);\n\ndeclare let EyeDropper: {\n new (): {\n open(): Promise<{ sRGBHex: string }>;\n };\n};\n\ntype Props = {\n onColorPick: (color: string) => void;\n};\n\nexport const ColorPickerEyedropper: React.FC<Props> = ({ onColorPick }) => {\n const onEyedropperButtonClick = () => {\n if (typeof EyeDropper !== \"undefined\") {\n new EyeDropper().open().then((result) => {\n const pickedColor = parseColor(result.sRGBHex);\n const hsb = pickedColor.toHsb();\n const hsbString = `hsb(${Math.round(hsb.h)}, ${Math.round(hsb.s * 100)}%, ${Math.round(hsb.b * 100)}%)`;\n onColorPick(hsbString);\n });\n }\n };\n\n if (typeof EyeDropper === \"undefined\") return null;\n\n return (\n <IconButton\n size=\"sm\"\n variant=\"secondary\"\n tone=\"mono\"\n onPress={onEyedropperButtonClick}\n icon={<DropletIcon />}\n aria-label=\"Pick color from screen\"\n />\n );\n};\n"],"mappings":";AAAA,SAAgB,cAAAA,aAAY,UAAAC,SAAQ,YAAAC,iBAAgB;;;ACCpD;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,E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BACV,UAAU;AAAA;AAAA,cACZ;AAAA,eAEJ;AAAA,YAEA,qBAAC,OAAI,eAAc,OAAM,KAAK,GAC5B;AAAA,8BAAAA;AAAA,gBAACM;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,SAAS;AAAA,kBACT,MAAM,gBAAgB,cAAc,gBAAAN,MAAC,aAAU,IAAK,gBAAAA,MAAC,YAAS;AAAA,kBAC9D,cAAW;AAAA;AAAA,cACb;AAAA,cACA,gBAAAA;AAAA,gBAACM;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,SAAS;AAAA,kBACT,MAAM,gBAAAN,MAAC,aAAU;AAAA,kBACjB,cAAW;AAAA;AAAA,cACb;AAAA,eACF;AAAA,aACF;AAAA,UAEC;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":["forwardRef","useRef","useState","jsx","View","jsx","View","jsx","View","jsx","jsx","forwardRef","RNTextInput","jsx","IconButton","useDesignSystem","isNative","forwardRef","useCallback","useEffect","useRef","useState","jsx","forwardRef","useRef","useState","useEffect","useCallback","useCallback","useEffect","useRef","useState","isWeb","isNative","useDesignSystem","jsx","useDesignSystem","useRef","useState","useCallback","isNative","useEffect","isWeb","useEffect","useState","jsx","useState","useEffect","useEffect","useState","Input","jsx","useState","useEffect","Input","jsx","jsx","forwardRef","useDesignSystem","useRef","useState","isNative","IconButton"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-color-picker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"build:native": "PLATFORM=native tsup"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xsolla/xui-button": "0.
|
|
14
|
-
"@xsolla/xui-core": "0.
|
|
15
|
-
"@xsolla/xui-input": "0.
|
|
16
|
-
"@xsolla/xui-primitives-core": "0.
|
|
17
|
-
"@xsolla/xui-select": "0.
|
|
13
|
+
"@xsolla/xui-button": "0.73.0",
|
|
14
|
+
"@xsolla/xui-core": "0.73.0",
|
|
15
|
+
"@xsolla/xui-input": "0.73.0",
|
|
16
|
+
"@xsolla/xui-primitives-core": "0.73.0",
|
|
17
|
+
"@xsolla/xui-select": "0.73.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"react": ">=16.8.0"
|
package/web/index.js
CHANGED
|
@@ -1322,7 +1322,7 @@ var ColorPicker = (0, import_react9.forwardRef)(
|
|
|
1322
1322
|
size: "sm",
|
|
1323
1323
|
options: selectFormatOptions,
|
|
1324
1324
|
value: colorFormat,
|
|
1325
|
-
|
|
1325
|
+
onChange: handleChangeFormat
|
|
1326
1326
|
}
|
|
1327
1327
|
) }),
|
|
1328
1328
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Box, { flex: 1, flexDirection: "row", gap: 4, children: [
|