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ourcesContent":["import {AriaColorAreaProps, useColorArea} from 'react-aria/useColorArea';\nimport {\n  ClassNameOrFunction,\n  ContextValue,\n  dom,\n  Provider,\n  RenderProps,\n  SlotProps,\n  useContextProps,\n  useRenderProps\n} from './utils';\nimport {ColorAreaState, useColorAreaState} from 'react-stately/useColorAreaState';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {InternalColorThumbContext} from './ColorThumb';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef, useRef} from 'react';\n\nexport interface ColorAreaRenderProps {\n  /**\n   * Whether the color area is disabled.\n   *\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean;\n  /**\n   * State of the color area.\n   */\n  state: ColorAreaState;\n}\n\nexport interface ColorAreaProps\n  extends\n    AriaColorAreaProps,\n    RenderProps<ColorAreaRenderProps>,\n    SlotProps,\n    GlobalDOMAttributes<HTMLDivElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element. A function may be provided to compute the class based on component state.\n   *\n   * @default 'react-aria-ColorArea'\n   */\n  className?: ClassNameOrFunction<ColorAreaRenderProps>;\n}\n\nexport const ColorAreaContext =\n  createContext<ContextValue<Partial<ColorAreaProps>, HTMLDivElement>>(null);\nexport const ColorAreaStateContext = createContext<ColorAreaState | null>(null);\n\n/**\n * A color area 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 = forwardRef(function ColorArea(\n  props: ColorAreaProps,\n  ref: ForwardedRef<HTMLDivElement>\n) {\n  [props, ref] = useContextProps(props, ref, ColorAreaContext);\n  let inputXRef = useRef(null);\n  let inputYRef = useRef(null);\n\n  let state = useColorAreaState(props);\n  let {colorAreaProps, xInputProps, yInputProps, thumbProps} = useColorArea(\n    {\n      ...props,\n      inputXRef,\n      inputYRef,\n      containerRef: ref\n    },\n    state\n  );\n\n  let renderProps = useRenderProps({\n    ...props,\n    defaultClassName: 'react-aria-ColorArea',\n    defaultStyle: colorAreaProps.style,\n    values: {\n      state,\n      isDisabled: props.isDisabled || false\n    }\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n  delete DOMProps.id;\n\n  return (\n    <dom.div\n      ref={ref}\n      {...mergeProps(DOMProps, colorAreaProps, renderProps)}\n      slot={props.slot || undefined}\n      data-disabled={props.isDisabled || undefined}>\n      <Provider\n        values={[\n          [ColorAreaStateContext, state],\n          [\n            InternalColorThumbContext,\n            {\n              state,\n              thumbProps,\n              inputXRef,\n              xInputProps,\n              inputYRef,\n              yInputProps,\n              isDisabled: props.isDisabled\n            }\n          ]\n        ]}>\n        {renderProps.children}\n      </Provider>\n    </dom.div>\n  );\n});\n"],"names":[],"version":3,"file":"ColorArea.mjs.map"}