"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireWildcard(require("react"));
var _SideContent = _interopRequireDefault(require("./components/SideContent"));
var _TabItems = _interopRequireDefault(require("./components/TabItems"));
var _TabsSt = require("./Tabs.st.css.js");
var _Tabs = require("./Tabs.constants");
var _HorizontalScroll = _interopRequireDefault(require("../HorizontalScroll"));
var _deprecationLog = _interopRequireDefault(require("../utils/deprecationLog"));
var _excluded = ["dataHook", "className", "activeId", "hasDivider", "items", "minWidth", "type", "size", "sideContent", "width", "alignment", "onClick", "scrollOnOverflow", "horizontalScrollProps", "horizontalPadding"];
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/Tabs/Tabs.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var Tabs = _ref => {
  var _props$showDivider;
  var {
      dataHook,
      className,
      activeId,
      hasDivider = true,
      // TODO: add default value to showDivider once hasDivider is removed
      items,
      minWidth,
      type,
      size = _Tabs.SIZE.medium,
      sideContent,
      width,
      alignment,
      onClick,
      scrollOnOverflow,
      horizontalScrollProps,
      horizontalPadding = true
    } = _ref,
    props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var showDivider = (_props$showDivider = props.showDivider) !== null && _props$showDivider !== void 0 ? _props$showDivider : hasDivider;
  var tabItemsProps = {
    className,
    activeId,
    hasDivider,
    items,
    minWidth,
    type,
    size,
    width,
    alignment,
    onClick,
    scrollOnOverflow
  };
  (0, _react.useEffect)(() => {
    if (hasDivider) {
      (0, _deprecationLog.default)('<Tabs/> - prop "hasDivider" is deprecated and will be removed in next major release, please use "showDivider" property instead.');
    }
  }, [hasDivider]);
  return /*#__PURE__*/_react.default.createElement("div", {
    "data-divider": showDivider,
    "data-hook": dataHook,
    className: (0, _TabsSt.st)(_TabsSt.classes.container, {
      showDivider,
      size,
      horizontalPadding,
      scrollOnOverflow
    }, className),
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 52,
      columnNumber: 5
    }
  }, scrollOnOverflow ? /*#__PURE__*/_react.default.createElement(_HorizontalScroll.default, (0, _extends2.default)({}, horizontalScrollProps, {
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 67,
      columnNumber: 9
    }
  }), /*#__PURE__*/_react.default.createElement(_TabItems.default, (0, _extends2.default)({}, tabItemsProps, {
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 68,
      columnNumber: 11
    }
  }))) : /*#__PURE__*/_react.default.createElement(_TabItems.default, (0, _extends2.default)({}, tabItemsProps, {
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 71,
      columnNumber: 9
    }
  })), /*#__PURE__*/_react.default.createElement(_SideContent.default, {
    content: sideContent,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 73,
      columnNumber: 7
    }
  }));
};
Tabs.displayName = 'Tabs';
var _default = exports.default = Tabs;
//# sourceMappingURL=Tabs.js.map