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; }

/*
Copyright (c) 2018 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/index.js';
import { OPTION_LIST_SIZE } from './constants.js';
export var List = styled('ul', function (_ref) {
  var $theme = _ref.$theme;
  return {
    position: 'relative',
    marginTop: '0',
    marginBottom: '0',
    marginLeft: '0',
    marginRight: '0',
    paddingTop: $theme.sizing.scale300,
    paddingBottom: $theme.sizing.scale300,
    paddingLeft: '0',
    paddingRight: '0',
    backgroundColor: $theme.colors.backgroundAlt,
    borderRadius: $theme.borders.radius300,
    boxShadow: $theme.lighting.shadow600,
    overflow: 'auto'
  };
});
List.displayName = "List";

function getFontColor(props) {
  if (props.$disabled) {
    return props.$theme.colors.menuFontDisabled;
  }

  if (props.$isHighlighted && props.$isFocused) {
    return props.$theme.colors.menuFontHighlighted;
  }

  if (props.$isHighlighted && !props.$isFocused) {
    return props.$theme.colors.menuFontSelected;
  }

  return props.$theme.colors.menuFontDefault;
}

function getBackgroundColor(props) {
  if (props.$disabled) {
    return 'transparent';
  }

  if (props.$isHighlighted) {
    return props.$theme.colors.menuFillHover;
  }

  return 'transparent';
}

export var ListItem = styled('li', function (props) {
  var $disabled = props.$disabled,
      $theme = props.$theme,
      $size = props.$size;
  return _objectSpread({}, $size === OPTION_LIST_SIZE.compact ? $theme.typography.font200 : $theme.typography.font300, {
    position: 'relative',
    display: 'block',
    color: getFontColor(props),
    cursor: $disabled ? 'not-allowed' : 'pointer',
    backgroundColor: getBackgroundColor(props),
    transitionProperty: 'color, background-color',
    transitionDuration: $theme.animation.timing100,
    transitionTimingFunction: $theme.animation.easeOutCurve,
    marginBottom: '0',
    paddingTop: $size === OPTION_LIST_SIZE.compact ? $theme.sizing.scale100 : $theme.sizing.scale300,
    paddingBottom: $size === OPTION_LIST_SIZE.compact ? $theme.sizing.scale100 : $theme.sizing.scale300,
    paddingRight: $size === OPTION_LIST_SIZE.compact ? $theme.sizing.scale900 : $theme.sizing.scale600,
    paddingLeft: $size === OPTION_LIST_SIZE.compact ? $theme.sizing.scale900 : $theme.sizing.scale600,
    ':focus': {
      outline: 'none'
    }
  });
});
ListItem.displayName = "ListItem";
export var ListItemProfile = styled('li', function (_ref2) {
  var $theme = _ref2.$theme;
  return {
    position: 'relative',
    display: 'flex',
    alignItems: 'center',
    cursor: 'pointer',
    paddingTop: $theme.sizing.scale300,
    paddingBottom: $theme.sizing.scale300,
    paddingRight: $theme.sizing.scale800,
    paddingLeft: $theme.sizing.scale800,
    transitionProperty: 'color, background-color',
    transitionDuration: $theme.animation.timing100,
    transitionTimingFunction: $theme.animation.easeOutCurve,
    ':hover': {
      backgroundColor: $theme.colors.menuFillHover
    }
  };
});
ListItemProfile.displayName = "ListItemProfile";
export var ProfileImgContainer = styled('div', {
  width: '60px',
  height: '60px',
  display: 'flex',
  justifyContent: 'center',
  alignItems: 'center'
});
ProfileImgContainer.displayName = "ProfileImgContainer";
export var ProfileImg = styled('img', {
  width: '100%',
  height: '100%',
  borderRadius: '50%'
});
ProfileImg.displayName = "ProfileImg";
export var ProfileLabelsContainer = styled('div', function (_ref3) {
  var $theme = _ref3.$theme;
  return {
    marginLeft: $theme.sizing.scale600,
    alignSelf: 'flex-start',
    display: 'flex',
    flexDirection: 'column'
  };
});
ProfileLabelsContainer.displayName = "ProfileLabelsContainer";
export var ProfileTitle = styled('h6', function (_ref4) {
  var $theme = _ref4.$theme;
  return _objectSpread({}, $theme.typography.font450, {
    color: $theme.colors.foreground,
    marginTop: '0',
    marginBottom: '0',
    marginLeft: '0',
    marginRight: '0'
  });
});
ProfileTitle.displayName = "ProfileTitle";
export var ProfileSubtitle = styled('p', function (_ref5) {
  var $theme = _ref5.$theme;
  return _objectSpread({}, $theme.typography.font300, {
    color: $theme.colors.foreground,
    marginTop: '0',
    marginBottom: '0',
    marginLeft: '0',
    marginRight: '0'
  });
});
ProfileSubtitle.displayName = "ProfileSubtitle";
export var ProfileBody = styled('p', function (_ref6) {
  var $theme = _ref6.$theme;
  return _objectSpread({}, $theme.typography.font200, {
    color: $theme.colors.foregroundAlt,
    marginTop: '0',
    marginBottom: '0',
    marginLeft: '0',
    marginRight: '0'
  });
});
ProfileBody.displayName = "ProfileBody";