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B,EAAE,GAAiC;IAC/H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,QAAQ,CAAA,GAAA,iBAAS,EAAE;IACvB,6DAA6D;IAC7D,IAAI,aAAC,SAAS,SAAE,KAAK,EAAE,GAAG,MAAK,GAAG;IAElC,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,YAAY,MAAM,UAAU;mBAC5B;QACF;IACF;IAEA,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACL,GAAG,IAAI;QACP,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;;AAEzC","sources":["packages/react-aria-components/src/ColorWheel.tsx"],"sourcesContent":["import {AriaColorWheelOptions, useColorWheel} from 'react-aria/useColorWheel';\nimport {\n  ClassNameOrFunction,\n  ContextValue,\n  dom,\n  Provider,\n  RenderProps,\n  SlotProps,\n  StyleRenderProps,\n  useContextProps,\n  useRenderProps\n} from './utils';\nimport {ColorWheelState, useColorWheelState} from 'react-stately/useColorWheelState';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {InternalColorThumbContext} from './ColorThumb';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, useContext, useRef} from 'react';\n\nexport interface ColorWheelRenderProps {\n  /**\n   * Whether the color wheel is disabled.\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean,\n  /**\n   * State of the color wheel.\n   */\n  state: ColorWheelState\n}\n\nexport interface ColorWheelProps extends AriaColorWheelOptions, RenderProps<ColorWheelRenderProps>, 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-ColorWheel'\n   */\n  className?: ClassNameOrFunction<ColorWheelRenderProps>\n}\n\nexport const ColorWheelContext = createContext<ContextValue<Partial<ColorWheelProps>, HTMLDivElement>>(null);\nexport const ColorWheelStateContext = createContext<ColorWheelState | null>(null);\n\n/**\n * A color wheel allows users to adjust the hue of an HSL or HSB color value on a circular track.\n */\nexport const ColorWheel = forwardRef(function ColorWheel(props: ColorWheelProps, ref: ForwardedRef<HTMLDivElement>) {\n  [props, ref] = useContextProps(props, ref, ColorWheelContext);\n  let state = useColorWheelState(props);\n  let inputRef = useRef(null);\n  let {trackProps, inputProps, thumbProps} = useColorWheel(props, state, inputRef);\n\n  let renderProps = useRenderProps({\n    ...props,\n    values: {\n      state,\n      isDisabled: props.isDisabled || false\n    },\n    defaultClassName: 'react-aria-ColorWheel',\n    defaultStyle: {\n      position: 'relative'\n    }\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n  delete DOMProps.id;\n\n  return (\n    <dom.div\n      {...DOMProps}\n      {...renderProps}\n      ref={ref}\n      slot={props.slot || undefined}\n      data-disabled={props.isDisabled || undefined}>\n      <Provider\n        values={[\n          [ColorWheelStateContext, state],\n          [ColorWheelTrackContext, trackProps],\n          [InternalColorThumbContext, {state, thumbProps, inputXRef: inputRef, xInputProps: inputProps, isDisabled: props.isDisabled}]\n        ]}>\n        {renderProps.children}\n      </Provider>\n    </dom.div>\n  );\n});\n\nexport interface ColorWheelTrackRenderProps extends ColorWheelRenderProps {}\nexport interface ColorWheelTrackProps extends StyleRenderProps<ColorWheelTrackRenderProps>, 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-ColorWheelTrack'\n   */\n  className?: ClassNameOrFunction<ColorWheelTrackRenderProps>\n}\ninterface ColorWheelTrackContextValue extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>, StyleRenderProps<ColorWheelTrackRenderProps> {}\n\nexport const ColorWheelTrackContext = createContext<ContextValue<ColorWheelTrackContextValue, HTMLDivElement>>(null);\n\n/**\n * A color wheel track renders a circular gradient track.\n */\nexport const ColorWheelTrack = forwardRef(function ColorWheelTrack(props: ColorWheelTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n  [props, ref] = useContextProps(props, ref, ColorWheelTrackContext);\n  let state = useContext(ColorWheelStateContext)!;\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  let {className, style, ...rest} = props;\n\n  let renderProps = useRenderProps({\n    ...props,\n    defaultClassName: 'react-aria-ColorWheelTrack',\n    values: {\n      isDisabled: state.isDisabled,\n      state\n    }\n  });\n\n  return (\n    <dom.div\n      {...rest}\n      {...renderProps}\n      ref={ref}\n      data-disabled={state.isDisabled || undefined} />\n  );\n});\n"],"names":[],"version":3,"file":"ColorWheel.mjs.map"}