"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.TabContent = exports.TabBar = exports.Tab = exports.Root = void 0;

var _index = require("../styles/index.js");

var _constants = require("./constants.js");

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

/**
 * Main component container element
 */
var Root = (0, _index.styled)('div', function (props) {
  var $orientation = props.$orientation;
  return {
    display: 'flex',
    flexDirection: $orientation === _constants.ORIENTATION.vertical ? 'row' : 'column'
  };
});
exports.Root = Root;
Root.displayName = "Root";
var Tab = (0, _index.styled)('div', function (props) {
  var $disabled = props.$disabled,
      $active = props.$active,
      $orientation = props.$orientation,
      _props$$theme = props.$theme,
      colors = _props$$theme.colors,
      sizing = _props$$theme.sizing,
      typography = _props$$theme.typography;

  var style = _objectSpread({}, typography.font300, {
    boxSizing: 'border-box',
    color: $active ? colors.black : colors.mono800,
    cursor: $disabled ? 'not-allowed' : 'pointer',
    paddingTop: sizing.scale600,
    paddingBottom: sizing.scale600,
    paddingLeft: sizing.scale300,
    paddingRight: sizing.scale300,
    marginLeft: sizing.scale200,
    marginRight: sizing.scale200,
    borderBottom: $orientation === _constants.ORIENTATION.horizontal && $active ? "2px solid ".concat(colors.primary400) : 'none',
    display: 'inline-block'
  });

  if (!$disabled) {
    style = _objectSpread({}, style, {
      ':focus': {
        color: colors.primary400
      },
      ':hover': {
        color: colors.primary400
      }
    });
  }

  return style;
});
exports.Tab = Tab;
Tab.displayName = "Tab";
var TabBar = (0, _index.styled)('div', function (props) {
  var $orientation = props.$orientation,
      _props$$theme2 = props.$theme,
      colors = _props$$theme2.colors,
      sizing = _props$$theme2.sizing;
  return {
    display: 'flex',
    flexDirection: $orientation === _constants.ORIENTATION.vertical ? 'column' : 'row',
    paddingLeft: sizing.scale400,
    paddingRight: sizing.scale400,
    backgroundColor: colors.mono200
  };
});
exports.TabBar = TabBar;
TabBar.displayName = "TabBar";
var TabContent = (0, _index.styled)('div', function (props) {
  var $active = props.$active,
      _props$$theme3 = props.$theme,
      sizing = _props$$theme3.sizing,
      typography = _props$$theme3.typography;
  return _objectSpread({}, typography.font400, {
    display: $active ? 'block' : 'none',
    paddingLeft: sizing.scale800,
    paddingRight: sizing.scale800,
    paddingTop: sizing.scale500,
    paddingBottom: sizing.scale500
  });
});
exports.TabContent = TabContent;
TabContent.displayName = "TabContent";