import { type CSSResultGroup } from 'lit'; import DSAAvatar from '../avatar/avatar'; import DSAIcon from '../icon/icon'; import DSATooltip from '../tooltip/tooltip'; import { ShoelaceElement } from '../../internal/shoelace-element'; /** * @summary Buttons represent actions that are available to the user. * @documentation https://dsa.service-public-autonomie.fr/latest/librairie-webcomponents/actions/bouton-button/web-NwtTT6wj * * @dependency dsa-icon * @dependency dsa-avatar * @dependency dsa-tooltip * * @event dsa-blur - Emitted when the button loses focus. * @event dsa-focus - Emitted when the button gains focus. * * @slot icon - The default icon to use when no image or initials are present. Works best with ``. */ export default class DSAProfileButton extends ShoelaceElement { static styles: CSSResultGroup; static dependencies: { 'dsa-icon': typeof DSAIcon; 'dsa-avatar': typeof DSAAvatar; 'dsa-tooltip': typeof DSATooltip; }; private readonly hasSlotController; private readonly localize; button: HTMLButtonElement; fullName: string; /** * Allows to choose between : * - full : avatar + name + caret * - minimal : avatar + caret * - mobile : avatar */ displayMode: 'full' | 'minimal' | 'mobile'; /** Provides an accessible label for the button element */ firstName: string; /** Provides an accessible label for the button element */ familyName: string; /** Provides an accessible label for the button element */ accessibleLabel: string; /** The image source to use for the avatar. */ image: string; /** Initials to use as a fallback when no image is available (1-2 characters max recommended). */ initials: string; private handleBlur; private handleFocus; private getDisplayedName; /** Simulates a click on the button. */ click(): void; /** Sets focus on the button. */ focus(options?: FocusOptions): void; /** Removes focus from the button. */ blur(): void; updateFullName(): void; renderButton(): import("lit").TemplateResult<1>; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'dsa-profile-button': DSAProfileButton; } }