@c2n/avatar 0.0.9 → 0.0.10

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
@@ -1,6 +1,6 @@
1
1
  # @c2n/avatar
2
2
 
3
- Avatar built with Lit: image, initials or any slotted content, with an optional status dot or badge.
3
+ Avatar components built with Lit: `c2-avatar` renders an image, initials or slotted content, while `c2-avatar-group` creates a responsive overlapping stack with an automatic overflow count.
4
4
 
5
5
  ```bash
6
6
  npm install @c2n/avatar
@@ -15,6 +15,13 @@ npm install @c2n/avatar
15
15
  <c2-avatar name="Ada Lovelace" src="/ada.jpg" status="online"></c2-avatar>
16
16
  <c2-avatar name="Ada Lovelace" auto-color initial-count="2"></c2-avatar>
17
17
  <c2-avatar name="Ada Lovelace" src="/ada.jpg" editable></c2-avatar>
18
+
19
+ <c2-avatar-group aria-label="Contributors" style="--c2-avatar-group--max-width: 160px">
20
+ <c2-avatar auto-color name="Ada Lovelace"></c2-avatar>
21
+ <c2-avatar auto-color name="Grace Hopper"></c2-avatar>
22
+ <c2-avatar auto-color name="Alan Turing"></c2-avatar>
23
+ <c2-avatar auto-color name="Katherine Johnson"></c2-avatar>
24
+ </c2-avatar-group>
18
25
  ```
19
26
 
20
27
  - **Content resolution**: the `src` image first (a failed load fires `error` and falls back to the initials), then slotted content (an icon, an emoji, an `<img>`), then the initials computed from `name`. `initial-count="2"` uses the first and last word of a longer name; `initials` overrides the computation.
@@ -24,4 +31,4 @@ npm install @c2n/avatar
24
31
  - **Accessibility**: the avatar is `role="img"` labelled by `alt` or `name`.
25
32
  - **Editing**: `editable` lets the user choose, replace, and remove an image. Listen for `avatar-change` to upload its `detail.file`, and `avatar-remove` to delete the persisted image. The component immediately displays a local preview; use `accept` and `max-size` for client-side validation.
26
33
 
27
- Every visual aspect is a CSS custom property (`--c2-avatar--*`, `--c2-avatar__badge--*`, `--c2-avatar__image--*`). For stacked groups give each avatar `--c2-avatar--box-shadow: 0 0 0 2px <page background>` and a negative margin. The full list is in `custom-elements.json` and on the docs site.
34
+ Every visual aspect is a CSS custom property (`--c2-avatar--*`, `--c2-avatar-group--*`, `--c2-avatar__badge--*`, `--c2-avatar__image--*`). The full list is in `custom-elements.json` and on the docs site.
package/dist/avatar.js CHANGED
@@ -14,6 +14,141 @@ function __decorate(decorators, target, key, desc) {
14
14
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15
15
  }
16
16
  //#endregion
