'use strict';

var jsxRuntime = require('react/jsx-runtime');
var primitives_Field = require('./primitives/Field.js');

function SelectFieldWrapper({ id, label, error, helpText, errorId, helpTextId, isDisabled, required, testIdPrefix, labelProps, className, children, }) {
    const hasField = !!(label || error || helpText);
    if (!hasField) {
        return (jsxRuntime.jsx("div", { className: className, ...(testIdPrefix
                ? { "data-testid": `${testIdPrefix}-select-container-wrapper` }
                : {}), children: children }));
    }
    return (jsxRuntime.jsxs(primitives_Field.Field, { "data-disabled": isDisabled || undefined, "data-invalid": !!error || undefined, className: className, ...(testIdPrefix
            ? { "data-testid": `${testIdPrefix}-select-container-wrapper` }
            : {}), children: [label && (jsxRuntime.jsxs(primitives_Field.FieldLabel, { htmlFor: id, ...labelProps, ...(testIdPrefix
                    ? { "data-testid": `${testIdPrefix}-input-label` }
                    : {}), children: [label, required && (jsxRuntime.jsx("span", { "aria-hidden": "true", className: "text-destructive", children: "*" }))] })), jsxRuntime.jsxs(primitives_Field.FieldContent, { children: [children, !!error && (jsxRuntime.jsx(primitives_Field.FieldError, { id: errorId, ...(testIdPrefix
                            ? { "data-testid": `${testIdPrefix}-select-error` }
                            : {}), children: error })), helpText && (jsxRuntime.jsx(primitives_Field.FieldDescription, { id: helpTextId, ...(testIdPrefix
                            ? { "data-testid": `${testIdPrefix}-select-help-text` }
                            : {}), children: helpText }))] })] }));
}

exports.SelectFieldWrapper = SelectFieldWrapper;
//# sourceMappingURL=SelectFieldWrapper-DEA--2wj.js.map
