require("./CheckboxGroup.css");
var $af04e099a53d3e85$exports = require("./Checkbox.cjs");
var $a0b996a550bb0891$exports = require("./Field.cjs");
var $bfa4962d90c8af48$exports = require("./Form.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $7mIZM$reactjsxruntime = require("react/jsx-runtime");
var $7mIZM$reactariacomponents = require("react-aria-components");
var $7mIZM$react = require("react");
var $7mIZM$reactspectrumutils = require("@react-spectrum/utils");


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

$parcel$export(module.exports, "CheckboxGroupContext", () => $883687908275b504$export$baf37c4be89255b8);
$parcel$export(module.exports, "CheckboxGroup", () => $883687908275b504$export$4aa08d5625cb8ead);
/*
 * 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 $883687908275b504$export$baf37c4be89255b8 = /*#__PURE__*/ (0, $7mIZM$react.createContext)(null);
const $883687908275b504$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, $7mIZM$react.forwardRef)(function CheckboxGroup(props, ref) {
    [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $883687908275b504$export$baf37c4be89255b8);
    let formContext = (0, $7mIZM$react.useContext)((0, $bfa4962d90c8af48$exports.FormContext));
    props = (0, $bfa4962d90c8af48$exports.useFormProps)(props);
    let { label: label, description: description, errorMessage: errorMessage, children: children, labelPosition: labelPosition = 'top', labelAlign: labelAlign = 'start', necessityIndicator: necessityIndicator = 'icon', size: size = 'M', orientation: orientation = 'vertical', UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, isEmphasized: isEmphasized, ...groupProps } = props;
    let domRef = (0, $7mIZM$reactspectrumutils.useDOMRef)(ref);
    return /*#__PURE__*/ (0, $7mIZM$reactjsxruntime.jsx)((0, $7mIZM$reactariacomponents.CheckboxGroup), {
        ...groupProps,
        ref: domRef,
        style: UNSAFE_style,
        className: UNSAFE_className + function anonymous(props, overrides) {
            let rules = " ";
            let gridColumnStart = false;
            let gridColumnEnd = false;
            let matches = String(overrides || '').matchAll(/(?:^|\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);
            for (let p of matches){
                if (p[1] === "z") gridColumnStart = true;
                if (p[1] === "y") gridColumnEnd = true;
                rules += p[0];
            }
            rules += ' se12';
            if (props.isInForm) {
                if (!gridColumnStart) rules += ' z2mU12';
            }
            if (props.isInForm) {
                if (props.labelPosition === "side") {
                    if (!gridColumnEnd) rules += ' yvoofG12';
                }
            }
            if (props.isInForm) rules += ' DLwlgod12';
            else {
                if (props.labelPosition === "side") rules += ' DPlN5qb12';
                else if (props.labelPosition === "top") rules += ' DM8Mfn12';
            }
            if (props.labelPosition === "side") rules += ' EPlN5qb12';
            else if (props.labelPosition === "top") rules += ' E4w1sLc12';
            if (props.labelPosition === "side") rules += ' CbRM95c12';
            else if (props.labelPosition === "top") rules += ' Cxaocre12';
            if (props.size === "XL") {
                rules += ' -_6BNtrc-e12';
                rules += ' vx12';
            } else if (props.size === "L") {
                rules += ' -_6BNtrc-d12';
                rules += ' vx12';
            } else if (props.size === "S") {
                rules += ' -_6BNtrc-b12';
                rules += ' vx12';
            } else if (props.size === "XS") {
                rules += ' -_6BNtrc-a12';
                rules += ' vx12';
            } else {
                rules += ' -_6BNtrc-c12';
                rules += ' vx12';
            }
            rules += ' ea12';
            rules += ' _Fd12';
            rules += ' _FnuYUweb12';
            if (props.size === "XL") rules += ' -BhX7R-Fz12';
            else if (props.size === "L") rules += ' -BhX7R-Fv12';
            else if (props.size === "S") rules += ' -BhX7R-Fp12';
            else if (props.size === "XS") rules += ' -BhX7R-Fn12';
            else rules += ' -BhX7R-Fx12';
            rules += ' -AJjOLd-UVxyPec12';
            rules += ' qg12';
            rules += ' __ca12';
            return rules;
        }({
            size: props.size,
            labelPosition: labelPosition,
            isInForm: !!formContext
        }, props.styles),
        children: ({ isDisabled: isDisabled, isInvalid: isInvalid })=>/*#__PURE__*/ (0, $7mIZM$reactjsxruntime.jsxs)((0, $7mIZM$reactjsxruntime.Fragment), {
                children: [
                    /*#__PURE__*/ (0, $7mIZM$reactjsxruntime.jsx)((0, $a0b996a550bb0891$exports.FieldLabel), {
                        includeNecessityIndicatorInAccessibilityName: true,
                        isDisabled: isDisabled,
                        isRequired: props.isRequired,
                        size: size,
                        labelPosition: labelPosition,
                        labelAlign: labelAlign,
                        necessityIndicator: necessityIndicator,
                        contextualHelp: props.contextualHelp,
                        children: label
                    }),
                    /*#__PURE__*/ (0, $7mIZM$reactjsxruntime.jsx)("div", {
                        className: function anonymous(props) {
                            let rules = " ";
                            rules += ' zXcEWr12';
                            rules += ' yXcEWr12';
                            rules += ' BXcEWr12';
                            rules += ' AXcEWr12';
                            rules += ' sd12';
                            if (props.orientation === "horizontal") rules += ' _tc12';
                            else if (props.orientation === "vertical") rules += ' _ta12';
                            rules += ' _Fd12';
                            rules += ' _FnuYUweb12';
                            rules += ' UgOnRt12';
                            rules += ' ql12';
                            rules += ' _wb12';
                            return rules;
                        }({
                            orientation: orientation
                        }),
                        children: /*#__PURE__*/ (0, $7mIZM$reactjsxruntime.jsx)((0, $bfa4962d90c8af48$exports.FormContext).Provider, {
                            value: {
                                ...formContext,
                                size: size,
                                isRequired: undefined
                            },
                            children: /*#__PURE__*/ (0, $7mIZM$reactjsxruntime.jsx)((0, $af04e099a53d3e85$exports.CheckboxContext).Provider, {
                                value: {
                                    isEmphasized: isEmphasized
                                },
                                children: children
                            })
                        })
                    }),
                    /*#__PURE__*/ (0, $7mIZM$reactjsxruntime.jsx)((0, $a0b996a550bb0891$exports.HelpText), {
                        size: size,
                        isDisabled: isDisabled,
                        isInvalid: isInvalid,
                        description: description,
                        showErrorIcon: true,
                        children: errorMessage
                    })
                ]
            })
    });
});


//# sourceMappingURL=CheckboxGroup.cjs.map
