var _excluded = ["imageUrl", "icon", "initials", "selected", "disabled", "clickable", "children"],
  _excluded2 = ["children"],
  _excluded3 = ["children"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import React from 'react';
import { Avatar } from '../Avatar/Avatar';
import { addSubcomponents } from '../_utils/addSubcomponents';
import { ContactItemAvatar, ContactItemAvatarWrapper, ContactItemText, ContactItemTextWrapper, ContactItemWrapper } from './ContactItem.styles';
/**

 The contact item component is a more complex alternative to a standard line
 of text found in a list or form component. Use this component when you have
 a list or set of items that can benefit from an additional line of content or
 an avatar.

 @since 10.19.0

 @see [Storybook](https://procore.github.io/core/core-react/latest/?path=/story/demos-contact-item--demo)

 @see [Design Guidelines](https://design.procore.com/contact-item)

 */
var ContactItem_ = /*#__PURE__*/React.forwardRef(function ContactItem(_ref, ref) {
  var imageUrl = _ref.imageUrl,
    icon = _ref.icon,
    initials = _ref.initials,
    _ref$selected = _ref.selected,
    selected = _ref$selected === void 0 ? false : _ref$selected,
    _ref$disabled = _ref.disabled,
    disabled = _ref$disabled === void 0 ? false : _ref$disabled,
    _ref$clickable = _ref.clickable,
    clickable = _ref$clickable === void 0 ? false : _ref$clickable,
    children = _ref.children,
    props = _objectWithoutProperties(_ref, _excluded);
  var showAvatar = imageUrl || icon || initials;
  return /*#__PURE__*/React.createElement(ContactItemWrapper, _extends({
    $selected: selected,
    $disabled: disabled,
    $clickable: clickable,
    ref: ref
  }, props), showAvatar && /*#__PURE__*/React.createElement(ContactItemAvatarWrapper, null, /*#__PURE__*/React.createElement(ContactItemAvatar, {
    "aria-hidden": true,
    size: "lg",
    disabled: disabled
  }, function () {
    if (imageUrl) return /*#__PURE__*/React.createElement(Avatar.Portrait, {
      imageUrl: imageUrl
    });
    if (icon) return /*#__PURE__*/React.createElement(Avatar.Icon, {
      icon: icon
    });
    if (initials) return /*#__PURE__*/React.createElement(Avatar.Label, null, initials);
  }())), /*#__PURE__*/React.createElement(ContactItemTextWrapper, null, children));
});
var Title = /*#__PURE__*/React.forwardRef(function Title(_ref2, ref) {
  var children = _ref2.children,
    props = _objectWithoutProperties(_ref2, _excluded2);
  return /*#__PURE__*/React.createElement(ContactItemText, _extends({
    weight: "bold",
    color: "gray15",
    ref: ref
  }, props), children);
});
var Description = /*#__PURE__*/React.forwardRef(function Description(_ref3, ref) {
  var children = _ref3.children,
    props = _objectWithoutProperties(_ref3, _excluded3);
  return /*#__PURE__*/React.createElement(ContactItemText, _extends({
    weight: "regular",
    color: "gray45",
    ref: ref
  }, props), children);
});
ContactItem_.displayName = 'ContactItem';
Title.displayName = 'ContactItem.Title';
Description.displayName = 'ContactItem.Description';
export var ContactItem = addSubcomponents({
  Title: Title,
  Description: Description
}, ContactItem_);
//# sourceMappingURL=ContactItem.js.map