"use client";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { forwardRef } from "react";
import { TextFieldAddon } from "./TextFieldAddon.js";
import { getFormConfig } from "./formConfig.js";
import { textFieldContainer } from "./textFieldContainerStyles.js";
/**
 * **Client Component**
 * This might be able to become a server component if I remove the useFormTheme hook
 *
 * This component is used to add the additional `TextField`, `TextArea`, and
 * `Select` theme styles.
 *
 * @internal
 */ export const TextFieldContainer = /*#__PURE__*/ forwardRef(function TextFieldContainer(props, ref) {
    const { children, className, dense = false, error = false, label = false, active = false, inline = false, stretch = false, readOnly = false, disabled = false, leftAddon, leftAddonProps, disableLeftAddonStyles = false, rightAddon, rightAddonProps, disableRightAddonStyles = false, theme: propTheme, underlineDirection: propUnderlineDirection, ...remaining } = props;
    const theme = getFormConfig("theme", propTheme);
    const underlineDirection = getFormConfig("underlineDirection", propUnderlineDirection);
    return /*#__PURE__*/ _jsxs("div", {
        ...remaining,
        ref: ref,
        className: textFieldContainer({
            theme,
            dense,
            error,
            label,
            inline,
            active,
            stretch,
            readOnly,
            disabled,
            className,
            leftAddon: !!leftAddon && !disableLeftAddonStyles,
            rightAddon: !!rightAddon && !disableRightAddonStyles,
            underlineDirection
        }),
        children: [
            /*#__PURE__*/ _jsx(TextFieldAddon, {
                ...leftAddonProps,
                disabled: disableLeftAddonStyles,
                children: leftAddon
            }),
            children,
            /*#__PURE__*/ _jsx(TextFieldAddon, {
                ...rightAddonProps,
                disabled: disableRightAddonStyles,
                after: true,
                children: rightAddon
            })
        ]
    });
});

//# sourceMappingURL=TextFieldContainer.js.map