ng-hub-ui-avatar 22.2.0 → 22.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -254,9 +254,10 @@ export class AppModule {}
254
254
  | `style` | `Record<string, any> \| string` | `{}` | Custom inline styles merged into avatar styles |
255
255
  | `placeholder` | `string` | `undefined` | Reserved placeholder input |
256
256
  | `referrerpolicy` | `string \| null` | `undefined` | Referrer policy for avatar image requests |
257
- | `status` | `HubAvatarStatus \| string \| null` | `null` | Presence indicator dot at the bottom-end corner. Built-ins: `online` (success), `away` (warning), `busy` (danger), `offline` (neutral). Any custom string is accepted — set `--hub-avatar-status-color` to colour it. When `null` (default) no dot is rendered. |
257
+ | `badge` | `string \| number \| boolean \| null` | `null` | Corner overlay. `badge` / `[badge]="true"` a **dot**; `badge="4k"` / `[badge]="9"` a **labelled** pill; `null` / absent nothing. |
258
+ | `badgeColor` | `HubAvatarBadgeColor \| string \| null` | `null` | Semantic colour of the badge: `primary · secondary · success · danger · warning · info · light · dark` (→ `--hub-sys-color-*`). Any custom string also works (set `--hub-avatar-badge-color`). |
258
259
 
259
- `HubAvatarStatus` is an exported type covering the built-in statuses: `'online' | 'away' | 'busy' | 'offline'`.
260
+ `HubAvatarBadgeColor` is an exported type covering the semantic colours: `'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark'`. Express presence with the colour: online → `success`, away → `warning`, busy → `danger`, offline → `secondary`.
260
261
 
261
262
  ### Outputs
262
263
 
@@ -318,33 +319,58 @@ hub-avatar {
318
319
  }
319
320
  ```
320
321
 
321
- ### Presence status
322
+ ### Badge (dot or labelled)
322
323
 
323
- Set the `status` input to render a small dot at the bottom-end corner. The dot scales with the avatar (the component exposes the live size on the host as `--hub-avatar-size`).
324
+ The `badge` input renders a corner overlay — a plain **dot** (great for presence) or a **labelled** pill (a count / text). Colour it with the semantic `badgeColor` input. Everything scales with the avatar.
324
325
 
325
326
  ```html
326
- <hub-avatar name="John Doe" status="online"></hub-avatar>
327
- <hub-avatar name="Jane Doe" status="busy"></hub-avatar>
328
- <hub-avatar name="Custom" status="dnd"></hub-avatar>
327
+ <!-- presence dot: badge (no content) + a semantic colour -->
328
+ <hub-avatar name="Ada Lovelace" badge badgeColor="success"></hub-avatar> <!-- online -->
329
+ <hub-avatar name="Grace Hopper" badge badgeColor="warning"></hub-avatar> <!-- away -->
330
+ <hub-avatar name="Alan Turing" badge badgeColor="danger"></hub-avatar> <!-- busy -->
331
+ <hub-avatar name="Linus T" badge badgeColor="secondary"></hub-avatar> <!-- offline -->
332
+
333
+ <!-- labelled badge -->
334
+ <hub-avatar name="Carlos M" badge="4k" badgeColor="danger"></hub-avatar>
329
335
  ```
330
336
 
331
- Built-ins map to the design-system colours: `online` success, `away` → warning, `busy` danger, `offline` neutral. Any custom string is accepted; colour it with `--hub-avatar-status-color`:
337
+ `badgeColor` maps to `--hub-sys-color-*`. For a custom colour, set `--hub-avatar-badge-color` (per element or via the [colour-variants mixin](#colour-variants--mixins)):
332
338
 
333
339
  ```scss
