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MAAM,UAAU;QAC5B,cAAc;QACd,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC7B,GAAG,UAAU;qBACd,0DAAC;QAAI,MAAK;qBACR,0DAAC;QACC,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC7B,GAAG,CAAA,GAAA,qCAAS,EAAE,aAAa,WAAW;QACvC,KAAK;sBAEP,0DAAC;QACC,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC7B,GAAG,CAAA,GAAA,qCAAS,EAAE,aAAa,WAAW;QACvC,KAAK;;AAMjB","sources":["packages/@adobe/react-spectrum/src/color/ColorArea.tsx"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaColorAreaProps, useColorArea} from 'react-aria/useColorArea';\n\nimport {classNames} from '../utils/classNames';\nimport {ColorAreaContext} from 'react-aria-components/ColorArea';\nimport {ColorThumb} from './ColorThumb';\nimport {dimensionValue, useStyleProps} from '../utils/styleProps';\nimport {DimensionValue, FocusableRef, StyleProps} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {ReactElement, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/colorarea/vars.css';\nimport {useColorAreaState} from 'react-stately/useColorAreaState';\nimport {useContextProps} from 'react-aria-components/slots';\nimport {useFocusableRef} from '../utils/useDOMRef';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumColorAreaProps\n  extends AriaColorAreaProps, Omit<StyleProps, 'width' | 'height'> {\n  /** Size of the Color Area. */\n  size?: DimensionValue;\n}\n\n/**\n * ColorArea allows users to adjust two channels of an RGB, HSL or HSB color value against a\n * two-dimensional gradient background.\n */\nexport const ColorArea = React.forwardRef(function ColorArea(\n  props: SpectrumColorAreaProps,\n  ref: FocusableRef<HTMLDivElement>\n) {\n  props = useProviderProps(props);\n  let inputXRef = useRef(null);\n  let inputYRef = useRef(null);\n  let containerRef = useFocusableRef(ref, inputXRef);\n  [props, containerRef] = useContextProps(props, containerRef, ColorAreaContext);\n\n  let {isDisabled} = props;\n  let size = props.size && dimensionValue(props.size);\n  let {styleProps} = useStyleProps(props);\n\n  let state = useColorAreaState(props);\n\n  let {colorAreaProps, xInputProps, yInputProps, thumbProps} = useColorArea(\n    {...props, inputXRef, inputYRef, containerRef},\n    state\n  );\n  let {focusProps, isFocusVisible} = useFocusRing();\n\n  return (\n    <div\n      {...colorAreaProps}\n      className={classNames(\n        styles,\n        'spectrum-ColorArea',\n        {\n          'is-disabled': isDisabled\n        },\n        styleProps.className\n      )}\n      ref={containerRef}\n      style={{\n        ...(isDisabled ? {} : colorAreaProps.style),\n        ...styleProps.style,\n        // Workaround around https://github.com/adobe/spectrum-css/issues/1032\n        width: size,\n        height: size\n      }}>\n      <ColorThumb\n        value={state.getDisplayColor()}\n        isFocused={isFocusVisible}\n        isDisabled={isDisabled}\n        isDragging={state.isDragging}\n        containerRef={containerRef}\n        className={classNames(styles, 'spectrum-ColorArea-handle')}\n        {...thumbProps}>\n        <div role=\"presentation\">\n          <input\n            className={classNames(styles, 'spectrum-ColorArea-slider')}\n            {...mergeProps(xInputProps, focusProps)}\n            ref={inputXRef}\n          />\n          <input\n            className={classNames(styles, 'spectrum-ColorArea-slider')}\n            {...mergeProps(yInputProps, focusProps)}\n            ref={inputYRef}\n          />\n        </div>\n      </ColorThumb>\n    </div>\n  );\n}) as (props: SpectrumColorAreaProps & {ref?: FocusableRef<HTMLDivElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"ColorArea.cjs.map"}