"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.StyledProfileBody = exports.StyledProfileSubtitle = exports.StyledProfileTitle = exports.StyledProfileLabelsContainer = exports.StyledProfileImg = exports.StyledProfileImgContainer = exports.StyledListItemProfile = exports.StyledListItem = exports.StyledEmptyState = exports.StyledList = 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; }

var StyledList = (0, _index.styled)('ul', function (_ref) {
  var $theme = _ref.$theme;
  return {
    backgroundColor: $theme.colors.menuFill,
    position: 'relative',
    marginTop: 0,
    marginBottom: 0,
    marginLeft: 0,
    marginRight: 0,
    paddingTop: $theme.sizing.scale300,
    paddingBottom: $theme.sizing.scale300,
    paddingLeft: 0,
    paddingRight: 0,
    borderTopLeftRadius: $theme.borders.popoverBorderRadius,
    borderTopRightRadius: $theme.borders.popoverBorderRadius,
    borderBottomRightRadius: $theme.borders.popoverBorderRadius,
    borderBottomLeftRadius: $theme.borders.popoverBorderRadius,
    boxShadow: $theme.lighting.shadow600,
    overflow: 'auto'
  };
});
exports.StyledList = StyledList;
StyledList.displayName = "StyledList";

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

var StyledEmptyState = (0, _index.styled)('li', function (props) {
  var $theme = props.$theme,
      $size = props.$size;
  return _objectSpread({}, $size === _constants.OPTION_LIST_SIZE.compact ? $theme.typography.font200 : $theme.typography.font300, {
    position: 'relative',
    display: 'block',
    color: $theme.colors.menuFontDisabled,
    textAlign: 'center',
    textTransform: 'capitalize',
    cursor: 'not-allowed',
    backgroundColor: 'transparent',
    marginBottom: 0,
    paddingTop: $theme.sizing.scale800,
    paddingBottom: $theme.sizing.scale800,
    paddingRight: $theme.sizing.scale800,
    paddingLeft: $theme.sizing.scale800
  });
});
exports.StyledEmptyState = StyledEmptyState;
StyledEmptyState.displayName = "StyledEmptyState";
var StyledListItem = (0, _index.styled)('li', function (props) {
  var $disabled = props.$disabled,
      $theme = props.$theme,
      $size = props.$size;
  return _objectSpread({}, $size === _constants.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 === _constants.OPTION_LIST_SIZE.compact ? $theme.sizing.scale100 : $theme.sizing.scale300,
    paddingBottom: $size === _constants.OPTION_LIST_SIZE.compact ? $theme.sizing.scale100 : $theme.sizing.scale300,
    paddingRight: $size === _constants.OPTION_LIST_SIZE.compact ? $theme.sizing.scale900 : $theme.sizing.scale600,
    paddingLeft: $size === _constants.OPTION_LIST_SIZE.compact ? $theme.sizing.scale900 : $theme.sizing.scale600,
    ':focus': {
      outline: 'none'
    }
  });
});
exports.StyledListItem = StyledListItem;
StyledListItem.displayName = "StyledListItem";
var StyledListItemProfile = (0, _index.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
    }
  };
});
exports.StyledListItemProfile = StyledListItemProfile;
StyledListItemProfile.displayName = "StyledListItemProfile";
var StyledProfileImgContainer = (0, _index.styled)('div', {
  width: '60px',
  height: '60px',
  display: 'flex',
  justifyContent: 'center',
  alignItems: 'center'
});
exports.StyledProfileImgContainer = StyledProfileImgContainer;
StyledProfileImgContainer.displayName = "StyledProfileImgContainer";
var StyledProfileImg = (0, _index.styled)('img', {
  width: '100%',
  height: '100%',
  borderTopLeftRadius: '50%',
  borderTopRightRadius: '50%',
  borderBottomRightRadius: '50%',
  borderBottomLeftRadius: '50%'
});
exports.StyledProfileImg = StyledProfileImg;
StyledProfileImg.displayName = "StyledProfileImg";
var StyledProfileLabelsContainer = (0, _index.styled)('div', function (_ref3) {
  var $theme = _ref3.$theme;
  return {
    marginLeft: $theme.sizing.scale600,
    alignSelf: 'flex-start',
    display: 'flex',
    flexDirection: 'column'
  };
});
exports.StyledProfileLabelsContainer = StyledProfileLabelsContainer;
StyledProfileLabelsContainer.displayName = "StyledProfileLabelsContainer";
var StyledProfileTitle = (0, _index.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
  });
});
exports.StyledProfileTitle = StyledProfileTitle;
StyledProfileTitle.displayName = "StyledProfileTitle";
var StyledProfileSubtitle = (0, _index.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
  });
});
exports.StyledProfileSubtitle = StyledProfileSubtitle;
StyledProfileSubtitle.displayName = "StyledProfileSubtitle";
var StyledProfileBody = (0, _index.styled)('p', function (_ref6) {
  var $theme = _ref6.$theme;
  return _objectSpread({}, $theme.typography.font200, {
    color: $theme.colors.foreground,
    marginTop: 0,
    marginBottom: 0,
    marginLeft: 0,
    marginRight: 0
  });
});
exports.StyledProfileBody = StyledProfileBody;
StyledProfileBody.displayName = "StyledProfileBody";