require("./ColorSwatchPicker.css");
var $8b1ea085cefae738$exports = require("./ColorSwatch.cjs");
var $150382364eecc4bc$exports = require("./useDOMRef.cjs");
var $ac757a4c2bd72aee$exports = require("../../icons/useSpectrumContextProps.cjs");
var $7eldL$reactjsxruntime = require("react/jsx-runtime");
var $7eldL$reactariacomponentsColorSwatchPicker = require("react-aria-components/ColorSwatchPicker");
var $7eldL$react = require("react");


function $parcel$export(e, n, v, s) {
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}

$parcel$export(module.exports, "ColorSwatchPickerContext", () => $a267e3efa7024819$export$7214f50881fc1eaf);
$parcel$export(module.exports, "ColorSwatchPicker", () => $a267e3efa7024819$export$b46792416e3d8515);
/*
 * Copyright 2024 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */ 





const $a267e3efa7024819$export$7214f50881fc1eaf = /*#__PURE__*/ (0, $7eldL$react.createContext)(null);
const $a267e3efa7024819$export$b46792416e3d8515 = /*#__PURE__*/ (0, $7eldL$react.forwardRef)(function ColorSwatchPicker(props, ref) {
    [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $a267e3efa7024819$export$7214f50881fc1eaf);
    let { density: density = 'regular', size: size = 'M', rounding: rounding = 'none', UNSAFE_className: UNSAFE_className = '', ...otherProps } = props;
    let domRef = (0, $150382364eecc4bc$exports.useDOMRef)(ref);
    return /*#__PURE__*/ (0, $7eldL$reactjsxruntime.jsx)((0, $7eldL$reactariacomponentsColorSwatchPicker.ColorSwatchPicker), {
        ...otherProps,
        ref: domRef,
        className: UNSAFE_className + function anonymous(props, overrides) {
            let rules = " ";
            rules += (String(overrides || '').match(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L)[^\s]+/g) || []).join('');
            rules += ' sd12';
            rules += ' _wb12';
            if (props.density === "spacious") rules += ' UWJpoB12';
            else if (props.density === "regular") rules += ' Ub12';
            else if (props.density === "compact") rules += ' Ua12';
            if (props.density === "spacious") rules += ' qWJpoB12';
            else if (props.density === "regular") rules += ' qb12';
            else if (props.density === "compact") rules += ' qa12';
            return rules;
        }({
            density: density
        }, props.styles),
        children: /*#__PURE__*/ (0, $7eldL$reactjsxruntime.jsx)((0, $8b1ea085cefae738$exports.InternalColorSwatchContext).Provider, {
            value: {
                useWrapper: $a267e3efa7024819$var$useWrapper,
                size: size,
                rounding: rounding
            },
            children: props.children
        })
    });
});
function $a267e3efa7024819$var$useWrapper(swatch, color, rounding) {
    return /*#__PURE__*/ (0, $7eldL$reactjsxruntime.jsx)((0, $7eldL$reactariacomponentsColorSwatchPicker.ColorSwatchPickerItem), {
        color: color,
        className: (renderProps)=>(function anonymous(props) {
                let rules = " ";
                if (props.isFocusVisible) rules += ' _Lf12';
                else rules += ' _Le12';
                rules += ' Oh12';
                rules += ' Olc12';
                rules += ' _Mc12';
                rules += ' _Kd12';
                rules += ' _Pc12';
                if (props.rounding === "full") rules += ' og12';
                else if (props.rounding === "default") rules += ' oa12';
                else if (props.rounding === "none") rules += ' od12';
                if (props.rounding === "full") rules += ' ng12';
                else if (props.rounding === "default") rules += ' na12';
                else if (props.rounding === "none") rules += ' nd12';
                if (props.rounding === "full") rules += ' kg12';
                else if (props.rounding === "default") rules += ' ka12';
                else if (props.rounding === "none") rules += ' kd12';
                if (props.rounding === "full") rules += ' jg12';
                else if (props.rounding === "default") rules += ' ja12';
                else if (props.rounding === "none") rules += ' jd12';
                rules += ' __ca12';
                return rules;
            })({
                ...renderProps,
                rounding: rounding
            }),
        children: ({ isSelected: isSelected })=>/*#__PURE__*/ (0, $7eldL$reactjsxruntime.jsxs)((0, $7eldL$reactjsxruntime.Fragment), {
                children: [
                    swatch,
                    isSelected && /*#__PURE__*/ (0, $7eldL$reactjsxruntime.jsx)("div", {
                        "aria-hidden": true,
                        className: " _Pa12 _Ob12 Wr12 _lr12 _Ar12 _zr12 _oa12 in12 _jf12 _kc12 hc12 mc12 lc12 Og12 _Lf12 _Mc12 _Kc12 _yb12 oi12 ni12 ki12 ji12"
                    })
                ]
            })
    });
}


//# sourceMappingURL=ColorSwatchPicker.cjs.map
