function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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; }

/*
Copyright (c) Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import { styled } from '../styles';
import { ORIENTATION } from './constants';
export var Root = styled('div', function (props) {
  var $orientation = props.$orientation;
  return {
    display: 'flex',
    flexDirection: $orientation === ORIENTATION.vertical ? 'row' : 'column'
  };
});
Root.displayName = "Root";
Root.displayName = 'Root';
export var Tab = styled('div', function (props) {
  var $disabled = props.$disabled,
      $active = props.$active,
      $orientation = props.$orientation,
      $isFocusVisible = props.$isFocusVisible,
      _props$$theme = props.$theme,
      colors = _props$$theme.colors,
      sizing = _props$$theme.sizing,
      typography = _props$$theme.typography;

  var style = _objectSpread(_objectSpread({}, typography.font200), {}, {
    boxSizing: 'border-box',
    color: $active ? colors.contentPrimary : colors.tabColor,
    cursor: $disabled ? 'not-allowed' : 'pointer',
    paddingTop: sizing.scale600,
    paddingBottom: sizing.scale600,
    paddingLeft: sizing.scale300,
    paddingRight: sizing.scale300,
    marginLeft: sizing.scale200,
    marginRight: sizing.scale200,
    outline: $isFocusVisible ? "3px solid ".concat(colors.borderAccent) : 'none',
    outlineOffset: '-3px',
    borderBottom: $orientation === ORIENTATION.horizontal && $active && !$isFocusVisible ? "2px solid ".concat(colors.borderSelected) : '2px solid transparent',
    display: 'inline-block'
  });

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

  return style;
});
Tab.displayName = "Tab";
Tab.displayName = 'Tab';
export var TabBar = 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 === ORIENTATION.vertical ? 'column' : 'row',
    paddingLeft: sizing.scale400,
    paddingRight: sizing.scale400,
    backgroundColor: colors.tabBarFill
  };
});
TabBar.displayName = "TabBar";
TabBar.displayName = 'TabBar';
export var TabContent = styled('div', function (props) {
  var $active = props.$active,
      _props$$theme3 = props.$theme,
      sizing = _props$$theme3.sizing,
      typography = _props$$theme3.typography;
  return _objectSpread(_objectSpread({}, typography.font300), {}, {
    display: $active ? 'block' : 'none',
    paddingLeft: sizing.scale800,
    paddingRight: sizing.scale800,
    paddingTop: sizing.scale500,
    paddingBottom: sizing.scale500
  });
});
TabContent.displayName = "TabContent";
TabContent.displayName = 'TabContent';