You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR migrates the UserAvatar component from carbon-for-ibm-products into @carbon/web-components, continuing the migration strategy established in #22936 and defined in ADR-0007. The component is added as pre-release / feature-flagged work — excluded from the v11 published build and v11 Storybook, and available exclusively in the v12 Storybook until the next major release.
The component ships with:
LitElement class (user-avatar.ts) with full property reflection and TypeScript types
Component styles (user-avatar.scss) scoped to :host()
Storybook stories (user-avatar.stories.ts) with CSF3 format and controls
MDX docs page (user-avatar.mdx)
Unit tests (__tests__/user-avatar-test.js) using @open-wc/testing
index.ts for element registration
Story assets (_story-assets/headshot.jpg) for image demos
Changelog
New
cds-user-avatar — displays a user avatar with support for profile image, name initials (derived from full name or explicit initials), and a fallback icon. Supports configurable size, background-color, tooltip-text, and tooltip-alignment props. Migrated from @carbon/ibm-products.
packages/web-components/src/components/user-avatar/ — full component directory with user-avatar.ts, user-avatar.scss, user-avatar.stories.ts, user-avatar.mdx, index.ts, story-styles.scss, __tests__/user-avatar-test.js, and _story-assets/headshot.jpg
Changed
packages/web-components/product-migrated-components.mjs — updated to include cds-user-avatar story and MDX globs for v11/v12 Storybook gating and build exclusion
packages/web-components/src/index.ts — export for cds-user-avatar added (commented out until graduation to stable release)
Testing / Reviewing
v11 Storybook — run yarn storybook in packages/web-components. Confirm UserAvatar does not appear in the sidebar.
v12 Storybook — run yarn storybook:v12 in packages/web-components. Confirm UserAvatar appears under its category with working controls (size, background color, image, name, tooltip), no console errors, and correct MDX docs.
Unit tests — run yarn test in packages/web-components. All tests in src/components/user-avatar/__tests__/user-avatar-test.js should pass.
PR Checklist
As the author of this PR, before marking ready for review, confirm you:
Reviewed every line of the diff
Updated documentation and storybook examples
Followed the required v12 migration documentation
for any code change that affects v12, or struck through this item because
the PR does not affect v12
Wrote passing tests that cover this change
Addressed any impact on accessibility (a11y)
Tested for cross-browser consistency
Validated that this code is ready for review and status checks should pass
❌ Patch coverage is 90.43444% with 240 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.52%. Comparing base (bb09811) to head (440e038). ⚠️ Report is 3 commits behind head on main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #22949
DO NOT MERGE UNTIL PR 22936 IS MERGED
This PR migrates the
UserAvatarcomponent fromcarbon-for-ibm-productsinto@carbon/web-components, continuing the migration strategy established in #22936 and defined in ADR-0007. The component is added as pre-release / feature-flagged work — excluded from the v11 published build and v11 Storybook, and available exclusively in the v12 Storybook until the next major release.The component ships with:
user-avatar.ts) with full property reflection and TypeScript typesuser-avatar.scss) scoped to:host()user-avatar.stories.ts) with CSF3 format and controlsuser-avatar.mdx)__tests__/user-avatar-test.js) using@open-wc/testingindex.tsfor element registration_story-assets/headshot.jpg) for image demosChangelog
New
cds-user-avatar— displays a user avatar with support for profile image, name initials (derived from full name or explicit initials), and a fallback icon. Supports configurablesize,background-color,tooltip-text, andtooltip-alignmentprops. Migrated from@carbon/ibm-products.packages/web-components/src/components/user-avatar/— full component directory withuser-avatar.ts,user-avatar.scss,user-avatar.stories.ts,user-avatar.mdx,index.ts,story-styles.scss,__tests__/user-avatar-test.js, and_story-assets/headshot.jpgChanged
packages/web-components/product-migrated-components.mjs— updated to includecds-user-avatarstory and MDX globs for v11/v12 Storybook gating and build exclusionpackages/web-components/src/index.ts— export forcds-user-avataradded (commented out until graduation to stable release)Testing / Reviewing
yarn storybookinpackages/web-components. ConfirmUserAvatardoes not appear in the sidebar.yarn storybook:v12inpackages/web-components. ConfirmUserAvatarappears under its category with working controls (size, background color, image, name, tooltip), no console errors, and correct MDX docs.yarn testinpackages/web-components. All tests insrc/components/user-avatar/__tests__/user-avatar-test.jsshould pass.PR Checklist
As the author of this PR, before marking ready for review, confirm you:
required v12 migration documentation
for any code change that affects v12, or struck through this item because
the PR does not affect v12
More details can be found in the pull request guide