Skip to content

feat(User): add color prop forwarded to inner Avatar#27

Open
IgorShevchik wants to merge 3 commits into
mainfrom
feat/user-avatar-color
Open

feat(User): add color prop forwarded to inner Avatar#27
IgorShevchik wants to merge 3 commits into
mainfrom
feat/user-avatar-color

Conversation

@IgorShevchik
Copy link
Copy Markdown
Collaborator

Summary

  • Adds top-level color?: AvatarProps['color'] prop on B24User.
  • Forwards it as the default color to the inner B24Avatar (in both render branches — wrapped in B24Chip and standalone).
  • Explicit avatar.color still wins, since v-bind="props.avatar" is applied after :color="props.color". No theme change in src/theme/user.ts — the prop is a pure passthrough.

Follow-up to #24 (Avatar/AvatarGroup color prop) to cascade the color into User, mirroring the pattern from #23 (Breadcrumb) and #25 (PageCard/PageCardGroup).

Test plan

  • pnpm run lint passes
  • pnpm run typecheck passes (root + docs + both playgrounds)
  • pnpm run test passes — new renders with color correctly snapshot witnesses the cascade (style-filled for air-primary vs default style-outline-no-accent)
  • Open playgrounds/nuxt and playgrounds/demouser page, toggle the Color selector, verify the avatar visibly tints
  • Verify explicit avatar.color overrides the cascade (set :avatar="{ src: '...', color: 'air-primary-success' }" while color="air-primary-alert" on B24User — avatar should be success)

🤖 Generated with Claude Code

IgorShevchik and others added 3 commits May 13, 2026 10:06
Tints the inner `B24Avatar` by default. An explicit `avatar.color` still
wins, since `v-bind="props.avatar"` is applied after `:color="props.color"`.
No theme change in `user.ts` — the prop is a pure passthrough.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The User `color` prop is typed as `AvatarProps['color']`, which the docs
generator cannot auto-resolve into the palette list (resolution looks at
the host theme's own `variants.color`, which User does not declare).
Spell the palette out via `items.color` in the Color section so the
playground renders the full color selector. Mirrors the same fix on
`Error` (`275c8b0b docs(Error): update color list`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Picks up upstream snapshot drift from `c00d2c42 test: update snapshots`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@IgorShevchik IgorShevchik force-pushed the feat/user-avatar-color branch from fc8eeda to 0bd38b4 Compare May 13, 2026 07:06
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