17
+ //#region src/avatar-group.scss?inline
18
+ var avatar_group_default = "/* ex : var((width: 24px), width, c2-checkbox) returns var(--c2-checkbox-width, 24px) */\n:host {\n display: flex;\n box-sizing: border-box;\n width: 100%;\n max-width: var(--c2-avatar-group--max-width,320px);\n min-width: 0;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.group,\nslot {\n display: flex;\n align-items: center;\n min-width: 0;\n}\n\n.group {\n width: 100%;\n overflow: hidden;\n}\n\nslot {\n flex: none;\n padding-inline-start: var(--c2-avatar-group--overlap,10px);\n}\n\n::slotted(c2-avatar) {\n flex: none;\n margin-inline-start: calc(-1 * var(--c2-avatar-group--overlap,10px));\n --c2-avatar--box-shadow: var(--c2-avatar-group__avatar--box-shadow,0 0 0 2px #ffffff);\n}\n\n::slotted([data-c2-avatar-group-hidden]) {\n display: none;\n}\n\n.overflow {\n position: relative;\n z-index: 1;\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--c2-avatar-group__overflow--size,32px);\n height: var(--c2-avatar-group__overflow--size,32px);\n margin-inline-start: calc(-1 * var(--c2-avatar-group--overlap,10px));\n border: var(--c2-avatar-group__overflow--border,2px solid #ffffff);\n border-radius: var(--c2-avatar-group__overflow--border-radius,999px);\n background: var(--c2-avatar-group__overflow--background,#52525b);\n color: var(--c2-avatar-group__overflow--color,#ffffff);\n font-size: var(--c2-avatar-group__overflow--font-size,12px);\n font-weight: var(--c2-avatar-group__overflow--font-weight,600);\n line-height: 1;\n white-space: nowrap;\n}\n\n.overflow[data-empty] {\n position: absolute;\n visibility: hidden;\n pointer-events: none;\n}";
19
+ //#endregion
20
+ //#region src/avatar-group.ts
21
+ var HIDDEN_ATTRIBUTE = "data-c2-avatar-group-hidden";
22
+ var AvatarGroup = class AvatarGroup extends LitElement {
23
+ constructor(..._args) {
24
+ super(..._args);
25
+ this.maxVisible = 0;
26
+ this.countMode = "hidden";
27
+ this.ariaLabel = "Avatar group";
28
+ this.renderedVisibleCount = 0;
29
+ this.renderedTotalCount = 0;
30
+ this.measureFrame = 0;
31
+ }
32
+ static {
33
+ this.styles = unsafeCSS(avatar_group_default);
34
+ }
35
+ /** Current number of slotted avatars. */
36
+ get total() {
37
+ return this.renderedTotalCount;
38
+ }
39
+ /** Current number of visible avatars. */
40
+ get visible() {
41
+ return this.renderedVisibleCount;
42
+ }
43
+ /** Current number of avatars represented by the overflow count. */
44
+ get hiddenCount() {
45
+ return Math.max(0, this.total - this.visible);
46
+ }
47
+ firstUpdated() {
48
+ if (typeof ResizeObserver === "undefined") return;
49
+ this.resizeObserver = new ResizeObserver(() => this.scheduleMeasure());
50
+ this.resizeObserver.observe(this);
51
+ this.scheduleMeasure();
52
+ }
53
+ updated(changed) {
54
+ if (changed.has("maxVisible")) this.scheduleMeasure();
55
+ }
56
+ disconnectedCallback() {
57
+ super.disconnectedCallback();
58
+ this.resizeObserver?.disconnect();
59
+ cancelAnimationFrame(this.measureFrame);
60
+ this.avatarItems.forEach((item) => item.removeAttribute(HIDDEN_ATTRIBUTE));
61
+ }
62
+ get avatarItems() {
63
+ if (!this.slotElement) return [];
64
+ return this.slotElement.assignedElements({ flatten: true }).filter((element) => element instanceof HTMLElement && element.localName === "c2-avatar");
65
+ }
66
+ handleSlotChange() {
67
+ this.scheduleMeasure();
68
+ }
69
+ /** Recalculates the responsive limit after application code changes a slotted avatar's dimensions. */
70
+ refresh() {
71
+ this.scheduleMeasure();
72
+ }
73
+ scheduleMeasure() {
74
+ cancelAnimationFrame(this.measureFrame);
75
+ this.measureFrame = requestAnimationFrame(() => this.measure());
76
+ }
77
+ measure() {
78
+ const items = this.avatarItems;
79
+ items.forEach((item) => item.removeAttribute(HIDDEN_ATTRIBUTE));
80
+ const total = items.length;
81
+ const available = this.getBoundingClientRect().width;
82
+ if (!available || !total) {
83
+ this.commitCounts(total, total);
84
+ return;
85
+ }
86
+ const styles = getComputedStyle(this);
87
+ const configuredOverlap = Number.parseFloat(styles.getPropertyValue("--c2-avatar-group--overlap"));
88
+ const overlap = Number.isFinite(configuredOverlap) ? Math.max(0, configuredOverlap) : 10;
89
+ const widths = items.map((item) => item.getBoundingClientRect().width);
90
+ const hardLimit = this.maxVisible > 0 ? Math.min(total, Math.floor(this.maxVisible)) : total;
91
+ const avatarsWidth = (count) => widths.slice(0, count).reduce((sum, width) => sum + width, 0) - Math.max(0, count - 1) * overlap;
92
+ const allAllowedFit = hardLimit === total && avatarsWidth(total) <= available;
93
+ let visible = total;
94
+ if (!allAllowedFit) {
95
+ const overflow = this.renderRoot.querySelector(".overflow")?.getBoundingClientRect().width ?? 0;
96
+ visible = 0;
97
+ for (let count = 0; count <= hardLimit; count += 1) if (avatarsWidth(count) + overflow - (count > 0 ? overlap : 0) <= available) visible = count;
98
+ else break;
99
+ }
100
+ items.forEach((item, index) => item.toggleAttribute(HIDDEN_ATTRIBUTE, index >= visible));
101
+ this.commitCounts(total, visible);
102
+ }
103
+ commitCounts(total, visible) {
104
+ if (total === this.renderedTotalCount && visible === this.renderedVisibleCount) return;
105
+ this.renderedTotalCount = total;
106
+ this.renderedVisibleCount = visible;
107
+ const detail = {
108
+ total,
109
+ visible,
110
+ hidden: Math.max(0, total - visible)
111
+ };
112
+ this.dispatchEvent(new CustomEvent("overflow-change", {
113
+ detail,
114
+ bubbles: true,
115
+ composed: true
116
+ }));
117
+ }
118
+ render() {
119
+ const hidden = this.hiddenCount;
120
+ const count = this.countMode === "total" ? this.total : hidden;
121
+ const label = this.countMode === "total" ? `${this.total} avatars total` : `${hidden} more avatar${hidden === 1 ? "" : "s"}`;
122
+ return html`
123
+ <div class="group" role="group" aria-label=${this.ariaLabel || nothing}>
124
+ <slot @slotchange=${this.handleSlotChange}></slot>
125
+ <span
126
+ class="overflow"
127
+ part="overflow"
128
+ ?data-empty=${hidden === 0}
129
+ aria-hidden=${hidden === 0 ? "true" : nothing}
130
+ aria-label=${hidden ? label : nothing}
131
+ >
132
+ ${this.countMode === "hidden" ? "+" : ""}${count}
133
+ </span>
134
+ </div>
135
+ `;
136
+ }
137
+ };
138
+ __decorate([property({
139
+ type: Number,
140
+ attribute: "max-visible"
141
+ })], AvatarGroup.prototype, "maxVisible", void 0);
142
+ __decorate([property({
143
+ reflect: true,
144
+ attribute: "count-mode"
145
+ })], AvatarGroup.prototype, "countMode", void 0);
146
+ __decorate([property({ attribute: "aria-label" })], AvatarGroup.prototype, "ariaLabel", void 0);
147
+ __decorate([state()], AvatarGroup.prototype, "renderedVisibleCount", void 0);
148
+ __decorate([state()], AvatarGroup.prototype, "renderedTotalCount", void 0);
149
+ __decorate([query("slot")], AvatarGroup.prototype, "slotElement", void 0);
150
+ AvatarGroup = __decorate([customElement("c2-avatar-group")], AvatarGroup);
151
+ //#endregion
17
152
  //#region src/avatar.ts
