Skip to content

feat(Error): add avatar and color props alongside icon - #36

Merged
IgorShevchik merged 2 commits into
mainfrom
feat/error-avatar-support
May 13, 2026
Merged

feat(Error): add avatar and color props alongside icon#36
IgorShevchik merged 2 commits into
mainfrom
feat/error-avatar-support

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Summary

Aligns B24Error with the canonical Embedded Avatar pattern documented in .github/contributing/component-structure.md (§Components with Embedded Avatar). The plain icon keeps precedence — avatar is the v-else-if fallback, same as Button, ChatMessage, Badge, Input, Select, Tabs, Countdown, PageCard, PageCardGroup.

  • Adds avatar?: AvatarProps (rendered only when icon is not set).
  • Adds color?: AvatarProps['color'] that tints the inner B24Avatar by default. Explicit avatar.color still wins, since v-bind="props.avatar" is applied after :color="props.color".
  • Theme exposes two new slots:
    • leadingAvatar (CSS classes)
    • leadingAvatarSize (value slot, base 'lg'). Error has no size variant, so the value lives in the slot base per the value-slot rule in .github/contributing/theme-structure.md.

Follow-up to #24 (Avatar/AvatarGroup color) and #40bdf842 (feat(Error): add icon prop and leading slot).

Test plan

  • pnpm run lint / pnpm run typecheck / pnpm run test pass
  • New renders with avatar correctly and renders with color and avatar correctly snapshots witness the cascade (default → style-outline-no-accent, air-primary-alertstyle-filled-alert)
  • Verify in docs page → Error → Avatar / Color sections that the cascade renders correctly
  • Verify explicit avatar.color overrides the cascade

🤖 Generated with Claude Code

IgorShevchik and others added 2 commits May 13, 2026 09:14
Brings `Error` in line with the canonical Embedded Avatar pattern
(see contributing/component-structure.md §Components with Embedded
Avatar). The plain icon path keeps precedence — `avatar` is the
`v-else-if` fallback. Adds `color?: AvatarProps['color']` that tints
the inner Avatar by default; an explicit `avatar.color` still wins,
since `v-bind="props.avatar"` is applied after `:color="props.color"`.

Theme exposes:
- `leadingAvatar` (CSS classes)
- `leadingAvatarSize` (value slot, base `'lg'` — Error has no `size`
  variant, so the value lives in the slot base per the value-slot rule
  in contributing/theme-structure.md)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@IgorShevchik
IgorShevchik merged commit 5f2df80 into main May 13, 2026
@IgorShevchik
IgorShevchik deleted the feat/error-avatar-support branch May 13, 2026 07:00
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