var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React from 'react';
import { addSubcomponents } from '../../utils/addSubcomponents';
import { Icon as IconBase } from '../Icon';
import { StyledAvatarContainer, StyledAvatarOverlay, StyledIconContainer, StyledLabelContainer, StyledPortraitContainer, } from './Avatar.styles';
/**

 We use avatars to visually represent our users, places, and things in the app.
 These can be in the form of rich media or representative illustrations.

 @since 10.19.0

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

 @see [Design Guidelines](https://design.procore.com/avatar)

 */
var Avatar_ = React.forwardRef(function Avatar(_a, ref) {
    var clickable = _a.clickable, disabled = _a.disabled, size = _a.size, children = _a.children, props = __rest(_a, ["clickable", "disabled", "size", "children"]);
    return (React.createElement(StyledAvatarContainer, __assign({ ref: ref, "$clickable": clickable, "$disabled": disabled, "$size": size, "data-qa": "core-avatar" }, props),
        React.Children.only(children),
        React.createElement(StyledAvatarOverlay, null)));
});
export var Icon = React.forwardRef(function Icon(_a, ref) {
    var icon = _a.icon, props = __rest(_a, ["icon"]);
    return (React.createElement(StyledIconContainer, __assign({ ref: ref }, props), typeof icon === 'string' ? React.createElement(IconBase, { icon: icon }) : icon));
});
export var Label = React.forwardRef(function Label(_a, ref) {
    var children = _a.children, props = __rest(_a, ["children"]);
    return (React.createElement(StyledLabelContainer, __assign({ ref: ref }, props), children));
});
export var Portrait = React.forwardRef(function Portrait(_a, ref) {
    var imageUrl = _a.imageUrl, props = __rest(_a, ["imageUrl"]);
    return (React.createElement(StyledPortraitContainer, __assign({ ref: ref, "$imageUrl": imageUrl }, props),
        React.createElement(StyledAvatarOverlay, null)));
});
Avatar_.displayName = 'Avatar';
Icon.displayName = 'Avatar.Icon';
Label.displayName = 'Avatar.Label';
Portrait.displayName = 'Avatar.Portrait';
export var Avatar = addSubcomponents({
    Icon: Icon,
    Label: Label,
    Portrait: Portrait,
}, Avatar_);
//# sourceMappingURL=Avatar.js.map