import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
import React__default, { forwardRef } from 'react';
import { cx } from '../../utils/index.js';
import { base as base$1 } from './variations/_size/base.js';
import { base as base$2 } from './variations/_gap/base.js';
import { base as base$4 } from './variations/_shape/base.js';
import { base as base$3 } from './variations/_orientation/base.js';
import { base as base$5 } from './variations/_stretching/base.js';
import { base } from './TextFieldGroup.styles.js';
import { classes } from './TextFieldGroup.tokens.js';

var _excluded = ["children", "className", "size", "stretching", "gap", "orientation", "shape", "isCommonTextFieldStyles"];
var textFieldGroupRoot = function textFieldGroupRoot(Root) {
  return /*#__PURE__*/forwardRef(function (props, ref) {
    var children = props.children,
      className = props.className,
      size = props.size,
      _props$stretching = props.stretching,
      stretching = _props$stretching === void 0 ? 'auto' : _props$stretching,
      _props$gap = props.gap,
      gap = _props$gap === void 0 ? 'dense' : _props$gap,
      _props$orientation = props.orientation,
      orientation = _props$orientation === void 0 ? 'horizontal' : _props$orientation,
      _props$shape = props.shape,
      shape = _props$shape === void 0 ? 'default' : _props$shape,
      _props$isCommonTextFi = props.isCommonTextFieldStyles,
      isCommonTextFieldStyles = _props$isCommonTextFi === void 0 ? true : _props$isCommonTextFi,
      rest = _objectWithoutProperties(props, _excluded);
    var orientationClass = classes[orientation];
    var gapClass = classes[gap];
    var shapeClass = classes[shape];
    var stretchingClass = classes["".concat(stretching, "Stretching")];
    var overrideStylesClass = isCommonTextFieldStyles ? classes.textFieldGroupOverrideStyles : undefined;
    return /*#__PURE__*/React__default.createElement(Root, _extends({
      ref: ref,
      size: size,
      gap: gap,
      shape: shape,
      orientation: orientation,
      className: cx(overrideStylesClass, orientationClass, gapClass, shapeClass, stretchingClass, className)
    }, rest), children);
  });
};
var textFieldGroupConfig = {
  name: 'TextFieldGroup',
  tag: 'div',
  layout: textFieldGroupRoot,
  base: base,
  variations: {
    size: {
      css: base$1
    },
    gap: {
      css: base$2
    },
    orientation: {
      css: base$3
    },
    shape: {
      css: base$4
    },
    stretching: {
      css: base$5
    }
  },
  defaults: {
    size: 'm',
    gap: 'dense',
    orientation: 'horizontal',
    shape: 'default',
    stretching: 'auto'
  }
};

export { textFieldGroupConfig, textFieldGroupRoot };
