feat(Error): add avatar and color props alongside icon - #36
Merged
Conversation
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>
2 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Aligns
B24Errorwith the canonical Embedded Avatar pattern documented in.github/contributing/component-structure.md(§Components with Embedded Avatar). The plainiconkeeps precedence —avataris thev-else-iffallback, same asButton,ChatMessage,Badge,Input,Select,Tabs,Countdown,PageCard,PageCardGroup.avatar?: AvatarProps(rendered only wheniconis not set).color?: AvatarProps['color']that tints the innerB24Avatarby default. Explicitavatar.colorstill wins, sincev-bind="props.avatar"is applied after:color="props.color".leadingAvatar(CSS classes)leadingAvatarSize(value slot, base'lg'). Error has nosizevariant, 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 testpassrenders with avatar correctlyandrenders with color and avatar correctlysnapshots witness the cascade (default →style-outline-no-accent,air-primary-alert→style-filled-alert)avatar.coloroverrides the cascade🤖 Generated with Claude Code