{"version":3,"file":"ColorPicker.mjs","names":[],"sources":["../../../src/color-picker/ColorPicker.tsx"],"sourcesContent":["/*!\n *\n *  Copyright (c) \"Neo4j\"\n *  Neo4j Sweden AB [http://neo4j.com]\n *\n *  This file is part of Neo4j.\n *\n *  Neo4j is free software: you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation, either version 3 of the License, or\n *  (at your option) any later version.\n *\n *  This program is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\nimport 'eyedropper-polyfill';\n\nimport { tokens } from '@neo4j-ndl/base';\nimport {\n  type HexColor,\n  hexToHsva,\n  type HsvaColor,\n  hsvaToHex,\n  hsvaToRgba,\n  Hue,\n  type PointerProps,\n  type RgbaColor,\n  rgbaToHex,\n  rgbaToHsva,\n  Saturation,\n  validHex,\n} from '@uiw/react-color';\nimport classNames from 'classnames';\nimport { forwardRef, useEffect, useMemo, useState } from 'react';\n\nimport { CleanIconButton } from '../clean-icon-button';\nimport { EyeDropperIconOutline } from '../icons/generated/heroIcons/EyeDropperIconOutline';\nimport { Select } from '../select';\nimport { TextInput } from '../text-input';\n\n/**\n * @remarks\n * By default the `swatches` prop is set to the available graph colors (`tokens.graph`) from `@neo4j-ndl/base`.\n *\n * @remarks\n * Where `HsvaColor`, `RgbaColor`, and `HexColor` types are from `@uiw/react-color`, and represent different color formats:\n *\n * - `HexColor`: A string in the format `#RRGGBB` (e.g., `#ff0000`).\n * - `RgbaColor`: An object with numeric properties `{ r, g, b, a }` for red, green, blue (0–255), and alpha (0–1).\n * - `HsvaColor`: An object with numeric properties `{ h, s, v, a }` for hue (0–360), saturation (0–100), value (0–100), and alpha (0–1).\n *\n * Visit [react-color](https://uiwjs.github.io/react-color/#/) for more information.\n */\ntype ColorPickerProps = {\n  /** The current color value. Can be provided in HSVA, RGBA, or Hex format. The component will automatically convert between formats as needed. */\n  color: HsvaColor | RgbaColor | HexColor;\n  /** Optional array of predefined color swatches for quick selection. Each swatch can be in HSVA, RGBA, or Hex format. */\n  swatches?: (HsvaColor | RgbaColor | HexColor)[];\n  /** Whether to display the eye dropper tool that allows users to sample colors from anywhere on the screen. */\n  shouldShowEyeDropper?: boolean;\n  /** Callback function triggered when the color value changes. Receives an object containing the new color in all three formats (hex, rgb, hsva) for convenience. */\n  onChange: (newColor: {\n    hex: HexColor;\n    rgb: RgbaColor;\n    hsva: HsvaColor;\n  }) => void;\n  /** Additional class name to apply to the root color picker container. */\n  className?: string;\n  /** Additional inline styles to apply to the root color picker container. */\n  style?: React.CSSProperties;\n\n  /** The target element to portal the menu to. If not provided, the menu will not be portaled. */\n  portalTarget?: HTMLElement | null;\n  /** The floating strategy to use for the menu. If not provided, the menu will be positioned absolutely. */\n  floatingStrategy?: 'absolute' | 'fixed';\n};\n\nexport const ColorPicker = forwardRef<HTMLDivElement, ColorPickerProps>(\n  function ColorPicker(\n    {\n      color,\n      onChange,\n      swatches = Object.values(tokens.graph).filter(validHex),\n      shouldShowEyeDropper = true,\n      className,\n      style,\n      portalTarget,\n      floatingStrategy = 'absolute',\n    },\n    ref,\n  ) {\n    const [isEyeDropperActiveState, setIsEyeDropperActiveState] =\n      useState(false);\n\n    const derivedHsva = useMemo(() => {\n      if (typeof color === 'string') {\n        return hexToHsva(color);\n      }\n      if (typeof color === 'object' && 'r' in color) {\n        return rgbaToHsva(color);\n      }\n      return { h: 0, s: 0, v: 0, ...(color as object), a: 1 } as HsvaColor; // oxlint-disable-line id-length\n    }, [color]);\n\n    const [hsva, setHsva] = useState<HsvaColor>(derivedHsva);\n\n    const [format, setFormat] = useState<{\n      label: string;\n      value: string;\n    }>({\n      label: 'Hex',\n      value: 'hex',\n    });\n\n    const isEyeDropperActive = 'EyeDropper' in window && shouldShowEyeDropper;\n\n    const handleChange = (hsva: HsvaColor) => {\n      setHsva(hsva);\n      const hex = hsvaToHex(hsva);\n      const rgb = hsvaToRgba(hsva);\n      onChange({\n        // used since typescript cannot infer the type of the color\n        hex: `#${hex.split('#')[1]}`,\n        hsva,\n        rgb,\n      });\n    };\n\n    return (\n      <div\n        ref={ref}\n        className={classNames('ndl-color-picker', className)}\n        style={style}\n      >\n        <Saturation\n          hsva={hsva}\n          className=\"ndl-color-picker-saturation\"\n          onChange={(newColor) => {\n            handleChange({ ...hsva, ...newColor, a: hsva.a }); // oxlint-disable-line id-length\n          }}\n          pointer={({ left, top, ...props }) => (\n            <Pointer\n              left={left?.toString()}\n              top={top?.toString()}\n              {...props}\n              hsva={hsva}\n            />\n          )}\n          radius={tokens.borderRadius['lg']}\n        />\n        <Swatch\n          colors={swatches}\n          hsva={hsva}\n          onChange={(newColor) => {\n            handleChange(newColor);\n          }}\n        />\n\n        <div className=\"ndl-color-picker-hue-container\">\n          {isEyeDropperActive && (\n            <CleanIconButton\n              size=\"small\"\n              isActive={isEyeDropperActiveState}\n              onClick={() => {\n                setIsEyeDropperActiveState(true);\n                const eyeDropper = new window.EyeDropper();\n                eyeDropper\n                  .open()\n                  .then((result: { sRGBHex: string }) => {\n                    handleChange(hexToHsva(result.sRGBHex));\n                  })\n                  .catch((err: Error) => {\n                    console.error(err);\n                  })\n                  .finally(() => {\n                    setIsEyeDropperActiveState(false);\n                  });\n              }}\n              description=\"Pick color from the screen with eye dropper tool\"\n            >\n              <EyeDropperIconOutline />\n            </CleanIconButton>\n          )}\n          <Hue\n            className=\"ndl-color-picker-hue\"\n            hue={hsva.h}\n            onChange={(newHue) => {\n              handleChange({ ...hsva, h: newHue.h }); // oxlint-disable-line id-length\n            }}\n            radius={tokens.borderRadius['lg']}\n            pointer={(props) => (\n              <Pointer\n                {...props}\n                hsva={{\n                  a: 1, // oxlint-disable-line id-length\n                  h: hsva.h, // oxlint-disable-line id-length\n                  s: 100, // oxlint-disable-line id-length\n                  v: 100, // oxlint-disable-line id-length\n                }}\n              />\n            )}\n          />\n        </div>\n\n        <div className=\"ndl-color-picker-inputs\">\n          <Select\n            size=\"small\"\n            type=\"select\"\n            ariaLabel=\"Color format\"\n            style={{\n              flexShrink: 0,\n            }}\n            selectProps={{\n              isSearchable: false,\n              menuPortalTarget: portalTarget,\n              menuPosition: floatingStrategy,\n              onChange: (newFormat) => {\n                if (!newFormat) {\n                  return;\n                }\n                setFormat({\n                  label: newFormat.label,\n                  value: newFormat.value,\n                });\n              },\n              options: [\n                {\n                  label: 'Hex',\n                  value: 'hex',\n                },\n                {\n                  label: 'RGB',\n                  value: 'rgb',\n                },\n              ],\n              value: { label: format.label, value: format.value },\n            }}\n          />\n          {format.value === 'hex' && (\n            <HexInput\n              hsva={hsva}\n              onChange={(newColor) => {\n                handleChange(hexToHsva(newColor));\n              }}\n            />\n          )}\n          {format.value === 'rgb' && (\n            <RgbInput\n              hsva={hsva}\n              onChange={(newColor) => {\n                handleChange(hexToHsva(newColor));\n              }}\n            />\n          )}\n        </div>\n      </div>\n    );\n  },\n);\n\nconst removeHashPrefix = (hex: string): string => hex.replace('#', '');\n\nconst HexInput = ({\n  hsva,\n  onChange,\n}: {\n  hsva: HsvaColor;\n  onChange: (newColor: string) => void;\n}) => {\n  const [inputValue, setInputValue] = useState<string>(() =>\n    removeHashPrefix(hsvaToHex(hsva)),\n  );\n\n  // Update input value when hsva changes from outside\n  useEffect(() => {\n    setInputValue(removeHashPrefix(hsvaToHex(hsva)));\n  }, [hsva]);\n\n  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n    const value = removeHashPrefix(event.target.value);\n\n    // Always update the input value for immediate feedback\n    setInputValue(value);\n\n    // Check if the input is a valid hex color (only 6 characters)\n    const isValidHex = /^[0-9A-Fa-f]{6}$/.test(value);\n\n    if (isValidHex) {\n      onChange(`#${value}`);\n    }\n  };\n\n  const hexValue = hsvaToHex(hsva);\n\n  return (\n    <TextInput\n      size=\"small\"\n      value={inputValue}\n      leadingElement={\n        <div className=\"ndl-color-picker-hex-input-prefix\">#</div>\n      }\n      onChange={handleChange}\n      isFluid\n      htmlAttributes={{\n        'aria-label': 'Hex color code',\n        maxLength: 6,\n        onCopy: (event) => {\n          event.preventDefault();\n          navigator.clipboard.writeText(hexValue);\n        },\n      }}\n    />\n  );\n};\n\nconst RgbInput = ({\n  hsva,\n  onChange,\n}: {\n  hsva: HsvaColor;\n  onChange: (newColor: string) => void;\n}) => {\n  const rgba = hsvaToRgba(hsva);\n  const [rgbValues, setRgbValues] = useState({\n    b: rgba.b, // oxlint-disable-line id-length\n    g: rgba.g, // oxlint-disable-line id-length\n    r: rgba.r, // oxlint-disable-line id-length\n  });\n\n  // Update input values when hsva changes from outside\n  useEffect(() => {\n    const newRgba = hsvaToRgba(hsva);\n    setRgbValues({\n      b: newRgba.b, // oxlint-disable-line id-length\n      g: newRgba.g, // oxlint-disable-line id-length\n      r: newRgba.r, // oxlint-disable-line id-length\n    });\n  }, [hsva]);\n\n  const handleChange = (\n    channel: 'r' | 'g' | 'b',\n    event: React.ChangeEvent<HTMLInputElement>,\n  ) => {\n    const value = parseInt(event.target.value, 10);\n\n    // Validate the input is a number between 0-255\n    const validValue = isNaN(value) ? 0 : Math.max(0, Math.min(255, value));\n\n    const newRgbValues = {\n      ...rgbValues,\n      [channel]: validValue,\n    };\n\n    setRgbValues(newRgbValues);\n\n    // Convert RGB to hex and call onChange\n    const hexColor = `#${newRgbValues.r.toString(16).padStart(2, '0')}${newRgbValues.g.toString(16).padStart(2, '0')}${newRgbValues.b.toString(16).padStart(2, '0')}`;\n    onChange(hexColor);\n  };\n\n  return (\n    <div className=\"ndl-color-picker-rgb-inputs\">\n      <TextInput\n        size=\"small\"\n        className=\"ndl-color-picker-rgb-input\"\n        value={rgbValues.r.toString()}\n        onChange={(event) => handleChange('r', event)}\n        htmlAttributes={{\n          'aria-label': 'Red',\n          max: '255',\n          min: '0',\n          type: 'number',\n        }}\n      />\n      <TextInput\n        size=\"small\"\n        className=\"ndl-color-picker-rgb-input\"\n        value={rgbValues.g.toString()}\n        onChange={(event) => handleChange('g', event)}\n        htmlAttributes={{\n          'aria-label': 'Green',\n          max: '255',\n          min: '0',\n          type: 'number',\n        }}\n      />\n      <TextInput\n        size=\"small\"\n        className=\"ndl-color-picker-rgb-input\"\n        value={rgbValues.b.toString()}\n        onChange={(event) => handleChange('b', event)}\n        htmlAttributes={{\n          'aria-label': 'Blue',\n          max: '255',\n          min: '0',\n          type: 'number',\n        }}\n      />\n    </div>\n  );\n};\n\nconst Swatch = ({\n  colors,\n  onChange,\n  hsva,\n}: {\n  colors: (HsvaColor | RgbaColor | HexColor)[];\n  hsva: HsvaColor;\n  onChange: (newColor: HsvaColor) => void;\n}) => {\n  return (\n    <div className=\"ndl-color-picker-swatch\">\n      {colors.map((color) => {\n        const hexColor =\n          typeof color === 'string'\n            ? color\n            : typeof color === 'object' && 'r' in color\n              ? rgbaToHex(color)\n              : hsvaToHex(color);\n        const hsvaColor =\n          typeof color === 'string'\n            ? hexToHsva(color)\n            : 'r' in color\n              ? rgbaToHsva(color)\n              : color;\n\n        const isActive =\n          hsva.h === hsvaColor.h &&\n          hsva.s === hsvaColor.s &&\n          hsva.v === hsvaColor.v;\n\n        return (\n          <button\n            type=\"button\"\n            key={hexColor}\n            aria-label={hexColor}\n            className={classNames('ndl-color-picker-swatch-color', {\n              'ndl-color-picker-swatch-color-active': isActive,\n            })}\n            style={{ backgroundColor: hsvaToHex(hsvaColor) }}\n            onClick={() => onChange(hsvaColor)}\n          />\n        );\n      })}\n    </div>\n  );\n};\nconst Pointer = ({\n  prefixCls,\n  left,\n  top,\n  hsva,\n}: PointerProps & { hsva: HsvaColor }) => {\n  const rgba = hsvaToRgba(hsva);\n  return (\n    <div\n      style={{\n        backgroundColor: `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`,\n        left,\n        top,\n      }}\n      className={classNames(prefixCls, 'ndl-color-picker-pointer')}\n    />\n  );\n};\n"],"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