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ved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ChildrenOrFunction, Provider, SlotProps, SlottedContextValue, useRenderProps, useSlottedContext} from './utils';\nimport {Color} from 'react-stately/Color';\n\nimport {ColorAreaContext} from './ColorArea';\n\nimport {ColorFieldContext} from './ColorField';\nimport {\n  ColorPickerState,\n  ColorPickerProps as StatelyColorPickerProps,\n  useColorPickerState\n} from 'react-stately/useColorPickerState';\nimport {ColorSliderContext} from './ColorSlider';\nimport {ColorSwatchContext} from './ColorSwatch';\nimport {ColorSwatchPickerContext} from './ColorSwatchPicker';\nimport {ColorWheelContext} from './ColorWheel';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, JSX} from 'react';\n\nexport interface ColorPickerRenderProps {\n  /** The currently selected color. */\n  color: Color\n}\n\nexport interface ColorPickerProps extends StatelyColorPickerProps, SlotProps {\n  /** The children of the component. A function may be provided to alter the children based on component state. */\n  children: ChildrenOrFunction<ColorPickerRenderProps>\n}\n\nexport const ColorPickerContext = createContext<SlottedContextValue<ColorPickerProps>>(null);\nexport const ColorPickerStateContext = createContext<ColorPickerState | null>(null);\n\n/**\n * A ColorPicker synchronizes a color value between multiple React Aria color components.\n * It simplifies building color pickers with customizable layouts via composition.\n */\nexport function ColorPicker(props: ColorPickerProps): JSX.Element {\n  let ctx = useSlottedContext(ColorPickerContext, props.slot);\n  props = mergeProps(ctx, props);\n  let state = useColorPickerState(props);\n  let renderProps = useRenderProps({\n    ...props,\n    values: {\n      color: state.color\n    }\n  });\n\n  return (\n    <Provider\n      values={[\n        [ColorPickerStateContext, state],\n        [ColorSliderContext, {value: state.color, onChange: state.setColor}],\n        [ColorAreaContext, {value: state.color, onChange: state.setColor}],\n        [ColorWheelContext, {value: state.color, onChange: state.setColor}],\n        [ColorFieldContext, {value: state.color, onChange: state.setColor}],\n        [ColorSwatchContext, {color: state.color}],\n        [ColorSwatchPickerContext, {value: state.color, onChange: state.setColor}]\n      ]}>\n      {renderProps.children}\n    </Provider>\n  );\n}\n"],"names":[],"version":3,"file":"ColorPicker.mjs.map"}