{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoCO,MAAM,0DACX,CAAA,GAAA,0BAAY,EAAkD;AAKzD,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAC7C,KAAuB,EACvB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,oBAAC,gBAAgB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,6CAAa,EAAE;IAC/C,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,cAAc,iBAAiB,KAAK;QACpC,QAAQ;mBACN;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,qCAAS,EAAE,UAAU,kBAAkB,YAAY;QACvD,MAAM,MAAM,IAAI,IAAI;QACpB,KAAK;;AAGX","sources":["packages/react-aria-components/src/ColorSwatch.tsx"],"sourcesContent":["import {AriaColorSwatchProps, useColorSwatch} from 'react-aria/useColorSwatch';\nimport {\n  ClassNameOrFunction,\n  ContextValue,\n  dom,\n  SlotProps,\n  StyleRenderProps,\n  useContextProps,\n  useRenderProps\n} from './utils';\nimport {Color} from 'react-stately/Color';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface ColorSwatchRenderProps {\n  /** The color of the swatch. */\n  color: Color;\n}\n\nexport interface ColorSwatchProps\n  extends\n    AriaColorSwatchProps,\n    StyleRenderProps<ColorSwatchRenderProps>,\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-ColorSwatch'\n   */\n  className?: ClassNameOrFunction<ColorSwatchRenderProps>;\n}\n\nexport const ColorSwatchContext =\n  createContext<ContextValue<ColorSwatchProps, HTMLDivElement>>(null);\n\n/**\n * A ColorSwatch displays a preview of a selected color.\n */\nexport const ColorSwatch = forwardRef(function ColorSwatch(\n  props: ColorSwatchProps,\n  ref: ForwardedRef<HTMLDivElement>\n) {\n  [props, ref] = useContextProps(props, ref, ColorSwatchContext);\n  let {colorSwatchProps, color} = useColorSwatch(props);\n  let renderProps = useRenderProps({\n    ...props,\n    defaultClassName: 'react-aria-ColorSwatch',\n    defaultStyle: colorSwatchProps.style,\n    values: {\n      color\n    }\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <dom.div\n      {...mergeProps(DOMProps, colorSwatchProps, renderProps)}\n      slot={props.slot || undefined}\n      ref={ref}\n    />\n  );\n});\n"],"names":[],"version":3,"file":"ColorSwatch.cjs.map"}