ng-hub-ui-avatar 22.9.0 → 22.9.2

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Carlos Morcillo
3
+ Copyright (c) 2026 Carlos Morcillo Fernández
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -17,5 +17,5 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALING IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -12,11 +12,11 @@ A universal avatar component for Angular applications that renders avatars from
12
12
 
13
13
  ## Documentation and Live Examples
14
14
 
15
- This package is part of [Hub UI](https://hubui.dev/), a collection of Angular component libraries for standalone apps.
15
+ This package is part of [Hub UI](https://hubui.dev/en/), a collection of Angular component libraries for standalone apps.
16
16
 
17
- - Docs: https://hubui.dev/avatar/overview/
18
- - Live examples: https://hubui.dev/avatar/examples/
19
- - Hub UI: https://hubui.dev/
17
+ - Docs: https://hubui.dev/en/avatar/overview/
18
+ - Live examples: https://hubui.dev/en/avatar/examples/
19
+ - Hub UI: https://hubui.dev/en/
20
20
 
21
21
  ## 🧩 Library Family `ng-hub-ui`
22
22
 
@@ -72,6 +72,15 @@ Supported avatar sources:
72
72
  - Initials (`name`)
73
73
  - Text value (`value`)
74
74
 
75
+ > **These three sources contact a third party.** `secure.gravatar.com`, `api.github.com` and
76
+ > `graph.facebook.com` are reached from the visitor's browser, so those services see the
77
+ > visitor's IP address — and Gravatar additionally receives a hash of the email address you
78
+ > pass it, which is enough to correlate a person across every site that uses Gravatar. That is
79
+ > not a defect, it is what "resolve an avatar from Gravatar" means; but it is a decision worth
80
+ > making deliberately rather than discovering in a network tab. If you cannot send that data,
81
+ > use the custom image, initials or text sources, which never leave your own origin.
82
+
83
+
75
84
  Fallback uses a source priority order. By default, the component tries the supported sources in their configured order until one succeeds.
76
85
 
77
86
  > This project is a fork of [ngx-avatars](https://github.com/Heatmanofurioso/ngx-avatars), which itself continued the original avatar work. This package adapts and maintains the component for modern Angular applications.
@@ -47,10 +47,10 @@ class AvatarConfigService {
47
47
  return this.userConfig.disableSrcCache;
48
48
  }
49
49
  }
50
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarConfigService, deps: [{ token: AVATAR_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
51
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarConfigService, providedIn: 'root' });
50
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AvatarConfigService, deps: [{ token: AVATAR_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
51
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AvatarConfigService, providedIn: 'root' });
52
52
  }
53
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarConfigService, decorators: [{
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AvatarConfigService, decorators: [{
54
54
  type: Injectable,
55
55
  args: [{ providedIn: 'root' }]
56
56
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -156,10 +156,10 @@ class AvatarService {
156
156
  getSourcePriority(sourceType) {
157
157
  return this.avatarSources.indexOf(sourceType);
158
158
  }
159
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarService, deps: [{ token: i1.HttpClient }, { token: AvatarConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
160
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarService, providedIn: 'root' });
159
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AvatarService, deps: [{ token: i1.HttpClient }, { token: AvatarConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
160
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AvatarService, providedIn: 'root' });
161
161
  }
162
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarService, decorators: [{
162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AvatarService, decorators: [{
163
163
  type: Injectable,
164
164
  args: [{ providedIn: 'root' }]
165
165
  }], ctorParameters: () => [{ type: i1.HttpClient }, { type: AvatarConfigService }] });
@@ -357,10 +357,10 @@ class SourceFactory {
357
357
  newInstance(sourceType, sourceValue) {
358
358
  return new this.sources[sourceType](sourceValue);
359
359
  }
360
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: SourceFactory, deps: [{ token: AvatarConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
361
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: SourceFactory, providedIn: 'root' });
360
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SourceFactory, deps: [{ token: AvatarConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
361
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SourceFactory, providedIn: 'root' });
362
362
  }
363
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: SourceFactory, decorators: [{
363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SourceFactory, decorators: [{
364
364
  type: Injectable,
365
365
  args: [{ providedIn: 'root' }]
366
366
  }], ctorParameters: () => [{ type: AvatarConfigService }] });
@@ -767,8 +767,8 @@ class AvatarComponent {
767
767
  removeSource(sourceType) {
768
768
  this.sources = this.sources.filter((source) => source.sourceType !== sourceType);
769
769
  }
770
- 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 });
771
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: AvatarComponent, isStandalone: true, 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 }, interactive: { classPropertyName: "interactive", publicName: "interactive", 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 }, autoColor: { classPropertyName: "autoColor", publicName: "autoColor", 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-badge-color": "badgeColorVar()", "style.--hub-avatar-size": "avatarSizePx" } }, viewQueries: [{ propertyName: "customContentRef", first: true, predicate: ["customContent"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
770
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AvatarComponent, deps: [{ token: SourceFactory }, { token: AvatarService }, { token: i3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
771
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AvatarComponent, isStandalone: true, 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 }, interactive: { classPropertyName: "interactive", publicName: "interactive", 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 }, autoColor: { classPropertyName: "autoColor", publicName: "autoColor", 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-badge-color": "badgeColorVar()", "style.--hub-avatar-size": "avatarSizePx" } }, viewQueries: [{ propertyName: "customContentRef", first: true, predicate: ["customContent"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
772
772
  <div
773
773
  (click)="onAvatarClicked()"
774
774
  (keydown.enter)="onAvatarKeydown($event)"
@@ -813,7 +813,7 @@ class AvatarComponent {
813
813
  }
814
814
  `, 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, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", 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, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", 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, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", 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"] });
815
815
  }
816
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarComponent, decorators: [{
816
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AvatarComponent, decorators: [{
817
817
  type: Component,
818
818
  args: [{ selector: 'hub-avatar', standalone: true, template: `
819
819
  <div
@@ -892,11 +892,11 @@ class AvatarModule {
892
892
  ]
893
893
  };
894
894
  }
895
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
896
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.1", ngImport: i0, type: AvatarModule, imports: [AvatarComponent], exports: [AvatarComponent] });
897
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarModule });
895
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AvatarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
896
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AvatarModule, imports: [AvatarComponent], exports: [AvatarComponent] });
897
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AvatarModule });
898
898
  }
