require("./SelectBoxGroup.css");
var $af04e099a53d3e85$exports = require("./Checkbox.cjs");
var $dba2b18fc5727f9b$exports = require("./Checkmark.cjs");
var $bde97c91243ed164$exports = require("../icons/Icon.cjs");
var $2061c83559b50a66$exports = require("./pressScale.cjs");
var $6367bc87eb7d24ad$exports = require("./Content.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $gGDF1$reactjsxruntime = require("react/jsx-runtime");
var $gGDF1$reactariacomponents = require("react-aria-components");
var $gGDF1$react = require("react");
var $gGDF1$reactaria = require("react-aria");


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

$parcel$export(module.exports, "SelectBoxGroupContext", () => $6a3953abb7deb063$export$cad91f7528e8dc08);
$parcel$export(module.exports, "SelectBox", () => $6a3953abb7deb063$export$ebde6d4e7862fe9d);
$parcel$export(module.exports, "SelectBoxGroup", () => $6a3953abb7deb063$export$da87cf13fc2ef3d8);
/*
 * Copyright 2025 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 CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */ 









const $6a3953abb7deb063$var$SelectBoxContext = /*#__PURE__*/ (0, $gGDF1$react.createContext)({
    orientation: 'vertical'
});
const $6a3953abb7deb063$export$cad91f7528e8dc08 = /*#__PURE__*/ (0, $gGDF1$react.createContext)(null);
const $6a3953abb7deb063$var$labelOnly = ':has([slot=label]):not(:has([slot=description]))';
const $6a3953abb7deb063$var$noIllustration = ':not(:has([slot=illustration]))';
const $6a3953abb7deb063$var$selectBoxStyles = function anonymous(props, overrides) {
    let rules = " ";
    let position = false;
    let width = false;
    let minWidth = false;
    let maxWidth = 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] === "_P") position = true;
        if (p[1] === "Z") width = true;
        if (p[1] === "N") minWidth = true;
        if (p[1] === "L") maxWidth = true;
        rules += p[0];
    }
    if (props.isFocusVisible) rules += ' _Lf11';
    else rules += ' _Le11';
    rules += ' Oh11';
    rules += ' Olc11';
    rules += ' _Mc11';
    rules += ' _Kd11';
    rules += ' se11';
    rules += ' __yM8Mfn11';
    if (!position) rules += ' _Pc11';
    rules += ' uk11';
    rules += ' ucJ9TBTb11';
    rules += ' ud3Euai11';
    rules += ' uea11';
    rules += ' ugb11';
    rules += ' uhd11';
    rules += ' uje11';
    rules += ' u2NhKxcl11';
    rules += ' uic11';
    rules += ' -_6BNtrc-c11';
    rules += ' vx11';
    rules += ' xb11';
    rules += ' _xa11';
    rules += ' _Fd11';
    rules += ' _FnuYUweb11';
    if (props.isDisabled) rules += ' pp11';
    rules += ' ri11';
    rules += ' _oa11';
    rules += ' _Nc11';
    rules += ' Pc11';
    if (props.orientation === "horizontal") {
        if (!width) rules += ' ZAK24ue11';
    } else if (!width) rules += ' Z75oWv11';
    if (props.orientation === "horizontal") rules += ' Fd11';
    else rules += ' F75oWv11';
    if (props.orientation === "horizontal") {
        if (!minWidth) rules += ' NBzUiud11';
    } else if (!minWidth) rules += ' NQGV3L11';
    if (props.orientation === "horizontal") rules += ' -_5yLdZ-ZILqIYb11';
    else rules += ' -_5yLdZ-Z75oWv11';
    if (!maxWidth) rules += ' Lqz07Zc11';
    if (props.orientation === "horizontal") rules += ' MKniM11';
    else rules += ' MQGV3L11';
    if (props.orientation === "horizontal") rules += ' KDvO7ld11';
    else rules += ' K75oWv11';
    if (props.orientation === "horizontal") rules += ' Tf11';
    else rules += ' Th11';
    if (props.orientation === "horizontal") rules += ' Qf11';
    else rules += ' Qh11';
    if (props.orientation === "horizontal") rules += ' Sk11';
    if (props.orientation === "horizontal") rules += ' Rh11';
    if (props.orientation === "horizontal") {
        rules += ' CtXiS9b11';
        rules += ' CbWiMddxbX3ib11';
    } else if (props.orientation === "vertical") rules += ' CfwsTtd11';
    if (props.orientation === "horizontal") {
        rules += ' E5HJqj11';
        rules += ' E1099pdfYMhHd11';
    } else if (props.orientation === "vertical") rules += ' EY7ZLHe11';
    if (props.orientation === "horizontal") rules += ' DJSAqje11';
    if (props.orientation === "vertical") rules += ' _cb11';
    rules += ' oc11';
    rules += ' nc11';
    rules += ' kc11';
    rules += ' jc11';
    rules += ' _jf11';
    if (props.isDisabled) rules += ' iA11';
    else if (props.isSelected) rules += ' in11';
    else rules += ' iA11';
    if (props.isDisabled) rules += ' gH11';
    else rules += ' g_g11';
    if (props.isDisabled) rules += ' _nd11';
    else if (props.isSelected) rules += ' _nLeasBb11';
    else if (props.isHovered) rules += ' _nLeasBb11';
    else rules += ' _n4zCLMe11';
    rules += ' _kc11';
    rules += ' hc11';
    rules += ' mc11';
    rules += ' lc11';
    rules += ' Yd11';
    rules += ' Xb11';
    rules += ' _2b11';
    return rules;
};
const $6a3953abb7deb063$var$illustrationContainer = function anonymous(props) {
    let rules = " ";
    rules += ' zTZ8xtd11';
    rules += ' yTZ8xtd11';
    rules += ' BTZ8xtd11';
    rules += ' ATZ8xtd11';
    rules += ' _dc11';
    rules += ' __Ab11';
    rules += ' Nl11';
    rules += ' Mk11';
    if (props.isDisabled) rules += ' -_8sjo0b-pp11';
    else {
        if (props.isPressed) rules += ' -_8sjo0b-po11';
        else if (props.isFocusVisible) rules += ' -_8sjo0b-po11';
        else if (props.isHovered) rules += ' -_8sjo0b-po11';
        else rules += ' -_8sjo0b-pt11';
    }
    return rules;
};
const $6a3953abb7deb063$var$descriptionText = function anonymous(props) {
    let rules = " ";
    rules += ' z9u7zPc11';
    rules += ' y9u7zPc11';
    rules += ' B9u7zPc11';
    rules += ' A9u7zPc11';
    rules += ' _dc11';
    if (props.orientation === "vertical") rules += ' sk11';
    else rules += ' sb11';
    rules += ' _Nc11';
    rules += ' Pc11';
    if (props.orientation === "horizontal") rules += ' _Wd11';
    else rules += ' _Wa11';
    if (props.isDisabled) rules += ' pp11';
    else {
        if (props.isPressed) rules += ' po11';
        else if (props.isFocusVisible) rules += ' po11';
        else if (props.isHovered) rules += ' po11';
        else rules += ' pt11';
    }
    return rules;
};
const $6a3953abb7deb063$var$labelText = function anonymous(props) {
    let rules = " ";
    rules += ' zv6x9r11';
    rules += ' yv6x9r11';
    rules += ' Bv6x9r11';
    rules += ' Av6x9r11';
    rules += ' _dc11';
    if (props.orientation === "horizontal") rules += ' __Ad11';
    else rules += ' __Ab11';
    rules += ' Za11';
    rules += ' _Nc11';
    rules += ' Pc11';
    rules += ' Na11';
    if (props.orientation === "horizontal") rules += ' _Wd11';
    else rules += ' _Wa11';
    rules += ' _7c11';
    rules += ' _Yb11';
    if (props.orientation === "horizontal") {
        rules += ' xd11';
        rules += ' _xa11';
        rules += ' xX0cczbc11';
        rules += ' _xX0cczba11';
    }
    if (props.isDisabled) rules += ' pp11';
    else {
        if (props.isPressed) rules += ' po11';
        else if (props.isFocusVisible) rules += ' po11';
        else if (props.isHovered) rules += ' po11';
        else rules += ' pt11';
    }
    return rules;
};
const $6a3953abb7deb063$var$gridStyles = 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 += ' se11';
    rules += ' __yM8Mfn11';
    rules += ' Uj11';
    rules += ' qj11';
    rules += ' _Ca11';
    if (props.orientation === "vertical") rules += ' -kN2jP-Z75oWv11';
    else if (props.orientation === "horizontal") rules += ' -kN2jP-ZAK24ue11';
    if (props.orientation === "vertical") rules += ' -LWGJg-ZQGV3L11';
    else if (props.orientation === "horizontal") rules += ' -LWGJg-ZBzUiud11';
    if (props.orientation === "vertical") rules += ' DnG8gle11';
    else if (props.orientation === "horizontal") rules += ' DnG8gle11';
    return rules;
};
function $6a3953abb7deb063$export$ebde6d4e7862fe9d(props) {
    let { children: children, isDisabled: individualDisabled = false, UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className, styles: styles, ...otherProps } = props;
    let { orientation: orientation = 'vertical', isDisabled: groupDisabled = false } = (0, $gGDF1$react.useContext)($6a3953abb7deb063$var$SelectBoxContext);
    const isDisabled = individualDisabled || groupDisabled;
    const ref = (0, $gGDF1$react.useRef)(null);
    let { isFocusVisible: isFocusVisible } = (0, $gGDF1$reactaria.useFocusVisible)();
    return /*#__PURE__*/ (0, $gGDF1$reactjsxruntime.jsx)((0, $gGDF1$reactariacomponents.ListBoxItem), {
        isDisabled: isDisabled,
        ref: ref,
        className: (renderProps)=>(UNSAFE_className || '') + $6a3953abb7deb063$var$selectBoxStyles({
                ...renderProps,
                isFocusVisible: isFocusVisible && renderProps.isFocused,
                orientation: orientation
            }, styles),
        style: (0, $2061c83559b50a66$exports.pressScale)(ref, UNSAFE_style),
        ...otherProps,
        children: ({ isSelected: isSelected, isDisabled: isDisabled, isHovered: isHovered, selectionMode: selectionMode })=>{
            return /*#__PURE__*/ (0, $gGDF1$reactjsxruntime.jsxs)((0, $gGDF1$reactjsxruntime.Fragment), {
                children: [
                    /*#__PURE__*/ (0, $gGDF1$reactjsxruntime.jsx)("div", {
                        className: " _Pa11 WJ11 _AI11 _Ob11",
                        "aria-hidden": "true",
                        children: !isDisabled && selectionMode === 'multiple' && /*#__PURE__*/ (0, $gGDF1$reactjsxruntime.jsx)("div", {
                            className: (0, $af04e099a53d3e85$exports.box)({
                                isSelected: isSelected,
                                isDisabled: isDisabled,
                                size: 'M'
                            }),
                            children: /*#__PURE__*/ (0, $gGDF1$reactjsxruntime.jsx)((0, $dba2b18fc5727f9b$exports.default), {
                                size: "S",
                                className: (0, $af04e099a53d3e85$exports.iconStyles)
                            })
                        })
                    }),
                    /*#__PURE__*/ (0, $gGDF1$reactjsxruntime.jsx)((0, $gGDF1$reactariacomponents.Provider), {
                        values: [
                            [
                                (0, $bde97c91243ed164$exports.IllustrationContext),
                                {
                                    size: 'S',
                                    styles: $6a3953abb7deb063$var$illustrationContainer({
                                        size: 'S',
                                        orientation: orientation,
                                        isDisabled: isDisabled,
                                        isHovered: isHovered
                                    })
                                }
                            ],
                            [
                                (0, $6367bc87eb7d24ad$exports.TextContext),
                                {
                                    slots: {
                                        [(0, $gGDF1$reactariacomponents.DEFAULT_SLOT)]: {
                                            styles: $6a3953abb7deb063$var$labelText({
                                                orientation: orientation,
                                                isDisabled: isDisabled,
                                                isHovered: isHovered
                                            })
                                        },
                                        label: {
                                            styles: $6a3953abb7deb063$var$labelText({
                                                orientation: orientation,
                                                isDisabled: isDisabled,
                                                isHovered: isHovered
                                            })
                                        },
                                        description: {
                                            styles: $6a3953abb7deb063$var$descriptionText({
                                                orientation: orientation,
                                                isDisabled: isDisabled,
                                                isHovered: isHovered
                                            })
                                        }
                                    }
                                }
                            ]
                        ],
                        children: children
                    })
                ]
            });
        }
    });
}
const $6a3953abb7deb063$export$da87cf13fc2ef3d8 = /*#__PURE__*/ (0, $gGDF1$react.forwardRef)(function SelectBoxGroup(props, ref) {
    [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $6a3953abb7deb063$export$cad91f7528e8dc08);
    let { children: children, selectionMode: selectionMode = 'single', orientation: orientation = 'vertical', isDisabled: isDisabled = false, UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style, styles: styles, ...otherProps } = props;
    const selectBoxContextValue = (0, $gGDF1$react.useMemo)(()=>({
            orientation: orientation,
            isDisabled: isDisabled
        }), [
        orientation,
        isDisabled
    ]);
    return /*#__PURE__*/ (0, $gGDF1$reactjsxruntime.jsx)($6a3953abb7deb063$var$SelectBoxContext.Provider, {
        value: selectBoxContextValue,
        children: /*#__PURE__*/ (0, $gGDF1$reactjsxruntime.jsx)((0, $gGDF1$reactariacomponents.ListBox), {
            selectionMode: selectionMode,
            layout: "grid",
            orientation: orientation,
            className: (UNSAFE_className || '') + $6a3953abb7deb063$var$gridStyles({
                orientation: orientation
            }, styles),
            style: UNSAFE_style,
            ...otherProps,
            children: children
        })
    });
});


//# sourceMappingURL=SelectBoxGroup.cjs.map