18
153
  var LEGACY_COUNT_ATTRIBUTE = "initialcount";
19
154
  var Avatar = class Avatar extends LitElement {
@@ -254,4 +389,4 @@ __decorate([state()], Avatar.prototype, "previewUrl", void 0);
254
389
  __decorate([query("input", true)], Avatar.prototype, "input", void 0);
255
390
  Avatar = __decorate([customElement("c2-avatar")], Avatar);
256
391
  //#endregion
257
- export { Avatar };
392
+ export { Avatar, AvatarGroup };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c2n/avatar",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "main": "dist/avatar.js",
6
6
  "exports": {
@@ -61,12 +61,12 @@
61
61
  }
62
62
  },
63
63
  "dependencies": {
64
- "@c2n/core": "0.0.9",
64
+ "@c2n/core": "0.0.10",
65
65
  "lit": "3.3.3"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@c2n/config": "*"
69
69
  },
70
70
  "customElements": "custom-elements.json",
71
- "gitHead": "e4768cce5e0fbd5bc3165cd493a1e8d57cf0fff4"
71
+ "gitHead": "8d57710b3345fcb01cdb4cb15d2d43ba8bf21642"
72
72
  }
package/react.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  // attribute and it stringifies.
9
9
 
10
10
  import type { DetailedHTMLProps, HTMLAttributes } from 'react'
11
- import type { Avatar } from '@c2n/avatar'
11
+ import type { Avatar, AvatarGroup } from '@c2n/avatar'
12
12
 
13
13
  /** Standard React host-element attributes plus the element's own public properties. */
