'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
var React = require('react');
var base = require('./variations/_view/base.js');
var base$1 = require('./variations/_size/base.js');
var DropdownGroup_styles = require('./DropdownGroup.styles.js');
var react = require('../../../../utils/react.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefault(React);

var _excluded = ["id", "labelClassName", "groupClassName", "label", "children", "role", "view", "size"];
/**
 * Элемент группы выпадающего списка
 */
var dropdownGroupRoot = function dropdownGroupRoot(Root) {
  return /*#__PURE__*/React.forwardRef(function (_ref, outerRootRef) {
    var id = _ref.id,
      labelClassName = _ref.labelClassName,
      groupClassName = _ref.groupClassName,
      label = _ref.label,
      children = _ref.children,
      role = _ref.role,
      view = _ref.view,
      size = _ref.size,
      rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
    var uniqId = react.safeUseId();
    var innerId = id || uniqId;
    return /*#__PURE__*/React__default.default.createElement(Root, {
      id: innerId,
      ref: outerRootRef,
      view: view,
      size: size,
      role: role
    }, /*#__PURE__*/React__default.default.createElement(DropdownGroup_styles.StyledDropdownLabel, {
      className: labelClassName
    }, label), /*#__PURE__*/React__default.default.createElement(DropdownGroup_styles.StyledDropdownGroup, _rollupPluginBabelHelpers.extends({
      className: groupClassName
    }, rest), children));
  });
};
var dropdownGroupConfig = {
  name: 'DropdownGroup',
  tag: 'div',
  layout: dropdownGroupRoot,
  base: '',
  variations: {
    view: {
      css: base.base
    },
    size: {
      css: base$1.base
    }
  },
  defaults: {
    view: 'primary',
    size: 'm'
  }
};

exports.dropdownGroupConfig = dropdownGroupConfig;
exports.dropdownGroupRoot = dropdownGroupRoot;
//# sourceMappingURL=DropdownGroup.js.map
