import { jsx } from 'react/jsx-runtime';
import React__default from 'react';
import { buttonGroupTheme } from './ButtonGroup.theme.js';
import { cn } from '../../../utils/cn.js';

const ButtonGroupText = React__default.forwardRef(({ children, className = "", asChild = false, ...props }, ref) => {
    // If asChild is true, clone the child element with our styles
    if (asChild && React__default.isValidElement(children)) {
        return React__default.cloneElement(children, {
            ref,
            className: cn(buttonGroupTheme.textStyles, children.props.className, className),
        });
    }
    // Otherwise, render as a div
    return (jsx("div", { ref: ref, className: cn(buttonGroupTheme.textStyles, className), ...props, children: children }));
});
ButtonGroupText.displayName = "ButtonGroupText";

export { ButtonGroupText };
