From f202c371bc03b2ffb294b6a58d6b767cfac73e77 Mon Sep 17 00:00:00 2001 From: Alex Carpenter Date: Fri, 11 Sep 2026 15:27:29 -0400 Subject: [PATCH] feat(ui): resize the Mosaic Avatar scale and key square radius off size --- .changeset/mosaic-avatar-sizing.md | 2 + packages/swingset/src/stories/avatar.mdx | 2 +- .../swingset/src/stories/avatar.stories.tsx | 6 +-- .../mosaic/components/avatar/avatar.styles.ts | 40 +++++++++++++++---- .../src/mosaic/components/avatar/avatar.tsx | 2 +- packages/ui/src/mosaic/tokens.stylex.ts | 4 +- 6 files changed, 41 insertions(+), 15 deletions(-) create mode 100644 .changeset/mosaic-avatar-sizing.md diff --git a/.changeset/mosaic-avatar-sizing.md b/.changeset/mosaic-avatar-sizing.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/mosaic-avatar-sizing.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/swingset/src/stories/avatar.mdx b/packages/swingset/src/stories/avatar.mdx index d9f3b1f1fb4..9deae63120c 100644 --- a/packages/swingset/src/stories/avatar.mdx +++ b/packages/swingset/src/stories/avatar.mdx @@ -58,7 +58,7 @@ While an image is still resolving, the fallback carries `data-pending` and pulse ### Interactive -Use `render` to compose the avatar onto a button or another trigger without introducing a separate wrapper component. The `xl` avatar and button are both 48×48. +Use `render` to compose the avatar onto a button or another trigger without introducing a separate wrapper component. The `lg` avatar and button are both 48×48. ) { return ( ) { export function Sizes(props: Record) { return (
- {(['xs', 'sm', 'md', 'lg', 'xl'] as const).map(size => ( + {(['xs', 'sm', 'md', 'lg'] as const).map(size => ( { shape?: 'circle' | 'square'; - size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'fit'; + size?: 'xs' | 'sm' | 'md' | 'lg' | 'fit'; } const AvatarRoot = React.forwardRef(function MosaicAvatarRoot( diff --git a/packages/ui/src/mosaic/tokens.stylex.ts b/packages/ui/src/mosaic/tokens.stylex.ts index 75dccbfb798..d30e5f57f79 100644 --- a/packages/ui/src/mosaic/tokens.stylex.ts +++ b/packages/ui/src/mosaic/tokens.stylex.ts @@ -63,8 +63,8 @@ export const colorVars = stylex.defineVars(colorDefaults); // ============================================================================= // Radius Tokens // ============================================================================= -// `md` is 6px rather than a 4/8/12 step: it is the control radius (button, avatar -// square), and neither neighbour sits right on a control. +// `md` is 6px rather than a 4/8/12 step: it is the control radius (button), and +// neither neighbour sits right on a control. const radiusDefaults = { '--cl-radius-none': '0rem',