Skip to content

feat: Add AvatarGroup#1050

Closed
pawelgrimm wants to merge 16 commits into
pawel/avatar-component-apifrom
pawel/feat/avatar-group-pair
Closed

feat: Add AvatarGroup#1050
pawelgrimm wants to merge 16 commits into
pawel/avatar-component-apifrom
pawel/feat/avatar-group-pair

Conversation

@pawelgrimm
Copy link
Copy Markdown
Contributor

Short description

Adds AvatarGroup and AvatarPair components for overlapping avatar collections, including polymorphic roots, exact pair child typing, an accessible decorative group count overlay, and circle/rounded clipping masks.

Documents the APIs in the Avatar docs and adds dedicated Storybook stories for group/pair variants and visual regression coverage.

PR Checklist

  • Added tests for bugs / new features
  • Updated docs (storybooks, readme)
  • Reviewed and approved Chromatic visual regression tests in CI

pawelgrimm and others added 16 commits May 27, 2026 13:52
Replace ::after pseudo with a real span so the count is in the DOM
(better SR support, queryable in tests). Drop data-count attribute;
use class-based selectors. Visual now reads "+N" instead of bare N.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds describe('a11y') blocks for AvatarGroup and AvatarPair, mirroring
Avatar's existing coverage as required by the per-component a11y
convention.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- AvatarPair JSDoc spells out "exactly two children" and the foreground
  vs. overlay roles
- mdx mirrors that, notes the count renders as +N, and points consumers
  at aria-label on the group root when it's a labeled entity
- corrects stale --reactist-avatar-pair-rounded-radius default (4px → 5px)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Tighten getContributor / getWorkspaceName return types and extract the
workspace helper so callers don't need ! everywhere.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Count "+N" overlay is purely visual; mark aria-hidden so screen readers
don't announce the literal "+3" after the named avatars. Group-level
aria-label remains the way to convey count semantically.
Tighten children type to readonly [ReactElement, ReactElement]. Catches
both wrong-count and conditional-false cases that would otherwise break
the :first-child/:last-child positioning rules.
The overlay is a sibling of the avatars and inherits the sibling mask
that visually notches each avatar onto the previous one. Suppress it on
.avatarGroupCount directly instead of via :nth-child(2), so the rule
holds regardless of how many avatars the group contains.
Used by both AvatarGroup and AvatarPair; the group-specific name was
misleading.
count is number | undefined; the explicit != null guard was redundant
with the > 0 check.
The count is rendered as a separate +N sibling, not "represented by the
final avatar" as the previous JSDoc suggested. Also notes that the
overlay is aria-hidden.
@pawelgrimm pawelgrimm changed the title Add AvatarGroup and AvatarPair feat: Add AvatarGroup May 28, 2026
@pawelgrimm
Copy link
Copy Markdown
Contributor Author

Superseded by #1051, which uses the AvatarGroup-only branch pawel/feat/avatar-group.

@pawelgrimm pawelgrimm closed this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant