@xsolla/xui-color-picker 0.148.2 → 0.149.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-color-picker",
3
- "version": "0.148.2",
3
+ "version": "0.149.1",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -13,11 +13,11 @@
13
13
  "test:coverage": "vitest run --coverage"
14
14
  },
15
15
  "dependencies": {
16
- "@xsolla/xui-button": "0.148.2",
17
- "@xsolla/xui-core": "0.148.2",
18
- "@xsolla/xui-input": "0.148.2",
19
- "@xsolla/xui-primitives-core": "0.148.2",
20
- "@xsolla/xui-select": "0.148.2"
16
+ "@xsolla/xui-button": "0.149.1",
17
+ "@xsolla/xui-core": "0.149.1",
18
+ "@xsolla/xui-input": "0.149.1",
19
+ "@xsolla/xui-primitives-core": "0.149.1",
20
+ "@xsolla/xui-select": "0.149.1"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": ">=16.8.0"
package/web/index.js CHANGED
@@ -226,6 +226,8 @@ var Box = import_react2.default.forwardRef(
226
226
  as,
227
227
  src,
228
228
  alt,
229
+ onError,
230
+ onLoad,
229
231
  type,
230
232
  disabled,
231
233
  id,
@@ -239,6 +241,8 @@ var Box = import_react2.default.forwardRef(
239
241
  {
240
242
  src,
241
243
  alt: alt || "",
244
+ onError,
245
+ onLoad,
242
246
  style: {
243
247
  display: "block",
244
248
  objectFit: "cover",
package/web/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx","../../src/ColorPicker.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../../foundation/primitives-web/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 styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\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 = true;\nexport const isNative = false;\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;;;ACA7C,IAAAC,gBAAkB;AAClB,+BAAmB;;;ACDnB,mBAAkB;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA,EAE9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,kBAAkB,KAAsB;AAC/C,MAAI,yBAAyB,I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AAA,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_react","React","styled","React","import_xui_button","import_xui_core","import_react","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"]}
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/ColorPicker.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../../foundation/primitives-web/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 styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\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 = true;\nexport const isNative = false;\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;;;ACA7C,IAAAC,gBAAkB;AAClB,+BAAmB;;;ACDnB,mBAAkB;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA,EAE9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,kBAAkB,KAAsB;AAC/C,MAAI,yBAAyB,IAAI,GAAG,EAAG,QAAO;AAC9C,SAAO,0BAAY,GAAG;AACxB;AAgBO,SAAS,sBAAsB,YAAoB;AACxD,QAAM,YAAY,aAAAC,QAAM;AAAA,IACtB,CAAC,EAAE,UAAU,aAAa,GAAG,MAAM,GAAG,QAAQ;AAC5C,YAAM,MAAO,eAA0B;AAC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A,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_react","React","styled","React","import_xui_button","import_xui_core","import_react","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/web/index.mjs CHANGED
@@ -186,6 +186,8 @@ var Box = React2.forwardRef(
186
186
  as,
187
187
  src,
188
188
  alt,
189
+ onError,
190
+ onLoad,
189
191
  type,
190
192
  disabled,
191
193
  id,
@@ -199,6 +201,8 @@ var Box = React2.forwardRef(
199
201
  {
200
202
  src,
201
203
  alt: alt || "",
204
+ onError,
205
+ onLoad,
202
206
  style: {
203
207
  display: "block",
204
208
  objectFit: "cover",
package/web/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ColorPicker.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../../foundation/primitives-web/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":["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 styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\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 = true;\nexport const isNative = false;\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,SAAS,cAAAA,aAAY,UAAAC,SAAQ,YAAAC,iBAAgB;;;ACA7C,OAAOC,YAAW;AAClB,OAAO,YAAY;;;ACDnB,OAAO,WAAW;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA,EAE9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,kBAAkB,KAAsB;AAC/C,MAAI,yBAAyB,IAAI,GAAG,EAAG,QAAO;AAC9C,SAAO,0BAAY,GAAG;AACxB;AAgBO,SAAS,sBAAsB,YAAoB;AACxD,QAAM,YAAY,MAAM;AAAA,IACtB,CAAC,EAAE,UAAU,aAAa,GAAG,MAAM,GAAG,QAAQ;AAC5C,YAAM,MAAO,eAA0B;AACvC,YAAM,YAAqC,CAAC;AAC5C,iBAAW,OAAO,OAAO,KAAK,KAAK,GAAG;AAC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ACZ,gBAAAA;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,gBAAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,SAAQ;AAAA,kBACR,OAAO;AAAA,kBACP,WAAU;AAAA,kBACV,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,KAAC,aAAU,IAAK,gBAAAA,KAAC,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,KAAC,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","React","React","IconButton","useResolvedTheme","isNative","useCallback","useEffect","useRef","useState","jsx","useRef","useState","useEffect","useCallback","useCallback","useEffect","useRef","useState","jsx","useRef","useState","useCallback","useEffect","useEffect","useState","jsx","useState","useEffect","useEffect","useState","Input","jsx","useState","useEffect","Input","jsx","jsx","forwardRef","useResolvedTheme","useRef","useState","isNative","IconButton"]}
1
+ {"version":3,"sources":["../../src/ColorPicker.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../../foundation/primitives-web/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":["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 styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\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 = true;\nexport const isNative = false;\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,SAAS,cAAAA,aAAY,UAAAC,SAAQ,YAAAC,iBAAgB;;;ACA7C,OAAOC,YAAW;AAClB,OAAO,YAAY;;;ACDnB,OAAO,WAAW;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA,EAE9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,kBAAkB,KAAsB;AAC/C,MAAI,yBAAyB,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IconButton","useResolvedTheme","isNative","useCallback","useEffect","useRef","useState","jsx","useRef","useState","useEffect","useCallback","useCallback","useEffect","useRef","useState","jsx","useRef","useState","useCallback","useEffect","useEffect","useState","jsx","useState","useEffect","useEffect","useState","Input","jsx","useState","useEffect","Input","jsx","jsx","forwardRef","useResolvedTheme","useRef","useState","isNative","IconButton"]}