@trimble-oss/moduswebcomponents
Version:
Modus Web Components is a modern, accessible UI library built with Stencil JS that provides reusable web components following Trimble's Modus design system. This updated version focuses on improved flexibility, enhanced theming options, comprehensive cust
35 lines (34 loc) • 1.28 kB
TypeScript
import { EventEmitter } from '../../stencil-public-runtime';
import { DaisySize } from '../types';
export interface IAvatarImageLoadError {
originalEvent: Event;
}
/**
* A customizable avatar component used to create avatars with different images or user initials.
* When no image is provided, the component can display initials (up to 3 characters) from the initials prop.
* The component will extract the first letter of each word in the initials string.
*/
export declare class ModusWcAvatar {
private inheritedAttributes;
/** Reference to the host element */
el: HTMLElement;
/** The image alt attribute for accessibility. */
alt: string;
/** Custom CSS class to apply to the inner div. */
customClass?: string;
/** The location of the image. */
imgSrc: string;
/** The initials to display when no image is provided. */
initials?: string;
/** The shape of the avatar. */
shape?: 'circle' | 'square';
/** The size of the avatar. */
size?: DaisySize | 'xl';
/** Event emitted when the avatar image fails to load. */
imageLoadError: EventEmitter<IAvatarImageLoadError>;
componentWillLoad(): void;
private getClasses;
private getUserInitials;
private handleImageError;
render(): any;
}