import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { forwardRef } from "react";
import { textFieldAddon } from "./textFieldAddonStyles.js";
/**
 * This component is used to add an icon before or after the text field with
 * correct styling.
 */ export const TextFieldAddon = /*#__PURE__*/ forwardRef(function TextFieldAddon(props, ref) {
    const { after, disabled, pointerEvents, children, className, ...remaining } = props;
    if (!children) {
        return null;
    }
    if (disabled) {
        return /*#__PURE__*/ _jsx(_Fragment, {
            children: children
        });
    }
    return /*#__PURE__*/ _jsx("span", {
        ...remaining,
        ref: ref,
        className: textFieldAddon({
            after,
            presentational: !pointerEvents,
            className
        }),
        children: children
    });
});

//# sourceMappingURL=TextFieldAddon.js.map