334
- hub-avatar[data-status='dnd'] {
335
- --hub-avatar-status-color: #9333ea;
340
+ hub-avatar[data-badge-color='brand'] {
341
+ --hub-avatar-badge-color: #9333ea;
336
342
  }
337
343
  ```
338
344
 
339
- Status tokens:
345
+ Badge tokens:
340
346
 
341
- | Variable | Default | Usage |
342
- | ------------------------------- | ------------------------------------------------------------- | -------------------------------------- |
343
- | `--hub-avatar-status-size` | `calc(var(--hub-avatar-size, 50px) * 0.28)` | Diameter of the status dot |
344
- | `--hub-avatar-status-offset` | `0px` | Inset of the dot from the corner |
345
- | `--hub-avatar-status-ring-width`| `max(2px, calc(var(--hub-avatar-size, 50px) * 0.05))` | Width of the ring around the dot |
346
- | `--hub-avatar-status-ring-color`| `var(--hub-sys-surface-page, #fff)` | Colour of the ring around the dot |
347
- | `--hub-avatar-status-color` | `var(--hub-sys-text-muted, #6c757d)` | Dot colour (re-based per built-in status) |
347
+ | Variable | Default | Usage |
348
+ | --------------------------------- | ----------------------------------------------------- | -------------------------------------- |
349
+ | `--hub-avatar-badge-size` | `calc(var(--hub-avatar-size, 50px) * 0.28)` | Dot diameter / label min-height |
350
+ | `--hub-avatar-badge-offset` | `0px` | Inset from the bottom-end corner |
351
+ | `--hub-avatar-badge-ring-width` | `max(2px, calc(var(--hub-avatar-size, 50px) * 0.05))` | Width of the ring around the badge |
352
+ | `--hub-avatar-badge-ring-color` | `var(--hub-sys-surface-page, #fff)` | Colour of the ring around the badge |
353
+ | `--hub-avatar-badge-color` | `var(--hub-sys-color-secondary, #6c757d)` | Badge fill (semantic via `badgeColor`) |
354
+ | `--hub-avatar-badge-text-color` | `var(--hub-ref-color-white, #fff)` | Badge label text colour |
355
+ | `--hub-avatar-badge-font-size` | `calc(var(--hub-avatar-size, 50px) * 0.22)` | Badge label font size |
356
+ | `--hub-avatar-badge-padding` | `calc(var(--hub-avatar-size, 50px) * 0.08)` | Badge label inline padding |
357
+
358
+ ### Colour variants & mixins
359
+
360
+ Every semantic colour works out of the box, both for the badge (`badgeColor="success"`) and as a coloured **avatar circle** (`class="hub-avatar--success"`). To (re)generate these in your own CSS — or to register a **custom colour** (e.g. a brand colour) — use the `hub-avatar-color-variants()` mixin, which emits the avatar **and** badge variants in one loop over a colour map:
361
+
362
+ ```scss
363
+ @use 'ng-hub-ui-avatar/styles/mixins/avatar-theme' as avatar;
364
+
365
+ // the eight semantic colours (default)
366
+ @include avatar.hub-avatar-color-variants();
367
+
368
+ // add your own — generates <hub-avatar class="hub-avatar--brand"> and badgeColor="brand"
369
+ @include avatar.hub-avatar-color-variants((
370
+ 'brand': var(--my-brand),
371
+ 'accent': #00d4aa
372
+ ));
373
+ ```
348
374
 
349
375
  ### Avatar group
350
376
 
@@ -368,18 +394,18 @@ Group tokens:
368
394
 
369
395
  ### Sass theming mixin
370
396
 
371
- The `hub-avatar-theme()` mixin themes an avatar in a single include — shape/surface, initials typography, the status dot and the group ring. Every parameter is optional and defaults to `null`, so only the ones you pass are emitted as `--hub-avatar-*` overrides. It is token-based, with no Bootstrap dependency.
397
+ The `hub-avatar-theme()` mixin themes an avatar in a single include — shape/surface, initials typography, projected-content sizing, the badge and the group ring. Every parameter is optional and defaults to `null`, so only the ones you pass are emitted as `--hub-avatar-*` overrides. It is token-based, with no Bootstrap dependency.
372
398
 
373
399
  ```scss
374
- @use 'ng-hub-ui-avatar/styles/mixins/avatar-theme' as *;
400
+ @use 'ng-hub-ui-avatar/styles/mixins/avatar-theme' as avatar;
375
401
 
376
402
  hub-avatar.brand {
377
- @include hub-avatar-theme(
403
+ @include avatar.hub-avatar-theme(
378
404
  $size: 64px,
379
405
  $border-radius: 1rem,
380
406
  $bg: #ede9fe,
381
407
  $fg: #5b21b6,
382
- $status-ring-color: #ede9fe
408
+ $badge-color: #f43f5e
383
409
  );
384
410
  }
385
411
  ```
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Optional, Inject, Injectable, input, output, SecurityContext, ViewChild, Component, NgModule } from '@angular/core';
2
+ import { InjectionToken, Optional, Inject, Injectable, input, computed, output, SecurityContext, ViewChild, Component, NgModule } from '@angular/core';
3
3
  import * as i3 from '@angular/platform-browser';
4
4
  import { takeWhile, map } from 'rxjs/operators';
5
5
  import * as i1 from '@angular/common/http';
@@ -408,13 +408,40 @@ class AvatarComponent {
408
408
  initialsSize = input(0, /* @ts-ignore */
409
409
  ...(ngDevMode ? [{ debugName: "initialsSize" }] : /* istanbul ignore next */ []));
410
410
  /**
411
- * Semantic presence indicator shown as a small dot at the bottom-end corner.
412
- * Built-ins: `online` (success) · `away` (warning) · `busy` (danger) · `offline`
413
- * (neutral). Any custom string is accepted set `--hub-avatar-status-color`
414
- * to colour it. When unset (default) no dot is rendered.
411
+ * Overlay badge at the bottom-end corner. A boolean / empty value renders a plain
412
+ * dot (great for a presence indicator); a string or number renders a labelled badge
413
+ * (e.g. a count like `"4k"`). `null` / absent (default) renders nothing.
414
+ *
415
+ * @example <hub-avatar badge badgeColor="success" /> // dot
416
+ * @example <hub-avatar badge="4k" badgeColor="danger" /> // labelled
417
+ */
418
+ badge = input(null, /* @ts-ignore */
419
+ ...(ngDevMode ? [{ debugName: "badge" }] : /* istanbul ignore next */ []));
420
+ /**
421
+ * Semantic colour of the {@link badge} (and, as a host class, of the avatar itself).
422
+ * Maps to a `--hub-sys-color-*` token; any custom string also works (set
423
+ * `--hub-avatar-badge-color`). When unset the badge uses a neutral default.
415
424
  */
416
- status = input(null, /* @ts-ignore */
417
- ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
425
+ badgeColor = input(null, /* @ts-ignore */
426
+ ...(ngDevMode ? [{ debugName: "badgeColor" }] : /* istanbul ignore next */ []));
427
+ /** True when a badge should be rendered (the `badge` input is set to anything but `null` / `false`). */
428
+ _hasBadge = computed(() => {
429
+ const b = this.badge();
430
+ return b !== null && b !== undefined && b !== false;
431
+ }, /* @ts-ignore */
432
+ ...(ngDevMode ? [{ debugName: "_hasBadge" }] : /* istanbul ignore next */ []));
433
+ /** The badge's text content; empty for a plain dot (`badge` is `true` or an empty string). */
434
+ _badgeText = computed(() => {
435
+ const b = this.badge();
436
+ if (b === true || b === '' || b === null || b === undefined || b === false) {
437
+ return '';
438
+ }
439
+ return String(b);
440
+ }, /* @ts-ignore */
441
+ ...(ngDevMode ? [{ debugName: "_badgeText" }] : /* istanbul ignore next */ []));
442
+ /** True when the badge is a plain dot (shown, but with no text content). */
443
+ _isDot = computed(() => this._hasBadge() && this._badgeText() === '', /* @ts-ignore */
444
+ ...(ngDevMode ? [{ debugName: "_isDot" }] : /* istanbul ignore next */ []));
418
445
  clickOnAvatar = output();
419
446
  /** Wrapper around the projected content (`<ng-content>`), used to detect whether the consumer projected anything. */
420
447
  customContentRef;
@@ -697,7 +724,7 @@ class AvatarComponent {
697
724
  this.sources = this.sources.filter((source) => source.sourceType !== sourceType);
698
725
  }
699
726
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarComponent, deps: [{ token: SourceFactory }, { token: AvatarService }, { token: i3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
700
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: AvatarComponent, isStandalone: false, selector: "hub-avatar", inputs: { round: { classPropertyName: "round", publicName: "round", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, textSizeRatio: { classPropertyName: "textSizeRatio", publicName: "textSizeRatio", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, fgColor: { classPropertyName: "fgColor", publicName: "fgColor", isSignal: true, isRequired: false, transformFunction: null }, borderColor: { classPropertyName: "borderColor", publicName: "borderColor", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, cornerRadius: { classPropertyName: "cornerRadius", publicName: "cornerRadius", isSignal: true, isRequired: false, transformFunction: null }, facebook: { classPropertyName: "facebook", publicName: "facebookId", isSignal: true, isRequired: false, transformFunction: null }, gravatar: { classPropertyName: "gravatar", publicName: "gravatarId", isSignal: true, isRequired: false, transformFunction: null }, github: { classPropertyName: "github", publicName: "githubId", isSignal: true, isRequired: false, transformFunction: null }, custom: { classPropertyName: "custom", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, customAlt: { classPropertyName: "customAlt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, referrerpolicy: { classPropertyName: "referrerpolicy", publicName: "referrerpolicy", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, initialsSize: { classPropertyName: "initialsSize", publicName: "initialsSize", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickOnAvatar: "clickOnAvatar" }, host: { properties: { "attr.data-status": "status() || null", "style.--hub-avatar-size": "avatarSizePx" } }, viewQueries: [{ propertyName: "customContentRef", first: true, predicate: ["customContent"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
727
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: AvatarComponent, isStandalone: false, selector: "hub-avatar", inputs: { round: { classPropertyName: "round", publicName: "round", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, textSizeRatio: { classPropertyName: "textSizeRatio", publicName: "textSizeRatio", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, fgColor: { classPropertyName: "fgColor", publicName: "fgColor", isSignal: true, isRequired: false, transformFunction: null }, borderColor: { classPropertyName: "borderColor", publicName: "borderColor", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, cornerRadius: { classPropertyName: "cornerRadius", publicName: "cornerRadius", isSignal: true, isRequired: false, transformFunction: null }, facebook: { classPropertyName: "facebook", publicName: "facebookId", isSignal: true, isRequired: false, transformFunction: null }, gravatar: { classPropertyName: "gravatar", publicName: "gravatarId", isSignal: true, isRequired: false, transformFunction: null }, github: { classPropertyName: "github", publicName: "githubId", isSignal: true, isRequired: false, transformFunction: null }, custom: { classPropertyName: "custom", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, customAlt: { classPropertyName: "customAlt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, referrerpolicy: { classPropertyName: "referrerpolicy", publicName: "referrerpolicy", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, initialsSize: { classPropertyName: "initialsSize", publicName: "initialsSize", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, badgeColor: { classPropertyName: "badgeColor", publicName: "badgeColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickOnAvatar: "clickOnAvatar" }, host: { properties: { "attr.data-badge-color": "badgeColor() || null", "style.--hub-avatar-size": "avatarSizePx" } }, viewQueries: [{ propertyName: "customContentRef", first: true, predicate: ["customContent"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
701
728
  <div (click)="onAvatarClicked()" class="avatar-container" [class.hub-avatar--custom]="hasCustomContent" [style]="hostStyle">
702
729
  <span #customContent class="hub-avatar__custom" [style]="customContentStyle"><ng-content></ng-content></span>
703
730
  @if (!hasCustomContent) {
@@ -722,10 +749,16 @@ class AvatarComponent {
722
749
  }
723
750
  }
724
751
  </div>
725
- @if (status()) {
726
- <span class="hub-avatar__status" aria-hidden="true"></span>
752
+ @if (_hasBadge()) {
753
+ <span
754
+ class="hub-avatar__badge"
755
+ [class.hub-avatar__badge--dot]="_isDot()"
756
+ [class.hub-avatar__badge--label]="!_isDot()"
757
+ [attr.aria-hidden]="_isDot() ? 'true' : null"
758
+ >{{ _badgeText() }}</span
759
+ >
727
760
  }
728
- `, isInline: true, styles: [":root,:host{--hub-avatar-size: 50px;--hub-avatar-overflow: hidden;--hub-avatar-border-radius-round: 50%;--hub-avatar-border-radius-square: var(--hub-ref-radius-sm, .25rem);--hub-avatar-border-radius: var( --hub-avatar-border-radius-round, var(--hub-avatar-border-radius-square, .25rem) );--hub-avatar-border-width-default: var(--hub-ref-border-width, 1px);--hub-avatar-border-width: 0;--hub-avatar-border-color: transparent;--hub-avatar-fg-color: var(--hub-ref-color-white, #fff);--hub-avatar-bg-color: var(--hub-sys-color-primary, #0d6efd);--hub-avatar-font-family: var( --hub-ref-font-family-base, Helvetica, Arial, sans-serif );--hub-avatar-font-weight: var(--hub-ref-font-weight-base, 400);--hub-avatar-font-size: calc(var(--hub-avatar-size, 50px) / 3);--hub-avatar-line-height: var(--hub-avatar-size, 50px);--hub-avatar-text-transform: uppercase;--hub-avatar-text-align: center;--hub-avatar-object-fit: cover;--hub-avatar-content-padding: calc(var(--hub-avatar-size, 50px) * .2);--hub-avatar-content-icon-size: calc(var(--hub-avatar-size, 50px) * .55);--hub-avatar-status-size: calc(var(--hub-avatar-size, 50px) * .28);--hub-avatar-status-offset: 0px;--hub-avatar-status-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .05));--hub-avatar-status-ring-color: var(--hub-sys-surface-page, #fff);--hub-avatar-status-color: var(--hub-sys-text-muted, #6c757d);--hub-avatar-group-overlap: calc(var(--hub-avatar-size, 50px) * .3);--hub-avatar-group-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .04));--hub-avatar-group-ring-color: var(--hub-sys-surface-page, #fff)}:host{display:inline-block;position:relative;border-radius:var(--hub-avatar-border-radius, 50%)}.avatar-container{width:var(--hub-avatar-size, 50px);height:var(--hub-avatar-size, 50px);border-radius:var(--hub-avatar-border-radius, 50%);overflow:var(--hub-avatar-overflow, hidden)}.avatar-content{width:100%;height:100%;max-width:100%;box-sizing:border-box;border-radius:var(--hub-avatar-border-radius, 50%);border:var(--hub-avatar-border-width, 0) solid var(--hub-avatar-border-color, transparent);color:var(--hub-avatar-fg-color, var(--hub-ref-color-white, #fff));background-color:var(--hub-avatar-bg-color, var(--hub-sys-surface-page, #fff));font-family:var(--hub-avatar-font-family, Helvetica, Arial, sans-serif);font-size:var(--hub-avatar-font-size, calc(var(--hub-avatar-size, 50px) / 3));font-weight:var(--hub-avatar-font-weight, var(--hub-ref-font-weight-base, 400));line-height:var(--hub-avatar-line-height, var(--hub-avatar-size, 50px));text-transform:var(--hub-avatar-text-transform, uppercase);text-align:var(--hub-avatar-text-align, center)}div.avatar-content{display:flex;align-items:center;justify-content:center}img.avatar-content{display:block;object-fit:var(--hub-avatar-object-fit, cover);background-color:transparent}.hub-avatar__custom{display:none}.hub-avatar--custom .hub-avatar__custom{display:flex;align-items:center;justify-content:center;width:100%;height:100%;box-sizing:border-box;padding:var(--hub-avatar-content-padding, calc(var(--hub-avatar-size, 50px) * .2));border-radius:inherit;overflow:hidden;background-color:var(--hub-avatar-bg-color, var(--hub-sys-color-primary, #0d6efd));color:var(--hub-avatar-fg-color, var(--hub-ref-color-white, #fff));font-size:var(--hub-avatar-content-icon-size, calc(var(--hub-avatar-size, 50px) * .55));line-height:1}.hub-avatar--custom .hub-avatar__custom>*{line-height:1}.hub-avatar--custom .hub-avatar__custom ::ng-deep svg,.hub-avatar--custom .hub-avatar__custom ::ng-deep img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}.hub-avatar__status{position:absolute;inset-block-end:var(--hub-avatar-status-offset, 0px);inset-inline-end:var(--hub-avatar-status-offset, 0px);width:var(--hub-avatar-status-size, calc(var(--hub-avatar-size, 50px) * .28));height:var(--hub-avatar-status-size, calc(var(--hub-avatar-size, 50px) * .28));box-sizing:border-box;border-radius:50%;background:var(--hub-avatar-status-color, var(--hub-sys-text-muted, #6c757d));box-shadow:0 0 0 var(--hub-avatar-status-ring-width, 2px) var(--hub-avatar-status-ring-color, var(--hub-sys-surface-page, #fff))}:host([data-status=online]){--hub-avatar-status-color: var(--hub-sys-color-success)}:host([data-status=away]){--hub-avatar-status-color: var(--hub-sys-color-warning)}:host([data-status=busy]){--hub-avatar-status-color: var(--hub-sys-color-danger)}:host([data-status=offline]){--hub-avatar-status-color: var(--hub-sys-text-muted, #6c757d)}.hub-avatar-group{display:inline-flex;align-items:center}.hub-avatar-group hub-avatar{box-shadow:0 0 0 var(--hub-avatar-group-ring-width, 2px) var(--hub-avatar-group-ring-color, var(--hub-sys-surface-page, #fff))}.hub-avatar-group hub-avatar+hub-avatar{margin-inline-start:calc(-1 * var(--hub-avatar-group-overlap, 15px))}\n"] });
761
+ `, isInline: true, styles: [":root,:host{--hub-avatar-size: 50px;--hub-avatar-overflow: hidden;--hub-avatar-border-radius-round: 50%;--hub-avatar-border-radius-square: var(--hub-ref-radius-sm, .25rem);--hub-avatar-border-radius: var( --hub-avatar-border-radius-round, var(--hub-avatar-border-radius-square, .25rem) );--hub-avatar-border-width-default: var(--hub-ref-border-width, 1px);--hub-avatar-border-width: 0;--hub-avatar-border-color: transparent;--hub-avatar-accent: var(--hub-sys-color-primary, #0d6efd);--hub-avatar-accent-emphasis: color-mix(in oklch, var(--hub-avatar-accent) 80%, var(--hub-sys-color-ink, #212529));--hub-avatar-accent-subtle: color-mix(in oklch, var(--hub-avatar-accent) 12%, var(--hub-sys-surface-page, #fff));--hub-avatar-accent-on: oklch(from var(--hub-avatar-accent) clamp(0, (.62 - l) * 1000, 1) 0 h);--hub-avatar-fg-color: var(--hub-avatar-accent-on, var(--hub-ref-color-white, #fff));--hub-avatar-bg-color: var(--hub-avatar-accent, var(--hub-sys-color-primary, #0d6efd));--hub-avatar-font-family: var( --hub-ref-font-family-base, Helvetica, Arial, sans-serif );--hub-avatar-font-weight: var(--hub-ref-font-weight-base, 400);--hub-avatar-font-size: calc(var(--hub-avatar-size, 50px) / 3);--hub-avatar-line-height: var(--hub-avatar-size, 50px);--hub-avatar-text-transform: uppercase;--hub-avatar-text-align: center;--hub-avatar-object-fit: cover;--hub-avatar-content-padding: calc(var(--hub-avatar-size, 50px) * .2);--hub-avatar-content-icon-size: calc(var(--hub-avatar-size, 50px) * .55);--hub-avatar-badge-size: calc(var(--hub-avatar-size, 50px) * .28);--hub-avatar-badge-offset: 0px;--hub-avatar-badge-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .05));--hub-avatar-badge-ring-color: var(--hub-sys-surface-page, #fff);--hub-avatar-badge-color: var(--hub-sys-color-secondary, #6c757d);--hub-avatar-badge-text-color: var(--hub-ref-color-white, #fff);--hub-avatar-badge-font-size: calc(var(--hub-avatar-size, 50px) * .22);--hub-avatar-badge-padding: calc(var(--hub-avatar-size, 50px) * .08);--hub-avatar-group-overlap: calc(var(--hub-avatar-size, 50px) * .3);--hub-avatar-group-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .04));--hub-avatar-group-ring-color: var(--hub-sys-surface-page, #fff)}:host{display:inline-block;position:relative;border-radius:var(--hub-avatar-border-radius, 50%)}.avatar-container{width:var(--hub-avatar-size, 50px);height:var(--hub-avatar-size, 50px);border-radius:var(--hub-avatar-border-radius, 50%);overflow:var(--hub-avatar-overflow, hidden)}.avatar-content{width:100%;height:100%;max-width:100%;box-sizing:border-box;border-radius:var(--hub-avatar-border-radius, 50%);border:var(--hub-avatar-border-width, 0) solid var(--hub-avatar-border-color, transparent);color:var(--hub-avatar-fg-color, var(--hub-ref-color-white, #fff));background-color:var(--hub-avatar-bg-color, var(--hub-sys-surface-page, #fff));font-family:var(--hub-avatar-font-family, Helvetica, Arial, sans-serif);font-size:var(--hub-avatar-font-size, calc(var(--hub-avatar-size, 50px) / 3));font-weight:var(--hub-avatar-font-weight, var(--hub-ref-font-weight-base, 400));line-height:var(--hub-avatar-line-height, var(--hub-avatar-size, 50px));text-transform:var(--hub-avatar-text-transform, uppercase);text-align:var(--hub-avatar-text-align, center)}div.avatar-content{display:flex;align-items:center;justify-content:center}img.avatar-content{display:block;object-fit:var(--hub-avatar-object-fit, cover);background-color:transparent}.hub-avatar__custom{display:none}.hub-avatar--custom .hub-avatar__custom{display:flex;align-items:center;justify-content:center;width:100%;height:100%;box-sizing:border-box;padding:var(--hub-avatar-content-padding, calc(var(--hub-avatar-size, 50px) * .2));border-radius:inherit;overflow:hidden;background-color:var(--hub-avatar-bg-color, var(--hub-sys-color-primary, #0d6efd));color:var(--hub-avatar-fg-color, var(--hub-ref-color-white, #fff));font-size:var(--hub-avatar-content-icon-size, calc(var(--hub-avatar-size, 50px) * .55));line-height:1}.hub-avatar--custom .hub-avatar__custom>*{line-height:1}.hub-avatar--custom .hub-avatar__custom ::ng-deep svg,.hub-avatar--custom .hub-avatar__custom ::ng-deep img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}.hub-avatar__badge{position:absolute;inset-block-end:var(--hub-avatar-badge-offset, 0px);inset-inline-end:var(--hub-avatar-badge-offset, 0px);box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;background:var(--hub-avatar-badge-color, var(--hub-sys-color-secondary, #6c757d));color:var(--hub-avatar-badge-text-color, var(--hub-ref-color-white, #fff));box-shadow:0 0 0 var(--hub-avatar-badge-ring-width, 2px) var(--hub-avatar-badge-ring-color, var(--hub-sys-surface-page, #fff))}.hub-avatar__badge--dot{width:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));height:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));border-radius:50%}.hub-avatar__badge--label{min-width:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));height:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));padding-inline:var(--hub-avatar-badge-padding, calc(var(--hub-avatar-size, 50px) * .08));border-radius:var(--hub-sys-radius-pill, 50rem);font-family:var(--hub-avatar-font-family, Helvetica, Arial, sans-serif);font-size:var(--hub-avatar-badge-font-size, calc(var(--hub-avatar-size, 50px) * .22));font-weight:var(--hub-ref-font-weight-bold, 700);line-height:1}:host([data-badge-color=primary]){--hub-avatar-badge-color: var(--hub-sys-color-primary)}:host(.hub-avatar--primary){--hub-avatar-accent: var(--hub-sys-color-primary)}:host([data-badge-color=secondary]){--hub-avatar-badge-color: var(--hub-sys-color-secondary)}:host(.hub-avatar--secondary){--hub-avatar-accent: var(--hub-sys-color-secondary)}:host([data-badge-color=success]){--hub-avatar-badge-color: var(--hub-sys-color-success)}:host(.hub-avatar--success){--hub-avatar-accent: var(--hub-sys-color-success)}:host([data-badge-color=danger]){--hub-avatar-badge-color: var(--hub-sys-color-danger)}:host(.hub-avatar--danger){--hub-avatar-accent: var(--hub-sys-color-danger)}:host([data-badge-color=warning]){--hub-avatar-badge-color: var(--hub-sys-color-warning)}:host(.hub-avatar--warning){--hub-avatar-accent: var(--hub-sys-color-warning)}:host([data-badge-color=info]){--hub-avatar-badge-color: var(--hub-sys-color-info)}:host(.hub-avatar--info){--hub-avatar-accent: var(--hub-sys-color-info)}:host([data-badge-color=neutral]){--hub-avatar-badge-color: var(--hub-sys-color-neutral)}:host(.hub-avatar--neutral){--hub-avatar-accent: var(--hub-sys-color-neutral)}:host([data-badge-color=light]){--hub-avatar-badge-color: var(--hub-sys-color-light)}:host(.hub-avatar--light){--hub-avatar-accent: var(--hub-sys-color-light)}:host([data-badge-color=dark]){--hub-avatar-badge-color: var(--hub-sys-color-dark)}:host(.hub-avatar--dark){--hub-avatar-accent: var(--hub-sys-color-dark)}:host([data-badge-color=warning]),:host([data-badge-color=light]){--hub-avatar-badge-text-color: var(--hub-sys-text-primary, #212529)}.hub-avatar-group{display:inline-flex;align-items:center}.hub-avatar-group hub-avatar{box-shadow:0 0 0 var(--hub-avatar-group-ring-width, 2px) var(--hub-avatar-group-ring-color, var(--hub-sys-surface-page, #fff))}.hub-avatar-group hub-avatar+hub-avatar{margin-inline-start:calc(-1 * var(--hub-avatar-group-overlap, 15px))}\n"] });
729
762
  }
730
763
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarComponent, decorators: [{
731
764
  type: Component,
@@ -754,14 +787,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
754
787
  }
755
788
  }
756
789
  </div>
757
- @if (status()) {
758
- <span class="hub-avatar__status" aria-hidden="true"></span>
790
+ @if (_hasBadge()) {
791
+ <span
792
+ class="hub-avatar__badge"
793
+ [class.hub-avatar__badge--dot]="_isDot()"
794
+ [class.hub-avatar__badge--label]="!_isDot()"
795
+ [attr.aria-hidden]="_isDot() ? 'true' : null"
796
+ >{{ _badgeText() }}</span
797
+ >
759
798
  }
760
799
  `, host: {
761
- '[attr.data-status]': 'status() || null',
800
+ '[attr.data-badge-color]': 'badgeColor() || null',
762
801
  '[style.--hub-avatar-size]': 'avatarSizePx'
763
- }, styles: [":root,:host{--hub-avatar-size: 50px;--hub-avatar-overflow: hidden;--hub-avatar-border-radius-round: 50%;--hub-avatar-border-radius-square: var(--hub-ref-radius-sm, .25rem);--hub-avatar-border-radius: var( --hub-avatar-border-radius-round, var(--hub-avatar-border-radius-square, .25rem) );--hub-avatar-border-width-default: var(--hub-ref-border-width, 1px);--hub-avatar-border-width: 0;--hub-avatar-border-color: transparent;--hub-avatar-fg-color: var(--hub-ref-color-white, #fff);--hub-avatar-bg-color: var(--hub-sys-color-primary, #0d6efd);--hub-avatar-font-family: var( --hub-ref-font-family-base, Helvetica, Arial, sans-serif );--hub-avatar-font-weight: var(--hub-ref-font-weight-base, 400);--hub-avatar-font-size: calc(var(--hub-avatar-size, 50px) / 3);--hub-avatar-line-height: var(--hub-avatar-size, 50px);--hub-avatar-text-transform: uppercase;--hub-avatar-text-align: center;--hub-avatar-object-fit: cover;--hub-avatar-content-padding: calc(var(--hub-avatar-size, 50px) * .2);--hub-avatar-content-icon-size: calc(var(--hub-avatar-size, 50px) * .55);--hub-avatar-status-size: calc(var(--hub-avatar-size, 50px) * .28);--hub-avatar-status-offset: 0px;--hub-avatar-status-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .05));--hub-avatar-status-ring-color: var(--hub-sys-surface-page, #fff);--hub-avatar-status-color: var(--hub-sys-text-muted, #6c757d);--hub-avatar-group-overlap: calc(var(--hub-avatar-size, 50px) * .3);--hub-avatar-group-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .04));--hub-avatar-group-ring-color: var(--hub-sys-surface-page, #fff)}:host{display:inline-block;position:relative;border-radius:var(--hub-avatar-border-radius, 50%)}.avatar-container{width:var(--hub-avatar-size, 50px);height:var(--hub-avatar-size, 50px);border-radius:var(--hub-avatar-border-radius, 50%);overflow:var(--hub-avatar-overflow, hidden)}.avatar-content{width:100%;height:100%;max-width:100%;box-sizing:border-box;border-radius:var(--hub-avatar-border-radius, 50%);border:var(--hub-avatar-border-width, 0) solid var(--hub-avatar-border-color, transparent);color:var(--hub-avatar-fg-color, var(--hub-ref-color-white, #fff));background-color:var(--hub-avatar-bg-color, var(--hub-sys-surface-page, #fff));font-family:var(--hub-avatar-font-family, Helvetica, Arial, sans-serif);font-size:var(--hub-avatar-font-size, calc(var(--hub-avatar-size, 50px) / 3));font-weight:var(--hub-avatar-font-weight, var(--hub-ref-font-weight-base, 400));line-height:var(--hub-avatar-line-height, var(--hub-avatar-size, 50px));text-transform:var(--hub-avatar-text-transform, uppercase);text-align:var(--hub-avatar-text-align, center)}div.avatar-content{display:flex;align-items:center;justify-content:center}img.avatar-content{display:block;object-fit:var(--hub-avatar-object-fit, cover);background-color:transparent}.hub-avatar__custom{display:none}.hub-avatar--custom .hub-avatar__custom{display:flex;align-items:center;justify-content:center;width:100%;height:100%;box-sizing:border-box;padding:var(--hub-avatar-content-padding, calc(var(--hub-avatar-size, 50px) * .2));border-radius:inherit;overflow:hidden;background-color:var(--hub-avatar-bg-color, var(--hub-sys-color-primary, #0d6efd));color:var(--hub-avatar-fg-color, var(--hub-ref-color-white, #fff));font-size:var(--hub-avatar-content-icon-size, calc(var(--hub-avatar-size, 50px) * .55));line-height:1}.hub-avatar--custom .hub-avatar__custom>*{line-height:1}.hub-avatar--custom .hub-avatar__custom ::ng-deep svg,.hub-avatar--custom .hub-avatar__custom ::ng-deep img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}.hub-avatar__status{position:absolute;inset-block-end:var(--hub-avatar-status-offset, 0px);inset-inline-end:var(--hub-avatar-status-offset, 0px);width:var(--hub-avatar-status-size, calc(var(--hub-avatar-size, 50px) * .28));height:var(--hub-avatar-status-size, calc(var(--hub-avatar-size, 50px) * .28));box-sizing:border-box;border-radius:50%;background:var(--hub-avatar-status-color, var(--hub-sys-text-muted, #6c757d));box-shadow:0 0 0 var(--hub-avatar-status-ring-width, 2px) var(--hub-avatar-status-ring-color, var(--hub-sys-surface-page, #fff))}:host([data-status=online]){--hub-avatar-status-color: var(--hub-sys-color-success)}:host([data-status=away]){--hub-avatar-status-color: var(--hub-sys-color-warning)}:host([data-status=busy]){--hub-avatar-status-color: var(--hub-sys-color-danger)}:host([data-status=offline]){--hub-avatar-status-color: var(--hub-sys-text-muted, #6c757d)}.hub-avatar-group{display:inline-flex;align-items:center}.hub-avatar-group hub-avatar{box-shadow:0 0 0 var(--hub-avatar-group-ring-width, 2px) var(--hub-avatar-group-ring-color, var(--hub-sys-surface-page, #fff))}.hub-avatar-group hub-avatar+hub-avatar{margin-inline-start:calc(-1 * var(--hub-avatar-group-overlap, 15px))}\n"] }]
764
- }], ctorParameters: () => [{ type: SourceFactory }, { type: AvatarService }, { type: i3.DomSanitizer }], propDecorators: { round: [{ type: i0.Input, args: [{ isSignal: true, alias: "round", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], textSizeRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "textSizeRatio", required: false }] }], bgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgColor", required: false }] }], fgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "fgColor", required: false }] }], borderColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderColor", required: false }] }], style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }], cornerRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "cornerRadius", required: false }] }], facebook: [{ type: i0.Input, args: [{ isSignal: true, alias: "facebookId", required: false }] }], gravatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "gravatarId", required: false }] }], github: [{ type: i0.Input, args: [{ isSignal: true, alias: "githubId", required: false }] }], custom: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], customAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], referrerpolicy: [{ type: i0.Input, args: [{ isSignal: true, alias: "referrerpolicy", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], initialsSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialsSize", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], clickOnAvatar: [{ type: i0.Output, args: ["clickOnAvatar"] }], customContentRef: [{
802
+ }, styles: [":root,:host{--hub-avatar-size: 50px;--hub-avatar-overflow: hidden;--hub-avatar-border-radius-round: 50%;--hub-avatar-border-radius-square: var(--hub-ref-radius-sm, .25rem);--hub-avatar-border-radius: var( --hub-avatar-border-radius-round, var(--hub-avatar-border-radius-square, .25rem) );--hub-avatar-border-width-default: var(--hub-ref-border-width, 1px);--hub-avatar-border-width: 0;--hub-avatar-border-color: transparent;--hub-avatar-accent: var(--hub-sys-color-primary, #0d6efd);--hub-avatar-accent-emphasis: color-mix(in oklch, var(--hub-avatar-accent) 80%, var(--hub-sys-color-ink, #212529));--hub-avatar-accent-subtle: color-mix(in oklch, var(--hub-avatar-accent) 12%, var(--hub-sys-surface-page, #fff));--hub-avatar-accent-on: oklch(from var(--hub-avatar-accent) clamp(0, (.62 - l) * 1000, 1) 0 h);--hub-avatar-fg-color: var(--hub-avatar-accent-on, var(--hub-ref-color-white, #fff));--hub-avatar-bg-color: var(--hub-avatar-accent, var(--hub-sys-color-primary, #0d6efd));--hub-avatar-font-family: var( --hub-ref-font-family-base, Helvetica, Arial, sans-serif );--hub-avatar-font-weight: var(--hub-ref-font-weight-base, 400);--hub-avatar-font-size: calc(var(--hub-avatar-size, 50px) / 3);--hub-avatar-line-height: var(--hub-avatar-size, 50px);--hub-avatar-text-transform: uppercase;--hub-avatar-text-align: center;--hub-avatar-object-fit: cover;--hub-avatar-content-padding: calc(var(--hub-avatar-size, 50px) * .2);--hub-avatar-content-icon-size: calc(var(--hub-avatar-size, 50px) * .55);--hub-avatar-badge-size: calc(var(--hub-avatar-size, 50px) * .28);--hub-avatar-badge-offset: 0px;--hub-avatar-badge-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .05));--hub-avatar-badge-ring-color: var(--hub-sys-surface-page, #fff);--hub-avatar-badge-color: var(--hub-sys-color-secondary, #6c757d);--hub-avatar-badge-text-color: var(--hub-ref-color-white, #fff);--hub-avatar-badge-font-size: calc(var(--hub-avatar-size, 50px) * .22);--hub-avatar-badge-padding: calc(var(--hub-avatar-size, 50px) * .08);--hub-avatar-group-overlap: calc(var(--hub-avatar-size, 50px) * .3);--hub-avatar-group-ring-width: max(2px, calc(var(--hub-avatar-size, 50px) * .04));--hub-avatar-group-ring-color: var(--hub-sys-surface-page, #fff)}:host{display:inline-block;position:relative;border-radius:var(--hub-avatar-border-radius, 50%)}.avatar-container{width:var(--hub-avatar-size, 50px);height:var(--hub-avatar-size, 50px);border-radius:var(--hub-avatar-border-radius, 50%);overflow:var(--hub-avatar-overflow, hidden)}.avatar-content{width:100%;height:100%;max-width:100%;box-sizing:border-box;border-radius:var(--hub-avatar-border-radius, 50%);border:var(--hub-avatar-border-width, 0) solid var(--hub-avatar-border-color, transparent);color:var(--hub-avatar-fg-color, var(--hub-ref-color-white, #fff));background-color:var(--hub-avatar-bg-color, var(--hub-sys-surface-page, #fff));font-family:var(--hub-avatar-font-family, Helvetica, Arial, sans-serif);font-size:var(--hub-avatar-font-size, calc(var(--hub-avatar-size, 50px) / 3));font-weight:var(--hub-avatar-font-weight, var(--hub-ref-font-weight-base, 400));line-height:var(--hub-avatar-line-height, var(--hub-avatar-size, 50px));text-transform:var(--hub-avatar-text-transform, uppercase);text-align:var(--hub-avatar-text-align, center)}div.avatar-content{display:flex;align-items:center;justify-content:center}img.avatar-content{display:block;object-fit:var(--hub-avatar-object-fit, cover);background-color:transparent}.hub-avatar__custom{display:none}.hub-avatar--custom .hub-avatar__custom{display:flex;align-items:center;justify-content:center;width:100%;height:100%;box-sizing:border-box;padding:var(--hub-avatar-content-padding, calc(var(--hub-avatar-size, 50px) * .2));border-radius:inherit;overflow:hidden;background-color:var(--hub-avatar-bg-color, var(--hub-sys-color-primary, #0d6efd));color:var(--hub-avatar-fg-color, var(--hub-ref-color-white, #fff));font-size:var(--hub-avatar-content-icon-size, calc(var(--hub-avatar-size, 50px) * .55));line-height:1}.hub-avatar--custom .hub-avatar__custom>*{line-height:1}.hub-avatar--custom .hub-avatar__custom ::ng-deep svg,.hub-avatar--custom .hub-avatar__custom ::ng-deep img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}.hub-avatar__badge{position:absolute;inset-block-end:var(--hub-avatar-badge-offset, 0px);inset-inline-end:var(--hub-avatar-badge-offset, 0px);box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;background:var(--hub-avatar-badge-color, var(--hub-sys-color-secondary, #6c757d));color:var(--hub-avatar-badge-text-color, var(--hub-ref-color-white, #fff));box-shadow:0 0 0 var(--hub-avatar-badge-ring-width, 2px) var(--hub-avatar-badge-ring-color, var(--hub-sys-surface-page, #fff))}.hub-avatar__badge--dot{width:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));height:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));border-radius:50%}.hub-avatar__badge--label{min-width:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));height:var(--hub-avatar-badge-size, calc(var(--hub-avatar-size, 50px) * .28));padding-inline:var(--hub-avatar-badge-padding, calc(var(--hub-avatar-size, 50px) * .08));border-radius:var(--hub-sys-radius-pill, 50rem);font-family:var(--hub-avatar-font-family, Helvetica, Arial, sans-serif);font-size:var(--hub-avatar-badge-font-size, calc(var(--hub-avatar-size, 50px) * .22));font-weight:var(--hub-ref-font-weight-bold, 700);line-height:1}:host([data-badge-color=primary]){--hub-avatar-badge-color: var(--hub-sys-color-primary)}:host(.hub-avatar--primary){--hub-avatar-accent: var(--hub-sys-color-primary)}:host([data-badge-color=secondary]){--hub-avatar-badge-color: var(--hub-sys-color-secondary)}:host(.hub-avatar--secondary){--hub-avatar-accent: var(--hub-sys-color-secondary)}:host([data-badge-color=success]){--hub-avatar-badge-color: var(--hub-sys-color-success)}:host(.hub-avatar--success){--hub-avatar-accent: var(--hub-sys-color-success)}:host([data-badge-color=danger]){--hub-avatar-badge-color: var(--hub-sys-color-danger)}:host(.hub-avatar--danger){--hub-avatar-accent: var(--hub-sys-color-danger)}:host([data-badge-color=warning]){--hub-avatar-badge-color: var(--hub-sys-color-warning)}:host(.hub-avatar--warning){--hub-avatar-accent: var(--hub-sys-color-warning)}:host([data-badge-color=info]){--hub-avatar-badge-color: var(--hub-sys-color-info)}:host(.hub-avatar--info){--hub-avatar-accent: var(--hub-sys-color-info)}:host([data-badge-color=neutral]){--hub-avatar-badge-color: var(--hub-sys-color-neutral)}:host(.hub-avatar--neutral){--hub-avatar-accent: var(--hub-sys-color-neutral)}:host([data-badge-color=light]){--hub-avatar-badge-color: var(--hub-sys-color-light)}:host(.hub-avatar--light){--hub-avatar-accent: var(--hub-sys-color-light)}:host([data-badge-color=dark]){--hub-avatar-badge-color: var(--hub-sys-color-dark)}:host(.hub-avatar--dark){--hub-avatar-accent: var(--hub-sys-color-dark)}:host([data-badge-color=warning]),:host([data-badge-color=light]){--hub-avatar-badge-text-color: var(--hub-sys-text-primary, #212529)}.hub-avatar-group{display:inline-flex;align-items:center}.hub-avatar-group hub-avatar{box-shadow:0 0 0 var(--hub-avatar-group-ring-width, 2px) var(--hub-avatar-group-ring-color, var(--hub-sys-surface-page, #fff))}.hub-avatar-group hub-avatar+hub-avatar{margin-inline-start:calc(-1 * var(--hub-avatar-group-overlap, 15px))}\n"] }]
803
+ }], ctorParameters: () => [{ type: SourceFactory }, { type: AvatarService }, { type: i3.DomSanitizer }], propDecorators: { round: [{ type: i0.Input, args: [{ isSignal: true, alias: "round", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], textSizeRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "textSizeRatio", required: false }] }], bgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgColor", required: false }] }], fgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "fgColor", required: false }] }], borderColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderColor", required: false }] }], style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }], cornerRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "cornerRadius", required: false }] }], facebook: [{ type: i0.Input, args: [{ isSignal: true, alias: "facebookId", required: false }] }], gravatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "gravatarId", required: false }] }], github: [{ type: i0.Input, args: [{ isSignal: true, alias: "githubId", required: false }] }], custom: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], customAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], referrerpolicy: [{ type: i0.Input, args: [{ isSignal: true, alias: "referrerpolicy", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], initialsSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialsSize", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], badgeColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeColor", required: false }] }], clickOnAvatar: [{ type: i0.Output, args: ["clickOnAvatar"] }], customContentRef: [{
765
804
  type: ViewChild,
766
805
  args: ['customContent', { static: true }]
767
806
  }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"ng-hub-ui-avatar.mjs","sources":["../../../projects/avatar/src/lib/avatar-config.token.ts","../../../projects/avatar/src/lib/avatar-config.service.ts","../../../projects/avatar/src/lib/sources/avatar-source.enum.ts","../../../projects/avatar/src/lib/avatar.service.ts","../../../projects/avatar/src/lib/sources/async-source.ts","../../../projects/avatar/src/lib/sources/facebook.ts","../../../projects/avatar/src/lib/sources/custom.ts","../../../projects/avatar/src/lib/sources/initials.ts","../../../projects/avatar/src/lib/sources/gravatar.ts","../../../projects/avatar/src/lib/sources/value.ts","../../../projects/avatar/src/lib/sources/github.ts","../../../projects/avatar/src/lib/sources/custom-no-cache.ts","../../../projects/avatar/src/lib/sources/source.factory.ts","../../../projects/avatar/src/lib/avatar.component.ts","../../../projects/avatar/src/lib/avatar.module.ts","../../../projects/avatar/src/public_api.ts","../../../projects/avatar/src/ng-hub-ui-avatar.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { AvatarConfig } from './avatar-config';\n/**\n * Token used to inject the AvatarConfig object\n */\nexport const AVATAR_CONFIG = new InjectionToken<AvatarConfig>('avatar.config');\n","import { Inject, Injectable, Optional } from '@angular/core';\n\nimport type { AvatarConfig } from './avatar-config';\nimport { AVATAR_CONFIG } from './avatar-config.token';\nimport { AvatarSource } from './sources/avatar-source.enum';\n\n@Injectable({ providedIn: 'root' })\nexport class AvatarConfigService {\n\tconstructor(\n\t\t@Optional()\n\t\t@Inject(AVATAR_CONFIG)\n\t\tpublic userConfig: AvatarConfig\n\t) {}\n\n\tpublic getAvatarSources(defaultSources: AvatarSource[]): AvatarSource[] {\n\t\tif (\n\t\t\tthis.userConfig &&\n\t\t\tthis.userConfig.sourcePriorityOrder &&\n\t\t\tthis.userConfig.sourcePriorityOrder.length\n\t\t) {\n\t\t\tconst uniqueSources = [\n\t\t\t\t...new Set(this.userConfig.sourcePriorityOrder)\n\t\t\t];\n\t\t\tconst validSources = uniqueSources.filter((source) =>\n\t\t\t\tdefaultSources.includes(source)\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...validSources,\n\t\t\t\t...defaultSources.filter(\n\t\t\t\t\t(source) => !validSources.includes(source)\n\t\t\t\t)\n\t\t\t];\n\t\t}\n\t\treturn defaultSources;\n\t}\n\n\tpublic getAvatarColors(defaultColors: string[]): string[] {\n\t\treturn (\n\t\t\t(this.userConfig &&\n\t\t\t\tthis.userConfig.colors &&\n\t\t\t\tthis.userConfig.colors.length &&\n\t\t\t\tthis.userConfig.colors) ||\n\t\t\tdefaultColors\n\t\t);\n\t}\n\n\tpublic getDisableSrcCache(defaultDisableSrcCache: boolean): boolean {\n\t\tif (\n\t\t\tthis.userConfig == null ||\n\t\t\tthis.userConfig.disableSrcCache == null\n\t\t) {\n\t\t\treturn defaultDisableSrcCache;\n\t\t} else {\n\t\t\treturn this.userConfig.disableSrcCache;\n\t\t}\n\t}\n}\n","export enum AvatarSource {\n FACEBOOK = 'facebook',\n GRAVATAR = 'gravatar',\n GITHUB = 'github',\n CUSTOM = 'custom',\n INITIALS = 'initials',\n VALUE = 'value'\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\n\nimport { Observable } from 'rxjs';\n\nimport { AvatarConfigService } from './avatar-config.service';\nimport { AvatarSource } from './sources/avatar-source.enum';\nimport { Source } from './sources/source';\n\n/**\n * list of Supported avatar sources\n */\nexport const defaultSources = [\n AvatarSource.FACEBOOK,\n AvatarSource.GRAVATAR,\n AvatarSource.GITHUB,\n AvatarSource.CUSTOM,\n AvatarSource.INITIALS,\n AvatarSource.VALUE\n];\n\n/**\n * list of default colors\n */\nexport const defaultColors = [\n '#1abc9c',\n '#3498db',\n '#f1c40f',\n '#8e44ad',\n '#e74c3c',\n '#d35400',\n '#2c3e50',\n '#7f8c8d'\n];\n\n/**\n * Default disable custom source cache settings\n */\nexport const defaultDisableSrcCache = false;\n\n/**\n * Provides utilities methods related to Avatar component\n */\n@Injectable({providedIn: 'root'})\nexport class AvatarService {\n public avatarSources: AvatarSource[] = defaultSources;\n public avatarColors: string[] = defaultColors;\n\n private readonly failedSources = new Map<string, Source>();\n\n constructor(\n private http: HttpClient,\n private avatarConfigService: AvatarConfigService\n ) {\n this.overrideAvatarSources();\n this.overrideAvatarColors();\n }\n\n public fetchAvatar(avatarUrl: string): Observable<unknown> {\n return this.http.get(avatarUrl);\n }\n\n public getRandomColor(avatarText: string): string {\n if (!avatarText) {\n return 'transparent';\n }\n const asciiCodeSum = this.calculateAsciiCode(avatarText);\n return this.avatarColors[asciiCodeSum % this.avatarColors.length];\n }\n\n public compareSources(\n sourceType1: AvatarSource,\n sourceType2: AvatarSource\n ): number {\n return (\n this.getSourcePriority(sourceType1) - this.getSourcePriority(sourceType2)\n );\n }\n\n public isSource(source: string): boolean {\n return this.avatarSources.includes(source as AvatarSource);\n }\n\n public isTextAvatar(sourceType: AvatarSource): boolean {\n return [AvatarSource.INITIALS, AvatarSource.VALUE].includes(sourceType);\n }\n\n private buildSourceKey(source: Source): string {\n return source.sourceType + '-' + source.sourceId;\n }\n\n public sourceHasFailedBefore(source: Source): boolean {\n return this.failedSources.has(this.buildSourceKey(source));\n }\n\n public markSourceAsFailed(source: Source): void {\n this.failedSources.set(this.buildSourceKey(source), source);\n }\n\n private overrideAvatarSources(): void {\n this.avatarSources = this.avatarConfigService.getAvatarSources(\n defaultSources\n );\n }\n\n private overrideAvatarColors(): void {\n this.avatarColors = this.avatarConfigService.getAvatarColors(defaultColors);\n }\n\n private calculateAsciiCode(value: string): number {\n return value\n .split('')\n .map(letter => letter.charCodeAt(0))\n .reduce((previous: number, current: number) => previous + current);\n }\n\n private getSourcePriority(sourceType: AvatarSource) {\n return this.avatarSources.indexOf(sourceType);\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Contract of all async sources.\n * Every async source must implement the processResponse method that extracts the avatar url from the data\n */\nexport abstract class AsyncSource implements Source {\n readonly abstract sourceType: AvatarSource;\n\n constructor(public sourceId: string) {}\n\n abstract getAvatar(size: number): string;\n abstract processResponse(data: unknown, size?: number): string | null;\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n/**\n * Facebook source implementation.\n * Fetch avatar source based on facebook identifier\n * and image size\n */\nexport class Facebook implements Source {\n readonly sourceType: AvatarSource = AvatarSource.FACEBOOK;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(size: number): string {\n return (\n 'https://graph.facebook.com/' +\n `${this.sourceId}/picture?width=${size}&height=${size}`\n );\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n/**\n * Custom source implementation.\n * return custom image as an avatar\n *\n */\nexport class Custom implements Source {\n readonly sourceType: AvatarSource = AvatarSource.CUSTOM;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n return this.sourceId;\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Initials source implementation.\n * return the initials of the given value\n */\nexport class Initials implements Source {\n readonly sourceType: AvatarSource = AvatarSource.INITIALS;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(size: number): string {\n return this.getInitials(this.sourceId, size);\n }\n\n /**\n * Returns the initial letters of a name in a string.\n */\n private getInitials(name: string, size: number): string {\n name = name.trim();\n\n if (!name) {\n return '';\n }\n\n const initials = name.split(' ');\n\n if (size && size < initials.length) {\n return this.constructInitials(initials.slice(0, size));\n } else {\n return this.constructInitials(initials);\n }\n }\n\n /**\n * Iterates a person's name string to get the initials of each word in uppercase.\n */\n private constructInitials(elements: string[]): string {\n if (!elements || !elements.length) {\n return '';\n }\n\n return elements\n .filter(element => element && element.length > 0)\n .map(element => element[0].toUpperCase())\n .join('');\n }\n}\n","import { Md5 } from 'ts-md5';\nimport { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\nfunction isRetina(): boolean {\n if (typeof window !== 'undefined' && window !== null) {\n if (window.devicePixelRatio > 1.25) {\n return true;\n }\n\n const mediaQuery = '(-webkit-min-device-pixel-ratio: 1.25), (min--moz-device-pixel-ratio: 1.25), (-o-min-device-pixel-ratio: 5/4), (min-resolution: 1.25dppx)';\n if (window.matchMedia && window.matchMedia(mediaQuery).matches) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Gravatar source implementation.\n * Fetch avatar source based on gravatar email\n */\nexport class Gravatar implements Source {\n readonly sourceType: AvatarSource = AvatarSource.GRAVATAR;\n public sourceId: string;\n\n constructor(public value: string) {\n this.sourceId = value.match('^[a-f0-9]{32}$')\n ? value\n : Md5.hashStr(value).toString();\n }\n\n public getAvatar(size: number): string {\n const avatarSize = isRetina() ? size * 2 : size;\n return `https://secure.gravatar.com/avatar/${\n this.sourceId\n }?s=${avatarSize}&d=404`;\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Value source implementation.\n * return the value as avatar\n */\nexport class Value implements Source {\n readonly sourceType: AvatarSource = AvatarSource.VALUE;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n return this.sourceId;\n }\n}\n","import { AsyncSource } from './async-source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * GitHub source implementation.\n * Fetch avatar source based on github identifier\n */\nexport class Github extends AsyncSource {\n readonly sourceType: AvatarSource = AvatarSource.GITHUB;\n\n constructor(sourceId: string) {\n super(sourceId);\n }\n\n public getAvatar(): string {\n return `https://api.github.com/users/${this.sourceId}`;\n }\n\n /**\n * extract github avatar from json data\n */\n public processResponse(data: { avatar_url: string }, size?: number): string {\n if (size) {\n return `${data.avatar_url}&s=${size}`;\n }\n return data.avatar_url;\n }\n}\n","import {Source} from './source';\nimport {AvatarSource} from './avatar-source.enum';\n\n/**\n * Custom source implementation (with no cache).\n * return custom image as an avatar\n *\n */\nexport class CustomNoCache implements Source {\n readonly sourceType: AvatarSource = AvatarSource.CUSTOM;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n const urlSuffix = Math.random();\n return `${this.sourceId}${this.sourceId.indexOf('?') > -1 ? '&' : '?'}_=${urlSuffix}`;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Source } from './source';\nimport { Facebook } from './facebook';\nimport { Custom } from './custom';\nimport { Initials } from './initials';\nimport { Gravatar } from './gravatar';\nimport { Value } from './value';\nimport { Github } from './github';\nimport { SourceCreator } from './source.creator';\nimport { AvatarSource } from './avatar-source.enum';\nimport { AvatarConfigService } from '../avatar-config.service';\nimport { defaultDisableSrcCache } from '../avatar.service';\nimport { CustomNoCache } from './custom-no-cache';\n\n/**\n * Factory class that implements factory method pattern.\n * Used to create Source implementation class based\n * on the source Type\n */\n@Injectable({providedIn: 'root'})\nexport class SourceFactory {\n private sources: { [key: string]: SourceCreator } = {};\n\n constructor(avatarConfigService: AvatarConfigService) {\n const disableSrcCache = avatarConfigService.getDisableSrcCache(defaultDisableSrcCache);\n this.sources[AvatarSource.FACEBOOK] = Facebook;\n this.sources[AvatarSource.GRAVATAR] = Gravatar;\n this.sources[AvatarSource.CUSTOM] = disableSrcCache ? CustomNoCache : Custom;\n this.sources[AvatarSource.INITIALS] = Initials;\n this.sources[AvatarSource.VALUE] = Value;\n this.sources[AvatarSource.GITHUB] = Github;\n }\n\n public newInstance(sourceType: AvatarSource, sourceValue: string): Source {\n return new this.sources[sourceType](sourceValue);\n }\n}\n","import { AfterContentInit, Component, ElementRef, OnChanges, OnDestroy, SecurityContext, SimpleChanges, ViewChild, input, output } from '@angular/core';\n\nimport { DomSanitizer, SafeUrl } from '@angular/platform-browser';\nimport { map, takeWhile } from 'rxjs/operators';\nimport { AvatarService } from './avatar.service';\nimport { AsyncSource } from './sources/async-source';\nimport { AvatarSource } from './sources/avatar-source.enum';\nimport { Source } from './sources/source';\nimport { SourceFactory } from './sources/source.factory';\n\ntype StyleObject = Record<string, string | number | null | undefined>;\ntype Style = StyleObject | string;\n\n/**\n * Built-in semantic presence statuses for the avatar indicator dot.\n * `online` → success · `away` → warning · `busy` → danger · `offline` → neutral.\n */\nexport type HubAvatarStatus = 'online' | 'away' | 'busy' | 'offline';\n\n/**\n * Universal avatar component that\n * generates avatar from different sources\n *\n * export\n * class AvatarComponent\n * implements {OnChanges}\n */\n\n@Component({\n\t// tslint:disable-next-line:component-selector\n\tselector: 'hub-avatar',\n\tstandalone: false,\n\tstyleUrl: './avatar.component.scss',\n\ttemplate: `\n\t\t<div (click)=\"onAvatarClicked()\" class=\"avatar-container\" [class.hub-avatar--custom]=\"hasCustomContent\" [style]=\"hostStyle\">\n\t\t\t<span #customContent class=\"hub-avatar__custom\" [style]=\"customContentStyle\"><ng-content></ng-content></span>\n\t\t\t@if (!hasCustomContent) {\n\t\t\t\t@if (avatarSrc) {\n\t\t\t\t\t<img\n\t\t\t\t\t\t[src]=\"avatarSrc\"\n\t\t\t\t\t\t[alt]=\"customAlt() ? customAlt() : avatarAlt\"\n\t\t\t\t\t\t[width]=\"size()\"\n\t\t\t\t\t\t[height]=\"size()\"\n\t\t\t\t\t\t[style]=\"avatarStyle\"\n\t\t\t\t\t\t[referrerPolicy]=\"referrerpolicy()\"\n\t\t\t\t\t\t(error)=\"fetchAvatarSource()\"\n\t\t\t\t\t\tclass=\"avatar-content\"\n\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t/>\n\t\t\t\t} @else {\n\t\t\t\t\t@if (avatarText) {\n\t\t\t\t\t\t<div class=\"avatar-content\" [style]=\"avatarStyle\">\n\t\t\t\t\t\t\t{{ avatarText }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t</div>\n\t\t@if (status()) {\n\t\t\t<span class=\"hub-avatar__status\" aria-hidden=\"true\"></span>\n\t\t}\n\t`,\n\thost: {\n\t\t'[attr.data-status]': 'status() || null',\n\t\t'[style.--hub-avatar-size]': 'avatarSizePx'\n\t}\n})\nexport class AvatarComponent implements AfterContentInit, OnChanges, OnDestroy {\n\treadonly round = input(true);\n\treadonly size = input<string | number>(50);\n\treadonly textSizeRatio = input(3);\n\treadonly bgColor = input<string>();\n\treadonly fgColor = input('#FFF');\n\treadonly borderColor = input<string>();\n\treadonly style = input<Style>({});\n\treadonly cornerRadius = input<string | number>(0);\n\treadonly facebook = input<string | null>(undefined, { alias: 'facebookId' });\n\treadonly gravatar = input<string | null>(undefined, { alias: 'gravatarId' });\n\treadonly github = input<string | null>(undefined, { alias: 'githubId' });\n\treadonly custom = input<string | SafeUrl | null>(undefined, { alias: 'src' });\n\treadonly customAlt = input<string | null>(undefined, { alias: 'alt' });\n\treadonly initials = input<string | null>(undefined, { alias: 'name' });\n\treadonly value = input<string | null>();\n\treadonly referrerpolicy = input<string | null>();\n\treadonly placeholder = input<string>();\n\treadonly initialsSize = input<string | number>(0);\n\t/**\n\t * Semantic presence indicator shown as a small dot at the bottom-end corner.\n\t * Built-ins: `online` (success) · `away` (warning) · `busy` (danger) · `offline`\n\t * (neutral). Any custom string is accepted — set `--hub-avatar-status-color`\n\t * to colour it. When unset (default) no dot is rendered.\n\t */\n\treadonly status = input<HubAvatarStatus | (string & {}) | null>(null);\n\n\treadonly clickOnAvatar = output<Source>();\n\n\t/** Wrapper around the projected content (`<ng-content>`), used to detect whether the consumer projected anything. */\n\t@ViewChild('customContent', { static: true }) private customContentRef?: ElementRef<HTMLElement>;\n\n\t/** True when the consumer projected custom content (an icon, SVG, image, …) into the avatar. */\n\thasCustomContent = false;\n\n\t/** Inline style applied to the projected-content slot (honours `bgColor` / `fgColor` / `borderColor` / `style`). */\n\tcustomContentStyle: StyleObject = {};\n\n\tisAlive = true;\n\tavatarSrc: SafeUrl | null = null;\n\tavatarAlt: SafeUrl | null = null;\n\tavatarText: string | null = null;\n\tavatarStyle: StyleObject = {};\n\thostStyle: StyleObject = {};\n\n\tprivate currentIndex = -1;\n\tprivate sources: Source[] = [];\n\n\tconstructor(\n\t\tprivate sourceFactory: SourceFactory,\n\t\tprivate avatarService: AvatarService,\n\t\tprivate sanitizer: DomSanitizer\n\t) {}\n\n\tonAvatarClicked(): void {\n\t\tthis.clickOnAvatar.emit(this.sources[this.currentIndex]);\n\t}\n\n\t/**\n\t * Detects projected content once it is available and, when present, computes its style.\n\t * Runs after content init so `<ng-content>` nodes are already in place.\n\t */\n\tngAfterContentInit(): void {\n\t\tconst host = this.customContentRef?.nativeElement;\n\t\tthis.hasCustomContent = !!host && this.hasMeaningfulProjectedContent(host);\n\t\tif (this.hasCustomContent) {\n\t\t\tthis.customContentStyle = this.getCustomContentStyle();\n\t\t}\n\t}\n\n\t/**\n\t * Returns true when the projected slot holds a real element or non-whitespace text,\n\t * so whitespace-only projection does not flip the avatar into custom-content mode.\n\t *\n\t * @param host The element wrapping the projected content.\n\t */\n\tprivate hasMeaningfulProjectedContent(host: HTMLElement): boolean {\n\t\treturn Array.from(host.childNodes).some(\n\t\t\t(node) =>\n\t\t\t\tnode.nodeType === Node.ELEMENT_NODE ||\n\t\t\t\t(node.nodeType === Node.TEXT_NODE && (node.textContent ?? '').trim().length > 0)\n\t\t);\n\t}\n\n\t/**\n\t * Builds the inline style for the projected-content slot. Sensible visible defaults\n\t * (a themed background circle and a readable foreground colour) come from CSS tokens;\n\t * the `bgColor` / `fgColor` / `borderColor` / `style` inputs override them when set.\n\t */\n\tprivate getCustomContentStyle(): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst bgColor = this.bgColor();\n\t\tconst hasCustomFgColor = this.fgColor() !== '#FFF';\n\t\treturn {\n\t\t\tbackgroundColor: bgColor ? bgColor : undefined,\n\t\t\tcolor: hasCustomFgColor ? this.fgColor() : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\t/**\n\t * The avatar size as a px string. Exposed on the host as `--hub-avatar-size`\n\t * so the status dot (and any token-driven child) scales with the avatar.\n\t */\n\tget avatarSizePx(): string {\n\t\treturn (parseFloat(String(this.size())) || 50) + 'px';\n\t}\n\n\t/**\n\t * Detect inputs change\n\t *\n\t * param {{ [propKey: string]: SimpleChange }} changes\n\t *\n\t * memberof AvatarComponent\n\t */\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tfor (const propName in changes) {\n\t\t\tif (this.avatarService.isSource(propName)) {\n\t\t\t\tconst sourceType: AvatarSource = AvatarSource[propName.toUpperCase() as keyof typeof AvatarSource];\n\t\t\t\tconst currentValue = changes[propName].currentValue;\n\t\t\t\tif (currentValue && typeof currentValue === 'string') {\n\t\t\t\t\tthis.addSource(sourceType, currentValue);\n\t\t\t\t} else {\n\t\t\t\t\tconst sanitized = this.sanitizer.sanitize(SecurityContext.URL, currentValue);\n\t\t\t\t\tif (sanitized) {\n\t\t\t\t\t\tthis.addSource(sourceType, sanitized);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.removeSource(sourceType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Reinitialize when any source input changes so fallback order is recalculated.\n\t\tthis.initializeAvatar();\n\t\tif (this.hasCustomContent) {\n\t\t\tthis.customContentStyle = this.getCustomContentStyle();\n\t\t}\n\t}\n\n\t/**\n\t * Fetch avatar source\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tfetchAvatarSource(): void {\n\t\tconst previousSource = this.sources[this.currentIndex];\n\t\tif (previousSource) {\n\t\t\tthis.avatarService.markSourceAsFailed(previousSource);\n\t\t}\n\n\t\tconst source = this.findNextSource();\n\t\tif (!source) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.avatarService.isTextAvatar(source.sourceType)) {\n\t\t\tthis.buildTextAvatar(source);\n\t\t\tthis.avatarSrc = null;\n\t\t} else {\n\t\t\tthis.buildImageAvatar(source);\n\t\t}\n\t}\n\n\tprivate findNextSource(): Source | null {\n\t\twhile (++this.currentIndex < this.sources.length) {\n\t\t\tconst source = this.sources[this.currentIndex];\n\t\t\tif (source && !this.avatarService.sourceHasFailedBefore(source)) {\n\t\t\t\treturn source;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.isAlive = false;\n\t}\n\n\t/**\n\t * Initialize the avatar component and its fallback system\n\t */\n\tprivate initializeAvatar(): void {\n\t\tconst computedBorderRadius = this.round()\n\t\t\t? '50%'\n\t\t\t: this.cornerRadius() + 'px';\n\t\tthis.hostStyle = {\n\t\t\twidth: this.size() + 'px',\n\t\t\theight: this.size() + 'px',\n\t\t\tborderRadius: computedBorderRadius\n\t\t};\n\n\t\tthis.currentIndex = -1;\n\t\tif (this.sources.length > 0) {\n\t\t\tthis.sortAvatarSources();\n\t\t\tthis.fetchAvatarSource();\n\t\t}\n\t}\n\n\tprivate sortAvatarSources(): void {\n\t\tthis.sources.sort((source1: Source, source2: Source) =>\n\t\t\tthis.avatarService.compareSources(source1.sourceType, source2.sourceType)\n\t\t);\n\t}\n\n\tprivate buildTextAvatar(avatarSource: Source): void {\n\t\tthis.avatarText = avatarSource.getAvatar(+this.initialsSize());\n\t\tthis.avatarStyle = this.getInitialsStyle(avatarSource.sourceId);\n\t}\n\n\tprivate buildImageAvatar(avatarSource: Source): void {\n\t\tthis.avatarStyle = this.getImageStyle();\n\t\tif (avatarSource instanceof AsyncSource) {\n\t\t\tthis.fetchAndProcessAsyncAvatar(avatarSource);\n\t\t} else {\n\t\t\tthis.avatarSrc = this.sanitizer.bypassSecurityTrustUrl(avatarSource.getAvatar(+this.size()));\n\t\t\tthis.avatarAlt = avatarSource.getAvatar(+this.size());\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * returns initials style\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tprivate getInitialsStyle(avatarValue: string): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst bgColor = this.bgColor();\n\t\tconst hasCornerRadius = !this.round() || +this.cornerRadius() > 0;\n\t\tconst hasCustomFgColor = this.fgColor() !== '#FFF';\n\t\treturn {\n\t\t\ttextAlign: 'center',\n\t\t\tborderRadius: hasCornerRadius ? (this.round() ? '100%' : this.cornerRadius() + 'px') : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\ttextTransform: 'uppercase',\n\t\t\tcolor: hasCustomFgColor ? this.fgColor() : undefined,\n\t\t\tbackgroundColor: bgColor ? bgColor : this.avatarService.getRandomColor(avatarValue),\n\t\t\tfont: Math.floor(+this.size() / this.textSizeRatio()) + 'px Helvetica, Arial, sans-serif',\n\t\t\tlineHeight: this.size() + 'px',\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\t/**\n\t *\n\t * returns image style\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tprivate getImageStyle(): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst hasCornerRadius = !this.round() || +this.cornerRadius() > 0;\n\t\treturn {\n\t\t\tmaxWidth: '100%',\n\t\t\tborderRadius: hasCornerRadius ? (this.round() ? '50%' : this.cornerRadius() + 'px') : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\twidth: this.size() + 'px',\n\t\t\theight: this.size() + 'px',\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\tprivate getCustomStyleObject(): StyleObject {\n\t\tconst customStyle = this.style();\n\t\tif (!customStyle) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (typeof customStyle === 'string') {\n\t\t\treturn this.parseInlineStyleString(customStyle);\n\t\t}\n\n\t\treturn customStyle;\n\t}\n\n\tprivate parseInlineStyleString(styleString: string): StyleObject {\n\t\tconst styleObject: StyleObject = {};\n\t\tstyleString\n\t\t\t.split(';')\n\t\t\t.map((declaration) => declaration.trim())\n\t\t\t.filter((declaration) => declaration.length > 0)\n\t\t\t.forEach((declaration) => {\n\t\t\t\tconst separatorIndex = declaration.indexOf(':');\n\t\t\t\tif (separatorIndex <= 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst property = declaration.slice(0, separatorIndex).trim();\n\t\t\t\tconst value = declaration.slice(separatorIndex + 1).trim();\n\t\t\t\tif (property && value) {\n\t\t\t\t\tstyleObject[property] = value;\n\t\t\t\t}\n\t\t\t});\n\t\treturn styleObject;\n\t}\n\n\t/**\n\t * Fetch avatar image asynchronously.\n\t *\n\t * param {Source} source represents avatar source\n\t * memberof AvatarComponent\n\t */\n\tprivate fetchAndProcessAsyncAvatar(source: AsyncSource): void {\n\t\tif (this.avatarService.sourceHasFailedBefore(source)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.avatarService\n\t\t\t.fetchAvatar(source.getAvatar(+this.size()))\n\t\t\t.pipe(\n\t\t\t\ttakeWhile(() => this.isAlive),\n\t\t\t\tmap((response) => source.processResponse(response, +this.size()))\n\t\t\t)\n\t\t\t.subscribe({\n\t\t\t\tnext: (avatarSrc) => (this.avatarSrc = avatarSrc),\n\t\t\t\terror: () => {\n\t\t\t\t\tthis.fetchAvatarSource();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Add avatar source\n\t *\n\t * param sourceType avatar source type e.g facebook,twitter, etc.\n\t * param sourceValue source value e.g facebookId value, etc.\n\t */\n\tprivate addSource(sourceType: AvatarSource, sourceValue: string): void {\n\t\tconst source = this.sources.find((s) => s.sourceType === sourceType);\n\t\tif (source) {\n\t\t\tsource.sourceId = sourceValue;\n\t\t} else {\n\t\t\tthis.sources.push(this.sourceFactory.newInstance(sourceType, sourceValue));\n\t\t}\n\t}\n\n\t/**\n\t * Remove avatar source\n\t *\n\t * param sourceType avatar source type e.g facebook,twitter, etc.\n\t */\n\tprivate removeSource(sourceType: AvatarSource): void {\n\t\tthis.sources = this.sources.filter((source) => source.sourceType !== sourceType);\n\t}\n}\n","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { AvatarConfig } from './avatar-config';\nimport { AvatarConfigService } from './avatar-config.service';\nimport { AVATAR_CONFIG } from './avatar-config.token';\nimport { AvatarComponent } from './avatar.component';\nimport { AvatarService } from './avatar.service';\nimport { SourceFactory } from './sources/source.factory';\n\n@NgModule({\n\timports: [CommonModule],\n\tdeclarations: [AvatarComponent],\n\tproviders: [SourceFactory, AvatarService, AvatarConfigService],\n\texports: [AvatarComponent]\n})\nexport class AvatarModule {\n\tstatic forRoot(\n\t\tavatarConfig?: AvatarConfig\n\t): ModuleWithProviders<AvatarModule> {\n\t\treturn {\n\t\t\tngModule: AvatarModule,\n\t\t\tproviders: [\n\t\t\t\t{\n\t\t\t\t\tprovide: AVATAR_CONFIG,\n\t\t\t\t\tuseValue: avatarConfig ? avatarConfig : {}\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\t}\n}\n","/*\n * Public API Surface of ng-hub-ui-avatar\n */\nexport * from './lib/avatar-config';\nexport * from './lib/avatar.component';\nexport * from './lib/avatar.module';\nexport * from './lib/avatar.service';\nexport * from './lib/sources/avatar-source.enum';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i2.AvatarConfigService","i1.AvatarConfigService","i1.SourceFactory","i2.AvatarService"],"mappings":";;;;;;;;AAGA;;AAEG;AACI,MAAM,aAAa,GAAG,IAAI,cAAc,CAAe,eAAe,CAAC;;MCCjE,mBAAmB,CAAA;AAIvB,IAAA,UAAA;AAHR,IAAA,WAAA,CAGQ,UAAwB,EAAA;QAAxB,IAAA,CAAA,UAAU,GAAV,UAAU;IACf;AAEI,IAAA,gBAAgB,CAAC,cAA8B,EAAA;QACrD,IACC,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,UAAU,CAAC,mBAAmB;AACnC,YAAA,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,MAAM,EACzC;AACD,YAAA,MAAM,aAAa,GAAG;gBACrB,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB;aAC9C;AACD,YAAA,MAAM,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,MAAM,KAChD,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAC/B;YACD,OAAO;AACN,gBAAA,GAAG,YAAY;AACf,gBAAA,GAAG,cAAc,CAAC,MAAM,CACvB,CAAC,MAAM,KAA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/src/lib/avatar-config.token.ts","../../../projects/avatar/src/lib/avatar-config.service.ts","../../../projects/avatar/src/lib/sources/avatar-source.enum.ts","../../../projects/avatar/src/lib/avatar.service.ts","../../../projects/avatar/src/lib/sources/async-source.ts","../../../projects/avatar/src/lib/sources/facebook.ts","../../../projects/avatar/src/lib/sources/custom.ts","../../../projects/avatar/src/lib/sources/initials.ts","../../../projects/avatar/src/lib/sources/gravatar.ts","../../../projects/avatar/src/lib/sources/value.ts","../../../projects/avatar/src/lib/sources/github.ts","../../../projects/avatar/src/lib/sources/custom-no-cache.ts","../../../projects/avatar/src/lib/sources/source.factory.ts","../../../projects/avatar/src/lib/avatar.component.ts","../../../projects/avatar/src/lib/avatar.module.ts","../../../projects/avatar/src/public_api.ts","../../../projects/avatar/src/ng-hub-ui-avatar.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { AvatarConfig } from './avatar-config';\n/**\n * Token used to inject the AvatarConfig object\n */\nexport const AVATAR_CONFIG = new InjectionToken<AvatarConfig>('avatar.config');\n","import { Inject, Injectable, Optional } from '@angular/core';\n\nimport type { AvatarConfig } from './avatar-config';\nimport { AVATAR_CONFIG } from './avatar-config.token';\nimport { AvatarSource } from './sources/avatar-source.enum';\n\n@Injectable({ providedIn: 'root' })\nexport class AvatarConfigService {\n\tconstructor(\n\t\t@Optional()\n\t\t@Inject(AVATAR_CONFIG)\n\t\tpublic userConfig: AvatarConfig\n\t) {}\n\n\tpublic getAvatarSources(defaultSources: AvatarSource[]): AvatarSource[] {\n\t\tif (\n\t\t\tthis.userConfig &&\n\t\t\tthis.userConfig.sourcePriorityOrder &&\n\t\t\tthis.userConfig.sourcePriorityOrder.length\n\t\t) {\n\t\t\tconst uniqueSources = [\n\t\t\t\t...new Set(this.userConfig.sourcePriorityOrder)\n\t\t\t];\n\t\t\tconst validSources = uniqueSources.filter((source) =>\n\t\t\t\tdefaultSources.includes(source)\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...validSources,\n\t\t\t\t...defaultSources.filter(\n\t\t\t\t\t(source) => !validSources.includes(source)\n\t\t\t\t)\n\t\t\t];\n\t\t}\n\t\treturn defaultSources;\n\t}\n\n\tpublic getAvatarColors(defaultColors: string[]): string[] {\n\t\treturn (\n\t\t\t(this.userConfig &&\n\t\t\t\tthis.userConfig.colors &&\n\t\t\t\tthis.userConfig.colors.length &&\n\t\t\t\tthis.userConfig.colors) ||\n\t\t\tdefaultColors\n\t\t);\n\t}\n\n\tpublic getDisableSrcCache(defaultDisableSrcCache: boolean): boolean {\n\t\tif (\n\t\t\tthis.userConfig == null ||\n\t\t\tthis.userConfig.disableSrcCache == null\n\t\t) {\n\t\t\treturn defaultDisableSrcCache;\n\t\t} else {\n\t\t\treturn this.userConfig.disableSrcCache;\n\t\t}\n\t}\n}\n","export enum AvatarSource {\n FACEBOOK = 'facebook',\n GRAVATAR = 'gravatar',\n GITHUB = 'github',\n CUSTOM = 'custom',\n INITIALS = 'initials',\n VALUE = 'value'\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\n\nimport { Observable } from 'rxjs';\n\nimport { AvatarConfigService } from './avatar-config.service';\nimport { AvatarSource } from './sources/avatar-source.enum';\nimport { Source } from './sources/source';\n\n/**\n * list of Supported avatar sources\n */\nexport const defaultSources = [\n AvatarSource.FACEBOOK,\n AvatarSource.GRAVATAR,\n AvatarSource.GITHUB,\n AvatarSource.CUSTOM,\n AvatarSource.INITIALS,\n AvatarSource.VALUE\n];\n\n/**\n * list of default colors\n */\nexport const defaultColors = [\n '#1abc9c',\n '#3498db',\n '#f1c40f',\n '#8e44ad',\n '#e74c3c',\n '#d35400',\n '#2c3e50',\n '#7f8c8d'\n];\n\n/**\n * Default disable custom source cache settings\n */\nexport const defaultDisableSrcCache = false;\n\n/**\n * Provides utilities methods related to Avatar component\n */\n@Injectable({providedIn: 'root'})\nexport class AvatarService {\n public avatarSources: AvatarSource[] = defaultSources;\n public avatarColors: string[] = defaultColors;\n\n private readonly failedSources = new Map<string, Source>();\n\n constructor(\n private http: HttpClient,\n private avatarConfigService: AvatarConfigService\n ) {\n this.overrideAvatarSources();\n this.overrideAvatarColors();\n }\n\n public fetchAvatar(avatarUrl: string): Observable<unknown> {\n return this.http.get(avatarUrl);\n }\n\n public getRandomColor(avatarText: string): string {\n if (!avatarText) {\n return 'transparent';\n }\n const asciiCodeSum = this.calculateAsciiCode(avatarText);\n return this.avatarColors[asciiCodeSum % this.avatarColors.length];\n }\n\n public compareSources(\n sourceType1: AvatarSource,\n sourceType2: AvatarSource\n ): number {\n return (\n this.getSourcePriority(sourceType1) - this.getSourcePriority(sourceType2)\n );\n }\n\n public isSource(source: string): boolean {\n return this.avatarSources.includes(source as AvatarSource);\n }\n\n public isTextAvatar(sourceType: AvatarSource): boolean {\n return [AvatarSource.INITIALS, AvatarSource.VALUE].includes(sourceType);\n }\n\n private buildSourceKey(source: Source): string {\n return source.sourceType + '-' + source.sourceId;\n }\n\n public sourceHasFailedBefore(source: Source): boolean {\n return this.failedSources.has(this.buildSourceKey(source));\n }\n\n public markSourceAsFailed(source: Source): void {\n this.failedSources.set(this.buildSourceKey(source), source);\n }\n\n private overrideAvatarSources(): void {\n this.avatarSources = this.avatarConfigService.getAvatarSources(\n defaultSources\n );\n }\n\n private overrideAvatarColors(): void {\n this.avatarColors = this.avatarConfigService.getAvatarColors(defaultColors);\n }\n\n private calculateAsciiCode(value: string): number {\n return value\n .split('')\n .map(letter => letter.charCodeAt(0))\n .reduce((previous: number, current: number) => previous + current);\n }\n\n private getSourcePriority(sourceType: AvatarSource) {\n return this.avatarSources.indexOf(sourceType);\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Contract of all async sources.\n * Every async source must implement the processResponse method that extracts the avatar url from the data\n */\nexport abstract class AsyncSource implements Source {\n readonly abstract sourceType: AvatarSource;\n\n constructor(public sourceId: string) {}\n\n abstract getAvatar(size: number): string;\n abstract processResponse(data: unknown, size?: number): string | null;\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n/**\n * Facebook source implementation.\n * Fetch avatar source based on facebook identifier\n * and image size\n */\nexport class Facebook implements Source {\n readonly sourceType: AvatarSource = AvatarSource.FACEBOOK;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(size: number): string {\n return (\n 'https://graph.facebook.com/' +\n `${this.sourceId}/picture?width=${size}&height=${size}`\n );\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n/**\n * Custom source implementation.\n * return custom image as an avatar\n *\n */\nexport class Custom implements Source {\n readonly sourceType: AvatarSource = AvatarSource.CUSTOM;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n return this.sourceId;\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Initials source implementation.\n * return the initials of the given value\n */\nexport class Initials implements Source {\n readonly sourceType: AvatarSource = AvatarSource.INITIALS;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(size: number): string {\n return this.getInitials(this.sourceId, size);\n }\n\n /**\n * Returns the initial letters of a name in a string.\n */\n private getInitials(name: string, size: number): string {\n name = name.trim();\n\n if (!name) {\n return '';\n }\n\n const initials = name.split(' ');\n\n if (size && size < initials.length) {\n return this.constructInitials(initials.slice(0, size));\n } else {\n return this.constructInitials(initials);\n }\n }\n\n /**\n * Iterates a person's name string to get the initials of each word in uppercase.\n */\n private constructInitials(elements: string[]): string {\n if (!elements || !elements.length) {\n return '';\n }\n\n return elements\n .filter(element => element && element.length > 0)\n .map(element => element[0].toUpperCase())\n .join('');\n }\n}\n","import { Md5 } from 'ts-md5';\nimport { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\nfunction isRetina(): boolean {\n if (typeof window !== 'undefined' && window !== null) {\n if (window.devicePixelRatio > 1.25) {\n return true;\n }\n\n const mediaQuery = '(-webkit-min-device-pixel-ratio: 1.25), (min--moz-device-pixel-ratio: 1.25), (-o-min-device-pixel-ratio: 5/4), (min-resolution: 1.25dppx)';\n if (window.matchMedia && window.matchMedia(mediaQuery).matches) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Gravatar source implementation.\n * Fetch avatar source based on gravatar email\n */\nexport class Gravatar implements Source {\n readonly sourceType: AvatarSource = AvatarSource.GRAVATAR;\n public sourceId: string;\n\n constructor(public value: string) {\n this.sourceId = value.match('^[a-f0-9]{32}$')\n ? value\n : Md5.hashStr(value).toString();\n }\n\n public getAvatar(size: number): string {\n const avatarSize = isRetina() ? size * 2 : size;\n return `https://secure.gravatar.com/avatar/${\n this.sourceId\n }?s=${avatarSize}&d=404`;\n }\n}\n","import { Source } from './source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * Value source implementation.\n * return the value as avatar\n */\nexport class Value implements Source {\n readonly sourceType: AvatarSource = AvatarSource.VALUE;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n return this.sourceId;\n }\n}\n","import { AsyncSource } from './async-source';\nimport { AvatarSource } from './avatar-source.enum';\n\n/**\n * GitHub source implementation.\n * Fetch avatar source based on github identifier\n */\nexport class Github extends AsyncSource {\n readonly sourceType: AvatarSource = AvatarSource.GITHUB;\n\n constructor(sourceId: string) {\n super(sourceId);\n }\n\n public getAvatar(): string {\n return `https://api.github.com/users/${this.sourceId}`;\n }\n\n /**\n * extract github avatar from json data\n */\n public processResponse(data: { avatar_url: string }, size?: number): string {\n if (size) {\n return `${data.avatar_url}&s=${size}`;\n }\n return data.avatar_url;\n }\n}\n","import {Source} from './source';\nimport {AvatarSource} from './avatar-source.enum';\n\n/**\n * Custom source implementation (with no cache).\n * return custom image as an avatar\n *\n */\nexport class CustomNoCache implements Source {\n readonly sourceType: AvatarSource = AvatarSource.CUSTOM;\n\n constructor(public sourceId: string) {}\n\n public getAvatar(): string {\n const urlSuffix = Math.random();\n return `${this.sourceId}${this.sourceId.indexOf('?') > -1 ? '&' : '?'}_=${urlSuffix}`;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Source } from './source';\nimport { Facebook } from './facebook';\nimport { Custom } from './custom';\nimport { Initials } from './initials';\nimport { Gravatar } from './gravatar';\nimport { Value } from './value';\nimport { Github } from './github';\nimport { SourceCreator } from './source.creator';\nimport { AvatarSource } from './avatar-source.enum';\nimport { AvatarConfigService } from '../avatar-config.service';\nimport { defaultDisableSrcCache } from '../avatar.service';\nimport { CustomNoCache } from './custom-no-cache';\n\n/**\n * Factory class that implements factory method pattern.\n * Used to create Source implementation class based\n * on the source Type\n */\n@Injectable({providedIn: 'root'})\nexport class SourceFactory {\n private sources: { [key: string]: SourceCreator } = {};\n\n constructor(avatarConfigService: AvatarConfigService) {\n const disableSrcCache = avatarConfigService.getDisableSrcCache(defaultDisableSrcCache);\n this.sources[AvatarSource.FACEBOOK] = Facebook;\n this.sources[AvatarSource.GRAVATAR] = Gravatar;\n this.sources[AvatarSource.CUSTOM] = disableSrcCache ? CustomNoCache : Custom;\n this.sources[AvatarSource.INITIALS] = Initials;\n this.sources[AvatarSource.VALUE] = Value;\n this.sources[AvatarSource.GITHUB] = Github;\n }\n\n public newInstance(sourceType: AvatarSource, sourceValue: string): Source {\n return new this.sources[sourceType](sourceValue);\n }\n}\n","import { AfterContentInit, Component, ElementRef, OnChanges, OnDestroy, SecurityContext, SimpleChanges, ViewChild, computed, input, output } from '@angular/core';\n\nimport { DomSanitizer, SafeUrl } from '@angular/platform-browser';\nimport { map, takeWhile } from 'rxjs/operators';\nimport { AvatarService } from './avatar.service';\nimport { AsyncSource } from './sources/async-source';\nimport { AvatarSource } from './sources/avatar-source.enum';\nimport { Source } from './sources/source';\nimport { SourceFactory } from './sources/source.factory';\n\ntype StyleObject = Record<string, string | number | null | undefined>;\ntype Style = StyleObject | string;\n\n/**\n * Semantic colours for the avatar badge and the avatar colour variants. Each maps\n * to a design-system `--hub-sys-color-*` token. Use them to colour a presence dot\n * (e.g. `success` = online, `warning` = away, `danger` = busy, `secondary` = offline)\n * or a labelled badge. Any custom string is also accepted (set `--hub-avatar-badge-color`).\n */\nexport type HubAvatarBadgeColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';\n\n/**\n * Universal avatar component that\n * generates avatar from different sources\n *\n * export\n * class AvatarComponent\n * implements {OnChanges}\n */\n\n@Component({\n\t// tslint:disable-next-line:component-selector\n\tselector: 'hub-avatar',\n\tstandalone: false,\n\tstyleUrl: './avatar.component.scss',\n\ttemplate: `\n\t\t<div (click)=\"onAvatarClicked()\" class=\"avatar-container\" [class.hub-avatar--custom]=\"hasCustomContent\" [style]=\"hostStyle\">\n\t\t\t<span #customContent class=\"hub-avatar__custom\" [style]=\"customContentStyle\"><ng-content></ng-content></span>\n\t\t\t@if (!hasCustomContent) {\n\t\t\t\t@if (avatarSrc) {\n\t\t\t\t\t<img\n\t\t\t\t\t\t[src]=\"avatarSrc\"\n\t\t\t\t\t\t[alt]=\"customAlt() ? customAlt() : avatarAlt\"\n\t\t\t\t\t\t[width]=\"size()\"\n\t\t\t\t\t\t[height]=\"size()\"\n\t\t\t\t\t\t[style]=\"avatarStyle\"\n\t\t\t\t\t\t[referrerPolicy]=\"referrerpolicy()\"\n\t\t\t\t\t\t(error)=\"fetchAvatarSource()\"\n\t\t\t\t\t\tclass=\"avatar-content\"\n\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t/>\n\t\t\t\t} @else {\n\t\t\t\t\t@if (avatarText) {\n\t\t\t\t\t\t<div class=\"avatar-content\" [style]=\"avatarStyle\">\n\t\t\t\t\t\t\t{{ avatarText }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t</div>\n\t\t@if (_hasBadge()) {\n\t\t\t<span\n\t\t\t\tclass=\"hub-avatar__badge\"\n\t\t\t\t[class.hub-avatar__badge--dot]=\"_isDot()\"\n\t\t\t\t[class.hub-avatar__badge--label]=\"!_isDot()\"\n\t\t\t\t[attr.aria-hidden]=\"_isDot() ? 'true' : null\"\n\t\t\t\t>{{ _badgeText() }}</span\n\t\t\t>\n\t\t}\n\t`,\n\thost: {\n\t\t'[attr.data-badge-color]': 'badgeColor() || null',\n\t\t'[style.--hub-avatar-size]': 'avatarSizePx'\n\t}\n})\nexport class AvatarComponent implements AfterContentInit, OnChanges, OnDestroy {\n\treadonly round = input(true);\n\treadonly size = input<string | number>(50);\n\treadonly textSizeRatio = input(3);\n\treadonly bgColor = input<string>();\n\treadonly fgColor = input('#FFF');\n\treadonly borderColor = input<string>();\n\treadonly style = input<Style>({});\n\treadonly cornerRadius = input<string | number>(0);\n\treadonly facebook = input<string | null>(undefined, { alias: 'facebookId' });\n\treadonly gravatar = input<string | null>(undefined, { alias: 'gravatarId' });\n\treadonly github = input<string | null>(undefined, { alias: 'githubId' });\n\treadonly custom = input<string | SafeUrl | null>(undefined, { alias: 'src' });\n\treadonly customAlt = input<string | null>(undefined, { alias: 'alt' });\n\treadonly initials = input<string | null>(undefined, { alias: 'name' });\n\treadonly value = input<string | null>();\n\treadonly referrerpolicy = input<string | null>();\n\treadonly placeholder = input<string>();\n\treadonly initialsSize = input<string | number>(0);\n\t/**\n\t * Overlay badge at the bottom-end corner. A boolean / empty value renders a plain\n\t * dot (great for a presence indicator); a string or number renders a labelled badge\n\t * (e.g. a count like `\"4k\"`). `null` / absent (default) renders nothing.\n\t *\n\t * @example <hub-avatar badge badgeColor=\"success\" /> // dot\n\t * @example <hub-avatar badge=\"4k\" badgeColor=\"danger\" /> // labelled\n\t */\n\treadonly badge = input<string | number | boolean | null>(null);\n\n\t/**\n\t * Semantic colour of the {@link badge} (and, as a host class, of the avatar itself).\n\t * Maps to a `--hub-sys-color-*` token; any custom string also works (set\n\t * `--hub-avatar-badge-color`). When unset the badge uses a neutral default.\n\t */\n\treadonly badgeColor = input<HubAvatarBadgeColor | (string & {}) | null>(null);\n\n\t/** True when a badge should be rendered (the `badge` input is set to anything but `null` / `false`). */\n\tprotected readonly _hasBadge = computed(() => {\n\t\tconst b = this.badge();\n\t\treturn b !== null && b !== undefined && b !== false;\n\t});\n\n\t/** The badge's text content; empty for a plain dot (`badge` is `true` or an empty string). */\n\tprotected readonly _badgeText = computed(() => {\n\t\tconst b = this.badge();\n\t\tif (b === true || b === '' || b === null || b === undefined || b === false) {\n\t\t\treturn '';\n\t\t}\n\t\treturn String(b);\n\t});\n\n\t/** True when the badge is a plain dot (shown, but with no text content). */\n\tprotected readonly _isDot = computed(() => this._hasBadge() && this._badgeText() === '');\n\n\treadonly clickOnAvatar = output<Source>();\n\n\t/** Wrapper around the projected content (`<ng-content>`), used to detect whether the consumer projected anything. */\n\t@ViewChild('customContent', { static: true }) private customContentRef?: ElementRef<HTMLElement>;\n\n\t/** True when the consumer projected custom content (an icon, SVG, image, …) into the avatar. */\n\thasCustomContent = false;\n\n\t/** Inline style applied to the projected-content slot (honours `bgColor` / `fgColor` / `borderColor` / `style`). */\n\tcustomContentStyle: StyleObject = {};\n\n\tisAlive = true;\n\tavatarSrc: SafeUrl | null = null;\n\tavatarAlt: SafeUrl | null = null;\n\tavatarText: string | null = null;\n\tavatarStyle: StyleObject = {};\n\thostStyle: StyleObject = {};\n\n\tprivate currentIndex = -1;\n\tprivate sources: Source[] = [];\n\n\tconstructor(\n\t\tprivate sourceFactory: SourceFactory,\n\t\tprivate avatarService: AvatarService,\n\t\tprivate sanitizer: DomSanitizer\n\t) {}\n\n\tonAvatarClicked(): void {\n\t\tthis.clickOnAvatar.emit(this.sources[this.currentIndex]);\n\t}\n\n\t/**\n\t * Detects projected content once it is available and, when present, computes its style.\n\t * Runs after content init so `<ng-content>` nodes are already in place.\n\t */\n\tngAfterContentInit(): void {\n\t\tconst host = this.customContentRef?.nativeElement;\n\t\tthis.hasCustomContent = !!host && this.hasMeaningfulProjectedContent(host);\n\t\tif (this.hasCustomContent) {\n\t\t\tthis.customContentStyle = this.getCustomContentStyle();\n\t\t}\n\t}\n\n\t/**\n\t * Returns true when the projected slot holds a real element or non-whitespace text,\n\t * so whitespace-only projection does not flip the avatar into custom-content mode.\n\t *\n\t * @param host The element wrapping the projected content.\n\t */\n\tprivate hasMeaningfulProjectedContent(host: HTMLElement): boolean {\n\t\treturn Array.from(host.childNodes).some(\n\t\t\t(node) =>\n\t\t\t\tnode.nodeType === Node.ELEMENT_NODE ||\n\t\t\t\t(node.nodeType === Node.TEXT_NODE && (node.textContent ?? '').trim().length > 0)\n\t\t);\n\t}\n\n\t/**\n\t * Builds the inline style for the projected-content slot. Sensible visible defaults\n\t * (a themed background circle and a readable foreground colour) come from CSS tokens;\n\t * the `bgColor` / `fgColor` / `borderColor` / `style` inputs override them when set.\n\t */\n\tprivate getCustomContentStyle(): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst bgColor = this.bgColor();\n\t\tconst hasCustomFgColor = this.fgColor() !== '#FFF';\n\t\treturn {\n\t\t\tbackgroundColor: bgColor ? bgColor : undefined,\n\t\t\tcolor: hasCustomFgColor ? this.fgColor() : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\t/**\n\t * The avatar size as a px string. Exposed on the host as `--hub-avatar-size`\n\t * so the status dot (and any token-driven child) scales with the avatar.\n\t */\n\tget avatarSizePx(): string {\n\t\treturn (parseFloat(String(this.size())) || 50) + 'px';\n\t}\n\n\t/**\n\t * Detect inputs change\n\t *\n\t * param {{ [propKey: string]: SimpleChange }} changes\n\t *\n\t * memberof AvatarComponent\n\t */\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tfor (const propName in changes) {\n\t\t\tif (this.avatarService.isSource(propName)) {\n\t\t\t\tconst sourceType: AvatarSource = AvatarSource[propName.toUpperCase() as keyof typeof AvatarSource];\n\t\t\t\tconst currentValue = changes[propName].currentValue;\n\t\t\t\tif (currentValue && typeof currentValue === 'string') {\n\t\t\t\t\tthis.addSource(sourceType, currentValue);\n\t\t\t\t} else {\n\t\t\t\t\tconst sanitized = this.sanitizer.sanitize(SecurityContext.URL, currentValue);\n\t\t\t\t\tif (sanitized) {\n\t\t\t\t\t\tthis.addSource(sourceType, sanitized);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.removeSource(sourceType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Reinitialize when any source input changes so fallback order is recalculated.\n\t\tthis.initializeAvatar();\n\t\tif (this.hasCustomContent) {\n\t\t\tthis.customContentStyle = this.getCustomContentStyle();\n\t\t}\n\t}\n\n\t/**\n\t * Fetch avatar source\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tfetchAvatarSource(): void {\n\t\tconst previousSource = this.sources[this.currentIndex];\n\t\tif (previousSource) {\n\t\t\tthis.avatarService.markSourceAsFailed(previousSource);\n\t\t}\n\n\t\tconst source = this.findNextSource();\n\t\tif (!source) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.avatarService.isTextAvatar(source.sourceType)) {\n\t\t\tthis.buildTextAvatar(source);\n\t\t\tthis.avatarSrc = null;\n\t\t} else {\n\t\t\tthis.buildImageAvatar(source);\n\t\t}\n\t}\n\n\tprivate findNextSource(): Source | null {\n\t\twhile (++this.currentIndex < this.sources.length) {\n\t\t\tconst source = this.sources[this.currentIndex];\n\t\t\tif (source && !this.avatarService.sourceHasFailedBefore(source)) {\n\t\t\t\treturn source;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.isAlive = false;\n\t}\n\n\t/**\n\t * Initialize the avatar component and its fallback system\n\t */\n\tprivate initializeAvatar(): void {\n\t\tconst computedBorderRadius = this.round()\n\t\t\t? '50%'\n\t\t\t: this.cornerRadius() + 'px';\n\t\tthis.hostStyle = {\n\t\t\twidth: this.size() + 'px',\n\t\t\theight: this.size() + 'px',\n\t\t\tborderRadius: computedBorderRadius\n\t\t};\n\n\t\tthis.currentIndex = -1;\n\t\tif (this.sources.length > 0) {\n\t\t\tthis.sortAvatarSources();\n\t\t\tthis.fetchAvatarSource();\n\t\t}\n\t}\n\n\tprivate sortAvatarSources(): void {\n\t\tthis.sources.sort((source1: Source, source2: Source) =>\n\t\t\tthis.avatarService.compareSources(source1.sourceType, source2.sourceType)\n\t\t);\n\t}\n\n\tprivate buildTextAvatar(avatarSource: Source): void {\n\t\tthis.avatarText = avatarSource.getAvatar(+this.initialsSize());\n\t\tthis.avatarStyle = this.getInitialsStyle(avatarSource.sourceId);\n\t}\n\n\tprivate buildImageAvatar(avatarSource: Source): void {\n\t\tthis.avatarStyle = this.getImageStyle();\n\t\tif (avatarSource instanceof AsyncSource) {\n\t\t\tthis.fetchAndProcessAsyncAvatar(avatarSource);\n\t\t} else {\n\t\t\tthis.avatarSrc = this.sanitizer.bypassSecurityTrustUrl(avatarSource.getAvatar(+this.size()));\n\t\t\tthis.avatarAlt = avatarSource.getAvatar(+this.size());\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * returns initials style\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tprivate getInitialsStyle(avatarValue: string): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst bgColor = this.bgColor();\n\t\tconst hasCornerRadius = !this.round() || +this.cornerRadius() > 0;\n\t\tconst hasCustomFgColor = this.fgColor() !== '#FFF';\n\t\treturn {\n\t\t\ttextAlign: 'center',\n\t\t\tborderRadius: hasCornerRadius ? (this.round() ? '100%' : this.cornerRadius() + 'px') : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\ttextTransform: 'uppercase',\n\t\t\tcolor: hasCustomFgColor ? this.fgColor() : undefined,\n\t\t\tbackgroundColor: bgColor ? bgColor : this.avatarService.getRandomColor(avatarValue),\n\t\t\tfont: Math.floor(+this.size() / this.textSizeRatio()) + 'px Helvetica, Arial, sans-serif',\n\t\t\tlineHeight: this.size() + 'px',\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\t/**\n\t *\n\t * returns image style\n\t *\n\t * memberOf AvatarComponent\n\t */\n\tprivate getImageStyle(): StyleObject {\n\t\tconst borderColor = this.borderColor();\n\t\tconst hasCornerRadius = !this.round() || +this.cornerRadius() > 0;\n\t\treturn {\n\t\t\tmaxWidth: '100%',\n\t\t\tborderRadius: hasCornerRadius ? (this.round() ? '50%' : this.cornerRadius() + 'px') : undefined,\n\t\t\tborder: borderColor ? '1px solid ' + borderColor : undefined,\n\t\t\twidth: this.size() + 'px',\n\t\t\theight: this.size() + 'px',\n\t\t\t...this.getCustomStyleObject()\n\t\t};\n\t}\n\n\tprivate getCustomStyleObject(): StyleObject {\n\t\tconst customStyle = this.style();\n\t\tif (!customStyle) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (typeof customStyle === 'string') {\n\t\t\treturn this.parseInlineStyleString(customStyle);\n\t\t}\n\n\t\treturn customStyle;\n\t}\n\n\tprivate parseInlineStyleString(styleString: string): StyleObject {\n\t\tconst styleObject: StyleObject = {};\n\t\tstyleString\n\t\t\t.split(';')\n\t\t\t.map((declaration) => declaration.trim())\n\t\t\t.filter((declaration) => declaration.length > 0)\n\t\t\t.forEach((declaration) => {\n\t\t\t\tconst separatorIndex = declaration.indexOf(':');\n\t\t\t\tif (separatorIndex <= 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst property = declaration.slice(0, separatorIndex).trim();\n\t\t\t\tconst value = declaration.slice(separatorIndex + 1).trim();\n\t\t\t\tif (property && value) {\n\t\t\t\t\tstyleObject[property] = value;\n\t\t\t\t}\n\t\t\t});\n\t\treturn styleObject;\n\t}\n\n\t/**\n\t * Fetch avatar image asynchronously.\n\t *\n\t * param {Source} source represents avatar source\n\t * memberof AvatarComponent\n\t */\n\tprivate fetchAndProcessAsyncAvatar(source: AsyncSource): void {\n\t\tif (this.avatarService.sourceHasFailedBefore(source)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.avatarService\n\t\t\t.fetchAvatar(source.getAvatar(+this.size()))\n\t\t\t.pipe(\n\t\t\t\ttakeWhile(() => this.isAlive),\n\t\t\t\tmap((response) => source.processResponse(response, +this.size()))\n\t\t\t)\n\t\t\t.subscribe({\n\t\t\t\tnext: (avatarSrc) => (this.avatarSrc = avatarSrc),\n\t\t\t\terror: () => {\n\t\t\t\t\tthis.fetchAvatarSource();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Add avatar source\n\t *\n\t * param sourceType avatar source type e.g facebook,twitter, etc.\n\t * param sourceValue source value e.g facebookId value, etc.\n\t */\n\tprivate addSource(sourceType: AvatarSource, sourceValue: string): void {\n\t\tconst source = this.sources.find((s) => s.sourceType === sourceType);\n\t\tif (source) {\n\t\t\tsource.sourceId = sourceValue;\n\t\t} else {\n\t\t\tthis.sources.push(this.sourceFactory.newInstance(sourceType, sourceValue));\n\t\t}\n\t}\n\n\t/**\n\t * Remove avatar source\n\t *\n\t * param sourceType avatar source type e.g facebook,twitter, etc.\n\t */\n\tprivate removeSource(sourceType: AvatarSource): void {\n\t\tthis.sources = this.sources.filter((source) => source.sourceType !== sourceType);\n\t}\n}\n","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { AvatarConfig } from './avatar-config';\nimport { AvatarConfigService } from './avatar-config.service';\nimport { AVATAR_CONFIG } from './avatar-config.token';\nimport { AvatarComponent } from './avatar.component';\nimport { AvatarService } from './avatar.service';\nimport { SourceFactory } from './sources/source.factory';\n\n@NgModule({\n\timports: [CommonModule],\n\tdeclarations: [AvatarComponent],\n\tproviders: [SourceFactory, AvatarService, AvatarConfigService],\n\texports: [AvatarComponent]\n})\nexport class AvatarModule {\n\tstatic forRoot(\n\t\tavatarConfig?: AvatarConfig\n\t): ModuleWithProviders<AvatarModule> {\n\t\treturn {\n\t\t\tngModule: AvatarModule,\n\t\t\tproviders: [\n\t\t\t\t{\n\t\t\t\t\tprovide: AVATAR_CONFIG,\n\t\t\t\t\tuseValue: avatarConfig ? avatarConfig : {}\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\t}\n}\n","/*\n * Public API Surface of ng-hub-ui-avatar\n */\nexport * from './lib/avatar-config';\nexport * from './lib/avatar.component';\nexport * from './lib/avatar.module';\nexport * from './lib/avatar.service';\nexport * from './lib/sources/avatar-source.enum';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i2.AvatarConfigService","i1.AvatarConfigService","i1.SourceFactory","i2.AvatarService"],"mappings":";;;;;;;;AAGA;;AAEG;AACI,MAAM,aAAa,GAAG,IAAI,cAAc,CAAe,eAAe,CAAC;;MCCjE,mBAAmB,CAAA;AAIvB,IAAA,UAAA;AAHR,IAAA,WAAA,CAGQ,UAAwB,EAAA;QAAxB,IAAA,CAAA,UAAU,GAAV,UAAU;IACf;AAEI,IAAA,gBAAgB,CAAC,cAA8B,EAAA;QACrD,IACC,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,UAAU,CAAC,mBAAmB;AACnC,YAAA,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,MAAM,EACzC;AACD,YAAA,MAAM,aAAa,GAAG;gBACrB,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB;aAC9C;AACD,YAAA,MAAM,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,MAAM,KAChD,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAC/B;YACD,OAAO;AACN,gBAAA,GAAG,YAAY;AACf,gBAAA,GAAG,cAAc,CAAC,MAAM,CACvB,CAAC,MAAM,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;aAE3C;QACF;AACA,QAAA,OAAO,cAAc;IACtB;AAEO,IAAA,eAAe,CAAC,aAAuB,EAAA;AAC7C,QAAA,QACC,CAAC,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,UAAU,CAAC,MAAM;AACtB,YAAA,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM;AAC7B,YAAA,IAAI,CAAC,UAAU,CAAC,MAAM;AACvB,YAAA,aAAa;IAEf;AAEO,IAAA,kBAAkB,CAAC,s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,eAAe,CAAA,EAAA,CAAA;wGAEb,YAAY,EAAA,SAAA,EAHb,CAAC,aAAa,EAAE,aAAa,EAAE,mBAAmB,CAAC,EAAA,OAAA,EAAA,CAFpD,YAAY,CAAA,EAAA,CAAA;;2FAKV,YAAY,EAAA,UAAA,EAAA,CAAA;kBANxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,CAAC,eAAe,CAAC;AAC/B,oBAAA,SAAS,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,mBAAmB,CAAC;oBAC9D,OAAO,EAAE,CAAC,eAAe;AACzB,iBAAA;;;ACfD;;AAEG;;ACFH;;AAEG;;;;"}
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ng-hub-ui-avatar",
3
3
  "description": "A universal avatar component for Angular applications that fetches / generates avatar based on the information you have about the user. Supports initials, Gravatar integration, custom images and styling options. Perfect for user profiles and comment systems.",
4
- "version": "22.2.0",
4
+ "version": "22.4.0",
5
5
  "keywords": [
6
6
  "angular",
7
7
  "avatar",
@@ -27,10 +27,11 @@
27
27
  },
28
28
  "sideEffects": false,
29
29
  "peerDependencies": {
30
- "@angular/common": ">=16.0.0",
31
- "@angular/core": ">=16.0.0"
30
+ "@angular/common": ">=18.0.0",
31
+ "@angular/core": ">=18.0.0"
32
32
  },
33
- "allowedNonPeerDependencies": {
33
+ "dependencies": {
34
+ "tslib": "^2.6.3",
34
35
  "ts-md5": "^1.3.1"
35
36
  },
36
37
  "homepage": "https://hubui.dev/",
@@ -45,8 +46,5 @@
45
46
  "default": "./fesm2022/ng-hub-ui-avatar.mjs"
46
47
  }
47
48
  },
48
- "type": "module",
49
- "dependencies": {
50
- "tslib": "^2.6.3"
51
- }
49
+ "type": "module"
52
50
  }
@@ -1,27 +1,75 @@
1
1
  // ─────────────────────────────────────────────────────────────────────────
2
- // hub-avatar-themeone-call theming for `<hub-avatar>`
2
+ // ng-hub-ui-avatar — consumer SCSS helpers
3
3
  // ─────────────────────────────────────────────────────────────────────────
4
4
  //
5
- // Override any of the `--hub-avatar-*` design tokens in a single include. Every
6
- // parameter is OPTIONAL and defaults to `null`: only the parameters you pass
7
- // are emitted, so the rest keep the component's defaults. Token-based and
8
- // self-contained (no Bootstrap dependencies).
5
+ // @use 'ng-hub-ui-avatar/styles/mixins/avatar-theme' as avatar;
9
6
  //
10
- // The built-in presence statuses (online / away / busy / offline) keep their
11
- // semantic colours automatically; use `$status-*` here to resize / reposition
12
- // the dot or to colour a custom status.
7
+ // hub-avatar-theme() — override any --hub-avatar-* token in one call
8
+ // hub-avatar-color-variants() emit avatar + badge colour variants in a loop
9
+ // hub-avatar-badge-color() — set the badge colour from a single value
10
+ //
11
+ // Token-based and self-contained (no Bootstrap dependency).
12
+
13
+ // Default semantic colour map → design-system `--hub-sys-color-*` tokens.
14
+ // Pass your own map (or extend this one) to `hub-avatar-color-variants()`.
15
+ // Mirrors the open accent set (9 canonical variants); each entry feeds the
16
+ // avatar's `--hub-avatar-accent` slot, so the circle fill and its legible
17
+ // foreground (`-on`) follow automatically. Add custom colours (e.g. `brand`) to
18
+ // this map — or pass your own map — and they work the same way.
19
+ $hub-avatar-semantic-colors: (
20
+ 'primary': var(--hub-sys-color-primary),
21
+ 'secondary': var(--hub-sys-color-secondary),
22
+ 'success': var(--hub-sys-color-success),
23
+ 'danger': var(--hub-sys-color-danger),
24
+ 'warning': var(--hub-sys-color-warning),
25
+ 'info': var(--hub-sys-color-info),
26
+ 'neutral': var(--hub-sys-color-neutral),
27
+ 'light': var(--hub-sys-color-light),
28
+ 'dark': var(--hub-sys-color-dark)
29
+ ) !default;
30
+
31
+ // ── hub-avatar-color-variants ────────────────────────────────────────────────
32
+ // In ONE loop over `$colors`, emit a coloured-circle variant of the AVATAR and a
33
+ // coloured variant of its BADGE for every entry. The avatar circle re-bases the
34
+ // single `--hub-avatar-accent` slot (not `--hub-avatar-bg-color` directly), so
35
+ // the fill and its legible foreground (`--hub-avatar-accent-on`) follow from one
36
+ // value — light accents get dark text automatically. The nine canonical colours
37
+ // already work out of the box; use this to (re)emit them in your own global CSS,
38
+ // or to register custom colours.
13
39
  //
14
40
  // @example
41
+ // @include avatar.hub-avatar-color-variants(); // the 9 semantic
42
+ // @include avatar.hub-avatar-color-variants(('brand': var(--brand))); // custom colour
15
43
  //
16
- // @use 'ng-hub-ui-avatar/styles/mixins/avatar-theme' as *;
44
+ // <hub-avatar class="hub-avatar--brand"> → brand-coloured circle
45
+ // <hub-avatar badge badgeColor="brand"> → brand-coloured badge
46
+ @mixin hub-avatar-color-variants($colors: $hub-avatar-semantic-colors) {
47
+ @each $name, $color in $colors {
48
+ hub-avatar.hub-avatar--#{$name} {
49
+ --hub-avatar-accent: #{$color};
50
+ }
51
+
52
+ hub-avatar[data-badge-color='#{$name}'] {
53
+ --hub-avatar-badge-color: #{$color};
54
+ }
55
+ }
56
+ }
57
+
58
+ // ── hub-avatar-badge-color ───────────────────────────────────────────────────
59
+ // Set the badge colour from a single value (a token or a literal).
60
+ @mixin hub-avatar-badge-color($color) {
61
+ --hub-avatar-badge-color: #{$color};
62
+ }
63
+
64
+ // ── hub-avatar-theme ─────────────────────────────────────────────────────────
65
+ // Override any of the `--hub-avatar-*` design tokens in a single include. Every
66
+ // parameter is OPTIONAL and defaults to `null`: only the parameters you pass are
67
+ // emitted, so the rest keep the component's defaults.
17
68
  //
69
+ // @example
18
70
  // hub-avatar.brand {
19
- // @include hub-avatar-theme(
20
- // $size: 64px,
21
- // $border-radius: 1rem,
22
- // $bg: #ede9fe,
23
- // $fg: #5b21b6,
24
- // $status-ring-color: #ede9fe
71
+ // @include avatar.hub-avatar-theme(
72
+ // $size: 64px, $bg: #ede9fe, $fg: #5b21b6, $badge-color: #f43f5e
25
73
  // );
26
74
  // }
27
75
  //
@@ -40,12 +88,18 @@
40
88
  $font-weight: null,
41
89
  $font-size: null,
42
90
  $text-transform: null,
43
- // ── Presence status dot ──
44
- $status-size: null,
45
- $status-offset: null,
46
- $status-ring-width: null,
47
- $status-ring-color: null,
48
- $status-color: null,
91
+ // ── Projected custom content ──
92
+ $content-padding: null,
93
+ $content-icon-size: null,
94
+ // ── Corner badge (dot / labelled) ──
95
+ $badge-size: null,
96
+ $badge-offset: null,
97
+ $badge-ring-width: null,
98
+ $badge-ring-color: null,
99
+ $badge-color: null,
100
+ $badge-text-color: null,
101
+ $badge-font-size: null,
102
+ $badge-padding: null,
49
103
  // ── Stacked group ──
50
104
  $group-overlap: null,
51
105
  $group-ring-width: null,
@@ -88,21 +142,38 @@
88
142
  --hub-avatar-text-transform: #{$text-transform};
89
143
  }
90
144
 
91
- // Presence status dot
92
- @if $status-size != null {
93
- --hub-avatar-status-size: #{$status-size};
145
+ // Projected custom content
146
+ @if $content-padding != null {
147
+ --hub-avatar-content-padding: #{$content-padding};
148
+ }
149
+ @if $content-icon-size != null {
150
+ --hub-avatar-content-icon-size: #{$content-icon-size};
151
+ }
152
+
153
+ // Corner badge
154
+ @if $badge-size != null {
155
+ --hub-avatar-badge-size: #{$badge-size};
156
+ }
157
+ @if $badge-offset != null {
158
+ --hub-avatar-badge-offset: #{$badge-offset};
159
+ }
160
+ @if $badge-ring-width != null {
161
+ --hub-avatar-badge-ring-width: #{$badge-ring-width};
162
+ }
163
+ @if $badge-ring-color != null {
164
+ --hub-avatar-badge-ring-color: #{$badge-ring-color};
94
165
  }
95
- @if $status-offset != null {
96
- --hub-avatar-status-offset: #{$status-offset};
166
+ @if $badge-color != null {
167
+ --hub-avatar-badge-color: #{$badge-color};
97
168
  }
98
- @if $status-ring-width != null {
99
- --hub-avatar-status-ring-width: #{$status-ring-width};
169
+ @if $badge-text-color != null {
170
+ --hub-avatar-badge-text-color: #{$badge-text-color};
100
171
  }
101
- @if $status-ring-color != null {
102
- --hub-avatar-status-ring-color: #{$status-ring-color};
172
+ @if $badge-font-size != null {
173
+ --hub-avatar-badge-font-size: #{$badge-font-size};
103
174
  }
104
- @if $status-color != null {
105
- --hub-avatar-status-color: #{$status-color};
175
+ @if $badge-padding != null {
176
+ --hub-avatar-badge-padding: #{$badge-padding};
106
177
  }
107
178
 
108
179
  // Stacked group
@@ -117,10 +117,12 @@ declare class SourceFactory {
117
117
  type StyleObject = Record<string, string | number | null | undefined>;
118
118
  type Style = StyleObject | string;
119
119
  /**
120
- * Built-in semantic presence statuses for the avatar indicator dot.
121
- * `online` success · `away` warning · `busy` danger · `offline` → neutral.
120
+ * Semantic colours for the avatar badge and the avatar colour variants. Each maps
121
+ * to a design-system `--hub-sys-color-*` token. Use them to colour a presence dot
122
+ * (e.g. `success` = online, `warning` = away, `danger` = busy, `secondary` = offline)
123
+ * or a labelled badge. Any custom string is also accepted (set `--hub-avatar-badge-color`).
122
124
  */
123
- type HubAvatarStatus = 'online' | 'away' | 'busy' | 'offline';
125
+ type HubAvatarBadgeColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
124
126
  /**
125
127
  * Universal avatar component that
126
128
  * generates avatar from different sources
@@ -152,12 +154,26 @@ declare class AvatarComponent implements AfterContentInit, OnChanges, OnDestroy
152
154
  readonly placeholder: _angular_core.InputSignal<string | undefined>;
153
155
  readonly initialsSize: _angular_core.InputSignal<string | number>;
154
156
  /**
155
- * Semantic presence indicator shown as a small dot at the bottom-end corner.
156
- * Built-ins: `online` (success) · `away` (warning) · `busy` (danger) · `offline`
157
- * (neutral). Any custom string is accepted set `--hub-avatar-status-color`
158
- * to colour it. When unset (default) no dot is rendered.
157
+ * Overlay badge at the bottom-end corner. A boolean / empty value renders a plain
158
+ * dot (great for a presence indicator); a string or number renders a labelled badge
159
+ * (e.g. a count like `"4k"`). `null` / absent (default) renders nothing.
160
+ *
161
+ * @example <hub-avatar badge badgeColor="success" /> // dot
162
+ * @example <hub-avatar badge="4k" badgeColor="danger" /> // labelled
163
+ */
164
+ readonly badge: _angular_core.InputSignal<string | number | boolean | null>;
165
+ /**
166
+ * Semantic colour of the {@link badge} (and, as a host class, of the avatar itself).
167
+ * Maps to a `--hub-sys-color-*` token; any custom string also works (set
168
+ * `--hub-avatar-badge-color`). When unset the badge uses a neutral default.
159
169
  */
160
- readonly status: _angular_core.InputSignal<HubAvatarStatus | (string & {}) | null>;
170
+ readonly badgeColor: _angular_core.InputSignal<HubAvatarBadgeColor | (string & {}) | null>;
171
+ /** True when a badge should be rendered (the `badge` input is set to anything but `null` / `false`). */
172
+ protected readonly _hasBadge: _angular_core.Signal<boolean>;
173
+ /** The badge's text content; empty for a plain dot (`badge` is `true` or an empty string). */
174
+ protected readonly _badgeText: _angular_core.Signal<string>;
175
+ /** True when the badge is a plain dot (shown, but with no text content). */
176
+ protected readonly _isDot: _angular_core.Signal<boolean>;
161
177
  readonly clickOnAvatar: _angular_core.OutputEmitterRef<Source>;
162
178
  /** Wrapper around the projected content (`<ng-content>`), used to detect whether the consumer projected anything. */
163
179
  private customContentRef?;
@@ -258,7 +274,7 @@ declare class AvatarComponent implements AfterContentInit, OnChanges, OnDestroy
258
274
  */
259
275
  private removeSource;
260
276
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AvatarComponent, never>;
261
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AvatarComponent, "hub-avatar", never, { "round": { "alias": "round"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "textSizeRatio": { "alias": "textSizeRatio"; "required": false; "isSignal": true; }; "bgColor": { "alias": "bgColor"; "required": false; "isSignal": true; }; "fgColor": { "alias": "fgColor"; "required": false; "isSignal": true; }; "borderColor": { "alias": "borderColor"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "cornerRadius": { "alias": "cornerRadius"; "required": false; "isSignal": true; }; "facebook": { "alias": "facebookId"; "required": false; "isSignal": true; }; "gravatar": { "alias": "gravatarId"; "required": false; "isSignal": true; }; "github": { "alias": "githubId"; "required": false; "isSignal": true; }; "custom": { "alias": "src"; "required": false; "isSignal": true; }; "customAlt": { "alias": "alt"; "required": false; "isSignal": true; }; "initials": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "referrerpolicy": { "alias": "referrerpolicy"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "initialsSize": { "alias": "initialsSize"; "required": false; "isSignal": true; }; "status": { "alias": "status"; "required": false; "isSignal": true; }; }, { "clickOnAvatar": "clickOnAvatar"; }, never, ["*"], false, never>;
277
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AvatarComponent, "hub-avatar", never, { "round": { "alias": "round"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "textSizeRatio": { "alias": "textSizeRatio"; "required": false; "isSignal": true; }; "bgColor": { "alias": "bgColor"; "required": false; "isSignal": true; }; "fgColor": { "alias": "fgColor"; "required": false; "isSignal": true; }; "borderColor": { "alias": "borderColor"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "cornerRadius": { "alias": "cornerRadius"; "required": false; "isSignal": true; }; "facebook": { "alias": "facebookId"; "required": false; "isSignal": true; }; "gravatar": { "alias": "gravatarId"; "required": false; "isSignal": true; }; "github": { "alias": "githubId"; "required": false; "isSignal": true; }; "custom": { "alias": "src"; "required": false; "isSignal": true; }; "customAlt": { "alias": "alt"; "required": false; "isSignal": true; }; "initials": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "referrerpolicy": { "alias": "referrerpolicy"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "initialsSize": { "alias": "initialsSize"; "required": false; "isSignal": true; }; "badge": { "alias": "badge"; "required": false; "isSignal": true; }; "badgeColor": { "alias": "badgeColor"; "required": false; "isSignal": true; }; }, { "clickOnAvatar": "clickOnAvatar"; }, never, ["*"], false, never>;
262
278
  }
263
279
 
264
280
  declare class AvatarModule {
@@ -269,4 +285,4 @@ declare class AvatarModule {
269
285
  }
270
286
 
271
287
  export { AvatarComponent, AvatarModule, AvatarService, AvatarSource, defaultColors, defaultDisableSrcCache, defaultSources };
272
- export type { AvatarConfig, HubAvatarStatus };
288
+ export type { AvatarConfig, HubAvatarBadgeColor };
Binary file
Binary file