Skip to content

feat(PageCard/PageCardGroup): add avatar prop with Button.vue pattern#25

Merged
IgorShevchik merged 1 commit into
mainfrom
feat/pagecardgroup-avatar-color
May 11, 2026
Merged

feat(PageCard/PageCardGroup): add avatar prop with Button.vue pattern#25
IgorShevchik merged 1 commit into
mainfrom
feat/pagecardgroup-avatar-color

Conversation

@IgorShevchik
Copy link
Copy Markdown
Collaborator

Summary

  • PageCard gains an avatar prop — renders B24Avatar in the leading slot; top-level icon keeps precedence (mirrors Button.vue). Theme adds leadingAvatar + leadingAvatarSize slots.
  • PageCardGroup items accept a full avatar config (color, src, chip, icon) plus a group-level :avatar umbrella default; per-item avatar.color merges over the group default. Plain top-level icon still works and now scales with size via new leadingIcon size variants.
  • Avatar/icon sizing per size: sm → 28px, md → 32px, lg → 42px. Bug fix: previous 'xl' base for leadingAvatarSize concatenated with size-variant value into an invalid 'xl xl' Avatar size and collapsed the avatar to 0×0.
  • Docs: new "Icon vs Avatar" section, dedicated PageCardGroupAvatarExample per-item palette demo, "Custom leading icon" repositioned as the escape hatch.
  • Playgrounds (demo + nuxt): split per-item-palette and group-avatar-color controls so toggling either actually re-renders (per-item color wins on merge — disables the group picker when the palette is on); static showcases for per-item palette, group-level avatar color, plain-icon mode.
  • Skill recipe (card-pickers) updated for icon-vs-avatar choice and merge rules.

Test plan

  • vitest run — 212 files / 4852 tests pass
  • nuxt typecheck clean for docs, playgrounds/demo, playgrounds/nuxt
  • eslint clean on changed files
  • Inline snapshot test verified avatar renders with correct size class (size-7/size-8/size-10.5) per group size
  • Inline snapshot test verified plain-icon path renders with synced size (size-7/size-8/size-10) per group size
  • Visual smoke in playgrounds — toggle Avatar mode, Item palette, Group avatar color; verify both the palette and group-color paths actually update the rendered grid

🤖 Generated with Claude Code

- PageCard: new `avatar` prop renders B24Avatar in the leading slot; top-level
  `icon` keeps precedence (mirrors Button.vue behaviour). Theme gains
  `leadingAvatar` + `leadingAvatarSize` slots.
- PageCardGroup: item gets per-item `avatar` config (full AvatarProps) plus a
  group-level `:avatar` umbrella default; per-item `avatar.color` merges over
  the group. Plain `icon` field still works and now scales with the group
  `size` via the new `leadingIcon` size variants.
- Size mapping (PageCardGroup → Avatar / leadingIcon): sm→sm (28px), md→md
  (32px), lg→lg (42px). Base `leadingAvatarSize` slot left empty so the size
  variant value is forwarded verbatim — previous `'xl'` base concatenated
  with the variant value into an invalid `'xl xl'` Avatar size, collapsing
  the avatar to 0×0.
- Docs: new "Icon vs Avatar" section, dedicated `PageCardGroupAvatarExample`
  per-item palette demo, "Custom leading icon" repositioned as the escape
  hatch beyond Avatar.
- Playgrounds (demo + nuxt): split palette and group-color controls so
  toggling either actually re-renders (per-item `avatar.color` wins on
  merge — disable the group-color picker when the item palette is on); add
  static showcases for per-item palette, group-level avatar color and the
  plain-icon mode.
- Skill recipe (card-pickers): document the icon-vs-avatar choice and the
  new merging rules.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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