14
14
  type C2Props<T> = DetailedHTMLProps<HTMLAttributes<T>, T> & Partial<Omit<T, keyof HTMLElement>>
@@ -17,6 +17,7 @@ declare module 'react' {
17
17
  namespace JSX {
18
18
  interface IntrinsicElements {
19
19
  'c2-avatar': C2Props<Avatar>
20
+ 'c2-avatar-group': C2Props<AvatarGroup>
20
21
  }
21
22
  }
22
23
  }
@@ -0,0 +1,78 @@
1
+ import { LitElement, type PropertyValues } from 'lit';
2
+ import type { TypedAddEventListener, TypedRemoveEventListener } from '@c2n/core/event-helper.js';
3
+ export type AvatarGroupCountMode = 'hidden' | 'total';
4
+ export interface AvatarGroupOverflowDetail {
5
+ total: number;
6
+ visible: number;
7
+ hidden: number;
8
+ }
9
+ export interface AvatarGroupEventMap {
10
+ 'overflow-change': CustomEvent<AvatarGroupOverflowDetail>;
11
+ }
12
+ export interface AvatarGroup {
13
+ addEventListener: TypedAddEventListener<AvatarGroup, AvatarGroupEventMap>;
14
+ removeEventListener: TypedRemoveEventListener<AvatarGroup, AvatarGroupEventMap>;
15
+ }
16
+ /**
17
+ * Responsive stack of `c2-avatar` elements. It observes its rendered width and each avatar's actual size, then hides
18
+ * the avatars that no longer fit and replaces them with a count. The host fills the available inline space up to
19
+ * `--c2-avatar-group--max-width`, so it also reacts when its parent becomes narrower.
20
+ *
21
+ * @tag c2-avatar-group
22
+ *
23
+ * @slotcomponent c2-avatar
24
+ *
25
+ * @slot - `c2-avatar` elements displayed in source order.
26
+ *
27
+ * @event {CustomEvent<AvatarGroupOverflowDetail>} overflow-change - Fired when resizing changes the visible or hidden counts.
28
+ *
29
+ * @csspart overflow - Count shown after the visible avatars.
30
+ *
31
+ * @cssproperty {pixel} [--c2-avatar-group--max-width=320px] - Maximum responsive width of the group.
32
+ * @cssproperty {pixel} [--c2-avatar-group--overlap=10px] - Amount that adjacent avatars overlap.
33
+ * @cssproperty {box-shadow} [--c2-avatar-group__avatar--box-shadow=0 0 0 2px #ffffff] - Ring applied to slotted avatars so overlaps stay distinct.
34
+ * @cssproperty {pixel} [--c2-avatar-group__overflow--size=32px] - Width and height of the overflow count.
35
+ * @cssproperty {color} [--c2-avatar-group__overflow--background=#52525b] - Overflow count background.
36
+ * @cssproperty {color} [--c2-avatar-group__overflow--color=#ffffff] - Overflow count text colour.
37
+ * @cssproperty {border} [--c2-avatar-group__overflow--border=2px solid #ffffff] - Ring around the overflow count.
38
+ * @cssproperty {border-radius} [--c2-avatar-group__overflow--border-radius=999px] - Overflow count corner radius.
39
+ * @cssproperty {font-size} [--c2-avatar-group__overflow--font-size=12px] - Overflow count text size.
40
+ * @cssproperty {font-weight} [--c2-avatar-group__overflow--font-weight=600] - Overflow count text weight.
41
+ */
42
+ export declare class AvatarGroup extends LitElement {
43
+ static styles: import("lit").CSSResult;
44
+ /** Optional hard cap in addition to the automatically calculated responsive limit. Zero means no hard cap. */
45
+ maxVisible: number;
46
+ /** Whether the overflow indicator shows `+hidden` or the total number of avatars. */
47
+ countMode: AvatarGroupCountMode;
48
+ /** Accessible name for the group. */
49
+ ariaLabel: string;
50
+ private renderedVisibleCount;
51
+ private renderedTotalCount;
52
+ private slotElement;
53
+ private resizeObserver?;
54
+ private measureFrame;
55
+ /** Current number of slotted avatars. */
56
+ get total(): number;
57
+ /** Current number of visible avatars. */
58
+ get visible(): number;
59
+ /** Current number of avatars represented by the overflow count. */
60
+ get hiddenCount(): number;
61
+ protected firstUpdated(): void;
62
+ protected updated(changed: PropertyValues<this>): void;
63
+ disconnectedCallback(): void;
64
+ private get avatarItems();
65
+ private handleSlotChange;
66
+ /** Recalculates the responsive limit after application code changes a slotted avatar's dimensions. */
67
+ refresh(): void;
68
+ private scheduleMeasure;
69
+ private measure;
70
+ private commitCounts;
71
+ render(): import("lit-html").TemplateResult<1>;
72
+ }
73
+ declare global {
74
+ interface HTMLElementTagNameMap {
75
+ 'c2-avatar-group': AvatarGroup;
76
+ }
77
+ }
78
+ //# sourceMappingURL=avatar-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar-group.d.ts","sourceRoot":"","sources":["../../src/avatar-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4B,KAAK,cAAc,EAAE,MAAM,KAAK,CAAA;AAG/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AAGhG,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,OAAO,CAAA;AAErD,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,EAAE,WAAW,CAAC,yBAAyB,CAAC,CAAA;CAC1D;AAED,MAAM,WAAW,WAAW;IAC1B,gBAAgB,EAAE,qBAAqB,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAA;IACzE,mBAAmB,EAAE,wBAAwB,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAA;CAChF;AAID;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBACa,WAAY,SAAQ,UAAU;IACzC,OAAgB,MAAM,0BAAoB;IAE1C,8GAA8G;IACxD,UAAU,SAAI;IAEpE,qFAAqF;IAC/B,SAAS,EAAE,oBAAoB,CAAW;IAEhG,qCAAqC;IACW,SAAS,SAAiB;IAEjE,OAAO,CAAC,oBAAoB,CAAI;IAChC,OAAO,CAAC,kBAAkB,CAAI;IACxB,OAAO,CAAC,WAAW,CAAkB;IAEpD,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,OAAO,CAAC,YAAY,CAAI;IAExB,yCAAyC;IACzC,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,yCAAyC;IACzC,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,mEAAmE;IACnE,IAAI,WAAW,IAAI,MAAM,CAExB;cAEkB,YAAY,IAAI,IAAI;cAOpB,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAItD,oBAAoB,IAAI,IAAI;IAOrC,OAAO,KAAK,WAAW,GAKtB;IAED,OAAO,CAAC,gBAAgB;IAIxB,sGAAsG;IACtG,OAAO,IAAI,IAAI;IAIf,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,OAAO;IAkCf,OAAO,CAAC,YAAY;IAQX,MAAM;CAoBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,WAAW,CAAA;KAC/B;CACF"}
@@ -146,4 +146,5 @@ declare global {
146
146
  'c2-avatar': Avatar;
147
147
  }
