require("./TimeField.css");
var $d19642654b699f84$exports = require("./DateField.cjs");
var $a0b996a550bb0891$exports = require("./Field.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $gqnnu$reactjsxruntime = require("react/jsx-runtime");
var $gqnnu$reactariacomponents = require("react-aria-components");
var $gqnnu$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, "TimeFieldContext", () => $7b93ad26130ad3f8$export$8e17ddc448e87c1e);
$parcel$export(module.exports, "TimeField", () => $7b93ad26130ad3f8$export$5eaee2322dd727eb);
/*
 * 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 $7b93ad26130ad3f8$export$8e17ddc448e87c1e = /*#__PURE__*/ (0, $gqnnu$react.createContext)(null);
const $7b93ad26130ad3f8$export$5eaee2322dd727eb = /*#__PURE__*/ (0, $gqnnu$react.forwardRef)(function TimeField(props, ref) {
    [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $7b93ad26130ad3f8$export$8e17ddc448e87c1e);
    let { label: label, contextualHelp: contextualHelp, description: descriptionMessage, errorMessage: errorMessage, isRequired: isRequired, size: size = 'M', labelPosition: labelPosition = 'top', necessityIndicator: necessityIndicator, labelAlign: labelAlign = 'start', UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className, styles: styles, ...timeFieldProps } = props;
    let formContext = (0, $gqnnu$react.useContext)((0, $gqnnu$reactariacomponents.FormContext));
    return /*#__PURE__*/ (0, $gqnnu$reactjsxruntime.jsx)((0, $gqnnu$reactariacomponents.TimeField), {
        ref: ref,
        isRequired: isRequired,
        ...timeFieldProps,
        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 += ' se11';
            if (props.isInForm) {
                if (!gridColumnStart) rules += ' z2mU11';
            }
            if (props.isInForm) {
                if (props.labelPosition === "side") {
                    if (!gridColumnEnd) rules += ' yvoofG11';
                }
            }
            if (props.isInForm) rules += ' DLwlgod11';
            else {
                if (props.labelPosition === "side") rules += ' DPlN5qb11';
                else if (props.labelPosition === "top") rules += ' DM8Mfn11';
            }
            if (props.labelPosition === "side") rules += ' EPlN5qb11';
            else if (props.labelPosition === "top") rules += ' E4w1sLc11';
            if (props.labelPosition === "side") rules += ' CbRM95c11';
            else if (props.labelPosition === "top") rules += ' Cxaocre11';
            if (props.size === "XL") {
                rules += ' -_6BNtrc-e11';
                rules += ' vx11';
            } else if (props.size === "L") {
                rules += ' -_6BNtrc-d11';
                rules += ' vx11';
            } else if (props.size === "S") {
                rules += ' -_6BNtrc-b11';
                rules += ' vx11';
            } else if (props.size === "XS") {
                rules += ' -_6BNtrc-a11';
                rules += ' vx11';
            } else {
                rules += ' -_6BNtrc-c11';
                rules += ' vx11';
            }
            rules += ' ea11';
            rules += ' _Fd11';
            rules += ' _FnuYUweb11';
            if (props.size === "XL") rules += ' -BhX7R-Fz11';
            else if (props.size === "L") rules += ' -BhX7R-Fv11';
            else if (props.size === "S") rules += ' -BhX7R-Fp11';
            else if (props.size === "XS") rules += ' -BhX7R-Fn11';
            else rules += ' -BhX7R-Fx11';
            rules += ' -AJjOLd-UVkF0Db11';
            rules += ' qg11';
            rules += ' __ca11';
            return rules;
        }({
            isInForm: !!formContext,
            labelPosition: labelPosition,
            size: size
        }, styles),
        children: ({ isDisabled: isDisabled, isInvalid: isInvalid })=>{
            return /*#__PURE__*/ (0, $gqnnu$reactjsxruntime.jsxs)((0, $gqnnu$reactjsxruntime.Fragment), {
                children: [
                    /*#__PURE__*/ (0, $gqnnu$reactjsxruntime.jsx)((0, $a0b996a550bb0891$exports.FieldLabel), {
                        isDisabled: isDisabled,
                        isRequired: isRequired,
                        size: size,
                        labelPosition: labelPosition,
                        labelAlign: labelAlign,
                        necessityIndicator: necessityIndicator,
                        contextualHelp: contextualHelp,
                        children: label
                    }),
                    /*#__PURE__*/ (0, $gqnnu$reactjsxruntime.jsxs)((0, $a0b996a550bb0891$exports.FieldGroup), {
                        role: "presentation",
                        isDisabled: isDisabled,
                        isInvalid: isInvalid,
                        size: size,
                        styles: function anonymous(props) {
                            let rules = " ";
                            rules += ' zXcEWr11';
                            rules += ' yXcEWr11';
                            rules += ' BXcEWr11';
                            rules += ' AXcEWr11';
                            if (props.size === "XL") rules += ' Nl11';
                            else if (props.size === "L") rules += ' Nj11';
                            else if (props.size === "S") rules += ' Nf11';
                            else if (props.size === "XS") rules += ' Ne11';
                            else rules += ' Nk11';
                            if (props.isQuiet) rules += ' _qd11';
                            else rules += ' _qtb11';
                            if (props.size === "XL") rules += ' -Anxdcc-Zt11';
                            else if (props.size === "L") rules += ' -Anxdcc-ZStdtne11';
                            else if (props.size === "S") rules += ' -Anxdcc-Zr11';
                            else rules += ' -Anxdcc-Z3fn9H11';
                            rules += ' __v6TNLWb11';
                            rules += ' SMBFGYc11';
                            rules += ' RfBFGYc11';
                            rules += ' -S_-Sv11';
                            rules += ' -R_-Rv11';
                            return rules;
                        }({
                            size: size
                        }),
                        children: [
                            /*#__PURE__*/ (0, $gqnnu$reactjsxruntime.jsx)((0, $d19642654b699f84$exports.DateInputContainer), {
                                children: /*#__PURE__*/ (0, $gqnnu$reactjsxruntime.jsx)((0, $d19642654b699f84$exports.DateInput), {})
                            }),
                            /*#__PURE__*/ (0, $gqnnu$reactjsxruntime.jsx)((0, $d19642654b699f84$exports.InvalidIndicator), {
                                isInvalid: isInvalid,
                                isDisabled: isDisabled
                            })
                        ]
                    }),
                    /*#__PURE__*/ (0, $gqnnu$reactjsxruntime.jsx)((0, $a0b996a550bb0891$exports.HelpText), {
                        size: size,
                        isDisabled: isDisabled,
                        isInvalid: isInvalid,
                        description: descriptionMessage,
                        children: errorMessage
                    })
                ]
            });
        }
    });
});


//# sourceMappingURL=TimeField.cjs.map
