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AU;oBAAE,KAAK;gBAAQ;aAAE;YACpD;gBAAC,CAAA,GAAA,6CAAkB;gBAAG;aAAY;YAClC;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBACb,GAAG,UAAU;oBACb,KAAK;oBACL,UAAU,MAAM,KAAK,CAAC,cAAc,CAAC,MAAM,OAAO,EAAE;gBACtD;aAAE;YACF;gBAAC,CAAA,GAAA,mDAAwB;gBAAG;2BAAC;gCAAO;oBAAY,WAAW;oBAAU,aAAa;oBAAY,YAAY,MAAM,UAAU;gBAAA;aAAE;SAC7H;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;;AAG3C","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   * @selector [data-orientation=\"horizontal | vertical\"]\n   */\n  orientation: Orientation,\n  /**\n   * Whether the color slider is disabled.\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean,\n  /**\n   * State of the color slider.\n   */\n  state: ColorSliderState\n}\n\nexport interface ColorSliderProps extends Omit<AriaColorSliderProps, 'label'>, RenderProps<ColorSliderRenderProps>, 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-ColorSlider'\n   */\n  className?: ClassNameOrFunction<ColorSliderRenderProps>\n}\n\nexport const ColorSliderContext = 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(props: ColorSliderProps, ref: ForwardedRef<HTMLDivElement>) {\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(\n    !props['aria-label'] && !props['aria-labelledby']\n  );\n  let {\n    trackProps,\n    thumbProps,\n    inputProps,\n    labelProps,\n    outputProps\n  } = useColorSlider({\n    ...props,\n    label,\n    trackRef,\n    inputRef\n  }, state);\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        [LabelContext, {\n          ...labelProps,\n          ref: labelRef,\n          children: state.value.getChannelName(props.channel, locale)\n        }],\n        [InternalColorThumbContext, {state, thumbProps, inputXRef: inputRef, xInputProps: inputProps, isDisabled: props.isDisabled}]\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    </Provider>\n  );\n});\n"],"names":[],"version":3,"file":"ColorSlider.cjs.map"}