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react-aria-components/src/ColorArea.tsx"],"sourcesContent":["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   * @selector [data-disabled]\n   */\n  isDisabled: boolean,\n  /**\n   * State of the color area.\n   */\n  state: ColorAreaState\n}\n\nexport interface ColorAreaProps extends AriaColorAreaProps, RenderProps<ColorAreaRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n   * @default 'react-aria-ColorArea'\n   */\n  className?: ClassNameOrFunction<ColorAreaRenderProps>\n}\n\nexport const ColorAreaContext = 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 two-dimensional gradient background.\n */\nexport const ColorArea = forwardRef(function ColorArea(props: ColorAreaProps, ref: ForwardedRef<HTMLDivElement>) {\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 {\n    colorAreaProps,\n    xInputProps,\n    yInputProps,\n    thumbProps\n  } = useColorArea({\n    ...props,\n    inputXRef,\n    inputYRef,\n    containerRef: ref\n  }, state);\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          [InternalColorThumbContext, {state, thumbProps, inputXRef, xInputProps, inputYRef, yInputProps, isDisabled: props.isDisabled}]\n        ]}>\n        {renderProps.children}\n      </Provider>\n    </dom.div>\n  );\n});\n"],"names":[],"version":3,"file":"ColorArea.cjs.map"}