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UAAU;oBAAE,KAAK;gBAAQ;aAAE;YACpD;gBAAC,CAAA,GAAA,6CAAkB;gBAAG;aAAY;YAClC;gBACE,CAAA,GAAA,sCAAW;gBACX;oBACE,GAAG,UAAU;oBACb,KAAK;oBACL,UAAU,MAAM,KAAK,CAAC,cAAc,CAAC,MAAM,OAAO,EAAE;gBACtD;aACD;YACD;gBACE,CAAA,GAAA,mDAAwB;gBACxB;2BACE;gCACA;oBACA,WAAW;oBACX,aAAa;oBACb,YAAY,MAAM,UAAU;gBAC9B;aACD;SACF;qBACD,0DAAC,CAAA,GAAA,6BAAE,EAAE,GAAG;QACL,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,oBAAkB,MAAM,WAAW;QACnC,iBAAe,MAAM,UAAU,IAAI;;AAI3C","sources":["packages/react-aria-components/src/ColorSlider.tsx"],"sourcesContent":["import {AriaColorSliderProps, useColorSlider} from 'react-aria/useColorSlider';\nimport {\n  ClassNameOrFunction,\n  ContextValue,\n  dom,\n  Provider,\n  RenderProps,\n  SlotProps,\n  useContextProps,\n  useRenderProps,\n  useSlot\n} from './utils';\nimport {ColorSliderState, useColorSliderState} from 'react-stately/useColorSliderState';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {InternalColorThumbContext} from './ColorThumb';\nimport {LabelContext} from './Label';\nimport {Orientation} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {SliderOutputContext, SliderStateContext, SliderTrackContext} from './Slider';\nimport {useLocale} from 'react-aria/I18nProvider';\n\nexport interface ColorSliderRenderProps {\n  /**\n   * The orientation of the color slider.\n   *\n   * @selector [data-orientation=\"horizontal | vertical\"]\n   */\n  orientation: Orientation;\n  /**\n   * Whether the color slider is disabled.\n   *\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean;\n  /**\n   * State of the color slider.\n   */\n  state: ColorSliderState;\n}\n\nexport interface ColorSliderProps\n  extends\n    Omit<AriaColorSliderProps, 'label'>,\n    RenderProps<ColorSliderRenderProps>,\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-ColorSlider'\n   */\n  className?: ClassNameOrFunction<ColorSliderRenderProps>;\n}\n\nexport const ColorSliderContext =\n  createContext<ContextValue<Partial<ColorSliderProps>, HTMLDivElement>>(null);\nexport const ColorSliderStateContext = createContext<ColorSliderState | null>(null);\n\n/**\n * A color slider allows users to adjust an individual channel of a color value.\n */\nexport const ColorSlider = forwardRef(function ColorSlider(\n  props: ColorSliderProps,\n  ref: ForwardedRef<HTMLDivElement>\n) {\n  [props, ref] = useContextProps(props, ref, ColorSliderContext);\n  let {locale} = useLocale();\n  let state = useColorSliderState({...props, locale});\n  let trackRef = React.useRef(null);\n  let inputRef = React.useRef(null);\n\n  let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n  let {trackProps, thumbProps, inputProps, labelProps, outputProps} = useColorSlider(\n    {\n      ...props,\n      label,\n      trackRef,\n      inputRef\n    },\n    state\n  );\n\n  let renderProps = useRenderProps({\n    ...props,\n    values: {\n      orientation: state.orientation,\n      isDisabled: state.isDisabled,\n      state\n    },\n    defaultClassName: 'react-aria-ColorSlider'\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n  delete DOMProps.id;\n\n  return (\n    <Provider\n      values={[\n        [ColorSliderStateContext, state],\n        [SliderStateContext, state],\n        [SliderTrackContext, {...trackProps, ref: trackRef}],\n        [SliderOutputContext, outputProps],\n        [\n          LabelContext,\n          {\n            ...labelProps,\n            ref: labelRef,\n            children: state.value.getChannelName(props.channel, locale)\n          }\n        ],\n        [\n          InternalColorThumbContext,\n          {\n            state,\n            thumbProps,\n            inputXRef: inputRef,\n            xInputProps: inputProps,\n            isDisabled: props.isDisabled\n          }\n        ]\n      ]}>\n      <dom.div\n        {...DOMProps}\n        {...renderProps}\n        ref={ref}\n        slot={props.slot || undefined}\n        data-orientation={state.orientation}\n        data-disabled={state.isDisabled || undefined}\n      />\n    </Provider>\n  );\n});\n"],"names":[],"version":3,"file":"ColorSlider.cjs.map"}