899
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: AvatarModule, decorators: [{
899
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AvatarModule, decorators: [{
900
900
  type: NgModule,
901
901
  args: [{
902
902
  imports: [AvatarComponent],
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.9.0",
4
+ "version": "22.9.2",
5
5
  "keywords": [
6
6
  "angular",
7
7
  "avatar",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,190 +0,0 @@
1
- // ─────────────────────────────────────────────────────────────────────────
2
- // ng-hub-ui-avatar — consumer SCSS helpers
3
- // ─────────────────────────────────────────────────────────────────────────
4
- //
5
- // @use 'ng-hub-ui-avatar/styles/mixins/avatar-theme' as avatar;
6
- //
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.
39
- //
40
- // @example
41
- // @include avatar.hub-avatar-color-variants(); // the 9 semantic
42
- // @include avatar.hub-avatar-color-variants(('brand': var(--brand))); // custom colour
43
- //
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.
68
- //
69
- // @example
70
- // hub-avatar.brand {
71
- // @include avatar.hub-avatar-theme(
72
- // $size: 64px, $bg: #ede9fe, $fg: #5b21b6, $badge-color: #f43f5e
73
- // );
74
- // }
75
- //
76
- // scss-docs-start hub-avatar-theme
77
- @mixin hub-avatar-theme(
78
- // ── Shape & surface ──
79
- $size: null,
80
- $border-radius: null,
81
- $border-width: null,
82
- $border-color: null,
83
- $bg: null,
84
- $fg: null,
85
- $object-fit: null,
86
- // ── Typography (initials) ──
87
- $font-family: null,
88
- $font-weight: null,
89
- $font-size: null,
90
- $text-transform: 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,
103
- // ── Stacked group ──
104
- $group-overlap: null,
105
- $group-ring-width: null,
106
- $group-ring-color: null
107
- ) {
108
- // Shape & surface
109
- @if $size != null {
110
- --hub-avatar-size: #{$size};
111
- }
112
- @if $border-radius != null {
113
- --hub-avatar-border-radius: #{$border-radius};
114
- }
115
- @if $border-width != null {
116
- --hub-avatar-border-width: #{$border-width};
117
- }
118
- @if $border-color != null {
119
- --hub-avatar-border-color: #{$border-color};
120
- }
121
- @if $bg != null {
122
- --hub-avatar-bg-color: #{$bg};
123
- }
124
- @if $fg != null {
125
- --hub-avatar-fg-color: #{$fg};
126
- }
127
- @if $object-fit != null {
128
- --hub-avatar-object-fit: #{$object-fit};
129
- }
130
-
131
- // Typography
132
- @if $font-family != null {
133
- --hub-avatar-font-family: #{$font-family};
134
- }
135
- @if $font-weight != null {
136
- --hub-avatar-font-weight: #{$font-weight};
137
- }
138
- @if $font-size != null {
139
- --hub-avatar-font-size: #{$font-size};
140
- }
141
- @if $text-transform != null {
142
- --hub-avatar-text-transform: #{$text-transform};
143
- }
144
-
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};
165
- }
166
- @if $badge-color != null {
167
- --hub-avatar-badge-color: #{$badge-color};
168
- }
169
- @if $badge-text-color != null {
170
- --hub-avatar-badge-text-color: #{$badge-text-color};
171
- }
172
- @if $badge-font-size != null {
173
- --hub-avatar-badge-font-size: #{$badge-font-size};
174
- }
175
- @if $badge-padding != null {
176
- --hub-avatar-badge-padding: #{$badge-padding};
177
- }
178
-
179
- // Stacked group
180
- @if $group-overlap != null {
181
- --hub-avatar-group-overlap: #{$group-overlap};
182
- }
183
- @if $group-ring-width != null {
184
- --hub-avatar-group-ring-width: #{$group-ring-width};
185
- }
186
- @if $group-ring-color != null {
187
- --hub-avatar-group-ring-color: #{$group-ring-color};
188
- }
189
- }
190
- // scss-docs-end hub-avatar-theme