import CwElement from '../../internal/cw-element.js'; import CwIcon from '../icon/icon.component.js'; import type { CSSResultGroup } from 'lit'; /** * @summary Avatars are used to represent a person or object. * @documentation https://cordwainer.dev/components/avatar * @status stable * @since 1.0 * * @dependency cw-icon * * @event cw-error - The image could not be loaded. This may because of an invalid URL, a temporary network condition, or some * unknown cause. * * @slot icon - The default icon to use when no image or initials are present. Works best with ``. * * @csspart base - The component's base wrapper. * @csspart icon - The container that wraps the avatar's icon. * @csspart initials - The container that wraps the avatar's initials. * @csspart image - The avatar image. Only shown when the `image` attribute is set. * * @cssproperty --size - The size of the avatar. */ export default class CwAvatar extends CwElement { static styles: CSSResultGroup; static dependencies: { 'cw-icon': typeof CwIcon; }; private hasError; /** The image source to use for the avatar. */ image: string; /** A label to use to describe the avatar to assistive devices. */ label: string; /** Initials to use as a fallback when no image is available (1-2 characters max recommended). */ initials: string; /** Indicates how the browser should load the image. */ loading: 'eager' | 'lazy'; /** The shape of the avatar. */ shape: 'circle' | 'square' | 'rounded'; /** When set, the avatar is rendered as an `` with this `href`, linking to e.g. a profile page. */ href: string; /** Tells the browser where to open the link. Only used when `href` is present. */ target: '_blank' | '_parent' | '_self' | '_top'; /** * When using `href`, this attribute will map to the underlying link's `rel` attribute. Unlike regular links, the * default is `noreferrer noopener` to prevent security exploits. However, if you're using `target` to point to a * different frame, you'll probably want this to change to `noopener` alone. */ rel: string; private isLink; handleImageChange(): void; private handleImageLoadError; render(): import("lit-html").TemplateResult; }