148
148
  }
149
+ export { AvatarGroup, type AvatarGroupCountMode, type AvatarGroupOverflowDetail } from './avatar-group';
149
150
  //# sourceMappingURL=avatar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/avatar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4B,KAAK,cAAc,EAAE,MAAM,KAAK,CAAA;AAG/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AAKhG,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,G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8
8
  // nothing: template.compilerOptions.isCustomElement = (tag) => tag.startsWith('c2-') in vite.config.ts.
9
9
 
10
10
  import type { DefineComponent, HTMLAttributes } from 'vue'
11
- import type { Avatar, AvatarEventMap } from '@c2n/avatar'
11
+ import type { Avatar, AvatarEventMap, AvatarGroup, AvatarGroupEventMap } from '@c2n/avatar'
12
12
 
13
13
  /** The element's own public properties, plus every attribute Vue understands on a host element. */
14
14
  type C2Props<T> = Partial<Omit<T, keyof HTMLElement>> & HTMLAttributes
@@ -26,6 +26,14 @@ declare module 'vue' {
26
26
  onAvatarChange?: (event: AvatarEventMap['avatar-change']) => void
27
27
  }
28
28
  >
29
+ 'c2-avatar-group': DefineComponent<
30
+ C2Props<AvatarGroup> & {
31
+ 'max-visible'?: unknown
32
+ 'count-mode'?: unknown
33
+ 'aria-label'?: unknown
34
+ onOverflowChange?: (event: AvatarGroupEventMap['overflow-change']) => void
35
+ }
36
+ >
29
37
  }
30
38
  }
31
39