@xsolla/xui-color-picker 0.138.0 → 0.138.1
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 +23 -20
- package/native/index.js.map +1 -1
- package/native/index.mjs +14 -15
- package/native/index.mjs.map +1 -1
- package/package.json +6 -6
- package/web/index.js +23 -20
- package/web/index.js.map +1 -1
- package/web/index.mjs +14 -15
- package/web/index.mjs.map +1 -1
package/native/index.js
CHANGED
|
@@ -205,14 +205,17 @@ var Box = ({
|
|
|
205
205
|
);
|
|
206
206
|
};
|
|
207
207
|
|
|
208
|
+
// ../primitives-native/src/index.tsx
|
|
209
|
+
var isWeb = false;
|
|
210
|
+
var isNative = true;
|
|
211
|
+
|
|
208
212
|
// src/ColorPicker.tsx
|
|
209
213
|
var import_xui_select = require("@xsolla/xui-select");
|
|
210
214
|
var import_xui_button2 = require("@xsolla/xui-button");
|
|
211
|
-
var
|
|
215
|
+
var import_xui_core2 = require("@xsolla/xui-core");
|
|
212
216
|
|
|
213
217
|
// src/ColorPickerArea.tsx
|
|
214
218
|
var import_react2 = require("react");
|
|
215
|
-
var import_xui_core = require("@xsolla/xui-core");
|
|
216
219
|
|
|
217
220
|
// src/colorUtils.ts
|
|
218
221
|
function hsbToRgb(h, s, b, a = 1) {
|
|
@@ -496,7 +499,7 @@ var ColorPickerArea = (0, import_react2.forwardRef)(function CustomColorArea(pro
|
|
|
496
499
|
);
|
|
497
500
|
const handleMouseDown = (0, import_react2.useCallback)(
|
|
498
501
|
(e) => {
|
|
499
|
-
if (
|
|
502
|
+
if (isNative) return;
|
|
500
503
|
setIsDragging(true);
|
|
501
504
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
502
505
|
const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);
|
|
@@ -507,7 +510,7 @@ var ColorPickerArea = (0, import_react2.forwardRef)(function CustomColorArea(pro
|
|
|
507
510
|
);
|
|
508
511
|
const handleMouseMove = (0, import_react2.useCallback)(
|
|
509
512
|
(e) => {
|
|
510
|
-
if (!isDragging ||
|
|
513
|
+
if (!isDragging || isNative) return;
|
|
511
514
|
const rect = internalRef.current?.getBoundingClientRect?.();
|
|
512
515
|
if (!rect) return;
|
|
513
516
|
const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);
|
|
@@ -523,7 +526,7 @@ var ColorPickerArea = (0, import_react2.forwardRef)(function CustomColorArea(pro
|
|
|
523
526
|
}
|
|
524
527
|
}, [isDragging, currentColor, onChangeEnd]);
|
|
525
528
|
(0, import_react2.useEffect)(() => {
|
|
526
|
-
if (
|
|
529
|
+
if (isWeb && isDragging) {
|
|
527
530
|
document.addEventListener("mousemove", handleMouseMove);
|
|
528
531
|
document.addEventListener("mouseup", handleMouseUp);
|
|
529
532
|
return () => {
|
|
@@ -545,7 +548,7 @@ var ColorPickerArea = (0, import_react2.forwardRef)(function CustomColorArea(pro
|
|
|
545
548
|
setIsDragging(false);
|
|
546
549
|
onChangeEnd?.(currentColor.toString());
|
|
547
550
|
}, [currentColor, onChangeEnd]);
|
|
548
|
-
const gradientStyle =
|
|
551
|
+
const gradientStyle = isWeb ? {
|
|
549
552
|
background: `linear-gradient(to top,
|
|
550
553
|
hsl(${hue}, 100%, 0%),
|
|
551
554
|
hsl(${hue}, 100%, 50%)),
|
|
@@ -570,11 +573,11 @@ var ColorPickerArea = (0, import_react2.forwardRef)(function CustomColorArea(pro
|
|
|
570
573
|
style: gradientStyle,
|
|
571
574
|
onMouseDown: handleMouseDown,
|
|
572
575
|
onLayout: (e) => {
|
|
573
|
-
if (
|
|
576
|
+
if (isNative) {
|
|
574
577
|
setLayout(e.nativeEvent.layout);
|
|
575
578
|
}
|
|
576
579
|
},
|
|
577
|
-
onMoveShouldSetResponder: () =>
|
|
580
|
+
onMoveShouldSetResponder: () => isNative,
|
|
578
581
|
onResponderGrant: (e) => {
|
|
579
582
|
setIsDragging(true);
|
|
580
583
|
handleResponderMove(e);
|
|
@@ -595,7 +598,7 @@ var ColorPickerArea = (0, import_react2.forwardRef)(function CustomColorArea(pro
|
|
|
595
598
|
style: {
|
|
596
599
|
left: `${thumbX}%`,
|
|
597
600
|
top: `${thumbY}%`,
|
|
598
|
-
transform:
|
|
601
|
+
transform: isWeb ? "translate(-50%, -50%)" : [{ translateX: -8 }, { translateY: -8 }],
|
|
599
602
|
backgroundColor: thumbColor,
|
|
600
603
|
boxShadow: "0 0 4px rgba(0,0,0,0.3)"
|
|
601
604
|
}
|
|
@@ -607,7 +610,7 @@ var ColorPickerArea = (0, import_react2.forwardRef)(function CustomColorArea(pro
|
|
|
607
610
|
|
|
608
611
|
// src/ColorPickerSlider.tsx
|
|
609
612
|
var import_react3 = require("react");
|
|
610
|
-
var
|
|
613
|
+
var import_xui_core = require("@xsolla/xui-core");
|
|
611
614
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
612
615
|
var ColorPickerSlider = ({
|
|
613
616
|
channel,
|
|
@@ -617,7 +620,7 @@ var ColorPickerSlider = ({
|
|
|
617
620
|
themeMode,
|
|
618
621
|
themeProductContext
|
|
619
622
|
}) => {
|
|
620
|
-
const { theme } = (0,
|
|
623
|
+
const { theme } = (0, import_xui_core.useResolvedTheme)({ themeMode, themeProductContext });
|
|
621
624
|
const trackRef = (0, import_react3.useRef)(null);
|
|
622
625
|
const [layout, setLayout] = (0, import_react3.useState)({ width: 0, height: 0 });
|
|
623
626
|
const [isDragging, setIsDragging] = (0, import_react3.useState)(false);
|
|
@@ -657,7 +660,7 @@ var ColorPickerSlider = ({
|
|
|
657
660
|
);
|
|
658
661
|
const handleMouseDown = (0, import_react3.useCallback)(
|
|
659
662
|
(e) => {
|
|
660
|
-
if (
|
|
663
|
+
if (isNative) return;
|
|
661
664
|
setIsDragging(true);
|
|
662
665
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
663
666
|
const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);
|
|
@@ -667,7 +670,7 @@ var ColorPickerSlider = ({
|
|
|
667
670
|
);
|
|
668
671
|
const handleMouseMove = (0, import_react3.useCallback)(
|
|
669
672
|
(e) => {
|
|
670
|
-
if (!isDragging ||
|
|
673
|
+
if (!isDragging || isNative) return;
|
|
671
674
|
const rect = trackRef.current?.getBoundingClientRect?.();
|
|
672
675
|
if (!rect) return;
|
|
673
676
|
const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);
|
|
@@ -682,7 +685,7 @@ var ColorPickerSlider = ({
|
|
|
682
685
|
}
|
|
683
686
|
}, [isDragging, currentColor, onChangeEnd]);
|
|
684
687
|
(0, import_react3.useEffect)(() => {
|
|
685
|
-
if (
|
|
688
|
+
if (isWeb && isDragging) {
|
|
686
689
|
document.addEventListener("mousemove", handleMouseMove);
|
|
687
690
|
document.addEventListener("mouseup", handleMouseUp);
|
|
688
691
|
return () => {
|
|
@@ -717,14 +720,14 @@ var ColorPickerSlider = ({
|
|
|
717
720
|
height: 12,
|
|
718
721
|
borderRadius: 6,
|
|
719
722
|
position: "relative",
|
|
720
|
-
style:
|
|
723
|
+
style: isWeb ? { background: getGradient() } : { backgroundColor: theme.colors.background.primary },
|
|
721
724
|
onLayout: (e) => {
|
|
722
|
-
if (
|
|
725
|
+
if (isNative) {
|
|
723
726
|
setLayout(e.nativeEvent.layout);
|
|
724
727
|
}
|
|
725
728
|
},
|
|
726
729
|
onMouseDown: handleMouseDown,
|
|
727
|
-
onMoveShouldSetResponder: () =>
|
|
730
|
+
onMoveShouldSetResponder: () => isNative,
|
|
728
731
|
onResponderGrant: (e) => {
|
|
729
732
|
setIsDragging(true);
|
|
730
733
|
handleResponderMove(e);
|
|
@@ -744,7 +747,7 @@ var ColorPickerSlider = ({
|
|
|
744
747
|
style: {
|
|
745
748
|
left: `${thumbPosition}%`,
|
|
746
749
|
top: "50%",
|
|
747
|
-
transform:
|
|
750
|
+
transform: isWeb ? "translate(-50%, -50%)" : [{ translateX: -8 }, { translateY: -8 }],
|
|
748
751
|
backgroundColor: thumbColor,
|
|
749
752
|
boxShadow: "0 0 4px rgba(0,0,0,0.3)"
|
|
750
753
|
}
|
|
@@ -955,7 +958,7 @@ var ColorPicker = (0, import_react6.forwardRef)(
|
|
|
955
958
|
themeMode,
|
|
956
959
|
themeProductContext
|
|
957
960
|
}, ref) => {
|
|
958
|
-
const { theme } = (0,
|
|
961
|
+
const { theme } = (0, import_xui_core2.useResolvedTheme)({ themeMode, themeProductContext });
|
|
959
962
|
const prevColorRef = (0, import_react6.useRef)(propValue);
|
|
960
963
|
const [innerValue, setInnerValue] = useUpdatableState(
|
|
961
964
|
(prevState) => {
|
|
@@ -993,7 +996,7 @@ var ColorPicker = (0, import_react6.forwardRef)(
|
|
|
993
996
|
handleChange(innerValue.toString(), newFormat);
|
|
994
997
|
};
|
|
995
998
|
const onCopy = async () => {
|
|
996
|
-
if (
|
|
999
|
+
if (import_xui_core2.isNative) {
|
|
997
1000
|
console.warn("Clipboard not yet implemented for native");
|
|
998
1001
|
return;
|
|
999
1002
|
}
|
package/native/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/ColorPicker.tsx","../../../primitives-native/src/Box.tsx","../../src/ColorPickerArea.tsx","../../src/colorUtils.ts","../../src/utils.ts","../../src/ColorPickerSlider.tsx","../../src/ColorPickerInput.tsx","../../src/ColorPickerHexInput.tsx","../../src/ColorPickerEyedropper.tsx"],"sourcesContent":["export * from \"./ColorPicker\";\nexport * from \"./types\";\nexport * from \"./colorUtils\";\nexport * from \"./ColorPickerArea\";\nexport * from \"./ColorPickerSlider\";\n","import { forwardRef, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { Select } from \"@xsolla/xui-select\";\nimport { IconButton } from \"@xsolla/xui-button\";\nimport {\n useResolvedTheme,\n isNative,\n type ThemeOverrideProps,\n} 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<\n any,\n ColorPickerProps & ThemeOverrideProps\n>(\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 themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const prevColorRef = useRef(propValue);\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 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 minWidth,\n minHeight,\n maxWidth,\n maxHeight,\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 minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight 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, {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type ForwardedRef,\n} from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { 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-expect-error - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport {\n isWeb,\n isNative,\n useResolvedTheme,\n type ThemeOverrideProps,\n} 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<\n ColorPickerSliderProps & ThemeOverrideProps\n> = ({\n channel,\n value,\n onChange,\n onChangeEnd,\n themeMode,\n themeProductContext,\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\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\";\nimport { Input } from \"@xsolla/xui-input\";\n// @ts-expect-error - this will be resolved at build time\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 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\";\nimport { Input } from \"@xsolla/xui-input\";\n// @ts-expect-error - this will be resolved at build time\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\";\nimport { IconButton } from \"@xsolla/xui-button\";\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA6C;;;ACC7C,0BAQO;AA2ID;AAxIC,IAAM,MAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,oBAAoB,CAAC,aAAk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AA,aACF;AAAA,UAEC;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":["import_react","import_xui_button","import_xui_core","import_react","import_jsx_runtime","import_react","import_xui_core","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_xui_input","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/ColorPicker.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/index.tsx","../../src/ColorPickerArea.tsx","../../src/colorUtils.ts","../../src/utils.ts","../../src/ColorPickerSlider.tsx","../../src/ColorPickerInput.tsx","../../src/ColorPickerHexInput.tsx","../../src/ColorPickerEyedropper.tsx"],"sourcesContent":["export * from \"./ColorPicker\";\nexport * from \"./types\";\nexport * from \"./colorUtils\";\nexport * from \"./ColorPickerArea\";\nexport * from \"./ColorPickerSlider\";\n","import { forwardRef, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { Select } from \"@xsolla/xui-select\";\nimport { IconButton } from \"@xsolla/xui-button\";\nimport {\n useResolvedTheme,\n isNative,\n type ThemeOverrideProps,\n} 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<\n any,\n ColorPickerProps & ThemeOverrideProps\n>(\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 themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const prevColorRef = useRef(propValue);\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 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 minWidth,\n minHeight,\n maxWidth,\n maxHeight,\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 minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight 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","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = false;\nexport const isNative = true;\n","import React, {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type ForwardedRef,\n} from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\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-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, type ThemeOverrideProps } 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<\n ColorPickerSliderProps & ThemeOverrideProps\n> = ({\n channel,\n value,\n onChange,\n onChangeEnd,\n themeMode,\n themeProductContext,\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\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\";\nimport { Input } from \"@xsolla/xui-input\";\n// @ts-expect-error - this will be resolved at build time\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 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\";\nimport { Input } from \"@xsolla/xui-input\";\n// @ts-expect-error - this will be resolved at build time\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\";\nimport { IconButton } from \"@xsolla/xui-button\";\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA6C;;;ACC7C,0BAQO;AA2ID;AAxIC,IAAM,MAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,oBAAoB,CAAC,aAAkC;AAAA,IAC3D,iBACE,WAAW,YAAY,kBACnB,WAAW,kBACX;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AA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AA;AAAA,YACZ,GACF;AAAA,YAEA,8CAAC,OAAI,MAAM,GAAG,eAAc,OAAM,KAAK,GACpC;AAAA,0BAAY,SAAS,KAAK,IACzB;AAAA,gBAAC;AAAA;AAAA,kBACC,OAAO,WAAW,SAAS,WAAW;AAAA,kBACtC,UAAU;AAAA;AAAA,cACZ,IAEA,SAAS,IAAI,CAAC,YACZ;AAAA,gBAAC;AAAA;AAAA,kBAEC,OAAO;AAAA,kBACP,WACE,WAAW,gBAAgB,OAAO,EAAE,aAAa,MAC7C,eACA;AAAA,kBAEN;AAAA,kBACA,UAAU;AAAA;AAAA,gBARL;AAAA,cASP,CACD;AAAA,cAEF,SACC;AAAA,gBAAC;AAAA;AAAA,kBACC,SAAQ;AAAA,kBACR,OAAO;AAAA,kBACP,WAAU;AAAA,kBACV,UAAU;AAAA;AAAA,cACZ;AAAA,eAEJ;AAAA,YAEA,8CAAC,OAAI,eAAc,OAAM,KAAK,GAC5B;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,SAAS;AAAA,kBACT,MAAM,gBAAgB,cAAc,6CAAC,aAAU,IAAK,6CAAC,YAAS;AAAA,kBAC9D,cAAW;AAAA;AAAA,cACb;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,SAAS;AAAA,kBACT,MAAM,6CAAC,aAAU;AAAA,kBACjB,cAAW;AAAA;AAAA,cACb;AAAA,eACF;AAAA,aACF;AAAA,UAEC;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":["import_react","import_xui_button","import_xui_core","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_xui_input","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
|
package/native/index.mjs
CHANGED
|
@@ -179,12 +179,16 @@ var Box = ({
|
|
|
179
179
|
);
|
|
180
180
|
};
|
|
181
181
|
|
|
182
|
+
// ../primitives-native/src/index.tsx
|
|
183
|
+
var isWeb = false;
|
|
184
|
+
var isNative = true;
|
|
185
|
+
|
|
182
186
|
// src/ColorPicker.tsx
|
|
183
187
|
import { Select } from "@xsolla/xui-select";
|
|
184
188
|
import { IconButton as IconButton2 } from "@xsolla/xui-button";
|
|
185
189
|
import {
|
|
186
190
|
useResolvedTheme as useResolvedTheme2,
|
|
187
|
-
isNative as
|
|
191
|
+
isNative as isNative2
|
|
188
192
|
} from "@xsolla/xui-core";
|
|
189
193
|
|
|
190
194
|
// src/ColorPickerArea.tsx
|
|
@@ -195,7 +199,6 @@ import {
|
|
|
195
199
|
useRef as useRef2,
|
|
196
200
|
useState as useState2
|
|
197
201
|
} from "react";
|
|
198
|
-
import { isWeb, isNative } from "@xsolla/xui-core";
|
|
199
202
|
|
|
200
203
|
// src/colorUtils.ts
|
|
201
204
|
function hsbToRgb(h, s, b, a = 1) {
|
|
@@ -590,11 +593,7 @@ var ColorPickerArea = forwardRef(function CustomColorArea(props, ref) {
|
|
|
590
593
|
|
|
591
594
|
// src/ColorPickerSlider.tsx
|
|
592
595
|
import { useCallback as useCallback3, useEffect as useEffect3, useRef as useRef3, useState as useState3 } from "react";
|
|
593
|
-
import {
|
|
594
|
-
isWeb as isWeb2,
|
|
595
|
-
isNative as isNative2,
|
|
596
|
-
useResolvedTheme
|
|
597
|
-
} from "@xsolla/xui-core";
|
|
596
|
+
import { useResolvedTheme } from "@xsolla/xui-core";
|
|
598
597
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
599
598
|
var ColorPickerSlider = ({
|
|
600
599
|
channel,
|
|
@@ -644,7 +643,7 @@ var ColorPickerSlider = ({
|
|
|
644
643
|
);
|
|
645
644
|
const handleMouseDown = useCallback3(
|
|
646
645
|
(e) => {
|
|
647
|
-
if (
|
|
646
|
+
if (isNative) return;
|
|
648
647
|
setIsDragging(true);
|
|
649
648
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
650
649
|
const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);
|
|
@@ -654,7 +653,7 @@ var ColorPickerSlider = ({
|
|
|
654
653
|
);
|
|
655
654
|
const handleMouseMove = useCallback3(
|
|
656
655
|
(e) => {
|
|
657
|
-
if (!isDragging ||
|
|
656
|
+
if (!isDragging || isNative) return;
|
|
658
657
|
const rect = trackRef.current?.getBoundingClientRect?.();
|
|
659
658
|
if (!rect) return;
|
|
660
659
|
const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);
|
|
@@ -669,7 +668,7 @@ var ColorPickerSlider = ({
|
|
|
669
668
|
}
|
|
670
669
|
}, [isDragging, currentColor, onChangeEnd]);
|
|
671
670
|
useEffect3(() => {
|
|
672
|
-
if (
|
|
671
|
+
if (isWeb && isDragging) {
|
|
673
672
|
document.addEventListener("mousemove", handleMouseMove);
|
|
674
673
|
document.addEventListener("mouseup", handleMouseUp);
|
|
675
674
|
return () => {
|
|
@@ -704,14 +703,14 @@ var ColorPickerSlider = ({
|
|
|
704
703
|
height: 12,
|
|
705
704
|
borderRadius: 6,
|
|
706
705
|
position: "relative",
|
|
707
|
-
style:
|
|
706
|
+
style: isWeb ? { background: getGradient() } : { backgroundColor: theme.colors.background.primary },
|
|
708
707
|
onLayout: (e) => {
|
|
709
|
-
if (
|
|
708
|
+
if (isNative) {
|
|
710
709
|
setLayout(e.nativeEvent.layout);
|
|
711
710
|
}
|
|
712
711
|
},
|
|
713
712
|
onMouseDown: handleMouseDown,
|
|
714
|
-
onMoveShouldSetResponder: () =>
|
|
713
|
+
onMoveShouldSetResponder: () => isNative,
|
|
715
714
|
onResponderGrant: (e) => {
|
|
716
715
|
setIsDragging(true);
|
|
717
716
|
handleResponderMove(e);
|
|
@@ -731,7 +730,7 @@ var ColorPickerSlider = ({
|
|
|
731
730
|
style: {
|
|
732
731
|
left: `${thumbPosition}%`,
|
|
733
732
|
top: "50%",
|
|
734
|
-
transform:
|
|
733
|
+
transform: isWeb ? "translate(-50%, -50%)" : [{ translateX: -8 }, { translateY: -8 }],
|
|
735
734
|
backgroundColor: thumbColor,
|
|
736
735
|
boxShadow: "0 0 4px rgba(0,0,0,0.3)"
|
|
737
736
|
}
|
|
@@ -980,7 +979,7 @@ var ColorPicker = forwardRef2(
|
|
|
980
979
|
handleChange(innerValue.toString(), newFormat);
|
|
981
980
|
};
|
|
982
981
|
const onCopy = async () => {
|
|
983
|
-
if (
|
|
982
|
+
if (isNative2) {
|
|
984
983
|
console.warn("Clipboard not yet implemented for native");
|
|
985
984
|
return;
|
|
986
985
|
}
|